@vygruppen/spor-react 12.7.0 → 12.8.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 +10 -10
- package/.turbo/turbo-postinstall.log +1 -1
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +332 -309
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +102 -4
- package/dist/index.d.ts +102 -4
- package/dist/index.mjs +333 -310
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/button/ButtonGroup.tsx +5 -15
- package/src/dialog/Dialog.tsx +1 -1
- package/src/input/AttachedInputs.tsx +6 -4
- package/src/input/Combobox.tsx +5 -4
- package/src/input/CountryCodeSelect.tsx +1 -1
- package/src/input/Field.tsx +1 -1
- package/src/input/Input.tsx +9 -8
- package/src/input/Select.tsx +3 -2
- package/src/layout/PressableCard.tsx +12 -5
- package/src/layout/StaticCard.tsx +6 -4
- package/src/theme/recipes/index.ts +2 -0
- package/src/theme/slot-recipes/anatomy.ts +2 -0
- package/src/theme/slot-recipes/collapsible.ts +21 -0
- package/src/theme/slot-recipes/index.ts +2 -0
- package/src/theme/slot-recipes/select.ts +2 -0
package/dist/index.mjs
CHANGED
@@ -1,4 +1,4 @@
|
|
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
|
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, 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, 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, InputElement, Input as Input$1, NativeSelect as NativeSelect$1, useControllableState, createListCollection, RadioGroup as RadioGroup$1, Select as Select$1, useSelectContext, Switch as Switch$1, Textarea as Textarea$1, RadioCard as RadioCard$1, Separator as Separator$1, Link, List as List$1, Center, PopoverCloseTrigger, Pagination as Pagination$1, usePaginationContext, createToaster, Tabs as Tabs$1, Table as Table$1, defineSemanticTokens, defineSlotRecipe, defineTokens, defineAnimationStyles, defineGlobalStyles, defineTextStyles, createSystem, defaultBaseConfig, VisuallyHidden, defineConfig, ListItem, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
|
2
2
|
export { Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, ClientOnly, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack, TableBody, TableCaption, TableCell, TableColumn, TableColumnGroup, TableColumnHeader, TableFooter, TableHeader, TableRoot, TableRow, VStack, VisuallyHidden, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, chakra as spor, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useToken } from '@chakra-ui/react';
|
3
3
|
import { DropdownDownFill24Icon, CopyOutline18Icon, CheckmarkFill18Icon, CloseFill18Icon, CloseFill30Icon, CloseFill24Icon, ServiceFill24Icon, QuestionFill24Icon, ErrorOutline24Icon, ErrorFill24Icon, AltTransportFill24Icon, WarningFill24Icon, SuccessFill24Icon, InformationFill24Icon, DropdownDownFill18Icon, DropdownRightFill18Icon, CalendarOutline24Icon, ArrowLeftFill24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill18Icon, WarningFill18Icon, ErrorFill18Icon, Forward15MediaControllerFill30Icon, Backward15MediaControllerFill30Icon, PauseMediaControllerFill24Icon, PlayMediaControllerFill24Icon, NextMediaControllerFill30Icon, PreviousMediaControllerFill30Icon, ArrowRightFill18Icon, DropdownLeftOutline18Icon, DropdownRightOutline18Icon, WalkFill30Icon, WalkFill24Icon, WalkFill18Icon, AltTransportFill30Icon, AltTransportFill18Icon, TramFill30Icon, TramFill24Icon, TramFill18Icon, SubwayFill30Icon, SubwayFill24Icon, SubwayFill18Icon, FerryFill30Icon, FerryFill24Icon, FerryFill18Icon, BusFill30Icon, BusFill24Icon, BusFill18Icon, ExpressBusFill30Icon, ExpressBusFill24Icon, ExpressBusFill18Icon, TrainFill30Icon, TrainFill24Icon, TrainFill18Icon, LinkOutOutline24Icon, LinkOutOutline18Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, DropdownLeftFill18Icon, SuccessFill18Icon } from '@vygruppen/spor-icon-react';
|
4
4
|
import * as React28 from 'react';
|
@@ -16,13 +16,14 @@ export { Item, Section } from 'react-stately';
|
|
16
16
|
import { GregorianCalendar, createCalendar, getLocalTimeZone, endOfMonth, getWeeksInMonth, isSameMonth, isToday, parseTime } from '@internationalized/date';
|
17
17
|
export { Time } from '@internationalized/date';
|
18
18
|
import { getSupportedCallingCodes } from 'awesome-phonenumber';
|
19
|
+
import { Global } from '@emotion/react';
|
19
20
|
import tokens23__default from '@vygruppen/spor-design-tokens';
|
20
21
|
import * as tokens23 from '@vygruppen/spor-design-tokens';
|
21
22
|
export { tokens23 as tokens };
|
22
|
-
import { Global } from '@emotion/react';
|
23
23
|
import tokens4 from '@vygruppen/spor-design-tokens/raw-tokens';
|
24
24
|
import { createAnatomy } from '@ark-ui/react/anatomy';
|
25
25
|
import { popoverAnatomy as popoverAnatomy$1 } from '@ark-ui/react/popover';
|
26
|
+
import { collapsibleAnatomy } from '@ark-ui/react/collapsible';
|
26
27
|
|
27
28
|
// src/accordion/Accordion.tsx
|
28
29
|
|
@@ -606,38 +607,12 @@ var texts2 = createTexts({
|
|
606
607
|
sv: "Laddar\u2026"
|
607
608
|
}
|
608
609
|
});
|
609
|
-
var groupRecipe = defineRecipe({
|
610
|
-
className: "spor-group",
|
611
|
-
base: {
|
612
|
-
fontSize: "lg"
|
613
|
-
},
|
614
|
-
variants: {
|
615
|
-
disabled: {
|
616
|
-
true: {
|
617
|
-
"& > *": {
|
618
|
-
pointerEvents: "none",
|
619
|
-
backgroundColor: "surface.disabled",
|
620
|
-
color: "text.disabled"
|
621
|
-
}
|
622
|
-
}
|
623
|
-
}
|
624
|
-
}
|
625
|
-
});
|
626
|
-
var Group = chakra(Group$1, groupRecipe);
|
627
610
|
var ButtonGroup = forwardRef(
|
628
611
|
(props, ref) => {
|
629
|
-
const
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
...rest,
|
634
|
-
ref,
|
635
|
-
attached,
|
636
|
-
grow,
|
637
|
-
disabled,
|
638
|
-
children
|
639
|
-
}
|
640
|
-
);
|
612
|
+
const recipe = useRecipe({ key: "buttonGroup" });
|
613
|
+
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
614
|
+
const styles = recipe(recipeProps);
|
615
|
+
return /* @__PURE__ */ jsx(Group, { ...restProps, ref, css: styles });
|
641
616
|
}
|
642
617
|
);
|
643
618
|
ButtonGroup.displayName = "ButtonGroup";
|
@@ -1399,7 +1374,7 @@ var Field3 = React28.forwardRef(
|
|
1399
1374
|
} = props;
|
1400
1375
|
const recipe = useSlotRecipe({ key: "field" });
|
1401
1376
|
const styles = recipe();
|
1402
|
-
return /* @__PURE__ */ jsxs(Stack, { gap: "2", ref, ...rest, children: [
|
1377
|
+
return /* @__PURE__ */ jsxs(Stack, { gap: "2", ref, width: "100%", ...rest, children: [
|
1403
1378
|
/* @__PURE__ */ jsxs(
|
1404
1379
|
Field.Root,
|
1405
1380
|
{
|
@@ -2346,7 +2321,7 @@ var DialogContent = React28.forwardRef((props, ref) => {
|
|
2346
2321
|
});
|
2347
2322
|
DialogContent.displayName = "DialogContent";
|
2348
2323
|
var DialogCloseTrigger = React28.forwardRef(function DialogCloseTrigger2(props, ref) {
|
2349
|
-
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, { ref, ...props, asChild: true, children: /* @__PURE__ */ jsx(CloseButton, { size: "md" }) });
|
2324
|
+
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, { ref, position: "absolute", ...props, asChild: true, children: /* @__PURE__ */ jsx(CloseButton, { size: "md" }) });
|
2350
2325
|
});
|
2351
2326
|
var DialogRoot = Dialog.Root;
|
2352
2327
|
var DialogFooter = Dialog.Footer;
|
@@ -2447,51 +2422,12 @@ var texts12 = createTexts({
|
|
2447
2422
|
sv: "St\xE4ng"
|
2448
2423
|
}
|
2449
2424
|
});
|
2450
|
-
var attachedInputsRecipe = defineRecipe({
|
2451
|
-
base: {
|
2452
|
-
display: "flex",
|
2453
|
-
gap: "0.1rem",
|
2454
|
-
width: "100%",
|
2455
|
-
"& select": {
|
2456
|
-
borderEndRadius: 0
|
2457
|
-
}
|
2458
|
-
},
|
2459
|
-
variants: {
|
2460
|
-
orientation: {
|
2461
|
-
horizontal: {
|
2462
|
-
flexDirection: "row",
|
2463
|
-
"& > *:first-of-type:not(:last-of-type) [data-attachable]": {
|
2464
|
-
borderEndRadius: 0
|
2465
|
-
},
|
2466
|
-
"& > *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
|
2467
|
-
borderRadius: 0
|
2468
|
-
},
|
2469
|
-
"& > *:not(:first-of-type):last-of-type [data-attachable]": {
|
2470
|
-
borderStartRadius: 0
|
2471
|
-
}
|
2472
|
-
},
|
2473
|
-
vertical: {
|
2474
|
-
flexDirection: "column",
|
2475
|
-
"& > *:first-of-type:not(:last-of-type) [data-attachable]": {
|
2476
|
-
borderBottomRadius: 0
|
2477
|
-
},
|
2478
|
-
"& > *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
|
2479
|
-
borderRadius: 0
|
2480
|
-
},
|
2481
|
-
"& > *:not(:first-of-type):last-of-type [data-attachable]": {
|
2482
|
-
borderTopRadius: 0
|
2483
|
-
}
|
2484
|
-
}
|
2485
|
-
}
|
2486
|
-
},
|
2487
|
-
defaultVariants: {
|
2488
|
-
orientation: "horizontal"
|
2489
|
-
}
|
2490
|
-
});
|
2491
|
-
var StyledGroup = chakra(Group$1, attachedInputsRecipe);
|
2492
2425
|
var AttachedInputs = forwardRef(
|
2493
2426
|
(props, ref) => {
|
2494
|
-
|
2427
|
+
const recipe = useRecipe({ key: "attachedInputs" });
|
2428
|
+
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
2429
|
+
const styles = recipe(recipeProps);
|
2430
|
+
return /* @__PURE__ */ jsx(Group, { ref, css: styles, attached: true, ...restProps });
|
2495
2431
|
}
|
2496
2432
|
);
|
2497
2433
|
AttachedInputs.displayName = "AttachedInputs";
|
@@ -2642,10 +2578,10 @@ var Combobox = (props) => {
|
|
2642
2578
|
loading,
|
2643
2579
|
leftIcon,
|
2644
2580
|
rightIcon,
|
2645
|
-
borderBottomLeftRadius
|
2646
|
-
borderBottomRightRadius
|
2647
|
-
borderTopLeftRadius
|
2648
|
-
borderTopRightRadius
|
2581
|
+
borderBottomLeftRadius,
|
2582
|
+
borderBottomRightRadius,
|
2583
|
+
borderTopLeftRadius,
|
2584
|
+
borderTopRightRadius,
|
2649
2585
|
marginBottom,
|
2650
2586
|
marginTop,
|
2651
2587
|
marginX,
|
@@ -2744,7 +2680,8 @@ var Combobox = (props) => {
|
|
2744
2680
|
}
|
2745
2681
|
}
|
2746
2682
|
) : rightIcon,
|
2747
|
-
placeholder: ""
|
2683
|
+
placeholder: "",
|
2684
|
+
"data-attachable": true
|
2748
2685
|
}
|
2749
2686
|
),
|
2750
2687
|
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", "data-trigger": "multiselect" }),
|
@@ -2813,90 +2750,6 @@ var FieldsetLegend = Fieldset$1.Legend;
|
|
2813
2750
|
var FieldsetContent = Fieldset$1.Content;
|
2814
2751
|
var FieldsetHelperText = Fieldset$1.HelperText;
|
2815
2752
|
var FieldsetErrorText = Fieldset$1.ErrorText;
|
2816
|
-
var inputRecipe = defineRecipe({
|
2817
|
-
base: {
|
2818
|
-
appearance: "none",
|
2819
|
-
width: "100%",
|
2820
|
-
outline: "none",
|
2821
|
-
border: 0,
|
2822
|
-
borderRadius: "sm",
|
2823
|
-
transitionProperty: "common",
|
2824
|
-
transitionDuration: "fast",
|
2825
|
-
color: "text",
|
2826
|
-
position: "relative",
|
2827
|
-
paddingX: 3,
|
2828
|
-
paddingTop: 3,
|
2829
|
-
height: 8,
|
2830
|
-
fontSize: "mobile.md",
|
2831
|
-
_disabled: {
|
2832
|
-
backgroundColor: "surface.disabled",
|
2833
|
-
outline: "1px solid",
|
2834
|
-
outlineColor: "outline.disabled",
|
2835
|
-
pointerEvents: "none"
|
2836
|
-
},
|
2837
|
-
_invalid: {
|
2838
|
-
outline: "2px solid",
|
2839
|
-
outlineColor: "outline.error",
|
2840
|
-
_active: {
|
2841
|
-
outline: "2px solid",
|
2842
|
-
outlineColor: "outline.error"
|
2843
|
-
},
|
2844
|
-
_focus: {
|
2845
|
-
outline: "2px solid",
|
2846
|
-
outlineColor: "outline.error"
|
2847
|
-
},
|
2848
|
-
_hover: {
|
2849
|
-
outline: "2px solid",
|
2850
|
-
outlineColor: "core.outline"
|
2851
|
-
}
|
2852
|
-
}
|
2853
|
-
},
|
2854
|
-
variants: {
|
2855
|
-
variant: {
|
2856
|
-
core: {
|
2857
|
-
backgroundColor: "transparent",
|
2858
|
-
outline: "1px solid",
|
2859
|
-
outlineColor: "core.outline",
|
2860
|
-
_hover: {
|
2861
|
-
outline: "2px solid",
|
2862
|
-
outlineColor: "core.outline.hover",
|
2863
|
-
_active: {
|
2864
|
-
outline: "1px solid",
|
2865
|
-
outlineColor: "outline.disabled",
|
2866
|
-
backgroundColor: "core.surface.active"
|
2867
|
-
}
|
2868
|
-
},
|
2869
|
-
_focus: {
|
2870
|
-
outline: "2px solid",
|
2871
|
-
outlineColor: "outline.focus"
|
2872
|
-
}
|
2873
|
-
},
|
2874
|
-
floating: {
|
2875
|
-
boxShadow: "sm",
|
2876
|
-
bg: "floating.surface",
|
2877
|
-
outline: "1px solid",
|
2878
|
-
outlineColor: "floating.outline",
|
2879
|
-
_hover: {
|
2880
|
-
outline: "1px solid",
|
2881
|
-
outlineColor: "floating.outline.hover"
|
2882
|
-
},
|
2883
|
-
_active: {
|
2884
|
-
outline: "1px solid",
|
2885
|
-
outlineColor: "floating.outline.active",
|
2886
|
-
backgroundColor: "floating.surface.active"
|
2887
|
-
},
|
2888
|
-
focus: {
|
2889
|
-
outline: "1px solid",
|
2890
|
-
outlineColor: "outline.focus"
|
2891
|
-
}
|
2892
|
-
}
|
2893
|
-
}
|
2894
|
-
},
|
2895
|
-
defaultVariants: {
|
2896
|
-
variant: "core"
|
2897
|
-
}
|
2898
|
-
});
|
2899
|
-
var StyledInput = chakra(Input$1, inputRecipe);
|
2900
2753
|
var Input = forwardRef(
|
2901
2754
|
({
|
2902
2755
|
startElement,
|
@@ -2907,6 +2760,9 @@ var Input = forwardRef(
|
|
2907
2760
|
errorText,
|
2908
2761
|
...props
|
2909
2762
|
}, ref) => {
|
2763
|
+
const recipe = useRecipe({ key: "input" });
|
2764
|
+
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
2765
|
+
const styles = recipe(recipeProps);
|
2910
2766
|
return /* @__PURE__ */ jsxs(
|
2911
2767
|
Field3,
|
2912
2768
|
{
|
@@ -2924,7 +2780,7 @@ var Input = forwardRef(
|
|
2924
2780
|
children: [
|
2925
2781
|
startElement && /* @__PURE__ */ jsx(InputElement, { pointerEvents: "none", paddingX: 2, children: startElement }),
|
2926
2782
|
/* @__PURE__ */ jsx(
|
2927
|
-
|
2783
|
+
Input$1,
|
2928
2784
|
{
|
2929
2785
|
"data-attachable": true,
|
2930
2786
|
ref,
|
@@ -2932,9 +2788,10 @@ var Input = forwardRef(
|
|
2932
2788
|
overflow: "hidden",
|
2933
2789
|
paddingLeft: startElement ? "2.6rem" : void 0,
|
2934
2790
|
paddingRight: endElement ? "2.6rem" : void 0,
|
2935
|
-
...
|
2791
|
+
...restProps,
|
2936
2792
|
className: `peer ${props.className}`,
|
2937
|
-
placeholder: ""
|
2793
|
+
placeholder: "",
|
2794
|
+
css: styles
|
2938
2795
|
}
|
2939
2796
|
),
|
2940
2797
|
endElement && /* @__PURE__ */ jsx(InputElement, { placement: "end", paddingX: 2, children: endElement })
|
@@ -3398,7 +3255,7 @@ var CountryCodeSelect = forwardRef((props, ref) => {
|
|
3398
3255
|
collection: callingCodes,
|
3399
3256
|
lazyMount: true,
|
3400
3257
|
"aria-label": t(texts15.countryCode),
|
3401
|
-
|
3258
|
+
sideRadiusVariant: "rightSideSquare",
|
3402
3259
|
children: callingCodes.items.map((code) => /* @__PURE__ */ jsx(SelectItem, { as: "option", item: code, children: code.label }, code.label))
|
3403
3260
|
}
|
3404
3261
|
);
|
@@ -3770,97 +3627,12 @@ var Textarea = forwardRef(
|
|
3770
3627
|
}
|
3771
3628
|
);
|
3772
3629
|
Textarea.displayName = "Textarea";
|
3773
|
-
|
3774
|
-
// src/util/slugify.tsx
|
3775
|
-
function slugify(text, maxLength = 50) {
|
3776
|
-
if (!text) {
|
3777
|
-
return text;
|
3778
|
-
}
|
3779
|
-
if (Array.isArray(text)) {
|
3780
|
-
text = text.join(" ");
|
3781
|
-
}
|
3782
|
-
if (maxLength < 1) {
|
3783
|
-
throw new Error("The maxLength parameter must be a positive number");
|
3784
|
-
}
|
3785
|
-
return text.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[\u00C6\u00E6]/g, "ae").replaceAll(/[\u00D8\u00F8]/g, "oe").replaceAll(/[\u00C5\u00E5]/g, "aa").toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^\w-]+/g, "").replaceAll(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "").slice(0, Math.max(0, maxLength));
|
3786
|
-
}
|
3787
|
-
|
3788
|
-
// src/theme/recipes/pressable-card.ts
|
3789
|
-
var pressableCardRecipe = defineRecipe({
|
3790
|
-
base: {
|
3791
|
-
appearance: "none",
|
3792
|
-
border: "none",
|
3793
|
-
overflow: "hidden",
|
3794
|
-
fontSize: "inherit",
|
3795
|
-
display: "block",
|
3796
|
-
borderRadius: "md",
|
3797
|
-
cursor: "pointer",
|
3798
|
-
transitionProperty: "common",
|
3799
|
-
transitionDuration: "fast",
|
3800
|
-
_disabled: {
|
3801
|
-
outline: "none",
|
3802
|
-
pointerEvents: "none",
|
3803
|
-
background: "surface.disabled",
|
3804
|
-
color: "text.disabled"
|
3805
|
-
}
|
3806
|
-
},
|
3807
|
-
variants: {
|
3808
|
-
variant: {
|
3809
|
-
floating: {
|
3810
|
-
boxShadow: "0px 1px 3px 0px var(--shadow-color)",
|
3811
|
-
shadowColor: "surface.disabled",
|
3812
|
-
border: "sm",
|
3813
|
-
borderColor: "floating.outline",
|
3814
|
-
backgroundColor: "floating.surface",
|
3815
|
-
_hover: {
|
3816
|
-
boxShadow: "0px 2px 6px 0px var(--shadow-color)",
|
3817
|
-
backgroundColor: "floating.surface.hover",
|
3818
|
-
borderColor: "floating.outline.hover",
|
3819
|
-
_active: {
|
3820
|
-
boxShadow: "none",
|
3821
|
-
backgroundColor: "floating.surface.active",
|
3822
|
-
borderColor: "floating.outline.active"
|
3823
|
-
}
|
3824
|
-
}
|
3825
|
-
},
|
3826
|
-
core: {
|
3827
|
-
outlineColor: "core.outline",
|
3828
|
-
outlineWidth: tokens23__default.size.stroke.sm,
|
3829
|
-
outlineStyle: "solid",
|
3830
|
-
backgroundColor: "core.surface",
|
3831
|
-
_hover: {
|
3832
|
-
outlineColor: "core.outline.hover",
|
3833
|
-
outlineWidth: tokens23__default.size.stroke.md,
|
3834
|
-
outlineStyle: "solid",
|
3835
|
-
_active: {
|
3836
|
-
backgroundColor: "core.surface.active",
|
3837
|
-
outlineWidth: tokens23__default.size.stroke.sm
|
3838
|
-
}
|
3839
|
-
}
|
3840
|
-
},
|
3841
|
-
accent: {
|
3842
|
-
boxShadow: "0px 1px 3px 0px var(--shadow-color)",
|
3843
|
-
shadowColor: "surface.disabled",
|
3844
|
-
background: "alert.success.surface",
|
3845
|
-
_hover: {
|
3846
|
-
background: "alert.success.surface.hover",
|
3847
|
-
boxShadow: "0px 2px 6px 0px var(--shadow-color)",
|
3848
|
-
_active: {
|
3849
|
-
background: "alert.success.surface.active",
|
3850
|
-
boxShadow: "none"
|
3851
|
-
}
|
3852
|
-
}
|
3853
|
-
}
|
3854
|
-
}
|
3855
|
-
},
|
3856
|
-
defaultVariants: {
|
3857
|
-
variant: "core"
|
3858
|
-
}
|
3859
|
-
});
|
3860
|
-
var PressableCardButton = chakra("button", pressableCardRecipe);
|
3861
3630
|
var PressableCard = forwardRef(
|
3862
3631
|
(props, ref) => {
|
3863
|
-
|
3632
|
+
const recipe = useRecipe({ key: "pressableCard" });
|
3633
|
+
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
3634
|
+
const styles = recipe(recipeProps);
|
3635
|
+
return /* @__PURE__ */ jsx(chakra.button, { ...restProps, css: styles, ref });
|
3864
3636
|
}
|
3865
3637
|
);
|
3866
3638
|
PressableCard.displayName = "PressableCard";
|
@@ -3923,55 +3695,20 @@ var Separator = forwardRef(
|
|
3923
3695
|
}
|
3924
3696
|
);
|
3925
3697
|
Separator.displayName = "Separator";
|
3926
|
-
var
|
3927
|
-
|
3928
|
-
|
3929
|
-
|
3930
|
-
|
3931
|
-
|
3932
|
-
|
3933
|
-
|
3934
|
-
|
3935
|
-
|
3936
|
-
|
3937
|
-
|
3938
|
-
|
3939
|
-
|
3940
|
-
backgroundColor: "surface.color.cream"
|
3941
|
-
},
|
3942
|
-
darkYellow: {
|
3943
|
-
backgroundColor: "surface.color.yellow"
|
3944
|
-
},
|
3945
|
-
red: {
|
3946
|
-
backgroundColor: "surface.color.red"
|
3947
|
-
},
|
3948
|
-
green: {
|
3949
|
-
backgroundColor: "surface.color.green"
|
3950
|
-
},
|
3951
|
-
blue: {
|
3952
|
-
backgroundColor: "surface.color.blue"
|
3953
|
-
},
|
3954
|
-
orange: {
|
3955
|
-
backgroundColor: "surface.color.orange"
|
3956
|
-
}
|
3957
|
-
}
|
3958
|
-
},
|
3959
|
-
defaultVariants: {
|
3960
|
-
colorPalette: "white"
|
3961
|
-
}
|
3962
|
-
});
|
3963
|
-
var StyledCardBox = chakra("div", staticCardRecipe);
|
3964
|
-
var StaticCard = forwardRef(
|
3965
|
-
(props, ref) => {
|
3966
|
-
return /* @__PURE__ */ jsx(StyledCardBox, { ...props, ref });
|
3967
|
-
}
|
3968
|
-
);
|
3969
|
-
StaticCard.displayName = "StaticCard";
|
3970
|
-
var icons = {
|
3971
|
-
"local-train": {
|
3972
|
-
sm: TrainFill18Icon,
|
3973
|
-
md: TrainFill24Icon,
|
3974
|
-
lg: TrainFill30Icon
|
3698
|
+
var StaticCard = forwardRef(
|
3699
|
+
(props, ref) => {
|
3700
|
+
const recipe = useRecipe({ key: "staticCard" });
|
3701
|
+
const [recipeProps, restProps] = recipe.splitVariantProps(props);
|
3702
|
+
const styles = recipe(recipeProps);
|
3703
|
+
return /* @__PURE__ */ jsx(Box, { css: styles, ...restProps, ref });
|
3704
|
+
}
|
3705
|
+
);
|
3706
|
+
StaticCard.displayName = "StaticCard";
|
3707
|
+
var icons = {
|
3708
|
+
"local-train": {
|
3709
|
+
sm: TrainFill18Icon,
|
3710
|
+
md: TrainFill24Icon,
|
3711
|
+
lg: TrainFill30Icon
|
3975
3712
|
},
|
3976
3713
|
"region-train": {
|
3977
3714
|
sm: TrainFill18Icon,
|
@@ -5524,6 +5261,47 @@ var Table = forwardRef((props, ref) => {
|
|
5524
5261
|
);
|
5525
5262
|
});
|
5526
5263
|
Table.displayName = "Table";
|
5264
|
+
var attachedInputsRecipe = defineRecipe({
|
5265
|
+
base: {
|
5266
|
+
display: "flex",
|
5267
|
+
gap: "0.1rem",
|
5268
|
+
width: "100%",
|
5269
|
+
"& select": {
|
5270
|
+
borderEndRadius: 0
|
5271
|
+
}
|
5272
|
+
},
|
5273
|
+
variants: {
|
5274
|
+
orientation: {
|
5275
|
+
horizontal: {
|
5276
|
+
flexDirection: "row",
|
5277
|
+
"& > *:first-of-type:not(:last-of-type) [data-attachable]": {
|
5278
|
+
borderEndRadius: 0
|
5279
|
+
},
|
5280
|
+
"& > *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
|
5281
|
+
borderRadius: 0
|
5282
|
+
},
|
5283
|
+
"& > *:not(:first-of-type):last-of-type [data-attachable]": {
|
5284
|
+
borderStartRadius: 0
|
5285
|
+
}
|
5286
|
+
},
|
5287
|
+
vertical: {
|
5288
|
+
flexDirection: "column",
|
5289
|
+
"& > *:first-of-type:not(:last-of-type) [data-attachable]": {
|
5290
|
+
borderBottomRadius: 0
|
5291
|
+
},
|
5292
|
+
"& > *:not(:first-of-type):not(:last-of-type) [data-attachable]": {
|
5293
|
+
borderRadius: 0
|
5294
|
+
},
|
5295
|
+
"& > *:not(:first-of-type):last-of-type [data-attachable]": {
|
5296
|
+
borderTopRadius: 0
|
5297
|
+
}
|
5298
|
+
}
|
5299
|
+
}
|
5300
|
+
},
|
5301
|
+
defaultVariants: {
|
5302
|
+
orientation: "horizontal"
|
5303
|
+
}
|
5304
|
+
});
|
5527
5305
|
var buttonRecipe = defineRecipe({
|
5528
5306
|
className: "spor-button",
|
5529
5307
|
base: {
|
@@ -5687,6 +5465,106 @@ var closeButtonRecipe = defineRecipe({
|
|
5687
5465
|
}
|
5688
5466
|
}
|
5689
5467
|
});
|
5468
|
+
var groupRecipe = defineRecipe({
|
5469
|
+
className: "spor-group",
|
5470
|
+
base: {
|
5471
|
+
fontSize: "lg"
|
5472
|
+
},
|
5473
|
+
variants: {
|
5474
|
+
disabled: {
|
5475
|
+
true: {
|
5476
|
+
"& > *": {
|
5477
|
+
pointerEvents: "none",
|
5478
|
+
backgroundColor: "surface.disabled",
|
5479
|
+
color: "text.disabled"
|
5480
|
+
}
|
5481
|
+
}
|
5482
|
+
}
|
5483
|
+
}
|
5484
|
+
});
|
5485
|
+
var inputRecipe = defineRecipe({
|
5486
|
+
base: {
|
5487
|
+
appearance: "none",
|
5488
|
+
width: "100%",
|
5489
|
+
outline: "none",
|
5490
|
+
border: 0,
|
5491
|
+
borderRadius: "sm",
|
5492
|
+
transitionProperty: "common",
|
5493
|
+
transitionDuration: "fast",
|
5494
|
+
color: "text",
|
5495
|
+
position: "relative",
|
5496
|
+
paddingX: 3,
|
5497
|
+
paddingTop: 3,
|
5498
|
+
height: 8,
|
5499
|
+
fontSize: "mobile.md",
|
5500
|
+
_disabled: {
|
5501
|
+
backgroundColor: "surface.disabled",
|
5502
|
+
outline: "1px solid",
|
5503
|
+
outlineColor: "outline.disabled",
|
5504
|
+
pointerEvents: "none"
|
5505
|
+
},
|
5506
|
+
_invalid: {
|
5507
|
+
outline: "2px solid",
|
5508
|
+
outlineColor: "outline.error",
|
5509
|
+
_active: {
|
5510
|
+
outline: "2px solid",
|
5511
|
+
outlineColor: "outline.error"
|
5512
|
+
},
|
5513
|
+
_focus: {
|
5514
|
+
outline: "2px solid",
|
5515
|
+
outlineColor: "outline.error"
|
5516
|
+
},
|
5517
|
+
_hover: {
|
5518
|
+
outline: "2px solid",
|
5519
|
+
outlineColor: "core.outline"
|
5520
|
+
}
|
5521
|
+
}
|
5522
|
+
},
|
5523
|
+
variants: {
|
5524
|
+
variant: {
|
5525
|
+
core: {
|
5526
|
+
backgroundColor: "transparent",
|
5527
|
+
outline: "1px solid",
|
5528
|
+
outlineColor: "core.outline",
|
5529
|
+
_hover: {
|
5530
|
+
outline: "2px solid",
|
5531
|
+
outlineColor: "core.outline.hover",
|
5532
|
+
_active: {
|
5533
|
+
outline: "1px solid",
|
5534
|
+
outlineColor: "outline.disabled",
|
5535
|
+
backgroundColor: "core.surface.active"
|
5536
|
+
}
|
5537
|
+
},
|
5538
|
+
_focus: {
|
5539
|
+
outline: "2px solid",
|
5540
|
+
outlineColor: "outline.focus"
|
5541
|
+
}
|
5542
|
+
},
|
5543
|
+
floating: {
|
5544
|
+
boxShadow: "sm",
|
5545
|
+
bg: "floating.surface",
|
5546
|
+
outline: "1px solid",
|
5547
|
+
outlineColor: "floating.outline",
|
5548
|
+
_hover: {
|
5549
|
+
outline: "1px solid",
|
5550
|
+
outlineColor: "floating.outline.hover"
|
5551
|
+
},
|
5552
|
+
_active: {
|
5553
|
+
outline: "1px solid",
|
5554
|
+
outlineColor: "floating.outline.active",
|
5555
|
+
backgroundColor: "floating.surface.active"
|
5556
|
+
},
|
5557
|
+
focus: {
|
5558
|
+
outline: "1px solid",
|
5559
|
+
outlineColor: "outline.focus"
|
5560
|
+
}
|
5561
|
+
}
|
5562
|
+
}
|
5563
|
+
},
|
5564
|
+
defaultVariants: {
|
5565
|
+
variant: "core"
|
5566
|
+
}
|
5567
|
+
});
|
5690
5568
|
var linkRecipe = defineRecipe({
|
5691
5569
|
base: {
|
5692
5570
|
transitionProperty: "common",
|
@@ -5765,6 +5643,93 @@ var linkRecipe = defineRecipe({
|
|
5765
5643
|
size: "sm"
|
5766
5644
|
}
|
5767
5645
|
});
|
5646
|
+
|
5647
|
+
// src/util/slugify.tsx
|
5648
|
+
function slugify(text, maxLength = 50) {
|
5649
|
+
if (!text) {
|
5650
|
+
return text;
|
5651
|
+
}
|
5652
|
+
if (Array.isArray(text)) {
|
5653
|
+
text = text.join(" ");
|
5654
|
+
}
|
5655
|
+
if (maxLength < 1) {
|
5656
|
+
throw new Error("The maxLength parameter must be a positive number");
|
5657
|
+
}
|
5658
|
+
return text.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[\u00C6\u00E6]/g, "ae").replaceAll(/[\u00D8\u00F8]/g, "oe").replaceAll(/[\u00C5\u00E5]/g, "aa").toLowerCase().replaceAll(/\s+/g, "-").replaceAll(/[^\w-]+/g, "").replaceAll(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "").slice(0, Math.max(0, maxLength));
|
5659
|
+
}
|
5660
|
+
|
5661
|
+
// src/theme/recipes/pressable-card.ts
|
5662
|
+
var pressableCardRecipe = defineRecipe({
|
5663
|
+
base: {
|
5664
|
+
appearance: "none",
|
5665
|
+
border: "none",
|
5666
|
+
overflow: "hidden",
|
5667
|
+
fontSize: "inherit",
|
5668
|
+
display: "block",
|
5669
|
+
borderRadius: "md",
|
5670
|
+
cursor: "pointer",
|
5671
|
+
transitionProperty: "common",
|
5672
|
+
transitionDuration: "fast",
|
5673
|
+
_disabled: {
|
5674
|
+
outline: "none",
|
5675
|
+
pointerEvents: "none",
|
5676
|
+
background: "surface.disabled",
|
5677
|
+
color: "text.disabled"
|
5678
|
+
}
|
5679
|
+
},
|
5680
|
+
variants: {
|
5681
|
+
variant: {
|
5682
|
+
floating: {
|
5683
|
+
boxShadow: "0px 1px 3px 0px var(--shadow-color)",
|
5684
|
+
shadowColor: "surface.disabled",
|
5685
|
+
border: "sm",
|
5686
|
+
borderColor: "floating.outline",
|
5687
|
+
backgroundColor: "floating.surface",
|
5688
|
+
_hover: {
|
5689
|
+
boxShadow: "0px 2px 6px 0px var(--shadow-color)",
|
5690
|
+
backgroundColor: "floating.surface.hover",
|
5691
|
+
borderColor: "floating.outline.hover",
|
5692
|
+
_active: {
|
5693
|
+
boxShadow: "none",
|
5694
|
+
backgroundColor: "floating.surface.active",
|
5695
|
+
borderColor: "floating.outline.active"
|
5696
|
+
}
|
5697
|
+
}
|
5698
|
+
},
|
5699
|
+
core: {
|
5700
|
+
outlineColor: "core.outline",
|
5701
|
+
outlineWidth: tokens23__default.size.stroke.sm,
|
5702
|
+
outlineStyle: "solid",
|
5703
|
+
backgroundColor: "core.surface",
|
5704
|
+
_hover: {
|
5705
|
+
outlineColor: "core.outline.hover",
|
5706
|
+
outlineWidth: tokens23__default.size.stroke.md,
|
5707
|
+
outlineStyle: "solid",
|
5708
|
+
_active: {
|
5709
|
+
backgroundColor: "core.surface.active",
|
5710
|
+
outlineWidth: tokens23__default.size.stroke.sm
|
5711
|
+
}
|
5712
|
+
}
|
5713
|
+
},
|
5714
|
+
accent: {
|
5715
|
+
boxShadow: "0px 1px 3px 0px var(--shadow-color)",
|
5716
|
+
shadowColor: "surface.disabled",
|
5717
|
+
background: "alert.success.surface",
|
5718
|
+
_hover: {
|
5719
|
+
background: "alert.success.surface.hover",
|
5720
|
+
boxShadow: "0px 2px 6px 0px var(--shadow-color)",
|
5721
|
+
_active: {
|
5722
|
+
background: "alert.success.surface.active",
|
5723
|
+
boxShadow: "none"
|
5724
|
+
}
|
5725
|
+
}
|
5726
|
+
}
|
5727
|
+
}
|
5728
|
+
},
|
5729
|
+
defaultVariants: {
|
5730
|
+
variant: "core"
|
5731
|
+
}
|
5732
|
+
});
|
5768
5733
|
var separatorRecipe = defineRecipe({
|
5769
5734
|
className: "spor-separator",
|
5770
5735
|
base: {
|
@@ -5898,6 +5863,43 @@ var skeletonRecipe = defineRecipe({
|
|
5898
5863
|
}
|
5899
5864
|
}
|
5900
5865
|
});
|
5866
|
+
var staticCardRecipe = defineRecipe({
|
5867
|
+
base: {
|
5868
|
+
borderRadius: "md"
|
5869
|
+
},
|
5870
|
+
variants: {
|
5871
|
+
colorPalette: {
|
5872
|
+
white: {
|
5873
|
+
backgroundColor: "surface.color.neutral",
|
5874
|
+
color: "text"
|
5875
|
+
},
|
5876
|
+
grey: {
|
5877
|
+
backgroundColor: "surface.color.grey"
|
5878
|
+
},
|
5879
|
+
yellow: {
|
5880
|
+
backgroundColor: "surface.color.cream"
|
5881
|
+
},
|
5882
|
+
darkYellow: {
|
5883
|
+
backgroundColor: "surface.color.yellow"
|
5884
|
+
},
|
5885
|
+
red: {
|
5886
|
+
backgroundColor: "surface.color.red"
|
5887
|
+
},
|
5888
|
+
green: {
|
5889
|
+
backgroundColor: "surface.color.green"
|
5890
|
+
},
|
5891
|
+
blue: {
|
5892
|
+
backgroundColor: "surface.color.blue"
|
5893
|
+
},
|
5894
|
+
orange: {
|
5895
|
+
backgroundColor: "surface.color.orange"
|
5896
|
+
}
|
5897
|
+
}
|
5898
|
+
},
|
5899
|
+
defaultVariants: {
|
5900
|
+
colorPalette: "white"
|
5901
|
+
}
|
5902
|
+
});
|
5901
5903
|
var _a2, _b;
|
5902
5904
|
var textareaRecipe = defineRecipe({
|
5903
5905
|
className: "spor-textarea",
|
@@ -5929,6 +5931,7 @@ var recipes = {
|
|
5929
5931
|
attachedInputs: attachedInputsRecipe,
|
5930
5932
|
badge: badgeRecipie,
|
5931
5933
|
button: buttonRecipe,
|
5934
|
+
buttonGroup: groupRecipe,
|
5932
5935
|
closeButton: closeButtonRecipe,
|
5933
5936
|
code: codeRecipie,
|
5934
5937
|
input: inputRecipe,
|
@@ -6932,6 +6935,23 @@ var choiceChipSlotRecipe = defineSlotRecipe({
|
|
6932
6935
|
chipType: "choice"
|
6933
6936
|
}
|
6934
6937
|
});
|
6938
|
+
var collapsibleSlotRecipe = defineSlotRecipe({
|
6939
|
+
slots: collapsibleAnatomy.keys(),
|
6940
|
+
className: "chakra-collapsible",
|
6941
|
+
base: {
|
6942
|
+
content: {
|
6943
|
+
overflow: "hidden",
|
6944
|
+
_open: {
|
6945
|
+
animationName: "expand-height, fade-in",
|
6946
|
+
animationDuration: "moderate"
|
6947
|
+
},
|
6948
|
+
_closed: {
|
6949
|
+
animationName: "collapse-height, fade-out",
|
6950
|
+
animationDuration: "moderate"
|
6951
|
+
}
|
6952
|
+
}
|
6953
|
+
}
|
6954
|
+
});
|
6935
6955
|
var datePickerSlotRecipe = defineSlotRecipe({
|
6936
6956
|
slots: datepickerAnatomy.keys(),
|
6937
6957
|
className: "spor-datepicker",
|
@@ -9022,7 +9042,9 @@ var selectSlotRecipe = defineSlotRecipe({
|
|
9022
9042
|
outline: "1px solid",
|
9023
9043
|
outlineColor: "floating.outline"
|
9024
9044
|
}
|
9025
|
-
}
|
9045
|
+
}
|
9046
|
+
},
|
9047
|
+
sideRadiusVariant: {
|
9026
9048
|
rightSideSquare: {
|
9027
9049
|
control: {
|
9028
9050
|
outline: "1px solid",
|
@@ -9719,7 +9741,8 @@ var slotRecipes = {
|
|
9719
9741
|
tabs: tabsSlotRecipe,
|
9720
9742
|
travelTag: travelTagSlotRecipe,
|
9721
9743
|
toast: toastSlotRecipe,
|
9722
|
-
checkboxCard: choiceChipSlotRecipe
|
9744
|
+
checkboxCard: choiceChipSlotRecipe,
|
9745
|
+
collapsible: collapsibleSlotRecipe
|
9723
9746
|
};
|
9724
9747
|
var animations = defineTokens.animations({
|
9725
9748
|
spin: {
|