@vygruppen/spor-react 12.2.0 → 12.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +11 -11
- package/.turbo/turbo-typegen.log +1 -1
- package/CHANGELOG.md +20 -0
- package/dist/index.d.mts +115 -212
- package/dist/index.d.ts +115 -212
- package/dist/index.js +566 -457
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +569 -460
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- 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 +49 -66
- 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/anatomy.ts +10 -0
- package/src/theme/slot-recipes/choice-chip.ts +183 -0
- package/src/theme/slot-recipes/field.ts +1 -28
- package/src/theme/slot-recipes/index.ts +2 -0
- package/src/theme/slot-recipes/numeric-stepper.ts +8 -3
- package/src/theme/slot-recipes/select.ts +4 -4
- package/src/input/InputGroup.tsx +0 -67
- package/src/theme/recipes/choice-chip.ts +0 -144
package/dist/index.js
CHANGED
@@ -1403,20 +1403,89 @@ var ColorModeButton = React28__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
|
-
|
1488
|
+
Field3.displayName = "Field";
|
1420
1489
|
var FieldErrorText = React28__namespace.forwardRef((props, ref) => {
|
1421
1490
|
return /* @__PURE__ */ jsxRuntime.jsx(react.Field.ErrorText, { ref, children: props.children });
|
1422
1491
|
});
|
@@ -1662,6 +1731,15 @@ var datepickerAnatomy = anatomy.createAnatomy("datepicker").parts(
|
|
1662
1731
|
"box",
|
1663
1732
|
"rangeCalendarPopover"
|
1664
1733
|
);
|
1734
|
+
var checkboxCardAnatomy = anatomy.createAnatomy("checkbox-card", [
|
1735
|
+
"root",
|
1736
|
+
"control",
|
1737
|
+
"label",
|
1738
|
+
"description",
|
1739
|
+
"addon",
|
1740
|
+
"indicator",
|
1741
|
+
"content"
|
1742
|
+
]);
|
1665
1743
|
|
1666
1744
|
// src/theme/slot-recipes/datepicker.ts
|
1667
1745
|
var datePickerSlotRecipe = react.defineSlotRecipe({
|
@@ -2373,18 +2451,20 @@ var StyledField = React28.forwardRef(
|
|
2373
2451
|
var DatePicker = React28.forwardRef(
|
2374
2452
|
({
|
2375
2453
|
variant,
|
2376
|
-
|
2454
|
+
errorText,
|
2377
2455
|
minHeight,
|
2378
2456
|
showYearNavigation,
|
2379
2457
|
withPortal = true,
|
2380
2458
|
width = "auto",
|
2459
|
+
invalid = false,
|
2460
|
+
helperText,
|
2381
2461
|
...props
|
2382
2462
|
}, externalRef) => {
|
2383
2463
|
const chakraFieldProps = react.useFieldContext();
|
2384
2464
|
const state = reactStately.useDatePickerState({
|
2385
2465
|
...props,
|
2386
2466
|
shouldCloseOnSelect: true,
|
2387
|
-
errorMessage,
|
2467
|
+
errorMessage: errorText,
|
2388
2468
|
isRequired: props.isRequired ?? (chakraFieldProps == null ? void 0 : chakraFieldProps.required),
|
2389
2469
|
validationState: (chakraFieldProps == null ? void 0 : chakraFieldProps.invalid) ? "invalid" : "valid"
|
2390
2470
|
});
|
@@ -2423,12 +2503,14 @@ var DatePicker = React28.forwardRef(
|
|
2423
2503
|
width,
|
2424
2504
|
children: /* @__PURE__ */ jsxRuntime.jsxs(react.Popover.Root, { ...dialogProps, children: [
|
2425
2505
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2426
|
-
|
2506
|
+
Field3,
|
2427
2507
|
{
|
2428
2508
|
display: "inline-flex",
|
2429
2509
|
id: inputGroupId,
|
2430
2510
|
"aria-labelledby": labelId,
|
2431
|
-
errorText
|
2511
|
+
errorText,
|
2512
|
+
invalid,
|
2513
|
+
helperText,
|
2432
2514
|
children: /* @__PURE__ */ jsxRuntime.jsx(react.PopoverAnchor, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
2433
2515
|
StyledField,
|
2434
2516
|
{
|
@@ -2508,13 +2590,18 @@ function DateRangePicker({
|
|
2508
2590
|
startName,
|
2509
2591
|
endName,
|
2510
2592
|
withPortal = true,
|
2593
|
+
errorText,
|
2594
|
+
helperText,
|
2595
|
+
invalid,
|
2511
2596
|
...props
|
2512
2597
|
}) {
|
2513
2598
|
const fieldContextPRops = react.useFieldContext();
|
2514
2599
|
const state = reactStately.useDateRangePickerState({
|
2515
2600
|
...props,
|
2516
2601
|
shouldCloseOnSelect: true,
|
2517
|
-
|
2602
|
+
isInvalid: invalid,
|
2603
|
+
errorMessage: errorText,
|
2604
|
+
isRequired: props.required ?? (fieldContextPRops == null ? void 0 : fieldContextPRops.required),
|
2518
2605
|
validationState: (fieldContextPRops == null ? void 0 : fieldContextPRops.invalid) ? "invalid" : "valid"
|
2519
2606
|
});
|
2520
2607
|
const ref = React28.useRef(null);
|
@@ -2541,54 +2628,65 @@ function DateRangePicker({
|
|
2541
2628
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAria.I18nProvider, { locale, children: /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { position: "relative", display: "inline-flex", flexDirection: "column", children: [
|
2542
2629
|
props.label && /* @__PURE__ */ jsxRuntime.jsx("label", { ...labelProps, htmlFor: datePickerId, children: props.label }),
|
2543
2630
|
/* @__PURE__ */ jsxRuntime.jsxs(react.Popover.Root, { ...dialogProps, children: [
|
2544
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
2545
|
-
|
2631
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2632
|
+
Field3,
|
2546
2633
|
{
|
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
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2586
|
-
|
2587
|
-
|
2588
|
-
|
2589
|
-
|
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
|
+
) })
|
2590
2688
|
}
|
2591
|
-
)
|
2689
|
+
),
|
2592
2690
|
state.isOpen && withPortal && /* @__PURE__ */ jsxRuntime.jsx(react.Portal, { children: popoverContent }),
|
2593
2691
|
state.isOpen && !withPortal && popoverContent
|
2594
2692
|
] })
|
@@ -2635,7 +2733,7 @@ var TimePicker = ({
|
|
2635
2733
|
name,
|
2636
2734
|
...boxProps
|
2637
2735
|
}) => {
|
2638
|
-
const { disabled: fieldDisabled, invalid: fieldInvalid } =
|
2736
|
+
const { disabled: fieldDisabled, invalid: fieldInvalid } = react.useFieldContext() ?? {};
|
2639
2737
|
const isDisabled = isDisabledExternally ?? fieldDisabled ?? false;
|
2640
2738
|
const { t } = useTranslation();
|
2641
2739
|
const locale = useCurrentLocale();
|
@@ -2682,7 +2780,7 @@ var TimePicker = ({
|
|
2682
2780
|
const ariaLabel = `${inputLabel} \u2013 ${t(
|
2683
2781
|
texts11.selectedTimeIs(`${(dateTime == null ? void 0 : dateTime.hour) ?? 0} ${(dateTime == null ? void 0 : dateTime.minute) ?? 0}`)
|
2684
2782
|
)}`;
|
2685
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2783
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field3, { as: "time", ...boxProps, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
2686
2784
|
StyledField,
|
2687
2785
|
{
|
2688
2786
|
width: "fit-content",
|
@@ -2762,9 +2860,6 @@ var texts11 = createTexts({
|
|
2762
2860
|
sv: "minuter"
|
2763
2861
|
}
|
2764
2862
|
});
|
2765
|
-
function useFieldContext4() {
|
2766
|
-
throw new Error("Function not implemented.");
|
2767
|
-
}
|
2768
2863
|
var DialogContent = React28__namespace.forwardRef((props, ref) => {
|
2769
2864
|
const {
|
2770
2865
|
children,
|
@@ -2996,184 +3091,28 @@ var CheckboxGroup = React28.forwardRef(
|
|
2996
3091
|
}
|
2997
3092
|
);
|
2998
3093
|
CheckboxGroup.displayName = "CheckboxGroup";
|
2999
|
-
var
|
3000
|
-
|
3001
|
-
|
3002
|
-
|
3003
|
-
|
3004
|
-
|
3005
|
-
|
3006
|
-
|
3007
|
-
borderRadius: "xl",
|
3008
|
-
transitionDuration: "fast",
|
3009
|
-
height: 6,
|
3010
|
-
paddingInlineStart: "2",
|
3011
|
-
paddingInlineEnd: "2",
|
3012
|
-
outline: "1px solid",
|
3013
|
-
outlineColor: "base.outline",
|
3014
|
-
_checked: {
|
3015
|
-
backgroundColor: "brand.surface",
|
3016
|
-
borderRadius: "sm",
|
3017
|
-
outline: "none",
|
3018
|
-
color: "brand.text",
|
3019
|
-
_hover: {
|
3020
|
-
backgroundColor: "brand.surface.hover",
|
3021
|
-
_active: {
|
3022
|
-
backgroundColor: "brand.surface.active"
|
3023
|
-
}
|
3024
|
-
}
|
3025
|
-
},
|
3026
|
-
_focusVisible: {
|
3027
|
-
outline: "2px solid",
|
3028
|
-
outlineColor: "outline.focus",
|
3029
|
-
outlineOffset: "1px"
|
3030
|
-
},
|
3031
|
-
_disabled: {
|
3032
|
-
pointerEvents: "none",
|
3033
|
-
boxShadow: "none",
|
3034
|
-
backgroundColor: "surface.disabled",
|
3035
|
-
color: "text.disabled",
|
3036
|
-
outline: "none",
|
3037
|
-
_hover: {
|
3038
|
-
backgroundColor: "core.surface.disabled",
|
3039
|
-
boxShadow: "none",
|
3040
|
-
color: "core.text.disabled"
|
3041
|
-
},
|
3042
|
-
_checked: {
|
3043
|
-
cursor: "not-allowed",
|
3044
|
-
boxShadow: "none",
|
3045
|
-
color: "core.text.disabled",
|
3046
|
-
backgroundColor: "core.surface.disabled",
|
3047
|
-
_hover: {
|
3048
|
-
backgroundColor: "core.surface.disabled",
|
3049
|
-
boxShadow: "none",
|
3050
|
-
color: "core.text.disabled"
|
3051
|
-
}
|
3052
|
-
}
|
3053
|
-
}
|
3054
|
-
},
|
3055
|
-
variants: {
|
3056
|
-
variant: {
|
3057
|
-
core: {
|
3058
|
-
color: "core.text",
|
3059
|
-
outlineColor: "core.outline",
|
3060
|
-
_hover: {
|
3061
|
-
outline: "2px solid",
|
3062
|
-
outlineColor: "core.outline.hover",
|
3063
|
-
_active: {
|
3064
|
-
outline: "1px solid",
|
3065
|
-
outlineColor: "core.outline",
|
3066
|
-
backgroundColor: "core.surface.active"
|
3067
|
-
}
|
3068
|
-
}
|
3069
|
-
},
|
3070
|
-
accent: {
|
3071
|
-
backgroundColor: "accent.surface",
|
3072
|
-
color: "accent.text",
|
3073
|
-
outline: "none",
|
3074
|
-
_hover: {
|
3075
|
-
backgroundColor: "accent.surface.hover",
|
3076
|
-
_active: {
|
3077
|
-
backgroundColor: "accent.surface.active"
|
3078
|
-
}
|
3079
|
-
}
|
3080
|
-
},
|
3081
|
-
floating: {
|
3082
|
-
backgroundColor: "floating.surface",
|
3083
|
-
outline: "1px solid",
|
3084
|
-
outlineColor: "floating.outline",
|
3085
|
-
color: "floating.text",
|
3086
|
-
boxShadow: "sm",
|
3087
|
-
_hover: {
|
3088
|
-
backgroundColor: "floating.surface.hover",
|
3089
|
-
outline: "1px solid",
|
3090
|
-
outlineColor: "floating.outline.hover",
|
3091
|
-
_active: {
|
3092
|
-
backgroundColor: "floating.surface.active",
|
3093
|
-
outline: "1px solid",
|
3094
|
-
outlineColor: "floating.outline"
|
3095
|
-
}
|
3096
|
-
}
|
3097
|
-
}
|
3098
|
-
},
|
3099
|
-
size: {
|
3100
|
-
xs: {
|
3101
|
-
_checked: {
|
3102
|
-
borderRadius: "0.563rem"
|
3103
|
-
},
|
3104
|
-
height: 5,
|
3105
|
-
paddingX: 1.5
|
3106
|
-
},
|
3107
|
-
sm: {
|
3108
|
-
_checked: {
|
3109
|
-
borderRadius: "sm"
|
3110
|
-
},
|
3111
|
-
height: 6,
|
3112
|
-
paddingX: 2
|
3113
|
-
},
|
3114
|
-
md: {
|
3115
|
-
_checked: {
|
3116
|
-
borderRadius: "sm"
|
3117
|
-
},
|
3118
|
-
height: 7,
|
3119
|
-
paddingX: 2
|
3120
|
-
},
|
3121
|
-
lg: {
|
3122
|
-
_checked: {
|
3123
|
-
borderRadius: "md"
|
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)
|
3124
3102
|
},
|
3125
|
-
|
3126
|
-
|
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
|
+
] }) })
|
3127
3111
|
}
|
3128
|
-
|
3112
|
+
);
|
3129
3113
|
}
|
3130
|
-
|
3131
|
-
|
3132
|
-
var ChoiceChip = ({
|
3133
|
-
children,
|
3134
|
-
icon,
|
3135
|
-
size = "sm",
|
3136
|
-
chipType = "choice",
|
3137
|
-
variant = "core",
|
3138
|
-
...props
|
3139
|
-
}) => {
|
3140
|
-
const {
|
3141
|
-
getControlProps,
|
3142
|
-
disabled,
|
3143
|
-
getLabelProps,
|
3144
|
-
getHiddenInputProps,
|
3145
|
-
setChecked,
|
3146
|
-
checked
|
3147
|
-
} = react.useCheckbox(props);
|
3148
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
3149
|
-
react.chakra.label,
|
3150
|
-
{
|
3151
|
-
...getLabelProps(),
|
3152
|
-
"aria-label": props["aria-label"] ?? String(children),
|
3153
|
-
children: [
|
3154
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
3155
|
-
react.chakra.input,
|
3156
|
-
{
|
3157
|
-
...getHiddenInputProps(),
|
3158
|
-
disabled,
|
3159
|
-
defaultChecked: checked,
|
3160
|
-
value: checked ? "on" : "off",
|
3161
|
-
type: "checkbox",
|
3162
|
-
"aria-checked": checked,
|
3163
|
-
onClick: () => {
|
3164
|
-
setChecked(!checked);
|
3165
|
-
}
|
3166
|
-
}
|
3167
|
-
),
|
3168
|
-
/* @__PURE__ */ jsxRuntime.jsxs(ChoiceChipStyledDiv, { ...getControlProps(), size, variant, children: [
|
3169
|
-
icon && /* @__PURE__ */ jsxRuntime.jsx(react.Span, { children: checked ? icon.checked : icon.default }),
|
3170
|
-
chipType !== "icon" && /* @__PURE__ */ jsxRuntime.jsx(react.Span, { children }),
|
3171
|
-
chipType === "filter" && checked && /* @__PURE__ */ jsxRuntime.jsx(sporIconReact.CloseOutline24Icon, { marginLeft: 1.5 })
|
3172
|
-
] })
|
3173
|
-
]
|
3174
|
-
}
|
3175
|
-
);
|
3176
|
-
};
|
3114
|
+
);
|
3115
|
+
ChoiceChip.displayName = "ChoiceChip";
|
3177
3116
|
var Popover = React28.forwardRef(
|
3178
3117
|
({
|
3179
3118
|
children,
|
@@ -3304,6 +3243,11 @@ var Combobox = React28.forwardRef(
|
|
3304
3243
|
"aria-haspopup": "listbox",
|
3305
3244
|
ref: inputRef,
|
3306
3245
|
role: "combobox",
|
3246
|
+
errorText: props.errorText,
|
3247
|
+
helperText: props.helperText,
|
3248
|
+
required: props.required,
|
3249
|
+
disabled: props.disabled,
|
3250
|
+
invalid: props.invalid,
|
3307
3251
|
label,
|
3308
3252
|
variant,
|
3309
3253
|
"aria-expanded": state.isOpen,
|
@@ -3478,36 +3422,6 @@ var inputRecipe = react.defineRecipe({
|
|
3478
3422
|
variant: "core"
|
3479
3423
|
}
|
3480
3424
|
});
|
3481
|
-
var InputGroup = React28__namespace.forwardRef(
|
3482
|
-
(props, ref) => {
|
3483
|
-
const {
|
3484
|
-
startElement,
|
3485
|
-
startElementProps,
|
3486
|
-
endElement,
|
3487
|
-
endElementProps,
|
3488
|
-
label,
|
3489
|
-
children,
|
3490
|
-
...rest
|
3491
|
-
} = props;
|
3492
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(react.Group, { ref, ...rest, children: [
|
3493
|
-
startElement && /* @__PURE__ */ jsxRuntime.jsx(
|
3494
|
-
react.InputElement,
|
3495
|
-
{
|
3496
|
-
pointerEvents: "none",
|
3497
|
-
paddingX: 2,
|
3498
|
-
...startElementProps,
|
3499
|
-
children: startElement
|
3500
|
-
}
|
3501
|
-
),
|
3502
|
-
React28__namespace.cloneElement(children, {
|
3503
|
-
...children.props
|
3504
|
-
}),
|
3505
|
-
label && /* @__PURE__ */ jsxRuntime.jsx(FieldLabel, { left: startElement ? 4 : "0", right: endElement ? 4 : 0, children: label }),
|
3506
|
-
endElement && /* @__PURE__ */ jsxRuntime.jsx(react.InputElement, { placement: "end", paddingX: 2, ...endElementProps, children: endElement })
|
3507
|
-
] });
|
3508
|
-
}
|
3509
|
-
);
|
3510
|
-
InputGroup.displayName = "InputGroup";
|
3511
3425
|
var StyledInput = react.chakra(react.Input, inputRecipe);
|
3512
3426
|
var Input = React28.forwardRef(
|
3513
3427
|
({
|
@@ -3519,29 +3433,40 @@ var Input = React28.forwardRef(
|
|
3519
3433
|
errorText,
|
3520
3434
|
...props
|
3521
3435
|
}, ref) => {
|
3522
|
-
return /* @__PURE__ */ jsxRuntime.
|
3523
|
-
|
3436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
3437
|
+
Field3,
|
3524
3438
|
{
|
3525
|
-
|
3526
|
-
|
3527
|
-
|
3528
|
-
|
3529
|
-
|
3530
|
-
|
3531
|
-
|
3532
|
-
|
3533
|
-
|
3534
|
-
|
3535
|
-
|
3536
|
-
|
3537
|
-
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
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
|
+
]
|
3543
3468
|
}
|
3544
|
-
)
|
3469
|
+
);
|
3545
3470
|
}
|
3546
3471
|
);
|
3547
3472
|
Input.displayName = "Input";
|
@@ -3846,46 +3771,66 @@ var NativeSelect = React28__namespace.forwardRef(function NativeSelect2(props, r
|
|
3846
3771
|
label,
|
3847
3772
|
invalid,
|
3848
3773
|
disabled,
|
3774
|
+
required,
|
3775
|
+
helperText,
|
3776
|
+
errorText,
|
3849
3777
|
...rest
|
3850
3778
|
} = props;
|
3851
3779
|
const recipe = react.useSlotRecipe({ recipe: nativeSelectSlotRecipe });
|
3852
3780
|
const styles = recipe({ variant });
|
3853
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
3854
|
-
|
3781
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
3782
|
+
Field3,
|
3855
3783
|
{
|
3856
|
-
|
3857
|
-
|
3858
|
-
|
3859
|
-
|
3860
|
-
|
3861
|
-
|
3862
|
-
|
3863
|
-
|
3864
|
-
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
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
|
+
)
|
3871
3811
|
}
|
3872
|
-
)
|
3812
|
+
);
|
3873
3813
|
});
|
3874
3814
|
var numericStepperRecipe = react.defineSlotRecipe({
|
3875
3815
|
slots: numericStepperAnatomy.keys(),
|
3876
3816
|
className: "spor-numeric-stepper",
|
3877
3817
|
base: {
|
3878
3818
|
root: {
|
3879
|
-
|
3880
|
-
|
3881
|
-
|
3819
|
+
"& > div": {
|
3820
|
+
display: "flex",
|
3821
|
+
flexDirection: "row",
|
3822
|
+
alignItems: "center"
|
3823
|
+
}
|
3882
3824
|
},
|
3883
3825
|
input: {
|
3884
3826
|
fontSize: "sm",
|
3885
3827
|
fontWeight: "bold",
|
3886
3828
|
marginX: 0.5,
|
3829
|
+
padding: 0,
|
3887
3830
|
paddingX: 0.5,
|
3888
3831
|
borderRadius: "xs",
|
3832
|
+
outline: "none",
|
3833
|
+
height: "auto",
|
3889
3834
|
textAlign: "center",
|
3890
3835
|
transitionProperty: "common",
|
3891
3836
|
transitionDuration: "fast",
|
@@ -3929,8 +3874,8 @@ var numericStepperRecipe = react.defineSlotRecipe({
|
|
3929
3874
|
}
|
3930
3875
|
}
|
3931
3876
|
});
|
3932
|
-
var NumericStepper = React28__namespace.default.forwardRef(
|
3933
|
-
|
3877
|
+
var NumericStepper = React28__namespace.default.forwardRef((props) => {
|
3878
|
+
const {
|
3934
3879
|
name: nameProp,
|
3935
3880
|
id: idProp,
|
3936
3881
|
value: valueProp,
|
@@ -3942,99 +3887,99 @@ var NumericStepper = React28__namespace.default.forwardRef(
|
|
3942
3887
|
withInput = true,
|
3943
3888
|
stepSize = 1,
|
3944
3889
|
showZero = false,
|
3945
|
-
ariaLabelContext = { singular: "", plural: "" }
|
3946
|
-
|
3947
|
-
|
3948
|
-
|
3949
|
-
|
3950
|
-
|
3951
|
-
|
3952
|
-
|
3953
|
-
|
3954
|
-
|
3955
|
-
|
3956
|
-
|
3957
|
-
|
3958
|
-
|
3959
|
-
|
3960
|
-
|
3961
|
-
|
3962
|
-
|
3963
|
-
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3967
|
-
|
3968
|
-
|
3969
|
-
|
3970
|
-
|
3971
|
-
)
|
3972
|
-
|
3973
|
-
|
3974
|
-
|
3975
|
-
|
3976
|
-
|
3977
|
-
}
|
3978
|
-
|
3979
|
-
|
3980
|
-
|
3981
|
-
|
3982
|
-
|
3983
|
-
|
3984
|
-
|
3985
|
-
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
|
3996
|
-
|
3997
|
-
|
3998
|
-
|
3999
|
-
|
4000
|
-
|
4001
|
-
|
4002
|
-
|
4003
|
-
|
4004
|
-
|
4005
|
-
|
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();
|
4006
3951
|
}
|
4007
3952
|
}
|
4008
|
-
|
4009
|
-
|
4010
|
-
|
4011
|
-
|
4012
|
-
|
4013
|
-
|
4014
|
-
|
4015
|
-
|
4016
|
-
|
4017
|
-
|
4018
|
-
|
4019
|
-
|
4020
|
-
|
4021
|
-
|
4022
|
-
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
|
4028
|
-
)
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
}
|
4037
|
-
);
|
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
|
+
});
|
4038
3983
|
NumericStepper.displayName = "NumericStepper";
|
4039
3984
|
var VerySmallButton = React28__namespace.default.forwardRef((props, ref) => {
|
4040
3985
|
const recipe = react.useSlotRecipe({ recipe: numericStepperRecipe });
|
@@ -4400,10 +4345,19 @@ var texts17 = createTexts({
|
|
4400
4345
|
});
|
4401
4346
|
var Select = React28__namespace.forwardRef(
|
4402
4347
|
(props, ref) => {
|
4403
|
-
const {
|
4348
|
+
const {
|
4349
|
+
variant = "core",
|
4350
|
+
children,
|
4351
|
+
positioning,
|
4352
|
+
label,
|
4353
|
+
errorText,
|
4354
|
+
invalid,
|
4355
|
+
helperText,
|
4356
|
+
...rest
|
4357
|
+
} = props;
|
4404
4358
|
const recipe = react.useSlotRecipe({ key: "select" });
|
4405
4359
|
const styles = recipe({ variant });
|
4406
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
4360
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field3, { errorText, invalid, helperText, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4407
4361
|
react.Select.Root,
|
4408
4362
|
{
|
4409
4363
|
...rest,
|
@@ -4418,7 +4372,7 @@ var Select = React28__namespace.forwardRef(
|
|
4418
4372
|
/* @__PURE__ */ jsxRuntime.jsx(SelectContent, { css: styles.selectContent, children })
|
4419
4373
|
]
|
4420
4374
|
}
|
4421
|
-
);
|
4375
|
+
) });
|
4422
4376
|
}
|
4423
4377
|
);
|
4424
4378
|
Select.displayName = "Select";
|
@@ -4497,23 +4451,40 @@ var SelectLabel = react.Select.Label;
|
|
4497
4451
|
var SelectItemText = react.Select.ItemText;
|
4498
4452
|
var SelectRoot = react.Select.Root;
|
4499
4453
|
var Switch = React28.forwardRef((props) => {
|
4500
|
-
const {
|
4454
|
+
const {
|
4455
|
+
rootRef,
|
4456
|
+
size = "md",
|
4457
|
+
label,
|
4458
|
+
invalid,
|
4459
|
+
errorText,
|
4460
|
+
helperText,
|
4461
|
+
...rest
|
4462
|
+
} = props;
|
4501
4463
|
const recipe = react.useSlotRecipe({ key: "switch" });
|
4502
4464
|
const styles = recipe({ size });
|
4503
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
4504
|
-
|
4465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
4466
|
+
Field3,
|
4505
4467
|
{
|
4506
|
-
|
4507
|
-
|
4508
|
-
|
4509
|
-
|
4510
|
-
children:
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
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
|
+
)
|
4515
4486
|
}
|
4516
|
-
)
|
4487
|
+
);
|
4517
4488
|
});
|
4518
4489
|
Switch.displayName = "Switch";
|
4519
4490
|
var useLabelHeight = (label) => {
|
@@ -4545,7 +4516,7 @@ var Textarea = React28.forwardRef(
|
|
4545
4516
|
const recipe = react.useRecipe({ key: "textarea" });
|
4546
4517
|
const styles = recipe({ variant });
|
4547
4518
|
const { labelRef, labelHeight } = useLabelHeight(label);
|
4548
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
4519
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Field3, { ...fieldProps, position: "relative", children: [
|
4549
4520
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4550
4521
|
react.Textarea,
|
4551
4522
|
{
|
@@ -4557,7 +4528,7 @@ var Textarea = React28.forwardRef(
|
|
4557
4528
|
placeholder: " "
|
4558
4529
|
}
|
4559
4530
|
),
|
4560
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4531
|
+
/* @__PURE__ */ jsxRuntime.jsx(FloatingLabel, { ref: labelRef, children: label })
|
4561
4532
|
] });
|
4562
4533
|
}
|
4563
4534
|
);
|
@@ -7522,6 +7493,170 @@ var checkboxSlotRecipe = react.defineSlotRecipe({
|
|
7522
7493
|
}
|
7523
7494
|
}
|
7524
7495
|
});
|
7496
|
+
var choiceChipSlotRecipe = react.defineSlotRecipe({
|
7497
|
+
slots: checkboxCardAnatomy.keys(),
|
7498
|
+
className: "chakra-checkbox-card",
|
7499
|
+
base: {
|
7500
|
+
root: {
|
7501
|
+
display: "inline-flex",
|
7502
|
+
alignItems: "center",
|
7503
|
+
boxAlign: "center",
|
7504
|
+
fontSize: "xs",
|
7505
|
+
cursor: "pointer",
|
7506
|
+
transitionProperty: "all",
|
7507
|
+
borderRadius: "xl",
|
7508
|
+
transitionDuration: "fast",
|
7509
|
+
paddingInlineStart: "2",
|
7510
|
+
paddingInlineEnd: "2",
|
7511
|
+
outline: "1px solid",
|
7512
|
+
outlineColor: "base.outline",
|
7513
|
+
_checked: {
|
7514
|
+
backgroundColor: "brand.surface",
|
7515
|
+
borderRadius: "sm",
|
7516
|
+
outline: "none",
|
7517
|
+
color: "brand.text",
|
7518
|
+
_hover: {
|
7519
|
+
backgroundColor: "brand.surface.hover",
|
7520
|
+
_active: {
|
7521
|
+
backgroundColor: "brand.surface.active"
|
7522
|
+
}
|
7523
|
+
}
|
7524
|
+
},
|
7525
|
+
_focusVisible: {
|
7526
|
+
outline: "2px solid",
|
7527
|
+
outlineColor: "outline.focus",
|
7528
|
+
outlineOffset: "1px"
|
7529
|
+
},
|
7530
|
+
_disabled: {
|
7531
|
+
pointerEvents: "none",
|
7532
|
+
boxShadow: "none",
|
7533
|
+
backgroundColor: "surface.disabled",
|
7534
|
+
color: "text.disabled",
|
7535
|
+
outline: "none",
|
7536
|
+
_hover: {
|
7537
|
+
backgroundColor: "core.surface.disabled",
|
7538
|
+
boxShadow: "none",
|
7539
|
+
color: "core.text.disabled"
|
7540
|
+
},
|
7541
|
+
_checked: {
|
7542
|
+
cursor: "not-allowed",
|
7543
|
+
boxShadow: "none",
|
7544
|
+
color: "core.text.disabled",
|
7545
|
+
backgroundColor: "core.surface.disabled",
|
7546
|
+
_hover: {
|
7547
|
+
backgroundColor: "core.surface.disabled",
|
7548
|
+
boxShadow: "none",
|
7549
|
+
color: "core.text.disabled"
|
7550
|
+
}
|
7551
|
+
}
|
7552
|
+
}
|
7553
|
+
},
|
7554
|
+
label: {
|
7555
|
+
display: "flex",
|
7556
|
+
alignItems: "center",
|
7557
|
+
fontSize: "xs"
|
7558
|
+
}
|
7559
|
+
},
|
7560
|
+
variants: {
|
7561
|
+
size: {
|
7562
|
+
xs: {
|
7563
|
+
root: {
|
7564
|
+
_checked: {
|
7565
|
+
borderRadius: "0.563rem"
|
7566
|
+
},
|
7567
|
+
height: 5,
|
7568
|
+
paddingX: 1.5
|
7569
|
+
}
|
7570
|
+
},
|
7571
|
+
sm: {
|
7572
|
+
root: {
|
7573
|
+
_checked: {
|
7574
|
+
borderRadius: "sm"
|
7575
|
+
},
|
7576
|
+
height: 6,
|
7577
|
+
paddingX: 2
|
7578
|
+
}
|
7579
|
+
},
|
7580
|
+
md: {
|
7581
|
+
root: {
|
7582
|
+
_checked: {
|
7583
|
+
borderRadius: "sm"
|
7584
|
+
},
|
7585
|
+
height: 7,
|
7586
|
+
paddingX: 2
|
7587
|
+
}
|
7588
|
+
},
|
7589
|
+
lg: {
|
7590
|
+
root: {
|
7591
|
+
_checked: {
|
7592
|
+
borderRadius: "md"
|
7593
|
+
},
|
7594
|
+
height: 8,
|
7595
|
+
paddingX: 3
|
7596
|
+
}
|
7597
|
+
}
|
7598
|
+
},
|
7599
|
+
variant: {
|
7600
|
+
core: {
|
7601
|
+
root: {
|
7602
|
+
color: "core.text",
|
7603
|
+
outlineColor: "core.outline",
|
7604
|
+
_hover: {
|
7605
|
+
outline: "2px solid",
|
7606
|
+
outlineColor: "core.outline.hover",
|
7607
|
+
_active: {
|
7608
|
+
outline: "1px solid",
|
7609
|
+
outlineColor: "core.outline",
|
7610
|
+
backgroundColor: "core.surface.active"
|
7611
|
+
}
|
7612
|
+
}
|
7613
|
+
}
|
7614
|
+
},
|
7615
|
+
accent: {
|
7616
|
+
root: {
|
7617
|
+
backgroundColor: "accent.surface",
|
7618
|
+
color: "accent.text",
|
7619
|
+
outline: "none",
|
7620
|
+
_hover: {
|
7621
|
+
backgroundColor: "accent.surface.hover",
|
7622
|
+
_active: {
|
7623
|
+
backgroundColor: "accent.surface.active"
|
7624
|
+
}
|
7625
|
+
}
|
7626
|
+
}
|
7627
|
+
},
|
7628
|
+
floating: {
|
7629
|
+
root: {
|
7630
|
+
backgroundColor: "floating.surface",
|
7631
|
+
outline: "1px solid",
|
7632
|
+
outlineColor: "floating.outline",
|
7633
|
+
color: "floating.text",
|
7634
|
+
boxShadow: "sm",
|
7635
|
+
_hover: {
|
7636
|
+
backgroundColor: "floating.surface.hover",
|
7637
|
+
outline: "1px solid",
|
7638
|
+
outlineColor: "floating.outline.hover",
|
7639
|
+
_active: {
|
7640
|
+
backgroundColor: "floating.surface.active",
|
7641
|
+
outline: "1px solid",
|
7642
|
+
outlineColor: "floating.outline"
|
7643
|
+
}
|
7644
|
+
}
|
7645
|
+
}
|
7646
|
+
}
|
7647
|
+
},
|
7648
|
+
chipType: {
|
7649
|
+
icon: {},
|
7650
|
+
choice: {},
|
7651
|
+
filter: {}
|
7652
|
+
}
|
7653
|
+
},
|
7654
|
+
defaultVariants: {
|
7655
|
+
size: "md",
|
7656
|
+
variant: "core",
|
7657
|
+
chipType: "choice"
|
7658
|
+
}
|
7659
|
+
});
|
7525
7660
|
var dialogSlotRecipe = react.defineSlotRecipe({
|
7526
7661
|
slots: dialogAnatomy.keys(),
|
7527
7662
|
className: "spor-dialog",
|
@@ -7944,33 +8079,6 @@ var fieldSlotRecipe = react.defineSlotRecipe({
|
|
7944
8079
|
position: "relative",
|
7945
8080
|
flexDirection: "column"
|
7946
8081
|
},
|
7947
|
-
label: {
|
7948
|
-
/* For when input is filled */
|
7949
|
-
pos: "absolute",
|
7950
|
-
paddingX: 3,
|
7951
|
-
top: "0.3rem",
|
7952
|
-
fontWeight: "normal",
|
7953
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7954
|
-
color: "text",
|
7955
|
-
pointerEvents: "none",
|
7956
|
-
transition: "position",
|
7957
|
-
zIndex: "docked",
|
7958
|
-
_peerPlaceholderShown: {
|
7959
|
-
/* For when input is not in focus */
|
7960
|
-
top: "0.9rem",
|
7961
|
-
color: "text",
|
7962
|
-
fontSize: ["mobile.sm", "desktop.sm"]
|
7963
|
-
},
|
7964
|
-
_peerFocusVisible: {
|
7965
|
-
/* For when input is in focus */
|
7966
|
-
fontSize: ["mobile.xs", "desktop.xs"],
|
7967
|
-
color: "text",
|
7968
|
-
top: "0.3rem"
|
7969
|
-
},
|
7970
|
-
_disabled: {
|
7971
|
-
opacity: 0.4
|
7972
|
-
}
|
7973
|
-
},
|
7974
8082
|
requiredIndicator: {
|
7975
8083
|
marginStart: 1,
|
7976
8084
|
color: "brightRed"
|
@@ -7990,7 +8098,7 @@ var fieldSlotRecipe = react.defineSlotRecipe({
|
|
7990
8098
|
textStyle: "xs",
|
7991
8099
|
width: "fit-content",
|
7992
8100
|
position: "absolute",
|
7993
|
-
bottom: -
|
8101
|
+
bottom: -5,
|
7994
8102
|
left: 3,
|
7995
8103
|
zIndex: "dropdown",
|
7996
8104
|
maxWidth: "50ch",
|
@@ -9236,6 +9344,10 @@ var selectSlotRecipe = react.defineSlotRecipe({
|
|
9236
9344
|
},
|
9237
9345
|
_open: {
|
9238
9346
|
borderBottomRadius: 0
|
9347
|
+
},
|
9348
|
+
_invalid: {
|
9349
|
+
outline: "2px solid",
|
9350
|
+
outlineColor: "outline.error"
|
9239
9351
|
}
|
9240
9352
|
},
|
9241
9353
|
itemText: {
|
@@ -9270,10 +9382,6 @@ var selectSlotRecipe = react.defineSlotRecipe({
|
|
9270
9382
|
_active: {
|
9271
9383
|
backgroundColor: "brand.surface.active"
|
9272
9384
|
},
|
9273
|
-
_invalid: {
|
9274
|
-
outline: "2px solid",
|
9275
|
-
outlineColor: "outline.error"
|
9276
|
-
},
|
9277
9385
|
_disabled: {
|
9278
9386
|
pointerEvents: "none",
|
9279
9387
|
color: "text.disabled",
|
@@ -9844,7 +9952,8 @@ var slotRecipes = {
|
|
9844
9952
|
table: tableSlotRecipe,
|
9845
9953
|
tabs: tabsSlotRecipe,
|
9846
9954
|
travelTag: travelTagSlotRecipe,
|
9847
|
-
toast: toastSlotRecipe
|
9955
|
+
toast: toastSlotRecipe,
|
9956
|
+
checkboxCard: choiceChipSlotRecipe
|
9848
9957
|
};
|
9849
9958
|
var animations = react.defineTokens.animations({
|
9850
9959
|
spin: {
|
@@ -10936,7 +11045,7 @@ exports.DrawerTrigger = DrawerTrigger;
|
|
10936
11045
|
exports.Expandable = Expandable;
|
10937
11046
|
exports.ExpandableAlert = ExpandableAlert;
|
10938
11047
|
exports.ExpandableItem = ExpandableItem;
|
10939
|
-
exports.Field =
|
11048
|
+
exports.Field = Field3;
|
10940
11049
|
exports.FieldErrorText = FieldErrorText;
|
10941
11050
|
exports.FieldLabel = FieldLabel;
|
10942
11051
|
exports.Fieldset = Fieldset;
|