@devalok/shilp-sutra 0.22.2 → 0.22.3

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.
@@ -4,22 +4,22 @@ import * as b from "react";
4
4
  import { ag as $ } from "../_chunks/vendor-utils.js";
5
5
  import { cn as o } from "../ui/lib/utils.js";
6
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";
7
+ import { TooltipProvider as H, Tooltip as x, TooltipTrigger as y, TooltipContent as N } from "../ui/tooltip.js";
8
8
  import { getInitials as B } from "./lib/string-utils.js";
9
- const I = {
9
+ const w = {
10
10
  lead: "ring-2 ring-accent-7 ring-offset-1 ring-offset-surface-2",
11
11
  admin: "ring-2 ring-warning-7 ring-offset-1 ring-offset-surface-2",
12
12
  client: "ring-2 ring-info-7 ring-offset-1 ring-offset-surface-2"
13
- }, g = $(
13
+ }, I = $(
14
14
  "shrink-0 overflow-hidden rounded-ds-full border-2",
15
15
  {
16
16
  variants: {
17
17
  size: {
18
- xs: "h-ds-xs w-ds-xs text-[10px]",
19
- sm: "h-ds-sm w-ds-sm text-ds-xs",
20
- md: "h-ds-md w-ds-md text-ds-sm",
21
- lg: "h-ds-lg w-ds-lg text-ds-md",
22
- xl: "h-ds-xl w-ds-xl text-ds-md"
18
+ xs: "h-ds-xs w-ds-xs",
19
+ sm: "h-ds-sm w-ds-sm",
20
+ md: "h-ds-md w-ds-md",
21
+ lg: "h-ds-lg w-ds-lg",
22
+ xl: "h-ds-xl w-ds-xl"
23
23
  }
24
24
  },
25
25
  defaultVariants: {
@@ -29,81 +29,80 @@ const I = {
29
29
  ), L = b.forwardRef(
30
30
  ({
31
31
  users: l,
32
- max: p = 4,
33
- size: a,
32
+ max: m = 4,
33
+ size: s,
34
34
  showTooltip: M = !0,
35
35
  borderColor: T = "surface-2",
36
- onOverflowClick: h,
37
- renderAvatar: u,
38
- expandDirection: C = "right",
39
- expandAmount: z = "default",
36
+ onOverflowClick: p,
37
+ renderAvatar: h,
38
+ expandDirection: z = "right",
39
+ expandAmount: C = "default",
40
40
  className: S,
41
41
  ...j
42
- }, A) => {
43
- const s = l.slice(0, p), i = l.length - p, c = {
42
+ }, k) => {
43
+ const a = l.slice(0, m), i = l.length - m, c = {
44
44
  xs: "-ml-ds-02",
45
45
  sm: "-ml-ds-02b",
46
46
  md: "-ml-ds-03",
47
47
  lg: "-ml-ds-04",
48
48
  xl: "-ml-ds-05"
49
- }[a ?? "md"], d = T === "surface-1" ? "border-surface-1" : "border-surface-2", [P, f] = b.useState(!1), k = {
49
+ }[s ?? "md"], g = T === "surface-1" ? "border-surface-1" : "border-surface-2", [A, d] = b.useState(!1), P = {
50
50
  xs: 8,
51
51
  sm: 10,
52
52
  md: 12,
53
53
  lg: 16,
54
54
  xl: 20
55
- }[a ?? "md"], R = { compact: 0.5, default: 1, wide: 1.5 }[z], V = s.length + (i > 0 ? 1 : 0);
56
- function m(e) {
57
- if (!P) return "translateX(0)";
58
- const t = k * R;
59
- return C === "left" ? `translateX(-${(V - 1 - e) * t}px)` : `translateX(${e * t}px)`;
55
+ }[s ?? "md"], R = { compact: 0.5, default: 1, wide: 1.5 }[C], V = a.length + (i > 0 ? 1 : 0);
56
+ function f(e) {
57
+ if (!A) return "translateX(0)";
58
+ const t = P * R;
59
+ return z === "left" ? `translateX(-${(V - 1 - e) * t}px)` : `translateX(${e * t}px)`;
60
60
  }
61
- const x = "transition-[transform,opacity] duration-300 ease-out hover:z-50 hover:scale-105 group-hover:[&:not(:hover)]:opacity-85";
61
+ const u = "transition-[transform,opacity] duration-300 ease-out hover:z-50 hover:scale-105 group-hover:[&:not(:hover)]:opacity-85";
62
62
  return /* @__PURE__ */ r(H, { children: /* @__PURE__ */ n(
63
63
  "div",
64
64
  {
65
- ref: A,
65
+ ref: k,
66
66
  role: "group",
67
67
  "aria-label": `${l.length} team members`,
68
68
  tabIndex: 0,
69
69
  className: o("group flex items-center", S),
70
- onMouseEnter: () => f(!0),
71
- onMouseLeave: () => f(!1),
72
- onFocus: () => f(!0),
70
+ onMouseEnter: () => d(!0),
71
+ onMouseLeave: () => d(!1),
72
+ onFocus: () => d(!0),
73
73
  onBlur: (e) => {
74
- e.currentTarget.contains(e.relatedTarget) || f(!1);
74
+ e.currentTarget.contains(e.relatedTarget) || d(!1);
75
75
  },
76
76
  ...j,
77
77
  children: [
78
- s.map((e, t) => {
78
+ a.map((e, t) => {
79
79
  const X = B(e.name);
80
- if (u)
80
+ if (h)
81
81
  return /* @__PURE__ */ r(
82
82
  "div",
83
83
  {
84
84
  className: o(
85
- g({ size: a }),
86
- d,
85
+ "shrink-0",
87
86
  t > 0 && c,
88
- x,
89
- e.ring && e.ring !== "none" && I[e.ring]
87
+ u,
88
+ e.ring && e.ring !== "none" && w[e.ring]
90
89
  ),
91
- style: { zIndex: s.length - t, transform: m(t) },
92
- children: u(e, t)
90
+ style: { zIndex: a.length - t, transform: f(t) },
91
+ children: h(e, t)
93
92
  },
94
93
  e.name
95
94
  );
96
95
  const v = /* @__PURE__ */ n(
97
96
  E,
98
97
  {
98
+ size: s,
99
99
  className: o(
100
- g({ size: a }),
101
- d,
100
+ g,
102
101
  t > 0 && c,
103
- x,
104
- e.ring && e.ring !== "none" && I[e.ring]
102
+ u,
103
+ e.ring && e.ring !== "none" && w[e.ring]
105
104
  ),
106
- style: { zIndex: s.length - t, transform: m(t) },
105
+ style: { zIndex: a.length - t, transform: f(t) },
107
106
  children: [
108
107
  e.image && /* @__PURE__ */ r(F, { src: e.image, alt: e.name }),
109
108
  /* @__PURE__ */ r(
@@ -118,10 +117,10 @@ const I = {
118
117
  },
119
118
  e.name
120
119
  );
121
- return M ? /* @__PURE__ */ n(y, { children: [
122
- /* @__PURE__ */ r(N, { asChild: !0, children: v }),
120
+ return M ? /* @__PURE__ */ n(x, { children: [
121
+ /* @__PURE__ */ r(y, { asChild: !0, children: v }),
123
122
  /* @__PURE__ */ r(
124
- w,
123
+ N,
125
124
  {
126
125
  className: "border-surface-border-strong bg-surface-1 text-surface-fg",
127
126
  sideOffset: 6,
@@ -130,20 +129,20 @@ const I = {
130
129
  )
131
130
  ] }, e.name) : v;
132
131
  }),
133
- i > 0 && /* @__PURE__ */ n(y, { children: [
134
- /* @__PURE__ */ r(N, { asChild: !0, children: h ? /* @__PURE__ */ n(
132
+ i > 0 && /* @__PURE__ */ n(x, { children: [
133
+ /* @__PURE__ */ r(y, { asChild: !0, children: p ? /* @__PURE__ */ n(
135
134
  "button",
136
135
  {
137
136
  type: "button",
138
- onClick: h,
137
+ onClick: p,
139
138
  className: o(
140
- g({ size: a }),
141
- d,
139
+ I({ size: s }),
140
+ g,
142
141
  c,
143
142
  "flex cursor-pointer items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
144
143
  "hover:scale-105 hover:bg-accent-3 transition-[transform,background-color] duration-300 ease-out"
145
144
  ),
146
- style: { zIndex: 0, transform: m(s.length) },
145
+ style: { zIndex: 0, transform: f(a.length) },
147
146
  children: [
148
147
  "+",
149
148
  i
@@ -153,13 +152,13 @@ const I = {
153
152
  "div",
154
153
  {
155
154
  className: o(
156
- g({ size: a }),
157
- d,
155
+ I({ size: s }),
156
+ g,
158
157
  c,
159
158
  "flex cursor-default items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
160
159
  "transition-[transform,opacity] duration-300 ease-out"
161
160
  ),
162
- style: { zIndex: 0, transform: m(s.length) },
161
+ style: { zIndex: 0, transform: f(a.length) },
163
162
  children: [
164
163
  "+",
165
164
  i
@@ -167,11 +166,11 @@ const I = {
167
166
  }
168
167
  ) }),
169
168
  /* @__PURE__ */ r(
170
- w,
169
+ N,
171
170
  {
172
171
  className: "border-surface-border-strong bg-surface-1 text-surface-fg",
173
172
  sideOffset: 6,
174
- children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-ds-01", children: l.slice(p).map((e, t) => /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name }, t)) })
173
+ children: /* @__PURE__ */ r("div", { className: "flex flex-col gap-ds-01", children: l.slice(m).map((e, t) => /* @__PURE__ */ r("p", { className: "text-ds-sm", children: e.name }, t)) })
175
174
  }
176
175
  )
177
176
  ] })
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAUjE,eAAO,MAAM,cAAc;;;8EAmB1B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AAoE7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EACnF,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC,SAAS,CAAA;IACxC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,QAAA,MAAM,MAAM,qFA6EV,CAAA;AAGF,QAAA,MAAM,WAAW,gKAgBf,CAAA;AAGF,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC;IACvE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,cAAc,6FAiClB,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/ui/avatar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAYjE,eAAO,MAAM,cAAc;;;8EAmB1B,CAAA;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjE,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;AA6E7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EACnF,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,gCAAgC;IAChC,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC,SAAS,CAAA;IACxC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,QAAA,MAAM,MAAM,qFA+EV,CAAA;AAGF,QAAA,MAAM,WAAW,gKAgBf,CAAA;AAGF,MAAM,WAAW,mBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC;IACvE;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,cAAc,6FAmClB,CAAA;AAGF,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,CAAA"}
package/dist/ui/avatar.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsx as s, jsxs as R } from "react/jsx-runtime";
3
- import * as i from "react";
4
- import { F as y, J as N, K as k } from "../_chunks/primitives.js";
2
+ import { jsx as a, jsxs as R } from "react/jsx-runtime";
3
+ import * as l from "react";
4
+ import { F as v, J as N, K as C } from "../_chunks/primitives.js";
5
5
  import { ag as F } from "../_chunks/vendor-utils.js";
6
- import { springs as C } from "./lib/motion.js";
6
+ import { springs as k } from "./lib/motion.js";
7
7
  import { cn as r } from "./lib/utils.js";
8
8
  import { m as f } from "../_chunks/framer.js";
9
- const A = i.createContext("circle"), x = F(
9
+ const A = l.createContext("circle"), M = l.createContext("md"), p = F(
10
10
  "relative flex shrink-0 overflow-hidden",
11
11
  {
12
12
  variants: {
@@ -35,7 +35,7 @@ const A = i.createContext("circle"), x = F(
35
35
  offline: "Offline",
36
36
  busy: "Busy",
37
37
  away: "Away"
38
- }, w = {
38
+ }, y = {
39
39
  xs: "h-ds-02b w-ds-02b",
40
40
  sm: "h-[8px] w-[8px]",
41
41
  md: "h-ds-03 w-ds-03",
@@ -45,123 +45,130 @@ const A = i.createContext("circle"), x = F(
45
45
  lead: "ring-accent-7",
46
46
  admin: "ring-warning-7",
47
47
  client: "ring-info-7"
48
- }, S = {
48
+ }, j = {
49
49
  circle: "rounded-ds-full",
50
50
  square: "rounded-ds-none",
51
51
  rounded: "rounded-ds-md"
52
- }, v = [
53
- { bg: "bg-accent-2", text: "text-accent-11" },
54
- { bg: "bg-success-2", text: "text-success-11" },
55
- { bg: "bg-warning-2", text: "text-warning-11" },
56
- { bg: "bg-error-2", text: "text-error-11" },
57
- { bg: "bg-info-2", text: "text-info-11" },
58
- { bg: "bg-cat-purple-2", text: "text-cat-purple-11" },
59
- { bg: "bg-cat-pink-2", text: "text-cat-pink-11" },
60
- { bg: "bg-cat-teal-2", text: "text-cat-teal-11" }
52
+ }, q = {
53
+ xs: "text-[9px]",
54
+ sm: "text-ds-xs",
55
+ md: "text-ds-sm",
56
+ lg: "text-ds-md",
57
+ xl: "text-ds-lg"
58
+ }, w = [
59
+ { bg: "bg-accent-3", text: "text-accent-11" },
60
+ { bg: "bg-success-3", text: "text-success-11" },
61
+ { bg: "bg-warning-3", text: "text-warning-11" },
62
+ { bg: "bg-error-3", text: "text-error-11" },
63
+ { bg: "bg-info-3", text: "text-info-11" },
64
+ { bg: "bg-category-teal-3", text: "text-category-teal-11" },
65
+ { bg: "bg-category-indigo-3", text: "text-category-indigo-11" },
66
+ { bg: "bg-category-cyan-3", text: "text-category-cyan-11" }
61
67
  ];
62
- function j(o) {
63
- let a = 5381;
64
- for (let e = 0; e < o.length; e++)
65
- a = (a << 5) + a + o.charCodeAt(e) | 0;
66
- const n = Math.abs(a) % v.length;
67
- return v[n];
68
+ function I(o) {
69
+ let e = 5381;
70
+ for (let t = 0; t < o.length; t++)
71
+ e = (e << 5) + e + o.charCodeAt(t) | 0;
72
+ const n = Math.abs(e) % w.length;
73
+ return w[n];
68
74
  }
69
- const q = i.forwardRef(({ className: o, size: a, shape: n, status: e, ring: l, badge: t, loading: g, children: d, ...c }, u) => {
70
- const m = n ?? "circle", p = l && l !== "none" ? r("ring-2 ring-offset-2 ring-offset-surface-2", O[l], S[m]) : void 0;
71
- if (g)
72
- return /* @__PURE__ */ s("span", { ref: u, className: r("relative inline-flex shrink-0", p), children: /* @__PURE__ */ s(
75
+ const L = l.forwardRef(({ className: o, size: e, shape: n, status: t, ring: i, badge: s, loading: x, children: d, ...c }, g) => {
76
+ const m = n ?? "circle", u = i && i !== "none" ? r("ring-2 ring-offset-2 ring-offset-surface-2", O[i], j[m]) : void 0;
77
+ if (x)
78
+ return /* @__PURE__ */ a("span", { ref: g, className: r("relative inline-flex shrink-0", u), children: /* @__PURE__ */ a(
73
79
  "span",
74
80
  {
75
- className: r(x({ size: a, shape: n }), "animate-pulse bg-surface-3"),
81
+ className: r(p({ size: e, shape: n }), "animate-pulse bg-surface-3"),
76
82
  "data-slot": "avatar-skeleton"
77
83
  }
78
84
  ) });
79
- const M = t !== void 0 && t !== 0;
80
- return /* @__PURE__ */ s(A.Provider, { value: m, children: /* @__PURE__ */ R("span", { className: r("relative inline-flex shrink-0", p), children: [
81
- /* @__PURE__ */ s(
82
- y,
85
+ const S = s !== void 0 && s !== 0;
86
+ return /* @__PURE__ */ a(A.Provider, { value: m, children: /* @__PURE__ */ a(M.Provider, { value: e ?? "md", children: /* @__PURE__ */ R("span", { className: r("relative inline-flex shrink-0", u), children: [
87
+ /* @__PURE__ */ a(
88
+ v,
83
89
  {
84
- ref: u,
85
- className: r(x({ size: a, shape: n }), o),
90
+ ref: g,
91
+ className: r(p({ size: e, shape: n }), o),
86
92
  ...c,
87
93
  children: d
88
94
  }
89
95
  ),
90
- e && (e === "online" ? /* @__PURE__ */ s(
96
+ t && (t === "online" ? /* @__PURE__ */ a(
91
97
  f.span,
92
98
  {
93
- className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-surface-2", b[e], w[a ?? "md"]),
99
+ className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-surface-2", b[t], y[e ?? "md"]),
94
100
  animate: { opacity: [1, 0.75, 1] },
95
101
  transition: { duration: 2.5, repeat: 1 / 0, ease: "easeInOut" },
96
102
  role: "img",
97
- "aria-label": h[e]
103
+ "aria-label": h[t]
98
104
  }
99
- ) : /* @__PURE__ */ s("span", { className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-surface-2", b[e], w[a ?? "md"]), role: "img", "aria-label": h[e] })),
100
- M && (t === "dot" ? /* @__PURE__ */ s(
105
+ ) : /* @__PURE__ */ a("span", { className: r("absolute bottom-0 right-0 rounded-ds-full ring-2 ring-surface-2", b[t], y[e ?? "md"]), role: "img", "aria-label": h[t] })),
106
+ S && (s === "dot" ? /* @__PURE__ */ a(
101
107
  "span",
102
108
  {
103
109
  className: "absolute -right-0.5 -top-0.5 h-[8px] w-[8px] rounded-ds-full bg-error-9 ring-2 ring-surface-2",
104
110
  "data-slot": "avatar-badge-dot",
105
111
  "aria-hidden": "true"
106
112
  }
107
- ) : typeof t == "number" ? /* @__PURE__ */ s(
113
+ ) : typeof s == "number" ? /* @__PURE__ */ a(
108
114
  f.span,
109
115
  {
110
116
  initial: { scale: 0 },
111
117
  animate: { scale: 1 },
112
- transition: C.bouncy,
118
+ transition: k.bouncy,
113
119
  className: "absolute -right-1 -top-1 flex min-w-[16px] items-center justify-center rounded-ds-full bg-error-9 px-1 text-[10px] font-bold leading-[16px] text-error-fg ring-2 ring-surface-2",
114
120
  "data-slot": "avatar-badge",
115
121
  role: "status",
116
- "aria-label": `${t > 99 ? "99+" : t} notifications`,
117
- children: t > 99 ? "99+" : t
122
+ "aria-label": `${s > 99 ? "99+" : s} notifications`,
123
+ children: s > 99 ? "99+" : s
118
124
  }
119
- ) : /* @__PURE__ */ s("span", { className: "absolute -right-1 -top-1", "data-slot": "avatar-badge-custom", children: t }))
120
- ] }) });
125
+ ) : /* @__PURE__ */ a("span", { className: "absolute -right-1 -top-1", "data-slot": "avatar-badge-custom", children: s }))
126
+ ] }) }) });
121
127
  });
122
- q.displayName = y.displayName;
123
- const I = i.forwardRef(({ className: o, ...a }, n) => /* @__PURE__ */ s(
128
+ L.displayName = v.displayName;
129
+ const B = l.forwardRef(({ className: o, ...e }, n) => /* @__PURE__ */ a(
124
130
  f.span,
125
131
  {
126
132
  initial: { opacity: 0, scale: 0.96 },
127
133
  animate: { opacity: 1, scale: 1 },
128
- transition: C.smooth,
134
+ transition: k.smooth,
129
135
  className: "absolute inset-0 h-full w-full",
130
- children: /* @__PURE__ */ s(
136
+ children: /* @__PURE__ */ a(
131
137
  N,
132
138
  {
133
139
  ref: n,
134
140
  className: r("aspect-square h-full w-full", o),
135
- ...a
141
+ ...e
136
142
  }
137
143
  )
138
144
  }
139
145
  ));
140
- I.displayName = N.displayName;
141
- const L = i.forwardRef(({ className: o, colorSeed: a, children: n, ...e }, l) => {
142
- const t = typeof n == "string" ? n : "", d = j(a ?? t), c = i.useContext(A), u = c === "square" ? "rounded-ds-none" : c === "rounded" ? "rounded-ds-md" : "rounded-ds-full", m = t.length === 1 ? "tracking-wide" : "tracking-normal";
143
- return /* @__PURE__ */ s(
144
- k,
146
+ B.displayName = N.displayName;
147
+ const z = l.forwardRef(({ className: o, colorSeed: e, children: n, ...t }, i) => {
148
+ const s = typeof n == "string" ? n : "", d = I(e ?? s), c = l.useContext(A), g = l.useContext(M), m = c === "square" ? "rounded-ds-none" : c === "rounded" ? "rounded-ds-md" : "rounded-ds-full", u = s.length === 1 ? "tracking-wide" : "tracking-normal";
149
+ return /* @__PURE__ */ a(
150
+ C,
145
151
  {
146
- ref: l,
152
+ ref: i,
147
153
  "data-slot": "avatar-fallback",
148
154
  className: r(
149
- "flex h-full w-full items-center justify-center",
150
- u,
155
+ "flex h-full w-full items-center justify-center font-semibold",
156
+ m,
157
+ q[g],
151
158
  d.bg,
152
159
  d.text,
153
- m,
160
+ u,
154
161
  o
155
162
  ),
156
- ...e,
163
+ ...t,
157
164
  children: n
158
165
  }
159
166
  );
160
167
  });
161
- L.displayName = k.displayName;
168
+ z.displayName = C.displayName;
162
169
  export {
163
- q as Avatar,
164
- L as AvatarFallback,
165
- I as AvatarImage,
166
- x as avatarVariants
170
+ L as Avatar,
171
+ z as AvatarFallback,
172
+ B as AvatarImage,
173
+ p as avatarVariants
167
174
  };
@@ -30,7 +30,7 @@ const L = n.forwardRef(({ className: h, error: u, indeterminate: a, checked: s,
30
30
  "data-[state=unchecked]:hover:border-accent-7 data-[state=unchecked]:hover:bg-surface-4",
31
31
  "data-[state=checked]:bg-accent-9 data-[state=checked]:border-accent-7 data-[state=checked]:text-accent-fg",
32
32
  "data-[state=indeterminate]:bg-accent-9 data-[state=indeterminate]:border-accent-7 data-[state=indeterminate]:text-accent-fg",
33
- u && "border-error-7 bg-error-2",
33
+ u && "border-error-7 bg-error-3",
34
34
  h
35
35
  ),
36
36
  ...m,
@@ -43,8 +43,13 @@
43
43
  - Missing `image` falls back to initials derived from `name`
44
44
  - Hover expand animation uses CSS `group-hover` — parent must not clip overflow
45
45
  - `borderColor` should match the surface context the group sits on (e.g., `surface-1` on cards)
46
+ - `renderAvatar` wrapper is positioning-only — pass `size` directly to your Avatar (do NOT use `className="h-full w-full"`)
46
47
 
47
48
  ## Changes
49
+ ### v0.22.3
50
+ - **Fixed** `renderAvatar` wrapper no longer clips consumer Avatar content (removed overflow-hidden, border, and size classes from wrapper)
51
+ - **Fixed** Removed redundant text-size classes from wrapper — Avatar handles font scaling internally
52
+
48
53
  ### v0.21.0
49
54
  - **Added** `xs` and `xl` size variants
50
55
  - **Added** `borderColor` prop for overlap border matching surface context
@@ -34,11 +34,15 @@
34
34
  ## Gotchas
35
35
  - Status dot renders with role="img" and aria-label (accessible, not decorative)
36
36
  - Dot size scales automatically with avatar size
37
+ - AvatarFallback font size scales automatically with avatar size (via AvatarSizeContext)
37
38
  - Ring offset color matches the surface context — ensure it sits on the expected background
38
39
  - Badge is hidden when value is `0` (falsy); use `"dot"` for presence without a count
39
40
  - Online status dot pulses with a CSS animation
40
41
 
41
42
  ## Changes
43
+ ### v0.22.3
44
+ - **Fixed** AvatarFallback text now auto-scales with avatar size — xs gets `text-[9px]`, sm `text-ds-xs`, md `text-ds-sm`, lg `text-ds-md`, xl `text-ds-lg`
45
+
42
46
  ### v0.22.0
43
47
  - **Fixed** Fallback always rendered `rounded-ds-full` regardless of `shape` prop. Now uses `AvatarShapeContext` to inherit the correct border-radius from `shape="square"` or `shape="rounded"`.
44
48
 
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.22.2
8
+ > Version: 0.22.3
9
9
 
10
10
  ---
11
11
 
@@ -353,11 +353,15 @@ Note: getFormFieldA11y() was removed in favor of useFormField() hook.
353
353
  ## Gotchas
354
354
  - Status dot renders with role="img" and aria-label (accessible, not decorative)
355
355
  - Dot size scales automatically with avatar size
356
+ - AvatarFallback font size scales automatically with avatar size (via AvatarSizeContext)
356
357
  - Ring offset color matches the surface context — ensure it sits on the expected background
357
358
  - Badge is hidden when value is `0` (falsy); use `"dot"` for presence without a count
358
359
  - Online status dot pulses with a CSS animation
359
360
 
360
361
  ## Changes
362
+ ### v0.22.3
363
+ - **Fixed** AvatarFallback text now auto-scales with avatar size — xs gets `text-[9px]`, sm `text-ds-xs`, md `text-ds-sm`, lg `text-ds-md`, xl `text-ds-lg`
364
+
361
365
  ### v0.22.0
362
366
  - **Fixed** Fallback always rendered `rounded-ds-full` regardless of `shape` prop. Now uses `AvatarShapeContext` to inherit the correct border-radius from `shape="square"` or `shape="rounded"`.
363
367
 
@@ -3042,8 +3046,13 @@ export default function RootLayout({ children }) {
3042
3046
  - Missing `image` falls back to initials derived from `name`
3043
3047
  - Hover expand animation uses CSS `group-hover` — parent must not clip overflow
3044
3048
  - `borderColor` should match the surface context the group sits on (e.g., `surface-1` on cards)
3049
+ - `renderAvatar` wrapper is positioning-only — pass `size` directly to your Avatar (do NOT use `className="h-full w-full"`)
3045
3050
 
3046
3051
  ## Changes
3052
+ ### v0.22.3
3053
+ - **Fixed** `renderAvatar` wrapper no longer clips consumer Avatar content (removed overflow-hidden, border, and size classes from wrapper)
3054
+ - **Fixed** Removed redundant text-size classes from wrapper — Avatar handles font scaling internally
3055
+
3047
3056
  ### v0.21.0
3048
3057
  - **Added** `xs` and `xl` size variants
3049
3058
  - **Added** `borderColor` prop for overlap border matching surface context
package/llms.txt CHANGED
@@ -101,7 +101,9 @@
101
101
 
102
102
  **Tooltip**: Auto-wraps with `<TooltipProvider>` — no manual provider needed. Text color fixed for dark mode.
103
103
 
104
- **Avatar fallback**: Now respects `shape` prop (was always circle).
104
+ **Avatar fallback**: Now respects `shape` prop (was always circle). Font size auto-scales with avatar size (v0.22.3).
105
+
106
+ **AvatarGroup renderAvatar**: Wrapper is positioning-only — pass `size` directly to your Avatar, do NOT use `className="h-full w-full"` (v0.22.3).
105
107
 
106
108
  **New hover states**: Checkbox, Radio, Switch track, Select items, DropdownMenu items, Combobox trigger.
107
109
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.22.2",
3
+ "version": "0.22.3",
4
4
  "description": "Devalok Design System — tokens, components, and patterns for Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",