@devalok/shilp-sutra 0.20.1 → 0.22.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 (101) hide show
  1. package/dist/_chunks/primitives.js +2 -2
  2. package/dist/_chunks/use-calendar.js +115 -115
  3. package/dist/_chunks/vendor-utils.js +1230 -1178
  4. package/dist/composed/activity-feed.d.ts.map +1 -1
  5. package/dist/composed/activity-feed.js +78 -78
  6. package/dist/composed/avatar-group.d.ts +13 -1
  7. package/dist/composed/avatar-group.d.ts.map +1 -1
  8. package/dist/composed/avatar-group.js +127 -50
  9. package/dist/composed/command-palette.js +50 -50
  10. package/dist/composed/content-card.js +10 -10
  11. package/dist/composed/empty-state.d.ts.map +1 -1
  12. package/dist/composed/empty-state.js +58 -48
  13. package/dist/composed/global-loading.d.ts.map +1 -1
  14. package/dist/composed/global-loading.js +11 -10
  15. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  16. package/dist/composed/loading-skeleton.js +32 -29
  17. package/dist/composed/member-picker.d.ts.map +1 -1
  18. package/dist/composed/member-picker.js +28 -17
  19. package/dist/composed/page-header.js +25 -25
  20. package/dist/composed/priority-indicator.d.ts.map +1 -1
  21. package/dist/composed/priority-indicator.js +60 -36
  22. package/dist/composed/rich-text-editor.js +104 -104
  23. package/dist/composed/schedule-view.d.ts.map +1 -1
  24. package/dist/composed/schedule-view.js +53 -45
  25. package/dist/composed/status-badge.js +16 -16
  26. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  27. package/dist/shell/bottom-navbar.js +35 -31
  28. package/dist/shell/notification-center.d.ts.map +1 -1
  29. package/dist/shell/notification-center.js +119 -111
  30. package/dist/shell/sidebar.js +2 -2
  31. package/dist/shell/top-bar.js +9 -9
  32. package/dist/tailwind/index.cjs +30 -3
  33. package/dist/tailwind/preset.d.ts.map +1 -1
  34. package/dist/tailwind/preset.js +30 -3
  35. package/dist/tokens/semantic.css +10 -10
  36. package/dist/tokens/typography-semantic.css +3 -3
  37. package/dist/ui/accordion.js +22 -22
  38. package/dist/ui/alert.js +8 -8
  39. package/dist/ui/avatar.d.ts +23 -1
  40. package/dist/ui/avatar.d.ts.map +1 -1
  41. package/dist/ui/avatar.js +124 -60
  42. package/dist/ui/badge.js +5 -5
  43. package/dist/ui/banner.js +18 -18
  44. package/dist/ui/breadcrumb.js +23 -23
  45. package/dist/ui/button.js +22 -22
  46. package/dist/ui/card.js +16 -16
  47. package/dist/ui/checkbox.d.ts.map +1 -1
  48. package/dist/ui/checkbox.js +72 -25
  49. package/dist/ui/chip.js +14 -14
  50. package/dist/ui/code.js +9 -9
  51. package/dist/ui/combobox.d.ts.map +1 -1
  52. package/dist/ui/combobox.js +46 -45
  53. package/dist/ui/dialog.js +17 -17
  54. package/dist/ui/dropdown-menu.js +22 -22
  55. package/dist/ui/form.d.ts.map +1 -1
  56. package/dist/ui/form.js +35 -29
  57. package/dist/ui/index.d.ts +1 -1
  58. package/dist/ui/index.d.ts.map +1 -1
  59. package/dist/ui/input.js +20 -20
  60. package/dist/ui/label.js +15 -15
  61. package/dist/ui/lib/motion.d.ts.map +1 -1
  62. package/dist/ui/lib/motion.js +2 -2
  63. package/dist/ui/link.js +14 -14
  64. package/dist/ui/number-input.js +36 -36
  65. package/dist/ui/pagination.js +14 -14
  66. package/dist/ui/progress.js +6 -6
  67. package/dist/ui/radio.d.ts.map +1 -1
  68. package/dist/ui/radio.js +24 -12
  69. package/dist/ui/search-input.d.ts.map +1 -1
  70. package/dist/ui/search-input.js +25 -19
  71. package/dist/ui/select.js +15 -15
  72. package/dist/ui/separator.d.ts +10 -2
  73. package/dist/ui/separator.d.ts.map +1 -1
  74. package/dist/ui/separator.js +16 -15
  75. package/dist/ui/sheet.js +7 -7
  76. package/dist/ui/sidebar.d.ts +1 -1
  77. package/dist/ui/sidebar.d.ts.map +1 -1
  78. package/dist/ui/sidebar.js +22 -22
  79. package/dist/ui/skeleton.js +5 -5
  80. package/dist/ui/slider.js +7 -7
  81. package/dist/ui/stat-card.js +19 -19
  82. package/dist/ui/switch.d.ts.map +1 -1
  83. package/dist/ui/switch.js +14 -13
  84. package/dist/ui/tabs.d.ts.map +1 -1
  85. package/dist/ui/tabs.js +60 -51
  86. package/dist/ui/textarea.js +15 -15
  87. package/dist/ui/toast.js +1 -1
  88. package/dist/ui/toggle.js +5 -5
  89. package/dist/ui/tooltip.d.ts +1 -1
  90. package/dist/ui/tooltip.d.ts.map +1 -1
  91. package/dist/ui/tooltip.js +49 -41
  92. package/docs/components/composed/avatar-group.md +29 -4
  93. package/docs/components/ui/avatar.md +23 -5
  94. package/docs/components/ui/button.md +5 -0
  95. package/docs/components/ui/checkbox.md +5 -0
  96. package/docs/components/ui/dropdown-menu.md +3 -0
  97. package/docs/components/ui/separator.md +3 -0
  98. package/docs/components/ui/tooltip.md +5 -0
  99. package/llms-full.txt +74 -10
  100. package/llms.txt +22 -2
  101. package/package.json +1 -1
@@ -1 +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;AAW9B,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,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;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;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EAAE,EACrB,MAAM,CAAC,EAAE,WAAW,GACnB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,EAAE,CA6C5C;AA8ID,QAAA,MAAM,YAAY,0FAiGjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
1
+ {"version":3,"file":"activity-feed.d.ts","sourceRoot":"","sources":["../../src/composed/activity-feed.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B,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,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;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;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAiBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EAAE,EACrB,MAAM,CAAC,EAAE,WAAW,GACnB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,YAAY,EAAE,CAAA;CAAE,EAAE,CA6C5C;AA8ID,QAAA,MAAM,YAAY,0FAqGjB,CAAA;AAGD,OAAO,EAAE,YAAY,EAAE,CAAA"}
@@ -1,87 +1,87 @@
1
1
  "use client";
2
- import { jsx as t, jsxs as a } from "react/jsx-runtime";
3
- import * as N from "react";
4
- import { cn as r } from "../ui/lib/utils.js";
5
- import { IconChevronRight as S } from "@tabler/icons-react";
6
- import { Avatar as O, AvatarImage as C, AvatarFallback as F } from "../ui/avatar.js";
7
- import { Button as D } from "../ui/button.js";
2
+ import { jsx as t, jsxs as s } from "react/jsx-runtime";
3
+ import * as k from "react";
4
+ import { cn as i } from "../ui/lib/utils.js";
5
+ import { IconChevronRight as F } from "@tabler/icons-react";
6
+ import { Avatar as W, AvatarImage as j, AvatarFallback as E } from "../ui/avatar.js";
7
+ import { Button as S } from "../ui/button.js";
8
8
  import { Skeleton as v } from "../ui/skeleton.js";
9
- import { getInitials as W } from "./lib/string-utils.js";
10
- import { formatRelativeTime as j } from "../ui/lib/date-utils.js";
11
- import { tweens as E } from "../ui/lib/motion.js";
12
- import { m as R } from "../_chunks/framer.js";
13
- const L = {
9
+ import { getInitials as R } from "./lib/string-utils.js";
10
+ import { formatRelativeTime as L } from "../ui/lib/date-utils.js";
11
+ import { tweens as D } from "../ui/lib/motion.js";
12
+ import { m as T } from "../_chunks/framer.js";
13
+ const z = {
14
14
  default: "bg-surface-fg-subtle",
15
15
  success: "bg-success-9",
16
16
  warning: "bg-warning-9",
17
17
  error: "bg-error-9",
18
18
  info: "bg-info-9"
19
- }, z = {
19
+ }, B = {
20
20
  today: "Today",
21
21
  yesterday: "Yesterday",
22
22
  thisWeek: "This Week",
23
23
  older: "Older"
24
24
  };
25
- function B(e, s) {
26
- const o = { ...z, ...s }, d = /* @__PURE__ */ new Date(), c = new Date(d.getFullYear(), d.getMonth(), d.getDate()), n = new Date(c.getTime() - 24 * 60 * 60 * 1e3), l = d.getDay(), b = l === 0 ? 6 : l - 1, y = new Date(
27
- c.getTime() - b * 24 * 60 * 60 * 1e3
28
- ), f = [], m = [], u = [], p = [];
29
- for (const i of e) {
30
- const x = (typeof i.timestamp == "string" ? new Date(i.timestamp) : i.timestamp).getTime();
31
- x >= c.getTime() ? f.push(i) : x >= n.getTime() ? m.push(i) : x >= y.getTime() ? u.push(i) : p.push(i);
25
+ function G(e, a) {
26
+ const d = { ...B, ...a }, o = /* @__PURE__ */ new Date(), c = new Date(o.getFullYear(), o.getMonth(), o.getDate()), n = new Date(c.getTime() - 24 * 60 * 60 * 1e3), r = o.getDay(), y = r === 0 ? 6 : r - 1, b = new Date(
27
+ c.getTime() - y * 24 * 60 * 60 * 1e3
28
+ ), f = [], m = [], u = [], g = [];
29
+ for (const l of e) {
30
+ const x = (typeof l.timestamp == "string" ? new Date(l.timestamp) : l.timestamp).getTime();
31
+ x >= c.getTime() ? f.push(l) : x >= n.getTime() ? m.push(l) : x >= b.getTime() ? u.push(l) : g.push(l);
32
32
  }
33
33
  const h = [];
34
- return f.length > 0 && h.push({ label: o.today, items: f }), m.length > 0 && h.push({ label: o.yesterday, items: m }), u.length > 0 && h.push({ label: o.thisWeek, items: u }), p.length > 0 && h.push({ label: o.older, items: p }), h;
34
+ return f.length > 0 && h.push({ label: d.today, items: f }), m.length > 0 && h.push({ label: d.yesterday, items: m }), u.length > 0 && h.push({ label: d.thisWeek, items: u }), g.length > 0 && h.push({ label: d.older, items: g }), h;
35
35
  }
36
- function G({ compact: e }) {
37
- return /* @__PURE__ */ t("div", { className: r("flex flex-col", e ? "gap-1" : "gap-3"), children: [0, 1, 2].map((s) => /* @__PURE__ */ a("div", { className: "flex items-center gap-ds-03", children: [
36
+ function I({ compact: e }) {
37
+ return /* @__PURE__ */ t("div", { className: i("flex flex-col", e ? "gap-1" : "gap-3"), children: [0, 1, 2].map((a) => /* @__PURE__ */ s("div", { className: "flex items-center gap-ds-03", children: [
38
38
  /* @__PURE__ */ t(v, { className: "h-2 w-2 shrink-0 rounded-ds-full" }),
39
39
  !e && /* @__PURE__ */ t(v, { className: "h-4 w-4 shrink-0 rounded-ds-full" }),
40
- /* @__PURE__ */ t(v, { className: r("flex-1", e ? "h-3" : "h-4") }),
40
+ /* @__PURE__ */ t(v, { className: i("flex-1", e ? "h-3" : "h-4") }),
41
41
  /* @__PURE__ */ t(v, { className: "h-3 w-12" })
42
- ] }, s)) });
42
+ ] }, a)) });
43
43
  }
44
- function T({
44
+ function O({
45
45
  item: e,
46
- compact: s
46
+ compact: a
47
47
  }) {
48
- const [o, d] = N.useState(!1), c = e.color ?? "default", n = () => {
49
- e.detail && d((l) => !l);
48
+ const [d, o] = k.useState(!1), c = e.color ?? "default", n = () => {
49
+ e.detail && o((r) => !r);
50
50
  };
51
- return /* @__PURE__ */ a("div", { className: r("relative flex items-start", s ? "gap-ds-02" : "gap-ds-03"), children: [
51
+ return /* @__PURE__ */ s("div", { className: i("relative flex items-start", a ? "gap-ds-02" : "gap-ds-03"), children: [
52
52
  /* @__PURE__ */ t(
53
53
  "div",
54
54
  {
55
- className: r(
55
+ className: i(
56
56
  "relative z-10 mt-1.5 h-2 w-2 shrink-0 rounded-ds-full ring-2 ring-surface-1",
57
- L[c]
57
+ z[c]
58
58
  )
59
59
  }
60
60
  ),
61
- !s && e.actor && /* @__PURE__ */ a(O, { className: "h-5 w-5 shrink-0 text-[9px]", children: [
62
- e.actor.image && /* @__PURE__ */ t(C, { src: e.actor.image, alt: e.actor.name }),
63
- /* @__PURE__ */ t(F, { className: "text-[9px]", children: W(e.actor.name) })
61
+ !a && e.actor && /* @__PURE__ */ s(W, { className: "h-5 w-5 shrink-0 text-[9px]", children: [
62
+ e.actor.image && /* @__PURE__ */ t(j, { src: e.actor.image, alt: e.actor.name }),
63
+ /* @__PURE__ */ t(E, { className: "text-[9px]", children: R(e.actor.name) })
64
64
  ] }),
65
- /* @__PURE__ */ a("div", { className: "flex min-w-0 flex-1 flex-col", children: [
66
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between gap-ds-02", children: [
67
- /* @__PURE__ */ a("div", { className: r("min-w-0 flex-1 flex items-center gap-ds-01 flex-wrap", s ? "text-ds-xs" : "text-ds-sm"), children: [
68
- e.actor && /* @__PURE__ */ a("span", { className: "font-medium text-surface-fg", children: [
65
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-1 flex-col", children: [
66
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-ds-02", children: [
67
+ /* @__PURE__ */ s("div", { className: i("min-w-0 flex-1 flex items-center gap-ds-01 flex-wrap", a ? "text-ds-xs" : "text-ds-sm"), children: [
68
+ e.actor && /* @__PURE__ */ s("span", { className: "font-medium text-surface-fg", children: [
69
69
  e.actor.name,
70
70
  " "
71
71
  ] }),
72
- e.detail && /* @__PURE__ */ t(S, { className: r("h-3 w-3 shrink-0 text-surface-fg-subtle transition-transform", o && "rotate-90") }),
72
+ e.detail && /* @__PURE__ */ t(F, { className: i("h-3 w-3 shrink-0 text-surface-fg-subtle transition-transform duration-fast-02 ease-productive-standard", d && "rotate-90") }),
73
73
  /* @__PURE__ */ t(
74
74
  "span",
75
75
  {
76
- className: r(
76
+ className: i(
77
77
  "text-surface-fg-muted",
78
- e.detail && "cursor-pointer hover:underline"
78
+ e.detail && "cursor-pointer hover:underline hover:bg-surface-2 rounded-ds-md"
79
79
  ),
80
80
  onClick: n,
81
81
  role: e.detail ? "button" : void 0,
82
82
  tabIndex: e.detail ? 0 : void 0,
83
- onKeyDown: e.detail ? (l) => {
84
- (l.key === "Enter" || l.key === " ") && (l.preventDefault(), n());
83
+ onKeyDown: e.detail ? (r) => {
84
+ (r.key === "Enter" || r.key === " ") && (r.preventDefault(), n());
85
85
  } : void 0,
86
86
  children: e.action
87
87
  }
@@ -90,32 +90,32 @@ function T({
90
90
  /* @__PURE__ */ t(
91
91
  "time",
92
92
  {
93
- className: r(
93
+ className: i(
94
94
  "shrink-0 whitespace-nowrap text-surface-fg-subtle",
95
- s ? "text-ds-xs" : "text-ds-sm"
95
+ a ? "text-ds-xs" : "text-ds-sm"
96
96
  ),
97
97
  dateTime: (typeof e.timestamp == "string" ? new Date(e.timestamp) : e.timestamp).toISOString(),
98
- children: j(e.timestamp)
98
+ children: L(e.timestamp)
99
99
  }
100
100
  )
101
101
  ] }),
102
- o && e.detail && /* @__PURE__ */ t("div", { className: "mt-ds-02 animate-in fade-in slide-in-from-top-1 text-ds-sm text-surface-fg-muted", children: e.detail })
102
+ d && e.detail && /* @__PURE__ */ t("div", { className: "mt-ds-02 animate-in fade-in slide-in-from-top-1 text-ds-sm text-surface-fg-muted", children: e.detail })
103
103
  ] })
104
104
  ] });
105
105
  }
106
- function I({
106
+ function Y({
107
107
  label: e,
108
- isFirst: s
108
+ isFirst: a
109
109
  }) {
110
- return /* @__PURE__ */ a(
111
- R.div,
110
+ return /* @__PURE__ */ s(
111
+ T.div,
112
112
  {
113
113
  initial: { opacity: 0 },
114
114
  animate: { opacity: 1 },
115
- transition: E.fade,
116
- className: r(
115
+ transition: D.fade,
116
+ className: i(
117
117
  "flex items-center gap-ds-03",
118
- s ? "" : "mt-ds-06",
118
+ a ? "" : "mt-ds-06",
119
119
  "mb-ds-03"
120
120
  ),
121
121
  children: [
@@ -126,39 +126,39 @@ function I({
126
126
  }
127
127
  );
128
128
  }
129
- const Y = N.forwardRef(
129
+ const M = k.forwardRef(
130
130
  ({
131
131
  items: e,
132
- onLoadMore: s,
133
- loading: o = !1,
134
- hasMore: d = !1,
132
+ onLoadMore: a,
133
+ loading: d = !1,
134
+ hasMore: o = !1,
135
135
  emptyState: c,
136
136
  compact: n = !1,
137
- maxInitialItems: l,
138
- groupBy: b = "none",
139
- groupLabels: y,
137
+ maxInitialItems: r,
138
+ groupBy: y = "none",
139
+ groupLabels: b,
140
140
  className: f,
141
141
  ...m
142
142
  }, u) => {
143
- const [p, h] = N.useState(!1);
144
- if (o)
145
- return /* @__PURE__ */ t("div", { ref: u, className: r("relative", f), ...m, children: /* @__PURE__ */ t(G, { compact: n }) });
143
+ const [g, h] = k.useState(!1);
144
+ if (d)
145
+ return /* @__PURE__ */ t("div", { ref: u, className: i("relative", f), ...m, children: /* @__PURE__ */ t(I, { compact: n }) });
146
146
  if (e.length === 0)
147
147
  return c ? /* @__PURE__ */ t("div", { ref: u, className: f, ...m, children: c }) : null;
148
- const i = l != null && !p && e.length > l, w = i ? e.slice(0, l) : e, x = b === "time";
149
- return /* @__PURE__ */ a("div", { ref: u, className: r("relative", f), ...m, children: [
150
- x ? /* @__PURE__ */ t("div", { children: B(w, y).map((g, A) => /* @__PURE__ */ a("div", { children: [
151
- /* @__PURE__ */ t(I, { label: g.label, isFirst: A === 0 }),
152
- /* @__PURE__ */ a("div", { className: r("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
148
+ const l = r != null && !g && e.length > r, w = l ? e.slice(0, r) : e, x = y === "time";
149
+ return /* @__PURE__ */ s("div", { ref: u, className: i("relative", f), ...m, children: [
150
+ x ? /* @__PURE__ */ t("div", { children: G(w, b).map((p, N) => /* @__PURE__ */ s("div", { children: [
151
+ /* @__PURE__ */ t(Y, { label: p.label, isFirst: N === 0 }),
152
+ /* @__PURE__ */ s("div", { className: i("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
153
153
  /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-[3px] top-0 w-px bg-surface-border" }),
154
- g.items.map((k) => /* @__PURE__ */ t(T, { item: k, compact: n }, k.id))
154
+ p.items.map((A, C) => /* @__PURE__ */ t(T.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { ...D.fade, delay: C * 0.03 }, children: /* @__PURE__ */ t(O, { item: A, compact: n }) }, A.id))
155
155
  ] })
156
- ] }, g.label)) }) : /* @__PURE__ */ a("div", { className: r("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
156
+ ] }, p.label)) }) : /* @__PURE__ */ s("div", { className: i("relative flex flex-col", n ? "gap-1" : "gap-3"), children: [
157
157
  /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-[3px] top-0 w-px bg-surface-border" }),
158
- w.map((g) => /* @__PURE__ */ t(T, { item: g, compact: n }, g.id))
158
+ w.map((p, N) => /* @__PURE__ */ t(T.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, transition: { ...D.fade, delay: N * 0.03 }, children: /* @__PURE__ */ t(O, { item: p, compact: n }) }, p.id))
159
159
  ] }),
160
- i && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ a(
161
- D,
160
+ l && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ s(
161
+ S,
162
162
  {
163
163
  variant: "ghost",
164
164
  size: "sm",
@@ -170,12 +170,12 @@ const Y = N.forwardRef(
170
170
  ]
171
171
  }
172
172
  ) }),
173
- d && s && !i && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ t(D, { variant: "ghost", size: "sm", onClick: s, children: "Load more" }) })
173
+ o && a && !l && /* @__PURE__ */ t("div", { className: "relative mt-ds-03 flex justify-center", children: /* @__PURE__ */ t(S, { variant: "ghost", size: "sm", onClick: a, children: "Load more" }) })
174
174
  ] });
175
175
  }
176
176
  );
177
- Y.displayName = "ActivityFeed";
177
+ M.displayName = "ActivityFeed";
178
178
  export {
179
- Y as ActivityFeed,
180
- B as groupItemsByTime
179
+ M as ActivityFeed,
180
+ G as groupItemsByTime
181
181
  };
@@ -1,17 +1,29 @@
1
1
  "use client";
2
2
  import { VariantProps } from 'class-variance-authority';
3
+ import { AvatarRing } from '../ui/avatar';
3
4
  import * as React from 'react';
4
5
  declare const avatarSizeVariants: (props?: ({
5
- size?: "sm" | "md" | "lg" | null | undefined;
6
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
6
7
  } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
8
  export interface AvatarUser {
8
9
  name: string;
9
10
  image?: string | null;
11
+ ring?: AvatarRing;
10
12
  }
11
13
  export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof avatarSizeVariants> {
12
14
  users: AvatarUser[];
13
15
  max?: number;
14
16
  showTooltip?: boolean;
17
+ /** Border color for the group avatars. @default 'surface-2' */
18
+ borderColor?: 'surface-1' | 'surface-2';
19
+ /** Callback when the "+N" overflow badge is clicked */
20
+ onOverflowClick?: () => void;
21
+ /** Custom render function for each avatar */
22
+ renderAvatar?: (user: AvatarUser, index: number) => React.ReactNode;
23
+ /** Direction avatars expand on hover. @default 'right' */
24
+ expandDirection?: 'left' | 'right';
25
+ /** How much avatars spread apart on hover. @default 'default' */
26
+ expandAmount?: 'compact' | 'default' | 'wide';
15
27
  }
16
28
  declare const AvatarGroup: React.ForwardRefExoticComponent<AvatarGroupProps & React.RefAttributes<HTMLDivElement>>;
17
29
  export { AvatarGroup };
@@ -1 +1 @@
1
- {"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../src/composed/avatar-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAejE,QAAA,MAAM,kBAAkB;;8EAcvB,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;AAED,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,QAAA,MAAM,WAAW,yFAuFhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
1
+ {"version":3,"file":"avatar-group.d.ts","sourceRoot":"","sources":["../../src/composed/avatar-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAOjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAS9C,QAAA,MAAM,kBAAkB;;8EAgBvB,CAAA;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,IAAI,CAAC,EAAE,UAAU,CAAA;CAClB;AAED,MAAM,WAAW,gBACf,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAC1C,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,WAAW,GAAG,WAAW,CAAA;IACvC,uDAAuD;IACvD,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IAC5B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,CAAC,SAAS,CAAA;IACnE,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAClC,iEAAiE;IACjE,YAAY,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAA;CAC9C;AAED,QAAA,MAAM,WAAW,yFAkLhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,95 +1,172 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
3
- import * as y from "react";
4
- import { ag as w } from "../_chunks/vendor-utils.js";
5
- import { cn as o } from "../ui/lib/utils.js";
6
- import { Avatar as A, AvatarImage as T, AvatarFallback as C } from "../ui/avatar.js";
7
- import { TooltipProvider as I, Tooltip as f, TooltipTrigger as p, TooltipContent as h } from "../ui/tooltip.js";
8
- import { getInitials as j } from "./lib/string-utils.js";
9
- const g = w(
10
- "shrink-0 overflow-hidden rounded-ds-full border-2 border-surface-1",
2
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
3
+ import * as b from "react";
4
+ import { ag as $ } from "../_chunks/vendor-utils.js";
5
+ import { cn as n } from "../ui/lib/utils.js";
6
+ import { Avatar as E, AvatarImage as F, AvatarFallback as G } from "../ui/avatar.js";
7
+ import { TooltipProvider as H, Tooltip as y, TooltipTrigger as N, TooltipContent as w } from "../ui/tooltip.js";
8
+ import { getInitials as R } from "./lib/string-utils.js";
9
+ const p = $(
10
+ "shrink-0 overflow-hidden rounded-ds-full border-2",
11
11
  {
12
12
  variants: {
13
13
  size: {
14
+ xs: "h-ds-xs w-ds-xs text-[10px]",
14
15
  sm: "h-ds-xs w-ds-xs text-ds-xs",
15
16
  md: "h-ds-sm w-ds-sm text-ds-sm",
16
- lg: "h-ds-md w-ds-md text-ds-md"
17
+ lg: "h-ds-md w-ds-md text-ds-md",
18
+ xl: "h-ds-lg w-ds-lg text-ds-lg"
17
19
  }
18
20
  },
19
21
  defaultVariants: {
20
22
  size: "md"
21
23
  }
22
24
  }
23
- ), z = y.forwardRef(
24
- ({ users: t, max: d = 4, size: l, showTooltip: v = !0, className: x, ...b }, u) => {
25
- const i = t.slice(0, d), n = t.length - d, c = {
25
+ ), B = b.forwardRef(
26
+ ({
27
+ users: l,
28
+ max: g = 4,
29
+ size: s,
30
+ showTooltip: I = !0,
31
+ borderColor: T = "surface-2",
32
+ onOverflowClick: h,
33
+ renderAvatar: u,
34
+ expandDirection: M = "right",
35
+ expandAmount: C = "default",
36
+ className: z,
37
+ ...S
38
+ }, j) => {
39
+ const a = l.slice(0, g), c = l.length - g, d = {
40
+ xs: "-ml-ds-02",
26
41
  sm: "-ml-ds-02b",
27
42
  md: "-ml-ds-03",
28
- lg: "-ml-ds-04"
29
- }[l ?? "md"];
30
- return /* @__PURE__ */ e(I, { children: /* @__PURE__ */ s(
43
+ lg: "-ml-ds-04",
44
+ xl: "-ml-ds-05"
45
+ }[s ?? "md"], i = T === "surface-1" ? "border-surface-1" : "border-surface-2", [A, m] = b.useState(!1), P = {
46
+ xs: 8,
47
+ sm: 10,
48
+ md: 12,
49
+ lg: 16,
50
+ xl: 20
51
+ }[s ?? "md"], k = { compact: 0.5, default: 1, wide: 1.5 }[C], V = a.length + (c > 0 ? 1 : 0);
52
+ function f(e) {
53
+ if (!A) return "translateX(0)";
54
+ const t = P * k;
55
+ return M === "left" ? `translateX(-${(V - 1 - e) * t}px)` : `translateX(${e * t}px)`;
56
+ }
57
+ const x = "transition-[transform,opacity] duration-300 ease-out hover:z-50 hover:scale-105 group-hover:[&:not(:hover)]:opacity-85";
58
+ return /* @__PURE__ */ r(H, { children: /* @__PURE__ */ o(
31
59
  "div",
32
60
  {
33
- ref: u,
34
- className: o("flex items-center", x),
35
- ...b,
61
+ ref: j,
62
+ role: "group",
63
+ "aria-label": `${l.length} team members`,
64
+ tabIndex: 0,
65
+ className: n("group flex items-center", z),
66
+ onMouseEnter: () => m(!0),
67
+ onMouseLeave: () => m(!1),
68
+ onFocus: () => m(!0),
69
+ onBlur: (e) => {
70
+ e.currentTarget.contains(e.relatedTarget) || m(!1);
71
+ },
72
+ ...S,
36
73
  children: [
37
- i.map((a, r) => {
38
- const N = j(a.name), m = /* @__PURE__ */ s(
39
- A,
74
+ a.map((e, t) => {
75
+ const X = R(e.name);
76
+ if (u)
77
+ return /* @__PURE__ */ r(
78
+ "div",
79
+ {
80
+ className: n(
81
+ p({ size: s }),
82
+ i,
83
+ t > 0 && d,
84
+ x
85
+ ),
86
+ style: { zIndex: a.length - t, transform: f(t) },
87
+ children: u(e, t)
88
+ },
89
+ e.name
90
+ );
91
+ const v = /* @__PURE__ */ o(
92
+ E,
40
93
  {
41
- className: o(
42
- g({ size: l }),
43
- r > 0 && c
94
+ ring: e.ring,
95
+ className: n(
96
+ p({ size: s }),
97
+ i,
98
+ t > 0 && d,
99
+ x
44
100
  ),
45
- style: { zIndex: i.length - r },
101
+ style: { zIndex: a.length - t, transform: f(t) },
46
102
  children: [
47
- a.image && /* @__PURE__ */ e(T, { src: a.image, alt: a.name }),
48
- /* @__PURE__ */ e(
49
- C,
103
+ e.image && /* @__PURE__ */ r(F, { src: e.image, alt: e.name }),
104
+ /* @__PURE__ */ r(
105
+ G,
50
106
  {
51
107
  className: "font-body font-semibold",
52
- children: N
108
+ colorSeed: e.name,
109
+ children: X
53
110
  }
54
111
  )
55
112
  ]
56
113
  },
57
- a.name
114
+ e.name
58
115
  );
59
- return v ? /* @__PURE__ */ s(f, { children: [
60
- /* @__PURE__ */ e(p, { asChild: !0, children: m }),
61
- /* @__PURE__ */ e(
62
- h,
116
+ return I ? /* @__PURE__ */ o(y, { children: [
117
+ /* @__PURE__ */ r(N, { asChild: !0, children: v }),
118
+ /* @__PURE__ */ r(
119
+ w,
63
120
  {
64
121
  className: "border-surface-border-strong bg-surface-1 text-surface-fg",
65
122
  sideOffset: 6,
66
- children: /* @__PURE__ */ e("p", { className: "text-ds-sm", children: a.name })
123
+ children: /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name })
67
124
  }
68
125
  )
69
- ] }, a.name) : m;
126
+ ] }, e.name) : v;
70
127
  }),
71
- n > 0 && /* @__PURE__ */ s(f, { children: [
72
- /* @__PURE__ */ e(p, { asChild: !0, children: /* @__PURE__ */ s(
128
+ c > 0 && /* @__PURE__ */ o(y, { children: [
129
+ /* @__PURE__ */ r(N, { asChild: !0, children: h ? /* @__PURE__ */ o(
130
+ "button",
131
+ {
132
+ type: "button",
133
+ onClick: h,
134
+ className: n(
135
+ p({ size: s }),
136
+ i,
137
+ d,
138
+ "flex cursor-pointer items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
139
+ "hover:scale-105 hover:bg-accent-3 transition-[transform,background-color] duration-300 ease-out"
140
+ ),
141
+ style: { zIndex: 0, transform: f(a.length) },
142
+ children: [
143
+ "+",
144
+ c
145
+ ]
146
+ }
147
+ ) : /* @__PURE__ */ o(
73
148
  "div",
74
149
  {
75
- className: o(
76
- g({ size: l }),
77
- c,
78
- "flex cursor-default items-center justify-center bg-accent-2 font-body font-semibold text-accent-11"
150
+ className: n(
151
+ p({ size: s }),
152
+ i,
153
+ d,
154
+ "flex cursor-default items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
155
+ "transition-[transform,opacity] duration-300 ease-out"
79
156
  ),
80
- style: { zIndex: 0 },
157
+ style: { zIndex: 0, transform: f(a.length) },
81
158
  children: [
82
159
  "+",
83
- n
160
+ c
84
161
  ]
85
162
  }
86
163
  ) }),
87
- /* @__PURE__ */ e(
88
- h,
164
+ /* @__PURE__ */ r(
165
+ w,
89
166
  {
90
167
  className: "border-surface-border-strong bg-surface-1 text-surface-fg",
91
168
  sideOffset: 6,
92
- children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-ds-01", children: t.slice(d).map((a, r) => /* @__PURE__ */ e("p", { className: "text-ds-sm", children: a.name }, r)) })
169
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-ds-01", children: l.slice(g).map((e, t) => /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name }, t)) })
93
170
  }
94
171
  )
95
172
  ] })
@@ -98,7 +175,7 @@ const g = w(
98
175
  ) });
99
176
  }
100
177
  );
101
- z.displayName = "AvatarGroup";
178
+ B.displayName = "AvatarGroup";
102
179
  export {
103
- z as AvatarGroup
180
+ B as AvatarGroup
104
181
  };