@vygruppen/spor-react 9.8.3 → 9.10.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/.turbo/turbo-build.log +9 -9
- package/CHANGELOG.md +23 -0
- package/dist/{CountryCodeSelect-C2XKHNTP.mjs → CountryCodeSelect-FVCL47RT.mjs} +1 -1
- package/dist/{chunk-ZDOSE4VD.mjs → chunk-WZYWSOJB.mjs} +241 -120
- package/dist/index.d.mts +207 -94
- package/dist/index.d.ts +207 -94
- package/dist/index.js +2903 -2780
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
- package/src/alert/BaseAlert.tsx +2 -0
- package/src/alert/ClosableAlert.tsx +11 -2
- package/src/alert/ExpandableAlert.tsx +3 -1
- package/src/alert/StaticAlert.tsx +10 -2
- package/src/input/InfoSelect.tsx +33 -14
- package/src/input/ListBox.tsx +1 -0
- package/src/layout/PressableCard.tsx +2 -2
- package/src/layout/RadioCard.tsx +44 -35
- package/src/layout/RadioCardGroup.tsx +9 -5
- package/src/layout/StaticCard.tsx +0 -1
- package/src/theme/components/alert.ts +1 -0
- package/src/theme/components/info-select.ts +12 -1
- package/src/theme/components/listbox.ts +5 -5
- package/src/theme/components/pressable-card.ts +10 -2
- package/src/theme/components/radio-card.ts +79 -40
- package/src/theme/utils/base-utils.ts +5 -2
- package/src/theme/utils/floating-utils.ts +3 -3
- package/src/theme/utils/ghost-utils.ts +19 -1
- package/src/theme/utils/outline-utils.ts +26 -0
- package/src/theme/utils/types.ts +3 -1
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-
|
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-WZYWSOJB.mjs';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@vygruppen/spor-react",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.10.0",
|
4
4
|
"main": "./dist/index.js",
|
5
5
|
"module": "./dist/index.mjs",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"@emotion/react": "^11.10.4",
|
23
23
|
"@emotion/styled": "^11.10.4",
|
24
24
|
"@internationalized/date": "^3.0.1",
|
25
|
-
"@vygruppen/spor-design-tokens": ">3.
|
25
|
+
"@vygruppen/spor-design-tokens": ">3.6.0",
|
26
26
|
"@vygruppen/spor-icon-react": ">3.6.0",
|
27
27
|
"@vygruppen/spor-loader": ">0.3.1",
|
28
28
|
"awesome-phonenumber": "^5.10.0",
|
package/src/alert/BaseAlert.tsx
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
Box,
|
3
|
+
Flex,
|
4
|
+
useDisclosure,
|
5
|
+
useMultiStyleConfig,
|
6
|
+
} from "@chakra-ui/react";
|
2
7
|
import { CloseFill18Icon } from "@vygruppen/spor-icon-react";
|
3
8
|
import React from "react";
|
4
9
|
import { IconButton } from "../button";
|
@@ -34,6 +39,7 @@ type ClosableAlertProps = BaseAlertProps & {
|
|
34
39
|
*/
|
35
40
|
export const ClosableAlert = ({
|
36
41
|
variant,
|
42
|
+
title,
|
37
43
|
children,
|
38
44
|
onClose: externalOnClose = () => {},
|
39
45
|
}: ClosableAlertProps) => {
|
@@ -60,7 +66,10 @@ export const ClosableAlert = ({
|
|
60
66
|
sx={styles.closeButton}
|
61
67
|
/>
|
62
68
|
<AlertIcon variant={variant} />
|
63
|
-
{
|
69
|
+
<Flex direction="column" gap={title ? 2 : undefined} textAlign="left">
|
70
|
+
{title && <Box fontWeight="bold">{title}</Box>}
|
71
|
+
<Box marginRight={1}>{children}</Box>
|
72
|
+
</Flex>
|
64
73
|
</BaseAlert>
|
65
74
|
);
|
66
75
|
};
|
@@ -63,6 +63,7 @@ export const ExpandableAlert = ({
|
|
63
63
|
>
|
64
64
|
<Flex as={headingLevel} alignItems="center">
|
65
65
|
<AlertIcon variant={variant} />
|
66
|
+
|
66
67
|
<Box
|
67
68
|
as="span"
|
68
69
|
sx={{
|
@@ -72,11 +73,12 @@ export const ExpandableAlert = ({
|
|
72
73
|
"-webkit-line-clamp": "1",
|
73
74
|
"-webkit-box-orient": "vertical",
|
74
75
|
}}
|
76
|
+
color="darkGrey"
|
75
77
|
>
|
76
78
|
{title}
|
77
79
|
</Box>
|
78
80
|
</Flex>
|
79
|
-
<AccordionIcon />
|
81
|
+
<AccordionIcon color="darkGrey" />
|
80
82
|
</Flex>
|
81
83
|
</AccordionButton>
|
82
84
|
<AccordionPanel>{children}</AccordionPanel>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { AlertIcon } from "./AlertIcon";
|
3
3
|
import { BaseAlert, BaseAlertProps } from "./BaseAlert";
|
4
|
+
import { Box, Flex } from "@chakra-ui/react";
|
4
5
|
|
5
6
|
type StaticAlertProps = BaseAlertProps;
|
6
7
|
|
@@ -15,11 +16,18 @@ type StaticAlertProps = BaseAlertProps;
|
|
15
16
|
* </StaticAlert>
|
16
17
|
* ```
|
17
18
|
*/
|
18
|
-
export const StaticAlert = ({
|
19
|
+
export const StaticAlert = ({
|
20
|
+
children,
|
21
|
+
title,
|
22
|
+
...props
|
23
|
+
}: StaticAlertProps) => {
|
19
24
|
return (
|
20
25
|
<BaseAlert {...props}>
|
21
26
|
<AlertIcon variant={props.variant} />
|
22
|
-
{
|
27
|
+
<Flex direction="column" gap={title ? 2 : undefined} textAlign="left">
|
28
|
+
{title && <Box fontWeight="bold">{title}</Box>}
|
29
|
+
<Box>{children}</Box>
|
30
|
+
</Flex>
|
23
31
|
</BaseAlert>
|
24
32
|
);
|
25
33
|
};
|
package/src/input/InfoSelect.tsx
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
import {
|
2
2
|
Box,
|
3
3
|
chakra,
|
4
|
+
Flex,
|
5
|
+
FormLabel,
|
4
6
|
ResponsiveValue,
|
5
7
|
useFormControlProps,
|
6
8
|
useMultiStyleConfig,
|
@@ -11,7 +13,7 @@ import {
|
|
11
13
|
} from "@vygruppen/spor-icon-react";
|
12
14
|
import React, { useRef } from "react";
|
13
15
|
import { HiddenSelect, useButton, useSelect } from "react-aria";
|
14
|
-
import { useSelectState } from "react-stately";
|
16
|
+
import { Column, useSelectState } from "react-stately";
|
15
17
|
import { createTexts, useTranslation } from "../";
|
16
18
|
import { ListBox } from "./ListBox";
|
17
19
|
import { Popover } from "./Popover";
|
@@ -152,13 +154,11 @@ type InfoSelectProps<T extends object> = {
|
|
152
154
|
*/
|
153
155
|
export function InfoSelect<T extends object>({
|
154
156
|
placeholder,
|
155
|
-
width = "100%",
|
156
|
-
height = "auto",
|
157
157
|
onChange,
|
158
158
|
value,
|
159
159
|
isLabelSrOnly,
|
160
160
|
defaultValue,
|
161
|
-
variant
|
161
|
+
variant,
|
162
162
|
...props
|
163
163
|
}: InfoSelectProps<T>) {
|
164
164
|
const renamedProps = {
|
@@ -188,11 +188,10 @@ export function InfoSelect<T extends object>({
|
|
188
188
|
const { t } = useTranslation();
|
189
189
|
const formControl = useFormControlProps(props);
|
190
190
|
|
191
|
+
const hasChosenValue = state.selectedItem !== null;
|
192
|
+
|
191
193
|
return (
|
192
194
|
<Box sx={styles.container}>
|
193
|
-
<chakra.div {...labelProps} sx={styles.label}>
|
194
|
-
{props.label}
|
195
|
-
</chakra.div>
|
196
195
|
<HiddenSelect
|
197
196
|
state={state}
|
198
197
|
triggerRef={triggerRef}
|
@@ -205,17 +204,37 @@ export function InfoSelect<T extends object>({
|
|
205
204
|
ref={triggerRef}
|
206
205
|
sx={styles.button}
|
207
206
|
{...buttonProps}
|
208
|
-
width={width}
|
209
|
-
height={height}
|
210
207
|
data-attachable
|
211
208
|
aria-invalid={formControl.isInvalid}
|
212
209
|
aria-describedby={formControl["aria-describedby"]}
|
213
210
|
>
|
214
|
-
<
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
211
|
+
<chakra.div sx={styles.innerButton}>
|
212
|
+
<chakra.div
|
213
|
+
{...labelProps}
|
214
|
+
sx={{
|
215
|
+
...styles.label,
|
216
|
+
...(hasChosenValue && {
|
217
|
+
transform: "scale(0.825) translateY(-10px) translateX(-10%)",
|
218
|
+
transitionProperty: "var(--spor-transition-property-common)",
|
219
|
+
transitionDuration: "var(--spor-transition-duration-normal)",
|
220
|
+
}),
|
221
|
+
}}
|
222
|
+
>
|
223
|
+
{props.label}
|
224
|
+
</chakra.div>
|
225
|
+
<Box
|
226
|
+
{...valueProps}
|
227
|
+
h={!hasChosenValue ? "0px" : "18px"}
|
228
|
+
hidden={!hasChosenValue}
|
229
|
+
transform={"scale(1) translateY(-10px)"}
|
230
|
+
transitionProperty={"var(--spor-transition-property-common)"}
|
231
|
+
transitionDuration={"var(--spor-transition-duration-normal)"}
|
232
|
+
>
|
233
|
+
{state.selectedItem
|
234
|
+
? state.selectedItem.textValue ?? state.selectedItem.rendered
|
235
|
+
: placeholder ?? t(texts.selectAnOption)}
|
236
|
+
</Box>
|
237
|
+
</chakra.div>
|
219
238
|
<Box sx={styles.arrowIcon}>
|
220
239
|
{state.isOpen ? <DropdownUpFill24Icon /> : <DropdownDownFill24Icon />}
|
221
240
|
</Box>
|
package/src/input/ListBox.tsx
CHANGED
@@ -9,7 +9,7 @@ import {
|
|
9
9
|
|
10
10
|
type PressableCardProps = BoxProps & {
|
11
11
|
/** Defaults to "base" */
|
12
|
-
variant
|
12
|
+
variant?: "floating" | "accent" | "base";
|
13
13
|
};
|
14
14
|
|
15
15
|
/**
|
@@ -43,7 +43,7 @@ type PressableCardProps = BoxProps & {
|
|
43
43
|
*/
|
44
44
|
|
45
45
|
export const PressableCard = forwardRef<PressableCardProps, As>(
|
46
|
-
({ children, variant = "
|
46
|
+
({ children, variant = "floating", ...props }, ref) => {
|
47
47
|
const styles = useStyleConfig("PressableCard", {
|
48
48
|
variant,
|
49
49
|
});
|
package/src/layout/RadioCard.tsx
CHANGED
@@ -1,23 +1,15 @@
|
|
1
1
|
import {
|
2
|
+
Box,
|
2
3
|
BoxProps,
|
3
4
|
UseRadioProps,
|
4
5
|
chakra,
|
5
6
|
forwardRef,
|
6
|
-
|
7
|
-
useStyleConfig,
|
7
|
+
useMultiStyleConfig,
|
8
8
|
} from "@chakra-ui/react";
|
9
|
-
import { dataAttr } from "@chakra-ui/utils";
|
10
9
|
import React, { useId } from "react";
|
11
10
|
|
12
|
-
export type RadioCardProps = UseRadioProps &
|
13
|
-
BoxProps & {
|
14
|
-
children: React.ReactNode;
|
15
|
-
/** Defaults to "base" */
|
16
|
-
variant: "floating" | "base";
|
17
|
-
};
|
18
|
-
|
19
11
|
/**
|
20
|
-
*
|
12
|
+
* Radio cards are used to present a set of options where only one option can be selected.
|
21
13
|
*
|
22
14
|
* The most basic version looks like this:
|
23
15
|
*
|
@@ -27,6 +19,14 @@ export type RadioCardProps = UseRadioProps &
|
|
27
19
|
* </RadioCard>
|
28
20
|
* ```
|
29
21
|
*
|
22
|
+
* In order to use RadioCard outside a RadioCardGroup, you need to pass the `isChecked` and `onChange` props.
|
23
|
+
*
|
24
|
+
* ```tsx
|
25
|
+
* <RadioCard isChecked={true} onChange={(e) => console.log(e.target.value)}>
|
26
|
+
* Content
|
27
|
+
* </RadioCard>
|
28
|
+
* ```
|
29
|
+
*
|
30
30
|
* In order to use RadioCard, you typically want to place these components in a group with several other RadioCards.
|
31
31
|
*
|
32
32
|
* ```tsx
|
@@ -59,38 +59,47 @@ export type RadioCardProps = UseRadioProps &
|
|
59
59
|
* ```
|
60
60
|
*/
|
61
61
|
|
62
|
-
export
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
export type RadioCardProps = UseRadioProps &
|
63
|
+
BoxProps & {
|
64
|
+
children: React.ReactNode;
|
65
|
+
/** Defaults to "base" */
|
66
|
+
variant?: "floating" | "base";
|
67
|
+
/** Needs to be defined if RadioCard is used outside RadioCardGroup */
|
68
|
+
isChecked?: boolean;
|
69
|
+
/** Needs to be defined if RadioCard is used outside RadioCardGroup */
|
70
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
71
|
+
};
|
68
72
|
|
69
|
-
|
70
|
-
|
73
|
+
export const RadioCard = forwardRef<RadioCardProps, "div">(
|
74
|
+
({ children, variant = "base", isChecked, onChange, ...props }, ref) => {
|
75
|
+
const styles = useMultiStyleConfig("RadioCard", { variant });
|
71
76
|
|
72
77
|
const id = `radio-card-${useId()}`;
|
73
78
|
|
79
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
80
|
+
onChange && onChange(event);
|
81
|
+
};
|
82
|
+
|
74
83
|
return (
|
75
|
-
<
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
data-hover={dataAttr(state.isHovered)}
|
86
|
-
data-focus={dataAttr(state.isFocused)}
|
87
|
-
data-active={dataAttr(state.isActive)}
|
88
|
-
data-disabled={dataAttr(state.isDisabled)}
|
84
|
+
<Box as="label" htmlFor={id} aria-label={String(children)} ref={ref}>
|
85
|
+
<chakra.input
|
86
|
+
type="radio"
|
87
|
+
id={id}
|
88
|
+
checked={isChecked}
|
89
|
+
onChange={handleChange}
|
90
|
+
{...props}
|
91
|
+
sx={styles.radioInput}
|
92
|
+
/>
|
93
|
+
<Box
|
89
94
|
{...props}
|
95
|
+
__css={{
|
96
|
+
...styles.container,
|
97
|
+
...(isChecked && styles.checked),
|
98
|
+
}}
|
90
99
|
>
|
91
100
|
{children}
|
92
|
-
</
|
93
|
-
</
|
101
|
+
</Box>
|
102
|
+
</Box>
|
94
103
|
);
|
95
104
|
},
|
96
105
|
);
|
@@ -4,7 +4,7 @@ import {
|
|
4
4
|
StackDirection,
|
5
5
|
Stack,
|
6
6
|
} from "@chakra-ui/react";
|
7
|
-
import React
|
7
|
+
import React from "react";
|
8
8
|
import { RadioCard, RadioCardProps } from "./RadioCard";
|
9
9
|
|
10
10
|
type RadioCardGroupProps = RadioGroupProps & {
|
@@ -75,17 +75,21 @@ export const RadioCardGroup = ({
|
|
75
75
|
...props,
|
76
76
|
});
|
77
77
|
|
78
|
-
const
|
78
|
+
const rootProps = getRootProps();
|
79
79
|
|
80
80
|
return (
|
81
|
-
<Stack direction={direction} {...
|
81
|
+
<Stack direction={direction} {...rootProps}>
|
82
82
|
{recursiveMap(children, (child: React.ReactElement) => {
|
83
83
|
if (child.type === RadioCard) {
|
84
|
-
const
|
84
|
+
const radioProps = getRadioProps({ value: child.props.value });
|
85
85
|
const variantValue = variant as "base" | "floating" | undefined;
|
86
86
|
return React.cloneElement(
|
87
87
|
child as React.ReactElement<RadioCardProps>,
|
88
|
-
{
|
88
|
+
{
|
89
|
+
...radioProps,
|
90
|
+
variant: variantValue,
|
91
|
+
...props,
|
92
|
+
},
|
89
93
|
);
|
90
94
|
}
|
91
95
|
return child;
|
@@ -19,18 +19,28 @@ const config = helpers.defineMultiStyleConfig({
|
|
19
19
|
container: {},
|
20
20
|
label: {
|
21
21
|
position: "relative",
|
22
|
+
fontSize: ["mobile.xs", "desktop.sm"],
|
22
23
|
...(props.isLabelSrOnly ? srOnly : {}),
|
23
24
|
},
|
25
|
+
innerButton: {
|
26
|
+
display: "flex",
|
27
|
+
flexDir: "column",
|
28
|
+
alignItems: "start",
|
29
|
+
justifyContent: "start",
|
30
|
+
},
|
24
31
|
button: {
|
32
|
+
display: "flex",
|
25
33
|
appearance: "none",
|
34
|
+
width: "100%",
|
35
|
+
height: "54px",
|
26
36
|
borderTopRadius: "sm",
|
27
37
|
borderBottomRadius: props.isOpen ? 0 : "sm",
|
28
38
|
paddingY: 1.5,
|
29
39
|
paddingX: 3,
|
30
|
-
display: "flex",
|
31
40
|
justifyContent: "space-between",
|
32
41
|
alignItems: "center",
|
33
42
|
fontSize: "mobile.md",
|
43
|
+
h: 8,
|
34
44
|
...baseBorder("default", props),
|
35
45
|
_hover: {
|
36
46
|
...baseBorder("hover", props),
|
@@ -48,6 +58,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
48
58
|
...baseBorder("invalid", props),
|
49
59
|
},
|
50
60
|
},
|
61
|
+
placeholder: {},
|
51
62
|
arrowIcon: {},
|
52
63
|
}),
|
53
64
|
variants: {
|
@@ -2,7 +2,7 @@ import { anatomy } from "@chakra-ui/anatomy";
|
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
3
|
import { mode } from "@chakra-ui/theme-tools";
|
4
4
|
import { baseBorder } from "../utils/base-utils";
|
5
|
-
import { ghostBackground } from "../utils/ghost-utils";
|
5
|
+
import { ghostBackground, ghostText } from "../utils/ghost-utils";
|
6
6
|
import { surface } from "../utils/surface-utils";
|
7
7
|
|
8
8
|
const parts = anatomy("ListBox").parts(
|
@@ -32,7 +32,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
32
32
|
marginY: 1,
|
33
33
|
marginX: 1,
|
34
34
|
borderRadius: "sm",
|
35
|
-
|
35
|
+
...ghostText("default", props),
|
36
36
|
cursor: "pointer",
|
37
37
|
outline: "none",
|
38
38
|
_active: {
|
@@ -45,15 +45,15 @@ const config = helpers.defineMultiStyleConfig({
|
|
45
45
|
...ghostBackground("selected", props),
|
46
46
|
},
|
47
47
|
_selected: {
|
48
|
-
...ghostBackground("
|
48
|
+
...ghostBackground("active", props),
|
49
49
|
},
|
50
50
|
},
|
51
51
|
label: {},
|
52
52
|
description: {
|
53
53
|
fontSize: ["mobile.xs", "desktop.xs"],
|
54
|
-
|
54
|
+
...ghostText("default", props),
|
55
55
|
"[aria-selected='true'] &": {
|
56
|
-
|
56
|
+
...ghostText("selected", props),
|
57
57
|
},
|
58
58
|
},
|
59
59
|
}),
|
@@ -13,9 +13,14 @@ const config = defineStyleConfig({
|
|
13
13
|
display: "block",
|
14
14
|
borderRadius: "md",
|
15
15
|
cursor: "pointer",
|
16
|
-
|
16
|
+
transitionProperty: "common",
|
17
|
+
transitionDuration: "fast",
|
18
|
+
"button&, a&, label&, &.is-clickable": {
|
19
|
+
...focusVisibleStyles(props),
|
20
|
+
},
|
17
21
|
_disabled: {
|
18
22
|
...baseBackground("disabled", props),
|
23
|
+
...baseBorder("disabled", props),
|
19
24
|
...baseText("disabled", props),
|
20
25
|
outline: "none",
|
21
26
|
pointerEvents: "none",
|
@@ -23,6 +28,7 @@ const config = defineStyleConfig({
|
|
23
28
|
}),
|
24
29
|
variants: {
|
25
30
|
base: (props) => ({
|
31
|
+
cursor: "pointer",
|
26
32
|
...baseBorder("default", props),
|
27
33
|
_hover: {
|
28
34
|
...baseBorder("hover", props),
|
@@ -37,7 +43,7 @@ const config = defineStyleConfig({
|
|
37
43
|
boxShadow: "sm",
|
38
44
|
_hover: {
|
39
45
|
...accentBackground("hover", props),
|
40
|
-
boxShadow: "
|
46
|
+
boxShadow: "md",
|
41
47
|
},
|
42
48
|
_active: {
|
43
49
|
...accentBackground("active", props),
|
@@ -46,6 +52,7 @@ const config = defineStyleConfig({
|
|
46
52
|
}),
|
47
53
|
floating: (props) => ({
|
48
54
|
...floatingBackground("default", props),
|
55
|
+
...floatingBorder("default", props),
|
49
56
|
boxShadow: "sm",
|
50
57
|
_hover: {
|
51
58
|
...floatingBackground("hover", props),
|
@@ -53,6 +60,7 @@ const config = defineStyleConfig({
|
|
53
60
|
boxShadow: "md",
|
54
61
|
},
|
55
62
|
_active: {
|
63
|
+
...floatingBorder("default", props),
|
56
64
|
...floatingBackground("active", props),
|
57
65
|
boxShadow: "none",
|
58
66
|
},
|