@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.
- package/dist/composed/avatar-group.js +54 -55
- package/dist/ui/avatar.d.ts.map +1 -1
- package/dist/ui/avatar.js +71 -64
- package/dist/ui/checkbox.js +1 -1
- package/docs/components/composed/avatar-group.md +5 -0
- package/docs/components/ui/avatar.md +4 -0
- package/llms-full.txt +10 -1
- package/llms.txt +3 -1
- package/package.json +1 -1
|
@@ -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
|
|
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
|
|
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
|
-
},
|
|
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
|
|
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
|
|
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:
|
|
33
|
-
size:
|
|
32
|
+
max: m = 4,
|
|
33
|
+
size: s,
|
|
34
34
|
showTooltip: M = !0,
|
|
35
35
|
borderColor: T = "surface-2",
|
|
36
|
-
onOverflowClick:
|
|
37
|
-
renderAvatar:
|
|
38
|
-
expandDirection:
|
|
39
|
-
expandAmount:
|
|
36
|
+
onOverflowClick: p,
|
|
37
|
+
renderAvatar: h,
|
|
38
|
+
expandDirection: z = "right",
|
|
39
|
+
expandAmount: C = "default",
|
|
40
40
|
className: S,
|
|
41
41
|
...j
|
|
42
|
-
},
|
|
43
|
-
const
|
|
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
|
-
}[
|
|
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
|
-
}[
|
|
56
|
-
function
|
|
57
|
-
if (!
|
|
58
|
-
const t =
|
|
59
|
-
return
|
|
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
|
|
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:
|
|
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: () =>
|
|
71
|
-
onMouseLeave: () =>
|
|
72
|
-
onFocus: () =>
|
|
70
|
+
onMouseEnter: () => d(!0),
|
|
71
|
+
onMouseLeave: () => d(!1),
|
|
72
|
+
onFocus: () => d(!0),
|
|
73
73
|
onBlur: (e) => {
|
|
74
|
-
e.currentTarget.contains(e.relatedTarget) ||
|
|
74
|
+
e.currentTarget.contains(e.relatedTarget) || d(!1);
|
|
75
75
|
},
|
|
76
76
|
...j,
|
|
77
77
|
children: [
|
|
78
|
-
|
|
78
|
+
a.map((e, t) => {
|
|
79
79
|
const X = B(e.name);
|
|
80
|
-
if (
|
|
80
|
+
if (h)
|
|
81
81
|
return /* @__PURE__ */ r(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
84
|
className: o(
|
|
85
|
-
|
|
86
|
-
d,
|
|
85
|
+
"shrink-0",
|
|
87
86
|
t > 0 && c,
|
|
88
|
-
|
|
89
|
-
e.ring && e.ring !== "none" &&
|
|
87
|
+
u,
|
|
88
|
+
e.ring && e.ring !== "none" && w[e.ring]
|
|
90
89
|
),
|
|
91
|
-
style: { zIndex:
|
|
92
|
-
children:
|
|
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
|
|
101
|
-
d,
|
|
100
|
+
g,
|
|
102
101
|
t > 0 && c,
|
|
103
|
-
|
|
104
|
-
e.ring && e.ring !== "none" &&
|
|
102
|
+
u,
|
|
103
|
+
e.ring && e.ring !== "none" && w[e.ring]
|
|
105
104
|
),
|
|
106
|
-
style: { zIndex:
|
|
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(
|
|
122
|
-
/* @__PURE__ */ r(
|
|
120
|
+
return M ? /* @__PURE__ */ n(x, { children: [
|
|
121
|
+
/* @__PURE__ */ r(y, { asChild: !0, children: v }),
|
|
123
122
|
/* @__PURE__ */ r(
|
|
124
|
-
|
|
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(
|
|
134
|
-
/* @__PURE__ */ r(
|
|
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:
|
|
137
|
+
onClick: p,
|
|
139
138
|
className: o(
|
|
140
|
-
|
|
141
|
-
|
|
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:
|
|
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
|
-
|
|
157
|
-
|
|
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:
|
|
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
|
-
|
|
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(
|
|
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
|
] })
|
package/dist/ui/avatar.d.ts.map
CHANGED
|
@@ -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;
|
|
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
|
|
3
|
-
import * as
|
|
4
|
-
import { F as
|
|
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
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
48
|
+
}, j = {
|
|
49
49
|
circle: "rounded-ds-full",
|
|
50
50
|
square: "rounded-ds-none",
|
|
51
51
|
rounded: "rounded-ds-md"
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{ bg: "bg-
|
|
60
|
-
{ bg: "bg-
|
|
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
|
|
63
|
-
let
|
|
64
|
-
for (let
|
|
65
|
-
|
|
66
|
-
const n = Math.abs(
|
|
67
|
-
return
|
|
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
|
|
70
|
-
const m = n ?? "circle",
|
|
71
|
-
if (
|
|
72
|
-
return /* @__PURE__ */
|
|
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(
|
|
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
|
|
80
|
-
return /* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
|
|
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:
|
|
85
|
-
className: r(
|
|
90
|
+
ref: g,
|
|
91
|
+
className: r(p({ size: e, shape: n }), o),
|
|
86
92
|
...c,
|
|
87
93
|
children: d
|
|
88
94
|
}
|
|
89
95
|
),
|
|
90
|
-
|
|
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[
|
|
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[
|
|
103
|
+
"aria-label": h[t]
|
|
98
104
|
}
|
|
99
|
-
) : /* @__PURE__ */
|
|
100
|
-
|
|
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
|
|
113
|
+
) : typeof s == "number" ? /* @__PURE__ */ a(
|
|
108
114
|
f.span,
|
|
109
115
|
{
|
|
110
116
|
initial: { scale: 0 },
|
|
111
117
|
animate: { scale: 1 },
|
|
112
|
-
transition:
|
|
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": `${
|
|
117
|
-
children:
|
|
122
|
+
"aria-label": `${s > 99 ? "99+" : s} notifications`,
|
|
123
|
+
children: s > 99 ? "99+" : s
|
|
118
124
|
}
|
|
119
|
-
) : /* @__PURE__ */
|
|
120
|
-
] }) });
|
|
125
|
+
) : /* @__PURE__ */ a("span", { className: "absolute -right-1 -top-1", "data-slot": "avatar-badge-custom", children: s }))
|
|
126
|
+
] }) }) });
|
|
121
127
|
});
|
|
122
|
-
|
|
123
|
-
const
|
|
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:
|
|
134
|
+
transition: k.smooth,
|
|
129
135
|
className: "absolute inset-0 h-full w-full",
|
|
130
|
-
children: /* @__PURE__ */
|
|
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
|
-
...
|
|
141
|
+
...e
|
|
136
142
|
}
|
|
137
143
|
)
|
|
138
144
|
}
|
|
139
145
|
));
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
|
|
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:
|
|
152
|
+
ref: i,
|
|
147
153
|
"data-slot": "avatar-fallback",
|
|
148
154
|
className: r(
|
|
149
|
-
"flex h-full w-full items-center justify-center",
|
|
150
|
-
|
|
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
|
-
|
|
160
|
+
u,
|
|
154
161
|
o
|
|
155
162
|
),
|
|
156
|
-
...
|
|
163
|
+
...t,
|
|
157
164
|
children: n
|
|
158
165
|
}
|
|
159
166
|
);
|
|
160
167
|
});
|
|
161
|
-
|
|
168
|
+
z.displayName = C.displayName;
|
|
162
169
|
export {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
L as Avatar,
|
|
171
|
+
z as AvatarFallback,
|
|
172
|
+
B as AvatarImage,
|
|
173
|
+
p as avatarVariants
|
|
167
174
|
};
|
package/dist/ui/checkbox.js
CHANGED
|
@@ -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-
|
|
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.
|
|
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
|
|