@mortenbrudvik/waveui 0.11.0 → 0.13.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 +157 -13
- package/dist/components/button/Link.cjs +1 -1
- package/dist/components/button/Link.cjs.map +1 -1
- package/dist/components/button/Link.mjs +4 -4
- package/dist/components/data-display/Avatar.cjs +1 -1
- package/dist/components/data-display/Avatar.cjs.map +1 -1
- package/dist/components/data-display/Avatar.colors.cjs +2 -0
- package/dist/components/data-display/Avatar.colors.cjs.map +1 -0
- package/dist/components/data-display/Avatar.colors.mjs +45 -0
- package/dist/components/data-display/Avatar.colors.mjs.map +1 -0
- package/dist/components/data-display/Avatar.context.cjs +1 -1
- package/dist/components/data-display/Avatar.context.cjs.map +1 -1
- package/dist/components/data-display/Avatar.context.mjs +4 -2
- package/dist/components/data-display/Avatar.context.mjs.map +1 -1
- package/dist/components/data-display/Avatar.mjs +103 -96
- package/dist/components/data-display/Avatar.mjs.map +1 -1
- package/dist/components/data-display/Avatar.sizes.cjs +2 -0
- package/dist/components/data-display/Avatar.sizes.cjs.map +1 -0
- package/dist/components/data-display/Avatar.sizes.mjs +41 -0
- package/dist/components/data-display/Avatar.sizes.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.cjs +1 -1
- package/dist/components/data-display/AvatarGroup.cjs.map +1 -1
- package/dist/components/data-display/AvatarGroup.context.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.context.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.context.mjs +9 -0
- package/dist/components/data-display/AvatarGroup.context.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.mjs +65 -122
- package/dist/components/data-display/AvatarGroup.mjs.map +1 -1
- package/dist/components/data-display/AvatarGroup.partition.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.partition.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.partition.mjs +14 -0
- package/dist/components/data-display/AvatarGroup.partition.mjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.parts.cjs +2 -0
- package/dist/components/data-display/AvatarGroup.parts.cjs.map +1 -0
- package/dist/components/data-display/AvatarGroup.parts.mjs +178 -0
- package/dist/components/data-display/AvatarGroup.parts.mjs.map +1 -0
- package/dist/components/data-display/InfoButton.cjs +1 -1
- package/dist/components/data-display/InfoButton.cjs.map +1 -1
- package/dist/components/data-display/InfoButton.mjs +12 -12
- package/dist/components/data-display/InteractionTag.cjs +1 -1
- package/dist/components/data-display/InteractionTag.cjs.map +1 -1
- package/dist/components/data-display/InteractionTag.mjs +36 -33
- package/dist/components/data-display/InteractionTag.mjs.map +1 -1
- package/dist/components/data-display/Persona.cjs +1 -1
- package/dist/components/data-display/Persona.cjs.map +1 -1
- package/dist/components/data-display/Persona.mjs +96 -37
- package/dist/components/data-display/Persona.mjs.map +1 -1
- package/dist/components/data-display/PresenceBadge.cjs +1 -1
- package/dist/components/data-display/PresenceBadge.cjs.map +1 -1
- package/dist/components/data-display/PresenceBadge.mjs +42 -28
- package/dist/components/data-display/PresenceBadge.mjs.map +1 -1
- package/dist/components/data-display/Tag.cjs +1 -1
- package/dist/components/data-display/Tag.cjs.map +1 -1
- package/dist/components/data-display/Tag.mjs +111 -108
- package/dist/components/data-display/Tag.mjs.map +1 -1
- package/dist/components/feedback/Toaster.cjs +1 -1
- package/dist/components/feedback/Toaster.cjs.map +1 -1
- package/dist/components/feedback/Toaster.mjs +235 -235
- package/dist/components/feedback/Toaster.mjs.map +1 -1
- package/dist/components/input/Combobox.cjs +1 -1
- package/dist/components/input/Combobox.cjs.map +1 -1
- package/dist/components/input/Combobox.mjs +176 -175
- package/dist/components/input/Combobox.mjs.map +1 -1
- package/dist/components/input/DatePicker.cjs +1 -1
- package/dist/components/input/DatePicker.cjs.map +1 -1
- package/dist/components/input/DatePicker.mjs +188 -187
- package/dist/components/input/DatePicker.mjs.map +1 -1
- package/dist/components/input/Dropdown.cjs +1 -1
- package/dist/components/input/Dropdown.cjs.map +1 -1
- package/dist/components/input/Dropdown.mjs +41 -40
- package/dist/components/input/Dropdown.mjs.map +1 -1
- package/dist/components/input/Option.cjs +1 -1
- package/dist/components/input/Option.cjs.map +1 -1
- package/dist/components/input/Option.mjs +89 -87
- package/dist/components/input/Option.mjs.map +1 -1
- package/dist/components/input/TagPicker.root.cjs +1 -1
- package/dist/components/input/TagPicker.root.cjs.map +1 -1
- package/dist/components/input/TagPicker.root.mjs +136 -135
- package/dist/components/input/TagPicker.root.mjs.map +1 -1
- package/dist/components/input/TimePicker.cjs +1 -1
- package/dist/components/input/TimePicker.cjs.map +1 -1
- package/dist/components/input/TimePicker.mjs +156 -154
- package/dist/components/input/TimePicker.mjs.map +1 -1
- package/dist/components/layout/Card.cjs +1 -1
- package/dist/components/layout/Card.cjs.map +1 -1
- package/dist/components/layout/Card.context.cjs +2 -0
- package/dist/components/layout/Card.context.cjs.map +1 -0
- package/dist/components/layout/Card.context.mjs +14 -0
- package/dist/components/layout/Card.context.mjs.map +1 -0
- package/dist/components/layout/Card.mjs +138 -92
- package/dist/components/layout/Card.mjs.map +1 -1
- package/dist/components/layout/Card.preview.cjs +2 -0
- package/dist/components/layout/Card.preview.cjs.map +1 -0
- package/dist/components/layout/Card.preview.mjs +22 -0
- package/dist/components/layout/Card.preview.mjs.map +1 -0
- package/dist/components/layout/Carousel.button.cjs +2 -0
- package/dist/components/layout/Carousel.button.cjs.map +1 -0
- package/dist/components/layout/Carousel.button.mjs +34 -0
- package/dist/components/layout/Carousel.button.mjs.map +1 -0
- package/dist/components/layout/Carousel.cjs +1 -1
- package/dist/components/layout/Carousel.cjs.map +1 -1
- package/dist/components/layout/Carousel.context.cjs +2 -0
- package/dist/components/layout/Carousel.context.cjs.map +1 -0
- package/dist/components/layout/Carousel.context.mjs +24 -0
- package/dist/components/layout/Carousel.context.mjs.map +1 -0
- package/dist/components/layout/Carousel.drag.cjs +2 -0
- package/dist/components/layout/Carousel.drag.cjs.map +1 -0
- package/dist/components/layout/Carousel.drag.mjs +79 -0
- package/dist/components/layout/Carousel.drag.mjs.map +1 -0
- package/dist/components/layout/Carousel.groups.cjs +2 -0
- package/dist/components/layout/Carousel.groups.cjs.map +1 -0
- package/dist/components/layout/Carousel.groups.mjs +23 -0
- package/dist/components/layout/Carousel.groups.mjs.map +1 -0
- package/dist/components/layout/Carousel.mjs +288 -150
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/Carousel.styles.cjs +2 -0
- package/dist/components/layout/Carousel.styles.cjs.map +1 -0
- package/dist/components/layout/Carousel.styles.mjs +30 -0
- package/dist/components/layout/Carousel.styles.mjs.map +1 -0
- package/dist/components/layout/TabList.cjs +1 -1
- package/dist/components/layout/TabList.cjs.map +1 -1
- package/dist/components/layout/TabList.mjs +163 -124
- package/dist/components/layout/TabList.mjs.map +1 -1
- package/dist/components/navigation/Menu.popover.cjs +1 -1
- package/dist/components/navigation/Menu.popover.cjs.map +1 -1
- package/dist/components/navigation/Menu.popover.mjs +137 -127
- package/dist/components/navigation/Menu.popover.mjs.map +1 -1
- package/dist/components/navigation/Menu.root.cjs +1 -1
- package/dist/components/navigation/Menu.root.cjs.map +1 -1
- package/dist/components/navigation/Menu.root.mjs +4 -4
- package/dist/components/overlays/Dialog.cjs +1 -1
- package/dist/components/overlays/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog.mjs +123 -123
- package/dist/components/overlays/Dialog.mjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.cjs +1 -1
- package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.mjs +12 -12
- package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
- package/dist/components/overlays/Popover.cjs +1 -1
- package/dist/components/overlays/Popover.cjs.map +1 -1
- package/dist/components/overlays/Popover.mjs +173 -162
- package/dist/components/overlays/Popover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.mjs +96 -91
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
- package/dist/components/overlays/Tooltip.cjs +1 -1
- package/dist/components/overlays/Tooltip.cjs.map +1 -1
- package/dist/components/overlays/Tooltip.mjs +47 -47
- package/dist/components/overlays/Tooltip.mjs.map +1 -1
- package/dist/components/portal/Portal.cjs +1 -1
- package/dist/components/portal/Portal.cjs.map +1 -1
- package/dist/components/portal/Portal.mjs +5 -5
- package/dist/components/table/DataGrid.cjs +1 -1
- package/dist/components/table/DataGrid.cjs.map +1 -1
- package/dist/components/table/DataGrid.mjs +1 -1
- package/dist/hooks/useDismiss.cjs.map +1 -1
- package/dist/hooks/useDismiss.mjs.map +1 -1
- package/dist/hooks/useFocusTrap.cjs.map +1 -1
- package/dist/hooks/useFocusTrap.mjs.map +1 -1
- package/dist/hooks/useFocusVisible.cjs +2 -0
- package/dist/hooks/useFocusVisible.cjs.map +1 -0
- package/dist/hooks/useFocusVisible.mjs +49 -0
- package/dist/hooks/useFocusVisible.mjs.map +1 -0
- package/dist/hooks/useFocusableGroup.cjs +2 -0
- package/dist/hooks/useFocusableGroup.cjs.map +1 -0
- package/dist/hooks/useFocusableGroup.mjs +70 -0
- package/dist/hooks/useFocusableGroup.mjs.map +1 -0
- package/dist/hooks/useModalLayer.cjs +1 -1
- package/dist/hooks/useModalLayer.cjs.map +1 -1
- package/dist/hooks/useModalLayer.mjs +4 -4
- package/dist/hooks/useModalOpen.cjs +2 -0
- package/dist/hooks/useModalOpen.cjs.map +1 -0
- package/dist/hooks/useModalOpen.mjs +14 -0
- package/dist/hooks/useModalOpen.mjs.map +1 -0
- package/dist/hooks/usePopupPosition.cjs +1 -1
- package/dist/hooks/usePopupPosition.cjs.map +1 -1
- package/dist/hooks/usePopupPosition.mjs +82 -53
- package/dist/hooks/usePopupPosition.mjs.map +1 -1
- package/dist/hooks/useResolvedTarget.cjs +2 -0
- package/dist/hooks/useResolvedTarget.cjs.map +1 -0
- package/dist/hooks/useResolvedTarget.mjs +37 -0
- package/dist/hooks/useResolvedTarget.mjs.map +1 -0
- package/dist/hooks/useRovingGrid.cjs +1 -1
- package/dist/hooks/useRovingGrid.cjs.map +1 -1
- package/dist/hooks/useRovingGrid.mjs +8 -57
- package/dist/hooks/useRovingGrid.mjs.map +1 -1
- package/dist/hooks/useRovingTabIndex.cjs +1 -1
- package/dist/hooks/useRovingTabIndex.cjs.map +1 -1
- package/dist/hooks/useRovingTabIndex.mjs +142 -107
- package/dist/hooks/useRovingTabIndex.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1364 -66
- package/dist/index.d.ts +1364 -66
- package/dist/index.mjs +132 -115
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +112 -92
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/initials.cjs +2 -0
- package/dist/lib/initials.cjs.map +1 -0
- package/dist/lib/initials.mjs +21 -0
- package/dist/lib/initials.mjs.map +1 -0
- package/dist/lib/layers.cjs +1 -1
- package/dist/lib/layers.cjs.map +1 -1
- package/dist/lib/layers.mjs +112 -109
- package/dist/lib/layers.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/styles/tokens.css +102 -0
|
@@ -7,29 +7,29 @@ import { isSameDay as ee, startOfDay as a } from "../../lib/date.mjs";
|
|
|
7
7
|
import { useControllable as o } from "../../hooks/useControllable.mjs";
|
|
8
8
|
import { useId as s } from "../../hooks/useId.mjs";
|
|
9
9
|
import { FOCUSABLE_SELECTOR as te } from "../../lib/focus.mjs";
|
|
10
|
-
import { useMergedRefs as
|
|
11
|
-
import { useIsClient as
|
|
12
|
-
import { joinIds as
|
|
13
|
-
import { useFieldContext as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { CalendarView as
|
|
28
|
-
import * as
|
|
29
|
-
import { jsx as
|
|
30
|
-
import { flushSync as
|
|
10
|
+
import { useMergedRefs as c } from "../../hooks/useMergedRefs.mjs";
|
|
11
|
+
import { useIsClient as ne } from "../../hooks/useIsClient.mjs";
|
|
12
|
+
import { joinIds as re } from "../../lib/aria.mjs";
|
|
13
|
+
import { useFieldContext as ie, useFieldControl as ae } from "../../hooks/useFieldControl.mjs";
|
|
14
|
+
import { resolvePositioning as oe, usePopupPosition as se } from "../../hooks/usePopupPosition.mjs";
|
|
15
|
+
import { useDismiss as ce } from "../../hooks/useDismiss.mjs";
|
|
16
|
+
import { useFocusTrap as le } from "../../hooks/useFocusTrap.mjs";
|
|
17
|
+
import { useRestoreFocus as ue } from "../../hooks/useRestoreFocus.mjs";
|
|
18
|
+
import { disabledStyles as de, focusRing as fe, inputAppearanceClasses as pe, inputFocus as me, inputHeightClasses as he, inputPaddingClasses as ge, inputTextClasses as _e } from "../../lib/styles.mjs";
|
|
19
|
+
import { Portal as ve } from "../portal/Portal.mjs";
|
|
20
|
+
import { CalendarIcon as ye, DismissIcon as be } from "../../lib/icons.mjs";
|
|
21
|
+
import { useInputLook as xe } from "./inputLook.mjs";
|
|
22
|
+
import { isInvalidLook as Se } from "./Input.mjs";
|
|
23
|
+
import { useFormReset as Ce } from "../../hooks/useFormReset.mjs";
|
|
24
|
+
import { HiddenInput as we } from "../internal/HiddenInput.mjs";
|
|
25
|
+
import { pickerButtonOffset as Te, pickerEndPadding as Ee, pickerGlyphSize as De, pickerIconButtonClasses as Oe } from "./pickerStyles.mjs";
|
|
26
|
+
import { formatDate as ke, formatISODate as Ae, getLocaleDateFormat as je, isDateInRange as Me, isValidLocaleTag as Ne, parseDate as Pe } from "./dateUtils.mjs";
|
|
27
|
+
import { CalendarView as Fe } from "./Calendar.mjs";
|
|
28
|
+
import * as l from "react";
|
|
29
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
30
|
+
import { flushSync as Ie } from "react-dom";
|
|
31
31
|
//#region src/components/input/DatePicker.tsx
|
|
32
|
-
var
|
|
32
|
+
var Le = (e) => e ? `Enter a date in the format ${e}.` : "Enter a valid date.", Re = (e, t) => e !== void 0 && t !== void 0 ? `Enter a date between ${e} and ${t}.` : e === void 0 ? `Enter a date on or before ${t}.` : `Enter a date on or after ${e}.`, ze = {
|
|
33
33
|
header: i.header,
|
|
34
34
|
previousMonthButton: i.previousMonthButton,
|
|
35
35
|
heading: i.heading,
|
|
@@ -46,215 +46,216 @@ var Ne = (e) => e ? `Enter a date in the format ${e}.` : "Enter a valid date.",
|
|
|
46
46
|
footer: i.footer,
|
|
47
47
|
todayButton: i.todayButton,
|
|
48
48
|
closeButton: i.closeButton
|
|
49
|
-
},
|
|
50
|
-
let { value:
|
|
51
|
-
|
|
52
|
-
let { size: D, appearance: O } =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
let [
|
|
59
|
-
|
|
60
|
-
}),
|
|
61
|
-
|
|
62
|
-
!
|
|
49
|
+
}, f = (f) => {
|
|
50
|
+
let { value: Be, defaultValue: p, onValueChange: Ve, onChange: m, formatDate: h, parseDate: g, locale: _, minDate: v, maxDate: y, disabledDates: b, placeholder: He = "Select a date", disabled: x = !1, size: Ue, positioning: We, appearance: Ge, readOnly: S, clearable: Ke = !1, firstDayOfWeek: qe = 0, today: Je, initialVisibleDate: Ye, showMonthPicker: Xe, showWeekNumbers: Ze, firstWeekOfYear: Qe, showGoToToday: $e, showCloseButton: et = !1, markedDates: tt, renderDay: nt, dayLabel: rt, open: C, defaultOpen: it, onOpenChange: at, onInvalidInput: ot, labels: w, name: st, form: T, required: E, autoComplete: ct = "off", autoCapitalize: lt, autoCorrect: ut, enterKeyHint: dt, inputMode: ft, spellCheck: pt, autoFocus: mt, tabIndex: ht, id: gt, "aria-label": _t, "aria-labelledby": vt, "aria-describedby": yt, "aria-invalid": bt, "aria-required": xt, "aria-errormessage": St, "aria-details": Ct, onFocus: wt, onBlur: Tt, onKeyDown: Et, onKeyUp: Dt, controlRef: Ot, className: kt, ref: At, ...jt } = f;
|
|
51
|
+
m !== void 0 && t("DatePicker", "onChange", "onValueChange");
|
|
52
|
+
let { size: D, appearance: O } = xe(Ue, Ge), Mt = h !== void 0, k = g !== void 0;
|
|
53
|
+
l.useEffect(() => {
|
|
54
|
+
Mt && !k && n("DatePicker:formatDate-without-parseDate", "DatePicker: `formatDate` is set without `parseDate`. Typed dates are parsed with the default parser for `locale` (its numeric format or yyyy-mm-dd), which may not read your format; pass `parseDate` as the inverse of `formatDate`.");
|
|
55
|
+
}, [Mt, k]), l.useEffect(() => {
|
|
56
|
+
_ !== void 0 && !Ne(_) && n(`DatePicker:invalid-locale:${_}`, `DatePicker: \`locale\` "${_}" is not a valid BCP 47 language tag (use hyphens, as in "en-US"). The runtime default locale formats and parses the dates instead, so the server and the browser may render different text.`);
|
|
57
|
+
}, [_]);
|
|
58
|
+
let [A, Nt] = o(Be, p ?? null, (e) => {
|
|
59
|
+
Ve?.(e), m?.(e);
|
|
60
|
+
}), j = !x && !S, [M, N] = o(C, (it ?? !1) && j, at), Pt = ne(), P = M && j && Pt, Ft = C !== void 0;
|
|
61
|
+
l.useEffect(() => {
|
|
62
|
+
!j && M && !Ft && N(!1);
|
|
63
63
|
}, [
|
|
64
|
+
j,
|
|
64
65
|
M,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
P
|
|
66
|
+
Ft,
|
|
67
|
+
N
|
|
68
68
|
]);
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
let
|
|
69
|
+
let F = (e) => h ? h(e) : ke(e, _), It = (e) => g ? g(e) : Pe(e, _), [I, L] = l.useState(null), [R, z] = l.useState(null), [Lt, Rt] = l.useState(j);
|
|
70
|
+
Lt !== j && (Rt(j), j || (L(null), z(null)));
|
|
71
|
+
let B = A ? Ae(A) : "", [zt, Bt] = l.useState(B);
|
|
72
|
+
zt !== B && (Bt(B), R !== null && (L(null), z(null)));
|
|
73
|
+
let V = (e) => {
|
|
74
74
|
let t = e ? a(e) : null;
|
|
75
|
-
(t ? ee(t,
|
|
76
|
-
},
|
|
77
|
-
if (!e.trim()) return
|
|
78
|
-
let t =
|
|
79
|
-
if (!t || Number.isNaN(t.getTime()) ? n = "unparseable" :
|
|
75
|
+
(t ? ee(t, A) : A === null) || Nt(t), L(null), z(null);
|
|
76
|
+
}, H = (e) => {
|
|
77
|
+
if (!e.trim()) return V(null), !0;
|
|
78
|
+
let t = It(e), n = null;
|
|
79
|
+
if (!t || Number.isNaN(t.getTime()) ? n = "unparseable" : Me(t, v, y) ? b?.(a(t)) && (n = "disabled") : n = "out-of-range", n || !t) {
|
|
80
80
|
let t = n ?? "unparseable";
|
|
81
|
-
return
|
|
81
|
+
return z(t), ot?.(e, t), !1;
|
|
82
82
|
}
|
|
83
|
-
return
|
|
84
|
-
}, [
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
}, { layerId:
|
|
89
|
-
open:
|
|
83
|
+
return V(t), !0;
|
|
84
|
+
}, [U, W] = l.useState(!1);
|
|
85
|
+
U && !P && W(!1);
|
|
86
|
+
let G = l.useRef(null), K = l.useRef(null), q = l.useRef(null), J = l.useRef(null), [Vt, Ht] = l.useState(null), Ut = c(Ot, G), Y = s("datepicker-dialog"), Wt = s("datepicker-heading"), Gt = s("datepicker-error"), X = (e) => {
|
|
87
|
+
J.current = e, N(!1);
|
|
88
|
+
}, { layerId: Kt } = ce({
|
|
89
|
+
open: P,
|
|
90
90
|
onDismiss: (e, t) => {
|
|
91
91
|
let n = e === "outside-press" && t.target instanceof Element ? t.target.closest(te) : null;
|
|
92
|
-
|
|
92
|
+
X(n ?? (U ? G.current : null));
|
|
93
93
|
},
|
|
94
|
-
refs: [
|
|
95
|
-
anchorRef:
|
|
94
|
+
refs: [q, K],
|
|
95
|
+
anchorRef: K,
|
|
96
96
|
kind: "modal"
|
|
97
|
-
}), { setReference:
|
|
98
|
-
open:
|
|
97
|
+
}), { setReference: qt, setFloating: Jt, floatingProps: Yt } = se({
|
|
98
|
+
open: P,
|
|
99
99
|
side: "bottom",
|
|
100
|
-
align: "start"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
100
|
+
align: "start",
|
|
101
|
+
...oe(We, {})
|
|
102
|
+
}), Xt = c(q, Ht, Jt);
|
|
103
|
+
le(Vt, {
|
|
104
|
+
enabled: P,
|
|
105
|
+
layerId: Kt,
|
|
106
|
+
initialFocus: () => q.current?.querySelector("[data-wave-calendar-grid] button[tabindex=\"0\"]") ?? null
|
|
107
|
+
}), ue({
|
|
108
|
+
enabled: P,
|
|
109
|
+
container: Vt,
|
|
110
|
+
triggerRef: K,
|
|
111
|
+
finalFocusRef: J,
|
|
111
112
|
onlyIfFocusInside: !0
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
let
|
|
116
|
-
id:
|
|
117
|
-
"aria-label":
|
|
118
|
-
"aria-labelledby":
|
|
119
|
-
"aria-describedby":
|
|
120
|
-
"aria-invalid":
|
|
121
|
-
"aria-required":
|
|
122
|
-
}),
|
|
123
|
-
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
}),
|
|
129
|
-
|
|
130
|
-
}),
|
|
131
|
-
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
},
|
|
113
|
+
}), l.useLayoutEffect(() => {
|
|
114
|
+
P && (J.current = null);
|
|
115
|
+
}, [P]);
|
|
116
|
+
let Zt = ie(), Qt = (E ?? Zt?.required ?? !1) && !S, $t = R !== null && !Zt?.hasErrorMessage, en = ae({
|
|
117
|
+
id: gt,
|
|
118
|
+
"aria-label": _t,
|
|
119
|
+
"aria-labelledby": vt,
|
|
120
|
+
"aria-describedby": re(yt, $t ? Gt : void 0),
|
|
121
|
+
"aria-invalid": R !== null || bt,
|
|
122
|
+
"aria-required": xt ?? E
|
|
123
|
+
}), tn = Se(!1, en["aria-invalid"]);
|
|
124
|
+
Ce(G, () => V(p ?? null), T);
|
|
125
|
+
let Z = Ke && !S && A !== null, nn = (e) => {
|
|
126
|
+
j && (L(e.target.value), z(null));
|
|
127
|
+
}, rn = r(Et, (e) => {
|
|
128
|
+
j && !e.nativeEvent.isComposing && (e.key === "Enter" && I !== null ? (e.preventDefault(), H(I)) : e.key === "Tab" && !e.shiftKey && Z && I !== null && !I.trim() ? Ie(() => H(I)) : e.key === "ArrowDown" && e.altKey && !P && (e.preventDefault(), I !== null && R === null && H(I), W(!0), N(!0)));
|
|
129
|
+
}), an = r(Tt, () => {
|
|
130
|
+
j && I !== null && R === null && H(I);
|
|
131
|
+
}), on = () => {
|
|
132
|
+
j && (J.current = null, W(!1), N(!P));
|
|
133
|
+
}, sn = () => {
|
|
134
|
+
j && (V(null), G.current?.focus());
|
|
135
|
+
}, cn = (e) => {
|
|
135
136
|
e.preventDefault();
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
e.key !== "Escape" || e.defaultPrevented || e.nativeEvent.isComposing || (e.preventDefault(),
|
|
140
|
-
},
|
|
141
|
-
return
|
|
137
|
+
}, ln = (e) => {
|
|
138
|
+
j && (V(e), X(G.current));
|
|
139
|
+
}, Q = () => X(U ? G.current : null), un = (e) => {
|
|
140
|
+
e.key !== "Escape" || e.defaultPrevented || e.nativeEvent.isComposing || (e.preventDefault(), Q());
|
|
141
|
+
}, dn = I ?? (A ? F(A) : ""), $ = "";
|
|
142
|
+
return R === "unparseable" ? $ = (w?.invalidDate ?? Le)(k ? void 0 : je(_).pattern) : R === "out-of-range" && (v || y) ? $ = (w?.outOfRange ?? Re)(v ? F(a(v)) : void 0, y ? F(a(y)) : void 0) : R === "disabled" && ($ = w?.unavailableDate ?? "This date is not available."), /* @__PURE__ */ d("div", {
|
|
142
143
|
"data-size": D,
|
|
143
144
|
"data-appearance": O,
|
|
144
|
-
...
|
|
145
|
-
ref:
|
|
146
|
-
className: e(i.root, "relative inline-flex flex-col",
|
|
145
|
+
...jt,
|
|
146
|
+
ref: At,
|
|
147
|
+
className: e(i.root, "relative inline-flex flex-col", kt),
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
ref:
|
|
149
|
+
/* @__PURE__ */ d("div", {
|
|
150
|
+
ref: qt,
|
|
150
151
|
className: "relative flex items-center",
|
|
151
152
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
ref:
|
|
153
|
+
/* @__PURE__ */ u("input", {
|
|
154
|
+
ref: Ut,
|
|
154
155
|
type: "text",
|
|
155
|
-
...
|
|
156
|
-
"aria-errormessage":
|
|
157
|
-
"aria-details":
|
|
158
|
-
value:
|
|
159
|
-
onChange:
|
|
160
|
-
onFocus:
|
|
161
|
-
onBlur:
|
|
162
|
-
onKeyDown:
|
|
163
|
-
onKeyUp:
|
|
164
|
-
placeholder:
|
|
165
|
-
disabled:
|
|
166
|
-
readOnly:
|
|
167
|
-
autoComplete:
|
|
168
|
-
autoCapitalize:
|
|
169
|
-
autoCorrect:
|
|
170
|
-
enterKeyHint:
|
|
171
|
-
inputMode:
|
|
172
|
-
spellCheck:
|
|
173
|
-
autoFocus:
|
|
174
|
-
tabIndex:
|
|
175
|
-
className: e(i.input,
|
|
156
|
+
...en,
|
|
157
|
+
"aria-errormessage": St,
|
|
158
|
+
"aria-details": Ct,
|
|
159
|
+
value: dn,
|
|
160
|
+
onChange: nn,
|
|
161
|
+
onFocus: wt,
|
|
162
|
+
onBlur: an,
|
|
163
|
+
onKeyDown: rn,
|
|
164
|
+
onKeyUp: Dt,
|
|
165
|
+
placeholder: He,
|
|
166
|
+
disabled: x,
|
|
167
|
+
readOnly: S,
|
|
168
|
+
autoComplete: ct,
|
|
169
|
+
autoCapitalize: lt,
|
|
170
|
+
autoCorrect: ut,
|
|
171
|
+
enterKeyHint: dt,
|
|
172
|
+
inputMode: ft,
|
|
173
|
+
spellCheck: pt,
|
|
174
|
+
autoFocus: mt,
|
|
175
|
+
tabIndex: ht,
|
|
176
|
+
className: e(i.input, he[D], "w-full", ge[D], _e[D], pe[O], "text-foreground placeholder:text-muted-foreground", me, de, tn && "border-destructive", Ee(Z ? 2 : 1, D))
|
|
176
177
|
}),
|
|
177
|
-
|
|
178
|
+
Z && /* @__PURE__ */ u("button", {
|
|
178
179
|
type: "button",
|
|
179
|
-
"aria-label":
|
|
180
|
-
disabled:
|
|
181
|
-
onMouseDown:
|
|
182
|
-
onClick:
|
|
183
|
-
className: e(i.clearButton,
|
|
184
|
-
children: /* @__PURE__ */
|
|
180
|
+
"aria-label": w?.clear ?? "Clear date",
|
|
181
|
+
disabled: x,
|
|
182
|
+
onMouseDown: cn,
|
|
183
|
+
onClick: sn,
|
|
184
|
+
className: e(i.clearButton, Oe(D, O), Te(D, 2), "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", "disabled:cursor-not-allowed disabled:opacity-50 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:focus-visible:opacity-100"),
|
|
185
|
+
children: /* @__PURE__ */ u(be, { size: De(D, "icon") })
|
|
185
186
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
ref:
|
|
187
|
+
/* @__PURE__ */ u("button", {
|
|
188
|
+
ref: K,
|
|
188
189
|
type: "button",
|
|
189
|
-
"aria-label":
|
|
190
|
+
"aria-label": w?.openCalendar ?? "Open calendar",
|
|
190
191
|
"aria-haspopup": "dialog",
|
|
191
|
-
"aria-expanded":
|
|
192
|
-
"aria-controls":
|
|
193
|
-
disabled:
|
|
194
|
-
onClick:
|
|
195
|
-
className: e(i.openCalendarButton,
|
|
196
|
-
children: /* @__PURE__ */
|
|
192
|
+
"aria-expanded": P,
|
|
193
|
+
"aria-controls": P ? Y : void 0,
|
|
194
|
+
disabled: x || S,
|
|
195
|
+
onClick: on,
|
|
196
|
+
className: e(i.openCalendarButton, Oe(D, O), Te(D, 1), fe, de),
|
|
197
|
+
children: /* @__PURE__ */ u(ye, { size: De(D, "icon") })
|
|
197
198
|
})
|
|
198
199
|
]
|
|
199
200
|
}),
|
|
200
|
-
|
|
201
|
-
id:
|
|
201
|
+
$t && /* @__PURE__ */ u("p", {
|
|
202
|
+
id: Gt,
|
|
202
203
|
role: "alert",
|
|
203
204
|
className: e(i.errorMessage, "mt-1 text-caption-1 text-error"),
|
|
204
205
|
children: $
|
|
205
206
|
}),
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
name:
|
|
208
|
-
form:
|
|
209
|
-
disabled:
|
|
210
|
-
value:
|
|
207
|
+
/* @__PURE__ */ u(we, {
|
|
208
|
+
name: st,
|
|
209
|
+
form: T,
|
|
210
|
+
disabled: x,
|
|
211
|
+
value: A ? Ae(A) : "",
|
|
211
212
|
type: "text",
|
|
212
|
-
required:
|
|
213
|
-
onInvalid: () =>
|
|
213
|
+
required: Qt,
|
|
214
|
+
onInvalid: () => G.current?.focus()
|
|
214
215
|
}),
|
|
215
|
-
|
|
216
|
-
layerId:
|
|
217
|
-
children: /* @__PURE__ */
|
|
218
|
-
ref:
|
|
219
|
-
id:
|
|
216
|
+
P && /* @__PURE__ */ u(ve, {
|
|
217
|
+
layerId: Kt,
|
|
218
|
+
children: /* @__PURE__ */ u("div", {
|
|
219
|
+
ref: Xt,
|
|
220
|
+
id: Y,
|
|
220
221
|
role: "dialog",
|
|
221
222
|
"aria-modal": "true",
|
|
222
|
-
"aria-labelledby":
|
|
223
|
-
...
|
|
223
|
+
"aria-labelledby": Wt,
|
|
224
|
+
...Yt,
|
|
224
225
|
"data-state": "open",
|
|
225
|
-
onKeyDown:
|
|
226
|
+
onKeyDown: un,
|
|
226
227
|
className: e(i.surface, "rounded-md border border-border bg-background p-3 text-foreground shadow-16"),
|
|
227
|
-
children: /* @__PURE__ */
|
|
228
|
-
value:
|
|
229
|
-
onPick:
|
|
230
|
-
minDate:
|
|
231
|
-
maxDate:
|
|
232
|
-
disabledDates:
|
|
233
|
-
firstDayOfWeek:
|
|
234
|
-
locale:
|
|
235
|
-
today:
|
|
236
|
-
initialVisibleDate:
|
|
237
|
-
showMonthPicker:
|
|
238
|
-
showWeekNumbers:
|
|
239
|
-
firstWeekOfYear:
|
|
240
|
-
showGoToToday:
|
|
241
|
-
markedDates:
|
|
242
|
-
renderDay:
|
|
243
|
-
dayLabel:
|
|
244
|
-
onClose:
|
|
245
|
-
closeLabel:
|
|
246
|
-
labels:
|
|
228
|
+
children: /* @__PURE__ */ u(Fe, {
|
|
229
|
+
value: A,
|
|
230
|
+
onPick: ln,
|
|
231
|
+
minDate: v,
|
|
232
|
+
maxDate: y,
|
|
233
|
+
disabledDates: b,
|
|
234
|
+
firstDayOfWeek: qe,
|
|
235
|
+
locale: _,
|
|
236
|
+
today: Je,
|
|
237
|
+
initialVisibleDate: Ye,
|
|
238
|
+
showMonthPicker: Xe,
|
|
239
|
+
showWeekNumbers: Ze,
|
|
240
|
+
firstWeekOfYear: Qe,
|
|
241
|
+
showGoToToday: $e,
|
|
242
|
+
markedDates: tt,
|
|
243
|
+
renderDay: nt,
|
|
244
|
+
dayLabel: rt,
|
|
245
|
+
onClose: et ? Q : void 0,
|
|
246
|
+
closeLabel: w?.close,
|
|
247
|
+
labels: w,
|
|
247
248
|
headingAs: "h2",
|
|
248
|
-
headingId:
|
|
249
|
-
partClassNames:
|
|
249
|
+
headingId: Wt,
|
|
250
|
+
partClassNames: ze
|
|
250
251
|
})
|
|
251
252
|
})
|
|
252
253
|
})
|
|
253
254
|
]
|
|
254
255
|
});
|
|
255
256
|
};
|
|
256
|
-
|
|
257
|
+
f.displayName = "DatePicker";
|
|
257
258
|
//#endregion
|
|
258
|
-
export {
|
|
259
|
+
export { f as DatePicker };
|
|
259
260
|
|
|
260
261
|
//# sourceMappingURL=DatePicker.mjs.map
|