@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.
- package/.turbo/turbo-build.log +10 -12
- package/CHANGELOG.md +34 -0
- package/dist/{CountryCodeSelect-DYAFPSID.mjs → CountryCodeSelect-OVMXGXPY.mjs} +1 -1
- package/dist/{chunk-42ZK3WXN.mjs → chunk-W7IAYOJH.mjs} +1252 -1784
- package/dist/index.d.mts +1657 -812
- package/dist/index.d.ts +1657 -812
- package/dist/index.js +1603 -2073
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/breadcrumb/Breadcrumb.tsx +4 -2
- package/src/card/Card.tsx +5 -4
- package/src/datepicker/DateRangePicker.tsx +1 -0
- package/src/input/ChoiceChip.tsx +3 -3
- package/src/input/NumericStepper.tsx +7 -49
- package/src/input/PasswordInput.tsx +2 -0
- package/src/input/PhoneNumberInput.tsx +1 -1
- package/src/input/Switch.tsx +4 -7
- package/src/loader/ProgressBar.tsx +7 -24
- package/src/tab/Tabs.tsx +4 -5
- package/src/theme/components/accordion.ts +12 -16
- package/src/theme/components/alert-expandable.ts +10 -21
- package/src/theme/components/breadcrumb.ts +60 -5
- package/src/theme/components/button.ts +40 -75
- package/src/theme/components/card-select.ts +14 -56
- package/src/theme/components/card.ts +66 -68
- package/src/theme/components/checkbox.ts +20 -20
- package/src/theme/components/choice-chip.ts +28 -43
- package/src/theme/components/close-button.ts +1 -1
- package/src/theme/components/datepicker.ts +48 -166
- package/src/theme/components/drawer.ts +6 -4
- package/src/theme/components/fab.ts +35 -62
- package/src/theme/components/index.ts +3 -1
- package/src/theme/components/info-select.ts +5 -9
- package/src/theme/components/input.ts +17 -32
- package/src/theme/components/link.ts +8 -8
- package/src/theme/components/listbox.ts +5 -7
- package/src/theme/components/media-controller-button.ts +20 -25
- package/src/theme/components/modal.ts +8 -6
- package/src/theme/components/numeric-stepper.ts +65 -0
- package/src/theme/components/popover.ts +7 -8
- package/src/theme/components/progress-bar.ts +43 -0
- package/src/theme/components/progress-indicator.ts +5 -2
- package/src/theme/components/radio.ts +15 -12
- package/src/theme/components/select.ts +2 -2
- package/src/theme/components/stepper.ts +10 -7
- package/src/theme/components/switch.ts +35 -82
- package/src/theme/components/table.ts +10 -12
- package/src/theme/components/tabs.ts +55 -261
- package/src/theme/components/travel-tag.ts +3 -6
- package/src/theme/foundations/colors.ts +3 -1
- package/src/theme/foundations/fonts.ts +2 -2
- package/src/theme/index.ts +9 -6
- package/src/theme/utils/accent-utils.ts +54 -0
- package/src/theme/utils/base-utils.ts +94 -0
- package/src/theme/utils/bg-utils.ts +19 -0
- package/src/theme/utils/brand-utils.ts +42 -0
- package/src/theme/utils/floating-utils.ts +64 -0
- package/src/theme/utils/{focus-util.ts → focus-utils.ts} +1 -1
- package/src/theme/utils/ghost-utils.ts +40 -0
- package/src/theme/utils/surface-utils.ts +35 -0
- package/src/tooltip/Tooltip.tsx +17 -20
- package/src/typography/Heading.tsx +7 -2
- package/src/util/externals.tsx +0 -1
- package/src/theme/utils/background-utils.ts +0 -179
- package/src/theme/utils/border-utils.ts +0 -176
- package/src/theme/utils/box-shadow-utils.ts +0 -44
- package/src/theme/utils/text-utils.ts +0 -60
@@ -1,5 +1,6 @@
|
|
1
1
|
export { default as Accordion } from "./accordion";
|
2
2
|
export { default as Alert } from "./alert";
|
3
|
+
export { default as AlertExpandable } from "./alert-expandable";
|
3
4
|
export { default as Badge } from "./badge";
|
4
5
|
export { default as Breadcrumb } from "./breadcrumb";
|
5
6
|
export { default as Button } from "./button";
|
@@ -24,7 +25,9 @@ export { default as List } from "./list";
|
|
24
25
|
export { default as ListBox } from "./listbox";
|
25
26
|
export { default as MediaControllerButton } from "./media-controller-button";
|
26
27
|
export { default as Modal } from "./modal";
|
28
|
+
export { default as NumericStepper } from "./numeric-stepper";
|
27
29
|
export { default as Popover } from "./popover";
|
30
|
+
export { default as ProgressBar } from "./progress-bar";
|
28
31
|
export { default as ProgressIndicator } from "./progress-indicator";
|
29
32
|
export { default as Radio } from "./radio";
|
30
33
|
export { default as Select } from "./select";
|
@@ -36,4 +39,3 @@ export { default as Tabs } from "./tabs";
|
|
36
39
|
export { default as Textarea } from "./textarea";
|
37
40
|
export { default as Toast } from "./toast";
|
38
41
|
export { default as TravelTag } from "./travel-tag";
|
39
|
-
export { default as AlertExpandable } from "./alert-expandable";
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { anatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { baseBackground,
|
4
|
-
import {
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-
|
3
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
+
import { floatingBackground, floatingBorder } from "../utils/floating-utils";
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
6
|
import { srOnly } from "../utils/sr-utils";
|
7
7
|
|
8
8
|
const parts = anatomy("InfoSelect").parts(
|
@@ -37,19 +37,15 @@ const config = helpers.defineMultiStyleConfig({
|
|
37
37
|
},
|
38
38
|
...focusVisibleStyles(props),
|
39
39
|
_disabled: {
|
40
|
-
|
40
|
+
pointerEvents: "none",
|
41
|
+
...baseText("disabled", props),
|
41
42
|
...baseBackground("disabled", props),
|
42
|
-
_hover: { ...baseBorder("disabled", props) },
|
43
|
-
_focus: { ...baseBorder("disabled", props) },
|
44
43
|
},
|
45
44
|
_active: {
|
46
45
|
...baseBackground("active", props),
|
47
46
|
},
|
48
47
|
_invalid: {
|
49
48
|
...baseBorder("invalid", props),
|
50
|
-
_hover: {
|
51
|
-
...baseBorder("hover", props),
|
52
|
-
},
|
53
49
|
},
|
54
50
|
},
|
55
51
|
arrowIcon: {},
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { inputAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import {
|
3
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
5
|
+
import { surface } from "../utils/surface-utils";
|
6
6
|
|
7
7
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
8
8
|
|
@@ -13,7 +13,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
13
13
|
width: "100%",
|
14
14
|
outline: "none",
|
15
15
|
border: 0,
|
16
|
-
|
16
|
+
...baseBackground("default", props),
|
17
17
|
borderRadius: "sm",
|
18
18
|
transitionProperty: "common",
|
19
19
|
transitionDuration: "fast",
|
@@ -22,43 +22,28 @@ const config = helpers.defineMultiStyleConfig({
|
|
22
22
|
height: "54px",
|
23
23
|
fontSize: "mobile.md",
|
24
24
|
|
25
|
-
|
26
|
-
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
27
|
-
}),
|
28
|
-
_active: {
|
29
|
-
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
30
|
-
boxShadow: getBoxShadowString({
|
31
|
-
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
32
|
-
}),
|
33
|
-
},
|
25
|
+
...baseBorder("default", props),
|
34
26
|
_hover: {
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
27
|
+
...baseBorder("hover", props),
|
28
|
+
},
|
29
|
+
_active: {
|
30
|
+
...baseBackground("active", props),
|
31
|
+
...baseBorder("default", props),
|
39
32
|
},
|
40
33
|
_focusVisible: {
|
41
34
|
...focusVisibleStyles(props)._focusVisible,
|
42
|
-
outlineOffset:
|
35
|
+
outlineOffset: 0,
|
43
36
|
},
|
44
37
|
|
45
38
|
_disabled: {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}),
|
50
|
-
cursor: "not-allowed",
|
39
|
+
...surface("disabled", props),
|
40
|
+
...baseBorder("disabled", props),
|
41
|
+
pointerEvents: "none",
|
51
42
|
},
|
52
43
|
_invalid: {
|
53
|
-
|
54
|
-
borderColor: "brightRed",
|
55
|
-
borderWidth: 2,
|
56
|
-
}),
|
44
|
+
...baseBorder("invalid", props),
|
57
45
|
_hover: {
|
58
|
-
|
59
|
-
borderColor: mode("darkGrey", "white")(props),
|
60
|
-
borderWidth: 2,
|
61
|
-
}),
|
46
|
+
...baseBorder("hover", props),
|
62
47
|
},
|
63
48
|
},
|
64
49
|
" + label": {
|
@@ -84,7 +69,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
84
69
|
},
|
85
70
|
group: {
|
86
71
|
":has(:disabled)": {
|
87
|
-
|
72
|
+
...baseText("disabled", props),
|
88
73
|
},
|
89
74
|
},
|
90
75
|
}),
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
2
|
import { mode } from "@chakra-ui/theme-tools";
|
3
|
-
import {
|
4
|
-
import { baseBackground,
|
5
|
-
import {
|
3
|
+
import { accentText } from "../utils/accent-utils";
|
4
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
5
|
+
import { brandBackground, brandText } from "../utils/brand-utils";
|
6
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
7
|
|
7
8
|
const config = defineStyleConfig({
|
8
9
|
baseStyle: (props) => ({
|
@@ -40,7 +41,7 @@ const config = defineStyleConfig({
|
|
40
41
|
}),
|
41
42
|
variants: {
|
42
43
|
primary: (props) => ({
|
43
|
-
...
|
44
|
+
...accentText("default", props),
|
44
45
|
_hover: {
|
45
46
|
...brandText("hover", props),
|
46
47
|
...brandBackground("hover", props),
|
@@ -57,16 +58,15 @@ const config = defineStyleConfig({
|
|
57
58
|
)(props)}, ${mode("blackAlpha.400", "whiteAlpha.400")(props)})`,
|
58
59
|
...baseText("default", props),
|
59
60
|
"&:focus, &:focus-visible, &:active, &:hover": {
|
60
|
-
outline: "solid",
|
61
|
-
outlineWidth: "1px",
|
61
|
+
outline: "1px solid",
|
62
62
|
},
|
63
63
|
...baseBackground("default", props),
|
64
64
|
_hover: {
|
65
|
-
|
65
|
+
...baseBorder("hover", props), // TODO: This is also weird
|
66
66
|
...baseBackground("hover", props),
|
67
|
+
outlineWidth: 1,
|
67
68
|
},
|
68
69
|
_active: {
|
69
|
-
outlineColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
70
70
|
...baseBackground("active", props),
|
71
71
|
},
|
72
72
|
}),
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import { anatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
5
|
-
import { ghostBackground } from "../utils/
|
4
|
+
import { baseBorder } from "../utils/base-utils";
|
5
|
+
import { ghostBackground } from "../utils/ghost-utils";
|
6
|
+
import { surface } from "../utils/surface-utils";
|
6
7
|
|
7
8
|
const parts = anatomy("ListBox").parts(
|
8
9
|
"container",
|
@@ -16,17 +17,14 @@ const helpers = createMultiStyleConfigHelpers(parts.keys);
|
|
16
17
|
const config = helpers.defineMultiStyleConfig({
|
17
18
|
baseStyle: (props) => ({
|
18
19
|
container: {
|
19
|
-
|
20
|
-
backgroundColor: mode(
|
21
|
-
"white",
|
22
|
-
`color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 10%)`,
|
23
|
-
)(props),
|
20
|
+
...surface("default", props),
|
24
21
|
boxShadow: "sm",
|
25
22
|
overflowY: "auto",
|
26
23
|
maxHeight: "50vh",
|
27
24
|
width: "100%",
|
28
25
|
listStyle: "none",
|
29
26
|
borderBottomRadius: "sm",
|
27
|
+
...baseBorder("default", props),
|
30
28
|
},
|
31
29
|
item: {
|
32
30
|
paddingX: 2,
|
@@ -1,6 +1,10 @@
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
2
|
import { anatomy } from "@chakra-ui/theme-tools";
|
3
|
-
import {
|
3
|
+
import { baseText } from "../utils/base-utils";
|
4
|
+
import { brandBackground } from "../utils/brand-utils";
|
5
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
|
+
import { ghostBackground } from "../utils/ghost-utils";
|
7
|
+
import { surface } from "../utils/surface-utils";
|
4
8
|
|
5
9
|
const parts = anatomy("media-controller-button").parts("container", "icon");
|
6
10
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
@@ -19,7 +23,8 @@ const config = helpers.defineMultiStyleConfig({
|
|
19
23
|
display: "flex",
|
20
24
|
padding: 1,
|
21
25
|
alignSelf: "center",
|
22
|
-
color
|
26
|
+
// The SVG icon color is set to the brand background color, due to how SVGs work
|
27
|
+
color: brandBackground("default", props).backgroundColor,
|
23
28
|
...focusVisibleStyles(props),
|
24
29
|
},
|
25
30
|
icon: {
|
@@ -30,51 +35,41 @@ const config = helpers.defineMultiStyleConfig({
|
|
30
35
|
},
|
31
36
|
}),
|
32
37
|
variants: {
|
33
|
-
play: {
|
38
|
+
play: (props) => ({
|
34
39
|
container: {
|
35
40
|
padding: 0,
|
36
41
|
_hover: {
|
37
|
-
color: "
|
42
|
+
color: brandBackground("hover", props).backgroundColor,
|
38
43
|
},
|
39
44
|
_active: {
|
40
|
-
color: "
|
45
|
+
color: brandBackground("active", props).backgroundColor,
|
41
46
|
},
|
42
47
|
|
43
48
|
_disabled: {
|
44
|
-
|
45
|
-
|
46
|
-
color: "silver",
|
47
|
-
},
|
48
|
-
_active: {
|
49
|
-
color: "silver",
|
50
|
-
},
|
49
|
+
pointerEvents: "none",
|
50
|
+
color: surface("disabled", props).backgroundColor,
|
51
51
|
},
|
52
52
|
},
|
53
|
-
},
|
54
|
-
jumpSkip: {
|
53
|
+
}),
|
54
|
+
jumpSkip: (props) => ({
|
55
55
|
container: {
|
56
56
|
_hover: {
|
57
|
-
|
57
|
+
...ghostBackground("hover", props),
|
58
58
|
},
|
59
59
|
_active: {
|
60
|
-
|
60
|
+
...ghostBackground("active", props),
|
61
61
|
},
|
62
62
|
_disabled: {
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
backgroundColor: "platinum",
|
67
|
-
},
|
68
|
-
_active: {
|
69
|
-
backgroundColor: "platinum",
|
70
|
-
},
|
63
|
+
pointerEvents: "none",
|
64
|
+
...surface("disabled", props),
|
65
|
+
...baseText("disabled", props),
|
71
66
|
},
|
72
67
|
},
|
73
68
|
icon: {
|
74
69
|
width: "0.71em",
|
75
70
|
height: "0.71em",
|
76
71
|
},
|
77
|
-
},
|
72
|
+
}),
|
78
73
|
},
|
79
74
|
sizes: {
|
80
75
|
sm: {
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { modalAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import {
|
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,9 +21,9 @@ const config = helpers.defineMultiStyleConfig({
|
|
19
21
|
},
|
20
22
|
dialog: {
|
21
23
|
borderRadius: "md",
|
22
|
-
|
23
|
-
|
24
|
-
|
24
|
+
...bg("default", props),
|
25
|
+
...baseText("default", props),
|
26
|
+
marginY: "3.75rem",
|
25
27
|
zIndex: "modal",
|
26
28
|
maxHeight:
|
27
29
|
props.scrollBehavior === "inside" ? "calc(100% - 7.5rem)" : undefined,
|
@@ -84,11 +86,11 @@ function getSize(value: string): PartsStyleObject<typeof parts> {
|
|
84
86
|
"@supports(min-height: -webkit-fill-available)": {
|
85
87
|
minHeight: "-webkit-fill-available",
|
86
88
|
},
|
87
|
-
|
89
|
+
marginY: 0,
|
88
90
|
},
|
89
91
|
};
|
90
92
|
}
|
91
93
|
return {
|
92
|
-
dialog: {
|
94
|
+
dialog: { maxWidth: value },
|
93
95
|
};
|
94
96
|
}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { anatomy } from "@chakra-ui/anatomy";
|
2
|
+
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
5
|
+
|
6
|
+
const parts = anatomy("NumericStepper").parts(
|
7
|
+
"container",
|
8
|
+
"button",
|
9
|
+
"text",
|
10
|
+
"input",
|
11
|
+
);
|
12
|
+
|
13
|
+
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
14
|
+
|
15
|
+
const config = helpers.defineMultiStyleConfig({
|
16
|
+
baseStyle: (props) => ({
|
17
|
+
container: {
|
18
|
+
display: "flex",
|
19
|
+
flexDirection: "row",
|
20
|
+
alignItems: "center",
|
21
|
+
},
|
22
|
+
input: {
|
23
|
+
fontSize: "sm",
|
24
|
+
fontWeight: "bold",
|
25
|
+
marginX: 1,
|
26
|
+
paddingX: 1,
|
27
|
+
borderRadius: "xs",
|
28
|
+
textAlign: "center",
|
29
|
+
transitionProperty: "common",
|
30
|
+
transitionDuration: "fast",
|
31
|
+
...baseBackground("default", props),
|
32
|
+
...baseText("default", props),
|
33
|
+
|
34
|
+
_disabled: {
|
35
|
+
pointerEvents: "none",
|
36
|
+
opacity: 0.5,
|
37
|
+
},
|
38
|
+
|
39
|
+
_hover: {
|
40
|
+
...baseBorder("default", props),
|
41
|
+
},
|
42
|
+
|
43
|
+
_active: {
|
44
|
+
...baseBackground("active", props),
|
45
|
+
},
|
46
|
+
|
47
|
+
...focusVisibleStyles(props),
|
48
|
+
},
|
49
|
+
text: {
|
50
|
+
fontSize: "sm",
|
51
|
+
fontWeight: "bold",
|
52
|
+
marginX: 1,
|
53
|
+
paddingX: 1,
|
54
|
+
textAlign: "center",
|
55
|
+
width: "4ch",
|
56
|
+
...baseText("default", props),
|
57
|
+
},
|
58
|
+
button: {
|
59
|
+
minWidth: "24px",
|
60
|
+
minHeight: "24px",
|
61
|
+
},
|
62
|
+
}),
|
63
|
+
});
|
64
|
+
|
65
|
+
export default config;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { popoverAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { cssVar, mode } from "@chakra-ui/theme-tools";
|
4
|
-
import { focusVisibleStyles } from "../utils/focus-
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
5
5
|
|
6
6
|
const $popperBg = cssVar("popper-bg");
|
7
7
|
const $arrowBg = cssVar("popper-arrow-bg");
|
@@ -15,19 +15,18 @@ const config = helpers.defineMultiStyleConfig({
|
|
15
15
|
zIndex: "popover",
|
16
16
|
},
|
17
17
|
content: {
|
18
|
-
[$popperBg.variable]: mode(
|
18
|
+
[$popperBg.variable]: mode(
|
19
|
+
"colors.surface.tertiary.light",
|
20
|
+
"colors.surface.tertiary.dark",
|
21
|
+
)(props),
|
19
22
|
backgroundColor: $popperBg.reference,
|
20
23
|
[$arrowBg.variable]: $popperBg.reference,
|
21
|
-
[$arrowShadowColor.variable]: "blackAlpha.300",
|
22
|
-
color: "white",
|
24
|
+
[$arrowShadowColor.variable]: "colors.blackAlpha.300",
|
25
|
+
color: "white", // TODO: Should this be a semantic token? Where does it fit in?
|
23
26
|
borderRadius: "sm",
|
24
27
|
padding: 1.5,
|
25
28
|
zIndex: "inherit",
|
26
29
|
maxWidth: "20em",
|
27
|
-
_focus: {
|
28
|
-
outline: 0,
|
29
|
-
boxShadow: "outline",
|
30
|
-
},
|
31
30
|
},
|
32
31
|
arrow: {
|
33
32
|
backgroundColor: "transparent",
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { anatomy } from "@chakra-ui/anatomy";
|
2
|
+
import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
|
3
|
+
import { mode } from "@chakra-ui/theme-tools";
|
4
|
+
|
5
|
+
const parts = anatomy("progressBar").parts(
|
6
|
+
"container",
|
7
|
+
"background",
|
8
|
+
"progress",
|
9
|
+
"description",
|
10
|
+
);
|
11
|
+
|
12
|
+
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
13
|
+
const config = helpers.defineMultiStyleConfig({
|
14
|
+
baseStyle: (props) => ({
|
15
|
+
container: {
|
16
|
+
minWidth: "100px",
|
17
|
+
},
|
18
|
+
background: {
|
19
|
+
display: "flex",
|
20
|
+
backgroundColor: mode("coralGreen", "pine")(props), // TODO: Replace with semantic tokens
|
21
|
+
borderRadius: "sm",
|
22
|
+
justifyContent: "flex-start",
|
23
|
+
marginX: "auto",
|
24
|
+
},
|
25
|
+
progress: {
|
26
|
+
backgroundColor: mode(
|
27
|
+
"brand.surface.active.light",
|
28
|
+
"brand.surface.active.dark",
|
29
|
+
)(props),
|
30
|
+
borderRadius: "sm",
|
31
|
+
maxWidth: "100%",
|
32
|
+
transition: "width .2s ease-out",
|
33
|
+
},
|
34
|
+
description: {
|
35
|
+
textAlign: "center",
|
36
|
+
marginTop: 2,
|
37
|
+
marginX: "auto",
|
38
|
+
fontWeight: "bold",
|
39
|
+
},
|
40
|
+
}),
|
41
|
+
});
|
42
|
+
|
43
|
+
export default config;
|
@@ -25,11 +25,14 @@ const config = helpers.defineMultiStyleConfig({
|
|
25
25
|
width: 1,
|
26
26
|
"&[aria-current='step']": {
|
27
27
|
circle: {
|
28
|
-
fill: mode(
|
28
|
+
fill: mode(
|
29
|
+
"brand.surface.default.light",
|
30
|
+
"brand.surface.default.dark",
|
31
|
+
)(props),
|
29
32
|
},
|
30
33
|
},
|
31
34
|
circle: {
|
32
|
-
fill: mode("
|
35
|
+
fill: mode("icon.disabled.light", "icon.disabled.dark")(props),
|
33
36
|
},
|
34
37
|
},
|
35
38
|
}),
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { radioAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { focusVisibleStyles } from "../utils/focus-util";
|
4
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
|
+
import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
|
5
|
+
import { brandBackground } from "../utils/brand-utils";
|
6
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
5
7
|
|
6
8
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
7
9
|
|
@@ -11,11 +13,11 @@ const config = helpers.defineMultiStyleConfig({
|
|
11
13
|
_hover: {
|
12
14
|
"input:enabled + .chakra-radio__control": {
|
13
15
|
backgroundColor: "inherit",
|
14
|
-
borderColor: mode("
|
16
|
+
borderColor: mode("text.default.light", "text.default.dark")(props),
|
15
17
|
},
|
16
18
|
"input:enabled:checked + .chakra-radio__control": {
|
17
|
-
color:
|
18
|
-
borderColor:
|
19
|
+
color: brandBackground("hover", props).backgroundColor,
|
20
|
+
borderColor: brandBackground("hover", props).backgroundColor,
|
19
21
|
},
|
20
22
|
},
|
21
23
|
},
|
@@ -28,19 +30,19 @@ const config = helpers.defineMultiStyleConfig({
|
|
28
30
|
height: 4,
|
29
31
|
backgroundColor: "inherit",
|
30
32
|
border: "2px solid",
|
31
|
-
borderColor:
|
33
|
+
borderColor: baseBorder("default", props).outlineColor,
|
32
34
|
borderRadius: "50%",
|
33
35
|
|
34
36
|
...focusVisibleStyles(props),
|
35
37
|
|
36
38
|
_disabled: {
|
37
|
-
|
38
|
-
|
39
|
-
|
39
|
+
...baseBackground("disabled", props),
|
40
|
+
...baseBorder("disabled", props),
|
41
|
+
...baseText("disabled", props),
|
40
42
|
},
|
41
43
|
_checked: {
|
42
|
-
borderColor: mode("pine", "coralGreen")(props),
|
43
44
|
color: mode("pine", "coralGreen")(props),
|
45
|
+
borderColor: "currentColor",
|
44
46
|
_before: {
|
45
47
|
content: `""`,
|
46
48
|
display: "inline-block",
|
@@ -51,9 +53,10 @@ const config = helpers.defineMultiStyleConfig({
|
|
51
53
|
background: "currentColor",
|
52
54
|
},
|
53
55
|
_disabled: {
|
54
|
-
|
55
|
-
|
56
|
-
|
56
|
+
pointerEvents: "none",
|
57
|
+
...baseBackground("disabled", props),
|
58
|
+
...baseBorder("disabled", props),
|
59
|
+
...baseText("disabled", props),
|
57
60
|
},
|
58
61
|
},
|
59
62
|
},
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { selectAnatomy } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import {
|
3
|
+
import { baseText } from "../utils/base-utils";
|
4
4
|
import { default as Input } from "./input";
|
5
5
|
|
6
6
|
const parts = selectAnatomy.extend("root");
|
@@ -44,7 +44,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
44
44
|
strokeLinecap: "round",
|
45
45
|
fontSize: "1.125rem",
|
46
46
|
_disabled: {
|
47
|
-
|
47
|
+
...baseText("disabled", props),
|
48
48
|
},
|
49
49
|
},
|
50
50
|
}),
|
@@ -1,5 +1,8 @@
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
2
|
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
3
|
+
import { baseText } from "../utils/base-utils";
|
4
|
+
import { brandBackground, brandText } from "../utils/brand-utils";
|
5
|
+
import { accentText, accentBackground } from "../utils/accent-utils";
|
3
6
|
|
4
7
|
const parts = anatomy("stepper").parts(
|
5
8
|
"root",
|
@@ -65,26 +68,26 @@ const config = helpers.defineMultiStyleConfig({
|
|
65
68
|
}),
|
66
69
|
accent: (props) => ({
|
67
70
|
root: {
|
68
|
-
backgroundColor: mode("
|
69
|
-
|
71
|
+
backgroundColor: mode("accent.bg.light", "accent.bg.dark")(props),
|
72
|
+
...accentText("default", props),
|
70
73
|
},
|
71
74
|
stepButton: {
|
72
75
|
color:
|
73
76
|
props.state === "disabled"
|
74
|
-
?
|
77
|
+
? baseText("disabled", props).color
|
75
78
|
: props.state === "completed"
|
76
|
-
?
|
77
|
-
:
|
79
|
+
? baseText("default", props).color
|
80
|
+
: brandText("default", props).color,
|
78
81
|
_hover: {
|
79
82
|
backgroundColor:
|
80
83
|
props.state === "disabled"
|
81
84
|
? "transparent"
|
82
|
-
:
|
85
|
+
: accentBackground("hover", props).backgroundColor,
|
83
86
|
},
|
84
87
|
},
|
85
88
|
backButton: {
|
86
89
|
_hover: {
|
87
|
-
|
90
|
+
...brandBackground("hover", props),
|
88
91
|
},
|
89
92
|
},
|
90
93
|
}),
|