@krizaka/ui 2.3.0 → 2.4.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 +16 -1
- package/dist/audio-player.d.ts +113 -0
- package/dist/audio-player.js +207 -0
- package/dist/audio-player.js.map +1 -0
- package/dist/chunk-2USC2YT6.js +17 -0
- package/dist/chunk-2USC2YT6.js.map +1 -0
- package/dist/chunk-EUPTXKH7.js +95 -0
- package/dist/chunk-EUPTXKH7.js.map +1 -0
- package/dist/chunk-RUPRYJ45.js +82 -0
- package/dist/chunk-RUPRYJ45.js.map +1 -0
- package/dist/chunk-XUMJA5ZI.js +283 -0
- package/dist/chunk-XUMJA5ZI.js.map +1 -0
- package/dist/chunk-YH4LMWRU.js +92 -0
- package/dist/chunk-YH4LMWRU.js.map +1 -0
- package/dist/chunk-YX6CNVJA.js +94 -0
- package/dist/chunk-YX6CNVJA.js.map +1 -0
- package/dist/chunk-ZIXB33X7.js +95 -0
- package/dist/chunk-ZIXB33X7.js.map +1 -0
- package/dist/combobox.d.ts +188 -0
- package/dist/combobox.js +16 -0
- package/dist/combobox.js.map +1 -0
- package/dist/data-table.d.ts +246 -0
- package/dist/data-table.js +290 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-picker.d.ts +288 -0
- package/dist/date-picker.js +364 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/file-upload.d.ts +238 -0
- package/dist/file-upload.js +437 -0
- package/dist/file-upload.js.map +1 -0
- package/dist/filter-bar.d.ts +139 -0
- package/dist/filter-bar.js +155 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/image-cropper.d.ts +115 -0
- package/dist/image-cropper.js +166 -0
- package/dist/image-cropper.js.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/media-capture.d.ts +155 -0
- package/dist/media-capture.js +242 -0
- package/dist/media-capture.js.map +1 -0
- package/dist/native/media-capture.d.ts +49 -0
- package/dist/native/media-capture.js +113 -0
- package/dist/native/media-capture.js.map +1 -0
- package/dist/native/video-player.d.ts +50 -0
- package/dist/native/video-player.js +69 -0
- package/dist/native/video-player.js.map +1 -0
- package/dist/native.d.ts +66 -2
- package/dist/native.js +166 -68
- package/dist/native.js.map +1 -1
- package/dist/pagination.d.ts +141 -0
- package/dist/pagination.js +165 -0
- package/dist/pagination.js.map +1 -0
- package/dist/search-field.d.ts +100 -0
- package/dist/search-field.js +167 -0
- package/dist/search-field.js.map +1 -0
- package/dist/tag-input.d.ts +44 -0
- package/dist/tag-input.js +67 -0
- package/dist/tag-input.js.map +1 -0
- package/dist/video-player.d.ts +204 -0
- package/dist/video-player.js +371 -0
- package/dist/video-player.js.map +1 -0
- package/dist/video-trimmer.d.ts +142 -0
- package/dist/video-trimmer.js +193 -0
- package/dist/video-trimmer.js.map +1 -0
- package/package.json +232 -4
- package/registry/alert.json +1 -1
- package/registry/audio-player.json +282 -0
- package/registry/avatar.json +1 -1
- package/registry/badge.json +1 -1
- package/registry/button.json +1 -1
- package/registry/card.json +1 -1
- package/registry/checkbox.json +1 -1
- package/registry/chip-link.json +1 -1
- package/registry/chip.json +1 -1
- package/registry/combobox.json +475 -0
- package/registry/command.json +1 -1
- package/registry/confirm-button.json +1 -1
- package/registry/countdown.json +1 -1
- package/registry/data-table.json +500 -0
- package/registry/date-picker.json +978 -0
- package/registry/dialog.json +1 -1
- package/registry/dropdown-menu.json +1 -1
- package/registry/empty-state.json +1 -1
- package/registry/examples/audio-player/podcast.d.ts +4 -0
- package/registry/examples/audio-player/podcast.js +22 -0
- package/registry/examples/audio-player/podcast.tsx +19 -0
- package/registry/examples/audio-player/voice-note.d.ts +4 -0
- package/registry/examples/audio-player/voice-note.js +12 -0
- package/registry/examples/audio-player/voice-note.tsx +12 -0
- package/registry/examples/combobox/async.d.ts +4 -0
- package/registry/examples/combobox/async.js +23 -0
- package/registry/examples/combobox/async.tsx +22 -0
- package/registry/examples/combobox/creatable.d.ts +4 -0
- package/registry/examples/combobox/creatable.js +32 -0
- package/registry/examples/combobox/creatable.tsx +28 -0
- package/registry/examples/combobox/invalid.d.ts +4 -0
- package/registry/examples/combobox/invalid.js +23 -0
- package/registry/examples/combobox/invalid.tsx +17 -0
- package/registry/examples/combobox/multiple.d.ts +4 -0
- package/registry/examples/combobox/multiple.js +29 -0
- package/registry/examples/combobox/multiple.tsx +26 -0
- package/registry/examples/data-table/cards.d.ts +4 -0
- package/registry/examples/data-table/cards.js +21 -0
- package/registry/examples/data-table/cards.tsx +20 -0
- package/registry/examples/data-table/empty.d.ts +4 -0
- package/registry/examples/data-table/empty.js +26 -0
- package/registry/examples/data-table/empty.tsx +21 -0
- package/registry/examples/data-table/error.d.ts +4 -0
- package/registry/examples/data-table/error.js +28 -0
- package/registry/examples/data-table/error.tsx +29 -0
- package/registry/examples/data-table/jobs.d.ts +4 -0
- package/registry/examples/data-table/jobs.js +37 -0
- package/registry/examples/data-table/jobs.tsx +36 -0
- package/registry/examples/data-table/loading.d.ts +4 -0
- package/registry/examples/data-table/loading.js +16 -0
- package/registry/examples/data-table/loading.tsx +12 -0
- package/registry/examples/data-table/virtualized.d.ts +4 -0
- package/registry/examples/data-table/virtualized.js +21 -0
- package/registry/examples/data-table/virtualized.tsx +20 -0
- package/registry/examples/date-picker/calendar.d.ts +4 -0
- package/registry/examples/date-picker/calendar.js +14 -0
- package/registry/examples/date-picker/calendar.tsx +16 -0
- package/registry/examples/date-picker/french.d.ts +4 -0
- package/registry/examples/date-picker/french.js +20 -0
- package/registry/examples/date-picker/french.tsx +14 -0
- package/registry/examples/date-picker/open.d.ts +4 -0
- package/registry/examples/date-picker/open.js +11 -0
- package/registry/examples/date-picker/open.tsx +8 -0
- package/registry/examples/date-picker/range.d.ts +4 -0
- package/registry/examples/date-picker/range.js +29 -0
- package/registry/examples/date-picker/range.tsx +25 -0
- package/registry/examples/date-picker/schedule.d.ts +4 -0
- package/registry/examples/date-picker/schedule.js +26 -0
- package/registry/examples/date-picker/schedule.tsx +22 -0
- package/registry/examples/file-upload/images.d.ts +4 -0
- package/registry/examples/file-upload/images.js +32 -0
- package/registry/examples/file-upload/images.tsx +25 -0
- package/registry/examples/file-upload/states.d.ts +4 -0
- package/registry/examples/file-upload/states.js +28 -0
- package/registry/examples/file-upload/states.tsx +23 -0
- package/registry/examples/file-upload/tus.d.ts +4 -0
- package/registry/examples/file-upload/tus.js +23 -0
- package/registry/examples/file-upload/tus.tsx +26 -0
- package/registry/examples/file-upload/video.d.ts +4 -0
- package/registry/examples/file-upload/video.js +39 -0
- package/registry/examples/file-upload/video.tsx +36 -0
- package/registry/examples/filter-bar/address.d.ts +4 -0
- package/registry/examples/filter-bar/address.js +29 -0
- package/registry/examples/filter-bar/address.tsx +27 -0
- package/registry/examples/filter-bar/jobs.d.ts +4 -0
- package/registry/examples/filter-bar/jobs.js +37 -0
- package/registry/examples/filter-bar/jobs.tsx +37 -0
- package/registry/examples/filter-bar/menu.d.ts +4 -0
- package/registry/examples/filter-bar/menu.js +27 -0
- package/registry/examples/filter-bar/menu.tsx +23 -0
- package/registry/examples/image-cropper/avatar.d.ts +4 -0
- package/registry/examples/image-cropper/avatar.js +13 -0
- package/registry/examples/image-cropper/avatar.tsx +14 -0
- package/registry/examples/image-cropper/banner.d.ts +4 -0
- package/registry/examples/image-cropper/banner.js +11 -0
- package/registry/examples/image-cropper/banner.tsx +10 -0
- package/registry/examples/image-cropper/vertical-video.d.ts +4 -0
- package/registry/examples/image-cropper/vertical-video.js +12 -0
- package/registry/examples/image-cropper/vertical-video.tsx +16 -0
- package/registry/examples/media-capture/clip.d.ts +4 -0
- package/registry/examples/media-capture/clip.js +20 -0
- package/registry/examples/media-capture/clip.tsx +18 -0
- package/registry/examples/media-capture/native/photo.d.ts +4 -0
- package/registry/examples/media-capture/native/photo.dark.png +0 -0
- package/registry/examples/media-capture/native/photo.js +27 -0
- package/registry/examples/media-capture/native/photo.light.png +0 -0
- package/registry/examples/media-capture/native/photo.tsx +20 -0
- package/registry/examples/media-capture/profile-photo.d.ts +4 -0
- package/registry/examples/media-capture/profile-photo.js +24 -0
- package/registry/examples/media-capture/profile-photo.tsx +20 -0
- package/registry/examples/pagination/cursor.d.ts +4 -0
- package/registry/examples/pagination/cursor.js +24 -0
- package/registry/examples/pagination/cursor.tsx +20 -0
- package/registry/examples/pagination/links.d.ts +4 -0
- package/registry/examples/pagination/links.js +11 -0
- package/registry/examples/pagination/links.tsx +6 -0
- package/registry/examples/pagination/native/cursor.d.ts +4 -0
- package/registry/examples/pagination/native/cursor.dark.png +0 -0
- package/registry/examples/pagination/native/cursor.js +19 -0
- package/registry/examples/pagination/native/cursor.light.png +0 -0
- package/registry/examples/pagination/native/cursor.tsx +13 -0
- package/registry/examples/pagination/native/pages.d.ts +4 -0
- package/registry/examples/pagination/native/pages.dark.png +0 -0
- package/registry/examples/pagination/native/pages.js +21 -0
- package/registry/examples/pagination/native/pages.light.png +0 -0
- package/registry/examples/pagination/native/pages.tsx +14 -0
- package/registry/examples/pagination/results.d.ts +4 -0
- package/registry/examples/pagination/results.js +23 -0
- package/registry/examples/pagination/results.tsx +19 -0
- package/registry/examples/pagination/table-footer.d.ts +4 -0
- package/registry/examples/pagination/table-footer.js +31 -0
- package/registry/examples/pagination/table-footer.tsx +27 -0
- package/registry/examples/search-field/global.d.ts +4 -0
- package/registry/examples/search-field/global.js +19 -0
- package/registry/examples/search-field/global.tsx +15 -0
- package/registry/examples/search-field/native/default.d.ts +4 -0
- package/registry/examples/search-field/native/default.dark.png +0 -0
- package/registry/examples/search-field/native/default.js +13 -0
- package/registry/examples/search-field/native/default.light.png +0 -0
- package/registry/examples/search-field/native/default.tsx +7 -0
- package/registry/examples/search-field/suggestions.d.ts +4 -0
- package/registry/examples/search-field/suggestions.js +30 -0
- package/registry/examples/search-field/suggestions.tsx +27 -0
- package/registry/examples/search-field/toolbar.d.ts +4 -0
- package/registry/examples/search-field/toolbar.js +17 -0
- package/registry/examples/search-field/toolbar.tsx +21 -0
- package/registry/examples/tag-input/recipients.d.ts +4 -0
- package/registry/examples/tag-input/recipients.js +23 -0
- package/registry/examples/tag-input/recipients.tsx +20 -0
- package/registry/examples/tag-input/video-tags.d.ts +4 -0
- package/registry/examples/tag-input/video-tags.js +26 -0
- package/registry/examples/tag-input/video-tags.tsx +22 -0
- package/registry/examples/video-player/default.d.ts +4 -0
- package/registry/examples/video-player/default.js +12 -0
- package/registry/examples/video-player/default.tsx +8 -0
- package/registry/examples/video-player/gated.d.ts +4 -0
- package/registry/examples/video-player/gated.js +26 -0
- package/registry/examples/video-player/gated.tsx +23 -0
- package/registry/examples/video-player/native/default.d.ts +4 -0
- package/registry/examples/video-player/native/default.dark.png +0 -0
- package/registry/examples/video-player/native/default.js +18 -0
- package/registry/examples/video-player/native/default.light.png +0 -0
- package/registry/examples/video-player/native/default.tsx +12 -0
- package/registry/examples/video-player/signed-source.d.ts +4 -0
- package/registry/examples/video-player/signed-source.js +16 -0
- package/registry/examples/video-player/signed-source.tsx +15 -0
- package/registry/examples/video-player/vertical.d.ts +4 -0
- package/registry/examples/video-player/vertical.js +12 -0
- package/registry/examples/video-player/vertical.tsx +12 -0
- package/registry/examples/video-trimmer/custom.d.ts +4 -0
- package/registry/examples/video-trimmer/custom.js +24 -0
- package/registry/examples/video-trimmer/custom.tsx +26 -0
- package/registry/examples/video-trimmer/filmstrip.d.ts +4 -0
- package/registry/examples/video-trimmer/filmstrip.js +15 -0
- package/registry/examples/video-trimmer/filmstrip.tsx +13 -0
- package/registry/examples/video-trimmer/playhead.d.ts +4 -0
- package/registry/examples/video-trimmer/playhead.js +15 -0
- package/registry/examples/video-trimmer/playhead.tsx +13 -0
- package/registry/field.json +1 -1
- package/registry/file-upload.json +471 -0
- package/registry/filter-bar.json +347 -0
- package/registry/glow-card.json +1 -1
- package/registry/image-cropper.json +313 -0
- package/registry/index.json +255 -1
- package/registry/iso.json +1 -1
- package/registry/kbd.json +1 -1
- package/registry/loader.json +1 -1
- package/registry/marquee.json +1 -1
- package/registry/mascots.json +1 -1
- package/registry/media-capture.json +347 -0
- package/registry/meter.json +3 -3
- package/registry/nav-bar.json +1 -1
- package/registry/number-ticker.json +1 -1
- package/registry/page-header.json +1 -1
- package/registry/pagination.json +475 -0
- package/registry/popover.json +1 -1
- package/registry/progress.json +5 -5
- package/registry/radio-group.json +1 -1
- package/registry/search-field.json +436 -0
- package/registry/section-backdrop.json +1 -1
- package/registry/separator.json +1 -1
- package/registry/skeleton.json +1 -1
- package/registry/slider.json +1 -1
- package/registry/slot.json +1 -1
- package/registry/spinner.json +1 -1
- package/registry/stat.json +1 -1
- package/registry/stepper.json +1 -1
- package/registry/switch.json +1 -1
- package/registry/tabs.json +1 -1
- package/registry/tag-input.json +363 -0
- package/registry/theme.json +1 -1
- package/registry/toast.json +1 -1
- package/registry/tooltip.json +1 -1
- package/registry/video-player.json +598 -0
- package/registry/video-trimmer.json +385 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
cn,
|
|
4
|
+
floating
|
|
5
|
+
} from "./chunk-2USC2YT6.js";
|
|
6
|
+
import {
|
|
7
|
+
useControllable
|
|
8
|
+
} from "./chunk-EUPTXKH7.js";
|
|
9
|
+
import {
|
|
10
|
+
CalendarGlyph,
|
|
11
|
+
ChevronGlyph,
|
|
12
|
+
CloseGlyph
|
|
13
|
+
} from "./chunk-YX6CNVJA.js";
|
|
14
|
+
|
|
15
|
+
// src/date-picker/calendar.tsx
|
|
16
|
+
import { formatDate, getDateTimeFormat } from "@krizaka/intl";
|
|
17
|
+
import * as React from "react";
|
|
18
|
+
import { tv } from "tailwind-variants";
|
|
19
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
+
var calendar = tv({
|
|
21
|
+
slots: {
|
|
22
|
+
root: "w-[17.5rem] select-none text-sm text-fg",
|
|
23
|
+
header: "mb-2 flex items-center justify-between gap-2",
|
|
24
|
+
title: "text-sm font-semibold capitalize",
|
|
25
|
+
nav: "inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40",
|
|
26
|
+
grid: "w-full border-collapse",
|
|
27
|
+
weekday: "h-8 w-10 text-center text-[11px] font-semibold uppercase text-fg-secondary",
|
|
28
|
+
cell: "p-0 text-center",
|
|
29
|
+
day: "relative h-10 w-10 rounded-lg text-sm tabular-nums text-fg transition-colors hover:bg-surface-3 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[outside]:text-fg-secondary data-[today]:font-bold data-[today]:not-data-[selected]:text-fg-accent data-[in-range]:rounded-none data-[in-range]:bg-accent-soft data-[selected]:bg-accent data-[selected]:text-on-accent data-[selected]:hover:bg-accent disabled:cursor-not-allowed disabled:text-fg-muted disabled:line-through disabled:opacity-50 disabled:hover:bg-transparent"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
var pad = (n) => String(n).padStart(2, "0");
|
|
33
|
+
var parts = (iso) => iso.split("-").map(Number);
|
|
34
|
+
var toLocalDate = (iso) => {
|
|
35
|
+
const [y, m, d] = parts(iso);
|
|
36
|
+
return new Date(y, m - 1, d);
|
|
37
|
+
};
|
|
38
|
+
var toIsoDate = (date) => `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
39
|
+
var addDays = (iso, days) => {
|
|
40
|
+
const date = toLocalDate(iso);
|
|
41
|
+
date.setDate(date.getDate() + days);
|
|
42
|
+
return toIsoDate(date);
|
|
43
|
+
};
|
|
44
|
+
var addMonths = (iso, months) => {
|
|
45
|
+
const [y, m, d] = parts(iso);
|
|
46
|
+
const first = new Date(y, m - 1 + months, 1);
|
|
47
|
+
const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();
|
|
48
|
+
return toIsoDate(new Date(first.getFullYear(), first.getMonth(), Math.min(d, last)));
|
|
49
|
+
};
|
|
50
|
+
var monthOf = (iso) => `${iso.slice(0, 7)}-01`;
|
|
51
|
+
var clampIso = (iso, min, max) => min && iso < min ? min : max && iso > max ? max : iso;
|
|
52
|
+
function weekStartOf(locale) {
|
|
53
|
+
try {
|
|
54
|
+
const info = new Intl.Locale(locale);
|
|
55
|
+
const firstDay = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;
|
|
56
|
+
return firstDay ? firstDay % 7 : 1;
|
|
57
|
+
} catch {
|
|
58
|
+
return 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
var calendarLabels = { previousMonth: "Previous month", nextMonth: "Next month" };
|
|
62
|
+
function Calendar({
|
|
63
|
+
locale,
|
|
64
|
+
value,
|
|
65
|
+
range,
|
|
66
|
+
onSelect,
|
|
67
|
+
month: monthProp,
|
|
68
|
+
defaultMonth,
|
|
69
|
+
onMonthChange,
|
|
70
|
+
min,
|
|
71
|
+
max,
|
|
72
|
+
isDateDisabled,
|
|
73
|
+
weekStartsOn,
|
|
74
|
+
today: todayProp,
|
|
75
|
+
autoFocus,
|
|
76
|
+
labels: given,
|
|
77
|
+
className
|
|
78
|
+
}) {
|
|
79
|
+
const labels = { ...calendarLabels, ...given };
|
|
80
|
+
const s = calendar();
|
|
81
|
+
const today = todayProp ?? toIsoDate(/* @__PURE__ */ new Date());
|
|
82
|
+
const anchor = value ?? range?.start ?? clampIso(today, min, max);
|
|
83
|
+
const [innerMonth, setInnerMonth] = React.useState(monthOf(defaultMonth ?? anchor));
|
|
84
|
+
const month = monthProp ? monthOf(monthProp) : innerMonth;
|
|
85
|
+
const [focused, setFocused] = React.useState(anchor.slice(0, 7) === month.slice(0, 7) ? anchor : month);
|
|
86
|
+
const [hover, setHover] = React.useState(null);
|
|
87
|
+
const grid = React.useRef(null);
|
|
88
|
+
const moved = React.useRef(Boolean(autoFocus));
|
|
89
|
+
const titleId = React.useId();
|
|
90
|
+
const setMonth = (next) => {
|
|
91
|
+
const m = monthOf(next);
|
|
92
|
+
if (!monthProp) setInnerMonth(m);
|
|
93
|
+
onMonthChange?.(m);
|
|
94
|
+
};
|
|
95
|
+
const active = focused.slice(0, 7) === month.slice(0, 7) ? focused : month;
|
|
96
|
+
React.useEffect(() => {
|
|
97
|
+
if (!moved.current) return;
|
|
98
|
+
moved.current = false;
|
|
99
|
+
grid.current?.querySelector(`[data-date="${active}"]`)?.focus();
|
|
100
|
+
}, [active]);
|
|
101
|
+
const disabled = (iso) => Boolean(min && iso < min || max && iso > max || isDateDisabled?.(iso));
|
|
102
|
+
const start = weekStartsOn ?? weekStartOf(locale);
|
|
103
|
+
const first = toLocalDate(month);
|
|
104
|
+
const lead = (first.getDay() - start + 7) % 7;
|
|
105
|
+
const gridStart = addDays(month, -lead);
|
|
106
|
+
const days = Array.from({ length: 42 }, (_, i) => addDays(gridStart, i));
|
|
107
|
+
const weeks = Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0].slice(0, 7) === month.slice(0, 7));
|
|
108
|
+
const weekdayShort = getDateTimeFormat(locale, { weekday: "short" });
|
|
109
|
+
const weekdayLong = getDateTimeFormat(locale, { weekday: "long" });
|
|
110
|
+
const title = getDateTimeFormat(locale, { month: "long", year: "numeric" }).format(first);
|
|
111
|
+
const rangeEnd = range ? range.end ?? hover : null;
|
|
112
|
+
const [lo, hi] = range && rangeEnd ? range.start <= rangeEnd ? [range.start, rangeEnd] : [rangeEnd, range.start] : [null, null];
|
|
113
|
+
const focusDay = (iso) => {
|
|
114
|
+
moved.current = true;
|
|
115
|
+
setFocused(iso);
|
|
116
|
+
if (iso.slice(0, 7) !== month.slice(0, 7)) setMonth(iso);
|
|
117
|
+
};
|
|
118
|
+
const onKeyDown = (event) => {
|
|
119
|
+
const weekday = (toLocalDate(active).getDay() - start + 7) % 7;
|
|
120
|
+
const moves = {
|
|
121
|
+
ArrowLeft: () => addDays(active, -1),
|
|
122
|
+
ArrowRight: () => addDays(active, 1),
|
|
123
|
+
ArrowUp: () => addDays(active, -7),
|
|
124
|
+
ArrowDown: () => addDays(active, 7),
|
|
125
|
+
Home: () => addDays(active, -weekday),
|
|
126
|
+
End: () => addDays(active, 6 - weekday),
|
|
127
|
+
PageUp: () => addMonths(active, event.shiftKey ? -12 : -1),
|
|
128
|
+
PageDown: () => addMonths(active, event.shiftKey ? 12 : 1)
|
|
129
|
+
};
|
|
130
|
+
const move = moves[event.key];
|
|
131
|
+
if (!move) return;
|
|
132
|
+
event.preventDefault();
|
|
133
|
+
focusDay(move());
|
|
134
|
+
};
|
|
135
|
+
const prevDisabled = Boolean(min && addDays(month, -1) < min);
|
|
136
|
+
const nextDisabled = Boolean(max && addMonths(month, 1) > max);
|
|
137
|
+
return /* @__PURE__ */ jsxs("div", { className: s.root({ className }), children: [
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: s.header(), children: [
|
|
139
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: s.nav(), "aria-label": labels.previousMonth, disabled: prevDisabled, onClick: () => setMonth(addMonths(month, -1)), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "left" }) }),
|
|
140
|
+
/* @__PURE__ */ jsx("h2", { id: titleId, className: s.title(), "aria-live": "polite", children: title }),
|
|
141
|
+
/* @__PURE__ */ jsx("button", { type: "button", className: s.nav(), "aria-label": labels.nextMonth, disabled: nextDisabled, onClick: () => setMonth(addMonths(month, 1)), children: /* @__PURE__ */ jsx(ChevronGlyph, { direction: "right" }) })
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsxs("table", { ref: grid, role: "grid", "aria-labelledby": titleId, className: s.grid(), onKeyDown, children: [
|
|
144
|
+
/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: days.slice(0, 7).map((iso) => /* @__PURE__ */ jsx("th", { scope: "col", abbr: weekdayLong.format(toLocalDate(iso)), className: s.weekday(), children: weekdayShort.format(toLocalDate(iso)).replace(/\.$/, "") }, iso)) }) }),
|
|
145
|
+
/* @__PURE__ */ jsx("tbody", { children: weeks.map((week) => /* @__PURE__ */ jsx("tr", { children: week.map((iso) => {
|
|
146
|
+
const selected = iso === value || range && (iso === range.start || iso === range.end);
|
|
147
|
+
const inRange = Boolean(lo && hi && iso > lo && iso < hi);
|
|
148
|
+
return /* @__PURE__ */ jsx("td", { role: "gridcell", "aria-selected": selected || inRange || void 0, className: s.cell(), children: /* @__PURE__ */ jsx(
|
|
149
|
+
"button",
|
|
150
|
+
{
|
|
151
|
+
type: "button",
|
|
152
|
+
"data-date": iso,
|
|
153
|
+
tabIndex: iso === active ? 0 : -1,
|
|
154
|
+
"aria-label": formatDate(toLocalDate(iso), { locale, style: "long" }),
|
|
155
|
+
"aria-current": iso === today ? "date" : void 0,
|
|
156
|
+
"data-today": iso === today ? "" : void 0,
|
|
157
|
+
"data-outside": iso.slice(0, 7) !== month.slice(0, 7) ? "" : void 0,
|
|
158
|
+
"data-selected": selected ? "" : void 0,
|
|
159
|
+
"data-in-range": inRange ? "" : void 0,
|
|
160
|
+
disabled: disabled(iso),
|
|
161
|
+
className: s.day(),
|
|
162
|
+
onClick: () => {
|
|
163
|
+
setFocused(iso);
|
|
164
|
+
onSelect?.(iso);
|
|
165
|
+
},
|
|
166
|
+
onMouseEnter: range && !range.end ? () => setHover(iso) : void 0,
|
|
167
|
+
onFocus: range && !range.end ? () => setHover(iso) : void 0,
|
|
168
|
+
children: Number(iso.slice(8))
|
|
169
|
+
}
|
|
170
|
+
) }, iso);
|
|
171
|
+
}) }, week[0])) })
|
|
172
|
+
] })
|
|
173
|
+
] });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// src/date-picker/date-picker.tsx
|
|
177
|
+
import { formatDate as formatDate2, getDateTimeFormat as getDateTimeFormat2 } from "@krizaka/intl";
|
|
178
|
+
import * as React2 from "react";
|
|
179
|
+
import { tv as tv2 } from "tailwind-variants";
|
|
180
|
+
|
|
181
|
+
// src/popover/popover.tsx
|
|
182
|
+
import { Popover as PopoverPrimitive } from "radix-ui";
|
|
183
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
184
|
+
function PopoverContent({ sideOffset = 8, collisionPadding = 8, container, className, ...props }) {
|
|
185
|
+
return /* @__PURE__ */ jsx2(PopoverPrimitive.Portal, { container, children: /* @__PURE__ */ jsx2(
|
|
186
|
+
PopoverPrimitive.Content,
|
|
187
|
+
{
|
|
188
|
+
sideOffset,
|
|
189
|
+
collisionPadding,
|
|
190
|
+
className: cn(floating, "w-72 max-w-(--radix-popover-content-available-width) p-4 origin-(--radix-popover-content-transform-origin)", className),
|
|
191
|
+
...props
|
|
192
|
+
}
|
|
193
|
+
) });
|
|
194
|
+
}
|
|
195
|
+
var Popover = {
|
|
196
|
+
Root: PopoverPrimitive.Root,
|
|
197
|
+
Trigger: PopoverPrimitive.Trigger,
|
|
198
|
+
Anchor: PopoverPrimitive.Anchor,
|
|
199
|
+
Close: PopoverPrimitive.Close,
|
|
200
|
+
Content: PopoverContent
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// src/date-picker/date-picker.tsx
|
|
204
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
205
|
+
var datePicker = tv2({
|
|
206
|
+
slots: {
|
|
207
|
+
root: "flex w-full flex-col gap-1.5",
|
|
208
|
+
label: "text-xs font-semibold text-fg-secondary",
|
|
209
|
+
row: "relative flex w-full",
|
|
210
|
+
trigger: "flex h-11 w-full items-center gap-2.5 rounded-lg border border-border-default bg-surface-2 px-3 text-left text-sm text-fg transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring data-[placeholder]:text-fg-muted aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50 data-[clearable]:pr-10",
|
|
211
|
+
icon: "h-4 w-4 shrink-0 text-fg-secondary",
|
|
212
|
+
clear: "absolute right-1.5 top-1/2 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring",
|
|
213
|
+
content: "w-auto p-3",
|
|
214
|
+
layout: "flex flex-col gap-3 sm:flex-row",
|
|
215
|
+
presets: "flex flex-wrap gap-1.5 sm:w-36 sm:flex-col sm:flex-nowrap sm:border-r sm:border-border-default sm:pr-3",
|
|
216
|
+
preset: "rounded-md px-2.5 py-1.5 text-left text-xs font-semibold text-fg-secondary hover:bg-surface-3 hover:text-fg focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:bg-accent-soft aria-pressed:text-fg",
|
|
217
|
+
hint: "text-xs text-fg-secondary",
|
|
218
|
+
error: "flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger"
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
var datePickerLabels = { previousMonth: "Previous month", nextMonth: "Next month", clear: "Clear date" };
|
|
222
|
+
function Field({
|
|
223
|
+
shared,
|
|
224
|
+
text,
|
|
225
|
+
hasValue,
|
|
226
|
+
onClear,
|
|
227
|
+
hidden,
|
|
228
|
+
open,
|
|
229
|
+
setOpen,
|
|
230
|
+
children
|
|
231
|
+
}) {
|
|
232
|
+
const { label, placeholder, clearable, hint, error, disabled, name, className } = shared;
|
|
233
|
+
const labels = { ...datePickerLabels, ...shared.labels };
|
|
234
|
+
const s = datePicker();
|
|
235
|
+
const id = React2.useId();
|
|
236
|
+
const describedBy = [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(" ") || void 0;
|
|
237
|
+
return /* @__PURE__ */ jsxs2("div", { className: s.root({ className }), children: [
|
|
238
|
+
/* @__PURE__ */ jsx3("label", { htmlFor: `${id}-trigger`, className: s.label(), children: label }),
|
|
239
|
+
/* @__PURE__ */ jsxs2(Popover.Root, { open, onOpenChange: setOpen, children: [
|
|
240
|
+
/* @__PURE__ */ jsxs2("div", { className: s.row(), children: [
|
|
241
|
+
/* @__PURE__ */ jsx3(Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs2(
|
|
242
|
+
"button",
|
|
243
|
+
{
|
|
244
|
+
id: `${id}-trigger`,
|
|
245
|
+
type: "button",
|
|
246
|
+
"aria-haspopup": "dialog",
|
|
247
|
+
"aria-describedby": describedBy,
|
|
248
|
+
"aria-invalid": error ? true : void 0,
|
|
249
|
+
disabled,
|
|
250
|
+
"data-placeholder": hasValue ? void 0 : "",
|
|
251
|
+
"data-clearable": clearable && hasValue ? "" : void 0,
|
|
252
|
+
className: s.trigger(),
|
|
253
|
+
children: [
|
|
254
|
+
/* @__PURE__ */ jsx3(CalendarGlyph, { className: s.icon() }),
|
|
255
|
+
/* @__PURE__ */ jsx3("span", { className: "truncate", children: text ?? placeholder ?? "" })
|
|
256
|
+
]
|
|
257
|
+
}
|
|
258
|
+
) }),
|
|
259
|
+
clearable && hasValue && !disabled ? /* @__PURE__ */ jsx3("button", { type: "button", "aria-label": labels.clear, className: s.clear(), onClick: onClear, children: /* @__PURE__ */ jsx3(CloseGlyph, { className: "h-4 w-4" }) }) : null
|
|
260
|
+
] }),
|
|
261
|
+
/* @__PURE__ */ jsx3(Popover.Content, { align: "start", "aria-label": label, className: s.content(), children })
|
|
262
|
+
] }),
|
|
263
|
+
name ? /* @__PURE__ */ jsx3("input", { type: "hidden", name, value: hidden }) : null,
|
|
264
|
+
hint ? /* @__PURE__ */ jsx3("p", { id: `${id}-hint`, className: s.hint(), children: hint }) : null,
|
|
265
|
+
error ? /* @__PURE__ */ jsx3("p", { id: `${id}-error`, className: s.error(), children: error }) : null
|
|
266
|
+
] });
|
|
267
|
+
}
|
|
268
|
+
function DatePicker({ value: valueProp, defaultValue = null, onValueChange, defaultOpen = false, ...shared }) {
|
|
269
|
+
const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);
|
|
270
|
+
const [open, setOpen] = React2.useState(defaultOpen);
|
|
271
|
+
const { locale, format = "medium" } = shared;
|
|
272
|
+
return /* @__PURE__ */ jsx3(
|
|
273
|
+
Field,
|
|
274
|
+
{
|
|
275
|
+
shared,
|
|
276
|
+
text: value ? formatDate2(toLocalDate(value), { locale, style: format }) : null,
|
|
277
|
+
hasValue: Boolean(value),
|
|
278
|
+
onClear: () => setValue(null),
|
|
279
|
+
hidden: value ?? "",
|
|
280
|
+
open,
|
|
281
|
+
setOpen,
|
|
282
|
+
children: /* @__PURE__ */ jsx3(
|
|
283
|
+
Calendar,
|
|
284
|
+
{
|
|
285
|
+
...shared,
|
|
286
|
+
autoFocus: true,
|
|
287
|
+
value,
|
|
288
|
+
onSelect: (date) => {
|
|
289
|
+
setValue(date);
|
|
290
|
+
setOpen(false);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
function formatRange(locale, start, end, style) {
|
|
298
|
+
const formatter = getDateTimeFormat2(locale, { dateStyle: style });
|
|
299
|
+
return formatter.formatRange ? formatter.formatRange(toLocalDate(start), toLocalDate(end)) : `${formatter.format(toLocalDate(start))} \u2013 ${formatter.format(toLocalDate(end))}`;
|
|
300
|
+
}
|
|
301
|
+
function DateRangePicker({ value: valueProp, defaultValue = null, onValueChange, presets, defaultOpen = false, ...shared }) {
|
|
302
|
+
const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);
|
|
303
|
+
const [draft, setDraft] = React2.useState(null);
|
|
304
|
+
const [open, setOpenState] = React2.useState(defaultOpen);
|
|
305
|
+
const { locale, format = "medium" } = shared;
|
|
306
|
+
const s = datePicker();
|
|
307
|
+
const setOpen = (next) => {
|
|
308
|
+
setOpenState(next);
|
|
309
|
+
setDraft(null);
|
|
310
|
+
};
|
|
311
|
+
const shown = draft ?? value;
|
|
312
|
+
const pick = (date) => {
|
|
313
|
+
if (!draft) setDraft({ start: date, end: null });
|
|
314
|
+
else {
|
|
315
|
+
const [start, end] = date < draft.start ? [date, draft.start] : [draft.start, date];
|
|
316
|
+
setValue({ start, end });
|
|
317
|
+
setOpen(false);
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
return /* @__PURE__ */ jsx3(
|
|
321
|
+
Field,
|
|
322
|
+
{
|
|
323
|
+
shared,
|
|
324
|
+
text: value ? formatRange(locale, value.start, value.end, format) : null,
|
|
325
|
+
hasValue: Boolean(value),
|
|
326
|
+
onClear: () => setValue(null),
|
|
327
|
+
hidden: value ? `${value.start}/${value.end}` : "",
|
|
328
|
+
open,
|
|
329
|
+
setOpen,
|
|
330
|
+
children: /* @__PURE__ */ jsxs2("div", { className: s.layout(), children: [
|
|
331
|
+
presets?.length ? /* @__PURE__ */ jsx3("div", { className: s.presets(), children: presets.map((preset) => /* @__PURE__ */ jsx3(
|
|
332
|
+
"button",
|
|
333
|
+
{
|
|
334
|
+
type: "button",
|
|
335
|
+
"aria-pressed": value?.start === preset.start && value?.end === preset.end,
|
|
336
|
+
className: s.preset(),
|
|
337
|
+
onClick: () => {
|
|
338
|
+
setValue({ start: preset.start, end: preset.end });
|
|
339
|
+
setOpen(false);
|
|
340
|
+
},
|
|
341
|
+
children: preset.label
|
|
342
|
+
},
|
|
343
|
+
preset.label
|
|
344
|
+
)) }) : null,
|
|
345
|
+
/* @__PURE__ */ jsx3(Calendar, { ...shared, autoFocus: true, range: shown, onSelect: pick })
|
|
346
|
+
] })
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
export {
|
|
351
|
+
Calendar,
|
|
352
|
+
DatePicker,
|
|
353
|
+
DateRangePicker,
|
|
354
|
+
addDays,
|
|
355
|
+
addMonths,
|
|
356
|
+
calendar,
|
|
357
|
+
calendarLabels,
|
|
358
|
+
datePicker,
|
|
359
|
+
datePickerLabels,
|
|
360
|
+
toIsoDate,
|
|
361
|
+
toLocalDate,
|
|
362
|
+
weekStartOf
|
|
363
|
+
};
|
|
364
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/date-picker/calendar.tsx","../src/date-picker/date-picker.tsx","../src/popover/popover.tsx"],"sourcesContent":["// Client. A month as an ARIA grid (the APG date picker): one day in the tab order, the arrows walk the days, Home /\n// End the week, Page Up / Page Down the months (Shift: the years), Enter or Space picks. Dates are ISO calendar dates\n// (`\"2026-10-11\"`): no time zone, nothing to convert, safe in an address. Month and day names come from\n// `@krizaka/intl` for the `locale` given — never the runtime's default.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { ChevronGlyph } from \"../glyphs\";\n\n/** A calendar date, `YYYY-MM-DD`. */\nexport type IsoDate = string;\n/** A range of calendar dates; `end` is `null` while the second date is not chosen. */\nexport type DateRange = { start: IsoDate; end: IsoDate | null };\n\nexport const calendar = tv({\n slots: {\n root: \"w-[17.5rem] select-none text-sm text-fg\",\n header: \"mb-2 flex items-center justify-between gap-2\",\n title: \"text-sm font-semibold capitalize\",\n nav:\n \"inline-flex h-8 w-8 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40\",\n grid: \"w-full border-collapse\",\n weekday: \"h-8 w-10 text-center text-[11px] font-semibold uppercase text-fg-secondary\",\n cell: \"p-0 text-center\",\n day:\n \"relative h-10 w-10 rounded-lg text-sm tabular-nums text-fg transition-colors hover:bg-surface-3 \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"data-[outside]:text-fg-secondary data-[today]:font-bold data-[today]:not-data-[selected]:text-fg-accent \" +\n \"data-[in-range]:rounded-none data-[in-range]:bg-accent-soft \" +\n \"data-[selected]:bg-accent data-[selected]:text-on-accent data-[selected]:hover:bg-accent \" +\n \"disabled:cursor-not-allowed disabled:text-fg-muted disabled:line-through disabled:opacity-50 disabled:hover:bg-transparent\",\n },\n});\n\nexport const pad = (n: number) => String(n).padStart(2, \"0\");\nconst parts = (iso: IsoDate) => iso.split(\"-\").map(Number) as [number, number, number];\n/** A local `Date` at midnight for an ISO date (for formatting). */\nexport const toLocalDate = (iso: IsoDate) => {\n const [y, m, d] = parts(iso);\n return new Date(y, m - 1, d);\n};\n/** The ISO date of a local `Date`. */\nexport const toIsoDate = (date: Date): IsoDate => `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\nexport const addDays = (iso: IsoDate, days: number) => {\n const date = toLocalDate(iso);\n date.setDate(date.getDate() + days);\n return toIsoDate(date);\n};\nexport const addMonths = (iso: IsoDate, months: number) => {\n const [y, m, d] = parts(iso);\n const first = new Date(y, m - 1 + months, 1);\n const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n return toIsoDate(new Date(first.getFullYear(), first.getMonth(), Math.min(d, last)));\n};\nconst monthOf = (iso: IsoDate) => `${iso.slice(0, 7)}-01`;\nconst clampIso = (iso: IsoDate, min?: IsoDate, max?: IsoDate) => (min && iso < min ? min : max && iso > max ? max : iso);\n\n/** The first day of the week for a locale (0 = Sunday … 6 = Saturday), from `Intl.Locale` week info; Monday otherwise. */\nexport function weekStartOf(locale: string): number {\n try {\n const info = new Intl.Locale(locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const firstDay = info.getWeekInfo?.().firstDay ?? info.weekInfo?.firstDay;\n return firstDay ? firstDay % 7 : 1;\n } catch {\n return 1;\n }\n}\n\nexport type CalendarLabels = {\n /** The previous-month button (\"Previous month\"). */\n previousMonth: string;\n /** The next-month button (\"Next month\"). */\n nextMonth: string;\n};\n\nexport const calendarLabels: CalendarLabels = { previousMonth: \"Previous month\", nextMonth: \"Next month\" };\n\nexport type CalendarProps = {\n /** The BCP 47 locale of the month and day names (`\"en-US\"`, `\"fr-CA\"`): always explicit. */\n locale: string;\n /** The chosen date (one-date mode). */\n value?: IsoDate | null;\n /** The chosen range (range mode): its ends are marked, the days between tinted. */\n range?: DateRange | null;\n /** Called with the day picked. */\n onSelect?: (date: IsoDate) => void;\n /** The month shown, any day of it (controlled). */\n month?: IsoDate;\n /** The month shown at first. Default: the value's, or today's. */\n defaultMonth?: IsoDate;\n /** Called when the month shown changes. */\n onMonthChange?: (month: IsoDate) => void;\n /** The earliest date that can be picked. */\n min?: IsoDate;\n /** The latest date that can be picked. */\n max?: IsoDate;\n /** Refuses some dates (`(d) => isWeekend(d)`). */\n isDateDisabled?: (date: IsoDate) => boolean;\n /** The first day of the week, 0 = Sunday. Default: the locale's. */\n weekStartsOn?: number;\n /** Today (marked): inject it for a stable server render or a test. Default: the device's date. */\n today?: IsoDate;\n /** Moves the focus to the active day when it mounts (inside a popover). */\n autoFocus?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<CalendarLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\n/** A month grid to pick a date or the ends of a range, with the full keyboard of the APG date picker. */\nexport function Calendar({\n locale,\n value,\n range,\n onSelect,\n month: monthProp,\n defaultMonth,\n onMonthChange,\n min,\n max,\n isDateDisabled,\n weekStartsOn,\n today: todayProp,\n autoFocus,\n labels: given,\n className,\n}: CalendarProps) {\n const labels = { ...calendarLabels, ...given };\n const s = calendar();\n const today = todayProp ?? toIsoDate(new Date());\n const anchor = value ?? range?.start ?? clampIso(today, min, max);\n const [innerMonth, setInnerMonth] = React.useState(monthOf(defaultMonth ?? anchor));\n const month = monthProp ? monthOf(monthProp) : innerMonth;\n const [focused, setFocused] = React.useState<IsoDate>(anchor.slice(0, 7) === month.slice(0, 7) ? anchor : month);\n const [hover, setHover] = React.useState<IsoDate | null>(null);\n const grid = React.useRef<HTMLTableElement>(null);\n const moved = React.useRef(Boolean(autoFocus));\n const titleId = React.useId();\n\n const setMonth = (next: IsoDate) => {\n const m = monthOf(next);\n if (!monthProp) setInnerMonth(m);\n onMonthChange?.(m);\n };\n // The focused day follows the month shown when it is changed from outside (the buttons, a controlled `month`).\n const active = focused.slice(0, 7) === month.slice(0, 7) ? focused : month;\n\n React.useEffect(() => {\n if (!moved.current) return;\n moved.current = false;\n grid.current?.querySelector<HTMLButtonElement>(`[data-date=\"${active}\"]`)?.focus();\n }, [active]);\n\n const disabled = (iso: IsoDate) => Boolean((min && iso < min) || (max && iso > max) || isDateDisabled?.(iso));\n const start = weekStartsOn ?? weekStartOf(locale);\n const first = toLocalDate(month);\n const lead = (first.getDay() - start + 7) % 7;\n const gridStart = addDays(month, -lead);\n const days = Array.from({ length: 42 }, (_, i) => addDays(gridStart, i));\n const weeks = Array.from({ length: 6 }, (_, w) => days.slice(w * 7, w * 7 + 7)).filter((week, w) => w < 5 || week[0]!.slice(0, 7) === month.slice(0, 7));\n const weekdayShort = getDateTimeFormat(locale, { weekday: \"short\" });\n const weekdayLong = getDateTimeFormat(locale, { weekday: \"long\" });\n const title = getDateTimeFormat(locale, { month: \"long\", year: \"numeric\" }).format(first);\n\n const rangeEnd = range ? (range.end ?? hover) : null;\n const [lo, hi] = range && rangeEnd ? (range.start <= rangeEnd ? [range.start, rangeEnd] : [rangeEnd, range.start]) : [null, null];\n\n const focusDay = (iso: IsoDate) => {\n moved.current = true;\n setFocused(iso);\n if (iso.slice(0, 7) !== month.slice(0, 7)) setMonth(iso);\n };\n\n const onKeyDown = (event: React.KeyboardEvent) => {\n const weekday = (toLocalDate(active).getDay() - start + 7) % 7;\n const moves: Record<string, () => IsoDate> = {\n ArrowLeft: () => addDays(active, -1),\n ArrowRight: () => addDays(active, 1),\n ArrowUp: () => addDays(active, -7),\n ArrowDown: () => addDays(active, 7),\n Home: () => addDays(active, -weekday),\n End: () => addDays(active, 6 - weekday),\n PageUp: () => addMonths(active, event.shiftKey ? -12 : -1),\n PageDown: () => addMonths(active, event.shiftKey ? 12 : 1),\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n focusDay(move());\n };\n\n const prevDisabled = Boolean(min && addDays(month, -1) < min);\n const nextDisabled = Boolean(max && addMonths(month, 1) > max);\n\n return (\n <div className={s.root({ className })}>\n <div className={s.header()}>\n <button type=\"button\" className={s.nav()} aria-label={labels.previousMonth} disabled={prevDisabled} onClick={() => setMonth(addMonths(month, -1))}>\n <ChevronGlyph direction=\"left\" />\n </button>\n <h2 id={titleId} className={s.title()} aria-live=\"polite\">\n {title}\n </h2>\n <button type=\"button\" className={s.nav()} aria-label={labels.nextMonth} disabled={nextDisabled} onClick={() => setMonth(addMonths(month, 1))}>\n <ChevronGlyph direction=\"right\" />\n </button>\n </div>\n <table ref={grid} role=\"grid\" aria-labelledby={titleId} className={s.grid()} onKeyDown={onKeyDown}>\n <thead>\n <tr>\n {days.slice(0, 7).map((iso) => (\n <th key={iso} scope=\"col\" abbr={weekdayLong.format(toLocalDate(iso))} className={s.weekday()}>\n {weekdayShort.format(toLocalDate(iso)).replace(/\\.$/, \"\")}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {weeks.map((week) => (\n <tr key={week[0]}>\n {week.map((iso) => {\n const selected = iso === value || (range && (iso === range.start || iso === range.end));\n const inRange = Boolean(lo && hi && iso > lo && iso < hi);\n return (\n <td key={iso} role=\"gridcell\" aria-selected={selected || inRange || undefined} className={s.cell()}>\n <button\n type=\"button\"\n data-date={iso}\n tabIndex={iso === active ? 0 : -1}\n aria-label={formatDate(toLocalDate(iso), { locale, style: \"long\" })}\n aria-current={iso === today ? \"date\" : undefined}\n data-today={iso === today ? \"\" : undefined}\n data-outside={iso.slice(0, 7) !== month.slice(0, 7) ? \"\" : undefined}\n data-selected={selected ? \"\" : undefined}\n data-in-range={inRange ? \"\" : undefined}\n disabled={disabled(iso)}\n className={s.day()}\n onClick={() => {\n setFocused(iso);\n onSelect?.(iso);\n }}\n onMouseEnter={range && !range.end ? () => setHover(iso) : undefined}\n onFocus={range && !range.end ? () => setHover(iso) : undefined}\n >\n {Number(iso.slice(8))}\n </button>\n </td>\n );\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n","// Client (a portal). A field-like button that opens the `Calendar` in a Popover (Radix: Escape closes, the focus\n// returns to the button). The value is an ISO date (`\"2026-10-11\"`) — the same string in a form, an address and an\n// API; the button reads it in the `locale`'s own format through `@krizaka/intl`.\nimport { formatDate, getDateTimeFormat } from \"@krizaka/intl\";\nimport * as React from \"react\";\nimport { tv } from \"tailwind-variants\";\n\nimport { CalendarGlyph, CloseGlyph } from \"../glyphs\";\nimport { useControllable } from \"../media\";\nimport { Popover } from \"../popover\";\nimport { Calendar, type CalendarLabels, type CalendarProps, type DateRange, type IsoDate, toLocalDate } from \"./calendar\";\n\nexport const datePicker = tv({\n slots: {\n root: \"flex w-full flex-col gap-1.5\",\n label: \"text-xs font-semibold text-fg-secondary\",\n row: \"relative flex w-full\",\n trigger:\n \"flex h-11 w-full items-center gap-2.5 rounded-lg border border-border-default bg-surface-2 px-3 text-left text-sm text-fg \" +\n \"transition-[border-color,box-shadow] focus-visible:border-accent focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring \" +\n \"data-[placeholder]:text-fg-muted aria-invalid:border-danger disabled:cursor-not-allowed disabled:opacity-50 data-[clearable]:pr-10\",\n icon: \"h-4 w-4 shrink-0 text-fg-secondary\",\n clear:\n \"absolute right-1.5 top-1/2 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-md text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring\",\n content: \"w-auto p-3\",\n layout: \"flex flex-col gap-3 sm:flex-row\",\n presets: \"flex flex-wrap gap-1.5 sm:w-36 sm:flex-col sm:flex-nowrap sm:border-r sm:border-border-default sm:pr-3\",\n preset:\n \"rounded-md px-2.5 py-1.5 text-left text-xs font-semibold text-fg-secondary hover:bg-surface-3 hover:text-fg \" +\n \"focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring aria-pressed:bg-accent-soft aria-pressed:text-fg\",\n hint: \"text-xs text-fg-secondary\",\n error: \"flex items-center gap-1.5 text-xs font-medium text-fg-danger before:h-1.5 before:w-1.5 before:shrink-0 before:rounded-full before:bg-danger\",\n },\n});\n\nexport type DatePickerLabels = CalendarLabels & {\n /** The clear button (\"Clear date\"). */\n clear: string;\n};\n\nexport const datePickerLabels: DatePickerLabels = { previousMonth: \"Previous month\", nextMonth: \"Next month\", clear: \"Clear date\" };\n\ntype Shared = Pick<CalendarProps, \"locale\" | \"min\" | \"max\" | \"isDateDisabled\" | \"weekStartsOn\" | \"today\"> & {\n /** The visible label, passed translated (also the button's accessible name, with the value). */\n label: string;\n /** Shown while nothing is chosen (\"Pick a date\"), passed translated. */\n placeholder?: string;\n /** `short` · `medium` (default) · `long`: how the button writes the date. */\n format?: \"short\" | \"medium\" | \"long\";\n /** Adds a button that empties the value. */\n clearable?: boolean;\n /** A help text under the field. */\n hint?: string;\n /** An error under the field: marks it invalid and is read with it. */\n error?: string;\n /** Not available. */\n disabled?: boolean;\n /** The name of a hidden input holding the ISO value, for a plain `<form>` post. */\n name?: string;\n /** Opens the calendar at first (a story, a test). */\n defaultOpen?: boolean;\n /** The words, passed translated; English by default. */\n labels?: Partial<DatePickerLabels>;\n /** Classes merged on the root. */\n className?: string;\n};\n\nexport type DatePickerProps = Shared & {\n /** The chosen date, ISO (controlled); `null` for none. */\n value?: IsoDate | null;\n /** The chosen date at first, uncontrolled. */\n defaultValue?: IsoDate | null;\n /** Called with the date picked, or `null` when cleared. */\n onValueChange?: (value: IsoDate | null) => void;\n};\n\nfunction Field({\n shared,\n text,\n hasValue,\n onClear,\n hidden,\n open,\n setOpen,\n children,\n}: {\n shared: Shared;\n text: string | null;\n hasValue: boolean;\n onClear: () => void;\n hidden: string;\n open: boolean;\n setOpen: (open: boolean) => void;\n children: React.ReactNode;\n}) {\n const { label, placeholder, clearable, hint, error, disabled, name, className } = shared;\n const labels = { ...datePickerLabels, ...shared.labels };\n const s = datePicker();\n const id = React.useId();\n const describedBy = [hint ? `${id}-hint` : null, error ? `${id}-error` : null].filter(Boolean).join(\" \") || undefined;\n return (\n <div className={s.root({ className })}>\n <label htmlFor={`${id}-trigger`} className={s.label()}>\n {label}\n </label>\n <Popover.Root open={open} onOpenChange={setOpen}>\n <div className={s.row()}>\n <Popover.Trigger asChild>\n <button\n id={`${id}-trigger`}\n type=\"button\"\n aria-haspopup=\"dialog\"\n aria-describedby={describedBy}\n aria-invalid={error ? true : undefined}\n disabled={disabled}\n data-placeholder={hasValue ? undefined : \"\"}\n data-clearable={clearable && hasValue ? \"\" : undefined}\n className={s.trigger()}\n >\n <CalendarGlyph className={s.icon()} />\n <span className=\"truncate\">{text ?? placeholder ?? \"\"}</span>\n </button>\n </Popover.Trigger>\n {clearable && hasValue && !disabled ? (\n <button type=\"button\" aria-label={labels.clear} className={s.clear()} onClick={onClear}>\n <CloseGlyph className=\"h-4 w-4\" />\n </button>\n ) : null}\n </div>\n <Popover.Content align=\"start\" aria-label={label} className={s.content()}>\n {children}\n </Popover.Content>\n </Popover.Root>\n {name ? <input type=\"hidden\" name={name} value={hidden} /> : null}\n {hint ? (\n <p id={`${id}-hint`} className={s.hint()}>\n {hint}\n </p>\n ) : null}\n {error ? (\n <p id={`${id}-error`} className={s.error()}>\n {error}\n </p>\n ) : null}\n </div>\n );\n}\n\n/** A date field: a button showing the date in the locale's format, a calendar in a popover, an ISO value. */\nexport function DatePicker({ value: valueProp, defaultValue = null, onValueChange, defaultOpen = false, ...shared }: DatePickerProps) {\n const [value, setValue] = useControllable<IsoDate | null>(valueProp, defaultValue, onValueChange);\n const [open, setOpen] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n return (\n <Field\n shared={shared}\n text={value ? formatDate(toLocalDate(value), { locale, style: format }) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ?? \"\"}\n open={open}\n setOpen={setOpen}\n >\n <Calendar\n {...shared}\n autoFocus\n value={value}\n onSelect={(date) => {\n setValue(date);\n setOpen(false);\n }}\n />\n </Field>\n );\n}\n\nexport type DateRangePreset = {\n /** Its name, passed translated (\"Last 7 days\"). */\n label: string;\n /** The first day, ISO. */\n start: IsoDate;\n /** The last day, ISO. */\n end: IsoDate;\n};\n\nexport type DateRangePickerProps = Shared & {\n /** The chosen range (controlled); `null` for none. `end` is never `null` in a committed value. */\n value?: { start: IsoDate; end: IsoDate } | null;\n /** The range at first, uncontrolled. */\n defaultValue?: { start: IsoDate; end: IsoDate } | null;\n /** Called once both ends are chosen (or with `null` when cleared). */\n onValueChange?: (value: { start: IsoDate; end: IsoDate } | null) => void;\n /** Ranges one click away (\"Last 7 days\", \"This month\"), beside the calendar. */\n presets?: readonly DateRangePreset[];\n};\n\n/** Formats a range as the locale writes one (\"Oct 1 – 11, 2026\"), through Intl's `formatRange` where available. */\nfunction formatRange(locale: string, start: IsoDate, end: IsoDate, style: \"short\" | \"medium\" | \"long\") {\n const formatter = getDateTimeFormat(locale, { dateStyle: style }) as Intl.DateTimeFormat & { formatRange?: (a: Date, b: Date) => string };\n return formatter.formatRange\n ? formatter.formatRange(toLocalDate(start), toLocalDate(end))\n : `${formatter.format(toLocalDate(start))} – ${formatter.format(toLocalDate(end))}`;\n}\n\n/** A period field: two clicks on one calendar (the days between tinted as you hover), optional presets. */\nexport function DateRangePicker({ value: valueProp, defaultValue = null, onValueChange, presets, defaultOpen = false, ...shared }: DateRangePickerProps) {\n const [value, setValue] = useControllable(valueProp, defaultValue, onValueChange);\n const [draft, setDraft] = React.useState<DateRange | null>(null);\n const [open, setOpenState] = React.useState(defaultOpen);\n const { locale, format = \"medium\" } = shared;\n const s = datePicker();\n const setOpen = (next: boolean) => {\n setOpenState(next);\n setDraft(null);\n };\n const shown: DateRange | null = draft ?? value;\n const pick = (date: IsoDate) => {\n if (!draft) setDraft({ start: date, end: null });\n else {\n const [start, end] = date < draft.start ? [date, draft.start] : [draft.start, date];\n setValue({ start, end });\n setOpen(false);\n }\n };\n return (\n <Field\n shared={shared}\n text={value ? formatRange(locale, value.start, value.end, format) : null}\n hasValue={Boolean(value)}\n onClear={() => setValue(null)}\n hidden={value ? `${value.start}/${value.end}` : \"\"}\n open={open}\n setOpen={setOpen}\n >\n <div className={s.layout()}>\n {presets?.length ? (\n <div className={s.presets()}>\n {presets.map((preset) => (\n <button\n key={preset.label}\n type=\"button\"\n aria-pressed={value?.start === preset.start && value?.end === preset.end}\n className={s.preset()}\n onClick={() => {\n setValue({ start: preset.start, end: preset.end });\n setOpen(false);\n }}\n >\n {preset.label}\n </button>\n ))}\n </div>\n ) : null}\n <Calendar {...shared} autoFocus range={shown} onSelect={pick} />\n </div>\n </Field>\n );\n}\n","// Client (a portal). Radix places the content, traps nothing, closes on Escape and on an outside click, and returns\n// the focus to the trigger.\nimport { Popover as PopoverPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\n\nimport { cn } from \"../cn\";\nimport { floating } from \"../floating\";\n\nexport type PopoverContentProps = React.ComponentProps<typeof PopoverPrimitive.Content> & {\n /** The element the portal renders into (default: document.body). */\n container?: HTMLElement | null;\n};\n\nexport function PopoverContent({ sideOffset = 8, collisionPadding = 8, container, className, ...props }: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal container={container}>\n <PopoverPrimitive.Content\n sideOffset={sideOffset}\n collisionPadding={collisionPadding}\n className={cn(floating, \"w-72 max-w-(--radix-popover-content-available-width) p-4 origin-(--radix-popover-content-transform-origin)\", className)}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\n/** `Popover.Root/Trigger/Anchor/Content/Close`. `open`/`defaultOpen` + `onOpenChange`. */\nexport const Popover = {\n Root: PopoverPrimitive.Root,\n Trigger: PopoverPrimitive.Trigger,\n Anchor: PopoverPrimitive.Anchor,\n Close: PopoverPrimitive.Close,\n Content: PopoverContent,\n};\n"],"mappings":";;;;;;;;;;;;;;;AAIA,SAAS,YAAY,yBAAyB;AAC9C,YAAY,WAAW;AACvB,SAAS,UAAU;AAiMb,SAEI,KAFJ;AAxLC,IAAM,WAAW,GAAG;AAAA,EACzB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,KACE;AAAA,IAEF,MAAM;AAAA,IACN,SAAS;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