@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 @@
|
|
|
1
|
+
export { default } from "./Card";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Binary toggle input with label and indeterminate state support.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Form fields for boolean selections (terms acceptance, preferences)
|
|
7
|
+
- Multi-select lists with "select all" (indeterminate state)
|
|
8
|
+
- Filter controls
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `checked` | `boolean` | `false` | Whether checked |
|
|
15
|
+
| `onChange` | `function` | — | Callback `(checked: boolean) => void` |
|
|
16
|
+
| `label` | `string` | — | Label text |
|
|
17
|
+
| `id` | `string` | auto-generated | Unique identifier |
|
|
18
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
19
|
+
| `indeterminate` | `boolean` | `false` | Indeterminate/partial state (for "select all") |
|
|
20
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
### Basic
|
|
25
|
+
```jsx
|
|
26
|
+
<Checkbox label="I agree to the terms" checked={agreed} onChange={setAgreed} />
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Select all pattern
|
|
30
|
+
```jsx
|
|
31
|
+
<Checkbox
|
|
32
|
+
label="Select All"
|
|
33
|
+
checked={allSelected}
|
|
34
|
+
indeterminate={someSelected && !allSelected}
|
|
35
|
+
onChange={handleSelectAll}
|
|
36
|
+
/>
|
|
37
|
+
{items.map(item => (
|
|
38
|
+
<Checkbox key={item.id} label={item.name} checked={item.selected} onChange={() => toggleItem(item.id)} />
|
|
39
|
+
))}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### In a form
|
|
43
|
+
```jsx
|
|
44
|
+
<Field label="Preferences">
|
|
45
|
+
<Flex direction="column" gap="8">
|
|
46
|
+
<Checkbox label="Email notifications" checked={emailNotifs} onChange={setEmailNotifs} />
|
|
47
|
+
<Checkbox label="SMS notifications" checked={smsNotifs} onChange={setSmsNotifs} />
|
|
48
|
+
</Flex>
|
|
49
|
+
</Field>
|
|
50
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import "./Checkbox.scss";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Checkbox component for form inputs
|
|
7
|
+
* @param {boolean} checked - Whether the checkbox is checked
|
|
8
|
+
* @param {function} onChange - Callback function when checkbox state changes
|
|
9
|
+
* @param {string} id - Unique identifier for the checkbox input
|
|
10
|
+
* @param {string} label - Label text for the checkbox
|
|
11
|
+
* @param {boolean} disabled - Whether the checkbox is disabled
|
|
12
|
+
* @param {boolean} indeterminate - Whether the checkbox is in indeterminate state
|
|
13
|
+
* @param {string} className - Additional CSS classes
|
|
14
|
+
* @param {object} props - Additional props to pass to the checkbox
|
|
15
|
+
*/
|
|
16
|
+
export default function Checkbox({
|
|
17
|
+
checked = false,
|
|
18
|
+
onChange,
|
|
19
|
+
id,
|
|
20
|
+
label,
|
|
21
|
+
disabled = false,
|
|
22
|
+
indeterminate = false,
|
|
23
|
+
className = "",
|
|
24
|
+
...props
|
|
25
|
+
}) {
|
|
26
|
+
const checkboxId =
|
|
27
|
+
id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
28
|
+
|
|
29
|
+
const handleChange = (event) => {
|
|
30
|
+
if (!disabled && onChange) {
|
|
31
|
+
onChange(event.target.checked);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// Only show indeterminate state when some (but not all) items are selected
|
|
36
|
+
const showIndeterminate = indeterminate && !checked;
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<label
|
|
40
|
+
className={`checkbox ${disabled ? "checkbox--disabled" : ""} ${showIndeterminate ? "checkbox--indeterminate" : ""} ${className}`}
|
|
41
|
+
htmlFor={checkboxId}
|
|
42
|
+
>
|
|
43
|
+
<input
|
|
44
|
+
type="checkbox"
|
|
45
|
+
id={checkboxId}
|
|
46
|
+
className="checkbox__input"
|
|
47
|
+
checked={checked}
|
|
48
|
+
onChange={handleChange}
|
|
49
|
+
disabled={disabled}
|
|
50
|
+
ref={(input) => {
|
|
51
|
+
if (input) {
|
|
52
|
+
input.indeterminate = indeterminate;
|
|
53
|
+
}
|
|
54
|
+
}}
|
|
55
|
+
{...props}
|
|
56
|
+
/>
|
|
57
|
+
<span className="checkbox__box">
|
|
58
|
+
{checked && (
|
|
59
|
+
<Icon
|
|
60
|
+
name="Check"
|
|
61
|
+
size={16}
|
|
62
|
+
appearance="bold"
|
|
63
|
+
className="checkbox__icon"
|
|
64
|
+
/>
|
|
65
|
+
)}
|
|
66
|
+
{indeterminate && !checked && (
|
|
67
|
+
<span className="checkbox__indeterminate" />
|
|
68
|
+
)}
|
|
69
|
+
</span>
|
|
70
|
+
{label && <span className="checkbox__label">{label}</span>}
|
|
71
|
+
</label>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.checkbox {
|
|
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
|
+
.checkbox__label {
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
color: var(--uds-text-secondary);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ── Modifier: indeterminate ─────────────────────────
|
|
23
|
+
&--indeterminate {
|
|
24
|
+
.checkbox__box {
|
|
25
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
26
|
+
border-color: var(--uds-border-brand-tertiary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.checkbox__input:not(:disabled) + .checkbox__box:hover {
|
|
30
|
+
background-color: var(--uds-surface-brand-secondary);
|
|
31
|
+
border-color: var(--uds-border-brand-secondary);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ── Element: hidden input ───────────────────────────
|
|
36
|
+
&__input {
|
|
37
|
+
position: absolute;
|
|
38
|
+
opacity: 0;
|
|
39
|
+
width: 0;
|
|
40
|
+
height: 0;
|
|
41
|
+
margin: 0;
|
|
42
|
+
|
|
43
|
+
&:focus-visible + .checkbox__box {
|
|
44
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
45
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:checked + .checkbox__box {
|
|
49
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
50
|
+
border-color: var(--uds-border-brand-tertiary);
|
|
51
|
+
color: var(--uds-text-inverse);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:not(:checked):not(:disabled) + .checkbox__box:hover {
|
|
55
|
+
border-color: var(--uds-border-brand-primary);
|
|
56
|
+
background-color: var(--uds-surface-tertiary);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:disabled + .checkbox__box {
|
|
60
|
+
background-color: var(--uds-surface-tertiary);
|
|
61
|
+
border-color: var(--uds-border-primary);
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&:disabled + .checkbox__box + .checkbox__label {
|
|
66
|
+
color: var(--uds-text-secondary);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// ── Element: visual box ─────────────────────────────
|
|
71
|
+
&__box {
|
|
72
|
+
position: relative;
|
|
73
|
+
display: inline-flex;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
width: 20px;
|
|
77
|
+
height: 20px;
|
|
78
|
+
min-width: 20px;
|
|
79
|
+
min-height: 20px;
|
|
80
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
81
|
+
border-radius: var(--uds-radius-4);
|
|
82
|
+
background-color: var(--uds-surface-tertiary);
|
|
83
|
+
transition:
|
|
84
|
+
background-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
|
|
85
|
+
border-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
|
|
86
|
+
box-shadow var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
87
|
+
flex-shrink: 0;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// ── Element: check icon ─────────────────────────────
|
|
91
|
+
&__icon {
|
|
92
|
+
color: var(--uds-text-inverse);
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
width: 16px;
|
|
97
|
+
height: 16px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// ── Element: indeterminate dash ─────────────────────
|
|
101
|
+
&__indeterminate {
|
|
102
|
+
width: 10px;
|
|
103
|
+
height: 2px;
|
|
104
|
+
background-color: var(--uds-color-white);
|
|
105
|
+
border-radius: 1px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// ── Element: label ──────────────────────────────────
|
|
109
|
+
&__label {
|
|
110
|
+
@include uds-body-14-medium;
|
|
111
|
+
color: var(--uds-text-primary);
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Checkbox";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Interactive label component for filters, selections, or tags with optional icon and badge.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Filter chips (active/inactive filters)
|
|
7
|
+
- Selection chips in multi-select contexts
|
|
8
|
+
- Compact labels with optional icons and counts
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Values | Description |
|
|
13
|
+
|------|------|---------|--------|-------------|
|
|
14
|
+
| `label` | `string` | — | — | Chip text |
|
|
15
|
+
| `appearance` | `string` | `"outline"` | `"outline"`, `"primary"` | Visual style |
|
|
16
|
+
| `shape` | `string` | `"pill"` | `"pill"`, `"rounded"` | Shape variant |
|
|
17
|
+
| `iconPlacement` | `string` | `"none"` | `"none"`, `"left"`, `"right"`, `"both"` | Icon position |
|
|
18
|
+
| `icon` | `string` | — | Phosphor icon name | Icon to display |
|
|
19
|
+
| `badge` | `number\|string` | — | — | Badge count |
|
|
20
|
+
| `badgeVariant` | `string` | `"red"` | Badge color variant | Badge color |
|
|
21
|
+
| `onClick` | `function` | — | — | Makes chip interactive (renders as button) |
|
|
22
|
+
| `disabled` | `boolean` | `false` | — | Disabled state |
|
|
23
|
+
| `className` | `string` | `""` | — | Additional CSS classes |
|
|
24
|
+
|
|
25
|
+
## Examples
|
|
26
|
+
|
|
27
|
+
### Filter chips
|
|
28
|
+
```jsx
|
|
29
|
+
<Flex gap="8">
|
|
30
|
+
<Chip label="All" appearance="primary" onClick={() => setFilter("all")} />
|
|
31
|
+
<Chip label="Active" onClick={() => setFilter("active")} />
|
|
32
|
+
<Chip label="Archived" onClick={() => setFilter("archived")} />
|
|
33
|
+
</Flex>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### With icon and badge
|
|
37
|
+
```jsx
|
|
38
|
+
<Chip label="Messages" icon="ChatCircle" iconPlacement="left" badge={5} />
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Note
|
|
42
|
+
- Renders as `<button>` when `onClick` is provided, `<span>` otherwise
|
|
43
|
+
- Uses `Badge` component internally for the badge count
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import Badge from "../Badge/Badge";
|
|
4
|
+
import "./Chip.scss";
|
|
5
|
+
|
|
6
|
+
const BASE_CLASS = "uds-chip";
|
|
7
|
+
|
|
8
|
+
const appearanceClassMap = {
|
|
9
|
+
outline: "outline",
|
|
10
|
+
primary: "primary",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const shapeClassMap = {
|
|
14
|
+
pill: "pill",
|
|
15
|
+
rounded: "rounded",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const iconPlacementClassMap = {
|
|
19
|
+
both: "icon-both",
|
|
20
|
+
left: "icon-left",
|
|
21
|
+
right: "icon-right",
|
|
22
|
+
none: "icon-none",
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Chip component for displaying labels, tags, or filters
|
|
27
|
+
* @param {string} label - The text content of the chip
|
|
28
|
+
* @param {string} appearance - Visual style variant: 'outline' or 'primary'
|
|
29
|
+
* @param {string} shape - Shape variant: 'pill' (fully rounded) or 'rounded' (slightly rounded)
|
|
30
|
+
* @param {string} iconPlacement - Icon placement: 'both', 'left', 'right', or 'none'
|
|
31
|
+
* @param {string} icon - Icon name to display (when iconPlacement is not 'none')
|
|
32
|
+
* @param {number|string} badge - Badge count to display
|
|
33
|
+
* @param {string} badgeVariant - Badge color variant (default: 'red')
|
|
34
|
+
* @param {string} className - Additional CSS classes
|
|
35
|
+
* @param {function} onClick - Click handler function
|
|
36
|
+
* @param {boolean} disabled - Whether the chip is disabled
|
|
37
|
+
* @param {object} props - Additional props to pass to the chip element
|
|
38
|
+
*/
|
|
39
|
+
export default function Chip({
|
|
40
|
+
label,
|
|
41
|
+
appearance = "outline",
|
|
42
|
+
shape = "pill",
|
|
43
|
+
iconPlacement = "none",
|
|
44
|
+
icon,
|
|
45
|
+
badge,
|
|
46
|
+
badgeVariant = "red",
|
|
47
|
+
className = "",
|
|
48
|
+
onClick,
|
|
49
|
+
disabled = false,
|
|
50
|
+
...props
|
|
51
|
+
}) {
|
|
52
|
+
const classNames = [
|
|
53
|
+
BASE_CLASS,
|
|
54
|
+
appearanceClassMap[appearance] &&
|
|
55
|
+
`${BASE_CLASS}--${appearanceClassMap[appearance]}`,
|
|
56
|
+
shapeClassMap[shape] && `${BASE_CLASS}--${shapeClassMap[shape]}`,
|
|
57
|
+
iconPlacementClassMap[iconPlacement] &&
|
|
58
|
+
`${BASE_CLASS}--${iconPlacementClassMap[iconPlacement]}`,
|
|
59
|
+
disabled && `${BASE_CLASS}--disabled`,
|
|
60
|
+
className,
|
|
61
|
+
]
|
|
62
|
+
.filter(Boolean)
|
|
63
|
+
.join(" ");
|
|
64
|
+
|
|
65
|
+
const hasLeftIcon = iconPlacement === "both" || iconPlacement === "left";
|
|
66
|
+
const hasRightIcon = iconPlacement === "both" || iconPlacement === "right";
|
|
67
|
+
const Element = onClick ? "button" : "span";
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Element
|
|
71
|
+
className={classNames}
|
|
72
|
+
onClick={disabled ? undefined : onClick}
|
|
73
|
+
disabled={disabled}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
{hasLeftIcon && icon && (
|
|
77
|
+
<Icon
|
|
78
|
+
name={icon}
|
|
79
|
+
size={16}
|
|
80
|
+
appearance="regular"
|
|
81
|
+
className={`${BASE_CLASS}__icon ${BASE_CLASS}__icon--left`}
|
|
82
|
+
/>
|
|
83
|
+
)}
|
|
84
|
+
{label && <span className={`${BASE_CLASS}__label`}>{label}</span>}
|
|
85
|
+
{hasRightIcon && icon && (
|
|
86
|
+
<Icon
|
|
87
|
+
name={icon}
|
|
88
|
+
size={16}
|
|
89
|
+
appearance="regular"
|
|
90
|
+
className={`${BASE_CLASS}__icon ${BASE_CLASS}__icon--right`}
|
|
91
|
+
/>
|
|
92
|
+
)}
|
|
93
|
+
{badge && (
|
|
94
|
+
<Badge
|
|
95
|
+
count={badge}
|
|
96
|
+
variant={badgeVariant}
|
|
97
|
+
className={`${BASE_CLASS}__badge`}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
</Element>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-chip {
|
|
4
|
+
@include uds-body-14-medium;
|
|
5
|
+
display: inline-flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
gap: var(--uds-gap-8);
|
|
9
|
+
padding-inline: var(--uds-spacing-12);
|
|
10
|
+
padding-block: var(--uds-spacing-6);
|
|
11
|
+
border: var(--uds-border-width-1) solid;
|
|
12
|
+
background-color: var(--uds-surface-primary);
|
|
13
|
+
color: var(--uds-text-primary);
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
user-select: none;
|
|
16
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
white-space: nowrap;
|
|
19
|
+
width: fit-content;
|
|
20
|
+
min-width: fit-content;
|
|
21
|
+
max-width: fit-content;
|
|
22
|
+
height: fit-content;
|
|
23
|
+
|
|
24
|
+
// When used as button, remove default button styles but inherit chip styles
|
|
25
|
+
&:is(button) {
|
|
26
|
+
font: inherit;
|
|
27
|
+
background: none;
|
|
28
|
+
border: var(--uds-border-width-1) solid;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Shape variants
|
|
32
|
+
&--pill {
|
|
33
|
+
border-radius: 999px; // Fully rounded pill shape
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&--rounded {
|
|
37
|
+
border-radius: var(--uds-radius-4); // Slightly rounded rectangular
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Appearance variants
|
|
41
|
+
&--outline {
|
|
42
|
+
background-color: var(--uds-surface-primary);
|
|
43
|
+
border-color: var(--uds-border-primary);
|
|
44
|
+
color: var(--uds-text-primary);
|
|
45
|
+
|
|
46
|
+
&:hover:not(.uds-chip--disabled) {
|
|
47
|
+
border-color: var(--uds-border-secondary);
|
|
48
|
+
background-color: var(--uds-surface-secondary);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:active:not(.uds-chip--disabled) {
|
|
52
|
+
border-color: var(--uds-border-tertiary);
|
|
53
|
+
background-color: var(--uds-surface-tertiary);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&--primary {
|
|
58
|
+
background-color: var(--uds-surface-brand-primary);
|
|
59
|
+
border-color: var(--uds-border-brand-tertiary);
|
|
60
|
+
color: var(--uds-text-primary);
|
|
61
|
+
|
|
62
|
+
&:hover:not(.uds-chip--disabled) {
|
|
63
|
+
background-color: var(--uds-surface-brand-primary);
|
|
64
|
+
border-color: var(--uds-border-brand-primary);
|
|
65
|
+
color: var(--uds-text-brand-primary);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&:active:not(.uds-chip--disabled) {
|
|
69
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
70
|
+
border-color: var(--uds-border-brand-primary);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Icon placement
|
|
75
|
+
&__icon {
|
|
76
|
+
display: inline-flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
flex-shrink: 0;
|
|
80
|
+
line-height: 0;
|
|
81
|
+
|
|
82
|
+
svg {
|
|
83
|
+
width: 16px;
|
|
84
|
+
height: 16px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&--left {
|
|
88
|
+
order: -1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&--right {
|
|
92
|
+
order: 1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&__label {
|
|
97
|
+
display: inline-block;
|
|
98
|
+
white-space: nowrap;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__badge {
|
|
102
|
+
margin-left: var(--uds-gap-4);
|
|
103
|
+
flex-shrink: 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Disabled state
|
|
107
|
+
&--disabled {
|
|
108
|
+
cursor: not-allowed;
|
|
109
|
+
opacity: 0.6;
|
|
110
|
+
pointer-events: none;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Focus state
|
|
114
|
+
&:focus-visible {
|
|
115
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
116
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Chip";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Datepicker
|
|
2
|
+
|
|
3
|
+
Calendar-based date selection input.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Date fields in forms (birthdate, deadline, event date)
|
|
7
|
+
- Date range selection for filters or reports
|
|
8
|
+
- Any input that requires a date value
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `value` | `Date\|string` | — | Selected date |
|
|
15
|
+
| `onChange` | `function` | — | Callback `(date: Date) => void` |
|
|
16
|
+
| `placeholder` | `string` | `"Select date"` | Placeholder text |
|
|
17
|
+
| `minDate` | `Date\|string` | — | Earliest selectable date |
|
|
18
|
+
| `maxDate` | `Date\|string` | — | Latest selectable date |
|
|
19
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
20
|
+
| `state` | `string` | `"default"` | `"default"`, `"error"`, `"disabled"` |
|
|
21
|
+
| `format` | `string` | `"MM/DD/YYYY"` | Display format |
|
|
22
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
<Datepicker value={date} onChange={setDate} placeholder="Choose a date" />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With min/max constraints
|
|
31
|
+
```jsx
|
|
32
|
+
<Datepicker
|
|
33
|
+
value={startDate}
|
|
34
|
+
onChange={setStartDate}
|
|
35
|
+
minDate={new Date()}
|
|
36
|
+
maxDate={new Date(2025, 11, 31)}
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### In a form
|
|
41
|
+
```jsx
|
|
42
|
+
<Field label="Start Date" required>
|
|
43
|
+
<Datepicker value={startDate} onChange={setStartDate} />
|
|
44
|
+
</Field>
|
|
45
|
+
```
|