@vygruppen/spor-react 5.3.0 → 5.5.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@5.3.0 build
2
+ > @vygruppen/spor-react@5.5.0 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -10,13 +10,13 @@
10
10
  ESM Build start
11
11
  "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/index.js".
12
12
  DTS Build start
13
- "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-55HLEY3T.mjs".
14
- CJS dist/index.js 507.32 KB
15
- CJS ⚡️ Build success in 2031ms
13
+ "Collapse" is imported from external module "@chakra-ui/react" but never used in "dist/chunk-2L6AHVGG.mjs".
14
+ CJS dist/index.js 507.36 KB
15
+ CJS ⚡️ Build success in 2092ms
16
16
  ESM dist/index.mjs 2.16 KB
17
- ESM dist/CountryCodeSelect-BITN7VNA.mjs 1.19 KB
18
- ESM dist/chunk-55HLEY3T.mjs 397.85 KB
19
- ESM ⚡️ Build success in 2033ms
20
- DTS ⚡️ Build success in 12838ms
21
- DTS dist/index.d.ts 265.02 KB
22
- DTS dist/index.d.mts 265.02 KB
17
+ ESM dist/CountryCodeSelect-KRCJWBUE.mjs 1.19 KB
18
+ ESM dist/chunk-2L6AHVGG.mjs 397.95 KB
19
+ ESM ⚡️ Build success in 2093ms
20
+ DTS ⚡️ Build success in 12617ms
21
+ DTS dist/index.d.ts 265.22 KB
22
+ DTS dist/index.d.mts 265.22 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 5.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9be3b2c: cardSelect: darkmode quick fix for background color
8
+
9
+ ### Patch Changes
10
+
11
+ - 762592e: Breadcrumb: Fixed a darkmode bug where the arrow icons between crumbs were always black
12
+
13
+ ## 5.4.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 3781bb2: CardSelect: added dark mode update and new prop for background also changed outline to base and card to float in variants
18
+
3
19
  ## 5.3.0
4
20
 
5
21
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-55HLEY3T.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-2L6AHVGG.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import tokens10__default from '@vygruppen/spor-design-tokens';
2
2
  import * as tokens10 from '@vygruppen/spor-design-tokens';
3
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';
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, useColorModeValue, Breadcrumb as Breadcrumb$1, BreadcrumbItem as BreadcrumbItem$1, BreadcrumbLink as BreadcrumbLink$1, Heading as Heading$1, CheckboxGroup as CheckboxGroup$1, List, ListItem, useFormControlProps, useFormControl, Drawer as Drawer$1, DrawerOverlay, DrawerCloseButton, DrawerBody, usePopoverContext, DarkMode, PopoverCloseButton, ChakraProvider, HStack, useToast as useToast$1, useInterval } from '@chakra-ui/react';
5
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
7
  import React69__default, { createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, useId, Suspense, useContext, useCallback, useMemo, useLayoutEffect } from 'react';
@@ -1535,10 +1535,11 @@ var StaticAlert = ({ children, ...props }) => {
1535
1535
  return /* @__PURE__ */ React69__default.createElement(BaseAlert, { ...props }, /* @__PURE__ */ React69__default.createElement(AlertIcon, { variant: props.variant }), children);
1536
1536
  };
1537
1537
  var Breadcrumb = (props) => {
1538
+ const iconColor = useColorModeValue("blackAlpha.400", "whiteAlpha.400");
1538
1539
  return /* @__PURE__ */ React69__default.createElement(
1539
1540
  Breadcrumb$1,
1540
1541
  {
1541
- separator: /* @__PURE__ */ React69__default.createElement(DropdownRightFill18Icon, { color: "blackAlpha.400" }),
1542
+ separator: /* @__PURE__ */ React69__default.createElement(DropdownRightFill18Icon, { color: iconColor }),
1542
1543
  ...props
1543
1544
  }
1544
1545
  );
@@ -2523,7 +2524,10 @@ var CardSelect = forwardRef(
2523
2524
  triggerRef
2524
2525
  );
2525
2526
  const { buttonProps } = useButton(triggerProps, triggerRef);
2526
- const styles3 = useMultiStyleConfig("CardSelect", { variant, size: size2 });
2527
+ const styles3 = useMultiStyleConfig("CardSelect", {
2528
+ variant,
2529
+ size: size2
2530
+ });
2527
2531
  useForceRerender(state2.isOpen);
2528
2532
  const ChevronIcon = size2 === "sm" ? DropdownDownFill18Icon : DropdownDownFill24Icon;
2529
2533
  return /* @__PURE__ */ React69__default.createElement(Box, { ...props }, /* @__PURE__ */ React69__default.createElement(
@@ -3423,7 +3427,7 @@ var texts14 = createTexts({
3423
3427
  sv: "Telefonnummer"
3424
3428
  }
3425
3429
  });
3426
- var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-BITN7VNA.mjs'));
3430
+ var LazyCountryCodeSelect = React69__default.lazy(() => import('./CountryCodeSelect-KRCJWBUE.mjs'));
3427
3431
  var Radio = forwardRef((props, ref) => {
3428
3432
  return /* @__PURE__ */ React69__default.createElement(Radio$1, { ...props, ref });
3429
3433
  });
@@ -10470,6 +10474,92 @@ var getColorSchemeActiveProps = (props) => {
10470
10474
  };
10471
10475
  }
10472
10476
  };
10477
+ function baseBackground(state2, props) {
10478
+ switch (state2) {
10479
+ case "active":
10480
+ return {
10481
+ backgroundColor: mode("mint", "whiteAlpha.100")(props)
10482
+ };
10483
+ case "selected":
10484
+ return {
10485
+ backgroundColor: mode("pine", "coralGreen")(props)
10486
+ };
10487
+ case "disabled":
10488
+ return {
10489
+ backgroundColor: mode("silver", "whiteAlpha.100")(props)
10490
+ };
10491
+ default:
10492
+ return {
10493
+ backgroundColor: "transparent"
10494
+ };
10495
+ }
10496
+ }
10497
+ function ghostBackground(state2, props) {
10498
+ switch (state2) {
10499
+ case "hover": {
10500
+ return {
10501
+ backgroundColor: mode("seaMist", "whiteAlpha.100")(props)
10502
+ };
10503
+ }
10504
+ case "active":
10505
+ return {
10506
+ backgroundColor: mode("seaMist", "whiteAlpha.200")(props)
10507
+ };
10508
+ case "focus":
10509
+ return {
10510
+ backgroundColor: "transparent"
10511
+ };
10512
+ case "selected": {
10513
+ return {
10514
+ backgroundColor: mode("mint", "whiteAlpha.200")(props)
10515
+ };
10516
+ }
10517
+ case "default":
10518
+ default:
10519
+ return {
10520
+ backgroundColor: "transparent"
10521
+ };
10522
+ }
10523
+ }
10524
+ function floatingBackground(state2, props) {
10525
+ switch (state2) {
10526
+ case "selected":
10527
+ return {
10528
+ backgroundColor: mode("mint", "pine")(props)
10529
+ };
10530
+ case "active":
10531
+ return {
10532
+ backgroundColor: mode(
10533
+ "mint",
10534
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 30%)`
10535
+ )(props)
10536
+ };
10537
+ case "hover":
10538
+ return {
10539
+ backgroundColor: mode(
10540
+ "white",
10541
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 20%)`
10542
+ )(props)
10543
+ };
10544
+ case "focus":
10545
+ return {
10546
+ backgroundColor: mode(
10547
+ "white",
10548
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 40%)`
10549
+ )(props)
10550
+ };
10551
+ case "default":
10552
+ default:
10553
+ return {
10554
+ backgroundColor: mode(
10555
+ "white",
10556
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 10%)`
10557
+ )(props)
10558
+ };
10559
+ }
10560
+ }
10561
+
10562
+ // src/theme/components/card-select.ts
10473
10563
  var parts2 = anatomy("card-select").parts("trigger", "card");
10474
10564
  var helpers3 = createMultiStyleConfigHelpers(parts2.keys);
10475
10565
  var config8 = helpers3.defineMultiStyleConfig({
@@ -10478,9 +10568,6 @@ var config8 = helpers3.defineMultiStyleConfig({
10478
10568
  appearance: "none",
10479
10569
  display: "flex",
10480
10570
  alignItems: "center",
10481
- _expanded: {
10482
- backgroundColor: mode("mint", "night")(props)
10483
- },
10484
10571
  ...focusVisible({
10485
10572
  notFocus: {},
10486
10573
  focus: {
@@ -10495,21 +10582,13 @@ var config8 = helpers3.defineMultiStyleConfig({
10495
10582
  card: {
10496
10583
  borderRadius: "sm",
10497
10584
  boxShadow: "md",
10498
- padding: 3
10585
+ padding: 3,
10586
+ color: mode("darkGrey", "white")(props),
10587
+ ...floatingBackground("default", props)
10499
10588
  }
10500
10589
  }),
10501
10590
  variants: {
10502
- ghost: (props) => ({
10503
- trigger: {
10504
- _hover: {
10505
- backgroundColor: mode("seaMist", "pine")(props)
10506
- },
10507
- _active: {
10508
- backgroundColor: mode("mint", "whiteAlpha.200")(props)
10509
- }
10510
- }
10511
- }),
10512
- outline: (props) => ({
10591
+ base: (props) => ({
10513
10592
  trigger: {
10514
10593
  boxShadow: getBoxShadowString({
10515
10594
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props)
@@ -10531,19 +10610,20 @@ var config8 = helpers3.defineMultiStyleConfig({
10531
10610
  })
10532
10611
  },
10533
10612
  _active: {
10534
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
10613
+ ...baseBackground("active", props),
10535
10614
  boxShadow: getBoxShadowString({
10536
10615
  borderColor: mode("darkGrey", "whiteAlpha.400")(props),
10537
10616
  borderWidth: 1
10538
10617
  })
10539
10618
  },
10540
10619
  _expanded: {
10620
+ ...baseBackground("active", props),
10541
10621
  _hover: {
10542
- backgroundColor: mode("seaMist", "todo")(props),
10622
+ ...baseBackground("active", props),
10543
10623
  boxShadow: "none"
10544
10624
  },
10545
10625
  _active: {
10546
- backgroundColor: mode("mint", "todo")(props),
10626
+ ...baseBackground("active", props),
10547
10627
  boxShadow: getBoxShadowString({
10548
10628
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
10549
10629
  borderWidth: 1
@@ -10552,13 +10632,26 @@ var config8 = helpers3.defineMultiStyleConfig({
10552
10632
  }
10553
10633
  }
10554
10634
  }),
10555
- card: (props) => ({
10635
+ ghost: (props) => ({
10636
+ trigger: {
10637
+ _hover: {
10638
+ ...ghostBackground("hover", props)
10639
+ },
10640
+ _active: {
10641
+ ...ghostBackground("active", props)
10642
+ },
10643
+ _expanded: {
10644
+ ...ghostBackground("selected", props)
10645
+ }
10646
+ }
10647
+ }),
10648
+ floating: (props) => ({
10556
10649
  trigger: {
10557
- backgroundColor: mode("transparent", "whiteAlpha.100")(props),
10650
+ ...floatingBackground("default", props),
10558
10651
  boxShadow: "sm",
10559
10652
  transition: "all .1s ease-out",
10560
10653
  _hover: {
10561
- backgroundColor: mode("seaMist", "pine")(props),
10654
+ ...floatingBackground("hover", props),
10562
10655
  boxShadow: getBoxShadowString({
10563
10656
  borderColor: mode("silver", "whiteAlpha.400")(props),
10564
10657
  borderWidth: 1,
@@ -10566,7 +10659,7 @@ var config8 = helpers3.defineMultiStyleConfig({
10566
10659
  })
10567
10660
  },
10568
10661
  _active: {
10569
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
10662
+ ...floatingBackground("active", props),
10570
10663
  boxShadow: getBoxShadowString({
10571
10664
  borderColor: mode("silver", "whiteAlpha.400")(props),
10572
10665
  borderWidth: mode(0, 1)(props),
@@ -10574,6 +10667,7 @@ var config8 = helpers3.defineMultiStyleConfig({
10574
10667
  })
10575
10668
  },
10576
10669
  _expanded: {
10670
+ ...floatingBackground("active", props),
10577
10671
  _hover: {
10578
10672
  boxShadow: getBoxShadowString({
10579
10673
  borderColor: "darkGrey",
@@ -10581,7 +10675,7 @@ var config8 = helpers3.defineMultiStyleConfig({
10581
10675
  })
10582
10676
  },
10583
10677
  _active: {
10584
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
10678
+ ...floatingBackground("active", props),
10585
10679
  boxShadow: "none"
10586
10680
  }
10587
10681
  }
@@ -11615,90 +11709,6 @@ function floatingBorder(state2, props) {
11615
11709
  };
11616
11710
  }
11617
11711
  }
11618
- function baseBackground(state2, props) {
11619
- switch (state2) {
11620
- case "active":
11621
- return {
11622
- backgroundColor: mode("mint", "whiteAlpha.100")(props)
11623
- };
11624
- case "selected":
11625
- return {
11626
- backgroundColor: "pine"
11627
- };
11628
- case "disabled":
11629
- return {
11630
- backgroundColor: mode("silver", "whiteAlpha.100")(props)
11631
- };
11632
- default:
11633
- return {
11634
- backgroundColor: "transparent"
11635
- };
11636
- }
11637
- }
11638
- function ghostBackground(state2, props) {
11639
- switch (state2) {
11640
- case "hover": {
11641
- return {
11642
- backgroundColor: mode("seaMist", "whiteAlpha.100")(props)
11643
- };
11644
- }
11645
- case "active":
11646
- return {
11647
- backgroundColor: mode("seaMist", "whiteAlpha.200")(props)
11648
- };
11649
- case "focus":
11650
- return {
11651
- backgroundColor: "transparent"
11652
- };
11653
- case "selected": {
11654
- return {
11655
- backgroundColor: mode("mint", "whiteAlpha.200")(props)
11656
- };
11657
- }
11658
- case "default":
11659
- default:
11660
- return {
11661
- backgroundColor: "transparent"
11662
- };
11663
- }
11664
- }
11665
- function floatingBackground(state2, props) {
11666
- switch (state2) {
11667
- case "selected":
11668
- return {
11669
- backgroundColor: mode("mint", "pine")(props)
11670
- };
11671
- case "active":
11672
- return {
11673
- backgroundColor: mode(
11674
- "mint",
11675
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 30%)`
11676
- )(props)
11677
- };
11678
- case "hover":
11679
- return {
11680
- backgroundColor: mode(
11681
- "white",
11682
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 20%)`
11683
- )(props)
11684
- };
11685
- case "focus":
11686
- return {
11687
- backgroundColor: mode(
11688
- "white",
11689
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 40%)`
11690
- )(props)
11691
- };
11692
- case "default":
11693
- default:
11694
- return {
11695
- backgroundColor: mode(
11696
- "white",
11697
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 10%)`
11698
- )(props)
11699
- };
11700
- }
11701
- }
11702
11712
 
11703
11713
  // src/theme/components/info-select.ts
11704
11714
  var parts6 = anatomy("InfoSelect").parts(
package/dist/index.d.mts CHANGED
@@ -686,6 +686,7 @@ type CardSelectProps = BoxProps & {
686
686
  * ```
687
687
  *
688
688
  * @see https://spor.vy.no/components/card-select
689
+ *
689
690
  */
690
691
  declare const CardSelect: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", CardSelectProps>;
691
692
 
@@ -2538,14 +2539,13 @@ declare const theme: {
2538
2539
  appearance: string;
2539
2540
  display: string;
2540
2541
  alignItems: string;
2541
- _expanded: {
2542
- backgroundColor: string;
2543
- };
2544
2542
  };
2545
2543
  card: {
2544
+ backgroundColor: string;
2546
2545
  borderRadius: string;
2547
2546
  boxShadow: string;
2548
2547
  padding: number;
2548
+ color: string;
2549
2549
  };
2550
2550
  }) | undefined;
2551
2551
  sizes?: {
@@ -2578,34 +2578,25 @@ declare const theme: {
2578
2578
  };
2579
2579
  } | undefined;
2580
2580
  variants?: {
2581
- ghost: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2582
- trigger: {
2583
- _hover: {
2584
- backgroundColor: string;
2585
- };
2586
- _active: {
2587
- backgroundColor: string;
2588
- };
2589
- };
2590
- };
2591
- outline: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2581
+ base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2592
2582
  trigger: {
2593
2583
  _hover: {
2594
2584
  boxShadow: string;
2595
2585
  };
2596
2586
  _active: {
2597
- backgroundColor: string;
2598
2587
  boxShadow: string;
2588
+ backgroundColor: string;
2599
2589
  };
2600
2590
  _expanded: {
2601
2591
  _hover: {
2602
- backgroundColor: string;
2603
2592
  boxShadow: string;
2593
+ backgroundColor: string;
2604
2594
  };
2605
2595
  _active: {
2606
- backgroundColor: string;
2607
2596
  boxShadow: string;
2597
+ backgroundColor: string;
2608
2598
  };
2599
+ backgroundColor: string;
2609
2600
  };
2610
2601
  _focus: _chakra_ui_styled_system.SystemStyleObject;
2611
2602
  _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
@@ -2613,34 +2604,48 @@ declare const theme: {
2613
2604
  boxShadow: string;
2614
2605
  };
2615
2606
  };
2616
- card: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2607
+ ghost: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2608
+ trigger: {
2609
+ _hover: {
2610
+ backgroundColor: string;
2611
+ };
2612
+ _active: {
2613
+ backgroundColor: string;
2614
+ };
2615
+ _expanded: {
2616
+ backgroundColor: string;
2617
+ };
2618
+ };
2619
+ };
2620
+ floating: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2617
2621
  trigger: {
2618
- backgroundColor: string;
2619
2622
  boxShadow: string;
2620
2623
  transition: string;
2621
2624
  _hover: {
2622
- backgroundColor: string;
2623
2625
  boxShadow: string;
2626
+ backgroundColor: string;
2624
2627
  };
2625
2628
  _active: {
2626
- backgroundColor: string;
2627
2629
  boxShadow: string;
2630
+ backgroundColor: string;
2628
2631
  };
2629
2632
  _expanded: {
2630
2633
  _hover: {
2631
2634
  boxShadow: string;
2632
2635
  };
2633
2636
  _active: {
2634
- backgroundColor: string;
2635
2637
  boxShadow: string;
2638
+ backgroundColor: string;
2636
2639
  };
2640
+ backgroundColor: string;
2637
2641
  };
2642
+ backgroundColor: string;
2638
2643
  };
2639
2644
  };
2640
2645
  } | undefined;
2641
2646
  defaultProps?: {
2642
2647
  size?: "sm" | "md" | "lg" | undefined;
2643
- variant?: "outline" | "card" | "ghost" | undefined;
2648
+ variant?: "base" | "ghost" | "floating" | undefined;
2644
2649
  colorScheme?: string | undefined;
2645
2650
  } | undefined;
2646
2651
  parts: ("card" | "trigger")[];
package/dist/index.d.ts CHANGED
@@ -686,6 +686,7 @@ type CardSelectProps = BoxProps & {
686
686
  * ```
687
687
  *
688
688
  * @see https://spor.vy.no/components/card-select
689
+ *
689
690
  */
690
691
  declare const CardSelect: _chakra_ui_system_dist_system_types.ComponentWithAs<"button", CardSelectProps>;
691
692
 
@@ -2538,14 +2539,13 @@ declare const theme: {
2538
2539
  appearance: string;
2539
2540
  display: string;
2540
2541
  alignItems: string;
2541
- _expanded: {
2542
- backgroundColor: string;
2543
- };
2544
2542
  };
2545
2543
  card: {
2544
+ backgroundColor: string;
2546
2545
  borderRadius: string;
2547
2546
  boxShadow: string;
2548
2547
  padding: number;
2548
+ color: string;
2549
2549
  };
2550
2550
  }) | undefined;
2551
2551
  sizes?: {
@@ -2578,34 +2578,25 @@ declare const theme: {
2578
2578
  };
2579
2579
  } | undefined;
2580
2580
  variants?: {
2581
- ghost: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2582
- trigger: {
2583
- _hover: {
2584
- backgroundColor: string;
2585
- };
2586
- _active: {
2587
- backgroundColor: string;
2588
- };
2589
- };
2590
- };
2591
- outline: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2581
+ base: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2592
2582
  trigger: {
2593
2583
  _hover: {
2594
2584
  boxShadow: string;
2595
2585
  };
2596
2586
  _active: {
2597
- backgroundColor: string;
2598
2587
  boxShadow: string;
2588
+ backgroundColor: string;
2599
2589
  };
2600
2590
  _expanded: {
2601
2591
  _hover: {
2602
- backgroundColor: string;
2603
2592
  boxShadow: string;
2593
+ backgroundColor: string;
2604
2594
  };
2605
2595
  _active: {
2606
- backgroundColor: string;
2607
2596
  boxShadow: string;
2597
+ backgroundColor: string;
2608
2598
  };
2599
+ backgroundColor: string;
2609
2600
  };
2610
2601
  _focus: _chakra_ui_styled_system.SystemStyleObject;
2611
2602
  _focusVisible: _chakra_ui_styled_system.SystemStyleObject;
@@ -2613,34 +2604,48 @@ declare const theme: {
2613
2604
  boxShadow: string;
2614
2605
  };
2615
2606
  };
2616
- card: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2607
+ ghost: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2608
+ trigger: {
2609
+ _hover: {
2610
+ backgroundColor: string;
2611
+ };
2612
+ _active: {
2613
+ backgroundColor: string;
2614
+ };
2615
+ _expanded: {
2616
+ backgroundColor: string;
2617
+ };
2618
+ };
2619
+ };
2620
+ floating: (props: _chakra_ui_styled_system.StyleFunctionProps) => {
2617
2621
  trigger: {
2618
- backgroundColor: string;
2619
2622
  boxShadow: string;
2620
2623
  transition: string;
2621
2624
  _hover: {
2622
- backgroundColor: string;
2623
2625
  boxShadow: string;
2626
+ backgroundColor: string;
2624
2627
  };
2625
2628
  _active: {
2626
- backgroundColor: string;
2627
2629
  boxShadow: string;
2630
+ backgroundColor: string;
2628
2631
  };
2629
2632
  _expanded: {
2630
2633
  _hover: {
2631
2634
  boxShadow: string;
2632
2635
  };
2633
2636
  _active: {
2634
- backgroundColor: string;
2635
2637
  boxShadow: string;
2638
+ backgroundColor: string;
2636
2639
  };
2640
+ backgroundColor: string;
2637
2641
  };
2642
+ backgroundColor: string;
2638
2643
  };
2639
2644
  };
2640
2645
  } | undefined;
2641
2646
  defaultProps?: {
2642
2647
  size?: "sm" | "md" | "lg" | undefined;
2643
- variant?: "outline" | "card" | "ghost" | undefined;
2648
+ variant?: "base" | "ghost" | "floating" | undefined;
2644
2649
  colorScheme?: string | undefined;
2645
2650
  } | undefined;
2646
2651
  parts: ("card" | "trigger")[];
package/dist/index.js CHANGED
@@ -1093,10 +1093,11 @@ exports.Breadcrumb = void 0; exports.BreadcrumbItem = void 0; exports.Breadcrumb
1093
1093
  var init_Breadcrumb = __esm({
1094
1094
  "src/breadcrumb/Breadcrumb.tsx"() {
1095
1095
  exports.Breadcrumb = (props) => {
1096
+ const iconColor = react.useColorModeValue("blackAlpha.400", "whiteAlpha.400");
1096
1097
  return /* @__PURE__ */ React69__namespace.default.createElement(
1097
1098
  react.Breadcrumb,
1098
1099
  {
1099
- separator: /* @__PURE__ */ React69__namespace.default.createElement(sporIconReact.DropdownRightFill18Icon, { color: "blackAlpha.400" }),
1100
+ separator: /* @__PURE__ */ React69__namespace.default.createElement(sporIconReact.DropdownRightFill18Icon, { color: iconColor }),
1100
1101
  ...props
1101
1102
  }
1102
1103
  );
@@ -2269,7 +2270,10 @@ var init_CardSelect = __esm({
2269
2270
  triggerRef
2270
2271
  );
2271
2272
  const { buttonProps } = reactAria.useButton(triggerProps, triggerRef);
2272
- const styles3 = react.useMultiStyleConfig("CardSelect", { variant, size: size2 });
2273
+ const styles3 = react.useMultiStyleConfig("CardSelect", {
2274
+ variant,
2275
+ size: size2
2276
+ });
2273
2277
  useForceRerender(state2.isOpen);
2274
2278
  const ChevronIcon = size2 === "sm" ? sporIconReact.DropdownDownFill18Icon : sporIconReact.DropdownDownFill24Icon;
2275
2279
  return /* @__PURE__ */ React69__namespace.default.createElement(react.Box, { ...props }, /* @__PURE__ */ React69__namespace.default.createElement(
@@ -11925,6 +11929,95 @@ var init_card2 = __esm({
11925
11929
  };
11926
11930
  }
11927
11931
  });
11932
+ function baseBackground(state2, props) {
11933
+ switch (state2) {
11934
+ case "active":
11935
+ return {
11936
+ backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props)
11937
+ };
11938
+ case "selected":
11939
+ return {
11940
+ backgroundColor: themeTools.mode("pine", "coralGreen")(props)
11941
+ };
11942
+ case "disabled":
11943
+ return {
11944
+ backgroundColor: themeTools.mode("silver", "whiteAlpha.100")(props)
11945
+ };
11946
+ default:
11947
+ return {
11948
+ backgroundColor: "transparent"
11949
+ };
11950
+ }
11951
+ }
11952
+ function ghostBackground(state2, props) {
11953
+ switch (state2) {
11954
+ case "hover": {
11955
+ return {
11956
+ backgroundColor: themeTools.mode("seaMist", "whiteAlpha.100")(props)
11957
+ };
11958
+ }
11959
+ case "active":
11960
+ return {
11961
+ backgroundColor: themeTools.mode("seaMist", "whiteAlpha.200")(props)
11962
+ };
11963
+ case "focus":
11964
+ return {
11965
+ backgroundColor: "transparent"
11966
+ };
11967
+ case "selected": {
11968
+ return {
11969
+ backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props)
11970
+ };
11971
+ }
11972
+ case "default":
11973
+ default:
11974
+ return {
11975
+ backgroundColor: "transparent"
11976
+ };
11977
+ }
11978
+ }
11979
+ function floatingBackground(state2, props) {
11980
+ switch (state2) {
11981
+ case "selected":
11982
+ return {
11983
+ backgroundColor: themeTools.mode("mint", "pine")(props)
11984
+ };
11985
+ case "active":
11986
+ return {
11987
+ backgroundColor: themeTools.mode(
11988
+ "mint",
11989
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 30%)`
11990
+ )(props)
11991
+ };
11992
+ case "hover":
11993
+ return {
11994
+ backgroundColor: themeTools.mode(
11995
+ "white",
11996
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 20%)`
11997
+ )(props)
11998
+ };
11999
+ case "focus":
12000
+ return {
12001
+ backgroundColor: themeTools.mode(
12002
+ "white",
12003
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 40%)`
12004
+ )(props)
12005
+ };
12006
+ case "default":
12007
+ default:
12008
+ return {
12009
+ backgroundColor: themeTools.mode(
12010
+ "white",
12011
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 10%)`
12012
+ )(props)
12013
+ };
12014
+ }
12015
+ }
12016
+ var init_background_utils = __esm({
12017
+ "src/theme/utils/background-utils.ts"() {
12018
+ init_foundations();
12019
+ }
12020
+ });
11928
12021
  var parts2, helpers3, config8, card_select_default;
11929
12022
  var init_card_select = __esm({
11930
12023
  "src/theme/components/card-select.ts"() {
@@ -11932,6 +12025,7 @@ var init_card_select = __esm({
11932
12025
  init_dist3();
11933
12026
  init_box_shadow_utils();
11934
12027
  init_focus_utils();
12028
+ init_background_utils();
11935
12029
  parts2 = anatomy("card-select").parts("trigger", "card");
11936
12030
  helpers3 = createMultiStyleConfigHelpers(parts2.keys);
11937
12031
  config8 = helpers3.defineMultiStyleConfig({
@@ -11940,9 +12034,6 @@ var init_card_select = __esm({
11940
12034
  appearance: "none",
11941
12035
  display: "flex",
11942
12036
  alignItems: "center",
11943
- _expanded: {
11944
- backgroundColor: themeTools.mode("mint", "night")(props)
11945
- },
11946
12037
  ...focusVisible({
11947
12038
  notFocus: {},
11948
12039
  focus: {
@@ -11957,21 +12048,13 @@ var init_card_select = __esm({
11957
12048
  card: {
11958
12049
  borderRadius: "sm",
11959
12050
  boxShadow: "md",
11960
- padding: 3
12051
+ padding: 3,
12052
+ color: themeTools.mode("darkGrey", "white")(props),
12053
+ ...floatingBackground("default", props)
11961
12054
  }
11962
12055
  }),
11963
12056
  variants: {
11964
- ghost: (props) => ({
11965
- trigger: {
11966
- _hover: {
11967
- backgroundColor: themeTools.mode("seaMist", "pine")(props)
11968
- },
11969
- _active: {
11970
- backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props)
11971
- }
11972
- }
11973
- }),
11974
- outline: (props) => ({
12057
+ base: (props) => ({
11975
12058
  trigger: {
11976
12059
  boxShadow: getBoxShadowString({
11977
12060
  borderColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props)
@@ -11993,19 +12076,20 @@ var init_card_select = __esm({
11993
12076
  })
11994
12077
  },
11995
12078
  _active: {
11996
- backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props),
12079
+ ...baseBackground("active", props),
11997
12080
  boxShadow: getBoxShadowString({
11998
12081
  borderColor: themeTools.mode("darkGrey", "whiteAlpha.400")(props),
11999
12082
  borderWidth: 1
12000
12083
  })
12001
12084
  },
12002
12085
  _expanded: {
12086
+ ...baseBackground("active", props),
12003
12087
  _hover: {
12004
- backgroundColor: themeTools.mode("seaMist", "todo")(props),
12088
+ ...baseBackground("active", props),
12005
12089
  boxShadow: "none"
12006
12090
  },
12007
12091
  _active: {
12008
- backgroundColor: themeTools.mode("mint", "todo")(props),
12092
+ ...baseBackground("active", props),
12009
12093
  boxShadow: getBoxShadowString({
12010
12094
  borderColor: themeTools.mode("blackAlpha.400", "whiteAlpha.400")(props),
12011
12095
  borderWidth: 1
@@ -12014,13 +12098,26 @@ var init_card_select = __esm({
12014
12098
  }
12015
12099
  }
12016
12100
  }),
12017
- card: (props) => ({
12101
+ ghost: (props) => ({
12018
12102
  trigger: {
12019
- backgroundColor: themeTools.mode("transparent", "whiteAlpha.100")(props),
12103
+ _hover: {
12104
+ ...ghostBackground("hover", props)
12105
+ },
12106
+ _active: {
12107
+ ...ghostBackground("active", props)
12108
+ },
12109
+ _expanded: {
12110
+ ...ghostBackground("selected", props)
12111
+ }
12112
+ }
12113
+ }),
12114
+ floating: (props) => ({
12115
+ trigger: {
12116
+ ...floatingBackground("default", props),
12020
12117
  boxShadow: "sm",
12021
12118
  transition: "all .1s ease-out",
12022
12119
  _hover: {
12023
- backgroundColor: themeTools.mode("seaMist", "pine")(props),
12120
+ ...floatingBackground("hover", props),
12024
12121
  boxShadow: getBoxShadowString({
12025
12122
  borderColor: themeTools.mode("silver", "whiteAlpha.400")(props),
12026
12123
  borderWidth: 1,
@@ -12028,7 +12125,7 @@ var init_card_select = __esm({
12028
12125
  })
12029
12126
  },
12030
12127
  _active: {
12031
- backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props),
12128
+ ...floatingBackground("active", props),
12032
12129
  boxShadow: getBoxShadowString({
12033
12130
  borderColor: themeTools.mode("silver", "whiteAlpha.400")(props),
12034
12131
  borderWidth: themeTools.mode(0, 1)(props),
@@ -12036,6 +12133,7 @@ var init_card_select = __esm({
12036
12133
  })
12037
12134
  },
12038
12135
  _expanded: {
12136
+ ...floatingBackground("active", props),
12039
12137
  _hover: {
12040
12138
  boxShadow: getBoxShadowString({
12041
12139
  borderColor: "darkGrey",
@@ -12043,7 +12141,7 @@ var init_card_select = __esm({
12043
12141
  })
12044
12142
  },
12045
12143
  _active: {
12046
- backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props),
12144
+ ...floatingBackground("active", props),
12047
12145
  boxShadow: "none"
12048
12146
  }
12049
12147
  }
@@ -13153,95 +13251,6 @@ var init_border_utils = __esm({
13153
13251
  init_box_shadow_utils();
13154
13252
  }
13155
13253
  });
13156
- function baseBackground(state2, props) {
13157
- switch (state2) {
13158
- case "active":
13159
- return {
13160
- backgroundColor: themeTools.mode("mint", "whiteAlpha.100")(props)
13161
- };
13162
- case "selected":
13163
- return {
13164
- backgroundColor: "pine"
13165
- };
13166
- case "disabled":
13167
- return {
13168
- backgroundColor: themeTools.mode("silver", "whiteAlpha.100")(props)
13169
- };
13170
- default:
13171
- return {
13172
- backgroundColor: "transparent"
13173
- };
13174
- }
13175
- }
13176
- function ghostBackground(state2, props) {
13177
- switch (state2) {
13178
- case "hover": {
13179
- return {
13180
- backgroundColor: themeTools.mode("seaMist", "whiteAlpha.100")(props)
13181
- };
13182
- }
13183
- case "active":
13184
- return {
13185
- backgroundColor: themeTools.mode("seaMist", "whiteAlpha.200")(props)
13186
- };
13187
- case "focus":
13188
- return {
13189
- backgroundColor: "transparent"
13190
- };
13191
- case "selected": {
13192
- return {
13193
- backgroundColor: themeTools.mode("mint", "whiteAlpha.200")(props)
13194
- };
13195
- }
13196
- case "default":
13197
- default:
13198
- return {
13199
- backgroundColor: "transparent"
13200
- };
13201
- }
13202
- }
13203
- function floatingBackground(state2, props) {
13204
- switch (state2) {
13205
- case "selected":
13206
- return {
13207
- backgroundColor: themeTools.mode("mint", "pine")(props)
13208
- };
13209
- case "active":
13210
- return {
13211
- backgroundColor: themeTools.mode(
13212
- "mint",
13213
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 30%)`
13214
- )(props)
13215
- };
13216
- case "hover":
13217
- return {
13218
- backgroundColor: themeTools.mode(
13219
- "white",
13220
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 20%)`
13221
- )(props)
13222
- };
13223
- case "focus":
13224
- return {
13225
- backgroundColor: themeTools.mode(
13226
- "white",
13227
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 40%)`
13228
- )(props)
13229
- };
13230
- case "default":
13231
- default:
13232
- return {
13233
- backgroundColor: themeTools.mode(
13234
- "white",
13235
- `color-mix(in srgb, ${props.theme.darkBackgroundColor ?? colors.darkGrey}, ${colors.white} 10%)`
13236
- )(props)
13237
- };
13238
- }
13239
- }
13240
- var init_background_utils = __esm({
13241
- "src/theme/utils/background-utils.ts"() {
13242
- init_foundations();
13243
- }
13244
- });
13245
13254
  var parts6, helpers10, config18, info_select_default;
13246
13255
  var init_info_select = __esm({
13247
13256
  "src/theme/components/info-select.ts"() {
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, 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, ProgressIndicator, 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, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-55HLEY3T.mjs';
1
+ export { Accordion, AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, AttachedInputs, Badge, Box, Brand, 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, ProgressIndicator, 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, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-2L6AHVGG.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "5.3.0",
3
+ "version": "5.5.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -6,6 +6,7 @@ import {
6
6
  } from "@chakra-ui/react";
7
7
  import { DropdownRightFill18Icon } from "@vygruppen/spor-icon-react";
8
8
  import React from "react";
9
+ import { useColorModeValue } from "@chakra-ui/react";
9
10
 
10
11
  type BreadcrumbProps = ChakraBreadcrumbProps;
11
12
  /**
@@ -25,9 +26,10 @@ type BreadcrumbProps = ChakraBreadcrumbProps;
25
26
  * ```
26
27
  */
27
28
  export const Breadcrumb = (props: BreadcrumbProps) => {
29
+ const iconColor = useColorModeValue("blackAlpha.400", "whiteAlpha.400");
28
30
  return (
29
31
  <ChakraBreadcrumb
30
- separator={<DropdownRightFill18Icon color="blackAlpha.400" />}
32
+ separator={<DropdownRightFill18Icon color={iconColor} />}
31
33
  {...props}
32
34
  />
33
35
  );
@@ -59,6 +59,7 @@ type CardSelectProps = BoxProps & {
59
59
  * ```
60
60
  *
61
61
  * @see https://spor.vy.no/components/card-select
62
+ *
62
63
  */
63
64
  export const CardSelect = forwardRef<CardSelectProps, "button">(
64
65
  (
@@ -96,7 +97,10 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
96
97
 
97
98
  const { buttonProps } = useButton(triggerProps, triggerRef);
98
99
 
99
- const styles = useMultiStyleConfig("CardSelect", { variant, size });
100
+ const styles = useMultiStyleConfig("CardSelect", {
101
+ variant,
102
+ size,
103
+ });
100
104
  useForceRerender(state.isOpen);
101
105
 
102
106
  const ChevronIcon =
@@ -1,8 +1,13 @@
1
1
  import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
3
- import { mode } from "@chakra-ui/theme-tools";
3
+ import { StyleFunctionProps, mode } from "@chakra-ui/theme-tools";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
5
  import { focusVisible } from "../utils/focus-utils";
6
+ import {
7
+ baseBackground,
8
+ floatingBackground,
9
+ ghostBackground,
10
+ } from "../utils/background-utils";
6
11
 
7
12
  const parts = anatomy("card-select").parts("trigger", "card");
8
13
 
@@ -13,9 +18,6 @@ const config = helpers.defineMultiStyleConfig({
13
18
  appearance: "none",
14
19
  display: "flex",
15
20
  alignItems: "center",
16
- _expanded: {
17
- backgroundColor: mode("mint", "night")(props),
18
- },
19
21
  ...focusVisible({
20
22
  notFocus: {},
21
23
  focus: {
@@ -31,20 +33,12 @@ const config = helpers.defineMultiStyleConfig({
31
33
  borderRadius: "sm",
32
34
  boxShadow: "md",
33
35
  padding: 3,
36
+ color: mode("darkGrey", "white")(props),
37
+ ...floatingBackground("default", props),
34
38
  },
35
39
  }),
36
40
  variants: {
37
- ghost: (props) => ({
38
- trigger: {
39
- _hover: {
40
- backgroundColor: mode("seaMist", "pine")(props),
41
- },
42
- _active: {
43
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
44
- },
45
- },
46
- }),
47
- outline: (props) => ({
41
+ base: (props) => ({
48
42
  trigger: {
49
43
  boxShadow: getBoxShadowString({
50
44
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
@@ -66,20 +60,20 @@ const config = helpers.defineMultiStyleConfig({
66
60
  }),
67
61
  },
68
62
  _active: {
69
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
63
+ ...baseBackground("active", props),
70
64
  boxShadow: getBoxShadowString({
71
65
  borderColor: mode("darkGrey", "whiteAlpha.400")(props),
72
66
  borderWidth: 1,
73
67
  }),
74
68
  },
75
-
76
69
  _expanded: {
70
+ ...baseBackground("active", props),
77
71
  _hover: {
78
- backgroundColor: mode("seaMist", "todo")(props),
72
+ ...baseBackground("active", props),
79
73
  boxShadow: "none",
80
74
  },
81
75
  _active: {
82
- backgroundColor: mode("mint", "todo")(props),
76
+ ...baseBackground("active", props),
83
77
  boxShadow: getBoxShadowString({
84
78
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
85
79
  borderWidth: 1,
@@ -88,13 +82,26 @@ const config = helpers.defineMultiStyleConfig({
88
82
  },
89
83
  },
90
84
  }),
91
- card: (props) => ({
85
+ ghost: (props) => ({
86
+ trigger: {
87
+ _hover: {
88
+ ...ghostBackground("hover", props),
89
+ },
90
+ _active: {
91
+ ...ghostBackground("active", props),
92
+ },
93
+ _expanded: {
94
+ ...ghostBackground("selected", props),
95
+ },
96
+ },
97
+ }),
98
+ floating: (props) => ({
92
99
  trigger: {
93
- backgroundColor: mode("transparent", "whiteAlpha.100")(props),
100
+ ...floatingBackground("default", props),
94
101
  boxShadow: "sm",
95
102
  transition: "all .1s ease-out",
96
103
  _hover: {
97
- backgroundColor: mode("seaMist", "pine")(props),
104
+ ...floatingBackground("hover", props),
98
105
  boxShadow: getBoxShadowString({
99
106
  borderColor: mode("silver", "whiteAlpha.400")(props),
100
107
  borderWidth: 1,
@@ -102,7 +109,7 @@ const config = helpers.defineMultiStyleConfig({
102
109
  }),
103
110
  },
104
111
  _active: {
105
- backgroundColor: mode("mint", "whiteAlpha.100")(props),
112
+ ...floatingBackground("active", props),
106
113
  boxShadow: getBoxShadowString({
107
114
  borderColor: mode("silver", "whiteAlpha.400")(props),
108
115
  borderWidth: mode(0, 1)(props),
@@ -110,6 +117,7 @@ const config = helpers.defineMultiStyleConfig({
110
117
  }),
111
118
  },
112
119
  _expanded: {
120
+ ...floatingBackground("active", props),
113
121
  _hover: {
114
122
  boxShadow: getBoxShadowString({
115
123
  borderColor: "darkGrey",
@@ -117,7 +125,7 @@ const config = helpers.defineMultiStyleConfig({
117
125
  }),
118
126
  },
119
127
  _active: {
120
- backgroundColor: mode("mint", "whiteAlpha.200")(props),
128
+ ...floatingBackground("active", props),
121
129
  boxShadow: "none",
122
130
  },
123
131
  },
@@ -17,7 +17,7 @@ export function baseBackground(
17
17
  };
18
18
  case "selected":
19
19
  return {
20
- backgroundColor: "pine",
20
+ backgroundColor: mode("pine", "coralGreen")(props),
21
21
  };
22
22
  case "disabled":
23
23
  return {
@@ -84,27 +84,21 @@ export function floatingBackground(
84
84
  return {
85
85
  backgroundColor: mode(
86
86
  "mint",
87
- `color-mix(in srgb, ${
88
- props.theme.darkBackgroundColor ?? colors.darkGrey
89
- }, ${colors.white} 30%)`,
87
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 30%)`,
90
88
  )(props),
91
89
  };
92
90
  case "hover":
93
91
  return {
94
92
  backgroundColor: mode(
95
93
  "white",
96
- `color-mix(in srgb, ${
97
- props.theme.darkBackgroundColor ?? colors.darkGrey
98
- }, ${colors.white} 20%)`,
94
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 20%)`,
99
95
  )(props),
100
96
  };
101
97
  case "focus":
102
98
  return {
103
99
  backgroundColor: mode(
104
100
  "white",
105
- `color-mix(in srgb, ${
106
- props.theme.darkBackgroundColor ?? colors.darkGrey
107
- }, ${colors.white} 40%)`,
101
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 40%)`,
108
102
  )(props),
109
103
  };
110
104
  case "default":
@@ -112,9 +106,7 @@ export function floatingBackground(
112
106
  return {
113
107
  backgroundColor: mode(
114
108
  "white",
115
- `color-mix(in srgb, ${
116
- props.theme.darkBackgroundColor ?? colors.darkGrey
117
- }, ${colors.white} 10%)`,
109
+ `color-mix(in srgb, ${props.theme.colors.accent}, ${colors.white} 10%)`,
118
110
  )(props),
119
111
  };
120
112
  }