@jfrader/ui 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{accordion-Bd-j04hW.js → accordion-xCI_u0BV.js} +2 -2
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-B58xempt.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-group-DOQQuV51.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/bottom-sheet-DPJBFkie.js +673 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-Cfw_hgt2.js} +1 -1
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-C92uYFJW.js} +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-B3Svu0X2.js +447 -0
- package/dist/calendar.js +1 -1
- package/dist/carousel-IvPqN-oM.js +472 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-cFquiSdy.js} +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DTQd_M-G.js +289 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-ahnRi-g8.js +292 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-Bhzvu9ma.js +334 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BQ5LleGb.js +384 -0
- package/dist/command-palette.js +1 -1
- package/dist/copy-button-ByiA6D3R.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-5zKSSuFF.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-B5uFWsm-.js +562 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-ciiv9H2b.js} +19 -19
- package/dist/dialog.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-C-qJcZ14.js +340 -0
- package/dist/expandable-card.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-pR4v7owg.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-D5KEKTSe.js +312 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-B-nrCIy2.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-ciuhPtQZ.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +79 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-BcySQfjZ.js +798 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-BcQKX2EJ.js +599 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-xwOOUtWP.js +275 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card-Bh9K4fZs.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-Pce_IYnz.js +590 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-sP5fiuQS.js} +4 -4
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-SeUyyEPD.js +64 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-DmXZ8E85.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/popover-QHcEvf9c.js +119 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-CbOWBUdA.js} +4 -4
- package/dist/progress.js +1 -1
- package/dist/radio-cards-D2QZENI_.js +455 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-E6mMRgo7.js} +4 -4
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-BhjUVXZZ.js +519 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-IxF0IJXm.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-yO1K1nbi.js +326 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-n_H52W1Z.js +292 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-q2SAsrdD.js +640 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-t0B5cecO.js +477 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-tirqlLY2.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-Cb3EHs64.js +268 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-DiZC57-3.js +418 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/{switch-Dr-qjmT4.js → switch-qwv8jQnR.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{tabs-CK_g1RKa.js → tabs-CAVJndX1.js} +2 -2
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-C8TWG-tY.js} +6 -5
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-BrW0XcG_.js} +6 -5
- package/dist/textarea.js +1 -1
- package/dist/time-picker-Db8D49cP.js +305 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-k3nURuCP.js +618 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-BHxI32ZA.js +352 -0
- package/dist/toast-stack-DqrAzdg5.js +183 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-fcjzpifI.js} +4 -4
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-CkeiW9C1.js +113 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-C2liIxqy.js +360 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +23 -5
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider.d.ts +70 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +1 -1
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +40 -0
- package/dist/types/overlay/overlay-layer.d.ts +33 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -1
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-DvJifLpF.js +31 -0
- package/package.json +175 -3
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
|
@@ -1,394 +0,0 @@
|
|
|
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, t as i } from "./media-D_eA_I-e.js";
|
|
5
|
-
import { t as a } from "./use-controlled-state-CVXDa-qM.js";
|
|
6
|
-
import { createContext as o, useContext as s, useEffect as c, useId as l, useImperativeHandle as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
|
|
7
|
-
import { vars as h } from "@jfrader/tokens/vars";
|
|
8
|
-
import { jsx as g, jsxs as _ } from "@emotion/react/jsx-runtime";
|
|
9
|
-
//#region src/components/calendar/calendar.styles.ts
|
|
10
|
-
var v = e({
|
|
11
|
-
display: "inline-flex",
|
|
12
|
-
flexDirection: "column",
|
|
13
|
-
gap: h.space[2],
|
|
14
|
-
fontFamily: h.font.sans,
|
|
15
|
-
color: h.color.text
|
|
16
|
-
}), y = e({
|
|
17
|
-
display: "flex",
|
|
18
|
-
alignItems: "center",
|
|
19
|
-
gap: h.space[2]
|
|
20
|
-
}), b = e({
|
|
21
|
-
flex: 1,
|
|
22
|
-
textAlign: "center",
|
|
23
|
-
fontSize: h.textSize.sm,
|
|
24
|
-
fontWeight: h.fontWeight.semibold
|
|
25
|
-
}), x = {
|
|
26
|
-
transitionDuration: h.motion.duration.fast,
|
|
27
|
-
transitionTimingFunction: h.motion.easeStandard,
|
|
28
|
-
[r]: { transitionDuration: "0s" }
|
|
29
|
-
}, S = e({
|
|
30
|
-
appearance: "none",
|
|
31
|
-
display: "inline-flex",
|
|
32
|
-
alignItems: "center",
|
|
33
|
-
justifyContent: "center",
|
|
34
|
-
inlineSize: "32px",
|
|
35
|
-
blockSize: "32px",
|
|
36
|
-
padding: 0,
|
|
37
|
-
border: `1px solid ${h.color.borderControl}`,
|
|
38
|
-
borderRadius: h.radius.sm,
|
|
39
|
-
backgroundColor: "transparent",
|
|
40
|
-
font: "inherit",
|
|
41
|
-
fontSize: h.textSize.lg,
|
|
42
|
-
lineHeight: 1,
|
|
43
|
-
color: h.color.text,
|
|
44
|
-
cursor: "pointer",
|
|
45
|
-
transitionProperty: "background-color",
|
|
46
|
-
...x,
|
|
47
|
-
"&:hover:not([aria-disabled=\"true\"])": { backgroundColor: h.color.surfaceHover },
|
|
48
|
-
"&[aria-disabled=\"true\"]": {
|
|
49
|
-
opacity: .55,
|
|
50
|
-
cursor: "not-allowed"
|
|
51
|
-
},
|
|
52
|
-
"&:focus-visible": { ...n }
|
|
53
|
-
}), C = e({
|
|
54
|
-
display: "inline-block",
|
|
55
|
-
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
56
|
-
}), w = e({
|
|
57
|
-
borderCollapse: "separate",
|
|
58
|
-
borderSpacing: h.space[1],
|
|
59
|
-
marginInline: `calc(-1 * ${h.space[1]})`
|
|
60
|
-
}), T = e({
|
|
61
|
-
paddingBlock: h.space[1],
|
|
62
|
-
fontSize: h.textSize.xs,
|
|
63
|
-
fontWeight: h.fontWeight.medium,
|
|
64
|
-
color: h.color.textMuted,
|
|
65
|
-
textAlign: "center"
|
|
66
|
-
}), E = e({ padding: 0 }), D = e({
|
|
67
|
-
appearance: "none",
|
|
68
|
-
display: "inline-flex",
|
|
69
|
-
alignItems: "center",
|
|
70
|
-
justifyContent: "center",
|
|
71
|
-
inlineSize: "36px",
|
|
72
|
-
blockSize: "36px",
|
|
73
|
-
padding: 0,
|
|
74
|
-
border: "1px solid transparent",
|
|
75
|
-
borderRadius: h.radius.sm,
|
|
76
|
-
backgroundColor: "transparent",
|
|
77
|
-
font: "inherit",
|
|
78
|
-
fontSize: h.textSize.sm,
|
|
79
|
-
fontVariantNumeric: "tabular-nums",
|
|
80
|
-
color: h.color.text,
|
|
81
|
-
cursor: "pointer",
|
|
82
|
-
transitionProperty: "background-color, border-color, color",
|
|
83
|
-
...x,
|
|
84
|
-
"&:hover:not(:disabled):not([data-selected])": { backgroundColor: h.color.surfaceHover },
|
|
85
|
-
"&[data-today]": {
|
|
86
|
-
borderColor: h.color.borderControl,
|
|
87
|
-
fontWeight: h.fontWeight.semibold
|
|
88
|
-
},
|
|
89
|
-
"&[data-selected]": {
|
|
90
|
-
backgroundColor: h.color.accent,
|
|
91
|
-
borderColor: h.color.accent,
|
|
92
|
-
color: h.color.accentContrast,
|
|
93
|
-
fontWeight: h.fontWeight.semibold
|
|
94
|
-
},
|
|
95
|
-
"&[data-selected]:hover": { backgroundColor: h.color.accentHover },
|
|
96
|
-
"&:disabled": {
|
|
97
|
-
opacity: .55,
|
|
98
|
-
cursor: "not-allowed",
|
|
99
|
-
textDecoration: "line-through"
|
|
100
|
-
},
|
|
101
|
-
"&:focus-visible": { ...n },
|
|
102
|
-
[i]: { "&[data-selected]": {
|
|
103
|
-
forcedColorAdjust: "none",
|
|
104
|
-
backgroundColor: "Highlight",
|
|
105
|
-
borderColor: "Highlight",
|
|
106
|
-
color: "HighlightText"
|
|
107
|
-
} }
|
|
108
|
-
}), O = /^\d{4}-\d{2}-\d{2}$/, k = /^\d{4}-\d{2}$/, A = 12, j = 0, M = "2026-01-04", N = (e, t) => String(e).padStart(t, "0");
|
|
109
|
-
function P(e, t, n) {
|
|
110
|
-
let r = new Date(Date.UTC(0, 0, 1));
|
|
111
|
-
return r.setUTCFullYear(e, t, n), r;
|
|
112
|
-
}
|
|
113
|
-
function F(e) {
|
|
114
|
-
let [t = NaN, n = NaN, r = 1] = e.split("-").map(Number);
|
|
115
|
-
return P(t, n - 1, r);
|
|
116
|
-
}
|
|
117
|
-
var I = (e) => `${N(e.getUTCFullYear(), 4)}-${N(e.getUTCMonth() + 1, 2)}-${N(e.getUTCDate(), 2)}`, L = (e) => e !== void 0 && O.test(e) && I(F(e)) === e, R = (e) => e !== void 0 && k.test(e) && L(`${e}-01`), z = (e) => e.slice(0, 7), B = (e) => `${e}-01`;
|
|
118
|
-
function V(e, t) {
|
|
119
|
-
let n = F(e);
|
|
120
|
-
return I(P(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + t));
|
|
121
|
-
}
|
|
122
|
-
function H(e, t) {
|
|
123
|
-
let n = F(e), r = P(n.getUTCFullYear(), n.getUTCMonth() + t, 1), i = P(r.getUTCFullYear(), r.getUTCMonth() + 1, 0).getUTCDate();
|
|
124
|
-
return I(P(r.getUTCFullYear(), r.getUTCMonth(), Math.min(n.getUTCDate(), i)));
|
|
125
|
-
}
|
|
126
|
-
var U = (e, t) => z(H(B(e), t)), W = (e) => V(B(U(e, 1)), -1), G = (e, t, n) => (t === void 0 || e >= t) && (n === void 0 || e <= n);
|
|
127
|
-
function ee(e, t, n) {
|
|
128
|
-
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
129
|
-
}
|
|
130
|
-
var K = (e, t) => (F(e).getUTCDay() - t + 7) % 7;
|
|
131
|
-
function q(e) {
|
|
132
|
-
let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
|
|
133
|
-
return n ? n.firstDay % 7 : j;
|
|
134
|
-
}
|
|
135
|
-
var J = {
|
|
136
|
-
calendar: "gregory",
|
|
137
|
-
timeZone: "UTC"
|
|
138
|
-
};
|
|
139
|
-
function te(e) {
|
|
140
|
-
return {
|
|
141
|
-
month: new Intl.DateTimeFormat(e, {
|
|
142
|
-
...J,
|
|
143
|
-
month: "long",
|
|
144
|
-
year: "numeric"
|
|
145
|
-
}),
|
|
146
|
-
day: new Intl.DateTimeFormat(e, {
|
|
147
|
-
...J,
|
|
148
|
-
day: "numeric"
|
|
149
|
-
}),
|
|
150
|
-
date: new Intl.DateTimeFormat(e, {
|
|
151
|
-
...J,
|
|
152
|
-
dateStyle: "long"
|
|
153
|
-
}),
|
|
154
|
-
weekdayShort: new Intl.DateTimeFormat(e, {
|
|
155
|
-
...J,
|
|
156
|
-
weekday: "short"
|
|
157
|
-
}),
|
|
158
|
-
weekdayLong: new Intl.DateTimeFormat(e, {
|
|
159
|
-
...J,
|
|
160
|
-
weekday: "long"
|
|
161
|
-
})
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
var ne = () => typeof navigator > "u" ? void 0 : navigator.language, Y = (e) => (t) => V(t, e), X = (e) => (t, { shiftKey: n }) => H(t, n ? e * A : e), Z = {
|
|
165
|
-
ArrowDown: Y(7),
|
|
166
|
-
ArrowUp: Y(-7),
|
|
167
|
-
Home: (e, { firstDayOfWeek: t }) => V(e, -K(e, t)),
|
|
168
|
-
End: (e, { firstDayOfWeek: t }) => V(e, 6 - K(e, t)),
|
|
169
|
-
PageUp: X(-1),
|
|
170
|
-
PageDown: X(1)
|
|
171
|
-
}, re = {
|
|
172
|
-
ltr: {
|
|
173
|
-
...Z,
|
|
174
|
-
ArrowRight: Y(1),
|
|
175
|
-
ArrowLeft: Y(-1)
|
|
176
|
-
},
|
|
177
|
-
rtl: {
|
|
178
|
-
...Z,
|
|
179
|
-
ArrowRight: Y(-1),
|
|
180
|
-
ArrowLeft: Y(1)
|
|
181
|
-
}
|
|
182
|
-
}, Q = o(null);
|
|
183
|
-
function $(e) {
|
|
184
|
-
let t = s(Q);
|
|
185
|
-
if (!t) throw Error(`Calendar.${e} must be rendered inside <Calendar>.`);
|
|
186
|
-
return t;
|
|
187
|
-
}
|
|
188
|
-
var ie = "‹", ae = "›";
|
|
189
|
-
function oe({ ref: e, value: n, defaultValue: r, onValueChange: i, visibleMonth: o, defaultVisibleMonth: s, onVisibleMonthChange: c, min: u, max: d, locale: p, firstDayOfWeek: h, className: _, sx: y, ...b }) {
|
|
190
|
-
let x = `${l()}-label`, S = /* @__PURE__ */ new Date(), C = I(P(S.getFullYear(), S.getMonth(), S.getDate())), w = f(() => new Intl.DateTimeFormat(p ?? ne(), J).resolvedOptions().locale, [p]), T = f(() => te(w), [w]), E = f(() => q(w), [w]), D = h ?? E, [O, k] = a(n, r, i), A = n ?? r, [j, M] = a(o, s ?? z(L(A) ? A : C), c), N = R(j) ? j : z(C), F = L(u) ? u : void 0, B = L(d) ? d : void 0, [V, H] = m(null), [U, W] = m(!1), G = f(() => ({
|
|
191
|
-
value: O,
|
|
192
|
-
visibleMonth: N,
|
|
193
|
-
today: C,
|
|
194
|
-
min: F,
|
|
195
|
-
max: B,
|
|
196
|
-
firstDayOfWeek: D,
|
|
197
|
-
formatters: T,
|
|
198
|
-
focus: V,
|
|
199
|
-
setFocus: H,
|
|
200
|
-
requestValue: k,
|
|
201
|
-
requestVisibleMonth: M,
|
|
202
|
-
labelId: x,
|
|
203
|
-
hasHeader: U,
|
|
204
|
-
setHasHeader: W
|
|
205
|
-
}), [
|
|
206
|
-
O,
|
|
207
|
-
N,
|
|
208
|
-
C,
|
|
209
|
-
F,
|
|
210
|
-
B,
|
|
211
|
-
D,
|
|
212
|
-
T,
|
|
213
|
-
V,
|
|
214
|
-
k,
|
|
215
|
-
M,
|
|
216
|
-
x,
|
|
217
|
-
U
|
|
218
|
-
]);
|
|
219
|
-
return /* @__PURE__ */ g(Q.Provider, {
|
|
220
|
-
value: G,
|
|
221
|
-
children: /* @__PURE__ */ g(t, {
|
|
222
|
-
className: _,
|
|
223
|
-
styles: v,
|
|
224
|
-
sx: y,
|
|
225
|
-
children: (t) => /* @__PURE__ */ g("div", {
|
|
226
|
-
...b,
|
|
227
|
-
ref: e,
|
|
228
|
-
"data-ui": "calendar",
|
|
229
|
-
className: t
|
|
230
|
-
})
|
|
231
|
-
})
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
oe.displayName = "Calendar";
|
|
235
|
-
function se({ ref: e, className: n, sx: r, ...i }) {
|
|
236
|
-
let { visibleMonth: a, min: o, max: s, formatters: c, requestVisibleMonth: l, labelId: u, setHasHeader: f } = $("Header");
|
|
237
|
-
d(() => (f(!0), () => f(!1)), [f]);
|
|
238
|
-
let p = U(a, -1), m = U(a, 1), h = o !== void 0 && W(p) < o, v = s !== void 0 && B(m) > s, x = (e) => c.month.format(F(B(e)));
|
|
239
|
-
return /* @__PURE__ */ g(t, {
|
|
240
|
-
className: n,
|
|
241
|
-
styles: y,
|
|
242
|
-
sx: r,
|
|
243
|
-
children: (t) => /* @__PURE__ */ _("div", {
|
|
244
|
-
...i,
|
|
245
|
-
ref: e,
|
|
246
|
-
"data-ui": "calendar-header",
|
|
247
|
-
className: t,
|
|
248
|
-
children: [
|
|
249
|
-
/* @__PURE__ */ g("button", {
|
|
250
|
-
type: "button",
|
|
251
|
-
"data-ui": "calendar-previous",
|
|
252
|
-
"aria-label": x(p),
|
|
253
|
-
"aria-disabled": h || void 0,
|
|
254
|
-
onClick: () => {
|
|
255
|
-
h || l(p);
|
|
256
|
-
},
|
|
257
|
-
css: S,
|
|
258
|
-
children: /* @__PURE__ */ g("span", {
|
|
259
|
-
"aria-hidden": "true",
|
|
260
|
-
css: C,
|
|
261
|
-
children: ie
|
|
262
|
-
})
|
|
263
|
-
}),
|
|
264
|
-
/* @__PURE__ */ g("span", {
|
|
265
|
-
id: u,
|
|
266
|
-
"aria-live": "polite",
|
|
267
|
-
"aria-atomic": "true",
|
|
268
|
-
"data-ui": "calendar-label",
|
|
269
|
-
css: b,
|
|
270
|
-
children: x(a)
|
|
271
|
-
}),
|
|
272
|
-
/* @__PURE__ */ g("button", {
|
|
273
|
-
type: "button",
|
|
274
|
-
"data-ui": "calendar-next",
|
|
275
|
-
"aria-label": x(m),
|
|
276
|
-
"aria-disabled": v || void 0,
|
|
277
|
-
onClick: () => {
|
|
278
|
-
v || l(m);
|
|
279
|
-
},
|
|
280
|
-
css: S,
|
|
281
|
-
children: /* @__PURE__ */ g("span", {
|
|
282
|
-
"aria-hidden": "true",
|
|
283
|
-
css: C,
|
|
284
|
-
children: ae
|
|
285
|
-
})
|
|
286
|
-
})
|
|
287
|
-
]
|
|
288
|
-
})
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
se.displayName = "Calendar.Header";
|
|
292
|
-
function ce({ date: e, isTabStop: t }) {
|
|
293
|
-
let { value: n, today: r, min: i, max: a, formatters: o, setFocus: s, requestValue: c } = $("Grid"), l = n === e, u = r === e, d = F(e);
|
|
294
|
-
return /* @__PURE__ */ g("td", {
|
|
295
|
-
role: "gridcell",
|
|
296
|
-
"aria-selected": l || void 0,
|
|
297
|
-
css: E,
|
|
298
|
-
children: /* @__PURE__ */ g("button", {
|
|
299
|
-
type: "button",
|
|
300
|
-
"data-ui": "calendar-day",
|
|
301
|
-
"data-date": e,
|
|
302
|
-
"data-today": u || void 0,
|
|
303
|
-
"data-selected": l || void 0,
|
|
304
|
-
"aria-current": u ? "date" : void 0,
|
|
305
|
-
"aria-label": o.date.format(d),
|
|
306
|
-
tabIndex: t ? 0 : -1,
|
|
307
|
-
disabled: !G(e, i, a),
|
|
308
|
-
onFocus: () => s({
|
|
309
|
-
date: e,
|
|
310
|
-
fallback: e
|
|
311
|
-
}),
|
|
312
|
-
onClick: () => {
|
|
313
|
-
s({
|
|
314
|
-
date: e,
|
|
315
|
-
fallback: e
|
|
316
|
-
}), c(e);
|
|
317
|
-
},
|
|
318
|
-
css: D,
|
|
319
|
-
children: o.day.format(d)
|
|
320
|
-
})
|
|
321
|
-
});
|
|
322
|
-
}
|
|
323
|
-
function le({ ref: e, onKeyDown: n, "aria-labelledby": r, "aria-label": i, className: a, sx: o, ...s }) {
|
|
324
|
-
let { value: l, visibleMonth: d, today: f, min: m, max: h, firstDayOfWeek: v, formatters: y, focus: b, setFocus: x, requestVisibleMonth: S, labelId: C, hasHeader: D } = $("Grid"), O = p(null);
|
|
325
|
-
u(e, () => O.current, []);
|
|
326
|
-
let k = p(!1), A = B(d), j = F(W(d)).getUTCDate(), N = Array.from({ length: j }, (e, t) => V(A, t)), P = (e) => e !== void 0 && N.includes(e) && G(e, m, h), I = [
|
|
327
|
-
b?.date,
|
|
328
|
-
b?.fallback,
|
|
329
|
-
l,
|
|
330
|
-
f
|
|
331
|
-
].find(P) ?? N.find((e) => G(e, m, h)), L = [...Array(K(A, v)).fill(null), ...N], R = Array.from({ length: Math.ceil(L.length / 7) }, (e, t) => Array.from({ length: 7 }, (e, n) => L[t * 7 + n] ?? null)), H = Array.from({ length: 7 }, (e, t) => F(V(M, (v + t) % 7)));
|
|
332
|
-
c(() => {
|
|
333
|
-
k.current && (k.current = !1, O.current?.querySelector(`[data-date="${I}"]`)?.focus());
|
|
334
|
-
});
|
|
335
|
-
let U = (e) => {
|
|
336
|
-
n?.(e);
|
|
337
|
-
let t = O.current;
|
|
338
|
-
if (e.defaultPrevented || !t) return;
|
|
339
|
-
let r = e.target.dataset.date;
|
|
340
|
-
if (!P(r)) return;
|
|
341
|
-
let i = re[getComputedStyle(t).direction === "rtl" ? "rtl" : "ltr"][e.key];
|
|
342
|
-
if (!i) return;
|
|
343
|
-
e.preventDefault();
|
|
344
|
-
let a = ee(i(r, {
|
|
345
|
-
firstDayOfWeek: v,
|
|
346
|
-
shiftKey: e.shiftKey
|
|
347
|
-
}), m, h);
|
|
348
|
-
a !== r && (x({
|
|
349
|
-
date: a,
|
|
350
|
-
fallback: r
|
|
351
|
-
}), k.current = !0, z(a) !== d && S(z(a)));
|
|
352
|
-
}, q = [r, D ? C : void 0].filter(Boolean).join(" ") || void 0, J = y.month.format(F(A));
|
|
353
|
-
return /* @__PURE__ */ g(t, {
|
|
354
|
-
className: a,
|
|
355
|
-
styles: w,
|
|
356
|
-
sx: o,
|
|
357
|
-
children: (e) => /* @__PURE__ */ _("table", {
|
|
358
|
-
...s,
|
|
359
|
-
ref: O,
|
|
360
|
-
role: "grid",
|
|
361
|
-
"aria-labelledby": q,
|
|
362
|
-
"aria-label": q === void 0 ? i ?? J : i,
|
|
363
|
-
"data-ui": "calendar-grid",
|
|
364
|
-
onKeyDown: U,
|
|
365
|
-
className: e,
|
|
366
|
-
children: [/* @__PURE__ */ g("thead", { children: /* @__PURE__ */ g("tr", {
|
|
367
|
-
role: "row",
|
|
368
|
-
children: H.map((e) => /* @__PURE__ */ g("th", {
|
|
369
|
-
role: "columnheader",
|
|
370
|
-
scope: "col",
|
|
371
|
-
abbr: y.weekdayLong.format(e),
|
|
372
|
-
css: T,
|
|
373
|
-
children: y.weekdayShort.format(e)
|
|
374
|
-
}, e.getUTCDay()))
|
|
375
|
-
}) }), /* @__PURE__ */ g("tbody", { children: R.map((e, t) => /* @__PURE__ */ g("tr", {
|
|
376
|
-
role: "row",
|
|
377
|
-
children: e.map((e, t) => e === null ? /* @__PURE__ */ g("td", {
|
|
378
|
-
role: "gridcell",
|
|
379
|
-
css: E
|
|
380
|
-
}, `empty-${t}`) : /* @__PURE__ */ g(ce, {
|
|
381
|
-
date: e,
|
|
382
|
-
isTabStop: e === I
|
|
383
|
-
}, e))
|
|
384
|
-
}, t)) })]
|
|
385
|
-
})
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
le.displayName = "Calendar.Grid";
|
|
389
|
-
var ue = Object.assign(oe, {
|
|
390
|
-
Header: se,
|
|
391
|
-
Grid: le
|
|
392
|
-
});
|
|
393
|
-
//#endregion
|
|
394
|
-
export { ue as t };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { r as e } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { t } from "./part-id-D0zksy32.js";
|
|
4
|
-
import { useCallback as n, useLayoutEffect as r, useMemo as i, useState as a } from "react";
|
|
5
|
-
import { vars as o } from "@jfrader/tokens/vars";
|
|
6
|
-
import { useListItem as s } from "@floating-ui/react";
|
|
7
|
-
//#region src/styling/listbox-style.ts
|
|
8
|
-
var c = e({
|
|
9
|
-
boxSizing: "border-box",
|
|
10
|
-
display: "flex",
|
|
11
|
-
flexDirection: "column",
|
|
12
|
-
backgroundColor: o.color.surfaceRaised,
|
|
13
|
-
border: `1px solid ${o.color.border}`,
|
|
14
|
-
borderRadius: o.radius.md,
|
|
15
|
-
boxShadow: o.shadow.overlay,
|
|
16
|
-
padding: o.space[1],
|
|
17
|
-
minInlineSize: "180px",
|
|
18
|
-
maxInlineSize: "min(320px, calc(100vw - 32px))",
|
|
19
|
-
color: o.color.text,
|
|
20
|
-
fontFamily: o.font.sans,
|
|
21
|
-
lineHeight: o.lineHeight.base
|
|
22
|
-
}), l = e({
|
|
23
|
-
maxBlockSize: "280px",
|
|
24
|
-
overflow: "auto",
|
|
25
|
-
"&[hidden]": { display: "none" }
|
|
26
|
-
}), u = e({
|
|
27
|
-
boxSizing: "border-box",
|
|
28
|
-
display: "flex",
|
|
29
|
-
alignItems: "center",
|
|
30
|
-
inlineSize: "100%",
|
|
31
|
-
minBlockSize: "32px",
|
|
32
|
-
flexShrink: 0,
|
|
33
|
-
borderRadius: o.radius.sm,
|
|
34
|
-
paddingBlock: o.space[1],
|
|
35
|
-
paddingInline: o.space[2],
|
|
36
|
-
fontSize: o.textSize.sm,
|
|
37
|
-
color: o.color.text,
|
|
38
|
-
cursor: "pointer",
|
|
39
|
-
userSelect: "none",
|
|
40
|
-
transitionProperty: "background-color",
|
|
41
|
-
transitionDuration: o.motion.duration.fast,
|
|
42
|
-
transitionTimingFunction: o.motion.easeStandard,
|
|
43
|
-
"&[data-active]": {
|
|
44
|
-
outline: `2px solid ${o.color.focusRing}`,
|
|
45
|
-
outlineOffset: "-2px"
|
|
46
|
-
},
|
|
47
|
-
"@media (prefers-reduced-motion: reduce)": { transitionDuration: "0s" }
|
|
48
|
-
}), d = e({
|
|
49
|
-
"&:hover:not([aria-disabled=\"true\"]), &[data-active]:not([aria-disabled=\"true\"])": { backgroundColor: o.color.surfaceHover },
|
|
50
|
-
"&[aria-disabled=\"true\"]": {
|
|
51
|
-
opacity: .55,
|
|
52
|
-
cursor: "not-allowed"
|
|
53
|
-
}
|
|
54
|
-
}), f = e({
|
|
55
|
-
gap: o.space[2],
|
|
56
|
-
"&[aria-selected=\"true\"]": { fontWeight: o.fontWeight.medium }
|
|
57
|
-
}), p = e({
|
|
58
|
-
flex: 1,
|
|
59
|
-
minInlineSize: 0
|
|
60
|
-
}), m = e({ color: o.color.accentText }), h = (e, t) => e !== void 0 && Object.keys(t).every((n) => e[n] === t[n]), g = (e, n) => `${t(e, "opt", n)}-item`;
|
|
61
|
-
function _() {
|
|
62
|
-
let [e, t] = a(() => /* @__PURE__ */ new Map()), r = n((e, n) => t((t) => h(t.get(e), n) ? t : new Map(t).set(e, n)), []), o = n((e) => t((t) => {
|
|
63
|
-
if (!t.has(e)) return t;
|
|
64
|
-
let n = new Map(t);
|
|
65
|
-
return n.delete(e), n;
|
|
66
|
-
}), []);
|
|
67
|
-
return [e, i(() => ({
|
|
68
|
-
register: r,
|
|
69
|
-
unregister: o
|
|
70
|
-
}), [r, o])];
|
|
71
|
-
}
|
|
72
|
-
function v(e) {
|
|
73
|
-
return s(e);
|
|
74
|
-
}
|
|
75
|
-
function y(e, t, n) {
|
|
76
|
-
r(() => {
|
|
77
|
-
if (t && e !== -1) return n.add(e), () => {
|
|
78
|
-
n.delete(e);
|
|
79
|
-
};
|
|
80
|
-
}, [
|
|
81
|
-
t,
|
|
82
|
-
e,
|
|
83
|
-
n
|
|
84
|
-
]);
|
|
85
|
-
}
|
|
86
|
-
function b(e, t, n, i, a) {
|
|
87
|
-
let o = v(), { index: s } = o;
|
|
88
|
-
return r(() => {
|
|
89
|
-
let r = n.current?.textContent ?? "";
|
|
90
|
-
if (t.register(e, i(s, r)), a === void 0 || s === -1) return;
|
|
91
|
-
let { labelsRef: o, include: c } = a;
|
|
92
|
-
return o.current[s] = c ? r : null, () => {
|
|
93
|
-
o.current[s] = null;
|
|
94
|
-
};
|
|
95
|
-
}), r(() => () => t.unregister(e), [e, t]), o;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { _ as a, m as c, l as d, c as f, v as i, f as l, y as n, d as o, b as r, u as s, g as t, p as u };
|