@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,367 @@
|
|
|
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_disabled
|
|
4
|
+
* recursica-allow-brand: --recursica_brand_states_focus_blur
|
|
5
|
+
* recursica-allow-brand: --recursica_brand_states_focus_border-size
|
|
6
|
+
* recursica-allow-brand: --recursica_brand_states_focus_color
|
|
7
|
+
* recursica-allow-brand: --recursica_brand_states_focus_margin
|
|
8
|
+
* recursica-allow-brand: --recursica_brand_states_hover_color
|
|
9
|
+
* recursica-allow-brand: --recursica_brand_states_hover_opacity
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* ==== ACCORDION CONTAINER ==== */
|
|
13
|
+
.root {
|
|
14
|
+
box-sizing: border-box;
|
|
15
|
+
margin: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
|
|
19
|
+
border-style: solid;
|
|
20
|
+
border-width: var(
|
|
21
|
+
--recursica_ui-kit_components_accordion_properties_border-size
|
|
22
|
+
);
|
|
23
|
+
border-radius: var(
|
|
24
|
+
--recursica_ui-kit_components_accordion_properties_border-radius
|
|
25
|
+
);
|
|
26
|
+
border-color: var(
|
|
27
|
+
--recursica_ui-kit_components_accordion_properties_colors_border-color
|
|
28
|
+
);
|
|
29
|
+
background-color: var(
|
|
30
|
+
--recursica_ui-kit_components_accordion_properties_colors_background-color
|
|
31
|
+
);
|
|
32
|
+
box-shadow: var(--recursica_ui-kit_components_accordion_properties_elevation);
|
|
33
|
+
|
|
34
|
+
max-width: var(--recursica_ui-kit_components_accordion_properties_max-width);
|
|
35
|
+
min-width: var(--recursica_ui-kit_components_accordion_properties_min-width);
|
|
36
|
+
padding: var(--recursica_ui-kit_components_accordion_properties_padding);
|
|
37
|
+
|
|
38
|
+
/* Ensure gaps between items */
|
|
39
|
+
gap: var(--recursica_ui-kit_components_accordion_properties_item-gap);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* ==== ACCORDION ITEM ==== */
|
|
43
|
+
.item {
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
margin: var(--recursica_ui-kit_components_accordion-item_properties_margin);
|
|
46
|
+
padding: var(--recursica_ui-kit_components_accordion-item_properties_padding);
|
|
47
|
+
position: relative;
|
|
48
|
+
transition: all 0.2s ease;
|
|
49
|
+
|
|
50
|
+
/* Overriding Mantine Default Borders natively */
|
|
51
|
+
border-bottom: none;
|
|
52
|
+
|
|
53
|
+
border-style: solid;
|
|
54
|
+
border-color: var(
|
|
55
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_border-color
|
|
56
|
+
);
|
|
57
|
+
border-width: var(
|
|
58
|
+
--recursica_ui-kit_components_accordion-item_properties_border-size
|
|
59
|
+
);
|
|
60
|
+
border-bottom-color: var(
|
|
61
|
+
--recursica_ui-kit_components_accordion_properties_colors_divider-color
|
|
62
|
+
);
|
|
63
|
+
border-bottom-width: var(
|
|
64
|
+
--recursica_ui-kit_components_accordion_properties_divider-size
|
|
65
|
+
);
|
|
66
|
+
border-radius: var(
|
|
67
|
+
--recursica_ui-kit_components_accordion-item_properties_border-radius
|
|
68
|
+
);
|
|
69
|
+
box-shadow: var(
|
|
70
|
+
--recursica_ui-kit_components_accordion-item_properties_elevation
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
/* The collapsed/expanded background now lives on accordion-header (open/closed appearance),
|
|
74
|
+
applied via .control below, rather than on the item wrapper itself. */
|
|
75
|
+
.noDivider {
|
|
76
|
+
border-bottom: none !important;
|
|
77
|
+
border-bottom-width: 0 !important;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* ==== ACCORDION CONTROL (HEADER) ==== */
|
|
81
|
+
.control {
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
width: 100%;
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
|
|
88
|
+
/* Re-apply gap defined by UI Kit for icons vs text */
|
|
89
|
+
gap: var(--recursica_ui-kit_components_accordion-header_properties_icon-gap);
|
|
90
|
+
|
|
91
|
+
/* Strip Mantine's baked padding directly */
|
|
92
|
+
padding: var(
|
|
93
|
+
--recursica_ui-kit_components_accordion-header_properties_vertical-padding
|
|
94
|
+
)
|
|
95
|
+
var(
|
|
96
|
+
--recursica_ui-kit_components_accordion-header_properties_horizontal-padding
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
/* Closed (resting) background/border — swapped to the open appearance below when expanded */
|
|
100
|
+
background-color: var(
|
|
101
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_background-color
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
border-style: solid;
|
|
105
|
+
border-width: var(
|
|
106
|
+
--recursica_ui-kit_components_accordion-header_properties_border-size
|
|
107
|
+
);
|
|
108
|
+
border-radius: var(
|
|
109
|
+
--recursica_ui-kit_components_accordion-header_properties_border-radius
|
|
110
|
+
);
|
|
111
|
+
border-color: var(
|
|
112
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_border-color
|
|
113
|
+
);
|
|
114
|
+
box-shadow: var(
|
|
115
|
+
--recursica_ui-kit_components_accordion-header_properties_elevation
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
transition: background-color 0.15s ease;
|
|
119
|
+
position: relative;
|
|
120
|
+
z-index: 1;
|
|
121
|
+
color: var(
|
|
122
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_text-color
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
/* Header Typography */
|
|
126
|
+
font-family: var(
|
|
127
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-family
|
|
128
|
+
);
|
|
129
|
+
font-size: var(
|
|
130
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-size
|
|
131
|
+
);
|
|
132
|
+
font-weight: var(
|
|
133
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-weight
|
|
134
|
+
);
|
|
135
|
+
font-style: var(
|
|
136
|
+
--recursica_ui-kit_components_accordion-header_properties_text_font-style
|
|
137
|
+
);
|
|
138
|
+
letter-spacing: var(
|
|
139
|
+
--recursica_ui-kit_components_accordion-header_properties_text_letter-spacing
|
|
140
|
+
);
|
|
141
|
+
line-height: var(
|
|
142
|
+
--recursica_ui-kit_components_accordion-header_properties_text_line-height
|
|
143
|
+
);
|
|
144
|
+
text-decoration: var(
|
|
145
|
+
--recursica_ui-kit_components_accordion-header_properties_text_text-decoration
|
|
146
|
+
);
|
|
147
|
+
text-transform: var(
|
|
148
|
+
--recursica_ui-kit_components_accordion-header_properties_text_text-transform
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.item[data-active] .control {
|
|
153
|
+
background-color: var(
|
|
154
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_background-color
|
|
155
|
+
);
|
|
156
|
+
border-color: var(
|
|
157
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_border-color
|
|
158
|
+
);
|
|
159
|
+
color: var(
|
|
160
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_text-color
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/* Mantine natively places hover states on the control node. We explicitly re-apply our own real
|
|
165
|
+
background (Mantine's native :hover CSS would otherwise show through) — closed or open,
|
|
166
|
+
matching whichever appearance is currently active — and use an overlay ::after structure with
|
|
167
|
+
the generic hover tokens for the actual hover tint; no per-item hover-color/hover-opacity
|
|
168
|
+
tokens exist anymore. */
|
|
169
|
+
.control:hover:not(:disabled) {
|
|
170
|
+
background-color: var(
|
|
171
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_background-color
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
.item[data-active] .control:hover:not(:disabled) {
|
|
175
|
+
background-color: var(
|
|
176
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_background-color
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
.control::after {
|
|
180
|
+
content: "";
|
|
181
|
+
position: absolute;
|
|
182
|
+
inset: 0;
|
|
183
|
+
border-radius: inherit;
|
|
184
|
+
z-index: -1;
|
|
185
|
+
pointer-events: none;
|
|
186
|
+
background-color: var(--recursica_brand_states_hover_color);
|
|
187
|
+
opacity: 0;
|
|
188
|
+
transition: opacity 150ms ease;
|
|
189
|
+
}
|
|
190
|
+
.control:hover:not(:disabled)::after {
|
|
191
|
+
opacity: var(--recursica_brand_states_hover_opacity);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Dims the whole item — control and any currently-visible panel content alike — using the
|
|
195
|
+
generic disabled opacity token, same convention as every other disabled component in the
|
|
196
|
+
design system (no accordion-item-specific disabled token exists). The Control's own native
|
|
197
|
+
`disabled` attribute already blocks click/keyboard interaction on its own; this only
|
|
198
|
+
handles the visual dim. */
|
|
199
|
+
.item[data-disabled] {
|
|
200
|
+
opacity: var(--recursica_brand_states_disabled);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* Recursica focus ring instead of Mantine's default `.mantine-focus-auto:focus-visible` outline
|
|
204
|
+
(same class+pseudo-class specificity, so !important guarantees ours wins regardless of CSS
|
|
205
|
+
import order). */
|
|
206
|
+
.control:focus-visible {
|
|
207
|
+
outline: none !important;
|
|
208
|
+
box-shadow:
|
|
209
|
+
0 0 0 var(--recursica_brand_states_focus_border-size)
|
|
210
|
+
var(--recursica_brand_states_focus_color),
|
|
211
|
+
0 0 var(--recursica_brand_states_focus_blur)
|
|
212
|
+
var(--recursica_brand_states_focus_margin)
|
|
213
|
+
var(--recursica_brand_states_focus_color) !important;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/* Label logic inside the Control wrapper */
|
|
217
|
+
.label {
|
|
218
|
+
flex: 1;
|
|
219
|
+
min-width: 0; /* HARDCODE: required for text-overflow ellipsis to take effect on a flex child */
|
|
220
|
+
text-align: left;
|
|
221
|
+
color: inherit;
|
|
222
|
+
padding: 0; /* Clear Mantine inner padding */
|
|
223
|
+
overflow: clip; /* HARDCODE: `hidden` clipped descenders (e.g. "g") whenever the text_line-height
|
|
224
|
+
token is tighter than the font's natural ascent+descent; `overflow-clip-margin` gives ink a
|
|
225
|
+
small bleed allowance while still clipping genuinely overflowing text — same fix project-wide,
|
|
226
|
+
see Chip/FileInput's IMPLEMENTATION_NOTES.md for the original discovery. */
|
|
227
|
+
overflow-clip-margin: 0.35em;
|
|
228
|
+
white-space: nowrap;
|
|
229
|
+
text-overflow: ellipsis;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* ==== ICON SLOT (Mantine's leading-icon wrapper) ==== */
|
|
233
|
+
.icon {
|
|
234
|
+
/* HARDCODE: Mantine applies its own margin-inline-start/end around this slot; our own
|
|
235
|
+
icon-gap token (applied as flex `gap` on .control) already provides the spacing. */
|
|
236
|
+
margin-inline-start: 0;
|
|
237
|
+
margin-inline-end: 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* ==== CHEVRON / RIGHT ICON ==== */
|
|
241
|
+
.chevron {
|
|
242
|
+
flex-shrink: 0;
|
|
243
|
+
width: var(
|
|
244
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-right-size
|
|
245
|
+
);
|
|
246
|
+
height: var(
|
|
247
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-right-size
|
|
248
|
+
);
|
|
249
|
+
color: var(
|
|
250
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_icon-color
|
|
251
|
+
);
|
|
252
|
+
margin: 0;
|
|
253
|
+
transition: transform 200ms ease;
|
|
254
|
+
display: flex;
|
|
255
|
+
align-items: center;
|
|
256
|
+
justify-content: center;
|
|
257
|
+
}
|
|
258
|
+
.chevron > * {
|
|
259
|
+
width: 100%;
|
|
260
|
+
height: 100%;
|
|
261
|
+
object-fit: contain;
|
|
262
|
+
}
|
|
263
|
+
.item[data-active] .chevron {
|
|
264
|
+
transform: rotate(180deg);
|
|
265
|
+
color: var(
|
|
266
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_icon-color
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* ==== LEFT ICON / CUSTOM ICONS ==== */
|
|
271
|
+
.iconLeftWrapper {
|
|
272
|
+
flex-shrink: 0;
|
|
273
|
+
display: flex;
|
|
274
|
+
align-items: center;
|
|
275
|
+
justify-content: center;
|
|
276
|
+
width: var(
|
|
277
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-left-size
|
|
278
|
+
);
|
|
279
|
+
height: var(
|
|
280
|
+
--recursica_ui-kit_components_accordion-header_properties_icon-left-size
|
|
281
|
+
);
|
|
282
|
+
color: var(
|
|
283
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_closed_properties_colors_icon-color
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
.item[data-active] .iconLeftWrapper {
|
|
287
|
+
color: var(
|
|
288
|
+
--recursica_ui-kit_components_accordion-header_variants_appearance_open_properties_colors_icon-color
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
.iconLeftWrapper > * {
|
|
292
|
+
width: 100%;
|
|
293
|
+
height: 100%;
|
|
294
|
+
object-fit: contain;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/* ==== ACCORDION PANEL (CONTENT) ==== */
|
|
298
|
+
.panel {
|
|
299
|
+
box-sizing: border-box;
|
|
300
|
+
margin: var(
|
|
301
|
+
--recursica_ui-kit_components_accordion-content_properties_margin
|
|
302
|
+
);
|
|
303
|
+
padding: 0; /* Overriding dynamic layout structure */
|
|
304
|
+
background-color: var(
|
|
305
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_background-color
|
|
306
|
+
);
|
|
307
|
+
border-style: solid;
|
|
308
|
+
border-color: var(
|
|
309
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_border-color
|
|
310
|
+
);
|
|
311
|
+
border-width: var(
|
|
312
|
+
--recursica_ui-kit_components_accordion-content_properties_border-size
|
|
313
|
+
);
|
|
314
|
+
border-radius: var(
|
|
315
|
+
--recursica_ui-kit_components_accordion-content_properties_border-radius
|
|
316
|
+
);
|
|
317
|
+
box-shadow: var(
|
|
318
|
+
--recursica_ui-kit_components_accordion-content_properties_elevation
|
|
319
|
+
);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.content {
|
|
323
|
+
box-sizing: border-box;
|
|
324
|
+
/* Strip Mantine padding and apply logic directly mapped */
|
|
325
|
+
padding: 0
|
|
326
|
+
var(
|
|
327
|
+
--recursica_ui-kit_components_accordion-content_properties_horizontal-padding
|
|
328
|
+
)
|
|
329
|
+
var(
|
|
330
|
+
--recursica_ui-kit_components_accordion-content_properties_bottom-padding
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
/* Apply offset gap explicitly calculated below header */
|
|
334
|
+
padding-top: var(
|
|
335
|
+
--recursica_ui-kit_components_accordion-content_properties_top-padding
|
|
336
|
+
);
|
|
337
|
+
|
|
338
|
+
color: var(
|
|
339
|
+
--recursica_ui-kit_components_accordion-content_properties_colors_text-color
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
/* Content Typography */
|
|
343
|
+
font-family: var(
|
|
344
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-family
|
|
345
|
+
);
|
|
346
|
+
font-size: var(
|
|
347
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-size
|
|
348
|
+
);
|
|
349
|
+
font-weight: var(
|
|
350
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-weight
|
|
351
|
+
);
|
|
352
|
+
font-style: var(
|
|
353
|
+
--recursica_ui-kit_components_accordion-content_properties_text_font-style
|
|
354
|
+
);
|
|
355
|
+
letter-spacing: var(
|
|
356
|
+
--recursica_ui-kit_components_accordion-content_properties_text_letter-spacing
|
|
357
|
+
);
|
|
358
|
+
line-height: var(
|
|
359
|
+
--recursica_ui-kit_components_accordion-content_properties_text_line-height
|
|
360
|
+
);
|
|
361
|
+
text-decoration: var(
|
|
362
|
+
--recursica_ui-kit_components_accordion-content_properties_text_text-decoration
|
|
363
|
+
);
|
|
364
|
+
text-transform: var(
|
|
365
|
+
--recursica_ui-kit_components_accordion-content_properties_text_text-transform
|
|
366
|
+
);
|
|
367
|
+
}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Accordion } from "./Accordion";
|
|
3
|
+
|
|
4
|
+
const SVGIcon = () => (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="24"
|
|
8
|
+
height="24"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
strokeWidth="2"
|
|
13
|
+
strokeLinecap="round"
|
|
14
|
+
strokeLinejoin="round"
|
|
15
|
+
>
|
|
16
|
+
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const ChevronIcon = () => (
|
|
21
|
+
<svg
|
|
22
|
+
width="24"
|
|
23
|
+
height="24"
|
|
24
|
+
viewBox="0 0 24 24"
|
|
25
|
+
fill="none"
|
|
26
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
27
|
+
>
|
|
28
|
+
<path
|
|
29
|
+
d="M20.0306 9.53062L12.5306 17.0306C12.461 17.1003 12.3783 17.1557 12.2872 17.1934C12.1962 17.2312 12.0986 17.2506 12 17.2506C11.9014 17.2506 11.8038 17.2312 11.7128 17.1934C11.6218 17.1557 11.539 17.1003 11.4694 17.0306L3.96938 9.53062C3.82865 9.38988 3.74959 9.19901 3.74959 8.99999C3.74959 8.80097 3.82865 8.61009 3.96938 8.46936C4.11011 8.32863 4.30098 8.24957 4.50001 8.24957C4.69903 8.24957 4.8899 8.32863 5.03063 8.46936L12 15.4397L18.9694 8.46936C19.0391 8.39968 19.1218 8.34441 19.2128 8.30669C19.3039 8.26898 19.4015 8.24957 19.5 8.24957C19.5986 8.24957 19.6961 8.26898 19.7872 8.30669C19.8782 8.34441 19.9609 8.39968 20.0306 8.46936C20.1003 8.53905 20.1556 8.62177 20.1933 8.71282C20.231 8.80386 20.2504 8.90144 20.2504 8.99999C20.2504 9.09854 20.231 9.19612 20.1933 9.28716C20.1556 9.37821 20.1003 9.46093 20.0306 9.53062Z"
|
|
30
|
+
fill="currentColor"
|
|
31
|
+
/>
|
|
32
|
+
</svg>
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
const meta: Meta<typeof Accordion> = {
|
|
36
|
+
title: "UI-Kit/Accordion",
|
|
37
|
+
component: Accordion,
|
|
38
|
+
tags: ["autodocs"],
|
|
39
|
+
parameters: {
|
|
40
|
+
docs: {
|
|
41
|
+
description: {
|
|
42
|
+
component: `
|
|
43
|
+
The \`Accordion\` component intelligently wraps \`@mantine/core\`'s underlying Accordion layers while applying strict native design system mapping via \`recursica_variables_scoped.css\`.
|
|
44
|
+
|
|
45
|
+
### Hybrid Composition API (Smart-Rendering)
|
|
46
|
+
To maximize flexibility while strictly aligning with the explicit Recursica design logic, the \`AccordionItem\` operates utilizing a **Hybrid Smart-Rendering Flow**:
|
|
47
|
+
|
|
48
|
+
1. **Auto-Construction (Explicit Mapping)**:
|
|
49
|
+
If you supply the explicitly outlined Recursica properties (\`title\`, \`leftIcon\`) directly onto \`<Accordion.Item>\`, the component auto-generates the necessary \`<Accordion.Control>\` DOM layer inherently bridging the icons and titles visually while leaving the raw \`children\` wrapped neatly as the \`<Accordion.Panel>\`.
|
|
50
|
+
|
|
51
|
+
2. **Graceful Falldown (Raw Composability)**:
|
|
52
|
+
If you deliberately omit the \`title\` property, the entire mapping system gracefully falls backward yielding exactly to the raw \`@mantine/core\` composition model. Under this context, you must inject your localized \`<Accordion.Control>\` and \`<Accordion.Panel>\` configurations completely manually.
|
|
53
|
+
|
|
54
|
+
### Architecture Warning (\`open\`)
|
|
55
|
+
To structurally protect the parent wrapper's core transitions tracking architecture (\`<Accordion value="...">\`), this configuration explicitly rejects mapping isolated \`open={true}\` object states natively on specific configurations. Use Mantine's inherent sibling arrays matching the corresponding active value map!
|
|
56
|
+
`,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default meta;
|
|
63
|
+
|
|
64
|
+
export const Default: StoryObj<typeof Accordion> = {
|
|
65
|
+
render: () => {
|
|
66
|
+
return (
|
|
67
|
+
<Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
|
|
68
|
+
<Accordion.Item value="item-1">
|
|
69
|
+
<Accordion.Control>Billing and Membership</Accordion.Control>
|
|
70
|
+
<Accordion.Panel>
|
|
71
|
+
You can manage your billing directly from the dashboard tab. All
|
|
72
|
+
payments are processed automatically.
|
|
73
|
+
</Accordion.Panel>
|
|
74
|
+
</Accordion.Item>
|
|
75
|
+
|
|
76
|
+
<Accordion.Item value="item-2">
|
|
77
|
+
<Accordion.Control>Refund Policy</Accordion.Control>
|
|
78
|
+
<Accordion.Panel>
|
|
79
|
+
We offer a 30-day money-back guarantee for all new subscriptions.
|
|
80
|
+
</Accordion.Panel>
|
|
81
|
+
</Accordion.Item>
|
|
82
|
+
|
|
83
|
+
<Accordion.Item value="item-3">
|
|
84
|
+
<Accordion.Control>Technical Support</Accordion.Control>
|
|
85
|
+
<Accordion.Panel>
|
|
86
|
+
Our support team is available 24/7 via live chat or email.
|
|
87
|
+
</Accordion.Panel>
|
|
88
|
+
</Accordion.Item>
|
|
89
|
+
</Accordion>
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export const WithIcons: StoryObj<typeof Accordion> = {
|
|
95
|
+
render: () => {
|
|
96
|
+
return (
|
|
97
|
+
<Accordion defaultValue="security" chevron={<ChevronIcon />}>
|
|
98
|
+
<Accordion.Item value="security">
|
|
99
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
100
|
+
Security Settings
|
|
101
|
+
</Accordion.Control>
|
|
102
|
+
<Accordion.Panel>
|
|
103
|
+
Enable two-factor authentication (2FA) and monitor active sessions
|
|
104
|
+
below.
|
|
105
|
+
</Accordion.Panel>
|
|
106
|
+
</Accordion.Item>
|
|
107
|
+
|
|
108
|
+
<Accordion.Item value="privacy">
|
|
109
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
110
|
+
Privacy Configuration
|
|
111
|
+
</Accordion.Control>
|
|
112
|
+
<Accordion.Panel>
|
|
113
|
+
Choose what data is shared with our analytics partners.
|
|
114
|
+
</Accordion.Panel>
|
|
115
|
+
</Accordion.Item>
|
|
116
|
+
</Accordion>
|
|
117
|
+
);
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const LongTitleTruncation: StoryObj<typeof Accordion> = {
|
|
122
|
+
render: () => {
|
|
123
|
+
return (
|
|
124
|
+
// `style` is stripped from Accordion itself (only passes through with overStyled);
|
|
125
|
+
// constrain width on a plain wrapper div instead to force truncation.
|
|
126
|
+
<div style={{ maxWidth: 320 }}>
|
|
127
|
+
<Accordion defaultValue="long-title" chevron={<ChevronIcon />}>
|
|
128
|
+
<Accordion.Item value="long-title">
|
|
129
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
130
|
+
This is a deliberately very long accordion item title used to
|
|
131
|
+
verify that overflowing text truncates with a CSS ellipsis instead
|
|
132
|
+
of wrapping or overflowing the header
|
|
133
|
+
</Accordion.Control>
|
|
134
|
+
<Accordion.Panel>
|
|
135
|
+
The header label above should truncate to a single line with a
|
|
136
|
+
trailing ellipsis (…) rather than wrapping onto multiple lines or
|
|
137
|
+
pushing the chevron out of view.
|
|
138
|
+
</Accordion.Panel>
|
|
139
|
+
</Accordion.Item>
|
|
140
|
+
|
|
141
|
+
<Accordion.Item value="short-title">
|
|
142
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
143
|
+
Short Title
|
|
144
|
+
</Accordion.Control>
|
|
145
|
+
<Accordion.Panel>
|
|
146
|
+
A short title in the same accordion for visual comparison.
|
|
147
|
+
</Accordion.Panel>
|
|
148
|
+
</Accordion.Item>
|
|
149
|
+
</Accordion>
|
|
150
|
+
</div>
|
|
151
|
+
);
|
|
152
|
+
},
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const Disabled: StoryObj<typeof Accordion> = {
|
|
156
|
+
render: () => {
|
|
157
|
+
return (
|
|
158
|
+
<Accordion defaultValue="expanded-disabled" chevron={<ChevronIcon />}>
|
|
159
|
+
<Accordion.Item value="expanded-disabled" disabled>
|
|
160
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
161
|
+
Expanded and Disabled
|
|
162
|
+
</Accordion.Control>
|
|
163
|
+
<Accordion.Panel>
|
|
164
|
+
This item starts expanded so the panel content's dimming can be
|
|
165
|
+
verified alongside the control's, not just the collapsed header.
|
|
166
|
+
</Accordion.Panel>
|
|
167
|
+
</Accordion.Item>
|
|
168
|
+
|
|
169
|
+
<Accordion.Item value="collapsed-disabled" disabled>
|
|
170
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
171
|
+
Collapsed and Disabled
|
|
172
|
+
</Accordion.Control>
|
|
173
|
+
<Accordion.Panel>
|
|
174
|
+
Clicking or tabbing to this control should have no effect.
|
|
175
|
+
</Accordion.Panel>
|
|
176
|
+
</Accordion.Item>
|
|
177
|
+
|
|
178
|
+
<Accordion.Item value="enabled">
|
|
179
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
180
|
+
Enabled, for Comparison
|
|
181
|
+
</Accordion.Control>
|
|
182
|
+
<Accordion.Panel>
|
|
183
|
+
A normal, interactive item alongside the disabled ones above.
|
|
184
|
+
</Accordion.Panel>
|
|
185
|
+
</Accordion.Item>
|
|
186
|
+
</Accordion>
|
|
187
|
+
);
|
|
188
|
+
},
|
|
189
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Placeholder for future Accordion component tests. Add tests here if/when needed.
|