From bba1c231ca33f816863d2dc25b9ba252975632b6 Mon Sep 17 00:00:00 2001 From: Szymon Tondowski Date: Wed, 6 Aug 2025 17:00:53 +0200 Subject: [PATCH] RFL-122 Additional classNames for Axiom components --- about/images/CONTRIBUTING.md | 2 +- packages/ui/src/components/avatar/avatar.tsx | 15 +- .../ui/src/components/checkbox/checkbox.tsx | 7 +- .../collapsible/collapsible.module.css | 2 +- .../components/collapsible/collapsible.tsx | 2 +- .../components/date-picker/date-picker.tsx | 7 + packages/ui/src/components/input/input.tsx | 16 +- packages/ui/src/components/input/types.ts | 8 + packages/ui/src/components/menu/menu-item.tsx | 12 +- packages/ui/src/components/menu/menu.tsx | 17 +- packages/ui/src/components/menu/types.ts | 1 + .../ui/src/components/modal/modal.module.css | 4 +- packages/ui/src/components/modal/modal.tsx | 19 +- .../node-description/node-description.tsx | 27 ++- .../components/radio-button/radio.module.css | 2 +- .../ui/src/components/radio-button/radio.tsx | 5 +- .../select/select-option/select-option.tsx | 7 +- .../select/select-value/select-value.tsx | 12 +- packages/ui/src/components/select/select.tsx | 20 +- packages/ui/src/components/select/types.ts | 1 + .../ui/src/components/separator/separator.tsx | 12 +- .../ui/src/components/snackbar/snackbar.tsx | 7 +- packages/website/generated/props.json | 177 +++++++++++++++++- 23 files changed, 345 insertions(+), 37 deletions(-) diff --git a/about/images/CONTRIBUTING.md b/about/images/CONTRIBUTING.md index 6a118fd7..568b303e 100644 --- a/about/images/CONTRIBUTING.md +++ b/about/images/CONTRIBUTING.md @@ -4,4 +4,4 @@ 2. Install dependencies: `pnpm install` 3. Build the Axiom library: `pnpm ui dev` 4. Start the Docusaurus documentation site: `pnpm website dev` -5. Open `http://localhost:3000/axiom/` +5. Open `http://localhost:3000/ui-components/authored/overview` diff --git a/packages/ui/src/components/avatar/avatar.tsx b/packages/ui/src/components/avatar/avatar.tsx index 091b25ed..2496f8f9 100644 --- a/packages/ui/src/components/avatar/avatar.tsx +++ b/packages/ui/src/components/avatar/avatar.tsx @@ -14,6 +14,10 @@ type Props = { * Size of the circle container */ size?: Size; + /** + * Optional class name for the container element + */ + classNameContainer?: string; }; type Size = 'extra-large' | 'large' | 'medium' | 'small'; @@ -21,9 +25,16 @@ type Size = 'extra-large' | 'large' | 'medium' | 'small'; /** * Component for displaying user avatars with various sizes */ -export function Avatar({ imageUrl, username, size = 'extra-large' }: Props) { +export function Avatar({ + imageUrl, + username, + size = 'extra-large', + classNameContainer, +}: Props) { return ( -
+
{username}
); diff --git a/packages/ui/src/components/checkbox/checkbox.tsx b/packages/ui/src/components/checkbox/checkbox.tsx index 86df9286..9833bd4a 100644 --- a/packages/ui/src/components/checkbox/checkbox.tsx +++ b/packages/ui/src/components/checkbox/checkbox.tsx @@ -18,6 +18,10 @@ type Props = { * Whether the checkbox is checked */ checked?: boolean; + /** + * Optional class name for the container element + */ + classNameContainer?: string; } & Omit, 'size'>; /** @@ -29,6 +33,7 @@ export function Checkbox({ indeterminate, checked, onChange, + classNameContainer, ...props }: Props) { function handleChange(event: React.ChangeEvent) { @@ -36,7 +41,7 @@ export function Checkbox({ } return ( -