@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
|
@@ -1,71 +1,410 @@
|
|
|
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
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
/*
|
|
2
|
+
Recursica Stepper CSS module natively binding to Figma variables.
|
|
3
|
+
|
|
4
|
+
HARDCODED CSS NOTE:
|
|
5
|
+
For horizontal layout, Mantine natively renders the text horizontally alongside the icon.
|
|
6
|
+
To achieve Recursica's layout where horizontal orientation stacks text below the icon,
|
|
7
|
+
we force `.step` to be a column, `.stepBody` to remove margin and text-align center,
|
|
8
|
+
and the `.separator`'s margin-top is dynamically calculated `calc((indicator-size / 2) - 1px)`
|
|
9
|
+
to ensure it continues to align with the vertical center of the indicator rather than the
|
|
10
|
+
whole step wrapper.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
.root {
|
|
14
|
+
/* Orientation specific gaps are mapped via data attributes */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.root.horizontal .steps {
|
|
18
|
+
align-items: flex-start;
|
|
19
|
+
--stepper-step-gap: var(
|
|
20
|
+
--recursica_ui-kit_components_stepper_variants_orientation_horizontal_properties_step-gap
|
|
21
|
+
);
|
|
22
|
+
--stepper-max-text-width: var(
|
|
23
|
+
--recursica_ui-kit_components_stepper_variants_orientation_horizontal_properties_max-text-width
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.root.horizontal .step {
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center;
|
|
30
|
+
gap: var(
|
|
31
|
+
--recursica_ui-kit_components_stepper_variants_orientation_horizontal_properties_indicator-label-gap
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.root.horizontal .stepBody {
|
|
36
|
+
width: var(--stepper-max-text-width);
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: flex-start;
|
|
41
|
+
margin-left: 0; /* Mantine natively applies a margin-inline-start */
|
|
42
|
+
gap: var(
|
|
43
|
+
--recursica_ui-kit_components_stepper_variants_orientation_horizontal_properties_label-description-gap
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.root.horizontal .stepLabel,
|
|
48
|
+
.root.horizontal .stepDescription {
|
|
49
|
+
width: max-content;
|
|
50
|
+
max-width: var(--stepper-max-text-width);
|
|
51
|
+
text-align: center;
|
|
52
|
+
white-space: normal;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.root.horizontal .separator {
|
|
56
|
+
align-self: flex-start; /* Force to top regardless of container alignment */
|
|
57
|
+
margin-top: calc(var(--stepper-indicator-size) / 2 - 1px);
|
|
58
|
+
margin-left: calc(
|
|
59
|
+
-1 * (var(--stepper-max-text-width) - var(--stepper-indicator-size)) / 2
|
|
60
|
+
);
|
|
61
|
+
margin-right: calc(
|
|
62
|
+
-1 * (var(--stepper-max-text-width) - var(--stepper-indicator-size)) / 2
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* Vertical Orientation */
|
|
67
|
+
.root.vertical {
|
|
68
|
+
--stepper-step-gap: var(
|
|
69
|
+
--recursica_ui-kit_components_stepper_variants_orientation_vertical_properties_step-gap
|
|
70
|
+
);
|
|
71
|
+
--separator-spacing: 0px; /* Force the line to touch the circle */
|
|
72
|
+
--stepper-max-text-width: var(
|
|
73
|
+
--recursica_ui-kit_components_stepper_variants_orientation_vertical_properties_max-text-width
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.root.vertical .step {
|
|
78
|
+
gap: var(
|
|
79
|
+
--recursica_ui-kit_components_stepper_variants_orientation_vertical_properties_indicator-label-gap
|
|
80
|
+
);
|
|
81
|
+
margin-top: 0 !important; /* Remove Mantine's gap */
|
|
82
|
+
padding-bottom: var(
|
|
83
|
+
--stepper-step-gap
|
|
84
|
+
); /* Move gap inside the step so the separator line can stretch through it */
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.root.vertical .step:last-of-type {
|
|
88
|
+
padding-bottom: 0;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.root.vertical .stepBody {
|
|
92
|
+
gap: var(
|
|
93
|
+
--recursica_ui-kit_components_stepper_variants_orientation_vertical_properties_label-description-gap
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Sizes */
|
|
98
|
+
.large {
|
|
99
|
+
--stepper-icon-size: var(
|
|
100
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_indicator-size
|
|
101
|
+
); /* Maps to Mantine's circle size */
|
|
102
|
+
--stepper-indicator-size: var(
|
|
103
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_indicator-size
|
|
104
|
+
);
|
|
105
|
+
--stepper-border-size: var(
|
|
106
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_indicator-border-size
|
|
107
|
+
);
|
|
108
|
+
--stepper-border-radius: var(
|
|
109
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_indicator-border-radius
|
|
110
|
+
);
|
|
111
|
+
--stepper-font-family: var(
|
|
112
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_font-family
|
|
113
|
+
);
|
|
114
|
+
--stepper-font-size: var(
|
|
115
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_font-size
|
|
116
|
+
);
|
|
117
|
+
--stepper-font-style: var(
|
|
118
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_font-style
|
|
119
|
+
);
|
|
120
|
+
--stepper-font-weight: var(
|
|
121
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_font-weight
|
|
122
|
+
);
|
|
123
|
+
--stepper-letter-spacing: var(
|
|
124
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_letter-spacing
|
|
125
|
+
);
|
|
126
|
+
--stepper-line-height: var(
|
|
127
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_line-height
|
|
128
|
+
);
|
|
129
|
+
--stepper-text-decoration: var(
|
|
130
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_text-decoration
|
|
131
|
+
);
|
|
132
|
+
--stepper-text-transform: var(
|
|
133
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_step-number-text_text-transform
|
|
134
|
+
);
|
|
135
|
+
--stepper-svg-size: var(
|
|
136
|
+
--recursica_ui-kit_components_stepper_variants_sizes_large_properties_completed-icon-size
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.small {
|
|
141
|
+
--stepper-icon-size: var(
|
|
142
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_indicator-size
|
|
143
|
+
); /* Maps to Mantine's circle size */
|
|
144
|
+
--stepper-indicator-size: var(
|
|
145
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_indicator-size
|
|
146
|
+
);
|
|
147
|
+
--stepper-border-size: var(
|
|
148
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_indicator-border-size
|
|
149
|
+
);
|
|
150
|
+
--stepper-border-radius: var(
|
|
151
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_indicator-border-radius
|
|
152
|
+
);
|
|
153
|
+
--stepper-font-family: var(
|
|
154
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_font-family
|
|
155
|
+
);
|
|
156
|
+
--stepper-font-size: var(
|
|
157
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_font-size
|
|
158
|
+
);
|
|
159
|
+
--stepper-font-style: var(
|
|
160
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_font-style
|
|
161
|
+
);
|
|
162
|
+
--stepper-font-weight: var(
|
|
163
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_font-weight
|
|
164
|
+
);
|
|
165
|
+
--stepper-letter-spacing: var(
|
|
166
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_letter-spacing
|
|
167
|
+
);
|
|
168
|
+
--stepper-line-height: var(
|
|
169
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_line-height
|
|
170
|
+
);
|
|
171
|
+
--stepper-text-decoration: var(
|
|
172
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_text-decoration
|
|
173
|
+
);
|
|
174
|
+
--stepper-text-transform: var(
|
|
175
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_step-number-text_text-transform
|
|
176
|
+
);
|
|
177
|
+
--stepper-svg-size: var(
|
|
178
|
+
--recursica_ui-kit_components_stepper_variants_sizes_small_properties_completed-icon-size
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Core Element Structuring using mapped variables */
|
|
183
|
+
.root .step {
|
|
184
|
+
/* Default to Mantine's native flex behavior (stretch) so the vertical separator spans the full height */
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.root .stepBody {
|
|
188
|
+
max-width: var(--stepper-max-text-width);
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.root .stepLabel {
|
|
194
|
+
font-family: var(
|
|
195
|
+
--recursica_ui-kit_components_stepper_properties_label-text_font-family
|
|
196
|
+
);
|
|
197
|
+
font-size: var(
|
|
198
|
+
--recursica_ui-kit_components_stepper_properties_label-text_font-size
|
|
199
|
+
);
|
|
200
|
+
font-style: var(
|
|
201
|
+
--recursica_ui-kit_components_stepper_properties_label-text_font-style
|
|
202
|
+
);
|
|
203
|
+
font-weight: var(
|
|
204
|
+
--recursica_ui-kit_components_stepper_properties_label-text_font-weight
|
|
205
|
+
);
|
|
206
|
+
letter-spacing: var(
|
|
207
|
+
--recursica_ui-kit_components_stepper_properties_label-text_letter-spacing
|
|
208
|
+
);
|
|
209
|
+
line-height: var(
|
|
210
|
+
--recursica_ui-kit_components_stepper_properties_label-text_line-height
|
|
211
|
+
);
|
|
212
|
+
text-decoration: var(
|
|
213
|
+
--recursica_ui-kit_components_stepper_properties_label-text_text-decoration
|
|
214
|
+
);
|
|
215
|
+
text-transform: var(
|
|
216
|
+
--recursica_ui-kit_components_stepper_properties_label-text_text-transform
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.root .stepDescription {
|
|
221
|
+
font-family: var(
|
|
222
|
+
--recursica_ui-kit_components_stepper_properties_description-text_font-family
|
|
223
|
+
);
|
|
224
|
+
font-size: var(
|
|
225
|
+
--recursica_ui-kit_components_stepper_properties_description-text_font-size
|
|
226
|
+
);
|
|
227
|
+
font-style: var(
|
|
228
|
+
--recursica_ui-kit_components_stepper_properties_description-text_font-style
|
|
229
|
+
);
|
|
230
|
+
font-weight: var(
|
|
231
|
+
--recursica_ui-kit_components_stepper_properties_description-text_font-weight
|
|
232
|
+
);
|
|
233
|
+
letter-spacing: var(
|
|
234
|
+
--recursica_ui-kit_components_stepper_properties_description-text_letter-spacing
|
|
235
|
+
);
|
|
236
|
+
line-height: var(
|
|
237
|
+
--recursica_ui-kit_components_stepper_properties_description-text_line-height
|
|
238
|
+
);
|
|
239
|
+
text-decoration: var(
|
|
240
|
+
--recursica_ui-kit_components_stepper_properties_description-text_text-decoration
|
|
241
|
+
);
|
|
242
|
+
text-transform: var(
|
|
243
|
+
--recursica_ui-kit_components_stepper_properties_description-text_text-transform
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.root .stepIcon {
|
|
248
|
+
width: var(--stepper-indicator-size);
|
|
249
|
+
height: var(--stepper-indicator-size);
|
|
250
|
+
min-width: var(--stepper-indicator-size);
|
|
251
|
+
min-height: var(--stepper-indicator-size);
|
|
252
|
+
border-width: var(--stepper-border-size);
|
|
253
|
+
border-radius: 50%; /* Override Figma token to ensure perfectly circular indicators */
|
|
254
|
+
|
|
255
|
+
font-family: var(--stepper-font-family);
|
|
256
|
+
font-size: var(--stepper-font-size);
|
|
257
|
+
font-style: var(--stepper-font-style);
|
|
258
|
+
font-weight: var(--stepper-font-weight);
|
|
259
|
+
letter-spacing: var(--stepper-letter-spacing);
|
|
260
|
+
line-height: var(--stepper-line-height);
|
|
261
|
+
text-decoration: var(--stepper-text-decoration);
|
|
262
|
+
text-transform: var(--stepper-text-transform);
|
|
263
|
+
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
/* Font details are implicitly mapped by sizes, but colors map to states */
|
|
268
|
+
/* Upcoming State (Pending) - Default */
|
|
269
|
+
background-color: var(
|
|
270
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-indicator-background
|
|
271
|
+
);
|
|
272
|
+
border-color: var(
|
|
273
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-indicator-border-color
|
|
274
|
+
);
|
|
275
|
+
color: var(
|
|
276
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-indicator-text
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* Completed State */
|
|
281
|
+
.root .stepIcon.Mui-completed,
|
|
282
|
+
.root .stepIcon:has(.Mui-completed) {
|
|
283
|
+
background-color: var(
|
|
284
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-indicator-background
|
|
285
|
+
);
|
|
286
|
+
border-color: var(
|
|
287
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-indicator-border-color
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.root .stepCompletedIcon {
|
|
292
|
+
color: var(
|
|
293
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-indicator-text
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.root .stepCompletedIcon svg {
|
|
298
|
+
width: var(--stepper-svg-size);
|
|
299
|
+
height: var(--stepper-svg-size);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.root .stepLabel.Mui-completed {
|
|
303
|
+
color: var(
|
|
304
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-label-color
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.root .stepDescription:has(~ .Mui-completed),
|
|
309
|
+
.root .MuiStepLabel-root.Mui-completed .stepDescription {
|
|
310
|
+
color: var(
|
|
311
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-description-color
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/* Current State (Progressing) */
|
|
316
|
+
.root .stepIcon.Mui-active,
|
|
317
|
+
.root .stepIcon:has(.Mui-active) {
|
|
318
|
+
background-color: var(
|
|
319
|
+
--recursica_ui-kit_components_stepper_properties_colors_current-indicator-background
|
|
320
|
+
);
|
|
321
|
+
border-color: var(
|
|
322
|
+
--recursica_ui-kit_components_stepper_properties_colors_current-indicator-border-color
|
|
323
|
+
);
|
|
324
|
+
color: var(
|
|
325
|
+
--recursica_ui-kit_components_stepper_properties_colors_current-indicator-text
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.root .stepLabel.Mui-active {
|
|
330
|
+
color: var(
|
|
331
|
+
--recursica_ui-kit_components_stepper_properties_colors_current-label-color
|
|
332
|
+
);
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.root .stepDescription:has(~ .Mui-active),
|
|
336
|
+
.root .MuiStepLabel-root.Mui-active .stepDescription {
|
|
337
|
+
color: var(
|
|
338
|
+
--recursica_ui-kit_components_stepper_properties_colors_current-description-color
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Upcoming State (Pending Labels) */
|
|
343
|
+
.root .stepLabel:not(.Mui-active):not(.Mui-completed) {
|
|
344
|
+
color: var(
|
|
345
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-label-color
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.root .MuiStepLabel-root:not(.Mui-active):not(.Mui-completed) .stepDescription {
|
|
350
|
+
color: var(
|
|
351
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-description-color
|
|
352
|
+
);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/* Horizontal Separator */
|
|
356
|
+
.root .separator {
|
|
357
|
+
margin: 0 var(--stepper-step-gap); /* Apply the gap logic to the separator natively */
|
|
358
|
+
background-color: var(
|
|
359
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-connector-color
|
|
360
|
+
);
|
|
361
|
+
height: var(
|
|
362
|
+
--recursica_ui-kit_components_stepper_properties_upcoming-connector-size
|
|
363
|
+
);
|
|
364
|
+
border: none;
|
|
365
|
+
min-width: 20px;
|
|
366
|
+
flex: 1;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.root .separator.Mui-active,
|
|
370
|
+
.root .separator.Mui-completed {
|
|
371
|
+
background-color: var(
|
|
372
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-connector-color
|
|
373
|
+
);
|
|
374
|
+
height: var(
|
|
375
|
+
--recursica_ui-kit_components_stepper_properties_completed-connector-size
|
|
376
|
+
);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/* Vertical Separator */
|
|
380
|
+
.root .verticalSeparator {
|
|
381
|
+
border-inline-start: var(
|
|
382
|
+
--recursica_ui-kit_components_stepper_properties_upcoming-connector-size
|
|
383
|
+
)
|
|
384
|
+
solid
|
|
385
|
+
var(
|
|
386
|
+
--recursica_ui-kit_components_stepper_properties_colors_upcoming-connector-color
|
|
387
|
+
);
|
|
388
|
+
top: var(
|
|
389
|
+
--stepper-icon-size
|
|
390
|
+
); /* Overrides Mantine's gap math to force the line to touch the icon */
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.root .verticalSeparator.Mui-active,
|
|
394
|
+
.root .verticalSeparator.Mui-completed {
|
|
395
|
+
border-inline-start: var(
|
|
396
|
+
--recursica_ui-kit_components_stepper_properties_completed-connector-size
|
|
397
|
+
)
|
|
398
|
+
solid
|
|
399
|
+
var(
|
|
400
|
+
--recursica_ui-kit_components_stepper_properties_colors_completed-connector-color
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/* Hide Content
|
|
405
|
+
Recursica Steppers are purely navigational/structural. Content should be managed
|
|
406
|
+
by the parent layout outside of the Stepper DOM.
|
|
407
|
+
*/
|
|
408
|
+
.root .content {
|
|
409
|
+
display: none;
|
|
410
|
+
}
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
1
2
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Stepper } from "./Stepper";
|
|
3
|
-
import {
|
|
3
|
+
import { Stepper, Step, StepLabel } from "./Stepper";
|
|
4
|
+
import { Button } from "../Button/Button";
|
|
5
|
+
import { Group } from "../Group/Group";
|
|
6
|
+
import { Flex } from "../Flex/Flex";
|
|
4
7
|
|
|
5
8
|
const meta: Meta<typeof Stepper> = {
|
|
6
|
-
title: "UI-Kit
|
|
9
|
+
title: "UI-Kit/Stepper",
|
|
7
10
|
component: Stepper,
|
|
8
11
|
tags: ["autodocs"],
|
|
9
12
|
parameters: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"href",
|
|
21
|
-
"onClick",
|
|
22
|
-
"onChange",
|
|
23
|
-
"value",
|
|
24
|
-
"checked",
|
|
25
|
-
],
|
|
13
|
+
layout: "centered",
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
size: {
|
|
17
|
+
control: "radio",
|
|
18
|
+
options: ["small", "large"],
|
|
19
|
+
},
|
|
20
|
+
orientation: {
|
|
21
|
+
control: "radio",
|
|
22
|
+
options: ["horizontal", "vertical"],
|
|
26
23
|
},
|
|
27
24
|
},
|
|
28
25
|
};
|
|
@@ -30,6 +27,135 @@ const meta: Meta<typeof Stepper> = {
|
|
|
30
27
|
export default meta;
|
|
31
28
|
type Story = StoryObj<typeof Stepper>;
|
|
32
29
|
|
|
30
|
+
const InteractiveStepper = (args: React.ComponentProps<typeof Stepper>) => {
|
|
31
|
+
const [active, setActive] = useState(1);
|
|
32
|
+
const nextStep = () =>
|
|
33
|
+
setActive((current) => (current < 3 ? current + 1 : current));
|
|
34
|
+
const prevStep = () =>
|
|
35
|
+
setActive((current) => (current > 0 ? current - 1 : current));
|
|
36
|
+
|
|
37
|
+
const steps = [
|
|
38
|
+
{
|
|
39
|
+
label: "First step",
|
|
40
|
+
description: "Create an account and set up your billing profile",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "Second step",
|
|
44
|
+
description:
|
|
45
|
+
"Verify email and ensure all notification preferences are correct",
|
|
46
|
+
},
|
|
47
|
+
{ label: "Final step", description: "Get full access" },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Flex direction="column" w={600}>
|
|
52
|
+
<Stepper {...args} activeStep={active}>
|
|
53
|
+
{steps.map((step, index) => (
|
|
54
|
+
<Step key={index} completed={active > index}>
|
|
55
|
+
<StepLabel description={step.description}>{step.label}</StepLabel>
|
|
56
|
+
</Step>
|
|
57
|
+
))}
|
|
58
|
+
</Stepper>
|
|
59
|
+
|
|
60
|
+
{active === steps.length ? (
|
|
61
|
+
<div style={{ marginTop: 24, textAlign: "center" }}>
|
|
62
|
+
Completed, click back button to get to previous step
|
|
63
|
+
</div>
|
|
64
|
+
) : (
|
|
65
|
+
<div style={{ marginTop: 24, textAlign: "center" }}>
|
|
66
|
+
Step {active + 1} content
|
|
67
|
+
</div>
|
|
68
|
+
)}
|
|
69
|
+
|
|
70
|
+
<Group mt={24} justify="center" gap={8}>
|
|
71
|
+
<Button variant="outline" onClick={prevStep} disabled={active === 0}>
|
|
72
|
+
Previous step
|
|
73
|
+
</Button>
|
|
74
|
+
<Button variant="outline" onClick={nextStep} disabled={active === 3}>
|
|
75
|
+
Next step
|
|
76
|
+
</Button>
|
|
77
|
+
</Group>
|
|
78
|
+
</Flex>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
33
82
|
export const Default: Story = {
|
|
34
|
-
render: () => <
|
|
83
|
+
render: (args) => <InteractiveStepper {...args} />,
|
|
84
|
+
args: {
|
|
85
|
+
size: "large",
|
|
86
|
+
orientation: "horizontal",
|
|
87
|
+
},
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const Small: Story = {
|
|
91
|
+
render: (args) => <InteractiveStepper {...args} />,
|
|
92
|
+
args: {
|
|
93
|
+
size: "small",
|
|
94
|
+
orientation: "horizontal",
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
export const Vertical: Story = {
|
|
99
|
+
render: (args) => <InteractiveStepper {...args} />,
|
|
100
|
+
args: {
|
|
101
|
+
size: "large",
|
|
102
|
+
orientation: "vertical",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const StressTestStepper = (args: React.ComponentProps<typeof Stepper>) => {
|
|
107
|
+
const [active, setActive] = useState(1);
|
|
108
|
+
const nextStep = () =>
|
|
109
|
+
setActive((current) => (current < 3 ? current + 1 : current));
|
|
110
|
+
const prevStep = () =>
|
|
111
|
+
setActive((current) => (current > 0 ? current - 1 : current));
|
|
112
|
+
|
|
113
|
+
const steps = [
|
|
114
|
+
{
|
|
115
|
+
label:
|
|
116
|
+
"This is an extremely long step title designed to test how the layout handles multiline text wrapping and constraints",
|
|
117
|
+
description: "Create an account and set up your billing profile",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "Second step",
|
|
121
|
+
description:
|
|
122
|
+
"Verify email and ensure all notification preferences are correct",
|
|
123
|
+
},
|
|
124
|
+
{ label: "Final step", description: undefined },
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<Flex direction="column" w={600}>
|
|
129
|
+
<Stepper {...args} activeStep={active}>
|
|
130
|
+
{steps.map((step, index) => (
|
|
131
|
+
<Step key={index} completed={active > index}>
|
|
132
|
+
<StepLabel description={step.description}>{step.label}</StepLabel>
|
|
133
|
+
</Step>
|
|
134
|
+
))}
|
|
135
|
+
</Stepper>
|
|
136
|
+
|
|
137
|
+
{active === steps.length && (
|
|
138
|
+
<div style={{ marginTop: 24, textAlign: "center" }}>
|
|
139
|
+
Completed, click back button to get to previous step
|
|
140
|
+
</div>
|
|
141
|
+
)}
|
|
142
|
+
|
|
143
|
+
<Group mt={24} justify="center" gap={8}>
|
|
144
|
+
<Button variant="outline" onClick={prevStep} disabled={active === 0}>
|
|
145
|
+
Previous step
|
|
146
|
+
</Button>
|
|
147
|
+
<Button variant="outline" onClick={nextStep} disabled={active === 3}>
|
|
148
|
+
Next step
|
|
149
|
+
</Button>
|
|
150
|
+
</Group>
|
|
151
|
+
</Flex>
|
|
152
|
+
);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const LayoutStressTest: Story = {
|
|
156
|
+
render: (args) => <StressTestStepper {...args} />,
|
|
157
|
+
args: {
|
|
158
|
+
size: "large",
|
|
159
|
+
orientation: "horizontal",
|
|
160
|
+
},
|
|
35
161
|
};
|