@cfx-dev/ui-components 3.0.4 → 4.0.0
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.
- package/dist/Select-Ds-fm4CN.js +3245 -0
- package/dist/assets/all_css.css +2 -0
- package/dist/assets/css/DropdownSelect.css +1 -0
- package/dist/assets/css/Input.css +1 -1
- package/dist/assets/css/Modal.css +1 -1
- package/dist/assets/css/Slider.css +1 -0
- package/dist/assets/general/global.css +1 -1
- package/dist/components/Checkbox/Checkbox.js +190 -118
- package/dist/components/DropdownSelect/DropdownSelect.d.ts +16 -0
- package/dist/components/DropdownSelect/DropdownSelect.js +2393 -0
- package/dist/components/DropdownSelect/DropdownSelectShowcase.d.ts +5 -0
- package/dist/components/DropdownSelect/DropdownSelectShowcase.js +52 -0
- package/dist/components/DropdownSelect/index.d.ts +1 -0
- package/dist/components/DropdownSelect/index.js +4 -0
- package/dist/components/Input/Input.js +4 -4
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.js +7 -3092
- package/dist/components/Select/SelectShowcase.js +1 -1
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Select/index.js +3 -2
- package/dist/components/Slider/Slider.d.ts +11 -0
- package/dist/components/Slider/Slider.js +606 -0
- package/dist/components/Slider/SliderShowcase.d.ts +5 -0
- package/dist/components/Slider/SliderShowcase.js +63 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +4 -0
- package/dist/components/Switch/Switch.js +131 -68
- package/dist/components/ui.d.ts +2 -2
- package/dist/components/ui.js +13 -13
- package/dist/index-BCnz73Lm.js +72 -0
- package/dist/index-BW3WdIgK.js +14 -0
- package/dist/index-BlbvKsmN.js +82 -0
- package/dist/index-CjTSD6zB.js +161 -0
- package/dist/main.d.ts +3 -1
- package/dist/main.js +69 -65
- package/dist/styles-scss/_ui.scss +5 -5
- package/package.json +3 -1
- package/dist/index-CjWRnNpt.js +0 -210
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as s from "react";
|
|
2
|
+
import y from "react";
|
|
3
|
+
import { jsx as h, Fragment as O } from "react/jsx-runtime";
|
|
4
|
+
function w(e, t = []) {
|
|
5
|
+
let n = [];
|
|
6
|
+
function r(c, l) {
|
|
7
|
+
const i = s.createContext(l), a = n.length;
|
|
8
|
+
n = [...n, l];
|
|
9
|
+
const S = (R) => {
|
|
10
|
+
var d;
|
|
11
|
+
const { scope: C, children: f, ...u } = R, p = ((d = C == null ? void 0 : C[e]) == null ? void 0 : d[a]) || i, m = s.useMemo(() => u, Object.values(u));
|
|
12
|
+
return /* @__PURE__ */ h(p.Provider, { value: m, children: f });
|
|
13
|
+
};
|
|
14
|
+
S.displayName = c + "Provider";
|
|
15
|
+
function v(R, C) {
|
|
16
|
+
var p;
|
|
17
|
+
const f = ((p = C == null ? void 0 : C[e]) == null ? void 0 : p[a]) || i, u = s.useContext(f);
|
|
18
|
+
if (u) return u;
|
|
19
|
+
if (l !== void 0) return l;
|
|
20
|
+
throw new Error(`\`${R}\` must be used within \`${c}\``);
|
|
21
|
+
}
|
|
22
|
+
return [S, v];
|
|
23
|
+
}
|
|
24
|
+
const o = () => {
|
|
25
|
+
const c = n.map((l) => s.createContext(l));
|
|
26
|
+
return function(i) {
|
|
27
|
+
const a = (i == null ? void 0 : i[e]) || c;
|
|
28
|
+
return s.useMemo(
|
|
29
|
+
() => ({ [`__scope${e}`]: { ...i, [e]: a } }),
|
|
30
|
+
[i, a]
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
return o.scopeName = e, [r, b(o, ...t)];
|
|
35
|
+
}
|
|
36
|
+
function b(...e) {
|
|
37
|
+
const t = e[0];
|
|
38
|
+
if (e.length === 1) return t;
|
|
39
|
+
const n = () => {
|
|
40
|
+
const r = e.map((o) => ({
|
|
41
|
+
useScope: o(),
|
|
42
|
+
scopeName: o.scopeName
|
|
43
|
+
}));
|
|
44
|
+
return function(c) {
|
|
45
|
+
const l = r.reduce((i, { useScope: a, scopeName: S }) => {
|
|
46
|
+
const R = a(c)[`__scope${S}`];
|
|
47
|
+
return { ...i, ...R };
|
|
48
|
+
}, {});
|
|
49
|
+
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: l }), [l]);
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
return n.scopeName = t.scopeName, n;
|
|
53
|
+
}
|
|
54
|
+
function _(e, t) {
|
|
55
|
+
if (typeof e == "function")
|
|
56
|
+
return e(t);
|
|
57
|
+
e != null && (e.current = t);
|
|
58
|
+
}
|
|
59
|
+
function A(...e) {
|
|
60
|
+
return (t) => {
|
|
61
|
+
let n = !1;
|
|
62
|
+
const r = e.map((o) => {
|
|
63
|
+
const c = _(o, t);
|
|
64
|
+
return !n && typeof c == "function" && (n = !0), c;
|
|
65
|
+
});
|
|
66
|
+
if (n)
|
|
67
|
+
return () => {
|
|
68
|
+
for (let o = 0; o < r.length; o++) {
|
|
69
|
+
const c = r[o];
|
|
70
|
+
typeof c == "function" ? c() : _(e[o], null);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function N(...e) {
|
|
76
|
+
return s.useCallback(A(...e), e);
|
|
77
|
+
}
|
|
78
|
+
var g = s.forwardRef((e, t) => {
|
|
79
|
+
const { children: n, ...r } = e, o = s.Children.toArray(n), c = o.find(V);
|
|
80
|
+
if (c) {
|
|
81
|
+
const l = c.props.children, i = o.map((a) => a === c ? s.Children.count(l) > 1 ? s.Children.only(null) : s.isValidElement(l) ? l.props.children : null : a);
|
|
82
|
+
return /* @__PURE__ */ h(M, { ...r, ref: t, children: s.isValidElement(l) ? s.cloneElement(l, void 0, i) : null });
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ h(M, { ...r, ref: t, children: n });
|
|
85
|
+
});
|
|
86
|
+
g.displayName = "Slot";
|
|
87
|
+
var M = s.forwardRef((e, t) => {
|
|
88
|
+
const { children: n, ...r } = e;
|
|
89
|
+
if (s.isValidElement(n)) {
|
|
90
|
+
const o = j(n);
|
|
91
|
+
return s.cloneElement(n, {
|
|
92
|
+
...$(r, n.props),
|
|
93
|
+
// @ts-ignore
|
|
94
|
+
ref: t ? A(t, o) : o
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return s.Children.count(n) > 1 ? s.Children.only(null) : null;
|
|
98
|
+
});
|
|
99
|
+
M.displayName = "SlotClone";
|
|
100
|
+
var T = ({ children: e }) => /* @__PURE__ */ h(O, { children: e });
|
|
101
|
+
function V(e) {
|
|
102
|
+
return s.isValidElement(e) && e.type === T;
|
|
103
|
+
}
|
|
104
|
+
function $(e, t) {
|
|
105
|
+
const n = { ...t };
|
|
106
|
+
for (const r in t) {
|
|
107
|
+
const o = e[r], c = t[r];
|
|
108
|
+
/^on[A-Z]/.test(r) ? o && c ? n[r] = (...i) => {
|
|
109
|
+
c(...i), o(...i);
|
|
110
|
+
} : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...c } : r === "className" && (n[r] = [o, c].filter(Boolean).join(" "));
|
|
111
|
+
}
|
|
112
|
+
return { ...e, ...n };
|
|
113
|
+
}
|
|
114
|
+
function j(e) {
|
|
115
|
+
var r, o;
|
|
116
|
+
let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
|
|
117
|
+
return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
|
|
118
|
+
}
|
|
119
|
+
function L(e) {
|
|
120
|
+
const t = e + "CollectionProvider", [n, r] = w(t), [o, c] = n(
|
|
121
|
+
t,
|
|
122
|
+
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
123
|
+
), l = (f) => {
|
|
124
|
+
const { scope: u, children: p } = f, m = y.useRef(null), d = y.useRef(/* @__PURE__ */ new Map()).current;
|
|
125
|
+
return /* @__PURE__ */ h(o, { scope: u, itemMap: d, collectionRef: m, children: p });
|
|
126
|
+
};
|
|
127
|
+
l.displayName = t;
|
|
128
|
+
const i = e + "CollectionSlot", a = y.forwardRef(
|
|
129
|
+
(f, u) => {
|
|
130
|
+
const { scope: p, children: m } = f, d = c(i, p), x = N(u, d.collectionRef);
|
|
131
|
+
return /* @__PURE__ */ h(g, { ref: x, children: m });
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
a.displayName = i;
|
|
135
|
+
const S = e + "CollectionItemSlot", v = "data-radix-collection-item", R = y.forwardRef(
|
|
136
|
+
(f, u) => {
|
|
137
|
+
const { scope: p, children: m, ...d } = f, x = y.useRef(null), P = N(u, x), E = c(S, p);
|
|
138
|
+
return y.useEffect(() => (E.itemMap.set(x, { ref: x, ...d }), () => void E.itemMap.delete(x))), /* @__PURE__ */ h(g, { [v]: "", ref: P, children: m });
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
R.displayName = S;
|
|
142
|
+
function C(f) {
|
|
143
|
+
const u = c(e + "CollectionConsumer", f);
|
|
144
|
+
return y.useCallback(() => {
|
|
145
|
+
const m = u.collectionRef.current;
|
|
146
|
+
if (!m) return [];
|
|
147
|
+
const d = Array.from(m.querySelectorAll(`[${v}]`));
|
|
148
|
+
return Array.from(u.itemMap.values()).sort(
|
|
149
|
+
(E, I) => d.indexOf(E.ref.current) - d.indexOf(I.ref.current)
|
|
150
|
+
);
|
|
151
|
+
}, [u.collectionRef, u.itemMap]);
|
|
152
|
+
}
|
|
153
|
+
return [
|
|
154
|
+
{ Provider: l, Slot: a, ItemSlot: R },
|
|
155
|
+
C,
|
|
156
|
+
r
|
|
157
|
+
];
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
L as c
|
|
161
|
+
};
|
package/dist/main.d.ts
CHANGED
|
@@ -54,8 +54,10 @@ export { PremiumBadge } from './components/PremiumBadge/PremiumBadge';
|
|
|
54
54
|
export { Prose } from './components/Prose/Prose';
|
|
55
55
|
export { Radio } from './components/Radio/Radio';
|
|
56
56
|
export { Select } from './components/Select';
|
|
57
|
+
export { DropdownSelect } from './components/DropdownSelect';
|
|
57
58
|
export { Separator } from './components/Separator/Separator';
|
|
58
59
|
export { Shroud } from './components/Shroud/Shroud';
|
|
60
|
+
export { Slider } from './components/Slider/Slider';
|
|
59
61
|
export { Spacer } from './components/Spacer/Spacer';
|
|
60
62
|
export { Style, useContextualStyle } from './components/Style/Style';
|
|
61
63
|
export { Switch } from './components/Switch';
|
|
@@ -92,5 +94,5 @@ export type { PopoverProps } from './components/Popover';
|
|
|
92
94
|
export type { AvatarProps, AvatarSize } from './components/Avatar';
|
|
93
95
|
export { OnScreenSensor } from './components/OnScreenSensor';
|
|
94
96
|
export { ui } from './components/ui';
|
|
95
|
-
export type { OffesetType, MediaQueryType } from './components/ui';
|
|
97
|
+
export type { OffesetType, MediaQueryType, MediaQueryEnum, OffsetEnum, } from './components/ui';
|
|
96
98
|
export { Symbols } from './components/Symbols';
|
package/dist/main.js
CHANGED
|
@@ -7,11 +7,11 @@ import { useDynamicRef as u } from "./utils/hooks/useDynamicRef.js";
|
|
|
7
7
|
import { useGlobalKeyboardEvent as d } from "./utils/hooks/useGlobalKeyboardEvent.js";
|
|
8
8
|
import { useKeyboardClose as T } from "./utils/hooks/useKeyboardClose.js";
|
|
9
9
|
import { useWindowResize as g } from "./utils/hooks/useWindowResize.js";
|
|
10
|
-
import { useOutlet as
|
|
11
|
-
import { CLIPBOARD_TITLE_APPEARANCE as
|
|
12
|
-
import { identity as b, invoke as A, noop as O, returnFalse as P, returnTrue as
|
|
13
|
-
import { Linkify as _, defaultLinkReplacer as h, defaultLinkReplacerx as v, isExternalUrl as F, linkify as U, linkifyx as N, matchLinkNodes as
|
|
14
|
-
import { clamp as
|
|
10
|
+
import { useOutlet as S } from "./utils/hooks/useOutlet.js";
|
|
11
|
+
import { CLIPBOARD_TITLE_APPEARANCE as k, useClipboardComponent as y } from "./utils/hooks/useClipboardComponent.js";
|
|
12
|
+
import { identity as b, invoke as A, noop as O, returnFalse as P, returnTrue as D } from "./utils/functional.js";
|
|
13
|
+
import { Linkify as _, defaultLinkReplacer as h, defaultLinkReplacerx as v, isExternalUrl as F, linkify as U, linkifyx as N, matchLinkNodes as w, matchLinks as z } from "./utils/links.js";
|
|
14
|
+
import { clamp as V, clamp01 as G } from "./utils/math.js";
|
|
15
15
|
import { isFalseString as H, isTrueString as M, normalizeSlashes as W, replaceRange as j, splitByIndices as q, unicodeCharAt as J } from "./utils/string.js";
|
|
16
16
|
import { debounce as X, throttle as Z } from "./utils/execution.js";
|
|
17
17
|
import { getColor as oo } from "./utils/color.js";
|
|
@@ -22,16 +22,16 @@ import { default as so } from "./components/Checkbox/Checkbox.js";
|
|
|
22
22
|
import { Button as co } from "./components/Button/Button.js";
|
|
23
23
|
import { LinkButton as To } from "./components/Button/LinkButton.js";
|
|
24
24
|
import { default as go, getLinkClassName as Bo } from "./components/Link/Link.js";
|
|
25
|
-
import { default as
|
|
25
|
+
import { default as Co } from "./components/Link/ButtonLink.js";
|
|
26
26
|
import { ButtonBar as yo } from "./components/Button/ButtonBar.js";
|
|
27
27
|
import { Avatar as bo } from "./components/Avatar/Avatar.js";
|
|
28
28
|
import { BACKDROP_OUTLET_ID as Oo, BackdropPortal as Po } from "./components/BackdropPortal/BackdropPortal.js";
|
|
29
|
-
import { Badge as
|
|
29
|
+
import { Badge as Eo } from "./components/Badge/Badge.js";
|
|
30
30
|
import { ControlBox as ho } from "./components/ControlBox/ControlBox.js";
|
|
31
31
|
import { CountryFlag as Fo } from "./components/CountryFlag/CountryFlag.js";
|
|
32
32
|
import { Decorate as No } from "./components/Decorate/Decorate.js";
|
|
33
|
-
import { Dot as
|
|
34
|
-
import { FLYOUT_OUTLET_ID as
|
|
33
|
+
import { Dot as zo } from "./components/Dot/Dot.js";
|
|
34
|
+
import { FLYOUT_OUTLET_ID as Vo, Flyout as Go } from "./components/Flyout/Flyout.js";
|
|
35
35
|
import { Logos as Ho } from "./components/Logos/index.js";
|
|
36
36
|
import { I as Wo } from "./cfxIcons-BNd1WgpX.js";
|
|
37
37
|
import { I as qo } from "./cfxIconsBig-BLJjMT-Y.js";
|
|
@@ -48,36 +48,38 @@ import { Center as cr } from "./components/Layout/Center/Center.js";
|
|
|
48
48
|
import { Flex as Ir } from "./components/Layout/Flex/Flex.js";
|
|
49
49
|
import { FlexRestricter as Lr } from "./components/Layout/Flex/FlexRestricter.js";
|
|
50
50
|
import { Pad as Br } from "./components/Layout/Pad/Pad.js";
|
|
51
|
-
import { Page as
|
|
51
|
+
import { Page as Cr } from "./components/Layout/Page/Page.js";
|
|
52
52
|
import { R as yr } from "./Rail-DcVowhML.js";
|
|
53
53
|
import { Scrollable as br } from "./components/Layout/Scrollable/Scrollable.js";
|
|
54
54
|
import { VirtualScrollable as Or } from "./components/Layout/Scrollable/VirtualScrollable.js";
|
|
55
|
-
import { Loaf as
|
|
55
|
+
import { Loaf as Dr } from "./components/Loaf/Loaf.js";
|
|
56
56
|
import { Modal as _r } from "./components/Modal/Modal.js";
|
|
57
57
|
import { NavList as vr } from "./components/NavList/NavList.js";
|
|
58
58
|
import { OVERLAY_OUTLET_ID as Ur, Overlay as Nr } from "./components/Overlay/Overlay.js";
|
|
59
|
-
import { Popover as
|
|
60
|
-
import { PremiumBadge as
|
|
59
|
+
import { Popover as zr } from "./components/Popover/Popover.js";
|
|
60
|
+
import { PremiumBadge as Vr } from "./components/PremiumBadge/PremiumBadge.js";
|
|
61
61
|
import { Prose as Yr } from "./components/Prose/Prose.js";
|
|
62
62
|
import { Radio as Mr } from "./components/Radio/Radio.js";
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
72
|
-
import {
|
|
73
|
-
import {
|
|
74
|
-
import {
|
|
75
|
-
import {
|
|
63
|
+
import { S as jr } from "./Select-Ds-fm4CN.js";
|
|
64
|
+
import { DropdownSelect as Jr } from "./components/DropdownSelect/DropdownSelect.js";
|
|
65
|
+
import { Separator as Xr } from "./components/Separator/Separator.js";
|
|
66
|
+
import { Shroud as $r } from "./components/Shroud/Shroud.js";
|
|
67
|
+
import { Slider as re } from "./components/Slider/Slider.js";
|
|
68
|
+
import { Spacer as te } from "./components/Spacer/Spacer.js";
|
|
69
|
+
import { Style as fe, useContextualStyle as me } from "./components/Style/Style.js";
|
|
70
|
+
import { default as ae } from "./components/Switch/Switch.js";
|
|
71
|
+
import { ToggleGroup as ne } from "./components/ToggleGroup/ToggleGroup.js";
|
|
72
|
+
import { Tabular as se } from "./components/Tabular/Tabular.js";
|
|
73
|
+
import { Table as ce, TableIconButton as de } from "./components/Table/Table.js";
|
|
74
|
+
import { Text as Te, TextBlock as Le, getTextOpacity as ge } from "./components/Text/Text.js";
|
|
75
|
+
import { Textarea as Se } from "./components/Textarea/Textarea.js";
|
|
76
|
+
import { TITLE_OUTLET_ID as ke, Title as ye } from "./components/Title/Title.js";
|
|
77
|
+
import { default as be } from "./components/InputDropzone/InputDropzone.js";
|
|
76
78
|
import "./components/InputDropzone/ItemPreview.js";
|
|
77
|
-
import { default as
|
|
78
|
-
import { OnScreenSensor as
|
|
79
|
-
import { ui as
|
|
80
|
-
import { Symbols as
|
|
79
|
+
import { default as Oe } from "./components/Skeleton/Skeleton.js";
|
|
80
|
+
import { OnScreenSensor as De } from "./components/OnScreenSensor.js";
|
|
81
|
+
import { ui as _e } from "./components/ui.js";
|
|
82
|
+
import { Symbols as ve } from "./components/Symbols.js";
|
|
81
83
|
export {
|
|
82
84
|
po as Accordion,
|
|
83
85
|
fo as AccordionContent,
|
|
@@ -87,20 +89,21 @@ export {
|
|
|
87
89
|
bo as Avatar,
|
|
88
90
|
Oo as BACKDROP_OUTLET_ID,
|
|
89
91
|
Po as BackdropPortal,
|
|
90
|
-
|
|
92
|
+
Eo as Badge,
|
|
91
93
|
sr as Box,
|
|
92
94
|
co as Button,
|
|
93
95
|
yo as ButtonBar,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
Co as ButtonLink,
|
|
97
|
+
k as CLIPBOARD_TITLE_APPEARANCE,
|
|
96
98
|
cr as Center,
|
|
97
99
|
so as Checkbox,
|
|
98
100
|
no as ClipboardButton,
|
|
99
101
|
ho as ControlBox,
|
|
100
102
|
Fo as CountryFlag,
|
|
101
103
|
No as Decorate,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
zo as Dot,
|
|
105
|
+
Jr as DropdownSelect,
|
|
106
|
+
Vo as FLYOUT_OUTLET_ID,
|
|
104
107
|
Ir as Flex,
|
|
105
108
|
Lr as FlexRestricter,
|
|
106
109
|
Go as Flyout,
|
|
@@ -112,47 +115,48 @@ export {
|
|
|
112
115
|
or as Indicator,
|
|
113
116
|
er as InfoPanel,
|
|
114
117
|
pr as Input,
|
|
115
|
-
|
|
118
|
+
be as InputDropzone,
|
|
116
119
|
ar as Interactive,
|
|
117
120
|
nr as Island,
|
|
118
121
|
go as Link,
|
|
119
122
|
To as LinkButton,
|
|
120
123
|
_ as Linkify,
|
|
121
|
-
|
|
124
|
+
Dr as Loaf,
|
|
122
125
|
Ho as Logos,
|
|
123
126
|
_r as Modal,
|
|
124
127
|
vr as NavList,
|
|
125
128
|
Ur as OVERLAY_OUTLET_ID,
|
|
126
|
-
|
|
129
|
+
De as OnScreenSensor,
|
|
127
130
|
Nr as Overlay,
|
|
128
131
|
Br as Pad,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
+
Cr as Page,
|
|
133
|
+
zr as Popover,
|
|
134
|
+
Vr as PremiumBadge,
|
|
132
135
|
Yr as Prose,
|
|
133
136
|
Mr as Radio,
|
|
134
137
|
yr as Rail,
|
|
135
138
|
mr as RichInput,
|
|
136
139
|
br as Scrollable,
|
|
137
140
|
jr as Select,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
141
|
+
Xr as Separator,
|
|
142
|
+
$r as Shroud,
|
|
143
|
+
Oe as Skeleton,
|
|
144
|
+
re as Slider,
|
|
145
|
+
te as Spacer,
|
|
146
|
+
fe as Style,
|
|
147
|
+
ae as Switch,
|
|
148
|
+
ve as Symbols,
|
|
149
|
+
ke as TITLE_OUTLET_ID,
|
|
150
|
+
ce as Table,
|
|
151
|
+
de as TableIconButton,
|
|
152
|
+
se as Tabular,
|
|
153
|
+
Te as Text,
|
|
154
|
+
Le as TextBlock,
|
|
155
|
+
Se as Textarea,
|
|
156
|
+
ye as Title,
|
|
157
|
+
ne as ToggleGroup,
|
|
154
158
|
Or as VirtualScrollable,
|
|
155
|
-
|
|
159
|
+
V as clamp,
|
|
156
160
|
G as clamp01,
|
|
157
161
|
f as clsx,
|
|
158
162
|
X as debounce,
|
|
@@ -160,7 +164,7 @@ export {
|
|
|
160
164
|
v as defaultLinkReplacerx,
|
|
161
165
|
oo as getColor,
|
|
162
166
|
Bo as getLinkClassName,
|
|
163
|
-
|
|
167
|
+
ge as getTextOpacity,
|
|
164
168
|
x as getValue,
|
|
165
169
|
b as identity,
|
|
166
170
|
A as invoke,
|
|
@@ -169,25 +173,25 @@ export {
|
|
|
169
173
|
M as isTrueString,
|
|
170
174
|
U as linkify,
|
|
171
175
|
N as linkifyx,
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
w as matchLinkNodes,
|
|
177
|
+
z as matchLinks,
|
|
174
178
|
t as mergeRefs,
|
|
175
179
|
O as noop,
|
|
176
180
|
W as normalizeSlashes,
|
|
177
181
|
j as replaceRange,
|
|
178
182
|
P as returnFalse,
|
|
179
|
-
|
|
183
|
+
D as returnTrue,
|
|
180
184
|
q as splitByIndices,
|
|
181
185
|
Z as throttle,
|
|
182
|
-
|
|
186
|
+
_e as ui,
|
|
183
187
|
J as unicodeCharAt,
|
|
184
188
|
y as useClipboardComponent,
|
|
185
|
-
|
|
189
|
+
me as useContextualStyle,
|
|
186
190
|
u as useDynamicRef,
|
|
187
191
|
d as useGlobalKeyboardEvent,
|
|
188
192
|
i as useInstance,
|
|
189
193
|
T as useKeyboardClose,
|
|
190
|
-
|
|
194
|
+
S as useOutlet,
|
|
191
195
|
l as usePopoverController,
|
|
192
196
|
g as useWindowResize
|
|
193
197
|
};
|
|
@@ -326,12 +326,12 @@ $zindexMap: (
|
|
|
326
326
|
|
|
327
327
|
$mediaMap: (
|
|
328
328
|
'initial': 0px,
|
|
329
|
-
'
|
|
330
|
-
'
|
|
331
|
-
'small': 768px,
|
|
329
|
+
'small': 360px,
|
|
330
|
+
'small-medium': 640px,
|
|
332
331
|
'medium': 1024px,
|
|
333
|
-
'large': 1280px,
|
|
334
|
-
'
|
|
332
|
+
'medium-large': 1280px,
|
|
333
|
+
'large': 1920px,
|
|
334
|
+
'xlarge': 2560px,
|
|
335
335
|
);
|
|
336
336
|
|
|
337
337
|
@mixin media-max($size: 'medium', $fix: 'empty') {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cfx-dev/ui-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/main.js",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@radix-ui/react-checkbox": "^1.1.1",
|
|
28
|
+
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
28
29
|
"@radix-ui/react-select": "^2.1.1",
|
|
30
|
+
"@radix-ui/react-slider": "^1.2.2",
|
|
29
31
|
"@radix-ui/react-switch": "^1.1.0",
|
|
30
32
|
"autolinker": "^3.14.3",
|
|
31
33
|
"flag-icons": "^6.1.1",
|
package/dist/index-CjWRnNpt.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
import * as s from "react";
|
|
2
|
-
import { jsx as h, Fragment as P } from "react/jsx-runtime";
|
|
3
|
-
import { r as R } from "./index-2hJuj4UN.js";
|
|
4
|
-
function w(e, t) {
|
|
5
|
-
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
6
|
-
}
|
|
7
|
-
function b(...e) {
|
|
8
|
-
return (t) => e.forEach((r) => w(r, t));
|
|
9
|
-
}
|
|
10
|
-
function D(...e) {
|
|
11
|
-
return s.useCallback(b(...e), e);
|
|
12
|
-
}
|
|
13
|
-
function M(e, t = []) {
|
|
14
|
-
let r = [];
|
|
15
|
-
function o(i, c) {
|
|
16
|
-
const u = s.createContext(c), f = r.length;
|
|
17
|
-
r = [...r, c];
|
|
18
|
-
function l(a) {
|
|
19
|
-
const { scope: d, children: S, ...p } = a, x = (d == null ? void 0 : d[e][f]) || u, g = s.useMemo(() => p, Object.values(p));
|
|
20
|
-
return /* @__PURE__ */ h(x.Provider, { value: g, children: S });
|
|
21
|
-
}
|
|
22
|
-
function m(a, d) {
|
|
23
|
-
const S = (d == null ? void 0 : d[e][f]) || u, p = s.useContext(S);
|
|
24
|
-
if (p) return p;
|
|
25
|
-
if (c !== void 0) return c;
|
|
26
|
-
throw new Error(`\`${a}\` must be used within \`${i}\``);
|
|
27
|
-
}
|
|
28
|
-
return l.displayName = i + "Provider", [l, m];
|
|
29
|
-
}
|
|
30
|
-
const n = () => {
|
|
31
|
-
const i = r.map((c) => s.createContext(c));
|
|
32
|
-
return function(u) {
|
|
33
|
-
const f = (u == null ? void 0 : u[e]) || i;
|
|
34
|
-
return s.useMemo(
|
|
35
|
-
() => ({ [`__scope${e}`]: { ...u, [e]: f } }),
|
|
36
|
-
[u, f]
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
return n.scopeName = e, [o, E(n, ...t)];
|
|
41
|
-
}
|
|
42
|
-
function E(...e) {
|
|
43
|
-
const t = e[0];
|
|
44
|
-
if (e.length === 1) return t;
|
|
45
|
-
const r = () => {
|
|
46
|
-
const o = e.map((n) => ({
|
|
47
|
-
useScope: n(),
|
|
48
|
-
scopeName: n.scopeName
|
|
49
|
-
}));
|
|
50
|
-
return function(i) {
|
|
51
|
-
const c = o.reduce((u, { useScope: f, scopeName: l }) => {
|
|
52
|
-
const a = f(i)[`__scope${l}`];
|
|
53
|
-
return { ...u, ...a };
|
|
54
|
-
}, {});
|
|
55
|
-
return s.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
return r.scopeName = t.scopeName, r;
|
|
59
|
-
}
|
|
60
|
-
function V(e, t, { checkForDefaultPrevented: r = !0 } = {}) {
|
|
61
|
-
return function(n) {
|
|
62
|
-
if (e == null || e(n), r === !1 || !n.defaultPrevented)
|
|
63
|
-
return t == null ? void 0 : t(n);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function C(e) {
|
|
67
|
-
const t = s.useRef(e);
|
|
68
|
-
return s.useEffect(() => {
|
|
69
|
-
t.current = e;
|
|
70
|
-
}), s.useMemo(() => (...r) => {
|
|
71
|
-
var o;
|
|
72
|
-
return (o = t.current) == null ? void 0 : o.call(t, ...r);
|
|
73
|
-
}, []);
|
|
74
|
-
}
|
|
75
|
-
function k({
|
|
76
|
-
prop: e,
|
|
77
|
-
defaultProp: t,
|
|
78
|
-
onChange: r = () => {
|
|
79
|
-
}
|
|
80
|
-
}) {
|
|
81
|
-
const [o, n] = z({ defaultProp: t, onChange: r }), i = e !== void 0, c = i ? e : o, u = C(r), f = s.useCallback(
|
|
82
|
-
(l) => {
|
|
83
|
-
if (i) {
|
|
84
|
-
const a = typeof l == "function" ? l(e) : l;
|
|
85
|
-
a !== e && u(a);
|
|
86
|
-
} else
|
|
87
|
-
n(l);
|
|
88
|
-
},
|
|
89
|
-
[i, e, n, u]
|
|
90
|
-
);
|
|
91
|
-
return [c, f];
|
|
92
|
-
}
|
|
93
|
-
function z({
|
|
94
|
-
defaultProp: e,
|
|
95
|
-
onChange: t
|
|
96
|
-
}) {
|
|
97
|
-
const r = s.useState(e), [o] = r, n = s.useRef(o), i = C(t);
|
|
98
|
-
return s.useEffect(() => {
|
|
99
|
-
n.current !== o && (i(o), n.current = o);
|
|
100
|
-
}, [o, n, i]), r;
|
|
101
|
-
}
|
|
102
|
-
function L(e) {
|
|
103
|
-
const t = s.useRef({ value: e, previous: e });
|
|
104
|
-
return s.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
105
|
-
}
|
|
106
|
-
var N = globalThis != null && globalThis.document ? s.useLayoutEffect : () => {
|
|
107
|
-
};
|
|
108
|
-
function U(e) {
|
|
109
|
-
const [t, r] = s.useState(void 0);
|
|
110
|
-
return N(() => {
|
|
111
|
-
if (e) {
|
|
112
|
-
r({ width: e.offsetWidth, height: e.offsetHeight });
|
|
113
|
-
const o = new ResizeObserver((n) => {
|
|
114
|
-
if (!Array.isArray(n) || !n.length)
|
|
115
|
-
return;
|
|
116
|
-
const i = n[0];
|
|
117
|
-
let c, u;
|
|
118
|
-
if ("borderBoxSize" in i) {
|
|
119
|
-
const f = i.borderBoxSize, l = Array.isArray(f) ? f[0] : f;
|
|
120
|
-
c = l.inlineSize, u = l.blockSize;
|
|
121
|
-
} else
|
|
122
|
-
c = e.offsetWidth, u = e.offsetHeight;
|
|
123
|
-
r({ width: c, height: u });
|
|
124
|
-
});
|
|
125
|
-
return o.observe(e, { box: "border-box" }), () => o.unobserve(e);
|
|
126
|
-
} else
|
|
127
|
-
r(void 0);
|
|
128
|
-
}, [e]), t;
|
|
129
|
-
}
|
|
130
|
-
var y = s.forwardRef((e, t) => {
|
|
131
|
-
const { children: r, ...o } = e, n = s.Children.toArray(r), i = n.find(A);
|
|
132
|
-
if (i) {
|
|
133
|
-
const c = i.props.children, u = n.map((f) => f === i ? s.Children.count(c) > 1 ? s.Children.only(null) : s.isValidElement(c) ? c.props.children : null : f);
|
|
134
|
-
return /* @__PURE__ */ h(v, { ...o, ref: t, children: s.isValidElement(c) ? s.cloneElement(c, void 0, u) : null });
|
|
135
|
-
}
|
|
136
|
-
return /* @__PURE__ */ h(v, { ...o, ref: t, children: r });
|
|
137
|
-
});
|
|
138
|
-
y.displayName = "Slot";
|
|
139
|
-
var v = s.forwardRef((e, t) => {
|
|
140
|
-
const { children: r, ...o } = e;
|
|
141
|
-
if (s.isValidElement(r)) {
|
|
142
|
-
const n = _(r);
|
|
143
|
-
return s.cloneElement(r, {
|
|
144
|
-
...W(o, r.props),
|
|
145
|
-
// @ts-ignore
|
|
146
|
-
ref: t ? b(t, n) : n
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
return s.Children.count(r) > 1 ? s.Children.only(null) : null;
|
|
150
|
-
});
|
|
151
|
-
v.displayName = "SlotClone";
|
|
152
|
-
var O = ({ children: e }) => /* @__PURE__ */ h(P, { children: e });
|
|
153
|
-
function A(e) {
|
|
154
|
-
return s.isValidElement(e) && e.type === O;
|
|
155
|
-
}
|
|
156
|
-
function W(e, t) {
|
|
157
|
-
const r = { ...t };
|
|
158
|
-
for (const o in t) {
|
|
159
|
-
const n = e[o], i = t[o];
|
|
160
|
-
/^on[A-Z]/.test(o) ? n && i ? r[o] = (...u) => {
|
|
161
|
-
i(...u), n(...u);
|
|
162
|
-
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...i } : o === "className" && (r[o] = [n, i].filter(Boolean).join(" "));
|
|
163
|
-
}
|
|
164
|
-
return { ...e, ...r };
|
|
165
|
-
}
|
|
166
|
-
function _(e) {
|
|
167
|
-
var o, n;
|
|
168
|
-
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
169
|
-
return r ? e.ref : (t = (n = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
170
|
-
}
|
|
171
|
-
var $ = [
|
|
172
|
-
"a",
|
|
173
|
-
"button",
|
|
174
|
-
"div",
|
|
175
|
-
"form",
|
|
176
|
-
"h2",
|
|
177
|
-
"h3",
|
|
178
|
-
"img",
|
|
179
|
-
"input",
|
|
180
|
-
"label",
|
|
181
|
-
"li",
|
|
182
|
-
"nav",
|
|
183
|
-
"ol",
|
|
184
|
-
"p",
|
|
185
|
-
"span",
|
|
186
|
-
"svg",
|
|
187
|
-
"ul"
|
|
188
|
-
], F = $.reduce((e, t) => {
|
|
189
|
-
const r = s.forwardRef((o, n) => {
|
|
190
|
-
const { asChild: i, ...c } = o, u = i ? y : t;
|
|
191
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ h(u, { ...c, ref: n });
|
|
192
|
-
});
|
|
193
|
-
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
194
|
-
}, {});
|
|
195
|
-
function T(e, t) {
|
|
196
|
-
e && R.flushSync(() => e.dispatchEvent(t));
|
|
197
|
-
}
|
|
198
|
-
export {
|
|
199
|
-
F as P,
|
|
200
|
-
y as S,
|
|
201
|
-
k as a,
|
|
202
|
-
V as b,
|
|
203
|
-
M as c,
|
|
204
|
-
L as d,
|
|
205
|
-
U as e,
|
|
206
|
-
N as f,
|
|
207
|
-
C as g,
|
|
208
|
-
T as h,
|
|
209
|
-
D as u
|
|
210
|
-
};
|