@janbox/storefront-builder 2.0.0 → 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
|
@@ -0,0 +1,157 @@
|
|
|
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
|
+
};
|