@vygruppen/spor-react 6.2.3 → 7.0.1
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/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +22 -0
- package/dist/{CountryCodeSelect-QZYP3GSD.mjs → CountryCodeSelect-EKQUBVBJ.mjs} +1 -1
- package/dist/{chunk-YFZOYRGT.mjs → chunk-CSCLMQYA.mjs} +183 -654
- package/dist/index.d.mts +502 -496
- package/dist/index.d.ts +502 -496
- package/dist/index.js +212 -685
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +4 -4
- package/src/input/NumericStepper.tsx +0 -4
- package/src/stepper/Stepper.tsx +1 -1
- package/src/stepper/StepperStep.tsx +1 -1
- package/src/theme/components/accordion.ts +4 -15
- package/src/theme/components/breadcrumb.ts +2 -14
- package/src/theme/components/button.ts +8 -58
- package/src/theme/components/card-select.ts +11 -26
- package/src/theme/components/card.ts +2 -18
- package/src/theme/components/checkbox.ts +4 -12
- package/src/theme/components/choice-chip.ts +2 -11
- package/src/theme/components/close-button.ts +2 -14
- package/src/theme/components/code.ts +1 -1
- package/src/theme/components/datepicker.ts +14 -65
- package/src/theme/components/drawer.ts +7 -7
- package/src/theme/components/fab.ts +12 -65
- package/src/theme/components/form-label.ts +1 -1
- package/src/theme/components/form.ts +1 -1
- package/src/theme/components/info-select.ts +5 -35
- package/src/theme/components/info-tag.ts +1 -1
- package/src/theme/components/input.ts +9 -31
- package/src/theme/components/link.ts +5 -29
- package/src/theme/components/listbox.ts +3 -5
- package/src/theme/components/media-controller-button.ts +5 -46
- package/src/theme/components/modal.ts +7 -7
- package/src/theme/components/popover.ts +7 -15
- package/src/theme/components/progress-indicator.ts +2 -6
- package/src/theme/components/radio.ts +5 -11
- package/src/theme/components/select.ts +2 -2
- package/src/theme/components/stepper.ts +11 -11
- package/src/theme/components/switch.ts +5 -73
- package/src/theme/components/table.ts +18 -18
- package/src/theme/components/tabs.ts +11 -14
- package/src/theme/components/travel-tag.ts +2 -15
- package/src/theme/utils/focus-util.ts +10 -0
- package/tsconfig.json +2 -2
- 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-
|
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-CSCLMQYA.mjs';
|
package/package.json
CHANGED
package/src/button/Button.tsx
CHANGED
@@ -115,19 +115,19 @@ export const Button = forwardRef<ButtonProps, "button">((props, ref) => {
|
|
115
115
|
</Center>
|
116
116
|
)}
|
117
117
|
<Flex
|
118
|
-
|
118
|
+
gap={1}
|
119
119
|
flex={1}
|
120
120
|
alignItems="center"
|
121
|
-
|
121
|
+
justifyContent={rightIcon ? "space-between" : "center"}
|
122
122
|
visibility={isLoading ? "hidden" : "visible"}
|
123
123
|
aria-hidden={isLoading}
|
124
124
|
>
|
125
|
-
<Flex
|
125
|
+
<Flex gap={1}>
|
126
126
|
{leftIcon}
|
127
127
|
<Box
|
128
128
|
visibility={isLoading ? "hidden" : "visible"}
|
129
129
|
whiteSpace="normal"
|
130
|
-
textAlign="
|
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
|
);
|
package/src/stepper/Stepper.tsx
CHANGED
@@ -90,7 +90,7 @@ export const Stepper = ({
|
|
90
90
|
</Box>
|
91
91
|
)}
|
92
92
|
</Box>
|
93
|
-
<Flex justifyContent="center" display={["none", "flex"]}>
|
93
|
+
<Flex justifyContent="center" display={["none", null, "flex"]}>
|
94
94
|
{steps.map((step, index) => (
|
95
95
|
<StepperStep key={index} stepNumber={index + 1} variant={variant}>
|
96
96
|
{step}
|
@@ -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 {
|
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
|
-
...
|
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 {
|
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
|
-
...
|
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,33 +20,25 @@ 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",
|
24
|
-
backgroundColor: "
|
25
|
-
color: "
|
27
|
+
backgroundColor: mode("blackAlpha.100", "whiteAlpha.100")(props),
|
28
|
+
color: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
26
29
|
},
|
27
30
|
_hover: {
|
28
31
|
_disabled: {
|
29
|
-
background: "
|
32
|
+
background: mode("blackAlpha.100", "whiteAlpha.100")(props),
|
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 {
|
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
|
-
...
|
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:
|
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:
|
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:
|
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
|
-
|
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 {
|
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 {
|
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
|
-
...
|
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: {
|