@cfx-dev/ui-components 4.5.16 → 4.5.17

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 (38) hide show
  1. package/dist/{Combination-2dfXEDc9.js → Combination-CcTTSYNP.js} +1 -1
  2. package/dist/{DropdownContent-CLtPVRZg.js → DropdownContent-MvHlrWi6.js} +4 -4
  3. package/dist/assets/all_css.css +2 -0
  4. package/dist/assets/css/DropdownSelect.css +1 -1
  5. package/dist/assets/css/Range.css +1 -0
  6. package/dist/assets/css/RangeInput.css +1 -0
  7. package/dist/assets/css/RichInput.css +1 -1
  8. package/dist/assets/css/Select.css +1 -1
  9. package/dist/assets/css/StyledInput.css +1 -1
  10. package/dist/components/Checkbox/Checkbox.js +23 -23
  11. package/dist/components/DropdownContent/DropdownContent.js +1 -1
  12. package/dist/components/DropdownContent/index.js +1 -1
  13. package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
  14. package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
  15. package/dist/components/Range/Range.d.ts +4 -0
  16. package/dist/components/Range/Range.js +90 -0
  17. package/dist/components/Range/Range.types.d.ts +9 -0
  18. package/dist/components/Range/Range.types.js +1 -0
  19. package/dist/components/Range/RangeInput.d.ts +13 -0
  20. package/dist/components/Range/RangeInput.js +78 -0
  21. package/dist/components/Range/RangeShowcase.d.ts +2 -0
  22. package/dist/components/Range/RangeShowcase.js +41 -0
  23. package/dist/components/Range/RangeWithInputs.d.ts +8 -0
  24. package/dist/components/Range/RangeWithInputs.js +81 -0
  25. package/dist/components/Range/index.d.ts +6 -0
  26. package/dist/components/Range/index.js +8 -0
  27. package/dist/components/Select/Select.js +3 -3
  28. package/dist/components/Slider/Slider.js +64 -472
  29. package/dist/components/Slider/SliderShowcase.js +6 -4
  30. package/dist/components/Switch/Switch.js +1 -1
  31. package/dist/{index-DWzyrn_L.js → index-3ctv5u9o.js} +1 -1
  32. package/dist/{index-BMU9X4M-.js → index-9LBuZ7x4.js} +7 -7
  33. package/dist/{index-DCuJlMqr.js → index-CfQtbUfi.js} +6 -6
  34. package/dist/index-D5SMGei3.js +427 -0
  35. package/dist/main.d.ts +2 -0
  36. package/dist/main.js +105 -99
  37. package/dist/styles-scss/_ui.scss +19 -17
  38. package/package.json +1 -1
@@ -0,0 +1,78 @@
1
+ import { jsxs as k, jsx as g } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import v from "../StyledInput/StyledInput.js";
4
+ import { clsx as h } from "../../utils/clsx.js";
5
+ const A = "cfxui__RangeInput__root__d7257", D = "cfxui__RangeInput__fullWidth__4ffc7", K = "cfxui__RangeInput__input__3bdcc", j = "cfxui__RangeInput__sign__c4033", n = {
6
+ root: A,
7
+ fullWidth: D,
8
+ input: K,
9
+ sign: j
10
+ };
11
+ function X(o) {
12
+ const {
13
+ fullWidth: R = !1,
14
+ value: e,
15
+ defaultValue: _,
16
+ onChange: s,
17
+ onSubmit: l,
18
+ onKeyDown: u,
19
+ pattern: F,
20
+ className: x,
21
+ containerClassName: y,
22
+ type: N = "number",
23
+ ref: b,
24
+ sign: f,
25
+ ...I
26
+ } = o, [i, C] = a.useState(e || _), w = typeof i < "u" && i !== "" && i !== null || typeof e < "u" && e !== "" && e !== null;
27
+ let r, m, d;
28
+ if (o.type === "number") {
29
+ const {
30
+ min: t,
31
+ max: c,
32
+ step: W
33
+ } = o;
34
+ d = W ?? 1, r = t ?? Number.MIN_SAFE_INTEGER, m = c ?? Number.MAX_SAFE_INTEGER;
35
+ }
36
+ const p = a.useCallback((t) => {
37
+ C(t), s && s(t);
38
+ }, [s]), E = a.useCallback(
39
+ (t) => {
40
+ const {
41
+ value: c
42
+ } = t.target;
43
+ p(c);
44
+ },
45
+ [p]
46
+ ), S = a.useCallback((t) => {
47
+ u && u(t), l && t.key === "Enter" && l();
48
+ }, [u, l]), V = h(
49
+ n.root,
50
+ y,
51
+ {
52
+ [n.fullWidth]: R,
53
+ [n.empty]: !w
54
+ }
55
+ );
56
+ return /* @__PURE__ */ k("div", { className: V, children: [
57
+ f && /* @__PURE__ */ g("div", { className: n.sign, children: f }),
58
+ /* @__PURE__ */ g(
59
+ v,
60
+ {
61
+ ref: b,
62
+ type: N,
63
+ className: h(n.input, x),
64
+ value: e,
65
+ onChange: E,
66
+ onKeyDown: S,
67
+ min: r,
68
+ max: m,
69
+ step: d,
70
+ defaultValue: _,
71
+ ...I
72
+ }
73
+ )
74
+ ] });
75
+ }
76
+ export {
77
+ X as default
78
+ };
@@ -0,0 +1,2 @@
1
+ declare function RangeShowcase(): import("react/jsx-runtime").JSX.Element;
2
+ export default RangeShowcase;
@@ -0,0 +1,41 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import r from "../Flex/Flex.js";
3
+ import { Text as t } from "../Text/Text.js";
4
+ import "../../utils/ui/ui.js";
5
+ import i from "./RangeWithInputs.js";
6
+ function g() {
7
+ return /* @__PURE__ */ a(r, { gap: "large", vertical: !0, pb: 20, children: [
8
+ /* @__PURE__ */ a(r, { gap: "normal", vertical: !0, children: [
9
+ /* @__PURE__ */ e(t, { children: "Range With Inputs" }),
10
+ /* @__PURE__ */ e(
11
+ i,
12
+ {
13
+ defaultValue: [55, 100],
14
+ max: 200,
15
+ step: 5,
16
+ maxSign: "$",
17
+ minSign: "$",
18
+ name: "range-with-inputs"
19
+ }
20
+ )
21
+ ] }),
22
+ /* @__PURE__ */ a(r, { gap: "normal", vertical: !0, children: [
23
+ /* @__PURE__ */ e(t, { children: "Disabled: Range With Inputs" }),
24
+ /* @__PURE__ */ e(
25
+ i,
26
+ {
27
+ defaultValue: [55, 100],
28
+ max: 200,
29
+ step: 5,
30
+ maxSign: "$",
31
+ minSign: "$",
32
+ disabled: !0,
33
+ name: "disabled-range"
34
+ }
35
+ )
36
+ ] })
37
+ ] });
38
+ }
39
+ export {
40
+ g as default
41
+ };
@@ -0,0 +1,8 @@
1
+ import { RangeProps } from './Range.types';
2
+
3
+ export type RangeWithInputsProps = RangeProps & {
4
+ minSign?: string;
5
+ maxSign?: string;
6
+ };
7
+ declare function RangeWithInputs(props: RangeWithInputsProps): import("react/jsx-runtime").JSX.Element;
8
+ export default RangeWithInputs;
@@ -0,0 +1,81 @@
1
+ import { jsxs as x, jsx as s } from "react/jsx-runtime";
2
+ import i from "react";
3
+ import C from "../Flex/Flex.js";
4
+ import R from "./Range.js";
5
+ import M from "./RangeInput.js";
6
+ function _(V) {
7
+ const {
8
+ value: e,
9
+ defaultValue: l,
10
+ onValueChange: m,
11
+ min: c = 0,
12
+ max: o = 100,
13
+ minSign: h,
14
+ maxSign: S,
15
+ disabled: f = !1,
16
+ name: u,
17
+ ...b
18
+ } = V, [t, d] = i.useState(() => e ? e[0] : l ? l[0] : c), [n, p] = i.useState(() => e ? e[1] : l ? l[1] : o), r = i.useCallback((a) => {
19
+ d(a[0]), p(a[1]), m && m(a);
20
+ }, [m]), j = i.useCallback((a) => {
21
+ const g = Math.min(Number(a), n);
22
+ r([g, n]);
23
+ }, [r, n]), v = i.useCallback((a) => {
24
+ const g = Math.min(Number(a), o);
25
+ r([t, g]);
26
+ }, [r, t, o]);
27
+ return i.useEffect(() => {
28
+ e && (d(e[0]), p(e[1]));
29
+ }, [e]), /* @__PURE__ */ x(C, { gap: 2.5, direction: "column", children: [
30
+ u && /* @__PURE__ */ s(
31
+ "input",
32
+ {
33
+ type: "hidden",
34
+ name: u,
35
+ value: [t, n].join(",")
36
+ }
37
+ ),
38
+ /* @__PURE__ */ s(
39
+ R,
40
+ {
41
+ min: c,
42
+ max: o,
43
+ value: [t, n],
44
+ defaultValue: l,
45
+ onValueChange: r,
46
+ disabled: f,
47
+ name: u,
48
+ ...b
49
+ }
50
+ ),
51
+ /* @__PURE__ */ x(C, { gap: 2.5, justifyContent: "space-between", children: [
52
+ /* @__PURE__ */ s(
53
+ M,
54
+ {
55
+ sign: h,
56
+ value: t,
57
+ onChange: j,
58
+ min: c,
59
+ max: n,
60
+ disabled: f,
61
+ id: [u, "min"].filter(Boolean).join("-")
62
+ }
63
+ ),
64
+ /* @__PURE__ */ s(
65
+ M,
66
+ {
67
+ sign: h,
68
+ value: n,
69
+ onChange: v,
70
+ min: t,
71
+ max: o,
72
+ disabled: f,
73
+ id: [u, "max"].filter(Boolean).join("-")
74
+ }
75
+ )
76
+ ] })
77
+ ] });
78
+ }
79
+ export {
80
+ _ as default
81
+ };
@@ -0,0 +1,6 @@
1
+ export { default as Range } from './Range';
2
+ export { default as RangeInput } from './RangeInput';
3
+ export { default as RangeWithInputs } from './RangeWithInputs';
4
+ export type { RangeProps } from './Range.types';
5
+ export type { RangeInputProps } from './RangeInput';
6
+ export type { RangeWithInputsProps } from './RangeWithInputs';
@@ -0,0 +1,8 @@
1
+ import { default as t } from "./Range.js";
2
+ import { default as o } from "./RangeInput.js";
3
+ import { default as n } from "./RangeWithInputs.js";
4
+ export {
5
+ t as Range,
6
+ o as RangeInput,
7
+ n as RangeWithInputs
8
+ };
@@ -3,9 +3,9 @@ import * as l from "react";
3
3
  import q from "react";
4
4
  import { R as ft, r as De } from "../../index-Cl_RnsqN.js";
5
5
  import { c as Ee } from "../../index-rKs9bXHr.js";
6
- import { a as K, P as N, d as Oe, c as mt, u as B, e as P, b as ht } from "../../index-DCuJlMqr.js";
7
- import { u as gt, c as vt } from "../../index-BMU9X4M-.js";
8
- import { c as Le, d as _t, u as Ne, A as St, a as wt, h as xt, b as yt, R as Ct, F as It, D as Tt, C as bt, e as Pt } from "../../Combination-2dfXEDc9.js";
6
+ import { e as K, P as N, u as Oe, c as mt, b as B, a as P, f as ht } from "../../index-CfQtbUfi.js";
7
+ import { u as gt, c as vt } from "../../index-9LBuZ7x4.js";
8
+ import { c as Le, d as _t, u as Ne, A as St, a as wt, h as xt, b as yt, R as Ct, F as It, D as Tt, C as bt, e as Pt } from "../../Combination-CcTTSYNP.js";
9
9
  import { u as Nt } from "../../index-BZPx6jYI.js";
10
10
  import { Icon as Rt } from "../Icon/Icon.js";
11
11
  import { clsx as xe } from "../../utils/clsx.js";