@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,121 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import { TransferList } from "./TransferList";
|
|
4
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
5
|
+
|
|
6
|
+
type TransferListStoryProps = React.ComponentProps<typeof TransferList>;
|
|
7
|
+
|
|
8
|
+
const SAMPLE_DATA: TransferListStoryProps["defaultData"] = [
|
|
9
|
+
[
|
|
10
|
+
{ value: "alpha", label: "Alpha" },
|
|
11
|
+
{ value: "bravo", label: "Bravo" },
|
|
12
|
+
{ value: "charlie", label: "Charlie" },
|
|
13
|
+
{ value: "delta", label: "Delta" },
|
|
14
|
+
{ value: "echo", label: "Echo" },
|
|
15
|
+
],
|
|
16
|
+
[{ value: "foxtrot", label: "Foxtrot" }],
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
const GROUPED_DATA: TransferListStoryProps["defaultData"] = [
|
|
20
|
+
[
|
|
21
|
+
{ value: "apple", label: "Apple", group: "Fruit" },
|
|
22
|
+
{ value: "banana", label: "Banana", group: "Fruit" },
|
|
23
|
+
{ value: "carrot", label: "Carrot", group: "Vegetable" },
|
|
24
|
+
{ value: "daikon", label: "Daikon", group: "Vegetable" },
|
|
25
|
+
{ value: "eagle", label: "Eagle" },
|
|
26
|
+
],
|
|
27
|
+
[],
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
const meta: Meta<TransferListStoryProps> = {
|
|
31
|
+
title: "UI-Kit/TransferList",
|
|
32
|
+
component: TransferList,
|
|
33
|
+
tags: ["autodocs"],
|
|
34
|
+
parameters: {
|
|
35
|
+
docs: {
|
|
36
|
+
description: {
|
|
37
|
+
component:
|
|
38
|
+
"TransferList (dual listbox) lets users move items between two lists. Composes FormControlWrapper, TextField, Checkbox, CheckboxGroup, Badge, and Button.",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
args: {
|
|
43
|
+
label: "Assign users",
|
|
44
|
+
assistiveText: "Move users into the selected list.",
|
|
45
|
+
defaultData: SAMPLE_DATA,
|
|
46
|
+
disabled: false,
|
|
47
|
+
required: false,
|
|
48
|
+
},
|
|
49
|
+
argTypes: {
|
|
50
|
+
disabled: {
|
|
51
|
+
control: "boolean",
|
|
52
|
+
},
|
|
53
|
+
...formControlArgTypes,
|
|
54
|
+
sourceLabel: {
|
|
55
|
+
control: "text",
|
|
56
|
+
},
|
|
57
|
+
targetLabel: {
|
|
58
|
+
control: "text",
|
|
59
|
+
},
|
|
60
|
+
searchable: {
|
|
61
|
+
control: "boolean",
|
|
62
|
+
},
|
|
63
|
+
searchPlaceholder: {
|
|
64
|
+
control: "text",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default meta;
|
|
70
|
+
|
|
71
|
+
type Story = StoryObj<TransferListStoryProps>;
|
|
72
|
+
|
|
73
|
+
export const Default: Story = {};
|
|
74
|
+
|
|
75
|
+
export const Grouped: Story = {
|
|
76
|
+
args: {
|
|
77
|
+
label: "Assign ingredients",
|
|
78
|
+
defaultData: GROUPED_DATA,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const SideBySide: Story = {
|
|
83
|
+
args: {
|
|
84
|
+
formLayout: "side-by-side",
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const NoSearch: Story = {
|
|
89
|
+
args: {
|
|
90
|
+
label: "Assign users (no filtering)",
|
|
91
|
+
searchable: false,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export const StaticError: Story = {
|
|
96
|
+
args: {
|
|
97
|
+
error: "Select at least one user.",
|
|
98
|
+
defaultData: [[], SAMPLE_DATA![0]],
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const StaticDisabled: Story = {
|
|
103
|
+
args: {
|
|
104
|
+
disabled: true,
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export const Empty: Story = {
|
|
109
|
+
args: {
|
|
110
|
+
label: "Assign users",
|
|
111
|
+
defaultData: [[], []],
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const ReadOnly: Story = {
|
|
116
|
+
args: {
|
|
117
|
+
label: "Assigned users",
|
|
118
|
+
defaultData: [[], SAMPLE_DATA![0]],
|
|
119
|
+
readOnly: true,
|
|
120
|
+
},
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TransferList component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import { forwardRef, useCallback, useId, useMemo, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
filterStylingProps,
|
|
4
|
+
type RecursicaOverStyled,
|
|
5
|
+
} from "../../utils/filterStylingProps";
|
|
6
|
+
import { type FormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
|
|
7
|
+
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
8
|
+
import { Badge } from "../Badge/Badge";
|
|
9
|
+
import { Button } from "../Button/Button";
|
|
10
|
+
import { TextField } from "../TextField/TextField";
|
|
11
|
+
import { Checkbox } from "../Checkbox/Checkbox";
|
|
12
|
+
import { CheckboxGroup } from "../Checkbox/CheckboxGroup";
|
|
13
|
+
import styles from "./TransferList.module.css";
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
type ReadOnlyControlProps,
|
|
17
|
+
type RecursicaTransferListProps as BaseRecursicaTransferListProps,
|
|
18
|
+
type RecursicaTransferListItem,
|
|
19
|
+
type RecursicaTransferListData,
|
|
20
|
+
} from "@recursica/adapter-common";
|
|
21
|
+
|
|
22
|
+
export type { RecursicaTransferListItem, RecursicaTransferListData };
|
|
23
|
+
|
|
24
|
+
export interface RecursicaTransferListProps
|
|
25
|
+
extends Omit<
|
|
26
|
+
FormControlWrapperProps,
|
|
27
|
+
| "children"
|
|
28
|
+
| "overStyled"
|
|
29
|
+
| "controlMaxWidth"
|
|
30
|
+
| "controlMinWidth"
|
|
31
|
+
| "onChange"
|
|
32
|
+
>,
|
|
33
|
+
ReadOnlyControlProps,
|
|
34
|
+
BaseRecursicaTransferListProps {
|
|
35
|
+
/** Disables the whole control */
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type TransferListProps = RecursicaOverStyled<RecursicaTransferListProps>;
|
|
40
|
+
|
|
41
|
+
/** Single/double chevron glyphs for the transfer buttons; flipped via CSS for the "left" direction
|
|
42
|
+
* so only one path needs to be maintained, same approach as Tree's `ExpandGlyph`. */
|
|
43
|
+
function ChevronIcon({ direction }: { direction: "left" | "right" }) {
|
|
44
|
+
return (
|
|
45
|
+
<svg
|
|
46
|
+
className={styles.chevron}
|
|
47
|
+
data-direction={direction}
|
|
48
|
+
viewBox="0 0 16 16"
|
|
49
|
+
width="1em"
|
|
50
|
+
height="1em"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
strokeWidth="2"
|
|
54
|
+
strokeLinecap="round"
|
|
55
|
+
strokeLinejoin="round"
|
|
56
|
+
aria-hidden="true"
|
|
57
|
+
>
|
|
58
|
+
<path d="M6 3l5 5-5 5" />
|
|
59
|
+
</svg>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function ChevronsIcon({ direction }: { direction: "left" | "right" }) {
|
|
64
|
+
return (
|
|
65
|
+
<svg
|
|
66
|
+
className={styles.chevron}
|
|
67
|
+
data-direction={direction}
|
|
68
|
+
viewBox="0 0 16 16"
|
|
69
|
+
width="1em"
|
|
70
|
+
height="1em"
|
|
71
|
+
fill="none"
|
|
72
|
+
stroke="currentColor"
|
|
73
|
+
strokeWidth="2"
|
|
74
|
+
strokeLinecap="round"
|
|
75
|
+
strokeLinejoin="round"
|
|
76
|
+
aria-hidden="true"
|
|
77
|
+
>
|
|
78
|
+
<path d="M3 3l5 5-5 5M9 3l5 5-5 5" />
|
|
79
|
+
</svg>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** Splits items into grouped/ungrouped buckets, same shape Forge's reference groups by `group`. */
|
|
84
|
+
function groupItems(items: RecursicaTransferListItem[]) {
|
|
85
|
+
const groups: Record<string, RecursicaTransferListItem[]> = {};
|
|
86
|
+
const ungrouped: RecursicaTransferListItem[] = [];
|
|
87
|
+
items.forEach((item) => {
|
|
88
|
+
if (item.group) {
|
|
89
|
+
(groups[item.group] ??= []).push(item);
|
|
90
|
+
} else {
|
|
91
|
+
ungrouped.push(item);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return { groups, ungrouped };
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const TransferList = forwardRef<HTMLDivElement, TransferListProps>(
|
|
98
|
+
function TransferList(props, ref) {
|
|
99
|
+
const {
|
|
100
|
+
overStyled = false,
|
|
101
|
+
formLayout = "stacked",
|
|
102
|
+
|
|
103
|
+
// Label & Wrapper Maps
|
|
104
|
+
labelSize,
|
|
105
|
+
labelAlignment,
|
|
106
|
+
labelOptionalText,
|
|
107
|
+
labelWithEditIcon,
|
|
108
|
+
labelActionArea,
|
|
109
|
+
onLabelEditClick,
|
|
110
|
+
|
|
111
|
+
label,
|
|
112
|
+
assistiveText,
|
|
113
|
+
description,
|
|
114
|
+
helperText,
|
|
115
|
+
assistiveWithIcon,
|
|
116
|
+
error,
|
|
117
|
+
required,
|
|
118
|
+
id: userProvidedId,
|
|
119
|
+
readOnly,
|
|
120
|
+
readOnlyComponent,
|
|
121
|
+
emptyValueComponent,
|
|
122
|
+
|
|
123
|
+
data: controlledData,
|
|
124
|
+
defaultData,
|
|
125
|
+
onChange,
|
|
126
|
+
sourceLabel = "Available",
|
|
127
|
+
targetLabel = "Selected",
|
|
128
|
+
searchable = true,
|
|
129
|
+
searchPlaceholder = "Filter items...",
|
|
130
|
+
disabled = false,
|
|
131
|
+
|
|
132
|
+
className,
|
|
133
|
+
style,
|
|
134
|
+
...rest
|
|
135
|
+
} = props;
|
|
136
|
+
const sanitizedProps = filterStylingProps(rest, overStyled);
|
|
137
|
+
|
|
138
|
+
const generatedId = useId();
|
|
139
|
+
const id = userProvidedId || `recursica-transfer-list-${generatedId}`;
|
|
140
|
+
|
|
141
|
+
// Manage internal state for uncontrolled mode
|
|
142
|
+
const [internalData, setInternalData] = useState<RecursicaTransferListData>(
|
|
143
|
+
() => defaultData ?? controlledData ?? [[], []],
|
|
144
|
+
);
|
|
145
|
+
const effectiveData =
|
|
146
|
+
controlledData !== undefined ? controlledData : internalData;
|
|
147
|
+
|
|
148
|
+
const handleChange = useCallback(
|
|
149
|
+
(newData: RecursicaTransferListData) => {
|
|
150
|
+
if (controlledData === undefined) {
|
|
151
|
+
setInternalData(newData);
|
|
152
|
+
}
|
|
153
|
+
onChange?.(newData);
|
|
154
|
+
},
|
|
155
|
+
[controlledData, onChange],
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
const [sourceSearch, setSourceSearch] = useState("");
|
|
159
|
+
const [targetSearch, setTargetSearch] = useState("");
|
|
160
|
+
const [sourceSelected, setSourceSelected] = useState<Set<string>>(
|
|
161
|
+
() => new Set(),
|
|
162
|
+
);
|
|
163
|
+
const [targetSelected, setTargetSelected] = useState<Set<string>>(
|
|
164
|
+
() => new Set(),
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
const filteredSource = useMemo(() => {
|
|
168
|
+
if (!sourceSearch) return effectiveData[0];
|
|
169
|
+
const query = sourceSearch.toLowerCase();
|
|
170
|
+
return effectiveData[0].filter((item) =>
|
|
171
|
+
item.label.toLowerCase().includes(query),
|
|
172
|
+
);
|
|
173
|
+
}, [effectiveData, sourceSearch]);
|
|
174
|
+
|
|
175
|
+
const filteredTarget = useMemo(() => {
|
|
176
|
+
if (!targetSearch) return effectiveData[1];
|
|
177
|
+
const query = targetSearch.toLowerCase();
|
|
178
|
+
return effectiveData[1].filter((item) =>
|
|
179
|
+
item.label.toLowerCase().includes(query),
|
|
180
|
+
);
|
|
181
|
+
}, [effectiveData, targetSearch]);
|
|
182
|
+
|
|
183
|
+
const transferToTarget = useCallback(() => {
|
|
184
|
+
if (sourceSelected.size === 0) return;
|
|
185
|
+
const newSource = effectiveData[0].filter(
|
|
186
|
+
(item) => !sourceSelected.has(item.value),
|
|
187
|
+
);
|
|
188
|
+
const moved = effectiveData[0].filter((item) =>
|
|
189
|
+
sourceSelected.has(item.value),
|
|
190
|
+
);
|
|
191
|
+
setSourceSelected(new Set());
|
|
192
|
+
handleChange([newSource, [...effectiveData[1], ...moved]]);
|
|
193
|
+
}, [effectiveData, sourceSelected, handleChange]);
|
|
194
|
+
|
|
195
|
+
const transferToSource = useCallback(() => {
|
|
196
|
+
if (targetSelected.size === 0) return;
|
|
197
|
+
const newTarget = effectiveData[1].filter(
|
|
198
|
+
(item) => !targetSelected.has(item.value),
|
|
199
|
+
);
|
|
200
|
+
const moved = effectiveData[1].filter((item) =>
|
|
201
|
+
targetSelected.has(item.value),
|
|
202
|
+
);
|
|
203
|
+
setTargetSelected(new Set());
|
|
204
|
+
handleChange([[...effectiveData[0], ...moved], newTarget]);
|
|
205
|
+
}, [effectiveData, targetSelected, handleChange]);
|
|
206
|
+
|
|
207
|
+
const transferAllToTarget = useCallback(() => {
|
|
208
|
+
if (effectiveData[0].length === 0) return;
|
|
209
|
+
setSourceSelected(new Set());
|
|
210
|
+
handleChange([[], [...effectiveData[1], ...effectiveData[0]]]);
|
|
211
|
+
}, [effectiveData, handleChange]);
|
|
212
|
+
|
|
213
|
+
const transferAllToSource = useCallback(() => {
|
|
214
|
+
if (effectiveData[1].length === 0) return;
|
|
215
|
+
setTargetSelected(new Set());
|
|
216
|
+
handleChange([[...effectiveData[0], ...effectiveData[1]], []]);
|
|
217
|
+
}, [effectiveData, handleChange]);
|
|
218
|
+
|
|
219
|
+
const toggleSourceItem = useCallback((value: string) => {
|
|
220
|
+
setSourceSelected((prev) => {
|
|
221
|
+
const next = new Set(prev);
|
|
222
|
+
if (next.has(value)) next.delete(value);
|
|
223
|
+
else next.add(value);
|
|
224
|
+
return next;
|
|
225
|
+
});
|
|
226
|
+
}, []);
|
|
227
|
+
|
|
228
|
+
const toggleTargetItem = useCallback((value: string) => {
|
|
229
|
+
setTargetSelected((prev) => {
|
|
230
|
+
const next = new Set(prev);
|
|
231
|
+
if (next.has(value)) next.delete(value);
|
|
232
|
+
else next.add(value);
|
|
233
|
+
return next;
|
|
234
|
+
});
|
|
235
|
+
}, []);
|
|
236
|
+
|
|
237
|
+
const renderPane = (
|
|
238
|
+
paneId: string,
|
|
239
|
+
paneLabel: string,
|
|
240
|
+
items: RecursicaTransferListItem[],
|
|
241
|
+
allItems: RecursicaTransferListItem[],
|
|
242
|
+
selected: Set<string>,
|
|
243
|
+
onToggle: (value: string) => void,
|
|
244
|
+
search: string,
|
|
245
|
+
onSearchChange: (value: string) => void,
|
|
246
|
+
) => {
|
|
247
|
+
const { groups, ungrouped } = groupItems(items);
|
|
248
|
+
const groupNames = Object.keys(groups).sort();
|
|
249
|
+
const countText =
|
|
250
|
+
selected.size > 0
|
|
251
|
+
? `${selected.size} / ${allItems.length}`
|
|
252
|
+
: `${allItems.length}`;
|
|
253
|
+
|
|
254
|
+
return (
|
|
255
|
+
<div className={styles.pane} data-pane={paneId}>
|
|
256
|
+
<div className={styles.paneHeader}>
|
|
257
|
+
<span>{paneLabel}</span>
|
|
258
|
+
<Badge>{countText}</Badge>
|
|
259
|
+
</div>
|
|
260
|
+
|
|
261
|
+
{searchable && (
|
|
262
|
+
<div className={styles.paneSearch}>
|
|
263
|
+
<TextField
|
|
264
|
+
value={search}
|
|
265
|
+
onChange={(e) => onSearchChange(e.currentTarget.value)}
|
|
266
|
+
placeholder={searchPlaceholder}
|
|
267
|
+
disabled={disabled}
|
|
268
|
+
aria-label={`Filter ${paneLabel.toLowerCase()}`}
|
|
269
|
+
/>
|
|
270
|
+
</div>
|
|
271
|
+
)}
|
|
272
|
+
|
|
273
|
+
<div className={styles.paneList}>
|
|
274
|
+
{items.length === 0 && (
|
|
275
|
+
<div className={styles.emptyState}>No items</div>
|
|
276
|
+
)}
|
|
277
|
+
|
|
278
|
+
{ungrouped.length > 0 && (
|
|
279
|
+
<CheckboxGroup>
|
|
280
|
+
{ungrouped.map((item) => (
|
|
281
|
+
<Checkbox
|
|
282
|
+
key={item.value}
|
|
283
|
+
id={`${id}-${paneId}-${item.value}`}
|
|
284
|
+
label={item.label}
|
|
285
|
+
checked={selected.has(item.value)}
|
|
286
|
+
onChange={() => onToggle(item.value)}
|
|
287
|
+
disabled={disabled}
|
|
288
|
+
/>
|
|
289
|
+
))}
|
|
290
|
+
</CheckboxGroup>
|
|
291
|
+
)}
|
|
292
|
+
|
|
293
|
+
{groupNames.map((groupName) => (
|
|
294
|
+
<CheckboxGroup
|
|
295
|
+
key={groupName}
|
|
296
|
+
label={groupName}
|
|
297
|
+
labelSize="small"
|
|
298
|
+
>
|
|
299
|
+
{groups[groupName].map((item) => (
|
|
300
|
+
<Checkbox
|
|
301
|
+
key={item.value}
|
|
302
|
+
id={`${id}-${paneId}-${item.value}`}
|
|
303
|
+
label={item.label}
|
|
304
|
+
checked={selected.has(item.value)}
|
|
305
|
+
onChange={() => onToggle(item.value)}
|
|
306
|
+
disabled={disabled}
|
|
307
|
+
/>
|
|
308
|
+
))}
|
|
309
|
+
</CheckboxGroup>
|
|
310
|
+
))}
|
|
311
|
+
</div>
|
|
312
|
+
</div>
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const wrapperClass = className
|
|
317
|
+
? `${styles.layoutOverride} ${className}`
|
|
318
|
+
: styles.layoutOverride;
|
|
319
|
+
|
|
320
|
+
return (
|
|
321
|
+
<WithReadOnlyWrapper
|
|
322
|
+
ref={ref}
|
|
323
|
+
formLayout={formLayout}
|
|
324
|
+
labelSize={labelSize}
|
|
325
|
+
labelAlignment={labelAlignment}
|
|
326
|
+
labelOptionalText={labelOptionalText}
|
|
327
|
+
labelWithEditIcon={labelWithEditIcon}
|
|
328
|
+
labelActionArea={labelActionArea}
|
|
329
|
+
onLabelEditClick={onLabelEditClick}
|
|
330
|
+
label={label}
|
|
331
|
+
assistiveText={assistiveText}
|
|
332
|
+
description={description}
|
|
333
|
+
helperText={helperText}
|
|
334
|
+
assistiveWithIcon={assistiveWithIcon}
|
|
335
|
+
error={error}
|
|
336
|
+
required={required}
|
|
337
|
+
disabled={disabled}
|
|
338
|
+
id={id}
|
|
339
|
+
className={wrapperClass}
|
|
340
|
+
style={style}
|
|
341
|
+
readOnly={readOnly}
|
|
342
|
+
readOnlyComponent={readOnlyComponent}
|
|
343
|
+
emptyValueComponent={emptyValueComponent}
|
|
344
|
+
readOnlyType="text"
|
|
345
|
+
readOnlyValue={effectiveData[1].map((item) => item.label)}
|
|
346
|
+
readOnlyNativeProps={props}
|
|
347
|
+
activeComponent={
|
|
348
|
+
<div
|
|
349
|
+
{...(sanitizedProps as Record<string, unknown>)}
|
|
350
|
+
className={styles.root}
|
|
351
|
+
data-disabled={disabled ? "true" : undefined}
|
|
352
|
+
data-error={error ? "true" : undefined}
|
|
353
|
+
>
|
|
354
|
+
<div className={styles.panes}>
|
|
355
|
+
{renderPane(
|
|
356
|
+
"source",
|
|
357
|
+
sourceLabel,
|
|
358
|
+
filteredSource,
|
|
359
|
+
effectiveData[0],
|
|
360
|
+
sourceSelected,
|
|
361
|
+
toggleSourceItem,
|
|
362
|
+
sourceSearch,
|
|
363
|
+
setSourceSearch,
|
|
364
|
+
)}
|
|
365
|
+
|
|
366
|
+
<div className={styles.transferColumn}>
|
|
367
|
+
<Button
|
|
368
|
+
variant="outline"
|
|
369
|
+
size="small"
|
|
370
|
+
icon={<ChevronsIcon direction="right" />}
|
|
371
|
+
aria-label={`Move all to ${targetLabel}`}
|
|
372
|
+
disabled={disabled || effectiveData[0].length === 0}
|
|
373
|
+
onClick={transferAllToTarget}
|
|
374
|
+
/>
|
|
375
|
+
<Button
|
|
376
|
+
variant="outline"
|
|
377
|
+
size="small"
|
|
378
|
+
icon={<ChevronIcon direction="right" />}
|
|
379
|
+
aria-label={`Move selected to ${targetLabel}`}
|
|
380
|
+
disabled={disabled || sourceSelected.size === 0}
|
|
381
|
+
onClick={transferToTarget}
|
|
382
|
+
/>
|
|
383
|
+
<Button
|
|
384
|
+
variant="outline"
|
|
385
|
+
size="small"
|
|
386
|
+
icon={<ChevronIcon direction="left" />}
|
|
387
|
+
aria-label={`Move selected to ${sourceLabel}`}
|
|
388
|
+
disabled={disabled || targetSelected.size === 0}
|
|
389
|
+
onClick={transferToSource}
|
|
390
|
+
/>
|
|
391
|
+
<Button
|
|
392
|
+
variant="outline"
|
|
393
|
+
size="small"
|
|
394
|
+
icon={<ChevronsIcon direction="left" />}
|
|
395
|
+
aria-label={`Move all to ${sourceLabel}`}
|
|
396
|
+
disabled={disabled || effectiveData[1].length === 0}
|
|
397
|
+
onClick={transferAllToSource}
|
|
398
|
+
/>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
{renderPane(
|
|
402
|
+
"target",
|
|
403
|
+
targetLabel,
|
|
404
|
+
filteredTarget,
|
|
405
|
+
effectiveData[1],
|
|
406
|
+
targetSelected,
|
|
407
|
+
toggleTargetItem,
|
|
408
|
+
targetSearch,
|
|
409
|
+
setTargetSearch,
|
|
410
|
+
)}
|
|
411
|
+
</div>
|
|
412
|
+
</div>
|
|
413
|
+
}
|
|
414
|
+
/>
|
|
415
|
+
);
|
|
416
|
+
},
|
|
417
|
+
);
|
|
418
|
+
|
|
419
|
+
TransferList.displayName = "TransferList";
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# TransferList - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `TransferList` component in your projects
|
|
4
|
+
using `@recursica/adapter-mui-v7`.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Import Reference
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import { TransferList } from "@recursica/adapter-mui-v7";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Basic Example
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
import React from "react";
|
|
20
|
+
import { TransferList } from "@recursica/adapter-mui-v7";
|
|
21
|
+
|
|
22
|
+
export default function Demo() {
|
|
23
|
+
return (
|
|
24
|
+
<TransferList
|
|
25
|
+
label="Assign users"
|
|
26
|
+
sourceLabel="Available"
|
|
27
|
+
targetLabel="Selected"
|
|
28
|
+
defaultData={[
|
|
29
|
+
[
|
|
30
|
+
{ value: "1", label: "Item 1" },
|
|
31
|
+
{ value: "2", label: "Item 2" },
|
|
32
|
+
],
|
|
33
|
+
[{ value: "3", label: "Item 3" }],
|
|
34
|
+
]}
|
|
35
|
+
onChange={(data) => console.log(data)}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Items sharing a `group` field render under a `CheckboxGroup` heading in their pane:
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
<TransferList
|
|
45
|
+
label="Assign ingredients"
|
|
46
|
+
defaultData={[
|
|
47
|
+
[
|
|
48
|
+
{ value: "apple", label: "Apple", group: "Fruit" },
|
|
49
|
+
{ value: "carrot", label: "Carrot", group: "Vegetable" },
|
|
50
|
+
{ value: "eagle", label: "Eagle" }, // ungrouped, renders above the groups
|
|
51
|
+
],
|
|
52
|
+
[],
|
|
53
|
+
]}
|
|
54
|
+
/>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Pass `data` instead of `defaultData` to control the selection yourself.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 3. Design System Integration
|
|
62
|
+
|
|
63
|
+
All Recursica components in the `@recursica/adapter-mui-v7` package adhere strictly to design system
|
|
64
|
+
spacing, scaling, and behavior patterns.
|
|
65
|
+
|
|
66
|
+
> [!IMPORTANT]
|
|
67
|
+
>
|
|
68
|
+
> - **Anti-override protection**: Rogue style injections (like inline `style` or arbitrary
|
|
69
|
+
> `className`) are automatically blocked by our prop layer unless `overStyled={true}` is
|
|
70
|
+
> explicitly provided.
|
|
71
|
+
> - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific
|
|
72
|
+
> visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
|
|
73
|
+
> - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in
|
|
74
|
+
> `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
75
|
+
> - **Form control layout**: `label`, `formLayout` (`stacked`/`side-by-side`), `required`,
|
|
76
|
+
> `assistiveText`/`description`/`helperText`, and `error` all route through the shared
|
|
77
|
+
> `FormControlWrapper`, same as every other form control.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TransferList";
|