@vygruppen/spor-react 9.8.2 → 9.8.3

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@9.8.2 build
2
+ > @vygruppen/spor-react@9.8.3 build
3
3
  > tsup src/index.tsx --dts --treeshake --format cjs,esm
4
4
 
5
5
  CLI Building entry: src/index.tsx
@@ -9,12 +9,12 @@
9
9
  CJS Build start
10
10
  ESM Build start
11
11
  DTS Build start
12
- CJS dist/index.js 508.50 KB
13
- CJS ⚡️ Build success in 2284ms
12
+ CJS dist/index.js 509.04 KB
13
+ CJS ⚡️ Build success in 2230ms
14
14
  ESM dist/index.mjs 2.11 KB
15
- ESM dist/CountryCodeSelect-46ZPAYGJ.mjs 1.19 KB
16
- ESM dist/chunk-4QF4PJTK.mjs 397.96 KB
17
- ESM ⚡️ Build success in 2286ms
18
- DTS ⚡️ Build success in 11777ms
19
- DTS dist/index.d.ts 337.72 KB
20
- DTS dist/index.d.mts 337.72 KB
15
+ ESM dist/CountryCodeSelect-C2XKHNTP.mjs 1.19 KB
16
+ ESM dist/chunk-ZDOSE4VD.mjs 398.42 KB
17
+ ESM ⚡️ Build success in 2232ms
18
+ DTS ⚡️ Build success in 11754ms
19
+ DTS dist/index.d.ts 337.67 KB
20
+ DTS dist/index.d.mts 337.67 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 9.8.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 50a42b2: Fix render of RadioCardGroup and RadioCard
8
+ - 72afbd7: Removed static values Table styles
9
+
3
10
  ## 9.8.2
4
11
 
5
12
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-4QF4PJTK.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-ZDOSE4VD.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -4,7 +4,7 @@ export { tokens11 as tokens };
4
4
  import { forwardRef, Divider as Divider$1, Stack as Stack$1, useRadio, useStyleConfig, chakra, Box, Card, Accordion as Accordion$1, Skeleton as Skeleton$1, useButtonGroup, Center, Flex, ButtonGroup as ButtonGroup$1, IconButton as IconButton$1, useMultiStyleConfig, Badge as Badge$1, Code as Code$1, Text, PopoverAnchor, FormLabel, useFormControlContext, PopoverContent, PopoverArrow, PopoverBody, FocusLock, Popover, InputGroup, PopoverTrigger, Portal, Checkbox as Checkbox$1, useCheckbox, FormControl as FormControl$1, InputLeftElement, Input as Input$1, InputRightElement, Select, useDisclosure, Button as Button$1, 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, useRadioGroup, 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, DrawerBody, DrawerHeader, useMediaQuery, DrawerCloseButton, DarkMode, PopoverCloseButton, usePopoverContext, UnorderedList, ChakraProvider, useToast as useToast$1, useInterval } from '@chakra-ui/react';
5
5
  export { AccordionButton, AccordionIcon, AccordionItem, AccordionPanel, Box, Center, Collapse, Container, DarkMode, DrawerBody, DrawerCloseButton, DrawerFooter, DrawerOverlay, Fade, Flex, FormHelperText, Grid, GridItem, HStack, Image, Img, InputGroup, LightMode, ListItem, Modal, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalOverlay, OrderedList, 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 React73 from 'react';
7
- import React73__default, { useId, createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, Suspense, Children, useContext, useCallback, useMemo, useLayoutEffect } from 'react';
7
+ import React73__default, { useId, createContext, useEffect, forwardRef as forwardRef$1, useRef, useState, Suspense, useContext, useCallback, useMemo, useLayoutEffect } from 'react';
8
8
  import { CloseFill30Icon, CloseFill24Icon, CloseFill18Icon, CalendarOutline24Icon, CloseOutline24Icon, SearchOutline24Icon, InformationFill24Icon, InformationFill18Icon, WarningFill24Icon, WarningFill18Icon, ErrorFill24Icon, ErrorFill18Icon, LinkOutOutline24Icon, DropdownRightFill18Icon, DropdownLeftFill18Icon, DropdownDownFill18Icon, DropdownDownFill24Icon, DropdownUpFill24Icon, ArrowRightFill18Icon, ArrowLeftFill24Icon, ArrowLeftOutline24Icon, ArrowRightOutline24Icon, ErrorOutline24Icon, AltTransportOutline24Icon, WarningOutline24Icon, SuccessOutline24Icon, InformationOutline24Icon, TrainFill18Icon, TrainFill24Icon, TrainFill30Icon, ExpressBusFill18Icon, ExpressBusFill24Icon, ExpressBusFill30Icon, BusFill18Icon, BusFill24Icon, BusFill30Icon, FerryFill18Icon, FerryFill24Icon, FerryFill30Icon, SubwayFill18Icon, SubwayFill24Icon, SubwayFill30Icon, TramFill18Icon, TramFill24Icon, TramFill30Icon, AltTransportFill18Icon, AltTransportFill24Icon, AltTransportFill30Icon, WalkFill18Icon, WalkFill24Icon, WalkFill30Icon } from '@vygruppen/spor-icon-react';
9
9
  import { inlineLoaderColorData, spinnerColorData, contentLoaderData, fullScreenLoaderWhiteData, inlineLoaderDarkData, fullScreenLoaderBlackData, inlineLoaderLightData, spinnerLightData, spinnerDarkData } from '@vygruppen/spor-loader';
10
10
  import { useLottie } from 'lottie-react';
@@ -829,14 +829,31 @@ var RadioCardGroup = ({
829
829
  ...props
830
830
  });
831
831
  const group = getRootProps();
832
- return /* @__PURE__ */ React73__default.createElement(Stack$1, { direction: direction2, ...group }, Children.map(
833
- children,
834
- (child) => {
832
+ return /* @__PURE__ */ React73__default.createElement(Stack$1, { direction: direction2, ...group }, recursiveMap(children, (child) => {
833
+ if (child.type === RadioCard) {
835
834
  const radio = getRadioProps({ value: child.props.value });
836
- return React73__default.cloneElement(child, { ...radio, variant, ...props });
835
+ const variantValue = variant;
836
+ return React73__default.cloneElement(
837
+ child,
838
+ { ...radio, variant: variantValue, ...props }
839
+ );
837
840
  }
838
- ));
841
+ return child;
842
+ }));
839
843
  };
844
+ function recursiveMap(children, fn) {
845
+ return React73__default.Children.map(children, (child) => {
846
+ if (React73__default.isValidElement(child) && child.props.children) {
847
+ child = React73__default.cloneElement(child, {
848
+ children: recursiveMap(child.props.children, fn)
849
+ });
850
+ }
851
+ if (React73__default.isValidElement(child)) {
852
+ return fn(child);
853
+ }
854
+ return child;
855
+ });
856
+ }
840
857
  var StaticCard = forwardRef(
841
858
  ({ colorScheme = "white", children, ...props }, ref) => {
842
859
  const styles3 = useStyleConfig("StaticCard", {
@@ -3428,7 +3445,7 @@ var texts14 = createTexts({
3428
3445
  sv: "Telefonnummer"
3429
3446
  }
3430
3447
  });
3431
- var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-46ZPAYGJ.mjs'));
3448
+ var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-C2XKHNTP.mjs'));
3432
3449
  var Radio = forwardRef((props, ref) => {
3433
3450
  return /* @__PURE__ */ React73__default.createElement(Radio$1, { ...props, ref });
3434
3451
  });
@@ -13330,13 +13347,11 @@ var config39 = helpers28.defineMultiStyleConfig({
13330
13347
  table: {
13331
13348
  borderCollapse: "collapse",
13332
13349
  ...baseText("default", props),
13333
- width: "100%",
13334
- minWidth: "600px"
13350
+ width: "100%"
13335
13351
  },
13336
13352
  th: {
13337
13353
  fontWeight: "bold",
13338
- textAlign: "start",
13339
- minWidth: "68px"
13354
+ textAlign: "start"
13340
13355
  },
13341
13356
  td: {
13342
13357
  textAlign: "start"
package/dist/index.d.mts CHANGED
@@ -6627,14 +6627,12 @@ declare const theme: {
6627
6627
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
6628
6628
  table: {
6629
6629
  width: string;
6630
- minWidth: string;
6631
6630
  color: string;
6632
6631
  borderCollapse: string;
6633
6632
  };
6634
6633
  th: {
6635
6634
  fontWeight: string;
6636
6635
  textAlign: string;
6637
- minWidth: string;
6638
6636
  };
6639
6637
  td: {
6640
6638
  textAlign: string;
@@ -9417,4 +9415,4 @@ declare const Text: _chakra_ui_system_dist_system_types.ComponentWithAs<"p", Tex
9417
9415
  **/
9418
9416
  declare function slugify(text: string | string[], maxLength?: number): string;
9419
9417
 
9420
- export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, FullScreenDrawer, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, Nudge, NudgeProps, NumericStepper, Pagination, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SimpleDrawer, SimpleDrawerProps, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, StaticCard, StaticCardProps, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Tooltip, TooltipProps, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardNudge, WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useToast, useTranslation };
9418
+ export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, FullScreenDrawer, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, Nudge, NudgeProps, NumericStepper, Pagination, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SimpleDrawer, SimpleDrawerProps, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, StaticCard, StaticCardProps, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Tooltip, TooltipProps, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardNudge, WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useToast, useTranslation };
package/dist/index.d.ts CHANGED
@@ -6627,14 +6627,12 @@ declare const theme: {
6627
6627
  baseStyle?: ((props: _chakra_ui_styled_system.StyleFunctionProps) => {
6628
6628
  table: {
6629
6629
  width: string;
6630
- minWidth: string;
6631
6630
  color: string;
6632
6631
  borderCollapse: string;
6633
6632
  };
6634
6633
  th: {
6635
6634
  fontWeight: string;
6636
6635
  textAlign: string;
6637
- minWidth: string;
6638
6636
  };
6639
6637
  td: {
6640
6638
  textAlign: string;
@@ -9417,4 +9415,4 @@ declare const Text: _chakra_ui_system_dist_system_types.ComponentWithAs<"p", Tex
9417
9415
  **/
9418
9416
  declare function slugify(text: string | string[], maxLength?: number): string;
9419
9417
 
9420
- export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, FullScreenDrawer, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, Nudge, NudgeProps, NumericStepper, Pagination, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SimpleDrawer, SimpleDrawerProps, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, StaticCard, StaticCardProps, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Tooltip, TooltipProps, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardNudge, WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useToast, useTranslation };
9418
+ export { Accordion, AccordionProps, AttachedInputs, Badge, BadgeProps, Brand, Breadcrumb, BreadcrumbItem, BreadcrumbLink, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, CardSelect, Checkbox, CheckboxGroup, CheckboxGroupProps, CheckboxProps, ChoiceChip, ChoiceChipProps, ClosableAlert, CloseButton, CloseButtonProps, Code, CodeProps, ColorInlineLoader, ColorInlineLoaderProps, ColorSpinner, ColorSpinnerProps, Combobox, ComboboxProps, ContentLoader, ContentLoaderProps, DarkFullScreenLoader, DarkInlineLoader, DarkInlineLoaderProps, DarkSpinner, DarkSpinnerProps, DatePicker, DateRangePicker, Divider, DividerProps, Drawer, DrawerContent, ModalHeader as DrawerHeader, Expandable, ExpandableAlert, ExpandableItem, ExpandableItemProps, FloatingActionButton, FormControl, FormControlProps, FormErrorMessage, FormErrorMessageProps, FormLabel, FormLabelProps, FullScreenDrawer, Heading, HeadingProps, IconButton, IconButtonProps, InfoSelect, InfoTag, InfoTagProps, Input, InputElementProps, InputLeftElement, InputProps, InputRightElement, ItemDescription, ItemLabel, JumpButton, Language, LanguageProvider, LightFullScreenLoader, LightInlineLoader, LightInlineLoaderProps, LightSpinner, LightSpinnerProps, LineIcon, LineIconProps, ListBox, ModalHeader, ModalHeaderProps, NativeSelect, NativeSelectProps, Nudge, NudgeProps, NumericStepper, Pagination, PasswordInput, PasswordInputProps, PhoneNumberInput, PlayPauseButton, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioCardProps, RadioGroup, RadioGroupProps, RadioProps, SearchInput, SearchInputProps, SimpleDrawer, SimpleDrawerProps, Skeleton, SkeletonCircle, SkeletonCircleProps, SkeletonProps, SkeletonText, SkeletonTextProps, SkipButton, SpinnerProps, SporProvider, Stack, StackProps, StaticAlert, StaticCard, StaticCardProps, Stepper, StepperStep, Switch, SwitchProps, Table, TableProps, Tabs, TabsProps, Text, TextLink, TextProps, Textarea, TextareaProps, TimePicker, ToastOptions, Tooltip, TooltipProps, Translations, TravelTag, TravelTagProps, VyLogo, VyLogoProps, WizardNudge, WizardNudgeProps, brandTheme, createTexts, fontFaces, slugify, theme, useToast, useTranslation };
package/dist/index.js CHANGED
@@ -878,9 +878,23 @@ var init_RadioCard = __esm({
878
878
  );
879
879
  }
880
880
  });
881
+ function recursiveMap(children, fn) {
882
+ return React73__namespace.default.Children.map(children, (child) => {
883
+ if (React73__namespace.default.isValidElement(child) && child.props.children) {
884
+ child = React73__namespace.default.cloneElement(child, {
885
+ children: recursiveMap(child.props.children, fn)
886
+ });
887
+ }
888
+ if (React73__namespace.default.isValidElement(child)) {
889
+ return fn(child);
890
+ }
891
+ return child;
892
+ });
893
+ }
881
894
  exports.RadioCardGroup = void 0;
882
895
  var init_RadioCardGroup = __esm({
883
896
  "src/layout/RadioCardGroup.tsx"() {
897
+ init_RadioCard();
884
898
  exports.RadioCardGroup = ({
885
899
  children,
886
900
  name,
@@ -897,13 +911,17 @@ var init_RadioCardGroup = __esm({
897
911
  ...props
898
912
  });
899
913
  const group = getRootProps();
900
- return /* @__PURE__ */ React73__namespace.default.createElement(react.Stack, { direction: direction2, ...group }, React73.Children.map(
901
- children,
902
- (child) => {
914
+ return /* @__PURE__ */ React73__namespace.default.createElement(react.Stack, { direction: direction2, ...group }, recursiveMap(children, (child) => {
915
+ if (child.type === exports.RadioCard) {
903
916
  const radio = getRadioProps({ value: child.props.value });
904
- return React73__namespace.default.cloneElement(child, { ...radio, variant, ...props });
917
+ const variantValue = variant;
918
+ return React73__namespace.default.cloneElement(
919
+ child,
920
+ { ...radio, variant: variantValue, ...props }
921
+ );
905
922
  }
906
- ));
923
+ return child;
924
+ }));
907
925
  };
908
926
  }
909
927
  });
@@ -15123,13 +15141,11 @@ var init_table2 = __esm({
15123
15141
  table: {
15124
15142
  borderCollapse: "collapse",
15125
15143
  ...baseText("default", props),
15126
- width: "100%",
15127
- minWidth: "600px"
15144
+ width: "100%"
15128
15145
  },
15129
15146
  th: {
15130
15147
  fontWeight: "bold",
15131
- textAlign: "start",
15132
- minWidth: "68px"
15148
+ textAlign: "start"
15133
15149
  },
15134
15150
  td: {
15135
15151
  textAlign: "start"
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, 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, FullScreenDrawer, 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, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-4QF4PJTK.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, 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, FullScreenDrawer, 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, Nudge, NumericStepper, OrderedList, Pagination, PasswordInput, PhoneNumberInput, PlayPauseButton, Portal, PressableCard, ProgressBar, ProgressIndicator, ProgressLoader, Radio, RadioCard, RadioCardGroup, RadioGroup, ScaleFade, SearchInput, Section, SimpleDrawer, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, SkipButton, Slide, SlideFade, Spacer, SporProvider, Stack, StaticAlert, StaticCard, Stepper, StepperStep, Switch, Tab, TabList, TabPanel, TabPanels, Table, TableCaption, Tabs, Tbody, Td, Text, TextLink, Textarea, Tfoot, Th, Thead, Time, TimePicker, Tooltip, Tr, TravelTag, UnorderedList, VStack, VyLogo, WizardNudge, Wrap, WrapItem, brandTheme, createTexts, defineStyleConfig, extendTheme, fontFaces, slugify, theme, tokens, useBreakpointValue, useClipboard, useColorMode, useColorModePreference, useColorModeValue, useControllableProp, useDisclosure, useMediaQuery, useMergeRefs, useOutsideClick, usePrefersReducedMotion, useSize, useTheme, useToast, useToken, useTranslation } from './chunk-ZDOSE4VD.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "9.8.2",
3
+ "version": "9.8.3",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -9,7 +9,7 @@ import {
9
9
  import { dataAttr } from "@chakra-ui/utils";
10
10
  import React, { useId } from "react";
11
11
 
12
- type RadioCardProps = UseRadioProps &
12
+ export type RadioCardProps = UseRadioProps &
13
13
  BoxProps & {
14
14
  children: React.ReactNode;
15
15
  /** Defaults to "base" */
@@ -5,6 +5,7 @@ import {
5
5
  Stack,
6
6
  } from "@chakra-ui/react";
7
7
  import React, { Children } from "react";
8
+ import { RadioCard, RadioCardProps } from "./RadioCard";
8
9
 
9
10
  type RadioCardGroupProps = RadioGroupProps & {
10
11
  children: React.ReactNode;
@@ -78,13 +79,38 @@ export const RadioCardGroup = ({
78
79
 
79
80
  return (
80
81
  <Stack direction={direction} {...group}>
81
- {Children.map(
82
- children as React.ReactElement[],
83
- (child: React.ReactElement) => {
82
+ {recursiveMap(children, (child: React.ReactElement) => {
83
+ if (child.type === RadioCard) {
84
84
  const radio = getRadioProps({ value: child.props.value });
85
- return React.cloneElement(child, { ...radio, variant, ...props });
86
- },
87
- )}
85
+ const variantValue = variant as "base" | "floating" | undefined;
86
+ return React.cloneElement(
87
+ child as React.ReactElement<RadioCardProps>,
88
+ { ...radio, variant: variantValue, ...props },
89
+ );
90
+ }
91
+ return child;
92
+ })}
88
93
  </Stack>
89
94
  );
90
95
  };
96
+
97
+ function recursiveMap(
98
+ children: React.ReactNode,
99
+ fn: (child: React.ReactElement) => React.ReactElement,
100
+ ): React.ReactNode {
101
+ return React.Children.map(children, (child) => {
102
+ // If this child is a React element and has children, recurse
103
+ if (React.isValidElement(child) && child.props.children) {
104
+ child = React.cloneElement(child as React.ReactElement<any>, {
105
+ children: recursiveMap(child.props.children, fn),
106
+ });
107
+ }
108
+
109
+ // Apply the function to the child (if it's a React element)
110
+ if (React.isValidElement(child)) {
111
+ return fn(child);
112
+ }
113
+
114
+ return child;
115
+ });
116
+ }
@@ -17,12 +17,10 @@ const config = helpers.defineMultiStyleConfig({
17
17
  borderCollapse: "collapse",
18
18
  ...baseText("default", props),
19
19
  width: "100%",
20
- minWidth: "600px",
21
20
  },
22
21
  th: {
23
22
  fontWeight: "bold",
24
23
  textAlign: "start",
25
- minWidth: "68px",
26
24
  },
27
25
  td: {
28
26
  textAlign: "start",