@jfrader/ui 0.4.0 → 0.5.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/README.md +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-BcySQfjZ.js +798 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-Cb3EHs64.js +268 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- package/dist/textarea.js +1 -1
- package/dist/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +23 -5
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +70 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
-
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { t as i } from "./calendar-C9Yad_-w.js";
|
|
6
|
-
import { n as a } from "./surface-DZ4d-2aL.js";
|
|
7
|
-
import { n as o, t as s } from "./use-overlay-floating-Bit-f0FU.js";
|
|
8
|
-
import { t as c } from "./text-field-D60ok14S.js";
|
|
9
|
-
import { createContext as l, useContext as u, useEffect as d, useId as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
10
|
-
import { vars as _ } from "@jfrader/tokens/vars";
|
|
11
|
-
import { jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
12
|
-
import { FloatingFocusManager as b, useClick as x, useDismiss as S, useInteractions as C, useMergeRefs as w, useRole as T } from "@floating-ui/react";
|
|
13
|
-
//#region src/components/date-picker/date-picker.tsx
|
|
14
|
-
var E = "bottom-start", D = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), O = " ", k = "[data-ui=\"calendar-day\"][tabindex=\"0\"]", A = "[data-ui=\"calendar-day\"]", j = /^\d{4}-\d{2}-\d{2}$/, M = {
|
|
15
|
-
calendar: "gregory",
|
|
16
|
-
timeZone: "UTC",
|
|
17
|
-
dateStyle: "medium"
|
|
18
|
-
}, N = l(null);
|
|
19
|
-
function P(e) {
|
|
20
|
-
let t = u(N);
|
|
21
|
-
if (!t) throw Error(`DatePicker.${e} must be rendered inside <DatePicker>.`);
|
|
22
|
-
return t;
|
|
23
|
-
}
|
|
24
|
-
var F = (e, t) => String(e).padStart(t, "0"), I = (e, t, n) => `${F(e, 4)}-${F(t, 2)}-${F(n, 2)}`;
|
|
25
|
-
function L(e) {
|
|
26
|
-
if (e === void 0 || !j.test(e)) return;
|
|
27
|
-
let [t = NaN, n = NaN, r = NaN] = e.split("-").map(Number), i = new Date(Date.UTC(0, 0, 1));
|
|
28
|
-
return i.setUTCFullYear(t, n - 1, r), I(i.getUTCFullYear(), i.getUTCMonth() + 1, i.getUTCDate()) === e ? i : void 0;
|
|
29
|
-
}
|
|
30
|
-
var R = (e) => L(e) ? e : void 0;
|
|
31
|
-
function ee(e, t, n) {
|
|
32
|
-
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
33
|
-
}
|
|
34
|
-
function te() {
|
|
35
|
-
let e = /* @__PURE__ */ new Date();
|
|
36
|
-
return I(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
37
|
-
}
|
|
38
|
-
var ne = () => typeof navigator > "u" ? void 0 : navigator.language;
|
|
39
|
-
function re(e, t) {
|
|
40
|
-
let n = new Intl.DisplayNames(t, { type: "dateTimeField" });
|
|
41
|
-
return e.formatToParts(/* @__PURE__ */ new Date(0)).map((e) => e.type === "literal" ? e.value : n.of(e.type) ?? e.value).join("");
|
|
42
|
-
}
|
|
43
|
-
function z(e) {
|
|
44
|
-
let t = e?.querySelector(k) ?? null;
|
|
45
|
-
return t?.focus({ preventScroll: !0 }), t;
|
|
46
|
-
}
|
|
47
|
-
var B = e({
|
|
48
|
-
cursor: "pointer",
|
|
49
|
-
"&:disabled": { cursor: "not-allowed" }
|
|
50
|
-
}), V = e({
|
|
51
|
-
...a,
|
|
52
|
-
borderRadius: _.radius.md,
|
|
53
|
-
boxShadow: _.shadow.overlay,
|
|
54
|
-
padding: _.space[3]
|
|
55
|
-
});
|
|
56
|
-
function H({ value: e, defaultValue: t, onValueChange: r, open: i, defaultOpen: a = !1, onOpenChange: o, min: c, max: l, locale: u, firstDayOfWeek: f, disabled: p = !1, name: _, placeholder: b, children: w }) {
|
|
57
|
-
let [D, O] = n(e, t, r), [k = !1, A] = n(i, a, o), [j, P] = g(!1), F = p || j, I = k && !F, [z, B] = g(null), V = h(null), H = h(!1), U = m(() => new Intl.DateTimeFormat(u ?? ne()).resolvedOptions().locale, [u]), W = m(() => new Intl.DateTimeFormat(U, M), [U]), G = m(() => re(W, U), [W, U]), K = L(D), q = K ? W.format(K) : "", J = R(c), Y = R(l), X = ee(R(D) ?? te(), J, Y).slice(0, 7), { refs: Z, floatingStyles: Q, context: $ } = s({
|
|
58
|
-
open: I,
|
|
59
|
-
placement: E,
|
|
60
|
-
onOpenChange: (e, t, n) => {
|
|
61
|
-
F && e || (e || (H.current = n === "escape-key"), A(e));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
d(() => {
|
|
65
|
-
F && (H.current = !1, k && A(!1));
|
|
66
|
-
}, [
|
|
67
|
-
F,
|
|
68
|
-
k,
|
|
69
|
-
A
|
|
70
|
-
]), d(() => {
|
|
71
|
-
!F && !I && H.current && (H.current = !1, Z.domReference.current?.focus());
|
|
72
|
-
}, [
|
|
73
|
-
F,
|
|
74
|
-
I,
|
|
75
|
-
Z
|
|
76
|
-
]);
|
|
77
|
-
let ie = x($, {
|
|
78
|
-
enabled: !F,
|
|
79
|
-
keyboardHandlers: !1
|
|
80
|
-
}), ae = S($, {
|
|
81
|
-
escapeKey: !0,
|
|
82
|
-
outsidePress: !0
|
|
83
|
-
}), oe = T($, { role: "dialog" }), { getReferenceProps: se, getFloatingProps: ce } = C([
|
|
84
|
-
ie,
|
|
85
|
-
ae,
|
|
86
|
-
oe
|
|
87
|
-
]), le = m(() => ({
|
|
88
|
-
open: I,
|
|
89
|
-
disabled: F,
|
|
90
|
-
value: D,
|
|
91
|
-
displayValue: q,
|
|
92
|
-
placeholder: b ?? G,
|
|
93
|
-
initialMonth: X,
|
|
94
|
-
min: J,
|
|
95
|
-
max: Y,
|
|
96
|
-
locale: U,
|
|
97
|
-
firstDayOfWeek: f,
|
|
98
|
-
inputLabelling: z,
|
|
99
|
-
gridRef: V,
|
|
100
|
-
refs: Z,
|
|
101
|
-
floatingContext: $,
|
|
102
|
-
floatingStyles: Q,
|
|
103
|
-
getReferenceProps: se,
|
|
104
|
-
getFloatingProps: ce,
|
|
105
|
-
requestOpenChange: (e) => {
|
|
106
|
-
F && e || A(e);
|
|
107
|
-
},
|
|
108
|
-
selectDate: (e) => {
|
|
109
|
-
F || (O(e), H.current = !0, A(!1));
|
|
110
|
-
},
|
|
111
|
-
setInputLabelling: B,
|
|
112
|
-
setInputDisabled: P
|
|
113
|
-
}), [
|
|
114
|
-
I,
|
|
115
|
-
F,
|
|
116
|
-
D,
|
|
117
|
-
q,
|
|
118
|
-
b,
|
|
119
|
-
G,
|
|
120
|
-
X,
|
|
121
|
-
J,
|
|
122
|
-
Y,
|
|
123
|
-
U,
|
|
124
|
-
f,
|
|
125
|
-
z,
|
|
126
|
-
Z,
|
|
127
|
-
$,
|
|
128
|
-
Q,
|
|
129
|
-
se,
|
|
130
|
-
ce,
|
|
131
|
-
A,
|
|
132
|
-
O
|
|
133
|
-
]);
|
|
134
|
-
return /* @__PURE__ */ y(N.Provider, {
|
|
135
|
-
value: le,
|
|
136
|
-
children: [w, _ !== void 0 && /* @__PURE__ */ v("input", {
|
|
137
|
-
type: "hidden",
|
|
138
|
-
name: _,
|
|
139
|
-
value: D ?? "",
|
|
140
|
-
disabled: F
|
|
141
|
-
})]
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
H.displayName = "DatePicker";
|
|
145
|
-
function U({ ref: e, label: t, id: n, disabled: i, slotProps: a, onKeyDown: o, onKeyUp: s, ...l }) {
|
|
146
|
-
let { open: u, disabled: d, displayValue: m, placeholder: h, gridRef: g, refs: _, getReferenceProps: y, requestOpenChange: b, setInputLabelling: x, setInputDisabled: S } = P("Input"), C = w([_.setReference, e]), T = f(), E = n ?? T, k = `${E}-label`, A = r(t), j = l["aria-labelledby"], M = l["aria-label"], N = M ?? (typeof t == "string" ? t : void 0), F = d || i === !0;
|
|
147
|
-
p(() => (S(i === !0), () => S(!1)), [i, S]), p(() => (x(j === void 0 ? M === void 0 ? typeof t == "string" ? { label: t } : { labelledBy: A ? k : void 0 } : { label: M } : { labelledBy: j }), () => x(null)), [
|
|
148
|
-
j,
|
|
149
|
-
M,
|
|
150
|
-
t,
|
|
151
|
-
A,
|
|
152
|
-
k,
|
|
153
|
-
x
|
|
154
|
-
]);
|
|
155
|
-
let I = () => {
|
|
156
|
-
F || (u ? z(g.current) : b(!0));
|
|
157
|
-
}, L = (e) => {
|
|
158
|
-
o?.(e), !(e.defaultPrevented || F) && (e.key === O ? e.preventDefault() : D.has(e.key) && (e.preventDefault(), I()));
|
|
159
|
-
}, R = (e) => {
|
|
160
|
-
s?.(e), !(e.defaultPrevented || F || e.key !== O) && I();
|
|
161
|
-
};
|
|
162
|
-
return /* @__PURE__ */ v(c, {
|
|
163
|
-
...y({
|
|
164
|
-
...l,
|
|
165
|
-
onKeyDown: L,
|
|
166
|
-
onKeyUp: R
|
|
167
|
-
}),
|
|
168
|
-
ref: C,
|
|
169
|
-
id: E,
|
|
170
|
-
label: A ? /* @__PURE__ */ v("span", {
|
|
171
|
-
id: k,
|
|
172
|
-
children: t
|
|
173
|
-
}) : t,
|
|
174
|
-
slotProps: {
|
|
175
|
-
...a,
|
|
176
|
-
control: {
|
|
177
|
-
...a?.control,
|
|
178
|
-
css: [B, a?.control?.css]
|
|
179
|
-
}
|
|
180
|
-
},
|
|
181
|
-
value: m,
|
|
182
|
-
placeholder: h,
|
|
183
|
-
disabled: F,
|
|
184
|
-
readOnly: !0,
|
|
185
|
-
role: "combobox",
|
|
186
|
-
"aria-label": N,
|
|
187
|
-
"aria-autocomplete": "none",
|
|
188
|
-
"data-state": u ? "open" : "closed",
|
|
189
|
-
"data-ui": "date-picker-input"
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
U.displayName = "DatePicker.Input";
|
|
193
|
-
function W({ ref: e, style: n, className: r, sx: a, ...s }) {
|
|
194
|
-
let { open: c, value: l, initialMonth: u, min: d, max: f, locale: p, firstDayOfWeek: m, inputLabelling: g, gridRef: _, refs: x, floatingContext: S, floatingStyles: C, getFloatingProps: T, selectDate: E } = P("Popup"), D = w([x.setFloating, e]), O = h(null), k = w([(e) => {
|
|
195
|
-
_.current = e, O.current = z(e);
|
|
196
|
-
}]);
|
|
197
|
-
if (!c) return null;
|
|
198
|
-
let j = s["aria-labelledby"] !== void 0 || s["aria-label"] !== void 0 ? {} : g?.labelledBy === void 0 ? { "aria-label": g?.label } : { "aria-labelledby": g.labelledBy }, M = (e) => {
|
|
199
|
-
let t = e.target.closest(A);
|
|
200
|
-
if (t?.disabled) return;
|
|
201
|
-
let n = t?.dataset.date;
|
|
202
|
-
n !== void 0 && E(n);
|
|
203
|
-
}, N = (e) => {
|
|
204
|
-
e.target.closest(A)?.disabled && e.preventDefault();
|
|
205
|
-
};
|
|
206
|
-
return /* @__PURE__ */ v(o, { children: /* @__PURE__ */ v(b, {
|
|
207
|
-
context: S,
|
|
208
|
-
modal: !1,
|
|
209
|
-
initialFocus: O,
|
|
210
|
-
returnFocus: !1,
|
|
211
|
-
children: /* @__PURE__ */ v(t, {
|
|
212
|
-
className: r,
|
|
213
|
-
styles: V,
|
|
214
|
-
sx: a,
|
|
215
|
-
children: (e) => /* @__PURE__ */ v("div", {
|
|
216
|
-
...T({
|
|
217
|
-
...j,
|
|
218
|
-
...s
|
|
219
|
-
}),
|
|
220
|
-
ref: D,
|
|
221
|
-
"data-ui": "date-picker-popup",
|
|
222
|
-
style: {
|
|
223
|
-
...n,
|
|
224
|
-
...C
|
|
225
|
-
},
|
|
226
|
-
className: e,
|
|
227
|
-
children: /* @__PURE__ */ y(i, {
|
|
228
|
-
value: l ?? "",
|
|
229
|
-
defaultVisibleMonth: u,
|
|
230
|
-
min: d,
|
|
231
|
-
max: f,
|
|
232
|
-
locale: p,
|
|
233
|
-
firstDayOfWeek: m,
|
|
234
|
-
children: [/* @__PURE__ */ v(i.Header, {}), /* @__PURE__ */ v(i.Grid, {
|
|
235
|
-
ref: k,
|
|
236
|
-
onClick: M,
|
|
237
|
-
onPointerDownCapture: N
|
|
238
|
-
})]
|
|
239
|
-
})
|
|
240
|
-
})
|
|
241
|
-
})
|
|
242
|
-
}) });
|
|
243
|
-
}
|
|
244
|
-
W.displayName = "DatePicker.Popup";
|
|
245
|
-
var G = Object.assign(H, {
|
|
246
|
-
Input: U,
|
|
247
|
-
Popup: W
|
|
248
|
-
});
|
|
249
|
-
//#endregion
|
|
250
|
-
export { G as t };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { n } from "./media-D_eA_I-e.js";
|
|
4
|
-
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
-
import { useId as i } from "react";
|
|
6
|
-
import { vars as a } from "@jfrader/tokens/vars";
|
|
7
|
-
import { jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
|
|
8
|
-
//#region src/styling/input-control.ts
|
|
9
|
-
var c = e({
|
|
10
|
-
display: "block",
|
|
11
|
-
inlineSize: "100%",
|
|
12
|
-
boxSizing: "border-box",
|
|
13
|
-
margin: 0,
|
|
14
|
-
backgroundColor: a.color.surfaceRaised,
|
|
15
|
-
border: `1px solid ${a.color.borderControl}`,
|
|
16
|
-
borderRadius: a.radius.md,
|
|
17
|
-
color: a.color.text,
|
|
18
|
-
fontFamily: a.font.sans,
|
|
19
|
-
transitionProperty: "border-color",
|
|
20
|
-
transitionDuration: a.motion.duration.fast,
|
|
21
|
-
transitionTimingFunction: a.motion.easeStandard,
|
|
22
|
-
"&::placeholder": { color: a.color.textSubtle },
|
|
23
|
-
"&:hover:not(:disabled):not(:focus-visible)": { borderColor: a.color.textSubtle },
|
|
24
|
-
"&:focus-visible": {
|
|
25
|
-
outline: `2px solid ${a.color.focusRing}`,
|
|
26
|
-
outlineOffset: "2px",
|
|
27
|
-
borderColor: a.color.focusRing
|
|
28
|
-
},
|
|
29
|
-
"&:disabled": {
|
|
30
|
-
opacity: .55,
|
|
31
|
-
cursor: "not-allowed"
|
|
32
|
-
},
|
|
33
|
-
"&[aria-invalid=\"true\"]:not(:focus-visible)": { borderColor: a.color.dangerBorder },
|
|
34
|
-
[n]: { transitionDuration: "0s" }
|
|
35
|
-
}), l = e({
|
|
36
|
-
display: "grid",
|
|
37
|
-
gap: a.space[1],
|
|
38
|
-
inlineSize: "100%"
|
|
39
|
-
}), u = e({
|
|
40
|
-
display: "inline-flex",
|
|
41
|
-
gap: a.space[1],
|
|
42
|
-
fontSize: a.textSize.sm,
|
|
43
|
-
fontWeight: a.fontWeight.medium,
|
|
44
|
-
color: a.color.text
|
|
45
|
-
}), d = e({ color: a.color.dangerText }), f = e({
|
|
46
|
-
fontSize: a.textSize.sm,
|
|
47
|
-
color: a.color.textMuted
|
|
48
|
-
}), p = e({
|
|
49
|
-
fontSize: a.textSize.sm,
|
|
50
|
-
color: a.color.dangerText
|
|
51
|
-
});
|
|
52
|
-
function m({ id: e, description: t, error: n, "aria-describedby": a, "aria-invalid": o }) {
|
|
53
|
-
let s = i(), c = e ?? s, l = `${c}-description`, u = `${c}-error`, d = r(t), f = r(n);
|
|
54
|
-
return {
|
|
55
|
-
id: c,
|
|
56
|
-
descriptionId: l,
|
|
57
|
-
errorId: u,
|
|
58
|
-
describedBy: [
|
|
59
|
-
a,
|
|
60
|
-
d && l,
|
|
61
|
-
f && u
|
|
62
|
-
].filter(Boolean).join(" ") || void 0,
|
|
63
|
-
ariaInvalid: f ? !0 : o
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function h({ "data-ui": e, className: n, sx: r, part: i, children: a }) {
|
|
67
|
-
let s = [n, i?.className].filter(Boolean).join(" ") || void 0;
|
|
68
|
-
return /* @__PURE__ */ o(t, {
|
|
69
|
-
className: s,
|
|
70
|
-
styles: [l, i?.css],
|
|
71
|
-
sx: r,
|
|
72
|
-
children: (t) => /* @__PURE__ */ o("div", {
|
|
73
|
-
"data-ui": e,
|
|
74
|
-
className: t,
|
|
75
|
-
children: a
|
|
76
|
-
})
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function g({ htmlFor: e, required: t, part: n, children: i }) {
|
|
80
|
-
return r(i) ? /* @__PURE__ */ s("label", {
|
|
81
|
-
htmlFor: e,
|
|
82
|
-
className: n?.className,
|
|
83
|
-
css: [u, n?.css],
|
|
84
|
-
children: [i, t && /* @__PURE__ */ o("span", {
|
|
85
|
-
"aria-hidden": !0,
|
|
86
|
-
css: d,
|
|
87
|
-
children: " *"
|
|
88
|
-
})]
|
|
89
|
-
}) : null;
|
|
90
|
-
}
|
|
91
|
-
function _({ id: e, part: t, children: n }) {
|
|
92
|
-
return r(n) ? /* @__PURE__ */ o("span", {
|
|
93
|
-
id: e,
|
|
94
|
-
className: t?.className,
|
|
95
|
-
css: [f, t?.css],
|
|
96
|
-
children: n
|
|
97
|
-
}) : null;
|
|
98
|
-
}
|
|
99
|
-
function v({ id: e, part: t, children: n }) {
|
|
100
|
-
return r(n) ? /* @__PURE__ */ o("span", {
|
|
101
|
-
id: e,
|
|
102
|
-
role: "alert",
|
|
103
|
-
className: t?.className,
|
|
104
|
-
css: [p, t?.css],
|
|
105
|
-
children: n
|
|
106
|
-
}) : null;
|
|
107
|
-
}
|
|
108
|
-
//#endregion
|
|
109
|
-
export { m as a, h as i, v as n, c as o, g as r, _ as t };
|
package/dist/menu-CGPTNRnF.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import { n as r } from "./media-D_eA_I-e.js";
|
|
5
|
-
import { t as i } from "./use-controlled-state-CVXDa-qM.js";
|
|
6
|
-
import { f as a, i as o, n as s, o as c } from "./collection-registry-BTYi6zGh.js";
|
|
7
|
-
import { t as l } from "./trigger-style-B1KVC8O1.js";
|
|
8
|
-
import { n as u, t as d } from "./use-overlay-floating-Bit-f0FU.js";
|
|
9
|
-
import { createContext as f, useContext as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
10
|
-
import { vars as v } from "@jfrader/tokens/vars";
|
|
11
|
-
import { jsx as y } from "@emotion/react/jsx-runtime";
|
|
12
|
-
import { FloatingFocusManager as b, FloatingList as x, useClick as S, useDismiss as C, useInteractions as w, useListNavigation as T, useMergeRefs as E, useRole as D, useTypeahead as O } from "@floating-ui/react";
|
|
13
|
-
//#region src/components/menu/menu.tsx
|
|
14
|
-
var k = 500, A = f(null), j = f(!1);
|
|
15
|
-
function M(e) {
|
|
16
|
-
let t = p(A);
|
|
17
|
-
if (!t) throw Error(`Menu.${e} must be rendered inside <Menu>.`);
|
|
18
|
-
return t;
|
|
19
|
-
}
|
|
20
|
-
function N() {
|
|
21
|
-
let e = M("Item");
|
|
22
|
-
if (!p(j)) throw Error("Menu.Item must be rendered inside <Menu.Content>.");
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
var P = e({
|
|
26
|
-
appearance: "none",
|
|
27
|
-
boxSizing: "border-box",
|
|
28
|
-
display: "flex",
|
|
29
|
-
alignItems: "center",
|
|
30
|
-
inlineSize: "100%",
|
|
31
|
-
minBlockSize: "32px",
|
|
32
|
-
border: 0,
|
|
33
|
-
borderRadius: v.radius.sm,
|
|
34
|
-
backgroundColor: "transparent",
|
|
35
|
-
paddingBlock: v.space[1],
|
|
36
|
-
paddingInline: v.space[2],
|
|
37
|
-
font: "inherit",
|
|
38
|
-
fontSize: v.textSize.sm,
|
|
39
|
-
color: v.color.text,
|
|
40
|
-
textAlign: "start",
|
|
41
|
-
cursor: "pointer",
|
|
42
|
-
transitionProperty: "background-color",
|
|
43
|
-
transitionDuration: v.motion.duration.fast,
|
|
44
|
-
transitionTimingFunction: v.motion.easeStandard,
|
|
45
|
-
"&:focus-visible": { ...n },
|
|
46
|
-
[r]: { transitionDuration: "0s" }
|
|
47
|
-
}), F = e({
|
|
48
|
-
blockSize: "1px",
|
|
49
|
-
marginBlock: v.space[1],
|
|
50
|
-
backgroundColor: v.color.border
|
|
51
|
-
});
|
|
52
|
-
function I({ open: e, defaultOpen: t = !1, onOpenChange: n, placement: r = "bottom-start", children: a }) {
|
|
53
|
-
let [o = !1, s] = i(e, t, n), [c, l] = _(null), u = g([]), f = g([]), p = g(/* @__PURE__ */ new Set()), v = g(!1), { refs: b, floatingStyles: x, context: E } = d({
|
|
54
|
-
open: o,
|
|
55
|
-
placement: r,
|
|
56
|
-
onOpenChange: (e, t, n) => {
|
|
57
|
-
e || (v.current = n === "escape-key"), s(e);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
m(() => {
|
|
61
|
-
!o && v.current && (v.current = !1, b.domReference.current?.focus());
|
|
62
|
-
}, [o, b]);
|
|
63
|
-
let j = S(E), M = D(E, { role: "menu" }), N = C(E, {
|
|
64
|
-
escapeKey: !0,
|
|
65
|
-
outsidePress: !0
|
|
66
|
-
}), P = T(E, {
|
|
67
|
-
listRef: u,
|
|
68
|
-
activeIndex: c,
|
|
69
|
-
onNavigate: l,
|
|
70
|
-
loop: !0,
|
|
71
|
-
orientation: "vertical",
|
|
72
|
-
disabledIndices: (e) => p.current.has(e),
|
|
73
|
-
focusItemOnOpen: !0
|
|
74
|
-
}), F = O(E, {
|
|
75
|
-
listRef: f,
|
|
76
|
-
activeIndex: c,
|
|
77
|
-
onMatch: o ? l : void 0,
|
|
78
|
-
resetMs: k
|
|
79
|
-
}), { getReferenceProps: I, getFloatingProps: L, getItemProps: R } = w([
|
|
80
|
-
j,
|
|
81
|
-
M,
|
|
82
|
-
N,
|
|
83
|
-
P,
|
|
84
|
-
F
|
|
85
|
-
]), z = h(() => ({
|
|
86
|
-
open: o,
|
|
87
|
-
requestClose: (e = !1) => {
|
|
88
|
-
e && (v.current = !0), s(!1);
|
|
89
|
-
},
|
|
90
|
-
activeIndex: c,
|
|
91
|
-
refs: b,
|
|
92
|
-
floatingContext: E,
|
|
93
|
-
floatingStyles: x,
|
|
94
|
-
elementsRef: u,
|
|
95
|
-
labelsRef: f,
|
|
96
|
-
disabledIndices: p.current,
|
|
97
|
-
getReferenceProps: I,
|
|
98
|
-
getFloatingProps: L,
|
|
99
|
-
getItemProps: R
|
|
100
|
-
}), [
|
|
101
|
-
o,
|
|
102
|
-
s,
|
|
103
|
-
c,
|
|
104
|
-
b,
|
|
105
|
-
E,
|
|
106
|
-
x,
|
|
107
|
-
I,
|
|
108
|
-
L,
|
|
109
|
-
R
|
|
110
|
-
]);
|
|
111
|
-
return /* @__PURE__ */ y(A.Provider, {
|
|
112
|
-
value: z,
|
|
113
|
-
children: a
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
I.displayName = "Menu";
|
|
117
|
-
function L({ ref: e, className: n, sx: r, ...i }) {
|
|
118
|
-
let { refs: a, getReferenceProps: o } = M("Trigger"), s = E([a.setReference, e]);
|
|
119
|
-
return /* @__PURE__ */ y(t, {
|
|
120
|
-
className: n,
|
|
121
|
-
styles: l,
|
|
122
|
-
sx: r,
|
|
123
|
-
children: (e) => /* @__PURE__ */ y("button", {
|
|
124
|
-
type: "button",
|
|
125
|
-
...o(i),
|
|
126
|
-
ref: s,
|
|
127
|
-
"data-ui": "menu-trigger",
|
|
128
|
-
className: e
|
|
129
|
-
})
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
L.displayName = "Menu.Trigger";
|
|
133
|
-
function R({ ref: e, style: n, children: r, className: i, sx: o, ...s }) {
|
|
134
|
-
let { open: c, refs: l, floatingContext: d, floatingStyles: f, elementsRef: p, labelsRef: m, getFloatingProps: h } = M("Content"), g = E([l.setFloating, e]);
|
|
135
|
-
return c ? /* @__PURE__ */ y(u, { children: /* @__PURE__ */ y(b, {
|
|
136
|
-
context: d,
|
|
137
|
-
modal: !1,
|
|
138
|
-
initialFocus: -1,
|
|
139
|
-
returnFocus: !1,
|
|
140
|
-
restoreFocus: !0,
|
|
141
|
-
children: /* @__PURE__ */ y(t, {
|
|
142
|
-
className: i,
|
|
143
|
-
styles: a,
|
|
144
|
-
sx: o,
|
|
145
|
-
children: (e) => /* @__PURE__ */ y("div", {
|
|
146
|
-
...h(s),
|
|
147
|
-
ref: g,
|
|
148
|
-
"data-ui": "menu",
|
|
149
|
-
style: {
|
|
150
|
-
...n,
|
|
151
|
-
...f
|
|
152
|
-
},
|
|
153
|
-
className: e,
|
|
154
|
-
children: /* @__PURE__ */ y(x, {
|
|
155
|
-
elementsRef: p,
|
|
156
|
-
labelsRef: m,
|
|
157
|
-
children: /* @__PURE__ */ y(j.Provider, {
|
|
158
|
-
value: !0,
|
|
159
|
-
children: r
|
|
160
|
-
})
|
|
161
|
-
})
|
|
162
|
-
})
|
|
163
|
-
})
|
|
164
|
-
}) }) : null;
|
|
165
|
-
}
|
|
166
|
-
R.displayName = "Menu.Content";
|
|
167
|
-
function z({ ref: e, onSelect: n, disabled: r = !1, onClick: i, className: a, sx: l, ...u }) {
|
|
168
|
-
let { activeIndex: d, requestClose: f, disabledIndices: p, getItemProps: m } = N(), { ref: h, index: g } = o({ label: r ? null : void 0 }), _ = E([h, e]), v = g !== -1 && d === g;
|
|
169
|
-
s(g, r, p);
|
|
170
|
-
let b = (e) => {
|
|
171
|
-
r || (i?.(e), n?.(), e.defaultPrevented || f(!0));
|
|
172
|
-
};
|
|
173
|
-
return /* @__PURE__ */ y(t, {
|
|
174
|
-
className: a,
|
|
175
|
-
styles: [P, c],
|
|
176
|
-
sx: l,
|
|
177
|
-
children: (e) => /* @__PURE__ */ y("button", {
|
|
178
|
-
type: "button",
|
|
179
|
-
...m({
|
|
180
|
-
...u,
|
|
181
|
-
onClick: b
|
|
182
|
-
}),
|
|
183
|
-
ref: _,
|
|
184
|
-
role: "menuitem",
|
|
185
|
-
tabIndex: v ? 0 : -1,
|
|
186
|
-
"aria-disabled": r || void 0,
|
|
187
|
-
"data-active": v || void 0,
|
|
188
|
-
"data-ui": "menu-item",
|
|
189
|
-
className: e
|
|
190
|
-
})
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
z.displayName = "Menu.Item";
|
|
194
|
-
function B({ ref: e, className: n, sx: r, ...i }) {
|
|
195
|
-
return /* @__PURE__ */ y(t, {
|
|
196
|
-
className: n,
|
|
197
|
-
styles: F,
|
|
198
|
-
sx: r,
|
|
199
|
-
children: (t) => /* @__PURE__ */ y("div", {
|
|
200
|
-
...i,
|
|
201
|
-
ref: e,
|
|
202
|
-
role: "separator",
|
|
203
|
-
"data-ui": "menu-separator",
|
|
204
|
-
className: t
|
|
205
|
-
})
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
B.displayName = "Menu.Separator";
|
|
209
|
-
var V = Object.assign(I, {
|
|
210
|
-
Trigger: L,
|
|
211
|
-
Content: R,
|
|
212
|
-
Item: z,
|
|
213
|
-
Separator: B
|
|
214
|
-
});
|
|
215
|
-
//#endregion
|
|
216
|
-
export { V as t };
|
package/dist/popover-CdRXjQqI.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t as n } from "./use-controlled-state-CVXDa-qM.js";
|
|
4
|
-
import { t as r } from "./trigger-style-B1KVC8O1.js";
|
|
5
|
-
import { n as i } from "./surface-DZ4d-2aL.js";
|
|
6
|
-
import { n as a, t as o } from "./use-overlay-floating-Bit-f0FU.js";
|
|
7
|
-
import { createContext as s, useContext as c, useEffect as l, useMemo as u, useRef as d } from "react";
|
|
8
|
-
import { vars as f } from "@jfrader/tokens/vars";
|
|
9
|
-
import { jsx as p } from "@emotion/react/jsx-runtime";
|
|
10
|
-
import { FloatingFocusManager as m, useClick as h, useDismiss as g, useInteractions as _, useMergeRefs as v, useRole as y } from "@floating-ui/react";
|
|
11
|
-
//#region src/components/popover/popover.tsx
|
|
12
|
-
var b = s(null);
|
|
13
|
-
function x(e) {
|
|
14
|
-
let t = c(b);
|
|
15
|
-
if (!t) throw Error(`Popover.${e} must be rendered inside <Popover>.`);
|
|
16
|
-
return t;
|
|
17
|
-
}
|
|
18
|
-
var S = e({
|
|
19
|
-
...i,
|
|
20
|
-
borderRadius: f.radius.lg,
|
|
21
|
-
boxShadow: f.shadow.overlay,
|
|
22
|
-
padding: f.space[4],
|
|
23
|
-
minInlineSize: "200px",
|
|
24
|
-
maxInlineSize: "min(360px, calc(100vw - 32px))",
|
|
25
|
-
fontSize: f.textSize.sm
|
|
26
|
-
});
|
|
27
|
-
function C({ open: e, defaultOpen: t = !1, onOpenChange: r, placement: i = "bottom", children: a }) {
|
|
28
|
-
let [s = !1, c] = n(e, t, r), f = d(!1), { refs: m, floatingStyles: v, context: x } = o({
|
|
29
|
-
open: s,
|
|
30
|
-
placement: i,
|
|
31
|
-
onOpenChange: (e, t, n) => {
|
|
32
|
-
e || (f.current = n === "escape-key"), c(e);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
l(() => {
|
|
36
|
-
!s && f.current && (f.current = !1, m.domReference.current?.focus());
|
|
37
|
-
}, [s, m]);
|
|
38
|
-
let S = h(x), C = g(x, {
|
|
39
|
-
escapeKey: !0,
|
|
40
|
-
outsidePress: !0
|
|
41
|
-
}), w = y(x, { role: "dialog" }), { getReferenceProps: T, getFloatingProps: E } = _([
|
|
42
|
-
S,
|
|
43
|
-
C,
|
|
44
|
-
w
|
|
45
|
-
]), D = u(() => ({
|
|
46
|
-
open: s,
|
|
47
|
-
refs: m,
|
|
48
|
-
floatingContext: x,
|
|
49
|
-
floatingStyles: v,
|
|
50
|
-
getReferenceProps: T,
|
|
51
|
-
getFloatingProps: E
|
|
52
|
-
}), [
|
|
53
|
-
s,
|
|
54
|
-
m,
|
|
55
|
-
x,
|
|
56
|
-
v,
|
|
57
|
-
T,
|
|
58
|
-
E
|
|
59
|
-
]);
|
|
60
|
-
return /* @__PURE__ */ p(b.Provider, {
|
|
61
|
-
value: D,
|
|
62
|
-
children: a
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
C.displayName = "Popover";
|
|
66
|
-
function w({ ref: e, className: n, sx: i, ...a }) {
|
|
67
|
-
let { refs: o, getReferenceProps: s } = x("Trigger"), c = v([o.setReference, e]);
|
|
68
|
-
return /* @__PURE__ */ p(t, {
|
|
69
|
-
className: n,
|
|
70
|
-
styles: r,
|
|
71
|
-
sx: i,
|
|
72
|
-
children: (e) => /* @__PURE__ */ p("button", {
|
|
73
|
-
type: "button",
|
|
74
|
-
...s(a),
|
|
75
|
-
ref: c,
|
|
76
|
-
"data-ui": "popover-trigger",
|
|
77
|
-
className: e
|
|
78
|
-
})
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
w.displayName = "Popover.Trigger";
|
|
82
|
-
function T({ ref: e, style: n, className: r, sx: i, ...o }) {
|
|
83
|
-
let { open: s, refs: c, floatingContext: l, floatingStyles: u, getFloatingProps: d } = x("Content"), f = v([c.setFloating, e]);
|
|
84
|
-
return s ? /* @__PURE__ */ p(a, { children: /* @__PURE__ */ p(m, {
|
|
85
|
-
context: l,
|
|
86
|
-
modal: !1,
|
|
87
|
-
initialFocus: -1,
|
|
88
|
-
returnFocus: !1,
|
|
89
|
-
closeOnFocusOut: !1,
|
|
90
|
-
children: /* @__PURE__ */ p(t, {
|
|
91
|
-
className: r,
|
|
92
|
-
styles: S,
|
|
93
|
-
sx: i,
|
|
94
|
-
children: (e) => /* @__PURE__ */ p("div", {
|
|
95
|
-
...d(o),
|
|
96
|
-
ref: f,
|
|
97
|
-
"data-ui": "popover",
|
|
98
|
-
style: {
|
|
99
|
-
...n,
|
|
100
|
-
...u
|
|
101
|
-
},
|
|
102
|
-
className: e
|
|
103
|
-
})
|
|
104
|
-
})
|
|
105
|
-
}) }) : null;
|
|
106
|
-
}
|
|
107
|
-
T.displayName = "Popover.Content";
|
|
108
|
-
var E = Object.assign(C, {
|
|
109
|
-
Trigger: w,
|
|
110
|
-
Content: T
|
|
111
|
-
});
|
|
112
|
-
//#endregion
|
|
113
|
-
export { E as t };
|