react-os-shell 3.3.2 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +13 -1
  2. package/dist/{Browser-GGKJBZCQ.js → Browser-KMCFAQ6B.js} +4 -4
  3. package/dist/{Browser-GGKJBZCQ.js.map → Browser-KMCFAQ6B.js.map} +1 -1
  4. package/dist/{Documents-GY6E25YJ.js → Documents-Q3IGUDRC.js} +3 -3
  5. package/dist/{Documents-GY6E25YJ.js.map → Documents-Q3IGUDRC.js.map} +1 -1
  6. package/dist/Files-JQMMXIM3.js +12 -0
  7. package/dist/{Files-ZCGJDSXN.js.map → Files-JQMMXIM3.js.map} +1 -1
  8. package/dist/{Notepad-JBG2GDDQ.js → Notepad-RGNFWBH7.js} +3 -3
  9. package/dist/{Notepad-JBG2GDDQ.js.map → Notepad-RGNFWBH7.js.map} +1 -1
  10. package/dist/Preview-6QVSOGRM.js +8 -0
  11. package/dist/{Preview-T2XC46AG.js.map → Preview-6QVSOGRM.js.map} +1 -1
  12. package/dist/{Spreadsheet-L6DMYE6W.js → Spreadsheet-FHAQX6CU.js} +4 -4
  13. package/dist/{Spreadsheet-L6DMYE6W.js.map → Spreadsheet-FHAQX6CU.js.map} +1 -1
  14. package/dist/apps/index.js +12 -12
  15. package/dist/{chunk-OS36T6ZP.js → chunk-2OONWKUI.js} +3 -3
  16. package/dist/{chunk-OS36T6ZP.js.map → chunk-2OONWKUI.js.map} +1 -1
  17. package/dist/{chunk-GLKDDFJL.js → chunk-65NSWQAT.js} +3 -3
  18. package/dist/{chunk-GLKDDFJL.js.map → chunk-65NSWQAT.js.map} +1 -1
  19. package/dist/{chunk-4J4V7FLN.js → chunk-CML7B3S4.js} +3 -3
  20. package/dist/{chunk-4J4V7FLN.js.map → chunk-CML7B3S4.js.map} +1 -1
  21. package/dist/{chunk-ZDTM7HX6.js → chunk-JQGXIQVO.js} +3 -3
  22. package/dist/{chunk-ZDTM7HX6.js.map → chunk-JQGXIQVO.js.map} +1 -1
  23. package/dist/{chunk-44B7SHZQ.js → chunk-L5TFGRBY.js} +4 -4
  24. package/dist/{chunk-44B7SHZQ.js.map → chunk-L5TFGRBY.js.map} +1 -1
  25. package/dist/{chunk-HM2POVAI.js → chunk-TVSL5Y5H.js} +4 -4
  26. package/dist/{chunk-HM2POVAI.js.map → chunk-TVSL5Y5H.js.map} +1 -1
  27. package/dist/index.d.ts +311 -2
  28. package/dist/index.js +1186 -9
  29. package/dist/index.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/Files-ZCGJDSXN.js +0 -12
  32. package/dist/Preview-T2XC46AG.js +0 -8
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
1
  import { subscribePomo, getPomoSnapshot } from './chunk-6VMTAVUD.js';
2
2
  export { setShellTodoProvider } from './chunk-6VMTAVUD.js';
3
- import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-HM2POVAI.js';
4
- export { Breadcrumbs } from './chunk-HM2POVAI.js';
3
+ import { PREVIEW_OPENED_EVENT, publishDesktopFolders, requestFilesTrashView, FolderGlyph, openPreviewFile, requestFilesDesktopFolderView, FileIconTile, hashGradient } from './chunk-TVSL5Y5H.js';
4
+ export { Breadcrumbs } from './chunk-TVSL5Y5H.js';
5
5
  import { SidebarLayout } from './chunk-VGTEM5RZ.js';
6
6
  export { SidebarLayout } from './chunk-VGTEM5RZ.js';
7
7
  import { playNotification, playStartup, soundsEnabled, getSoundConfig, SOUND_PACK_KEYS, SOUND_PACKS, SOUND_TYPES, SOUND_TYPE_LABELS, setSoundForType, previewSound, setAllSounds, playLogout } from './chunk-D7PYW2QS.js';
8
- export { ImageAnnotator_default as ImageAnnotator } from './chunk-4J4V7FLN.js';
8
+ export { ImageAnnotator_default as ImageAnnotator } from './chunk-CML7B3S4.js';
9
9
  import { toast_default } from './chunk-VENYVK3L.js';
10
10
  export { toast_default as toast } from './chunk-VENYVK3L.js';
11
- export { EditableGrid } from './chunk-ZDTM7HX6.js';
11
+ export { EditableGrid } from './chunk-JQGXIQVO.js';
12
12
  import { useAuth, useShellAuth } from './chunk-ADJ3CERD.js';
13
13
  export { ShellAuthProvider, setShellAuthBridge, useShellAuth } from './chunk-ADJ3CERD.js';
14
- import { APP_VERSION } from './chunk-GLKDDFJL.js';
15
- export { VERSION } from './chunk-GLKDDFJL.js';
14
+ import { APP_VERSION } from './chunk-65NSWQAT.js';
15
+ export { VERSION } from './chunk-65NSWQAT.js';
16
16
  import { useWindowManager, PopupMenu, PopupMenuLabel, PopupMenuDivider, PopupMenuItem, WINDOW_REGISTRY, isPageEntry, Modal, useShellPrefs, useIsMobile, ModalActions, useModalActive, client_default, LoadingSpinner, setWindowPosition, ThumbCard, activateModal } from './chunk-6OWYD4O6.js';
17
17
  export { CancelButton, CopyButton, DocFavStar, Modal, ModalActions, PopupMenu, PopupMenuDivider, PopupMenuItem, PopupMenuLabel, ShellPrefsProvider, WindowCrashedFallback, WindowErrorBoundary, WindowManagerProvider, WindowTitle, commitExposeHighlight, exitExposeMode, getActiveWindowRoute, getExposeHighlight, getWindowPosition, isEntityEntry, isPageEntry, registerModalEscapeInterceptor, setExposeHighlight, setShellApiClient, setShellWindowRegistry, setWindowDefaultPosition, setWindowPosition, subscribeExposeHighlight, toggleExposeMode, useLocalStoragePrefs, useModalActive, useShellPrefs, useWidgetSettings, useWindowManager, useWindowMenuItem, useWindowTitle } from './chunk-6OWYD4O6.js';
18
18
  export { ConfirmProvider, confirm, confirmDestructive, prompt } from './chunk-UBN4IUDE.js';
19
19
  import { glassStyle, startMenuCategories, navSections, isSection, GLASS_INPUT_BG, navIcons, sectionIcons } from './chunk-ZF6AYO4G.js';
20
20
  export { GLASS_DIVIDER, GLASS_INPUT_BG, glassStyle, setShellNavIcons } from './chunk-ZF6AYO4G.js';
21
- import { createContext, lazy, useState, useRef, useEffect, useCallback, useMemo, useLayoutEffect, useContext, isValidElement, cloneElement, Suspense, Fragment as Fragment$1, useSyncExternalStore } from 'react';
21
+ import { createContext, lazy, forwardRef, useCallback, useState, useRef, useEffect, useMemo, useLayoutEffect, useContext, isValidElement, cloneElement, Suspense, Fragment as Fragment$1, Children, useId, useSyncExternalStore } from 'react';
22
22
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
23
23
  import { Dialog, DialogBackdrop, DialogPanel } from '@headlessui/react';
24
24
  import { createPortal } from 'react-dom';
@@ -568,6 +568,14 @@ function useClickOutside(ref, onClose) {
568
568
  return () => document.removeEventListener("mousedown", handler);
569
569
  }, [ref, onClose]);
570
570
  }
571
+
572
+ // src/forms/styles.ts
573
+ var INPUT_BASE = "block w-full rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/30";
574
+ var INPUT_INVALID = "border-red-300 focus:border-red-400 focus:ring-red-400/30";
575
+ var INPUT_DISABLED = "disabled:cursor-not-allowed disabled:opacity-60";
576
+ function inputClasses(opts) {
577
+ return [INPUT_BASE, opts?.invalid ? INPUT_INVALID : "", INPUT_DISABLED, opts?.className ?? ""].filter(Boolean).join(" ");
578
+ }
571
579
  function useDropdownAlignment(triggerRef, open, maxWidth) {
572
580
  const [alignRight, setAlignRight] = useState(false);
573
581
  useLayoutEffect(() => {
@@ -594,7 +602,6 @@ function ClearButton({ onClear, ariaLabel = "Clear selection" }) {
594
602
  }
595
603
  );
596
604
  }
597
- var INPUT_BASE = "block w-full rounded-md border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-800 placeholder:text-gray-400 shadow-sm focus:border-blue-400 focus:outline-none focus:ring-2 focus:ring-blue-400/30";
598
605
  function SearchableSelect({
599
606
  value,
600
607
  onChange,
@@ -6153,6 +6160,1176 @@ function useSort(defaultField, defaultDir = "asc") {
6153
6160
  const ordering = sort.direction === "desc" ? `-${sort.field}` : sort.field;
6154
6161
  return { sort, onSort, ordering };
6155
6162
  }
6163
+ function buildPages(page, pageCount, sibling) {
6164
+ const wanted = /* @__PURE__ */ new Set([1, pageCount]);
6165
+ for (let i = page - sibling; i <= page + sibling; i++) {
6166
+ if (i >= 1 && i <= pageCount) wanted.add(i);
6167
+ }
6168
+ const sorted = [...wanted].sort((a, b) => a - b);
6169
+ const out = [];
6170
+ let prev = 0;
6171
+ for (const p of sorted) {
6172
+ if (prev && p - prev > 1) out.push("\u2026");
6173
+ out.push(p);
6174
+ prev = p;
6175
+ }
6176
+ return out;
6177
+ }
6178
+ var BTN = "inline-flex h-8 min-w-8 items-center justify-center rounded-md px-2 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-40";
6179
+ function Pagination({
6180
+ page,
6181
+ pageCount,
6182
+ onPageChange,
6183
+ siblingCount = 1,
6184
+ showEdges = false,
6185
+ className = ""
6186
+ }) {
6187
+ if (pageCount <= 1) return null;
6188
+ const pages = buildPages(page, pageCount, siblingCount);
6189
+ const go = (p) => {
6190
+ if (p >= 1 && p <= pageCount && p !== page) onPageChange(p);
6191
+ };
6192
+ return /* @__PURE__ */ jsxs("nav", { "aria-label": "Pagination", className: `flex items-center gap-1 ${className}`.trim(), children: [
6193
+ showEdges && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "First page", disabled: page === 1, onClick: () => go(1), className: `${BTN} text-gray-600 hover:bg-gray-100`, children: "\xAB" }),
6194
+ /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Previous page", disabled: page === 1, onClick: () => go(page - 1), className: `${BTN} text-gray-600 hover:bg-gray-100`, children: "\u2039" }),
6195
+ pages.map(
6196
+ (p, i) => p === "\u2026" ? /* @__PURE__ */ jsx("span", { className: "px-1 text-gray-400", children: "\u2026" }, `gap-${i}`) : /* @__PURE__ */ jsx(
6197
+ "button",
6198
+ {
6199
+ type: "button",
6200
+ "aria-current": p === page ? "page" : void 0,
6201
+ onClick: () => go(p),
6202
+ className: `${BTN} ${p === page ? "bg-blue-600 font-medium text-white" : "text-gray-700 hover:bg-gray-100"}`,
6203
+ children: p
6204
+ },
6205
+ p
6206
+ )
6207
+ ),
6208
+ /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Next page", disabled: page === pageCount, onClick: () => go(page + 1), className: `${BTN} text-gray-600 hover:bg-gray-100`, children: "\u203A" }),
6209
+ showEdges && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Last page", disabled: page === pageCount, onClick: () => go(pageCount), className: `${BTN} text-gray-600 hover:bg-gray-100`, children: "\xBB" })
6210
+ ] });
6211
+ }
6212
+ var BASE = "inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 disabled:cursor-not-allowed disabled:opacity-60";
6213
+ var VARIANTS = {
6214
+ primary: "bg-blue-600 text-white shadow-sm hover:bg-blue-700 focus:ring-blue-400/40",
6215
+ secondary: "border border-gray-300 bg-white text-gray-700 shadow-sm hover:bg-gray-50 focus:ring-blue-400/30",
6216
+ ghost: "text-gray-700 hover:bg-gray-100 focus:ring-blue-400/30",
6217
+ danger: "bg-red-600 text-white shadow-sm hover:bg-red-700 focus:ring-red-400/40"
6218
+ };
6219
+ var SIZES = {
6220
+ sm: "gap-1 px-2.5 py-1 text-xs",
6221
+ md: "gap-1.5 px-3 py-1.5 text-sm"
6222
+ };
6223
+ function Spinner() {
6224
+ return /* @__PURE__ */ jsxs("svg", { className: "h-3.5 w-3.5 animate-spin", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
6225
+ /* @__PURE__ */ jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
6226
+ /* @__PURE__ */ jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z" })
6227
+ ] });
6228
+ }
6229
+ var Button = forwardRef(function Button2({
6230
+ variant = "primary",
6231
+ size = "md",
6232
+ loading = false,
6233
+ leftIcon,
6234
+ rightIcon,
6235
+ block = false,
6236
+ disabled,
6237
+ type = "button",
6238
+ children,
6239
+ className = "",
6240
+ ...rest
6241
+ }, ref) {
6242
+ return /* @__PURE__ */ jsxs(
6243
+ "button",
6244
+ {
6245
+ ref,
6246
+ type,
6247
+ disabled: disabled || loading,
6248
+ "aria-busy": loading || void 0,
6249
+ className: [BASE, VARIANTS[variant], SIZES[size], block ? "w-full" : "", className].filter(Boolean).join(" "),
6250
+ ...rest,
6251
+ children: [
6252
+ loading ? /* @__PURE__ */ jsx(Spinner, {}) : leftIcon,
6253
+ children,
6254
+ !loading && rightIcon
6255
+ ]
6256
+ }
6257
+ );
6258
+ });
6259
+ var Button_default = Button;
6260
+ var Input = forwardRef(function Input2({ invalid, leftIcon, rightAdornment, className = "", ...rest }, ref) {
6261
+ const pad = `${leftIcon ? "pl-9" : ""} ${rightAdornment ? "pr-9" : ""}`.trim();
6262
+ const field = /* @__PURE__ */ jsx(
6263
+ "input",
6264
+ {
6265
+ ref,
6266
+ className: inputClasses({ invalid, className: [pad, className].filter(Boolean).join(" ") }),
6267
+ ...rest
6268
+ }
6269
+ );
6270
+ if (!leftIcon && !rightAdornment) return field;
6271
+ return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
6272
+ leftIcon && /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-400", children: leftIcon }),
6273
+ field,
6274
+ rightAdornment && /* @__PURE__ */ jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-400", children: rightAdornment })
6275
+ ] });
6276
+ });
6277
+ var Input_default = Input;
6278
+ var Textarea = forwardRef(function Textarea2({ invalid, autoGrow, className = "", onInput, rows = 3, ...rest }, ref) {
6279
+ const handleInput = useCallback((e) => {
6280
+ if (autoGrow) {
6281
+ const el = e.currentTarget;
6282
+ el.style.height = "auto";
6283
+ el.style.height = `${el.scrollHeight}px`;
6284
+ }
6285
+ onInput?.(e);
6286
+ }, [autoGrow, onInput]);
6287
+ return /* @__PURE__ */ jsx(
6288
+ "textarea",
6289
+ {
6290
+ ref,
6291
+ rows,
6292
+ onInput: handleInput,
6293
+ className: inputClasses({ invalid, className: `${autoGrow ? "resize-none overflow-hidden" : ""} ${className}`.trim() }),
6294
+ ...rest
6295
+ }
6296
+ );
6297
+ });
6298
+ var Textarea_default = Textarea;
6299
+ var Select = forwardRef(function Select2({ value, onChange, options, placeholder, invalid, className = "", ...rest }, ref) {
6300
+ return /* @__PURE__ */ jsxs(
6301
+ "select",
6302
+ {
6303
+ ref,
6304
+ value,
6305
+ onChange: (e) => onChange(e.target.value),
6306
+ className: inputClasses({ invalid, className: `pr-8 ${className}`.trim() }),
6307
+ ...rest,
6308
+ children: [
6309
+ placeholder !== void 0 && /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: placeholder }),
6310
+ options.map((o) => /* @__PURE__ */ jsx("option", { value: o.value, disabled: o.disabled, children: o.label }, o.value))
6311
+ ]
6312
+ }
6313
+ );
6314
+ });
6315
+ var Select_default = Select;
6316
+ var BOX = "h-4 w-4 shrink-0 rounded border-gray-300 accent-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-400/30 disabled:cursor-not-allowed disabled:opacity-60";
6317
+ var Checkbox = forwardRef(function Checkbox2({ checked, onChange, label, description, disabled, className = "", ...rest }, ref) {
6318
+ if (!label && !description) {
6319
+ return /* @__PURE__ */ jsx(
6320
+ "input",
6321
+ {
6322
+ ref,
6323
+ type: "checkbox",
6324
+ checked,
6325
+ disabled,
6326
+ onChange: (e) => onChange(e.target.checked),
6327
+ className: `${BOX} ${className}`.trim(),
6328
+ ...rest
6329
+ }
6330
+ );
6331
+ }
6332
+ return /* @__PURE__ */ jsxs("label", { className: `flex items-start gap-2 ${disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"} ${className}`.trim(), children: [
6333
+ /* @__PURE__ */ jsx(
6334
+ "input",
6335
+ {
6336
+ ref,
6337
+ type: "checkbox",
6338
+ checked,
6339
+ disabled,
6340
+ onChange: (e) => onChange(e.target.checked),
6341
+ className: `${BOX} mt-0.5`,
6342
+ ...rest
6343
+ }
6344
+ ),
6345
+ /* @__PURE__ */ jsxs("span", { className: "text-sm leading-tight", children: [
6346
+ label && /* @__PURE__ */ jsx("span", { className: "font-medium text-gray-700", children: label }),
6347
+ description && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-gray-500", children: description })
6348
+ ] })
6349
+ ] });
6350
+ });
6351
+ var Checkbox_default = Checkbox;
6352
+ var DOT = "h-4 w-4 shrink-0 border-gray-300 accent-blue-600 focus:outline-none focus:ring-2 focus:ring-blue-400/30 disabled:cursor-not-allowed disabled:opacity-60";
6353
+ var Radio = forwardRef(function Radio2({ checked, onChange, label, description, disabled, className = "", ...rest }, ref) {
6354
+ if (!label && !description) {
6355
+ return /* @__PURE__ */ jsx(
6356
+ "input",
6357
+ {
6358
+ ref,
6359
+ type: "radio",
6360
+ checked,
6361
+ disabled,
6362
+ onChange: (e) => onChange(e.target.checked),
6363
+ className: `${DOT} ${className}`.trim(),
6364
+ ...rest
6365
+ }
6366
+ );
6367
+ }
6368
+ return /* @__PURE__ */ jsxs("label", { className: `flex items-start gap-2 ${disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer"} ${className}`.trim(), children: [
6369
+ /* @__PURE__ */ jsx(
6370
+ "input",
6371
+ {
6372
+ ref,
6373
+ type: "radio",
6374
+ checked,
6375
+ disabled,
6376
+ onChange: (e) => onChange(e.target.checked),
6377
+ className: `${DOT} mt-0.5`,
6378
+ ...rest
6379
+ }
6380
+ ),
6381
+ /* @__PURE__ */ jsxs("span", { className: "text-sm leading-tight", children: [
6382
+ label && /* @__PURE__ */ jsx("span", { className: "font-medium text-gray-700", children: label }),
6383
+ description && /* @__PURE__ */ jsx("span", { className: "mt-0.5 block text-xs text-gray-500", children: description })
6384
+ ] })
6385
+ ] });
6386
+ });
6387
+ var Radio_default = Radio;
6388
+ function FormField({
6389
+ label,
6390
+ htmlFor,
6391
+ hint,
6392
+ error,
6393
+ required,
6394
+ className = "",
6395
+ children
6396
+ }) {
6397
+ return /* @__PURE__ */ jsxs("div", { className, children: [
6398
+ label && /* @__PURE__ */ jsxs("label", { htmlFor, className: "mb-1 block text-xs font-medium text-gray-600", children: [
6399
+ label,
6400
+ required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-500", children: "*" })
6401
+ ] }),
6402
+ children,
6403
+ error ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-red-600", children: error }) : hint ? /* @__PURE__ */ jsx("p", { className: "mt-1 text-[11px] text-gray-400", children: hint }) : null
6404
+ ] });
6405
+ }
6406
+ function Label({ required, children, className = "", ...rest }) {
6407
+ return /* @__PURE__ */ jsxs("label", { className: `mb-1 block text-xs font-medium text-gray-600 ${className}`.trim(), ...rest, children: [
6408
+ children,
6409
+ required && /* @__PURE__ */ jsx("span", { className: "ml-0.5 text-red-500", children: "*" })
6410
+ ] });
6411
+ }
6412
+ function Card({ children, header, footer, padded = true, className = "" }) {
6413
+ return /* @__PURE__ */ jsxs("div", { className: `rounded-lg border border-gray-200 bg-white shadow-sm ${className}`.trim(), children: [
6414
+ header && /* @__PURE__ */ jsx("div", { className: "border-b border-gray-100 px-4 py-3 text-sm font-semibold text-gray-900", children: header }),
6415
+ /* @__PURE__ */ jsx("div", { className: padded ? "p-4" : "", children }),
6416
+ footer && /* @__PURE__ */ jsx("div", { className: "border-t border-gray-100 px-4 py-3", children: footer })
6417
+ ] });
6418
+ }
6419
+ function StatCard({ label, value, icon, delta, className = "" }) {
6420
+ const deltaColor = delta?.direction === "up" ? "text-green-600" : delta?.direction === "down" ? "text-red-600" : "text-gray-500";
6421
+ const arrow = delta?.direction === "up" ? "\u25B2" : delta?.direction === "down" ? "\u25BC" : "\u2192";
6422
+ return /* @__PURE__ */ jsxs("div", { className: `rounded-lg border border-gray-200 bg-white p-4 shadow-sm ${className}`.trim(), children: [
6423
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
6424
+ /* @__PURE__ */ jsx("span", { className: "text-xs font-medium uppercase tracking-wide text-gray-500", children: label }),
6425
+ icon && /* @__PURE__ */ jsx("span", { className: "text-gray-400", children: icon })
6426
+ ] }),
6427
+ /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-baseline gap-2", children: [
6428
+ /* @__PURE__ */ jsx("span", { className: "text-2xl font-semibold text-gray-900", children: value }),
6429
+ delta && /* @__PURE__ */ jsxs("span", { className: `text-xs font-medium ${deltaColor}`, children: [
6430
+ arrow,
6431
+ " ",
6432
+ delta.value
6433
+ ] })
6434
+ ] })
6435
+ ] });
6436
+ }
6437
+ var SIZE_PX = { xs: 24, sm: 32, md: 40, lg: 56 };
6438
+ var STATUS_COLOR = {
6439
+ online: "bg-green-500",
6440
+ offline: "bg-gray-400",
6441
+ busy: "bg-red-500",
6442
+ away: "bg-amber-500"
6443
+ };
6444
+ function initials(name) {
6445
+ if (!name) return "?";
6446
+ const parts = name.trim().split(/\s+/).filter(Boolean);
6447
+ if (parts.length === 0) return "?";
6448
+ const first = parts[0][0] ?? "";
6449
+ const last = parts.length > 1 ? parts[parts.length - 1][0] : "";
6450
+ return (first + last).toUpperCase() || "?";
6451
+ }
6452
+ function Avatar({ src, name, size = "md", status, className = "" }) {
6453
+ const px = SIZE_PX[size];
6454
+ const dot = Math.max(8, Math.round(px * 0.28));
6455
+ return /* @__PURE__ */ jsxs("span", { className: `relative inline-flex shrink-0 ${className}`.trim(), style: { width: px, height: px }, children: [
6456
+ src ? /* @__PURE__ */ jsx("img", { src, alt: name ?? "", className: "h-full w-full rounded-full object-cover" }) : /* @__PURE__ */ jsx(
6457
+ "span",
6458
+ {
6459
+ className: "flex h-full w-full items-center justify-center rounded-full bg-gray-100 font-medium text-gray-600",
6460
+ style: { fontSize: Math.round(px * 0.4) },
6461
+ children: initials(name)
6462
+ }
6463
+ ),
6464
+ status && /* @__PURE__ */ jsx(
6465
+ "span",
6466
+ {
6467
+ className: `absolute bottom-0 right-0 rounded-full ring-2 ring-white ${STATUS_COLOR[status]}`,
6468
+ style: { width: dot, height: dot }
6469
+ }
6470
+ )
6471
+ ] });
6472
+ }
6473
+ function AvatarGroup({ children, max, size = "md", className = "" }) {
6474
+ const items = Children.toArray(children);
6475
+ const shown = max ? items.slice(0, max) : items;
6476
+ const overflow = max ? items.length - shown.length : 0;
6477
+ const px = SIZE_PX[size];
6478
+ const overlap = Math.round(px * 0.3);
6479
+ return /* @__PURE__ */ jsxs("div", { className: `flex items-center ${className}`.trim(), children: [
6480
+ shown.map((child, i) => /* @__PURE__ */ jsx("span", { className: "rounded-full ring-2 ring-white", style: { marginLeft: i === 0 ? 0 : -overlap }, children: child }, i)),
6481
+ overflow > 0 && /* @__PURE__ */ jsxs(
6482
+ "span",
6483
+ {
6484
+ className: "flex items-center justify-center rounded-full bg-gray-200 font-medium text-gray-600 ring-2 ring-white",
6485
+ style: { width: px, height: px, marginLeft: -overlap, fontSize: Math.round(px * 0.36) },
6486
+ children: [
6487
+ "+",
6488
+ overflow
6489
+ ]
6490
+ }
6491
+ )
6492
+ ] });
6493
+ }
6494
+ var TONE = {
6495
+ info: { box: "bg-blue-50 border-blue-200", icon: "text-blue-600" },
6496
+ success: { box: "bg-green-50 border-green-200", icon: "text-green-600" },
6497
+ warning: { box: "bg-amber-50 border-amber-200", icon: "text-amber-600" },
6498
+ danger: { box: "bg-red-50 border-red-200", icon: "text-red-600" }
6499
+ };
6500
+ function ToneIcon({ tone }) {
6501
+ const common = { className: "h-5 w-5", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": true };
6502
+ switch (tone) {
6503
+ case "success":
6504
+ return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.7-9.3a1 1 0 00-1.4-1.4L9 10.6 7.7 9.3a1 1 0 00-1.4 1.4l2 2a1 1 0 001.4 0l4-4z", clipRule: "evenodd" }) });
6505
+ case "warning":
6506
+ return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M8.3 2.8a2 2 0 013.4 0l6 10A2 2 0 0116 16H4a2 2 0 01-1.7-3.2l6-10zM10 7a1 1 0 00-1 1v3a1 1 0 102 0V8a1 1 0 00-1-1zm0 7a1 1 0 100 2 1 1 0 000-2z", clipRule: "evenodd" }) });
6507
+ case "danger":
6508
+ return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.7 7.3a1 1 0 00-1.4 1.4L8.6 10l-1.3 1.3a1 1 0 101.4 1.4L10 11.4l1.3 1.3a1 1 0 001.4-1.4L11.4 10l1.3-1.3a1 1 0 10-1.4-1.4L10 8.6 8.7 7.3z", clipRule: "evenodd" }) });
6509
+ default:
6510
+ return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM9 9a1 1 0 012 0v4a1 1 0 11-2 0V9zm1-4a1 1 0 100 2 1 1 0 000-2z", clipRule: "evenodd" }) });
6511
+ }
6512
+ }
6513
+ function Banner({ tone = "info", title, children, icon, onDismiss, className = "" }) {
6514
+ const t = TONE[tone];
6515
+ return /* @__PURE__ */ jsxs("div", { role: tone === "danger" ? "alert" : "status", className: `flex items-start gap-3 rounded-lg border px-4 py-3 ${t.box} ${className}`.trim(), children: [
6516
+ /* @__PURE__ */ jsx("span", { className: `mt-0.5 shrink-0 ${t.icon}`, children: icon ?? /* @__PURE__ */ jsx(ToneIcon, { tone }) }),
6517
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 text-sm", children: [
6518
+ title && /* @__PURE__ */ jsx("div", { className: "font-semibold text-gray-900", children: title }),
6519
+ children && /* @__PURE__ */ jsx("div", { className: `text-gray-700 ${title ? "mt-0.5" : ""}`.trim(), children })
6520
+ ] }),
6521
+ onDismiss && /* @__PURE__ */ jsx("button", { type: "button", onClick: onDismiss, "aria-label": "Dismiss", className: "shrink-0 text-gray-400 hover:text-gray-600", children: /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 6l8 8M14 6l-8 8" }) }) })
6522
+ ] });
6523
+ }
6524
+ function Tabs({ items, value, onChange, variant = "underline", className = "" }) {
6525
+ if (variant === "pill") {
6526
+ return /* @__PURE__ */ jsx("div", { role: "tablist", className: `inline-flex items-center gap-1 rounded-lg bg-gray-100 p-1 ${className}`.trim(), children: items.map((t) => {
6527
+ const active = t.id === value;
6528
+ return /* @__PURE__ */ jsxs(
6529
+ "button",
6530
+ {
6531
+ type: "button",
6532
+ role: "tab",
6533
+ "aria-selected": active,
6534
+ tabIndex: active ? 0 : -1,
6535
+ disabled: t.disabled,
6536
+ onClick: () => onChange(t.id),
6537
+ className: `inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${active ? "bg-blue-600 text-white shadow-sm" : "text-gray-600 hover:text-gray-900"}`,
6538
+ children: [
6539
+ t.icon,
6540
+ t.label
6541
+ ]
6542
+ },
6543
+ t.id
6544
+ );
6545
+ }) });
6546
+ }
6547
+ return /* @__PURE__ */ jsx("div", { role: "tablist", className: `flex items-center gap-1 border-b border-gray-200 ${className}`.trim(), children: items.map((t) => {
6548
+ const active = t.id === value;
6549
+ return /* @__PURE__ */ jsxs(
6550
+ "button",
6551
+ {
6552
+ type: "button",
6553
+ role: "tab",
6554
+ "aria-selected": active,
6555
+ tabIndex: active ? 0 : -1,
6556
+ disabled: t.disabled,
6557
+ onClick: () => onChange(t.id),
6558
+ className: `-mb-px inline-flex items-center gap-1.5 border-b-2 px-3 py-2 text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:opacity-50 ${active ? "border-blue-600 text-blue-600" : "border-transparent text-gray-600 hover:border-gray-300 hover:text-gray-900"}`,
6559
+ children: [
6560
+ t.icon,
6561
+ t.label
6562
+ ]
6563
+ },
6564
+ t.id
6565
+ );
6566
+ }) });
6567
+ }
6568
+ function Accordion({
6569
+ items,
6570
+ defaultOpenIds = [],
6571
+ openIds,
6572
+ onOpenChange,
6573
+ allowMultiple = false,
6574
+ className = ""
6575
+ }) {
6576
+ const [internal, setInternal] = useState(defaultOpenIds);
6577
+ const open = openIds ?? internal;
6578
+ const toggle = (id) => {
6579
+ const isOpen = open.includes(id);
6580
+ const next = isOpen ? open.filter((x) => x !== id) : allowMultiple ? [...open, id] : [id];
6581
+ if (openIds === void 0) setInternal(next);
6582
+ onOpenChange?.(next);
6583
+ };
6584
+ return /* @__PURE__ */ jsx("div", { className: `divide-y divide-gray-100 overflow-hidden rounded-lg border border-gray-200 ${className}`.trim(), children: items.map((item) => {
6585
+ const isOpen = open.includes(item.id);
6586
+ return /* @__PURE__ */ jsxs("div", { children: [
6587
+ /* @__PURE__ */ jsxs(
6588
+ "button",
6589
+ {
6590
+ type: "button",
6591
+ disabled: item.disabled,
6592
+ "aria-expanded": isOpen,
6593
+ onClick: () => toggle(item.id),
6594
+ className: "flex w-full items-center justify-between gap-3 px-4 py-3 text-left text-sm font-medium text-gray-900 hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",
6595
+ children: [
6596
+ /* @__PURE__ */ jsx("span", { children: item.title }),
6597
+ /* @__PURE__ */ jsx(
6598
+ "svg",
6599
+ {
6600
+ className: `h-4 w-4 shrink-0 text-gray-400 transition-transform ${isOpen ? "rotate-180" : ""}`,
6601
+ viewBox: "0 0 20 20",
6602
+ fill: "none",
6603
+ stroke: "currentColor",
6604
+ strokeWidth: "2",
6605
+ "aria-hidden": "true",
6606
+ children: /* @__PURE__ */ jsx("path", { d: "M6 8l4 4 4-4", strokeLinecap: "round", strokeLinejoin: "round" })
6607
+ }
6608
+ )
6609
+ ]
6610
+ }
6611
+ ),
6612
+ isOpen && /* @__PURE__ */ jsx("div", { className: "px-4 pb-3 text-sm text-gray-600", children: item.content })
6613
+ ] }, item.id);
6614
+ }) });
6615
+ }
6616
+ var SIDE_POS = {
6617
+ top: "bottom-full left-1/2 -translate-x-1/2 mb-1.5",
6618
+ bottom: "top-full left-1/2 -translate-x-1/2 mt-1.5",
6619
+ left: "right-full top-1/2 -translate-y-1/2 mr-1.5",
6620
+ right: "left-full top-1/2 -translate-y-1/2 ml-1.5"
6621
+ };
6622
+ function Tooltip({ content, side = "top", delay = 200, children }) {
6623
+ const [show, setShow] = useState(false);
6624
+ const timer = useRef(void 0);
6625
+ const id = useId();
6626
+ const open = () => {
6627
+ timer.current = window.setTimeout(() => setShow(true), delay);
6628
+ };
6629
+ const close = () => {
6630
+ window.clearTimeout(timer.current);
6631
+ setShow(false);
6632
+ };
6633
+ useEffect(() => () => window.clearTimeout(timer.current), []);
6634
+ return /* @__PURE__ */ jsxs(
6635
+ "span",
6636
+ {
6637
+ className: "relative inline-flex",
6638
+ "aria-describedby": show ? id : void 0,
6639
+ onMouseEnter: open,
6640
+ onMouseLeave: close,
6641
+ onFocus: open,
6642
+ onBlur: close,
6643
+ children: [
6644
+ children,
6645
+ show && /* @__PURE__ */ jsx(
6646
+ "span",
6647
+ {
6648
+ id,
6649
+ role: "tooltip",
6650
+ className: `pointer-events-none absolute z-[300] whitespace-nowrap rounded-md px-2 py-1 text-xs text-gray-800 ${SIDE_POS[side]}`,
6651
+ style: glassStyle(),
6652
+ children: content
6653
+ }
6654
+ )
6655
+ ]
6656
+ }
6657
+ );
6658
+ }
6659
+ function Sparkline({
6660
+ data,
6661
+ width = 120,
6662
+ height = 32,
6663
+ stroke = "currentColor",
6664
+ fill,
6665
+ strokeWidth = 1.5,
6666
+ showDots = false,
6667
+ className,
6668
+ style
6669
+ }) {
6670
+ if (data.length === 0) return null;
6671
+ const max = Math.max(...data);
6672
+ const min = Math.min(...data);
6673
+ const span = max - min || 1;
6674
+ const pad = strokeWidth + (showDots ? 2 : 0);
6675
+ const y = (v) => height - pad - (v - min) / span * (height - pad * 2);
6676
+ const pts = data.length === 1 ? [[0, height / 2], [width, height / 2]] : data.map((v, i) => [i * width / (data.length - 1), y(v)]);
6677
+ const line = pts.map(([x, yy], i) => `${i === 0 ? "M" : "L"}${x.toFixed(2)},${yy.toFixed(2)}`).join(" ");
6678
+ const area = `${line} L${width.toFixed(2)},${height} L0,${height} Z`;
6679
+ return /* @__PURE__ */ jsxs(
6680
+ "svg",
6681
+ {
6682
+ className,
6683
+ style,
6684
+ width,
6685
+ height,
6686
+ viewBox: `0 0 ${width} ${height}`,
6687
+ preserveAspectRatio: "none",
6688
+ role: "img",
6689
+ "aria-hidden": "true",
6690
+ children: [
6691
+ fill && /* @__PURE__ */ jsx("path", { d: area, fill, stroke: "none" }),
6692
+ /* @__PURE__ */ jsx("path", { d: line, fill: "none", stroke, strokeWidth, strokeLinejoin: "round", strokeLinecap: "round" }),
6693
+ showDots && pts.map(([x, yy], i) => /* @__PURE__ */ jsx("circle", { cx: x, cy: yy, r: strokeWidth + 0.5, fill: stroke }, i))
6694
+ ]
6695
+ }
6696
+ );
6697
+ }
6698
+ function BarChart({
6699
+ data,
6700
+ labels,
6701
+ height = 120,
6702
+ color = "currentColor",
6703
+ colors,
6704
+ max,
6705
+ gap = 6,
6706
+ className,
6707
+ style
6708
+ }) {
6709
+ if (data.length === 0) return null;
6710
+ const peak = max ?? (Math.max(...data, 0) || 1);
6711
+ return /* @__PURE__ */ jsxs("div", { className, style, children: [
6712
+ /* @__PURE__ */ jsx("div", { className: "flex items-end", style: { height, gap }, children: data.map((v, i) => /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col justify-end", style: { height: "100%" }, children: /* @__PURE__ */ jsx(
6713
+ "div",
6714
+ {
6715
+ className: "w-full rounded-t",
6716
+ style: {
6717
+ height: `${Math.max(0, v / peak * 100)}%`,
6718
+ minHeight: v > 0 ? 2 : 0,
6719
+ backgroundColor: colors?.[i] ?? color
6720
+ },
6721
+ title: labels?.[i] != null ? `${labels[i]}: ${v}` : String(v)
6722
+ }
6723
+ ) }, i)) }),
6724
+ labels && /* @__PURE__ */ jsx("div", { className: "mt-1 flex", style: { gap }, children: labels.map((l, i) => /* @__PURE__ */ jsx("div", { className: "flex-1 truncate text-center text-[10px] text-gray-400", children: l }, i)) })
6725
+ ] });
6726
+ }
6727
+ var PALETTE = ["#3b82f6", "#22c55e", "#f59e0b", "#ef4444", "#6366f1", "#14b8a6", "#a855f7", "#64748b"];
6728
+ function DonutChart({ segments, size = 120, thickness = 16, centerLabel, className, style }) {
6729
+ const total = segments.reduce((s, x) => s + Math.max(0, x.value), 0) || 1;
6730
+ const r = (size - thickness) / 2;
6731
+ const c = size / 2;
6732
+ const circ = 2 * Math.PI * r;
6733
+ let offset = 0;
6734
+ return /* @__PURE__ */ jsxs(
6735
+ "div",
6736
+ {
6737
+ className: `relative inline-flex items-center justify-center ${className ?? ""}`.trim(),
6738
+ style: { width: size, height: size, ...style },
6739
+ children: [
6740
+ /* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, role: "img", "aria-hidden": "true", style: { transform: "rotate(-90deg)" }, children: [
6741
+ /* @__PURE__ */ jsx("circle", { cx: c, cy: c, r, fill: "none", stroke: "rgba(148,163,184,0.25)", strokeWidth: thickness }),
6742
+ segments.map((s, i) => {
6743
+ const len = Math.max(0, s.value) / total * circ;
6744
+ const el = /* @__PURE__ */ jsx(
6745
+ "circle",
6746
+ {
6747
+ cx: c,
6748
+ cy: c,
6749
+ r,
6750
+ fill: "none",
6751
+ stroke: s.color ?? PALETTE[i % PALETTE.length],
6752
+ strokeWidth: thickness,
6753
+ strokeDasharray: `${len} ${circ - len}`,
6754
+ strokeDashoffset: -offset
6755
+ },
6756
+ i
6757
+ );
6758
+ offset += len;
6759
+ return el;
6760
+ })
6761
+ ] }),
6762
+ centerLabel != null && /* @__PURE__ */ jsx("div", { className: "absolute text-center text-sm font-semibold text-gray-900", children: centerLabel })
6763
+ ]
6764
+ }
6765
+ );
6766
+ }
6767
+ var STATUS_GROUPS = {
6768
+ paid: "success",
6769
+ shipped: "active",
6770
+ processing: "queued",
6771
+ refunded: "neutral",
6772
+ overdue: "danger"
6773
+ };
6774
+ var REVENUE = [12, 18, 14, 22, 19, 27, 24, 31, 28, 35, 30, 38];
6775
+ var MONTHS = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
6776
+ var ORDERS = [
6777
+ { id: "#3201", customer: "Alice Nguyen", total: "$1,204", status: "paid" },
6778
+ { id: "#3202", customer: "Marco Reyes", total: "$642", status: "shipped" },
6779
+ { id: "#3203", customer: "Priya Patel", total: "$2,980", status: "processing" },
6780
+ { id: "#3204", customer: "Tom Becker", total: "$318", status: "overdue" },
6781
+ { id: "#3205", customer: "Sara Lind", total: "$540", status: "refunded" }
6782
+ ];
6783
+ function DashboardTemplate() {
6784
+ return /* @__PURE__ */ jsx(StatusBadgeProvider, { groups: STATUS_GROUPS, children: /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-6xl space-y-6", children: [
6785
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
6786
+ /* @__PURE__ */ jsxs("div", { children: [
6787
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-gray-900", children: "Dashboard" }),
6788
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Overview of your store this month" })
6789
+ ] }),
6790
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
6791
+ /* @__PURE__ */ jsx(Button_default, { variant: "secondary", size: "sm", children: "Export" }),
6792
+ /* @__PURE__ */ jsx(Button_default, { size: "sm", children: "New report" })
6793
+ ] })
6794
+ ] }),
6795
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4", children: [
6796
+ /* @__PURE__ */ jsx(StatCard, { label: "Revenue", value: "$38.2k", delta: { value: "12%", direction: "up" } }),
6797
+ /* @__PURE__ */ jsx(StatCard, { label: "Orders", value: "1,204", delta: { value: "4%", direction: "up" } }),
6798
+ /* @__PURE__ */ jsx(StatCard, { label: "Customers", value: "892", delta: { value: "2%", direction: "down" } }),
6799
+ /* @__PURE__ */ jsx(StatCard, { label: "Refunds", value: "$1.1k", delta: { value: "0%", direction: "flat" } })
6800
+ ] }),
6801
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-3", children: [
6802
+ /* @__PURE__ */ jsx(Card, { header: "Revenue", className: "lg:col-span-2", children: /* @__PURE__ */ jsx("div", { className: "text-blue-600", children: /* @__PURE__ */ jsx(BarChart, { data: REVENUE, labels: MONTHS, height: 160 }) }) }),
6803
+ /* @__PURE__ */ jsx(Card, { header: "Traffic sources", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
6804
+ /* @__PURE__ */ jsx(
6805
+ DonutChart,
6806
+ {
6807
+ size: 120,
6808
+ segments: [
6809
+ { label: "Direct", value: 45 },
6810
+ { label: "Search", value: 30 },
6811
+ { label: "Social", value: 15 },
6812
+ { label: "Email", value: 10 }
6813
+ ],
6814
+ centerLabel: /* @__PURE__ */ jsx("span", { className: "text-gray-900", children: "100%" })
6815
+ }
6816
+ ),
6817
+ /* @__PURE__ */ jsxs("ul", { className: "space-y-1.5 text-sm text-gray-600", children: [
6818
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
6819
+ /* @__PURE__ */ jsx(Dot, { c: "#3b82f6" }),
6820
+ "Direct \xB7 45%"
6821
+ ] }),
6822
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
6823
+ /* @__PURE__ */ jsx(Dot, { c: "#22c55e" }),
6824
+ "Search \xB7 30%"
6825
+ ] }),
6826
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
6827
+ /* @__PURE__ */ jsx(Dot, { c: "#f59e0b" }),
6828
+ "Social \xB7 15%"
6829
+ ] }),
6830
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-2", children: [
6831
+ /* @__PURE__ */ jsx(Dot, { c: "#ef4444" }),
6832
+ "Email \xB7 10%"
6833
+ ] })
6834
+ ] })
6835
+ ] }) })
6836
+ ] }),
6837
+ /* @__PURE__ */ jsx(Card, { header: "Recent orders", padded: false, children: /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
6838
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400", children: [
6839
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Order" }),
6840
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Customer" }),
6841
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Total" }),
6842
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Status" })
6843
+ ] }) }),
6844
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-100", children: ORDERS.map((o) => /* @__PURE__ */ jsxs("tr", { className: "text-gray-700", children: [
6845
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2 font-mono text-xs text-gray-500", children: o.id }),
6846
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2", children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
6847
+ /* @__PURE__ */ jsx(Avatar, { size: "xs", name: o.customer }),
6848
+ o.customer
6849
+ ] }) }),
6850
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2", children: o.total }),
6851
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2", children: /* @__PURE__ */ jsx(StatusBadge, { status: o.status }) })
6852
+ ] }, o.id)) })
6853
+ ] }) }),
6854
+ /* @__PURE__ */ jsxs("p", { className: "flex items-center gap-2 text-xs text-gray-400", children: [
6855
+ /* @__PURE__ */ jsx("span", { className: "text-emerald-600", children: /* @__PURE__ */ jsx(Sparkline, { data: REVENUE, width: 80, height: 20 }) }),
6856
+ "Trending up 12% vs last month"
6857
+ ] })
6858
+ ] }) }) });
6859
+ }
6860
+ function Dot({ c }) {
6861
+ return /* @__PURE__ */ jsx("span", { className: "inline-block h-2.5 w-2.5 rounded-full", style: { backgroundColor: c } });
6862
+ }
6863
+ var GROUPS = {
6864
+ active: "success",
6865
+ invited: "queued",
6866
+ suspended: "danger",
6867
+ pending: "pending"
6868
+ };
6869
+ var ROWS = [
6870
+ { name: "Alice Nguyen", email: "alice@acme.co", role: "Admin", status: "active" },
6871
+ { name: "Marco Reyes", email: "marco@acme.co", role: "Editor", status: "invited" },
6872
+ { name: "Priya Patel", email: "priya@acme.co", role: "Editor", status: "active" },
6873
+ { name: "Tom Becker", email: "tom@acme.co", role: "Viewer", status: "suspended" },
6874
+ { name: "Sara Lind", email: "sara@acme.co", role: "Viewer", status: "pending" },
6875
+ { name: "Yuki Tanaka", email: "yuki@acme.co", role: "Editor", status: "active" }
6876
+ ];
6877
+ function DataTablePage() {
6878
+ const [page, setPage] = useState(1);
6879
+ const [role, setRole] = useState("");
6880
+ const [query, setQuery] = useState("");
6881
+ return /* @__PURE__ */ jsx(StatusBadgeProvider, { groups: GROUPS, children: /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-5xl space-y-4", children: [
6882
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
6883
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-gray-900", children: "Members" }),
6884
+ /* @__PURE__ */ jsx(Button_default, { size: "sm", children: "Invite member" })
6885
+ ] }),
6886
+ /* @__PURE__ */ jsxs(Card, { padded: false, children: [
6887
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 border-b border-gray-100 p-3", children: [
6888
+ /* @__PURE__ */ jsx("div", { className: "min-w-48 flex-1", children: /* @__PURE__ */ jsx(Input_default, { value: query, onChange: (e) => setQuery(e.target.value), placeholder: "Search members\u2026", leftIcon: /* @__PURE__ */ jsx(SearchIcon, {}) }) }),
6889
+ /* @__PURE__ */ jsx("div", { className: "w-40", children: /* @__PURE__ */ jsx(
6890
+ Select_default,
6891
+ {
6892
+ value: role,
6893
+ onChange: setRole,
6894
+ placeholder: "All roles",
6895
+ options: [
6896
+ { value: "admin", label: "Admin" },
6897
+ { value: "editor", label: "Editor" },
6898
+ { value: "viewer", label: "Viewer" }
6899
+ ]
6900
+ }
6901
+ ) }),
6902
+ /* @__PURE__ */ jsx(Button_default, { variant: "secondary", size: "sm", children: "Filter" })
6903
+ ] }),
6904
+ /* @__PURE__ */ jsxs("table", { className: "w-full text-sm", children: [
6905
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", { className: "border-b border-gray-100 text-left text-xs uppercase tracking-wide text-gray-400", children: [
6906
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Name" }),
6907
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Role" }),
6908
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium", children: "Status" }),
6909
+ /* @__PURE__ */ jsx("th", { className: "px-4 py-2 font-medium text-right", children: "Actions" })
6910
+ ] }) }),
6911
+ /* @__PURE__ */ jsx("tbody", { className: "divide-y divide-gray-100", children: ROWS.map((r) => /* @__PURE__ */ jsxs("tr", { className: "text-gray-700 hover:bg-gray-50", children: [
6912
+ /* @__PURE__ */ jsxs("td", { className: "px-4 py-2.5", children: [
6913
+ /* @__PURE__ */ jsx("div", { className: "font-medium text-gray-900", children: r.name }),
6914
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-400", children: r.email })
6915
+ ] }),
6916
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: r.role }),
6917
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5", children: /* @__PURE__ */ jsx(StatusBadge, { status: r.status }) }),
6918
+ /* @__PURE__ */ jsx("td", { className: "px-4 py-2.5 text-right", children: /* @__PURE__ */ jsx(Button_default, { variant: "ghost", size: "sm", children: "Edit" }) })
6919
+ ] }, r.email)) })
6920
+ ] }),
6921
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-t border-gray-100 p-3", children: [
6922
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: "Showing 1\u20136 of 48" }),
6923
+ /* @__PURE__ */ jsx(Pagination, { page, pageCount: 8, onPageChange: setPage, showEdges: true })
6924
+ ] })
6925
+ ] })
6926
+ ] }) }) });
6927
+ }
6928
+ function SearchIcon() {
6929
+ return /* @__PURE__ */ jsxs("svg", { className: "h-4 w-4", viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", children: [
6930
+ /* @__PURE__ */ jsx("circle", { cx: "9", cy: "9", r: "6" }),
6931
+ /* @__PURE__ */ jsx("path", { d: "M14 14l3 3", strokeLinecap: "round" })
6932
+ ] });
6933
+ }
6934
+ function FormLayoutPage() {
6935
+ const [plan, setPlan] = useState("pro");
6936
+ const [newsletter, setNewsletter] = useState(true);
6937
+ const [country, setCountry] = useState("us");
6938
+ return /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("form", { className: "mx-auto max-w-2xl space-y-5", onSubmit: (e) => e.preventDefault(), children: [
6939
+ /* @__PURE__ */ jsxs("div", { children: [
6940
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-gray-900", children: "Account settings" }),
6941
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: "Update your profile and preferences." })
6942
+ ] }),
6943
+ /* @__PURE__ */ jsx(Card, { header: "Profile", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6944
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
6945
+ /* @__PURE__ */ jsx(FormField, { label: "First name", htmlFor: "fn", required: true, children: /* @__PURE__ */ jsx(Input_default, { id: "fn", defaultValue: "Alice" }) }),
6946
+ /* @__PURE__ */ jsx(FormField, { label: "Last name", htmlFor: "ln", required: true, children: /* @__PURE__ */ jsx(Input_default, { id: "ln", defaultValue: "Nguyen" }) })
6947
+ ] }),
6948
+ /* @__PURE__ */ jsx(FormField, { label: "Email", htmlFor: "email", hint: "We'll never share your email.", children: /* @__PURE__ */ jsx(Input_default, { id: "email", type: "email", defaultValue: "alice@acme.co" }) }),
6949
+ /* @__PURE__ */ jsx(FormField, { label: "Bio", htmlFor: "bio", hint: "Brief description for your profile.", children: /* @__PURE__ */ jsx(Textarea_default, { id: "bio", autoGrow: true, defaultValue: "Product designer at Acme." }) })
6950
+ ] }) }),
6951
+ /* @__PURE__ */ jsx(Card, { header: "Preferences", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6952
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
6953
+ /* @__PURE__ */ jsx(FormField, { label: "Country", htmlFor: "country", children: /* @__PURE__ */ jsx(
6954
+ Select_default,
6955
+ {
6956
+ value: country,
6957
+ onChange: setCountry,
6958
+ options: [
6959
+ { value: "us", label: "United States" },
6960
+ { value: "de", label: "Germany" },
6961
+ { value: "jp", label: "Japan" }
6962
+ ]
6963
+ }
6964
+ ) }),
6965
+ /* @__PURE__ */ jsx(FormField, { label: "Plan", children: /* @__PURE__ */ jsxs("div", { className: "space-y-1.5 pt-1", children: [
6966
+ /* @__PURE__ */ jsx(Radio_default, { name: "plan", checked: plan === "free", onChange: () => setPlan("free"), label: "Free" }),
6967
+ /* @__PURE__ */ jsx(Radio_default, { name: "plan", checked: plan === "pro", onChange: () => setPlan("pro"), label: "Pro" }),
6968
+ /* @__PURE__ */ jsx(Radio_default, { name: "plan", checked: plan === "team", onChange: () => setPlan("team"), label: "Team" })
6969
+ ] }) })
6970
+ ] }),
6971
+ /* @__PURE__ */ jsx(Checkbox_default, { checked: newsletter, onChange: setNewsletter, label: "Email me product updates", description: "Occasional news \u2014 no more than once a month." })
6972
+ ] }) }),
6973
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-end gap-2", children: [
6974
+ /* @__PURE__ */ jsx(Button_default, { variant: "secondary", children: "Cancel" }),
6975
+ /* @__PURE__ */ jsx(Button_default, { type: "submit", children: "Save changes" })
6976
+ ] })
6977
+ ] }) });
6978
+ }
6979
+ var ITEMS = [
6980
+ { name: "Mechanical keyboard", qty: 1, price: 129 },
6981
+ { name: "USB-C cable (2m)", qty: 2, price: 12 },
6982
+ { name: "Laptop stand", qty: 1, price: 48 }
6983
+ ];
6984
+ function CheckoutTemplate() {
6985
+ const [sameAddress, setSameAddress] = useState(true);
6986
+ const [country, setCountry] = useState("us");
6987
+ const subtotal = ITEMS.reduce((s, i) => s + i.qty * i.price, 0);
6988
+ const shipping = 9;
6989
+ const total = subtotal + shipping;
6990
+ return /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-5xl space-y-5", children: [
6991
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-gray-900", children: "Checkout" }),
6992
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-5 lg:grid-cols-3", children: [
6993
+ /* @__PURE__ */ jsxs("form", { className: "space-y-5 lg:col-span-2", onSubmit: (e) => e.preventDefault(), children: [
6994
+ /* @__PURE__ */ jsx(Card, { header: "Contact", children: /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsx(FormField, { label: "Email", htmlFor: "ck-email", required: true, children: /* @__PURE__ */ jsx(Input_default, { id: "ck-email", type: "email", placeholder: "you@example.com" }) }) }) }),
6995
+ /* @__PURE__ */ jsx(Card, { header: "Shipping address", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
6996
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2", children: [
6997
+ /* @__PURE__ */ jsx(FormField, { label: "First name", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "Alice" }) }),
6998
+ /* @__PURE__ */ jsx(FormField, { label: "Last name", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "Nguyen" }) })
6999
+ ] }),
7000
+ /* @__PURE__ */ jsx(FormField, { label: "Address", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "123 Market St" }) }),
7001
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-3", children: [
7002
+ /* @__PURE__ */ jsx(FormField, { label: "City", children: /* @__PURE__ */ jsx(Input_default, { placeholder: "San Francisco" }) }),
7003
+ /* @__PURE__ */ jsx(FormField, { label: "ZIP", children: /* @__PURE__ */ jsx(Input_default, { placeholder: "94103" }) }),
7004
+ /* @__PURE__ */ jsx(FormField, { label: "Country", children: /* @__PURE__ */ jsx(
7005
+ Select_default,
7006
+ {
7007
+ value: country,
7008
+ onChange: setCountry,
7009
+ options: [
7010
+ { value: "us", label: "United States" },
7011
+ { value: "de", label: "Germany" },
7012
+ { value: "jp", label: "Japan" }
7013
+ ]
7014
+ }
7015
+ ) })
7016
+ ] }),
7017
+ /* @__PURE__ */ jsx(Checkbox_default, { checked: sameAddress, onChange: setSameAddress, label: "Billing address same as shipping" })
7018
+ ] }) }),
7019
+ /* @__PURE__ */ jsx(Card, { header: "Payment", children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
7020
+ /* @__PURE__ */ jsx(FormField, { label: "Card number", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "1234 5678 9012 3456" }) }),
7021
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
7022
+ /* @__PURE__ */ jsx(FormField, { label: "Expiry", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "MM / YY" }) }),
7023
+ /* @__PURE__ */ jsx(FormField, { label: "CVC", required: true, children: /* @__PURE__ */ jsx(Input_default, { placeholder: "123" }) })
7024
+ ] })
7025
+ ] }) })
7026
+ ] }),
7027
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
7028
+ /* @__PURE__ */ jsxs(Card, { header: "Order summary", children: [
7029
+ /* @__PURE__ */ jsx("ul", { className: "space-y-2 text-sm", children: ITEMS.map((i) => /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-2 text-gray-700", children: [
7030
+ /* @__PURE__ */ jsxs("span", { children: [
7031
+ i.name,
7032
+ " ",
7033
+ /* @__PURE__ */ jsxs("span", { className: "text-gray-400", children: [
7034
+ "\xD7",
7035
+ i.qty
7036
+ ] })
7037
+ ] }),
7038
+ /* @__PURE__ */ jsxs("span", { children: [
7039
+ "$",
7040
+ i.qty * i.price
7041
+ ] })
7042
+ ] }, i.name)) }),
7043
+ /* @__PURE__ */ jsxs("div", { className: "mt-3 space-y-1.5 border-t border-gray-100 pt-3 text-sm text-gray-600", children: [
7044
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
7045
+ /* @__PURE__ */ jsx("span", { children: "Subtotal" }),
7046
+ /* @__PURE__ */ jsxs("span", { children: [
7047
+ "$",
7048
+ subtotal
7049
+ ] })
7050
+ ] }),
7051
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between", children: [
7052
+ /* @__PURE__ */ jsx("span", { children: "Shipping" }),
7053
+ /* @__PURE__ */ jsxs("span", { children: [
7054
+ "$",
7055
+ shipping
7056
+ ] })
7057
+ ] }),
7058
+ /* @__PURE__ */ jsxs("div", { className: "flex justify-between text-base font-semibold text-gray-900", children: [
7059
+ /* @__PURE__ */ jsx("span", { children: "Total" }),
7060
+ /* @__PURE__ */ jsxs("span", { children: [
7061
+ "$",
7062
+ total
7063
+ ] })
7064
+ ] })
7065
+ ] }),
7066
+ /* @__PURE__ */ jsxs(Button_default, { block: true, className: "mt-4", children: [
7067
+ "Pay $",
7068
+ total
7069
+ ] })
7070
+ ] }),
7071
+ /* @__PURE__ */ jsx(Banner, { tone: "success", title: "Promo applied", children: "Free returns within 30 days." })
7072
+ ] })
7073
+ ] })
7074
+ ] }) });
7075
+ }
7076
+ var FOLDERS = [
7077
+ { id: "inbox", label: "Inbox", count: 12 },
7078
+ { id: "starred", label: "Starred", count: 3 },
7079
+ { id: "sent", label: "Sent" },
7080
+ { id: "drafts", label: "Drafts", count: 1 },
7081
+ { id: "archive", label: "Archive" },
7082
+ { id: "trash", label: "Trash" }
7083
+ ];
7084
+ var MESSAGES = [
7085
+ { id: 1, from: "Marco Reyes", subject: "Q3 roadmap review", preview: "Sharing the deck ahead of Thursday \u2014 let me know\u2026", time: "9:14", unread: true },
7086
+ { id: 2, from: "Priya Patel", subject: "Design handoff", preview: "The Figma file is ready for engineering. I exported\u2026", time: "8:02", unread: true },
7087
+ { id: 3, from: "GitHub", subject: "[acme/web] PR #482 merged", preview: "Your pull request was merged into main by\u2026", time: "Yest" },
7088
+ { id: 4, from: "Sara Lind", subject: "Lunch Friday?", preview: "A few of us are heading to the new place on 5th\u2026", time: "Yest" }
7089
+ ];
7090
+ function EmailTemplate() {
7091
+ const [active, setActive] = useState(1);
7092
+ const selected = MESSAGES.find((m) => m.id === active) ?? MESSAGES[0];
7093
+ return /* @__PURE__ */ jsx("div", { className: "h-full", children: /* @__PURE__ */ jsx(
7094
+ SidebarLayout,
7095
+ {
7096
+ side: "left",
7097
+ defaultWidth: 200,
7098
+ sidebar: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col p-2", children: [
7099
+ /* @__PURE__ */ jsx(Button_default, { block: true, className: "mb-2", children: "Compose" }),
7100
+ FOLDERS.map((f, i) => /* @__PURE__ */ jsxs(
7101
+ "button",
7102
+ {
7103
+ className: `flex items-center justify-between rounded-md px-3 py-2 text-left text-sm ${i === 0 ? "bg-blue-50 font-medium text-blue-700" : "text-gray-700 hover:bg-gray-100"}`,
7104
+ children: [
7105
+ /* @__PURE__ */ jsx("span", { children: f.label }),
7106
+ f.count != null && /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: f.count })
7107
+ ]
7108
+ },
7109
+ f.id
7110
+ ))
7111
+ ] }),
7112
+ children: /* @__PURE__ */ jsxs("div", { className: "flex h-full", children: [
7113
+ /* @__PURE__ */ jsx("div", { className: "w-72 shrink-0 overflow-auto border-r border-gray-200", children: MESSAGES.map((m) => /* @__PURE__ */ jsxs(
7114
+ "button",
7115
+ {
7116
+ onClick: () => setActive(m.id),
7117
+ className: `block w-full border-b border-gray-100 px-4 py-3 text-left hover:bg-gray-50 ${m.id === active ? "bg-blue-50/50" : ""}`,
7118
+ children: [
7119
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
7120
+ /* @__PURE__ */ jsx("span", { className: `truncate text-sm ${m.unread ? "font-semibold text-gray-900" : "text-gray-700"}`, children: m.from }),
7121
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] text-gray-400", children: m.time })
7122
+ ] }),
7123
+ /* @__PURE__ */ jsx("div", { className: `truncate text-sm ${m.unread ? "text-gray-800" : "text-gray-600"}`, children: m.subject }),
7124
+ /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-gray-400", children: m.preview })
7125
+ ]
7126
+ },
7127
+ m.id
7128
+ )) }),
7129
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 flex-col overflow-auto", children: [
7130
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-gray-200 p-4", children: [
7131
+ /* @__PURE__ */ jsx("h2", { className: "truncate text-base font-semibold text-gray-900", children: selected.subject }),
7132
+ /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 gap-1.5", children: [
7133
+ /* @__PURE__ */ jsx(Button_default, { variant: "ghost", size: "sm", children: "Archive" }),
7134
+ /* @__PURE__ */ jsx(Button_default, { variant: "secondary", size: "sm", children: "Reply" })
7135
+ ] })
7136
+ ] }),
7137
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-b border-gray-100 p-4", children: [
7138
+ /* @__PURE__ */ jsx(Avatar, { name: selected.from }),
7139
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
7140
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-gray-900", children: selected.from }),
7141
+ /* @__PURE__ */ jsxs("div", { className: "text-xs text-gray-400", children: [
7142
+ "to me \xB7 ",
7143
+ selected.time
7144
+ ] })
7145
+ ] })
7146
+ ] }),
7147
+ /* @__PURE__ */ jsxs("div", { className: "space-y-3 p-4 text-sm leading-relaxed text-gray-700", children: [
7148
+ /* @__PURE__ */ jsx("p", { children: "Hi," }),
7149
+ /* @__PURE__ */ jsxs("p", { children: [
7150
+ selected.preview,
7151
+ " The full details are attached \u2014 happy to walk through anything on a quick call."
7152
+ ] }),
7153
+ /* @__PURE__ */ jsxs("p", { children: [
7154
+ "Best,",
7155
+ /* @__PURE__ */ jsx("br", {}),
7156
+ selected.from
7157
+ ] })
7158
+ ] })
7159
+ ] })
7160
+ ] })
7161
+ }
7162
+ ) });
7163
+ }
7164
+ var CONVOS = [
7165
+ { id: 1, name: "Priya Patel", last: "Sounds good \u2014 shipping it now", time: "9:41", status: "online" },
7166
+ { id: 2, name: "Design team", last: "Marco: updated the tokens", time: "9:12", status: "away" },
7167
+ { id: 3, name: "Tom Becker", last: "Thanks!", time: "Yest", status: "offline" },
7168
+ { id: 4, name: "Sara Lind", last: "See you Friday \u{1F389}", time: "Yest", status: "busy" }
7169
+ ];
7170
+ var THREAD = [
7171
+ { mine: false, text: "Hey! Did the latest build go out?" },
7172
+ { mine: true, text: "Just merged \u2014 deploying now." },
7173
+ { mine: false, text: "Nice. Any breaking changes for the portal?" },
7174
+ { mine: true, text: "Nope, fully additive. New components only." },
7175
+ { mine: false, text: "Sounds good \u2014 shipping it now" }
7176
+ ];
7177
+ function ChatTemplate() {
7178
+ const [active, setActive] = useState(1);
7179
+ const convo = CONVOS.find((c) => c.id === active) ?? CONVOS[0];
7180
+ return /* @__PURE__ */ jsx("div", { className: "h-full", children: /* @__PURE__ */ jsx(
7181
+ SidebarLayout,
7182
+ {
7183
+ side: "left",
7184
+ defaultWidth: 260,
7185
+ sidebar: /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto", children: CONVOS.map((c) => /* @__PURE__ */ jsxs(
7186
+ "button",
7187
+ {
7188
+ onClick: () => setActive(c.id),
7189
+ className: `flex w-full items-center gap-3 border-b border-gray-100 px-3 py-3 text-left hover:bg-gray-50 ${c.id === active ? "bg-blue-50/50" : ""}`,
7190
+ children: [
7191
+ /* @__PURE__ */ jsx(Avatar, { name: c.name, status: c.status }),
7192
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
7193
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
7194
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium text-gray-900", children: c.name }),
7195
+ /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[11px] text-gray-400", children: c.time })
7196
+ ] }),
7197
+ /* @__PURE__ */ jsx("div", { className: "truncate text-xs text-gray-500", children: c.last })
7198
+ ] })
7199
+ ]
7200
+ },
7201
+ c.id
7202
+ )) }),
7203
+ children: /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col", children: [
7204
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 border-b border-gray-200 p-3", children: [
7205
+ /* @__PURE__ */ jsx(Avatar, { name: convo.name, status: convo.status, size: "sm" }),
7206
+ /* @__PURE__ */ jsxs("div", { children: [
7207
+ /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-gray-900", children: convo.name }),
7208
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-400 capitalize", children: convo.status })
7209
+ ] })
7210
+ ] }),
7211
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-2 overflow-auto bg-gray-50 p-4", children: THREAD.map((m, i) => /* @__PURE__ */ jsx("div", { className: `flex ${m.mine ? "justify-end" : "justify-start"}`, children: /* @__PURE__ */ jsx(
7212
+ "div",
7213
+ {
7214
+ style: { maxWidth: "75%" },
7215
+ className: `rounded-2xl px-3 py-2 text-sm ${m.mine ? "bg-blue-600 text-white" : "bg-white text-gray-800 shadow-sm"}`,
7216
+ children: m.text
7217
+ }
7218
+ ) }, i)) }),
7219
+ /* @__PURE__ */ jsxs("form", { className: "flex items-center gap-2 border-t border-gray-200 p-3", onSubmit: (e) => e.preventDefault(), children: [
7220
+ /* @__PURE__ */ jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsx(Input_default, { placeholder: "Type a message\u2026" }) }),
7221
+ /* @__PURE__ */ jsx(Button_default, { type: "submit", children: "Send" })
7222
+ ] })
7223
+ ] })
7224
+ }
7225
+ ) });
7226
+ }
7227
+ var GROUPS2 = { featured: "success", new: "active", draft: "draft" };
7228
+ var GRADIENTS = [
7229
+ "linear-gradient(135deg,#60a5fa,#a78bfa)",
7230
+ "linear-gradient(135deg,#34d399,#10b981)",
7231
+ "linear-gradient(135deg,#fbbf24,#f59e0b)",
7232
+ "linear-gradient(135deg,#f472b6,#ec4899)",
7233
+ "linear-gradient(135deg,#38bdf8,#6366f1)",
7234
+ "linear-gradient(135deg,#fb7185,#ef4444)",
7235
+ "linear-gradient(135deg,#4ade80,#22c55e)",
7236
+ "linear-gradient(135deg,#c084fc,#8b5cf6)"
7237
+ ];
7238
+ var ITEMS2 = GRADIENTS.map((g, i) => ({
7239
+ id: i,
7240
+ title: ["Sunrise", "Forest", "Desert", "Bloom", "Ocean", "Ember", "Meadow", "Dusk"][i],
7241
+ tag: ["featured", "new", "draft"][i % 3],
7242
+ bg: g
7243
+ }));
7244
+ function GalleryTemplate() {
7245
+ const [filter, setFilter] = useState("all");
7246
+ const shown = filter === "all" ? ITEMS2 : ITEMS2.filter((i) => i.tag === filter);
7247
+ return /* @__PURE__ */ jsx(StatusBadgeProvider, { groups: GROUPS2, children: /* @__PURE__ */ jsx("div", { className: "h-full overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("div", { className: "mx-auto max-w-5xl space-y-4", children: [
7248
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
7249
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-gray-900", children: "Gallery" }),
7250
+ /* @__PURE__ */ jsx(Button_default, { size: "sm", children: "Upload" })
7251
+ ] }),
7252
+ /* @__PURE__ */ jsx(
7253
+ Tabs,
7254
+ {
7255
+ value: filter,
7256
+ onChange: setFilter,
7257
+ variant: "pill",
7258
+ items: [
7259
+ { id: "all", label: "All" },
7260
+ { id: "featured", label: "Featured" },
7261
+ { id: "new", label: "New" },
7262
+ { id: "draft", label: "Drafts" }
7263
+ ]
7264
+ }
7265
+ ),
7266
+ /* @__PURE__ */ jsx("div", { className: "grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4", children: shown.map((item) => /* @__PURE__ */ jsxs(Card, { padded: false, className: "overflow-hidden", children: [
7267
+ /* @__PURE__ */ jsx("div", { className: "relative h-28", style: { background: item.bg }, children: /* @__PURE__ */ jsx("span", { className: "absolute right-2 top-2", children: /* @__PURE__ */ jsx(StatusBadge, { status: item.tag }) }) }),
7268
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 p-3", children: [
7269
+ /* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium text-gray-900", children: item.title }),
7270
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400", children: "2.4 MB" })
7271
+ ] })
7272
+ ] }, item.id)) })
7273
+ ] }) }) });
7274
+ }
7275
+ var COPY = {
7276
+ login: { title: "Welcome back", subtitle: "Sign in to your account", cta: "Sign in" },
7277
+ register: { title: "Create your account", subtitle: "Start your 14-day free trial", cta: "Create account" },
7278
+ forgot: { title: "Reset password", subtitle: "We'll email you a reset link", cta: "Send reset link" }
7279
+ };
7280
+ function AuthScreen({ mode = "login" }) {
7281
+ const [remember, setRemember] = useState(true);
7282
+ const c = COPY[mode];
7283
+ return /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center overflow-auto bg-gray-50 p-6", children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-sm", children: [
7284
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 text-center", children: [
7285
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-blue-600 text-sm font-bold text-white", children: "A" }),
7286
+ /* @__PURE__ */ jsx("h1", { className: "text-lg font-semibold text-gray-900", children: c.title }),
7287
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500", children: c.subtitle })
7288
+ ] }),
7289
+ /* @__PURE__ */ jsx(Card, { children: /* @__PURE__ */ jsxs("form", { className: "space-y-4", onSubmit: (e) => e.preventDefault(), children: [
7290
+ mode === "register" && /* @__PURE__ */ jsx(FormField, { label: "Name", htmlFor: "au-name", children: /* @__PURE__ */ jsx(Input_default, { id: "au-name", placeholder: "Alice Nguyen" }) }),
7291
+ /* @__PURE__ */ jsx(FormField, { label: "Email", htmlFor: "au-email", children: /* @__PURE__ */ jsx(Input_default, { id: "au-email", type: "email", placeholder: "you@example.com" }) }),
7292
+ mode !== "forgot" && /* @__PURE__ */ jsx(
7293
+ FormField,
7294
+ {
7295
+ label: "Password",
7296
+ htmlFor: "au-pass",
7297
+ hint: mode === "register" ? "At least 8 characters." : void 0,
7298
+ children: /* @__PURE__ */ jsx(Input_default, { id: "au-pass", type: "password", placeholder: "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" })
7299
+ }
7300
+ ),
7301
+ mode === "login" && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
7302
+ /* @__PURE__ */ jsx(Checkbox_default, { checked: remember, onChange: setRemember, label: "Remember me" }),
7303
+ /* @__PURE__ */ jsx("a", { href: "#", className: "text-sm text-blue-600 hover:underline", children: "Forgot?" })
7304
+ ] }),
7305
+ /* @__PURE__ */ jsx(Button_default, { type: "submit", block: true, children: c.cta })
7306
+ ] }) }),
7307
+ /* @__PURE__ */ jsx("p", { className: "mt-4 text-center text-sm text-gray-500", children: mode === "register" ? /* @__PURE__ */ jsxs(Fragment, { children: [
7308
+ "Already have an account? ",
7309
+ /* @__PURE__ */ jsx("a", { href: "#", className: "text-blue-600 hover:underline", children: "Sign in" })
7310
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
7311
+ "New here? ",
7312
+ /* @__PURE__ */ jsx("a", { href: "#", className: "text-blue-600 hover:underline", children: "Create an account" })
7313
+ ] }) })
7314
+ ] }) });
7315
+ }
7316
+ var COPY2 = {
7317
+ 403: { title: "Access denied", body: "You don't have permission to view this page." },
7318
+ 404: { title: "Page not found", body: "The page you're looking for doesn't exist or was moved." },
7319
+ 500: { title: "Something went wrong", body: "An unexpected error occurred. Please try again." }
7320
+ };
7321
+ function ErrorPage({ code = 404 }) {
7322
+ const c = COPY2[code];
7323
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center bg-gray-50 p-6 text-center", children: [
7324
+ /* @__PURE__ */ jsx("div", { className: "text-7xl font-bold tracking-tight text-gray-400", children: code }),
7325
+ /* @__PURE__ */ jsx("h1", { className: "mt-2 text-xl font-semibold text-gray-900", children: c.title }),
7326
+ /* @__PURE__ */ jsx("p", { className: "mt-1 max-w-sm text-sm text-gray-500", children: c.body }),
7327
+ /* @__PURE__ */ jsxs("div", { className: "mt-6 flex items-center gap-2", children: [
7328
+ /* @__PURE__ */ jsx(Button_default, { variant: "secondary", children: "Go back" }),
7329
+ /* @__PURE__ */ jsx(Button_default, { children: "Take me home" })
7330
+ ] })
7331
+ ] });
7332
+ }
6156
7333
  var EntityFetcherContext = createContext(null);
6157
7334
  function ShellEntityFetcherProvider({
6158
7335
  value,
@@ -6199,6 +7376,6 @@ function useEditHotkey(callback) {
6199
7376
  }, [callback, isActive]);
6200
7377
  }
6201
7378
 
6202
- export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, BehaviorPanel, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Customization, DEV_BANNER_TEXT, Desktop, DesktopHostProvider, DevIndicator, ENTER, EntityList, GlobalSearch, HelpCenter, Kanban, Layout, ListFooter, MOD, Markdown, NotificationBell, ResizableTable, SHIFT, SearchableSelect, ShellEntityFetcherProvider, ShortcutHelp, SoundsPanel, StartMenu, StatusBadge, StatusBadgeProvider, SystemPreferences, TopNav, WidgetManager, applyDevTitle, createWindowRegistry, formatDate, isDevEnv, isMac, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
7379
+ export { ALT, ALT_SHIFT_D, ALT_SHIFT_E, ALT_SHIFT_N, Accordion, AuthScreen, Avatar, AvatarGroup, Banner, BarChart, BehaviorPanel, Button_default as Button, CMD_A, CMD_DOT, CMD_ENTER, CMD_K, CMD_S, Card, ChatTemplate, Checkbox_default as Checkbox, CheckoutTemplate, Customization, DEV_BANNER_TEXT, DashboardTemplate, DataTablePage, Desktop, DesktopHostProvider, DevIndicator, DonutChart, ENTER, EmailTemplate, EntityList, ErrorPage, FormField, FormLayoutPage, GalleryTemplate, GlobalSearch, HelpCenter, INPUT_BASE, Input_default as Input, Kanban, Label, Layout, ListFooter, MOD, Markdown, NotificationBell, Pagination, Radio_default as Radio, ResizableTable, SHIFT, SearchableSelect, Select_default as Select, ShellEntityFetcherProvider, ShortcutHelp, SoundsPanel, Sparkline, StartMenu, StatCard, StatusBadge, StatusBadgeProvider, SystemPreferences, Tabs, Textarea_default as Textarea, Tooltip, TopNav, WidgetManager, applyDevTitle, createWindowRegistry, formatDate, inputClasses, isDevEnv, isMac, useClickOutside, useColumnConfig, useDesktopHost, useEditHotkey, useInfiniteScroll, useNewHotkey, useShellEntityFetcher, useSort, useTableNav };
6203
7380
  //# sourceMappingURL=index.js.map
6204
7381
  //# sourceMappingURL=index.js.map