@recursica/adapter-mui-v7 1.0.0
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/.storybook/commonArgTypes.ts +148 -0
- package/ARCHITECTURE.md +18 -0
- package/CHANGELOG.md +582 -0
- package/LICENSE +21 -0
- package/OVERSTYLING.md +59 -0
- package/README.md +70 -0
- package/SETUP.md +92 -0
- package/USAGE.md +57 -0
- package/dist/adapter-mui-v7.cjs +292 -0
- package/dist/adapter-mui-v7.cjs.map +1 -0
- package/dist/adapter-mui-v7.css +1 -0
- package/dist/adapter-mui-v7.js +40757 -0
- package/dist/adapter-mui-v7.js.map +1 -0
- package/dist/index.d.ts +2350 -0
- package/dist/vite.svg +1 -0
- package/docs/PHILOSOPHY.md +39 -0
- package/llms.txt +76 -0
- package/package.json +151 -0
- package/recursica_brand.json +2677 -0
- package/recursica_tokens.json +799 -0
- package/recursica_ui-kit.json +14981 -0
- package/recursica_variables_scoped.css +30489 -0
- package/src/GlobalExemptions.modules.css +7 -0
- package/src/Introduction.stories.tsx +184 -0
- package/src/OverStyling.tsx +87 -0
- package/src/Version.tsx +37 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +107 -0
- package/src/components/Accordion/Accordion.module.css +362 -0
- package/src/components/Accordion/Accordion.stories.tsx +198 -0
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/Accordion/Accordion.tsx +285 -0
- package/src/components/Accordion/USAGE.md +43 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +59 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +121 -0
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +68 -0
- package/src/components/AssistiveElement/AssistiveElement.test.tsx +1 -0
- package/src/components/AssistiveElement/AssistiveElement.tsx +94 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AssistiveElement/index.ts +1 -0
- package/src/components/AutoComplete/AutoComplete.module.css +456 -0
- package/src/components/AutoComplete/AutoComplete.stories.tsx +336 -0
- package/src/components/AutoComplete/AutoComplete.test.tsx +1 -0
- package/src/components/AutoComplete/AutoComplete.tsx +266 -0
- package/src/components/AutoComplete/IMPLEMENTATION_NOTES.md +37 -0
- package/src/components/AutoComplete/USAGE.md +68 -0
- package/src/components/AutoComplete/index.ts +1 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +36 -0
- package/src/components/Avatar/Avatar.module.css +336 -0
- package/src/components/Avatar/Avatar.stories.tsx +92 -0
- package/src/components/Avatar/Avatar.test.tsx +1 -0
- package/src/components/Avatar/Avatar.tsx +88 -0
- package/src/components/Avatar/USAGE.md +38 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/Badge.module.css +115 -0
- package/src/components/Badge/Badge.stories.tsx +78 -0
- package/src/components/Badge/Badge.test.tsx +1 -0
- package/src/components/Badge/Badge.tsx +61 -0
- package/src/components/Badge/USAGE.md +40 -0
- package/src/components/Badge/index.ts +1 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +51 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +51 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +114 -0
- package/src/components/Breadcrumb/Breadcrumb.test.tsx +1 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +70 -0
- package/src/components/Breadcrumb/USAGE.md +42 -0
- package/src/components/Breadcrumb/index.ts +1 -0
- package/src/components/Button/BUTTON_IMPLEMENTATION_NOTES.md +123 -0
- package/src/components/Button/Button.module.css +413 -0
- package/src/components/Button/Button.stories.tsx +196 -0
- package/src/components/Button/Button.styleIsolation.dom.test.tsx +98 -0
- package/src/components/Button/Button.tsx +156 -0
- package/src/components/Button/USAGE.md +46 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +15 -0
- package/src/components/Card/Card.module.css +155 -0
- package/src/components/Card/Card.stories.tsx +131 -0
- package/src/components/Card/Card.test.tsx +1 -0
- package/src/components/Card/Card.tsx +202 -0
- package/src/components/Card/USAGE.md +57 -0
- package/src/components/Card/index.ts +1 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +14 -0
- package/src/components/Checkbox/Checkbox.module.css +286 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +97 -0
- package/src/components/Checkbox/Checkbox.test.tsx +1 -0
- package/src/components/Checkbox/Checkbox.tsx +259 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +148 -0
- package/src/components/Checkbox/USAGE.md +36 -0
- package/src/components/Checkbox/index.ts +6 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +102 -0
- package/src/components/Chip/Chip.module.css +283 -0
- package/src/components/Chip/Chip.stories.tsx +154 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Chip/Chip.tsx +168 -0
- package/src/components/Chip/USAGE.md +55 -0
- package/src/components/Chip/index.ts +1 -0
- package/src/components/Container/Container.stories.tsx +118 -0
- package/src/components/Container/Container.test.tsx +1 -0
- package/src/components/Container/Container.tsx +51 -0
- package/src/components/Container/IMPLEMENTATION_NOTES.md +5 -0
- package/src/components/Container/USAGE.md +48 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +29 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +35 -0
- package/src/components/DatePicker/DatePicker.module.css +464 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +163 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.tsx +229 -0
- package/src/components/DatePicker/USAGE.md +49 -0
- package/src/components/DatePicker/index.ts +1 -0
- package/src/components/Dropdown/BareDropdown.tsx +168 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/Dropdown/Dropdown.icons.tsx +33 -0
- package/src/components/Dropdown/Dropdown.module.css +535 -0
- package/src/components/Dropdown/Dropdown.stories.tsx +252 -0
- package/src/components/Dropdown/Dropdown.test.tsx +1 -0
- package/src/components/Dropdown/Dropdown.tsx +319 -0
- package/src/components/Dropdown/USAGE.md +68 -0
- package/src/components/Dropdown/index.ts +1 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +153 -0
- package/src/components/FileInput/FileInput.module.css +268 -0
- package/src/components/FileInput/FileInput.stories.tsx +313 -0
- package/src/components/FileInput/FileInput.test.tsx +1 -0
- package/src/components/FileInput/FileInput.tsx +415 -0
- package/src/components/FileInput/USAGE.md +145 -0
- package/src/components/FileInput/index.ts +1 -0
- package/src/components/FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md +249 -0
- package/src/components/FileUpload/FileUpload.module.css +200 -0
- package/src/components/FileUpload/FileUpload.stories.tsx +362 -0
- package/src/components/FileUpload/FileUpload.test.tsx +1 -0
- package/src/components/FileUpload/FileUpload.tsx +352 -0
- package/src/components/FileUpload/USAGE.md +199 -0
- package/src/components/FileUpload/index.ts +1 -0
- package/src/components/Flex/Flex.stories.tsx +128 -0
- package/src/components/Flex/Flex.test.tsx +1 -0
- package/src/components/Flex/Flex.tsx +89 -0
- package/src/components/Flex/USAGE.md +41 -0
- package/src/components/Flex/index.ts +1 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +118 -0
- package/src/components/FormControlLayout/FormControlLayout.test.tsx +1 -0
- package/src/components/FormControlLayout/FormControlLayout.tsx +72 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlLayout/index.ts +1 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +35 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +87 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +129 -0
- package/src/components/FormControlWrapper/FormControlWrapper.test.tsx +1 -0
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +149 -0
- package/src/components/FormControlWrapper/USAGE.md +40 -0
- package/src/components/FormControlWrapper/index.ts +1 -0
- package/src/components/Grid/Grid.module.css +72 -0
- package/src/components/Grid/Grid.stories.tsx +161 -0
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +155 -0
- package/src/components/Grid/IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Grid/USAGE.md +53 -0
- package/src/components/Grid/index.ts +1 -0
- package/src/components/Group/Group.stories.tsx +120 -0
- package/src/components/Group/Group.test.tsx +1 -0
- package/src/components/Group/Group.tsx +116 -0
- package/src/components/Group/USAGE.md +41 -0
- package/src/components/Group/index.ts +1 -0
- package/src/components/Heading/Heading.stories.tsx +50 -0
- package/src/components/Heading/Heading.test.tsx +1 -0
- package/src/components/Heading/Heading.tsx +28 -0
- package/src/components/Heading/USAGE.md +36 -0
- package/src/components/Heading/index.ts +1 -0
- package/src/components/HoverCard/HoverCard.module.css +107 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +172 -0
- package/src/components/HoverCard/HoverCard.test.tsx +1 -0
- package/src/components/HoverCard/HoverCard.tsx +145 -0
- package/src/components/HoverCard/USAGE.md +45 -0
- package/src/components/HoverCard/index.ts +1 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +27 -0
- package/src/components/Label/Label.module.css +169 -0
- package/src/components/Label/Label.stories.tsx +131 -0
- package/src/components/Label/Label.test.tsx +1 -0
- package/src/components/Label/Label.tsx +96 -0
- package/src/components/Label/USAGE.md +36 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layer/USAGE.md +50 -0
- package/src/components/Link/LINK_IMPLEMENTATION_NOTES.md +9 -0
- package/src/components/Link/Link.module.css +105 -0
- package/src/components/Link/Link.stories.tsx +58 -0
- package/src/components/Link/Link.test.tsx +1 -0
- package/src/components/Link/Link.tsx +45 -0
- package/src/components/Link/USAGE.md +40 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Loader/Loader.animate.dom.test.tsx +72 -0
- package/src/components/Loader/Loader.module.css +175 -0
- package/src/components/Loader/Loader.stories.tsx +123 -0
- package/src/components/Loader/Loader.test.tsx +1 -0
- package/src/components/Loader/Loader.tsx +72 -0
- package/src/components/Loader/USAGE.md +42 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Menu/IMPLEMENTATION_NOTES.md +5 -0
- package/src/components/Menu/Menu.module.css +283 -0
- package/src/components/Menu/Menu.stories.tsx +405 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Menu/Menu.tsx +103 -0
- package/src/components/Menu/USAGE.md +53 -0
- package/src/components/Menu/index.ts +1 -0
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +31 -0
- package/src/components/Modal/Modal.module.css +302 -0
- package/src/components/Modal/Modal.stories.tsx +105 -0
- package/src/components/Modal/Modal.test.tsx +1 -0
- package/src/components/Modal/Modal.tsx +231 -0
- package/src/components/Modal/USAGE.md +40 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/NumberInput/NUMBER_INPUT_IMPLEMENTATION_NOTES.md +93 -0
- package/src/components/NumberInput/NumberInput.module.css +303 -0
- package/src/components/NumberInput/NumberInput.stories.tsx +96 -0
- package/src/components/NumberInput/NumberInput.test.tsx +1 -0
- package/src/components/NumberInput/NumberInput.tsx +273 -0
- package/src/components/NumberInput/USAGE.md +36 -0
- package/src/components/NumberInput/index.ts +1 -0
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +40 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +197 -0
- package/src/components/Pagination/Pagination.stories.tsx +48 -0
- package/src/components/Pagination/Pagination.test.tsx +1 -0
- package/src/components/Pagination/Pagination.tsx +123 -0
- package/src/components/Pagination/USAGE.md +36 -0
- package/src/components/Pagination/index.ts +1 -0
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +133 -0
- package/src/components/Panel/Panel.module.css +231 -0
- package/src/components/Panel/Panel.stories.tsx +227 -0
- package/src/components/Panel/Panel.test.tsx +1 -0
- package/src/components/Panel/Panel.tsx +186 -0
- package/src/components/Panel/USAGE.md +46 -0
- package/src/components/Panel/index.ts +1 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +22 -0
- package/src/components/Popover/Popover.module.css +118 -0
- package/src/components/Popover/Popover.stories.tsx +133 -0
- package/src/components/Popover/Popover.test.tsx +1 -0
- package/src/components/Popover/Popover.tsx +267 -0
- package/src/components/Popover/USAGE.md +69 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Radio/RADIO_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Radio/Radio.module.css +247 -0
- package/src/components/Radio/Radio.stories.tsx +93 -0
- package/src/components/Radio/Radio.test.tsx +1 -0
- package/src/components/Radio/Radio.tsx +223 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +122 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/Radio/index.ts +2 -0
- package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +54 -0
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +163 -0
- package/src/components/ReadOnlyField/ReadOnlyField.test.tsx +1 -0
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +108 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/USAGE.md +36 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +2 -0
- package/src/components/RecursicaThemeProvider/USAGE.md +60 -0
- package/src/components/SegmentedControl/IMPLEMENTATION_NOTES.md +14 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +201 -0
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +106 -0
- package/src/components/SegmentedControl/SegmentedControl.test.tsx +1 -0
- package/src/components/SegmentedControl/SegmentedControl.tsx +149 -0
- package/src/components/SegmentedControl/USAGE.md +49 -0
- package/src/components/SegmentedControl/index.ts +1 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +55 -0
- package/src/components/Slider/Slider.module.css +635 -0
- package/src/components/Slider/Slider.stories.tsx +282 -0
- package/src/components/Slider/Slider.test.tsx +1 -0
- package/src/components/Slider/Slider.tsx +435 -0
- package/src/components/Slider/USAGE.md +56 -0
- package/src/components/Slider/index.ts +1 -0
- package/src/components/Stack/Stack.stories.tsx +108 -0
- package/src/components/Stack/Stack.test.tsx +1 -0
- package/src/components/Stack/Stack.tsx +43 -0
- package/src/components/Stack/USAGE.md +41 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +120 -0
- package/src/components/Stepper/Stepper.module.css +474 -0
- package/src/components/Stepper/Stepper.stories.tsx +157 -0
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Stepper/Stepper.tsx +240 -0
- package/src/components/Stepper/USAGE.md +45 -0
- package/src/components/Stepper/index.ts +1 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +147 -0
- package/src/components/Switch/Switch.module.css +346 -0
- package/src/components/Switch/Switch.stories.tsx +114 -0
- package/src/components/Switch/Switch.test.tsx +1 -0
- package/src/components/Switch/Switch.tsx +294 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +156 -0
- package/src/components/Switch/USAGE.md +36 -0
- package/src/components/Switch/index.ts +2 -0
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +75 -0
- package/src/components/Table/Table.module.css +462 -0
- package/src/components/Table/Table.stories.tsx +154 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Table/Table.tsx +250 -0
- package/src/components/Table/USAGE.md +90 -0
- package/src/components/Table/index.ts +1 -0
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +76 -0
- package/src/components/Tabs/Tabs.module.css +801 -0
- package/src/components/Tabs/Tabs.stories.tsx +174 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +103 -0
- package/src/components/Tabs/USAGE.md +61 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +10 -0
- package/src/components/Text/Text.stories.tsx +75 -0
- package/src/components/Text/Text.test.tsx +1 -0
- package/src/components/Text/Text.tsx +19 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/Text/index.ts +1 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/TextArea/TextArea.module.css +203 -0
- package/src/components/TextArea/TextArea.stories.tsx +94 -0
- package/src/components/TextArea/TextArea.test.tsx +1 -0
- package/src/components/TextArea/TextArea.tsx +162 -0
- package/src/components/TextArea/USAGE.md +38 -0
- package/src/components/TextArea/index.ts +1 -0
- package/src/components/TextField/TextField.module.css +271 -0
- package/src/components/TextField/TextField.stories.tsx +162 -0
- package/src/components/TextField/TextField.test.tsx +1 -0
- package/src/components/TextField/TextField.tsx +182 -0
- package/src/components/TextField/USAGE.md +38 -0
- package/src/components/TextField/index.ts +1 -0
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +89 -0
- package/src/components/TimePicker/TimePicker.module.css +262 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +155 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +277 -0
- package/src/components/TimePicker/USAGE.md +61 -0
- package/src/components/TimePicker/index.ts +1 -0
- package/src/components/Timeline/IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/Timeline/Timeline.module.css +363 -0
- package/src/components/Timeline/Timeline.stories.tsx +128 -0
- package/src/components/Timeline/Timeline.test.tsx +1 -0
- package/src/components/Timeline/Timeline.tsx +90 -0
- package/src/components/Timeline/TimelineItem.tsx +95 -0
- package/src/components/Timeline/USAGE.md +41 -0
- package/src/components/Timeline/index.ts +2 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +37 -0
- package/src/components/Toast/Toast.module.css +193 -0
- package/src/components/Toast/Toast.stories.tsx +67 -0
- package/src/components/Toast/Toast.test.tsx +1 -0
- package/src/components/Toast/Toast.tsx +121 -0
- package/src/components/Toast/USAGE.md +42 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/Tooltip.module.css +83 -0
- package/src/components/Tooltip/Tooltip.stories.tsx +165 -0
- package/src/components/Tooltip/Tooltip.test.tsx +1 -0
- package/src/components/Tooltip/Tooltip.tsx +78 -0
- package/src/components/Tooltip/USAGE.md +40 -0
- package/src/components/Tooltip/index.ts +1 -0
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +140 -0
- package/src/components/TransferList/TransferList.module.css +174 -0
- package/src/components/TransferList/TransferList.stories.tsx +121 -0
- package/src/components/TransferList/TransferList.test.tsx +1 -0
- package/src/components/TransferList/TransferList.tsx +419 -0
- package/src/components/TransferList/USAGE.md +77 -0
- package/src/components/TransferList/index.ts +1 -0
- package/src/components/Tree/IMPLEMENTATION_NOTES.md +53 -0
- package/src/components/Tree/Tree.module.css +272 -0
- package/src/components/Tree/Tree.stories.tsx +104 -0
- package/src/components/Tree/Tree.test.tsx +1 -0
- package/src/components/Tree/Tree.tsx +298 -0
- package/src/components/Tree/USAGE.md +99 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/Typography/TYPOGRAPHY_IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Typography/Typography.module.css +13 -0
- package/src/components/Typography/Typography.test.tsx +1 -0
- package/src/components/Typography/Typography.tsx +43 -0
- package/src/components/Typography/USAGE.md +40 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/index.ts +50 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +194 -0
- package/src/types/index.ts +9 -0
- package/src/types/scss-modules.d.ts +9 -0
- package/src/utils/ColorSchemeWrapper.tsx +23 -0
- package/src/utils/RequireAccessibleLabel.ts +1 -0
- package/src/utils/copyToClipboard.ts +36 -0
- package/src/utils/filterStylingProps.test.ts +85 -0
- package/src/utils/filterStylingProps.ts +143 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/renderRichOption.tsx +51 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import React, { useState } from "react";
|
|
3
|
+
import { FileInput } from "./FileInput";
|
|
4
|
+
import { type RecursicaFileUploadItem } from "@recursica/adapter-common";
|
|
5
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
6
|
+
|
|
7
|
+
function mockFile(name: string, size = 1024) {
|
|
8
|
+
return new File([new Uint8Array(size)], name);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const meta: Meta<typeof FileInput> = {
|
|
12
|
+
title: "UI-Kit/FileInput",
|
|
13
|
+
component: FileInput,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
parameters: {
|
|
16
|
+
docs: {
|
|
17
|
+
description: {
|
|
18
|
+
component: `
|
|
19
|
+
The \`FileInput\` component is a single-line, \`TextField\`-shaped control for choosing files, integrated directly into the \`FormControlWrapper\` architecture. It shares \`FileUpload\`'s selection/validation interface (\`accept\`/\`maxSize\`/\`maxFiles\`, \`readOnly\`) behind a different presentation — every selected file renders as a removable chip in a horizontally scrollable row, and a trailing \`Button\` clears the current selection.
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
\`\`\`tsx
|
|
23
|
+
<FileInput
|
|
24
|
+
label="Resume"
|
|
25
|
+
files={files}
|
|
26
|
+
onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
27
|
+
onFileRemove={() => setFiles([])}
|
|
28
|
+
/>
|
|
29
|
+
\`\`\`
|
|
30
|
+
`,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
argTypes: {
|
|
35
|
+
...formControlArgTypes,
|
|
36
|
+
accept: {
|
|
37
|
+
control: "text",
|
|
38
|
+
description:
|
|
39
|
+
"Native `accept` attribute for the file picker (e.g. `.pdf,.png`).",
|
|
40
|
+
},
|
|
41
|
+
multiple: {
|
|
42
|
+
control: "boolean",
|
|
43
|
+
description:
|
|
44
|
+
"Whether more than one file can be selected/dropped at once. Defaults to `false`.",
|
|
45
|
+
},
|
|
46
|
+
maxSize: {
|
|
47
|
+
control: "number",
|
|
48
|
+
description: "Maximum size per file, in bytes.",
|
|
49
|
+
},
|
|
50
|
+
maxFiles: {
|
|
51
|
+
control: "number",
|
|
52
|
+
description:
|
|
53
|
+
"Maximum total number of files allowed. Only meaningful when `multiple` is `true`.",
|
|
54
|
+
},
|
|
55
|
+
readOnly: {
|
|
56
|
+
control: "boolean",
|
|
57
|
+
description:
|
|
58
|
+
"Renders `files` as a static, non-interactive display with no clear/remove icons.",
|
|
59
|
+
},
|
|
60
|
+
placeholder: {
|
|
61
|
+
control: "text",
|
|
62
|
+
},
|
|
63
|
+
icon: {
|
|
64
|
+
table: { disable: true },
|
|
65
|
+
},
|
|
66
|
+
clearIcon: {
|
|
67
|
+
table: { disable: true },
|
|
68
|
+
},
|
|
69
|
+
files: {
|
|
70
|
+
table: { disable: true },
|
|
71
|
+
},
|
|
72
|
+
onFilesAdded: {
|
|
73
|
+
table: { disable: true },
|
|
74
|
+
},
|
|
75
|
+
onFileRemove: {
|
|
76
|
+
table: { disable: true },
|
|
77
|
+
},
|
|
78
|
+
onFilesRejected: {
|
|
79
|
+
table: { disable: true },
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default meta;
|
|
85
|
+
|
|
86
|
+
type Story = StoryObj<typeof FileInput>;
|
|
87
|
+
type FileInputStoryArgs = React.ComponentProps<typeof FileInput> & {
|
|
88
|
+
withLayer?: boolean;
|
|
89
|
+
layer?: number;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Default: Story = {
|
|
93
|
+
args: {
|
|
94
|
+
label: "Resume",
|
|
95
|
+
},
|
|
96
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
97
|
+
render: function FileInputStory({
|
|
98
|
+
withLayer,
|
|
99
|
+
layer,
|
|
100
|
+
...args
|
|
101
|
+
}: FileInputStoryArgs) {
|
|
102
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
103
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([]);
|
|
104
|
+
return (
|
|
105
|
+
<FileInput
|
|
106
|
+
{...args}
|
|
107
|
+
files={files}
|
|
108
|
+
onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
109
|
+
onFileRemove={() => setFiles([])}
|
|
110
|
+
/>
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const WithFile: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
label: "Resume",
|
|
118
|
+
},
|
|
119
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
120
|
+
render: function FileInputStory({
|
|
121
|
+
withLayer,
|
|
122
|
+
layer,
|
|
123
|
+
...args
|
|
124
|
+
}: FileInputStoryArgs) {
|
|
125
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
126
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([
|
|
127
|
+
{ file: mockFile("resume.pdf") },
|
|
128
|
+
]);
|
|
129
|
+
return (
|
|
130
|
+
<FileInput
|
|
131
|
+
{...args}
|
|
132
|
+
files={files}
|
|
133
|
+
onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
134
|
+
onFileRemove={() => setFiles([])}
|
|
135
|
+
/>
|
|
136
|
+
);
|
|
137
|
+
},
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const MultipleFiles: Story = {
|
|
141
|
+
args: {
|
|
142
|
+
label: "Attachments",
|
|
143
|
+
assistiveText: "Up to 5 files",
|
|
144
|
+
multiple: true,
|
|
145
|
+
},
|
|
146
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
147
|
+
render: function FileInputStory({
|
|
148
|
+
withLayer,
|
|
149
|
+
layer,
|
|
150
|
+
...args
|
|
151
|
+
}: FileInputStoryArgs) {
|
|
152
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
153
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([
|
|
154
|
+
{ file: mockFile("document.pdf") },
|
|
155
|
+
{ file: mockFile("image.png") },
|
|
156
|
+
{ file: mockFile("spreadsheet.xlsx") },
|
|
157
|
+
]);
|
|
158
|
+
return (
|
|
159
|
+
<FileInput
|
|
160
|
+
{...args}
|
|
161
|
+
files={files}
|
|
162
|
+
onFilesAdded={(added) =>
|
|
163
|
+
setFiles((prev) => [...prev, ...added.map((file) => ({ file }))])
|
|
164
|
+
}
|
|
165
|
+
onFileRemove={(id) =>
|
|
166
|
+
setFiles((prev) =>
|
|
167
|
+
prev.filter((item) => (item.id ?? item.file.name) !== id),
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
/>
|
|
171
|
+
);
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export const SideBySide: Story = {
|
|
176
|
+
args: {
|
|
177
|
+
label: "Resume",
|
|
178
|
+
assistiveText: "PDF or Word document",
|
|
179
|
+
formLayout: "side-by-side",
|
|
180
|
+
},
|
|
181
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
182
|
+
render: function FileInputStory({
|
|
183
|
+
withLayer,
|
|
184
|
+
layer,
|
|
185
|
+
...args
|
|
186
|
+
}: FileInputStoryArgs) {
|
|
187
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
188
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([]);
|
|
189
|
+
return (
|
|
190
|
+
<FileInput
|
|
191
|
+
{...args}
|
|
192
|
+
files={files}
|
|
193
|
+
onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
194
|
+
onFileRemove={() => setFiles([])}
|
|
195
|
+
/>
|
|
196
|
+
);
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
export const Disabled: Story = {
|
|
201
|
+
args: {
|
|
202
|
+
label: "Resume",
|
|
203
|
+
disabled: true,
|
|
204
|
+
},
|
|
205
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
206
|
+
render: function FileInputStory({
|
|
207
|
+
withLayer,
|
|
208
|
+
layer,
|
|
209
|
+
...args
|
|
210
|
+
}: FileInputStoryArgs) {
|
|
211
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
212
|
+
const [files] = useState<RecursicaFileUploadItem[]>([
|
|
213
|
+
{ file: mockFile("resume.pdf") },
|
|
214
|
+
]);
|
|
215
|
+
return <FileInput {...args} files={files} />;
|
|
216
|
+
},
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
export const ErrorState: Story = {
|
|
220
|
+
args: {
|
|
221
|
+
label: "Resume",
|
|
222
|
+
error: "A file is required.",
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export const ReadOnly: Story = {
|
|
227
|
+
args: {
|
|
228
|
+
label: "Attachments",
|
|
229
|
+
assistiveText: "Submitted files cannot be changed",
|
|
230
|
+
multiple: true,
|
|
231
|
+
readOnly: true,
|
|
232
|
+
},
|
|
233
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
234
|
+
render: function FileInputStory({
|
|
235
|
+
withLayer,
|
|
236
|
+
layer,
|
|
237
|
+
...args
|
|
238
|
+
}: FileInputStoryArgs) {
|
|
239
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
240
|
+
const [files] = useState<RecursicaFileUploadItem[]>([
|
|
241
|
+
{ file: mockFile("document.pdf") },
|
|
242
|
+
{ file: mockFile("image.png") },
|
|
243
|
+
]);
|
|
244
|
+
return <FileInput {...args} files={files} />;
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
// Demonstrates that `accept` isn't just cosmetic on the native file-picker dialog — files that
|
|
249
|
+
// don't match it are rejected the same way whether picked or dropped directly (drag-and-drop
|
|
250
|
+
// bypasses the native `accept` filtering entirely, so this only works because FileInput
|
|
251
|
+
// re-validates it itself, same as FileUpload). Drag a non-.pdf file onto the control to see it
|
|
252
|
+
// switch into its error state with the default `invalidFileTypeMessage`.
|
|
253
|
+
export const AcceptRestriction: Story = {
|
|
254
|
+
args: {
|
|
255
|
+
label: "Resume",
|
|
256
|
+
assistiveText: "Only .pdf files are accepted",
|
|
257
|
+
accept: ".pdf",
|
|
258
|
+
},
|
|
259
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
260
|
+
render: function FileInputStory({
|
|
261
|
+
withLayer,
|
|
262
|
+
layer,
|
|
263
|
+
...args
|
|
264
|
+
}: FileInputStoryArgs) {
|
|
265
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
266
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([]);
|
|
267
|
+
return (
|
|
268
|
+
<FileInput
|
|
269
|
+
{...args}
|
|
270
|
+
files={files}
|
|
271
|
+
onFilesAdded={(added) => setFiles(added.map((file) => ({ file })))}
|
|
272
|
+
onFileRemove={() => setFiles([])}
|
|
273
|
+
/>
|
|
274
|
+
);
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
// Demonstrates `maxFiles` in multiple-file mode: already at the 2-file cap below, so
|
|
279
|
+
// dropping/picking another file is rejected with the default `maxFilesMessage`.
|
|
280
|
+
export const MaxFilesRestriction: Story = {
|
|
281
|
+
args: {
|
|
282
|
+
label: "Attachments",
|
|
283
|
+
assistiveText: "Up to 2 files allowed",
|
|
284
|
+
multiple: true,
|
|
285
|
+
maxFiles: 2,
|
|
286
|
+
},
|
|
287
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
288
|
+
render: function FileInputStory({
|
|
289
|
+
withLayer,
|
|
290
|
+
layer,
|
|
291
|
+
...args
|
|
292
|
+
}: FileInputStoryArgs) {
|
|
293
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
294
|
+
const [files, setFiles] = useState<RecursicaFileUploadItem[]>([
|
|
295
|
+
{ file: mockFile("document.pdf") },
|
|
296
|
+
{ file: mockFile("image.png") },
|
|
297
|
+
]);
|
|
298
|
+
return (
|
|
299
|
+
<FileInput
|
|
300
|
+
{...args}
|
|
301
|
+
files={files}
|
|
302
|
+
onFilesAdded={(added) =>
|
|
303
|
+
setFiles((prev) => [...prev, ...added.map((file) => ({ file }))])
|
|
304
|
+
}
|
|
305
|
+
onFileRemove={(id) =>
|
|
306
|
+
setFiles((prev) =>
|
|
307
|
+
prev.filter((item) => (item.id ?? item.file.name) !== id),
|
|
308
|
+
)
|
|
309
|
+
}
|
|
310
|
+
/>
|
|
311
|
+
);
|
|
312
|
+
},
|
|
313
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future FileInput component tests. Add tests here if/when needed.
|