@devalok/shilp-sutra 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +7 -1
- package/BREAKING.json +29 -0
- package/MIGRATION.md +61 -0
- package/dist/_chunks/motion-provider.js +7 -6
- package/dist/_chunks/motion-provider.js.map +1 -1
- package/dist/_chunks/success.js +53 -53
- package/dist/ai/command-bar.js +158 -158
- package/dist/ai/command-bar.js.map +1 -1
- package/dist/ai/conversation.js +5 -5
- package/dist/composed/avatar-group.d.ts +11 -9
- package/dist/composed/avatar-group.d.ts.map +1 -1
- package/dist/composed/avatar-group.js +108 -140
- package/dist/composed/avatar-group.js.map +1 -1
- package/dist/composed/bulk-action-bar.d.ts +19 -11
- package/dist/composed/bulk-action-bar.d.ts.map +1 -1
- package/dist/composed/bulk-action-bar.js +81 -110
- package/dist/composed/bulk-action-bar.js.map +1 -1
- package/dist/composed/command-palette.js +17 -17
- package/dist/composed/command-palette.js.map +1 -1
- package/dist/composed/error-boundary.d.ts +15 -3
- package/dist/composed/error-boundary.d.ts.map +1 -1
- package/dist/composed/error-boundary.js +43 -26
- package/dist/composed/error-boundary.js.map +1 -1
- package/dist/composed/loading-skeleton.d.ts +2 -0
- package/dist/composed/loading-skeleton.d.ts.map +1 -1
- package/dist/composed/loading-skeleton.js +79 -56
- package/dist/composed/loading-skeleton.js.map +1 -1
- package/dist/composed/master-detail.d.ts +21 -8
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +91 -77
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/page-skeletons.d.ts +6 -0
- package/dist/composed/page-skeletons.d.ts.map +1 -1
- package/dist/composed/page-skeletons.js +93 -71
- package/dist/composed/page-skeletons.js.map +1 -1
- package/dist/composed/priority-indicator.d.ts +15 -6
- package/dist/composed/priority-indicator.d.ts.map +1 -1
- package/dist/composed/priority-indicator.js +37 -88
- package/dist/composed/priority-indicator.js.map +1 -1
- package/dist/composed/schedule-view.d.ts +17 -2
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +163 -64
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/motion/motion-provider.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.d.ts +32 -6
- package/dist/shell/bottom-navbar.d.ts.map +1 -1
- package/dist/shell/bottom-navbar.js +156 -129
- package/dist/shell/bottom-navbar.js.map +1 -1
- package/dist/shell/index.d.ts +5 -3
- package/dist/shell/index.d.ts.map +1 -1
- package/dist/shell/index.js +2 -3
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +2 -0
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/tokens/primitives.css +6 -2
- package/dist/tokens/utilities.css +6 -0
- package/dist/ui/autocomplete.d.ts +34 -32
- package/dist/ui/autocomplete.d.ts.map +1 -1
- package/dist/ui/autocomplete.js +115 -110
- package/dist/ui/autocomplete.js.map +1 -1
- package/dist/ui/combobox.d.ts +1 -1
- package/dist/ui/combobox.d.ts.map +1 -1
- package/dist/ui/combobox.js +133 -128
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/file-upload.d.ts.map +1 -1
- package/dist/ui/file-upload.js +124 -138
- package/dist/ui/file-upload.js.map +1 -1
- package/dist/ui/form.d.ts +7 -0
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/form.js +4 -2
- package/dist/ui/form.js.map +1 -1
- package/dist/ui/icon-button.d.ts +2 -1
- package/dist/ui/icon-button.d.ts.map +1 -1
- package/dist/ui/icon-button.js +1 -1
- package/dist/ui/icon-button.js.map +1 -1
- package/dist/ui/index.js +30 -30
- package/dist/ui/label.d.ts.map +1 -1
- package/dist/ui/label.js +7 -6
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/search-input.js +4 -4
- package/dist/ui/sidebar.js +7 -7
- package/dist/ui/spinner.d.ts.map +1 -1
- package/dist/ui/spinner.js +50 -44
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/switch.d.ts.map +1 -1
- package/dist/ui/switch.js +24 -24
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.js +1 -1
- package/dist/ui/table.js.map +1 -1
- package/docs/components/composed/bulk-action-bar.md +9 -3
- package/docs/components/composed/error-boundary.md +18 -2
- package/docs/components/composed/master-detail.md +12 -2
- package/docs/components/composed/page-skeletons.md +2 -2
- package/docs/components/composed/priority-indicator.md +22 -11
- package/docs/components/composed/rich-chat-input.md +18 -6
- package/docs/components/composed/schedule-view.md +20 -5
- package/docs/components/composed/simple-tooltip.md +1 -1
- package/docs/components/shell/app-command-palette.md +2 -1
- package/docs/components/shell/bottom-navbar.md +28 -9
- package/docs/components/shell/command-registry.md +2 -2
- package/docs/components/shell/link-context.md +2 -2
- package/docs/components/shell/top-bar.md +1 -1
- package/docs/components/ui/autocomplete.md +26 -10
- package/docs/components/ui/search-input.md +2 -2
- package/docs/components/ui/slider.md +2 -2
- package/docs/components/ui/split-button.md +3 -3
- package/llms.txt +2 -2
- package/make-kit/Guidelines.md +1 -1
- package/make-kit/components/overview.md +2 -2
- package/make-kit/foundations/surfaces.md +1 -1
- package/mcp-manifest.json +581 -172
- package/package.json +1 -6
- package/skill/SKILL.md +1 -1
- package/skill/chat-skill/README.md +18 -0
- package/skill/chat-skill/SKILL.md +78 -0
- package/skill/chat-skill/chatgpt-instructions.md +26 -0
- package/skill/chat-skill/gemini-instructions.md +25 -0
- package/skill/references/components.md +2 -2
- package/dist/shell/sidebar.d.ts +0 -113
- package/dist/shell/sidebar.d.ts.map +0 -1
- package/dist/shell/sidebar.js +0 -293
- package/dist/shell/sidebar.js.map +0 -1
- package/docs/components/shell/sidebar.md +0 -103
package/AGENTS.md
CHANGED
|
@@ -43,7 +43,7 @@ Read these local files. Your training data is outdated and will hallucinate APIs
|
|
|
43
43
|
### MCP tools
|
|
44
44
|
|
|
45
45
|
<!-- BEGIN:mcp-tools --><!-- generated by scripts/generate-tool-list.mjs — do not edit by hand -->
|
|
46
|
-
|
|
46
|
+
_17 tools (source: `packages/mcp-server/src/index.mjs`):_
|
|
47
47
|
|
|
48
48
|
**Reference:**
|
|
49
49
|
- `find_component` — Search shilp-sutra components by keyword (authoritative component index).
|
|
@@ -63,8 +63,14 @@ _13 tools (source: `packages/mcp-server/src/index.mjs`):_
|
|
|
63
63
|
**Quality:**
|
|
64
64
|
- `check_slop` — Pre-emit DESIGN-QUALITY gate (complements validate_snippet, which checks correctness).
|
|
65
65
|
|
|
66
|
+
**Presets:**
|
|
67
|
+
- `get_preset` — Full detail for one preset: the shadcn registry-item (dependencies, files, docs), plus the exact install steps — the components.json `registries` snippet to…
|
|
68
|
+
- `list_presets` — Discover the shilp-sutra Preset Library — pre-assembled real-world screens (sidebars, dashboards, auth) built FROM shilp-sutra components.
|
|
69
|
+
- `preview_preset` — READ-ONLY TSX source of a preset (+ its GitHub source URL), so you can show it, learn the composition, or adapt it inline WITHOUT installing.
|
|
70
|
+
|
|
66
71
|
**Write:**
|
|
67
72
|
- `report_issue` — File a bug report, feature request, suggestion, or docs-gap on the shilp-sutra repo when you hit a wall using the design system.
|
|
73
|
+
- `submit_entry` — Submit an entry to Build with Shilp Sutra, the online buildathon by Devalok.
|
|
68
74
|
<!-- END:mcp-tools -->
|
|
69
75
|
|
|
70
76
|
### Setting up in a new project (do this in order)
|
package/BREAKING.json
CHANGED
|
@@ -321,6 +321,35 @@
|
|
|
321
321
|
"ScheduleView: the ScheduleEvent `color` value \"primary\" was renamed \"accent\" (matches the DS colour vocabulary). Migrate { color: 'primary' } → { color: 'accent' }. It was the default, so untyped events are unaffected. Also added focus-visible rings on slot/event buttons.",
|
|
322
322
|
"New `Dot` primitive (@devalok/shilp-sutra/ui/dot) — the shared indicator dot. StatusBadge composes Badge + Dot; StatusDot and Badge's `dot` prop now render Dot internally. No API change to StatusBadge/StatusDot/Badge props (Badge's dot pulse animation shifted from a bespoke ripple to Dot's ping). StatusDot's `inactive` shade is now neutral-8 (was neutral-6)."
|
|
323
323
|
]
|
|
324
|
+
},
|
|
325
|
+
"0.54.0": {
|
|
326
|
+
"summary": "AppSidebar removed — the config-driven shell sidebar is retired in favour of composable Sidebar primitives (@devalok/shilp-sutra/ui/sidebar) + the copy-and-own sidebar-app preset.",
|
|
327
|
+
"migrationDoc": "MIGRATION.md#v0540--appsidebar-removed",
|
|
328
|
+
"removed": [
|
|
329
|
+
{
|
|
330
|
+
"symbol": "AppSidebar",
|
|
331
|
+
"where": "@devalok/shilp-sutra/shell/sidebar and the /shell barrel",
|
|
332
|
+
"replacement": "Compose the Sidebar primitives from @devalok/shilp-sutra/ui/sidebar, or install the sidebar-app preset (npx shadcn@latest add @devalok/sidebar-app; gallery at https://shilp-sutra.devalok.in/presets). The preset reproduces AppSidebar's shape as ownable source."
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"symbol": "AppSidebarProps",
|
|
336
|
+
"where": "@devalok/shilp-sutra/shell/sidebar and the /shell barrel"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"symbol": "NavGroup, NavItem, NavSubItem, SidebarUser, SidebarPromo, SidebarFooterConfig",
|
|
340
|
+
"where": "@devalok/shilp-sutra/shell/sidebar (AppSidebar config types)"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"symbol": "./shell/sidebar",
|
|
344
|
+
"where": "package.json exports (subpath removed)",
|
|
345
|
+
"replacement": "@devalok/shilp-sutra/ui/sidebar for the primitives"
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"notes": [
|
|
349
|
+
"The Sidebar PRIMITIVES (@devalok/shilp-sutra/ui/sidebar — Sidebar, SidebarProvider, SidebarMenu, SidebarMenuSub*, SidebarMenuBadge, SidebarGroupAction, etc.) are unchanged. Only the config-driven AppSidebar wrapper on top of them is removed.",
|
|
350
|
+
"Fastest migration: `npx shadcn@latest add @devalok/sidebar-app`, then replace <AppSidebar navGroups={…} user={…} currentPath={…} /> with the pasted <SidebarApp/>, wiring your router Link + active path. Composing @devalok/shilp-sutra/ui/sidebar directly is equally valid and needs no registry.",
|
|
351
|
+
"Deprecation cycle: no PUBLISHED version carried an @deprecated AppSidebar — 0.53.0 shipped it undeprecated, 0.54.0 removes it. The deprecation marker existed only within the unreleased 0.54.0 line. This is a deliberate call for a 0.x beta with a single coordinated consumer (breaking changes ship in 0.x minors); a post-1.0 removal would get a real deprecate→remove window."
|
|
352
|
+
]
|
|
324
353
|
}
|
|
325
354
|
}
|
|
326
355
|
}
|
package/MIGRATION.md
CHANGED
|
@@ -4,6 +4,67 @@ This page indexes all breaking changes across `@devalok/shilp-sutra` versions. F
|
|
|
4
4
|
|
|
5
5
|
> **Upgrading from < 0.36?** Start here, then read each intermediate version section. Breaking changes stack — skipping versions means stacking migrations.
|
|
6
6
|
|
|
7
|
+
## v0.54.0 — AppSidebar removed
|
|
8
|
+
|
|
9
|
+
**Breaking.** The config-driven `AppSidebar` shell component is removed. It was a
|
|
10
|
+
convenience wrapper over the `Sidebar` primitives; those **primitives are
|
|
11
|
+
unchanged** (`@devalok/shilp-sutra/ui/sidebar`). Only the wrapper — and its config
|
|
12
|
+
types and subpath export — are gone.
|
|
13
|
+
|
|
14
|
+
**Removed**
|
|
15
|
+
|
|
16
|
+
| Symbol | Was at |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `AppSidebar`, `AppSidebarProps` | `@devalok/shilp-sutra/shell/sidebar` + the `/shell` barrel |
|
|
19
|
+
| `NavGroup`, `NavItem`, `NavSubItem`, `SidebarUser`, `SidebarPromo`, `SidebarFooterConfig` | `@devalok/shilp-sutra/shell/sidebar` (AppSidebar config types) |
|
|
20
|
+
| `@devalok/shilp-sutra/shell/sidebar` (subpath export) | — |
|
|
21
|
+
|
|
22
|
+
**Migrate — option A (fastest): install the `sidebar-app` preset.** It reproduces
|
|
23
|
+
AppSidebar's shape (logo, grouped nav, collapsible sub-items, badges, group `+`
|
|
24
|
+
action, user footer) as source you own and edit.
|
|
25
|
+
|
|
26
|
+
Register the registry once in `components.json`:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{ "registries": { "@devalok": "https://shilp-sutra.devalok.in/r/{name}.json" } }
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx shadcn@latest add @devalok/sidebar-app
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Replace the wrapper with the pasted component, wiring your router:
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
// Before
|
|
42
|
+
import { AppSidebar } from '@devalok/shilp-sutra/shell/sidebar'
|
|
43
|
+
<AppSidebar navGroups={groups} user={user} currentPath={pathname} />
|
|
44
|
+
|
|
45
|
+
// After — you own SidebarApp; edit the markup directly
|
|
46
|
+
import { SidebarApp } from '@/components/devalok/sidebar-app/sidebar-app'
|
|
47
|
+
<SidebarApp />
|
|
48
|
+
// In SidebarApp: swap <a> for next/link and CURRENT_PATH for usePathname().
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Other shapes: `@devalok/sidebar-projects`, `@devalok/sidebar-client`,
|
|
52
|
+
`@devalok/sidebar-minimal`. Gallery: <https://shilp-sutra.devalok.in/presets>.
|
|
53
|
+
|
|
54
|
+
**Migrate — option B: compose the primitives directly** from
|
|
55
|
+
`@devalok/shilp-sutra/ui/sidebar` (`Sidebar`, `SidebarProvider`, `SidebarMenu`,
|
|
56
|
+
`SidebarMenuButton`, `SidebarMenuSub*`, `SidebarMenuBadge`, `SidebarGroupAction`,
|
|
57
|
+
…). The preset in option A is itself a worked example of this.
|
|
58
|
+
|
|
59
|
+
> Requires `@devalok/shilp-sutra` installed and its CSS imported
|
|
60
|
+
> (`@import "@devalok/shilp-sutra/css";`). framer-motion ^12 is a required peer.
|
|
61
|
+
|
|
62
|
+
## v0.53.0 — additive (no migration required)
|
|
63
|
+
|
|
64
|
+
Nothing breaks at the TypeScript level; this release is additive.
|
|
65
|
+
|
|
66
|
+
> Auto-stubbed by `version-packages` so the release audit's MIGRATION-section gate can't block. If any behavioral or visual change needs consumer action, replace this stub with the specifics on the Version Packages PR before publishing.
|
|
67
|
+
|
|
7
68
|
## v0.52.0 — additive (no migration required)
|
|
8
69
|
|
|
9
70
|
Nothing breaks at the TypeScript level; this release is additive.
|
|
@@ -4,11 +4,7 @@ import * as n from "react";
|
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import { MotionConfig as i, useReducedMotion as a } from "framer-motion";
|
|
6
6
|
//#region src/motion/motion-provider.tsx
|
|
7
|
-
var o = n.createContext(
|
|
8
|
-
springs: e,
|
|
9
|
-
tweens: t,
|
|
10
|
-
reducedMotion: !1
|
|
11
|
-
});
|
|
7
|
+
var o = n.createContext(null);
|
|
12
8
|
function s({ children: s, reducedMotion: c = "user" }) {
|
|
13
9
|
let l = a() ?? !1, u = c === "user" ? l : c, d = n.useMemo(() => ({
|
|
14
10
|
springs: e,
|
|
@@ -24,7 +20,12 @@ function s({ children: s, reducedMotion: c = "user" }) {
|
|
|
24
20
|
});
|
|
25
21
|
}
|
|
26
22
|
function c() {
|
|
27
|
-
|
|
23
|
+
let r = n.useContext(o), i = a() ?? !1;
|
|
24
|
+
return r || {
|
|
25
|
+
springs: e,
|
|
26
|
+
tweens: t,
|
|
27
|
+
reducedMotion: i
|
|
28
|
+
};
|
|
28
29
|
}
|
|
29
30
|
//#endregion
|
|
30
31
|
export { s as MotionProvider, c as useMotion };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motion-provider.js","names":[],"sources":["../../src/motion/motion-provider.tsx"],"sourcesContent":["'use client'\n\nimport { MotionConfig, useReducedMotion as useFMReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from '../ui/lib/motion'\n\ntype ReducedMotionMode = 'user' | boolean\n\ntype MotionContextValue = {\n springs: typeof springs\n tweens: typeof tweens\n reducedMotion: boolean\n}\n\nconst MotionContext = React.createContext<MotionContextValue>(
|
|
1
|
+
{"version":3,"file":"motion-provider.js","names":[],"sources":["../../src/motion/motion-provider.tsx"],"sourcesContent":["'use client'\n\nimport { MotionConfig, useReducedMotion as useFMReducedMotion } from 'framer-motion'\nimport * as React from 'react'\n\nimport { springs, tweens } from '../ui/lib/motion'\n\ntype ReducedMotionMode = 'user' | boolean\n\ntype MotionContextValue = {\n springs: typeof springs\n tweens: typeof tweens\n reducedMotion: boolean\n}\n\n// `null` default = \"no MotionProvider mounted\". `useMotion()` detects this and\n// falls back to the OS `prefers-reduced-motion` setting, so components respect\n// reduced motion out of the box — a provider is an override, not a requirement.\nconst MotionContext = React.createContext<MotionContextValue | null>(null)\n\ntype MotionProviderProps = {\n children: React.ReactNode\n /** 'user' = detect OS preference, true = force off, false = force on */\n reducedMotion?: ReducedMotionMode\n}\n\nfunction MotionProvider({ children, reducedMotion = 'user' }: MotionProviderProps) {\n const osPreference = useFMReducedMotion() ?? false\n const isReduced = reducedMotion === 'user' ? osPreference : reducedMotion\n\n const value = React.useMemo<MotionContextValue>(\n () => ({ springs, tweens, reducedMotion: isReduced }),\n [isReduced],\n )\n\n return (\n <MotionContext.Provider value={value}>\n <MotionConfig reducedMotion={reducedMotion === 'user' ? 'user' : reducedMotion ? 'always' : 'never'}>\n {children}\n </MotionConfig>\n </MotionContext.Provider>\n )\n}\n\nfunction useMotion(): MotionContextValue {\n const ctx = React.useContext(MotionContext)\n // Always called (hook order stable); only used when no provider is mounted.\n const osPreference = useFMReducedMotion() ?? false\n if (ctx) return ctx\n return { springs, tweens, reducedMotion: osPreference }\n}\n\nexport { MotionProvider, type MotionProviderProps,useMotion }\n"],"mappings":";;;;;AAkBA,IAAM,IAAgB,EAAM,cAAyC,IAAI;AAQzE,SAAS,EAAe,EAAE,aAAU,mBAAgB,UAA+B;CACjF,IAAM,IAAe,EAAmB,KAAK,IACvC,IAAY,MAAkB,SAAS,IAAe,GAEtD,IAAQ,EAAM,eACX;EAAE;EAAS;EAAQ,eAAe;CAAU,IACnD,CAAC,CAAS,CACZ;CAEA,OACE,kBAAC,EAAc,UAAf;EAA+B;YAC7B,kBAAC,GAAD;GAAc,eAAe,MAAkB,SAAS,SAAS,IAAgB,WAAW;GACzF;EACW,CAAA;CACQ,CAAA;AAE5B;AAEA,SAAS,IAAgC;CACvC,IAAM,IAAM,EAAM,WAAW,CAAa,GAEpC,IAAe,EAAmB,KAAK;CAE7C,OADI,KACG;EAAE;EAAS;EAAQ,eAAe;CAAa;AACxD"}
|
package/dist/_chunks/success.js
CHANGED
|
@@ -3,14 +3,14 @@ import { durations as e, springs as t, tweens as n } from "../ui/lib/motion.js";
|
|
|
3
3
|
import { cn as r } from "../ui/lib/utils.js";
|
|
4
4
|
import { Icon as i } from "../ui/icon.js";
|
|
5
5
|
import { Alert as a } from "../ui/alert.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
6
|
+
import { useMotion as o } from "./motion-provider.js";
|
|
7
|
+
import { Skeleton as s } from "../ui/skeleton.js";
|
|
8
|
+
import { BadgeCompound as c } from "./badge-group.js";
|
|
9
|
+
import { Button as l } from "../ui/button.js";
|
|
10
|
+
import { Collapsible as u, CollapsibleContent as d, CollapsibleTrigger as f } from "../ui/collapsible.js";
|
|
11
|
+
import { Table as p, TableBody as m, TableCaption as h, TableCell as g, TableHead as _, TableHeader as v, TableRow as y } from "../ui/table.js";
|
|
12
|
+
import { Separator as b } from "../ui/separator.js";
|
|
13
|
+
import { StatCard as x } from "../ui/stat-card.js";
|
|
14
14
|
import { BlockShell as S } from "./block-shell.js";
|
|
15
15
|
import * as C from "react";
|
|
16
16
|
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
@@ -21,14 +21,14 @@ function A(e, t) {
|
|
|
21
21
|
if (t.variant === "badge") {
|
|
22
22
|
if (e && typeof e == "object" && "label" in e) {
|
|
23
23
|
let t = e;
|
|
24
|
-
return /* @__PURE__ */ w(
|
|
24
|
+
return /* @__PURE__ */ w(c, {
|
|
25
25
|
variant: "subtle",
|
|
26
26
|
size: "sm",
|
|
27
27
|
color: t.color,
|
|
28
28
|
children: t.label
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
return /* @__PURE__ */ w(
|
|
31
|
+
return /* @__PURE__ */ w(c, {
|
|
32
32
|
variant: "subtle",
|
|
33
33
|
size: "sm",
|
|
34
34
|
children: String(e ?? "")
|
|
@@ -45,38 +45,38 @@ function j(e, t, n) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
var M = C.memo(function({ data: e, confidence: n }) {
|
|
48
|
-
let { reducedMotion: i } =
|
|
49
|
-
e.sortable && (a === t ?
|
|
48
|
+
let { reducedMotion: i } = o(), [a, s] = C.useState(null), [c, l] = C.useState(null), u = C.useCallback((t) => {
|
|
49
|
+
e.sortable && (a === t ? c === "asc" ? l("desc") : c === "desc" && (s(null), l(null)) : (s(t), l("asc")));
|
|
50
50
|
}, [
|
|
51
51
|
e.sortable,
|
|
52
52
|
a,
|
|
53
|
-
|
|
54
|
-
]),
|
|
53
|
+
c
|
|
54
|
+
]), d = e.columns ?? [], f = j(e.rows ?? [], a, c);
|
|
55
55
|
return /* @__PURE__ */ w(S, {
|
|
56
56
|
confidence: n,
|
|
57
57
|
className: "overflow-x-auto",
|
|
58
|
-
children: /* @__PURE__ */ T(
|
|
59
|
-
e.caption && /* @__PURE__ */ w(
|
|
60
|
-
/* @__PURE__ */ w(
|
|
61
|
-
let n = a === t.key, i = e.sortable ? n ?
|
|
62
|
-
return /* @__PURE__ */ w(
|
|
58
|
+
children: /* @__PURE__ */ T(p, { children: [
|
|
59
|
+
e.caption && /* @__PURE__ */ w(h, { children: e.caption }),
|
|
60
|
+
/* @__PURE__ */ w(v, { children: /* @__PURE__ */ w(y, { children: d.map((t) => {
|
|
61
|
+
let n = a === t.key, i = e.sortable ? n ? c === "asc" ? "ascending" : "descending" : "none" : void 0;
|
|
62
|
+
return /* @__PURE__ */ w(_, {
|
|
63
63
|
role: "columnheader",
|
|
64
64
|
className: r(t.variant === "number" && "text-right", e.sortable && "cursor-pointer select-none"),
|
|
65
65
|
tabIndex: e.sortable ? 0 : void 0,
|
|
66
|
-
onClick: e.sortable ? () =>
|
|
66
|
+
onClick: e.sortable ? () => u(t.key) : void 0,
|
|
67
67
|
onKeyDown: e.sortable ? (e) => {
|
|
68
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
68
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), u(t.key));
|
|
69
69
|
} : void 0,
|
|
70
70
|
"aria-sort": i,
|
|
71
71
|
children: /* @__PURE__ */ T("span", {
|
|
72
72
|
className: "inline-flex items-center gap-1",
|
|
73
73
|
children: [
|
|
74
74
|
t.label,
|
|
75
|
-
n &&
|
|
75
|
+
n && c === "asc" && /* @__PURE__ */ w("span", {
|
|
76
76
|
"aria-hidden": "true",
|
|
77
77
|
children: "▲"
|
|
78
78
|
}),
|
|
79
|
-
n &&
|
|
79
|
+
n && c === "desc" && /* @__PURE__ */ w("span", {
|
|
80
80
|
"aria-hidden": "true",
|
|
81
81
|
children: "▼"
|
|
82
82
|
})
|
|
@@ -84,7 +84,7 @@ var M = C.memo(function({ data: e, confidence: n }) {
|
|
|
84
84
|
})
|
|
85
85
|
}, t.key);
|
|
86
86
|
}) }) }),
|
|
87
|
-
/* @__PURE__ */ w(
|
|
87
|
+
/* @__PURE__ */ w(m, { children: f.map((e, n) => {
|
|
88
88
|
let a = typeof e.id == "string" || typeof e.id == "number" ? String(e.id) : `row-${n}`;
|
|
89
89
|
return /* @__PURE__ */ w(i ? "tr" : k.tr, {
|
|
90
90
|
className: "hover:bg-surface-raised-hover transition-colors",
|
|
@@ -102,7 +102,7 @@ var M = C.memo(function({ data: e, confidence: n }) {
|
|
|
102
102
|
delay: n * .03
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
|
-
children:
|
|
105
|
+
children: d.map((t) => /* @__PURE__ */ w(g, {
|
|
106
106
|
className: r("text-body-sm py-ds-02b px-ds-04", t.variant === "number" && "text-right tabular-nums font-medium"),
|
|
107
107
|
children: A(e[t.key], t)
|
|
108
108
|
}, t.key))
|
|
@@ -129,27 +129,27 @@ var N = C.memo(function({ data: e, confidence: t, onAction: n }) {
|
|
|
129
129
|
}),
|
|
130
130
|
/* @__PURE__ */ T("div", {
|
|
131
131
|
className: "flex items-center gap-3",
|
|
132
|
-
children: [/* @__PURE__ */ w(
|
|
132
|
+
children: [/* @__PURE__ */ w(l, {
|
|
133
133
|
variant: "solid",
|
|
134
134
|
color: e.destructive ? "error" : void 0,
|
|
135
135
|
onClick: r,
|
|
136
136
|
children: e.label
|
|
137
|
-
}), /* @__PURE__ */ w(
|
|
137
|
+
}), /* @__PURE__ */ w(l, {
|
|
138
138
|
variant: "ghost",
|
|
139
139
|
onClick: i,
|
|
140
140
|
children: "Cancel"
|
|
141
141
|
})]
|
|
142
142
|
}),
|
|
143
|
-
e.rationale && /* @__PURE__ */ T(
|
|
143
|
+
e.rationale && /* @__PURE__ */ T(u, {
|
|
144
144
|
className: "mt-3",
|
|
145
|
-
children: [/* @__PURE__ */ w(
|
|
145
|
+
children: [/* @__PURE__ */ w(f, {
|
|
146
146
|
asChild: !0,
|
|
147
147
|
children: /* @__PURE__ */ w("button", {
|
|
148
148
|
type: "button",
|
|
149
149
|
className: "text-caption text-surface-fg-subtle underline cursor-pointer",
|
|
150
150
|
children: "Why this action?"
|
|
151
151
|
})
|
|
152
|
-
}), /* @__PURE__ */ w(
|
|
152
|
+
}), /* @__PURE__ */ w(d, { children: /* @__PURE__ */ w("p", {
|
|
153
153
|
className: "text-body-sm text-surface-fg-muted mt-2 p-3 bg-surface-raised rounded-surface",
|
|
154
154
|
children: e.rationale
|
|
155
155
|
}) })]
|
|
@@ -161,13 +161,13 @@ N.displayName = "ConfirmBlock";
|
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region src/ai/blocks/divider.tsx
|
|
163
163
|
var P = C.memo(function(e) {
|
|
164
|
-
let { reducedMotion: t } =
|
|
165
|
-
return t ? /* @__PURE__ */ w(
|
|
164
|
+
let { reducedMotion: t } = o();
|
|
165
|
+
return t ? /* @__PURE__ */ w(b, {}) : /* @__PURE__ */ w(k.div, {
|
|
166
166
|
initial: { scaleX: 0 },
|
|
167
167
|
animate: { scaleX: 1 },
|
|
168
168
|
style: { originX: .5 },
|
|
169
169
|
transition: n.elegant,
|
|
170
|
-
children: /* @__PURE__ */ w(
|
|
170
|
+
children: /* @__PURE__ */ w(b, {})
|
|
171
171
|
});
|
|
172
172
|
});
|
|
173
173
|
P.displayName = "DividerBlock";
|
|
@@ -227,7 +227,7 @@ function L({ status: e }) {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
var R = C.memo(function({ data: t }) {
|
|
230
|
-
let { reducedMotion: n } =
|
|
230
|
+
let { reducedMotion: n } = o(), i = n;
|
|
231
231
|
if (t.lines != null) {
|
|
232
232
|
let e = Math.max(1, t.lines);
|
|
233
233
|
return /* @__PURE__ */ T("div", {
|
|
@@ -235,7 +235,7 @@ var R = C.memo(function({ data: t }) {
|
|
|
235
235
|
"aria-busy": "true",
|
|
236
236
|
"aria-label": "Loading",
|
|
237
237
|
className: "flex flex-col gap-2",
|
|
238
|
-
children: [Array.from({ length: e }).map((t, n) => /* @__PURE__ */ w(
|
|
238
|
+
children: [Array.from({ length: e }).map((t, n) => /* @__PURE__ */ w(s, {
|
|
239
239
|
animation: "shimmer",
|
|
240
240
|
className: r("h-4", n === e - 1 ? "w-3/5" : "w-full")
|
|
241
241
|
}, n)), /* @__PURE__ */ w("span", {
|
|
@@ -285,7 +285,7 @@ R.displayName = "LoadingBlock";
|
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/ai/blocks/stat-row.tsx
|
|
287
287
|
var z = C.memo(function({ data: e }) {
|
|
288
|
-
let { reducedMotion: n } =
|
|
288
|
+
let { reducedMotion: n } = o(), r = e.stats ?? [];
|
|
289
289
|
return r.length === 0 ? null : /* @__PURE__ */ w("div", {
|
|
290
290
|
className: "flex flex-wrap gap-ds-05",
|
|
291
291
|
children: r.map((e, r) => {
|
|
@@ -295,7 +295,7 @@ var z = C.memo(function({ data: e }) {
|
|
|
295
295
|
} : void 0;
|
|
296
296
|
return n ? /* @__PURE__ */ w("div", {
|
|
297
297
|
className: "flex-1 min-w-[140px]",
|
|
298
|
-
children: /* @__PURE__ */ w(
|
|
298
|
+
children: /* @__PURE__ */ w(x, {
|
|
299
299
|
label: e.label,
|
|
300
300
|
value: e.value,
|
|
301
301
|
delta: i
|
|
@@ -311,7 +311,7 @@ var z = C.memo(function({ data: e }) {
|
|
|
311
311
|
...t.responsive,
|
|
312
312
|
delay: r * .08
|
|
313
313
|
},
|
|
314
|
-
children: /* @__PURE__ */ w(
|
|
314
|
+
children: /* @__PURE__ */ w(x, {
|
|
315
315
|
label: e.label,
|
|
316
316
|
value: e.value,
|
|
317
317
|
delta: i
|
|
@@ -324,20 +324,20 @@ z.displayName = "StatRowBlock";
|
|
|
324
324
|
//#endregion
|
|
325
325
|
//#region src/ai/blocks/success.tsx
|
|
326
326
|
var B = 5e3, V = C.memo(function({ data: e, blockId: t, confidence: n, onAction: r }) {
|
|
327
|
-
let { reducedMotion: i } =
|
|
327
|
+
let { reducedMotion: i } = o(), s = i, c = e.undoTimeout ?? B, [u, d] = C.useState(c), [f, p] = C.useState(!!e.undoable);
|
|
328
328
|
C.useEffect(() => {
|
|
329
329
|
if (!e.undoable) return;
|
|
330
330
|
let t = setInterval(() => {
|
|
331
|
-
|
|
331
|
+
d((e) => {
|
|
332
332
|
let n = e - 100;
|
|
333
|
-
return n <= 0 ? (clearInterval(t),
|
|
333
|
+
return n <= 0 ? (clearInterval(t), p(!1), 0) : n;
|
|
334
334
|
});
|
|
335
335
|
}, 100);
|
|
336
336
|
return () => clearInterval(t);
|
|
337
|
-
}, [e.undoable,
|
|
338
|
-
let
|
|
337
|
+
}, [e.undoable, c]);
|
|
338
|
+
let m = C.useCallback(() => {
|
|
339
339
|
r?.(t || "unknown", "undo");
|
|
340
|
-
}, [t, r]),
|
|
340
|
+
}, [t, r]), h = Math.ceil(u / 1e3), g = 2 * Math.PI * 9;
|
|
341
341
|
return /* @__PURE__ */ T(S, {
|
|
342
342
|
confidence: n,
|
|
343
343
|
children: [/* @__PURE__ */ w(a, {
|
|
@@ -345,13 +345,13 @@ var B = 5e3, V = C.memo(function({ data: e, blockId: t, confidence: n, onAction:
|
|
|
345
345
|
variant: "subtle",
|
|
346
346
|
title: e.title,
|
|
347
347
|
children: e.message
|
|
348
|
-
}),
|
|
348
|
+
}), f && e.undoable && /* @__PURE__ */ w("div", {
|
|
349
349
|
className: "mt-2 flex items-center gap-2",
|
|
350
|
-
children: /* @__PURE__ */ w(
|
|
350
|
+
children: /* @__PURE__ */ w(l, {
|
|
351
351
|
variant: "ghost",
|
|
352
352
|
size: "sm",
|
|
353
|
-
onClick:
|
|
354
|
-
"aria-label": `Undo action, ${
|
|
353
|
+
onClick: m,
|
|
354
|
+
"aria-label": `Undo action, ${h} seconds remaining`,
|
|
355
355
|
children: /* @__PURE__ */ T("span", {
|
|
356
356
|
className: "flex items-center gap-1.5",
|
|
357
357
|
children: [/* @__PURE__ */ T("svg", {
|
|
@@ -375,11 +375,11 @@ var B = 5e3, V = C.memo(function({ data: e, blockId: t, confidence: n, onAction:
|
|
|
375
375
|
fill: "none",
|
|
376
376
|
stroke: "currentColor",
|
|
377
377
|
strokeWidth: 2,
|
|
378
|
-
strokeDasharray:
|
|
379
|
-
initial:
|
|
380
|
-
animate: { strokeDashoffset:
|
|
381
|
-
transition:
|
|
382
|
-
duration:
|
|
378
|
+
strokeDasharray: g,
|
|
379
|
+
initial: s ? void 0 : { strokeDashoffset: 0 },
|
|
380
|
+
animate: { strokeDashoffset: g },
|
|
381
|
+
transition: s ? { duration: 0 } : {
|
|
382
|
+
duration: c / 1e3,
|
|
383
383
|
ease: "linear"
|
|
384
384
|
}
|
|
385
385
|
})]
|