@aback-ui/ui 0.0.0-stage → 0.2.1
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/LICENSE +21 -0
- package/README.md +69 -2
- package/dist/components/accordion.d.ts +8 -0
- package/dist/components/accordion.d.ts.map +1 -0
- package/dist/components/accordion.js +17 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +15 -0
- package/dist/components/alert-dialog.d.ts.map +1 -0
- package/dist/components/alert-dialog.js +38 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +12 -0
- package/dist/components/alert.d.ts.map +1 -0
- package/dist/components/alert.js +28 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/avatar.d.ts +25 -0
- package/dist/components/avatar.d.ts.map +1 -0
- package/dist/components/avatar.js +34 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +15 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +27 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumbs.d.ts +11 -0
- package/dist/components/breadcrumbs.d.ts.map +1 -0
- package/dist/components/breadcrumbs.js +11 -0
- package/dist/components/breadcrumbs.js.map +1 -0
- package/dist/components/button.d.ts +12 -0
- package/dist/components/button.d.ts.map +1 -0
- package/dist/components/button.js +43 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +25 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +87 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +12 -0
- package/dist/components/card.d.ts.map +1 -0
- package/dist/components/card.js +25 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/checkbox.d.ts +5 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +10 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block.d.ts +25 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +19 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +7 -0
- package/dist/components/collapsible.d.ts.map +1 -0
- package/dist/components/collapsible.js +11 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/combobox.d.ts +40 -0
- package/dist/components/combobox.d.ts.map +1 -0
- package/dist/components/combobox.js +27 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +24 -0
- package/dist/components/command.d.ts.map +1 -0
- package/dist/components/command.js +35 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/copy-button.d.ts +32 -0
- package/dist/components/copy-button.d.ts.map +1 -0
- package/dist/components/copy-button.js +65 -0
- package/dist/components/copy-button.js.map +1 -0
- package/dist/components/date-picker.d.ts +66 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +75 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/description-list.d.ts +29 -0
- package/dist/components/description-list.d.ts.map +1 -0
- package/dist/components/description-list.js +28 -0
- package/dist/components/description-list.js.map +1 -0
- package/dist/components/dialog.d.ts +16 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +29 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +26 -0
- package/dist/components/dropdown-menu.d.ts.map +1 -0
- package/dist/components/dropdown-menu.js +41 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/dropzone.d.ts +47 -0
- package/dist/components/dropzone.d.ts.map +1 -0
- package/dist/components/dropzone.js +125 -0
- package/dist/components/dropzone.js.map +1 -0
- package/dist/components/empty-state.d.ts +10 -0
- package/dist/components/empty-state.d.ts.map +1 -0
- package/dist/components/empty-state.js +8 -0
- package/dist/components/empty-state.js.map +1 -0
- package/dist/components/field.d.ts +17 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +13 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/hover-card.d.ts +7 -0
- package/dist/components/hover-card.d.ts.map +1 -0
- package/dist/components/hover-card.js +11 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +26 -0
- package/dist/components/input-group.d.ts.map +1 -0
- package/dist/components/input-group.js +41 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input.d.ts +5 -0
- package/dist/components/input.d.ts.map +1 -0
- package/dist/components/input.js +19 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/kbd.d.ts +4 -0
- package/dist/components/kbd.d.ts.map +1 -0
- package/dist/components/kbd.js +7 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +4 -0
- package/dist/components/label.d.ts.map +1 -0
- package/dist/components/label.js +9 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/layout.d.ts +69 -0
- package/dist/components/layout.d.ts.map +1 -0
- package/dist/components/layout.js +61 -0
- package/dist/components/layout.js.map +1 -0
- package/dist/components/page-header.d.ts +20 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +11 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/pagination.d.ts +20 -0
- package/dist/components/pagination.d.ts.map +1 -0
- package/dist/components/pagination.js +51 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +8 -0
- package/dist/components/popover.d.ts.map +1 -0
- package/dist/components/popover.js +12 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/progress.d.ts +12 -0
- package/dist/components/progress.d.ts.map +1 -0
- package/dist/components/progress.js +11 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +6 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +12 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/rating.d.ts +33 -0
- package/dist/components/rating.d.ts.map +1 -0
- package/dist/components/rating.js +52 -0
- package/dist/components/rating.js.map +1 -0
- package/dist/components/reading-progress.d.ts +16 -0
- package/dist/components/reading-progress.d.ts.map +1 -0
- package/dist/components/reading-progress.js +54 -0
- package/dist/components/reading-progress.js.map +1 -0
- package/dist/components/relative-time.d.ts +26 -0
- package/dist/components/relative-time.d.ts.map +1 -0
- package/dist/components/relative-time.js +83 -0
- package/dist/components/relative-time.js.map +1 -0
- package/dist/components/scroll-area.d.ts +10 -0
- package/dist/components/scroll-area.d.ts.map +1 -0
- package/dist/components/scroll-area.js +9 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/section-heading.d.ts +28 -0
- package/dist/components/section-heading.d.ts.map +1 -0
- package/dist/components/section-heading.js +23 -0
- package/dist/components/section-heading.js.map +1 -0
- package/dist/components/select.d.ts +5 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +17 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +5 -0
- package/dist/components/separator.d.ts.map +1 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/share-buttons.d.ts +25 -0
- package/dist/components/share-buttons.d.ts.map +1 -0
- package/dist/components/share-buttons.js +67 -0
- package/dist/components/share-buttons.js.map +1 -0
- package/dist/components/sheet.d.ts +18 -0
- package/dist/components/sheet.d.ts.map +1 -0
- package/dist/components/sheet.js +35 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.d.ts +4 -0
- package/dist/components/skeleton.d.ts.map +1 -0
- package/dist/components/skeleton.js +7 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/skip-link.d.ts +13 -0
- package/dist/components/skip-link.d.ts.map +1 -0
- package/dist/components/skip-link.js +12 -0
- package/dist/components/skip-link.js.map +1 -0
- package/dist/components/slider.d.ts +9 -0
- package/dist/components/slider.d.ts.map +1 -0
- package/dist/components/slider.js +9 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.d.ts.map +1 -0
- package/dist/components/spinner.js +13 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat.d.ts +54 -0
- package/dist/components/stat.d.ts.map +1 -0
- package/dist/components/stat.js +62 -0
- package/dist/components/stat.js.map +1 -0
- package/dist/components/steps.d.ts +21 -0
- package/dist/components/steps.d.ts.map +1 -0
- package/dist/components/steps.js +26 -0
- package/dist/components/steps.js.map +1 -0
- package/dist/components/switch.d.ts +5 -0
- package/dist/components/switch.d.ts.map +1 -0
- package/dist/components/switch.js +9 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table-of-contents.d.ts +28 -0
- package/dist/components/table-of-contents.d.ts.map +1 -0
- package/dist/components/table-of-contents.js +79 -0
- package/dist/components/table-of-contents.js.map +1 -0
- package/dist/components/table.d.ts +15 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +29 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +8 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +16 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.d.ts.map +1 -0
- package/dist/components/textarea.js +18 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/theme-toggle.d.ts +43 -0
- package/dist/components/theme-toggle.d.ts.map +1 -0
- package/dist/components/theme-toggle.js +99 -0
- package/dist/components/theme-toggle.js.map +1 -0
- package/dist/components/toaster.d.ts +27 -0
- package/dist/components/toaster.d.ts.map +1 -0
- package/dist/components/toaster.js +52 -0
- package/dist/components/toaster.js.map +1 -0
- package/dist/components/toggle-group.d.ts +12 -0
- package/dist/components/toggle-group.d.ts.map +1 -0
- package/dist/components/toggle-group.js +39 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/tooltip.d.ts +10 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +14 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/package.json +76 -4
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { IconCalendar, IconX } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { Button } from "./button.js";
|
|
7
|
+
import { Calendar, formatCalendarDate } from "./calendar.js";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "./popover.js";
|
|
9
|
+
function toIsoDate(date) {
|
|
10
|
+
const year = date.getFullYear();
|
|
11
|
+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
12
|
+
const day = `${date.getDate()}`.padStart(2, "0");
|
|
13
|
+
return `${year}-${month}-${day}`;
|
|
14
|
+
}
|
|
15
|
+
function selectionBounds(min, max) {
|
|
16
|
+
const matchers = [];
|
|
17
|
+
if (min)
|
|
18
|
+
matchers.push({ before: min });
|
|
19
|
+
if (max)
|
|
20
|
+
matchers.push({ after: max });
|
|
21
|
+
return matchers.length > 0 ? matchers : undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A date field: a button that opens a calendar in a popover.
|
|
25
|
+
*
|
|
26
|
+
* The trigger is a real button, so the field is reachable and operable by
|
|
27
|
+
* keyboard. Selecting a day closes the popover and returns focus to the
|
|
28
|
+
* trigger; Escape closes without changing the value. When `name` is set, a
|
|
29
|
+
* hidden input carries the `yyyy-mm-dd` value into native form submission.
|
|
30
|
+
*/
|
|
31
|
+
function DatePicker({ value, onChange, placeholder = "Pick a date", min, max, disabled, clearable = true, locale, format, defaultMonth, id, name, className, align = "start", "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, }) {
|
|
32
|
+
const [open, setOpen] = React.useState(false);
|
|
33
|
+
const label = value ? (format ? format(value) : formatCalendarDate(value, locale)) : placeholder;
|
|
34
|
+
function select(date) {
|
|
35
|
+
onChange?.(date);
|
|
36
|
+
if (date)
|
|
37
|
+
setOpen(false);
|
|
38
|
+
}
|
|
39
|
+
return (_jsxs("div", { "data-slot": "date-picker", className: cn("relative w-full", className), children: [_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { id: id, type: "button", variant: "outline", disabled: disabled, "aria-haspopup": "dialog", "aria-expanded": open, "aria-describedby": ariaDescribedBy, "aria-invalid": ariaInvalid, "aria-labelledby": ariaLabelledBy, className: cn("w-full justify-start gap-2 font-normal", !value && "text-muted-foreground"), children: [_jsx(IconCalendar, { "aria-hidden": "true", className: "size-4 shrink-0" }), _jsx("span", { className: "truncate", children: label })] }) }), _jsxs(PopoverContent, { align: align, "aria-label": "Choose a date", className: "w-auto p-0", children: [_jsx(Calendar, { mode: "single", selected: value, onSelect: select, defaultMonth: value ?? defaultMonth, disabled: selectionBounds(min, max), autoFocus: true }), clearable && value ? (_jsx("div", { className: "border-t border-border p-1", children: _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring", onClick: () => {
|
|
40
|
+
onChange?.(undefined);
|
|
41
|
+
setOpen(false);
|
|
42
|
+
}, children: [_jsx(IconX, { "aria-hidden": "true", className: "size-3.5" }), "Clear date"] }) })) : null] })] }), name ? _jsx("input", { type: "hidden", name: name, value: value ? toIsoDate(value) : "" }) : null] }));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A range field for reports, filters, and booking windows.
|
|
46
|
+
*
|
|
47
|
+
* The popover stays open until both ends are chosen, so the visitor can see
|
|
48
|
+
* the in-progress range. A completed range is announced through the calendar
|
|
49
|
+
* grid's `aria-multiselectable` and per-day selected state.
|
|
50
|
+
*/
|
|
51
|
+
function DateRangePicker({ value, onChange, placeholder = "Pick a date range", min, max, disabled, clearable = true, locale, format, numberOfMonths = 1, defaultMonth, id, className, align = "start", "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, }) {
|
|
52
|
+
const [open, setOpen] = React.useState(false);
|
|
53
|
+
const formatOne = (date) => format ? format(date) : formatCalendarDate(date, locale);
|
|
54
|
+
const sameDay = value?.from && value.to ? value.from.toDateString() === value.to.toDateString() : false;
|
|
55
|
+
const label = value?.from
|
|
56
|
+
? value.to && !sameDay
|
|
57
|
+
? `${formatOne(value.from)} – ${formatOne(value.to)}`
|
|
58
|
+
: formatOne(value.from)
|
|
59
|
+
: placeholder;
|
|
60
|
+
function select(range) {
|
|
61
|
+
onChange?.(range);
|
|
62
|
+
// A first click in react-day-picker produces a one-day range. Keeping the
|
|
63
|
+
// calendar open lets the visitor finish the second end; a range that spans
|
|
64
|
+
// two different days is complete and closes the popover.
|
|
65
|
+
if (range?.from && range.to && range.from.toDateString() !== range.to.toDateString()) {
|
|
66
|
+
setOpen(false);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return (_jsx("div", { "data-slot": "date-range-picker", className: cn("relative w-full", className), children: _jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { id: id, type: "button", variant: "outline", disabled: disabled, "aria-haspopup": "dialog", "aria-expanded": open, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, className: cn("w-full justify-start gap-2 font-normal", !value?.from && "text-muted-foreground"), children: [_jsx(IconCalendar, { "aria-hidden": "true", className: "size-4 shrink-0" }), _jsx("span", { className: "truncate", children: label })] }) }), _jsxs(PopoverContent, { align: align, "aria-label": "Choose a date range", className: "w-auto p-0", children: [_jsx(Calendar, { mode: "range", selected: value, onSelect: select, defaultMonth: value?.from ?? defaultMonth, numberOfMonths: numberOfMonths, disabled: selectionBounds(min, max), autoFocus: true }), clearable && value?.from ? (_jsx("div", { className: "border-t border-border p-1", children: _jsxs("button", { type: "button", className: "flex w-full items-center gap-2 px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring", onClick: () => {
|
|
70
|
+
onChange?.(undefined);
|
|
71
|
+
setOpen(false);
|
|
72
|
+
}, children: [_jsx(IconX, { "aria-hidden": "true", className: "size-3.5" }), "Clear range"] }) })) : null] })] }) }));
|
|
73
|
+
}
|
|
74
|
+
export { DatePicker, DateRangePicker };
|
|
75
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../src/components/date-picker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpE,SAAS,SAAS,CAAC,IAAU;IAC3B,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,MAAM,KAAK,GAAG,GAAG,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,G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SAAS,IAAI,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAC1B,cAAK,SAAS,EAAC,4BAA4B,YACzC,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kPAAkP,EAC5P,OAAO,EAAE,GAAG,EAAE;oCACZ,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC;oCACtB,OAAO,CAAC,KAAK,CAAC,CAAC;gCACjB,CAAC,aAED,KAAC,KAAK,mBAAa,MAAM,EAAC,SAAS,EAAC,UAAU,GAAG,mBAE1C,GACL,CACP,CAAC,CAAC,CAAC,IAAI,IACO,IACT,GACN,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type DetailsTone = "neutral" | "success" | "warning" | "danger" | "info";
|
|
3
|
+
export interface DescriptionListProps extends React.ComponentProps<"dl"> {
|
|
4
|
+
/** Draws the outer border. Turn it off when the list sits inside a card. */
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Key and value rows: file metadata, a price breakdown, request headers, or
|
|
9
|
+
* account details. A real `<dl>`, so each term labels its value for assistive
|
|
10
|
+
* technology. Rows wrap on narrow screens instead of truncating the value.
|
|
11
|
+
*/
|
|
12
|
+
declare function DescriptionList({ bordered, className, ...props }: DescriptionListProps): React.JSX.Element;
|
|
13
|
+
export interface DescriptionListItemProps extends React.ComponentProps<"div"> {
|
|
14
|
+
/** A bold row with a heavier rule, for a total. */
|
|
15
|
+
emphasis?: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare function DescriptionListItem({ emphasis, className, ...props }: DescriptionListItemProps): React.JSX.Element;
|
|
18
|
+
export interface DescriptionListTermProps extends React.ComponentProps<"dt"> {
|
|
19
|
+
/** Monospace keys for technical fields such as header names. */
|
|
20
|
+
mono?: boolean;
|
|
21
|
+
}
|
|
22
|
+
declare function DescriptionListTerm({ mono, className, ...props }: DescriptionListTermProps): React.JSX.Element;
|
|
23
|
+
export interface DescriptionListDetailsProps extends React.ComponentProps<"dd"> {
|
|
24
|
+
/** Colours the value. Keep a sign or a word with it, such as "-$12" or "saved". */
|
|
25
|
+
tone?: DetailsTone;
|
|
26
|
+
}
|
|
27
|
+
declare function DescriptionListDetails({ tone, className, ...props }: DescriptionListDetailsProps): React.JSX.Element;
|
|
28
|
+
export { DescriptionList, DescriptionListDetails, DescriptionListItem, DescriptionListTerm };
|
|
29
|
+
//# sourceMappingURL=description-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-list.d.ts","sourceRoot":"","sources":["../../src/components/description-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM,CAAC;AAUzE,MAAM,WAAW,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IACtE,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,iBAAS,eAAe,CAAC,EAAE,QAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,qBAQtF;AAED,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC3E,mDAAmD;IACnD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,iBAAS,mBAAmB,CAAC,EAAE,QAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,qBAa/F;AAED,MAAM,WAAW,wBAAyB,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IAC1E,gEAAgE;IAChE,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,iBAAS,mBAAmB,CAAC,EAAE,IAAY,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,qBAY3F;AAED,MAAM,WAAW,2BAA4B,SAAQ,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC;IAC7E,mFAAmF;IACnF,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED,iBAAS,sBAAsB,CAAC,EAAE,IAAgB,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,2BAA2B,qBAQrG;AAED,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils.js";
|
|
3
|
+
const toneText = {
|
|
4
|
+
neutral: "text-foreground",
|
|
5
|
+
success: "text-success",
|
|
6
|
+
warning: "text-warning",
|
|
7
|
+
danger: "text-danger",
|
|
8
|
+
info: "text-info",
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Key and value rows: file metadata, a price breakdown, request headers, or
|
|
12
|
+
* account details. A real `<dl>`, so each term labels its value for assistive
|
|
13
|
+
* technology. Rows wrap on narrow screens instead of truncating the value.
|
|
14
|
+
*/
|
|
15
|
+
function DescriptionList({ bordered = true, className, ...props }) {
|
|
16
|
+
return (_jsx("dl", { "data-slot": "description-list", className: cn("divide-y divide-border text-sm", bordered && "border border-border", className), ...props }));
|
|
17
|
+
}
|
|
18
|
+
function DescriptionListItem({ emphasis = false, className, ...props }) {
|
|
19
|
+
return (_jsx("div", { "data-slot": "description-list-item", "data-emphasis": emphasis ? "" : undefined, className: cn("flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 px-3 py-2.5", emphasis && "border-t-2 border-t-border font-semibold [&>dt]:text-foreground", className), ...props }));
|
|
20
|
+
}
|
|
21
|
+
function DescriptionListTerm({ mono = false, className, ...props }) {
|
|
22
|
+
return (_jsx("dt", { "data-slot": "description-list-term", className: cn("min-w-[4.5rem] text-muted-foreground", mono && "font-mono text-xs", className), ...props }));
|
|
23
|
+
}
|
|
24
|
+
function DescriptionListDetails({ tone = "neutral", className, ...props }) {
|
|
25
|
+
return (_jsx("dd", { "data-slot": "description-list-details", className: cn("text-right tabular-nums break-words", toneText[tone], className), ...props }));
|
|
26
|
+
}
|
|
27
|
+
export { DescriptionList, DescriptionListDetails, DescriptionListItem, DescriptionListTerm };
|
|
28
|
+
//# sourceMappingURL=description-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"description-list.js","sourceRoot":"","sources":["../../src/components/description-list.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAIlC,MAAM,QAAQ,GAAgC;IAC5C,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,cAAc;IACvB,OAAO,EAAE,cAAc;IACvB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;CAClB,CAAC;AAOF;;;;GAIG;AACH,SAAS,eAAe,CAAC,EAAE,QAAQ,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAwB;IACrF,OAAO,CACL,0BACY,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CAAC,gCAAgC,EAAE,QAAQ,IAAI,sBAAsB,EAAE,SAAS,CAAC,KAC1F,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,SAAS,mBAAmB,CAAC,EAAE,QAAQ,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAA4B;IAC9F,OAAO,CACL,2BACY,uBAAuB,mBAClB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EACxC,SAAS,EAAE,EAAE,CACX,2EAA2E,EAC3E,QAAQ,IAAI,iEAAiE,EAC7E,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,SAAS,mBAAmB,CAAC,EAAE,IAAI,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAA4B;IAC1F,OAAO,CACL,0BACY,uBAAuB,EACjC,SAAS,EAAE,EAAE,CACX,sCAAsC,EACtC,IAAI,IAAI,mBAAmB,EAC3B,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,SAAS,sBAAsB,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACpG,OAAO,CACL,0BACY,0BAA0B,EACpC,SAAS,EAAE,EAAE,CAAC,qCAAqC,EAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,KAC3E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
7
|
+
declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
|
|
8
|
+
declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
9
|
+
showCloseButton?: boolean;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function DialogFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
|
|
14
|
+
declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
|
|
15
|
+
export { Dialog, DialogTrigger, DialogClose, DialogPortal, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
16
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAKrD,QAAA,MAAM,MAAM,uCAAuB,CAAC;AACpC,QAAA,MAAM,aAAa,8GAA0B,CAAC;AAC9C,QAAA,MAAM,WAAW,4GAAwB,CAAC;AAC1C,QAAA,MAAM,YAAY,6CAAyB,CAAC;AAE5C,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAatD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,qBA+BA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Dialog as DialogPrimitive } from "radix-ui";
|
|
4
|
+
import { IconX } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
const Dialog = DialogPrimitive.Root;
|
|
7
|
+
const DialogTrigger = DialogPrimitive.Trigger;
|
|
8
|
+
const DialogClose = DialogPrimitive.Close;
|
|
9
|
+
const DialogPortal = DialogPrimitive.Portal;
|
|
10
|
+
function DialogOverlay({ className, ...props }) {
|
|
11
|
+
return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("fixed inset-0 z-50 bg-black/40 backdrop-blur-sm dark:bg-black/60", "data-[state=open]:animate-in data-[state=open]:fade-in-0", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0", className), ...props }));
|
|
12
|
+
}
|
|
13
|
+
function DialogContent({ className, children, showCloseButton = true, ...props }) {
|
|
14
|
+
return (_jsxs(DialogPortal, { children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("fixed left-1/2 top-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto", "border border-border bg-popover p-6 text-popover-foreground shadow-2xl", "duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className), ...props, children: [children, showCloseButton ? (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: cn("absolute right-3 top-3 inline-flex size-8 items-center justify-center text-muted-foreground transition-colors hover:bg-muted hover:text-foreground", "outline-none focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover"), children: [_jsx(IconX, { "aria-hidden": "true", className: "size-4" }), _jsx("span", { className: "sr-only", children: "Close" })] })) : null] })] }));
|
|
15
|
+
}
|
|
16
|
+
function DialogHeader({ className, ...props }) {
|
|
17
|
+
return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-1.5 pr-6 text-left", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function DialogFooter({ className, ...props }) {
|
|
20
|
+
return (_jsx("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props }));
|
|
21
|
+
}
|
|
22
|
+
function DialogTitle({ className, ...props }) {
|
|
23
|
+
return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg font-semibold leading-none tracking-tight", className), ...props }));
|
|
24
|
+
}
|
|
25
|
+
function DialogDescription({ className, ...props }) {
|
|
26
|
+
return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-sm leading-relaxed text-muted-foreground", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
export { Dialog, DialogTrigger, DialogClose, DialogPortal, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
29
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.js","sourceRoot":"","sources":["../../src/components/dialog.tsx"],"names":[],"mappings":"AAAA,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AAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACxE,OAAO,CACL,2BACY,eAAe,EACzB,SAAS,EAAE,EAAE,CAAC,sCAAsC,EAAE,SAAS,CAAC,KAC5D,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAA+B;IACxE,OAAO,CACL,2BACY,eAAe,EACzB,SAAS,EAAE,EAAE,CAAC,wDAAwD,EAAE,SAAS,CAAC,KAC9E,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EAC2C;IACnD,OAAO,CACL,KAAC,eAAe,CAAC,KAAK,iBACV,cAAc,EACxB,SAAS,EAAE,EAAE,CAAC,mDAAmD,EAAE,SAAS,CAAC,KACzE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACiD;IACzD,OAAO,CACL,KAAC,eAAe,CAAC,WAAW,iBAChB,oBAAoB,EAC9B,SAAS,EAAE,EAAE,CAAC,+CAA+C,EAAE,SAAS,CAAC,KACrE,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
3
|
+
declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
|
|
10
|
+
declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
|
|
11
|
+
inset?: boolean;
|
|
12
|
+
variant?: "default" | "destructive";
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
|
|
15
|
+
declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
|
|
16
|
+
declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
|
|
17
|
+
inset?: boolean;
|
|
18
|
+
}): React.JSX.Element;
|
|
19
|
+
declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
|
|
20
|
+
declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
21
|
+
declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
|
|
22
|
+
inset?: boolean;
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
|
|
25
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
26
|
+
//# sourceMappingURL=dropdown-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAKjE,QAAA,MAAM,YAAY,mDAA6B,CAAC;AAChD,QAAA,MAAM,mBAAmB,0HAAgC,CAAC;AAC1D,QAAA,MAAM,iBAAiB,qHAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yDAA+B,CAAC;AACxD,QAAA,MAAM,eAAe,sDAA4B,CAAC;AAClD,QAAA,MAAM,sBAAsB,0HAAmC,CAAC;AAEhE,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAiB5D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CACrC,qBAkBA;AAED,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,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AAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
|
|
4
|
+
import { IconCheck, IconChevronRight } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
const DropdownMenu = DropdownMenuPrimitive.Root;
|
|
7
|
+
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
|
|
8
|
+
const DropdownMenuGroup = DropdownMenuPrimitive.Group;
|
|
9
|
+
const DropdownMenuPortal = DropdownMenuPrimitive.Portal;
|
|
10
|
+
const DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
11
|
+
const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
12
|
+
function DropdownMenuContent({ className, sideOffset = 4, ...props }) {
|
|
13
|
+
return (_jsx(DropdownMenuPrimitive.Portal, { children: _jsx(DropdownMenuPrimitive.Content, { "data-slot": "dropdown-menu-content", sideOffset: sideOffset, className: cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[12rem] overflow-y-auto", "border border-border bg-popover p-1 text-popover-foreground shadow-lg", "data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", "data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95", className), ...props }) }));
|
|
14
|
+
}
|
|
15
|
+
function DropdownMenuItem({ className, inset, variant = "default", ...props }) {
|
|
16
|
+
return (_jsx(DropdownMenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: cn("relative flex cursor-default select-none items-center gap-2 px-3 py-2 text-sm outline-none", "transition-colors focus:bg-muted focus:text-foreground", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", "[&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", variant === "destructive" &&
|
|
17
|
+
"text-destructive focus:bg-danger-soft focus:text-danger-strong", className), ...props }));
|
|
18
|
+
}
|
|
19
|
+
function DropdownMenuCheckboxItem({ className, children, checked, ...props }) {
|
|
20
|
+
return (_jsxs(DropdownMenuPrimitive.CheckboxItem, { "data-slot": "dropdown-menu-checkbox-item", checked: checked, className: cn("relative flex cursor-default select-none items-center gap-2 py-2 pl-8 pr-3 text-sm outline-none", "transition-colors focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx(IconCheck, { "aria-hidden": "true", className: "size-4" }) }) }), children] }));
|
|
21
|
+
}
|
|
22
|
+
function DropdownMenuRadioItem({ className, children, ...props }) {
|
|
23
|
+
return (_jsxs(DropdownMenuPrimitive.RadioItem, { "data-slot": "dropdown-menu-radio-item", className: cn("relative flex cursor-default select-none items-center gap-2 py-2 pl-8 pr-3 text-sm outline-none", "transition-colors focus:bg-muted focus:text-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className), ...props, children: [_jsx("span", { className: "absolute left-2 flex size-4 items-center justify-center", children: _jsx(DropdownMenuPrimitive.ItemIndicator, { children: _jsx("span", { className: "size-2 bg-current" }) }) }), children] }));
|
|
24
|
+
}
|
|
25
|
+
function DropdownMenuLabel({ className, inset, ...props }) {
|
|
26
|
+
return (_jsx(DropdownMenuPrimitive.Label, { "data-slot": "dropdown-menu-label", className: cn("px-3 py-1.5 text-xs font-medium uppercase tracking-wide text-muted-foreground", inset && "pl-8", className), ...props }));
|
|
27
|
+
}
|
|
28
|
+
function DropdownMenuSeparator({ className, ...props }) {
|
|
29
|
+
return (_jsx(DropdownMenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: cn("-mx-1 my-1 h-px bg-separator", className), ...props }));
|
|
30
|
+
}
|
|
31
|
+
function DropdownMenuShortcut({ className, ...props }) {
|
|
32
|
+
return (_jsx("span", { "data-slot": "dropdown-menu-shortcut", className: cn("ml-auto text-[10px] font-semibold uppercase tracking-[0.12em] text-muted-foreground", className), ...props }));
|
|
33
|
+
}
|
|
34
|
+
function DropdownMenuSubTrigger({ className, inset, children, ...props }) {
|
|
35
|
+
return (_jsxs(DropdownMenuPrimitive.SubTrigger, { "data-slot": "dropdown-menu-sub-trigger", className: cn("flex cursor-default select-none items-center gap-2 px-3 py-2 text-sm outline-none", "focus:bg-muted data-[state=open]:bg-muted", inset && "pl-8", className), ...props, children: [children, _jsx(IconChevronRight, { "aria-hidden": "true", className: "ml-auto size-4" })] }));
|
|
36
|
+
}
|
|
37
|
+
function DropdownMenuSubContent({ className, ...props }) {
|
|
38
|
+
return (_jsx(DropdownMenuPrimitive.SubContent, { "data-slot": "dropdown-menu-sub-content", className: cn("z-50 min-w-[10rem] overflow-hidden border border-border bg-popover p-1 text-popover-foreground shadow-lg", className), ...props }));
|
|
39
|
+
}
|
|
40
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
41
|
+
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sourceRoot":"","sources":["../../src/components/dropdown-menu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAGb,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC,MAAM,YAAY,GAAG,qBAAqB,CAAC,IAAI,CAAC;AAChD,MAAM,mBAAmB,G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,GAAG,KAAK,EAGT;IACC,OAAO,CACL,MAAC,qBAAqB,CAAC,UAAU,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,mFAAmF,EACnF,2CAA2C,EAC3C,KAAK,IAAI,MAAM,EACf,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,gBAAgB,mBAAa,MAAM,EAAC,SAAS,EAAC,gBAAgB,GAAG,IACjC,CACpC,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACsD;IAC9D,OAAO,CACL,KAAC,qBAAqB,CAAC,UAAU,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,0GAA0G,EAC1G,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,GACvB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export type FileRejectionReason = "type" | "size" | "count";
|
|
3
|
+
export interface FileRejection {
|
|
4
|
+
file: File;
|
|
5
|
+
reason: FileRejectionReason;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* True when a file satisfies an `accept` string in the same syntax as the
|
|
9
|
+
* native input: extensions (".pdf"), exact MIME types ("image/png"), and
|
|
10
|
+
* wildcards ("image/*"). The picker filters by `accept`, but dropped files do
|
|
11
|
+
* not, so every file is checked here before it is reported as accepted.
|
|
12
|
+
*/
|
|
13
|
+
declare function fileMatchesAccept(file: File, accept?: string): boolean;
|
|
14
|
+
/** "980 B", "14.2 KB", "3.1 MB". Uses 1024-based units, like file managers. */
|
|
15
|
+
declare function formatFileSize(bytes: number): string;
|
|
16
|
+
export interface DropzoneProps extends Omit<React.ComponentProps<"div">, "onDrop" | "onChange" | "children"> {
|
|
17
|
+
/** Called with the files that passed type, size, and count checks. */
|
|
18
|
+
onFilesAccepted: (files: File[]) => void;
|
|
19
|
+
/** Called with each refused file and the reason, so the page can explain it. */
|
|
20
|
+
onFilesRejected?: (rejections: FileRejection[]) => void;
|
|
21
|
+
/** Accepted types, in native `accept` syntax. Checked for dropped files too. */
|
|
22
|
+
accept?: string;
|
|
23
|
+
multiple?: boolean;
|
|
24
|
+
/** Largest accepted file in bytes. */
|
|
25
|
+
maxSize?: number;
|
|
26
|
+
/** Most files accepted from one selection. Defaults to 1 unless `multiple`. */
|
|
27
|
+
maxFiles?: number;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/** Primary line, also the input's accessible name. */
|
|
30
|
+
label?: React.ReactNode;
|
|
31
|
+
/** Secondary line under the label. */
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
/** Formats and limits, such as "PNG or JPG, up to 10 MB". Announced as the description. */
|
|
34
|
+
hint?: React.ReactNode;
|
|
35
|
+
icon?: React.ReactNode;
|
|
36
|
+
/** Props for the underlying file input, such as `id`, `name`, or `aria-describedby`. */
|
|
37
|
+
inputProps?: Omit<React.ComponentProps<"input">, "type" | "accept" | "multiple" | "disabled" | "onChange">;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A drag-and-drop area backed by a real file input. The input is visually
|
|
41
|
+
* hidden but stays focusable, so Tab reaches it, Enter or Space opens the
|
|
42
|
+
* picker, and the frame shows the focus ring. Files are validated the same way
|
|
43
|
+
* whether they were dropped or picked.
|
|
44
|
+
*/
|
|
45
|
+
declare function Dropzone({ onFilesAccepted, onFilesRejected, accept, multiple, maxSize, maxFiles, disabled, label, description, hint, icon, inputProps, className, ...props }: DropzoneProps): React.JSX.Element;
|
|
46
|
+
export { Dropzone, fileMatchesAccept, formatFileSize };
|
|
47
|
+
//# sour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AAK,CAAC,SAAS,CAAC;IACvB,wFAAwF;IACxF,UAAU,CAAC,EAAE,IAAI,CACf,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAC7B,MAAM,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CACzD,CAAC;CACH;AAED;;;;;GAKG;AACH,iBAAS,QAAQ,CAAC,EAChB,eAAe,EACf,eAAe,EACf,MAAM,EACN,QAAgB,EAChB,OAAO,EACP,QAAQ,EACR,QAAgB,EAChB,KAA0B,EAC1B,WAAkC,EAClC,IAAI,EACJ,IAAI,EACJ,UAAU,EACV,SAAS,EACT,GAAG,KAAK,EACT,EAAE,aAAa,qBAsIf;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { IconUpload } from "@tabler/icons-react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
/**
|
|
7
|
+
* True when a file satisfies an `accept` string in the same syntax as the
|
|
8
|
+
* native input: extensions (".pdf"), exact MIME types ("image/png"), and
|
|
9
|
+
* wildcards ("image/*"). The picker filters by `accept`, but dropped files do
|
|
10
|
+
* not, so every file is checked here before it is reported as accepted.
|
|
11
|
+
*/
|
|
12
|
+
function fileMatchesAccept(file, accept) {
|
|
13
|
+
if (!accept)
|
|
14
|
+
return true;
|
|
15
|
+
const tokens = accept
|
|
16
|
+
.split(",")
|
|
17
|
+
.map((token) => token.trim().toLowerCase())
|
|
18
|
+
.filter(Boolean);
|
|
19
|
+
if (tokens.length === 0)
|
|
20
|
+
return true;
|
|
21
|
+
const name = file.name.toLowerCase();
|
|
22
|
+
const type = (file.type || "").toLowerCase();
|
|
23
|
+
return tokens.some((token) => {
|
|
24
|
+
if (token.startsWith("."))
|
|
25
|
+
return name.endsWith(token);
|
|
26
|
+
if (token.endsWith("/*"))
|
|
27
|
+
return type.startsWith(token.slice(0, -1));
|
|
28
|
+
return type === token;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/** "980 B", "14.2 KB", "3.1 MB". Uses 1024-based units, like file managers. */
|
|
32
|
+
function formatFileSize(bytes) {
|
|
33
|
+
if (!Number.isFinite(bytes) || bytes < 0)
|
|
34
|
+
return "";
|
|
35
|
+
if (bytes < 1024)
|
|
36
|
+
return `${bytes} B`;
|
|
37
|
+
const units = ["KB", "MB", "GB", "TB"];
|
|
38
|
+
let value = bytes / 1024;
|
|
39
|
+
let unit = 0;
|
|
40
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
41
|
+
value /= 1024;
|
|
42
|
+
unit += 1;
|
|
43
|
+
}
|
|
44
|
+
return `${value < 10 ? value.toFixed(1) : Math.round(value)} ${units[unit]}`;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A drag-and-drop area backed by a real file input. The input is visually
|
|
48
|
+
* hidden but stays focusable, so Tab reaches it, Enter or Space opens the
|
|
49
|
+
* picker, and the frame shows the focus ring. Files are validated the same way
|
|
50
|
+
* whether they were dropped or picked.
|
|
51
|
+
*/
|
|
52
|
+
function Dropzone({ onFilesAccepted, onFilesRejected, accept, multiple = false, maxSize, maxFiles, disabled = false, label = "Drop a file here", description = "or click to browse", hint, icon, inputProps, className, ...props }) {
|
|
53
|
+
const generatedId = React.useId();
|
|
54
|
+
const inputId = inputProps?.id ?? `${generatedId}-input`;
|
|
55
|
+
const labelId = `${generatedId}-label`;
|
|
56
|
+
const descriptionId = `${generatedId}-description`;
|
|
57
|
+
const hintId = `${generatedId}-hint`;
|
|
58
|
+
const [dragging, setDragging] = React.useState(false);
|
|
59
|
+
const depth = React.useRef(0);
|
|
60
|
+
const limit = maxFiles ?? (multiple ? Number.POSITIVE_INFINITY : 1);
|
|
61
|
+
function handleFiles(list) {
|
|
62
|
+
if (!list || disabled)
|
|
63
|
+
return;
|
|
64
|
+
const files = Array.from(list);
|
|
65
|
+
const accepted = [];
|
|
66
|
+
const rejected = [];
|
|
67
|
+
for (const file of files) {
|
|
68
|
+
if (!fileMatchesAccept(file, accept)) {
|
|
69
|
+
rejected.push({ file, reason: "type" });
|
|
70
|
+
}
|
|
71
|
+
else if (maxSize !== undefined && file.size > maxSize) {
|
|
72
|
+
rejected.push({ file, reason: "size" });
|
|
73
|
+
}
|
|
74
|
+
else if (accepted.length >= limit) {
|
|
75
|
+
rejected.push({ file, reason: "count" });
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
accepted.push(file);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (accepted.length > 0)
|
|
82
|
+
onFilesAccepted(accepted);
|
|
83
|
+
if (rejected.length > 0)
|
|
84
|
+
onFilesRejected?.(rejected);
|
|
85
|
+
}
|
|
86
|
+
function handleDragEnter(event) {
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
if (disabled)
|
|
89
|
+
return;
|
|
90
|
+
depth.current += 1;
|
|
91
|
+
setDragging(true);
|
|
92
|
+
}
|
|
93
|
+
function handleDragOver(event) {
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
if (disabled)
|
|
96
|
+
return;
|
|
97
|
+
event.dataTransfer.dropEffect = "copy";
|
|
98
|
+
}
|
|
99
|
+
function handleDragLeave(event) {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
depth.current = Math.max(0, depth.current - 1);
|
|
102
|
+
if (depth.current === 0)
|
|
103
|
+
setDragging(false);
|
|
104
|
+
}
|
|
105
|
+
function handleDrop(event) {
|
|
106
|
+
event.preventDefault();
|
|
107
|
+
depth.current = 0;
|
|
108
|
+
setDragging(false);
|
|
109
|
+
handleFiles(event.dataTransfer.files);
|
|
110
|
+
}
|
|
111
|
+
const describedBy = [
|
|
112
|
+
description ? descriptionId : null,
|
|
113
|
+
hint ? hintId : null,
|
|
114
|
+
inputProps?.["aria-describedby"],
|
|
115
|
+
]
|
|
116
|
+
.filter(Boolean)
|
|
117
|
+
.join(" ");
|
|
118
|
+
return (_jsxs("div", { "data-slot": "dropzone", "data-dragging": dragging ? "" : undefined, "data-disabled": disabled ? "" : undefined, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, className: cn("relative border-2 border-dashed border-muted-foreground/25 bg-background transition-colors duration-200", "has-[input:focus-visible]:border-solid has-[input:focus-visible]:border-focus-ring", "has-[input:focus-visible]:ring-2 has-[input:focus-visible]:ring-focus-ring has-[input:focus-visible]:ring-offset-2 has-[input:focus-visible]:ring-offset-background", !disabled && "hover:border-primary-300 hover:bg-muted/50 dark:hover:border-primary-600", dragging && "border-primary-500 bg-brand-wash", disabled && "cursor-not-allowed opacity-50", className), ...props, children: [_jsx("input", { ...inputProps, id: inputId, type: "file", accept: accept, multiple: multiple, disabled: disabled, "aria-labelledby": labelId, "aria-describedby": describedBy || undefined, className: cn("sr-only", inputProps?.className), onChange: (event) => {
|
|
119
|
+
handleFiles(event.target.files);
|
|
120
|
+
// Clear the value so choosing the same file again fires a change.
|
|
121
|
+
event.target.value = "";
|
|
122
|
+
} }), _jsxs("label", { htmlFor: inputId, className: cn("flex flex-col items-center gap-3 p-8 text-center", disabled ? "cursor-not-allowed" : "cursor-pointer"), children: [_jsx("span", { "aria-hidden": "true", className: "flex size-12 items-center justify-center bg-brand-chip text-brand-icon [&_svg]:size-6", children: icon ?? _jsx(IconUpload, {}) }), _jsxs("span", { className: "flex flex-col gap-1", children: [_jsx("span", { id: labelId, className: "text-sm font-medium text-foreground", children: label }), description ? (_jsx("span", { id: descriptionId, className: "text-sm text-muted-foreground", children: description })) : null] }), hint ? (_jsx("span", { id: hintId, className: "text-xs text-muted-foreground", children: hint })) : null] })] }));
|
|
123
|
+
}
|
|
124
|
+
export { Dropzone, fileMatchesAccept, formatFileSize };
|
|
125
|
+
//# sourceMappingURL=dropzone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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CACR,CAAC,CAAC,CAAC,IAAI,IACH,EACN,IAAI,CAAC,CAAC,CAAC,CACN,eAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAC,+BAA+B,YACxD,IAAI,GACA,CACR,CAAC,CAAC,CAAC,IAAI,IACF,IACJ,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface EmptyStateProps extends Omit<React.ComponentProps<"div">, "title"> {
|
|
3
|
+
icon?: React.ReactNode;
|
|
4
|
+
title: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
action?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare function EmptyState({ icon, title, description, action, className, ...props }: EmptyStateProps): React.JSX.Element;
|
|
9
|
+
export { EmptyState };
|
|
10
|
+
//# sourceMappingURL=empty-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACjF,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,iBAAS,UAAU,CAAC,EAClB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,eAAe,qBAsBjB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconInbox } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
function EmptyState({ icon, title, description, action, className, ...props }) {
|
|
5
|
+
return (_jsxs("div", { "data-slot": "empty-state", className: cn("flex flex-col items-center justify-center gap-3 border border-border bg-muted/10 p-12 text-center", className), ...props, children: [_jsx("div", { className: "flex size-12 items-center justify-center text-muted-foreground/40 [&_svg]:size-8", children: icon ?? _jsx(IconInbox, { "aria-hidden": "true" }) }), _jsx("p", { className: "text-base font-semibold text-foreground", children: title }), description ? (_jsx("p", { className: "max-w-sm text-sm leading-relaxed text-muted-foreground", children: description })) : null, action ? _jsx("div", { className: "mt-2", children: action }) : null] }));
|
|
6
|
+
}
|
|
7
|
+
export { EmptyState };
|
|
8
|
+
//# sourceMappingURL=empty-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-state.js","sourceRoot":"","sources":["../../src/components/empty-state.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AASlC,SAAS,UAAU,CAAC,EAClB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACQ;IAChB,OAAO,CACL,4BACY,aAAa,EACvB,SAAS,EAAE,EAAE,CACX,mGAAmG,EACnG,SAAS,CACV,KACG,KAAK,aAET,cAAK,SAAS,EAAC,kFAAkF,YAC9F,IAAI,IAAI,KAAC,SAAS,mBAAa,MAAM,GAAG,GACrC,EACN,YAAG,SAAS,EAAC,yCAAyC,YAAE,KAAK,GAAK,EACjE,WAAW,CAAC,CAAC,CAAC,CACb,YAAG,SAAS,EAAC,wDAAwD,YAClE,WAAW,GACV,CACL,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,MAAM,YAAE,MAAM,GAAO,CAAC,CAAC,CAAC,IAAI,IACjD,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface FieldProps extends React.ComponentProps<"div"> {
|
|
3
|
+
/** The control id this field labels. */
|
|
4
|
+
htmlFor: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
error?: React.ReactNode;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Layout and labeling for a single form control. It does not inject props into
|
|
12
|
+
* the control; pass `id`, `aria-describedby`, and `aria-invalid` explicitly so
|
|
13
|
+
* the relationship stays visible in the consuming code.
|
|
14
|
+
*/
|
|
15
|
+
declare function Field({ htmlFor, label, description, error, required, className, children, ...props }: FieldProps): React.JSX.Element;
|
|
16
|
+
export { Field };
|
|
17
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC7D,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;GAIG;AACH,iBAAS,KAAK,CAAC,EACb,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,qBAgCZ;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { IconAlertCircle } from "@tabler/icons-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* Layout and labeling for a single form control. It does not inject props into
|
|
6
|
+
* the control; pass `id`, `aria-describedby`, and `aria-invalid` explicitly so
|
|
7
|
+
* the relationship stays visible in the consuming code.
|
|
8
|
+
*/
|
|
9
|
+
function Field({ htmlFor, label, description, error, required, className, children, ...props }) {
|
|
10
|
+
return (_jsxs("div", { "data-slot": "field", className: cn("flex flex-col gap-1.5", className), ...props, children: [_jsxs("label", { htmlFor: htmlFor, className: "flex items-center gap-1 text-sm font-medium leading-none text-foreground", children: [label, required ? (_jsx("span", { "aria-hidden": "true", className: "text-destructive", children: "*" })) : null] }), children, description ? (_jsx("p", { id: `${htmlFor}-description`, className: "text-xs leading-relaxed text-muted-foreground", children: description })) : null, error ? (_jsxs("p", { id: `${htmlFor}-error`, role: "alert", className: "flex items-start gap-1.5 text-xs font-medium leading-relaxed text-danger", children: [_jsx(IconAlertCircle, { "aria-hidden": "true", className: "mt-0.5 size-3.5 shrink-0" }), error] })) : null] }));
|
|
11
|
+
}
|
|
12
|
+
export { Field };
|
|
13
|
+
//# sourceMappingURL=field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.js","sourceRoot":"","sources":["../../src/components/field.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAWlC;;;;GAIG;AACH,SAAS,KAAK,CAAC,EACb,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACG;IACX,OAAO,CACL,4BAAe,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,CAAC,KAAM,KAAK,aACjF,iBACE,OAAO,EAAE,OAAO,EAChB,SAAS,EAAC,0EAA0E,aAEnF,KAAK,EACL,QAAQ,CAAC,CAAC,CAAC,CACV,8BAAkB,MAAM,EAAC,SAAS,EAAC,kBAAkB,kBAE9C,CACR,CAAC,CAAC,CAAC,IAAI,IACF,EACP,QAAQ,EACR,WAAW,CAAC,CAAC,CAAC,CACb,YAAG,EAAE,EAAE,GAAG,OAAO,cAAc,EAAE,SAAS,EAAC,+CAA+C,YACvF,WAAW,GACV,CACL,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,CAAC,CAAC,CACP,aACE,EAAE,EAAE,GAAG,OAAO,QAAQ,EACtB,IAAI,EAAC,OAAO,EACZ,SAAS,EAAC,0EAA0E,aAEpF,KAAC,eAAe,mBAAa,MAAM,EAAC,SAAS,EAAC,0BAA0B,GAAG,EAC1E,KAAK,IACJ,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { HoverCard as HoverCardPrimitive } from "radix-ui";
|
|
3
|
+
declare const HoverCard: React.FC<HoverCardPrimitive.HoverCardProps>;
|
|
4
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardPrimitive.HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
5
|
+
declare function HoverCardContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof HoverCardPrimitive.Content>): React.JSX.Element;
|
|
6
|
+
export { HoverCard, HoverCardTrigger, HoverCardContent };
|
|
7
|
+
//# sourceMappingURL=hover-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI3D,QAAA,MAAM,SAAS,6CAA0B,CAAC;AAC1C,QAAA,MAAM,gBAAgB,oHAA6B,CAAC;AAEpD,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAgB,EAChB,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,qBAiBzD;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
|