@vygruppen/spor-react 9.6.5 → 9.8.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.
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, 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-F6WDIMSM.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-3P7NVQKW.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "9.6.5",
3
+ "version": "9.8.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
package/src/card/Card.tsx CHANGED
@@ -50,8 +50,15 @@ export type CardProps = Exclude<BoxProps, "size"> & {
50
50
  * </Card>
51
51
  * ```
52
52
  */
53
+
54
+ /**
55
+ * @deprecated Card is deprecated. Use `StaticCard` or `PressableCard` instead.
56
+ */
53
57
  export const Card = forwardRef<CardProps, As>(
54
58
  ({ size = "sm", colorScheme = "white", children, ...props }, ref) => {
59
+ console.warn(
60
+ "Warning: Card is deprecated. Use `StaticCard` or `PressableCard` instead.",
61
+ );
55
62
  const styles = useStyleConfig("Card", {
56
63
  colorScheme,
57
64
  size,
@@ -1,3 +1 @@
1
1
  export * from "./Card";
2
- export * from "./StaticCard";
3
- export * from "./PressableCard";
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { Box, BoxProps, useStyleConfig } from "@chakra-ui/react";
3
+
4
+ type PressableCardProps = Omit<BoxProps, "as"> & {
5
+ /** Use "floating" | "accent" | "base". Defaults to base */
6
+ 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
+ };
12
+
13
+ /**
14
+ * `PressableCard` is a component that renders a pressable card.
15
+ *
16
+ * The `PressableCard` component can be used to create a card that responds to user interactions.
17
+ * It can be rendered as a button, link, label, or any other HTML element by specifying the `as` prop.
18
+ * If no `as` prop is provided, it defaults to a button.
19
+ *
20
+ * The `size` prop can be used to control the size of the card. It defaults to "sm".
21
+ * The `variant` prop can be used to control the style variant of the card. It defaults to "base".
22
+ *
23
+ * Example usage:
24
+ *
25
+ * ```tsx
26
+ * <PressableCard>
27
+ * Content
28
+ * </PressableCard>
29
+ * ```
30
+ *
31
+ * To render the card as a different HTML element, specify the `as` prop:
32
+ *
33
+ * ```tsx
34
+ * <PressableCard as="a">
35
+ * This is now a <a /> element
36
+ * </PressableCard>
37
+ * ```
38
+ *
39
+ * For a static card with other color schemes, use the `StaticCard` component.
40
+ *
41
+ * @see StaticCard
42
+ */
43
+
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
+ };
@@ -0,0 +1,95 @@
1
+ import {
2
+ BoxProps,
3
+ UseRadioProps,
4
+ chakra,
5
+ forwardRef,
6
+ useRadio,
7
+ useStyleConfig,
8
+ } from "@chakra-ui/react";
9
+ import { dataAttr } from "@chakra-ui/utils";
10
+ import React, { useId } from "react";
11
+
12
+ type RadioCardProps = UseRadioProps &
13
+ BoxProps & {
14
+ children: React.ReactNode;
15
+ variant: "floating" | "base";
16
+ };
17
+
18
+ /**
19
+ * Renders a radio card.
20
+ *
21
+ * The most basic version looks like this:
22
+ *
23
+ * ```tsx
24
+ * <RadioCard>
25
+ * Content
26
+ * </RadioCard>
27
+ * ```
28
+ *
29
+ * In order to use RadioCard, you typically want to place these components in a group with several other RadioCards.
30
+ *
31
+ * ```tsx
32
+ * <RadioCardGroup name="ticket">
33
+ * <RadioCard value="economy">Economy</RadioCard>
34
+ * <RadioCard value="business">Business</RadioCard>
35
+ * <RadioCard value="first-class">First Class</RadioCard>
36
+ * </RadioCardGroup>
37
+ * ```
38
+ *
39
+ * You can add styling to each card seperately, or you can add a common style to the group.
40
+ * Group styling overrides single styling if both are present.
41
+ *
42
+ * This example shows how to style all cards in a group:
43
+ *
44
+ * ```tsx
45
+ * <RadioCardGroup name="ticket" variant="floating" padding={3}>
46
+ * <RadioCard value="economy">Economy</RadioCard>
47
+ * <RadioCard value="business">Business</RadioCard>
48
+ * <RadioCard value="first-class">First Class</RadioCard>
49
+ * </RadioCardGroup>
50
+ * ```
51
+ *
52
+ * This example shows how to style a single card:
53
+ *
54
+ * ```tsx
55
+ * <RadioCard variant="floating" padding={3}>
56
+ * Economy
57
+ * </RadioCard>
58
+ * ```
59
+ */
60
+
61
+ export const RadioCard = forwardRef<RadioCardProps, "div">(
62
+ ({ children, variant = "base", ...props }, ref) => {
63
+ const { getInputProps, getRadioProps, getRootProps, state } =
64
+ useRadio(props);
65
+
66
+ const styles = useStyleConfig("RadioCard", { variant });
67
+
68
+ const input = getInputProps({}, ref);
69
+ const radio = getRadioProps();
70
+
71
+ const id = `radio-card-${useId()}`;
72
+
73
+ return (
74
+ <chakra.label
75
+ htmlFor={id}
76
+ {...getRootProps()}
77
+ aria-label={String(children)}
78
+ >
79
+ <chakra.input {...input} id={id} disabled={state.isDisabled} />
80
+ <chakra.div
81
+ __css={styles}
82
+ {...radio}
83
+ data-checked={dataAttr(state.isChecked)}
84
+ data-hover={dataAttr(state.isHovered)}
85
+ data-focus={dataAttr(state.isFocused)}
86
+ data-active={dataAttr(state.isActive)}
87
+ data-disabled={dataAttr(state.isDisabled)}
88
+ {...props}
89
+ >
90
+ {children}
91
+ </chakra.div>
92
+ </chakra.label>
93
+ );
94
+ },
95
+ );
@@ -0,0 +1,81 @@
1
+ import {
2
+ useRadioGroup,
3
+ RadioGroupProps,
4
+ StackDirection,
5
+ Stack,
6
+ } from "@chakra-ui/react";
7
+ import React, { Children } from "react";
8
+
9
+ type RadioCardGroupProps = RadioGroupProps & {
10
+ children: React.ReactNode;
11
+ props?: RadioGroupProps;
12
+ direction?: StackDirection;
13
+ };
14
+
15
+ /**
16
+ * Radio card groups are used to group several radio cards together.
17
+ *
18
+ * You can and should pass the common `name` prop to the `RadioGroup`, instead of to each `Radio` component.
19
+ *
20
+ * ```tsx
21
+ * <RadioCardGroup name="ticket">
22
+ * <RadioCard>Economy</RadioCard>
23
+ * <RadioCard>Business</RadioCard>
24
+ * <RadioCard>First Class</RadioCard>
25
+ * </RadioCardGroup>
26
+ * ```
27
+ *
28
+ * By default, radio cards show up horizontally. If you want them to show up vertically, please specify the `direction="column"` prop.
29
+ *
30
+ * ```tsx
31
+ * <RadioCardGroup name="ticket" direction="column">
32
+ * <RadioCard>Economy</RadioCard>
33
+ * <RadioCard>Business</RadioCard>
34
+ * <RadioCard>First Class</RadioCard>
35
+ * </RadioCardGroup>
36
+ * ```
37
+ *
38
+ * You can also specify the `defaultValue` prop to set the default value of the radio group.
39
+ *
40
+ * ```tsx
41
+ * <RadioCardGroup name="ticket" defaultValue="Economy">
42
+ * <RadioCard>Economy</RadioCard>
43
+ * <RadioCard>Business</RadioCard>
44
+ * <RadioCard>First Class</RadioCard>
45
+ * </RadioCardGroup>
46
+ * ```
47
+ *
48
+ * Check out RadioCard for more information on how to style the radio cards.
49
+ * @see RadioCard
50
+ */
51
+
52
+ export const RadioCardGroup = ({
53
+ children,
54
+ name,
55
+ direction = "row",
56
+ onChange,
57
+ defaultValue,
58
+ variant = "base",
59
+ ...props
60
+ }: RadioCardGroupProps) => {
61
+ const { getRootProps, getRadioProps } = useRadioGroup({
62
+ defaultValue: defaultValue,
63
+ name: name,
64
+ onChange: onChange,
65
+ ...props,
66
+ });
67
+
68
+ const group = getRootProps();
69
+
70
+ return (
71
+ <Stack direction={direction} {...group}>
72
+ {Children.map(
73
+ children as React.ReactElement[],
74
+ (child: React.ReactElement) => {
75
+ const radio = getRadioProps({ value: child.props.value });
76
+ return React.cloneElement(child, { ...radio, variant, ...props });
77
+ },
78
+ )}
79
+ </Stack>
80
+ );
81
+ };
@@ -0,0 +1,77 @@
1
+ import React from "react";
2
+ import {
3
+ As,
4
+ Box,
5
+ BoxProps,
6
+ useStyleConfig,
7
+ forwardRef,
8
+ Card,
9
+ } from "@chakra-ui/react";
10
+
11
+ export type StaticCardProps = BoxProps & {
12
+ children: React.ReactNode;
13
+ /** Defaults to "white" */
14
+ colorScheme:
15
+ | "white"
16
+ | "grey"
17
+ | "green"
18
+ | "orange"
19
+ | "red"
20
+ | "yellow"
21
+ | "blue"
22
+ | "darkBlue"
23
+ | "darkGreen"
24
+ | "darkYellow";
25
+ };
26
+
27
+ /**
28
+ * `StaticCard` is a component that renders a static card.
29
+ *
30
+ * The `StaticCard` component can be used to create a card that does not respond to user interactions.
31
+ * It can be rendered as any HTML element by specifying the `as` prop.
32
+ *
33
+ * The `colorScheme` prop can be used to control the color scheme of the card. It defaults to "white".
34
+ *
35
+ * Example usage:
36
+ *
37
+ * ```tsx
38
+ * <StaticCard>
39
+ * Content
40
+ * </StaticCard>
41
+ * ```
42
+ *
43
+ * To render the card as a different HTML element, specify the `as` prop:
44
+ *
45
+ * ```tsx
46
+ * <StaticCard as="section">
47
+ * This is now a <section /> element
48
+ * </StaticCard>
49
+ * ```
50
+ *
51
+ * To change the color scheme of the card, specify the `colorScheme` prop:
52
+ *
53
+ * ```tsx
54
+ * <StaticCard colorScheme="orange">
55
+ * An orange card
56
+ * </StaticCard>
57
+ * ```
58
+ *
59
+ * For a card with click functionality, use the `PressableCard` component.
60
+ *
61
+ * @see PressableCard
62
+ */
63
+
64
+ export const StaticCard = forwardRef<StaticCardProps, As>(
65
+ ({ colorScheme = "white", children, ...props }, ref) => {
66
+ const styles = useStyleConfig("StaticCard", {
67
+ colorScheme,
68
+ });
69
+
70
+ return (
71
+ <Box __css={styles} {...props} ref={ref}>
72
+ {children}
73
+ <Card />
74
+ </Box>
75
+ );
76
+ },
77
+ );
@@ -26,3 +26,7 @@ export type {
26
26
  } from "@chakra-ui/react";
27
27
  export * from "./Divider";
28
28
  export * from "./Stack";
29
+ export * from "./RadioCard";
30
+ export * from "./RadioCardGroup";
31
+ export * from "./StaticCard";
32
+ export * from "./PressableCard";
@@ -30,6 +30,7 @@ export { default as Pagination } from "./pagination";
30
30
  export { default as Popover } from "./popover";
31
31
  export { default as ProgressBar } from "./progress-bar";
32
32
  export { default as ProgressIndicator } from "./progress-indicator";
33
+ export { default as RadioCard } from "./radio-card";
33
34
  export { default as Radio } from "./radio";
34
35
  export { default as Select } from "./select";
35
36
  export { default as Skeleton } from "./skeleton";
@@ -1,179 +1,61 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
- import { mode } from "@chakra-ui/theme-tools";
3
2
  import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
4
- import { floatingBackground, floatingBorder } from "../utils/floating-utils";
3
+ import { floatingBackground } from "../utils/floating-utils";
5
4
  import { focusVisibleStyles } from "../utils/focus-utils";
6
- import { accentBackground, accentText } from "../utils/accent-utils";
5
+ import { accentBackground } from "../utils/accent-utils";
7
6
 
8
7
  const config = defineStyleConfig({
9
- baseStyle: (props: any) => ({
8
+ baseStyle: (props) => ({
10
9
  appearance: "none",
11
10
  border: "none",
12
11
  overflow: "hidden",
13
12
  fontSize: "inherit",
14
13
  display: "block",
15
14
  borderRadius: "md",
16
- ...getColorSchemeBaseProps(props),
17
- ...getColorSchemeClickableProps(props),
18
15
  ...focusVisibleStyles(props),
19
- ...getColorSchemeActiveProps(props),
20
- _hover: getColorSchemeHoverProps(props),
21
16
  _disabled: {
22
17
  ...baseBackground("disabled", props),
23
- ...baseBorder("disabled", props),
24
18
  ...baseText("disabled", props),
19
+ outline: "none",
25
20
  pointerEvents: "none",
26
21
  },
27
22
  }),
28
23
  variants: {
29
24
  base: (props) => ({
30
- ...baseBackground("default", props),
25
+ ...baseBorder("default", props),
31
26
  _hover: {
32
- ...baseBackground("hover", props),
27
+ ...baseBorder("hover", props),
33
28
  },
34
29
  _active: {
35
30
  ...baseBackground("active", props),
31
+ ...baseBorder("active", props),
36
32
  },
37
33
  }),
38
34
  accent: (props) => ({
39
35
  ...accentBackground("default", props),
36
+ boxShadow: "sm",
40
37
  _hover: {
41
38
  ...accentBackground("hover", props),
39
+ boxShadow: "sm",
42
40
  },
43
41
  _active: {
44
42
  ...accentBackground("active", props),
43
+ boxShadow: "none",
45
44
  },
46
45
  }),
47
46
  floating: (props) => ({
48
47
  ...floatingBackground("default", props),
49
- _hover: {
50
- ...floatingBackground("hover", props),
51
- },
52
- _active: {
53
- ...floatingBackground("active", props),
54
- },
55
- }),
56
- },
57
- sizes: {
58
- sm: {
59
48
  boxShadow: "sm",
60
-
61
49
  _hover: {
50
+ ...floatingBackground("hover", props),
62
51
  boxShadow: "md",
63
52
  },
64
-
65
53
  _active: {
54
+ ...floatingBackground("active", props),
66
55
  boxShadow: "none",
67
56
  },
68
- },
69
- lg: {
70
- boxShadow: "md",
71
-
72
- _hover: {
73
- boxShadow: "lg",
74
- },
75
-
76
- _active: {
77
- boxShadow: "sm",
78
- },
79
- },
57
+ }),
80
58
  },
81
59
  });
82
60
 
83
61
  export default config;
84
-
85
- type CardThemeProps = {
86
- colorScheme: "accent" | "default";
87
- theme: any;
88
- colorMode: "light" | "dark";
89
- };
90
-
91
- const getColorSchemeBaseProps = (props: CardThemeProps) => {
92
- switch (props.colorScheme) {
93
- case "default":
94
- return {
95
- ...baseBorder("default", props),
96
- backgroundColor: mode(
97
- "white",
98
- `color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
99
- )(props),
100
- color: "inherit",
101
- };
102
- case "accent":
103
- return {
104
- ...accentBackground("default", props),
105
- ...accentText("default", props),
106
- _hover: {
107
- ...accentBackground("hover", props),
108
- },
109
- _active: {
110
- ...accentBackground("active", props),
111
- },
112
- };
113
- }
114
- };
115
-
116
- function getColorSchemeClickableProps(props: CardThemeProps) {
117
- switch (props.colorScheme) {
118
- case "default":
119
- return {
120
- ...floatingBorder("default", props),
121
- };
122
- case "accent":
123
- return {
124
- ...accentBackground("default", props),
125
- ...accentText("default", props),
126
- _hover: {
127
- ...accentBackground("hover", props),
128
- },
129
- _active: {
130
- ...accentBackground("active", props),
131
- },
132
- };
133
- }
134
- }
135
-
136
- const getColorSchemeHoverProps = (props: CardThemeProps) => {
137
- switch (props.colorScheme) {
138
- case "default":
139
- return {
140
- backgroundColor: mode(
141
- "white",
142
- `color-mix(in srgb, white 20%, var(--spor-colors-bg-default-dark))`,
143
- )(props),
144
- ...floatingBorder("hover", props),
145
- };
146
- case "accent":
147
- return {
148
- ...accentBackground("default", props),
149
- ...accentText("default", props),
150
- _hover: {
151
- ...accentBackground("hover", props),
152
- },
153
- _active: {
154
- ...accentBackground("active", props),
155
- },
156
- };
157
- }
158
- };
159
- const getColorSchemeActiveProps = (props: CardThemeProps) => {
160
- const { colorScheme } = props;
161
- switch (colorScheme) {
162
- case "default":
163
- return {
164
- backgroundColor: mode("bg.tertiary.light", `bg.default.dark`)(props),
165
- ...floatingBorder("active", props),
166
- };
167
- case "accent":
168
- return {
169
- ...accentBackground("default", props),
170
- ...accentText("default", props),
171
- _hover: {
172
- ...accentBackground("hover", props),
173
- },
174
- _active: {
175
- ...accentBackground("active", props),
176
- },
177
- };
178
- }
179
- };
@@ -0,0 +1,64 @@
1
+ import { defineStyleConfig } from "@chakra-ui/react";
2
+ import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
3
+ import { floatingBackground, floatingBorder } from "../utils/floating-utils";
4
+ import { focusVisibleStyles } from "../utils/focus-utils";
5
+
6
+ const config = defineStyleConfig({
7
+ baseStyle: (props: any) => ({
8
+ appearance: "none",
9
+ border: "none",
10
+ overflow: "hidden",
11
+ fontSize: "inherit",
12
+ display: "block",
13
+ borderRadius: "sm",
14
+ ...focusVisibleStyles(props),
15
+ _checked: {
16
+ outline: "1px solid",
17
+ outlineColor: "greenHaze",
18
+ ...floatingBackground("active", props),
19
+ _hover: {
20
+ ...floatingBackground("active", props),
21
+ },
22
+ },
23
+ _disabled: {
24
+ pointerEvents: "none",
25
+ ...baseBackground("disabled", props),
26
+ ...baseBorder("disabled", props),
27
+ ...baseText("disabled", props),
28
+ },
29
+ }),
30
+ variants: {
31
+ base: (props) => ({
32
+ ...baseBackground("default", props),
33
+ ...baseBorder("default", props),
34
+ _hover: {
35
+ ...baseBackground("hover", props),
36
+ ...baseBorder("hover", props),
37
+ },
38
+ _active: {
39
+ ...baseBackground("active", props),
40
+ },
41
+ }),
42
+ floating: (props) => ({
43
+ ...floatingBackground("default", props),
44
+ boxShadow: "sm",
45
+ _hover: {
46
+ ...floatingBackground("hover", props),
47
+ ...floatingBorder("hover", props),
48
+ boxShadow: "md",
49
+ },
50
+ _active: {
51
+ ...floatingBackground("active", props),
52
+ ...floatingBorder("active", props),
53
+ },
54
+ _checked: {
55
+ _hover: {
56
+ outline: "1px solid",
57
+ outlineColor: "silver",
58
+ },
59
+ },
60
+ }),
61
+ },
62
+ });
63
+
64
+ export default config;
@@ -1,7 +1,6 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
- import { mode } from "@chakra-ui/theme-tools";
3
2
  import { colors } from "../foundations";
4
- import { baseBorder, baseText } from "../utils/base-utils";
3
+ import { focusVisibleStyles } from "../utils/focus-utils";
5
4
 
6
5
  const config = defineStyleConfig({
7
6
  baseStyle: (props: any) => ({
@@ -11,8 +10,8 @@ const config = defineStyleConfig({
11
10
  fontSize: "inherit",
12
11
  display: "block",
13
12
  borderRadius: "md",
14
- // Except for white cards, all cards are light mode always
15
13
  color: "text.default.light",
14
+ ...focusVisibleStyles(props),
16
15
  ...getColorSchemeBaseProps(props),
17
16
  }),
18
17
  });
@@ -31,20 +30,14 @@ type CardThemeProps = {
31
30
  | "darkBlue"
32
31
  | "darkGreen"
33
32
  | "darkYellow";
34
- theme: any;
35
- colorMode: "light" | "dark";
36
33
  };
37
34
 
38
35
  const getColorSchemeBaseProps = (props: CardThemeProps) => {
39
36
  switch (props.colorScheme) {
40
37
  case "white":
41
38
  return {
42
- ...baseBorder("default", props),
43
- backgroundColor: mode(
44
- "white",
45
- `color-mix(in srgb, white 10%, var(--spor-colors-bg-default-dark))`,
46
- )(props),
47
- color: "inherit",
39
+ backgroundColor: "white",
40
+ color: "darkGrey",
48
41
  };
49
42
  case "grey":
50
43
  return {
@@ -80,7 +73,6 @@ const getColorSchemeBaseProps = (props: CardThemeProps) => {
80
73
  default:
81
74
  return {
82
75
  backgroundColor: colors[props.colorScheme]?.[100] ?? "default",
83
- ...baseText("default", props),
84
76
  };
85
77
  }
86
78
  };
@@ -22,12 +22,10 @@ const config = helpers.defineMultiStyleConfig({
22
22
  th: {
23
23
  fontWeight: "bold",
24
24
  textAlign: "start",
25
- verticalAlign: "top",
26
25
  minWidth: "68px",
27
26
  },
28
27
  td: {
29
28
  textAlign: "start",
30
- verticalAlign: "top",
31
29
  },
32
30
  tfoot: {
33
31
  tr: {