xtreme-ui 0.0.122 → 0.0.123

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 (141) hide show
  1. package/dist/ActionCard-B8grjL52.js +26 -0
  2. package/dist/Avatar-soTst6QB.js +138 -0
  3. package/dist/Button-8OfYrlfv.js +20 -0
  4. package/dist/ColorPicker-DTlIMXCI.js +18 -0
  5. package/dist/ColorPopper-DD-LwyH4.js +208 -0
  6. package/dist/FilePicker-B0CAFe_F.js +77 -0
  7. package/dist/ImageEditor-CHAOpQQ3.js +57 -0
  8. package/dist/Navigation-CZ6ofO5o.js +33 -0
  9. package/dist/ProgressBar-BYsdT_xg.js +11 -0
  10. package/dist/Select-N5Uw9cYv.js +75 -0
  11. package/dist/Sider-WB4MCj13.js +34 -0
  12. package/dist/SiderModal-0iZz0k9s.js +25 -0
  13. package/dist/Spinner-DvZRWrE7.js +24 -0
  14. package/dist/Textfield-DD7cRuMt.js +93 -0
  15. package/dist/ThemePicker-CcMoStgj.js +57 -0
  16. package/dist/ThemeSelect-vklTxFpw.js +33 -0
  17. package/dist/ThemeSwitch-DEvhyHpt.js +57 -0
  18. package/dist/common-JWQuqtVw.js +4 -0
  19. package/dist/components/ActionCard/ActionCard.d.ts.map +1 -1
  20. package/dist/components/ActionCard/exports.d.ts +1 -1
  21. package/dist/components/ActionCard/exports.d.ts.map +1 -1
  22. package/dist/components/ActionCard/exports.js +6 -1
  23. package/dist/components/ActionCard/types.d.ts.map +1 -1
  24. package/dist/components/Avatar/Avatar.d.ts.map +1 -1
  25. package/dist/components/Avatar/exports.js +6 -1
  26. package/dist/components/Avatar/types.d.ts.map +1 -1
  27. package/dist/components/Button/Button.d.ts.map +1 -1
  28. package/dist/components/Button/exports.js +6 -1
  29. package/dist/components/Button/types.d.ts +2 -2
  30. package/dist/components/Button/types.d.ts.map +1 -1
  31. package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  32. package/dist/components/ColorPicker/exports.js +5 -1
  33. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  34. package/dist/components/ColorPopper/ColorPopper.d.ts +1 -1
  35. package/dist/components/ColorPopper/ColorPopper.d.ts.map +1 -1
  36. package/dist/components/ColorPopper/exports.js +5 -1
  37. package/dist/components/ColorPopper/types.d.ts +2 -2
  38. package/dist/components/ColorPopper/types.d.ts.map +1 -1
  39. package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
  40. package/dist/components/DatePicker/exports.js +6 -1
  41. package/dist/components/DatePicker/types.d.ts.map +1 -1
  42. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  43. package/dist/components/FilePicker/exports.d.ts +1 -1
  44. package/dist/components/FilePicker/exports.d.ts.map +1 -1
  45. package/dist/components/FilePicker/exports.js +6 -1
  46. package/dist/components/FilePicker/types.d.ts +1 -1
  47. package/dist/components/FilePicker/types.d.ts.map +1 -1
  48. package/dist/components/ImageEditor/ImageEditor.d.ts.map +1 -1
  49. package/dist/components/ImageEditor/exports.js +5 -1
  50. package/dist/components/ImageEditor/types.d.ts +1 -1
  51. package/dist/components/ImageEditor/types.d.ts.map +1 -1
  52. package/dist/components/Navigation/Navigation.d.ts.map +1 -1
  53. package/dist/components/Navigation/exports.js +5 -1
  54. package/dist/components/Navigation/types.d.ts.map +1 -1
  55. package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
  56. package/dist/components/ProgressBar/exports.js +5 -1
  57. package/dist/components/ProgressBar/types.d.ts.map +1 -1
  58. package/dist/components/Select/Select.d.ts.map +1 -1
  59. package/dist/components/Select/exports.js +5 -1
  60. package/dist/components/Select/types.d.ts +1 -1
  61. package/dist/components/Select/types.d.ts.map +1 -1
  62. package/dist/components/Sider/Sider.d.ts.map +1 -1
  63. package/dist/components/Sider/exports.d.ts +1 -1
  64. package/dist/components/Sider/exports.js +5 -1
  65. package/dist/components/Sider/types.d.ts.map +1 -1
  66. package/dist/components/SiderModal/SiderModal.d.ts.map +1 -1
  67. package/dist/components/SiderModal/exports.js +5 -1
  68. package/dist/components/SiderModal/types.d.ts.map +1 -1
  69. package/dist/components/Spinner/Spinner.d.ts.map +1 -1
  70. package/dist/components/Spinner/exports.js +6 -1
  71. package/dist/components/Spinner/types.d.ts.map +1 -1
  72. package/dist/components/Textfield/Textfield.d.ts.map +1 -1
  73. package/dist/components/Textfield/exports.js +5 -1
  74. package/dist/components/Textfield/types.d.ts +51 -51
  75. package/dist/components/Textfield/types.d.ts.map +1 -1
  76. package/dist/components/ThemePicker/ThemePicker.d.ts.map +1 -1
  77. package/dist/components/ThemePicker/exports.js +5 -1
  78. package/dist/components/ThemePicker/types.d.ts.map +1 -1
  79. package/dist/components/ThemeSelect/ThemeSelect.d.ts.map +1 -1
  80. package/dist/components/ThemeSelect/exports.js +5 -1
  81. package/dist/components/ThemeSelect/types.d.ts.map +1 -1
  82. package/dist/components/ThemeSwitch/ThemeSwitch.d.ts.map +1 -1
  83. package/dist/components/ThemeSwitch/exports.js +5 -1
  84. package/dist/components/ThemeSwitch/types.d.ts.map +1 -1
  85. package/dist/components/context/Data/DataContext.d.ts.map +1 -1
  86. package/dist/components/context/Data/types.d.ts.map +1 -1
  87. package/dist/components/context/Theme/ThemeContext.d.ts.map +1 -1
  88. package/dist/components/context/Theme/types.d.ts.map +1 -1
  89. package/dist/components/context/index.d.ts.map +1 -1
  90. package/dist/components/context/useContext.d.ts.map +1 -1
  91. package/dist/components/hooks/exports.d.ts +3 -3
  92. package/dist/components/hooks/exports.d.ts.map +1 -1
  93. package/dist/components/hooks/types.d.ts +1 -1
  94. package/dist/components/hooks/types.d.ts.map +1 -1
  95. package/dist/components/hooks/useDebouncedEffect.d.ts.map +1 -1
  96. package/dist/components/hooks/usePersistingState.d.ts.map +1 -1
  97. package/dist/components/hooks/useScreen.d.ts +1 -1
  98. package/dist/components/hooks/useScreen.d.ts.map +1 -1
  99. package/dist/imageHelper-VIHg_IWS.js +44 -0
  100. package/dist/index.d.ts +32 -31
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +182 -1
  103. package/dist/theme-ykEJBufR.js +28 -0
  104. package/dist/types-BZuGVOZ5.js +55 -0
  105. package/dist/useContext-J6sc--E9.js +47 -0
  106. package/dist/useScreen-W3HOVFnS.js +47 -0
  107. package/dist/utils/constants/theme.d.ts.map +1 -1
  108. package/dist/utils/function/common.d.ts.map +1 -1
  109. package/dist/utils/function/localStorage.d.ts.map +1 -1
  110. package/dist/utils/function/mergeRefs.d.ts.map +1 -1
  111. package/dist/utils/helper/colorHelper.d.ts.map +1 -1
  112. package/dist/utils/helper/domHelper.d.ts.map +1 -1
  113. package/dist/utils/helper/imageHelper.d.ts.map +1 -1
  114. package/dist/utils/helper/themeController.d.ts +1 -1
  115. package/dist/utils/helper/themeController.d.ts.map +1 -1
  116. package/dist/utils/index.d.ts +1 -1
  117. package/dist/utils/index.d.ts.map +1 -1
  118. package/package.json +7 -19
  119. package/dist/ActionCard-Dbpat8bm.js +0 -2
  120. package/dist/Avatar-DOT-ws0p.js +0 -1
  121. package/dist/Button-G6cDfQ_2.js +0 -1
  122. package/dist/ColorPicker-C3IR_ijV.js +0 -3
  123. package/dist/ColorPopper-vGesdoPl.js +0 -10
  124. package/dist/FilePicker-D6qHXAU3.js +0 -8
  125. package/dist/ImageEditor-CRdW3G_G.js +0 -7
  126. package/dist/Navigation-BqPe_bfy.js +0 -4
  127. package/dist/ProgressBar-CpCwJRLJ.js +0 -2
  128. package/dist/Select-uoCUlO9L.js +0 -3
  129. package/dist/Sider-S8lIHbaD.js +0 -5
  130. package/dist/SiderModal-DeoiKMZn.js +0 -9
  131. package/dist/Spinner-Bbm68b3W.js +0 -9
  132. package/dist/Textfield-D8sU99y0.js +0 -5
  133. package/dist/ThemePicker-DlxNjxb8.js +0 -13
  134. package/dist/ThemeSelect-Chl18N7X.js +0 -1
  135. package/dist/ThemeSwitch-TsIe8W8K.js +0 -2
  136. package/dist/common-Do6lufjP.js +0 -1
  137. package/dist/imageHelper-B5X4pOcS.js +0 -1
  138. package/dist/theme-BBSThvgw.js +0 -1
  139. package/dist/types-DA8XVLaK.js +0 -2
  140. package/dist/useContext-Dd-uQWg7.js +0 -2
  141. package/dist/useScreen-hc-uEMYs.js +0 -1
@@ -0,0 +1,26 @@
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import f from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import './ActionCard.css';var s = /* @__PURE__ */ ((r) => (r[r.mini = 100] = "mini", r[r.default = 164] = "default", r[r.large = 254] = "large", r))(s || {});
5
+ const p = n((r, e) => {
6
+ const { className: l, children: o, style: c = {}, size: a = "default", onClick: i } = r, t = Array.isArray(a) ? a : [s[a], s[a]], m = f("xtrActionCard", "shadowRipple", `${a}Size`, l);
7
+ return /* @__PURE__ */ d(
8
+ "footer",
9
+ {
10
+ ref: e,
11
+ className: m,
12
+ style: {
13
+ "--cardWidth": `${t[0]}px`,
14
+ "--cardHeight": `${t[1]}px`,
15
+ ...c
16
+ },
17
+ onClick: i,
18
+ children: o
19
+ }
20
+ );
21
+ });
22
+ p.displayName = "ActionCard";
23
+ export {
24
+ p as A,
25
+ s as E
26
+ };
@@ -0,0 +1,138 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import L from "clsx";
3
+ import { Icon as M } from "gliff";
4
+ import { forwardRef as R, useState as c, useEffect as T } from "react";
5
+ import { r as j, b as k } from "./imageHelper-VIHg_IWS.js";
6
+ import './Avatar.css';const i = {
7
+ happy: [
8
+ "f118",
9
+ "e392",
10
+ "f580",
11
+ "f5b8",
12
+ "e409",
13
+ "e3a4",
14
+ "e39d",
15
+ "f5c2",
16
+ "e398",
17
+ "e396",
18
+ "f4da",
19
+ "e391",
20
+ "e390",
21
+ "e38f",
22
+ "e38d",
23
+ "e389",
24
+ "e383",
25
+ "f59c",
26
+ "f59b",
27
+ "f59a",
28
+ "f599",
29
+ "f598",
30
+ "e37d",
31
+ "f597",
32
+ "f596",
33
+ "e379",
34
+ "f58c",
35
+ "f581",
36
+ "f58b",
37
+ "f58a",
38
+ "f589",
39
+ "f588",
40
+ "f587",
41
+ "f586",
42
+ "f585",
43
+ "f584",
44
+ "f583",
45
+ "f582",
46
+ "e377",
47
+ "f579",
48
+ "e2fe",
49
+ "e372",
50
+ "e36e",
51
+ "e47c",
52
+ "e36b",
53
+ "e368",
54
+ "f2fe"
55
+ ],
56
+ sad: [
57
+ "e3a0",
58
+ "e3a5",
59
+ "e3a3",
60
+ "e3a2",
61
+ "e3a1",
62
+ "e39f",
63
+ "f5c8",
64
+ "e485",
65
+ "e397",
66
+ "e395",
67
+ "e394",
68
+ "e393",
69
+ "e38b",
70
+ "f5b4",
71
+ "e38a",
72
+ "f5b3",
73
+ "f5a5",
74
+ "e388",
75
+ "e387",
76
+ "e386",
77
+ "e385",
78
+ "e384",
79
+ "e382",
80
+ "e380",
81
+ "e483",
82
+ "f5a4",
83
+ "f11a",
84
+ "e37c",
85
+ "e37b",
86
+ "e37a",
87
+ "e378",
88
+ "f57f",
89
+ "e376",
90
+ "f57a",
91
+ "f119",
92
+ "e375",
93
+ "e374",
94
+ "e373",
95
+ "e480",
96
+ "e371",
97
+ "e47f",
98
+ "f567",
99
+ "e36f",
100
+ "e47e",
101
+ "e36d",
102
+ "e36c",
103
+ "e47d",
104
+ "e36a",
105
+ "e369",
106
+ "f556",
107
+ "f6e2",
108
+ "f8f6",
109
+ "f54c"
110
+ ]
111
+ };
112
+ var h = /* @__PURE__ */ ((a) => (a[a.mini = 64] = "mini", a[a.default = 96] = "default", a[a.large = 128] = "large", a))(h || {});
113
+ const w = R((a, u) => {
114
+ const { className: b, src: f, file: o, alt: y, placeholderIcon: I, size: l = "default", onClick: x } = a, [m, d] = c(), [N, F] = c(i.happy[0]), [v, s] = c(!!f || !!o), [p, r] = c(!1), g = typeof l == "number" ? l : h[l], C = L("xtrAvatar", b, v && "loading", p && "error"), t = (e) => {
115
+ e && setTimeout(() => d(e), 300), setTimeout(() => s(!1), 1e3);
116
+ };
117
+ return T(() => {
118
+ F(i.happy[Math.floor(Math.random() * i.happy.length)]);
119
+ try {
120
+ o ? (s(!0), r(!1), j(o).then((e) => t(e)).catch((e) => {
121
+ console.log(e), s(!1), r(!0);
122
+ })) : f ? (s(!0), r(!1), k(f).then((e) => t(e)).catch((e) => {
123
+ console.log(e, f), s(!1), r(!0);
124
+ })) : (d(void 0), t());
125
+ } catch {
126
+ t();
127
+ }
128
+ }, [f, o]), /* @__PURE__ */ n("div", { ref: u, className: C, style: { "--avatarSize": `${g}px` }, onClick: x, role: "img", children: m ? (
129
+ // biome-ignore lint/performance/noImgElement: library component wrapping img
130
+ /* @__PURE__ */ n("img", { className: "image", src: m, alt: y })
131
+ ) : /* @__PURE__ */ n(M, { className: "placeholder", type: "solid", size: 8 + g / 4, code: p ? "e1b7" : I ?? N }) });
132
+ });
133
+ w.displayName = "Avatar";
134
+ export {
135
+ w as A,
136
+ h as E,
137
+ i as F
138
+ };
@@ -0,0 +1,20 @@
1
+ import { jsxs as N, jsx as n } from "react/jsx-runtime";
2
+ import k from "clsx";
3
+ import { Icon as x } from "gliff";
4
+ import { forwardRef as D } from "react";
5
+ import { P as b } from "./ProgressBar-BYsdT_xg.js";
6
+ import './Button.css';var t = /* @__PURE__ */ ((r) => (r.primary = "primary", r.primaryDanger = "primaryDanger", r.secondary = "secondary", r.secondaryDanger = "secondaryDanger", r.link = "link", r.linkDanger = "linkDanger", r))(t || {});
7
+ const h = D((r, m) => {
8
+ const { className: d, style: p = {}, label: a, type: i = "primary", size: l = "default", disabled: f = !1, loading: o = !1, icon: e, iconType: y, iconPosition: s = "left", onClick: g } = r, c = e ? /* @__PURE__ */ n(x, { className: "icon", code: e, type: y, size: l }) : null, u = k("xtrButton", "shadowRipple", `${i}Type`, `${l}Size`, !a && "iconOnly", o && "loading", d);
9
+ return !a && !e ? null : /* @__PURE__ */ N("button", { ref: m, className: u, style: p, onClick: g, disabled: f, children: [
10
+ i.includes(t.link) && /* @__PURE__ */ n(b, { className: "underline", intermediate: o }),
11
+ s === "left" && c,
12
+ a && /* @__PURE__ */ n("span", { className: "label", children: a }),
13
+ s === "right" && c
14
+ ] });
15
+ });
16
+ h.displayName = "Button";
17
+ export {
18
+ h as B,
19
+ t as E
20
+ };
@@ -0,0 +1,18 @@
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import p from "@uiw/react-color-alpha";
3
+ import C from "@uiw/react-color-shade-slider";
4
+ import d from "@uiw/react-color-wheel";
5
+ import f from "clsx";
6
+ import { forwardRef as x } from "react";
7
+ import './ColorPicker.css';const s = 180, N = x((l, h) => {
8
+ const { className: m, shade: t = !0, alpha: c = !0, color: o = { h: 0, s: 0, v: 100, a: 1 }, setColor: a } = l, i = f("xtrColorPicker", m);
9
+ return /* @__PURE__ */ n("div", { ref: h, className: i, children: [
10
+ /* @__PURE__ */ e(d, { className: "wheel", color: o, width: s, height: s, onChange: (r) => a(r.hsva) }),
11
+ t && /* @__PURE__ */ e(C, { className: "shade", hsva: o, onChange: ({ v: r }) => a({ ...o, v: r }) }),
12
+ c && /* @__PURE__ */ e(p, { className: "alpha", hsva: o, onChange: ({ a: r }) => a({ ...o, a: r }) })
13
+ ] });
14
+ });
15
+ N.displayName = "ColorPicker";
16
+ export {
17
+ N as C
18
+ };
@@ -0,0 +1,208 @@
1
+ import { jsxs as h, Fragment as ie, jsx as t } from "react/jsx-runtime";
2
+ import { useFloating as ae, autoUpdate as ce, shift as he, flip as de, offset as me, useTransitionStyles as pe, useInteractions as ue, useClick as fe, useDismiss as Ce } from "@floating-ui/react";
3
+ import x from "clsx";
4
+ import { colord as r, getFormat as ge } from "colord";
5
+ import { Icon as ve } from "gliff";
6
+ import { forwardRef as xe, useMemo as I, useState as y, useRef as ye, useEffect as j } from "react";
7
+ import { C as He } from "./ColorPicker-DTlIMXCI.js";
8
+ import { T as be } from "./Textfield-DD7cRuMt.js";
9
+ import { u as $e, g as Ne } from "./useScreen-W3HOVFnS.js";
10
+ import { T as Te } from "./theme-ykEJBufR.js";
11
+ import { B as E } from "./Button-8OfYrlfv.js";
12
+ import './ColorPopper.css';function Pe(s, l) {
13
+ if (typeof s == "function")
14
+ s(l);
15
+ else if (s != null)
16
+ try {
17
+ s.current = l;
18
+ } catch {
19
+ throw new Error(`Cannot assign value "${l}" to ref "${s}"`);
20
+ }
21
+ }
22
+ function we(s) {
23
+ return (l) => {
24
+ s.forEach((u) => Pe(u, l));
25
+ };
26
+ }
27
+ function z(s, l) {
28
+ const {
29
+ className: u,
30
+ popperClassName: A,
31
+ input: H = "textfield",
32
+ size: q = "default",
33
+ placeholder: D = "Color Picker",
34
+ colorHeading: f = "Pick color",
35
+ schemeHeading: F,
36
+ themeScheme: b,
37
+ setThemeScheme: U,
38
+ showReset: W = !0,
39
+ alpha: _,
40
+ shade: G,
41
+ swatch: $,
42
+ hideWheel: B = !1,
43
+ color: d,
44
+ setColor: C
45
+ } = s, J = $e(), n = I(() => r(d), []), g = I(() => ge(d), [d]), [N, m] = y(n.toHsv()), [i, p] = y(n.toHex()), [K, Q] = y(f), T = ye(!1), [L, P] = y(!1), { refs: w, floatingStyles: X, context: R } = ae({
46
+ open: L,
47
+ onOpenChange: P,
48
+ middleware: [he({ crossAxis: !0, padding: 18 }), de(), me(({ placement: e }) => e === "bottom" ? 10 : 16)],
49
+ whileElementsMounted: ce
50
+ }), { isMounted: Y, styles: Z } = pe(R, {
51
+ duration: 200,
52
+ initial: ({ side: e }) => ({
53
+ opacity: 0,
54
+ translate: e === "bottom" ? "0px 8px" : "0px -8px"
55
+ })
56
+ }), { getReferenceProps: V, getFloatingProps: ee } = ue([fe(R), Ce(R)]), [S, oe, k] = I(() => {
57
+ const e = r(N), o = e.toHsl(), a = n.toHsl();
58
+ return [
59
+ `${Math.round(o.h)} ${Math.round(o.s)}% ${Math.round(o.l)}%`,
60
+ `${Math.round(a.h)} ${Math.round(a.s)}% ${Math.round(a.l)}%`,
61
+ e.isLight() ? "black" : "white"
62
+ ];
63
+ }, [n, N]), te = i !== n.toHex(), M = H === "button" || H === "buttonLabel", v = (e) => {
64
+ T.current = !0, g === "rgb" ? C(e.toRgb()) : g === "hex" ? C(e.toHex()) : g === "hsl" ? C(e.toHsl()) : g === "hsv" && C(e.toHsv());
65
+ }, O = (e) => {
66
+ p(e);
67
+ const o = r(e);
68
+ o.isValid() && (m(o.toHsv()), v(o));
69
+ }, se = (e) => {
70
+ const o = r(e);
71
+ m(e), p(o.toHex()), v(o);
72
+ }, re = (e) => {
73
+ const o = r(e);
74
+ m(o.toHsv()), p(o.toHex()), v(o);
75
+ }, ne = () => {
76
+ m(n.toHsv()), p(n.toHex()), v(n);
77
+ };
78
+ return j(() => {
79
+ if (!T.current) {
80
+ const e = r(d);
81
+ m(e.toHsv()), p(e.toHex());
82
+ }
83
+ T.current = !1;
84
+ }, [d]), j(() => {
85
+ Q(Ne(r(i).toHsl()) ?? f);
86
+ }, [f, i]), /* @__PURE__ */ h(ie, { children: [
87
+ M ? /* @__PURE__ */ t(
88
+ E,
89
+ {
90
+ className: "xtrColorButton",
91
+ ref: w.setReference,
92
+ size: q,
93
+ icon: "f53f",
94
+ iconType: "solid",
95
+ label: H === "buttonLabel" ? i : void 0,
96
+ style: {
97
+ "--themeColor": S,
98
+ "--iconColor": k,
99
+ color: k
100
+ },
101
+ onClick: () => P(!0),
102
+ ...V()
103
+ }
104
+ ) : /* @__PURE__ */ t(
105
+ be,
106
+ {
107
+ className: x("xtrColorInput", u),
108
+ ref: w.setReference,
109
+ placeholder: D,
110
+ icon: "f53f",
111
+ iconType: "solid",
112
+ active: L,
113
+ value: i,
114
+ onChange: (e) => O(e.target.value),
115
+ style: {
116
+ "--colorBrandPrimary": S,
117
+ "--iconColor": k
118
+ },
119
+ onFocus: () => P(!0),
120
+ ...V()
121
+ }
122
+ ),
123
+ Y && /* @__PURE__ */ h(
124
+ "div",
125
+ {
126
+ ref: we([l, w.setFloating]),
127
+ className: x("xtrColorPopper", A),
128
+ style: { ...X, ...Z, "--colorBrandPrimary": S },
129
+ ...ee(),
130
+ children: [
131
+ ($ || !B) && /* @__PURE__ */ h("div", { className: x("header", M && "withInput"), children: [
132
+ /* @__PURE__ */ h("div", { className: "heading", children: [
133
+ /* @__PURE__ */ h("div", { children: [
134
+ /* @__PURE__ */ t("h1", { children: K }),
135
+ M && /* @__PURE__ */ t(
136
+ "input",
137
+ {
138
+ placeholder: "#Hex",
139
+ className: x("popperInput", u),
140
+ value: i,
141
+ autoFocus: J.isLargest,
142
+ onChange: (e) => O(e.target.value)
143
+ }
144
+ )
145
+ ] }),
146
+ /* @__PURE__ */ t("h1", { children: f })
147
+ ] }),
148
+ W && /* @__PURE__ */ t(
149
+ ve,
150
+ {
151
+ code: "f1da",
152
+ type: "solid",
153
+ style: {
154
+ "--colorBrandPrimary": oe,
155
+ visibility: te ? "visible" : "hidden"
156
+ },
157
+ onClick: ne
158
+ }
159
+ )
160
+ ] }),
161
+ $ && /* @__PURE__ */ t("div", { className: "swatch", children: $.map((e, o) => {
162
+ const a = r(i).isEqual(e), c = r(e).toHsl(), le = `${c.h} ${c.s}% ${c.l}%`;
163
+ return /* @__PURE__ */ t(
164
+ E,
165
+ {
166
+ className: "swatchItem",
167
+ icon: "f00c",
168
+ iconType: "solid",
169
+ size: "mini",
170
+ style: {
171
+ "--themeColor": le,
172
+ color: a ? "white" : "transparent"
173
+ },
174
+ onClick: () => re(c)
175
+ },
176
+ `ThemeColor-${c.h}${c.s}${c.l}-${o}`
177
+ );
178
+ }) }),
179
+ !B && /* @__PURE__ */ t(He, { className: "colorPicker", alpha: _, shade: G, color: N, setColor: se }),
180
+ F && /* @__PURE__ */ h("div", { className: "themeScheme", children: [
181
+ /* @__PURE__ */ t("div", { className: "header", children: /* @__PURE__ */ h("div", { className: "heading", children: [
182
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t("h1", { children: b }) }),
183
+ /* @__PURE__ */ t("h1", { children: F })
184
+ ] }) }),
185
+ /* @__PURE__ */ t("div", { className: "schemeSelector", children: Te.map(({ name: e, icon: o }, a) => /* @__PURE__ */ t(
186
+ E,
187
+ {
188
+ icon: o,
189
+ iconType: "solid",
190
+ disabled: b === e,
191
+ type: b === e ? "primary" : "secondary",
192
+ onClick: () => U?.(e)
193
+ },
194
+ `ThemeScheme-${e}-${a}`
195
+ )) })
196
+ ] })
197
+ ]
198
+ }
199
+ )
200
+ ] });
201
+ }
202
+ const je = xe(z);
203
+ z.displayName = "ColorPopper";
204
+ export {
205
+ je as C,
206
+ Pe as a,
207
+ we as m
208
+ };
@@ -0,0 +1,77 @@
1
+ import { jsxs as d, Fragment as h, jsx as s } from "react/jsx-runtime";
2
+ import C from "clsx";
3
+ import { Icon as P } from "gliff";
4
+ import { createPortal as F } from "react-dom";
5
+ import { useFilePicker as j } from "use-file-picker";
6
+ import { I as x } from "./ImageEditor-CHAOpQQ3.js";
7
+ import { B as E } from "./Button-8OfYrlfv.js";
8
+ import './FilePicker.css';const v = ["jpg", "jpeg", "png", "gif", ".bmp", "webp", "heif", "heic"], l = {
9
+ file: "f15b",
10
+ multimedia: "f86d",
11
+ image: "f1c5",
12
+ jpg: "e646",
13
+ jpeg: "e646",
14
+ png: "e666",
15
+ gif: "e645",
16
+ svg: "e64b",
17
+ eps: "e644",
18
+ audio: "f1c7",
19
+ mp3: "e648",
20
+ wav: "f478",
21
+ video: "f1c8",
22
+ mp4: "e649",
23
+ mov: "e647",
24
+ pdf: "f1c1",
25
+ doc: "e5ed",
26
+ docx: "e5ed",
27
+ xls: "e64d",
28
+ xlsx: "e64d",
29
+ ppt: "e64a",
30
+ pptx: "e64a",
31
+ csv: "f6dd",
32
+ html: "f1c9",
33
+ zip: "e5ee",
34
+ rar: "f1c6",
35
+ "7z": "f1c6"
36
+ }, I = (e = "") => {
37
+ if (e.includes(",") && e.includes("/")) {
38
+ let i = 0;
39
+ if (e.split(",").map((n) => n.split("/")?.[0]).forEach((n) => {
40
+ n in l && i++;
41
+ }), i > 0) return l.multimedia;
42
+ }
43
+ if (e.includes("/")) {
44
+ const [i, r] = e.split("/");
45
+ if (r in l) return l[r];
46
+ if (i in l) return l[i];
47
+ }
48
+ const c = e.includes(",") ? e.split(",")?.[0]?.replace(".", "") : e.replace(".", "");
49
+ return c in l ? l[c] : l.file;
50
+ }, H = (e) => {
51
+ const { className: c, children: i, draggable: r = !1, editable: n = !1, multiple: t = !1, accept: a = "*/*", onChange: m } = e, p = n && !t && (a.includes("image") || v.includes(a?.split?.(",")?.[0]?.replace(".", ""))), { openFilePicker: g, loading: k, plainFiles: f, clear: b } = j({
52
+ accept: a,
53
+ multiple: t,
54
+ onFilesSuccessfullySelected: ({ plainFiles: o }) => {
55
+ p || m(o);
56
+ }
57
+ }), u = C("xtrFilePicker", i && "wrapper", r && "draggable", c);
58
+ return i ? /* @__PURE__ */ d(h, { children: [
59
+ /* @__PURE__ */ s("div", { className: u, onClick: g, children: i }),
60
+ p && f?.[0] && F(/* @__PURE__ */ s(x, { file: f?.[0], clearFile: b, onChange: (o) => m(o.blob ? [o.blob] : []) }), document.body)
61
+ ] }) : r ? /* @__PURE__ */ d("div", { className: u, onClick: g, children: [
62
+ /* @__PURE__ */ s(P, { code: "f0ed", set: "duotone", size: 64 }),
63
+ /* @__PURE__ */ d("h2", { children: [
64
+ "Drop File",
65
+ t ? "s" : "",
66
+ " Here"
67
+ ] }),
68
+ /* @__PURE__ */ s("p", { children: "or click here to open file chooser" })
69
+ ] }) : /* @__PURE__ */ d(h, { children: [
70
+ /* @__PURE__ */ s(E, { className: u, label: `Choose File${t ? "s" : ""}`, icon: I(a), onClick: g, loading: k }),
71
+ p && f?.[0] && F(/* @__PURE__ */ s(x, { file: f?.[0], clearFile: b, onChange: (o) => m(o.blob ? [o.blob] : []) }), document.body)
72
+ ] });
73
+ };
74
+ export {
75
+ H as F,
76
+ l as a
77
+ };
@@ -0,0 +1,57 @@
1
+ import { jsxs as h, jsx as o } from "react/jsx-runtime";
2
+ import Z from "clsx";
3
+ import { Icon as n } from "gliff";
4
+ import { useState as t, useCallback as b, useEffect as j } from "react";
5
+ import A from "react-easy-crop";
6
+ import { S as R } from "./Spinner-DvZRWrE7.js";
7
+ import { r as $, g as _, a as q } from "./imageHelper-VIHg_IWS.js";
8
+ import './ImageEditor.css';const S = 1, Q = (x) => {
9
+ const { className: y, file: r, clearFile: m, minImageSize: a, cropShape: k = "round", aspect: z = 1, zoomSpeed: v = 1, onChange: w } = x, [l, d] = t(), [E, p] = t(!0), [F, g] = t(S), [L, f] = t({ x: 0, y: 0 }), [C, i] = t(0), [M, u] = t(), N = Z("xtrImageEditor", y), P = async () => {
10
+ try {
11
+ const e = await q(l, M, C);
12
+ e && w(e);
13
+ } catch (e) {
14
+ console.error(e);
15
+ }
16
+ s();
17
+ }, s = b(() => {
18
+ d(void 0), f({ x: 0, y: 0 }), g(S), i(0), u(void 0), m?.(), p(!0);
19
+ }, [m]);
20
+ return j(() => {
21
+ (async () => {
22
+ if (!r) return;
23
+ const c = await $(r), I = await _(c);
24
+ if (a && Math.min(I.width, I.height) < a)
25
+ return s(), console.log(`Image should be at least ${a}x${a}`);
26
+ d(c);
27
+ })();
28
+ }, [s, r, a]), r ? /* @__PURE__ */ h("div", { className: N, children: [
29
+ /* @__PURE__ */ o(
30
+ A,
31
+ {
32
+ image: l,
33
+ onMediaLoaded: () => p(!1),
34
+ cropShape: k,
35
+ aspect: z,
36
+ zoom: F,
37
+ zoomSpeed: v,
38
+ onZoomChange: g,
39
+ rotation: C,
40
+ onRotationChange: i,
41
+ crop: L,
42
+ onCropChange: f,
43
+ onCropComplete: (e, c) => u(c)
44
+ }
45
+ ),
46
+ /* @__PURE__ */ h("div", { className: "editorControls", children: [
47
+ /* @__PURE__ */ o(n, { code: "f00d", type: "solid", onClick: s }),
48
+ /* @__PURE__ */ o(n, { code: "f2ea", type: "solid", onClick: () => i((e) => e - 90) }),
49
+ /* @__PURE__ */ o(n, { code: "f2f9", type: "solid", onClick: () => i((e) => e + 90) }),
50
+ /* @__PURE__ */ o(n, { code: "f00c", type: "solid", onClick: P })
51
+ ] }),
52
+ E && /* @__PURE__ */ o(R, { fullpage: !0 })
53
+ ] }) : null;
54
+ };
55
+ export {
56
+ Q as I
57
+ };
@@ -0,0 +1,33 @@
1
+ import { jsxs as o, jsx as s } from "react/jsx-runtime";
2
+ import r from "clsx";
3
+ import { Icon as v } from "gliff";
4
+ import { forwardRef as g, useState as x, useEffect as b } from "react";
5
+ import './Navigation.css';const j = g((c, t) => {
6
+ const { className: l, children: m, hrefPropName: f = "href", routes: d = [], pathname: e = "", as: h = "a" } = c, [i, n] = x("/"), N = r("xtrNavigation", l);
7
+ return b(() => {
8
+ i === e && n("/");
9
+ }, [i, e]), /* @__PURE__ */ o("nav", { ref: t, className: N, children: [
10
+ /* @__PURE__ */ s("div", { className: "brand", children: m }),
11
+ /* @__PURE__ */ s("div", { className: "routeList", children: d.map((a, p) => /* @__PURE__ */ o(
12
+ h,
13
+ {
14
+ className: r("route", a?.href === i && "loading", a?.href === e && "active"),
15
+ [f]: a?.href,
16
+ onClick: () => {
17
+ setTimeout(() => {
18
+ i !== e && n(a?.href);
19
+ }, 150);
20
+ },
21
+ children: [
22
+ a?.icon && /* @__PURE__ */ s(v, { code: a?.icon, set: a?.href === e ? "duotone" : void 0, type: a?.href === e ? void 0 : "light" }),
23
+ /* @__PURE__ */ s("span", { className: "label", children: a?.name })
24
+ ]
25
+ },
26
+ `route-${a?.href}-${p}`
27
+ )) })
28
+ ] });
29
+ });
30
+ j.displayName = "Navigation";
31
+ export {
32
+ j as N
33
+ };
@@ -0,0 +1,11 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import l from "clsx";
3
+ import { forwardRef as n } from "react";
4
+ import './ProgressBar.css';const p = n((e, a) => {
5
+ const { className: o, progress: t = 100, intermediate: r = !1 } = e, m = r ? 150 : Math.min(Math.max(t, 0), 100), i = l("xtrProgressBar", r && "intermediate", o);
6
+ return /* @__PURE__ */ s("div", { ref: a, className: i, role: "progressbar", children: /* @__PURE__ */ s("span", { className: "progress", style: { width: `${m}%` } }) });
7
+ });
8
+ p.displayName = "ProgressBar";
9
+ export {
10
+ p as P
11
+ };
@@ -0,0 +1,75 @@
1
+ import { jsxs as O, jsx as c } from "react/jsx-runtime";
2
+ import j from "clsx";
3
+ import { Icon as y } from "gliff";
4
+ import { useId as z, useState as H, useMemo as q } from "react";
5
+ import w from "react-select";
6
+ import { i as h } from "./common-JWQuqtVw.js";
7
+ import './Select.css';function W(S) {
8
+ const {
9
+ className: v,
10
+ multi: e = !1,
11
+ placeholder: n = "Select an option",
12
+ noOptionsMessage: x,
13
+ icon: t,
14
+ size: i = "default",
15
+ iconType: g = "regular",
16
+ clearable: b = !0,
17
+ searchable: u = !0,
18
+ disabled: C = !1,
19
+ loading: N = !1,
20
+ options: s,
21
+ value: o,
22
+ onChange: m
23
+ } = S, p = z(), [f, d] = H(!1), I = q(() => {
24
+ if (e) {
25
+ const l = o ?? [];
26
+ return s.filter((a) => l.some((r) => h(a.value, r)));
27
+ } else
28
+ return s.find((l) => h(l.value, o)) || null;
29
+ }, [e, s, o]), M = j(
30
+ "xtrSelectWrapper",
31
+ i && `${i}Size`,
32
+ e ? "multi" : "single",
33
+ t && "withIcon",
34
+ !!o && "withValue",
35
+ f && "open",
36
+ !u && "noSearch",
37
+ v
38
+ );
39
+ return /* @__PURE__ */ O("div", { className: M, children: [
40
+ /* @__PURE__ */ c(
41
+ w,
42
+ {
43
+ className: "xtrSelect",
44
+ classNamePrefix: "xtrSelect",
45
+ id: p,
46
+ isMulti: e,
47
+ menuIsOpen: f,
48
+ onMenuOpen: () => d(!0),
49
+ onMenuClose: () => d(!1),
50
+ noOptionsMessage: x,
51
+ placeholder: n,
52
+ isClearable: b,
53
+ isSearchable: u,
54
+ isDisabled: C,
55
+ isLoading: N,
56
+ options: s,
57
+ value: I,
58
+ onChange: (l) => {
59
+ if (e) {
60
+ const a = l?.map((r) => r.value) ?? [];
61
+ m(a);
62
+ } else {
63
+ const a = l?.value ?? null;
64
+ m(a);
65
+ }
66
+ }
67
+ }
68
+ ),
69
+ n && !e && /* @__PURE__ */ c("label", { className: "placeholder", htmlFor: p, children: n }),
70
+ t && /* @__PURE__ */ c(y, { className: "xtrSelectIcon", code: t, type: g })
71
+ ] });
72
+ }
73
+ export {
74
+ W as S
75
+ };