@vygruppen/spor-react 10.2.0 → 10.4.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.
@@ -38,6 +38,7 @@ export type ComboboxProps<T> = AriaComboBoxProps<T> & {
38
38
  inputRef?: React.RefObject<HTMLInputElement>;
39
39
  /** If you want to allow an empty collection */
40
40
  allowsEmptyCollection?: boolean;
41
+ variant?: "base" | "floating";
41
42
  } & OverridableInputProps;
42
43
  /**
43
44
  * A combobox is a combination of an input and a list of suggestions.
@@ -87,6 +88,7 @@ export function Combobox<T extends object>({
87
88
  emptyContent,
88
89
  inputRef: externalInputRef,
89
90
  allowsEmptyCollection,
91
+ variant,
90
92
  ...rest
91
93
  }: ComboboxProps<T>) {
92
94
  const { contains } = useFilter({ sensitivity: "base" });
@@ -147,6 +149,7 @@ export function Combobox<T extends object>({
147
149
  ref={inputRef}
148
150
  role="combobox"
149
151
  label={label}
152
+ variant={variant}
150
153
  aria-expanded={state.isOpen}
151
154
  aria-autocomplete="list"
152
155
  aria-controls={listboxId}
@@ -196,6 +199,7 @@ export function Combobox<T extends object>({
196
199
  listBoxRef={listBoxRef}
197
200
  emptyContent={emptyContent}
198
201
  maxWidth={inputWidth}
202
+ variant={variant}
199
203
  >
200
204
  {rest.children}
201
205
  </ListBox>
@@ -26,6 +26,7 @@ type CountryCodeSelectProps = {
26
26
  name: string;
27
27
  width?: BoxProps["width"];
28
28
  height?: BoxProps["height"];
29
+ variant?: "base" | "floating";
29
30
  };
30
31
  export const CountryCodeSelect = (props: CountryCodeSelectProps) => {
31
32
  const { t } = useTranslation();
@@ -35,6 +36,7 @@ export const CountryCodeSelect = (props: CountryCodeSelectProps) => {
35
36
  label={t(texts.countryCode)}
36
37
  isLabelSrOnly={true}
37
38
  items={callingCodes as any}
39
+ variant={props.variant}
38
40
  {...props}
39
41
  >
40
42
  {(item) => <Item key={item.key}>{item.key}</Item>}
@@ -178,18 +178,19 @@ export function InfoSelect<T extends object>({
178
178
 
179
179
  const stateStyle = "completed";
180
180
 
181
+ const hasChosenValue = state.selectedItem !== null;
182
+
181
183
  const styles = useMultiStyleConfig("InfoSelect", {
182
184
  isOpen: state.isOpen,
183
185
  isLabelSrOnly,
184
186
  variant,
185
187
  stateStyle,
188
+ hasChosenValue,
186
189
  });
187
190
  const { buttonProps } = useButton(triggerProps, triggerRef);
188
191
  const { t } = useTranslation();
189
192
  const formControl = useFormControlProps(props);
190
193
 
191
- const hasChosenValue = state.selectedItem !== null;
192
-
193
194
  return (
194
195
  <Box sx={styles.container}>
195
196
  <HiddenSelect
@@ -226,7 +227,7 @@ export function InfoSelect<T extends object>({
226
227
  {...valueProps}
227
228
  h={isLabelSrOnly ? "" : !hasChosenValue ? "0px" : "18px"}
228
229
  hidden={!hasChosenValue}
229
- transform={isLabelSrOnly ? "" : "scale(1) translateY(-10px)"}
230
+ transform={isLabelSrOnly ? "" : "scale(1) translateY(-12px)"}
230
231
  transitionProperty={"var(--spor-transition-property-common)"}
231
232
  transitionDuration={"var(--spor-transition-duration-normal)"}
232
233
  >
@@ -253,6 +254,7 @@ export function InfoSelect<T extends object>({
253
254
  state={state}
254
255
  listBoxRef={listboxRef}
255
256
  borderBottomRadius="sm"
257
+ variant={variant}
256
258
  >
257
259
  {props.children}
258
260
  </ListBox>
@@ -29,6 +29,7 @@ type ListBoxProps<T> = AriaListBoxProps<T> &
29
29
  /** UI to render if the collection is empty */
30
30
  emptyContent?: React.ReactNode;
31
31
  maxWidth?: BoxProps["maxWidth"];
32
+ variant?: "base" | "floating";
32
33
  };
33
34
 
34
35
  /**
@@ -70,10 +71,11 @@ export function ListBox<T extends object>({
70
71
  listBoxRef,
71
72
  state,
72
73
  maxWidth,
74
+ variant,
73
75
  ...props
74
76
  }: ListBoxProps<T>) {
75
77
  const { listBoxProps } = useListBox(props, state, listBoxRef);
76
- const styles = useMultiStyleConfig("ListBox", {});
78
+ const styles = useMultiStyleConfig("ListBox", { variant });
77
79
 
78
80
  return (
79
81
  <List
@@ -82,6 +84,7 @@ export function ListBox<T extends object>({
82
84
  sx={styles.container}
83
85
  aria-busy={isLoading}
84
86
  maxWidth={maxWidth}
87
+ variant={variant}
85
88
  >
86
89
  {state.collection.size === 0 && props.emptyContent}
87
90
  {Array.from(state.collection).map((item) =>
@@ -4,7 +4,7 @@ import {
4
4
  useFormControl,
5
5
  useMultiStyleConfig,
6
6
  } from "@chakra-ui/react";
7
- import React from "react";
7
+ import React, { useRef } from "react";
8
8
  import {
9
9
  Box,
10
10
  BoxProps,
@@ -35,6 +35,8 @@ type NumericStepperProps = {
35
35
  stepSize?: number;
36
36
  /** Whether to show the number input when value is zero */
37
37
  showZero?: boolean;
38
+ /** Name added to the aria-label of subtract and add buttons. */
39
+ ariaLabelContext?: { singular: string; plural: string };
38
40
  } & Omit<BoxProps, "onChange">;
39
41
  /** A simple stepper component for integer values
40
42
  *
@@ -72,8 +74,10 @@ export function NumericStepper({
72
74
  withInput = true,
73
75
  stepSize = 1,
74
76
  showZero = false,
77
+ ariaLabelContext = { singular: "", plural: "" },
75
78
  ...boxProps
76
79
  }: NumericStepperProps) {
80
+ const addButtonRef = useRef<HTMLButtonElement>(null);
77
81
  const { t } = useTranslation();
78
82
  const styles = useMultiStyleConfig("NumericStepper", {});
79
83
  const [value, onChange] = useControllableState<number>({
@@ -84,12 +88,26 @@ export function NumericStepper({
84
88
  const formControlProps = useFormControl({ id: idProp, isDisabled });
85
89
  const clampedStepSize = Math.max(Math.min(stepSize, 10), 1);
86
90
 
91
+ const focusOnAddButton = () => {
92
+ addButtonRef.current?.focus();
93
+ };
94
+
87
95
  return (
88
96
  <Flex __css={styles.container} {...boxProps}>
89
97
  <VerySmallButton
90
98
  icon={<SubtractIcon stepLabel={clampedStepSize} />}
91
- aria-label={t(texts.decrementButtonAriaLabel(clampedStepSize))}
92
- onClick={() => onChange(Math.max(value - clampedStepSize, minValue))}
99
+ aria-label={t(
100
+ texts.decrementButtonAriaLabel(
101
+ clampedStepSize,
102
+ stepSize == 1 ? ariaLabelContext.singular : ariaLabelContext.plural,
103
+ ),
104
+ )}
105
+ onClick={() => {
106
+ onChange(Math.max(value - clampedStepSize, minValue));
107
+ if (Math.max(value - clampedStepSize, minValue) <= minValue) {
108
+ focusOnAddButton();
109
+ }
110
+ }}
93
111
  visibility={value <= minValue ? "hidden" : "visible"}
94
112
  isDisabled={formControlProps.disabled}
95
113
  id={value <= minValue ? undefined : formControlProps.id}
@@ -107,27 +125,48 @@ export function NumericStepper({
107
125
  width={`${Math.max(value.toString().length + 1, 3)}ch`}
108
126
  visibility={!showZero && value === 0 ? "hidden" : "visible"}
109
127
  aria-live="assertive"
110
- aria-label={value.toString()}
128
+ aria-label={
129
+ ariaLabelContext.plural !== ""
130
+ ? t(texts.currentNumberAriaLabel(ariaLabelContext.plural))
131
+ : ""
132
+ }
111
133
  onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
112
134
  const numericInput = Number(e.target.value);
113
135
  if (Number.isNaN(numericInput)) {
114
136
  return;
115
137
  }
116
138
  onChange(Math.max(Math.min(numericInput, maxValue), minValue));
139
+ if (
140
+ !showZero &&
141
+ Math.max(Math.min(numericInput, maxValue), minValue) === 0
142
+ ) {
143
+ focusOnAddButton();
144
+ }
117
145
  }}
118
146
  />
119
147
  ) : (
120
148
  <chakra.text
121
149
  sx={styles.text}
122
150
  visibility={!showZero && value === 0 ? "hidden" : "visible"}
123
- aria-label={value.toString()}
151
+ aria-live="assertive"
152
+ aria-label={
153
+ ariaLabelContext.plural !== ""
154
+ ? t(texts.currentNumberAriaLabel(ariaLabelContext.plural))
155
+ : ""
156
+ }
124
157
  >
125
158
  {value}
126
159
  </chakra.text>
127
160
  )}
128
161
  <VerySmallButton
162
+ ref={addButtonRef}
129
163
  icon={<AddIcon stepLabel={clampedStepSize} />}
130
- aria-label={t(texts.incrementButtonAriaLabel(clampedStepSize))}
164
+ aria-label={t(
165
+ texts.incrementButtonAriaLabel(
166
+ clampedStepSize,
167
+ stepSize == 1 ? ariaLabelContext.singular : ariaLabelContext.plural,
168
+ ),
169
+ )}
131
170
  onClick={() => onChange(Math.min(value + clampedStepSize, maxValue))}
132
171
  visibility={value >= maxValue ? "hidden" : "visible"}
133
172
  isDisabled={formControlProps.disabled}
@@ -152,12 +191,18 @@ type VerySmallButtonProps = {
152
191
  id?: string;
153
192
  };
154
193
  /** Internal override for extra small icon buttons */
155
- const VerySmallButton = (props: VerySmallButtonProps) => {
194
+ const VerySmallButton = React.forwardRef((props: VerySmallButtonProps, ref) => {
156
195
  const styles = useMultiStyleConfig("NumericStepper", {});
157
196
  return (
158
- <IconButton variant="primary" size="xs" sx={styles.button} {...props} />
197
+ <IconButton
198
+ variant="primary"
199
+ size="xs"
200
+ sx={styles.button}
201
+ ref={ref}
202
+ {...props}
203
+ />
159
204
  );
160
- };
205
+ });
161
206
 
162
207
  type IconPropTypes = BoxProps & { stepLabel: number };
163
208
 
@@ -221,20 +266,28 @@ const AddIcon = ({ stepLabel, ...props }: IconPropTypes) => (
221
266
  );
222
267
 
223
268
  const texts = createTexts({
224
- decrementButtonAriaLabel(stepSize) {
269
+ currentNumberAriaLabel(ariaContext) {
270
+ return {
271
+ nb: `Valgt antall ${ariaContext}`,
272
+ en: `Chosen number of ${ariaContext}`,
273
+ nn: `Valgt antall ${ariaContext}`,
274
+ sv: `Valgt antall ${ariaContext}`,
275
+ };
276
+ },
277
+ decrementButtonAriaLabel(stepSize, ariaContext) {
225
278
  return {
226
- nb: `Trekk fra ${stepSize}`,
227
- en: `Subtract ${stepSize}`,
228
- nn: `Trekk frå ${stepSize}`,
229
- sv: `Subtrahera ${stepSize}`,
279
+ nb: `Trekk fra ${stepSize} ${ariaContext}`,
280
+ en: `Subtract ${stepSize} ${ariaContext}`,
281
+ nn: `Trekk frå ${stepSize} ${ariaContext}`,
282
+ sv: `Subtrahera ${stepSize} ${ariaContext}`,
230
283
  };
231
284
  },
232
- incrementButtonAriaLabel(stepSize) {
285
+ incrementButtonAriaLabel(stepSize, ariaContext) {
233
286
  return {
234
- nb: `Legg til ${stepSize}`,
235
- en: `Add ${stepSize}`,
236
- nn: `Legg til ${stepSize}`,
237
- sv: `Lägg till ${stepSize}`,
287
+ nb: `Legg til ${stepSize} ${ariaContext}`,
288
+ en: `Add ${stepSize} ${ariaContext}`,
289
+ nn: `Legg til ${stepSize} ${ariaContext}`,
290
+ sv: `Lägg till ${stepSize} ${ariaContext}`,
238
291
  };
239
292
  },
240
293
  });
@@ -24,6 +24,7 @@ type PhoneNumberInputProps = Omit<BoxProps, "onChange"> & {
24
24
  onChange?: (change: CountryCodeAndPhoneNumber) => void;
25
25
  /** The optional value of the country code and phone number */
26
26
  value?: CountryCodeAndPhoneNumber;
27
+ variant?: "base" | "floating";
27
28
  };
28
29
  /**
29
30
  * A component for entering phone numbers.
@@ -49,6 +50,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
49
50
  name,
50
51
  value: externalValue,
51
52
  onChange: externalOnChange,
53
+ variant,
52
54
  ...boxProps
53
55
  },
54
56
  ref,
@@ -73,6 +75,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
73
75
  width="6.25rem"
74
76
  height="100%"
75
77
  value="+47"
78
+ variant={variant}
76
79
  >
77
80
  <Item key="+47">+47</Item>
78
81
  </InfoSelect>
@@ -89,6 +92,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
89
92
  name={name ? `${name}-country-code` : "country-code"}
90
93
  height="100%"
91
94
  width="6.25rem"
95
+ variant={variant}
92
96
  />
93
97
  </Suspense>
94
98
  <Input
@@ -107,6 +111,7 @@ export const PhoneNumberInput = forwardRef<PhoneNumberInputProps, As>(
107
111
  }}
108
112
  position="relative"
109
113
  left="1px" // Makes the borders overlap
114
+ variant={variant}
110
115
  />
111
116
  </AttachedInputs>
112
117
  );
@@ -1,4 +1,5 @@
1
1
  import {
2
+ As,
2
3
  Switch as ChakraSwitch,
3
4
  SwitchProps as ChakraSwitchProps,
4
5
  forwardRef,
@@ -7,6 +8,7 @@ import React from "react";
7
8
 
8
9
  export type SwitchProps = Omit<ChakraSwitchProps, "colorScheme" | "variant"> & {
9
10
  size?: "sm" | "md" | "lg";
11
+ as?: As;
10
12
  };
11
13
 
12
14
  /**
@@ -31,7 +33,7 @@ export type SwitchProps = Omit<ChakraSwitchProps, "colorScheme" | "variant"> & {
31
33
  * ```
32
34
  */
33
35
  export const Switch = forwardRef<SwitchProps, "input">(
34
- ({ size = "md", ...props }: SwitchProps, ref) => {
35
- return <ChakraSwitch size={size} {...props} ref={ref} />;
36
+ ({ size = "md", as = "div", ...props }: SwitchProps, ref) => {
37
+ return <ChakraSwitch as={as} size={size} {...props} ref={ref} />;
36
38
  },
37
39
  );
@@ -1,5 +1,4 @@
1
1
  import {
2
- Box,
3
2
  FormLabel,
4
3
  forwardRef,
5
4
  Textarea as ChakraTextarea,
@@ -9,7 +8,7 @@ import {
9
8
  } from "@chakra-ui/react";
10
9
  import React, { useId } from "react";
11
10
 
12
- export type TextareaProps = Exclude<ChakraTextareaProps, "variant" | "size"> & {
11
+ export type TextareaProps = Exclude<ChakraTextareaProps, "size"> & {
13
12
  label?: string;
14
13
  };
15
14
  /**
@@ -4,7 +4,7 @@ import { mode } from "@chakra-ui/theme-tools";
4
4
  import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
5
5
  import { floatingBackground, floatingBorder } from "../utils/floating-utils";
6
6
  import { focusVisibleStyles } from "../utils/focus-utils";
7
- import { ghostBackground } from "../utils/ghost-utils";
7
+ import { ghostBackground, ghostText } from "../utils/ghost-utils";
8
8
 
9
9
  const parts = anatomy("card-select").parts("trigger", "card");
10
10
 
@@ -20,6 +20,7 @@ const config = helpers.defineMultiStyleConfig({
20
20
  label: {
21
21
  position: "relative",
22
22
  fontSize: ["mobile.xs", "desktop.sm"],
23
+ marginTop: props.hasChosenValue ? 2 : 0,
23
24
  ...(props.isLabelSrOnly ? srOnly : {}),
24
25
  },
25
26
  innerButton: {
@@ -1,101 +1,22 @@
1
1
  import { inputAnatomy as parts } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import { baseBackground, baseBorder, baseText } from "../utils/base-utils";
4
- import { focusVisibleStyles } from "../utils/focus-utils";
5
- import { surface } from "../utils/surface-utils";
6
- import { floatingBackground, floatingBorder } from "../utils/floating-utils";
3
+ import { inputBaseStyle, inputVariant } from "../utils/input-utils";
7
4
 
8
5
  const helpers = createMultiStyleConfigHelpers(parts.keys);
9
6
 
10
7
  const config = helpers.defineMultiStyleConfig({
11
8
  baseStyle: (props) => ({
12
- field: {
13
- appearance: "none",
14
- width: "100%",
15
- outline: "none",
16
- border: 0,
17
- borderRadius: "sm",
18
- transitionProperty: "common",
19
- transitionDuration: "fast",
20
- position: "relative",
21
- paddingX: 3,
22
- height: 8,
23
- fontSize: "mobile.md",
24
- _hover: {
25
- ...baseBorder("hover", props),
26
- },
27
- _active: {
28
- ...baseBackground("active", props),
29
- ...baseBorder("default", props),
30
- },
31
- _focusVisible: {
32
- ...focusVisibleStyles(props)._focusVisible,
33
- outlineOffset: 0,
34
- },
35
-
36
- _disabled: {
37
- ...surface("disabled", props),
38
- ...baseBorder("disabled", props),
39
- pointerEvents: "none",
40
- },
41
- _invalid: {
42
- ...baseBorder("invalid", props),
43
- _hover: {
44
- ...baseBorder("hover", props),
45
- },
46
- },
47
- " + label": {
48
- fontSize: ["mobile.sm", "desktop.sm"],
49
- top: "2px",
50
- left: props.paddingLeft || props.pl || 3,
51
- zIndex: 2,
52
- position: "absolute",
53
- marginY: 2,
54
- transition: ".1s ease-out",
55
- transformOrigin: "top left",
56
- cursor: "text",
57
- },
58
- "&:not(:placeholder-shown)": {
59
- paddingTop: "1rem",
60
- "& + label": {
61
- transform: "scale(0.825) translateY(-10px)",
62
- },
63
- },
64
- },
65
- element: {
66
- height: "100%",
67
- },
68
- group: {
69
- ":has(:disabled)": {
70
- ...baseText("disabled", props),
71
- },
72
- },
9
+ ...inputBaseStyle(props),
73
10
  }),
74
11
  variants: {
75
12
  base: (props) => ({
76
13
  field: {
77
- ...baseBackground("default", props),
78
- ...baseBorder("default", props),
14
+ ...inputVariant("base", props),
79
15
  },
80
16
  }),
81
17
  floating: (props) => ({
82
18
  field: {
83
- boxShadow: "sm",
84
- ...floatingBackground("default", props),
85
- ...floatingBorder("default", props),
86
-
87
- _hover: {
88
- ...floatingBorder("hover", props),
89
- ...floatingBackground("hover", props),
90
- },
91
- _active: {
92
- ...floatingBorder("active", props),
93
- ...floatingBackground("active", props),
94
- },
95
- _selected: {
96
- ...floatingBorder("selected", props),
97
- ...floatingBackground("selected", props),
98
- },
19
+ ...inputVariant("floating", props),
99
20
  },
100
21
  }),
101
22
  },
@@ -1,10 +1,10 @@
1
1
  import { anatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
- import { mode } from "@chakra-ui/theme-tools";
4
3
  import { baseBorder } from "../utils/base-utils";
5
4
  import { ghostBackground, ghostText } from "../utils/ghost-utils";
6
5
  import { surface } from "../utils/surface-utils";
7
6
  import { outlineBorder } from "../utils/outline-utils";
7
+ import { floatingBorder } from "../utils/floating-utils";
8
8
 
9
9
  const parts = anatomy("ListBox").parts(
10
10
  "container",
@@ -25,7 +25,6 @@ const config = helpers.defineMultiStyleConfig({
25
25
  width: "100%",
26
26
  listStyle: "none",
27
27
  borderBottomRadius: "sm",
28
- ...baseBorder("default", props),
29
28
  },
30
29
  item: {
31
30
  paddingX: 2,
@@ -58,6 +57,21 @@ const config = helpers.defineMultiStyleConfig({
58
57
  },
59
58
  },
60
59
  }),
60
+ variants: {
61
+ base: (props) => ({
62
+ container: {
63
+ ...baseBorder("default", props),
64
+ },
65
+ }),
66
+ floating: (props) => ({
67
+ container: {
68
+ ...floatingBorder("default", props),
69
+ },
70
+ }),
71
+ },
72
+ defaultProps: {
73
+ variant: "base",
74
+ },
61
75
  });
62
76
 
63
77
  export default config;
@@ -2,6 +2,7 @@ import { selectAnatomy } from "@chakra-ui/anatomy";
2
2
  import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
3
3
  import { baseText } from "../utils/base-utils";
4
4
  import { default as Input } from "./input";
5
+ import { inputBaseStyle, inputVariant } from "../utils/input-utils";
5
6
 
6
7
  const parts = selectAnatomy.extend("root");
7
8
 
@@ -15,7 +16,7 @@ const config = helpers.defineMultiStyleConfig({
15
16
  position: "relative",
16
17
  "& + label": {
17
18
  fontSize: ["mobile.sm", "desktop.sm"],
18
- top: "2px",
19
+ top: "0.2rem",
19
20
  left: 3,
20
21
  zIndex: 2,
21
22
  position: "absolute",
@@ -28,10 +29,9 @@ const config = helpers.defineMultiStyleConfig({
28
29
  },
29
30
  },
30
31
  field: {
31
- ...Input.baseStyle!(props).field,
32
+ ...inputBaseStyle(props).field,
32
33
  appearance: "none",
33
34
  paddingTop: "1rem",
34
- "option, optgroup": {},
35
35
  },
36
36
  icon: {
37
37
  width: 5,
@@ -46,6 +46,21 @@ const config = helpers.defineMultiStyleConfig({
46
46
  },
47
47
  },
48
48
  }),
49
+ variants: {
50
+ base: (props) => ({
51
+ field: {
52
+ ...inputVariant("base", props),
53
+ },
54
+ }),
55
+ floating: (props) => ({
56
+ field: {
57
+ ...inputVariant("floating", props),
58
+ },
59
+ }),
60
+ },
61
+ defaultProps: {
62
+ variant: "base",
63
+ },
49
64
  });
50
65
 
51
66
  export default config;
@@ -1,9 +1,9 @@
1
1
  import { defineStyleConfig } from "@chakra-ui/react";
2
- import Input from "./input";
2
+ import { inputBaseStyle, inputVariant } from "../utils/input-utils";
3
3
 
4
4
  const config = defineStyleConfig({
5
5
  baseStyle: (props) => ({
6
- ...Input.baseStyle!(props).field,
6
+ ...inputBaseStyle(props).field,
7
7
  minHeight: "5rem",
8
8
  verticalAlign: "top",
9
9
  appearance: "none",
@@ -17,6 +17,17 @@ const config = defineStyleConfig({
17
17
  },
18
18
  },
19
19
  }),
20
+ variants: {
21
+ base: (props) => ({
22
+ ...inputVariant("base", props),
23
+ }),
24
+ floating: (props) => ({
25
+ ...inputVariant("floating", props),
26
+ }),
27
+ },
28
+ defaultProps: {
29
+ variant: "base",
30
+ },
20
31
  });
21
32
 
22
33
  export default config;
@@ -1,6 +1,6 @@
1
- import { mode } from "@chakra-ui/theme-tools";
1
+ import { mode, StyleFunctionProps } from "@chakra-ui/theme-tools";
2
2
 
3
- export const focusVisibleStyles = (props: any) => ({
3
+ export const focusVisibleStyles = (props: StyleFunctionProps) => ({
4
4
  _focusVisible: {
5
5
  outlineWidth: "2px",
6
6
  outlineColor: mode("outline.focus.light", "outline.focus.dark")(props),