@vygruppen/spor-react 13.0.0 → 13.0.2
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/.turbo/turbo-postinstall.log +4 -6
- package/CHANGELOG.md +15 -0
- package/dist/index.cjs +97 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -85
- package/dist/index.d.ts +85 -85
- package/dist/index.mjs +97 -134
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/accordion/Accordion.tsx +3 -3
- package/src/accordion/Expandable.tsx +1 -1
- package/src/alert/Alert.tsx +1 -1
- package/src/alert/AlertIcon.tsx +1 -57
- package/src/alert/ExpandableAlert.tsx +1 -1
- package/src/alert/ServiceAlert.tsx +1 -1
- package/src/breadcrumb/Breadcrumb.tsx +1 -1
- package/src/button/Button.tsx +1 -1
- package/src/button/ButtonGroup.tsx +1 -1
- package/src/button/Clipboard.tsx +3 -3
- package/src/button/CloseButton.tsx +1 -1
- package/src/button/FloatingActionButton.tsx +1 -1
- package/src/button/IconButton.tsx +1 -1
- package/src/calendar/CalendarContext.tsx +1 -1
- package/src/color-mode/color-mode.tsx +1 -1
- package/src/datepicker/CalendarTriggerButton.tsx +1 -1
- package/src/datepicker/DateField.tsx +1 -1
- package/src/datepicker/DatePicker.tsx +1 -1
- package/src/datepicker/DateTimeSegment.tsx +1 -1
- package/src/datepicker/StyledField.tsx +1 -1
- package/src/dialog/Dialog.tsx +2 -2
- package/src/dialog/Drawer.tsx +4 -4
- package/src/input/AttachedInputs.tsx +1 -1
- package/src/input/Autocomplete.tsx +1 -1
- package/src/input/CardSelect.tsx +2 -2
- package/src/input/Checkbox.tsx +1 -1
- package/src/input/ChoiceChip.tsx +1 -1
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/Field.tsx +2 -2
- package/src/input/FloatingLabel.tsx +1 -1
- package/src/input/Input.tsx +1 -1
- package/src/input/NativeSelect.tsx +1 -1
- package/src/input/NumericStepper.tsx +2 -2
- package/src/input/PasswordInput.tsx +2 -2
- package/src/input/PhoneNumberInput.tsx +1 -1
- package/src/input/Popover.tsx +1 -1
- package/src/input/Radio.tsx +2 -2
- package/src/input/SearchInput.tsx +1 -1
- package/src/input/Select.tsx +7 -7
- package/src/input/Switch.tsx +10 -2
- package/src/input/Textarea.tsx +1 -1
- package/src/input/useFLoatingInputState.tsx +1 -1
- package/src/layout/PressableCard.tsx +1 -1
- package/src/layout/RadioCard.tsx +2 -2
- package/src/layout/Separator.tsx +2 -2
- package/src/layout/StaticCard.tsx +1 -1
- package/src/linjetag/LineIcon.tsx +1 -1
- package/src/linjetag/TravelTag.tsx +1 -1
- package/src/link/TextLink.tsx +1 -1
- package/src/loader/ProgressBar.tsx +1 -1
- package/src/loader/ProgressLoader.tsx +1 -1
- package/src/loader/Skeleton.tsx +1 -1
- package/src/logo/CargonetLogo.tsx +1 -1
- package/src/logo/VyLogo.tsx +1 -1
- package/src/logo/VyLogoPride.tsx +1 -1
- package/src/media-controller/JumpButton.tsx +1 -1
- package/src/media-controller/PlayPauseButton.tsx +1 -1
- package/src/media-controller/SkipButton.tsx +1 -1
- package/src/nudge/Nudge.tsx +3 -3
- package/src/pagination/Pagination.tsx +5 -5
- package/src/popover/index.tsx +2 -2
- package/src/progress-indicator/ProgressIndicator.tsx +1 -1
- package/src/stepper/Stepper.tsx +1 -1
- package/src/tab/Tabs.tsx +1 -1
- package/src/theme/recipes/link.ts +1 -0
- package/src/toast/toast.tsx +5 -2
- package/src/tooltip.tsx +2 -2
- package/src/typography/Badge.tsx +1 -1
- package/src/typography/Code.tsx +1 -1
- package/src/typography/Heading.tsx +1 -1
- package/src/typography/Text.tsx +1 -1
package/src/input/Switch.tsx
CHANGED
|
@@ -49,7 +49,7 @@ export const Switch = ({
|
|
|
49
49
|
ref,
|
|
50
50
|
...props
|
|
51
51
|
}: SwitchProps & {
|
|
52
|
-
ref?: React.
|
|
52
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
53
53
|
}) => {
|
|
54
54
|
const {
|
|
55
55
|
rootRef,
|
|
@@ -59,6 +59,9 @@ export const Switch = ({
|
|
|
59
59
|
errorText,
|
|
60
60
|
helperText,
|
|
61
61
|
css,
|
|
62
|
+
"aria-label": ariaLabel,
|
|
63
|
+
"aria-labelledby": ariaLabelledby,
|
|
64
|
+
"aria-describedby": ariaDescribedby,
|
|
62
65
|
...rest
|
|
63
66
|
} = props;
|
|
64
67
|
const recipe = useSlotRecipe({ key: "switch" });
|
|
@@ -80,7 +83,12 @@ export const Switch = ({
|
|
|
80
83
|
checked={props.checked}
|
|
81
84
|
css={styles.root}
|
|
82
85
|
>
|
|
83
|
-
<ChakraSwitch.HiddenInput
|
|
86
|
+
<ChakraSwitch.HiddenInput
|
|
87
|
+
ref={ref}
|
|
88
|
+
aria-label={ariaLabel}
|
|
89
|
+
aria-labelledby={ariaLabelledby}
|
|
90
|
+
aria-describedby={ariaDescribedby}
|
|
91
|
+
/>
|
|
84
92
|
<ChakraSwitch.Control css={styles.control}>
|
|
85
93
|
<ChakraSwitch.Thumb />
|
|
86
94
|
</ChakraSwitch.Control>
|
package/src/input/Textarea.tsx
CHANGED
|
@@ -8,7 +8,7 @@ export type UseFloatingInputStateProps<
|
|
|
8
8
|
onFocus?: (event: FocusEvent<T>) => void;
|
|
9
9
|
onBlur?: (event: FocusEvent<T>) => void;
|
|
10
10
|
onChange?: (event: ChangeEvent<T>) => void;
|
|
11
|
-
inputRef?: React.
|
|
11
|
+
inputRef?: React.Ref<T>;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export function useFloatingInputState<
|
|
@@ -45,7 +45,7 @@ export const PressableCard = ({
|
|
|
45
45
|
ref,
|
|
46
46
|
...props
|
|
47
47
|
}: PressableCardProps & {
|
|
48
|
-
ref?: React.
|
|
48
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
49
49
|
}) => {
|
|
50
50
|
const recipe = useRecipe({ key: "pressableCard" });
|
|
51
51
|
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
package/src/layout/RadioCard.tsx
CHANGED
|
@@ -42,7 +42,7 @@ export const RadioCard = ({
|
|
|
42
42
|
ref,
|
|
43
43
|
...props
|
|
44
44
|
}: RadioCardItemProps & {
|
|
45
|
-
ref?: React.
|
|
45
|
+
ref?: React.Ref<HTMLInputElement>;
|
|
46
46
|
}) => {
|
|
47
47
|
const { inputProps, children } = props;
|
|
48
48
|
const uniqueId = useId();
|
|
@@ -79,7 +79,7 @@ export const RadioCardGroup = ({
|
|
|
79
79
|
ref,
|
|
80
80
|
...props
|
|
81
81
|
}: RadioCardRootProps & {
|
|
82
|
-
ref?: React.
|
|
82
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
83
83
|
}) => {
|
|
84
84
|
const {
|
|
85
85
|
children,
|
package/src/layout/Separator.tsx
CHANGED
|
@@ -9,7 +9,7 @@ export const Separator = ({
|
|
|
9
9
|
ref,
|
|
10
10
|
...props
|
|
11
11
|
}: ChakraSeparatorProps & {
|
|
12
|
-
ref?: React.
|
|
12
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
13
13
|
}) => {
|
|
14
|
-
return <ChakraSeparator {...props} ref={ref} data- />;
|
|
14
|
+
return <ChakraSeparator aria-hidden="true" {...props} ref={ref} data- />;
|
|
15
15
|
};
|
|
@@ -47,7 +47,7 @@ export const StaticCard = ({
|
|
|
47
47
|
ref,
|
|
48
48
|
...props
|
|
49
49
|
}: StaticCardProps & {
|
|
50
|
-
ref?: React.
|
|
50
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
51
51
|
}) => {
|
|
52
52
|
const recipe = useRecipe({ key: "staticCard" });
|
|
53
53
|
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
|
@@ -74,7 +74,7 @@ export const LineIcon = function LineIcon({
|
|
|
74
74
|
label,
|
|
75
75
|
...rest
|
|
76
76
|
}: LineIconProps & {
|
|
77
|
-
ref?: React.
|
|
77
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
78
78
|
}) {
|
|
79
79
|
const recipe = useSlotRecipe({ key: "lineIcon" });
|
|
80
80
|
const styles = recipe({ variant, size, ...rest });
|
|
@@ -141,7 +141,7 @@ export const TravelTag = function TravelTag({
|
|
|
141
141
|
customIconVariant,
|
|
142
142
|
...rest
|
|
143
143
|
}: TravelTagProps & {
|
|
144
|
-
ref?: React.
|
|
144
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
145
145
|
}) {
|
|
146
146
|
const recipie = useSlotRecipe({ key: "travelTag" });
|
|
147
147
|
const styles = recipie({
|
package/src/link/TextLink.tsx
CHANGED
|
@@ -96,7 +96,7 @@ export const ProgressLoader = ({
|
|
|
96
96
|
width,
|
|
97
97
|
...rest
|
|
98
98
|
}: ProgressLoaderProps & {
|
|
99
|
-
ref?: React.
|
|
99
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
100
100
|
}) => {
|
|
101
101
|
const { t } = useTranslation();
|
|
102
102
|
const currentLoadingText = useRotatingLabel({
|
package/src/loader/Skeleton.tsx
CHANGED
|
@@ -13,7 +13,7 @@ export const CargonetLogo = ({
|
|
|
13
13
|
ref,
|
|
14
14
|
...props
|
|
15
15
|
}: CargonetLogoProps & {
|
|
16
|
-
ref?: React.
|
|
16
|
+
ref?: React.Ref<SVGSVGElement>;
|
|
17
17
|
}) => {
|
|
18
18
|
const { colorPalette } = props;
|
|
19
19
|
// These colors should not be tokenized, as they are logo specific.
|
package/src/logo/VyLogo.tsx
CHANGED
package/src/logo/VyLogoPride.tsx
CHANGED
package/src/nudge/Nudge.tsx
CHANGED
|
@@ -70,7 +70,7 @@ export const NudgeTrigger = ({
|
|
|
70
70
|
ref,
|
|
71
71
|
...props
|
|
72
72
|
}: ChakraPopover.TriggerProps & {
|
|
73
|
-
ref?: React.
|
|
73
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
74
74
|
}) => {
|
|
75
75
|
return <PopoverTrigger {...props} ref={ref} />;
|
|
76
76
|
};
|
|
@@ -81,7 +81,7 @@ export const NudgeContent = ({
|
|
|
81
81
|
children,
|
|
82
82
|
...props
|
|
83
83
|
}: PopoverProps & {
|
|
84
|
-
ref?: React.
|
|
84
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
85
85
|
}) => {
|
|
86
86
|
const [currentStep, setCurrentStep] = useState(1);
|
|
87
87
|
const childrenArray = React.Children.toArray(children); // Convert children to an array
|
|
@@ -206,7 +206,7 @@ export const NudgeCloseTrigger = ({
|
|
|
206
206
|
children,
|
|
207
207
|
...props
|
|
208
208
|
}: ChakraPopover.TriggerProps & {
|
|
209
|
-
ref?: React.
|
|
209
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
210
210
|
}) => {
|
|
211
211
|
const isStringChild = typeof children === "string";
|
|
212
212
|
|
|
@@ -41,7 +41,7 @@ export const Pagination = ({
|
|
|
41
41
|
ref,
|
|
42
42
|
...props
|
|
43
43
|
}: PaginationRootProps & {
|
|
44
|
-
ref?: React.
|
|
44
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
45
45
|
}) => {
|
|
46
46
|
const { getHref, children, ...rest } = props;
|
|
47
47
|
const recipe = useSlotRecipe({ key: "pagination" });
|
|
@@ -68,7 +68,7 @@ export const PaginationEllipsis = ({
|
|
|
68
68
|
ref,
|
|
69
69
|
...props
|
|
70
70
|
}: ChakraPagination.EllipsisProps & {
|
|
71
|
-
ref?: React.
|
|
71
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
72
72
|
}) => {
|
|
73
73
|
return (
|
|
74
74
|
<ListItem>
|
|
@@ -83,7 +83,7 @@ export const PaginationItem = ({
|
|
|
83
83
|
ref,
|
|
84
84
|
...props
|
|
85
85
|
}: ChakraPagination.ItemProps & {
|
|
86
|
-
ref?: React.
|
|
86
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
87
87
|
}) => {
|
|
88
88
|
const rootProps = useRootProps();
|
|
89
89
|
const { t } = useTranslation();
|
|
@@ -128,7 +128,7 @@ export const PaginationPrevTrigger = ({
|
|
|
128
128
|
ref,
|
|
129
129
|
...props
|
|
130
130
|
}: ChakraPagination.PrevTriggerProps & {
|
|
131
|
-
ref?: React.
|
|
131
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
132
132
|
}) => {
|
|
133
133
|
const { page } = usePaginationContext();
|
|
134
134
|
const recipe = useSlotRecipe({ key: "pagination" });
|
|
@@ -178,7 +178,7 @@ export const PaginationNextTrigger = ({
|
|
|
178
178
|
ref,
|
|
179
179
|
...props
|
|
180
180
|
}: ChakraPagination.NextTriggerProps & {
|
|
181
|
-
ref?: React.
|
|
181
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
182
182
|
}) => {
|
|
183
183
|
const { page, totalPages } = usePaginationContext();
|
|
184
184
|
const recipe = useSlotRecipe({ key: "pagination" });
|
package/src/popover/index.tsx
CHANGED
|
@@ -17,7 +17,7 @@ export const PopoverTrigger = ({
|
|
|
17
17
|
children,
|
|
18
18
|
...props
|
|
19
19
|
}: ChakraPopover.TriggerProps & {
|
|
20
|
-
ref?: React.
|
|
20
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
21
21
|
}) => {
|
|
22
22
|
const isStringChild = typeof children === "string";
|
|
23
23
|
|
|
@@ -39,7 +39,7 @@ export const PopoverContent = ({
|
|
|
39
39
|
showCloseButton = false,
|
|
40
40
|
...props
|
|
41
41
|
}: PopoverProps & {
|
|
42
|
-
ref?: React.
|
|
42
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
43
43
|
}) => {
|
|
44
44
|
const { colorMode } = useColorMode();
|
|
45
45
|
|
package/src/stepper/Stepper.tsx
CHANGED
package/src/tab/Tabs.tsx
CHANGED
|
@@ -62,7 +62,7 @@ export const Tabs = ({
|
|
|
62
62
|
ref,
|
|
63
63
|
...props
|
|
64
64
|
}: TabsProps & {
|
|
65
|
-
ref?: React.
|
|
65
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
66
66
|
}) => {
|
|
67
67
|
const { variant = "core", size = "sm" } = props;
|
|
68
68
|
return <ChakraTabs.Root {...props} ref={ref} variant={variant} size={size} />;
|
package/src/toast/toast.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
BoxProps,
|
|
4
5
|
createToaster,
|
|
5
6
|
Portal,
|
|
6
7
|
Stack,
|
|
@@ -22,19 +23,21 @@ type ToastProps = {
|
|
|
22
23
|
text: string;
|
|
23
24
|
variant: Variant;
|
|
24
25
|
id?: string;
|
|
25
|
-
}
|
|
26
|
+
} & Pick<BoxProps, "width">;
|
|
26
27
|
|
|
27
28
|
export const createToast = ({
|
|
28
29
|
text,
|
|
29
30
|
variant,
|
|
30
31
|
id,
|
|
31
32
|
duration = 6000,
|
|
33
|
+
width = "sm",
|
|
32
34
|
}: ToastProps) =>
|
|
33
35
|
toaster.create({
|
|
34
36
|
description: text,
|
|
35
37
|
type: variant,
|
|
36
38
|
id: id ?? crypto.randomUUID(),
|
|
37
39
|
duration,
|
|
40
|
+
meta: { width },
|
|
38
41
|
});
|
|
39
42
|
|
|
40
43
|
export const Toaster = () => {
|
|
@@ -42,7 +45,7 @@ export const Toaster = () => {
|
|
|
42
45
|
<Portal>
|
|
43
46
|
<ChakraToaster toaster={toaster} insetInline={{ mdDown: "4" }}>
|
|
44
47
|
{(toast) => (
|
|
45
|
-
<Toast.Root width={{ md:
|
|
48
|
+
<Toast.Root width={{ md: toast.meta?.width }} role="alert">
|
|
46
49
|
<AlertIcon variant={toast.type as Variant} />
|
|
47
50
|
<Stack gap="1" flex="1" maxWidth="100%">
|
|
48
51
|
<Toast.Description>{toast.description}</Toast.Description>
|
package/src/tooltip.tsx
CHANGED
|
@@ -9,7 +9,7 @@ export const TooltipTrigger = ({
|
|
|
9
9
|
children,
|
|
10
10
|
...props
|
|
11
11
|
}: ChakraTooltip.TriggerProps & {
|
|
12
|
-
ref?: React.
|
|
12
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
13
13
|
}) => {
|
|
14
14
|
const isStringChild = typeof children === "string";
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ export const TooltipContent = ({
|
|
|
27
27
|
children,
|
|
28
28
|
...props
|
|
29
29
|
}: TooltipProps & {
|
|
30
|
-
ref?: React.
|
|
30
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
31
31
|
}) => {
|
|
32
32
|
return (
|
|
33
33
|
<Portal>
|
package/src/typography/Badge.tsx
CHANGED
package/src/typography/Code.tsx
CHANGED
package/src/typography/Text.tsx
CHANGED
|
@@ -48,7 +48,7 @@ export const Text = function Text({
|
|
|
48
48
|
ref,
|
|
49
49
|
...props
|
|
50
50
|
}: TextProps & {
|
|
51
|
-
ref?: React.
|
|
51
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
52
52
|
}) {
|
|
53
53
|
const { variant, lineHeight, fontSize, ...rest } = props;
|
|
54
54
|
const resolvedProps = resolveTextProps({ variant, fontSize, lineHeight });
|