@cfx-dev/ui-components 4.5.16 → 4.5.18

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 (49) 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/Flyout.css +1 -1
  6. package/dist/assets/css/Popover.css +1 -1
  7. package/dist/assets/css/Range.css +1 -0
  8. package/dist/assets/css/RangeInput.css +1 -0
  9. package/dist/assets/css/RichInput.css +1 -1
  10. package/dist/assets/css/Select.css +1 -1
  11. package/dist/assets/css/StyledInput.css +1 -1
  12. package/dist/assets/general/global.css +1 -1
  13. package/dist/components/Checkbox/Checkbox.js +23 -23
  14. package/dist/components/DropdownContent/DropdownContent.js +1 -1
  15. package/dist/components/DropdownContent/index.js +1 -1
  16. package/dist/components/DropdownMenu/DropdownMenu.js +1 -1
  17. package/dist/components/DropdownSelect/DropdownSelect.js +1 -1
  18. package/dist/components/Flyout/Flyout.d.ts +7 -3
  19. package/dist/components/Flyout/Flyout.js +61 -48
  20. package/dist/components/Flyout/FlyoutShowcase.d.ts +5 -0
  21. package/dist/components/Flyout/FlyoutShowcase.js +28 -0
  22. package/dist/components/Flyout/index.d.ts +1 -1
  23. package/dist/components/Flyout/index.js +5 -3
  24. package/dist/components/Range/Range.d.ts +4 -0
  25. package/dist/components/Range/Range.js +90 -0
  26. package/dist/components/Range/Range.types.d.ts +9 -0
  27. package/dist/components/Range/Range.types.js +1 -0
  28. package/dist/components/Range/RangeInput.d.ts +13 -0
  29. package/dist/components/Range/RangeInput.js +78 -0
  30. package/dist/components/Range/RangeShowcase.d.ts +2 -0
  31. package/dist/components/Range/RangeShowcase.js +41 -0
  32. package/dist/components/Range/RangeWithInputs.d.ts +8 -0
  33. package/dist/components/Range/RangeWithInputs.js +81 -0
  34. package/dist/components/Range/index.d.ts +6 -0
  35. package/dist/components/Range/index.js +8 -0
  36. package/dist/components/Select/Select.js +3 -3
  37. package/dist/components/Slider/Slider.js +64 -472
  38. package/dist/components/Slider/SliderShowcase.js +6 -4
  39. package/dist/components/Switch/Switch.js +1 -1
  40. package/dist/{index-DWzyrn_L.js → index-3ctv5u9o.js} +1 -1
  41. package/dist/{index-BMU9X4M-.js → index-9LBuZ7x4.js} +7 -7
  42. package/dist/{index-DCuJlMqr.js → index-CfQtbUfi.js} +6 -6
  43. package/dist/index-D5SMGei3.js +427 -0
  44. package/dist/main.d.ts +3 -1
  45. package/dist/main.js +186 -178
  46. package/dist/styles-scss/_ui.scss +20 -17
  47. package/dist/styles-scss/global.scss +2 -0
  48. package/dist/styles-scss/tokens.scss +26 -21
  49. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import { jsx as s, jsxs as w, Fragment as $ } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
3
  import G from "react";
4
- import { c as K, P as g, d as X, u as B, e as q, f as J } from "../../index-DCuJlMqr.js";
4
+ import { c as K, P as g, u as X, b as B, a as q, d as J } from "../../index-CfQtbUfi.js";
5
5
  import { u as Q } from "../../index-BZPx6jYI.js";
6
- import { P as V } from "../../index-DWzyrn_L.js";
6
+ import { P as V } from "../../index-3ctv5u9o.js";
7
7
  import "../Icons/cfx-icons/Close.js";
8
8
  import "../Icons/cfx-icons/Controller.js";
9
9
  import "../Icons/cfx-icons/Copy.js";
@@ -58,7 +58,7 @@ import "../Icons/cfx-icons-big/Warning.js";
58
58
  import "../Icons/cfx-icons-big/Confirm.js";
59
59
  import { clsx as N } from "../../utils/clsx.js";
60
60
  import { getColor as Z } from "../../utils/color.js";
61
- var R = "Checkbox", [ee, Co] = K(R), [oe, E] = ee(R);
61
+ var R = "Checkbox", [ee, bo] = K(R), [oe, E] = ee(R);
62
62
  function te(o) {
63
63
  const {
64
64
  __scopeCheckbox: a,
@@ -70,10 +70,10 @@ function te(o) {
70
70
  name: _,
71
71
  onCheckedChange: d,
72
72
  required: h,
73
- value: C = "on",
73
+ value: b = "on",
74
74
  // @ts-expect-error
75
75
  internal_do_not_use_render: p
76
- } = o, [i, b] = X({
76
+ } = o, [i, C] = X({
77
77
  prop: n,
78
78
  defaultProp: r ?? !1,
79
79
  onChange: d,
@@ -84,12 +84,12 @@ function te(o) {
84
84
  ), P = {
85
85
  checked: i,
86
86
  disabled: e,
87
- setChecked: b,
87
+ setChecked: C,
88
88
  control: u,
89
89
  setControl: k,
90
90
  name: _,
91
91
  form: f,
92
- value: C,
92
+ value: b,
93
93
  hasConsumerStoppedPropagationRef: c,
94
94
  required: h,
95
95
  defaultChecked: v(r) ? !1 : r,
@@ -114,12 +114,12 @@ var T = "CheckboxTrigger", M = l.forwardRef(
114
114
  disabled: _,
115
115
  checked: d,
116
116
  required: h,
117
- setControl: C,
117
+ setControl: b,
118
118
  setChecked: p,
119
119
  hasConsumerStoppedPropagationRef: i,
120
- isFormControl: b,
120
+ isFormControl: C,
121
121
  bubbleInput: u
122
- } = E(T, o), k = B(r, C), I = l.useRef(d);
122
+ } = E(T, o), k = B(r, b), I = l.useRef(d);
123
123
  return l.useEffect(() => {
124
124
  const t = e == null ? void 0 : e.form;
125
125
  if (t) {
@@ -143,7 +143,7 @@ var T = "CheckboxTrigger", M = l.forwardRef(
143
143
  t.key === "Enter" && t.preventDefault();
144
144
  }),
145
145
  onClick: q(n, (t) => {
146
- p((c) => v(c) ? !0 : !c), u && b && (i.current = t.isPropagationStopped(), i.current || t.stopPropagation());
146
+ p((c) => v(c) ? !0 : !c), u && C && (i.current = t.isPropagationStopped(), i.current || t.stopPropagation());
147
147
  })
148
148
  }
149
149
  );
@@ -161,7 +161,7 @@ var U = l.forwardRef(
161
161
  disabled: _,
162
162
  value: d,
163
163
  onCheckedChange: h,
164
- form: C,
164
+ form: b,
165
165
  ...p
166
166
  } = o;
167
167
  return /* @__PURE__ */ s(
@@ -174,7 +174,7 @@ var U = l.forwardRef(
174
174
  required: f,
175
175
  onCheckedChange: h,
176
176
  name: m,
177
- form: C,
177
+ form: b,
178
178
  value: d,
179
179
  internal_do_not_use_render: ({ isFormControl: i }) => /* @__PURE__ */ w($, { children: [
180
180
  /* @__PURE__ */ s(
@@ -229,11 +229,11 @@ var F = "CheckboxBubbleInput", L = l.forwardRef(
229
229
  required: _,
230
230
  disabled: d,
231
231
  name: h,
232
- value: C,
232
+ value: b,
233
233
  form: p,
234
234
  bubbleInput: i,
235
- setBubbleInput: b
236
- } = E(F, o), u = B(n, b), k = Q(e), I = J(m);
235
+ setBubbleInput: C
236
+ } = E(F, o), u = B(n, C), k = Q(e), I = J(m);
237
237
  l.useEffect(() => {
238
238
  const c = i;
239
239
  if (!c) return;
@@ -256,7 +256,7 @@ var F = "CheckboxBubbleInput", L = l.forwardRef(
256
256
  required: _,
257
257
  disabled: d,
258
258
  name: h,
259
- value: C,
259
+ value: b,
260
260
  form: p,
261
261
  ...a,
262
262
  tabIndex: -1,
@@ -309,10 +309,10 @@ function de(o) {
309
309
  squareClassName: _,
310
310
  colorToken: d,
311
311
  color: h,
312
- opacity: C,
312
+ opacity: b,
313
313
  luminance: p,
314
314
  checked: i,
315
- name: b,
315
+ name: C,
316
316
  iconIndicator: u = z,
317
317
  iconSquare: k = W,
318
318
  ...I
@@ -341,11 +341,11 @@ function de(o) {
341
341
  style: { color: t },
342
342
  className: c,
343
343
  children: [
344
- b && /* @__PURE__ */ s(
344
+ C && /* @__PURE__ */ s(
345
345
  "input",
346
346
  {
347
347
  type: "hidden",
348
- name: b,
348
+ name: C,
349
349
  value: i ? "on" : ""
350
350
  }
351
351
  ),
@@ -355,7 +355,7 @@ function de(o) {
355
355
  }
356
356
  );
357
357
  }
358
- const bo = G.memo(de);
358
+ const Co = G.memo(de);
359
359
  export {
360
- bo as default
360
+ Co as default
361
361
  };
@@ -1,5 +1,5 @@
1
1
  import "react/jsx-runtime";
2
- import { D as a, g as i } from "../../DropdownContent-CLtPVRZg.js";
2
+ import { D as a, g as i } from "../../DropdownContent-MvHlrWi6.js";
3
3
  import "react";
4
4
  import "../../utils/clsx.js";
5
5
  import "../../utils/ui/ui.js";
@@ -1,4 +1,4 @@
1
- import { D as n, g as t } from "../../DropdownContent-CLtPVRZg.js";
1
+ import { D as n, g as t } from "../../DropdownContent-MvHlrWi6.js";
2
2
  export {
3
3
  n as DropdownContent,
4
4
  t as getDropdownContentSizeClassNames
@@ -1,5 +1,5 @@
1
1
  import { jsxs as d, jsx as o } from "react/jsx-runtime";
2
- import { R as m, T as p, D as f } from "../../DropdownContent-CLtPVRZg.js";
2
+ import { R as m, T as p, D as f } from "../../DropdownContent-MvHlrWi6.js";
3
3
  import u from "react";
4
4
  function h(t) {
5
5
  const {
@@ -1,5 +1,5 @@
1
1
  import { jsxs as f, jsx as l } from "react/jsx-runtime";
2
- import { g as W, R as N, T as R, D as v } from "../../DropdownContent-CLtPVRZg.js";
2
+ import { g as W, R as N, T as R, D as v } from "../../DropdownContent-MvHlrWi6.js";
3
3
  import _, { useRef as b, useState as z, useEffect as I } from "react";
4
4
  import T from "../Flex/Flex.js";
5
5
  import { clsx as j } from "../../utils/clsx.js";
@@ -1,15 +1,18 @@
1
1
  import { default as React } from 'react';
2
2
 
3
3
  export declare const FLYOUT_OUTLET_ID = "flyout-outlet";
4
+ export declare const FLYOUT_ROOT_ID = "cfxui-root";
5
+ export declare const FLYOUT_ROOT_SHRINK_CLASSNAME = "shrink";
4
6
  export type FlyoutSize = 'normal' | 'small' | 'xsmall' | 'xxsmall';
5
- export type FlyoutTheme = 'default' | 'filter';
6
- export interface FlyoutProps {
7
+ export type FlyoutTheme = 'default' | 'legacy';
8
+ export interface FlyoutProps extends React.PropsWithChildren {
7
9
  disabled?: boolean;
8
10
  theme?: FlyoutTheme;
9
11
  size?: FlyoutSize;
10
12
  onClose?(): void;
11
- children?: React.ReactNode;
12
13
  holderClassName?: string;
14
+ rootClassName?: string;
15
+ maskClassName?: string;
13
16
  }
14
17
  export declare function Flyout(props: FlyoutProps): import("react/jsx-runtime").JSX.Element;
15
18
  export declare namespace Flyout {
@@ -19,4 +22,5 @@ export interface FlyoutHeaderProps {
19
22
  onClose?(): void;
20
23
  children: React.ReactNode;
21
24
  ref?: React.Ref<HTMLDivElement>;
25
+ className?: string;
22
26
  }
@@ -1,66 +1,79 @@
1
- import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import f from "react";
3
- import { F as p } from "../../Combination-N-vN9BB-.js";
4
- import h from "../Button/Button.js";
5
- import { clsx as r } from "../../utils/clsx.js";
1
+ import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
+ import y from "react";
3
+ import { F as x } from "../../Combination-N-vN9BB-.js";
4
+ import F from "../Button/Button.js";
5
+ import { clsx as s } from "../../utils/clsx.js";
6
6
  import "../../utils/links.js";
7
- import { Interactive as x } from "../Interactive/Interactive.js";
8
- import { noop as y } from "../../utils/functional.js";
7
+ import { Interactive as k } from "../Interactive/Interactive.js";
8
+ import { noop as b } from "../../utils/functional.js";
9
9
  import "../../utils/hooks/useGlobalKeyboardEvent.js";
10
- import { useKeyboardClose as F } from "../../utils/hooks/useKeyboardClose.js";
11
- import { useOutlet as k } from "../../utils/hooks/useOutlet.js";
12
- const b = "cfxui__Flyout__root__eba04", v = "cfxui__Flyout__backdrop__57f9e", z = "cfxui__Flyout__mask__72713", C = "cfxui__Flyout__holder__d80b5", N = "cfxui__Flyout__content__04e42", L = "cfxui__Flyout__active__14a29", O = "cfxui__Flyout__header__40009", E = "cfxui__Flyout__title__b235a", e = {
13
- root: b,
14
- backdrop: v,
15
- mask: z,
16
- holder: C,
17
- content: N,
10
+ import { useKeyboardClose as N } from "../../utils/hooks/useKeyboardClose.js";
11
+ import { useOutlet as C } from "../../utils/hooks/useOutlet.js";
12
+ const v = "cfxui__Flyout__root__eba04", z = "cfxui__Flyout__backdrop__57f9e", O = "cfxui__Flyout__holder__d80b5", L = "cfxui__Flyout__content__04e42", T = "cfxui__Flyout__header__40009", I = "cfxui__Flyout__title__b235a", E = "cfxui__Flyout__active__14a29", U = "cfxui__Flyout__mask__72713", e = {
13
+ root: v,
14
+ backdrop: z,
15
+ holder: O,
16
+ content: L,
17
+ header: T,
18
+ title: I,
19
+ active: E,
20
+ "backdrop-appearance": "cfxui__Flyout__backdrop-appearance__d9564",
21
+ mask: U,
22
+ "holder-appearance-btu": "cfxui__Flyout__holder-appearance-btu__84100",
23
+ "holder-appearance-rtl": "cfxui__Flyout__holder-appearance-rtl__3ccf2",
24
+ "theme-legacy": "cfxui__Flyout__theme-legacy__a3452",
18
25
  "size-normal": "cfxui__Flyout__size-normal__e1165",
19
26
  "size-small": "cfxui__Flyout__size-small__038a5",
20
27
  "size-xsmall": "cfxui__Flyout__size-xsmall__839e8",
21
28
  "size-xxsmall": "cfxui__Flyout__size-xxsmall__33712",
22
- "theme-filter": "cfxui__Flyout__theme-filter__1fcce",
23
- active: L,
24
- "backdrop-appearance": "cfxui__Flyout__backdrop-appearance__d9564",
25
- "holder-appearance": "cfxui__Flyout__holder-appearance__e818c",
26
- header: O,
27
- title: E
28
- }, I = "flyout-outlet";
29
- function T(c) {
29
+ "backdrop-appearance-rtl": "cfxui__Flyout__backdrop-appearance-rtl__9f651"
30
+ }, g = "flyout-outlet", H = "cfxui-root", n = "shrink";
31
+ function S(i) {
30
32
  const {
31
33
  disabled: t = !1,
32
- size: l = "normal",
33
- theme: a = "default",
34
- onClose: s = y,
35
- children: n,
36
- holderClassName: m
37
- } = c, u = k(I);
38
- f.useEffect(() => {
34
+ size: a = "normal",
35
+ theme: c = "default",
36
+ onClose: l = b,
37
+ children: r,
38
+ holderClassName: u,
39
+ rootClassName: d,
40
+ maskClassName: f
41
+ } = i, p = C(g);
42
+ y.useEffect(() => {
39
43
  if (t)
40
44
  return;
41
- const _ = document.getElementById("cfxui-root");
42
- return _ == null || _.classList.add("shrink"), () => _ == null ? void 0 : _.classList.remove("shrink");
43
- }, [t]), F(s);
44
- const d = r(e.root, e[`size-${l}`], e[`theme-${a}`], {
45
- [e.active]: !t
46
- });
47
- return /* @__PURE__ */ o(u, { children: /* @__PURE__ */ i("div", { className: d, children: [
48
- /* @__PURE__ */ o(x, { showPointer: !1, className: e.backdrop, onClick: s }),
49
- /* @__PURE__ */ o("div", { className: e.mask, children: /* @__PURE__ */ o("div", { className: r(e.holder, m), children: /* @__PURE__ */ o(p, { disabled: !!t, className: e.content, children: n }) }) })
45
+ const _ = document.getElementById(H);
46
+ return _ == null || _.classList.add(n), () => _ == null ? void 0 : _.classList.remove(n);
47
+ }, [t]), N(l);
48
+ const h = s(
49
+ e.root,
50
+ e[`size-${a}`],
51
+ e[`theme-${c}`],
52
+ {
53
+ [e.active]: !t
54
+ },
55
+ d
56
+ );
57
+ return /* @__PURE__ */ o(p, { children: /* @__PURE__ */ m("div", { className: h, children: [
58
+ /* @__PURE__ */ o(k, { showPointer: !1, className: e.backdrop, onClick: l }),
59
+ /* @__PURE__ */ o("div", { className: s(e.mask, f), children: /* @__PURE__ */ o("div", { className: s(e.holder, u), children: /* @__PURE__ */ o(x, { disabled: t, className: e.content, children: r }) }) })
50
60
  ] }) });
51
61
  }
52
- T.Header = function(t) {
62
+ S.Header = function(t) {
53
63
  const {
54
- onClose: l,
55
- children: a,
56
- ref: s
64
+ onClose: a,
65
+ children: c,
66
+ ref: l,
67
+ className: r
57
68
  } = t;
58
- return /* @__PURE__ */ i("div", { ref: s, className: e.header, children: [
59
- /* @__PURE__ */ o("div", { className: e.title, children: a }),
60
- !!l && /* @__PURE__ */ o(h, { icon: "Close", onClick: l })
69
+ return /* @__PURE__ */ m("div", { ref: l, className: s(e.header, r), children: [
70
+ /* @__PURE__ */ o("div", { className: e.title, children: c }),
71
+ !!a && /* @__PURE__ */ o(F, { icon: "Close", onClick: a })
61
72
  ] });
62
73
  };
63
74
  export {
64
- I as FLYOUT_OUTLET_ID,
65
- T as Flyout
75
+ g as FLYOUT_OUTLET_ID,
76
+ H as FLYOUT_ROOT_ID,
77
+ n as FLYOUT_ROOT_SHRINK_CLASSNAME,
78
+ S as Flyout
66
79
  };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ declare function FlyoutShowcase(): import("react/jsx-runtime").JSX.Element;
4
+ declare const _default: React.MemoExoticComponent<typeof FlyoutShowcase>;
5
+ export default _default;
@@ -0,0 +1,28 @@
1
+ import { jsxs as o, Fragment as s, jsx as r } from "react/jsx-runtime";
2
+ import n from "react";
3
+ import { Flyout as l } from "./Flyout.js";
4
+ function i() {
5
+ const [e, t] = n.useState(!0);
6
+ return /* @__PURE__ */ o(s, { children: [
7
+ /* @__PURE__ */ o("button", { type: "button", onClick: () => t(!e), children: [
8
+ e ? "Open" : "Close",
9
+ " ",
10
+ "Flyout"
11
+ ] }),
12
+ /* @__PURE__ */ o(
13
+ l,
14
+ {
15
+ disabled: e,
16
+ onClose: () => t(!0),
17
+ children: [
18
+ /* @__PURE__ */ r(l.Header, { onClose: () => t(!0), children: /* @__PURE__ */ r("h1", { children: "Header" }) }),
19
+ /* @__PURE__ */ r("p", { children: "This is a flyout" })
20
+ ]
21
+ }
22
+ )
23
+ ] });
24
+ }
25
+ const d = n.memo(i);
26
+ export {
27
+ d as default
28
+ };
@@ -1,2 +1,2 @@
1
- export { FLYOUT_OUTLET_ID, Flyout } from './Flyout';
1
+ export { Flyout, FLYOUT_OUTLET_ID, FLYOUT_ROOT_ID, FLYOUT_ROOT_SHRINK_CLASSNAME, } from './Flyout';
2
2
  export type { FlyoutProps, FlyoutSize, FlyoutTheme, } from './Flyout';
@@ -1,5 +1,7 @@
1
- import { FLYOUT_OUTLET_ID as r, Flyout as t } from "./Flyout.js";
1
+ import { FLYOUT_OUTLET_ID as _, FLYOUT_ROOT_ID as L, FLYOUT_ROOT_SHRINK_CLASSNAME as F, Flyout as U } from "./Flyout.js";
2
2
  export {
3
- r as FLYOUT_OUTLET_ID,
4
- t as Flyout
3
+ _ as FLYOUT_OUTLET_ID,
4
+ L as FLYOUT_ROOT_ID,
5
+ F as FLYOUT_ROOT_SHRINK_CLASSNAME,
6
+ U as Flyout
5
7
  };
@@ -0,0 +1,4 @@
1
+ import { RangeProps } from './Range.types';
2
+
3
+ declare function Range(props: RangeProps): import("react/jsx-runtime").JSX.Element;
4
+ export default Range;
@@ -0,0 +1,90 @@
1
+ import { jsxs as R, jsx as a } from "react/jsx-runtime";
2
+ import { R as p, T as w, a as N, b as s } from "../../index-D5SMGei3.js";
3
+ import L from "react";
4
+ import { clsx as r } from "../../utils/clsx.js";
5
+ const k = "cfxui__Range__root__9b6c3", v = "cfxui__Range__disabled__1bbc7", I = "cfxui__Range__track__28130", T = "cfxui__Range__range__2adcc", V = "cfxui__Range__thumb__905e9", B = "cfxui__Range__thumbIcon__acb4e", e = {
6
+ root: k,
7
+ disabled: v,
8
+ track: I,
9
+ range: T,
10
+ thumb: V,
11
+ thumbIcon: B
12
+ };
13
+ function j(t) {
14
+ return /* @__PURE__ */ a(
15
+ "svg",
16
+ {
17
+ viewBox: "0 0 16 22",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ ...t,
20
+ children: /* @__PURE__ */ a(
21
+ "path",
22
+ {
23
+ fill: "currentColor",
24
+ d: "M0 1.74333C0 0.595035 1.29793 -0.0729044 2.23234 0.594526L15.1917 9.8512C15.9799 10.4142 15.9799 11.5858 15.1917 12.1488L2.23234 21.4055C1.29793 22.0729 0 21.405 0 20.2567V1.74333Z"
25
+ }
26
+ )
27
+ }
28
+ );
29
+ }
30
+ function M(t) {
31
+ return /* @__PURE__ */ a(
32
+ "svg",
33
+ {
34
+ viewBox: "0 0 16 22",
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ ...t,
37
+ children: /* @__PURE__ */ a(
38
+ "path",
39
+ {
40
+ fill: "currentColor",
41
+ d: "M15.8 20.2567C15.8 21.405 14.5021 22.0729 13.5677 21.4055L0.608372 12.1488C-0.179886 11.5858 -0.179887 10.4142 0.608371 9.8512L13.5677 0.594526C14.5021 -0.0729047 15.8001 0.595036 15.8001 1.74333L15.8 20.2567Z"
42
+ }
43
+ )
44
+ }
45
+ );
46
+ }
47
+ function P(t) {
48
+ const {
49
+ value: o,
50
+ defaultValue: l,
51
+ ariaLabelStart: u,
52
+ ariaLabelEnd: _,
53
+ className: i,
54
+ trackClassName: m,
55
+ min: b = 0,
56
+ max: h,
57
+ minStepsBetweenThumbs: d = 1,
58
+ onValueChange: n,
59
+ ref: f,
60
+ disabled: c = !1,
61
+ ...g
62
+ } = t, x = L.useCallback((C) => {
63
+ n && n(C);
64
+ }, [n]);
65
+ return /* @__PURE__ */ R(
66
+ p,
67
+ {
68
+ ...g,
69
+ defaultValue: l,
70
+ ref: f,
71
+ min: b,
72
+ max: h,
73
+ value: o,
74
+ minStepsBetweenThumbs: d,
75
+ className: r(e.root, i, {
76
+ [e.disabled]: c
77
+ }),
78
+ onValueChange: x,
79
+ disabled: c,
80
+ children: [
81
+ /* @__PURE__ */ a(w, { className: r(e.track, m), children: /* @__PURE__ */ a(N, { className: e.range }) }),
82
+ /* @__PURE__ */ a(s, { className: e.thumb, "aria-label": u, children: /* @__PURE__ */ a(j, { className: e.thumbIcon }) }),
83
+ /* @__PURE__ */ a(s, { className: e.thumb, "aria-label": _, children: /* @__PURE__ */ a(M, { className: e.thumbIcon }) })
84
+ ]
85
+ }
86
+ );
87
+ }
88
+ export {
89
+ P as default
90
+ };
@@ -0,0 +1,9 @@
1
+ import { default as React } from 'react';
2
+ import * as RadixSlider from '@radix-ui/react-slider';
3
+ export interface RangeProps extends RadixSlider.SliderProps {
4
+ ariaLabelStart?: string;
5
+ ariaLabelEnd?: string;
6
+ ref?: React.Ref<HTMLSpanElement>;
7
+ className?: string;
8
+ trackClassName?: string;
9
+ }
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { StyledInputProps } from '../StyledInput';
3
+
4
+ export interface RangeInputProps extends Omit<StyledInputProps, 'onChange'> {
5
+ fullWidth?: boolean;
6
+ containerClassName?: string;
7
+ sign?: string;
8
+ onChange?: (value: string) => void;
9
+ onSubmit?: () => void;
10
+ onKeyDown?(event: React.KeyboardEvent<HTMLInputElement>): void;
11
+ }
12
+ declare function RangeInput(props: RangeInputProps): import("react/jsx-runtime").JSX.Element;
13
+ export default RangeInput;
@@ -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;