@vygruppen/spor-react 12.2.1 → 12.3.1
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 +12 -31
- package/.turbo/turbo-typegen.log +1 -19
- package/CHANGELOG.md +18 -0
- package/dist/index.d.mts +77 -123
- package/dist/index.d.ts +77 -123
- package/dist/index.js +547 -446
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +436 -335
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/datepicker/DatePicker.tsx +10 -13
- package/src/datepicker/DateRangePicker.tsx +18 -5
- package/src/datepicker/TimePicker.tsx +34 -35
- package/src/input/AttachedInputs.tsx +7 -4
- package/src/input/ChoiceChip.tsx +13 -3
- package/src/input/Combobox.tsx +5 -0
- package/src/input/Field.tsx +56 -20
- package/src/input/FloatingLabel.tsx +38 -0
- package/src/input/Input.tsx +40 -23
- package/src/input/Label.tsx +18 -0
- package/src/input/NativeSelect.tsx +14 -5
- package/src/input/NumericStepper.tsx +102 -99
- package/src/input/PasswordInput.tsx +1 -2
- package/src/input/Select.tsx +29 -15
- package/src/input/Switch.tsx +17 -3
- package/src/input/Textarea.tsx +2 -2
- package/src/theme/slot-recipes/field.ts +1 -28
- package/src/theme/slot-recipes/numeric-stepper.ts +8 -3
- package/src/theme/slot-recipes/select.ts +4 -4
- package/src/theme/slot-recipes/table.ts +1 -0
- package/src/input/InputGroup.tsx +0 -67
package/dist/index.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
var react = require('@chakra-ui/react');
|
4
4
|
var sporIconReact = require('@vygruppen/spor-icon-react');
|
5
|
-
var
|
5
|
+
var React28 = require('react');
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
7
7
|
var sporLoader = require('@vygruppen/spor-loader');
|
8
8
|
var ReactLottie = require('lottie-react');
|
@@ -45,7 +45,7 @@ function _interopNamespace(e) {
|
|
45
45
|
return Object.freeze(n);
|
46
46
|
}
|
47
47
|
|
48
|
-
var
|
48
|
+
var React28__namespace = /*#__PURE__*/_interopNamespace(React28);
|
49
49
|
var ReactLottie__default = /*#__PURE__*/_interopDefault(ReactLottie);
|
50
50
|
var tokens20__namespace = /*#__PURE__*/_interopNamespace(tokens20);
|
51
51
|
var cargonetJson__default = /*#__PURE__*/_interopDefault(cargonetJson);
|
@@ -86,7 +86,7 @@ var warnAboutMismatchingIcon = ({
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
};
|
89
|
-
var Accordion =
|
89
|
+
var Accordion = React28.forwardRef(
|
90
90
|
(props, ref) => {
|
91
91
|
const { variant = "core", children, gap = 2, ...rest } = props;
|
92
92
|
const recipe = react.useSlotRecipe({ key: "accordion" });
|
@@ -103,7 +103,7 @@ var Accordion = React29.forwardRef(
|
|
103
103
|
);
|
104
104
|
}
|
105
105
|
);
|
106
|
-
var AccordionItemTrigger =
|
106
|
+
var AccordionItemTrigger = React28.forwardRef(function AccordionItemTrigger2(props, ref) {
|
107
107
|
const { startElement, children, headingLevel, ...rest } = props;
|
108
108
|
warnAboutMismatchingIcon({ icon: startElement });
|
109
109
|
const recipe = react.useSlotRecipe({ key: "accordion" });
|
@@ -116,7 +116,7 @@ var AccordionItemTrigger = React29.forwardRef(function AccordionItemTrigger2(pro
|
|
116
116
|
/* @__PURE__ */ jsxRuntime.jsx(react.Accordion.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.DropdownDownFill24Icon, {}) })
|
117
117
|
] }) });
|
118
118
|
});
|
119
|
-
var AccordionItemContent =
|
119
|
+
var AccordionItemContent = React28.forwardRef(function AccordionItemContent2(props, ref) {
|
120
120
|
const { children } = props;
|
121
121
|
const recipe = react.useSlotRecipe({ key: "accordion" });
|
122
122
|
const styles = recipe();
|
@@ -124,7 +124,7 @@ var AccordionItemContent = React29.forwardRef(function AccordionItemContent2(pro
|
|
124
124
|
});
|
125
125
|
Accordion.displayName = "Accordion";
|
126
126
|
var AccordionItem = react.Accordion.Item;
|
127
|
-
var Expandable =
|
127
|
+
var Expandable = React28.forwardRef(
|
128
128
|
(props, ref) => {
|
129
129
|
const { title, children, headingLevel, startElement, ...rest } = props;
|
130
130
|
return /* @__PURE__ */ jsxRuntime.jsx(Accordion, { ...props, ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -169,7 +169,7 @@ var Language = /* @__PURE__ */ ((Language3) => {
|
|
169
169
|
Language3["English"] = "en";
|
170
170
|
return Language3;
|
171
171
|
})(Language || {});
|
172
|
-
var LanguageContext =
|
172
|
+
var LanguageContext = React28.createContext(void 0);
|
173
173
|
function LanguageProvider({
|
174
174
|
language,
|
175
175
|
children
|
@@ -177,7 +177,7 @@ function LanguageProvider({
|
|
177
177
|
return /* @__PURE__ */ jsxRuntime.jsx(LanguageContext.Provider, { value: language, children });
|
178
178
|
}
|
179
179
|
function useLanguage() {
|
180
|
-
const language =
|
180
|
+
const language = React28.useContext(LanguageContext);
|
181
181
|
if (!language) {
|
182
182
|
throw new Error("Please wrap your application in a LanguageProvider");
|
183
183
|
}
|
@@ -195,8 +195,8 @@ function createTexts(texts27) {
|
|
195
195
|
}
|
196
196
|
var hydrating = true;
|
197
197
|
function useHydrated() {
|
198
|
-
const [hydrated, setHydrated] =
|
199
|
-
|
198
|
+
const [hydrated, setHydrated] = React28.useState(() => !hydrating);
|
199
|
+
React28.useEffect(function hydrate() {
|
200
200
|
hydrating = false;
|
201
201
|
setHydrated(true);
|
202
202
|
}, []);
|
@@ -339,11 +339,11 @@ var LightSpinner = ({
|
|
339
339
|
] });
|
340
340
|
};
|
341
341
|
var useRotatingLabel = ({ label, delay }) => {
|
342
|
-
const loadingTextArray =
|
342
|
+
const loadingTextArray = React28.useMemo(
|
343
343
|
() => Array.isArray(label) ? label : [label],
|
344
344
|
[label]
|
345
345
|
);
|
346
|
-
const [currentLoadingTextIndex, setCurrentLoadingTextIndex] =
|
346
|
+
const [currentLoadingTextIndex, setCurrentLoadingTextIndex] = React28.useState(0);
|
347
347
|
usehooksTs.useInterval(() => {
|
348
348
|
setCurrentLoadingTextIndex(
|
349
349
|
(prevIndex) => (prevIndex + 1) % loadingTextArray.length
|
@@ -351,7 +351,7 @@ var useRotatingLabel = ({ label, delay }) => {
|
|
351
351
|
}, delay);
|
352
352
|
return loadingTextArray[currentLoadingTextIndex];
|
353
353
|
};
|
354
|
-
var ProgressBar =
|
354
|
+
var ProgressBar = React28.forwardRef(
|
355
355
|
({
|
356
356
|
value,
|
357
357
|
label,
|
@@ -397,9 +397,9 @@ var progressLoaderRecipe = react.defineRecipe({
|
|
397
397
|
}
|
398
398
|
});
|
399
399
|
var usePathLength = (value) => {
|
400
|
-
const pathRef =
|
401
|
-
const [pathLength, setPathLength] =
|
402
|
-
|
400
|
+
const pathRef = React28.useRef(null);
|
401
|
+
const [pathLength, setPathLength] = React28.useState(0);
|
402
|
+
React28.useEffect(() => {
|
403
403
|
if (pathRef.current) {
|
404
404
|
const totalLength = pathRef.current.getTotalLength();
|
405
405
|
setPathLength(totalLength);
|
@@ -409,7 +409,7 @@ var usePathLength = (value) => {
|
|
409
409
|
return { pathRef, pathLength, progressOffset };
|
410
410
|
};
|
411
411
|
var ProgressLoaderWrapper = react.chakra("div", progressLoaderRecipe);
|
412
|
-
var ProgressLoader =
|
412
|
+
var ProgressLoader = React28.forwardRef(
|
413
413
|
({
|
414
414
|
value,
|
415
415
|
label,
|
@@ -433,7 +433,7 @@ var ProgressLoader = React29.forwardRef(
|
|
433
433
|
pathLength: progressPathLength,
|
434
434
|
progressOffset
|
435
435
|
} = usePathLength(value);
|
436
|
-
const id =
|
436
|
+
const id = React28.useId();
|
437
437
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
438
438
|
ProgressLoaderWrapper,
|
439
439
|
{
|
@@ -565,7 +565,7 @@ var skeletonRecipe = react.defineRecipe({
|
|
565
565
|
}
|
566
566
|
}
|
567
567
|
});
|
568
|
-
var SkeletonCircle =
|
568
|
+
var SkeletonCircle = React28__namespace.forwardRef(function SkeletonCircle2(props, ref) {
|
569
569
|
const recipe = react.useRecipe({ recipe: skeletonRecipe });
|
570
570
|
const [recipeProps, restProps] = recipe.splitVariantProps({
|
571
571
|
loading: true,
|
@@ -575,7 +575,7 @@ var SkeletonCircle = React29__namespace.forwardRef(function SkeletonCircle2(prop
|
|
575
575
|
const { size, css, ...rest } = restProps;
|
576
576
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Circle, { size, asChild: true, ref, children: /* @__PURE__ */ jsxRuntime.jsx(react.Skeleton, { css: { ...recipe(recipeProps), ...css }, ...rest }) });
|
577
577
|
});
|
578
|
-
var SkeletonText =
|
578
|
+
var SkeletonText = React28.forwardRef(
|
579
579
|
function SkeletonText2(props, ref) {
|
580
580
|
const recipe = react.useRecipe({ recipe: skeletonRecipe });
|
581
581
|
const [recipeProps, restProps] = recipe.splitVariantProps({
|
@@ -596,7 +596,7 @@ var SkeletonText = React29.forwardRef(
|
|
596
596
|
)) });
|
597
597
|
}
|
598
598
|
);
|
599
|
-
var Skeleton =
|
599
|
+
var Skeleton = React28.forwardRef(
|
600
600
|
function SkeletonText3(props, ref) {
|
601
601
|
const recipe = react.useRecipe({ recipe: skeletonRecipe });
|
602
602
|
const [recipeProps, restProps] = recipe.splitVariantProps({
|
@@ -634,7 +634,7 @@ var LoadingContent = ({
|
|
634
634
|
loadingText && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { children: loadingText })
|
635
635
|
] })
|
636
636
|
] });
|
637
|
-
var Button =
|
637
|
+
var Button = React28.forwardRef(
|
638
638
|
({
|
639
639
|
loading,
|
640
640
|
disabled,
|
@@ -667,7 +667,7 @@ var Button = React29.forwardRef(
|
|
667
667
|
variant,
|
668
668
|
size,
|
669
669
|
...rest,
|
670
|
-
children: rest.asChild ?
|
670
|
+
children: rest.asChild ? React28.cloneElement(children, {
|
671
671
|
children: renderContent()
|
672
672
|
}) : renderContent()
|
673
673
|
}
|
@@ -701,7 +701,7 @@ var groupRecipe = react.defineRecipe({
|
|
701
701
|
}
|
702
702
|
});
|
703
703
|
var Group = react.chakra(react.Group, groupRecipe);
|
704
|
-
var ButtonGroup =
|
704
|
+
var ButtonGroup = React28.forwardRef(
|
705
705
|
(props, ref) => {
|
706
706
|
const { children, disabled, grow, attached, ...rest } = props;
|
707
707
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -718,7 +718,7 @@ var ButtonGroup = React29.forwardRef(
|
|
718
718
|
}
|
719
719
|
);
|
720
720
|
ButtonGroup.displayName = "ButtonGroup";
|
721
|
-
var Badge =
|
721
|
+
var Badge = React28.forwardRef(function Badge2({ icon, children, ...props }, ref) {
|
722
722
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Badge, { ref, ...props, children: [
|
723
723
|
children,
|
724
724
|
icon && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: icon })
|
@@ -841,12 +841,12 @@ var codeRecipie = react.defineRecipe({
|
|
841
841
|
}
|
842
842
|
});
|
843
843
|
var StyledCode = react.chakra(react.Code, codeRecipie);
|
844
|
-
var Code =
|
844
|
+
var Code = React28__namespace.default.forwardRef(
|
845
845
|
function Code2(props, ref) {
|
846
846
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledCode, { ...props, ref });
|
847
847
|
}
|
848
848
|
);
|
849
|
-
var Heading =
|
849
|
+
var Heading = React28.forwardRef(
|
850
850
|
function Heading2(props, ref) {
|
851
851
|
const {
|
852
852
|
as,
|
@@ -869,13 +869,13 @@ var Heading = React29.forwardRef(
|
|
869
869
|
);
|
870
870
|
}
|
871
871
|
);
|
872
|
-
var Text3 =
|
872
|
+
var Text3 = React28.forwardRef(
|
873
873
|
function Text4(props, ref) {
|
874
874
|
const { variant = "sm", ...rest } = props;
|
875
875
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Text, { ...rest, textStyle: variant, ref });
|
876
876
|
}
|
877
877
|
);
|
878
|
-
var ClipboardIcon =
|
878
|
+
var ClipboardIcon = React28__namespace.forwardRef((props, ref) => {
|
879
879
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
880
880
|
react.Clipboard.Indicator,
|
881
881
|
{
|
@@ -887,7 +887,7 @@ var ClipboardIcon = React29__namespace.forwardRef((props, ref) => {
|
|
887
887
|
);
|
888
888
|
});
|
889
889
|
ClipboardIcon.displayName = "ClipboardIcon";
|
890
|
-
var ClipboardCopyText =
|
890
|
+
var ClipboardCopyText = React28__namespace.forwardRef((props, ref) => {
|
891
891
|
const { t } = useTranslation();
|
892
892
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
893
893
|
react.Clipboard.Indicator,
|
@@ -900,7 +900,7 @@ var ClipboardCopyText = React29__namespace.forwardRef((props, ref) => {
|
|
900
900
|
);
|
901
901
|
});
|
902
902
|
ClipboardCopyText.displayName = "ClipboardCopyText";
|
903
|
-
var ClipboardButton =
|
903
|
+
var ClipboardButton = React28__namespace.forwardRef((props, ref) => {
|
904
904
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Clipboard.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { ref, size: "xs", leftIcon: /* @__PURE__ */ jsxRuntime.jsx(ClipboardIcon, {}), ...props, children: /* @__PURE__ */ jsxRuntime.jsx(ClipboardCopyText, {}) }) });
|
905
905
|
});
|
906
906
|
ClipboardButton.displayName = "ClipboardButton";
|
@@ -919,7 +919,7 @@ var texts3 = createTexts({
|
|
919
919
|
sv: "Kopierad"
|
920
920
|
}
|
921
921
|
});
|
922
|
-
var IconButton =
|
922
|
+
var IconButton = React28.forwardRef(
|
923
923
|
(props, ref) => {
|
924
924
|
const { icon, size = "sm", loading = false, ...rest } = props;
|
925
925
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -936,7 +936,7 @@ var IconButton = React29.forwardRef(
|
|
936
936
|
}
|
937
937
|
);
|
938
938
|
IconButton.displayName = "IconButton";
|
939
|
-
var CloseButton =
|
939
|
+
var CloseButton = React28.forwardRef(
|
940
940
|
({ size = "sm", ...props }, ref) => {
|
941
941
|
const { t } = useTranslation();
|
942
942
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -975,7 +975,7 @@ var texts4 = createTexts({
|
|
975
975
|
sv: "St\xE4ng"
|
976
976
|
}
|
977
977
|
});
|
978
|
-
var FloatingActionButton =
|
978
|
+
var FloatingActionButton = React28.forwardRef(
|
979
979
|
({
|
980
980
|
children,
|
981
981
|
icon,
|
@@ -984,11 +984,11 @@ var FloatingActionButton = React29.forwardRef(
|
|
984
984
|
placement = "bottom right",
|
985
985
|
...props
|
986
986
|
}, ref) => {
|
987
|
-
const [isTextVisible, setIsTextVisible] =
|
987
|
+
const [isTextVisible, setIsTextVisible] = React28__namespace.default.useState(
|
988
988
|
externalIsTextVisible === void 0 ? false : externalIsTextVisible
|
989
989
|
);
|
990
990
|
const scrollDirection = useScrollDirection();
|
991
|
-
|
991
|
+
React28.useEffect(() => {
|
992
992
|
if (externalIsTextVisible !== void 0) {
|
993
993
|
return;
|
994
994
|
}
|
@@ -998,7 +998,7 @@ var FloatingActionButton = React29.forwardRef(
|
|
998
998
|
);
|
999
999
|
return () => globalThis.clearTimeout(id);
|
1000
1000
|
}, [scrollDirection, externalIsTextVisible]);
|
1001
|
-
|
1001
|
+
React28.useEffect(() => {
|
1002
1002
|
setIsTextVisible(!!externalIsTextVisible);
|
1003
1003
|
}, [externalIsTextVisible]);
|
1004
1004
|
const recipe = react.useSlotRecipe({ key: "floatingActionButton" });
|
@@ -1025,11 +1025,11 @@ var FloatingActionButton = React29.forwardRef(
|
|
1025
1025
|
);
|
1026
1026
|
FloatingActionButton.displayName = "FloatingActionButton";
|
1027
1027
|
var useScrollDirection = () => {
|
1028
|
-
const [scrollDirection, setScrollDirection] =
|
1029
|
-
const lastScrollPosition =
|
1028
|
+
const [scrollDirection, setScrollDirection] = React28__namespace.default.useState(null);
|
1029
|
+
const lastScrollPosition = React28__namespace.default.useRef(
|
1030
1030
|
globalThis.window === void 0 ? 0 : window.scrollY
|
1031
1031
|
);
|
1032
|
-
|
1032
|
+
React28__namespace.default.useEffect(() => {
|
1033
1033
|
const onScroll = () => {
|
1034
1034
|
const delta = window.scrollY - lastScrollPosition.current;
|
1035
1035
|
if (delta === 0) {
|
@@ -1135,7 +1135,7 @@ var texts5 = createTexts({
|
|
1135
1135
|
en: "Service"
|
1136
1136
|
}
|
1137
1137
|
});
|
1138
|
-
var Alert =
|
1138
|
+
var Alert = React28.forwardRef((props, ref) => {
|
1139
1139
|
const {
|
1140
1140
|
title,
|
1141
1141
|
showIndicator = true,
|
@@ -1182,7 +1182,7 @@ var Alert = React29.forwardRef((props, ref) => {
|
|
1182
1182
|
] });
|
1183
1183
|
});
|
1184
1184
|
Alert.displayName = "Alert";
|
1185
|
-
var ExpandableAlert =
|
1185
|
+
var ExpandableAlert = React28.forwardRef(
|
1186
1186
|
(props, ref) => {
|
1187
1187
|
const {
|
1188
1188
|
variant = "info",
|
@@ -1243,7 +1243,7 @@ var ExpandableAlert = React29.forwardRef(
|
|
1243
1243
|
}
|
1244
1244
|
);
|
1245
1245
|
ExpandableAlert.displayName = "ExpandableAlert";
|
1246
|
-
var ServiceAlert =
|
1246
|
+
var ServiceAlert = React28.forwardRef(
|
1247
1247
|
(props, ref) => {
|
1248
1248
|
const {
|
1249
1249
|
variant = "service",
|
@@ -1345,14 +1345,14 @@ var texts6 = createTexts({
|
|
1345
1345
|
en: "Traffic announcement"
|
1346
1346
|
}
|
1347
1347
|
});
|
1348
|
-
var Breadcrumb =
|
1348
|
+
var Breadcrumb = React28.forwardRef(
|
1349
1349
|
({ children, ...props }, ref) => {
|
1350
|
-
const validChildren =
|
1351
|
-
(element) =>
|
1350
|
+
const validChildren = React28__namespace.default.Children.toArray(children).filter(
|
1351
|
+
(element) => React28__namespace.default.isValidElement(element)
|
1352
1352
|
);
|
1353
1353
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Breadcrumb.Root, { ref, ...props, children: /* @__PURE__ */ jsxRuntime.jsx(react.Breadcrumb.List, { children: validChildren.map((child, index) => {
|
1354
1354
|
const isLast = index === validChildren.length - 1;
|
1355
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
1355
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React28__namespace.default.Fragment, { children: [
|
1356
1356
|
/* @__PURE__ */ jsxRuntime.jsx(react.Breadcrumb.Item, { children: child }),
|
1357
1357
|
!isLast && /* @__PURE__ */ jsxRuntime.jsx(react.Breadcrumb.Separator, { "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.DropdownRightFill18Icon, {}) })
|
1358
1358
|
] }, index);
|
@@ -1382,7 +1382,7 @@ function ColorModeIcon() {
|
|
1382
1382
|
const { colorMode } = useColorMode();
|
1383
1383
|
return colorMode === "dark" ? /* @__PURE__ */ jsxRuntime.jsx(lu.LuMoon, {}) : /* @__PURE__ */ jsxRuntime.jsx(lu.LuSun, {});
|
1384
1384
|
}
|
1385
|
-
var ColorModeButton =
|
1385
|
+
var ColorModeButton = React28__namespace.forwardRef(function ColorModeButton2(props, ref) {
|
1386
1386
|
const { toggleColorMode } = useColorMode();
|
1387
1387
|
return /* @__PURE__ */ jsxRuntime.jsx(react.ClientOnly, { fallback: /* @__PURE__ */ jsxRuntime.jsx(react.Skeleton, { boxSize: "8" }), children: /* @__PURE__ */ jsxRuntime.jsx(
|
1388
1388
|
react.IconButton,
|
@@ -1403,21 +1403,90 @@ var ColorModeButton = React29__namespace.forwardRef(function ColorModeButton2(pr
|
|
1403
1403
|
}
|
1404
1404
|
) });
|
1405
1405
|
});
|
1406
|
-
var
|
1406
|
+
var FloatingLabel = React28.forwardRef(
|
1407
|
+
(props, ref) => /* @__PURE__ */ jsxRuntime.jsx(react.Field.Label, { ref, ...props, css: floatingLabelStyles })
|
1408
|
+
);
|
1409
|
+
FloatingLabel.displayName = "FloatingLabel";
|
1410
|
+
var floatingLabelStyles = react.defineStyle({
|
1411
|
+
paddingX: 3,
|
1412
|
+
fontWeight: "normal",
|
1413
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1414
|
+
color: "text",
|
1415
|
+
pointerEvents: "none",
|
1416
|
+
zIndex: "docked",
|
1417
|
+
_disabled: {
|
1418
|
+
opacity: 0.4
|
1419
|
+
},
|
1420
|
+
pos: "absolute",
|
1421
|
+
top: "0.3rem",
|
1422
|
+
transition: "position",
|
1423
|
+
_peerPlaceholderShown: {
|
1424
|
+
/* For when input is not in focus */
|
1425
|
+
top: "0.9rem",
|
1426
|
+
color: "text",
|
1427
|
+
fontSize: ["mobile.sm", "desktop.sm"]
|
1428
|
+
},
|
1429
|
+
_peerFocusVisible: {
|
1430
|
+
/* For when input is in focus */
|
1431
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1432
|
+
color: "text",
|
1433
|
+
top: "0.3rem"
|
1434
|
+
}
|
1435
|
+
});
|
1436
|
+
var Label = (props) => /* @__PURE__ */ jsxRuntime.jsx(react.Field.Label, { ...props, css: labelStyles });
|
1437
|
+
var labelStyles = react.defineStyle({
|
1438
|
+
fontWeight: "normal",
|
1439
|
+
paddingBottom: 1,
|
1440
|
+
paddingX: 1,
|
1441
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1442
|
+
color: "text",
|
1443
|
+
pointerEvents: "none",
|
1444
|
+
zIndex: "docked",
|
1445
|
+
_disabled: {
|
1446
|
+
opacity: 0.4
|
1447
|
+
}
|
1448
|
+
});
|
1449
|
+
var Field3 = React28__namespace.forwardRef(
|
1407
1450
|
(props, ref) => {
|
1408
|
-
const {
|
1409
|
-
|
1410
|
-
const styles = recipe({ label, helperText, errorText });
|
1411
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Field.Root, { ref, ...rest, css: styles.root, children: [
|
1451
|
+
const {
|
1452
|
+
label,
|
1412
1453
|
children,
|
1413
|
-
helperText
|
1414
|
-
|
1415
|
-
|
1454
|
+
helperText,
|
1455
|
+
errorText,
|
1456
|
+
floatingLabel = false,
|
1457
|
+
disabled,
|
1458
|
+
invalid,
|
1459
|
+
readOnly,
|
1460
|
+
required,
|
1461
|
+
direction,
|
1462
|
+
...rest
|
1463
|
+
} = props;
|
1464
|
+
const recipe = react.useSlotRecipe({ key: "field" });
|
1465
|
+
const styles = recipe();
|
1466
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(react.Stack, { gap: "2", ref, ...rest, width: "100%", children: [
|
1467
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
1468
|
+
react.Field.Root,
|
1469
|
+
{
|
1470
|
+
disabled,
|
1471
|
+
invalid,
|
1472
|
+
readOnly,
|
1473
|
+
required,
|
1474
|
+
css: styles.root,
|
1475
|
+
direction,
|
1476
|
+
children: [
|
1477
|
+
label && !floatingLabel && /* @__PURE__ */ jsxRuntime.jsx(Label, { children: label }),
|
1478
|
+
children,
|
1479
|
+
label && floatingLabel && /* @__PURE__ */ jsxRuntime.jsx(FloatingLabel, { children: label }),
|
1480
|
+
errorText && /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { children: errorText })
|
1481
|
+
]
|
1482
|
+
}
|
1483
|
+
),
|
1484
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx(Text3, { fontSize: "sm", color: "text.tertiary", children: helperText })
|
1416
1485
|
] });
|
1417
1486
|
}
|
1418
1487
|
);
|
1419
|
-
|
1420
|
-
var FieldErrorText =
|
1488
|
+
Field3.displayName = "Field";
|
1489
|
+
var FieldErrorText = React28__namespace.forwardRef((props, ref) => {
|
1421
1490
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { ref, children: props.children });
|
1422
1491
|
});
|
1423
1492
|
FieldErrorText.displayName = "FieldErrorText";
|
@@ -1885,7 +1954,7 @@ function CalendarCell({
|
|
1885
1954
|
currentMonth,
|
1886
1955
|
variant
|
1887
1956
|
}) {
|
1888
|
-
const ref =
|
1957
|
+
const ref = React28.useRef(null);
|
1889
1958
|
const {
|
1890
1959
|
cellProps,
|
1891
1960
|
buttonProps,
|
@@ -1913,7 +1982,7 @@ function CalendarCell({
|
|
1913
1982
|
if (isOutsideMonth) {
|
1914
1983
|
stateProps["data-unavailable"] = true;
|
1915
1984
|
}
|
1916
|
-
|
1985
|
+
React28.useEffect(() => {
|
1917
1986
|
var _a5;
|
1918
1987
|
(_a5 = ref.current) == null ? void 0 : _a5.addEventListener(
|
1919
1988
|
"touchend",
|
@@ -2024,7 +2093,7 @@ function CalendarNavigationButton({
|
|
2024
2093
|
"aria-label": ariaLabel,
|
2025
2094
|
...rest
|
2026
2095
|
}) {
|
2027
|
-
const ref =
|
2096
|
+
const ref = React28.useRef(null);
|
2028
2097
|
const { buttonProps } = reactAria.useButton(rest, ref);
|
2029
2098
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2030
2099
|
IconButton,
|
@@ -2185,7 +2254,7 @@ var texts8 = createTexts({
|
|
2185
2254
|
en: "Calendar"
|
2186
2255
|
}
|
2187
2256
|
});
|
2188
|
-
var CalendarTriggerButton =
|
2257
|
+
var CalendarTriggerButton = React28.forwardRef(({ variant, disabled, ariaLabelledby, ...buttonProps }) => {
|
2189
2258
|
const { t } = useTranslation();
|
2190
2259
|
const recipe = react.useSlotRecipe({
|
2191
2260
|
key: "datePicker",
|
@@ -2213,9 +2282,9 @@ var texts9 = createTexts({
|
|
2213
2282
|
en: "Open calendar"
|
2214
2283
|
}
|
2215
2284
|
});
|
2216
|
-
var DateTimeSegment =
|
2285
|
+
var DateTimeSegment = React28.forwardRef(
|
2217
2286
|
({ segment, state, ariaLabel, ariaDescription }, externalRef) => {
|
2218
|
-
const internalRef =
|
2287
|
+
const internalRef = React28.useRef(null);
|
2219
2288
|
const ref = externalRef ?? internalRef;
|
2220
2289
|
const { segmentProps } = reactAria.useDateSegment(
|
2221
2290
|
segment,
|
@@ -2263,7 +2332,7 @@ function createCalendar2(identifier) {
|
|
2263
2332
|
}
|
2264
2333
|
}
|
2265
2334
|
}
|
2266
|
-
var DateField =
|
2335
|
+
var DateField = React28.forwardRef(
|
2267
2336
|
({ labelId, ...props }, externalRef) => {
|
2268
2337
|
var _a5;
|
2269
2338
|
const locale = useCurrentLocale();
|
@@ -2278,7 +2347,7 @@ var DateField = React29.forwardRef(
|
|
2278
2347
|
createCalendar: createCalendar2
|
2279
2348
|
});
|
2280
2349
|
const { t } = useTranslation();
|
2281
|
-
const internalRef =
|
2350
|
+
const internalRef = React28.useRef(null);
|
2282
2351
|
const ref = externalRef ?? internalRef;
|
2283
2352
|
const { fieldProps } = reactAria.useDateField(
|
2284
2353
|
props,
|
@@ -2355,7 +2424,7 @@ var getAriaLabel = (segmentType) => {
|
|
2355
2424
|
}
|
2356
2425
|
}
|
2357
2426
|
};
|
2358
|
-
var StyledField =
|
2427
|
+
var StyledField = React28.forwardRef(
|
2359
2428
|
function StyledField2(props, ref) {
|
2360
2429
|
const { children, variant, isDisabled, ariaLabelledby, ...otherProps } = props;
|
2361
2430
|
const { invalid } = react.useFieldContext() ?? {
|
@@ -2379,33 +2448,35 @@ var StyledField = React29.forwardRef(
|
|
2379
2448
|
);
|
2380
2449
|
}
|
2381
2450
|
);
|
2382
|
-
var DatePicker =
|
2451
|
+
var DatePicker = React28.forwardRef(
|
2383
2452
|
({
|
2384
2453
|
variant,
|
2385
|
-
|
2454
|
+
errorText,
|
2386
2455
|
minHeight,
|
2387
2456
|
showYearNavigation,
|
2388
2457
|
withPortal = true,
|
2389
2458
|
width = "auto",
|
2459
|
+
invalid = false,
|
2460
|
+
helperText,
|
2390
2461
|
...props
|
2391
2462
|
}, externalRef) => {
|
2392
2463
|
const chakraFieldProps = react.useFieldContext();
|
2393
2464
|
const state = reactStately.useDatePickerState({
|
2394
2465
|
...props,
|
2395
2466
|
shouldCloseOnSelect: true,
|
2396
|
-
errorMessage,
|
2467
|
+
errorMessage: errorText,
|
2397
2468
|
isRequired: props.isRequired ?? (chakraFieldProps == null ? void 0 : chakraFieldProps.required),
|
2398
2469
|
validationState: (chakraFieldProps == null ? void 0 : chakraFieldProps.invalid) ? "invalid" : "valid"
|
2399
2470
|
});
|
2400
|
-
const internalRef =
|
2471
|
+
const internalRef = React28.useRef(null);
|
2401
2472
|
const ref = externalRef ?? internalRef;
|
2402
2473
|
const { labelProps, fieldProps, buttonProps, dialogProps, calendarProps } = reactAria.useDatePicker(
|
2403
2474
|
props,
|
2404
2475
|
state,
|
2405
2476
|
ref
|
2406
2477
|
);
|
2407
|
-
const labelId = `label-${
|
2408
|
-
const inputGroupId = `input-group-${
|
2478
|
+
const labelId = `label-${React28.useId()}`;
|
2479
|
+
const inputGroupId = `input-group-${React28.useId()}`;
|
2409
2480
|
const recipe = react.useSlotRecipe({
|
2410
2481
|
key: "datePicker",
|
2411
2482
|
recipe: datePickerSlotRecipe
|
@@ -2432,12 +2503,14 @@ var DatePicker = React29.forwardRef(
|
|
2432
2503
|
width,
|
2433
2504
|
children: /* @__PURE__ */ jsxRuntime.jsxs(react.Popover.Root, { ...dialogProps, children: [
|
2434
2505
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2435
|
-
|
2506
|
+
Field3,
|
2436
2507
|
{
|
2437
2508
|
display: "inline-flex",
|
2438
2509
|
id: inputGroupId,
|
2439
2510
|
"aria-labelledby": labelId,
|
2440
|
-
errorText
|
2511
|
+
errorText,
|
2512
|
+
invalid,
|
2513
|
+
helperText,
|
2441
2514
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
2442
2515
|
StyledField,
|
2443
2516
|
{
|
@@ -2494,7 +2567,7 @@ function RangeCalendar(props) {
|
|
2494
2567
|
recipe: datePickerSlotRecipe
|
2495
2568
|
});
|
2496
2569
|
const styles = recipe({});
|
2497
|
-
const ref =
|
2570
|
+
const ref = React28.useRef(null);
|
2498
2571
|
const { calendarProps, title } = reactAria.useRangeCalendar(props, state, ref);
|
2499
2572
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { ...calendarProps, ref, css: styles.rangeCalendarPopover, children: [
|
2500
2573
|
/* @__PURE__ */ jsxRuntime.jsx(CalendarHeader, { state, title }),
|
@@ -2517,16 +2590,21 @@ function DateRangePicker({
|
|
2517
2590
|
startName,
|
2518
2591
|
endName,
|
2519
2592
|
withPortal = true,
|
2593
|
+
errorText,
|
2594
|
+
helperText,
|
2595
|
+
invalid,
|
2520
2596
|
...props
|
2521
2597
|
}) {
|
2522
2598
|
const fieldContextPRops = react.useFieldContext();
|
2523
2599
|
const state = reactStately.useDateRangePickerState({
|
2524
2600
|
...props,
|
2525
2601
|
shouldCloseOnSelect: true,
|
2526
|
-
|
2602
|
+
isInvalid: invalid,
|
2603
|
+
errorMessage: errorText,
|
2604
|
+
isRequired: props.required ?? (fieldContextPRops == null ? void 0 : fieldContextPRops.required),
|
2527
2605
|
validationState: (fieldContextPRops == null ? void 0 : fieldContextPRops.invalid) ? "invalid" : "valid"
|
2528
2606
|
});
|
2529
|
-
const ref =
|
2607
|
+
const ref = React28.useRef(null);
|
2530
2608
|
const uniqueId = reactAria.useId();
|
2531
2609
|
const datePickerId = `date-range-picker-${uniqueId}`;
|
2532
2610
|
const {
|
@@ -2550,61 +2628,72 @@ function DateRangePicker({
|
|
2550
2628
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAria.I18nProvider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", display: "inline-flex", flexDirection: "column", children: [
|
2551
2629
|
props.label && /* @__PURE__ */ jsxRuntime.jsx("label", { ...labelProps, htmlFor: datePickerId, children: props.label }),
|
2552
2630
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Popover.Root, { ...dialogProps, children: [
|
2553
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
2554
|
-
|
2631
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2632
|
+
Field3,
|
2555
2633
|
{
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
2590
|
-
|
2591
|
-
|
2592
|
-
|
2593
|
-
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2634
|
+
width: "auto",
|
2635
|
+
display: "inline-flex",
|
2636
|
+
id: datePickerId,
|
2637
|
+
errorText,
|
2638
|
+
helperText,
|
2639
|
+
invalid,
|
2640
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
2641
|
+
StyledField,
|
2642
|
+
{
|
2643
|
+
alignItems: "center",
|
2644
|
+
paddingX: 3,
|
2645
|
+
variant,
|
2646
|
+
onClick: onFieldClick,
|
2647
|
+
minHeight,
|
2648
|
+
children: [
|
2649
|
+
variant && /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
2650
|
+
CalendarTriggerButton,
|
2651
|
+
{
|
2652
|
+
variant,
|
2653
|
+
ref,
|
2654
|
+
...buttonProps
|
2655
|
+
}
|
2656
|
+
) }),
|
2657
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2658
|
+
DateField,
|
2659
|
+
{
|
2660
|
+
...startFieldProps,
|
2661
|
+
name: startName,
|
2662
|
+
label: props.startLabel,
|
2663
|
+
labelProps
|
2664
|
+
}
|
2665
|
+
),
|
2666
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2667
|
+
react.Box,
|
2668
|
+
{
|
2669
|
+
as: "span",
|
2670
|
+
"aria-hidden": "true",
|
2671
|
+
paddingRight: "2",
|
2672
|
+
paddingLeft: "2",
|
2673
|
+
children: "\u2013"
|
2674
|
+
}
|
2675
|
+
),
|
2676
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2677
|
+
DateField,
|
2678
|
+
{
|
2679
|
+
...endFieldProps,
|
2680
|
+
name: endName,
|
2681
|
+
label: props.endLabel,
|
2682
|
+
labelProps
|
2683
|
+
}
|
2684
|
+
)
|
2685
|
+
]
|
2686
|
+
}
|
2687
|
+
) })
|
2599
2688
|
}
|
2600
|
-
)
|
2689
|
+
),
|
2601
2690
|
state.isOpen && withPortal && /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: popoverContent }),
|
2602
2691
|
state.isOpen && !withPortal && popoverContent
|
2603
2692
|
] })
|
2604
2693
|
] }) });
|
2605
2694
|
}
|
2606
2695
|
var TimeField = ({ state, ...props }) => {
|
2607
|
-
const ref =
|
2696
|
+
const ref = React28.useRef(null);
|
2608
2697
|
const { labelProps, fieldProps } = reactAria.useTimeField(props, state, ref);
|
2609
2698
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { children: [
|
2610
2699
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -2644,7 +2733,7 @@ var TimePicker = ({
|
|
2644
2733
|
name,
|
2645
2734
|
...boxProps
|
2646
2735
|
}) => {
|
2647
|
-
const { disabled: fieldDisabled, invalid: fieldInvalid } =
|
2736
|
+
const { disabled: fieldDisabled, invalid: fieldInvalid } = react.useFieldContext() ?? {};
|
2648
2737
|
const isDisabled = isDisabledExternally ?? fieldDisabled ?? false;
|
2649
2738
|
const { t } = useTranslation();
|
2650
2739
|
const locale = useCurrentLocale();
|
@@ -2691,7 +2780,7 @@ var TimePicker = ({
|
|
2691
2780
|
const ariaLabel = `${inputLabel} \u2013 ${t(
|
2692
2781
|
texts11.selectedTimeIs(`${(dateTime == null ? void 0 : dateTime.hour) ?? 0} ${(dateTime == null ? void 0 : dateTime.minute) ?? 0}`)
|
2693
2782
|
)}`;
|
2694
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field3, { as: "time", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
2695
2784
|
StyledField,
|
2696
2785
|
{
|
2697
2786
|
width: "fit-content",
|
@@ -2771,10 +2860,7 @@ var texts11 = createTexts({
|
|
2771
2860
|
sv: "minuter"
|
2772
2861
|
}
|
2773
2862
|
});
|
2774
|
-
|
2775
|
-
throw new Error("Function not implemented.");
|
2776
|
-
}
|
2777
|
-
var DialogContent = React29__namespace.forwardRef((props, ref) => {
|
2863
|
+
var DialogContent = React28__namespace.forwardRef((props, ref) => {
|
2778
2864
|
const {
|
2779
2865
|
children,
|
2780
2866
|
portalled = true,
|
@@ -2788,7 +2874,7 @@ var DialogContent = React29__namespace.forwardRef((props, ref) => {
|
|
2788
2874
|
] });
|
2789
2875
|
});
|
2790
2876
|
DialogContent.displayName = "DialogContent";
|
2791
|
-
var DialogCloseTrigger =
|
2877
|
+
var DialogCloseTrigger = React28__namespace.forwardRef(function DialogCloseTrigger2(props, ref) {
|
2792
2878
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Dialog.CloseTrigger, { ref, ...props, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "md" }) });
|
2793
2879
|
});
|
2794
2880
|
var DialogRoot = react.Dialog.Root;
|
@@ -2803,7 +2889,7 @@ var DialogActionTrigger = react.Dialog.ActionTrigger;
|
|
2803
2889
|
var [RootDrawerProvider, useRootDrawerProps] = react.createContext({
|
2804
2890
|
name: "RootDrawerProvider"
|
2805
2891
|
});
|
2806
|
-
var DrawerContent =
|
2892
|
+
var DrawerContent = React28.forwardRef(
|
2807
2893
|
(props, ref) => {
|
2808
2894
|
const { children, portalled = true, portalRef, ...rest } = props;
|
2809
2895
|
const { size, placement } = useRootDrawerProps();
|
@@ -2816,7 +2902,7 @@ var DrawerContent = React29.forwardRef(
|
|
2816
2902
|
}
|
2817
2903
|
);
|
2818
2904
|
DrawerContent.displayName = "DrawerContent";
|
2819
|
-
var CloseDrawerLine =
|
2905
|
+
var CloseDrawerLine = React28.forwardRef((props, ref) => {
|
2820
2906
|
const { t } = useTranslation();
|
2821
2907
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2822
2908
|
react.Drawer.CloseTrigger,
|
@@ -2843,17 +2929,17 @@ var CloseDrawerLine = React29.forwardRef((props, ref) => {
|
|
2843
2929
|
);
|
2844
2930
|
});
|
2845
2931
|
CloseDrawerLine.displayName = "CloseDrawerLine";
|
2846
|
-
var DrawerCloseTrigger =
|
2932
|
+
var DrawerCloseTrigger = React28.forwardRef(function DrawerCloseTrigger2(props, ref) {
|
2847
2933
|
const { size } = useRootDrawerProps();
|
2848
2934
|
const { t } = useTranslation();
|
2849
2935
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.CloseTrigger, { ref, ...props, asChild: true, children: size === "full" ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", leftIcon: /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.CloseFill24Icon, {}), children: t(texts12.close) }) : /* @__PURE__ */ jsxRuntime.jsx(CloseButton, { size: "md" }) });
|
2850
2936
|
});
|
2851
|
-
var DrawerBackTrigger =
|
2937
|
+
var DrawerBackTrigger = React28.forwardRef((props, ref) => {
|
2852
2938
|
const { t } = useTranslation();
|
2853
2939
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.CloseTrigger, { asChild: true, ...props, ref, top: "0", children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", leftIcon: /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.ArrowLeftFill24Icon, {}), children: t(texts12.back) }) });
|
2854
2940
|
});
|
2855
2941
|
DrawerBackTrigger.displayName = "DrawerBackTrigger";
|
2856
|
-
var DrawerFullScreenHeader =
|
2942
|
+
var DrawerFullScreenHeader = React28.forwardRef((props, ref) => {
|
2857
2943
|
const { backTrigger = true, title } = props;
|
2858
2944
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Drawer.Header, { ...props, ref, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Grid, { templateColumns: "1fr auto 1fr", height: "auto", paddingX: "8", children: [
|
2859
2945
|
/* @__PURE__ */ jsxRuntime.jsx(react.GridItem, { width: "full", alignSelf: "center", children: backTrigger && /* @__PURE__ */ jsxRuntime.jsx(DrawerBackTrigger, {}) }),
|
@@ -2932,7 +3018,7 @@ var attachedInputsRecipe = react.defineRecipe({
|
|
2932
3018
|
}
|
2933
3019
|
});
|
2934
3020
|
var StyledGroup = react.chakra(react.Group, attachedInputsRecipe);
|
2935
|
-
var AttachedInputs =
|
3021
|
+
var AttachedInputs = React28.forwardRef(
|
2936
3022
|
(props, ref) => {
|
2937
3023
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledGroup, { ref, attached: true, ...props });
|
2938
3024
|
}
|
@@ -2941,7 +3027,7 @@ AttachedInputs.displayName = "AttachedInputs";
|
|
2941
3027
|
var CardSelect = ({ size = "md", ...props }) => {
|
2942
3028
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Root, { size, ...props });
|
2943
3029
|
};
|
2944
|
-
var CardSelectContent =
|
3030
|
+
var CardSelectContent = React28.forwardRef(
|
2945
3031
|
({ children, ...props }, ref) => {
|
2946
3032
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Content, { ref, padding: 0, bg: "none", children: /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Body, { ...props, children: /* @__PURE__ */ jsxRuntime.jsx(
|
2947
3033
|
StaticCard,
|
@@ -2962,7 +3048,7 @@ var bgActiveStyleMap = {
|
|
2962
3048
|
ghost: "ghost.surface.active",
|
2963
3049
|
floating: "floating.surface.active"
|
2964
3050
|
};
|
2965
|
-
var CardSelectTrigger =
|
3051
|
+
var CardSelectTrigger = React28.forwardRef(
|
2966
3052
|
({ icon, variant = "core", withChevron = true, size, children, ...props }, ref) => {
|
2967
3053
|
const ChevronIcon = size === "sm" ? sporIconReact.DropdownDownFill18Icon : sporIconReact.DropdownDownFill24Icon;
|
2968
3054
|
const { open } = react.usePopoverContext();
|
@@ -2987,7 +3073,7 @@ var CardSelectTrigger = React29.forwardRef(
|
|
2987
3073
|
}
|
2988
3074
|
);
|
2989
3075
|
CardSelectTrigger.displayName = "CardSelectTrigger";
|
2990
|
-
var Checkbox =
|
3076
|
+
var Checkbox = React28__namespace.forwardRef(
|
2991
3077
|
(props, ref) => {
|
2992
3078
|
const { children, inputProps, rootRef, ...rest } = props;
|
2993
3079
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Checkbox.Root, { ref: rootRef, ...rest, children: [
|
@@ -2998,27 +3084,36 @@ var Checkbox = React29__namespace.forwardRef(
|
|
2998
3084
|
}
|
2999
3085
|
);
|
3000
3086
|
Checkbox.displayName = "Checkbox";
|
3001
|
-
var CheckboxGroup =
|
3087
|
+
var CheckboxGroup = React28.forwardRef(
|
3002
3088
|
(props, ref) => {
|
3003
3089
|
const { direction = "row", children, gap = 1, ...rest } = props;
|
3004
3090
|
return /* @__PURE__ */ jsxRuntime.jsx(react.CheckboxGroup, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(react.Stack, { direction, gap, children }) });
|
3005
3091
|
}
|
3006
3092
|
);
|
3007
3093
|
CheckboxGroup.displayName = "CheckboxGroup";
|
3008
|
-
var ChoiceChip =
|
3009
|
-
({ children, icon, ...rootProps }, ref) => {
|
3010
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3016
|
-
|
3017
|
-
|
3094
|
+
var ChoiceChip = React28.forwardRef(
|
3095
|
+
({ children, icon, onCheckedChange, ...rootProps }, ref) => {
|
3096
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
3097
|
+
react.CheckboxCard.Root,
|
3098
|
+
{
|
3099
|
+
...rootProps,
|
3100
|
+
...onCheckedChange && {
|
3101
|
+
onCheckedChange: (details) => onCheckedChange(!!details.checked)
|
3102
|
+
},
|
3103
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react.CheckboxCard.Context, { children: ({ checked }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
3104
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.CheckboxCard.HiddenInput, { ref }),
|
3105
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.CheckboxCard.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(react.CheckboxCard.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(react.CheckboxCard.Label, { children: [
|
3106
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx(react.Span, { width: "24px", children: checked ? icon.checked : icon.default }),
|
3107
|
+
rootProps.chipType !== "icon" && children,
|
3108
|
+
rootProps.chipType === "filter" && checked && /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.CloseOutline24Icon, {})
|
3109
|
+
] }) }) })
|
3110
|
+
] }) })
|
3111
|
+
}
|
3112
|
+
);
|
3018
3113
|
}
|
3019
3114
|
);
|
3020
3115
|
ChoiceChip.displayName = "ChoiceChip";
|
3021
|
-
var Popover =
|
3116
|
+
var Popover = React28.forwardRef(
|
3022
3117
|
({
|
3023
3118
|
children,
|
3024
3119
|
state,
|
@@ -3032,7 +3127,7 @@ var Popover = React29.forwardRef(
|
|
3032
3127
|
containerPadding = 12
|
3033
3128
|
}, ref) => {
|
3034
3129
|
var _a5;
|
3035
|
-
const internalRef =
|
3130
|
+
const internalRef = React28.useRef(null);
|
3036
3131
|
const popoverRef = ref ?? internalRef;
|
3037
3132
|
const { popoverProps, underlayProps } = reactAria.usePopover(
|
3038
3133
|
{
|
@@ -3070,7 +3165,7 @@ var Popover = React29.forwardRef(
|
|
3070
3165
|
}
|
3071
3166
|
);
|
3072
3167
|
Popover.displayName = "Popover";
|
3073
|
-
var Combobox =
|
3168
|
+
var Combobox = React28.forwardRef(
|
3074
3169
|
(props) => {
|
3075
3170
|
const {
|
3076
3171
|
label,
|
@@ -3099,11 +3194,11 @@ var Combobox = React29.forwardRef(
|
|
3099
3194
|
variant
|
3100
3195
|
} = props;
|
3101
3196
|
const { contains } = reactAria.useFilter({ sensitivity: "base" });
|
3102
|
-
const fallbackInputRef =
|
3197
|
+
const fallbackInputRef = React28.useRef(null);
|
3103
3198
|
const inputRef = externalInputRef ?? fallbackInputRef;
|
3104
|
-
const listBoxRef =
|
3105
|
-
const popoverRef =
|
3106
|
-
const listboxId = `${
|
3199
|
+
const listBoxRef = React28.useRef(null);
|
3200
|
+
const popoverRef = React28.useRef(null);
|
3201
|
+
const listboxId = `${React28.useId()}-listbox`;
|
3107
3202
|
const inputWidth = useInputWidth(inputRef);
|
3108
3203
|
const state = reactStately.useComboBoxState({
|
3109
3204
|
defaultFilter: contains,
|
@@ -3148,6 +3243,11 @@ var Combobox = React29.forwardRef(
|
|
3148
3243
|
"aria-haspopup": "listbox",
|
3149
3244
|
ref: inputRef,
|
3150
3245
|
role: "combobox",
|
3246
|
+
errorText: props.errorText,
|
3247
|
+
helperText: props.helperText,
|
3248
|
+
required: props.required,
|
3249
|
+
disabled: props.disabled,
|
3250
|
+
invalid: props.invalid,
|
3151
3251
|
label,
|
3152
3252
|
variant,
|
3153
3253
|
"aria-expanded": state.isOpen,
|
@@ -3208,8 +3308,8 @@ var Combobox = React29.forwardRef(
|
|
3208
3308
|
);
|
3209
3309
|
Combobox.displayName = "Combobox";
|
3210
3310
|
var useInputWidth = (inputRef) => {
|
3211
|
-
const [inputWidth, setInputWidth] =
|
3212
|
-
|
3311
|
+
const [inputWidth, setInputWidth] = React28.useState("auto");
|
3312
|
+
React28.useEffect(() => {
|
3213
3313
|
const onResize = debounce(() => {
|
3214
3314
|
if (inputRef.current) {
|
3215
3315
|
setInputWidth(`${inputRef.current.offsetWidth}px`);
|
@@ -3322,38 +3422,8 @@ var inputRecipe = react.defineRecipe({
|
|
3322
3422
|
variant: "core"
|
3323
3423
|
}
|
3324
3424
|
});
|
3325
|
-
var InputGroup = React29__namespace.forwardRef(
|
3326
|
-
(props, ref) => {
|
3327
|
-
const {
|
3328
|
-
startElement,
|
3329
|
-
startElementProps,
|
3330
|
-
endElement,
|
3331
|
-
endElementProps,
|
3332
|
-
label,
|
3333
|
-
children,
|
3334
|
-
...rest
|
3335
|
-
} = props;
|
3336
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Group, { ref, ...rest, children: [
|
3337
|
-
startElement && /* @__PURE__ */ jsxRuntime.jsx(
|
3338
|
-
react.InputElement,
|
3339
|
-
{
|
3340
|
-
pointerEvents: "none",
|
3341
|
-
paddingX: 2,
|
3342
|
-
...startElementProps,
|
3343
|
-
children: startElement
|
3344
|
-
}
|
3345
|
-
),
|
3346
|
-
React29__namespace.cloneElement(children, {
|
3347
|
-
...children.props
|
3348
|
-
}),
|
3349
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { left: startElement ? 4 : "0", right: endElement ? 4 : 0, children: label }),
|
3350
|
-
endElement && /* @__PURE__ */ jsxRuntime.jsx(react.InputElement, { placement: "end", paddingX: 2, ...endElementProps, children: endElement })
|
3351
|
-
] });
|
3352
|
-
}
|
3353
|
-
);
|
3354
|
-
InputGroup.displayName = "InputGroup";
|
3355
3425
|
var StyledInput = react.chakra(react.Input, inputRecipe);
|
3356
|
-
var Input =
|
3426
|
+
var Input = React28.forwardRef(
|
3357
3427
|
({
|
3358
3428
|
startElement,
|
3359
3429
|
endElement,
|
@@ -3363,33 +3433,44 @@ var Input = React29.forwardRef(
|
|
3363
3433
|
errorText,
|
3364
3434
|
...props
|
3365
3435
|
}, ref) => {
|
3366
|
-
return /* @__PURE__ */ jsxRuntime.
|
3367
|
-
|
3436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
3437
|
+
Field3,
|
3368
3438
|
{
|
3369
|
-
|
3370
|
-
|
3371
|
-
|
3372
|
-
|
3373
|
-
|
3374
|
-
|
3375
|
-
|
3376
|
-
|
3377
|
-
|
3378
|
-
|
3379
|
-
|
3380
|
-
|
3381
|
-
|
3382
|
-
|
3383
|
-
|
3384
|
-
|
3385
|
-
|
3386
|
-
|
3439
|
+
invalid,
|
3440
|
+
helperText,
|
3441
|
+
errorText,
|
3442
|
+
label: (
|
3443
|
+
// Render startElement invisibly to align label text with input content when an icon is present
|
3444
|
+
/* @__PURE__ */ jsxRuntime.jsxs(react.Flex, { children: [
|
3445
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Box, { visibility: "hidden", children: startElement }),
|
3446
|
+
label
|
3447
|
+
] })
|
3448
|
+
),
|
3449
|
+
floatingLabel: true,
|
3450
|
+
children: [
|
3451
|
+
startElement && /* @__PURE__ */ jsxRuntime.jsx(react.InputElement, { pointerEvents: "none", paddingX: 2, children: startElement }),
|
3452
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3453
|
+
StyledInput,
|
3454
|
+
{
|
3455
|
+
"data-attachable": true,
|
3456
|
+
ref,
|
3457
|
+
focusVisibleRing: "outside",
|
3458
|
+
overflow: "hidden",
|
3459
|
+
paddingLeft: startElement ? "2.6rem" : void 0,
|
3460
|
+
paddingRight: endElement ? "2.6rem" : void 0,
|
3461
|
+
...props,
|
3462
|
+
className: `peer ${props.className}`,
|
3463
|
+
placeholder: ""
|
3464
|
+
}
|
3465
|
+
),
|
3466
|
+
endElement && /* @__PURE__ */ jsxRuntime.jsx(react.InputElement, { placement: "end", paddingX: 2, children: endElement })
|
3467
|
+
]
|
3387
3468
|
}
|
3388
|
-
)
|
3469
|
+
);
|
3389
3470
|
}
|
3390
3471
|
);
|
3391
3472
|
Input.displayName = "Input";
|
3392
|
-
var ListBox =
|
3473
|
+
var ListBox = React28.forwardRef(
|
3393
3474
|
(props) => {
|
3394
3475
|
const { loading, listBoxRef, state, maxWidth, variant, children } = props;
|
3395
3476
|
const { listBoxProps } = reactAria.useListBox(props, state, listBoxRef);
|
@@ -3426,7 +3507,7 @@ function ItemDescription({ children }) {
|
|
3426
3507
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Box, { ...descriptionProps, css: styles, fontSize: "xs", children });
|
3427
3508
|
}
|
3428
3509
|
function Option({ item, state }) {
|
3429
|
-
const ref =
|
3510
|
+
const ref = React28.useRef(null);
|
3430
3511
|
const {
|
3431
3512
|
optionProps,
|
3432
3513
|
isSelected,
|
@@ -3451,7 +3532,7 @@ function Option({ item, state }) {
|
|
3451
3532
|
if (isFocusVisible) {
|
3452
3533
|
dataFields["data-focus-visible"] = true;
|
3453
3534
|
}
|
3454
|
-
|
3535
|
+
React28.useEffect(() => {
|
3455
3536
|
var _a5;
|
3456
3537
|
(_a5 = ref == null ? void 0 : ref.current) == null ? void 0 : _a5.addEventListener(
|
3457
3538
|
"touchend",
|
@@ -3463,12 +3544,12 @@ function Option({ item, state }) {
|
|
3463
3544
|
}, []);
|
3464
3545
|
return /* @__PURE__ */ jsxRuntime.jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsxRuntime.jsx(react.ListItem, { ...optionProps, ...dataFields, ref, css: styles.item, children: item.rendered }) });
|
3465
3546
|
}
|
3466
|
-
var OptionContext =
|
3547
|
+
var OptionContext = React28__namespace.default.createContext({
|
3467
3548
|
labelProps: {},
|
3468
3549
|
descriptionProps: {}
|
3469
3550
|
});
|
3470
3551
|
var useOptionContext = () => {
|
3471
|
-
return
|
3552
|
+
return React28.useContext(OptionContext);
|
3472
3553
|
};
|
3473
3554
|
function ListBoxSection({ section, state }) {
|
3474
3555
|
var _a5, _b4;
|
@@ -3683,53 +3764,73 @@ var nativeSelectSlotRecipe = react.defineSlotRecipe({
|
|
3683
3764
|
}
|
3684
3765
|
}
|
3685
3766
|
});
|
3686
|
-
var NativeSelect =
|
3767
|
+
var NativeSelect = React28__namespace.forwardRef(function NativeSelect2(props, ref) {
|
3687
3768
|
const {
|
3688
3769
|
children,
|
3689
3770
|
variant = "core",
|
3690
3771
|
label,
|
3691
3772
|
invalid,
|
3692
3773
|
disabled,
|
3774
|
+
required,
|
3775
|
+
helperText,
|
3776
|
+
errorText,
|
3693
3777
|
...rest
|
3694
3778
|
} = props;
|
3695
3779
|
const recipe = react.useSlotRecipe({ recipe: nativeSelectSlotRecipe });
|
3696
3780
|
const styles = recipe({ variant });
|
3697
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
3698
|
-
|
3781
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
3782
|
+
Field3,
|
3699
3783
|
{
|
3700
|
-
|
3701
|
-
|
3702
|
-
|
3703
|
-
|
3704
|
-
|
3705
|
-
|
3706
|
-
|
3707
|
-
|
3708
|
-
|
3709
|
-
|
3710
|
-
|
3711
|
-
|
3712
|
-
|
3713
|
-
|
3714
|
-
|
3784
|
+
label,
|
3785
|
+
invalid,
|
3786
|
+
disabled,
|
3787
|
+
required,
|
3788
|
+
helperText,
|
3789
|
+
errorText,
|
3790
|
+
floatingLabel: true,
|
3791
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
3792
|
+
react.NativeSelect.Root,
|
3793
|
+
{
|
3794
|
+
ref,
|
3795
|
+
css: styles.root,
|
3796
|
+
"aria-disabled": disabled,
|
3797
|
+
children: [
|
3798
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3799
|
+
react.NativeSelect.Field,
|
3800
|
+
{
|
3801
|
+
css: styles.field,
|
3802
|
+
"aria-invalid": invalid,
|
3803
|
+
...rest,
|
3804
|
+
children
|
3805
|
+
}
|
3806
|
+
),
|
3807
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.NativeSelect.Indicator, { css: styles.icon, children: /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.DropdownDownFill18Icon, {}) })
|
3808
|
+
]
|
3809
|
+
}
|
3810
|
+
)
|
3715
3811
|
}
|
3716
|
-
)
|
3812
|
+
);
|
3717
3813
|
});
|
3718
3814
|
var numericStepperRecipe = react.defineSlotRecipe({
|
3719
3815
|
slots: numericStepperAnatomy.keys(),
|
3720
3816
|
className: "spor-numeric-stepper",
|
3721
3817
|
base: {
|
3722
3818
|
root: {
|
3723
|
-
|
3724
|
-
|
3725
|
-
|
3819
|
+
"& > div": {
|
3820
|
+
display: "flex",
|
3821
|
+
flexDirection: "row",
|
3822
|
+
alignItems: "center"
|
3823
|
+
}
|
3726
3824
|
},
|
3727
3825
|
input: {
|
3728
3826
|
fontSize: "sm",
|
3729
3827
|
fontWeight: "bold",
|
3730
3828
|
marginX: 0.5,
|
3829
|
+
padding: 0,
|
3731
3830
|
paddingX: 0.5,
|
3732
3831
|
borderRadius: "xs",
|
3832
|
+
outline: "none",
|
3833
|
+
height: "auto",
|
3733
3834
|
textAlign: "center",
|
3734
3835
|
transitionProperty: "common",
|
3735
3836
|
transitionDuration: "fast",
|
@@ -3773,8 +3874,8 @@ var numericStepperRecipe = react.defineSlotRecipe({
|
|
3773
3874
|
}
|
3774
3875
|
}
|
3775
3876
|
});
|
3776
|
-
var NumericStepper =
|
3777
|
-
|
3877
|
+
var NumericStepper = React28__namespace.default.forwardRef((props) => {
|
3878
|
+
const {
|
3778
3879
|
name: nameProp,
|
3779
3880
|
id: idProp,
|
3780
3881
|
value: valueProp,
|
@@ -3786,101 +3887,101 @@ var NumericStepper = React29__namespace.default.forwardRef(
|
|
3786
3887
|
withInput = true,
|
3787
3888
|
stepSize = 1,
|
3788
3889
|
showZero = false,
|
3789
|
-
ariaLabelContext = { singular: "", plural: "" }
|
3790
|
-
|
3791
|
-
|
3792
|
-
|
3793
|
-
|
3794
|
-
|
3795
|
-
|
3796
|
-
|
3797
|
-
|
3798
|
-
|
3799
|
-
|
3800
|
-
|
3801
|
-
|
3802
|
-
|
3803
|
-
|
3804
|
-
|
3805
|
-
|
3806
|
-
|
3807
|
-
|
3808
|
-
|
3809
|
-
|
3810
|
-
|
3811
|
-
|
3812
|
-
|
3813
|
-
|
3814
|
-
|
3815
|
-
)
|
3816
|
-
|
3817
|
-
|
3818
|
-
|
3819
|
-
|
3820
|
-
|
3821
|
-
}
|
3822
|
-
|
3823
|
-
|
3824
|
-
|
3825
|
-
|
3826
|
-
|
3827
|
-
|
3828
|
-
|
3829
|
-
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3836
|
-
|
3837
|
-
|
3838
|
-
|
3839
|
-
|
3840
|
-
|
3841
|
-
|
3842
|
-
|
3843
|
-
|
3844
|
-
|
3845
|
-
|
3846
|
-
|
3847
|
-
|
3848
|
-
|
3849
|
-
|
3890
|
+
ariaLabelContext = { singular: "", plural: "" },
|
3891
|
+
...rest
|
3892
|
+
} = props;
|
3893
|
+
const addButtonRef = React28.useRef(null);
|
3894
|
+
const { t } = useTranslation();
|
3895
|
+
const recipe = react.useSlotRecipe({ recipe: numericStepperRecipe });
|
3896
|
+
const styles = recipe();
|
3897
|
+
const [value, onChange] = react.useControllableState({
|
3898
|
+
value: valueProp,
|
3899
|
+
onChange: onChangeProp,
|
3900
|
+
defaultValue
|
3901
|
+
});
|
3902
|
+
const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
|
3903
|
+
const focusOnAddButton = () => {
|
3904
|
+
var _a5;
|
3905
|
+
(_a5 = addButtonRef.current) == null ? void 0 : _a5.focus();
|
3906
|
+
};
|
3907
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Field3, { css: styles.root, width: "auto", ...rest, children: [
|
3908
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3909
|
+
VerySmallButton,
|
3910
|
+
{
|
3911
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(SubtractIcon, { stepLabel: clampedStepSize }),
|
3912
|
+
"aria-label": t(
|
3913
|
+
texts13.decrementButtonAriaLabel(
|
3914
|
+
clampedStepSize,
|
3915
|
+
stepSize === 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
3916
|
+
)
|
3917
|
+
),
|
3918
|
+
onClick: () => {
|
3919
|
+
onChange(Math.max(value - clampedStepSize, minValue));
|
3920
|
+
if (Math.max(value - clampedStepSize, minValue) <= minValue) {
|
3921
|
+
focusOnAddButton();
|
3922
|
+
}
|
3923
|
+
},
|
3924
|
+
visibility: value <= minValue ? "hidden" : "visible",
|
3925
|
+
disabled,
|
3926
|
+
id: value <= minValue ? void 0 : idProp
|
3927
|
+
}
|
3928
|
+
),
|
3929
|
+
withInput ? /* @__PURE__ */ jsxRuntime.jsx(
|
3930
|
+
react.Input,
|
3931
|
+
{
|
3932
|
+
min: minValue,
|
3933
|
+
max: maxValue,
|
3934
|
+
name: nameProp,
|
3935
|
+
value,
|
3936
|
+
disabled,
|
3937
|
+
id: !showZero && value === 0 ? void 0 : idProp,
|
3938
|
+
css: styles.input,
|
3939
|
+
width: `${Math.max(value.toString().length + 1, 3)}ch`,
|
3940
|
+
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3941
|
+
"aria-live": "assertive",
|
3942
|
+
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3943
|
+
onChange: (e) => {
|
3944
|
+
const numericInput = Number(e.target.value);
|
3945
|
+
if (Number.isNaN(numericInput)) {
|
3946
|
+
return;
|
3947
|
+
}
|
3948
|
+
onChange(Math.max(Math.min(numericInput, maxValue), minValue));
|
3949
|
+
if (!showZero && Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
|
3950
|
+
focusOnAddButton();
|
3850
3951
|
}
|
3851
3952
|
}
|
3852
|
-
|
3853
|
-
|
3854
|
-
|
3855
|
-
|
3856
|
-
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
|
3863
|
-
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
)
|
3873
|
-
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3880
|
-
}
|
3881
|
-
);
|
3953
|
+
}
|
3954
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
3955
|
+
react.chakra.text,
|
3956
|
+
{
|
3957
|
+
css: styles,
|
3958
|
+
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3959
|
+
"aria-live": "assertive",
|
3960
|
+
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3961
|
+
children: value
|
3962
|
+
}
|
3963
|
+
),
|
3964
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3965
|
+
VerySmallButton,
|
3966
|
+
{
|
3967
|
+
ref: addButtonRef,
|
3968
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(AddIcon, { stepLabel: clampedStepSize }),
|
3969
|
+
"aria-label": t(
|
3970
|
+
texts13.incrementButtonAriaLabel(
|
3971
|
+
clampedStepSize,
|
3972
|
+
stepSize === 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
3973
|
+
)
|
3974
|
+
),
|
3975
|
+
onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
|
3976
|
+
visibility: value >= maxValue ? "hidden" : "visible",
|
3977
|
+
disabled,
|
3978
|
+
id: value >= maxValue ? void 0 : idProp
|
3979
|
+
}
|
3980
|
+
)
|
3981
|
+
] });
|
3982
|
+
});
|
3882
3983
|
NumericStepper.displayName = "NumericStepper";
|
3883
|
-
var VerySmallButton =
|
3984
|
+
var VerySmallButton = React28__namespace.default.forwardRef((props, ref) => {
|
3884
3985
|
const recipe = react.useSlotRecipe({ recipe: numericStepperRecipe });
|
3885
3986
|
const styles = recipe({ colorPalette: "default" });
|
3886
3987
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3963,7 +4064,7 @@ var texts13 = createTexts({
|
|
3963
4064
|
};
|
3964
4065
|
}
|
3965
4066
|
});
|
3966
|
-
var PasswordInput =
|
4067
|
+
var PasswordInput = React28.forwardRef(
|
3967
4068
|
(props, ref) => {
|
3968
4069
|
const {
|
3969
4070
|
defaultVisible,
|
@@ -4008,7 +4109,7 @@ var PasswordInput = React29.forwardRef(
|
|
4008
4109
|
}
|
4009
4110
|
);
|
4010
4111
|
PasswordInput.displayName = "PasswordInput";
|
4011
|
-
var VisibilityTrigger =
|
4112
|
+
var VisibilityTrigger = React28__namespace.default.forwardRef(
|
4012
4113
|
(props, ref) => {
|
4013
4114
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4014
4115
|
react.Button,
|
@@ -4054,7 +4155,7 @@ var sortedCallingCodes = awesomePhonenumber.getSupportedCallingCodes().sort((a,
|
|
4054
4155
|
var callingCodes = react.createListCollection({
|
4055
4156
|
items: [...prioritizedCountryCodes, ...sortedCallingCodes]
|
4056
4157
|
});
|
4057
|
-
var CountryCodeSelect =
|
4158
|
+
var CountryCodeSelect = React28.forwardRef((props, ref) => {
|
4058
4159
|
const { t } = useTranslation();
|
4059
4160
|
if (props.allowedCountryCodes) {
|
4060
4161
|
callingCodes.items = callingCodes.items.filter(
|
@@ -4087,7 +4188,7 @@ var texts15 = createTexts({
|
|
4087
4188
|
sv: "Landskod"
|
4088
4189
|
}
|
4089
4190
|
});
|
4090
|
-
var PhoneNumberInput =
|
4191
|
+
var PhoneNumberInput = React28.forwardRef((props, ref) => {
|
4091
4192
|
const {
|
4092
4193
|
label: externalLabel,
|
4093
4194
|
value: externalValue,
|
@@ -4183,7 +4284,7 @@ var texts16 = createTexts({
|
|
4183
4284
|
sv: "Landskod"
|
4184
4285
|
}
|
4185
4286
|
});
|
4186
|
-
var Radio =
|
4287
|
+
var Radio = React28.forwardRef((props, ref) => {
|
4187
4288
|
const { children, inputProps, rootRef, ...rest } = props;
|
4188
4289
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.RadioGroup.Item, { ref: rootRef, ...rest, children: [
|
4189
4290
|
/* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
@@ -4192,13 +4293,13 @@ var Radio = React29.forwardRef((props, ref) => {
|
|
4192
4293
|
] });
|
4193
4294
|
});
|
4194
4295
|
Radio.displayName = "Radio";
|
4195
|
-
var RadioGroup =
|
4296
|
+
var RadioGroup = React28.forwardRef(
|
4196
4297
|
(props, ref) => {
|
4197
4298
|
return /* @__PURE__ */ jsxRuntime.jsx(react.RadioGroup.Root, { ref, ...props, "aria-labelledby": "" });
|
4198
4299
|
}
|
4199
4300
|
);
|
4200
4301
|
RadioGroup.displayName = "RadioGroup";
|
4201
|
-
var SearchInput =
|
4302
|
+
var SearchInput = React28.forwardRef(
|
4202
4303
|
(props, ref) => {
|
4203
4304
|
const { t } = useTranslation();
|
4204
4305
|
const { variant = "core", onReset, label, value } = props;
|
@@ -4242,12 +4343,21 @@ var texts17 = createTexts({
|
|
4242
4343
|
en: "Reset search field"
|
4243
4344
|
}
|
4244
4345
|
});
|
4245
|
-
var Select =
|
4346
|
+
var Select = React28__namespace.forwardRef(
|
4246
4347
|
(props, ref) => {
|
4247
|
-
const {
|
4348
|
+
const {
|
4349
|
+
variant = "core",
|
4350
|
+
children,
|
4351
|
+
positioning,
|
4352
|
+
label,
|
4353
|
+
errorText,
|
4354
|
+
invalid,
|
4355
|
+
helperText,
|
4356
|
+
...rest
|
4357
|
+
} = props;
|
4248
4358
|
const recipe = react.useSlotRecipe({ key: "select" });
|
4249
4359
|
const styles = recipe({ variant });
|
4250
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
4360
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field3, { errorText, invalid, helperText, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4251
4361
|
react.Select.Root,
|
4252
4362
|
{
|
4253
4363
|
...rest,
|
@@ -4262,11 +4372,11 @@ var Select = React29__namespace.forwardRef(
|
|
4262
4372
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { css: styles.selectContent, children })
|
4263
4373
|
]
|
4264
4374
|
}
|
4265
|
-
);
|
4375
|
+
) });
|
4266
4376
|
}
|
4267
4377
|
);
|
4268
4378
|
Select.displayName = "Select";
|
4269
|
-
var SelectItem =
|
4379
|
+
var SelectItem = React28__namespace.forwardRef(
|
4270
4380
|
(props, ref) => {
|
4271
4381
|
const { item, children, description, ...rest } = props;
|
4272
4382
|
const recipe = react.useSlotRecipe({ key: "select" });
|
@@ -4281,14 +4391,14 @@ var SelectItem = React29__namespace.forwardRef(
|
|
4281
4391
|
}
|
4282
4392
|
);
|
4283
4393
|
SelectItem.displayName = "SelectItem";
|
4284
|
-
var SelectItemGroup =
|
4394
|
+
var SelectItemGroup = React28__namespace.forwardRef(function SelectItemGroup2(props, ref) {
|
4285
4395
|
const { children, label, ...rest } = props;
|
4286
4396
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.Select.ItemGroup, { ...rest, ref, children: [
|
4287
4397
|
/* @__PURE__ */ jsxRuntime.jsx(react.Select.ItemGroupLabel, { children: label }),
|
4288
4398
|
children
|
4289
4399
|
] });
|
4290
4400
|
});
|
4291
|
-
var SelectTrigger =
|
4401
|
+
var SelectTrigger = React28__namespace.forwardRef(function SelectTrigger2(props, ref) {
|
4292
4402
|
const { children, clearable, ...rest } = props;
|
4293
4403
|
const recipe = react.useSlotRecipe({ key: "select" });
|
4294
4404
|
const styles = recipe();
|
@@ -4300,7 +4410,7 @@ var SelectTrigger = React29__namespace.forwardRef(function SelectTrigger2(props,
|
|
4300
4410
|
] })
|
4301
4411
|
] });
|
4302
4412
|
});
|
4303
|
-
var SelectClearTrigger =
|
4413
|
+
var SelectClearTrigger = React28__namespace.forwardRef(function SelectClearTrigger2(props, ref) {
|
4304
4414
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Select.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsxRuntime.jsx(
|
4305
4415
|
CloseButton,
|
4306
4416
|
{
|
@@ -4311,11 +4421,11 @@ var SelectClearTrigger = React29__namespace.forwardRef(function SelectClearTrigg
|
|
4311
4421
|
}
|
4312
4422
|
) });
|
4313
4423
|
});
|
4314
|
-
var SelectContent =
|
4424
|
+
var SelectContent = React28__namespace.forwardRef(function SelectContent2(props, ref) {
|
4315
4425
|
const { portalled = true, portalRef, ...rest } = props;
|
4316
4426
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsxRuntime.jsx(react.Select.Positioner, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Select.Content, { ...rest, ref }) }) });
|
4317
4427
|
});
|
4318
|
-
var SelectValueText =
|
4428
|
+
var SelectValueText = React28__namespace.forwardRef(function SelectValueText2(props, ref) {
|
4319
4429
|
const { children, withPlaceholder, placeholder, ...rest } = props;
|
4320
4430
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4321
4431
|
react.Select.ValueText,
|
@@ -4340,30 +4450,47 @@ var SelectValueText = React29__namespace.forwardRef(function SelectValueText2(pr
|
|
4340
4450
|
var SelectLabel = react.Select.Label;
|
4341
4451
|
var SelectItemText = react.Select.ItemText;
|
4342
4452
|
var SelectRoot = react.Select.Root;
|
4343
|
-
var Switch =
|
4344
|
-
const {
|
4453
|
+
var Switch = React28.forwardRef((props) => {
|
4454
|
+
const {
|
4455
|
+
rootRef,
|
4456
|
+
size = "md",
|
4457
|
+
label,
|
4458
|
+
invalid,
|
4459
|
+
errorText,
|
4460
|
+
helperText,
|
4461
|
+
...rest
|
4462
|
+
} = props;
|
4345
4463
|
const recipe = react.useSlotRecipe({ key: "switch" });
|
4346
4464
|
const styles = recipe({ size });
|
4347
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
4348
|
-
|
4465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
4466
|
+
Field3,
|
4349
4467
|
{
|
4350
|
-
|
4351
|
-
|
4352
|
-
|
4353
|
-
|
4354
|
-
children:
|
4355
|
-
|
4356
|
-
|
4357
|
-
|
4358
|
-
|
4468
|
+
style: { width: "auto" },
|
4469
|
+
invalid,
|
4470
|
+
errorText,
|
4471
|
+
helperText,
|
4472
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4473
|
+
react.Switch.Root,
|
4474
|
+
{
|
4475
|
+
ref: rootRef,
|
4476
|
+
...rest,
|
4477
|
+
checked: props.checked,
|
4478
|
+
css: styles.root,
|
4479
|
+
children: [
|
4480
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Switch.Label, { children: label }),
|
4481
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Switch.HiddenInput, {}),
|
4482
|
+
/* @__PURE__ */ jsxRuntime.jsx(react.Switch.Control, { css: styles.control, children: /* @__PURE__ */ jsxRuntime.jsx(react.Switch.Thumb, {}) })
|
4483
|
+
]
|
4484
|
+
}
|
4485
|
+
)
|
4359
4486
|
}
|
4360
|
-
)
|
4487
|
+
);
|
4361
4488
|
});
|
4362
4489
|
Switch.displayName = "Switch";
|
4363
4490
|
var useLabelHeight = (label) => {
|
4364
|
-
const labelRef =
|
4365
|
-
const [labelHeight, setLabelHeight] =
|
4366
|
-
|
4491
|
+
const labelRef = React28.useRef(null);
|
4492
|
+
const [labelHeight, setLabelHeight] = React28.useState(0);
|
4493
|
+
React28.useLayoutEffect(() => {
|
4367
4494
|
const updateLabelHeight = () => {
|
4368
4495
|
if (labelRef.current) {
|
4369
4496
|
setLabelHeight(labelRef.current.offsetHeight);
|
@@ -4383,13 +4510,13 @@ var useLabelHeight = (label) => {
|
|
4383
4510
|
}, [label]);
|
4384
4511
|
return { labelRef, labelHeight };
|
4385
4512
|
};
|
4386
|
-
var Textarea =
|
4513
|
+
var Textarea = React28.forwardRef(
|
4387
4514
|
(props, ref) => {
|
4388
4515
|
const { label, variant = "core", ...fieldProps } = props;
|
4389
4516
|
const recipe = react.useRecipe({ key: "textarea" });
|
4390
4517
|
const styles = recipe({ variant });
|
4391
4518
|
const { labelRef, labelHeight } = useLabelHeight(label);
|
4392
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
4519
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Field3, { ...fieldProps, position: "relative", children: [
|
4393
4520
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4394
4521
|
react.Textarea,
|
4395
4522
|
{
|
@@ -4401,7 +4528,7 @@ var Textarea = React29.forwardRef(
|
|
4401
4528
|
placeholder: " "
|
4402
4529
|
}
|
4403
4530
|
),
|
4404
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4531
|
+
/* @__PURE__ */ jsxRuntime.jsx(FloatingLabel, { ref: labelRef, children: label })
|
4405
4532
|
] });
|
4406
4533
|
}
|
4407
4534
|
);
|
@@ -4494,13 +4621,13 @@ var pressableCardRecipe = react.defineRecipe({
|
|
4494
4621
|
}
|
4495
4622
|
});
|
4496
4623
|
var PressableCardButton = react.chakra("button", pressableCardRecipe);
|
4497
|
-
var PressableCard =
|
4624
|
+
var PressableCard = React28.forwardRef(
|
4498
4625
|
(props, ref) => {
|
4499
4626
|
return /* @__PURE__ */ jsxRuntime.jsx(PressableCardButton, { ...props, ref });
|
4500
4627
|
}
|
4501
4628
|
);
|
4502
4629
|
PressableCard.displayName = "PressableCard";
|
4503
|
-
var RadioCard =
|
4630
|
+
var RadioCard = React28.forwardRef(
|
4504
4631
|
(props, ref) => {
|
4505
4632
|
const { inputProps, children, value, ariaLabel } = props;
|
4506
4633
|
return /* @__PURE__ */ jsxRuntime.jsxs(react.RadioCard.Item, { ...props, children: [
|
@@ -4517,7 +4644,7 @@ var RadioCard = React29.forwardRef(
|
|
4517
4644
|
}
|
4518
4645
|
);
|
4519
4646
|
RadioCard.displayName = "RadioCard";
|
4520
|
-
var RadioCardGroup =
|
4647
|
+
var RadioCardGroup = React28.forwardRef(
|
4521
4648
|
(props, ref) => {
|
4522
4649
|
const {
|
4523
4650
|
children,
|
@@ -4626,7 +4753,7 @@ var separatorRecipe = react.defineRecipe({
|
|
4626
4753
|
}
|
4627
4754
|
]
|
4628
4755
|
});
|
4629
|
-
var Separator =
|
4756
|
+
var Separator = React28.forwardRef(
|
4630
4757
|
(props, ref) => {
|
4631
4758
|
const {
|
4632
4759
|
size = "md",
|
@@ -4677,7 +4804,7 @@ var staticCardRecipe = react.defineRecipe({
|
|
4677
4804
|
}
|
4678
4805
|
});
|
4679
4806
|
var StyledCardBox = react.chakra("div", staticCardRecipe);
|
4680
|
-
var StaticCard =
|
4807
|
+
var StaticCard = React28.forwardRef(
|
4681
4808
|
(props, ref) => {
|
4682
4809
|
return /* @__PURE__ */ jsxRuntime.jsx(StyledCardBox, { ...props, ref });
|
4683
4810
|
}
|
@@ -4729,7 +4856,7 @@ var getCorrectIcon = ({ variant, size }) => {
|
|
4729
4856
|
var _a5;
|
4730
4857
|
return ((_a5 = icons[variant]) == null ? void 0 : _a5[size]) ?? react.Box;
|
4731
4858
|
};
|
4732
|
-
var LineIcon =
|
4859
|
+
var LineIcon = React28.forwardRef(
|
4733
4860
|
function LineIcon2({
|
4734
4861
|
variant,
|
4735
4862
|
size = "md",
|
@@ -4804,7 +4931,7 @@ var InfoTag = ({
|
|
4804
4931
|
] })
|
4805
4932
|
] });
|
4806
4933
|
};
|
4807
|
-
var TravelTag =
|
4934
|
+
var TravelTag = React28.forwardRef(
|
4808
4935
|
function TravelTag2({
|
4809
4936
|
variant,
|
4810
4937
|
size = "md",
|
@@ -4881,13 +5008,13 @@ var ExternalIcon = ({ label }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fra
|
|
4881
5008
|
/* @__PURE__ */ jsxRuntime.jsx(sporIconReact.LinkOutOutline24Icon, { "aria-hidden": true }),
|
4882
5009
|
/* @__PURE__ */ jsxRuntime.jsx(react.VisuallyHidden, { children: label })
|
4883
5010
|
] });
|
4884
|
-
var TextLink =
|
5011
|
+
var TextLink = React28.forwardRef(
|
4885
5012
|
({ children, external, href, ...props }, ref) => {
|
4886
5013
|
const { t } = useTranslation();
|
4887
5014
|
const isExternal = external ?? Boolean((href == null ? void 0 : href.startsWith("http://")) || (href == null ? void 0 : href.startsWith("https://")));
|
4888
5015
|
const externalLabel = t ? t(texts18.externalLink) : texts18.externalLink.en;
|
4889
|
-
if (props.asChild &&
|
4890
|
-
return /* @__PURE__ */ jsxRuntime.jsx(react.Link, { href, ...props, ref, children:
|
5016
|
+
if (props.asChild && React28.isValidElement(children)) {
|
5017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.Link, { href, ...props, ref, children: React28.cloneElement(children, {
|
4891
5018
|
...children.props,
|
4892
5019
|
children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
4893
5020
|
children.props.children,
|
@@ -4913,7 +5040,7 @@ var texts18 = createTexts({
|
|
4913
5040
|
var List = react.List.Root;
|
4914
5041
|
var ListItem2 = react.List.Item;
|
4915
5042
|
var ListIndicator = react.List.Indicator;
|
4916
|
-
var CargonetLogo =
|
5043
|
+
var CargonetLogo = React28.forwardRef(
|
4917
5044
|
(props, ref) => {
|
4918
5045
|
const { colorPalette } = props;
|
4919
5046
|
const mainColor = "#DF8200";
|
@@ -5072,8 +5199,8 @@ var fillRecipe = {
|
|
5072
5199
|
};
|
5073
5200
|
var Path = react.chakra("path", fillRecipe);
|
5074
5201
|
var SVGGroup = react.chakra("g", fillRecipe);
|
5075
|
-
var VyLogo =
|
5076
|
-
const id =
|
5202
|
+
var VyLogo = React28.forwardRef((props, ref) => {
|
5203
|
+
const id = React28.useId();
|
5077
5204
|
return /* @__PURE__ */ jsxRuntime.jsxs(SvgBox, { ref, viewBox: "0 0 107 54", ...props, children: [
|
5078
5205
|
/* @__PURE__ */ jsxRuntime.jsx("title", { children: "Vy logo" }),
|
5079
5206
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -5193,7 +5320,7 @@ var VyLogo = React29.forwardRef((props, ref) => {
|
|
5193
5320
|
] });
|
5194
5321
|
});
|
5195
5322
|
VyLogo.displayName = "VyLogo";
|
5196
|
-
var VyLogoPride =
|
5323
|
+
var VyLogoPride = React28.forwardRef(
|
5197
5324
|
(props, ref) => {
|
5198
5325
|
const pinkColor = "#ED6F99";
|
5199
5326
|
const purpleColor = "#C06CF7";
|
@@ -5204,7 +5331,7 @@ var VyLogoPride = React29.forwardRef(
|
|
5204
5331
|
const redColor = "#EA3323";
|
5205
5332
|
const orangeColor = "#F09436";
|
5206
5333
|
const yellowColor = "#FFFF54";
|
5207
|
-
const id =
|
5334
|
+
const id = React28.useId();
|
5208
5335
|
return (
|
5209
5336
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
5210
5337
|
/* @__PURE__ */ jsxRuntime.jsxs(SvgBox, { ref, viewBox: "0 0 107 54", ...props, children: [
|
@@ -5407,7 +5534,7 @@ var VyLogoPride = React29.forwardRef(
|
|
5407
5534
|
}
|
5408
5535
|
);
|
5409
5536
|
VyLogoPride.displayName = "VyLogoPride";
|
5410
|
-
var JumpButton =
|
5537
|
+
var JumpButton = React28.forwardRef(
|
5411
5538
|
(props, ref) => {
|
5412
5539
|
const { direction, disabled, size = "sm" } = props;
|
5413
5540
|
const { t } = useTranslation();
|
@@ -5442,7 +5569,7 @@ var texts19 = createTexts({
|
|
5442
5569
|
en: "15 seconds backward"
|
5443
5570
|
}
|
5444
5571
|
});
|
5445
|
-
var PlayPauseButton =
|
5572
|
+
var PlayPauseButton = React28.forwardRef((props, ref) => {
|
5446
5573
|
const { playing, disabled, size = "sm" } = props;
|
5447
5574
|
const { t } = useTranslation();
|
5448
5575
|
const recipe = react.useSlotRecipe({ key: "mediaControllerButton" });
|
@@ -5475,7 +5602,7 @@ var texts20 = createTexts({
|
|
5475
5602
|
en: "Play"
|
5476
5603
|
}
|
5477
5604
|
});
|
5478
|
-
var SkipButton =
|
5605
|
+
var SkipButton = React28.forwardRef(
|
5479
5606
|
(props, ref) => {
|
5480
5607
|
const { direction, disabled, size = "sm" } = props;
|
5481
5608
|
const { t } = useTranslation();
|
@@ -5531,23 +5658,23 @@ var Nudge = (props) => {
|
|
5531
5658
|
}
|
5532
5659
|
return /* @__PURE__ */ jsxRuntime.jsx(Popover2, { defaultOpen: true, size, ...rest });
|
5533
5660
|
};
|
5534
|
-
var NudgeTrigger =
|
5661
|
+
var NudgeTrigger = React28.forwardRef(({ ...props }, ref) => {
|
5535
5662
|
return /* @__PURE__ */ jsxRuntime.jsx(PopoverTrigger, { ...props, ref });
|
5536
5663
|
});
|
5537
5664
|
NudgeTrigger.displayName = "NudgeTrigger";
|
5538
|
-
var NudgeContent =
|
5665
|
+
var NudgeContent = React28.forwardRef(
|
5539
5666
|
({ showCloseButton = true, children, ...props }, ref) => {
|
5540
|
-
const [currentStep, setCurrentStep] =
|
5541
|
-
const childrenArray =
|
5667
|
+
const [currentStep, setCurrentStep] = React28.useState(1);
|
5668
|
+
const childrenArray = React28__namespace.default.Children.toArray(children);
|
5542
5669
|
const { open } = react$1.usePopoverContext();
|
5543
|
-
|
5670
|
+
React28.useEffect(() => {
|
5544
5671
|
setCurrentStep(1);
|
5545
5672
|
}, [children, open]);
|
5546
5673
|
const wizardPages = childrenArray.filter(
|
5547
|
-
(child) =>
|
5674
|
+
(child) => React28__namespace.default.isValidElement(child) && child.type.displayName === "NudgeWizardStep"
|
5548
5675
|
);
|
5549
5676
|
const restChildren = childrenArray.filter(
|
5550
|
-
(child) => !
|
5677
|
+
(child) => !React28__namespace.default.isValidElement(child) || child.type.displayName !== "NudgeWizardStep"
|
5551
5678
|
);
|
5552
5679
|
const totalSteps = wizardPages.length;
|
5553
5680
|
const isLastStep = totalSteps === currentStep;
|
@@ -5628,7 +5755,7 @@ var NudgeWizardStep = ({ children }) => {
|
|
5628
5755
|
return /* @__PURE__ */ jsxRuntime.jsx(react.chakra.div, { display: "flex", flexDirection: "column", gap: "1rem", width: "100%", children });
|
5629
5756
|
};
|
5630
5757
|
NudgeWizardStep.displayName = "NudgeWizardStep";
|
5631
|
-
var NudgeCloseTrigger =
|
5758
|
+
var NudgeCloseTrigger = React28.forwardRef(({ children, ...props }, ref) => {
|
5632
5759
|
const isStringChild = typeof children === "string";
|
5633
5760
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Popover.CloseTrigger, { ...props, ref, asChild: !isStringChild, children });
|
5634
5761
|
});
|
@@ -5636,7 +5763,7 @@ NudgeCloseTrigger.displayName = "NudgeCloseTrigger";
|
|
5636
5763
|
var [RootPropsProvider, useRootProps] = react.createContext({
|
5637
5764
|
name: "RootPropsProvider"
|
5638
5765
|
});
|
5639
|
-
var Pagination =
|
5766
|
+
var Pagination = React28__namespace.forwardRef(
|
5640
5767
|
(props, ref) => {
|
5641
5768
|
const { getHref, children, ...rest } = props;
|
5642
5769
|
const recipe = react.useSlotRecipe({ key: "pagination" });
|
@@ -5661,11 +5788,11 @@ var Pagination = React29__namespace.forwardRef(
|
|
5661
5788
|
}
|
5662
5789
|
);
|
5663
5790
|
Pagination.displayName = "Pagination";
|
5664
|
-
var PaginationEllipsis =
|
5791
|
+
var PaginationEllipsis = React28__namespace.forwardRef((props, ref) => {
|
5665
5792
|
return /* @__PURE__ */ jsxRuntime.jsx(ListItem2, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Pagination.Ellipsis, { ref, ...props, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { cursor: "default", children: "..." }) }) });
|
5666
5793
|
});
|
5667
5794
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
5668
|
-
var PaginationItem =
|
5795
|
+
var PaginationItem = React28__namespace.forwardRef((props, ref) => {
|
5669
5796
|
const rootProps = useRootProps();
|
5670
5797
|
const { t } = useTranslation();
|
5671
5798
|
const { page, totalPages } = react.usePaginationContext();
|
@@ -5698,7 +5825,7 @@ var PaginationItem = React29__namespace.forwardRef((props, ref) => {
|
|
5698
5825
|
) });
|
5699
5826
|
});
|
5700
5827
|
PaginationItem.displayName = "PaginationItem";
|
5701
|
-
var PaginationPrevTrigger =
|
5828
|
+
var PaginationPrevTrigger = React28__namespace.forwardRef((props, ref) => {
|
5702
5829
|
const { page } = react.usePaginationContext();
|
5703
5830
|
const recipe = react.useSlotRecipe({ key: "pagination" });
|
5704
5831
|
const styles = recipe();
|
@@ -5738,7 +5865,7 @@ var PaginationPrevTrigger = React29__namespace.forwardRef((props, ref) => {
|
|
5738
5865
|
) });
|
5739
5866
|
});
|
5740
5867
|
PaginationPrevTrigger.displayName = "PaginationPrevTrigger";
|
5741
|
-
var PaginationNextTrigger =
|
5868
|
+
var PaginationNextTrigger = React28__namespace.forwardRef((props, ref) => {
|
5742
5869
|
const { page, totalPages } = react.usePaginationContext();
|
5743
5870
|
const recipe = react.useSlotRecipe({ key: "pagination" });
|
5744
5871
|
const styles = recipe();
|
@@ -5818,17 +5945,17 @@ var texts23 = createTexts({
|
|
5818
5945
|
}
|
5819
5946
|
});
|
5820
5947
|
var Popover2 = react.Popover.Root;
|
5821
|
-
var PopoverTrigger =
|
5948
|
+
var PopoverTrigger = React28.forwardRef(({ children, ...props }, ref) => {
|
5822
5949
|
const isStringChild = typeof children === "string";
|
5823
5950
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Popover.Trigger, { ...props, ref, asChild: !isStringChild, children });
|
5824
5951
|
});
|
5825
5952
|
PopoverTrigger.displayName = "PopoverTrigger";
|
5826
|
-
var PopoverContent =
|
5953
|
+
var PopoverContent = React28.forwardRef(
|
5827
5954
|
({ children, showCloseButton = false, ...props }, ref) => {
|
5828
5955
|
const { colorMode } = useColorMode();
|
5829
|
-
const closeButtonRef =
|
5956
|
+
const closeButtonRef = React28__namespace.default.useRef(null);
|
5830
5957
|
const { open } = react.usePopoverContext();
|
5831
|
-
|
5958
|
+
React28.useEffect(() => {
|
5832
5959
|
if (showCloseButton && open && closeButtonRef.current) {
|
5833
5960
|
closeButtonRef.current.focus();
|
5834
5961
|
}
|
@@ -5862,7 +5989,7 @@ var ProgressDot = ({ isActive }) => {
|
|
5862
5989
|
}
|
5863
5990
|
);
|
5864
5991
|
};
|
5865
|
-
var ProgressIndicator =
|
5992
|
+
var ProgressIndicator = React28.forwardRef(({ numberOfSteps, activeStep }) => {
|
5866
5993
|
const { t } = useTranslation();
|
5867
5994
|
const recipe = react.useSlotRecipe({
|
5868
5995
|
key: "progressIndicator"
|
@@ -6036,7 +6163,7 @@ var SporProvider = ({
|
|
6036
6163
|
children
|
6037
6164
|
] }) }) });
|
6038
6165
|
};
|
6039
|
-
var StepperContext =
|
6166
|
+
var StepperContext = React28__namespace.default.createContext(null);
|
6040
6167
|
var StepperProvider = ({
|
6041
6168
|
activeStep,
|
6042
6169
|
children,
|
@@ -6053,7 +6180,7 @@ var StepperProvider = ({
|
|
6053
6180
|
);
|
6054
6181
|
};
|
6055
6182
|
var useStepper = () => {
|
6056
|
-
const context =
|
6183
|
+
const context = React28__namespace.default.useContext(StepperContext);
|
6057
6184
|
if (!context) {
|
6058
6185
|
throw new Error(
|
6059
6186
|
"useStepper must be used within a StepperProvider. Most likely, you forgot to wrap your StepperStep in a Stepper component"
|
@@ -6061,7 +6188,7 @@ var useStepper = () => {
|
|
6061
6188
|
}
|
6062
6189
|
return context;
|
6063
6190
|
};
|
6064
|
-
var Stepper =
|
6191
|
+
var Stepper = React28.forwardRef(
|
6065
6192
|
function Stepper2(props, ref) {
|
6066
6193
|
const {
|
6067
6194
|
onClick = () => {
|
@@ -6209,7 +6336,7 @@ var getState = (stepNumber, activeStep) => {
|
|
6209
6336
|
}
|
6210
6337
|
return "disabled";
|
6211
6338
|
};
|
6212
|
-
var Tabs =
|
6339
|
+
var Tabs = React28.forwardRef((props, ref) => {
|
6213
6340
|
const { variant = "core", size = "sm" } = props;
|
6214
6341
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Tabs.Root, { ...props, ref, variant, size });
|
6215
6342
|
});
|
@@ -6251,7 +6378,8 @@ var tableSlotRecipe = react.defineSlotRecipe({
|
|
6251
6378
|
cell: {
|
6252
6379
|
...numericStyles,
|
6253
6380
|
paddingX: 1.5,
|
6254
|
-
paddingY: 1
|
6381
|
+
paddingY: 1,
|
6382
|
+
width: "100%"
|
6255
6383
|
},
|
6256
6384
|
footer: {
|
6257
6385
|
fontWeight: "medium"
|
@@ -6411,7 +6539,7 @@ var tableSlotRecipe = react.defineSlotRecipe({
|
|
6411
6539
|
}
|
6412
6540
|
}
|
6413
6541
|
});
|
6414
|
-
var Table =
|
6542
|
+
var Table = React28.forwardRef((props, ref) => {
|
6415
6543
|
const { variant = "ghost", size, colorPalette = "green", children } = props;
|
6416
6544
|
const recipe = react.useSlotRecipe({ recipe: tableSlotRecipe });
|
6417
6545
|
const styles = recipe({ variant, size });
|
@@ -7952,33 +8080,6 @@ var fieldSlotRecipe = react.defineSlotRecipe({
|
|
7952
8080
|
position: "relative",
|
7953
8081
|
flexDirection: "column"
|
7954
8082
|
},
|
7955
|
-
label: {
|
7956
|
-
/* For when input is filled */
|
7957
|
-
pos: "absolute",
|
7958
|
-
paddingX: 3,
|
7959
|
-
top: "0.3rem",
|
7960
|
-
fontWeight: "normal",
|
7961
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7962
|
-
color: "text",
|
7963
|
-
pointerEvents: "none",
|
7964
|
-
transition: "position",
|
7965
|
-
zIndex: "docked",
|
7966
|
-
_peerPlaceholderShown: {
|
7967
|
-
/* For when input is not in focus */
|
7968
|
-
top: "0.9rem",
|
7969
|
-
color: "text",
|
7970
|
-
fontSize: ["mobile.sm", "desktop.sm"]
|
7971
|
-
},
|
7972
|
-
_peerFocusVisible: {
|
7973
|
-
/* For when input is in focus */
|
7974
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7975
|
-
color: "text",
|
7976
|
-
top: "0.3rem"
|
7977
|
-
},
|
7978
|
-
_disabled: {
|
7979
|
-
opacity: 0.4
|
7980
|
-
}
|
7981
|
-
},
|
7982
8083
|
requiredIndicator: {
|
7983
8084
|
marginStart: 1,
|
7984
8085
|
color: "brightRed"
|
@@ -7998,7 +8099,7 @@ var fieldSlotRecipe = react.defineSlotRecipe({
|
|
7998
8099
|
textStyle: "xs",
|
7999
8100
|
width: "fit-content",
|
8000
8101
|
position: "absolute",
|
8001
|
-
bottom: -
|
8102
|
+
bottom: -5,
|
8002
8103
|
left: 3,
|
8003
8104
|
zIndex: "dropdown",
|
8004
8105
|
maxWidth: "50ch",
|
@@ -9244,6 +9345,10 @@ var selectSlotRecipe = react.defineSlotRecipe({
|
|
9244
9345
|
},
|
9245
9346
|
_open: {
|
9246
9347
|
borderBottomRadius: 0
|
9348
|
+
},
|
9349
|
+
_invalid: {
|
9350
|
+
outline: "2px solid",
|
9351
|
+
outlineColor: "outline.error"
|
9247
9352
|
}
|
9248
9353
|
},
|
9249
9354
|
itemText: {
|
@@ -9278,10 +9383,6 @@ var selectSlotRecipe = react.defineSlotRecipe({
|
|
9278
9383
|
_active: {
|
9279
9384
|
backgroundColor: "brand.surface.active"
|
9280
9385
|
},
|
9281
|
-
_invalid: {
|
9282
|
-
outline: "2px solid",
|
9283
|
-
outlineColor: "outline.error"
|
9284
|
-
},
|
9285
9386
|
_disabled: {
|
9286
9387
|
pointerEvents: "none",
|
9287
9388
|
color: "text.disabled",
|
@@ -10945,7 +11046,7 @@ exports.DrawerTrigger = DrawerTrigger;
|
|
10945
11046
|
exports.Expandable = Expandable;
|
10946
11047
|
exports.ExpandableAlert = ExpandableAlert;
|
10947
11048
|
exports.ExpandableItem = ExpandableItem;
|
10948
|
-
exports.Field =
|
11049
|
+
exports.Field = Field3;
|
10949
11050
|
exports.FieldErrorText = FieldErrorText;
|
10950
11051
|
exports.FieldLabel = FieldLabel;
|
10951
11052
|
exports.Fieldset = Fieldset;
|