@recursica/mui-adapter 0.5.0 → 0.7.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/ARCHITECTURE.md +15 -0
- package/CHANGELOG.md +15 -0
- package/SETUP.md +77 -0
- package/USAGE.md +55 -0
- package/dist/mui-adapter.cjs +74 -1
- package/dist/mui-adapter.cjs.map +1 -1
- package/dist/mui-adapter.css +1 -1
- package/dist/mui-adapter.js +6863 -205
- package/dist/mui-adapter.js.map +1 -1
- package/dist/src/components/Accordion/Accordion.d.ts +43 -2
- package/dist/src/components/AssistiveElement/AssistiveElement.d.ts +6 -2
- package/dist/src/components/Autocomplete/Autocomplete.d.ts +12 -2
- package/dist/src/components/Avatar/Avatar.d.ts +10 -3
- package/dist/src/components/Badge/Badge.d.ts +10 -3
- package/dist/src/components/Breadcrumb/Breadcrumb.d.ts +9 -3
- package/dist/src/components/Button/Button.d.ts +2 -17
- package/dist/src/components/Card/Card.d.ts +38 -3
- package/dist/src/components/Checkbox/Checkbox.d.ts +13 -2
- package/dist/src/components/Checkbox/CheckboxGroup.d.ts +18 -0
- package/dist/src/components/Checkbox/index.d.ts +5 -1
- package/dist/src/components/Chip/Chip.d.ts +9 -2
- package/dist/src/components/Container/Container.d.ts +1 -5
- package/dist/src/components/DatePicker/DatePicker.d.ts +2 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +12 -2
- package/dist/src/components/Flex/Flex.d.ts +2 -22
- package/dist/src/components/FormControlLayout/FormControlLayout.d.ts +5 -2
- package/dist/src/components/FormControlWrapper/FormControlWrapper.d.ts +9 -2
- package/dist/src/components/Group/Group.d.ts +2 -7
- package/dist/src/components/HoverCard/HoverCard.d.ts +28 -2
- package/dist/src/components/Label/Label.d.ts +6 -2
- package/dist/src/components/Link/Link.d.ts +2 -6
- package/dist/src/components/Loader/Loader.d.ts +2 -7
- package/dist/src/components/Menu/Menu.d.ts +25 -3
- package/dist/src/components/Modal/Modal.d.ts +37 -2
- package/dist/src/components/NumberInput/NumberInput.d.ts +12 -2
- package/dist/src/components/Pagination/Pagination.d.ts +12 -3
- package/dist/src/components/Pagination/Pagination.icons.d.ts +8 -0
- package/dist/src/components/Panel/Panel.d.ts +52 -3
- package/dist/src/components/Radio/Radio.d.ts +13 -3
- package/dist/src/components/Radio/RadioGroup.d.ts +9 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyBooleanField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyField.d.ts +4 -2
- package/dist/src/components/ReadOnlyField/ReadOnlySwitchField.d.ts +5 -0
- package/dist/src/components/ReadOnlyField/ReadOnlyTextField.d.ts +8 -0
- package/dist/src/components/ReadOnlyField/WithReadOnlyWrapper.d.ts +28 -0
- package/dist/src/components/ReadOnlyField/index.d.ts +1 -0
- package/dist/src/components/SegmentedControl/SegmentedControl.d.ts +21 -3
- package/dist/src/components/Slider/Slider.d.ts +18 -2
- package/dist/src/components/Stack/Stack.d.ts +2 -5
- package/dist/src/components/Stepper/Stepper.d.ts +41 -2
- package/dist/src/components/Switch/Switch.d.ts +10 -3
- package/dist/src/components/Switch/SwitchGroup.d.ts +13 -0
- package/dist/src/components/Table/Table.d.ts +2 -1
- package/dist/src/components/Tabs/Tabs.d.ts +20 -3
- package/dist/src/components/Text/Text.d.ts +2 -16
- package/dist/src/components/TextArea/TextArea.d.ts +12 -2
- package/dist/src/components/TextField/TextField.d.ts +12 -2
- package/dist/src/components/TimePicker/TimePicker.d.ts +2 -1
- package/dist/src/components/Timeline/Timeline.d.ts +15 -2
- package/dist/src/components/Timeline/TimelineItem.d.ts +18 -0
- package/dist/src/components/Title/Title.d.ts +2 -15
- package/dist/src/components/Toast/Toast.d.ts +20 -2
- package/dist/src/components/Tooltip/Tooltip.d.ts +28 -3
- package/dist/src/components/TransferList/TransferList.d.ts +2 -1
- package/dist/src/components/Typography/Typography.d.ts +1 -1
- package/dist/src/utils/RequireAccessibleLabel.d.ts +1 -18
- package/dist/src/utils/filterStylingProps.d.ts +1 -11
- package/llms.txt +16 -0
- package/package.json +14 -3
- package/src/components/Accordion/Accordion.module.css +294 -56
- package/src/components/Accordion/Accordion.stories.tsx +131 -21
- package/src/components/Accordion/Accordion.tsx +260 -5
- package/src/components/AssistiveElement/AssistiveElement.module.css +114 -20
- package/src/components/AssistiveElement/AssistiveElement.stories.tsx +60 -20
- package/src/components/AssistiveElement/AssistiveElement.tsx +81 -5
- package/src/components/Autocomplete/Autocomplete.module.css +319 -42
- package/src/components/Autocomplete/Autocomplete.stories.tsx +175 -23
- package/src/components/Autocomplete/Autocomplete.tsx +181 -6
- package/src/components/Avatar/Avatar.module.css +343 -73
- package/src/components/Avatar/Avatar.stories.tsx +94 -22
- package/src/components/Avatar/Avatar.tsx +99 -6
- package/src/components/Badge/Badge.module.css +127 -29
- package/src/components/Badge/Badge.stories.tsx +65 -22
- package/src/components/Badge/Badge.tsx +67 -6
- package/src/components/Breadcrumb/Breadcrumb.module.css +25 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +57 -22
- package/src/components/Breadcrumb/Breadcrumb.tsx +59 -6
- package/src/components/Button/Button.module.css +19 -61
- package/src/components/Button/Button.stories.tsx +24 -23
- package/src/components/Button/Button.tsx +7 -18
- package/src/components/Card/Card.module.css +154 -38
- package/src/components/Card/Card.stories.tsx +117 -19
- package/src/components/Card/Card.tsx +181 -5
- package/src/components/Checkbox/Checkbox.module.css +249 -39
- package/src/components/Checkbox/Checkbox.stories.tsx +81 -19
- package/src/components/Checkbox/Checkbox.tsx +246 -5
- package/src/components/Checkbox/CheckboxGroup.stories.tsx +139 -0
- package/src/components/Checkbox/CheckboxGroup.tsx +137 -0
- package/src/components/Checkbox/index.ts +6 -1
- package/src/components/Chip/Chip.module.css +246 -43
- package/src/components/Chip/Chip.stories.tsx +101 -21
- package/src/components/Chip/Chip.tsx +136 -6
- package/src/components/Container/Container.stories.tsx +103 -20
- package/src/components/Container/Container.tsx +1 -13
- package/src/components/DatePicker/DatePicker.stories.tsx +125 -19
- package/src/components/DatePicker/DatePicker.tsx +3 -1
- package/src/components/Dropdown/Dropdown.module.css +291 -41
- package/src/components/Dropdown/Dropdown.stories.tsx +80 -21
- package/src/components/Dropdown/Dropdown.tsx +180 -6
- package/src/components/FileInput/FileInput.stories.tsx +2 -19
- package/src/components/FileUpload/FileUpload.stories.tsx +2 -19
- package/src/components/Flex/Flex.stories.tsx +113 -20
- package/src/components/Flex/Flex.tsx +16 -26
- package/src/components/FormControlLayout/FormControlLayout.module.css +92 -0
- package/src/components/FormControlLayout/FormControlLayout.stories.tsx +67 -20
- package/src/components/FormControlLayout/FormControlLayout.tsx +69 -4
- package/src/components/FormControlWrapper/FormControlWrapper.module.css +87 -0
- package/src/components/FormControlWrapper/FormControlWrapper.stories.tsx +116 -22
- package/src/components/FormControlWrapper/FormControlWrapper.tsx +126 -6
- package/src/components/Group/Group.stories.tsx +6 -30
- package/src/components/Group/Group.tsx +14 -9
- package/src/components/HoverCard/HoverCard.module.css +90 -22
- package/src/components/HoverCard/HoverCard.stories.tsx +158 -21
- package/src/components/HoverCard/HoverCard.tsx +147 -5
- package/src/components/Label/Label.module.css +140 -35
- package/src/components/Label/Label.stories.tsx +108 -21
- package/src/components/Label/Label.tsx +82 -5
- package/src/components/Link/Link.module.css +4 -3
- package/src/components/Link/Link.stories.tsx +2 -8
- package/src/components/Link/Link.tsx +1 -5
- package/src/components/Loader/Loader.module.css +1 -2
- package/src/components/Loader/Loader.tsx +1 -7
- package/src/components/Menu/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Menu/Menu.module.css +285 -51
- package/src/components/Menu/Menu.stories.tsx +229 -25
- package/src/components/Menu/Menu.tsx +73 -6
- package/src/components/Modal/Modal.module.css +171 -35
- package/src/components/Modal/Modal.stories.tsx +66 -22
- package/src/components/Modal/Modal.tsx +215 -5
- package/src/components/NumberInput/NumberInput.module.css +276 -42
- package/src/components/NumberInput/NumberInput.stories.tsx +83 -20
- package/src/components/NumberInput/NumberInput.tsx +136 -6
- package/src/components/Pagination/IMPLEMENTATION_NOTES.md +3 -0
- package/src/components/Pagination/Pagination.icons.tsx +66 -0
- package/src/components/Pagination/Pagination.module.css +234 -20
- package/src/components/Pagination/Pagination.stories.tsx +34 -21
- package/src/components/Pagination/Pagination.tsx +74 -6
- package/src/components/Panel/Panel.module.css +206 -38
- package/src/components/Panel/Panel.stories.tsx +214 -22
- package/src/components/Panel/Panel.tsx +130 -5
- package/src/components/Radio/Radio.module.css +235 -37
- package/src/components/Radio/Radio.stories.tsx +77 -19
- package/src/components/Radio/Radio.tsx +210 -5
- package/src/components/Radio/RadioGroup.stories.tsx +117 -0
- package/src/components/Radio/RadioGroup.tsx +125 -0
- package/src/components/ReadOnlyField/ReadOnlyBooleanField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyField.module.css +53 -15
- package/src/components/ReadOnlyField/ReadOnlyField.stories.tsx +147 -19
- package/src/components/ReadOnlyField/ReadOnlyField.tsx +105 -5
- package/src/components/ReadOnlyField/ReadOnlySwitchField.tsx +21 -0
- package/src/components/ReadOnlyField/ReadOnlyTextField.tsx +48 -0
- package/src/components/ReadOnlyField/WithReadOnlyWrapper.tsx +93 -0
- package/src/components/ReadOnlyField/index.ts +1 -0
- package/src/components/SegmentedControl/SegmentedControl.module.css +179 -47
- package/src/components/SegmentedControl/SegmentedControl.stories.tsx +102 -20
- package/src/components/SegmentedControl/SegmentedControl.tsx +140 -6
- package/src/components/Slider/Slider.module.css +539 -86
- package/src/components/Slider/Slider.stories.tsx +157 -19
- package/src/components/Slider/Slider.tsx +283 -5
- package/src/components/Stack/Stack.stories.tsx +4 -25
- package/src/components/Stack/Stack.tsx +1 -5
- package/src/components/Stepper/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Stepper/Stepper.module.css +410 -71
- package/src/components/Stepper/Stepper.stories.tsx +146 -20
- package/src/components/Stepper/Stepper.tsx +147 -6
- package/src/components/Switch/Switch.module.css +259 -39
- package/src/components/Switch/Switch.stories.tsx +98 -19
- package/src/components/Switch/Switch.tsx +200 -6
- package/src/components/Switch/SwitchGroup.stories.tsx +132 -0
- package/src/components/Switch/SwitchGroup.tsx +120 -0
- package/src/components/Table/Table.stories.tsx +1 -19
- package/src/components/Table/Table.tsx +3 -1
- package/src/components/Tabs/IMPLEMENTATION_NOTES.md +4 -0
- package/src/components/Tabs/Tabs.module.css +422 -79
- package/src/components/Tabs/Tabs.stories.tsx +156 -20
- package/src/components/Tabs/Tabs.tsx +86 -6
- package/src/components/Text/Text.stories.tsx +5 -17
- package/src/components/Text/Text.tsx +1 -15
- package/src/components/TextArea/TextArea.module.css +155 -32
- package/src/components/TextArea/TextArea.stories.tsx +80 -21
- package/src/components/TextArea/TextArea.tsx +146 -6
- package/src/components/TextField/TextField.module.css +261 -42
- package/src/components/TextField/TextField.stories.tsx +147 -20
- package/src/components/TextField/TextField.tsx +169 -6
- package/src/components/TimePicker/TimePicker.stories.tsx +2 -19
- package/src/components/TimePicker/TimePicker.tsx +3 -1
- package/src/components/Timeline/Timeline.module.css +365 -76
- package/src/components/Timeline/Timeline.stories.tsx +114 -21
- package/src/components/Timeline/Timeline.tsx +83 -5
- package/src/components/Timeline/TimelineItem.tsx +90 -0
- package/src/components/Title/Title.stories.tsx +0 -18
- package/src/components/Title/Title.tsx +1 -7
- package/src/components/Toast/Toast.module.css +166 -28
- package/src/components/Toast/Toast.stories.tsx +54 -22
- package/src/components/Toast/Toast.tsx +124 -5
- package/src/components/Tooltip/Tooltip.module.css +89 -24
- package/src/components/Tooltip/Tooltip.stories.tsx +152 -22
- package/src/components/Tooltip/Tooltip.tsx +88 -5
- package/src/components/TransferList/TransferList.stories.tsx +1 -19
- package/src/components/TransferList/TransferList.tsx +3 -1
- package/src/utils/RequireAccessibleLabel.ts +1 -12
- package/src/utils/filterStylingProps.ts +7 -20
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"url": "git+https://github.com/borderux/recursica.git",
|
|
14
14
|
"directory": "packages/mui-adapter"
|
|
15
15
|
},
|
|
16
|
-
"version": "0.
|
|
16
|
+
"version": "0.7.0",
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
@@ -33,7 +33,11 @@
|
|
|
33
33
|
"dist",
|
|
34
34
|
"src",
|
|
35
35
|
"CHANGELOG.md",
|
|
36
|
-
".storybook/commonArgTypes.ts"
|
|
36
|
+
".storybook/commonArgTypes.ts",
|
|
37
|
+
"llms.txt",
|
|
38
|
+
"USAGE.md",
|
|
39
|
+
"ARCHITECTURE.md",
|
|
40
|
+
"SETUP.md"
|
|
37
41
|
],
|
|
38
42
|
"keywords": [
|
|
39
43
|
"react",
|
|
@@ -51,13 +55,14 @@
|
|
|
51
55
|
"build": "vite build --mode library",
|
|
52
56
|
"build-storybook": "storybook build -o storybook-static",
|
|
53
57
|
"lint": "eslint .",
|
|
54
|
-
"storybook": "storybook dev -p
|
|
58
|
+
"storybook": "storybook dev -p 6012",
|
|
55
59
|
"analyze-tokens": "analyze-tokens --css recursica_variables_scoped.css --dir src/components --output token-analysis.json",
|
|
56
60
|
"prebuild": "npm run analyze-tokens"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
59
63
|
"@chromatic-com/storybook": "^5.1.1",
|
|
60
64
|
"@eslint/js": "^9.25.0",
|
|
65
|
+
"@mui/lab": "^7.0.1-beta.25",
|
|
61
66
|
"@recursica/adapter-common": "*",
|
|
62
67
|
"@recursica/recursica-postcss-vars": "*",
|
|
63
68
|
"@recursica/storybook-template": "*",
|
|
@@ -96,8 +101,14 @@
|
|
|
96
101
|
"peerDependencies": {
|
|
97
102
|
"@emotion/react": "^11.14.0",
|
|
98
103
|
"@emotion/styled": "^11.14.0",
|
|
104
|
+
"@mui/lab": "^7.0.1-beta.25",
|
|
99
105
|
"@mui/material": "^7.3.0",
|
|
100
106
|
"react": ">=16.8.0",
|
|
101
107
|
"react-dom": ">=16.8.0"
|
|
108
|
+
},
|
|
109
|
+
"peerDependenciesMeta": {
|
|
110
|
+
"@mui/lab": {
|
|
111
|
+
"optional": true
|
|
112
|
+
}
|
|
102
113
|
}
|
|
103
114
|
}
|
|
@@ -1,56 +1,294 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
/*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/*
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
1
|
+
/* ==== ACCORDION CONTAINER ==== */
|
|
2
|
+
.root {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
margin: 0;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
|
|
8
|
+
border-style: solid;
|
|
9
|
+
border-width: var(
|
|
10
|
+
--recursica_ui-kit_components_accordion_properties_border-size
|
|
11
|
+
);
|
|
12
|
+
border-radius: var(
|
|
13
|
+
--recursica_ui-kit_components_accordion_properties_border-radius
|
|
14
|
+
);
|
|
15
|
+
border-color: var(
|
|
16
|
+
--recursica_ui-kit_components_accordion_properties_colors_border-color
|
|
17
|
+
);
|
|
18
|
+
background-color: var(
|
|
19
|
+
--recursica_ui-kit_components_accordion_properties_colors_background
|
|
20
|
+
);
|
|
21
|
+
box-shadow: var(--recursica_ui-kit_components_accordion_properties_elevation);
|
|
22
|
+
|
|
23
|
+
max-width: var(--recursica_ui-kit_components_accordion_properties_max-width);
|
|
24
|
+
min-width: var(--recursica_ui-kit_components_accordion_properties_min-width);
|
|
25
|
+
padding: var(--recursica_ui-kit_components_accordion_properties_padding);
|
|
26
|
+
|
|
27
|
+
/* Ensure gaps between items */
|
|
28
|
+
gap: var(--recursica_ui-kit_components_accordion_properties_item-gap);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ==== ACCORDION ITEM ==== */
|
|
32
|
+
.item {
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
margin: 0;
|
|
35
|
+
position: relative;
|
|
36
|
+
transition: all 0.2s ease;
|
|
37
|
+
|
|
38
|
+
/* Overriding Mantine Default Borders natively */
|
|
39
|
+
border-bottom: none;
|
|
40
|
+
|
|
41
|
+
border-style: solid;
|
|
42
|
+
border-color: var(
|
|
43
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_item-border-color
|
|
44
|
+
);
|
|
45
|
+
border-width: var(
|
|
46
|
+
--recursica_ui-kit_components_accordion-item_properties_item-border-size
|
|
47
|
+
);
|
|
48
|
+
border-bottom-color: var(
|
|
49
|
+
--recursica_ui-kit_components_accordion_properties_colors_divider
|
|
50
|
+
);
|
|
51
|
+
border-bottom-width: var(
|
|
52
|
+
--recursica_ui-kit_components_accordion_properties_divider-size
|
|
53
|
+
);
|
|
54
|
+
border-radius: var(
|
|
55
|
+
--recursica_ui-kit_components_accordion-item_properties_border-radius
|
|
56
|
+
);
|
|
57
|
+
box-shadow: var(
|
|
58
|
+
--recursica_ui-kit_components_accordion-item_properties_elevation-item
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
background-color: var(
|
|
62
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_background-collapsed
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
.item:global(.Mui-expanded) {
|
|
66
|
+
background-color: var(
|
|
67
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_background-expanded
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
.noDivider {
|
|
71
|
+
border-bottom: none !important;
|
|
72
|
+
border-bottom-width: 0 !important;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* ==== ACCORDION CONTROL (HEADER) ==== */
|
|
76
|
+
.control {
|
|
77
|
+
box-sizing: border-box;
|
|
78
|
+
width: 100%;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: space-between;
|
|
82
|
+
|
|
83
|
+
/* Re-apply gap defined by UI Kit for icons vs text */
|
|
84
|
+
gap: var(--recursica_ui-kit_components_accordion-item_properties_icon-gap);
|
|
85
|
+
|
|
86
|
+
/* Strip Mantine's baked padding directly */
|
|
87
|
+
padding: var(
|
|
88
|
+
--recursica_ui-kit_components_accordion-item_properties_header-vertical-padding
|
|
89
|
+
)
|
|
90
|
+
var(
|
|
91
|
+
--recursica_ui-kit_components_accordion-item_properties_header-horizontal-padding
|
|
92
|
+
);
|
|
93
|
+
background-color: transparent;
|
|
94
|
+
|
|
95
|
+
transition: background-color 0.15s ease;
|
|
96
|
+
position: relative;
|
|
97
|
+
z-index: 1;
|
|
98
|
+
color: var(
|
|
99
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_text
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
/* Header Typography */
|
|
103
|
+
font-family: var(
|
|
104
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_font-family
|
|
105
|
+
);
|
|
106
|
+
font-size: var(
|
|
107
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_font-size
|
|
108
|
+
);
|
|
109
|
+
font-weight: var(
|
|
110
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_font-weight
|
|
111
|
+
);
|
|
112
|
+
font-style: var(
|
|
113
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_font-style
|
|
114
|
+
);
|
|
115
|
+
letter-spacing: var(
|
|
116
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_letter-spacing
|
|
117
|
+
);
|
|
118
|
+
line-height: var(
|
|
119
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_line-height
|
|
120
|
+
);
|
|
121
|
+
text-decoration: var(
|
|
122
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_text-decoration
|
|
123
|
+
);
|
|
124
|
+
text-transform: var(
|
|
125
|
+
--recursica_ui-kit_components_accordion-item_properties_header-text_text-transform
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Ensure inner native wrap aligns and has zero margins */
|
|
130
|
+
.control :global(.MuiAccordionSummary-content) {
|
|
131
|
+
margin: 0 !important;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
gap: inherit;
|
|
135
|
+
flex: 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.control :global(.MuiAccordionSummary-content.Mui-expanded) {
|
|
139
|
+
margin: 0 !important;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Mantine natively places hover states on the control node.
|
|
143
|
+
We explicitly override it with our layer hover tokens via an overlay ::after structure
|
|
144
|
+
so we can cleanly utilize the hover-opacity token! */
|
|
145
|
+
.control:hover {
|
|
146
|
+
background-color: transparent;
|
|
147
|
+
}
|
|
148
|
+
.control::after {
|
|
149
|
+
content: "";
|
|
150
|
+
position: absolute;
|
|
151
|
+
inset: 0;
|
|
152
|
+
border-radius: inherit;
|
|
153
|
+
z-index: -1;
|
|
154
|
+
pointer-events: none;
|
|
155
|
+
background-color: var(
|
|
156
|
+
--recursica_ui-kit_components_accordion-item_properties_hover-color
|
|
157
|
+
);
|
|
158
|
+
opacity: 0;
|
|
159
|
+
transition: opacity 150ms ease;
|
|
160
|
+
}
|
|
161
|
+
.control:hover:not(:disabled)::after {
|
|
162
|
+
opacity: var(
|
|
163
|
+
--recursica_ui-kit_components_accordion-item_properties_hover-opacity
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* Label logic inside the Control wrapper */
|
|
168
|
+
.label {
|
|
169
|
+
flex: 1;
|
|
170
|
+
text-align: left;
|
|
171
|
+
color: inherit;
|
|
172
|
+
padding: 0; /* Clear Mantine inner padding */
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/* ==== CHEVRON / RIGHT ICON ==== */
|
|
176
|
+
.chevron {
|
|
177
|
+
flex-shrink: 0;
|
|
178
|
+
width: var(
|
|
179
|
+
--recursica_ui-kit_components_accordion-item_properties_icon-right-size
|
|
180
|
+
);
|
|
181
|
+
height: var(
|
|
182
|
+
--recursica_ui-kit_components_accordion-item_properties_icon-right-size
|
|
183
|
+
);
|
|
184
|
+
color: var(
|
|
185
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_icon
|
|
186
|
+
);
|
|
187
|
+
margin: 0;
|
|
188
|
+
transition: transform 200ms ease;
|
|
189
|
+
display: flex;
|
|
190
|
+
align-items: center;
|
|
191
|
+
justify-content: center;
|
|
192
|
+
}
|
|
193
|
+
.chevron > * {
|
|
194
|
+
width: 100%;
|
|
195
|
+
height: 100%;
|
|
196
|
+
object-fit: contain;
|
|
197
|
+
}
|
|
198
|
+
.item:global(.Mui-expanded) .chevron {
|
|
199
|
+
transform: rotate(180deg);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* ==== LEFT ICON / CUSTOM ICONS ==== */
|
|
203
|
+
.iconLeftWrapper {
|
|
204
|
+
flex-shrink: 0;
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: center;
|
|
207
|
+
justify-content: center;
|
|
208
|
+
width: var(
|
|
209
|
+
--recursica_ui-kit_components_accordion-item_properties_icon-left-size
|
|
210
|
+
);
|
|
211
|
+
height: var(
|
|
212
|
+
--recursica_ui-kit_components_accordion-item_properties_icon-left-size
|
|
213
|
+
);
|
|
214
|
+
color: var(
|
|
215
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_icon
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
.iconLeftWrapper > * {
|
|
219
|
+
width: 100%;
|
|
220
|
+
height: 100%;
|
|
221
|
+
object-fit: contain;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* ==== ACCORDION PANEL (CONTENT) ==== */
|
|
225
|
+
.panel {
|
|
226
|
+
box-sizing: border-box;
|
|
227
|
+
margin: var(
|
|
228
|
+
--recursica_ui-kit_components_accordion-item_properties_content-margin
|
|
229
|
+
);
|
|
230
|
+
padding: 0; /* Overriding dynamic layout structure */
|
|
231
|
+
background-color: var(
|
|
232
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_content-background
|
|
233
|
+
);
|
|
234
|
+
border-style: solid;
|
|
235
|
+
border-color: var(
|
|
236
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_content-border-color
|
|
237
|
+
);
|
|
238
|
+
border-width: var(
|
|
239
|
+
--recursica_ui-kit_components_accordion-item_properties_content-border-size
|
|
240
|
+
);
|
|
241
|
+
border-radius: var(
|
|
242
|
+
--recursica_ui-kit_components_accordion-item_properties_content-border-radius
|
|
243
|
+
);
|
|
244
|
+
box-shadow: var(
|
|
245
|
+
--recursica_ui-kit_components_accordion-item_properties_elevation-content
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.content {
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
/* Strip Mantine padding and apply logic directly mapped */
|
|
252
|
+
padding: 0
|
|
253
|
+
var(
|
|
254
|
+
--recursica_ui-kit_components_accordion-item_properties_content-horizontal-padding
|
|
255
|
+
)
|
|
256
|
+
var(
|
|
257
|
+
--recursica_ui-kit_components_accordion-item_properties_content-bottom-padding
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
/* Apply offset gap explicitly calculated below header */
|
|
261
|
+
padding-top: var(
|
|
262
|
+
--recursica_ui-kit_components_accordion-item_properties_content-top-padding
|
|
263
|
+
);
|
|
264
|
+
|
|
265
|
+
color: var(
|
|
266
|
+
--recursica_ui-kit_components_accordion-item_properties_colors_content-text
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
/* Content Typography */
|
|
270
|
+
font-family: var(
|
|
271
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_font-family
|
|
272
|
+
);
|
|
273
|
+
font-size: var(
|
|
274
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_font-size
|
|
275
|
+
);
|
|
276
|
+
font-weight: var(
|
|
277
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_font-weight
|
|
278
|
+
);
|
|
279
|
+
font-style: var(
|
|
280
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_font-style
|
|
281
|
+
);
|
|
282
|
+
letter-spacing: var(
|
|
283
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_letter-spacing
|
|
284
|
+
);
|
|
285
|
+
line-height: var(
|
|
286
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_line-height
|
|
287
|
+
);
|
|
288
|
+
text-decoration: var(
|
|
289
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_text-decoration
|
|
290
|
+
);
|
|
291
|
+
text-transform: var(
|
|
292
|
+
--recursica_ui-kit_components_accordion-item_properties_content-text_text-transform
|
|
293
|
+
);
|
|
294
|
+
}
|
|
@@ -1,35 +1,145 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
2
|
import { Accordion } from "./Accordion";
|
|
3
|
-
import {
|
|
3
|
+
import { Layer } from "@recursica/adapter-common";
|
|
4
|
+
|
|
5
|
+
const SVGIcon = () => (
|
|
6
|
+
<svg
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
width="24"
|
|
9
|
+
height="24"
|
|
10
|
+
viewBox="0 0 24 24"
|
|
11
|
+
fill="none"
|
|
12
|
+
stroke="currentColor"
|
|
13
|
+
strokeWidth="2"
|
|
14
|
+
strokeLinecap="round"
|
|
15
|
+
strokeLinejoin="round"
|
|
16
|
+
>
|
|
17
|
+
<path d="M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const ChevronIcon = () => (
|
|
22
|
+
<svg
|
|
23
|
+
width="24"
|
|
24
|
+
height="24"
|
|
25
|
+
viewBox="0 0 24 24"
|
|
26
|
+
fill="none"
|
|
27
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
28
|
+
>
|
|
29
|
+
<path
|
|
30
|
+
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"
|
|
31
|
+
fill="currentColor"
|
|
32
|
+
/>
|
|
33
|
+
</svg>
|
|
34
|
+
);
|
|
4
35
|
|
|
5
36
|
const meta: Meta<typeof Accordion> = {
|
|
6
|
-
title: "UI-Kit
|
|
37
|
+
title: "UI-Kit/Accordion",
|
|
7
38
|
component: Accordion,
|
|
8
39
|
tags: ["autodocs"],
|
|
9
40
|
parameters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
docs: {
|
|
42
|
+
description: {
|
|
43
|
+
component: `
|
|
44
|
+
The \`Accordion\` component intelligently wraps \`@mantine/core\`'s underlying Accordion layers while applying strict native design system mapping via \`recursica_variables_scoped.css\`.
|
|
45
|
+
|
|
46
|
+
### Hybrid Composition API (Smart-Rendering)
|
|
47
|
+
To maximize flexibility while strictly aligning with the explicit Recursica design logic, the \`AccordionItem\` operates utilizing a **Hybrid Smart-Rendering Flow**:
|
|
48
|
+
|
|
49
|
+
1. **Auto-Construction (Explicit Mapping)**:
|
|
50
|
+
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>\`.
|
|
51
|
+
|
|
52
|
+
2. **Graceful Falldown (Raw Composability)**:
|
|
53
|
+
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.
|
|
54
|
+
|
|
55
|
+
### Architecture Warning (\`open\`)
|
|
56
|
+
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!
|
|
57
|
+
`,
|
|
58
|
+
},
|
|
26
59
|
},
|
|
27
60
|
},
|
|
28
61
|
};
|
|
29
62
|
|
|
30
63
|
export default meta;
|
|
31
|
-
type Story = StoryObj<typeof Accordion>;
|
|
32
64
|
|
|
33
|
-
export const Default:
|
|
34
|
-
render: () =>
|
|
65
|
+
export const Default: StoryObj<typeof Accordion> = {
|
|
66
|
+
render: () => {
|
|
67
|
+
return (
|
|
68
|
+
<Layer layer={0} style={{ padding: "24px" }}>
|
|
69
|
+
<Accordion defaultValue="item-1" chevron={<ChevronIcon />}>
|
|
70
|
+
<Accordion.Item value="item-1">
|
|
71
|
+
<Accordion.Control>Billing and Membership</Accordion.Control>
|
|
72
|
+
<Accordion.Panel>
|
|
73
|
+
You can manage your billing directly from the dashboard tab. All
|
|
74
|
+
payments are processed automatically.
|
|
75
|
+
</Accordion.Panel>
|
|
76
|
+
</Accordion.Item>
|
|
77
|
+
|
|
78
|
+
<Accordion.Item value="item-2">
|
|
79
|
+
<Accordion.Control>Refund Policy</Accordion.Control>
|
|
80
|
+
<Accordion.Panel>
|
|
81
|
+
We offer a 30-day money-back guarantee for all new subscriptions.
|
|
82
|
+
</Accordion.Panel>
|
|
83
|
+
</Accordion.Item>
|
|
84
|
+
|
|
85
|
+
<Accordion.Item value="item-3">
|
|
86
|
+
<Accordion.Control>Technical Support</Accordion.Control>
|
|
87
|
+
<Accordion.Panel>
|
|
88
|
+
Our support team is available 24/7 via live chat or email.
|
|
89
|
+
</Accordion.Panel>
|
|
90
|
+
</Accordion.Item>
|
|
91
|
+
</Accordion>
|
|
92
|
+
</Layer>
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const WithIcons: StoryObj<typeof Accordion> = {
|
|
98
|
+
render: () => {
|
|
99
|
+
return (
|
|
100
|
+
<Layer layer={0} style={{ padding: "24px" }}>
|
|
101
|
+
<Accordion defaultValue="security" chevron={<ChevronIcon />}>
|
|
102
|
+
<Accordion.Item value="security">
|
|
103
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
104
|
+
Security Settings
|
|
105
|
+
</Accordion.Control>
|
|
106
|
+
<Accordion.Panel>
|
|
107
|
+
Enable two-factor authentication (2FA) and monitor active sessions
|
|
108
|
+
below.
|
|
109
|
+
</Accordion.Panel>
|
|
110
|
+
</Accordion.Item>
|
|
111
|
+
|
|
112
|
+
<Accordion.Item value="privacy">
|
|
113
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
114
|
+
Privacy Configuration
|
|
115
|
+
</Accordion.Control>
|
|
116
|
+
<Accordion.Panel>
|
|
117
|
+
Choose what data is shared with our analytics partners.
|
|
118
|
+
</Accordion.Panel>
|
|
119
|
+
</Accordion.Item>
|
|
120
|
+
</Accordion>
|
|
121
|
+
</Layer>
|
|
122
|
+
);
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export const LayerOne: StoryObj<typeof Accordion> = {
|
|
127
|
+
render: () => {
|
|
128
|
+
return (
|
|
129
|
+
<Layer layer={1} style={{ padding: "24px" }}>
|
|
130
|
+
<Accordion defaultValue="demo" chevron={<ChevronIcon />}>
|
|
131
|
+
<Accordion.Item value="demo">
|
|
132
|
+
<Accordion.Control leftIcon={<SVGIcon />}>
|
|
133
|
+
Layer 1 Render Engine
|
|
134
|
+
</Accordion.Control>
|
|
135
|
+
<Accordion.Panel>
|
|
136
|
+
This Accordion dynamically updates its colors, borders, and
|
|
137
|
+
typography variables because it is wrapped securely by the
|
|
138
|
+
simulated `data-recursica-layer="1"`.
|
|
139
|
+
</Accordion.Panel>
|
|
140
|
+
</Accordion.Item>
|
|
141
|
+
</Accordion>
|
|
142
|
+
</Layer>
|
|
143
|
+
);
|
|
144
|
+
},
|
|
35
145
|
};
|