@recursica/adapter-mantine-v8 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 +688 -0
- package/LICENSE +21 -0
- package/OVERSTYLING.md +56 -0
- package/README.md +70 -0
- package/SETUP.md +93 -0
- package/USAGE.md +57 -0
- package/dist/adapter-mantine-v8.cjs +12 -0
- package/dist/adapter-mantine-v8.cjs.map +1 -0
- package/dist/adapter-mantine-v8.css +1 -0
- package/dist/adapter-mantine-v8.js +5759 -0
- package/dist/adapter-mantine-v8.js.map +1 -0
- package/dist/index.d.ts +2095 -0
- package/dist/test.html +1 -0
- package/dist/vite.svg +1 -0
- package/docs/PHILOSOPHY.md +39 -0
- package/llms.txt +74 -0
- package/package.json +131 -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 +154 -0
- package/src/OverStyling.tsx +79 -0
- package/src/Version.tsx +44 -0
- package/src/components/Accordion/ACCORDION_IMPLEMENTATION_NOTES.md +72 -0
- package/src/components/Accordion/Accordion.module.css +367 -0
- package/src/components/Accordion/Accordion.stories.tsx +189 -0
- package/src/components/Accordion/Accordion.test.tsx +1 -0
- package/src/components/Accordion/Accordion.tsx +220 -0
- package/src/components/Accordion/USAGE.md +51 -0
- package/src/components/Accordion/index.ts +1 -0
- package/src/components/AssistiveElement/ASSISTIVEELEMENT_IMPLEMENTATION_NOTES.md +45 -0
- package/src/components/AssistiveElement/AssistiveElement.module.css +111 -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 +93 -0
- package/src/components/AssistiveElement/USAGE.md +36 -0
- package/src/components/AutoComplete/AUTOCOMPLETE_IMPLEMENTATION_NOTES.md +42 -0
- package/src/components/AutoComplete/AutoComplete.module.css +430 -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 +179 -0
- package/src/components/AutoComplete/USAGE.md +80 -0
- package/src/components/Avatar/AVATAR_IMPLEMENTATION_NOTES.md +34 -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 +108 -0
- package/src/components/Avatar/USAGE.md +38 -0
- package/src/components/Avatar/index.ts +1 -0
- package/src/components/Badge/BADGE_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Badge/Badge.module.css +127 -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 +64 -0
- package/src/components/Badge/USAGE.md +56 -0
- package/src/components/Breadcrumb/BREADCRUMB_IMPLEMENTATION_NOTES.md +47 -0
- package/src/components/Breadcrumb/Breadcrumb.module.css +48 -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 +85 -0
- package/src/components/Breadcrumb/USAGE.md +55 -0
- package/src/components/Breadcrumb/markCurrentPageItem.test.ts +49 -0
- package/src/components/Button/Button.module.css +446 -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 +184 -0
- package/src/components/Button/IMPLEMENTATION_NOTES.md +109 -0
- package/src/components/Button/USAGE.md +80 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Card/CARD_IMPLEMENTATION_NOTES.md +17 -0
- package/src/components/Card/Card.module.css +119 -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 +248 -0
- package/src/components/Card/USAGE.md +63 -0
- package/src/components/Checkbox/CHECKBOX_IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/Checkbox/Checkbox.module.css +267 -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 +151 -0
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +147 -0
- package/src/components/Checkbox/USAGE.md +48 -0
- package/src/components/Chip/CHIP_IMPLEMENTATION_NOTES.md +110 -0
- package/src/components/Chip/Chip.module.css +288 -0
- package/src/components/Chip/Chip.stories.tsx +128 -0
- package/src/components/Chip/Chip.test.tsx +1 -0
- package/src/components/Chip/Chip.tsx +157 -0
- package/src/components/Chip/USAGE.md +55 -0
- package/src/components/Container/CONTAINER_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Container/Container.module.css +7 -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 +69 -0
- package/src/components/Container/USAGE.md +47 -0
- package/src/components/DatePicker/DATEPICKER_IMPLEMENTATION_NOTES.md +31 -0
- package/src/components/DatePicker/DatePicker.icons.tsx +27 -0
- package/src/components/DatePicker/DatePicker.module.css +566 -0
- package/src/components/DatePicker/DatePicker.stories.tsx +158 -0
- package/src/components/DatePicker/DatePicker.test.tsx +1 -0
- package/src/components/DatePicker/DatePicker.tsx +218 -0
- package/src/components/DatePicker/USAGE.md +49 -0
- package/src/components/Dropdown/BareDropdown.tsx +97 -0
- package/src/components/Dropdown/DROPDOWN_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Dropdown/Dropdown.module.css +477 -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 +213 -0
- package/src/components/Dropdown/USAGE.md +69 -0
- package/src/components/FileInput/FILEINPUT_IMPLEMENTATION_NOTES.md +153 -0
- package/src/components/FileInput/FileInput.module.css +280 -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 +417 -0
- package/src/components/FileInput/USAGE.md +145 -0
- package/src/components/FileUpload/FILEUPLOAD_IMPLEMENTATION_NOTES.md +244 -0
- package/src/components/FileUpload/FileUpload.module.css +205 -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 +354 -0
- package/src/components/FileUpload/USAGE.md +199 -0
- package/src/components/Flex/FLEX_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Flex/Flex.module.css +7 -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 +75 -0
- package/src/components/Flex/USAGE.md +48 -0
- package/src/components/FormControlLayout/FormControlLayout.module.css +90 -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 +74 -0
- package/src/components/FormControlLayout/USAGE.md +40 -0
- package/src/components/FormControlWrapper/FORMCONTROLWRAPPER_IMPLEMENTATION_NOTES.md +32 -0
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +75 -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 +151 -0
- package/src/components/FormControlWrapper/USAGE.md +47 -0
- package/src/components/Grid/GRID_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Grid/Grid.module.css +11 -0
- package/src/components/Grid/Grid.stories.tsx +206 -0
- package/src/components/Grid/Grid.test.tsx +1 -0
- package/src/components/Grid/Grid.tsx +140 -0
- package/src/components/Grid/USAGE.md +47 -0
- package/src/components/Group/GROUP_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Group/Group.module.css +7 -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 +60 -0
- package/src/components/Group/USAGE.md +48 -0
- package/src/components/Heading/HEADING_IMPLEMENTATION_NOTES.md +18 -0
- package/src/components/Heading/Heading.module.css +13 -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 +52 -0
- package/src/components/Heading/USAGE.md +36 -0
- package/src/components/HoverCard/HOVERCARD_IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/HoverCard/HoverCard.module.css +90 -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 +133 -0
- package/src/components/HoverCard/USAGE.md +52 -0
- package/src/components/Label/LABEL_IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Label/Label.module.css +141 -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 +113 -0
- package/src/components/Label/USAGE.md +47 -0
- package/src/components/Label/index.ts +1 -0
- package/src/components/Layer/USAGE.md +54 -0
- package/src/components/Link/IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/Link/Link.module.css +110 -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 +67 -0
- package/src/components/Link/USAGE.md +56 -0
- package/src/components/Link/index.ts +1 -0
- package/src/components/Loader/LOADER_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/Loader/Loader.animate.dom.test.tsx +82 -0
- package/src/components/Loader/Loader.module.css +63 -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 +69 -0
- package/src/components/Loader/USAGE.md +44 -0
- package/src/components/Menu/MENU_IMPLEMENTATION_NOTES.md +88 -0
- package/src/components/Menu/Menu.module.css +280 -0
- package/src/components/Menu/Menu.stories.tsx +371 -0
- package/src/components/Menu/Menu.test.tsx +1 -0
- package/src/components/Menu/Menu.tsx +373 -0
- package/src/components/Menu/USAGE.md +55 -0
- package/src/components/Modal/MODAL_IMPLEMENTATION_NOTES.md +32 -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 +368 -0
- package/src/components/Modal/USAGE.md +58 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/NumberInput/NUMBER_INPUT_IMPLEMENTATION_NOTES.md +24 -0
- package/src/components/NumberInput/NumberInput.module.css +302 -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 +157 -0
- package/src/components/NumberInput/USAGE.md +52 -0
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +16 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +188 -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 +265 -0
- package/src/components/Pagination/USAGE.md +36 -0
- package/src/components/Pagination/index.ts +5 -0
- package/src/components/Panel/PANEL_IMPLEMENTATION_NOTES.md +116 -0
- package/src/components/Panel/Panel.module.css +209 -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 +269 -0
- package/src/components/Panel/USAGE.md +56 -0
- package/src/components/Popover/IMPLEMENTATION_NOTES.md +77 -0
- package/src/components/Popover/Popover.module.css +86 -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 +142 -0
- package/src/components/Popover/USAGE.md +61 -0
- package/src/components/Popover/index.ts +1 -0
- package/src/components/Radio/Radio.module.css +231 -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 +168 -0
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +124 -0
- package/src/components/Radio/USAGE.md +36 -0
- package/src/components/ReadOnlyField/READ_ONLY_FIELD_IMPLEMENTATION_NOTES.md +15 -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 +114 -0
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/USAGE.md +44 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +5 -0
- package/src/components/RecursicaThemeProvider/USAGE.md +60 -0
- package/src/components/SegmentedControl/IMPLEMENTATION_NOTES.md +25 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +185 -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 +110 -0
- package/src/components/SegmentedControl/USAGE.md +55 -0
- package/src/components/Slider/IMPLEMENTATION_NOTES.md +92 -0
- package/src/components/Slider/Slider.module.css +588 -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 +391 -0
- package/src/components/Slider/USAGE.md +56 -0
- package/src/components/Stack/STACK_IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stack/Stack.module.css +7 -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 +62 -0
- package/src/components/Stack/USAGE.md +48 -0
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +28 -0
- package/src/components/Stepper/Stepper.module.css +404 -0
- package/src/components/Stepper/Stepper.stories.tsx +148 -0
- package/src/components/Stepper/Stepper.test.tsx +1 -0
- package/src/components/Stepper/Stepper.tsx +93 -0
- package/src/components/Stepper/USAGE.md +41 -0
- package/src/components/Switch/SWITCH_IMPLEMENTATION_NOTES.md +64 -0
- package/src/components/Switch/Switch.module.css +279 -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 +177 -0
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +127 -0
- package/src/components/Switch/USAGE.md +42 -0
- package/src/components/Table/TABLE_IMPLEMENTATION_NOTES.md +78 -0
- package/src/components/Table/Table.icons.tsx +40 -0
- package/src/components/Table/Table.module.css +444 -0
- package/src/components/Table/Table.stories.tsx +140 -0
- package/src/components/Table/Table.test.tsx +1 -0
- package/src/components/Table/Table.tsx +243 -0
- package/src/components/Table/USAGE.md +78 -0
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +27 -0
- package/src/components/Tabs/Tabs.module.css +591 -0
- package/src/components/Tabs/Tabs.stories.tsx +154 -0
- package/src/components/Tabs/Tabs.test.tsx +1 -0
- package/src/components/Tabs/Tabs.tsx +114 -0
- package/src/components/Tabs/USAGE.md +45 -0
- package/src/components/Text/TEXT_IMPLEMENTATION_NOTES.md +12 -0
- package/src/components/Text/Text.module.css +13 -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 +53 -0
- package/src/components/Text/USAGE.md +40 -0
- package/src/components/TextArea/TEXTAREA_IMPLEMENTATION_NOTES.md +7 -0
- package/src/components/TextArea/TextArea.module.css +183 -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 +137 -0
- package/src/components/TextArea/USAGE.md +48 -0
- package/src/components/TextField/TEXTFIELD_IMPLEMENTATION_NOTES.md +19 -0
- package/src/components/TextField/TextField.module.css +264 -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 +139 -0
- package/src/components/TextField/USAGE.md +44 -0
- package/src/components/TimePicker/TIMEPICKER_IMPLEMENTATION_NOTES.md +119 -0
- package/src/components/TimePicker/TimePicker.module.css +291 -0
- package/src/components/TimePicker/TimePicker.stories.tsx +141 -0
- package/src/components/TimePicker/TimePicker.test.tsx +1 -0
- package/src/components/TimePicker/TimePicker.tsx +304 -0
- package/src/components/TimePicker/USAGE.md +57 -0
- package/src/components/Timeline/TIMELINE_IMPLEMENTATION_NOTES.md +13 -0
- package/src/components/Timeline/Timeline.module.css +373 -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 +73 -0
- package/src/components/Timeline/TimelineItem.tsx +79 -0
- package/src/components/Timeline/USAGE.md +49 -0
- package/src/components/Toast/TOAST_IMPLEMENTATION_NOTES.md +39 -0
- package/src/components/Toast/Toast.module.css +184 -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 +82 -0
- package/src/components/Toast/USAGE.md +50 -0
- package/src/components/Toast/index.ts +1 -0
- package/src/components/Tooltip/TOOLTIP_IMPLEMENTATION_NOTES.md +85 -0
- package/src/components/Tooltip/Tooltip.module.css +91 -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 +117 -0
- package/src/components/Tooltip/USAGE.md +80 -0
- package/src/components/TransferList/TRANSFERLIST_IMPLEMENTATION_NOTES.md +111 -0
- package/src/components/TransferList/TransferList.module.css +182 -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/Tree/IMPLEMENTATION_NOTES.md +48 -0
- package/src/components/Tree/Tree.module.css +232 -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 +220 -0
- package/src/components/Tree/USAGE.md +96 -0
- package/src/components/Tree/index.ts +1 -0
- package/src/components/index.ts +52 -0
- package/src/env.d.ts +7 -0
- package/src/index.ts +179 -0
- package/src/types/index.ts +9 -0
- package/src/types/mantine.d.ts +7 -0
- package/src/types/scss-modules.d.ts +9 -0
- package/src/utils/ColorSchemeWrapper.tsx +27 -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 +150 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/renderRichOption.tsx +65 -0
|
@@ -0,0 +1,264 @@
|
|
|
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
|
+
/* EXEMPTIONS:
|
|
44
|
+
- border-size is constant across disabled/error states — only border-color changes; the
|
|
45
|
+
disabled/error border-size tokens are never applied by design. */
|
|
46
|
+
/* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_disabled_properties_border-size */
|
|
47
|
+
/* recursica-ignore: --recursica_ui-kit_components_text-field_variants_states_error_properties_border-size */
|
|
48
|
+
|
|
49
|
+
.root {
|
|
50
|
+
display: flex;
|
|
51
|
+
position: relative;
|
|
52
|
+
width: 100%;
|
|
53
|
+
min-height: var(
|
|
54
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
/* Override Mantine native Input variables governing section spacing padding mathematics safely */
|
|
58
|
+
--input-left-section-size: calc(
|
|
59
|
+
var(
|
|
60
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
61
|
+
) +
|
|
62
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
63
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
|
|
64
|
+
);
|
|
65
|
+
--input-right-section-size: calc(
|
|
66
|
+
var(
|
|
67
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
68
|
+
) +
|
|
69
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-size) +
|
|
70
|
+
var(--recursica_ui-kit_components_text-field_properties_icon-text-gap)
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.input {
|
|
75
|
+
/* Structural Overrides */
|
|
76
|
+
width: 100%;
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
margin: 0;
|
|
79
|
+
|
|
80
|
+
/* Box Geometry */
|
|
81
|
+
min-height: var(
|
|
82
|
+
--recursica_ui-kit_components_text-field_properties_min-height
|
|
83
|
+
);
|
|
84
|
+
padding-top: var(
|
|
85
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
86
|
+
);
|
|
87
|
+
padding-bottom: var(
|
|
88
|
+
--recursica_ui-kit_components_text-field_properties_vertical-padding
|
|
89
|
+
);
|
|
90
|
+
padding-left: var(
|
|
91
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
92
|
+
);
|
|
93
|
+
padding-right: var(
|
|
94
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
95
|
+
);
|
|
96
|
+
border-radius: var(
|
|
97
|
+
--recursica_ui-kit_components_text-field_properties_border-radius
|
|
98
|
+
);
|
|
99
|
+
border-width: var(
|
|
100
|
+
--recursica_ui-kit_components_text-field_properties_border-size
|
|
101
|
+
);
|
|
102
|
+
border-style: solid;
|
|
103
|
+
|
|
104
|
+
/* Strict Typography Unification */
|
|
105
|
+
font-family: var(
|
|
106
|
+
--recursica_ui-kit_components_text-field_properties_text_font-family
|
|
107
|
+
);
|
|
108
|
+
font-size: var(
|
|
109
|
+
--recursica_ui-kit_components_text-field_properties_text_font-size
|
|
110
|
+
);
|
|
111
|
+
font-style: var(
|
|
112
|
+
--recursica_ui-kit_components_text-field_properties_text_font-style
|
|
113
|
+
);
|
|
114
|
+
font-weight: var(
|
|
115
|
+
--recursica_ui-kit_components_text-field_properties_text_font-weight
|
|
116
|
+
);
|
|
117
|
+
letter-spacing: var(
|
|
118
|
+
--recursica_ui-kit_components_text-field_properties_text_letter-spacing
|
|
119
|
+
);
|
|
120
|
+
line-height: var(
|
|
121
|
+
--recursica_ui-kit_components_text-field_properties_text_line-height
|
|
122
|
+
);
|
|
123
|
+
text-decoration: var(
|
|
124
|
+
--recursica_ui-kit_components_text-field_properties_text_text-decoration
|
|
125
|
+
);
|
|
126
|
+
text-transform: var(
|
|
127
|
+
--recursica_ui-kit_components_text-field_properties_text_text-transform
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
/* Base State Default Execution */
|
|
131
|
+
background-color: var(
|
|
132
|
+
--recursica_ui-kit_components_text-field_properties_colors_background-color
|
|
133
|
+
);
|
|
134
|
+
border-color: var(
|
|
135
|
+
--recursica_ui-kit_components_text-field_properties_colors_border-color
|
|
136
|
+
);
|
|
137
|
+
color: var(
|
|
138
|
+
--recursica_ui-kit_components_text-field_properties_colors_text-color
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
outline: none;
|
|
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] .input {
|
|
153
|
+
padding-left: var(--input-left-section-size);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.root[data-with-right-section] .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
|
+
}
|
|
166
|
+
|
|
167
|
+
.section[data-position="left"] {
|
|
168
|
+
justify-content: flex-start;
|
|
169
|
+
padding-left: var(
|
|
170
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.section[data-position="right"] {
|
|
175
|
+
justify-content: flex-end;
|
|
176
|
+
padding-right: var(
|
|
177
|
+
--recursica_ui-kit_components_text-field_properties_horizontal-padding
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.section :global(svg) {
|
|
182
|
+
width: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
183
|
+
height: var(--recursica_ui-kit_components_text-field_properties_icon-size);
|
|
184
|
+
color: var(
|
|
185
|
+
--recursica_ui-kit_components_text-field_properties_colors_leading-icon
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.section[data-position="right"] :global(svg) {
|
|
190
|
+
color: var(
|
|
191
|
+
--recursica_ui-kit_components_text-field_properties_colors_trailing-icon
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* -------------------------------------
|
|
196
|
+
STATE CASCADE ARCHITECTURE
|
|
197
|
+
-------------------------------------- */
|
|
198
|
+
|
|
199
|
+
/* Focus State Mapping (Triggered internally via browser pseudo-pseudo-class) */
|
|
200
|
+
/* The token schema no longer provides per-component focus colors; apply the generic focus ring
|
|
201
|
+
tokens as a box-shadow ring instead of a color swap. */
|
|
202
|
+
.input:focus-within,
|
|
203
|
+
.input:focus {
|
|
204
|
+
box-shadow:
|
|
205
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
206
|
+
var(--recursica_brand_states_focus_color),
|
|
207
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
208
|
+
var(--recursica_brand_states_focus_margin)
|
|
209
|
+
var(--recursica_brand_states_focus_color);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* Error State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
213
|
+
.root[data-error] .input {
|
|
214
|
+
border-color: var(
|
|
215
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_border-color
|
|
216
|
+
) !important;
|
|
217
|
+
background-color: var(
|
|
218
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_background-color
|
|
219
|
+
) !important;
|
|
220
|
+
color: var(
|
|
221
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_text-color
|
|
222
|
+
) !important;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.root[data-error] .section[data-position="left"] :global(svg) {
|
|
226
|
+
color: var(
|
|
227
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_leading-icon
|
|
228
|
+
) !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.root[data-error] .section[data-position="right"] :global(svg) {
|
|
232
|
+
color: var(
|
|
233
|
+
--recursica_ui-kit_components_text-field_variants_states_error_properties_colors_trailing-icon
|
|
234
|
+
) !important;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/* Disabled State Mapping (Propagated strictly down from the wrapper DOM context) */
|
|
238
|
+
.root[data-disabled] .input {
|
|
239
|
+
border-color: var(
|
|
240
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_border-color
|
|
241
|
+
) !important;
|
|
242
|
+
background-color: var(
|
|
243
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_background-color
|
|
244
|
+
) !important;
|
|
245
|
+
color: var(
|
|
246
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_text-color
|
|
247
|
+
) !important;
|
|
248
|
+
opacity: var(
|
|
249
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_opacity
|
|
250
|
+
) !important;
|
|
251
|
+
cursor: not-allowed;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.root[data-disabled] .section[data-position="left"] :global(svg) {
|
|
255
|
+
color: var(
|
|
256
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_leading-icon
|
|
257
|
+
) !important;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.root[data-disabled] .section[data-position="right"] :global(svg) {
|
|
261
|
+
color: var(
|
|
262
|
+
--recursica_ui-kit_components_text-field_variants_states_disabled_properties_colors_trailing-icon
|
|
263
|
+
) !important;
|
|
264
|
+
}
|
|
@@ -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,139 @@
|
|
|
1
|
+
import React, { forwardRef } from "react";
|
|
2
|
+
import { Input, type InputProps, type InputWrapperProps } from "@mantine/core";
|
|
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<InputProps, "size" | "variant" | "radius" | "wrapperProps">,
|
|
18
|
+
Pick<
|
|
19
|
+
InputWrapperProps,
|
|
20
|
+
"label" | "error" | "required" | "withAsterisk" | "id"
|
|
21
|
+
>,
|
|
22
|
+
Omit<
|
|
23
|
+
React.ComponentPropsWithoutRef<"input">,
|
|
24
|
+
"size" | "style" | "className" | "id"
|
|
25
|
+
>,
|
|
26
|
+
Omit<
|
|
27
|
+
RecursicaFormControlWrapperProps,
|
|
28
|
+
"controlMaxWidth" | "controlMinWidth"
|
|
29
|
+
>,
|
|
30
|
+
ReadOnlyControlProps,
|
|
31
|
+
BaseRecursicaTextFieldProps {}
|
|
32
|
+
|
|
33
|
+
export type TextFieldProps = RecursicaOverStyled<RecursicaTextFieldProps>;
|
|
34
|
+
|
|
35
|
+
// Props this component intentionally doesn't support — deleted at runtime so they can't leak
|
|
36
|
+
// through even if a caller forces them via plain JavaScript, bypassing the `Omit<>` above.
|
|
37
|
+
const UNSUPPORTED_PROPS = [
|
|
38
|
+
"size", // Recursica controls sizing via the `size` variant + design tokens, not raw dimensions.
|
|
39
|
+
"variant", // Colors/variants are token-driven; the library's native palette isn't exposed.
|
|
40
|
+
"radius", // Recursica does not expose the library's native corner-radius system.
|
|
41
|
+
] as const satisfies readonly (keyof InputProps)[];
|
|
42
|
+
|
|
43
|
+
export const TextField = forwardRef<HTMLInputElement, TextFieldProps>(
|
|
44
|
+
function TextField(props, ref) {
|
|
45
|
+
const {
|
|
46
|
+
overStyled = false,
|
|
47
|
+
formLayout = "stacked",
|
|
48
|
+
|
|
49
|
+
// Label & Wrapper Maps
|
|
50
|
+
labelSize,
|
|
51
|
+
labelAlignment,
|
|
52
|
+
labelOptionalText,
|
|
53
|
+
labelWithEditIcon,
|
|
54
|
+
onLabelEditClick,
|
|
55
|
+
|
|
56
|
+
label,
|
|
57
|
+
assistiveText,
|
|
58
|
+
assistiveWithIcon,
|
|
59
|
+
error,
|
|
60
|
+
required,
|
|
61
|
+
withAsterisk,
|
|
62
|
+
id,
|
|
63
|
+
className,
|
|
64
|
+
style,
|
|
65
|
+
disabled,
|
|
66
|
+
readOnly,
|
|
67
|
+
readOnlyComponent,
|
|
68
|
+
emptyValueComponent,
|
|
69
|
+
value,
|
|
70
|
+
defaultValue,
|
|
71
|
+
...rest
|
|
72
|
+
} = props;
|
|
73
|
+
const sanitizedProps = omitUnsupportedProps(
|
|
74
|
+
filterStylingProps(rest, overStyled) as Record<string, unknown>,
|
|
75
|
+
UNSUPPORTED_PROPS,
|
|
76
|
+
);
|
|
77
|
+
const restRecord = sanitizedProps as Record<string, unknown>;
|
|
78
|
+
|
|
79
|
+
// Securely map core native blocks down ensuring nested CSS modules map precisely
|
|
80
|
+
const mergedClassNames = mergeClassNames(
|
|
81
|
+
{
|
|
82
|
+
wrapper: styles.root, // The nested Input internal relative wrapper bounding box
|
|
83
|
+
input: styles.input,
|
|
84
|
+
section: styles.section,
|
|
85
|
+
},
|
|
86
|
+
restRecord.classNames as Partial<Record<string, string>> | undefined,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
const wrapperClass = className
|
|
90
|
+
? `${styles.layoutOverride} ${className}`
|
|
91
|
+
: styles.layoutOverride;
|
|
92
|
+
|
|
93
|
+
return (
|
|
94
|
+
<WithReadOnlyWrapper
|
|
95
|
+
className={wrapperClass}
|
|
96
|
+
style={style as React.CSSProperties}
|
|
97
|
+
controlMaxWidth="var(--text-field-control-max-width)"
|
|
98
|
+
controlMinWidth="var(--text-field-control-min-width)"
|
|
99
|
+
overStyled={overStyled as true}
|
|
100
|
+
formLayout={formLayout}
|
|
101
|
+
labelSize={labelSize}
|
|
102
|
+
labelAlignment={labelAlignment}
|
|
103
|
+
labelOptionalText={labelOptionalText}
|
|
104
|
+
labelWithEditIcon={labelWithEditIcon}
|
|
105
|
+
onLabelEditClick={onLabelEditClick}
|
|
106
|
+
label={label}
|
|
107
|
+
assistiveText={assistiveText}
|
|
108
|
+
assistiveWithIcon={assistiveWithIcon}
|
|
109
|
+
error={error}
|
|
110
|
+
required={required}
|
|
111
|
+
withAsterisk={withAsterisk}
|
|
112
|
+
id={id}
|
|
113
|
+
readOnly={readOnly}
|
|
114
|
+
readOnlyComponent={readOnlyComponent}
|
|
115
|
+
emptyValueComponent={emptyValueComponent}
|
|
116
|
+
readOnlyType="text"
|
|
117
|
+
readOnlyValue={value !== undefined ? value : defaultValue}
|
|
118
|
+
readOnlyNativeProps={props}
|
|
119
|
+
activeComponent={
|
|
120
|
+
/* Naked Input execution safely decoupled from Mantine's macro Input.Wrapper DOM hooks */
|
|
121
|
+
<Input
|
|
122
|
+
ref={ref}
|
|
123
|
+
{...(sanitizedProps as unknown as InputProps)}
|
|
124
|
+
classNames={mergedClassNames}
|
|
125
|
+
disabled={disabled}
|
|
126
|
+
value={value}
|
|
127
|
+
defaultValue={defaultValue}
|
|
128
|
+
wrapperProps={{
|
|
129
|
+
"data-disabled": disabled ? "true" : undefined,
|
|
130
|
+
"data-error": error ? "true" : undefined,
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
}
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
},
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
TextField.displayName = "TextField";
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# TextField - Usage Guide
|
|
2
|
+
|
|
3
|
+
This document describes how to integrate and use the `TextField` component in your projects using `@recursica/adapter-mantine-v8`.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Import Reference
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { TextField } from "@recursica/adapter-mantine-v8";
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Basic Example
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
import { TextField } from "@recursica/adapter-mantine-v8";
|
|
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-mantine-v8` 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.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 4. Key Integration Features & Constraints
|
|
43
|
+
|
|
44
|
+
The label, assistive text, and error state are rendered via the surrounding form label rather than Mantine's built-in label, so there is a single, consistently positioned label and asterisk for the field.
|