@vygruppen/spor-react 8.2.1 → 9.0.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 -12
- package/CHANGELOG.md +34 -0
- package/dist/{CountryCodeSelect-NEASN3EC.mjs → CountryCodeSelect-LFDBAHV7.mjs} +1 -1
- package/dist/{chunk-AKOJGLTQ.mjs → chunk-BWLVKMWU.mjs} +1262 -1785
- package/dist/index.d.mts +1664 -813
- package/dist/index.d.ts +1664 -813
- package/dist/index.js +1551 -2011
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/accordion/Expandable.tsx +22 -2
- package/src/breadcrumb/Breadcrumb.tsx +4 -2
- 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 +56 -63
- 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,9 +1,9 @@
|
|
1
1
|
import { switchAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { calc, cssVar, mode } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
import { focusVisibleStyles } from "../utils/focus-
|
4
|
+
import { baseBackground, baseBorder } from "../utils/base-utils";
|
5
|
+
import { brandBackground } from "../utils/brand-utils";
|
6
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
7
7
|
|
8
8
|
const $width = cssVar("switch-track-width");
|
9
9
|
const $height = cssVar("switch-track-height");
|
@@ -14,7 +14,7 @@ const $translateX = cssVar("switch-thumb-x");
|
|
14
14
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
15
15
|
|
16
16
|
const config = helpers.defineMultiStyleConfig({
|
17
|
-
baseStyle: {
|
17
|
+
baseStyle: (props) => ({
|
18
18
|
container: {
|
19
19
|
[$diff.variable]: diffValue,
|
20
20
|
[$translateX.variable]: $diff.reference,
|
@@ -27,9 +27,30 @@ const config = helpers.defineMultiStyleConfig({
|
|
27
27
|
height: [$height.reference],
|
28
28
|
transitionProperty: "common",
|
29
29
|
transitionDuration: "fast",
|
30
|
+
...baseBackground("default", props),
|
31
|
+
...baseBorder("default", props),
|
32
|
+
...focusVisibleStyles(props),
|
30
33
|
|
34
|
+
_hover: {
|
35
|
+
...baseBackground("hover", props),
|
36
|
+
...baseBorder("hover", props),
|
37
|
+
},
|
38
|
+
_checked: {
|
39
|
+
...brandBackground("default", props),
|
40
|
+
outlineColor: "transparent",
|
41
|
+
|
42
|
+
_hover: {
|
43
|
+
...brandBackground("hover", props),
|
44
|
+
},
|
45
|
+
},
|
31
46
|
_disabled: {
|
32
47
|
pointerEvents: "none",
|
48
|
+
...baseBackground("default", props),
|
49
|
+
...baseBorder("disabled", props),
|
50
|
+
_checked: {
|
51
|
+
...baseBackground("disabled", props),
|
52
|
+
...baseBorder("disabled", props),
|
53
|
+
},
|
33
54
|
},
|
34
55
|
},
|
35
56
|
thumb: {
|
@@ -38,88 +59,20 @@ const config = helpers.defineMultiStyleConfig({
|
|
38
59
|
borderRadius: "50%",
|
39
60
|
width: [$height.reference],
|
40
61
|
height: [$height.reference],
|
41
|
-
_checked: {
|
42
|
-
transform: `translateX(${$translateX.reference})`,
|
43
|
-
},
|
44
|
-
},
|
45
|
-
},
|
46
|
-
variants: {
|
47
|
-
solid: ({ colorMode }) => ({
|
48
|
-
track: {
|
49
|
-
backgroundColor: "osloGrey",
|
50
|
-
boxShadow: mode(
|
51
|
-
"none",
|
52
|
-
getBoxShadowString({
|
53
|
-
borderColor: colors.whiteAlpha[400],
|
54
|
-
}),
|
55
|
-
)({ colorMode }),
|
56
|
-
...focusVisibleStyles({ colorMode }),
|
57
|
-
_hover: {
|
58
|
-
backgroundColor: "steel",
|
59
|
-
boxShadow: mode(
|
60
|
-
"none",
|
61
|
-
getBoxShadowString({ borderColor: colors.white }),
|
62
|
-
)({ colorMode }),
|
63
|
-
},
|
64
|
-
_checked: {
|
65
|
-
backgroundColor: mode("darkTeal", "celadon")({ colorMode }),
|
66
62
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
},
|
74
|
-
},
|
75
|
-
_disabled: {
|
76
|
-
backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
|
77
|
-
boxShadow: mode(
|
78
|
-
"none",
|
79
|
-
getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
|
80
|
-
)({ colorMode }),
|
81
|
-
_checked: {
|
82
|
-
backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
|
83
|
-
boxShadow: mode(
|
84
|
-
"none",
|
85
|
-
getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
|
86
|
-
)({ colorMode }),
|
87
|
-
},
|
88
|
-
},
|
89
|
-
},
|
90
|
-
|
91
|
-
thumb: {
|
92
|
-
backgroundColor: "white",
|
93
|
-
"[data-disabled] &": {
|
94
|
-
backgroundColor: "steel",
|
95
|
-
},
|
63
|
+
backgroundColor: mode("base.icon.light", "base.icon.dark")(props),
|
64
|
+
"[data-disabled] &": {
|
65
|
+
backgroundColor: mode(
|
66
|
+
"icon.disabled.light",
|
67
|
+
"icon.disabled.dark",
|
68
|
+
)(props),
|
96
69
|
},
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
backgroundColor: "platinum",
|
101
|
-
boxShadow: getBoxShadowString({
|
102
|
-
borderColor: colors.blackAlpha["400"],
|
103
|
-
}),
|
104
|
-
_hover: {
|
105
|
-
backgroundColor: "white",
|
106
|
-
},
|
107
|
-
_checked: {
|
108
|
-
backgroundColor: "white",
|
109
|
-
_hover: {
|
110
|
-
backgroundColor: "mint",
|
111
|
-
},
|
112
|
-
},
|
113
|
-
},
|
114
|
-
thumb: {
|
115
|
-
backgroundColor: "osloGrey",
|
116
|
-
|
117
|
-
_checked: {
|
118
|
-
backgroundColor: "darkTeal",
|
119
|
-
},
|
70
|
+
_checked: {
|
71
|
+
backgroundColor: mode("brand.icon.light", "brand.icon.dark")(props),
|
72
|
+
transform: `translateX(${$translateX.reference})`,
|
120
73
|
},
|
121
74
|
},
|
122
|
-
},
|
75
|
+
}),
|
123
76
|
sizes: {
|
124
77
|
sm: {
|
125
78
|
container: {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { tableAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
4
|
+
import { baseBorder, baseText } from "../utils/base-utils";
|
5
5
|
|
6
6
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
7
7
|
|
@@ -12,9 +12,10 @@ const numericStyles = {
|
|
12
12
|
};
|
13
13
|
|
14
14
|
const config = helpers.defineMultiStyleConfig({
|
15
|
-
baseStyle: {
|
15
|
+
baseStyle: (props) => ({
|
16
16
|
table: {
|
17
17
|
borderCollapse: "collapse",
|
18
|
+
...baseText("default", props),
|
18
19
|
width: "100%",
|
19
20
|
},
|
20
21
|
th: {
|
@@ -32,18 +33,15 @@ const config = helpers.defineMultiStyleConfig({
|
|
32
33
|
},
|
33
34
|
},
|
34
35
|
caption: {
|
35
|
-
|
36
|
+
marginTop: 4,
|
36
37
|
fontFamily: "heading",
|
37
38
|
textAlign: "center",
|
38
39
|
fontWeight: "bold",
|
39
40
|
color: "currentColor",
|
40
41
|
},
|
41
|
-
},
|
42
|
+
}),
|
42
43
|
variants: {
|
43
44
|
simple: (props) => ({
|
44
|
-
table: {
|
45
|
-
color: mode("darkGrey", "white")(props),
|
46
|
-
},
|
47
45
|
th: {
|
48
46
|
borderBottom: "sm",
|
49
47
|
borderColor: mode(`blackAlpha.200`, `whiteAlpha.300`)(props),
|
@@ -61,19 +59,19 @@ const config = helpers.defineMultiStyleConfig({
|
|
61
59
|
transitionDuration: "fast",
|
62
60
|
transitionProperty: "background-color, box-shadow",
|
63
61
|
_hover: {
|
64
|
-
|
65
|
-
|
66
|
-
getBoxShadowString({ borderColor: "blueGreen", borderWidth: 3 }),
|
67
|
-
)(props),
|
62
|
+
...baseBorder("hover", props),
|
63
|
+
outlineOffset: "-2px",
|
68
64
|
backgroundColor: mode(
|
69
65
|
props.colorScheme === "grey" ? "mint" : "coralGreen",
|
70
66
|
"whiteAlpha.200",
|
71
67
|
)(props),
|
72
68
|
},
|
69
|
+
_last: {
|
70
|
+
borderBottomRadius: "md",
|
71
|
+
},
|
73
72
|
},
|
74
73
|
},
|
75
74
|
th: {
|
76
|
-
color: mode("darkGrey", "white")(props),
|
77
75
|
border: mode("none", "md"),
|
78
76
|
borderColor: mode("transparent", `whiteAlpha.200`)(props),
|
79
77
|
backgroundColor: mode(`${props.colorScheme}.100`, "darkTeal")(props),
|
@@ -1,7 +1,10 @@
|
|
1
1
|
import { tabsAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { mode, type StyleFunctionProps } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
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";
|
5
8
|
|
6
9
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
7
10
|
|
@@ -16,7 +19,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
16
19
|
alignItems: "center",
|
17
20
|
gap: 0.5,
|
18
21
|
width: props.isFitted ? "fit-content" : "100%",
|
19
|
-
|
22
|
+
borderRadius: "xl",
|
20
23
|
},
|
21
24
|
tab: {
|
22
25
|
display: "flex",
|
@@ -27,40 +30,63 @@ const config = helpers.defineMultiStyleConfig({
|
|
27
30
|
width: props.isFitted ? "fit-content" : "100%",
|
28
31
|
height: "100%",
|
29
32
|
whiteSpace: "nowrap",
|
30
|
-
|
31
|
-
|
33
|
+
borderRadius: "xl",
|
34
|
+
...focusVisibleStyles(props),
|
35
|
+
_disabled: {
|
36
|
+
...baseBackground("disabled", props),
|
37
|
+
...baseText("disabled", props),
|
38
|
+
},
|
32
39
|
_selected: {
|
33
|
-
boxShadow: "md",
|
34
40
|
pointerEvents: "none",
|
35
|
-
...
|
41
|
+
...brandBackground("default", props),
|
42
|
+
...brandText("default", props),
|
43
|
+
_hover: {
|
44
|
+
...brandBackground("hover", props),
|
45
|
+
...brandText("hover", props),
|
46
|
+
},
|
47
|
+
_active: {
|
48
|
+
...brandBackground("active", props),
|
49
|
+
...brandText("active", props),
|
50
|
+
},
|
36
51
|
},
|
37
|
-
...focusVisibleStyles(props),
|
38
|
-
_hover: getTabColorSchemeHoverProps(props),
|
39
|
-
_active: getTabColorSchemeActiveProps(props),
|
40
|
-
_disabled: getTabColorSchemeDisabledProps(props),
|
41
52
|
},
|
42
|
-
tabpanel: {},
|
43
53
|
}),
|
44
54
|
variants: {
|
45
|
-
|
55
|
+
base: (props) => ({
|
46
56
|
tablist: {
|
47
|
-
|
57
|
+
...baseBackground("default", props),
|
58
|
+
...baseText("default", props),
|
59
|
+
...baseBorder("default", props),
|
48
60
|
},
|
49
61
|
tab: {
|
50
|
-
|
62
|
+
...baseText("default", props),
|
63
|
+
_hover: {
|
64
|
+
...baseBorder("hover", props),
|
65
|
+
outlineOffset: "-2px",
|
66
|
+
},
|
67
|
+
_accent: {
|
68
|
+
...baseBackground("active", props),
|
69
|
+
},
|
51
70
|
},
|
52
|
-
},
|
53
|
-
|
71
|
+
}),
|
72
|
+
accent: (props) => ({
|
54
73
|
tablist: {
|
55
|
-
|
74
|
+
backgroundColor: mode("accent.bg.light", "accent.bg.dark")(props),
|
75
|
+
...accentText("default", props),
|
56
76
|
},
|
57
77
|
tab: {
|
58
|
-
|
78
|
+
...accentText("default", props),
|
79
|
+
_hover: {
|
80
|
+
...accentBackground("hover", props),
|
81
|
+
},
|
82
|
+
_accent: {
|
83
|
+
...accentBackground("active", props),
|
84
|
+
},
|
59
85
|
},
|
60
|
-
},
|
86
|
+
}),
|
61
87
|
},
|
62
88
|
sizes: {
|
63
|
-
|
89
|
+
xs: {
|
64
90
|
tablist: {
|
65
91
|
height: "30px",
|
66
92
|
padding: "2px",
|
@@ -70,7 +96,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
70
96
|
paddingY: 0,
|
71
97
|
},
|
72
98
|
},
|
73
|
-
|
99
|
+
sm: {
|
74
100
|
tablist: {
|
75
101
|
height: "36px",
|
76
102
|
padding: 0.5,
|
@@ -79,7 +105,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
79
105
|
paddingX: 2,
|
80
106
|
},
|
81
107
|
},
|
82
|
-
|
108
|
+
md: {
|
83
109
|
tablist: {
|
84
110
|
height: "42px",
|
85
111
|
padding: 0.5,
|
@@ -89,7 +115,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
89
115
|
paddingX: 2,
|
90
116
|
},
|
91
117
|
},
|
92
|
-
|
118
|
+
lg: {
|
93
119
|
tablist: {
|
94
120
|
height: "54px",
|
95
121
|
padding: "4px",
|
@@ -101,267 +127,35 @@ const config = helpers.defineMultiStyleConfig({
|
|
101
127
|
},
|
102
128
|
},
|
103
129
|
defaultProps: {
|
104
|
-
size: "
|
105
|
-
variant: "
|
130
|
+
size: "sm",
|
131
|
+
variant: "base",
|
106
132
|
},
|
107
133
|
});
|
108
134
|
|
109
135
|
export default config;
|
110
136
|
|
111
|
-
const getTabColorSchemeProps = (props: StyleFunctionProps) => {
|
112
|
-
switch (props.colorScheme) {
|
113
|
-
case "dark":
|
114
|
-
return {
|
115
|
-
color: "white",
|
116
|
-
};
|
117
|
-
case "light":
|
118
|
-
return {
|
119
|
-
color: "darkGrey",
|
120
|
-
};
|
121
|
-
case "green":
|
122
|
-
return {
|
123
|
-
color: "darkTeal",
|
124
|
-
};
|
125
|
-
case "grey":
|
126
|
-
return {
|
127
|
-
color: "darkGrey",
|
128
|
-
};
|
129
|
-
case "base":
|
130
|
-
return {
|
131
|
-
color: mode("darkGrey", "white")(props),
|
132
|
-
};
|
133
|
-
case "accent":
|
134
|
-
return {
|
135
|
-
color: mode("darkTeal", "white")(props),
|
136
|
-
};
|
137
|
-
default:
|
138
|
-
return {};
|
139
|
-
}
|
140
|
-
};
|
141
|
-
|
142
|
-
const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
|
143
|
-
switch (props.colorScheme) {
|
144
|
-
case "dark":
|
145
|
-
return {
|
146
|
-
backgroundColor: "white",
|
147
|
-
color: "darkTeal",
|
148
|
-
_focus: {
|
149
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
|
150
|
-
},
|
151
|
-
"&:focus:not(:focus-visible)": {
|
152
|
-
boxShadow: "none",
|
153
|
-
},
|
154
|
-
_focusVisible: {
|
155
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
|
156
|
-
},
|
157
|
-
_hover: {
|
158
|
-
backgroundColor: "white",
|
159
|
-
color: "darkTeal",
|
160
|
-
},
|
161
|
-
_active: {
|
162
|
-
backgroundColor: "white",
|
163
|
-
color: "darkTeal",
|
164
|
-
},
|
165
|
-
};
|
166
|
-
case "base":
|
167
|
-
return {
|
168
|
-
backgroundColor: "pine",
|
169
|
-
color: "white",
|
170
|
-
_hover: {
|
171
|
-
backgroundColor: "darkTeal",
|
172
|
-
color: "white",
|
173
|
-
},
|
174
|
-
_active: {
|
175
|
-
backgroundColor: "darkTeal",
|
176
|
-
color: "white",
|
177
|
-
},
|
178
|
-
};
|
179
|
-
case "accent":
|
180
|
-
return {
|
181
|
-
backgroundColor: "pine",
|
182
|
-
color: "white",
|
183
|
-
_hover: {
|
184
|
-
backgroundColor: "darkTeal",
|
185
|
-
color: "white",
|
186
|
-
},
|
187
|
-
_active: {
|
188
|
-
backgroundColor: "darkTeal",
|
189
|
-
color: "white",
|
190
|
-
},
|
191
|
-
};
|
192
|
-
default:
|
193
|
-
return {
|
194
|
-
backgroundColor: "darkTeal",
|
195
|
-
color: "white",
|
196
|
-
_hover: {
|
197
|
-
backgroundColor: "darkTeal",
|
198
|
-
color: "white",
|
199
|
-
},
|
200
|
-
_active: {
|
201
|
-
backgroundColor: "darkTeal",
|
202
|
-
color: "white",
|
203
|
-
},
|
204
|
-
};
|
205
|
-
}
|
206
|
-
};
|
207
|
-
|
208
|
-
const getTabColorSchemeFocusProps = (props: StyleFunctionProps) => {
|
209
|
-
switch (props.colorScheme) {
|
210
|
-
case "dark":
|
211
|
-
return {
|
212
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.white}`,
|
213
|
-
};
|
214
|
-
case "base":
|
215
|
-
return {
|
216
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
|
217
|
-
};
|
218
|
-
case "accent":
|
219
|
-
return {
|
220
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
|
221
|
-
};
|
222
|
-
default:
|
223
|
-
return {
|
224
|
-
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
|
225
|
-
};
|
226
|
-
}
|
227
|
-
};
|
228
|
-
|
229
137
|
const getTabColorSchemeHoverProps = (props: StyleFunctionProps) => {
|
230
138
|
switch (props.colorScheme) {
|
231
|
-
case "dark":
|
232
|
-
return {
|
233
|
-
backgroundColor: "pine",
|
234
|
-
};
|
235
|
-
case "light":
|
236
|
-
return {
|
237
|
-
backgroundColor: "silver",
|
238
|
-
};
|
239
|
-
case "green":
|
240
|
-
return {
|
241
|
-
backgroundColor: "coralGreen",
|
242
|
-
};
|
243
|
-
case "grey":
|
244
|
-
return {
|
245
|
-
backgroundColor: "silver",
|
246
|
-
};
|
247
139
|
case "base":
|
248
140
|
return {
|
249
|
-
|
250
|
-
`inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
|
251
|
-
`inset 0 0 0 2px ${props.theme.colors.white}`,
|
252
|
-
)(props),
|
253
|
-
color: mode("darkGrey", "white")(props),
|
141
|
+
...baseBorder("hover", props),
|
254
142
|
};
|
255
143
|
case "accent":
|
256
144
|
return {
|
257
|
-
|
258
|
-
color: mode("darkTeal", "white")(props),
|
145
|
+
...accentBackground("hover", props),
|
259
146
|
};
|
260
|
-
default:
|
261
|
-
return {};
|
262
147
|
}
|
263
148
|
};
|
264
149
|
|
265
150
|
const getTabColorSchemeActiveProps = (props: StyleFunctionProps) => {
|
266
151
|
switch (props.colorScheme) {
|
267
|
-
case "dark":
|
268
|
-
return {
|
269
|
-
backgroundColor: "celadon",
|
270
|
-
color: "white",
|
271
|
-
};
|
272
|
-
case "light":
|
273
|
-
return {
|
274
|
-
backgroundColor: "mint",
|
275
|
-
color: "darkGrey",
|
276
|
-
};
|
277
|
-
case "green":
|
278
|
-
return {
|
279
|
-
backgroundColor: "seaMist",
|
280
|
-
color: "darkTeal",
|
281
|
-
};
|
282
|
-
case "grey":
|
283
|
-
return {
|
284
|
-
backgroundColor: "lightGrey",
|
285
|
-
color: "darkGrey",
|
286
|
-
};
|
287
|
-
case "base":
|
288
|
-
return {
|
289
|
-
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
290
|
-
color: mode("darkGrey", "white")(props),
|
291
|
-
};
|
292
|
-
case "accent":
|
293
|
-
return {
|
294
|
-
backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
|
295
|
-
color: mode("darkTeal", "white")(props),
|
296
|
-
};
|
297
|
-
default:
|
298
|
-
return {};
|
299
|
-
}
|
300
|
-
};
|
301
|
-
|
302
|
-
const getTabColorSchemeDisabledProps = (props: StyleFunctionProps) => {
|
303
|
-
switch (props.colorScheme) {
|
304
|
-
case "dark":
|
305
|
-
return {
|
306
|
-
color: "lightAlpha.200",
|
307
|
-
};
|
308
|
-
case "light":
|
309
|
-
return {
|
310
|
-
color: "silver",
|
311
|
-
};
|
312
|
-
case "green":
|
313
|
-
return {
|
314
|
-
color: "coralGreen",
|
315
|
-
};
|
316
|
-
case "grey":
|
317
|
-
return {
|
318
|
-
color: "steel",
|
319
|
-
};
|
320
|
-
case "base":
|
321
|
-
return {
|
322
|
-
color: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
323
|
-
};
|
324
|
-
case "accent":
|
325
|
-
return {
|
326
|
-
color: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
327
|
-
};
|
328
|
-
default:
|
329
|
-
return {};
|
330
|
-
}
|
331
|
-
};
|
332
|
-
|
333
|
-
const getTablistColorSchemeProps = (props: StyleFunctionProps) => {
|
334
|
-
switch (props.colorScheme) {
|
335
|
-
case "dark":
|
336
|
-
return { backgroundColor: "darkTeal", color: "white" };
|
337
|
-
case "light":
|
338
|
-
return {
|
339
|
-
backgroundColor: "white",
|
340
|
-
color: "darkGrey",
|
341
|
-
boxShadow: `inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`,
|
342
|
-
};
|
343
|
-
case "green":
|
344
|
-
return { backgroundColor: "mint", color: "darkTeal" };
|
345
|
-
case "grey":
|
346
|
-
return {
|
347
|
-
backgroundColor: "platinum",
|
348
|
-
color: "darkGrey",
|
349
|
-
};
|
350
152
|
case "base":
|
351
153
|
return {
|
352
|
-
|
353
|
-
color: "darkGrey",
|
354
|
-
boxShadow: mode(
|
355
|
-
`inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`,
|
356
|
-
`inset 0 0 0 1px ${props.theme.colors.whiteAlpha["400"]}`,
|
357
|
-
)(props),
|
154
|
+
...baseBackground("active", props),
|
358
155
|
};
|
359
156
|
case "accent":
|
360
157
|
return {
|
361
|
-
|
362
|
-
color: "darkTeal",
|
158
|
+
...accentBackground("active", props),
|
363
159
|
};
|
364
|
-
default:
|
365
|
-
return {};
|
366
160
|
}
|
367
161
|
};
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
2
2
|
import type { StyleFunctionProps } from "@chakra-ui/theme-tools";
|
3
3
|
import { anatomy, mode } from "@chakra-ui/theme-tools";
|
4
|
-
import {
|
5
|
-
import { focusVisibleStyles } from "../utils/focus-util";
|
4
|
+
import { focusVisibleStyles } from "../utils/focus-utils";
|
6
5
|
|
7
6
|
const parts = anatomy("travel-tag").parts(
|
8
7
|
"container",
|
@@ -31,11 +30,9 @@ const config = helpers.defineMultiStyleConfig({
|
|
31
30
|
backgroundColor: "silver",
|
32
31
|
},
|
33
32
|
"button&, a&": {
|
33
|
+
boxShadow: "sm",
|
34
34
|
_hover: {
|
35
|
-
boxShadow:
|
36
|
-
borderColor: props.theme.colors.blackAlpha[100],
|
37
|
-
baseShadow: "sm",
|
38
|
-
}),
|
35
|
+
boxShadow: "md",
|
39
36
|
},
|
40
37
|
...focusVisibleStyles(props),
|
41
38
|
_active: {
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import tokens from "@vygruppen/spor-design-tokens";
|
2
2
|
|
3
3
|
export type ColorsType = typeof tokens.color.alias &
|
4
|
-
typeof tokens.color.palette &
|
4
|
+
typeof tokens.color.palette &
|
5
|
+
typeof tokens.color.vyDigital & { linjetag: typeof tokens.color.linjetag };
|
5
6
|
|
6
7
|
export const colors: ColorsType = {
|
7
8
|
...tokens.color.alias,
|
8
9
|
...tokens.color.palette,
|
10
|
+
...tokens.color.vyDigital,
|
9
11
|
linjetag: tokens.color.linjetag,
|
10
12
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import tokens from "@vygruppen/spor-design-tokens";
|
2
2
|
|
3
3
|
export const fonts = {
|
4
|
-
body: `${tokens.font.family.body}, sans-serif`,
|
5
|
-
heading: `${tokens.font.family.heading}, sans-serif`,
|
4
|
+
body: `${tokens.font.family.body}, arial, sans-serif`,
|
5
|
+
heading: `${tokens.font.family.heading}, arial, sans-serif`,
|
6
6
|
mono: `${tokens.font.family.monospace}, monospace`,
|
7
7
|
};
|
package/src/theme/index.ts
CHANGED
@@ -17,14 +17,17 @@ export const theme = {
|
|
17
17
|
};
|
18
18
|
|
19
19
|
export const brandTheme = {
|
20
|
-
[Brand.VyDigital]: {
|
21
|
-
colors: {
|
22
|
-
accent: foundations.colors.night,
|
23
|
-
},
|
24
|
-
},
|
20
|
+
[Brand.VyDigital]: {},
|
25
21
|
[Brand.VyUtvikling]: {
|
26
22
|
colors: {
|
27
|
-
accent:
|
23
|
+
accent: {
|
24
|
+
surface: {
|
25
|
+
default: {
|
26
|
+
light: foundations.colors.seaMist,
|
27
|
+
dark: foundations.colors.darkGrey,
|
28
|
+
},
|
29
|
+
},
|
30
|
+
},
|
28
31
|
},
|
29
32
|
},
|
30
33
|
};
|