@mich8060/unified-design-system 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.lib.md +103 -0
- package/README.md +265 -0
- package/dist/LICENSE +21 -0
- package/dist/README.md +103 -0
- package/dist/package.json +49 -0
- package/dist/styles.css +20544 -0
- package/dist/uds-components.es.js +67031 -0
- package/dist/uds-components.es.js.map +1 -0
- package/dist/uds-components.umd.js +67048 -0
- package/dist/uds-components.umd.js.map +1 -0
- package/package.json +158 -0
- package/src/styles/_typography.scss +932 -0
- package/src/styles/_utilities.scss +3738 -0
- package/src/styles/_variables.scss +620 -0
- package/src/styles/prism-custom.css +204 -0
- package/src/styles/prism-custom.scss +205 -0
- package/src/styles/tokens.css +1463 -0
- package/src/styles/tokens.scss +1116 -0
- package/src/ui/Accordion/Accordion.ai.md +69 -0
- package/src/ui/Accordion/Accordion.scss +87 -0
- package/src/ui/Accordion/Accordion.spec.ts +25 -0
- package/src/ui/Accordion/Accordion.stories.tsx +46 -0
- package/src/ui/Accordion/Accordion.test.tsx +54 -0
- package/src/ui/Accordion/Accordion.tsx +73 -0
- package/src/ui/Accordion/Accordion.types.ts +15 -0
- package/src/ui/Accordion/index.js +1 -0
- package/src/ui/ActionMenu/ActionMenu.ai.md +106 -0
- package/src/ui/ActionMenu/ActionMenu.jsx +437 -0
- package/src/ui/ActionMenu/ActionMenu.scss +252 -0
- package/src/ui/ActionMenu/ActionMenu.spec.ts +12 -0
- package/src/ui/ActionMenu/ActionMenu.stories.jsx +14 -0
- package/src/ui/ActionMenu/ActionMenu.stories.tsx +124 -0
- package/src/ui/ActionMenu/ActionMenu.test.tsx +1 -0
- package/src/ui/ActionMenu/ActionMenu.tsx +6 -0
- package/src/ui/ActionMenu/ActionMenu.types.ts +3 -0
- package/src/ui/ActionMenu/index.js +1 -0
- package/src/ui/Avatar/Avatar.ai.md +54 -0
- package/src/ui/Avatar/Avatar.jsx +49 -0
- package/src/ui/Avatar/Avatar.scss +87 -0
- package/src/ui/Avatar/Avatar.spec.ts +12 -0
- package/src/ui/Avatar/Avatar.stories.jsx +14 -0
- package/src/ui/Avatar/Avatar.stories.tsx +14 -0
- package/src/ui/Avatar/Avatar.test.tsx +1 -0
- package/src/ui/Avatar/Avatar.tsx +6 -0
- package/src/ui/Avatar/Avatar.types.ts +3 -0
- package/src/ui/Avatar/index.js +1 -0
- package/src/ui/Badge/Badge.ai.md +37 -0
- package/src/ui/Badge/Badge.jsx +64 -0
- package/src/ui/Badge/Badge.scss +84 -0
- package/src/ui/Badge/Badge.spec.ts +12 -0
- package/src/ui/Badge/Badge.stories.jsx +14 -0
- package/src/ui/Badge/Badge.stories.tsx +14 -0
- package/src/ui/Badge/Badge.test.tsx +1 -0
- package/src/ui/Badge/Badge.tsx +6 -0
- package/src/ui/Badge/Badge.types.ts +3 -0
- package/src/ui/Badge/index.js +1 -0
- package/src/ui/Branding/Branding.ai.md +81 -0
- package/src/ui/Branding/Branding.jsx +127 -0
- package/src/ui/Branding/Branding.scss +57 -0
- package/src/ui/Branding/Branding.spec.ts +12 -0
- package/src/ui/Branding/Branding.stories.jsx +14 -0
- package/src/ui/Branding/Branding.stories.tsx +14 -0
- package/src/ui/Branding/Branding.test.tsx +1 -0
- package/src/ui/Branding/Branding.tsx +6 -0
- package/src/ui/Branding/Branding.types.ts +3 -0
- package/src/ui/Branding/index.js +1 -0
- package/src/ui/Breadcrumb/Breadcrumb.ai.md +50 -0
- package/src/ui/Breadcrumb/Breadcrumb.jsx +167 -0
- package/src/ui/Breadcrumb/Breadcrumb.scss +46 -0
- package/src/ui/Breadcrumb/Breadcrumb.spec.ts +12 -0
- package/src/ui/Breadcrumb/Breadcrumb.stories.jsx +26 -0
- package/src/ui/Breadcrumb/Breadcrumb.stories.tsx +14 -0
- package/src/ui/Breadcrumb/Breadcrumb.test.tsx +1 -0
- package/src/ui/Breadcrumb/Breadcrumb.tsx +6 -0
- package/src/ui/Breadcrumb/Breadcrumb.types.ts +3 -0
- package/src/ui/Breadcrumb/index.js +2 -0
- package/src/ui/Button/Button.ai.md +122 -0
- package/src/ui/Button/Button.figma.tsx +49 -0
- package/src/ui/Button/Button.scss +188 -0
- package/src/ui/Button/Button.spec.ts +52 -0
- package/src/ui/Button/Button.stories.tsx +199 -0
- package/src/ui/Button/Button.test.tsx +85 -0
- package/src/ui/Button/Button.tsx +131 -0
- package/src/ui/Button/Button.types.ts +32 -0
- package/src/ui/Button/index.js +1 -0
- package/src/ui/Calendar/Calendar.ai.md +151 -0
- package/src/ui/Calendar/Calendar.jsx +504 -0
- package/src/ui/Calendar/Calendar.scss +451 -0
- package/src/ui/Calendar/Calendar.spec.ts +12 -0
- package/src/ui/Calendar/Calendar.stories.jsx +14 -0
- package/src/ui/Calendar/Calendar.stories.tsx +14 -0
- package/src/ui/Calendar/Calendar.test.tsx +1 -0
- package/src/ui/Calendar/Calendar.tsx +6 -0
- package/src/ui/Calendar/Calendar.types.ts +3 -0
- package/src/ui/Calendar/index.js +1 -0
- package/src/ui/Card/Card.ai.md +41 -0
- package/src/ui/Card/Card.jsx +25 -0
- package/src/ui/Card/Card.scss +47 -0
- package/src/ui/Card/Card.spec.ts +12 -0
- package/src/ui/Card/Card.stories.jsx +28 -0
- package/src/ui/Card/Card.stories.tsx +14 -0
- package/src/ui/Card/Card.test.tsx +1 -0
- package/src/ui/Card/Card.tsx +6 -0
- package/src/ui/Card/Card.types.ts +3 -0
- package/src/ui/Card/index.js +1 -0
- package/src/ui/Checkbox/Checkbox.ai.md +50 -0
- package/src/ui/Checkbox/Checkbox.jsx +73 -0
- package/src/ui/Checkbox/Checkbox.scss +115 -0
- package/src/ui/Checkbox/Checkbox.spec.ts +12 -0
- package/src/ui/Checkbox/Checkbox.stories.jsx +14 -0
- package/src/ui/Checkbox/Checkbox.stories.tsx +14 -0
- package/src/ui/Checkbox/Checkbox.test.tsx +1 -0
- package/src/ui/Checkbox/Checkbox.tsx +6 -0
- package/src/ui/Checkbox/Checkbox.types.ts +3 -0
- package/src/ui/Checkbox/index.js +1 -0
- package/src/ui/Chip/Chip.ai.md +43 -0
- package/src/ui/Chip/Chip.jsx +102 -0
- package/src/ui/Chip/Chip.scss +118 -0
- package/src/ui/Chip/Chip.spec.ts +12 -0
- package/src/ui/Chip/Chip.stories.jsx +14 -0
- package/src/ui/Chip/Chip.stories.tsx +14 -0
- package/src/ui/Chip/Chip.test.tsx +1 -0
- package/src/ui/Chip/Chip.tsx +6 -0
- package/src/ui/Chip/Chip.types.ts +3 -0
- package/src/ui/Chip/index.js +1 -0
- package/src/ui/Datepicker/Datepicker.ai.md +45 -0
- package/src/ui/Datepicker/Datepicker.jsx +330 -0
- package/src/ui/Datepicker/Datepicker.scss +206 -0
- package/src/ui/Datepicker/Datepicker.spec.ts +12 -0
- package/src/ui/Datepicker/Datepicker.stories.jsx +14 -0
- package/src/ui/Datepicker/Datepicker.stories.tsx +14 -0
- package/src/ui/Datepicker/Datepicker.test.tsx +1 -0
- package/src/ui/Datepicker/Datepicker.tsx +6 -0
- package/src/ui/Datepicker/Datepicker.types.ts +3 -0
- package/src/ui/Datepicker/index.js +2 -0
- package/src/ui/Divider/Divider.ai.md +34 -0
- package/src/ui/Divider/Divider.jsx +89 -0
- package/src/ui/Divider/Divider.scss +116 -0
- package/src/ui/Divider/Divider.spec.ts +12 -0
- package/src/ui/Divider/Divider.stories.jsx +14 -0
- package/src/ui/Divider/Divider.stories.tsx +14 -0
- package/src/ui/Divider/Divider.test.tsx +1 -0
- package/src/ui/Divider/Divider.tsx +6 -0
- package/src/ui/Divider/Divider.types.ts +3 -0
- package/src/ui/Divider/index.js +1 -0
- package/src/ui/DotStatus/DotStatus.ai.md +36 -0
- package/src/ui/DotStatus/DotStatus.jsx +64 -0
- package/src/ui/DotStatus/DotStatus.scss +87 -0
- package/src/ui/DotStatus/DotStatus.spec.ts +12 -0
- package/src/ui/DotStatus/DotStatus.stories.jsx +14 -0
- package/src/ui/DotStatus/DotStatus.stories.tsx +14 -0
- package/src/ui/DotStatus/DotStatus.test.tsx +1 -0
- package/src/ui/DotStatus/DotStatus.tsx +6 -0
- package/src/ui/DotStatus/DotStatus.types.ts +3 -0
- package/src/ui/DotStatus/index.js +1 -0
- package/src/ui/Dropdown/Dropdown.ai.md +118 -0
- package/src/ui/Dropdown/Dropdown.scss +129 -0
- package/src/ui/Dropdown/Dropdown.spec.ts +54 -0
- package/src/ui/Dropdown/Dropdown.stories.tsx +59 -0
- package/src/ui/Dropdown/Dropdown.test.tsx +37 -0
- package/src/ui/Dropdown/Dropdown.tsx +119 -0
- package/src/ui/Dropdown/Dropdown.types.ts +25 -0
- package/src/ui/Dropdown/index.js +1 -0
- package/src/ui/EventCard/EventCard.ai.md +101 -0
- package/src/ui/EventCard/EventCard.jsx +92 -0
- package/src/ui/EventCard/EventCard.scss +186 -0
- package/src/ui/EventCard/EventCard.spec.ts +12 -0
- package/src/ui/EventCard/EventCard.stories.jsx +14 -0
- package/src/ui/EventCard/EventCard.stories.tsx +14 -0
- package/src/ui/EventCard/EventCard.test.tsx +1 -0
- package/src/ui/EventCard/EventCard.tsx +6 -0
- package/src/ui/EventCard/EventCard.types.ts +3 -0
- package/src/ui/EventCard/index.js +1 -0
- package/src/ui/Field/Field.ai.md +69 -0
- package/src/ui/Field/Field.jsx +89 -0
- package/src/ui/Field/Field.scss +76 -0
- package/src/ui/Field/Field.spec.ts +12 -0
- package/src/ui/Field/Field.stories.jsx +14 -0
- package/src/ui/Field/Field.stories.tsx +14 -0
- package/src/ui/Field/Field.test.tsx +1 -0
- package/src/ui/Field/Field.tsx +6 -0
- package/src/ui/Field/Field.types.ts +3 -0
- package/src/ui/Field/index.js +1 -0
- package/src/ui/FileUpload/FileUpload.ai.md +38 -0
- package/src/ui/FileUpload/FileUpload.figma.tsx +28 -0
- package/src/ui/FileUpload/FileUpload.jsx +153 -0
- package/src/ui/FileUpload/FileUpload.scss +78 -0
- package/src/ui/FileUpload/FileUpload.spec.ts +12 -0
- package/src/ui/FileUpload/FileUpload.stories.jsx +14 -0
- package/src/ui/FileUpload/FileUpload.stories.tsx +14 -0
- package/src/ui/FileUpload/FileUpload.test.tsx +1 -0
- package/src/ui/FileUpload/FileUpload.tsx +6 -0
- package/src/ui/FileUpload/FileUpload.types.ts +3 -0
- package/src/ui/FileUpload/index.js +2 -0
- package/src/ui/Flex/Flex.ai.md +130 -0
- package/src/ui/Flex/Flex.jsx +53 -0
- package/src/ui/Flex/Flex.scss +119 -0
- package/src/ui/Flex/Flex.spec.ts +12 -0
- package/src/ui/Flex/Flex.stories.jsx +14 -0
- package/src/ui/Flex/Flex.stories.tsx +14 -0
- package/src/ui/Flex/Flex.test.tsx +1 -0
- package/src/ui/Flex/Flex.tsx +6 -0
- package/src/ui/Flex/Flex.types.ts +3 -0
- package/src/ui/Flex/index.js +1 -0
- package/src/ui/Icon/Icon.ai.md +46 -0
- package/src/ui/Icon/Icon.figma.tsx +22 -0
- package/src/ui/Icon/Icon.jsx +47 -0
- package/src/ui/Icon/Icon.scss +1 -0
- package/src/ui/Icon/Icon.spec.ts +12 -0
- package/src/ui/Icon/Icon.stories.jsx +14 -0
- package/src/ui/Icon/Icon.stories.tsx +14 -0
- package/src/ui/Icon/Icon.test.tsx +1 -0
- package/src/ui/Icon/Icon.tsx +6 -0
- package/src/ui/Icon/Icon.types.ts +3 -0
- package/src/ui/Icon/index.js +1 -0
- package/src/ui/ImageAspect/ImageAspect.ai.md +37 -0
- package/src/ui/ImageAspect/ImageAspect.jsx +56 -0
- package/src/ui/ImageAspect/ImageAspect.scss +62 -0
- package/src/ui/ImageAspect/ImageAspect.spec.ts +12 -0
- package/src/ui/ImageAspect/ImageAspect.stories.jsx +14 -0
- package/src/ui/ImageAspect/ImageAspect.stories.tsx +14 -0
- package/src/ui/ImageAspect/ImageAspect.test.tsx +1 -0
- package/src/ui/ImageAspect/ImageAspect.tsx +6 -0
- package/src/ui/ImageAspect/ImageAspect.types.ts +3 -0
- package/src/ui/ImageAspect/index.js +1 -0
- package/src/ui/Input/Input.ai.md +89 -0
- package/src/ui/Input/Input.figma.tsx +35 -0
- package/src/ui/Input/Input.scss +126 -0
- package/src/ui/Input/Input.spec.ts +54 -0
- package/src/ui/Input/Input.stories.tsx +72 -0
- package/src/ui/Input/Input.test.tsx +70 -0
- package/src/ui/Input/Input.tsx +91 -0
- package/src/ui/Input/Input.types.ts +22 -0
- package/src/ui/Input/index.js +2 -0
- package/src/ui/Key/Key.ai.md +31 -0
- package/src/ui/Key/Key.jsx +37 -0
- package/src/ui/Key/Key.scss +31 -0
- package/src/ui/Key/Key.spec.ts +12 -0
- package/src/ui/Key/Key.stories.jsx +14 -0
- package/src/ui/Key/Key.stories.tsx +14 -0
- package/src/ui/Key/Key.test.tsx +1 -0
- package/src/ui/Key/Key.tsx +6 -0
- package/src/ui/Key/Key.types.ts +3 -0
- package/src/ui/Key/index.js +1 -0
- package/src/ui/Menu/Menu.jsx +232 -0
- package/src/ui/Menu/Menu.scss +370 -0
- package/src/ui/Menu/Menu.spec.ts +12 -0
- package/src/ui/Menu/Menu.stories.jsx +41 -0
- package/src/ui/Menu/Menu.stories.tsx +14 -0
- package/src/ui/Menu/Menu.test.tsx +1 -0
- package/src/ui/Menu/Menu.tsx +6 -0
- package/src/ui/Menu/Menu.types.ts +3 -0
- package/src/ui/Menu/index.js +1 -0
- package/src/ui/MicroCalendar/MicroCalendar.ai.md +35 -0
- package/src/ui/MicroCalendar/MicroCalendar.jsx +393 -0
- package/src/ui/MicroCalendar/MicroCalendar.scss +289 -0
- package/src/ui/MicroCalendar/MicroCalendar.spec.ts +12 -0
- package/src/ui/MicroCalendar/MicroCalendar.stories.jsx +14 -0
- package/src/ui/MicroCalendar/MicroCalendar.stories.tsx +14 -0
- package/src/ui/MicroCalendar/MicroCalendar.test.tsx +1 -0
- package/src/ui/MicroCalendar/MicroCalendar.tsx +6 -0
- package/src/ui/MicroCalendar/MicroCalendar.types.ts +3 -0
- package/src/ui/MicroCalendar/index.js +1 -0
- package/src/ui/Modal/Modal.ai.md +150 -0
- package/src/ui/Modal/Modal.jsx +173 -0
- package/src/ui/Modal/Modal.scss +179 -0
- package/src/ui/Modal/Modal.spec.ts +12 -0
- package/src/ui/Modal/Modal.stories.jsx +14 -0
- package/src/ui/Modal/Modal.stories.tsx +14 -0
- package/src/ui/Modal/Modal.test.tsx +1 -0
- package/src/ui/Modal/Modal.tsx +6 -0
- package/src/ui/Modal/Modal.types.ts +3 -0
- package/src/ui/Modal/index.js +1 -0
- package/src/ui/Pagination/Pagination.ai.md +30 -0
- package/src/ui/Pagination/Pagination.jsx +237 -0
- package/src/ui/Pagination/Pagination.scss +182 -0
- package/src/ui/Pagination/Pagination.spec.ts +12 -0
- package/src/ui/Pagination/Pagination.stories.jsx +14 -0
- package/src/ui/Pagination/Pagination.stories.tsx +14 -0
- package/src/ui/Pagination/Pagination.test.tsx +1 -0
- package/src/ui/Pagination/Pagination.tsx +6 -0
- package/src/ui/Pagination/Pagination.types.ts +3 -0
- package/src/ui/Pagination/index.js +1 -0
- package/src/ui/PillToggle/PillToggle.ai.md +44 -0
- package/src/ui/PillToggle/PillToggle.jsx +56 -0
- package/src/ui/PillToggle/PillToggle.scss +84 -0
- package/src/ui/PillToggle/PillToggle.spec.ts +12 -0
- package/src/ui/PillToggle/PillToggle.stories.jsx +14 -0
- package/src/ui/PillToggle/PillToggle.stories.tsx +14 -0
- package/src/ui/PillToggle/PillToggle.test.tsx +1 -0
- package/src/ui/PillToggle/PillToggle.tsx +6 -0
- package/src/ui/PillToggle/PillToggle.types.ts +3 -0
- package/src/ui/PillToggle/index.js +1 -0
- package/src/ui/Playground/Playground.ai.md +96 -0
- package/src/ui/Playground/Playground.jsx +524 -0
- package/src/ui/Playground/Playground.scss +310 -0
- package/src/ui/Playground/Playground.spec.ts +12 -0
- package/src/ui/Playground/Playground.stories.jsx +14 -0
- package/src/ui/Playground/Playground.stories.tsx +14 -0
- package/src/ui/Playground/Playground.test.tsx +1 -0
- package/src/ui/Playground/Playground.tsx +6 -0
- package/src/ui/Playground/Playground.types.ts +3 -0
- package/src/ui/Playground/index.js +2 -0
- package/src/ui/ProgressCircle/ProgressCircle.ai.md +36 -0
- package/src/ui/ProgressCircle/ProgressCircle.jsx +147 -0
- package/src/ui/ProgressCircle/ProgressCircle.scss +143 -0
- package/src/ui/ProgressCircle/ProgressCircle.spec.ts +12 -0
- package/src/ui/ProgressCircle/ProgressCircle.stories.jsx +14 -0
- package/src/ui/ProgressCircle/ProgressCircle.stories.tsx +14 -0
- package/src/ui/ProgressCircle/ProgressCircle.test.tsx +1 -0
- package/src/ui/ProgressCircle/ProgressCircle.tsx +6 -0
- package/src/ui/ProgressCircle/ProgressCircle.types.ts +3 -0
- package/src/ui/ProgressCircle/index.js +1 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.ai.md +27 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.jsx +92 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.scss +133 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.spec.ts +12 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.stories.jsx +14 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.stories.tsx +14 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.test.tsx +1 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.tsx +6 -0
- package/src/ui/ProgressIndicator/ProgressIndicator.types.ts +3 -0
- package/src/ui/ProgressIndicator/index.js +1 -0
- package/src/ui/Radio/Radio.ai.md +53 -0
- package/src/ui/Radio/Radio.jsx +57 -0
- package/src/ui/Radio/Radio.scss +89 -0
- package/src/ui/Radio/Radio.spec.ts +12 -0
- package/src/ui/Radio/Radio.stories.jsx +14 -0
- package/src/ui/Radio/Radio.stories.tsx +14 -0
- package/src/ui/Radio/Radio.test.tsx +1 -0
- package/src/ui/Radio/Radio.tsx +6 -0
- package/src/ui/Radio/Radio.types.ts +3 -0
- package/src/ui/Radio/index.js +1 -0
- package/src/ui/Slider/Slider.ai.md +33 -0
- package/src/ui/Slider/Slider.jsx +283 -0
- package/src/ui/Slider/Slider.scss +156 -0
- package/src/ui/Slider/Slider.spec.ts +12 -0
- package/src/ui/Slider/Slider.stories.jsx +14 -0
- package/src/ui/Slider/Slider.stories.tsx +14 -0
- package/src/ui/Slider/Slider.test.tsx +1 -0
- package/src/ui/Slider/Slider.tsx +6 -0
- package/src/ui/Slider/Slider.types.ts +3 -0
- package/src/ui/Slider/index.js +1 -0
- package/src/ui/Status/Status.ai.md +36 -0
- package/src/ui/Status/Status.jsx +66 -0
- package/src/ui/Status/Status.scss +90 -0
- package/src/ui/Status/Status.spec.ts +12 -0
- package/src/ui/Status/Status.stories.jsx +14 -0
- package/src/ui/Status/Status.stories.tsx +14 -0
- package/src/ui/Status/Status.test.tsx +1 -0
- package/src/ui/Status/Status.tsx +6 -0
- package/src/ui/Status/Status.types.ts +3 -0
- package/src/ui/Status/index.js +1 -0
- package/src/ui/Steps/Steps.ai.md +56 -0
- package/src/ui/Steps/Steps.jsx +201 -0
- package/src/ui/Steps/Steps.scss +240 -0
- package/src/ui/Steps/Steps.spec.ts +12 -0
- package/src/ui/Steps/Steps.stories.jsx +14 -0
- package/src/ui/Steps/Steps.stories.tsx +14 -0
- package/src/ui/Steps/Steps.test.tsx +1 -0
- package/src/ui/Steps/Steps.tsx +6 -0
- package/src/ui/Steps/Steps.types.ts +3 -0
- package/src/ui/Steps/index.js +1 -0
- package/src/ui/Table/Table.ai.md +108 -0
- package/src/ui/Table/Table.jsx +143 -0
- package/src/ui/Table/Table.scss +90 -0
- package/src/ui/Table/Table.spec.ts +12 -0
- package/src/ui/Table/Table.stories.jsx +14 -0
- package/src/ui/Table/Table.stories.tsx +14 -0
- package/src/ui/Table/Table.test.tsx +1 -0
- package/src/ui/Table/Table.tsx +6 -0
- package/src/ui/Table/Table.types.ts +3 -0
- package/src/ui/Table/index.js +1 -0
- package/src/ui/Tabs/TabItem.jsx +80 -0
- package/src/ui/Tabs/Tabs.ai.md +52 -0
- package/src/ui/Tabs/Tabs.figma.tsx +30 -0
- package/src/ui/Tabs/Tabs.jsx +318 -0
- package/src/ui/Tabs/Tabs.scss +164 -0
- package/src/ui/Tabs/Tabs.spec.ts +12 -0
- package/src/ui/Tabs/Tabs.stories.jsx +18 -0
- package/src/ui/Tabs/Tabs.stories.tsx +14 -0
- package/src/ui/Tabs/Tabs.test.tsx +1 -0
- package/src/ui/Tabs/Tabs.tsx +6 -0
- package/src/ui/Tabs/Tabs.types.ts +3 -0
- package/src/ui/Tabs/index.js +3 -0
- package/src/ui/Tag/Tag.ai.md +59 -0
- package/src/ui/Tag/Tag.figma.tsx +29 -0
- package/src/ui/Tag/Tag.jsx +93 -0
- package/src/ui/Tag/Tag.scss +258 -0
- package/src/ui/Tag/Tag.spec.ts +12 -0
- package/src/ui/Tag/Tag.stories.jsx +14 -0
- package/src/ui/Tag/Tag.stories.tsx +14 -0
- package/src/ui/Tag/Tag.test.tsx +1 -0
- package/src/ui/Tag/Tag.tsx +6 -0
- package/src/ui/Tag/Tag.types.ts +3 -0
- package/src/ui/Tag/index.js +2 -0
- package/src/ui/Textarea/Textarea.ai.md +40 -0
- package/src/ui/Textarea/Textarea.figma.tsx +35 -0
- package/src/ui/Textarea/Textarea.jsx +68 -0
- package/src/ui/Textarea/Textarea.scss +71 -0
- package/src/ui/Textarea/Textarea.spec.ts +12 -0
- package/src/ui/Textarea/Textarea.stories.jsx +14 -0
- package/src/ui/Textarea/Textarea.stories.tsx +14 -0
- package/src/ui/Textarea/Textarea.test.tsx +1 -0
- package/src/ui/Textarea/Textarea.tsx +6 -0
- package/src/ui/Textarea/Textarea.types.ts +3 -0
- package/src/ui/Textarea/index.js +2 -0
- package/src/ui/Toast/Toast.ai.md +47 -0
- package/src/ui/Toast/Toast.jsx +75 -0
- package/src/ui/Toast/Toast.scss +132 -0
- package/src/ui/Toast/Toast.spec.ts +12 -0
- package/src/ui/Toast/Toast.stories.jsx +14 -0
- package/src/ui/Toast/Toast.stories.tsx +14 -0
- package/src/ui/Toast/Toast.test.tsx +1 -0
- package/src/ui/Toast/Toast.tsx +6 -0
- package/src/ui/Toast/Toast.types.ts +3 -0
- package/src/ui/Toast/index.js +2 -0
- package/src/ui/Toggle/Toggle.ai.md +37 -0
- package/src/ui/Toggle/Toggle.jsx +73 -0
- package/src/ui/Toggle/Toggle.scss +139 -0
- package/src/ui/Toggle/Toggle.spec.ts +12 -0
- package/src/ui/Toggle/Toggle.stories.jsx +14 -0
- package/src/ui/Toggle/Toggle.stories.tsx +14 -0
- package/src/ui/Toggle/Toggle.test.tsx +1 -0
- package/src/ui/Toggle/Toggle.tsx +6 -0
- package/src/ui/Toggle/Toggle.types.ts +3 -0
- package/src/ui/Toggle/index.js +1 -0
- package/src/ui/Tooltip/Tooltip.ai.md +33 -0
- package/src/ui/Tooltip/Tooltip.figma.tsx +24 -0
- package/src/ui/Tooltip/Tooltip.jsx +125 -0
- package/src/ui/Tooltip/Tooltip.scss +80 -0
- package/src/ui/Tooltip/Tooltip.spec.ts +12 -0
- package/src/ui/Tooltip/Tooltip.stories.jsx +14 -0
- package/src/ui/Tooltip/Tooltip.stories.tsx +14 -0
- package/src/ui/Tooltip/Tooltip.test.tsx +1 -0
- package/src/ui/Tooltip/Tooltip.tsx +6 -0
- package/src/ui/Tooltip/Tooltip.types.ts +3 -0
- package/src/ui/Tooltip/index.js +2 -0
- package/src/ui/UDS/UDS.jsx +52 -0
- package/src/ui/UDS/UDS.scss +49 -0
- package/src/ui/UDS/UDS.spec.ts +12 -0
- package/src/ui/UDS/UDS.stories.jsx +22 -0
- package/src/ui/UDS/UDS.stories.tsx +14 -0
- package/src/ui/UDS/UDS.test.tsx +1 -0
- package/src/ui/UDS/UDS.tsx +6 -0
- package/src/ui/UDS/UDS.types.ts +3 -0
- package/src/ui/UDS/index.js +1 -0
- package/src/ui/_spec/createMetaFromSpec.ts +35 -0
- package/src/ui/_spec/createStoryArgsFromSpec.ts +8 -0
- package/src/ui/_spec/generated/spec-props-reference.md +55 -0
- package/src/ui/_spec/specStorySync.test.ts +73 -0
- package/src/ui/_spec/types.ts +21 -0
- package/src/ui/index.js +66 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProgressCircle from "./ProgressCircle";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/ProgressCircle",
|
|
5
|
+
component: ProgressCircle,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {},
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProgressCircle from "./ProgressCircle.jsx";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/ProgressCircle",
|
|
5
|
+
component: ProgressCircle,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {},
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ProgressCircle";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# ProgressIndicator
|
|
2
|
+
|
|
3
|
+
Linear progress bar for showing completion or loading state.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- File upload progress, form completion
|
|
7
|
+
- Loading indicators
|
|
8
|
+
- Any linear progress visualization
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `value` | `number` | `0` | Progress percentage (0–100) |
|
|
15
|
+
| `variant` | `string` | `"determinate"` | `"determinate"` or `"indeterminate"` |
|
|
16
|
+
| `color` | `string` | `"blue"` | Bar color |
|
|
17
|
+
| `size` | `string` | `"default"` | `"small"`, `"default"`, `"large"` |
|
|
18
|
+
| `showLabel` | `boolean` | `false` | Show percentage text |
|
|
19
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
<ProgressIndicator value={60} showLabel />
|
|
25
|
+
<ProgressIndicator variant="indeterminate" /> {/* Animated loading bar */}
|
|
26
|
+
<ProgressIndicator value={100} color="green" />
|
|
27
|
+
```
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./ProgressIndicator.scss";
|
|
3
|
+
|
|
4
|
+
const BASE_CLASS = "uds-progress-indicator";
|
|
5
|
+
|
|
6
|
+
const variantClassMap = {
|
|
7
|
+
default: "default",
|
|
8
|
+
blue: "blue",
|
|
9
|
+
green: "green",
|
|
10
|
+
success: "green",
|
|
11
|
+
orange: "orange",
|
|
12
|
+
warning: "orange",
|
|
13
|
+
red: "red",
|
|
14
|
+
error: "red",
|
|
15
|
+
purple: "purple",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const sizeClassMap = {
|
|
19
|
+
small: "small",
|
|
20
|
+
medium: "medium",
|
|
21
|
+
large: "large",
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* ProgressIndicator component for displaying progress bars
|
|
26
|
+
* @param {number} value - Progress value (0-100)
|
|
27
|
+
* @param {number} max - Maximum value (default: 100)
|
|
28
|
+
* @param {string} variant - Color variant: 'default', 'blue', 'green', 'success', 'orange', 'warning', 'red', 'error', 'purple'
|
|
29
|
+
* @param {string} size - Size variant: 'small', 'medium', or 'large'
|
|
30
|
+
* @param {string} label - Optional label text to display above the progress bar
|
|
31
|
+
* @param {boolean} showValue - Whether to show the percentage value
|
|
32
|
+
* @param {boolean} showLabel - Whether to show the label (if provided)
|
|
33
|
+
* @param {string} className - Additional CSS classes
|
|
34
|
+
* @param {string} 'aria-label' - Accessible label for screen readers
|
|
35
|
+
* @param {object} props - Additional props to pass to the progress element
|
|
36
|
+
*/
|
|
37
|
+
export default function ProgressIndicator({
|
|
38
|
+
value = 0,
|
|
39
|
+
max = 100,
|
|
40
|
+
variant = "default",
|
|
41
|
+
size = "medium",
|
|
42
|
+
label,
|
|
43
|
+
showValue = false,
|
|
44
|
+
showLabel = true,
|
|
45
|
+
className = "",
|
|
46
|
+
"aria-label": ariaLabel,
|
|
47
|
+
...props
|
|
48
|
+
}) {
|
|
49
|
+
const percentage = Math.min(Math.max((value / max) * 100, 0), 100);
|
|
50
|
+
const displayValue = Math.round(percentage);
|
|
51
|
+
|
|
52
|
+
const classNames = [
|
|
53
|
+
BASE_CLASS,
|
|
54
|
+
variantClassMap[variant] && `${BASE_CLASS}--${variantClassMap[variant]}`,
|
|
55
|
+
sizeClassMap[size] && `${BASE_CLASS}--${sizeClassMap[size]}`,
|
|
56
|
+
className,
|
|
57
|
+
]
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
.join(" ");
|
|
60
|
+
|
|
61
|
+
const progressId = `progress-${Math.random().toString(36).substr(2, 9)}`;
|
|
62
|
+
const labelId = label ? `${progressId}-label` : undefined;
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<div className={classNames} {...props}>
|
|
66
|
+
{(label && showLabel) || showValue ? (
|
|
67
|
+
<div className={`${BASE_CLASS}__header`}>
|
|
68
|
+
{label && showLabel && (
|
|
69
|
+
<span id={labelId} className={`${BASE_CLASS}__label`}>
|
|
70
|
+
{label}
|
|
71
|
+
</span>
|
|
72
|
+
)}
|
|
73
|
+
{showValue && (
|
|
74
|
+
<span className={`${BASE_CLASS}__value`}>{displayValue}%</span>
|
|
75
|
+
)}
|
|
76
|
+
</div>
|
|
77
|
+
) : null}
|
|
78
|
+
<div className={`${BASE_CLASS}__track`}>
|
|
79
|
+
<div
|
|
80
|
+
className={`${BASE_CLASS}__fill`}
|
|
81
|
+
role="progressbar"
|
|
82
|
+
aria-valuenow={value}
|
|
83
|
+
aria-valuemin={0}
|
|
84
|
+
aria-valuemax={max}
|
|
85
|
+
aria-label={ariaLabel || label || `Progress: ${displayValue}%`}
|
|
86
|
+
aria-labelledby={labelId}
|
|
87
|
+
style={{ width: `${percentage}%` }}
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-progress-indicator {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--uds-gap-8);
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
&__header {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: center;
|
|
13
|
+
gap: var(--uds-gap-8);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__label {
|
|
17
|
+
@include uds-body-14-medium;
|
|
18
|
+
color: var(--uds-text-primary);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&__value {
|
|
22
|
+
@include uds-body-14-medium;
|
|
23
|
+
color: var(--uds-text-secondary);
|
|
24
|
+
white-space: nowrap;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&__track {
|
|
28
|
+
position: relative;
|
|
29
|
+
width: 100%;
|
|
30
|
+
background-color: var(--uds-surface-tertiary);
|
|
31
|
+
border-radius: var(--uds-radius-4);
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&__fill {
|
|
36
|
+
height: 100%;
|
|
37
|
+
background-color: var(--uds-surface-brand-primary);
|
|
38
|
+
border-radius: var(--uds-radius-4);
|
|
39
|
+
transition: width var(--uds-animation-duration-300) var(--uds-animation-ease-standard);
|
|
40
|
+
position: relative;
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
|
|
43
|
+
// Animated shimmer effect (optional, can be enabled via class)
|
|
44
|
+
&::after {
|
|
45
|
+
content: "";
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
left: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
bottom: 0;
|
|
51
|
+
background: linear-gradient(
|
|
52
|
+
90deg,
|
|
53
|
+
transparent,
|
|
54
|
+
rgba(255, 255, 255, 0.2),
|
|
55
|
+
transparent
|
|
56
|
+
);
|
|
57
|
+
transform: translateX(-100%);
|
|
58
|
+
transition: transform 0.6s ease;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Size variants
|
|
63
|
+
&--small {
|
|
64
|
+
.uds-progress-indicator__track {
|
|
65
|
+
height: 4px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&--medium {
|
|
70
|
+
.uds-progress-indicator__track {
|
|
71
|
+
height: 8px;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&--large {
|
|
76
|
+
.uds-progress-indicator__track {
|
|
77
|
+
height: 12px;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Variant colors
|
|
82
|
+
&--default,
|
|
83
|
+
&--blue {
|
|
84
|
+
.uds-progress-indicator__fill {
|
|
85
|
+
background-color: var(--uds-surface-brand-primary);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&--green,
|
|
90
|
+
&--success {
|
|
91
|
+
.uds-progress-indicator__fill {
|
|
92
|
+
background-color: #22c55e; // Green
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--orange,
|
|
97
|
+
&--warning {
|
|
98
|
+
.uds-progress-indicator__fill {
|
|
99
|
+
background-color: #f97316; // Orange
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&--red,
|
|
104
|
+
&--error {
|
|
105
|
+
.uds-progress-indicator__fill {
|
|
106
|
+
background-color: #ef4444; // Red
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&--purple {
|
|
111
|
+
.uds-progress-indicator__fill {
|
|
112
|
+
background-color: #a855f7; // Purple
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Animated state (for indeterminate/loading progress)
|
|
117
|
+
&--animated {
|
|
118
|
+
.uds-progress-indicator__fill {
|
|
119
|
+
&::after {
|
|
120
|
+
animation: progress-shimmer 1.5s infinite;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@keyframes progress-shimmer {
|
|
127
|
+
0% {
|
|
128
|
+
transform: translateX(-100%);
|
|
129
|
+
}
|
|
130
|
+
100% {
|
|
131
|
+
transform: translateX(100%);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProgressIndicator from "./ProgressIndicator";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/ProgressIndicator",
|
|
5
|
+
component: ProgressIndicator,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {},
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ProgressIndicator from "./ProgressIndicator.jsx";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/ProgressIndicator",
|
|
5
|
+
component: ProgressIndicator,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "padded",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {},
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./ProgressIndicator";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
Radio button group for single-value selection from a set of options.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Choosing one option from a small set (2–6 options)
|
|
7
|
+
- Form fields where only one selection is valid
|
|
8
|
+
- Settings/preferences with mutually exclusive options
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
### RadioGroup (container)
|
|
13
|
+
|
|
14
|
+
| Prop | Type | Default | Description |
|
|
15
|
+
|------|------|---------|-------------|
|
|
16
|
+
| `name` | `string` | — | Group name (shared across radios) |
|
|
17
|
+
| `value` | `string` | — | Currently selected value |
|
|
18
|
+
| `onChange` | `function` | — | Callback `(value: string) => void` |
|
|
19
|
+
| `children` | `ReactNode` | — | `RadioOption` components |
|
|
20
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
21
|
+
| `layout` | `string` | `"vertical"` | `"vertical"` or `"horizontal"` |
|
|
22
|
+
|
|
23
|
+
### RadioOption
|
|
24
|
+
|
|
25
|
+
| Prop | Type | Default | Description |
|
|
26
|
+
|------|------|---------|-------------|
|
|
27
|
+
| `value` | `string` | — | Option value |
|
|
28
|
+
| `label` | `string` | — | Label text |
|
|
29
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<RadioGroup name="plan" value={plan} onChange={setPlan}>
|
|
35
|
+
<RadioOption value="free" label="Free Plan" />
|
|
36
|
+
<RadioOption value="pro" label="Pro Plan" />
|
|
37
|
+
<RadioOption value="enterprise" label="Enterprise Plan" />
|
|
38
|
+
</RadioGroup>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Horizontal layout
|
|
42
|
+
```jsx
|
|
43
|
+
<RadioGroup name="size" value={size} onChange={setSize} layout="horizontal">
|
|
44
|
+
<RadioOption value="sm" label="Small" />
|
|
45
|
+
<RadioOption value="md" label="Medium" />
|
|
46
|
+
<RadioOption value="lg" label="Large" />
|
|
47
|
+
</RadioGroup>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Import
|
|
51
|
+
```jsx
|
|
52
|
+
import { RadioGroup, RadioOption } from "@mich8060/chg-design-system";
|
|
53
|
+
```
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Radio.scss";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Radio component for form inputs
|
|
6
|
+
* @param {boolean} checked - Whether the radio button is checked
|
|
7
|
+
* @param {function} onChange - Callback function when radio button state changes
|
|
8
|
+
* @param {string} name - Name attribute for grouping radio buttons (required for proper functionality)
|
|
9
|
+
* @param {string} id - Unique identifier for the radio input
|
|
10
|
+
* @param {string} value - Value of the radio button
|
|
11
|
+
* @param {string} label - Label text for the radio button
|
|
12
|
+
* @param {boolean} disabled - Whether the radio button is disabled
|
|
13
|
+
* @param {string} className - Additional CSS classes
|
|
14
|
+
* @param {object} props - Additional props to pass to the radio input
|
|
15
|
+
*/
|
|
16
|
+
export default function Radio({
|
|
17
|
+
checked = false,
|
|
18
|
+
onChange,
|
|
19
|
+
name,
|
|
20
|
+
id,
|
|
21
|
+
value,
|
|
22
|
+
label,
|
|
23
|
+
disabled = false,
|
|
24
|
+
className = "",
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const radioId = id || `radio-${Math.random().toString(36).substr(2, 9)}`;
|
|
28
|
+
|
|
29
|
+
const handleChange = (event) => {
|
|
30
|
+
if (!disabled && onChange) {
|
|
31
|
+
onChange(event);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<label
|
|
37
|
+
className={`radio ${disabled ? "radio--disabled" : ""} ${className}`}
|
|
38
|
+
htmlFor={radioId}
|
|
39
|
+
>
|
|
40
|
+
<input
|
|
41
|
+
type="radio"
|
|
42
|
+
id={radioId}
|
|
43
|
+
name={name}
|
|
44
|
+
value={value}
|
|
45
|
+
className="radio__input"
|
|
46
|
+
checked={checked}
|
|
47
|
+
onChange={handleChange}
|
|
48
|
+
disabled={disabled}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
<span className="radio__circle">
|
|
52
|
+
{checked && <span className="radio__dot" />}
|
|
53
|
+
</span>
|
|
54
|
+
{label && <span className="radio__label">{label}</span>}
|
|
55
|
+
</label>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.radio {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--uds-gap-8);
|
|
8
|
+
cursor: pointer;
|
|
9
|
+
user-select: none;
|
|
10
|
+
|
|
11
|
+
// ── Modifier: disabled ──────────────────────────────
|
|
12
|
+
&--disabled {
|
|
13
|
+
cursor: not-allowed;
|
|
14
|
+
opacity: 0.6;
|
|
15
|
+
|
|
16
|
+
.radio__label {
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
color: var(--uds-text-secondary);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ── Element: hidden input ───────────────────────────
|
|
23
|
+
&__input {
|
|
24
|
+
position: absolute;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
width: 0;
|
|
27
|
+
height: 0;
|
|
28
|
+
margin: 0;
|
|
29
|
+
|
|
30
|
+
&:focus-visible + .radio__circle {
|
|
31
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
32
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:checked + .radio__circle {
|
|
36
|
+
border-color: var(--uds-border-brand-primary);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:not(:checked):not(:disabled) + .radio__circle:hover {
|
|
40
|
+
border-color: var(--uds-border-brand-primary);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:disabled + .radio__circle {
|
|
44
|
+
background-color: var(--uds-surface-tertiary);
|
|
45
|
+
border-color: var(--uds-border-primary);
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:disabled + .radio__circle + .radio__label {
|
|
50
|
+
color: var(--uds-text-secondary);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ── Element: visual circle ──────────────────────────
|
|
55
|
+
&__circle {
|
|
56
|
+
position: relative;
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
width: 20px;
|
|
61
|
+
height: 20px;
|
|
62
|
+
min-width: 20px;
|
|
63
|
+
min-height: 20px;
|
|
64
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
65
|
+
border-radius: 50%;
|
|
66
|
+
background-color: var(--uds-surface-primary);
|
|
67
|
+
transition:
|
|
68
|
+
border-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
|
|
69
|
+
box-shadow var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
70
|
+
flex-shrink: 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ── Element: inner dot ──────────────────────────────
|
|
74
|
+
&__dot {
|
|
75
|
+
width: 10px;
|
|
76
|
+
height: 10px;
|
|
77
|
+
border-radius: 50%;
|
|
78
|
+
background-color: var(--uds-surface-brand-primary);
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// ── Element: label ──────────────────────────────────
|
|
83
|
+
&__label {
|
|
84
|
+
@include uds-body-14-medium;
|
|
85
|
+
color: var(--uds-text-primary);
|
|
86
|
+
line-height: 20px;
|
|
87
|
+
cursor: pointer;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Radio";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
Range slider input for numeric value selection within a min/max range.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Volume, brightness, or zoom controls
|
|
7
|
+
- Price range filters
|
|
8
|
+
- Any numeric value selection within a bounded range
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `min` | `number` | `0` | Minimum value |
|
|
15
|
+
| `max` | `number` | `100` | Maximum value |
|
|
16
|
+
| `value` | `number` | `0` | Current value (controlled) |
|
|
17
|
+
| `step` | `number` | `1` | Step increment |
|
|
18
|
+
| `onChange` | `function` | — | Callback `(value: number) => void` |
|
|
19
|
+
| `label` | `string` | — | Label text |
|
|
20
|
+
| `showValue` | `boolean` | `false` | Display current value |
|
|
21
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
22
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
<Slider min={0} max={100} value={volume} onChange={setVolume} label="Volume" showValue />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Price filter
|
|
31
|
+
```jsx
|
|
32
|
+
<Slider min={0} max={1000} step={50} value={maxPrice} onChange={setMaxPrice} label="Max Price" showValue />
|
|
33
|
+
```
|