@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,129 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-dropdown {
|
|
4
|
+
// ActionMenu default is inline-block; we override to full width
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
// ── Outer wrapper (label + dropdown) ────────────────
|
|
8
|
+
&-outer {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
gap: var(--uds-gap-8);
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// ── Element: label ──────────────────────────────────
|
|
16
|
+
&__label {
|
|
17
|
+
@include uds-body-14-medium;
|
|
18
|
+
color: var(--uds-text-primary);
|
|
19
|
+
display: block;
|
|
20
|
+
margin-bottom: var(--uds-gap-8);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// ── Element: trigger button (default = 44px) ────────
|
|
24
|
+
&__trigger {
|
|
25
|
+
@include uds-body-16;
|
|
26
|
+
all: unset;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
width: 100%;
|
|
31
|
+
height: 44px;
|
|
32
|
+
padding: var(--uds-spacing-10) var(--uds-spacing-12);
|
|
33
|
+
background-color: var(--uds-input-surface);
|
|
34
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
35
|
+
border-radius: var(--uds-radius-4);
|
|
36
|
+
color: var(--uds-text-primary);
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
39
|
+
box-sizing: border-box;
|
|
40
|
+
text-align: left;
|
|
41
|
+
|
|
42
|
+
&:focus-visible {
|
|
43
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
44
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ── Element: displayed value ────────────────────────
|
|
49
|
+
&__value {
|
|
50
|
+
flex: 1;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
|
|
55
|
+
&--placeholder {
|
|
56
|
+
color: var(--uds-text-secondary);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ── Element: caret icon ─────────────────────────────
|
|
61
|
+
&__icon {
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
margin-left: var(--uds-gap-8);
|
|
64
|
+
transition: transform var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
65
|
+
color: var(--uds-text-secondary);
|
|
66
|
+
|
|
67
|
+
&--open {
|
|
68
|
+
transform: rotate(180deg);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ── Element: options panel (via ActionMenu menuClassName)
|
|
73
|
+
&__menu {
|
|
74
|
+
max-height: 300px;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ── Size: compact ───────────────────────────────────
|
|
79
|
+
&--compact {
|
|
80
|
+
.uds-dropdown__trigger {
|
|
81
|
+
padding: var(--uds-spacing-8) var(--uds-spacing-10);
|
|
82
|
+
@include uds-body-14;
|
|
83
|
+
height: 36px;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ── State: focused ──────────────────────────────────
|
|
88
|
+
&--focused {
|
|
89
|
+
.uds-dropdown__trigger {
|
|
90
|
+
border-color: var(--uds-border-brand-primary);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// ── State: error ────────────────────────────────────
|
|
95
|
+
&--error {
|
|
96
|
+
.uds-dropdown__trigger {
|
|
97
|
+
border-color: var(--uds-text-error, #ef4444);
|
|
98
|
+
background-color: var(--uds-surface-primary);
|
|
99
|
+
color: #ef4444;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.uds-dropdown__value {
|
|
103
|
+
color: #ef4444;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.uds-dropdown__icon {
|
|
107
|
+
color: #ef4444;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── State: disabled ─────────────────────────────────
|
|
112
|
+
&--disabled {
|
|
113
|
+
.uds-dropdown__trigger {
|
|
114
|
+
background-color: var(--uds-surface-tertiary);
|
|
115
|
+
border-color: var(--uds-border-primary);
|
|
116
|
+
color: var(--uds-text-secondary);
|
|
117
|
+
cursor: not-allowed;
|
|
118
|
+
opacity: 0.6;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.uds-dropdown__value {
|
|
122
|
+
color: var(--uds-text-secondary);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.uds-dropdown__icon {
|
|
126
|
+
color: var(--uds-text-secondary);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export const DROPDOWN_BASE_CLASS = "uds-dropdown";
|
|
2
|
+
|
|
3
|
+
export const DROPDOWN_SIZES = ["compact", "default"] as const;
|
|
4
|
+
export const DROPDOWN_STATES = ["default", "focused", "error", "disabled"] as const;
|
|
5
|
+
|
|
6
|
+
export const DROPDOWN_DEFAULTS = {
|
|
7
|
+
options: [],
|
|
8
|
+
placeholder: "Select an option",
|
|
9
|
+
size: "default",
|
|
10
|
+
state: "default",
|
|
11
|
+
placement: "bottom-start",
|
|
12
|
+
className: "",
|
|
13
|
+
disabled: false,
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
16
|
+
export const DROPDOWN_CLASS_MAP = {
|
|
17
|
+
size: {
|
|
18
|
+
compact: "compact",
|
|
19
|
+
default: null,
|
|
20
|
+
} as const,
|
|
21
|
+
state: {
|
|
22
|
+
default: null,
|
|
23
|
+
focused: "focused",
|
|
24
|
+
error: "error",
|
|
25
|
+
disabled: "disabled",
|
|
26
|
+
} as const,
|
|
27
|
+
} as const;
|
|
28
|
+
|
|
29
|
+
export const DROPDOWN_STORY_SPEC = {
|
|
30
|
+
defaults: {
|
|
31
|
+
options: [
|
|
32
|
+
{ value: "apple", label: "Apple" },
|
|
33
|
+
{ value: "orange", label: "Orange" },
|
|
34
|
+
{ value: "banana", label: "Banana" },
|
|
35
|
+
],
|
|
36
|
+
value: "apple",
|
|
37
|
+
placeholder: DROPDOWN_DEFAULTS.placeholder,
|
|
38
|
+
size: DROPDOWN_DEFAULTS.size,
|
|
39
|
+
state: DROPDOWN_DEFAULTS.state,
|
|
40
|
+
placement: DROPDOWN_DEFAULTS.placement,
|
|
41
|
+
disabled: DROPDOWN_DEFAULTS.disabled,
|
|
42
|
+
label: "Fruit",
|
|
43
|
+
},
|
|
44
|
+
options: {
|
|
45
|
+
size: DROPDOWN_SIZES,
|
|
46
|
+
state: DROPDOWN_STATES,
|
|
47
|
+
},
|
|
48
|
+
stories: {
|
|
49
|
+
default: {},
|
|
50
|
+
compact: { size: "compact" },
|
|
51
|
+
error: { state: "error" },
|
|
52
|
+
disabled: { disabled: true, state: "disabled" },
|
|
53
|
+
},
|
|
54
|
+
} as const;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Dropdown from "./Dropdown";
|
|
2
|
+
import { DROPDOWN_STORY_SPEC } from "./Dropdown.spec";
|
|
3
|
+
import { createStoryArgsFromSpec } from "../_spec/createStoryArgsFromSpec";
|
|
4
|
+
|
|
5
|
+
type DropdownStoryArgs = {
|
|
6
|
+
options: readonly { value: string; label: string }[];
|
|
7
|
+
value: string;
|
|
8
|
+
placeholder: string;
|
|
9
|
+
size: "compact" | "default";
|
|
10
|
+
state: "default" | "focused" | "error" | "disabled";
|
|
11
|
+
placement: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
label: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const DROPDOWN_DEFAULT_ARGS: DropdownStoryArgs = {
|
|
17
|
+
...DROPDOWN_STORY_SPEC.defaults,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const fromSpec = createStoryArgsFromSpec<DropdownStoryArgs>(DROPDOWN_DEFAULT_ARGS);
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
title: "Components/Dropdown",
|
|
24
|
+
component: Dropdown,
|
|
25
|
+
tags: ["autodocs"],
|
|
26
|
+
args: DROPDOWN_DEFAULT_ARGS,
|
|
27
|
+
argTypes: {
|
|
28
|
+
size: {
|
|
29
|
+
control: "select",
|
|
30
|
+
options: [...DROPDOWN_STORY_SPEC.options.size],
|
|
31
|
+
},
|
|
32
|
+
state: {
|
|
33
|
+
control: "select",
|
|
34
|
+
options: [...DROPDOWN_STORY_SPEC.options.state],
|
|
35
|
+
},
|
|
36
|
+
label: { control: "text", description: "Field label" },
|
|
37
|
+
placeholder: { control: "text", description: "Placeholder text" },
|
|
38
|
+
options: { control: "object", description: "Dropdown options list" },
|
|
39
|
+
},
|
|
40
|
+
parameters: {
|
|
41
|
+
layout: "padded",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const Default = {
|
|
46
|
+
args: fromSpec(DROPDOWN_STORY_SPEC.stories.default),
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Compact = {
|
|
50
|
+
args: fromSpec(DROPDOWN_STORY_SPEC.stories.compact),
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Error = {
|
|
54
|
+
args: fromSpec(DROPDOWN_STORY_SPEC.stories.error),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const Disabled = {
|
|
58
|
+
args: fromSpec(DROPDOWN_STORY_SPEC.stories.disabled),
|
|
59
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, test } from "@jest/globals";
|
|
2
|
+
import { render, screen } from "@testing-library/react";
|
|
3
|
+
import Dropdown from "./Dropdown";
|
|
4
|
+
import { DROPDOWN_DEFAULTS, DROPDOWN_SIZES } from "./Dropdown.spec";
|
|
5
|
+
|
|
6
|
+
describe("Dropdown spec sync", () => {
|
|
7
|
+
test("renders label and placeholder from defaults", () => {
|
|
8
|
+
render(<Dropdown label="Fruit" />);
|
|
9
|
+
expect(screen.getByRole("button", { name: /Fruit/i })).toBeInTheDocument();
|
|
10
|
+
expect(screen.getByText(DROPDOWN_DEFAULTS.placeholder)).toBeInTheDocument();
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("supports all size options from spec", () => {
|
|
14
|
+
DROPDOWN_SIZES.forEach((size) => {
|
|
15
|
+
const { container, unmount } = render(<Dropdown size={size} />);
|
|
16
|
+
const root = container.querySelector(".uds-dropdown");
|
|
17
|
+
if (size === DROPDOWN_DEFAULTS.size) {
|
|
18
|
+
expect(root).not.toHaveClass(`uds-dropdown--${size}`);
|
|
19
|
+
} else {
|
|
20
|
+
expect(root).toHaveClass(`uds-dropdown--${size}`);
|
|
21
|
+
}
|
|
22
|
+
unmount();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
test("normalizes string options and renders selected value", () => {
|
|
27
|
+
render(
|
|
28
|
+
<Dropdown
|
|
29
|
+
label="Sort by"
|
|
30
|
+
options={["Latest", "Oldest"]}
|
|
31
|
+
value="Oldest"
|
|
32
|
+
/>,
|
|
33
|
+
);
|
|
34
|
+
expect(screen.getByRole("button", { name: /Sort by/i })).toBeInTheDocument();
|
|
35
|
+
expect(screen.getByText("Oldest")).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import ActionMenu from "../ActionMenu/ActionMenu";
|
|
4
|
+
import "./Dropdown.scss";
|
|
5
|
+
import {
|
|
6
|
+
DROPDOWN_BASE_CLASS,
|
|
7
|
+
DROPDOWN_CLASS_MAP,
|
|
8
|
+
DROPDOWN_DEFAULTS,
|
|
9
|
+
} from "./Dropdown.spec";
|
|
10
|
+
import type { DropdownOption, DropdownProps } from "./Dropdown.types";
|
|
11
|
+
|
|
12
|
+
const IconComponent = Icon as any;
|
|
13
|
+
const ActionMenuComponent = ActionMenu as any;
|
|
14
|
+
|
|
15
|
+
export default function Dropdown({
|
|
16
|
+
options = [],
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
placeholder = DROPDOWN_DEFAULTS.placeholder,
|
|
20
|
+
size = DROPDOWN_DEFAULTS.size,
|
|
21
|
+
state = DROPDOWN_DEFAULTS.state,
|
|
22
|
+
placement = DROPDOWN_DEFAULTS.placement,
|
|
23
|
+
id,
|
|
24
|
+
label,
|
|
25
|
+
className = DROPDOWN_DEFAULTS.className,
|
|
26
|
+
disabled = DROPDOWN_DEFAULTS.disabled,
|
|
27
|
+
...props
|
|
28
|
+
}: DropdownProps) {
|
|
29
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
30
|
+
|
|
31
|
+
const dropdownId = id || `dropdown-${Math.random().toString(36).substr(2, 9)}`;
|
|
32
|
+
|
|
33
|
+
const normalizedOptions = useMemo<DropdownOption[]>(
|
|
34
|
+
() =>
|
|
35
|
+
options.map((option) =>
|
|
36
|
+
typeof option === "string" ? { value: option, label: option } : option,
|
|
37
|
+
),
|
|
38
|
+
[options],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const currentState =
|
|
42
|
+
disabled ? "disabled" : state === "default" && isOpen ? "focused" : state;
|
|
43
|
+
|
|
44
|
+
const selectedOption = normalizedOptions.find((opt) => opt.value === value);
|
|
45
|
+
const displayValue = selectedOption ? selectedOption.label : placeholder;
|
|
46
|
+
|
|
47
|
+
const menuItems = useMemo(
|
|
48
|
+
() =>
|
|
49
|
+
normalizedOptions.map((opt) => ({
|
|
50
|
+
id: opt.value,
|
|
51
|
+
label: opt.label,
|
|
52
|
+
active: opt.value === value,
|
|
53
|
+
onClick: () => {
|
|
54
|
+
if (onChange && !disabled) {
|
|
55
|
+
onChange(opt.value);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
})),
|
|
59
|
+
[normalizedOptions, value, onChange, disabled],
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
const wrapperClassNames = [
|
|
63
|
+
DROPDOWN_BASE_CLASS,
|
|
64
|
+
DROPDOWN_CLASS_MAP.size[size] && `${DROPDOWN_BASE_CLASS}--${DROPDOWN_CLASS_MAP.size[size]}`,
|
|
65
|
+
DROPDOWN_CLASS_MAP.state[currentState] &&
|
|
66
|
+
`${DROPDOWN_BASE_CLASS}--${DROPDOWN_CLASS_MAP.state[currentState]}`,
|
|
67
|
+
isOpen && `${DROPDOWN_BASE_CLASS}--open`,
|
|
68
|
+
className,
|
|
69
|
+
]
|
|
70
|
+
.filter(Boolean)
|
|
71
|
+
.join(" ");
|
|
72
|
+
|
|
73
|
+
const triggerButton = (
|
|
74
|
+
<button
|
|
75
|
+
type="button"
|
|
76
|
+
id={dropdownId}
|
|
77
|
+
className={`${DROPDOWN_BASE_CLASS}__trigger`}
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
aria-label={label || placeholder}
|
|
80
|
+
{...props}
|
|
81
|
+
>
|
|
82
|
+
<span
|
|
83
|
+
className={`${DROPDOWN_BASE_CLASS}__value ${
|
|
84
|
+
!selectedOption ? `${DROPDOWN_BASE_CLASS}__value--placeholder` : ""
|
|
85
|
+
}`}
|
|
86
|
+
>
|
|
87
|
+
{displayValue}
|
|
88
|
+
</span>
|
|
89
|
+
<IconComponent
|
|
90
|
+
name="CaretDown"
|
|
91
|
+
size={16}
|
|
92
|
+
appearance="regular"
|
|
93
|
+
className={`${DROPDOWN_BASE_CLASS}__icon ${
|
|
94
|
+
isOpen ? `${DROPDOWN_BASE_CLASS}__icon--open` : ""
|
|
95
|
+
}`}
|
|
96
|
+
/>
|
|
97
|
+
</button>
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<div className={`${DROPDOWN_BASE_CLASS}-outer`}>
|
|
102
|
+
{label && (
|
|
103
|
+
<label htmlFor={dropdownId} className={`${DROPDOWN_BASE_CLASS}__label`}>
|
|
104
|
+
{label}
|
|
105
|
+
</label>
|
|
106
|
+
)}
|
|
107
|
+
<ActionMenuComponent
|
|
108
|
+
trigger={triggerButton}
|
|
109
|
+
items={menuItems}
|
|
110
|
+
placement={placement}
|
|
111
|
+
fullWidth
|
|
112
|
+
disabled={disabled}
|
|
113
|
+
onOpenChange={setIsOpen}
|
|
114
|
+
className={wrapperClassNames}
|
|
115
|
+
menuClassName={`${DROPDOWN_BASE_CLASS}__menu`}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "react";
|
|
2
|
+
import type { DROPDOWN_SIZES, DROPDOWN_STATES } from "./Dropdown.spec";
|
|
3
|
+
|
|
4
|
+
export type DropdownSize = (typeof DROPDOWN_SIZES)[number];
|
|
5
|
+
export type DropdownState = (typeof DROPDOWN_STATES)[number];
|
|
6
|
+
|
|
7
|
+
export interface DropdownOption {
|
|
8
|
+
value: string | number;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface DropdownProps
|
|
13
|
+
extends Omit<HTMLAttributes<HTMLButtonElement>, "onChange"> {
|
|
14
|
+
options?: Array<DropdownOption | string>;
|
|
15
|
+
value?: string | number;
|
|
16
|
+
onChange?: (value: string | number) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
size?: DropdownSize;
|
|
19
|
+
state?: DropdownState;
|
|
20
|
+
placement?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
label?: string;
|
|
23
|
+
className?: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Dropdown";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# EventCard (Blade)
|
|
2
|
+
|
|
3
|
+
A visual scheduling event bar for calendars, schedules, and lists.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Displaying events within the Calendar component (automatic)
|
|
7
|
+
- Building event lists, timelines, or schedule views
|
|
8
|
+
- Dashboard scheduling summaries
|
|
9
|
+
- Any UI that shows travel, assignment, or unassigned events
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Values | Description |
|
|
14
|
+
|------|------|---------|--------|-------------|
|
|
15
|
+
| `title` | `string` | `"Title"` | Any text | Event title text |
|
|
16
|
+
| `type` | `string` | `"travel"` | `"travel"`, `"assignment"`, `"unassigned"` | Event type (determines color) |
|
|
17
|
+
| `status` | `string` | `"active"` | `"active"`, `"past"`, `"pending"` | Event status (determines fill style) |
|
|
18
|
+
| `badge` | `string` | — | Any text | Badge label text (compact inverse Tag) |
|
|
19
|
+
| `icon` | `boolean` | `false` | `true`, `false` | Show CornersOut expand icon |
|
|
20
|
+
| `startCap` | `boolean` | `true` | `true`, `false` | Rounded left corners |
|
|
21
|
+
| `endCap` | `boolean` | `true` | `true`, `false` | Rounded right corners |
|
|
22
|
+
| `onClick` | `function` | — | `() => void` | Click handler |
|
|
23
|
+
| `className` | `string` | `""` | Any CSS class | Additional CSS classes |
|
|
24
|
+
|
|
25
|
+
## Color Matrix
|
|
26
|
+
|
|
27
|
+
| Type | Active | Past | Pending |
|
|
28
|
+
|------|--------|------|---------|
|
|
29
|
+
| `travel` | Blue solid (`primary-500`) | Neutral gray (`neutrals-100`) | Cyan striped (`cyan-50` + `cyan-200` border) |
|
|
30
|
+
| `assignment` | Orange solid (`secondary-500`) | Neutral gray (`neutrals-100`) | Aqua striped (`aqua-50` + `aqua-200` border) |
|
|
31
|
+
| `unassigned` | Gray solid (`neutrals-500`) | Neutral gray (`neutrals-100`) | Light gray striped (`neutrals-50` + `neutrals-500` border) |
|
|
32
|
+
|
|
33
|
+
## Code Examples
|
|
34
|
+
|
|
35
|
+
### Basic EventCard
|
|
36
|
+
```jsx
|
|
37
|
+
import { EventCard } from "@mich8060/chg-design-system";
|
|
38
|
+
|
|
39
|
+
<EventCard title="Denver, CO" type="travel" status="active" />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### With Badge
|
|
43
|
+
```jsx
|
|
44
|
+
<EventCard title="Salt Lake" type="assignment" status="active" badge="Label" />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### With Icon
|
|
48
|
+
```jsx
|
|
49
|
+
<EventCard title="Denver" type="travel" status="active" icon />
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### With Badge + Icon
|
|
53
|
+
```jsx
|
|
54
|
+
<EventCard title="Denver" type="travel" status="active" badge="Label" icon />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Multi-day Spanning
|
|
58
|
+
```jsx
|
|
59
|
+
import { EventCard, Flex } from "@mich8060/chg-design-system";
|
|
60
|
+
|
|
61
|
+
<Flex gap="0">
|
|
62
|
+
<EventCard title="5-Day Trip" type="travel" status="active" startCap endCap={false} />
|
|
63
|
+
<EventCard title="" type="travel" status="active" startCap={false} endCap={false} />
|
|
64
|
+
<EventCard title="" type="travel" status="active" startCap={false} endCap={false} />
|
|
65
|
+
<EventCard title="" type="travel" status="active" startCap={false} endCap />
|
|
66
|
+
</Flex>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Schedule List
|
|
70
|
+
```jsx
|
|
71
|
+
<Flex direction="column" gap="4">
|
|
72
|
+
<EventCard title="Denver, CO" type="travel" status="active" onClick={...} />
|
|
73
|
+
<EventCard title="Salt Lake City" type="assignment" status="active" badge="2" onClick={...} />
|
|
74
|
+
<EventCard title="Open Shift" type="unassigned" status="active" onClick={...} />
|
|
75
|
+
<EventCard title="Portland" type="travel" status="pending" onClick={...} />
|
|
76
|
+
</Flex>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Cap Behavior
|
|
80
|
+
|
|
81
|
+
| startCap | endCap | Rounding | Content |
|
|
82
|
+
|----------|--------|----------|---------|
|
|
83
|
+
| `true` | `true` | All corners | Title + badge + icon |
|
|
84
|
+
| `true` | `false` | Left only | Title + badge + icon |
|
|
85
|
+
| `false` | `true` | Right only | Bar only (unless icon/badge) |
|
|
86
|
+
| `false` | `false` | None | Bar only (unless icon/badge) |
|
|
87
|
+
|
|
88
|
+
When `startCap={false}` and neither `icon` nor `badge` is set, only a color bar is rendered.
|
|
89
|
+
|
|
90
|
+
## Do's and Don'ts
|
|
91
|
+
- **Do** use `type` to match the event's scheduling category
|
|
92
|
+
- **Do** use `status` to reflect whether the event is current, completed, or tentative
|
|
93
|
+
- **Do** use `startCap`/`endCap` for multi-day calendar spanning
|
|
94
|
+
- **Don't** manually set caps unless building custom calendar layouts
|
|
95
|
+
- **Do** use `onClick` to make events interactive
|
|
96
|
+
|
|
97
|
+
## Accessibility
|
|
98
|
+
- Renders as `<button>` when `onClick` is provided, otherwise `<div>`
|
|
99
|
+
- Includes `title` attribute for tooltip
|
|
100
|
+
- Supports keyboard focus when clickable
|
|
101
|
+
- Pending pattern overlay has `aria-hidden="true"`
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Tag from "../Tag/Tag";
|
|
3
|
+
import Icon from "../Icon/Icon";
|
|
4
|
+
import "./EventCard.scss";
|
|
5
|
+
|
|
6
|
+
const BASE_CLASS = "uds-event-card";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* EventCard (Blade) — A visual scheduling event bar for calendars and lists.
|
|
10
|
+
*
|
|
11
|
+
* Displays events as colored bars with type-based coloring (travel, assignment,
|
|
12
|
+
* unassigned), status styling (active, past, pending), optional badge, and
|
|
13
|
+
* optional expand icon. Supports startCap/endCap for multi-day spanning.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} title - Event title text
|
|
16
|
+
* @param {string} type - Color type: "travel" | "assignment" | "unassigned"
|
|
17
|
+
* @param {string} status - Visual status: "active" | "past" | "pending"
|
|
18
|
+
* @param {string} badge - Badge label text (falsy to hide)
|
|
19
|
+
* @param {boolean} icon - Show CornersOut expand icon
|
|
20
|
+
* @param {boolean} startCap - Rounded left corners (true = start of event)
|
|
21
|
+
* @param {boolean} endCap - Rounded right corners (true = end of event)
|
|
22
|
+
* @param {function} onClick - Click handler (renders as <button>)
|
|
23
|
+
* @param {string} className - Additional CSS classes
|
|
24
|
+
*/
|
|
25
|
+
export default function EventCard({
|
|
26
|
+
title = "Title",
|
|
27
|
+
type = "travel",
|
|
28
|
+
status = "active",
|
|
29
|
+
badge,
|
|
30
|
+
icon = false,
|
|
31
|
+
startCap = true,
|
|
32
|
+
endCap = true,
|
|
33
|
+
onClick,
|
|
34
|
+
className = "",
|
|
35
|
+
...rest
|
|
36
|
+
}) {
|
|
37
|
+
// Content is shown when startCap is true, or when there's an icon or badge
|
|
38
|
+
const showContent = startCap || icon || !!badge;
|
|
39
|
+
|
|
40
|
+
const classNames = [
|
|
41
|
+
BASE_CLASS,
|
|
42
|
+
`${BASE_CLASS}--${type}`,
|
|
43
|
+
`${BASE_CLASS}--${status}`,
|
|
44
|
+
!startCap && `${BASE_CLASS}--no-start-cap`,
|
|
45
|
+
!endCap && `${BASE_CLASS}--no-end-cap`,
|
|
46
|
+
!showContent && `${BASE_CLASS}--bar-only`,
|
|
47
|
+
onClick && `${BASE_CLASS}--clickable`,
|
|
48
|
+
className,
|
|
49
|
+
]
|
|
50
|
+
.filter(Boolean)
|
|
51
|
+
.join(" ");
|
|
52
|
+
|
|
53
|
+
const Element = onClick ? "button" : "div";
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Element
|
|
57
|
+
className={classNames}
|
|
58
|
+
onClick={onClick}
|
|
59
|
+
type={onClick ? "button" : undefined}
|
|
60
|
+
title={title}
|
|
61
|
+
{...rest}
|
|
62
|
+
>
|
|
63
|
+
<div className={`${BASE_CLASS}__container`}>
|
|
64
|
+
{status === "pending" && (
|
|
65
|
+
<div className={`${BASE_CLASS}__pattern`} aria-hidden="true" />
|
|
66
|
+
)}
|
|
67
|
+
{showContent && (
|
|
68
|
+
<div className={`${BASE_CLASS}__content`}>
|
|
69
|
+
<span className={`${BASE_CLASS}__title`}>{title}</span>
|
|
70
|
+
{badge && (
|
|
71
|
+
<Tag
|
|
72
|
+
label={badge}
|
|
73
|
+
color="inverse"
|
|
74
|
+
solid
|
|
75
|
+
rounded
|
|
76
|
+
size="compact"
|
|
77
|
+
/>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
{icon && (
|
|
82
|
+
<Icon
|
|
83
|
+
name="CornersOut"
|
|
84
|
+
size={16}
|
|
85
|
+
appearance="regular"
|
|
86
|
+
className={`${BASE_CLASS}__icon`}
|
|
87
|
+
/>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
</Element>
|
|
91
|
+
);
|
|
92
|
+
}
|