@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,93 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../Icon/Icon";
|
|
3
|
+
import "./Tag.scss";
|
|
4
|
+
|
|
5
|
+
const BASE_CLASS = "uds-tag";
|
|
6
|
+
|
|
7
|
+
const appearanceClassMap = {
|
|
8
|
+
"label-only": "label-only",
|
|
9
|
+
"icon-left": "icon-left",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const sizeClassMap = {
|
|
13
|
+
compact: "compact",
|
|
14
|
+
default: "default",
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const colorClassMap = {
|
|
18
|
+
transparent: "transparent",
|
|
19
|
+
neutral: "neutral",
|
|
20
|
+
red: "red",
|
|
21
|
+
orange: "orange",
|
|
22
|
+
yellow: "yellow",
|
|
23
|
+
emerald: "emerald",
|
|
24
|
+
green: "green",
|
|
25
|
+
sky: "sky",
|
|
26
|
+
cyan: "cyan",
|
|
27
|
+
blue: "blue",
|
|
28
|
+
indigo: "indigo",
|
|
29
|
+
purple: "purple",
|
|
30
|
+
fuchsia: "fuchsia",
|
|
31
|
+
magenta: "magenta",
|
|
32
|
+
inverse: "inverse",
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Tag component for displaying labels with optional icons
|
|
37
|
+
*
|
|
38
|
+
* @param {string} label - The text content of the tag
|
|
39
|
+
* @param {string} appearance - Visual style variant: 'label-only' or 'icon-left'
|
|
40
|
+
* @param {string} size - Size variant: 'compact' or 'default'
|
|
41
|
+
* @param {string} color - Color variant: 'transparent', 'neutral', 'red', 'orange', 'yellow', 'emerald', 'green', 'sky', 'cyan', 'blue', 'indigo', 'purple', 'fuchsia', 'magenta', 'inverse'
|
|
42
|
+
* @param {boolean} rounded - Whether to use rounded corners (default: true)
|
|
43
|
+
* @param {boolean} solid - Whether to use solid background (default: false)
|
|
44
|
+
* @param {string|boolean} icon - Icon name to display (when appearance is 'icon-left')
|
|
45
|
+
* @param {string} className - Additional CSS classes
|
|
46
|
+
* @param {function} onClick - Click handler function
|
|
47
|
+
* @param {object} props - Additional props to pass to the tag element
|
|
48
|
+
*/
|
|
49
|
+
export default function Tag({
|
|
50
|
+
label = "Label",
|
|
51
|
+
appearance = "label-only",
|
|
52
|
+
size = "compact",
|
|
53
|
+
color = "transparent",
|
|
54
|
+
rounded = true,
|
|
55
|
+
solid = false,
|
|
56
|
+
icon,
|
|
57
|
+
className = "",
|
|
58
|
+
onClick,
|
|
59
|
+
...props
|
|
60
|
+
}) {
|
|
61
|
+
const classNames = [
|
|
62
|
+
BASE_CLASS,
|
|
63
|
+
appearanceClassMap[appearance] &&
|
|
64
|
+
`${BASE_CLASS}--${appearanceClassMap[appearance]}`,
|
|
65
|
+
sizeClassMap[size] && `${BASE_CLASS}--${sizeClassMap[size]}`,
|
|
66
|
+
colorClassMap[color] && `${BASE_CLASS}--${colorClassMap[color]}`,
|
|
67
|
+
rounded && `${BASE_CLASS}--rounded`,
|
|
68
|
+
solid && `${BASE_CLASS}--solid`,
|
|
69
|
+
className,
|
|
70
|
+
]
|
|
71
|
+
.filter(Boolean)
|
|
72
|
+
.join(" ");
|
|
73
|
+
|
|
74
|
+
const Element = onClick ? "button" : "span";
|
|
75
|
+
const hasIcon = appearance === "icon-left" && icon;
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Element className={classNames} onClick={onClick} {...props}>
|
|
79
|
+
{hasIcon && typeof icon === "string" && (
|
|
80
|
+
<Icon
|
|
81
|
+
name={icon}
|
|
82
|
+
size={size === "compact" ? 10 : 12}
|
|
83
|
+
appearance="regular"
|
|
84
|
+
className={`${BASE_CLASS}__icon`}
|
|
85
|
+
/>
|
|
86
|
+
)}
|
|
87
|
+
{hasIcon && typeof icon !== "string" && (
|
|
88
|
+
<span className={`${BASE_CLASS}__icon`}>{icon}</span>
|
|
89
|
+
)}
|
|
90
|
+
{label && <span className={`${BASE_CLASS}__label`}>{label}</span>}
|
|
91
|
+
</Element>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
.uds-tag {
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 0;
|
|
6
|
+
border: var(--uds-border-width-1) solid transparent;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
min-width: 24px;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
width: fit-content;
|
|
11
|
+
height: fit-content;
|
|
12
|
+
user-select: none;
|
|
13
|
+
|
|
14
|
+
// When used as button, remove default button styles
|
|
15
|
+
&:is(button) {
|
|
16
|
+
background: none;
|
|
17
|
+
font: inherit;
|
|
18
|
+
color: inherit;
|
|
19
|
+
cursor: pointer;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ── Size: Compact (16px tall) ──────────────────────────────────────
|
|
23
|
+
&--compact {
|
|
24
|
+
font-size: 10px;
|
|
25
|
+
font-weight: var(--uds-font-weight-semibold);
|
|
26
|
+
line-height: 12px;
|
|
27
|
+
padding: var(--uds-spacing-2) var(--uds-spacing-4);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// ── Size: Default (24px tall) ──────────────────────────────────────
|
|
31
|
+
&--default {
|
|
32
|
+
font-size: var(--uds-font-size-12);
|
|
33
|
+
font-weight: var(--uds-font-weight-semibold);
|
|
34
|
+
line-height: var(--uds-line-16);
|
|
35
|
+
padding: var(--uds-spacing-4) var(--uds-spacing-8);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// ── Icon-left: compact gets slightly wider outer padding ───────────
|
|
39
|
+
&--icon-left.uds-tag--compact {
|
|
40
|
+
padding-inline: var(--uds-spacing-6);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ── Rounded variant ────────────────────────────────────────────────
|
|
44
|
+
&--rounded {
|
|
45
|
+
border-radius: 9999px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:not(&--rounded) {
|
|
49
|
+
border-radius: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// ── Icon ───────────────────────────────────────────────────────────
|
|
53
|
+
&__icon {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: center;
|
|
57
|
+
flex-shrink: 0;
|
|
58
|
+
line-height: 0;
|
|
59
|
+
|
|
60
|
+
svg {
|
|
61
|
+
width: 10px;
|
|
62
|
+
height: 10px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.uds-tag--default & {
|
|
66
|
+
svg {
|
|
67
|
+
width: 12px;
|
|
68
|
+
height: 12px;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// ── Label ──────────────────────────────────────────────────────────
|
|
74
|
+
&__label {
|
|
75
|
+
display: inline-block;
|
|
76
|
+
white-space: nowrap;
|
|
77
|
+
text-align: center;
|
|
78
|
+
padding-inline: var(--uds-spacing-4);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Icon-left compact: tighter inner label padding
|
|
82
|
+
&--icon-left.uds-tag--compact &__label {
|
|
83
|
+
padding-inline: var(--uds-spacing-2);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ── Color variants (non-solid) ─────────────────────────────────────
|
|
87
|
+
&--transparent:not(&--solid) {
|
|
88
|
+
background-color: transparent;
|
|
89
|
+
color: var(--uds-text-primary);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&--neutral:not(&--solid) {
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
color: var(--uds-text-primary);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&--red:not(&--solid) {
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
color: var(--uds-color-accent-red-600);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&--orange:not(&--solid) {
|
|
103
|
+
background-color: transparent;
|
|
104
|
+
color: var(--uds-color-accent-orange-600);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
&--yellow:not(&--solid) {
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
color: var(--uds-color-accent-yellow-600);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&--emerald:not(&--solid) {
|
|
113
|
+
background-color: transparent;
|
|
114
|
+
color: var(--uds-color-accent-emerald-600);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&--green:not(&--solid) {
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
color: var(--uds-color-accent-green-600);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&--sky:not(&--solid) {
|
|
123
|
+
background-color: transparent;
|
|
124
|
+
color: var(--uds-color-accent-sky-600);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&--cyan:not(&--solid) {
|
|
128
|
+
background-color: transparent;
|
|
129
|
+
color: var(--uds-color-accent-cyan-600);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--blue:not(&--solid) {
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
color: var(--uds-color-accent-blue-600);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&--indigo:not(&--solid) {
|
|
138
|
+
background-color: transparent;
|
|
139
|
+
color: var(--uds-color-accent-indigo-600);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&--purple:not(&--solid) {
|
|
143
|
+
background-color: transparent;
|
|
144
|
+
color: var(--uds-color-accent-purple-600);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&--fuchsia:not(&--solid) {
|
|
148
|
+
background-color: transparent;
|
|
149
|
+
color: var(--uds-color-accent-fuchsia-600);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&--magenta:not(&--solid) {
|
|
153
|
+
background-color: transparent;
|
|
154
|
+
color: var(--uds-color-accent-magenta-600);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&--inverse:not(&--solid) {
|
|
158
|
+
background-color: transparent;
|
|
159
|
+
color: var(--uds-text-inverse);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ── Color variants (solid) ─────────────────────────────────────────
|
|
163
|
+
&--transparent.uds-tag--solid {
|
|
164
|
+
background-color: var(--uds-surface-primary);
|
|
165
|
+
border-color: var(--uds-border-primary);
|
|
166
|
+
color: var(--uds-text-primary);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
&--neutral.uds-tag--solid {
|
|
170
|
+
background-color: var(--uds-surface-primary);
|
|
171
|
+
border-color: var(--uds-border-primary);
|
|
172
|
+
color: var(--uds-text-primary);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&--red.uds-tag--solid {
|
|
176
|
+
background-color: var(--uds-color-accent-red-600);
|
|
177
|
+
border-color: transparent;
|
|
178
|
+
color: var(--uds-text-inverse);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&--orange.uds-tag--solid {
|
|
182
|
+
background-color: var(--uds-color-accent-orange-600);
|
|
183
|
+
border-color: transparent;
|
|
184
|
+
color: var(--uds-text-inverse);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&--yellow.uds-tag--solid {
|
|
188
|
+
background-color: var(--uds-color-accent-yellow-600);
|
|
189
|
+
border-color: transparent;
|
|
190
|
+
color: var(--uds-text-inverse);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&--emerald.uds-tag--solid {
|
|
194
|
+
background-color: var(--uds-color-accent-emerald-600);
|
|
195
|
+
border-color: transparent;
|
|
196
|
+
color: var(--uds-text-inverse);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&--green.uds-tag--solid {
|
|
200
|
+
background-color: var(--uds-color-accent-green-600);
|
|
201
|
+
border-color: transparent;
|
|
202
|
+
color: var(--uds-text-inverse);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&--sky.uds-tag--solid {
|
|
206
|
+
background-color: var(--uds-color-accent-sky-600);
|
|
207
|
+
border-color: transparent;
|
|
208
|
+
color: var(--uds-text-inverse);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
&--cyan.uds-tag--solid {
|
|
212
|
+
background-color: var(--uds-color-accent-cyan-600);
|
|
213
|
+
border-color: transparent;
|
|
214
|
+
color: var(--uds-text-inverse);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&--blue.uds-tag--solid {
|
|
218
|
+
background-color: var(--uds-color-accent-blue-600);
|
|
219
|
+
border-color: transparent;
|
|
220
|
+
color: var(--uds-text-inverse);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
&--indigo.uds-tag--solid {
|
|
224
|
+
background-color: var(--uds-color-accent-indigo-600);
|
|
225
|
+
border-color: transparent;
|
|
226
|
+
color: var(--uds-text-inverse);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
&--purple.uds-tag--solid {
|
|
230
|
+
background-color: var(--uds-color-accent-purple-600);
|
|
231
|
+
border-color: transparent;
|
|
232
|
+
color: var(--uds-text-inverse);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&--fuchsia.uds-tag--solid {
|
|
236
|
+
background-color: var(--uds-color-accent-fuchsia-600);
|
|
237
|
+
border-color: transparent;
|
|
238
|
+
color: var(--uds-text-inverse);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
&--magenta.uds-tag--solid {
|
|
242
|
+
background-color: var(--uds-color-accent-magenta-600);
|
|
243
|
+
border-color: transparent;
|
|
244
|
+
color: var(--uds-text-inverse);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&--inverse.uds-tag--solid {
|
|
248
|
+
background-color: var(--uds-surface-inverse);
|
|
249
|
+
border-color: transparent;
|
|
250
|
+
color: var(--uds-text-inverse);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ── Focus state ────────────────────────────────────────────────────
|
|
254
|
+
&:focus-visible {
|
|
255
|
+
outline: solid var(--uds-focus-ring-width) var(--uds-focus-ring-border);
|
|
256
|
+
outline-offset: var(--uds-focus-ring-offset);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
Multi-line text input component with resize options and character counting.
|
|
4
|
+
|
|
5
|
+
## When to Use
|
|
6
|
+
- Multi-line text fields (descriptions, comments, messages)
|
|
7
|
+
- Form fields that need more than one line of input
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Values | Description |
|
|
12
|
+
|------|------|---------|--------|-------------|
|
|
13
|
+
| `value` | `string` | — | — | Textarea value (controlled) |
|
|
14
|
+
| `onChange` | `function` | — | `(event) => void` | Change handler |
|
|
15
|
+
| `placeholder` | `string` | — | — | Placeholder text |
|
|
16
|
+
| `rows` | `number` | `4` | — | Initial visible rows |
|
|
17
|
+
| `resize` | `string` | `"vertical"` | `"none"`, `"vertical"`, `"horizontal"`, `"both"` | Resize behavior |
|
|
18
|
+
| `maxLength` | `number` | — | — | Max characters (shows counter) |
|
|
19
|
+
| `state` | `string` | `"default"` | `"default"`, `"focused"`, `"error"`, `"disabled"` | Visual state |
|
|
20
|
+
| `disabled` | `boolean` | `false` | — | Disabled state |
|
|
21
|
+
| `className` | `string` | `""` | — | Additional CSS classes |
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
```jsx
|
|
26
|
+
<Textarea placeholder="Enter description..." value={desc} onChange={e => setDesc(e.target.value)} />
|
|
27
|
+
<Textarea placeholder="Comment" maxLength={500} rows={6} />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### In a form
|
|
31
|
+
```jsx
|
|
32
|
+
<Field label="Description" helperText="Provide a detailed description">
|
|
33
|
+
<Textarea
|
|
34
|
+
value={description}
|
|
35
|
+
onChange={e => setDescription(e.target.value)}
|
|
36
|
+
maxLength={1000}
|
|
37
|
+
placeholder="Enter description..."
|
|
38
|
+
/>
|
|
39
|
+
</Field>
|
|
40
|
+
```
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Textarea from './Textarea';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figma Code Connect for Textarea component
|
|
6
|
+
*
|
|
7
|
+
* Simple execution version of textarea with various configurations
|
|
8
|
+
*/
|
|
9
|
+
export default function TextareaFigma({
|
|
10
|
+
value,
|
|
11
|
+
placeholderText = 'Placeholder',
|
|
12
|
+
size = 'default',
|
|
13
|
+
state = 'default',
|
|
14
|
+
placeholder = false,
|
|
15
|
+
scrollbar = 'false',
|
|
16
|
+
resize = true,
|
|
17
|
+
}) {
|
|
18
|
+
const [internalValue, setInternalValue] = useState(value || '');
|
|
19
|
+
|
|
20
|
+
const handleChange = (e) => {
|
|
21
|
+
setInternalValue(e.target.value);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Textarea
|
|
26
|
+
value={placeholder ? '' : (value || internalValue)}
|
|
27
|
+
onChange={handleChange}
|
|
28
|
+
placeholder={placeholder ? placeholderText : undefined}
|
|
29
|
+
size={size.toLowerCase()}
|
|
30
|
+
state={state.toLowerCase()}
|
|
31
|
+
resize={resize}
|
|
32
|
+
disabled={state === 'disabled'}
|
|
33
|
+
/>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./Textarea.scss";
|
|
3
|
+
|
|
4
|
+
const BASE_CLASS = "uds-textarea";
|
|
5
|
+
|
|
6
|
+
const sizeClassMap = {
|
|
7
|
+
compact: "compact",
|
|
8
|
+
default: "default",
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const stateClassMap = {
|
|
12
|
+
default: "default",
|
|
13
|
+
focused: "focused",
|
|
14
|
+
error: "error",
|
|
15
|
+
disabled: "disabled",
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Textarea component for multi-line text input
|
|
20
|
+
*
|
|
21
|
+
* @param {string} value - The value of the textarea
|
|
22
|
+
* @param {function} onChange - Callback function when value changes
|
|
23
|
+
* @param {string} placeholder - Placeholder text
|
|
24
|
+
* @param {string} size - Size variant: 'compact' (80px min-height) or 'default' (120px min-height)
|
|
25
|
+
* @param {string} state - State variant: 'default', 'focused', 'error', or 'disabled'
|
|
26
|
+
* @param {boolean} resize - Whether the textarea can be resized (default: true)
|
|
27
|
+
* @param {boolean} disabled - Whether the textarea is disabled (overrides state)
|
|
28
|
+
* @param {string} id - Unique identifier for the textarea
|
|
29
|
+
* @param {string} className - Additional CSS classes
|
|
30
|
+
* @param {object} props - Additional props to pass to the textarea element
|
|
31
|
+
*/
|
|
32
|
+
export default function Textarea({
|
|
33
|
+
value,
|
|
34
|
+
onChange,
|
|
35
|
+
placeholder,
|
|
36
|
+
size = "default",
|
|
37
|
+
state = "default",
|
|
38
|
+
resize = true,
|
|
39
|
+
disabled = false,
|
|
40
|
+
id,
|
|
41
|
+
className = "",
|
|
42
|
+
...props
|
|
43
|
+
}) {
|
|
44
|
+
const effectiveState = disabled ? "disabled" : state;
|
|
45
|
+
|
|
46
|
+
const classNames = [
|
|
47
|
+
BASE_CLASS,
|
|
48
|
+
sizeClassMap[size] && `${BASE_CLASS}--${sizeClassMap[size]}`,
|
|
49
|
+
stateClassMap[effectiveState] &&
|
|
50
|
+
`${BASE_CLASS}--${stateClassMap[effectiveState]}`,
|
|
51
|
+
!resize && `${BASE_CLASS}--no-resize`,
|
|
52
|
+
className,
|
|
53
|
+
]
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
.join(" ");
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<textarea
|
|
59
|
+
id={id}
|
|
60
|
+
className={classNames}
|
|
61
|
+
value={value}
|
|
62
|
+
onChange={onChange}
|
|
63
|
+
placeholder={placeholder}
|
|
64
|
+
disabled={disabled || effectiveState === "disabled"}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@use "../../styles/typography" as *;
|
|
2
|
+
|
|
3
|
+
.uds-textarea {
|
|
4
|
+
@include uds-body-16;
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: var(--uds-spacing-10) var(--uds-spacing-12);
|
|
7
|
+
border: var(--uds-border-width-1) solid var(--uds-input-border);
|
|
8
|
+
border-radius: var(--uds-radius-4);
|
|
9
|
+
background-color: var(--uds-input-surface);
|
|
10
|
+
color: var(--uds-text-primary);
|
|
11
|
+
transition: all var(--uds-animation-duration-200) var(--uds-animation-ease-standard);
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
font-family: var(--uds-font-family);
|
|
14
|
+
resize: vertical;
|
|
15
|
+
align-self: stretch;
|
|
16
|
+
overflow-y: auto;
|
|
17
|
+
|
|
18
|
+
&::placeholder {
|
|
19
|
+
color: var(--uds-text-placeholder);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Size variants
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
&--default {
|
|
26
|
+
min-height: 120px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&--compact {
|
|
30
|
+
min-height: 80px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// No resize variant
|
|
34
|
+
&--no-resize {
|
|
35
|
+
resize: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Default state (border color)
|
|
39
|
+
border-color: var(--uds-border-primary);
|
|
40
|
+
|
|
41
|
+
// State: Focused
|
|
42
|
+
&--focused {
|
|
43
|
+
border-color: var(--uds-border-brand-primary);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// State: Error
|
|
47
|
+
&--error {
|
|
48
|
+
border-color: var(--uds-text-error, #ef4444);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// State: Disabled
|
|
52
|
+
&--disabled,
|
|
53
|
+
&:disabled {
|
|
54
|
+
background-color: var(--uds-surface-tertiary);
|
|
55
|
+
color: var(--uds-text-secondary);
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
opacity: 0.6;
|
|
58
|
+
border-color: var(--uds-border-primary);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Focus state (applies to all states except disabled)
|
|
62
|
+
&:focus:not(:disabled) {
|
|
63
|
+
outline: none;
|
|
64
|
+
border-color: var(--uds-border-brand-primary);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Remove default textarea styling that might interfere
|
|
68
|
+
&:focus-visible {
|
|
69
|
+
outline: none;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|