@vygruppen/spor-react 12.14.1 → 12.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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, 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, useDialogContext, Drawer as Drawer$1, Grid, GridItem, usePopoverContext, Checkbox as Checkbox$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, Tooltip as Tooltip$1, VisuallyHidden, defineConfig, CheckboxGroup as CheckboxGroup$1, ListItem, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
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, useDialogContext, Drawer as Drawer$1, usePopoverContext, Checkbox as Checkbox$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, Tooltip as Tooltip$1, VisuallyHidden, defineConfig, CheckboxGroup as CheckboxGroup$1, ListItem, ChakraProvider, Toaster as Toaster$1, Toast, Icon } from '@chakra-ui/react';
2
2
  export { AspectRatio, Box, BreadcrumbCurrentLink, BreadcrumbEllipsis, BreadcrumbLink, Center, ClientOnly, Collapsible, Container, Em, Flex, For, FormatByte, FormatNumber, Grid, GridItem, HStack, Icon, Image, Kbd, LocaleProvider, Portal, Show, SimpleGrid, Spacer, Span, Stack, TableBody, TableCaption, TableCell, TableColumn, TableColumnGroup, TableColumnHeader, TableFooter, TableHeader, TableRoot, TableRow, VStack, VisuallyHidden, createIcon, createListCollection, createSystem, defineConfig, defineRecipe, defineStyle, chakra as spor, useBreakpointValue, useCheckbox, useClipboard, useControllableProp, useDisclosure, useMediaQuery, useRecipe, useSlotRecipe, 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 React27 from 'react';
@@ -2355,6 +2355,20 @@ var DialogTitle = Dialog.Title;
2355
2355
  var DialogDescription = Dialog.Description;
2356
2356
  var DialogTrigger = Dialog.Trigger;
2357
2357
  var DialogActionTrigger = Dialog.ActionTrigger;
2358
+ var ResponsiveButton = ({ label, icon, ...props }) => {
2359
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2360
+ /* @__PURE__ */ jsx(Button, { display: ["none", "flex"], leftIcon: icon, ...props, children: label }),
2361
+ /* @__PURE__ */ jsx(
2362
+ IconButton,
2363
+ {
2364
+ display: ["flex", "none"],
2365
+ "aria-label": label,
2366
+ icon,
2367
+ ...props
2368
+ }
2369
+ )
2370
+ ] });
2371
+ };
2358
2372
  var [RootDrawerProvider, useRootDrawerProps] = createContext$1({
2359
2373
  name: "RootDrawerProvider"
2360
2374
  });
@@ -2401,20 +2415,37 @@ CloseDrawerLine.displayName = "CloseDrawerLine";
2401
2415
  var DrawerCloseTrigger = forwardRef(function DrawerCloseTrigger2(props, ref) {
2402
2416
  const { size } = useRootDrawerProps();
2403
2417
  const { t } = useTranslation();
2404
- return /* @__PURE__ */ jsx(Drawer$1.CloseTrigger, { ref, ...props, asChild: true, children: size === "full" ? /* @__PURE__ */ jsx(Button, { variant: "ghost", leftIcon: /* @__PURE__ */ jsx(CloseFill24Icon, {}), children: t(texts12.close) }) : /* @__PURE__ */ jsx(CloseButton, { size: "md" }) });
2418
+ return /* @__PURE__ */ jsx(Drawer$1.CloseTrigger, { ref, ...props, asChild: true, children: size === "full" ? /* @__PURE__ */ jsx(
2419
+ ResponsiveButton,
2420
+ {
2421
+ variant: "ghost",
2422
+ icon: /* @__PURE__ */ jsx(CloseFill24Icon, {}),
2423
+ label: t(texts12.close)
2424
+ }
2425
+ ) : /* @__PURE__ */ jsx(CloseButton, { size: "md" }) });
2405
2426
  });
2406
2427
  var DrawerBackTrigger = forwardRef((props, ref) => {
2407
2428
  const { t } = useTranslation();
2408
- return /* @__PURE__ */ jsx(Drawer$1.CloseTrigger, { asChild: true, ...props, ref, top: "0", children: /* @__PURE__ */ jsx(Button, { variant: "ghost", leftIcon: /* @__PURE__ */ jsx(ArrowLeftFill24Icon, {}), children: t(texts12.back) }) });
2429
+ return /* @__PURE__ */ jsx(Drawer$1.CloseTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ jsx(
2430
+ ResponsiveButton,
2431
+ {
2432
+ variant: "ghost",
2433
+ icon: /* @__PURE__ */ jsx(ArrowLeftFill24Icon, {}),
2434
+ label: t(texts12.back)
2435
+ }
2436
+ ) });
2409
2437
  });
2410
2438
  DrawerBackTrigger.displayName = "DrawerBackTrigger";
2411
2439
  var DrawerFullScreenHeader = forwardRef((props, ref) => {
2412
2440
  const { backTrigger = true, closeTrigger = true, children } = props;
2413
- return /* @__PURE__ */ jsx(Drawer$1.Header, { ...props, ref, asChild: true, children: /* @__PURE__ */ jsxs(Grid, { templateColumns: "1fr auto 1fr", height: "auto", paddingX: "8", children: [
2414
- /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "center", children: backTrigger && /* @__PURE__ */ jsx(DrawerBackTrigger, {}) }),
2415
- /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "end", asChild: true, children: children && /* @__PURE__ */ jsx(DrawerTitle, { children }) }),
2416
- closeTrigger && /* @__PURE__ */ jsx(GridItem, { width: "full", alignSelf: "end", children: /* @__PURE__ */ jsx(DrawerCloseTrigger, { justifySelf: "end", top: "0" }) })
2417
- ] }) });
2441
+ return /* @__PURE__ */ jsxs(Drawer$1.Header, { ...props, ref, children: [
2442
+ /* @__PURE__ */ jsx(Box, { children: backTrigger && /* @__PURE__ */ jsx(DrawerBackTrigger, {}) }),
2443
+ /* @__PURE__ */ jsx(DrawerTitle, { children }),
2444
+ /* @__PURE__ */ jsxs(Box, { children: [
2445
+ " ",
2446
+ closeTrigger && /* @__PURE__ */ jsx(DrawerCloseTrigger, {})
2447
+ ] })
2448
+ ] });
2418
2449
  });
2419
2450
  DrawerFullScreenHeader.displayName = "DrawerFullScreenHeader";
2420
2451
  var Drawer = (props) => {
@@ -3671,7 +3702,7 @@ var Switch = forwardRef(
3671
3702
  children: [
3672
3703
  /* @__PURE__ */ jsx(Switch$1.HiddenInput, { ref }),
3673
3704
  /* @__PURE__ */ jsx(Switch$1.Control, { css: styles.control, children: /* @__PURE__ */ jsx(Switch$1.Thumb, {}) }),
3674
- /* @__PURE__ */ jsx(Switch$1.Label, { children: label })
3705
+ label && /* @__PURE__ */ jsx(Switch$1.Label, { children: label })
3675
3706
  ]
3676
3707
  }
3677
3708
  )
@@ -7661,7 +7692,8 @@ var drawerSlotRecipe = defineSlotRecipe({
7661
7692
  display: "flex",
7662
7693
  alignItems: "center",
7663
7694
  justifyContent: "space-between",
7664
- paddingX: ["3", null, null, "5"],
7695
+ paddingX: ["2", null, null, "5"],
7696
+ gap: "1",
7665
7697
  paddingBottom: "1"
7666
7698
  },
7667
7699
  body: {