@waveinno/ui 0.3.0 → 0.4.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 (61) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +29 -11
  3. package/dist/components/brand/waveinno-logo.js +1 -1
  4. package/dist/components/charts/bar-list.js +1 -1
  5. package/dist/components/charts/heatmap.js +1 -1
  6. package/dist/components/patterns/activity-feed.js +1 -1
  7. package/dist/components/patterns/app-launcher.js +1 -1
  8. package/dist/components/patterns/data-table-edit.js +1 -1
  9. package/dist/components/patterns/data-table-filters.js +1 -1
  10. package/dist/components/patterns/data-table.js +1 -1
  11. package/dist/components/patterns/page-header.js +1 -1
  12. package/dist/components/patterns/page-hero.js +1 -1
  13. package/dist/components/patterns/stat-card.js +1 -1
  14. package/dist/components/patterns/timeline.js +1 -1
  15. package/dist/components/ui/alert.js +1 -1
  16. package/dist/components/ui/avatar.js +1 -1
  17. package/dist/components/ui/badge.js +1 -1
  18. package/dist/components/ui/button.js +1 -1
  19. package/dist/components/ui/checkbox.js +1 -1
  20. package/dist/components/ui/combobox.js +1 -1
  21. package/dist/components/ui/confirm-dialog.js +1 -1
  22. package/dist/components/ui/dialog.js +1 -1
  23. package/dist/components/ui/dropdown-menu.js +1 -1
  24. package/dist/components/ui/file-upload.js +1 -1
  25. package/dist/components/ui/kbd.js +1 -1
  26. package/dist/components/ui/menu.js +1 -1
  27. package/dist/components/ui/password-input.js +1 -1
  28. package/dist/components/ui/pin-input.js +1 -1
  29. package/dist/components/ui/popover.js +1 -1
  30. package/dist/components/ui/progress.js +1 -1
  31. package/dist/components/ui/radio-group.js +1 -1
  32. package/dist/components/ui/segmented.d.ts +1 -1
  33. package/dist/components/ui/segmented.js +1 -1
  34. package/dist/components/ui/sheet.js +1 -1
  35. package/dist/components/ui/slider.js +1 -1
  36. package/dist/components/ui/spinner.js +1 -1
  37. package/dist/components/ui/tabs.js +1 -1
  38. package/dist/components/ui/toast.js +1 -1
  39. package/dist/hooks/index.d.ts +1 -0
  40. package/dist/hooks/index.js +1 -1
  41. package/dist/hooks/use-router.d.ts +41 -0
  42. package/dist/hooks/use-router.js +1 -0
  43. package/dist/lib/index.d.ts +1 -0
  44. package/dist/lib/index.js +1 -1
  45. package/dist/lib/theme.d.ts +48 -0
  46. package/dist/lib/theme.js +7 -0
  47. package/dist/next/index.d.ts +6 -0
  48. package/dist/next/index.js +1 -0
  49. package/dist/shell/app-shell.js +1 -1
  50. package/dist/shell/app-switcher.js +1 -1
  51. package/dist/shell/command-palette.js +1 -1
  52. package/dist/shell/icon-rail.js +1 -1
  53. package/dist/shell/mobile-nav.js +1 -1
  54. package/dist/shell/module-sidebar.js +1 -1
  55. package/dist/shell/notifications.js +1 -1
  56. package/dist/shell/placeholder-screen.js +1 -1
  57. package/dist/shell/topbar.js +1 -1
  58. package/dist/shell/use-active.js +1 -1
  59. package/dist/shell/user-menu.js +1 -1
  60. package/dist/styles.css +18 -5
  61. package/package.json +11 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,23 @@ prop, major = a renamed or removed export or prop.
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 0.4.0 — 2026-10-02
10
+
11
+ - **Works in Vite and any React 19 app.** The package no longer imports Next.js: links and navigation go through a
12
+ router adapter (`RouterProvider`, `useRouterAdapter`, `RouterLink`). `next` is now an optional peer dependency.
13
+ - **`@waveinno/ui/next`**: `NextRouterProvider` (and `nextRouter`), the Next.js adapter.
14
+ **Action needed for Next.js apps using AppShell:** wrap the app in `<NextRouterProvider>`; without it the shell's
15
+ links still work, but as plain links with full page loads.
16
+ - **`createTheme()`**: a full light and dark palette from one brand colour (OKLCH), with radius and fonts; returns CSS
17
+ and token maps. `hexToOklch`, `oklchToHex`.
18
+ - **Theme tokens** `--brand-1`, `--brand-2` (the brand gradient) and `--ink` (dark panels); every gradient, glow and
19
+ ink surface now follows them. `--radius-scale` scales every component's corners, not just the three named radii.
20
+ Tailwind gets `bg-ink`, `from-brand-1`, `to-brand-2`.
21
+ - Toast: the icon sits centred in its tile (sonner's 16 px icon box is resized to fit); the tone washes in from the
22
+ icon's corner. StatCard: the gradient card's number is white again.
23
+ - Docs site in the repo (`npm run dev` → /docs): Next.js and Vite installation guides, typography and fonts, theming,
24
+ routing, a page per component with live preview and copy-paste code, and a live theme builder.
25
+
9
26
  ## 0.3.0 — 2026-10-02
10
27
 
11
28
  - **RadioGroup**, **RadioGroupItem** and **RadioCard** (whole-card choices with icon, description and a price or badge).
package/README.md CHANGED
@@ -7,27 +7,45 @@ the brand, in light and dark, in English and Bangla. Shipped as compiled JavaScr
7
7
  npm install @waveinno/ui
8
8
  ```
9
9
 
10
- ## Set up (Next.js + Tailwind CSS v4)
10
+ ## Set up
11
+
12
+ Full guides, with every file: run the docs (`npm run dev`, then http://localhost:4500/docs) and open **Installation →
13
+ Next.js** or **Vite**. In short:
11
14
 
12
15
  ```css
13
- /* app/globals.css */
16
+ /* globals.css (Next.js) or src/index.css (Vite) */
14
17
  @import "tailwindcss";
15
18
  @import "@waveinno/ui/styles.css";
16
- /* Tailwind must see the class names the package uses. */
17
- @source "../../node_modules/@waveinno/ui/dist";
19
+ /* Tailwind must see the class names the package uses (path relative to this file). */
20
+ @source "../node_modules/@waveinno/ui/dist";
18
21
  ```
19
22
 
20
23
  ```tsx
21
- // app/layout.tsx — apply the saved theme before first paint (no flash)
24
+ // Next.js: app/layout.tsx — apply the saved theme before first paint (no flash)
22
25
  import { themeBootScript } from "@waveinno/ui";
23
-
24
26
  <head>
25
- <script dangerouslySetInnerHTML={{ __html: themeBootScript("default") }} />
27
+ <script dangerouslySetInnerHTML={{ __html: themeBootScript() }} />
26
28
  </head>;
29
+
30
+ // app/providers.tsx ("use client") — Next.js links for the shell, tooltips, toasts
31
+ import { Toaster, TooltipProvider } from "@waveinno/ui";
32
+ import { NextRouterProvider } from "@waveinno/ui/next";
33
+ <NextRouterProvider>
34
+ <TooltipProvider>{children}<Toaster /></TooltipProvider>
35
+ </NextRouterProvider>;
27
36
  ```
28
37
 
29
- Peer dependencies: `react` and `react-dom` 19+, `next` 16+, `tailwindcss` 4+. For Bangla and the Taka sign, load
30
- Noto Sans Bengali and add it to `--font-inter` / `--font-jakarta` (Inter has no ৳).
38
+ Vite needs no Next.js: the main entry never imports it. Peer dependencies: `react` and `react-dom` 19+,
39
+ `tailwindcss` 4+, and `next` 16+ only for `@waveinno/ui/next`. Fonts: Inter, Plus Jakarta Sans, JetBrains Mono, and
40
+ Noto Sans Bengali after each (Inter has no Bangla and no ৳).
41
+
42
+ ## Theme
43
+
44
+ ```ts
45
+ import { createTheme } from "@waveinno/ui";
46
+ const { css } = createTheme({ primary: "#0f9d7a", radius: "lg", fontSans: "Manrope" });
47
+ // paste css after the package's stylesheet; or try colours live in the docs' theme builder (/themes)
48
+ ```
31
49
 
32
50
  ## Use
33
51
 
@@ -51,11 +69,11 @@ through `labels` props, so each product passes its own language.
51
69
  | Brand | WaveinnoLogo, WaveinnoSymbol, WaveMark (app icon: seven tones, round, 3D, animated), PoweredBy, Watermark; `@waveinno/ui/brand/waveinno-logo.svg` |
52
70
  | Shell | AppShell (rail → panel → content → drawer, ⌘K), theme and density controls, record drawer |
53
71
 
54
- ## See every component
72
+ ## Docs and playground
55
73
 
56
74
  ```bash
57
75
  npm install
58
- npm run dev # playground on http://localhost:4500, live from src/
76
+ npm run dev # http://localhost:4500 — docs (/docs), theme builder (/themes), every component on one page (/playground), live from src/
59
77
  ```
60
78
 
61
79
  Adding or changing a component: see [CONTRIBUTING.md](CONTRIBUTING.md).
@@ -1 +1 @@
1
- import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as c from"react";import{cn as i}from"../../lib/utils.js";const h=["M1813.61,996.15a83,83,0,0,1,18.61-27.62A89.37,89.37,0,0,1,1861,950.21c11.11-4.5,23.12-6.6,36.33-6.6s25.22,2.1,36.33,6.6a83.21,83.21,0,0,1,47.14,45.94,90.43,90.43,0,0,1,6.6,35.13c0,12.91-2.1,24.62-6.6,35.42a86,86,0,0,1-18.62,27.93,87.76,87.76,0,0,1-28.52,18.31c-11.11,4.5-23.12,6.6-36.33,6.6s-25.22-2.1-36.33-6.6a89.35,89.35,0,0,1-28.82-18.31,81.45,81.45,0,0,1-18.61-27.93,93.49,93.49,0,0,1,0-70.55Zm40.53,54.94a46.08,46.08,0,0,0,43.23,30,43.2,43.2,0,0,0,18.62-3.91A41.77,41.77,0,0,0,1930.7,1067a52.44,52.44,0,0,0,9.61-15.91,61.14,61.14,0,0,0,0-39.63,54.86,54.86,0,0,0-9.61-15.61A47.06,47.06,0,0,0,1916,985.34a47.9,47.9,0,0,0-18.62-3.6,46.79,46.79,0,0,0-18.61,3.6,48.25,48.25,0,0,0-15,10.51,43.84,43.84,0,0,0-9.61,15.61,56.33,56.33,0,0,0,0,39.63Z","M722.47,1061.5a74.57,74.57,0,0,1-16.65,25.57,73.37,73.37,0,0,1-25.27,16.65,86.77,86.77,0,0,1-32.11,6q-21,0-37.46-8.92a71.35,71.35,0,0,1-26.46-24.09,73.73,73.73,0,0,1-26.46,24.09q-16.5,8.91-37.46,8.92a85.28,85.28,0,0,1-31.82-6,73.83,73.83,0,0,1-42.21-42.22,86.77,86.77,0,0,1-5.95-32.11v-91h43.11v89.79c0,13.08,3.87,23.49,11.3,31.52s17.24,11.89,28.84,11.89a42.25,42.25,0,0,0,16.35-3.27,37.82,37.82,0,0,0,12.49-9.22,42.23,42.23,0,0,0,8.32-13.67,45.72,45.72,0,0,0,3-17.25V938.41h41v89.79a46.8,46.8,0,0,0,3,17.25,42.05,42.05,0,0,0,8.32,13.67,36.1,36.1,0,0,0,12.79,9.22,41.85,41.85,0,0,0,16,3.27c11.89,0,21.71-3.87,29.14-11.89s11-18.44,11-31.52V938.41h43.11v91A86.77,86.77,0,0,1,722.47,1061.5Z","M759,988.36a84.63,84.63,0,0,1,18.43-28A83.17,83.17,0,0,1,805.71,942c10.71-4.46,22.6-6.54,35.38-6.54a98.64,98.64,0,0,1,34.49,5.95,82.52,82.52,0,0,1,27.06,17.24,79.35,79.35,0,0,1,17.54,26.16,85.9,85.9,0,0,1,6.24,33v88.89H885.1v-25.27c-4.46,8.62-11.9,15.46-21.71,20.52a75.91,75.91,0,0,1-64.22,1.18,70,70,0,0,1-24.67-17.83,81.81,81.81,0,0,1-16.06-27.06,98.91,98.91,0,0,1-6-34.49C752.49,1011,754.58,999.07,759,988.36Zm40.13,53.82a42,42,0,0,0,9.22,15.46,38,38,0,0,0,13.68,10.1,38.78,38.78,0,0,0,17.54,3.87,43.46,43.46,0,0,0,17.84-3.57,39.31,39.31,0,0,0,14-10.11,46.86,46.86,0,0,0,8.92-15.46,59.7,59.7,0,0,0,3-19.92,62.27,62.27,0,0,0-3.27-19.92,46.79,46.79,0,0,0-8.92-15.46,43.91,43.91,0,0,0-14-10.4,41.19,41.19,0,0,0-48.76,10.4,47.47,47.47,0,0,0-9.22,15.46,62.27,62.27,0,0,0-3.27,19.92A59.11,59.11,0,0,0,799.17,1042.18Z","M1005.81,1106.69l-69-168.57h44.89l51.44,135.57,66.12-179.37h45.49l-84,212.37Z","M1292.41,1074.29a75.91,75.91,0,0,1-19,18.73,81.4,81.4,0,0,1-25,12.19,94.91,94.91,0,0,1-29.14,4.46c-12.48,0-24.08-2.08-34.49-6.55a84.32,84.32,0,0,1-27.65-18.13,79.12,79.12,0,0,1-17.83-27.65c-4.46-10.71-6.55-22.3-6.55-35.08a89.47,89.47,0,0,1,6.55-34.79,86.11,86.11,0,0,1,18.13-27.35c7.43-7.73,16.65-13.68,27.35-18.14,10.41-4.46,22-6.54,34.49-6.54a96.51,96.51,0,0,1,36.57,6.84,80.21,80.21,0,0,1,27.65,19.92A95.31,95.31,0,0,1,1301,992.52a114.42,114.42,0,0,1,6.25,38.66H1176.46c1.49,13.08,6.54,23.48,14.57,31.51s17.84,11.89,29.73,11.89a51,51,0,0,0,25.87-6.84,38.71,38.71,0,0,0,16-17.83H1304A73.86,73.86,0,0,1,1292.41,1074.29Zm-42.81-94.55c-8-6.84-17.54-10.11-28.84-10.11S1200,973.2,1192.22,980s-12.79,16.05-14.87,27.65h87.41C1262.68,995.79,1257.63,986.58,1249.6,979.74Z","M1337.9,874.49a23,23,0,0,1,32.11,0,21.1,21.1,0,0,1,6.54,15.76,21.75,21.75,0,0,1-6.54,16,22.26,22.26,0,0,1-32.11,0,21.76,21.76,0,0,1-6.55-16A21.11,21.11,0,0,1,1337.9,874.49Zm37.16,232.2h-42.22V938.41h42.22Z","M1533.82,1016.9c0-13.08-3.86-23.48-11.59-31.51-8-8-18.14-11.89-30.33-11.89-12.49,0-22.6,3.86-30.33,11.89-8,8-11.89,18.43-11.89,31.51v89.79h-43.11v-91.27a78,78,0,0,1,6.54-32.41,75.62,75.62,0,0,1,17.54-25.27,82.26,82.26,0,0,1,27.06-16.35,96.94,96.94,0,0,1,34.19-5.95,98.17,98.17,0,0,1,34.19,5.95,76.94,76.94,0,0,1,44.6,41.62,82.88,82.88,0,0,1,6.24,32.41v91.27h-43.11Z","M1777.9,1015.42v91.27h-43.11V1016.9c0-13.08-3.86-23.48-11.59-31.52-8-8-18.13-11.89-30.33-11.89-12.49,0-22.6,3.87-30.32,11.89-8,8-11.89,18.44-11.89,31.52v89.79h-43.11v-91.27a78,78,0,0,1,6.53-32.41,75.8,75.8,0,0,1,17.55-25.27,82.36,82.36,0,0,1,27-16.36,97.21,97.21,0,0,1,34.19-5.94,102.42,102.42,0,0,1,11.44.62,96.48,96.48,0,0,1,22.76,5.32,76,76,0,0,1,50.79,71.3C1777.89,1013.59,1777.9,1014.5,1777.9,1015.42Z"],u="M1728.11,921.1h.22c19-.47,37.93-.7,56.9-1.21a26.67,26.67,0,0,1,3.49.36c.2,2.21.46,4.13.52,6,.47,17.92,1,35.81,1.47,53.72v.19c-.52-1.3-1.08-2.57-1.66-3.83-.16-.39-.35-.77-.52-1.15-.36-.76-.72-1.52-1.1-2.27-.18-.38-.38-.74-.58-1.11s-.29-.6-.45-.89a101,101,0,0,0-6.29-10.39l-.74-1.07a103.42,103.42,0,0,0-6.95-8.78l-.82-.92c-.3-.34-.62-.69-.94-1s-.62-.67-1-1-.62-.67-.94-1l-1-1-2-1.92-1-.94-1-.92-1-.92-1-.89-1.28-1.07c-.63-.52-1.28-1-1.93-1.55-.37-.28-.73-.57-1.1-.84s-.79-.61-1.2-.91-.68-.5-1-.73l-1.32-.94-.95-.65c-1.14-.78-2.29-1.54-3.47-2.26-.39-.25-.78-.5-1.18-.73a102,102,0,0,0-10.12-5.39c-1-.46-2-.9-3-1.31-.49-.21-1-.42-1.46-.61s-.77-.33-1.16-.47l-1.18-.46C1730.28,921.87,1729.2,921.48,1728.11,921.1Z",d="M125,1019.41l-8.72,9.16c-4.84-5.51-11.54-10.91-18.68-11.59-4.45-.44-9.17,0-13.64,0H49.73a13.45,13.45,0,0,1-13.45-13.45v-50.7a13.45,13.45,0,0,1,13.45-13.45H99.28a13.46,13.46,0,0,1,13.46,13.45v24.5c0,10.29-2.71,22.17,3,31.5A42.32,42.32,0,0,0,125,1019.41Z",p="M401.1,938.26v81.47l-33.28.5a22.1,22.1,0,0,0-16.2,7.43l-66.45,74.6a22.09,22.09,0,0,1-16.51,7.41H247.59a11.38,11.38,0,0,1-11.37-11.38v-78.56h-8.54a24.74,24.74,0,0,0-18.37,8.18l-2.48,2.77-5.62,6.26-57.38,63.85a26.17,26.17,0,0,1-4.58,4,26.77,26.77,0,0,1-11,4.47,27.48,27.48,0,0,1-4.36.36H110.87a16.06,16.06,0,0,1-16.06-16.08v-42.43l21.49-22.59,8.72-9.16,64.68-68A37,37,0,0,1,216.47,940H248v85l.09-.09.07,21,89.94-96.13a37,37,0,0,1,26.77-11.48Z";function f({id:t}){return n("defs",{children:[n("linearGradient",{id:`${t}-a`,x1:"80.65",y1:"939.38",x2:"80.65",y2:"1028.57",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]}),n("linearGradient",{id:`${t}-b`,x1:"247.96",y1:"938.26",x2:"247.96",y2:"1109.67",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]}),n("linearGradient",{id:`${t}-c`,x1:"1728.11",y1:"950.03",x2:"1790.71",y2:"950.03",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]})]})}function v({className:t,tone:r="default",title:o="WAVEINNO"}){const a=c.useId().replace(/:/g,"");return n("svg",{viewBox:"-8 -8 1967.16 267.6",overflow:"visible",className:i("h-6 w-auto shrink-0",r==="inverse"?"text-white":"text-text",t),role:o?"img":void 0,"aria-label":o||void 0,"aria-hidden":o?void 0:!0,children:[e(f,{id:a}),n("g",{transform:"translate(-36.28 -867.95)",children:[h.map(s=>e("path",{d:s,fill:"currentColor"},s.slice(0,24))),e("path",{d:u,fill:`url(#${a}-c)`}),e("path",{d,fill:`url(#${a}-a)`}),e("path",{d:p,fill:`url(#${a}-b)`})]})]})}function g({className:t,style:r,title:o="WAVEINNO",mono:a=!1}){const s=c.useId().replace(/:/g,"");return n("svg",{viewBox:"36.28 938.26 364.82 171.41",className:i("h-6 w-auto shrink-0",t),style:r,role:o?"img":void 0,"aria-label":o||void 0,"aria-hidden":o?void 0:!0,children:[a?null:e(f,{id:s}),e("path",{d,fill:a?"currentColor":`url(#${s}-a)`}),e("path",{d:p,fill:a?"currentColor":`url(#${s}-b)`})]})}const x={"bottom-left":"bottom-2.5 left-2.5","bottom-right":"bottom-2.5 right-2.5","top-left":"top-2.5 left-2.5","top-right":"top-2.5 right-2.5"};function N({product:t,icon:r,variant:o="inline",position:a="bottom-left",label:s="powered by",className:m}){const l=n("span",{className:i("flex items-center gap-1 font-medium text-muted",t?"mt-0.5 text-[9px]":"text-[11px]"),children:[s,e(v,{title:"",className:t?"h-[9px]":"h-[11px]"})]});return n("div",{"aria-label":t?`${t}, ${s} WAVEINNO`:`${s} WAVEINNO`,role:"img",className:i("flex select-none items-center gap-1.5",o==="floating"&&i("pointer-events-none absolute z-10 rounded-[11px] border border-border bg-canvas/75 py-[5px] pl-1.5 pr-2.5 shadow-[0_4px_14px_-6px_rgba(10,15,46,.35)] backdrop-blur-md",x[a]),m),children:[r?e("span",{className:"grid shrink-0 place-items-center",children:r}):null,t?n("span",{className:"flex flex-col leading-none",children:[e("b",{className:"text-[12.5px] font-extrabold tracking-[0.14em] text-text",children:t.toUpperCase()}),l]}):l]})}function y({opacity:t=.05,className:r}){return e("div",{"aria-hidden":!0,className:i("pointer-events-none absolute inset-0 grid select-none place-items-center overflow-hidden",r),children:e("div",{style:{opacity:t},className:"w-[55%] max-w-[420px] -rotate-12",children:e(g,{title:"",className:"h-auto w-full"})})})}export{N as PoweredBy,y as Watermark,v as WaveinnoLogo,g as WaveinnoSymbol};
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import*as c from"react";import{cn as l}from"../../lib/utils.js";const u=["M1813.61,996.15a83,83,0,0,1,18.61-27.62A89.37,89.37,0,0,1,1861,950.21c11.11-4.5,23.12-6.6,36.33-6.6s25.22,2.1,36.33,6.6a83.21,83.21,0,0,1,47.14,45.94,90.43,90.43,0,0,1,6.6,35.13c0,12.91-2.1,24.62-6.6,35.42a86,86,0,0,1-18.62,27.93,87.76,87.76,0,0,1-28.52,18.31c-11.11,4.5-23.12,6.6-36.33,6.6s-25.22-2.1-36.33-6.6a89.35,89.35,0,0,1-28.82-18.31,81.45,81.45,0,0,1-18.61-27.93,93.49,93.49,0,0,1,0-70.55Zm40.53,54.94a46.08,46.08,0,0,0,43.23,30,43.2,43.2,0,0,0,18.62-3.91A41.77,41.77,0,0,0,1930.7,1067a52.44,52.44,0,0,0,9.61-15.91,61.14,61.14,0,0,0,0-39.63,54.86,54.86,0,0,0-9.61-15.61A47.06,47.06,0,0,0,1916,985.34a47.9,47.9,0,0,0-18.62-3.6,46.79,46.79,0,0,0-18.61,3.6,48.25,48.25,0,0,0-15,10.51,43.84,43.84,0,0,0-9.61,15.61,56.33,56.33,0,0,0,0,39.63Z","M722.47,1061.5a74.57,74.57,0,0,1-16.65,25.57,73.37,73.37,0,0,1-25.27,16.65,86.77,86.77,0,0,1-32.11,6q-21,0-37.46-8.92a71.35,71.35,0,0,1-26.46-24.09,73.73,73.73,0,0,1-26.46,24.09q-16.5,8.91-37.46,8.92a85.28,85.28,0,0,1-31.82-6,73.83,73.83,0,0,1-42.21-42.22,86.77,86.77,0,0,1-5.95-32.11v-91h43.11v89.79c0,13.08,3.87,23.49,11.3,31.52s17.24,11.89,28.84,11.89a42.25,42.25,0,0,0,16.35-3.27,37.82,37.82,0,0,0,12.49-9.22,42.23,42.23,0,0,0,8.32-13.67,45.72,45.72,0,0,0,3-17.25V938.41h41v89.79a46.8,46.8,0,0,0,3,17.25,42.05,42.05,0,0,0,8.32,13.67,36.1,36.1,0,0,0,12.79,9.22,41.85,41.85,0,0,0,16,3.27c11.89,0,21.71-3.87,29.14-11.89s11-18.44,11-31.52V938.41h43.11v91A86.77,86.77,0,0,1,722.47,1061.5Z","M759,988.36a84.63,84.63,0,0,1,18.43-28A83.17,83.17,0,0,1,805.71,942c10.71-4.46,22.6-6.54,35.38-6.54a98.64,98.64,0,0,1,34.49,5.95,82.52,82.52,0,0,1,27.06,17.24,79.35,79.35,0,0,1,17.54,26.16,85.9,85.9,0,0,1,6.24,33v88.89H885.1v-25.27c-4.46,8.62-11.9,15.46-21.71,20.52a75.91,75.91,0,0,1-64.22,1.18,70,70,0,0,1-24.67-17.83,81.81,81.81,0,0,1-16.06-27.06,98.91,98.91,0,0,1-6-34.49C752.49,1011,754.58,999.07,759,988.36Zm40.13,53.82a42,42,0,0,0,9.22,15.46,38,38,0,0,0,13.68,10.1,38.78,38.78,0,0,0,17.54,3.87,43.46,43.46,0,0,0,17.84-3.57,39.31,39.31,0,0,0,14-10.11,46.86,46.86,0,0,0,8.92-15.46,59.7,59.7,0,0,0,3-19.92,62.27,62.27,0,0,0-3.27-19.92,46.79,46.79,0,0,0-8.92-15.46,43.91,43.91,0,0,0-14-10.4,41.19,41.19,0,0,0-48.76,10.4,47.47,47.47,0,0,0-9.22,15.46,62.27,62.27,0,0,0-3.27,19.92A59.11,59.11,0,0,0,799.17,1042.18Z","M1005.81,1106.69l-69-168.57h44.89l51.44,135.57,66.12-179.37h45.49l-84,212.37Z","M1292.41,1074.29a75.91,75.91,0,0,1-19,18.73,81.4,81.4,0,0,1-25,12.19,94.91,94.91,0,0,1-29.14,4.46c-12.48,0-24.08-2.08-34.49-6.55a84.32,84.32,0,0,1-27.65-18.13,79.12,79.12,0,0,1-17.83-27.65c-4.46-10.71-6.55-22.3-6.55-35.08a89.47,89.47,0,0,1,6.55-34.79,86.11,86.11,0,0,1,18.13-27.35c7.43-7.73,16.65-13.68,27.35-18.14,10.41-4.46,22-6.54,34.49-6.54a96.51,96.51,0,0,1,36.57,6.84,80.21,80.21,0,0,1,27.65,19.92A95.31,95.31,0,0,1,1301,992.52a114.42,114.42,0,0,1,6.25,38.66H1176.46c1.49,13.08,6.54,23.48,14.57,31.51s17.84,11.89,29.73,11.89a51,51,0,0,0,25.87-6.84,38.71,38.71,0,0,0,16-17.83H1304A73.86,73.86,0,0,1,1292.41,1074.29Zm-42.81-94.55c-8-6.84-17.54-10.11-28.84-10.11S1200,973.2,1192.22,980s-12.79,16.05-14.87,27.65h87.41C1262.68,995.79,1257.63,986.58,1249.6,979.74Z","M1337.9,874.49a23,23,0,0,1,32.11,0,21.1,21.1,0,0,1,6.54,15.76,21.75,21.75,0,0,1-6.54,16,22.26,22.26,0,0,1-32.11,0,21.76,21.76,0,0,1-6.55-16A21.11,21.11,0,0,1,1337.9,874.49Zm37.16,232.2h-42.22V938.41h42.22Z","M1533.82,1016.9c0-13.08-3.86-23.48-11.59-31.51-8-8-18.14-11.89-30.33-11.89-12.49,0-22.6,3.86-30.33,11.89-8,8-11.89,18.43-11.89,31.51v89.79h-43.11v-91.27a78,78,0,0,1,6.54-32.41,75.62,75.62,0,0,1,17.54-25.27,82.26,82.26,0,0,1,27.06-16.35,96.94,96.94,0,0,1,34.19-5.95,98.17,98.17,0,0,1,34.19,5.95,76.94,76.94,0,0,1,44.6,41.62,82.88,82.88,0,0,1,6.24,32.41v91.27h-43.11Z","M1777.9,1015.42v91.27h-43.11V1016.9c0-13.08-3.86-23.48-11.59-31.52-8-8-18.13-11.89-30.33-11.89-12.49,0-22.6,3.87-30.32,11.89-8,8-11.89,18.44-11.89,31.52v89.79h-43.11v-91.27a78,78,0,0,1,6.53-32.41,75.8,75.8,0,0,1,17.55-25.27,82.36,82.36,0,0,1,27-16.36,97.21,97.21,0,0,1,34.19-5.94,102.42,102.42,0,0,1,11.44.62,96.48,96.48,0,0,1,22.76,5.32,76,76,0,0,1,50.79,71.3C1777.89,1013.59,1777.9,1014.5,1777.9,1015.42Z"],v="M1728.11,921.1h.22c19-.47,37.93-.7,56.9-1.21a26.67,26.67,0,0,1,3.49.36c.2,2.21.46,4.13.52,6,.47,17.92,1,35.81,1.47,53.72v.19c-.52-1.3-1.08-2.57-1.66-3.83-.16-.39-.35-.77-.52-1.15-.36-.76-.72-1.52-1.1-2.27-.18-.38-.38-.74-.58-1.11s-.29-.6-.45-.89a101,101,0,0,0-6.29-10.39l-.74-1.07a103.42,103.42,0,0,0-6.95-8.78l-.82-.92c-.3-.34-.62-.69-.94-1s-.62-.67-1-1-.62-.67-.94-1l-1-1-2-1.92-1-.94-1-.92-1-.92-1-.89-1.28-1.07c-.63-.52-1.28-1-1.93-1.55-.37-.28-.73-.57-1.1-.84s-.79-.61-1.2-.91-.68-.5-1-.73l-1.32-.94-.95-.65c-1.14-.78-2.29-1.54-3.47-2.26-.39-.25-.78-.5-1.18-.73a102,102,0,0,0-10.12-5.39c-1-.46-2-.9-3-1.31-.49-.21-1-.42-1.46-.61s-.77-.33-1.16-.47l-1.18-.46C1730.28,921.87,1729.2,921.48,1728.11,921.1Z",d="M125,1019.41l-8.72,9.16c-4.84-5.51-11.54-10.91-18.68-11.59-4.45-.44-9.17,0-13.64,0H49.73a13.45,13.45,0,0,1-13.45-13.45v-50.7a13.45,13.45,0,0,1,13.45-13.45H99.28a13.46,13.46,0,0,1,13.46,13.45v24.5c0,10.29-2.71,22.17,3,31.5A42.32,42.32,0,0,0,125,1019.41Z",p="M401.1,938.26v81.47l-33.28.5a22.1,22.1,0,0,0-16.2,7.43l-66.45,74.6a22.09,22.09,0,0,1-16.51,7.41H247.59a11.38,11.38,0,0,1-11.37-11.38v-78.56h-8.54a24.74,24.74,0,0,0-18.37,8.18l-2.48,2.77-5.62,6.26-57.38,63.85a26.17,26.17,0,0,1-4.58,4,26.77,26.77,0,0,1-11,4.47,27.48,27.48,0,0,1-4.36.36H110.87a16.06,16.06,0,0,1-16.06-16.08v-42.43l21.49-22.59,8.72-9.16,64.68-68A37,37,0,0,1,216.47,940H248v85l.09-.09.07,21,89.94-96.13a37,37,0,0,1,26.77-11.48Z";function f({id:a}){return n("defs",{children:[n("linearGradient",{id:`${a}-a`,x1:"80.65",y1:"939.38",x2:"80.65",y2:"1028.57",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]}),n("linearGradient",{id:`${a}-b`,x1:"247.96",y1:"938.26",x2:"247.96",y2:"1109.67",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]}),n("linearGradient",{id:`${a}-c`,x1:"1728.11",y1:"950.03",x2:"1790.71",y2:"950.03",gradientUnits:"userSpaceOnUse",children:[e("stop",{offset:"0",stopColor:"#1437d3"}),e("stop",{offset:"1",stopColor:"#7560fd"})]})]})}function h({className:a,tone:o="default",title:r="WAVEINNO"}){const t=c.useId().replace(/:/g,"");return n("svg",{viewBox:"-8 -8 1967.16 267.6",overflow:"visible",className:l("h-6 w-auto shrink-0",o==="inverse"?"text-white":"text-text",a),role:r?"img":void 0,"aria-label":r||void 0,"aria-hidden":r?void 0:!0,children:[e(f,{id:t}),n("g",{transform:"translate(-36.28 -867.95)",children:[u.map(s=>e("path",{d:s,fill:"currentColor"},s.slice(0,24))),e("path",{d:v,fill:`url(#${t}-c)`}),e("path",{d,fill:`url(#${t}-a)`}),e("path",{d:p,fill:`url(#${t}-b)`})]})]})}function g({className:a,style:o,title:r="WAVEINNO",mono:t=!1}){const s=c.useId().replace(/:/g,"");return n("svg",{viewBox:"36.28 938.26 364.82 171.41",className:l("h-6 w-auto shrink-0",a),style:o,role:r?"img":void 0,"aria-label":r||void 0,"aria-hidden":r?void 0:!0,children:[t?null:e(f,{id:s}),e("path",{d,fill:t?"currentColor":`url(#${s}-a)`}),e("path",{d:p,fill:t?"currentColor":`url(#${s}-b)`})]})}const x={"bottom-left":"bottom-2.5 left-2.5","bottom-right":"bottom-2.5 right-2.5","top-left":"top-2.5 left-2.5","top-right":"top-2.5 right-2.5"};function N({product:a,icon:o,variant:r="inline",position:t="bottom-left",label:s="powered by",className:m}){const i=n("span",{className:l("flex items-center gap-1 font-medium text-muted",a?"mt-0.5 text-[9px]":"text-[11px]"),children:[s,e(h,{title:"",className:a?"h-[9px]":"h-[11px]"})]});return n("div",{"aria-label":a?`${a}, ${s} WAVEINNO`:`${s} WAVEINNO`,role:"img",className:l("flex select-none items-center gap-1.5",r==="floating"&&l("pointer-events-none absolute z-10 rounded-[calc(11px*var(--radius-scale))] border border-border bg-canvas/75 py-[5px] pl-1.5 pr-2.5 shadow-[0_4px_14px_-6px_rgba(10,15,46,.35)] backdrop-blur-md",x[t]),m),children:[o?e("span",{className:"grid shrink-0 place-items-center",children:o}):null,a?n("span",{className:"flex flex-col leading-none",children:[e("b",{className:"text-[12.5px] font-extrabold tracking-[0.14em] text-text",children:a.toUpperCase()}),i]}):i]})}function y({opacity:a=.05,className:o}){return e("div",{"aria-hidden":!0,className:l("pointer-events-none absolute inset-0 grid select-none place-items-center overflow-hidden",o),children:e("div",{style:{opacity:a},className:"w-[55%] max-w-[420px] -rotate-12",children:e(g,{title:"",className:"h-auto w-full"})})})}export{N as PoweredBy,y as Watermark,h as WaveinnoLogo,g as WaveinnoSymbol};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as r}from"react/jsx-runtime";import{cn as l}from"../../lib/utils.js";function x({items:n,format:o=a=>a.toLocaleString(),sort:i=!0,color:c="var(--primary-subtle)",className:m}){const a=i?[...n].sort((e,s)=>s.value-e.value):n,u=Math.max(1,...a.map(e=>e.value));return t("ul",{className:l("space-y-1.5",m),children:a.map(e=>{const s=e.href?"a":"div";return t("li",{children:r(s,{...e.href?{href:e.href}:{},className:l("group flex items-center gap-3",e.href&&"cursor-pointer"),children:[r("div",{className:"relative h-8 min-w-0 flex-1 overflow-hidden rounded-[7px]",children:[t("div",{className:"absolute inset-y-0 left-0 rounded-[7px] transition-[width] duration-700 ease-[var(--ease)] group-hover:brightness-95",style:{width:`${Math.max(2,e.value/u*100)}%`,background:c}}),r("div",{className:"relative flex h-full items-center gap-2 px-2.5 text-[13px]",children:[e.icon?t("span",{className:"shrink-0 text-muted [&>svg]:size-4",children:e.icon}):null,t("span",{className:"truncate font-medium text-text",children:e.label}),e.hint?t("span",{className:"truncate text-[12px] text-muted",children:e.hint}):null]})]}),t("span",{className:"num w-20 shrink-0 text-right text-[13px] font-medium text-text",children:o(e.value)})]})},e.id)})})}export{x as BarList};
1
+ import{jsx as a,jsxs as r}from"react/jsx-runtime";import{cn as l}from"../../lib/utils.js";function v({items:n,format:o=t=>t.toLocaleString(),sort:i=!0,color:c="var(--primary-subtle)",className:u}){const t=i?[...n].sort((e,s)=>s.value-e.value):n,m=Math.max(1,...t.map(e=>e.value));return a("ul",{className:l("space-y-1.5",u),children:t.map(e=>{const s=e.href?"a":"div";return a("li",{children:r(s,{...e.href?{href:e.href}:{},className:l("group flex items-center gap-3",e.href&&"cursor-pointer"),children:[r("div",{className:"relative h-8 min-w-0 flex-1 overflow-hidden rounded-[calc(7px*var(--radius-scale))]",children:[a("div",{className:"absolute inset-y-0 left-0 rounded-[calc(7px*var(--radius-scale))] transition-[width] duration-700 ease-[var(--ease)] group-hover:brightness-95",style:{width:`${Math.max(2,e.value/m*100)}%`,background:c}}),r("div",{className:"relative flex h-full items-center gap-2 px-2.5 text-[13px]",children:[e.icon?a("span",{className:"shrink-0 text-muted [&>svg]:size-4",children:e.icon}):null,a("span",{className:"truncate font-medium text-text",children:e.label}),e.hint?a("span",{className:"truncate text-[12px] text-muted",children:e.hint}):null]})]}),a("span",{className:"num w-20 shrink-0 text-right text-[13px] font-medium text-text",children:o(e.value)})]})},e.id)})})}export{v as BarList};
@@ -1 +1 @@
1
- import{jsx as a,jsxs as r}from"react/jsx-runtime";import*as v from"react";import{cn as f}from"../../lib/utils.js";import{SEQUENTIAL as s}from"./palette.js";function b({rows:u,columns:m,values:o,format:t=n=>String(n),max:x,showColumnEvery:g=1,className:d}){const n=x??Math.max(1,...o.flat()),c=e=>e<=0?"var(--hover)":s[Math.min(s.length-1,Math.floor(e/n*(s.length-.001)))];return r("div",{className:f("overflow-x-auto",d),children:[r("div",{className:"inline-grid min-w-full gap-[3px]",style:{gridTemplateColumns:`auto repeat(${m.length}, minmax(14px, 1fr))`},children:[a("span",{}),m.map((e,p)=>a("span",{className:"num pb-1 text-center text-[10.5px] text-muted",children:p%g===0?e:""},e)),u.map((e,p)=>r(v.Fragment,{children:[a("span",{className:"pr-2 text-right text-[11.5px] leading-[18px] text-muted",children:e}),m.map((i,h)=>{const l=o[p]?.[h]??0;return a("span",{title:`${e} \xB7 ${i}: ${t(l)}`,"aria-label":`${e} ${i}: ${t(l)}`,className:"h-[18px] rounded-[4px] transition-transform hover:scale-110 hover:ring-2 hover:ring-primary/40",style:{background:c(l)}},i)})]},e))]}),r("div",{className:"mt-3 flex items-center justify-end gap-2 text-[11px] text-muted",children:[a("span",{className:"num",children:t(0)}),a("span",{className:"flex gap-[3px]",children:s.map(e=>a("span",{className:"h-2.5 w-5 rounded-[3px]",style:{background:e}},e))}),a("span",{className:"num",children:t(n)})]})]})}export{b as Heatmap};
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import*as v from"react";import{cn as f}from"../../lib/utils.js";import{SEQUENTIAL as s}from"./palette.js";function b({rows:u,columns:m,values:o,format:t=n=>String(n),max:x,showColumnEvery:d=1,className:g}){const n=x??Math.max(1,...o.flat()),c=a=>a<=0?"var(--hover)":s[Math.min(s.length-1,Math.floor(a/n*(s.length-.001)))];return r("div",{className:f("overflow-x-auto",g),children:[r("div",{className:"inline-grid min-w-full gap-[3px]",style:{gridTemplateColumns:`auto repeat(${m.length}, minmax(14px, 1fr))`},children:[e("span",{}),m.map((a,p)=>e("span",{className:"num pb-1 text-center text-[10.5px] text-muted",children:p%d===0?a:""},a)),u.map((a,p)=>r(v.Fragment,{children:[e("span",{className:"pr-2 text-right text-[11.5px] leading-[18px] text-muted",children:a}),m.map((i,h)=>{const l=o[p]?.[h]??0;return e("span",{title:`${a} \xB7 ${i}: ${t(l)}`,"aria-label":`${a} ${i}: ${t(l)}`,className:"h-[18px] rounded-[calc(4px*var(--radius-scale))] transition-transform hover:scale-110 hover:ring-2 hover:ring-primary/40",style:{background:c(l)}},i)})]},a))]}),r("div",{className:"mt-3 flex items-center justify-end gap-2 text-[11px] text-muted",children:[e("span",{className:"num",children:t(0)}),e("span",{className:"flex gap-[3px]",children:s.map(a=>e("span",{className:"h-2.5 w-5 rounded-[3px]",style:{background:a}},a))}),e("span",{className:"num",children:t(n)})]})]})}export{b as Heatmap};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{cn as s}from"../../lib/utils.js";import{Badge as o}from"../ui/badge.js";const i={neutral:"bg-hover text-muted",info:"bg-primary-subtle text-primary",success:"bg-success-subtle text-success",warning:"bg-warning-subtle text-warning",danger:"bg-danger-subtle text-danger",accent:"bg-primary-subtle text-accent"},c={neutral:"before:bg-border2",info:"before:bg-primary",success:"before:bg-success",warning:"before:bg-warning",danger:"before:bg-danger",accent:"before:bg-accent"};function x({items:n,variant:l="list",className:r}){return l==="cards"?t("ul",{className:s("space-y-2",r),children:n.map(e=>a("li",{className:s("relative flex items-center gap-3 overflow-hidden rounded-[12px] border border-border bg-raised py-3 pl-4 pr-3 shadow-[var(--lit)] transition-[transform,box-shadow] hover:-translate-y-px hover:shadow-[var(--lit),0_8px_20px_-12px_rgba(5,8,22,.3)]","before:absolute before:inset-y-0 before:left-0 before:w-[3px]",c[e.tone]),children:[t("span",{className:s("grid size-9 shrink-0 place-items-center rounded-[10px] [&_svg]:size-[18px]",i[e.tone]),children:e.icon??t("i",{className:"size-2 rounded-full bg-current"})}),a("div",{className:"min-w-0 flex-1",children:[a("div",{className:"flex items-center gap-2",children:[t("p",{className:"truncate text-[13px] font-semibold text-text",children:e.title}),e.time?t("span",{className:"ml-auto shrink-0 text-[11px] text-muted",children:e.time}):null]}),t("p",{className:"mt-0.5 text-[12px] text-muted",children:e.detail})]}),e.action?t("div",{className:"shrink-0",children:e.action}):null]},e.id))}):l==="compact"?t("ul",{className:s("divide-y divide-border",r),children:n.map(e=>a("li",{className:"flex items-center gap-2.5 py-2 text-[12.5px]",children:[t(o,{tone:e.tone,className:"h-4 shrink-0 px-1",children:t("span",{className:"sr-only",children:e.tone})}),a("span",{className:"min-w-0 flex-1 truncate",children:[t("span",{className:"font-medium text-text",children:e.title})," ",a("span",{className:"text-muted",children:["\xB7 ",e.detail]})]}),e.time?t("span",{className:"shrink-0 text-[11px] text-muted",children:e.time}):null,e.action?t("div",{className:"shrink-0",children:e.action}):null]},e.id))}):t("ul",{className:s("",r),children:n.map(e=>a("li",{className:"flex items-center gap-3 border-b border-border py-3 last:border-0",children:[t(o,{tone:e.tone,className:"h-[18px] shrink-0 px-1.5",children:t("span",{className:"sr-only",children:e.tone})}),a("div",{className:"min-w-0 flex-1",children:[t("p",{className:"text-[13px] font-medium leading-[18px] text-text",children:e.title}),t("p",{className:"mt-0.5 text-xs text-muted",children:e.detail})]}),e.action?t("div",{className:"shrink-0",children:e.action}):null]},e.id))})}export{x as ActivityFeed};
1
+ import{jsx as a,jsxs as t}from"react/jsx-runtime";import{cn as s}from"../../lib/utils.js";import{Badge as c}from"../ui/badge.js";const i={neutral:"bg-hover text-muted",info:"bg-primary-subtle text-primary",success:"bg-success-subtle text-success",warning:"bg-warning-subtle text-warning",danger:"bg-danger-subtle text-danger",accent:"bg-primary-subtle text-accent"},o={neutral:"before:bg-border2",info:"before:bg-primary",success:"before:bg-success",warning:"before:bg-warning",danger:"before:bg-danger",accent:"before:bg-accent"};function x({items:n,variant:l="list",className:r}){return l==="cards"?a("ul",{className:s("space-y-2",r),children:n.map(e=>t("li",{className:s("relative flex items-center gap-3 overflow-hidden rounded-[calc(12px*var(--radius-scale))] border border-border bg-raised py-3 pl-4 pr-3 shadow-[var(--lit)] transition-[transform,box-shadow] hover:-translate-y-px hover:shadow-[var(--lit),0_8px_20px_-12px_rgba(5,8,22,.3)]","before:absolute before:inset-y-0 before:left-0 before:w-[3px]",o[e.tone]),children:[a("span",{className:s("grid size-9 shrink-0 place-items-center rounded-[calc(10px*var(--radius-scale))] [&_svg]:size-[18px]",i[e.tone]),children:e.icon??a("i",{className:"size-2 rounded-full bg-current"})}),t("div",{className:"min-w-0 flex-1",children:[t("div",{className:"flex items-center gap-2",children:[a("p",{className:"truncate text-[13px] font-semibold text-text",children:e.title}),e.time?a("span",{className:"ml-auto shrink-0 text-[11px] text-muted",children:e.time}):null]}),a("p",{className:"mt-0.5 text-[12px] text-muted",children:e.detail})]}),e.action?a("div",{className:"shrink-0",children:e.action}):null]},e.id))}):l==="compact"?a("ul",{className:s("divide-y divide-border",r),children:n.map(e=>t("li",{className:"flex items-center gap-2.5 py-2 text-[12.5px]",children:[a(c,{tone:e.tone,className:"h-4 shrink-0 px-1",children:a("span",{className:"sr-only",children:e.tone})}),t("span",{className:"min-w-0 flex-1 truncate",children:[a("span",{className:"font-medium text-text",children:e.title})," ",t("span",{className:"text-muted",children:["\xB7 ",e.detail]})]}),e.time?a("span",{className:"shrink-0 text-[11px] text-muted",children:e.time}):null,e.action?a("div",{className:"shrink-0",children:e.action}):null]},e.id))}):a("ul",{className:s("",r),children:n.map(e=>t("li",{className:"flex items-center gap-3 border-b border-border py-3 last:border-0",children:[a(c,{tone:e.tone,className:"h-[18px] shrink-0 px-1.5",children:a("span",{className:"sr-only",children:e.tone})}),t("div",{className:"min-w-0 flex-1",children:[a("p",{className:"text-[13px] font-medium leading-[18px] text-text",children:e.title}),a("p",{className:"mt-0.5 text-xs text-muted",children:e.detail})]}),e.action?a("div",{className:"shrink-0",children:e.action}):null]},e.id))})}export{x as ActivityFeed};
@@ -1 +1 @@
1
- "use client";import{Fragment as _,jsx as e,jsxs as o}from"react/jsx-runtime";import*as b from"@radix-ui/react-popover";import{ArrowUpRight as M,Check as w}from"lucide-react";import*as N from"react";import{cn as c}from"../../lib/utils.js";const G={grid:"w-[328px] border-border bg-raised",list:"w-[340px] border-border bg-raised",spotlight:"w-[560px] max-w-[calc(100vw-24px)] border-border bg-raised p-0",glass:"w-[328px] border-white/50 bg-raised/65 backdrop-blur-2xl backdrop-saturate-150 shadow-[inset_0_1px_0_rgba(255,255,255,.6),var(--elev3)] dark:border-white/10 dark:shadow-[inset_0_1px_0_rgba(255,255,255,.08),var(--elev3)]",dark:"w-[328px] border-white/10 text-white bg-[#120b2e] bg-[image:radial-gradient(120%_60%_at_0%_0%,rgba(91,74,245,.32),transparent_60%)] [--text:#f5f6fa] [--body:#c9cce0] [--muted:#8d93b3] [--border:rgba(255,255,255,.1)] [--hover:rgba(255,255,255,.07)] [--primary:#a5a8ff] [--primary-subtle:rgba(139,143,248,.16)] [--raised:rgba(255,255,255,.06)] [--surface:rgba(255,255,255,.04)]"},U={icon:"size-9 rounded-full text-muted hover:bg-hover hover:text-text data-[state=open]:bg-hover data-[state=open]:text-text",chip:"h-9 gap-2 rounded-full border border-border bg-raised pl-1.5 pr-3 text-[13px] font-medium text-text shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06)] hover:bg-hover data-[state=open]:bg-hover"};function T({open:s}){return e("svg",{viewBox:"0 0 18 18",className:"size-[18px] shrink-0","aria-hidden":!0,children:Array.from({length:9},(i,a)=>{const r=Math.floor(a/3),n=a%3,p=r===n||r+n===2,u=s&&p?(1-n)*1.6:0,g=s&&p?(1-r)*1.6:0;return e("circle",{cx:3+n*6,cy:3+r*6,r:1.7,fill:"currentColor",style:{transform:`translate(${u}px, ${g}px) scale(${s&&!p?0:1})`,transformOrigin:`${3+n*6}px ${3+r*6}px`,transition:`transform 260ms cubic-bezier(.3,.7,.2,1) ${s?a*12:(8-a)*12}ms`}},a)})})}function x({app:s,size:i,glow:a}){const r={sm:"size-8 rounded-[9px] [&_svg]:size-4",md:"size-12 rounded-[14px] [&_svg]:size-[22px]",lg:"size-14 rounded-[16px] [&_svg]:size-6"}[i];return s.tint?e("span",{className:c("relative isolate grid shrink-0 place-items-center overflow-hidden text-white","before:absolute before:inset-x-0 before:top-0 before:-z-10 before:h-1/2 before:bg-[linear-gradient(180deg,rgba(255,255,255,.28),transparent)]",r),style:{background:s.tint,boxShadow:`inset 0 1px 0 rgba(255,255,255,.35), inset 0 -8px 16px -8px rgba(5,8,22,.3), 0 1px 2px rgba(5,8,22,.18)${a?", 0 10px 24px -10px rgba(91,74,245,.7)":""}`},children:s.icon}):e("span",{className:c("grid shrink-0 place-items-center [&>img]:size-full [&>*]:max-h-full [&>*]:max-w-full",r),children:s.icon})}function j(s){return i=>{const a=Array.from(i.currentTarget.querySelectorAll("[data-launcher-app]:not([aria-disabled='true'])")),r=a.indexOf(document.activeElement);if(r<0)return;const n={ArrowRight:1,ArrowLeft:-1,ArrowDown:s,ArrowUp:-s}[i.key];let p;n!==void 0?p=a[Math.min(Math.max(r+n,0),a.length-1)]:i.key==="Home"?p=a[0]:i.key==="End"&&(p=a[a.length-1]),p&&(i.preventDefault(),p.focus())}}function y({app:s,current:i,onChoose:a,className:r,children:n,onFocus:p,onMouseEnter:u}){const g={"data-launcher-app":"","aria-current":i?"page":void 0,"aria-disabled":s.disabled||void 0,className:c("outline-none focus-visible:ring-2 focus-visible:ring-primary/45",s.disabled&&"pointer-events-none opacity-45",r),onFocus:p,onMouseEnter:u};return s.href&&!s.disabled?e("a",{href:s.href,...g,onClick:()=>a(s),children:n}):e("button",{type:"button",disabled:s.disabled,...g,onClick:()=>a(s),children:n})}function W({apps:s,current:i,onSelect:a,variant:r="grid",trigger:n="icon",title:p="Apps",action:u,footer:g,align:C="end",side:O="bottom",open:k,onOpenChange:S,className:D}){const[H,$]=N.useState(!1),f=k??H,A=t=>{k===void 0&&$(t),S?.(t)},m=s.find(t=>t.id===i),[K,L]=N.useState(i),l=s.find(t=>t.id===K)??m??s[0],z=r==="grid"||r==="glass"||r==="dark",R=j(z?3:1),h=N.useRef(null),v=t=>{a?.(t),A(!1)},P=o("div",{className:c("flex items-center justify-between gap-2",r==="spotlight"?"border-b border-border px-4 py-3":"px-1 pb-2.5"),children:[e("p",{className:"text-[13px] font-semibold text-text",children:p}),u]}),q=e("div",{ref:h,role:"list",onKeyDown:R,className:"grid grid-cols-3 gap-1",children:s.map(t=>{const d=t.id===i;return e("div",{role:"listitem",children:o(y,{app:t,current:d,onChoose:v,className:c("group/app relative flex w-full cursor-pointer flex-col items-center gap-2 rounded-[12px] px-1 pb-2.5 pt-3 text-center transition-colors duration-150",r==="glass"?"hover:bg-white/40 focus-visible:bg-white/40 dark:hover:bg-white/10 dark:focus-visible:bg-white/10":"hover:bg-hover focus-visible:bg-hover",d&&(r==="dark"?"bg-white/[.06]":r==="glass"?"bg-white/30 dark:bg-white/[.06]":"bg-primary-subtle/60")),children:[o("span",{className:"relative transition-transform duration-200 ease-[cubic-bezier(.3,.7,.2,1)] group-hover/app:-translate-y-0.5 group-hover/app:scale-[1.04]",children:[e(x,{app:t,size:"md",glow:r==="dark"}),d?e("span",{className:"absolute -bottom-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-white ring-2 ring-[var(--raised)] [&_svg]:size-2.5",children:e(w,{strokeWidth:3.5})}):null]}),e("span",{className:"w-full truncate text-[12px] font-medium leading-4 text-text",children:t.name}),t.badge?e("span",{className:"-mt-1 scale-90",children:t.badge}):null]})},t.id)})}),E=e("div",{ref:h,role:"list",onKeyDown:R,className:c("flex flex-col gap-0.5",r==="spotlight"&&"p-1.5"),children:s.map(t=>{const d=t.id===i,V=r==="spotlight"&&t.id===l?.id;return e("div",{role:"listitem",children:o(y,{app:t,current:d,onChoose:v,onFocus:()=>L(t.id),onMouseEnter:()=>L(t.id),className:c("group/app flex w-full cursor-pointer items-center gap-3 rounded-[10px] px-2 py-2 text-left transition-colors duration-150",V?"bg-raised shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06),0_4px_12px_-4px_rgba(5,8,22,.14)] ring-1 ring-border":"hover:bg-hover focus-visible:bg-hover"),children:[e(x,{app:t,size:r==="spotlight"?"sm":"md"}),o("span",{className:"min-w-0 flex-1",children:[o("span",{className:"flex items-center gap-2",children:[e("span",{className:c("truncate text-[13px] font-medium",d?"text-primary":"text-text"),children:t.name}),t.badge]}),t.description&&r==="list"?e("span",{className:"mt-0.5 block truncate text-[11.5px] text-muted",children:t.description}):null]}),d?e(w,{className:"size-4 shrink-0 text-primary"}):e(M,{className:"size-4 shrink-0 text-muted opacity-0 transition-[opacity,transform] duration-150 group-hover/app:translate-x-0.5 group-hover/app:-translate-y-0.5 group-hover/app:opacity-100"})]})},t.id)})}),F=o(_,{children:[P,o("div",{className:"grid min-h-[260px] grid-cols-1 sm:grid-cols-[220px_1fr]",children:[e("div",{className:"border-border bg-surface sm:border-r",children:E}),l?o("div",{className:"hidden flex-col p-5 animate-[wave-in_220ms_var(--ease)] sm:flex",children:[e(x,{app:l,size:"lg",glow:!0}),o("div",{className:"mt-4 flex items-center gap-2",children:[e("p",{className:"disp text-[16px] font-semibold text-text",children:l.name}),l.badge]}),l.description?e("p",{className:"mt-1 text-[12.5px] leading-[18px] text-body",children:l.description}):null,e("div",{className:"mt-auto pt-5",children:l.id===i?o("p",{className:"flex items-center gap-1.5 text-[12px] font-medium text-primary",children:[e(w,{className:"size-3.5"})," You are here"]}):o(y,{app:l,current:!1,onChoose:v,className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-full bg-[linear-gradient(135deg,#1f45ea,#5b4af5)] px-3.5 text-[12.5px] font-medium text-white shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_6px_14px_-6px_rgba(20,55,211,.7)] transition-[filter] hover:brightness-110",children:["Open ",l.name," ",e(M,{className:"size-3.5"})]})})]},l.id):null]}),g?e("div",{className:"border-t border-border bg-surface px-4 py-2.5 text-[12px] text-muted",children:g}):null]});return o(b.Root,{open:f,onOpenChange:A,children:[e(b.Trigger,{"aria-label":m?`${m.name}. Switch app`:"Switch app",className:c("inline-flex shrink-0 cursor-pointer items-center justify-center outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-primary/45",U[n],D),children:n==="chip"&&m?o(_,{children:[e("span",{className:"[&_svg]:!size-3.5",children:e(x,{app:m,size:"sm"})}),e("span",{className:"max-w-[120px] truncate",children:m.name}),e("span",{className:"text-muted",children:e(T,{open:f})})]}):e(T,{open:f})}),e(b.Portal,{children:e(b.Content,{"data-pop":"",align:C,side:O,sideOffset:8,collisionPadding:12,onOpenAutoFocus:t=>{t.preventDefault();const d=h.current;(d?.querySelector("[data-launcher-app][aria-current]")??d?.querySelector("[data-launcher-app]"))?.focus()},className:c("z-50 overflow-hidden rounded-[18px] border p-2.5 shadow-elev3 outline-none",G[r]),children:r==="spotlight"?F:o(_,{children:[e("div",{className:"px-1 pt-1",children:P}),z?q:E,g?e("div",{className:"mt-2 border-t border-border px-1 pt-2.5 text-[12px] text-muted",children:g}):null]})})})]})}export{W as AppLauncher};
1
+ "use client";import{Fragment as _,jsx as e,jsxs as i}from"react/jsx-runtime";import*as b from"@radix-ui/react-popover";import{ArrowUpRight as M,Check as w}from"lucide-react";import*as N from"react";import{cn as c}from"../../lib/utils.js";const G={grid:"w-[328px] border-border bg-raised",list:"w-[340px] border-border bg-raised",spotlight:"w-[560px] max-w-[calc(100vw-24px)] border-border bg-raised p-0",glass:"w-[328px] border-white/50 bg-raised/65 backdrop-blur-2xl backdrop-saturate-150 shadow-[inset_0_1px_0_rgba(255,255,255,.6),var(--elev3)] dark:border-white/10 dark:shadow-[inset_0_1px_0_rgba(255,255,255,.08),var(--elev3)]",dark:"w-[328px] border-white/10 text-white bg-[var(--ink)] bg-[image:radial-gradient(120%_60%_at_0%_0%,color-mix(in_srgb,var(--brand-2)_32%,transparent),transparent_60%)] [--text:#f5f6fa] [--body:#c9cce0] [--muted:#8d93b3] [--border:rgba(255,255,255,.1)] [--hover:rgba(255,255,255,.07)] [--primary:#a5a8ff] [--primary-subtle:rgba(139,143,248,.16)] [--raised:rgba(255,255,255,.06)] [--surface:rgba(255,255,255,.04)]"},U={icon:"size-9 rounded-full text-muted hover:bg-hover hover:text-text data-[state=open]:bg-hover data-[state=open]:text-text",chip:"h-9 gap-2 rounded-full border border-border bg-raised pl-1.5 pr-3 text-[13px] font-medium text-text shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06)] hover:bg-hover data-[state=open]:bg-hover"};function T({open:a}){return e("svg",{viewBox:"0 0 18 18",className:"size-[18px] shrink-0","aria-hidden":!0,children:Array.from({length:9},(n,s)=>{const r=Math.floor(s/3),o=s%3,p=r===o||r+o===2,g=a&&p?(1-o)*1.6:0,u=a&&p?(1-r)*1.6:0;return e("circle",{cx:3+o*6,cy:3+r*6,r:1.7,fill:"currentColor",style:{transform:`translate(${g}px, ${u}px) scale(${a&&!p?0:1})`,transformOrigin:`${3+o*6}px ${3+r*6}px`,transition:`transform 260ms cubic-bezier(.3,.7,.2,1) ${a?s*12:(8-s)*12}ms`}},s)})})}function x({app:a,size:n,glow:s}){const r={sm:"size-8 rounded-[calc(9px*var(--radius-scale))] [&_svg]:size-4",md:"size-12 rounded-[calc(14px*var(--radius-scale))] [&_svg]:size-[22px]",lg:"size-14 rounded-[calc(16px*var(--radius-scale))] [&_svg]:size-6"}[n];return a.tint?e("span",{className:c("relative isolate grid shrink-0 place-items-center overflow-hidden text-white","before:absolute before:inset-x-0 before:top-0 before:-z-10 before:h-1/2 before:bg-[linear-gradient(180deg,rgba(255,255,255,.28),transparent)]",r),style:{background:a.tint,boxShadow:`inset 0 1px 0 rgba(255,255,255,.35), inset 0 -8px 16px -8px rgba(5,8,22,.3), 0 1px 2px rgba(5,8,22,.18)${s?", 0 10px 24px -10px color-mix(in srgb, var(--brand-2) 70%, transparent)":""}`},children:a.icon}):e("span",{className:c("grid shrink-0 place-items-center [&>img]:size-full [&>*]:max-h-full [&>*]:max-w-full",r),children:a.icon})}function j(a){return n=>{const s=Array.from(n.currentTarget.querySelectorAll("[data-launcher-app]:not([aria-disabled='true'])")),r=s.indexOf(document.activeElement);if(r<0)return;const o={ArrowRight:1,ArrowLeft:-1,ArrowDown:a,ArrowUp:-a}[n.key];let p;o!==void 0?p=s[Math.min(Math.max(r+o,0),s.length-1)]:n.key==="Home"?p=s[0]:n.key==="End"&&(p=s[s.length-1]),p&&(n.preventDefault(),p.focus())}}function y({app:a,current:n,onChoose:s,className:r,children:o,onFocus:p,onMouseEnter:g}){const u={"data-launcher-app":"","aria-current":n?"page":void 0,"aria-disabled":a.disabled||void 0,className:c("outline-none focus-visible:ring-2 focus-visible:ring-primary/45",a.disabled&&"pointer-events-none opacity-45",r),onFocus:p,onMouseEnter:g};return a.href&&!a.disabled?e("a",{href:a.href,...u,onClick:()=>s(a),children:o}):e("button",{type:"button",disabled:a.disabled,...u,onClick:()=>s(a),children:o})}function W({apps:a,current:n,onSelect:s,variant:r="grid",trigger:o="icon",title:p="Apps",action:g,footer:u,align:C="end",side:O="bottom",open:k,onOpenChange:S,className:D}){const[H,$]=N.useState(!1),h=k??H,A=t=>{k===void 0&&$(t),S?.(t)},m=a.find(t=>t.id===n),[K,L]=N.useState(n),l=a.find(t=>t.id===K)??m??a[0],z=r==="grid"||r==="glass"||r==="dark",R=j(z?3:1),f=N.useRef(null),v=t=>{s?.(t),A(!1)},P=i("div",{className:c("flex items-center justify-between gap-2",r==="spotlight"?"border-b border-border px-4 py-3":"px-1 pb-2.5"),children:[e("p",{className:"text-[13px] font-semibold text-text",children:p}),g]}),q=e("div",{ref:f,role:"list",onKeyDown:R,className:"grid grid-cols-3 gap-1",children:a.map(t=>{const d=t.id===n;return e("div",{role:"listitem",children:i(y,{app:t,current:d,onChoose:v,className:c("group/app relative flex w-full cursor-pointer flex-col items-center gap-2 rounded-[calc(12px*var(--radius-scale))] px-1 pb-2.5 pt-3 text-center transition-colors duration-150",r==="glass"?"hover:bg-white/40 focus-visible:bg-white/40 dark:hover:bg-white/10 dark:focus-visible:bg-white/10":"hover:bg-hover focus-visible:bg-hover",d&&(r==="dark"?"bg-white/[.06]":r==="glass"?"bg-white/30 dark:bg-white/[.06]":"bg-primary-subtle/60")),children:[i("span",{className:"relative transition-transform duration-200 ease-[cubic-bezier(.3,.7,.2,1)] group-hover/app:-translate-y-0.5 group-hover/app:scale-[1.04]",children:[e(x,{app:t,size:"md",glow:r==="dark"}),d?e("span",{className:"absolute -bottom-1 -right-1 grid size-4 place-items-center rounded-full bg-primary text-white ring-2 ring-[var(--raised)] [&_svg]:size-2.5",children:e(w,{strokeWidth:3.5})}):null]}),e("span",{className:"w-full truncate text-[12px] font-medium leading-4 text-text",children:t.name}),t.badge?e("span",{className:"-mt-1 scale-90",children:t.badge}):null]})},t.id)})}),E=e("div",{ref:f,role:"list",onKeyDown:R,className:c("flex flex-col gap-0.5",r==="spotlight"&&"p-1.5"),children:a.map(t=>{const d=t.id===n,V=r==="spotlight"&&t.id===l?.id;return e("div",{role:"listitem",children:i(y,{app:t,current:d,onChoose:v,onFocus:()=>L(t.id),onMouseEnter:()=>L(t.id),className:c("group/app flex w-full cursor-pointer items-center gap-3 rounded-[calc(10px*var(--radius-scale))] px-2 py-2 text-left transition-colors duration-150",V?"bg-raised shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.06),0_4px_12px_-4px_rgba(5,8,22,.14)] ring-1 ring-border":"hover:bg-hover focus-visible:bg-hover"),children:[e(x,{app:t,size:r==="spotlight"?"sm":"md"}),i("span",{className:"min-w-0 flex-1",children:[i("span",{className:"flex items-center gap-2",children:[e("span",{className:c("truncate text-[13px] font-medium",d?"text-primary":"text-text"),children:t.name}),t.badge]}),t.description&&r==="list"?e("span",{className:"mt-0.5 block truncate text-[11.5px] text-muted",children:t.description}):null]}),d?e(w,{className:"size-4 shrink-0 text-primary"}):e(M,{className:"size-4 shrink-0 text-muted opacity-0 transition-[opacity,transform] duration-150 group-hover/app:translate-x-0.5 group-hover/app:-translate-y-0.5 group-hover/app:opacity-100"})]})},t.id)})}),F=i(_,{children:[P,i("div",{className:"grid min-h-[260px] grid-cols-1 sm:grid-cols-[220px_1fr]",children:[e("div",{className:"border-border bg-surface sm:border-r",children:E}),l?i("div",{className:"hidden flex-col p-5 animate-[wave-in_220ms_var(--ease)] sm:flex",children:[e(x,{app:l,size:"lg",glow:!0}),i("div",{className:"mt-4 flex items-center gap-2",children:[e("p",{className:"disp text-[16px] font-semibold text-text",children:l.name}),l.badge]}),l.description?e("p",{className:"mt-1 text-[12.5px] leading-[18px] text-body",children:l.description}):null,e("div",{className:"mt-auto pt-5",children:l.id===n?i("p",{className:"flex items-center gap-1.5 text-[12px] font-medium text-primary",children:[e(w,{className:"size-3.5"})," You are here"]}):i(y,{app:l,current:!1,onChoose:v,className:"inline-flex h-8 cursor-pointer items-center gap-1.5 rounded-full bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] px-3.5 text-[12.5px] font-medium text-white shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_6px_14px_-6px_color-mix(in_srgb,var(--brand-1)_70%,transparent)] transition-[filter] hover:brightness-110",children:["Open ",l.name," ",e(M,{className:"size-3.5"})]})})]},l.id):null]}),u?e("div",{className:"border-t border-border bg-surface px-4 py-2.5 text-[12px] text-muted",children:u}):null]});return i(b.Root,{open:h,onOpenChange:A,children:[e(b.Trigger,{"aria-label":m?`${m.name}. Switch app`:"Switch app",className:c("inline-flex shrink-0 cursor-pointer items-center justify-center outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-primary/45",U[o],D),children:o==="chip"&&m?i(_,{children:[e("span",{className:"[&_svg]:!size-3.5",children:e(x,{app:m,size:"sm"})}),e("span",{className:"max-w-[120px] truncate",children:m.name}),e("span",{className:"text-muted",children:e(T,{open:h})})]}):e(T,{open:h})}),e(b.Portal,{children:e(b.Content,{"data-pop":"",align:C,side:O,sideOffset:8,collisionPadding:12,onOpenAutoFocus:t=>{t.preventDefault();const d=f.current;(d?.querySelector("[data-launcher-app][aria-current]")??d?.querySelector("[data-launcher-app]"))?.focus()},className:c("z-50 overflow-hidden rounded-[calc(18px*var(--radius-scale))] border p-2.5 shadow-elev3 outline-none",G[r]),children:r==="spotlight"?F:i(_,{children:[e("div",{className:"px-1 pt-1",children:P}),z?q:E,u?e("div",{className:"mt-2 border-t border-border px-1 pt-2.5 text-[12px] text-muted",children:u}):null]})})})]})}export{W as AppLauncher};
@@ -1 +1 @@
1
- "use client";import{Fragment as P,jsx as e,jsxs as a}from"react/jsx-runtime";import{Check as z,Loader2 as I,Pencil as R,PenLine as E,Trash2 as H}from"lucide-react";import*as i from"react";import{cn as D}from"../../lib/utils.js";import{Button as w}from"../ui/button.js";import{Dialog as K,DialogBody as O,DialogContent as V,DialogDescription as $,DialogFooter as q,DialogHeader as A,DialogTitle as F}from"../ui/dialog.js";import{Input as W}from"../ui/input.js";import{Label as k}from"../ui/label.js";import{ConfirmDialog as G}from"../ui/confirm-dialog.js";import{Select as N,SelectContent as T,SelectItem as B,SelectTrigger as L,SelectValue as M}from"../ui/select.js";function ee({value:l,display:m,edit:r,onSave:x,align:c}){const[g,y]=i.useState(!1),[o,f]=i.useState(""),[p,u]=i.useState(null),[C,v]=i.useState("idle"),s=i.useRef(null),d=()=>{f(l==null?"":String(l)),u(null),y(!0)};i.useEffect(()=>{g&&(s.current?.focus(),s.current&&"select"in s.current&&r.type!=="select"&&s.current.select())},[g,r.type]);const b=async()=>{if(o===String(l??""))return y(!1);const n=o.trim()===""&&!r.allowEmpty?r.requiredMessage??"Can't be empty":r.validate?.(o)??null;if(n)return u(n);try{v("saving"),await x(o),y(!1),v("saved"),window.setTimeout(()=>v("idle"),900)}catch(S){v("idle"),u(S instanceof Error?S.message:String(S))}};if(!g)return a("button",{type:"button",onClick:n=>{n.stopPropagation(),d()},className:D("group/edit -mx-1.5 flex w-[calc(100%+12px)] min-w-0 cursor-text items-center gap-1.5 rounded-[6px] px-1.5 py-0.5 text-left outline-none transition-colors","hover:bg-primary-subtle/60 focus-visible:ring-2 focus-visible:ring-primary/40",c==="right"&&"flex-row-reverse text-right",C==="saved"&&"wm-saved"),children:[e("span",{className:"min-w-0 flex-1 truncate",children:m}),C==="saved"?e(z,{className:"size-3.5 shrink-0 text-success"}):e(R,{className:"size-3 shrink-0 text-muted opacity-0 transition-opacity group-hover/edit:opacity-70"})]});const t="h-8 w-full rounded-[7px] border border-primary bg-raised px-2 text-[13px] text-text outline-none ring-2 ring-primary/20 "+(p?"!border-danger !ring-danger/20 ":"")+(c==="right"?"text-right ":""),h=n=>{n.stopPropagation(),n.key==="Enter"?(n.preventDefault(),b()):n.key==="Escape"&&(n.preventDefault(),y(!1))};return a("div",{className:"relative -my-1",onClick:n=>n.stopPropagation(),children:[r.type==="select"?e("select",{ref:s,value:o,onChange:n=>f(n.target.value),onKeyDown:h,onBlur:()=>{b()},className:D(t,"cursor-pointer"),children:(r.options??[]).map(n=>e("option",{value:n.value,children:n.label},n.value))}):e("input",{ref:s,type:r.type==="number"?"number":r.type==="date"?"date":"text",value:o,onChange:n=>{f(n.target.value),u(null)},onKeyDown:h,onBlur:()=>{b()},"aria-invalid":!!p,className:D(t,r.type==="number"&&"num")}),C==="saving"?e(I,{className:"absolute right-2 top-1/2 size-3.5 -translate-y-1/2 animate-spin text-primary"}):null,p?e("p",{role:"alert",className:"absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded-[6px] bg-danger px-2 py-1 text-[11.5px] font-medium text-white shadow-elev2",children:p}):null]})}function te({count:l,columns:m,onApply:r}){const[x,c]=i.useState(!1),[g,y]=i.useState(m[0]?.id??""),[o,f]=i.useState(""),[p,u]=i.useState(null),[C,v]=i.useState(!1),s=m.find(t=>t.id===g)??m[0];if(!s)return null;const d=s.edit,b=async()=>{const t=o.trim()===""&&!d.allowEmpty?d.requiredMessage??"Can't be empty":d.validate?.(o)??null;if(t)return u(t);v(!0);try{await r(s.id,o),c(!1),f("")}catch(h){u(h instanceof Error?h.message:String(h))}finally{v(!1)}};return a(P,{children:[a(w,{variant:"ghost",size:"sm",onClick:()=>c(!0),children:[e(E,{}),"Edit"]}),e(K,{open:x,onOpenChange:c,children:a(V,{variant:"center",size:"sm",children:[a(A,{icon:e(E,{}),eyebrow:`${l} selected`,children:[a(F,{children:["Edit ",l," rows"]}),e($,{children:"The value replaces what each selected row has in that column."})]}),a(O,{className:"space-y-4",children:[a("div",{className:"space-y-1.5",children:[e(k,{children:"Column"}),a(N,{value:s.id,onValueChange:t=>{y(t),f(""),u(null)},children:[e(L,{children:e(M,{})}),e(T,{children:m.map(t=>e(B,{value:t.id,children:t.label},t.id))})]})]}),a("div",{className:"space-y-1.5",children:[e(k,{children:"New value"}),d.type==="select"?a(N,{value:o||void 0,onValueChange:t=>{f(t),u(null)},children:[e(L,{"aria-invalid":!!p,children:e(M,{placeholder:"Choose\u2026"})}),e(T,{children:(d.options??[]).map(t=>e(B,{value:t.value,children:t.label},t.value))})]}):e(W,{type:d.type==="number"?"number":d.type==="date"?"date":"text",value:o,state:p?"error":"default",onChange:t=>{f(t.target.value),u(null)},onKeyDown:t=>t.key==="Enter"&&void b()}),p?e("p",{role:"alert",className:"text-[12px] text-danger",children:p}):null]})]}),a(q,{children:[e(w,{onClick:()=>c(!1),children:"Cancel"}),a(w,{variant:"primary",loading:C,onClick:()=>{b()},children:["Apply to ",l," rows"]})]})]})})]})}function ne({count:l,names:m,typeAbove:r=5,onConfirm:x}){const[c,g]=i.useState(!1);return a(P,{children:[a(w,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-subtle hover:text-danger",onClick:()=>g(!0),children:[e(H,{}),"Delete"]}),e(G,{open:c,onOpenChange:g,title:`Delete ${l} ${l===1?"row":"rows"}?`,description:"They will be removed for everyone. This cannot be undone.",items:m,confirmWord:l>=r?"DELETE":void 0,confirmLabel:`Delete ${l}`,onConfirm:x})]})}export{ne as BulkDelete,te as BulkEdit,ee as EditableCell};
1
+ "use client";import{Fragment as P,jsx as e,jsxs as n}from"react/jsx-runtime";import{Check as z,Loader2 as I,Pencil as R,PenLine as E,Trash2 as H}from"lucide-react";import*as i from"react";import{cn as D}from"../../lib/utils.js";import{Button as w}from"../ui/button.js";import{Dialog as K,DialogBody as O,DialogContent as V,DialogDescription as $,DialogFooter as q,DialogHeader as A,DialogTitle as F}from"../ui/dialog.js";import{Input as W}from"../ui/input.js";import{Label as k}from"../ui/label.js";import{ConfirmDialog as G}from"../ui/confirm-dialog.js";import{Select as N,SelectContent as T,SelectItem as B,SelectTrigger as L,SelectValue as M}from"../ui/select.js";function ee({value:l,display:m,edit:r,onSave:x,align:c}){const[g,y]=i.useState(!1),[o,v]=i.useState(""),[p,u]=i.useState(null),[C,f]=i.useState("idle"),s=i.useRef(null),d=()=>{v(l==null?"":String(l)),u(null),y(!0)};i.useEffect(()=>{g&&(s.current?.focus(),s.current&&"select"in s.current&&r.type!=="select"&&s.current.select())},[g,r.type]);const b=async()=>{if(o===String(l??""))return y(!1);const a=o.trim()===""&&!r.allowEmpty?r.requiredMessage??"Can't be empty":r.validate?.(o)??null;if(a)return u(a);try{f("saving"),await x(o),y(!1),f("saved"),window.setTimeout(()=>f("idle"),900)}catch(S){f("idle"),u(S instanceof Error?S.message:String(S))}};if(!g)return n("button",{type:"button",onClick:a=>{a.stopPropagation(),d()},className:D("group/edit -mx-1.5 flex w-[calc(100%+12px)] min-w-0 cursor-text items-center gap-1.5 rounded-[calc(6px*var(--radius-scale))] px-1.5 py-0.5 text-left outline-none transition-colors","hover:bg-primary-subtle/60 focus-visible:ring-2 focus-visible:ring-primary/40",c==="right"&&"flex-row-reverse text-right",C==="saved"&&"wm-saved"),children:[e("span",{className:"min-w-0 flex-1 truncate",children:m}),C==="saved"?e(z,{className:"size-3.5 shrink-0 text-success"}):e(R,{className:"size-3 shrink-0 text-muted opacity-0 transition-opacity group-hover/edit:opacity-70"})]});const t="h-8 w-full rounded-[calc(7px*var(--radius-scale))] border border-primary bg-raised px-2 text-[13px] text-text outline-none ring-2 ring-primary/20 "+(p?"!border-danger !ring-danger/20 ":"")+(c==="right"?"text-right ":""),h=a=>{a.stopPropagation(),a.key==="Enter"?(a.preventDefault(),b()):a.key==="Escape"&&(a.preventDefault(),y(!1))};return n("div",{className:"relative -my-1",onClick:a=>a.stopPropagation(),children:[r.type==="select"?e("select",{ref:s,value:o,onChange:a=>v(a.target.value),onKeyDown:h,onBlur:()=>{b()},className:D(t,"cursor-pointer"),children:(r.options??[]).map(a=>e("option",{value:a.value,children:a.label},a.value))}):e("input",{ref:s,type:r.type==="number"?"number":r.type==="date"?"date":"text",value:o,onChange:a=>{v(a.target.value),u(null)},onKeyDown:h,onBlur:()=>{b()},"aria-invalid":!!p,className:D(t,r.type==="number"&&"num")}),C==="saving"?e(I,{className:"absolute right-2 top-1/2 size-3.5 -translate-y-1/2 animate-spin text-primary"}):null,p?e("p",{role:"alert",className:"absolute left-0 top-full z-20 mt-1 whitespace-nowrap rounded-[calc(6px*var(--radius-scale))] bg-danger px-2 py-1 text-[11.5px] font-medium text-white shadow-elev2",children:p}):null]})}function te({count:l,columns:m,onApply:r}){const[x,c]=i.useState(!1),[g,y]=i.useState(m[0]?.id??""),[o,v]=i.useState(""),[p,u]=i.useState(null),[C,f]=i.useState(!1),s=m.find(t=>t.id===g)??m[0];if(!s)return null;const d=s.edit,b=async()=>{const t=o.trim()===""&&!d.allowEmpty?d.requiredMessage??"Can't be empty":d.validate?.(o)??null;if(t)return u(t);f(!0);try{await r(s.id,o),c(!1),v("")}catch(h){u(h instanceof Error?h.message:String(h))}finally{f(!1)}};return n(P,{children:[n(w,{variant:"ghost",size:"sm",onClick:()=>c(!0),children:[e(E,{}),"Edit"]}),e(K,{open:x,onOpenChange:c,children:n(V,{variant:"center",size:"sm",children:[n(A,{icon:e(E,{}),eyebrow:`${l} selected`,children:[n(F,{children:["Edit ",l," rows"]}),e($,{children:"The value replaces what each selected row has in that column."})]}),n(O,{className:"space-y-4",children:[n("div",{className:"space-y-1.5",children:[e(k,{children:"Column"}),n(N,{value:s.id,onValueChange:t=>{y(t),v(""),u(null)},children:[e(L,{children:e(M,{})}),e(T,{children:m.map(t=>e(B,{value:t.id,children:t.label},t.id))})]})]}),n("div",{className:"space-y-1.5",children:[e(k,{children:"New value"}),d.type==="select"?n(N,{value:o||void 0,onValueChange:t=>{v(t),u(null)},children:[e(L,{"aria-invalid":!!p,children:e(M,{placeholder:"Choose\u2026"})}),e(T,{children:(d.options??[]).map(t=>e(B,{value:t.value,children:t.label},t.value))})]}):e(W,{type:d.type==="number"?"number":d.type==="date"?"date":"text",value:o,state:p?"error":"default",onChange:t=>{v(t.target.value),u(null)},onKeyDown:t=>t.key==="Enter"&&void b()}),p?e("p",{role:"alert",className:"text-[12px] text-danger",children:p}):null]})]}),n(q,{children:[e(w,{onClick:()=>c(!1),children:"Cancel"}),n(w,{variant:"primary",loading:C,onClick:()=>{b()},children:["Apply to ",l," rows"]})]})]})})]})}function ae({count:l,names:m,typeAbove:r=5,onConfirm:x}){const[c,g]=i.useState(!1);return n(P,{children:[n(w,{variant:"ghost",size:"sm",className:"text-danger hover:bg-danger-subtle hover:text-danger",onClick:()=>g(!0),children:[e(H,{}),"Delete"]}),e(G,{open:c,onOpenChange:g,title:`Delete ${l} ${l===1?"row":"rows"}?`,description:"They will be removed for everyone. This cannot be undone.",items:m,confirmWord:l>=r?"DELETE":void 0,confirmLabel:`Delete ${l}`,onConfirm:x})]})}export{ae as BulkDelete,te as BulkEdit,ee as EditableCell};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as f}from"react/jsx-runtime";import{ListFilter as T,Plus as L,Trash2 as P,X as q}from"lucide-react";import*as B from"react";import{cn as D}from"../../lib/utils.js";import{Button as g}from"../ui/button.js";import{parseIsoDay as I,toIsoDay as h}from"../ui/calendar.js";import{Checkbox as O}from"../ui/checkbox.js";import{DatePicker as z,DateRangePicker as E}from"../ui/date-picker.js";import{Input as v}from"../ui/input.js";import{Popover as V,PopoverContent as j,PopoverTrigger as M}from"../ui/popover.js";import{Segmented as $}from"../ui/segmented.js";import{Select as F,SelectContent as N,SelectItem as A,SelectTrigger as _,SelectValue as w}from"../ui/select.js";const ie={match:"and",rules:[]},S={text:["contains","not_contains","is","is_not","starts_with","empty","not_empty"],select:["any_of","none_of","empty","not_empty"],number:["eq","neq","gt","gte","lt","lte","between","empty","not_empty"],date:["on","before","after","between","empty","not_empty"]},b={filter:"Filter",filters:"Filters",addFilter:"Add filter",clearAll:"Clear all",matchAll:"All rules",matchAny:"Any rule",where:"Where",and:"and",or:"or",value:"Value",none:"No filters yet. Add one to narrow the rows.",ops:{contains:"contains",not_contains:"does not contain",is:"is",is_not:"is not",starts_with:"starts with",any_of:"is any of",none_of:"is none of",eq:"=",neq:"\u2260",gt:">",gte:"\u2265",lt:"<",lte:"\u2264",between:"is between",on:"is on",before:"is before",after:"is after",empty:"is empty",not_empty:"is not empty"}},x=e=>e==="empty"||e==="not_empty";function ae(e,n){const p=[];for(const c of e){const r=c.meta?.filter;if(!r)continue;const i="accessorKey"in c?String(c.accessorKey):void 0,t="accessorFn"in c?c.accessorFn:void 0,a=c.id??i;if(!a||!i&&!t)continue;const l=(y,u)=>t?t(y,u):y[i];let d=r.options??[];r.type==="select"&&!r.options&&(d=[...new Set(n.map((u,m)=>l(u,m)).filter(u=>u!=null&&u!=="").map(String))].sort().map(u=>({value:u,label:u})));const s=r.label??(typeof c.header=="string"?c.header:a);p.push({id:a,label:s,type:r.type,options:d,get:l})}return p}function K(e){return e instanceof Date?h(e):typeof e=="number"?h(new Date(e)):typeof e=="string"&&I(e)?e.slice(0,10):null}function W(e,n,p){const c=p==null||p==="";if(e.op==="empty")return c;if(e.op==="not_empty")return!c;const r=e.value,i=Array.isArray(r)?r[0]??"":r;if(n.type==="text"){if(i==="")return!0;const t=String(p??"").toLowerCase(),a=i.toLowerCase();if(e.op==="contains")return t.includes(a);if(e.op==="not_contains")return!t.includes(a);if(e.op==="is")return t===a;if(e.op==="is_not")return t!==a;if(e.op==="starts_with")return t.startsWith(a)}if(n.type==="select"){const t=Array.isArray(r)?r:[r];if(!t.length)return!0;const a=t.includes(String(p??""));return e.op==="none_of"?!a:a}if(n.type==="number"){const t=typeof p=="number"?p:Number(p);if(e.op==="between"){const[l,d]=(Array.isArray(r)?r:[r,""]).map(s=>s===""?null:Number(s));return(l===null||t>=l)&&(d===null||t<=d)}if(i==="")return!0;const a=Number(i);return Number.isNaN(t)?!1:{eq:t===a,neq:t!==a,gt:t>a,gte:t>=a,lt:t<a,lte:t<=a}[e.op]??!0}if(n.type==="date"){const t=K(p);if(e.op==="between"){const[a,l]=Array.isArray(r)?r:[r,""];return!a&&!l?!0:!!t&&(!a||t>=a)&&(!l||t<=l)}return i===""?!0:t?e.op==="on"?t===i:e.op==="before"?t<i:t>i:!1}return!0}function se(e,n,p){const c=p.rules.filter(r=>n.some(i=>i.id===r.column));return c.length?e.filter((r,i)=>{const t=c.map(a=>{const l=n.find(d=>d.id===a.column);return W(a,l,l.get(r,i))});return p.match==="and"?t.every(Boolean):t.some(Boolean)}):e}const C=e=>x(e.op)||(Array.isArray(e.value)?e.value.some(n=>n!==""):e.value!=="");let X=0;const Y=()=>`f${Date.now().toString(36)}${(X++).toString(36)}`;function k(e){const n=S[e.type][0];return{id:Y(),column:e.id,op:n,value:e.type==="select"?[]:n==="between"?["",""]:""}}function G({rule:e,field:n,onChange:p,L:c}){if(x(e.op))return o("div",{className:"h-ctl"});if(n.type==="select"){const r=Array.isArray(e.value)?e.value:[];return o("div",{className:"max-h-40 space-y-0.5 overflow-y-auto rounded-ctl border border-border2 bg-raised p-1.5",children:n.options.map(i=>f("label",{className:"flex cursor-pointer items-center gap-2 rounded-[6px] px-1.5 py-1 text-[13px] text-text hover:bg-hover",children:[o(O,{checked:r.includes(i.value),onCheckedChange:t=>p(t?[...r,i.value]:r.filter(a=>a!==i.value))}),o("span",{className:"truncate",children:i.label})]},i.value))})}if(n.type==="date"){if(e.op==="between"){const[r="",i=""]=Array.isArray(e.value)?e.value:[];return o(E,{value:{from:r,to:i},onChange:t=>p([t.from,t.to]),numberOfMonths:1,presets:[]})}return o(z,{value:typeof e.value=="string"?e.value:"",onChange:p})}if(e.op==="between"){const[r="",i=""]=Array.isArray(e.value)?e.value:[];return f("div",{className:"flex items-center gap-1.5",children:[o(v,{type:"number",value:r,onChange:t=>p([t.target.value,i]),placeholder:"min",className:"num"}),o("span",{className:"text-muted",children:"\u2013"}),o(v,{type:"number",value:i,onChange:t=>p([r,t.target.value]),placeholder:"max",className:"num"})]})}return o(v,{type:n.type==="number"?"number":"text",value:typeof e.value=="string"?e.value:"",onChange:r=>p(r.target.value),placeholder:c.value,className:D(n.type==="number"&&"num")})}function le({fields:e,value:n,onChange:p,labels:c,open:r,onOpenChange:i}){const t={...b,...c,ops:{...b.ops,...c?.ops}},a=n.rules.filter(C).length,l=s=>p({...n,rules:s}),d=(s,y)=>l(n.rules.map(u=>u.id===s?{...u,...y}:u));return f(V,{open:r,onOpenChange:i,children:[o(M,{asChild:!0,children:f(g,{variant:a?"subtle":"secondary",size:"sm",children:[o(T,{}),t.filter,a?o("span",{className:"num grid h-[18px] min-w-[18px] place-items-center rounded-full bg-primary px-1 text-[10.5px] font-semibold text-white",children:a}):null]})}),f(j,{align:"start",className:"w-[min(640px,calc(100vw-24px))] p-0",children:[f("div",{className:"flex items-center justify-between gap-3 border-b border-border px-4 py-3",children:[o("p",{className:"disp text-[14px] font-semibold text-text",children:t.filters}),n.rules.length>1?o($,{ariaLabel:"Match",value:n.match,onChange:s=>p({...n,match:s}),options:[{value:"and",label:t.matchAll},{value:"or",label:t.matchAny}]}):null]}),f("div",{className:"max-h-[52vh] space-y-2.5 overflow-y-auto px-4 py-3",children:[n.rules.length===0?o("p",{className:"py-4 text-center text-[13px] text-muted",children:t.none}):null,n.rules.map((s,y)=>{const u=e.find(m=>m.id===s.column)??e[0];return f("div",{className:"grid grid-cols-[44px_1fr_auto] items-start gap-2 sm:grid-cols-[44px_150px_150px_1fr_auto]",children:[o("span",{className:"pt-2 text-right text-[12px] font-medium text-muted",children:y===0?t.where:n.match==="and"?t.and:t.or}),f(F,{value:u.id,onValueChange:m=>d(s.id,{...k(e.find(R=>R.id===m)),id:s.id}),children:[o(_,{className:"max-sm:col-span-1",children:o(w,{})}),o(N,{children:e.map(m=>o(A,{value:m.id,children:m.label},m.id))})]}),o("button",{type:"button","aria-label":"Remove rule",onClick:()=>l(n.rules.filter(m=>m.id!==s.id)),className:"grid size-ctl cursor-pointer place-items-center rounded-ctl text-muted transition-colors hover:bg-danger-subtle hover:text-danger sm:order-last",children:o(P,{className:"size-4"})}),o("div",{className:"col-start-2 sm:col-start-auto",children:f(F,{value:s.op,onValueChange:m=>d(s.id,{op:m,value:u.type==="select"?Array.isArray(s.value)?s.value:[]:m==="between"?["",""]:Array.isArray(s.value)?"":s.value}),children:[o(_,{children:o(w,{})}),o(N,{children:S[u.type].map(m=>o(A,{value:m,children:t.ops[m]},m))})]})}),o("div",{className:"col-span-2 col-start-2 min-w-0 sm:col-span-1 sm:col-start-auto",children:o(G,{rule:s,field:u,onChange:m=>d(s.id,{value:m}),L:t})})]},s.id)})]}),f("div",{className:"flex items-center justify-between border-t border-border bg-surface px-4 py-2.5",children:[f(g,{size:"sm",variant:"ghost",disabled:!e.length,onClick:()=>l([...n.rules,k(e[0])]),children:[o(L,{})," ",t.addFilter]}),n.rules.length?o(g,{size:"sm",variant:"ghost",onClick:()=>p({...n,rules:[]}),children:t.clearAll}):null]})]})]})}function pe({fields:e,value:n,onChange:p,onEdit:c,labels:r}){const i={...b,...r,ops:{...b.ops,...r?.ops}},t=n.rules.filter(C);if(!t.length)return null;const a=(l,d)=>{if(x(l.op))return"";if(d.type==="select"){const s=(Array.isArray(l.value)?l.value:[l.value]).map(y=>d.options.find(u=>u.value===y)?.label??y);return s.length>2?`${s.slice(0,2).join(", ")} +${s.length-2}`:s.join(", ")}return Array.isArray(l.value)?l.value.filter(Boolean).join(" \u2013 "):l.value};return f("div",{className:"mb-2.5 flex flex-wrap items-center gap-1.5",children:[t.map((l,d)=>{const s=e.find(y=>y.id===l.column);return s?f(B.Fragment,{children:[d>0?o("span",{className:"text-[11px] font-medium uppercase text-muted",children:n.match==="and"?i.and:i.or}):null,f("span",{className:"inline-flex h-7 items-center gap-1 rounded-full border border-primary/20 bg-primary-subtle pl-2.5 pr-1 text-[12px] text-primary",children:[f("button",{type:"button",onClick:c,className:"cursor-pointer",children:[o("span",{className:"font-semibold",children:s.label})," ",o("span",{className:"opacity-80",children:i.ops[l.op]})," ",o("span",{className:"num font-medium",children:a(l,s)})]}),o("button",{type:"button","aria-label":"Remove filter",onClick:()=>p({...n,rules:n.rules.filter(y=>y.id!==l.id)}),className:"grid size-5 cursor-pointer place-items-center rounded-full transition-colors hover:bg-primary/15",children:o(q,{className:"size-3"})})]})]},l.id):null}),o("button",{type:"button",onClick:()=>p({...n,rules:[]}),className:"ml-1 cursor-pointer text-[12px] text-muted underline-offset-2 hover:text-text hover:underline",children:i.clearAll})]})}export{ie as EMPTY_FILTERS,b as FILTER_LABELS,le as FilterBuilder,pe as FilterChips,se as applyFilters,ae as filterFields};
1
+ "use client";import{jsx as o,jsxs as f}from"react/jsx-runtime";import{ListFilter as T,Plus as L,Trash2 as P,X as q}from"lucide-react";import*as B from"react";import{cn as D}from"../../lib/utils.js";import{Button as g}from"../ui/button.js";import{parseIsoDay as I,toIsoDay as h}from"../ui/calendar.js";import{Checkbox as O}from"../ui/checkbox.js";import{DatePicker as z,DateRangePicker as E}from"../ui/date-picker.js";import{Input as v}from"../ui/input.js";import{Popover as V,PopoverContent as j,PopoverTrigger as M}from"../ui/popover.js";import{Segmented as $}from"../ui/segmented.js";import{Select as F,SelectContent as N,SelectItem as A,SelectTrigger as _,SelectValue as w}from"../ui/select.js";const ae={match:"and",rules:[]},S={text:["contains","not_contains","is","is_not","starts_with","empty","not_empty"],select:["any_of","none_of","empty","not_empty"],number:["eq","neq","gt","gte","lt","lte","between","empty","not_empty"],date:["on","before","after","between","empty","not_empty"]},b={filter:"Filter",filters:"Filters",addFilter:"Add filter",clearAll:"Clear all",matchAll:"All rules",matchAny:"Any rule",where:"Where",and:"and",or:"or",value:"Value",none:"No filters yet. Add one to narrow the rows.",ops:{contains:"contains",not_contains:"does not contain",is:"is",is_not:"is not",starts_with:"starts with",any_of:"is any of",none_of:"is none of",eq:"=",neq:"\u2260",gt:">",gte:"\u2265",lt:"<",lte:"\u2264",between:"is between",on:"is on",before:"is before",after:"is after",empty:"is empty",not_empty:"is not empty"}},x=e=>e==="empty"||e==="not_empty";function ie(e,n){const p=[];for(const c of e){const r=c.meta?.filter;if(!r)continue;const a="accessorKey"in c?String(c.accessorKey):void 0,t="accessorFn"in c?c.accessorFn:void 0,i=c.id??a;if(!i||!a&&!t)continue;const l=(y,u)=>t?t(y,u):y[a];let d=r.options??[];r.type==="select"&&!r.options&&(d=[...new Set(n.map((u,m)=>l(u,m)).filter(u=>u!=null&&u!=="").map(String))].sort().map(u=>({value:u,label:u})));const s=r.label??(typeof c.header=="string"?c.header:i);p.push({id:i,label:s,type:r.type,options:d,get:l})}return p}function K(e){return e instanceof Date?h(e):typeof e=="number"?h(new Date(e)):typeof e=="string"&&I(e)?e.slice(0,10):null}function W(e,n,p){const c=p==null||p==="";if(e.op==="empty")return c;if(e.op==="not_empty")return!c;const r=e.value,a=Array.isArray(r)?r[0]??"":r;if(n.type==="text"){if(a==="")return!0;const t=String(p??"").toLowerCase(),i=a.toLowerCase();if(e.op==="contains")return t.includes(i);if(e.op==="not_contains")return!t.includes(i);if(e.op==="is")return t===i;if(e.op==="is_not")return t!==i;if(e.op==="starts_with")return t.startsWith(i)}if(n.type==="select"){const t=Array.isArray(r)?r:[r];if(!t.length)return!0;const i=t.includes(String(p??""));return e.op==="none_of"?!i:i}if(n.type==="number"){const t=typeof p=="number"?p:Number(p);if(e.op==="between"){const[l,d]=(Array.isArray(r)?r:[r,""]).map(s=>s===""?null:Number(s));return(l===null||t>=l)&&(d===null||t<=d)}if(a==="")return!0;const i=Number(a);return Number.isNaN(t)?!1:{eq:t===i,neq:t!==i,gt:t>i,gte:t>=i,lt:t<i,lte:t<=i}[e.op]??!0}if(n.type==="date"){const t=K(p);if(e.op==="between"){const[i,l]=Array.isArray(r)?r:[r,""];return!i&&!l?!0:!!t&&(!i||t>=i)&&(!l||t<=l)}return a===""?!0:t?e.op==="on"?t===a:e.op==="before"?t<a:t>a:!1}return!0}function se(e,n,p){const c=p.rules.filter(r=>n.some(a=>a.id===r.column));return c.length?e.filter((r,a)=>{const t=c.map(i=>{const l=n.find(d=>d.id===i.column);return W(i,l,l.get(r,a))});return p.match==="and"?t.every(Boolean):t.some(Boolean)}):e}const C=e=>x(e.op)||(Array.isArray(e.value)?e.value.some(n=>n!==""):e.value!=="");let X=0;const Y=()=>`f${Date.now().toString(36)}${(X++).toString(36)}`;function k(e){const n=S[e.type][0];return{id:Y(),column:e.id,op:n,value:e.type==="select"?[]:n==="between"?["",""]:""}}function G({rule:e,field:n,onChange:p,L:c}){if(x(e.op))return o("div",{className:"h-ctl"});if(n.type==="select"){const r=Array.isArray(e.value)?e.value:[];return o("div",{className:"max-h-40 space-y-0.5 overflow-y-auto rounded-ctl border border-border2 bg-raised p-1.5",children:n.options.map(a=>f("label",{className:"flex cursor-pointer items-center gap-2 rounded-[calc(6px*var(--radius-scale))] px-1.5 py-1 text-[13px] text-text hover:bg-hover",children:[o(O,{checked:r.includes(a.value),onCheckedChange:t=>p(t?[...r,a.value]:r.filter(i=>i!==a.value))}),o("span",{className:"truncate",children:a.label})]},a.value))})}if(n.type==="date"){if(e.op==="between"){const[r="",a=""]=Array.isArray(e.value)?e.value:[];return o(E,{value:{from:r,to:a},onChange:t=>p([t.from,t.to]),numberOfMonths:1,presets:[]})}return o(z,{value:typeof e.value=="string"?e.value:"",onChange:p})}if(e.op==="between"){const[r="",a=""]=Array.isArray(e.value)?e.value:[];return f("div",{className:"flex items-center gap-1.5",children:[o(v,{type:"number",value:r,onChange:t=>p([t.target.value,a]),placeholder:"min",className:"num"}),o("span",{className:"text-muted",children:"\u2013"}),o(v,{type:"number",value:a,onChange:t=>p([r,t.target.value]),placeholder:"max",className:"num"})]})}return o(v,{type:n.type==="number"?"number":"text",value:typeof e.value=="string"?e.value:"",onChange:r=>p(r.target.value),placeholder:c.value,className:D(n.type==="number"&&"num")})}function le({fields:e,value:n,onChange:p,labels:c,open:r,onOpenChange:a}){const t={...b,...c,ops:{...b.ops,...c?.ops}},i=n.rules.filter(C).length,l=s=>p({...n,rules:s}),d=(s,y)=>l(n.rules.map(u=>u.id===s?{...u,...y}:u));return f(V,{open:r,onOpenChange:a,children:[o(M,{asChild:!0,children:f(g,{variant:i?"subtle":"secondary",size:"sm",children:[o(T,{}),t.filter,i?o("span",{className:"num grid h-[18px] min-w-[18px] place-items-center rounded-full bg-primary px-1 text-[10.5px] font-semibold text-white",children:i}):null]})}),f(j,{align:"start",className:"w-[min(640px,calc(100vw-24px))] p-0",children:[f("div",{className:"flex items-center justify-between gap-3 border-b border-border px-4 py-3",children:[o("p",{className:"disp text-[14px] font-semibold text-text",children:t.filters}),n.rules.length>1?o($,{ariaLabel:"Match",value:n.match,onChange:s=>p({...n,match:s}),options:[{value:"and",label:t.matchAll},{value:"or",label:t.matchAny}]}):null]}),f("div",{className:"max-h-[52vh] space-y-2.5 overflow-y-auto px-4 py-3",children:[n.rules.length===0?o("p",{className:"py-4 text-center text-[13px] text-muted",children:t.none}):null,n.rules.map((s,y)=>{const u=e.find(m=>m.id===s.column)??e[0];return f("div",{className:"grid grid-cols-[44px_1fr_auto] items-start gap-2 sm:grid-cols-[44px_150px_150px_1fr_auto]",children:[o("span",{className:"pt-2 text-right text-[12px] font-medium text-muted",children:y===0?t.where:n.match==="and"?t.and:t.or}),f(F,{value:u.id,onValueChange:m=>d(s.id,{...k(e.find(R=>R.id===m)),id:s.id}),children:[o(_,{className:"max-sm:col-span-1",children:o(w,{})}),o(N,{children:e.map(m=>o(A,{value:m.id,children:m.label},m.id))})]}),o("button",{type:"button","aria-label":"Remove rule",onClick:()=>l(n.rules.filter(m=>m.id!==s.id)),className:"grid size-ctl cursor-pointer place-items-center rounded-ctl text-muted transition-colors hover:bg-danger-subtle hover:text-danger sm:order-last",children:o(P,{className:"size-4"})}),o("div",{className:"col-start-2 sm:col-start-auto",children:f(F,{value:s.op,onValueChange:m=>d(s.id,{op:m,value:u.type==="select"?Array.isArray(s.value)?s.value:[]:m==="between"?["",""]:Array.isArray(s.value)?"":s.value}),children:[o(_,{children:o(w,{})}),o(N,{children:S[u.type].map(m=>o(A,{value:m,children:t.ops[m]},m))})]})}),o("div",{className:"col-span-2 col-start-2 min-w-0 sm:col-span-1 sm:col-start-auto",children:o(G,{rule:s,field:u,onChange:m=>d(s.id,{value:m}),L:t})})]},s.id)})]}),f("div",{className:"flex items-center justify-between border-t border-border bg-surface px-4 py-2.5",children:[f(g,{size:"sm",variant:"ghost",disabled:!e.length,onClick:()=>l([...n.rules,k(e[0])]),children:[o(L,{})," ",t.addFilter]}),n.rules.length?o(g,{size:"sm",variant:"ghost",onClick:()=>p({...n,rules:[]}),children:t.clearAll}):null]})]})]})}function pe({fields:e,value:n,onChange:p,onEdit:c,labels:r}){const a={...b,...r,ops:{...b.ops,...r?.ops}},t=n.rules.filter(C);if(!t.length)return null;const i=(l,d)=>{if(x(l.op))return"";if(d.type==="select"){const s=(Array.isArray(l.value)?l.value:[l.value]).map(y=>d.options.find(u=>u.value===y)?.label??y);return s.length>2?`${s.slice(0,2).join(", ")} +${s.length-2}`:s.join(", ")}return Array.isArray(l.value)?l.value.filter(Boolean).join(" \u2013 "):l.value};return f("div",{className:"mb-2.5 flex flex-wrap items-center gap-1.5",children:[t.map((l,d)=>{const s=e.find(y=>y.id===l.column);return s?f(B.Fragment,{children:[d>0?o("span",{className:"text-[11px] font-medium uppercase text-muted",children:n.match==="and"?a.and:a.or}):null,f("span",{className:"inline-flex h-7 items-center gap-1 rounded-full border border-primary/20 bg-primary-subtle pl-2.5 pr-1 text-[12px] text-primary",children:[f("button",{type:"button",onClick:c,className:"cursor-pointer",children:[o("span",{className:"font-semibold",children:s.label})," ",o("span",{className:"opacity-80",children:a.ops[l.op]})," ",o("span",{className:"num font-medium",children:i(l,s)})]}),o("button",{type:"button","aria-label":"Remove filter",onClick:()=>p({...n,rules:n.rules.filter(y=>y.id!==l.id)}),className:"grid size-5 cursor-pointer place-items-center rounded-full transition-colors hover:bg-primary/15",children:o(q,{className:"size-3"})})]})]},l.id):null}),o("button",{type:"button",onClick:()=>p({...n,rules:[]}),className:"ml-1 cursor-pointer text-[12px] text-muted underline-offset-2 hover:text-text hover:underline",children:a.clearAll})]})}export{ae as EMPTY_FILTERS,b as FILTER_LABELS,le as FilterBuilder,pe as FilterChips,se as applyFilters,ie as filterFields};
@@ -1,2 +1,2 @@
1
1
  "use client";import{jsx as t,jsxs as n}from"react/jsx-runtime";import{flexRender as U,getCoreRowModel as Me,getFilteredRowModel as Re,getPaginationRowModel as Ne,getSortedRowModel as ke,useReactTable as Fe}from"@tanstack/react-table";import{ArrowDown as Pe,ArrowUp as ze,ArrowUpDown as Te,ChevronLeft as _e,ChevronRight as Ve,Columns3 as Ie,Download as te,FileDown as oe,FileSpreadsheet as Le,ListFilter as Ee,Pin as Ae,Search as Be,Star as Ue,X as $}from"lucide-react";import*as l from"react";import{toast as N}from"sonner";import{Button as m}from"../ui/button.js";import{Checkbox as ne}from"../ui/checkbox.js";import{DropdownMenu as K,DropdownMenuCheckboxItem as $e,DropdownMenuContent as O,DropdownMenuItem as S,DropdownMenuLabel as re,DropdownMenuSeparator as Ke,DropdownMenuTrigger as j}from"../ui/dropdown-menu.js";import{Input as Oe}from"../ui/input.js";import{cn as g}from"../../lib/utils.js";import{applyFilters as je,EMPTY_FILTERS as ae,FilterBuilder as He,FilterChips as qe,filterFields as Ge}from"./data-table-filters.js";import{BulkDelete as Qe,BulkEdit as Xe,EditableCell as Ye}from"./data-table-edit.js";const Je={default:"rounded-card border border-border bg-surface",striped:"rounded-card border border-border bg-surface",bordered:"rounded-card border border-border2 bg-raised",cards:"",minimal:""};function st({columns:b,data:f,getRowId:k,onRowClick:y,activeId:ie,searchPlaceholder:le="Search\u2026",pageSize:se=12,footer:H,emptyState:de,savedViews:F=[],toolbarExtra:ce,exportName:ge="waveinno-export",defaultFilters:ue=ae,onFiltersChange:pe,manualFiltering:q=!1,filterLabels:G,variant:d="default",onCellEdit:v,onBulkEdit:P,onBulkDelete:Q,getRowLabel:X,bulkActions:me,className:be}){const[fe,z]=l.useState([]),[we,T]=l.useState({}),[he,_]=l.useState({left:[],right:[]}),[V,w]=l.useState({}),[I,L]=l.useState(""),[E,A]=l.useState(-1),[Y,J]=l.useState(null),[C,xe]=l.useState(ue),[Se,W]=l.useState(!1),D=e=>{xe(e),pe?.(e)},h=l.useMemo(()=>Ge(b,f),[b,f]),Z=l.useMemo(()=>b.filter(e=>e.meta?.edit).map(e=>({id:e.id??("accessorKey"in e?String(e.accessorKey):""),label:typeof e.header=="string"?e.header:e.id??"",edit:e.meta.edit})).filter(e=>e.id),[b]),ye=l.useMemo(()=>q?f:je(f,h,C),[f,h,C,q]),ee=l.useMemo(()=>({id:"__select",size:36,enableSorting:!1,enableHiding:!1,header:({table:e})=>t(ne,{"aria-label":"Select all rows on this page",checked:e.getIsAllPageRowsSelected()?!0:e.getIsSomePageRowsSelected()?"indeterminate":!1,onCheckedChange:o=>e.toggleAllPageRowsSelected(!!o)}),cell:({row:e})=>t(ne,{"aria-label":"Select row",checked:e.getIsSelected(),onCheckedChange:o=>e.toggleSelected(!!o),onClick:o=>o.stopPropagation()})}),[]),ve=l.useMemo(()=>[ee,...b],[b,ee]),r=Fe({data:ye,columns:ve,state:{sorting:fe,columnVisibility:we,columnPinning:he,rowSelection:V,globalFilter:I},getRowId:e=>k(e),onSortingChange:z,onColumnVisibilityChange:T,onColumnPinningChange:_,onRowSelectionChange:w,onGlobalFilterChange:L,enableMultiSort:!0,enableColumnResizing:!0,columnResizeMode:"onChange",getCoreRowModel:Me(),getSortedRowModel:ke(),getFilteredRowModel:Re(),getPaginationRowModel:Ne(),initialState:{pagination:{pageSize:se}}}),M=r.getRowModel().rows,R=Object.keys(V).filter(e=>V[e]).length,Ce=e=>{if(e.key==="ArrowDown")e.preventDefault(),A(o=>Math.min(o+1,M.length-1));else if(e.key==="ArrowUp")e.preventDefault(),A(o=>Math.max(o-1,0));else if(e.key==="Enter"&&E>=0){e.preventDefault();const o=M[E];o&&y&&y(o.original)}},B=()=>{const e=r.getVisibleLeafColumns().filter(a=>a.id!=="__select"),o=e.map(a=>{const u=a.columnDef.header;return typeof u=="string"?u:a.id}),c=r.getFilteredRowModel().rows.map(a=>e.map(u=>{const x=a.getValue(u.id);return x==null?"":String(x)})),s=[o,...c].map(a=>a.map(u=>`"${u.replace(/"/g,'""')}"`).join(",")).join(`
2
- `),p=URL.createObjectURL(new Blob([`\uFEFF${s}`],{type:"text/csv"})),i=document.createElement("a");i.href=p,i.download=`${ge}.csv`,i.click(),URL.revokeObjectURL(p),N.success(`Exported ${c.length} rows`)},De=e=>{J(e.id),z(e.sorting??[]),T(e.visibility??{}),_(e.pinning??{left:[],right:[]}),e.filters&&D(e.filters)};return n("div",{className:g("relative",be),children:[n("div",{className:"mb-2.5 flex flex-wrap items-center gap-2",children:[n("div",{className:"relative min-w-[200px] flex-1 sm:max-w-xs",children:[t(Be,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted"}),t(Oe,{value:I,onChange:e=>L(e.target.value),placeholder:le,className:"pl-8"}),I?t("button",{type:"button",onClick:()=>L(""),className:"absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer text-muted hover:text-text","aria-label":"Clear search",children:t($,{className:"size-3.5"})}):null]}),h.length?t(He,{fields:h,value:C,onChange:D,labels:G,open:Se,onOpenChange:W}):null,ce,t("div",{className:"flex-1"}),F.length?n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(Ue,{}),Y?F.find(e=>e.id===Y)?.name:"Saved views"]})}),n(O,{align:"end",children:[t(re,{children:"Saved views"}),F.map(e=>n(S,{onSelect:()=>De(e),children:[t(Ee,{}),e.name]},e.id)),t(Ke,{}),n(S,{onSelect:()=>{J(null),z([]),T({}),_({left:[],right:[]}),D(ae)},children:[t($,{}),"Reset to default"]})]})]}):null,n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(Ie,{}),"Columns"]})}),n(O,{align:"end",className:"max-h-80 overflow-y-auto",children:[t(re,{children:"Visible columns"}),r.getAllLeafColumns().filter(e=>e.getCanHide()&&e.id!=="__select").map(e=>t($e,{checked:e.getIsVisible(),onCheckedChange:o=>e.toggleVisibility(!!o),onSelect:o=>o.preventDefault(),children:typeof e.columnDef.header=="string"?e.columnDef.header:e.id},e.id))]})]}),n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(te,{}),"Export"]})}),n(O,{align:"end",children:[n(S,{onSelect:B,children:[t(oe,{}),"CSV"]}),n(S,{onSelect:B,children:[t(Le,{}),"Excel (.xlsx)"]}),n(S,{onSelect:()=>N.info("PDF export queued"),children:[t(oe,{}),"PDF"]})]})]})]}),t(qe,{fields:h,value:C,onChange:D,onEdit:()=>W(!0),labels:G}),t("div",{tabIndex:0,onKeyDown:Ce,role:"region","aria-label":"Data table",className:g("overflow-auto outline-none",Je[d],d==="cards"&&"-mx-1 px-1"),children:n("table",{className:g("w-full text-[13px]",d==="cards"?"border-separate border-spacing-y-1.5":"border-collapse"),children:[t("thead",{children:r.getHeaderGroups().map(e=>t("tr",{children:e.headers.map(o=>{const c=o.column.columnDef.meta,s=o.column.getIsSorted(),p=o.column.getCanSort(),i=o.column.getIsPinned();return t("th",{style:{width:o.getSize()},className:g("ov sticky top-0 z-10 whitespace-nowrap px-cellx py-2 text-left",d==="cards"?"bg-canvas":d==="minimal"?"border-b border-border bg-canvas":"border-b border-border bg-surface",d==="bordered"&&"border-r border-border bg-hover last:border-r-0",c?.sticky==="right"&&"right-0 z-20 shadow-[-8px_0_12px_-10px_rgba(5,8,22,.25)]",c?.align==="right"&&"text-right",i==="left"&&"left-0 z-20"),children:o.isPlaceholder?null:n("div",{className:g("group/th flex items-center gap-1",c?.align==="right"&&"justify-end"),children:[p?n("button",{type:"button",onClick:a=>o.column.toggleSorting(void 0,a.shiftKey),className:g("ov flex items-center gap-1",p&&"cursor-pointer hover:text-text",s&&"!text-primary"),children:[U(o.column.columnDef.header,o.getContext()),p?s==="asc"?t(ze,{className:"size-3"}):s==="desc"?t(Pe,{className:"size-3"}):t(Te,{className:"size-3 opacity-0 transition-opacity group-hover/th:opacity-60"}):null]}):t("span",{className:"ov flex items-center gap-1",children:U(o.column.columnDef.header,o.getContext())}),o.column.getCanPin()&&o.column.id!=="__select"?t("button",{type:"button","aria-label":i?"Unpin column":"Pin column left",onClick:()=>o.column.pin(i==="left"?!1:"left"),className:g("cursor-pointer transition-opacity",i?"text-primary":"opacity-0 group-hover/th:opacity-60 hover:!opacity-100"),children:t(Ae,{className:"size-3"})}):null,o.column.getCanResize()?t("span",{onMouseDown:o.getResizeHandler(),onTouchStart:o.getResizeHandler(),className:"absolute right-0 top-0 h-full w-1 cursor-col-resize select-none bg-transparent hover:bg-primary-muted","aria-hidden":!0}):null]})},o.id)})},e.id))}),t("tbody",{children:M.length===0?t("tr",{children:t("td",{colSpan:r.getVisibleLeafColumns().length,className:"p-0",children:de??t("div",{className:"px-6 py-14 text-center text-[13px] text-muted",children:"No rows match the current filters."})})}):M.map((e,o)=>{const c=k(e.original),s=ie===c;return t("tr",{onClick:()=>{A(o),y?.(e.original)},"aria-selected":s,className:g("group/row transition-[background-color,box-shadow,transform] duration-150",y&&"cursor-pointer",d==="striped"&&"even:bg-hover/45",d==="cards"?g("[&>td]:border-y [&>td]:border-border [&>td]:bg-raised [&>td:first-child]:rounded-l-[11px] [&>td:first-child]:border-l [&>td:last-child]:rounded-r-[11px] [&>td:last-child]:border-r","shadow-[0_1px_2px_rgba(5,8,22,.04)] hover:-translate-y-px hover:shadow-[0_6px_18px_-8px_rgba(5,8,22,.22)]",s&&"[&>td]:border-primary/40 [&>td]:bg-selected"):s?"bg-selected shadow-[inset_2px_0_var(--primary)]":E===o?"bg-hover":"hover:bg-hover"),children:e.getVisibleCells().map(i=>{const a=i.column.columnDef.meta,u=U(i.column.columnDef.cell,i.getContext());return t("td",{style:{height:d==="cards"?"calc(var(--row-h) + 10px)":"var(--row-h)"},className:g("whitespace-nowrap px-cellx py-celly",d==="cards"?"":d==="minimal"?"border-b border-dashed border-border":"border-b border-border",d==="bordered"&&"border-r border-border last:border-r-0",a?.sticky==="right"&&"sticky right-0 z-[1] bg-surface shadow-[-8px_0_12px_-10px_rgba(5,8,22,.25)] group-hover/row:bg-hover group-even/row:bg-inherit",a?.align==="right"&&"text-right",a?.mono&&"mono",a?.num&&"num",a?.strong&&"font-medium text-text"),children:a?.edit&&v?t(Ye,{value:i.getValue(),display:u,edit:a.edit,align:a.align,onSave:x=>v(e.original,i.column.id,x)}):u},i.id)})},e.id)})}),H?t("tfoot",{children:t("tr",{className:"border-t-2 border-border2 font-semibold text-text",children:H})}):null]})}),n("div",{className:"mt-2.5 flex flex-wrap items-center gap-3 text-xs text-muted",children:[t("span",{className:"num",children:r.getFilteredRowModel().rows.length===0?"0 rows":`${r.getState().pagination.pageIndex*r.getState().pagination.pageSize+1}\u2013${Math.min((r.getState().pagination.pageIndex+1)*r.getState().pagination.pageSize,r.getFilteredRowModel().rows.length)} of ${r.getFilteredRowModel().rows.length}`}),n("div",{className:"ml-auto flex items-center gap-1",children:[t(m,{variant:"ghost",size:"iconSm","aria-label":"Previous page",disabled:!r.getCanPreviousPage(),onClick:()=>r.previousPage(),children:t(_e,{})}),n("span",{className:"num px-1",children:[r.getState().pagination.pageIndex+1," /"," ",r.getPageCount()||1]}),t(m,{variant:"ghost",size:"iconSm","aria-label":"Next page",disabled:!r.getCanNextPage(),onClick:()=>r.nextPage(),children:t(Ve,{})})]})]}),R>0?n("div",{className:"anim-in fixed bottom-6 left-1/2 z-30 flex -translate-x-1/2 items-center gap-2 rounded-full border border-border bg-raised px-3 py-2 shadow-elev3",children:[n("span",{className:"num px-1 text-[13px] font-medium text-text",children:[R," selected"]}),t("span",{className:"h-4 w-px bg-border"}),n(m,{variant:"ghost",size:"sm",onClick:B,children:[t(te,{}),"Export"]}),Z.length&&(P||v)?t(Xe,{count:R,columns:Z,onApply:async(e,o)=>{const c=r.getSelectedRowModel().rows.map(s=>s.original);if(P)await P(c,e,o);else for(const s of c)await v(s,e,o);N.success(`Updated ${c.length} rows`),w({})}}):null,Q?t(Qe,{count:R,names:r.getSelectedRowModel().rows.map(e=>X?X(e.original):k(e.original)),onConfirm:async()=>{const e=r.getSelectedRowModel().rows.map(o=>o.original);await Q(e),N.success(`Deleted ${e.length} rows`),w({})}}):null,me?.(r.getSelectedRowModel().rows.map(e=>e.original),()=>w({})),t(m,{variant:"ghost",size:"iconSm","aria-label":"Clear selection",onClick:()=>w({}),children:t($,{})})]}):null]})}export{st as DataTable};
2
+ `),p=URL.createObjectURL(new Blob([`\uFEFF${s}`],{type:"text/csv"})),i=document.createElement("a");i.href=p,i.download=`${ge}.csv`,i.click(),URL.revokeObjectURL(p),N.success(`Exported ${c.length} rows`)},De=e=>{J(e.id),z(e.sorting??[]),T(e.visibility??{}),_(e.pinning??{left:[],right:[]}),e.filters&&D(e.filters)};return n("div",{className:g("relative",be),children:[n("div",{className:"mb-2.5 flex flex-wrap items-center gap-2",children:[n("div",{className:"relative min-w-[200px] flex-1 sm:max-w-xs",children:[t(Be,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted"}),t(Oe,{value:I,onChange:e=>L(e.target.value),placeholder:le,className:"pl-8"}),I?t("button",{type:"button",onClick:()=>L(""),className:"absolute right-2 top-1/2 -translate-y-1/2 cursor-pointer text-muted hover:text-text","aria-label":"Clear search",children:t($,{className:"size-3.5"})}):null]}),h.length?t(He,{fields:h,value:C,onChange:D,labels:G,open:Se,onOpenChange:W}):null,ce,t("div",{className:"flex-1"}),F.length?n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(Ue,{}),Y?F.find(e=>e.id===Y)?.name:"Saved views"]})}),n(O,{align:"end",children:[t(re,{children:"Saved views"}),F.map(e=>n(S,{onSelect:()=>De(e),children:[t(Ee,{}),e.name]},e.id)),t(Ke,{}),n(S,{onSelect:()=>{J(null),z([]),T({}),_({left:[],right:[]}),D(ae)},children:[t($,{}),"Reset to default"]})]})]}):null,n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(Ie,{}),"Columns"]})}),n(O,{align:"end",className:"max-h-80 overflow-y-auto",children:[t(re,{children:"Visible columns"}),r.getAllLeafColumns().filter(e=>e.getCanHide()&&e.id!=="__select").map(e=>t($e,{checked:e.getIsVisible(),onCheckedChange:o=>e.toggleVisibility(!!o),onSelect:o=>o.preventDefault(),children:typeof e.columnDef.header=="string"?e.columnDef.header:e.id},e.id))]})]}),n(K,{children:[t(j,{asChild:!0,children:n(m,{variant:"secondary",size:"sm",children:[t(te,{}),"Export"]})}),n(O,{align:"end",children:[n(S,{onSelect:B,children:[t(oe,{}),"CSV"]}),n(S,{onSelect:B,children:[t(Le,{}),"Excel (.xlsx)"]}),n(S,{onSelect:()=>N.info("PDF export queued"),children:[t(oe,{}),"PDF"]})]})]})]}),t(qe,{fields:h,value:C,onChange:D,onEdit:()=>W(!0),labels:G}),t("div",{tabIndex:0,onKeyDown:Ce,role:"region","aria-label":"Data table",className:g("overflow-auto outline-none",Je[d],d==="cards"&&"-mx-1 px-1"),children:n("table",{className:g("w-full text-[13px]",d==="cards"?"border-separate border-spacing-y-1.5":"border-collapse"),children:[t("thead",{children:r.getHeaderGroups().map(e=>t("tr",{children:e.headers.map(o=>{const c=o.column.columnDef.meta,s=o.column.getIsSorted(),p=o.column.getCanSort(),i=o.column.getIsPinned();return t("th",{style:{width:o.getSize()},className:g("ov sticky top-0 z-10 whitespace-nowrap px-cellx py-2 text-left",d==="cards"?"bg-canvas":d==="minimal"?"border-b border-border bg-canvas":"border-b border-border bg-surface",d==="bordered"&&"border-r border-border bg-hover last:border-r-0",c?.sticky==="right"&&"right-0 z-20 shadow-[-8px_0_12px_-10px_rgba(5,8,22,.25)]",c?.align==="right"&&"text-right",i==="left"&&"left-0 z-20"),children:o.isPlaceholder?null:n("div",{className:g("group/th flex items-center gap-1",c?.align==="right"&&"justify-end"),children:[p?n("button",{type:"button",onClick:a=>o.column.toggleSorting(void 0,a.shiftKey),className:g("ov flex items-center gap-1",p&&"cursor-pointer hover:text-text",s&&"!text-primary"),children:[U(o.column.columnDef.header,o.getContext()),p?s==="asc"?t(ze,{className:"size-3"}):s==="desc"?t(Pe,{className:"size-3"}):t(Te,{className:"size-3 opacity-0 transition-opacity group-hover/th:opacity-60"}):null]}):t("span",{className:"ov flex items-center gap-1",children:U(o.column.columnDef.header,o.getContext())}),o.column.getCanPin()&&o.column.id!=="__select"?t("button",{type:"button","aria-label":i?"Unpin column":"Pin column left",onClick:()=>o.column.pin(i==="left"?!1:"left"),className:g("cursor-pointer transition-opacity",i?"text-primary":"opacity-0 group-hover/th:opacity-60 hover:!opacity-100"),children:t(Ae,{className:"size-3"})}):null,o.column.getCanResize()?t("span",{onMouseDown:o.getResizeHandler(),onTouchStart:o.getResizeHandler(),className:"absolute right-0 top-0 h-full w-1 cursor-col-resize select-none bg-transparent hover:bg-primary-muted","aria-hidden":!0}):null]})},o.id)})},e.id))}),t("tbody",{children:M.length===0?t("tr",{children:t("td",{colSpan:r.getVisibleLeafColumns().length,className:"p-0",children:de??t("div",{className:"px-6 py-14 text-center text-[13px] text-muted",children:"No rows match the current filters."})})}):M.map((e,o)=>{const c=k(e.original),s=ie===c;return t("tr",{onClick:()=>{A(o),y?.(e.original)},"aria-selected":s,className:g("group/row transition-[background-color,box-shadow,transform] duration-150",y&&"cursor-pointer",d==="striped"&&"even:bg-hover/45",d==="cards"?g("[&>td]:border-y [&>td]:border-border [&>td]:bg-raised [&>td:first-child]:rounded-l-[calc(11px*var(--radius-scale))] [&>td:first-child]:border-l [&>td:last-child]:rounded-r-[calc(11px*var(--radius-scale))] [&>td:last-child]:border-r","shadow-[0_1px_2px_rgba(5,8,22,.04)] hover:-translate-y-px hover:shadow-[0_6px_18px_-8px_rgba(5,8,22,.22)]",s&&"[&>td]:border-primary/40 [&>td]:bg-selected"):s?"bg-selected shadow-[inset_2px_0_var(--primary)]":E===o?"bg-hover":"hover:bg-hover"),children:e.getVisibleCells().map(i=>{const a=i.column.columnDef.meta,u=U(i.column.columnDef.cell,i.getContext());return t("td",{style:{height:d==="cards"?"calc(var(--row-h) + 10px)":"var(--row-h)"},className:g("whitespace-nowrap px-cellx py-celly",d==="cards"?"":d==="minimal"?"border-b border-dashed border-border":"border-b border-border",d==="bordered"&&"border-r border-border last:border-r-0",a?.sticky==="right"&&"sticky right-0 z-[1] bg-surface shadow-[-8px_0_12px_-10px_rgba(5,8,22,.25)] group-hover/row:bg-hover group-even/row:bg-inherit",a?.align==="right"&&"text-right",a?.mono&&"mono",a?.num&&"num",a?.strong&&"font-medium text-text"),children:a?.edit&&v?t(Ye,{value:i.getValue(),display:u,edit:a.edit,align:a.align,onSave:x=>v(e.original,i.column.id,x)}):u},i.id)})},e.id)})}),H?t("tfoot",{children:t("tr",{className:"border-t-2 border-border2 font-semibold text-text",children:H})}):null]})}),n("div",{className:"mt-2.5 flex flex-wrap items-center gap-3 text-xs text-muted",children:[t("span",{className:"num",children:r.getFilteredRowModel().rows.length===0?"0 rows":`${r.getState().pagination.pageIndex*r.getState().pagination.pageSize+1}\u2013${Math.min((r.getState().pagination.pageIndex+1)*r.getState().pagination.pageSize,r.getFilteredRowModel().rows.length)} of ${r.getFilteredRowModel().rows.length}`}),n("div",{className:"ml-auto flex items-center gap-1",children:[t(m,{variant:"ghost",size:"iconSm","aria-label":"Previous page",disabled:!r.getCanPreviousPage(),onClick:()=>r.previousPage(),children:t(_e,{})}),n("span",{className:"num px-1",children:[r.getState().pagination.pageIndex+1," /"," ",r.getPageCount()||1]}),t(m,{variant:"ghost",size:"iconSm","aria-label":"Next page",disabled:!r.getCanNextPage(),onClick:()=>r.nextPage(),children:t(Ve,{})})]})]}),R>0?n("div",{className:"anim-in fixed bottom-6 left-1/2 z-30 flex -translate-x-1/2 items-center gap-2 rounded-full border border-border bg-raised px-3 py-2 shadow-elev3",children:[n("span",{className:"num px-1 text-[13px] font-medium text-text",children:[R," selected"]}),t("span",{className:"h-4 w-px bg-border"}),n(m,{variant:"ghost",size:"sm",onClick:B,children:[t(te,{}),"Export"]}),Z.length&&(P||v)?t(Xe,{count:R,columns:Z,onApply:async(e,o)=>{const c=r.getSelectedRowModel().rows.map(s=>s.original);if(P)await P(c,e,o);else for(const s of c)await v(s,e,o);N.success(`Updated ${c.length} rows`),w({})}}):null,Q?t(Qe,{count:R,names:r.getSelectedRowModel().rows.map(e=>X?X(e.original):k(e.original)),onConfirm:async()=>{const e=r.getSelectedRowModel().rows.map(o=>o.original);await Q(e),N.success(`Deleted ${e.length} rows`),w({})}}):null,me?.(r.getSelectedRowModel().rows.map(e=>e.original),()=>w({})),t(m,{variant:"ghost",size:"iconSm","aria-label":"Clear selection",onClick:()=>w({}),children:t($,{})})]}):null]})}export{st as DataTable};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{CircleAlert as b,CircleCheck as x,Info as u,Sparkles as g,TriangleAlert as f}from"lucide-react";import N from"next/link";import{cn as s}from"../../lib/utils.js";function h({items:n}){return e("nav",{"aria-label":"Breadcrumb",className:"mb-3 text-xs text-muted",children:e("ol",{className:"flex flex-wrap items-center",children:n.map((r,t)=>a("li",{className:"flex items-center",children:[t>0?e("span",{className:"mx-1.5 text-border2","aria-hidden":!0,children:"\u203A"}):null,r.href&&t<n.length-1?e(N,{href:r.href,className:"text-primary hover:underline",children:r.label}):e("span",{"aria-current":t===n.length-1?"page":void 0,children:r.label})]},`${r.label}-${t}`))})})}function k({crumbs:n,title:r,description:t,secondary:o,primary:l,className:c}){return a("div",{className:s("mb-5",c),children:[n?.length?e(h,{items:n}):null,a("div",{className:"flex flex-col items-start gap-3 sm:flex-row sm:flex-wrap sm:gap-4",children:[a("div",{className:"min-w-0 w-full flex-1",children:[e("h1",{className:"disp text-2xl font-semibold leading-[30px]",children:r}),t?e("p",{className:"mt-1 max-w-[70ch] text-[13px] text-muted",children:t}):null]}),o||l?a("div",{className:"flex w-full shrink-0 items-center gap-2 sm:w-auto",children:[o,l]}):null]})]})}const w={accent:{soft:"border-accent bg-primary-subtle",outline:"border-accent/40",icon:g},info:{soft:"border-primary bg-primary-subtle",outline:"border-primary/40",icon:u},success:{soft:"border-success bg-success-subtle",outline:"border-success/40",icon:x},warning:{soft:"border-warning bg-warning-subtle",outline:"border-warning/40",icon:f},danger:{soft:"border-danger bg-danger-subtle",outline:"border-danger/40",icon:b},neutral:{soft:"border-border2 bg-hover",outline:"border-border2",icon:u}},v={accent:"text-accent",info:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-muted"};function C({children:n,className:r,tone:t="accent",title:o,icon:l,action:c,variant:i="soft"}){const d=w[t],p=d.icon,m=l===!0?e(p,{className:"size-4"}):l||null;return a("div",{className:s("mb-4 flex items-start gap-3 text-[13px] leading-5",i==="soft"&&s("rounded-r-ctl border-l-[3px] px-3.5 py-2.5 text-body",d.soft),i==="outline"&&s("rounded-ctl border bg-raised px-3.5 py-3 text-body",d.outline),i==="gradient"&&"rounded-[12px] bg-[linear-gradient(135deg,#1437d3,#7560fd)] px-4 py-3 text-white/90 shadow-[inset_0_1px_0_rgba(255,255,255,.2),0_8px_20px_-10px_rgba(20,55,211,.6)]",r),children:[m?e("span",{className:s("mt-0.5 shrink-0 [&_svg]:size-4",i==="gradient"?"text-white":v[t]),children:m}):null,a("div",{className:"min-w-0 flex-1",children:[o?e("p",{className:s("mb-0.5 font-semibold",i==="gradient"?"text-white":"text-text"),children:o}):null,n]}),c?e("div",{className:"shrink-0 self-center",children:c}):null]})}export{h as Breadcrumbs,C as Note,k as PageHeader};
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import{CircleAlert as p,CircleCheck as x,Info as u,Sparkles as g,TriangleAlert as f}from"lucide-react";import{RouterLink as N}from"../../hooks/use-router.js";import{cn as s}from"../../lib/utils.js";function h({items:a}){return e("nav",{"aria-label":"Breadcrumb",className:"mb-3 text-xs text-muted",children:e("ol",{className:"flex flex-wrap items-center",children:a.map((r,t)=>n("li",{className:"flex items-center",children:[t>0?e("span",{className:"mx-1.5 text-border2","aria-hidden":!0,children:"\u203A"}):null,r.href&&t<a.length-1?e(N,{href:r.href,className:"text-primary hover:underline",children:r.label}):e("span",{"aria-current":t===a.length-1?"page":void 0,children:r.label})]},`${r.label}-${t}`))})})}function T({crumbs:a,title:r,description:t,secondary:o,primary:l,className:c}){return n("div",{className:s("mb-5",c),children:[a?.length?e(h,{items:a}):null,n("div",{className:"flex flex-col items-start gap-3 sm:flex-row sm:flex-wrap sm:gap-4",children:[n("div",{className:"min-w-0 w-full flex-1",children:[e("h1",{className:"disp text-2xl font-semibold leading-[30px]",children:r}),t?e("p",{className:"mt-1 max-w-[70ch] text-[13px] text-muted",children:t}):null]}),o||l?n("div",{className:"flex w-full shrink-0 items-center gap-2 sm:w-auto",children:[o,l]}):null]})]})}const v={accent:{soft:"border-accent bg-primary-subtle",outline:"border-accent/40",icon:g},info:{soft:"border-primary bg-primary-subtle",outline:"border-primary/40",icon:u},success:{soft:"border-success bg-success-subtle",outline:"border-success/40",icon:x},warning:{soft:"border-warning bg-warning-subtle",outline:"border-warning/40",icon:f},danger:{soft:"border-danger bg-danger-subtle",outline:"border-danger/40",icon:p},neutral:{soft:"border-border2 bg-hover",outline:"border-border2",icon:u}},w={accent:"text-accent",info:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",neutral:"text-muted"};function C({children:a,className:r,tone:t="accent",title:o,icon:l,action:c,variant:i="soft"}){const d=v[t],b=d.icon,m=l===!0?e(b,{className:"size-4"}):l||null;return n("div",{className:s("mb-4 flex items-start gap-3 text-[13px] leading-5",i==="soft"&&s("rounded-r-ctl border-l-[3px] px-3.5 py-2.5 text-body",d.soft),i==="outline"&&s("rounded-ctl border bg-raised px-3.5 py-3 text-body",d.outline),i==="gradient"&&"rounded-[calc(12px*var(--radius-scale))] bg-[linear-gradient(135deg,var(--brand-1),var(--brand-2))] px-4 py-3 text-white/90 shadow-[inset_0_1px_0_rgba(255,255,255,.2),0_8px_20px_-10px_color-mix(in_srgb,var(--brand-1)_60%,transparent)]",r),children:[m?e("span",{className:s("mt-0.5 shrink-0 [&_svg]:size-4",i==="gradient"?"text-white":w[t]),children:m}):null,n("div",{className:"min-w-0 flex-1",children:[o?e("p",{className:s("mb-0.5 font-semibold",i==="gradient"?"text-white":"text-text"),children:o}):null,a]}),c?e("div",{className:"shrink-0 self-center",children:c}):null]})}export{h as Breadcrumbs,C as Note,T as PageHeader};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as r}from"react/jsx-runtime";import{ChevronRight as v}from"lucide-react";import*as h from"react";import{cn as l}from"../../lib/utils.js";import{StatusBadge as N}from"../ui/badge.js";const y={neutral:"text-muted",info:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",accent:"text-accent"};function T({crumbs:n,icon:s,eyebrow:i,badge:o,title:b,description:d,meta:p,actions:m,stats:c,tabs:x,activeTab:u,onTabChange:g,className:f}){return r("header",{className:l("relative isolate overflow-hidden rounded-[16px] border border-border bg-surface shadow-[var(--lit)]","before:absolute before:inset-0 before:-z-10 before:bg-[radial-gradient(80%_120%_at_100%_0%,var(--primary-subtle),transparent_55%)]","after:absolute after:inset-0 after:-z-10 after:bg-[radial-gradient(var(--border)_1px,transparent_1px)] after:[background-size:16px_16px] after:[mask-image:linear-gradient(135deg,transparent_35%,black_100%)] after:opacity-60",f),children:[r("div",{className:"px-5 pb-5 pt-4 sm:px-6",children:[n?.length?t("nav",{"aria-label":"Breadcrumb",className:"mb-3 flex flex-wrap items-center gap-1 text-[12px] text-muted",children:n.map((e,a)=>r(h.Fragment,{children:[a>0?t(v,{className:"size-3 opacity-60"}):null,e.href&&a<n.length-1?t("a",{href:e.href,className:"rounded px-0.5 transition-colors hover:text-text",children:e.label}):t("span",{className:l(a===n.length-1&&"text-body"),children:e.label})]},`${e.label}-${a}`))}):null,r("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[r("div",{className:"flex min-w-0 items-start gap-4",children:[s?t("span",{className:"grid size-14 shrink-0 place-items-center overflow-hidden rounded-[14px] border border-border bg-raised text-primary shadow-elev2 [&>svg]:size-6",children:s}):null,r("div",{className:"min-w-0",children:[i?t("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[0.1em] text-primary",children:i}):null,r("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[t("h1",{className:"disp text-[22px] font-semibold leading-tight tracking-[-0.01em] text-text sm:text-[26px]",children:b}),o?t(N,{label:o.label,tone:o.tone??"neutral"}):null]}),d?t("p",{className:"mt-1.5 max-w-[68ch] text-[13.5px] leading-relaxed text-muted",children:d}):null,p?.length?t("ul",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[12.5px] text-body",children:p.map((e,a)=>r("li",{className:"flex items-center gap-1.5",children:[e.icon?t(e.icon,{className:"size-3.5 text-muted"}):null,e.label]},a))}):null]})]}),m?t("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:m}):null]}),c?.length?t("dl",{className:"mt-5 grid grid-cols-2 gap-px overflow-hidden rounded-[12px] border border-border bg-border sm:grid-cols-4",children:c.map(e=>r("div",{className:"bg-raised/90 px-4 py-3 backdrop-blur",children:[t("dt",{className:"text-[11px] font-medium uppercase tracking-[0.06em] text-muted",children:e.label}),t("dd",{className:"num mt-1 text-[19px] font-semibold leading-none text-text",children:e.value}),e.hint?t("dd",{className:l("num mt-1 text-[11.5px]",y[e.tone??"neutral"]),children:e.hint}):null]},e.label))}):null]}),x?.length?t("nav",{role:"tablist",className:"flex gap-1 overflow-x-auto border-t border-border px-3 [scrollbar-width:none] sm:px-4",children:x.map(e=>{const a=e.id===u;return r("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>g?.(e.id),className:l("relative flex h-11 shrink-0 cursor-pointer items-center gap-1.5 px-3 text-[13px] font-medium transition-colors",a?"text-text":"text-muted hover:text-text","after:absolute after:inset-x-2 after:bottom-0 after:h-[2px] after:rounded-full after:transition-colors",a?"after:bg-primary":"after:bg-transparent"),children:[e.label,e.count!==void 0?t("span",{className:l("num rounded-full px-1.5 py-px text-[10.5px]",a?"bg-primary-subtle text-primary":"bg-hover text-muted"),children:e.count}):null]},e.id)})}):null]})}export{T as PageHero};
1
+ import{jsx as t,jsxs as r}from"react/jsx-runtime";import{ChevronRight as v}from"lucide-react";import*as h from"react";import{cn as l}from"../../lib/utils.js";import{StatusBadge as N}from"../ui/badge.js";const y={neutral:"text-muted",info:"text-primary",success:"text-success",warning:"text-warning",danger:"text-danger",accent:"text-accent"};function T({crumbs:n,icon:o,eyebrow:i,badge:s,title:b,description:d,meta:c,actions:p,stats:m,tabs:x,activeTab:u,onTabChange:g,className:f}){return r("header",{className:l("relative isolate overflow-hidden rounded-[calc(16px*var(--radius-scale))] border border-border bg-surface shadow-[var(--lit)]","before:absolute before:inset-0 before:-z-10 before:bg-[radial-gradient(80%_120%_at_100%_0%,var(--primary-subtle),transparent_55%)]","after:absolute after:inset-0 after:-z-10 after:bg-[radial-gradient(var(--border)_1px,transparent_1px)] after:[background-size:16px_16px] after:[mask-image:linear-gradient(135deg,transparent_35%,black_100%)] after:opacity-60",f),children:[r("div",{className:"px-5 pb-5 pt-4 sm:px-6",children:[n?.length?t("nav",{"aria-label":"Breadcrumb",className:"mb-3 flex flex-wrap items-center gap-1 text-[12px] text-muted",children:n.map((e,a)=>r(h.Fragment,{children:[a>0?t(v,{className:"size-3 opacity-60"}):null,e.href&&a<n.length-1?t("a",{href:e.href,className:"rounded px-0.5 transition-colors hover:text-text",children:e.label}):t("span",{className:l(a===n.length-1&&"text-body"),children:e.label})]},`${e.label}-${a}`))}):null,r("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[r("div",{className:"flex min-w-0 items-start gap-4",children:[o?t("span",{className:"grid size-14 shrink-0 place-items-center overflow-hidden rounded-[calc(14px*var(--radius-scale))] border border-border bg-raised text-primary shadow-elev2 [&>svg]:size-6",children:o}):null,r("div",{className:"min-w-0",children:[i?t("p",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[0.1em] text-primary",children:i}):null,r("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1",children:[t("h1",{className:"disp text-[22px] font-semibold leading-tight tracking-[-0.01em] text-text sm:text-[26px]",children:b}),s?t(N,{label:s.label,tone:s.tone??"neutral"}):null]}),d?t("p",{className:"mt-1.5 max-w-[68ch] text-[13.5px] leading-relaxed text-muted",children:d}):null,c?.length?t("ul",{className:"mt-3 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-[12.5px] text-body",children:c.map((e,a)=>r("li",{className:"flex items-center gap-1.5",children:[e.icon?t(e.icon,{className:"size-3.5 text-muted"}):null,e.label]},a))}):null]})]}),p?t("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:p}):null]}),m?.length?t("dl",{className:"mt-5 grid grid-cols-2 gap-px overflow-hidden rounded-[calc(12px*var(--radius-scale))] border border-border bg-border sm:grid-cols-4",children:m.map(e=>r("div",{className:"bg-raised/90 px-4 py-3 backdrop-blur",children:[t("dt",{className:"text-[11px] font-medium uppercase tracking-[0.06em] text-muted",children:e.label}),t("dd",{className:"num mt-1 text-[19px] font-semibold leading-none text-text",children:e.value}),e.hint?t("dd",{className:l("num mt-1 text-[11.5px]",y[e.tone??"neutral"]),children:e.hint}):null]},e.label))}):null]}),x?.length?t("nav",{role:"tablist",className:"flex gap-1 overflow-x-auto border-t border-border px-3 [scrollbar-width:none] sm:px-4",children:x.map(e=>{const a=e.id===u;return r("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>g?.(e.id),className:l("relative flex h-11 shrink-0 cursor-pointer items-center gap-1.5 px-3 text-[13px] font-medium transition-colors",a?"text-text":"text-muted hover:text-text","after:absolute after:inset-x-2 after:bottom-0 after:h-[2px] after:rounded-full after:transition-colors",a?"after:bg-primary":"after:bg-transparent"),children:[e.label,e.count!==void 0?t("span",{className:l("num rounded-full px-1.5 py-px text-[10.5px]",a?"bg-primary-subtle text-primary":"bg-hover text-muted"),children:e.count}):null]},e.id)})}):null]})}export{T as PageHero};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{ArrowDownRight as $,ArrowUpRight as k}from"lucide-react";import*as z from"react";import{cn as d}from"../../lib/utils.js";import{useCurrency as C}from"../../store/settings-store.js";import{WaveinnoSymbol as S}from"../brand/waveinno-logo.js";import{ProgressRing as L}from"../ui/progress.js";const M={neutral:"bg-hover text-muted",info:"bg-primary-subtle text-primary",success:"bg-success-subtle text-success",warning:"bg-warning-subtle text-warning",danger:"bg-danger-subtle text-danger",accent:"bg-primary-subtle text-accent"},P={neutral:"var(--muted)",info:"var(--primary)",success:"var(--success)",warning:"var(--warning)",danger:"var(--danger)",accent:"var(--accent)"};function T({delta:a,invert:m,label:i,onBrand:n}){const s=m?a<0:a>0;return t("span",{className:"flex flex-wrap items-center gap-1.5 text-[12px]",children:[t("span",{className:d("num inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 font-semibold",n?"bg-white/18 text-white":s?"bg-success-subtle text-success":"bg-danger-subtle text-danger"),children:[a>=0?e(k,{className:"size-3"}):e($,{className:"size-3"}),Math.abs(a).toFixed(1),"%"]}),i?e("span",{className:n?"text-white/70":"text-muted",children:i}):null]})}function A(a){const m=Math.max(...a),i=Math.min(...a),n=m-i||1,s=a.map((r,p)=>[p/(a.length-1)*100,36-(r-i)/n*30]);let f=`M${s[0][0]},${s[0][1]}`;for(let r=1;r<s.length;r++){const[p,v]=s[r-1],[l,g]=s[r],u=(p+l)/2;f+=` C${u},${v} ${u},${g} ${l},${g}`}return{line:f,area:`${f} L100,40 L0,40 Z`,last:s[s.length-1]}}function E({label:a,value:m,currency:i,delta:n,invertDelta:s,deltaLabel:f,hint:r,icon:p,tone:v="info",variant:l="icon",spark:g,target:u,parts:b,className:_}){const h=C(),w=z.useId().replace(/:/g,""),x=l==="gradient",y=t("span",{className:"num disp text-[28px] font-semibold leading-none tracking-[-0.01em]",children:[i&&h.position==="before"?e("span",{className:"mr-0.5 text-[0.62em] font-medium opacity-70",children:h.symbol}):null,m,i&&h.position==="after"?e("span",{className:"ml-1 text-[0.62em] font-medium opacity-70",children:h.symbol}):null]});return t("div",{className:d("relative isolate flex flex-col overflow-hidden rounded-[16px] border p-[18px] transition-[transform,box-shadow] duration-200 hover:-translate-y-0.5",x?"border-transparent bg-[linear-gradient(140deg,#1f45ea,#1437d3_45%,#7560fd)] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_14px_30px_-14px_rgba(20,55,211,.7)]":"border-border bg-surface text-text shadow-[var(--lit)] hover:shadow-[var(--lit),0_10px_24px_-14px_rgba(5,8,22,.25)]",_),children:[x?e(S,{mono:!0,title:"",className:"pointer-events-none absolute -bottom-4 -right-6 -z-10 h-auto w-40 rotate-[-12deg] text-white opacity-[.12]"}):null,t("div",{className:"flex items-start justify-between gap-3",children:[e("p",{className:d("text-[12px] font-medium",x?"text-white/80":"text-muted"),children:a}),p&&l!=="target"?e("span",{className:d("grid size-9 shrink-0 place-items-center rounded-[10px] [&_svg]:size-[18px]",x?"bg-white/15 text-white ring-1 ring-inset ring-white/25":M[v]),children:p}):null]}),l==="target"&&u?t("div",{className:"mt-2 flex items-center justify-between gap-3",children:[t("div",{className:"min-w-0",children:[y,e("p",{className:"mt-2 text-[12px] text-muted",children:u.label})]}),e(L,{value:u.percent,size:68,thickness:7,gradient:!0,label:a})]}):l==="comparison"&&b?t("div",{className:"mt-2",children:[e("div",{className:"grid grid-cols-2 gap-3",children:b.map((o,c)=>t("div",{className:d(c===1&&"border-l border-border pl-3"),children:[t("p",{className:"flex items-center gap-1.5 text-[11.5px] text-muted",children:[e("span",{className:d("size-2 rounded-full",c===0?"bg-primary":"bg-accent")}),o.label]}),e("p",{className:"num disp mt-1 text-[22px] font-semibold leading-none text-text",children:o.display??o.value.toLocaleString()})]},o.label))}),(()=>{const o=b[0].value+b[1].value||1,c=b[0].value/o*100;return t("div",{className:"mt-3",children:[t("div",{className:"flex h-2 gap-0.5 overflow-hidden rounded-full",children:[e("div",{className:"h-full rounded-l-full bg-[linear-gradient(90deg,#1437d3,#4f46e5)]",style:{width:`${c}%`}}),e("div",{className:"h-full flex-1 rounded-r-full bg-[linear-gradient(90deg,#7c3aed,#a78bfa)]"})]}),t("div",{className:"num mt-1.5 flex justify-between text-[11px] text-muted",children:[t("span",{children:[c.toFixed(0),"%"]}),t("span",{children:[(100-c).toFixed(0),"%"]})]})]})})()]}):e("div",{className:"mt-2",children:y}),n!==void 0||r?t("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[n!==void 0?e(T,{delta:n,invert:s,label:f,onBrand:x}):null,r?e("span",{className:d("text-[12px]",x?"text-white/70":"text-muted"),children:r}):null]}):null,l==="spark"&&g&&g.length>1?(()=>{const{line:o,area:c,last:R}=A(g),N=P[n===void 0?v:(s?n<0:n>0)?"success":"danger"];return t("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"-mx-[18px] -mb-[18px] mt-3 h-16 w-[calc(100%+36px)]","aria-hidden":!0,children:[e("defs",{children:t("linearGradient",{id:`${w}-a`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"0",stopColor:N,stopOpacity:".28"}),e("stop",{offset:"1",stopColor:N,stopOpacity:"0"})]})}),e("path",{d:c,fill:`url(#${w}-a)`}),e("path",{d:o,fill:"none",stroke:N,strokeWidth:"1.6",vectorEffect:"non-scaling-stroke"}),e("circle",{cx:R[0],cy:R[1],r:"1.6",fill:N,vectorEffect:"non-scaling-stroke"})]})})():null]})}function O({children:a,className:m}){return e("div",{className:d("stagger grid gap-3 sm:grid-cols-2 xl:grid-cols-4",m),children:a})}export{E as StatCard,O as StatGrid};
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{ArrowDownRight as $,ArrowUpRight as k}from"lucide-react";import*as z from"react";import{cn as d}from"../../lib/utils.js";import{useCurrency as C}from"../../store/settings-store.js";import{WaveinnoSymbol as S}from"../brand/waveinno-logo.js";import{ProgressRing as L}from"../ui/progress.js";const M={neutral:"bg-hover text-muted",info:"bg-primary-subtle text-primary",success:"bg-success-subtle text-success",warning:"bg-warning-subtle text-warning",danger:"bg-danger-subtle text-danger",accent:"bg-primary-subtle text-accent"},P={neutral:"var(--muted)",info:"var(--primary)",success:"var(--success)",warning:"var(--warning)",danger:"var(--danger)",accent:"var(--accent)"};function T({delta:a,invert:m,label:i,onBrand:n}){const s=m?a<0:a>0;return t("span",{className:"flex flex-wrap items-center gap-1.5 text-[12px]",children:[t("span",{className:d("num inline-flex items-center gap-0.5 rounded-full px-1.5 py-0.5 font-semibold",n?"bg-white/18 text-white":s?"bg-success-subtle text-success":"bg-danger-subtle text-danger"),children:[a>=0?e(k,{className:"size-3"}):e($,{className:"size-3"}),Math.abs(a).toFixed(1),"%"]}),i?e("span",{className:n?"text-white/70":"text-muted",children:i}):null]})}function A(a){const m=Math.max(...a),i=Math.min(...a),n=m-i||1,s=a.map((r,p)=>[p/(a.length-1)*100,36-(r-i)/n*30]);let b=`M${s[0][0]},${s[0][1]}`;for(let r=1;r<s.length;r++){const[p,v]=s[r-1],[l,g]=s[r],u=(p+l)/2;b+=` C${u},${v} ${u},${g} ${l},${g}`}return{line:b,area:`${b} L100,40 L0,40 Z`,last:s[s.length-1]}}function E({label:a,value:m,currency:i,delta:n,invertDelta:s,deltaLabel:b,hint:r,icon:p,tone:v="info",variant:l="icon",spark:g,target:u,parts:f,className:R}){const h=C(),w=z.useId().replace(/:/g,""),x=l==="gradient",y=t("span",{className:"num disp text-[28px] font-semibold leading-none tracking-[-0.01em]",children:[i&&h.position==="before"?e("span",{className:"mr-0.5 text-[0.62em] font-medium opacity-70",children:h.symbol}):null,m,i&&h.position==="after"?e("span",{className:"ml-1 text-[0.62em] font-medium opacity-70",children:h.symbol}):null]});return t("div",{className:d("relative isolate flex flex-col overflow-hidden rounded-[calc(16px*var(--radius-scale))] border p-[18px] transition-[transform,box-shadow] duration-200 hover:-translate-y-0.5",x?"border-transparent [--text:#ffffff] bg-[linear-gradient(140deg,var(--brand-1),color-mix(in_srgb,var(--brand-1)_78%,#000)_45%,var(--brand-2))] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.25),0_14px_30px_-14px_color-mix(in_srgb,var(--brand-1)_70%,transparent)]":"border-border bg-surface text-text shadow-[var(--lit)] hover:shadow-[var(--lit),0_10px_24px_-14px_rgba(5,8,22,.25)]",R),children:[x?e(S,{mono:!0,title:"",className:"pointer-events-none absolute -bottom-4 -right-6 -z-10 h-auto w-40 rotate-[-12deg] text-white opacity-[.12]"}):null,t("div",{className:"flex items-start justify-between gap-3",children:[e("p",{className:d("text-[12px] font-medium",x?"text-white/80":"text-muted"),children:a}),p&&l!=="target"?e("span",{className:d("grid size-9 shrink-0 place-items-center rounded-[calc(10px*var(--radius-scale))] [&_svg]:size-[18px]",x?"bg-white/15 text-white ring-1 ring-inset ring-white/25":M[v]),children:p}):null]}),l==="target"&&u?t("div",{className:"mt-2 flex items-center justify-between gap-3",children:[t("div",{className:"min-w-0",children:[y,e("p",{className:"mt-2 text-[12px] text-muted",children:u.label})]}),e(L,{value:u.percent,size:68,thickness:7,gradient:!0,label:a})]}):l==="comparison"&&f?t("div",{className:"mt-2",children:[e("div",{className:"grid grid-cols-2 gap-3",children:f.map((o,c)=>t("div",{className:d(c===1&&"border-l border-border pl-3"),children:[t("p",{className:"flex items-center gap-1.5 text-[11.5px] text-muted",children:[e("span",{className:d("size-2 rounded-full",c===0?"bg-primary":"bg-accent")}),o.label]}),e("p",{className:"num disp mt-1 text-[22px] font-semibold leading-none text-text",children:o.display??o.value.toLocaleString()})]},o.label))}),(()=>{const o=f[0].value+f[1].value||1,c=f[0].value/o*100;return t("div",{className:"mt-3",children:[t("div",{className:"flex h-2 gap-0.5 overflow-hidden rounded-full",children:[e("div",{className:"h-full rounded-l-full bg-[linear-gradient(90deg,var(--brand-1),var(--primary))]",style:{width:`${c}%`}}),e("div",{className:"h-full flex-1 rounded-r-full bg-[linear-gradient(90deg,#7c3aed,#a78bfa)]"})]}),t("div",{className:"num mt-1.5 flex justify-between text-[11px] text-muted",children:[t("span",{children:[c.toFixed(0),"%"]}),t("span",{children:[(100-c).toFixed(0),"%"]})]})]})})()]}):e("div",{className:"mt-2",children:y}),n!==void 0||r?t("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[n!==void 0?e(T,{delta:n,invert:s,label:b,onBrand:x}):null,r?e("span",{className:d("text-[12px]",x?"text-white/70":"text-muted"),children:r}):null]}):null,l==="spark"&&g&&g.length>1?(()=>{const{line:o,area:c,last:_}=A(g),N=P[n===void 0?v:(s?n<0:n>0)?"success":"danger"];return t("svg",{viewBox:"0 0 100 40",preserveAspectRatio:"none",className:"-mx-[18px] -mb-[18px] mt-3 h-16 w-[calc(100%+36px)]","aria-hidden":!0,children:[e("defs",{children:t("linearGradient",{id:`${w}-a`,x1:"0",y1:"0",x2:"0",y2:"1",children:[e("stop",{offset:"0",stopColor:N,stopOpacity:".28"}),e("stop",{offset:"1",stopColor:N,stopOpacity:"0"})]})}),e("path",{d:c,fill:`url(#${w}-a)`}),e("path",{d:o,fill:"none",stroke:N,strokeWidth:"1.6",vectorEffect:"non-scaling-stroke"}),e("circle",{cx:_[0],cy:_[1],r:"1.6",fill:N,vectorEffect:"non-scaling-stroke"})]})})():null]})}function O({children:a,className:m}){return e("div",{className:d("stagger grid gap-3 sm:grid-cols-2 xl:grid-cols-4",m),children:a})}export{E as StatCard,O as StatGrid};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{ChevronDown as y,CornerDownRight as v,MessageSquare as w,Pin as R,Send as k}from"lucide-react";import*as b from"react";import{cn as c}from"../../lib/utils.js";import{Avatar as f}from"../ui/avatar.js";import{Badge as N}from"../ui/badge.js";import{Button as z}from"../ui/button.js";const T={neutral:"bg-raised text-muted ring-border",info:"bg-primary-subtle text-primary ring-primary/25",success:"bg-success-subtle text-success ring-success/25",warning:"bg-warning-subtle text-warning ring-warning/25",danger:"bg-danger-subtle text-danger ring-danger/25",accent:"bg-primary-subtle text-accent ring-accent/25"};function D({items:r,className:p}){const o=[];for(const n of r){const l=n.group??"",s=o[o.length-1];s&&s[0]===l?s[1].push(n):o.push([l,[n]])}return e("div",{className:c("space-y-5",p),children:o.map(([n,l])=>a("section",{children:[n?a("h4",{className:"mb-3 flex items-center gap-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted",children:[n,e("span",{className:"h-px flex-1 bg-border"})]}):null,e("ol",{className:"relative",children:l.map((s,d)=>a("li",{className:"relative flex gap-3.5 pb-5 last:pb-0",children:[d<l.length-1?e("span",{"aria-hidden":!0,className:"absolute left-[15px] top-8 bottom-0 w-px bg-border"}):null,e("span",{className:c("relative z-[1] grid size-8 shrink-0 place-items-center rounded-full ring-1 [&_svg]:size-4",T[s.tone??"neutral"]),children:s.icon??e("i",{className:"size-2 rounded-full bg-current"})}),a("div",{className:"min-w-0 flex-1 pt-1",children:[a("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a("p",{className:"text-[13px] text-body",children:[s.actor?a("span",{className:"font-semibold text-text",children:[s.actor.name," "]}):null,s.title]}),s.meta,e("time",{className:"ml-auto shrink-0 text-[11.5px] text-muted",children:s.time})]}),s.description?e("div",{className:"mt-1 text-[12.5px] leading-[18px] text-muted",children:s.description}):null]})]},s.id))})]},n||"_"))})}function O({entries:r,defaultOpen:p=1,labels:o,className:n}){const l={changes:t=>`${t} ${t===1?"change":"changes"}`,empty:"(empty)",...o},[s,d]=b.useState(()=>new Set(r.slice(0,p).map(t=>t.id))),g=t=>d(u=>{const m=new Set(u);return m.has(t)?m.delete(t):m.add(t),m});return e("ol",{className:c("relative space-y-3",n),children:r.map((t,u)=>{const m=s.has(t.id),i=t.changes?.length??0;return a("li",{className:"relative flex gap-3.5",children:[u<r.length-1?e("span",{"aria-hidden":!0,className:"absolute left-[17px] top-10 -bottom-3 w-px bg-border"}):null,e(f,{name:t.actor.name,src:t.actor.src,size:"md",className:"relative z-[1] mt-1 ring-4 ring-canvas"}),a("div",{className:"min-w-0 flex-1 overflow-hidden rounded-[12px] border border-border bg-raised shadow-[var(--lit)]",children:[a("button",{type:"button",onClick:()=>i&&g(t.id),className:c("flex w-full items-start gap-2 px-3.5 py-3 text-left",i?"cursor-pointer hover:bg-hover/50":"cursor-default"),"aria-expanded":i?m:void 0,children:[a("div",{className:"min-w-0 flex-1",children:[a("p",{className:"text-[13px] text-body",children:[e("span",{className:"font-semibold text-text",children:t.actor.name}),t.actor.role?a("span",{className:"text-muted",children:[" \xB7 ",t.actor.role]}):null]}),a("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[e(N,{tone:t.tone??"info",variant:"soft",children:t.action}),t.version?e("span",{className:"num rounded-[5px] border border-border bg-surface px-1.5 text-[11px] font-medium leading-[18px] text-muted",children:t.version}):null,i?e("span",{className:"text-[11.5px] text-muted",children:l.changes(i)}):null]})]}),e("time",{className:"shrink-0 pt-0.5 text-[11.5px] text-muted",children:t.at}),i?e(y,{className:c("mt-0.5 size-4 shrink-0 text-muted transition-transform",m&&"rotate-180")}):null]}),t.note?a("p",{className:"mx-3.5 mb-3 rounded-[8px] border-l-2 border-primary/40 bg-surface px-2.5 py-1.5 text-[12.5px] italic leading-[18px] text-body",children:["\u201C",t.note,"\u201D"]}):null,i&&m?e("dl",{className:"divide-y divide-border border-t border-border bg-surface/60",children:t.changes.map(x=>a("div",{className:"grid grid-cols-[110px_1fr] items-center gap-3 px-3.5 py-2 text-[12.5px] sm:grid-cols-[140px_1fr]",children:[e("dt",{className:"truncate font-medium text-muted",children:x.field}),a("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[e("span",{className:"num rounded-[5px] bg-danger-subtle px-1.5 py-0.5 text-danger line-through decoration-danger/50",children:x.from??l.empty}),e("span",{className:"text-muted",children:"\u2192"}),e("span",{className:"num rounded-[5px] bg-success-subtle px-1.5 py-0.5 font-medium text-success",children:x.to??l.empty})]})]},x.field))}):null]})]},t.id)})})}function h({note:r,depth:p,onReply:o,labels:n}){const[l,s]=b.useState(p<1),[d,g]=b.useState(!1),[t,u]=b.useState(""),m=r.replies??[];return e("li",{className:"relative",children:a("div",{className:"flex gap-3",children:[e(f,{name:r.author.name,src:r.author.src,size:p?"sm":"md",className:"relative z-[1] mt-0.5 ring-4 ring-canvas"}),a("div",{className:"min-w-0 flex-1",children:[a("div",{className:c("rounded-[12px] border px-3.5 py-2.5",r.pinned?"border-primary/30 bg-primary-subtle/40":"border-border bg-raised"),children:[a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e("span",{className:"text-[13px] font-semibold text-text",children:r.author.name}),r.author.role?e("span",{className:"text-[11.5px] text-muted",children:r.author.role}):null,r.tag?e(N,{tone:r.tag.tone??"neutral",variant:"outline",children:r.tag.label}):null,r.pinned?e(R,{className:"size-3 text-primary","aria-label":"pinned"}):null,e("time",{className:"ml-auto text-[11.5px] text-muted",children:r.at})]}),e("div",{className:"mt-1 text-[13px] leading-5 text-body",children:r.text})]}),a("div",{className:"mt-1 flex items-center gap-3 pl-1 text-[12px]",children:[o?a("button",{type:"button",onClick:()=>g(i=>!i),className:"flex cursor-pointer items-center gap-1 font-medium text-muted hover:text-primary",children:[e(v,{className:"size-3.5"})," ",n.reply]}):null,m.length?a("button",{type:"button",onClick:()=>s(i=>!i),className:"flex cursor-pointer items-center gap-1 font-medium text-primary",children:[e(w,{className:"size-3.5"})," ",l?n.hide:n.replies(m.length)]}):null]}),d&&o?a("form",{className:"mt-2 flex items-start gap-2",onSubmit:i=>{i.preventDefault(),t.trim()&&(o(r.id,t.trim()),u(""),g(!1),s(!0))},children:[e("textarea",{autoFocus:!0,value:t,onChange:i=>u(i.target.value),rows:2,placeholder:n.placeholder,className:"min-h-16 flex-1 resize-y rounded-[10px] border border-border2 bg-raised px-3 py-2 text-[13px] text-text outline-none placeholder:text-placeholder focus:border-primary focus:ring-2 focus:ring-primary/20"}),e(z,{type:"submit",variant:"primary",size:"icon","aria-label":n.send,disabled:!t.trim(),children:e(k,{})})]}):null,m.length&&l?e("ul",{className:"relative mt-3 space-y-3 before:absolute before:-left-[22px] before:top-0 before:bottom-3 before:w-px before:bg-border",children:m.map(i=>e(h,{note:i,depth:p+1,onReply:o,labels:n},i.id))}):null]})]})})}function _({notes:r,onReply:p,labels:o,className:n}){const l={reply:"Reply",replies:d=>`${d} ${d===1?"reply":"replies"}`,hide:"Hide replies",placeholder:"Write a reply\u2026",send:"Send",...o},s=[...r].sort((d,g)=>+!!g.pinned-+!!d.pinned);return e("ul",{className:c("space-y-4",n),children:s.map(d=>e(h,{note:d,depth:0,onReply:p,labels:l},d.id))})}export{D as ActivityTimeline,O as ChangeHistory,_ as ChangeNotes};
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import{ChevronDown as h,CornerDownRight as y,MessageSquare as w,Pin as R,Send as k}from"lucide-react";import*as b from"react";import{cn as p}from"../../lib/utils.js";import{Avatar as f}from"../ui/avatar.js";import{Badge as N}from"../ui/badge.js";import{Button as z}from"../ui/button.js";const T={neutral:"bg-raised text-muted ring-border",info:"bg-primary-subtle text-primary ring-primary/25",success:"bg-success-subtle text-success ring-success/25",warning:"bg-warning-subtle text-warning ring-warning/25",danger:"bg-danger-subtle text-danger ring-danger/25",accent:"bg-primary-subtle text-accent ring-accent/25"};function D({items:r,className:m}){const o=[];for(const n of r){const l=n.group??"",s=o[o.length-1];s&&s[0]===l?s[1].push(n):o.push([l,[n]])}return e("div",{className:p("space-y-5",m),children:o.map(([n,l])=>a("section",{children:[n?a("h4",{className:"mb-3 flex items-center gap-3 text-[11px] font-semibold uppercase tracking-[0.08em] text-muted",children:[n,e("span",{className:"h-px flex-1 bg-border"})]}):null,e("ol",{className:"relative",children:l.map((s,c)=>a("li",{className:"relative flex gap-3.5 pb-5 last:pb-0",children:[c<l.length-1?e("span",{"aria-hidden":!0,className:"absolute left-[15px] top-8 bottom-0 w-px bg-border"}):null,e("span",{className:p("relative z-[1] grid size-8 shrink-0 place-items-center rounded-full ring-1 [&_svg]:size-4",T[s.tone??"neutral"]),children:s.icon??e("i",{className:"size-2 rounded-full bg-current"})}),a("div",{className:"min-w-0 flex-1 pt-1",children:[a("div",{className:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5",children:[a("p",{className:"text-[13px] text-body",children:[s.actor?a("span",{className:"font-semibold text-text",children:[s.actor.name," "]}):null,s.title]}),s.meta,e("time",{className:"ml-auto shrink-0 text-[11.5px] text-muted",children:s.time})]}),s.description?e("div",{className:"mt-1 text-[12.5px] leading-[18px] text-muted",children:s.description}):null]})]},s.id))})]},n||"_"))})}function O({entries:r,defaultOpen:m=1,labels:o,className:n}){const l={changes:t=>`${t} ${t===1?"change":"changes"}`,empty:"(empty)",...o},[s,c]=b.useState(()=>new Set(r.slice(0,m).map(t=>t.id))),u=t=>c(g=>{const d=new Set(g);return d.has(t)?d.delete(t):d.add(t),d});return e("ol",{className:p("relative space-y-3",n),children:r.map((t,g)=>{const d=s.has(t.id),i=t.changes?.length??0;return a("li",{className:"relative flex gap-3.5",children:[g<r.length-1?e("span",{"aria-hidden":!0,className:"absolute left-[17px] top-10 -bottom-3 w-px bg-border"}):null,e(f,{name:t.actor.name,src:t.actor.src,size:"md",className:"relative z-[1] mt-1 ring-4 ring-canvas"}),a("div",{className:"min-w-0 flex-1 overflow-hidden rounded-[calc(12px*var(--radius-scale))] border border-border bg-raised shadow-[var(--lit)]",children:[a("button",{type:"button",onClick:()=>i&&u(t.id),className:p("flex w-full items-start gap-2 px-3.5 py-3 text-left",i?"cursor-pointer hover:bg-hover/50":"cursor-default"),"aria-expanded":i?d:void 0,children:[a("div",{className:"min-w-0 flex-1",children:[a("p",{className:"text-[13px] text-body",children:[e("span",{className:"font-semibold text-text",children:t.actor.name}),t.actor.role?a("span",{className:"text-muted",children:[" \xB7 ",t.actor.role]}):null]}),a("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[e(N,{tone:t.tone??"info",variant:"soft",children:t.action}),t.version?e("span",{className:"num rounded-[calc(5px*var(--radius-scale))] border border-border bg-surface px-1.5 text-[11px] font-medium leading-[18px] text-muted",children:t.version}):null,i?e("span",{className:"text-[11.5px] text-muted",children:l.changes(i)}):null]})]}),e("time",{className:"shrink-0 pt-0.5 text-[11.5px] text-muted",children:t.at}),i?e(h,{className:p("mt-0.5 size-4 shrink-0 text-muted transition-transform",d&&"rotate-180")}):null]}),t.note?a("p",{className:"mx-3.5 mb-3 rounded-[calc(8px*var(--radius-scale))] border-l-2 border-primary/40 bg-surface px-2.5 py-1.5 text-[12.5px] italic leading-[18px] text-body",children:["\u201C",t.note,"\u201D"]}):null,i&&d?e("dl",{className:"divide-y divide-border border-t border-border bg-surface/60",children:t.changes.map(x=>a("div",{className:"grid grid-cols-[110px_1fr] items-center gap-3 px-3.5 py-2 text-[12.5px] sm:grid-cols-[140px_1fr]",children:[e("dt",{className:"truncate font-medium text-muted",children:x.field}),a("dd",{className:"flex min-w-0 flex-wrap items-center gap-1.5",children:[e("span",{className:"num rounded-[calc(5px*var(--radius-scale))] bg-danger-subtle px-1.5 py-0.5 text-danger line-through decoration-danger/50",children:x.from??l.empty}),e("span",{className:"text-muted",children:"\u2192"}),e("span",{className:"num rounded-[calc(5px*var(--radius-scale))] bg-success-subtle px-1.5 py-0.5 font-medium text-success",children:x.to??l.empty})]})]},x.field))}):null]})]},t.id)})})}function v({note:r,depth:m,onReply:o,labels:n}){const[l,s]=b.useState(m<1),[c,u]=b.useState(!1),[t,g]=b.useState(""),d=r.replies??[];return e("li",{className:"relative",children:a("div",{className:"flex gap-3",children:[e(f,{name:r.author.name,src:r.author.src,size:m?"sm":"md",className:"relative z-[1] mt-0.5 ring-4 ring-canvas"}),a("div",{className:"min-w-0 flex-1",children:[a("div",{className:p("rounded-[calc(12px*var(--radius-scale))] border px-3.5 py-2.5",r.pinned?"border-primary/30 bg-primary-subtle/40":"border-border bg-raised"),children:[a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e("span",{className:"text-[13px] font-semibold text-text",children:r.author.name}),r.author.role?e("span",{className:"text-[11.5px] text-muted",children:r.author.role}):null,r.tag?e(N,{tone:r.tag.tone??"neutral",variant:"outline",children:r.tag.label}):null,r.pinned?e(R,{className:"size-3 text-primary","aria-label":"pinned"}):null,e("time",{className:"ml-auto text-[11.5px] text-muted",children:r.at})]}),e("div",{className:"mt-1 text-[13px] leading-5 text-body",children:r.text})]}),a("div",{className:"mt-1 flex items-center gap-3 pl-1 text-[12px]",children:[o?a("button",{type:"button",onClick:()=>u(i=>!i),className:"flex cursor-pointer items-center gap-1 font-medium text-muted hover:text-primary",children:[e(y,{className:"size-3.5"})," ",n.reply]}):null,d.length?a("button",{type:"button",onClick:()=>s(i=>!i),className:"flex cursor-pointer items-center gap-1 font-medium text-primary",children:[e(w,{className:"size-3.5"})," ",l?n.hide:n.replies(d.length)]}):null]}),c&&o?a("form",{className:"mt-2 flex items-start gap-2",onSubmit:i=>{i.preventDefault(),t.trim()&&(o(r.id,t.trim()),g(""),u(!1),s(!0))},children:[e("textarea",{autoFocus:!0,value:t,onChange:i=>g(i.target.value),rows:2,placeholder:n.placeholder,className:"min-h-16 flex-1 resize-y rounded-[calc(10px*var(--radius-scale))] border border-border2 bg-raised px-3 py-2 text-[13px] text-text outline-none placeholder:text-placeholder focus:border-primary focus:ring-2 focus:ring-primary/20"}),e(z,{type:"submit",variant:"primary",size:"icon","aria-label":n.send,disabled:!t.trim(),children:e(k,{})})]}):null,d.length&&l?e("ul",{className:"relative mt-3 space-y-3 before:absolute before:-left-[22px] before:top-0 before:bottom-3 before:w-px before:bg-border",children:d.map(i=>e(v,{note:i,depth:m+1,onReply:o,labels:n},i.id))}):null]})]})})}function _({notes:r,onReply:m,labels:o,className:n}){const l={reply:"Reply",replies:c=>`${c} ${c===1?"reply":"replies"}`,hide:"Hide replies",placeholder:"Write a reply\u2026",send:"Send",...o},s=[...r].sort((c,u)=>+!!u.pinned-+!!c.pinned);return e("ul",{className:p("space-y-4",n),children:s.map(c=>e(v,{note:c,depth:0,onReply:m,labels:l},c.id))})}export{D as ActivityTimeline,O as ChangeHistory,_ as ChangeNotes};
@@ -1 +1 @@
1
- "use client";import{jsx as e,jsxs as x}from"react/jsx-runtime";import{CircleAlert as m,CircleCheck as f,Info as b,TriangleAlert as _,X as w}from"lucide-react";import*as h from"react";import{cn as t}from"../../lib/utils.js";const y={info:{c:"var(--info)",s:"var(--info-subtle)",icon:e(b,{})},success:{c:"var(--success)",s:"var(--success-subtle)",icon:e(f,{})},warning:{c:"var(--warning)",s:"var(--warning-subtle)",icon:e(_,{})},danger:{c:"var(--danger)",s:"var(--danger-subtle)",icon:e(m,{})},neutral:{c:"var(--muted)",s:"var(--hover)",icon:e(b,{})}},R={soft:{box:"border border-[color-mix(in_srgb,var(--tone)_22%,transparent)] bg-[var(--tone-subtle)]",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"},outline:{box:"border border-[color-mix(in_srgb,var(--tone)_45%,transparent)] bg-raised",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"},solid:{box:"border border-transparent bg-[var(--tone)] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.18),0_8px_20px_-10px_var(--tone)]",icon:"text-white",title:"text-white",body:"text-white/85"},accent:{box:"border border-border bg-raised pl-5 shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.04)] before:absolute before:inset-y-2.5 before:left-2 before:w-[3px] before:rounded-full before:bg-[var(--tone)]",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"}},A=h.forwardRef(({tone:o="info",variant:i="soft",title:n,icon:s,action:l,onDismiss:c,className:v,style:p,children:d,...g},u)=>{const a=y[o],r=R[i];return x("div",{ref:u,role:o==="danger"||o==="warning"?"alert":"status",style:{"--tone":a.c,"--tone-subtle":a.s,...p},className:t("relative flex gap-3 rounded-[12px] p-3.5 text-[13px] animate-[wave-in_220ms_var(--ease)]",r.box,v),...g,children:[s!==!1?e("span",{className:t("mt-px shrink-0 [&_svg]:size-[18px]",r.icon),children:s??a.icon}):null,x("div",{className:"min-w-0 flex-1",children:[n?e("p",{className:t("font-semibold leading-5",r.title),children:n}):null,d?e("div",{className:t("leading-5",n&&"mt-0.5",r.body),children:d}):null,l?e("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:l}):null]}),c?e("button",{type:"button",onClick:c,"aria-label":"Dismiss",className:t("-m-1 grid size-7 shrink-0 cursor-pointer place-items-center rounded-[7px] transition-colors [&_svg]:size-3.5",i==="solid"?"text-white/80 hover:bg-white/15 hover:text-white":"text-muted hover:bg-[color-mix(in_srgb,var(--tone)_12%,transparent)] hover:text-text"),children:e(w,{})}):null]})});A.displayName="Alert";export{A as Alert};
1
+ "use client";import{jsx as e,jsxs as x}from"react/jsx-runtime";import{CircleAlert as m,CircleCheck as f,Info as b,TriangleAlert as _,X as w}from"lucide-react";import*as h from"react";import{cn as t}from"../../lib/utils.js";const y={info:{c:"var(--info)",s:"var(--info-subtle)",icon:e(b,{})},success:{c:"var(--success)",s:"var(--success-subtle)",icon:e(f,{})},warning:{c:"var(--warning)",s:"var(--warning-subtle)",icon:e(_,{})},danger:{c:"var(--danger)",s:"var(--danger-subtle)",icon:e(m,{})},neutral:{c:"var(--muted)",s:"var(--hover)",icon:e(b,{})}},R={soft:{box:"border border-[color-mix(in_srgb,var(--tone)_22%,transparent)] bg-[var(--tone-subtle)]",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"},outline:{box:"border border-[color-mix(in_srgb,var(--tone)_45%,transparent)] bg-raised",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"},solid:{box:"border border-transparent bg-[var(--tone)] text-white shadow-[inset_0_1px_0_rgba(255,255,255,.18),0_8px_20px_-10px_var(--tone)]",icon:"text-white",title:"text-white",body:"text-white/85"},accent:{box:"border border-border bg-raised pl-5 shadow-[var(--lit),0_1px_2px_rgba(5,8,22,.04)] before:absolute before:inset-y-2.5 before:left-2 before:w-[3px] before:rounded-full before:bg-[var(--tone)]",icon:"text-[var(--tone)]",title:"text-text",body:"text-body"}},A=h.forwardRef(({tone:o="info",variant:s="soft",title:a,icon:i,action:l,onDismiss:c,className:v,style:p,children:d,...g},u)=>{const n=y[o],r=R[s];return x("div",{ref:u,role:o==="danger"||o==="warning"?"alert":"status",style:{"--tone":n.c,"--tone-subtle":n.s,...p},className:t("relative flex gap-3 rounded-[calc(12px*var(--radius-scale))] p-3.5 text-[13px] animate-[wave-in_220ms_var(--ease)]",r.box,v),...g,children:[i!==!1?e("span",{className:t("mt-px shrink-0 [&_svg]:size-[18px]",r.icon),children:i??n.icon}):null,x("div",{className:"min-w-0 flex-1",children:[a?e("p",{className:t("font-semibold leading-5",r.title),children:a}):null,d?e("div",{className:t("leading-5",a&&"mt-0.5",r.body),children:d}):null,l?e("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:l}):null]}),c?e("button",{type:"button",onClick:c,"aria-label":"Dismiss",className:t("-m-1 grid size-7 shrink-0 cursor-pointer place-items-center rounded-[calc(7px*var(--radius-scale))] transition-colors [&_svg]:size-3.5",s==="solid"?"text-white/80 hover:bg-white/15 hover:text-white":"text-muted hover:bg-[color-mix(in_srgb,var(--tone)_12%,transparent)] hover:text-text"),children:e(w,{})}):null]})});A.displayName="Alert";export{A as Alert};
@@ -1 +1 @@
1
- "use client";import{jsx as r,jsxs as o}from"react/jsx-runtime";import*as m from"@radix-ui/react-avatar";import{BadgeCheck as x}from"lucide-react";import{cn as n,initials as v}from"../../lib/utils.js";const p={sm:"size-6 text-[10px]",md:"size-8 text-xs",lg:"size-10 text-[13px]",xl:"size-14 text-[17px]","2xl":"size-20 text-[24px]"},b={sm:"size-2",md:"size-2.5",lg:"size-3",xl:"size-3.5","2xl":"size-4"},u=["linear-gradient(135deg,#1f45ea,#5b4af5)","linear-gradient(135deg,#7560fd,#a78bfa)","linear-gradient(135deg,#0891b2,#22d3ee)","linear-gradient(135deg,#047857,#10b981)","linear-gradient(135deg,#d97706,#f59e0b)","linear-gradient(135deg,#db2777,#f472b6)","linear-gradient(135deg,#1a113e,#4338ca)"];function z(e){let a=0;for(const s of e)a=a*31+s.charCodeAt(0)>>>0;return u[a%u.length]}const h={online:"bg-success",away:"bg-warning",busy:"bg-danger",offline:"bg-border2"};function k({name:e,src:a,size:s="md",status:i,verified:l,ring:t,shape:c="circle",className:f}){const d=c==="circle"?"rounded-full":"rounded-[28%]",g=o(m.Root,{className:n("relative grid shrink-0 place-items-center overflow-hidden font-semibold text-white select-none shadow-[inset_0_1px_0_rgba(255,255,255,.25)]",d,p[s],!t&&f),style:{background:z(e)},children:[a?r(m.Image,{src:a,alt:e,className:"size-full object-cover"}):null,r(m.Fallback,{className:"grid size-full place-items-center",children:v(e)})]});return!t&&!i&&!l?g:o("span",{className:n("relative inline-grid shrink-0",t&&f),children:[t?r("span",{className:n("bg-[conic-gradient(from_200deg,#1437d3,#7560fd,#22d3ee,#1437d3)] p-[2px]",d),children:r("span",{className:n("block bg-canvas p-[2px]",d),children:g})}):g,i?r("span",{className:n("absolute bottom-0 right-0 rounded-full ring-2 ring-canvas",h[i],b[s]),"aria-label":i}):null,l?r(x,{className:n("absolute -right-1 -top-1 fill-primary text-canvas",b[s]==="size-2"?"size-3":"size-4"),"aria-label":"verified"}):null]})}function S({names:e,max:a=4,size:s="sm"}){const i=e.slice(0,a),l=e.length-i.length;return o("div",{className:"flex items-center",children:[i.map((t,c)=>r(k,{name:t,size:s,className:"-ml-1.5 ring-2 ring-surface first:ml-0"},t+c)),l>0?o("span",{className:n("num -ml-1.5 grid place-items-center rounded-full bg-hover font-semibold text-muted ring-2 ring-surface",p[s]),children:["+",l]}):null]})}export{k as Avatar,S as AvatarStack};
1
+ "use client";import{jsx as t,jsxs as o}from"react/jsx-runtime";import*as m from"@radix-ui/react-avatar";import{BadgeCheck as x}from"lucide-react";import{cn as r,initials as v}from"../../lib/utils.js";const b={sm:"size-6 text-[10px]",md:"size-8 text-xs",lg:"size-10 text-[13px]",xl:"size-14 text-[17px]","2xl":"size-20 text-[24px]"},p={sm:"size-2",md:"size-2.5",lg:"size-3",xl:"size-3.5","2xl":"size-4"},u=["linear-gradient(135deg,#1f45ea,#5b4af5)","linear-gradient(135deg,#7560fd,#a78bfa)","linear-gradient(135deg,#0891b2,#22d3ee)","linear-gradient(135deg,#047857,#10b981)","linear-gradient(135deg,#d97706,#f59e0b)","linear-gradient(135deg,#db2777,#f472b6)","linear-gradient(135deg,#1a113e,#4338ca)"];function z(e){let a=0;for(const s of e)a=a*31+s.charCodeAt(0)>>>0;return u[a%u.length]}const h={online:"bg-success",away:"bg-warning",busy:"bg-danger",offline:"bg-border2"};function k({name:e,src:a,size:s="md",status:i,verified:l,ring:n,shape:c="circle",className:f}){const d=c==="circle"?"rounded-full":"rounded-[28%]",g=o(m.Root,{className:r("relative grid shrink-0 place-items-center overflow-hidden font-semibold text-white select-none shadow-[inset_0_1px_0_rgba(255,255,255,.25)]",d,b[s],!n&&f),style:{background:z(e)},children:[a?t(m.Image,{src:a,alt:e,className:"size-full object-cover"}):null,t(m.Fallback,{className:"grid size-full place-items-center",children:v(e)})]});return!n&&!i&&!l?g:o("span",{className:r("relative inline-grid shrink-0",n&&f),children:[n?t("span",{className:r("bg-[conic-gradient(from_200deg,var(--brand-1),var(--brand-2),#22d3ee,var(--brand-1))] p-[2px]",d),children:t("span",{className:r("block bg-canvas p-[2px]",d),children:g})}):g,i?t("span",{className:r("absolute bottom-0 right-0 rounded-full ring-2 ring-canvas",h[i],p[s]),"aria-label":i}):null,l?t(x,{className:r("absolute -right-1 -top-1 fill-primary text-canvas",p[s]==="size-2"?"size-3":"size-4"),"aria-label":"verified"}):null]})}function S({names:e,max:a=4,size:s="sm"}){const i=e.slice(0,a),l=e.length-i.length;return o("div",{className:"flex items-center",children:[i.map((n,c)=>t(k,{name:n,size:s,className:"-ml-1.5 ring-2 ring-surface first:ml-0"},n+c)),l>0?o("span",{className:r("num -ml-1.5 grid place-items-center rounded-full bg-hover font-semibold text-muted ring-2 ring-surface",b[s]),children:["+",l]}):null]})}export{k as Avatar,S as AvatarStack};