@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,318 @@
|
|
|
1
|
+
import React, { useRef, useEffect, useState } from "react";
|
|
2
|
+
import TabItem from "./TabItem";
|
|
3
|
+
import Button from "../Button/Button";
|
|
4
|
+
import "./Tabs.scss";
|
|
5
|
+
|
|
6
|
+
const BASE_CLASS = "uds-tabs";
|
|
7
|
+
|
|
8
|
+
const appearanceClassMap = {
|
|
9
|
+
underline: "underline",
|
|
10
|
+
block: "block",
|
|
11
|
+
"block-inverted": "block-inverted",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Tabs component - A simple complete tab group
|
|
16
|
+
*
|
|
17
|
+
* @param {Array} tabs - Array of tab objects: [{ label, icon?, tag?, onClick? }, ...]
|
|
18
|
+
* @param {string} appearance - Visual style variant: 'underline', 'block', or 'block-inverted'
|
|
19
|
+
* @param {number} activeTab - Index of the currently active tab (0-based)
|
|
20
|
+
* @param {boolean} fill - Whether tabs should fill available width (default: false)
|
|
21
|
+
* @param {boolean} scrollable - Whether tabs should scroll when overflowing (default: false)
|
|
22
|
+
* @param {function} onTabChange - Callback when tab changes: (index) => void
|
|
23
|
+
* @param {string} className - Additional CSS classes
|
|
24
|
+
* @param {object} props - Additional props to pass to the tabs container
|
|
25
|
+
*/
|
|
26
|
+
export default function Tabs({
|
|
27
|
+
tabs = [],
|
|
28
|
+
appearance = "underline",
|
|
29
|
+
activeTab,
|
|
30
|
+
fill = false,
|
|
31
|
+
scrollable = false,
|
|
32
|
+
onTabChange,
|
|
33
|
+
className = "",
|
|
34
|
+
...props
|
|
35
|
+
}) {
|
|
36
|
+
const tabsContainerRef = useRef(null);
|
|
37
|
+
const tabsListRef = useRef(null);
|
|
38
|
+
const [showLeftScroll, setShowLeftScroll] = useState(false);
|
|
39
|
+
const [showRightScroll, setShowRightScroll] = useState(false);
|
|
40
|
+
const [, setScrollPosition] = useState(0);
|
|
41
|
+
|
|
42
|
+
// Default to first tab (index 0) if activeTab is not provided or invalid
|
|
43
|
+
const currentActiveTab = activeTab !== undefined && activeTab !== null && activeTab >= 0 && activeTab < tabs.length
|
|
44
|
+
? activeTab
|
|
45
|
+
: 0;
|
|
46
|
+
|
|
47
|
+
const classNames = [
|
|
48
|
+
BASE_CLASS,
|
|
49
|
+
appearanceClassMap[appearance] &&
|
|
50
|
+
`${BASE_CLASS}--${appearanceClassMap[appearance]}`,
|
|
51
|
+
fill && `${BASE_CLASS}--fill`,
|
|
52
|
+
scrollable && `${BASE_CLASS}--scrollable`,
|
|
53
|
+
className,
|
|
54
|
+
]
|
|
55
|
+
.filter(Boolean)
|
|
56
|
+
.join(" ");
|
|
57
|
+
|
|
58
|
+
const handleTabClick = (index, tab) => {
|
|
59
|
+
if (tab.onClick) {
|
|
60
|
+
tab.onClick(index, tab);
|
|
61
|
+
}
|
|
62
|
+
if (onTabChange) {
|
|
63
|
+
onTabChange(index, tab);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// Check if scrolling is needed and update scroll button visibility
|
|
68
|
+
const checkScrollButtons = () => {
|
|
69
|
+
if (!scrollable || !tabsContainerRef.current || !tabsListRef.current) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const container = tabsContainerRef.current;
|
|
74
|
+
const list = tabsListRef.current;
|
|
75
|
+
const containerWidth = container.offsetWidth;
|
|
76
|
+
const listWidth = list.scrollWidth;
|
|
77
|
+
const scrollLeft = list.scrollLeft;
|
|
78
|
+
|
|
79
|
+
setShowLeftScroll(scrollLeft > 0);
|
|
80
|
+
setShowRightScroll(scrollLeft < listWidth - containerWidth - 1);
|
|
81
|
+
setScrollPosition(scrollLeft);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Scroll to active tab if it's not visible
|
|
85
|
+
const scrollToActiveTab = () => {
|
|
86
|
+
if (!scrollable || !tabsListRef.current || currentActiveTab === undefined) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const list = tabsListRef.current;
|
|
91
|
+
const container = tabsContainerRef.current;
|
|
92
|
+
const activeTabElement = list.children[currentActiveTab];
|
|
93
|
+
|
|
94
|
+
if (!activeTabElement || !container) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const _containerLeft = container.offsetLeft; // eslint-disable-line no-unused-vars
|
|
99
|
+
const containerWidth = container.offsetWidth;
|
|
100
|
+
const tabLeft = activeTabElement.offsetLeft;
|
|
101
|
+
const tabWidth = activeTabElement.offsetWidth;
|
|
102
|
+
const scrollLeft = list.scrollLeft;
|
|
103
|
+
|
|
104
|
+
// Check if tab is outside visible area
|
|
105
|
+
const tabRight = tabLeft + tabWidth;
|
|
106
|
+
const visibleLeft = scrollLeft;
|
|
107
|
+
const visibleRight = scrollLeft + containerWidth;
|
|
108
|
+
|
|
109
|
+
if (tabLeft < visibleLeft) {
|
|
110
|
+
// Tab is to the left of visible area
|
|
111
|
+
list.scrollTo({
|
|
112
|
+
left: tabLeft - 16, // Add some padding
|
|
113
|
+
behavior: "smooth",
|
|
114
|
+
});
|
|
115
|
+
} else if (tabRight > visibleRight) {
|
|
116
|
+
// Tab is to the right of visible area
|
|
117
|
+
list.scrollTo({
|
|
118
|
+
left: tabRight - containerWidth + 16, // Add some padding
|
|
119
|
+
behavior: "smooth",
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Handle scroll button clicks
|
|
125
|
+
const handleScrollLeft = () => {
|
|
126
|
+
if (!tabsListRef.current) return;
|
|
127
|
+
const scrollAmount = tabsListRef.current.offsetWidth * 0.75;
|
|
128
|
+
tabsListRef.current.scrollBy({
|
|
129
|
+
left: -scrollAmount,
|
|
130
|
+
behavior: "smooth",
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const handleScrollRight = () => {
|
|
135
|
+
if (!tabsListRef.current) return;
|
|
136
|
+
const scrollAmount = tabsListRef.current.offsetWidth * 0.75;
|
|
137
|
+
tabsListRef.current.scrollBy({
|
|
138
|
+
left: scrollAmount,
|
|
139
|
+
behavior: "smooth",
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// Check scroll buttons on mount, resize, and scroll
|
|
144
|
+
useEffect(() => {
|
|
145
|
+
if (!scrollable) return;
|
|
146
|
+
|
|
147
|
+
checkScrollButtons();
|
|
148
|
+
scrollToActiveTab();
|
|
149
|
+
|
|
150
|
+
const container = tabsContainerRef.current;
|
|
151
|
+
const list = tabsListRef.current;
|
|
152
|
+
|
|
153
|
+
if (!container || !list) return;
|
|
154
|
+
|
|
155
|
+
const resizeObserver = new ResizeObserver(() => {
|
|
156
|
+
checkScrollButtons();
|
|
157
|
+
scrollToActiveTab();
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
resizeObserver.observe(container);
|
|
161
|
+
resizeObserver.observe(list);
|
|
162
|
+
|
|
163
|
+
list.addEventListener("scroll", checkScrollButtons);
|
|
164
|
+
|
|
165
|
+
return () => {
|
|
166
|
+
resizeObserver.disconnect();
|
|
167
|
+
list.removeEventListener("scroll", checkScrollButtons);
|
|
168
|
+
};
|
|
169
|
+
}, [scrollable, tabs.length]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
170
|
+
|
|
171
|
+
// Auto-select first tab on mount if no activeTab is provided
|
|
172
|
+
useEffect(() => {
|
|
173
|
+
if (activeTab === undefined || activeTab === null) {
|
|
174
|
+
if (onTabChange && tabs.length > 0) {
|
|
175
|
+
onTabChange(0, tabs[0]);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
179
|
+
|
|
180
|
+
// Scroll to active tab when it changes
|
|
181
|
+
useEffect(() => {
|
|
182
|
+
if (scrollable) {
|
|
183
|
+
// Small delay to ensure DOM is updated
|
|
184
|
+
setTimeout(() => {
|
|
185
|
+
scrollToActiveTab();
|
|
186
|
+
checkScrollButtons();
|
|
187
|
+
}, 100);
|
|
188
|
+
}
|
|
189
|
+
}, [currentActiveTab, scrollable]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
190
|
+
|
|
191
|
+
// Early return after all hooks
|
|
192
|
+
if (!tabs || tabs.length === 0) {
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const tabsContent = (
|
|
197
|
+
<div
|
|
198
|
+
ref={tabsListRef}
|
|
199
|
+
className={`${BASE_CLASS}__list`}
|
|
200
|
+
role="tablist"
|
|
201
|
+
{...props}
|
|
202
|
+
>
|
|
203
|
+
{tabs.map((tab, index) => {
|
|
204
|
+
// Ensure tab is an object and extract safe values
|
|
205
|
+
if (!tab || typeof tab !== "object") return null;
|
|
206
|
+
|
|
207
|
+
// Safely extract label - ensure it's a string, not an object
|
|
208
|
+
const label = (tab.label != null && typeof tab.label === "string")
|
|
209
|
+
? tab.label
|
|
210
|
+
: (tab.label != null && typeof tab.label !== "object")
|
|
211
|
+
? String(tab.label)
|
|
212
|
+
: "";
|
|
213
|
+
|
|
214
|
+
// Safely extract icon - only use if it's a string
|
|
215
|
+
const icon = typeof tab.icon === "string" ? tab.icon : undefined;
|
|
216
|
+
|
|
217
|
+
// Safely extract tag - only use if it's a number or string
|
|
218
|
+
const tag = (typeof tab.tag === "number" || typeof tab.tag === "string")
|
|
219
|
+
? tab.tag
|
|
220
|
+
: undefined;
|
|
221
|
+
|
|
222
|
+
// Safely extract tagVariant - only use if it's a string
|
|
223
|
+
const tagVariant = typeof tab.tagVariant === "string" ? tab.tagVariant : undefined;
|
|
224
|
+
|
|
225
|
+
// Safely get key - ensure it's a string or number
|
|
226
|
+
const tabKey = (tab.id != null && typeof tab.id !== "object")
|
|
227
|
+
? (typeof tab.id === "string" || typeof tab.id === "number" ? tab.id : String(tab.id))
|
|
228
|
+
: index;
|
|
229
|
+
|
|
230
|
+
return (
|
|
231
|
+
<TabItem
|
|
232
|
+
key={tabKey}
|
|
233
|
+
label={label}
|
|
234
|
+
appearance={appearance}
|
|
235
|
+
active={index === currentActiveTab}
|
|
236
|
+
icon={icon}
|
|
237
|
+
tag={tag}
|
|
238
|
+
tagVariant={tagVariant}
|
|
239
|
+
onClick={() => handleTabClick(index, tab)}
|
|
240
|
+
/>
|
|
241
|
+
);
|
|
242
|
+
})}
|
|
243
|
+
</div>
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
if (scrollable) {
|
|
247
|
+
return (
|
|
248
|
+
<div ref={tabsContainerRef} className={classNames}>
|
|
249
|
+
{showLeftScroll && (
|
|
250
|
+
<Button
|
|
251
|
+
appearance="ghost"
|
|
252
|
+
layout="icon-only"
|
|
253
|
+
icon="CaretLeft"
|
|
254
|
+
onClick={handleScrollLeft}
|
|
255
|
+
className={`${BASE_CLASS}__scroll-button ${BASE_CLASS}__scroll-button--left`}
|
|
256
|
+
aria-label="Scroll tabs left"
|
|
257
|
+
/>
|
|
258
|
+
)}
|
|
259
|
+
{tabsContent}
|
|
260
|
+
{showRightScroll && (
|
|
261
|
+
<Button
|
|
262
|
+
appearance="ghost"
|
|
263
|
+
layout="icon-only"
|
|
264
|
+
icon="CaretRight"
|
|
265
|
+
onClick={handleScrollRight}
|
|
266
|
+
className={`${BASE_CLASS}__scroll-button ${BASE_CLASS}__scroll-button--right`}
|
|
267
|
+
aria-label="Scroll tabs right"
|
|
268
|
+
/>
|
|
269
|
+
)}
|
|
270
|
+
</div>
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return (
|
|
275
|
+
<div className={classNames} role="tablist" {...props}>
|
|
276
|
+
{tabs.map((tab, index) => {
|
|
277
|
+
// Ensure tab is an object and extract safe values
|
|
278
|
+
if (!tab || typeof tab !== "object") return null;
|
|
279
|
+
|
|
280
|
+
// Safely extract label - ensure it's a string, not an object
|
|
281
|
+
const label = (tab.label != null && typeof tab.label === "string")
|
|
282
|
+
? tab.label
|
|
283
|
+
: (tab.label != null && typeof tab.label !== "object")
|
|
284
|
+
? String(tab.label)
|
|
285
|
+
: "";
|
|
286
|
+
|
|
287
|
+
// Safely extract icon - only use if it's a string
|
|
288
|
+
const icon = typeof tab.icon === "string" ? tab.icon : undefined;
|
|
289
|
+
|
|
290
|
+
// Safely extract tag - only use if it's a number or string
|
|
291
|
+
const tag = (typeof tab.tag === "number" || typeof tab.tag === "string")
|
|
292
|
+
? tab.tag
|
|
293
|
+
: undefined;
|
|
294
|
+
|
|
295
|
+
// Safely extract tagVariant - only use if it's a string
|
|
296
|
+
const tagVariant = typeof tab.tagVariant === "string" ? tab.tagVariant : undefined;
|
|
297
|
+
|
|
298
|
+
// Safely get key - ensure it's a string or number
|
|
299
|
+
const tabKey = (tab.id != null && typeof tab.id !== "object")
|
|
300
|
+
? (typeof tab.id === "string" || typeof tab.id === "number" ? tab.id : String(tab.id))
|
|
301
|
+
: index;
|
|
302
|
+
|
|
303
|
+
return (
|
|
304
|
+
<TabItem
|
|
305
|
+
key={tabKey}
|
|
306
|
+
label={label}
|
|
307
|
+
appearance={appearance}
|
|
308
|
+
active={index === currentActiveTab}
|
|
309
|
+
icon={icon}
|
|
310
|
+
tag={tag}
|
|
311
|
+
tagVariant={tagVariant}
|
|
312
|
+
onClick={() => handleTabClick(index, tab)}
|
|
313
|
+
/>
|
|
314
|
+
);
|
|
315
|
+
})}
|
|
316
|
+
</div>
|
|
317
|
+
);
|
|
318
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds {
|
|
4
|
+
&-tabs {
|
|
5
|
+
all: unset;
|
|
6
|
+
display: flex;
|
|
7
|
+
gap: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
position: relative;
|
|
10
|
+
overflow-y: hidden;
|
|
11
|
+
|
|
12
|
+
&__list {
|
|
13
|
+
all: unset;
|
|
14
|
+
display: flex;
|
|
15
|
+
gap: 0;
|
|
16
|
+
width: 100%;
|
|
17
|
+
scroll-behavior: smooth;
|
|
18
|
+
overflow-y: hidden;
|
|
19
|
+
scrollbar-width: none; // Firefox
|
|
20
|
+
-ms-overflow-style: none; // IE and Edge
|
|
21
|
+
|
|
22
|
+
&::-webkit-scrollbar {
|
|
23
|
+
display: none; // Chrome, Safari, Opera
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&--scrollable {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(--uds-gap-4);
|
|
31
|
+
position: relative;
|
|
32
|
+
|
|
33
|
+
.uds-tabs__list {
|
|
34
|
+
flex: 1;
|
|
35
|
+
min-width: 0; // Allows flex item to shrink below content size
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__scroll-button {
|
|
40
|
+
flex-shrink: 0;
|
|
41
|
+
z-index: 1;
|
|
42
|
+
position: relative;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-item {
|
|
46
|
+
@include uds-body-14-semibold;
|
|
47
|
+
all: unset;
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
display: inline-flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
justify-content: center;
|
|
52
|
+
gap: var(--uds-gap-8);
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
position: relative;
|
|
55
|
+
user-select: none;
|
|
56
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
57
|
+
white-space: nowrap;
|
|
58
|
+
flex-shrink: 0; // Prevent tabs from shrinking
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&--block {
|
|
62
|
+
border-radius: var(--uds-radius-4);
|
|
63
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
64
|
+
padding: var(--uds-spacing-4);
|
|
65
|
+
|
|
66
|
+
button {
|
|
67
|
+
padding: var(--uds-spacing-8) var(--uds-spacing-12);
|
|
68
|
+
@include uds-body-14-medium;
|
|
69
|
+
|
|
70
|
+
&.active {
|
|
71
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
72
|
+
border-radius: var(--uds-radius-4);
|
|
73
|
+
color: var(--uds-text-inverse);
|
|
74
|
+
@include uds-body-14-semibold;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--block-inverted {
|
|
80
|
+
border-radius: var(--uds-radius-4);
|
|
81
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
82
|
+
padding: var(--uds-spacing-4);
|
|
83
|
+
|
|
84
|
+
button {
|
|
85
|
+
padding: var(--uds-spacing-8) var(--uds-spacing-12);
|
|
86
|
+
@include uds-body-14-medium;
|
|
87
|
+
|
|
88
|
+
&.active {
|
|
89
|
+
background-color: var(--uds-surface-primary);
|
|
90
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
91
|
+
color: var(--uds-icon-brand-tertiary);
|
|
92
|
+
@include uds-body-14-semibold;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--underline {
|
|
98
|
+
border-bottom: solid var(--uds-border-width-1) var(--uds-border-primary);
|
|
99
|
+
|
|
100
|
+
button {
|
|
101
|
+
margin-bottom: -1px;
|
|
102
|
+
padding: var(--uds-spacing-12) var(--uds-spacing-24);
|
|
103
|
+
|
|
104
|
+
&.active {
|
|
105
|
+
border-bottom: solid 2px var(--uds-border-brand-tertiary);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Overflow menu container
|
|
111
|
+
&__overflow-menu {
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
flex-shrink: 0;
|
|
115
|
+
position: relative;
|
|
116
|
+
left: 0;
|
|
117
|
+
z-index: 1;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Style overflow button for underline appearance
|
|
121
|
+
&--underline {
|
|
122
|
+
.uds-tabs__overflow-menu button {
|
|
123
|
+
margin-bottom: -1px;
|
|
124
|
+
padding: var(--uds-spacing-12) var(--uds-spacing-24);
|
|
125
|
+
@include uds-body-16;
|
|
126
|
+
|
|
127
|
+
&.active {
|
|
128
|
+
border-bottom: solid 2px var(--uds-border-brand-tertiary);
|
|
129
|
+
@include uds-body-14-semibold;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Style overflow button for block appearance
|
|
135
|
+
&--block {
|
|
136
|
+
.uds-tabs__overflow-menu button {
|
|
137
|
+
padding: var(--uds-spacing-8) var(--uds-spacing-12);
|
|
138
|
+
@include uds-body-14-medium;
|
|
139
|
+
|
|
140
|
+
&.active {
|
|
141
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
142
|
+
border-radius: var(--uds-radius-4);
|
|
143
|
+
color: var(--uds-text-inverse);
|
|
144
|
+
@include uds-body-14-semibold;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Style overflow button for block-inverted appearance
|
|
150
|
+
&--block-inverted {
|
|
151
|
+
.uds-tabs__overflow-menu button {
|
|
152
|
+
padding: var(--uds-spacing-8) var(--uds-spacing-12);
|
|
153
|
+
@include uds-body-14-medium;
|
|
154
|
+
|
|
155
|
+
&.active {
|
|
156
|
+
background-color: var(--uds-surface-primary);
|
|
157
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
158
|
+
color: var(--uds-icon-brand-tertiary);
|
|
159
|
+
@include uds-body-14-semibold;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Tabs from "./Tabs";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Components/Tabs",
|
|
5
|
+
component: Tabs,
|
|
6
|
+
tags: ["autodocs"],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const Default = {
|
|
10
|
+
args: {
|
|
11
|
+
tabs: [
|
|
12
|
+
{ id: "overview", label: "Overview" },
|
|
13
|
+
{ id: "details", label: "Details" },
|
|
14
|
+
{ id: "settings", label: "Settings" },
|
|
15
|
+
],
|
|
16
|
+
activeTab: 0,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Tag
|
|
2
|
+
|
|
3
|
+
Colored label component for categorization, status, or metadata display.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Status labels (Active, Pending, Archived)
|
|
7
|
+
- Category tags on cards or list items
|
|
8
|
+
- Metadata labels (role, department, type)
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Values | Description |
|
|
13
|
+
|------|------|---------|--------|-------------|
|
|
14
|
+
| `label` | `string` | — | — | Tag text |
|
|
15
|
+
| `color` | `string` | `"gray"` | `"red"`, `"orange"`, `"yellow"`, `"green"`, `"dark-green"`, `"blue"`, `"dark-blue"`, `"purple"`, `"pink"`, `"gray"` | Tag color |
|
|
16
|
+
| `variant` | `string` | `"filled"` | `"filled"`, `"outline"` | Fill style |
|
|
17
|
+
| `size` | `string` | `"default"` | `"small"`, `"default"` | Tag size |
|
|
18
|
+
| `removable` | `boolean` | `false` | — | Show remove button |
|
|
19
|
+
| `onRemove` | `function` | — | — | Remove callback |
|
|
20
|
+
| `className` | `string` | `""` | — | Additional CSS classes |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
### Status tags
|
|
25
|
+
```jsx
|
|
26
|
+
<Tag label="Active" color="green" />
|
|
27
|
+
<Tag label="Pending" color="yellow" />
|
|
28
|
+
<Tag label="Archived" color="gray" variant="outline" />
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Removable filter tags
|
|
32
|
+
```jsx
|
|
33
|
+
{filters.map(f => (
|
|
34
|
+
<Tag key={f} label={f} color="blue" removable onRemove={() => removeFilter(f)} />
|
|
35
|
+
))}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### In a table cell
|
|
39
|
+
```jsx
|
|
40
|
+
const columns = [
|
|
41
|
+
{
|
|
42
|
+
key: "status",
|
|
43
|
+
label: "Status",
|
|
44
|
+
render: (value) => (
|
|
45
|
+
<Tag label={value} color={value === "Active" ? "green" : "gray"} size="small" />
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Semantic Color Guide
|
|
52
|
+
| Color | Use For |
|
|
53
|
+
|-------|---------|
|
|
54
|
+
| `green` | Active, success, approved |
|
|
55
|
+
| `red` | Error, rejected, critical |
|
|
56
|
+
| `yellow` | Warning, pending, review |
|
|
57
|
+
| `blue` | Info, selected, default |
|
|
58
|
+
| `gray` | Neutral, inactive, archived |
|
|
59
|
+
| `purple` | Special, premium, custom |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Tag from './Tag';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma Code Connect for Tag component
|
|
6
|
+
*
|
|
7
|
+
* Simple execution version of tag with various configurations
|
|
8
|
+
*/
|
|
9
|
+
export default function TagFigma({
|
|
10
|
+
label = 'Label',
|
|
11
|
+
appearance = 'label-only',
|
|
12
|
+
size = 'compact',
|
|
13
|
+
color = 'transparent',
|
|
14
|
+
rounded = true,
|
|
15
|
+
solid = false,
|
|
16
|
+
icon,
|
|
17
|
+
}) {
|
|
18
|
+
return (
|
|
19
|
+
<Tag
|
|
20
|
+
label={label}
|
|
21
|
+
appearance={appearance}
|
|
22
|
+
size={size}
|
|
23
|
+
color={color}
|
|
24
|
+
rounded={rounded}
|
|
25
|
+
solid={solid}
|
|
26
|
+
icon={icon}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
}
|