@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,47 @@
|
|
|
1
|
+
# Toast
|
|
2
|
+
|
|
3
|
+
Notification toast for transient feedback messages.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Success confirmations ("Item saved successfully")
|
|
7
|
+
- Error messages ("Failed to delete item")
|
|
8
|
+
- Warning alerts and informational notices
|
|
9
|
+
- Any brief, auto-dismissing notification
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Default | Values | Description |
|
|
14
|
+
|------|------|---------|--------|-------------|
|
|
15
|
+
| `message` | `string` | — | — | Toast message text |
|
|
16
|
+
| `type` | `string` | `"info"` | `"success"`, `"error"`, `"warning"`, `"info"` | Toast variant |
|
|
17
|
+
| `duration` | `number` | `5000` | ms | Auto-dismiss duration (0 = persistent) |
|
|
18
|
+
| `onClose` | `function` | — | — | Close callback |
|
|
19
|
+
| `position` | `string` | `"top-right"` | `"top-right"`, `"top-left"`, `"bottom-right"`, `"bottom-left"`, `"top-center"`, `"bottom-center"` | Screen position |
|
|
20
|
+
| `action` | `object` | — | `{ label, onClick }` | Optional action button |
|
|
21
|
+
|
|
22
|
+
## Usage Pattern
|
|
23
|
+
|
|
24
|
+
### With toast manager
|
|
25
|
+
```jsx
|
|
26
|
+
import { useToast } from "@mich8060/chg-design-system";
|
|
27
|
+
|
|
28
|
+
function MyComponent() {
|
|
29
|
+
const { showToast } = useToast();
|
|
30
|
+
|
|
31
|
+
const handleSave = async () => {
|
|
32
|
+
try {
|
|
33
|
+
await saveData();
|
|
34
|
+
showToast({ message: "Saved successfully!", type: "success" });
|
|
35
|
+
} catch (err) {
|
|
36
|
+
showToast({ message: "Save failed", type: "error", duration: 0 });
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Direct usage
|
|
43
|
+
```jsx
|
|
44
|
+
{showSuccess && (
|
|
45
|
+
<Toast message="Item created" type="success" onClose={() => setShowSuccess(false)} />
|
|
46
|
+
)}
|
|
47
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import "./Toast.scss";
|
|
4
|
+
|
|
5
|
+
const BASE_CLASS = "uds-toast";
|
|
6
|
+
|
|
7
|
+
const variantClassMap = {
|
|
8
|
+
success: "success",
|
|
9
|
+
error: "error",
|
|
10
|
+
warning: "warning",
|
|
11
|
+
info: "info",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const iconMap = {
|
|
15
|
+
success: "CheckCircle",
|
|
16
|
+
error: "XCircle",
|
|
17
|
+
warning: "Warning",
|
|
18
|
+
info: "Info",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Toast component for displaying notification messages
|
|
23
|
+
* @param {string} message - The message text to display
|
|
24
|
+
* @param {string} variant - Toast variant: 'success', 'error', 'warning', 'info' (default: 'info')
|
|
25
|
+
* @param {string} title - Optional title text
|
|
26
|
+
* @param {boolean} showIcon - Whether to show an icon (default: true)
|
|
27
|
+
* @param {boolean} showClose - Whether to show a close button (default: true)
|
|
28
|
+
* @param {function} onClose - Callback function when toast is closed
|
|
29
|
+
* @param {string} className - Additional CSS classes
|
|
30
|
+
* @param {object} props - Additional props to pass to the toast element
|
|
31
|
+
*/
|
|
32
|
+
export default function Toast({
|
|
33
|
+
message,
|
|
34
|
+
variant = "info",
|
|
35
|
+
title,
|
|
36
|
+
showIcon = true,
|
|
37
|
+
showClose = true,
|
|
38
|
+
onClose,
|
|
39
|
+
className = "",
|
|
40
|
+
...props
|
|
41
|
+
}) {
|
|
42
|
+
const classNames = [
|
|
43
|
+
BASE_CLASS,
|
|
44
|
+
variantClassMap[variant] && `${BASE_CLASS}--${variantClassMap[variant]}`,
|
|
45
|
+
className,
|
|
46
|
+
]
|
|
47
|
+
.filter(Boolean)
|
|
48
|
+
.join(" ");
|
|
49
|
+
|
|
50
|
+
const iconName = iconMap[variant] || "Info";
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<div className={classNames} role="alert" {...props}>
|
|
54
|
+
{showIcon && (
|
|
55
|
+
<div className={`${BASE_CLASS}__icon`}>
|
|
56
|
+
<Icon name={iconName} size={20} appearance="fill" />
|
|
57
|
+
</div>
|
|
58
|
+
)}
|
|
59
|
+
<div className={`${BASE_CLASS}__content`}>
|
|
60
|
+
{title && <div className={`${BASE_CLASS}__title`}>{title}</div>}
|
|
61
|
+
{message && <div className={`${BASE_CLASS}__message`}>{message}</div>}
|
|
62
|
+
</div>
|
|
63
|
+
{showClose && onClose && (
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
className={`${BASE_CLASS}__close`}
|
|
67
|
+
onClick={onClose}
|
|
68
|
+
aria-label="Close toast"
|
|
69
|
+
>
|
|
70
|
+
<Icon name="X" size={16} appearance="regular" />
|
|
71
|
+
</button>
|
|
72
|
+
)}
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-toast {
|
|
4
|
+
@include uds-body-14;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: flex-start;
|
|
7
|
+
gap: var(--uds-gap-12);
|
|
8
|
+
padding: var(--uds-spacing-16);
|
|
9
|
+
border-radius: var(--uds-radius-8);
|
|
10
|
+
box-shadow: var(--uds-shadow-light-200);
|
|
11
|
+
background: var(--uds-surface-primary);
|
|
12
|
+
border: var(--uds-border-width-1) solid var(--uds-border-primary);
|
|
13
|
+
min-width: 320px;
|
|
14
|
+
max-width: 420px;
|
|
15
|
+
position: relative;
|
|
16
|
+
z-index: var(--uds-elevation-toast);
|
|
17
|
+
|
|
18
|
+
&__icon {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
flex-shrink: 0;
|
|
23
|
+
margin-top: 2px;
|
|
24
|
+
|
|
25
|
+
svg {
|
|
26
|
+
width: 20px;
|
|
27
|
+
height: 20px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&__content {
|
|
32
|
+
flex: 1;
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: var(--uds-gap-4);
|
|
36
|
+
min-width: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__title {
|
|
40
|
+
@include uds-body-14-semibold;
|
|
41
|
+
color: var(--uds-text-primary);
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&__message {
|
|
46
|
+
@include uds-body-14;
|
|
47
|
+
color: var(--uds-text-secondary);
|
|
48
|
+
margin: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&__close {
|
|
52
|
+
all: unset;
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
justify-content: center;
|
|
56
|
+
cursor: pointer;
|
|
57
|
+
padding: var(--uds-spacing-4);
|
|
58
|
+
margin: -4px -4px -4px 0;
|
|
59
|
+
border-radius: var(--uds-radius-4);
|
|
60
|
+
color: var(--uds-text-secondary);
|
|
61
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
|
|
64
|
+
&:hover {
|
|
65
|
+
background: var(--uds-surface-secondary);
|
|
66
|
+
color: var(--uds-text-primary);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
71
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
svg {
|
|
75
|
+
width: 16px;
|
|
76
|
+
height: 16px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Variant styles
|
|
81
|
+
&--success {
|
|
82
|
+
border-color: var(--uds-border-success, #10b981);
|
|
83
|
+
background: var(--uds-surface-success-light, #ecfdf5);
|
|
84
|
+
|
|
85
|
+
.uds-toast__icon {
|
|
86
|
+
color: var(--uds-text-success, #059669);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.uds-toast__title {
|
|
90
|
+
color: var(--uds-text-success, #059669);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--error {
|
|
95
|
+
border-color: var(--uds-border-error, #ef4444);
|
|
96
|
+
background: var(--uds-surface-error-light, #fef2f2);
|
|
97
|
+
|
|
98
|
+
.uds-toast__icon {
|
|
99
|
+
color: var(--uds-text-error, #dc2626);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.uds-toast__title {
|
|
103
|
+
color: var(--uds-text-error, #dc2626);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--warning {
|
|
108
|
+
border-color: var(--uds-border-warning, #f59e0b);
|
|
109
|
+
background: var(--uds-surface-warning-light, #fffbeb);
|
|
110
|
+
|
|
111
|
+
.uds-toast__icon {
|
|
112
|
+
color: var(--uds-text-warning, #d97706);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.uds-toast__title {
|
|
116
|
+
color: var(--uds-text-warning, #d97706);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&--info {
|
|
121
|
+
border-color: var(--uds-border-info, #3b82f6);
|
|
122
|
+
background: var(--uds-surface-info-light, #eff6ff);
|
|
123
|
+
|
|
124
|
+
.uds-toast__icon {
|
|
125
|
+
color: var(--uds-text-info, #2563eb);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.uds-toast__title {
|
|
129
|
+
color: var(--uds-text-info, #2563eb);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
On/off switch component with label and size variants.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Boolean settings (enable/disable features)
|
|
7
|
+
- Preference toggles (dark mode, notifications)
|
|
8
|
+
- Any on/off control
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Values | Description |
|
|
13
|
+
|------|------|---------|--------|-------------|
|
|
14
|
+
| `checked` | `boolean` | `false` | — | Whether on |
|
|
15
|
+
| `onChange` | `function` | — | `(checked: boolean) => void` | Toggle callback |
|
|
16
|
+
| `label` | `string` | — | — | Label text |
|
|
17
|
+
| `id` | `string` | auto | — | Unique ID |
|
|
18
|
+
| `disabled` | `boolean` | `false` | — | Disabled state |
|
|
19
|
+
| `size` | `string` | `"default"` | `"small"`, `"default"` | Toggle size |
|
|
20
|
+
| `className` | `string` | `""` | — | Additional CSS classes |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
<Toggle label="Dark Mode" checked={darkMode} onChange={setDarkMode} />
|
|
26
|
+
<Toggle label="Notifications" checked={notifs} onChange={setNotifs} size="small" />
|
|
27
|
+
<Toggle label="Disabled" disabled />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### In a settings form
|
|
31
|
+
```jsx
|
|
32
|
+
<Flex direction="column" gap="16">
|
|
33
|
+
<Toggle label="Email notifications" checked={email} onChange={setEmail} />
|
|
34
|
+
<Toggle label="Push notifications" checked={push} onChange={setPush} />
|
|
35
|
+
<Toggle label="SMS alerts" checked={sms} onChange={setSms} />
|
|
36
|
+
</Flex>
|
|
37
|
+
```
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Toggle.scss";
|
|
3
|
+
|
|
4
|
+
const BASE_CLASS = "uds-toggle";
|
|
5
|
+
|
|
6
|
+
const sizeClassMap = {
|
|
7
|
+
large: "large",
|
|
8
|
+
small: "small",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Toggle component for switching between states
|
|
13
|
+
* @param {boolean} checked - Whether the toggle is checked (on/off)
|
|
14
|
+
* @param {string} state - Toggle state: 'off', 'on', or 'indeterminate' (default: 'off')
|
|
15
|
+
* @param {string} size - Toggle size: 'large' or 'small' (default: 'large')
|
|
16
|
+
* @param {boolean} bordered - Whether to show border (default: false)
|
|
17
|
+
* @param {function} onChange - Callback function when toggle state changes
|
|
18
|
+
* @param {boolean} disabled - Whether the toggle is disabled
|
|
19
|
+
* @param {string} id - Unique identifier for the toggle input
|
|
20
|
+
* @param {string} className - Additional CSS classes
|
|
21
|
+
* @param {object} props - Additional props to pass to the toggle
|
|
22
|
+
*/
|
|
23
|
+
export default function Toggle({
|
|
24
|
+
checked,
|
|
25
|
+
state,
|
|
26
|
+
size = "large",
|
|
27
|
+
bordered = false,
|
|
28
|
+
onChange,
|
|
29
|
+
disabled = false,
|
|
30
|
+
id,
|
|
31
|
+
className = "",
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
// Determine state from checked prop if state is not provided
|
|
35
|
+
const toggleState = state || (checked ? "on" : "off");
|
|
36
|
+
|
|
37
|
+
const classNames = [
|
|
38
|
+
BASE_CLASS,
|
|
39
|
+
sizeClassMap[size] && `${BASE_CLASS}--${sizeClassMap[size]}`,
|
|
40
|
+
bordered && `${BASE_CLASS}--bordered`,
|
|
41
|
+
toggleState === "indeterminate" && `${BASE_CLASS}--indeterminate`,
|
|
42
|
+
disabled && `${BASE_CLASS}--disabled`,
|
|
43
|
+
className,
|
|
44
|
+
]
|
|
45
|
+
.filter(Boolean)
|
|
46
|
+
.join(" ");
|
|
47
|
+
|
|
48
|
+
const handleChange = (event) => {
|
|
49
|
+
if (!disabled && onChange) {
|
|
50
|
+
onChange(event.target.checked);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<label className={classNames} htmlFor={id} {...props}>
|
|
56
|
+
<input
|
|
57
|
+
type="checkbox"
|
|
58
|
+
id={id}
|
|
59
|
+
className={`${BASE_CLASS}__input`}
|
|
60
|
+
checked={checked || toggleState === "on"}
|
|
61
|
+
onChange={handleChange}
|
|
62
|
+
disabled={disabled}
|
|
63
|
+
/>
|
|
64
|
+
<span className={`${BASE_CLASS}__slider`}>
|
|
65
|
+
{toggleState === "indeterminate" ? (
|
|
66
|
+
<span className={`${BASE_CLASS}__dash`} />
|
|
67
|
+
) : (
|
|
68
|
+
<span className={`${BASE_CLASS}__thumb`} />
|
|
69
|
+
)}
|
|
70
|
+
</span>
|
|
71
|
+
</label>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-toggle {
|
|
4
|
+
position: relative;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
cursor: pointer;
|
|
7
|
+
|
|
8
|
+
// Large size (default)
|
|
9
|
+
width: 48px;
|
|
10
|
+
height: 28px;
|
|
11
|
+
|
|
12
|
+
&--small {
|
|
13
|
+
width: 36px;
|
|
14
|
+
height: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--disabled {
|
|
18
|
+
cursor: not-allowed;
|
|
19
|
+
opacity: 0.6;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__input {
|
|
23
|
+
opacity: 0;
|
|
24
|
+
width: 0;
|
|
25
|
+
height: 0;
|
|
26
|
+
position: absolute;
|
|
27
|
+
|
|
28
|
+
&:focus-visible + .uds-toggle__slider {
|
|
29
|
+
outline: var(--uds-focus-ring-width) solid var(--uds-focus-ring-border);
|
|
30
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&:disabled + .uds-toggle__slider {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__slider {
|
|
39
|
+
position: absolute;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
top: 0;
|
|
42
|
+
left: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
background-color: var(--uds-color-neutrals-400);
|
|
46
|
+
border-radius: 14px;
|
|
47
|
+
transition: background-color var(--uds-animation-duration-200)
|
|
48
|
+
var(--uds-animation-ease-standard);
|
|
49
|
+
border: none;
|
|
50
|
+
|
|
51
|
+
&:hover:not(.uds-toggle--disabled) {
|
|
52
|
+
background-color: var(--uds-color-neutrals-400);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&--bordered &__slider {
|
|
57
|
+
border: var(--uds-border-width-1) solid
|
|
58
|
+
var(--uds-border-brand-primary, #3b82f6);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&__thumb {
|
|
62
|
+
position: absolute;
|
|
63
|
+
content: "";
|
|
64
|
+
height: 20px;
|
|
65
|
+
width: 20px;
|
|
66
|
+
left: 4px;
|
|
67
|
+
top: 50%;
|
|
68
|
+
transform: translateY(-50%);
|
|
69
|
+
background-color: var(--uds-surface-primary, #ffffff);
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
transition:
|
|
72
|
+
transform var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
|
|
73
|
+
background-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard),
|
|
74
|
+
border-color var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
75
|
+
box-shadow: var(--uds-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.1));
|
|
76
|
+
border: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&--bordered &__thumb {
|
|
80
|
+
border: var(--uds-border-width-1) solid
|
|
81
|
+
var(--uds-border-brand-primary, #3b82f6);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__dash {
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 50%;
|
|
87
|
+
left: 50%;
|
|
88
|
+
transform: translate(-50%, -50%);
|
|
89
|
+
width: 12px;
|
|
90
|
+
height: 2px;
|
|
91
|
+
background-color: var(--uds-surface-primary, #ffffff);
|
|
92
|
+
border-radius: 1px;
|
|
93
|
+
border: none;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&--bordered &__dash {
|
|
97
|
+
border: var(--uds-border-width-1) solid
|
|
98
|
+
var(--uds-border-brand-primary, #3b82f6);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Small size adjustments
|
|
102
|
+
&--small &__thumb {
|
|
103
|
+
height: 14px;
|
|
104
|
+
width: 14px;
|
|
105
|
+
left: 3px;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&--small &__dash {
|
|
109
|
+
width: 8px;
|
|
110
|
+
height: 1.5px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Off state (default)
|
|
114
|
+
&__input:not(:checked) + &__slider {
|
|
115
|
+
background-color: var(--uds-color-neutrals-400);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&--bordered &__input:not(:checked) + &__slider {
|
|
119
|
+
background-color: var(--uds-surface-primary, #ffffff);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// On state
|
|
123
|
+
&__input:checked + &__slider {
|
|
124
|
+
background-color: var(--uds-surface-brand-tertiary);
|
|
125
|
+
|
|
126
|
+
.uds-toggle__thumb {
|
|
127
|
+
transform: translateY(-50%) translateX(20px);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&--small &__input:checked + &__slider .uds-toggle__thumb {
|
|
132
|
+
transform: translateY(-50%) translateX(16px);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Indeterminate state
|
|
136
|
+
&--indeterminate &__slider {
|
|
137
|
+
background-color: var(--uds-surface-brand-primary, #3b82f6);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Toggle";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Hover/focus tooltip for additional context on any element.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Providing extra information on icon-only buttons
|
|
7
|
+
- Explaining truncated text or status indicators
|
|
8
|
+
- Adding context without cluttering the UI
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Values | Description |
|
|
13
|
+
|------|------|---------|--------|-------------|
|
|
14
|
+
| `content` | `string\|ReactNode` | — | — | Tooltip content |
|
|
15
|
+
| `position` | `string` | `"top"` | `"top"`, `"bottom"`, `"left"`, `"right"` | Tooltip position |
|
|
16
|
+
| `children` | `ReactNode` | — | — | Element to attach tooltip to |
|
|
17
|
+
| `delay` | `number` | `200` | ms | Hover delay before showing |
|
|
18
|
+
| `className` | `string` | `""` | — | Additional CSS classes |
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
```jsx
|
|
23
|
+
<Tooltip content="Delete this item">
|
|
24
|
+
<Button layout="icon-only" icon="Trash" appearance="ghost" />
|
|
25
|
+
</Tooltip>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With rich content
|
|
29
|
+
```jsx
|
|
30
|
+
<Tooltip content={<span>Created on <strong>Jan 15, 2024</strong></span>} position="bottom">
|
|
31
|
+
<span>2 weeks ago</span>
|
|
32
|
+
</Tooltip>
|
|
33
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Tooltip from './Tooltip';
|
|
2
|
+
import { code } from '@figma/code-connect';
|
|
3
|
+
|
|
4
|
+
export default code.connect(
|
|
5
|
+
Tooltip,
|
|
6
|
+
'https://www.figma.com/design/LkIyThUA0oVNsDEAyOF7ER/Design-System--Components',
|
|
7
|
+
{
|
|
8
|
+
props: {
|
|
9
|
+
content: code.string('A message which appears when a cursor is positioned over an icon, image, hyperlink, or other element in a graphical user interface.'),
|
|
10
|
+
placement: code.enum('placement', {
|
|
11
|
+
top: 'top',
|
|
12
|
+
bottom: 'bottom',
|
|
13
|
+
left: 'left',
|
|
14
|
+
right: 'right',
|
|
15
|
+
}),
|
|
16
|
+
disabled: code.boolean('disabled'),
|
|
17
|
+
},
|
|
18
|
+
example: ({ content, placement, disabled }) => (
|
|
19
|
+
<Tooltip content={content} placement={placement} disabled={disabled}>
|
|
20
|
+
<button>Hover me</button>
|
|
21
|
+
</Tooltip>
|
|
22
|
+
),
|
|
23
|
+
}
|
|
24
|
+
);
|