@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,186 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-event-card {
|
|
4
|
+
all: unset;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
padding: var(--uds-spacing-2) var(--uds-spacing-4);
|
|
10
|
+
cursor: default;
|
|
11
|
+
min-width: 0;
|
|
12
|
+
|
|
13
|
+
// ── Clickable ───────────────────────────────────────────────────
|
|
14
|
+
&--clickable {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
|
|
17
|
+
&:hover .uds-event-card__container {
|
|
18
|
+
filter: brightness(0.93);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&:focus-visible {
|
|
22
|
+
outline: 2px solid var(--uds-border-focus);
|
|
23
|
+
outline-offset: 0;
|
|
24
|
+
border-radius: var(--uds-radius-4);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// ── Cap Variations ────────────────────────────────────────────
|
|
29
|
+
&--no-start-cap {
|
|
30
|
+
padding-left: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&--no-end-cap {
|
|
34
|
+
padding-right: 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&--no-start-cap.uds-event-card--no-end-cap {
|
|
38
|
+
padding-left: 0;
|
|
39
|
+
padding-right: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// ── Container ─────────────────────────────────────────────────
|
|
43
|
+
&__container {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex: 1 0 0;
|
|
46
|
+
align-items: center;
|
|
47
|
+
min-height: 1px;
|
|
48
|
+
min-width: 1px;
|
|
49
|
+
padding: var(--uds-spacing-4) var(--uds-spacing-8);
|
|
50
|
+
border-radius: var(--uds-radius-4);
|
|
51
|
+
gap: var(--uds-spacing-8);
|
|
52
|
+
position: relative;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
transition: filter var(--uds-animation-duration-150) var(--uds-animation-ease-standard);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Container cap radius overrides
|
|
58
|
+
&--no-end-cap &__container {
|
|
59
|
+
border-top-right-radius: 0;
|
|
60
|
+
border-bottom-right-radius: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&--no-start-cap &__container {
|
|
64
|
+
border-top-left-radius: 0;
|
|
65
|
+
border-bottom-left-radius: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Bar-only mode (no content, no startCap, no icon/badge)
|
|
69
|
+
&--bar-only &__container {
|
|
70
|
+
height: 20px;
|
|
71
|
+
padding: 0;
|
|
72
|
+
gap: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ── Content ───────────────────────────────────────────────────
|
|
76
|
+
&__content {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex: 1 0 0;
|
|
79
|
+
align-items: center;
|
|
80
|
+
min-height: 1px;
|
|
81
|
+
min-width: 1px;
|
|
82
|
+
gap: var(--uds-spacing-8);
|
|
83
|
+
position: relative;
|
|
84
|
+
z-index: 1;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__title {
|
|
88
|
+
@include uds-body-12-medium;
|
|
89
|
+
color: inherit;
|
|
90
|
+
white-space: nowrap;
|
|
91
|
+
overflow: hidden;
|
|
92
|
+
text-overflow: ellipsis;
|
|
93
|
+
min-width: 0;
|
|
94
|
+
flex-shrink: 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&__icon {
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
position: relative;
|
|
100
|
+
z-index: 1;
|
|
101
|
+
color: inherit;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ── Pending Stripe Pattern ────────────────────────────────────
|
|
105
|
+
&__pattern {
|
|
106
|
+
position: absolute;
|
|
107
|
+
inset: 0;
|
|
108
|
+
pointer-events: none;
|
|
109
|
+
background: repeating-linear-gradient(
|
|
110
|
+
-45deg,
|
|
111
|
+
transparent,
|
|
112
|
+
transparent 5px,
|
|
113
|
+
var(--_stripe-color) 5px,
|
|
114
|
+
var(--_stripe-color) 6px
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// ════════════════════════════════════════════════════════════════
|
|
119
|
+
// TYPE × STATUS Color Matrix
|
|
120
|
+
// ════════════════════════════════════════════════════════════════
|
|
121
|
+
|
|
122
|
+
// ── Travel ──────────────────────────────────────────────────────
|
|
123
|
+
&--travel {
|
|
124
|
+
&.uds-event-card--active .uds-event-card__container {
|
|
125
|
+
background-color: var(--uds-color-primary-500);
|
|
126
|
+
color: var(--uds-text-inverse);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&.uds-event-card--past .uds-event-card__container {
|
|
130
|
+
background-color: var(--uds-color-neutrals-100);
|
|
131
|
+
color: var(--uds-text-primary);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.uds-event-card--pending .uds-event-card__container {
|
|
135
|
+
background-color: var(--uds-color-accent-cyan-50);
|
|
136
|
+
border-left: 4px solid var(--uds-color-accent-cyan-200);
|
|
137
|
+
color: var(--uds-text-primary);
|
|
138
|
+
--_stripe-color: var(--uds-color-accent-cyan-200);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ── Assignment ─────────────────────────────────────────────────
|
|
143
|
+
&--assignment {
|
|
144
|
+
&.uds-event-card--active .uds-event-card__container {
|
|
145
|
+
background-color: var(--uds-color-secondary-500);
|
|
146
|
+
color: var(--uds-text-inverse);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&.uds-event-card--past .uds-event-card__container {
|
|
150
|
+
background-color: var(--uds-color-neutrals-100);
|
|
151
|
+
color: var(--uds-text-primary);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
&.uds-event-card--pending .uds-event-card__container {
|
|
155
|
+
background-color: var(--uds-color-accent-aqua-50);
|
|
156
|
+
border-left: 4px solid var(--uds-color-accent-aqua-200);
|
|
157
|
+
color: var(--uds-text-primary);
|
|
158
|
+
--_stripe-color: var(--uds-color-accent-aqua-200);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ── Unassigned ─────────────────────────────────────────────────
|
|
163
|
+
&--unassigned {
|
|
164
|
+
&.uds-event-card--active .uds-event-card__container {
|
|
165
|
+
background-color: var(--uds-color-neutrals-500);
|
|
166
|
+
color: var(--uds-text-inverse);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&.uds-event-card--past .uds-event-card__container {
|
|
170
|
+
background-color: var(--uds-color-neutrals-100);
|
|
171
|
+
color: var(--uds-text-primary);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.uds-event-card--pending .uds-event-card__container {
|
|
175
|
+
background-color: var(--uds-color-neutrals-50);
|
|
176
|
+
border-left: 4px solid var(--uds-color-neutrals-500);
|
|
177
|
+
color: var(--uds-text-primary);
|
|
178
|
+
--_stripe-color: var(--uds-color-neutrals-200);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ── Pending: Remove left border when no startCap ──────────────
|
|
183
|
+
&--pending.uds-event-card--no-start-cap .uds-event-card__container {
|
|
184
|
+
border-left: none;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./EventCard";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Field
|
|
2
|
+
|
|
3
|
+
Form field wrapper providing label, helper text, error messages, and required indicator.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Wrapping any form input (Input, Textarea, Dropdown, Datepicker, etc.)
|
|
7
|
+
- Any place you need a labeled form field with validation feedback
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
|------|------|---------|-------------|
|
|
13
|
+
| `label` | `string` | — | Field label text |
|
|
14
|
+
| `htmlFor` | `string` | — | Associates label with input (matches input `id`) |
|
|
15
|
+
| `required` | `boolean` | `false` | Shows required asterisk |
|
|
16
|
+
| `helperText` | `string` | — | Help text below the input |
|
|
17
|
+
| `error` | `string` | — | Error message (overrides helperText when present) |
|
|
18
|
+
| `children` | `ReactNode` | — | Form input component |
|
|
19
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
### Basic form field
|
|
24
|
+
```jsx
|
|
25
|
+
<Field label="Email" htmlFor="email" required>
|
|
26
|
+
<Input id="email" type="email" placeholder="you@example.com" />
|
|
27
|
+
</Field>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### With error
|
|
31
|
+
```jsx
|
|
32
|
+
<Field label="Password" error={errors.password} required>
|
|
33
|
+
<Input type="password" state={errors.password ? "error" : "default"} />
|
|
34
|
+
</Field>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### With helper text
|
|
38
|
+
```jsx
|
|
39
|
+
<Field label="Username" helperText="Must be 3-20 characters, letters and numbers only">
|
|
40
|
+
<Input value={username} onChange={e => setUsername(e.target.value)} />
|
|
41
|
+
</Field>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Complete form
|
|
45
|
+
```jsx
|
|
46
|
+
<Flex direction="column" gap="16">
|
|
47
|
+
<Field label="Name" required>
|
|
48
|
+
<Input value={name} onChange={e => setName(e.target.value)} />
|
|
49
|
+
</Field>
|
|
50
|
+
<Field label="Role">
|
|
51
|
+
<Dropdown options={roles} value={role} onChange={setRole} />
|
|
52
|
+
</Field>
|
|
53
|
+
<Field label="Bio" helperText="Tell us about yourself">
|
|
54
|
+
<Textarea value={bio} onChange={e => setBio(e.target.value)} maxLength={500} />
|
|
55
|
+
</Field>
|
|
56
|
+
<Flex justifyContent="flex-end" gap="8">
|
|
57
|
+
<Button label="Cancel" appearance="outline" />
|
|
58
|
+
<Button label="Save" />
|
|
59
|
+
</Flex>
|
|
60
|
+
</Flex>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Do's and Don'ts
|
|
64
|
+
|
|
65
|
+
✅ **Do**: Always wrap form inputs with `Field` for consistent layout
|
|
66
|
+
✅ **Do**: Use `htmlFor` matching the input's `id` for accessibility
|
|
67
|
+
|
|
68
|
+
❌ **Don't**: Use `Field` for non-form content
|
|
69
|
+
❌ **Don't**: Put multiple inputs inside a single `Field`
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import "./Field.scss";
|
|
4
|
+
|
|
5
|
+
const BASE_CLASS = "uds-field";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Field component for form input fields with label, helper text, and optional features
|
|
9
|
+
* @param {string} label - Label text for the field
|
|
10
|
+
* @param {boolean} required - Whether the field is required (adds asterisk to label)
|
|
11
|
+
* @param {string} helperMessage - Helper text displayed below the input
|
|
12
|
+
* @param {string} infoIcon - Icon name for info icon (e.g., "Info")
|
|
13
|
+
* @param {function} onInfoClick - Callback when info icon is clicked
|
|
14
|
+
* @param {number} maxLength - Maximum character length (enables character count)
|
|
15
|
+
* @param {number|string} value - Current value (for character count calculation)
|
|
16
|
+
* @param {string} id - Unique identifier for the field
|
|
17
|
+
* @param {string} className - Additional CSS classes
|
|
18
|
+
* @param {React.ReactNode} children - The input element to wrap
|
|
19
|
+
* @param {object} props - Additional props to pass to the field wrapper
|
|
20
|
+
*/
|
|
21
|
+
export default function Field({
|
|
22
|
+
label,
|
|
23
|
+
required = false,
|
|
24
|
+
helperMessage,
|
|
25
|
+
infoIcon,
|
|
26
|
+
onInfoClick,
|
|
27
|
+
maxLength,
|
|
28
|
+
value,
|
|
29
|
+
id,
|
|
30
|
+
className = "",
|
|
31
|
+
children,
|
|
32
|
+
...props
|
|
33
|
+
}) {
|
|
34
|
+
const fieldId = id || `field-${Math.random().toString(36).substr(2, 9)}`;
|
|
35
|
+
|
|
36
|
+
// Calculate character count if maxLength is provided
|
|
37
|
+
const currentLength = value ? String(value).length : 0;
|
|
38
|
+
const showCharacterCount = maxLength !== undefined && maxLength !== null;
|
|
39
|
+
|
|
40
|
+
const classNames = [BASE_CLASS, className].filter(Boolean).join(" ");
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div className={classNames} {...props}>
|
|
44
|
+
{/* Label Row */}
|
|
45
|
+
{(label || infoIcon) && (
|
|
46
|
+
<div className={`${BASE_CLASS}__label-row`}>
|
|
47
|
+
{label && (
|
|
48
|
+
<label htmlFor={fieldId} className={`${BASE_CLASS}__label`}>
|
|
49
|
+
{label}
|
|
50
|
+
{required && <span className={`${BASE_CLASS}__required`}>*</span>}
|
|
51
|
+
</label>
|
|
52
|
+
)}
|
|
53
|
+
{infoIcon && (
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
className={`${BASE_CLASS}__info-icon`}
|
|
57
|
+
onClick={onInfoClick}
|
|
58
|
+
aria-label="More information"
|
|
59
|
+
tabIndex={0}
|
|
60
|
+
>
|
|
61
|
+
<Icon name={infoIcon} size={16} appearance="regular" />
|
|
62
|
+
</button>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
|
|
67
|
+
{/* Input Slot */}
|
|
68
|
+
<div className={`${BASE_CLASS}__input-wrapper`}>
|
|
69
|
+
{React.isValidElement(children) && fieldId
|
|
70
|
+
? React.cloneElement(children, {
|
|
71
|
+
id: fieldId,
|
|
72
|
+
maxLength: maxLength || children.props.maxLength,
|
|
73
|
+
...children.props,
|
|
74
|
+
})
|
|
75
|
+
: children}
|
|
76
|
+
{showCharacterCount && (
|
|
77
|
+
<span className={`${BASE_CLASS}__character-count`}>
|
|
78
|
+
{currentLength}/{maxLength}
|
|
79
|
+
</span>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
{/* Helper Message */}
|
|
84
|
+
{helperMessage && (
|
|
85
|
+
<div className={`${BASE_CLASS}__helper`}>{helperMessage}</div>
|
|
86
|
+
)}
|
|
87
|
+
</div>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-field {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--uds-gap-8);
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
&__label-row {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
gap: var(--uds-gap-8);
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__label {
|
|
17
|
+
@include uds-body-14-medium;
|
|
18
|
+
color: var(--uds-text-primary);
|
|
19
|
+
display: inline-block;
|
|
20
|
+
line-height: 20px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__required {
|
|
24
|
+
color: var(--uds-text-error, #ef4444);
|
|
25
|
+
margin-left: 2px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__info-icon {
|
|
29
|
+
all: unset;
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: 20px;
|
|
34
|
+
height: 20px;
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
background-color: var(--uds-surface-tertiary);
|
|
37
|
+
color: var(--uds-text-secondary);
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
flex-shrink: 0;
|
|
40
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
background-color: var(--uds-surface-quaternary);
|
|
44
|
+
color: var(--uds-text-primary);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:focus-visible {
|
|
48
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
49
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&__input-wrapper {
|
|
54
|
+
position: relative;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: flex-start;
|
|
57
|
+
width: 100%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&__character-count {
|
|
61
|
+
@include uds-body-12;
|
|
62
|
+
position: absolute;
|
|
63
|
+
bottom: var(--uds-spacing-8);
|
|
64
|
+
right: var(--uds-spacing-12);
|
|
65
|
+
color: var(--uds-text-secondary);
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
line-height: 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&__helper {
|
|
71
|
+
@include uds-body-14;
|
|
72
|
+
color: var(--uds-text-secondary);
|
|
73
|
+
line-height: 20px;
|
|
74
|
+
margin-top: calc(var(--uds-gap-8) * -1);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Field";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# FileUpload
|
|
2
|
+
|
|
3
|
+
Drag-and-drop file upload component with preview and validation.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- File attachment fields in forms
|
|
7
|
+
- Document/image upload interfaces
|
|
8
|
+
- Any file input that needs drag-and-drop support
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
| Prop | Type | Default | Description |
|
|
13
|
+
|------|------|---------|-------------|
|
|
14
|
+
| `onUpload` | `function` | — | Callback `(files: File[]) => void` |
|
|
15
|
+
| `accept` | `string` | — | Accepted file types (e.g., `.jpg,.png,.pdf`) |
|
|
16
|
+
| `multiple` | `boolean` | `false` | Allow multiple files |
|
|
17
|
+
| `maxSize` | `number` | — | Max file size in bytes |
|
|
18
|
+
| `disabled` | `boolean` | `false` | Disabled state |
|
|
19
|
+
| `label` | `string` | `"Drop files here or click to upload"` | Upload area text |
|
|
20
|
+
| `className` | `string` | `""` | Additional CSS classes |
|
|
21
|
+
|
|
22
|
+
## Examples
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
<FileUpload onUpload={handleFiles} accept=".jpg,.png,.gif" multiple />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Single document upload
|
|
29
|
+
```jsx
|
|
30
|
+
<Field label="Resume">
|
|
31
|
+
<FileUpload
|
|
32
|
+
onUpload={([file]) => setResume(file)}
|
|
33
|
+
accept=".pdf,.doc,.docx"
|
|
34
|
+
maxSize={5 * 1024 * 1024}
|
|
35
|
+
label="Drop your resume here"
|
|
36
|
+
/>
|
|
37
|
+
</Field>
|
|
38
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import FileUpload from './FileUpload';
|
|
2
|
+
import { code } from '@figma/code-connect';
|
|
3
|
+
|
|
4
|
+
export default code.connect(
|
|
5
|
+
FileUpload,
|
|
6
|
+
'https://www.figma.com/design/LkIyThUA0oVNsDEAyOF7ER/Design-System--Components',
|
|
7
|
+
{
|
|
8
|
+
props: {
|
|
9
|
+
instructionText: code.string('instructionText'),
|
|
10
|
+
acceptText: code.string('acceptText'),
|
|
11
|
+
maxSize: code.number('maxSize'),
|
|
12
|
+
accept: code.array('accept'),
|
|
13
|
+
multiple: code.boolean('multiple'),
|
|
14
|
+
disabled: code.boolean('disabled'),
|
|
15
|
+
},
|
|
16
|
+
example: ({ instructionText, acceptText, maxSize, accept, multiple, disabled }) => (
|
|
17
|
+
<FileUpload
|
|
18
|
+
instructionText={instructionText}
|
|
19
|
+
acceptText={acceptText}
|
|
20
|
+
maxSize={maxSize}
|
|
21
|
+
accept={accept}
|
|
22
|
+
multiple={multiple}
|
|
23
|
+
disabled={disabled}
|
|
24
|
+
onFileSelect={(files) => console.log('Files selected:', files)}
|
|
25
|
+
/>
|
|
26
|
+
),
|
|
27
|
+
}
|
|
28
|
+
);
|