@datum-cloud/datum-ui 0.8.0 → 0.9.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/dist/{adapter-context-NyGTDZYq.mjs → adapter-context-DemTWhel.mjs} +3 -3
- package/dist/alert/index.mjs +1 -1
- package/dist/{alert-BDj6od5I.mjs → alert-Cz56SqdN.mjs} +2 -2
- package/dist/app-navigation/index.mjs +2 -2
- package/dist/{app-navigation-rSOfo1KV.mjs → app-navigation-CnGkJvwF.mjs} +1 -1
- package/dist/autocomplete/index.mjs +1 -1
- package/dist/{autocomplete-DdbTQe6u.mjs → autocomplete-ChuPNldi.mjs} +6 -6
- package/dist/autosearch/index.mjs +12 -12
- package/dist/avatar-stack/index.mjs +1 -1
- package/dist/{avatar-stack-CDhlA1Nm.mjs → avatar-stack-WqoQ3l06.mjs} +1 -1
- package/dist/{button-D3RrsMfQ.mjs → button-Rw1xI-k9.mjs} +2 -2
- package/dist/calendar/index.mjs +1 -1
- package/dist/calendar-D_DriVHT.mjs +77 -0
- package/dist/{calendar-C-Hbf74r.mjs → calendar-Dwvq3Vu_.mjs} +6 -6
- package/dist/calendar-date-picker-CchHKodM.mjs +52 -0
- package/dist/chart/index.mjs +1 -1
- package/dist/{chart-CUa21ynK.mjs → chart-DgcOwkOh.mjs} +5 -5
- package/dist/code-editor/index.mjs +1 -1
- package/dist/{col-DISdGlqY.mjs → col-Q6yazFwL.mjs} +2 -1
- package/dist/components/base/button/button.d.ts.map +1 -1
- package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts +6 -5
- package/dist/components/features/calendar-date-picker/calendar-date-picker.d.ts.map +1 -1
- package/dist/components/features/calendar-date-picker/types.d.ts +19 -0
- package/dist/components/features/calendar-date-picker/types.d.ts.map +1 -1
- package/dist/components/features/code-editor/code-editor.d.ts +1 -1
- package/dist/components/features/code-editor/code-editor.d.ts.map +1 -1
- package/dist/components/features/code-editor/index.d.ts +1 -1
- package/dist/components/features/code-editor/index.d.ts.map +1 -1
- package/dist/components/features/code-editor/types.d.ts +25 -2
- package/dist/components/features/code-editor/types.d.ts.map +1 -1
- package/dist/components/features/data-table/core/client-provider.d.ts.map +1 -1
- package/dist/components/features/date-time-picker/date-time-picker.d.ts +12 -4
- package/dist/components/features/date-time-picker/date-time-picker.d.ts.map +1 -1
- package/dist/components/features/date-time-picker/types.d.ts +9 -0
- package/dist/components/features/date-time-picker/types.d.ts.map +1 -1
- package/dist/components/features/grid/components/col.d.ts +1 -1
- package/dist/components/features/grid/components/col.d.ts.map +1 -1
- package/dist/components/features/grid/components/row.d.ts +1 -1
- package/dist/components/features/grid/components/row.d.ts.map +1 -1
- package/dist/components/features/picker/components/calendar.d.ts +14 -0
- package/dist/components/features/picker/components/calendar.d.ts.map +1 -0
- package/dist/components/features/picker/components/content.d.ts +18 -0
- package/dist/components/features/picker/components/content.d.ts.map +1 -0
- package/dist/components/features/picker/components/context.d.ts +57 -0
- package/dist/components/features/picker/components/context.d.ts.map +1 -0
- package/dist/components/features/picker/components/footer.d.ts +35 -0
- package/dist/components/features/picker/components/footer.d.ts.map +1 -0
- package/dist/components/features/picker/components/index.d.ts +36 -0
- package/dist/components/features/picker/components/index.d.ts.map +1 -0
- package/dist/components/features/picker/components/presets.d.ts +9 -0
- package/dist/components/features/picker/components/presets.d.ts.map +1 -0
- package/dist/components/features/picker/components/root.d.ts +40 -0
- package/dist/components/features/picker/components/root.d.ts.map +1 -0
- package/dist/components/features/picker/components/time-input-field.d.ts +13 -0
- package/dist/components/features/picker/components/time-input-field.d.ts.map +1 -0
- package/dist/components/features/picker/components/time-input.d.ts +13 -0
- package/dist/components/features/picker/components/time-input.d.ts.map +1 -0
- package/dist/components/features/picker/components/timezone-indicator.d.ts +14 -0
- package/dist/components/features/picker/components/timezone-indicator.d.ts.map +1 -0
- package/dist/components/features/picker/components/timezone-select.d.ts +16 -0
- package/dist/components/features/picker/components/timezone-select.d.ts.map +1 -0
- package/dist/components/features/picker/components/trigger.d.ts +23 -0
- package/dist/components/features/picker/components/trigger.d.ts.map +1 -0
- package/dist/components/features/picker/hooks/index.d.ts +5 -0
- package/dist/components/features/picker/hooks/index.d.ts.map +1 -0
- package/dist/components/features/picker/hooks/use-keyboard-shortcuts.d.ts +25 -0
- package/dist/components/features/picker/hooks/use-keyboard-shortcuts.d.ts.map +1 -0
- package/dist/components/features/picker/hooks/use-picker-state.d.ts +51 -0
- package/dist/components/features/picker/hooks/use-picker-state.d.ts.map +1 -0
- package/dist/components/features/picker/hooks/use-presets.d.ts +24 -0
- package/dist/components/features/picker/hooks/use-presets.d.ts.map +1 -0
- package/dist/components/features/picker/hooks/use-time-slots.d.ts +21 -0
- package/dist/components/features/picker/hooks/use-time-slots.d.ts.map +1 -0
- package/dist/components/features/picker/index.d.ts +8 -0
- package/dist/components/features/picker/index.d.ts.map +1 -0
- package/dist/components/features/picker/internal/use-deprecation-warning.d.ts +9 -0
- package/dist/components/features/picker/internal/use-deprecation-warning.d.ts.map +1 -0
- package/dist/components/features/picker/presets/defaults.d.ts +16 -0
- package/dist/components/features/picker/presets/defaults.d.ts.map +1 -0
- package/dist/components/features/picker/presets/index.d.ts +2 -0
- package/dist/components/features/picker/presets/index.d.ts.map +1 -0
- package/dist/components/features/picker/types.d.ts +70 -0
- package/dist/components/features/picker/types.d.ts.map +1 -0
- package/dist/components/features/picker/utils/commit.d.ts +16 -0
- package/dist/components/features/picker/utils/commit.d.ts.map +1 -0
- package/dist/components/features/picker/utils/compare.d.ts +12 -0
- package/dist/components/features/picker/utils/compare.d.ts.map +1 -0
- package/dist/components/features/picker/utils/format-value.d.ts +25 -0
- package/dist/components/features/picker/utils/format-value.d.ts.map +1 -0
- package/dist/components/features/picker/utils/format.d.ts +38 -0
- package/dist/components/features/picker/utils/format.d.ts.map +1 -0
- package/dist/components/features/picker/utils/index.d.ts +7 -0
- package/dist/components/features/picker/utils/index.d.ts.map +1 -0
- package/dist/components/features/picker/utils/range.d.ts +26 -0
- package/dist/components/features/picker/utils/range.d.ts.map +1 -0
- package/dist/components/features/picker/utils/timezone.d.ts +38 -0
- package/dist/components/features/picker/utils/timezone.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/date-picker.d.ts +10 -0
- package/dist/components/features/picker/wrappers/date-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/date-range-picker.d.ts +16 -0
- package/dist/components/features/picker/wrappers/date-range-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/date-range-time-picker.d.ts +16 -0
- package/dist/components/features/picker/wrappers/date-range-time-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/date-time-picker.d.ts +20 -0
- package/dist/components/features/picker/wrappers/date-time-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/date-time-range-picker.d.ts +16 -0
- package/dist/components/features/picker/wrappers/date-time-range-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/index.d.ts +16 -0
- package/dist/components/features/picker/wrappers/index.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/internal/default-footer.d.ts +7 -0
- package/dist/components/features/picker/wrappers/internal/default-footer.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/time-picker.d.ts +14 -0
- package/dist/components/features/picker/wrappers/time-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/time-range-picker.d.ts +16 -0
- package/dist/components/features/picker/wrappers/time-range-picker.d.ts.map +1 -0
- package/dist/components/features/picker/wrappers/types.d.ts +118 -0
- package/dist/components/features/picker/wrappers/types.d.ts.map +1 -0
- package/dist/components/features/tag-input/tag-input.d.ts +1 -1
- package/dist/components/features/tag-input/tag-input.d.ts.map +1 -1
- package/dist/components/features/time-picker/time-picker.d.ts +5 -0
- package/dist/components/features/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/features/time-picker/types.d.ts +5 -0
- package/dist/components/features/time-picker/types.d.ts.map +1 -1
- package/dist/components/features/time-range-picker/index.d.ts +5 -0
- package/dist/components/features/time-range-picker/index.d.ts.map +1 -1
- package/dist/components/features/time-range-picker/time-range-picker.d.ts +19 -14
- package/dist/components/features/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/components/features/time-range-picker/types.d.ts +20 -0
- package/dist/components/features/time-range-picker/types.d.ts.map +1 -1
- package/dist/data-table/index.mjs +22 -15
- package/dist/date-picker/index.mjs +2 -2
- package/dist/date-range-picker-DNZh06zo.mjs +77 -0
- package/dist/date-time-picker/index.mjs +1 -1
- package/dist/date-time-picker-BiobghTJ.mjs +43 -0
- package/dist/date-time-picker-C0fF7s_e.mjs +109 -0
- package/dist/date-time-range-picker-cW4rbuFn.mjs +82 -0
- package/dist/default-footer-DbpemJVl.mjs +1037 -0
- package/dist/dropzone/index.mjs +1 -1
- package/dist/{dropzone-Bt0plEuw.mjs → dropzone-DXH0xHso.mjs} +1 -1
- package/dist/empty-content/index.mjs +1 -1
- package/dist/form/adapters/conform/index.mjs +19 -19
- package/dist/form/adapters/rhf/index.mjs +18 -18
- package/dist/form/index.mjs +2 -2
- package/dist/form/stepper/index.mjs +23 -23
- package/dist/{form-CCNN9VtJ.mjs → form-DvgKb4s4.mjs} +49 -42
- package/dist/{form-context-CeKyvO-A.mjs → form-context-0usxTumz.mjs} +3 -3
- package/dist/grid/index.mjs +1 -1
- package/dist/hooks/index.mjs +2 -2
- package/dist/index.mjs +41 -41
- package/dist/input-group/index.mjs +1 -1
- package/dist/{input-group-DDtz-RT7.mjs → input-group-CeMsDhOk.mjs} +1 -1
- package/dist/input-number/index.mjs +1 -1
- package/dist/{input-number-Diu-C6d5.mjs → input-number-BU4nno8J.mjs} +1 -1
- package/dist/loader-overlay/index.mjs +1 -1
- package/dist/map/index.mjs +1 -1
- package/dist/{map-qo7bY_g_.mjs → map-l7iwhEwM.mjs} +24 -27
- package/dist/more-actions/index.mjs +2 -2
- package/dist/{more-actions-Ca5qqd0H.mjs → more-actions-Baqor0yr.mjs} +2 -2
- package/dist/multi-select/index.mjs +1 -1
- package/dist/{multi-select-DM_dxnSV.mjs → multi-select-BHmtkQIi.mjs} +6 -6
- package/dist/nprogress/nprogress.css +59 -11
- package/dist/page-title/index.mjs +1 -1
- package/dist/picker/index.mjs +273 -0
- package/dist/rich-text-editor/index.mjs +1 -1
- package/dist/{rich-text-editor-CQH_U4T5.mjs → rich-text-editor-aWuLRaj9.mjs} +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/select-By1ZqPgr.mjs +94 -0
- package/dist/select-Ck0szhAH.mjs +73 -0
- package/dist/sidebar/index.mjs +1 -1
- package/dist/{sidebar-B8LQJiNI.mjs → sidebar-CUnFkH7o.mjs} +32 -32
- package/dist/skeleton/index.mjs +1 -1
- package/dist/{skeleton-D4HOEiOZ.mjs → skeleton-CxAhQT6T.mjs} +1 -1
- package/dist/stepper/index.mjs +1 -1
- package/dist/{stepper-Beb-zbdL.mjs → stepper-adDdiJMx.mjs} +7 -7
- package/dist/styles/root.css +4 -2
- package/dist/styles/shadcn/shadcn.css +212 -213
- package/dist/switch/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tag-input/index.mjs +1 -1
- package/dist/{tag-input-Bf4GMptp.mjs → tag-input-D3NYy9-_.mjs} +1 -1
- package/dist/task-queue/index.mjs +1 -1
- package/dist/{task-queue-dropdown-D-LncEWm.mjs → task-queue-dropdown-t9KKIL6j.mjs} +3 -3
- package/dist/textarea/index.mjs +1 -1
- package/dist/theme/index.mjs +1 -1
- package/dist/{themes-CAiN4b6G.mjs → themes-08-znmBI.mjs} +16 -16
- package/dist/time-input-9LdNL0Us.mjs +196 -0
- package/dist/time-picker/index.mjs +1 -1
- package/dist/time-picker-B-vpUClR.mjs +45 -0
- package/dist/time-picker-C840fLl6.mjs +49 -0
- package/dist/timezone-indicator-COoeMKKs.mjs +27 -0
- package/dist/{to-api-format-CgKcC9SK.mjs → to-api-format-CNqrcrz7.mjs} +58 -243
- package/dist/toast/index.mjs +2 -2
- package/dist/{toast-DDdLgY53.mjs → toast-Bd5Kk7BB.mjs} +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/dist/transfer/index.mjs +1 -1
- package/dist/{transfer-CoGPwOc6.mjs → transfer-CuJGL420.mjs} +6 -6
- package/dist/{types-CKIe2WlV.mjs → types-DvMIxilw.mjs} +9 -3
- package/dist/typography/index.mjs +1 -1
- package/dist/{typography-TRKP_CLT.mjs → typography-CBwfg-vz.mjs} +5 -5
- package/dist/{use-copy-to-clipboard-D7KyLIAt.mjs → use-copy-to-clipboard-ZHDvfV3W.mjs} +1 -1
- package/dist/use-deprecation-warning-Dy_DOyLu.mjs +20 -0
- package/dist/{use-display-touched-C-afz17j.mjs → use-display-touched-DpX3fsOl.mjs} +5 -5
- package/dist/{use-option-picker-BXQOfyrK.mjs → use-option-picker-DV5O68eV.mjs} +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/visually-hidden/index.mjs +1 -1
- package/package.json +30 -25
- package/dist/calendar-date-picker-BaykEs6j.mjs +0 -749
- package/dist/date-time-picker-DKOxrhmc.mjs +0 -193
- package/dist/select-zxwykvQn.mjs +0 -163
- package/dist/time-picker-BZF5jbF6.mjs +0 -99
- package/dist/use-date-constraints-R3H4lIoT.mjs +0 -41
- /package/dist/{action-row-DnhBhMtt.mjs → action-row-ZaMsJ8cP.mjs} +0 -0
- /package/dist/{empty-content-CBh5bbtJ.mjs → empty-content-DTk_lwnh.mjs} +0 -0
- /package/dist/{hooks-DQXVwbrs.mjs → hooks-CnphNpwz.mjs} +0 -0
- /package/dist/{loader-overlay-C2WDla6V.mjs → loader-overlay-B3YEoOFJ.mjs} +0 -0
- /package/dist/{map-leaflet-imports-yWwH4CHB.mjs → map-leaflet-imports-Ix8F7E8j.mjs} +0 -0
- /package/dist/{page-title-ChLiv6gB.mjs → page-title-D5JhOpxV.mjs} +0 -0
- /package/dist/{skeleton-D2xuJdE1.mjs → skeleton-B1NOdZGM.mjs} +0 -0
- /package/dist/{switch-DcSF42Kc.mjs → switch-BcQaR1Bp.mjs} +0 -0
- /package/dist/{table-DWGT4cqh.mjs → table-ouGk4Vxe.mjs} +0 -0
- /package/dist/{textarea-BoChBcFz.mjs → textarea-q-k7DYwi.mjs} +0 -0
- /package/dist/{toast-D5XD7goD.mjs → toast-BWol1pyV.mjs} +0 -0
- /package/dist/{tooltip-a7NTDCWw.mjs → tooltip-CHuzXR_O.mjs} +0 -0
- /package/dist/{utils-BwB1mIdZ.mjs → utils-bUueJ2r9.mjs} +0 -0
- /package/dist/{visuallyhidden-BHOPczmW.mjs → visuallyhidden-CoIJOJ9z.mjs} +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { t as cn } from "../cn-D2KYQ917.mjs";
|
|
2
|
+
import { i as SelectItem, l as SelectTrigger, n as SelectContent, t as Select, u as SelectValue } from "../select-By1ZqPgr.mjs";
|
|
3
|
+
import { A as zonedDateToIso, C as PickerContext, D as getBrowserTimezone, E as formatTimezoneLabel, F as isDateBearingMode, I as isRangeMode, L as isTimeBearingMode, M as DATE_BEARING_MODES, N as RANGE_MODES, O as getTimezoneOffset, P as TIME_BEARING_MODES, S as PickerContent, T as formatInTimezone, _ as formatTimeLabel, a as PickerFooter, b as resolveCommit, c as PickerTrigger, d as DATETIME_PRESETS, f as DATE_PRESETS, g as dateToYYYYMMDD, i as PickerClear, j as ALLOWED_STEPS, k as isoToZonedDate, l as Picker$1, m as usePickerState, n as PickerApply, o as PickerReset, p as getDefaultPresets, r as PickerCancel, s as formatPickerValue, t as DefaultFooter, u as usePresets, v as isValidTimeString, w as usePickerContext, x as useKeyboardShortcuts, y as parseTimeString } from "../default-footer-DbpemJVl.mjs";
|
|
4
|
+
import { t as PickerCalendar } from "../calendar-D_DriVHT.mjs";
|
|
5
|
+
import { n as PickerPresets, t as DateRangePicker } from "../date-range-picker-DNZh06zo.mjs";
|
|
6
|
+
import { n as useTimeSlots, t as PickerTimeInput } from "../time-input-9LdNL0Us.mjs";
|
|
7
|
+
import { t as DateTimePicker } from "../date-time-picker-C0fF7s_e.mjs";
|
|
8
|
+
import { t as PickerTimezoneIndicator } from "../timezone-indicator-COoeMKKs.mjs";
|
|
9
|
+
import { t as TimePicker } from "../time-picker-B-vpUClR.mjs";
|
|
10
|
+
import { t as DateTimeRangePicker } from "../date-time-range-picker-cW4rbuFn.mjs";
|
|
11
|
+
import { Clock, Globe } from "lucide-react";
|
|
12
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { differenceInCalendarDays } from "date-fns";
|
|
14
|
+
//#region src/components/features/picker/components/timezone-select.tsx
|
|
15
|
+
function PickerTimezoneSelect({ options, onChange, className, placeholder = "Select timezone" }) {
|
|
16
|
+
const { mode, timezone } = usePickerContext();
|
|
17
|
+
if (!isTimeBearingMode(mode)) return null;
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
19
|
+
"data-slot": "picker-tz-select",
|
|
20
|
+
className: cn("flex items-center gap-2 px-3 py-2", className),
|
|
21
|
+
children: [/* @__PURE__ */ jsx(Globe, { className: "text-muted-foreground size-4 shrink-0" }), /* @__PURE__ */ jsxs(Select, {
|
|
22
|
+
value: timezone,
|
|
23
|
+
onValueChange: onChange,
|
|
24
|
+
children: [/* @__PURE__ */ jsx(SelectTrigger, {
|
|
25
|
+
className: "hover:bg-accent h-8 min-w-[180px] border-0 bg-transparent px-2 text-xs shadow-none",
|
|
26
|
+
children: /* @__PURE__ */ jsx(SelectValue, { placeholder })
|
|
27
|
+
}), /* @__PURE__ */ jsx(SelectContent, { children: options.map((opt) => /* @__PURE__ */ jsx(SelectItem, {
|
|
28
|
+
value: opt.value,
|
|
29
|
+
className: "text-xs",
|
|
30
|
+
children: opt.label
|
|
31
|
+
}, opt.value)) })]
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
PickerTimezoneSelect.displayName = "Picker.TimezoneSelect";
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/components/features/picker/components/index.ts
|
|
38
|
+
const Picker = Object.assign(Picker$1, {
|
|
39
|
+
Trigger: PickerTrigger,
|
|
40
|
+
Content: PickerContent,
|
|
41
|
+
Calendar: PickerCalendar,
|
|
42
|
+
TimeInput: PickerTimeInput,
|
|
43
|
+
Presets: PickerPresets,
|
|
44
|
+
Footer: PickerFooter,
|
|
45
|
+
Apply: PickerApply,
|
|
46
|
+
Reset: PickerReset,
|
|
47
|
+
Cancel: PickerCancel,
|
|
48
|
+
Clear: PickerClear,
|
|
49
|
+
TimezoneIndicator: PickerTimezoneIndicator,
|
|
50
|
+
TimezoneSelect: PickerTimezoneSelect
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/components/features/picker/utils/compare.ts
|
|
54
|
+
/** Strict equality of two nullable Date references by millisecond value. */
|
|
55
|
+
function isSameDate(a, b) {
|
|
56
|
+
if (a === b) return true;
|
|
57
|
+
if (a === null || b === null) return false;
|
|
58
|
+
return a.getTime() === b.getTime();
|
|
59
|
+
}
|
|
60
|
+
/** Equality of two nullable date ranges. Compares from, to (by ms), and preset. */
|
|
61
|
+
function isSameDateRange(a, b) {
|
|
62
|
+
if (a === b) return true;
|
|
63
|
+
if (a === null || b === null) return false;
|
|
64
|
+
return a.from.getTime() === b.from.getTime() && a.to.getTime() === b.to.getTime() && a.preset === b.preset;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Equality of two nullable string ranges. Used for time-of-day, time-range,
|
|
68
|
+
* and datetime-range value shapes (all structurally identical).
|
|
69
|
+
* Compares from, to, and optional preset.
|
|
70
|
+
*/
|
|
71
|
+
function isSameStringRange(a, b) {
|
|
72
|
+
if (a === b) return true;
|
|
73
|
+
if (a === null || b === null) return false;
|
|
74
|
+
return a.from === b.from && a.to === b.to && a.preset === b.preset;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/components/features/picker/utils/range.ts
|
|
78
|
+
/**
|
|
79
|
+
* Number of calendar days between two dates. Always non-negative.
|
|
80
|
+
*
|
|
81
|
+
* Uses calendar-day boundaries (not 24-hour windows), so a range from
|
|
82
|
+
* 23:59 today to 00:00 tomorrow counts as 1 day, not 0.
|
|
83
|
+
*/
|
|
84
|
+
function getDaysDifference(from, to) {
|
|
85
|
+
return Math.abs(differenceInCalendarDays(to, from));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Validate a range against a maximum span (inclusive).
|
|
89
|
+
*
|
|
90
|
+
* - Returns `true` when `maxRange` is undefined.
|
|
91
|
+
* - Returns `true` when the range spans at most `maxRange` days.
|
|
92
|
+
*/
|
|
93
|
+
function isRangeValid(from, to, maxRange) {
|
|
94
|
+
if (maxRange === void 0) return true;
|
|
95
|
+
return getDaysDifference(from, to) <= maxRange;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Clamp a range to fit within `maxRange` days.
|
|
99
|
+
*
|
|
100
|
+
* If the range already fits, returns the original `{from, to}`.
|
|
101
|
+
* Otherwise, holds `from` and clamps `to` forward to exactly `maxRange`
|
|
102
|
+
* days after `from`.
|
|
103
|
+
*/
|
|
104
|
+
function clampRange(from, to, maxRange) {
|
|
105
|
+
if (isRangeValid(from, to, maxRange)) return {
|
|
106
|
+
from,
|
|
107
|
+
to
|
|
108
|
+
};
|
|
109
|
+
return {
|
|
110
|
+
from,
|
|
111
|
+
to: new Date(from.getTime() + maxRange * 24 * 60 * 60 * 1e3)
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/components/features/picker/wrappers/date-picker.tsx
|
|
116
|
+
function DatePicker({ value, onChange, placeholder = "Pick a date", clearable = true, responsive = true, sheetTitle = "Pick a date", numberOfMonths = 1, triggerLabel, icon, disabled, className, triggerClassName, popoverClassName, id, sheetDescription, modal, commit, disablePast, disableFuture, minDate, maxDate, dateFormat }) {
|
|
117
|
+
return /* @__PURE__ */ jsx(Picker$1.Root, {
|
|
118
|
+
mode: "date",
|
|
119
|
+
value,
|
|
120
|
+
onChange,
|
|
121
|
+
commit,
|
|
122
|
+
responsive,
|
|
123
|
+
presets: [],
|
|
124
|
+
disablePast,
|
|
125
|
+
disableFuture,
|
|
126
|
+
minDate,
|
|
127
|
+
maxDate,
|
|
128
|
+
children: /* @__PURE__ */ jsx(PickerContent, {
|
|
129
|
+
trigger: /* @__PURE__ */ jsx(PickerTrigger, {
|
|
130
|
+
placeholder,
|
|
131
|
+
clearable,
|
|
132
|
+
disabled,
|
|
133
|
+
className,
|
|
134
|
+
triggerClassName,
|
|
135
|
+
id,
|
|
136
|
+
icon,
|
|
137
|
+
children: (v) => triggerLabel ? triggerLabel(v) : formatPickerValue(v, "date", { dateFormat })
|
|
138
|
+
}),
|
|
139
|
+
sheetTitle,
|
|
140
|
+
sheetDescription,
|
|
141
|
+
modal,
|
|
142
|
+
contentClassName: popoverClassName,
|
|
143
|
+
footer: /* @__PURE__ */ jsx(DefaultFooter, {}),
|
|
144
|
+
children: /* @__PURE__ */ jsx(PickerCalendar, {
|
|
145
|
+
numberOfMonths,
|
|
146
|
+
minDate,
|
|
147
|
+
maxDate,
|
|
148
|
+
disablePast,
|
|
149
|
+
disableFuture
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
DatePicker.displayName = "DatePicker";
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/components/features/picker/wrappers/date-range-time-picker.tsx
|
|
157
|
+
function DateRangeTimePicker({ value, onChange, placeholder = "Pick a date range with time", clearable = true, responsive = true, sheetTitle = "Pick a date range with time", timezone, step = 15, hourCycle, numberOfMonths = 2, hideTimezone = false, triggerLabel, icon, disabled, className, triggerClassName, popoverClassName, id, sheetDescription, modal, disablePast, disableFuture, minDate, maxDate, presets, excludePresets, dateFormat, timeFormat }) {
|
|
158
|
+
return /* @__PURE__ */ jsx(Picker$1.Root, {
|
|
159
|
+
mode: "date-range-time",
|
|
160
|
+
value,
|
|
161
|
+
onChange,
|
|
162
|
+
responsive,
|
|
163
|
+
timezone,
|
|
164
|
+
step,
|
|
165
|
+
hourCycle,
|
|
166
|
+
hideTimezone,
|
|
167
|
+
presets,
|
|
168
|
+
excludePresets,
|
|
169
|
+
disablePast,
|
|
170
|
+
disableFuture,
|
|
171
|
+
minDate,
|
|
172
|
+
maxDate,
|
|
173
|
+
children: /* @__PURE__ */ jsx(PickerContent, {
|
|
174
|
+
trigger: /* @__PURE__ */ jsx(PickerTrigger, {
|
|
175
|
+
placeholder,
|
|
176
|
+
clearable,
|
|
177
|
+
disabled,
|
|
178
|
+
className,
|
|
179
|
+
triggerClassName,
|
|
180
|
+
id,
|
|
181
|
+
icon,
|
|
182
|
+
children: (v) => triggerLabel ? triggerLabel(v) : formatPickerValue(v, "date-range-time", {
|
|
183
|
+
timezone,
|
|
184
|
+
hourCycle,
|
|
185
|
+
dateFormat,
|
|
186
|
+
timeFormat
|
|
187
|
+
})
|
|
188
|
+
}),
|
|
189
|
+
sheetTitle,
|
|
190
|
+
sheetDescription,
|
|
191
|
+
modal,
|
|
192
|
+
contentClassName: popoverClassName,
|
|
193
|
+
footer: /* @__PURE__ */ jsx(DefaultFooter, {}),
|
|
194
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
195
|
+
className: "flex flex-col md:flex-row",
|
|
196
|
+
children: [/* @__PURE__ */ jsx(PickerPresets, {}), /* @__PURE__ */ jsxs("div", {
|
|
197
|
+
className: "flex flex-col",
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ jsx(PickerCalendar, {
|
|
200
|
+
numberOfMonths,
|
|
201
|
+
minDate,
|
|
202
|
+
maxDate,
|
|
203
|
+
disablePast,
|
|
204
|
+
disableFuture
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ jsxs("div", {
|
|
207
|
+
className: "border-t p-3",
|
|
208
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
209
|
+
className: "text-muted-foreground mb-1 text-xs",
|
|
210
|
+
children: "Time of day"
|
|
211
|
+
}), /* @__PURE__ */ jsx(PickerTimeInput, { target: "embedded-from" })]
|
|
212
|
+
}),
|
|
213
|
+
/* @__PURE__ */ jsx(PickerTimezoneIndicator, {})
|
|
214
|
+
]
|
|
215
|
+
})]
|
|
216
|
+
})
|
|
217
|
+
})
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
DateRangeTimePicker.displayName = "DateRangeTimePicker";
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/components/features/picker/wrappers/time-range-picker.tsx
|
|
223
|
+
const DEFAULT_TIME_ICON = /* @__PURE__ */ jsx(Clock, { className: "text-muted-foreground size-4 shrink-0" });
|
|
224
|
+
function TimeRangePicker({ value, onChange, placeholder = "Pick a time range", clearable = true, responsive = true, sheetTitle = "Pick a time range", step = 15, hourCycle, timeFormat, triggerLabel, icon, disabled, className, triggerClassName, popoverClassName, id, sheetDescription, modal, commit }) {
|
|
225
|
+
return /* @__PURE__ */ jsx(Picker$1.Root, {
|
|
226
|
+
mode: "time-range",
|
|
227
|
+
value,
|
|
228
|
+
onChange,
|
|
229
|
+
commit,
|
|
230
|
+
responsive,
|
|
231
|
+
step,
|
|
232
|
+
hourCycle,
|
|
233
|
+
children: /* @__PURE__ */ jsx(PickerContent, {
|
|
234
|
+
trigger: /* @__PURE__ */ jsx(PickerTrigger, {
|
|
235
|
+
placeholder,
|
|
236
|
+
clearable,
|
|
237
|
+
disabled,
|
|
238
|
+
className,
|
|
239
|
+
triggerClassName,
|
|
240
|
+
id,
|
|
241
|
+
icon: icon ?? DEFAULT_TIME_ICON,
|
|
242
|
+
children: (v) => triggerLabel ? triggerLabel(v) : formatPickerValue(v, "time-range", {
|
|
243
|
+
hourCycle,
|
|
244
|
+
timeFormat
|
|
245
|
+
})
|
|
246
|
+
}),
|
|
247
|
+
sheetTitle,
|
|
248
|
+
sheetDescription,
|
|
249
|
+
modal,
|
|
250
|
+
contentClassName: popoverClassName,
|
|
251
|
+
footer: /* @__PURE__ */ jsx(DefaultFooter, {}),
|
|
252
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
253
|
+
className: "flex gap-2 p-3",
|
|
254
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
255
|
+
className: "flex-1",
|
|
256
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
257
|
+
className: "text-muted-foreground mb-1 text-xs",
|
|
258
|
+
children: "From"
|
|
259
|
+
}), /* @__PURE__ */ jsx(PickerTimeInput, { target: "range-from" })]
|
|
260
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
261
|
+
className: "flex-1",
|
|
262
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
263
|
+
className: "text-muted-foreground mb-1 text-xs",
|
|
264
|
+
children: "To"
|
|
265
|
+
}), /* @__PURE__ */ jsx(PickerTimeInput, { target: "range-to" })]
|
|
266
|
+
})]
|
|
267
|
+
})
|
|
268
|
+
})
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
TimeRangePicker.displayName = "TimeRangePicker";
|
|
272
|
+
//#endregion
|
|
273
|
+
export { ALLOWED_STEPS, DATETIME_PRESETS, DATE_BEARING_MODES, DATE_PRESETS, DatePicker, DateRangePicker, DateRangeTimePicker, DateTimePicker, DateTimeRangePicker, Picker, PickerApply, PickerCalendar, PickerCancel, PickerClear, PickerContent, PickerContext, PickerFooter, PickerPresets, PickerReset, PickerTimeInput, PickerTimezoneIndicator, PickerTimezoneSelect, PickerTrigger, RANGE_MODES, TIME_BEARING_MODES, TimePicker, TimeRangePicker, clampRange, dateToYYYYMMDD, formatInTimezone, formatPickerValue, formatTimeLabel, formatTimezoneLabel, getBrowserTimezone, getDaysDifference, getDefaultPresets, getTimezoneOffset, isDateBearingMode, isRangeMode, isRangeValid, isSameDate, isSameDateRange, isSameStringRange, isTimeBearingMode, isValidTimeString, isoToZonedDate, parseTimeString, resolveCommit, useKeyboardShortcuts, usePickerContext, usePickerState, usePresets, useTimeSlots, zonedDateToIso };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useRichTextEditor, r as RichTextContent, t as RichTextEditor } from "../rich-text-editor-
|
|
1
|
+
import { n as useRichTextEditor, r as RichTextContent, t as RichTextEditor } from "../rich-text-editor-aWuLRaj9.mjs";
|
|
2
2
|
export { RichTextContent, RichTextEditor, useRichTextEditor };
|
|
@@ -3,7 +3,7 @@ import { t as Button } from "./button-BllvE9Lm.mjs";
|
|
|
3
3
|
import { t as Icon } from "./icon-wrapper-DuLp3RM1.mjs";
|
|
4
4
|
import { t as Input } from "./input-FKGqZypx.mjs";
|
|
5
5
|
import { t as ResponsivePopover } from "./responsive-popover-D-t9bxSN.mjs";
|
|
6
|
-
import { t as Tooltip } from "./tooltip-
|
|
6
|
+
import { t as Tooltip } from "./tooltip-CHuzXR_O.mjs";
|
|
7
7
|
import { BoldIcon, ItalicIcon, LinkIcon, StrikethroughIcon, UnderlineIcon, UnlinkIcon } from "lucide-react";
|
|
8
8
|
import { createContext, use, useCallback, useState } from "react";
|
|
9
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
package/dist/select/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SelectLabel, c as SelectSeparator, i as SelectItem, l as SelectTrigger, n as SelectContent, o as SelectScrollDownButton, r as SelectGroup, s as SelectScrollUpButton, t as Select, u as SelectValue } from "../select-
|
|
1
|
+
import { a as SelectLabel, c as SelectSeparator, i as SelectItem, l as SelectTrigger, n as SelectContent, o as SelectScrollDownButton, r as SelectGroup, s as SelectScrollUpButton, t as Select, u as SelectValue } from "../select-Ck0szhAH.mjs";
|
|
2
2
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as cn } from "./utils-C8KwMfT_.mjs";
|
|
2
|
+
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
6
|
+
//#region ../shadcn/ui/select.tsx
|
|
7
|
+
const Select = ({ ...props }) => {
|
|
8
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Root, {
|
|
9
|
+
"data-slot": "select",
|
|
10
|
+
...props
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
const SelectGroup = ({ ...props }) => {
|
|
14
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Group, {
|
|
15
|
+
"data-slot": "select-group",
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const SelectValue = ({ ...props }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
21
|
+
"data-slot": "select-value",
|
|
22
|
+
...props
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
const SelectTrigger = ({ className, children, ...props }) => {
|
|
26
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Trigger, {
|
|
27
|
+
"data-slot": "select-trigger",
|
|
28
|
+
className: cn("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive rounded-md border bg-transparent py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", "flex h-auto min-h-10 w-full items-center justify-between px-3 text-sm font-medium", className),
|
|
29
|
+
...props,
|
|
30
|
+
children: [children, /* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
31
|
+
asChild: true,
|
|
32
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4 opacity-50" })
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const SelectContent = ({ className, children, position = "popper", ...props }) => {
|
|
37
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
38
|
+
"data-slot": "select-content",
|
|
39
|
+
className: cn("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", "w-[var(--radix-select-trigger-width)]", className),
|
|
40
|
+
position,
|
|
41
|
+
...props,
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
44
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
45
|
+
className: cn("p-1", position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
46
|
+
children
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
49
|
+
]
|
|
50
|
+
}) });
|
|
51
|
+
};
|
|
52
|
+
const SelectLabel = ({ className, ...props }) => {
|
|
53
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Label, {
|
|
54
|
+
"data-slot": "select-label",
|
|
55
|
+
className: cn("px-2 py-1.5 text-sm font-medium", className),
|
|
56
|
+
...props
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
const SelectItem = ({ className, children, ...props }) => {
|
|
60
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
61
|
+
"data-slot": "select-item",
|
|
62
|
+
className: cn("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", className),
|
|
63
|
+
...props,
|
|
64
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
65
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
66
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) })
|
|
67
|
+
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const SelectSeparator = ({ className, ...props }) => {
|
|
71
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.Separator, {
|
|
72
|
+
"data-slot": "select-separator",
|
|
73
|
+
className: cn("bg-border pointer-events-none -mx-1 my-1 h-px", className),
|
|
74
|
+
...props
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
const SelectScrollUpButton = ({ className, ...props }) => {
|
|
78
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, {
|
|
79
|
+
"data-slot": "select-scroll-up-button",
|
|
80
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
81
|
+
...props,
|
|
82
|
+
children: /* @__PURE__ */ jsx(ChevronUpIcon, { className: "size-4" })
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const SelectScrollDownButton = ({ className, ...props }) => {
|
|
86
|
+
return /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, {
|
|
87
|
+
"data-slot": "select-scroll-down-button",
|
|
88
|
+
className: cn("flex cursor-default items-center justify-center py-1", className),
|
|
89
|
+
...props,
|
|
90
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, { className: "size-4" })
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { SelectLabel as a, SelectSeparator as c, SelectItem as i, SelectTrigger as l, SelectContent as n, SelectScrollDownButton as o, SelectGroup as r, SelectScrollUpButton as s, Select as t, SelectValue as u };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
|
+
import { a as SelectLabel$1, c as SelectSeparator$1, i as SelectItem$1, l as SelectTrigger$1, n as SelectContent$1, o as SelectScrollDownButton$1, r as SelectGroup$1, s as SelectScrollUpButton$1, t as Select$1, u as SelectValue$1 } from "./select-By1ZqPgr.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/base/select/select.tsx
|
|
6
|
+
const Select = Select$1;
|
|
7
|
+
const SelectValue = SelectValue$1;
|
|
8
|
+
function SelectGroup({ ref, className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx(SelectGroup$1, {
|
|
10
|
+
ref,
|
|
11
|
+
className: cn(className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
SelectGroup.displayName = "SelectGroup";
|
|
16
|
+
function SelectTrigger({ ref, className, ...props }) {
|
|
17
|
+
return /* @__PURE__ */ jsx(SelectTrigger$1, {
|
|
18
|
+
ref,
|
|
19
|
+
className: cn("rounded-lg", "bg-input-background/50", "text-input-foreground", "border-input-border", "placeholder:text-input-placeholder", "focus-visible:ring-0 focus-visible:ring-offset-0", "focus-visible:border-input-focus-border", "focus-visible:shadow-(--input-focus-shadow)", "aria-invalid:border-destructive", className),
|
|
20
|
+
...props
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
SelectTrigger.displayName = "SelectTrigger";
|
|
24
|
+
function SelectContent({ ref, className, ...props }) {
|
|
25
|
+
return /* @__PURE__ */ jsx(SelectContent$1, {
|
|
26
|
+
ref,
|
|
27
|
+
className: cn(className),
|
|
28
|
+
...props
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
SelectContent.displayName = "SelectContent";
|
|
32
|
+
function SelectLabel({ ref, className, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(SelectLabel$1, {
|
|
34
|
+
ref,
|
|
35
|
+
className: cn(className),
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
SelectLabel.displayName = "SelectLabel";
|
|
40
|
+
function SelectItem({ ref, className, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(SelectItem$1, {
|
|
42
|
+
ref,
|
|
43
|
+
className: cn(className),
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
SelectItem.displayName = "SelectItem";
|
|
48
|
+
function SelectSeparator({ ref, className, ...props }) {
|
|
49
|
+
return /* @__PURE__ */ jsx(SelectSeparator$1, {
|
|
50
|
+
ref,
|
|
51
|
+
className: cn(className),
|
|
52
|
+
...props
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
SelectSeparator.displayName = "SelectSeparator";
|
|
56
|
+
function SelectScrollUpButton({ ref, className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(SelectScrollUpButton$1, {
|
|
58
|
+
ref,
|
|
59
|
+
className: cn(className),
|
|
60
|
+
...props
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
SelectScrollUpButton.displayName = "SelectScrollUpButton";
|
|
64
|
+
function SelectScrollDownButton({ ref, className, ...props }) {
|
|
65
|
+
return /* @__PURE__ */ jsx(SelectScrollDownButton$1, {
|
|
66
|
+
ref,
|
|
67
|
+
className: cn(className),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
SelectScrollDownButton.displayName = "SelectScrollDownButton";
|
|
72
|
+
//#endregion
|
|
73
|
+
export { SelectLabel as a, SelectSeparator as c, SelectItem as i, SelectTrigger as l, SelectContent as n, SelectScrollDownButton as o, SelectGroup as r, SelectScrollUpButton as s, Select as t, SelectValue as u };
|
package/dist/sidebar/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "../sidebar-
|
|
1
|
+
import { C as SidebarTrigger, S as SidebarSeparator, _ as SidebarMenuSub, a as SidebarGroupAction, b as SidebarProvider, c as SidebarHeader, d as SidebarMenu, f as SidebarMenuAction, g as SidebarMenuSkeleton, h as SidebarMenuItem, i as SidebarGroup, l as SidebarInput, m as SidebarMenuButton, n as SidebarContent, o as SidebarGroupContent, p as SidebarMenuBadge, r as SidebarFooter, s as SidebarGroupLabel, t as Sidebar, u as SidebarInset, v as SidebarMenuSubButton, w as useSidebar, x as SidebarRail, y as SidebarMenuSubItem } from "../sidebar-CUnFkH7o.mjs";
|
|
2
2
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
2
|
import { t as Separator } from "./separator-DXVTncCK.mjs";
|
|
3
|
-
import { t as Button } from "./button-
|
|
3
|
+
import { t as Button } from "./button-Rw1xI-k9.mjs";
|
|
4
4
|
import { t as Icon } from "./icon-wrapper-DuLp3RM1.mjs";
|
|
5
5
|
import { t as Input } from "./input-FKGqZypx.mjs";
|
|
6
6
|
import { a as SheetHeader, n as SheetContent, o as SheetTitle, r as SheetDescription, t as Sheet } from "./sheet-DVEToCVY.mjs";
|
|
7
|
-
import { t as Skeleton } from "./skeleton-
|
|
8
|
-
import { i as TooltipProvider, t as Tooltip } from "./tooltip-
|
|
7
|
+
import { t as Skeleton } from "./skeleton-B1NOdZGM.mjs";
|
|
8
|
+
import { i as TooltipProvider, t as Tooltip } from "./tooltip-CHuzXR_O.mjs";
|
|
9
9
|
import { cva } from "class-variance-authority";
|
|
10
10
|
import { PanelLeftCloseIcon, PanelLeftOpenIcon } from "lucide-react";
|
|
11
|
-
import * as React
|
|
11
|
+
import * as React from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { Slot } from "@radix-ui/react-slot";
|
|
14
14
|
//#region ../shadcn/hooks/use-mobile.ts
|
|
15
15
|
const MOBILE_BREAKPOINT = 768;
|
|
16
16
|
function useIsMobile() {
|
|
17
|
-
const [isMobile, setIsMobile] = React
|
|
18
|
-
React
|
|
17
|
+
const [isMobile, setIsMobile] = React.useState(void 0);
|
|
18
|
+
React.useEffect(() => {
|
|
19
19
|
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
20
20
|
const onChange = () => {
|
|
21
21
|
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
@@ -34,33 +34,33 @@ const SIDEBAR_WIDTH = "13rem";
|
|
|
34
34
|
const SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
35
35
|
const SIDEBAR_WIDTH_ICON = "3rem";
|
|
36
36
|
const SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
37
|
-
const SidebarContext = React
|
|
37
|
+
const SidebarContext = React.createContext(null);
|
|
38
38
|
function useSidebar() {
|
|
39
|
-
const context = React
|
|
39
|
+
const context = React.use(SidebarContext);
|
|
40
40
|
if (!context) throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
41
41
|
return context;
|
|
42
42
|
}
|
|
43
43
|
function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: setOpenProp, expandOnHover = false, expandBehavior = "push", showBackdrop = false, className, style, children, ...props }) {
|
|
44
44
|
const isMobile = useIsMobile();
|
|
45
|
-
const [openMobile, setOpenMobile] = React
|
|
46
|
-
const [isHovered, setIsHovered] = React
|
|
47
|
-
const [hasSubLayout, setHasSubLayout] = React
|
|
48
|
-
const hoverTimeoutRef = React
|
|
49
|
-
const hoverLockRef = React
|
|
50
|
-
const userClosedSidebarRef = React
|
|
51
|
-
const [_open, _setOpen] = React
|
|
45
|
+
const [openMobile, setOpenMobile] = React.useState(false);
|
|
46
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
47
|
+
const [hasSubLayout, setHasSubLayout] = React.useState(false);
|
|
48
|
+
const hoverTimeoutRef = React.useRef(null);
|
|
49
|
+
const hoverLockRef = React.useRef(false);
|
|
50
|
+
const userClosedSidebarRef = React.useRef(false);
|
|
51
|
+
const [_open, _setOpen] = React.useState(defaultOpen);
|
|
52
52
|
const open = openProp ?? _open;
|
|
53
53
|
const LG_BREAKPOINT = 1024;
|
|
54
|
-
React
|
|
54
|
+
React.useLayoutEffect(() => {
|
|
55
55
|
if (isMobile) {
|
|
56
56
|
_setOpen(false);
|
|
57
57
|
setOpenMobile(false);
|
|
58
58
|
} else if (window.innerWidth < LG_BREAKPOINT) _setOpen(false);
|
|
59
59
|
}, [isMobile]);
|
|
60
|
-
React
|
|
60
|
+
React.useEffect(() => {
|
|
61
61
|
if (isMobile) userClosedSidebarRef.current = false;
|
|
62
62
|
}, [isMobile]);
|
|
63
|
-
React
|
|
63
|
+
React.useEffect(() => {
|
|
64
64
|
if (isMobile) return;
|
|
65
65
|
const mql = window.matchMedia(`(min-width: ${LG_BREAKPOINT}px)`);
|
|
66
66
|
const onChange = () => {
|
|
@@ -71,25 +71,25 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
71
71
|
mql.addEventListener("change", onChange);
|
|
72
72
|
return () => mql.removeEventListener("change", onChange);
|
|
73
73
|
}, [isMobile]);
|
|
74
|
-
const setOpen = React
|
|
74
|
+
const setOpen = React.useCallback((value) => {
|
|
75
75
|
const openState = typeof value === "function" ? value(open) : value;
|
|
76
76
|
if (setOpenProp) setOpenProp(openState);
|
|
77
77
|
else _setOpen(openState);
|
|
78
78
|
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
79
79
|
}, [setOpenProp, open]);
|
|
80
|
-
const handleMouseEnter = React
|
|
80
|
+
const handleMouseEnter = React.useCallback(() => {
|
|
81
81
|
if (!expandOnHover) return;
|
|
82
82
|
if (hoverLockRef.current) return;
|
|
83
83
|
if (hoverTimeoutRef.current) clearTimeout(hoverTimeoutRef.current);
|
|
84
84
|
setIsHovered(true);
|
|
85
85
|
}, [expandOnHover]);
|
|
86
|
-
const handleMouseLeave = React
|
|
86
|
+
const handleMouseLeave = React.useCallback(() => {
|
|
87
87
|
if (!expandOnHover) return;
|
|
88
88
|
hoverTimeoutRef.current = setTimeout(() => {
|
|
89
89
|
setIsHovered(false);
|
|
90
90
|
}, expandBehavior === "overlay" ? 200 : 300);
|
|
91
91
|
}, [expandOnHover, expandBehavior]);
|
|
92
|
-
const toggleSidebar = React
|
|
92
|
+
const toggleSidebar = React.useCallback(() => {
|
|
93
93
|
if (isMobile) {
|
|
94
94
|
setOpenMobile((current) => !current);
|
|
95
95
|
return;
|
|
@@ -109,7 +109,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
109
109
|
setOpenMobile,
|
|
110
110
|
expandOnHover
|
|
111
111
|
]);
|
|
112
|
-
const forceClose = React
|
|
112
|
+
const forceClose = React.useCallback(() => {
|
|
113
113
|
if (isMobile) {
|
|
114
114
|
setOpenMobile(false);
|
|
115
115
|
return;
|
|
@@ -123,7 +123,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
123
123
|
setOpen,
|
|
124
124
|
setOpenMobile
|
|
125
125
|
]);
|
|
126
|
-
const closeForNavigation = React
|
|
126
|
+
const closeForNavigation = React.useCallback(() => {
|
|
127
127
|
if (isMobile) {
|
|
128
128
|
setOpenMobile(false);
|
|
129
129
|
return;
|
|
@@ -140,7 +140,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
140
140
|
setOpen,
|
|
141
141
|
setOpenMobile
|
|
142
142
|
]);
|
|
143
|
-
React
|
|
143
|
+
React.useEffect(() => {
|
|
144
144
|
const handleKeyDown = (event) => {
|
|
145
145
|
if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
|
|
146
146
|
event.preventDefault();
|
|
@@ -153,7 +153,7 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
153
153
|
const effectiveOpen = open || expandOnHover && isHovered;
|
|
154
154
|
const state = effectiveOpen ? "expanded" : "collapsed";
|
|
155
155
|
return /* @__PURE__ */ jsx(SidebarContext, {
|
|
156
|
-
value: React
|
|
156
|
+
value: React.useMemo(() => ({
|
|
157
157
|
state,
|
|
158
158
|
open: effectiveOpen,
|
|
159
159
|
setOpen,
|
|
@@ -204,10 +204,10 @@ function SidebarProvider({ defaultOpen = true, open: openProp, onOpenChange: set
|
|
|
204
204
|
}
|
|
205
205
|
function Sidebar({ side = "left", variant = "sidebar", collapsible = "offcanvas", className, children, ...props }) {
|
|
206
206
|
const { isMobile, state, openMobile, setOpenMobile, handleMouseEnter, handleMouseLeave, expandBehavior, showBackdrop, forceClose } = useSidebar();
|
|
207
|
-
const sidebarRef = React
|
|
208
|
-
const [showBackdropElement, setShowBackdropElement] = React
|
|
209
|
-
const [backdropVisible, setBackdropVisible] = React
|
|
210
|
-
React
|
|
207
|
+
const sidebarRef = React.useRef(null);
|
|
208
|
+
const [showBackdropElement, setShowBackdropElement] = React.useState(false);
|
|
209
|
+
const [backdropVisible, setBackdropVisible] = React.useState(false);
|
|
210
|
+
React.useEffect(() => {
|
|
211
211
|
if (showBackdrop && expandBehavior === "overlay" && state === "expanded") {
|
|
212
212
|
setShowBackdropElement(true);
|
|
213
213
|
requestAnimationFrame(() => {
|
|
@@ -453,7 +453,7 @@ function SidebarMenuButton({ asChild = false, isActive = false, variant = "defau
|
|
|
453
453
|
...props
|
|
454
454
|
});
|
|
455
455
|
if (!tooltip) return button;
|
|
456
|
-
const tooltipMessage = typeof tooltip === "string" || React
|
|
456
|
+
const tooltipMessage = typeof tooltip === "string" || React.isValidElement(tooltip) || typeof tooltip === "object" && "message" in tooltip ? typeof tooltip === "string" || React.isValidElement(tooltip) ? tooltip : tooltip.message : null;
|
|
457
457
|
const tooltipProps = typeof tooltip === "object" && "message" in tooltip ? {
|
|
458
458
|
side: tooltip.side,
|
|
459
459
|
align: tooltip.align
|
|
@@ -484,7 +484,7 @@ function SidebarMenuBadge({ className, ...props }) {
|
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
486
|
function SidebarMenuSkeleton({ className, showIcon = false, ...props }) {
|
|
487
|
-
const width = React
|
|
487
|
+
const width = React.useMemo(() => {
|
|
488
488
|
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
489
489
|
}, []);
|
|
490
490
|
return /* @__PURE__ */ jsxs("div", {
|
package/dist/skeleton/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Skeleton } from "../skeleton-
|
|
1
|
+
import { t as Skeleton } from "../skeleton-CxAhQT6T.mjs";
|
|
2
2
|
export { Skeleton };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cn } from "./cn-D2KYQ917.mjs";
|
|
2
|
-
import { t as Skeleton$1 } from "./skeleton-
|
|
2
|
+
import { t as Skeleton$1 } from "./skeleton-B1NOdZGM.mjs";
|
|
3
3
|
import "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/base/skeleton/skeleton.tsx
|
package/dist/stepper/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as defineStepper } from "../stepper-
|
|
1
|
+
import { t as defineStepper } from "../stepper-adDdiJMx.mjs";
|
|
2
2
|
export { defineStepper };
|