@loczer/storefront-sdk 0.153.0 → 0.154.0
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/dist/components/Footer/businessHoursUtils.d.ts.map +1 -1
- package/dist/components/Footer/businessHoursUtils.js +16 -16
- package/dist/components/StorefrontCartPanel/index.d.ts +2 -1
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +68 -63
- package/dist/i18n/en.d.ts +1 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +1 -0
- package/dist/i18n/fr.d.ts +1 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +1 -0
- package/dist/index.d.ts +48 -32
- package/dist/index.js +103 -100
- package/dist/lib/checkoutVerifyCoupon.d.ts +1 -0
- package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
- package/dist/lib/checkoutVerifyCoupon.js +1 -0
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +56 -51
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +16 -14
- package/dist/storefront.css +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +17 -17
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +8 -11
- package/dist/ui/form.d.ts +1 -1
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +52 -86
- package/dist/ui/radio-group.d.ts +10 -7
- package/dist/ui/radio-group.d.ts.map +1 -1
- package/dist/ui/radio-group.js +63 -45
- package/dist/ui/select.d.ts +29 -15
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/select.js +158 -232
- package/dist/ui/slot.d.ts +3 -7
- package/dist/ui/slot.d.ts.map +1 -1
- package/dist/ui/slot.js +47 -27
- package/dist/ui/theme.d.ts +9 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +24 -0
- package/dist/ui/tooltip.d.ts +30 -13
- package/dist/ui/tooltip.d.ts.map +1 -1
- package/dist/ui/tooltip.js +89 -60
- package/package.json +1 -1
package/dist/ui/select.js
CHANGED
|
@@ -1,255 +1,181 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { Select as
|
|
4
|
-
import { ChevronDown as
|
|
5
|
-
import { cn as
|
|
6
|
-
|
|
1
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { Select as a } from "@base-ui/react/select";
|
|
4
|
+
import { ChevronDown as f, ChevronUp as w, Check as g } from "lucide-react";
|
|
5
|
+
import { cn as c } from "@rpcbase/ui";
|
|
6
|
+
import { Slot as y } from "./slot.js";
|
|
7
|
+
import { useThemeAppearance as b } from "./theme.js";
|
|
8
|
+
const m = (e) => {
|
|
9
|
+
if (e !== void 0)
|
|
10
|
+
return e === "" ? null : e;
|
|
11
|
+
};
|
|
12
|
+
function U({
|
|
13
|
+
value: e,
|
|
14
|
+
defaultValue: t,
|
|
7
15
|
onValueChange: r,
|
|
8
|
-
|
|
16
|
+
open: n,
|
|
17
|
+
defaultOpen: s = !1,
|
|
18
|
+
onOpenChange: i,
|
|
19
|
+
children: S
|
|
9
20
|
}) {
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
21
|
+
return /* @__PURE__ */ o(
|
|
22
|
+
a.Root,
|
|
12
23
|
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
value: m(e),
|
|
25
|
+
defaultValue: m(t),
|
|
26
|
+
onValueChange: (d) => r?.(d ?? ""),
|
|
27
|
+
open: n,
|
|
28
|
+
defaultOpen: s,
|
|
29
|
+
onOpenChange: (d) => i?.(d),
|
|
30
|
+
children: S
|
|
17
31
|
}
|
|
18
32
|
);
|
|
19
33
|
}
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
ref: u,
|
|
24
|
-
className: N(
|
|
25
|
-
"flex h-10 w-full cursor-pointer items-center text-left rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&>span]:line-clamp-1",
|
|
26
|
-
r
|
|
27
|
-
),
|
|
28
|
-
...o,
|
|
29
|
-
children: [
|
|
30
|
-
l,
|
|
31
|
-
/* @__PURE__ */ t(i.Icon, { className: "ml-auto flex h-4 w-4 shrink-0 items-center justify-center opacity-50", children: /* @__PURE__ */ t(A, { className: "h-4 w-4" }) })
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
));
|
|
35
|
-
z.displayName = "SelectTrigger";
|
|
36
|
-
const E = e.createContext(null), P = e.forwardRef(
|
|
37
|
-
({ direction: r, speed: l = 400, className: o, children: u, ...m }, C) => {
|
|
38
|
-
const k = e.useContext(E), [f, R] = e.useState(!0), p = e.useRef(null), h = e.useRef(null), w = e.useRef(!1), a = k?.viewport, b = e.useCallback(() => {
|
|
39
|
-
if (!a) {
|
|
40
|
-
R(!0);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const { scrollTop: n, scrollHeight: g, clientHeight: d } = a, s = 2, S = n > s, v = n < g - d - s;
|
|
44
|
-
if (!(g > d + s)) {
|
|
45
|
-
R(!0);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
R(r === "up" ? !S : !v);
|
|
49
|
-
}, [r, a]);
|
|
50
|
-
e.useEffect(() => {
|
|
51
|
-
if (!a) return;
|
|
52
|
-
b();
|
|
53
|
-
const n = () => b(), g = () => b();
|
|
54
|
-
a.addEventListener("scroll", n, { passive: !0 });
|
|
55
|
-
const d = new ResizeObserver(g);
|
|
56
|
-
d.observe(a);
|
|
57
|
-
const s = new MutationObserver(g);
|
|
58
|
-
return s.observe(a, { childList: !0, subtree: !0 }), () => {
|
|
59
|
-
a.removeEventListener("scroll", n), d.disconnect(), s.disconnect();
|
|
60
|
-
};
|
|
61
|
-
}, [b, a]);
|
|
62
|
-
const c = e.useCallback(() => {
|
|
63
|
-
p.current !== null && (cancelAnimationFrame(p.current), p.current = null), w.current = !1, h.current = null;
|
|
64
|
-
}, []), x = e.useCallback((n) => {
|
|
65
|
-
if (!a || f || !w.current) {
|
|
66
|
-
c();
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
h.current || (h.current = n);
|
|
70
|
-
const g = n - h.current, d = l * g / 1e3;
|
|
71
|
-
if (d < 0.1) {
|
|
72
|
-
p.current = requestAnimationFrame(x);
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
const s = a.scrollTop, S = a.scrollHeight - a.clientHeight, v = r === "up" ? Math.max(0, s - d) : Math.min(S, s + d);
|
|
76
|
-
a.scrollTo({ top: v }), h.current = n;
|
|
77
|
-
const y = 1;
|
|
78
|
-
if ((r === "up" ? v > y : v < S - y) && Math.abs(v - s) > 0.01) {
|
|
79
|
-
p.current = requestAnimationFrame(x);
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
c(), setTimeout(b, 16);
|
|
83
|
-
}, [b, r, f, l, c, a]), T = e.useCallback(() => {
|
|
84
|
-
f || !a || w.current || (w.current = !0, h.current = null, p.current = requestAnimationFrame(x));
|
|
85
|
-
}, [f, x, a]);
|
|
86
|
-
return e.useEffect(() => () => c(), [c]), /* @__PURE__ */ t(
|
|
87
|
-
"div",
|
|
88
|
-
{
|
|
89
|
-
...m,
|
|
90
|
-
ref: C,
|
|
91
|
-
className: N(
|
|
92
|
-
"flex items-center justify-center py-1 select-none",
|
|
93
|
-
f ? "cursor-default opacity-40" : "cursor-pointer opacity-100 hover:bg-accent/20",
|
|
94
|
-
o
|
|
95
|
-
),
|
|
96
|
-
onPointerEnter: (n) => {
|
|
97
|
-
m.onPointerEnter?.(n), f || T();
|
|
98
|
-
},
|
|
99
|
-
onPointerMove: (n) => {
|
|
100
|
-
m.onPointerMove?.(n), !f && !w.current && T();
|
|
101
|
-
},
|
|
102
|
-
onPointerLeave: (n) => {
|
|
103
|
-
m.onPointerLeave?.(n), c();
|
|
104
|
-
},
|
|
105
|
-
children: u
|
|
106
|
-
}
|
|
107
|
-
);
|
|
108
|
-
}
|
|
34
|
+
const N = l.forwardRef(
|
|
35
|
+
({ ...e }, t) => /* @__PURE__ */ o(a.Group, { ref: t, ...e })
|
|
109
36
|
);
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
className: r,
|
|
117
|
-
|
|
118
|
-
position: o = "popper",
|
|
119
|
-
autoScroll: u,
|
|
120
|
-
footer: m,
|
|
121
|
-
side: C = "bottom",
|
|
122
|
-
sideOffset: k = 4,
|
|
123
|
-
align: f = "start",
|
|
124
|
-
alignOffset: R,
|
|
125
|
-
collisionBoundary: p,
|
|
126
|
-
collisionPadding: h,
|
|
127
|
-
positionMethod: w,
|
|
128
|
-
...a
|
|
129
|
-
}, b) => {
|
|
130
|
-
const [c, x] = e.useState(null);
|
|
131
|
-
return e.useEffect(() => {
|
|
132
|
-
if (!c || !u) return;
|
|
133
|
-
const n = requestAnimationFrame(() => {
|
|
134
|
-
if (c.querySelector('[role="option"][data-selected]')) return;
|
|
135
|
-
const d = Array.from(c.querySelectorAll('[role="option"]'));
|
|
136
|
-
if (!d.length) return;
|
|
137
|
-
let s, S;
|
|
138
|
-
for (const y of d) {
|
|
139
|
-
if (!y.hasAttribute("data-disabled")) {
|
|
140
|
-
s = y;
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
S = y;
|
|
144
|
-
}
|
|
145
|
-
if (!s) return;
|
|
146
|
-
const v = u === "firstEnabledWithContext" && S ? S : s;
|
|
147
|
-
c.scrollTo({ top: Math.max(0, v.offsetTop - 8) });
|
|
148
|
-
});
|
|
149
|
-
return () => cancelAnimationFrame(n);
|
|
150
|
-
}, [u, c]), /* @__PURE__ */ t(i.Portal, { children: /* @__PURE__ */ t(
|
|
151
|
-
i.Positioner,
|
|
37
|
+
N.displayName = "SelectGroup";
|
|
38
|
+
const x = l.forwardRef(
|
|
39
|
+
({ placeholder: e, children: t, ...r }, n) => /* @__PURE__ */ o(a.Value, { ref: n, placeholder: e, ...r, children: t })
|
|
40
|
+
);
|
|
41
|
+
x.displayName = "SelectValue";
|
|
42
|
+
const I = l.forwardRef(
|
|
43
|
+
({ className: e, children: t, ...r }, n) => /* @__PURE__ */ p(
|
|
44
|
+
a.Trigger,
|
|
152
45
|
{
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
i.Popup,
|
|
164
|
-
{
|
|
165
|
-
ref: b,
|
|
166
|
-
className: N(
|
|
167
|
-
"pointer-events-auto relative max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=closed]:pointer-events-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
168
|
-
o === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
169
|
-
r
|
|
170
|
-
),
|
|
171
|
-
render: (T, n) => /* @__PURE__ */ t(
|
|
172
|
-
"div",
|
|
173
|
-
{
|
|
174
|
-
...T,
|
|
175
|
-
"data-state": n.open ? "open" : "closed",
|
|
176
|
-
"aria-hidden": n.open ? void 0 : !0
|
|
177
|
-
}
|
|
178
|
-
),
|
|
179
|
-
...a,
|
|
180
|
-
children: /* @__PURE__ */ I(E.Provider, { value: { viewport: c, setViewport: x }, children: [
|
|
181
|
-
/* @__PURE__ */ t(L, {}),
|
|
182
|
-
/* @__PURE__ */ t(
|
|
183
|
-
i.List,
|
|
184
|
-
{
|
|
185
|
-
ref: x,
|
|
186
|
-
className: N(
|
|
187
|
-
"p-1 overflow-y-auto",
|
|
188
|
-
o === "popper" && "max-h-[var(--available-height)] min-w-[var(--anchor-width)]"
|
|
189
|
-
),
|
|
190
|
-
children: l
|
|
191
|
-
}
|
|
192
|
-
),
|
|
193
|
-
/* @__PURE__ */ t(B, {}),
|
|
194
|
-
m
|
|
195
|
-
] })
|
|
196
|
-
}
|
|
197
|
-
)
|
|
46
|
+
ref: n,
|
|
47
|
+
className: c(
|
|
48
|
+
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
49
|
+
e
|
|
50
|
+
),
|
|
51
|
+
...r,
|
|
52
|
+
children: [
|
|
53
|
+
t,
|
|
54
|
+
/* @__PURE__ */ o(a.Icon, { children: /* @__PURE__ */ o(f, { className: "h-4 w-4 opacity-50" }) })
|
|
55
|
+
]
|
|
198
56
|
}
|
|
199
|
-
)
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
const
|
|
203
|
-
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
I.displayName = "SelectTrigger";
|
|
60
|
+
const u = l.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
|
|
61
|
+
a.ScrollUpArrow,
|
|
204
62
|
{
|
|
205
|
-
ref:
|
|
206
|
-
className:
|
|
207
|
-
|
|
63
|
+
ref: r,
|
|
64
|
+
className: c(
|
|
65
|
+
"flex items-center justify-center py-1 cursor-default select-none opacity-100 hover:bg-accent/20",
|
|
66
|
+
e
|
|
67
|
+
),
|
|
68
|
+
...t,
|
|
69
|
+
children: /* @__PURE__ */ o(w, { className: "h-4 w-4" })
|
|
208
70
|
}
|
|
209
71
|
));
|
|
210
|
-
|
|
211
|
-
const
|
|
212
|
-
|
|
72
|
+
u.displayName = "SelectScrollUpButton";
|
|
73
|
+
const h = l.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
|
|
74
|
+
a.ScrollDownArrow,
|
|
213
75
|
{
|
|
214
|
-
ref:
|
|
215
|
-
className:
|
|
216
|
-
"
|
|
217
|
-
|
|
76
|
+
ref: r,
|
|
77
|
+
className: c(
|
|
78
|
+
"flex items-center justify-center py-1 cursor-default select-none opacity-100 hover:bg-accent/20",
|
|
79
|
+
e
|
|
218
80
|
),
|
|
219
|
-
|
|
220
|
-
|
|
81
|
+
...t,
|
|
82
|
+
children: /* @__PURE__ */ o(f, { className: "h-4 w-4" })
|
|
83
|
+
}
|
|
84
|
+
));
|
|
85
|
+
h.displayName = "SelectScrollDownButton";
|
|
86
|
+
const v = l.forwardRef(
|
|
87
|
+
({ className: e, children: t, position: r = "popper", ...n }, s) => {
|
|
88
|
+
const i = b();
|
|
89
|
+
return /* @__PURE__ */ o(a.Portal, { children: /* @__PURE__ */ o(
|
|
90
|
+
a.Positioner,
|
|
221
91
|
{
|
|
222
|
-
|
|
223
|
-
|
|
92
|
+
side: "bottom",
|
|
93
|
+
align: "start",
|
|
94
|
+
sideOffset: r === "popper" ? 4 : 0,
|
|
95
|
+
positionMethod: "fixed",
|
|
96
|
+
className: "z-[60]",
|
|
97
|
+
alignItemWithTrigger: r !== "popper",
|
|
98
|
+
collisionPadding: 8,
|
|
99
|
+
collisionAvoidance: { side: "flip", align: "shift", fallbackAxisSide: "none" },
|
|
100
|
+
children: /* @__PURE__ */ p(
|
|
101
|
+
a.Popup,
|
|
102
|
+
{
|
|
103
|
+
ref: s,
|
|
104
|
+
className: c(
|
|
105
|
+
i === "dark" && "dark",
|
|
106
|
+
"relative z-[60] max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md transition-opacity duration-75 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",
|
|
107
|
+
r === "popper" && "min-w-[var(--anchor-width)]",
|
|
108
|
+
e
|
|
109
|
+
),
|
|
110
|
+
...n,
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ o(u, {}),
|
|
113
|
+
/* @__PURE__ */ o(a.List, { className: "p-1 overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: t }),
|
|
114
|
+
/* @__PURE__ */ o(h, {})
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
)
|
|
224
118
|
}
|
|
225
|
-
)
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
119
|
+
) });
|
|
120
|
+
}
|
|
121
|
+
);
|
|
122
|
+
v.displayName = "SelectContent";
|
|
123
|
+
const R = l.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
|
|
124
|
+
a.GroupLabel,
|
|
125
|
+
{
|
|
126
|
+
ref: r,
|
|
127
|
+
className: c("py-1.5 pl-8 pr-2 text-sm font-semibold", e),
|
|
128
|
+
...t
|
|
231
129
|
}
|
|
232
130
|
));
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
131
|
+
R.displayName = "SelectLabel";
|
|
132
|
+
const C = l.forwardRef(
|
|
133
|
+
({ className: e, children: t, value: r, disabled: n, ...s }, i) => /* @__PURE__ */ p(
|
|
134
|
+
a.Item,
|
|
135
|
+
{
|
|
136
|
+
ref: i,
|
|
137
|
+
value: r,
|
|
138
|
+
disabled: n,
|
|
139
|
+
className: c(
|
|
140
|
+
"relative flex w-full select-none items-center whitespace-nowrap rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 cursor-pointer",
|
|
141
|
+
e
|
|
142
|
+
),
|
|
143
|
+
...s,
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ o("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ o(a.ItemIndicator, { children: /* @__PURE__ */ o(g, { className: "h-4 w-4" }) }) }),
|
|
146
|
+
/* @__PURE__ */ o(a.ItemText, { children: t })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
);
|
|
151
|
+
C.displayName = "SelectItem";
|
|
152
|
+
const T = l.forwardRef(({ ...e }, t) => /* @__PURE__ */ o(a.ItemText, { ref: t, ...e }));
|
|
153
|
+
T.displayName = "SelectItemText";
|
|
154
|
+
const k = l.forwardRef(({ ...e }, t) => /* @__PURE__ */ o(a.ItemIndicator, { ref: t, ...e }));
|
|
155
|
+
k.displayName = "SelectItemIndicator";
|
|
156
|
+
const j = l.forwardRef(({ className: e, ...t }, r) => /* @__PURE__ */ o(
|
|
157
|
+
a.Separator,
|
|
236
158
|
{
|
|
237
|
-
ref:
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
...l
|
|
159
|
+
ref: r,
|
|
160
|
+
className: c("-mx-1 my-1 h-px bg-muted", e),
|
|
161
|
+
...t
|
|
241
162
|
}
|
|
242
163
|
));
|
|
243
|
-
|
|
164
|
+
j.displayName = "SelectSeparator";
|
|
165
|
+
const V = l.forwardRef(({ asChild: e, ...t }, r) => /* @__PURE__ */ o(e ? y : "span", { ref: r, ...t }));
|
|
166
|
+
V.displayName = "SelectIcon";
|
|
244
167
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
168
|
+
U as Select,
|
|
169
|
+
v as SelectContent,
|
|
170
|
+
N as SelectGroup,
|
|
171
|
+
V as SelectIcon,
|
|
172
|
+
C as SelectItem,
|
|
173
|
+
k as SelectItemIndicator,
|
|
174
|
+
T as SelectItemText,
|
|
175
|
+
R as SelectLabel,
|
|
176
|
+
h as SelectScrollDownButton,
|
|
177
|
+
u as SelectScrollUpButton,
|
|
178
|
+
j as SelectSeparator,
|
|
179
|
+
I as SelectTrigger,
|
|
180
|
+
x as SelectValue
|
|
255
181
|
};
|
package/dist/ui/slot.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type SlotProps = React.HTMLAttributes<HTMLElement> & {
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export declare const Slot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
2
|
+
declare const composeRefs: <T>(...refs: Array<React.Ref<T> | undefined>) => (node: T | null) => void;
|
|
3
|
+
declare const Slot: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
8
4
|
children?: React.ReactNode;
|
|
9
5
|
} & React.RefAttributes<HTMLElement>>;
|
|
10
|
-
export {};
|
|
6
|
+
export { Slot, composeRefs };
|
|
11
7
|
//# sourceMappingURL=slot.d.ts.map
|
package/dist/ui/slot.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/ui/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"slot.d.ts","sourceRoot":"","sources":["../../src/ui/slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,QAAA,MAAM,WAAW,GAAI,CAAC,EAAG,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,MACvD,MAAM,CAAC,GAAG,IAAI,SAYvB,CAAA;AAmED,QAAA,MAAM,IAAI;eAHG,KAAK,CAAC,SAAS;qCAgB1B,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAA"}
|
package/dist/ui/slot.js
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (e) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
e.current = s;
|
|
1
|
+
import * as f from "react";
|
|
2
|
+
import { cn as u } from "@rpcbase/ui";
|
|
3
|
+
const a = (...t) => (n) => {
|
|
4
|
+
t.forEach((e) => {
|
|
5
|
+
if (e) {
|
|
6
|
+
if (typeof e == "function") {
|
|
7
|
+
e(n);
|
|
8
|
+
return;
|
|
12
9
|
}
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
e.current = n;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}, i = (t) => typeof t == "function" && "isReactWarning" in t && !!t.isReactWarning, l = (t) => {
|
|
14
|
+
const n = Object.getOwnPropertyDescriptor(t.props, "ref"), e = n?.get;
|
|
15
|
+
if (i(e))
|
|
16
|
+
return t.ref;
|
|
17
|
+
if (n)
|
|
18
|
+
return t.props.ref;
|
|
19
|
+
const r = Object.getOwnPropertyDescriptor(t, "ref")?.get;
|
|
20
|
+
return i(r) ? t.props.ref : t.ref;
|
|
21
|
+
}, p = (t, n) => /^on[A-Z]/.test(t) && typeof n == "function", R = (t, n) => {
|
|
22
|
+
const e = { ...t, ...n };
|
|
23
|
+
return Object.keys(t).forEach((r) => {
|
|
24
|
+
const o = t[r], c = n[r];
|
|
25
|
+
if (p(r, o) && p(r, c)) {
|
|
26
|
+
e[r] = (...s) => {
|
|
27
|
+
c(...s), s[0]?.defaultPrevented || o(...s);
|
|
28
|
+
};
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (r === "className") {
|
|
32
|
+
e[r] = u(c, o);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
r === "style" && (e[r] = {
|
|
36
|
+
...o,
|
|
37
|
+
...c
|
|
26
38
|
});
|
|
27
|
-
}
|
|
28
|
-
)
|
|
39
|
+
}), e;
|
|
40
|
+
}, m = f.forwardRef(({ children: t, ...n }, e) => {
|
|
41
|
+
if (!f.isValidElement(t))
|
|
42
|
+
return null;
|
|
43
|
+
const r = t, o = l(r), c = R(n, r.props);
|
|
44
|
+
return f.cloneElement(r, {
|
|
45
|
+
...c,
|
|
46
|
+
ref: a(o, e)
|
|
47
|
+
});
|
|
48
|
+
});
|
|
29
49
|
m.displayName = "Slot";
|
|
30
50
|
export {
|
|
31
51
|
m as Slot,
|
|
32
|
-
|
|
52
|
+
a as composeRefs
|
|
33
53
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type ThemeAppearance = "light" | "dark";
|
|
3
|
+
type ThemeProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
appearance?: ThemeAppearance;
|
|
5
|
+
};
|
|
6
|
+
declare function Theme({ appearance, className, children, ...props }: ThemeProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare const useThemeAppearance: () => ThemeAppearance;
|
|
8
|
+
export { Theme, useThemeAppearance };
|
|
9
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/ui/theme.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,KAAK,eAAe,GAAG,OAAO,GAAG,MAAM,CAAA;AAIvC,KAAK,UAAU,GAAG,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,GAAG;IACvD,UAAU,CAAC,EAAE,eAAe,CAAA;CAC7B,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,UAAoB,EACpB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,2CAWZ;AAED,QAAA,MAAM,kBAAkB,uBAAiD,CAAA;AAEzE,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAA"}
|
package/dist/ui/theme.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import { cn as a } from "@rpcbase/ui";
|
|
4
|
+
const o = r.createContext("light");
|
|
5
|
+
function h({
|
|
6
|
+
appearance: e = "light",
|
|
7
|
+
className: n,
|
|
8
|
+
children: c,
|
|
9
|
+
...m
|
|
10
|
+
}) {
|
|
11
|
+
return /* @__PURE__ */ t(o.Provider, { value: e, children: /* @__PURE__ */ t(
|
|
12
|
+
"div",
|
|
13
|
+
{
|
|
14
|
+
className: a(e === "dark" && "dark", "contents", n),
|
|
15
|
+
...m,
|
|
16
|
+
children: c
|
|
17
|
+
}
|
|
18
|
+
) });
|
|
19
|
+
}
|
|
20
|
+
const p = () => r.useContext(o);
|
|
21
|
+
export {
|
|
22
|
+
h as Theme,
|
|
23
|
+
p as useThemeAppearance
|
|
24
|
+
};
|
package/dist/ui/tooltip.d.ts
CHANGED
|
@@ -1,20 +1,37 @@
|
|
|
1
|
-
import { Tooltip as
|
|
1
|
+
import { Tooltip as BaseTooltip } from '@base-ui/react/tooltip';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
3
|
+
type TooltipProviderProps = {
|
|
4
|
+
children?: React.ReactNode;
|
|
4
5
|
delayDuration?: number;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
delay?: number;
|
|
7
|
+
closeDelay?: number;
|
|
8
|
+
};
|
|
9
|
+
declare function TooltipProvider({ children, delayDuration, delay, closeDelay, }: TooltipProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type TooltipProps = {
|
|
8
11
|
delayDuration?: number;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
open?: boolean;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare function Tooltip({ delayDuration, open, defaultOpen, onOpenChange, children, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
declare const TooltipTrigger: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
12
19
|
asChild?: boolean;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
delay?: number;
|
|
21
|
+
closeDelay?: number;
|
|
22
|
+
closeOnClick?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
25
|
+
type TooltipSide = "top" | "right" | "bottom" | "left";
|
|
26
|
+
type TooltipAlign = "start" | "center" | "end";
|
|
27
|
+
declare const TooltipContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
16
28
|
disableAnimation?: boolean;
|
|
29
|
+
side?: TooltipSide;
|
|
30
|
+
align?: TooltipAlign;
|
|
31
|
+
sideOffset?: number;
|
|
32
|
+
theme?: "dark" | "light";
|
|
33
|
+
container?: React.ComponentProps<typeof BaseTooltip.Portal>["container"];
|
|
34
|
+
positionerClassName?: string;
|
|
17
35
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
-
|
|
19
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipPortal, TooltipProvider, TooltipArrow, Tooltip as Root, TooltipTrigger as Trigger, TooltipContent as Content, TooltipPortal as Portal, TooltipProvider as Provider, TooltipArrow as Arrow, };
|
|
36
|
+
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, Tooltip as Root, TooltipTrigger as Trigger, TooltipContent as Content, TooltipProvider as Provider, };
|
|
20
37
|
//# sourceMappingURL=tooltip.d.ts.map
|
package/dist/ui/tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAe/D,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,iBAAS,eAAe,CAAC,EACvB,QAAQ,EACR,aAAiB,EACjB,KAAK,EACL,UAAU,GACX,EAAE,oBAAoB,2CAMtB;AAED,KAAK,YAAY,GAAG;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,iBAAS,OAAO,CAAC,EACf,aAAiB,EACjB,IAAI,EACJ,WAAmB,EACnB,YAAY,EACZ,QAAQ,GACT,EAAE,YAAY,2CAYd;AAUD,QAAA,MAAM,cAAc;cAPR,OAAO;YACT,MAAM;iBACD,MAAM;mBACJ,OAAO;eACX,OAAO;2CAgBnB,CAAA;AAGD,KAAK,WAAW,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAA;AACtD,KAAK,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAY9C,QAAA,MAAM,cAAc;uBATC,OAAO;WACnB,WAAW;YACV,YAAY;iBACP,MAAM;YACX,MAAM,GAAG,OAAO;gBACZ,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC;0BAClD,MAAM;wCAkD7B,CAAA;AAGD,OAAO,EACL,OAAO,EACP,cAAc,EACd,cAAc,EACd,eAAe,EACf,OAAO,IAAI,IAAI,EACf,cAAc,IAAI,OAAO,EACzB,cAAc,IAAI,OAAO,EACzB,eAAe,IAAI,QAAQ,GAC5B,CAAA"}
|