acai-ui-library 0.1.21 → 0.1.23
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/components/ai-chatbot-logo-glyph.cjs +31 -0
- package/dist/components/ai-chatbot-logo-glyph.cjs.map +1 -0
- package/dist/components/ai-chatbot-logo-glyph.d.cts +3 -0
- package/dist/components/ai-chatbot-logo-glyph.d.ts +3 -0
- package/dist/components/ai-chatbot-logo-glyph.js +6 -0
- package/dist/components/ai-chatbot-logo-glyph.js.map +1 -0
- package/dist/components/ai-chatbot-logo.cjs +136 -0
- package/dist/components/ai-chatbot-logo.cjs.map +1 -0
- package/dist/components/ai-chatbot-logo.d.cts +13 -0
- package/dist/components/ai-chatbot-logo.d.ts +13 -0
- package/dist/components/ai-chatbot-logo.js +102 -0
- package/dist/components/ai-chatbot-logo.js.map +1 -0
- package/dist/components/app-launcher.cjs +224 -0
- package/dist/components/app-launcher.cjs.map +1 -0
- package/dist/components/app-launcher.d.cts +24 -0
- package/dist/components/app-launcher.d.ts +24 -0
- package/dist/components/app-launcher.js +190 -0
- package/dist/components/app-launcher.js.map +1 -0
- package/dist/components/calendar.cjs +13 -5
- package/dist/components/calendar.cjs.map +1 -1
- package/dist/components/calendar.js +15 -7
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/date-picker.cjs +17 -7
- package/dist/components/date-picker.cjs.map +1 -1
- package/dist/components/date-picker.js +23 -13
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-time-picker.cjs +13 -5
- package/dist/components/date-time-picker.cjs.map +1 -1
- package/dist/components/date-time-picker.js +28 -20
- package/dist/components/date-time-picker.js.map +1 -1
- package/dist/components/help-widget/app-id-typecheck.cjs +34 -0
- package/dist/components/help-widget/app-id-typecheck.cjs.map +1 -0
- package/dist/components/help-widget/app-id-typecheck.d.cts +17 -0
- package/dist/components/help-widget/app-id-typecheck.d.ts +17 -0
- package/dist/components/help-widget/app-id-typecheck.js +8 -0
- package/dist/components/help-widget/app-id-typecheck.js.map +1 -0
- package/dist/components/help-widget/consent-dialog.cjs +276 -0
- package/dist/components/help-widget/consent-dialog.cjs.map +1 -0
- package/dist/components/help-widget/consent-dialog.d.cts +17 -0
- package/dist/components/help-widget/consent-dialog.d.ts +17 -0
- package/dist/components/help-widget/consent-dialog.js +239 -0
- package/dist/components/help-widget/consent-dialog.js.map +1 -0
- package/dist/components/help-widget/help-session-banner.cjs +85 -0
- package/dist/components/help-widget/help-session-banner.cjs.map +1 -0
- package/dist/components/help-widget/help-session-banner.d.cts +17 -0
- package/dist/components/help-widget/help-session-banner.d.ts +17 -0
- package/dist/components/help-widget/help-session-banner.js +50 -0
- package/dist/components/help-widget/help-session-banner.js.map +1 -0
- package/dist/components/help-widget/help-widget.cjs +503 -0
- package/dist/components/help-widget/help-widget.cjs.map +1 -0
- package/dist/components/help-widget/help-widget.d.cts +32 -0
- package/dist/components/help-widget/help-widget.d.ts +32 -0
- package/dist/components/help-widget/help-widget.js +468 -0
- package/dist/components/help-widget/help-widget.js.map +1 -0
- package/dist/components/help-widget/highlight-overlay.cjs +84 -0
- package/dist/components/help-widget/highlight-overlay.cjs.map +1 -0
- package/dist/components/help-widget/highlight-overlay.d.cts +24 -0
- package/dist/components/help-widget/highlight-overlay.d.ts +24 -0
- package/dist/components/help-widget/highlight-overlay.js +49 -0
- package/dist/components/help-widget/highlight-overlay.js.map +1 -0
- package/dist/components/help-widget/use-help-session.cjs +85 -0
- package/dist/components/help-widget/use-help-session.cjs.map +1 -0
- package/dist/components/help-widget/use-help-session.d.cts +46 -0
- package/dist/components/help-widget/use-help-session.d.ts +46 -0
- package/dist/components/help-widget/use-help-session.js +50 -0
- package/dist/components/help-widget/use-help-session.js.map +1 -0
- package/dist/index.cjs +665 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +699 -126
- package/dist/index.js.map +1 -1
- package/dist/lib/app-ids.cjs +58 -0
- package/dist/lib/app-ids.cjs.map +1 -0
- package/dist/lib/app-ids.d.cts +12 -0
- package/dist/lib/app-ids.d.ts +12 -0
- package/dist/lib/app-ids.js +32 -0
- package/dist/lib/app-ids.js.map +1 -0
- package/dist/lib/mask-snapshot.cjs +66 -0
- package/dist/lib/mask-snapshot.cjs.map +1 -0
- package/dist/lib/mask-snapshot.d.cts +16 -0
- package/dist/lib/mask-snapshot.d.ts +16 -0
- package/dist/lib/mask-snapshot.js +41 -0
- package/dist/lib/mask-snapshot.js.map +1 -0
- package/package.json +2 -1
|
@@ -87,8 +87,14 @@ Button.displayName = "Button";
|
|
|
87
87
|
|
|
88
88
|
// src/components/calendar.tsx
|
|
89
89
|
import { DayPicker } from "react-day-picker";
|
|
90
|
-
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
91
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
90
|
+
import { ChevronDown, ChevronLeft, ChevronRight } from "lucide-react";
|
|
91
|
+
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
92
|
+
function CalendarSelect({ children, ...selectProps }) {
|
|
93
|
+
return /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx2("select", { ...selectProps, children }),
|
|
95
|
+
/* @__PURE__ */ jsx2(ChevronDown, { "aria-hidden": "true", className: "pointer-events-none absolute end-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
92
98
|
var DEFAULT_YEARS_BACK = 10;
|
|
93
99
|
var DEFAULT_YEARS_FORWARD = 10;
|
|
94
100
|
function Calendar({
|
|
@@ -111,16 +117,16 @@ function Calendar({
|
|
|
111
117
|
showOutsideDays,
|
|
112
118
|
className: cn("w-[260px] rounded-lg p-3", className),
|
|
113
119
|
classNames: {
|
|
114
|
-
months: "flex flex-col",
|
|
120
|
+
months: "relative flex flex-col",
|
|
115
121
|
month: "space-y-3",
|
|
116
122
|
month_caption: "relative flex h-8 items-center justify-center",
|
|
117
123
|
caption_label: "text-sm font-medium hidden",
|
|
118
|
-
nav: "flex items-center",
|
|
124
|
+
nav: "absolute inset-x-0 top-0 z-10 flex h-8 items-center pointer-events-none",
|
|
119
125
|
button_previous: cn(
|
|
120
|
-
"absolute start-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
126
|
+
"pointer-events-auto absolute start-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
121
127
|
),
|
|
122
128
|
button_next: cn(
|
|
123
|
-
"absolute end-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
129
|
+
"pointer-events-auto absolute end-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
124
130
|
),
|
|
125
131
|
month_grid: "w-full border-collapse",
|
|
126
132
|
weekdays: "flex w-full",
|
|
@@ -137,8 +143,9 @@ function Calendar({
|
|
|
137
143
|
disabled: "[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default",
|
|
138
144
|
range_middle: "[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none",
|
|
139
145
|
range_start: "[&>button]:rounded-e-none",
|
|
146
|
+
dropdown_root: "relative",
|
|
140
147
|
dropdowns: "flex items-center gap-1.5 justify-center",
|
|
141
|
-
dropdown: "h-7 rounded-md border border-input bg-background
|
|
148
|
+
dropdown: "h-7 appearance-none rounded-md border border-input bg-background ps-2 pe-6 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1",
|
|
142
149
|
months_dropdown: "w-[104px]",
|
|
143
150
|
years_dropdown: "w-[72px]",
|
|
144
151
|
hidden: "invisible",
|
|
@@ -146,6 +153,7 @@ function Calendar({
|
|
|
146
153
|
},
|
|
147
154
|
captionLayout,
|
|
148
155
|
components: {
|
|
156
|
+
Select: CalendarSelect,
|
|
149
157
|
Chevron: ({ orientation }) => {
|
|
150
158
|
const Icon = orientation === "left" ? ChevronLeft : ChevronRight;
|
|
151
159
|
return /* @__PURE__ */ jsx2(Icon, { className: "size-4" });
|
|
@@ -179,9 +187,11 @@ var PopoverContent = React2.forwardRef(({ className, align = "center", sideOffse
|
|
|
179
187
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
180
188
|
|
|
181
189
|
// src/components/date-picker.tsx
|
|
182
|
-
import { jsx as jsx4, jsxs as
|
|
190
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
183
191
|
function formatDate(d) {
|
|
184
|
-
|
|
192
|
+
const day = String(d.getDate()).padStart(2, "0");
|
|
193
|
+
const month = String(d.getMonth() + 1).padStart(2, "0");
|
|
194
|
+
return `${day}/${month}/${d.getFullYear()}`;
|
|
185
195
|
}
|
|
186
196
|
function DatePicker({
|
|
187
197
|
date,
|
|
@@ -202,10 +212,10 @@ function DatePicker({
|
|
|
202
212
|
if (range.from) return formatDate(range.from);
|
|
203
213
|
return /* @__PURE__ */ jsx4("span", { children: placeholder });
|
|
204
214
|
}
|
|
205
|
-
return date
|
|
215
|
+
return formatDate(date);
|
|
206
216
|
}, [date, mode, placeholder]);
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */ jsx4(PopoverTrigger, { asChild: true, children: /* @__PURE__ */
|
|
217
|
+
return /* @__PURE__ */ jsxs3(Popover, { children: [
|
|
218
|
+
/* @__PURE__ */ jsx4(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs3(
|
|
209
219
|
Button,
|
|
210
220
|
{
|
|
211
221
|
variant: "outline",
|
|
@@ -220,7 +230,7 @@ function DatePicker({
|
|
|
220
230
|
]
|
|
221
231
|
}
|
|
222
232
|
) }),
|
|
223
|
-
/* @__PURE__ */ jsx4(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ jsx4(PopoverContent, { className: "w-auto p-0", align: "start", children: /* @__PURE__ */ jsxs3("div", { className: "flex", children: [
|
|
224
234
|
presets && presets.length > 0 && /* @__PURE__ */ jsx4("div", { className: "flex flex-col gap-1 border-e p-2 min-w-[140px]", children: presets.map((preset) => /* @__PURE__ */ jsx4(
|
|
225
235
|
Button,
|
|
226
236
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/date-picker.tsx","../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/calendar.tsx","../../src/components/popover.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport type { DateRange, Matcher } from \"react-day-picker\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Calendar } from \"./calendar\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\n\nexport type DatePickerPreset =\n | { label: string; value: Date }\n | { label: string; value: { from: Date; to: Date } }\n\nexport interface DatePickerProps {\n /** Selected value. For `mode=\"single\"` this is a Date, for `mode=\"range\"` this is a range object. */\n date?: Date | DateRange\n /** Called with the new selection. */\n onDateChange?: (date: Date | DateRange | undefined) => void\n /** Selection mode. Defaults to \"single\". */\n mode?: \"single\" | \"range\"\n /** Placeholder for the trigger when no date is picked. */\n placeholder?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Optional date format string — reserved for future use. */\n formatStr?: string\n /** Optional preset list rendered in a sidebar to the left of the calendar. */\n presets?: DatePickerPreset[]\n /** Passed through to the underlying Calendar. */\n disabled?: Matcher | Matcher[]\n}\n\nfunction formatDate(d: Date): string {\n return d.toLocaleDateString()\n}\n\nfunction DatePicker({\n date,\n onDateChange,\n mode = \"single\",\n placeholder = \"Pick a date\",\n className,\n presets,\n disabled,\n}: DatePickerProps) {\n const label = React.useMemo(() => {\n if (!date) return <span>{placeholder}</span>\n if (mode === \"range\") {\n const range = date as DateRange\n if (range.from && range.to) {\n return `${formatDate(range.from)} – ${formatDate(range.to)}`\n }\n if (range.from) return formatDate(range.from)\n return <span>{placeholder}</span>\n }\n return (date as Date).toLocaleDateString()\n }, [date, mode, placeholder])\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n >\n <CalendarIcon className=\"me-2 h-4 w-4\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div className=\"flex\">\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-e p-2 min-w-[140px]\">\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start font-normal\"\n onClick={() => onDateChange?.(preset.value as Date | DateRange)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n {mode === \"range\" ? (\n <Calendar\n mode=\"range\"\n selected={date as DateRange | undefined}\n onSelect={(value) => onDateChange?.(value)}\n disabled={disabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={date as Date | undefined}\n onSelect={(value) => onDateChange?.(value)}\n disabled={disabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n )}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport { DatePicker }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link:\n \"text-primary underline-offset-4 hover:underline\",\n success:\n \"bg-success text-success-foreground hover:bg-success-hover\",\n },\n size: {\n xs: \"h-7 px-2.5 text-xs\",\n sm: \"h-9 px-3\",\n default: \"h-10 px-4 py-2\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10\",\n \"icon-sm\": \"h-8 w-8\",\n },\n shape: {\n default: \"rounded-md\",\n rounded: \"rounded-lg\",\n pill: \"rounded-full\",\n square: \"rounded-none\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n shape: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n prefixIcon?: React.ReactNode\n suffixIcon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n prefixIcon,\n suffixIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, shape, className }))}\n ref={ref}\n disabled={isDisabled}\n {...props}\n >\n {loading && <Loader2 className=\"animate-spin\" />}\n {!loading && prefixIcon}\n {children}\n {suffixIcon}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { DayPicker } from \"react-day-picker\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\n/**\n * How far the year dropdown reaches when the caller gives no bounds.\n *\n * `captionLayout` defaults to \"dropdown\" here, and react-day-picker then falls\n * back to [currentYear - 100, currentYear] for the year list. That is wrong in\n * both directions: a hundred dead years to scroll past, and no future year at\n * all - a deadline could not be set beyond December of the current year.\n * Callers that know their range pass `startMonth` / `endMonth` and these are\n * not used.\n */\nconst DEFAULT_YEARS_BACK = 10\nconst DEFAULT_YEARS_FORWARD = 10\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"dropdown\",\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const now = new Date()\n const defaultedStartMonth =\n startMonth ?? new Date(now.getFullYear() - DEFAULT_YEARS_BACK, 0, 1)\n const defaultedEndMonth =\n endMonth ?? new Date(now.getFullYear() + DEFAULT_YEARS_FORWARD, 11, 1)\n\n return (\n <DayPicker\n startMonth={defaultedStartMonth}\n endMonth={defaultedEndMonth}\n showOutsideDays={showOutsideDays}\n className={cn(\"w-[260px] rounded-lg p-3\", className)}\n classNames={{\n months: \"flex flex-col\",\n month: \"space-y-3\",\n month_caption: \"relative flex h-8 items-center justify-center\",\n caption_label: \"text-sm font-medium hidden\",\n nav: \"flex items-center\",\n button_previous: cn(\n \"absolute start-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n button_next: cn(\n \"absolute end-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: \"flex w-full\",\n weekday:\n \"flex-1 h-8 flex items-center justify-center text-[11px] font-medium text-muted-foreground uppercase tracking-wider\",\n week: \"flex w-full mt-1\",\n day: \"flex-1 h-8 p-0 relative focus-within:z-20 flex items-center justify-center text-sm\",\n day_button: cn(\n \"inline-flex size-8 items-center justify-center rounded-md bg-transparent text-sm font-normal cursor-pointer border-none hover:bg-muted transition-colors\"\n ),\n range_end: \"day-range-end\",\n selected:\n \"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:font-medium\",\n today: \"[&>button]:font-semibold [&>button]:text-primary\",\n outside:\n \"day-outside [&>button]:bg-transparent [&>button]:text-muted-foreground [&>button]:opacity-50\",\n disabled: \"[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default\",\n range_middle:\n \"[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none\",\n range_start: \"[&>button]:rounded-e-none\",\n dropdowns: \"flex items-center gap-1.5 justify-center\",\n dropdown:\n \"h-7 rounded-md border border-input bg-background px-2 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1\",\n months_dropdown: \"w-[104px]\",\n years_dropdown: \"w-[72px]\",\n hidden: \"invisible\",\n ...classNames,\n }}\n captionLayout={captionLayout}\n components={{\n Chevron: ({ orientation }) => {\n const Icon = orientation === \"left\" ? ChevronLeft : ChevronRight\n return <Icon className=\"size-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,SAAS,oBAAoB;;;ACD7B,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,eAAe;AA4ElB,SAMc,KANd;AAzEN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA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AA;AAAA,QAAC;AAAA;AAAA,UAEC,SAAQ;AAAA,UACR,MAAK;AAAA,UACL,WAAU;AAAA,UACV,SAAS,MAAM,eAAe,OAAO,KAAyB;AAAA,UAE7D,iBAAO;AAAA;AAAA,QANH,OAAO;AAAA,MAOd,CACD,GACH;AAAA,MAEF,gBAAAA,KAAC,SACE,mBAAS,UACR,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU;AAAA,UACV,UAAU,CAAC,UAAU,eAAe,KAAK;AAAA,UACzC;AAAA,UAGA,WAAS;AAAA;AAAA,MACX,IAEA,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU;AAAA,UACV,UAAU,CAAC,UAAU,eAAe,KAAK;AAAA,UACzC;AAAA,UAGA,WAAS;AAAA;AAAA,MACX,GAEJ;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["React","jsx","React","jsx","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/date-picker.tsx","../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/calendar.tsx","../../src/components/popover.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { CalendarIcon } from \"lucide-react\"\nimport type { DateRange, Matcher } from \"react-day-picker\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Calendar } from \"./calendar\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\n\nexport type DatePickerPreset =\n | { label: string; value: Date }\n | { label: string; value: { from: Date; to: Date } }\n\nexport interface DatePickerProps {\n /** Selected value. For `mode=\"single\"` this is a Date, for `mode=\"range\"` this is a range object. */\n date?: Date | DateRange\n /** Called with the new selection. */\n onDateChange?: (date: Date | DateRange | undefined) => void\n /** Selection mode. Defaults to \"single\". */\n mode?: \"single\" | \"range\"\n /** Placeholder for the trigger when no date is picked. */\n placeholder?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Optional date format string — reserved for future use. */\n formatStr?: string\n /** Optional preset list rendered in a sidebar to the left of the calendar. */\n presets?: DatePickerPreset[]\n /** Passed through to the underlying Calendar. */\n disabled?: Matcher | Matcher[]\n}\n\nfunction formatDate(d: Date): string {\n const day = String(d.getDate()).padStart(2, \"0\")\n const month = String(d.getMonth() + 1).padStart(2, \"0\")\n return `${day}/${month}/${d.getFullYear()}`\n}\n\nfunction DatePicker({\n date,\n onDateChange,\n mode = \"single\",\n placeholder = \"Pick a date\",\n className,\n presets,\n disabled,\n}: DatePickerProps) {\n const label = React.useMemo(() => {\n if (!date) return <span>{placeholder}</span>\n if (mode === \"range\") {\n const range = date as DateRange\n if (range.from && range.to) {\n return `${formatDate(range.from)} – ${formatDate(range.to)}`\n }\n if (range.from) return formatDate(range.from)\n return <span>{placeholder}</span>\n }\n return formatDate(date as Date)\n }, [date, mode, placeholder])\n\n return (\n <Popover>\n <PopoverTrigger asChild>\n <Button\n variant=\"outline\"\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n className\n )}\n >\n <CalendarIcon className=\"me-2 h-4 w-4\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <div className=\"flex\">\n {presets && presets.length > 0 && (\n <div className=\"flex flex-col gap-1 border-e p-2 min-w-[140px]\">\n {presets.map((preset) => (\n <Button\n key={preset.label}\n variant=\"ghost\"\n size=\"sm\"\n className=\"justify-start font-normal\"\n onClick={() => onDateChange?.(preset.value as Date | DateRange)}\n >\n {preset.label}\n </Button>\n ))}\n </div>\n )}\n <div>\n {mode === \"range\" ? (\n <Calendar\n mode=\"range\"\n selected={date as DateRange | undefined}\n onSelect={(value) => onDateChange?.(value)}\n disabled={disabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n ) : (\n <Calendar\n mode=\"single\"\n selected={date as Date | undefined}\n onSelect={(value) => onDateChange?.(value)}\n disabled={disabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n )}\n </div>\n </div>\n </PopoverContent>\n </Popover>\n )\n}\n\nexport { DatePicker }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link:\n \"text-primary underline-offset-4 hover:underline\",\n success:\n \"bg-success text-success-foreground hover:bg-success-hover\",\n },\n size: {\n xs: \"h-7 px-2.5 text-xs\",\n sm: \"h-9 px-3\",\n default: \"h-10 px-4 py-2\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10\",\n \"icon-sm\": \"h-8 w-8\",\n },\n shape: {\n default: \"rounded-md\",\n rounded: \"rounded-lg\",\n pill: \"rounded-full\",\n square: \"rounded-none\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n shape: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n prefixIcon?: React.ReactNode\n suffixIcon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n prefixIcon,\n suffixIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, shape, className }))}\n ref={ref}\n disabled={isDisabled}\n {...props}\n >\n {loading && <Loader2 className=\"animate-spin\" />}\n {!loading && prefixIcon}\n {children}\n {suffixIcon}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { DayPicker } from \"react-day-picker\"\nimport { ChevronDown, ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\n// Module-level so its identity is stable; an inline component remounts the <select> (losing focus) on every Calendar render.\nfunction CalendarSelect({ children, ...selectProps }: React.SelectHTMLAttributes<HTMLSelectElement>) {\n return (\n <>\n <select {...selectProps}>{children}</select>\n <ChevronDown aria-hidden=\"true\" className=\"pointer-events-none absolute end-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n </>\n )\n}\n\n/**\n * How far the year dropdown reaches when the caller gives no bounds.\n *\n * `captionLayout` defaults to \"dropdown\" here, and react-day-picker then falls\n * back to [currentYear - 100, currentYear] for the year list. That is wrong in\n * both directions: a hundred dead years to scroll past, and no future year at\n * all - a deadline could not be set beyond December of the current year.\n * Callers that know their range pass `startMonth` / `endMonth` and these are\n * not used.\n */\nconst DEFAULT_YEARS_BACK = 10\nconst DEFAULT_YEARS_FORWARD = 10\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"dropdown\",\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const now = new Date()\n const defaultedStartMonth =\n startMonth ?? new Date(now.getFullYear() - DEFAULT_YEARS_BACK, 0, 1)\n const defaultedEndMonth =\n endMonth ?? new Date(now.getFullYear() + DEFAULT_YEARS_FORWARD, 11, 1)\n\n return (\n <DayPicker\n startMonth={defaultedStartMonth}\n endMonth={defaultedEndMonth}\n showOutsideDays={showOutsideDays}\n className={cn(\"w-[260px] rounded-lg p-3\", className)}\n classNames={{\n months: \"relative flex flex-col\",\n month: \"space-y-3\",\n month_caption: \"relative flex h-8 items-center justify-center\",\n caption_label: \"text-sm font-medium hidden\",\n nav: \"absolute inset-x-0 top-0 z-10 flex h-8 items-center pointer-events-none\",\n button_previous: cn(\n \"pointer-events-auto absolute start-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n button_next: cn(\n \"pointer-events-auto absolute end-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: \"flex w-full\",\n weekday:\n \"flex-1 h-8 flex items-center justify-center text-[11px] font-medium text-muted-foreground uppercase tracking-wider\",\n week: \"flex w-full mt-1\",\n day: \"flex-1 h-8 p-0 relative focus-within:z-20 flex items-center justify-center text-sm\",\n day_button: cn(\n \"inline-flex size-8 items-center justify-center rounded-md bg-transparent text-sm font-normal cursor-pointer border-none hover:bg-muted transition-colors\"\n ),\n range_end: \"day-range-end\",\n selected:\n \"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:font-medium\",\n today: \"[&>button]:font-semibold [&>button]:text-primary\",\n outside:\n \"day-outside [&>button]:bg-transparent [&>button]:text-muted-foreground [&>button]:opacity-50\",\n disabled: \"[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default\",\n range_middle:\n \"[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none\",\n range_start: \"[&>button]:rounded-e-none\",\n dropdown_root: \"relative\",\n dropdowns: \"flex items-center gap-1.5 justify-center\",\n dropdown:\n \"h-7 appearance-none rounded-md border border-input bg-background ps-2 pe-6 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1\",\n months_dropdown: \"w-[104px]\",\n years_dropdown: \"w-[72px]\",\n hidden: \"invisible\",\n ...classNames,\n }}\n captionLayout={captionLayout}\n components={{\n Select: CalendarSelect,\n Chevron: ({ orientation }) => {\n const Icon = orientation === \"left\" ? ChevronLeft : ChevronRight\n return <Icon className=\"size-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n"],"mappings":";AAAA,YAAYA,YAAW;AACvB,SAAS,oBAAoB;;;ACD7B,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,eAAe;AA4ElB,SAMc,KANd;AAzEN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,IACT;AAAA,EACF;AACF;AAWA,IAAM,SAAe;AAAA,EACnB,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,OAAO,UAAU,OAAO;AAC9B,UAAM,aAAa,YAAY;AAE/B,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,GAAG,eAAe,EAAE,SAAS,MAAM,OAAO,UAAU,CAAC,CAAC;AAAA,QAC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AC,SACE,mBAAS,UACR,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU;AAAA,UACV,UAAU,CAAC,UAAU,eAAe,KAAK;AAAA,UACzC;AAAA,UAGA,WAAS;AAAA;AAAA,MACX,IAEA,gBAAAA;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL,UAAU;AAAA,UACV,UAAU,CAAC,UAAU,eAAe,KAAK;AAAA,UACzC;AAAA,UAGA,WAAS;AAAA;AAAA,MACX,GAEJ;AAAA,OACF,GACF;AAAA,KACF;AAEJ;","names":["React","jsx","jsxs","React","jsx","jsx","jsxs"]}
|
|
@@ -123,6 +123,12 @@ Button.displayName = "Button";
|
|
|
123
123
|
var import_react_day_picker = require("react-day-picker");
|
|
124
124
|
var import_lucide_react2 = require("lucide-react");
|
|
125
125
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
126
|
+
function CalendarSelect({ children, ...selectProps }) {
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
|
|
128
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("select", { ...selectProps, children }),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ChevronDown, { "aria-hidden": "true", className: "pointer-events-none absolute end-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" })
|
|
130
|
+
] });
|
|
131
|
+
}
|
|
126
132
|
var DEFAULT_YEARS_BACK = 10;
|
|
127
133
|
var DEFAULT_YEARS_FORWARD = 10;
|
|
128
134
|
function Calendar({
|
|
@@ -145,16 +151,16 @@ function Calendar({
|
|
|
145
151
|
showOutsideDays,
|
|
146
152
|
className: cn("w-[260px] rounded-lg p-3", className),
|
|
147
153
|
classNames: {
|
|
148
|
-
months: "flex flex-col",
|
|
154
|
+
months: "relative flex flex-col",
|
|
149
155
|
month: "space-y-3",
|
|
150
156
|
month_caption: "relative flex h-8 items-center justify-center",
|
|
151
157
|
caption_label: "text-sm font-medium hidden",
|
|
152
|
-
nav: "flex items-center",
|
|
158
|
+
nav: "absolute inset-x-0 top-0 z-10 flex h-8 items-center pointer-events-none",
|
|
153
159
|
button_previous: cn(
|
|
154
|
-
"absolute start-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
160
|
+
"pointer-events-auto absolute start-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
155
161
|
),
|
|
156
162
|
button_next: cn(
|
|
157
|
-
"absolute end-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
163
|
+
"pointer-events-auto absolute end-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
|
|
158
164
|
),
|
|
159
165
|
month_grid: "w-full border-collapse",
|
|
160
166
|
weekdays: "flex w-full",
|
|
@@ -171,8 +177,9 @@ function Calendar({
|
|
|
171
177
|
disabled: "[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default",
|
|
172
178
|
range_middle: "[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none",
|
|
173
179
|
range_start: "[&>button]:rounded-e-none",
|
|
180
|
+
dropdown_root: "relative",
|
|
174
181
|
dropdowns: "flex items-center gap-1.5 justify-center",
|
|
175
|
-
dropdown: "h-7 rounded-md border border-input bg-background
|
|
182
|
+
dropdown: "h-7 appearance-none rounded-md border border-input bg-background ps-2 pe-6 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1",
|
|
176
183
|
months_dropdown: "w-[104px]",
|
|
177
184
|
years_dropdown: "w-[72px]",
|
|
178
185
|
hidden: "invisible",
|
|
@@ -180,6 +187,7 @@ function Calendar({
|
|
|
180
187
|
},
|
|
181
188
|
captionLayout,
|
|
182
189
|
components: {
|
|
190
|
+
Select: CalendarSelect,
|
|
183
191
|
Chevron: ({ orientation }) => {
|
|
184
192
|
const Icon = orientation === "left" ? import_lucide_react2.ChevronLeft : import_lucide_react2.ChevronRight;
|
|
185
193
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Icon, { className: "size-4" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/date-time-picker.tsx","../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/calendar.tsx","../../src/components/popover.tsx","../../src/components/time-picker.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { CalendarClockIcon } from \"lucide-react\"\nimport type { Matcher } from \"react-day-picker\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Calendar } from \"./calendar\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\nimport {\n TimePickerPanel,\n buildAllowedSlots,\n buildMinuteList,\n formatTimeLabel,\n formatTimeValue,\n isTimeInRange,\n parseTimeValue,\n snapToAllowedSlot,\n type TimeValue,\n} from \"./time-picker\"\n\nfunction startOfDay(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\nfunction isSameDay(a: Date, b: Date): boolean {\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n )\n}\n\n/** Minutes since midnight for a Date, in local time. */\nfunction minutesOfDay(date: Date): number {\n return date.getHours() * 60 + date.getMinutes()\n}\n\n/** A new Date on `day` at `minutes` past midnight, seconds zeroed. */\nfunction withTime(day: Date, minutes: number): Date {\n return new Date(\n day.getFullYear(),\n day.getMonth(),\n day.getDate(),\n Math.floor(minutes / 60),\n minutes % 60,\n 0,\n 0\n )\n}\n\nexport interface DateTimePickerProps {\n /** The selected moment. One value covers both the date and the time. */\n value?: Date\n /**\n * Called with the new moment, or with undefined when the value is cleared.\n * Fires only on Apply — edits inside the popover are held as a draft until\n * then.\n */\n onValueChange?: (value: Date | undefined) => void\n /**\n * Earliest selectable moment. Days before it are disabled in the calendar\n * and, on the boundary day itself, the times before it are disabled too.\n */\n minDate?: Date\n /**\n * Latest selectable moment. Days after it are disabled in the calendar and,\n * on the boundary day itself, the times after it are disabled too.\n */\n maxDate?: Date\n /** Extra day matchers passed through to the underlying Calendar. */\n disabledDates?: Matcher | Matcher[]\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /**\n * Time applied when a date is picked before any time has been chosen, as\n * \"HH:mm\". Defaults to \"09:00\" and is moved to the nearest allowed slot when\n * the bound forbids it.\n */\n defaultTime?: TimeValue\n /** Trigger text shown when nothing is selected. */\n placeholder?: string\n /** Overrides how the selected moment is rendered on the trigger. */\n formatValue?: (value: Date) => string\n /** Shows a Clear action in the popover. Defaults to true. */\n clearable?: boolean\n /** Text of the Clear action, which empties the draft. Defaults to \"Clear\". */\n clearLabel?: string\n /** Text of the action that commits the draft. Defaults to \"Apply\". */\n applyLabel?: string\n /** Text of the action that discards the draft. Defaults to \"Cancel\". */\n cancelLabel?: string\n /** Heading above the time columns. Defaults to \"Time\". */\n timeLabel?: string\n /** Disables the whole control. */\n disabled?: boolean\n /** Accessible name for the trigger. Defaults to the placeholder. */\n \"aria-label\"?: string\n /** Id of an element that labels the trigger. */\n \"aria-labelledby\"?: string\n /** Id applied to the trigger button. */\n id?: string\n /** Name reported on a hidden input, so the value posts with a plain form. */\n name?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Classname applied to the popover content. */\n contentClassName?: string\n /** Controlled open state of the popover. */\n open?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Side the popover is aligned to. Defaults to \"start\". */\n align?: \"start\" | \"center\" | \"end\"\n}\n\n/**\n * A date and a time in one popover, reporting a single Date. Drop-in\n * replacement for a native `datetime-local` input: the calendar and the time\n * columns write to the same value, and `minDate` / `maxDate` are enforced on\n * both halves, including on the boundary day where only part of the day is\n * still allowed.\n *\n * Edits are committed explicitly. Picking a day, an hour, a minute or a period\n * moves a draft held inside the popover; `onValueChange` fires once, on Apply.\n * Cancel, Escape and a click outside all discard the draft, so a stray click\n * cannot write a deadline.\n */\nconst DateTimePicker = React.forwardRef<HTMLButtonElement, DateTimePickerProps>(\n (\n {\n value,\n onValueChange,\n minDate,\n maxDate,\n disabledDates,\n minuteStep = 5,\n hourCycle = 12,\n defaultTime = \"09:00\",\n placeholder = \"Pick a date and time\",\n formatValue,\n clearable = true,\n clearLabel = \"Clear\",\n applyLabel = \"Apply\",\n cancelLabel = \"Cancel\",\n timeLabel = \"Time\",\n disabled,\n id,\n name,\n className,\n contentClassName,\n open,\n onOpenChange,\n align = \"start\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n },\n ref\n ) => {\n // Every interaction inside the popover edits this draft, never `value`.\n // The trigger keeps showing `value`, so an uncommitted edit can never be\n // mistaken for a saved one.\n const [draft, setDraft] = React.useState<Date | undefined>(value)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const isOpen = open ?? uncontrolledOpen\n\n // Opening re-seeds the draft. The effect covers a controlled consumer that\n // flips `open` itself, which never reaches our onOpenChange handler.\n const wasOpen = React.useRef(isOpen)\n React.useEffect(() => {\n if (isOpen && !wasOpen.current) setDraft(value)\n wasOpen.current = isOpen\n }, [isOpen, value])\n\n const setOpenState = (next: boolean) => {\n if (open === undefined) setUncontrolledOpen(next)\n onOpenChange?.(next)\n }\n\n // The trigger, Escape and a click outside all land here. None of them\n // commits: the draft goes back to `value` whichever way the popover moves.\n const handleOpenChange = (next: boolean) => {\n setDraft(value)\n setOpenState(next)\n }\n\n const handleCancel = () => {\n setDraft(value)\n setOpenState(false)\n }\n\n // The one path that reports to the consumer, including the undefined left\n // behind by Clear.\n const handleApply = () => {\n onValueChange?.(draft)\n setOpenState(false)\n }\n\n // The day the time columns are bound against. Without a draft yet that is\n // today, pulled inside the allowed range so the columns are usable.\n const activeDay = React.useMemo(() => {\n if (draft) return startOfDay(draft)\n const today = startOfDay(new Date())\n if (minDate && today < startOfDay(minDate)) return startOfDay(minDate)\n if (maxDate && today > startOfDay(maxDate)) return startOfDay(maxDate)\n return today\n }, [draft, minDate, maxDate])\n\n /** The time window still open on a given day, once the bound is applied. */\n const timeWindowFor = React.useCallback(\n (day: Date): { minTime?: TimeValue; maxTime?: TimeValue } => ({\n minTime:\n minDate && isSameDay(day, minDate)\n ? formatTimeValue(minutesOfDay(minDate))\n : undefined,\n maxTime:\n maxDate && isSameDay(day, maxDate)\n ? formatTimeValue(minutesOfDay(maxDate))\n : undefined,\n }),\n [minDate, maxDate]\n )\n\n const activeWindow = timeWindowFor(activeDay)\n\n // The year dropdown follows the bound rather than Calendar's generic\n // default: with minDate set to now, a deadline picker offering 2016 would\n // be offering years every one of whose days it then refuses.\n const calendarStartMonth = React.useMemo(\n () => (minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), 1) : undefined),\n [minDate],\n )\n const calendarEndMonth = React.useMemo(\n () => (maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), 1) : undefined),\n [maxDate],\n )\n\n const calendarDisabled = React.useMemo(() => {\n const matchers: Matcher[] = []\n if (minDate) matchers.push({ before: startOfDay(minDate) })\n if (maxDate) matchers.push({ after: startOfDay(maxDate) })\n if (Array.isArray(disabledDates)) matchers.push(...disabledDates)\n else if (disabledDates !== undefined) matchers.push(disabledDates)\n return matchers\n }, [minDate, maxDate, disabledDates])\n\n const handleDaySelect = (day: Date | undefined) => {\n // Clicking the selected day again deselects in react-day-picker. A\n // deadline should not disappear by accident, so Clear is the only way out.\n if (!day) return\n const desired = draft ? minutesOfDay(draft) : (parseTimeValue(defaultTime) ?? 0)\n const { minTime, maxTime } = timeWindowFor(day)\n const min = parseTimeValue(minTime)\n const max = parseTimeValue(maxTime)\n if (isTimeInRange(desired, min, max)) {\n setDraft(withTime(day, desired))\n return\n }\n const snapped = snapToAllowedSlot(\n desired,\n buildAllowedSlots(buildMinuteList(minuteStep, desired % 60), min, max)\n )\n if (snapped === undefined) return\n setDraft(withTime(day, snapped))\n }\n\n const handleTimeChange = (next: TimeValue) => {\n const minutes = parseTimeValue(next)\n if (minutes === undefined) return\n setDraft(withTime(draft ?? activeDay, minutes))\n }\n\n const label = value\n ? (formatValue?.(value) ??\n `${value.toLocaleDateString()} ${formatTimeLabel(minutesOfDay(value), hourCycle)}`)\n : placeholder\n\n return (\n <Popover open={isOpen} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n id={id}\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? placeholder)}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n >\n <CalendarClockIcon className=\"me-2 h-4 w-4\" aria-hidden=\"true\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\"w-auto p-0\", contentClassName)}\n align={align}\n aria-label={ariaLabel ?? placeholder}\n >\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:divide-x sm:divide-border\">\n <Calendar\n mode=\"single\"\n selected={draft}\n defaultMonth={activeDay}\n startMonth={calendarStartMonth}\n endMonth={calendarEndMonth}\n onSelect={handleDaySelect}\n disabled={calendarDisabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n <div className=\"border-t border-border p-2 sm:border-t-0\">\n <div className=\"px-1 pb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground\">\n {timeLabel}\n </div>\n <TimePickerPanel\n value={draft ? formatTimeValue(minutesOfDay(draft)) : undefined}\n onValueChange={handleTimeChange}\n minTime={activeWindow.minTime}\n maxTime={activeWindow.maxTime}\n minuteStep={minuteStep}\n hourCycle={hourCycle}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-2 border-t border-border p-2\">\n {clearable && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n disabled={!draft}\n onClick={() => setDraft(undefined)}\n >\n {clearLabel}\n </Button>\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n onClick={handleCancel}\n >\n {cancelLabel}\n </Button>\n <Button type=\"button\" variant=\"default\" size=\"sm\" onClick={handleApply}>\n {applyLabel}\n </Button>\n </div>\n </div>\n </PopoverContent>\n {name && (\n <input\n type=\"hidden\"\n name={name}\n value={\n value\n ? `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, \"0\")}-${String(\n value.getDate()\n ).padStart(2, \"0\")}T${formatTimeValue(minutesOfDay(value))}`\n : \"\"\n }\n />\n )}\n </Popover>\n )\n }\n)\nDateTimePicker.displayName = \"DateTimePicker\"\n\nexport { DateTimePicker }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link:\n \"text-primary underline-offset-4 hover:underline\",\n success:\n \"bg-success text-success-foreground hover:bg-success-hover\",\n },\n size: {\n xs: \"h-7 px-2.5 text-xs\",\n sm: \"h-9 px-3\",\n default: \"h-10 px-4 py-2\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10\",\n \"icon-sm\": \"h-8 w-8\",\n },\n shape: {\n default: \"rounded-md\",\n rounded: \"rounded-lg\",\n pill: \"rounded-full\",\n square: \"rounded-none\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n shape: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n prefixIcon?: React.ReactNode\n suffixIcon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n prefixIcon,\n suffixIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, shape, className }))}\n ref={ref}\n disabled={isDisabled}\n {...props}\n >\n {loading && <Loader2 className=\"animate-spin\" />}\n {!loading && prefixIcon}\n {children}\n {suffixIcon}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { DayPicker } from \"react-day-picker\"\nimport { ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\n/**\n * How far the year dropdown reaches when the caller gives no bounds.\n *\n * `captionLayout` defaults to \"dropdown\" here, and react-day-picker then falls\n * back to [currentYear - 100, currentYear] for the year list. That is wrong in\n * both directions: a hundred dead years to scroll past, and no future year at\n * all - a deadline could not be set beyond December of the current year.\n * Callers that know their range pass `startMonth` / `endMonth` and these are\n * not used.\n */\nconst DEFAULT_YEARS_BACK = 10\nconst DEFAULT_YEARS_FORWARD = 10\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"dropdown\",\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const now = new Date()\n const defaultedStartMonth =\n startMonth ?? new Date(now.getFullYear() - DEFAULT_YEARS_BACK, 0, 1)\n const defaultedEndMonth =\n endMonth ?? new Date(now.getFullYear() + DEFAULT_YEARS_FORWARD, 11, 1)\n\n return (\n <DayPicker\n startMonth={defaultedStartMonth}\n endMonth={defaultedEndMonth}\n showOutsideDays={showOutsideDays}\n className={cn(\"w-[260px] rounded-lg p-3\", className)}\n classNames={{\n months: \"flex flex-col\",\n month: \"space-y-3\",\n month_caption: \"relative flex h-8 items-center justify-center\",\n caption_label: \"text-sm font-medium hidden\",\n nav: \"flex items-center\",\n button_previous: cn(\n \"absolute start-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n button_next: cn(\n \"absolute end-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: \"flex w-full\",\n weekday:\n \"flex-1 h-8 flex items-center justify-center text-[11px] font-medium text-muted-foreground uppercase tracking-wider\",\n week: \"flex w-full mt-1\",\n day: \"flex-1 h-8 p-0 relative focus-within:z-20 flex items-center justify-center text-sm\",\n day_button: cn(\n \"inline-flex size-8 items-center justify-center rounded-md bg-transparent text-sm font-normal cursor-pointer border-none hover:bg-muted transition-colors\"\n ),\n range_end: \"day-range-end\",\n selected:\n \"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:font-medium\",\n today: \"[&>button]:font-semibold [&>button]:text-primary\",\n outside:\n \"day-outside [&>button]:bg-transparent [&>button]:text-muted-foreground [&>button]:opacity-50\",\n disabled: \"[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default\",\n range_middle:\n \"[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none\",\n range_start: \"[&>button]:rounded-e-none\",\n dropdowns: \"flex items-center gap-1.5 justify-center\",\n dropdown:\n \"h-7 rounded-md border border-input bg-background px-2 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1\",\n months_dropdown: \"w-[104px]\",\n years_dropdown: \"w-[72px]\",\n hidden: \"invisible\",\n ...classNames,\n }}\n captionLayout={captionLayout}\n components={{\n Chevron: ({ orientation }) => {\n const Icon = orientation === \"left\" ? ChevronLeft : ChevronRight\n return <Icon className=\"size-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n","import * as React from \"react\"\nimport { ClockIcon } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\n\n/** Matches a 24-hour clock time, \"HH:mm\". */\nconst TIME_VALUE_PATTERN = /^([01]\\d|2[0-3]):([0-5]\\d)$/\n\nconst MINUTES_PER_DAY = 24 * 60\nconst NOON = 12 * 60\n\n/** A 24-hour clock time such as \"09:00\" or \"17:30\". */\nexport type TimeValue = string\n\ntype Period = \"AM\" | \"PM\"\n\nfunction pad2(value: number): string {\n return value.toString().padStart(2, \"0\")\n}\n\n/**\n * Turns a \"HH:mm\" string into minutes since midnight. Returns undefined for\n * anything that is not a valid 24-hour time, so a bad prop degrades to\n * \"nothing selected\" rather than throwing inside a render.\n */\nfunction parseTimeValue(value?: string | null): number | undefined {\n if (!value) return undefined\n const match = TIME_VALUE_PATTERN.exec(value.trim())\n if (!match) return undefined\n return Number(match[1]) * 60 + Number(match[2])\n}\n\n/** Turns minutes since midnight back into the canonical \"HH:mm\" string. */\nfunction formatTimeValue(minutesOfDay: number): string {\n const normalised = ((minutesOfDay % MINUTES_PER_DAY) + MINUTES_PER_DAY) % MINUTES_PER_DAY\n return `${pad2(Math.floor(normalised / 60))}:${pad2(normalised % 60)}`\n}\n\n/** Human-readable time, either \"17:30\" or \"05:30 PM\" depending on the cycle. */\nfunction formatTimeLabel(minutesOfDay: number, hourCycle: 12 | 24): string {\n const normalised = ((minutesOfDay % MINUTES_PER_DAY) + MINUTES_PER_DAY) % MINUTES_PER_DAY\n const hours = Math.floor(normalised / 60)\n const minutes = normalised % 60\n if (hourCycle === 24) return `${pad2(hours)}:${pad2(minutes)}`\n const period: Period = hours < NOON / 60 ? \"AM\" : \"PM\"\n const hour12 = hours % 12 === 0 ? 12 : hours % 12\n return `${pad2(hour12)}:${pad2(minutes)} ${period}`\n}\n\nfunction isTimeInRange(minutesOfDay: number, min?: number, max?: number): boolean {\n if (min !== undefined && minutesOfDay < min) return false\n if (max !== undefined && minutesOfDay > max) return false\n return true\n}\n\n/** The hour a 12-hour-cycle cell stands for once its period is applied. */\nfunction to24Hour(hour12: number, period: Period): number {\n const base = hour12 % 12\n return period === \"AM\" ? base : base + 12\n}\n\n/**\n * The minute offsets the minute column offers. `extra` keeps a value that does\n * not sit on the step grid visible — a consumer may hand us \"14:07\" with a\n * 5-minute step and we must not silently fail to reflect it.\n */\nfunction buildMinuteList(minuteStep: number, extra?: number): number[] {\n const step = Number.isFinite(minuteStep) ? Math.min(60, Math.max(1, Math.floor(minuteStep))) : 5\n const minutes: number[] = []\n for (let minute = 0; minute < 60; minute += step) minutes.push(minute)\n if (extra !== undefined && extra >= 0 && extra < 60 && !minutes.includes(extra)) {\n minutes.push(extra)\n minutes.sort((a, b) => a - b)\n }\n return minutes\n}\n\n/** Every selectable slot of the day that the bound allows, ascending. */\nfunction buildAllowedSlots(minutes: number[], min?: number, max?: number): number[] {\n const slots: number[] = []\n for (let hour = 0; hour < 24; hour += 1) {\n for (const minute of minutes) {\n const slot = hour * 60 + minute\n if (isTimeInRange(slot, min, max)) slots.push(slot)\n }\n }\n return slots\n}\n\n/**\n * The allowed slot closest to `desired`, preferring one at or after it, so a\n * time that has fallen outside the bound moves forward to the next legal slot\n * instead of backwards.\n */\nfunction snapToAllowedSlot(desired: number, allowedSlots: number[]): number | undefined {\n if (allowedSlots.length === 0) return undefined\n let best = allowedSlots[0]\n let bestScore = Number.POSITIVE_INFINITY\n for (const slot of allowedSlots) {\n const score = slot >= desired ? slot - desired : desired - slot + MINUTES_PER_DAY\n if (score < bestScore) {\n bestScore = score\n best = slot\n }\n }\n return best\n}\n\nconst columnClasses =\n \"flex max-h-[216px] w-16 flex-col gap-1 overflow-y-auto overscroll-contain p-1\"\n\nconst cellClasses =\n \"shrink-0 rounded-md px-2 py-1.5 text-sm font-normal text-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-pressed:bg-primary aria-pressed:font-medium aria-pressed:text-primary-foreground aria-pressed:hover:bg-primary aria-pressed:hover:text-primary-foreground disabled:pointer-events-none disabled:text-muted-foreground disabled:opacity-50\"\n\ninterface TimeCellProps {\n label: string\n accessibleName: string\n pressed: boolean\n disabled: boolean\n onSelect: () => void\n}\n\nfunction TimeCell({ label, accessibleName, pressed, disabled, onSelect }: TimeCellProps) {\n return (\n <button\n type=\"button\"\n aria-label={accessibleName}\n aria-pressed={pressed}\n disabled={disabled}\n onClick={onSelect}\n className={cn(cellClasses)}\n >\n {label}\n </button>\n )\n}\n\nexport interface TimePickerPanelProps {\n /** Selected time as a 24-hour \"HH:mm\" string. */\n value?: TimeValue\n /** Called with the newly selected 24-hour \"HH:mm\" string. */\n onValueChange?: (value: TimeValue) => void\n /** Earliest selectable time as \"HH:mm\". Earlier times are disabled. */\n minTime?: TimeValue\n /** Latest selectable time as \"HH:mm\". Later times are disabled. */\n maxTime?: TimeValue\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /** Accessible name for the hour column. Defaults to \"Hour\". */\n hourLabel?: string\n /** Accessible name for the minute column. Defaults to \"Minute\". */\n minuteLabel?: string\n /** Accessible name for the AM/PM column. Defaults to \"Period\". */\n periodLabel?: string\n /** Classname applied to the panel wrapper. */\n className?: string\n}\n\n/**\n * The bare hour/minute columns, without a popover around them. Used by\n * TimePicker and by DateTimePicker, which supplies its own popover.\n */\nfunction TimePickerPanel({\n value,\n onValueChange,\n minTime,\n maxTime,\n minuteStep = 5,\n hourCycle = 12,\n hourLabel = \"Hour\",\n minuteLabel = \"Minute\",\n periodLabel = \"Period\",\n className,\n}: TimePickerPanelProps) {\n const minMinutes = parseTimeValue(minTime)\n const maxMinutes = parseTimeValue(maxTime)\n const selected = parseTimeValue(value)\n\n const minuteList = React.useMemo(\n () => buildMinuteList(minuteStep, selected === undefined ? undefined : selected % 60),\n [minuteStep, selected]\n )\n const allowedSlots = React.useMemo(\n () => buildAllowedSlots(minuteList, minMinutes, maxMinutes),\n [minuteList, minMinutes, maxMinutes]\n )\n\n // Each click reports a complete time, so with nothing selected yet the\n // columns work against the first slot the bound allows.\n const active = selected ?? allowedSlots[0]\n const activeHour = active === undefined ? undefined : Math.floor(active / 60)\n const activeMinute = active === undefined ? undefined : active % 60\n const activePeriod: Period =\n activeHour !== undefined && activeHour >= 12 ? \"PM\" : \"AM\"\n\n const hourHasSlot = (hour: number) =>\n allowedSlots.some((slot) => Math.floor(slot / 60) === hour)\n const firstSlotInHour = (hour: number) =>\n allowedSlots.find((slot) => Math.floor(slot / 60) === hour)\n const periodHasSlot = (period: Period) =>\n allowedSlots.some((slot) => (slot < NOON ? \"AM\" : \"PM\") === period)\n const firstSlotInPeriod = (period: Period) =>\n allowedSlots.find((slot) => (slot < NOON ? \"AM\" : \"PM\") === period)\n\n const commit = (minutesOfDay: number | undefined) => {\n if (minutesOfDay === undefined) return\n onValueChange?.(formatTimeValue(minutesOfDay))\n }\n\n const selectHour = (hour: number) => {\n const desired = hour * 60 + (activeMinute ?? 0)\n commit(isTimeInRange(desired, minMinutes, maxMinutes) ? desired : firstSlotInHour(hour))\n }\n\n const selectMinute = (minute: number) => {\n if (activeHour === undefined) return\n commit(activeHour * 60 + minute)\n }\n\n const selectPeriod = (period: Period) => {\n if (activeHour === undefined || activeMinute === undefined) {\n commit(firstSlotInPeriod(period))\n return\n }\n const hour12 = activeHour % 12 === 0 ? 12 : activeHour % 12\n const desired = to24Hour(hour12, period) * 60 + activeMinute\n commit(\n isTimeInRange(desired, minMinutes, maxMinutes) ? desired : firstSlotInPeriod(period)\n )\n }\n\n const hourCells =\n hourCycle === 24\n ? Array.from({ length: 24 }, (_, hour) => hour)\n : [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\n\n return (\n <div className={cn(\"flex items-start divide-x divide-border\", className)}>\n <div className={cn(columnClasses)} role=\"group\" aria-label={hourLabel}>\n {hourCells.map((cell) => {\n const hour = hourCycle === 24 ? cell : to24Hour(cell, activePeriod)\n const label = pad2(cell)\n return (\n <TimeCell\n key={`hour-${cell}`}\n label={label}\n accessibleName={`${hourLabel} ${label}`}\n pressed={activeHour === hour && selected !== undefined}\n disabled={!hourHasSlot(hour)}\n onSelect={() => selectHour(hour)}\n />\n )\n })}\n </div>\n <div className={cn(columnClasses)} role=\"group\" aria-label={minuteLabel}>\n {minuteList.map((minute) => {\n const label = pad2(minute)\n const disabled =\n activeHour === undefined ||\n !isTimeInRange(activeHour * 60 + minute, minMinutes, maxMinutes)\n return (\n <TimeCell\n key={`minute-${minute}`}\n label={label}\n accessibleName={`${minuteLabel} ${label}`}\n pressed={activeMinute === minute && selected !== undefined}\n disabled={disabled}\n onSelect={() => selectMinute(minute)}\n />\n )\n })}\n </div>\n {hourCycle === 12 && (\n <div className={cn(columnClasses)} role=\"group\" aria-label={periodLabel}>\n {([\"AM\", \"PM\"] as Period[]).map((period) => (\n <TimeCell\n key={period}\n label={period}\n accessibleName={period}\n pressed={activePeriod === period && selected !== undefined}\n disabled={!periodHasSlot(period)}\n onSelect={() => selectPeriod(period)}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\nTimePickerPanel.displayName = \"TimePickerPanel\"\n\nexport interface TimePickerProps {\n /** Selected time as a 24-hour \"HH:mm\" string. */\n value?: TimeValue\n /** Called with the new time, or with undefined when the value is cleared. */\n onValueChange?: (value: TimeValue | undefined) => void\n /** Earliest selectable time as \"HH:mm\". Earlier times are disabled. */\n minTime?: TimeValue\n /** Latest selectable time as \"HH:mm\". Later times are disabled. */\n maxTime?: TimeValue\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /** Trigger text shown when nothing is selected. */\n placeholder?: string\n /** Shows a Clear action in the popover. Defaults to true. */\n clearable?: boolean\n /** Text of the Clear action. Defaults to \"Clear\". */\n clearLabel?: string\n /** Disables the whole control. */\n disabled?: boolean\n /** Accessible name for the trigger. Defaults to the placeholder. */\n \"aria-label\"?: string\n /** Id of an element that labels the trigger. */\n \"aria-labelledby\"?: string\n /** Id applied to the trigger button. */\n id?: string\n /** Name reported on a hidden input, so the value posts with a plain form. */\n name?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Classname applied to the popover content. */\n contentClassName?: string\n /** Controlled open state of the popover. */\n open?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Side the popover is aligned to. Defaults to \"start\". */\n align?: \"start\" | \"center\" | \"end\"\n}\n\n/**\n * A time control: a popover trigger showing the selected time, over hour and\n * minute columns. The value is always a 24-hour \"HH:mm\" string, so it survives\n * a round trip through JSON and through a `datetime-local`-shaped API.\n */\nconst TimePicker = React.forwardRef<HTMLButtonElement, TimePickerProps>(\n (\n {\n value,\n onValueChange,\n minTime,\n maxTime,\n minuteStep = 5,\n hourCycle = 12,\n placeholder = \"Pick a time\",\n clearable = true,\n clearLabel = \"Clear\",\n disabled,\n id,\n name,\n className,\n contentClassName,\n open,\n onOpenChange,\n align = \"start\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n },\n ref\n ) => {\n const selected = parseTimeValue(value)\n const label =\n selected === undefined ? placeholder : formatTimeLabel(selected, hourCycle)\n\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n id={id}\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? placeholder)}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"w-[180px] justify-start text-left font-normal\",\n selected === undefined && \"text-muted-foreground\",\n className\n )}\n >\n <ClockIcon className=\"me-2 h-4 w-4\" aria-hidden=\"true\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\"w-auto p-0\", contentClassName)}\n align={align}\n aria-label={ariaLabel ?? placeholder}\n >\n <TimePickerPanel\n value={value}\n onValueChange={(next) => onValueChange?.(next)}\n minTime={minTime}\n maxTime={maxTime}\n minuteStep={minuteStep}\n hourCycle={hourCycle}\n />\n {clearable && (\n <div className=\"flex justify-end border-t border-border p-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n disabled={selected === undefined}\n onClick={() => onValueChange?.(undefined)}\n >\n {clearLabel}\n </Button>\n </div>\n )}\n </PopoverContent>\n {name && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Popover>\n )\n }\n)\nTimePicker.displayName = \"TimePicker\"\n\nexport {\n TimePicker,\n TimePickerPanel,\n formatTimeLabel,\n formatTimeValue,\n parseTimeValue,\n isTimeInRange,\n buildMinuteList,\n buildAllowedSlots,\n snapToAllowedSlot,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,SAAuB;AACvB,IAAAC,uBAAkC;;;ACDlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,0BAAwB;AA4ElB;AAzEN,IAAM,qBAAiB;A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,SAAS,MAAM,SAAS,MAAS;AAAA,kBAEhC;AAAA;AAAA,cACH;AAAA,cAEF,8CAAC,SAAI,WAAU,mCACb;AAAA;AAAA,kBAAC;AAAA;AAAA,oBACC,MAAK;AAAA,oBACL,SAAQ;AAAA,oBACR,MAAK;AAAA,oBACL,WAAU;AAAA,oBACV,SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,gBACA,6CAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,MAAK,MAAK,SAAS,aACxD,sBACH;AAAA,iBACF;AAAA,eACF;AAAA;AAAA;AAAA,MACF;AAAA,MACC,QACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL;AAAA,UACA,OACE,QACI,GAAG,MAAM,YAAY,CAAC,IAAI,OAAO,MAAM,SAAS,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,YACzE,MAAM,QAAQ;AAAA,UAChB,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,gBAAgB,aAAa,KAAK,CAAC,CAAC,KAC1D;AAAA;AAAA,MAER;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;","names":["React","import_lucide_react","import_lucide_react","import_jsx_runtime","React","import_jsx_runtime","React","import_lucide_react","import_jsx_runtime","minutesOfDay","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../src/components/date-time-picker.tsx","../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/calendar.tsx","../../src/components/popover.tsx","../../src/components/time-picker.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { CalendarClockIcon } from \"lucide-react\"\nimport type { Matcher } from \"react-day-picker\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Calendar } from \"./calendar\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\nimport {\n TimePickerPanel,\n buildAllowedSlots,\n buildMinuteList,\n formatTimeLabel,\n formatTimeValue,\n isTimeInRange,\n parseTimeValue,\n snapToAllowedSlot,\n type TimeValue,\n} from \"./time-picker\"\n\nfunction startOfDay(date: Date): Date {\n return new Date(date.getFullYear(), date.getMonth(), date.getDate())\n}\n\nfunction isSameDay(a: Date, b: Date): boolean {\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n )\n}\n\n/** Minutes since midnight for a Date, in local time. */\nfunction minutesOfDay(date: Date): number {\n return date.getHours() * 60 + date.getMinutes()\n}\n\n/** A new Date on `day` at `minutes` past midnight, seconds zeroed. */\nfunction withTime(day: Date, minutes: number): Date {\n return new Date(\n day.getFullYear(),\n day.getMonth(),\n day.getDate(),\n Math.floor(minutes / 60),\n minutes % 60,\n 0,\n 0\n )\n}\n\nexport interface DateTimePickerProps {\n /** The selected moment. One value covers both the date and the time. */\n value?: Date\n /**\n * Called with the new moment, or with undefined when the value is cleared.\n * Fires only on Apply — edits inside the popover are held as a draft until\n * then.\n */\n onValueChange?: (value: Date | undefined) => void\n /**\n * Earliest selectable moment. Days before it are disabled in the calendar\n * and, on the boundary day itself, the times before it are disabled too.\n */\n minDate?: Date\n /**\n * Latest selectable moment. Days after it are disabled in the calendar and,\n * on the boundary day itself, the times after it are disabled too.\n */\n maxDate?: Date\n /** Extra day matchers passed through to the underlying Calendar. */\n disabledDates?: Matcher | Matcher[]\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /**\n * Time applied when a date is picked before any time has been chosen, as\n * \"HH:mm\". Defaults to \"09:00\" and is moved to the nearest allowed slot when\n * the bound forbids it.\n */\n defaultTime?: TimeValue\n /** Trigger text shown when nothing is selected. */\n placeholder?: string\n /** Overrides how the selected moment is rendered on the trigger. */\n formatValue?: (value: Date) => string\n /** Shows a Clear action in the popover. Defaults to true. */\n clearable?: boolean\n /** Text of the Clear action, which empties the draft. Defaults to \"Clear\". */\n clearLabel?: string\n /** Text of the action that commits the draft. Defaults to \"Apply\". */\n applyLabel?: string\n /** Text of the action that discards the draft. Defaults to \"Cancel\". */\n cancelLabel?: string\n /** Heading above the time columns. Defaults to \"Time\". */\n timeLabel?: string\n /** Disables the whole control. */\n disabled?: boolean\n /** Accessible name for the trigger. Defaults to the placeholder. */\n \"aria-label\"?: string\n /** Id of an element that labels the trigger. */\n \"aria-labelledby\"?: string\n /** Id applied to the trigger button. */\n id?: string\n /** Name reported on a hidden input, so the value posts with a plain form. */\n name?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Classname applied to the popover content. */\n contentClassName?: string\n /** Controlled open state of the popover. */\n open?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Side the popover is aligned to. Defaults to \"start\". */\n align?: \"start\" | \"center\" | \"end\"\n}\n\n/**\n * A date and a time in one popover, reporting a single Date. Drop-in\n * replacement for a native `datetime-local` input: the calendar and the time\n * columns write to the same value, and `minDate` / `maxDate` are enforced on\n * both halves, including on the boundary day where only part of the day is\n * still allowed.\n *\n * Edits are committed explicitly. Picking a day, an hour, a minute or a period\n * moves a draft held inside the popover; `onValueChange` fires once, on Apply.\n * Cancel, Escape and a click outside all discard the draft, so a stray click\n * cannot write a deadline.\n */\nconst DateTimePicker = React.forwardRef<HTMLButtonElement, DateTimePickerProps>(\n (\n {\n value,\n onValueChange,\n minDate,\n maxDate,\n disabledDates,\n minuteStep = 5,\n hourCycle = 12,\n defaultTime = \"09:00\",\n placeholder = \"Pick a date and time\",\n formatValue,\n clearable = true,\n clearLabel = \"Clear\",\n applyLabel = \"Apply\",\n cancelLabel = \"Cancel\",\n timeLabel = \"Time\",\n disabled,\n id,\n name,\n className,\n contentClassName,\n open,\n onOpenChange,\n align = \"start\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n },\n ref\n ) => {\n // Every interaction inside the popover edits this draft, never `value`.\n // The trigger keeps showing `value`, so an uncommitted edit can never be\n // mistaken for a saved one.\n const [draft, setDraft] = React.useState<Date | undefined>(value)\n const [uncontrolledOpen, setUncontrolledOpen] = React.useState(false)\n const isOpen = open ?? uncontrolledOpen\n\n // Opening re-seeds the draft. The effect covers a controlled consumer that\n // flips `open` itself, which never reaches our onOpenChange handler.\n const wasOpen = React.useRef(isOpen)\n React.useEffect(() => {\n if (isOpen && !wasOpen.current) setDraft(value)\n wasOpen.current = isOpen\n }, [isOpen, value])\n\n const setOpenState = (next: boolean) => {\n if (open === undefined) setUncontrolledOpen(next)\n onOpenChange?.(next)\n }\n\n // The trigger, Escape and a click outside all land here. None of them\n // commits: the draft goes back to `value` whichever way the popover moves.\n const handleOpenChange = (next: boolean) => {\n setDraft(value)\n setOpenState(next)\n }\n\n const handleCancel = () => {\n setDraft(value)\n setOpenState(false)\n }\n\n // The one path that reports to the consumer, including the undefined left\n // behind by Clear.\n const handleApply = () => {\n onValueChange?.(draft)\n setOpenState(false)\n }\n\n // The day the time columns are bound against. Without a draft yet that is\n // today, pulled inside the allowed range so the columns are usable.\n const activeDay = React.useMemo(() => {\n if (draft) return startOfDay(draft)\n const today = startOfDay(new Date())\n if (minDate && today < startOfDay(minDate)) return startOfDay(minDate)\n if (maxDate && today > startOfDay(maxDate)) return startOfDay(maxDate)\n return today\n }, [draft, minDate, maxDate])\n\n /** The time window still open on a given day, once the bound is applied. */\n const timeWindowFor = React.useCallback(\n (day: Date): { minTime?: TimeValue; maxTime?: TimeValue } => ({\n minTime:\n minDate && isSameDay(day, minDate)\n ? formatTimeValue(minutesOfDay(minDate))\n : undefined,\n maxTime:\n maxDate && isSameDay(day, maxDate)\n ? formatTimeValue(minutesOfDay(maxDate))\n : undefined,\n }),\n [minDate, maxDate]\n )\n\n const activeWindow = timeWindowFor(activeDay)\n\n // The year dropdown follows the bound rather than Calendar's generic\n // default: with minDate set to now, a deadline picker offering 2016 would\n // be offering years every one of whose days it then refuses.\n const calendarStartMonth = React.useMemo(\n () => (minDate ? new Date(minDate.getFullYear(), minDate.getMonth(), 1) : undefined),\n [minDate],\n )\n const calendarEndMonth = React.useMemo(\n () => (maxDate ? new Date(maxDate.getFullYear(), maxDate.getMonth(), 1) : undefined),\n [maxDate],\n )\n\n const calendarDisabled = React.useMemo(() => {\n const matchers: Matcher[] = []\n if (minDate) matchers.push({ before: startOfDay(minDate) })\n if (maxDate) matchers.push({ after: startOfDay(maxDate) })\n if (Array.isArray(disabledDates)) matchers.push(...disabledDates)\n else if (disabledDates !== undefined) matchers.push(disabledDates)\n return matchers\n }, [minDate, maxDate, disabledDates])\n\n const handleDaySelect = (day: Date | undefined) => {\n // Clicking the selected day again deselects in react-day-picker. A\n // deadline should not disappear by accident, so Clear is the only way out.\n if (!day) return\n const desired = draft ? minutesOfDay(draft) : (parseTimeValue(defaultTime) ?? 0)\n const { minTime, maxTime } = timeWindowFor(day)\n const min = parseTimeValue(minTime)\n const max = parseTimeValue(maxTime)\n if (isTimeInRange(desired, min, max)) {\n setDraft(withTime(day, desired))\n return\n }\n const snapped = snapToAllowedSlot(\n desired,\n buildAllowedSlots(buildMinuteList(minuteStep, desired % 60), min, max)\n )\n if (snapped === undefined) return\n setDraft(withTime(day, snapped))\n }\n\n const handleTimeChange = (next: TimeValue) => {\n const minutes = parseTimeValue(next)\n if (minutes === undefined) return\n setDraft(withTime(draft ?? activeDay, minutes))\n }\n\n const label = value\n ? (formatValue?.(value) ??\n `${value.toLocaleDateString()} ${formatTimeLabel(minutesOfDay(value), hourCycle)}`)\n : placeholder\n\n return (\n <Popover open={isOpen} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n id={id}\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? placeholder)}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"w-[280px] justify-start text-left font-normal\",\n !value && \"text-muted-foreground\",\n className\n )}\n >\n <CalendarClockIcon className=\"me-2 h-4 w-4\" aria-hidden=\"true\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\"w-auto p-0\", contentClassName)}\n align={align}\n aria-label={ariaLabel ?? placeholder}\n >\n <div className=\"flex flex-col sm:flex-row sm:items-start sm:divide-x sm:divide-border\">\n <Calendar\n mode=\"single\"\n selected={draft}\n defaultMonth={activeDay}\n startMonth={calendarStartMonth}\n endMonth={calendarEndMonth}\n onSelect={handleDaySelect}\n disabled={calendarDisabled}\n // Focus moves into the calendar the user just opened (keyboard navigation).\n // eslint-disable-next-line jsx-a11y/no-autofocus\n autoFocus\n />\n <div className=\"border-t border-border p-2 sm:border-t-0\">\n <div className=\"px-1 pb-1 text-xs font-medium uppercase tracking-wider text-muted-foreground\">\n {timeLabel}\n </div>\n <TimePickerPanel\n value={draft ? formatTimeValue(minutesOfDay(draft)) : undefined}\n onValueChange={handleTimeChange}\n minTime={activeWindow.minTime}\n maxTime={activeWindow.maxTime}\n minuteStep={minuteStep}\n hourCycle={hourCycle}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-2 border-t border-border p-2\">\n {clearable && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n disabled={!draft}\n onClick={() => setDraft(undefined)}\n >\n {clearLabel}\n </Button>\n )}\n <div className=\"ms-auto flex items-center gap-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n onClick={handleCancel}\n >\n {cancelLabel}\n </Button>\n <Button type=\"button\" variant=\"default\" size=\"sm\" onClick={handleApply}>\n {applyLabel}\n </Button>\n </div>\n </div>\n </PopoverContent>\n {name && (\n <input\n type=\"hidden\"\n name={name}\n value={\n value\n ? `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, \"0\")}-${String(\n value.getDate()\n ).padStart(2, \"0\")}T${formatTimeValue(minutesOfDay(value))}`\n : \"\"\n }\n />\n )}\n </Popover>\n )\n }\n)\nDateTimePicker.displayName = \"DateTimePicker\"\n\nexport { DateTimePicker }\n","import { type ClassValue, clsx } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","\nimport * as React from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { Loader2 } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4\",\n {\n variants: {\n variant: {\n default:\n \"bg-primary text-primary-foreground hover:bg-primary-hover\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive-hover\",\n outline:\n \"border border-input bg-background hover:bg-accent hover:text-accent-foreground\",\n secondary:\n \"bg-secondary text-secondary-foreground hover:bg-secondary-hover\",\n ghost:\n \"hover:bg-accent hover:text-accent-foreground\",\n link:\n \"text-primary underline-offset-4 hover:underline\",\n success:\n \"bg-success text-success-foreground hover:bg-success-hover\",\n },\n size: {\n xs: \"h-7 px-2.5 text-xs\",\n sm: \"h-9 px-3\",\n default: \"h-10 px-4 py-2\",\n lg: \"h-11 px-8\",\n icon: \"h-10 w-10\",\n \"icon-sm\": \"h-8 w-8\",\n },\n shape: {\n default: \"rounded-md\",\n rounded: \"rounded-lg\",\n pill: \"rounded-full\",\n square: \"rounded-none\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n shape: \"default\",\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean\n loading?: boolean\n prefixIcon?: React.ReactNode\n suffixIcon?: React.ReactNode\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n shape,\n asChild = false,\n loading = false,\n prefixIcon,\n suffixIcon,\n children,\n disabled,\n ...props\n },\n ref\n ) => {\n const Comp = asChild ? Slot : \"button\"\n const isDisabled = disabled || loading\n\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, shape, className }))}\n ref={ref}\n disabled={isDisabled}\n {...props}\n >\n {loading && <Loader2 className=\"animate-spin\" />}\n {!loading && prefixIcon}\n {children}\n {suffixIcon}\n </Comp>\n )\n }\n)\nButton.displayName = \"Button\"\n\nexport { Button, buttonVariants }\n","import * as React from \"react\"\nimport { DayPicker } from \"react-day-picker\"\nimport { ChevronDown, ChevronLeft, ChevronRight } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\n\nexport type CalendarProps = React.ComponentProps<typeof DayPicker>\n\n// Module-level so its identity is stable; an inline component remounts the <select> (losing focus) on every Calendar render.\nfunction CalendarSelect({ children, ...selectProps }: React.SelectHTMLAttributes<HTMLSelectElement>) {\n return (\n <>\n <select {...selectProps}>{children}</select>\n <ChevronDown aria-hidden=\"true\" className=\"pointer-events-none absolute end-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground\" />\n </>\n )\n}\n\n/**\n * How far the year dropdown reaches when the caller gives no bounds.\n *\n * `captionLayout` defaults to \"dropdown\" here, and react-day-picker then falls\n * back to [currentYear - 100, currentYear] for the year list. That is wrong in\n * both directions: a hundred dead years to scroll past, and no future year at\n * all - a deadline could not be set beyond December of the current year.\n * Callers that know their range pass `startMonth` / `endMonth` and these are\n * not used.\n */\nconst DEFAULT_YEARS_BACK = 10\nconst DEFAULT_YEARS_FORWARD = 10\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = \"dropdown\",\n startMonth,\n endMonth,\n ...props\n}: CalendarProps) {\n const now = new Date()\n const defaultedStartMonth =\n startMonth ?? new Date(now.getFullYear() - DEFAULT_YEARS_BACK, 0, 1)\n const defaultedEndMonth =\n endMonth ?? new Date(now.getFullYear() + DEFAULT_YEARS_FORWARD, 11, 1)\n\n return (\n <DayPicker\n startMonth={defaultedStartMonth}\n endMonth={defaultedEndMonth}\n showOutsideDays={showOutsideDays}\n className={cn(\"w-[260px] rounded-lg p-3\", className)}\n classNames={{\n months: \"relative flex flex-col\",\n month: \"space-y-3\",\n month_caption: \"relative flex h-8 items-center justify-center\",\n caption_label: \"text-sm font-medium hidden\",\n nav: \"absolute inset-x-0 top-0 z-10 flex h-8 items-center pointer-events-none\",\n button_previous: cn(\n \"pointer-events-auto absolute start-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n button_next: cn(\n \"pointer-events-auto absolute end-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none\"\n ),\n month_grid: \"w-full border-collapse\",\n weekdays: \"flex w-full\",\n weekday:\n \"flex-1 h-8 flex items-center justify-center text-[11px] font-medium text-muted-foreground uppercase tracking-wider\",\n week: \"flex w-full mt-1\",\n day: \"flex-1 h-8 p-0 relative focus-within:z-20 flex items-center justify-center text-sm\",\n day_button: cn(\n \"inline-flex size-8 items-center justify-center rounded-md bg-transparent text-sm font-normal cursor-pointer border-none hover:bg-muted transition-colors\"\n ),\n range_end: \"day-range-end\",\n selected:\n \"[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:hover:bg-primary [&>button]:hover:text-primary-foreground [&>button]:font-medium\",\n today: \"[&>button]:font-semibold [&>button]:text-primary\",\n outside:\n \"day-outside [&>button]:bg-transparent [&>button]:text-muted-foreground [&>button]:opacity-50\",\n disabled: \"[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default\",\n range_middle:\n \"[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none\",\n range_start: \"[&>button]:rounded-e-none\",\n dropdown_root: \"relative\",\n dropdowns: \"flex items-center gap-1.5 justify-center\",\n dropdown:\n \"h-7 appearance-none rounded-md border border-input bg-background ps-2 pe-6 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1\",\n months_dropdown: \"w-[104px]\",\n years_dropdown: \"w-[72px]\",\n hidden: \"invisible\",\n ...classNames,\n }}\n captionLayout={captionLayout}\n components={{\n Select: CalendarSelect,\n Chevron: ({ orientation }) => {\n const Icon = orientation === \"left\" ? ChevronLeft : ChevronRight\n return <Icon className=\"size-4\" />\n },\n }}\n {...props}\n />\n )\n}\nCalendar.displayName = \"Calendar\"\n\nexport { Calendar }\n","import * as React from \"react\"\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\"\nimport { cn } from \"../lib/utils\"\n\nconst Popover = PopoverPrimitive.Root\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = \"center\", sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n","import * as React from \"react\"\nimport { ClockIcon } from \"lucide-react\"\nimport { cn } from \"../lib/utils\"\nimport { Button } from \"./button\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"./popover\"\n\n/** Matches a 24-hour clock time, \"HH:mm\". */\nconst TIME_VALUE_PATTERN = /^([01]\\d|2[0-3]):([0-5]\\d)$/\n\nconst MINUTES_PER_DAY = 24 * 60\nconst NOON = 12 * 60\n\n/** A 24-hour clock time such as \"09:00\" or \"17:30\". */\nexport type TimeValue = string\n\ntype Period = \"AM\" | \"PM\"\n\nfunction pad2(value: number): string {\n return value.toString().padStart(2, \"0\")\n}\n\n/**\n * Turns a \"HH:mm\" string into minutes since midnight. Returns undefined for\n * anything that is not a valid 24-hour time, so a bad prop degrades to\n * \"nothing selected\" rather than throwing inside a render.\n */\nfunction parseTimeValue(value?: string | null): number | undefined {\n if (!value) return undefined\n const match = TIME_VALUE_PATTERN.exec(value.trim())\n if (!match) return undefined\n return Number(match[1]) * 60 + Number(match[2])\n}\n\n/** Turns minutes since midnight back into the canonical \"HH:mm\" string. */\nfunction formatTimeValue(minutesOfDay: number): string {\n const normalised = ((minutesOfDay % MINUTES_PER_DAY) + MINUTES_PER_DAY) % MINUTES_PER_DAY\n return `${pad2(Math.floor(normalised / 60))}:${pad2(normalised % 60)}`\n}\n\n/** Human-readable time, either \"17:30\" or \"05:30 PM\" depending on the cycle. */\nfunction formatTimeLabel(minutesOfDay: number, hourCycle: 12 | 24): string {\n const normalised = ((minutesOfDay % MINUTES_PER_DAY) + MINUTES_PER_DAY) % MINUTES_PER_DAY\n const hours = Math.floor(normalised / 60)\n const minutes = normalised % 60\n if (hourCycle === 24) return `${pad2(hours)}:${pad2(minutes)}`\n const period: Period = hours < NOON / 60 ? \"AM\" : \"PM\"\n const hour12 = hours % 12 === 0 ? 12 : hours % 12\n return `${pad2(hour12)}:${pad2(minutes)} ${period}`\n}\n\nfunction isTimeInRange(minutesOfDay: number, min?: number, max?: number): boolean {\n if (min !== undefined && minutesOfDay < min) return false\n if (max !== undefined && minutesOfDay > max) return false\n return true\n}\n\n/** The hour a 12-hour-cycle cell stands for once its period is applied. */\nfunction to24Hour(hour12: number, period: Period): number {\n const base = hour12 % 12\n return period === \"AM\" ? base : base + 12\n}\n\n/**\n * The minute offsets the minute column offers. `extra` keeps a value that does\n * not sit on the step grid visible — a consumer may hand us \"14:07\" with a\n * 5-minute step and we must not silently fail to reflect it.\n */\nfunction buildMinuteList(minuteStep: number, extra?: number): number[] {\n const step = Number.isFinite(minuteStep) ? Math.min(60, Math.max(1, Math.floor(minuteStep))) : 5\n const minutes: number[] = []\n for (let minute = 0; minute < 60; minute += step) minutes.push(minute)\n if (extra !== undefined && extra >= 0 && extra < 60 && !minutes.includes(extra)) {\n minutes.push(extra)\n minutes.sort((a, b) => a - b)\n }\n return minutes\n}\n\n/** Every selectable slot of the day that the bound allows, ascending. */\nfunction buildAllowedSlots(minutes: number[], min?: number, max?: number): number[] {\n const slots: number[] = []\n for (let hour = 0; hour < 24; hour += 1) {\n for (const minute of minutes) {\n const slot = hour * 60 + minute\n if (isTimeInRange(slot, min, max)) slots.push(slot)\n }\n }\n return slots\n}\n\n/**\n * The allowed slot closest to `desired`, preferring one at or after it, so a\n * time that has fallen outside the bound moves forward to the next legal slot\n * instead of backwards.\n */\nfunction snapToAllowedSlot(desired: number, allowedSlots: number[]): number | undefined {\n if (allowedSlots.length === 0) return undefined\n let best = allowedSlots[0]\n let bestScore = Number.POSITIVE_INFINITY\n for (const slot of allowedSlots) {\n const score = slot >= desired ? slot - desired : desired - slot + MINUTES_PER_DAY\n if (score < bestScore) {\n bestScore = score\n best = slot\n }\n }\n return best\n}\n\nconst columnClasses =\n \"flex max-h-[216px] w-16 flex-col gap-1 overflow-y-auto overscroll-contain p-1\"\n\nconst cellClasses =\n \"shrink-0 rounded-md px-2 py-1.5 text-sm font-normal text-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background aria-pressed:bg-primary aria-pressed:font-medium aria-pressed:text-primary-foreground aria-pressed:hover:bg-primary aria-pressed:hover:text-primary-foreground disabled:pointer-events-none disabled:text-muted-foreground disabled:opacity-50\"\n\ninterface TimeCellProps {\n label: string\n accessibleName: string\n pressed: boolean\n disabled: boolean\n onSelect: () => void\n}\n\nfunction TimeCell({ label, accessibleName, pressed, disabled, onSelect }: TimeCellProps) {\n return (\n <button\n type=\"button\"\n aria-label={accessibleName}\n aria-pressed={pressed}\n disabled={disabled}\n onClick={onSelect}\n className={cn(cellClasses)}\n >\n {label}\n </button>\n )\n}\n\nexport interface TimePickerPanelProps {\n /** Selected time as a 24-hour \"HH:mm\" string. */\n value?: TimeValue\n /** Called with the newly selected 24-hour \"HH:mm\" string. */\n onValueChange?: (value: TimeValue) => void\n /** Earliest selectable time as \"HH:mm\". Earlier times are disabled. */\n minTime?: TimeValue\n /** Latest selectable time as \"HH:mm\". Later times are disabled. */\n maxTime?: TimeValue\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /** Accessible name for the hour column. Defaults to \"Hour\". */\n hourLabel?: string\n /** Accessible name for the minute column. Defaults to \"Minute\". */\n minuteLabel?: string\n /** Accessible name for the AM/PM column. Defaults to \"Period\". */\n periodLabel?: string\n /** Classname applied to the panel wrapper. */\n className?: string\n}\n\n/**\n * The bare hour/minute columns, without a popover around them. Used by\n * TimePicker and by DateTimePicker, which supplies its own popover.\n */\nfunction TimePickerPanel({\n value,\n onValueChange,\n minTime,\n maxTime,\n minuteStep = 5,\n hourCycle = 12,\n hourLabel = \"Hour\",\n minuteLabel = \"Minute\",\n periodLabel = \"Period\",\n className,\n}: TimePickerPanelProps) {\n const minMinutes = parseTimeValue(minTime)\n const maxMinutes = parseTimeValue(maxTime)\n const selected = parseTimeValue(value)\n\n const minuteList = React.useMemo(\n () => buildMinuteList(minuteStep, selected === undefined ? undefined : selected % 60),\n [minuteStep, selected]\n )\n const allowedSlots = React.useMemo(\n () => buildAllowedSlots(minuteList, minMinutes, maxMinutes),\n [minuteList, minMinutes, maxMinutes]\n )\n\n // Each click reports a complete time, so with nothing selected yet the\n // columns work against the first slot the bound allows.\n const active = selected ?? allowedSlots[0]\n const activeHour = active === undefined ? undefined : Math.floor(active / 60)\n const activeMinute = active === undefined ? undefined : active % 60\n const activePeriod: Period =\n activeHour !== undefined && activeHour >= 12 ? \"PM\" : \"AM\"\n\n const hourHasSlot = (hour: number) =>\n allowedSlots.some((slot) => Math.floor(slot / 60) === hour)\n const firstSlotInHour = (hour: number) =>\n allowedSlots.find((slot) => Math.floor(slot / 60) === hour)\n const periodHasSlot = (period: Period) =>\n allowedSlots.some((slot) => (slot < NOON ? \"AM\" : \"PM\") === period)\n const firstSlotInPeriod = (period: Period) =>\n allowedSlots.find((slot) => (slot < NOON ? \"AM\" : \"PM\") === period)\n\n const commit = (minutesOfDay: number | undefined) => {\n if (minutesOfDay === undefined) return\n onValueChange?.(formatTimeValue(minutesOfDay))\n }\n\n const selectHour = (hour: number) => {\n const desired = hour * 60 + (activeMinute ?? 0)\n commit(isTimeInRange(desired, minMinutes, maxMinutes) ? desired : firstSlotInHour(hour))\n }\n\n const selectMinute = (minute: number) => {\n if (activeHour === undefined) return\n commit(activeHour * 60 + minute)\n }\n\n const selectPeriod = (period: Period) => {\n if (activeHour === undefined || activeMinute === undefined) {\n commit(firstSlotInPeriod(period))\n return\n }\n const hour12 = activeHour % 12 === 0 ? 12 : activeHour % 12\n const desired = to24Hour(hour12, period) * 60 + activeMinute\n commit(\n isTimeInRange(desired, minMinutes, maxMinutes) ? desired : firstSlotInPeriod(period)\n )\n }\n\n const hourCells =\n hourCycle === 24\n ? Array.from({ length: 24 }, (_, hour) => hour)\n : [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\n\n return (\n <div className={cn(\"flex items-start divide-x divide-border\", className)}>\n <div className={cn(columnClasses)} role=\"group\" aria-label={hourLabel}>\n {hourCells.map((cell) => {\n const hour = hourCycle === 24 ? cell : to24Hour(cell, activePeriod)\n const label = pad2(cell)\n return (\n <TimeCell\n key={`hour-${cell}`}\n label={label}\n accessibleName={`${hourLabel} ${label}`}\n pressed={activeHour === hour && selected !== undefined}\n disabled={!hourHasSlot(hour)}\n onSelect={() => selectHour(hour)}\n />\n )\n })}\n </div>\n <div className={cn(columnClasses)} role=\"group\" aria-label={minuteLabel}>\n {minuteList.map((minute) => {\n const label = pad2(minute)\n const disabled =\n activeHour === undefined ||\n !isTimeInRange(activeHour * 60 + minute, minMinutes, maxMinutes)\n return (\n <TimeCell\n key={`minute-${minute}`}\n label={label}\n accessibleName={`${minuteLabel} ${label}`}\n pressed={activeMinute === minute && selected !== undefined}\n disabled={disabled}\n onSelect={() => selectMinute(minute)}\n />\n )\n })}\n </div>\n {hourCycle === 12 && (\n <div className={cn(columnClasses)} role=\"group\" aria-label={periodLabel}>\n {([\"AM\", \"PM\"] as Period[]).map((period) => (\n <TimeCell\n key={period}\n label={period}\n accessibleName={period}\n pressed={activePeriod === period && selected !== undefined}\n disabled={!periodHasSlot(period)}\n onSelect={() => selectPeriod(period)}\n />\n ))}\n </div>\n )}\n </div>\n )\n}\nTimePickerPanel.displayName = \"TimePickerPanel\"\n\nexport interface TimePickerProps {\n /** Selected time as a 24-hour \"HH:mm\" string. */\n value?: TimeValue\n /** Called with the new time, or with undefined when the value is cleared. */\n onValueChange?: (value: TimeValue | undefined) => void\n /** Earliest selectable time as \"HH:mm\". Earlier times are disabled. */\n minTime?: TimeValue\n /** Latest selectable time as \"HH:mm\". Later times are disabled. */\n maxTime?: TimeValue\n /** Minute granularity offered by the minute column. Defaults to 5. */\n minuteStep?: number\n /** 12 adds an AM/PM column, 24 lists hours 00-23. Defaults to 12. */\n hourCycle?: 12 | 24\n /** Trigger text shown when nothing is selected. */\n placeholder?: string\n /** Shows a Clear action in the popover. Defaults to true. */\n clearable?: boolean\n /** Text of the Clear action. Defaults to \"Clear\". */\n clearLabel?: string\n /** Disables the whole control. */\n disabled?: boolean\n /** Accessible name for the trigger. Defaults to the placeholder. */\n \"aria-label\"?: string\n /** Id of an element that labels the trigger. */\n \"aria-labelledby\"?: string\n /** Id applied to the trigger button. */\n id?: string\n /** Name reported on a hidden input, so the value posts with a plain form. */\n name?: string\n /** Classname applied to the trigger button. */\n className?: string\n /** Classname applied to the popover content. */\n contentClassName?: string\n /** Controlled open state of the popover. */\n open?: boolean\n /** Called when the popover opens or closes. */\n onOpenChange?: (open: boolean) => void\n /** Side the popover is aligned to. Defaults to \"start\". */\n align?: \"start\" | \"center\" | \"end\"\n}\n\n/**\n * A time control: a popover trigger showing the selected time, over hour and\n * minute columns. The value is always a 24-hour \"HH:mm\" string, so it survives\n * a round trip through JSON and through a `datetime-local`-shaped API.\n */\nconst TimePicker = React.forwardRef<HTMLButtonElement, TimePickerProps>(\n (\n {\n value,\n onValueChange,\n minTime,\n maxTime,\n minuteStep = 5,\n hourCycle = 12,\n placeholder = \"Pick a time\",\n clearable = true,\n clearLabel = \"Clear\",\n disabled,\n id,\n name,\n className,\n contentClassName,\n open,\n onOpenChange,\n align = \"start\",\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n },\n ref\n ) => {\n const selected = parseTimeValue(value)\n const label =\n selected === undefined ? placeholder : formatTimeLabel(selected, hourCycle)\n\n return (\n <Popover open={open} onOpenChange={onOpenChange}>\n <PopoverTrigger asChild>\n <Button\n ref={ref}\n id={id}\n type=\"button\"\n variant=\"outline\"\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : (ariaLabel ?? placeholder)}\n aria-labelledby={ariaLabelledBy}\n className={cn(\n \"w-[180px] justify-start text-left font-normal\",\n selected === undefined && \"text-muted-foreground\",\n className\n )}\n >\n <ClockIcon className=\"me-2 h-4 w-4\" aria-hidden=\"true\" />\n {label}\n </Button>\n </PopoverTrigger>\n <PopoverContent\n className={cn(\"w-auto p-0\", contentClassName)}\n align={align}\n aria-label={ariaLabel ?? placeholder}\n >\n <TimePickerPanel\n value={value}\n onValueChange={(next) => onValueChange?.(next)}\n minTime={minTime}\n maxTime={maxTime}\n minuteStep={minuteStep}\n hourCycle={hourCycle}\n />\n {clearable && (\n <div className=\"flex justify-end border-t border-border p-2\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"font-normal\"\n disabled={selected === undefined}\n onClick={() => onValueChange?.(undefined)}\n >\n {clearLabel}\n </Button>\n </div>\n )}\n </PopoverContent>\n {name && <input type=\"hidden\" name={name} value={value ?? \"\"} />}\n </Popover>\n )\n }\n)\nTimePicker.displayName = \"TimePicker\"\n\nexport {\n TimePicker,\n TimePickerPanel,\n formatTimeLabel,\n formatTimeValue,\n parseTimeValue,\n isTimeInRange,\n buildMinuteList,\n buildAllowedSlots,\n snapToAllowedSlot,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,SAAuB;AACvB,IAAAC,uBAAkC;;;ACDlC,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACJA,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,0BAAwB;AA4ElB;AAzEN,IAAM,qBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,WACE;AAAA,QACF,OACE;AAAA,QACF,MACE;AAAA,QACF,SACE;AAAA,MACJ;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,SAAS;AAAA,QACT,IAAI;AAAA,QACJ,MAAM;AAAA,QACN,WAAW;AAAA,MACb;AAAA,MACA,OAAO;AAAA,QACL,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,QAAQ;AAAA,MACV;AAAA,I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SAAS;AAAA,oBAER;AAAA;AAAA,gBACH;AAAA,gBACA,6CAAC,UAAO,MAAK,UAAS,SAAQ,WAAU,MAAK,MAAK,SAAS,aACxD,sBACH;AAAA,iBACF;AAAA,eACF;AAAA;AAAA;AAAA,MACF;AAAA,MACC,QACC;AAAA,QAAC;AAAA;AAAA,UACC,MAAK;AAAA,UACL;AAAA,UACA,OACE,QACI,GAAG,MAAM,YAAY,CAAC,IAAI,OAAO,MAAM,SAAS,IAAI,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,YACzE,MAAM,QAAQ;AAAA,UAChB,EAAE,SAAS,GAAG,GAAG,CAAC,IAAI,gBAAgB,aAAa,KAAK,CAAC,CAAC,KAC1D;AAAA;AAAA,MAER;AAAA,OAEJ;AAAA,EAEJ;AACF;AACA,eAAe,cAAc;","names":["React","import_lucide_react","import_lucide_react","import_jsx_runtime","React","import_jsx_runtime","React","import_lucide_react","import_jsx_runtime","minutesOfDay","import_jsx_runtime"]}
|