@vygruppen/spor-react 3.8.1 → 4.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 +12 -12
- package/CHANGELOG.md +33 -0
- package/dist/{CountryCodeSelect-UG3JHWO3.mjs → CountryCodeSelect-HCQZVKWU.mjs} +1 -1
- package/dist/{chunk-HCSXVAA5.mjs → chunk-3SY4N6MP.mjs} +195 -135
- package/dist/index.d.mts +89 -87
- package/dist/index.d.ts +89 -87
- package/dist/index.js +199 -133
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/button/Button.tsx +2 -5
- package/src/button/ButtonGroup.tsx +1 -1
- package/src/button/FloatingActionButton.tsx +2 -11
- package/src/button/IconButton.tsx +1 -3
- package/src/datepicker/DatePicker.tsx +22 -14
- package/src/datepicker/DateRangePicker.tsx +14 -13
- package/src/link/TextLink.tsx +2 -6
- package/src/modal/Drawer.tsx +2 -2
- package/src/tab/Tabs.tsx +1 -11
- package/src/theme/components/button.ts +0 -20
- package/src/theme/components/close-button.ts +1 -1
- package/src/theme/components/datepicker.ts +122 -39
- package/src/theme/components/drawer.ts +4 -3
- package/src/theme/components/link.ts +5 -46
- package/src/theme/components/modal.ts +1 -1
- package/src/theme/components/popover.ts +20 -4
- package/src/util/externals.tsx +2 -0
@@ -11,18 +11,13 @@ import {
|
|
11
11
|
PopoverTrigger,
|
12
12
|
Portal,
|
13
13
|
ResponsiveValue,
|
14
|
-
useBreakpointValue,
|
15
14
|
useFormControlContext,
|
16
15
|
useMultiStyleConfig,
|
17
16
|
} from "@chakra-ui/react";
|
18
17
|
import { DateValue } from "@internationalized/date";
|
19
18
|
import { useDatePickerState } from "@react-stately/datepicker";
|
20
19
|
import React, { forwardRef, useRef } from "react";
|
21
|
-
import {
|
22
|
-
AriaDatePickerProps,
|
23
|
-
I18nProvider,
|
24
|
-
useDatePicker,
|
25
|
-
} from "react-aria";
|
20
|
+
import { AriaDatePickerProps, I18nProvider, useDatePicker } from "react-aria";
|
26
21
|
import { FormErrorMessage } from "..";
|
27
22
|
import { Calendar } from "./Calendar";
|
28
23
|
import { CalendarTriggerButton } from "./CalendarTriggerButton";
|
@@ -41,10 +36,10 @@ type DatePickerProps = AriaDatePickerProps<DateValue> &
|
|
41
36
|
/**
|
42
37
|
* A date picker component.
|
43
38
|
*
|
44
|
-
* There are
|
39
|
+
* There are three different variants – `base`, `floating` and `ghost`.
|
45
40
|
*
|
46
41
|
* ```tsx
|
47
|
-
* <DatePicker label="Dato" variant="
|
42
|
+
* <DatePicker label="Dato" variant="base" />
|
48
43
|
* ```
|
49
44
|
*/
|
50
45
|
|
@@ -93,7 +88,7 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
93
88
|
};
|
94
89
|
|
95
90
|
const popoverContent = (
|
96
|
-
<PopoverContent color="darkGrey"
|
91
|
+
<PopoverContent color="darkGrey" sx={styles.calendarPopover}>
|
97
92
|
<PopoverArrow sx={styles.arrow} />
|
98
93
|
<PopoverBody>
|
99
94
|
<FocusLock>
|
@@ -109,14 +104,19 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
109
104
|
|
110
105
|
return (
|
111
106
|
<I18nProvider locale={locale}>
|
112
|
-
<Box
|
107
|
+
<Box
|
108
|
+
position="relative"
|
109
|
+
display="inline-flex"
|
110
|
+
flexDirection="column"
|
111
|
+
width={width}
|
112
|
+
>
|
113
113
|
<Popover
|
114
114
|
{...dialogProps}
|
115
115
|
isOpen={state.isOpen}
|
116
116
|
onOpen={state.open}
|
117
117
|
onClose={state.close}
|
118
118
|
>
|
119
|
-
<InputGroup {...groupProps} display="inline-flex">
|
119
|
+
<InputGroup {...groupProps} display="inline-flex">
|
120
120
|
<PopoverAnchor>
|
121
121
|
<StyledField
|
122
122
|
variant={variant}
|
@@ -125,7 +125,11 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
125
125
|
minHeight={minHeight}
|
126
126
|
>
|
127
127
|
<PopoverTrigger>
|
128
|
-
<CalendarTriggerButton
|
128
|
+
<CalendarTriggerButton
|
129
|
+
variant={variant}
|
130
|
+
ref={ref}
|
131
|
+
{...buttonProps}
|
132
|
+
/>
|
129
133
|
</PopoverTrigger>
|
130
134
|
<DateField
|
131
135
|
label={props.label}
|
@@ -136,8 +140,12 @@ export const DatePicker = forwardRef<HTMLDivElement, DatePickerProps>(
|
|
136
140
|
</StyledField>
|
137
141
|
</PopoverAnchor>
|
138
142
|
</InputGroup>
|
139
|
-
<FormErrorMessage {...errorMessageProps}>
|
140
|
-
|
143
|
+
<FormErrorMessage {...errorMessageProps}>
|
144
|
+
{errorMessage}
|
145
|
+
</FormErrorMessage>
|
146
|
+
{state.isOpen && !props.isDisabled && withPortal && (
|
147
|
+
<Portal>{popoverContent}</Portal>
|
148
|
+
)}
|
141
149
|
{state.isOpen && !props.isDisabled && !withPortal && popoverContent}
|
142
150
|
</Popover>
|
143
151
|
</Box>
|
@@ -12,7 +12,6 @@ import {
|
|
12
12
|
PopoverTrigger,
|
13
13
|
Portal,
|
14
14
|
ResponsiveValue,
|
15
|
-
useBreakpointValue,
|
16
15
|
useFormControlContext,
|
17
16
|
useMultiStyleConfig,
|
18
17
|
} from "@chakra-ui/react";
|
@@ -36,20 +35,16 @@ type DateRangePickerProps = AriaDateRangePickerProps<DateValue> &
|
|
36
35
|
startName?: string;
|
37
36
|
endLabel?: string;
|
38
37
|
endName?: string;
|
39
|
-
variant: ResponsiveValue<
|
40
|
-
"base"
|
41
|
-
| "floating"
|
42
|
-
| "ghost"
|
43
|
-
>;
|
38
|
+
variant: ResponsiveValue<"base" | "floating" | "ghost">;
|
44
39
|
withPortal?: boolean;
|
45
40
|
};
|
46
41
|
/**
|
47
42
|
* A date range picker component.
|
48
43
|
*
|
49
|
-
* There are
|
44
|
+
* There are three variants to choose from – `base`, `floating` and `ghost`.
|
50
45
|
*
|
51
46
|
* ```tsx
|
52
|
-
* <DateRangePicker startLabel="From" startName="from" endLabel="To" endName="to" variant="
|
47
|
+
* <DateRangePicker startLabel="From" startName="from" endLabel="To" endName="to" variant="base" />
|
53
48
|
* ```
|
54
49
|
*/
|
55
50
|
export function DateRangePicker({
|
@@ -78,7 +73,7 @@ export function DateRangePicker({
|
|
78
73
|
calendarProps,
|
79
74
|
} = useDateRangePicker(props, state, ref);
|
80
75
|
|
81
|
-
const styles = useMultiStyleConfig("Datepicker", {variant});
|
76
|
+
const styles = useMultiStyleConfig("Datepicker", { variant });
|
82
77
|
const locale = useCurrentLocale();
|
83
78
|
|
84
79
|
const handleEnterClick = (e: React.KeyboardEvent) => {
|
@@ -90,11 +85,11 @@ export function DateRangePicker({
|
|
90
85
|
};
|
91
86
|
|
92
87
|
const onFieldClick = () => {
|
93
|
-
|
88
|
+
state.setOpen(true);
|
94
89
|
};
|
95
90
|
|
96
91
|
const popoverContent = (
|
97
|
-
<PopoverContent sx={styles.
|
92
|
+
<PopoverContent sx={styles.calendarPopover} maxWidth="none">
|
98
93
|
<PopoverArrow sx={styles.arrow} />
|
99
94
|
<PopoverBody>
|
100
95
|
<FocusLock>
|
@@ -130,7 +125,13 @@ export function DateRangePicker({
|
|
130
125
|
>
|
131
126
|
{variant && (
|
132
127
|
<PopoverTrigger>
|
133
|
-
<CalendarTriggerButton
|
128
|
+
<CalendarTriggerButton
|
129
|
+
paddingLeft={1}
|
130
|
+
paddingRight={1}
|
131
|
+
variant={variant}
|
132
|
+
ref={ref}
|
133
|
+
{...buttonProps}
|
134
|
+
/>
|
134
135
|
</PopoverTrigger>
|
135
136
|
)}
|
136
137
|
<DateField
|
@@ -139,7 +140,7 @@ export function DateRangePicker({
|
|
139
140
|
label={props.startLabel}
|
140
141
|
labelProps={labelProps}
|
141
142
|
/>
|
142
|
-
|
143
|
+
<Box as="span" aria-hidden="true" paddingRight="2">
|
143
144
|
–
|
144
145
|
</Box>
|
145
146
|
<DateField
|
package/src/link/TextLink.tsx
CHANGED
@@ -8,15 +8,11 @@ import React from "react";
|
|
8
8
|
import { createTexts, useTranslation } from "..";
|
9
9
|
|
10
10
|
type LinkProps = Omit<ChakraLinkProps, "variant"> & {
|
11
|
-
variant?:
|
12
|
-
| "primary"
|
13
|
-
| "secondary"
|
14
|
-
/** @deprecated Use `secondary` instead */
|
15
|
-
| "tertiary";
|
11
|
+
variant?: "primary" | "secondary";
|
16
12
|
};
|
17
13
|
/** Link to different sites or parts of site
|
18
14
|
*
|
19
|
-
* You can specify the `variant` prop to get different link designs.
|
15
|
+
* You can specify the `variant` prop to get different link designs.
|
20
16
|
*/
|
21
17
|
export const TextLink = forwardRef<LinkProps, "a">(
|
22
18
|
({ children, ...props }, ref) => {
|
package/src/modal/Drawer.tsx
CHANGED
@@ -90,9 +90,9 @@ const Notch = forwardRef<BoxProps, any>((props, ref) => {
|
|
90
90
|
ref={ref}
|
91
91
|
>
|
92
92
|
<Center
|
93
|
-
background={
|
93
|
+
background={
|
94
94
|
placement === "bottom" ? "bottom" : "top"
|
95
|
-
}
|
95
|
+
}
|
96
96
|
padding={2}
|
97
97
|
borderRadius="md"
|
98
98
|
>
|
package/src/tab/Tabs.tsx
CHANGED
@@ -9,17 +9,7 @@ export type TabsProps = Exclude<
|
|
9
9
|
ChakraTabsProps,
|
10
10
|
"colorScheme" | "variant" | "orientation" | "size"
|
11
11
|
> & {
|
12
|
-
colorScheme:
|
13
|
-
/** @deprecated dark is deprecated please use accent*/
|
14
|
-
| "dark"
|
15
|
-
/** @deprecated light is deprecated please use default*/
|
16
|
-
| "light"
|
17
|
-
/** @deprecated green is deprecated please use accent*/
|
18
|
-
| "green"
|
19
|
-
/** @deprecated grey is deprecated please use default*/
|
20
|
-
| "grey"
|
21
|
-
| "base"
|
22
|
-
| "accent" ;
|
12
|
+
colorScheme: "base" | "accent";
|
23
13
|
/** Defaults to `md` */
|
24
14
|
size?: "sm" | "md" | "lg" | "xl";
|
25
15
|
/** Defaults to `round` */
|
@@ -125,26 +125,6 @@ const config = defineStyleConfig({
|
|
125
125
|
},
|
126
126
|
},
|
127
127
|
}),
|
128
|
-
/**
|
129
|
-
* @deprecated use `secondary` instead.
|
130
|
-
*/
|
131
|
-
tertiary: {
|
132
|
-
backgroundColor: "mint",
|
133
|
-
color: "darkGrey",
|
134
|
-
fontWeight: "normal",
|
135
|
-
...focusVisible({
|
136
|
-
focus: {
|
137
|
-
boxShadow: `inset 0 0 0 4px ${colors.mint}, inset 0 0 0 4px ${colors.mint}, inset 0 0 0 6px currentColor`,
|
138
|
-
},
|
139
|
-
notFocus: { boxShadow: "none" },
|
140
|
-
}),
|
141
|
-
_hover: {
|
142
|
-
backgroundColor: "seaMist",
|
143
|
-
},
|
144
|
-
_active: {
|
145
|
-
backgroundColor: "lightGrey",
|
146
|
-
},
|
147
|
-
},
|
148
128
|
additional: (props) => ({
|
149
129
|
backgroundColor: "transparent",
|
150
130
|
color: mode("darkGrey", "white")(props),
|
@@ -8,6 +8,7 @@ const parts = anatomy("datepicker").parts(
|
|
8
8
|
"wrapper",
|
9
9
|
"calendarTriggerButton",
|
10
10
|
"arrow",
|
11
|
+
"calendarPopover",
|
11
12
|
"calendar",
|
12
13
|
"weekdays",
|
13
14
|
"weekend",
|
@@ -34,36 +35,10 @@ const config = helpers.defineMultiStyleConfig({
|
|
34
35
|
paddingY: 0.5,
|
35
36
|
alignItems: "center",
|
36
37
|
_hover: {
|
37
|
-
boxShadow: getBoxShadowString({
|
38
|
-
borderColor: mode("darkGrey", "white")(props),
|
39
|
-
borderWidth: 2,
|
40
|
-
}),
|
41
38
|
zIndex: zIndices.docked,
|
42
39
|
},
|
43
|
-
_focusWithin: {
|
44
|
-
boxShadow: getBoxShadowString({
|
45
|
-
borderColor: mode("greenHaze", "azure")(props),
|
46
|
-
borderWidth: 2,
|
47
|
-
}),
|
48
|
-
},
|
49
|
-
_invalid: {
|
50
|
-
boxShadow: getBoxShadowString({
|
51
|
-
borderColor: "brightRed",
|
52
|
-
borderWidth: 2,
|
53
|
-
}),
|
54
|
-
},
|
55
40
|
_disabled: {
|
56
41
|
pointerEvents: "none",
|
57
|
-
boxShadow: getBoxShadowString({
|
58
|
-
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
59
|
-
borderWidth: 1,
|
60
|
-
}),
|
61
|
-
_focus: {
|
62
|
-
boxShadow: getBoxShadowString({
|
63
|
-
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
64
|
-
borderWidth: 1,
|
65
|
-
}),
|
66
|
-
},
|
67
42
|
},
|
68
43
|
},
|
69
44
|
inputLabel: {
|
@@ -123,17 +98,19 @@ const config = helpers.defineMultiStyleConfig({
|
|
123
98
|
}),
|
124
99
|
},
|
125
100
|
},
|
126
|
-
arrow: {
|
101
|
+
arrow: {
|
127
102
|
[$arrowBackground.variable]: mode("white", colors.night)(props),
|
128
|
-
},
|
129
|
-
|
103
|
+
},
|
104
|
+
calendarPopover: {
|
130
105
|
backgroundColor: mode("white", "night")(props),
|
131
106
|
color: mode("darkGrey", "white")(props),
|
132
107
|
boxShadow: getBoxShadowString({
|
133
108
|
borderWidth: 2,
|
134
109
|
borderColor: mode("blackAlpha.200", "whiteAlpha.200")(props),
|
110
|
+
baseShadow: "md",
|
135
111
|
}),
|
136
112
|
},
|
113
|
+
|
137
114
|
weekdays: {
|
138
115
|
color: mode("darkGrey", "white")(props),
|
139
116
|
},
|
@@ -216,6 +193,41 @@ const config = helpers.defineMultiStyleConfig({
|
|
216
193
|
}),
|
217
194
|
variants: {
|
218
195
|
base: (props) => ({
|
196
|
+
wrapper: {
|
197
|
+
boxShadow: getBoxShadowString({
|
198
|
+
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
199
|
+
}),
|
200
|
+
_hover: {
|
201
|
+
boxShadow: getBoxShadowString({
|
202
|
+
borderColor: mode("darkGrey", "white")(props),
|
203
|
+
borderWidth: 2,
|
204
|
+
}),
|
205
|
+
},
|
206
|
+
_focusWithin: {
|
207
|
+
boxShadow: getBoxShadowString({
|
208
|
+
borderColor: mode("greenHaze", "azure")(props),
|
209
|
+
borderWidth: 2,
|
210
|
+
}),
|
211
|
+
},
|
212
|
+
_invalid: {
|
213
|
+
boxShadow: getBoxShadowString({
|
214
|
+
borderColor: "brightRed",
|
215
|
+
borderWidth: 2,
|
216
|
+
}),
|
217
|
+
},
|
218
|
+
_disabled: {
|
219
|
+
boxShadow: getBoxShadowString({
|
220
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
221
|
+
borderWidth: 1,
|
222
|
+
}),
|
223
|
+
_focus: {
|
224
|
+
boxShadow: getBoxShadowString({
|
225
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
226
|
+
borderWidth: 1,
|
227
|
+
}),
|
228
|
+
},
|
229
|
+
},
|
230
|
+
},
|
219
231
|
calendar: {
|
220
232
|
backgroundColor: mode("white", "night")(props),
|
221
233
|
color: mode("darkGrey", "white")(props),
|
@@ -238,14 +250,55 @@ const config = helpers.defineMultiStyleConfig({
|
|
238
250
|
},
|
239
251
|
}),
|
240
252
|
floating: (props) => ({
|
241
|
-
|
242
|
-
|
243
|
-
|
253
|
+
wrapper: {
|
254
|
+
boxShadow: getBoxShadowString({
|
255
|
+
borderColor: mode("blackAlpha.400", "whiteAlpha.400")(props),
|
256
|
+
baseShadow: "sm",
|
257
|
+
}),
|
258
|
+
_hover: {
|
259
|
+
boxShadow: getBoxShadowString({
|
260
|
+
borderColor: mode("darkGrey", "white")(props),
|
261
|
+
borderWidth: 2,
|
262
|
+
baseShadow: "sm",
|
263
|
+
}),
|
264
|
+
},
|
265
|
+
_focusWithin: {
|
244
266
|
boxShadow: getBoxShadowString({
|
245
|
-
borderColor: mode("
|
267
|
+
borderColor: mode("greenHaze", "azure")(props),
|
268
|
+
borderWidth: 2,
|
246
269
|
baseShadow: "sm",
|
247
270
|
}),
|
248
271
|
},
|
272
|
+
_invalid: {
|
273
|
+
boxShadow: getBoxShadowString({
|
274
|
+
borderColor: "brightRed",
|
275
|
+
borderWidth: 2,
|
276
|
+
baseShadow: "sm",
|
277
|
+
}),
|
278
|
+
},
|
279
|
+
_disabled: {
|
280
|
+
boxShadow: getBoxShadowString({
|
281
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
282
|
+
borderWidth: 1,
|
283
|
+
baseShadow: "sm",
|
284
|
+
}),
|
285
|
+
_focus: {
|
286
|
+
boxShadow: getBoxShadowString({
|
287
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
288
|
+
borderWidth: 1,
|
289
|
+
baseShadow: "sm",
|
290
|
+
}),
|
291
|
+
},
|
292
|
+
},
|
293
|
+
},
|
294
|
+
calendar: {
|
295
|
+
backgroundColor: mode("white", "night")(props),
|
296
|
+
color: mode("darkGrey", "white")(props),
|
297
|
+
boxShadow: getBoxShadowString({
|
298
|
+
borderColor: mode("grey.200", "whiteAlpha.400")(props),
|
299
|
+
baseShadow: "sm",
|
300
|
+
}),
|
301
|
+
},
|
249
302
|
dateCell: {
|
250
303
|
color: mode("darkGrey", "white")(props),
|
251
304
|
_hover: {
|
@@ -254,13 +307,43 @@ const config = helpers.defineMultiStyleConfig({
|
|
254
307
|
},
|
255
308
|
}),
|
256
309
|
ghost: (props) => ({
|
310
|
+
wrapper: {
|
311
|
+
boxShadow: "none",
|
312
|
+
_hover: {
|
313
|
+
boxShadow: getBoxShadowString({
|
314
|
+
borderColor: mode("darkGrey", "white")(props),
|
315
|
+
borderWidth: 2,
|
316
|
+
}),
|
317
|
+
},
|
318
|
+
_focusWithin: {
|
319
|
+
boxShadow: getBoxShadowString({
|
320
|
+
borderColor: mode("greenHaze", "azure")(props),
|
321
|
+
borderWidth: 2,
|
322
|
+
}),
|
323
|
+
},
|
324
|
+
_invalid: {
|
325
|
+
boxShadow: getBoxShadowString({
|
326
|
+
borderColor: "brightRed",
|
327
|
+
borderWidth: 2,
|
328
|
+
}),
|
329
|
+
},
|
330
|
+
_disabled: {
|
331
|
+
boxShadow: getBoxShadowString({
|
332
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
333
|
+
borderWidth: 1,
|
334
|
+
}),
|
335
|
+
_focus: {
|
336
|
+
boxShadow: getBoxShadowString({
|
337
|
+
borderColor: mode("osloGrey", "whiteAlpha.400")(props),
|
338
|
+
borderWidth: 1,
|
339
|
+
}),
|
340
|
+
},
|
341
|
+
},
|
342
|
+
},
|
257
343
|
calendar: {
|
258
344
|
backgroundColor: mode("white", "night")(props),
|
259
345
|
color: mode("darkGrey", "white")(props),
|
260
|
-
boxShadow:
|
261
|
-
borderWidth: 2,
|
262
|
-
borderColor: mode("", "")(props),
|
263
|
-
}),
|
346
|
+
boxShadow: "none",
|
264
347
|
},
|
265
348
|
dateCell: {
|
266
349
|
color: mode("darkGrey", "white")(props),
|
@@ -268,8 +351,8 @@ const config = helpers.defineMultiStyleConfig({
|
|
268
351
|
backgroundColor: mode("seaMist", "pine")(props),
|
269
352
|
},
|
270
353
|
_selected: {
|
271
|
-
backgroundColor: mode("", "primaryGreen")(props),
|
272
|
-
color: "darkGrey"
|
354
|
+
backgroundColor: mode("transparent", "primaryGreen")(props),
|
355
|
+
color: "darkGrey",
|
273
356
|
},
|
274
357
|
},
|
275
358
|
}),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { modalAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import type
|
3
|
+
import { mode, type PartsStyleObject } from "@chakra-ui/theme-tools";
|
4
4
|
|
5
5
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
6
6
|
|
@@ -9,6 +9,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
9
9
|
overlay: {
|
10
10
|
backgroundColor: "blackAlpha.600",
|
11
11
|
zIndex: "modal",
|
12
|
+
color: "red",
|
12
13
|
},
|
13
14
|
dialogContainer: {
|
14
15
|
display: "flex",
|
@@ -18,8 +19,8 @@ const config = helpers.defineMultiStyleConfig({
|
|
18
19
|
overflow: props.scrollBehavior === "inside" ? "hidden" : "auto",
|
19
20
|
},
|
20
21
|
dialog: {
|
21
|
-
|
22
|
-
color: "inherit",
|
22
|
+
backgroundColor: mode("white", "pine")(props),
|
23
|
+
color: mode("inherit", "white")(props),
|
23
24
|
zIndex: "modal",
|
24
25
|
maxHeight:
|
25
26
|
props.scrollBehavior === "inside" ? "calc(100% - 7.5rem)" : undefined,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { defineStyleConfig } from "@chakra-ui/react";
|
2
|
+
import { mode } from "@chakra-ui/theme-tools";
|
2
3
|
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
3
4
|
import { focusVisible } from "../utils/focus-utils";
|
4
|
-
import { mode } from "@chakra-ui/theme-tools";
|
5
5
|
|
6
6
|
const config = defineStyleConfig({
|
7
7
|
baseStyle: {
|
@@ -55,7 +55,7 @@ const config = defineStyleConfig({
|
|
55
55
|
}),
|
56
56
|
_hover: {
|
57
57
|
color: mode("darkTeal", "white")(props),
|
58
|
-
backgroundColor: mode("coralGreen", "whiteAlpha.200")(props)
|
58
|
+
backgroundColor: mode("coralGreen", "whiteAlpha.200")(props),
|
59
59
|
},
|
60
60
|
_active: {
|
61
61
|
color: mode("pine", "white")(props),
|
@@ -67,7 +67,7 @@ const config = defineStyleConfig({
|
|
67
67
|
...focusVisible({
|
68
68
|
focus: {
|
69
69
|
backgroundColor: mode("darkGrey", "white")(props),
|
70
|
-
color: mode("white", "darkTeal")(props)
|
70
|
+
color: mode("white", "darkTeal")(props),
|
71
71
|
},
|
72
72
|
notFocus: {
|
73
73
|
boxShadow: "none",
|
@@ -76,52 +76,11 @@ const config = defineStyleConfig({
|
|
76
76
|
}),
|
77
77
|
_hover: {
|
78
78
|
backgroundColor: mode("blackAlpha.100", "whiteAlpha.200")(props),
|
79
|
-
color: mode("darkGrey", "white")(props)
|
79
|
+
color: mode("darkGrey", "white")(props),
|
80
80
|
},
|
81
81
|
_active: {
|
82
82
|
backgroundColor: mode("mint", "whiteAlpha.100")(props),
|
83
|
-
color: mode("darkGrey", "white")(props)
|
84
|
-
},
|
85
|
-
}),
|
86
|
-
/**
|
87
|
-
* @deprecated tertiary style will be deprecated in the future.
|
88
|
-
* Please use the secondary style instead.
|
89
|
-
*/
|
90
|
-
tertiary: (props) => ({
|
91
|
-
color: "white",
|
92
|
-
...focusVisible({
|
93
|
-
focus: {
|
94
|
-
color: "pine",
|
95
|
-
backgroundColor: "white",
|
96
|
-
boxShadow: getBoxShadowString({
|
97
|
-
borderColor: "white",
|
98
|
-
borderWidth: 3,
|
99
|
-
isInset: false,
|
100
|
-
}),
|
101
|
-
},
|
102
|
-
notFocus: {
|
103
|
-
color: "white",
|
104
|
-
boxShadow: "none",
|
105
|
-
backgroundColor: "transparent",
|
106
|
-
},
|
107
|
-
}),
|
108
|
-
_hover: {
|
109
|
-
color: "white",
|
110
|
-
backgroundColor: "whiteAlpha.200",
|
111
|
-
boxShadow: getBoxShadowString({
|
112
|
-
borderColor: props.theme.colors.whiteAlpha[200],
|
113
|
-
borderWidth: 3,
|
114
|
-
isInset: false,
|
115
|
-
}),
|
116
|
-
},
|
117
|
-
_active: {
|
118
|
-
color: "white",
|
119
|
-
backgroundColor: "whiteAlpha.400",
|
120
|
-
boxShadow: getBoxShadowString({
|
121
|
-
borderColor: props.theme.colors.whiteAlpha[400],
|
122
|
-
borderWidth: 3,
|
123
|
-
isInset: false,
|
124
|
-
}),
|
83
|
+
color: mode("darkGrey", "white")(props),
|
125
84
|
},
|
126
85
|
}),
|
127
86
|
},
|
@@ -19,7 +19,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
19
19
|
},
|
20
20
|
dialog: {
|
21
21
|
borderRadius: "md",
|
22
|
-
background: mode("white", "
|
22
|
+
background: mode("white", "pine")(props),
|
23
23
|
color: mode("inherit", "white")(props),
|
24
24
|
my: "3.75rem",
|
25
25
|
zIndex: "modal",
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { popoverAnatomy as parts } from "@chakra-ui/anatomy";
|
2
2
|
import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
|
3
|
-
import { cssVar } from "@chakra-ui/theme-tools";
|
3
|
+
import { cssVar, mode } from "@chakra-ui/theme-tools";
|
4
|
+
import { getBoxShadowString } from "../utils/box-shadow-utils";
|
5
|
+
import { focusVisible } from "../utils/focus-utils";
|
4
6
|
|
5
7
|
const $popperBg = cssVar("popper-bg");
|
6
8
|
const $arrowBg = cssVar("popper-arrow-bg");
|
@@ -9,12 +11,12 @@ const $arrowShadowColor = cssVar("popper-arrow-shadow-color");
|
|
9
11
|
const helpers = createMultiStyleConfigHelpers(parts.keys);
|
10
12
|
|
11
13
|
const config = helpers.defineMultiStyleConfig({
|
12
|
-
baseStyle: {
|
14
|
+
baseStyle: (props) => ({
|
13
15
|
popper: {
|
14
16
|
zIndex: "popover",
|
15
17
|
},
|
16
18
|
content: {
|
17
|
-
[$popperBg.variable]: `colors.darkTeal`,
|
19
|
+
[$popperBg.variable]: mode(`colors.darkTeal`, `colors.pine`)(props) ,
|
18
20
|
backgroundColor: $popperBg.reference,
|
19
21
|
[$arrowBg.variable]: $popperBg.reference,
|
20
22
|
[$arrowShadowColor.variable]: `colors.blackAlpha.300`,
|
@@ -36,6 +38,20 @@ const config = helpers.defineMultiStyleConfig({
|
|
36
38
|
},
|
37
39
|
closeButton: {
|
38
40
|
position: "absolute",
|
41
|
+
color: "white",
|
42
|
+
hover: "whiteAlpha.100",
|
43
|
+
...focusVisible({
|
44
|
+
focus: {
|
45
|
+
boxShadow: getBoxShadowString({ borderColor: "azure" }),
|
46
|
+
|
47
|
+
},
|
48
|
+
notFocus: {
|
49
|
+
boxShadow: "none",
|
50
|
+
},
|
51
|
+
}),
|
52
|
+
_active: {
|
53
|
+
backgroundColor: "whiteAlpha.200",
|
54
|
+
},
|
39
55
|
borderRadius: "xs",
|
40
56
|
top: 1,
|
41
57
|
insetEnd: 1,
|
@@ -43,7 +59,7 @@ const config = helpers.defineMultiStyleConfig({
|
|
43
59
|
height: 2,
|
44
60
|
padding: 1,
|
45
61
|
},
|
46
|
-
},
|
62
|
+
}),
|
47
63
|
sizes: {
|
48
64
|
sm: {
|
49
65
|
content: {
|
package/src/util/externals.tsx
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
export {
|
3
3
|
DarkMode,
|
4
4
|
LightMode,
|
5
|
+
Portal,
|
5
6
|
useBreakpointValue,
|
6
7
|
useClipboard,
|
7
8
|
useColorMode,
|
@@ -17,6 +18,7 @@ export {
|
|
17
18
|
useToken,
|
18
19
|
} from "@chakra-ui/react";
|
19
20
|
export type {
|
21
|
+
PortalProps,
|
20
22
|
UseClipboardOptions,
|
21
23
|
UseDisclosureProps,
|
22
24
|
UseOutsideClickProps,
|