@janbox/storefront-builder 2.0.1 → 2.0.2
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/README.md +2 -2
- package/dist/anchor-target-CtXzdkBu.js +2918 -0
- package/dist/{color-picker-popover-B3AVFuei.js → color-picker-popover-XeaVfYS8.js} +104 -80
- package/dist/countdown-timer.node-Bh5fTSJ8.js +913 -0
- package/dist/date-picker-D9K6HWl-.js +157 -0
- package/dist/{dialog-header-DPLOS7TT.js → dialog-header-Bh3Dkw2q.js} +2440 -2122
- package/dist/dropzone-CF4CWXth.js +546 -0
- package/dist/editor/toolbars.js +171 -161
- package/dist/editor/ui/button-group/button-group.d.ts +1 -1
- package/dist/editor/ui/dialog/dialog-body/dialog-body.d.ts +1 -1
- package/dist/editor/ui/form-label/form-label.d.ts +1 -1
- package/dist/editor/ui/input/input.d.ts +1 -2
- package/dist/editor/ui/loading-overlay/loading-overlay.d.ts +1 -1
- package/dist/editor/ui/popover/popover-close.d.ts +1 -1
- package/dist/editor/ui/tabs/tab-content.d.ts +1 -1
- package/dist/editor/ui/tabs/tab-list.d.ts +2 -4
- package/dist/editor/ui/tabs/tab-panel.d.ts +1 -1
- package/dist/editor/ui/tabs/tab.d.ts +2 -5
- package/dist/editor/ui/tabs/tabs.d.ts +1 -1
- package/dist/editor/ui.js +82 -72
- package/dist/editor.js +822 -586
- package/dist/index-800HnUOi.js +4 -0
- package/dist/{index-CwrFnubn.js → index-CXyljfMv.js} +1729 -1584
- package/dist/index.js +287 -247
- package/dist/style.css +1 -1
- package/dist/templates.js +10 -12
- package/dist/theme/index.d.ts +293 -0
- package/dist/tooltip-CXOlTkGg.js +75 -0
- package/dist/utils/common.d.ts +0 -2
- package/package.json +1 -2
- package/dist/anchor-target-BlOvysAr.js +0 -2329
- package/dist/countdown-timer.node-OmDiT-pz.js +0 -825
- package/dist/date-picker-B4Rju7gG.js +0 -115
- package/dist/dropzone-Dbfed3jK.js +0 -490
- package/dist/index-BbiQ0n_-.js +0 -4
- package/dist/tooltip-KbIHELP2.js +0 -65
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { jsxs as c, jsx as t } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { Fragment as $ } from "react";
|
|
3
|
-
import "react-datepicker/dist/react-datepicker.css";
|
|
4
|
-
import { useFloating as B, autoUpdate as E, flip as U, offset as Z, size as _, useClick as A, useDismiss as G, useRole as L, useInteractions as X, FloatingPortal as q } from "@floating-ui/react";
|
|
5
|
-
import { FLOATING_Z_INDEX as u } from "@janbox/storefront-ui/theme";
|
|
6
|
-
import { isUndefined as J } from "lodash-es";
|
|
7
|
-
import { DatePicker as K } from "react-datepicker";
|
|
8
|
-
import { W as Q, c as Y } from "./dialog-header-DPLOS7TT.js";
|
|
9
|
-
import { useControllableState as p } from "@janbox/storefront-ui/hooks";
|
|
10
|
-
const ee = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
11
|
-
<path d="M16 2V6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
12
|
-
<path d="M8 2V6" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
13
|
-
<path d="M3 9H21" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
14
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 4H5C3.895 4 3 4.895 3 6V19C3 20.105 3.895 21 5 21H19C20.105 21 21 20.105 21 19V6C21 4.895 20.105 4 19 4Z" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
15
|
-
<path d="M7.01304 12.729C6.87504 12.729 6.76304 12.841 6.76404 12.979C6.76404 13.117 6.87604 13.229 7.01404 13.229C7.15204 13.229 7.26404 13.117 7.26404 12.979C7.26404 12.841 7.15204 12.729 7.01304 12.729" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
16
|
-
<path d="M12.013 12.729C11.875 12.729 11.763 12.841 11.764 12.979C11.764 13.117 11.876 13.229 12.014 13.229C12.152 13.229 12.264 13.117 12.264 12.979C12.264 12.841 12.152 12.729 12.013 12.729" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
17
|
-
<path d="M17.013 12.729C16.875 12.729 16.763 12.841 16.764 12.979C16.764 13.117 16.876 13.229 17.014 13.229C17.152 13.229 17.264 13.117 17.264 12.979C17.264 12.841 17.152 12.729 17.013 12.729" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
18
|
-
<path d="M7.01304 16.729C6.87504 16.729 6.76304 16.841 6.76404 16.979C6.76404 17.117 6.87604 17.229 7.01404 17.229C7.15204 17.229 7.26404 17.117 7.26404 16.979C7.26404 16.841 7.15204 16.729 7.01304 16.729" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
19
|
-
<path d="M12.013 16.729C11.875 16.729 11.763 16.841 11.764 16.979C11.764 17.117 11.876 17.229 12.014 17.229C12.152 17.229 12.264 17.117 12.264 16.979C12.264 16.841 12.152 16.729 12.013 16.729" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
20
|
-
</svg>
|
|
21
|
-
`, ce = (h) => {
|
|
22
|
-
const {
|
|
23
|
-
placement: w = "bottom",
|
|
24
|
-
contentWidth: l,
|
|
25
|
-
open: f,
|
|
26
|
-
onOpenChange: C,
|
|
27
|
-
dissmiss: k,
|
|
28
|
-
value: m,
|
|
29
|
-
defaultValue: g,
|
|
30
|
-
onChange: x,
|
|
31
|
-
placeholder: v,
|
|
32
|
-
referenceProps: a,
|
|
33
|
-
prefix: b,
|
|
34
|
-
suffix: j,
|
|
35
|
-
size: y = "32",
|
|
36
|
-
showTimeInput: M = !0,
|
|
37
|
-
...I
|
|
38
|
-
} = h, [r, V] = p({
|
|
39
|
-
defaultValue: g,
|
|
40
|
-
value: m
|
|
41
|
-
}), [s, F] = p({
|
|
42
|
-
defaultValue: !1,
|
|
43
|
-
value: f
|
|
44
|
-
}), N = (e, n, o) => {
|
|
45
|
-
!e && !o || (F(e), C?.(e, n, o));
|
|
46
|
-
}, { refs: d, floatingStyles: O, context: i } = B({
|
|
47
|
-
open: s,
|
|
48
|
-
onOpenChange: N,
|
|
49
|
-
placement: w,
|
|
50
|
-
middleware: [
|
|
51
|
-
U(),
|
|
52
|
-
Z(4),
|
|
53
|
-
_({
|
|
54
|
-
apply({ elements: e }) {
|
|
55
|
-
const { width: n } = e.reference.getBoundingClientRect(), o = l === "fit-parent" ? n : l, T = {
|
|
56
|
-
minWidth: `${o ?? n}px`,
|
|
57
|
-
width: J(o) ? o : `${o}px`,
|
|
58
|
-
zIndex: u
|
|
59
|
-
};
|
|
60
|
-
Object.assign(e.floating.style, T);
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
],
|
|
64
|
-
whileElementsMounted: E
|
|
65
|
-
}), W = A(i), z = G(i, k), D = L(i), { getReferenceProps: P, getFloatingProps: R } = X([W, z, D]), S = {
|
|
66
|
-
height: Number(y)
|
|
67
|
-
}, H = (e) => {
|
|
68
|
-
e && (V(e), x?.(e));
|
|
69
|
-
};
|
|
70
|
-
return /* @__PURE__ */ c($, { children: [
|
|
71
|
-
/* @__PURE__ */ c(
|
|
72
|
-
"button",
|
|
73
|
-
{
|
|
74
|
-
css: S,
|
|
75
|
-
...I,
|
|
76
|
-
...P({
|
|
77
|
-
...a,
|
|
78
|
-
className: Y(
|
|
79
|
-
"tw:rounded-lg tw:overflow-hidden tw:bg-ic-white-1s tw:inline-flex tw:items-center tw:gap-2 tw:relative tw:text-xs tw:px-2 tw:text-ic-white-6s",
|
|
80
|
-
"tw:after:absolute tw:after:content-empty tw:after:inset-0 tw:after:pointer-events-none tw:after:rounded-lg tw:after:border tw:after:border-transparent",
|
|
81
|
-
{
|
|
82
|
-
"tw:after:border-ic-white-1s tw:bg-ic-black-7s": s
|
|
83
|
-
},
|
|
84
|
-
a?.className
|
|
85
|
-
)
|
|
86
|
-
}),
|
|
87
|
-
ref: d.setReference,
|
|
88
|
-
children: [
|
|
89
|
-
b,
|
|
90
|
-
/* @__PURE__ */ t("div", { className: "tw:flex-1 tw:text-left tw:truncate", children: r ? /* @__PURE__ */ t("span", { children: new Intl.DateTimeFormat(void 0, {
|
|
91
|
-
dateStyle: "short",
|
|
92
|
-
timeStyle: "short",
|
|
93
|
-
hour12: !1
|
|
94
|
-
}).format(r) }) : /* @__PURE__ */ t("span", { children: v }) }),
|
|
95
|
-
j ?? /* @__PURE__ */ t(Q, { source: ee, size: 16 })
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
),
|
|
99
|
-
s && /* @__PURE__ */ t(q, { root: document.body, children: /* @__PURE__ */ t(
|
|
100
|
-
"div",
|
|
101
|
-
{
|
|
102
|
-
ref: d.setFloating,
|
|
103
|
-
style: {
|
|
104
|
-
...O,
|
|
105
|
-
zIndex: u
|
|
106
|
-
},
|
|
107
|
-
...R(),
|
|
108
|
-
children: /* @__PURE__ */ t("div", { className: "tw:focus-visible:outline-none tw:rounded-lg tw:animate-fade tw:animate-duration-300 tw:text-xs", children: /* @__PURE__ */ t(K, { showTimeInput: M, selected: r, onChange: H, inline: !0 }) })
|
|
109
|
-
}
|
|
110
|
-
) })
|
|
111
|
-
] });
|
|
112
|
-
};
|
|
113
|
-
export {
|
|
114
|
-
ce as W
|
|
115
|
-
};
|
|
@@ -1,490 +0,0 @@
|
|
|
1
|
-
import { jsx as n, jsxs as k, Fragment as q } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { Children as R, isValidElement as z, cloneElement as J, useRef as j, useEffect as Ce, useMemo as B, useCallback as X, Fragment as ye } from "react";
|
|
3
|
-
import { isNumber as ke, isNil as F, merge as Ie, isUndefined as Q, get as _ } from "lodash-es";
|
|
4
|
-
import { c as g, m as ee, l as K, W as O, P as Ve, M as We, A as Ee, B as Se, D as te, E as Ae, F as Oe, L as Te } from "./dialog-header-DPLOS7TT.js";
|
|
5
|
-
import { useControllableState as V } from "@janbox/storefront-ui/hooks";
|
|
6
|
-
import { useMergeRefs as H, useFloating as ne, autoUpdate as se, offset as re, flip as oe, size as ae, useClick as ie, useHover as Pe, safePolygon as Me, useDismiss as le, useRole as ce, useInteractions as ue, useFloatingParentNodeId as Fe, FloatingTree as Re, FloatingPortal as ze } from "@floating-ui/react";
|
|
7
|
-
import { useUpdateEffect as Le } from "react-use";
|
|
8
|
-
import { FLOATING_Z_INDEX as $ } from "@janbox/storefront-ui/theme";
|
|
9
|
-
import { useVirtualizer as De } from "@tanstack/react-virtual";
|
|
10
|
-
import { OverlayScrollbarsComponent as _e } from "overlayscrollbars-react";
|
|
11
|
-
import { useDropzone as $e } from "react-dropzone";
|
|
12
|
-
const ct = ({
|
|
13
|
-
children: e,
|
|
14
|
-
defaultValue: o,
|
|
15
|
-
value: s,
|
|
16
|
-
onSelectionChange: i,
|
|
17
|
-
className: u,
|
|
18
|
-
...t
|
|
19
|
-
}) => {
|
|
20
|
-
const [a, d] = V({
|
|
21
|
-
defaultValue: o ?? null,
|
|
22
|
-
value: s
|
|
23
|
-
}), l = R.toArray(e).filter(
|
|
24
|
-
(m) => z(m)
|
|
25
|
-
), c = (m) => {
|
|
26
|
-
const f = m.currentTarget.value;
|
|
27
|
-
f !== a && (d(f), i?.(f, m));
|
|
28
|
-
};
|
|
29
|
-
return /* @__PURE__ */ n("div", { className: g("tw:p-1 tw:flex tw:items-center tw:gap-2 tw:bg-ic-white-1s tw:rounded-lg", u), ...t, children: l.map(
|
|
30
|
-
(m) => J(m, {
|
|
31
|
-
onClick(f) {
|
|
32
|
-
c(f), m.props.onClick?.(f);
|
|
33
|
-
},
|
|
34
|
-
className: g(
|
|
35
|
-
"tw:text-ic-white-4s",
|
|
36
|
-
{
|
|
37
|
-
"tw:bg-ic-black-7s tw:hover:bg-ic-black-7s tw:text-ic-white-6s": m.props.value?.toString() === a
|
|
38
|
-
},
|
|
39
|
-
m.props.className
|
|
40
|
-
)
|
|
41
|
-
})
|
|
42
|
-
) });
|
|
43
|
-
}, Z = 10, ut = ({
|
|
44
|
-
min: e = 0,
|
|
45
|
-
max: o = Number.MAX_SAFE_INTEGER,
|
|
46
|
-
fractionDigits: s = 0,
|
|
47
|
-
value: i,
|
|
48
|
-
defaultValue: u,
|
|
49
|
-
step: t = 0,
|
|
50
|
-
ref: a,
|
|
51
|
-
...d
|
|
52
|
-
}) => {
|
|
53
|
-
const l = j(null), [c, m] = V({
|
|
54
|
-
value: i?.toString(),
|
|
55
|
-
defaultValue: u?.toString() ?? ""
|
|
56
|
-
}), f = parseFloat(c), v = H([a, l]), h = typeof s == "number" ? s : Z, W = (r) => {
|
|
57
|
-
if (r = r.replace(/e|E/g, ""), e >= 0 && (r = r.replace(/^-/, "")), s === 0)
|
|
58
|
-
r = r.replace(/\.\d+$/, "");
|
|
59
|
-
else {
|
|
60
|
-
const b = r.split(".");
|
|
61
|
-
if (b.length > 1) {
|
|
62
|
-
const p = b.at(1)?.slice(0, Math.min(h, Z));
|
|
63
|
-
r = `${b.at(0)}.${p}`;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return d.transform?.(r) ?? r;
|
|
67
|
-
}, E = (r) => {
|
|
68
|
-
d.mode === "onBlur" && r.target.valueAsNumber < e && (r.target.value = e.toString()), m(r.target.value), d.onChange?.(r);
|
|
69
|
-
}, S = (r) => {
|
|
70
|
-
(r.key === "e" || r.key === "E") && r.preventDefault(), d.onKeyDown?.(r);
|
|
71
|
-
}, I = (r) => {
|
|
72
|
-
if (!l.current) return;
|
|
73
|
-
Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set?.call(l.current, r);
|
|
74
|
-
const p = new Event("input", { bubbles: !0 });
|
|
75
|
-
l.current.dispatchEvent(p);
|
|
76
|
-
}, N = (r) => {
|
|
77
|
-
const b = l.current;
|
|
78
|
-
if (F(b)) return;
|
|
79
|
-
const p = b.valueAsNumber, y = Math.min(isNaN(p) ? e + t : p + t, o);
|
|
80
|
-
p !== y && I(y.toString());
|
|
81
|
-
}, A = (r) => {
|
|
82
|
-
const b = l.current;
|
|
83
|
-
if (F(b)) return;
|
|
84
|
-
const p = b.valueAsNumber, y = Math.max(isNaN(p) ? e : p - t, e);
|
|
85
|
-
p !== y && I(y.toString());
|
|
86
|
-
};
|
|
87
|
-
return /* @__PURE__ */ n(
|
|
88
|
-
ee,
|
|
89
|
-
{
|
|
90
|
-
...d,
|
|
91
|
-
css: {
|
|
92
|
-
"::-webkit-outer-spin-button": {
|
|
93
|
-
margin: 0,
|
|
94
|
-
WebkitAppearance: "none"
|
|
95
|
-
},
|
|
96
|
-
"::-webkit-inner-spin-button": {
|
|
97
|
-
WebkitAppearance: "none",
|
|
98
|
-
margin: 0
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
prefix: d.prefix ?? (t > 0 ? /* @__PURE__ */ n(
|
|
102
|
-
K,
|
|
103
|
-
{
|
|
104
|
-
disabled: ke(i) && i <= e,
|
|
105
|
-
onClick: A,
|
|
106
|
-
"aria-disabled": isNaN(f) ? !1 : f >= o,
|
|
107
|
-
children: /* @__PURE__ */ n(O, { source: We })
|
|
108
|
-
}
|
|
109
|
-
) : null),
|
|
110
|
-
suffix: d.suffix ?? (t > 0 ? /* @__PURE__ */ n(K, { onClick: N, "aria-disabled": isNaN(f) ? !1 : f <= e, children: /* @__PURE__ */ n(O, { source: Ve }) }) : null),
|
|
111
|
-
type: "number",
|
|
112
|
-
value: c,
|
|
113
|
-
onChange: E,
|
|
114
|
-
transform: W,
|
|
115
|
-
ref: v,
|
|
116
|
-
onKeyDown: S
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
}, dt = ({ event: e = "click", reason: o, className: s, ref: i, ...u }) => {
|
|
120
|
-
const t = j(null), {
|
|
121
|
-
context: { onOpenChange: a }
|
|
122
|
-
} = Ee(), d = H([i, t]);
|
|
123
|
-
return Ce(() => {
|
|
124
|
-
const l = t.current;
|
|
125
|
-
if (!l) return;
|
|
126
|
-
const c = function(m) {
|
|
127
|
-
a?.(!1, m, o);
|
|
128
|
-
};
|
|
129
|
-
return l.addEventListener(e, c), () => {
|
|
130
|
-
l.removeEventListener(e, c);
|
|
131
|
-
};
|
|
132
|
-
}, [e, a, o]), /* @__PURE__ */ n("div", { className: g("tw:contents", s), ...u, ref: d });
|
|
133
|
-
}, Y = ({
|
|
134
|
-
open: e,
|
|
135
|
-
placement: o = "bottom",
|
|
136
|
-
onOpenChange: s,
|
|
137
|
-
dissmiss: i,
|
|
138
|
-
children: u,
|
|
139
|
-
reference: t,
|
|
140
|
-
trigger: a = "click",
|
|
141
|
-
offset: d = 4
|
|
142
|
-
}) => {
|
|
143
|
-
const [l, c] = V({
|
|
144
|
-
defaultValue: !1,
|
|
145
|
-
value: e
|
|
146
|
-
}), f = ne({
|
|
147
|
-
open: l,
|
|
148
|
-
onOpenChange: (r, b, p) => {
|
|
149
|
-
c(r), s?.(r, b, p);
|
|
150
|
-
},
|
|
151
|
-
placement: o,
|
|
152
|
-
middleware: [
|
|
153
|
-
re(d),
|
|
154
|
-
oe(),
|
|
155
|
-
ae({
|
|
156
|
-
apply({ elements: r }) {
|
|
157
|
-
const b = {
|
|
158
|
-
zIndex: `${$}`,
|
|
159
|
-
minWidth: `${r.reference.getBoundingClientRect().width}px`
|
|
160
|
-
};
|
|
161
|
-
Object.assign(r.floating.style, b);
|
|
162
|
-
}
|
|
163
|
-
})
|
|
164
|
-
],
|
|
165
|
-
whileElementsMounted: se
|
|
166
|
-
}), { context: v, refs: h } = f, W = ie(v, {
|
|
167
|
-
enabled: a === "click"
|
|
168
|
-
}), E = Pe(v, {
|
|
169
|
-
enabled: a === "hover",
|
|
170
|
-
handleClose: Me()
|
|
171
|
-
}), S = le(
|
|
172
|
-
v,
|
|
173
|
-
Ie(
|
|
174
|
-
{
|
|
175
|
-
ancestorScroll: !0
|
|
176
|
-
},
|
|
177
|
-
i
|
|
178
|
-
)
|
|
179
|
-
), I = ce(v), N = ue([W, S, I, E]), A = B(
|
|
180
|
-
() => ({
|
|
181
|
-
...f,
|
|
182
|
-
...N
|
|
183
|
-
}),
|
|
184
|
-
[f, N]
|
|
185
|
-
);
|
|
186
|
-
return Le(() => {
|
|
187
|
-
Q(t) || (h.setReference?.(t), v.onOpenChange(!F(t)));
|
|
188
|
-
}, [t]), /* @__PURE__ */ n(Se.Provider, { value: A, children: u });
|
|
189
|
-
}, ft = (e) => Fe() ? /* @__PURE__ */ n(Y, { ...e }) : /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(Y, { ...e }) }), je = ({ className: e, ...o }) => /* @__PURE__ */ n("div", { className: g("tw:animate-fade-down", e), ...o }), Be = ({ children: e, className: o, ...s }) => {
|
|
190
|
-
const { activeIndex: i } = te(), u = R.toArray(e).filter((t) => z(t) && t.type === je).find((t, a) => a === i);
|
|
191
|
-
return /* @__PURE__ */ n("div", { className: g("tw:relative tw:border-t tw:border-ic-white-1s", o), ...s, children: u });
|
|
192
|
-
}, He = ({ className: e, classes: o, ...s }) => {
|
|
193
|
-
const { activeIndex: i, focusTab: u } = te(), t = Number(_(s, "data-tab-index")), a = (d) => {
|
|
194
|
-
u(t), s.onClick?.(d);
|
|
195
|
-
};
|
|
196
|
-
return /* @__PURE__ */ n(
|
|
197
|
-
"li",
|
|
198
|
-
{
|
|
199
|
-
"aria-hidden": !0,
|
|
200
|
-
className: g(
|
|
201
|
-
"tw:px-3 tw:py-2 tw:rounded-t-lg tw:text-ic-white-5s tw:text-center tw:cursor-pointer",
|
|
202
|
-
{
|
|
203
|
-
[g("tw:text-ic-white-6s tw:bg-ic-black-7s", o?.active)]: i === t
|
|
204
|
-
},
|
|
205
|
-
e
|
|
206
|
-
),
|
|
207
|
-
...s,
|
|
208
|
-
onClick: a
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
}, Ge = ({ className: e, children: o, layout: s = "auto-fit", ...i }) => {
|
|
212
|
-
const u = R.toArray(o).filter(
|
|
213
|
-
(t) => z(t) && t.type === He
|
|
214
|
-
);
|
|
215
|
-
return /* @__PURE__ */ n(
|
|
216
|
-
"ul",
|
|
217
|
-
{
|
|
218
|
-
className: g(
|
|
219
|
-
"tw:flex tw:items-center",
|
|
220
|
-
{
|
|
221
|
-
"tw:*:flex-1": s === "auto-fill"
|
|
222
|
-
},
|
|
223
|
-
e
|
|
224
|
-
),
|
|
225
|
-
...i,
|
|
226
|
-
children: u.map(
|
|
227
|
-
(t, a) => J(t, {
|
|
228
|
-
"data-tab-index": a
|
|
229
|
-
})
|
|
230
|
-
)
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
}, wt = ({ defaultIndex: e, activeIndex: o, children: s, onTabChange: i, className: u, ...t }) => {
|
|
234
|
-
const a = R.toArray(s).filter((h) => z(h)), d = a.find((h) => h.type === Ge), [l, c] = V({
|
|
235
|
-
defaultValue: e ?? 0,
|
|
236
|
-
value: o
|
|
237
|
-
}), m = a.find((h) => h.type === Be), f = (h) => {
|
|
238
|
-
c(h), i?.(h);
|
|
239
|
-
}, v = B(() => ({
|
|
240
|
-
activeIndex: l,
|
|
241
|
-
focusTab: f
|
|
242
|
-
}), [l]);
|
|
243
|
-
return /* @__PURE__ */ n(Ae.Provider, { value: v, children: /* @__PURE__ */ k("div", { className: g("tw:flex tw:flex-col", u), ...t, children: [
|
|
244
|
-
d,
|
|
245
|
-
m
|
|
246
|
-
] }) });
|
|
247
|
-
}, Ue = ({ children: e, options: o, ...s }) => /* @__PURE__ */ n(
|
|
248
|
-
_e,
|
|
249
|
-
{
|
|
250
|
-
options: {
|
|
251
|
-
scrollbars: {
|
|
252
|
-
autoHide: "leave"
|
|
253
|
-
},
|
|
254
|
-
...o
|
|
255
|
-
},
|
|
256
|
-
...s,
|
|
257
|
-
children: e
|
|
258
|
-
}
|
|
259
|
-
), Xe = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
260
|
-
<path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
261
|
-
</svg>
|
|
262
|
-
`, Ke = `<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
263
|
-
<path d="M10,18a1,1,0,0,1-.71-.29l-5-5a1,1,0,0,1,1.42-1.42L10,15.59l8.29-8.3a1,1,0,1,1,1.42,1.42l-9,9A1,1,0,0,1,10,18Z"></path>
|
|
264
|
-
</svg>`, Ze = ({ RowComponent: e, options: o, ref: s, ...i }) => {
|
|
265
|
-
const u = j(null), t = H([u, s]), a = De({
|
|
266
|
-
...o,
|
|
267
|
-
getScrollElement: () => {
|
|
268
|
-
const c = u.current?.getElement()?.firstElementChild;
|
|
269
|
-
return c instanceof HTMLDivElement ? c : null;
|
|
270
|
-
}
|
|
271
|
-
}), d = a.getVirtualItems(), l = a.getTotalSize();
|
|
272
|
-
return /* @__PURE__ */ n(Ue, { ...i, ref: t, children: /* @__PURE__ */ n(
|
|
273
|
-
Oe.div,
|
|
274
|
-
{
|
|
275
|
-
initial: { opacity: 0 },
|
|
276
|
-
animate: { opacity: 1 },
|
|
277
|
-
style: {
|
|
278
|
-
height: l
|
|
279
|
-
},
|
|
280
|
-
children: /* @__PURE__ */ n(
|
|
281
|
-
"div",
|
|
282
|
-
{
|
|
283
|
-
style: {
|
|
284
|
-
transform: `translateY(${d.at(0)?.start ?? 0}px)`
|
|
285
|
-
},
|
|
286
|
-
children: d.map((c) => /* @__PURE__ */ n("div", { "data-index": c.index, ref: a.measureElement, children: /* @__PURE__ */ n(e, { row: c }) }, c.key))
|
|
287
|
-
}
|
|
288
|
-
)
|
|
289
|
-
}
|
|
290
|
-
) });
|
|
291
|
-
}, mt = (e) => {
|
|
292
|
-
const {
|
|
293
|
-
placement: o = "bottom-start",
|
|
294
|
-
contentWidth: s,
|
|
295
|
-
visible: i,
|
|
296
|
-
onOpenChange: u,
|
|
297
|
-
dissmiss: t,
|
|
298
|
-
searchable: a,
|
|
299
|
-
value: d,
|
|
300
|
-
optionValue: l,
|
|
301
|
-
optionLabel: c,
|
|
302
|
-
defaultValue: m,
|
|
303
|
-
options: f,
|
|
304
|
-
onChange: v,
|
|
305
|
-
placeholder: h,
|
|
306
|
-
prefix: W,
|
|
307
|
-
suffix: E,
|
|
308
|
-
className: S,
|
|
309
|
-
size: I = "32",
|
|
310
|
-
listProps: N,
|
|
311
|
-
selectedRenderer: A,
|
|
312
|
-
checkedIcon: r,
|
|
313
|
-
...b
|
|
314
|
-
} = e, [p, y] = V({
|
|
315
|
-
defaultValue: !1,
|
|
316
|
-
value: i
|
|
317
|
-
}), [T, de] = V({
|
|
318
|
-
defaultValue: m,
|
|
319
|
-
value: d
|
|
320
|
-
}), fe = (w, x, C) => {
|
|
321
|
-
!w && !C || (y(w), u?.(w, x, C));
|
|
322
|
-
}, { refs: G, floatingStyles: we, context: L } = ne({
|
|
323
|
-
open: p,
|
|
324
|
-
onOpenChange: fe,
|
|
325
|
-
placement: o,
|
|
326
|
-
middleware: [
|
|
327
|
-
oe(),
|
|
328
|
-
re(4),
|
|
329
|
-
ae({
|
|
330
|
-
apply({ elements: w }) {
|
|
331
|
-
const { width: x } = w.reference.getBoundingClientRect(), C = s === "fit-parent" ? x : s, M = {
|
|
332
|
-
minWidth: `${C ?? x}px`,
|
|
333
|
-
width: Q(C) ? C : `${C}px`,
|
|
334
|
-
zIndex: $
|
|
335
|
-
};
|
|
336
|
-
Object.assign(w.floating.style, M);
|
|
337
|
-
}
|
|
338
|
-
})
|
|
339
|
-
],
|
|
340
|
-
whileElementsMounted: se
|
|
341
|
-
}), me = ie(L), pe = le(L, t), be = ce(L), { getReferenceProps: he, getFloatingProps: ge } = ue([me, pe, be]), P = X(
|
|
342
|
-
(w) => typeof l == "function" ? l(w) : _(w, l ?? "value"),
|
|
343
|
-
[l]
|
|
344
|
-
), U = X(
|
|
345
|
-
(w) => typeof c == "function" ? c(w) : _(w, c ?? "label"),
|
|
346
|
-
[c]
|
|
347
|
-
), xe = (w) => {
|
|
348
|
-
const x = P(w);
|
|
349
|
-
x !== T && (de(x), v?.(x, w), y(!1));
|
|
350
|
-
}, D = B(
|
|
351
|
-
() => f.find((w) => T === P(w)),
|
|
352
|
-
[P, f, T]
|
|
353
|
-
), ve = ({ row: w }) => {
|
|
354
|
-
const x = f.at(w.index);
|
|
355
|
-
if (F(x)) return /* @__PURE__ */ n(q, {});
|
|
356
|
-
const C = P(x), M = T === C;
|
|
357
|
-
return /* @__PURE__ */ k(
|
|
358
|
-
"div",
|
|
359
|
-
{
|
|
360
|
-
onClick: (qe) => {
|
|
361
|
-
xe(x);
|
|
362
|
-
},
|
|
363
|
-
"aria-hidden": !0,
|
|
364
|
-
className: g(
|
|
365
|
-
"tw:p-2 tw:flex tw:items-center tw:gap-2 tw:cursor-pointer tw:rounded-lg tw:hover:bg-ic-white-1s",
|
|
366
|
-
{
|
|
367
|
-
"tw:bg-ic-black-7s": M
|
|
368
|
-
}
|
|
369
|
-
),
|
|
370
|
-
children: [
|
|
371
|
-
/* @__PURE__ */ n("div", { className: "tw:flex-1 tw:truncate", children: U(x) }),
|
|
372
|
-
M && (r ?? /* @__PURE__ */ n(O, { size: 16, source: Ke }))
|
|
373
|
-
]
|
|
374
|
-
}
|
|
375
|
-
);
|
|
376
|
-
}, Ne = {
|
|
377
|
-
height: Number(I)
|
|
378
|
-
};
|
|
379
|
-
return /* @__PURE__ */ k(ye, { children: [
|
|
380
|
-
/* @__PURE__ */ k(
|
|
381
|
-
"button",
|
|
382
|
-
{
|
|
383
|
-
className: g(
|
|
384
|
-
"tw:rounded-lg tw:overflow-hidden tw:bg-ic-white-1s tw:inline-flex tw:items-center tw:gap-2 tw:relative tw:text-xs tw:px-2 tw:text-ic-white-6s",
|
|
385
|
-
"tw:after:absolute tw:after:content-empty tw:after:inset-0 tw:after:pointer-events-none tw:after:rounded-lg tw:after:border tw:after:border-transparent",
|
|
386
|
-
{
|
|
387
|
-
"tw:after:border-ic-white-1s tw:bg-ic-black-7s": p
|
|
388
|
-
},
|
|
389
|
-
S
|
|
390
|
-
),
|
|
391
|
-
css: Ne,
|
|
392
|
-
...b,
|
|
393
|
-
...he(),
|
|
394
|
-
ref: G.setReference,
|
|
395
|
-
children: [
|
|
396
|
-
W,
|
|
397
|
-
/* @__PURE__ */ n("div", { className: "tw:flex-1 tw:text-left tw:truncate", children: D ? A?.(D) ?? U(D) : /* @__PURE__ */ n("span", { className: "tw:text-ic-white-3s", children: h }) }),
|
|
398
|
-
E ?? /* @__PURE__ */ n(
|
|
399
|
-
O,
|
|
400
|
-
{
|
|
401
|
-
source: Xe,
|
|
402
|
-
className: g("tw:transition-transform", {
|
|
403
|
-
"tw:-rotate-180": p
|
|
404
|
-
}),
|
|
405
|
-
size: 16
|
|
406
|
-
}
|
|
407
|
-
)
|
|
408
|
-
]
|
|
409
|
-
}
|
|
410
|
-
),
|
|
411
|
-
p && /* @__PURE__ */ n(ze, { root: document.body, children: /* @__PURE__ */ n(
|
|
412
|
-
"div",
|
|
413
|
-
{
|
|
414
|
-
ref: G.setFloating,
|
|
415
|
-
className: "tw:bg-ic-ink-6s tw:rounded-lg",
|
|
416
|
-
style: {
|
|
417
|
-
...we,
|
|
418
|
-
zIndex: $
|
|
419
|
-
},
|
|
420
|
-
...ge(),
|
|
421
|
-
children: /* @__PURE__ */ k("div", { className: "tw:focus-visible:outline-none tw:rounded-lg tw:py-1 tw:shadow tw:animate-fade tw:animate-duration-300 tw:bg-ic-white-1s tw:text-ic-white-6s tw:text-xs", children: [
|
|
422
|
-
a && /* @__PURE__ */ n("div", { className: "tw:px-2 tw:mb-2", children: /* @__PURE__ */ n(ee, { fullWidth: !0, autoFocus: !0 }) }),
|
|
423
|
-
/* @__PURE__ */ n(
|
|
424
|
-
Ze,
|
|
425
|
-
{
|
|
426
|
-
RowComponent: ve,
|
|
427
|
-
...N,
|
|
428
|
-
className: g("tw:px-1", N?.className),
|
|
429
|
-
style: {
|
|
430
|
-
// height: 160,
|
|
431
|
-
...N?.style
|
|
432
|
-
},
|
|
433
|
-
options: {
|
|
434
|
-
count: f.length,
|
|
435
|
-
estimateSize: () => 32,
|
|
436
|
-
...N?.options
|
|
437
|
-
}
|
|
438
|
-
}
|
|
439
|
-
)
|
|
440
|
-
] })
|
|
441
|
-
}
|
|
442
|
-
) })
|
|
443
|
-
] });
|
|
444
|
-
}, pt = ({
|
|
445
|
-
className: e,
|
|
446
|
-
style: o,
|
|
447
|
-
children: s,
|
|
448
|
-
isLoading: i,
|
|
449
|
-
hideChildrenOnLoading: u,
|
|
450
|
-
size: t = 24,
|
|
451
|
-
...a
|
|
452
|
-
}) => /* @__PURE__ */ k(
|
|
453
|
-
"div",
|
|
454
|
-
{
|
|
455
|
-
className: g("tw:relative", e),
|
|
456
|
-
style: {
|
|
457
|
-
minWidth: t,
|
|
458
|
-
minHeight: t,
|
|
459
|
-
...o
|
|
460
|
-
},
|
|
461
|
-
...a,
|
|
462
|
-
children: [
|
|
463
|
-
!i || !u ? s : /* @__PURE__ */ n(q, {}),
|
|
464
|
-
i && /* @__PURE__ */ n("div", { className: "tw:absolute tw:inset-0 tw:z-50 tw:flex tw:items-center tw:justify-center", children: /* @__PURE__ */ n(O, { source: Te, className: "tw:animate-spin tw:text-ic-orange-6s", size: t }) })
|
|
465
|
-
]
|
|
466
|
-
}
|
|
467
|
-
), bt = ({ children: e, ...o }) => {
|
|
468
|
-
const s = $e(o);
|
|
469
|
-
return /* @__PURE__ */ k("div", { ...s.getRootProps(), children: [
|
|
470
|
-
e?.(s),
|
|
471
|
-
/* @__PURE__ */ n("input", { ...s.getInputProps() })
|
|
472
|
-
] });
|
|
473
|
-
};
|
|
474
|
-
export {
|
|
475
|
-
Xe as A,
|
|
476
|
-
Ue as W,
|
|
477
|
-
ct as a,
|
|
478
|
-
bt as b,
|
|
479
|
-
ut as c,
|
|
480
|
-
pt as d,
|
|
481
|
-
ft as e,
|
|
482
|
-
dt as f,
|
|
483
|
-
mt as g,
|
|
484
|
-
He as h,
|
|
485
|
-
Be as i,
|
|
486
|
-
Ge as j,
|
|
487
|
-
je as k,
|
|
488
|
-
wt as l,
|
|
489
|
-
Ze as m
|
|
490
|
-
};
|
package/dist/index-BbiQ0n_-.js
DELETED
package/dist/tooltip-KbIHELP2.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsxs as y, jsx as s } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useRef as C, Fragment as E, isValidElement as I, cloneElement as N } from "react";
|
|
3
|
-
import { useFloating as O, autoUpdate as P, flip as j, offset as V, size as k, arrow as z, useHover as D, safePolygon as M, useFocus as S, useDismiss as T, useRole as W, useInteractions as _, useMergeRefs as A, FloatingPortal as G } from "@floating-ui/react";
|
|
4
|
-
import { get as H } from "lodash-es";
|
|
5
|
-
import { c as L } from "./dialog-header-DPLOS7TT.js";
|
|
6
|
-
import { FLOATING_Z_INDEX as U } from "@janbox/storefront-ui/theme";
|
|
7
|
-
import { useControllableState as X } from "@janbox/storefront-ui/hooks";
|
|
8
|
-
const Y = ({ placement: f = "top", open: c, onOpenChange: m, children: e, content: d }) => {
|
|
9
|
-
const [r, p] = X({
|
|
10
|
-
defaultValue: !1,
|
|
11
|
-
value: c
|
|
12
|
-
}), u = C(null), g = (o, n, R) => {
|
|
13
|
-
p(o), m?.(o, n, R);
|
|
14
|
-
}, { refs: i, floatingStyles: w, context: t } = O({
|
|
15
|
-
open: r,
|
|
16
|
-
onOpenChange: g,
|
|
17
|
-
placement: f,
|
|
18
|
-
middleware: [
|
|
19
|
-
j(),
|
|
20
|
-
V(4),
|
|
21
|
-
k({
|
|
22
|
-
apply({ elements: o }) {
|
|
23
|
-
const n = {
|
|
24
|
-
zIndex: `${U}`
|
|
25
|
-
};
|
|
26
|
-
Object.assign(o.floating.style, n);
|
|
27
|
-
}
|
|
28
|
-
}),
|
|
29
|
-
z({ element: u })
|
|
30
|
-
],
|
|
31
|
-
whileElementsMounted: P
|
|
32
|
-
}), b = D(t, { move: !1, handleClose: M() }), h = S(t), v = T(t, {}), x = W(t, {
|
|
33
|
-
role: "tooltip"
|
|
34
|
-
}), { getReferenceProps: l, getFloatingProps: F } = _([b, h, v, x]), a = A([i.setReference, H(e, "ref")]);
|
|
35
|
-
return /* @__PURE__ */ y(E, { children: [
|
|
36
|
-
I(e) ? N(
|
|
37
|
-
e,
|
|
38
|
-
l({
|
|
39
|
-
...e.props ?? {},
|
|
40
|
-
ref: a
|
|
41
|
-
})
|
|
42
|
-
) : /* @__PURE__ */ s("div", { ...l(), ref: a, children: e }),
|
|
43
|
-
r && /* @__PURE__ */ s(G, { children: /* @__PURE__ */ s(
|
|
44
|
-
"div",
|
|
45
|
-
{
|
|
46
|
-
style: w,
|
|
47
|
-
...F(),
|
|
48
|
-
className: "tw:bg-ic-ink-6s tw:rounded-lg",
|
|
49
|
-
ref: i.setFloating,
|
|
50
|
-
children: /* @__PURE__ */ s(
|
|
51
|
-
"div",
|
|
52
|
-
{
|
|
53
|
-
className: L(
|
|
54
|
-
"tw:focus-visible:outline-none tw:rounded-lg tw:p-2 tw:shadow tw:animate-fade tw:animate-duration-300 tw:bg-ic-ink-6s tw:border tw:border-ic-white-1s tw:text-ic-white-6s tw:text-xs"
|
|
55
|
-
),
|
|
56
|
-
children: d
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
) })
|
|
61
|
-
] });
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
Y as W
|
|
65
|
-
};
|