@cfx-dev/ui-components 4.5.1 → 4.5.3

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 (45) hide show
  1. package/dist/assets/all_css.css +2 -0
  2. package/dist/assets/css/Input.css +1 -1
  3. package/dist/assets/css/StyledInput.css +1 -0
  4. package/dist/assets/css/StyledTextarea.css +1 -0
  5. package/dist/assets/css/Textarea.css +1 -1
  6. package/dist/assets/general/global.css +1 -1
  7. package/dist/components/Checkbox/Checkbox.d.ts +1 -0
  8. package/dist/components/Checkbox/Checkbox.js +139 -129
  9. package/dist/components/DropdownSelect/DropdownSelect.d.ts +2 -1
  10. package/dist/components/DropdownSelect/DropdownSelect.js +53 -44
  11. package/dist/components/DropdownSelect/DropdownSelectShowcase.js +13 -12
  12. package/dist/components/Input/Input.d.ts +3 -2
  13. package/dist/components/Input/Input.js +94 -89
  14. package/dist/components/Input/Input.types.d.ts +2 -0
  15. package/dist/components/Input/Input.types.js +1 -0
  16. package/dist/components/Input/RichInput.d.ts +1 -1
  17. package/dist/components/Input/index.d.ts +2 -1
  18. package/dist/components/InputDropzone/InputDropzone.d.ts +1 -0
  19. package/dist/components/InputDropzone/InputDropzone.js +135 -134
  20. package/dist/components/InputDropzone/InputDropzoneShowcase.js +6 -5
  21. package/dist/components/Radio/Radio.d.ts +1 -0
  22. package/dist/components/Radio/Radio.js +21 -19
  23. package/dist/components/StyledInput/StyledInput.d.ts +12 -0
  24. package/dist/components/StyledInput/StyledInput.js +46 -0
  25. package/dist/components/StyledInput/index.d.ts +2 -0
  26. package/dist/components/StyledInput/index.js +4 -0
  27. package/dist/components/StyledTextarea/StyledTextarea.d.ts +10 -0
  28. package/dist/components/StyledTextarea/StyledTextarea.js +32 -0
  29. package/dist/components/StyledTextarea/index.d.ts +2 -0
  30. package/dist/components/StyledTextarea/index.js +4 -0
  31. package/dist/components/Switch/Switch.js +61 -49
  32. package/dist/components/Tabular/Tabular.d.ts +12 -0
  33. package/dist/components/Tabular/Tabular.js +34 -33
  34. package/dist/components/Tabular/index.d.ts +1 -1
  35. package/dist/components/Textarea/Textarea.d.ts +7 -3
  36. package/dist/components/Textarea/Textarea.js +46 -43
  37. package/dist/components/ToggleGroup/ToggleGroup.d.ts +1 -0
  38. package/dist/components/ToggleGroup/ToggleGroup.js +57 -47
  39. package/dist/main.d.ts +5 -1
  40. package/dist/main.js +126 -122
  41. package/dist/rsc.d.ts +4 -0
  42. package/dist/rsc.js +12 -8
  43. package/dist/styles-scss/global.scss +1 -1
  44. package/dist/styles-scss/tokens.scss +19 -20
  45. package/package.json +1 -1
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ import { InputSize, InputTheme } from '../Input/Input.types';
3
+ import { ResponsiveValueType } from '../../utils/ui';
4
+
5
+ export interface StyledInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
6
+ className?: string;
7
+ size?: ResponsiveValueType<InputSize>;
8
+ theme?: InputTheme;
9
+ ref?: React.Ref<HTMLInputElement>;
10
+ }
11
+ declare function StyledInput(props: StyledInputProps): import("react/jsx-runtime").JSX.Element;
12
+ export default StyledInput;
@@ -0,0 +1,46 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { clsx as m } from "../../utils/clsx.js";
3
+ import { ui as p } from "../../utils/ui/ui.js";
4
+ const s = "cfxui__StyledInput__root__37064", S = "cfxui__StyledInput__small__0f240", r = "cfxui__StyledInput__large__a3ad2", d = "cfxui__StyledInput__onlight__dcd8f", l = {
5
+ root: s,
6
+ small: S,
7
+ large: r,
8
+ onlight: d,
9
+ "inputSizeinitial-large": "cfxui__StyledInput__inputSizeinitial-large__a31e6",
10
+ "inputSizeinitial-small": "cfxui__StyledInput__inputSizeinitial-small__77433",
11
+ "inputSizesmall-large": "cfxui__StyledInput__inputSizesmall-large__eb62a",
12
+ "inputSizesmall-small": "cfxui__StyledInput__inputSizesmall-small__d5e87",
13
+ "inputSizesmall-medium-large": "cfxui__StyledInput__inputSizesmall-medium-large__b13be",
14
+ "inputSizesmall-medium-small": "cfxui__StyledInput__inputSizesmall-medium-small__a9d00",
15
+ "inputSizemedium-large": "cfxui__StyledInput__inputSizemedium-large__75764",
16
+ "inputSizemedium-small": "cfxui__StyledInput__inputSizemedium-small__43151",
17
+ "inputSizemedium-large-large": "cfxui__StyledInput__inputSizemedium-large-large__3f450",
18
+ "inputSizemedium-large-small": "cfxui__StyledInput__inputSizemedium-large-small__eba0f",
19
+ "inputSizelarge-large": "cfxui__StyledInput__inputSizelarge-large__19572",
20
+ "inputSizelarge-small": "cfxui__StyledInput__inputSizelarge-small__3ecc3",
21
+ "inputSizexlarge-large": "cfxui__StyledInput__inputSizexlarge-large__06e9b",
22
+ "inputSizexlarge-small": "cfxui__StyledInput__inputSizexlarge-small__b318f"
23
+ };
24
+ function f(e) {
25
+ const {
26
+ className: i,
27
+ size: _ = "normal",
28
+ theme: t = "default",
29
+ ...u
30
+ } = e;
31
+ return /* @__PURE__ */ n(
32
+ "input",
33
+ {
34
+ className: m(
35
+ i,
36
+ l.root,
37
+ l[t],
38
+ p.getResponsiveFlatClassnames("input-size", _).map((a) => l[a])
39
+ ),
40
+ ...u
41
+ }
42
+ );
43
+ }
44
+ export {
45
+ f as default
46
+ };
@@ -0,0 +1,2 @@
1
+ export { default as StyledInput } from './StyledInput';
2
+ export type { StyledInputProps } from './StyledInput';
@@ -0,0 +1,4 @@
1
+ import { default as a } from "./StyledInput.js";
2
+ export {
3
+ a as StyledInput
4
+ };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+
3
+ export type TextareaResizeType = 'none' | 'vertical' | 'horizontal' | 'both';
4
+ export interface StyledTextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
5
+ className?: string;
6
+ resize?: TextareaResizeType;
7
+ ref?: React.Ref<HTMLTextAreaElement>;
8
+ }
9
+ declare function StyledTextarea(props: StyledTextareaProps): import("react/jsx-runtime").JSX.Element;
10
+ export default StyledTextarea;
@@ -0,0 +1,32 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { clsx as i } from "../../utils/clsx.js";
3
+ const c = "cfxui__StyledTextarea__root__8c3b9", e = {
4
+ root: c,
5
+ "resize-none": "cfxui__StyledTextarea__resize-none__e5b55",
6
+ "resize-vertical": "cfxui__StyledTextarea__resize-vertical__717ec",
7
+ "resize-horizontal": "cfxui__StyledTextarea__resize-horizontal__4f44b",
8
+ "resize-both": "cfxui__StyledTextarea__resize-both__c451f"
9
+ };
10
+ function n(r) {
11
+ const {
12
+ className: t,
13
+ resize: _ = "none",
14
+ ref: o,
15
+ ...a
16
+ } = r;
17
+ return /* @__PURE__ */ s(
18
+ "textarea",
19
+ {
20
+ className: i(
21
+ e.root,
22
+ t,
23
+ e[`resize-${_}`]
24
+ ),
25
+ ref: o,
26
+ ...a
27
+ }
28
+ );
29
+ }
30
+ export {
31
+ n as default
32
+ };
@@ -0,0 +1,2 @@
1
+ export { default as StyledTextarea } from './StyledTextarea';
2
+ export type { StyledTextareaProps, TextareaResizeType } from './StyledTextarea';
@@ -0,0 +1,4 @@
1
+ import { default as t } from "./StyledTextarea.js";
2
+ export {
3
+ t as StyledTextarea
4
+ };
@@ -1,72 +1,72 @@
1
- import { jsxs as I, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as P, jsx as i } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import M from "react";
4
- import { u as k, d as H, c as j, P as x, e as A, f as q } from "../../index-DCuJlMqr.js";
4
+ import { u as x, d as H, c as j, P as y, e as A, f as q } from "../../index-DCuJlMqr.js";
5
5
  import { u as z } from "../../index-BZPx6jYI.js";
6
- import { clsx as P } from "../../utils/clsx.js";
7
- var m = "Switch", [L, et] = j(m), [O, $] = L(m), y = r.forwardRef(
6
+ import { clsx as k } from "../../utils/clsx.js";
7
+ var w = "Switch", [L, et] = j(w), [O, $] = L(w), T = r.forwardRef(
8
8
  (e, s) => {
9
9
  const {
10
10
  __scopeSwitch: t,
11
11
  name: o,
12
12
  checked: c,
13
- defaultChecked: w,
14
- required: u,
15
- disabled: a,
16
- value: h = "on",
13
+ defaultChecked: u,
14
+ required: h,
15
+ disabled: n,
16
+ value: d = "on",
17
17
  onCheckedChange: _,
18
- form: n,
18
+ form: a,
19
19
  ...S
20
- } = e, [d, l] = r.useState(null), b = k(s, (f) => l(f)), v = r.useRef(!1), R = d ? n || !!d.closest("form") : !0, [p, B] = H({
20
+ } = e, [p, l] = r.useState(null), b = x(s, (m) => l(m)), v = r.useRef(!1), R = p ? a || !!p.closest("form") : !0, [f, U] = H({
21
21
  prop: c,
22
- defaultProp: w ?? !1,
22
+ defaultProp: u ?? !1,
23
23
  onChange: _,
24
- caller: m
24
+ caller: w
25
25
  });
26
- return /* @__PURE__ */ I(O, { scope: t, checked: p, disabled: a, children: [
26
+ return /* @__PURE__ */ P(O, { scope: t, checked: f, disabled: n, children: [
27
27
  /* @__PURE__ */ i(
28
- x.button,
28
+ y.button,
29
29
  {
30
30
  type: "button",
31
31
  role: "switch",
32
- "aria-checked": p,
33
- "aria-required": u,
34
- "data-state": g(p),
35
- "data-disabled": a ? "" : void 0,
36
- disabled: a,
37
- value: h,
32
+ "aria-checked": f,
33
+ "aria-required": h,
34
+ "data-state": B(f),
35
+ "data-disabled": n ? "" : void 0,
36
+ disabled: n,
37
+ value: d,
38
38
  ...S,
39
39
  ref: b,
40
- onClick: A(e.onClick, (f) => {
41
- B((U) => !U), R && (v.current = f.isPropagationStopped(), v.current || f.stopPropagation());
40
+ onClick: A(e.onClick, (m) => {
41
+ U((I) => !I), R && (v.current = m.isPropagationStopped(), v.current || m.stopPropagation());
42
42
  })
43
43
  }
44
44
  ),
45
45
  R && /* @__PURE__ */ i(
46
- E,
46
+ g,
47
47
  {
48
- control: d,
48
+ control: p,
49
49
  bubbles: !v.current,
50
50
  name: o,
51
- value: h,
52
- checked: p,
53
- required: u,
54
- disabled: a,
55
- form: n,
51
+ value: d,
52
+ checked: f,
53
+ required: h,
54
+ disabled: n,
55
+ form: a,
56
56
  style: { transform: "translateX(-100%)" }
57
57
  }
58
58
  )
59
59
  ] });
60
60
  }
61
61
  );
62
- y.displayName = m;
63
- var T = "SwitchThumb", N = r.forwardRef(
62
+ T.displayName = w;
63
+ var N = "SwitchThumb", E = r.forwardRef(
64
64
  (e, s) => {
65
- const { __scopeSwitch: t, ...o } = e, c = $(T, t);
65
+ const { __scopeSwitch: t, ...o } = e, c = $(N, t);
66
66
  return /* @__PURE__ */ i(
67
- x.span,
67
+ y.span,
68
68
  {
69
- "data-state": g(c.checked),
69
+ "data-state": B(c.checked),
70
70
  "data-disabled": c.disabled ? "" : void 0,
71
71
  ...o,
72
72
  ref: s
@@ -74,28 +74,28 @@ var T = "SwitchThumb", N = r.forwardRef(
74
74
  );
75
75
  }
76
76
  );
77
- N.displayName = T;
78
- var D = "SwitchBubbleInput", E = r.forwardRef(
77
+ E.displayName = N;
78
+ var D = "SwitchBubbleInput", g = r.forwardRef(
79
79
  ({
80
80
  __scopeSwitch: e,
81
81
  control: s,
82
82
  checked: t,
83
83
  bubbles: o = !0,
84
84
  ...c
85
- }, w) => {
86
- const u = r.useRef(null), a = k(u, w), h = z(t), _ = q(s);
85
+ }, u) => {
86
+ const h = r.useRef(null), n = x(h, u), d = z(t), _ = q(s);
87
87
  return r.useEffect(() => {
88
- const n = u.current;
89
- if (!n) return;
88
+ const a = h.current;
89
+ if (!a) return;
90
90
  const S = window.HTMLInputElement.prototype, l = Object.getOwnPropertyDescriptor(
91
91
  S,
92
92
  "checked"
93
93
  ).set;
94
- if (h !== t && l) {
94
+ if (d !== t && l) {
95
95
  const b = new Event("click", { bubbles: o });
96
- l.call(n, t), n.dispatchEvent(b);
96
+ l.call(a, t), a.dispatchEvent(b);
97
97
  }
98
- }, [h, t, o]), /* @__PURE__ */ i(
98
+ }, [d, t, o]), /* @__PURE__ */ i(
99
99
  "input",
100
100
  {
101
101
  type: "checkbox",
@@ -103,7 +103,7 @@ var D = "SwitchBubbleInput", E = r.forwardRef(
103
103
  defaultChecked: t,
104
104
  ...c,
105
105
  tabIndex: -1,
106
- ref: a,
106
+ ref: n,
107
107
  style: {
108
108
  ...c.style,
109
109
  ..._,
@@ -116,11 +116,11 @@ var D = "SwitchBubbleInput", E = r.forwardRef(
116
116
  );
117
117
  }
118
118
  );
119
- E.displayName = D;
120
- function g(e) {
119
+ g.displayName = D;
120
+ function B(e) {
121
121
  return e ? "checked" : "unchecked";
122
122
  }
123
- var F = y, W = N;
123
+ var F = T, W = E;
124
124
  const X = "cfxui__Switch__switchUnset__c8b03", G = "cfxui__Switch__switchRoot__f2911", J = "cfxui__Switch__switchThumb__9cbf5", C = {
125
125
  switchUnset: X,
126
126
  switchRoot: G,
@@ -130,9 +130,21 @@ function K(e) {
130
130
  const {
131
131
  classNameRoot: s,
132
132
  classNameThumb: t,
133
- ...o
133
+ name: o,
134
+ checked: c,
135
+ ...u
134
136
  } = e;
135
- return /* @__PURE__ */ i(F, { ...o, className: P(C.switchRoot, C.switchUnset, s), children: /* @__PURE__ */ i(W, { className: P(C.switchThumb, t) }) });
137
+ return /* @__PURE__ */ P(F, { ...u, className: k(C.switchRoot, C.switchUnset, s), children: [
138
+ o && /* @__PURE__ */ i(
139
+ "input",
140
+ {
141
+ type: "hidden",
142
+ name: o,
143
+ value: c ? "on" : ""
144
+ }
145
+ ),
146
+ /* @__PURE__ */ i(W, { className: k(C.switchThumb, t) })
147
+ ] });
136
148
  }
137
149
  const ot = M.memo(K);
138
150
  export {
@@ -32,9 +32,21 @@ export declare namespace Tabular {
32
32
  export interface TabularRootProps extends React.PropsWithChildren, Pick<TabularProps, 'className' | 'ariaLabel' | 'tabIndex' | 'theme' | 'role' | 'size'> {
33
33
  style?: React.CSSProperties;
34
34
  }
35
+ export interface TabularItemComponentProps {
36
+ disabled?: boolean;
37
+ type: HTMLButtonElement['type'];
38
+ role: HTMLButtonElement['role'];
39
+ className?: string;
40
+ onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
41
+ 'aria-label'?: string;
42
+ 'aria-controls'?: string;
43
+ 'data-text'?: React.ReactNode;
44
+ 'aria-selected'?: boolean;
45
+ }
35
46
  export interface TabularItemProps extends TabularItem {
36
47
  active: boolean;
37
48
  onClick: (id: string) => void;
38
49
  className?: string;
39
50
  size?: ResponsiveValueType<TabularSize>;
51
+ Component?: React.ElementType<TabularItemComponentProps>;
40
52
  }
@@ -1,12 +1,12 @@
1
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
2
- import d, { createElement as N } from "react";
3
- import { Dot as p } from "../Dot/Dot.js";
1
+ import { jsx as m, jsxs as N } from "react/jsx-runtime";
2
+ import d, { createElement as p } from "react";
3
+ import { Dot as C } from "../Dot/Dot.js";
4
4
  import { clsx as n } from "../../utils/clsx.js";
5
- import { ui as C } from "../../utils/ui/ui.js";
6
- const v = "cfxui__Tabular__reset__b1dbc", k = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", R = "cfxui__Tabular__active__1ae95", y = "cfxui__Tabular__hasNotification__c372f", j = "cfxui__Tabular__content__3a95a", l = {
7
- reset: v,
5
+ import { ui as v } from "../../utils/ui/ui.js";
6
+ const k = "cfxui__Tabular__reset__b1dbc", R = "cfxui__Tabular__item__98cc3", I = "cfxui__Tabular__root__0ff05", y = "cfxui__Tabular__active__1ae95", j = "cfxui__Tabular__hasNotification__c372f", A = "cfxui__Tabular__content__3a95a", e = {
7
+ reset: k,
8
8
  "tabular-size-initial-large": "cfxui__Tabular__tabular-size-initial-large__9451f",
9
- item: k,
9
+ item: R,
10
10
  "tabular-size-initial-small": "cfxui__Tabular__tabular-size-initial-small__4dad8",
11
11
  "tabular-size-small-large": "cfxui__Tabular__tabular-size-small-large__1390c",
12
12
  "tabular-size-small-small": "cfxui__Tabular__tabular-size-small-small__cc6e3",
@@ -23,25 +23,25 @@ const v = "cfxui__Tabular__reset__b1dbc", k = "cfxui__Tabular__item__98cc3", I =
23
23
  root: I,
24
24
  "theme-dark": "cfxui__Tabular__theme-dark__80b8c",
25
25
  "theme-light": "cfxui__Tabular__theme-light__c05b9",
26
- active: R,
27
- hasNotification: y,
28
- content: j
26
+ active: y,
27
+ hasNotification: j,
28
+ content: A
29
29
  };
30
30
  function o(b) {
31
31
  const {
32
32
  items: s,
33
33
  activeItem: t,
34
- onActivate: e,
34
+ onActivate: l,
35
35
  itemClassName: i,
36
36
  size: u = "medium",
37
37
  ..._
38
38
  } = b, c = d.useCallback((a) => {
39
- e && e(a);
40
- }, [e]), r = n(
41
- l.root,
39
+ l && l(a);
40
+ }, [l]), r = n(
41
+ e.root,
42
42
  _.className
43
43
  );
44
- return /* @__PURE__ */ m(o.Root, { ..._, className: r, children: s.map((a) => /* @__PURE__ */ N(
44
+ return /* @__PURE__ */ m(o.Root, { ..._, className: r, children: s.map((a) => /* @__PURE__ */ p(
45
45
  o.Item,
46
46
  {
47
47
  ...a,
@@ -56,13 +56,13 @@ function o(b) {
56
56
  o.Root = function(s) {
57
57
  const {
58
58
  children: t,
59
- className: e,
59
+ className: l,
60
60
  ariaLabel: i,
61
61
  tabIndex: u,
62
62
  theme: _ = "dark",
63
63
  role: c = "tablist",
64
64
  style: r
65
- } = s, a = n(l.root, l[`theme-${_}`], e);
65
+ } = s, a = n(e.root, e[`theme-${_}`], l);
66
66
  return /* @__PURE__ */ m(
67
67
  "div",
68
68
  {
@@ -78,7 +78,7 @@ o.Root = function(s) {
78
78
  o.Item = function(s) {
79
79
  const {
80
80
  id: t,
81
- label: e,
81
+ label: l,
82
82
  onClick: i,
83
83
  ariaLabel: u,
84
84
  ariaControls: _,
@@ -86,34 +86,35 @@ o.Item = function(s) {
86
86
  active: r = !1,
87
87
  disabled: a = !1,
88
88
  hasNotification: f = !1,
89
- size: x
90
- } = s, z = d.useCallback(() => {
89
+ size: x,
90
+ Component: z
91
+ } = s, g = d.useCallback(() => {
91
92
  a || i(t);
92
- }, [a, i, t]), g = n(
93
- l.reset,
94
- l.item,
93
+ }, [a, i, t]), T = n(
94
+ e.reset,
95
+ e.item,
95
96
  c,
96
- C.getResponsiveFlatClassnames("tabular-size", x).map((T) => l[T]),
97
+ v.getResponsiveFlatClassnames("tabular-size", x).map((h) => e[h]),
97
98
  {
98
- [l.active]: r,
99
- [l.hasNotification]: f
99
+ [e.active]: r,
100
+ [e.hasNotification]: f
100
101
  }
101
102
  );
102
103
  return /* @__PURE__ */ m(
103
- "button",
104
+ z || "button",
104
105
  {
105
106
  disabled: a,
106
107
  type: "button",
107
108
  role: "tab",
108
- className: g,
109
- onClick: z,
109
+ className: T,
110
+ onClick: g,
110
111
  "aria-label": u,
111
112
  "aria-controls": _,
112
- "data-text": e,
113
+ "data-text": l,
113
114
  "aria-selected": r,
114
- children: /* @__PURE__ */ h("span", { className: l.content, children: [
115
- e,
116
- f && /* @__PURE__ */ m(p, { color: "green", className: l.notification })
115
+ children: /* @__PURE__ */ N("span", { className: e.content, children: [
116
+ l,
117
+ f && /* @__PURE__ */ m(C, { color: "green", className: e.notification })
117
118
  ] })
118
119
  }
119
120
  );
@@ -1,2 +1,2 @@
1
1
  export { Tabular } from './Tabular';
2
- export type { TabularProps, TabularItem, TabularRootProps, } from './Tabular';
2
+ export type { TabularProps, TabularItem, TabularRootProps, TabularItemComponentProps, } from './Tabular';
@@ -1,15 +1,19 @@
1
1
  import { default as React } from 'react';
2
+ import { TextareaResizeType } from '../StyledTextarea';
2
3
 
3
4
  export interface TextareaProps {
4
- value: string;
5
- onChange: (value: string) => void;
5
+ value?: string;
6
+ defaultValue?: string;
7
+ onChange?: (value: string) => void;
6
8
  label?: React.ReactNode;
7
9
  placeholder?: string;
8
10
  rows?: number;
9
11
  disabled?: boolean;
10
- resize?: 'none' | 'vertical' | 'horizontal' | 'both';
12
+ resize?: TextareaResizeType;
11
13
  autofocus?: boolean;
12
14
  className?: string;
13
15
  backdropBlur?: boolean;
16
+ name?: string;
17
+ ref?: React.Ref<HTMLTextAreaElement>;
14
18
  }
15
19
  export declare function Textarea(props: TextareaProps): import("react/jsx-runtime").JSX.Element;
@@ -1,55 +1,58 @@
1
- import { jsx as s, jsxs as p } from "react/jsx-runtime";
2
- import l from "react";
3
- import { clsx as T } from "../../utils/clsx.js";
4
- const k = "cfxui__Textarea__root__688b1", v = "cfxui__Textarea__fullWidth__2e853", B = "cfxui__Textarea__disabled__5d783", C = "cfxui__Textarea__error__932cb", N = "cfxui__Textarea__backdropBlur__15cb2", e = {
5
- root: k,
6
- fullWidth: v,
7
- "resize-none": "cfxui__Textarea__resize-none__1130d",
8
- "resize-vertical": "cfxui__Textarea__resize-vertical__f856e",
9
- "resize-horizontal": "cfxui__Textarea__resize-horizontal__b4b8f",
10
- "resize-both": "cfxui__Textarea__resize-both__004b8",
11
- disabled: B,
12
- error: C,
13
- backdropBlur: N
1
+ import { jsx as s, jsxs as C } from "react/jsx-runtime";
2
+ import c from "react";
3
+ import N from "../StyledTextarea/StyledTextarea.js";
4
+ import { clsx as g } from "../../utils/clsx.js";
5
+ const v = "cfxui__Textarea__root__688b1", j = "cfxui__Textarea__textarea__8ab29", F = "cfxui__Textarea__disabled__5d783", I = "cfxui__Textarea__backdropBlur__15cb2", a = {
6
+ root: v,
7
+ textarea: j,
8
+ disabled: F,
9
+ backdropBlur: I
14
10
  };
15
- function F(c) {
11
+ function S(d) {
16
12
  const {
17
- value: i,
18
- onChange: r,
19
- label: a,
20
- placeholder: n,
21
- rows: d,
22
- resize: u = "none",
13
+ value: n,
14
+ defaultValue: _,
15
+ onChange: e,
16
+ label: t,
17
+ placeholder: u,
18
+ rows: i,
19
+ resize: x = "none",
23
20
  disabled: o = !1,
24
- autofocus: x,
21
+ autofocus: b,
25
22
  className: f,
26
- backdropBlur: b = !1
27
- } = c, h = l.useCallback(
28
- (m) => {
29
- r(m.target.value);
23
+ backdropBlur: m = !1,
24
+ name: p,
25
+ ref: h
26
+ } = d, k = c.useCallback(
27
+ (B) => {
28
+ e && e(B.target.value);
30
29
  },
31
- [r]
32
- ), _ = l.useId(), t = /* @__PURE__ */ s(
33
- "textarea",
30
+ [e]
31
+ ), r = c.useId(), l = /* @__PURE__ */ s(
32
+ N,
34
33
  {
35
- autoFocus: x,
36
- id: _,
37
- className: e[`resize-${u}`],
38
- rows: d,
39
- value: i,
34
+ id: r,
35
+ className: a.textarea,
36
+ rows: i,
37
+ value: n,
38
+ defaultValue: _,
40
39
  disabled: o,
41
- onChange: h,
42
- placeholder: n
40
+ onChange: k,
41
+ placeholder: u,
42
+ name: p,
43
+ ref: h,
44
+ resize: x,
45
+ autoFocus: b
43
46
  }
44
- ), z = T(e.root, f, {
45
- [e.disabled]: o,
46
- [e.backdropBlur]: b
47
+ ), T = g(a.root, f, {
48
+ [a.disabled]: o,
49
+ [a.backdropBlur]: m
47
50
  });
48
- return /* @__PURE__ */ s("div", { className: z, children: a ? /* @__PURE__ */ p("label", { htmlFor: _, children: [
49
- a,
50
- t
51
- ] }) : t });
51
+ return /* @__PURE__ */ s("div", { className: T, children: t ? /* @__PURE__ */ C("label", { htmlFor: r, children: [
52
+ t,
53
+ l
54
+ ] }) : l });
52
55
  }
53
56
  export {
54
- F as Textarea
57
+ S as Textarea
55
58
  };
@@ -26,5 +26,6 @@ export interface ToggleGroupProps {
26
26
  multiline?: boolean;
27
27
  fullWidth?: boolean;
28
28
  size?: ToggleGroupSizeType;
29
+ name?: string;
29
30
  }
30
31
  export declare const ToggleGroup: React.NamedExoticComponent<ToggleGroupProps>;