@worldcoin/mini-apps-ui-kit-react 1.0.0-canary.15 → 1.0.0-canary.16

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 (29) hide show
  1. package/dist/components/Input/Input.d.ts +11 -41
  2. package/dist/components/Input/Input.js +172 -125
  3. package/dist/components/Input/index.js +2 -4
  4. package/dist/components/OTPField/OTPField.d.ts +3 -0
  5. package/dist/components/OTPField/OTPField.js +46 -28
  6. package/dist/components/OTPField/index.js +3 -2
  7. package/dist/components/PasswordField/PasswordField.d.ts +1 -1
  8. package/dist/components/PasswordField/PasswordField.js +24 -27
  9. package/dist/components/PasteButton/PasteButton.d.ts +0 -1
  10. package/dist/components/PasteButton/PasteButton.js +5 -6
  11. package/dist/components/PhoneField/PhoneField.d.ts +1 -6
  12. package/dist/components/PhoneField/PhoneField.js +46 -49
  13. package/dist/components/PhoneField/constants.d.ts +0 -1
  14. package/dist/components/PhoneField/constants.js +12 -18
  15. package/dist/components/SearchField/SearchField.d.ts +1 -1
  16. package/dist/components/SearchField/SearchField.js +42 -45
  17. package/dist/components/Select/Select.d.ts +6 -0
  18. package/dist/components/Select/Select.js +77 -44
  19. package/dist/components/Select/index.js +3 -2
  20. package/dist/components/TextArea/TextArea.d.ts +6 -2
  21. package/dist/components/TextArea/TextArea.js +44 -25
  22. package/dist/components/TopBar/TopBar.js +9 -9
  23. package/dist/components/WalletAddressField/WalletAddressField.d.ts +1 -1
  24. package/dist/components/WalletAddressField/WalletAddressField.js +29 -31
  25. package/dist/index.js +21 -21
  26. package/dist/tailwind/index.d.ts +36 -0
  27. package/dist/tailwind/index.js +97 -12
  28. package/package.json +1 -1
  29. package/public/globals.css +1 -1
@@ -1,6 +1,6 @@
1
1
  import { CountryCode } from '../Flag/Flag';
2
2
  import { InputProps } from '../Input';
3
- export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdornment" | "startAdornmentWidth" | "placeholder"> {
3
+ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdornment" | "placeholder"> {
4
4
  /**
5
5
  * Current phone number value.
6
6
  */
@@ -48,11 +48,6 @@ export interface PhoneFieldProps extends Omit<InputProps, "onChange" | "startAdo
48
48
  * The component should use currentColor to match the Input's styling.
49
49
  */
50
50
  endAdornment?: React.ReactNode;
51
- /**
52
- * Width of the end adornment in rem
53
- * @default 1.25
54
- */
55
- endAdornmentWidth?: number;
56
51
  }
57
52
  export declare const PhoneField: import('react').ForwardRefExoticComponent<PhoneFieldProps & import('react').RefAttributes<HTMLDivElement>>;
58
53
  export default PhoneField;
@@ -1,92 +1,89 @@
1
1
  "use client";
2
- import { jsx as a } from "react/jsx-runtime";
3
- import { forwardRef as x, useImperativeHandle as B } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ import { forwardRef as V, useImperativeHandle as x } from "react";
4
4
  import { usePhoneInput as R } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
5
- import { CountryDrawer as W } from "../CountryDrawer/CountryDrawer.js";
6
- import { Input as _ } from "../Input/Input.js";
7
- import $ from "./CountrySelectorButton.js";
8
- import { DIAL_CODE_PREFIX as b, startAdornmentWidthByDialCodeLength as j } from "./constants.js";
9
- import { getCountryDataListByCodes as q, getValidatedCountryCode as d } from "./utils.js";
10
- const H = x(
5
+ import { CountryDrawer as g } from "../CountryDrawer/CountryDrawer.js";
6
+ import { Input as B } from "../Input/Input.js";
7
+ import _ from "./CountrySelectorButton.js";
8
+ import { DIAL_CODE_PREFIX as $ } from "./constants.js";
9
+ import { getCountryDataListByCodes as b, getValidatedCountryCode as m } from "./utils.js";
10
+ const j = V(
11
11
  ({
12
- value: m,
12
+ value: d,
13
13
  onChange: o,
14
- countries: i,
14
+ countries: a,
15
15
  label: f = "Phone",
16
16
  defaultCountryCode: t = "US",
17
17
  disableDialCodePrefill: c = !0,
18
- disabled: l = !1,
19
- error: h = !1,
20
- isValid: p,
18
+ disabled: i = !1,
19
+ error: p = !1,
20
+ isValid: h,
21
21
  endAdornment: C,
22
- endAdornmentWidth: y,
23
- type: D = "tel",
24
- inputMode: A = "tel",
22
+ type: y = "tel",
23
+ inputMode: D = "tel",
25
24
  autoComplete: w = "tel",
26
- autoCapitalize: P = "off",
27
- autoCorrect: v = "off",
28
- ...E
29
- }, I) => {
30
- const { inputValue: L, country: r, inputRef: n, handlePhoneValueChange: S, setCountry: g } = R(
25
+ autoCapitalize: A = "off",
26
+ autoCorrect: P = "off",
27
+ ...v
28
+ }, E) => {
29
+ const { inputValue: I, country: l, inputRef: r, handlePhoneValueChange: S, setCountry: F } = R(
31
30
  {
32
31
  defaultCountry: t.toLowerCase(),
33
32
  disableDialCodePrefill: c,
34
33
  disableDialCodeAndPrefix: !0,
35
- value: m,
36
- countries: q(i),
34
+ value: d,
35
+ countries: b(a),
37
36
  onChange: (e) => {
38
37
  o == null || o(
39
38
  e.phone,
40
- d(e.country.iso2, t)
39
+ m(e.country.iso2, t)
41
40
  );
42
41
  }
43
42
  }
44
- ), u = d(r.iso2, t), F = `${b}${r.dialCode}`, V = j[r.dialCode.length];
45
- return B(I, () => n.current), /* @__PURE__ */ a(
46
- _,
43
+ ), u = m(l.iso2, t), L = `${$}${l.dialCode}`;
44
+ return x(E, () => r.current), /* @__PURE__ */ n(
45
+ B,
47
46
  {
48
- ...E,
49
- ref: n,
50
- type: D,
51
- inputMode: A,
47
+ ...v,
48
+ ref: r,
49
+ type: y,
50
+ inputMode: D,
52
51
  autoComplete: w,
53
- autoCapitalize: P,
54
- autoCorrect: v,
55
- value: L,
52
+ autoCapitalize: A,
53
+ autoCorrect: P,
54
+ value: I,
56
55
  onChange: S,
57
56
  label: f,
58
- disabled: l,
59
- error: h,
60
- isValid: p,
57
+ disabled: i,
58
+ error: p,
59
+ isValid: h,
61
60
  endAdornment: C,
62
- endAdornmentWidth: y,
63
- startAdornmentWidth: V,
64
61
  showStartDivider: !0,
65
- startAdornment: /* @__PURE__ */ a(
66
- W,
62
+ startAdornment: /* @__PURE__ */ n(
63
+ g,
67
64
  {
68
65
  value: u,
69
66
  defaultValue: t,
70
- countries: i,
67
+ countries: a,
71
68
  onAnimationEnd: (e) => {
72
69
  e || requestAnimationFrame(() => {
73
70
  var s;
74
- (s = n.current) == null || s.focus();
71
+ (s = r.current) == null || s.focus();
75
72
  });
76
73
  },
77
74
  onChange: (e) => {
78
- g(e.toLowerCase());
75
+ F(e.toLowerCase());
79
76
  },
80
- disabled: l,
81
- children: /* @__PURE__ */ a($, { value: u, label: F })
77
+ disabled: i,
78
+ children: /* @__PURE__ */ n(_, { value: u, label: L })
82
79
  }
83
80
  )
84
81
  }
85
82
  );
86
83
  }
87
84
  );
88
- H.displayName = "PhoneField";
85
+ j.displayName = "PhoneField";
89
86
  export {
90
- H as PhoneField,
91
- H as default
87
+ j as PhoneField,
88
+ j as default
92
89
  };
@@ -1,4 +1,3 @@
1
1
  import { CountryData } from 'react-international-phone';
2
2
  export declare const extendedCountryDataList: CountryData[];
3
3
  export declare const DIAL_CODE_PREFIX = "+";
4
- export declare const startAdornmentWidthByDialCodeLength: Record<string, number>;
@@ -1,26 +1,20 @@
1
1
  import { countries as i } from "../../node_modules/.pnpm/countries-list@3.1.1/node_modules/countries-list/mjs/index.js";
2
2
  import { defaultCountries as e, parseCountry as s } from "../../node_modules/.pnpm/react-international-phone@4.4.0_react@18.3.1/node_modules/react-international-phone/dist/index.js";
3
- import { countryCodes as d } from "../Flag/constants.js";
3
+ import { countryCodes as c } from "../Flag/constants.js";
4
4
  const r = new Set(
5
- d.map((o) => o.toLowerCase())
6
- ), c = e.filter(
5
+ c.map((o) => o.toLowerCase())
6
+ ), p = e.filter(
7
7
  (o) => r.has(s(o).iso2)
8
- ), p = new Set(e.map((o) => s(o).iso2)), m = Array.from(r).filter(
9
- (o) => !p.has(o)
10
- ), l = Object.entries(i).filter(([o]) => m.includes(o.toLowerCase())).map(([o, t]) => {
8
+ ), d = new Set(e.map((o) => s(o).iso2)), m = Array.from(r).filter(
9
+ (o) => !d.has(o)
10
+ ), f = Object.entries(i).filter(([o]) => m.includes(o.toLowerCase())).map(([o, t]) => {
11
11
  const { name: n, phone: a } = t, u = a[0].toString(), C = o.toLowerCase();
12
12
  return [n, C, u];
13
- }), w = [
14
- ...c,
15
- ...l
16
- ].sort((o, t) => o[0].localeCompare(t[0])), h = "+", D = {
17
- 1: 5.5,
18
- 2: 6,
19
- 3: 6.5,
20
- 4: 7
21
- };
13
+ }), L = [
14
+ ...p,
15
+ ...f
16
+ ].sort((o, t) => o[0].localeCompare(t[0])), S = "+";
22
17
  export {
23
- h as DIAL_CODE_PREFIX,
24
- w as extendedCountryDataList,
25
- D as startAdornmentWidthByDialCodeLength
18
+ S as DIAL_CODE_PREFIX,
19
+ L as extendedCountryDataList
26
20
  };
@@ -1,5 +1,5 @@
1
1
  import { InputProps } from '../Input';
2
- export interface SearchFieldProps extends Omit<InputProps, "startAdornment" | "startAdornmentWidth" | "placeholder"> {
2
+ export interface SearchFieldProps extends Omit<InputProps, "startAdornment" | "placeholder"> {
3
3
  /**
4
4
  * If true, the input will display in an error state with error styling
5
5
  */
@@ -1,83 +1,80 @@
1
1
  "use client";
2
- import { jsx as a } from "react/jsx-runtime";
3
- import { createChangeEvent as c } from "../../lib/utils.js";
4
- import { forwardRef as T, useRef as W, useState as i, useImperativeHandle as N } from "react";
5
- import R from "../ClearButton/ClearButton.js";
6
- import { Magnifier as x } from "../Icons/Magnifier.js";
7
- import { Input as E } from "../Input/Input.js";
8
- import H, { PASTE_BUTTON_WIDTH as _ } from "../PasteButton/PasteButton.js";
9
- const j = T(
2
+ import { jsx as r } from "react/jsx-runtime";
3
+ import { createChangeEvent as l } from "../../lib/utils.js";
4
+ import { forwardRef as S, useRef as A, useState as m, useImperativeHandle as R } from "react";
5
+ import x from "../ClearButton/ClearButton.js";
6
+ import { Magnifier as N } from "../Icons/Magnifier.js";
7
+ import { Input as j } from "../Input/Input.js";
8
+ import w from "../PasteButton/PasteButton.js";
9
+ const y = S(
10
10
  ({
11
- showPasteButton: l,
12
- pasteButtonLabel: d,
11
+ showPasteButton: o,
12
+ pasteButtonLabel: i,
13
13
  isValid: s,
14
14
  disabled: u,
15
- type: h = "search",
16
- autoComplete: A = "off",
15
+ type: d = "search",
16
+ autoComplete: h = "off",
17
17
  spellCheck: F = "false",
18
- endAdornment: B,
19
- endAdornmentWidth: C,
20
- label: I = "Search",
18
+ endAdornment: C,
19
+ label: g = "Search",
21
20
  ...e
22
- }, P) => {
23
- const r = W(null), [S, o] = i(!1), [g, v] = i(!1);
24
- N(P, () => r.current);
25
- let f = B, m = C;
26
- return l && !u && !g ? (f = /* @__PURE__ */ a(
27
- H,
21
+ }, v) => {
22
+ const a = A(null), [B, c] = m(!1), [I, P] = m(!1);
23
+ R(v, () => a.current);
24
+ let f = C;
25
+ return o && !u && !I ? f = /* @__PURE__ */ r(
26
+ w,
28
27
  {
29
- inputRef: r,
30
- label: d,
28
+ inputRef: a,
29
+ label: i,
31
30
  onPaste: () => {
32
31
  var t;
33
- if (r.current) {
34
- const n = c(r.current);
35
- (t = e.onChange) == null || t.call(e, n), v(!0);
32
+ if (a.current) {
33
+ const n = l(a.current);
34
+ (t = e.onChange) == null || t.call(e, n), P(!0);
36
35
  }
37
36
  }
38
37
  }
39
- ), m = _) : S && !u && (f = /* @__PURE__ */ a(
40
- R,
38
+ ) : B && !u && (f = /* @__PURE__ */ r(
39
+ x,
41
40
  {
42
- inputRef: r,
41
+ inputRef: a,
43
42
  onClear: () => {
44
43
  var t;
45
- if (r.current) {
46
- const n = c(r.current);
44
+ if (a.current) {
45
+ const n = l(a.current);
47
46
  (t = e.onChange) == null || t.call(e, n);
48
47
  }
49
48
  }
50
49
  }
51
- ), m = 2.3), /* @__PURE__ */ a(
52
- E,
50
+ )), /* @__PURE__ */ r(
51
+ j,
53
52
  {
54
53
  ...e,
55
- ref: r,
56
- startAdornment: /* @__PURE__ */ a(x, {}),
54
+ ref: a,
55
+ startAdornment: /* @__PURE__ */ r(N, {}),
57
56
  isValid: s,
58
57
  disabled: u,
59
- startAdornmentWidth: 2.3,
60
- endAdornmentWidth: m,
61
58
  endAdornment: f,
62
- type: h,
63
- autoComplete: A,
59
+ type: d,
60
+ autoComplete: h,
64
61
  spellCheck: F,
65
62
  onFocus: (t) => {
66
63
  var n;
67
- o(!0), (n = e.onFocus) == null || n.call(e, t);
64
+ c(!0), (n = e.onFocus) == null || n.call(e, t);
68
65
  },
69
- label: I,
66
+ label: g,
70
67
  onBlur: (t) => {
71
68
  var n;
72
- o(!1), (n = e.onBlur) == null || n.call(e, t);
69
+ c(!1), (n = e.onBlur) == null || n.call(e, t);
73
70
  },
74
71
  className: "rounded-full h-[3.125rem]"
75
72
  }
76
73
  );
77
74
  }
78
75
  );
79
- j.displayName = "SearchField";
76
+ y.displayName = "SearchField";
80
77
  export {
81
- j as SearchField,
82
- j as default
78
+ y as SearchField,
79
+ y as default
83
80
  };
@@ -1,4 +1,10 @@
1
1
  import * as RadixSelect from "@radix-ui/react-select";
2
+ export declare const selectVariants: (props?: ({
3
+ error?: boolean | null | undefined;
4
+ isLabel?: boolean | null | undefined;
5
+ isFocused?: boolean | null | undefined;
6
+ variant?: "default" | "floating-label" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
2
8
  export interface SelectOption {
3
9
  /**
4
10
  * The value of the option.
@@ -1,66 +1,98 @@
1
1
  "use client";
2
2
  import { jsxs as d, jsx as r } from "react/jsx-runtime";
3
3
  import { DROPDOWN_CONTAINER_STYLES as x } from "../../lib/constants/dropdownStyles.js";
4
- import { Root as N, Trigger as S, Value as I, Icon as R, Portal as V, Content as j, Viewport as A, Item as T, ItemText as D } from "../../node_modules/.pnpm/@radix-ui_react-select@2.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._atdh45n5c7sked5b6tbwgdz7re/node_modules/@radix-ui/react-select/dist/index.js";
5
- import { forwardRef as E, useState as C, useEffect as O } from "react";
6
- import { cn as t } from "../../lib/utils.js";
7
- import { ArrowDown as P } from "../Icons/ArrowDown.js";
8
- import { inputVariants as _ } from "../Input/Input.js";
9
- import { typographyVariants as m } from "../Typography/Typography.js";
10
- const $ = E(
4
+ import { Root as N, Trigger as S, Value as V, Icon as I, Portal as R, Content as j, Viewport as A, Item as T, ItemText as D } from "../../node_modules/.pnpm/@radix-ui_react-select@2.1.4_@types_react-dom@18.3.5_@types_react@18.3.18__@types_react@18.3._atdh45n5c7sked5b6tbwgdz7re/node_modules/@radix-ui/react-select/dist/index.js";
5
+ import { cva as E } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
6
+ import { forwardRef as F, useState as C, useEffect as L } from "react";
7
+ import { cn as a } from "../../lib/utils.js";
8
+ import { ArrowDown as O } from "../Icons/ArrowDown.js";
9
+ import { typographyVariants as f } from "../Typography/Typography.js";
10
+ const P = E(
11
+ a(
12
+ "flex items-center justify-between whitespace-nowrap [&>span:first-of-type]:line-clamp-1",
13
+ "peer h-[3.5rem] w-full rounded-[0.625rem] border border-gray-100 bg-gray-100 px-4 outline-none transition duration-300",
14
+ "placeholder:text-gray-500",
15
+ "focus:border-gray-300 focus:bg-gray-0 focus-visible:outline-none",
16
+ "disabled:cursor-not-allowed disabled:opacity-50",
17
+ // Radix Select styles
18
+ "data-[placeholder]:text-gray-500",
19
+ "data-[state=closed]:bg-gray-100 data-[state=closed]:border-gray-100"
20
+ ),
21
+ {
22
+ variants: {
23
+ error: {
24
+ true: "border-error-600 focus:border-error-600 bg-gray-0"
25
+ },
26
+ isLabel: {
27
+ true: "pt-6 pb-2 placeholder:text-transparent",
28
+ false: ""
29
+ },
30
+ isFocused: {
31
+ true: "focus:border-gray-300 focus:bg-gray-0 focus-visible:outline-none",
32
+ false: ""
33
+ },
34
+ variant: {
35
+ "floating-label": "pt-6 pb-2 placeholder:text-transparent",
36
+ default: ""
37
+ }
38
+ },
39
+ defaultVariants: {
40
+ error: !1,
41
+ isFocused: !1,
42
+ variant: "default"
43
+ }
44
+ }
45
+ ), _ = F(
11
46
  ({
12
47
  options: l = [],
13
- placeholder: f = "Select...",
14
- value: i,
15
- onChange: h,
16
- open: a,
48
+ placeholder: u = "Select...",
49
+ value: o,
50
+ onChange: m,
51
+ open: t,
17
52
  onOpenChange: s,
18
- error: p = !1,
19
- defaultOpen: o = !1,
20
- disabled: u = !1,
21
- name: g,
53
+ error: b = !1,
54
+ defaultOpen: i = !1,
55
+ disabled: g = !1,
56
+ name: p,
22
57
  defaultValue: y,
23
- ...b
58
+ ...h
24
59
  }, v) => {
25
- const [c, n] = C(a ?? o), w = (e) => {
26
- n(e), s == null || s(e);
60
+ const [n, c] = C(t ?? i), w = (e) => {
61
+ c(e), s == null || s(e);
27
62
  };
28
- return O(() => {
29
- a !== void 0 && n(a);
30
- }, [a]), Array.isArray(l) || console.error("`options` must be an array of objects with `value` and `label` keys."), /* @__PURE__ */ d(
63
+ return L(() => {
64
+ t !== void 0 && c(t);
65
+ }, [t]), Array.isArray(l) || console.error("`options` must be an array of objects with `value` and `label` keys."), /* @__PURE__ */ d(
31
66
  N,
32
67
  {
33
- value: i,
34
- open: c,
35
- onValueChange: h,
36
- defaultOpen: o,
68
+ value: o,
69
+ open: n,
70
+ onValueChange: m,
71
+ defaultOpen: i,
37
72
  onOpenChange: w,
38
- name: g,
39
- disabled: u,
73
+ name: p,
74
+ disabled: g,
40
75
  defaultValue: y,
41
- ...b,
76
+ ...h,
42
77
  children: [
43
78
  /* @__PURE__ */ d(
44
79
  S,
45
80
  {
46
81
  ref: v,
47
- className: t(
48
- m({ variant: "body", level: 3 }),
49
- _({ error: p, isFocused: c }),
50
- "flex items-center justify-between whitespace-nowrap [&>span:first-of-type]:line-clamp-1",
51
- "data-[placeholder]:text-gray-500",
52
- "data-[state=closed]:bg-gray-100 data-[state=closed]:border-gray-100"
82
+ className: a(
83
+ f({ variant: "body" }),
84
+ P({ error: b, isFocused: n })
53
85
  ),
54
86
  children: [
55
- /* @__PURE__ */ r(I, { placeholder: f }),
56
- /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(P, { className: "text-gray-400 size-6" }) })
87
+ /* @__PURE__ */ r(V, { placeholder: u }),
88
+ /* @__PURE__ */ r(I, { children: /* @__PURE__ */ r(O, { className: "text-gray-400 size-6" }) })
57
89
  ]
58
90
  }
59
91
  ),
60
- /* @__PURE__ */ r(V, { children: /* @__PURE__ */ r(j, { position: "popper", className: t(x), children: /* @__PURE__ */ r(
92
+ /* @__PURE__ */ r(R, { children: /* @__PURE__ */ r(j, { position: "popper", className: a(x), children: /* @__PURE__ */ r(
61
93
  A,
62
94
  {
63
- className: t(
95
+ className: a(
64
96
  "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] p-2",
65
97
  l.length === 0 && "hidden"
66
98
  ),
@@ -68,10 +100,10 @@ const $ = E(
68
100
  T,
69
101
  {
70
102
  value: e.value,
71
- className: t(
103
+ className: a(
72
104
  "w-full cursor-pointer select-none rounded-md p-2 font-sans outline-none hover:bg-gray-50",
73
- i === e.value && "bg-gray-100",
74
- m({ variant: "body", level: 2 })
105
+ o === e.value && "bg-gray-100",
106
+ f({ variant: "body", level: 3 })
75
107
  ),
76
108
  children: /* @__PURE__ */ r(D, { children: e.label })
77
109
  },
@@ -84,8 +116,9 @@ const $ = E(
84
116
  );
85
117
  }
86
118
  );
87
- $.displayName = "Select";
119
+ _.displayName = "Select";
88
120
  export {
89
- $ as Select,
90
- $ as default
121
+ _ as Select,
122
+ _ as default,
123
+ P as selectVariants
91
124
  };
@@ -1,4 +1,5 @@
1
- import { Select as r } from "./Select.js";
1
+ import { Select as r, selectVariants as a } from "./Select.js";
2
2
  export {
3
- r as Select
3
+ r as Select,
4
+ a as selectVariants
4
5
  };
@@ -1,7 +1,11 @@
1
1
  import { VariantProps } from 'class-variance-authority';
2
- import { inputVariants } from '../Input/Input';
3
2
  import * as React from "react";
4
- export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "style" | "placeholder">, VariantProps<typeof inputVariants> {
3
+ export declare const textAreaVariants: (props?: ({
4
+ error?: boolean | null | undefined;
5
+ isFocused?: boolean | null | undefined;
6
+ variant?: "default" | "floating-label" | null | undefined;
7
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
8
+ export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "className" | "style" | "placeholder">, VariantProps<typeof textAreaVariants> {
5
9
  /**
6
10
  * If true, the textarea will display in an error state with error styling
7
11
  */
@@ -1,37 +1,55 @@
1
- import { jsxs as n, jsx as o } from "react/jsx-runtime";
2
- import { cva as d } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
- import * as c from "react";
1
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
+ import { cva as c } from "../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
+ import * as p from "react";
4
4
  import { cn as r } from "../../lib/utils.js";
5
- import { inputVariants as x } from "../Input/Input.js";
6
5
  import { typographyVariants as l } from "../Typography/Typography.js";
7
- const u = d("min-h-[7.5rem] resize-y", {
8
- variants: {
9
- variant: {
10
- "floating-label": "pt-8",
11
- default: "pt-4"
6
+ const b = c(
7
+ r(
8
+ "min-h-[7.5rem] resize-y peer w-full rounded-[0.625rem] border border-gray-100 bg-gray-100 px-4 outline-none transition duration-300",
9
+ "placeholder:text-gray-500",
10
+ "focus:border-gray-300 focus:bg-gray-0 focus-visible:outline-none",
11
+ "disabled:cursor-not-allowed disabled:opacity-50"
12
+ ),
13
+ {
14
+ variants: {
15
+ error: {
16
+ true: "border-error-600 focus:border-error-600 bg-gray-0"
17
+ },
18
+ isFocused: {
19
+ true: "focus:border-gray-300 focus:bg-gray-0 focus-visible:outline-none",
20
+ false: ""
21
+ },
22
+ variant: {
23
+ "floating-label": "pt-8 pb-2 placeholder:text-transparent",
24
+ default: "pt-4"
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ error: !1,
29
+ isFocused: !1,
30
+ variant: "default"
12
31
  }
13
32
  }
14
- }), b = c.forwardRef(
15
- ({ error: s, isFocused: m = !1, disabled: p, label: t, variant: e = "default", id: a, ...i }, f) => /* @__PURE__ */ n("div", { className: "relative flex w-full items-center group", children: [
16
- /* @__PURE__ */ o(
33
+ ), g = p.forwardRef(
34
+ ({ error: s, isFocused: d = !1, disabled: i, label: e, variant: a = "default", id: o, ...n }, f) => /* @__PURE__ */ u("div", { className: "relative flex w-full items-center group", children: [
35
+ /* @__PURE__ */ t(
17
36
  "textarea",
18
37
  {
19
38
  ref: f,
20
- id: a,
21
- placeholder: t,
22
- disabled: p,
39
+ id: o,
40
+ placeholder: e,
41
+ disabled: i,
23
42
  className: r(
24
- x({ error: s, isFocused: m, variant: e }),
25
- l({ variant: "body", level: 3 }),
26
- u({ variant: e })
43
+ b({ error: s, isFocused: d, variant: a }),
44
+ l({ variant: "body" })
27
45
  ),
28
- ...i
46
+ ...n
29
47
  }
30
48
  ),
31
- e === "floating-label" && /* @__PURE__ */ o(
49
+ a === "floating-label" && /* @__PURE__ */ t(
32
50
  "label",
33
51
  {
34
- htmlFor: a,
52
+ htmlFor: o,
35
53
  className: r(
36
54
  l({ variant: "body", level: 3 }),
37
55
  r(
@@ -42,13 +60,14 @@ const u = d("min-h-[7.5rem] resize-y", {
42
60
  "absolute text-gray-500 duration-300 transform text-xs top-0 pt-4 z-10 pl-4 w-full bg-gray-100 rounded-t-[0.625rem] border-t border-x border-gray-100"
43
61
  )
44
62
  ),
45
- children: t
63
+ children: e
46
64
  }
47
65
  )
48
66
  ] })
49
67
  );
50
- b.displayName = "TextArea";
68
+ g.displayName = "TextArea";
51
69
  export {
52
- b as TextArea,
53
- b as default
70
+ g as TextArea,
71
+ g as default,
72
+ b as textAreaVariants
54
73
  };