@vygruppen/spor-react 12.1.2 → 12.2.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 +11 -11
- package/.turbo/turbo-typegen.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +148 -151
- package/dist/index.d.ts +148 -151
- package/dist/index.js +2284 -1880
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2169 -1774
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.tsx +2 -1
- package/src/accordion/Expandable.tsx +3 -1
- package/src/accordion/helpers.ts +2 -1
- package/src/alert/Alert.tsx +3 -1
- package/src/alert/AlertIcon.tsx +17 -10
- package/src/alert/ExpandableAlert.tsx +3 -2
- package/src/alert/ServiceAlert.tsx +2 -1
- package/src/breadcrumb/Breadcrumb.tsx +9 -8
- package/src/button/Button.tsx +2 -1
- package/src/button/ButtonGroup.tsx +2 -1
- package/src/button/Clipboard.tsx +3 -0
- package/src/button/CloseButton.tsx +8 -4
- package/src/button/FloatingActionButton.tsx +5 -5
- package/src/button/IconButton.tsx +1 -0
- package/src/color-mode/color-mode.tsx +2 -2
- package/src/datepicker/Calendar.tsx +0 -1
- package/src/datepicker/CalendarCell.tsx +5 -5
- package/src/datepicker/CalendarGrid.tsx +3 -2
- package/src/datepicker/CalendarHeader.tsx +1 -4
- package/src/datepicker/CalendarTriggerButton.tsx +3 -4
- package/src/datepicker/DateField.tsx +13 -6
- package/src/datepicker/DatePicker.tsx +2 -1
- package/src/datepicker/DateRangePicker.tsx +1 -1
- package/src/datepicker/DateTimeSegment.tsx +2 -1
- package/src/datepicker/RangeCalendar.tsx +1 -1
- package/src/datepicker/StyledField.tsx +1 -1
- package/src/datepicker/TimeField.tsx +3 -3
- package/src/datepicker/TimePicker.tsx +4 -2
- package/src/datepicker/utils.ts +10 -5
- package/src/dialog/Dialog.tsx +1 -0
- package/src/dialog/Drawer.tsx +28 -26
- package/src/i18n/index.tsx +1 -0
- package/src/input/AttachedInputs.tsx +6 -3
- package/src/input/CardSelect.tsx +3 -1
- package/src/input/Checkbox.tsx +1 -0
- package/src/input/CheckboxGroup.tsx +3 -1
- package/src/input/ChoiceChip.tsx +1 -1
- package/src/input/Combobox.tsx +6 -4
- package/src/input/CountryCodeSelect.tsx +10 -4
- package/src/input/Field.tsx +2 -0
- package/src/input/Input.tsx +2 -3
- package/src/input/InputGroup.tsx +1 -1
- package/src/input/ListBox.tsx +9 -8
- package/src/input/NativeSelect.tsx +1 -2
- package/src/input/NumericStepper.tsx +22 -23
- package/src/input/PasswordInput.tsx +2 -1
- package/src/input/PhoneNumberInput.tsx +6 -2
- package/src/input/Popover.tsx +2 -0
- package/src/input/Radio.tsx +2 -0
- package/src/input/SearchInput.tsx +2 -1
- package/src/input/Select.tsx +8 -2
- package/src/input/Switch.tsx +22 -34
- package/src/input/Textarea.tsx +6 -4
- package/src/input/index.ts +1 -1
- package/src/layout/PressableCard.tsx +5 -2
- package/src/layout/RadioCard.tsx +3 -1
- package/src/layout/Separator.tsx +2 -1
- package/src/layout/StaticCard.tsx +6 -3
- package/src/linjetag/InfoTag.tsx +3 -2
- package/src/linjetag/LineIcon.tsx +5 -4
- package/src/linjetag/TravelTag.tsx +12 -8
- package/src/link/TextLink.tsx +1 -1
- package/src/loader/ColorInlineLoader.tsx +0 -1
- package/src/loader/ColorSpinner.tsx +0 -1
- package/src/loader/ContentLoader.tsx +0 -1
- package/src/loader/DarkFullScreenLoader.tsx +0 -1
- package/src/loader/DarkInlineLoader.tsx +0 -1
- package/src/loader/DarkSpinner.tsx +0 -1
- package/src/loader/LightFullScreenLoader.tsx +0 -1
- package/src/loader/LightInlineLoader.tsx +0 -1
- package/src/loader/LightSpinner.tsx +0 -1
- package/src/loader/Lottie.tsx +1 -2
- package/src/loader/ProgressBar.tsx +1 -2
- package/src/loader/ProgressLoader.tsx +2 -7
- package/src/logo/CargonetLogo.tsx +2 -1
- package/src/logo/VyLogo.tsx +3 -4
- package/src/logo/VyLogoPride.tsx +4 -1
- package/src/media-controller/JumpButton.tsx +2 -1
- package/src/media-controller/PlayPauseButton.tsx +2 -1
- package/src/media-controller/SkipButton.tsx +2 -1
- package/src/nudge/Nudge.tsx +7 -14
- package/src/pagination/Pagination.tsx +5 -0
- package/src/popover/index.tsx +2 -0
- package/src/progress-indicator/ProgressDot.tsx +1 -1
- package/src/progress-indicator/ProgressIndicator.tsx +4 -2
- package/src/provider/SporProvider.tsx +0 -1
- package/src/stepper/Stepper.tsx +1 -1
- package/src/tab/Tabs.tsx +1 -1
- package/src/table/Table.tsx +2 -1
- package/src/theme/slot-recipes/alert-expandable.ts +0 -4
- package/src/theme/slot-recipes/info-tag.ts +0 -1
- package/src/theme/slot-recipes/popover.ts +0 -1
- package/src/theme/slot-recipes/radio-card.ts +0 -3
- package/src/theme/utils/accent-utils.ts +12 -6
- package/src/theme/utils/bg-utils.ts +6 -3
- package/src/theme/utils/brand-utils.ts +7 -7
- package/src/theme/utils/core-utils.ts +23 -13
- package/src/theme/utils/floating-utils.ts +16 -8
- package/src/theme/utils/ghost-utils.ts +8 -4
- package/src/theme/utils/input-utils.ts +7 -4
- package/src/theme/utils/outline-utils.ts +6 -3
- package/src/theme/utils/surface-utils.ts +8 -4
- package/src/toast/toast.tsx +0 -1
- package/src/typography/Badge.tsx +8 -5
- package/src/typography/Heading.tsx +1 -1
- package/src/typography/Text.tsx +1 -1
- package/src/util/slugify.tsx +8 -8
- package/tsconfig.json +1 -0
package/src/input/Switch.tsx
CHANGED
@@ -44,38 +44,26 @@ export type SwitchProps = Exclude<
|
|
44
44
|
* ```
|
45
45
|
*/
|
46
46
|
|
47
|
-
export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
children,
|
52
|
-
rootRef,
|
53
|
-
trackLabel,
|
54
|
-
thumbLabel,
|
55
|
-
size = "md",
|
56
|
-
label,
|
57
|
-
onCheckedChange,
|
58
|
-
...rest
|
59
|
-
} = props;
|
47
|
+
export const Switch = forwardRef<HTMLInputElement, SwitchProps>((props) => {
|
48
|
+
const { rootRef, size = "md", label, ...rest } = props;
|
49
|
+
const recipe = useSlotRecipe({ key: "switch" });
|
50
|
+
const styles = recipe({ size });
|
60
51
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
>
|
72
|
-
<ChakraSwitch.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
);
|
80
|
-
},
|
81
|
-
);
|
52
|
+
return (
|
53
|
+
<Field style={{ width: "auto" }}>
|
54
|
+
<ChakraSwitch.Root
|
55
|
+
ref={rootRef}
|
56
|
+
{...rest}
|
57
|
+
checked={props.checked}
|
58
|
+
css={styles.root}
|
59
|
+
>
|
60
|
+
<ChakraSwitch.Label>{label}</ChakraSwitch.Label>
|
61
|
+
<ChakraSwitch.HiddenInput />
|
62
|
+
<ChakraSwitch.Control css={styles.control}>
|
63
|
+
<ChakraSwitch.Thumb />
|
64
|
+
</ChakraSwitch.Control>
|
65
|
+
</ChakraSwitch.Root>
|
66
|
+
</Field>
|
67
|
+
);
|
68
|
+
});
|
69
|
+
Switch.displayName = "Switch";
|
package/src/input/Textarea.tsx
CHANGED
@@ -44,16 +44,17 @@ const useLabelHeight = (label: ReactNode | undefined) => {
|
|
44
44
|
};
|
45
45
|
|
46
46
|
const observer = new ResizeObserver(updateLabelHeight);
|
47
|
-
|
48
|
-
|
47
|
+
const currentLabelRef = labelRef.current;
|
48
|
+
if (currentLabelRef) {
|
49
|
+
observer.observe(currentLabelRef);
|
49
50
|
}
|
50
51
|
|
51
52
|
// Initial calculation with a slight delay to ensure CSS is applied
|
52
53
|
setTimeout(updateLabelHeight, 0);
|
53
54
|
|
54
55
|
return () => {
|
55
|
-
if (
|
56
|
-
observer.unobserve(
|
56
|
+
if (currentLabelRef) {
|
57
|
+
observer.unobserve(currentLabelRef);
|
57
58
|
}
|
58
59
|
};
|
59
60
|
}, [label]);
|
@@ -98,3 +99,4 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
98
99
|
);
|
99
100
|
},
|
100
101
|
);
|
102
|
+
Textarea.displayName = "Textarea";
|
package/src/input/index.ts
CHANGED
@@ -4,8 +4,8 @@ export * from "./Checkbox";
|
|
4
4
|
export * from "./CheckboxGroup";
|
5
5
|
export * from "./ChoiceChip";
|
6
6
|
export * from "./Combobox";
|
7
|
-
export * from "./Fieldset";
|
8
7
|
export * from "./Field";
|
8
|
+
export * from "./Fieldset";
|
9
9
|
export * from "./Input";
|
10
10
|
export * from "./ListBox";
|
11
11
|
export * from "./NativeSelect";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { ButtonProps, chakra, RecipeVariantProps } from "@chakra-ui/react";
|
3
|
-
import
|
3
|
+
import { forwardRef } from "react";
|
4
4
|
|
5
5
|
import { pressableCardRecipe } from "../theme/recipes/pressable-card";
|
6
6
|
|
@@ -40,5 +40,8 @@ type PressableCardProps = RecipeVariantProps<typeof pressableCardRecipe> &
|
|
40
40
|
ButtonProps;
|
41
41
|
|
42
42
|
export const PressableCard = forwardRef<HTMLDivElement, PressableCardProps>(
|
43
|
-
(props, ref) =>
|
43
|
+
(props, ref) => {
|
44
|
+
return <PressableCardButton {...props} ref={ref} />;
|
45
|
+
},
|
44
46
|
);
|
47
|
+
PressableCard.displayName = "PressableCard";
|
package/src/layout/RadioCard.tsx
CHANGED
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
RecipeVariantProps,
|
5
5
|
useSlotRecipe,
|
6
6
|
} from "@chakra-ui/react";
|
7
|
-
import React, { forwardRef
|
7
|
+
import React, { forwardRef } from "react";
|
8
8
|
|
9
9
|
import { radioCardSlotRecipe } from "../theme/slot-recipes/radio-card";
|
10
10
|
|
@@ -55,6 +55,7 @@ export const RadioCard = forwardRef<HTMLInputElement, RadioCardItemProps>(
|
|
55
55
|
);
|
56
56
|
},
|
57
57
|
);
|
58
|
+
RadioCard.displayName = "RadioCard";
|
58
59
|
|
59
60
|
type RadioCardRootProps = RadioCardVariantProps &
|
60
61
|
Exclude<ChakraRadioCard.RootProps, "variant"> & {
|
@@ -92,5 +93,6 @@ export const RadioCardGroup = forwardRef<HTMLDivElement, RadioCardRootProps>(
|
|
92
93
|
);
|
93
94
|
},
|
94
95
|
);
|
96
|
+
RadioCardGroup.displayName = "RadioCardGroup";
|
95
97
|
|
96
98
|
export const RadioCardLabel = ChakraRadioCard.Label;
|
package/src/layout/Separator.tsx
CHANGED
@@ -6,7 +6,7 @@ import {
|
|
6
6
|
SeparatorProps as ChakraSeparatorProps,
|
7
7
|
useRecipe,
|
8
8
|
} from "@chakra-ui/react";
|
9
|
-
import
|
9
|
+
import { forwardRef, PropsWithChildren } from "react";
|
10
10
|
|
11
11
|
import { separatorRecipe } from "../theme/recipes/separator";
|
12
12
|
|
@@ -31,3 +31,4 @@ export const Separator = forwardRef<HTMLDivElement, SeparatorProps>(
|
|
31
31
|
return <ChakraSeparator css={styles} {...props} ref={ref} />;
|
32
32
|
},
|
33
33
|
);
|
34
|
+
Separator.displayName = "Separator";
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
|
-
import {
|
3
|
-
import
|
2
|
+
import { BoxProps, chakra, RecipeVariantProps } from "@chakra-ui/react";
|
3
|
+
import { forwardRef } from "react";
|
4
4
|
|
5
5
|
import { staticCardRecipe } from "../theme/recipes/static-card";
|
6
6
|
|
@@ -47,5 +47,8 @@ export type StaticCardProps = RecipeVariantProps<typeof staticCardRecipe> &
|
|
47
47
|
BoxProps;
|
48
48
|
|
49
49
|
export const StaticCard = forwardRef<HTMLDivElement, StaticCardProps>(
|
50
|
-
(props, ref) =>
|
50
|
+
(props, ref) => {
|
51
|
+
return <StyledCardBox {...props} ref={ref}></StyledCardBox>;
|
52
|
+
},
|
51
53
|
);
|
54
|
+
StaticCard.displayName = "StaticCard";
|
package/src/linjetag/InfoTag.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, RecipeVariantProps, useSlotRecipe } from "@chakra-ui/react";
|
3
|
-
import
|
3
|
+
import { PropsWithChildren } from "react";
|
4
4
|
|
5
5
|
import { infoTagSlotRecipe } from "../theme/slot-recipes/info-tag";
|
6
6
|
import { LineIcon } from "./LineIcon";
|
@@ -18,7 +18,7 @@ export type InfoTagProps = TagProps & PropsWithChildren<InfoTagVariantProps>;
|
|
18
18
|
* ```tsx
|
19
19
|
* <InfoTag variant="subway" title="3" description="Ringen" />
|
20
20
|
* ```
|
21
|
-
* They support three different sizes
|
21
|
+
* They support three different sizes –`sm`, `md` and `lg`.
|
22
22
|
*
|
23
23
|
* ```tsx
|
24
24
|
* <InfoTag
|
@@ -63,6 +63,7 @@ export const InfoTag = ({
|
|
63
63
|
variant={variant}
|
64
64
|
size={size}
|
65
65
|
aria-label={title}
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
66
67
|
{...(customProps as any)} // TODO: Fix this
|
67
68
|
/>
|
68
69
|
<Box css={styles.textContainer}>
|
@@ -41,7 +41,7 @@ export type LineIconProps = Exclude<BoxProps, "variant"> &
|
|
41
41
|
* <LineIcon variant="subway" />
|
42
42
|
* ```
|
43
43
|
*
|
44
|
-
* They support three different sizes
|
44
|
+
* They support three different sizes - `sm`, `md` and `lg`.
|
45
45
|
*
|
46
46
|
* ```tsx
|
47
47
|
* <LineIcon variant="subway" size="lg" />
|
@@ -67,7 +67,7 @@ export const LineIcon = forwardRef<HTMLDivElement, LineIconProps>(
|
|
67
67
|
variant,
|
68
68
|
size = "md",
|
69
69
|
foregroundColor,
|
70
|
-
|
70
|
+
|
71
71
|
disabled,
|
72
72
|
style,
|
73
73
|
target = "lineIcon",
|
@@ -85,11 +85,12 @@ export const LineIcon = forwardRef<HTMLDivElement, LineIconProps>(
|
|
85
85
|
return variant === "walk" && target === "travelTag" ? 0 : 0.5;
|
86
86
|
};
|
87
87
|
|
88
|
-
const Icon:
|
88
|
+
const Icon: React.ElementType = getCorrectIcon({
|
89
89
|
variant:
|
90
90
|
variant === "custom" && "customIconVariant" in rest
|
91
91
|
? rest.customIconVariant
|
92
|
-
:
|
92
|
+
: // eslint-disable-next-line unicorn/no-nested-ternary
|
93
|
+
variant === "custom" //eslint rules and prettier conflict
|
93
94
|
? "local-train"
|
94
95
|
: variant,
|
95
96
|
size,
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
WarningFill18Icon,
|
14
14
|
WarningFill24Icon,
|
15
15
|
} from "@vygruppen/spor-icon-react";
|
16
|
-
import
|
16
|
+
import { forwardRef, PropsWithChildren } from "react";
|
17
17
|
|
18
18
|
import { travelTagSlotRecipe } from "../theme/slot-recipes/travel-tag";
|
19
19
|
import { LineIcon } from "./LineIcon";
|
@@ -48,7 +48,7 @@ export type TravelTagProps = TagProps &
|
|
48
48
|
* <TravelTag variant="subway" title="3" description="Ringen" />
|
49
49
|
* ```
|
50
50
|
*
|
51
|
-
* They support three different sizes
|
51
|
+
* They support three different sizes - `sm`, `md` and `lg`.
|
52
52
|
*
|
53
53
|
* You can also render them with a deviation level to indicate an extra focus:
|
54
54
|
*
|
@@ -133,7 +133,8 @@ export const TravelTag = forwardRef<HTMLDivElement, TravelTagProps>(
|
|
133
133
|
customIconVariant={customIconVariant}
|
134
134
|
disabled={disabled}
|
135
135
|
target="travelTag"
|
136
|
-
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
137
|
+
{...(rest as any)} //Find a way to not use any here
|
137
138
|
/>
|
138
139
|
<Box css={styles.textContainer}>
|
139
140
|
{title && (
|
@@ -161,15 +162,18 @@ const getDeviationLevelIcon = ({
|
|
161
162
|
size,
|
162
163
|
}: Pick<TravelTagProps, "deviationLevel" | "size">) => {
|
163
164
|
switch (deviationLevel) {
|
164
|
-
case "critical":
|
165
|
+
case "critical": {
|
165
166
|
return size === "lg" ? ErrorFill24Icon : ErrorFill18Icon;
|
167
|
+
}
|
166
168
|
case "major":
|
167
|
-
case "minor":
|
169
|
+
case "minor": {
|
168
170
|
return size === "lg" ? WarningFill24Icon : WarningFill18Icon;
|
169
|
-
|
171
|
+
}
|
172
|
+
case "info": {
|
170
173
|
return size === "lg" ? InformationFill24Icon : InformationFill18Icon;
|
171
|
-
|
172
|
-
default:
|
174
|
+
}
|
175
|
+
default: {
|
173
176
|
return null;
|
177
|
+
}
|
174
178
|
}
|
175
179
|
};
|
package/src/link/TextLink.tsx
CHANGED
@@ -43,7 +43,6 @@ const ExternalIcon = ({ label }: { label: string }) => (
|
|
43
43
|
</>
|
44
44
|
);
|
45
45
|
|
46
|
-
// eslint-disable-next-line react/display-name
|
47
46
|
export const TextLink = forwardRef<HTMLAnchorElement, LinkProps>(
|
48
47
|
({ children, external, href, ...props }, ref) => {
|
49
48
|
const { t } = useTranslation();
|
@@ -79,6 +78,7 @@ export const TextLink = forwardRef<HTMLAnchorElement, LinkProps>(
|
|
79
78
|
);
|
80
79
|
},
|
81
80
|
);
|
81
|
+
TextLink.displayName = "TextLink";
|
82
82
|
|
83
83
|
const texts = createTexts({
|
84
84
|
externalLink: {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, BoxProps, Center, VisuallyHidden } from "@chakra-ui/react";
|
3
3
|
import { fullScreenLoaderWhiteData } from "@vygruppen/spor-loader";
|
4
|
-
import React from "react";
|
5
4
|
|
6
5
|
import { ClientOnly } from "./ClientOnly";
|
7
6
|
import Lottie from "./Lottie";
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use client";
|
2
2
|
import { Box, BoxProps, Center, VisuallyHidden } from "@chakra-ui/react";
|
3
3
|
import { fullScreenLoaderBlackData } from "@vygruppen/spor-loader";
|
4
|
-
import React from "react";
|
5
4
|
|
6
5
|
import { ClientOnly } from "./ClientOnly";
|
7
6
|
import Lottie from "./Lottie";
|
package/src/loader/Lottie.tsx
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
import ReactLottie from "lottie-react";
|
2
|
-
import React from "react";
|
3
2
|
|
4
3
|
/**
|
5
4
|
* A wrapper around Lottie to make it tree-shakeable for SSR.
|
6
5
|
*/
|
7
|
-
export default function Lottie({ animationData }: { animationData:
|
6
|
+
export default function Lottie({ animationData }: { animationData: unknown }) {
|
8
7
|
return <ReactLottie animationData={animationData} />;
|
9
8
|
}
|
@@ -79,13 +79,11 @@ export const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
|
|
79
79
|
(
|
80
80
|
{
|
81
81
|
value,
|
82
|
-
colorPalette = "white",
|
83
82
|
label,
|
84
83
|
labelRotationDelay = 5000,
|
85
84
|
isActive = true,
|
86
85
|
showValueText = false,
|
87
86
|
height = "0.5rem",
|
88
|
-
"aria-label": ariaLabel,
|
89
87
|
...rest
|
90
88
|
},
|
91
89
|
ref,
|
@@ -117,3 +115,4 @@ export const ProgressBar = forwardRef<HTMLDivElement, ProgressBarProps>(
|
|
117
115
|
);
|
118
116
|
},
|
119
117
|
);
|
118
|
+
ProgressBar.displayName = "ProgressBar";
|
@@ -1,11 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
-
import {
|
3
|
-
Box,
|
4
|
-
BoxProps,
|
5
|
-
chakra,
|
6
|
-
RecipeVariantProps,
|
7
|
-
Text,
|
8
|
-
} from "@chakra-ui/react";
|
2
|
+
import { BoxProps, chakra, RecipeVariantProps, Text } from "@chakra-ui/react";
|
9
3
|
import React, { forwardRef, useEffect, useId, useRef, useState } from "react";
|
10
4
|
import { useProgressBar } from "react-aria";
|
11
5
|
|
@@ -175,6 +169,7 @@ export const ProgressLoader = forwardRef<HTMLDivElement, ProgressLoaderProps>(
|
|
175
169
|
);
|
176
170
|
},
|
177
171
|
);
|
172
|
+
ProgressLoader.displayName = "ProgressLoader";
|
178
173
|
|
179
174
|
const texts = createTexts({
|
180
175
|
fallbackLabel: (value) => ({
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { chakra } from "@chakra-ui/react";
|
2
|
-
import
|
2
|
+
import { forwardRef } from "react";
|
3
3
|
|
4
4
|
export type CargonetLogoProps = {
|
5
5
|
/** The color of the logo
|
@@ -96,3 +96,4 @@ export const CargonetLogo = forwardRef<SVGSVGElement, CargonetLogoProps>(
|
|
96
96
|
);
|
97
97
|
},
|
98
98
|
);
|
99
|
+
CargonetLogo.displayName = "CargonetLogo";
|
package/src/logo/VyLogo.tsx
CHANGED
@@ -1,7 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import React, { forwardRef,
|
3
|
-
|
4
|
-
import { useColorMode } from "..";
|
1
|
+
import { BoxProps, chakra } from "@chakra-ui/react";
|
2
|
+
import React, { forwardRef, useId } from "react";
|
5
3
|
|
6
4
|
export const SvgBox = chakra("svg");
|
7
5
|
|
@@ -119,3 +117,4 @@ export const VyLogo = forwardRef<SVGSVGElement, VyLogoProps>((props, ref) => {
|
|
119
117
|
</SvgBox>
|
120
118
|
);
|
121
119
|
});
|
120
|
+
VyLogo.displayName = "VyLogo";
|
package/src/logo/VyLogoPride.tsx
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BoxProps } from "@chakra-ui/react";
|
2
|
-
import
|
2
|
+
import { forwardRef, useId } from "react";
|
3
3
|
|
4
4
|
import { SvgBox } from "./VyLogo";
|
5
5
|
|
@@ -21,7 +21,9 @@ export const VyLogoPride = forwardRef<SVGSVGElement, VyLogoPrideProps>(
|
|
21
21
|
|
22
22
|
const id = useId();
|
23
23
|
return (
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
24
25
|
<SvgBox ref={ref} viewBox="0 0 107 54" {...(props as any)}>
|
26
|
+
{/* Find a way to not use any */}
|
25
27
|
<title>Vy logo pride</title>
|
26
28
|
<svg
|
27
29
|
width="108"
|
@@ -161,3 +163,4 @@ export const VyLogoPride = forwardRef<SVGSVGElement, VyLogoPrideProps>(
|
|
161
163
|
);
|
162
164
|
},
|
163
165
|
);
|
166
|
+
VyLogoPride.displayName = "VyLogoPride";
|
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
Backward15MediaControllerFill30Icon,
|
10
10
|
Forward15MediaControllerFill30Icon,
|
11
11
|
} from "@vygruppen/spor-icon-react";
|
12
|
-
import
|
12
|
+
import { forwardRef, PropsWithChildren } from "react";
|
13
13
|
|
14
14
|
import { createTexts, useTranslation } from "..";
|
15
15
|
import { mediaControllerSlotRecipe } from "../theme/slot-recipes/media-controller-button";
|
@@ -66,6 +66,7 @@ export const JumpButton = forwardRef<HTMLButtonElement, JumpButtonProps>(
|
|
66
66
|
);
|
67
67
|
},
|
68
68
|
);
|
69
|
+
JumpButton.displayName = "JumpButton";
|
69
70
|
|
70
71
|
const texts = createTexts({
|
71
72
|
forward: {
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
PauseMediaControllerFill24Icon,
|
5
5
|
PlayMediaControllerFill24Icon,
|
6
6
|
} from "@vygruppen/spor-icon-react";
|
7
|
-
import
|
7
|
+
import { forwardRef, PropsWithChildren } from "react";
|
8
8
|
|
9
9
|
import { createTexts, MediaControllerVariantProps, useTranslation } from "..";
|
10
10
|
|
@@ -56,6 +56,7 @@ export const PlayPauseButton = forwardRef<
|
|
56
56
|
</Center>
|
57
57
|
);
|
58
58
|
});
|
59
|
+
PlayPauseButton.displayName = "PlayPauseButton";
|
59
60
|
|
60
61
|
const texts = createTexts({
|
61
62
|
pause: {
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
NextMediaControllerFill30Icon,
|
5
5
|
PreviousMediaControllerFill30Icon,
|
6
6
|
} from "@vygruppen/spor-icon-react";
|
7
|
-
import
|
7
|
+
import { forwardRef, PropsWithChildren } from "react";
|
8
8
|
|
9
9
|
import { createTexts, MediaControllerVariantProps, useTranslation } from "..";
|
10
10
|
|
@@ -54,6 +54,7 @@ export const SkipButton = forwardRef<HTMLButtonElement, SkipButtonProps>(
|
|
54
54
|
);
|
55
55
|
},
|
56
56
|
);
|
57
|
+
SkipButton.displayName = "SkipButton";
|
57
58
|
|
58
59
|
const texts = createTexts({
|
59
60
|
next: {
|
package/src/nudge/Nudge.tsx
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
"use client";
|
2
|
-
import {
|
3
|
-
PopoverCloseTrigger,
|
4
|
-
usePopover,
|
5
|
-
usePopoverContext,
|
6
|
-
} from "@ark-ui/react";
|
2
|
+
import { PopoverCloseTrigger, usePopoverContext } from "@ark-ui/react";
|
7
3
|
import {
|
8
4
|
Box,
|
9
5
|
BoxProps,
|
@@ -16,7 +12,6 @@ import React, {
|
|
16
12
|
forwardRef,
|
17
13
|
PropsWithChildren,
|
18
14
|
useEffect,
|
19
|
-
useRef,
|
20
15
|
useState,
|
21
16
|
} from "react";
|
22
17
|
|
@@ -56,12 +51,7 @@ export type NudgeProps = {
|
|
56
51
|
} & PopoverRootProps;
|
57
52
|
|
58
53
|
export const Nudge = (props: NudgeProps) => {
|
59
|
-
const {
|
60
|
-
introducedDate,
|
61
|
-
defaultOpen = props.open === undefined ? true : undefined, // defaultOpen defaults to true if open is undefined
|
62
|
-
size = "md",
|
63
|
-
...rest
|
64
|
-
} = props;
|
54
|
+
const { introducedDate, size = "md", ...rest } = props;
|
65
55
|
|
66
56
|
if (isNudgeExpired(introducedDate)) {
|
67
57
|
logExpirationWarning();
|
@@ -77,6 +67,7 @@ export const NudgeTrigger = forwardRef<
|
|
77
67
|
>(({ ...props }, ref) => {
|
78
68
|
return <PopoverTrigger {...props} ref={ref} />;
|
79
69
|
});
|
70
|
+
NudgeTrigger.displayName = "NudgeTrigger";
|
80
71
|
|
81
72
|
export const NudgeContent = forwardRef<HTMLDivElement, PopoverProps>(
|
82
73
|
({ showCloseButton = true, children, ...props }, ref) => {
|
@@ -104,7 +95,7 @@ export const NudgeContent = forwardRef<HTMLDivElement, PopoverProps>(
|
|
104
95
|
const totalSteps = wizardPages.length;
|
105
96
|
const isLastStep = totalSteps === currentStep;
|
106
97
|
|
107
|
-
if (
|
98
|
+
if (wizardPages.length === 0) {
|
108
99
|
return (
|
109
100
|
<PopoverContent showCloseButton={showCloseButton} {...props} ref={ref}>
|
110
101
|
{children}
|
@@ -133,8 +124,9 @@ export const NudgeContent = forwardRef<HTMLDivElement, PopoverProps>(
|
|
133
124
|
);
|
134
125
|
},
|
135
126
|
);
|
127
|
+
NudgeContent.displayName = "NudgeContent";
|
136
128
|
|
137
|
-
export const NudgeActions = ({
|
129
|
+
export const NudgeActions = ({ ...props }: BoxProps) => {
|
138
130
|
const { colorMode } = useColorMode();
|
139
131
|
|
140
132
|
return (
|
@@ -216,3 +208,4 @@ export const NudgeCloseTrigger = forwardRef<
|
|
216
208
|
</ChakraPopover.CloseTrigger>
|
217
209
|
);
|
218
210
|
});
|
211
|
+
NudgeCloseTrigger.displayName = "NudgeCloseTrigger";
|
@@ -60,6 +60,7 @@ export const Pagination = React.forwardRef<HTMLDivElement, PaginationRootProps>(
|
|
60
60
|
);
|
61
61
|
},
|
62
62
|
);
|
63
|
+
Pagination.displayName = "Pagination";
|
63
64
|
|
64
65
|
export const PaginationEllipsis = React.forwardRef<
|
65
66
|
HTMLDivElement,
|
@@ -73,6 +74,7 @@ export const PaginationEllipsis = React.forwardRef<
|
|
73
74
|
</ListItem>
|
74
75
|
);
|
75
76
|
});
|
77
|
+
PaginationEllipsis.displayName = "PaginationEllipsis";
|
76
78
|
|
77
79
|
export const PaginationItem = React.forwardRef<
|
78
80
|
HTMLButtonElement,
|
@@ -115,6 +117,7 @@ export const PaginationItem = React.forwardRef<
|
|
115
117
|
</ListItem>
|
116
118
|
);
|
117
119
|
});
|
120
|
+
PaginationItem.displayName = "PaginationItem";
|
118
121
|
|
119
122
|
export const PaginationPrevTrigger = React.forwardRef<
|
120
123
|
HTMLButtonElement,
|
@@ -163,6 +166,7 @@ export const PaginationPrevTrigger = React.forwardRef<
|
|
163
166
|
</ListItem>
|
164
167
|
);
|
165
168
|
});
|
169
|
+
PaginationPrevTrigger.displayName = "PaginationPrevTrigger";
|
166
170
|
|
167
171
|
export const PaginationNextTrigger = React.forwardRef<
|
168
172
|
HTMLButtonElement,
|
@@ -208,6 +212,7 @@ export const PaginationNextTrigger = React.forwardRef<
|
|
208
212
|
</ListItem>
|
209
213
|
);
|
210
214
|
});
|
215
|
+
PaginationNextTrigger.displayName = "PaginationNextTrigger";
|
211
216
|
|
212
217
|
export const PaginationItems = (
|
213
218
|
props: React.HTMLAttributes<HTMLElement> & {},
|
package/src/popover/index.tsx
CHANGED
@@ -24,6 +24,7 @@ export const PopoverTrigger = forwardRef<
|
|
24
24
|
</ChakraPopover.Trigger>
|
25
25
|
);
|
26
26
|
});
|
27
|
+
PopoverTrigger.displayName = "PopoverTrigger";
|
27
28
|
|
28
29
|
export type PopoverProps = ChakraPopover.ContentProps &
|
29
30
|
React.RefAttributes<HTMLDivElement> & {
|
@@ -66,3 +67,4 @@ export const PopoverContent = forwardRef<HTMLDivElement, PopoverProps>(
|
|
66
67
|
);
|
67
68
|
},
|
68
69
|
);
|
70
|
+
PopoverContent.displayName = "PopoverContent";
|