@vygruppen/spor-react 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
 
2
- > @vygruppen/spor-react@3.2.0 build
2
+ > @vygruppen/spor-react@3.3.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,13 +9,13 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
- "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-QOZMDFH3.mjs".
13
12
  "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/index.js".
13
+ "toZoned" and "toTime" are imported from external module "@internationalized/date" but never used in "dist/chunk-INCE2TKZ.mjs".
14
+ CJS dist/index.js 901.96 KB
15
+ CJS ⚡️ Build success in 4644ms
14
16
  ESM dist/index.mjs 2.01 KB
15
- ESM dist/CountryCodeSelect-YGXVIC6H.mjs 350.82 KB
16
- ESM dist/chunk-QOZMDFH3.mjs 418.96 KB
17
- ESM ⚡️ Build success in 4811ms
18
- CJS dist/index.js 901.54 KB
19
- CJS ⚡️ Build success in 4811ms
20
- DTS ⚡️ Build success in 17792ms
21
- DTS dist/index.d.ts 251.71 KB
17
+ ESM dist/CountryCodeSelect-YQHGPTOR.mjs 350.82 KB
18
+ ESM dist/chunk-INCE2TKZ.mjs 419.29 KB
19
+ ESM ⚡️ Build success in 4645ms
20
+ DTS ⚡️ Build success in 17821ms
21
+ DTS dist/index.d.ts 251.94 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 81c256bc: Accordion: Add new prop "spacing" for adding spacing between items.
8
+ Accordion: Do some design tweaks
9
+
3
10
  ## 3.2.0
4
11
 
5
12
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-QOZMDFH3.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-INCE2TKZ.mjs';
2
2
  import React from 'react';
3
3
 
4
4
  // ../../node_modules/awesome-phonenumber/index-esm.mjs
@@ -1,4 +1,4 @@
1
- import { forwardRef, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Box, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, Stack as Stack$1, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, useMultiStyleConfig, FormLabel, Flex, useFormControlContext, useBreakpointValue, Popover, InputGroup, PopoverAnchor, Portal, PopoverContent, PopoverArrow, PopoverBody, 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, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverTrigger, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
1
+ import { forwardRef, Box, Stack as Stack$1, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Button as Button$1, Center, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useStyleConfig, Badge as Badge$1, Code as Code$1, Text, useMultiStyleConfig, FormLabel, Flex, useFormControlContext, useBreakpointValue, Popover, InputGroup, PopoverAnchor, Portal, PopoverContent, PopoverArrow, PopoverBody, 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, SkeletonCircle as SkeletonCircle$1, SkeletonText as SkeletonText$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useColorModeValue, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverTrigger, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
2
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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, ScaleFade, SimpleGrid, Slide, SlideFade, Spacer, Tab, TabList, TabPanel, TabPanels, TableCaption, Tbody, Td, Tfoot, Th, Thead, Tr, VStack, Wrap, WrapItem, extendTheme, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useTheme, useToken } from '@chakra-ui/react';
3
3
  import tokens10__default from '@vygruppen/spor-design-tokens';
4
4
  import * as tokens10 from '@vygruppen/spor-design-tokens';
@@ -769,6 +769,26 @@ var require_lodash = __commonJS({
769
769
  module.exports = mergeWith5;
770
770
  }
771
771
  });
772
+ var Divider = forwardRef((props, ref) => {
773
+ return /* @__PURE__ */ React49__default.createElement(
774
+ Box,
775
+ {
776
+ as: "hr",
777
+ height: "2px",
778
+ border: "0",
779
+ borderRadius: "1px",
780
+ backgroundColor: "blackAlpha.200",
781
+ width: "100%",
782
+ ...props,
783
+ ref
784
+ }
785
+ );
786
+ });
787
+ var Stack = forwardRef(
788
+ ({ flexDirection, ...props }, ref) => {
789
+ return /* @__PURE__ */ React49__default.createElement(Stack$1, { ...props, direction: flexDirection, ref });
790
+ }
791
+ );
772
792
  var AccordionContext = React49__default.createContext(null);
773
793
  var AccordionProvider = ({
774
794
  size: size2,
@@ -785,17 +805,20 @@ var useAccordionContext = () => {
785
805
  }
786
806
  return context;
787
807
  };
788
- var Accordion = forwardRef((props, ref) => {
789
- const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
790
- return /* @__PURE__ */ React49__default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React49__default.createElement(
791
- Accordion$1,
792
- {
793
- ...props,
794
- ref,
795
- defaultIndex
796
- }
797
- ));
798
- });
808
+ var Accordion = forwardRef(
809
+ ({ children, spacing: spacing3 = 2, ...props }, ref) => {
810
+ const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
811
+ return /* @__PURE__ */ React49__default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React49__default.createElement(
812
+ Accordion$1,
813
+ {
814
+ ...props,
815
+ ref,
816
+ defaultIndex
817
+ },
818
+ /* @__PURE__ */ React49__default.createElement(Stack, { spacing: spacing3 }, children)
819
+ ));
820
+ }
821
+ );
799
822
  var Expandable = ({
800
823
  children,
801
824
  headingLevel,
@@ -823,7 +846,7 @@ var ExpandableItem = ({
823
846
  }) => {
824
847
  const { size: size2 } = useAccordionContext();
825
848
  warnAboutMismatchingIcon({ icon: leftIcon, size: size2 });
826
- return /* @__PURE__ */ React49__default.createElement(AccordionItem, { ...rest }, /* @__PURE__ */ React49__default.createElement(Box, { as: headingLevel }, /* @__PURE__ */ React49__default.createElement(AccordionButton, null, /* @__PURE__ */ React49__default.createElement(Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React49__default.createElement(Box, { mr: 2 }, leftIcon), title), /* @__PURE__ */ React49__default.createElement(AccordionIcon, null))), /* @__PURE__ */ React49__default.createElement(AccordionPanel, null, children));
849
+ return /* @__PURE__ */ React49__default.createElement(AccordionItem, { ...rest }, /* @__PURE__ */ React49__default.createElement(Box, { as: headingLevel }, /* @__PURE__ */ React49__default.createElement(AccordionButton, null, /* @__PURE__ */ React49__default.createElement(Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React49__default.createElement(Box, { marginRight: 1 }, leftIcon), title), /* @__PURE__ */ React49__default.createElement(AccordionIcon, null))), /* @__PURE__ */ React49__default.createElement(AccordionPanel, null, children));
827
850
  };
828
851
  var warnAboutMismatchingIcon = ({ icon, size: size2 }) => {
829
852
  var _a6, _b5;
@@ -1501,28 +1524,6 @@ var ExpandableAlert = ({
1501
1524
  var StaticAlert = ({ children, ...props }) => {
1502
1525
  return /* @__PURE__ */ React49__default.createElement(BaseAlert, { ...props }, /* @__PURE__ */ React49__default.createElement(AlertIcon, { variant: props.variant }), children);
1503
1526
  };
1504
- var Divider = forwardRef((props, ref) => {
1505
- return /* @__PURE__ */ React49__default.createElement(
1506
- Box,
1507
- {
1508
- as: "hr",
1509
- height: "2px",
1510
- border: "0",
1511
- borderRadius: "1px",
1512
- backgroundColor: "blackAlpha.200",
1513
- width: "100%",
1514
- ...props,
1515
- ref
1516
- }
1517
- );
1518
- });
1519
- var Stack = forwardRef(
1520
- ({ flexDirection, ...props }, ref) => {
1521
- return /* @__PURE__ */ React49__default.createElement(Stack$1, { ...props, direction: flexDirection, ref });
1522
- }
1523
- );
1524
-
1525
- // src/card/Card.tsx
1526
1527
  var Card = forwardRef(
1527
1528
  ({ size: size2 = "sm", colorScheme = "white", children, ...props }, ref) => {
1528
1529
  const styles2 = useStyleConfig("Card", {
@@ -5269,7 +5270,7 @@ var texts13 = createTexts({
5269
5270
  sv: "Telefonnummer"
5270
5271
  }
5271
5272
  });
5272
- var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-YGXVIC6H.mjs'));
5273
+ var LazyCountryCodeSelect = React49__default.lazy(() => import('./CountryCodeSelect-YQHGPTOR.mjs'));
5273
5274
  var Radio = forwardRef((props, ref) => {
5274
5275
  return /* @__PURE__ */ React49__default.createElement(Radio$1, { ...props, ref });
5275
5276
  });
@@ -10941,6 +10942,7 @@ var config3 = helpers.defineMultiStyleConfig({
10941
10942
  justifyContent: "space-between",
10942
10943
  color: "darkGrey",
10943
10944
  textAlign: "left",
10945
+ fontWeight: "bold",
10944
10946
  ...focusVisible({
10945
10947
  notFocus: {
10946
10948
  boxShadow: getBoxShadowString({
@@ -10960,8 +10962,7 @@ var config3 = helpers.defineMultiStyleConfig({
10960
10962
  }
10961
10963
  },
10962
10964
  panel: {
10963
- pt: 2,
10964
- pb: 5,
10965
+ paddingY: 2,
10965
10966
  borderBottomRadius: "sm"
10966
10967
  },
10967
10968
  icon: {
@@ -10976,8 +10977,7 @@ var config3 = helpers.defineMultiStyleConfig({
10976
10977
  backgroundColor: "seaMist"
10977
10978
  },
10978
10979
  _active: {
10979
- backgroundColor: "mint",
10980
- boxShadow: getBoxShadowString({ borderColor: "darkGrey" })
10980
+ backgroundColor: "mint"
10981
10981
  }
10982
10982
  }
10983
10983
  },
@@ -11007,7 +11007,10 @@ var config3 = helpers.defineMultiStyleConfig({
11007
11007
  },
11008
11008
  card: {
11009
11009
  container: {
11010
- boxShadow: "md"
11010
+ boxShadow: getBoxShadowString({
11011
+ baseShadow: "sm",
11012
+ borderColor: "silver"
11013
+ })
11011
11014
  },
11012
11015
  button: {
11013
11016
  _expanded: {
@@ -11026,31 +11029,34 @@ var config3 = helpers.defineMultiStyleConfig({
11026
11029
  sm: {
11027
11030
  button: {
11028
11031
  fontSize: "desktop.xs",
11029
- px: 2,
11030
- py: 1
11032
+ paddingX: 2,
11033
+ paddingY: 1
11031
11034
  },
11032
11035
  panel: {
11033
- px: 2
11036
+ fontSize: "desktop.xs",
11037
+ paddingX: 2
11034
11038
  }
11035
11039
  },
11036
11040
  md: {
11037
11041
  button: {
11038
11042
  fontSize: "desktop.sm",
11039
- px: 3,
11040
- py: 1
11043
+ paddingX: 3,
11044
+ paddingY: 1
11041
11045
  },
11042
11046
  panel: {
11043
- px: 3
11047
+ fontSize: "desktop.sm",
11048
+ paddingX: 3
11044
11049
  }
11045
11050
  },
11046
11051
  lg: {
11047
11052
  button: {
11048
11053
  fontSize: "desktop.sm",
11049
- px: 3,
11050
- py: 2
11054
+ paddingX: 3,
11055
+ paddingY: 2
11051
11056
  },
11052
11057
  panel: {
11053
- px: 3
11058
+ fontSize: "desktop.sm",
11059
+ paddingX: 3
11054
11060
  }
11055
11061
  }
11056
11062
  },
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AccordionProps as AccordionProps$1, AccordionItemProps, BoxProps, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, As, StackProps as StackProps$1, 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';
1
+ import { BoxProps, As, StackProps as StackProps$1, AccordionProps as AccordionProps$1, AccordionItemProps, ButtonProps as ButtonProps$1, ButtonGroupProps as ButtonGroupProps$1, IconButtonProps as IconButtonProps$1, 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
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, Modal, ModalBody, ModalBodyProps, ModalCloseButton, ModalContent, ModalContentProps, ModalFooter, ModalFooterProps, ModalOverlay, ModalOverlayProps, ModalProps, Popover, PopoverAnchor, PopoverArrow, PopoverArrowProps, PopoverBody, PopoverBodyProps, PopoverCloseButton, PopoverCloseButtonProps, PopoverContent, PopoverContentProps, PopoverFooter, PopoverFooterProps, PopoverHeader, PopoverHeaderProps, PopoverProps, PopoverTrigger, 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, 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
3
  import tokens__default from '@vygruppen/spor-design-tokens';
4
4
  import * as tokens from '@vygruppen/spor-design-tokens';
@@ -15,6 +15,49 @@ export { Item, Section } from 'react-stately';
15
15
  import * as _chakra_ui_theme_tools_dist_component from '@chakra-ui/theme-tools/dist/component';
16
16
  import * as _chakra_ui_styled_system from '@chakra-ui/styled-system';
17
17
 
18
+ type DividerProps = BoxProps;
19
+ /** A dividing line, used to divide content.
20
+ *
21
+ * You can specify margins if you need to give the content some space, or use a `Stack` component to do it for you
22
+ *
23
+ * ```tsx
24
+ * <Divider mt={4} mb={6} />
25
+ * ```
26
+ */
27
+ declare const Divider: _chakra_ui_system_dist_system_types.ComponentWithAs<As, BoxProps>;
28
+
29
+ type StackProps = Exclude<StackProps$1, "direction"> & {
30
+ flexDirection?: StackProps$1["direction"];
31
+ };
32
+ /**
33
+ * Adds consistent spacing between elements
34
+ *
35
+ * ```tsx
36
+ * <Stack>
37
+ * <Text>Here's a paragraph</Text>
38
+ * <Text>Here's another perfectly spaced paragraph</Text>
39
+ * </Stack>
40
+ * ```
41
+ *
42
+ * By default, the stack will be a column. You can change this by setting the `flexDirection` prop to any valid flex direction:
43
+ * ```tsx
44
+ * <Stack flexDirection="row">
45
+ * <Checkbox>Here's a checkbox</Checkbox>
46
+ * <Checkbox>Here's another checkbox, almost right next to the first one</Checkbox>
47
+ * </Stack>
48
+ * ```
49
+ *
50
+ * You can specify the spacing between elements with the `spacing` prop:
51
+ *
52
+ * ```tsx
53
+ * <Stack spacing={4}>
54
+ * <Card>Here's one card</Card>
55
+ * <Card>Here's another card, with a lot of space between it</Card>
56
+ * </Stack>
57
+ * ```
58
+ */
59
+ declare const Stack: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", StackProps>;
60
+
18
61
  type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
19
62
  /**
20
63
  * The display variant of the accordion items.
@@ -25,6 +68,8 @@ type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
25
68
  */
26
69
  variant?: "list" | "outline" | "card";
27
70
  size?: "sm" | "md" | "lg";
71
+ /** The margin between accordion items */
72
+ spacing?: StackProps["spacing"];
28
73
  };
29
74
  /**
30
75
  * Wraps a set of ExpandableItem or AccordionItem components.
@@ -337,49 +382,6 @@ type FloatingActionButtonProps = BoxProps & {
337
382
  */
338
383
  declare const FloatingActionButton: ({ children, icon, variant, isTextVisible: externalIsTextVisible, placement, ...props }: FloatingActionButtonProps) => React__default.JSX.Element;
339
384
 
340
- type DividerProps = BoxProps;
341
- /** A dividing line, used to divide content.
342
- *
343
- * You can specify margins if you need to give the content some space, or use a `Stack` component to do it for you
344
- *
345
- * ```tsx
346
- * <Divider mt={4} mb={6} />
347
- * ```
348
- */
349
- declare const Divider: _chakra_ui_system_dist_system_types.ComponentWithAs<As, BoxProps>;
350
-
351
- type StackProps = Exclude<StackProps$1, "direction"> & {
352
- flexDirection?: StackProps$1["direction"];
353
- };
354
- /**
355
- * Adds consistent spacing between elements
356
- *
357
- * ```tsx
358
- * <Stack>
359
- * <Text>Here's a paragraph</Text>
360
- * <Text>Here's another perfectly spaced paragraph</Text>
361
- * </Stack>
362
- * ```
363
- *
364
- * By default, the stack will be a column. You can change this by setting the `flexDirection` prop to any valid flex direction:
365
- * ```tsx
366
- * <Stack flexDirection="row">
367
- * <Checkbox>Here's a checkbox</Checkbox>
368
- * <Checkbox>Here's another checkbox, almost right next to the first one</Checkbox>
369
- * </Stack>
370
- * ```
371
- *
372
- * You can specify the spacing between elements with the `spacing` prop:
373
- *
374
- * ```tsx
375
- * <Stack spacing={4}>
376
- * <Card>Here's one card</Card>
377
- * <Card>Here's another card, with a lot of space between it</Card>
378
- * </Stack>
379
- * ```
380
- */
381
- declare const Stack: _chakra_ui_system_dist_system_types.ComponentWithAs<"div", StackProps>;
382
-
383
385
  type CardProps = Exclude<BoxProps, "size"> & {
384
386
  size?: "sm" | "lg";
385
387
  children: React__default.ReactNode;
@@ -1949,10 +1951,10 @@ declare const theme: {
1949
1951
  justifyContent: string;
1950
1952
  color: string;
1951
1953
  textAlign: string;
1954
+ fontWeight: string;
1952
1955
  };
1953
1956
  panel: {
1954
- pt: number;
1955
- pb: number;
1957
+ paddingY: number;
1956
1958
  borderBottomRadius: string;
1957
1959
  };
1958
1960
  icon: {
@@ -1963,31 +1965,34 @@ declare const theme: {
1963
1965
  sm: {
1964
1966
  button: {
1965
1967
  fontSize: string;
1966
- px: number;
1967
- py: number;
1968
+ paddingX: number;
1969
+ paddingY: number;
1968
1970
  };
1969
1971
  panel: {
1970
- px: number;
1972
+ fontSize: string;
1973
+ paddingX: number;
1971
1974
  };
1972
1975
  };
1973
1976
  md: {
1974
1977
  button: {
1975
1978
  fontSize: string;
1976
- px: number;
1977
- py: number;
1979
+ paddingX: number;
1980
+ paddingY: number;
1978
1981
  };
1979
1982
  panel: {
1980
- px: number;
1983
+ fontSize: string;
1984
+ paddingX: number;
1981
1985
  };
1982
1986
  };
1983
1987
  lg: {
1984
1988
  button: {
1985
1989
  fontSize: string;
1986
- px: number;
1987
- py: number;
1990
+ paddingX: number;
1991
+ paddingY: number;
1988
1992
  };
1989
1993
  panel: {
1990
- px: number;
1994
+ fontSize: string;
1995
+ paddingX: number;
1991
1996
  };
1992
1997
  };
1993
1998
  } | undefined;
@@ -2000,7 +2005,6 @@ declare const theme: {
2000
2005
  };
2001
2006
  _active: {
2002
2007
  backgroundColor: string;
2003
- boxShadow: string;
2004
2008
  };
2005
2009
  };
2006
2010
  };
@@ -3457,12 +3461,12 @@ declare const theme: {
3457
3461
  }) | undefined;
3458
3462
  sizes?: {
3459
3463
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
3460
- keys: ("element" | "group" | "addon" | "field")[];
3464
+ keys: ("group" | "element" | "addon" | "field")[];
3461
3465
  }>;
3462
3466
  } | undefined;
3463
3467
  variants?: {
3464
3468
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
3465
- keys: ("element" | "group" | "addon" | "field")[];
3469
+ keys: ("group" | "element" | "addon" | "field")[];
3466
3470
  }>;
3467
3471
  } | undefined;
3468
3472
  defaultProps?: {
@@ -3470,7 +3474,7 @@ declare const theme: {
3470
3474
  variant?: string | number | undefined;
3471
3475
  colorScheme?: string | undefined;
3472
3476
  } | undefined;
3473
- parts: ("element" | "group" | "addon" | "field")[];
3477
+ parts: ("group" | "element" | "addon" | "field")[];
3474
3478
  };
3475
3479
  LineIcon: {
3476
3480
  baseStyle?: {
@@ -5212,7 +5216,7 @@ declare const theme: {
5212
5216
  sizes?: {
5213
5217
  "2xs": {
5214
5218
  container: {
5215
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | {
5219
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | {
5216
5220
  sm: string;
5217
5221
  md: string;
5218
5222
  lg: string;
@@ -5220,7 +5224,7 @@ declare const theme: {
5220
5224
  } | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96;
5221
5225
  };
5222
5226
  excessLabel: {
5223
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5227
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5224
5228
  sm: string;
5225
5229
  md: string;
5226
5230
  lg: string;
@@ -5230,7 +5234,7 @@ declare const theme: {
5230
5234
  };
5231
5235
  xs: {
5232
5236
  container: {
5233
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5237
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5234
5238
  sm: string;
5235
5239
  md: string;
5236
5240
  lg: string;
@@ -5238,7 +5242,7 @@ declare const theme: {
5238
5242
  };
5239
5243
  };
5240
5244
  excessLabel: {
5241
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5245
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5242
5246
  sm: string;
5243
5247
  md: string;
5244
5248
  lg: string;
@@ -5248,7 +5252,7 @@ declare const theme: {
5248
5252
  };
5249
5253
  sm: {
5250
5254
  container: {
5251
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5255
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5252
5256
  sm: string;
5253
5257
  md: string;
5254
5258
  lg: string;
@@ -5256,7 +5260,7 @@ declare const theme: {
5256
5260
  };
5257
5261
  };
5258
5262
  excessLabel: {
5259
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5263
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5260
5264
  sm: string;
5261
5265
  md: string;
5262
5266
  lg: string;
@@ -5266,7 +5270,7 @@ declare const theme: {
5266
5270
  };
5267
5271
  md: {
5268
5272
  container: {
5269
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5273
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5270
5274
  sm: string;
5271
5275
  md: string;
5272
5276
  lg: string;
@@ -5274,7 +5278,7 @@ declare const theme: {
5274
5278
  };
5275
5279
  };
5276
5280
  excessLabel: {
5277
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5281
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5278
5282
  sm: string;
5279
5283
  md: string;
5280
5284
  lg: string;
@@ -5284,7 +5288,7 @@ declare const theme: {
5284
5288
  };
5285
5289
  lg: {
5286
5290
  container: {
5287
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5291
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5288
5292
  sm: string;
5289
5293
  md: string;
5290
5294
  lg: string;
@@ -5292,7 +5296,7 @@ declare const theme: {
5292
5296
  };
5293
5297
  };
5294
5298
  excessLabel: {
5295
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5299
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5296
5300
  sm: string;
5297
5301
  md: string;
5298
5302
  lg: string;
@@ -5302,7 +5306,7 @@ declare const theme: {
5302
5306
  };
5303
5307
  xl: {
5304
5308
  container: {
5305
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5309
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5306
5310
  sm: string;
5307
5311
  md: string;
5308
5312
  lg: string;
@@ -5310,7 +5314,7 @@ declare const theme: {
5310
5314
  };
5311
5315
  };
5312
5316
  excessLabel: {
5313
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5317
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5314
5318
  sm: string;
5315
5319
  md: string;
5316
5320
  lg: string;
@@ -5320,7 +5324,7 @@ declare const theme: {
5320
5324
  };
5321
5325
  "2xl": {
5322
5326
  container: {
5323
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5327
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5324
5328
  sm: string;
5325
5329
  md: string;
5326
5330
  lg: string;
@@ -5328,7 +5332,7 @@ declare const theme: {
5328
5332
  };
5329
5333
  };
5330
5334
  excessLabel: {
5331
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5335
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5332
5336
  sm: string;
5333
5337
  md: string;
5334
5338
  lg: string;
@@ -5338,7 +5342,7 @@ declare const theme: {
5338
5342
  };
5339
5343
  full: {
5340
5344
  container: {
5341
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5345
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5342
5346
  sm: string;
5343
5347
  md: string;
5344
5348
  lg: string;
@@ -5346,7 +5350,7 @@ declare const theme: {
5346
5350
  };
5347
5351
  };
5348
5352
  excessLabel: {
5349
- [x: string]: string | 1 | 2 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5353
+ [x: string]: string | 2 | 1 | 3 | 6 | 4 | 5 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 0.5 | 1.5 | 24 | 60 | 2.5 | 3.5 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 64 | 72 | 80 | 96 | {
5350
5354
  sm: string;
5351
5355
  md: string;
5352
5356
  lg: string;
@@ -5734,12 +5738,12 @@ declare const theme: {
5734
5738
  } | undefined;
5735
5739
  sizes?: {
5736
5740
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
5737
- keys: ("button" | "list" | "icon" | "divider" | "item" | "groupTitle" | "command")[];
5741
+ keys: ("button" | "list" | "divider" | "icon" | "item" | "groupTitle" | "command")[];
5738
5742
  }>;
5739
5743
  } | undefined;
5740
5744
  variants?: {
5741
5745
  [key: string]: _chakra_ui_styled_system.PartsStyleInterpolation<{
5742
- keys: ("button" | "list" | "icon" | "divider" | "item" | "groupTitle" | "command")[];
5746
+ keys: ("button" | "list" | "divider" | "icon" | "item" | "groupTitle" | "command")[];
5743
5747
  }>;
5744
5748
  } | undefined;
5745
5749
  defaultProps?: {
@@ -5747,7 +5751,7 @@ declare const theme: {
5747
5751
  variant?: string | number | undefined;
5748
5752
  colorScheme?: string | undefined;
5749
5753
  } | undefined;
5750
- parts: ("button" | "list" | "icon" | "divider" | "item" | "groupTitle" | "command")[];
5754
+ parts: ("button" | "list" | "divider" | "icon" | "item" | "groupTitle" | "command")[];
5751
5755
  };
5752
5756
  NumberInput: {
5753
5757
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
@@ -6620,8 +6624,8 @@ declare const theme: {
6620
6624
  "7xl": string;
6621
6625
  "8xl": string;
6622
6626
  0: string;
6623
- 1: string;
6624
6627
  2: string;
6628
+ 1: string;
6625
6629
  3: string;
6626
6630
  6: string;
6627
6631
  4: string;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var React49 = require('react');
4
3
  var react = require('@chakra-ui/react');
4
+ var React49 = require('react');
5
5
  var lottieReact = require('lottie-react');
6
6
  var sporLoader = require('@vygruppen/spor-loader');
7
7
  var reactAria = require('react-aria');
@@ -67,6 +67,42 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
67
67
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
68
68
  mod
69
69
  ));
70
+ exports.Divider = void 0;
71
+ var init_Divider = __esm({
72
+ "src/layout/Divider.tsx"() {
73
+ exports.Divider = react.forwardRef((props, ref) => {
74
+ return /* @__PURE__ */ React49__namespace.default.createElement(
75
+ react.Box,
76
+ {
77
+ as: "hr",
78
+ height: "2px",
79
+ border: "0",
80
+ borderRadius: "1px",
81
+ backgroundColor: "blackAlpha.200",
82
+ width: "100%",
83
+ ...props,
84
+ ref
85
+ }
86
+ );
87
+ });
88
+ }
89
+ });
90
+ exports.Stack = void 0;
91
+ var init_Stack = __esm({
92
+ "src/layout/Stack.tsx"() {
93
+ exports.Stack = react.forwardRef(
94
+ ({ flexDirection, ...props }, ref) => {
95
+ return /* @__PURE__ */ React49__namespace.default.createElement(react.Stack, { ...props, direction: flexDirection, ref });
96
+ }
97
+ );
98
+ }
99
+ });
100
+ var init_layout = __esm({
101
+ "src/layout/index.tsx"() {
102
+ init_Divider();
103
+ init_Stack();
104
+ }
105
+ });
70
106
  var AccordionContext, AccordionProvider, useAccordionContext;
71
107
  var init_AccordionContext = __esm({
72
108
  "src/accordion/AccordionContext.tsx"() {
@@ -91,18 +127,22 @@ var init_AccordionContext = __esm({
91
127
  exports.Accordion = void 0;
92
128
  var init_Accordion = __esm({
93
129
  "src/accordion/Accordion.tsx"() {
130
+ init_layout();
94
131
  init_AccordionContext();
95
- exports.Accordion = react.forwardRef((props, ref) => {
96
- const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
97
- return /* @__PURE__ */ React49__namespace.default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React49__namespace.default.createElement(
98
- react.Accordion,
99
- {
100
- ...props,
101
- ref,
102
- defaultIndex
103
- }
104
- ));
105
- });
132
+ exports.Accordion = react.forwardRef(
133
+ ({ children, spacing: spacing3 = 2, ...props }, ref) => {
134
+ const defaultIndex = typeof props.defaultIndex === "number" && props.allowMultiple ? [props.defaultIndex] : props.defaultIndex;
135
+ return /* @__PURE__ */ React49__namespace.default.createElement(AccordionProvider, { size: props.size }, /* @__PURE__ */ React49__namespace.default.createElement(
136
+ react.Accordion,
137
+ {
138
+ ...props,
139
+ ref,
140
+ defaultIndex
141
+ },
142
+ /* @__PURE__ */ React49__namespace.default.createElement(exports.Stack, { spacing: spacing3 }, children)
143
+ ));
144
+ }
145
+ );
106
146
  }
107
147
  });
108
148
  exports.Expandable = void 0; exports.ExpandableItem = void 0; var warnAboutMismatchingIcon;
@@ -137,7 +177,7 @@ var init_Expandable = __esm({
137
177
  }) => {
138
178
  const { size: size2 } = useAccordionContext();
139
179
  warnAboutMismatchingIcon({ icon: leftIcon, size: size2 });
140
- return /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionItem, { ...rest }, /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { as: headingLevel }, /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionButton, null, /* @__PURE__ */ React49__namespace.default.createElement(react.Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { mr: 2 }, leftIcon), title), /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionIcon, null))), /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionPanel, null, children));
180
+ return /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionItem, { ...rest }, /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { as: headingLevel }, /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionButton, null, /* @__PURE__ */ React49__namespace.default.createElement(react.Flex, { alignItems: "center" }, leftIcon && /* @__PURE__ */ React49__namespace.default.createElement(react.Box, { marginRight: 1 }, leftIcon), title), /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionIcon, null))), /* @__PURE__ */ React49__namespace.default.createElement(react.AccordionPanel, null, children));
141
181
  };
142
182
  warnAboutMismatchingIcon = ({ icon, size: size2 }) => {
143
183
  var _a6, _b5;
@@ -1035,42 +1075,6 @@ var init_alert = __esm({
1035
1075
  init_StaticAlert();
1036
1076
  }
1037
1077
  });
1038
- exports.Divider = void 0;
1039
- var init_Divider = __esm({
1040
- "src/layout/Divider.tsx"() {
1041
- exports.Divider = react.forwardRef((props, ref) => {
1042
- return /* @__PURE__ */ React49__namespace.default.createElement(
1043
- react.Box,
1044
- {
1045
- as: "hr",
1046
- height: "2px",
1047
- border: "0",
1048
- borderRadius: "1px",
1049
- backgroundColor: "blackAlpha.200",
1050
- width: "100%",
1051
- ...props,
1052
- ref
1053
- }
1054
- );
1055
- });
1056
- }
1057
- });
1058
- exports.Stack = void 0;
1059
- var init_Stack = __esm({
1060
- "src/layout/Stack.tsx"() {
1061
- exports.Stack = react.forwardRef(
1062
- ({ flexDirection, ...props }, ref) => {
1063
- return /* @__PURE__ */ React49__namespace.default.createElement(react.Stack, { ...props, direction: flexDirection, ref });
1064
- }
1065
- );
1066
- }
1067
- });
1068
- var init_layout = __esm({
1069
- "src/layout/index.tsx"() {
1070
- init_Divider();
1071
- init_Stack();
1072
- }
1073
- });
1074
1078
  exports.Card = void 0;
1075
1079
  var init_Card = __esm({
1076
1080
  "src/card/Card.tsx"() {
@@ -18931,6 +18935,7 @@ var init_accordion2 = __esm({
18931
18935
  justifyContent: "space-between",
18932
18936
  color: "darkGrey",
18933
18937
  textAlign: "left",
18938
+ fontWeight: "bold",
18934
18939
  ...focusVisible({
18935
18940
  notFocus: {
18936
18941
  boxShadow: getBoxShadowString({
@@ -18950,8 +18955,7 @@ var init_accordion2 = __esm({
18950
18955
  }
18951
18956
  },
18952
18957
  panel: {
18953
- pt: 2,
18954
- pb: 5,
18958
+ paddingY: 2,
18955
18959
  borderBottomRadius: "sm"
18956
18960
  },
18957
18961
  icon: {
@@ -18966,8 +18970,7 @@ var init_accordion2 = __esm({
18966
18970
  backgroundColor: "seaMist"
18967
18971
  },
18968
18972
  _active: {
18969
- backgroundColor: "mint",
18970
- boxShadow: getBoxShadowString({ borderColor: "darkGrey" })
18973
+ backgroundColor: "mint"
18971
18974
  }
18972
18975
  }
18973
18976
  },
@@ -18997,7 +19000,10 @@ var init_accordion2 = __esm({
18997
19000
  },
18998
19001
  card: {
18999
19002
  container: {
19000
- boxShadow: "md"
19003
+ boxShadow: getBoxShadowString({
19004
+ baseShadow: "sm",
19005
+ borderColor: "silver"
19006
+ })
19001
19007
  },
19002
19008
  button: {
19003
19009
  _expanded: {
@@ -19016,31 +19022,34 @@ var init_accordion2 = __esm({
19016
19022
  sm: {
19017
19023
  button: {
19018
19024
  fontSize: "desktop.xs",
19019
- px: 2,
19020
- py: 1
19025
+ paddingX: 2,
19026
+ paddingY: 1
19021
19027
  },
19022
19028
  panel: {
19023
- px: 2
19029
+ fontSize: "desktop.xs",
19030
+ paddingX: 2
19024
19031
  }
19025
19032
  },
19026
19033
  md: {
19027
19034
  button: {
19028
19035
  fontSize: "desktop.sm",
19029
- px: 3,
19030
- py: 1
19036
+ paddingX: 3,
19037
+ paddingY: 1
19031
19038
  },
19032
19039
  panel: {
19033
- px: 3
19040
+ fontSize: "desktop.sm",
19041
+ paddingX: 3
19034
19042
  }
19035
19043
  },
19036
19044
  lg: {
19037
19045
  button: {
19038
19046
  fontSize: "desktop.sm",
19039
- px: 3,
19040
- py: 2
19047
+ paddingX: 3,
19048
+ paddingY: 2
19041
19049
  },
19042
19050
  panel: {
19043
- px: 3
19051
+ fontSize: "desktop.sm",
19052
+ paddingX: 3
19044
19053
  }
19045
19054
  }
19046
19055
  },
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, 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, 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-QOZMDFH3.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, 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, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalOverlay, NativeSelect, NumericStepper, PasswordInput, PhoneNumberInput, PlayPauseButton, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, PopoverWizardBody, 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, 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-INCE2TKZ.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  Accordion as ChakraAccordion,
3
3
  AccordionProps as ChakraAccordionProps,
4
- As,
5
4
  forwardRef,
6
5
  } from "@chakra-ui/react";
7
6
  import React from "react";
7
+ import { Stack, StackProps } from "../layout";
8
8
  import { AccordionProvider } from "./AccordionContext";
9
9
  export {
10
10
  AccordionButton,
@@ -28,6 +28,8 @@ export type AccordionProps = Omit<ChakraAccordionProps, "variant" | "size"> & {
28
28
  */
29
29
  variant?: "list" | "outline" | "card";
30
30
  size?: "sm" | "md" | "lg";
31
+ /** The margin between accordion items */
32
+ spacing?: StackProps["spacing"];
31
33
  };
32
34
  /**
33
35
  * Wraps a set of ExpandableItem or AccordionItem components.
@@ -45,18 +47,22 @@ export type AccordionProps = Omit<ChakraAccordionProps, "variant" | "size"> & {
45
47
  *
46
48
  * If you only have one expandable item, you can use the `<Expandable />` component instead.
47
49
  */
48
- export const Accordion = forwardRef<AccordionProps, "div">((props, ref) => {
49
- const defaultIndex =
50
- typeof props.defaultIndex === "number" && props.allowMultiple
51
- ? [props.defaultIndex]
52
- : props.defaultIndex;
53
- return (
54
- <AccordionProvider size={props.size}>
55
- <ChakraAccordion
56
- {...props}
57
- ref={ref}
58
- defaultIndex={defaultIndex as number[] | undefined}
59
- />
60
- </AccordionProvider>
61
- );
62
- });
50
+ export const Accordion = forwardRef<AccordionProps, "div">(
51
+ ({ children, spacing = 2, ...props }, ref) => {
52
+ const defaultIndex =
53
+ typeof props.defaultIndex === "number" && props.allowMultiple
54
+ ? [props.defaultIndex]
55
+ : props.defaultIndex;
56
+ return (
57
+ <AccordionProvider size={props.size}>
58
+ <ChakraAccordion
59
+ {...props}
60
+ ref={ref}
61
+ defaultIndex={defaultIndex as number[] | undefined}
62
+ >
63
+ <Stack spacing={spacing}>{children}</Stack>
64
+ </ChakraAccordion>
65
+ </AccordionProvider>
66
+ );
67
+ }
68
+ );
@@ -106,7 +106,7 @@ export const ExpandableItem = ({
106
106
  <Box as={headingLevel}>
107
107
  <AccordionButton>
108
108
  <Flex alignItems="center">
109
- {leftIcon && <Box mr={2}>{leftIcon}</Box>}
109
+ {leftIcon && <Box marginRight={1}>{leftIcon}</Box>}
110
110
  {title}
111
111
  </Flex>
112
112
  <AccordionIcon />
@@ -21,6 +21,7 @@ const config = helpers.defineMultiStyleConfig({
21
21
  justifyContent: "space-between",
22
22
  color: "darkGrey",
23
23
  textAlign: "left",
24
+ fontWeight: "bold",
24
25
  ...focusVisible({
25
26
  notFocus: {
26
27
  boxShadow: getBoxShadowString({
@@ -40,8 +41,7 @@ const config = helpers.defineMultiStyleConfig({
40
41
  },
41
42
  },
42
43
  panel: {
43
- pt: 2,
44
- pb: 5,
44
+ paddingY: 2,
45
45
  borderBottomRadius: "sm",
46
46
  },
47
47
  icon: {
@@ -57,7 +57,6 @@ const config = helpers.defineMultiStyleConfig({
57
57
  },
58
58
  _active: {
59
59
  backgroundColor: "mint",
60
- boxShadow: getBoxShadowString({ borderColor: "darkGrey" }),
61
60
  },
62
61
  },
63
62
  },
@@ -87,7 +86,10 @@ const config = helpers.defineMultiStyleConfig({
87
86
  },
88
87
  card: {
89
88
  container: {
90
- boxShadow: "md",
89
+ boxShadow: getBoxShadowString({
90
+ baseShadow: "sm",
91
+ borderColor: "silver",
92
+ }),
91
93
  },
92
94
  button: {
93
95
  _expanded: {
@@ -106,31 +108,34 @@ const config = helpers.defineMultiStyleConfig({
106
108
  sm: {
107
109
  button: {
108
110
  fontSize: "desktop.xs",
109
- px: 2,
110
- py: 1,
111
+ paddingX: 2,
112
+ paddingY: 1,
111
113
  },
112
114
  panel: {
113
- px: 2,
115
+ fontSize: "desktop.xs",
116
+ paddingX: 2,
114
117
  },
115
118
  },
116
119
  md: {
117
120
  button: {
118
121
  fontSize: "desktop.sm",
119
- px: 3,
120
- py: 1,
122
+ paddingX: 3,
123
+ paddingY: 1,
121
124
  },
122
125
  panel: {
123
- px: 3,
126
+ fontSize: "desktop.sm",
127
+ paddingX: 3,
124
128
  },
125
129
  },
126
130
  lg: {
127
131
  button: {
128
132
  fontSize: "desktop.sm",
129
- px: 3,
130
- py: 2,
133
+ paddingX: 3,
134
+ paddingY: 2,
131
135
  },
132
136
  panel: {
133
- px: 3,
137
+ fontSize: "desktop.sm",
138
+ paddingX: 3,
134
139
  },
135
140
  },
136
141
  },