@vygruppen/spor-react 12.8.10 → 12.10.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/dist/index.d.cts CHANGED
@@ -2995,8 +2995,18 @@ declare const ProgressIndicator: React__default.ForwardRefExoticComponent<BoxPro
2995
2995
  } & React__default.RefAttributes<HTMLDivElement>>;
2996
2996
 
2997
2997
  type SporProviderProps = Omit<ChakraProviderProps, "value"> & {
2998
+ /**
2999
+ * The current language of your application. Used for built-in microcopy and labels. Default is Norwegian (bokmål).
3000
+ */
2998
3001
  language?: Language;
3002
+ /**
3003
+ * The theme to use for colors and design tokens. If not provided, the default Spor theme is used.
3004
+ */
2999
3005
  theme?: SystemContext;
3006
+ /**
3007
+ * If true, enables system color mode. If false, the default theme is light.
3008
+ */
3009
+ enableSystemColorMode?: boolean;
3000
3010
  };
3001
3011
  /**
3002
3012
  * This component is used to provide the specified theme of colors and other
@@ -3035,7 +3045,7 @@ import { theme } from '../../../../apps/docs/app/features/portable-text/code-blo
3035
3045
  * );
3036
3046
  * ```
3037
3047
  */
3038
- declare const SporProvider: ({ language, theme, children, }: SporProviderProps) => react_jsx_runtime.JSX.Element;
3048
+ declare const SporProvider: ({ language, theme, enableSystemColorMode, children, }: SporProviderProps) => react_jsx_runtime.JSX.Element;
3039
3049
 
3040
3050
  declare const stepperSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "title" | "closeButton" | "container" | "innerContainer" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle" | "backButton", {
3041
3051
  variant: {
package/dist/index.d.ts CHANGED
@@ -2995,8 +2995,18 @@ declare const ProgressIndicator: React__default.ForwardRefExoticComponent<BoxPro
2995
2995
  } & React__default.RefAttributes<HTMLDivElement>>;
2996
2996
 
2997
2997
  type SporProviderProps = Omit<ChakraProviderProps, "value"> & {
2998
+ /**
2999
+ * The current language of your application. Used for built-in microcopy and labels. Default is Norwegian (bokmål).
3000
+ */
2998
3001
  language?: Language;
3002
+ /**
3003
+ * The theme to use for colors and design tokens. If not provided, the default Spor theme is used.
3004
+ */
2999
3005
  theme?: SystemContext;
3006
+ /**
3007
+ * If true, enables system color mode. If false, the default theme is light.
3008
+ */
3009
+ enableSystemColorMode?: boolean;
3000
3010
  };
3001
3011
  /**
3002
3012
  * This component is used to provide the specified theme of colors and other
@@ -3035,7 +3045,7 @@ import { theme } from '../../../../apps/docs/app/features/portable-text/code-blo
3035
3045
  * );
3036
3046
  * ```
3037
3047
  */
3038
- declare const SporProvider: ({ language, theme, children, }: SporProviderProps) => react_jsx_runtime.JSX.Element;
3048
+ declare const SporProvider: ({ language, theme, enableSystemColorMode, children, }: SporProviderProps) => react_jsx_runtime.JSX.Element;
3039
3049
 
3040
3050
  declare const stepperSlotRecipe: _chakra_ui_react.SlotRecipeDefinition<"root" | "title" | "closeButton" | "container" | "innerContainer" | "stepCounter" | "stepContainer" | "stepButton" | "stepNumber" | "stepTitle" | "backButton", {
3041
3051
  variant: {
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, 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, 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';
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';
@@ -15,6 +15,7 @@ import { useDateFieldState, useDatePickerState, useCalendarState, useRangeCalend
15
15
  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
+ import { useSwipeable } from 'react-swipeable';
18
19
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
19
20
  import { Global } from '@emotion/react';
20
21
  import tokens23__default from '@vygruppen/spor-design-tokens';
@@ -2356,38 +2357,38 @@ var DrawerContent = forwardRef(
2356
2357
  (props, ref) => {
2357
2358
  const { children, portalled = true, portalRef, ...rest } = props;
2358
2359
  const { size, placement } = useRootDrawerProps();
2360
+ const { setOpen } = useDialogContext();
2361
+ const handlers = useSwipeable({
2362
+ onSwiped: (e) => {
2363
+ const shouldClose = placement === "bottom" && e.dir === "Down" || placement === "top" && e.dir === "Up" || placement === "end" && e.dir === "Right" || placement === "start" && e.dir === "Left";
2364
+ if (shouldClose) {
2365
+ setOpen(false);
2366
+ }
2367
+ },
2368
+ swipeDuration: 250
2369
+ });
2359
2370
  const sizeNotFull = size !== "full";
2360
- return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(Drawer$1.Positioner, { children: /* @__PURE__ */ jsxs(Drawer$1.Content, { ref, ...rest, children: [
2371
+ return /* @__PURE__ */ jsx(Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ jsx(Drawer$1.Positioner, { children: /* @__PURE__ */ jsx(Box, { ...handlers, width: "100%", children: /* @__PURE__ */ jsxs(Drawer$1.Content, { ref, ...rest, children: [
2361
2372
  sizeNotFull && placement === "bottom" && /* @__PURE__ */ jsx(CloseDrawerLine, {}),
2362
2373
  children,
2363
2374
  sizeNotFull && placement === "top" && /* @__PURE__ */ jsx(CloseDrawerLine, {})
2364
- ] }) }) });
2375
+ ] }) }) }) });
2365
2376
  }
2366
2377
  );
2367
2378
  DrawerContent.displayName = "DrawerContent";
2368
2379
  var CloseDrawerLine = forwardRef((props, ref) => {
2369
- const { t } = useTranslation();
2370
2380
  return /* @__PURE__ */ jsx(
2371
- Drawer$1.CloseTrigger,
2381
+ Box,
2372
2382
  {
2373
- ...props,
2374
- ref,
2375
- position: "relative",
2376
- insetEnd: "unset",
2377
- "aria-label": t(texts12.close),
2378
- cursor: "pointer",
2383
+ width: 7,
2384
+ minHeight: 1,
2379
2385
  top: 0,
2380
- paddingY: 2,
2381
- children: /* @__PURE__ */ jsx(
2382
- Box,
2383
- {
2384
- width: 7,
2385
- height: 1,
2386
- backgroundColor: "silver",
2387
- borderRadius: "xs",
2388
- marginX: "auto"
2389
- }
2390
- )
2386
+ marginY: 2,
2387
+ marginX: "auto",
2388
+ backgroundColor: "silver",
2389
+ borderRadius: "xs",
2390
+ ...props,
2391
+ ref
2391
2392
  }
2392
2393
  );
2393
2394
  });
@@ -5113,9 +5114,10 @@ var texts25 = createTexts({
5113
5114
  var SporProvider = ({
5114
5115
  language = "nb" /* NorwegianBokmal */,
5115
5116
  theme = system,
5117
+ enableSystemColorMode = true,
5116
5118
  children
5117
5119
  }) => {
5118
- return /* @__PURE__ */ jsx(LanguageProvider, { language, children: /* @__PURE__ */ jsx(ChakraProvider, { value: theme, children: /* @__PURE__ */ jsxs(ColorModeProvider, { children: [
5120
+ return /* @__PURE__ */ jsx(LanguageProvider, { language, children: /* @__PURE__ */ jsx(ChakraProvider, { value: theme, children: /* @__PURE__ */ jsxs(ColorModeProvider, { enableSystem: enableSystemColorMode, children: [
5119
5121
  /* @__PURE__ */ jsx(Toaster, {}),
5120
5122
  /* @__PURE__ */ jsx(Global, { styles: fontFaces }),
5121
5123
  children
@@ -6884,6 +6886,7 @@ var choiceChipSlotRecipe = defineSlotRecipe({
6884
6886
  label: {
6885
6887
  display: "flex",
6886
6888
  alignItems: "center",
6889
+ gap: "1",
6887
6890
  fontSize: "xs"
6888
6891
  }
6889
6892
  },