@jfrader/ui 0.3.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/theme-root-BbTBuLMQ.js +46 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-t7nAKc2c.js +27 -0
- 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/theme-root/theme-root.d.ts +9 -3
- 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/overlay-portal.d.ts +7 -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-scope.d.ts +19 -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-DrmjBbo7.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-ClUYBIBh.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-DU60SMdt.js +0 -216
- package/dist/popover-BtN_0ejj.js +0 -113
- package/dist/select-BCS0-LVW.js +0 -286
- package/dist/theme-root-BiXXvQvr.js +0 -42
- package/dist/toast-iqelR-r0.js +0 -282
- package/dist/tooltip-CB-HC1js.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-efeqppiw.js +0 -19
|
@@ -0,0 +1,562 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { n as ee } from "./roving-focus-CYlo_Kf8.js";
|
|
6
|
+
import { t as te } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { t as o } from "./button-C92uYFJW.js";
|
|
9
|
+
import { n as s } from "./surface-DZ4d-2aL.js";
|
|
10
|
+
import { n as c, r as l } from "./overlay-layer-SeUyyEPD.js";
|
|
11
|
+
import { a as u, c as d, d as f, f as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./calendar-B3Svu0X2.js";
|
|
12
|
+
import { t as ne } from "./overlay-portal-C4JZFq2M.js";
|
|
13
|
+
import { t as re } from "./use-overlay-floating-DvJifLpF.js";
|
|
14
|
+
import { createContext as S, useCallback as ie, useContext as C, useEffect as ae, useId as oe, useLayoutEffect as se, useMemo as w, useRef as T, useState as E } from "react";
|
|
15
|
+
import { vars as D } from "@jfrader/tokens/vars";
|
|
16
|
+
import { Fragment as O, jsx as k, jsxs as A } from "@emotion/react/jsx-runtime";
|
|
17
|
+
import { FloatingFocusManager as j, useClick as M, useInteractions as N, useMergeRefs as ce, useRole as P } from "@floating-ui/react";
|
|
18
|
+
//#region src/components/date-range-picker/date-range-picker.tsx
|
|
19
|
+
var F = "bottom-start", I = 712, L = 864e5, le = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), ue = " ", R = "[data-ui=\"calendar-day\"]", z = `${R}[tabindex="0"]`, B = {
|
|
20
|
+
itemSelector: "[data-ui=\"date-range-picker-preset\"]:not([aria-disabled=\"true\"])",
|
|
21
|
+
ownerSelector: "[data-ui=\"date-range-picker-presets\"]"
|
|
22
|
+
}, de = [], fe = {
|
|
23
|
+
...g,
|
|
24
|
+
dateStyle: "medium"
|
|
25
|
+
}, V = S(null);
|
|
26
|
+
function H(e) {
|
|
27
|
+
let t = C(V);
|
|
28
|
+
if (!t) throw Error(`DateRangePicker.${e} must be rendered inside <DateRangePicker>.`);
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
var pe = (e) => e != null && d(e.start) && d(e.end) && e.start <= e.end, me = (e, t, n) => pe(e) && h(e.start, t, n) && h(e.end, t, n), he = (e, t) => e === t || e !== null && t !== null && e.start === t.start && e.end === t.end, U = (e, t) => e <= t ? {
|
|
32
|
+
start: e,
|
|
33
|
+
end: t
|
|
34
|
+
} : {
|
|
35
|
+
start: t,
|
|
36
|
+
end: e
|
|
37
|
+
}, W = ({ start: e, end: t }) => Math.round((m(t).getTime() - m(e).getTime()) / L) + 1;
|
|
38
|
+
function ge() {
|
|
39
|
+
let e = /* @__PURE__ */ new Date();
|
|
40
|
+
return x(u(e.getFullYear(), e.getMonth(), e.getDate()));
|
|
41
|
+
}
|
|
42
|
+
var _e = (e, { start: t, end: n }) => e.formatRange(m(t), m(n)), G = (e) => {
|
|
43
|
+
let t = e?.querySelector(z) ?? null;
|
|
44
|
+
return t?.focus({ preventScroll: !0 }), t;
|
|
45
|
+
}, K = e({
|
|
46
|
+
appearance: "none",
|
|
47
|
+
display: "inline-flex",
|
|
48
|
+
alignItems: "center",
|
|
49
|
+
gap: D.space[2],
|
|
50
|
+
boxSizing: "border-box",
|
|
51
|
+
maxInlineSize: "100%",
|
|
52
|
+
border: `1px solid ${D.color.borderControl}`,
|
|
53
|
+
borderRadius: D.radius.md,
|
|
54
|
+
backgroundColor: D.color.surfaceRaised,
|
|
55
|
+
font: "inherit",
|
|
56
|
+
fontWeight: D.fontWeight.medium,
|
|
57
|
+
color: D.color.text,
|
|
58
|
+
textAlign: "start",
|
|
59
|
+
cursor: "pointer",
|
|
60
|
+
transitionProperty: "background-color, border-color",
|
|
61
|
+
transitionDuration: D.motion.duration.fast,
|
|
62
|
+
transitionTimingFunction: D.motion.easeStandard,
|
|
63
|
+
"&:hover:not(:disabled)": { backgroundColor: D.color.surfaceHover },
|
|
64
|
+
"&:focus-visible": { ...n },
|
|
65
|
+
"&[aria-invalid=\"true\"]:not(:focus-visible)": { borderColor: D.color.dangerText },
|
|
66
|
+
"&:disabled": {
|
|
67
|
+
opacity: .55,
|
|
68
|
+
cursor: "not-allowed"
|
|
69
|
+
},
|
|
70
|
+
[i]: { transitionDuration: "0s" }
|
|
71
|
+
}), q = {
|
|
72
|
+
sm: e({
|
|
73
|
+
minBlockSize: D.space[8],
|
|
74
|
+
paddingInline: D.space[3],
|
|
75
|
+
fontSize: D.textSize.sm
|
|
76
|
+
}),
|
|
77
|
+
md: e({
|
|
78
|
+
minBlockSize: D.space[10],
|
|
79
|
+
paddingInline: D.space[4],
|
|
80
|
+
fontSize: D.textSize.sm
|
|
81
|
+
}),
|
|
82
|
+
lg: e({
|
|
83
|
+
minBlockSize: D.space[12],
|
|
84
|
+
paddingInline: D.space[4],
|
|
85
|
+
fontSize: D.textSize.md
|
|
86
|
+
})
|
|
87
|
+
}, J = e({
|
|
88
|
+
display: "inline-flex",
|
|
89
|
+
flexShrink: 0,
|
|
90
|
+
color: D.color.textMuted,
|
|
91
|
+
"& > svg": {
|
|
92
|
+
inlineSize: "1em",
|
|
93
|
+
blockSize: "1em"
|
|
94
|
+
}
|
|
95
|
+
}), Y = e({ color: D.color.textMuted }), X = e({
|
|
96
|
+
display: "block",
|
|
97
|
+
marginBlockStart: D.space[2],
|
|
98
|
+
fontSize: D.textSize.xs,
|
|
99
|
+
color: D.color.dangerText
|
|
100
|
+
}), ve = e({
|
|
101
|
+
...s,
|
|
102
|
+
display: "grid",
|
|
103
|
+
gap: D.space[4],
|
|
104
|
+
borderRadius: D.radius.lg,
|
|
105
|
+
boxShadow: D.shadow.overlay,
|
|
106
|
+
padding: D.space[4],
|
|
107
|
+
overflow: "auto",
|
|
108
|
+
"&[data-layout=\"rail\"]": { gridTemplateColumns: "auto 1fr" },
|
|
109
|
+
[r]: { border: "1px solid CanvasText" }
|
|
110
|
+
}), ye = e({
|
|
111
|
+
display: "flex",
|
|
112
|
+
gap: D.space[2],
|
|
113
|
+
"[data-layout=\"row\"] > &": {
|
|
114
|
+
overflowX: "auto",
|
|
115
|
+
paddingBlock: D.space[1]
|
|
116
|
+
},
|
|
117
|
+
"[data-layout=\"rail\"] > &": {
|
|
118
|
+
flexDirection: "column",
|
|
119
|
+
gridRow: "1 / span 2",
|
|
120
|
+
paddingInlineEnd: D.space[4],
|
|
121
|
+
borderInlineEnd: `1px solid ${D.color.border}`
|
|
122
|
+
}
|
|
123
|
+
}), be = e({
|
|
124
|
+
appearance: "none",
|
|
125
|
+
flexShrink: 0,
|
|
126
|
+
minBlockSize: D.space[8],
|
|
127
|
+
paddingInline: D.space[3],
|
|
128
|
+
border: "1px solid transparent",
|
|
129
|
+
borderRadius: D.radius.md,
|
|
130
|
+
backgroundColor: "transparent",
|
|
131
|
+
font: "inherit",
|
|
132
|
+
fontSize: D.textSize.sm,
|
|
133
|
+
color: D.color.text,
|
|
134
|
+
textAlign: "start",
|
|
135
|
+
whiteSpace: "nowrap",
|
|
136
|
+
cursor: "pointer",
|
|
137
|
+
transitionProperty: "background-color, border-color",
|
|
138
|
+
transitionDuration: D.motion.duration.fast,
|
|
139
|
+
transitionTimingFunction: D.motion.easeStandard,
|
|
140
|
+
"&:hover:not([aria-disabled=\"true\"])": { backgroundColor: D.color.surfaceHover },
|
|
141
|
+
"&[aria-pressed=\"true\"]": {
|
|
142
|
+
backgroundColor: D.color.accentSoft,
|
|
143
|
+
borderColor: D.color.accentBorder
|
|
144
|
+
},
|
|
145
|
+
"&[aria-disabled=\"true\"]": {
|
|
146
|
+
opacity: .55,
|
|
147
|
+
cursor: "not-allowed"
|
|
148
|
+
},
|
|
149
|
+
"&:focus-visible": { ...n },
|
|
150
|
+
[i]: { transitionDuration: "0s" },
|
|
151
|
+
[r]: { "&[aria-pressed=\"true\"]": { borderColor: "Highlight" } }
|
|
152
|
+
}), xe = e({
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexWrap: "wrap",
|
|
155
|
+
alignItems: "flex-start",
|
|
156
|
+
gap: D.space[6]
|
|
157
|
+
}), Se = e({
|
|
158
|
+
display: "flex",
|
|
159
|
+
flexWrap: "wrap",
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
justifyContent: "space-between",
|
|
162
|
+
gap: D.space[3],
|
|
163
|
+
"[data-layout=\"rail\"] > &": { gridColumn: 2 }
|
|
164
|
+
}), Ce = e({
|
|
165
|
+
fontSize: D.textSize.sm,
|
|
166
|
+
color: D.color.textMuted
|
|
167
|
+
}), we = e({
|
|
168
|
+
display: "flex",
|
|
169
|
+
gap: D.space[2],
|
|
170
|
+
marginInlineStart: "auto"
|
|
171
|
+
});
|
|
172
|
+
function Z({ nodeId: e, value: t, defaultValue: n, onValueChange: r, open: i, defaultOpen: ee = !1, onOpenChange: a, min: o, max: s, locale: c, firstDayOfWeek: u, today: f, months: p = "auto", boundary: m, presets: h = de, disabled: v = !1, readOnly: y = !1, required: b = !1, startName: x, endName: ne, messages: S, children: ie }) {
|
|
173
|
+
let [C = null, oe, se] = te(t, n ?? null, r), [D = !1, O] = te(i, ee, a), j = D && !v, [ce, I] = E(null), [L, le] = E(null), ue = T(null), R = T(!1), z = T(null), B = w(() => new Intl.DateTimeFormat(c ?? _(), g).resolvedOptions().locale, [c]), H = w(() => new Intl.DateTimeFormat(B, fe), [B]), U = pe(C) ? C : null, W = d(o) ? o : void 0, G = d(s) ? s : void 0, K = C !== null && U === null || W !== void 0 && G !== void 0 && W > G, q = d(f) ? f : ge(), { refs: J, floatingStyles: Y, context: X } = re({
|
|
174
|
+
open: j,
|
|
175
|
+
placement: F,
|
|
176
|
+
nodeId: e,
|
|
177
|
+
boundary: m,
|
|
178
|
+
onAvailableSize: (e) => le((t) => t?.width === e.width && t.height === e.height ? t : e),
|
|
179
|
+
onOpenChange: (e, t, n) => {
|
|
180
|
+
if (v && e) return;
|
|
181
|
+
let r = z.current;
|
|
182
|
+
z.current = n === "outside-press" && t?.target instanceof Element ? t.target : null;
|
|
183
|
+
let i = n === "focus-out" && t instanceof FocusEvent ? t.relatedTarget : null;
|
|
184
|
+
r && i instanceof Node && i.contains(r) || (e || (R.current = n === "escape-key"), O(e));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
ae(() => {
|
|
188
|
+
!j && R.current && (R.current = !1, J.domReference.current?.focus());
|
|
189
|
+
}, [j, J]);
|
|
190
|
+
let ve = M(X, {
|
|
191
|
+
enabled: !v,
|
|
192
|
+
keyboardHandlers: !1
|
|
193
|
+
}), ye = l(X, "container"), be = P(X, { role: "dialog" }), { getReferenceProps: xe, getFloatingProps: Se } = N([
|
|
194
|
+
ve,
|
|
195
|
+
...ye,
|
|
196
|
+
be
|
|
197
|
+
]), Ce = w(() => U ? _e(H, U) : void 0, [H, U]), we = w(() => {
|
|
198
|
+
let e = (e) => {
|
|
199
|
+
he(e, C) || oe(e);
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
open: j,
|
|
203
|
+
disabled: v,
|
|
204
|
+
readOnly: y,
|
|
205
|
+
required: b,
|
|
206
|
+
invalid: K,
|
|
207
|
+
value: U,
|
|
208
|
+
displayValue: Ce,
|
|
209
|
+
min: W,
|
|
210
|
+
max: G,
|
|
211
|
+
locale: B,
|
|
212
|
+
firstDayOfWeek: u,
|
|
213
|
+
today: q,
|
|
214
|
+
months: p,
|
|
215
|
+
presets: h,
|
|
216
|
+
messages: S,
|
|
217
|
+
availableSize: L,
|
|
218
|
+
triggerLabelling: ce,
|
|
219
|
+
contentRef: ue,
|
|
220
|
+
refs: J,
|
|
221
|
+
floatingContext: X,
|
|
222
|
+
floatingStyles: Y,
|
|
223
|
+
getReferenceProps: xe,
|
|
224
|
+
getFloatingProps: Se,
|
|
225
|
+
requestOpen: () => {
|
|
226
|
+
v || O(!0);
|
|
227
|
+
},
|
|
228
|
+
apply: (t) => {
|
|
229
|
+
v || y || !me(t, W, G) || (e(t), R.current = !0, O(!1));
|
|
230
|
+
},
|
|
231
|
+
cancel: () => {
|
|
232
|
+
R.current = !0, O(!1);
|
|
233
|
+
},
|
|
234
|
+
resetValue: () => {
|
|
235
|
+
t === void 0 ? se() : e(n ?? null);
|
|
236
|
+
},
|
|
237
|
+
setTriggerLabelling: I
|
|
238
|
+
};
|
|
239
|
+
}, [
|
|
240
|
+
j,
|
|
241
|
+
v,
|
|
242
|
+
y,
|
|
243
|
+
b,
|
|
244
|
+
K,
|
|
245
|
+
C,
|
|
246
|
+
U,
|
|
247
|
+
Ce,
|
|
248
|
+
W,
|
|
249
|
+
G,
|
|
250
|
+
B,
|
|
251
|
+
u,
|
|
252
|
+
q,
|
|
253
|
+
p,
|
|
254
|
+
h,
|
|
255
|
+
S,
|
|
256
|
+
L,
|
|
257
|
+
ce,
|
|
258
|
+
J,
|
|
259
|
+
X,
|
|
260
|
+
Y,
|
|
261
|
+
xe,
|
|
262
|
+
Se,
|
|
263
|
+
oe,
|
|
264
|
+
O,
|
|
265
|
+
se,
|
|
266
|
+
t,
|
|
267
|
+
n
|
|
268
|
+
]);
|
|
269
|
+
return /* @__PURE__ */ A(V.Provider, {
|
|
270
|
+
value: we,
|
|
271
|
+
children: [
|
|
272
|
+
ie,
|
|
273
|
+
x !== void 0 && /* @__PURE__ */ k("input", {
|
|
274
|
+
type: "hidden",
|
|
275
|
+
name: x,
|
|
276
|
+
value: U?.start ?? "",
|
|
277
|
+
disabled: v
|
|
278
|
+
}),
|
|
279
|
+
ne !== void 0 && /* @__PURE__ */ k("input", {
|
|
280
|
+
type: "hidden",
|
|
281
|
+
name: ne,
|
|
282
|
+
value: U?.end ?? "",
|
|
283
|
+
disabled: v
|
|
284
|
+
})
|
|
285
|
+
]
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
function Te(e) {
|
|
289
|
+
return /* @__PURE__ */ k(c, { children: (t) => /* @__PURE__ */ k(Z, {
|
|
290
|
+
...e,
|
|
291
|
+
nodeId: t
|
|
292
|
+
}) });
|
|
293
|
+
}
|
|
294
|
+
Te.displayName = "DateRangePicker";
|
|
295
|
+
function Ee({ ref: e, id: n, size: r = "md", icon: i, placeholder: ee, className: te, sx: o, onKeyDown: s, onKeyUp: c, "aria-label": l, "aria-labelledby": u, "aria-describedby": d, "aria-invalid": f, ...p }) {
|
|
296
|
+
let { open: m, disabled: h, readOnly: g, required: _, invalid: v, displayValue: y, messages: b, contentRef: x, refs: ne, getReferenceProps: re, requestOpen: S, resetValue: ie, setTriggerLabelling: C } = H("Trigger"), w = T(null), E = ce([
|
|
297
|
+
ne.setReference,
|
|
298
|
+
e,
|
|
299
|
+
w
|
|
300
|
+
]), D = oe(), j = n ?? D, M = `${j}-value`, N = `${j}-required`, P = `${j}-error`, F = _ && a(b.required), I = v || f, L = (I === !0 || I === "true") && a(b.error);
|
|
301
|
+
se(() => (C(u === void 0 ? l === void 0 ? null : { label: l } : { labelledBy: u }), () => C(null)), [
|
|
302
|
+
u,
|
|
303
|
+
l,
|
|
304
|
+
C
|
|
305
|
+
]);
|
|
306
|
+
let R = T(ie);
|
|
307
|
+
ae(() => {
|
|
308
|
+
R.current = ie;
|
|
309
|
+
}), ae(() => {
|
|
310
|
+
let e = w.current?.form;
|
|
311
|
+
if (!e) return;
|
|
312
|
+
let t = () => R.current();
|
|
313
|
+
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
314
|
+
}, []);
|
|
315
|
+
let z = u ?? (l === void 0 ? void 0 : j), B = z === void 0 ? void 0 : [
|
|
316
|
+
z,
|
|
317
|
+
M,
|
|
318
|
+
F ? N : void 0
|
|
319
|
+
].filter(Boolean).join(" "), de = [d, L ? P : void 0].filter(Boolean).join(" ") || void 0, fe = () => {
|
|
320
|
+
h || (m ? G(x.current) : S());
|
|
321
|
+
}, V = (e) => {
|
|
322
|
+
s?.(e), !(e.defaultPrevented || h) && (e.key === ue ? e.preventDefault() : le.has(e.key) && (e.preventDefault(), fe()));
|
|
323
|
+
}, pe = (e) => {
|
|
324
|
+
c?.(e), !(e.defaultPrevented || h || e.key !== ue) && fe();
|
|
325
|
+
};
|
|
326
|
+
return /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(t, {
|
|
327
|
+
className: te,
|
|
328
|
+
styles: [K, q[r]],
|
|
329
|
+
sx: o,
|
|
330
|
+
children: (e) => /* @__PURE__ */ A("button", {
|
|
331
|
+
type: "button",
|
|
332
|
+
...re({
|
|
333
|
+
...p,
|
|
334
|
+
onKeyDown: V,
|
|
335
|
+
onKeyUp: pe
|
|
336
|
+
}),
|
|
337
|
+
ref: E,
|
|
338
|
+
id: j,
|
|
339
|
+
disabled: h,
|
|
340
|
+
"aria-label": l,
|
|
341
|
+
"aria-labelledby": B,
|
|
342
|
+
"aria-describedby": de,
|
|
343
|
+
"aria-invalid": I,
|
|
344
|
+
"data-ui": "date-range-picker",
|
|
345
|
+
"data-state": m ? "open" : "closed",
|
|
346
|
+
"data-size": r,
|
|
347
|
+
"data-readonly": g || void 0,
|
|
348
|
+
"data-required": _ || void 0,
|
|
349
|
+
className: e,
|
|
350
|
+
children: [
|
|
351
|
+
a(i) && /* @__PURE__ */ k("span", {
|
|
352
|
+
"aria-hidden": "true",
|
|
353
|
+
css: J,
|
|
354
|
+
children: i
|
|
355
|
+
}),
|
|
356
|
+
y === void 0 ? /* @__PURE__ */ k("span", {
|
|
357
|
+
id: M,
|
|
358
|
+
"data-placeholder": "",
|
|
359
|
+
css: Y,
|
|
360
|
+
children: ee
|
|
361
|
+
}) : /* @__PURE__ */ k("span", {
|
|
362
|
+
id: M,
|
|
363
|
+
children: y
|
|
364
|
+
}),
|
|
365
|
+
F && /* @__PURE__ */ k("span", {
|
|
366
|
+
id: N,
|
|
367
|
+
hidden: !0,
|
|
368
|
+
children: b.required
|
|
369
|
+
})
|
|
370
|
+
]
|
|
371
|
+
})
|
|
372
|
+
}), L && /* @__PURE__ */ k("span", {
|
|
373
|
+
id: P,
|
|
374
|
+
role: "alert",
|
|
375
|
+
"data-ui": "date-range-picker-error",
|
|
376
|
+
css: X,
|
|
377
|
+
children: b.error
|
|
378
|
+
})] });
|
|
379
|
+
}
|
|
380
|
+
Ee.displayName = "DateRangePicker.Trigger";
|
|
381
|
+
function Q(e) {
|
|
382
|
+
let { open: t } = H("Content");
|
|
383
|
+
return t ? /* @__PURE__ */ k(De, { ...e }) : null;
|
|
384
|
+
}
|
|
385
|
+
Q.displayName = "DateRangePicker.Content";
|
|
386
|
+
function De({ ref: e, dir: n, style: r, className: i, sx: te, slotProps: a, "aria-label": s, "aria-labelledby": c, "aria-describedby": l, ...u }) {
|
|
387
|
+
let { readOnly: d, value: m, min: g, max: _, locale: x, firstDayOfWeek: re, today: S, months: C, presets: D, messages: O, availableSize: M, triggerLabelling: N, contentRef: P, refs: F, floatingContext: L, floatingStyles: le, getFloatingProps: ue, apply: z, cancel: de } = H("Content"), V = oe(), pe = w(() => new Intl.DateTimeFormat(x, fe), [x]), ge = w(() => new Intl.NumberFormat(x), [x]), K = (e) => e != null && h(e, g, _), q = g === void 0 || _ === void 0 || g <= _ ? K(m?.start) ? m.start : v(_ !== void 0 && S > _ ? y(f(_)) : S, g, _) : null, [J, Y] = E(m), [X, Z] = E(!1), [Te, Ee] = E(m);
|
|
388
|
+
he(Te, m) || (Ee(m), Y(m), Z(!1));
|
|
389
|
+
let [Q, De] = E(q), [Oe, ke] = E(null), [Ae, je] = E(null), Me = T(null), Ne = M?.width ?? F.domReference.current?.ownerDocument.documentElement.clientWidth ?? 0, $ = C === "auto" ? Ne >= I ? 2 : 1 : C, [Pe, Fe] = E(f(q ?? v(S, g, void 0))), Ie = Array.from({ length: $ }, (e, t) => p(Pe, t)), Le = Ie[Ie.length - 1] ?? Pe, Re = (e) => f(e) >= Pe && f(e) <= Le, ze = (e, t = $) => {
|
|
390
|
+
let n = f(e);
|
|
391
|
+
n < Pe ? Fe(n) : n > p(Pe, t - 1) && Fe(p(n, 1 - t));
|
|
392
|
+
}, [Be, Ve] = E($);
|
|
393
|
+
Be !== $ && (Ve($), Q !== null && ze(Q, $));
|
|
394
|
+
let He = [
|
|
395
|
+
Q,
|
|
396
|
+
J?.start,
|
|
397
|
+
S
|
|
398
|
+
].find((e) => K(e) && Re(e)) ?? Ie.map((e) => v(y(e), g, _)).find((e) => Re(e) && K(e)) ?? null, Ue = Oe ?? Q, We = X && J && K(Ue) ? U(J.start, Ue) : null, Ge = We ?? J;
|
|
399
|
+
ae(() => {
|
|
400
|
+
let e = Me.current;
|
|
401
|
+
if (e === null) return;
|
|
402
|
+
Me.current = null;
|
|
403
|
+
let t = P.current?.querySelector(`${R}[data-date="${e}"]`);
|
|
404
|
+
t && t.ownerDocument.activeElement !== t && t.focus();
|
|
405
|
+
});
|
|
406
|
+
let Ke = (e) => {
|
|
407
|
+
De(e), ke(null), ze(e);
|
|
408
|
+
let t = P.current?.ownerDocument.activeElement;
|
|
409
|
+
Me.current = t instanceof HTMLElement && t.dataset.date === e ? null : e;
|
|
410
|
+
}, qe = (e) => {
|
|
411
|
+
d || (X && J ? (Y(U(J.start, e)), Z(!1)) : (Y({
|
|
412
|
+
start: e,
|
|
413
|
+
end: e
|
|
414
|
+
}), Z(!0)));
|
|
415
|
+
}, Je = (e) => {
|
|
416
|
+
let t = e.target.closest(R);
|
|
417
|
+
ke(t && !t.disabled ? t.dataset.date ?? null : null);
|
|
418
|
+
}, Ye = D.map((e) => {
|
|
419
|
+
let t = e.range(S);
|
|
420
|
+
return {
|
|
421
|
+
preset: e,
|
|
422
|
+
range: t,
|
|
423
|
+
enabled: !d && me(t, g, _)
|
|
424
|
+
};
|
|
425
|
+
}), Xe = Ye.find((e) => e.enabled && e.preset.id === Ae) ?? Ye.find((e) => e.enabled), Ze = (e) => {
|
|
426
|
+
Y(e), Z(!1), De(e.start), ze(e.start);
|
|
427
|
+
}, Qe = T(null), $e = ie((e) => {
|
|
428
|
+
P.current = e, e && !Qe.current && (Qe.current = G(e));
|
|
429
|
+
}, [P]), et = ce([
|
|
430
|
+
F.setFloating,
|
|
431
|
+
e,
|
|
432
|
+
$e
|
|
433
|
+
]), tt = L.elements.domReference, [nt, rt] = E();
|
|
434
|
+
se(() => {
|
|
435
|
+
rt(tt?.ownerDocument.defaultView?.getComputedStyle(tt).direction);
|
|
436
|
+
}, [tt]);
|
|
437
|
+
let it = c !== void 0 || s !== void 0 ? {
|
|
438
|
+
"aria-labelledby": c,
|
|
439
|
+
"aria-label": s
|
|
440
|
+
} : N?.labelledBy === void 0 ? { "aria-label": N?.label } : { "aria-labelledby": N.labelledBy }, at = $ === 2 ? "rail" : "row", ot = !d && me(J, g, _);
|
|
441
|
+
return /* @__PURE__ */ k(ne, { children: /* @__PURE__ */ k(j, {
|
|
442
|
+
context: L,
|
|
443
|
+
modal: !1,
|
|
444
|
+
initialFocus: Qe,
|
|
445
|
+
returnFocus: !1,
|
|
446
|
+
children: /* @__PURE__ */ k(t, {
|
|
447
|
+
className: i,
|
|
448
|
+
styles: ve,
|
|
449
|
+
sx: te,
|
|
450
|
+
children: (e) => /* @__PURE__ */ A("div", {
|
|
451
|
+
...ue({
|
|
452
|
+
...it,
|
|
453
|
+
"aria-describedby": [l, V].filter(Boolean).join(" "),
|
|
454
|
+
...u
|
|
455
|
+
}),
|
|
456
|
+
ref: et,
|
|
457
|
+
dir: n ?? nt,
|
|
458
|
+
"data-ui": "date-range-picker-content",
|
|
459
|
+
"data-layout": at,
|
|
460
|
+
style: {
|
|
461
|
+
...r,
|
|
462
|
+
...le,
|
|
463
|
+
...M && {
|
|
464
|
+
maxInlineSize: M.width,
|
|
465
|
+
maxBlockSize: M.height
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
className: e,
|
|
469
|
+
children: [
|
|
470
|
+
Ye.length > 0 && /* @__PURE__ */ k("div", {
|
|
471
|
+
role: "group",
|
|
472
|
+
"aria-label": O.presets,
|
|
473
|
+
"data-ui": "date-range-picker-presets",
|
|
474
|
+
className: a?.presets?.className,
|
|
475
|
+
css: [ye, a?.presets?.css],
|
|
476
|
+
onKeyDown: (e) => ee(e, e.currentTarget, at === "rail" ? "vertical" : "horizontal", B),
|
|
477
|
+
children: Ye.map(({ preset: e, range: t, enabled: n }) => /* @__PURE__ */ k("button", {
|
|
478
|
+
type: "button",
|
|
479
|
+
"data-ui": "date-range-picker-preset",
|
|
480
|
+
"aria-disabled": !n || void 0,
|
|
481
|
+
"aria-pressed": n && he(t, J) && !X,
|
|
482
|
+
tabIndex: e === Xe?.preset ? 0 : -1,
|
|
483
|
+
onFocus: () => je(e.id),
|
|
484
|
+
onClick: () => {
|
|
485
|
+
n && Ze(t);
|
|
486
|
+
},
|
|
487
|
+
css: be,
|
|
488
|
+
children: e.label
|
|
489
|
+
}, e.id))
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ k("div", {
|
|
492
|
+
"data-ui": "date-range-picker-calendars",
|
|
493
|
+
className: a?.calendars?.className,
|
|
494
|
+
css: [xe, a?.calendars?.css],
|
|
495
|
+
children: Ie.map((e, t) => /* @__PURE__ */ A(b, {
|
|
496
|
+
visibleMonth: e,
|
|
497
|
+
onVisibleMonthChange: (e) => Fe(p(e, -t)),
|
|
498
|
+
min: g,
|
|
499
|
+
max: _,
|
|
500
|
+
locale: x,
|
|
501
|
+
firstDayOfWeek: re,
|
|
502
|
+
today: S,
|
|
503
|
+
selectionRange: J,
|
|
504
|
+
previewRange: We,
|
|
505
|
+
tabStopDate: He !== null && f(He) === e ? He : null,
|
|
506
|
+
onDayActivate: qe,
|
|
507
|
+
onFocusedDateChange: Ke,
|
|
508
|
+
rangeLabels: {
|
|
509
|
+
start: O.start,
|
|
510
|
+
end: O.end
|
|
511
|
+
},
|
|
512
|
+
children: [/* @__PURE__ */ k(b.Header, {}), /* @__PURE__ */ k(b.Grid, {
|
|
513
|
+
onPointerMove: Je,
|
|
514
|
+
onPointerLeave: () => ke(null)
|
|
515
|
+
})]
|
|
516
|
+
}, t))
|
|
517
|
+
}),
|
|
518
|
+
/* @__PURE__ */ A("div", {
|
|
519
|
+
"data-ui": "date-range-picker-footer",
|
|
520
|
+
css: Se,
|
|
521
|
+
children: [/* @__PURE__ */ k("span", {
|
|
522
|
+
id: V,
|
|
523
|
+
role: "status",
|
|
524
|
+
"data-ui": "date-range-picker-summary",
|
|
525
|
+
className: a?.summary?.className,
|
|
526
|
+
css: [Ce, a?.summary?.css],
|
|
527
|
+
children: Ge ? O.summary({
|
|
528
|
+
range: _e(pe, Ge),
|
|
529
|
+
days: W(Ge),
|
|
530
|
+
formattedDays: ge.format(W(Ge))
|
|
531
|
+
}) : O.empty
|
|
532
|
+
}), /* @__PURE__ */ A("div", {
|
|
533
|
+
"data-ui": "date-range-picker-actions",
|
|
534
|
+
className: a?.actions?.className,
|
|
535
|
+
css: [we, a?.actions?.css],
|
|
536
|
+
children: [/* @__PURE__ */ k(o, {
|
|
537
|
+
variant: "ghost",
|
|
538
|
+
size: "sm",
|
|
539
|
+
onClick: de,
|
|
540
|
+
children: O.cancel
|
|
541
|
+
}), /* @__PURE__ */ k(o, {
|
|
542
|
+
tone: "accent",
|
|
543
|
+
size: "sm",
|
|
544
|
+
disabled: !ot,
|
|
545
|
+
onClick: () => {
|
|
546
|
+
ot && z(J);
|
|
547
|
+
},
|
|
548
|
+
children: O.apply
|
|
549
|
+
})]
|
|
550
|
+
})]
|
|
551
|
+
})
|
|
552
|
+
]
|
|
553
|
+
})
|
|
554
|
+
})
|
|
555
|
+
}) });
|
|
556
|
+
}
|
|
557
|
+
var Oe = Object.assign(Te, {
|
|
558
|
+
Trigger: Ee,
|
|
559
|
+
Content: Q
|
|
560
|
+
});
|
|
561
|
+
//#endregion
|
|
562
|
+
export { Oe as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
3
|
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
-
import {
|
|
5
|
-
import { t as i } from "./use-controlled-state-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { n as u, t as d } from "./
|
|
4
|
+
import { r } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { n as a, t as o } from "./surface-DZ4d-2aL.js";
|
|
7
|
+
import { t as s } from "./trigger-style-B1KVC8O1.js";
|
|
8
|
+
import { i as c, n as l, r as u, t as d } from "./use-native-dialog-DWpIUVO1.js";
|
|
9
9
|
import { createContext as f, useCallback as p, useContext as m, useEffect as h, useId as g, useMemo as _, useRef as v, useState as y } from "react";
|
|
10
10
|
import { vars as b } from "@jfrader/tokens/vars";
|
|
11
11
|
import { jsx as x } from "@emotion/react/jsx-runtime";
|
|
@@ -16,8 +16,8 @@ function w(e) {
|
|
|
16
16
|
if (!t) throw Error(`Dialog.${e} must be rendered inside <Dialog>.`);
|
|
17
17
|
return t;
|
|
18
18
|
}
|
|
19
|
-
var T = e(
|
|
20
|
-
...
|
|
19
|
+
var T = e(o), E = e({
|
|
20
|
+
...a,
|
|
21
21
|
borderRadius: b.radius.lg,
|
|
22
22
|
boxShadow: b.shadow.floating,
|
|
23
23
|
padding: b.space[5],
|
|
@@ -63,8 +63,8 @@ var T = e(d), E = e({
|
|
|
63
63
|
[r]: { transitionDuration: "0s" }
|
|
64
64
|
});
|
|
65
65
|
function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
66
|
-
let a = g(), [
|
|
67
|
-
open:
|
|
66
|
+
let a = g(), [o = !1, s] = i(e, t, n), { setDialogElement: l, setOpen: u, requestClose: d, repairToken: f } = c(o, s), [p, m] = y(!1), [h, v] = y(!1), b = _(() => ({
|
|
67
|
+
open: o,
|
|
68
68
|
setOpen: u,
|
|
69
69
|
requestClose: d,
|
|
70
70
|
repairToken: f,
|
|
@@ -76,7 +76,7 @@ function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
|
76
76
|
setHasTitle: m,
|
|
77
77
|
setHasDescription: v
|
|
78
78
|
}), [
|
|
79
|
-
|
|
79
|
+
o,
|
|
80
80
|
u,
|
|
81
81
|
d,
|
|
82
82
|
f,
|
|
@@ -91,8 +91,8 @@ function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
A.displayName = "Dialog";
|
|
94
|
-
function j({ ref: e = null, onClick: n, render: r, className: i, sx:
|
|
95
|
-
let { open: c, setOpen: l } = w("Trigger"), { "data-ui": u, ...d } =
|
|
94
|
+
function j({ ref: e = null, onClick: n, render: r, className: i, sx: a, ...o }) {
|
|
95
|
+
let { open: c, setOpen: l } = w("Trigger"), { "data-ui": u, ...d } = o, f = n, p = (e) => {
|
|
96
96
|
f?.(e), e.defaultPrevented || l(!0);
|
|
97
97
|
}, m = {
|
|
98
98
|
type: "button",
|
|
@@ -105,8 +105,8 @@ function j({ ref: e = null, onClick: n, render: r, className: i, sx: o, ...s })
|
|
|
105
105
|
};
|
|
106
106
|
return /* @__PURE__ */ x(t, {
|
|
107
107
|
className: i,
|
|
108
|
-
styles: r ? void 0 :
|
|
109
|
-
sx:
|
|
108
|
+
styles: r ? void 0 : s,
|
|
109
|
+
sx: a,
|
|
110
110
|
children: (e) => r ? r({
|
|
111
111
|
...m,
|
|
112
112
|
className: e
|
|
@@ -118,15 +118,15 @@ function j({ ref: e = null, onClick: n, render: r, className: i, sx: o, ...s })
|
|
|
118
118
|
}
|
|
119
119
|
j.displayName = "Dialog.Trigger";
|
|
120
120
|
function M({ ref: e, className: n, sx: r, ...i }) {
|
|
121
|
-
let { children: a, onCancel: o, onClick:
|
|
122
|
-
|
|
123
|
-
}, [y]), j =
|
|
121
|
+
let { children: a, onCancel: o, onClick: s, onClose: c, "aria-labelledby": f, "aria-describedby": m, withDescription: h = !0, ...g } = d(i), _ = w("Content"), { setOpen: y, titleId: b, descriptionId: S, hasTitle: D, hasDescription: O } = _, k = v(null), A = p(() => {
|
|
122
|
+
l(k.current, y);
|
|
123
|
+
}, [y]), j = u({
|
|
124
124
|
..._,
|
|
125
125
|
requestClose: A
|
|
126
126
|
}, {
|
|
127
127
|
onCancel: o,
|
|
128
|
-
onClick:
|
|
129
|
-
onClose:
|
|
128
|
+
onClick: s,
|
|
129
|
+
onClose: c
|
|
130
130
|
}, e, k), M = [f, D && b].filter(Boolean).join(" ") || void 0, N = [m, h && O && S].filter(Boolean).join(" ") || void 0;
|
|
131
131
|
return /* @__PURE__ */ x(t, {
|
|
132
132
|
className: n,
|
package/dist/dialog.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Dialog } from "./dialog-
|
|
2
|
+
export { t as Dialog } from "./dialog-ciiv9H2b.js";
|