@devalok/shilp-sutra 0.9.2 → 0.11.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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as r, jsxs as d, Fragment as B } from "react/jsx-runtime";
3
3
  import * as a from "react";
4
- import { j as G, k as U, P as q, l as J } from "../_chunks/primitives.js";
4
+ import { g as G, h as U, P as q, i as J } from "../_chunks/primitives.js";
5
5
  import { IconChevronDown as Q, IconSearch as W, IconCheck as Y, IconX as Z } from "@tabler/icons-react";
6
6
  import { c as x } from "../_chunks/utils.js";
7
7
  const P = 2, V = 36, ee = a.forwardRef(
@@ -10,13 +10,13 @@ const P = 2, V = 36, ee = a.forwardRef(
10
10
  value: f,
11
11
  onValueChange: m,
12
12
  placeholder: S = "Select...",
13
- searchPlaceholder: j = "Search...",
14
- emptyMessage: A = "No results found",
13
+ searchPlaceholder: A = "Search...",
14
+ emptyMessage: L = "No results found",
15
15
  multiple: b = !1,
16
16
  disabled: p = !1,
17
- className: L,
18
- triggerClassName: T,
19
- maxVisible: $ = 6,
17
+ className: T,
18
+ triggerClassName: $,
19
+ maxVisible: j = 6,
20
20
  renderOption: E,
21
21
  ...H
22
22
  }, M) => {
@@ -168,7 +168,7 @@ const P = 2, V = 36, ee = a.forwardRef(
168
168
  }
169
169
  return /* @__PURE__ */ r("span", { className: "flex-1 truncate text-left text-text-placeholder", children: S });
170
170
  };
171
- return /* @__PURE__ */ r(G, { open: h, onOpenChange: z, children: /* @__PURE__ */ d("div", { className: x("relative", L), ...H, children: [
171
+ return /* @__PURE__ */ r(G, { open: h, onOpenChange: z, children: /* @__PURE__ */ d("div", { className: x("relative", T), ...H, children: [
172
172
  /* @__PURE__ */ r(U, { asChild: !0, disabled: p, children: /* @__PURE__ */ d(
173
173
  "button",
174
174
  {
@@ -185,7 +185,7 @@ const P = 2, V = 36, ee = a.forwardRef(
185
185
  "transition-colors duration-fast-01",
186
186
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-offset-2 focus-visible:border-border-interactive",
187
187
  "disabled:cursor-not-allowed disabled:opacity-[0.38]",
188
- T
188
+ $
189
189
  ),
190
190
  children: [
191
191
  F(),
@@ -215,7 +215,7 @@ const P = 2, V = 36, ee = a.forwardRef(
215
215
  ref: k,
216
216
  type: "text",
217
217
  className: "flex-1 bg-transparent py-ds-03 text-ds-md outline-none placeholder:text-text-placeholder",
218
- placeholder: j,
218
+ placeholder: A,
219
219
  value: v,
220
220
  onChange: (e) => {
221
221
  y(e.target.value), c(-1);
@@ -228,7 +228,7 @@ const P = 2, V = 36, ee = a.forwardRef(
228
228
  }
229
229
  )
230
230
  ] }),
231
- o.length === 0 ? /* @__PURE__ */ r("div", { className: "px-ds-04 py-ds-05 text-center text-ds-md text-text-tertiary", children: A }) : /* @__PURE__ */ r(
231
+ o.length === 0 ? /* @__PURE__ */ r("div", { className: "px-ds-04 py-ds-05 text-center text-ds-md text-text-tertiary", children: L }) : /* @__PURE__ */ r(
232
232
  "ul",
233
233
  {
234
234
  ref: N,
@@ -236,7 +236,7 @@ const P = 2, V = 36, ee = a.forwardRef(
236
236
  role: "listbox",
237
237
  "aria-multiselectable": b || void 0,
238
238
  className: "overflow-auto p-ds-02",
239
- style: { maxHeight: `${$ * V}px` },
239
+ style: { maxHeight: `${j * V}px` },
240
240
  children: o.map((e, t) => {
241
241
  const s = O(e.value);
242
242
  return /* @__PURE__ */ d(
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as i, jsx as s } from "react/jsx-runtime";
3
3
  import * as n from "react";
4
- import { m as l, n as m, o as c, p, q as u, r as f, s as x, t as b, L as y, u as N, v as h, G as C, w as g, x as w, y as M } from "../_chunks/primitives.js";
4
+ import { j as l, k as m, l as c, m as p, n as u, o as f, p as x, q as b, L as y, r as N, s as h, G as C, t as g, u as w, v as M } from "../_chunks/primitives.js";
5
5
  import { IconChevronRight as R, IconCheck as I, IconCircle as v } from "@tabler/icons-react";
6
6
  import { c as d } from "../_chunks/utils.js";
7
7
  const F = h, H = M, J = C, K = c, O = w, Q = g, S = n.forwardRef(({ className: e, inset: t, children: a, ...o }, r) => /* @__PURE__ */ i(
@@ -33,7 +33,7 @@ const z = n.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ s(
33
33
  }
34
34
  ));
35
35
  z.displayName = m.displayName;
36
- const G = n.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ s(c, { children: /* @__PURE__ */ s(
36
+ const j = n.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ s(c, { children: /* @__PURE__ */ s(
37
37
  p,
38
38
  {
39
39
  ref: a,
@@ -44,8 +44,8 @@ const G = n.forwardRef(({ className: e, ...t }, a) => /* @__PURE__ */ s(c, { chi
44
44
  ...t
45
45
  }
46
46
  ) }));
47
- G.displayName = p.displayName;
48
- const j = n.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */ s(
47
+ j.displayName = p.displayName;
48
+ const G = n.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */ s(
49
49
  u,
50
50
  {
51
51
  ref: o,
@@ -57,8 +57,8 @@ const j = n.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */
57
57
  ...a
58
58
  }
59
59
  ));
60
- j.displayName = u.displayName;
61
- const T = n.forwardRef(({ className: e, children: t, checked: a, ...o }, r) => /* @__PURE__ */ i(
60
+ G.displayName = u.displayName;
61
+ const k = n.forwardRef(({ className: e, children: t, checked: a, ...o }, r) => /* @__PURE__ */ i(
62
62
  f,
63
63
  {
64
64
  ref: r,
@@ -74,8 +74,8 @@ const T = n.forwardRef(({ className: e, children: t, checked: a, ...o }, r) => /
74
74
  ]
75
75
  }
76
76
  ));
77
- T.displayName = f.displayName;
78
- const k = n.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__ */ i(
77
+ k.displayName = f.displayName;
78
+ const T = n.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__ */ i(
79
79
  b,
80
80
  {
81
81
  ref: o,
@@ -90,7 +90,7 @@ const k = n.forwardRef(({ className: e, children: t, ...a }, o) => /* @__PURE__
90
90
  ]
91
91
  }
92
92
  ));
93
- k.displayName = b.displayName;
93
+ T.displayName = b.displayName;
94
94
  const L = n.forwardRef(({ className: e, inset: t, ...a }, o) => /* @__PURE__ */ s(
95
95
  y,
96
96
  {
@@ -129,14 +129,14 @@ const q = ({
129
129
  q.displayName = "ContextMenuShortcut";
130
130
  export {
131
131
  F as ContextMenu,
132
- T as ContextMenuCheckboxItem,
133
- G as ContextMenuContent,
132
+ k as ContextMenuCheckboxItem,
133
+ j as ContextMenuContent,
134
134
  J as ContextMenuGroup,
135
- j as ContextMenuItem,
135
+ G as ContextMenuItem,
136
136
  L as ContextMenuLabel,
137
137
  K as ContextMenuPortal,
138
138
  Q as ContextMenuRadioGroup,
139
- k as ContextMenuRadioItem,
139
+ T as ContextMenuRadioItem,
140
140
  P as ContextMenuSeparator,
141
141
  q as ContextMenuShortcut,
142
142
  O as ContextMenuSub,
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
3
  import * as i from "react";
4
- import { z as n, A as o, B as m, D as l } from "../_chunks/primitives.js";
4
+ import { w as n, x as o, y as m, z as l } from "../_chunks/primitives.js";
5
5
  import { c as f } from "../_chunks/utils.js";
6
- const u = m, C = l, p = i.forwardRef(({ className: a, align: e = "center", sideOffset: d = 4, ...r }, s) => /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
6
+ const u = m, w = l, p = i.forwardRef(({ className: a, align: e = "center", sideOffset: d = 4, ...r }, s) => /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(
7
7
  o,
8
8
  {
9
9
  ref: s,
@@ -20,5 +20,5 @@ p.displayName = o.displayName;
20
20
  export {
21
21
  u as HoverCard,
22
22
  p as HoverCardContent,
23
- C as HoverCardTrigger
23
+ w as HoverCardTrigger
24
24
  };
package/dist/ui/index.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import { B as K, b as Q } from "../_chunks/button.js";
3
3
  import { IconButton as Y } from "./icon-button.js";
4
4
  import { B as $, S as ee, u as re } from "../_chunks/spinner.js";
5
- import { I as ae, l as oe, S as ne, c as se, h as ie, d as le, m as ce, f as de, e as be, a as ue, n as ge, o as xe, g as me, p as pe, q as fe, j as ve, i as ye, r as Ne, s as Se, t as Ce, u as Te, v as we, w as Me, b as he, k as Ie, x as De, y as Ae } from "../_chunks/sidebar.js";
5
+ import { I as ae, q as oe, S as ne, c as se, i as ie, d as le, f as ce, g as de, e as be, a as ue, r as ge, s as xe, h as me, t as pe, l as fe, k as ve, j as ye, u as Ne, m as Se, o as Ce, n as Te, v as we, w as Me, b as he, p as Ie, x as De, y as Ae } from "../_chunks/sidebar.js";
6
6
  import { ColorInput as Ve } from "./color-input.js";
7
7
  import { jsxs as c, jsx as t } from "react/jsx-runtime";
8
8
  import * as s from "react";
9
- import { E as m, bo as S, bn as p, bl as f, bm as v } from "../_chunks/primitives.js";
9
+ import { A as m, bo as S, bn as p, bl as f, bm as v } from "../_chunks/primitives.js";
10
10
  import { c as l } from "../_chunks/utils.js";
11
11
  import { VisuallyHidden as ke } from "./visually-hidden.js";
12
12
  import { Autocomplete as Ge } from "./autocomplete.js";
package/dist/ui/label.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsxs as m, jsx as i } from "react/jsx-runtime";
3
3
  import * as d from "react";
4
- import { E as e } from "../_chunks/primitives.js";
4
+ import { A as e } from "../_chunks/primitives.js";
5
5
  import { c as n } from "../_chunks/utils.js";
6
6
  const p = d.forwardRef(({ className: a, required: t, children: r, ...s }, o) => /* @__PURE__ */ m(
7
7
  e,
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as o } from "react/jsx-runtime";
3
3
  import * as i from "react";
4
- import { P as n, l as t, j as m, k as p, aT as l } from "../_chunks/primitives.js";
4
+ import { P as n, i as t, g as m, h as p, aT as l } from "../_chunks/primitives.js";
5
5
  import { c } from "../_chunks/utils.js";
6
6
  const P = m, u = p, v = l, f = i.forwardRef(({ className: e, align: a = "center", sideOffset: r = 4, ...s }, d) => /* @__PURE__ */ o(n, { children: /* @__PURE__ */ o(
7
7
  t,
@@ -6,7 +6,7 @@ import "@tabler/icons-react";
6
6
  import "../hooks/use-mobile.js";
7
7
  import "../_chunks/utils.js";
8
8
  import "../_chunks/button.js";
9
- import { S as m, c as M, h as g, d as G, m as I, f as c, e as l, a as B, n as f, o as k, g as v, p as A, q as C, j as h, i as j, r as q, s as w, t as x, u as y, v as F, w as H, b as L, k as P, y as R } from "../_chunks/sidebar.js";
9
+ import { S as m, c as M, i as g, d as l, f as G, g as I, e as c, a as B, r as f, s as k, h as v, t as A, l as C, k as h, j, u as w, m as x, o as y, n as F, v as H, w as L, b as P, p as R, y as T } from "../_chunks/sidebar.js";
10
10
  import "./sheet.js";
11
11
  import "./skeleton.js";
12
12
  import "../_chunks/tooltip.js";
@@ -15,10 +15,10 @@ export {
15
15
  m as Sidebar,
16
16
  M as SidebarContent,
17
17
  g as SidebarFooter,
18
- G as SidebarGroup,
19
- I as SidebarGroupAction,
20
- c as SidebarGroupContent,
21
- l as SidebarGroupLabel,
18
+ l as SidebarGroup,
19
+ G as SidebarGroupAction,
20
+ I as SidebarGroupContent,
21
+ c as SidebarGroupLabel,
22
22
  B as SidebarHeader,
23
23
  f as SidebarInput,
24
24
  k as SidebarInset,
@@ -27,13 +27,13 @@ export {
27
27
  C as SidebarMenuBadge,
28
28
  h as SidebarMenuButton,
29
29
  j as SidebarMenuItem,
30
- q as SidebarMenuSkeleton,
31
- w as SidebarMenuSub,
32
- x as SidebarMenuSubButton,
33
- y as SidebarMenuSubItem,
34
- F as SidebarProvider,
35
- H as SidebarRail,
36
- L as SidebarSeparator,
37
- P as SidebarTrigger,
38
- R as useSidebar
30
+ w as SidebarMenuSkeleton,
31
+ x as SidebarMenuSub,
32
+ y as SidebarMenuSubButton,
33
+ F as SidebarMenuSubItem,
34
+ H as SidebarProvider,
35
+ L as SidebarRail,
36
+ P as SidebarSeparator,
37
+ R as SidebarTrigger,
38
+ T as useSidebar
39
39
  };
package/llms-full.txt CHANGED
@@ -5,7 +5,7 @@
5
5
  > All variant values and props verified from source CVA definitions.
6
6
  >
7
7
  > Package: @devalok/shilp-sutra
8
- > Version: 0.6.1
8
+ > Version: 0.10.0
9
9
 
10
10
  ---
11
11
 
@@ -1677,6 +1677,96 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
1677
1677
  />
1678
1678
  - Gotchas: Must be wrapped in SidebarProvider (from ui/sidebar)
1679
1679
 
1680
+ ### AppSidebar v0.10.0 additions
1681
+
1682
+ New props on AppSidebarProps:
1683
+ footer: SidebarFooterConfig — structured footer (takes precedence over footerLinks)
1684
+ headerSlot: ReactNode — content between user info and navigation
1685
+ preFooterSlot: ReactNode — content between navigation and footer
1686
+ renderItem: (item: NavItem, defaultRender: () => ReactNode) => ReactNode | null — custom item rendering
1687
+
1688
+ New fields on NavItem:
1689
+ badge: string | number — badge rendered on the right side (numbers > 99 display as "99+")
1690
+ children: NavSubItem[] — renders as collapsible sub-list with chevron toggle
1691
+ defaultOpen: boolean — whether collapsible is open by default (auto-opens when a child is active)
1692
+
1693
+ New type NavSubItem: { title: string, href: string, icon?: ReactNode, exact?: boolean }
1694
+
1695
+ New fields on NavGroup:
1696
+ action: ReactNode — action button rendered next to the group label
1697
+
1698
+ New type SidebarFooterConfig:
1699
+ links: Array<{ label: string, href: string }> — legal/utility links as a row
1700
+ version: string — version or build info text
1701
+ slot: ReactNode — custom content above the links row
1702
+
1703
+ Deprecated props:
1704
+ footerLinks — use footer.links instead (footerLinks still works for backwards compat)
1705
+
1706
+ - S9: Collapsible nav items
1707
+ ```tsx
1708
+ // Collapsible nav items
1709
+ {
1710
+ title: "Projects",
1711
+ href: "/projects",
1712
+ icon: <IconLayoutKanban />,
1713
+ children: [
1714
+ { title: "Karm V2", href: "/projects/abc/board" },
1715
+ { title: "Website Redesign", href: "/projects/def/board" },
1716
+ ],
1717
+ }
1718
+ ```
1719
+
1720
+ - S10: Nav item badge
1721
+ ```tsx
1722
+ { title: "My Tasks", href: "/my-tasks", icon: <IconChecklist />, badge: 5 }
1723
+ { title: "Messages", href: "/messages", icon: <IconMessage />, badge: "New" }
1724
+ // Numbers > 99 display as "99+"
1725
+ ```
1726
+
1727
+ - S11: Nav group action
1728
+ ```tsx
1729
+ {
1730
+ label: "WORK",
1731
+ items: [...],
1732
+ action: <button onClick={...} aria-label="New project"><IconPlus size={14} /></button>,
1733
+ }
1734
+ ```
1735
+
1736
+ - S12: Structured footer
1737
+ ```tsx
1738
+ <AppSidebar
1739
+ footer={{
1740
+ links: [{ label: "Terms", href: "/terms" }, { label: "Privacy", href: "/privacy" }],
1741
+ version: "v2.4.1",
1742
+ slot: <a href="/changelog">What's new?</a>,
1743
+ }}
1744
+ />
1745
+ // footer takes precedence over footerLinks. footerLinks still works for backwards compat.
1746
+ ```
1747
+
1748
+ - S13: Header and pre-footer slots
1749
+ ```tsx
1750
+ <AppSidebar
1751
+ headerSlot={<DharaWidget userId={user.id} />}
1752
+ preFooterSlot={<UpgradeBanner />}
1753
+ navGroups={navGroups}
1754
+ />
1755
+ // Slots auto-add SidebarSeparator. No extra DOM when not provided.
1756
+ ```
1757
+
1758
+ - S14: Custom item rendering
1759
+ ```tsx
1760
+ <AppSidebar
1761
+ renderItem={(item, defaultRender) => {
1762
+ if (item.href === "/my-tasks") {
1763
+ return <CustomTasksItem item={item} />
1764
+ }
1765
+ return null // use default for all other items
1766
+ }}
1767
+ />
1768
+ ```
1769
+
1680
1770
  ## BottomNavbar
1681
1771
  - Import: @devalok/shilp-sutra/shell/bottom-navbar
1682
1772
  - Server-safe: No
package/llms.txt CHANGED
@@ -4,6 +4,11 @@
4
4
  > Built on the same primitives as shadcn/ui but with key API differences.
5
5
  > Read this file BEFORE writing any UI code. Do NOT guess from shadcn/ui knowledge.
6
6
 
7
+ ## BREAKING CHANGES (v0.11.0 — dark mode)
8
+ - Dark mode interactive colors shifted: --color-interactive pink-400→pink-500, --color-interactive-hover pink-300→pink-600, --color-interactive-active pink-200→pink-700, --color-interactive-subtle pink-950→pink-1000
9
+ - Dark mode text status colors shifted: --color-text-error red-200→red-300, --color-text-success green-200→green-300, --color-text-warning yellow-200→yellow-300, --color-text-link blue-200→blue-300, --color-text-brand pink-300→pink-400
10
+ - New primitive token: --pink-1000 (#150208) near-black
11
+
7
12
  ## BREAKING CHANGES (v0.8.0)
8
13
  - Combobox: Now uses discriminated union. Single: `multiple?: false, value: string, onValueChange: (v: string) => void`. Multiple: `multiple: true, value: string[], onValueChange: (v: string[]) => void`. No more `v as string[]` casts.
9
14
  - StatusBadge: Pass either `status` OR `color`, not both (discriminated union).
@@ -160,6 +165,17 @@ NOTIFICATION SELECTION GUIDE:
160
165
  ### Shell Components (app-level layout)
161
166
  - TopBar: pageTitle, user, onNavigate, onLogout, notificationSlot, mobileLogo, userMenuItems?(UserMenuItem[] — custom items between Profile and theme toggle, supports icon, href, onClick, separator, badge, disabled, color)
162
167
  - AppSidebar: navigation tree with NavItem[], NavGroup[]
168
+
169
+ ### AppSidebar (v0.10.0 additions)
170
+ - NavItem.children?: NavSubItem[] — collapsible sub-list with chevron toggle
171
+ - NavItem.defaultOpen?: boolean — control initial collapsed state
172
+ - NavItem.badge?: string | number — badge on nav item (99+ cap for numbers)
173
+ - NavGroup.action?: ReactNode — action button next to group label
174
+ - footer?: SidebarFooterConfig — structured footer with links, version, slot (replaces footerLinks)
175
+ - headerSlot?: ReactNode — content between user info and navigation
176
+ - preFooterSlot?: ReactNode — content between navigation and footer
177
+ - renderItem?: (item, defaultRender) => ReactNode | null — custom item rendering
178
+
163
179
  - BottomNavbar: mobile navigation, user is optional (not required to render)
164
180
  - NotificationCenter: notifications[], onMarkRead, onMarkAllRead, onNavigate, getNotificationRoute?(returns string|null, fallback null), footerSlot?, emptyState?, headerActions?, popoverClassName?, onDismiss?(id)
165
181
  - AppCommandPalette: user, isAdmin, onNavigate, onSearch, searchResults, isSearching, onSearchResultSelect