@vygruppen/spor-react 4.0.3 → 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 +20 -0
- package/dist/{CountryCodeSelect-RUH47EQH.mjs → CountryCodeSelect-FBKDO5JS.mjs} +1 -1
- package/dist/{chunk-XT6QVKN5.mjs → chunk-FPWAXD72.mjs} +144 -217
- package/dist/index.d.mts +17 -93
- package/dist/index.d.ts +17 -93
- package/dist/index.js +145 -218
- 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 +5 -5
- 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 +2 -4
- 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
@@ -51,7 +51,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
51
51
|
"none",
|
52
52
|
getBoxShadowString({
|
53
53
|
borderColor: colors.whiteAlpha[400],
|
54
|
-
})
|
54
|
+
}),
|
55
55
|
)({ colorMode }),
|
56
56
|
|
57
57
|
...focusVisible({
|
@@ -73,7 +73,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
73
73
|
borderColor: "coralGreen",
|
74
74
|
borderWidth: 2,
|
75
75
|
isInset: false,
|
76
|
-
})
|
76
|
+
}),
|
77
77
|
)({ colorMode }),
|
78
78
|
},
|
79
79
|
notFocus: {
|
@@ -81,7 +81,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
81
81
|
"none",
|
82
82
|
getBoxShadowString({
|
83
83
|
borderColor: colors.whiteAlpha[400],
|
84
|
-
})
|
84
|
+
}),
|
85
85
|
)({ colorMode }),
|
86
86
|
},
|
87
87
|
}),
|
@@ -89,7 +89,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
89
89
|
backgroundColor: "steel",
|
90
90
|
boxShadow: mode(
|
91
91
|
"none",
|
92
|
-
getBoxShadowString({ borderColor: colors.white })
|
92
|
+
getBoxShadowString({ borderColor: colors.white }),
|
93
93
|
)({ colorMode }),
|
94
94
|
},
|
95
95
|
_checked: {
|
@@ -113,13 +113,13 @@ const config = helpers.defineMultiStyleConfig({
|
|
113
113
|
borderWidth: 2,
|
114
114
|
borderColor: "coralGreen",
|
115
115
|
isInset: false,
|
116
|
-
})
|
116
|
+
}),
|
117
117
|
)({ colorMode }),
|
118
118
|
},
|
119
119
|
notFocus: {
|
120
120
|
boxShadow: mode(
|
121
121
|
"none",
|
122
|
-
getBoxShadowString({ borderColor: colors.white })
|
122
|
+
getBoxShadowString({ borderColor: colors.white }),
|
123
123
|
)({ colorMode }),
|
124
124
|
},
|
125
125
|
}),
|
@@ -128,7 +128,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
128
128
|
backgroundColor: mode("pine", "river")({ colorMode }),
|
129
129
|
boxShadow: mode(
|
130
130
|
"none",
|
131
|
-
getBoxShadowString({ borderColor: colors.white })
|
131
|
+
getBoxShadowString({ borderColor: colors.white }),
|
132
132
|
)({ colorMode }),
|
133
133
|
},
|
134
134
|
},
|
@@ -136,13 +136,13 @@ const config = helpers.defineMultiStyleConfig({
|
|
136
136
|
backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
|
137
137
|
boxShadow: mode(
|
138
138
|
"none",
|
139
|
-
getBoxShadowString({ borderColor: colors.whiteAlpha[400] })
|
139
|
+
getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
|
140
140
|
)({ colorMode }),
|
141
141
|
_checked: {
|
142
142
|
backgroundColor: mode("platinum", "dimGrey")({ colorMode }),
|
143
143
|
boxShadow: mode(
|
144
144
|
"none",
|
145
|
-
getBoxShadowString({ borderColor: colors.whiteAlpha[400] })
|
145
|
+
getBoxShadowString({ borderColor: colors.whiteAlpha[400] }),
|
146
146
|
)({ colorMode }),
|
147
147
|
},
|
148
148
|
},
|
@@ -63,11 +63,11 @@ const config = helpers.defineMultiStyleConfig({
|
|
63
63
|
_hover: {
|
64
64
|
boxShadow: mode(
|
65
65
|
getBoxShadowString({ borderColor: "darkTeal", borderWidth: 3 }),
|
66
|
-
getBoxShadowString({ borderColor: "blueGreen", borderWidth: 3 })
|
66
|
+
getBoxShadowString({ borderColor: "blueGreen", borderWidth: 3 }),
|
67
67
|
)(props),
|
68
68
|
backgroundColor: mode(
|
69
69
|
props.colorScheme === "grey" ? "mint" : "coralGreen",
|
70
|
-
"whiteAlpha.200"
|
70
|
+
"whiteAlpha.200",
|
71
71
|
)(props),
|
72
72
|
},
|
73
73
|
},
|
@@ -83,7 +83,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
83
83
|
border: mode("sm", "md"),
|
84
84
|
borderColor: mode(
|
85
85
|
props.colorScheme === "grey" ? "silver" : "blackAlpha.200",
|
86
|
-
"whiteAlpha.200"
|
86
|
+
"whiteAlpha.200",
|
87
87
|
)(props),
|
88
88
|
...numericStyles,
|
89
89
|
_first: {
|
@@ -178,7 +178,7 @@ const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
|
|
178
178
|
backgroundColor: "darkTeal",
|
179
179
|
color: "white",
|
180
180
|
},
|
181
|
-
}
|
181
|
+
};
|
182
182
|
case "accent":
|
183
183
|
return {
|
184
184
|
backgroundColor: "pine",
|
@@ -191,7 +191,7 @@ const getTabColorSchemeSelectedProps = (props: StyleFunctionProps) => {
|
|
191
191
|
backgroundColor: "darkTeal",
|
192
192
|
color: "white",
|
193
193
|
},
|
194
|
-
}
|
194
|
+
};
|
195
195
|
default:
|
196
196
|
return {
|
197
197
|
backgroundColor: "darkTeal",
|
@@ -217,11 +217,11 @@ const getTabColorSchemeFocusProps = (props: StyleFunctionProps) => {
|
|
217
217
|
case "base":
|
218
218
|
return {
|
219
219
|
boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
|
220
|
-
}
|
220
|
+
};
|
221
221
|
case "accent":
|
222
222
|
return {
|
223
223
|
boxShadow: `inset 0 0 0 2px ${props.theme.colors.azure}`,
|
224
|
-
}
|
224
|
+
};
|
225
225
|
default:
|
226
226
|
return {
|
227
227
|
boxShadow: `inset 0 0 0 2px ${props.theme.colors.greenHaze}`,
|
@@ -249,13 +249,16 @@ const getTabColorSchemeHoverProps = (props: StyleFunctionProps) => {
|
|
249
249
|
};
|
250
250
|
case "base":
|
251
251
|
return {
|
252
|
-
boxShadow: mode(
|
253
|
-
|
252
|
+
boxShadow: mode(
|
253
|
+
`inset 0 0 0 2px ${props.theme.colors.darkGrey}`,
|
254
|
+
`inset 0 0 0 2px ${props.theme.colors.white}`,
|
255
|
+
)(props),
|
256
|
+
color: mode("darkGrey", "white")(props),
|
254
257
|
};
|
255
258
|
case "accent":
|
256
259
|
return {
|
257
260
|
backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
|
258
|
-
color: mode("darkTeal", "white")(props)
|
261
|
+
color: mode("darkTeal", "white")(props),
|
259
262
|
};
|
260
263
|
default:
|
261
264
|
return {};
|
@@ -318,13 +321,13 @@ const getTabColorSchemeDisabledProps = (props: StyleFunctionProps) => {
|
|
318
321
|
color: "steel",
|
319
322
|
};
|
320
323
|
case "base":
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
324
|
+
return {
|
325
|
+
color: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
326
|
+
};
|
327
|
+
case "accent":
|
328
|
+
return {
|
329
|
+
color: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
330
|
+
};
|
328
331
|
default:
|
329
332
|
return {};
|
330
333
|
}
|
@@ -351,12 +354,15 @@ const getTablistColorSchemeProps = (props: StyleFunctionProps) => {
|
|
351
354
|
return {
|
352
355
|
backgroundColor: mode("white", "transparent")(props),
|
353
356
|
color: "darkGrey",
|
354
|
-
boxShadow: mode(
|
357
|
+
boxShadow: mode(
|
358
|
+
`inset 0 0 0 1px ${props.theme.colors.blackAlpha["400"]}`,
|
359
|
+
`inset 0 0 0 1px ${props.theme.colors.whiteAlpha["400"]}`,
|
360
|
+
)(props),
|
355
361
|
};
|
356
362
|
case "accent":
|
357
|
-
return {
|
358
|
-
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
359
|
-
color: "darkTeal"
|
363
|
+
return {
|
364
|
+
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
365
|
+
color: "darkTeal",
|
360
366
|
};
|
361
367
|
default:
|
362
368
|
return {};
|
@@ -11,7 +11,7 @@ const parts = anatomy("travel-tag").parts(
|
|
11
11
|
"textContainer",
|
12
12
|
"title",
|
13
13
|
"description",
|
14
|
-
"deviationIcon"
|
14
|
+
"deviationIcon",
|
15
15
|
);
|
16
16
|
|
17
17
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
@@ -166,7 +166,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
166
166
|
title: {
|
167
167
|
fontSize: "mobile.xs",
|
168
168
|
fontWeight: "normal",
|
169
|
-
color: mode("black", "white")(props)
|
169
|
+
color: mode("black", "white")(props),
|
170
170
|
},
|
171
171
|
description: {
|
172
172
|
display: "none",
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import {StyleFunctionProps, mode} from "@chakra-ui/theme-tools";
|
1
|
+
import { StyleFunctionProps, mode } from "@chakra-ui/theme-tools";
|
2
2
|
|
3
3
|
export const styles = {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
}
|
4
|
+
global: (props: StyleFunctionProps | Record<string, any>) => ({
|
5
|
+
"html, body": {
|
6
|
+
color: mode("darkGrey", "lightGrey")(props),
|
7
|
+
},
|
8
|
+
svg: {
|
9
|
+
display: "initial",
|
10
|
+
},
|
11
|
+
}),
|
12
|
+
};
|
@@ -11,7 +11,7 @@ type GetBoxShadowStringArgs = {
|
|
11
11
|
* A utility for creating box shadow strings
|
12
12
|
*/
|
13
13
|
export const getBoxShadowString = (
|
14
|
-
args: GetBoxShadowStringArgs | GetBoxShadowStringArgs[]
|
14
|
+
args: GetBoxShadowStringArgs | GetBoxShadowStringArgs[],
|
15
15
|
): string => {
|
16
16
|
if (Array.isArray(args)) {
|
17
17
|
return args.map((arg) => getBoxShadowString(arg)).join(", ");
|
@@ -34,7 +34,7 @@ export const getBoxShadowString = (
|
|
34
34
|
}
|
35
35
|
}
|
36
36
|
allShadows.push(
|
37
|
-
`${isInset ? "inset " : ""}0 0 0 ${borderWidth}px ${color}
|
37
|
+
`${isInset ? "inset " : ""}0 0 0 ${borderWidth}px ${color}`,
|
38
38
|
);
|
39
39
|
}
|
40
40
|
if (baseShadow) {
|
@@ -6,21 +6,21 @@ import { BaseToast } from "./BaseToast";
|
|
6
6
|
describe("<BaseToast />", () => {
|
7
7
|
it("is accessible in variant success", async () => {
|
8
8
|
const { container } = render(
|
9
|
-
<BaseToast variant="success">Test text</BaseToast
|
9
|
+
<BaseToast variant="success">Test text</BaseToast>,
|
10
10
|
);
|
11
11
|
expect(await axe(container)).toHaveNoViolations();
|
12
12
|
});
|
13
13
|
|
14
14
|
it("is accessible in variant info", async () => {
|
15
15
|
const { container } = render(
|
16
|
-
<BaseToast variant="info">Test text</BaseToast
|
16
|
+
<BaseToast variant="info">Test text</BaseToast>,
|
17
17
|
);
|
18
18
|
expect(await axe(container)).toHaveNoViolations();
|
19
19
|
});
|
20
20
|
|
21
21
|
it("is accessible in variant error", async () => {
|
22
22
|
const { container } = render(
|
23
|
-
<BaseToast variant="error">Test text</BaseToast
|
23
|
+
<BaseToast variant="error">Test text</BaseToast>,
|
24
24
|
);
|
25
25
|
expect(await axe(container)).toHaveNoViolations();
|
26
26
|
});
|
@@ -9,7 +9,7 @@ describe("<ClosableToast />", () => {
|
|
9
9
|
const { getByRole } = render(
|
10
10
|
<ClosableToast variant="success" onClose={handleClick}>
|
11
11
|
Test text
|
12
|
-
</ClosableToast
|
12
|
+
</ClosableToast>,
|
13
13
|
);
|
14
14
|
getByRole("button").click();
|
15
15
|
expect(handleClick).toHaveBeenCalled();
|
package/src/toast/index.tsx
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from "./useToast";
|
1
|
+
export * from "./useToast";
|
package/src/toast/useToast.tsx
CHANGED
@@ -31,8 +31,8 @@ type BaseToastOptions = {
|
|
31
31
|
duration?: number;
|
32
32
|
};
|
33
33
|
|
34
|
-
export type ToastOptions =
|
35
|
-
|
34
|
+
export type ToastOptions = BaseToastOptions &
|
35
|
+
(ClosableToastOptions | ActionToastOptions | {});
|
36
36
|
|
37
37
|
/**
|
38
38
|
* Creates a function that can trigger toasts
|
@@ -96,4 +96,4 @@ const getToastComponent = (opts: ToastOptions) => {
|
|
96
96
|
{opts.text}
|
97
97
|
</BaseToast>
|
98
98
|
);
|
99
|
-
};
|
99
|
+
};
|
package/src/typography/Badge.tsx
CHANGED
package/src/typography/Text.tsx
CHANGED