@vygruppen/spor-react 12.3.1 → 12.3.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 +11 -11
- package/.turbo/turbo-typegen.log +1 -1
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +44 -42
- package/dist/index.d.ts +44 -42
- package/dist/index.js +234 -224
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +239 -229
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/alert/AlertIcon.tsx +17 -11
- package/src/button/Button.tsx +1 -1
- package/src/button/CloseButton.tsx +6 -3
- package/src/button/IconButton.tsx +1 -1
- package/src/datepicker/CalendarTriggerButton.tsx +2 -2
- package/src/datepicker/DatePicker.tsx +5 -1
- package/src/datepicker/DateRangePicker.tsx +4 -1
- package/src/input/Combobox.tsx +149 -157
- package/src/input/ListBox.tsx +27 -34
- package/src/input/NumericStepper.tsx +2 -2
- package/src/input/Switch.tsx +35 -33
- package/src/linjetag/LineIcon.tsx +14 -10
- package/src/loader/ProgressLoader.tsx +12 -8
- package/src/progress-indicator/ProgressIndicator.tsx +2 -1
package/src/input/Switch.tsx
CHANGED
@@ -45,39 +45,41 @@ export type SwitchProps = Exclude<
|
|
45
45
|
* ```
|
46
46
|
*/
|
47
47
|
|
48
|
-
export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
48
|
+
export const Switch = forwardRef<HTMLInputElement, SwitchProps>(
|
49
|
+
(props, ref) => {
|
50
|
+
const {
|
51
|
+
rootRef,
|
52
|
+
size = "md",
|
53
|
+
label,
|
54
|
+
invalid,
|
55
|
+
errorText,
|
56
|
+
helperText,
|
57
|
+
...rest
|
58
|
+
} = props;
|
59
|
+
const recipe = useSlotRecipe({ key: "switch" });
|
60
|
+
const styles = recipe({ size });
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
>
|
68
|
-
<ChakraSwitch.Root
|
69
|
-
ref={rootRef}
|
70
|
-
{...rest}
|
71
|
-
checked={props.checked}
|
72
|
-
css={styles.root}
|
62
|
+
return (
|
63
|
+
<Field
|
64
|
+
style={{ width: "auto" }}
|
65
|
+
invalid={invalid}
|
66
|
+
errorText={errorText}
|
67
|
+
helperText={helperText}
|
73
68
|
>
|
74
|
-
<ChakraSwitch.
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
}
|
69
|
+
<ChakraSwitch.Root
|
70
|
+
ref={rootRef}
|
71
|
+
{...rest}
|
72
|
+
checked={props.checked}
|
73
|
+
css={styles.root}
|
74
|
+
>
|
75
|
+
<ChakraSwitch.Label>{label}</ChakraSwitch.Label>
|
76
|
+
<ChakraSwitch.HiddenInput ref={ref} />
|
77
|
+
<ChakraSwitch.Control css={styles.control}>
|
78
|
+
<ChakraSwitch.Thumb />
|
79
|
+
</ChakraSwitch.Control>
|
80
|
+
</ChakraSwitch.Root>
|
81
|
+
</Field>
|
82
|
+
);
|
83
|
+
},
|
84
|
+
);
|
83
85
|
Switch.displayName = "Switch";
|
@@ -63,17 +63,20 @@ export type LineIconProps = Exclude<BoxProps, "variant"> &
|
|
63
63
|
*/
|
64
64
|
|
65
65
|
export const LineIcon = forwardRef<HTMLDivElement, LineIconProps>(
|
66
|
-
function LineIcon(
|
67
|
-
|
68
|
-
|
69
|
-
|
66
|
+
function LineIcon(
|
67
|
+
{
|
68
|
+
variant,
|
69
|
+
size = "md",
|
70
|
+
foregroundColor,
|
70
71
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
72
|
+
disabled,
|
73
|
+
style,
|
74
|
+
target = "lineIcon",
|
75
|
+
label,
|
76
|
+
...rest
|
77
|
+
},
|
78
|
+
ref,
|
79
|
+
) {
|
77
80
|
const recipe = useSlotRecipe({ key: "lineIcon" });
|
78
81
|
const styles = recipe({ variant, size, ...rest });
|
79
82
|
|
@@ -112,6 +115,7 @@ export const LineIcon = forwardRef<HTMLDivElement, LineIconProps>(
|
|
112
115
|
borderWidth={borderContainer()}
|
113
116
|
borderColor={variant === "walk" ? "core.outline" : "transparent"}
|
114
117
|
aria-label={label}
|
118
|
+
ref={ref}
|
115
119
|
>
|
116
120
|
<Icon css={styles.icon} />
|
117
121
|
</Box>
|
@@ -88,14 +88,17 @@ const ProgressLoaderWrapper = chakra("div", progressLoaderRecipe);
|
|
88
88
|
*/
|
89
89
|
|
90
90
|
export const ProgressLoader = forwardRef<HTMLDivElement, ProgressLoaderProps>(
|
91
|
-
(
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
91
|
+
(
|
92
|
+
{
|
93
|
+
value,
|
94
|
+
label,
|
95
|
+
labelRotationDelay = 5000,
|
96
|
+
"aria-label": ariaLabel,
|
97
|
+
width,
|
98
|
+
...rest
|
99
|
+
},
|
100
|
+
ref,
|
101
|
+
) => {
|
99
102
|
const { t } = useTranslation();
|
100
103
|
const currentLoadingText = useRotatingLabel({
|
101
104
|
label,
|
@@ -124,6 +127,7 @@ export const ProgressLoader = forwardRef<HTMLDivElement, ProgressLoaderProps>(
|
|
124
127
|
aria-valuemax={100}
|
125
128
|
aria-label={ariaLabel ?? t(texts.fallbackLabel(value ?? "?"))}
|
126
129
|
{...rest}
|
130
|
+
ref={ref}
|
127
131
|
>
|
128
132
|
<chakra.svg as="svg" viewBox="0 0 246 78" fill="none">
|
129
133
|
<path
|
@@ -35,7 +35,7 @@ export type ProgressIndicatorProps = BoxProps &
|
|
35
35
|
export const ProgressIndicator = forwardRef<
|
36
36
|
HTMLDivElement,
|
37
37
|
ProgressIndicatorProps
|
38
|
-
>(({ numberOfSteps, activeStep }) => {
|
38
|
+
>(({ numberOfSteps, activeStep }, ref) => {
|
39
39
|
const { t } = useTranslation();
|
40
40
|
const recipe = useSlotRecipe({
|
41
41
|
key: "progressIndicator",
|
@@ -51,6 +51,7 @@ export const ProgressIndicator = forwardRef<
|
|
51
51
|
aria-valuemax={numberOfSteps}
|
52
52
|
aria-valuenow={activeStep}
|
53
53
|
aria-valuetext={t(texts.stepsOf(activeStep, numberOfSteps))}
|
54
|
+
ref={ref}
|
54
55
|
>
|
55
56
|
<Box css={styles.container}>
|
56
57
|
{Array.from({ length: numberOfSteps }, (_, i) => (
|