@platned/ui 0.7.0 → 0.8.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/dist/index.cjs +1343 -974
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +287 -30
- package/dist/index.d.ts +287 -30
- package/dist/index.js +1637 -1261
- package/dist/index.js.map +1 -1
- package/dist/sidebar.cjs +73 -1
- package/dist/sidebar.cjs.map +1 -1
- package/dist/sidebar.js +87 -14
- package/dist/sidebar.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -91,6 +91,7 @@ __export(src_exports, {
|
|
|
91
91
|
ContextMenuContent: () => ContextMenuContent,
|
|
92
92
|
ContextMenuGroup: () => ContextMenuGroup,
|
|
93
93
|
ContextMenuItem: () => ContextMenuItem,
|
|
94
|
+
ContextMenuItems: () => ContextMenuItems,
|
|
94
95
|
ContextMenuLabel: () => ContextMenuLabel,
|
|
95
96
|
ContextMenuRadioGroup: () => ContextMenuRadioGroup,
|
|
96
97
|
ContextMenuRadioItem: () => ContextMenuRadioItem,
|
|
@@ -128,6 +129,7 @@ __export(src_exports, {
|
|
|
128
129
|
DropdownMenuContent: () => DropdownMenuContent,
|
|
129
130
|
DropdownMenuGroup: () => DropdownMenuGroup,
|
|
130
131
|
DropdownMenuItem: () => DropdownMenuItem,
|
|
132
|
+
DropdownMenuItems: () => DropdownMenuItems,
|
|
131
133
|
DropdownMenuLabel: () => DropdownMenuLabel,
|
|
132
134
|
DropdownMenuRadioGroup: () => DropdownMenuRadioGroup,
|
|
133
135
|
DropdownMenuRadioItem: () => DropdownMenuRadioItem,
|
|
@@ -186,6 +188,7 @@ __export(src_exports, {
|
|
|
186
188
|
MenubarContent: () => MenubarContent,
|
|
187
189
|
MenubarGroup: () => MenubarGroup,
|
|
188
190
|
MenubarItem: () => MenubarItem,
|
|
191
|
+
MenubarItems: () => MenubarItems,
|
|
189
192
|
MenubarLabel: () => MenubarLabel,
|
|
190
193
|
MenubarMenu: () => MenubarMenu,
|
|
191
194
|
MenubarRadioGroup: () => MenubarRadioGroup,
|
|
@@ -2162,25 +2165,382 @@ var Select = (0, import_react16.forwardRef)(function Select2({
|
|
|
2162
2165
|
});
|
|
2163
2166
|
|
|
2164
2167
|
// src/components/forms/date-picker.tsx
|
|
2168
|
+
var import_react19 = require("react");
|
|
2169
|
+
var import_clsx16 = __toESM(require("clsx"), 1);
|
|
2170
|
+
var import_lucide_react3 = require("lucide-react");
|
|
2171
|
+
|
|
2172
|
+
// src/components/overlays/popover.tsx
|
|
2165
2173
|
var import_react17 = require("react");
|
|
2174
|
+
var import_radix_ui = require("radix-ui");
|
|
2175
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2176
|
+
var PopoverTriggerNode = (0, import_react17.createContext)(null);
|
|
2177
|
+
function Popover({ children, open, defaultOpen, onOpenChange, modal = false }) {
|
|
2178
|
+
const [node, setNode] = (0, import_react17.useState)(null);
|
|
2179
|
+
const trigger = (0, import_react17.useMemo)(() => ({ node, setNode, modal }), [node, modal]);
|
|
2180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2181
|
+
import_radix_ui.Popover.Root,
|
|
2182
|
+
{
|
|
2183
|
+
open,
|
|
2184
|
+
defaultOpen,
|
|
2185
|
+
onOpenChange,
|
|
2186
|
+
modal,
|
|
2187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PopoverTriggerNode.Provider, { value: trigger, children })
|
|
2188
|
+
}
|
|
2189
|
+
);
|
|
2190
|
+
}
|
|
2191
|
+
var PopoverTrigger = (0, import_react17.forwardRef)(
|
|
2192
|
+
function PopoverTrigger2(props, ref) {
|
|
2193
|
+
const trigger = (0, import_react17.useContext)(PopoverTriggerNode);
|
|
2194
|
+
const fallbackId = (0, import_react17.useId)();
|
|
2195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2196
|
+
import_radix_ui.Popover.Trigger,
|
|
2197
|
+
{
|
|
2198
|
+
ref: composeRefs(ref, trigger?.setNode),
|
|
2199
|
+
id: props.id ?? fallbackId,
|
|
2200
|
+
...props
|
|
2201
|
+
}
|
|
2202
|
+
);
|
|
2203
|
+
}
|
|
2204
|
+
);
|
|
2205
|
+
var PopoverContent = (0, import_react17.forwardRef)(
|
|
2206
|
+
function PopoverContent2({ children, side = "bottom", align = "center", sideOffset = 8, label, container, className, onOpenAutoFocus, ...rest }, ref) {
|
|
2207
|
+
const trigger = (0, import_react17.useContext)(PopoverTriggerNode);
|
|
2208
|
+
const inherited = usePortalContainer();
|
|
2209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_radix_ui.Popover.Portal, { container: container ?? inherited ?? void 0, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2210
|
+
import_radix_ui.Popover.Content,
|
|
2211
|
+
{
|
|
2212
|
+
ref,
|
|
2213
|
+
side,
|
|
2214
|
+
align,
|
|
2215
|
+
sideOffset,
|
|
2216
|
+
collisionPadding: 8,
|
|
2217
|
+
onOpenAutoFocus,
|
|
2218
|
+
onEscapeKeyDown: (event) => void deferEscapeToInnerPopup(event),
|
|
2219
|
+
"aria-modal": trigger?.modal || void 0,
|
|
2220
|
+
"aria-label": label,
|
|
2221
|
+
"aria-labelledby": label ? void 0 : trigger?.node?.id || void 0,
|
|
2222
|
+
className: cn(
|
|
2223
|
+
"z-popover max-w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-default bg-default p-4 shadow-400",
|
|
2224
|
+
"focus:outline-none",
|
|
2225
|
+
className
|
|
2226
|
+
),
|
|
2227
|
+
...rest,
|
|
2228
|
+
children
|
|
2229
|
+
}
|
|
2230
|
+
) });
|
|
2231
|
+
}
|
|
2232
|
+
);
|
|
2233
|
+
var PopoverClose = (0, import_react17.forwardRef)(
|
|
2234
|
+
function PopoverClose2(props, ref) {
|
|
2235
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_radix_ui.Popover.Close, { ref, ...props });
|
|
2236
|
+
}
|
|
2237
|
+
);
|
|
2238
|
+
var PopoverAnchor = (0, import_react17.forwardRef)(
|
|
2239
|
+
function PopoverAnchor2(props, ref) {
|
|
2240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_radix_ui.Popover.Anchor, { ref, ...props });
|
|
2241
|
+
}
|
|
2242
|
+
);
|
|
2243
|
+
|
|
2244
|
+
// src/components/forms/calendar.tsx
|
|
2245
|
+
var import_react18 = require("react");
|
|
2166
2246
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
2167
2247
|
var import_lucide_react2 = require("lucide-react");
|
|
2168
|
-
var
|
|
2169
|
-
var
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2248
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2249
|
+
var CAPTION_SELECT = (0, import_clsx15.default)(
|
|
2250
|
+
"h-7 appearance-none rounded-md border border-default bg-default px-2 text-body-xs font-medium text-default",
|
|
2251
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default"
|
|
2252
|
+
);
|
|
2253
|
+
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
2254
|
+
var sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
2255
|
+
var addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
2256
|
+
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
2257
|
+
var isBefore = (a, b) => startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
2258
|
+
var isAfter = (a, b) => startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
2259
|
+
var inRange = (d, from, to) => startOfDay(d).getTime() > startOfDay(from).getTime() && startOfDay(d).getTime() < startOfDay(to).getTime();
|
|
2260
|
+
function monthGrid(month, weekStartsOn) {
|
|
2261
|
+
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
2262
|
+
const offset2 = (first.getDay() - weekStartsOn + 7) % 7;
|
|
2263
|
+
const start = addDays(first, -offset2);
|
|
2264
|
+
return Array.from({ length: 42 }, (_, i) => addDays(start, i));
|
|
2265
|
+
}
|
|
2266
|
+
function Calendar({
|
|
2267
|
+
mode = "single",
|
|
2268
|
+
value,
|
|
2269
|
+
range,
|
|
2270
|
+
onSelect,
|
|
2271
|
+
onRangeChange,
|
|
2272
|
+
defaultMonth,
|
|
2273
|
+
min,
|
|
2274
|
+
max,
|
|
2275
|
+
isDateDisabled,
|
|
2276
|
+
weekStartsOn = 1,
|
|
2277
|
+
locale,
|
|
2278
|
+
label = "Calendar",
|
|
2279
|
+
captionLayout = "label",
|
|
2280
|
+
startYear,
|
|
2281
|
+
endYear,
|
|
2282
|
+
className,
|
|
2283
|
+
...rest
|
|
2284
|
+
}) {
|
|
2285
|
+
const today = (0, import_react18.useMemo)(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
2286
|
+
const gridId = (0, import_react18.useId)();
|
|
2287
|
+
const [month, setMonth] = (0, import_react18.useState)(
|
|
2288
|
+
() => defaultMonth ?? value ?? range?.from ?? today
|
|
2289
|
+
);
|
|
2290
|
+
const [focusedDate, setFocusedDate] = (0, import_react18.useState)(
|
|
2291
|
+
() => value ?? range?.from ?? today
|
|
2292
|
+
);
|
|
2293
|
+
const cellRefs = (0, import_react18.useRef)(/* @__PURE__ */ new Map());
|
|
2294
|
+
const monthFormatter = (0, import_react18.useMemo)(
|
|
2295
|
+
() => new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }),
|
|
2296
|
+
[locale]
|
|
2297
|
+
);
|
|
2298
|
+
const dayNameFormatter = (0, import_react18.useMemo)(
|
|
2299
|
+
() => new Intl.DateTimeFormat(locale, { weekday: "short" }),
|
|
2300
|
+
[locale]
|
|
2301
|
+
);
|
|
2302
|
+
const monthNameFormatter = (0, import_react18.useMemo)(
|
|
2303
|
+
() => new Intl.DateTimeFormat(locale, { month: "long" }),
|
|
2304
|
+
[locale]
|
|
2305
|
+
);
|
|
2306
|
+
const fullDateFormatter = (0, import_react18.useMemo)(
|
|
2307
|
+
() => new Intl.DateTimeFormat(locale, { weekday: "long", day: "numeric", month: "long", year: "numeric" }),
|
|
2308
|
+
[locale]
|
|
2309
|
+
);
|
|
2310
|
+
const disabled = (0, import_react18.useCallback)(
|
|
2311
|
+
(date) => {
|
|
2312
|
+
if (min && isBefore(date, min)) return true;
|
|
2313
|
+
if (max && isAfter(date, max)) return true;
|
|
2314
|
+
return isDateDisabled?.(date) ?? false;
|
|
2315
|
+
},
|
|
2316
|
+
[min, max, isDateDisabled]
|
|
2317
|
+
);
|
|
2318
|
+
const key = (d) => `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
2319
|
+
const pendingFocus = (0, import_react18.useRef)(false);
|
|
2320
|
+
const focusDate = (0, import_react18.useCallback)((date) => {
|
|
2321
|
+
pendingFocus.current = true;
|
|
2322
|
+
setFocusedDate(date);
|
|
2323
|
+
setMonth(
|
|
2324
|
+
(current) => current.getFullYear() === date.getFullYear() && current.getMonth() === date.getMonth() ? current : new Date(date.getFullYear(), date.getMonth(), 1)
|
|
2325
|
+
);
|
|
2326
|
+
}, []);
|
|
2327
|
+
(0, import_react18.useEffect)(() => {
|
|
2328
|
+
if (!pendingFocus.current) return;
|
|
2329
|
+
const node = cellRefs.current.get(key(focusedDate));
|
|
2330
|
+
if (node) {
|
|
2331
|
+
node.focus();
|
|
2332
|
+
pendingFocus.current = false;
|
|
2333
|
+
}
|
|
2334
|
+
}, [focusedDate, month]);
|
|
2335
|
+
const select = (date) => {
|
|
2336
|
+
if (disabled(date)) return;
|
|
2337
|
+
setFocusedDate(date);
|
|
2338
|
+
if (mode === "single") {
|
|
2339
|
+
onSelect?.(date);
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
const current = range ?? { from: null, to: null };
|
|
2343
|
+
if (!current.from || current.to || isBefore(date, current.from)) {
|
|
2344
|
+
onRangeChange?.({ from: date, to: null });
|
|
2345
|
+
} else {
|
|
2346
|
+
onRangeChange?.({ from: current.from, to: date });
|
|
2347
|
+
}
|
|
2348
|
+
};
|
|
2349
|
+
const onKeyDown = (event) => {
|
|
2350
|
+
const moves = {
|
|
2351
|
+
ArrowLeft: () => addDays(focusedDate, -1),
|
|
2352
|
+
ArrowRight: () => addDays(focusedDate, 1),
|
|
2353
|
+
ArrowUp: () => addDays(focusedDate, -7),
|
|
2354
|
+
ArrowDown: () => addDays(focusedDate, 7),
|
|
2355
|
+
Home: () => addDays(focusedDate, -((focusedDate.getDay() - weekStartsOn + 7) % 7)),
|
|
2356
|
+
End: () => addDays(focusedDate, 6 - (focusedDate.getDay() - weekStartsOn + 7) % 7),
|
|
2357
|
+
// Shift moves a year (APG date-picker dialog); without it, a month.
|
|
2358
|
+
PageUp: () => new Date(focusedDate.getFullYear() - (event.shiftKey ? 1 : 0), focusedDate.getMonth() - (event.shiftKey ? 0 : 1), focusedDate.getDate()),
|
|
2359
|
+
PageDown: () => new Date(focusedDate.getFullYear() + (event.shiftKey ? 1 : 0), focusedDate.getMonth() + (event.shiftKey ? 0 : 1), focusedDate.getDate())
|
|
2360
|
+
};
|
|
2361
|
+
const move = moves[event.key];
|
|
2362
|
+
if (move) {
|
|
2363
|
+
event.preventDefault();
|
|
2364
|
+
focusDate(move());
|
|
2365
|
+
}
|
|
2366
|
+
};
|
|
2367
|
+
const firstYear = startYear ?? min?.getFullYear() ?? today.getFullYear() - 100;
|
|
2368
|
+
const lastYear = endYear ?? max?.getFullYear() ?? today.getFullYear() + 10;
|
|
2369
|
+
const years = Array.from({ length: Math.max(0, lastYear - firstYear) + 1 }, (_, i) => firstYear + i);
|
|
2370
|
+
const monthOutOfRange = (m) => !!min && (month.getFullYear() < min.getFullYear() || month.getFullYear() === min.getFullYear() && m < min.getMonth()) || !!max && (month.getFullYear() > max.getFullYear() || month.getFullYear() === max.getFullYear() && m > max.getMonth());
|
|
2371
|
+
const showMonth = (year, m) => {
|
|
2372
|
+
let next = new Date(year, m, 1);
|
|
2373
|
+
if (min && next < new Date(min.getFullYear(), min.getMonth(), 1)) next = new Date(min.getFullYear(), min.getMonth(), 1);
|
|
2374
|
+
if (max && next > new Date(max.getFullYear(), max.getMonth(), 1)) next = new Date(max.getFullYear(), max.getMonth(), 1);
|
|
2375
|
+
setMonth(next);
|
|
2376
|
+
const day = Math.min(focusedDate.getDate(), new Date(next.getFullYear(), next.getMonth() + 1, 0).getDate());
|
|
2377
|
+
setFocusedDate(new Date(next.getFullYear(), next.getMonth(), day));
|
|
2378
|
+
};
|
|
2379
|
+
const days = monthGrid(month, weekStartsOn);
|
|
2380
|
+
const weekdayNames = days.slice(0, 7).map((d) => dayNameFormatter.format(d));
|
|
2381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2382
|
+
"div",
|
|
2383
|
+
{
|
|
2384
|
+
"data-slot": "calendar",
|
|
2385
|
+
className: cn("w-fit rounded-xl border border-default bg-default p-3", className),
|
|
2386
|
+
...rest,
|
|
2387
|
+
children: [
|
|
2388
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
2389
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2390
|
+
IconButton,
|
|
2391
|
+
{
|
|
2392
|
+
variant: "subtle",
|
|
2393
|
+
size: "sm",
|
|
2394
|
+
"aria-label": "Previous month",
|
|
2395
|
+
disabled: !!min && isBefore(addMonths(month, -1), new Date(min.getFullYear(), min.getMonth(), 1)),
|
|
2396
|
+
onClick: () => setMonth(addMonths(month, -1)),
|
|
2397
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react2.ChevronLeftIcon, { "aria-hidden": true, size: 16 })
|
|
2398
|
+
}
|
|
2399
|
+
),
|
|
2400
|
+
captionLayout === "dropdown" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "relative flex items-center gap-1.5", children: [
|
|
2401
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2402
|
+
"select",
|
|
2403
|
+
{
|
|
2404
|
+
"aria-label": "Month",
|
|
2405
|
+
value: month.getMonth(),
|
|
2406
|
+
onChange: (event) => showMonth(month.getFullYear(), Number(event.target.value)),
|
|
2407
|
+
className: CAPTION_SELECT,
|
|
2408
|
+
children: Array.from({ length: 12 }, (_, m) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: m, disabled: monthOutOfRange(m), children: monthNameFormatter.format(new Date(2e3, m, 1)) }, m))
|
|
2409
|
+
}
|
|
2410
|
+
),
|
|
2411
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2412
|
+
"select",
|
|
2413
|
+
{
|
|
2414
|
+
"aria-label": "Year",
|
|
2415
|
+
value: month.getFullYear(),
|
|
2416
|
+
onChange: (event) => showMonth(Number(event.target.value), month.getMonth()),
|
|
2417
|
+
className: CAPTION_SELECT,
|
|
2418
|
+
children: years.map((year) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("option", { value: year, children: year }, year))
|
|
2419
|
+
}
|
|
2420
|
+
),
|
|
2421
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-live": "polite", className: "sr-only", children: monthFormatter.format(month) })
|
|
2422
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { "aria-live": "polite", className: "text-body-sm font-semibold text-default", children: monthFormatter.format(month) }),
|
|
2423
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2424
|
+
IconButton,
|
|
2425
|
+
{
|
|
2426
|
+
variant: "subtle",
|
|
2427
|
+
size: "sm",
|
|
2428
|
+
"aria-label": "Next month",
|
|
2429
|
+
disabled: !!max && isAfter(addMonths(month, 1), new Date(max.getFullYear(), max.getMonth(), 1)),
|
|
2430
|
+
onClick: () => setMonth(addMonths(month, 1)),
|
|
2431
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_lucide_react2.ChevronRightIcon, { "aria-hidden": true, size: 16 })
|
|
2432
|
+
}
|
|
2433
|
+
)
|
|
2434
|
+
] }),
|
|
2435
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2436
|
+
"div",
|
|
2437
|
+
{
|
|
2438
|
+
role: "grid",
|
|
2439
|
+
"aria-label": label,
|
|
2440
|
+
id: gridId,
|
|
2441
|
+
tabIndex: -1,
|
|
2442
|
+
onKeyDown,
|
|
2443
|
+
children: [
|
|
2444
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "row", className: "mb-1 grid grid-cols-7", children: weekdayNames.map((name) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2445
|
+
"div",
|
|
2446
|
+
{
|
|
2447
|
+
role: "columnheader",
|
|
2448
|
+
className: "flex h-8 items-center justify-center text-body-tiny font-medium text-default-tertiary",
|
|
2449
|
+
children: name
|
|
2450
|
+
},
|
|
2451
|
+
name
|
|
2452
|
+
)) }),
|
|
2453
|
+
Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "row", className: "grid grid-cols-7", children: days.slice(week * 7, week * 7 + 7).map((date) => {
|
|
2454
|
+
const outside = date.getMonth() !== month.getMonth();
|
|
2455
|
+
const isDisabled = disabled(date);
|
|
2456
|
+
const selected = mode === "single" ? sameDay(date, value) : sameDay(date, range?.from) || sameDay(date, range?.to);
|
|
2457
|
+
const between = mode === "range" && range?.from && range?.to ? inRange(date, range.from, range.to) : false;
|
|
2458
|
+
const isFocused = sameDay(date, focusedDate);
|
|
2459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { role: "gridcell", "aria-selected": selected || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2460
|
+
"button",
|
|
2461
|
+
{
|
|
2462
|
+
ref: (node) => {
|
|
2463
|
+
if (node) cellRefs.current.set(key(date), node);
|
|
2464
|
+
else cellRefs.current.delete(key(date));
|
|
2465
|
+
},
|
|
2466
|
+
type: "button",
|
|
2467
|
+
tabIndex: isFocused ? 0 : -1,
|
|
2468
|
+
disabled: isDisabled,
|
|
2469
|
+
"aria-label": fullDateFormatter.format(date),
|
|
2470
|
+
"aria-current": sameDay(date, today) ? "date" : void 0,
|
|
2471
|
+
onClick: () => select(date),
|
|
2472
|
+
onFocus: () => setFocusedDate(date),
|
|
2473
|
+
className: (0, import_clsx15.default)(
|
|
2474
|
+
"flex size-9 items-center justify-center rounded-lg text-body-sm tabular-nums transition-colors",
|
|
2475
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
2476
|
+
"disabled:cursor-not-allowed disabled:text-disabled disabled:hover:bg-transparent",
|
|
2477
|
+
selected ? "bg-brand font-semibold text-brand-on-brand" : between ? "rounded-none bg-brand-tertiary text-default" : outside ? "text-default-tertiary hover:bg-default-secondary" : "text-default hover:bg-default-secondary",
|
|
2478
|
+
// Today is marked by a ring rather than a fill, so it stays legible
|
|
2479
|
+
// when it is also the selected day.
|
|
2480
|
+
sameDay(date, today) && !selected && "ring-1 ring-inset ring-brand-tertiary"
|
|
2481
|
+
),
|
|
2482
|
+
children: date.getDate()
|
|
2483
|
+
}
|
|
2484
|
+
) }, key(date));
|
|
2485
|
+
}) }, week))
|
|
2486
|
+
]
|
|
2487
|
+
}
|
|
2488
|
+
)
|
|
2489
|
+
]
|
|
2490
|
+
}
|
|
2491
|
+
);
|
|
2492
|
+
}
|
|
2493
|
+
|
|
2494
|
+
// src/components/forms/date-picker.tsx
|
|
2495
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2496
|
+
var triggerBase = {
|
|
2497
|
+
lg: "h-12 px-5 pr-12 text-body",
|
|
2498
|
+
md: "h-9 px-4 pr-8 text-body-sm",
|
|
2499
|
+
sm: "h-6 px-3 pr-6 text-body-tiny"
|
|
2173
2500
|
};
|
|
2174
2501
|
var iconWrap2 = {
|
|
2175
2502
|
lg: { right: "right-4", size: "size-5" },
|
|
2176
2503
|
md: { right: "right-3", size: "size-4" },
|
|
2177
2504
|
sm: { right: "right-2", size: "size-3" }
|
|
2178
2505
|
};
|
|
2179
|
-
var
|
|
2506
|
+
var ISO = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
2507
|
+
function parseIso(value) {
|
|
2508
|
+
const match = value ? ISO.exec(value) : null;
|
|
2509
|
+
if (!match) return null;
|
|
2510
|
+
const date = new Date(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
|
|
2511
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
2512
|
+
}
|
|
2513
|
+
function toIso(date) {
|
|
2514
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
2515
|
+
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
|
|
2516
|
+
}
|
|
2517
|
+
var DatePicker = (0, import_react19.forwardRef)(function DatePicker2({
|
|
2518
|
+
label,
|
|
2519
|
+
description,
|
|
2520
|
+
error,
|
|
2521
|
+
hint,
|
|
2522
|
+
size: sizeProp,
|
|
2523
|
+
className,
|
|
2524
|
+
disabled,
|
|
2525
|
+
required,
|
|
2526
|
+
id,
|
|
2527
|
+
value: valueProp,
|
|
2528
|
+
defaultValue,
|
|
2529
|
+
onChange,
|
|
2530
|
+
onValueChange,
|
|
2531
|
+
onBlur,
|
|
2532
|
+
placeholder = "Pick a date",
|
|
2533
|
+
locale,
|
|
2534
|
+
weekStartsOn,
|
|
2535
|
+
captionLayout = "dropdown",
|
|
2536
|
+
startYear,
|
|
2537
|
+
endYear,
|
|
2538
|
+
min,
|
|
2539
|
+
max,
|
|
2540
|
+
...props
|
|
2541
|
+
}, ref) {
|
|
2180
2542
|
const size2 = useControlSize(sizeProp);
|
|
2181
|
-
|
|
2182
|
-
const iw = iconWrap2[size2];
|
|
2183
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2184
2544
|
Field,
|
|
2185
2545
|
{
|
|
2186
2546
|
id,
|
|
@@ -2188,79 +2548,190 @@ var DatePicker = (0, import_react17.forwardRef)(function DatePicker2({ label, de
|
|
|
2188
2548
|
disabled,
|
|
2189
2549
|
required,
|
|
2190
2550
|
hasDescription: !!description,
|
|
2191
|
-
hasError,
|
|
2551
|
+
hasError: !!error,
|
|
2192
2552
|
hasHint: !!hint,
|
|
2193
2553
|
className,
|
|
2194
2554
|
children: [
|
|
2195
|
-
label && /* @__PURE__ */ (0,
|
|
2196
|
-
description && /* @__PURE__ */ (0,
|
|
2197
|
-
/* @__PURE__ */ (0,
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
] }),
|
|
2224
|
-
hasError && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldError, { children: error }),
|
|
2225
|
-
!hasError && hint && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FieldHint, { children: hint })
|
|
2555
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldLabel, { children: label }),
|
|
2556
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldDescription, { children: description }),
|
|
2557
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2558
|
+
DateControl,
|
|
2559
|
+
{
|
|
2560
|
+
ref,
|
|
2561
|
+
size: size2,
|
|
2562
|
+
invalid: !!error,
|
|
2563
|
+
disabled,
|
|
2564
|
+
required,
|
|
2565
|
+
value: valueProp,
|
|
2566
|
+
defaultValue,
|
|
2567
|
+
onChange,
|
|
2568
|
+
onValueChange,
|
|
2569
|
+
onBlur,
|
|
2570
|
+
placeholder,
|
|
2571
|
+
locale,
|
|
2572
|
+
weekStartsOn,
|
|
2573
|
+
captionLayout,
|
|
2574
|
+
startYear,
|
|
2575
|
+
endYear,
|
|
2576
|
+
min: typeof min === "number" ? String(min) : min,
|
|
2577
|
+
max: typeof max === "number" ? String(max) : max,
|
|
2578
|
+
label,
|
|
2579
|
+
inputProps: props
|
|
2580
|
+
}
|
|
2581
|
+
),
|
|
2582
|
+
error ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldError, { children: error }) : hint && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FieldHint, { children: hint })
|
|
2226
2583
|
]
|
|
2227
2584
|
}
|
|
2228
2585
|
);
|
|
2229
2586
|
});
|
|
2230
|
-
var
|
|
2231
|
-
|
|
2587
|
+
var DateControl = (0, import_react19.forwardRef)(function DateControl2({
|
|
2588
|
+
size: size2,
|
|
2589
|
+
invalid,
|
|
2590
|
+
disabled,
|
|
2591
|
+
required,
|
|
2592
|
+
value,
|
|
2593
|
+
defaultValue,
|
|
2594
|
+
onChange,
|
|
2595
|
+
onValueChange,
|
|
2596
|
+
onBlur,
|
|
2597
|
+
placeholder,
|
|
2598
|
+
locale,
|
|
2599
|
+
weekStartsOn,
|
|
2600
|
+
captionLayout,
|
|
2601
|
+
startYear,
|
|
2602
|
+
endYear,
|
|
2603
|
+
min,
|
|
2604
|
+
max,
|
|
2605
|
+
label,
|
|
2606
|
+
inputProps: { name, ...inputProps }
|
|
2607
|
+
}, ref) {
|
|
2232
2608
|
const field = useFieldControl();
|
|
2609
|
+
const fieldContext = useFieldContext();
|
|
2610
|
+
const valueId = (0, import_react19.useId)();
|
|
2611
|
+
const dialogId = (0, import_react19.useId)();
|
|
2612
|
+
const [open, setOpen] = (0, import_react19.useState)(false);
|
|
2613
|
+
const [internal, setInternal] = (0, import_react19.useState)(defaultValue ?? "");
|
|
2614
|
+
const iso = value ?? internal;
|
|
2615
|
+
const date = parseIso(iso);
|
|
2616
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
2617
|
+
const inputRef = (0, import_react19.useRef)(null);
|
|
2618
|
+
const contentRef = (0, import_react19.useRef)(null);
|
|
2233
2619
|
const isInvalid = invalid || !!field["aria-invalid"];
|
|
2234
|
-
const isDisabled =
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
"[&::-webkit-calendar-picker-indicator]:opacity-0",
|
|
2246
|
-
"[&::-webkit-calendar-picker-indicator]:absolute",
|
|
2247
|
-
"[&::-webkit-calendar-picker-indicator]:right-0",
|
|
2248
|
-
"[&::-webkit-calendar-picker-indicator]:h-full",
|
|
2249
|
-
"[&::-webkit-calendar-picker-indicator]:w-10",
|
|
2250
|
-
"[&::-webkit-calendar-picker-indicator]:cursor-pointer",
|
|
2251
|
-
inputBase2[size2],
|
|
2252
|
-
isDisabled ? "cursor-not-allowed border-disabled bg-disabled text-disabled" : isInvalid ? "border-danger-secondary focus-visible:border-danger focus-visible:ring-danger" : "border-default focus-visible:border-brand focus-visible:ring-brand",
|
|
2253
|
-
className
|
|
2254
|
-
),
|
|
2255
|
-
...props
|
|
2620
|
+
const isDisabled = disabled ?? field.disabled;
|
|
2621
|
+
const iw = iconWrap2[size2];
|
|
2622
|
+
const formatter = (0, import_react19.useMemo)(() => new Intl.DateTimeFormat(locale, { dateStyle: "medium" }), [locale]);
|
|
2623
|
+
const commit = (next) => {
|
|
2624
|
+
const nextIso = toIso(next);
|
|
2625
|
+
if (value === void 0) setInternal(nextIso);
|
|
2626
|
+
onValueChange?.(nextIso);
|
|
2627
|
+
const input = inputRef.current;
|
|
2628
|
+
if (input) {
|
|
2629
|
+
Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(input, nextIso);
|
|
2630
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
2256
2631
|
}
|
|
2257
|
-
|
|
2632
|
+
setOpen(false);
|
|
2633
|
+
};
|
|
2634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "relative flex items-center", children: [
|
|
2635
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
|
|
2636
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2637
|
+
"button",
|
|
2638
|
+
{
|
|
2639
|
+
ref: triggerRef,
|
|
2640
|
+
type: "button",
|
|
2641
|
+
role: "combobox",
|
|
2642
|
+
"aria-haspopup": "dialog",
|
|
2643
|
+
"aria-expanded": open,
|
|
2644
|
+
"aria-controls": open ? dialogId : void 0,
|
|
2645
|
+
"aria-labelledby": fieldContext ? `${fieldContext.labelId} ${valueId}` : void 0,
|
|
2646
|
+
"aria-label": fieldContext ? void 0 : label,
|
|
2647
|
+
"data-size": size2,
|
|
2648
|
+
...field,
|
|
2649
|
+
disabled: isDisabled,
|
|
2650
|
+
onBlur,
|
|
2651
|
+
className: (0, import_clsx16.default)(
|
|
2652
|
+
"w-full appearance-none rounded-lg border text-left outline-none transition-colors",
|
|
2653
|
+
"bg-default text-default",
|
|
2654
|
+
"focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
2655
|
+
triggerBase[size2],
|
|
2656
|
+
isDisabled ? "cursor-not-allowed border-disabled bg-disabled text-disabled" : isInvalid ? "border-danger-secondary focus-visible:border-danger focus-visible:ring-danger" : "border-default focus-visible:border-brand focus-visible:ring-brand"
|
|
2657
|
+
),
|
|
2658
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { id: valueId, className: (0, import_clsx16.default)("block truncate", !date && "text-default-tertiary"), children: date ? formatter.format(date) : placeholder })
|
|
2659
|
+
}
|
|
2660
|
+
) }),
|
|
2661
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2662
|
+
PopoverContent,
|
|
2663
|
+
{
|
|
2664
|
+
ref: contentRef,
|
|
2665
|
+
id: dialogId,
|
|
2666
|
+
label: label ? `Choose ${label.toLowerCase()}` : "Choose date",
|
|
2667
|
+
align: "start",
|
|
2668
|
+
className: "w-auto max-w-none p-0",
|
|
2669
|
+
onOpenAutoFocus: (event) => {
|
|
2670
|
+
event.preventDefault();
|
|
2671
|
+
contentRef.current?.querySelector('[role="grid"] [tabindex="0"]')?.focus();
|
|
2672
|
+
},
|
|
2673
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2674
|
+
Calendar,
|
|
2675
|
+
{
|
|
2676
|
+
value: date,
|
|
2677
|
+
onSelect: commit,
|
|
2678
|
+
min: parseIso(min) ?? void 0,
|
|
2679
|
+
max: parseIso(max) ?? void 0,
|
|
2680
|
+
locale,
|
|
2681
|
+
weekStartsOn,
|
|
2682
|
+
captionLayout,
|
|
2683
|
+
startYear,
|
|
2684
|
+
endYear,
|
|
2685
|
+
label: label ?? "Calendar",
|
|
2686
|
+
className: "border-0"
|
|
2687
|
+
}
|
|
2688
|
+
)
|
|
2689
|
+
}
|
|
2690
|
+
)
|
|
2691
|
+
] }),
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2693
|
+
"span",
|
|
2694
|
+
{
|
|
2695
|
+
"aria-hidden": true,
|
|
2696
|
+
className: (0, import_clsx16.default)(
|
|
2697
|
+
"pointer-events-none absolute",
|
|
2698
|
+
iw.right,
|
|
2699
|
+
iw.size,
|
|
2700
|
+
"flex items-center justify-center",
|
|
2701
|
+
isDisabled ? "text-icon-disabled" : "text-icon-default-secondary"
|
|
2702
|
+
),
|
|
2703
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_lucide_react3.CalendarIcon, { className: "size-full" })
|
|
2704
|
+
}
|
|
2705
|
+
),
|
|
2706
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2707
|
+
"input",
|
|
2708
|
+
{
|
|
2709
|
+
ref: composeRefs(ref, inputRef),
|
|
2710
|
+
type: "date",
|
|
2711
|
+
"aria-hidden": true,
|
|
2712
|
+
tabIndex: -1,
|
|
2713
|
+
...inputProps,
|
|
2714
|
+
name,
|
|
2715
|
+
value: iso,
|
|
2716
|
+
min,
|
|
2717
|
+
max,
|
|
2718
|
+
required,
|
|
2719
|
+
disabled: isDisabled,
|
|
2720
|
+
onChange: (event) => {
|
|
2721
|
+
if (value === void 0) setInternal(event.target.value);
|
|
2722
|
+
onChange?.(event);
|
|
2723
|
+
},
|
|
2724
|
+
onFocus: () => triggerRef.current?.focus(),
|
|
2725
|
+
className: "pointer-events-none absolute inset-x-0 bottom-0 h-px w-full opacity-0"
|
|
2726
|
+
}
|
|
2727
|
+
)
|
|
2728
|
+
] });
|
|
2258
2729
|
});
|
|
2259
2730
|
|
|
2260
2731
|
// src/components/forms/stepper.tsx
|
|
2261
|
-
var
|
|
2262
|
-
var
|
|
2263
|
-
var
|
|
2732
|
+
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
2733
|
+
var import_lucide_react4 = require("lucide-react");
|
|
2734
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2264
2735
|
var STATUS_TEXT = {
|
|
2265
2736
|
complete: "completed",
|
|
2266
2737
|
active: "current step",
|
|
@@ -2273,41 +2744,41 @@ var SIZE2 = {
|
|
|
2273
2744
|
function StepIndicator({ status, size: size2 }) {
|
|
2274
2745
|
const s = SIZE2[size2];
|
|
2275
2746
|
if (status === "complete") {
|
|
2276
|
-
return /* @__PURE__ */ (0,
|
|
2747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2277
2748
|
"span",
|
|
2278
2749
|
{
|
|
2279
2750
|
"aria-hidden": true,
|
|
2280
|
-
className: (0,
|
|
2751
|
+
className: (0, import_clsx17.default)(
|
|
2281
2752
|
"flex shrink-0 items-center justify-center rounded-full bg-brand text-brand-on-brand",
|
|
2282
2753
|
s.indicator
|
|
2283
2754
|
),
|
|
2284
|
-
children: /* @__PURE__ */ (0,
|
|
2755
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.CheckIcon, { size: s.glyph })
|
|
2285
2756
|
}
|
|
2286
2757
|
);
|
|
2287
2758
|
}
|
|
2288
2759
|
if (status === "active") {
|
|
2289
|
-
return /* @__PURE__ */ (0,
|
|
2760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2290
2761
|
"span",
|
|
2291
2762
|
{
|
|
2292
2763
|
"aria-hidden": true,
|
|
2293
|
-
className: (0,
|
|
2764
|
+
className: (0, import_clsx17.default)(
|
|
2294
2765
|
"flex shrink-0 items-center justify-center rounded-full border-2 border-brand-emphasis",
|
|
2295
2766
|
s.indicator
|
|
2296
2767
|
),
|
|
2297
|
-
children: /* @__PURE__ */ (0,
|
|
2768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "size-2.5 rounded-full bg-brand" })
|
|
2298
2769
|
}
|
|
2299
2770
|
);
|
|
2300
2771
|
}
|
|
2301
|
-
return /* @__PURE__ */ (0,
|
|
2772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2302
2773
|
"span",
|
|
2303
2774
|
{
|
|
2304
2775
|
"aria-hidden": true,
|
|
2305
|
-
className: (0,
|
|
2776
|
+
className: (0, import_clsx17.default)("shrink-0 rounded-full border-2 border-disabled", s.indicator)
|
|
2306
2777
|
}
|
|
2307
2778
|
);
|
|
2308
2779
|
}
|
|
2309
2780
|
function ChevronSeparator() {
|
|
2310
|
-
return /* @__PURE__ */ (0,
|
|
2781
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react4.ChevronRightIcon, { className: "mx-1 size-4 shrink-0 text-default-tertiary", "aria-hidden": true });
|
|
2311
2782
|
}
|
|
2312
2783
|
var labelClass = {
|
|
2313
2784
|
complete: "text-brand font-semibold",
|
|
@@ -2318,26 +2789,26 @@ function Stepper({ steps, size: size2 = "md", label = "Progress", className }) {
|
|
|
2318
2789
|
const s = SIZE2[size2];
|
|
2319
2790
|
return (
|
|
2320
2791
|
// An <ol> cannot be wrapped without breaking the list relationship with its <li>s.
|
|
2321
|
-
/* @__PURE__ */ (0,
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2322
2793
|
"ol",
|
|
2323
2794
|
{
|
|
2324
|
-
className: (0,
|
|
2795
|
+
className: (0, import_clsx17.default)("flex items-center overflow-x-auto", SCROLLBAR_CLASSES, className),
|
|
2325
2796
|
"aria-label": label,
|
|
2326
|
-
children: steps.map((step, i) => /* @__PURE__ */ (0,
|
|
2797
|
+
children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2327
2798
|
"li",
|
|
2328
2799
|
{
|
|
2329
2800
|
className: "flex items-center",
|
|
2330
2801
|
"aria-current": step.status === "active" ? "step" : void 0,
|
|
2331
2802
|
children: [
|
|
2332
|
-
/* @__PURE__ */ (0,
|
|
2333
|
-
/* @__PURE__ */ (0,
|
|
2334
|
-
/* @__PURE__ */ (0,
|
|
2335
|
-
/* @__PURE__ */ (0,
|
|
2803
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "flex items-center gap-1.5", children: [
|
|
2804
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(StepIndicator, { status: step.status, size: size2 }),
|
|
2805
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: (0, import_clsx17.default)("whitespace-nowrap", s.label, labelClass[step.status]), children: step.label }),
|
|
2806
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "sr-only", children: [
|
|
2336
2807
|
", ",
|
|
2337
2808
|
STATUS_TEXT[step.status]
|
|
2338
2809
|
] })
|
|
2339
2810
|
] }),
|
|
2340
|
-
i < steps.length - 1 && /* @__PURE__ */ (0,
|
|
2811
|
+
i < steps.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronSeparator, {})
|
|
2341
2812
|
]
|
|
2342
2813
|
},
|
|
2343
2814
|
step.label
|
|
@@ -2348,9 +2819,9 @@ function Stepper({ steps, size: size2 = "md", label = "Progress", className }) {
|
|
|
2348
2819
|
}
|
|
2349
2820
|
|
|
2350
2821
|
// src/components/forms/multiselect-card.tsx
|
|
2351
|
-
var
|
|
2352
|
-
var
|
|
2353
|
-
var
|
|
2822
|
+
var import_clsx18 = __toESM(require("clsx"), 1);
|
|
2823
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2824
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2354
2825
|
var SIZE3 = {
|
|
2355
2826
|
default: {
|
|
2356
2827
|
pad: "p-4",
|
|
@@ -2380,7 +2851,7 @@ function MultiSelectCard({
|
|
|
2380
2851
|
className
|
|
2381
2852
|
}) {
|
|
2382
2853
|
const s = SIZE3[size2];
|
|
2383
|
-
return /* @__PURE__ */ (0,
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
2384
2855
|
"button",
|
|
2385
2856
|
{
|
|
2386
2857
|
type: "button",
|
|
@@ -2388,7 +2859,7 @@ function MultiSelectCard({
|
|
|
2388
2859
|
"aria-checked": selected,
|
|
2389
2860
|
disabled,
|
|
2390
2861
|
onClick: onToggle,
|
|
2391
|
-
className: (0,
|
|
2862
|
+
className: (0, import_clsx18.default)(
|
|
2392
2863
|
"relative w-full rounded-2xl border-2 text-left transition-all",
|
|
2393
2864
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
2394
2865
|
"disabled:cursor-not-allowed disabled:opacity-60",
|
|
@@ -2397,40 +2868,40 @@ function MultiSelectCard({
|
|
|
2397
2868
|
className
|
|
2398
2869
|
),
|
|
2399
2870
|
children: [
|
|
2400
|
-
/* @__PURE__ */ (0,
|
|
2401
|
-
/* @__PURE__ */ (0,
|
|
2871
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
2872
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2402
2873
|
"span",
|
|
2403
2874
|
{
|
|
2404
2875
|
"aria-hidden": true,
|
|
2405
|
-
className: (0,
|
|
2876
|
+
className: (0, import_clsx18.default)(
|
|
2406
2877
|
"flex shrink-0 items-center justify-center",
|
|
2407
2878
|
s.iconBox,
|
|
2408
2879
|
selected ? "bg-brand" : "bg-brand-tertiary"
|
|
2409
2880
|
),
|
|
2410
|
-
children: /* @__PURE__ */ (0,
|
|
2881
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: (0, import_clsx18.default)(s.icon, selected ? "text-icon-brand-on-brand" : "text-icon-brand"), children: icon })
|
|
2411
2882
|
}
|
|
2412
2883
|
),
|
|
2413
|
-
selected ? /* @__PURE__ */ (0,
|
|
2884
|
+
selected ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2414
2885
|
"span",
|
|
2415
2886
|
{
|
|
2416
2887
|
"aria-hidden": true,
|
|
2417
|
-
className: (0,
|
|
2888
|
+
className: (0, import_clsx18.default)(
|
|
2418
2889
|
"flex shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand",
|
|
2419
2890
|
s.mark
|
|
2420
2891
|
),
|
|
2421
|
-
children: /* @__PURE__ */ (0,
|
|
2892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react5.CheckIcon, { className: "size-3", strokeWidth: 2.5 })
|
|
2422
2893
|
}
|
|
2423
|
-
) : /* @__PURE__ */ (0,
|
|
2894
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2424
2895
|
"span",
|
|
2425
2896
|
{
|
|
2426
2897
|
"aria-hidden": true,
|
|
2427
|
-
className: (0,
|
|
2898
|
+
className: (0, import_clsx18.default)("shrink-0 rounded-full border-2 border-default", s.mark)
|
|
2428
2899
|
}
|
|
2429
2900
|
)
|
|
2430
2901
|
] }),
|
|
2431
|
-
/* @__PURE__ */ (0,
|
|
2432
|
-
/* @__PURE__ */ (0,
|
|
2433
|
-
description && /* @__PURE__ */ (0,
|
|
2902
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: s.gap, children: [
|
|
2903
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: (0, import_clsx18.default)("font-semibold", s.title, selected ? "text-brand" : "text-default"), children: title }),
|
|
2904
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "mt-0.5 text-body-tiny text-default-secondary", children: description })
|
|
2434
2905
|
] })
|
|
2435
2906
|
]
|
|
2436
2907
|
}
|
|
@@ -2438,8 +2909,8 @@ function MultiSelectCard({
|
|
|
2438
2909
|
}
|
|
2439
2910
|
|
|
2440
2911
|
// src/components/forms/switch.tsx
|
|
2441
|
-
var
|
|
2442
|
-
var
|
|
2912
|
+
var import_react20 = require("react");
|
|
2913
|
+
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
2443
2914
|
|
|
2444
2915
|
// src/lib/compose-event-handlers.ts
|
|
2445
2916
|
function composeEventHandlers(theirs, ours) {
|
|
@@ -2450,12 +2921,12 @@ function composeEventHandlers(theirs, ours) {
|
|
|
2450
2921
|
}
|
|
2451
2922
|
|
|
2452
2923
|
// src/components/forms/switch.tsx
|
|
2453
|
-
var
|
|
2924
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2454
2925
|
var SIZE4 = {
|
|
2455
2926
|
sm: { track: "h-5 w-9", knob: "size-4", translate: "translate-x-4" },
|
|
2456
2927
|
md: { track: "h-6 w-11", knob: "size-5", translate: "translate-x-5" }
|
|
2457
2928
|
};
|
|
2458
|
-
var Switch = (0,
|
|
2929
|
+
var Switch = (0, import_react20.forwardRef)(function Switch2({
|
|
2459
2930
|
checked: checkedProp,
|
|
2460
2931
|
defaultChecked = false,
|
|
2461
2932
|
onCheckedChange,
|
|
@@ -2478,11 +2949,11 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2478
2949
|
defaultValue: defaultChecked,
|
|
2479
2950
|
onChange: onCheckedChange
|
|
2480
2951
|
});
|
|
2481
|
-
const generatedId = (0,
|
|
2952
|
+
const generatedId = (0, import_react20.useId)();
|
|
2482
2953
|
const controlId = id ?? generatedId;
|
|
2483
2954
|
const descriptionId = `${controlId}-description`;
|
|
2484
2955
|
const s = SIZE4[size2];
|
|
2485
|
-
const control = /* @__PURE__ */ (0,
|
|
2956
|
+
const control = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2486
2957
|
"button",
|
|
2487
2958
|
{
|
|
2488
2959
|
ref,
|
|
@@ -2496,7 +2967,7 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2496
2967
|
"aria-describedby": description ? descriptionId : void 0,
|
|
2497
2968
|
disabled,
|
|
2498
2969
|
onClick: composeEventHandlers(onClick, () => setChecked(!checked)),
|
|
2499
|
-
className: (0,
|
|
2970
|
+
className: (0, import_clsx19.default)(
|
|
2500
2971
|
"group flex items-center gap-2",
|
|
2501
2972
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
2502
2973
|
disabled && "cursor-not-allowed opacity-50",
|
|
@@ -2504,11 +2975,11 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2504
2975
|
),
|
|
2505
2976
|
...rest,
|
|
2506
2977
|
children: [
|
|
2507
|
-
/* @__PURE__ */ (0,
|
|
2978
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2508
2979
|
"span",
|
|
2509
2980
|
{
|
|
2510
2981
|
"aria-hidden": true,
|
|
2511
|
-
className: (0,
|
|
2982
|
+
className: (0, import_clsx19.default)(
|
|
2512
2983
|
"relative inline-flex shrink-0 rounded-full transition-colors",
|
|
2513
2984
|
s.track,
|
|
2514
2985
|
// The unchecked track is borderless per the spec. A border here would also shift
|
|
@@ -2516,10 +2987,10 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2516
2987
|
// against the padding box.
|
|
2517
2988
|
disabled ? "bg-disabled" : checked ? "bg-brand group-hover:bg-brand-hover" : "bg-default-secondary group-hover:bg-default-secondary-hover"
|
|
2518
2989
|
),
|
|
2519
|
-
children: /* @__PURE__ */ (0,
|
|
2990
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2520
2991
|
"span",
|
|
2521
2992
|
{
|
|
2522
|
-
className: (0,
|
|
2993
|
+
className: (0, import_clsx19.default)(
|
|
2523
2994
|
"absolute left-0.5 top-0.5 rounded-full bg-default shadow-100 transition-transform",
|
|
2524
2995
|
s.knob,
|
|
2525
2996
|
checked ? s.translate : "translate-x-0"
|
|
@@ -2528,11 +2999,11 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2528
2999
|
)
|
|
2529
3000
|
}
|
|
2530
3001
|
),
|
|
2531
|
-
label && /* @__PURE__ */ (0,
|
|
3002
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-body-xs text-default", children: label })
|
|
2532
3003
|
]
|
|
2533
3004
|
}
|
|
2534
3005
|
);
|
|
2535
|
-
const formInput = name ? /* @__PURE__ */ (0,
|
|
3006
|
+
const formInput = name ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2536
3007
|
"input",
|
|
2537
3008
|
{
|
|
2538
3009
|
type: "checkbox",
|
|
@@ -2549,19 +3020,19 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2549
3020
|
}
|
|
2550
3021
|
) : null;
|
|
2551
3022
|
if (!description) {
|
|
2552
|
-
return formInput ? /* @__PURE__ */ (0,
|
|
3023
|
+
return formInput ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: (0, import_clsx19.default)("relative inline-flex", className), children: [
|
|
2553
3024
|
control,
|
|
2554
3025
|
formInput
|
|
2555
3026
|
] }) : control;
|
|
2556
3027
|
}
|
|
2557
|
-
return /* @__PURE__ */ (0,
|
|
3028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_clsx19.default)("relative flex flex-col", className), children: [
|
|
2558
3029
|
control,
|
|
2559
3030
|
formInput,
|
|
2560
|
-
/* @__PURE__ */ (0,
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
2561
3032
|
"span",
|
|
2562
3033
|
{
|
|
2563
3034
|
id: descriptionId,
|
|
2564
|
-
className: (0,
|
|
3035
|
+
className: (0, import_clsx19.default)(
|
|
2565
3036
|
"mt-0.5 text-body-tiny",
|
|
2566
3037
|
size2 === "md" ? "pl-[52px]" : "pl-[44px]",
|
|
2567
3038
|
disabled ? "text-disabled" : "text-default-secondary"
|
|
@@ -2573,9 +3044,9 @@ var Switch = (0, import_react18.forwardRef)(function Switch2({
|
|
|
2573
3044
|
});
|
|
2574
3045
|
|
|
2575
3046
|
// src/components/forms/toggle.tsx
|
|
2576
|
-
var
|
|
2577
|
-
var
|
|
2578
|
-
var
|
|
3047
|
+
var import_react21 = require("react");
|
|
3048
|
+
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
3049
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2579
3050
|
var SIZE5 = {
|
|
2580
3051
|
sm: "h-8 min-w-8 px-2 text-body-tiny [&_svg]:size-3.5",
|
|
2581
3052
|
md: "h-9 min-w-9 px-2.5 text-body-xs [&_svg]:size-4",
|
|
@@ -2585,7 +3056,7 @@ var VARIANT = {
|
|
|
2585
3056
|
ghost: "border border-transparent bg-transparent",
|
|
2586
3057
|
outline: "border border-default bg-default"
|
|
2587
3058
|
};
|
|
2588
|
-
var Toggle = (0,
|
|
3059
|
+
var Toggle = (0, import_react21.forwardRef)(function Toggle2({
|
|
2589
3060
|
pressed: pressedProp,
|
|
2590
3061
|
defaultPressed = false,
|
|
2591
3062
|
onPressedChange,
|
|
@@ -2597,7 +3068,7 @@ var Toggle = (0, import_react19.forwardRef)(function Toggle2({
|
|
|
2597
3068
|
onClick,
|
|
2598
3069
|
...rest
|
|
2599
3070
|
}, ref) {
|
|
2600
|
-
const group = (0,
|
|
3071
|
+
const group = (0, import_react21.useContext)(ToggleGroupContext);
|
|
2601
3072
|
const [standalonePressed, setStandalonePressed] = useControllableState({
|
|
2602
3073
|
value: pressedProp,
|
|
2603
3074
|
defaultValue: defaultPressed,
|
|
@@ -2605,7 +3076,7 @@ var Toggle = (0, import_react19.forwardRef)(function Toggle2({
|
|
|
2605
3076
|
});
|
|
2606
3077
|
const pressed = group ? group.isPressed(rest.value) : standalonePressed;
|
|
2607
3078
|
const isDisabled = disabled ?? group?.disabled;
|
|
2608
|
-
return /* @__PURE__ */ (0,
|
|
3079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2609
3080
|
"button",
|
|
2610
3081
|
{
|
|
2611
3082
|
ref,
|
|
@@ -2636,9 +3107,10 @@ var Toggle = (0, import_react19.forwardRef)(function Toggle2({
|
|
|
2636
3107
|
}
|
|
2637
3108
|
);
|
|
2638
3109
|
});
|
|
2639
|
-
var ToggleGroupContext = (0,
|
|
3110
|
+
var ToggleGroupContext = (0, import_react21.createContext)(null);
|
|
2640
3111
|
function ToggleGroup({
|
|
2641
3112
|
children,
|
|
3113
|
+
options,
|
|
2642
3114
|
type = "single",
|
|
2643
3115
|
value: valueProp,
|
|
2644
3116
|
defaultValue,
|
|
@@ -2658,8 +3130,8 @@ function ToggleGroup({
|
|
|
2658
3130
|
orientation: orientation === "vertical" ? "vertical" : "horizontal",
|
|
2659
3131
|
loop: true
|
|
2660
3132
|
});
|
|
2661
|
-
const cursor = (0,
|
|
2662
|
-
const context = (0,
|
|
3133
|
+
const cursor = (0, import_react21.useRef)(0);
|
|
3134
|
+
const context = (0, import_react21.useMemo)(
|
|
2663
3135
|
() => ({
|
|
2664
3136
|
isPressed: (itemValue) => Array.isArray(value) ? value.includes(itemValue) : value === itemValue,
|
|
2665
3137
|
toggle: (itemValue) => {
|
|
@@ -2679,33 +3151,42 @@ function ToggleGroup({
|
|
|
2679
3151
|
[value, setValue, type, disabled, roving]
|
|
2680
3152
|
);
|
|
2681
3153
|
cursor.current = 0;
|
|
2682
|
-
return /* @__PURE__ */ (0,
|
|
3154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ToggleGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2683
3155
|
"div",
|
|
2684
3156
|
{
|
|
2685
3157
|
role: "group",
|
|
2686
3158
|
"aria-label": label,
|
|
2687
3159
|
"data-slot": "toggle-group",
|
|
2688
|
-
className: (0,
|
|
3160
|
+
className: (0, import_clsx20.default)(
|
|
2689
3161
|
"inline-flex gap-0.5",
|
|
2690
3162
|
orientation === "vertical" ? "flex-col" : "flex-row items-center",
|
|
2691
3163
|
className
|
|
2692
3164
|
),
|
|
2693
3165
|
...roving.containerProps,
|
|
2694
3166
|
...rest,
|
|
2695
|
-
children
|
|
3167
|
+
children: options ? options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3168
|
+
ToggleGroupItem,
|
|
3169
|
+
{
|
|
3170
|
+
value: option.value,
|
|
3171
|
+
"aria-label": option["aria-label"],
|
|
3172
|
+
disabled: option.disabled,
|
|
3173
|
+
children: option.label
|
|
3174
|
+
},
|
|
3175
|
+
option.value
|
|
3176
|
+
)) : children
|
|
2696
3177
|
}
|
|
2697
3178
|
) });
|
|
2698
3179
|
}
|
|
2699
|
-
var ToggleGroupItem = (0,
|
|
3180
|
+
var ToggleGroupItem = (0, import_react21.forwardRef)(
|
|
2700
3181
|
function ToggleGroupItem2({ value, children, onFocus, ...rest }, ref) {
|
|
2701
|
-
const group = (0,
|
|
3182
|
+
const group = (0, import_react21.useContext)(ToggleGroupContext);
|
|
2702
3183
|
if (!group) throw new Error("<ToggleGroupItem> must be used inside <ToggleGroup>");
|
|
2703
3184
|
const index = group.claimIndex();
|
|
2704
3185
|
const { ref: rovingRef, ...itemProps } = group.roving.itemProps(index, {
|
|
2705
3186
|
disabled: rest.disabled ?? group.disabled,
|
|
2706
3187
|
label: typeof children === "string" ? children : void 0
|
|
2707
3188
|
});
|
|
2708
|
-
return /* @__PURE__ */ (0,
|
|
3189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2709
3190
|
Toggle,
|
|
2710
3191
|
{
|
|
2711
3192
|
ref: composeRefs(ref, rovingRef),
|
|
@@ -2724,10 +3205,10 @@ var ToggleGroupItem = (0, import_react19.forwardRef)(
|
|
|
2724
3205
|
);
|
|
2725
3206
|
|
|
2726
3207
|
// src/components/forms/input-otp.tsx
|
|
2727
|
-
var
|
|
2728
|
-
var
|
|
2729
|
-
var
|
|
2730
|
-
var InputOTP = (0,
|
|
3208
|
+
var import_react22 = require("react");
|
|
3209
|
+
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
3210
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3211
|
+
var InputOTP = (0, import_react22.forwardRef)(function InputOTP2({
|
|
2731
3212
|
length = 6,
|
|
2732
3213
|
value: valueProp,
|
|
2733
3214
|
defaultValue = "",
|
|
@@ -2746,9 +3227,9 @@ var InputOTP = (0, import_react20.forwardRef)(function InputOTP2({
|
|
|
2746
3227
|
defaultValue,
|
|
2747
3228
|
onChange: onValueChange
|
|
2748
3229
|
});
|
|
2749
|
-
const inputRef = (0,
|
|
2750
|
-
const [focused, setFocused] = (0,
|
|
2751
|
-
const describedById = (0,
|
|
3230
|
+
const inputRef = (0, import_react22.useRef)(null);
|
|
3231
|
+
const [focused, setFocused] = (0, import_react22.useState)(false);
|
|
3232
|
+
const describedById = (0, import_react22.useId)();
|
|
2752
3233
|
const pattern = mode === "numeric" ? /[^0-9]/g : /[^a-zA-Z0-9]/g;
|
|
2753
3234
|
const commit = (next) => {
|
|
2754
3235
|
const cleaned = next.replace(pattern, "").slice(0, length);
|
|
@@ -2757,14 +3238,14 @@ var InputOTP = (0, import_react20.forwardRef)(function InputOTP2({
|
|
|
2757
3238
|
};
|
|
2758
3239
|
const chars = value.split("");
|
|
2759
3240
|
const activeIndex = Math.min(value.length, length - 1);
|
|
2760
|
-
return /* @__PURE__ */ (0,
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
3241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: (0, import_clsx21.default)("relative inline-flex flex-col gap-1.5", className), children: [
|
|
3242
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
2762
3243
|
"div",
|
|
2763
3244
|
{
|
|
2764
3245
|
className: "relative inline-flex items-center gap-2",
|
|
2765
3246
|
onClick: () => inputRef.current?.focus(),
|
|
2766
3247
|
children: [
|
|
2767
|
-
/* @__PURE__ */ (0,
|
|
3248
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2768
3249
|
"input",
|
|
2769
3250
|
{
|
|
2770
3251
|
ref: composeRefs(inputRef, ref),
|
|
@@ -2793,11 +3274,11 @@ var InputOTP = (0, import_react20.forwardRef)(function InputOTP2({
|
|
|
2793
3274
|
className: "absolute inset-0 z-raised w-full cursor-default bg-transparent text-transparent caret-transparent outline-none"
|
|
2794
3275
|
}
|
|
2795
3276
|
),
|
|
2796
|
-
Array.from({ length }, (_, index) => /* @__PURE__ */ (0,
|
|
3277
|
+
Array.from({ length }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2797
3278
|
"span",
|
|
2798
3279
|
{
|
|
2799
3280
|
"aria-hidden": true,
|
|
2800
|
-
className: (0,
|
|
3281
|
+
className: (0, import_clsx21.default)(
|
|
2801
3282
|
"flex h-12 w-10 items-center justify-center rounded-lg border text-body font-semibold tabular-nums transition-colors",
|
|
2802
3283
|
groupAfter && index === groupAfter && "ml-3",
|
|
2803
3284
|
disabled ? "border-disabled bg-disabled text-disabled" : invalid ? "border-danger-secondary bg-default text-default" : "border-default bg-default text-default",
|
|
@@ -2810,15 +3291,15 @@ var InputOTP = (0, import_react20.forwardRef)(function InputOTP2({
|
|
|
2810
3291
|
]
|
|
2811
3292
|
}
|
|
2812
3293
|
),
|
|
2813
|
-
/* @__PURE__ */ (0,
|
|
3294
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { id: describedById, className: "sr-only", children: `Enter the ${length}-character code. ${value.length} of ${length} entered.` })
|
|
2814
3295
|
] });
|
|
2815
3296
|
});
|
|
2816
3297
|
|
|
2817
3298
|
// src/components/forms/file-drop-zone.tsx
|
|
2818
|
-
var
|
|
2819
|
-
var
|
|
2820
|
-
var
|
|
2821
|
-
var
|
|
3299
|
+
var import_react23 = require("react");
|
|
3300
|
+
var import_clsx22 = __toESM(require("clsx"), 1);
|
|
3301
|
+
var import_lucide_react6 = require("lucide-react");
|
|
3302
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2822
3303
|
var DEFAULT_ACCEPT = ".pdf,.jpg,.jpeg,.png";
|
|
2823
3304
|
var DEFAULT_MAX_SIZE_BYTES = 10 * 1024 * 1024;
|
|
2824
3305
|
function formatFileSize(bytes) {
|
|
@@ -2839,8 +3320,8 @@ function useFilePicker({
|
|
|
2839
3320
|
maxSizeBytes = DEFAULT_MAX_SIZE_BYTES,
|
|
2840
3321
|
onFileSelected
|
|
2841
3322
|
} = {}) {
|
|
2842
|
-
const inputRef = (0,
|
|
2843
|
-
const [error, setError] = (0,
|
|
3323
|
+
const inputRef = (0, import_react23.useRef)(null);
|
|
3324
|
+
const [error, setError] = (0, import_react23.useState)(null);
|
|
2844
3325
|
function handleFiles(files) {
|
|
2845
3326
|
const file = files?.[0];
|
|
2846
3327
|
if (!file) return;
|
|
@@ -2880,76 +3361,80 @@ function FileDropZone({
|
|
|
2880
3361
|
onFileSelected,
|
|
2881
3362
|
disabled = false
|
|
2882
3363
|
}) {
|
|
2883
|
-
const [isDragging, setIsDragging] = (0,
|
|
3364
|
+
const [isDragging, setIsDragging] = (0, import_react23.useState)(false);
|
|
2884
3365
|
const picker = useFilePicker({ accept, maxSizeBytes, onFileSelected });
|
|
2885
3366
|
const { error, handleFiles } = picker;
|
|
2886
3367
|
const inputRef = picker.inputProps.ref;
|
|
2887
|
-
return
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
{
|
|
2892
|
-
|
|
2893
|
-
"
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
e.preventDefault();
|
|
2907
|
-
if (!disabled) setIsDragging(true);
|
|
2908
|
-
},
|
|
2909
|
-
onDragEnter: (e) => {
|
|
2910
|
-
e.preventDefault();
|
|
2911
|
-
if (!disabled) setIsDragging(true);
|
|
2912
|
-
},
|
|
2913
|
-
onDragLeave: () => setIsDragging(false),
|
|
2914
|
-
onDrop: (e) => {
|
|
2915
|
-
e.preventDefault();
|
|
2916
|
-
setIsDragging(false);
|
|
2917
|
-
if (!disabled) handleFiles(e.dataTransfer.files);
|
|
2918
|
-
},
|
|
2919
|
-
className: (0, import_clsx21.default)(
|
|
2920
|
-
"flex flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed py-4 px-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1",
|
|
2921
|
-
disabled ? "cursor-not-allowed border-disabled bg-disabled" : (0, import_clsx21.default)(
|
|
2922
|
-
"cursor-pointer",
|
|
2923
|
-
isDragging ? "border-brand bg-brand-tertiary" : "border-default bg-default-secondary hover:border-brand hover:bg-brand-tertiary"
|
|
2924
|
-
),
|
|
2925
|
-
className
|
|
2926
|
-
),
|
|
2927
|
-
children: [
|
|
2928
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2929
|
-
"span",
|
|
2930
|
-
{
|
|
2931
|
-
"aria-hidden": true,
|
|
2932
|
-
className: disabled ? "text-disabled" : isDragging ? "text-brand" : "text-default-secondary",
|
|
2933
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react5.UploadIcon, { className: "size-5" })
|
|
3368
|
+
return (
|
|
3369
|
+
// relative: the hidden input is absolutely positioned (sr-only); without a positioned
|
|
3370
|
+
// ancestor its box escapes a scrolling container and scrolls the page instead.
|
|
3371
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "relative", children: [
|
|
3372
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("input", { ...picker.inputProps, disabled }),
|
|
3373
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3374
|
+
"div",
|
|
3375
|
+
{
|
|
3376
|
+
role: "button",
|
|
3377
|
+
"data-state": isDragging ? "dragging" : void 0,
|
|
3378
|
+
tabIndex: disabled ? -1 : 0,
|
|
3379
|
+
"aria-disabled": disabled,
|
|
3380
|
+
onClick: () => {
|
|
3381
|
+
if (!disabled) inputRef.current?.click();
|
|
3382
|
+
},
|
|
3383
|
+
onKeyDown: (e) => {
|
|
3384
|
+
if (!disabled && (e.key === "Enter" || e.key === " ")) {
|
|
3385
|
+
e.preventDefault();
|
|
3386
|
+
inputRef.current?.click();
|
|
2934
3387
|
}
|
|
3388
|
+
},
|
|
3389
|
+
onDragOver: (e) => {
|
|
3390
|
+
e.preventDefault();
|
|
3391
|
+
if (!disabled) setIsDragging(true);
|
|
3392
|
+
},
|
|
3393
|
+
onDragEnter: (e) => {
|
|
3394
|
+
e.preventDefault();
|
|
3395
|
+
if (!disabled) setIsDragging(true);
|
|
3396
|
+
},
|
|
3397
|
+
onDragLeave: () => setIsDragging(false),
|
|
3398
|
+
onDrop: (e) => {
|
|
3399
|
+
e.preventDefault();
|
|
3400
|
+
setIsDragging(false);
|
|
3401
|
+
if (!disabled) handleFiles(e.dataTransfer.files);
|
|
3402
|
+
},
|
|
3403
|
+
className: (0, import_clsx22.default)(
|
|
3404
|
+
"flex flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed py-4 px-4 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1",
|
|
3405
|
+
disabled ? "cursor-not-allowed border-disabled bg-disabled" : (0, import_clsx22.default)(
|
|
3406
|
+
"cursor-pointer",
|
|
3407
|
+
isDragging ? "border-brand bg-brand-tertiary" : "border-default bg-default-secondary hover:border-brand hover:bg-brand-tertiary"
|
|
3408
|
+
),
|
|
3409
|
+
className
|
|
2935
3410
|
),
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
3411
|
+
children: [
|
|
3412
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3413
|
+
"span",
|
|
3414
|
+
{
|
|
3415
|
+
"aria-hidden": true,
|
|
3416
|
+
className: disabled ? "text-disabled" : isDragging ? "text-brand" : "text-default-secondary",
|
|
3417
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react6.UploadIcon, { className: "size-5" })
|
|
3418
|
+
}
|
|
3419
|
+
),
|
|
3420
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: (0, import_clsx22.default)("text-body-sm font-medium", disabled ? "text-disabled" : "text-default"), children: "Upload file" }),
|
|
3421
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-body-xs text-default-secondary text-center", children: description })
|
|
3422
|
+
]
|
|
3423
|
+
}
|
|
3424
|
+
),
|
|
3425
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { role: "alert", className: "text-body-xs text-danger", children: error })
|
|
3426
|
+
] })
|
|
3427
|
+
);
|
|
2943
3428
|
}
|
|
2944
3429
|
|
|
2945
3430
|
// src/components/forms/tag-input.tsx
|
|
2946
|
-
var
|
|
2947
|
-
var
|
|
3431
|
+
var import_react24 = require("react");
|
|
3432
|
+
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
2948
3433
|
|
|
2949
3434
|
// src/components/status/badge.tsx
|
|
2950
|
-
var
|
|
2951
|
-
var
|
|
2952
|
-
var
|
|
3435
|
+
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
3436
|
+
var import_lucide_react7 = require("lucide-react");
|
|
3437
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2953
3438
|
var defaultClasses = {
|
|
2954
3439
|
gray: "bg-badge-gray text-badge-gray",
|
|
2955
3440
|
red: "bg-badge-red text-badge-red",
|
|
@@ -2962,15 +3447,15 @@ var defaultClasses = {
|
|
|
2962
3447
|
slate: "bg-badge-slate text-badge-slate"
|
|
2963
3448
|
};
|
|
2964
3449
|
var subtleClasses = {
|
|
2965
|
-
gray: "border border-badge-gray text-
|
|
2966
|
-
red: "border border-badge-red text-
|
|
2967
|
-
yellow: "border border-badge-yellow text-
|
|
2968
|
-
lime: "border border-badge-lime text-
|
|
2969
|
-
green: "border border-badge-green text-
|
|
2970
|
-
teal: "border border-badge-teal text-
|
|
2971
|
-
blue: "border border-badge-blue text-
|
|
2972
|
-
pink: "border border-badge-pink text-
|
|
2973
|
-
slate: "border border-badge-slate text-
|
|
3450
|
+
gray: "border border-badge-gray text-badge-gray",
|
|
3451
|
+
red: "border border-badge-red text-badge-red",
|
|
3452
|
+
yellow: "border border-badge-yellow text-badge-yellow",
|
|
3453
|
+
lime: "border border-badge-lime text-badge-lime",
|
|
3454
|
+
green: "border border-badge-green text-badge-green",
|
|
3455
|
+
teal: "border border-badge-teal text-badge-teal",
|
|
3456
|
+
blue: "border border-badge-blue text-badge-blue",
|
|
3457
|
+
pink: "border border-badge-pink text-badge-pink",
|
|
3458
|
+
slate: "border border-badge-slate text-badge-slate"
|
|
2974
3459
|
};
|
|
2975
3460
|
function Badge({
|
|
2976
3461
|
label,
|
|
@@ -2982,47 +3467,47 @@ function Badge({
|
|
|
2982
3467
|
className
|
|
2983
3468
|
}) {
|
|
2984
3469
|
const isDefault = variant === "default";
|
|
2985
|
-
return /* @__PURE__ */ (0,
|
|
3470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
2986
3471
|
"span",
|
|
2987
3472
|
{
|
|
2988
3473
|
"data-variant": variant,
|
|
2989
|
-
className: (0,
|
|
3474
|
+
className: (0, import_clsx23.default)(
|
|
2990
3475
|
"inline-flex items-center rounded-full px-2 py-0.5",
|
|
2991
3476
|
size2 === "sm" ? "gap-1" : "gap-1.5",
|
|
2992
3477
|
isDefault ? defaultClasses[color] : subtleClasses[color],
|
|
2993
3478
|
className
|
|
2994
3479
|
),
|
|
2995
3480
|
children: [
|
|
2996
|
-
indicator && /* @__PURE__ */ (0,
|
|
3481
|
+
indicator && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
2997
3482
|
"span",
|
|
2998
3483
|
{
|
|
2999
|
-
className: (0,
|
|
3484
|
+
className: (0, import_clsx23.default)(
|
|
3000
3485
|
"shrink-0 rounded-full bg-current",
|
|
3001
3486
|
size2 === "sm" ? "h-1.5 w-1.5" : "h-2 w-2"
|
|
3002
3487
|
)
|
|
3003
3488
|
}
|
|
3004
3489
|
),
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
3490
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3006
3491
|
"span",
|
|
3007
3492
|
{
|
|
3008
|
-
className: (0,
|
|
3493
|
+
className: (0, import_clsx23.default)(
|
|
3009
3494
|
"whitespace-nowrap",
|
|
3010
|
-
size2 === "sm" ? (0,
|
|
3495
|
+
size2 === "sm" ? (0, import_clsx23.default)("text-body-tiny", isDefault && "font-semibold") : "text-body-xs"
|
|
3011
3496
|
),
|
|
3012
3497
|
children: label
|
|
3013
3498
|
}
|
|
3014
3499
|
),
|
|
3015
|
-
onClose && /* @__PURE__ */ (0,
|
|
3500
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3016
3501
|
"button",
|
|
3017
3502
|
{
|
|
3018
3503
|
type: "button",
|
|
3019
3504
|
onClick: onClose,
|
|
3020
|
-
className: (0,
|
|
3505
|
+
className: (0, import_clsx23.default)(
|
|
3021
3506
|
"inline-flex shrink-0 items-center justify-center rounded-full opacity-60 transition-opacity hover:opacity-100",
|
|
3022
3507
|
size2 === "sm" ? "h-3 w-3" : "h-4 w-4"
|
|
3023
3508
|
),
|
|
3024
3509
|
"aria-label": `Remove ${label}`,
|
|
3025
|
-
children: /* @__PURE__ */ (0,
|
|
3510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react7.XIcon, { className: "h-full w-full", strokeWidth: 2.5, "aria-hidden": true })
|
|
3026
3511
|
}
|
|
3027
3512
|
)
|
|
3028
3513
|
]
|
|
@@ -3031,12 +3516,12 @@ function Badge({
|
|
|
3031
3516
|
}
|
|
3032
3517
|
|
|
3033
3518
|
// src/components/forms/tag-input.tsx
|
|
3034
|
-
var
|
|
3519
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3035
3520
|
var defaultParse = (raw) => ({ value: raw.trim() });
|
|
3036
3521
|
function TagInput({ label, hint, error, required, disabled, id, className, ...rest }) {
|
|
3037
|
-
const [parseError, setParseError] = (0,
|
|
3522
|
+
const [parseError, setParseError] = (0, import_react24.useState)(null);
|
|
3038
3523
|
const shownError = error ?? parseError ?? void 0;
|
|
3039
|
-
return /* @__PURE__ */ (0,
|
|
3524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3040
3525
|
Field,
|
|
3041
3526
|
{
|
|
3042
3527
|
id,
|
|
@@ -3046,9 +3531,9 @@ function TagInput({ label, hint, error, required, disabled, id, className, ...re
|
|
|
3046
3531
|
hasHint: Boolean(hint),
|
|
3047
3532
|
className,
|
|
3048
3533
|
children: [
|
|
3049
|
-
label && /* @__PURE__ */ (0,
|
|
3050
|
-
/* @__PURE__ */ (0,
|
|
3051
|
-
shownError ? /* @__PURE__ */ (0,
|
|
3534
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FieldLabel, { children: label }),
|
|
3535
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TagInputControl, { disabled, required, invalid: Boolean(shownError), onParseError: setParseError, ...rest }),
|
|
3536
|
+
shownError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FieldError, { children: shownError }) : hint && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FieldHint, { children: hint })
|
|
3052
3537
|
]
|
|
3053
3538
|
}
|
|
3054
3539
|
);
|
|
@@ -3078,9 +3563,9 @@ function TagInputControl({
|
|
|
3078
3563
|
delimiter.lastIndex = 0;
|
|
3079
3564
|
return delimiter.test(text);
|
|
3080
3565
|
};
|
|
3081
|
-
const [draft, setDraft] = (0,
|
|
3082
|
-
const [rejected, setRejected] = (0,
|
|
3083
|
-
(0,
|
|
3566
|
+
const [draft, setDraft] = (0, import_react24.useState)("");
|
|
3567
|
+
const [rejected, setRejected] = (0, import_react24.useState)(null);
|
|
3568
|
+
(0, import_react24.useEffect)(() => {
|
|
3084
3569
|
onParseError(rejected);
|
|
3085
3570
|
onInvalidChange?.(rejected !== null);
|
|
3086
3571
|
}, [rejected, onParseError, onInvalidChange]);
|
|
@@ -3125,7 +3610,7 @@ function TagInputControl({
|
|
|
3125
3610
|
event.preventDefault();
|
|
3126
3611
|
commit(`${draft}${text}`);
|
|
3127
3612
|
}
|
|
3128
|
-
return /* @__PURE__ */ (0,
|
|
3613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
3129
3614
|
"div",
|
|
3130
3615
|
{
|
|
3131
3616
|
"data-invalid": invalid || void 0,
|
|
@@ -3137,7 +3622,7 @@ function TagInputControl({
|
|
|
3137
3622
|
"data-[disabled]:cursor-not-allowed data-[disabled]:border-disabled data-[disabled]:bg-disabled"
|
|
3138
3623
|
),
|
|
3139
3624
|
children: [
|
|
3140
|
-
values.map((value) => /* @__PURE__ */ (0,
|
|
3625
|
+
values.map((value) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3141
3626
|
Badge,
|
|
3142
3627
|
{
|
|
3143
3628
|
label: value,
|
|
@@ -3146,7 +3631,7 @@ function TagInputControl({
|
|
|
3146
3631
|
},
|
|
3147
3632
|
value
|
|
3148
3633
|
)),
|
|
3149
|
-
/* @__PURE__ */ (0,
|
|
3634
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3150
3635
|
"input",
|
|
3151
3636
|
{
|
|
3152
3637
|
...field,
|
|
@@ -3162,30 +3647,30 @@ function TagInputControl({
|
|
|
3162
3647
|
onKeyDown: handleKeyDown,
|
|
3163
3648
|
onPaste: handlePaste,
|
|
3164
3649
|
onBlur: () => commit(draft),
|
|
3165
|
-
className: (0,
|
|
3650
|
+
className: (0, import_clsx24.default)(
|
|
3166
3651
|
"min-w-[8rem] flex-1 bg-transparent px-1 text-body-sm text-default outline-none",
|
|
3167
3652
|
"placeholder:text-default-tertiary disabled:cursor-not-allowed"
|
|
3168
3653
|
)
|
|
3169
3654
|
}
|
|
3170
3655
|
),
|
|
3171
|
-
name && values.map((value) => /* @__PURE__ */ (0,
|
|
3656
|
+
name && values.map((value) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { type: "hidden", name, value }, value))
|
|
3172
3657
|
]
|
|
3173
3658
|
}
|
|
3174
3659
|
);
|
|
3175
3660
|
}
|
|
3176
3661
|
|
|
3177
3662
|
// src/components/forms/form-card.tsx
|
|
3178
|
-
var
|
|
3179
|
-
var
|
|
3180
|
-
var
|
|
3663
|
+
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
3664
|
+
var import_lucide_react8 = require("lucide-react");
|
|
3665
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3181
3666
|
function FormCard({
|
|
3182
3667
|
children,
|
|
3183
3668
|
className
|
|
3184
3669
|
}) {
|
|
3185
|
-
return /* @__PURE__ */ (0,
|
|
3670
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3186
3671
|
"div",
|
|
3187
3672
|
{
|
|
3188
|
-
className: (0,
|
|
3673
|
+
className: (0, import_clsx25.default)(
|
|
3189
3674
|
"overflow-hidden rounded-xl border border-default bg-default",
|
|
3190
3675
|
className
|
|
3191
3676
|
),
|
|
@@ -3194,9 +3679,9 @@ function FormCard({
|
|
|
3194
3679
|
);
|
|
3195
3680
|
}
|
|
3196
3681
|
function FormCardHeader({ title, subtitle }) {
|
|
3197
|
-
return /* @__PURE__ */ (0,
|
|
3198
|
-
/* @__PURE__ */ (0,
|
|
3199
|
-
subtitle && /* @__PURE__ */ (0,
|
|
3682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "border-b border-default px-7 py-6", children: [
|
|
3683
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "text-heading-sm font-semibold text-default leading-snug", children: title }),
|
|
3684
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "mt-1 text-body-xs text-default-secondary", children: subtitle })
|
|
3200
3685
|
] });
|
|
3201
3686
|
}
|
|
3202
3687
|
function FormCardFooter({
|
|
@@ -3214,8 +3699,8 @@ function FormCardFooter({
|
|
|
3214
3699
|
// opens (WCAG 2.2 SC 2.4.11 Focus Not Obscured). Below `sm` Back/Continue share one
|
|
3215
3700
|
// full-width row and the draft action wraps under them; DOM order stays draft → back →
|
|
3216
3701
|
// continue for keyboards. Ported from SCIC in 0.7.0.
|
|
3217
|
-
/* @__PURE__ */ (0,
|
|
3218
|
-
onSaveDraft ? /* @__PURE__ */ (0,
|
|
3702
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-wrap items-center justify-between gap-3 border-t border-default px-4 py-4 sm:px-7 sm:py-5", children: [
|
|
3703
|
+
onSaveDraft ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3219
3704
|
Button,
|
|
3220
3705
|
{
|
|
3221
3706
|
variant: "neutral",
|
|
@@ -3225,25 +3710,25 @@ function FormCardFooter({
|
|
|
3225
3710
|
className: "order-last w-full justify-center sm:order-none sm:w-auto",
|
|
3226
3711
|
children: "Save as draft"
|
|
3227
3712
|
}
|
|
3228
|
-
) : /* @__PURE__ */ (0,
|
|
3229
|
-
/* @__PURE__ */ (0,
|
|
3230
|
-
!backDisabled && /* @__PURE__ */ (0,
|
|
3713
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "hidden sm:block" }),
|
|
3714
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex w-full items-center gap-2 sm:w-auto", children: [
|
|
3715
|
+
!backDisabled && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3231
3716
|
Button,
|
|
3232
3717
|
{
|
|
3233
3718
|
variant: "neutral",
|
|
3234
3719
|
size: "md",
|
|
3235
|
-
leadingIcon: /* @__PURE__ */ (0,
|
|
3720
|
+
leadingIcon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react8.ArrowLeftIcon, { "aria-hidden": true, size: 16 }),
|
|
3236
3721
|
onClick: onBack,
|
|
3237
3722
|
className: "flex-1 justify-center sm:flex-none",
|
|
3238
3723
|
children: "Back"
|
|
3239
3724
|
}
|
|
3240
3725
|
),
|
|
3241
|
-
/* @__PURE__ */ (0,
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3242
3727
|
Button,
|
|
3243
3728
|
{
|
|
3244
3729
|
variant: "primary",
|
|
3245
3730
|
size: "md",
|
|
3246
|
-
trailingIcon: continueIcon === null ? void 0 : continueIcon ?? /* @__PURE__ */ (0,
|
|
3731
|
+
trailingIcon: continueIcon === null ? void 0 : continueIcon ?? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react8.ArrowRightIcon, { "aria-hidden": true, size: 16 }),
|
|
3247
3732
|
onClick: onContinue,
|
|
3248
3733
|
disabled: continueDisabled,
|
|
3249
3734
|
className: "flex-1 justify-center sm:flex-none",
|
|
@@ -3256,8 +3741,8 @@ function FormCardFooter({
|
|
|
3256
3741
|
}
|
|
3257
3742
|
|
|
3258
3743
|
// src/components/status/role-badge.tsx
|
|
3259
|
-
var
|
|
3260
|
-
var
|
|
3744
|
+
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
3745
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3261
3746
|
var ROLE_TONES = {
|
|
3262
3747
|
"Super Admin": "slate",
|
|
3263
3748
|
"Admin": "slate",
|
|
@@ -3286,11 +3771,11 @@ var HEX6 = /^#[0-9a-fA-F]{6}$/;
|
|
|
3286
3771
|
function RoleBadge({ role, size: size2 = "sm", tone, color }) {
|
|
3287
3772
|
const rawColor = color && HEX6.test(color) ? color : void 0;
|
|
3288
3773
|
const resolved = tone ?? ROLE_TONES[role] ?? FALLBACK_TONE;
|
|
3289
|
-
return /* @__PURE__ */ (0,
|
|
3774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3290
3775
|
"span",
|
|
3291
3776
|
{
|
|
3292
3777
|
"data-tone": tone,
|
|
3293
|
-
className: (0,
|
|
3778
|
+
className: (0, import_clsx26.default)(
|
|
3294
3779
|
"inline-flex items-center rounded-full font-medium whitespace-nowrap",
|
|
3295
3780
|
size2 === "sm" ? "px-2 py-0.5 text-body-tiny" : "px-3 py-1 text-body-xs",
|
|
3296
3781
|
!rawColor && TONE_STYLES[resolved]
|
|
@@ -3302,10 +3787,10 @@ function RoleBadge({ role, size: size2 = "sm", tone, color }) {
|
|
|
3302
3787
|
}
|
|
3303
3788
|
|
|
3304
3789
|
// src/components/forms/combobox.tsx
|
|
3305
|
-
var
|
|
3306
|
-
var
|
|
3307
|
-
var
|
|
3308
|
-
var
|
|
3790
|
+
var import_react25 = require("react");
|
|
3791
|
+
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
3792
|
+
var import_lucide_react9 = require("lucide-react");
|
|
3793
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3309
3794
|
var HEIGHT = {
|
|
3310
3795
|
lg: "h-12 px-4 text-body",
|
|
3311
3796
|
md: "h-9 px-3 text-body-sm",
|
|
@@ -3333,23 +3818,23 @@ function Combobox({
|
|
|
3333
3818
|
defaultValue,
|
|
3334
3819
|
onChange: onValueChange
|
|
3335
3820
|
});
|
|
3336
|
-
const [open, setOpen] = (0,
|
|
3337
|
-
const [query, setQuery] = (0,
|
|
3338
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3339
|
-
const baseId = (0,
|
|
3821
|
+
const [open, setOpen] = (0, import_react25.useState)(false);
|
|
3822
|
+
const [query, setQuery] = (0, import_react25.useState)("");
|
|
3823
|
+
const [activeIndex, setActiveIndex] = (0, import_react25.useState)(0);
|
|
3824
|
+
const baseId = (0, import_react25.useId)();
|
|
3340
3825
|
const listboxId = `${baseId}-listbox`;
|
|
3341
3826
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
3342
|
-
const inputRef = (0,
|
|
3343
|
-
const listRef = (0,
|
|
3344
|
-
const rootRef = (0,
|
|
3827
|
+
const inputRef = (0, import_react25.useRef)(null);
|
|
3828
|
+
const listRef = (0, import_react25.useRef)(null);
|
|
3829
|
+
const rootRef = (0, import_react25.useRef)(null);
|
|
3345
3830
|
const field = useFieldControl();
|
|
3346
|
-
const matches = (0,
|
|
3831
|
+
const matches = (0, import_react25.useMemo)(() => {
|
|
3347
3832
|
const predicate = filter ?? ((option, q) => option.label.toLowerCase().includes(q.toLowerCase()));
|
|
3348
3833
|
return query ? options.filter((option) => predicate(option, query)) : options;
|
|
3349
3834
|
}, [options, query, filter]);
|
|
3350
3835
|
const selected = options.find((option) => option.value === value) ?? null;
|
|
3351
3836
|
const displayValue = open ? query : selected?.label ?? "";
|
|
3352
|
-
const close = (0,
|
|
3837
|
+
const close = (0, import_react25.useCallback)((restoreFocus = true) => {
|
|
3353
3838
|
setOpen(false);
|
|
3354
3839
|
setQuery("");
|
|
3355
3840
|
if (restoreFocus) inputRef.current?.focus();
|
|
@@ -3378,20 +3863,20 @@ function Combobox({
|
|
|
3378
3863
|
sideOffset: 4,
|
|
3379
3864
|
matchAnchorWidth: true
|
|
3380
3865
|
});
|
|
3381
|
-
(0,
|
|
3866
|
+
(0, import_react25.useEffect)(() => {
|
|
3382
3867
|
refs.setReference(rootRef.current);
|
|
3383
3868
|
}, [refs, open]);
|
|
3384
|
-
(0,
|
|
3869
|
+
(0, import_react25.useEffect)(() => {
|
|
3385
3870
|
setActiveIndex(0);
|
|
3386
3871
|
}, [query, options]);
|
|
3387
|
-
(0,
|
|
3872
|
+
(0, import_react25.useEffect)(() => {
|
|
3388
3873
|
if (!open) return;
|
|
3389
3874
|
const node = listRef.current?.querySelector(`#${CSS.escape(optionId(activeIndex))}`);
|
|
3390
3875
|
if (node instanceof Element && typeof node.scrollIntoView === "function") {
|
|
3391
3876
|
node.scrollIntoView({ block: "nearest" });
|
|
3392
3877
|
}
|
|
3393
3878
|
});
|
|
3394
|
-
(0,
|
|
3879
|
+
(0, import_react25.useEffect)(() => {
|
|
3395
3880
|
if (!open) return;
|
|
3396
3881
|
function onPointerDown(event) {
|
|
3397
3882
|
const withinRoot = rootRef.current?.contains(event.target);
|
|
@@ -3402,18 +3887,18 @@ function Combobox({
|
|
|
3402
3887
|
return () => document.removeEventListener("pointerdown", onPointerDown);
|
|
3403
3888
|
}, [open, close]);
|
|
3404
3889
|
let renderedGroup;
|
|
3405
|
-
return /* @__PURE__ */ (0,
|
|
3406
|
-
/* @__PURE__ */ (0,
|
|
3890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { ref: rootRef, className: (0, import_clsx27.default)("relative w-full", className), children: [
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3407
3892
|
"div",
|
|
3408
3893
|
{
|
|
3409
|
-
className: (0,
|
|
3894
|
+
className: (0, import_clsx27.default)(
|
|
3410
3895
|
"flex w-full items-center gap-2 rounded-lg border transition-colors",
|
|
3411
3896
|
HEIGHT[size2],
|
|
3412
3897
|
"focus-within:ring-2 focus-within:ring-offset-1 focus-within:ring-offset-default",
|
|
3413
3898
|
disabled ? "cursor-not-allowed border-disabled bg-disabled" : invalid || field["aria-invalid"] ? "border-danger-secondary focus-within:border-danger focus-within:ring-danger" : "border-default bg-default focus-within:border-brand focus-within:ring-brand"
|
|
3414
3899
|
),
|
|
3415
3900
|
children: [
|
|
3416
|
-
/* @__PURE__ */ (0,
|
|
3901
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3417
3902
|
"input",
|
|
3418
3903
|
{
|
|
3419
3904
|
ref: inputRef,
|
|
@@ -3475,18 +3960,18 @@ function Combobox({
|
|
|
3475
3960
|
break;
|
|
3476
3961
|
}
|
|
3477
3962
|
},
|
|
3478
|
-
className: (0,
|
|
3963
|
+
className: (0, import_clsx27.default)(
|
|
3479
3964
|
"min-w-0 flex-1 bg-transparent text-default outline-none",
|
|
3480
3965
|
"placeholder:text-default-tertiary",
|
|
3481
3966
|
"disabled:cursor-not-allowed disabled:text-disabled"
|
|
3482
3967
|
)
|
|
3483
3968
|
}
|
|
3484
3969
|
),
|
|
3485
|
-
/* @__PURE__ */ (0,
|
|
3486
|
-
|
|
3970
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3971
|
+
import_lucide_react9.ChevronDownIcon,
|
|
3487
3972
|
{
|
|
3488
3973
|
"aria-hidden": true,
|
|
3489
|
-
className: (0,
|
|
3974
|
+
className: (0, import_clsx27.default)(
|
|
3490
3975
|
"shrink-0 transition-transform",
|
|
3491
3976
|
size2 === "sm" ? "size-3" : "size-4",
|
|
3492
3977
|
disabled ? "text-icon-disabled" : "text-icon-default-secondary",
|
|
@@ -3497,7 +3982,7 @@ function Combobox({
|
|
|
3497
3982
|
]
|
|
3498
3983
|
}
|
|
3499
3984
|
),
|
|
3500
|
-
open && /* @__PURE__ */ (0,
|
|
3985
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
3501
3986
|
"div",
|
|
3502
3987
|
{
|
|
3503
3988
|
ref: (node) => {
|
|
@@ -3508,16 +3993,16 @@ function Combobox({
|
|
|
3508
3993
|
role: "listbox",
|
|
3509
3994
|
"aria-label": label,
|
|
3510
3995
|
style: { ...floatingStyles, width: "var(--panel-anchor-width)" },
|
|
3511
|
-
className: (0,
|
|
3996
|
+
className: (0, import_clsx27.default)("z-popover", OVERLAY_PANEL, OVERLAY_PANEL_SCROLL),
|
|
3512
3997
|
children: [
|
|
3513
|
-
matches.length === 0 && /* @__PURE__ */ (0,
|
|
3998
|
+
matches.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "px-2.5 py-2 text-body-xs text-default-secondary", children: emptyMessage }),
|
|
3514
3999
|
matches.map((option, index) => {
|
|
3515
4000
|
const isSelected = option.value === value;
|
|
3516
4001
|
const isActive = index === activeIndex;
|
|
3517
4002
|
const groupHeading = option.group !== renderedGroup ? option.group : void 0;
|
|
3518
4003
|
renderedGroup = option.group;
|
|
3519
|
-
return /* @__PURE__ */ (0,
|
|
3520
|
-
groupHeading && /* @__PURE__ */ (0,
|
|
4004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
4005
|
+
groupHeading && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3521
4006
|
"div",
|
|
3522
4007
|
{
|
|
3523
4008
|
role: "presentation",
|
|
@@ -3525,7 +4010,7 @@ function Combobox({
|
|
|
3525
4010
|
children: groupHeading
|
|
3526
4011
|
}
|
|
3527
4012
|
),
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
4013
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3529
4014
|
"div",
|
|
3530
4015
|
{
|
|
3531
4016
|
id: optionId(index),
|
|
@@ -3535,18 +4020,18 @@ function Combobox({
|
|
|
3535
4020
|
onPointerDown: (event) => event.preventDefault(),
|
|
3536
4021
|
onClick: () => commit(option),
|
|
3537
4022
|
onPointerEnter: () => !option.disabled && setActiveIndex(index),
|
|
3538
|
-
className: (0,
|
|
4023
|
+
className: (0, import_clsx27.default)(
|
|
3539
4024
|
OVERLAY_ITEM_BASE,
|
|
3540
4025
|
OVERLAY_ITEM_SIZE.md,
|
|
3541
4026
|
"items-center",
|
|
3542
|
-
option.disabled ? "cursor-not-allowed text-disabled" : isActive ? (0,
|
|
4027
|
+
option.disabled ? "cursor-not-allowed text-disabled" : isActive ? (0, import_clsx27.default)(OVERLAY_ITEM_ACTIVE, "text-default") : "text-default"
|
|
3543
4028
|
),
|
|
3544
|
-
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ (0,
|
|
3545
|
-
/* @__PURE__ */ (0,
|
|
3546
|
-
/* @__PURE__ */ (0,
|
|
3547
|
-
option.description && /* @__PURE__ */ (0,
|
|
4029
|
+
children: renderOption ? renderOption(option, isSelected) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
4031
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "block truncate", children: option.label }),
|
|
4032
|
+
option.description && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "block truncate text-body-tiny text-default-secondary", children: option.description })
|
|
3548
4033
|
] }),
|
|
3549
|
-
isSelected && /* @__PURE__ */ (0,
|
|
4034
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react9.CheckIcon, { "aria-hidden": true, className: "size-3.5 shrink-0 text-brand", strokeWidth: 3 })
|
|
3550
4035
|
] })
|
|
3551
4036
|
}
|
|
3552
4037
|
)
|
|
@@ -3559,7 +4044,7 @@ function Combobox({
|
|
|
3559
4044
|
}
|
|
3560
4045
|
|
|
3561
4046
|
// src/components/forms/role-combo-box.tsx
|
|
3562
|
-
var
|
|
4047
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3563
4048
|
var ROLE_COMBO_OPTIONS = [
|
|
3564
4049
|
{ role: "Reviewer", description: "Reviews onboarding requests" },
|
|
3565
4050
|
{ role: "Admin", description: "Full org control" },
|
|
@@ -3582,7 +4067,7 @@ function RoleComboBox({
|
|
|
3582
4067
|
label: option.role,
|
|
3583
4068
|
description: option.description
|
|
3584
4069
|
}));
|
|
3585
|
-
return /* @__PURE__ */ (0,
|
|
4070
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3586
4071
|
Combobox,
|
|
3587
4072
|
{
|
|
3588
4073
|
options: comboboxOptions,
|
|
@@ -3594,17 +4079,17 @@ function RoleComboBox({
|
|
|
3594
4079
|
clearable: false,
|
|
3595
4080
|
emptyMessage: "No roles match",
|
|
3596
4081
|
className,
|
|
3597
|
-
renderOption: (option) => /* @__PURE__ */ (0,
|
|
3598
|
-
/* @__PURE__ */ (0,
|
|
3599
|
-
/* @__PURE__ */ (0,
|
|
4082
|
+
renderOption: (option) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
4083
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(RoleBadge, { role: option.value, size: "sm" }),
|
|
4084
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "min-w-0 flex-1 truncate text-body-xs text-default-secondary", children: option.description })
|
|
3600
4085
|
] })
|
|
3601
4086
|
}
|
|
3602
4087
|
);
|
|
3603
4088
|
}
|
|
3604
4089
|
|
|
3605
4090
|
// src/components/forms/country-select.tsx
|
|
3606
|
-
var
|
|
3607
|
-
var
|
|
4091
|
+
var import_react26 = require("react");
|
|
4092
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3608
4093
|
var ISO_3166_ALPHA_2 = "AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW";
|
|
3609
4094
|
var COUNTRY_CODES = ISO_3166_ALPHA_2.split(" ");
|
|
3610
4095
|
function countryOptions(codes = COUNTRY_CODES, locale) {
|
|
@@ -3624,12 +4109,12 @@ function CountrySelect({
|
|
|
3624
4109
|
}) {
|
|
3625
4110
|
const keep = [props.value, props.defaultValue].filter((v) => !!v);
|
|
3626
4111
|
const keepKey = keep.join("|");
|
|
3627
|
-
const options = (0,
|
|
4112
|
+
const options = (0, import_react26.useMemo)(() => {
|
|
3628
4113
|
const list = countryOptions(countries, locale);
|
|
3629
4114
|
const missing = keep.filter((v) => !list.some((o) => o.value === v));
|
|
3630
4115
|
return [...countryOptions(missing, locale), ...list];
|
|
3631
4116
|
}, [countries, locale, keepKey]);
|
|
3632
|
-
return /* @__PURE__ */ (0,
|
|
4117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3633
4118
|
Combobox,
|
|
3634
4119
|
{
|
|
3635
4120
|
...props,
|
|
@@ -3645,8 +4130,8 @@ function CountrySelect({
|
|
|
3645
4130
|
}
|
|
3646
4131
|
|
|
3647
4132
|
// src/components/forms/time-zone-select.tsx
|
|
3648
|
-
var
|
|
3649
|
-
var
|
|
4133
|
+
var import_react27 = require("react");
|
|
4134
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3650
4135
|
var RENAMED = {
|
|
3651
4136
|
"America/Godthab": "America/Nuuk",
|
|
3652
4137
|
"Asia/Calcutta": "Asia/Kolkata",
|
|
@@ -3698,13 +4183,13 @@ function TimeZoneSelect({
|
|
|
3698
4183
|
const atTime = at?.getTime();
|
|
3699
4184
|
const keep = [props.value, props.defaultValue].filter((v) => !!v);
|
|
3700
4185
|
const keepKey = keep.join("|");
|
|
3701
|
-
const options = (0,
|
|
4186
|
+
const options = (0, import_react27.useMemo)(() => {
|
|
3702
4187
|
const when = atTime === void 0 ? /* @__PURE__ */ new Date() : new Date(atTime);
|
|
3703
4188
|
const list = timeZoneOptions(timeZones, when);
|
|
3704
4189
|
const missing = keep.filter((v) => !list.some((o) => o.value === v));
|
|
3705
4190
|
return [...missing.map((v) => zoneOption(v, when)), ...list];
|
|
3706
4191
|
}, [timeZones, atTime, keepKey]);
|
|
3707
|
-
return /* @__PURE__ */ (0,
|
|
4192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
3708
4193
|
Combobox,
|
|
3709
4194
|
{
|
|
3710
4195
|
...props,
|
|
@@ -3720,10 +4205,10 @@ function TimeZoneSelect({
|
|
|
3720
4205
|
}
|
|
3721
4206
|
|
|
3722
4207
|
// src/components/forms/command.tsx
|
|
3723
|
-
var
|
|
3724
|
-
var
|
|
3725
|
-
var
|
|
3726
|
-
var
|
|
4208
|
+
var import_react28 = require("react");
|
|
4209
|
+
var import_clsx28 = __toESM(require("clsx"), 1);
|
|
4210
|
+
var import_lucide_react10 = require("lucide-react");
|
|
4211
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
3727
4212
|
function Command({
|
|
3728
4213
|
items,
|
|
3729
4214
|
label = "Command palette",
|
|
@@ -3733,13 +4218,13 @@ function Command({
|
|
|
3733
4218
|
autoFocus = true,
|
|
3734
4219
|
className
|
|
3735
4220
|
}) {
|
|
3736
|
-
const [query, setQuery] = (0,
|
|
3737
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3738
|
-
const baseId = (0,
|
|
4221
|
+
const [query, setQuery] = (0, import_react28.useState)("");
|
|
4222
|
+
const [activeIndex, setActiveIndex] = (0, import_react28.useState)(0);
|
|
4223
|
+
const baseId = (0, import_react28.useId)();
|
|
3739
4224
|
const listboxId = `${baseId}-listbox`;
|
|
3740
4225
|
const optionId = (index) => `${baseId}-option-${index}`;
|
|
3741
|
-
const listRef = (0,
|
|
3742
|
-
const matches = (0,
|
|
4226
|
+
const listRef = (0, import_react28.useRef)(null);
|
|
4227
|
+
const matches = (0, import_react28.useMemo)(() => {
|
|
3743
4228
|
if (!query) return items;
|
|
3744
4229
|
const q = query.toLowerCase();
|
|
3745
4230
|
return items.filter((item) => {
|
|
@@ -3748,10 +4233,10 @@ function Command({
|
|
|
3748
4233
|
return item.keywords?.some((keyword) => keyword.toLowerCase().includes(q)) ?? false;
|
|
3749
4234
|
});
|
|
3750
4235
|
}, [items, query]);
|
|
3751
|
-
(0,
|
|
4236
|
+
(0, import_react28.useEffect)(() => {
|
|
3752
4237
|
setActiveIndex(0);
|
|
3753
4238
|
}, [query]);
|
|
3754
|
-
(0,
|
|
4239
|
+
(0, import_react28.useEffect)(() => {
|
|
3755
4240
|
const node = listRef.current?.querySelector(`#${CSS.escape(optionId(activeIndex))}`);
|
|
3756
4241
|
if (node instanceof Element && typeof node.scrollIntoView === "function") {
|
|
3757
4242
|
node.scrollIntoView({ block: "nearest" });
|
|
@@ -3774,10 +4259,10 @@ function Command({
|
|
|
3774
4259
|
});
|
|
3775
4260
|
};
|
|
3776
4261
|
let renderedGroup;
|
|
3777
|
-
return /* @__PURE__ */ (0,
|
|
3778
|
-
/* @__PURE__ */ (0,
|
|
3779
|
-
/* @__PURE__ */ (0,
|
|
3780
|
-
/* @__PURE__ */ (0,
|
|
4262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: (0, import_clsx28.default)("relative flex w-full flex-col", className), children: [
|
|
4263
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex items-center gap-2 border-b border-default px-3.5 py-3", children: [
|
|
4264
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react10.SearchIcon, { "aria-hidden": true, className: "size-4 shrink-0 text-icon-default-secondary" }),
|
|
4265
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3781
4266
|
"input",
|
|
3782
4267
|
{
|
|
3783
4268
|
role: "combobox",
|
|
@@ -3824,22 +4309,22 @@ function Command({
|
|
|
3824
4309
|
}
|
|
3825
4310
|
)
|
|
3826
4311
|
] }),
|
|
3827
|
-
/* @__PURE__ */ (0,
|
|
4312
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3828
4313
|
"div",
|
|
3829
4314
|
{
|
|
3830
4315
|
ref: listRef,
|
|
3831
4316
|
id: listboxId,
|
|
3832
4317
|
role: "listbox",
|
|
3833
4318
|
"aria-label": label,
|
|
3834
|
-
className: (0,
|
|
4319
|
+
className: (0, import_clsx28.default)("max-h-80 overflow-y-auto p-1.5", SCROLLBAR_CLASSES),
|
|
3835
4320
|
children: [
|
|
3836
|
-
matches.length === 0 && /* @__PURE__ */ (0,
|
|
4321
|
+
matches.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "px-2.5 py-6 text-center text-body-sm text-default-secondary", children: emptyMessage }),
|
|
3837
4322
|
matches.map((item, index) => {
|
|
3838
4323
|
const isActive = index === activeIndex;
|
|
3839
4324
|
const groupHeading = item.group !== renderedGroup ? item.group : void 0;
|
|
3840
4325
|
renderedGroup = item.group;
|
|
3841
|
-
return /* @__PURE__ */ (0,
|
|
3842
|
-
groupHeading && /* @__PURE__ */ (0,
|
|
4326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
4327
|
+
groupHeading && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
3843
4328
|
"div",
|
|
3844
4329
|
{
|
|
3845
4330
|
role: "presentation",
|
|
@@ -3847,7 +4332,7 @@ function Command({
|
|
|
3847
4332
|
children: groupHeading
|
|
3848
4333
|
}
|
|
3849
4334
|
),
|
|
3850
|
-
/* @__PURE__ */ (0,
|
|
4335
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
3851
4336
|
"div",
|
|
3852
4337
|
{
|
|
3853
4338
|
id: optionId(index),
|
|
@@ -3857,19 +4342,19 @@ function Command({
|
|
|
3857
4342
|
onPointerDown: (event) => event.preventDefault(),
|
|
3858
4343
|
onClick: () => run(item),
|
|
3859
4344
|
onPointerEnter: () => !item.disabled && setActiveIndex(index),
|
|
3860
|
-
className: (0,
|
|
4345
|
+
className: (0, import_clsx28.default)(
|
|
3861
4346
|
OVERLAY_ITEM_BASE,
|
|
3862
4347
|
OVERLAY_ITEM_SIZE.md,
|
|
3863
4348
|
"items-center",
|
|
3864
|
-
item.disabled ? "cursor-not-allowed text-disabled" : isActive ? (0,
|
|
4349
|
+
item.disabled ? "cursor-not-allowed text-disabled" : isActive ? (0, import_clsx28.default)(OVERLAY_ITEM_ACTIVE, "text-default") : "text-default"
|
|
3865
4350
|
),
|
|
3866
4351
|
children: [
|
|
3867
|
-
item.icon && /* @__PURE__ */ (0,
|
|
3868
|
-
/* @__PURE__ */ (0,
|
|
3869
|
-
/* @__PURE__ */ (0,
|
|
3870
|
-
item.description && /* @__PURE__ */ (0,
|
|
4352
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": true, className: "flex size-4 shrink-0 items-center justify-center", children: item.icon }),
|
|
4353
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { className: "min-w-0 flex-1", children: [
|
|
4354
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "block truncate", children: item.label }),
|
|
4355
|
+
item.description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "block truncate text-body-tiny text-default-secondary", children: item.description })
|
|
3871
4356
|
] }),
|
|
3872
|
-
item.shortcut && /* @__PURE__ */ (0,
|
|
4357
|
+
item.shortcut && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "ml-auto flex shrink-0 items-center gap-1", children: item.shortcut })
|
|
3873
4358
|
]
|
|
3874
4359
|
}
|
|
3875
4360
|
)
|
|
@@ -3878,13 +4363,13 @@ function Command({
|
|
|
3878
4363
|
]
|
|
3879
4364
|
}
|
|
3880
4365
|
),
|
|
3881
|
-
/* @__PURE__ */ (0,
|
|
4366
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-live": "polite", className: "sr-only", children: `${matches.length} ${matches.length === 1 ? "result" : "results"}` })
|
|
3882
4367
|
] });
|
|
3883
4368
|
}
|
|
3884
4369
|
|
|
3885
4370
|
// src/components/status/status-badge.tsx
|
|
3886
|
-
var
|
|
3887
|
-
var
|
|
4371
|
+
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
4372
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
3888
4373
|
var TONE_STYLES2 = {
|
|
3889
4374
|
neutral: "bg-status-neutral text-status-neutral",
|
|
3890
4375
|
info: "bg-status-info text-status-info",
|
|
@@ -3915,18 +4400,18 @@ function StatusBadge({
|
|
|
3915
4400
|
icon,
|
|
3916
4401
|
className
|
|
3917
4402
|
}) {
|
|
3918
|
-
return /* @__PURE__ */ (0,
|
|
4403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
3919
4404
|
"span",
|
|
3920
4405
|
{
|
|
3921
4406
|
"data-tone": tone,
|
|
3922
|
-
className: (0,
|
|
4407
|
+
className: (0, import_clsx29.default)(
|
|
3923
4408
|
"inline-flex items-center gap-1.5 rounded-full font-medium leading-tight whitespace-nowrap",
|
|
3924
4409
|
SIZE_STYLES[size2],
|
|
3925
4410
|
TONE_STYLES2[tone],
|
|
3926
4411
|
className
|
|
3927
4412
|
),
|
|
3928
4413
|
children: [
|
|
3929
|
-
icon ? /* @__PURE__ */ (0,
|
|
4414
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "shrink-0", children: icon }) : dot && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: (0, import_clsx29.default)("size-1.5 shrink-0 rounded-full", DOT_STYLES[tone]) }),
|
|
3930
4415
|
label
|
|
3931
4416
|
]
|
|
3932
4417
|
}
|
|
@@ -3934,8 +4419,8 @@ function StatusBadge({
|
|
|
3934
4419
|
}
|
|
3935
4420
|
|
|
3936
4421
|
// src/components/status/status-dot.tsx
|
|
3937
|
-
var
|
|
3938
|
-
var
|
|
4422
|
+
var import_clsx30 = __toESM(require("clsx"), 1);
|
|
4423
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
3939
4424
|
var dotTones = {
|
|
3940
4425
|
brand: "bg-brand",
|
|
3941
4426
|
positive: "bg-positive",
|
|
@@ -3945,63 +4430,63 @@ var dotTones = {
|
|
|
3945
4430
|
default: "bg-default-tertiary"
|
|
3946
4431
|
};
|
|
3947
4432
|
function StatusDot({ tone = "default", color, className }) {
|
|
3948
|
-
return /* @__PURE__ */ (0,
|
|
4433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3949
4434
|
"span",
|
|
3950
4435
|
{
|
|
3951
4436
|
"data-tone": tone,
|
|
3952
|
-
className: (0,
|
|
4437
|
+
className: (0, import_clsx30.default)("inline-block size-1.5 shrink-0 rounded-full", !color && dotTones[tone], className),
|
|
3953
4438
|
style: color ? { backgroundColor: color } : void 0
|
|
3954
4439
|
}
|
|
3955
4440
|
);
|
|
3956
4441
|
}
|
|
3957
4442
|
|
|
3958
4443
|
// src/components/status/status-chip.tsx
|
|
3959
|
-
var
|
|
3960
|
-
var
|
|
4444
|
+
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
4445
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3961
4446
|
function StatusChip({ label, count, tone = "default", dotColor, bg, className }) {
|
|
3962
|
-
return /* @__PURE__ */ (0,
|
|
4447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
3963
4448
|
"span",
|
|
3964
4449
|
{
|
|
3965
4450
|
"data-tone": tone,
|
|
3966
|
-
className: (0,
|
|
4451
|
+
className: (0, import_clsx31.default)(
|
|
3967
4452
|
"inline-flex items-center gap-1.5 rounded-full px-3 py-1",
|
|
3968
4453
|
!bg && "bg-default-secondary",
|
|
3969
4454
|
className
|
|
3970
4455
|
),
|
|
3971
4456
|
style: bg ? { backgroundColor: bg } : void 0,
|
|
3972
4457
|
children: [
|
|
3973
|
-
/* @__PURE__ */ (0,
|
|
3974
|
-
/* @__PURE__ */ (0,
|
|
3975
|
-
/* @__PURE__ */ (0,
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(StatusDot, { tone, color: dotColor }),
|
|
4459
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-body-xs font-medium text-default", children: count }),
|
|
4460
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-body-xs text-default-secondary", children: label })
|
|
3976
4461
|
]
|
|
3977
4462
|
}
|
|
3978
4463
|
);
|
|
3979
4464
|
}
|
|
3980
4465
|
|
|
3981
4466
|
// src/components/status/count-badge.tsx
|
|
3982
|
-
var
|
|
3983
|
-
var
|
|
4467
|
+
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
4468
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3984
4469
|
function CountBadge({ count, label, tone = "positive", className }) {
|
|
3985
|
-
return /* @__PURE__ */ (0,
|
|
4470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
3986
4471
|
"span",
|
|
3987
4472
|
{
|
|
3988
4473
|
"data-tone": tone,
|
|
3989
|
-
className: (0,
|
|
4474
|
+
className: (0, import_clsx32.default)(
|
|
3990
4475
|
"inline-flex items-center gap-1.5 rounded-full border border-default px-3 py-1 text-body-xs font-medium text-default",
|
|
3991
4476
|
className
|
|
3992
4477
|
),
|
|
3993
4478
|
children: [
|
|
3994
|
-
/* @__PURE__ */ (0,
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(StatusDot, { tone }),
|
|
3995
4480
|
count,
|
|
3996
|
-
label && /* @__PURE__ */ (0,
|
|
4481
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-default-secondary", children: label })
|
|
3997
4482
|
]
|
|
3998
4483
|
}
|
|
3999
4484
|
);
|
|
4000
4485
|
}
|
|
4001
4486
|
|
|
4002
4487
|
// src/components/status/tag-pill.tsx
|
|
4003
|
-
var
|
|
4004
|
-
var
|
|
4488
|
+
var import_clsx33 = __toESM(require("clsx"), 1);
|
|
4489
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
4005
4490
|
var toneStyles = {
|
|
4006
4491
|
default: "bg-default-secondary text-default-secondary",
|
|
4007
4492
|
brand: "bg-brand-tertiary text-brand",
|
|
@@ -4010,11 +4495,11 @@ var toneStyles = {
|
|
|
4010
4495
|
danger: "bg-danger-tertiary text-danger"
|
|
4011
4496
|
};
|
|
4012
4497
|
function TagPill({ label, tone = "default", bg, color, className }) {
|
|
4013
|
-
return /* @__PURE__ */ (0,
|
|
4498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
4014
4499
|
"span",
|
|
4015
4500
|
{
|
|
4016
4501
|
"data-tone": tone,
|
|
4017
|
-
className: (0,
|
|
4502
|
+
className: (0, import_clsx33.default)(
|
|
4018
4503
|
"inline-flex items-center rounded-full px-2 py-0.5 text-body-xs font-medium",
|
|
4019
4504
|
!bg && !color && toneStyles[tone],
|
|
4020
4505
|
className
|
|
@@ -4029,8 +4514,8 @@ function TagPill({ label, tone = "default", bg, color, className }) {
|
|
|
4029
4514
|
}
|
|
4030
4515
|
|
|
4031
4516
|
// src/components/status/trail-chip.tsx
|
|
4032
|
-
var
|
|
4033
|
-
var
|
|
4517
|
+
var import_clsx34 = __toESM(require("clsx"), 1);
|
|
4518
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
4034
4519
|
var DOT = {
|
|
4035
4520
|
neutral: "bg-status-dot-neutral",
|
|
4036
4521
|
info: "bg-status-dot-info",
|
|
@@ -4041,31 +4526,31 @@ var DOT = {
|
|
|
4041
4526
|
danger: "bg-status-dot-danger"
|
|
4042
4527
|
};
|
|
4043
4528
|
function TrailChip({ label, value, tone = "info", dotColor, className }) {
|
|
4044
|
-
return /* @__PURE__ */ (0,
|
|
4529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
4045
4530
|
"div",
|
|
4046
4531
|
{
|
|
4047
4532
|
"data-tone": tone,
|
|
4048
|
-
className: (0,
|
|
4533
|
+
className: (0, import_clsx34.default)(
|
|
4049
4534
|
"flex items-center gap-2 rounded-full border border-default bg-default px-3 py-1.5",
|
|
4050
4535
|
className
|
|
4051
4536
|
),
|
|
4052
4537
|
children: [
|
|
4053
|
-
/* @__PURE__ */ (0,
|
|
4538
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
4054
4539
|
"span",
|
|
4055
4540
|
{
|
|
4056
|
-
className: (0,
|
|
4541
|
+
className: (0, import_clsx34.default)("size-1.5 shrink-0 rounded-full", !dotColor && DOT[tone]),
|
|
4057
4542
|
style: dotColor ? { backgroundColor: dotColor } : void 0
|
|
4058
4543
|
}
|
|
4059
4544
|
),
|
|
4060
|
-
/* @__PURE__ */ (0,
|
|
4061
|
-
/* @__PURE__ */ (0,
|
|
4545
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-body-tiny font-semibold uppercase tracking-wide text-default-secondary", children: label }),
|
|
4546
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "text-body-xs font-medium text-default", children: value })
|
|
4062
4547
|
]
|
|
4063
4548
|
}
|
|
4064
4549
|
);
|
|
4065
4550
|
}
|
|
4066
4551
|
|
|
4067
4552
|
// src/components/status/user-status-pill.tsx
|
|
4068
|
-
var
|
|
4553
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
4069
4554
|
var STATUS_META = {
|
|
4070
4555
|
active: { label: "Active", tone: "positive" },
|
|
4071
4556
|
// `caution` (pale yellow), not `warning` (orange) — Pending is one step below a
|
|
@@ -4075,13 +4560,13 @@ var STATUS_META = {
|
|
|
4075
4560
|
};
|
|
4076
4561
|
function UserStatusPill({ status }) {
|
|
4077
4562
|
const { label, tone } = STATUS_META[status];
|
|
4078
|
-
return /* @__PURE__ */ (0,
|
|
4563
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(StatusBadge, { label, tone });
|
|
4079
4564
|
}
|
|
4080
4565
|
|
|
4081
4566
|
// src/components/status/check-indicator.tsx
|
|
4082
|
-
var
|
|
4083
|
-
var
|
|
4084
|
-
var
|
|
4567
|
+
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
4568
|
+
var import_lucide_react11 = require("lucide-react");
|
|
4569
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
4085
4570
|
var STATUS_STYLES = {
|
|
4086
4571
|
passed: "bg-status-check-passed border-status-check-passed text-status-check-passed",
|
|
4087
4572
|
in_progress: "bg-status-check-progress border-status-check-progress text-status-check-progress",
|
|
@@ -4093,25 +4578,25 @@ var STATUS_STYLES = {
|
|
|
4093
4578
|
function StatusGlyph({ status }) {
|
|
4094
4579
|
switch (status) {
|
|
4095
4580
|
case "passed":
|
|
4096
|
-
return /* @__PURE__ */ (0,
|
|
4581
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.CheckIcon, { className: "size-3", strokeWidth: 3, "aria-hidden": true });
|
|
4097
4582
|
case "failed":
|
|
4098
|
-
return /* @__PURE__ */ (0,
|
|
4583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.XIcon, { className: "size-3", strokeWidth: 3, "aria-hidden": true });
|
|
4099
4584
|
case "waived":
|
|
4100
|
-
return /* @__PURE__ */ (0,
|
|
4585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.MinusIcon, { className: "size-3", strokeWidth: 3, "aria-hidden": true });
|
|
4101
4586
|
case "in_progress":
|
|
4102
|
-
return /* @__PURE__ */ (0,
|
|
4587
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.LoaderCircleIcon, { className: "size-3", strokeWidth: 3, "aria-hidden": true });
|
|
4103
4588
|
case "action_required":
|
|
4104
|
-
return /* @__PURE__ */ (0,
|
|
4589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react11.CircleAlertIcon, { className: "size-3.5", strokeWidth: 2.5, "aria-hidden": true });
|
|
4105
4590
|
case "pending":
|
|
4106
4591
|
return null;
|
|
4107
4592
|
}
|
|
4108
4593
|
}
|
|
4109
4594
|
function CheckIndicator({ status, label, className }) {
|
|
4110
|
-
return /* @__PURE__ */ (0,
|
|
4595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
4111
4596
|
"div",
|
|
4112
4597
|
{
|
|
4113
4598
|
"data-status": status,
|
|
4114
|
-
className: (0,
|
|
4599
|
+
className: (0, import_clsx35.default)(
|
|
4115
4600
|
"flex size-[22px] shrink-0 items-center justify-center rounded-full border-[1.5px]",
|
|
4116
4601
|
STATUS_STYLES[status],
|
|
4117
4602
|
className
|
|
@@ -4119,14 +4604,14 @@ function CheckIndicator({ status, label, className }) {
|
|
|
4119
4604
|
role: label ? "img" : void 0,
|
|
4120
4605
|
"aria-label": label,
|
|
4121
4606
|
"aria-hidden": label ? void 0 : true,
|
|
4122
|
-
children: /* @__PURE__ */ (0,
|
|
4607
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(StatusGlyph, { status })
|
|
4123
4608
|
}
|
|
4124
4609
|
);
|
|
4125
4610
|
}
|
|
4126
4611
|
|
|
4127
4612
|
// src/components/status/entity-icon-badge.tsx
|
|
4128
|
-
var
|
|
4129
|
-
var
|
|
4613
|
+
var import_clsx36 = __toESM(require("clsx"), 1);
|
|
4614
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
4130
4615
|
var sizeStyles4 = {
|
|
4131
4616
|
sm: "size-8",
|
|
4132
4617
|
md: "size-10"
|
|
@@ -4144,11 +4629,11 @@ var toneStyles2 = {
|
|
|
4144
4629
|
neutral: "bg-neutral-tertiary text-icon-neutral"
|
|
4145
4630
|
};
|
|
4146
4631
|
function EntityIconBadge({ size: size2 = "sm", tone = "default", shape = "square", bg, iconColor, children, className }) {
|
|
4147
|
-
return /* @__PURE__ */ (0,
|
|
4632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4148
4633
|
"span",
|
|
4149
4634
|
{
|
|
4150
4635
|
"data-tone": tone,
|
|
4151
|
-
className: (0,
|
|
4636
|
+
className: (0, import_clsx36.default)(
|
|
4152
4637
|
"inline-flex shrink-0 items-center justify-center",
|
|
4153
4638
|
sizeStyles4[size2],
|
|
4154
4639
|
shapeStyles[shape][size2],
|
|
@@ -4165,13 +4650,13 @@ function EntityIconBadge({ size: size2 = "sm", tone = "default", shape = "square
|
|
|
4165
4650
|
}
|
|
4166
4651
|
|
|
4167
4652
|
// src/components/forms/checkbox.tsx
|
|
4168
|
-
var
|
|
4169
|
-
var
|
|
4653
|
+
var import_react29 = require("react");
|
|
4654
|
+
var import_clsx38 = __toESM(require("clsx"), 1);
|
|
4170
4655
|
|
|
4171
4656
|
// src/components/forms/check-control.tsx
|
|
4172
|
-
var
|
|
4173
|
-
var
|
|
4174
|
-
var
|
|
4657
|
+
var import_clsx37 = __toESM(require("clsx"), 1);
|
|
4658
|
+
var import_lucide_react12 = require("lucide-react");
|
|
4659
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
4175
4660
|
var CHECK_SIZE = {
|
|
4176
4661
|
sm: { box: "size-4", glyph: "size-2.5", dot: "size-1.5" },
|
|
4177
4662
|
md: { box: "size-[18px]", glyph: "size-3", dot: "size-2" }
|
|
@@ -4186,11 +4671,11 @@ function CheckControl({
|
|
|
4186
4671
|
}) {
|
|
4187
4672
|
const s = CHECK_SIZE[size2];
|
|
4188
4673
|
const on = checked || indeterminate;
|
|
4189
|
-
return /* @__PURE__ */ (0,
|
|
4674
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
4190
4675
|
"span",
|
|
4191
4676
|
{
|
|
4192
4677
|
"aria-hidden": true,
|
|
4193
|
-
className: (0,
|
|
4678
|
+
className: (0, import_clsx37.default)(
|
|
4194
4679
|
"mt-px flex shrink-0 items-center justify-center border-[1.5px] transition-colors",
|
|
4195
4680
|
s.box,
|
|
4196
4681
|
type === "radio" ? "rounded-full" : "rounded-[4px]",
|
|
@@ -4199,18 +4684,18 @@ function CheckControl({
|
|
|
4199
4684
|
"peer-focus-visible:ring-2 peer-focus-visible:ring-brand peer-focus-visible:ring-offset-1 peer-focus-visible:ring-offset-default",
|
|
4200
4685
|
disabled ? on ? "border-disabled bg-disabled text-disabled-on-disabled" : "border-disabled bg-disabled" : on ? "border-brand-emphasis bg-brand text-brand-on-brand" : invalid ? "border-danger bg-default" : "border-default-secondary bg-default"
|
|
4201
4686
|
),
|
|
4202
|
-
children: type === "checkbox" ? indeterminate ? /* @__PURE__ */ (0,
|
|
4687
|
+
children: type === "checkbox" ? indeterminate ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react12.MinusIcon, { className: s.glyph, strokeWidth: 3 }) : checked ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react12.CheckIcon, { className: s.glyph, strokeWidth: 3 }) : null : checked ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { className: (0, import_clsx37.default)("rounded-full bg-current", s.dot) }) : null
|
|
4203
4688
|
}
|
|
4204
4689
|
);
|
|
4205
4690
|
}
|
|
4206
4691
|
|
|
4207
4692
|
// src/components/forms/checkbox.tsx
|
|
4208
|
-
var
|
|
4693
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
4209
4694
|
var LABEL_TEXT2 = {
|
|
4210
4695
|
sm: "text-body-tiny",
|
|
4211
4696
|
md: "text-body-xs"
|
|
4212
4697
|
};
|
|
4213
|
-
var Checkbox = (0,
|
|
4698
|
+
var Checkbox = (0, import_react29.forwardRef)(function Checkbox2({
|
|
4214
4699
|
checked: checkedProp,
|
|
4215
4700
|
defaultChecked = false,
|
|
4216
4701
|
onCheckedChange,
|
|
@@ -4229,24 +4714,27 @@ var Checkbox = (0, import_react27.forwardRef)(function Checkbox2({
|
|
|
4229
4714
|
defaultValue: defaultChecked,
|
|
4230
4715
|
onChange: onCheckedChange
|
|
4231
4716
|
});
|
|
4232
|
-
const inputRef = (0,
|
|
4233
|
-
const generatedId = (0,
|
|
4717
|
+
const inputRef = (0, import_react29.useRef)(null);
|
|
4718
|
+
const generatedId = (0, import_react29.useId)();
|
|
4234
4719
|
const controlId = id ?? generatedId;
|
|
4235
4720
|
const descriptionId = `${controlId}-description`;
|
|
4236
|
-
(0,
|
|
4721
|
+
(0, import_react29.useEffect)(() => {
|
|
4237
4722
|
if (inputRef.current) inputRef.current.indeterminate = indeterminate;
|
|
4238
4723
|
}, [indeterminate]);
|
|
4239
|
-
return /* @__PURE__ */ (0,
|
|
4240
|
-
/* @__PURE__ */ (0,
|
|
4724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx38.default)("flex flex-col", className), children: [
|
|
4725
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4241
4726
|
"label",
|
|
4242
4727
|
{
|
|
4243
4728
|
htmlFor: controlId,
|
|
4244
|
-
className: (0,
|
|
4245
|
-
|
|
4729
|
+
className: (0, import_clsx38.default)(
|
|
4730
|
+
// relative: the hidden input is absolutely positioned (sr-only). Without a positioned
|
|
4731
|
+
// ancestor here its box lands far up the page, and focusing it on click scrolled a
|
|
4732
|
+
// scrolling container to that spot, away from the control.
|
|
4733
|
+
"group relative inline-flex items-start gap-2.5",
|
|
4246
4734
|
disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"
|
|
4247
4735
|
),
|
|
4248
4736
|
children: [
|
|
4249
|
-
/* @__PURE__ */ (0,
|
|
4737
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4250
4738
|
"input",
|
|
4251
4739
|
{
|
|
4252
4740
|
ref: composeRefs(inputRef, ref),
|
|
@@ -4261,7 +4749,7 @@ var Checkbox = (0, import_react27.forwardRef)(function Checkbox2({
|
|
|
4261
4749
|
...props
|
|
4262
4750
|
}
|
|
4263
4751
|
),
|
|
4264
|
-
/* @__PURE__ */ (0,
|
|
4752
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4265
4753
|
CheckControl,
|
|
4266
4754
|
{
|
|
4267
4755
|
type: "checkbox",
|
|
@@ -4272,15 +4760,15 @@ var Checkbox = (0, import_react27.forwardRef)(function Checkbox2({
|
|
|
4272
4760
|
size: size2
|
|
4273
4761
|
}
|
|
4274
4762
|
),
|
|
4275
|
-
label && /* @__PURE__ */ (0,
|
|
4763
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: (0, import_clsx38.default)(LABEL_TEXT2[size2], "text-default"), children: label })
|
|
4276
4764
|
]
|
|
4277
4765
|
}
|
|
4278
4766
|
),
|
|
4279
|
-
description && /* @__PURE__ */ (0,
|
|
4767
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4280
4768
|
"span",
|
|
4281
4769
|
{
|
|
4282
4770
|
id: descriptionId,
|
|
4283
|
-
className: (0,
|
|
4771
|
+
className: (0, import_clsx38.default)(
|
|
4284
4772
|
"mt-0.5 pl-[26px]",
|
|
4285
4773
|
LABEL_TEXT2[size2],
|
|
4286
4774
|
disabled ? "text-disabled" : "text-default-secondary"
|
|
@@ -4292,12 +4780,13 @@ var Checkbox = (0, import_react27.forwardRef)(function Checkbox2({
|
|
|
4292
4780
|
});
|
|
4293
4781
|
|
|
4294
4782
|
// src/components/forms/radio-group.tsx
|
|
4295
|
-
var
|
|
4296
|
-
var
|
|
4297
|
-
var
|
|
4298
|
-
var RadioGroupContext = (0,
|
|
4299
|
-
var RadioGroup = (0,
|
|
4783
|
+
var import_react30 = require("react");
|
|
4784
|
+
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
4785
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4786
|
+
var RadioGroupContext = (0, import_react30.createContext)(null);
|
|
4787
|
+
var RadioGroup = (0, import_react30.forwardRef)(function RadioGroup2({
|
|
4300
4788
|
children,
|
|
4789
|
+
options,
|
|
4301
4790
|
value: valueProp,
|
|
4302
4791
|
defaultValue,
|
|
4303
4792
|
onValueChange,
|
|
@@ -4311,13 +4800,13 @@ var RadioGroup = (0, import_react28.forwardRef)(function RadioGroup2({
|
|
|
4311
4800
|
className,
|
|
4312
4801
|
...rest
|
|
4313
4802
|
}, ref) {
|
|
4314
|
-
const generatedName = (0,
|
|
4803
|
+
const generatedName = (0, import_react30.useId)();
|
|
4315
4804
|
const [value, setValue] = useControllableState({
|
|
4316
4805
|
value: valueProp,
|
|
4317
4806
|
defaultValue,
|
|
4318
4807
|
onChange: onValueChange
|
|
4319
4808
|
});
|
|
4320
|
-
return /* @__PURE__ */ (0,
|
|
4809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4321
4810
|
RadioGroupContext.Provider,
|
|
4322
4811
|
{
|
|
4323
4812
|
value: {
|
|
@@ -4328,7 +4817,7 @@ var RadioGroup = (0, import_react28.forwardRef)(function RadioGroup2({
|
|
|
4328
4817
|
disabled,
|
|
4329
4818
|
invalid
|
|
4330
4819
|
},
|
|
4331
|
-
children: /* @__PURE__ */ (0,
|
|
4820
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4332
4821
|
"div",
|
|
4333
4822
|
{
|
|
4334
4823
|
ref,
|
|
@@ -4338,13 +4827,22 @@ var RadioGroup = (0, import_react28.forwardRef)(function RadioGroup2({
|
|
|
4338
4827
|
"aria-invalid": invalid || void 0,
|
|
4339
4828
|
"aria-orientation": orientation,
|
|
4340
4829
|
"data-slot": "radio-group",
|
|
4341
|
-
className: (0,
|
|
4830
|
+
className: (0, import_clsx39.default)(
|
|
4342
4831
|
"flex",
|
|
4343
4832
|
orientation === "vertical" ? "flex-col gap-2.5" : "flex-row flex-wrap gap-4",
|
|
4344
4833
|
className
|
|
4345
4834
|
),
|
|
4346
4835
|
...rest,
|
|
4347
|
-
children
|
|
4836
|
+
children: options ? options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4837
|
+
Radio,
|
|
4838
|
+
{
|
|
4839
|
+
value: option.value,
|
|
4840
|
+
label: option.label,
|
|
4841
|
+
description: option.description,
|
|
4842
|
+
disabled: option.disabled
|
|
4843
|
+
},
|
|
4844
|
+
option.value
|
|
4845
|
+
)) : children
|
|
4348
4846
|
}
|
|
4349
4847
|
)
|
|
4350
4848
|
}
|
|
@@ -4354,25 +4852,28 @@ var LABEL_TEXT3 = {
|
|
|
4354
4852
|
sm: "text-body-tiny",
|
|
4355
4853
|
md: "text-body-xs"
|
|
4356
4854
|
};
|
|
4357
|
-
var Radio = (0,
|
|
4358
|
-
const group = (0,
|
|
4855
|
+
var Radio = (0, import_react30.forwardRef)(function Radio2({ value, label, description, disabled, id, className, ...props }, ref) {
|
|
4856
|
+
const group = (0, import_react30.useContext)(RadioGroupContext);
|
|
4359
4857
|
if (!group) throw new Error("<Radio> must be used inside <RadioGroup>");
|
|
4360
|
-
const generatedId = (0,
|
|
4858
|
+
const generatedId = (0, import_react30.useId)();
|
|
4361
4859
|
const controlId = id ?? generatedId;
|
|
4362
4860
|
const descriptionId = `${controlId}-description`;
|
|
4363
4861
|
const isDisabled = disabled ?? group.disabled;
|
|
4364
4862
|
const checked = group.value === value;
|
|
4365
|
-
return /* @__PURE__ */ (0,
|
|
4366
|
-
/* @__PURE__ */ (0,
|
|
4863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: (0, import_clsx39.default)("flex flex-col", className), children: [
|
|
4864
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
4367
4865
|
"label",
|
|
4368
4866
|
{
|
|
4369
4867
|
htmlFor: controlId,
|
|
4370
|
-
className: (0,
|
|
4371
|
-
|
|
4868
|
+
className: (0, import_clsx39.default)(
|
|
4869
|
+
// relative: the hidden input is absolutely positioned (sr-only). Without a positioned
|
|
4870
|
+
// ancestor here its box lands far up the page, and focusing it on click scrolled a
|
|
4871
|
+
// scrolling container to that spot, away from the control.
|
|
4872
|
+
"group relative inline-flex items-start gap-2.5",
|
|
4372
4873
|
isDisabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"
|
|
4373
4874
|
),
|
|
4374
4875
|
children: [
|
|
4375
|
-
/* @__PURE__ */ (0,
|
|
4876
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4376
4877
|
"input",
|
|
4377
4878
|
{
|
|
4378
4879
|
ref,
|
|
@@ -4388,7 +4889,7 @@ var Radio = (0, import_react28.forwardRef)(function Radio2({ value, label, descr
|
|
|
4388
4889
|
...props
|
|
4389
4890
|
}
|
|
4390
4891
|
),
|
|
4391
|
-
/* @__PURE__ */ (0,
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4392
4893
|
CheckControl,
|
|
4393
4894
|
{
|
|
4394
4895
|
type: "radio",
|
|
@@ -4398,15 +4899,15 @@ var Radio = (0, import_react28.forwardRef)(function Radio2({ value, label, descr
|
|
|
4398
4899
|
size: group.size
|
|
4399
4900
|
}
|
|
4400
4901
|
),
|
|
4401
|
-
label && /* @__PURE__ */ (0,
|
|
4902
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: (0, import_clsx39.default)(LABEL_TEXT3[group.size], "text-default"), children: label })
|
|
4402
4903
|
]
|
|
4403
4904
|
}
|
|
4404
4905
|
),
|
|
4405
|
-
description && /* @__PURE__ */ (0,
|
|
4906
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4406
4907
|
"span",
|
|
4407
4908
|
{
|
|
4408
4909
|
id: descriptionId,
|
|
4409
|
-
className: (0,
|
|
4910
|
+
className: (0, import_clsx39.default)(
|
|
4410
4911
|
"mt-0.5 pl-[26px]",
|
|
4411
4912
|
LABEL_TEXT3[group.size],
|
|
4412
4913
|
isDisabled ? "text-disabled" : "text-default-secondary"
|
|
@@ -4418,12 +4919,13 @@ var Radio = (0, import_react28.forwardRef)(function Radio2({ value, label, descr
|
|
|
4418
4919
|
});
|
|
4419
4920
|
|
|
4420
4921
|
// src/components/forms/radio-cards.tsx
|
|
4421
|
-
var
|
|
4422
|
-
var
|
|
4423
|
-
var
|
|
4424
|
-
var RadioCardsContext = (0,
|
|
4425
|
-
var RadioCards = (0,
|
|
4922
|
+
var import_react31 = require("react");
|
|
4923
|
+
var import_clsx40 = __toESM(require("clsx"), 1);
|
|
4924
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4925
|
+
var RadioCardsContext = (0, import_react31.createContext)(null);
|
|
4926
|
+
var RadioCards = (0, import_react31.forwardRef)(function RadioCards2({
|
|
4426
4927
|
children,
|
|
4928
|
+
options,
|
|
4427
4929
|
value: valueProp,
|
|
4428
4930
|
defaultValue,
|
|
4429
4931
|
onValueChange,
|
|
@@ -4435,17 +4937,17 @@ var RadioCards = (0, import_react29.forwardRef)(function RadioCards2({
|
|
|
4435
4937
|
className,
|
|
4436
4938
|
...rest
|
|
4437
4939
|
}, ref) {
|
|
4438
|
-
const generatedName = (0,
|
|
4940
|
+
const generatedName = (0, import_react31.useId)();
|
|
4439
4941
|
const [value, setValue] = useControllableState({
|
|
4440
4942
|
value: valueProp,
|
|
4441
4943
|
defaultValue,
|
|
4442
4944
|
onChange: onValueChange
|
|
4443
4945
|
});
|
|
4444
|
-
return /* @__PURE__ */ (0,
|
|
4946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4445
4947
|
RadioCardsContext.Provider,
|
|
4446
4948
|
{
|
|
4447
4949
|
value: { name: name ?? generatedName, value, setValue, size: size2, disabled, required },
|
|
4448
|
-
children: /* @__PURE__ */ (0,
|
|
4950
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4449
4951
|
"div",
|
|
4450
4952
|
{
|
|
4451
4953
|
ref,
|
|
@@ -4455,7 +4957,7 @@ var RadioCards = (0, import_react29.forwardRef)(function RadioCards2({
|
|
|
4455
4957
|
"data-slot": "radio-cards",
|
|
4456
4958
|
className: cn("grid gap-3", className),
|
|
4457
4959
|
...rest,
|
|
4458
|
-
children
|
|
4960
|
+
children: options ? options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(RadioCardsItem, { ...option }, option.value)) : children
|
|
4459
4961
|
}
|
|
4460
4962
|
)
|
|
4461
4963
|
}
|
|
@@ -4465,14 +4967,14 @@ var SIZE6 = {
|
|
|
4465
4967
|
default: { pad: "p-4", iconBox: "size-10 rounded-xl", icon: "size-5", mark: "size-5", gap: "mt-3", title: "text-body-sm" },
|
|
4466
4968
|
sm: { pad: "p-3", iconBox: "size-8 rounded-lg", icon: "size-4", mark: "size-4", gap: "mt-2", title: "text-body-xs" }
|
|
4467
4969
|
};
|
|
4468
|
-
var RadioCardsItem = (0,
|
|
4469
|
-
const group = (0,
|
|
4970
|
+
var RadioCardsItem = (0, import_react31.forwardRef)(function RadioCardsItem2({ value, title, description, icon, disabled: itemDisabled = false, className }, ref) {
|
|
4971
|
+
const group = (0, import_react31.useContext)(RadioCardsContext);
|
|
4470
4972
|
if (!group) throw new Error("<RadioCardsItem> must be used inside <RadioCards>");
|
|
4471
4973
|
const s = SIZE6[group.size];
|
|
4472
4974
|
const disabled = group.disabled || itemDisabled;
|
|
4473
|
-
const titleId = (0,
|
|
4474
|
-
const descriptionId = (0,
|
|
4475
|
-
return /* @__PURE__ */ (0,
|
|
4975
|
+
const titleId = (0, import_react31.useId)();
|
|
4976
|
+
const descriptionId = (0, import_react31.useId)();
|
|
4977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
4476
4978
|
"label",
|
|
4477
4979
|
{
|
|
4478
4980
|
"data-slot": "radio-cards-item",
|
|
@@ -4487,7 +4989,7 @@ var RadioCardsItem = (0, import_react29.forwardRef)(function RadioCardsItem2({ v
|
|
|
4487
4989
|
className
|
|
4488
4990
|
),
|
|
4489
4991
|
children: [
|
|
4490
|
-
/* @__PURE__ */ (0,
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4491
4993
|
"input",
|
|
4492
4994
|
{
|
|
4493
4995
|
ref,
|
|
@@ -4503,35 +5005,35 @@ var RadioCardsItem = (0, import_react29.forwardRef)(function RadioCardsItem2({ v
|
|
|
4503
5005
|
className: "sr-only"
|
|
4504
5006
|
}
|
|
4505
5007
|
),
|
|
4506
|
-
/* @__PURE__ */ (0,
|
|
4507
|
-
icon ? /* @__PURE__ */ (0,
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "flex items-start justify-between gap-2", children: [
|
|
5009
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4508
5010
|
"span",
|
|
4509
5011
|
{
|
|
4510
5012
|
"aria-hidden": true,
|
|
4511
|
-
className: (0,
|
|
5013
|
+
className: (0, import_clsx40.default)(
|
|
4512
5014
|
"flex shrink-0 items-center justify-center bg-brand-tertiary",
|
|
4513
5015
|
"[label:has(:checked)_&]:bg-brand",
|
|
4514
5016
|
s.iconBox
|
|
4515
5017
|
),
|
|
4516
|
-
children: /* @__PURE__ */ (0,
|
|
5018
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: (0, import_clsx40.default)(s.icon, "text-icon-brand [label:has(:checked)_&]:text-icon-brand-on-brand"), children: icon })
|
|
4517
5019
|
}
|
|
4518
|
-
) : /* @__PURE__ */ (0,
|
|
4519
|
-
/* @__PURE__ */ (0,
|
|
5020
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", {}),
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
4520
5022
|
"span",
|
|
4521
5023
|
{
|
|
4522
5024
|
"aria-hidden": true,
|
|
4523
|
-
className: (0,
|
|
5025
|
+
className: (0, import_clsx40.default)(
|
|
4524
5026
|
"flex shrink-0 items-center justify-center rounded-full border-2 border-default",
|
|
4525
5027
|
"[label:has(:checked)_&]:border-brand",
|
|
4526
5028
|
s.mark
|
|
4527
5029
|
),
|
|
4528
|
-
children: /* @__PURE__ */ (0,
|
|
5030
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "size-2 scale-0 rounded-full bg-brand transition-transform [label:has(:checked)_&]:scale-100" })
|
|
4529
5031
|
}
|
|
4530
5032
|
)
|
|
4531
5033
|
] }),
|
|
4532
|
-
/* @__PURE__ */ (0,
|
|
4533
|
-
/* @__PURE__ */ (0,
|
|
4534
|
-
description && /* @__PURE__ */ (0,
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: s.gap, children: [
|
|
5035
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { id: titleId, className: (0, import_clsx40.default)("block font-semibold text-default [label:has(:checked)_&]:text-brand", s.title), children: title }),
|
|
5036
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { id: descriptionId, className: "mt-0.5 block text-body-tiny text-default-secondary", children: description })
|
|
4535
5037
|
] })
|
|
4536
5038
|
]
|
|
4537
5039
|
}
|
|
@@ -4539,11 +5041,12 @@ var RadioCardsItem = (0, import_react29.forwardRef)(function RadioCardsItem2({ v
|
|
|
4539
5041
|
});
|
|
4540
5042
|
|
|
4541
5043
|
// src/components/forms/checkbox-group.tsx
|
|
4542
|
-
var
|
|
4543
|
-
var
|
|
4544
|
-
var CheckboxGroupContext = (0,
|
|
4545
|
-
var CheckboxGroup = (0,
|
|
5044
|
+
var import_react32 = require("react");
|
|
5045
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
5046
|
+
var CheckboxGroupContext = (0, import_react32.createContext)(null);
|
|
5047
|
+
var CheckboxGroup = (0, import_react32.forwardRef)(function CheckboxGroup2({
|
|
4546
5048
|
children,
|
|
5049
|
+
options,
|
|
4547
5050
|
legend,
|
|
4548
5051
|
value: valueProp,
|
|
4549
5052
|
defaultValue = [],
|
|
@@ -4555,7 +5058,7 @@ var CheckboxGroup = (0, import_react30.forwardRef)(function CheckboxGroup2({
|
|
|
4555
5058
|
required = false,
|
|
4556
5059
|
className
|
|
4557
5060
|
}, ref) {
|
|
4558
|
-
const generatedName = (0,
|
|
5061
|
+
const generatedName = (0, import_react32.useId)();
|
|
4559
5062
|
const [value, setValue] = useControllableState({
|
|
4560
5063
|
value: valueProp,
|
|
4561
5064
|
defaultValue,
|
|
@@ -4570,8 +5073,8 @@ var CheckboxGroup = (0, import_react30.forwardRef)(function CheckboxGroup2({
|
|
|
4570
5073
|
disabled,
|
|
4571
5074
|
required: required && value.length === 0
|
|
4572
5075
|
};
|
|
4573
|
-
return /* @__PURE__ */ (0,
|
|
4574
|
-
/* @__PURE__ */ (0,
|
|
5076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckboxGroupContext.Provider, { value: context, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(FieldSet, { ref, "data-slot": "checkbox-group", "data-required": required || void 0, className, children: [
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4575
5078
|
FieldLegend,
|
|
4576
5079
|
{
|
|
4577
5080
|
variant: "label",
|
|
@@ -4579,14 +5082,14 @@ var CheckboxGroup = (0, import_react30.forwardRef)(function CheckboxGroup2({
|
|
|
4579
5082
|
children: legend
|
|
4580
5083
|
}
|
|
4581
5084
|
),
|
|
4582
|
-
/* @__PURE__ */ (0,
|
|
5085
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: cn("flex", orientation === "vertical" ? "flex-col gap-2.5" : "flex-row flex-wrap gap-4"), children: options ? options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(CheckboxGroupItem, { ...option }, option.value)) : children })
|
|
4583
5086
|
] }) });
|
|
4584
5087
|
});
|
|
4585
|
-
var CheckboxGroupItem = (0,
|
|
5088
|
+
var CheckboxGroupItem = (0, import_react32.forwardRef)(
|
|
4586
5089
|
function CheckboxGroupItem2({ value, label, description, disabled }, ref) {
|
|
4587
|
-
const group = (0,
|
|
5090
|
+
const group = (0, import_react32.useContext)(CheckboxGroupContext);
|
|
4588
5091
|
if (!group) throw new Error("<CheckboxGroupItem> must be used inside <CheckboxGroup>");
|
|
4589
|
-
return /* @__PURE__ */ (0,
|
|
5092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
4590
5093
|
Checkbox,
|
|
4591
5094
|
{
|
|
4592
5095
|
ref,
|
|
@@ -4605,8 +5108,8 @@ var CheckboxGroupItem = (0, import_react30.forwardRef)(
|
|
|
4605
5108
|
);
|
|
4606
5109
|
|
|
4607
5110
|
// src/components/forms/segmented-control.tsx
|
|
4608
|
-
var
|
|
4609
|
-
var
|
|
5111
|
+
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
5112
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
4610
5113
|
function SegmentedControl({
|
|
4611
5114
|
options,
|
|
4612
5115
|
value: valueProp,
|
|
@@ -4629,12 +5132,12 @@ function SegmentedControl({
|
|
|
4629
5132
|
loop: true,
|
|
4630
5133
|
defaultIndex: selectedIndex
|
|
4631
5134
|
});
|
|
4632
|
-
return /* @__PURE__ */ (0,
|
|
5135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4633
5136
|
"div",
|
|
4634
5137
|
{
|
|
4635
5138
|
role: "radiogroup",
|
|
4636
5139
|
"aria-label": label,
|
|
4637
|
-
className: (0,
|
|
5140
|
+
className: (0, import_clsx41.default)(
|
|
4638
5141
|
"inline-flex items-center rounded-xl border border-default bg-default-secondary p-0.5",
|
|
4639
5142
|
className
|
|
4640
5143
|
),
|
|
@@ -4645,7 +5148,7 @@ function SegmentedControl({
|
|
|
4645
5148
|
disabled: option.disabled,
|
|
4646
5149
|
label: option.label
|
|
4647
5150
|
});
|
|
4648
|
-
return /* @__PURE__ */ (0,
|
|
5151
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
4649
5152
|
"button",
|
|
4650
5153
|
{
|
|
4651
5154
|
type: "button",
|
|
@@ -4659,7 +5162,7 @@ function SegmentedControl({
|
|
|
4659
5162
|
if (!option.disabled) setValue(option.value);
|
|
4660
5163
|
},
|
|
4661
5164
|
onClick: () => !option.disabled && setValue(option.value),
|
|
4662
|
-
className: (0,
|
|
5165
|
+
className: (0, import_clsx41.default)(
|
|
4663
5166
|
"rounded-lg px-3.5 py-1.5 text-body-xs font-medium transition-colors",
|
|
4664
5167
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default-secondary",
|
|
4665
5168
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -4675,10 +5178,10 @@ function SegmentedControl({
|
|
|
4675
5178
|
}
|
|
4676
5179
|
|
|
4677
5180
|
// src/components/forms/slider.tsx
|
|
4678
|
-
var
|
|
4679
|
-
var
|
|
4680
|
-
var
|
|
4681
|
-
var Slider = (0,
|
|
5181
|
+
var import_react33 = require("react");
|
|
5182
|
+
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
5183
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
5184
|
+
var Slider = (0, import_react33.forwardRef)(function Slider2({
|
|
4682
5185
|
value,
|
|
4683
5186
|
defaultValue,
|
|
4684
5187
|
onValueChange,
|
|
@@ -4694,32 +5197,32 @@ var Slider = (0, import_react31.forwardRef)(function Slider2({
|
|
|
4694
5197
|
className,
|
|
4695
5198
|
...props
|
|
4696
5199
|
}, ref) {
|
|
4697
|
-
const generatedId = (0,
|
|
5200
|
+
const generatedId = (0, import_react33.useId)();
|
|
4698
5201
|
const controlId = id ?? generatedId;
|
|
4699
5202
|
const descriptionId = `${controlId}-description`;
|
|
4700
5203
|
const current = value ?? defaultValue ?? min;
|
|
4701
5204
|
const display = formatValue ? formatValue(current) : String(current);
|
|
4702
|
-
return /* @__PURE__ */ (0,
|
|
4703
|
-
(label || showValue) && /* @__PURE__ */ (0,
|
|
4704
|
-
label && /* @__PURE__ */ (0,
|
|
5205
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: (0, import_clsx42.default)("flex w-full flex-col gap-1.5", className), children: [
|
|
5206
|
+
(label || showValue) && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
5207
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4705
5208
|
"label",
|
|
4706
5209
|
{
|
|
4707
5210
|
htmlFor: controlId,
|
|
4708
|
-
className: (0,
|
|
5211
|
+
className: (0, import_clsx42.default)("text-body-sm", disabled ? "text-disabled" : "text-default"),
|
|
4709
5212
|
children: label
|
|
4710
5213
|
}
|
|
4711
5214
|
),
|
|
4712
|
-
showValue && /* @__PURE__ */ (0,
|
|
5215
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "text-body-sm font-medium tabular-nums text-default", children: display })
|
|
4713
5216
|
] }),
|
|
4714
|
-
description && /* @__PURE__ */ (0,
|
|
5217
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4715
5218
|
"p",
|
|
4716
5219
|
{
|
|
4717
5220
|
id: descriptionId,
|
|
4718
|
-
className: (0,
|
|
5221
|
+
className: (0, import_clsx42.default)("text-body-xs", disabled ? "text-disabled" : "text-default-secondary"),
|
|
4719
5222
|
children: description
|
|
4720
5223
|
}
|
|
4721
5224
|
),
|
|
4722
|
-
/* @__PURE__ */ (0,
|
|
5225
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4723
5226
|
"input",
|
|
4724
5227
|
{
|
|
4725
5228
|
ref,
|
|
@@ -4734,7 +5237,7 @@ var Slider = (0, import_react31.forwardRef)(function Slider2({
|
|
|
4734
5237
|
"aria-describedby": description ? descriptionId : void 0,
|
|
4735
5238
|
"aria-valuetext": formatValue ? display : void 0,
|
|
4736
5239
|
onChange: (event) => onValueChange?.(Number(event.target.value)),
|
|
4737
|
-
className: (0,
|
|
5240
|
+
className: (0, import_clsx42.default)(
|
|
4738
5241
|
"h-5 w-full cursor-pointer appearance-none bg-transparent",
|
|
4739
5242
|
"focus-visible:outline-none",
|
|
4740
5243
|
disabled && "cursor-not-allowed opacity-50",
|
|
@@ -4758,244 +5261,40 @@ var Slider = (0, import_react31.forwardRef)(function Slider2({
|
|
|
4758
5261
|
});
|
|
4759
5262
|
|
|
4760
5263
|
// src/components/forms/label.tsx
|
|
4761
|
-
var
|
|
4762
|
-
var
|
|
4763
|
-
var
|
|
5264
|
+
var import_react34 = require("react");
|
|
5265
|
+
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
5266
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
4764
5267
|
var SIZE7 = {
|
|
4765
5268
|
lg: "text-body",
|
|
4766
5269
|
md: "text-body-sm",
|
|
4767
5270
|
sm: "text-body-tiny"
|
|
4768
5271
|
};
|
|
4769
|
-
var Label = (0,
|
|
5272
|
+
var Label = (0, import_react34.forwardRef)(function Label2({ children, size: size2, className, htmlFor, ...rest }, ref) {
|
|
4770
5273
|
const field = useFieldContext();
|
|
4771
5274
|
const resolvedSize = size2 ?? field?.size ?? "md";
|
|
4772
|
-
return /* @__PURE__ */ (0,
|
|
5275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
4773
5276
|
"label",
|
|
4774
5277
|
{
|
|
4775
|
-
ref,
|
|
4776
|
-
htmlFor: htmlFor ?? field?.controlId,
|
|
4777
|
-
"data-slot": "label",
|
|
4778
|
-
className: (0,
|
|
4779
|
-
"select-none",
|
|
4780
|
-
SIZE7[resolvedSize],
|
|
4781
|
-
field?.disabled ? "text-disabled" : "text-default",
|
|
4782
|
-
className
|
|
4783
|
-
),
|
|
4784
|
-
...rest,
|
|
4785
|
-
children
|
|
4786
|
-
}
|
|
4787
|
-
);
|
|
4788
|
-
});
|
|
4789
|
-
|
|
4790
|
-
// src/components/forms/calendar.tsx
|
|
4791
|
-
var import_react33 = require("react");
|
|
4792
|
-
var import_clsx43 = __toESM(require("clsx"), 1);
|
|
4793
|
-
var import_lucide_react12 = require("lucide-react");
|
|
4794
|
-
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
4795
|
-
var startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
|
|
4796
|
-
var sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
|
|
4797
|
-
var addDays = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
4798
|
-
var addMonths = (d, n) => new Date(d.getFullYear(), d.getMonth() + n, 1);
|
|
4799
|
-
var isBefore = (a, b) => startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
4800
|
-
var isAfter = (a, b) => startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
4801
|
-
var inRange = (d, from, to) => startOfDay(d).getTime() > startOfDay(from).getTime() && startOfDay(d).getTime() < startOfDay(to).getTime();
|
|
4802
|
-
function monthGrid(month, weekStartsOn) {
|
|
4803
|
-
const first = new Date(month.getFullYear(), month.getMonth(), 1);
|
|
4804
|
-
const offset2 = (first.getDay() - weekStartsOn + 7) % 7;
|
|
4805
|
-
const start = addDays(first, -offset2);
|
|
4806
|
-
return Array.from({ length: 42 }, (_, i) => addDays(start, i));
|
|
4807
|
-
}
|
|
4808
|
-
function Calendar({
|
|
4809
|
-
mode = "single",
|
|
4810
|
-
value,
|
|
4811
|
-
range,
|
|
4812
|
-
onSelect,
|
|
4813
|
-
onRangeChange,
|
|
4814
|
-
defaultMonth,
|
|
4815
|
-
min,
|
|
4816
|
-
max,
|
|
4817
|
-
isDateDisabled,
|
|
4818
|
-
weekStartsOn = 1,
|
|
4819
|
-
locale,
|
|
4820
|
-
label = "Calendar",
|
|
4821
|
-
className,
|
|
4822
|
-
...rest
|
|
4823
|
-
}) {
|
|
4824
|
-
const today = (0, import_react33.useMemo)(() => startOfDay(/* @__PURE__ */ new Date()), []);
|
|
4825
|
-
const gridId = (0, import_react33.useId)();
|
|
4826
|
-
const [month, setMonth] = (0, import_react33.useState)(
|
|
4827
|
-
() => defaultMonth ?? value ?? range?.from ?? today
|
|
4828
|
-
);
|
|
4829
|
-
const [focusedDate, setFocusedDate] = (0, import_react33.useState)(
|
|
4830
|
-
() => value ?? range?.from ?? today
|
|
4831
|
-
);
|
|
4832
|
-
const cellRefs = (0, import_react33.useRef)(/* @__PURE__ */ new Map());
|
|
4833
|
-
const monthFormatter = (0, import_react33.useMemo)(
|
|
4834
|
-
() => new Intl.DateTimeFormat(locale, { month: "long", year: "numeric" }),
|
|
4835
|
-
[locale]
|
|
4836
|
-
);
|
|
4837
|
-
const dayNameFormatter = (0, import_react33.useMemo)(
|
|
4838
|
-
() => new Intl.DateTimeFormat(locale, { weekday: "short" }),
|
|
4839
|
-
[locale]
|
|
4840
|
-
);
|
|
4841
|
-
const fullDateFormatter = (0, import_react33.useMemo)(
|
|
4842
|
-
() => new Intl.DateTimeFormat(locale, { weekday: "long", day: "numeric", month: "long", year: "numeric" }),
|
|
4843
|
-
[locale]
|
|
4844
|
-
);
|
|
4845
|
-
const disabled = (0, import_react33.useCallback)(
|
|
4846
|
-
(date) => {
|
|
4847
|
-
if (min && isBefore(date, min)) return true;
|
|
4848
|
-
if (max && isAfter(date, max)) return true;
|
|
4849
|
-
return isDateDisabled?.(date) ?? false;
|
|
4850
|
-
},
|
|
4851
|
-
[min, max, isDateDisabled]
|
|
4852
|
-
);
|
|
4853
|
-
const key = (d) => `${d.getFullYear()}-${d.getMonth()}-${d.getDate()}`;
|
|
4854
|
-
const pendingFocus = (0, import_react33.useRef)(false);
|
|
4855
|
-
const focusDate = (0, import_react33.useCallback)((date) => {
|
|
4856
|
-
pendingFocus.current = true;
|
|
4857
|
-
setFocusedDate(date);
|
|
4858
|
-
setMonth(
|
|
4859
|
-
(current) => current.getFullYear() === date.getFullYear() && current.getMonth() === date.getMonth() ? current : new Date(date.getFullYear(), date.getMonth(), 1)
|
|
4860
|
-
);
|
|
4861
|
-
}, []);
|
|
4862
|
-
(0, import_react33.useEffect)(() => {
|
|
4863
|
-
if (!pendingFocus.current) return;
|
|
4864
|
-
const node = cellRefs.current.get(key(focusedDate));
|
|
4865
|
-
if (node) {
|
|
4866
|
-
node.focus();
|
|
4867
|
-
pendingFocus.current = false;
|
|
4868
|
-
}
|
|
4869
|
-
}, [focusedDate, month]);
|
|
4870
|
-
const select = (date) => {
|
|
4871
|
-
if (disabled(date)) return;
|
|
4872
|
-
setFocusedDate(date);
|
|
4873
|
-
if (mode === "single") {
|
|
4874
|
-
onSelect?.(date);
|
|
4875
|
-
return;
|
|
4876
|
-
}
|
|
4877
|
-
const current = range ?? { from: null, to: null };
|
|
4878
|
-
if (!current.from || current.to || isBefore(date, current.from)) {
|
|
4879
|
-
onRangeChange?.({ from: date, to: null });
|
|
4880
|
-
} else {
|
|
4881
|
-
onRangeChange?.({ from: current.from, to: date });
|
|
4882
|
-
}
|
|
4883
|
-
};
|
|
4884
|
-
const onKeyDown = (event) => {
|
|
4885
|
-
const moves = {
|
|
4886
|
-
ArrowLeft: () => addDays(focusedDate, -1),
|
|
4887
|
-
ArrowRight: () => addDays(focusedDate, 1),
|
|
4888
|
-
ArrowUp: () => addDays(focusedDate, -7),
|
|
4889
|
-
ArrowDown: () => addDays(focusedDate, 7),
|
|
4890
|
-
Home: () => addDays(focusedDate, -((focusedDate.getDay() - weekStartsOn + 7) % 7)),
|
|
4891
|
-
End: () => addDays(focusedDate, 6 - (focusedDate.getDay() - weekStartsOn + 7) % 7),
|
|
4892
|
-
PageUp: () => addDays(focusedDate, 0) && new Date(focusedDate.getFullYear(), focusedDate.getMonth() - 1, focusedDate.getDate()),
|
|
4893
|
-
PageDown: () => new Date(focusedDate.getFullYear(), focusedDate.getMonth() + 1, focusedDate.getDate())
|
|
4894
|
-
};
|
|
4895
|
-
const move = moves[event.key];
|
|
4896
|
-
if (move) {
|
|
4897
|
-
event.preventDefault();
|
|
4898
|
-
focusDate(move());
|
|
4899
|
-
}
|
|
4900
|
-
};
|
|
4901
|
-
const days = monthGrid(month, weekStartsOn);
|
|
4902
|
-
const weekdayNames = days.slice(0, 7).map((d) => dayNameFormatter.format(d));
|
|
4903
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4904
|
-
"div",
|
|
4905
|
-
{
|
|
4906
|
-
"data-slot": "calendar",
|
|
4907
|
-
className: (0, import_clsx43.default)("w-fit rounded-xl border border-default bg-default p-3", className),
|
|
5278
|
+
ref,
|
|
5279
|
+
htmlFor: htmlFor ?? field?.controlId,
|
|
5280
|
+
"data-slot": "label",
|
|
5281
|
+
className: (0, import_clsx43.default)(
|
|
5282
|
+
"select-none",
|
|
5283
|
+
SIZE7[resolvedSize],
|
|
5284
|
+
field?.disabled ? "text-disabled" : "text-default",
|
|
5285
|
+
className
|
|
5286
|
+
),
|
|
4908
5287
|
...rest,
|
|
4909
|
-
children
|
|
4910
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
4911
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4912
|
-
IconButton,
|
|
4913
|
-
{
|
|
4914
|
-
variant: "subtle",
|
|
4915
|
-
size: "sm",
|
|
4916
|
-
"aria-label": "Previous month",
|
|
4917
|
-
disabled: !!min && isBefore(addMonths(month, -1), new Date(min.getFullYear(), min.getMonth(), 1)),
|
|
4918
|
-
onClick: () => setMonth(addMonths(month, -1)),
|
|
4919
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronLeftIcon, { "aria-hidden": true, size: 16 })
|
|
4920
|
-
}
|
|
4921
|
-
),
|
|
4922
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-live": "polite", className: "text-body-sm font-semibold text-default", children: monthFormatter.format(month) }),
|
|
4923
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4924
|
-
IconButton,
|
|
4925
|
-
{
|
|
4926
|
-
variant: "subtle",
|
|
4927
|
-
size: "sm",
|
|
4928
|
-
"aria-label": "Next month",
|
|
4929
|
-
disabled: !!max && isAfter(addMonths(month, 1), new Date(max.getFullYear(), max.getMonth(), 1)),
|
|
4930
|
-
onClick: () => setMonth(addMonths(month, 1)),
|
|
4931
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronRightIcon, { "aria-hidden": true, size: 16 })
|
|
4932
|
-
}
|
|
4933
|
-
)
|
|
4934
|
-
] }),
|
|
4935
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
4936
|
-
"div",
|
|
4937
|
-
{
|
|
4938
|
-
role: "grid",
|
|
4939
|
-
"aria-label": label,
|
|
4940
|
-
id: gridId,
|
|
4941
|
-
tabIndex: -1,
|
|
4942
|
-
onKeyDown,
|
|
4943
|
-
children: [
|
|
4944
|
-
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { role: "row", className: "mb-1 grid grid-cols-7", children: weekdayNames.map((name) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4945
|
-
"div",
|
|
4946
|
-
{
|
|
4947
|
-
role: "columnheader",
|
|
4948
|
-
className: "flex h-8 items-center justify-center text-body-tiny font-medium text-default-tertiary",
|
|
4949
|
-
children: name
|
|
4950
|
-
},
|
|
4951
|
-
name
|
|
4952
|
-
)) }),
|
|
4953
|
-
Array.from({ length: 6 }, (_, week) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { role: "row", className: "grid grid-cols-7", children: days.slice(week * 7, week * 7 + 7).map((date) => {
|
|
4954
|
-
const outside = date.getMonth() !== month.getMonth();
|
|
4955
|
-
const isDisabled = disabled(date);
|
|
4956
|
-
const selected = mode === "single" ? sameDay(date, value) : sameDay(date, range?.from) || sameDay(date, range?.to);
|
|
4957
|
-
const between = mode === "range" && range?.from && range?.to ? inRange(date, range.from, range.to) : false;
|
|
4958
|
-
const isFocused = sameDay(date, focusedDate);
|
|
4959
|
-
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { role: "gridcell", "aria-selected": selected || void 0, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
4960
|
-
"button",
|
|
4961
|
-
{
|
|
4962
|
-
ref: (node) => {
|
|
4963
|
-
if (node) cellRefs.current.set(key(date), node);
|
|
4964
|
-
else cellRefs.current.delete(key(date));
|
|
4965
|
-
},
|
|
4966
|
-
type: "button",
|
|
4967
|
-
tabIndex: isFocused ? 0 : -1,
|
|
4968
|
-
disabled: isDisabled,
|
|
4969
|
-
"aria-label": fullDateFormatter.format(date),
|
|
4970
|
-
"aria-current": sameDay(date, today) ? "date" : void 0,
|
|
4971
|
-
onClick: () => select(date),
|
|
4972
|
-
onFocus: () => setFocusedDate(date),
|
|
4973
|
-
className: (0, import_clsx43.default)(
|
|
4974
|
-
"flex size-9 items-center justify-center rounded-lg text-body-sm tabular-nums transition-colors",
|
|
4975
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand focus-visible:ring-offset-1 focus-visible:ring-offset-default",
|
|
4976
|
-
"disabled:cursor-not-allowed disabled:text-disabled disabled:hover:bg-transparent",
|
|
4977
|
-
selected ? "bg-brand font-semibold text-brand-on-brand" : between ? "rounded-none bg-brand-tertiary text-default" : outside ? "text-default-tertiary hover:bg-default-secondary" : "text-default hover:bg-default-secondary",
|
|
4978
|
-
// Today is marked by a ring rather than a fill, so it stays legible
|
|
4979
|
-
// when it is also the selected day.
|
|
4980
|
-
sameDay(date, today) && !selected && "ring-1 ring-inset ring-brand-tertiary"
|
|
4981
|
-
),
|
|
4982
|
-
children: date.getDate()
|
|
4983
|
-
}
|
|
4984
|
-
) }, key(date));
|
|
4985
|
-
}) }, week))
|
|
4986
|
-
]
|
|
4987
|
-
}
|
|
4988
|
-
)
|
|
4989
|
-
]
|
|
5288
|
+
children
|
|
4990
5289
|
}
|
|
4991
5290
|
);
|
|
4992
|
-
}
|
|
5291
|
+
});
|
|
4993
5292
|
|
|
4994
5293
|
// src/components/forms/input-group.tsx
|
|
4995
|
-
var
|
|
5294
|
+
var import_react35 = require("react");
|
|
4996
5295
|
var import_clsx44 = __toESM(require("clsx"), 1);
|
|
4997
5296
|
var import_lucide_react13 = require("lucide-react");
|
|
4998
|
-
var
|
|
5297
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
4999
5298
|
var HEIGHT2 = {
|
|
5000
5299
|
lg: "h-12 text-body",
|
|
5001
5300
|
md: "h-9 text-body-sm",
|
|
@@ -5006,9 +5305,9 @@ var PAD = {
|
|
|
5006
5305
|
md: "px-3 gap-1.5",
|
|
5007
5306
|
sm: "px-2 gap-1"
|
|
5008
5307
|
};
|
|
5009
|
-
var InputGroup = (0,
|
|
5308
|
+
var InputGroup = (0, import_react35.forwardRef)(function InputGroup2({ children, size: sizeProp, invalid = false, disabled = false, className, ...rest }, ref) {
|
|
5010
5309
|
const size2 = useControlSize(sizeProp);
|
|
5011
|
-
return /* @__PURE__ */ (0,
|
|
5310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5012
5311
|
"div",
|
|
5013
5312
|
{
|
|
5014
5313
|
ref,
|
|
@@ -5030,10 +5329,10 @@ var InputGroup = (0, import_react34.forwardRef)(function InputGroup2({ children,
|
|
|
5030
5329
|
}
|
|
5031
5330
|
);
|
|
5032
5331
|
});
|
|
5033
|
-
var InputGroupInput = (0,
|
|
5332
|
+
var InputGroupInput = (0, import_react35.forwardRef)(
|
|
5034
5333
|
function InputGroupInput2({ className, ...props }, ref) {
|
|
5035
5334
|
const field = useFieldControl();
|
|
5036
|
-
return /* @__PURE__ */ (0,
|
|
5335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5037
5336
|
"input",
|
|
5038
5337
|
{
|
|
5039
5338
|
ref,
|
|
@@ -5049,9 +5348,9 @@ var InputGroupInput = (0, import_react34.forwardRef)(
|
|
|
5049
5348
|
);
|
|
5050
5349
|
}
|
|
5051
5350
|
);
|
|
5052
|
-
var InputGroupAddon = (0,
|
|
5351
|
+
var InputGroupAddon = (0, import_react35.forwardRef)(
|
|
5053
5352
|
function InputGroupAddon2({ children, align = "inline-start", decorative = true, className, ...rest }, ref) {
|
|
5054
|
-
return /* @__PURE__ */ (0,
|
|
5353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5055
5354
|
"span",
|
|
5056
5355
|
{
|
|
5057
5356
|
ref,
|
|
@@ -5070,9 +5369,9 @@ var InputGroupAddon = (0, import_react34.forwardRef)(
|
|
|
5070
5369
|
);
|
|
5071
5370
|
}
|
|
5072
5371
|
);
|
|
5073
|
-
var InputGroupText = (0,
|
|
5372
|
+
var InputGroupText = (0, import_react35.forwardRef)(
|
|
5074
5373
|
function InputGroupText2({ children, className, ...rest }, ref) {
|
|
5075
|
-
return /* @__PURE__ */ (0,
|
|
5374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5076
5375
|
"span",
|
|
5077
5376
|
{
|
|
5078
5377
|
ref,
|
|
@@ -5083,12 +5382,12 @@ var InputGroupText = (0, import_react34.forwardRef)(
|
|
|
5083
5382
|
);
|
|
5084
5383
|
}
|
|
5085
5384
|
);
|
|
5086
|
-
var SearchInput = (0,
|
|
5385
|
+
var SearchInput = (0, import_react35.forwardRef)(function SearchInput2({ size: sizeProp, onClear, label = "Search", disabled, value, className, ...props }, ref) {
|
|
5087
5386
|
const size2 = useControlSize(sizeProp);
|
|
5088
5387
|
const hasValue = value !== void 0 && value !== "";
|
|
5089
|
-
return /* @__PURE__ */ (0,
|
|
5090
|
-
/* @__PURE__ */ (0,
|
|
5091
|
-
/* @__PURE__ */ (0,
|
|
5388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(InputGroup, { size: size2, disabled, className, children: [
|
|
5389
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputGroupAddon, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.SearchIcon, { className: size2 === "sm" ? "size-3" : "size-4" }) }),
|
|
5390
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5092
5391
|
InputGroupInput,
|
|
5093
5392
|
{
|
|
5094
5393
|
ref,
|
|
@@ -5100,7 +5399,7 @@ var SearchInput = (0, import_react34.forwardRef)(function SearchInput2({ size: s
|
|
|
5100
5399
|
...props
|
|
5101
5400
|
}
|
|
5102
5401
|
),
|
|
5103
|
-
onClear && hasValue && /* @__PURE__ */ (0,
|
|
5402
|
+
onClear && hasValue && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputGroupAddon, { align: "inline-end", decorative: false, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
5104
5403
|
"button",
|
|
5105
5404
|
{
|
|
5106
5405
|
type: "button",
|
|
@@ -5108,15 +5407,15 @@ var SearchInput = (0, import_react34.forwardRef)(function SearchInput2({ size: s
|
|
|
5108
5407
|
onClick: onClear,
|
|
5109
5408
|
disabled,
|
|
5110
5409
|
className: "flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
|
|
5111
|
-
children: /* @__PURE__ */ (0,
|
|
5410
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.XIcon, { "aria-hidden": true, className: size2 === "sm" ? "size-3" : "size-4" })
|
|
5112
5411
|
}
|
|
5113
5412
|
) })
|
|
5114
5413
|
] });
|
|
5115
5414
|
});
|
|
5116
5415
|
|
|
5117
5416
|
// src/components/overlays/modal.tsx
|
|
5118
|
-
var
|
|
5119
|
-
var
|
|
5417
|
+
var import_react36 = require("react");
|
|
5418
|
+
var import_radix_ui2 = require("radix-ui");
|
|
5120
5419
|
var import_lucide_react14 = require("lucide-react");
|
|
5121
5420
|
|
|
5122
5421
|
// src/components/overlays/toaster-guard.ts
|
|
@@ -5126,7 +5425,7 @@ function isInsideToaster(target) {
|
|
|
5126
5425
|
}
|
|
5127
5426
|
|
|
5128
5427
|
// src/components/overlays/modal.tsx
|
|
5129
|
-
var
|
|
5428
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
5130
5429
|
var SIZE8 = {
|
|
5131
5430
|
sm: "sm:max-w-[420px]",
|
|
5132
5431
|
md: "sm:max-w-[540px]",
|
|
@@ -5134,10 +5433,10 @@ var SIZE8 = {
|
|
|
5134
5433
|
xl: "sm:max-w-[800px]"
|
|
5135
5434
|
};
|
|
5136
5435
|
var TONE_ICON = {
|
|
5137
|
-
info: /* @__PURE__ */ (0,
|
|
5138
|
-
positive: /* @__PURE__ */ (0,
|
|
5139
|
-
warning: /* @__PURE__ */ (0,
|
|
5140
|
-
danger: /* @__PURE__ */ (0,
|
|
5436
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.InfoIcon, { "aria-hidden": true, className: "size-5" }),
|
|
5437
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.CircleCheckBigIcon, { "aria-hidden": true, className: "size-5" }),
|
|
5438
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.TriangleAlertIcon, { "aria-hidden": true, className: "size-5" }),
|
|
5439
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.OctagonAlertIcon, { "aria-hidden": true, className: "size-5" })
|
|
5141
5440
|
};
|
|
5142
5441
|
var TONE_BADGE = {
|
|
5143
5442
|
info: "brand",
|
|
@@ -5150,14 +5449,14 @@ var FOOTER_ALIGN = {
|
|
|
5150
5449
|
between: "justify-between",
|
|
5151
5450
|
end: "justify-end"
|
|
5152
5451
|
};
|
|
5153
|
-
var ModalNaming = (0,
|
|
5154
|
-
var Modal = (0,
|
|
5155
|
-
return /* @__PURE__ */ (0,
|
|
5452
|
+
var ModalNaming = (0, import_react36.createContext)(null);
|
|
5453
|
+
var Modal = (0, import_react36.forwardRef)(function Modal2({ open, defaultOpen, onOpenChange, container, ...shell }, ref) {
|
|
5454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_radix_ui2.Dialog.Root, { open, defaultOpen, onOpenChange, children: [
|
|
5156
5455
|
extractTrigger(shell.children),
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Portal, { container: container ?? void 0, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ModalShell, { ref, ...shell }) })
|
|
5158
5457
|
] });
|
|
5159
5458
|
});
|
|
5160
|
-
var ModalShell = (0,
|
|
5459
|
+
var ModalShell = (0, import_react36.forwardRef)(
|
|
5161
5460
|
function ModalShell2({
|
|
5162
5461
|
label,
|
|
5163
5462
|
children,
|
|
@@ -5169,14 +5468,14 @@ var ModalShell = (0, import_react35.forwardRef)(
|
|
|
5169
5468
|
onInteractOutside,
|
|
5170
5469
|
initialFocus
|
|
5171
5470
|
}, ref) {
|
|
5172
|
-
const [hasTitle, setHasTitle] = (0,
|
|
5173
|
-
const [hasDescription, setHasDescription] = (0,
|
|
5174
|
-
const [contentNode, setContentNode] = (0,
|
|
5175
|
-
const [returnFocusTo] = (0,
|
|
5471
|
+
const [hasTitle, setHasTitle] = (0, import_react36.useState)(false);
|
|
5472
|
+
const [hasDescription, setHasDescription] = (0, import_react36.useState)(false);
|
|
5473
|
+
const [contentNode, setContentNode] = (0, import_react36.useState)(null);
|
|
5474
|
+
const [returnFocusTo] = (0, import_react36.useState)(
|
|
5176
5475
|
() => typeof document === "undefined" ? null : document.activeElement
|
|
5177
5476
|
);
|
|
5178
|
-
return /* @__PURE__ */ (0,
|
|
5179
|
-
|
|
5477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5478
|
+
import_radix_ui2.Dialog.Overlay,
|
|
5180
5479
|
{
|
|
5181
5480
|
className: cn(
|
|
5182
5481
|
// The overlay wraps the content (a Radix-supported layout), so it also does the
|
|
@@ -5184,8 +5483,8 @@ var ModalShell = (0, import_react35.forwardRef)(
|
|
|
5184
5483
|
"fixed inset-0 z-modal flex items-end justify-center sm:items-center",
|
|
5185
5484
|
OVERLAY_SCRIM
|
|
5186
5485
|
),
|
|
5187
|
-
children: /* @__PURE__ */ (0,
|
|
5188
|
-
|
|
5486
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
5487
|
+
import_radix_ui2.Dialog.Content,
|
|
5189
5488
|
{
|
|
5190
5489
|
ref: composeRefs(ref, setContentNode),
|
|
5191
5490
|
role,
|
|
@@ -5226,22 +5525,22 @@ var ModalShell = (0, import_react35.forwardRef)(
|
|
|
5226
5525
|
className
|
|
5227
5526
|
),
|
|
5228
5527
|
children: [
|
|
5229
|
-
!hasTitle && label && /* @__PURE__ */ (0,
|
|
5230
|
-
showClose && /* @__PURE__ */ (0,
|
|
5528
|
+
!hasTitle && label && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Title, { className: "sr-only", children: label }),
|
|
5529
|
+
showClose && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Close, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5231
5530
|
IconButton,
|
|
5232
5531
|
{
|
|
5233
5532
|
variant: "subtle",
|
|
5234
5533
|
size: "sm",
|
|
5235
5534
|
"aria-label": "Close dialog",
|
|
5236
5535
|
className: "absolute right-6 top-5 z-raised",
|
|
5237
|
-
children: /* @__PURE__ */ (0,
|
|
5536
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.XIcon, { size: 16, "aria-hidden": true })
|
|
5238
5537
|
}
|
|
5239
5538
|
) }),
|
|
5240
|
-
/* @__PURE__ */ (0,
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5241
5540
|
ModalNaming.Provider,
|
|
5242
5541
|
{
|
|
5243
5542
|
value: { registerTitle: setHasTitle, registerDescription: setHasDescription },
|
|
5244
|
-
children: /* @__PURE__ */ (0,
|
|
5543
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(PortalContainerProvider, { container: contentNode, children: withoutTrigger(children) })
|
|
5245
5544
|
}
|
|
5246
5545
|
)
|
|
5247
5546
|
]
|
|
@@ -5251,15 +5550,15 @@ var ModalShell = (0, import_react35.forwardRef)(
|
|
|
5251
5550
|
);
|
|
5252
5551
|
}
|
|
5253
5552
|
);
|
|
5254
|
-
var ModalTrigger = (0,
|
|
5553
|
+
var ModalTrigger = (0, import_react36.forwardRef)(
|
|
5255
5554
|
function ModalTrigger2(props, ref) {
|
|
5256
|
-
return /* @__PURE__ */ (0,
|
|
5555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Trigger, { ref, ...props });
|
|
5257
5556
|
}
|
|
5258
5557
|
);
|
|
5259
5558
|
ModalTrigger.__modalTrigger = true;
|
|
5260
|
-
var ModalClose = (0,
|
|
5559
|
+
var ModalClose = (0, import_react36.forwardRef)(
|
|
5261
5560
|
function ModalClose2(props, ref) {
|
|
5262
|
-
return /* @__PURE__ */ (0,
|
|
5561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Close, { ref, ...props });
|
|
5263
5562
|
}
|
|
5264
5563
|
);
|
|
5265
5564
|
function isTrigger(node) {
|
|
@@ -5271,8 +5570,8 @@ function extractTrigger(children) {
|
|
|
5271
5570
|
function withoutTrigger(children) {
|
|
5272
5571
|
return Array.isArray(children) ? children.filter((child) => !isTrigger(child)) : isTrigger(children) ? null : children;
|
|
5273
5572
|
}
|
|
5274
|
-
var ModalHeader = (0,
|
|
5275
|
-
return /* @__PURE__ */ (0,
|
|
5573
|
+
var ModalHeader = (0, import_react36.forwardRef)(function ModalHeader2({ children, tone = "default", divider = true, className, ...rest }, ref) {
|
|
5574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
5276
5575
|
"div",
|
|
5277
5576
|
{
|
|
5278
5577
|
ref,
|
|
@@ -5286,43 +5585,43 @@ var ModalHeader = (0, import_react35.forwardRef)(function ModalHeader2({ childre
|
|
|
5286
5585
|
),
|
|
5287
5586
|
...rest,
|
|
5288
5587
|
children: [
|
|
5289
|
-
tone !== "default" && /* @__PURE__ */ (0,
|
|
5290
|
-
/* @__PURE__ */ (0,
|
|
5588
|
+
tone !== "default" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(EntityIconBadge, { size: "md", shape: "circle", tone: TONE_BADGE[tone], children: TONE_ICON[tone] }),
|
|
5589
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "min-w-0 flex-1", children })
|
|
5291
5590
|
]
|
|
5292
5591
|
}
|
|
5293
5592
|
);
|
|
5294
5593
|
});
|
|
5295
|
-
var ModalTitle = (0,
|
|
5296
|
-
const naming = (0,
|
|
5297
|
-
(0,
|
|
5594
|
+
var ModalTitle = (0, import_react36.forwardRef)(function ModalTitle2({ children, className, ...rest }, ref) {
|
|
5595
|
+
const naming = (0, import_react36.useContext)(ModalNaming);
|
|
5596
|
+
(0, import_react36.useEffect)(() => {
|
|
5298
5597
|
naming?.registerTitle(true);
|
|
5299
5598
|
return () => naming?.registerTitle(false);
|
|
5300
5599
|
}, [naming]);
|
|
5301
5600
|
const classes = cn("text-heading-sm font-semibold text-default", className);
|
|
5302
5601
|
if (!naming) {
|
|
5303
|
-
return /* @__PURE__ */ (0,
|
|
5602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("h2", { ref, className: classes, ...rest, children });
|
|
5304
5603
|
}
|
|
5305
|
-
return /* @__PURE__ */ (0,
|
|
5604
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Title, { ref, className: classes, ...rest, children });
|
|
5306
5605
|
});
|
|
5307
|
-
var ModalDescription = (0,
|
|
5606
|
+
var ModalDescription = (0, import_react36.forwardRef)(
|
|
5308
5607
|
function ModalDescription2({ children, className, ...rest }, ref) {
|
|
5309
|
-
const naming = (0,
|
|
5310
|
-
(0,
|
|
5608
|
+
const naming = (0, import_react36.useContext)(ModalNaming);
|
|
5609
|
+
(0, import_react36.useEffect)(() => {
|
|
5311
5610
|
naming?.registerDescription(true);
|
|
5312
5611
|
return () => naming?.registerDescription(false);
|
|
5313
5612
|
}, [naming]);
|
|
5314
5613
|
const classes = cn("mt-0.5 text-body-xs text-default-secondary", className);
|
|
5315
5614
|
if (!naming) {
|
|
5316
|
-
return /* @__PURE__ */ (0,
|
|
5615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("p", { ref, className: classes, ...rest, children });
|
|
5317
5616
|
}
|
|
5318
|
-
return /* @__PURE__ */ (0,
|
|
5617
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_radix_ui2.Dialog.Description, { ref, className: classes, ...rest, children });
|
|
5319
5618
|
}
|
|
5320
5619
|
);
|
|
5321
|
-
var ModalBody = (0,
|
|
5322
|
-
return /* @__PURE__ */ (0,
|
|
5620
|
+
var ModalBody = (0, import_react36.forwardRef)(function ModalBody2({ children, className, ...rest }, ref) {
|
|
5621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref, className: cn("px-6 py-5", className), ...rest, children });
|
|
5323
5622
|
});
|
|
5324
|
-
var ModalFooter = (0,
|
|
5325
|
-
return /* @__PURE__ */ (0,
|
|
5623
|
+
var ModalFooter = (0, import_react36.forwardRef)(function ModalFooter2({ children, align = "end", divider = true, className, ...rest }, ref) {
|
|
5624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
5326
5625
|
"div",
|
|
5327
5626
|
{
|
|
5328
5627
|
ref,
|
|
@@ -5339,9 +5638,9 @@ var ModalFooter = (0, import_react35.forwardRef)(function ModalFooter2({ childre
|
|
|
5339
5638
|
});
|
|
5340
5639
|
|
|
5341
5640
|
// src/components/overlays/tooltip.tsx
|
|
5342
|
-
var
|
|
5343
|
-
var
|
|
5344
|
-
var
|
|
5641
|
+
var import_react37 = require("react");
|
|
5642
|
+
var import_radix_ui3 = require("radix-ui");
|
|
5643
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5345
5644
|
function Tooltip({
|
|
5346
5645
|
children,
|
|
5347
5646
|
title,
|
|
@@ -5356,28 +5655,28 @@ function Tooltip({
|
|
|
5356
5655
|
className
|
|
5357
5656
|
}) {
|
|
5358
5657
|
const container = usePortalContainer();
|
|
5359
|
-
const labelId = (0,
|
|
5658
|
+
const labelId = (0, import_react37.useId)();
|
|
5360
5659
|
const labelled = association === "labelledby";
|
|
5361
|
-
const content = /* @__PURE__ */ (0,
|
|
5362
|
-
title && /* @__PURE__ */ (0,
|
|
5363
|
-
body && /* @__PURE__ */ (0,
|
|
5660
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
|
|
5661
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "font-semibold", children: title }),
|
|
5662
|
+
body && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: cn(title && "mt-0.5 opacity-80"), children: body })
|
|
5364
5663
|
] });
|
|
5365
|
-
return /* @__PURE__ */ (0,
|
|
5366
|
-
/* @__PURE__ */ (0,
|
|
5367
|
-
|
|
5664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_radix_ui3.Tooltip.Provider, { delayDuration: openDelay, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_radix_ui3.Tooltip.Root, { open, defaultOpen, onOpenChange, children: [
|
|
5665
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5666
|
+
import_radix_ui3.Tooltip.Trigger,
|
|
5368
5667
|
{
|
|
5369
5668
|
asChild: true,
|
|
5370
5669
|
...labelled ? { "aria-labelledby": labelId, "aria-describedby": void 0 } : {},
|
|
5371
5670
|
children
|
|
5372
5671
|
}
|
|
5373
5672
|
),
|
|
5374
|
-
labelled && /* @__PURE__ */ (0,
|
|
5673
|
+
labelled && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { id: labelId, hidden: true, children: [
|
|
5375
5674
|
title,
|
|
5376
5675
|
body ? " " : null,
|
|
5377
5676
|
body
|
|
5378
5677
|
] }),
|
|
5379
|
-
/* @__PURE__ */ (0,
|
|
5380
|
-
|
|
5678
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_radix_ui3.Tooltip.Portal, { container: container ?? void 0, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5679
|
+
import_radix_ui3.Tooltip.Content,
|
|
5381
5680
|
{
|
|
5382
5681
|
side,
|
|
5383
5682
|
align,
|
|
@@ -5394,77 +5693,6 @@ function Tooltip({
|
|
|
5394
5693
|
] }) });
|
|
5395
5694
|
}
|
|
5396
5695
|
|
|
5397
|
-
// src/components/overlays/popover.tsx
|
|
5398
|
-
var import_react37 = require("react");
|
|
5399
|
-
var import_radix_ui3 = require("radix-ui");
|
|
5400
|
-
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
5401
|
-
var PopoverTriggerNode = (0, import_react37.createContext)(null);
|
|
5402
|
-
function Popover({ children, open, defaultOpen, onOpenChange, modal = false }) {
|
|
5403
|
-
const [node, setNode] = (0, import_react37.useState)(null);
|
|
5404
|
-
const trigger = (0, import_react37.useMemo)(() => ({ node, setNode, modal }), [node, modal]);
|
|
5405
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5406
|
-
import_radix_ui3.Popover.Root,
|
|
5407
|
-
{
|
|
5408
|
-
open,
|
|
5409
|
-
defaultOpen,
|
|
5410
|
-
onOpenChange,
|
|
5411
|
-
modal,
|
|
5412
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(PopoverTriggerNode.Provider, { value: trigger, children })
|
|
5413
|
-
}
|
|
5414
|
-
);
|
|
5415
|
-
}
|
|
5416
|
-
var PopoverTrigger = (0, import_react37.forwardRef)(
|
|
5417
|
-
function PopoverTrigger2(props, ref) {
|
|
5418
|
-
const trigger = (0, import_react37.useContext)(PopoverTriggerNode);
|
|
5419
|
-
const fallbackId = (0, import_react37.useId)();
|
|
5420
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5421
|
-
import_radix_ui3.Popover.Trigger,
|
|
5422
|
-
{
|
|
5423
|
-
ref: composeRefs(ref, trigger?.setNode),
|
|
5424
|
-
id: props.id ?? fallbackId,
|
|
5425
|
-
...props
|
|
5426
|
-
}
|
|
5427
|
-
);
|
|
5428
|
-
}
|
|
5429
|
-
);
|
|
5430
|
-
var PopoverContent = (0, import_react37.forwardRef)(
|
|
5431
|
-
function PopoverContent2({ children, side = "bottom", align = "center", sideOffset = 8, label, container, className, ...rest }, ref) {
|
|
5432
|
-
const trigger = (0, import_react37.useContext)(PopoverTriggerNode);
|
|
5433
|
-
const inherited = usePortalContainer();
|
|
5434
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_radix_ui3.Popover.Portal, { container: container ?? inherited ?? void 0, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
5435
|
-
import_radix_ui3.Popover.Content,
|
|
5436
|
-
{
|
|
5437
|
-
ref,
|
|
5438
|
-
side,
|
|
5439
|
-
align,
|
|
5440
|
-
sideOffset,
|
|
5441
|
-
collisionPadding: 8,
|
|
5442
|
-
onEscapeKeyDown: (event) => void deferEscapeToInnerPopup(event),
|
|
5443
|
-
"aria-modal": trigger?.modal || void 0,
|
|
5444
|
-
"aria-label": label,
|
|
5445
|
-
"aria-labelledby": label ? void 0 : trigger?.node?.id || void 0,
|
|
5446
|
-
className: cn(
|
|
5447
|
-
"z-popover max-w-[min(22rem,calc(100vw-2rem))] rounded-xl border border-default bg-default p-4 shadow-400",
|
|
5448
|
-
"focus:outline-none",
|
|
5449
|
-
className
|
|
5450
|
-
),
|
|
5451
|
-
...rest,
|
|
5452
|
-
children
|
|
5453
|
-
}
|
|
5454
|
-
) });
|
|
5455
|
-
}
|
|
5456
|
-
);
|
|
5457
|
-
var PopoverClose = (0, import_react37.forwardRef)(
|
|
5458
|
-
function PopoverClose2(props, ref) {
|
|
5459
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_radix_ui3.Popover.Close, { ref, ...props });
|
|
5460
|
-
}
|
|
5461
|
-
);
|
|
5462
|
-
var PopoverAnchor = (0, import_react37.forwardRef)(
|
|
5463
|
-
function PopoverAnchor2(props, ref) {
|
|
5464
|
-
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_radix_ui3.Popover.Anchor, { ref, ...props });
|
|
5465
|
-
}
|
|
5466
|
-
);
|
|
5467
|
-
|
|
5468
5696
|
// src/components/overlays/hover-card.tsx
|
|
5469
5697
|
var import_react38 = require("react");
|
|
5470
5698
|
var import_radix_ui4 = require("radix-ui");
|
|
@@ -5565,6 +5793,18 @@ function focusMenuEdge(event, edge) {
|
|
|
5565
5793
|
else if (document.activeElement === panel) items[0]?.focus();
|
|
5566
5794
|
});
|
|
5567
5795
|
}
|
|
5796
|
+
function visibleMenuItems(items) {
|
|
5797
|
+
const kept = items.filter((item) => {
|
|
5798
|
+
if (item.hidden) return false;
|
|
5799
|
+
if (item.type === "group" || item.type === "submenu") return visibleMenuItems(item.items).length > 0;
|
|
5800
|
+
return true;
|
|
5801
|
+
});
|
|
5802
|
+
return kept.filter((item, i) => {
|
|
5803
|
+
if (item.type !== "separator") return true;
|
|
5804
|
+
const prev = kept[i - 1];
|
|
5805
|
+
return i > 0 && i < kept.length - 1 && prev.type !== "separator";
|
|
5806
|
+
});
|
|
5807
|
+
}
|
|
5568
5808
|
function createMenuParts(P) {
|
|
5569
5809
|
const Item = (0, import_react39.forwardRef)(function MenuItem({ children, onSelect, tone = "default", disabled = false, icon, description, shortcut, textValue, className, ...rest }, ref) {
|
|
5570
5810
|
const descriptionId = (0, import_react39.useId)();
|
|
@@ -5695,7 +5935,58 @@ function createMenuParts(P) {
|
|
|
5695
5935
|
}
|
|
5696
5936
|
) });
|
|
5697
5937
|
});
|
|
5938
|
+
function Items({ items }) {
|
|
5939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_jsx_runtime53.Fragment, { children: visibleMenuItems(items).map(renderItem) });
|
|
5940
|
+
}
|
|
5941
|
+
function renderItem(item) {
|
|
5942
|
+
switch (item.type) {
|
|
5943
|
+
case "checkbox":
|
|
5944
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5945
|
+
CheckboxItem,
|
|
5946
|
+
{
|
|
5947
|
+
checked: item.checked,
|
|
5948
|
+
onCheckedChange: item.onCheckedChange,
|
|
5949
|
+
disabled: item.disabled,
|
|
5950
|
+
shortcut: item.shortcut,
|
|
5951
|
+
textValue: item.textValue,
|
|
5952
|
+
children: item.label
|
|
5953
|
+
},
|
|
5954
|
+
item.id
|
|
5955
|
+
);
|
|
5956
|
+
case "radio":
|
|
5957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(RadioGroup3, { value: item.value, onValueChange: item.onValueChange, children: item.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(RadioItem, { value: option.value, disabled: option.disabled, children: option.label }, option.value)) }, item.id);
|
|
5958
|
+
case "group":
|
|
5959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Group, { label: item.label, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Items, { items: item.items }) }, item.id);
|
|
5960
|
+
case "submenu":
|
|
5961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Sub, { children: [
|
|
5962
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SubTrigger, { icon: item.icon, disabled: item.disabled, children: item.label }),
|
|
5963
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SubContent, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Items, { items: item.items }) })
|
|
5964
|
+
] }, item.id);
|
|
5965
|
+
case "label":
|
|
5966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Label3, { children: item.label }, item.id);
|
|
5967
|
+
case "separator":
|
|
5968
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Separator3, {}, item.id);
|
|
5969
|
+
case "custom":
|
|
5970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_react39.Fragment, { children: item.render() }, item.id);
|
|
5971
|
+
default:
|
|
5972
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
5973
|
+
Item,
|
|
5974
|
+
{
|
|
5975
|
+
onSelect: item.onSelect,
|
|
5976
|
+
tone: item.tone,
|
|
5977
|
+
disabled: item.disabled,
|
|
5978
|
+
icon: item.icon,
|
|
5979
|
+
description: item.description,
|
|
5980
|
+
shortcut: item.shortcut,
|
|
5981
|
+
textValue: item.textValue,
|
|
5982
|
+
children: item.label
|
|
5983
|
+
},
|
|
5984
|
+
item.id
|
|
5985
|
+
);
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5698
5988
|
return {
|
|
5989
|
+
Items,
|
|
5699
5990
|
Item,
|
|
5700
5991
|
CheckboxItem,
|
|
5701
5992
|
RadioGroup: RadioGroup3,
|
|
@@ -5712,13 +6003,16 @@ function createMenuParts(P) {
|
|
|
5712
6003
|
|
|
5713
6004
|
// src/components/overlays/context-menu.tsx
|
|
5714
6005
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
5715
|
-
function ContextMenu({ children, open: openProp, defaultOpen = false, onOpenChange }) {
|
|
6006
|
+
function ContextMenu({ children, items, open: openProp, defaultOpen = false, onOpenChange }) {
|
|
5716
6007
|
const [, setOpen] = useControllableState({
|
|
5717
6008
|
value: openProp,
|
|
5718
6009
|
defaultValue: defaultOpen,
|
|
5719
6010
|
onChange: onOpenChange
|
|
5720
6011
|
});
|
|
5721
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_radix_ui5.ContextMenu.Root, { onOpenChange: setOpen, modal: false, children
|
|
6012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_radix_ui5.ContextMenu.Root, { onOpenChange: setOpen, modal: false, children: items ? /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
6013
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ContextMenuTrigger, { children }),
|
|
6014
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ContextMenuContent, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ContextMenuItems, { items }) })
|
|
6015
|
+
] }) : children });
|
|
5722
6016
|
}
|
|
5723
6017
|
var ContextMenuTrigger = (0, import_react40.forwardRef)(
|
|
5724
6018
|
function ContextMenuTrigger2({ children, disabled = false, className, onKeyDown, ...rest }, ref) {
|
|
@@ -5783,6 +6077,7 @@ var ContextMenuContent = (0, import_react40.forwardRef)(
|
|
|
5783
6077
|
}
|
|
5784
6078
|
);
|
|
5785
6079
|
var parts = createMenuParts(import_radix_ui5.ContextMenu);
|
|
6080
|
+
var ContextMenuItems = parts.Items;
|
|
5786
6081
|
var ContextMenuItem = parts.Item;
|
|
5787
6082
|
var ContextMenuCheckboxItem = parts.CheckboxItem;
|
|
5788
6083
|
var ContextMenuRadioGroup = parts.RadioGroup;
|
|
@@ -5799,7 +6094,7 @@ var ContextMenuSubContent = parts.SubContent;
|
|
|
5799
6094
|
var import_react41 = require("react");
|
|
5800
6095
|
var import_radix_ui6 = require("radix-ui");
|
|
5801
6096
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
5802
|
-
var Menubar = (0, import_react41.forwardRef)(function Menubar2({ children, label, value, defaultValue, onValueChange, className, ...rest }, ref) {
|
|
6097
|
+
var Menubar = (0, import_react41.forwardRef)(function Menubar2({ children, menus, label, value, defaultValue, onValueChange, className, ...rest }, ref) {
|
|
5803
6098
|
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
5804
6099
|
import_radix_ui6.Menubar.Root,
|
|
5805
6100
|
{
|
|
@@ -5812,7 +6107,10 @@ var Menubar = (0, import_react41.forwardRef)(function Menubar2({ children, label
|
|
|
5812
6107
|
"data-slot": "menubar",
|
|
5813
6108
|
className: cn("flex items-center gap-0.5", className),
|
|
5814
6109
|
...rest,
|
|
5815
|
-
children
|
|
6110
|
+
children: menus ? menus.filter((menu) => !menu.hidden).map((menu) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(MenubarMenu, { value: menu.value, children: [
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MenubarTrigger, { children: menu.label }),
|
|
6112
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MenubarContent, { children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(MenubarItems, { items: menu.items }) })
|
|
6113
|
+
] }, menu.value)) : children
|
|
5816
6114
|
}
|
|
5817
6115
|
);
|
|
5818
6116
|
});
|
|
@@ -5868,6 +6166,7 @@ var MenubarContent = (0, import_react41.forwardRef)(
|
|
|
5868
6166
|
}
|
|
5869
6167
|
);
|
|
5870
6168
|
var parts2 = createMenuParts(import_radix_ui6.Menubar);
|
|
6169
|
+
var MenubarItems = parts2.Items;
|
|
5871
6170
|
var MenubarItem = parts2.Item;
|
|
5872
6171
|
var MenubarCheckboxItem = parts2.CheckboxItem;
|
|
5873
6172
|
var MenubarRadioGroup = parts2.RadioGroup;
|
|
@@ -6314,6 +6613,11 @@ function useDropdownMenuState(part) {
|
|
|
6314
6613
|
}
|
|
6315
6614
|
function DropdownMenu({
|
|
6316
6615
|
children,
|
|
6616
|
+
items,
|
|
6617
|
+
trigger,
|
|
6618
|
+
label,
|
|
6619
|
+
side,
|
|
6620
|
+
align,
|
|
6317
6621
|
open: openProp,
|
|
6318
6622
|
defaultOpen = false,
|
|
6319
6623
|
onOpenChange,
|
|
@@ -6326,7 +6630,10 @@ function DropdownMenu({
|
|
|
6326
6630
|
});
|
|
6327
6631
|
const pendingEdge = (0, import_react46.useRef)("start");
|
|
6328
6632
|
const state = (0, import_react46.useMemo)(() => ({ setOpen, pendingEdge }), [setOpen]);
|
|
6329
|
-
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radix_ui8.DropdownMenu.Root, { open, onOpenChange: setOpen, modal, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuStateContext.Provider, { value: state, children
|
|
6633
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_radix_ui8.DropdownMenu.Root, { open, onOpenChange: setOpen, modal, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuStateContext.Provider, { value: state, children: items ? /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
|
|
6634
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuTrigger, { asChild: trigger != null, label, children: trigger }),
|
|
6635
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuContent, { side, align, children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(DropdownMenuItems, { items }) })
|
|
6636
|
+
] }) : children }) });
|
|
6330
6637
|
}
|
|
6331
6638
|
var DropdownMenuTrigger = (0, import_react46.forwardRef)(
|
|
6332
6639
|
function DropdownMenuTrigger2({ children, asChild = false, label = "Open menu", onClick, onPointerDown, onMouseDown, onKeyDown, ...rest }, ref) {
|
|
@@ -6411,6 +6718,7 @@ var DropdownMenuContent = (0, import_react46.forwardRef)(
|
|
|
6411
6718
|
}
|
|
6412
6719
|
);
|
|
6413
6720
|
var parts3 = createMenuParts(import_radix_ui8.DropdownMenu);
|
|
6721
|
+
var DropdownMenuItems = parts3.Items;
|
|
6414
6722
|
var DropdownMenuItem = parts3.Item;
|
|
6415
6723
|
var DropdownMenuCheckboxItem = parts3.CheckboxItem;
|
|
6416
6724
|
var DropdownMenuRadioGroup = parts3.RadioGroup;
|
|
@@ -6648,7 +6956,8 @@ var import_lucide_react19 = require("lucide-react");
|
|
|
6648
6956
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
6649
6957
|
var HeadingLevel = (0, import_react50.createContext)(3);
|
|
6650
6958
|
var Accordion = (0, import_react50.forwardRef)(function Accordion2({
|
|
6651
|
-
children,
|
|
6959
|
+
children: childrenProp,
|
|
6960
|
+
items,
|
|
6652
6961
|
type = "single",
|
|
6653
6962
|
value,
|
|
6654
6963
|
defaultValue,
|
|
@@ -6659,6 +6968,10 @@ var Accordion = (0, import_react50.forwardRef)(function Accordion2({
|
|
|
6659
6968
|
className,
|
|
6660
6969
|
...rest
|
|
6661
6970
|
}, ref) {
|
|
6971
|
+
const children = items ? items.filter((item) => !item.hidden).map((item) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(AccordionItem, { value: item.value, disabled: item.disabled, children: [
|
|
6972
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AccordionTrigger, { children: item.label }),
|
|
6973
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AccordionContent, { children: item.content })
|
|
6974
|
+
] }, item.value)) : childrenProp;
|
|
6662
6975
|
const shared = {
|
|
6663
6976
|
ref,
|
|
6664
6977
|
disabled,
|
|
@@ -8011,9 +8324,23 @@ var import_react59 = require("react");
|
|
|
8011
8324
|
var import_clsx59 = __toESM(require("clsx"), 1);
|
|
8012
8325
|
var import_lucide_react22 = require("lucide-react");
|
|
8013
8326
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
8014
|
-
var Breadcrumb = (0, import_react59.forwardRef)(function Breadcrumb2({ children, label = "Breadcrumb", className, ...rest }, ref) {
|
|
8015
|
-
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("nav", { ref, "aria-label": label, "data-slot": "breadcrumb", ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("ol", { className: (0, import_clsx59.default)("flex flex-wrap items-center gap-1.5 p-0 text-body-xs", className), children }) });
|
|
8327
|
+
var Breadcrumb = (0, import_react59.forwardRef)(function Breadcrumb2({ children, items, renderLink, maxItems, label = "Breadcrumb", className, ...rest }, ref) {
|
|
8328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("nav", { ref, "aria-label": label, "data-slot": "breadcrumb", ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("ol", { className: (0, import_clsx59.default)("flex flex-wrap items-center gap-1.5 p-0 text-body-xs", className), children: items ? renderItems(items, renderLink, maxItems) : children }) });
|
|
8016
8329
|
});
|
|
8330
|
+
function renderItems(items, renderLink, maxItems) {
|
|
8331
|
+
const last = items.length - 1;
|
|
8332
|
+
const collapse = maxItems !== void 0 && maxItems >= 2 && items.length > maxItems;
|
|
8333
|
+
const shown = collapse ? [0, ...items.map((_, i) => i).slice(items.length - (maxItems - 1))] : items.map((_, i) => i);
|
|
8334
|
+
return shown.map((index, position) => {
|
|
8335
|
+
const item = items[index];
|
|
8336
|
+
const current = item.current ?? index === last;
|
|
8337
|
+
const crumb = !current && renderLink ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BreadcrumbItem, { asChild: true, first: position === 0, children: renderLink(item) }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BreadcrumbItem, { href: item.href, current, first: position === 0, children: item.label });
|
|
8338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_react59.Fragment, { children: [
|
|
8339
|
+
crumb,
|
|
8340
|
+
collapse && position === 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(BreadcrumbEllipsis, {})
|
|
8341
|
+
] }, item.id ?? index);
|
|
8342
|
+
});
|
|
8343
|
+
}
|
|
8017
8344
|
var BreadcrumbItem = (0, import_react59.forwardRef)(
|
|
8018
8345
|
function BreadcrumbItem2({ children, current = false, asChild = false, first = false, className, ...rest }, ref) {
|
|
8019
8346
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("li", { className: "flex items-center gap-1.5", children: [
|
|
@@ -8239,8 +8566,8 @@ function PaginationBar({
|
|
|
8239
8566
|
SelectControl,
|
|
8240
8567
|
{
|
|
8241
8568
|
"aria-label": "Rows per page",
|
|
8242
|
-
size: "
|
|
8243
|
-
className: "w-
|
|
8569
|
+
size: "md",
|
|
8570
|
+
className: "w-20",
|
|
8244
8571
|
value: String(pageSize),
|
|
8245
8572
|
options: options.map((size2) => ({ value: String(size2), label: String(size2) })),
|
|
8246
8573
|
onValueChange: (value) => onPageSizeChange?.(Number(value))
|
|
@@ -9469,6 +9796,7 @@ function refusePress(event) {
|
|
|
9469
9796
|
|
|
9470
9797
|
// src/components/lists/file-row.tsx
|
|
9471
9798
|
var import_clsx80 = __toESM(require("clsx"), 1);
|
|
9799
|
+
var import_lucide_react25 = require("lucide-react");
|
|
9472
9800
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
9473
9801
|
function FileTypeBadge({ type }) {
|
|
9474
9802
|
return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "flex size-[34px] shrink-0 items-center justify-center rounded-md bg-brand-tertiary text-body-tiny font-semibold text-brand", children: type });
|
|
@@ -9480,6 +9808,8 @@ function FileRow({
|
|
|
9480
9808
|
leading,
|
|
9481
9809
|
onDownload,
|
|
9482
9810
|
downloadLabel = "Download",
|
|
9811
|
+
onRemove,
|
|
9812
|
+
removeLabel = "Remove",
|
|
9483
9813
|
actions,
|
|
9484
9814
|
className
|
|
9485
9815
|
}) {
|
|
@@ -9497,17 +9827,10 @@ function FileRow({
|
|
|
9497
9827
|
/* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "truncate text-body-sm font-medium text-default", children: name }),
|
|
9498
9828
|
detail && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("span", { className: "text-body-xs text-default-secondary", children: detail })
|
|
9499
9829
|
] }),
|
|
9500
|
-
(onDownload || actions) && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex shrink-0 items-center gap-
|
|
9501
|
-
onDownload && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
|
|
9502
|
-
|
|
9503
|
-
|
|
9504
|
-
type: "button",
|
|
9505
|
-
onClick: onDownload,
|
|
9506
|
-
className: "text-body-xs font-medium text-brand hover:underline",
|
|
9507
|
-
children: downloadLabel
|
|
9508
|
-
}
|
|
9509
|
-
),
|
|
9510
|
-
actions
|
|
9830
|
+
(onDownload || onRemove || actions) && /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
9831
|
+
onDownload && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Tooltip, { title: downloadLabel, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(IconButton, { variant: "subtle", size: "sm", "aria-label": `${downloadLabel} ${name}`, onClick: onDownload, className: "touch-hit", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react25.DownloadIcon, { "aria-hidden": true }) }) }),
|
|
9832
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(Tooltip, { title: removeLabel, children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(IconButton, { variant: "subtle", size: "sm", "aria-label": `${removeLabel} ${name}`, onClick: onRemove, className: "touch-hit", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_lucide_react25.Trash2Icon, { "aria-hidden": true }) }) }),
|
|
9833
|
+
actions && /* @__PURE__ */ (0, import_jsx_runtime101.jsx)("div", { className: "ml-2 flex items-center gap-2", children: actions })
|
|
9511
9834
|
] })
|
|
9512
9835
|
]
|
|
9513
9836
|
}
|
|
@@ -9732,11 +10055,11 @@ function IconTextRow({ icon, title, detail, className }) {
|
|
|
9732
10055
|
|
|
9733
10056
|
// src/components/lists/checklist-row.tsx
|
|
9734
10057
|
var import_clsx84 = __toESM(require("clsx"), 1);
|
|
9735
|
-
var
|
|
10058
|
+
var import_lucide_react26 = require("lucide-react");
|
|
9736
10059
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
9737
10060
|
function ChecklistRow({ label, state, className }) {
|
|
9738
10061
|
return /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)("li", { "data-state": state, className: (0, import_clsx84.default)("flex items-center gap-3", className), children: [
|
|
9739
|
-
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center", children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
10062
|
+
/* @__PURE__ */ (0, import_jsx_runtime106.jsx)("span", { className: "flex size-5 shrink-0 items-center justify-center", children: state === "done" ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_lucide_react26.CheckIcon, { className: "size-4 text-positive", strokeWidth: 2.5, "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
|
|
9740
10063
|
"span",
|
|
9741
10064
|
{
|
|
9742
10065
|
className: (0, import_clsx84.default)(
|
|
@@ -9819,7 +10142,7 @@ function DetailGrid({ children, columns = "auto", className }) {
|
|
|
9819
10142
|
// src/components/lists/description-list.tsx
|
|
9820
10143
|
var import_react66 = require("react");
|
|
9821
10144
|
var import_clsx87 = __toESM(require("clsx"), 1);
|
|
9822
|
-
var
|
|
10145
|
+
var import_lucide_react27 = require("lucide-react");
|
|
9823
10146
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
9824
10147
|
function DescriptionList({ children, className }) {
|
|
9825
10148
|
return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("dl", { className: cn("flex flex-col gap-3", className), children });
|
|
@@ -9841,26 +10164,29 @@ function CopyButton({ value, label, copiedLabel = "Copied", className }) {
|
|
|
9841
10164
|
const timer = window.setTimeout(() => setCopied(false), 2e3);
|
|
9842
10165
|
return () => window.clearTimeout(timer);
|
|
9843
10166
|
}, [copied]);
|
|
9844
|
-
return
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
|
|
9848
|
-
|
|
9849
|
-
|
|
9850
|
-
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
()
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9863
|
-
|
|
10167
|
+
return (
|
|
10168
|
+
// relative: keeps the sr-only status (absolutely positioned) inside a scrolling container.
|
|
10169
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsxs)("span", { className: "relative inline-flex", children: [
|
|
10170
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
|
|
10171
|
+
IconButton,
|
|
10172
|
+
{
|
|
10173
|
+
variant: "subtle",
|
|
10174
|
+
size: "sm",
|
|
10175
|
+
"aria-label": label,
|
|
10176
|
+
"data-state": copied ? "copied" : void 0,
|
|
10177
|
+
className: cn("-my-0.5 touch-hit", className),
|
|
10178
|
+
onClick: () => {
|
|
10179
|
+
void navigator.clipboard?.writeText(value).then(
|
|
10180
|
+
() => setCopied(true),
|
|
10181
|
+
() => void 0
|
|
10182
|
+
);
|
|
10183
|
+
},
|
|
10184
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react27.CheckIcon, { "aria-hidden": true }) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_lucide_react27.CopyIcon, { "aria-hidden": true })
|
|
10185
|
+
}
|
|
10186
|
+
),
|
|
10187
|
+
/* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { role: "status", className: "sr-only", children: copied ? copiedLabel : "" })
|
|
10188
|
+
] })
|
|
10189
|
+
);
|
|
9864
10190
|
}
|
|
9865
10191
|
function EmailText({ email, className }) {
|
|
9866
10192
|
const at = email.lastIndexOf("@");
|
|
@@ -9874,7 +10200,7 @@ function EmailText({ email, className }) {
|
|
|
9874
10200
|
|
|
9875
10201
|
// src/components/lists/checked-group-list.tsx
|
|
9876
10202
|
var import_clsx88 = __toESM(require("clsx"), 1);
|
|
9877
|
-
var
|
|
10203
|
+
var import_lucide_react28 = require("lucide-react");
|
|
9878
10204
|
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
9879
10205
|
var COLUMNS4 = {
|
|
9880
10206
|
1: "columns-1",
|
|
@@ -9891,7 +10217,7 @@ function CheckedGroupList({
|
|
|
9891
10217
|
if (groups.length === 0) {
|
|
9892
10218
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: (0, import_clsx88.default)("text-body-xs text-default-secondary", className), children: emptyLabel });
|
|
9893
10219
|
}
|
|
9894
|
-
const glyph = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
|
|
10220
|
+
const glyph = icon === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_lucide_react28.CheckIcon, { className: "size-3.5", strokeWidth: 2.5, "aria-hidden": true }) : icon;
|
|
9895
10221
|
return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { className: (0, import_clsx88.default)(COLUMNS4[columns], "gap-x-6", className), children: groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("div", { className: "mb-5 break-inside-avoid last:mb-0", children: [
|
|
9896
10222
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("p", { className: "mb-2 text-body-tiny font-semibold uppercase tracking-wide text-default-secondary", children: group.label }),
|
|
9897
10223
|
/* @__PURE__ */ (0, import_jsx_runtime110.jsx)("ul", { className: "space-y-1.5", children: group.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)("li", { className: "flex items-center gap-2 text-body-xs text-default", children: [
|
|
@@ -9904,7 +10230,7 @@ function CheckedGroupList({
|
|
|
9904
10230
|
// src/components/lists/tree-view.tsx
|
|
9905
10231
|
var import_react67 = require("react");
|
|
9906
10232
|
var import_clsx89 = __toESM(require("clsx"), 1);
|
|
9907
|
-
var
|
|
10233
|
+
var import_lucide_react29 = require("lucide-react");
|
|
9908
10234
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
9909
10235
|
var ROW = {
|
|
9910
10236
|
sm: "min-h-8 py-1 text-body-xs",
|
|
@@ -10060,7 +10386,7 @@ function TreeView({
|
|
|
10060
10386
|
focus(id);
|
|
10061
10387
|
},
|
|
10062
10388
|
className: "flex size-5 shrink-0 items-center justify-center rounded text-icon-default-secondary hover:bg-default-tertiary",
|
|
10063
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
|
|
10389
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_lucide_react29.ChevronRightIcon, { className: (0, import_clsx89.default)("size-3.5 transition-transform", node.expanded && "rotate-90") })
|
|
10064
10390
|
}
|
|
10065
10391
|
)
|
|
10066
10392
|
) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { "aria-hidden": true, className: "size-5 shrink-0" }),
|
|
@@ -10085,27 +10411,39 @@ function TreeView({
|
|
|
10085
10411
|
// src/components/lists/table.tsx
|
|
10086
10412
|
var import_react68 = require("react");
|
|
10087
10413
|
var import_clsx90 = __toESM(require("clsx"), 1);
|
|
10088
|
-
var
|
|
10414
|
+
var import_lucide_react30 = require("lucide-react");
|
|
10089
10415
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
10090
|
-
var Table = (0, import_react68.forwardRef)(function Table2({ label, density = "default", fixed = false, className, children, ...rest }, ref) {
|
|
10416
|
+
var Table = (0, import_react68.forwardRef)(function Table2({ label, density = "default", fixed = false, maxHeight, className, children, ...rest }, ref) {
|
|
10091
10417
|
return (
|
|
10092
10418
|
// The scroll container is separate from the table so the header stays inside the
|
|
10093
10419
|
// scrolling region — a table that is its own scroll container cannot have a sticky
|
|
10094
10420
|
// header.
|
|
10095
10421
|
// The scroll wrapper is required for a <table>, which cannot itself scroll, so this
|
|
10096
10422
|
// takes the scrollbar styling rather than ScrollArea.
|
|
10097
|
-
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
10098
|
-
"
|
|
10423
|
+
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
10424
|
+
"div",
|
|
10099
10425
|
{
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10426
|
+
className: (0, import_clsx90.default)(
|
|
10427
|
+
"w-full",
|
|
10428
|
+
maxHeight ? (0, import_clsx90.default)("overflow-auto overscroll-contain", FOCUS_RING_INSET) : "overflow-x-auto",
|
|
10429
|
+
SCROLLBAR_CLASSES
|
|
10430
|
+
),
|
|
10431
|
+
style: maxHeight ? { maxHeight } : void 0,
|
|
10432
|
+
...maxHeight ? { role: "region", tabIndex: 0, "aria-label": label ? `${label} (scrolls)` : "Table (scrolls)" } : {},
|
|
10433
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
10434
|
+
"table",
|
|
10435
|
+
{
|
|
10436
|
+
ref,
|
|
10437
|
+
"aria-label": label,
|
|
10438
|
+
"data-slot": "table",
|
|
10439
|
+
"data-density": density,
|
|
10440
|
+
className: cn("w-full border-collapse", fixed && "table-fixed", className),
|
|
10441
|
+
...rest,
|
|
10442
|
+
children
|
|
10443
|
+
}
|
|
10444
|
+
)
|
|
10107
10445
|
}
|
|
10108
|
-
)
|
|
10446
|
+
)
|
|
10109
10447
|
);
|
|
10110
10448
|
});
|
|
10111
10449
|
var TableCaption = (0, import_react68.forwardRef)(
|
|
@@ -10197,7 +10535,7 @@ var TableHead = (0, import_react68.forwardRef)(function TableHead2({ sort, onSor
|
|
|
10197
10535
|
),
|
|
10198
10536
|
children: [
|
|
10199
10537
|
children,
|
|
10200
|
-
sort === false ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
10538
|
+
sort === false ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_lucide_react30.ChevronsUpDownIcon, { "aria-hidden": true, className: "size-3.5 opacity-50" }) : sort === "ascending" ? /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_lucide_react30.ChevronUpIcon, { "aria-hidden": true, className: "size-3.5" }) : /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_lucide_react30.ChevronDownIcon, { "aria-hidden": true, className: "size-3.5" })
|
|
10201
10539
|
]
|
|
10202
10540
|
}
|
|
10203
10541
|
) : children
|
|
@@ -10359,7 +10697,7 @@ function cardSlots(columns) {
|
|
|
10359
10697
|
}
|
|
10360
10698
|
|
|
10361
10699
|
// src/components/lists/data-table-parts.tsx
|
|
10362
|
-
var
|
|
10700
|
+
var import_lucide_react31 = require("lucide-react");
|
|
10363
10701
|
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
10364
10702
|
var SELECT_COLUMN_ID = "select";
|
|
10365
10703
|
function columnLabel(column) {
|
|
@@ -10379,7 +10717,7 @@ function DataTableColumnHeader({
|
|
|
10379
10717
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("span", { className: cn(hidden ? "sr-only" : "inline-block w-max whitespace-nowrap", className), children: text });
|
|
10380
10718
|
}
|
|
10381
10719
|
const sorted = column.getIsSorted();
|
|
10382
|
-
const Icon = sorted === "asc" ?
|
|
10720
|
+
const Icon = sorted === "asc" ? import_lucide_react31.ChevronUpIcon : sorted === "desc" ? import_lucide_react31.ChevronDownIcon : import_lucide_react31.ChevronsUpDownIcon;
|
|
10383
10721
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
|
|
10384
10722
|
"button",
|
|
10385
10723
|
{
|
|
@@ -10439,7 +10777,7 @@ function DataTableViewOptions({ table, label = "Columns" }) {
|
|
|
10439
10777
|
const columns = table.getAllLeafColumns().filter((column) => column.getCanHide());
|
|
10440
10778
|
if (columns.length === 0) return null;
|
|
10441
10779
|
return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(DropdownMenu, { children: [
|
|
10442
|
-
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Button, { variant: "neutral", size: "
|
|
10780
|
+
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(Button, { variant: "neutral", size: "md", leadingIcon: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_lucide_react31.Columns3Icon, { "aria-hidden": true }), children: label }) }),
|
|
10443
10781
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(DropdownMenuContent, { align: "end", children: [
|
|
10444
10782
|
/* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DropdownMenuLabel, { children: "Show columns" }),
|
|
10445
10783
|
columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
|
|
@@ -10542,18 +10880,18 @@ function TableCellProgress({
|
|
|
10542
10880
|
className
|
|
10543
10881
|
}) {
|
|
10544
10882
|
const clamped = Math.min(100, Math.max(0, percent));
|
|
10545
|
-
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_clsx93.default)("flex
|
|
10883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("div", { className: (0, import_clsx93.default)("flex w-full min-w-0 items-center gap-2", className), children: [
|
|
10546
10884
|
/* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
|
|
10547
10885
|
ProgressBar,
|
|
10548
10886
|
{
|
|
10549
10887
|
value: clamped,
|
|
10550
10888
|
tone,
|
|
10551
|
-
size: "sm",
|
|
10552
|
-
className:
|
|
10889
|
+
size: size2 === "sm" ? "xs" : "sm",
|
|
10890
|
+
className: "min-w-12 flex-1",
|
|
10553
10891
|
"aria-label": `${clamped}%`
|
|
10554
10892
|
}
|
|
10555
10893
|
),
|
|
10556
|
-
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "text-body-tiny leading-none text-default-secondary", children: [
|
|
10894
|
+
/* @__PURE__ */ (0, import_jsx_runtime116.jsxs)("span", { className: "shrink-0 text-body-tiny leading-none tabular-nums text-default-secondary", children: [
|
|
10557
10895
|
percent,
|
|
10558
10896
|
"%"
|
|
10559
10897
|
] })
|
|
@@ -10654,17 +10992,19 @@ function useHeaderWidths(padding2, deps) {
|
|
|
10654
10992
|
}
|
|
10655
10993
|
function useScrollEdges() {
|
|
10656
10994
|
const [node, setNode] = (0, import_react71.useState)(null);
|
|
10657
|
-
const [edges, setEdges] = (0, import_react71.useState)({ overflowing: false, atStart: true, atEnd: true });
|
|
10995
|
+
const [edges, setEdges] = (0, import_react71.useState)({ overflowing: false, atStart: true, atEnd: true, overflowingY: false, atTop: true });
|
|
10658
10996
|
const measure = (0, import_react71.useCallback)(() => {
|
|
10659
10997
|
if (!node) return;
|
|
10660
|
-
const { scrollLeft, scrollWidth, clientWidth } = node;
|
|
10998
|
+
const { scrollLeft, scrollWidth, clientWidth, scrollTop, scrollHeight, clientHeight } = node;
|
|
10661
10999
|
const next = {
|
|
10662
11000
|
overflowing: scrollWidth > clientWidth + 1,
|
|
10663
11001
|
atStart: scrollLeft <= 1,
|
|
10664
|
-
atEnd: scrollLeft + clientWidth >= scrollWidth - 1
|
|
11002
|
+
atEnd: scrollLeft + clientWidth >= scrollWidth - 1,
|
|
11003
|
+
overflowingY: scrollHeight > clientHeight + 1,
|
|
11004
|
+
atTop: scrollTop <= 1
|
|
10665
11005
|
};
|
|
10666
11006
|
setEdges(
|
|
10667
|
-
(previous) => previous.overflowing === next.overflowing && previous.atStart === next.atStart && previous.atEnd === next.atEnd ? previous : next
|
|
11007
|
+
(previous) => previous.overflowing === next.overflowing && previous.atStart === next.atStart && previous.atEnd === next.atEnd && previous.overflowingY === next.overflowingY && previous.atTop === next.atTop ? previous : next
|
|
10668
11008
|
);
|
|
10669
11009
|
}, [node]);
|
|
10670
11010
|
(0, import_react71.useLayoutEffect)(() => {
|
|
@@ -10710,6 +11050,7 @@ function DataTable({
|
|
|
10710
11050
|
density = "default",
|
|
10711
11051
|
align = "center",
|
|
10712
11052
|
responsive = true,
|
|
11053
|
+
maxHeight,
|
|
10713
11054
|
manual = {},
|
|
10714
11055
|
state = {},
|
|
10715
11056
|
onSortingChange,
|
|
@@ -10819,14 +11160,15 @@ function DataTable({
|
|
|
10819
11160
|
renderRowLink,
|
|
10820
11161
|
getRowTone,
|
|
10821
11162
|
getRowDimmed,
|
|
10822
|
-
getRowLabel
|
|
11163
|
+
getRowLabel,
|
|
11164
|
+
maxHeight
|
|
10823
11165
|
};
|
|
10824
|
-
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { "data-slot": "data-table", className: cn("flex flex-col gap-3", className), children: [
|
|
11166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { "data-slot": "data-table", className: cn("relative flex flex-col gap-3", className), children: [
|
|
10825
11167
|
showToolbar && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
10826
11168
|
search && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
10827
11169
|
SearchInput,
|
|
10828
11170
|
{
|
|
10829
|
-
size: "
|
|
11171
|
+
size: "md",
|
|
10830
11172
|
label: search.label ?? "Search",
|
|
10831
11173
|
placeholder: search.placeholder ?? "Search\u2026",
|
|
10832
11174
|
value: searchValue,
|
|
@@ -10840,7 +11182,7 @@ function DataTable({
|
|
|
10840
11182
|
] }),
|
|
10841
11183
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { role: "status", "aria-live": "polite", className: "sr-only", children: filtering && !loading ? `${resultCount} ${resultCount === 1 ? "result" : "results"}` : "" }),
|
|
10842
11184
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { ref: wrapRef, className: "overflow-hidden rounded-xl border border-default bg-default", children: [
|
|
10843
|
-
mode === "cards" ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CardList, { ...view }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TableView, { ...view }),
|
|
11185
|
+
mode === "cards" ? maxHeight ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CardScroll, { label, maxHeight, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CardList, { ...view }) }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CardList, { ...view }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TableView, { ...view }),
|
|
10844
11186
|
showPager && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "border-t border-default px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(DataTablePagination, { table, pageSizeOptions }) }),
|
|
10845
11187
|
footer && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "border-t border-default px-4 py-3", children: footer })
|
|
10846
11188
|
] })
|
|
@@ -10863,7 +11205,8 @@ function TableView({
|
|
|
10863
11205
|
getRowHref,
|
|
10864
11206
|
renderRowLink,
|
|
10865
11207
|
getRowTone,
|
|
10866
|
-
getRowDimmed
|
|
11208
|
+
getRowDimmed,
|
|
11209
|
+
maxHeight
|
|
10867
11210
|
}) {
|
|
10868
11211
|
const d = DENSITY2[density];
|
|
10869
11212
|
const columns = table.getVisibleLeafColumns();
|
|
@@ -10891,15 +11234,23 @@ function TableView({
|
|
|
10891
11234
|
],
|
|
10892
11235
|
(id === stickyStart || id === stickyEnd) && (header ? "bg-default-secondary" : ["bg-default", rowAction && "group-hover:bg-default-secondary"])
|
|
10893
11236
|
);
|
|
10894
|
-
const
|
|
11237
|
+
const scrolls = scroll.overflowing || Boolean(maxHeight) && scroll.overflowingY;
|
|
11238
|
+
const direction = scroll.overflowing && maxHeight && scroll.overflowingY ? "scrolls" : scroll.overflowing ? "scrolls horizontally" : "scrolls vertically";
|
|
11239
|
+
const regionLabel = `${label ?? "Table"} (${direction})`;
|
|
11240
|
+
const pinnedHeader = maxHeight ? (0, import_clsx94.default)("sticky top-0 z-sticky bg-default-secondary", !scroll.atTop && "shadow-[inset_0_-1px_0_var(--color-border-default-default)]") : void 0;
|
|
10895
11241
|
return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: "relative", children: [
|
|
10896
11242
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
10897
11243
|
"div",
|
|
10898
11244
|
{
|
|
10899
11245
|
ref: scroll.ref,
|
|
10900
11246
|
onScroll: scroll.onScroll,
|
|
10901
|
-
className: cn(
|
|
10902
|
-
|
|
11247
|
+
className: cn(
|
|
11248
|
+
maxHeight ? "overflow-auto overscroll-contain" : "overflow-x-auto overscroll-x-contain",
|
|
11249
|
+
SCROLLBAR_CLASSES,
|
|
11250
|
+
scrolls && FOCUS_RING_INSET
|
|
11251
|
+
),
|
|
11252
|
+
style: maxHeight ? { maxHeight } : void 0,
|
|
11253
|
+
...scrolls ? { role: "region", tabIndex: 0, "aria-label": regionLabel } : {},
|
|
10903
11254
|
children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
|
|
10904
11255
|
"table",
|
|
10905
11256
|
{
|
|
@@ -10936,6 +11287,7 @@ function TableView({
|
|
|
10936
11287
|
TEXT_ALIGN[meta?.align ?? "start"],
|
|
10937
11288
|
!meta?.interactive && "overflow-hidden",
|
|
10938
11289
|
stickyClass(header.column.id, true),
|
|
11290
|
+
pinnedHeader,
|
|
10939
11291
|
meta?.headerClassName
|
|
10940
11292
|
),
|
|
10941
11293
|
children: header.isPlaceholder ? null : typeof definition === "string" || definition === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { ref: meta?.hideHeader ? void 0 : headers.register(header.column.id), className: "inline-block", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(DataTableColumnHeader, { column: header.column }) }) : (0, import_react_table.flexRender)(definition, header.getContext())
|
|
@@ -11055,6 +11407,20 @@ function BodyCell({
|
|
|
11055
11407
|
}
|
|
11056
11408
|
);
|
|
11057
11409
|
}
|
|
11410
|
+
function CardScroll({ label, maxHeight, children }) {
|
|
11411
|
+
const scroll = useScrollEdges();
|
|
11412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
|
|
11413
|
+
"div",
|
|
11414
|
+
{
|
|
11415
|
+
ref: scroll.ref,
|
|
11416
|
+
onScroll: scroll.onScroll,
|
|
11417
|
+
style: { maxHeight },
|
|
11418
|
+
className: cn("overflow-y-auto overscroll-contain", SCROLLBAR_CLASSES, scroll.overflowingY && FOCUS_RING_INSET),
|
|
11419
|
+
...scroll.overflowingY ? { role: "region", tabIndex: 0, "aria-label": `${label ?? "Table"} (scrolls vertically)` } : {},
|
|
11420
|
+
children
|
|
11421
|
+
}
|
|
11422
|
+
);
|
|
11423
|
+
}
|
|
11058
11424
|
function CardList({
|
|
11059
11425
|
table,
|
|
11060
11426
|
label,
|
|
@@ -11135,7 +11501,7 @@ function CardList({
|
|
|
11135
11501
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "flex max-w-[45%] shrink-0 justify-end [&_.whitespace-nowrap]:whitespace-normal", children: render(slots.status.id) }),
|
|
11136
11502
|
slots.actions && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { className: "relative z-raised shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CellInteractionGuard, { children: render(slots.actions.id) }) })
|
|
11137
11503
|
] }),
|
|
11138
|
-
slots.fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("dl", { className: "grid grid-cols-[repeat(auto-
|
|
11504
|
+
slots.fields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("dl", { className: "grid grid-cols-[repeat(auto-fit,minmax(min(100%,8.5rem),1fr))] gap-x-4 gap-y-2.5", children: slots.fields.map(({ id, column }) => /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { className: (0, import_clsx94.default)("min-w-0", column.columnDef.meta?.interactive && "relative z-raised"), children: [
|
|
11139
11505
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("dt", { className: "text-body-tiny text-default-secondary", children: columnLabel(column) }),
|
|
11140
11506
|
/* @__PURE__ */ (0, import_jsx_runtime117.jsx)("dd", { className: "mt-0.5 min-w-0 text-body-xs text-default", children: column.columnDef.meta?.interactive ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(CellInteractionGuard, { children: render(id) }) : render(id) })
|
|
11141
11507
|
] }, id)) })
|
|
@@ -11154,7 +11520,7 @@ var import_react_table2 = require("@tanstack/react-table");
|
|
|
11154
11520
|
|
|
11155
11521
|
// src/components/feedback/inline-alert.tsx
|
|
11156
11522
|
var import_clsx95 = __toESM(require("clsx"), 1);
|
|
11157
|
-
var
|
|
11523
|
+
var import_lucide_react32 = require("lucide-react");
|
|
11158
11524
|
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
11159
11525
|
var toneStyles3 = {
|
|
11160
11526
|
info: "border-brand-tertiary bg-brand-tertiary text-brand",
|
|
@@ -11163,10 +11529,10 @@ var toneStyles3 = {
|
|
|
11163
11529
|
positive: "border-positive-tertiary bg-positive-tertiary text-positive"
|
|
11164
11530
|
};
|
|
11165
11531
|
var toneIcons = {
|
|
11166
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11167
|
-
warning: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11168
|
-
danger: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11169
|
-
positive: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
|
|
11532
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react32.InfoIcon, { className: "size-4" }),
|
|
11533
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react32.TriangleAlertIcon, { className: "size-4" }),
|
|
11534
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react32.TriangleAlertIcon, { className: "size-4" }),
|
|
11535
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_lucide_react32.CircleCheckBigIcon, { className: "size-4" })
|
|
11170
11536
|
};
|
|
11171
11537
|
function InlineAlert({ tone, children, icon, className }) {
|
|
11172
11538
|
const glyph = icon === void 0 ? toneIcons[tone] : icon;
|
|
@@ -11225,7 +11591,7 @@ var ErrorBoundary = class extends import_react72.Component {
|
|
|
11225
11591
|
// src/components/feedback/banner.tsx
|
|
11226
11592
|
var import_react73 = require("react");
|
|
11227
11593
|
var import_clsx96 = __toESM(require("clsx"), 1);
|
|
11228
|
-
var
|
|
11594
|
+
var import_lucide_react33 = require("lucide-react");
|
|
11229
11595
|
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
11230
11596
|
var TONE_STYLES3 = {
|
|
11231
11597
|
info: "border-brand-tertiary bg-brand-tertiary text-default",
|
|
@@ -11240,10 +11606,10 @@ var TONE_ICON_COLOR = {
|
|
|
11240
11606
|
danger: "text-icon-danger"
|
|
11241
11607
|
};
|
|
11242
11608
|
var TONE_ICON2 = {
|
|
11243
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11244
|
-
positive: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11245
|
-
warning: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11246
|
-
danger: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11609
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react33.InfoIcon, { "aria-hidden": true, className: "size-5" }),
|
|
11610
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react33.CircleCheckBigIcon, { "aria-hidden": true, className: "size-5" }),
|
|
11611
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react33.TriangleAlertIcon, { "aria-hidden": true, className: "size-5" }),
|
|
11612
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react33.TriangleAlertIcon, { "aria-hidden": true, className: "size-5" })
|
|
11247
11613
|
};
|
|
11248
11614
|
var Banner = (0, import_react73.forwardRef)(function Banner2({
|
|
11249
11615
|
title,
|
|
@@ -11288,7 +11654,7 @@ var Banner = (0, import_react73.forwardRef)(function Banner2({
|
|
|
11288
11654
|
"aria-label": typeof title === "string" ? `Dismiss: ${title}` : "Dismiss",
|
|
11289
11655
|
onClick: onDismiss,
|
|
11290
11656
|
className: "-mr-1 -mt-1 shrink-0",
|
|
11291
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
|
|
11657
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_lucide_react33.XIcon, { "aria-hidden": true, size: 16 })
|
|
11292
11658
|
}
|
|
11293
11659
|
)
|
|
11294
11660
|
]
|
|
@@ -11299,7 +11665,7 @@ var Banner = (0, import_react73.forwardRef)(function Banner2({
|
|
|
11299
11665
|
// src/components/feedback/toast.tsx
|
|
11300
11666
|
var import_react74 = require("react");
|
|
11301
11667
|
var import_clsx97 = __toESM(require("clsx"), 1);
|
|
11302
|
-
var
|
|
11668
|
+
var import_lucide_react34 = require("lucide-react");
|
|
11303
11669
|
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
11304
11670
|
var ToastContext = (0, import_react74.createContext)(null);
|
|
11305
11671
|
function useToast() {
|
|
@@ -11308,10 +11674,10 @@ function useToast() {
|
|
|
11308
11674
|
return context;
|
|
11309
11675
|
}
|
|
11310
11676
|
var TONE_ICON3 = {
|
|
11311
|
-
info: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11312
|
-
positive: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11313
|
-
warning: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11314
|
-
danger: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11677
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react34.InfoIcon, { "aria-hidden": true, className: "size-4" }),
|
|
11678
|
+
positive: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react34.CircleCheckBigIcon, { "aria-hidden": true, className: "size-4" }),
|
|
11679
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react34.TriangleAlertIcon, { "aria-hidden": true, className: "size-4" }),
|
|
11680
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react34.TriangleAlertIcon, { "aria-hidden": true, className: "size-4" })
|
|
11315
11681
|
};
|
|
11316
11682
|
var TONE_ICON_COLOR2 = {
|
|
11317
11683
|
info: "text-icon-brand",
|
|
@@ -11415,7 +11781,7 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
11415
11781
|
"aria-label": typeof toast.title === "string" ? `Dismiss: ${toast.title}` : "Dismiss",
|
|
11416
11782
|
onClick: onDismiss,
|
|
11417
11783
|
className: "-mr-1 -mt-1 shrink-0",
|
|
11418
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
|
|
11784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_lucide_react34.XIcon, { "aria-hidden": true, size: 14 })
|
|
11419
11785
|
}
|
|
11420
11786
|
)
|
|
11421
11787
|
]
|
|
@@ -11425,7 +11791,7 @@ function ToastItem({ toast, onDismiss }) {
|
|
|
11425
11791
|
|
|
11426
11792
|
// src/components/forms/password-input.tsx
|
|
11427
11793
|
var import_react75 = require("react");
|
|
11428
|
-
var
|
|
11794
|
+
var import_lucide_react35 = require("lucide-react");
|
|
11429
11795
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
11430
11796
|
var PasswordInput = (0, import_react75.forwardRef)(function PasswordInput2(props, ref) {
|
|
11431
11797
|
const [visible, setVisible] = (0, import_react75.useState)(false);
|
|
@@ -11442,7 +11808,7 @@ var PasswordInput = (0, import_react75.forwardRef)(function PasswordInput2(props
|
|
|
11442
11808
|
"aria-label": visible ? "Hide password" : "Show password",
|
|
11443
11809
|
onClick: () => setVisible((v) => !v),
|
|
11444
11810
|
className: "flex items-center justify-center rounded transition-colors hover:text-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand",
|
|
11445
|
-
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
|
|
11811
|
+
children: visible ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react35.EyeOffIcon, { "aria-hidden": true, className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_lucide_react35.EyeIcon, { "aria-hidden": true, className: "size-4" })
|
|
11446
11812
|
}
|
|
11447
11813
|
)
|
|
11448
11814
|
}
|
|
@@ -11451,7 +11817,7 @@ var PasswordInput = (0, import_react75.forwardRef)(function PasswordInput2(props
|
|
|
11451
11817
|
|
|
11452
11818
|
// src/components/ai/ai-chat-bar.tsx
|
|
11453
11819
|
var import_clsx98 = __toESM(require("clsx"), 1);
|
|
11454
|
-
var
|
|
11820
|
+
var import_lucide_react36 = require("lucide-react");
|
|
11455
11821
|
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
11456
11822
|
function AIChatBar({
|
|
11457
11823
|
placeholder = "Ask Intelligence about any entity, supplier, or risk\u2026",
|
|
@@ -11465,7 +11831,7 @@ function AIChatBar({
|
|
|
11465
11831
|
className
|
|
11466
11832
|
),
|
|
11467
11833
|
children: [
|
|
11468
|
-
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
11834
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react36.SearchIcon, { className: "size-4" }) }),
|
|
11469
11835
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "flex-1 text-body-sm text-default-tertiary truncate", children: placeholder }),
|
|
11470
11836
|
/* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
|
|
11471
11837
|
"button",
|
|
@@ -11474,7 +11840,7 @@ function AIChatBar({
|
|
|
11474
11840
|
className: "inline-flex shrink-0 items-center gap-2 rounded-xl bg-brand px-4 py-3 text-body-sm font-semibold text-brand-on-brand hover:bg-brand-hover transition-colors",
|
|
11475
11841
|
children: [
|
|
11476
11842
|
"Ask",
|
|
11477
|
-
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
|
|
11843
|
+
/* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_lucide_react36.ArrowRightIcon, { "aria-hidden": true, className: "size-4" })
|
|
11478
11844
|
]
|
|
11479
11845
|
}
|
|
11480
11846
|
)
|
|
@@ -11485,7 +11851,7 @@ function AIChatBar({
|
|
|
11485
11851
|
|
|
11486
11852
|
// src/components/ai/ai-suggestion-chip.tsx
|
|
11487
11853
|
var import_clsx99 = __toESM(require("clsx"), 1);
|
|
11488
|
-
var
|
|
11854
|
+
var import_lucide_react37 = require("lucide-react");
|
|
11489
11855
|
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
11490
11856
|
function AISuggestionChip({ prompt, onClick, className }) {
|
|
11491
11857
|
return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(
|
|
@@ -11498,9 +11864,9 @@ function AISuggestionChip({ prompt, onClick, className }) {
|
|
|
11498
11864
|
className
|
|
11499
11865
|
),
|
|
11500
11866
|
children: [
|
|
11501
|
-
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-brand", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
11867
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-brand", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_lucide_react37.CpuIcon, { className: "size-4" }) }),
|
|
11502
11868
|
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { className: "flex-1 text-body-sm text-default truncate", children: prompt }),
|
|
11503
|
-
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
|
|
11869
|
+
/* @__PURE__ */ (0, import_jsx_runtime124.jsx)("span", { "aria-hidden": true, className: "shrink-0 text-icon-default-secondary", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_lucide_react37.ArrowRightIcon, { className: "size-3.5", strokeWidth: 2.5 }) })
|
|
11504
11870
|
]
|
|
11505
11871
|
}
|
|
11506
11872
|
);
|
|
@@ -11528,7 +11894,7 @@ function QuickActionsBar({ actions, active, onSelect, className }) {
|
|
|
11528
11894
|
|
|
11529
11895
|
// src/components/ai/chat.tsx
|
|
11530
11896
|
var import_clsx101 = __toESM(require("clsx"), 1);
|
|
11531
|
-
var
|
|
11897
|
+
var import_lucide_react38 = require("lucide-react");
|
|
11532
11898
|
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
11533
11899
|
function AiAvatar({ className, icon }) {
|
|
11534
11900
|
return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
@@ -11536,7 +11902,7 @@ function AiAvatar({ className, icon }) {
|
|
|
11536
11902
|
{
|
|
11537
11903
|
"aria-hidden": true,
|
|
11538
11904
|
className: cn("flex size-8 shrink-0 items-center justify-center rounded-full bg-brand text-icon-brand-on-brand", className),
|
|
11539
|
-
children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
|
|
11905
|
+
children: icon ?? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_lucide_react38.CpuIcon, { className: "size-3.5" })
|
|
11540
11906
|
}
|
|
11541
11907
|
);
|
|
11542
11908
|
}
|
|
@@ -11652,6 +12018,7 @@ function AuroraBackdrop() {
|
|
|
11652
12018
|
ContextMenuContent,
|
|
11653
12019
|
ContextMenuGroup,
|
|
11654
12020
|
ContextMenuItem,
|
|
12021
|
+
ContextMenuItems,
|
|
11655
12022
|
ContextMenuLabel,
|
|
11656
12023
|
ContextMenuRadioGroup,
|
|
11657
12024
|
ContextMenuRadioItem,
|
|
@@ -11689,6 +12056,7 @@ function AuroraBackdrop() {
|
|
|
11689
12056
|
DropdownMenuContent,
|
|
11690
12057
|
DropdownMenuGroup,
|
|
11691
12058
|
DropdownMenuItem,
|
|
12059
|
+
DropdownMenuItems,
|
|
11692
12060
|
DropdownMenuLabel,
|
|
11693
12061
|
DropdownMenuRadioGroup,
|
|
11694
12062
|
DropdownMenuRadioItem,
|
|
@@ -11747,6 +12115,7 @@ function AuroraBackdrop() {
|
|
|
11747
12115
|
MenubarContent,
|
|
11748
12116
|
MenubarGroup,
|
|
11749
12117
|
MenubarItem,
|
|
12118
|
+
MenubarItems,
|
|
11750
12119
|
MenubarLabel,
|
|
11751
12120
|
MenubarMenu,
|
|
11752
12121
|
MenubarRadioGroup,
|