@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.
Files changed (123) hide show
  1. package/AGENTS.md +7 -1
  2. package/BREAKING.json +29 -0
  3. package/MIGRATION.md +61 -0
  4. package/dist/_chunks/motion-provider.js +7 -6
  5. package/dist/_chunks/motion-provider.js.map +1 -1
  6. package/dist/_chunks/success.js +53 -53
  7. package/dist/ai/command-bar.js +158 -158
  8. package/dist/ai/command-bar.js.map +1 -1
  9. package/dist/ai/conversation.js +5 -5
  10. package/dist/composed/avatar-group.d.ts +11 -9
  11. package/dist/composed/avatar-group.d.ts.map +1 -1
  12. package/dist/composed/avatar-group.js +108 -140
  13. package/dist/composed/avatar-group.js.map +1 -1
  14. package/dist/composed/bulk-action-bar.d.ts +19 -11
  15. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  16. package/dist/composed/bulk-action-bar.js +81 -110
  17. package/dist/composed/bulk-action-bar.js.map +1 -1
  18. package/dist/composed/command-palette.js +17 -17
  19. package/dist/composed/command-palette.js.map +1 -1
  20. package/dist/composed/error-boundary.d.ts +15 -3
  21. package/dist/composed/error-boundary.d.ts.map +1 -1
  22. package/dist/composed/error-boundary.js +43 -26
  23. package/dist/composed/error-boundary.js.map +1 -1
  24. package/dist/composed/loading-skeleton.d.ts +2 -0
  25. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  26. package/dist/composed/loading-skeleton.js +79 -56
  27. package/dist/composed/loading-skeleton.js.map +1 -1
  28. package/dist/composed/master-detail.d.ts +21 -8
  29. package/dist/composed/master-detail.d.ts.map +1 -1
  30. package/dist/composed/master-detail.js +91 -77
  31. package/dist/composed/master-detail.js.map +1 -1
  32. package/dist/composed/page-skeletons.d.ts +6 -0
  33. package/dist/composed/page-skeletons.d.ts.map +1 -1
  34. package/dist/composed/page-skeletons.js +93 -71
  35. package/dist/composed/page-skeletons.js.map +1 -1
  36. package/dist/composed/priority-indicator.d.ts +15 -6
  37. package/dist/composed/priority-indicator.d.ts.map +1 -1
  38. package/dist/composed/priority-indicator.js +37 -88
  39. package/dist/composed/priority-indicator.js.map +1 -1
  40. package/dist/composed/schedule-view.d.ts +17 -2
  41. package/dist/composed/schedule-view.d.ts.map +1 -1
  42. package/dist/composed/schedule-view.js +163 -64
  43. package/dist/composed/schedule-view.js.map +1 -1
  44. package/dist/motion/motion-provider.d.ts.map +1 -1
  45. package/dist/shell/bottom-navbar.d.ts +32 -6
  46. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  47. package/dist/shell/bottom-navbar.js +156 -129
  48. package/dist/shell/bottom-navbar.js.map +1 -1
  49. package/dist/shell/index.d.ts +5 -3
  50. package/dist/shell/index.d.ts.map +1 -1
  51. package/dist/shell/index.js +2 -3
  52. package/dist/shell/notification-preferences.d.ts.map +1 -1
  53. package/dist/shell/notification-preferences.js +2 -0
  54. package/dist/shell/notification-preferences.js.map +1 -1
  55. package/dist/tokens/primitives.css +6 -2
  56. package/dist/tokens/utilities.css +6 -0
  57. package/dist/ui/autocomplete.d.ts +34 -32
  58. package/dist/ui/autocomplete.d.ts.map +1 -1
  59. package/dist/ui/autocomplete.js +115 -110
  60. package/dist/ui/autocomplete.js.map +1 -1
  61. package/dist/ui/combobox.d.ts +1 -1
  62. package/dist/ui/combobox.d.ts.map +1 -1
  63. package/dist/ui/combobox.js +133 -128
  64. package/dist/ui/combobox.js.map +1 -1
  65. package/dist/ui/file-upload.d.ts.map +1 -1
  66. package/dist/ui/file-upload.js +124 -138
  67. package/dist/ui/file-upload.js.map +1 -1
  68. package/dist/ui/form.d.ts +7 -0
  69. package/dist/ui/form.d.ts.map +1 -1
  70. package/dist/ui/form.js +4 -2
  71. package/dist/ui/form.js.map +1 -1
  72. package/dist/ui/icon-button.d.ts +2 -1
  73. package/dist/ui/icon-button.d.ts.map +1 -1
  74. package/dist/ui/icon-button.js +1 -1
  75. package/dist/ui/icon-button.js.map +1 -1
  76. package/dist/ui/index.js +30 -30
  77. package/dist/ui/label.d.ts.map +1 -1
  78. package/dist/ui/label.js +7 -6
  79. package/dist/ui/label.js.map +1 -1
  80. package/dist/ui/search-input.js +4 -4
  81. package/dist/ui/sidebar.js +7 -7
  82. package/dist/ui/spinner.d.ts.map +1 -1
  83. package/dist/ui/spinner.js +50 -44
  84. package/dist/ui/spinner.js.map +1 -1
  85. package/dist/ui/switch.d.ts.map +1 -1
  86. package/dist/ui/switch.js +24 -24
  87. package/dist/ui/switch.js.map +1 -1
  88. package/dist/ui/table.js +1 -1
  89. package/dist/ui/table.js.map +1 -1
  90. package/docs/components/composed/bulk-action-bar.md +9 -3
  91. package/docs/components/composed/error-boundary.md +18 -2
  92. package/docs/components/composed/master-detail.md +12 -2
  93. package/docs/components/composed/page-skeletons.md +2 -2
  94. package/docs/components/composed/priority-indicator.md +22 -11
  95. package/docs/components/composed/rich-chat-input.md +18 -6
  96. package/docs/components/composed/schedule-view.md +20 -5
  97. package/docs/components/composed/simple-tooltip.md +1 -1
  98. package/docs/components/shell/app-command-palette.md +2 -1
  99. package/docs/components/shell/bottom-navbar.md +28 -9
  100. package/docs/components/shell/command-registry.md +2 -2
  101. package/docs/components/shell/link-context.md +2 -2
  102. package/docs/components/shell/top-bar.md +1 -1
  103. package/docs/components/ui/autocomplete.md +26 -10
  104. package/docs/components/ui/search-input.md +2 -2
  105. package/docs/components/ui/slider.md +2 -2
  106. package/docs/components/ui/split-button.md +3 -3
  107. package/llms.txt +2 -2
  108. package/make-kit/Guidelines.md +1 -1
  109. package/make-kit/components/overview.md +2 -2
  110. package/make-kit/foundations/surfaces.md +1 -1
  111. package/mcp-manifest.json +581 -172
  112. package/package.json +1 -6
  113. package/skill/SKILL.md +1 -1
  114. package/skill/chat-skill/README.md +18 -0
  115. package/skill/chat-skill/SKILL.md +78 -0
  116. package/skill/chat-skill/chatgpt-instructions.md +26 -0
  117. package/skill/chat-skill/gemini-instructions.md +25 -0
  118. package/skill/references/components.md +2 -2
  119. package/dist/shell/sidebar.d.ts +0 -113
  120. package/dist/shell/sidebar.d.ts.map +0 -1
  121. package/dist/shell/sidebar.js +0 -293
  122. package/dist/shell/sidebar.js.map +0 -1
  123. package/docs/components/shell/sidebar.md +0 -103
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.52.0",
3
+ "version": "0.54.0",
4
4
  "description": "Devalok Design System — accessible React components, OKLCH design tokens, and Tailwind 4 CSS-first setup. Ships with AI-agent setup recipes.",
5
5
  "license": "MIT",
6
6
  "author": "Devalok Design & Strategy Studios <shilp-sutra@devalok.in>",
@@ -710,11 +710,6 @@
710
710
  "import": "./dist/shell/notification-preferences.js",
711
711
  "default": "./dist/shell/notification-preferences.js"
712
712
  },
713
- "./shell/sidebar": {
714
- "types": "./dist/shell/sidebar.d.ts",
715
- "import": "./dist/shell/sidebar.js",
716
- "default": "./dist/shell/sidebar.js"
717
- },
718
713
  "./shell/top-bar": {
719
714
  "types": "./dist/shell/top-bar.d.ts",
720
715
  "import": "./dist/shell/top-bar.js",
package/skill/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: shilp-sutra
3
3
  description: Add, configure, and use components from Devalok's shilp-sutra design system (@devalok/shilp-sutra) — a Tailwind 4 + React 19 + CVA library with 110+ accessible components, OKLCH design tokens, framer-motion animations, and per-component RSC-safe entry points. Use this skill whenever the user mentions shilp-sutra, Devalok, the @devalok npm scope, or asks to install/add/style/theme UI in any React project that already depends on the package — even if they don't name it explicitly. Use it instead of generic shadcn/ui, MUI, or Chakra knowledge when shilp-sutra is in the project. Covers Next.js (App + Pages), Vite, Astro, Remix, TanStack Start setup playbooks; component API and variant reference; brand token customization; Server Component import patterns; and a troubleshoot tree for the thirteen most common breakages.
4
4
  license: MIT
5
5
  metadata:
6
- version: "0.52.0"
6
+ version: "0.54.0"
7
7
  author: Devalok Design & Strategy Studios
8
8
  homepage: https://github.com/devalok-design/shilp-sutra
9
9
  npm: https://www.npmjs.com/package/@devalok/shilp-sutra
@@ -0,0 +1,18 @@
1
+ # shilp-sutra chat skill
2
+
3
+ A small pointer that teaches AI chat assistants what `@devalok/shilp-sutra` is and
4
+ routes them to the MCP server for the real, version-exact component docs. Use it on chat
5
+ surfaces that have no native Agent Skills support. For coding agents (Claude Code,
6
+ Cursor, Codex), use the full skill in the parent directory instead.
7
+
8
+ All of these say the same thing; pick the file that matches where you are pasting.
9
+
10
+ | Surface | File | How to load it |
11
+ | --- | --- | --- |
12
+ | claude.ai / Claude Desktop | `SKILL.md` | Add as a skill, or connect the MCP directly: `claude mcp add --transport http shilp-sutra https://shilp-sutra.devalok.in/mcp` |
13
+ | ChatGPT (Custom GPT or Custom Instructions) | `chatgpt-instructions.md` | Paste the block into the GPT's Instructions field |
14
+ | Gemini (Gem) | `gemini-instructions.md` | Paste the block into the Gem's Instructions field |
15
+ | Copilot Chat / other | `SKILL.md` | Paste the body into the system or context prompt |
16
+
17
+ The heavy lifting lives in the MCP server at https://shilp-sutra.devalok.in/mcp. These
18
+ files only orient the model and point it there; they do not duplicate component docs.
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: shilp-sutra
3
+ description: >
4
+ Use whenever the user works with @devalok/shilp-sutra or the Devalok Design
5
+ System in a React or Next.js project: installing it, importing components,
6
+ building dashboards, theming with an archetype or a brand color, or fixing
7
+ token and setup issues. Trigger on any @devalok import or a component name
8
+ (Sidebar, StatCard, DataTable, DatePicker, TopBar, PageHeader) even when the
9
+ package is not named. Prefer this over shadcn/ui, Radix, MUI, or Chakra
10
+ knowledge whenever shilp-sutra is in the project.
11
+ license: MIT
12
+ metadata:
13
+ author: Devalok Design & Strategy Studio
14
+ homepage: https://github.com/devalok-design/shilp-sutra
15
+ npm: https://www.npmjs.com/package/@devalok/shilp-sutra
16
+ ---
17
+
18
+ # shilp-sutra (Devalok Design System): chat quick reference
19
+
20
+ `@devalok/shilp-sutra` is Devalok's design system for React and Next.js: Tailwind 4,
21
+ React 19, CVA, OKLCH tokens. It is NOT shadcn/ui, Radix, MUI, or Chakra. The component
22
+ APIs, token namespace, and setup all differ, so do not answer from memory of those
23
+ libraries. This file is a pointer. The full, version-exact docs live in the shilp-sutra
24
+ MCP server.
25
+
26
+ ## Install
27
+
28
+ ```bash
29
+ pnpm add @devalok/shilp-sutra framer-motion
30
+ ```
31
+
32
+ `framer-motion@^12` is a required peer. Add `sonner@^2` only if you render a `<Toaster />`.
33
+
34
+ ## Wire the CSS (Tailwind 4, no JS config)
35
+
36
+ ```css
37
+ @import "tailwindcss";
38
+ @import "@devalok/shilp-sutra/css";
39
+ ```
40
+
41
+ There is no `tailwind.config.ts` and no preset. On Next.js, add
42
+ `transpilePackages: ["@devalok/shilp-sutra"]` to `next.config`.
43
+
44
+ ## Import layers
45
+
46
+ | Layer | Import | Holds |
47
+ | -------- | ------------------------------------- | ---------------------------------------------- |
48
+ | ui | `@devalok/shilp-sutra/ui/<name>` | primitives: Button, Input, Dialog, Select, ... |
49
+ | composed | `@devalok/shilp-sutra/composed/<name>`| patterns: StatCard, DataTable, DatePicker, ... |
50
+ | shell | `@devalok/shilp-sutra/shell/<name>` | app frame: TopBar, Sidebar, BottomNavbar |
51
+
52
+ Prefer per-component imports (`/ui/button`) over the barrel (`/ui`): smaller bundles and
53
+ Server-Component safe.
54
+
55
+ ## Full docs live in the MCP: connect it
56
+
57
+ For real component APIs, props, variants, tokens, and setup recipes, use the shilp-sutra
58
+ MCP server. Do not guess prop or variant names; they are enumerated there.
59
+
60
+ ```
61
+ https://shilp-sutra.devalok.in/mcp
62
+ ```
63
+
64
+ Claude Code or Claude Desktop:
65
+
66
+ ```bash
67
+ claude mcp add --transport http shilp-sutra https://shilp-sutra.devalok.in/mcp
68
+ ```
69
+
70
+ Once connected, call `how_to_use` first, then `get_component`, `get_setup`, and
71
+ `get_tokens` as needed.
72
+
73
+ ## Theming
74
+
75
+ For a copy-paste theme (a 12-step accent ramp plus role tokens), send the user to the
76
+ Themer: https://shilp-sutra.devalok.in/themer . Paste its CSS block after the
77
+ `@import "@devalok/shilp-sutra/css";` line. Theming is CSS-only; there is no provider
78
+ component.
@@ -0,0 +1,26 @@
1
+ <!-- Paste the block below into a ChatGPT Custom GPT's "Instructions" field, or into
2
+ Settings > Personalization > Custom Instructions. Keep it verbatim. -->
3
+
4
+ You help users build UI with @devalok/shilp-sutra, the Devalok Design System for
5
+ React and Next.js (Tailwind 4, React 19, CVA, OKLCH tokens).
6
+
7
+ It is NOT shadcn/ui, Radix, MUI, or Chakra. The component APIs, token namespace, and
8
+ setup differ from all of them. Do not answer from memory of those libraries, and do
9
+ not invent prop or variant names.
10
+
11
+ Setup:
12
+ - Install: `pnpm add @devalok/shilp-sutra framer-motion` (framer-motion@^12 is a
13
+ required peer; add sonner@^2 only for a Toaster).
14
+ - CSS (Tailwind 4, no JS config): `@import "tailwindcss";` then
15
+ `@import "@devalok/shilp-sutra/css";`. On Next.js add
16
+ `transpilePackages: ["@devalok/shilp-sutra"]`.
17
+ - Import per component: `@devalok/shilp-sutra/ui/button`,
18
+ `@devalok/shilp-sutra/composed/stat-card`, `@devalok/shilp-sutra/shell/top-bar`.
19
+
20
+ For real component APIs, props, variants, tokens, and setup recipes, tell the user to
21
+ connect the shilp-sutra MCP server at https://shilp-sutra.devalok.in/mcp and to read
22
+ its `how_to_use`, `get_component`, `get_setup`, and `get_tokens` tools. That server is
23
+ the version-exact source of truth; this instruction block is only an orientation.
24
+
25
+ For theming, point the user to the Themer at https://shilp-sutra.devalok.in/themer for
26
+ a copy-paste CSS theme.
@@ -0,0 +1,25 @@
1
+ <!-- Paste the block below into a Gemini Gem's "Instructions" field. Keep it verbatim. -->
2
+
3
+ Act as a helper for @devalok/shilp-sutra, the Devalok Design System for React and
4
+ Next.js (Tailwind 4, React 19, CVA, OKLCH tokens).
5
+
6
+ It is NOT shadcn/ui, Radix, MUI, or Chakra. Its component APIs, token namespace, and
7
+ setup differ. Do not answer from memory of those libraries, and never invent prop or
8
+ variant names.
9
+
10
+ Setup:
11
+ - Install: `pnpm add @devalok/shilp-sutra framer-motion` (framer-motion@^12 is a
12
+ required peer; add sonner@^2 only for a Toaster).
13
+ - CSS (Tailwind 4, no JS config): `@import "tailwindcss";` then
14
+ `@import "@devalok/shilp-sutra/css";`. On Next.js add
15
+ `transpilePackages: ["@devalok/shilp-sutra"]`.
16
+ - Import per component: `@devalok/shilp-sutra/ui/button`,
17
+ `@devalok/shilp-sutra/composed/stat-card`, `@devalok/shilp-sutra/shell/top-bar`.
18
+
19
+ For real component APIs, props, variants, tokens, and setup recipes, direct the user to
20
+ the shilp-sutra MCP server at https://shilp-sutra.devalok.in/mcp (tools: `how_to_use`,
21
+ `get_component`, `get_setup`, `get_tokens`). It is the version-exact source of truth;
22
+ these instructions are only an orientation.
23
+
24
+ For theming, send the user to the Themer at https://shilp-sutra.devalok.in/themer for a
25
+ copy-paste CSS theme.
@@ -2,7 +2,7 @@
2
2
 
3
3
  # @devalok/shilp-sutra
4
4
 
5
- > Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.52.0.
5
+ > Radix UI + Tailwind 4 (CSS-first) + CVA design system for Devalok apps, v0.54.0.
6
6
  > Built on the same primitives as shadcn/ui but with DIFFERENT prop APIs — never guess from shadcn knowledge; verify every prop.
7
7
  > This file is a ROUTER: it tells you what exists and where to get details. Do not look for prop tables here — fetch them per component (MCP tool or per-component doc file below).
8
8
 
@@ -94,6 +94,7 @@ Format: `[name](doc path): summary`. Import paths follow `@devalok/shilp-sutra/<
94
94
  - [select](docs/components/ui/select.md)
95
95
  - [separator](docs/components/ui/separator.md)
96
96
  - [sheet](docs/components/ui/sheet.md)
97
+ - [sidebar](docs/components/ui/sidebar.md)
97
98
  - [skeleton](docs/components/ui/skeleton.md)
98
99
  - [slider](docs/components/ui/slider.md)
99
100
  - [spinner](docs/components/ui/spinner.md)
@@ -158,7 +159,6 @@ Format: `[name](doc path): summary`. Import paths follow `@devalok/shilp-sutra/<
158
159
  - [link-context](docs/components/shell/link-context.md): Exports: LinkProvider, useLink
159
160
  - [notification-center](docs/components/shell/notification-center.md)
160
161
  - [notification-preferences](docs/components/shell/notification-preferences.md)
161
- - [sidebar](docs/components/shell/sidebar.md)
162
162
  - [top-bar](docs/components/shell/top-bar.md)
163
163
 
164
164
  ### ai
@@ -1,113 +0,0 @@
1
- "use client";
2
- import { IconInput } from '../ui/lib/icon-input';
3
- /**
4
- * AppSidebar -- Application-layer sidebar built on the Sidebar primitive.
5
- *
6
- * Design-system token migration (2026-02-28):
7
- * All V1 colour tokens have been replaced with semantic design-system tokens.
8
- * Typography classes replaced with Tailwind equivalents.
9
- *
10
- * Props-driven: accepts user info, currentPath, and navItems instead of
11
- * reading from Remix hooks or Zustand stores.
12
- */
13
- import * as React from 'react';
14
- export interface NavSubItem {
15
- title: string;
16
- href: string;
17
- /** Optional icon. Accepts any `IconInput`. */
18
- icon?: IconInput;
19
- exact?: boolean;
20
- }
21
- export interface NavItem {
22
- title: string;
23
- href: string;
24
- /** Icon for this nav item. Accepts any `IconInput`. */
25
- icon: IconInput;
26
- /** When true, the route matches only when the path is exactly equal */
27
- exact?: boolean;
28
- /** Badge rendered on the right side of the nav item */
29
- badge?: string | number;
30
- /** Optional child items — renders as collapsible sub-list with chevron */
31
- children?: NavSubItem[];
32
- /** Whether the collapsible is open by default. Auto-opens when a child is active. */
33
- defaultOpen?: boolean;
34
- }
35
- export interface NavGroup {
36
- label: string;
37
- items: NavItem[];
38
- /** Action rendered next to the group label (e.g., a "+" button) */
39
- action?: React.ReactNode;
40
- }
41
- export interface SidebarUser {
42
- name: string;
43
- email?: string;
44
- image?: string | null;
45
- designation?: string;
46
- role?: string;
47
- }
48
- export interface SidebarPromo {
49
- /** Promo message text */
50
- text: string;
51
- /** Optional icon rendered before the text. Accepts any `IconInput`. */
52
- icon?: IconInput;
53
- /** Action button rendered in the promo banner */
54
- action?: {
55
- label: string;
56
- href?: string;
57
- onClick?: () => void;
58
- };
59
- /** When provided, renders a dismiss (X) button that calls this handler */
60
- onDismiss?: () => void;
61
- }
62
- export interface SidebarFooterConfig {
63
- /** Legal/utility links rendered as a row separated by dividers */
64
- links?: Array<{
65
- label: string;
66
- href: string;
67
- }>;
68
- /** Version or build info text (or link) rendered inline after links */
69
- version?: string | {
70
- label: string;
71
- href: string;
72
- };
73
- /** Custom content rendered above the links row */
74
- slot?: React.ReactNode;
75
- /** Promo/upsell banner rendered above the links row */
76
- promo?: SidebarPromo;
77
- }
78
- export interface AppSidebarProps extends React.HTMLAttributes<HTMLDivElement> {
79
- /** Currently active pathname -- used to highlight the active nav item */
80
- currentPath?: string;
81
- /** User information displayed in the sidebar header */
82
- user?: SidebarUser | null;
83
- /** Primary navigation groups rendered in the main content area */
84
- navGroups?: NavGroup[];
85
- /** Optional logo element. Falls back to a text placeholder. */
86
- logo?: React.ReactNode;
87
- /** Footer links rendered at the bottom of the sidebar */
88
- footerLinks?: Array<{
89
- label: string;
90
- href: string;
91
- }>;
92
- /** Structured footer config (takes precedence over footerLinks) */
93
- footer?: SidebarFooterConfig;
94
- /** Content rendered between user header and navigation */
95
- headerSlot?: React.ReactNode;
96
- /** Content rendered between navigation and footer */
97
- preFooterSlot?: React.ReactNode;
98
- /** className applied to the wrapper div around preFooterSlot */
99
- preFooterClassName?: string;
100
- /** Override rendering for specific nav items. Return null to use default rendering. */
101
- renderItem?: (item: NavItem, defaultRender: () => React.ReactNode) => React.ReactNode | null;
102
- /** Additional className for the root sidebar element */
103
- className?: string;
104
- /**
105
- * Corner radius of nav items (composable). @default 'md' (control radius, ~6px).
106
- * `'lg'` restores the previous rounder look; `'sm'` is tighter; `'pill'` is fully rounded.
107
- * Sets the `--ds-sidebar-item-radius` CSS var, so you can also override it via `className`/`style`.
108
- */
109
- navItemRadius?: 'sm' | 'md' | 'lg' | 'pill';
110
- }
111
- declare const AppSidebar: React.ForwardRefExoticComponent<AppSidebarProps & React.RefAttributes<HTMLDivElement>>;
112
- export { AppSidebar };
113
- //# sourceMappingURL=sidebar.d.ts.map
@@ -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AC/B,gEAAgE;IAChE,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,uFAAuF;IACvF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAC5F,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAA;CAC5C;AAgMD,QAAA,MAAM,UAAU,wFAmOf,CAAA;AAGD,OAAO,EAAE,UAAU,EAAE,CAAA"}
@@ -1,293 +0,0 @@
1
- "use client";
2
- import { IconProvider as e } from "../ui/icon-context.js";
3
- import { cn as t } from "../ui/lib/utils.js";
4
- import { Avatar as n, AvatarFallback as r, AvatarImage as i } from "../ui/avatar.js";
5
- import { normalizeIcon as a } from "../_chunks/normalize-icon.js";
6
- import { Button as o } from "../ui/button.js";
7
- import { Collapsible as s, CollapsibleContent as c, CollapsibleTrigger as l } from "../ui/collapsible.js";
8
- import { TruncatedText as u } from "../ui/truncated-text.js";
9
- import { useLink as d } from "../_chunks/link-context.js";
10
- import { Sidebar as f, SidebarContent as p, SidebarFooter as m, SidebarGroup as h, SidebarGroupAction as g, SidebarGroupContent as _, SidebarGroupLabel as v, SidebarHeader as y, SidebarMenu as b, SidebarMenuBadge as x, SidebarMenuButton as S, SidebarMenuItem as C, SidebarMenuSub as w, SidebarMenuSubButton as T, SidebarMenuSubItem as E, SidebarSeparator as D } from "../ui/sidebar.js";
11
- import "./link-context.js";
12
- import * as O from "react";
13
- import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
14
- //#region src/shell/sidebar.tsx
15
- function M({ className: e }) {
16
- return /* @__PURE__ */ A("svg", {
17
- xmlns: "http://www.w3.org/2000/svg",
18
- width: "16",
19
- height: "16",
20
- viewBox: "0 0 24 24",
21
- fill: "none",
22
- stroke: "currentColor",
23
- strokeWidth: "2",
24
- strokeLinecap: "round",
25
- strokeLinejoin: "round",
26
- className: e,
27
- children: /* @__PURE__ */ A("path", { d: "m9 18 6-6-6-6" })
28
- });
29
- }
30
- function N({ className: e }) {
31
- return /* @__PURE__ */ j("svg", {
32
- xmlns: "http://www.w3.org/2000/svg",
33
- width: "16",
34
- height: "16",
35
- viewBox: "0 0 24 24",
36
- fill: "none",
37
- stroke: "currentColor",
38
- strokeWidth: "2",
39
- strokeLinecap: "round",
40
- strokeLinejoin: "round",
41
- className: e,
42
- children: [/* @__PURE__ */ A("path", { d: "M18 6 6 18" }), /* @__PURE__ */ A("path", { d: "m6 6 12 12" })]
43
- });
44
- }
45
- var P = "relative gap-ds-04 rounded-[var(--ds-sidebar-item-radius,var(--radius-control))] px-ds-04 py-ds-03 transition-colors duration-fast-02", F = {
46
- sm: "var(--radius-control-inner)",
47
- md: "var(--radius-control)",
48
- lg: "var(--radius-surface)",
49
- pill: "var(--radius-pill)"
50
- }, I = "bg-accent-2 text-accent-11 font-medium", L = "text-surface-fg-subtle hover:bg-surface-raised-hover hover:text-surface-fg";
51
- function R({ item: n, isActive: r, isPathActive: i }) {
52
- let o = d(), u = n.badge == null ? null : typeof n.badge == "number" && n.badge > 99 ? "99+" : String(n.badge);
53
- if (n.children && n.children.length > 0) {
54
- let d = n.children.some((e) => i(e.href, e.exact));
55
- return /* @__PURE__ */ A(s, {
56
- defaultOpen: d || r || (n.defaultOpen ?? !1),
57
- className: "group/collapsible",
58
- children: /* @__PURE__ */ j(C, { children: [/* @__PURE__ */ j("div", {
59
- className: "relative",
60
- children: [
61
- /* @__PURE__ */ A(S, {
62
- asChild: !0,
63
- isActive: r || d,
64
- tooltip: n.title,
65
- className: t(P, r || d ? I : L),
66
- children: /* @__PURE__ */ j(o, {
67
- href: n.href,
68
- "aria-label": n.title,
69
- "aria-current": r ? "page" : void 0,
70
- className: "min-w-0",
71
- children: [/* @__PURE__ */ A("span", {
72
- className: "[&>svg]:h-ico-md [&>svg]:w-ico-md shrink-0",
73
- "aria-hidden": "true",
74
- children: /* @__PURE__ */ A(e, {
75
- size: "md",
76
- children: a(n.icon)
77
- })
78
- }), /* @__PURE__ */ A("span", {
79
- className: "text-body-lg truncate",
80
- children: n.title
81
- })]
82
- })
83
- }),
84
- u && /* @__PURE__ */ A(x, { children: u }),
85
- /* @__PURE__ */ A(l, {
86
- asChild: !0,
87
- children: /* @__PURE__ */ A("button", {
88
- className: "absolute right-ds-02 top-1/2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-control text-surface-fg-subtle transition-colors hover:bg-surface-raised-hover hover:text-surface-fg group-data-[collapsible=icon]:hidden",
89
- "aria-label": `Toggle ${n.title}`,
90
- children: /* @__PURE__ */ A(M, { className: "h-4 w-4 transition-transform duration-fast-02 ease-productive-standard group-data-[state=open]/collapsible:rotate-90" })
91
- })
92
- })
93
- ]
94
- }), /* @__PURE__ */ A(c, { children: /* @__PURE__ */ A(w, { children: n.children.map((t) => {
95
- let n = i(t.href, t.exact);
96
- return /* @__PURE__ */ A(E, { children: /* @__PURE__ */ A(T, {
97
- asChild: !0,
98
- isActive: n,
99
- children: /* @__PURE__ */ j(o, {
100
- href: t.href,
101
- "aria-current": n ? "page" : void 0,
102
- className: "min-w-0",
103
- children: [t.icon && /* @__PURE__ */ A("span", {
104
- className: "[&>svg]:h-ico-sm [&>svg]:w-ico-sm shrink-0",
105
- "aria-hidden": "true",
106
- children: /* @__PURE__ */ A(e, {
107
- size: "sm",
108
- children: a(t.icon)
109
- })
110
- }), /* @__PURE__ */ A("span", {
111
- className: "truncate",
112
- children: t.title
113
- })]
114
- })
115
- }) }, t.href);
116
- }) }) })] })
117
- });
118
- }
119
- return /* @__PURE__ */ j(C, { children: [/* @__PURE__ */ A(S, {
120
- asChild: !0,
121
- isActive: r,
122
- tooltip: n.title,
123
- className: t(P, r ? I : L),
124
- children: /* @__PURE__ */ j(o, {
125
- href: n.href,
126
- "aria-label": n.title,
127
- "aria-current": r ? "page" : void 0,
128
- className: "min-w-0",
129
- children: [/* @__PURE__ */ A("span", {
130
- className: "[&>svg]:h-ico-md [&>svg]:w-ico-md shrink-0",
131
- "aria-hidden": "true",
132
- children: /* @__PURE__ */ A(e, {
133
- size: "md",
134
- children: a(n.icon)
135
- })
136
- }), /* @__PURE__ */ A("span", {
137
- className: "text-body-lg truncate",
138
- children: n.title
139
- })]
140
- })
141
- }), u && /* @__PURE__ */ A(x, { children: u })] });
142
- }
143
- var z = O.forwardRef(({ currentPath: s = "/", user: c, navGroups: l = [], logo: x, headerSlot: S, preFooterSlot: C, preFooterClassName: w, footerLinks: T = [], footer: E, renderItem: M, className: P, navItemRadius: I, style: L, ...z }, B) => {
144
- let V = d(), H = (e, t = !1) => t || e === "/" ? s === e : s.startsWith(e);
145
- return /* @__PURE__ */ j(f, {
146
- ...z,
147
- ref: B,
148
- "aria-label": "Main navigation",
149
- style: I ? {
150
- "--ds-sidebar-item-radius": F[I],
151
- ...L
152
- } : L,
153
- className: t("z-raised hidden h-full flex-col border-r border-surface-border-strong bg-surface-raised md:flex", P),
154
- children: [
155
- /* @__PURE__ */ A(y, {
156
- className: "px-ds-06 py-ds-06",
157
- children: x ?? /* @__PURE__ */ A("span", {
158
- className: "text-heading-xs font-semibold text-surface-fg",
159
- children: "Logo"
160
- })
161
- }),
162
- c && /* @__PURE__ */ j("div", {
163
- className: "flex items-center gap-ds-04 px-ds-06 pb-ds-05",
164
- children: [/* @__PURE__ */ j(n, {
165
- className: "h-ds-sm-plus w-ds-sm-plus",
166
- children: [c.image ? /* @__PURE__ */ A(i, {
167
- src: c.image,
168
- alt: c.name
169
- }) : null, /* @__PURE__ */ A(r, {
170
- className: "bg-surface-raised-hover text-surface-fg",
171
- children: c.name?.charAt(0).toUpperCase()
172
- })]
173
- }), /* @__PURE__ */ j("div", {
174
- className: "flex min-w-0 flex-col",
175
- children: [/* @__PURE__ */ A(u, {
176
- className: "text-body-md text-surface-fg",
177
- children: c.name ?? ""
178
- }), /* @__PURE__ */ A(u, {
179
- className: "text-body-sm text-surface-fg-subtle",
180
- children: c.designation || c.role || ""
181
- })]
182
- })]
183
- }),
184
- /* @__PURE__ */ A(D, {}),
185
- S && /* @__PURE__ */ j(k, { children: [S, /* @__PURE__ */ A(D, {})] }),
186
- /* @__PURE__ */ A(p, {
187
- className: "no-scrollbar px-ds-04",
188
- children: l.map((e, t) => /* @__PURE__ */ j("div", { children: [t > 0 && /* @__PURE__ */ A(D, {}), /* @__PURE__ */ j(h, { children: [
189
- /* @__PURE__ */ A(v, {
190
- className: "px-ds-04 text-body-sm text-surface-fg-subtle",
191
- children: e.label
192
- }),
193
- e.action && /* @__PURE__ */ A(g, {
194
- asChild: !0,
195
- children: e.action
196
- }),
197
- /* @__PURE__ */ A(_, { children: /* @__PURE__ */ A(b, { children: e.items.map((e) => {
198
- let t = () => /* @__PURE__ */ A(R, {
199
- item: e,
200
- isActive: H(e.href, e.exact),
201
- isPathActive: H
202
- });
203
- if (M) {
204
- let n = M(e, t);
205
- if (n !== null) return /* @__PURE__ */ A(O.Fragment, { children: n }, e.href);
206
- }
207
- return /* @__PURE__ */ A(O.Fragment, { children: t() }, e.href);
208
- }) }) })
209
- ] })] }, e.label))
210
- }),
211
- C && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(D, {}), /* @__PURE__ */ A("div", {
212
- className: w,
213
- children: C
214
- })] }),
215
- E ? /* @__PURE__ */ j(m, {
216
- className: "gap-ds-03 px-ds-06 py-ds-05",
217
- children: [
218
- E.slot && /* @__PURE__ */ A("div", { children: E.slot }),
219
- E.promo && /* @__PURE__ */ j("div", {
220
- className: "relative rounded-surface bg-surface-raised p-ds-04 shadow-raised",
221
- children: [E.promo.onDismiss && /* @__PURE__ */ A("button", {
222
- onClick: E.promo.onDismiss,
223
- "aria-label": "Dismiss",
224
- className: "absolute right-ds-02 top-ds-02 flex h-5 w-5 items-center justify-center rounded-control text-surface-fg-subtle transition-colors hover:bg-surface-raised-hover hover:text-surface-fg",
225
- children: /* @__PURE__ */ A(N, { className: "h-3.5 w-3.5" })
226
- }), /* @__PURE__ */ j("div", {
227
- className: "flex flex-col gap-ds-03",
228
- children: [E.promo.icon && /* @__PURE__ */ A("span", {
229
- className: "text-accent-11 [&>svg]:h-ico-md [&>svg]:w-ico-md",
230
- "aria-hidden": "true",
231
- children: /* @__PURE__ */ A(e, {
232
- size: "md",
233
- children: a(E.promo.icon)
234
- })
235
- }), /* @__PURE__ */ j("div", {
236
- className: "flex min-w-0 flex-col gap-ds-03",
237
- children: [/* @__PURE__ */ A("p", {
238
- className: "text-body-sm text-surface-fg line-clamp-2",
239
- children: E.promo.text
240
- }), E.promo.action && (E.promo.action.href ? /* @__PURE__ */ A(o, {
241
- asChild: !0,
242
- variant: "solid",
243
- size: "sm",
244
- className: "self-start",
245
- children: /* @__PURE__ */ A(V, {
246
- href: E.promo.action.href,
247
- onClick: E.promo.action.onClick,
248
- children: E.promo.action.label
249
- })
250
- }) : /* @__PURE__ */ A(o, {
251
- variant: "solid",
252
- size: "sm",
253
- className: "self-start",
254
- onClick: E.promo.action.onClick,
255
- children: E.promo.action.label
256
- }))]
257
- })]
258
- })]
259
- }),
260
- (E.links?.length || E.version) && /* @__PURE__ */ j("div", {
261
- className: "flex items-center gap-ds-03 text-body-sm text-surface-fg-subtle",
262
- children: [
263
- E.links?.map((e, t) => /* @__PURE__ */ j(O.Fragment, { children: [t > 0 && /* @__PURE__ */ A("span", { children: "·" }), /* @__PURE__ */ A(V, {
264
- className: "transition-colors hover:text-accent-11",
265
- href: e.href,
266
- children: e.label
267
- })] }, e.href)),
268
- E.links?.length && E.version && /* @__PURE__ */ A("span", { children: "·" }),
269
- E.version && (typeof E.version == "string" ? /* @__PURE__ */ A("span", { children: E.version }) : /* @__PURE__ */ A(V, {
270
- className: "transition-colors hover:text-accent-11",
271
- href: E.version.href,
272
- children: E.version.label
273
- }))
274
- ]
275
- })
276
- ]
277
- }) : T.length > 0 ? /* @__PURE__ */ A(m, {
278
- className: "px-ds-06 py-ds-05",
279
- children: /* @__PURE__ */ A("div", {
280
- className: "flex items-center gap-ds-03 text-body-sm text-surface-fg-subtle",
281
- children: T.map((e, t) => /* @__PURE__ */ j(O.Fragment, { children: [t > 0 && /* @__PURE__ */ A("span", { children: "·" }), /* @__PURE__ */ A(V, {
282
- className: "transition-colors hover:text-accent-11",
283
- href: e.href,
284
- children: e.label
285
- })] }, e.href))
286
- })
287
- }) : null
288
- ]
289
- });
290
- });
291
- z.displayName = "AppSidebar";
292
- //#endregion
293
- export { z as AppSidebar };