@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,293 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as a } from "./use-latest-callback-cj1OOQL6.js";
|
|
5
|
+
import { t as o } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
7
|
+
import { useEffect as c, useId as l, useRef as u, useState as d } from "react";
|
|
8
|
+
import { vars as f } from "@jfrader/tokens/vars";
|
|
9
|
+
import { Fragment as p, jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/countdown/countdown.tsx
|
|
11
|
+
var ee = 2147483647, g = 864e13, _ = 1e3, v = [
|
|
12
|
+
"days",
|
|
13
|
+
"hours",
|
|
14
|
+
"minutes",
|
|
15
|
+
"seconds"
|
|
16
|
+
], y = {
|
|
17
|
+
days: 86400,
|
|
18
|
+
hours: 3600,
|
|
19
|
+
minutes: 60,
|
|
20
|
+
seconds: 1
|
|
21
|
+
}, b = {
|
|
22
|
+
days: "day",
|
|
23
|
+
hours: "hour",
|
|
24
|
+
minutes: "minute",
|
|
25
|
+
seconds: "second"
|
|
26
|
+
}, te = () => Date.now(), x = (e) => Number.isFinite(e) && Math.abs(e) <= g, S = (e) => s(e) && e !== "";
|
|
27
|
+
function ne(e) {
|
|
28
|
+
if (typeof e == "string") {
|
|
29
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d{1,3})?)?(Z|[+-](\d{2}):(\d{2}))$/.exec(e);
|
|
30
|
+
if (!t) return null;
|
|
31
|
+
let [, n, r, i, a, o, s, , c, l] = t, u = /* @__PURE__ */ new Date(`${n}-${r}-01T00:00:00Z`);
|
|
32
|
+
if (u.setUTCMonth(u.getUTCMonth() + 1, 0), +r < 1 || +r > 12 || +i < 1 || +i > u.getUTCDate() || +a > 23 || +o > 59 || +(s ?? 0) > 59 || +(c ?? 0) > 23 || +(l ?? 0) > 59) return null;
|
|
33
|
+
}
|
|
34
|
+
let t = typeof e == "number" ? e : e instanceof Date ? e.getTime() : Date.parse(e);
|
|
35
|
+
return x(t) ? t : null;
|
|
36
|
+
}
|
|
37
|
+
function C(e, t) {
|
|
38
|
+
return t.map((t) => {
|
|
39
|
+
let n = Math.floor(e / y[t]);
|
|
40
|
+
return e %= y[t], {
|
|
41
|
+
unit: t,
|
|
42
|
+
value: n
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function re(e, t, n) {
|
|
47
|
+
let r = e >= 60 && t.length > 1 ? t.filter((e) => e !== "seconds") : t, i = C(e, r);
|
|
48
|
+
if (r.length === 1 && r[0] === "seconds") return new Intl.NumberFormat(n, {
|
|
49
|
+
style: "unit",
|
|
50
|
+
unit: "second",
|
|
51
|
+
unitDisplay: "long"
|
|
52
|
+
}).format(e);
|
|
53
|
+
let a = i.filter(({ value: e }) => e > 0);
|
|
54
|
+
a.length || a.push(i[i.length - 1]);
|
|
55
|
+
let o = Intl.DurationFormat;
|
|
56
|
+
return typeof o == "function" ? new o(n, {
|
|
57
|
+
style: "long",
|
|
58
|
+
...Object.fromEntries(a.map(({ unit: e }) => [`${e}Display`, "always"]))
|
|
59
|
+
}).format(Object.fromEntries(a.map(({ unit: e, value: t }) => [e, t]))) : new Intl.ListFormat(n, {
|
|
60
|
+
style: "long",
|
|
61
|
+
type: "conjunction"
|
|
62
|
+
}).format(a.map(({ unit: e, value: t }) => new Intl.NumberFormat(n, {
|
|
63
|
+
style: "unit",
|
|
64
|
+
unit: b[e],
|
|
65
|
+
unitDisplay: "long"
|
|
66
|
+
}).format(t)));
|
|
67
|
+
}
|
|
68
|
+
var w = e({
|
|
69
|
+
from: {
|
|
70
|
+
transform: "translateY(100%)",
|
|
71
|
+
opacity: 0
|
|
72
|
+
},
|
|
73
|
+
to: {
|
|
74
|
+
transform: "translateY(0)",
|
|
75
|
+
opacity: 1
|
|
76
|
+
}
|
|
77
|
+
}), T = e({
|
|
78
|
+
from: { opacity: 0 },
|
|
79
|
+
to: { opacity: 1 }
|
|
80
|
+
}), ie = t({
|
|
81
|
+
display: "grid",
|
|
82
|
+
gap: f.space[2],
|
|
83
|
+
inlineSize: "fit-content",
|
|
84
|
+
maxInlineSize: "100%",
|
|
85
|
+
minInlineSize: 0,
|
|
86
|
+
fontFamily: f.font.sans,
|
|
87
|
+
color: f.color.text,
|
|
88
|
+
textAlign: "start",
|
|
89
|
+
lineHeight: f.lineHeight.base,
|
|
90
|
+
overflowWrap: "anywhere",
|
|
91
|
+
[r]: { color: "CanvasText" }
|
|
92
|
+
}), E = t({
|
|
93
|
+
fontSize: f.textSize.sm,
|
|
94
|
+
color: f.color.textMuted
|
|
95
|
+
}), D = t({
|
|
96
|
+
display: "flex",
|
|
97
|
+
flexWrap: "wrap",
|
|
98
|
+
alignItems: "baseline",
|
|
99
|
+
gap: f.space[4],
|
|
100
|
+
minInlineSize: 0,
|
|
101
|
+
maxInlineSize: "100%"
|
|
102
|
+
}), ae = t({
|
|
103
|
+
minBlockSize: f.space[8],
|
|
104
|
+
boxSizing: "border-box",
|
|
105
|
+
border: `1px solid ${f.color.borderControl}`,
|
|
106
|
+
borderRadius: f.radius.full,
|
|
107
|
+
paddingInline: f.space[3],
|
|
108
|
+
paddingBlock: f.space[1],
|
|
109
|
+
backgroundColor: f.color.surfaceRaised,
|
|
110
|
+
"& [data-ui=\"countdown-content\"]": { gap: f.space[2] },
|
|
111
|
+
[r]: {
|
|
112
|
+
borderColor: "CanvasText",
|
|
113
|
+
backgroundColor: "transparent"
|
|
114
|
+
}
|
|
115
|
+
}), oe = t({
|
|
116
|
+
maxInlineSize: "100%",
|
|
117
|
+
minInlineSize: 0,
|
|
118
|
+
fontSize: f.textSize.xs
|
|
119
|
+
}), O = t({
|
|
120
|
+
display: "inline-block",
|
|
121
|
+
maxInlineSize: "100%",
|
|
122
|
+
fontFamily: f.font.mono,
|
|
123
|
+
fontVariantNumeric: "tabular-nums",
|
|
124
|
+
fontWeight: f.fontWeight.medium,
|
|
125
|
+
lineHeight: f.lineHeight.tight
|
|
126
|
+
}), k = t({ fontSize: `clamp(${f.textSize["2xl"]}, 8cqi, ${f.textSize["3xl"]})` }), A = t({ fontSize: f.textSize.sm }), j = t({
|
|
127
|
+
animation: `${w} ${f.motion.duration.base} ${f.motion.easeStandard}`,
|
|
128
|
+
[i]: { animation: "none" }
|
|
129
|
+
}), M = t({
|
|
130
|
+
display: "flex",
|
|
131
|
+
flexWrap: "wrap",
|
|
132
|
+
alignItems: "center",
|
|
133
|
+
gap: f.space[2],
|
|
134
|
+
color: f.color.text,
|
|
135
|
+
animation: `${T} ${f.motion.duration.fast} ${f.motion.easeStandard}`,
|
|
136
|
+
[i]: { animation: "none" }
|
|
137
|
+
}), se = t({
|
|
138
|
+
display: "inline-flex",
|
|
139
|
+
color: f.color.success,
|
|
140
|
+
[r]: { color: "CanvasText" }
|
|
141
|
+
});
|
|
142
|
+
function ce({ value: e, variant: t, slot: n }) {
|
|
143
|
+
let r = u(e), i = r.current !== e;
|
|
144
|
+
return c(() => {
|
|
145
|
+
r.current = e;
|
|
146
|
+
}, [e]), /* @__PURE__ */ m("span", {
|
|
147
|
+
"data-ui": "countdown-number",
|
|
148
|
+
className: n?.className,
|
|
149
|
+
css: [
|
|
150
|
+
O,
|
|
151
|
+
t === "display" ? k : A,
|
|
152
|
+
i && j,
|
|
153
|
+
n?.css
|
|
154
|
+
],
|
|
155
|
+
children: e
|
|
156
|
+
}, e);
|
|
157
|
+
}
|
|
158
|
+
function N({ ref: e, target: t, variant: r = "display", units: i = v, label: s = "Time remaining", locale: f, unitDisplay: g = r === "display" ? "long" : "narrow", completeLabel: y = "Live now", completeText: w = "Complete", pendingLabel: T = "—", invalidLabel: O = "Unavailable", invalidText: k = "Unavailable", clock: A = te, initialNow: j, onComplete: N, announceCompletion: P = !1, completionIcon: F, slotProps: I, className: L, sx: le, "aria-labelledby": R, "aria-describedby": ue, "aria-label": de, ...fe }) {
|
|
159
|
+
let z = `${l()}-label`, B = `${l()}-description`, V = ne(t), H = v.filter((e) => i.includes(e)), U = H.length ? H : v, [W, pe] = d(j), [me, G] = d(null), K = a(N), q = u({
|
|
160
|
+
epoch: V,
|
|
161
|
+
fired: !1
|
|
162
|
+
});
|
|
163
|
+
c(() => {
|
|
164
|
+
if (q.current.epoch !== V && (q.current = {
|
|
165
|
+
epoch: V,
|
|
166
|
+
fired: !1
|
|
167
|
+
}), G(null), V === null) return;
|
|
168
|
+
let e, t, n = () => {
|
|
169
|
+
clearTimeout(e), clearTimeout(t);
|
|
170
|
+
let r;
|
|
171
|
+
try {
|
|
172
|
+
r = A();
|
|
173
|
+
} catch {
|
|
174
|
+
r = NaN;
|
|
175
|
+
}
|
|
176
|
+
if (pe(r), !x(r)) {
|
|
177
|
+
t = setTimeout(n, _);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
let i = V - r;
|
|
181
|
+
i <= 0 ? q.current.fired ? G(V) : (q.current.fired = !0, G(V), K(V)) : (t = setTimeout(n, Math.min(i, ee)), document.visibilityState !== "hidden" && (e = setTimeout(n, Math.min(i, i % _ || _))));
|
|
182
|
+
};
|
|
183
|
+
return n(), document.addEventListener("visibilitychange", n), window.addEventListener("pageshow", n), () => {
|
|
184
|
+
clearTimeout(e), clearTimeout(t), document.removeEventListener("visibilitychange", n), window.removeEventListener("pageshow", n);
|
|
185
|
+
};
|
|
186
|
+
}, [
|
|
187
|
+
V,
|
|
188
|
+
A,
|
|
189
|
+
K
|
|
190
|
+
]);
|
|
191
|
+
let J = V === null || W !== void 0 && !x(W) ? "invalid" : W === void 0 ? "pending" : W >= V ? "complete" : "running", Y = J === "running" ? Math.ceil((V - W) / _) : 0, he = J === "running" ? re(Y, U, f) : void 0, X = S(y) && (typeof y == "string" || typeof y == "number"), ge = typeof O == "string" || typeof O == "number", Z = P && J === "complete" && me === V, Q = he ?? (J === "invalid" ? k : J === "complete" && !X && !Z ? w : void 0), $ = /* @__PURE__ */ h(p, { children: [
|
|
192
|
+
S(F) && /* @__PURE__ */ m("span", {
|
|
193
|
+
"data-ui": "countdown-icon",
|
|
194
|
+
"aria-hidden": "true",
|
|
195
|
+
className: I?.icon?.className,
|
|
196
|
+
css: [se, I?.icon?.css],
|
|
197
|
+
children: F
|
|
198
|
+
}),
|
|
199
|
+
S(y) ? /* @__PURE__ */ m("span", {
|
|
200
|
+
"aria-hidden": !X || void 0,
|
|
201
|
+
children: y
|
|
202
|
+
}) : null,
|
|
203
|
+
!X && Z && /* @__PURE__ */ m("span", {
|
|
204
|
+
css: o,
|
|
205
|
+
children: w
|
|
206
|
+
})
|
|
207
|
+
] });
|
|
208
|
+
return /* @__PURE__ */ m(n, {
|
|
209
|
+
className: L,
|
|
210
|
+
styles: [ie, r === "compact" && ae],
|
|
211
|
+
sx: le,
|
|
212
|
+
children: (t) => /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
|
|
213
|
+
...fe,
|
|
214
|
+
ref: e,
|
|
215
|
+
className: t,
|
|
216
|
+
"data-ui": "countdown",
|
|
217
|
+
"data-state": J,
|
|
218
|
+
"data-variant": r,
|
|
219
|
+
role: "timer",
|
|
220
|
+
"aria-live": "off",
|
|
221
|
+
"aria-label": de ?? (!S(s) && !R ? "Time remaining" : void 0),
|
|
222
|
+
"aria-labelledby": [R, S(s) && z].filter(Boolean).join(" ") || void 0,
|
|
223
|
+
"aria-describedby": [ue, Q !== void 0 && B].filter(Boolean).join(" ") || void 0,
|
|
224
|
+
children: [
|
|
225
|
+
S(s) && /* @__PURE__ */ m("span", {
|
|
226
|
+
id: z,
|
|
227
|
+
"data-ui": "countdown-label",
|
|
228
|
+
className: I?.label?.className,
|
|
229
|
+
css: [E, I?.label?.css],
|
|
230
|
+
children: s
|
|
231
|
+
}),
|
|
232
|
+
J === "running" && /* @__PURE__ */ m("div", {
|
|
233
|
+
"data-ui": "countdown-content",
|
|
234
|
+
"aria-hidden": "true",
|
|
235
|
+
className: I?.content?.className,
|
|
236
|
+
css: [D, I?.content?.css],
|
|
237
|
+
children: C(Y, U).map(({ unit: e, value: t }) => {
|
|
238
|
+
let n = new Intl.NumberFormat(f, {
|
|
239
|
+
style: "unit",
|
|
240
|
+
unit: b[e],
|
|
241
|
+
unitDisplay: g,
|
|
242
|
+
minimumIntegerDigits: 2,
|
|
243
|
+
useGrouping: !1
|
|
244
|
+
}), i = n.resolvedOptions();
|
|
245
|
+
return /* @__PURE__ */ m("bdi", {
|
|
246
|
+
"data-ui": "countdown-unit",
|
|
247
|
+
className: I?.unit?.className,
|
|
248
|
+
css: [oe, I?.unit?.css],
|
|
249
|
+
children: n.formatToParts(t).map((e, t) => e.type === "integer" ? /* @__PURE__ */ m(ce, {
|
|
250
|
+
value: e.value,
|
|
251
|
+
variant: r,
|
|
252
|
+
slot: I?.number
|
|
253
|
+
}, t) : /* @__PURE__ */ m("span", { children: e.value }, t))
|
|
254
|
+
}, `${e}-${i.locale}-${i.numberingSystem}`);
|
|
255
|
+
})
|
|
256
|
+
}),
|
|
257
|
+
J === "complete" && !Z && (S(y) || S(F)) && /* @__PURE__ */ m("span", {
|
|
258
|
+
"data-ui": "countdown-complete",
|
|
259
|
+
className: I?.complete?.className,
|
|
260
|
+
css: [M, I?.complete?.css],
|
|
261
|
+
children: $
|
|
262
|
+
}),
|
|
263
|
+
J === "pending" && S(T) && /* @__PURE__ */ m("span", {
|
|
264
|
+
"data-ui": "countdown-pending",
|
|
265
|
+
children: T
|
|
266
|
+
}),
|
|
267
|
+
J === "invalid" && S(O) && /* @__PURE__ */ m("span", {
|
|
268
|
+
"data-ui": "countdown-invalid",
|
|
269
|
+
"aria-hidden": !ge || void 0,
|
|
270
|
+
children: O
|
|
271
|
+
}),
|
|
272
|
+
Q !== void 0 && /* @__PURE__ */ m("span", {
|
|
273
|
+
id: B,
|
|
274
|
+
"data-ui": "countdown-description",
|
|
275
|
+
className: I?.description?.className,
|
|
276
|
+
css: [o, I?.description?.css],
|
|
277
|
+
children: Q
|
|
278
|
+
})
|
|
279
|
+
]
|
|
280
|
+
}), P && /* @__PURE__ */ m("span", {
|
|
281
|
+
role: "status",
|
|
282
|
+
"aria-live": "polite",
|
|
283
|
+
"aria-atomic": "true",
|
|
284
|
+
"data-ui": "countdown-announcement",
|
|
285
|
+
className: I?.complete?.className,
|
|
286
|
+
css: Z ? [M, I?.complete?.css] : o,
|
|
287
|
+
children: Z ? $ : null
|
|
288
|
+
})] })
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
N.displayName = "Countdown";
|
|
292
|
+
//#endregion
|
|
293
|
+
export { N as t };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./use-controlled-state-DpeVQZNR.js";
|
|
4
|
+
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
+
import { n as i } from "./surface-DZ4d-2aL.js";
|
|
6
|
+
import { t as a } from "./overlay-layer-qEbpEtb8.js";
|
|
7
|
+
import { t as o } from "./calendar-BzJdv_SZ.js";
|
|
8
|
+
import { t as s } from "./overlay-portal-C4JZFq2M.js";
|
|
9
|
+
import { t as c } from "./use-overlay-floating-Bx2jBKAA.js";
|
|
10
|
+
import { t as l } from "./text-field-hU72iSVS.js";
|
|
11
|
+
import { createContext as u, useContext as d, useEffect as f, useId as p, useLayoutEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
|
|
12
|
+
import { vars as v } from "@jfrader/tokens/vars";
|
|
13
|
+
import { jsx as y, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
14
|
+
import { FloatingFocusManager as x, useClick as S, useDismiss as C, useInteractions as w, useMergeRefs as T, useRole as E } from "@floating-ui/react";
|
|
15
|
+
//#region src/components/date-picker/date-picker.tsx
|
|
16
|
+
var D = "bottom-start", O = /* @__PURE__ */ new Set(["Enter", "ArrowDown"]), k = " ", A = "[data-ui=\"calendar-day\"][tabindex=\"0\"]", j = "[data-ui=\"calendar-day\"]", M = /^\d{4}-\d{2}-\d{2}$/, N = {
|
|
17
|
+
calendar: "gregory",
|
|
18
|
+
timeZone: "UTC",
|
|
19
|
+
dateStyle: "medium"
|
|
20
|
+
}, P = u(null);
|
|
21
|
+
function F(e) {
|
|
22
|
+
let t = d(P);
|
|
23
|
+
if (!t) throw Error(`DatePicker.${e} must be rendered inside <DatePicker>.`);
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
var I = (e, t) => String(e).padStart(t, "0"), L = (e, t, n) => `${I(e, 4)}-${I(t, 2)}-${I(n, 2)}`;
|
|
27
|
+
function R(e) {
|
|
28
|
+
if (e === void 0 || !M.test(e)) return;
|
|
29
|
+
let [t = NaN, n = NaN, r = NaN] = e.split("-").map(Number), i = new Date(Date.UTC(0, 0, 1));
|
|
30
|
+
return i.setUTCFullYear(t, n - 1, r), L(i.getUTCFullYear(), i.getUTCMonth() + 1, i.getUTCDate()) === e ? i : void 0;
|
|
31
|
+
}
|
|
32
|
+
var z = (e) => R(e) ? e : void 0;
|
|
33
|
+
function ee(e, t, n) {
|
|
34
|
+
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
35
|
+
}
|
|
36
|
+
function te() {
|
|
37
|
+
let e = /* @__PURE__ */ new Date();
|
|
38
|
+
return L(e.getFullYear(), e.getMonth() + 1, e.getDate());
|
|
39
|
+
}
|
|
40
|
+
var ne = () => typeof navigator > "u" ? void 0 : navigator.language;
|
|
41
|
+
function re(e, t) {
|
|
42
|
+
let n = new Intl.DisplayNames(t, { type: "dateTimeField" });
|
|
43
|
+
return e.formatToParts(/* @__PURE__ */ new Date(0)).map((e) => e.type === "literal" ? e.value : n.of(e.type) ?? e.value).join("");
|
|
44
|
+
}
|
|
45
|
+
function B(e) {
|
|
46
|
+
let t = e?.querySelector(A) ?? null;
|
|
47
|
+
return t?.focus({ preventScroll: !0 }), t;
|
|
48
|
+
}
|
|
49
|
+
var V = e({
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
"&:disabled": { cursor: "not-allowed" }
|
|
52
|
+
}), H = e({
|
|
53
|
+
...i,
|
|
54
|
+
borderRadius: v.radius.md,
|
|
55
|
+
boxShadow: v.shadow.overlay,
|
|
56
|
+
padding: v.space[3]
|
|
57
|
+
});
|
|
58
|
+
function U({ value: e, defaultValue: t, onValueChange: r, open: i, defaultOpen: a = !1, onOpenChange: o, min: s, max: l, locale: u, firstDayOfWeek: d, disabled: p = !1, name: m, placeholder: v, children: x }) {
|
|
59
|
+
let [T, O] = n(e, t, r), [k = !1, A] = n(i, a, o), [j, M] = _(!1), F = p || j, I = k && !F, [L, B] = _(null), V = g(null), H = g(!1), U = h(() => new Intl.DateTimeFormat(u ?? ne()).resolvedOptions().locale, [u]), W = h(() => new Intl.DateTimeFormat(U, N), [U]), G = h(() => re(W, U), [W, U]), K = R(T), q = K ? W.format(K) : "", J = z(s), Y = z(l), X = ee(z(T) ?? te(), J, Y).slice(0, 7), { refs: Z, floatingStyles: Q, context: $ } = c({
|
|
60
|
+
open: I,
|
|
61
|
+
placement: D,
|
|
62
|
+
onOpenChange: (e, t, n) => {
|
|
63
|
+
F && e || (e || (H.current = n === "escape-key"), A(e));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
f(() => {
|
|
67
|
+
F && (H.current = !1, k && A(!1));
|
|
68
|
+
}, [
|
|
69
|
+
F,
|
|
70
|
+
k,
|
|
71
|
+
A
|
|
72
|
+
]), f(() => {
|
|
73
|
+
!F && !I && H.current && (H.current = !1, Z.domReference.current?.focus());
|
|
74
|
+
}, [
|
|
75
|
+
F,
|
|
76
|
+
I,
|
|
77
|
+
Z
|
|
78
|
+
]);
|
|
79
|
+
let ie = S($, {
|
|
80
|
+
enabled: !F,
|
|
81
|
+
keyboardHandlers: !1
|
|
82
|
+
}), ae = C($, {
|
|
83
|
+
escapeKey: !0,
|
|
84
|
+
outsidePress: !0
|
|
85
|
+
}), oe = E($, { role: "dialog" }), { getReferenceProps: se, getFloatingProps: ce } = w([
|
|
86
|
+
ie,
|
|
87
|
+
ae,
|
|
88
|
+
oe
|
|
89
|
+
]), le = h(() => ({
|
|
90
|
+
open: I,
|
|
91
|
+
disabled: F,
|
|
92
|
+
value: T,
|
|
93
|
+
displayValue: q,
|
|
94
|
+
placeholder: v ?? G,
|
|
95
|
+
initialMonth: X,
|
|
96
|
+
min: J,
|
|
97
|
+
max: Y,
|
|
98
|
+
locale: U,
|
|
99
|
+
firstDayOfWeek: d,
|
|
100
|
+
inputLabelling: L,
|
|
101
|
+
gridRef: V,
|
|
102
|
+
refs: Z,
|
|
103
|
+
floatingContext: $,
|
|
104
|
+
floatingStyles: Q,
|
|
105
|
+
getReferenceProps: se,
|
|
106
|
+
getFloatingProps: ce,
|
|
107
|
+
requestOpenChange: (e) => {
|
|
108
|
+
F && e || A(e);
|
|
109
|
+
},
|
|
110
|
+
selectDate: (e) => {
|
|
111
|
+
F || (O(e), H.current = !0, A(!1));
|
|
112
|
+
},
|
|
113
|
+
setInputLabelling: B,
|
|
114
|
+
setInputDisabled: M
|
|
115
|
+
}), [
|
|
116
|
+
I,
|
|
117
|
+
F,
|
|
118
|
+
T,
|
|
119
|
+
q,
|
|
120
|
+
v,
|
|
121
|
+
G,
|
|
122
|
+
X,
|
|
123
|
+
J,
|
|
124
|
+
Y,
|
|
125
|
+
U,
|
|
126
|
+
d,
|
|
127
|
+
L,
|
|
128
|
+
Z,
|
|
129
|
+
$,
|
|
130
|
+
Q,
|
|
131
|
+
se,
|
|
132
|
+
ce,
|
|
133
|
+
A,
|
|
134
|
+
O
|
|
135
|
+
]);
|
|
136
|
+
return /* @__PURE__ */ b(P.Provider, {
|
|
137
|
+
value: le,
|
|
138
|
+
children: [x, m !== void 0 && /* @__PURE__ */ y("input", {
|
|
139
|
+
type: "hidden",
|
|
140
|
+
name: m,
|
|
141
|
+
value: T ?? "",
|
|
142
|
+
disabled: F
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function W(e) {
|
|
147
|
+
return /* @__PURE__ */ y(a, { children: /* @__PURE__ */ y(U, { ...e }) });
|
|
148
|
+
}
|
|
149
|
+
W.displayName = "DatePicker";
|
|
150
|
+
function G({ ref: e, label: t, id: n, disabled: i, slotProps: a, onKeyDown: o, onKeyUp: s, ...c }) {
|
|
151
|
+
let { open: u, disabled: d, displayValue: f, placeholder: h, gridRef: g, refs: _, getReferenceProps: v, requestOpenChange: b, setInputLabelling: x, setInputDisabled: S } = F("Input"), C = T([_.setReference, e]), w = p(), E = n ?? w, D = `${E}-label`, A = r(t), j = c["aria-labelledby"], M = c["aria-label"], N = M ?? (typeof t == "string" ? t : void 0), P = d || i === !0;
|
|
152
|
+
m(() => (S(i === !0), () => S(!1)), [i, S]), m(() => (x(j === void 0 ? M === void 0 ? typeof t == "string" ? { label: t } : { labelledBy: A ? D : void 0 } : { label: M } : { labelledBy: j }), () => x(null)), [
|
|
153
|
+
j,
|
|
154
|
+
M,
|
|
155
|
+
t,
|
|
156
|
+
A,
|
|
157
|
+
D,
|
|
158
|
+
x
|
|
159
|
+
]);
|
|
160
|
+
let I = () => {
|
|
161
|
+
P || (u ? B(g.current) : b(!0));
|
|
162
|
+
}, L = (e) => {
|
|
163
|
+
o?.(e), !(e.defaultPrevented || P) && (e.key === k ? e.preventDefault() : O.has(e.key) && (e.preventDefault(), I()));
|
|
164
|
+
}, R = (e) => {
|
|
165
|
+
s?.(e), !(e.defaultPrevented || P || e.key !== k) && I();
|
|
166
|
+
};
|
|
167
|
+
return /* @__PURE__ */ y(l, {
|
|
168
|
+
...v({
|
|
169
|
+
...c,
|
|
170
|
+
onKeyDown: L,
|
|
171
|
+
onKeyUp: R
|
|
172
|
+
}),
|
|
173
|
+
ref: C,
|
|
174
|
+
id: E,
|
|
175
|
+
label: A ? /* @__PURE__ */ y("span", {
|
|
176
|
+
id: D,
|
|
177
|
+
children: t
|
|
178
|
+
}) : t,
|
|
179
|
+
slotProps: {
|
|
180
|
+
...a,
|
|
181
|
+
control: {
|
|
182
|
+
...a?.control,
|
|
183
|
+
css: [V, a?.control?.css]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
value: f,
|
|
187
|
+
placeholder: h,
|
|
188
|
+
disabled: P,
|
|
189
|
+
readOnly: !0,
|
|
190
|
+
role: "combobox",
|
|
191
|
+
"aria-label": N,
|
|
192
|
+
"aria-autocomplete": "none",
|
|
193
|
+
"data-state": u ? "open" : "closed",
|
|
194
|
+
"data-ui": "date-picker-input"
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
G.displayName = "DatePicker.Input";
|
|
198
|
+
function K({ ref: e, style: n, className: r, sx: i, ...a }) {
|
|
199
|
+
let { open: c, value: l, initialMonth: u, min: d, max: f, locale: p, firstDayOfWeek: m, inputLabelling: h, gridRef: _, refs: v, floatingContext: S, floatingStyles: C, getFloatingProps: w, selectDate: E } = F("Popup"), D = T([v.setFloating, e]), O = g(null), k = T([(e) => {
|
|
200
|
+
_.current = e, O.current = B(e);
|
|
201
|
+
}]);
|
|
202
|
+
if (!c) return null;
|
|
203
|
+
let A = a["aria-labelledby"] !== void 0 || a["aria-label"] !== void 0 ? {} : h?.labelledBy === void 0 ? { "aria-label": h?.label } : { "aria-labelledby": h.labelledBy }, M = (e) => {
|
|
204
|
+
let t = e.target.closest(j);
|
|
205
|
+
if (t?.disabled) return;
|
|
206
|
+
let n = t?.dataset.date;
|
|
207
|
+
n !== void 0 && E(n);
|
|
208
|
+
}, N = (e) => {
|
|
209
|
+
e.target.closest(j)?.disabled && e.preventDefault();
|
|
210
|
+
};
|
|
211
|
+
return /* @__PURE__ */ y(s, { children: /* @__PURE__ */ y(x, {
|
|
212
|
+
context: S,
|
|
213
|
+
modal: !1,
|
|
214
|
+
initialFocus: O,
|
|
215
|
+
returnFocus: !1,
|
|
216
|
+
children: /* @__PURE__ */ y(t, {
|
|
217
|
+
className: r,
|
|
218
|
+
styles: H,
|
|
219
|
+
sx: i,
|
|
220
|
+
children: (e) => /* @__PURE__ */ y("div", {
|
|
221
|
+
...w({
|
|
222
|
+
...A,
|
|
223
|
+
...a
|
|
224
|
+
}),
|
|
225
|
+
ref: D,
|
|
226
|
+
"data-ui": "date-picker-popup",
|
|
227
|
+
style: {
|
|
228
|
+
...n,
|
|
229
|
+
...C
|
|
230
|
+
},
|
|
231
|
+
className: e,
|
|
232
|
+
children: /* @__PURE__ */ b(o, {
|
|
233
|
+
value: l ?? "",
|
|
234
|
+
defaultVisibleMonth: u,
|
|
235
|
+
min: d,
|
|
236
|
+
max: f,
|
|
237
|
+
locale: p,
|
|
238
|
+
firstDayOfWeek: m,
|
|
239
|
+
children: [/* @__PURE__ */ y(o.Header, {}), /* @__PURE__ */ y(o.Grid, {
|
|
240
|
+
ref: k,
|
|
241
|
+
onClick: M,
|
|
242
|
+
onPointerDownCapture: N
|
|
243
|
+
})]
|
|
244
|
+
})
|
|
245
|
+
})
|
|
246
|
+
})
|
|
247
|
+
}) });
|
|
248
|
+
}
|
|
249
|
+
K.displayName = "DatePicker.Popup";
|
|
250
|
+
var q = Object.assign(W, {
|
|
251
|
+
Input: G,
|
|
252
|
+
Popup: K
|
|
253
|
+
});
|
|
254
|
+
//#endregion
|
|
255
|
+
export { q as t };
|
package/dist/date-picker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as DatePicker } from "./date-picker-
|
|
2
|
+
export { t as DatePicker } from "./date-picker-BiPN7yeK.js";
|