@vygruppen/spor-react 4.1.1 → 5.1.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@4.1.1 build
2
+ > @vygruppen/spor-react@5.1.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -8,13 +8,15 @@
8
8
  CLI Target: node16
9
9
  CJS Build start
10
10
  ESM Build start
11
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
12
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-VXZX2ZXT.mjs".
11
13
  DTS Build start
12
- CJS dist/index.js 490.53 KB
13
- CJS ⚡️ Build success in 2250ms
14
- ESM dist/index.mjs 2.10 KB
15
- ESM dist/CountryCodeSelect-7MAIS4VT.mjs 1.19 KB
16
- ESM dist/chunk-U2IWIWOD.mjs 382.91 KB
17
- ESM ⚡️ Build success in 2252ms
18
- DTS ⚡️ Build success in 12839ms
19
- DTS dist/index.d.ts 262.48 KB
20
- DTS dist/index.d.mts 262.48 KB
14
+ CJS dist/index.js 493.70 KB
15
+ CJS ⚡️ Build success in 2337ms
16
+ ESM dist/index.mjs 2.12 KB
17
+ ESM dist/CountryCodeSelect-M5TBGWY5.mjs 1.19 KB
18
+ ESM dist/chunk-VXZX2ZXT.mjs 385.58 KB
19
+ ESM ⚡️ Build success in 2338ms
20
+ DTS ⚡️ Build success in 12621ms
21
+ DTS dist/index.d.ts 262.63 KB
22
+ DTS dist/index.d.mts 262.63 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 5.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a16a9972: Expose new methods and components from Chakra:
8
+
9
+ - defineStyleConfig
10
+ - Collapse
11
+ - useSize
12
+ - ComponentStyleConfig (type)
13
+ - CSSWithMultiValues (type)
14
+
15
+ ### Patch Changes
16
+
17
+ - f3394fb3: DatePicker: Fix bug where field went from uncontrolled to controleld
18
+ - 1a6eb2f8: TimePicker: Allow for null values (so the time can be reset)
19
+ - 6043ebfb: Button, IconButton: Fix a bug that broke loading states
20
+
21
+ ## 5.0.0
22
+
23
+ ### Major Changes
24
+
25
+ - 24963270: Breaking: Rename <Button variant="additional" /> to <Button variant="tertiary" />
26
+
27
+ Due to a… minor screwup on ~our~ @selbekk's side, we deprecated the wrong name earlier on.
28
+
29
+ To mitigate my screwup, please search through your code base for "additional", and replace it with "tertiary". It should be a simple enough upgrade. Make sure to do this with all Button and IconButton components.
30
+
31
+ Sorry. - @selbekk.
32
+
33
+ ### Patch Changes
34
+
35
+ - 799d47bb: Button: bugfix changed primary button color to pine
36
+
3
37
  ## 4.1.1
4
38
 
5
39
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-U2IWIWOD.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-VXZX2ZXT.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1,10 +1,10 @@
1
- import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, Flex, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, useControllableState, Radio as Radio$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Textarea as Textarea$1, Link, ModalHeader as ModalHeader$1, useModalContext, DrawerContent as DrawerContent$1, Tabs as Tabs$1, Table as Table$1, defineStyleConfig as defineStyleConfig$1, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, useColorMode, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
2
- export { AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, Box, Center, Collapse, Container, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, Fade, Flex, FormHelperText, Grid, GridItem, HStack, Image, Img, InputGroup, LightMode, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, VStack, Wrap, WrapItem, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
1
  import tokens10__default from '@vygruppen/spor-design-tokens';
4
2
  import * as tokens10 from '@vygruppen/spor-design-tokens';
5
3
  export { tokens10 as tokens };
4
+ import { forwardRef, Divider as Divider$1, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, Flex, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, chakra, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, useControllableState, Radio as Radio$1, RadioGroup as RadioGroup$1, Switch as Switch$1, Textarea as Textarea$1, Link, ModalHeader as ModalHeader$1, useModalContext, DrawerContent as DrawerContent$1, Tabs as Tabs$1, Table as Table$1, defineStyleConfig as defineStyleConfig$1, createMultiStyleConfigHelpers as createMultiStyleConfigHelpers$1, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, useColorMode, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
5
+ export { AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, Box, Center, Container, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, Fade, Flex, FormHelperText, Grid, GridItem, HStack, Image, Img, InputGroup, LightMode, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, VStack, Wrap, WrapItem, defineStyleConfig, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
6
6
  import * as React69 from 'react';
7
- import React69__default, { createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, useId, Suspense, useContext, useCallback, useMemo } from 'react';
7
+ import React69__default, { createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, useId, Suspense, useContext, useCallback, useMemo, useLayoutEffect } from 'react';
8
8
  import { CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, CalendarOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill24Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, LinkOutOutline24Icon, DropdownRightFill18Icon, DropdownLeftFill18Icon, DropdownDownFill18Icon, DropdownDownFill24Icon, DropdownUpFill24Icon, ArrowRightFill18Icon, DropdownLeftFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, ErrorOutline24Icon, AltTransportOutline24Icon, WarningOutline24Icon, SuccessOutline24Icon, InformationOutline24Icon, TrainFill18Icon, TrainFill24Icon, TrainFill30Icon, ExpressBusFill18Icon, ExpressBusFill24Icon, ExpressBusFill30Icon, BusFill18Icon, BusFill24Icon, BusFill30Icon, FerryFill18Icon, FerryFill24Icon, FerryFill30Icon, SubwayFill18Icon, SubwayFill24Icon, SubwayFill30Icon, TramFill18Icon, TramFill24Icon, TramFill30Icon, AltTransportFill18Icon, AltTransportFill24Icon, AltTransportFill30Icon, WalkFill18Icon, WalkFill24Icon, WalkFill30Icon } from '@vygruppen/spor-icon-react';
9
9
  import { inlineLoaderColorData, spinnerColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, fullScreenLoaderBlackData, inlineLoaderLightData, spinnerLightData, spinnerDarkData } from '@vygruppen/spor-loader';
10
10
  import { useLottie } from 'lottie-react';
@@ -1167,7 +1167,8 @@ var Button = forwardRef((props, ref) => {
1167
1167
  isLoading,
1168
1168
  isDisabled,
1169
1169
  leftIcon,
1170
- rightIcon
1170
+ rightIcon,
1171
+ ...rest
1171
1172
  } = props;
1172
1173
  const ariaLabel = useCorrectAriaLabel(props);
1173
1174
  const buttonGroup = useButtonGroup();
@@ -1178,7 +1179,7 @@ var Button = forwardRef((props, ref) => {
1178
1179
  {
1179
1180
  size: finalSize,
1180
1181
  variant: finalVariant,
1181
- ...props,
1182
+ ...rest,
1182
1183
  ref,
1183
1184
  "aria-label": ariaLabel,
1184
1185
  "aria-busy": isLoading,
@@ -1200,8 +1201,9 @@ var Button = forwardRef((props, ref) => {
1200
1201
  ColorInlineLoader,
1201
1202
  {
1202
1203
  maxWidth: getLoaderWidth(finalSize),
1203
- width: "100%",
1204
- marginX: 2
1204
+ width: "80%",
1205
+ marginX: 2,
1206
+ marginY: 2
1205
1207
  }
1206
1208
  )
1207
1209
  ),
@@ -1251,7 +1253,7 @@ var IconButton = forwardRef(
1251
1253
  {
1252
1254
  title: props["aria-label"],
1253
1255
  ...props,
1254
- spinner: /* @__PURE__ */ React69__default.createElement(ColorSpinner, { margin: 1 }),
1256
+ spinner: /* @__PURE__ */ React69__default.createElement(ColorSpinner, { width: "80%", height: "80%", marginX: 1, marginTop: 1 }),
1255
1257
  ref
1256
1258
  }
1257
1259
  )
@@ -2004,7 +2006,7 @@ var DateField = forwardRef$1(
2004
2006
  "input",
2005
2007
  {
2006
2008
  type: "hidden",
2007
- value: (_a6 = state2.value) == null ? void 0 : _a6.toString(),
2009
+ value: ((_a6 = state2.value) == null ? void 0 : _a6.toString()) ?? "",
2008
2010
  name: props.name
2009
2011
  }
2010
2012
  ));
@@ -3416,7 +3418,7 @@ var texts14 = createTexts({
3416
3418
  sv: "Telefonnummer"
3417
3419
  }
3418
3420
  });
3419
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-7MAIS4VT.mjs'));
3421
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-M5TBGWY5.mjs'));
3420
3422
  var Radio = forwardRef((props, ref) => {
3421
3423
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
3422
3424
  });
@@ -4098,7 +4100,7 @@ var NextStepButton = ({ isLastStep, onNext }) => {
4098
4100
  return /* @__PURE__ */ React69.createElement(
4099
4101
  Button,
4100
4102
  {
4101
- variant: "additional",
4103
+ variant: "tertiary",
4102
4104
  size: "sm",
4103
4105
  color: "white",
4104
4106
  leftIcon: isLastStep ? void 0 : /* @__PURE__ */ React69.createElement(ArrowRightFill18Icon, null),
@@ -4269,7 +4271,7 @@ var StepperStep = ({
4269
4271
  Button,
4270
4272
  {
4271
4273
  size: "xs",
4272
- variant: state2 === "active" ? "primary" : state2 === "completed" ? "additional" : "ghost",
4274
+ variant: state2 === "active" ? "primary" : state2 === "completed" ? "tertiary" : "ghost",
4273
4275
  ...adjustedProps,
4274
4276
  onClick: () => onClick(stepNumber)
4275
4277
  },
@@ -9799,7 +9801,7 @@ var config6 = defineStyleConfig$1({
9799
9801
  primary: (props) => ({
9800
9802
  // FIXME: Update to use a global defined background color for darkMode whenever it is available.
9801
9803
  // hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
9802
- backgroundColor: mode("primaryGreen", "coralGreen")(props),
9804
+ backgroundColor: mode("pine", "coralGreen")(props),
9803
9805
  color: mode("white", "darkTeal")(props),
9804
9806
  ...focusVisible({
9805
9807
  focus: {
@@ -13459,7 +13461,7 @@ var ActionToast = ({
13459
13461
  buttonText,
13460
13462
  id
13461
13463
  }) => {
13462
- return /* @__PURE__ */ React69__default.createElement(BaseToast, { variant, id }, /* @__PURE__ */ React69__default.createElement(Box, { marginRight: 2, flexGrow: "1" }, children), /* @__PURE__ */ React69__default.createElement(Button, { variant: "additional", size: "sm", onClick }, buttonText));
13464
+ return /* @__PURE__ */ React69__default.createElement(BaseToast, { variant, id }, /* @__PURE__ */ React69__default.createElement(Box, { marginRight: 2, flexGrow: "1" }, children), /* @__PURE__ */ React69__default.createElement(Button, { variant: "tertiary", size: "sm", onClick }, buttonText));
13463
13465
  };
13464
13466
  var ClosableToast = ({
13465
13467
  children,
@@ -13533,4 +13535,95 @@ var getToastComponent = (opts) => {
13533
13535
  return ({ id }) => /* @__PURE__ */ React69__default.createElement(BaseToast, { id, variant: opts.variant }, opts.text);
13534
13536
  };
13535
13537
 
13536
- export { Accordion, AttachedInputs, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerContent, Expandable, ExpandableAlert, ExpandableItem, FloatingActionButton, FormControl, FormErrorMessage, FormLabel3 as FormLabel, Heading, IconButton, InfoSelect, InfoTag, Input, InputLeftElement2 as InputLeftElement, InputRightElement2 as InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, ListBox, ModalHeader, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, SimpleDrawer, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Table, Tabs, Text4 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, WizardPopover, createTexts, fontFaces, theme, useToast, useTranslation };
13538
+ // ../../node_modules/@zag-js/element-size/dist/track-size.mjs
13539
+ function trackElementSize(element, callback) {
13540
+ if (!element) {
13541
+ callback(void 0);
13542
+ return;
13543
+ }
13544
+ callback({ width: element.offsetWidth, height: element.offsetHeight });
13545
+ const win = element.ownerDocument.defaultView ?? window;
13546
+ const observer = new win.ResizeObserver((entries) => {
13547
+ if (!Array.isArray(entries) || !entries.length)
13548
+ return;
13549
+ const [entry] = entries;
13550
+ let width;
13551
+ let height;
13552
+ if ("borderBoxSize" in entry) {
13553
+ const borderSizeEntry = entry["borderBoxSize"];
13554
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
13555
+ width = borderSize["inlineSize"];
13556
+ height = borderSize["blockSize"];
13557
+ } else {
13558
+ width = element.offsetWidth;
13559
+ height = element.offsetHeight;
13560
+ }
13561
+ callback({ width, height });
13562
+ });
13563
+ observer.observe(element, { box: "border-box" });
13564
+ return () => observer.unobserve(element);
13565
+ }
13566
+ var useSafeLayoutEffect = Boolean(globalThis == null ? void 0 : globalThis.document) ? useLayoutEffect : useEffect;
13567
+ function trackMutation(el, cb) {
13568
+ var _a6, _b5;
13569
+ if (!el || !el.parentElement)
13570
+ return;
13571
+ const win = (_b5 = (_a6 = el.ownerDocument) == null ? void 0 : _a6.defaultView) != null ? _b5 : window;
13572
+ const observer = new win.MutationObserver(() => {
13573
+ cb();
13574
+ });
13575
+ observer.observe(el.parentElement, { childList: true });
13576
+ return () => {
13577
+ observer.disconnect();
13578
+ };
13579
+ }
13580
+ function useSizes({
13581
+ getNodes,
13582
+ observeMutation = true
13583
+ }) {
13584
+ const [sizes26, setSizes] = useState([]);
13585
+ const [count, setCount] = useState(0);
13586
+ useSafeLayoutEffect(() => {
13587
+ const elements = getNodes();
13588
+ const cleanups = elements.map(
13589
+ (element, index) => trackElementSize(element, (size2) => {
13590
+ setSizes((sizes27) => {
13591
+ return [
13592
+ ...sizes27.slice(0, index),
13593
+ size2,
13594
+ ...sizes27.slice(index + 1)
13595
+ ];
13596
+ });
13597
+ })
13598
+ );
13599
+ if (observeMutation) {
13600
+ const firstNode = elements[0];
13601
+ cleanups.push(
13602
+ trackMutation(firstNode, () => {
13603
+ setCount((count2) => count2 + 1);
13604
+ })
13605
+ );
13606
+ }
13607
+ return () => {
13608
+ cleanups.forEach((cleanup) => {
13609
+ cleanup == null ? void 0 : cleanup();
13610
+ });
13611
+ };
13612
+ }, [count]);
13613
+ return sizes26;
13614
+ }
13615
+ function isRef(ref) {
13616
+ return typeof ref === "object" && ref !== null && "current" in ref;
13617
+ }
13618
+ function useSize(subject) {
13619
+ const [size2] = useSizes({
13620
+ observeMutation: false,
13621
+ getNodes() {
13622
+ const node = isRef(subject) ? subject.current : subject;
13623
+ return [node];
13624
+ }
13625
+ });
13626
+ return size2;
13627
+ }
13628
+
13629
+ export { Accordion, AttachedInputs, Badge, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerContent, Expandable, ExpandableAlert, ExpandableItem, FloatingActionButton, FormControl, FormErrorMessage, FormLabel3 as FormLabel, Heading, IconButton, InfoSelect, InfoTag, Input, InputLeftElement2 as InputLeftElement, InputRightElement2 as InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightSpinner, LineIcon, ListBox, ModalHeader, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, PopoverWizardBody, ProgressBar, ProgressLoader, Radio, RadioGroup, SearchInput, SimpleDrawer, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Table, Tabs, Text4 as Text, TextLink, Textarea, TimePicker, TravelTag, VyLogo, WizardPopover, createTexts, fontFaces, theme, useSize, useToast, useTranslation };
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { DividerProps as DividerProps$1, As, BoxProps, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, BreadcrumbProps as BreadcrumbProps$1, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, ComponentWithAs, ResponsiveValue, FlexProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, StackDirection, FormControlProps as FormControlProps$1, FormLabelProps as FormLabelProps$1, InputProps as InputProps$1, InputElementProps as InputElementProps$1, SelectProps, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SwitchProps as SwitchProps$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, SkeletonTextProps as SkeletonTextProps$1, ModalHeaderProps as ModalHeaderProps$1, DrawerContentProps, DrawerProps as DrawerProps$1, PopoverProps, ChakraProviderProps, TabsProps as TabsProps$1, TableProps as TableProps$1, BadgeProps as BadgeProps$1, CodeProps as CodeProps$1, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
2
- export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, Center, CenterProps, Collapse, CollapseProps, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, Portal, PortalProps, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
1
  import tokens__default from '@vygruppen/spor-design-tokens';
4
2
  import * as tokens from '@vygruppen/spor-design-tokens';
5
3
  export { tokens };
6
4
  import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
5
+ import { DividerProps as DividerProps$1, As, BoxProps, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, BreadcrumbProps as BreadcrumbProps$1, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, ComponentWithAs, ResponsiveValue, FlexProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, StackDirection, FormControlProps as FormControlProps$1, FormLabelProps as FormLabelProps$1, InputProps as InputProps$1, InputElementProps as InputElementProps$1, SelectProps, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SwitchProps as SwitchProps$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, SkeletonTextProps as SkeletonTextProps$1, ModalHeaderProps as ModalHeaderProps$1, DrawerContentProps, DrawerProps as DrawerProps$1, PopoverProps, ChakraProviderProps, TabsProps as TabsProps$1, TableProps as TableProps$1, BadgeProps as BadgeProps$1, CodeProps as CodeProps$1, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
6
+ export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, CSSWithMultiValues, Center, CenterProps, Collapse, CollapseProps, ComponentStyleConfig, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, Portal, PortalProps, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, defineStyleConfig, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
7
7
  import * as React from 'react';
8
8
  import React__default, { ChangeEvent } from 'react';
9
9
  import * as _chakra_ui_breadcrumb_dist_breadcrumb_link from '@chakra-ui/breadcrumb/dist/breadcrumb-link';
@@ -15,6 +15,7 @@ import { TimeValue } from '@react-types/datepicker';
15
15
  import { ListState, SelectState } from 'react-stately';
16
16
  export { Item, Section } from 'react-stately';
17
17
  import * as _chakra_ui_styled_system from '@chakra-ui/styled-system';
18
+ export { useSize } from '@chakra-ui/react-use-size';
18
19
 
19
20
  type DividerProps = DividerProps$1 & {
20
21
  size?: "sm" | "md" | "lg";
@@ -266,7 +267,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
266
267
  *
267
268
  * Defaults to "primary"
268
269
  */
269
- variant?: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
270
+ variant?: "control" | "primary" | "secondary" | "tertiary" | "ghost" | "floating";
270
271
  };
271
272
  /**
272
273
  * Buttons are used to trigger actions.
@@ -276,7 +277,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
276
277
  * - `control`: This button is used for ticket controls only.
277
278
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
278
279
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
279
- * - `additional`: Used for additional choices, like a less important secondary action.
280
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
280
281
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
281
282
  * - `floating`: Used for floating actions, like a menu button in a menu.
282
283
  *
@@ -334,7 +335,7 @@ type ButtonGroupProps = ButtonGroupProps$1;
334
335
  declare const ButtonGroup: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", ButtonGroupProps$1>;
335
336
 
336
337
  type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
337
- variant: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
338
+ variant: "control" | "primary" | "secondary" | "tertiary" | "ghost" | "floating";
338
339
  };
339
340
  /**
340
341
  * An icon-only button.
@@ -346,7 +347,7 @@ type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
346
347
  * - `control`: This button is used for ticket controls only.
347
348
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
348
349
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
349
- * - `additional`: Used for additional choices, like a less important secondary action.
350
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
350
351
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
351
352
  * - `floating`: Used for floating actions, like a menu button in a menu.
352
353
  *
@@ -488,9 +489,10 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
488
489
  name?: string;
489
490
  /** The controlled value, if any.
490
491
  *
491
- * A `new Time(hours, minutes)` should be passed
492
+ * A `new Time(hours, minutes)` should be passed.
493
+ * Or `null` if the time should be unset.
492
494
  **/
493
- value?: TimeValue;
495
+ value?: TimeValue | null;
494
496
  /** A default value, if any.
495
497
  *
496
498
  * A `new Time(hours, minutes)` should be passed.
@@ -2363,7 +2365,7 @@ declare const theme: {
2363
2365
  } | undefined;
2364
2366
  defaultProps?: {
2365
2367
  size?: "sm" | "md" | "lg" | "xs" | undefined;
2366
- variant?: "primary" | "secondary" | "ghost" | "floating" | "tertiary" | undefined;
2368
+ variant?: "primary" | "secondary" | "tertiary" | "ghost" | "floating" | undefined;
2367
2369
  colorScheme?: string | undefined;
2368
2370
  } | undefined;
2369
2371
  };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { DividerProps as DividerProps$1, As, BoxProps, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, BreadcrumbProps as BreadcrumbProps$1, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, ComponentWithAs, ResponsiveValue, FlexProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, StackDirection, FormControlProps as FormControlProps$1, FormLabelProps as FormLabelProps$1, InputProps as InputProps$1, InputElementProps as InputElementProps$1, SelectProps, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SwitchProps as SwitchProps$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, SkeletonTextProps as SkeletonTextProps$1, ModalHeaderProps as ModalHeaderProps$1, DrawerContentProps, DrawerProps as DrawerProps$1, PopoverProps, ChakraProviderProps, TabsProps as TabsProps$1, TableProps as TableProps$1, BadgeProps as BadgeProps$1, CodeProps as CodeProps$1, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
2
- export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, Center, CenterProps, Collapse, CollapseProps, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, Portal, PortalProps, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
1
  import tokens__default from '@vygruppen/spor-design-tokens';
4
2
  import * as tokens from '@vygruppen/spor-design-tokens';
5
3
  export { tokens };
6
4
  import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
5
+ import { DividerProps as DividerProps$1, As, BoxProps, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, BreadcrumbProps as BreadcrumbProps$1, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, ComponentWithAs, ResponsiveValue, FlexProps, CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1, StackDirection, FormControlProps as FormControlProps$1, FormLabelProps as FormLabelProps$1, InputProps as InputProps$1, InputElementProps as InputElementProps$1, SelectProps, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SwitchProps as SwitchProps$1, TextareaProps as TextareaProps$1, LinkProps as LinkProps$1, SkeletonTextProps as SkeletonTextProps$1, ModalHeaderProps as ModalHeaderProps$1, DrawerContentProps, DrawerProps as DrawerProps$1, PopoverProps, ChakraProviderProps, TabsProps as TabsProps$1, TableProps as TableProps$1, BadgeProps as BadgeProps$1, CodeProps as CodeProps$1, HeadingProps as HeadingProps$1, TextProps as TextProps$1 } from '@chakra-ui/react';
6
+ export { AccordionButton, AccordionButtonProps, AccordionIcon, AccordionItem, AccordionItemProps, AccordionPanel, AccordionPanelProps, Box, BoxProps, CSSWithMultiValues, Center, CenterProps, Collapse, CollapseProps, ComponentStyleConfig, Container, ContainerProps, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, DrawerProps, Fade, FadeProps, Flex, FlexProps, FormHelperText, Grid, GridItem, GridItemProps, GridProps, HStack, Image, ImageProps, Img, ImgProps, InputGroup, InputGroupProps, LightMode, ListItem, ListItemProps, ListProps, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, OrderedList, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, Portal, PortalProps, ScaleFade, ScaleFadeProps, SimpleGrid, SimpleGridProps, Slide, SlideFade, SlideFadeProps, SlideProps, Spacer, SpacerProps, Tab, TabList, TabListProps, TabPanel, TabPanelProps, TabPanels, TabPanelsProps, TabProps, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableFooterProps, TableHeadProps, TableRowProps, Tbody, Td, Tfoot, Th, Thead, Tr, UnorderedList, UseClipboardOptions, UseDisclosureProps, UseOutsideClickProps, VStack, Wrap, WrapItem, WrapItemProps, WrapProps, defineStyleConfig, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
7
7
  import * as React from 'react';
8
8
  import React__default, { ChangeEvent } from 'react';
9
9
  import * as _chakra_ui_breadcrumb_dist_breadcrumb_link from '@chakra-ui/breadcrumb/dist/breadcrumb-link';
@@ -15,6 +15,7 @@ import { TimeValue } from '@react-types/datepicker';
15
15
  import { ListState, SelectState } from 'react-stately';
16
16
  export { Item, Section } from 'react-stately';
17
17
  import * as _chakra_ui_styled_system from '@chakra-ui/styled-system';
18
+ export { useSize } from '@chakra-ui/react-use-size';
18
19
 
19
20
  type DividerProps = DividerProps$1 & {
20
21
  size?: "sm" | "md" | "lg";
@@ -266,7 +267,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
266
267
  *
267
268
  * Defaults to "primary"
268
269
  */
269
- variant?: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
270
+ variant?: "control" | "primary" | "secondary" | "tertiary" | "ghost" | "floating";
270
271
  };
271
272
  /**
272
273
  * Buttons are used to trigger actions.
@@ -276,7 +277,7 @@ type ButtonProps = Exclude<ButtonProps$1, "colorScheme" | "loadingText" | "size"
276
277
  * - `control`: This button is used for ticket controls only.
277
278
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
278
279
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
279
- * - `additional`: Used for additional choices, like a less important secondary action.
280
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
280
281
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
281
282
  * - `floating`: Used for floating actions, like a menu button in a menu.
282
283
  *
@@ -334,7 +335,7 @@ type ButtonGroupProps = ButtonGroupProps$1;
334
335
  declare const ButtonGroup: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", ButtonGroupProps$1>;
335
336
 
336
337
  type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
337
- variant: "control" | "primary" | "secondary" | "additional" | "ghost" | "floating";
338
+ variant: "control" | "primary" | "secondary" | "tertiary" | "ghost" | "floating";
338
339
  };
339
340
  /**
340
341
  * An icon-only button.
@@ -346,7 +347,7 @@ type IconButtonProps = Omit<IconButtonProps$1, "variant"> & {
346
347
  * - `control`: This button is used for ticket controls only.
347
348
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
348
349
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
349
- * - `additional`: Used for additional choices, like a less important secondary action.
350
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
350
351
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
351
352
  * - `floating`: Used for floating actions, like a menu button in a menu.
352
353
  *
@@ -488,9 +489,10 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
488
489
  name?: string;
489
490
  /** The controlled value, if any.
490
491
  *
491
- * A `new Time(hours, minutes)` should be passed
492
+ * A `new Time(hours, minutes)` should be passed.
493
+ * Or `null` if the time should be unset.
492
494
  **/
493
- value?: TimeValue;
495
+ value?: TimeValue | null;
494
496
  /** A default value, if any.
495
497
  *
496
498
  * A `new Time(hours, minutes)` should be passed.
@@ -2363,7 +2365,7 @@ declare const theme: {
2363
2365
  } | undefined;
2364
2366
  defaultProps?: {
2365
2367
  size?: "sm" | "md" | "lg" | "xs" | undefined;
2366
- variant?: "primary" | "secondary" | "ghost" | "floating" | "tertiary" | undefined;
2368
+ variant?: "primary" | "secondary" | "tertiary" | "ghost" | "floating" | undefined;
2367
2369
  colorScheme?: string | undefined;
2368
2370
  } | undefined;
2369
2371
  };
package/dist/index.js CHANGED
@@ -664,7 +664,8 @@ var init_Button = __esm({
664
664
  isLoading,
665
665
  isDisabled,
666
666
  leftIcon,
667
- rightIcon
667
+ rightIcon,
668
+ ...rest
668
669
  } = props;
669
670
  const ariaLabel = useCorrectAriaLabel(props);
670
671
  const buttonGroup = react.useButtonGroup();
@@ -675,7 +676,7 @@ var init_Button = __esm({
675
676
  {
676
677
  size: finalSize,
677
678
  variant: finalVariant,
678
- ...props,
679
+ ...rest,
679
680
  ref,
680
681
  "aria-label": ariaLabel,
681
682
  "aria-busy": isLoading,
@@ -697,8 +698,9 @@ var init_Button = __esm({
697
698
  exports.ColorInlineLoader,
698
699
  {
699
700
  maxWidth: getLoaderWidth(finalSize),
700
- width: "100%",
701
- marginX: 2
701
+ width: "80%",
702
+ marginX: 2,
703
+ marginY: 2
702
704
  }
703
705
  )
704
706
  ),
@@ -739,7 +741,7 @@ var init_IconButton = __esm({
739
741
  {
740
742
  title: props["aria-label"],
741
743
  ...props,
742
- spinner: /* @__PURE__ */ React69__namespace.default.createElement(exports.ColorSpinner, { margin: 1 }),
744
+ spinner: /* @__PURE__ */ React69__namespace.default.createElement(exports.ColorSpinner, { width: "80%", height: "80%", marginX: 1, marginTop: 1 }),
743
745
  ref
744
746
  }
745
747
  )
@@ -1663,7 +1665,7 @@ var init_DateField = __esm({
1663
1665
  "input",
1664
1666
  {
1665
1667
  type: "hidden",
1666
- value: (_a6 = state2.value) == null ? void 0 : _a6.toString(),
1668
+ value: ((_a6 = state2.value) == null ? void 0 : _a6.toString()) ?? "",
1667
1669
  name: props.name
1668
1670
  }
1669
1671
  ));
@@ -4912,7 +4914,7 @@ var init_PopoverWizardBody = __esm({
4912
4914
  return /* @__PURE__ */ React69__namespace.createElement(
4913
4915
  exports.Button,
4914
4916
  {
4915
- variant: "additional",
4917
+ variant: "tertiary",
4916
4918
  size: "sm",
4917
4919
  color: "white",
4918
4920
  leftIcon: isLastStep ? void 0 : /* @__PURE__ */ React69__namespace.createElement(sporIconReact.ArrowRightFill18Icon, null),
@@ -5133,7 +5135,7 @@ var init_StepperStep = __esm({
5133
5135
  exports.Button,
5134
5136
  {
5135
5137
  size: "xs",
5136
- variant: state2 === "active" ? "primary" : state2 === "completed" ? "additional" : "ghost",
5138
+ variant: state2 === "active" ? "primary" : state2 === "completed" ? "tertiary" : "ghost",
5137
5139
  ...adjustedProps,
5138
5140
  onClick: () => onClick(stepNumber)
5139
5141
  },
@@ -11286,7 +11288,7 @@ var init_button2 = __esm({
11286
11288
  primary: (props) => ({
11287
11289
  // FIXME: Update to use a global defined background color for darkMode whenever it is available.
11288
11290
  // hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
11289
- backgroundColor: themeTools.mode("primaryGreen", "coralGreen")(props),
11291
+ backgroundColor: themeTools.mode("pine", "coralGreen")(props),
11290
11292
  color: themeTools.mode("white", "darkTeal")(props),
11291
11293
  ...focusVisible({
11292
11294
  focus: {
@@ -15295,7 +15297,7 @@ var init_ActionToast = __esm({
15295
15297
  buttonText,
15296
15298
  id
15297
15299
  }) => {
15298
- return /* @__PURE__ */ React69__namespace.default.createElement(BaseToast, { variant, id }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { marginRight: 2, flexGrow: "1" }, children), /* @__PURE__ */ React69__namespace.default.createElement(exports.Button, { variant: "additional", size: "sm", onClick }, buttonText));
15300
+ return /* @__PURE__ */ React69__namespace.default.createElement(BaseToast, { variant, id }, /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { marginRight: 2, flexGrow: "1" }, children), /* @__PURE__ */ React69__namespace.default.createElement(exports.Button, { variant: "tertiary", size: "sm", onClick }, buttonText));
15299
15301
  };
15300
15302
  }
15301
15303
  });
@@ -15394,8 +15396,118 @@ var init_transition = __esm({
15394
15396
  "src/transition/index.ts"() {
15395
15397
  }
15396
15398
  });
15399
+
15400
+ // ../../node_modules/@zag-js/element-size/dist/track-size.mjs
15401
+ function trackElementSize(element, callback) {
15402
+ if (!element) {
15403
+ callback(void 0);
15404
+ return;
15405
+ }
15406
+ callback({ width: element.offsetWidth, height: element.offsetHeight });
15407
+ const win = element.ownerDocument.defaultView ?? window;
15408
+ const observer = new win.ResizeObserver((entries) => {
15409
+ if (!Array.isArray(entries) || !entries.length)
15410
+ return;
15411
+ const [entry] = entries;
15412
+ let width;
15413
+ let height;
15414
+ if ("borderBoxSize" in entry) {
15415
+ const borderSizeEntry = entry["borderBoxSize"];
15416
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
15417
+ width = borderSize["inlineSize"];
15418
+ height = borderSize["blockSize"];
15419
+ } else {
15420
+ width = element.offsetWidth;
15421
+ height = element.offsetHeight;
15422
+ }
15423
+ callback({ width, height });
15424
+ });
15425
+ observer.observe(element, { box: "border-box" });
15426
+ return () => observer.unobserve(element);
15427
+ }
15428
+ var init_track_size = __esm({
15429
+ "../../node_modules/@zag-js/element-size/dist/track-size.mjs"() {
15430
+ }
15431
+ });
15432
+
15433
+ // ../../node_modules/@zag-js/element-size/dist/index.mjs
15434
+ var init_dist8 = __esm({
15435
+ "../../node_modules/@zag-js/element-size/dist/index.mjs"() {
15436
+ init_track_size();
15437
+ }
15438
+ });
15439
+ function trackMutation(el, cb) {
15440
+ var _a6, _b5;
15441
+ if (!el || !el.parentElement)
15442
+ return;
15443
+ const win = (_b5 = (_a6 = el.ownerDocument) == null ? void 0 : _a6.defaultView) != null ? _b5 : window;
15444
+ const observer = new win.MutationObserver(() => {
15445
+ cb();
15446
+ });
15447
+ observer.observe(el.parentElement, { childList: true });
15448
+ return () => {
15449
+ observer.disconnect();
15450
+ };
15451
+ }
15452
+ function useSizes({
15453
+ getNodes,
15454
+ observeMutation = true
15455
+ }) {
15456
+ const [sizes26, setSizes] = React69.useState([]);
15457
+ const [count, setCount] = React69.useState(0);
15458
+ useSafeLayoutEffect(() => {
15459
+ const elements = getNodes();
15460
+ const cleanups = elements.map(
15461
+ (element, index) => trackElementSize(element, (size2) => {
15462
+ setSizes((sizes27) => {
15463
+ return [
15464
+ ...sizes27.slice(0, index),
15465
+ size2,
15466
+ ...sizes27.slice(index + 1)
15467
+ ];
15468
+ });
15469
+ })
15470
+ );
15471
+ if (observeMutation) {
15472
+ const firstNode = elements[0];
15473
+ cleanups.push(
15474
+ trackMutation(firstNode, () => {
15475
+ setCount((count2) => count2 + 1);
15476
+ })
15477
+ );
15478
+ }
15479
+ return () => {
15480
+ cleanups.forEach((cleanup) => {
15481
+ cleanup == null ? void 0 : cleanup();
15482
+ });
15483
+ };
15484
+ }, [count]);
15485
+ return sizes26;
15486
+ }
15487
+ function isRef(ref) {
15488
+ return typeof ref === "object" && ref !== null && "current" in ref;
15489
+ }
15490
+ function useSize(subject) {
15491
+ const [size2] = useSizes({
15492
+ observeMutation: false,
15493
+ getNodes() {
15494
+ const node = isRef(subject) ? subject.current : subject;
15495
+ return [node];
15496
+ }
15497
+ });
15498
+ return size2;
15499
+ }
15500
+ var useSafeLayoutEffect;
15501
+ var init_dist9 = __esm({
15502
+ "../../node_modules/@chakra-ui/react-use-size/dist/index.mjs"() {
15503
+ "use client";
15504
+ init_dist8();
15505
+ useSafeLayoutEffect = Boolean(globalThis == null ? void 0 : globalThis.document) ? React69.useLayoutEffect : React69.useEffect;
15506
+ }
15507
+ });
15397
15508
  var init_externals = __esm({
15398
15509
  "src/util/externals.tsx"() {
15510
+ init_dist9();
15399
15511
  }
15400
15512
  });
15401
15513
 
@@ -15462,10 +15574,6 @@ Object.defineProperty(exports, 'Center', {
15462
15574
  enumerable: true,
15463
15575
  get: function () { return react.Center; }
15464
15576
  });
15465
- Object.defineProperty(exports, 'Collapse', {
15466
- enumerable: true,
15467
- get: function () { return react.Collapse; }
15468
- });
15469
15577
  Object.defineProperty(exports, 'Container', {
15470
15578
  enumerable: true,
15471
15579
  get: function () { return react.Container; }
@@ -15682,6 +15790,10 @@ Object.defineProperty(exports, 'WrapItem', {
15682
15790
  enumerable: true,
15683
15791
  get: function () { return react.WrapItem; }
15684
15792
  });
15793
+ Object.defineProperty(exports, 'defineStyleConfig', {
15794
+ enumerable: true,
15795
+ get: function () { return react.defineStyleConfig; }
15796
+ });
15685
15797
  Object.defineProperty(exports, 'extendTheme', {
15686
15798
  enumerable: true,
15687
15799
  get: function () { return react.extendTheme; }
@@ -15761,4 +15873,5 @@ exports.LanguageProvider = LanguageProvider;
15761
15873
  exports.ListBox = ListBox;
15762
15874
  exports.NumericStepper = NumericStepper;
15763
15875
  exports.createTexts = createTexts;
15876
+ exports.useSize = useSize;
15764
15877
  exports.useTranslation = useTranslation;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, Collapse, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToast, useToken, useTranslation } from './chunk-U2IWIWOD.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, Card, CardSelect, Center, Checkbox, CheckboxGroup, ChoiceChip, ClosableAlert, CloseButton, Code, ColorInlineLoader, ColorSpinner, Combobox, Container, ContentLoader, DarkFullScreenLoader, DarkInlineLoader, DarkMode, DarkSpinner, DatePicker, DateRangePicker, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, ModalHeader as DrawerHeader, DrawerOverlay, Expandable, ExpandableAlert, ExpandableItem, Fade, Flex, FloatingActionButton, FormControl, FormErrorMessage, FormHelperText, FormLabel, Grid, GridItem, HStack, Heading, IconButton, Image, Img, InfoSelect, InfoTag, Input, InputGroup, InputLeftElement, InputRightElement, Item, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightMode, LightSpinner, LineIcon, ListBox, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, OrderedList, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, Portal, ProgressBar, ProgressLoader, Radio, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, SimplePopover, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardPopover, Wrap, WrapItem, createTexts, defineStyleConfig, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-VXZX2ZXT.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "4.1.1",
3
+ "version": "5.1.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -28,7 +28,7 @@ export type ButtonProps = Exclude<
28
28
  | "control"
29
29
  | "primary"
30
30
  | "secondary"
31
- | "additional"
31
+ | "tertiary"
32
32
  | "ghost"
33
33
  | "floating";
34
34
  };
@@ -40,7 +40,7 @@ export type ButtonProps = Exclude<
40
40
  * - `control`: This button is used for ticket controls only.
41
41
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
42
42
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
43
- * - `additional`: Used for additional choices, like a less important secondary action.
43
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
44
44
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
45
45
  * - `floating`: Used for floating actions, like a menu button in a menu.
46
46
  *
@@ -69,6 +69,7 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
69
69
  isDisabled,
70
70
  leftIcon,
71
71
  rightIcon,
72
+ ...rest
72
73
  } = props;
73
74
  const ariaLabel = useCorrectAriaLabel(props);
74
75
  const buttonGroup = useButtonGroup();
@@ -83,7 +84,7 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
83
84
  <ChakraButton
84
85
  size={finalSize}
85
86
  variant={finalVariant}
86
- {...props}
87
+ {...rest}
87
88
  ref={ref}
88
89
  aria-label={ariaLabel}
89
90
  aria-busy={isLoading}
@@ -118,8 +119,9 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
118
119
  >
119
120
  <ColorInlineLoader
120
121
  maxWidth={getLoaderWidth(finalSize)}
121
- width="100%"
122
+ width="80%"
122
123
  marginX={2}
124
+ marginY={2}
123
125
  />
124
126
  </Center>
125
127
  )}
@@ -12,7 +12,7 @@ export type IconButtonProps = Omit<ChakraIconButtonProps, "variant"> & {
12
12
  | "control"
13
13
  | "primary"
14
14
  | "secondary"
15
- | "additional"
15
+ | "tertiary"
16
16
  | "ghost"
17
17
  | "floating";
18
18
  };
@@ -26,7 +26,7 @@ export type IconButtonProps = Omit<ChakraIconButtonProps, "variant"> & {
26
26
  * - `control`: This button is used for ticket controls only.
27
27
  * - `primary`: This is our main button. It's used for the main actions in a view, like a call to action. There should only be a single primary button in each view.
28
28
  * - `secondary`: Used for secondary actions in a view, and when you need to make several actions available at the same time.
29
- * - `additional`: Used for additional choices, like a less important secondary action.
29
+ * - `tertiary`: Used for additional choices, like a less important secondary action.
30
30
  * - `ghost`: Used inside other interactive elements, like date pickers and input fields.
31
31
  * - `floating`: Used for floating actions, like a menu button in a menu.
32
32
  *
@@ -56,7 +56,9 @@ export const IconButton = forwardRef<IconButtonProps, As>(
56
56
  <ChakraIconButton
57
57
  title={props["aria-label"]}
58
58
  {...props}
59
- spinner={<ColorSpinner margin={1} />}
59
+ spinner={
60
+ <ColorSpinner width="80%" height="80%" marginX={1} marginTop={1} />
61
+ }
60
62
  ref={ref}
61
63
  />
62
64
  ),
@@ -64,7 +64,7 @@ export const DateField = forwardRef<HTMLDivElement, DateFieldProps>(
64
64
  </Flex>
65
65
  <input
66
66
  type="hidden"
67
- value={state.value?.toString()}
67
+ value={state.value?.toString() ?? ""}
68
68
  name={props.name}
69
69
  />
70
70
  </Box>
@@ -2,13 +2,13 @@ import { Box, Flex } from "@chakra-ui/react";
2
2
  import { CalendarDateTime, Time } from "@internationalized/date";
3
3
  import React, { useRef } from "react";
4
4
  import { AriaTimeFieldProps, useTimeField } from "react-aria";
5
- import { DateFieldState } from "react-stately";
5
+ import { TimeFieldState } from "@react-stately/datepicker";
6
6
  import { FormLabel } from "..";
7
7
  import { DateTimeSegment } from "./DateTimeSegment";
8
8
  import { getTimestampFromTime } from "./utils";
9
9
 
10
10
  type TimeFieldProps = AriaTimeFieldProps<Time> & {
11
- state: DateFieldState;
11
+ state: TimeFieldState;
12
12
  label: string;
13
13
  name?: string;
14
14
  };
@@ -19,9 +19,10 @@ type TimePickerProps = Omit<BoxProps, "defaultValue" | "onChange"> & {
19
19
  name?: string;
20
20
  /** The controlled value, if any.
21
21
  *
22
- * A `new Time(hours, minutes)` should be passed
22
+ * A `new Time(hours, minutes)` should be passed.
23
+ * Or `null` if the time should be unset.
23
24
  **/
24
- value?: TimeValue;
25
+ value?: TimeValue | null;
25
26
  /** A default value, if any.
26
27
  *
27
28
  * A `new Time(hours, minutes)` should be passed.
package/src/index.tsx CHANGED
@@ -1,4 +1,3 @@
1
- export { extendTheme } from "@chakra-ui/react";
2
1
  export * as tokens from "@vygruppen/spor-design-tokens";
3
2
  export * from "./accordion";
4
3
  export * from "./alert";
@@ -64,7 +64,7 @@ const NextStepButton = ({ isLastStep, onNext }: NextStepButtonProps) => {
64
64
  const { t } = useTranslation();
65
65
  return (
66
66
  <Button
67
- variant="additional"
67
+ variant="tertiary"
68
68
  size="sm"
69
69
  color="white"
70
70
  leftIcon={isLastStep ? undefined : <ArrowRightFill18Icon />}
@@ -35,7 +35,7 @@ export const StepperStep = ({
35
35
  state === "active"
36
36
  ? "primary"
37
37
  : state === "completed"
38
- ? "additional"
38
+ ? "tertiary"
39
39
  : "ghost"
40
40
  }
41
41
  {...adjustedProps}
@@ -34,7 +34,7 @@ const config = defineStyleConfig({
34
34
  primary: (props) => ({
35
35
  // FIXME: Update to use a global defined background color for darkMode whenever it is available.
36
36
  // hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
37
- backgroundColor: mode("primaryGreen", "coralGreen")(props),
37
+ backgroundColor: mode("pine", "coralGreen")(props),
38
38
  color: mode("white", "darkTeal")(props),
39
39
  ...focusVisible({
40
40
  focus: {
@@ -20,7 +20,7 @@ export const ActionToast = ({
20
20
  <Box marginRight={2} flexGrow="1">
21
21
  {children}
22
22
  </Box>
23
- <Button variant="additional" size="sm" onClick={onClick}>
23
+ <Button variant="tertiary" size="sm" onClick={onClick}>
24
24
  {buttonText}
25
25
  </Button>
26
26
  </BaseToast>
@@ -1,8 +1,11 @@
1
1
  /** This file works as a proxy for all Chakra UI exports */
2
2
  export {
3
+ Collapse,
3
4
  DarkMode,
4
5
  LightMode,
5
6
  Portal,
7
+ defineStyleConfig,
8
+ extendTheme,
6
9
  useBreakpointValue,
7
10
  useClipboard,
8
11
  useColorMode,
@@ -18,8 +21,11 @@ export {
18
21
  useToken,
19
22
  } from "@chakra-ui/react";
20
23
  export type {
24
+ CSSWithMultiValues,
25
+ ComponentStyleConfig,
21
26
  PortalProps,
22
27
  UseClipboardOptions,
23
28
  UseDisclosureProps,
24
29
  UseOutsideClickProps,
25
30
  } from "@chakra-ui/react";
31
+ export { useSize } from "@chakra-ui/react-use-size";