@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,271 @@
|
|
|
1
|
+
/* Brand-layer exemptions (recursica-allow-brand) — see recursica-token-analyzer README.md.
|
|
2
|
+
* Global hover/focus/disabled state tokens (recursica_variables_scoped.css header, 'Hover & Focus states' / 'Disabled state' — implicit rule for every interactive element; components must not define their own per-component treatment).
|
|
3
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/* LAYOUT SPACING OVERRIDES:
|
|
10
|
+
- Sets the --form-control-margin-bottom spacing hook to map component-specific layout tokens.
|
|
11
|
+
- Also sets the --text-field-control-{max,min}-width hooks consumed inline in TextField.tsx,
|
|
12
|
+
since the token schema no longer provides a single layout-agnostic min/max width. */
|
|
13
|
+
.layoutOverride {
|
|
14
|
+
--form-control-margin-bottom: var(
|
|
15
|
+
--recursica_ui-kit_components_text-field_variants_layouts_stacked_properties_top-bottom-margin
|
|
16
|
+
);
|
|
17
|
+
--text-field-control-max-width: var(
|
|
18
|
+
--recursica_ui-kit_components_text-field_variants_layouts_stacked_properties_max-width
|
|
19
|
+
);
|
|
20
|
+
--text-field-control-min-width: var(
|
|
21
|
+
--recursica_ui-kit_components_text-field_variants_layouts_stacked_properties_min-width
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.layoutOverride[data-form-layout="side-by-side"] {
|
|
26
|
+
--form-control-margin-bottom: var(
|
|
27
|
+
--recursica_ui-kit_components_text-field_variants_layouts_side-by-side_properties_top-bottom-margin
|
|
28
|
+
);
|
|
29
|
+
--text-field-control-max-width: var(
|
|
30
|
+
--recursica_ui-kit_components_text-field_variants_layouts_side-by-side_properties_max-width
|
|
31
|
+
);
|
|
32
|
+
--text-field-control-min-width: var(
|
|
33
|
+
--recursica_ui-kit_components_text-field_variants_layouts_side-by-side_properties_min-width
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* HARDCODED VALUES:
|
|
38
|
+
- border-style: solid. Native structural rendering rule.
|
|
39
|
+
- outline: none. Bypassing browser focus rings to rely strictly on Recursica focus states natively.
|
|
40
|
+
- flex/layout: display: flex on the root wrapper safely encapsulating internal section rendering.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
.root {
|
|
44
|
+
display: flex;
|
|
45
|
+
position: relative;
|
|
46
|
+
width: 100%;
|
|
47
|
+
min-height: var(
|
|
48
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
/* Strict Typography Unification placed on root for MUI InputBase inheritance */
|
|
52
|
+
font-family: var(
|
|
53
|
+
--recursica_ui-kit_components_text-field_properties_text_font-family
|
|
54
|
+
);
|
|
55
|
+
font-size: var(
|
|
56
|
+
--recursica_ui-kit_components_text-field_properties_text_font-size
|
|
57
|
+
);
|
|
58
|
+
font-style: var(
|
|
59
|
+
--recursica_ui-kit_components_text-field_properties_text_font-style
|
|
60
|
+
);
|
|
61
|
+
font-weight: var(
|
|
62
|
+
--recursica_ui-kit_components_text-field_properties_text_font-weight
|
|
63
|
+
);
|
|
64
|
+
letter-spacing: var(
|
|
65
|
+
--recursica_ui-kit_components_text-field_properties_text_letter-spacing
|
|
66
|
+
);
|
|
67
|
+
line-height: var(
|
|
68
|
+
--recursica_ui-kit_components_text-field_properties_text_line-height
|
|
69
|
+
);
|
|
70
|
+
text-decoration: var(
|
|
71
|
+
--recursica_ui-kit_components_text-field_properties_text_text-decoration
|
|
72
|
+
);
|
|
73
|
+
text-transform: var(
|
|
74
|
+
--recursica_ui-kit_components_text-field_properties_text_text-transform
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
/* Box Geometry placed on root so MUI InputBase boundary executes */
|
|
78
|
+
border-radius: var(
|
|
79
|
+
--recursica_ui-kit_components_text-field_properties_border-radius
|
|
80
|
+
);
|
|
81
|
+
border-width: var(
|
|
82
|
+
--recursica_ui-kit_components_text-field_properties_border-size
|
|
83
|
+
);
|
|
84
|
+
border-style: solid;
|
|
85
|
+
|
|
86
|
+
/* Base State Default Execution */
|
|
87
|
+
background-color: var(
|
|
88
|
+
--recursica_ui-kit_components_text-field_properties_colors_background-color
|
|
89
|
+
);
|
|
90
|
+
border-color: var(
|
|
91
|
+
--recursica_ui-kit_components_text-field_properties_colors_border-color
|
|
92
|
+
);
|
|
93
|
+
color: var(
|
|
94
|
+
--recursica_ui-kit_components_text-field_properties_colors_text-color
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
/* Override MUI/Mantine native Input variables governing section spacing padding mathematics safely */
|
|
98
|
+
--input-left-section-size: calc(
|
|
99
|
+
var(
|
|
100
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
101
|
+
) +
|
|
102
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
103
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
|
|
104
|
+
);
|
|
105
|
+
--input-right-section-size: calc(
|
|
106
|
+
var(
|
|
107
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
108
|
+
) +
|
|
109
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
110
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.input {
|
|
115
|
+
/* Structural Overrides */
|
|
116
|
+
width: 100%;
|
|
117
|
+
box-sizing: border-box;
|
|
118
|
+
margin: 0;
|
|
119
|
+
|
|
120
|
+
/* Box Geometry Padding */
|
|
121
|
+
min-height: var(
|
|
122
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
123
|
+
);
|
|
124
|
+
padding-top: var(
|
|
125
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
126
|
+
);
|
|
127
|
+
padding-bottom: var(
|
|
128
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
129
|
+
);
|
|
130
|
+
padding-left: var(
|
|
131
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
132
|
+
);
|
|
133
|
+
padding-right: var(
|
|
134
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
outline: none;
|
|
138
|
+
border: none; /* Because root handles border in MUI */
|
|
139
|
+
background: transparent;
|
|
140
|
+
color: inherit;
|
|
141
|
+
height: auto; /* overrides MUI's 1.1876em */
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.input::placeholder {
|
|
145
|
+
opacity: var(
|
|
146
|
+
--recursica_ui-kit_components_text-field_properties_placeholder-opacity
|
|
147
|
+
);
|
|
148
|
+
color: inherit;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* Dynamic Padding Overrides */
|
|
152
|
+
.root[data-with-left-section="true"] .input {
|
|
153
|
+
padding-left: var(--input-left-section-size);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.root[data-with-right-section="true"] .input {
|
|
157
|
+
padding-right: var(--input-right-section-size);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Flexible End-Caps (Icons, actions) */
|
|
161
|
+
.section {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
height: 100%;
|
|
165
|
+
position: absolute;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.section[data-position="left"] {
|
|
169
|
+
justify-content: flex-start;
|
|
170
|
+
left: 0;
|
|
171
|
+
padding-left: var(
|
|
172
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.section[data-position="right"] {
|
|
177
|
+
justify-content: flex-end;
|
|
178
|
+
right: 0;
|
|
179
|
+
padding-right: var(
|
|
180
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.section :global(svg) {
|
|
185
|
+
width: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
186
|
+
height: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
187
|
+
color: var(
|
|
188
|
+
--recursica_ui-kit_components_text-field_properties_colors_leading-icon
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.section[data-position="right"] :global(svg) {
|
|
193
|
+
color: var(
|
|
194
|
+
--recursica_ui-kit_components_text-field_properties_colors_trailing-icon
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* -------------------------------------
|
|
199
|
+
STATE CASCADE ARCHITECTURE
|
|
200
|
+
-------------------------------------- */
|
|
201
|
+
|
|
202
|
+
/* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
|
|
203
|
+
/* The token schema no longer provides per-component focus colors; apply the generic focus ring
|
|
204
|
+
tokens as a box-shadow ring instead of a color swap (matches mantine-adapter reference). */
|
|
205
|
+
.root:focus-within,
|
|
206
|
+
.root:focus {
|
|
207
|
+
box-shadow:
|
|
208
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
209
|
+
var(--recursica_brand_states_focus_color),
|
|
210
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
211
|
+
var(--recursica_brand_states_focus_margin)
|
|
212
|
+
var(--recursica_brand_states_focus_color);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
216
|
+
.root[data-error="true"] {
|
|
217
|
+
border-color: var(
|
|
218
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_border-color
|
|
219
|
+
);
|
|
220
|
+
background-color: var(
|
|
221
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_background-color
|
|
222
|
+
);
|
|
223
|
+
color: var(
|
|
224
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_text-color
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.root[data-error="true"] .section[data-position="left"] :global(svg) {
|
|
229
|
+
color: var(
|
|
230
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_leading-icon
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.root[data-error="true"] .section[data-position="right"] :global(svg) {
|
|
235
|
+
color: var(
|
|
236
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_trailing-icon
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
241
|
+
.root[data-disabled="true"] {
|
|
242
|
+
border-color: var(
|
|
243
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_border-color
|
|
244
|
+
);
|
|
245
|
+
background-color: var(
|
|
246
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_background-color
|
|
247
|
+
);
|
|
248
|
+
color: var(
|
|
249
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_text-color
|
|
250
|
+
);
|
|
251
|
+
opacity: var(
|
|
252
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_opacity
|
|
253
|
+
);
|
|
254
|
+
cursor: not-allowed;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.root[data-disabled="true"] .input {
|
|
258
|
+
cursor: not-allowed;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.root[data-disabled="true"] .section[data-position="left"] :global(svg) {
|
|
262
|
+
color: var(
|
|
263
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_leading-icon
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.root[data-disabled="true"] .section[data-position="right"] :global(svg) {
|
|
268
|
+
color: var(
|
|
269
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_trailing-icon
|
|
270
|
+
);
|
|
271
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { TextField } from "./TextField";
|
|
3
|
+
import { formControlArgTypes } from "../../../.storybook/commonArgTypes";
|
|
4
|
+
const meta: Meta<typeof TextField> = {
|
|
5
|
+
title: "UI-Kit/TextField",
|
|
6
|
+
component: TextField,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: `
|
|
12
|
+
The \`TextField\` primitive functions as a universal text entry input natively integrated directly into the unified \`FormControlWrapper\` architecture.
|
|
13
|
+
|
|
14
|
+
### Architectural Decoupling
|
|
15
|
+
Recursica forcibly overrides the internal Mantine \`Input.Wrapper\` defaults injecting an untamed \`<Input>\` layout primitive perfectly mapped back into our rigid design systems. State modifiers (e.g. Focus, Errors) hook flawlessly back onto our CSS module mapping variable colors strictly accurately.
|
|
16
|
+
|
|
17
|
+
### Examples
|
|
18
|
+
Always structure horizontal architectures via the generic \`formLayout\` parameter.
|
|
19
|
+
\`\`\`tsx
|
|
20
|
+
<TextField
|
|
21
|
+
label="Primary Network Socket"
|
|
22
|
+
assistiveText="Ensure connections resolve seamlessly."
|
|
23
|
+
formLayout="stacked"
|
|
24
|
+
/>
|
|
25
|
+
\`\`\`
|
|
26
|
+
`,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
...formControlArgTypes,
|
|
32
|
+
disabled: {
|
|
33
|
+
control: "boolean",
|
|
34
|
+
description:
|
|
35
|
+
"Maps the formal disabled variable states structurally to the input core.",
|
|
36
|
+
},
|
|
37
|
+
error: {
|
|
38
|
+
control: "text",
|
|
39
|
+
description:
|
|
40
|
+
"Applies the strict error string boundary rendering invalid structures seamlessly.",
|
|
41
|
+
},
|
|
42
|
+
required: {
|
|
43
|
+
control: "boolean",
|
|
44
|
+
},
|
|
45
|
+
label: {
|
|
46
|
+
control: "text",
|
|
47
|
+
},
|
|
48
|
+
assistiveText: {
|
|
49
|
+
control: "text",
|
|
50
|
+
},
|
|
51
|
+
readOnly: {
|
|
52
|
+
control: "boolean",
|
|
53
|
+
description:
|
|
54
|
+
"Toggles structural read-only data presentation explicitly blocking standard component bindings.",
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export default meta;
|
|
60
|
+
|
|
61
|
+
type Story = StoryObj<typeof TextField>;
|
|
62
|
+
|
|
63
|
+
export const Default: Story = {
|
|
64
|
+
args: {
|
|
65
|
+
disabled: false,
|
|
66
|
+
label: "Authentication Token",
|
|
67
|
+
placeholder: "Enter validation hash...",
|
|
68
|
+
assistiveText:
|
|
69
|
+
"Tokens are stored identically locally and strictly ephemeral.",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export const FormsSideBySide: Story = {
|
|
74
|
+
args: {
|
|
75
|
+
label: "Distributed Access Control",
|
|
76
|
+
placeholder: "admin@node.local",
|
|
77
|
+
assistiveText:
|
|
78
|
+
"Specify the exact cluster administrative credentials enforcing strict domain policies. This violently long string tests native textual wrapping safely mapping alongside inputs.",
|
|
79
|
+
formLayout: "side-by-side",
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export const WithLeadingIcon: Story = {
|
|
84
|
+
args: {
|
|
85
|
+
label: "Search Global Context",
|
|
86
|
+
placeholder: "Search for repositories...",
|
|
87
|
+
leftSection: (
|
|
88
|
+
<svg
|
|
89
|
+
width="24"
|
|
90
|
+
height="24"
|
|
91
|
+
viewBox="0 0 24 24"
|
|
92
|
+
fill="none"
|
|
93
|
+
stroke="currentColor"
|
|
94
|
+
strokeWidth="2"
|
|
95
|
+
strokeLinecap="round"
|
|
96
|
+
strokeLinejoin="round"
|
|
97
|
+
>
|
|
98
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
99
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
100
|
+
</svg>
|
|
101
|
+
),
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const WithTrailingIcon: Story = {
|
|
106
|
+
args: {
|
|
107
|
+
label: "Validation URL",
|
|
108
|
+
placeholder: "https://recursica.dev",
|
|
109
|
+
rightSection: (
|
|
110
|
+
<svg
|
|
111
|
+
width="24"
|
|
112
|
+
height="24"
|
|
113
|
+
viewBox="0 0 24 24"
|
|
114
|
+
fill="none"
|
|
115
|
+
stroke="currentColor"
|
|
116
|
+
strokeWidth="2"
|
|
117
|
+
strokeLinecap="round"
|
|
118
|
+
strokeLinejoin="round"
|
|
119
|
+
>
|
|
120
|
+
<polyline points="20 6 9 17 4 12"></polyline>
|
|
121
|
+
</svg>
|
|
122
|
+
),
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const Disabled: Story = {
|
|
127
|
+
args: {
|
|
128
|
+
label: "Disabled Deployment Node",
|
|
129
|
+
placeholder: "Disabled primitive map...",
|
|
130
|
+
disabled: true,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const ErrorState: Story = {
|
|
135
|
+
args: {
|
|
136
|
+
label: "Cluster Failure",
|
|
137
|
+
placeholder: "Failing component instance...",
|
|
138
|
+
defaultValue: "Invalid Execution Plan",
|
|
139
|
+
error:
|
|
140
|
+
"Critical runtime node disconnect detected traversing DOM architecture.",
|
|
141
|
+
required: true,
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const StaticReadOnly: Story = {
|
|
146
|
+
args: {
|
|
147
|
+
label: "Static ReadOnly Review",
|
|
148
|
+
placeholder: "Ignored...",
|
|
149
|
+
value: "Explicitly Uneditable Bound Output",
|
|
150
|
+
readOnly: true,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export const EditableReadOnly: Story = {
|
|
155
|
+
args: {
|
|
156
|
+
label: "Editable ReadOnly Review",
|
|
157
|
+
placeholder: "Ignored until active...",
|
|
158
|
+
defaultValue: "Waiting for Edit Execution",
|
|
159
|
+
readOnly: true,
|
|
160
|
+
labelWithEditIcon: true,
|
|
161
|
+
},
|
|
162
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future TextField component tests. Add tests here if/when needed.
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { InputBase, type InputBaseProps } from "@mui/material";
|
|
3
|
+
import { type ReadOnlyControlProps } from "@recursica/adapter-common";
|
|
4
|
+
import {
|
|
5
|
+
filterStylingProps,
|
|
6
|
+
omitUnsupportedProps,
|
|
7
|
+
mergeClassNames,
|
|
8
|
+
type RecursicaOverStyled,
|
|
9
|
+
} from "../../utils/filterStylingProps";
|
|
10
|
+
import { type RecursicaFormControlWrapperProps } from "../FormControlWrapper/FormControlWrapper";
|
|
11
|
+
import { WithReadOnlyWrapper } from "../ReadOnlyField/WithReadOnlyWrapper";
|
|
12
|
+
import styles from "./TextField.module.css";
|
|
13
|
+
|
|
14
|
+
import { type RecursicaTextFieldProps as BaseRecursicaTextFieldProps } from "@recursica/adapter-common";
|
|
15
|
+
|
|
16
|
+
export interface RecursicaTextFieldProps
|
|
17
|
+
extends Omit<
|
|
18
|
+
InputBaseProps,
|
|
19
|
+
| "color"
|
|
20
|
+
| "size"
|
|
21
|
+
| "startAdornment"
|
|
22
|
+
| "endAdornment"
|
|
23
|
+
| "autoComplete"
|
|
24
|
+
| "error"
|
|
25
|
+
>,
|
|
26
|
+
Omit<
|
|
27
|
+
React.ComponentPropsWithoutRef<"input">,
|
|
28
|
+
keyof InputBaseProps | "size" | "color" | "style" | "className" | "id"
|
|
29
|
+
>,
|
|
30
|
+
Pick<
|
|
31
|
+
RecursicaFormControlWrapperProps,
|
|
32
|
+
| "label"
|
|
33
|
+
| "error"
|
|
34
|
+
| "required"
|
|
35
|
+
| "id"
|
|
36
|
+
| "assistiveText"
|
|
37
|
+
| "assistiveWithIcon"
|
|
38
|
+
| "formLayout"
|
|
39
|
+
| "labelSize"
|
|
40
|
+
| "labelAlignment"
|
|
41
|
+
| "labelOptionalText"
|
|
42
|
+
| "labelWithEditIcon"
|
|
43
|
+
| "onLabelEditClick"
|
|
44
|
+
>,
|
|
45
|
+
ReadOnlyControlProps,
|
|
46
|
+
BaseRecursicaTextFieldProps {}
|
|
47
|
+
|
|
48
|
+
export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
|
|
49
|
+
|
|
50
|
+
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
51
|
+
function TextField(props, ref) {
|
|
52
|
+
const {
|
|
53
|
+
overStyled = false,
|
|
54
|
+
formLayout = "stacked",
|
|
55
|
+
|
|
56
|
+
// Label & Wrapper Maps
|
|
57
|
+
labelSize,
|
|
58
|
+
labelAlignment,
|
|
59
|
+
labelOptionalText,
|
|
60
|
+
labelWithEditIcon,
|
|
61
|
+
onLabelEditClick,
|
|
62
|
+
|
|
63
|
+
label,
|
|
64
|
+
assistiveText,
|
|
65
|
+
assistiveWithIcon,
|
|
66
|
+
error,
|
|
67
|
+
required,
|
|
68
|
+
id,
|
|
69
|
+
className,
|
|
70
|
+
style,
|
|
71
|
+
disabled,
|
|
72
|
+
readOnly,
|
|
73
|
+
readOnlyComponent,
|
|
74
|
+
emptyValueComponent,
|
|
75
|
+
value,
|
|
76
|
+
defaultValue,
|
|
77
|
+
leftSection,
|
|
78
|
+
rightSection,
|
|
79
|
+
...rest
|
|
80
|
+
} = props;
|
|
81
|
+
|
|
82
|
+
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
83
|
+
// through even if a caller forces them via plain JavaScript, bypassing the Omit<> above.
|
|
84
|
+
const UNSUPPORTED_PROPS = [
|
|
85
|
+
"size", // Recursica controls sizing via design tokens, not MUI's native small/medium size
|
|
86
|
+
"color", // Colors are token-driven; MUI's native palette isn't exposed
|
|
87
|
+
] as const satisfies readonly (keyof InputBaseProps)[];
|
|
88
|
+
|
|
89
|
+
const sanitizedProps = omitUnsupportedProps(
|
|
90
|
+
filterStylingProps(rest, overStyled),
|
|
91
|
+
UNSUPPORTED_PROPS,
|
|
92
|
+
);
|
|
93
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
94
|
+
|
|
95
|
+
// Securely map core native blocks down ensuring nested CSS modules map precisely. The
|
|
96
|
+
// caller-facing "root"/"input" slot names (MUI's own InputBase `classes` shape) are
|
|
97
|
+
// translated to this component's internal "wrapper"/"input" naming below.
|
|
98
|
+
const callerClasses = restRecord.classes as
|
|
99
|
+
| Partial<Record<string, string>>
|
|
100
|
+
| undefined;
|
|
101
|
+
const mergedClassNames = mergeClassNames(
|
|
102
|
+
{
|
|
103
|
+
wrapper: styles.root, // The nested Input internal relative wrapper bounding box
|
|
104
|
+
input: styles.input,
|
|
105
|
+
section: styles.section,
|
|
106
|
+
},
|
|
107
|
+
callerClasses && {
|
|
108
|
+
wrapper: callerClasses.root,
|
|
109
|
+
input: callerClasses.input,
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const wrapperClass = className
|
|
114
|
+
? `${styles.layoutOverride} ${className}`
|
|
115
|
+
: styles.layoutOverride;
|
|
116
|
+
|
|
117
|
+
const startAdornment = leftSection ? (
|
|
118
|
+
<div className={mergedClassNames.section} data-position="left">
|
|
119
|
+
{leftSection}
|
|
120
|
+
</div>
|
|
121
|
+
) : undefined;
|
|
122
|
+
|
|
123
|
+
const endAdornment = rightSection ? (
|
|
124
|
+
<div className={mergedClassNames.section} data-position="right">
|
|
125
|
+
{rightSection}
|
|
126
|
+
</div>
|
|
127
|
+
) : undefined;
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<WithReadOnlyWrapper
|
|
131
|
+
className={wrapperClass}
|
|
132
|
+
style={style as React.CSSProperties}
|
|
133
|
+
controlMaxWidth="var(--text-field-control-max-width)"
|
|
134
|
+
controlMinWidth="var(--text-field-control-min-width)"
|
|
135
|
+
overStyled={overStyled as true}
|
|
136
|
+
formLayout={formLayout}
|
|
137
|
+
labelSize={labelSize}
|
|
138
|
+
labelAlignment={labelAlignment}
|
|
139
|
+
labelOptionalText={labelOptionalText}
|
|
140
|
+
labelWithEditIcon={labelWithEditIcon}
|
|
141
|
+
onLabelEditClick={onLabelEditClick}
|
|
142
|
+
label={label}
|
|
143
|
+
assistiveText={assistiveText}
|
|
144
|
+
assistiveWithIcon={assistiveWithIcon}
|
|
145
|
+
error={error}
|
|
146
|
+
required={required}
|
|
147
|
+
id={id}
|
|
148
|
+
readOnly={readOnly}
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
150
|
+
readOnlyComponent={readOnlyComponent as any}
|
|
151
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
|
+
emptyValueComponent={(emptyValueComponent as any) || undefined}
|
|
153
|
+
readOnlyType="text"
|
|
154
|
+
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
155
|
+
readOnlyNativeProps={props}
|
|
156
|
+
activeComponent={
|
|
157
|
+
/* Naked Input execution safely decoupled from MUI's macro FormControl DOM hooks */
|
|
158
|
+
<InputBase
|
|
159
|
+
inputRef={ref} // MUI specific forward ref mapping
|
|
160
|
+
{...(sanitizedProps as unknown as InputBaseProps)}
|
|
161
|
+
classes={{
|
|
162
|
+
root: mergedClassNames.wrapper,
|
|
163
|
+
input: mergedClassNames.input,
|
|
164
|
+
}}
|
|
165
|
+
disabled={disabled}
|
|
166
|
+
value={value}
|
|
167
|
+
defaultValue={defaultValue}
|
|
168
|
+
startAdornment={startAdornment}
|
|
169
|
+
endAdornment={endAdornment}
|
|
170
|
+
// Bind native CSS selectors for errors / adornments explicitly to the root boundary
|
|
171
|
+
data-disabled={disabled ? "true" : undefined}
|
|
172
|
+
data-error={error ? "true" : undefined}
|
|
173
|
+
data-with-left-section={leftSection ? "true" : undefined}
|
|
174
|
+
data-with-right-section={rightSection ? "true" : undefined}
|
|
175
|
+
/>
|
|
176
|
+
}
|
|
177
|
+
/>
|
|
178
|
+
);
|
|
179
|
+
},
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
TextField.displayName = "TextField";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# TextField - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `TextField` component in your projects using `@recursica/adapter-mui-v7`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { TextField } from "@recursica/adapter-mui-v7";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { TextField } from "@recursica/adapter-mui-v7";
|
|
20
|
+
|
|
21
|
+
export default function Demo() {
|
|
22
|
+
return (
|
|
23
|
+
<TextField label="Username" placeholder="Enter your username" required />
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 3. Design System Integration
|
|
31
|
+
|
|
32
|
+
All Recursica components in the `@recursica/adapter-mui-v7` package adhere strictly to design system spacing, scaling, and behavior patterns.
|
|
33
|
+
|
|
34
|
+
> [!IMPORTANT]
|
|
35
|
+
>
|
|
36
|
+
> - **Anti-override protection**: Rogues style injections (like inline `style` or arbitrary `className`) are automatically blocked by our prop layer unless `overStyled={true}` is explicitly provided.
|
|
37
|
+
> - **No Direct Layers**: Do not pass a `layer` prop to this component. To place it on a specific visual layer, wrap it in a `<Layer layer={0|1|2|3}>` component natively.
|
|
38
|
+
> - **Variables and Theming**: Styling is entirely determined by local CSS variables defined in `recursica_variables_scoped.css` and mapped in the component's CSS module.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TextField";
|