@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.mjs
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { useSlotRecipe, Accordion as Accordion$1, Stack, Box, HStack, Progress, defineRecipe, chakra, Text, useRecipe, Circle, Skeleton as Skeleton$1, Button as Button$1, Group as Group$1, Badge as Badge$1, Code as Code$1, Clipboard as Clipboard$1, IconButton as IconButton$1, useDisclosure, Alert as Alert$1, Span, Flex, Breadcrumb as Breadcrumb$1, ClientOnly as ClientOnly$1, Field
|
1
|
+
import { useSlotRecipe, Accordion as Accordion$1, Stack, Box, HStack, Progress, defineRecipe, chakra, Text, useRecipe, Circle, Skeleton as Skeleton$1, Button as Button$1, Group as Group$1, Badge as Badge$1, Code as Code$1, Clipboard as Clipboard$1, IconButton as IconButton$1, useDisclosure, Alert as Alert$1, Span, Flex, Breadcrumb as Breadcrumb$1, ClientOnly as ClientOnly$1, Field, defineStyle, defineSlotRecipe, PopoverAnchor, useFieldContext, Popover as Popover$1, Portal, Dialog, createContext as createContext$1, Drawer as Drawer$1, Grid, GridItem, usePopoverContext, Checkbox as Checkbox$1, CheckboxGroup as CheckboxGroup$1, CheckboxCard, Fieldset as Fieldset$1, Input as Input$1, InputElement, List as List$1, ListItem, NativeSelect as NativeSelect$1, useControllableState, createListCollection, RadioGroup as RadioGroup$1, Select as Select$1, Switch as Switch$1, Textarea as Textarea$1, RadioCard as RadioCard$1, Separator as Separator$1, Link, Center, Pagination as Pagination$1, usePaginationContext, createToaster, Tabs as Tabs$1, Table as Table$1, defineSemanticTokens, defineTokens, defineAnimationStyles, defineGlobalStyles, defineTextStyles, createSystem, defaultBaseConfig, VisuallyHidden, defineConfig, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
|
2
2
|
export { Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack, TableBody, TableCaption, TableCell, TableColumn, TableColumnHeader, TableFooter, TableHeader, TableRoot, TableRow, VStack, VisuallyHidden, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useToken } from '@chakra-ui/react';
|
3
3
|
import { DropdownDownFill24Icon, CopyOutline18Icon, CheckmarkFill18Icon, CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, DropdownDownFill18Icon, ServiceFill24Icon, WarningFill24Icon, DropdownRightFill18Icon, CalendarOutline24Icon, ArrowLeftFill24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, Forward15MediaControllerFill30Icon, Backward15MediaControllerFill30Icon, PauseMediaControllerFill24Icon, PlayMediaControllerFill24Icon, NextMediaControllerFill30Icon, PreviousMediaControllerFill30Icon, ArrowRightFill18Icon, DropdownLeftOutline18Icon, DropdownRightOutline18Icon, WalkFill30Icon, WalkFill24Icon, WalkFill18Icon, AltTransportFill30Icon, AltTransportFill24Icon, AltTransportFill18Icon, TramFill30Icon, TramFill24Icon, TramFill18Icon, SubwayFill30Icon, SubwayFill24Icon, SubwayFill18Icon, FerryFill30Icon, FerryFill24Icon, FerryFill18Icon, BusFill30Icon, BusFill24Icon, BusFill18Icon, ExpressBusFill30Icon, ExpressBusFill24Icon, ExpressBusFill18Icon, TrainFill30Icon, TrainFill24Icon, TrainFill18Icon, LinkOutOutline24Icon, QuestionFill24Icon, ErrorOutline24Icon, SuccessFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, DropdownLeftFill18Icon, SuccessFill18Icon } from '@vygruppen/spor-icon-react';
|
4
|
-
import * as
|
5
|
-
import
|
4
|
+
import * as React28 from 'react';
|
5
|
+
import React28__default, { forwardRef, createContext, useId, cloneElement, useEffect, useRef, useState, isValidElement, useMemo, useLayoutEffect, useContext } from 'react';
|
6
6
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
7
7
|
import { spinnerColorData, inlineLoaderColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, spinnerLightData, spinnerDarkData, fullScreenLoaderBlackData, inlineLoaderLightData } from '@vygruppen/spor-loader';
|
8
8
|
import ReactLottie from 'lottie-react';
|
@@ -540,7 +540,7 @@ var skeletonRecipe = defineRecipe({
|
|
540
540
|
}
|
541
541
|
}
|
542
542
|
});
|
543
|
-
var SkeletonCircle =
|
543
|
+
var SkeletonCircle = React28.forwardRef(function SkeletonCircle2(props, ref) {
|
544
544
|
const recipe = useRecipe({ recipe: skeletonRecipe });
|
545
545
|
const [recipeProps, restProps] = recipe.splitVariantProps({
|
546
546
|
loading: true,
|
@@ -816,7 +816,7 @@ var codeRecipie = defineRecipe({
|
|
816
816
|
}
|
817
817
|
});
|
818
818
|
var StyledCode = chakra(Code$1, codeRecipie);
|
819
|
-
var Code =
|
819
|
+
var Code = React28__default.forwardRef(
|
820
820
|
function Code2(props, ref) {
|
821
821
|
return /* @__PURE__ */ jsx(StyledCode, { ...props, ref });
|
822
822
|
}
|
@@ -850,7 +850,7 @@ var Text3 = forwardRef(
|
|
850
850
|
return /* @__PURE__ */ jsx(Text, { ...rest, textStyle: variant, ref });
|
851
851
|
}
|
852
852
|
);
|
853
|
-
var ClipboardIcon =
|
853
|
+
var ClipboardIcon = React28.forwardRef((props, ref) => {
|
854
854
|
return /* @__PURE__ */ jsx(
|
855
855
|
Clipboard$1.Indicator,
|
856
856
|
{
|
@@ -862,7 +862,7 @@ var ClipboardIcon = React29.forwardRef((props, ref) => {
|
|
862
862
|
);
|
863
863
|
});
|
864
864
|
ClipboardIcon.displayName = "ClipboardIcon";
|
865
|
-
var ClipboardCopyText =
|
865
|
+
var ClipboardCopyText = React28.forwardRef((props, ref) => {
|
866
866
|
const { t } = useTranslation();
|
867
867
|
return /* @__PURE__ */ jsx(
|
868
868
|
Clipboard$1.Indicator,
|
@@ -875,7 +875,7 @@ var ClipboardCopyText = React29.forwardRef((props, ref) => {
|
|
875
875
|
);
|
876
876
|
});
|
877
877
|
ClipboardCopyText.displayName = "ClipboardCopyText";
|
878
|
-
var ClipboardButton =
|
878
|
+
var ClipboardButton = React28.forwardRef((props, ref) => {
|
879
879
|
return /* @__PURE__ */ jsx(Clipboard$1.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(Button, { ref, size: "xs", leftIcon: /* @__PURE__ */ jsx(ClipboardIcon, {}), ...props, children: /* @__PURE__ */ jsx(ClipboardCopyText, {}) }) });
|
880
880
|
});
|
881
881
|
ClipboardButton.displayName = "ClipboardButton";
|
@@ -959,7 +959,7 @@ var FloatingActionButton = forwardRef(
|
|
959
959
|
placement = "bottom right",
|
960
960
|
...props
|
961
961
|
}, ref) => {
|
962
|
-
const [isTextVisible, setIsTextVisible] =
|
962
|
+
const [isTextVisible, setIsTextVisible] = React28__default.useState(
|
963
963
|
externalIsTextVisible === void 0 ? false : externalIsTextVisible
|
964
964
|
);
|
965
965
|
const scrollDirection = useScrollDirection();
|
@@ -1000,11 +1000,11 @@ var FloatingActionButton = forwardRef(
|
|
1000
1000
|
);
|
1001
1001
|
FloatingActionButton.displayName = "FloatingActionButton";
|
1002
1002
|
var useScrollDirection = () => {
|
1003
|
-
const [scrollDirection, setScrollDirection] =
|
1004
|
-
const lastScrollPosition =
|
1003
|
+
const [scrollDirection, setScrollDirection] = React28__default.useState(null);
|
1004
|
+
const lastScrollPosition = React28__default.useRef(
|
1005
1005
|
globalThis.window === void 0 ? 0 : window.scrollY
|
1006
1006
|
);
|
1007
|
-
|
1007
|
+
React28__default.useEffect(() => {
|
1008
1008
|
const onScroll = () => {
|
1009
1009
|
const delta = window.scrollY - lastScrollPosition.current;
|
1010
1010
|
if (delta === 0) {
|
@@ -1322,12 +1322,12 @@ var texts6 = createTexts({
|
|
1322
1322
|
});
|
1323
1323
|
var Breadcrumb = forwardRef(
|
1324
1324
|
({ children, ...props }, ref) => {
|
1325
|
-
const validChildren =
|
1326
|
-
(element) =>
|
1325
|
+
const validChildren = React28__default.Children.toArray(children).filter(
|
1326
|
+
(element) => React28__default.isValidElement(element)
|
1327
1327
|
);
|
1328
1328
|
return /* @__PURE__ */ jsx(Breadcrumb$1.Root, { ref, ...props, children: /* @__PURE__ */ jsx(Breadcrumb$1.List, { children: validChildren.map((child, index) => {
|
1329
1329
|
const isLast = index === validChildren.length - 1;
|
1330
|
-
return /* @__PURE__ */ jsxs(
|
1330
|
+
return /* @__PURE__ */ jsxs(React28__default.Fragment, { children: [
|
1331
1331
|
/* @__PURE__ */ jsx(Breadcrumb$1.Item, { children: child }),
|
1332
1332
|
!isLast && /* @__PURE__ */ jsx(Breadcrumb$1.Separator, { "aria-hidden": "true", children: /* @__PURE__ */ jsx(DropdownRightFill18Icon, {}) })
|
1333
1333
|
] }, index);
|
@@ -1357,7 +1357,7 @@ function ColorModeIcon() {
|
|
1357
1357
|
const { colorMode } = useColorMode();
|
1358
1358
|
return colorMode === "dark" ? /* @__PURE__ */ jsx(LuMoon, {}) : /* @__PURE__ */ jsx(LuSun, {});
|
1359
1359
|
}
|
1360
|
-
var ColorModeButton =
|
1360
|
+
var ColorModeButton = React28.forwardRef(function ColorModeButton2(props, ref) {
|
1361
1361
|
const { toggleColorMode } = useColorMode();
|
1362
1362
|
return /* @__PURE__ */ jsx(ClientOnly$1, { fallback: /* @__PURE__ */ jsx(Skeleton$1, { boxSize: "8" }), children: /* @__PURE__ */ jsx(
|
1363
1363
|
IconButton$1,
|
@@ -1378,25 +1378,94 @@ var ColorModeButton = React29.forwardRef(function ColorModeButton2(props, ref) {
|
|
1378
1378
|
}
|
1379
1379
|
) });
|
1380
1380
|
});
|
1381
|
-
var
|
1381
|
+
var FloatingLabel = forwardRef(
|
1382
|
+
(props, ref) => /* @__PURE__ */ jsx(Field.Label, { ref, ...props, css: floatingLabelStyles })
|
1383
|
+
);
|
1384
|
+
FloatingLabel.displayName = "FloatingLabel";
|
1385
|
+
var floatingLabelStyles = defineStyle({
|
1386
|
+
paddingX: 3,
|
1387
|
+
fontWeight: "normal",
|
1388
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1389
|
+
color: "text",
|
1390
|
+
pointerEvents: "none",
|
1391
|
+
zIndex: "docked",
|
1392
|
+
_disabled: {
|
1393
|
+
opacity: 0.4
|
1394
|
+
},
|
1395
|
+
pos: "absolute",
|
1396
|
+
top: "0.3rem",
|
1397
|
+
transition: "position",
|
1398
|
+
_peerPlaceholderShown: {
|
1399
|
+
/* For when input is not in focus */
|
1400
|
+
top: "0.9rem",
|
1401
|
+
color: "text",
|
1402
|
+
fontSize: ["mobile.sm", "desktop.sm"]
|
1403
|
+
},
|
1404
|
+
_peerFocusVisible: {
|
1405
|
+
/* For when input is in focus */
|
1406
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1407
|
+
color: "text",
|
1408
|
+
top: "0.3rem"
|
1409
|
+
}
|
1410
|
+
});
|
1411
|
+
var Label = (props) => /* @__PURE__ */ jsx(Field.Label, { ...props, css: labelStyles });
|
1412
|
+
var labelStyles = defineStyle({
|
1413
|
+
fontWeight: "normal",
|
1414
|
+
paddingBottom: 1,
|
1415
|
+
paddingX: 1,
|
1416
|
+
fontSize: ["mobile.xs", "desktop.xs"],
|
1417
|
+
color: "text",
|
1418
|
+
pointerEvents: "none",
|
1419
|
+
zIndex: "docked",
|
1420
|
+
_disabled: {
|
1421
|
+
opacity: 0.4
|
1422
|
+
}
|
1423
|
+
});
|
1424
|
+
var Field3 = React28.forwardRef(
|
1382
1425
|
(props, ref) => {
|
1383
|
-
const {
|
1384
|
-
|
1385
|
-
const styles = recipe({ label, helperText, errorText });
|
1386
|
-
return /* @__PURE__ */ jsxs(Field$1.Root, { ref, ...rest, css: styles.root, children: [
|
1426
|
+
const {
|
1427
|
+
label,
|
1387
1428
|
children,
|
1388
|
-
helperText
|
1389
|
-
|
1390
|
-
|
1429
|
+
helperText,
|
1430
|
+
errorText,
|
1431
|
+
floatingLabel = false,
|
1432
|
+
disabled,
|
1433
|
+
invalid,
|
1434
|
+
readOnly,
|
1435
|
+
required,
|
1436
|
+
direction,
|
1437
|
+
...rest
|
1438
|
+
} = props;
|
1439
|
+
const recipe = useSlotRecipe({ key: "field" });
|
1440
|
+
const styles = recipe();
|
1441
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "2", ref, ...rest, width: "100%", children: [
|
1442
|
+
/* @__PURE__ */ jsxs(
|
1443
|
+
Field.Root,
|
1444
|
+
{
|
1445
|
+
disabled,
|
1446
|
+
invalid,
|
1447
|
+
readOnly,
|
1448
|
+
required,
|
1449
|
+
css: styles.root,
|
1450
|
+
direction,
|
1451
|
+
children: [
|
1452
|
+
label && !floatingLabel && /* @__PURE__ */ jsx(Label, { children: label }),
|
1453
|
+
children,
|
1454
|
+
label && floatingLabel && /* @__PURE__ */ jsx(FloatingLabel, { children: label }),
|
1455
|
+
errorText && /* @__PURE__ */ jsx(Field.ErrorText, { children: errorText })
|
1456
|
+
]
|
1457
|
+
}
|
1458
|
+
),
|
1459
|
+
helperText && /* @__PURE__ */ jsx(Text3, { fontSize: "sm", color: "text.tertiary", children: helperText })
|
1391
1460
|
] });
|
1392
1461
|
}
|
1393
1462
|
);
|
1394
|
-
|
1395
|
-
var FieldErrorText =
|
1396
|
-
return /* @__PURE__ */ jsx(Field
|
1463
|
+
Field3.displayName = "Field";
|
1464
|
+
var FieldErrorText = React28.forwardRef((props, ref) => {
|
1465
|
+
return /* @__PURE__ */ jsx(Field.ErrorText, { ref, children: props.children });
|
1397
1466
|
});
|
1398
1467
|
FieldErrorText.displayName = "FieldErrorText";
|
1399
|
-
var FieldLabel = Field
|
1468
|
+
var FieldLabel = Field.Label;
|
1400
1469
|
var accordionAnatomy = createAnatomy("accordion").parts(
|
1401
1470
|
"root",
|
1402
1471
|
"itemTrigger",
|
@@ -2357,18 +2426,20 @@ var StyledField = forwardRef(
|
|
2357
2426
|
var DatePicker = forwardRef(
|
2358
2427
|
({
|
2359
2428
|
variant,
|
2360
|
-
|
2429
|
+
errorText,
|
2361
2430
|
minHeight,
|
2362
2431
|
showYearNavigation,
|
2363
2432
|
withPortal = true,
|
2364
2433
|
width = "auto",
|
2434
|
+
invalid = false,
|
2435
|
+
helperText,
|
2365
2436
|
...props
|
2366
2437
|
}, externalRef) => {
|
2367
2438
|
const chakraFieldProps = useFieldContext();
|
2368
2439
|
const state = useDatePickerState({
|
2369
2440
|
...props,
|
2370
2441
|
shouldCloseOnSelect: true,
|
2371
|
-
errorMessage,
|
2442
|
+
errorMessage: errorText,
|
2372
2443
|
isRequired: props.isRequired ?? (chakraFieldProps == null ? void 0 : chakraFieldProps.required),
|
2373
2444
|
validationState: (chakraFieldProps == null ? void 0 : chakraFieldProps.invalid) ? "invalid" : "valid"
|
2374
2445
|
});
|
@@ -2407,12 +2478,14 @@ var DatePicker = forwardRef(
|
|
2407
2478
|
width,
|
2408
2479
|
children: /* @__PURE__ */ jsxs(Popover$1.Root, { ...dialogProps, children: [
|
2409
2480
|
/* @__PURE__ */ jsx(
|
2410
|
-
|
2481
|
+
Field3,
|
2411
2482
|
{
|
2412
2483
|
display: "inline-flex",
|
2413
2484
|
id: inputGroupId,
|
2414
2485
|
"aria-labelledby": labelId,
|
2415
|
-
errorText
|
2486
|
+
errorText,
|
2487
|
+
invalid,
|
2488
|
+
helperText,
|
2416
2489
|
children: /* @__PURE__ */ jsx(PopoverAnchor, { children: /* @__PURE__ */ jsxs(
|
2417
2490
|
StyledField,
|
2418
2491
|
{
|
@@ -2492,13 +2565,18 @@ function DateRangePicker({
|
|
2492
2565
|
startName,
|
2493
2566
|
endName,
|
2494
2567
|
withPortal = true,
|
2568
|
+
errorText,
|
2569
|
+
helperText,
|
2570
|
+
invalid,
|
2495
2571
|
...props
|
2496
2572
|
}) {
|
2497
2573
|
const fieldContextPRops = useFieldContext();
|
2498
2574
|
const state = useDateRangePickerState({
|
2499
2575
|
...props,
|
2500
2576
|
shouldCloseOnSelect: true,
|
2501
|
-
|
2577
|
+
isInvalid: invalid,
|
2578
|
+
errorMessage: errorText,
|
2579
|
+
isRequired: props.required ?? (fieldContextPRops == null ? void 0 : fieldContextPRops.required),
|
2502
2580
|
validationState: (fieldContextPRops == null ? void 0 : fieldContextPRops.invalid) ? "invalid" : "valid"
|
2503
2581
|
});
|
2504
2582
|
const ref = useRef(null);
|
@@ -2525,54 +2603,65 @@ function DateRangePicker({
|
|
2525
2603
|
return /* @__PURE__ */ jsx(I18nProvider, { locale, children: /* @__PURE__ */ jsxs(Box, { position: "relative", display: "inline-flex", flexDirection: "column", children: [
|
2526
2604
|
props.label && /* @__PURE__ */ jsx("label", { ...labelProps, htmlFor: datePickerId, children: props.label }),
|
2527
2605
|
/* @__PURE__ */ jsxs(Popover$1.Root, { ...dialogProps, children: [
|
2528
|
-
/* @__PURE__ */ jsx(
|
2529
|
-
|
2606
|
+
/* @__PURE__ */ jsx(
|
2607
|
+
Field3,
|
2530
2608
|
{
|
2531
|
-
|
2532
|
-
|
2533
|
-
|
2534
|
-
|
2535
|
-
|
2536
|
-
|
2537
|
-
|
2538
|
-
|
2539
|
-
|
2540
|
-
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2552
|
-
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2609
|
+
width: "auto",
|
2610
|
+
display: "inline-flex",
|
2611
|
+
id: datePickerId,
|
2612
|
+
errorText,
|
2613
|
+
helperText,
|
2614
|
+
invalid,
|
2615
|
+
children: /* @__PURE__ */ jsx(PopoverAnchor, { children: /* @__PURE__ */ jsxs(
|
2616
|
+
StyledField,
|
2617
|
+
{
|
2618
|
+
alignItems: "center",
|
2619
|
+
paddingX: 3,
|
2620
|
+
variant,
|
2621
|
+
onClick: onFieldClick,
|
2622
|
+
minHeight,
|
2623
|
+
children: [
|
2624
|
+
variant && /* @__PURE__ */ jsx(Popover$1.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
|
2625
|
+
CalendarTriggerButton,
|
2626
|
+
{
|
2627
|
+
variant,
|
2628
|
+
ref,
|
2629
|
+
...buttonProps
|
2630
|
+
}
|
2631
|
+
) }),
|
2632
|
+
/* @__PURE__ */ jsx(
|
2633
|
+
DateField,
|
2634
|
+
{
|
2635
|
+
...startFieldProps,
|
2636
|
+
name: startName,
|
2637
|
+
label: props.startLabel,
|
2638
|
+
labelProps
|
2639
|
+
}
|
2640
|
+
),
|
2641
|
+
/* @__PURE__ */ jsx(
|
2642
|
+
Box,
|
2643
|
+
{
|
2644
|
+
as: "span",
|
2645
|
+
"aria-hidden": "true",
|
2646
|
+
paddingRight: "2",
|
2647
|
+
paddingLeft: "2",
|
2648
|
+
children: "\u2013"
|
2649
|
+
}
|
2650
|
+
),
|
2651
|
+
/* @__PURE__ */ jsx(
|
2652
|
+
DateField,
|
2653
|
+
{
|
2654
|
+
...endFieldProps,
|
2655
|
+
name: endName,
|
2656
|
+
label: props.endLabel,
|
2657
|
+
labelProps
|
2658
|
+
}
|
2659
|
+
)
|
2660
|
+
]
|
2661
|
+
}
|
2662
|
+
) })
|
2574
2663
|
}
|
2575
|
-
)
|
2664
|
+
),
|
2576
2665
|
state.isOpen && withPortal && /* @__PURE__ */ jsx(Portal, { children: popoverContent }),
|
2577
2666
|
state.isOpen && !withPortal && popoverContent
|
2578
2667
|
] })
|
@@ -2619,7 +2708,7 @@ var TimePicker = ({
|
|
2619
2708
|
name,
|
2620
2709
|
...boxProps
|
2621
2710
|
}) => {
|
2622
|
-
const { disabled: fieldDisabled, invalid: fieldInvalid } =
|
2711
|
+
const { disabled: fieldDisabled, invalid: fieldInvalid } = useFieldContext() ?? {};
|
2623
2712
|
const isDisabled = isDisabledExternally ?? fieldDisabled ?? false;
|
2624
2713
|
const { t } = useTranslation();
|
2625
2714
|
const locale = useCurrentLocale();
|
@@ -2666,7 +2755,7 @@ var TimePicker = ({
|
|
2666
2755
|
const ariaLabel = `${inputLabel} \u2013 ${t(
|
2667
2756
|
texts11.selectedTimeIs(`${(dateTime == null ? void 0 : dateTime.hour) ?? 0} ${(dateTime == null ? void 0 : dateTime.minute) ?? 0}`)
|
2668
2757
|
)}`;
|
2669
|
-
return /* @__PURE__ */ jsx(
|
2758
|
+
return /* @__PURE__ */ jsx(Field3, { as: "time", ...boxProps, children: /* @__PURE__ */ jsxs(
|
2670
2759
|
StyledField,
|
2671
2760
|
{
|
2672
2761
|
width: "fit-content",
|
@@ -2746,10 +2835,7 @@ var texts11 = createTexts({
|
|
2746
2835
|
sv: "minuter"
|
2747
2836
|
}
|
2748
2837
|
});
|
2749
|
-
|
2750
|
-
throw new Error("Function not implemented.");
|
2751
|
-
}
|
2752
|
-
var DialogContent = React29.forwardRef((props, ref) => {
|
2838
|
+
var DialogContent = React28.forwardRef((props, ref) => {
|
2753
2839
|
const {
|
2754
2840
|
children,
|
2755
2841
|
portalled = true,
|
@@ -2763,7 +2849,7 @@ var DialogContent = React29.forwardRef((props, ref) => {
|
|
2763
2849
|
] });
|
2764
2850
|
});
|
2765
2851
|
DialogContent.displayName = "DialogContent";
|
2766
|
-
var DialogCloseTrigger =
|
2852
|
+
var DialogCloseTrigger = React28.forwardRef(function DialogCloseTrigger2(props, ref) {
|
2767
2853
|
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, { ref, ...props, asChild: true, children: /* @__PURE__ */ jsx(CloseButton, { size: "md" }) });
|
2768
2854
|
});
|
2769
2855
|
var DialogRoot = Dialog.Root;
|
@@ -2962,7 +3048,7 @@ var CardSelectTrigger = forwardRef(
|
|
2962
3048
|
}
|
2963
3049
|
);
|
2964
3050
|
CardSelectTrigger.displayName = "CardSelectTrigger";
|
2965
|
-
var Checkbox =
|
3051
|
+
var Checkbox = React28.forwardRef(
|
2966
3052
|
(props, ref) => {
|
2967
3053
|
const { children, inputProps, rootRef, ...rest } = props;
|
2968
3054
|
return /* @__PURE__ */ jsxs(Checkbox$1.Root, { ref: rootRef, ...rest, children: [
|
@@ -2981,15 +3067,24 @@ var CheckboxGroup = forwardRef(
|
|
2981
3067
|
);
|
2982
3068
|
CheckboxGroup.displayName = "CheckboxGroup";
|
2983
3069
|
var ChoiceChip = forwardRef(
|
2984
|
-
({ children, icon, ...rootProps }, ref) => {
|
2985
|
-
return /* @__PURE__ */ jsx(
|
2986
|
-
|
2987
|
-
|
2988
|
-
|
2989
|
-
|
2990
|
-
|
2991
|
-
|
2992
|
-
|
3070
|
+
({ children, icon, onCheckedChange, ...rootProps }, ref) => {
|
3071
|
+
return /* @__PURE__ */ jsx(
|
3072
|
+
CheckboxCard.Root,
|
3073
|
+
{
|
3074
|
+
...rootProps,
|
3075
|
+
...onCheckedChange && {
|
3076
|
+
onCheckedChange: (details) => onCheckedChange(!!details.checked)
|
3077
|
+
},
|
3078
|
+
children: /* @__PURE__ */ jsx(CheckboxCard.Context, { children: ({ checked }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
3079
|
+
/* @__PURE__ */ jsx(CheckboxCard.HiddenInput, { ref }),
|
3080
|
+
/* @__PURE__ */ jsx(CheckboxCard.Control, { children: /* @__PURE__ */ jsx(CheckboxCard.Content, { children: /* @__PURE__ */ jsxs(CheckboxCard.Label, { children: [
|
3081
|
+
icon && /* @__PURE__ */ jsx(Span, { width: "24px", children: checked ? icon.checked : icon.default }),
|
3082
|
+
rootProps.chipType !== "icon" && children,
|
3083
|
+
rootProps.chipType === "filter" && checked && /* @__PURE__ */ jsx(CloseOutline24Icon, {})
|
3084
|
+
] }) }) })
|
3085
|
+
] }) })
|
3086
|
+
}
|
3087
|
+
);
|
2993
3088
|
}
|
2994
3089
|
);
|
2995
3090
|
ChoiceChip.displayName = "ChoiceChip";
|
@@ -3123,6 +3218,11 @@ var Combobox = forwardRef(
|
|
3123
3218
|
"aria-haspopup": "listbox",
|
3124
3219
|
ref: inputRef,
|
3125
3220
|
role: "combobox",
|
3221
|
+
errorText: props.errorText,
|
3222
|
+
helperText: props.helperText,
|
3223
|
+
required: props.required,
|
3224
|
+
disabled: props.disabled,
|
3225
|
+
invalid: props.invalid,
|
3126
3226
|
label,
|
3127
3227
|
variant,
|
3128
3228
|
"aria-expanded": state.isOpen,
|
@@ -3297,36 +3397,6 @@ var inputRecipe = defineRecipe({
|
|
3297
3397
|
variant: "core"
|
3298
3398
|
}
|
3299
3399
|
});
|
3300
|
-
var InputGroup = React29.forwardRef(
|
3301
|
-
(props, ref) => {
|
3302
|
-
const {
|
3303
|
-
startElement,
|
3304
|
-
startElementProps,
|
3305
|
-
endElement,
|
3306
|
-
endElementProps,
|
3307
|
-
label,
|
3308
|
-
children,
|
3309
|
-
...rest
|
3310
|
-
} = props;
|
3311
|
-
return /* @__PURE__ */ jsxs(Group$1, { ref, ...rest, children: [
|
3312
|
-
startElement && /* @__PURE__ */ jsx(
|
3313
|
-
InputElement,
|
3314
|
-
{
|
3315
|
-
pointerEvents: "none",
|
3316
|
-
paddingX: 2,
|
3317
|
-
...startElementProps,
|
3318
|
-
children: startElement
|
3319
|
-
}
|
3320
|
-
),
|
3321
|
-
React29.cloneElement(children, {
|
3322
|
-
...children.props
|
3323
|
-
}),
|
3324
|
-
label && /* @__PURE__ */ jsx(FieldLabel, { left: startElement ? 4 : "0", right: endElement ? 4 : 0, children: label }),
|
3325
|
-
endElement && /* @__PURE__ */ jsx(InputElement, { placement: "end", paddingX: 2, ...endElementProps, children: endElement })
|
3326
|
-
] });
|
3327
|
-
}
|
3328
|
-
);
|
3329
|
-
InputGroup.displayName = "InputGroup";
|
3330
3400
|
var StyledInput = chakra(Input$1, inputRecipe);
|
3331
3401
|
var Input = forwardRef(
|
3332
3402
|
({
|
@@ -3338,29 +3408,40 @@ var Input = forwardRef(
|
|
3338
3408
|
errorText,
|
3339
3409
|
...props
|
3340
3410
|
}, ref) => {
|
3341
|
-
return /* @__PURE__ */
|
3342
|
-
|
3411
|
+
return /* @__PURE__ */ jsxs(
|
3412
|
+
Field3,
|
3343
3413
|
{
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3350
|
-
|
3351
|
-
|
3352
|
-
|
3353
|
-
|
3354
|
-
|
3355
|
-
|
3356
|
-
|
3357
|
-
|
3358
|
-
|
3359
|
-
|
3360
|
-
|
3361
|
-
|
3414
|
+
invalid,
|
3415
|
+
helperText,
|
3416
|
+
errorText,
|
3417
|
+
label: (
|
3418
|
+
// Render startElement invisibly to align label text with input content when an icon is present
|
3419
|
+
/* @__PURE__ */ jsxs(Flex, { children: [
|
3420
|
+
/* @__PURE__ */ jsx(Box, { visibility: "hidden", children: startElement }),
|
3421
|
+
label
|
3422
|
+
] })
|
3423
|
+
),
|
3424
|
+
floatingLabel: true,
|
3425
|
+
children: [
|
3426
|
+
startElement && /* @__PURE__ */ jsx(InputElement, { pointerEvents: "none", paddingX: 2, children: startElement }),
|
3427
|
+
/* @__PURE__ */ jsx(
|
3428
|
+
StyledInput,
|
3429
|
+
{
|
3430
|
+
"data-attachable": true,
|
3431
|
+
ref,
|
3432
|
+
focusVisibleRing: "outside",
|
3433
|
+
overflow: "hidden",
|
3434
|
+
paddingLeft: startElement ? "2.6rem" : void 0,
|
3435
|
+
paddingRight: endElement ? "2.6rem" : void 0,
|
3436
|
+
...props,
|
3437
|
+
className: `peer ${props.className}`,
|
3438
|
+
placeholder: ""
|
3439
|
+
}
|
3440
|
+
),
|
3441
|
+
endElement && /* @__PURE__ */ jsx(InputElement, { placement: "end", paddingX: 2, children: endElement })
|
3442
|
+
]
|
3362
3443
|
}
|
3363
|
-
)
|
3444
|
+
);
|
3364
3445
|
}
|
3365
3446
|
);
|
3366
3447
|
Input.displayName = "Input";
|
@@ -3438,7 +3519,7 @@ function Option({ item, state }) {
|
|
3438
3519
|
}, []);
|
3439
3520
|
return /* @__PURE__ */ jsx(OptionContext.Provider, { value: { labelProps, descriptionProps }, children: /* @__PURE__ */ jsx(ListItem, { ...optionProps, ...dataFields, ref, css: styles.item, children: item.rendered }) });
|
3440
3521
|
}
|
3441
|
-
var OptionContext =
|
3522
|
+
var OptionContext = React28__default.createContext({
|
3442
3523
|
labelProps: {},
|
3443
3524
|
descriptionProps: {}
|
3444
3525
|
});
|
@@ -3658,53 +3739,73 @@ var nativeSelectSlotRecipe = defineSlotRecipe({
|
|
3658
3739
|
}
|
3659
3740
|
}
|
3660
3741
|
});
|
3661
|
-
var NativeSelect =
|
3742
|
+
var NativeSelect = React28.forwardRef(function NativeSelect2(props, ref) {
|
3662
3743
|
const {
|
3663
3744
|
children,
|
3664
3745
|
variant = "core",
|
3665
3746
|
label,
|
3666
3747
|
invalid,
|
3667
3748
|
disabled,
|
3749
|
+
required,
|
3750
|
+
helperText,
|
3751
|
+
errorText,
|
3668
3752
|
...rest
|
3669
3753
|
} = props;
|
3670
3754
|
const recipe = useSlotRecipe({ recipe: nativeSelectSlotRecipe });
|
3671
3755
|
const styles = recipe({ variant });
|
3672
|
-
return /* @__PURE__ */ jsx(
|
3673
|
-
|
3756
|
+
return /* @__PURE__ */ jsx(
|
3757
|
+
Field3,
|
3674
3758
|
{
|
3675
|
-
|
3676
|
-
|
3677
|
-
|
3678
|
-
|
3679
|
-
|
3680
|
-
|
3681
|
-
|
3682
|
-
|
3683
|
-
|
3684
|
-
|
3685
|
-
|
3686
|
-
|
3687
|
-
|
3688
|
-
|
3689
|
-
|
3759
|
+
label,
|
3760
|
+
invalid,
|
3761
|
+
disabled,
|
3762
|
+
required,
|
3763
|
+
helperText,
|
3764
|
+
errorText,
|
3765
|
+
floatingLabel: true,
|
3766
|
+
children: /* @__PURE__ */ jsxs(
|
3767
|
+
NativeSelect$1.Root,
|
3768
|
+
{
|
3769
|
+
ref,
|
3770
|
+
css: styles.root,
|
3771
|
+
"aria-disabled": disabled,
|
3772
|
+
children: [
|
3773
|
+
/* @__PURE__ */ jsx(
|
3774
|
+
NativeSelect$1.Field,
|
3775
|
+
{
|
3776
|
+
css: styles.field,
|
3777
|
+
"aria-invalid": invalid,
|
3778
|
+
...rest,
|
3779
|
+
children
|
3780
|
+
}
|
3781
|
+
),
|
3782
|
+
/* @__PURE__ */ jsx(NativeSelect$1.Indicator, { css: styles.icon, children: /* @__PURE__ */ jsx(DropdownDownFill18Icon, {}) })
|
3783
|
+
]
|
3784
|
+
}
|
3785
|
+
)
|
3690
3786
|
}
|
3691
|
-
)
|
3787
|
+
);
|
3692
3788
|
});
|
3693
3789
|
var numericStepperRecipe = defineSlotRecipe({
|
3694
3790
|
slots: numericStepperAnatomy.keys(),
|
3695
3791
|
className: "spor-numeric-stepper",
|
3696
3792
|
base: {
|
3697
3793
|
root: {
|
3698
|
-
|
3699
|
-
|
3700
|
-
|
3794
|
+
"& > div": {
|
3795
|
+
display: "flex",
|
3796
|
+
flexDirection: "row",
|
3797
|
+
alignItems: "center"
|
3798
|
+
}
|
3701
3799
|
},
|
3702
3800
|
input: {
|
3703
3801
|
fontSize: "sm",
|
3704
3802
|
fontWeight: "bold",
|
3705
3803
|
marginX: 0.5,
|
3804
|
+
padding: 0,
|
3706
3805
|
paddingX: 0.5,
|
3707
3806
|
borderRadius: "xs",
|
3807
|
+
outline: "none",
|
3808
|
+
height: "auto",
|
3708
3809
|
textAlign: "center",
|
3709
3810
|
transitionProperty: "common",
|
3710
3811
|
transitionDuration: "fast",
|
@@ -3748,8 +3849,8 @@ var numericStepperRecipe = defineSlotRecipe({
|
|
3748
3849
|
}
|
3749
3850
|
}
|
3750
3851
|
});
|
3751
|
-
var NumericStepper =
|
3752
|
-
|
3852
|
+
var NumericStepper = React28__default.forwardRef((props) => {
|
3853
|
+
const {
|
3753
3854
|
name: nameProp,
|
3754
3855
|
id: idProp,
|
3755
3856
|
value: valueProp,
|
@@ -3761,101 +3862,101 @@ var NumericStepper = React29__default.forwardRef(
|
|
3761
3862
|
withInput = true,
|
3762
3863
|
stepSize = 1,
|
3763
3864
|
showZero = false,
|
3764
|
-
ariaLabelContext = { singular: "", plural: "" }
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
|
3777
|
-
|
3778
|
-
|
3779
|
-
|
3780
|
-
|
3781
|
-
|
3782
|
-
|
3783
|
-
|
3784
|
-
|
3785
|
-
|
3786
|
-
|
3787
|
-
|
3788
|
-
|
3789
|
-
|
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
|
-
|
3865
|
+
ariaLabelContext = { singular: "", plural: "" },
|
3866
|
+
...rest
|
3867
|
+
} = props;
|
3868
|
+
const addButtonRef = useRef(null);
|
3869
|
+
const { t } = useTranslation();
|
3870
|
+
const recipe = useSlotRecipe({ recipe: numericStepperRecipe });
|
3871
|
+
const styles = recipe();
|
3872
|
+
const [value, onChange] = useControllableState({
|
3873
|
+
value: valueProp,
|
3874
|
+
onChange: onChangeProp,
|
3875
|
+
defaultValue
|
3876
|
+
});
|
3877
|
+
const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
|
3878
|
+
const focusOnAddButton = () => {
|
3879
|
+
var _a5;
|
3880
|
+
(_a5 = addButtonRef.current) == null ? void 0 : _a5.focus();
|
3881
|
+
};
|
3882
|
+
return /* @__PURE__ */ jsxs(Field3, { css: styles.root, width: "auto", ...rest, children: [
|
3883
|
+
/* @__PURE__ */ jsx(
|
3884
|
+
VerySmallButton,
|
3885
|
+
{
|
3886
|
+
icon: /* @__PURE__ */ jsx(SubtractIcon, { stepLabel: clampedStepSize }),
|
3887
|
+
"aria-label": t(
|
3888
|
+
texts13.decrementButtonAriaLabel(
|
3889
|
+
clampedStepSize,
|
3890
|
+
stepSize === 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
3891
|
+
)
|
3892
|
+
),
|
3893
|
+
onClick: () => {
|
3894
|
+
onChange(Math.max(value - clampedStepSize, minValue));
|
3895
|
+
if (Math.max(value - clampedStepSize, minValue) <= minValue) {
|
3896
|
+
focusOnAddButton();
|
3897
|
+
}
|
3898
|
+
},
|
3899
|
+
visibility: value <= minValue ? "hidden" : "visible",
|
3900
|
+
disabled,
|
3901
|
+
id: value <= minValue ? void 0 : idProp
|
3902
|
+
}
|
3903
|
+
),
|
3904
|
+
withInput ? /* @__PURE__ */ jsx(
|
3905
|
+
Input$1,
|
3906
|
+
{
|
3907
|
+
min: minValue,
|
3908
|
+
max: maxValue,
|
3909
|
+
name: nameProp,
|
3910
|
+
value,
|
3911
|
+
disabled,
|
3912
|
+
id: !showZero && value === 0 ? void 0 : idProp,
|
3913
|
+
css: styles.input,
|
3914
|
+
width: `${Math.max(value.toString().length + 1, 3)}ch`,
|
3915
|
+
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3916
|
+
"aria-live": "assertive",
|
3917
|
+
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3918
|
+
onChange: (e) => {
|
3919
|
+
const numericInput = Number(e.target.value);
|
3920
|
+
if (Number.isNaN(numericInput)) {
|
3921
|
+
return;
|
3922
|
+
}
|
3923
|
+
onChange(Math.max(Math.min(numericInput, maxValue), minValue));
|
3924
|
+
if (!showZero && Math.max(Math.min(numericInput, maxValue), minValue) === 0) {
|
3925
|
+
focusOnAddButton();
|
3825
3926
|
}
|
3826
3927
|
}
|
3827
|
-
|
3828
|
-
|
3829
|
-
|
3830
|
-
|
3831
|
-
|
3832
|
-
|
3833
|
-
|
3834
|
-
|
3835
|
-
|
3836
|
-
|
3837
|
-
|
3838
|
-
|
3839
|
-
|
3840
|
-
|
3841
|
-
|
3842
|
-
|
3843
|
-
|
3844
|
-
|
3845
|
-
|
3846
|
-
|
3847
|
-
)
|
3848
|
-
|
3849
|
-
|
3850
|
-
|
3851
|
-
|
3852
|
-
|
3853
|
-
|
3854
|
-
|
3855
|
-
}
|
3856
|
-
);
|
3928
|
+
}
|
3929
|
+
) : /* @__PURE__ */ jsx(
|
3930
|
+
chakra.text,
|
3931
|
+
{
|
3932
|
+
css: styles,
|
3933
|
+
visibility: !showZero && value === 0 ? "hidden" : "visible",
|
3934
|
+
"aria-live": "assertive",
|
3935
|
+
"aria-label": ariaLabelContext.plural === "" ? "" : t(texts13.currentNumberAriaLabel(ariaLabelContext.plural)),
|
3936
|
+
children: value
|
3937
|
+
}
|
3938
|
+
),
|
3939
|
+
/* @__PURE__ */ jsx(
|
3940
|
+
VerySmallButton,
|
3941
|
+
{
|
3942
|
+
ref: addButtonRef,
|
3943
|
+
icon: /* @__PURE__ */ jsx(AddIcon, { stepLabel: clampedStepSize }),
|
3944
|
+
"aria-label": t(
|
3945
|
+
texts13.incrementButtonAriaLabel(
|
3946
|
+
clampedStepSize,
|
3947
|
+
stepSize === 1 ? ariaLabelContext.singular : ariaLabelContext.plural
|
3948
|
+
)
|
3949
|
+
),
|
3950
|
+
onClick: () => onChange(Math.min(value + clampedStepSize, maxValue)),
|
3951
|
+
visibility: value >= maxValue ? "hidden" : "visible",
|
3952
|
+
disabled,
|
3953
|
+
id: value >= maxValue ? void 0 : idProp
|
3954
|
+
}
|
3955
|
+
)
|
3956
|
+
] });
|
3957
|
+
});
|
3857
3958
|
NumericStepper.displayName = "NumericStepper";
|
3858
|
-
var VerySmallButton =
|
3959
|
+
var VerySmallButton = React28__default.forwardRef((props, ref) => {
|
3859
3960
|
const recipe = useSlotRecipe({ recipe: numericStepperRecipe });
|
3860
3961
|
const styles = recipe({ colorPalette: "default" });
|
3861
3962
|
return /* @__PURE__ */ jsx(
|
@@ -3983,7 +4084,7 @@ var PasswordInput = forwardRef(
|
|
3983
4084
|
}
|
3984
4085
|
);
|
3985
4086
|
PasswordInput.displayName = "PasswordInput";
|
3986
|
-
var VisibilityTrigger =
|
4087
|
+
var VisibilityTrigger = React28__default.forwardRef(
|
3987
4088
|
(props, ref) => {
|
3988
4089
|
return /* @__PURE__ */ jsx(
|
3989
4090
|
Button$1,
|
@@ -4217,12 +4318,21 @@ var texts17 = createTexts({
|
|
4217
4318
|
en: "Reset search field"
|
4218
4319
|
}
|
4219
4320
|
});
|
4220
|
-
var Select =
|
4321
|
+
var Select = React28.forwardRef(
|
4221
4322
|
(props, ref) => {
|
4222
|
-
const {
|
4323
|
+
const {
|
4324
|
+
variant = "core",
|
4325
|
+
children,
|
4326
|
+
positioning,
|
4327
|
+
label,
|
4328
|
+
errorText,
|
4329
|
+
invalid,
|
4330
|
+
helperText,
|
4331
|
+
...rest
|
4332
|
+
} = props;
|
4223
4333
|
const recipe = useSlotRecipe({ key: "select" });
|
4224
4334
|
const styles = recipe({ variant });
|
4225
|
-
return /* @__PURE__ */ jsxs(
|
4335
|
+
return /* @__PURE__ */ jsx(Field3, { errorText, invalid, helperText, children: /* @__PURE__ */ jsxs(
|
4226
4336
|
Select$1.Root,
|
4227
4337
|
{
|
4228
4338
|
...rest,
|
@@ -4237,11 +4347,11 @@ var Select = React29.forwardRef(
|
|
4237
4347
|
/* @__PURE__ */ jsx(SelectContent, { css: styles.selectContent, children })
|
4238
4348
|
]
|
4239
4349
|
}
|
4240
|
-
);
|
4350
|
+
) });
|
4241
4351
|
}
|
4242
4352
|
);
|
4243
4353
|
Select.displayName = "Select";
|
4244
|
-
var SelectItem =
|
4354
|
+
var SelectItem = React28.forwardRef(
|
4245
4355
|
(props, ref) => {
|
4246
4356
|
const { item, children, description, ...rest } = props;
|
4247
4357
|
const recipe = useSlotRecipe({ key: "select" });
|
@@ -4256,14 +4366,14 @@ var SelectItem = React29.forwardRef(
|
|
4256
4366
|
}
|
4257
4367
|
);
|
4258
4368
|
SelectItem.displayName = "SelectItem";
|
4259
|
-
var SelectItemGroup =
|
4369
|
+
var SelectItemGroup = React28.forwardRef(function SelectItemGroup2(props, ref) {
|
4260
4370
|
const { children, label, ...rest } = props;
|
4261
4371
|
return /* @__PURE__ */ jsxs(Select$1.ItemGroup, { ...rest, ref, children: [
|
4262
4372
|
/* @__PURE__ */ jsx(Select$1.ItemGroupLabel, { children: label }),
|
4263
4373
|
children
|
4264
4374
|
] });
|
4265
4375
|
});
|
4266
|
-
var SelectTrigger =
|
4376
|
+
var SelectTrigger = React28.forwardRef(function SelectTrigger2(props, ref) {
|
4267
4377
|
const { children, clearable, ...rest } = props;
|
4268
4378
|
const recipe = useSlotRecipe({ key: "select" });
|
4269
4379
|
const styles = recipe();
|
@@ -4275,7 +4385,7 @@ var SelectTrigger = React29.forwardRef(function SelectTrigger2(props, ref) {
|
|
4275
4385
|
] })
|
4276
4386
|
] });
|
4277
4387
|
});
|
4278
|
-
var SelectClearTrigger =
|
4388
|
+
var SelectClearTrigger = React28.forwardRef(function SelectClearTrigger2(props, ref) {
|
4279
4389
|
return /* @__PURE__ */ jsx(Select$1.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsx(
|
4280
4390
|
CloseButton,
|
4281
4391
|
{
|
@@ -4286,11 +4396,11 @@ var SelectClearTrigger = React29.forwardRef(function SelectClearTrigger2(props,
|
|
4286
4396
|
}
|
4287
4397
|
) });
|
4288
4398
|
});
|
4289
|
-
var SelectContent =
|
4399
|
+
var SelectContent = React28.forwardRef(function SelectContent2(props, ref) {
|
4290
4400
|
const { portalled = true, portalRef, ...rest } = props;
|
4291
4401
|
return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(Select$1.Positioner, { children: /* @__PURE__ */ jsx(Select$1.Content, { ...rest, ref }) }) });
|
4292
4402
|
});
|
4293
|
-
var SelectValueText =
|
4403
|
+
var SelectValueText = React28.forwardRef(function SelectValueText2(props, ref) {
|
4294
4404
|
const { children, withPlaceholder, placeholder, ...rest } = props;
|
4295
4405
|
return /* @__PURE__ */ jsx(
|
4296
4406
|
Select$1.ValueText,
|
@@ -4316,23 +4426,40 @@ var SelectLabel = Select$1.Label;
|
|
4316
4426
|
var SelectItemText = Select$1.ItemText;
|
4317
4427
|
var SelectRoot = Select$1.Root;
|
4318
4428
|
var Switch = forwardRef((props) => {
|
4319
|
-
const {
|
4429
|
+
const {
|
4430
|
+
rootRef,
|
4431
|
+
size = "md",
|
4432
|
+
label,
|
4433
|
+
invalid,
|
4434
|
+
errorText,
|
4435
|
+
helperText,
|
4436
|
+
...rest
|
4437
|
+
} = props;
|
4320
4438
|
const recipe = useSlotRecipe({ key: "switch" });
|
4321
4439
|
const styles = recipe({ size });
|
4322
|
-
return /* @__PURE__ */ jsx(
|
4323
|
-
|
4440
|
+
return /* @__PURE__ */ jsx(
|
4441
|
+
Field3,
|
4324
4442
|
{
|
4325
|
-
|
4326
|
-
|
4327
|
-
|
4328
|
-
|
4329
|
-
children:
|
4330
|
-
|
4331
|
-
|
4332
|
-
|
4333
|
-
|
4443
|
+
style: { width: "auto" },
|
4444
|
+
invalid,
|
4445
|
+
errorText,
|
4446
|
+
helperText,
|
4447
|
+
children: /* @__PURE__ */ jsxs(
|
4448
|
+
Switch$1.Root,
|
4449
|
+
{
|
4450
|
+
ref: rootRef,
|
4451
|
+
...rest,
|
4452
|
+
checked: props.checked,
|
4453
|
+
css: styles.root,
|
4454
|
+
children: [
|
4455
|
+
/* @__PURE__ */ jsx(Switch$1.Label, { children: label }),
|
4456
|
+
/* @__PURE__ */ jsx(Switch$1.HiddenInput, {}),
|
4457
|
+
/* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) })
|
4458
|
+
]
|
4459
|
+
}
|
4460
|
+
)
|
4334
4461
|
}
|
4335
|
-
)
|
4462
|
+
);
|
4336
4463
|
});
|
4337
4464
|
Switch.displayName = "Switch";
|
4338
4465
|
var useLabelHeight = (label) => {
|
@@ -4364,7 +4491,7 @@ var Textarea = forwardRef(
|
|
4364
4491
|
const recipe = useRecipe({ key: "textarea" });
|
4365
4492
|
const styles = recipe({ variant });
|
4366
4493
|
const { labelRef, labelHeight } = useLabelHeight(label);
|
4367
|
-
return /* @__PURE__ */ jsxs(
|
4494
|
+
return /* @__PURE__ */ jsxs(Field3, { ...fieldProps, position: "relative", children: [
|
4368
4495
|
/* @__PURE__ */ jsx(
|
4369
4496
|
Textarea$1,
|
4370
4497
|
{
|
@@ -4376,7 +4503,7 @@ var Textarea = forwardRef(
|
|
4376
4503
|
placeholder: " "
|
4377
4504
|
}
|
4378
4505
|
),
|
4379
|
-
/* @__PURE__ */ jsx(
|
4506
|
+
/* @__PURE__ */ jsx(FloatingLabel, { ref: labelRef, children: label })
|
4380
4507
|
] });
|
4381
4508
|
}
|
4382
4509
|
);
|
@@ -5513,16 +5640,16 @@ NudgeTrigger.displayName = "NudgeTrigger";
|
|
5513
5640
|
var NudgeContent = forwardRef(
|
5514
5641
|
({ showCloseButton = true, children, ...props }, ref) => {
|
5515
5642
|
const [currentStep, setCurrentStep] = useState(1);
|
5516
|
-
const childrenArray =
|
5643
|
+
const childrenArray = React28__default.Children.toArray(children);
|
5517
5644
|
const { open } = usePopoverContext$1();
|
5518
5645
|
useEffect(() => {
|
5519
5646
|
setCurrentStep(1);
|
5520
5647
|
}, [children, open]);
|
5521
5648
|
const wizardPages = childrenArray.filter(
|
5522
|
-
(child) =>
|
5649
|
+
(child) => React28__default.isValidElement(child) && child.type.displayName === "NudgeWizardStep"
|
5523
5650
|
);
|
5524
5651
|
const restChildren = childrenArray.filter(
|
5525
|
-
(child) => !
|
5652
|
+
(child) => !React28__default.isValidElement(child) || child.type.displayName !== "NudgeWizardStep"
|
5526
5653
|
);
|
5527
5654
|
const totalSteps = wizardPages.length;
|
5528
5655
|
const isLastStep = totalSteps === currentStep;
|
@@ -5611,7 +5738,7 @@ NudgeCloseTrigger.displayName = "NudgeCloseTrigger";
|
|
5611
5738
|
var [RootPropsProvider, useRootProps] = createContext$1({
|
5612
5739
|
name: "RootPropsProvider"
|
5613
5740
|
});
|
5614
|
-
var Pagination =
|
5741
|
+
var Pagination = React28.forwardRef(
|
5615
5742
|
(props, ref) => {
|
5616
5743
|
const { getHref, children, ...rest } = props;
|
5617
5744
|
const recipe = useSlotRecipe({ key: "pagination" });
|
@@ -5636,11 +5763,11 @@ var Pagination = React29.forwardRef(
|
|
5636
5763
|
}
|
5637
5764
|
);
|
5638
5765
|
Pagination.displayName = "Pagination";
|
5639
|
-
var PaginationEllipsis =
|
5766
|
+
var PaginationEllipsis = React28.forwardRef((props, ref) => {
|
5640
5767
|
return /* @__PURE__ */ jsx(ListItem2, { children: /* @__PURE__ */ jsx(Pagination$1.Ellipsis, { ref, ...props, asChild: true, children: /* @__PURE__ */ jsx(Box, { cursor: "default", children: "..." }) }) });
|
5641
5768
|
});
|
5642
5769
|
PaginationEllipsis.displayName = "PaginationEllipsis";
|
5643
|
-
var PaginationItem =
|
5770
|
+
var PaginationItem = React28.forwardRef((props, ref) => {
|
5644
5771
|
const rootProps = useRootProps();
|
5645
5772
|
const { t } = useTranslation();
|
5646
5773
|
const { page, totalPages } = usePaginationContext();
|
@@ -5673,7 +5800,7 @@ var PaginationItem = React29.forwardRef((props, ref) => {
|
|
5673
5800
|
) });
|
5674
5801
|
});
|
5675
5802
|
PaginationItem.displayName = "PaginationItem";
|
5676
|
-
var PaginationPrevTrigger =
|
5803
|
+
var PaginationPrevTrigger = React28.forwardRef((props, ref) => {
|
5677
5804
|
const { page } = usePaginationContext();
|
5678
5805
|
const recipe = useSlotRecipe({ key: "pagination" });
|
5679
5806
|
const styles = recipe();
|
@@ -5713,7 +5840,7 @@ var PaginationPrevTrigger = React29.forwardRef((props, ref) => {
|
|
5713
5840
|
) });
|
5714
5841
|
});
|
5715
5842
|
PaginationPrevTrigger.displayName = "PaginationPrevTrigger";
|
5716
|
-
var PaginationNextTrigger =
|
5843
|
+
var PaginationNextTrigger = React28.forwardRef((props, ref) => {
|
5717
5844
|
const { page, totalPages } = usePaginationContext();
|
5718
5845
|
const recipe = useSlotRecipe({ key: "pagination" });
|
5719
5846
|
const styles = recipe();
|
@@ -5801,7 +5928,7 @@ PopoverTrigger.displayName = "PopoverTrigger";
|
|
5801
5928
|
var PopoverContent = forwardRef(
|
5802
5929
|
({ children, showCloseButton = false, ...props }, ref) => {
|
5803
5930
|
const { colorMode } = useColorMode();
|
5804
|
-
const closeButtonRef =
|
5931
|
+
const closeButtonRef = React28__default.useRef(null);
|
5805
5932
|
const { open } = usePopoverContext();
|
5806
5933
|
useEffect(() => {
|
5807
5934
|
if (showCloseButton && open && closeButtonRef.current) {
|
@@ -6011,7 +6138,7 @@ var SporProvider = ({
|
|
6011
6138
|
children
|
6012
6139
|
] }) }) });
|
6013
6140
|
};
|
6014
|
-
var StepperContext =
|
6141
|
+
var StepperContext = React28__default.createContext(null);
|
6015
6142
|
var StepperProvider = ({
|
6016
6143
|
activeStep,
|
6017
6144
|
children,
|
@@ -6028,7 +6155,7 @@ var StepperProvider = ({
|
|
6028
6155
|
);
|
6029
6156
|
};
|
6030
6157
|
var useStepper = () => {
|
6031
|
-
const context =
|
6158
|
+
const context = React28__default.useContext(StepperContext);
|
6032
6159
|
if (!context) {
|
6033
6160
|
throw new Error(
|
6034
6161
|
"useStepper must be used within a StepperProvider. Most likely, you forgot to wrap your StepperStep in a Stepper component"
|
@@ -6226,7 +6353,8 @@ var tableSlotRecipe = defineSlotRecipe({
|
|
6226
6353
|
cell: {
|
6227
6354
|
...numericStyles,
|
6228
6355
|
paddingX: 1.5,
|
6229
|
-
paddingY: 1
|
6356
|
+
paddingY: 1,
|
6357
|
+
width: "100%"
|
6230
6358
|
},
|
6231
6359
|
footer: {
|
6232
6360
|
fontWeight: "medium"
|
@@ -7927,33 +8055,6 @@ var fieldSlotRecipe = defineSlotRecipe({
|
|
7927
8055
|
position: "relative",
|
7928
8056
|
flexDirection: "column"
|
7929
8057
|
},
|
7930
|
-
label: {
|
7931
|
-
/* For when input is filled */
|
7932
|
-
pos: "absolute",
|
7933
|
-
paddingX: 3,
|
7934
|
-
top: "0.3rem",
|
7935
|
-
fontWeight: "normal",
|
7936
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7937
|
-
color: "text",
|
7938
|
-
pointerEvents: "none",
|
7939
|
-
transition: "position",
|
7940
|
-
zIndex: "docked",
|
7941
|
-
_peerPlaceholderShown: {
|
7942
|
-
/* For when input is not in focus */
|
7943
|
-
top: "0.9rem",
|
7944
|
-
color: "text",
|
7945
|
-
fontSize: ["mobile.sm", "desktop.sm"]
|
7946
|
-
},
|
7947
|
-
_peerFocusVisible: {
|
7948
|
-
/* For when input is in focus */
|
7949
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7950
|
-
color: "text",
|
7951
|
-
top: "0.3rem"
|
7952
|
-
},
|
7953
|
-
_disabled: {
|
7954
|
-
opacity: 0.4
|
7955
|
-
}
|
7956
|
-
},
|
7957
8058
|
requiredIndicator: {
|
7958
8059
|
marginStart: 1,
|
7959
8060
|
color: "brightRed"
|
@@ -7973,7 +8074,7 @@ var fieldSlotRecipe = defineSlotRecipe({
|
|
7973
8074
|
textStyle: "xs",
|
7974
8075
|
width: "fit-content",
|
7975
8076
|
position: "absolute",
|
7976
|
-
bottom: -
|
8077
|
+
bottom: -5,
|
7977
8078
|
left: 3,
|
7978
8079
|
zIndex: "dropdown",
|
7979
8080
|
maxWidth: "50ch",
|
@@ -9219,6 +9320,10 @@ var selectSlotRecipe = defineSlotRecipe({
|
|
9219
9320
|
},
|
9220
9321
|
_open: {
|
9221
9322
|
borderBottomRadius: 0
|
9323
|
+
},
|
9324
|
+
_invalid: {
|
9325
|
+
outline: "2px solid",
|
9326
|
+
outlineColor: "outline.error"
|
9222
9327
|
}
|
9223
9328
|
},
|
9224
9329
|
itemText: {
|
@@ -9253,10 +9358,6 @@ var selectSlotRecipe = defineSlotRecipe({
|
|
9253
9358
|
_active: {
|
9254
9359
|
backgroundColor: "brand.surface.active"
|
9255
9360
|
},
|
9256
|
-
_invalid: {
|
9257
|
-
outline: "2px solid",
|
9258
|
-
outlineColor: "outline.error"
|
9259
|
-
},
|
9260
9361
|
_disabled: {
|
9261
9362
|
pointerEvents: "none",
|
9262
9363
|
color: "text.disabled",
|
@@ -10646,6 +10747,6 @@ var themes = {
|
|
10646
10747
|
};
|
10647
10748
|
var system = themes["VyDigital" /* VyDigital */];
|
10648
10749
|
|
10649
|
-
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, AttachedInputs, Badge, Brand, Breadcrumb, Button, ButtonGroup, CardSelect, CardSelectContent, CardSelectTrigger, CargonetLogo, Checkbox, CheckboxGroup, ChoiceChip, Clipboard, ClipboardButton, CloseButton, CloseDrawerLine, Code, ColorInlineLoader, ColorModeButton, ColorModeIcon, ColorModeProvider, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field, FieldErrorText, FieldLabel, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, Heading, IconButton, InfoTag, Input, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, List, ListBox, ListIndicator, ListItem2 as ListItem, NativeSelect, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, NudgeTrigger, NudgeWizardStep, NumericStepper, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover2 as Popover, PopoverContent, PopoverTrigger, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, SearchInput, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, StaticCard, Stepper, StepperStep, SvgBox, Switch, Table, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Text3 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useColorMode, useColorModeValue, useTranslation };
|
10750
|
+
export { Accordion, AccordionItem, AccordionItemContent, AccordionItemTrigger, Alert, AttachedInputs, Badge, Brand, Breadcrumb, Button, ButtonGroup, CardSelect, CardSelectContent, CardSelectTrigger, CargonetLogo, Checkbox, CheckboxGroup, ChoiceChip, Clipboard, ClipboardButton, CloseButton, CloseDrawerLine, Code, ColorInlineLoader, ColorModeButton, ColorModeIcon, ColorModeProvider, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, DialogActionTrigger, DialogBackdrop, DialogBody, DialogCloseTrigger, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogRoot, DialogTitle, DialogTrigger, Drawer, DrawerActionTrigger, DrawerBackTrigger, DrawerBackdrop, DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerFullScreenHeader, DrawerHeader, DrawerTitle, DrawerTrigger, Expandable, ExpandableAlert, ExpandableItem, Field3 as Field, FieldErrorText, FieldLabel, Fieldset, FieldsetContent, FieldsetErrorText, FieldsetHelperText, FieldsetLegend, FloatingActionButton, Heading, IconButton, InfoTag, Input, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, List, ListBox, ListIndicator, ListItem2 as ListItem, NativeSelect, Nudge, NudgeActions, NudgeCloseTrigger, NudgeContent, NudgeTrigger, NudgeWizardStep, NumericStepper, Pagination, PaginationEllipsis, PaginationItem, PaginationItems, PaginationNextTrigger, PaginationPrevTrigger, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover2 as Popover, PopoverContent, PopoverTrigger, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardLabel, RadioGroup, SearchInput, Select, SelectContent, SelectItem, SelectItemGroup, SelectItemText, SelectLabel, SelectRoot, SelectTrigger, SelectValueText, Separator, ServiceAlert, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, StaticCard, Stepper, StepperStep, SvgBox, Switch, Table, Tabs, TabsContent, TabsIndicator, TabsList, TabsTrigger, Text3 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, VyLogoPride, createTexts, createToast, fontFaces, slugify, system, themes, useColorMode, useColorModeValue, useTranslation };
|
10650
10751
|
//# sourceMappingURL=out.js.map
|
10651
10752
|
//# sourceMappingURL=index.mjs.map
|