@jfrader/ui 0.4.0 → 0.5.1
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-DLul6vIl.js +205 -0
- 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-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.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-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -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-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -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-DgWqyU75.js +802 -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-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -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-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -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-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.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-BCw4zZom.js +262 -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-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- 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-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -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/checkbox/checkbox.d.ts +1 -1
- 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 +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- 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/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -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/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -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 +68 -7
- 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/pagination/pagination.d.ts +1 -1
- 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/radio-group/radio-group.d.ts +1 -1
- 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-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -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/tabs/tabs.d.ts +1 -1
- 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/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -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 +2 -2
- 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 +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- 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-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- 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/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- 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
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,570 @@
|
|
|
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-NLY0h6EJ.js";
|
|
9
|
+
import { n as s } from "./surface-DZ4d-2aL.js";
|
|
10
|
+
import { a as ne, i as re } from "./overlay-layer-qEbpEtb8.js";
|
|
11
|
+
import { a as c, c as l, d as u, f as d, i as f, l as p, n as m, o as h, r as g, s as _, t as v, u as y } from "./calendar-BzJdv_SZ.js";
|
|
12
|
+
import { t as b } from "./overlay-portal-C4JZFq2M.js";
|
|
13
|
+
import { t as ie } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
14
|
+
import { createContext as x, useCallback as ae, useContext as S, useEffect as oe, useId as se, useLayoutEffect as ce, useMemo as C, useRef as w, useState as T } from "react";
|
|
15
|
+
import { vars as E } from "@jfrader/tokens/vars";
|
|
16
|
+
import { Fragment as D, jsx as O, jsxs as k } from "@emotion/react/jsx-runtime";
|
|
17
|
+
import { FloatingFocusManager as A, useClick as j, useInteractions as M, useMergeRefs as le, useRole as N } from "@floating-ui/react";
|
|
18
|
+
//#region src/components/date-range-picker/date-range-picker.tsx
|
|
19
|
+
var P = "bottom-start", F = 712, I = 864e5, ue = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), L = " ", 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
|
+
...m,
|
|
24
|
+
dateStyle: "medium"
|
|
25
|
+
}, V = x(null);
|
|
26
|
+
function H(e) {
|
|
27
|
+
let t = S(V);
|
|
28
|
+
if (!t) throw Error(`DateRangePicker.${e} must be rendered inside <DateRangePicker>.`);
|
|
29
|
+
return t;
|
|
30
|
+
}
|
|
31
|
+
var pe = (e) => e != null && l(e.start) && l(e.end) && e.start <= e.end, me = (e, t, n) => pe(e) && p(e.start, t, n) && p(e.end, t, n), U = (e, t) => e === t || e !== null && t !== null && e.start === t.start && e.end === t.end, W = (e, t) => e <= t ? {
|
|
32
|
+
start: e,
|
|
33
|
+
end: t
|
|
34
|
+
} : {
|
|
35
|
+
start: t,
|
|
36
|
+
end: e
|
|
37
|
+
}, G = ({ start: e, end: t }) => Math.round((f(t).getTime() - f(e).getTime()) / I) + 1;
|
|
38
|
+
function he() {
|
|
39
|
+
let e = /* @__PURE__ */ new Date();
|
|
40
|
+
return y(c(e.getFullYear(), e.getMonth(), e.getDate()));
|
|
41
|
+
}
|
|
42
|
+
var ge = (e, { start: t, end: n }) => e.formatRange(f(t), f(n)), _e = (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: E.space[2],
|
|
50
|
+
boxSizing: "border-box",
|
|
51
|
+
maxInlineSize: "100%",
|
|
52
|
+
border: `1px solid ${E.color.borderControl}`,
|
|
53
|
+
borderRadius: E.radius.md,
|
|
54
|
+
backgroundColor: E.color.surfaceRaised,
|
|
55
|
+
font: "inherit",
|
|
56
|
+
fontWeight: E.fontWeight.medium,
|
|
57
|
+
color: E.color.text,
|
|
58
|
+
textAlign: "start",
|
|
59
|
+
cursor: "pointer",
|
|
60
|
+
transitionProperty: "background-color, border-color",
|
|
61
|
+
transitionDuration: E.motion.duration.fast,
|
|
62
|
+
transitionTimingFunction: E.motion.easeStandard,
|
|
63
|
+
"&:hover:not(:disabled)": { backgroundColor: E.color.surfaceHover },
|
|
64
|
+
"&:focus-visible": { ...n },
|
|
65
|
+
"&[aria-invalid=\"true\"]:not(:focus-visible)": { borderColor: E.color.dangerText },
|
|
66
|
+
"&:disabled": {
|
|
67
|
+
opacity: .55,
|
|
68
|
+
cursor: "not-allowed"
|
|
69
|
+
},
|
|
70
|
+
[i]: { transitionDuration: "0s" }
|
|
71
|
+
}), q = {
|
|
72
|
+
sm: e({
|
|
73
|
+
minBlockSize: E.space[8],
|
|
74
|
+
paddingInline: E.space[3],
|
|
75
|
+
fontSize: E.textSize.sm
|
|
76
|
+
}),
|
|
77
|
+
md: e({
|
|
78
|
+
minBlockSize: E.space[10],
|
|
79
|
+
paddingInline: E.space[4],
|
|
80
|
+
fontSize: E.textSize.sm
|
|
81
|
+
}),
|
|
82
|
+
lg: e({
|
|
83
|
+
minBlockSize: E.space[12],
|
|
84
|
+
paddingInline: E.space[4],
|
|
85
|
+
fontSize: E.textSize.md
|
|
86
|
+
})
|
|
87
|
+
}, J = e({
|
|
88
|
+
display: "inline-flex",
|
|
89
|
+
flexShrink: 0,
|
|
90
|
+
color: E.color.textMuted,
|
|
91
|
+
"& > svg": {
|
|
92
|
+
inlineSize: "1em",
|
|
93
|
+
blockSize: "1em"
|
|
94
|
+
}
|
|
95
|
+
}), Y = e({ color: E.color.textMuted }), X = e({
|
|
96
|
+
display: "block",
|
|
97
|
+
marginBlockStart: E.space[2],
|
|
98
|
+
fontSize: E.textSize.xs,
|
|
99
|
+
color: E.color.dangerText
|
|
100
|
+
}), ve = e({
|
|
101
|
+
...s,
|
|
102
|
+
display: "grid",
|
|
103
|
+
gap: E.space[4],
|
|
104
|
+
borderRadius: E.radius.lg,
|
|
105
|
+
boxShadow: E.shadow.overlay,
|
|
106
|
+
padding: E.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: E.space[2],
|
|
113
|
+
"[data-layout=\"row\"] > &": {
|
|
114
|
+
overflowX: "auto",
|
|
115
|
+
paddingBlock: E.space[1]
|
|
116
|
+
},
|
|
117
|
+
"[data-layout=\"rail\"] > &": {
|
|
118
|
+
flexDirection: "column",
|
|
119
|
+
gridRow: "1 / span 2",
|
|
120
|
+
paddingInlineEnd: E.space[4],
|
|
121
|
+
borderInlineEnd: `1px solid ${E.color.border}`
|
|
122
|
+
}
|
|
123
|
+
}), be = e({
|
|
124
|
+
appearance: "none",
|
|
125
|
+
flexShrink: 0,
|
|
126
|
+
minBlockSize: E.space[8],
|
|
127
|
+
paddingInline: E.space[3],
|
|
128
|
+
border: "1px solid transparent",
|
|
129
|
+
borderRadius: E.radius.md,
|
|
130
|
+
backgroundColor: "transparent",
|
|
131
|
+
font: "inherit",
|
|
132
|
+
fontSize: E.textSize.sm,
|
|
133
|
+
color: E.color.text,
|
|
134
|
+
textAlign: "start",
|
|
135
|
+
whiteSpace: "nowrap",
|
|
136
|
+
cursor: "pointer",
|
|
137
|
+
transitionProperty: "background-color, border-color",
|
|
138
|
+
transitionDuration: E.motion.duration.fast,
|
|
139
|
+
transitionTimingFunction: E.motion.easeStandard,
|
|
140
|
+
"&:hover:not([aria-disabled=\"true\"])": { backgroundColor: E.color.surfaceHover },
|
|
141
|
+
"&[aria-pressed=\"true\"]": {
|
|
142
|
+
backgroundColor: E.color.accentSoft,
|
|
143
|
+
borderColor: E.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: E.space[6]
|
|
157
|
+
}), Se = e({
|
|
158
|
+
display: "flex",
|
|
159
|
+
flexWrap: "wrap",
|
|
160
|
+
alignItems: "center",
|
|
161
|
+
justifyContent: "space-between",
|
|
162
|
+
gap: E.space[3],
|
|
163
|
+
"[data-layout=\"rail\"] > &": { gridColumn: 2 }
|
|
164
|
+
}), Ce = e({
|
|
165
|
+
fontSize: E.textSize.sm,
|
|
166
|
+
color: E.color.textMuted
|
|
167
|
+
}), we = e({
|
|
168
|
+
display: "flex",
|
|
169
|
+
gap: E.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: re, firstDayOfWeek: c, today: u, months: d = "auto", boundary: f, presets: p = de, disabled: g = !1, readOnly: _ = !1, required: v = !1, startName: y, endName: b, messages: x, children: ae }) {
|
|
173
|
+
let [S = null, se, ce] = te(t, n ?? null, r), [E = !1, D] = te(i, ee, a), k = E && !g, [A, le] = T(null), [F, I] = T(null), ue = w(null), L = w(!1), R = w(null), z = C(() => new Intl.DateTimeFormat(re ?? h(), m).resolvedOptions().locale, [re]), B = C(() => new Intl.DateTimeFormat(z, fe), [z]), H = pe(S) ? S : null, W = l(o) ? o : void 0, G = l(s) ? s : void 0, _e = S !== null && H === null || W !== void 0 && G !== void 0 && W > G, K = l(u) ? u : he(), { refs: q, floatingStyles: J, context: Y } = ie({
|
|
174
|
+
open: k,
|
|
175
|
+
placement: P,
|
|
176
|
+
nodeId: e,
|
|
177
|
+
boundary: f,
|
|
178
|
+
onAvailableSize: (e) => I((t) => t?.width === e.width && t.height === e.height ? t : e),
|
|
179
|
+
onOpenChange: (e, t, n) => {
|
|
180
|
+
if (g && e) return;
|
|
181
|
+
let r = R.current;
|
|
182
|
+
R.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 || (L.current = n === "escape-key"), D(e));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
oe(() => {
|
|
188
|
+
!k && L.current && (L.current = !1, q.domReference.current?.focus());
|
|
189
|
+
}, [k, q]);
|
|
190
|
+
let X = j(Y, {
|
|
191
|
+
enabled: !g,
|
|
192
|
+
keyboardHandlers: !1
|
|
193
|
+
}), ve = ne(Y, "container"), ye = N(Y, { role: "dialog" }), { getReferenceProps: be, getFloatingProps: xe } = M([
|
|
194
|
+
X,
|
|
195
|
+
...ve,
|
|
196
|
+
ye
|
|
197
|
+
]), Se = C(() => H ? ge(B, H) : void 0, [B, H]), Ce = C(() => {
|
|
198
|
+
let e = (e) => {
|
|
199
|
+
U(e, S) || se(e);
|
|
200
|
+
};
|
|
201
|
+
return {
|
|
202
|
+
open: k,
|
|
203
|
+
disabled: g,
|
|
204
|
+
readOnly: _,
|
|
205
|
+
required: v,
|
|
206
|
+
invalid: _e,
|
|
207
|
+
value: H,
|
|
208
|
+
startName: y,
|
|
209
|
+
endName: b,
|
|
210
|
+
displayValue: Se,
|
|
211
|
+
min: W,
|
|
212
|
+
max: G,
|
|
213
|
+
locale: z,
|
|
214
|
+
firstDayOfWeek: c,
|
|
215
|
+
today: K,
|
|
216
|
+
months: d,
|
|
217
|
+
presets: p,
|
|
218
|
+
messages: x,
|
|
219
|
+
availableSize: F,
|
|
220
|
+
triggerLabelling: A,
|
|
221
|
+
contentRef: ue,
|
|
222
|
+
refs: q,
|
|
223
|
+
floatingContext: Y,
|
|
224
|
+
floatingStyles: J,
|
|
225
|
+
getReferenceProps: be,
|
|
226
|
+
getFloatingProps: xe,
|
|
227
|
+
requestOpen: () => {
|
|
228
|
+
g || D(!0);
|
|
229
|
+
},
|
|
230
|
+
apply: (t) => {
|
|
231
|
+
g || _ || !me(t, W, G) || (e(t), L.current = !0, D(!1));
|
|
232
|
+
},
|
|
233
|
+
cancel: () => {
|
|
234
|
+
L.current = !0, D(!1);
|
|
235
|
+
},
|
|
236
|
+
resetValue: () => {
|
|
237
|
+
t === void 0 ? ce() : e(n ?? null);
|
|
238
|
+
},
|
|
239
|
+
setTriggerLabelling: le
|
|
240
|
+
};
|
|
241
|
+
}, [
|
|
242
|
+
k,
|
|
243
|
+
g,
|
|
244
|
+
_,
|
|
245
|
+
v,
|
|
246
|
+
_e,
|
|
247
|
+
S,
|
|
248
|
+
H,
|
|
249
|
+
y,
|
|
250
|
+
b,
|
|
251
|
+
Se,
|
|
252
|
+
W,
|
|
253
|
+
G,
|
|
254
|
+
z,
|
|
255
|
+
c,
|
|
256
|
+
K,
|
|
257
|
+
d,
|
|
258
|
+
p,
|
|
259
|
+
x,
|
|
260
|
+
F,
|
|
261
|
+
A,
|
|
262
|
+
q,
|
|
263
|
+
Y,
|
|
264
|
+
J,
|
|
265
|
+
be,
|
|
266
|
+
xe,
|
|
267
|
+
se,
|
|
268
|
+
D,
|
|
269
|
+
ce,
|
|
270
|
+
t,
|
|
271
|
+
n
|
|
272
|
+
]);
|
|
273
|
+
return /* @__PURE__ */ O(V.Provider, {
|
|
274
|
+
value: Ce,
|
|
275
|
+
children: ae
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
function Te(e) {
|
|
279
|
+
return /* @__PURE__ */ O(re, { children: (t) => /* @__PURE__ */ O(Z, {
|
|
280
|
+
...e,
|
|
281
|
+
nodeId: t
|
|
282
|
+
}) });
|
|
283
|
+
}
|
|
284
|
+
Te.displayName = "DateRangePicker";
|
|
285
|
+
function Ee({ ref: e, id: n, form: r, size: i = "md", icon: ee, placeholder: te, className: o, sx: s, onKeyDown: ne, onKeyUp: re, "aria-label": c, "aria-labelledby": l, "aria-describedby": u, "aria-invalid": d, ...f }) {
|
|
286
|
+
let { open: p, disabled: m, readOnly: h, required: g, invalid: _, displayValue: v, value: y, startName: b, endName: ie, messages: x, contentRef: ae, refs: S, getReferenceProps: C, requestOpen: T, resetValue: E, setTriggerLabelling: A } = H("Trigger"), j = w(null), M = le([
|
|
287
|
+
S.setReference,
|
|
288
|
+
e,
|
|
289
|
+
j
|
|
290
|
+
]), N = se(), P = n ?? N, F = `${P}-value`, I = `${P}-required`, R = `${P}-error`, z = g && a(x.required), B = _ || d, de = (B === !0 || B === "true") && a(x.error);
|
|
291
|
+
ce(() => (A(l === void 0 ? c === void 0 ? null : { label: c } : { labelledBy: l }), () => A(null)), [
|
|
292
|
+
l,
|
|
293
|
+
c,
|
|
294
|
+
A
|
|
295
|
+
]);
|
|
296
|
+
let fe = w(E);
|
|
297
|
+
oe(() => {
|
|
298
|
+
fe.current = E;
|
|
299
|
+
}), oe(() => {
|
|
300
|
+
let e = j.current?.form;
|
|
301
|
+
if (!e) return;
|
|
302
|
+
let t = () => fe.current();
|
|
303
|
+
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
304
|
+
}, [r]);
|
|
305
|
+
let V = l ?? (c === void 0 ? void 0 : P), pe = V === void 0 ? void 0 : [
|
|
306
|
+
V,
|
|
307
|
+
F,
|
|
308
|
+
z ? I : void 0
|
|
309
|
+
].filter(Boolean).join(" "), me = [u, de ? R : void 0].filter(Boolean).join(" ") || void 0, U = () => {
|
|
310
|
+
m || (p ? _e(ae.current) : T());
|
|
311
|
+
}, W = (e) => {
|
|
312
|
+
ne?.(e), !(e.defaultPrevented || m) && (e.key === L ? e.preventDefault() : ue.has(e.key) && (e.preventDefault(), U()));
|
|
313
|
+
}, G = (e) => {
|
|
314
|
+
re?.(e), !(e.defaultPrevented || m || e.key !== L) && U();
|
|
315
|
+
};
|
|
316
|
+
return /* @__PURE__ */ k(D, { children: [
|
|
317
|
+
/* @__PURE__ */ O(t, {
|
|
318
|
+
className: o,
|
|
319
|
+
styles: [K, q[i]],
|
|
320
|
+
sx: s,
|
|
321
|
+
children: (e) => /* @__PURE__ */ k("button", {
|
|
322
|
+
type: "button",
|
|
323
|
+
...C({
|
|
324
|
+
...f,
|
|
325
|
+
onKeyDown: W,
|
|
326
|
+
onKeyUp: G
|
|
327
|
+
}),
|
|
328
|
+
ref: M,
|
|
329
|
+
id: P,
|
|
330
|
+
form: r,
|
|
331
|
+
disabled: m,
|
|
332
|
+
"aria-label": c,
|
|
333
|
+
"aria-labelledby": pe,
|
|
334
|
+
"aria-describedby": me,
|
|
335
|
+
"aria-invalid": B,
|
|
336
|
+
"data-ui": "date-range-picker",
|
|
337
|
+
"data-state": p ? "open" : "closed",
|
|
338
|
+
"data-size": i,
|
|
339
|
+
"data-readonly": h || void 0,
|
|
340
|
+
"data-required": g || void 0,
|
|
341
|
+
className: e,
|
|
342
|
+
children: [
|
|
343
|
+
a(ee) && /* @__PURE__ */ O("span", {
|
|
344
|
+
"aria-hidden": "true",
|
|
345
|
+
css: J,
|
|
346
|
+
children: ee
|
|
347
|
+
}),
|
|
348
|
+
v === void 0 ? /* @__PURE__ */ O("span", {
|
|
349
|
+
id: F,
|
|
350
|
+
"data-placeholder": "",
|
|
351
|
+
css: Y,
|
|
352
|
+
children: te
|
|
353
|
+
}) : /* @__PURE__ */ O("span", {
|
|
354
|
+
id: F,
|
|
355
|
+
children: v
|
|
356
|
+
}),
|
|
357
|
+
z && /* @__PURE__ */ O("span", {
|
|
358
|
+
id: I,
|
|
359
|
+
hidden: !0,
|
|
360
|
+
children: x.required
|
|
361
|
+
})
|
|
362
|
+
]
|
|
363
|
+
})
|
|
364
|
+
}),
|
|
365
|
+
de && /* @__PURE__ */ O("span", {
|
|
366
|
+
id: R,
|
|
367
|
+
role: "alert",
|
|
368
|
+
"data-ui": "date-range-picker-error",
|
|
369
|
+
css: X,
|
|
370
|
+
children: x.error
|
|
371
|
+
}),
|
|
372
|
+
b !== void 0 && /* @__PURE__ */ O("input", {
|
|
373
|
+
type: "hidden",
|
|
374
|
+
form: r,
|
|
375
|
+
name: b,
|
|
376
|
+
value: y?.start ?? "",
|
|
377
|
+
disabled: m
|
|
378
|
+
}),
|
|
379
|
+
ie !== void 0 && /* @__PURE__ */ O("input", {
|
|
380
|
+
type: "hidden",
|
|
381
|
+
form: r,
|
|
382
|
+
name: ie,
|
|
383
|
+
value: y?.end ?? "",
|
|
384
|
+
disabled: m
|
|
385
|
+
})
|
|
386
|
+
] });
|
|
387
|
+
}
|
|
388
|
+
Ee.displayName = "DateRangePicker.Trigger";
|
|
389
|
+
function Q(e) {
|
|
390
|
+
let { open: t } = H("Content");
|
|
391
|
+
return t ? /* @__PURE__ */ O(De, { ...e }) : null;
|
|
392
|
+
}
|
|
393
|
+
Q.displayName = "DateRangePicker.Content";
|
|
394
|
+
function De({ ref: e, dir: n, style: r, className: i, sx: te, slotProps: a, "aria-label": s, "aria-labelledby": ne, "aria-describedby": re, ...c }) {
|
|
395
|
+
let { readOnly: l, value: f, min: m, max: h, locale: y, firstDayOfWeek: ie, today: x, months: S, presets: E, messages: D, availableSize: j, triggerLabelling: M, contentRef: N, refs: P, floatingContext: I, floatingStyles: ue, getFloatingProps: L, apply: z, cancel: de } = H("Content"), V = se(), pe = C(() => new Intl.DateTimeFormat(y, fe), [y]), he = C(() => new Intl.NumberFormat(y), [y]), K = (e) => e != null && p(e, m, h), q = m === void 0 || h === void 0 || m <= h ? K(f?.start) ? f.start : g(h !== void 0 && x > h ? _(u(h)) : x, m, h) : null, [J, Y] = T(f), [X, Z] = T(!1), [Te, Ee] = T(f);
|
|
396
|
+
U(Te, f) || (Ee(f), Y(f), Z(!1));
|
|
397
|
+
let [Q, De] = T(q), [Oe, ke] = T(null), [Ae, je] = T(null), Me = w(null), Ne = j?.width ?? P.domReference.current?.ownerDocument.documentElement.clientWidth ?? 0, $ = S === "auto" ? Ne >= F ? 2 : 1 : S, [Pe, Fe] = T(u(q ?? g(x, m, void 0))), Ie = Array.from({ length: $ }, (e, t) => d(Pe, t)), Le = Ie[Ie.length - 1] ?? Pe, Re = (e) => u(e) >= Pe && u(e) <= Le, ze = (e, t = $) => {
|
|
398
|
+
let n = u(e);
|
|
399
|
+
n < Pe ? Fe(n) : n > d(Pe, t - 1) && Fe(d(n, 1 - t));
|
|
400
|
+
}, [Be, Ve] = T($);
|
|
401
|
+
Be !== $ && (Ve($), Q !== null && ze(Q, $));
|
|
402
|
+
let He = [
|
|
403
|
+
Q,
|
|
404
|
+
J?.start,
|
|
405
|
+
x
|
|
406
|
+
].find((e) => K(e) && Re(e)) ?? Ie.map((e) => g(_(e), m, h)).find((e) => Re(e) && K(e)) ?? null, Ue = Oe ?? Q, We = X && J && K(Ue) ? W(J.start, Ue) : null, Ge = We ?? J;
|
|
407
|
+
oe(() => {
|
|
408
|
+
let e = Me.current;
|
|
409
|
+
if (e === null) return;
|
|
410
|
+
Me.current = null;
|
|
411
|
+
let t = N.current?.querySelector(`${R}[data-date="${e}"]`);
|
|
412
|
+
t && t.ownerDocument.activeElement !== t && t.focus();
|
|
413
|
+
});
|
|
414
|
+
let Ke = (e) => {
|
|
415
|
+
De(e), ke(null), ze(e);
|
|
416
|
+
let t = N.current?.ownerDocument.activeElement;
|
|
417
|
+
Me.current = t instanceof HTMLElement && t.dataset.date === e ? null : e;
|
|
418
|
+
}, qe = (e) => {
|
|
419
|
+
l || (X && J ? (Y(W(J.start, e)), Z(!1)) : (Y({
|
|
420
|
+
start: e,
|
|
421
|
+
end: e
|
|
422
|
+
}), Z(!0)));
|
|
423
|
+
}, Je = (e) => {
|
|
424
|
+
let t = e.target.closest(R);
|
|
425
|
+
ke(t && !t.disabled ? t.dataset.date ?? null : null);
|
|
426
|
+
}, Ye = E.map((e) => {
|
|
427
|
+
let t = e.range(x);
|
|
428
|
+
return {
|
|
429
|
+
preset: e,
|
|
430
|
+
range: t,
|
|
431
|
+
enabled: !l && me(t, m, h)
|
|
432
|
+
};
|
|
433
|
+
}), Xe = Ye.find((e) => e.enabled && e.preset.id === Ae) ?? Ye.find((e) => e.enabled), Ze = (e) => {
|
|
434
|
+
Y(e), Z(!1), De(e.start), ze(e.start);
|
|
435
|
+
}, Qe = w(null), $e = ae((e) => {
|
|
436
|
+
N.current = e, e && !Qe.current && (Qe.current = _e(e));
|
|
437
|
+
}, [N]), et = le([
|
|
438
|
+
P.setFloating,
|
|
439
|
+
e,
|
|
440
|
+
$e
|
|
441
|
+
]), tt = I.elements.domReference, [nt, rt] = T();
|
|
442
|
+
ce(() => {
|
|
443
|
+
rt(tt?.ownerDocument.defaultView?.getComputedStyle(tt).direction);
|
|
444
|
+
}, [tt]);
|
|
445
|
+
let it = ne !== void 0 || s !== void 0 ? {
|
|
446
|
+
"aria-labelledby": ne,
|
|
447
|
+
"aria-label": s
|
|
448
|
+
} : M?.labelledBy === void 0 ? { "aria-label": M?.label } : { "aria-labelledby": M.labelledBy }, at = $ === 2 && Ye.length > 0 ? "rail" : "row", ot = !l && me(J, m, h);
|
|
449
|
+
return /* @__PURE__ */ O(b, { children: /* @__PURE__ */ O(A, {
|
|
450
|
+
context: I,
|
|
451
|
+
modal: !1,
|
|
452
|
+
initialFocus: Qe,
|
|
453
|
+
returnFocus: !1,
|
|
454
|
+
children: /* @__PURE__ */ O(t, {
|
|
455
|
+
className: i,
|
|
456
|
+
styles: ve,
|
|
457
|
+
sx: te,
|
|
458
|
+
children: (e) => /* @__PURE__ */ k("div", {
|
|
459
|
+
...L({
|
|
460
|
+
...it,
|
|
461
|
+
"aria-describedby": [re, V].filter(Boolean).join(" "),
|
|
462
|
+
...c
|
|
463
|
+
}),
|
|
464
|
+
ref: et,
|
|
465
|
+
dir: n ?? nt,
|
|
466
|
+
"data-ui": "date-range-picker-content",
|
|
467
|
+
"data-layout": at,
|
|
468
|
+
style: {
|
|
469
|
+
...r,
|
|
470
|
+
...ue,
|
|
471
|
+
...j && {
|
|
472
|
+
maxInlineSize: j.width,
|
|
473
|
+
maxBlockSize: j.height
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
className: e,
|
|
477
|
+
children: [
|
|
478
|
+
Ye.length > 0 && /* @__PURE__ */ O("div", {
|
|
479
|
+
role: "group",
|
|
480
|
+
"aria-label": D.presets,
|
|
481
|
+
"data-ui": "date-range-picker-presets",
|
|
482
|
+
className: a?.presets?.className,
|
|
483
|
+
css: [ye, a?.presets?.css],
|
|
484
|
+
onKeyDown: (e) => ee(e, e.currentTarget, at === "rail" ? "vertical" : "horizontal", B),
|
|
485
|
+
children: Ye.map(({ preset: e, range: t, enabled: n }) => /* @__PURE__ */ O("button", {
|
|
486
|
+
type: "button",
|
|
487
|
+
"data-ui": "date-range-picker-preset",
|
|
488
|
+
"aria-disabled": !n || void 0,
|
|
489
|
+
"aria-pressed": n && U(t, J) && !X,
|
|
490
|
+
tabIndex: e === Xe?.preset ? 0 : -1,
|
|
491
|
+
onFocus: () => je(e.id),
|
|
492
|
+
onClick: () => {
|
|
493
|
+
n && Ze(t);
|
|
494
|
+
},
|
|
495
|
+
css: be,
|
|
496
|
+
children: e.label
|
|
497
|
+
}, e.id))
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ O("div", {
|
|
500
|
+
"data-ui": "date-range-picker-calendars",
|
|
501
|
+
className: a?.calendars?.className,
|
|
502
|
+
css: [xe, a?.calendars?.css],
|
|
503
|
+
children: Ie.map((e, t) => /* @__PURE__ */ k(v, {
|
|
504
|
+
visibleMonth: e,
|
|
505
|
+
onVisibleMonthChange: (e) => Fe(d(e, -t)),
|
|
506
|
+
min: m,
|
|
507
|
+
max: h,
|
|
508
|
+
locale: y,
|
|
509
|
+
firstDayOfWeek: ie,
|
|
510
|
+
today: x,
|
|
511
|
+
selectionRange: J,
|
|
512
|
+
previewRange: We,
|
|
513
|
+
tabStopDate: He !== null && u(He) === e ? He : null,
|
|
514
|
+
onDayActivate: qe,
|
|
515
|
+
onFocusedDateChange: Ke,
|
|
516
|
+
rangeLabels: {
|
|
517
|
+
start: D.start,
|
|
518
|
+
end: D.end
|
|
519
|
+
},
|
|
520
|
+
children: [/* @__PURE__ */ O(v.Header, {}), /* @__PURE__ */ O(v.Grid, {
|
|
521
|
+
onPointerMove: Je,
|
|
522
|
+
onPointerLeave: () => ke(null)
|
|
523
|
+
})]
|
|
524
|
+
}, t))
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ k("div", {
|
|
527
|
+
"data-ui": "date-range-picker-footer",
|
|
528
|
+
css: Se,
|
|
529
|
+
children: [/* @__PURE__ */ O("span", {
|
|
530
|
+
id: V,
|
|
531
|
+
role: "status",
|
|
532
|
+
"data-ui": "date-range-picker-summary",
|
|
533
|
+
className: a?.summary?.className,
|
|
534
|
+
css: [Ce, a?.summary?.css],
|
|
535
|
+
children: Ge ? D.summary({
|
|
536
|
+
range: ge(pe, Ge),
|
|
537
|
+
days: G(Ge),
|
|
538
|
+
formattedDays: he.format(G(Ge))
|
|
539
|
+
}) : D.empty
|
|
540
|
+
}), /* @__PURE__ */ k("div", {
|
|
541
|
+
"data-ui": "date-range-picker-actions",
|
|
542
|
+
className: a?.actions?.className,
|
|
543
|
+
css: [we, a?.actions?.css],
|
|
544
|
+
children: [/* @__PURE__ */ O(o, {
|
|
545
|
+
variant: "ghost",
|
|
546
|
+
size: "sm",
|
|
547
|
+
onClick: de,
|
|
548
|
+
children: D.cancel
|
|
549
|
+
}), /* @__PURE__ */ O(o, {
|
|
550
|
+
tone: "accent",
|
|
551
|
+
size: "sm",
|
|
552
|
+
disabled: !ot,
|
|
553
|
+
onClick: () => {
|
|
554
|
+
ot && z(J);
|
|
555
|
+
},
|
|
556
|
+
children: D.apply
|
|
557
|
+
})]
|
|
558
|
+
})]
|
|
559
|
+
})
|
|
560
|
+
]
|
|
561
|
+
})
|
|
562
|
+
})
|
|
563
|
+
}) });
|
|
564
|
+
}
|
|
565
|
+
var Oe = Object.assign(Te, {
|
|
566
|
+
Trigger: Ee,
|
|
567
|
+
Content: Q
|
|
568
|
+
});
|
|
569
|
+
//#endregion
|
|
570
|
+
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,12 +16,12 @@ 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],
|
|
24
|
-
minInlineSize: "320px",
|
|
24
|
+
minInlineSize: "min(320px, 100%)",
|
|
25
25
|
maxInlineSize: "min(560px, calc(100vw - 32px))"
|
|
26
26
|
}), D = e({
|
|
27
27
|
margin: 0,
|
|
@@ -38,6 +38,7 @@ var T = e(d), E = e({
|
|
|
38
38
|
appearance: "none",
|
|
39
39
|
display: "inline-flex",
|
|
40
40
|
alignItems: "center",
|
|
41
|
+
minBlockSize: "32px",
|
|
41
42
|
border: "1px solid transparent",
|
|
42
43
|
borderRadius: b.radius.md,
|
|
43
44
|
backgroundColor: "transparent",
|
|
@@ -63,8 +64,8 @@ var T = e(d), E = e({
|
|
|
63
64
|
[r]: { transitionDuration: "0s" }
|
|
64
65
|
});
|
|
65
66
|
function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
66
|
-
let a = g(), [
|
|
67
|
-
open:
|
|
67
|
+
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 = _(() => ({
|
|
68
|
+
open: o,
|
|
68
69
|
setOpen: u,
|
|
69
70
|
requestClose: d,
|
|
70
71
|
repairToken: f,
|
|
@@ -76,7 +77,7 @@ function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
|
76
77
|
setHasTitle: m,
|
|
77
78
|
setHasDescription: v
|
|
78
79
|
}), [
|
|
79
|
-
|
|
80
|
+
o,
|
|
80
81
|
u,
|
|
81
82
|
d,
|
|
82
83
|
f,
|
|
@@ -91,8 +92,8 @@ function A({ open: e, defaultOpen: t = !1, onOpenChange: n, children: r }) {
|
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
94
|
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 } =
|
|
95
|
+
function j({ ref: e = null, onClick: n, render: r, className: i, sx: a, ...o }) {
|
|
96
|
+
let { open: c, setOpen: l } = w("Trigger"), { "data-ui": u, ...d } = o, f = n, p = (e) => {
|
|
96
97
|
f?.(e), e.defaultPrevented || l(!0);
|
|
97
98
|
}, m = {
|
|
98
99
|
type: "button",
|
|
@@ -105,8 +106,8 @@ function j({ ref: e = null, onClick: n, render: r, className: i, sx: o, ...s })
|
|
|
105
106
|
};
|
|
106
107
|
return /* @__PURE__ */ x(t, {
|
|
107
108
|
className: i,
|
|
108
|
-
styles: r ? void 0 :
|
|
109
|
-
sx:
|
|
109
|
+
styles: r ? void 0 : s,
|
|
110
|
+
sx: a,
|
|
110
111
|
children: (e) => r ? r({
|
|
111
112
|
...m,
|
|
112
113
|
className: e
|
|
@@ -118,15 +119,15 @@ function j({ ref: e = null, onClick: n, render: r, className: i, sx: o, ...s })
|
|
|
118
119
|
}
|
|
119
120
|
j.displayName = "Dialog.Trigger";
|
|
120
121
|
function M({ ref: e, className: n, sx: r, ...i }) {
|
|
121
|
-
let { children: a, onCancel: o, onClick:
|
|
122
|
-
|
|
123
|
-
}, [y]), j =
|
|
122
|
+
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(() => {
|
|
123
|
+
l(k.current, y);
|
|
124
|
+
}, [y]), j = u({
|
|
124
125
|
..._,
|
|
125
126
|
requestClose: A
|
|
126
127
|
}, {
|
|
127
128
|
onCancel: o,
|
|
128
|
-
onClick:
|
|
129
|
-
onClose:
|
|
129
|
+
onClick: s,
|
|
130
|
+
onClose: c
|
|
130
131
|
}, e, k), M = [f, D && b].filter(Boolean).join(" ") || void 0, N = [m, h && O && S].filter(Boolean).join(" ") || void 0;
|
|
131
132
|
return /* @__PURE__ */ x(t, {
|
|
132
133
|
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-BX1zYMs-.js";
|