@vygruppen/spor-react 4.0.2 → 4.1.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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +27 -0
- package/dist/{CountryCodeSelect-WSPQNU6B.mjs → CountryCodeSelect-FBKDO5JS.mjs} +1 -1
- package/dist/{chunk-MGJQOEU2.mjs → chunk-FPWAXD72.mjs} +149 -220
- package/dist/index.d.mts +22 -96
- package/dist/index.d.ts +22 -96
- package/dist/index.js +148 -219
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/accordion/Accordion.test.tsx +1 -1
- package/src/accordion/Accordion.tsx +1 -1
- package/src/accordion/AccordionContext.tsx +1 -1
- package/src/accordion/Expandable.tsx +6 -6
- package/src/alert/BaseAlert.test.tsx +5 -5
- package/src/alert/BaseAlert.tsx +5 -1
- package/src/alert/ClosableAlert.test.tsx +3 -3
- package/src/alert/ExpandableAlert.test.tsx +5 -5
- package/src/button/Button.test.tsx +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/button/CloseButton.tsx +1 -1
- package/src/button/FloatingActionButton.tsx +5 -5
- package/src/button/IconButton.tsx +1 -1
- package/src/card/Card.tsx +3 -2
- package/src/card/index.tsx +1 -1
- package/src/datepicker/Calendar.tsx +6 -6
- package/src/datepicker/CalendarCell.tsx +9 -8
- package/src/datepicker/CalendarGrid.tsx +9 -9
- package/src/datepicker/CalendarHeader.tsx +2 -2
- package/src/datepicker/CalendarTriggerButton.tsx +5 -10
- package/src/datepicker/DateField.tsx +2 -2
- package/src/datepicker/DatePicker.tsx +3 -3
- package/src/datepicker/DateTimeSegment.tsx +2 -2
- package/src/datepicker/RangeCalendar.tsx +5 -2
- package/src/datepicker/StyledField.tsx +2 -6
- package/src/datepicker/TimePicker.test.tsx +4 -4
- package/src/datepicker/TimePicker.tsx +9 -7
- package/src/index.tsx +0 -1
- package/src/input/CardSelect.tsx +3 -3
- package/src/input/Combobox.tsx +1 -1
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/FormErrorMessage.tsx +1 -1
- package/src/input/InfoSelect.tsx +1 -1
- package/src/input/Input.tsx +1 -1
- package/src/input/InputElement.tsx +2 -2
- package/src/input/ListBox.tsx +3 -3
- package/src/input/NativeSelect.tsx +1 -1
- package/src/input/PasswordInput.tsx +1 -1
- package/src/input/PhoneNumberInput.tsx +13 -4
- package/src/input/Popover.tsx +4 -4
- package/src/input/RadioGroup.tsx +1 -1
- package/src/input/SearchInput.tsx +1 -1
- package/src/input/Switch.tsx +1 -1
- package/src/layout/Stack.tsx +1 -1
- package/src/linjetag/TravelTag.tsx +2 -2
- package/src/link/TextLink.tsx +1 -1
- package/src/list/index.tsx +0 -1
- package/src/loader/DarkSpinner.tsx +5 -5
- package/src/loader/SkeletonText.tsx +6 -3
- package/src/loader/useRotatingLabel.tsx +2 -2
- package/src/media-controller/index.test.tsx +6 -6
- package/src/modal/Drawer.tsx +2 -4
- package/src/modal/ModalHeader.tsx +1 -1
- package/src/provider/index.tsx +1 -1
- package/src/stepper/Stepper.tsx +10 -6
- package/src/stepper/StepperContext.tsx +7 -7
- package/src/stepper/StepperStep.tsx +56 -16
- package/src/theme/components/button.ts +25 -44
- package/src/theme/components/card.ts +7 -1
- package/src/theme/components/close-button.ts +3 -1
- package/src/theme/components/datepicker.ts +2 -2
- package/src/theme/components/divider.ts +17 -17
- package/src/theme/components/fab.ts +16 -13
- package/src/theme/components/info-tag.ts +7 -8
- package/src/theme/components/input.ts +4 -2
- package/src/theme/components/line-icon.ts +1 -2
- package/src/theme/components/media-controller-button.ts +1 -1
- package/src/theme/components/popover.ts +1 -2
- package/src/theme/components/select.ts +4 -4
- package/src/theme/components/stepper.ts +8 -155
- package/src/theme/components/switch.ts +9 -9
- package/src/theme/components/table.ts +3 -3
- package/src/theme/components/tabs.ts +24 -18
- package/src/theme/components/textarea.ts +1 -1
- package/src/theme/components/travel-tag.ts +2 -2
- package/src/theme/foundations/spacing.ts +1 -1
- package/src/theme/foundations/styles.ts +10 -10
- package/src/theme/utils/box-shadow-utils.ts +2 -2
- package/src/toast/ActionToast.test.tsx +1 -1
- package/src/toast/BaseToast.test.tsx +3 -3
- package/src/toast/ClosableToast.test.tsx +1 -1
- package/src/toast/index.tsx +1 -1
- package/src/toast/useToast.tsx +3 -3
- package/src/typography/Badge.tsx +1 -1
- package/src/typography/Text.tsx +1 -1
- package/tsconfig.json +1 -1
@@ -31,73 +31,54 @@ const config = defineStyleConfig({
|
|
31
31
|
},
|
32
32
|
},
|
33
33
|
variants: {
|
34
|
-
control: (props) => ({
|
35
|
-
backgroundColor: mode("darkTeal", "mint")(props),
|
36
|
-
color: mode("white", "darkTeal")(props),
|
37
|
-
...focusVisible({
|
38
|
-
focus: {
|
39
|
-
boxShadow: `inset 0 0 0 4px ${mode(
|
40
|
-
colors.darkTeal,
|
41
|
-
colors.seaMist
|
42
|
-
)(props)}, inset 0 0 0 6px currentColor`,
|
43
|
-
},
|
44
|
-
notFocus: { boxShadow: "none" },
|
45
|
-
}),
|
46
|
-
_hover: {
|
47
|
-
backgroundColor: mode("night", "coralGreen")(props),
|
48
|
-
},
|
49
|
-
_active: {
|
50
|
-
backgroundColor: mode("pine", "white")(props),
|
51
|
-
},
|
52
|
-
}),
|
53
34
|
primary: (props) => ({
|
54
35
|
// FIXME: Update to use a global defined background color for darkMode whenever it is available.
|
55
36
|
// hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
|
56
|
-
backgroundColor: "primaryGreen",
|
57
|
-
color: "white",
|
37
|
+
backgroundColor: mode("primaryGreen", "coralGreen")(props),
|
38
|
+
color: mode("white", "darkTeal")(props),
|
58
39
|
...focusVisible({
|
59
40
|
focus: {
|
60
41
|
boxShadow: `inset 0 0 0 2px ${mode(
|
61
42
|
colors.greenHaze,
|
62
|
-
colors.azure
|
43
|
+
colors.azure,
|
63
44
|
)(props)}, inset 0 0 0 4px ${mode(
|
64
45
|
colors.white,
|
65
|
-
colors.darkGrey
|
46
|
+
colors.darkGrey,
|
66
47
|
)(props)}`,
|
67
48
|
},
|
68
49
|
notFocus: { boxShadow: "none" },
|
69
50
|
}),
|
70
51
|
_hover: {
|
71
|
-
backgroundColor: "
|
52
|
+
backgroundColor: mode("darkTeal", "blueGreen")(props),
|
72
53
|
},
|
73
54
|
_active: {
|
74
|
-
backgroundColor: "
|
55
|
+
backgroundColor: mode("greenHaze", "seaMist")(props),
|
75
56
|
},
|
76
57
|
}),
|
77
58
|
secondary: (props) => ({
|
78
59
|
// FIXME: Update to use global defined background color for darkMode whenever it is available instead of alpha
|
79
|
-
backgroundColor: mode("seaMist", "
|
60
|
+
backgroundColor: mode("seaMist", "primaryGreen")(props),
|
80
61
|
color: mode("darkTeal", "white")(props),
|
81
62
|
// order is important here for now while we do not have global defined background color for darkMode
|
82
63
|
_hover: {
|
83
|
-
backgroundColor: mode("coralGreen", "
|
64
|
+
backgroundColor: mode("coralGreen", "greenHaze")(props),
|
84
65
|
},
|
85
66
|
...focusVisible({
|
86
67
|
focus: {
|
87
68
|
boxShadow: `inset 0 0 0 2px ${mode(
|
88
69
|
colors.greenHaze,
|
89
|
-
colors.
|
70
|
+
colors.primaryGreen,
|
90
71
|
)(props)}, inset 0 0 0 4px ${mode(
|
91
72
|
colors.white,
|
92
|
-
colors.
|
73
|
+
colors.darkTeal,
|
93
74
|
)(props)}`,
|
94
75
|
_hover: {
|
95
76
|
boxShadow: `inset 0 0 0 2px ${mode(
|
96
77
|
colors.greenHaze,
|
97
|
-
colors.azure
|
78
|
+
colors.azure,
|
98
79
|
)(props)}, inset 0 0 0 4px ${mode(
|
99
80
|
colors.white,
|
100
|
-
colors.blackAlpha[500]
|
81
|
+
colors.blackAlpha[500],
|
101
82
|
)(props)}`,
|
102
83
|
},
|
103
84
|
},
|
@@ -106,44 +87,44 @@ const config = defineStyleConfig({
|
|
106
87
|
},
|
107
88
|
}),
|
108
89
|
_active: {
|
109
|
-
backgroundColor: mode("mint", "
|
90
|
+
backgroundColor: mode("mint", "darkTeal")(props),
|
110
91
|
boxShadow: `inset 0 0 0 2px ${mode(
|
111
92
|
colors.greenHaze,
|
112
|
-
colors.azure
|
93
|
+
colors.azure,
|
113
94
|
)(props)}, inset 0 0 0 4px ${mode(
|
114
95
|
colors.white,
|
115
|
-
colors.blackAlpha[600]
|
96
|
+
colors.blackAlpha[600],
|
116
97
|
)(props)}`,
|
117
98
|
_hover: {
|
118
99
|
boxShadow: `inset 0 0 0 2px ${mode(
|
119
100
|
colors.greenHaze,
|
120
|
-
colors.azure
|
101
|
+
colors.azure,
|
121
102
|
)(props)}, inset 0 0 0 4px ${mode(
|
122
103
|
colors.white,
|
123
|
-
colors.blackAlpha[600]
|
104
|
+
colors.blackAlpha[600],
|
124
105
|
)(props)}`,
|
125
106
|
},
|
126
107
|
},
|
127
108
|
}),
|
128
|
-
|
109
|
+
tertiary: (props) => ({
|
129
110
|
backgroundColor: "transparent",
|
130
111
|
color: mode("darkGrey", "white")(props),
|
131
112
|
fontWeight: "normal",
|
132
113
|
boxShadow: `inset 0 0 0 1px ${mode(
|
133
114
|
colors.blackAlpha[400],
|
134
|
-
colors.whiteAlpha[400]
|
115
|
+
colors.whiteAlpha[400],
|
135
116
|
)(props)}`,
|
136
117
|
...focusVisible({
|
137
118
|
focus: {
|
138
119
|
boxShadow: getBoxShadowString({
|
139
120
|
borderWidth: 2,
|
140
|
-
borderColor: "
|
121
|
+
borderColor: "azure",
|
141
122
|
}),
|
142
123
|
},
|
143
124
|
notFocus: {
|
144
125
|
boxShadow: `inset 0 0 0 1px ${mode(
|
145
126
|
colors.blackAlpha[400],
|
146
|
-
colors.whiteAlpha[400]
|
127
|
+
colors.whiteAlpha[400],
|
147
128
|
)(props)}`,
|
148
129
|
},
|
149
130
|
}),
|
@@ -153,7 +134,7 @@ const config = defineStyleConfig({
|
|
153
134
|
_active: {
|
154
135
|
boxShadow: `inset 0 0 0 1px ${mode(
|
155
136
|
colors.blackAlpha[400],
|
156
|
-
colors.whiteAlpha[300]
|
137
|
+
colors.whiteAlpha[300],
|
157
138
|
)(props)}`,
|
158
139
|
backgroundColor: mode("mint", "whiteAlpha.200")(props),
|
159
140
|
},
|
@@ -174,13 +155,13 @@ const config = defineStyleConfig({
|
|
174
155
|
},
|
175
156
|
}),
|
176
157
|
_hover: {
|
177
|
-
backgroundColor: mode("seaMist", "
|
158
|
+
backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
|
178
159
|
_disabled: {
|
179
160
|
color: "blackAlpha.300",
|
180
161
|
},
|
181
162
|
},
|
182
163
|
_active: {
|
183
|
-
backgroundColor: mode("mint", "whiteAlpha.
|
164
|
+
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
184
165
|
},
|
185
166
|
}),
|
186
167
|
floating: (props) => ({
|
@@ -190,7 +171,7 @@ const config = defineStyleConfig({
|
|
190
171
|
baseShadow: "sm",
|
191
172
|
}),
|
192
173
|
_active: {
|
193
|
-
backgroundColor: mode("mint", "whiteAlpha.
|
174
|
+
backgroundColor: mode("mint", "whiteAlpha.400")(props),
|
194
175
|
},
|
195
176
|
_hover: {
|
196
177
|
backgroundColor: mode("white", "whiteAlpha.200")(props),
|
@@ -58,7 +58,8 @@ type CardThemeProps = {
|
|
58
58
|
| "green"
|
59
59
|
| "teal"
|
60
60
|
| "yellow"
|
61
|
-
| "orange"
|
61
|
+
| "orange"
|
62
|
+
| "red";
|
62
63
|
size: "sm" | "lg";
|
63
64
|
};
|
64
65
|
|
@@ -84,6 +85,11 @@ const getColorSchemeBaseProps = (props: CardThemeProps) => {
|
|
84
85
|
backgroundColor: "seaMist",
|
85
86
|
};
|
86
87
|
}
|
88
|
+
case "red": {
|
89
|
+
return {
|
90
|
+
backgroundColor: "pink",
|
91
|
+
};
|
92
|
+
}
|
87
93
|
default:
|
88
94
|
return {
|
89
95
|
backgroundColor: colors[colorScheme]?.[100] ?? "platinum",
|
@@ -18,7 +18,9 @@ const config = defineStyleConfig({
|
|
18
18
|
...focusVisible({
|
19
19
|
focus: {
|
20
20
|
outline: "none",
|
21
|
-
boxShadow: getBoxShadowString({
|
21
|
+
boxShadow: getBoxShadowString({
|
22
|
+
borderColor: mode("greenHaze", "azure")(props),
|
23
|
+
}),
|
22
24
|
outlineOffset: "2px",
|
23
25
|
},
|
24
26
|
notFocus: {
|
@@ -14,7 +14,7 @@ const parts = anatomy("datepicker").parts(
|
|
14
14
|
"weekend",
|
15
15
|
"dateCell",
|
16
16
|
"inputLabel",
|
17
|
-
"dateTimeSegment"
|
17
|
+
"dateTimeSegment",
|
18
18
|
);
|
19
19
|
|
20
20
|
const $arrowBackground = cssVar("popper-arrow-bg");
|
@@ -50,7 +50,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
50
50
|
dateTimeSegment: {
|
51
51
|
color: mode(
|
52
52
|
"darkGrey",
|
53
|
-
props.isPlaceholder ? "whiteAlpha.400" : "white"
|
53
|
+
props.isPlaceholder ? "whiteAlpha.400" : "white",
|
54
54
|
)(props),
|
55
55
|
},
|
56
56
|
calendarTriggerButton: {
|
@@ -1,37 +1,37 @@
|
|
1
|
-
import { defineStyle, defineStyleConfig } from "@chakra-ui/styled-system"
|
2
|
-
import { mode } from "@chakra-ui/theme-tools"
|
1
|
+
import { defineStyle, defineStyleConfig } from "@chakra-ui/styled-system";
|
2
|
+
import { mode } from "@chakra-ui/theme-tools";
|
3
3
|
|
4
|
-
const baseStyle = defineStyle(props => ({
|
5
|
-
borderColor: mode("blackAlpha.300", "whiteAlpha.300")(props)
|
6
|
-
}))
|
4
|
+
const baseStyle = defineStyle((props) => ({
|
5
|
+
borderColor: mode("blackAlpha.300", "whiteAlpha.300")(props),
|
6
|
+
}));
|
7
7
|
|
8
8
|
const variantSolid = defineStyle({
|
9
9
|
borderStyle: "solid",
|
10
|
-
})
|
10
|
+
});
|
11
11
|
|
12
12
|
const variantDashed = defineStyle({
|
13
13
|
borderStyle: "dashed",
|
14
|
-
})
|
14
|
+
});
|
15
15
|
|
16
16
|
const variants = {
|
17
17
|
solid: variantSolid,
|
18
18
|
dashed: variantDashed,
|
19
|
-
}
|
19
|
+
};
|
20
20
|
|
21
21
|
const sizes = {
|
22
22
|
sm: {
|
23
|
-
borderWidth:
|
24
|
-
borderRadius:
|
23
|
+
borderWidth: "1px",
|
24
|
+
borderRadius: "0.5px",
|
25
25
|
},
|
26
26
|
md: {
|
27
|
-
borderWidth:
|
28
|
-
borderRadius:
|
27
|
+
borderWidth: "2px",
|
28
|
+
borderRadius: "1px",
|
29
29
|
},
|
30
30
|
lg: {
|
31
|
-
borderWidth:
|
32
|
-
borderRadius:
|
31
|
+
borderWidth: "3px",
|
32
|
+
borderRadius: "1.5px",
|
33
33
|
},
|
34
|
-
}
|
34
|
+
};
|
35
35
|
|
36
36
|
export default defineStyleConfig({
|
37
37
|
baseStyle,
|
@@ -39,6 +39,6 @@ export default defineStyleConfig({
|
|
39
39
|
sizes,
|
40
40
|
defaultProps: {
|
41
41
|
variant: "solid",
|
42
|
-
size:
|
42
|
+
size: "md",
|
43
43
|
},
|
44
|
-
})
|
44
|
+
});
|
@@ -100,8 +100,8 @@ const config = helpers.defineMultiStyleConfig({
|
|
100
100
|
...focusVisible({
|
101
101
|
focus: {
|
102
102
|
boxShadow: mode(
|
103
|
-
|
104
|
-
|
103
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.darkTeal}, inset 0 0 0 6px ${props.theme.colors.white}`,
|
104
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.mint}, inset 0 0 0 6px ${props.theme.colors.darkTeal}`,
|
105
105
|
)(props),
|
106
106
|
outline: "none",
|
107
107
|
},
|
@@ -115,20 +115,23 @@ const config = helpers.defineMultiStyleConfig({
|
|
115
115
|
container: {
|
116
116
|
backgroundColor: mode("white", "whiteAlpha.100")(props),
|
117
117
|
color: mode("darkGrey", "white")(props),
|
118
|
-
_active: {
|
118
|
+
_active: {
|
119
119
|
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
120
|
-
color: mode("darkGrey", "white")(props)
|
120
|
+
color: mode("darkGrey", "white")(props),
|
121
121
|
},
|
122
122
|
_hover: {
|
123
123
|
backgroundColor: mode("white", "transparent")(props),
|
124
|
-
boxShadow: mode(
|
125
|
-
|
124
|
+
boxShadow: mode(
|
125
|
+
`inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
|
126
|
+
`inset 0 0 0 2px ${props.theme.colors.white}`,
|
127
|
+
)(props),
|
128
|
+
color: mode("darkGrey", "white")(props),
|
126
129
|
},
|
127
130
|
...focusVisible({
|
128
131
|
focus: {
|
129
132
|
boxShadow: mode(
|
130
|
-
|
131
|
-
|
133
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.white}, inset 0 0 0 6px ${props.theme.colors.darkGrey}`,
|
134
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.brightRed}, inset 0 0 0 6px ${props.theme.colors.white}`,
|
132
135
|
)(props),
|
133
136
|
outline: "none",
|
134
137
|
},
|
@@ -142,19 +145,19 @@ const config = helpers.defineMultiStyleConfig({
|
|
142
145
|
container: {
|
143
146
|
backgroundColor: mode("mint", "pine")(props),
|
144
147
|
color: mode("darkTeal", "white")(props),
|
145
|
-
_active: {
|
148
|
+
_active: {
|
146
149
|
backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
|
147
|
-
color: mode("darkTeal", "white")(props)
|
150
|
+
color: mode("darkTeal", "white")(props),
|
148
151
|
},
|
149
152
|
_hover: {
|
150
153
|
backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
|
151
|
-
color: mode("darkTeal", "white")(props)
|
154
|
+
color: mode("darkTeal", "white")(props),
|
152
155
|
},
|
153
156
|
...focusVisible({
|
154
157
|
focus: {
|
155
158
|
boxShadow: mode(
|
156
|
-
|
157
|
-
|
159
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.mint}, inset 0 0 0 6px ${props.theme.colors.azure}`,
|
160
|
+
`${props.theme.shadows.md}, inset 0 0 0 4px ${props.theme.colors.pine}, inset 0 0 0 6px ${props.theme.colors.azure}`,
|
158
161
|
)(props),
|
159
162
|
outline: "none",
|
160
163
|
},
|
@@ -8,7 +8,7 @@ const parts = anatomy("info-tag").parts(
|
|
8
8
|
"icon",
|
9
9
|
"textContainer",
|
10
10
|
"title",
|
11
|
-
"description"
|
11
|
+
"description",
|
12
12
|
);
|
13
13
|
|
14
14
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
@@ -48,17 +48,16 @@ const config = helpers.defineMultiStyleConfig({
|
|
48
48
|
defaultProps: {
|
49
49
|
size: "md",
|
50
50
|
},
|
51
|
-
|
52
|
-
|
51
|
+
variants: {
|
52
|
+
walk: (props) => ({
|
53
53
|
iconContainer: {
|
54
54
|
backgroundColor: mode("white", "transparent")(props),
|
55
55
|
boxShadow: mode(
|
56
|
-
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.black[200]}`,
|
57
|
-
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.whiteAlpha[400]}
|
58
|
-
|
56
|
+
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.black[200]}`,
|
57
|
+
`${props.theme.shadows.md}, inset 0 0 0 2px ${props.theme.colors.whiteAlpha[400]}`,
|
58
|
+
)(props),
|
59
59
|
},
|
60
60
|
}),
|
61
|
-
}
|
61
|
+
},
|
62
62
|
});
|
63
63
|
export default config;
|
64
|
-
|
@@ -45,13 +45,15 @@ const config = helpers.defineMultiStyleConfig({
|
|
45
45
|
}),
|
46
46
|
},
|
47
47
|
notFocus: {
|
48
|
-
boxShadow: getBoxShadowString({
|
48
|
+
boxShadow: getBoxShadowString({
|
49
|
+
borderColor: mode("darkGrey", "white")(props),
|
50
|
+
}),
|
49
51
|
},
|
50
52
|
}),
|
51
53
|
_disabled: {
|
52
54
|
backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
|
53
55
|
boxShadow: getBoxShadowString({
|
54
|
-
borderColor: mode("blackAlpha.200", "whiteAlpha.200")(props)
|
56
|
+
borderColor: mode("blackAlpha.200", "whiteAlpha.200")(props),
|
55
57
|
}),
|
56
58
|
cursor: "not-allowed",
|
57
59
|
},
|
@@ -16,7 +16,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
16
16
|
zIndex: "popover",
|
17
17
|
},
|
18
18
|
content: {
|
19
|
-
[$popperBg.variable]: mode(`colors.darkTeal`, `colors.pine`)(props)
|
19
|
+
[$popperBg.variable]: mode(`colors.darkTeal`, `colors.pine`)(props),
|
20
20
|
backgroundColor: $popperBg.reference,
|
21
21
|
[$arrowBg.variable]: $popperBg.reference,
|
22
22
|
[$arrowShadowColor.variable]: `colors.blackAlpha.300`,
|
@@ -43,7 +43,6 @@ const config = helpers.defineMultiStyleConfig({
|
|
43
43
|
...focusVisible({
|
44
44
|
focus: {
|
45
45
|
boxShadow: getBoxShadowString({ borderColor: "azure" }),
|
46
|
-
|
47
46
|
},
|
48
47
|
notFocus: {
|
49
48
|
boxShadow: "none",
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import {selectAnatomy} from "@chakra-ui/anatomy";
|
2
|
-
import {createMultiStyleConfigHelpers} from "@chakra-ui/react";
|
3
|
-
import {default as Input} from "./input";
|
4
|
-
import {mode} from "@chakra-ui/theme-tools";
|
1
|
+
import { selectAnatomy } from "@chakra-ui/anatomy";
|
2
|
+
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
+
import { default as Input } from "./input";
|
4
|
+
import { mode } from "@chakra-ui/theme-tools";
|
5
5
|
|
6
6
|
const parts = selectAnatomy.extend("root");
|
7
7
|
|
@@ -12,7 +12,7 @@ const parts = anatomy("stepper").parts(
|
|
12
12
|
"stepButton",
|
13
13
|
"stepNumber",
|
14
14
|
"stepTitle",
|
15
|
-
"closeButton"
|
15
|
+
"closeButton",
|
16
16
|
);
|
17
17
|
|
18
18
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
@@ -20,7 +20,6 @@ const helpers = createMultiStyleConfigHelpers(parts.keys);
|
|
20
20
|
const config = helpers.defineMultiStyleConfig({
|
21
21
|
baseStyle: (props) => ({
|
22
22
|
root: {
|
23
|
-
backgroundColor: getRootBackgroundColor(props),
|
24
23
|
display: "flex",
|
25
24
|
alignItems: "center",
|
26
25
|
justifyContent: ["space-between", "center"],
|
@@ -39,7 +38,6 @@ const config = helpers.defineMultiStyleConfig({
|
|
39
38
|
display: ["flex", "none"],
|
40
39
|
alignItems: "center",
|
41
40
|
justifyContent: "space-between",
|
42
|
-
color: getColor(props),
|
43
41
|
},
|
44
42
|
backButton: {
|
45
43
|
borderRadius: "xs",
|
@@ -56,175 +54,30 @@ const config = helpers.defineMultiStyleConfig({
|
|
56
54
|
ml: 2,
|
57
55
|
textAlign: "right",
|
58
56
|
},
|
59
|
-
stepCounter: {
|
60
|
-
whiteSpace: "nowrap",
|
61
|
-
textDecoration: "underline",
|
62
|
-
},
|
63
57
|
stepContainer: {
|
64
58
|
display: "flex",
|
65
59
|
alignItems: "center",
|
66
60
|
},
|
67
|
-
stepButton: {
|
68
|
-
color: "inherit",
|
69
|
-
display: "flex",
|
70
|
-
alignItems: "center",
|
71
|
-
padding: 1,
|
72
|
-
borderRadius: "xs",
|
73
|
-
},
|
74
|
-
stepNumber: {
|
75
|
-
borderRadius: "round",
|
76
|
-
border: "sm",
|
77
|
-
borderColor: "currentColor",
|
78
|
-
width: 4,
|
79
|
-
height: 4,
|
80
|
-
mr: 1,
|
81
|
-
display: "flex",
|
82
|
-
alignItems: "center",
|
83
|
-
justifyContent: "center",
|
84
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
85
|
-
},
|
86
61
|
stepTitle: {
|
87
62
|
textStyle: "sm",
|
88
63
|
whiteSpace: "nowrap",
|
89
64
|
},
|
90
65
|
}),
|
91
66
|
variants: {
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
},
|
96
|
-
stepButton: {
|
97
|
-
_hover: getHoverStyles(props),
|
98
|
-
_focus: getFocusStyles(props),
|
99
|
-
"&:focus:not(:focus-visible)": {
|
100
|
-
boxShadow: "none",
|
101
|
-
},
|
102
|
-
_focusVisible: getFocusStyles(props),
|
103
|
-
_active: getActiveStyles(props),
|
104
|
-
},
|
105
|
-
}),
|
106
|
-
active: (props) => ({
|
107
|
-
stepContainer: {
|
108
|
-
color: getColor(props),
|
109
|
-
},
|
110
|
-
stepButton: {
|
111
|
-
pointerEvents: "none",
|
112
|
-
},
|
113
|
-
stepNumber: getStepNumberStyles(props),
|
114
|
-
stepTitle: {
|
115
|
-
fontWeight: "bold",
|
67
|
+
base: (props) => ({
|
68
|
+
root: {
|
69
|
+
backgroundColor: "transparent",
|
116
70
|
},
|
117
71
|
}),
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
},
|
122
|
-
stepButton: {
|
123
|
-
pointerEvents: "none",
|
72
|
+
accent: (props) => ({
|
73
|
+
root: {
|
74
|
+
backgroundColor: mode("seaMist", "pine")(props),
|
124
75
|
},
|
125
76
|
}),
|
126
77
|
},
|
127
78
|
defaultProps: {
|
128
|
-
|
79
|
+
variant: "base",
|
129
80
|
},
|
130
81
|
});
|
131
82
|
|
132
83
|
export default config;
|
133
|
-
|
134
|
-
const getRootBackgroundColor = (props: StyleFunctionProps) => {
|
135
|
-
switch (props.colorScheme) {
|
136
|
-
case "light":
|
137
|
-
return "white";
|
138
|
-
case "dark":
|
139
|
-
return "darkTeal";
|
140
|
-
case "green":
|
141
|
-
default:
|
142
|
-
return "seaMist";
|
143
|
-
}
|
144
|
-
};
|
145
|
-
|
146
|
-
const getColor = (props: StyleFunctionProps) => {
|
147
|
-
switch (props.colorScheme) {
|
148
|
-
case "light":
|
149
|
-
return mode("darkGrey", "white")(props);
|
150
|
-
case "dark":
|
151
|
-
return "white";
|
152
|
-
case "green":
|
153
|
-
default:
|
154
|
-
return mode("darkTeal", "white")(props);
|
155
|
-
}
|
156
|
-
};
|
157
|
-
|
158
|
-
const getStepNumberStyles = (props: StyleFunctionProps) => {
|
159
|
-
switch (props.colorScheme) {
|
160
|
-
case "dark":
|
161
|
-
return {
|
162
|
-
backgroundColor: "white",
|
163
|
-
color: "darkTeal",
|
164
|
-
};
|
165
|
-
case "light":
|
166
|
-
case "green":
|
167
|
-
default:
|
168
|
-
return {
|
169
|
-
backgroundColor: mode("darkTeal", "white")(props),
|
170
|
-
color: mode("white", "darkTeal")(props),
|
171
|
-
};
|
172
|
-
}
|
173
|
-
};
|
174
|
-
|
175
|
-
const getDisabledColor = (props: StyleFunctionProps) => {
|
176
|
-
switch (props.colorScheme) {
|
177
|
-
case "dark":
|
178
|
-
return "whiteAlpha.400";
|
179
|
-
case "green":
|
180
|
-
return "dimGrey";
|
181
|
-
case "light":
|
182
|
-
default:
|
183
|
-
return "osloGrey";
|
184
|
-
}
|
185
|
-
};
|
186
|
-
|
187
|
-
const getHoverStyles = (props: StyleFunctionProps) => {
|
188
|
-
switch (props.colorScheme) {
|
189
|
-
case "dark":
|
190
|
-
return { backgroundColor: "pine" };
|
191
|
-
case "green":
|
192
|
-
return {
|
193
|
-
backgroundColor: mode("coralGreen", "primaryGreen")(props),
|
194
|
-
};
|
195
|
-
case "light":
|
196
|
-
default:
|
197
|
-
return {
|
198
|
-
backgroundColor: mode("seaMist", "primaryGreen")(props),
|
199
|
-
};
|
200
|
-
}
|
201
|
-
};
|
202
|
-
|
203
|
-
const getFocusStyles = (props: StyleFunctionProps) => {
|
204
|
-
switch (props.colorScheme) {
|
205
|
-
case "dark":
|
206
|
-
return {
|
207
|
-
outline: "none",
|
208
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.white}`,
|
209
|
-
};
|
210
|
-
case "light":
|
211
|
-
case "green":
|
212
|
-
default:
|
213
|
-
return {
|
214
|
-
outline: "none",
|
215
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
|
216
|
-
};
|
217
|
-
}
|
218
|
-
};
|
219
|
-
|
220
|
-
const getActiveStyles = (props: StyleFunctionProps) => {
|
221
|
-
switch (props.colorScheme) {
|
222
|
-
case "light":
|
223
|
-
return { backgroundColor: "mint" };
|
224
|
-
case "dark":
|
225
|
-
return { backgroundColor: "celadon" };
|
226
|
-
case "green":
|
227
|
-
default:
|
228
|
-
return { color: "azure", backgroundColor: "transparent" };
|
229
|
-
}
|
230
|
-
};
|