@vygruppen/spor-react 6.2.2 → 7.0.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.
Files changed (45) hide show
  1. package/.turbo/turbo-build.log +10 -10
  2. package/CHANGELOG.md +20 -0
  3. package/dist/{CountryCodeSelect-FJ6OGX3Z.mjs → CountryCodeSelect-OK6RZ6AY.mjs} +1 -1
  4. package/dist/{chunk-2OBDF3T7.mjs → chunk-CYU6YFQK.mjs} +167 -642
  5. package/dist/index.d.mts +483 -497
  6. package/dist/index.d.ts +483 -497
  7. package/dist/index.js +196 -673
  8. package/dist/index.mjs +1 -1
  9. package/package.json +1 -1
  10. package/src/button/Button.tsx +4 -4
  11. package/src/input/NumericStepper.tsx +0 -4
  12. package/src/theme/components/accordion.ts +4 -15
  13. package/src/theme/components/breadcrumb.ts +2 -14
  14. package/src/theme/components/button.ts +5 -55
  15. package/src/theme/components/card-select.ts +11 -26
  16. package/src/theme/components/card.ts +2 -18
  17. package/src/theme/components/checkbox.ts +4 -12
  18. package/src/theme/components/choice-chip.ts +2 -11
  19. package/src/theme/components/close-button.ts +2 -14
  20. package/src/theme/components/code.ts +1 -1
  21. package/src/theme/components/datepicker.ts +14 -65
  22. package/src/theme/components/drawer.ts +7 -7
  23. package/src/theme/components/fab.ts +6 -63
  24. package/src/theme/components/form-label.ts +1 -1
  25. package/src/theme/components/form.ts +1 -1
  26. package/src/theme/components/info-select.ts +5 -35
  27. package/src/theme/components/info-tag.ts +1 -1
  28. package/src/theme/components/input.ts +9 -31
  29. package/src/theme/components/link.ts +5 -29
  30. package/src/theme/components/listbox.ts +3 -5
  31. package/src/theme/components/media-controller-button.ts +5 -46
  32. package/src/theme/components/modal.ts +7 -7
  33. package/src/theme/components/popover.ts +7 -15
  34. package/src/theme/components/progress-indicator.ts +1 -5
  35. package/src/theme/components/radio.ts +5 -11
  36. package/src/theme/components/select.ts +2 -2
  37. package/src/theme/components/stepper.ts +6 -6
  38. package/src/theme/components/switch.ts +5 -73
  39. package/src/theme/components/table.ts +18 -18
  40. package/src/theme/components/tabs.ts +11 -14
  41. package/src/theme/components/travel-tag.ts +2 -15
  42. package/src/theme/font-faces.ts +1 -1
  43. package/src/theme/utils/focus-util.ts +10 -0
  44. package/tsconfig.json +2 -2
  45. package/src/theme/utils/focus-utils.ts +0 -16
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-2OBDF3T7.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-CYU6YFQK.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
- "version": "6.2.2",
3
+ "version": "7.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -115,19 +115,19 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
115
115
  </Center>
116
116
  )}
117
117
  <Flex
118
- justifyContent="space-between"
118
+ gap={1}
119
119
  flex={1}
120
120
  alignItems="center"
121
- gap={1}
121
+ justifyContent={rightIcon ? "space-between" : "center"}
122
122
  visibility={isLoading ? "hidden" : "visible"}
123
123
  aria-hidden={isLoading}
124
124
  >
125
- <Flex justifyContent="center" alignItems="center" gap={1}>
125
+ <Flex gap={1}>
126
126
  {leftIcon}
127
127
  <Box
128
128
  visibility={isLoading ? "hidden" : "visible"}
129
129
  whiteSpace="normal"
130
- textAlign="left"
130
+ textAlign="center"
131
131
  >
132
132
  {children}
133
133
  </Box>
@@ -196,10 +196,6 @@ const VerySmallButton = (props: VerySmallButtonProps) => {
196
196
  size="xs"
197
197
  minWidth="24px"
198
198
  minHeight="24px"
199
- _focusVisible={{
200
- boxShadow:
201
- "inset 0 0 0 2px var(--spor-colors-pine), inset 0 0 0 3px white",
202
- }}
203
199
  {...props}
204
200
  />
205
201
  );
@@ -1,9 +1,9 @@
1
1
  import { accordionAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
3
+ import { mode } from "@chakra-ui/theme-tools";
3
4
  import { colors, shadows } from "../foundations";
4
5
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisible } from "../utils/focus-utils";
6
- import { mode } from "@chakra-ui/theme-tools";
6
+ import { focusVisibleStyles } from "../utils/focus-util";
7
7
 
8
8
  const helpers = createMultiStyleConfigHelpers(parts.keys);
9
9
  const config = helpers.defineMultiStyleConfig({
@@ -18,25 +18,14 @@ const config = helpers.defineMultiStyleConfig({
18
18
  transitionDuration: "normal",
19
19
  border: "none",
20
20
  borderRadius: "sm",
21
+ borderColor: "osloGrey",
21
22
  display: "flex",
22
23
  justifyContent: "space-between",
23
24
  color: mode("darkGrey", "white")(props),
24
25
  textAlign: "left",
25
26
  fontFamily: "body",
26
27
  fontWeight: "bold",
27
- ...focusVisible({
28
- notFocus: {
29
- boxShadow: getBoxShadowString({
30
- borderColor: "osloGrey",
31
- }),
32
- },
33
- focus: {
34
- boxShadow: getBoxShadowString({
35
- borderColor: mode("greenHaze", "azure")(props),
36
- borderWidth: 2,
37
- }),
38
- },
39
- }),
28
+ ...focusVisibleStyles(props),
40
29
  _disabled: {
41
30
  opacity: 0.4,
42
31
  cursor: "not-allowed",
@@ -4,8 +4,7 @@ import {
4
4
  defineStyle,
5
5
  } from "@chakra-ui/styled-system";
6
6
  import { mode } from "@chakra-ui/theme-tools";
7
- import { getBoxShadowString } from "../utils/box-shadow-utils";
8
- import { focusVisible } from "../utils/focus-utils";
7
+ import { focusVisibleStyles } from "../utils/focus-util";
9
8
 
10
9
  const { defineMultiStyleConfig, definePartsStyle } =
11
10
  createMultiStyleConfigHelpers(parts.keys);
@@ -14,7 +13,6 @@ const baseStyleLink = defineStyle((props) => ({
14
13
  transitionProperty: "common",
15
14
  transitionDuration: "fast",
16
15
  transitionTimingFunction: "ease-out",
17
- outline: "none",
18
16
  color: "inherit",
19
17
  textDecoration: "none",
20
18
  textStyle: "xs",
@@ -25,17 +23,7 @@ const baseStyleLink = defineStyle((props) => ({
25
23
  _hover: {
26
24
  backgroundColor: mode("seaMist", "pine")(props),
27
25
  },
28
- ...focusVisible({
29
- focus: {
30
- boxShadow: getBoxShadowString({
31
- borderColor: mode("greenHaze", "azure")(props),
32
- borderWidth: 2,
33
- }),
34
- },
35
- notFocus: {
36
- boxShadow: "none",
37
- },
38
- }),
26
+ ...focusVisibleStyles(props),
39
27
  _active: {
40
28
  backgroundColor: mode("mint", "whiteAlpha.200")(props),
41
29
  },
@@ -2,13 +2,15 @@ import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { mode } from "@chakra-ui/theme-tools";
3
3
  import { colors } from "../foundations";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
5
6
 
6
7
  const config = defineStyleConfig({
7
- baseStyle: {
8
+ baseStyle: (props) => ({
8
9
  border: 0,
9
10
  borderRadius: "xl",
10
11
  display: "flex",
11
12
  alignItems: "center",
13
+ justifyContent: "center",
12
14
  transitionProperty: "common",
13
15
  transitionDuration: "normal",
14
16
  textWrap: "wrap",
@@ -18,6 +20,7 @@ const config = defineStyleConfig({
18
20
  boxShadow: 0,
19
21
  outline: 0,
20
22
  },
23
+ ...focusVisibleStyles(props),
21
24
  _disabled: {
22
25
  cursor: "not-allowed",
23
26
  boxShadow: "none",
@@ -29,22 +32,13 @@ const config = defineStyleConfig({
29
32
  background: "silver",
30
33
  },
31
34
  },
32
- },
35
+ }),
33
36
  variants: {
34
37
  primary: (props) => ({
35
38
  // FIXME: Update to use a global defined background color for darkMode whenever it is available.
36
39
  // hardcoded background color as alpha-"hack" below is not feasible for dark mode with solid background color
37
40
  backgroundColor: mode("pine", "coralGreen")(props),
38
41
  color: mode("white", "darkTeal")(props),
39
- _focusVisible: {
40
- boxShadow: `inset 0 0 0 2px ${mode(
41
- colors.greenHaze,
42
- colors.azure,
43
- )(props)}, inset 0 0 0 4px ${mode(
44
- colors.white,
45
- colors.darkGrey,
46
- )(props)}`,
47
- },
48
42
  _hover: {
49
43
  backgroundColor: mode("darkTeal", "blueGreen")(props),
50
44
  },
@@ -60,24 +54,6 @@ const config = defineStyleConfig({
60
54
  _hover: {
61
55
  backgroundColor: mode("coralGreen", "greenHaze")(props),
62
56
  },
63
- _focusVisible: {
64
- boxShadow: `inset 0 0 0 2px ${mode(
65
- colors.greenHaze,
66
- colors.primaryGreen,
67
- )(props)}, inset 0 0 0 4px ${mode(
68
- colors.white,
69
- colors.darkTeal,
70
- )(props)}`,
71
- _hover: {
72
- boxShadow: `inset 0 0 0 2px ${mode(
73
- colors.greenHaze,
74
- colors.azure,
75
- )(props)}, inset 0 0 0 4px ${mode(
76
- colors.white,
77
- colors.blackAlpha[500],
78
- )(props)}`,
79
- },
80
- },
81
57
  _active: {
82
58
  backgroundColor: mode("mint", "darkTeal")(props),
83
59
  boxShadow: `inset 0 0 0 2px ${mode(
@@ -105,12 +81,6 @@ const config = defineStyleConfig({
105
81
  colors.blackAlpha[400],
106
82
  colors.whiteAlpha[400],
107
83
  )(props)}`,
108
- _focusVisible: {
109
- boxShadow: getBoxShadowString({
110
- borderWidth: 2,
111
- borderColor: "azure",
112
- }),
113
- },
114
84
  _hover: {
115
85
  boxShadow: `inset 0 0 0 2px currentColor`,
116
86
  },
@@ -125,12 +95,6 @@ const config = defineStyleConfig({
125
95
  ghost: (props) => ({
126
96
  backgroundColor: "transparent",
127
97
  color: mode("darkGrey", "white")(props),
128
- _focusVisible: {
129
- boxShadow: getBoxShadowString({
130
- borderColor: mode("greenHaze", "azure")(props),
131
- borderWidth: 2,
132
- }),
133
- },
134
98
  _hover: {
135
99
  backgroundColor: mode("seaMist", "whiteAlpha.200")(props),
136
100
  _disabled: {
@@ -158,20 +122,6 @@ const config = defineStyleConfig({
158
122
  borderWidth: 2,
159
123
  }),
160
124
  },
161
- _focusVisible: {
162
- boxShadow: getBoxShadowString({
163
- borderColor: mode("greenHaze", "azure")(props),
164
- borderWidth: 2,
165
- baseShadow: "sm",
166
- }),
167
- _hover: {
168
- boxShadow: getBoxShadowString({
169
- borderColor: mode("greenHaze", "azure")(props),
170
- borderWidth: 2,
171
- baseShadow: "md",
172
- }),
173
- },
174
- },
175
125
  }),
176
126
  },
177
127
  sizes: {
@@ -1,13 +1,13 @@
1
1
  import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/styled-system";
3
- import { StyleFunctionProps, mode } from "@chakra-ui/theme-tools";
4
- import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisible } from "../utils/focus-utils";
3
+ import { mode } from "@chakra-ui/theme-tools";
6
4
  import {
7
5
  baseBackground,
8
6
  floatingBackground,
9
7
  ghostBackground,
10
8
  } from "../utils/background-utils";
9
+ import { getBoxShadowString } from "../utils/box-shadow-utils";
10
+ import { focusVisibleStyles } from "../utils/focus-util";
11
11
 
12
12
  const parts = anatomy("card-select").parts("trigger", "card");
13
13
 
@@ -18,16 +18,7 @@ const config = helpers.defineMultiStyleConfig({
18
18
  appearance: "none",
19
19
  display: "flex",
20
20
  alignItems: "center",
21
- ...focusVisible({
22
- notFocus: {},
23
- focus: {
24
- boxShadow: getBoxShadowString({
25
- borderColor: "greenHaze",
26
- borderWidth: 3,
27
- }),
28
- outline: "none",
29
- },
30
- }),
21
+ ...focusVisibleStyles(props),
31
22
  },
32
23
  card: {
33
24
  borderRadius: "sm",
@@ -43,20 +34,10 @@ const config = helpers.defineMultiStyleConfig({
43
34
  boxShadow: getBoxShadowString({
44
35
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
45
36
  }),
46
- ...focusVisible({
47
- notFocus: { boxShadow: "none" },
48
- focus: {
49
- boxShadow: getBoxShadowString({
50
- borderColor: "greenHaze",
51
- borderWidth: 3,
52
- }),
53
- outline: "none",
54
- },
55
- }),
56
37
  _hover: {
57
38
  boxShadow: getBoxShadowString({
58
39
  borderColor: mode("darkGrey", "white")(props),
59
- borderWidth: 3,
40
+ borderWidth: 2,
60
41
  }),
61
42
  },
62
43
  _active: {
@@ -98,13 +79,17 @@ const config = helpers.defineMultiStyleConfig({
98
79
  floating: (props) => ({
99
80
  trigger: {
100
81
  ...floatingBackground("default", props),
101
- boxShadow: "sm",
82
+ boxShadow: getBoxShadowString({
83
+ borderColor: mode("silver", "whiteAlpha.400")(props),
84
+ borderWidth: 1,
85
+ baseShadow: "sm",
86
+ }),
102
87
  transition: "all .1s ease-out",
103
88
  _hover: {
104
89
  ...floatingBackground("hover", props),
105
90
  boxShadow: getBoxShadowString({
106
91
  borderColor: mode("silver", "whiteAlpha.400")(props),
107
- borderWidth: 1,
92
+ borderWidth: 2,
108
93
  baseShadow: "sm",
109
94
  }),
110
95
  },
@@ -2,6 +2,7 @@ import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { mode } from "@chakra-ui/theme-tools";
3
3
  import { colors } from "../foundations";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
5
6
 
6
7
  const config = defineStyleConfig({
7
8
  baseStyle: (props: any) => ({
@@ -18,16 +19,8 @@ const config = defineStyleConfig({
18
19
  "button&, a&, label&, &.is-clickable": {
19
20
  ...getColorSchemeClickableProps(props),
20
21
  _hover: getColorSchemeHoverProps(props),
22
+ ...focusVisibleStyles(props),
21
23
  _active: getColorSchemeActiveProps(props),
22
- _focusVisible: {
23
- boxShadow: getBoxShadowString({
24
- borderColor: mode("greenHaze", "azure")(props),
25
- borderWidth: 2,
26
- isInset: false,
27
- }),
28
- outline: "none",
29
- _active: getColorSchemeActiveProps(props),
30
- },
31
24
  _disabled: {
32
25
  backgroundColor: "platinum",
33
26
  boxShadow: getBoxShadowString({
@@ -98,7 +91,6 @@ function getColorSchemeClickableProps({ colorScheme, size }: CardThemeProps) {
98
91
  boxShadow: getBoxShadowString({
99
92
  baseShadow,
100
93
  borderColor: "silver",
101
- isInset: false,
102
94
  }),
103
95
  };
104
96
  case "grey":
@@ -106,7 +98,6 @@ function getColorSchemeClickableProps({ colorScheme, size }: CardThemeProps) {
106
98
  boxShadow: getBoxShadowString({
107
99
  baseShadow,
108
100
  borderColor: "steel",
109
- isInset: false,
110
101
  }),
111
102
  };
112
103
  default:
@@ -115,7 +106,6 @@ function getColorSchemeClickableProps({ colorScheme, size }: CardThemeProps) {
115
106
  boxShadow: getBoxShadowString({
116
107
  baseShadow,
117
108
  borderColor: colors[colorScheme]?.[200] ?? "silver",
118
- isInset: false,
119
109
  }),
120
110
  };
121
111
  }
@@ -131,7 +121,6 @@ const getColorSchemeHoverProps = (props: CardThemeProps) => {
131
121
  boxShadow: getBoxShadowString({
132
122
  baseShadow,
133
123
  borderColor: colors.steel,
134
- isInset: false,
135
124
  }),
136
125
  };
137
126
  case "grey":
@@ -139,7 +128,6 @@ const getColorSchemeHoverProps = (props: CardThemeProps) => {
139
128
  boxShadow: getBoxShadowString({
140
129
  baseShadow,
141
130
  borderColor: colors.osloGrey,
142
- isInset: false,
143
131
  }),
144
132
  };
145
133
  default:
@@ -148,7 +136,6 @@ const getColorSchemeHoverProps = (props: CardThemeProps) => {
148
136
  boxShadow: getBoxShadowString({
149
137
  baseShadow,
150
138
  borderColor: colors[colorScheme]?.[400] ?? colors.silver,
151
- isInset: false,
152
139
  }),
153
140
  };
154
141
  }
@@ -163,7 +150,6 @@ const getColorSchemeActiveProps = (props: CardThemeProps) => {
163
150
  boxShadow: getBoxShadowString({
164
151
  baseShadow,
165
152
  borderColor: colors.silver,
166
- isInset: false,
167
153
  }),
168
154
  };
169
155
  case "grey":
@@ -172,7 +158,6 @@ const getColorSchemeActiveProps = (props: CardThemeProps) => {
172
158
  boxShadow: getBoxShadowString({
173
159
  baseShadow,
174
160
  borderColor: colors.steel,
175
- isInset: false,
176
161
  }),
177
162
  };
178
163
  default:
@@ -181,7 +166,6 @@ const getColorSchemeActiveProps = (props: CardThemeProps) => {
181
166
  boxShadow: getBoxShadowString({
182
167
  baseShadow,
183
168
  borderColor: colors[colorScheme]?.[100] ?? colors.silver,
184
- isInset: false,
185
169
  }),
186
170
  };
187
171
  }
@@ -1,10 +1,11 @@
1
1
  import { checkboxAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
+ import { focusVisibleStyles } from "../utils/focus-util";
3
4
 
4
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
5
6
 
6
7
  const config = helpers.defineMultiStyleConfig({
7
- baseStyle: {
8
+ baseStyle: (props) => ({
8
9
  container: {
9
10
  _hover: {
10
11
  "input:enabled:not([aria-invalid]) + .chakra-checkbox__control": {
@@ -48,10 +49,7 @@ const config = helpers.defineMultiStyleConfig({
48
49
  borderColor: "primaryGreen",
49
50
  color: "white",
50
51
 
51
- _focus: {
52
- backgroundColor: "primaryGreen",
53
- borderColor: "azure",
54
- },
52
+ ...focusVisibleStyles(props),
55
53
 
56
54
  _disabled: {
57
55
  backgroundColor: "lightGrey",
@@ -69,12 +67,6 @@ const config = helpers.defineMultiStyleConfig({
69
67
  backgroundColor: "lightGrey",
70
68
  borderColor: "steel",
71
69
  },
72
-
73
- _focus: {
74
- backgroundColor: "white",
75
- borderColor: "azure",
76
- },
77
-
78
70
  _invalid: {
79
71
  backgroundColor: "white",
80
72
  borderColor: "brightRed",
@@ -84,7 +76,7 @@ const config = helpers.defineMultiStyleConfig({
84
76
  userSelect: "none",
85
77
  _disabled: { opacity: 0.4 },
86
78
  },
87
- },
79
+ }),
88
80
  });
89
81
 
90
82
  export default config;
@@ -1,8 +1,7 @@
1
1
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy, mode } from "@chakra-ui/theme-tools";
3
3
  import { getBoxShadowString } from "../utils/box-shadow-utils";
4
- import { colors } from "../foundations";
5
- import { focusVisible } from "../utils/focus-utils";
4
+ import { focusVisibleStyles } from "../utils/focus-util";
6
5
 
7
6
  const parts = anatomy("choice-chip").parts("container", "icon", "label");
8
7
 
@@ -23,15 +22,7 @@ const config = helpers.defineMultiStyleConfig({
23
22
  background: "pine",
24
23
  boxShadow: getBoxShadowString({ borderColor: "celadon" }),
25
24
  },
26
- "input:focus-visible + &": {
27
- boxShadow: `inset 0 0 0 2px ${mode(
28
- colors.greenHaze,
29
- colors.azure,
30
- )(props)}, inset 0 0 0 4px ${mode(
31
- colors.white,
32
- colors.darkGrey,
33
- )(props)}`,
34
- },
25
+ "input:focus-visible + &": focusVisibleStyles(props)._focusVisible,
35
26
  "@media (hover:hover)": {
36
27
  _hover: {
37
28
  color: mode("darkTeal", "white")(props),
@@ -1,7 +1,6 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
2
  import { cssVar, mode } from "@chakra-ui/theme-tools";
3
- import { getBoxShadowString } from "../utils/box-shadow-utils";
4
- import { focusVisible } from "../utils/focus-utils";
3
+ import { focusVisibleStyles } from "../utils/focus-util";
5
4
 
6
5
  const $size = cssVar("close-button-size");
7
6
 
@@ -15,18 +14,7 @@ const config = defineStyleConfig({
15
14
  backgroundColor: "transparent",
16
15
  color: mode("darkGrey", "white")(props),
17
16
  fontWeight: "normal",
18
- ...focusVisible({
19
- focus: {
20
- outline: "none",
21
- boxShadow: getBoxShadowString({
22
- borderColor: mode("greenHaze", "azure")(props),
23
- }),
24
- outlineOffset: "2px",
25
- },
26
- notFocus: {
27
- boxShadow: "none",
28
- },
29
- }),
17
+ ...focusVisibleStyles(props),
30
18
  _hover: {
31
19
  backgroundColor: mode("seaMist", "whiteAlpha.100")(props),
32
20
  _disabled: {
@@ -8,7 +8,7 @@ const config = defineStyleConfig({
8
8
  fontFamily: "monospace",
9
9
  fontSize: ["mobile.xs", "desktop.xs"],
10
10
  borderRadius: "xs",
11
- px: 1,
11
+ paddingX: 1,
12
12
  },
13
13
  variants,
14
14
  defaultProps,
@@ -2,7 +2,7 @@ import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
2
2
  import { anatomy, cssVar, mode } from "@chakra-ui/theme-tools";
3
3
  import { colors, zIndices } from "../foundations";
4
4
  import { getBoxShadowString } from "../utils/box-shadow-utils";
5
- import { focusVisible } from "../utils/focus-utils";
5
+ import { focusVisibleStyles } from "../utils/focus-util";
6
6
 
7
7
  const parts = anatomy("datepicker").parts(
8
8
  "wrapper",
@@ -40,6 +40,9 @@ const config = helpers.defineMultiStyleConfig({
40
40
  _disabled: {
41
41
  pointerEvents: "none",
42
42
  },
43
+ _focusWithin: {
44
+ ...focusVisibleStyles(props)._focusVisible,
45
+ },
43
46
  },
44
47
  inputLabel: {
45
48
  fontSize: "mobile.xs",
@@ -55,7 +58,10 @@ const config = helpers.defineMultiStyleConfig({
55
58
  },
56
59
  calendarTriggerButton: {
57
60
  backgroundColor: mode("white", "night")(props),
58
- boxShadow: "none",
61
+ boxShadow: getBoxShadowString({
62
+ borderColor: mode("darkGrey", "white")(props),
63
+ borderWidth: 1,
64
+ }),
59
65
  width: 8,
60
66
  display: "flex",
61
67
  alignItems: "center",
@@ -76,21 +82,7 @@ const config = helpers.defineMultiStyleConfig({
76
82
  _active: {
77
83
  backgroundColor: mode("mint", "whiteAlpha.200")(props),
78
84
  },
79
- ...focusVisible({
80
- focus: {
81
- outline: "none",
82
- boxShadow: getBoxShadowString({
83
- borderColor: mode("greenHaze", "azure")(props),
84
- borderWidth: 2,
85
- }),
86
- },
87
- notFocus: {
88
- boxShadow: getBoxShadowString({
89
- borderColor: mode("darkGrey", "white")(props),
90
- borderWidth: 1,
91
- }),
92
- },
93
- }),
85
+ ...focusVisibleStyles(props),
94
86
  _invalid: {
95
87
  boxShadow: getBoxShadowString({
96
88
  borderColor: "brightRed",
@@ -110,7 +102,6 @@ const config = helpers.defineMultiStyleConfig({
110
102
  baseShadow: "md",
111
103
  }),
112
104
  },
113
-
114
105
  weekdays: {
115
106
  color: mode("darkGrey", "white")(props),
116
107
  },
@@ -132,27 +123,11 @@ const config = helpers.defineMultiStyleConfig({
132
123
  _hover: {
133
124
  backgroundColor: mode("seaMist", "pine")(props),
134
125
  },
135
- ...focusVisible({
136
- focus: {
137
- outline: "none",
138
- boxShadow: getBoxShadowString({
139
- borderWidth: 2,
140
- borderColor: mode("greenHaze", "azure")(props),
141
- }),
142
- },
143
- notFocus: {
144
- boxShadow: "none",
145
- _hover: {
146
- boxShadow: getBoxShadowString({
147
- borderWidth: 2,
148
- borderColor: "osloGrey",
149
- }),
150
- },
151
- _active: {
152
- color: mode("darkGrey", "white")(props),
153
- },
154
- },
155
- }),
126
+ _focusVisible: {
127
+ outlineColor: "greenHaze",
128
+ outlineWidth: 2,
129
+ outlineStyle: "solid",
130
+ },
156
131
  _active: {
157
132
  backgroundColor: "seaMist",
158
133
  boxShadow: "none",
@@ -177,13 +152,6 @@ const config = helpers.defineMultiStyleConfig({
177
152
  borderWidth: 1,
178
153
  borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
179
154
  }),
180
- _focus: {
181
- outline: "none",
182
- boxShadow: getBoxShadowString({
183
- borderWidth: 2,
184
- borderColor: mode("greenHaze", "azure")(props),
185
- }),
186
- },
187
155
  },
188
156
  "&[data-unavailable]": {
189
157
  pointerEvents: "none",
@@ -203,12 +171,6 @@ const config = helpers.defineMultiStyleConfig({
203
171
  borderWidth: 2,
204
172
  }),
205
173
  },
206
- _focusWithin: {
207
- boxShadow: getBoxShadowString({
208
- borderColor: mode("greenHaze", "azure")(props),
209
- borderWidth: 2,
210
- }),
211
- },
212
174
  _invalid: {
213
175
  boxShadow: getBoxShadowString({
214
176
  borderColor: "brightRed",
@@ -262,13 +224,6 @@ const config = helpers.defineMultiStyleConfig({
262
224
  baseShadow: "sm",
263
225
  }),
264
226
  },
265
- _focusWithin: {
266
- boxShadow: getBoxShadowString({
267
- borderColor: mode("greenHaze", "azure")(props),
268
- borderWidth: 2,
269
- baseShadow: "sm",
270
- }),
271
- },
272
227
  _invalid: {
273
228
  boxShadow: getBoxShadowString({
274
229
  borderColor: "brightRed",
@@ -315,12 +270,6 @@ const config = helpers.defineMultiStyleConfig({
315
270
  borderWidth: 2,
316
271
  }),
317
272
  },
318
- _focusWithin: {
319
- boxShadow: getBoxShadowString({
320
- borderColor: mode("greenHaze", "azure")(props),
321
- borderWidth: 2,
322
- }),
323
- },
324
273
  _invalid: {
325
274
  boxShadow: getBoxShadowString({
326
275
  borderColor: "brightRed",