@vygruppen/spor-react 8.3.0 → 9.0.1

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.
Files changed (67) hide show
  1. package/.turbo/turbo-build.log +10 -12
  2. package/CHANGELOG.md +34 -0
  3. package/dist/{CountryCodeSelect-DYAFPSID.mjs → CountryCodeSelect-OVMXGXPY.mjs} +1 -1
  4. package/dist/{chunk-42ZK3WXN.mjs → chunk-W7IAYOJH.mjs} +1252 -1784
  5. package/dist/index.d.mts +1657 -812
  6. package/dist/index.d.ts +1657 -812
  7. package/dist/index.js +1603 -2073
  8. package/dist/index.mjs +1 -1
  9. package/package.json +1 -1
  10. package/src/breadcrumb/Breadcrumb.tsx +4 -2
  11. package/src/card/Card.tsx +5 -4
  12. package/src/datepicker/DateRangePicker.tsx +1 -0
  13. package/src/input/ChoiceChip.tsx +3 -3
  14. package/src/input/NumericStepper.tsx +7 -49
  15. package/src/input/PasswordInput.tsx +2 -0
  16. package/src/input/PhoneNumberInput.tsx +1 -1
  17. package/src/input/Switch.tsx +4 -7
  18. package/src/loader/ProgressBar.tsx +7 -24
  19. package/src/tab/Tabs.tsx +4 -5
  20. package/src/theme/components/accordion.ts +12 -16
  21. package/src/theme/components/alert-expandable.ts +10 -21
  22. package/src/theme/components/breadcrumb.ts +60 -5
  23. package/src/theme/components/button.ts +40 -75
  24. package/src/theme/components/card-select.ts +14 -56
  25. package/src/theme/components/card.ts +66 -68
  26. package/src/theme/components/checkbox.ts +20 -20
  27. package/src/theme/components/choice-chip.ts +28 -43
  28. package/src/theme/components/close-button.ts +1 -1
  29. package/src/theme/components/datepicker.ts +48 -166
  30. package/src/theme/components/drawer.ts +6 -4
  31. package/src/theme/components/fab.ts +35 -62
  32. package/src/theme/components/index.ts +3 -1
  33. package/src/theme/components/info-select.ts +5 -9
  34. package/src/theme/components/input.ts +17 -32
  35. package/src/theme/components/link.ts +8 -8
  36. package/src/theme/components/listbox.ts +5 -7
  37. package/src/theme/components/media-controller-button.ts +20 -25
  38. package/src/theme/components/modal.ts +8 -6
  39. package/src/theme/components/numeric-stepper.ts +65 -0
  40. package/src/theme/components/popover.ts +7 -8
  41. package/src/theme/components/progress-bar.ts +43 -0
  42. package/src/theme/components/progress-indicator.ts +5 -2
  43. package/src/theme/components/radio.ts +15 -12
  44. package/src/theme/components/select.ts +2 -2
  45. package/src/theme/components/stepper.ts +10 -7
  46. package/src/theme/components/switch.ts +35 -82
  47. package/src/theme/components/table.ts +10 -12
  48. package/src/theme/components/tabs.ts +55 -261
  49. package/src/theme/components/travel-tag.ts +3 -6
  50. package/src/theme/foundations/colors.ts +3 -1
  51. package/src/theme/foundations/fonts.ts +2 -2
  52. package/src/theme/index.ts +9 -6
  53. package/src/theme/utils/accent-utils.ts +54 -0
  54. package/src/theme/utils/base-utils.ts +94 -0
  55. package/src/theme/utils/bg-utils.ts +19 -0
  56. package/src/theme/utils/brand-utils.ts +42 -0
  57. package/src/theme/utils/floating-utils.ts +64 -0
  58. package/src/theme/utils/{focus-util.ts → focus-utils.ts} +1 -1
  59. package/src/theme/utils/ghost-utils.ts +40 -0
  60. package/src/theme/utils/surface-utils.ts +35 -0
  61. package/src/tooltip/Tooltip.tsx +17 -20
  62. package/src/typography/Heading.tsx +7 -2
  63. package/src/util/externals.tsx +0 -1
  64. package/src/theme/utils/background-utils.ts +0 -179
  65. package/src/theme/utils/border-utils.ts +0 -176
  66. package/src/theme/utils/box-shadow-utils.ts +0 -44
  67. package/src/theme/utils/text-utils.ts +0 -60
@@ -1,19 +1,10 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy } from "@chakra-ui/theme-tools";
3
- import { focusVisibleStyles } from "../utils/focus-util";
4
- import {
5
- accentBackground,
6
- baseBackground,
7
- brandBackground,
8
- floatingBackground,
9
- } from "../utils/background-utils";
10
- import { baseText, accentText } from "../utils/text-utils";
11
- import {
12
- baseBorder,
13
- accentBorder,
14
- brandBorder,
15
- floatingBorder,
16
- } from "../utils/border-utils";
3
+ import { accentBackground, accentText } from "../utils/accent-utils";
4
+ import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
5
+ import { brandBackground } from "../utils/brand-utils";
6
+ import { floatingBackground, floatingBorder } from "../utils/floating-utils";
7
+ import { focusVisibleStyles } from "../utils/focus-utils";
17
8
 
18
9
  const parts = anatomy("choice-chip").parts("container", "icon", "label");
19
10
 
@@ -25,25 +16,25 @@ const config = helpers.defineMultiStyleConfig({
25
16
  display: "inline-flex",
26
17
  alignItems: "center",
27
18
  fontSize: "16px",
28
- px: 1,
29
19
  cursor: "pointer",
20
+ transitionProperty: "all",
21
+ transitionDuration: "fast",
30
22
  _checked: {
23
+ outlineColor: "transparent",
31
24
  ...accentText("selected", props),
32
25
  ...accentBackground("selected", props),
33
- ...accentBorder("selected", props),
34
26
  _hover: {
35
27
  ...brandBackground("hover", props),
36
28
  ...baseText("selected", props),
37
- ...brandBorder("hover", props),
29
+ outlineColor: "transparent",
38
30
  },
39
31
  _active: {
40
32
  ...baseText("selected", props),
41
33
  ...brandBackground("active", props),
42
- ...brandBorder("active", props),
43
34
  },
44
35
  },
45
36
  _disabled: {
46
- cursor: "not-allowed",
37
+ pointerEvents: "none",
47
38
  boxShadow: "none",
48
39
  ...baseText("disabled", props),
49
40
  ...baseBackground("disabled", props),
@@ -67,7 +58,7 @@ const config = helpers.defineMultiStyleConfig({
67
58
  "input:focus-visible + &": focusVisibleStyles(props)._focusVisible,
68
59
  },
69
60
  icon: {
70
- mr: props.hasLabel ? 1 : 0,
61
+ marginRight: props.hasLabel ? 1 : 0,
71
62
  },
72
63
  }),
73
64
  variants: {
@@ -76,12 +67,10 @@ const config = helpers.defineMultiStyleConfig({
76
67
  ...baseBackground("default", props),
77
68
  ...baseBorder("default", props),
78
69
  ...baseText("default", props),
79
- "@media (hover:hover)": {
80
- _hover: {
81
- ...baseText("default", props),
82
- ...baseBorder("hover", props),
83
- ...baseBackground("hover", props),
84
- },
70
+ _hover: {
71
+ ...baseText("default", props),
72
+ ...baseBorder("hover", props),
73
+ ...baseBackground("hover", props),
85
74
  },
86
75
  _active: {
87
76
  ...baseBackground("active", props),
@@ -93,23 +82,17 @@ const config = helpers.defineMultiStyleConfig({
93
82
  container: {
94
83
  ...accentBackground("default", props),
95
84
  ...accentText("default", props),
96
- ...accentBorder("default", props),
97
- "@media (hover:hover)": {
98
- _hover: {
99
- ...accentBackground("hover", props),
100
- ...accentBorder("hover", props),
101
- ...accentText("default", props),
102
- },
85
+ _hover: {
86
+ ...accentBackground("hover", props),
87
+ ...accentText("default", props),
103
88
  },
104
89
  _active: {
105
90
  ...accentText("default", props),
106
- ...accentBorder("active", props),
107
91
  ...accentBackground("active", props),
108
92
  },
109
93
  },
110
94
  _active: {
111
95
  ...accentText("default", props),
112
- ...accentBorder("active", props),
113
96
  ...accentBackground("active", props),
114
97
  },
115
98
  }),
@@ -118,10 +101,12 @@ const config = helpers.defineMultiStyleConfig({
118
101
  ...floatingBackground("default", props),
119
102
  ...baseText("default", props),
120
103
  ...floatingBorder("default", props),
104
+ boxShadow: "sm",
121
105
  _hover: {
122
106
  ...floatingBackground("hover", props),
123
107
  ...floatingBorder("hover", props),
124
108
  ...baseText("default", props),
109
+ boxShadow: "md",
125
110
  },
126
111
  _active: {
127
112
  ...floatingBackground("active", props),
@@ -132,37 +117,37 @@ const config = helpers.defineMultiStyleConfig({
132
117
  }),
133
118
  },
134
119
  sizes: {
135
- sm: {
120
+ xs: {
136
121
  container: {
137
122
  borderRadius: "30px",
138
123
  _checked: {
139
124
  borderRadius: "9px",
140
125
  },
141
126
  height: "30px",
142
- px: 1.5,
127
+ paddingX: 1.5,
143
128
  },
144
129
  },
145
- md: {
130
+ sm: {
146
131
  container: {
147
132
  borderRadius: "30px",
148
133
  _checked: {
149
134
  borderRadius: "12px",
150
135
  },
151
136
  height: "36px",
152
- px: 2,
137
+ paddingX: 2,
153
138
  },
154
139
  },
155
- lg: {
140
+ md: {
156
141
  container: {
157
142
  borderRadius: "30px",
158
143
  _checked: {
159
144
  borderRadius: "12px",
160
145
  },
161
146
  height: "42px",
162
- px: 2,
147
+ paddingX: 2,
163
148
  },
164
149
  },
165
- xl: {
150
+ lg: {
166
151
  container: {
167
152
  borderRadius: "30px",
168
153
  _checked: {
@@ -174,7 +159,7 @@ const config = helpers.defineMultiStyleConfig({
174
159
  },
175
160
  },
176
161
  defaultProps: {
177
- size: "md",
162
+ size: "sm",
178
163
  },
179
164
  });
180
165
 
@@ -1,6 +1,6 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { cssVar, mode } from "@chakra-ui/theme-tools";
3
- import { focusVisibleStyles } from "../utils/focus-util";
3
+ import { focusVisibleStyles } from "../utils/focus-utils";
4
4
 
5
5
  const $size = cssVar("close-button-size");
6
6
 
@@ -1,8 +1,13 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy, cssVar, mode } from "@chakra-ui/theme-tools";
3
- import { colors, zIndices } from "../foundations";
4
- import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisibleStyles } from "../utils/focus-util";
3
+ import { zIndices } from "../foundations";
4
+ import { accentText } from "../utils/accent-utils";
5
+ import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
6
+ import { brandBackground, brandText } from "../utils/brand-utils";
7
+ import { floatingBorder } from "../utils/floating-utils";
8
+ import { focusVisibleStyles } from "../utils/focus-utils";
9
+ import { ghostBackground } from "../utils/ghost-utils";
10
+ import { surface } from "../utils/surface-utils";
6
11
 
7
12
  const parts = anatomy("datepicker").parts(
8
13
  "wrapper",
@@ -23,10 +28,6 @@ const helpers = createMultiStyleConfigHelpers(parts.keys);
23
28
  const config = helpers.defineMultiStyleConfig({
24
29
  baseStyle: (props) => ({
25
30
  wrapper: {
26
- backgroundColor: mode("white", "night")(props),
27
- boxShadow: getBoxShadowString({
28
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
29
- }),
30
31
  transitionProperty: "box-shadow",
31
32
  transitionDuration: "fast",
32
33
  borderRadius: "sm",
@@ -39,6 +40,7 @@ const config = helpers.defineMultiStyleConfig({
39
40
  },
40
41
  _disabled: {
41
42
  pointerEvents: "none",
43
+ ...baseBackground("disabled", props),
42
44
  },
43
45
  _focusWithin: {
44
46
  ...focusVisibleStyles(props)._focusVisible,
@@ -57,7 +59,6 @@ const config = helpers.defineMultiStyleConfig({
57
59
  )(props),
58
60
  },
59
61
  calendarTriggerButton: {
60
- backgroundColor: mode("white", "night")(props),
61
62
  width: 8,
62
63
  display: "flex",
63
64
  alignItems: "center",
@@ -71,42 +72,35 @@ const config = helpers.defineMultiStyleConfig({
71
72
  borderRadius: "sm",
72
73
  right: "9px",
73
74
 
75
+ ...focusVisibleStyles(props),
74
76
  _hover: {
75
- boxShadow: "none",
76
- backgroundColor: mode("seaMist", "pine")(props),
77
+ ...ghostBackground("hover", props),
77
78
  },
78
79
  _active: {
79
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
80
+ ...ghostBackground("active", props),
80
81
  },
81
- ...focusVisibleStyles(props),
82
82
  _invalid: {
83
- boxShadow: getBoxShadowString({
84
- borderColor: "brightRed",
85
- borderWidth: 2,
86
- }),
83
+ ...baseBorder("invalid", props),
87
84
  },
88
85
  },
89
86
  arrow: {
90
- [$arrowBackground.variable]: mode("white", colors.night)(props),
87
+ [$arrowBackground.variable]: surface("default", props).backgroundColor,
91
88
  },
92
89
  calendarPopover: {
93
- backgroundColor: mode("white", "night")(props),
94
- color: mode("darkGrey", "white")(props),
95
- boxShadow: getBoxShadowString({
96
- borderWidth: 2,
97
- borderColor: mode("blackAlpha.200", "whiteAlpha.200")(props),
98
- baseShadow: "md",
99
- }),
90
+ ...baseBackground("default", props),
91
+ ...baseText("default", props),
92
+ ...baseBorder("default", props),
93
+ boxShadow: "md",
100
94
  },
101
95
  weekdays: {
102
- color: mode("darkGrey", "white")(props),
96
+ ...baseText("default", props),
103
97
  },
104
98
  weekend: {
105
- color: mode("darkTeal", "seaMist")(props),
99
+ ...accentText("default", props),
106
100
  },
107
101
  dateCell: {
108
- backgroundColor: mode("white", "night")(props),
109
- color: mode("darkGrey", "white")(props),
102
+ ...ghostBackground("default", props),
103
+ ...baseText("default", props),
110
104
  borderRadius: "50%",
111
105
  position: "relative",
112
106
  transition: ".1s ease-in-out",
@@ -117,187 +111,75 @@ const config = helpers.defineMultiStyleConfig({
117
111
  transitionSpeed: "fast",
118
112
 
119
113
  _hover: {
120
- backgroundColor: mode("seaMist", "pine")(props),
121
- },
122
- _focusVisible: {
123
- outlineColor: "greenHaze",
124
- outlineWidth: 2,
125
- outlineStyle: "solid",
114
+ ...ghostBackground("hover", props),
126
115
  },
116
+ ...focusVisibleStyles(props),
127
117
  _active: {
128
- backgroundColor: "seaMist",
129
- boxShadow: "none",
130
- color: mode("darkGrey", "white")(props),
118
+ ...ghostBackground("active", props),
131
119
  },
132
120
  _disabled: {
133
- color: "osloGrey",
134
- boxShadow: "none",
121
+ ...baseBackground("disabled", props),
122
+ ...baseText("disabled", props),
135
123
  pointerEvents: "none",
136
124
  },
137
125
  _selected: {
138
- backgroundColor: mode("darkTeal", "pine")(props),
139
- color: "white",
126
+ ...brandBackground("default", props),
127
+ ...brandText("default", props),
140
128
  _active: {
141
- backgroundColor: "seaMist",
142
- boxShadow: "none",
143
- color: "darkGrey",
129
+ ...brandBackground("active", props),
130
+ ...brandText("active", props),
144
131
  },
145
132
  },
146
133
  "&[data-today]": {
147
- boxShadow: getBoxShadowString({
148
- borderWidth: 1,
149
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
150
- }),
134
+ ...baseBorder("default", props),
151
135
  },
152
136
  "&[data-unavailable]": {
153
137
  pointerEvents: "none",
154
- color: "osloGrey",
138
+ ...baseBackground("disabled", props),
139
+ ...baseText("disabled", props),
155
140
  },
156
141
  },
157
142
  }),
158
143
  variants: {
159
144
  base: (props) => ({
160
145
  wrapper: {
161
- boxShadow: getBoxShadowString({
162
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
163
- }),
146
+ ...baseBorder("default", props),
147
+ ...baseBackground("default", props),
148
+
164
149
  _hover: {
165
- boxShadow: getBoxShadowString({
166
- borderColor: mode("darkGrey", "white")(props),
167
- borderWidth: 2,
168
- }),
150
+ ...baseBorder("hover", props),
169
151
  },
170
152
  _invalid: {
171
- boxShadow: getBoxShadowString({
172
- borderColor: "brightRed",
173
- borderWidth: 2,
174
- }),
153
+ ...baseBorder("invalid", props),
175
154
  },
176
155
  _disabled: {
177
- boxShadow: getBoxShadowString({
178
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
179
- borderWidth: 1,
180
- }),
181
- _focus: {
182
- boxShadow: getBoxShadowString({
183
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
184
- borderWidth: 1,
185
- }),
186
- },
187
- },
188
- },
189
- calendar: {
190
- backgroundColor: mode("white", "night")(props),
191
- color: mode("darkGrey", "white")(props),
192
- boxShadow: getBoxShadowString({
193
- borderWidth: 2,
194
- borderColor: mode("blackAlpha.200", "whiteAlpha.200")(props),
195
- }),
196
- },
197
- dateCell: {
198
- color: mode("darkGrey", "white")(props),
199
- _hover: {
200
- backgroundColor: mode("seaMist", "pine")(props),
201
- },
202
- "&[data-today]": {
203
- boxShadow: getBoxShadowString({
204
- borderWidth: 1,
205
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
206
- }),
156
+ ...baseBorder("disabled", props),
207
157
  },
208
158
  },
209
159
  }),
210
160
  floating: (props) => ({
211
161
  wrapper: {
212
- boxShadow: getBoxShadowString({
213
- borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
214
- baseShadow: "sm",
215
- }),
162
+ ...floatingBorder("default", props),
163
+ boxShadow: "sm",
164
+
216
165
  _hover: {
217
- boxShadow: getBoxShadowString({
218
- borderColor: mode("darkGrey", "white")(props),
219
- borderWidth: 2,
220
- baseShadow: "sm",
221
- }),
166
+ ...floatingBorder("hover", props),
222
167
  },
223
168
  _invalid: {
224
- boxShadow: getBoxShadowString({
225
- borderColor: "brightRed",
226
- borderWidth: 2,
227
- baseShadow: "sm",
228
- }),
169
+ ...baseBorder("invalid", props),
229
170
  },
230
171
  _disabled: {
231
- boxShadow: getBoxShadowString({
232
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
233
- borderWidth: 1,
234
- baseShadow: "sm",
235
- }),
236
- _focus: {
237
- boxShadow: getBoxShadowString({
238
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
239
- borderWidth: 1,
240
- baseShadow: "sm",
241
- }),
242
- },
243
- },
244
- },
245
- calendar: {
246
- backgroundColor: mode("white", "night")(props),
247
- color: mode("darkGrey", "white")(props),
248
- boxShadow: getBoxShadowString({
249
- borderColor: mode("grey.200", "whiteAlpha.400")(props),
250
- baseShadow: "sm",
251
- }),
252
- },
253
- dateCell: {
254
- color: mode("darkGrey", "white")(props),
255
- _hover: {
256
- backgroundColor: mode("", "")(props),
172
+ ...baseBorder("disabled", props),
257
173
  },
258
174
  },
259
175
  }),
260
176
  ghost: (props) => ({
261
177
  wrapper: {
262
- boxShadow: "none",
263
178
  _hover: {
264
- boxShadow: getBoxShadowString({
265
- borderColor: mode("darkGrey", "white")(props),
266
- borderWidth: 2,
267
- }),
179
+ ...baseBorder("hover", props),
268
180
  },
269
181
  _invalid: {
270
- boxShadow: getBoxShadowString({
271
- borderColor: "brightRed",
272
- borderWidth: 2,
273
- }),
274
- },
275
- _disabled: {
276
- boxShadow: getBoxShadowString({
277
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
278
- borderWidth: 1,
279
- }),
280
- _focus: {
281
- boxShadow: getBoxShadowString({
282
- borderColor: mode("osloGrey", "whiteAlpha.400")(props),
283
- borderWidth: 1,
284
- }),
285
- },
286
- },
287
- },
288
- calendar: {
289
- backgroundColor: mode("white", "night")(props),
290
- color: mode("darkGrey", "white")(props),
291
- boxShadow: "none",
292
- },
293
- dateCell: {
294
- color: mode("darkGrey", "white")(props),
295
- _hover: {
296
- backgroundColor: mode("seaMist", "pine")(props),
297
- },
298
- _selected: {
299
- backgroundColor: mode("transparent", "primaryGreen")(props),
300
- color: "darkGrey",
182
+ ...baseBorder("invalid", props),
301
183
  },
302
184
  },
303
185
  }),
@@ -1,6 +1,8 @@
1
1
  import { modalAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import { mode, type PartsStyleObject } from "@chakra-ui/theme-tools";
3
+ import { type PartsStyleObject } from "@chakra-ui/theme-tools";
4
+ import { baseText } from "../utils/base-utils";
5
+ import { bg } from "../utils/bg-utils";
4
6
 
5
7
  const helpers = createMultiStyleConfigHelpers(parts.keys);
6
8
 
@@ -19,8 +21,8 @@ const config = helpers.defineMultiStyleConfig({
19
21
  overflow: props.scrollBehavior === "inside" ? "hidden" : "auto",
20
22
  },
21
23
  dialog: {
22
- backgroundColor: mode("white", "pine")(props),
23
- color: mode("inherit", "white")(props),
24
+ ...bg("default", props),
25
+ ...baseText("default", props),
24
26
  zIndex: "modal",
25
27
  maxHeight:
26
28
  props.scrollBehavior === "inside" ? "calc(100% - 7.5rem)" : undefined,
@@ -81,7 +83,7 @@ function getSize(value: string): PartsStyleObject<typeof parts> {
81
83
  "@supports(min-height: -webkit-fill-available)": {
82
84
  minHeight: "-webkit-fill-available",
83
85
  },
84
- my: 0,
86
+ marginY: 0,
85
87
  },
86
88
  };
87
89
  }
@@ -1,6 +1,11 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
- import { anatomy, mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
3
- import { focusVisibleStyles } from "../utils/focus-util";
2
+ import { anatomy, StyleFunctionProps } from "@chakra-ui/theme-tools";
3
+
4
+ import { accentBackground, accentText } from "../utils/accent-utils";
5
+ import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
6
+ import { brandBackground, brandText } from "../utils/brand-utils";
7
+ import { focusVisibleStyles } from "../utils/focus-utils";
8
+ import { surface } from "../utils/surface-utils";
4
9
 
5
10
  const parts = anatomy("fab").parts("container", "icon", "text");
6
11
 
@@ -21,20 +26,14 @@ const config = helpers.defineMultiStyleConfig({
21
26
  transitionDuration: "fast",
22
27
  transitionProperty: "common",
23
28
  position: "fixed",
29
+ zIndex: "sticky",
24
30
  ...getPositionProps(props),
25
- _disabled: {
26
- backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
27
- color: mode("blackAlpha.400", "whiteAlpha.400")(props),
28
- },
29
31
  ...focusVisibleStyles(props),
30
- _hover: {
31
- backgroundColor: "seaMist",
32
- _disabled: {
33
- backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
34
- color: mode("blackAlpha.400", "whiteAlpha.400")(props),
35
- },
32
+ _disabled: {
33
+ ...surface("disabled", props),
34
+ ...baseText("disabled", props),
35
+ pointerEvents: "none",
36
36
  },
37
- zIndex: "sticky",
38
37
  },
39
38
  icon: {
40
39
  marginRight: props.isTextVisible ? 1 : 0,
@@ -48,75 +47,49 @@ const config = helpers.defineMultiStyleConfig({
48
47
  },
49
48
  }),
50
49
  variants: {
51
- dark: (props) => ({
52
- container: {
53
- backgroundColor: "darkTeal",
54
- color: "white",
55
- _active: { backgroundColor: "pine" },
56
- _hover: {
57
- backgroundColor: "night",
58
- },
59
- },
60
- }),
61
- light: {
62
- container: {
63
- backgroundColor: "white",
64
- color: "darkGrey",
65
- _active: { backgroundColor: "mint" },
66
- },
67
- },
68
- green: {
69
- container: {
70
- backgroundColor: "mint",
71
- color: "darkTeal",
72
- _active: { color: "darkTeal", backgroundColor: "lightGrey" },
73
- },
74
- },
75
50
  brand: (props) => ({
76
51
  container: {
77
- backgroundColor: mode("darkTeal", "mint")(props),
78
- color: mode("white", "darkTeal")(props),
79
- _active: { backgroundColor: mode("pine", "white")(props) },
52
+ ...brandBackground("default", props),
53
+ ...brandText("default", props),
80
54
  _hover: {
81
- backgroundColor: mode("night", "seaMist")(props),
55
+ ...brandBackground("hover", props),
56
+ },
57
+ _active: {
58
+ ...brandBackground("active", props),
82
59
  },
83
60
  },
84
61
  }),
85
62
  base: (props) => ({
86
63
  container: {
87
- backgroundColor: mode("white", "whiteAlpha.100")(props),
88
- color: mode("darkGrey", "white")(props),
89
- _active: {
90
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
91
- color: mode("darkGrey", "white")(props),
92
- },
64
+ ...baseBackground("default", props),
65
+ ...baseBorder("default", props),
66
+ ...baseText("default", props),
93
67
  _hover: {
94
- backgroundColor: mode("white", "transparent")(props),
95
- boxShadow: mode(
96
- `inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
97
- `inset 0 0 0 2px ${props.theme.colors.white}`,
98
- )(props),
99
- color: mode("darkGrey", "white")(props),
68
+ ...baseBackground("hover", props),
69
+ ...baseBorder("hover", props),
70
+ },
71
+ _active: {
72
+ ...baseBorder("default", props),
73
+ ...baseBackground("active", props),
100
74
  },
101
75
  },
102
76
  }),
103
77
  accent: (props) => ({
104
78
  container: {
105
- backgroundColor: mode("mint", "pine")(props),
106
- color: mode("darkTeal", "white")(props),
107
- _active: {
108
- backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
109
- color: mode("darkTeal", "white")(props),
110
- },
79
+ ...accentBackground("default", props),
80
+ ...accentText("default", props),
111
81
  _hover: {
112
- backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
113
- color: mode("darkTeal", "white")(props),
82
+ ...accentBackground("hover", props),
83
+ ...accentText("default", props),
84
+ },
85
+ _active: {
86
+ ...accentBackground("active", props),
114
87
  },
115
88
  },
116
89
  }),
117
90
  },
118
91
  defaultProps: {
119
- variant: "dark",
92
+ variant: "brand",
120
93
  },
121
94
  });
122
95