@inshorts/glint-ui 0.5.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -0
- package/README.md +3 -9
- package/dist/alert.cjs +96 -0
- package/dist/alert.cjs.map +1 -0
- package/dist/alert.d.cts +29 -0
- package/dist/alert.d.ts +29 -0
- package/dist/alert.js +10 -0
- package/dist/alert.js.map +1 -0
- package/dist/autocomplete.cjs +578 -0
- package/dist/autocomplete.cjs.map +1 -0
- package/dist/autocomplete.d.cts +56 -0
- package/dist/autocomplete.d.ts +56 -0
- package/dist/autocomplete.js +11 -0
- package/dist/autocomplete.js.map +1 -0
- package/dist/badge.cjs +89 -0
- package/dist/badge.cjs.map +1 -0
- package/dist/badge.d.cts +25 -0
- package/dist/badge.d.ts +25 -0
- package/dist/badge.js +10 -0
- package/dist/badge.js.map +1 -0
- package/dist/breadcrumb.cjs +88 -0
- package/dist/breadcrumb.cjs.map +1 -0
- package/dist/breadcrumb.d.cts +14 -0
- package/dist/breadcrumb.d.ts +14 -0
- package/dist/breadcrumb.js +8 -0
- package/dist/breadcrumb.js.map +1 -0
- package/dist/button.cjs +143 -0
- package/dist/button.cjs.map +1 -0
- package/dist/button.d.cts +34 -0
- package/dist/button.d.ts +34 -0
- package/dist/button.js +9 -0
- package/dist/button.js.map +1 -0
- package/dist/card.cjs +111 -0
- package/dist/card.cjs.map +1 -0
- package/dist/card.d.cts +15 -0
- package/dist/card.d.ts +15 -0
- package/dist/card.js +18 -0
- package/dist/card.js.map +1 -0
- package/dist/checkbox.cjs +66 -0
- package/dist/checkbox.cjs.map +1 -0
- package/{src/checkbox.tsx → dist/checkbox.d.cts} +5 -22
- package/dist/checkbox.d.ts +25 -0
- package/dist/checkbox.js +10 -0
- package/dist/checkbox.js.map +1 -0
- package/dist/chunk-43ZUFY63.js +85 -0
- package/dist/chunk-43ZUFY63.js.map +1 -0
- package/dist/chunk-67ACNS42.js +29 -0
- package/dist/chunk-67ACNS42.js.map +1 -0
- package/dist/chunk-6URKHMCF.js +76 -0
- package/dist/chunk-6URKHMCF.js.map +1 -0
- package/dist/chunk-ASU6CUTZ.js +85 -0
- package/dist/chunk-ASU6CUTZ.js.map +1 -0
- package/dist/chunk-EWSBFU54.js +53 -0
- package/dist/chunk-EWSBFU54.js.map +1 -0
- package/dist/chunk-G4ZQUSAJ.js +38 -0
- package/dist/chunk-G4ZQUSAJ.js.map +1 -0
- package/dist/chunk-GMCUXEFI.js +67 -0
- package/dist/chunk-GMCUXEFI.js.map +1 -0
- package/dist/chunk-HBBOR43A.js +85 -0
- package/dist/chunk-HBBOR43A.js.map +1 -0
- package/dist/chunk-HCA5ODCD.js +11 -0
- package/dist/chunk-HCA5ODCD.js.map +1 -0
- package/dist/chunk-HYRJYUPI.js +26 -0
- package/dist/chunk-HYRJYUPI.js.map +1 -0
- package/dist/chunk-IRCTGJQB.js +26 -0
- package/dist/chunk-IRCTGJQB.js.map +1 -0
- package/dist/chunk-JDE5XYPT.js +30 -0
- package/dist/chunk-JDE5XYPT.js.map +1 -0
- package/dist/chunk-JSJEEKR3.js +59 -0
- package/dist/chunk-JSJEEKR3.js.map +1 -0
- package/dist/chunk-KR3BCFP7.js +85 -0
- package/dist/chunk-KR3BCFP7.js.map +1 -0
- package/dist/chunk-MQT5RAQV.js +202 -0
- package/dist/chunk-MQT5RAQV.js.map +1 -0
- package/dist/chunk-MUPW2TFJ.js +102 -0
- package/dist/chunk-MUPW2TFJ.js.map +1 -0
- package/dist/chunk-PM2VE7DJ.js +100 -0
- package/dist/chunk-PM2VE7DJ.js.map +1 -0
- package/dist/chunk-PPYR3O3L.js +44 -0
- package/dist/chunk-PPYR3O3L.js.map +1 -0
- package/dist/chunk-PUTC52SI.js +98 -0
- package/dist/chunk-PUTC52SI.js.map +1 -0
- package/dist/chunk-PVK4WQJZ.js +513 -0
- package/dist/chunk-PVK4WQJZ.js.map +1 -0
- package/dist/chunk-PWAKTEXF.js +18 -0
- package/dist/chunk-PWAKTEXF.js.map +1 -0
- package/dist/chunk-QTFWORA7.js +26 -0
- package/dist/chunk-QTFWORA7.js.map +1 -0
- package/dist/chunk-RUPL2H6V.js +49 -0
- package/dist/chunk-RUPL2H6V.js.map +1 -0
- package/dist/chunk-S7PVZAPL.js +28 -0
- package/dist/chunk-S7PVZAPL.js.map +1 -0
- package/dist/chunk-SQDV2AKJ.js +49 -0
- package/dist/chunk-SQDV2AKJ.js.map +1 -0
- package/dist/chunk-T2KXVH3O.js +297 -0
- package/dist/chunk-T2KXVH3O.js.map +1 -0
- package/dist/chunk-T4WCCHJQ.js +29 -0
- package/dist/chunk-T4WCCHJQ.js.map +1 -0
- package/dist/chunk-UC3ZIQPE.js +93 -0
- package/dist/chunk-UC3ZIQPE.js.map +1 -0
- package/dist/chunk-UE7JY7VR.js +28 -0
- package/dist/chunk-UE7JY7VR.js.map +1 -0
- package/dist/chunk-WVNRFO5F.js +70 -0
- package/dist/chunk-WVNRFO5F.js.map +1 -0
- package/dist/chunk-Y5WCT6XN.js +93 -0
- package/dist/chunk-Y5WCT6XN.js.map +1 -0
- package/dist/chunk-YDICVETX.js +151 -0
- package/dist/chunk-YDICVETX.js.map +1 -0
- package/dist/chunk-YSU4VWRD.js +90 -0
- package/dist/chunk-YSU4VWRD.js.map +1 -0
- package/dist/chunk-ZFSQVMLJ.js +126 -0
- package/dist/chunk-ZFSQVMLJ.js.map +1 -0
- package/dist/chunk-ZHATD73Y.js +46 -0
- package/dist/chunk-ZHATD73Y.js.map +1 -0
- package/dist/chunk-ZLAA4DGG.js +111 -0
- package/dist/chunk-ZLAA4DGG.js.map +1 -0
- package/dist/chunk-ZP252OJZ.js +56 -0
- package/dist/chunk-ZP252OJZ.js.map +1 -0
- package/dist/clipboard.cjs +125 -0
- package/dist/clipboard.cjs.map +1 -0
- package/dist/clipboard.d.cts +52 -0
- package/dist/clipboard.d.ts +52 -0
- package/dist/clipboard.js +23 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/collapsible.cjs +94 -0
- package/dist/collapsible.cjs.map +1 -0
- package/dist/collapsible.d.cts +21 -0
- package/dist/collapsible.d.ts +21 -0
- package/dist/collapsible.js +9 -0
- package/dist/collapsible.js.map +1 -0
- package/dist/confirm-dialog.cjs +369 -0
- package/dist/confirm-dialog.cjs.map +1 -0
- package/dist/confirm-dialog.d.cts +16 -0
- package/dist/confirm-dialog.d.ts +16 -0
- package/dist/confirm-dialog.js +13 -0
- package/dist/confirm-dialog.js.map +1 -0
- package/dist/copy-button.cjs +102 -0
- package/dist/copy-button.cjs.map +1 -0
- package/dist/copy-button.d.cts +18 -0
- package/dist/copy-button.d.ts +18 -0
- package/dist/copy-button.js +10 -0
- package/dist/copy-button.js.map +1 -0
- package/dist/data-table.cjs +140 -0
- package/dist/data-table.cjs.map +1 -0
- package/dist/data-table.d.cts +81 -0
- package/dist/data-table.d.ts +81 -0
- package/dist/data-table.js +8 -0
- package/dist/data-table.js.map +1 -0
- package/dist/date-range-picker/dateRange.cjs +138 -0
- package/dist/date-range-picker/dateRange.cjs.map +1 -0
- package/dist/date-range-picker/dateRange.d.cts +57 -0
- package/dist/date-range-picker/dateRange.d.ts +57 -0
- package/dist/date-range-picker/dateRange.js +31 -0
- package/dist/date-range-picker/dateRange.js.map +1 -0
- package/dist/date-range-picker/index.cjs +375 -0
- package/dist/date-range-picker/index.cjs.map +1 -0
- package/dist/date-range-picker/index.d.cts +18 -0
- package/dist/date-range-picker/index.d.ts +18 -0
- package/dist/date-range-picker/index.js +10 -0
- package/dist/date-range-picker/index.js.map +1 -0
- package/dist/dialogLayer.cjs +121 -0
- package/dist/dialogLayer.cjs.map +1 -0
- package/dist/dialogLayer.d.cts +11 -0
- package/dist/dialogLayer.d.ts +11 -0
- package/dist/dialogLayer.js +8 -0
- package/dist/dialogLayer.js.map +1 -0
- package/dist/feature-access-gate.cjs +160 -0
- package/dist/feature-access-gate.cjs.map +1 -0
- package/dist/feature-access-gate.d.cts +14 -0
- package/dist/feature-access-gate.d.ts +14 -0
- package/dist/feature-access-gate.js +11 -0
- package/dist/feature-access-gate.js.map +1 -0
- package/dist/field.cjs +58 -0
- package/dist/field.cjs.map +1 -0
- package/dist/field.d.cts +23 -0
- package/dist/field.d.ts +23 -0
- package/dist/field.js +8 -0
- package/dist/field.js.map +1 -0
- package/dist/image-uploader.cjs +293 -0
- package/dist/image-uploader.cjs.map +1 -0
- package/dist/image-uploader.d.cts +34 -0
- package/dist/image-uploader.d.ts +34 -0
- package/dist/image-uploader.js +12 -0
- package/dist/image-uploader.js.map +1 -0
- package/dist/index.cjs +3012 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +41 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +232 -0
- package/dist/index.js.map +1 -0
- package/dist/input.cjs +58 -0
- package/dist/input.cjs.map +1 -0
- package/dist/input.d.cts +7 -0
- package/dist/input.d.ts +7 -0
- package/dist/input.js +10 -0
- package/dist/input.js.map +1 -0
- package/dist/label.cjs +67 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.cts +7 -0
- package/dist/label.d.ts +7 -0
- package/dist/label.js +9 -0
- package/dist/label.js.map +1 -0
- package/dist/modal.cjs +212 -0
- package/dist/modal.cjs.map +1 -0
- package/dist/modal.d.cts +39 -0
- package/dist/modal.d.ts +39 -0
- package/dist/modal.js +12 -0
- package/dist/modal.js.map +1 -0
- package/dist/page-header.cjs +78 -0
- package/dist/page-header.cjs.map +1 -0
- package/dist/page-header.d.cts +35 -0
- package/dist/page-header.d.ts +35 -0
- package/dist/page-header.js +8 -0
- package/dist/page-header.js.map +1 -0
- package/dist/pagination.cjs +237 -0
- package/dist/pagination.cjs.map +1 -0
- package/dist/pagination.d.cts +15 -0
- package/dist/pagination.d.ts +15 -0
- package/dist/pagination.js +11 -0
- package/dist/pagination.js.map +1 -0
- package/dist/panel-brand-mark.cjs +59 -0
- package/dist/panel-brand-mark.cjs.map +1 -0
- package/dist/panel-brand-mark.d.cts +13 -0
- package/dist/panel-brand-mark.d.ts +13 -0
- package/dist/panel-brand-mark.js +8 -0
- package/dist/panel-brand-mark.js.map +1 -0
- package/dist/panel-sign-in.cjs +256 -0
- package/dist/panel-sign-in.cjs.map +1 -0
- package/dist/panel-sign-in.d.cts +31 -0
- package/dist/panel-sign-in.d.ts +31 -0
- package/dist/panel-sign-in.js +14 -0
- package/dist/panel-sign-in.js.map +1 -0
- package/dist/segmented-control.cjs +126 -0
- package/dist/segmented-control.cjs.map +1 -0
- package/dist/segmented-control.d.cts +60 -0
- package/dist/segmented-control.d.ts +60 -0
- package/dist/segmented-control.js +9 -0
- package/dist/segmented-control.js.map +1 -0
- package/dist/select.cjs +648 -0
- package/dist/select.cjs.map +1 -0
- package/dist/select.d.cts +30 -0
- package/dist/select.d.ts +30 -0
- package/dist/select.js +12 -0
- package/dist/select.js.map +1 -0
- package/dist/separator.cjs +70 -0
- package/dist/separator.cjs.map +1 -0
- package/dist/separator.d.cts +13 -0
- package/dist/separator.d.ts +13 -0
- package/dist/separator.js +9 -0
- package/dist/separator.js.map +1 -0
- package/dist/side-drawer.cjs +321 -0
- package/dist/side-drawer.cjs.map +1 -0
- package/dist/side-drawer.d.cts +21 -0
- package/dist/side-drawer.d.ts +21 -0
- package/dist/side-drawer.js +13 -0
- package/dist/side-drawer.js.map +1 -0
- package/dist/spinner.cjs +57 -0
- package/dist/spinner.cjs.map +1 -0
- package/{src/spinner.tsx → dist/spinner.d.cts} +11 -22
- package/dist/spinner.d.ts +27 -0
- package/dist/spinner.js +8 -0
- package/dist/spinner.js.map +1 -0
- package/dist/spreadsheet-grid.cjs +238 -0
- package/dist/spreadsheet-grid.cjs.map +1 -0
- package/dist/spreadsheet-grid.d.cts +48 -0
- package/dist/spreadsheet-grid.d.ts +48 -0
- package/dist/spreadsheet-grid.js +8 -0
- package/dist/spreadsheet-grid.js.map +1 -0
- package/dist/state-panel.cjs +86 -0
- package/dist/state-panel.cjs.map +1 -0
- package/dist/state-panel.d.cts +23 -0
- package/dist/state-panel.d.ts +23 -0
- package/dist/state-panel.js +9 -0
- package/dist/state-panel.js.map +1 -0
- package/dist/switch.cjs +87 -0
- package/dist/switch.cjs.map +1 -0
- package/dist/switch.d.cts +13 -0
- package/dist/switch.d.ts +13 -0
- package/dist/switch.js +9 -0
- package/dist/switch.js.map +1 -0
- package/dist/table.cjs +139 -0
- package/dist/table.cjs.map +1 -0
- package/dist/table.d.cts +16 -0
- package/dist/table.d.ts +16 -0
- package/dist/table.js +22 -0
- package/dist/table.js.map +1 -0
- package/dist/tabs.cjs +168 -0
- package/dist/tabs.cjs.map +1 -0
- package/dist/tabs.d.cts +59 -0
- package/dist/tabs.d.ts +59 -0
- package/dist/tabs.js +11 -0
- package/dist/tabs.js.map +1 -0
- package/dist/textarea.cjs +66 -0
- package/dist/textarea.cjs.map +1 -0
- package/dist/textarea.d.cts +18 -0
- package/dist/textarea.d.ts +18 -0
- package/dist/textarea.js +10 -0
- package/dist/textarea.js.map +1 -0
- package/dist/utils.cjs +35 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +5 -0
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +7 -0
- package/dist/utils.js.map +1 -0
- package/package.json +395 -19
- package/src/alert.tsx +0 -74
- package/src/autocomplete.tsx +0 -666
- package/src/badge.tsx +0 -60
- package/src/breadcrumb.tsx +0 -71
- package/src/button.tsx +0 -113
- package/src/card.tsx +0 -79
- package/src/clipboard.ts +0 -144
- package/src/collapsible.tsx +0 -63
- package/src/confirm-dialog.tsx +0 -84
- package/src/copy-button.tsx +0 -58
- package/src/data-table.tsx +0 -190
- package/src/date-range-picker/dateRange.ts +0 -142
- package/src/date-range-picker/index.tsx +0 -366
- package/src/dialogLayer.ts +0 -142
- package/src/feature-access-gate.tsx +0 -38
- package/src/field.tsx +0 -56
- package/src/image-uploader.tsx +0 -181
- package/src/index.ts +0 -37
- package/src/input.tsx +0 -16
- package/src/label.tsx +0 -23
- package/src/modal.tsx +0 -117
- package/src/page-header.tsx +0 -75
- package/src/pagination.tsx +0 -116
- package/src/panel-brand-mark.tsx +0 -32
- package/src/panel-sign-in.tsx +0 -134
- package/src/segmented-control.tsx +0 -155
- package/src/select.tsx +0 -105
- package/src/separator.tsx +0 -32
- package/src/side-drawer.tsx +0 -87
- package/src/spreadsheet-grid.tsx +0 -264
- package/src/state-panel.tsx +0 -46
- package/src/switch.tsx +0 -46
- package/src/table.tsx +0 -110
- package/src/tabs.tsx +0 -201
- package/src/textarea.tsx +0 -32
- package/src/utils.ts +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/collapsible.tsx
|
|
33
|
+
var collapsible_exports = {};
|
|
34
|
+
__export(collapsible_exports, {
|
|
35
|
+
CollapsibleSection: () => CollapsibleSection
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(collapsible_exports);
|
|
38
|
+
var import_lucide_react = require("lucide-react");
|
|
39
|
+
var React = __toESM(require("react"), 1);
|
|
40
|
+
|
|
41
|
+
// src/utils.ts
|
|
42
|
+
var import_clsx = require("clsx");
|
|
43
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
44
|
+
function cn(...inputs) {
|
|
45
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// src/collapsible.tsx
|
|
49
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
50
|
+
function CollapsibleSection({
|
|
51
|
+
title,
|
|
52
|
+
icon,
|
|
53
|
+
defaultOpen = true,
|
|
54
|
+
right,
|
|
55
|
+
className,
|
|
56
|
+
children
|
|
57
|
+
}) {
|
|
58
|
+
const [open, setOpen] = React.useState(defaultOpen);
|
|
59
|
+
const bodyId = React.useId();
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cn("border-border rounded-lg border", className), children: [
|
|
61
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
type: "button",
|
|
65
|
+
"aria-expanded": open,
|
|
66
|
+
"aria-controls": bodyId,
|
|
67
|
+
onClick: () => setOpen((current) => !current),
|
|
68
|
+
className: "hover:bg-muted/50 flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm font-semibold transition",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
import_lucide_react.ChevronDown,
|
|
72
|
+
{
|
|
73
|
+
size: 14,
|
|
74
|
+
"aria-hidden": true,
|
|
75
|
+
className: cn(
|
|
76
|
+
"shrink-0 transition-transform",
|
|
77
|
+
open ? "" : "-rotate-90"
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
icon,
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "flex-1", children: title }),
|
|
83
|
+
right
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: bodyId, hidden: !open, className: "space-y-3 px-3 pt-1 pb-3", children })
|
|
88
|
+
] });
|
|
89
|
+
}
|
|
90
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
91
|
+
0 && (module.exports = {
|
|
92
|
+
CollapsibleSection
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=collapsible.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/collapsible.tsx","../src/utils.ts"],"sourcesContent":["\"use client\";\n\nimport { ChevronDown } from \"lucide-react\";\nimport * as React from \"react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * A titled section that folds away.\n *\n * For sidebar panels that are long but not always in use — the body stays\n * mounted so its state (a loaded list, a half-filled filter) survives being\n * collapsed, rather than being thrown away and refetched on the way back.\n */\nexport function CollapsibleSection({\n title,\n icon,\n defaultOpen = true,\n right,\n className,\n children,\n}: {\n title: string;\n /** Optional leading glyph, shown between the chevron and the title. */\n icon?: React.ReactNode;\n defaultOpen?: boolean;\n /** Optional trailing content in the header, e.g. a count. */\n right?: React.ReactNode;\n className?: string;\n children: React.ReactNode;\n}) {\n const [open, setOpen] = React.useState(defaultOpen);\n const bodyId = React.useId();\n\n return (\n <div className={cn(\"border-border rounded-lg border\", className)}>\n <button\n type=\"button\"\n aria-expanded={open}\n aria-controls={bodyId}\n onClick={() => setOpen((current) => !current)}\n className=\"hover:bg-muted/50 flex w-full items-center gap-2 rounded-lg px-3 py-2 text-left text-sm font-semibold transition\"\n >\n <ChevronDown\n size={14}\n aria-hidden\n className={cn(\n \"shrink-0 transition-transform\",\n open ? \"\" : \"-rotate-90\",\n )}\n />\n {icon}\n <span className=\"flex-1\">{title}</span>\n {right}\n </button>\n {/* Hidden rather than unmounted, so collapsing does not discard the\n panel's state or refetch what it had already loaded. */}\n <div id={bodyId} hidden={!open} className=\"space-y-3 px-3 pt-1 pb-3\">\n {children}\n </div>\n </div>\n );\n}\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAA4B;AAC5B,YAAuB;;;ACHvB,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD+BM;AAtBC,SAAS,mBAAmB;AAAA,EACjC;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA,EACA;AACF,GASG;AACD,QAAM,CAAC,MAAM,OAAO,IAAU,eAAS,WAAW;AAClD,QAAM,SAAe,YAAM;AAE3B,SACE,6CAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAC7D;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,iBAAe;AAAA,QACf,iBAAe;AAAA,QACf,SAAS,MAAM,QAAQ,CAAC,YAAY,CAAC,OAAO;AAAA,QAC5C,WAAU;AAAA,QAEV;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,eAAW;AAAA,cACX,WAAW;AAAA,gBACT;AAAA,gBACA,OAAO,KAAK;AAAA,cACd;AAAA;AAAA,UACF;AAAA,UACC;AAAA,UACD,4CAAC,UAAK,WAAU,UAAU,iBAAM;AAAA,UAC/B;AAAA;AAAA;AAAA,IACH;AAAA,IAGA,4CAAC,SAAI,IAAI,QAAQ,QAAQ,CAAC,MAAM,WAAU,4BACvC,UACH;AAAA,KACF;AAEJ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A titled section that folds away.
|
|
5
|
+
*
|
|
6
|
+
* For sidebar panels that are long but not always in use — the body stays
|
|
7
|
+
* mounted so its state (a loaded list, a half-filled filter) survives being
|
|
8
|
+
* collapsed, rather than being thrown away and refetched on the way back.
|
|
9
|
+
*/
|
|
10
|
+
declare function CollapsibleSection({ title, icon, defaultOpen, right, className, children, }: {
|
|
11
|
+
title: string;
|
|
12
|
+
/** Optional leading glyph, shown between the chevron and the title. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
/** Optional trailing content in the header, e.g. a count. */
|
|
16
|
+
right?: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { CollapsibleSection };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A titled section that folds away.
|
|
5
|
+
*
|
|
6
|
+
* For sidebar panels that are long but not always in use — the body stays
|
|
7
|
+
* mounted so its state (a loaded list, a half-filled filter) survives being
|
|
8
|
+
* collapsed, rather than being thrown away and refetched on the way back.
|
|
9
|
+
*/
|
|
10
|
+
declare function CollapsibleSection({ title, icon, defaultOpen, right, className, children, }: {
|
|
11
|
+
title: string;
|
|
12
|
+
/** Optional leading glyph, shown between the chevron and the title. */
|
|
13
|
+
icon?: React.ReactNode;
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
/** Optional trailing content in the header, e.g. a count. */
|
|
16
|
+
right?: React.ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
|
|
21
|
+
export { CollapsibleSection };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
"use client";
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all)
|
|
12
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
+
};
|
|
14
|
+
var __copyProps = (to, from, except, desc) => {
|
|
15
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
+
for (let key of __getOwnPropNames(from))
|
|
17
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
23
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
24
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
25
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
26
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
27
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
28
|
+
mod
|
|
29
|
+
));
|
|
30
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
31
|
+
|
|
32
|
+
// src/confirm-dialog.tsx
|
|
33
|
+
var confirm_dialog_exports = {};
|
|
34
|
+
__export(confirm_dialog_exports, {
|
|
35
|
+
ConfirmDialog: () => ConfirmDialog
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(confirm_dialog_exports);
|
|
38
|
+
var React4 = __toESM(require("react"), 1);
|
|
39
|
+
|
|
40
|
+
// src/button.tsx
|
|
41
|
+
var React = __toESM(require("react"), 1);
|
|
42
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
43
|
+
var import_react_slot = require("@radix-ui/react-slot");
|
|
44
|
+
|
|
45
|
+
// src/spinner.tsx
|
|
46
|
+
var import_lucide_react = require("lucide-react");
|
|
47
|
+
|
|
48
|
+
// src/utils.ts
|
|
49
|
+
var import_clsx = require("clsx");
|
|
50
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
51
|
+
function cn(...inputs) {
|
|
52
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/spinner.tsx
|
|
56
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
57
|
+
var SIZES = {
|
|
58
|
+
sm: "size-3.5",
|
|
59
|
+
md: "size-4",
|
|
60
|
+
lg: "size-5",
|
|
61
|
+
xl: "size-10 border-2"
|
|
62
|
+
};
|
|
63
|
+
function Spinner({ size = "md", className, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
65
|
+
import_lucide_react.Loader2,
|
|
66
|
+
{
|
|
67
|
+
"aria-hidden": true,
|
|
68
|
+
className: cn("animate-spin", SIZES[size], className),
|
|
69
|
+
...props
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/button.tsx
|
|
75
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
76
|
+
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
77
|
+
"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
78
|
+
{
|
|
79
|
+
variants: {
|
|
80
|
+
variant: {
|
|
81
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
82
|
+
secondary: "bg-muted text-foreground hover:bg-muted/80",
|
|
83
|
+
ghost: "hover:bg-muted",
|
|
84
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
85
|
+
outline: "border border-border bg-background hover:bg-muted"
|
|
86
|
+
},
|
|
87
|
+
size: {
|
|
88
|
+
sm: "h-8 px-2.5",
|
|
89
|
+
md: "h-9 px-3",
|
|
90
|
+
lg: "h-10 px-4",
|
|
91
|
+
icon: "h-9 w-9 px-0",
|
|
92
|
+
// Square, matching `sm`'s height — for an icon-only control sitting in
|
|
93
|
+
// a table row or beside `sm` buttons, where `icon` is a row taller.
|
|
94
|
+
"icon-sm": "h-8 w-8 px-0"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
defaultVariants: {
|
|
98
|
+
variant: "default",
|
|
99
|
+
size: "md"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
var ICON_SIZES = /* @__PURE__ */ new Set(["icon", "icon-sm"]);
|
|
104
|
+
var Button = React.forwardRef(
|
|
105
|
+
({
|
|
106
|
+
className,
|
|
107
|
+
variant,
|
|
108
|
+
size,
|
|
109
|
+
asChild = false,
|
|
110
|
+
loading,
|
|
111
|
+
disabled,
|
|
112
|
+
children,
|
|
113
|
+
...props
|
|
114
|
+
}, ref) => {
|
|
115
|
+
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
116
|
+
if (asChild) {
|
|
117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
118
|
+
Comp,
|
|
119
|
+
{
|
|
120
|
+
ref,
|
|
121
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
122
|
+
...props,
|
|
123
|
+
children
|
|
124
|
+
}
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
ref,
|
|
131
|
+
disabled: disabled || loading,
|
|
132
|
+
"aria-busy": loading || void 0,
|
|
133
|
+
className: cn(buttonVariants({ variant, size }), className),
|
|
134
|
+
...props,
|
|
135
|
+
children: [
|
|
136
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Spinner, { size: "sm" }) : null,
|
|
137
|
+
loading && size != null && ICON_SIZES.has(size) ? null : children
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
Button.displayName = "Button";
|
|
144
|
+
|
|
145
|
+
// src/modal.tsx
|
|
146
|
+
var React3 = __toESM(require("react"), 1);
|
|
147
|
+
var import_react_dom = require("react-dom");
|
|
148
|
+
|
|
149
|
+
// src/dialogLayer.ts
|
|
150
|
+
var React2 = __toESM(require("react"), 1);
|
|
151
|
+
var layers = [];
|
|
152
|
+
var FOCUSABLE = [
|
|
153
|
+
"a[href]",
|
|
154
|
+
"button:not([disabled])",
|
|
155
|
+
"input:not([disabled])",
|
|
156
|
+
"select:not([disabled])",
|
|
157
|
+
"textarea:not([disabled])",
|
|
158
|
+
'[tabindex]:not([tabindex="-1"])'
|
|
159
|
+
].join(",");
|
|
160
|
+
function isVisible(element) {
|
|
161
|
+
if (element.closest("[hidden]")) return false;
|
|
162
|
+
if (element.getAttribute("aria-hidden") === "true") return false;
|
|
163
|
+
return typeof element.checkVisibility === "function" ? element.checkVisibility() : true;
|
|
164
|
+
}
|
|
165
|
+
function focusableWithin(container) {
|
|
166
|
+
return Array.from(container.querySelectorAll(FOCUSABLE)).filter(
|
|
167
|
+
isVisible
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
function useDialogLayer({
|
|
171
|
+
active,
|
|
172
|
+
containerRef,
|
|
173
|
+
onEscape
|
|
174
|
+
}) {
|
|
175
|
+
const escapeRef = React2.useRef(onEscape);
|
|
176
|
+
React2.useEffect(() => {
|
|
177
|
+
escapeRef.current = onEscape;
|
|
178
|
+
});
|
|
179
|
+
React2.useEffect(() => {
|
|
180
|
+
if (!active) return;
|
|
181
|
+
const layer = /* @__PURE__ */ Symbol("dialog-layer");
|
|
182
|
+
layers.push(layer);
|
|
183
|
+
const isTopLayer = () => layers[layers.length - 1] === layer;
|
|
184
|
+
const previouslyFocused = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
185
|
+
const container = containerRef.current;
|
|
186
|
+
if (container && !container.contains(document.activeElement)) {
|
|
187
|
+
const [first] = focusableWithin(container);
|
|
188
|
+
(container.hasAttribute("tabindex") ? container : first)?.focus();
|
|
189
|
+
}
|
|
190
|
+
function handleKeyDown(event) {
|
|
191
|
+
if (!isTopLayer()) return;
|
|
192
|
+
if (event.key === "Escape") {
|
|
193
|
+
escapeRef.current?.();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (event.key !== "Tab") return;
|
|
197
|
+
const panel = containerRef.current;
|
|
198
|
+
if (!panel) return;
|
|
199
|
+
const items = focusableWithin(panel);
|
|
200
|
+
if (items.length === 0) {
|
|
201
|
+
event.preventDefault();
|
|
202
|
+
panel.focus();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const first = items[0];
|
|
206
|
+
const last = items[items.length - 1];
|
|
207
|
+
const active2 = document.activeElement;
|
|
208
|
+
const outside = !panel.contains(active2);
|
|
209
|
+
if (event.shiftKey && (active2 === first || outside)) {
|
|
210
|
+
event.preventDefault();
|
|
211
|
+
last.focus();
|
|
212
|
+
} else if (!event.shiftKey && (active2 === last || outside)) {
|
|
213
|
+
event.preventDefault();
|
|
214
|
+
first.focus();
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
218
|
+
const previousOverflow = document.body.style.overflow;
|
|
219
|
+
document.body.style.overflow = "hidden";
|
|
220
|
+
return () => {
|
|
221
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
222
|
+
document.body.style.overflow = previousOverflow;
|
|
223
|
+
const index = layers.indexOf(layer);
|
|
224
|
+
if (index !== -1) layers.splice(index, 1);
|
|
225
|
+
if (previouslyFocused?.isConnected) previouslyFocused.focus();
|
|
226
|
+
};
|
|
227
|
+
}, [active, containerRef]);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/modal.tsx
|
|
231
|
+
var import_jsx_runtime3 = (
|
|
232
|
+
/*
|
|
233
|
+
`overflow-y-auto` on the overlay, `my-auto` on the panel — not
|
|
234
|
+
`items-center`. A flex item centred with `align-items` overflows equally
|
|
235
|
+
in both directions once it is taller than its container, and the half
|
|
236
|
+
above the top edge cannot be scrolled to: with the page behind it locked,
|
|
237
|
+
an over-tall dialog was simply unreachable at both ends. Auto margins
|
|
238
|
+
centre a short panel the same way and collapse to zero on a tall one,
|
|
239
|
+
which scrolls.
|
|
240
|
+
*/
|
|
241
|
+
require("react/jsx-runtime")
|
|
242
|
+
);
|
|
243
|
+
var emptySubscribe = () => () => {
|
|
244
|
+
};
|
|
245
|
+
function useHasMounted() {
|
|
246
|
+
return React3.useSyncExternalStore(
|
|
247
|
+
emptySubscribe,
|
|
248
|
+
() => true,
|
|
249
|
+
() => false
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
function Modal({
|
|
253
|
+
isOpen,
|
|
254
|
+
labelledBy,
|
|
255
|
+
describedBy,
|
|
256
|
+
closeLabel,
|
|
257
|
+
onClose,
|
|
258
|
+
children,
|
|
259
|
+
dismissible = true,
|
|
260
|
+
role = "dialog",
|
|
261
|
+
panelClassName
|
|
262
|
+
}) {
|
|
263
|
+
const mounted = useHasMounted();
|
|
264
|
+
const panelRef = React3.useRef(null);
|
|
265
|
+
useDialogLayer({
|
|
266
|
+
// Gated on `mounted` too: before that the panel is not rendered, so there
|
|
267
|
+
// would be nothing to move focus into.
|
|
268
|
+
active: isOpen && mounted,
|
|
269
|
+
containerRef: panelRef,
|
|
270
|
+
onEscape: dismissible ? onClose : void 0
|
|
271
|
+
});
|
|
272
|
+
if (!mounted || !isOpen) return null;
|
|
273
|
+
return (0, import_react_dom.createPortal)(
|
|
274
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fixed inset-0 z-[100] flex justify-center overflow-y-auto p-4", children: [
|
|
275
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
276
|
+
"button",
|
|
277
|
+
{
|
|
278
|
+
type: "button",
|
|
279
|
+
"aria-label": closeLabel,
|
|
280
|
+
tabIndex: -1,
|
|
281
|
+
className: "fixed inset-0 bg-slate-950/50",
|
|
282
|
+
onClick: () => {
|
|
283
|
+
if (dismissible) onClose();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
),
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
ref: panelRef,
|
|
291
|
+
role,
|
|
292
|
+
"aria-modal": "true",
|
|
293
|
+
"aria-labelledby": labelledBy,
|
|
294
|
+
"aria-describedby": describedBy,
|
|
295
|
+
tabIndex: -1,
|
|
296
|
+
className: cn(
|
|
297
|
+
"border-border bg-background relative z-10 my-auto w-full rounded-lg border shadow-2xl outline-none",
|
|
298
|
+
panelClassName ?? "max-w-md p-6"
|
|
299
|
+
),
|
|
300
|
+
children
|
|
301
|
+
}
|
|
302
|
+
)
|
|
303
|
+
] }),
|
|
304
|
+
document.body
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
// src/confirm-dialog.tsx
|
|
309
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
310
|
+
function ConfirmDialog({
|
|
311
|
+
isOpen,
|
|
312
|
+
title,
|
|
313
|
+
description,
|
|
314
|
+
confirmLabel = "Delete",
|
|
315
|
+
cancelLabel = "Cancel",
|
|
316
|
+
isConfirming,
|
|
317
|
+
error,
|
|
318
|
+
onConfirm,
|
|
319
|
+
onClose
|
|
320
|
+
}) {
|
|
321
|
+
const titleId = React4.useId();
|
|
322
|
+
const descriptionId = React4.useId();
|
|
323
|
+
const errorId = React4.useId();
|
|
324
|
+
const describedBy = [
|
|
325
|
+
description ? descriptionId : null,
|
|
326
|
+
error ? errorId : null
|
|
327
|
+
].filter(Boolean).join(" ");
|
|
328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
329
|
+
Modal,
|
|
330
|
+
{
|
|
331
|
+
isOpen,
|
|
332
|
+
role: "alertdialog",
|
|
333
|
+
labelledBy: titleId,
|
|
334
|
+
describedBy: describedBy || void 0,
|
|
335
|
+
closeLabel: "Close dialog",
|
|
336
|
+
onClose,
|
|
337
|
+
children: [
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h3", { id: titleId, className: "text-lg font-semibold", children: title }),
|
|
339
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { id: descriptionId, className: "text-muted-foreground mt-2 text-sm", children: description }) : null,
|
|
340
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
341
|
+
"div",
|
|
342
|
+
{
|
|
343
|
+
id: errorId,
|
|
344
|
+
role: "alert",
|
|
345
|
+
className: "border-destructive/30 bg-destructive/5 text-destructive mt-4 rounded-lg border px-3 py-2 text-sm",
|
|
346
|
+
children: error
|
|
347
|
+
}
|
|
348
|
+
) : null,
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "mt-6 flex justify-end gap-2", children: [
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Button, { variant: "outline", onClick: onClose, disabled: isConfirming, children: cancelLabel }),
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
352
|
+
Button,
|
|
353
|
+
{
|
|
354
|
+
variant: "destructive",
|
|
355
|
+
onClick: onConfirm,
|
|
356
|
+
loading: isConfirming,
|
|
357
|
+
children: confirmLabel
|
|
358
|
+
}
|
|
359
|
+
)
|
|
360
|
+
] })
|
|
361
|
+
]
|
|
362
|
+
}
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
366
|
+
0 && (module.exports = {
|
|
367
|
+
ConfirmDialog
|
|
368
|
+
});
|
|
369
|
+
//# sourceMappingURL=confirm-dialog.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/confirm-dialog.tsx","../src/button.tsx","../src/spinner.tsx","../src/utils.ts","../src/modal.tsx","../src/dialogLayer.ts"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\n\nimport { Button } from \"./button\";\nimport { Modal } from \"./modal\";\n\ninterface ConfirmDialogProps {\n isOpen: boolean;\n title: string;\n description?: React.ReactNode;\n confirmLabel?: string;\n cancelLabel?: string;\n isConfirming?: boolean;\n error?: string | null;\n onConfirm: () => void;\n onClose: () => void;\n}\n\nexport function ConfirmDialog({\n isOpen,\n title,\n description,\n confirmLabel = \"Delete\",\n cancelLabel = \"Cancel\",\n isConfirming,\n error,\n onConfirm,\n onClose,\n}: ConfirmDialogProps) {\n const titleId = React.useId();\n const descriptionId = React.useId();\n const errorId = React.useId();\n\n const describedBy = [\n description ? descriptionId : null,\n error ? errorId : null,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return (\n <Modal\n isOpen={isOpen}\n role=\"alertdialog\"\n labelledBy={titleId}\n describedBy={describedBy || undefined}\n closeLabel=\"Close dialog\"\n onClose={onClose}\n >\n <h3 id={titleId} className=\"text-lg font-semibold\">\n {title}\n </h3>\n {description ? (\n <div id={descriptionId} className=\"text-muted-foreground mt-2 text-sm\">\n {description}\n </div>\n ) : null}\n\n {error ? (\n <div\n id={errorId}\n role=\"alert\"\n className=\"border-destructive/30 bg-destructive/5 text-destructive mt-4 rounded-lg border px-3 py-2 text-sm\"\n >\n {error}\n </div>\n ) : null}\n\n <div className=\"mt-6 flex justify-end gap-2\">\n <Button variant=\"outline\" onClick={onClose} disabled={isConfirming}>\n {cancelLabel}\n </Button>\n <Button\n variant=\"destructive\"\n onClick={onConfirm}\n loading={isConfirming}\n >\n {confirmLabel}\n </Button>\n </div>\n </Modal>\n );\n}\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nimport { Spinner } from \"./spinner\";\nimport { cn } from \"./utils\";\n\nconst buttonVariants = cva(\n \"inline-flex h-9 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md px-3 text-sm font-medium transition duration-200 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n secondary: \"bg-muted text-foreground hover:bg-muted/80\",\n ghost: \"hover:bg-muted\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline: \"border border-border bg-background hover:bg-muted\",\n },\n size: {\n sm: \"h-8 px-2.5\",\n md: \"h-9 px-3\",\n lg: \"h-10 px-4\",\n icon: \"h-9 w-9 px-0\",\n // Square, matching `sm`'s height — for an icon-only control sitting in\n // a table row or beside `sm` buttons, where `icon` is a row taller.\n \"icon-sm\": \"h-8 w-8 px-0\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"md\",\n },\n },\n);\n\nexport interface ButtonProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n /**\n * Work is in flight: shows a spinner, disables the button, and sets\n * `aria-busy`.\n *\n * This exists because the panel had 272 disabled buttons and only 22 that\n * said anything about why — the rest went dead on click with no spinner and\n * no label change, which reads as a broken button rather than a busy one.\n * Making the feedback part of `disabled` rather than something each caller\n * remembers separately is the only way that ratio stays fixed.\n *\n * The label is kept rather than swapped. \"Saving…\" loses which button you\n * pressed, and the spinner already says it is working. An icon-only button\n * is the exception — there is no room beside the glyph, so the spinner takes\n * its place; the `aria-label` is what names the button either way.\n *\n * \"Icon-only\" means an icon `size`. A square button that grew a spinner\n * beside its glyph would not just look wrong, it would resize mid-request\n * and shove whatever sits next to it sideways.\n */\n loading?: boolean;\n}\n\n/** Sizes with no room for a spinner beside the glyph. */\nconst ICON_SIZES = new Set<string>([\"icon\", \"icon-sm\"]);\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n className,\n variant,\n size,\n asChild = false,\n loading,\n disabled,\n children,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : \"button\";\n\n // `asChild` renders someone else's element, which may not take a spinner or\n // a disabled attribute — so the busy treatment is only applied to a real\n // button, and passing both is a mistake worth not papering over.\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <button\n ref={ref}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n >\n {loading ? <Spinner size=\"sm\" /> : null}\n {loading && size != null && ICON_SIZES.has(size) ? null : children}\n </button>\n );\n },\n);\n\nButton.displayName = \"Button\";\n","import * as React from \"react\";\nimport { Loader2 } from \"lucide-react\";\n\nimport { cn } from \"./utils\";\n\n/**\n * The one spinner.\n *\n * There were five spellings of `animate-spin` across twelve files — `h-4 w-4`,\n * `h-5 w-5`, `size-4`, bare, and a hand-drawn ring in `ProtectedRoute` — so the\n * same \"working\" signal came out a different size depending on which panel you\n * were on.\n *\n * It is `aria-hidden` on purpose. A spinner is decoration; what a screen reader\n * needs is the surrounding control's `aria-busy` or the panel's status text,\n * and announcing \"loading\" twice is worse than once. `Button` and `StatePanel`\n * both supply that.\n */\nconst SIZES = {\n sm: \"size-3.5\",\n md: \"size-4\",\n lg: \"size-5\",\n xl: \"size-10 border-2\",\n} as const;\n\nexport interface SpinnerProps extends React.SVGProps<SVGSVGElement> {\n size?: keyof typeof SIZES;\n}\n\nexport function Spinner({ size = \"md\", className, ...props }: SpinnerProps) {\n return (\n <Loader2\n aria-hidden\n className={cn(\"animate-spin\", SIZES[size], className)}\n {...props}\n />\n );\n}\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","\"use client\";\n\nimport * as React from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { useDialogLayer } from \"./dialogLayer\";\nimport { cn } from \"./utils\";\n\nconst emptySubscribe = () => () => {};\n\n/**\n * Returns false during SSR and the first client render, then true once mounted.\n * `useSyncExternalStore` is the React-recommended way to read client-only state\n * without a setState-in-effect (which triggers cascading renders).\n */\nexport function useHasMounted(): boolean {\n return React.useSyncExternalStore(\n emptySubscribe,\n () => true,\n () => false,\n );\n}\n\ninterface ModalProps {\n isOpen: boolean;\n /** id of the element labelling the dialog; wired to aria-labelledby. */\n labelledBy: string;\n /**\n * Optional id(s) of elements describing the dialog (APG alertdialog body).\n * Space-separated when multiple.\n */\n describedBy?: string;\n /** Accessible label for the backdrop dismiss button. */\n closeLabel: string;\n onClose: () => void;\n children: React.ReactNode;\n /**\n * When false, Escape and backdrop clicks do not close the modal (e.g. while a\n * save is in flight). Defaults to true.\n */\n dismissible?: boolean;\n /** Use \"alertdialog\" for destructive confirmations. Defaults to \"dialog\". */\n role?: \"dialog\" | \"alertdialog\";\n /** Tailwind max-width class for the panel. Defaults to \"max-w-md\". */\n panelClassName?: string;\n}\n\n/**\n * Shared modal shell: renders a portal-backed, scroll-locked, Escape-dismissible\n * overlay with a centered panel. Callers provide the panel body (heading, form,\n * footer). Consolidates the boilerplate previously copied across every dialog.\n */\nexport function Modal({\n isOpen,\n labelledBy,\n describedBy,\n closeLabel,\n onClose,\n children,\n dismissible = true,\n role = \"dialog\",\n panelClassName,\n}: ModalProps) {\n const mounted = useHasMounted();\n const panelRef = React.useRef<HTMLDivElement>(null);\n\n useDialogLayer({\n // Gated on `mounted` too: before that the panel is not rendered, so there\n // would be nothing to move focus into.\n active: isOpen && mounted,\n containerRef: panelRef,\n onEscape: dismissible ? onClose : undefined,\n });\n\n if (!mounted || !isOpen) return null;\n\n return createPortal(\n /*\n `overflow-y-auto` on the overlay, `my-auto` on the panel — not\n `items-center`. A flex item centred with `align-items` overflows equally\n in both directions once it is taller than its container, and the half\n above the top edge cannot be scrolled to: with the page behind it locked,\n an over-tall dialog was simply unreachable at both ends. Auto margins\n centre a short panel the same way and collapse to zero on a tall one,\n which scrolls.\n */\n <div className=\"fixed inset-0 z-[100] flex justify-center overflow-y-auto p-4\">\n {/* `fixed`, not `absolute`: inside a scrolling overlay an absolute\n backdrop scrolls away with the content and leaves the rest of a tall\n dialog sitting on an undimmed page. */}\n <button\n type=\"button\"\n aria-label={closeLabel}\n tabIndex={-1}\n className=\"fixed inset-0 bg-slate-950/50\"\n onClick={() => {\n if (dismissible) onClose();\n }}\n />\n <div\n ref={panelRef}\n role={role}\n aria-modal=\"true\"\n aria-labelledby={labelledBy}\n aria-describedby={describedBy}\n tabIndex={-1}\n className={cn(\n \"border-border bg-background relative z-10 my-auto w-full rounded-lg border shadow-2xl outline-none\",\n panelClassName ?? \"max-w-md p-6\",\n )}\n >\n {children}\n </div>\n </div>,\n document.body,\n );\n}\n","\"use client\";\n\nimport * as React from \"react\";\n\n/**\n * The keyboard and focus behaviour every dialog needs, in one place.\n *\n * `Modal` and `SideDrawer` each had a copy of the scroll lock and an Escape\n * handler, and neither did anything about focus: opening a dialog left focus\n * on the button behind it, Tab walked the page underneath — through the\n * full-screen backdrop button, among other things — and closing left focus\n * wherever it had wandered. That is the whole keyboard story for thirty\n * dialogs, so it is fixed once here rather than thirty times.\n */\n\n/**\n * Open dialogs, innermost last.\n *\n * Nesting is real here — \"Create audience group\" opens on top of \"Send\n * notification\" — and without an ordering both would answer the same Escape\n * and fight over the same Tab. Only the top layer acts.\n */\nconst layers: symbol[] = [];\n\nconst FOCUSABLE = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\n/**\n * Deliberately not `offsetParent` or `getClientRects`: the first is null for\n * anything `position: fixed`, which a dialog panel usually is, and the second\n * is empty for *everything* under a test renderer that does no layout — which\n * would collapse the trap to \"no focusable elements\" in every test.\n */\nfunction isVisible(element: HTMLElement): boolean {\n if (element.closest(\"[hidden]\")) return false;\n if (element.getAttribute(\"aria-hidden\") === \"true\") return false;\n return typeof element.checkVisibility === \"function\"\n ? element.checkVisibility()\n : true;\n}\n\nfunction focusableWithin(container: HTMLElement): HTMLElement[] {\n return Array.from(container.querySelectorAll<HTMLElement>(FOCUSABLE)).filter(\n isVisible,\n );\n}\n\nexport function useDialogLayer({\n active,\n containerRef,\n onEscape,\n}: {\n active: boolean;\n /** The panel. Focus is moved into it and kept inside it. */\n containerRef: React.RefObject<HTMLElement | null>;\n /** Called on Escape, only while this is the top layer. Omit to ignore it. */\n onEscape?: () => void;\n}): void {\n // Read through a ref so a caller passing a fresh closure every render does\n // not tear the listener down and rebuild it on every keystroke.\n const escapeRef = React.useRef(onEscape);\n React.useEffect(() => {\n escapeRef.current = onEscape;\n });\n\n React.useEffect(() => {\n if (!active) return;\n\n const layer = Symbol(\"dialog-layer\");\n layers.push(layer);\n const isTopLayer = () => layers[layers.length - 1] === layer;\n\n const previouslyFocused =\n document.activeElement instanceof HTMLElement\n ? document.activeElement\n : null;\n\n const container = containerRef.current;\n // Something inside may have claimed focus already — an `autoFocus` input —\n // and that choice is better than any this could make.\n if (container && !container.contains(document.activeElement)) {\n const [first] = focusableWithin(container);\n // The panel itself, not its first control: the first control is a Delete\n // button often enough that focusing it would put a destructive action\n // one Enter away from an accidental keypress.\n (container.hasAttribute(\"tabindex\") ? container : first)?.focus();\n }\n\n function handleKeyDown(event: KeyboardEvent) {\n if (!isTopLayer()) return;\n\n if (event.key === \"Escape\") {\n escapeRef.current?.();\n return;\n }\n\n if (event.key !== \"Tab\") return;\n const panel = containerRef.current;\n if (!panel) return;\n\n const items = focusableWithin(panel);\n if (items.length === 0) {\n event.preventDefault();\n panel.focus();\n return;\n }\n\n const first = items[0]!;\n const last = items[items.length - 1]!;\n const active = document.activeElement;\n const outside = !panel.contains(active);\n\n if (event.shiftKey && (active === first || outside)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && (active === last || outside)) {\n event.preventDefault();\n first.focus();\n }\n }\n\n document.addEventListener(\"keydown\", handleKeyDown);\n const previousOverflow = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n document.body.style.overflow = previousOverflow;\n const index = layers.indexOf(layer);\n if (index !== -1) layers.splice(index, 1);\n // Back where it came from, so closing a dialog opened by keyboard does\n // not drop the caret at the top of the document.\n if (previouslyFocused?.isConnected) previouslyFocused.focus();\n };\n }, [active, containerRef]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,SAAuB;;;ACFvB,YAAuB;AACvB,sCAAuC;AACvC,wBA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d;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,UAAgB,aAAM;AAC5B,QAAM,gBAAsB,aAAM;AAClC,QAAM,UAAgB,aAAM;AAE5B,QAAM,cAAc;AAAA,IAClB,cAAc,gBAAgB;AAAA,IAC9B,QAAQ,UAAU;AAAA,EACpB,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,MAAK;AAAA,MACL,YAAY;AAAA,MACZ,aAAa,eAAe;AAAA,MAC5B,YAAW;AAAA,MACX;AAAA,MAEA;AAAA,qDAAC,QAAG,IAAI,SAAS,WAAU,yBACxB,iBACH;AAAA,QACC,cACC,6CAAC,SAAI,IAAI,eAAe,WAAU,sCAC/B,uBACH,IACE;AAAA,QAEH,QACC;AAAA,UAAC;AAAA;AAAA,YACC,IAAI;AAAA,YACJ,MAAK;AAAA,YACL,WAAU;AAAA,YAET;AAAA;AAAA,QACH,IACE;AAAA,QAEJ,8CAAC,SAAI,WAAU,+BACb;AAAA,uDAAC,UAAO,SAAQ,WAAU,SAAS,SAAS,UAAU,cACnD,uBACH;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAQ;AAAA,cACR,SAAS;AAAA,cACT,SAAS;AAAA,cAER;AAAA;AAAA,UACH;AAAA,WACF;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["React","import_jsx_runtime","React","React","active","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConfirmDialogProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
isConfirming?: boolean;
|
|
10
|
+
error?: string | null;
|
|
11
|
+
onConfirm: () => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare function ConfirmDialog({ isOpen, title, description, confirmLabel, cancelLabel, isConfirming, error, onConfirm, onClose, }: ConfirmDialogProps): React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ConfirmDialog };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
interface ConfirmDialogProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
confirmLabel?: string;
|
|
8
|
+
cancelLabel?: string;
|
|
9
|
+
isConfirming?: boolean;
|
|
10
|
+
error?: string | null;
|
|
11
|
+
onConfirm: () => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare function ConfirmDialog({ isOpen, title, description, confirmLabel, cancelLabel, isConfirming, error, onConfirm, onClose, }: ConfirmDialogProps): React.JSX.Element;
|
|
15
|
+
|
|
16
|
+
export { ConfirmDialog };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ConfirmDialog
|
|
4
|
+
} from "./chunk-WVNRFO5F.js";
|
|
5
|
+
import "./chunk-YSU4VWRD.js";
|
|
6
|
+
import "./chunk-HBBOR43A.js";
|
|
7
|
+
import "./chunk-KR3BCFP7.js";
|
|
8
|
+
import "./chunk-UE7JY7VR.js";
|
|
9
|
+
import "./chunk-HCA5ODCD.js";
|
|
10
|
+
export {
|
|
11
|
+
ConfirmDialog
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=confirm-dialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|