@cfx-dev/ui-components 4.3.8 → 4.3.10

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 (36) hide show
  1. package/dist/{Combination-BGYCZNoJ.js → Combination-DFb92tMK.js} +658 -655
  2. package/dist/assets/general/global.css +1 -1
  3. package/dist/assets/general/themes.css +1 -1
  4. package/dist/components/Accordion/AccordionShowcase.js +21 -9
  5. package/dist/components/Button/ButtonBar.d.ts +2 -0
  6. package/dist/components/Checkbox/Checkbox.js +2 -2
  7. package/dist/components/Dot/Dot.js +6 -4
  8. package/dist/components/DropdownSelect/DropdownSelect.js +4 -4
  9. package/dist/components/Link/LinkShowcase.js +8 -4
  10. package/dist/components/Modal/ModalShowcase.js +2 -1
  11. package/dist/components/Prose/Prose.d.ts +1 -2
  12. package/dist/components/RSC/Box/Box.js +48 -48
  13. package/dist/components/Select/Select.js +3 -3
  14. package/dist/components/Skeleton/SkeletonShowcase.js +3 -2
  15. package/dist/components/Slider/Slider.js +2 -2
  16. package/dist/components/Switch/Switch.js +1 -1
  17. package/dist/components/Text/Text.types.d.ts +1 -0
  18. package/dist/components/Text/TextShowcase.js +1 -1
  19. package/dist/components/Title/Title.js +9 -4
  20. package/dist/{index-DlJ4qUbZ.js → index-BMU9X4M-.js} +1 -1
  21. package/dist/index-DCuJlMqr.js +239 -0
  22. package/dist/{index-CriGVLlo.js → index-DWzyrn_L.js} +1 -1
  23. package/dist/styles-scss/_colors.scss +50 -51
  24. package/dist/styles-scss/_typography.scss +25 -20
  25. package/dist/styles-scss/_ui.scss +115 -98
  26. package/dist/styles-scss/global.scss +13 -8
  27. package/dist/styles-scss/themes/theme_cfx.scss +15 -15
  28. package/dist/styles-scss/themes/theme_fivem.scss +12 -12
  29. package/dist/styles-scss/themes/theme_redm.scss +12 -12
  30. package/dist/styles-scss/themes/theme_wireframe.scss +12 -12
  31. package/dist/styles-scss/themes.scss +4 -4
  32. package/dist/styles-scss/tokens.scss +117 -118
  33. package/dist/utils/hooks/useClipboardComponent.d.ts +4 -1
  34. package/dist/utils/ui/ui.d.ts +2 -1
  35. package/package.json +10 -15
  36. package/dist/index-ByKwkZKY.js +0 -239
@@ -1,239 +0,0 @@
1
- import * as i from "react";
2
- import { jsx as y } from "react/jsx-runtime";
3
- import { r as w } from "./index-Cl_RnsqN.js";
4
- function b(e, n) {
5
- if (typeof e == "function")
6
- return e(n);
7
- e != null && (e.current = n);
8
- }
9
- function g(...e) {
10
- return (n) => {
11
- let o = !1;
12
- const s = e.map((t) => {
13
- const r = b(t, n);
14
- return !o && typeof r == "function" && (o = !0), r;
15
- });
16
- if (o)
17
- return () => {
18
- for (let t = 0; t < s.length; t++) {
19
- const r = s[t];
20
- typeof r == "function" ? r() : b(e[t], null);
21
- }
22
- };
23
- };
24
- }
25
- function E(...e) {
26
- return i.useCallback(g(...e), e);
27
- }
28
- function B(e, n = []) {
29
- let o = [];
30
- function s(r, u) {
31
- const c = i.createContext(u), l = o.length;
32
- o = [...o, u];
33
- const f = (a) => {
34
- var v;
35
- const { scope: p, children: h, ...m } = a, S = ((v = p == null ? void 0 : p[e]) == null ? void 0 : v[l]) || c, x = i.useMemo(() => m, Object.values(m));
36
- return /* @__PURE__ */ y(S.Provider, { value: x, children: h });
37
- };
38
- f.displayName = r + "Provider";
39
- function d(a, p) {
40
- var S;
41
- const h = ((S = p == null ? void 0 : p[e]) == null ? void 0 : S[l]) || c, m = i.useContext(h);
42
- if (m) return m;
43
- if (u !== void 0) return u;
44
- throw new Error(`\`${a}\` must be used within \`${r}\``);
45
- }
46
- return [f, d];
47
- }
48
- const t = () => {
49
- const r = o.map((u) => i.createContext(u));
50
- return function(c) {
51
- const l = (c == null ? void 0 : c[e]) || r;
52
- return i.useMemo(
53
- () => ({ [`__scope${e}`]: { ...c, [e]: l } }),
54
- [c, l]
55
- );
56
- };
57
- };
58
- return t.scopeName = e, [s, P(t, ...n)];
59
- }
60
- function P(...e) {
61
- const n = e[0];
62
- if (e.length === 1) return n;
63
- const o = () => {
64
- const s = e.map((t) => ({
65
- useScope: t(),
66
- scopeName: t.scopeName
67
- }));
68
- return function(r) {
69
- const u = s.reduce((c, { useScope: l, scopeName: f }) => {
70
- const a = l(r)[`__scope${f}`];
71
- return { ...c, ...a };
72
- }, {});
73
- return i.useMemo(() => ({ [`__scope${n.scopeName}`]: u }), [u]);
74
- };
75
- };
76
- return o.scopeName = n.scopeName, o;
77
- }
78
- function k(e, n, { checkForDefaultPrevented: o = !0 } = {}) {
79
- return function(t) {
80
- if (e == null || e(t), o === !1 || !t.defaultPrevented)
81
- return n == null ? void 0 : n(t);
82
- };
83
- }
84
- var C = globalThis != null && globalThis.document ? i.useLayoutEffect : () => {
85
- }, R = i[" useInsertionEffect ".trim().toString()] || C;
86
- function L({
87
- prop: e,
88
- defaultProp: n,
89
- onChange: o = () => {
90
- },
91
- caller: s
92
- }) {
93
- const [t, r, u] = $({
94
- defaultProp: n,
95
- onChange: o
96
- }), c = e !== void 0, l = c ? e : t;
97
- {
98
- const d = i.useRef(e !== void 0);
99
- i.useEffect(() => {
100
- const a = d.current;
101
- a !== c && console.warn(
102
- `${s} is changing from ${a ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
103
- ), d.current = c;
104
- }, [c, s]);
105
- }
106
- const f = i.useCallback(
107
- (d) => {
108
- var a;
109
- if (c) {
110
- const p = z(d) ? d(e) : d;
111
- p !== e && ((a = u.current) == null || a.call(u, p));
112
- } else
113
- r(d);
114
- },
115
- [c, e, r, u]
116
- );
117
- return [l, f];
118
- }
119
- function $({
120
- defaultProp: e,
121
- onChange: n
122
- }) {
123
- const [o, s] = i.useState(e), t = i.useRef(o), r = i.useRef(n);
124
- return R(() => {
125
- r.current = n;
126
- }, [n]), i.useEffect(() => {
127
- var u;
128
- t.current !== o && ((u = r.current) == null || u.call(r, o), t.current = o);
129
- }, [o, t]), [o, s, r];
130
- }
131
- function z(e) {
132
- return typeof e == "function";
133
- }
134
- function T(e) {
135
- const [n, o] = i.useState(void 0);
136
- return C(() => {
137
- if (e) {
138
- o({ width: e.offsetWidth, height: e.offsetHeight });
139
- const s = new ResizeObserver((t) => {
140
- if (!Array.isArray(t) || !t.length)
141
- return;
142
- const r = t[0];
143
- let u, c;
144
- if ("borderBoxSize" in r) {
145
- const l = r.borderBoxSize, f = Array.isArray(l) ? l[0] : l;
146
- u = f.inlineSize, c = f.blockSize;
147
- } else
148
- u = e.offsetWidth, c = e.offsetHeight;
149
- o({ width: u, height: c });
150
- });
151
- return s.observe(e, { box: "border-box" }), () => s.unobserve(e);
152
- } else
153
- o(void 0);
154
- }, [e]), n;
155
- }
156
- // @__NO_SIDE_EFFECTS__
157
- function _(e) {
158
- const n = /* @__PURE__ */ O(e), o = i.forwardRef((s, t) => {
159
- const { children: r, ...u } = s, c = i.Children.toArray(r), l = c.find(N);
160
- if (l) {
161
- const f = l.props.children, d = c.map((a) => a === l ? i.Children.count(f) > 1 ? i.Children.only(null) : i.isValidElement(f) ? f.props.children : null : a);
162
- return /* @__PURE__ */ y(n, { ...u, ref: t, children: i.isValidElement(f) ? i.cloneElement(f, void 0, d) : null });
163
- }
164
- return /* @__PURE__ */ y(n, { ...u, ref: t, children: r });
165
- });
166
- return o.displayName = `${e}.Slot`, o;
167
- }
168
- // @__NO_SIDE_EFFECTS__
169
- function O(e) {
170
- const n = i.forwardRef((o, s) => {
171
- const { children: t, ...r } = o, u = i.isValidElement(t) ? I(t) : void 0, c = E(u, s);
172
- if (i.isValidElement(t)) {
173
- const l = D(r, t.props);
174
- return t.type !== i.Fragment && (l.ref = c), i.cloneElement(t, l);
175
- }
176
- return i.Children.count(t) > 1 ? i.Children.only(null) : null;
177
- });
178
- return n.displayName = `${e}.SlotClone`, n;
179
- }
180
- var A = Symbol("radix.slottable");
181
- function N(e) {
182
- return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === A;
183
- }
184
- function D(e, n) {
185
- const o = { ...n };
186
- for (const s in n) {
187
- const t = e[s], r = n[s];
188
- /^on[A-Z]/.test(s) ? t && r ? o[s] = (...c) => {
189
- const l = r(...c);
190
- return t(...c), l;
191
- } : t && (o[s] = t) : s === "style" ? o[s] = { ...t, ...r } : s === "className" && (o[s] = [t, r].filter(Boolean).join(" "));
192
- }
193
- return { ...e, ...o };
194
- }
195
- function I(e) {
196
- var s, t;
197
- let n = (s = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : s.get, o = n && "isReactWarning" in n && n.isReactWarning;
198
- return o ? e.ref : (n = (t = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : t.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
199
- }
200
- var V = [
201
- "a",
202
- "button",
203
- "div",
204
- "form",
205
- "h2",
206
- "h3",
207
- "img",
208
- "input",
209
- "label",
210
- "li",
211
- "nav",
212
- "ol",
213
- "p",
214
- "select",
215
- "span",
216
- "svg",
217
- "ul"
218
- ], F = V.reduce((e, n) => {
219
- const o = /* @__PURE__ */ _(`Primitive.${n}`), s = i.forwardRef((t, r) => {
220
- const { asChild: u, ...c } = t, l = u ? o : n;
221
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ y(l, { ...c, ref: r });
222
- });
223
- return s.displayName = `Primitive.${n}`, { ...e, [n]: s };
224
- }, {});
225
- function M(e, n) {
226
- e && w.flushSync(() => e.dispatchEvent(n));
227
- }
228
- export {
229
- F as P,
230
- C as a,
231
- _ as b,
232
- B as c,
233
- L as d,
234
- k as e,
235
- T as f,
236
- M as g,
237
- g as h,
238
- E as u
239
- };