@devalok/shilp-sutra 0.14.0 → 0.16.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 (43) hide show
  1. package/dist/_chunks/sidebar.js +21 -21
  2. package/dist/composed/activity-feed.d.ts +26 -0
  3. package/dist/composed/activity-feed.d.ts.map +1 -0
  4. package/dist/composed/activity-feed.js +132 -0
  5. package/dist/composed/command-palette.d.ts.map +1 -1
  6. package/dist/composed/command-palette.js +130 -110
  7. package/dist/composed/empty-state.d.ts +2 -0
  8. package/dist/composed/empty-state.d.ts.map +1 -1
  9. package/dist/composed/empty-state.js +30 -24
  10. package/dist/composed/index.d.ts +4 -0
  11. package/dist/composed/index.d.ts.map +1 -1
  12. package/dist/composed/index.js +31 -26
  13. package/dist/composed/upload-progress.d.ts +33 -0
  14. package/dist/composed/upload-progress.d.ts.map +1 -0
  15. package/dist/composed/upload-progress.js +386 -0
  16. package/dist/shell/bottom-navbar.d.ts +2 -0
  17. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  18. package/dist/shell/bottom-navbar.js +70 -52
  19. package/dist/shell/notification-center.js +1 -1
  20. package/dist/shell/sidebar.d.ts +2 -0
  21. package/dist/shell/sidebar.d.ts.map +1 -1
  22. package/dist/shell/sidebar.js +99 -98
  23. package/dist/ui/color-input.js +1 -1
  24. package/dist/ui/data-table.d.ts +35 -1
  25. package/dist/ui/data-table.d.ts.map +1 -1
  26. package/dist/ui/data-table.js +423 -277
  27. package/dist/ui/index.d.ts +1 -1
  28. package/dist/ui/index.d.ts.map +1 -1
  29. package/dist/ui/index.js +143 -136
  30. package/dist/ui/input.js +9 -9
  31. package/dist/ui/number-input.js +9 -9
  32. package/dist/ui/search-input.js +1 -1
  33. package/dist/ui/select.js +1 -1
  34. package/dist/ui/skeleton.d.ts +44 -1
  35. package/dist/ui/skeleton.d.ts.map +1 -1
  36. package/dist/ui/skeleton.js +209 -14
  37. package/dist/ui/stat-card.d.ts +20 -0
  38. package/dist/ui/stat-card.d.ts.map +1 -1
  39. package/dist/ui/stat-card.js +173 -37
  40. package/dist/ui/textarea.js +10 -10
  41. package/llms-full.txt +88 -3
  42. package/llms.txt +11 -0
  43. package/package.json +1 -1
@@ -26,13 +26,13 @@ const X = z([
26
26
  variants: {
27
27
  size: {
28
28
  sm: "h-ds-sm text-ds-sm px-ds-03",
29
- md: "h-ds-md text-ds-base px-ds-04",
30
- lg: "h-ds-lg text-ds-lg px-ds-05"
29
+ md: "h-ds-md text-ds-md px-ds-04",
30
+ lg: "h-ds-lg text-ds-md px-ds-05"
31
31
  }
32
32
  },
33
33
  defaultVariants: { size: "md" }
34
34
  }), T = B.forwardRef(({ className: a, type: e, state: t, size: d, startIcon: s, endIcon: n, ...c }, f) => {
35
- const l = K(), u = t ?? (l.state === "helper" ? void 0 : l.state), b = c["aria-describedby"] ?? l.helperTextId, g = c["aria-required"] ?? l.required, y = r("input", { type: e, className: i(X({ size: d }), s && "pl-ds-07", n && "pr-ds-07", u === "error" && "border-border-error focus-visible:ring-error", u === "warning" && "border-border-warning focus-visible:ring-warning", u === "success" && "border-border-success focus-visible:ring-success", a), "aria-invalid": u === "error" || void 0, "aria-describedby": b, "aria-required": g || void 0, ref: f, ...c });
35
+ const l = K(), u = t ?? (l.state === "helper" ? void 0 : l.state), m = c["aria-describedby"] ?? l.helperTextId, g = c["aria-required"] ?? l.required, y = r("input", { type: e, className: i(X({ size: d }), s && "pl-ds-07", n && "pr-ds-07", u === "error" && "border-border-error focus-visible:ring-error", u === "warning" && "border-border-warning focus-visible:ring-warning", u === "success" && "border-border-success focus-visible:ring-success", a), "aria-invalid": u === "error" || void 0, "aria-describedby": m, "aria-required": g || void 0, ref: f, ...c });
36
36
  return !s && !n ? y : x("div", { className: "relative flex items-center w-full", children: [s && r("span", { className: "absolute left-ds-03 flex items-center text-text-secondary pointer-events-none [&>svg]:h-ico-sm [&>svg]:w-ico-sm", children: s }), y, n && r("span", { className: "absolute right-ds-03 flex items-center text-text-secondary pointer-events-none [&>svg]:h-ico-sm [&>svg]:w-ico-sm", children: n })] });
37
37
  });
38
38
  T.displayName = "Input";
@@ -55,16 +55,16 @@ const te = o(
55
55
  children: n,
56
56
  ...c
57
57
  }, f) => {
58
- const l = G(), [u, b] = _(!1), [g, y] = _(a), h = e ?? g, w = C(
58
+ const l = G(), [u, m] = _(!1), [g, y] = _(a), h = e ?? g, w = C(
59
59
  (p) => {
60
- const m = typeof p == "function" ? p(h) : p;
61
- t ? t(m) : y(m), document.cookie = `${Y}=${m}; path=/; max-age=${J}`;
60
+ const b = typeof p == "function" ? p(h) : p;
61
+ t ? t(b) : y(b), document.cookie = `${Y}=${b}; path=/; max-age=${J}`;
62
62
  },
63
63
  [t, h]
64
- ), S = C(() => l ? b((p) => !p) : w((p) => !p), [l, w, b]);
64
+ ), S = C(() => l ? m((p) => !p) : w((p) => !p), [l, w, m]);
65
65
  j(() => {
66
- const p = (m) => {
67
- m.key === ae && (m.metaKey || m.ctrlKey) && (m.preventDefault(), S());
66
+ const p = (b) => {
67
+ b.key === ae && (b.metaKey || b.ctrlKey) && (b.preventDefault(), S());
68
68
  };
69
69
  return window.addEventListener("keydown", p), () => window.removeEventListener("keydown", p);
70
70
  }, [S]);
@@ -75,7 +75,7 @@ const te = o(
75
75
  setOpen: w,
76
76
  isMobile: l,
77
77
  openMobile: u,
78
- setOpenMobile: b,
78
+ setOpenMobile: m,
79
79
  toggleSidebar: S
80
80
  }),
81
81
  [
@@ -84,7 +84,7 @@ const te = o(
84
84
  w,
85
85
  l,
86
86
  u,
87
- b,
87
+ m,
88
88
  S
89
89
  ]
90
90
  );
@@ -117,7 +117,7 @@ const re = o(
117
117
  children: s,
118
118
  ...n
119
119
  }, c) => {
120
- const { isMobile: f, state: l, openMobile: u, setOpenMobile: b } = N();
120
+ const { isMobile: f, state: l, openMobile: u, setOpenMobile: m } = N();
121
121
  return t === "none" ? /* @__PURE__ */ r(
122
122
  "div",
123
123
  {
@@ -129,7 +129,7 @@ const re = o(
129
129
  ...n,
130
130
  children: s
131
131
  }
132
- ) : f ? /* @__PURE__ */ r(V, { open: u, onOpenChange: b, ...n, children: /* @__PURE__ */ r(
132
+ ) : f ? /* @__PURE__ */ r(V, { open: u, onOpenChange: m, ...n, children: /* @__PURE__ */ r(
133
133
  F,
134
134
  {
135
135
  "data-sidebar": "sidebar",
@@ -317,7 +317,7 @@ const ue = o(
317
317
  )
318
318
  );
319
319
  ue.displayName = "SidebarContent";
320
- const be = o(
320
+ const me = o(
321
321
  ({ className: a, ...e }, t) => /* @__PURE__ */ r(
322
322
  "div",
323
323
  {
@@ -328,7 +328,7 @@ const be = o(
328
328
  }
329
329
  )
330
330
  );
331
- be.displayName = "SidebarGroup";
331
+ me.displayName = "SidebarGroup";
332
332
  const pe = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ r(
333
333
  e ? v : "div",
334
334
  {
@@ -343,7 +343,7 @@ const pe = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ r(
343
343
  }
344
344
  ));
345
345
  pe.displayName = "SidebarGroupLabel";
346
- const me = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ r(
346
+ const be = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ r(
347
347
  e ? v : "button",
348
348
  {
349
349
  ref: d,
@@ -357,7 +357,7 @@ const me = o(({ className: a, asChild: e = !1, ...t }, d) => /* @__PURE__ */ r(
357
357
  ...t
358
358
  }
359
359
  ));
360
- me.displayName = "SidebarGroupAction";
360
+ be.displayName = "SidebarGroupAction";
361
361
  const fe = o(
362
362
  ({ className: a, ...e }, t) => /* @__PURE__ */ r(
363
363
  "div",
@@ -423,7 +423,7 @@ const xe = z(
423
423
  className: n,
424
424
  ...c
425
425
  }, f) => {
426
- const l = a ? v : "button", { isMobile: u, state: b } = N(), g = /* @__PURE__ */ r(
426
+ const l = a ? v : "button", { isMobile: u, state: m } = N(), g = /* @__PURE__ */ r(
427
427
  l,
428
428
  {
429
429
  ref: f,
@@ -443,7 +443,7 @@ const xe = z(
443
443
  {
444
444
  side: "right",
445
445
  align: "center",
446
- hidden: b !== "collapsed" || u,
446
+ hidden: m !== "collapsed" || u,
447
447
  ...s
448
448
  }
449
449
  )
@@ -567,9 +567,9 @@ export {
567
567
  ne as a,
568
568
  ce as b,
569
569
  ue as c,
570
- be as d,
570
+ me as d,
571
571
  pe as e,
572
- me as f,
572
+ be as f,
573
573
  fe as g,
574
574
  ge as h,
575
575
  le as i,
@@ -0,0 +1,26 @@
1
+ "use client";
2
+ import * as React from 'react';
3
+ export interface ActivityItem {
4
+ id: string;
5
+ actor?: {
6
+ name: string;
7
+ image?: string;
8
+ };
9
+ action: string | React.ReactNode;
10
+ timestamp: Date | string;
11
+ icon?: React.ReactNode;
12
+ color?: 'default' | 'success' | 'warning' | 'error' | 'info';
13
+ detail?: React.ReactNode;
14
+ }
15
+ export interface ActivityFeedProps extends React.HTMLAttributes<HTMLDivElement> {
16
+ items: ActivityItem[];
17
+ onLoadMore?: () => void;
18
+ loading?: boolean;
19
+ hasMore?: boolean;
20
+ emptyState?: React.ReactNode;
21
+ compact?: boolean;
22
+ maxInitialItems?: number;
23
+ }
24
+ declare const ActivityFeed: React.ForwardRefExoticComponent<ActivityFeedProps & React.RefAttributes<HTMLDivElement>>;
25
+ export { ActivityFeed };
26
+ //# sourceMappingURL=activity-feed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity-feed.d.ts","sourceRoot":"","sources":["../../src/composed/activity-feed.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IACxC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IAChC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAA;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;IAC5D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,MAAM,WAAW,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IAC7E,KAAK,EAAE,YAAY,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AA2ID,QAAA,MAAM,YAAY,0FA4EjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -0,0 +1,132 @@
1
+ "use client";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import * as u from "react";
4
+ import { c as s } from "../_chunks/utils.js";
5
+ import { IconChevronRight as y } from "@tabler/icons-react";
6
+ import { A as b, a as k, b as A } from "../_chunks/avatar.js";
7
+ import { B as v } from "../_chunks/button.js";
8
+ import { Skeleton as f } from "../ui/skeleton.js";
9
+ import { getInitials as D } from "./lib/string-utils.js";
10
+ const S = {
11
+ default: "bg-text-placeholder",
12
+ success: "bg-success",
13
+ warning: "bg-warning",
14
+ error: "bg-error",
15
+ info: "bg-interactive"
16
+ };
17
+ function j(e) {
18
+ const r = typeof e == "string" ? new Date(e) : e, c = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), i = Math.floor(c / 1e3), l = Math.floor(i / 60), a = Math.floor(l / 60), o = Math.floor(a / 24);
19
+ return i < 60 ? "just now" : l < 60 ? `${l}m ago` : a < 24 ? `${a}h ago` : o < 7 ? `${o}d ago` : r.toLocaleDateString();
20
+ }
21
+ function C({ compact: e }) {
22
+ return /* @__PURE__ */ t("div", { className: s("flex flex-col", e ? "gap-1" : "gap-3"), children: [0, 1, 2].map((r) => /* @__PURE__ */ n("div", { className: "flex items-center gap-ds-03", children: [
23
+ /* @__PURE__ */ t(f, { className: "h-2 w-2 shrink-0 rounded-ds-full" }),
24
+ !e && /* @__PURE__ */ t(f, { className: "h-4 w-4 shrink-0 rounded-ds-full" }),
25
+ /* @__PURE__ */ t(f, { className: s("flex-1", e ? "h-3" : "h-4") }),
26
+ /* @__PURE__ */ t(f, { className: "h-3 w-12" })
27
+ ] }, r)) });
28
+ }
29
+ function M({
30
+ item: e,
31
+ compact: r
32
+ }) {
33
+ const [d, c] = u.useState(!1), i = e.color ?? "default", l = () => {
34
+ e.detail && c((a) => !a);
35
+ };
36
+ return /* @__PURE__ */ n("div", { className: s("relative flex items-start", r ? "gap-ds-02" : "gap-ds-03"), children: [
37
+ /* @__PURE__ */ t(
38
+ "div",
39
+ {
40
+ className: s(
41
+ "relative z-10 mt-1.5 h-2 w-2 shrink-0 rounded-ds-full ring-2 ring-surface",
42
+ S[i]
43
+ )
44
+ }
45
+ ),
46
+ !r && e.actor && /* @__PURE__ */ n(b, { className: "h-5 w-5 shrink-0 text-[9px]", children: [
47
+ e.actor.image && /* @__PURE__ */ t(k, { src: e.actor.image, alt: e.actor.name }),
48
+ /* @__PURE__ */ t(A, { className: "text-[9px]", children: D(e.actor.name) })
49
+ ] }),
50
+ /* @__PURE__ */ n("div", { className: "flex min-w-0 flex-1 flex-col", children: [
51
+ /* @__PURE__ */ n("div", { className: "flex items-center justify-between gap-ds-02", children: [
52
+ /* @__PURE__ */ n("div", { className: s("min-w-0 flex-1 flex items-center gap-ds-01 flex-wrap", r ? "text-ds-xs" : "text-ds-sm"), children: [
53
+ e.actor && /* @__PURE__ */ n("span", { className: "font-medium text-text-primary", children: [
54
+ e.actor.name,
55
+ " "
56
+ ] }),
57
+ e.detail && /* @__PURE__ */ t(y, { className: s("h-3 w-3 shrink-0 text-text-placeholder transition-transform", d && "rotate-90") }),
58
+ /* @__PURE__ */ t(
59
+ "span",
60
+ {
61
+ className: s(
62
+ "text-text-secondary",
63
+ e.detail && "cursor-pointer hover:underline"
64
+ ),
65
+ onClick: l,
66
+ role: e.detail ? "button" : void 0,
67
+ tabIndex: e.detail ? 0 : void 0,
68
+ onKeyDown: e.detail ? (a) => {
69
+ (a.key === "Enter" || a.key === " ") && (a.preventDefault(), l());
70
+ } : void 0,
71
+ children: e.action
72
+ }
73
+ )
74
+ ] }),
75
+ /* @__PURE__ */ t(
76
+ "time",
77
+ {
78
+ className: s(
79
+ "shrink-0 whitespace-nowrap text-text-placeholder",
80
+ r ? "text-ds-xs" : "text-ds-sm"
81
+ ),
82
+ dateTime: (typeof e.timestamp == "string" ? new Date(e.timestamp) : e.timestamp).toISOString(),
83
+ children: j(e.timestamp)
84
+ }
85
+ )
86
+ ] }),
87
+ d && e.detail && /* @__PURE__ */ t("div", { className: "mt-ds-02 animate-in fade-in slide-in-from-top-1 text-ds-sm text-text-secondary", children: e.detail })
88
+ ] })
89
+ ] });
90
+ }
91
+ const R = u.forwardRef(
92
+ ({
93
+ items: e,
94
+ onLoadMore: r,
95
+ loading: d = !1,
96
+ hasMore: c = !1,
97
+ emptyState: i,
98
+ compact: l = !1,
99
+ maxInitialItems: a,
100
+ className: o,
101
+ ...h
102
+ }, m) => {
103
+ const [p, w] = u.useState(!1);
104
+ if (d)
105
+ return /* @__PURE__ */ t("div", { ref: m, className: s("relative", o), ...h, children: /* @__PURE__ */ t(C, { compact: l }) });
106
+ if (e.length === 0)
107
+ return i ? /* @__PURE__ */ t("div", { ref: m, className: o, ...h, children: i }) : null;
108
+ const x = a != null && !p && e.length > a, N = x ? e.slice(0, a) : e;
109
+ return /* @__PURE__ */ n("div", { ref: m, className: s("relative", o), ...h, children: [
110
+ /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-[3px] top-0 w-px bg-border" }),
111
+ /* @__PURE__ */ t("div", { className: s("relative flex flex-col", l ? "gap-1" : "gap-3"), children: N.map((g) => /* @__PURE__ */ t(M, { item: g, compact: l }, g.id)) }),
112
+ x && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ n(
113
+ v,
114
+ {
115
+ variant: "ghost",
116
+ size: "sm",
117
+ onClick: () => w(!0),
118
+ children: [
119
+ "Show all (",
120
+ e.length,
121
+ ")"
122
+ ]
123
+ }
124
+ ) }),
125
+ c && r && !x && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ t(v, { variant: "ghost", size: "sm", onClick: r, children: "Load more" }) })
126
+ ] });
127
+ }
128
+ );
129
+ R.displayName = "ActivityFeed";
130
+ export {
131
+ R as ActivityFeed
132
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,QAAA,MAAM,cAAc,4FAoSnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"command-palette.d.ts","sourceRoot":"","sources":["../../src/composed/command-palette.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAiB9B,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,WAAW,EAAE,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,YAAY,EAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAMD,QAAA,MAAM,cAAc,4FAoTnB,CAAA;AAID,OAAO,EAAE,cAAc,EAAE,CAAA"}