@vygruppen/spor-react 9.8.0 → 9.8.2

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.0 build
2
+ > @vygruppen/spor-react@9.8.2 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
14
  ESM dist/index.mjs 2.11 KB
13
- ESM dist/CountryCodeSelect-EKYAUNTI.mjs 1.19 KB
14
- ESM dist/chunk-3P7NVQKW.mjs 397.80 KB
15
- ESM ⚡️ Build success in 2067ms
16
- CJS dist/index.js 508.29 KB
17
- CJS ⚡️ Build success in 2068ms
18
- DTS ⚡️ Build success in 11221ms
19
- DTS dist/index.d.ts 337.50 KB
20
- DTS dist/index.d.mts 337.50 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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 9.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 5503c91: Fixes on new Cards
8
+ - Make PressableCard more scalable (removed as)
9
+ - Edit "white" colorScheme on StaticCard to support darkmode
10
+
11
+ ## 9.8.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 6852a42: Update docs for PressableCard and RadioCard
16
+
3
17
  ## 9.8.0
4
18
 
5
19
  ### Minor Changes
@@ -1,4 +1,4 @@
1
- import { createTexts, useTranslation, InfoSelect, Item } from './chunk-3P7NVQKW.mjs';
1
+ import { createTexts, useTranslation, InfoSelect, Item } from './chunk-4QF4PJTK.mjs';
2
2
  import React from 'react';
3
3
  import { getSupportedCallingCodes } from 'awesome-phonenumber';
4
4
 
@@ -845,16 +845,14 @@ var StaticCard = forwardRef(
845
845
  return /* @__PURE__ */ React73__default.createElement(Box, { __css: styles3, ...props, ref }, children, /* @__PURE__ */ React73__default.createElement(Card, null));
846
846
  }
847
847
  );
848
- var PressableCard = ({
849
- children,
850
- as = "button",
851
- size: size2 = "sm",
852
- variant = "base",
853
- ...props
854
- }) => {
855
- const styles3 = useStyleConfig("PressableCard", { variant, size: size2 });
856
- return /* @__PURE__ */ React73__default.createElement(Box, { as, __css: styles3, ...props }, children);
857
- };
848
+ var PressableCard = forwardRef(
849
+ ({ children, variant = "base", ...props }, ref) => {
850
+ const styles3 = useStyleConfig("PressableCard", {
851
+ variant
852
+ });
853
+ return /* @__PURE__ */ React73__default.createElement(Box, { __css: styles3, ...props, ref }, children);
854
+ }
855
+ );
858
856
  var AccordionContext = React73__default.createContext(null);
859
857
  var AccordionProvider = ({
860
858
  size: size2,
@@ -2638,10 +2636,12 @@ var CardSelect = forwardRef(
2638
2636
  placement
2639
2637
  },
2640
2638
  /* @__PURE__ */ React73__default.createElement(
2641
- Card2,
2639
+ StaticCard,
2642
2640
  {
2643
2641
  colorScheme: "white",
2644
2642
  size: "lg",
2643
+ border: "sm",
2644
+ borderColor: "grey",
2645
2645
  sx: styles3.card,
2646
2646
  ...overlayProps
2647
2647
  },
@@ -3428,7 +3428,7 @@ var texts14 = createTexts({
3428
3428
  sv: "Telefonnummer"
3429
3429
  }
3430
3430
  });
3431
- var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-EKYAUNTI.mjs'));
3431
+ var LazyCountryCodeSelect = React73__default.lazy(() => import('./CountryCodeSelect-46ZPAYGJ.mjs'));
3432
3432
  var Radio = forwardRef((props, ref) => {
3433
3433
  return /* @__PURE__ */ React73__default.createElement(Radio$1, { ...props, ref });
3434
3434
  });
@@ -13661,8 +13661,8 @@ var getColorSchemeBaseProps2 = (props) => {
13661
13661
  switch (props.colorScheme) {
13662
13662
  case "white":
13663
13663
  return {
13664
- backgroundColor: "white",
13665
- color: "darkGrey"
13664
+ ...floatingBackground("default", props),
13665
+ color: mode("text.default.light", "text.default.dark")(props)
13666
13666
  };
13667
13667
  case "grey":
13668
13668
  return {
@@ -13709,6 +13709,7 @@ var config44 = defineStyleConfig$1({
13709
13709
  fontSize: "inherit",
13710
13710
  display: "block",
13711
13711
  borderRadius: "md",
13712
+ cursor: "pointer",
13712
13713
  ...focusVisibleStyles(props),
13713
13714
  _disabled: {
13714
13715
  ...baseBackground("disabled", props),
@@ -13745,6 +13746,7 @@ var config44 = defineStyleConfig$1({
13745
13746
  boxShadow: "sm",
13746
13747
  _hover: {
13747
13748
  ...floatingBackground("hover", props),
13749
+ ...floatingBorder("hover", props),
13748
13750
  boxShadow: "md"
13749
13751
  },
13750
13752
  _active: {
package/dist/index.d.mts CHANGED
@@ -58,8 +58,8 @@ type StackProps = Exclude<StackProps$1, "direction"> & {
58
58
  *
59
59
  * ```tsx
60
60
  * <Stack spacing={4}>
61
- * <Card>Here's one card</Card>
62
- * <Card>Here's another card, with a lot of space between it</Card>
61
+ * <StaticCard>Here's one card</StaticCard>
62
+ * <StaticCard>Here's another card, with a lot of space between it</StaticCard>
63
63
  * </Stack>
64
64
  * ```
65
65
  */
@@ -67,6 +67,7 @@ declare const Stack: _chakra_ui_system_dist_system_types.ComponentWithAs<"div",
67
67
 
68
68
  type RadioCardProps = UseRadioProps & BoxProps & {
69
69
  children: React.ReactNode;
70
+ /** Defaults to "base" */
70
71
  variant: "floating" | "base";
71
72
  };
72
73
  /**
@@ -116,7 +117,16 @@ declare const RadioCard: _chakra_ui_system_dist_system_types.ComponentWithAs<"di
116
117
  type RadioCardGroupProps = RadioGroupProps$1 & {
117
118
  children: React.ReactNode;
118
119
  props?: RadioGroupProps$1;
120
+ /** Defaults to "row" */
119
121
  direction?: StackDirection;
122
+ /** Defaults to "base" */
123
+ variant?: string;
124
+ /** The name of the radio group */
125
+ name?: string;
126
+ /** The default value of the radio group */
127
+ defaultValue?: string;
128
+ /** The callback function to be called when the radio group value changes */
129
+ onChange?: (value: string) => void;
120
130
  };
121
131
  /**
122
132
  * Radio card groups are used to group several radio cards together.
@@ -199,13 +209,9 @@ type StaticCardProps = BoxProps & {
199
209
  */
200
210
  declare const StaticCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, StaticCardProps>;
201
211
 
202
- type PressableCardProps = Omit<BoxProps, "as"> & {
203
- /** Use "floating" | "accent" | "base". Defaults to base */
212
+ type PressableCardProps = BoxProps & {
213
+ /** Defaults to "base" */
204
214
  variant: "floating" | "accent" | "base";
205
- /** Use "sm" | "lg". Defaults to sm */
206
- size?: "sm" | "lg";
207
- /** Use "button" | "a" | "label". Defaults to button */
208
- as: "button" | "a" | "label";
209
215
  };
210
216
  /**
211
217
  * `PressableCard` is a component that renders a pressable card.
@@ -214,7 +220,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
214
220
  * It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
215
221
  * If no `as` prop is provided, it defaults to a button.
216
222
  *
217
- * The `size` prop can be used to control the size of the card. It defaults to "sm".
218
223
  * The `variant` prop can be used to control the style variant of the card. It defaults to "base".
219
224
  *
220
225
  * Example usage:
@@ -237,7 +242,7 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
237
242
  *
238
243
  * @see StaticCard
239
244
  */
240
- declare const PressableCard: ({ children, as, size, variant, ...props }: PressableCardProps) => React.JSX.Element;
245
+ declare const PressableCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, PressableCardProps>;
241
246
 
242
247
  type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
243
248
  /**
@@ -2101,7 +2106,7 @@ type NudgeProps = {
2101
2106
  * name="my-nudge"
2102
2107
  * content="Check out this enormous new feature!"
2103
2108
  * >
2104
- * <Card variant="base" padding={2} width="fit-content">My new feature</Card>
2109
+ * <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
2105
2110
  * </Nudge>
2106
2111
  * ```
2107
2112
  */
@@ -2126,9 +2131,9 @@ type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
2126
2131
  * name="my-wizard-nudge"
2127
2132
  * introducedDate="2024-02-19"
2128
2133
  * >
2129
- * <Card width="fit-content" padding={2}>
2134
+ * <StaticCard width="fit-content" padding={2}>
2130
2135
  * My new feature
2131
- * </Card>
2136
+ * </StaticCard>
2132
2137
  * </WizardNudge>
2133
2138
  * ```
2134
2139
  */
@@ -7177,8 +7182,8 @@ declare const theme: {
7177
7182
  };
7178
7183
  StaticCard: {
7179
7184
  baseStyle?: ((props: any) => {
7180
- backgroundColor: string;
7181
7185
  color: string;
7186
+ backgroundColor: string;
7182
7187
  _focusVisible: {
7183
7188
  outlineWidth: string;
7184
7189
  outlineColor: string;
@@ -7192,8 +7197,7 @@ declare const theme: {
7192
7197
  display: string;
7193
7198
  borderRadius: string;
7194
7199
  } | {
7195
- backgroundColor: string;
7196
- color: string;
7200
+ backgroundColor: any;
7197
7201
  _focusVisible: {
7198
7202
  outlineWidth: string;
7199
7203
  outlineColor: string;
@@ -7206,6 +7210,7 @@ declare const theme: {
7206
7210
  fontSize: string;
7207
7211
  display: string;
7208
7212
  borderRadius: string;
7213
+ color: string;
7209
7214
  }) | undefined;
7210
7215
  sizes?: {
7211
7216
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
@@ -7239,6 +7244,7 @@ declare const theme: {
7239
7244
  fontSize: string;
7240
7245
  display: string;
7241
7246
  borderRadius: string;
7247
+ cursor: string;
7242
7248
  }) | undefined;
7243
7249
  sizes?: {
7244
7250
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
@@ -7309,6 +7315,8 @@ declare const theme: {
7309
7315
  boxShadow: string;
7310
7316
  _hover: {
7311
7317
  boxShadow: string;
7318
+ outline: string;
7319
+ outlineColor: string;
7312
7320
  backgroundColor: string;
7313
7321
  };
7314
7322
  _active: {
package/dist/index.d.ts CHANGED
@@ -58,8 +58,8 @@ type StackProps = Exclude<StackProps$1, "direction"> & {
58
58
  *
59
59
  * ```tsx
60
60
  * <Stack spacing={4}>
61
- * <Card>Here's one card</Card>
62
- * <Card>Here's another card, with a lot of space between it</Card>
61
+ * <StaticCard>Here's one card</StaticCard>
62
+ * <StaticCard>Here's another card, with a lot of space between it</StaticCard>
63
63
  * </Stack>
64
64
  * ```
65
65
  */
@@ -67,6 +67,7 @@ declare const Stack: _chakra_ui_system_dist_system_types.ComponentWithAs<"div",
67
67
 
68
68
  type RadioCardProps = UseRadioProps & BoxProps & {
69
69
  children: React.ReactNode;
70
+ /** Defaults to "base" */
70
71
  variant: "floating" | "base";
71
72
  };
72
73
  /**
@@ -116,7 +117,16 @@ declare const RadioCard: _chakra_ui_system_dist_system_types.ComponentWithAs<"di
116
117
  type RadioCardGroupProps = RadioGroupProps$1 & {
117
118
  children: React.ReactNode;
118
119
  props?: RadioGroupProps$1;
120
+ /** Defaults to "row" */
119
121
  direction?: StackDirection;
122
+ /** Defaults to "base" */
123
+ variant?: string;
124
+ /** The name of the radio group */
125
+ name?: string;
126
+ /** The default value of the radio group */
127
+ defaultValue?: string;
128
+ /** The callback function to be called when the radio group value changes */
129
+ onChange?: (value: string) => void;
120
130
  };
121
131
  /**
122
132
  * Radio card groups are used to group several radio cards together.
@@ -199,13 +209,9 @@ type StaticCardProps = BoxProps & {
199
209
  */
200
210
  declare const StaticCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, StaticCardProps>;
201
211
 
202
- type PressableCardProps = Omit<BoxProps, "as"> & {
203
- /** Use "floating" | "accent" | "base". Defaults to base */
212
+ type PressableCardProps = BoxProps & {
213
+ /** Defaults to "base" */
204
214
  variant: "floating" | "accent" | "base";
205
- /** Use "sm" | "lg". Defaults to sm */
206
- size?: "sm" | "lg";
207
- /** Use "button" | "a" | "label". Defaults to button */
208
- as: "button" | "a" | "label";
209
215
  };
210
216
  /**
211
217
  * `PressableCard` is a component that renders a pressable card.
@@ -214,7 +220,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
214
220
  * It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
215
221
  * If no `as` prop is provided, it defaults to a button.
216
222
  *
217
- * The `size` prop can be used to control the size of the card. It defaults to "sm".
218
223
  * The `variant` prop can be used to control the style variant of the card. It defaults to "base".
219
224
  *
220
225
  * Example usage:
@@ -237,7 +242,7 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
237
242
  *
238
243
  * @see StaticCard
239
244
  */
240
- declare const PressableCard: ({ children, as, size, variant, ...props }: PressableCardProps) => React.JSX.Element;
245
+ declare const PressableCard: _chakra_ui_system_dist_system_types.ComponentWithAs<As, PressableCardProps>;
241
246
 
242
247
  type AccordionProps = Omit<AccordionProps$1, "variant" | "size"> & {
243
248
  /**
@@ -2101,7 +2106,7 @@ type NudgeProps = {
2101
2106
  * name="my-nudge"
2102
2107
  * content="Check out this enormous new feature!"
2103
2108
  * >
2104
- * <Card variant="base" padding={2} width="fit-content">My new feature</Card>
2109
+ * <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
2105
2110
  * </Nudge>
2106
2111
  * ```
2107
2112
  */
@@ -2126,9 +2131,9 @@ type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
2126
2131
  * name="my-wizard-nudge"
2127
2132
  * introducedDate="2024-02-19"
2128
2133
  * >
2129
- * <Card width="fit-content" padding={2}>
2134
+ * <StaticCard width="fit-content" padding={2}>
2130
2135
  * My new feature
2131
- * </Card>
2136
+ * </StaticCard>
2132
2137
  * </WizardNudge>
2133
2138
  * ```
2134
2139
  */
@@ -7177,8 +7182,8 @@ declare const theme: {
7177
7182
  };
7178
7183
  StaticCard: {
7179
7184
  baseStyle?: ((props: any) => {
7180
- backgroundColor: string;
7181
7185
  color: string;
7186
+ backgroundColor: string;
7182
7187
  _focusVisible: {
7183
7188
  outlineWidth: string;
7184
7189
  outlineColor: string;
@@ -7192,8 +7197,7 @@ declare const theme: {
7192
7197
  display: string;
7193
7198
  borderRadius: string;
7194
7199
  } | {
7195
- backgroundColor: string;
7196
- color: string;
7200
+ backgroundColor: any;
7197
7201
  _focusVisible: {
7198
7202
  outlineWidth: string;
7199
7203
  outlineColor: string;
@@ -7206,6 +7210,7 @@ declare const theme: {
7206
7210
  fontSize: string;
7207
7211
  display: string;
7208
7212
  borderRadius: string;
7213
+ color: string;
7209
7214
  }) | undefined;
7210
7215
  sizes?: {
7211
7216
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
@@ -7239,6 +7244,7 @@ declare const theme: {
7239
7244
  fontSize: string;
7240
7245
  display: string;
7241
7246
  borderRadius: string;
7247
+ cursor: string;
7242
7248
  }) | undefined;
7243
7249
  sizes?: {
7244
7250
  [key: string]: _chakra_ui_styled_system.SystemStyleInterpolation;
@@ -7309,6 +7315,8 @@ declare const theme: {
7309
7315
  boxShadow: string;
7310
7316
  _hover: {
7311
7317
  boxShadow: string;
7318
+ outline: string;
7319
+ outlineColor: string;
7312
7320
  backgroundColor: string;
7313
7321
  };
7314
7322
  _active: {
package/dist/index.js CHANGED
@@ -923,16 +923,14 @@ var init_StaticCard = __esm({
923
923
  exports.PressableCard = void 0;
924
924
  var init_PressableCard = __esm({
925
925
  "src/layout/PressableCard.tsx"() {
926
- exports.PressableCard = ({
927
- children,
928
- as = "button",
929
- size: size2 = "sm",
930
- variant = "base",
931
- ...props
932
- }) => {
933
- const styles3 = react.useStyleConfig("PressableCard", { variant, size: size2 });
934
- return /* @__PURE__ */ React73__namespace.default.createElement(react.Box, { as, __css: styles3, ...props }, children);
935
- };
926
+ exports.PressableCard = react.forwardRef(
927
+ ({ children, variant = "base", ...props }, ref) => {
928
+ const styles3 = react.useStyleConfig("PressableCard", {
929
+ variant
930
+ });
931
+ return /* @__PURE__ */ React73__namespace.default.createElement(react.Box, { __css: styles3, ...props, ref }, children);
932
+ }
933
+ );
936
934
  }
937
935
  });
938
936
  var init_layout = __esm({
@@ -3156,10 +3154,12 @@ var init_CardSelect = __esm({
3156
3154
  placement
3157
3155
  },
3158
3156
  /* @__PURE__ */ React73__namespace.default.createElement(
3159
- exports.Card,
3157
+ exports.StaticCard,
3160
3158
  {
3161
3159
  colorScheme: "white",
3162
3160
  size: "lg",
3161
+ border: "sm",
3162
+ borderColor: "grey",
3163
3163
  sx: styles3.card,
3164
3164
  ...overlayProps
3165
3165
  },
@@ -15463,6 +15463,7 @@ var init_static_card = __esm({
15463
15463
  "src/theme/components/static-card.ts"() {
15464
15464
  init_foundations();
15465
15465
  init_focus_utils();
15466
+ init_floating_utils();
15466
15467
  config43 = react.defineStyleConfig({
15467
15468
  baseStyle: (props) => ({
15468
15469
  appearance: "none",
@@ -15482,8 +15483,8 @@ var init_static_card = __esm({
15482
15483
  switch (props.colorScheme) {
15483
15484
  case "white":
15484
15485
  return {
15485
- backgroundColor: "white",
15486
- color: "darkGrey"
15486
+ ...floatingBackground("default", props),
15487
+ color: themeTools.mode("text.default.light", "text.default.dark")(props)
15487
15488
  };
15488
15489
  case "grey":
15489
15490
  return {
@@ -15539,6 +15540,7 @@ var init_pressable_card = __esm({
15539
15540
  fontSize: "inherit",
15540
15541
  display: "block",
15541
15542
  borderRadius: "md",
15543
+ cursor: "pointer",
15542
15544
  ...focusVisibleStyles(props),
15543
15545
  _disabled: {
15544
15546
  ...baseBackground("disabled", props),
@@ -15575,6 +15577,7 @@ var init_pressable_card = __esm({
15575
15577
  boxShadow: "sm",
15576
15578
  _hover: {
15577
15579
  ...floatingBackground("hover", props),
15580
+ ...floatingBorder("hover", props),
15578
15581
  boxShadow: "md"
15579
15582
  },
15580
15583
  _active: {
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-3P7NVQKW.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-4QF4PJTK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "9.8.0",
3
+ "version": "9.8.2",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "@emotion/styled": "^11.10.4",
24
24
  "@internationalized/date": "^3.0.1",
25
25
  "@vygruppen/spor-design-tokens": ">3.4.0",
26
- "@vygruppen/spor-icon-react": ">3.2.3",
26
+ "@vygruppen/spor-icon-react": ">3.6.0",
27
27
  "@vygruppen/spor-loader": ">0.3.1",
28
28
  "awesome-phonenumber": "^5.10.0",
29
29
  "deepmerge": "^4.3.1",
@@ -14,7 +14,7 @@ import {
14
14
  import React, { useEffect, useRef, useState } from "react";
15
15
  import { AriaPositionProps, useButton, useOverlayTrigger } from "react-aria";
16
16
  import { useOverlayTriggerState } from "react-stately";
17
- import { Card } from "..";
17
+ import { StaticCard } from "..";
18
18
  import { Dialog } from "./Dialog";
19
19
  import { Popover } from "./Popover";
20
20
 
@@ -149,14 +149,16 @@ export const CardSelect = forwardRef<CardSelectProps, "button">(
149
149
  crossOffset={crossOffset}
150
150
  placement={placement}
151
151
  >
152
- <Card
152
+ <StaticCard
153
153
  colorScheme="white"
154
154
  size="lg"
155
+ border={"sm"}
156
+ borderColor={"grey"}
155
157
  sx={styles.card}
156
158
  {...overlayProps}
157
159
  >
158
160
  <Dialog aria-label={label}>{children}</Dialog>
159
- </Card>
161
+ </StaticCard>
160
162
  </Popover>
161
163
  )}
162
164
  </Box>
@@ -1,13 +1,15 @@
1
1
  import React from "react";
2
- import { Box, BoxProps, useStyleConfig } from "@chakra-ui/react";
2
+ import {
3
+ As,
4
+ Box,
5
+ BoxProps,
6
+ forwardRef,
7
+ useStyleConfig,
8
+ } from "@chakra-ui/react";
3
9
 
4
- type PressableCardProps = Omit<BoxProps, "as"> & {
5
- /** Use "floating" | "accent" | "base". Defaults to base */
10
+ type PressableCardProps = BoxProps & {
11
+ /** Defaults to "base" */
6
12
  variant: "floating" | "accent" | "base";
7
- /** Use "sm" | "lg". Defaults to sm */
8
- size?: "sm" | "lg";
9
- /** Use "button" | "a" | "label". Defaults to button */
10
- as: "button" | "a" | "label";
11
13
  };
12
14
 
13
15
  /**
@@ -17,7 +19,6 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
17
19
  * It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
18
20
  * If no `as` prop is provided, it defaults to a button.
19
21
  *
20
- * The `size` prop can be used to control the size of the card. It defaults to "sm".
21
22
  * The `variant` prop can be used to control the style variant of the card. It defaults to "base".
22
23
  *
23
24
  * Example usage:
@@ -41,17 +42,16 @@ type PressableCardProps = Omit<BoxProps, "as"> & {
41
42
  * @see StaticCard
42
43
  */
43
44
 
44
- export const PressableCard = ({
45
- children,
46
- as = "button",
47
- size = "sm",
48
- variant = "base",
49
- ...props
50
- }: PressableCardProps) => {
51
- const styles = useStyleConfig("PressableCard", { variant, size });
52
- return (
53
- <Box as={as} __css={styles} {...props}>
54
- {children}
55
- </Box>
56
- );
57
- };
45
+ export const PressableCard = forwardRef<PressableCardProps, As>(
46
+ ({ children, variant = "base", ...props }, ref) => {
47
+ const styles = useStyleConfig("PressableCard", {
48
+ variant,
49
+ });
50
+
51
+ return (
52
+ <Box __css={styles} {...props} ref={ref}>
53
+ {children}
54
+ </Box>
55
+ );
56
+ },
57
+ );
@@ -12,6 +12,7 @@ import React, { useId } from "react";
12
12
  type RadioCardProps = UseRadioProps &
13
13
  BoxProps & {
14
14
  children: React.ReactNode;
15
+ /** Defaults to "base" */
15
16
  variant: "floating" | "base";
16
17
  };
17
18
 
@@ -9,7 +9,16 @@ import React, { Children } from "react";
9
9
  type RadioCardGroupProps = RadioGroupProps & {
10
10
  children: React.ReactNode;
11
11
  props?: RadioGroupProps;
12
+ /** Defaults to "row" */
12
13
  direction?: StackDirection;
14
+ /** Defaults to "base" */
15
+ variant?: string;
16
+ /** The name of the radio group */
17
+ name?: string;
18
+ /** The default value of the radio group */
19
+ defaultValue?: string;
20
+ /** The callback function to be called when the radio group value changes */
21
+ onChange?: (value: string) => void;
13
22
  };
14
23
 
15
24
  /**
@@ -30,8 +30,8 @@ export type StackProps = Exclude<ChakraStackProps, "direction"> & {
30
30
  *
31
31
  * ```tsx
32
32
  * <Stack spacing={4}>
33
- * <Card>Here's one card</Card>
34
- * <Card>Here's another card, with a lot of space between it</Card>
33
+ * <StaticCard>Here's one card</StaticCard>
34
+ * <StaticCard>Here's another card, with a lot of space between it</StaticCard>
35
35
  * </Stack>
36
36
  * ```
37
37
  */
@@ -74,7 +74,7 @@ const EXPIRATION_DELAY = 1000 * 60 * 60 * 24 * 30; // 30 days
74
74
  * name="my-nudge"
75
75
  * content="Check out this enormous new feature!"
76
76
  * >
77
- * <Card variant="base" padding={2} width="fit-content">My new feature</Card>
77
+ * <StaticCard variant="base" padding={2} width="fit-content">My new feature</StaticCard>
78
78
  * </Nudge>
79
79
  * ```
80
80
  */
@@ -30,9 +30,9 @@ export type WizardNudgeProps = Omit<NudgeProps, "actions" | "content"> & {
30
30
  * name="my-wizard-nudge"
31
31
  * introducedDate="2024-02-19"
32
32
  * >
33
- * <Card width="fit-content" padding={2}>
33
+ * <StaticCard width="fit-content" padding={2}>
34
34
  * My new feature
35
- * </Card>
35
+ * </StaticCard>
36
36
  * </WizardNudge>
37
37
  * ```
38
38
  */
@@ -1,6 +1,6 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
3
- import { floatingBackground } from "../utils/floating-utils";
3
+ import { floatingBackground, floatingBorder } from "../utils/floating-utils";
4
4
  import { focusVisibleStyles } from "../utils/focus-utils";
5
5
  import { accentBackground } from "../utils/accent-utils";
6
6
 
@@ -12,6 +12,7 @@ const config = defineStyleConfig({
12
12
  fontSize: "inherit",
13
13
  display: "block",
14
14
  borderRadius: "md",
15
+ cursor: "pointer",
15
16
  ...focusVisibleStyles(props),
16
17
  _disabled: {
17
18
  ...baseBackground("disabled", props),
@@ -48,6 +49,7 @@ const config = defineStyleConfig({
48
49
  boxShadow: "sm",
49
50
  _hover: {
50
51
  ...floatingBackground("hover", props),
52
+ ...floatingBorder("hover", props),
51
53
  boxShadow: "md",
52
54
  },
53
55
  _active: {
@@ -1,6 +1,9 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { colors } from "../foundations";
3
3
  import { focusVisibleStyles } from "../utils/focus-utils";
4
+ import { bg } from "../utils/bg-utils";
5
+ import { floatingBackground } from "../utils/floating-utils";
6
+ import { mode } from "@chakra-ui/theme-tools";
4
7
 
5
8
  const config = defineStyleConfig({
6
9
  baseStyle: (props: any) => ({
@@ -32,12 +35,12 @@ type CardThemeProps = {
32
35
  | "darkYellow";
33
36
  };
34
37
 
35
- const getColorSchemeBaseProps = (props: CardThemeProps) => {
38
+ const getColorSchemeBaseProps = (props: any) => {
36
39
  switch (props.colorScheme) {
37
40
  case "white":
38
41
  return {
39
- backgroundColor: "white",
40
- color: "darkGrey",
42
+ ...floatingBackground("default", props),
43
+ color: mode("text.default.light", "text.default.dark")(props),
41
44
  };
42
45
  case "grey":
43
46
  return {