@la-batcave/ui 3.5.1 → 4.0.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/Alert.d.ts +17 -7
- package/dist/Alert.js +31 -28
- package/dist/Button.js +29 -26
- package/dist/Card.d.ts +2 -6
- package/dist/Card.js +35 -58
- package/dist/CodeBlock.js +2 -2
- package/dist/Collapse.js +8 -8
- package/dist/Combobox.js +51 -51
- package/dist/DarkMode.js +11 -11
- package/dist/DatePicker.d.ts +5 -17
- package/dist/DatePicker.js +221 -205
- package/dist/Dialog.js +65 -65
- package/dist/Drawer.js +1 -1
- package/dist/Dropdown.js +10 -10
- package/dist/HoverCard.js +13 -13
- package/dist/Input.js +633 -626
- package/dist/LogViewer.js +1 -1
- package/dist/Menubar.js +25 -25
- package/dist/Pagination.js +17 -17
- package/dist/Popover.js +4 -4
- package/dist/Resizable.js +1 -1
- package/dist/Sheet.d.ts +1 -1
- package/dist/Sheet.js +21 -21
- package/dist/Sidebar.d.ts +39 -1
- package/dist/Sidebar.js +101 -63
- package/dist/Skeleton.js +9 -9
- package/dist/Table.js +31 -31
- package/dist/Tabs.d.ts +15 -11
- package/dist/Tabs.js +134 -125
- package/dist/Toast.js +35 -34
- package/dist/Tooltip.js +1 -1
- package/dist/Typography.js +9 -9
- package/dist/Widget.js +77 -81
- package/dist/index.css +1 -1
- package/package.json +3 -2
package/dist/Combobox.js
CHANGED
|
@@ -9,11 +9,11 @@ import { R as Me, T as Ne, P as $e, C as De } from "./_shared/index-C3aZemLI.js"
|
|
|
9
9
|
import { ChevronsUpDown as Pe, Search as ze, Check as Oe } from "lucide-react";
|
|
10
10
|
import { c as U } from "./_shared/utils-eGXXUFl7.js";
|
|
11
11
|
var pe = 1, je = 0.9, Fe = 0.8, Ke = 0.17, te = 0.1, re = 0.999, qe = 0.9999, Le = 0.99, Ve = /[\\\/_+.#"@\[\(\{&]/, Be = /[\\\/_+.#"@\[\(\{&]/g, Te = /[\s-]/, ge = /[\s-]/g;
|
|
12
|
-
function le(t, n, r, f, u,
|
|
13
|
-
if (
|
|
14
|
-
var m = `${u},${
|
|
12
|
+
function le(t, n, r, f, u, i, s) {
|
|
13
|
+
if (i === n.length) return u === t.length ? pe : Le;
|
|
14
|
+
var m = `${u},${i}`;
|
|
15
15
|
if (s[m] !== void 0) return s[m];
|
|
16
|
-
for (var h = f.charAt(
|
|
16
|
+
for (var h = f.charAt(i), o = r.indexOf(h, u), d = 0, g, C, w, I; o >= 0; ) g = le(t, n, r, f, o + 1, i + 1, s), g > d && (o === u ? g *= pe : Ve.test(t.charAt(o - 1)) ? (g *= Fe, w = t.slice(u, o - 1).match(Be), w && u > 0 && (g *= Math.pow(re, w.length))) : Te.test(t.charAt(o - 1)) ? (g *= je, I = t.slice(u, o - 1).match(ge), I && u > 0 && (g *= Math.pow(re, I.length))) : (g *= Ke, u > 0 && (g *= Math.pow(re, o - u))), t.charAt(o) !== n.charAt(i) && (g *= qe)), (g < te && r.charAt(o - 1) === f.charAt(i + 1) || f.charAt(i + 1) === f.charAt(i) && r.charAt(o - 1) !== f.charAt(i)) && (C = le(t, n, r, f, o + 1, i + 2, s), C * te > g && (g = C * te)), g > d && (d = g), o = r.indexOf(h, o + 1);
|
|
17
17
|
return s[m] = d, d;
|
|
18
18
|
}
|
|
19
19
|
function ve(t) {
|
|
@@ -26,7 +26,7 @@ var K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', He = '[cmdk-group-headi
|
|
|
26
26
|
let r = O(() => {
|
|
27
27
|
var e, c;
|
|
28
28
|
return { search: "", value: (c = (e = t.value) != null ? e : t.defaultValue) != null ? c : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
29
|
-
}), f = O(() => /* @__PURE__ */ new Set()), u = O(() => /* @__PURE__ */ new Map()),
|
|
29
|
+
}), f = O(() => /* @__PURE__ */ new Set()), u = O(() => /* @__PURE__ */ new Map()), i = O(() => /* @__PURE__ */ new Map()), s = O(() => /* @__PURE__ */ new Set()), m = Ee(t), { label: h, children: o, value: d, onValueChange: g, filter: C, shouldFilter: w, loop: I, disablePointerSelection: W = !1, vimBindings: M = !0, ...B } = t, G = j(), oe = j(), J = j(), N = l.useRef(null), x = nt();
|
|
30
30
|
D(() => {
|
|
31
31
|
if (d !== void 0) {
|
|
32
32
|
let e = d.trim();
|
|
@@ -59,21 +59,21 @@ var K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', He = '[cmdk-group-headi
|
|
|
59
59
|
s.current.forEach((e) => e());
|
|
60
60
|
} }), []), X = l.useMemo(() => ({ value: (e, c, p) => {
|
|
61
61
|
var a;
|
|
62
|
-
c !== ((a =
|
|
62
|
+
c !== ((a = i.current.get(e)) == null ? void 0 : a.value) && (i.current.set(e, { value: c, keywords: p }), r.current.filtered.items.set(e, ie(c, p)), x(2, () => {
|
|
63
63
|
Y(), k.emit();
|
|
64
64
|
}));
|
|
65
65
|
}, item: (e, c) => (f.current.add(e), c && (u.current.has(c) ? u.current.get(c).add(e) : u.current.set(c, /* @__PURE__ */ new Set([e]))), x(3, () => {
|
|
66
66
|
Z(), Y(), r.current.value || Q(), k.emit();
|
|
67
67
|
}), () => {
|
|
68
|
-
|
|
68
|
+
i.current.delete(e), f.current.delete(e), r.current.filtered.items.delete(e);
|
|
69
69
|
let p = P();
|
|
70
70
|
x(4, () => {
|
|
71
71
|
Z(), p?.getAttribute("id") === e && Q(), k.emit();
|
|
72
72
|
});
|
|
73
73
|
}), group: (e) => (u.current.has(e) || u.current.set(e, /* @__PURE__ */ new Set()), () => {
|
|
74
|
-
|
|
75
|
-
}), filter: () => m.current.shouldFilter, label: h || t["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: G, inputId: J, labelId:
|
|
76
|
-
function
|
|
74
|
+
i.current.delete(e), u.current.delete(e);
|
|
75
|
+
}), filter: () => m.current.shouldFilter, label: h || t["aria-label"], getDisablePointerSelection: () => m.current.disablePointerSelection, listId: G, inputId: J, labelId: oe, listInnerRef: N }), []);
|
|
76
|
+
function ie(e, c) {
|
|
77
77
|
var p, a;
|
|
78
78
|
let v = (a = (p = m.current) == null ? void 0 : p.filter) != null ? a : We;
|
|
79
79
|
return e ? v(e, r.current.search, c) : 0;
|
|
@@ -115,7 +115,7 @@ var K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', He = '[cmdk-group-headi
|
|
|
115
115
|
r.current.filtered.groups = /* @__PURE__ */ new Set();
|
|
116
116
|
let v = 0;
|
|
117
117
|
for (let b of f.current) {
|
|
118
|
-
let E = (c = (e =
|
|
118
|
+
let E = (c = (e = i.current.get(b)) == null ? void 0 : e.value) != null ? c : "", y = (a = (p = i.current.get(b)) == null ? void 0 : p.keywords) != null ? a : [], T = ie(E, y);
|
|
119
119
|
r.current.filtered.items.set(b, T), T > 0 && v++;
|
|
120
120
|
}
|
|
121
121
|
for (let [b, E] of u.current) for (let y of E) if (r.current.filtered.items.get(y) > 0) {
|
|
@@ -199,13 +199,13 @@ var K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', He = '[cmdk-group-headi
|
|
|
199
199
|
} }, l.createElement("label", { "cmdk-label": "", htmlFor: X.inputId, id: X.labelId, style: at }, h), H(t, (e) => l.createElement(ye.Provider, { value: k }, l.createElement(xe.Provider, { value: X }, e))));
|
|
200
200
|
}), Ge = l.forwardRef((t, n) => {
|
|
201
201
|
var r, f;
|
|
202
|
-
let u = j(),
|
|
202
|
+
let u = j(), i = l.useRef(null), s = l.useContext(we), m = V(), h = Ee(t), o = (f = (r = h.current) == null ? void 0 : r.forceMount) != null ? f : s?.forceMount;
|
|
203
203
|
D(() => {
|
|
204
|
-
if (!
|
|
205
|
-
}, [
|
|
206
|
-
let d = Ce(u,
|
|
204
|
+
if (!o) return m.item(u, s?.id);
|
|
205
|
+
}, [o]);
|
|
206
|
+
let d = Ce(u, i, [t.value, t.children, i], t.keywords), g = ue(), C = R((x) => x.value && x.value === d.current), w = R((x) => o || m.filter() === !1 ? !0 : x.search ? x.filtered.items.get(u) > 0 : !0);
|
|
207
207
|
l.useEffect(() => {
|
|
208
|
-
let x =
|
|
208
|
+
let x = i.current;
|
|
209
209
|
if (!(!x || t.disabled)) return x.addEventListener(ae, I), () => x.removeEventListener(ae, I);
|
|
210
210
|
}, [w, t.onSelect, t.disabled]);
|
|
211
211
|
function I() {
|
|
@@ -216,44 +216,44 @@ var K = '[cmdk-group=""]', ne = '[cmdk-group-items=""]', He = '[cmdk-group-headi
|
|
|
216
216
|
g.setState("value", d.current, !0);
|
|
217
217
|
}
|
|
218
218
|
if (!w) return null;
|
|
219
|
-
let { disabled: M, value: B, onSelect: G, forceMount:
|
|
220
|
-
return l.createElement(A.div, { ref: L(
|
|
219
|
+
let { disabled: M, value: B, onSelect: G, forceMount: oe, keywords: J, ...N } = t;
|
|
220
|
+
return l.createElement(A.div, { ref: L(i, n), ...N, id: u, "cmdk-item": "", role: "option", "aria-disabled": !!M, "aria-selected": !!C, "data-disabled": !!M, "data-selected": !!C, onPointerMove: M || m.getDisablePointerSelection() ? void 0 : W, onClick: M ? void 0 : I }, t.children);
|
|
221
221
|
}), Je = l.forwardRef((t, n) => {
|
|
222
|
-
let { heading: r, children: f, forceMount: u, ...
|
|
222
|
+
let { heading: r, children: f, forceMount: u, ...i } = t, s = j(), m = l.useRef(null), h = l.useRef(null), o = j(), d = V(), g = R((w) => u || d.filter() === !1 ? !0 : w.search ? w.filtered.groups.has(s) : !0);
|
|
223
223
|
D(() => d.group(s), []), Ce(s, m, [t.value, t.heading, h]);
|
|
224
224
|
let C = l.useMemo(() => ({ id: s, forceMount: u }), [u]);
|
|
225
|
-
return l.createElement(A.div, { ref: L(m, n), ...
|
|
225
|
+
return l.createElement(A.div, { ref: L(m, n), ...i, "cmdk-group": "", role: "presentation", hidden: g ? void 0 : !0 }, r && l.createElement("div", { ref: h, "cmdk-group-heading": "", "aria-hidden": !0, id: o }, r), H(t, (w) => l.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": r ? o : void 0 }, l.createElement(we.Provider, { value: C }, w))));
|
|
226
226
|
}), Xe = l.forwardRef((t, n) => {
|
|
227
|
-
let { alwaysRender: r, ...f } = t, u = l.useRef(null),
|
|
228
|
-
return !r && !
|
|
227
|
+
let { alwaysRender: r, ...f } = t, u = l.useRef(null), i = R((s) => !s.search);
|
|
228
|
+
return !r && !i ? null : l.createElement(A.div, { ref: L(u, n), ...f, "cmdk-separator": "", role: "separator" });
|
|
229
229
|
}), Ye = l.forwardRef((t, n) => {
|
|
230
|
-
let { onValueChange: r, ...f } = t, u = t.value != null,
|
|
230
|
+
let { onValueChange: r, ...f } = t, u = t.value != null, i = ue(), s = R((o) => o.search), m = R((o) => o.selectedItemId), h = V();
|
|
231
231
|
return l.useEffect(() => {
|
|
232
|
-
t.value != null &&
|
|
233
|
-
}, [t.value]), l.createElement(A.input, { ref: n, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": h.listId, "aria-labelledby": h.labelId, "aria-activedescendant": m, id: h.inputId, type: "text", value: u ? t.value : s, onChange: (
|
|
234
|
-
u ||
|
|
232
|
+
t.value != null && i.setState("search", t.value);
|
|
233
|
+
}, [t.value]), l.createElement(A.input, { ref: n, ...f, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": h.listId, "aria-labelledby": h.labelId, "aria-activedescendant": m, id: h.inputId, type: "text", value: u ? t.value : s, onChange: (o) => {
|
|
234
|
+
u || i.setState("search", o.target.value), r?.(o.target.value);
|
|
235
235
|
} });
|
|
236
236
|
}), Qe = l.forwardRef((t, n) => {
|
|
237
|
-
let { children: r, label: f = "Suggestions", ...u } = t,
|
|
237
|
+
let { children: r, label: f = "Suggestions", ...u } = t, i = l.useRef(null), s = l.useRef(null), m = R((o) => o.selectedItemId), h = V();
|
|
238
238
|
return l.useEffect(() => {
|
|
239
|
-
if (s.current &&
|
|
240
|
-
let
|
|
239
|
+
if (s.current && i.current) {
|
|
240
|
+
let o = s.current, d = i.current, g, C = new ResizeObserver(() => {
|
|
241
241
|
g = requestAnimationFrame(() => {
|
|
242
|
-
let w =
|
|
242
|
+
let w = o.offsetHeight;
|
|
243
243
|
d.style.setProperty("--cmdk-list-height", w.toFixed(1) + "px");
|
|
244
244
|
});
|
|
245
245
|
});
|
|
246
|
-
return C.observe(
|
|
247
|
-
cancelAnimationFrame(g), C.unobserve(
|
|
246
|
+
return C.observe(o), () => {
|
|
247
|
+
cancelAnimationFrame(g), C.unobserve(o);
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
}, []), l.createElement(A.div, { ref: L(
|
|
250
|
+
}, []), l.createElement(A.div, { ref: L(i, n), ...u, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": m, "aria-label": f, id: h.listId }, H(t, (o) => l.createElement("div", { ref: L(s, h.listInnerRef), "cmdk-list-sizer": "" }, o)));
|
|
251
251
|
}), Ze = l.forwardRef((t, n) => {
|
|
252
|
-
let { open: r, onOpenChange: f, overlayClassName: u, contentClassName:
|
|
253
|
-
return l.createElement(Se, { open: r, onOpenChange: f }, l.createElement(Ie, { container: s }, l.createElement(Re, { "cmdk-overlay": "", className: u }), l.createElement(Ae, { "aria-label": t.label, "cmdk-dialog": "", className:
|
|
252
|
+
let { open: r, onOpenChange: f, overlayClassName: u, contentClassName: i, container: s, ...m } = t;
|
|
253
|
+
return l.createElement(Se, { open: r, onOpenChange: f }, l.createElement(Ie, { container: s }, l.createElement(Re, { "cmdk-overlay": "", className: u }), l.createElement(Ae, { "aria-label": t.label, "cmdk-dialog": "", className: i }, l.createElement(ke, { ref: n, ...m }))));
|
|
254
254
|
}), _e = l.forwardRef((t, n) => R((r) => r.filtered.count === 0) ? l.createElement(A.div, { ref: n, ...t, "cmdk-empty": "", role: "presentation" }) : null), et = l.forwardRef((t, n) => {
|
|
255
|
-
let { progress: r, children: f, label: u = "Loading...", ...
|
|
256
|
-
return l.createElement(A.div, { ref: n, ...
|
|
255
|
+
let { progress: r, children: f, label: u = "Loading...", ...i } = t;
|
|
256
|
+
return l.createElement(A.div, { ref: n, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": r, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": u }, H(t, (s) => l.createElement("div", { "aria-hidden": !0 }, s)));
|
|
257
257
|
}), q = Object.assign(ke, { List: Qe, Item: Ge, Input: Ye, Group: Je, Separator: Xe, Dialog: Ze, Empty: _e, Loading: et });
|
|
258
258
|
function tt(t, n) {
|
|
259
259
|
let r = t.nextElementSibling;
|
|
@@ -285,17 +285,17 @@ function R(t) {
|
|
|
285
285
|
return l.useSyncExternalStore(n.subscribe, r, r);
|
|
286
286
|
}
|
|
287
287
|
function Ce(t, n, r, f = []) {
|
|
288
|
-
let u = l.useRef(),
|
|
288
|
+
let u = l.useRef(), i = V();
|
|
289
289
|
return D(() => {
|
|
290
290
|
var s;
|
|
291
291
|
let m = (() => {
|
|
292
|
-
var
|
|
292
|
+
var o;
|
|
293
293
|
for (let d of r) {
|
|
294
294
|
if (typeof d == "string") return d.trim();
|
|
295
|
-
if (typeof d == "object" && "current" in d) return d.current ? (
|
|
295
|
+
if (typeof d == "object" && "current" in d) return d.current ? (o = d.current.textContent) == null ? void 0 : o.trim() : u.current;
|
|
296
296
|
}
|
|
297
|
-
})(), h = f.map((
|
|
298
|
-
|
|
297
|
+
})(), h = f.map((o) => o.trim());
|
|
298
|
+
i.value(t, m, h), (s = n.current) == null || s.setAttribute(z, m), u.current = m;
|
|
299
299
|
}), u;
|
|
300
300
|
}
|
|
301
301
|
var nt = () => {
|
|
@@ -320,10 +320,10 @@ function pt({
|
|
|
320
320
|
onChange: r,
|
|
321
321
|
placeholder: f = "Rechercher...",
|
|
322
322
|
emptyMessage: u = "Aucun resultat.",
|
|
323
|
-
disabled:
|
|
323
|
+
disabled: i = !1,
|
|
324
324
|
className: s
|
|
325
325
|
}) {
|
|
326
|
-
const [m, h] = l.useState(!1),
|
|
326
|
+
const [m, h] = l.useState(!1), o = t.find((d) => d.value === n);
|
|
327
327
|
return /* @__PURE__ */ $(Me, { open: m, onOpenChange: h, children: [
|
|
328
328
|
/* @__PURE__ */ S(Ne, { asChild: !0, children: /* @__PURE__ */ $(
|
|
329
329
|
"button",
|
|
@@ -331,18 +331,18 @@ function pt({
|
|
|
331
331
|
type: "button",
|
|
332
332
|
role: "combobox",
|
|
333
333
|
"aria-expanded": m,
|
|
334
|
-
disabled:
|
|
334
|
+
disabled: i,
|
|
335
335
|
className: U(
|
|
336
|
-
"flex items-center justify-between gap-2 w-full bg-
|
|
337
|
-
"focus:border-
|
|
336
|
+
"flex items-center justify-between gap-2 w-full bg-input/50 border border-transparent rounded-3xl px-3 py-2 text-sm text-foreground transition-[color,box-shadow,border-color] cursor-pointer",
|
|
337
|
+
"focus:border-ring focus:ring-3 focus:ring-ring/30 focus:outline-none",
|
|
338
338
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
339
339
|
!n && "text-muted-foreground",
|
|
340
340
|
s
|
|
341
341
|
),
|
|
342
342
|
children: [
|
|
343
343
|
/* @__PURE__ */ $("span", { className: "flex items-center gap-2 truncate", children: [
|
|
344
|
-
|
|
345
|
-
|
|
344
|
+
o?.icon && /* @__PURE__ */ S(o.icon, { className: "size-4 shrink-0" }),
|
|
345
|
+
o ? o.label : f
|
|
346
346
|
] }),
|
|
347
347
|
/* @__PURE__ */ S(Pe, { size: 16, className: "text-muted-foreground shrink-0" })
|
|
348
348
|
]
|
|
@@ -354,7 +354,7 @@ function pt({
|
|
|
354
354
|
sideOffset: 4,
|
|
355
355
|
align: "start",
|
|
356
356
|
className: U(
|
|
357
|
-
"z-50 w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-
|
|
357
|
+
"z-50 w-[var(--radix-popover-trigger-width)] overflow-hidden rounded-3xl border border-border bg-card/95 backdrop-blur-md shadow-lg",
|
|
358
358
|
"animate-in fade-in-0 zoom-in-95"
|
|
359
359
|
),
|
|
360
360
|
children: /* @__PURE__ */ $(q, { className: "flex flex-col", children: [
|
|
@@ -378,7 +378,7 @@ function pt({
|
|
|
378
378
|
r(d.value === n ? "" : d.value), h(!1);
|
|
379
379
|
},
|
|
380
380
|
className: U(
|
|
381
|
-
"flex items-center gap-2 rounded-
|
|
381
|
+
"flex items-center gap-2 rounded-2xl px-2 py-1.5 text-sm text-foreground cursor-pointer select-none outline-none transition-colors",
|
|
382
382
|
"data-[selected=true]:bg-primary/10 data-[selected=true]:text-foreground"
|
|
383
383
|
),
|
|
384
384
|
children: [
|
package/dist/DarkMode.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as o } from "react/jsx-runtime";
|
|
3
|
-
import { useState as m, useEffect as
|
|
3
|
+
import { useState as m, useEffect as f } from "react";
|
|
4
4
|
import { c as g } from "./_shared/utils-eGXXUFl7.js";
|
|
5
5
|
import { Sun as h, Moon as p } from "lucide-react";
|
|
6
6
|
const i = "btcv-theme";
|
|
@@ -13,13 +13,13 @@ function d(e) {
|
|
|
13
13
|
function b(e) {
|
|
14
14
|
typeof window < "u" && localStorage.setItem(i, e), d(e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function x() {
|
|
17
17
|
const n = c() === "dark" ? "light" : "dark";
|
|
18
18
|
return b(n), n;
|
|
19
19
|
}
|
|
20
20
|
function E({ size: e = "md", onChange: n, className: u, ...l }) {
|
|
21
|
-
const [
|
|
22
|
-
|
|
21
|
+
const [a, r] = m("dark");
|
|
22
|
+
f(() => {
|
|
23
23
|
const t = c();
|
|
24
24
|
r(t), d(t);
|
|
25
25
|
}, []);
|
|
@@ -29,28 +29,28 @@ function E({ size: e = "md", onChange: n, className: u, ...l }) {
|
|
|
29
29
|
{
|
|
30
30
|
type: "button",
|
|
31
31
|
onClick: () => {
|
|
32
|
-
const t =
|
|
32
|
+
const t = x();
|
|
33
33
|
r(t), n?.(t);
|
|
34
34
|
},
|
|
35
35
|
className: g(
|
|
36
36
|
"inline-flex items-center justify-center cursor-pointer transition-all select-none outline-none",
|
|
37
37
|
"bg-transparent text-muted-foreground border border-transparent",
|
|
38
38
|
"hover:bg-accent hover:text-foreground",
|
|
39
|
-
"focus-visible:ring
|
|
39
|
+
"focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30",
|
|
40
40
|
{
|
|
41
|
-
sm: "h-7 w-7 rounded-
|
|
42
|
-
md: "h-9 w-9 rounded-
|
|
43
|
-
lg: "h-11 w-11 rounded-
|
|
41
|
+
sm: "h-7 w-7 rounded-xl",
|
|
42
|
+
md: "h-9 w-9 rounded-xl",
|
|
43
|
+
lg: "h-11 w-11 rounded-xl"
|
|
44
44
|
}[e],
|
|
45
45
|
u
|
|
46
46
|
),
|
|
47
47
|
...l,
|
|
48
|
-
children:
|
|
48
|
+
children: a === "dark" ? /* @__PURE__ */ o(h, { size: s }) : /* @__PURE__ */ o(p, { size: s })
|
|
49
49
|
}
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
export {
|
|
53
53
|
E as ThemeToggle,
|
|
54
54
|
b as setTheme,
|
|
55
|
-
|
|
55
|
+
x as toggleTheme
|
|
56
56
|
};
|
package/dist/DatePicker.d.ts
CHANGED
|
@@ -12,19 +12,14 @@ export interface DatePickerProps {
|
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Standalone calendar component wrapping react-day-picker with BTCV styling.
|
|
16
|
-
*
|
|
15
|
+
* Standalone calendar component wrapping react-day-picker with BTCV Luma styling.
|
|
16
|
+
* Supports single selection and date ranges.
|
|
17
17
|
*
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
20
|
-
* Accepts the same props as DayPicker.
|
|
18
|
+
* @example
|
|
19
|
+
* <Calendar mode="single" selected={date} onSelect={setDate} />
|
|
21
20
|
*
|
|
22
21
|
* @example
|
|
23
|
-
* <Calendar
|
|
24
|
-
* mode="single"
|
|
25
|
-
* selected={date}
|
|
26
|
-
* onSelect={setDate}
|
|
27
|
-
* />
|
|
22
|
+
* <Calendar mode="range" selected={range} onSelect={setRange} />
|
|
28
23
|
*/
|
|
29
24
|
declare function Calendar(props: DayPickerProps & {
|
|
30
25
|
className?: string;
|
|
@@ -32,17 +27,10 @@ declare function Calendar(props: DayPickerProps & {
|
|
|
32
27
|
/**
|
|
33
28
|
* Date picker input that opens a calendar popover on click.
|
|
34
29
|
* The trigger is styled to match the Input component.
|
|
35
|
-
* Uses Intl.DateTimeFormat for locale-aware date formatting.
|
|
36
|
-
*
|
|
37
|
-
* @description Combines a Radix Popover with the Calendar component.
|
|
38
|
-
* The popover closes automatically when a date is selected.
|
|
39
30
|
*
|
|
40
31
|
* @example
|
|
41
32
|
* const [date, setDate] = React.useState<Date>();
|
|
42
33
|
* <DatePicker label="Date de naissance" value={date} onChange={setDate} />
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* <DatePicker placeholder="Selectionner..." />
|
|
46
34
|
*/
|
|
47
35
|
declare function DatePicker({ value, onChange, placeholder, label, className, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
48
36
|
export { Calendar, DatePicker };
|