@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
@@ -1,22 +1,23 @@
1
- import { jsxs as $, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as q, jsx as t } from "react/jsx-runtime";
2
2
  import i from "react";
3
- import { Icon as q } from "../Icon/Icon.js";
4
- import H from "../IconButton/IconButton.js";
5
- import { Indicator as J } from "../Indicator/Indicator.js";
6
- import { clsx as C } from "../../utils/clsx.js";
7
- import { getValue as L } from "../../utils/getValue.js";
8
- import { ui as O } from "../../utils/ui/ui.js";
9
- const P = "cfxui__Input__root__6392b", Q = "cfxui__Input__fullWidth__5a033", U = "cfxui__Input__input__07830", Y = "cfxui__Input__empty__3b36a", Z = "cfxui__Input__placeholderIcon__4d079", ee = "cfxui__Input__decorator__3b81f", le = "cfxui__Input__small__c1513", te = "cfxui__Input__large__92d72", ae = "cfxui__Input__onlight__7d0b7", ie = "cfxui__Input__backdropBlur__fdde1", l = {
10
- root: P,
11
- fullWidth: Q,
12
- input: U,
13
- empty: Y,
14
- placeholderIcon: Z,
15
- decorator: ee,
16
- small: le,
17
- large: te,
18
- onlight: ae,
19
- backdropBlur: ie,
3
+ import { Icon as H } from "../Icon/Icon.js";
4
+ import J from "../IconButton/IconButton.js";
5
+ import { Indicator as L } from "../Indicator/Indicator.js";
6
+ import O from "../StyledInput/StyledInput.js";
7
+ import { clsx as k } from "../../utils/clsx.js";
8
+ import { getValue as P } from "../../utils/getValue.js";
9
+ import { ui as Q } from "../../utils/ui/ui.js";
10
+ const U = "cfxui__Input__root__6392b", Y = "cfxui__Input__fullWidth__5a033", Z = "cfxui__Input__empty__3b36a", ee = "cfxui__Input__placeholderIcon__4d079", le = "cfxui__Input__input__07830", te = "cfxui__Input__decorator__3b81f", ae = "cfxui__Input__small__c1513", ie = "cfxui__Input__large__92d72", ne = "cfxui__Input__onlight__7d0b7", ue = "cfxui__Input__backdropBlur__fdde1", l = {
11
+ root: U,
12
+ fullWidth: Y,
13
+ empty: Z,
14
+ placeholderIcon: ee,
15
+ input: le,
16
+ decorator: te,
17
+ small: ae,
18
+ large: ie,
19
+ onlight: ne,
20
+ backdropBlur: ue,
20
21
  "inputSizeinitial-large": "cfxui__Input__inputSizeinitial-large__12afb",
21
22
  "inputSizeinitial-small": "cfxui__Input__inputSizeinitial-small__33905",
22
23
  "inputSizesmall-large": "cfxui__Input__inputSizesmall-large__e2689",
@@ -32,115 +33,119 @@ const P = "cfxui__Input__root__6392b", Q = "cfxui__Input__fullWidth__5a033", U =
32
33
  "inputSizexlarge-large": "cfxui__Input__inputSizexlarge-large__1ef2c",
33
34
  "inputSizexlarge-small": "cfxui__Input__inputSizexlarge-small__7f6ab"
34
35
  };
35
- function ne(n) {
36
+ function _e(n) {
36
37
  const {
37
- decorator: o,
38
+ decorator: r,
38
39
  loading: m,
39
40
  type: p,
40
41
  hasValue: a,
41
- onCleare: u
42
+ onCleare: o
42
43
  } = n;
43
- return m ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(J, {}) }) : o ? /* @__PURE__ */ t("div", { className: l.decorator, children: L(o) }) : p === "search" && a ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(H, { size: "xsmall", areaSize: "large", name: "Close", onClick: u }) }) : null;
44
+ return m ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(L, {}) }) : r ? /* @__PURE__ */ t("div", { className: l.decorator, children: P(r) }) : p === "search" && a ? /* @__PURE__ */ t("div", { className: l.decorator, children: /* @__PURE__ */ t(J, { size: "xsmall", areaSize: "large", name: "Close", onClick: o }) }) : null;
44
45
  }
45
- function de(n) {
46
+ function Ie(n) {
46
47
  const {
47
- id: o,
48
+ id: r,
48
49
  name: m,
49
50
  fullWidth: p = !1,
50
51
  value: a,
51
- onChange: u,
52
- onSubmit: d,
53
- onKeyDown: f,
54
- pattern: g,
55
- tabIndex: N,
56
- loading: y = !1,
57
- spellCheck: k = !0,
58
- autofocus: R = !1,
59
- disabled: w = !1,
60
- className: v,
61
- containerClassName: E,
52
+ defaultValue: o,
53
+ onChange: d,
54
+ onSubmit: f,
55
+ onKeyDown: g,
56
+ pattern: I,
57
+ tabIndex: R,
58
+ loading: w = !1,
59
+ spellCheck: v = !0,
60
+ autofocus: E = !1,
61
+ disabled: V = !1,
62
+ className: B,
63
+ containerClassName: W,
62
64
  placeholder: c = "",
63
65
  placeholderIcon: s,
64
- type: I = "text",
65
- size: B = "normal",
66
- theme: V = "default",
67
- decorator: W,
68
- backdropBlur: D = !1,
69
- ref: F
70
- } = n, [x, A] = i.useState(a), S = typeof x < "u" && x !== "" && x !== null || typeof a < "u" && a !== "" && a !== null;
71
- let z, h, b;
66
+ type: S = "text",
67
+ size: z = "normal",
68
+ theme: h = "default",
69
+ decorator: D,
70
+ backdropBlur: F = !1,
71
+ ref: A
72
+ } = n, [x, K] = i.useState(a || o), b = typeof x < "u" && x !== "" && x !== null || typeof a < "u" && a !== "" && a !== null;
73
+ let C, y, N;
72
74
  if (n.type === "number") {
73
75
  const {
74
76
  min: e,
75
- max: r,
76
- step: X
77
+ max: _,
78
+ step: $
77
79
  } = n;
78
- b = X ?? 1, z = e ?? Number.MIN_SAFE_INTEGER, h = r ?? Number.MAX_SAFE_INTEGER;
80
+ N = $ ?? 1, C = e ?? Number.MIN_SAFE_INTEGER, y = _ ?? Number.MAX_SAFE_INTEGER;
79
81
  }
80
- const _ = i.useCallback((e) => {
81
- A(e), u && u(e);
82
- }, [u]), K = i.useCallback(
82
+ const u = i.useCallback((e) => {
83
+ K(e), d && d(e);
84
+ }, [d]), M = i.useCallback(
83
85
  (e) => {
84
86
  const {
85
- value: r
87
+ value: _
86
88
  } = e.target;
87
- if (g) {
88
- g.test(r) && _(r);
89
+ if (I) {
90
+ I.test(_) && u(_);
89
91
  return;
90
92
  }
91
- _(r);
93
+ u(_);
92
94
  },
93
- [_, g]
94
- ), M = i.useCallback((e) => {
95
- f && f(e), d && e.key === "Enter" && d();
96
- }, [f, d]), j = i.useCallback(() => {
97
- _("");
98
- }, [_]), G = C(
95
+ [u, I]
96
+ ), j = i.useCallback((e) => {
97
+ g && g(e), f && e.key === "Enter" && f();
98
+ }, [g, f]), G = i.useCallback(() => {
99
+ u("");
100
+ }, [u]), T = k(
99
101
  l.root,
100
- l[V],
101
- E,
102
- O.getResponsiveFlatClassnames("input-size", B).map((e) => l[e]),
102
+ l[h],
103
+ W,
104
+ Q.getResponsiveFlatClassnames("input-size", z).map((e) => l[e]),
103
105
  {
104
106
  [l.fullWidth]: p,
105
- [l.backdropBlur]: D,
106
- [l.empty]: !S
107
+ [l.backdropBlur]: F,
108
+ [l.empty]: !b
107
109
  }
108
- ), T = i.useMemo(() => c ? s ? ` ${c.trim()}` : c.trim() : "", [c, s]);
109
- return /* @__PURE__ */ $("div", { className: G, children: [
110
+ ), X = i.useMemo(() => c ? s ? ` ${c.trim()}` : c.trim() : "", [c, s]);
111
+ return /* @__PURE__ */ q("div", { className: T, children: [
110
112
  /* @__PURE__ */ t(
111
- "input",
113
+ O,
112
114
  {
113
- id: o,
115
+ size: z,
116
+ theme: h,
117
+ id: r,
114
118
  name: m,
115
- ref: F,
116
- type: I,
117
- tabIndex: N,
118
- autoFocus: R,
119
- className: C(l.input, v),
119
+ ref: A,
120
+ type: S,
121
+ tabIndex: R,
122
+ className: k(l.input, B),
120
123
  value: a,
121
- placeholder: T,
122
- disabled: w,
123
- onChange: K,
124
- onKeyDown: M,
125
- spellCheck: k,
126
- min: z,
127
- max: h,
128
- step: b
124
+ placeholder: X,
125
+ disabled: V,
126
+ onChange: M,
127
+ onKeyDown: j,
128
+ spellCheck: v,
129
+ min: C,
130
+ max: y,
131
+ step: N,
132
+ defaultValue: o,
133
+ autoFocus: E
129
134
  }
130
135
  ),
131
- s && /* @__PURE__ */ t(q, { name: s, className: l.placeholderIcon }),
136
+ s && /* @__PURE__ */ t(H, { name: s, className: l.placeholderIcon }),
132
137
  /* @__PURE__ */ t(
133
- ne,
138
+ _e,
134
139
  {
135
- decorator: W,
136
- loading: y,
137
- type: I,
138
- hasValue: S,
139
- onCleare: j
140
+ decorator: D,
141
+ loading: w,
142
+ type: S,
143
+ hasValue: b,
144
+ onCleare: G
140
145
  }
141
146
  )
142
147
  ] });
143
148
  }
144
149
  export {
145
- de as default
150
+ Ie as default
146
151
  };
@@ -0,0 +1,2 @@
1
+ export type InputSize = 'small' | 'normal' | 'large';
2
+ export type InputTheme = 'default' | 'onlight';
@@ -1,6 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { ResponsiveValueType } from '../../utils/ui';
3
- import { InputSize } from './Input';
3
+ import { InputSize } from './Input.types';
4
4
 
5
5
  export interface RichInputProps {
6
6
  size?: ResponsiveValueType<InputSize>;
@@ -1,4 +1,5 @@
1
1
  export { default as Input } from './Input';
2
2
  export { default as RichInput } from './RichInput';
3
- export type { InputSize, InputProps, InputTheme, } from './Input';
3
+ export type { InputProps } from './Input';
4
+ export type { InputSize, InputTheme } from './Input.types';
4
5
  export type { RichInputProps } from './RichInput';
@@ -19,6 +19,7 @@ export interface InputDropzoneProps extends DropzoneOptions {
19
19
  rootAriaLabel?: string;
20
20
  dropzoneClassName?: string;
21
21
  dropzoneItemClassName?: string;
22
+ name?: string;
22
23
  }
23
24
  declare function InputDropzone(props: InputDropzoneProps): import("react/jsx-runtime").JSX.Element;
24
25
  declare const _default: React.MemoExoticComponent<typeof InputDropzone>;