@janbox/storefront-builder 2.0.2 → 2.0.3

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 (35) hide show
  1. package/dist/{dialog-header-Bh3Dkw2q.js → countdown-timer.node-CZrTzirS.js} +3315 -2157
  2. package/dist/editor/components/index.d.ts +0 -1
  3. package/dist/editor/hooks/index.d.ts +0 -12
  4. package/dist/editor/hooks/use-editor.d.ts +6 -2
  5. package/dist/editor/index.d.ts +4 -0
  6. package/dist/editor/lib/index.d.ts +6 -4
  7. package/dist/editor/toolbars/css-font-weight/index.d.ts +9 -0
  8. package/dist/editor/toolbars/{width/width.d.ts → css-width/index.d.ts} +5 -5
  9. package/dist/editor/toolbars/html-anchor-target/index.d.ts +7 -0
  10. package/dist/editor/toolbars/index.d.ts +3 -3
  11. package/dist/editor/toolbars/text-align/index.d.ts +9 -1
  12. package/dist/editor.js +1189 -693
  13. package/dist/index-B1b2lC5K.js +4 -0
  14. package/dist/index-CdI5y-ul.js +8326 -0
  15. package/dist/index.js +173 -371
  16. package/dist/templates.js +26 -28
  17. package/dist/{tooltip-CXOlTkGg.js → tooltip-npH7aBjY.js} +1 -1
  18. package/package.json +1 -10
  19. package/dist/anchor-target-CtXzdkBu.js +0 -2918
  20. package/dist/color-picker-popover-XeaVfYS8.js +0 -225
  21. package/dist/countdown-timer.node-Bh5fTSJ8.js +0 -913
  22. package/dist/date-picker-D9K6HWl-.js +0 -157
  23. package/dist/dropzone-CF4CWXth.js +0 -546
  24. package/dist/editor/components/toolbar-container.d.ts +0 -1
  25. package/dist/editor/toolbars/anchor-target/anchor-target.d.ts +0 -7
  26. package/dist/editor/toolbars/anchor-target/index.d.ts +0 -1
  27. package/dist/editor/toolbars/font-weight/dataset.d.ts +0 -5
  28. package/dist/editor/toolbars/font-weight/font-weight.d.ts +0 -9
  29. package/dist/editor/toolbars/font-weight/index.d.ts +0 -1
  30. package/dist/editor/toolbars/text-align/text-align.d.ts +0 -8
  31. package/dist/editor/toolbars/width/index.d.ts +0 -1
  32. package/dist/editor/toolbars.js +0 -346
  33. package/dist/editor/ui.js +0 -120
  34. package/dist/index-800HnUOi.js +0 -4
  35. package/dist/index-CXyljfMv.js +0 -4593
@@ -1,157 +0,0 @@
1
- import { jsxs as u, jsx as t } from "@emotion/react/jsx-runtime";
2
- import { Fragment as T } from "react";
3
- import "react-datepicker/dist/react-datepicker.css";
4
- import { useFloating as $, autoUpdate as A, flip as B, offset as U, size as Z, useClick as _, useDismiss as G, useRole as L, useInteractions as X, FloatingPortal as q } from "@floating-ui/react";
5
- import { FLOATING_Z_INDEX as p } from "@janbox/storefront-ui/theme";
6
- import { isUndefined as J } from "lodash-es";
7
- import { DatePicker as K } from "react-datepicker";
8
- import { t as r, W as Q } from "./dialog-header-Bh3Dkw2q.js";
9
- import { useControllableState as h } from "@janbox/storefront-ui/hooks";
10
- const Y = `<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
- `, ae = (C) => {
22
- const {
23
- placement: f = "bottom",
24
- contentWidth: d,
25
- open: k,
26
- onOpenChange: m,
27
- dissmiss: g,
28
- value: w,
29
- defaultValue: b,
30
- onChange: v,
31
- placeholder: x,
32
- referenceProps: a,
33
- prefix: y,
34
- suffix: j,
35
- size: I = "32",
36
- showTimeInput: M = !0,
37
- ...W
38
- } = C, [s, O] = h({
39
- defaultValue: b,
40
- value: w
41
- }), [i, R] = h({
42
- defaultValue: !1,
43
- value: k
44
- }), S = (e, n, o) => {
45
- !e && !o || (R(e), m?.(e, n, o));
46
- }, { refs: c, floatingStyles: V, context: l } = $({
47
- open: i,
48
- onOpenChange: S,
49
- placement: f,
50
- middleware: [
51
- B(),
52
- U(4),
53
- Z({
54
- apply({ elements: e }) {
55
- const { width: n } = e.reference.getBoundingClientRect(), o = d === "fit-parent" ? n : d, H = {
56
- minWidth: `${o ?? n}px`,
57
- width: J(o) ? o : `${o}px`,
58
- zIndex: p
59
- };
60
- Object.assign(e.floating.style, H);
61
- }
62
- })
63
- ],
64
- whileElementsMounted: A
65
- }), F = _(l), z = G(l, g), D = L(l), { getReferenceProps: P, getFloatingProps: N } = X([F, z, D]), E = (e) => {
66
- e && (O(e), v?.(e));
67
- };
68
- return /* @__PURE__ */ u(T, { children: [
69
- /* @__PURE__ */ u(
70
- "button",
71
- {
72
- css: [
73
- {
74
- height: Number(I),
75
- display: "inline-flex",
76
- position: "relative",
77
- paddingInline: 8,
78
- borderRadius: 8,
79
- overflow: "hidden",
80
- alignItems: "center",
81
- gap: 8
82
- },
83
- {
84
- backgroundColor: r.palette.white["1s"],
85
- color: r.palette.white["6s"],
86
- ...r.text.xs,
87
- "&::after": {
88
- content: '""',
89
- position: "absolute",
90
- inset: 0,
91
- pointerEvents: "none",
92
- borderRadius: 8,
93
- borderWidth: 1,
94
- borderStyle: "solid",
95
- borderColor: "transparent"
96
- }
97
- },
98
- i && {
99
- backgroundColor: r.palette.black["7s"],
100
- "&::after": {
101
- content: '""',
102
- position: "absolute",
103
- inset: 0,
104
- pointerEvents: "none",
105
- borderRadius: 8,
106
- borderWidth: 1,
107
- borderStyle: "solid",
108
- borderColor: r.palette.white["1s"]
109
- }
110
- }
111
- ],
112
- ...W,
113
- ...P({
114
- ...a,
115
- className: a?.className
116
- }),
117
- ref: c.setReference,
118
- children: [
119
- y,
120
- /* @__PURE__ */ t("div", { css: { flex: 1, textAlign: "left", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: s ? /* @__PURE__ */ t("span", { children: new Intl.DateTimeFormat(void 0, {
121
- dateStyle: "short",
122
- timeStyle: "short",
123
- hour12: !1
124
- }).format(s) }) : /* @__PURE__ */ t("span", { children: x }) }),
125
- j ?? /* @__PURE__ */ t(Q, { source: Y, size: 16 })
126
- ]
127
- }
128
- ),
129
- i && /* @__PURE__ */ t(q, { root: document.body, children: /* @__PURE__ */ t(
130
- "div",
131
- {
132
- ref: c.setFloating,
133
- style: {
134
- ...V,
135
- zIndex: p
136
- },
137
- ...N(),
138
- children: /* @__PURE__ */ t(
139
- "div",
140
- {
141
- css: {
142
- ":focus-visible": {
143
- outlineStyle: "none"
144
- },
145
- borderRadius: 8,
146
- ...r.text.xs
147
- },
148
- children: /* @__PURE__ */ t(K, { showTimeInput: M, selected: s, onChange: E, inline: !0 })
149
- }
150
- )
151
- }
152
- ) })
153
- ] });
154
- };
155
- export {
156
- ae as W
157
- };
@@ -1,546 +0,0 @@
1
- import { jsx as t, jsxs as R, Fragment as xe } from "@emotion/react/jsx-runtime";
2
- import { Children as B, isValidElement as _, cloneElement as q, useRef as $, useEffect as Ce, useMemo as j, useCallback as X, Fragment as ke } from "react";
3
- import { useControllableState as I } from "@janbox/storefront-ui/hooks";
4
- import { t as u, l as J, k as K, W as P, P as ye, M as Ie, D as Se, E as We, F as Ne, G as Q, H as Ve } from "./dialog-header-Bh3Dkw2q.js";
5
- import { ClassNames as Ee } from "@emotion/react";
6
- import { useMergeRefs as G, useFloating as ee, autoUpdate as te, offset as ne, flip as oe, size as se, useClick as re, useHover as Re, safePolygon as Ae, useDismiss as ie, useRole as le, useInteractions as ae, useFloatingParentNodeId as Te, FloatingTree as Oe, FloatingPortal as Pe } from "@floating-ui/react";
7
- import { isNumber as Me, isNil as M, merge as ze, isUndefined as ce, get as D } from "lodash-es";
8
- import { useUpdateEffect as Fe } from "react-use";
9
- import { FLOATING_Z_INDEX as L } from "@janbox/storefront-ui/theme";
10
- import { useVirtualizer as De } from "@tanstack/react-virtual";
11
- import { OverlayScrollbarsComponent as Le } from "overlayscrollbars-react";
12
- import { useDropzone as Be } from "react-dropzone";
13
- const lt = ({
14
- children: e,
15
- defaultValue: o,
16
- value: s,
17
- onSelectionChange: l,
18
- ...a
19
- }) => {
20
- const [i, b] = I({
21
- defaultValue: o ?? null,
22
- value: s
23
- }), c = B.toArray(e).filter(
24
- (r) => _(r)
25
- ), d = (r) => {
26
- const w = r.currentTarget.value;
27
- w !== i && (b(w), l?.(w, r));
28
- };
29
- return /* @__PURE__ */ t(Ee, { children: ({ cx: r, css: w }) => /* @__PURE__ */ t(
30
- "div",
31
- {
32
- css: {
33
- padding: 4,
34
- display: "flex",
35
- alignItems: "center",
36
- gap: 8,
37
- borderRadius: 8,
38
- backgroundColor: u.palette.white["1s"]
39
- },
40
- ...a,
41
- children: c.map(
42
- (p) => q(p, {
43
- ...p.props,
44
- onClick(v) {
45
- d(v), p.props.onClick?.(v);
46
- },
47
- className: r(
48
- w([
49
- {
50
- color: u.palette.white["4s"]
51
- },
52
- p.props.value?.toString() === i && {
53
- backgroundColor: u.palette.black["7s"],
54
- color: u.palette.white["6s"]
55
- }
56
- ]),
57
- p.props.className
58
- )
59
- })
60
- )
61
- }
62
- ) });
63
- }, Z = 10, at = ({
64
- min: e = 0,
65
- max: o = Number.MAX_SAFE_INTEGER,
66
- fractionDigits: s = 0,
67
- value: l,
68
- defaultValue: a,
69
- step: i = 0,
70
- ref: b,
71
- ...c
72
- }) => {
73
- const d = $(null), [r, w] = I({
74
- value: l?.toString(),
75
- defaultValue: a?.toString() ?? ""
76
- }), p = parseFloat(r), v = G([b, d]), S = typeof s == "number" ? s : Z, W = (n) => {
77
- if (n = n.replace(/e|E/g, ""), e >= 0 && (n = n.replace(/^-/, "")), s === 0)
78
- n = n.replace(/\.\d+$/, "");
79
- else {
80
- const g = n.split(".");
81
- if (g.length > 1) {
82
- const h = g.at(1)?.slice(0, Math.min(S, Z));
83
- n = `${g.at(0)}.${h}`;
84
- }
85
- }
86
- return c.transform?.(n) ?? n;
87
- }, N = (n) => {
88
- c.mode === "onBlur" && n.target.valueAsNumber < e && (n.target.value = e.toString()), w(n.target.value), c.onChange?.(n);
89
- }, V = (n) => {
90
- (n.key === "e" || n.key === "E") && n.preventDefault(), c.onKeyDown?.(n);
91
- }, y = (n) => {
92
- if (!d.current) return;
93
- Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set?.call(d.current, n);
94
- const h = new Event("input", { bubbles: !0 });
95
- d.current.dispatchEvent(h);
96
- }, C = (n) => {
97
- const g = d.current;
98
- if (M(g)) return;
99
- const h = g.valueAsNumber, k = Math.min(isNaN(h) ? e + i : h + i, o);
100
- h !== k && y(k.toString());
101
- }, E = (n) => {
102
- const g = d.current;
103
- if (M(g)) return;
104
- const h = g.valueAsNumber, k = Math.max(isNaN(h) ? e : h - i, e);
105
- h !== k && y(k.toString());
106
- };
107
- return /* @__PURE__ */ t(
108
- J,
109
- {
110
- ...c,
111
- css: {
112
- "::-webkit-outer-spin-button": {
113
- margin: 0,
114
- WebkitAppearance: "none"
115
- },
116
- "::-webkit-inner-spin-button": {
117
- WebkitAppearance: "none",
118
- margin: 0
119
- }
120
- },
121
- prefix: c.prefix ?? (i > 0 ? /* @__PURE__ */ t(
122
- K,
123
- {
124
- disabled: Me(l) && l <= e,
125
- onClick: E,
126
- "aria-disabled": isNaN(p) ? !1 : p >= o,
127
- children: /* @__PURE__ */ t(P, { source: Ie })
128
- }
129
- ) : null),
130
- suffix: c.suffix ?? (i > 0 ? /* @__PURE__ */ t(K, { onClick: C, "aria-disabled": isNaN(p) ? !1 : p <= e, children: /* @__PURE__ */ t(P, { source: ye }) }) : null),
131
- type: "number",
132
- value: r,
133
- onChange: N,
134
- transform: W,
135
- ref: v,
136
- onKeyDown: V
137
- }
138
- );
139
- }, ct = ({ event: e = "click", reason: o, ref: s, ...l }) => {
140
- const a = $(null), {
141
- context: { onOpenChange: i }
142
- } = Se(), b = G([s, a]);
143
- return Ce(() => {
144
- const c = a.current;
145
- if (!c) return;
146
- const d = function(r) {
147
- i?.(!1, r, o);
148
- };
149
- return c.addEventListener(e, d), () => {
150
- c.removeEventListener(e, d);
151
- };
152
- }, [e, i, o]), /* @__PURE__ */ t(
153
- "div",
154
- {
155
- css: {
156
- display: "contents"
157
- },
158
- ...l,
159
- ref: b
160
- }
161
- );
162
- }, Y = ({
163
- open: e,
164
- placement: o = "bottom",
165
- onOpenChange: s,
166
- dissmiss: l,
167
- children: a,
168
- reference: i,
169
- trigger: b = "click",
170
- offset: c = 4
171
- }) => {
172
- const [d, r] = I({
173
- defaultValue: !1,
174
- value: e
175
- }), p = ee({
176
- open: d,
177
- onOpenChange: (n, g, h) => {
178
- r(n), s?.(n, g, h);
179
- },
180
- placement: o,
181
- middleware: [
182
- ne(c),
183
- oe(),
184
- se({
185
- apply({ elements: n }) {
186
- const g = {
187
- zIndex: `${L}`,
188
- minWidth: `${n.reference.getBoundingClientRect().width}px`
189
- };
190
- Object.assign(n.floating.style, g);
191
- }
192
- })
193
- ],
194
- whileElementsMounted: te
195
- }), { context: v, refs: S } = p, W = re(v, {
196
- enabled: b === "click"
197
- }), N = Re(v, {
198
- enabled: b === "hover",
199
- handleClose: Ae()
200
- }), V = ie(
201
- v,
202
- ze(
203
- {
204
- ancestorScroll: !0
205
- },
206
- l
207
- )
208
- ), y = le(v), C = ae([W, V, y, N]), E = j(
209
- () => ({
210
- ...p,
211
- ...C
212
- }),
213
- [p, C]
214
- );
215
- return Fe(() => {
216
- ce(i) || (S.setReference?.(i), v.onOpenChange(!M(i)));
217
- }, [i]), /* @__PURE__ */ t(We.Provider, { value: E, children: a });
218
- }, dt = (e) => Te() ? /* @__PURE__ */ t(Y, { ...e }) : /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ t(Y, { ...e }) }), ut = ({ defaultIndex: e, activeIndex: o, children: s, onTabChange: l, ...a }) => {
219
- const [i, b] = I({
220
- defaultValue: e ?? 0,
221
- value: o
222
- }), c = (r) => {
223
- b(r), l?.(r);
224
- }, d = j(() => ({
225
- activeIndex: i,
226
- focusTab: c
227
- }), [i]);
228
- return /* @__PURE__ */ t(Ne.Provider, { value: d, children: /* @__PURE__ */ t("div", { css: { display: "flex", flexDirection: "column" }, ...a, children: s }) });
229
- }, _e = ({ fill: e = !1, ...o }) => {
230
- const { activeIndex: s, focusTab: l } = Q(), a = Number(D(o, "data-tab-index")), i = (b) => {
231
- l(a), o.onClick?.(b);
232
- };
233
- return /* @__PURE__ */ t(
234
- "li",
235
- {
236
- "aria-hidden": !0,
237
- css: [
238
- {
239
- paddingInline: 12,
240
- paddingBlock: 8,
241
- borderTopLeftRadius: 8,
242
- borderTopRightRadius: 8,
243
- color: u.palette.white["5s"],
244
- textAlign: "center",
245
- cursor: "pointer"
246
- },
247
- s === a && {
248
- color: u.palette.white["6s"],
249
- backgroundColor: u.palette.black["7s"]
250
- },
251
- e && {
252
- flex: 1
253
- }
254
- ],
255
- ...o,
256
- onClick: i
257
- }
258
- );
259
- }, pt = ({ children: e, ...o }) => {
260
- const s = B.toArray(e).filter(
261
- (l) => _(l) && l.type === _e
262
- );
263
- return /* @__PURE__ */ t("ul", { css: [{ display: "flex", alignItems: "center" }], ...o, children: s.map(
264
- (l, a) => q(l, {
265
- "data-tab-index": a
266
- })
267
- ) });
268
- }, $e = ({ ...e }) => /* @__PURE__ */ t("div", { ...e }), ft = ({ children: e, ...o }) => {
269
- const { activeIndex: s } = Q(), l = B.toArray(e).filter((a) => _(a) && a.type === $e).find((a, i) => i === s);
270
- return /* @__PURE__ */ t(
271
- "div",
272
- {
273
- css: { position: "relative", borderTopWidth: 1, borderTopStyle: "solid", borderColor: u.palette.white["1s"] },
274
- ...o,
275
- children: l
276
- }
277
- );
278
- }, je = ({ children: e, options: o, ...s }) => /* @__PURE__ */ t(
279
- Le,
280
- {
281
- options: {
282
- scrollbars: {
283
- autoHide: "leave"
284
- },
285
- ...o
286
- },
287
- ...s,
288
- children: e
289
- }
290
- ), Ge = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
291
- <path d="M6 9L12 15L18 9" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
292
- </svg>
293
- `, He = `<svg fill="currentColor" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
294
- <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>
295
- </svg>`, Ue = ({ RowComponent: e, options: o, ref: s, ...l }) => {
296
- const a = $(null), i = G([a, s]), b = De({
297
- ...o,
298
- getScrollElement: () => {
299
- const r = a.current?.getElement()?.firstElementChild;
300
- return r instanceof HTMLDivElement ? r : null;
301
- }
302
- }), c = b.getVirtualItems(), d = b.getTotalSize();
303
- return /* @__PURE__ */ t(je, { ...l, ref: i, children: /* @__PURE__ */ t(
304
- Ve.div,
305
- {
306
- initial: { opacity: 0 },
307
- animate: { opacity: 1 },
308
- style: {
309
- height: d
310
- },
311
- children: /* @__PURE__ */ t(
312
- "div",
313
- {
314
- style: {
315
- transform: `translateY(${c.at(0)?.start ?? 0}px)`
316
- },
317
- children: c.map((r) => /* @__PURE__ */ t("div", { "data-index": r.index, ref: b.measureElement, children: /* @__PURE__ */ t(e, { row: r }) }, r.key))
318
- }
319
- )
320
- }
321
- ) });
322
- }, bt = (e) => {
323
- const {
324
- placement: o = "bottom-start",
325
- contentWidth: s,
326
- visible: l,
327
- onOpenChange: a,
328
- dissmiss: i,
329
- searchable: b,
330
- value: c,
331
- optionValue: d,
332
- optionLabel: r,
333
- defaultValue: w,
334
- options: p,
335
- onChange: v,
336
- placeholder: S,
337
- prefix: W,
338
- suffix: N,
339
- className: V,
340
- size: y = "32",
341
- listProps: C,
342
- selectedRenderer: E,
343
- checkedIcon: n,
344
- ...g
345
- } = e, [h, k] = I({
346
- defaultValue: !1,
347
- value: l
348
- }), [A, de] = I({
349
- defaultValue: w,
350
- value: c
351
- }), ue = (f, m, x) => {
352
- !f && !x || (k(f), a?.(f, m, x));
353
- }, { refs: H, floatingStyles: pe, context: z } = ee({
354
- open: h,
355
- onOpenChange: ue,
356
- placement: o,
357
- middleware: [
358
- oe(),
359
- ne(4),
360
- se({
361
- apply({ elements: f }) {
362
- const { width: m } = f.reference.getBoundingClientRect(), x = s === "fit-parent" ? m : s, O = {
363
- minWidth: `${x ?? m}px`,
364
- width: ce(x) ? x : `${x}px`,
365
- zIndex: L
366
- };
367
- Object.assign(f.floating.style, O);
368
- }
369
- })
370
- ],
371
- whileElementsMounted: te
372
- }), fe = re(z), be = ie(z, i), he = le(z), { getReferenceProps: ge, getFloatingProps: me } = ae([fe, be, he]), T = X(
373
- (f) => typeof d == "function" ? d(f) : D(f, d ?? "value"),
374
- [d]
375
- ), U = X(
376
- (f) => typeof r == "function" ? r(f) : D(f, r ?? "label"),
377
- [r]
378
- ), ve = (f) => {
379
- const m = T(f);
380
- m !== A && (de(m), v?.(m, f), k(!1));
381
- }, F = j(
382
- () => p.find((f) => A === T(f)),
383
- [T, p, A]
384
- ), we = ({ row: f }) => {
385
- const m = p.at(f.index);
386
- if (M(m)) return /* @__PURE__ */ t(xe, {});
387
- const x = T(m), O = A === x;
388
- return /* @__PURE__ */ R(
389
- "div",
390
- {
391
- onClick: (Ke) => {
392
- ve(m);
393
- },
394
- "aria-hidden": !0,
395
- css: [
396
- {
397
- padding: 8,
398
- display: "flex",
399
- alignItems: "center",
400
- gap: 8,
401
- borderRadius: 8,
402
- cursor: "pointer",
403
- ":hover": {
404
- backgroundColor: u.palette.white["1s"]
405
- }
406
- },
407
- O && { backgroundColor: u.palette.black["7s"] }
408
- ],
409
- children: [
410
- /* @__PURE__ */ t("div", { css: { flex: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: U(m) }),
411
- O && (n ?? /* @__PURE__ */ t(P, { size: 16, source: He }))
412
- ]
413
- }
414
- );
415
- };
416
- return /* @__PURE__ */ R(ke, { children: [
417
- /* @__PURE__ */ R(
418
- "button",
419
- {
420
- className: V,
421
- css: [
422
- {
423
- ...u.text.xs,
424
- height: Number(y),
425
- display: "inline-flex",
426
- position: "relative",
427
- paddingInline: 8,
428
- borderRadius: 8,
429
- overflow: "hidden",
430
- alignItems: "center",
431
- gap: 8,
432
- backgroundColor: u.palette.white["1s"],
433
- color: u.palette.white["6s"],
434
- "&::after": {
435
- content: '""',
436
- position: "absolute",
437
- inset: 0,
438
- pointerEvents: "none",
439
- borderRadius: 8,
440
- borderWidth: 1,
441
- borderStyle: "solid",
442
- borderColor: "transparent"
443
- }
444
- },
445
- h && {
446
- backgroundColor: u.palette.black["7s"],
447
- "&::after": {
448
- content: '""',
449
- position: "absolute",
450
- inset: 0,
451
- pointerEvents: "none",
452
- borderRadius: 8,
453
- borderWidth: 1,
454
- borderStyle: "solid",
455
- borderColor: u.palette.white["1s"]
456
- }
457
- }
458
- ],
459
- ...g,
460
- ...ge(),
461
- ref: H.setReference,
462
- children: [
463
- W,
464
- /* @__PURE__ */ t("div", { css: { flex: 1, textAlign: "left", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: F ? E?.(F) ?? U(F) : /* @__PURE__ */ t("span", { css: { color: u.palette.white["3s"] }, children: S }) }),
465
- N ?? /* @__PURE__ */ t(
466
- P,
467
- {
468
- source: Ge,
469
- css: [{ transition: "transform" }, h && { transform: "rotate(-180deg)" }],
470
- size: 16
471
- }
472
- )
473
- ]
474
- }
475
- ),
476
- h && /* @__PURE__ */ t(Pe, { root: document.body, children: /* @__PURE__ */ t(
477
- "div",
478
- {
479
- ref: H.setFloating,
480
- css: { borderRadius: 8, backgroundColor: u.palette.ink["6s"] },
481
- style: {
482
- ...pe,
483
- zIndex: L
484
- },
485
- ...me(),
486
- children: /* @__PURE__ */ R(
487
- "div",
488
- {
489
- css: {
490
- paddingBlock: 4,
491
- borderRadius: 8,
492
- backgroundColor: u.palette.white["1s"],
493
- color: u.palette.white["6s"],
494
- ":focus-visible": {
495
- outlineStyle: "none"
496
- },
497
- ...u.text.xs
498
- },
499
- children: [
500
- b && /* @__PURE__ */ t("div", { css: { paddingInline: 8, marginBottom: 8 }, children: /* @__PURE__ */ t(J, { fullWidth: !0, autoFocus: !0 }) }),
501
- /* @__PURE__ */ t(
502
- Ue,
503
- {
504
- RowComponent: we,
505
- ...C,
506
- css: { paddingInline: 4 },
507
- style: {
508
- // height: 160,
509
- ...C?.style
510
- },
511
- options: {
512
- count: p.length,
513
- estimateSize: () => 32,
514
- ...C?.options
515
- }
516
- }
517
- )
518
- ]
519
- }
520
- )
521
- }
522
- ) })
523
- ] });
524
- }, ht = ({ children: e, ...o }) => {
525
- const s = Be(o);
526
- return /* @__PURE__ */ R("div", { ...s.getRootProps(), children: [
527
- e?.(s),
528
- /* @__PURE__ */ t("input", { ...s.getInputProps() })
529
- ] });
530
- };
531
- export {
532
- Ge as A,
533
- je as W,
534
- lt as a,
535
- ht as b,
536
- at as c,
537
- dt as d,
538
- ct as e,
539
- bt as f,
540
- _e as g,
541
- ft as h,
542
- pt as i,
543
- $e as j,
544
- ut as k,
545
- Ue as l
546
- };
@@ -1 +0,0 @@
1
- export declare const ToolbarContainer: (props: React.JSX.IntrinsicElements["div"]) => import("@emotion/react/jsx-runtime").JSX.Element;