@devalok/shilp-sutra 0.22.0 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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;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
+ {"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;AAgB9C,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,yFAmLhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -1,104 +1,109 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
+ import { jsx as r, jsxs as n } from "react/jsx-runtime";
3
3
  import * as b from "react";
4
4
  import { ag as $ } from "../_chunks/vendor-utils.js";
5
- import { cn as n } from "../ui/lib/utils.js";
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
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 = $(
8
+ import { getInitials as B } from "./lib/string-utils.js";
9
+ const I = {
10
+ lead: "ring-2 ring-accent-7 ring-offset-1 ring-offset-surface-2",
11
+ admin: "ring-2 ring-warning-7 ring-offset-1 ring-offset-surface-2",
12
+ client: "ring-2 ring-info-7 ring-offset-1 ring-offset-surface-2"
13
+ }, g = $(
10
14
  "shrink-0 overflow-hidden rounded-ds-full border-2",
11
15
  {
12
16
  variants: {
13
17
  size: {
14
18
  xs: "h-ds-xs w-ds-xs text-[10px]",
15
- sm: "h-ds-xs w-ds-xs text-ds-xs",
16
- md: "h-ds-sm w-ds-sm text-ds-sm",
17
- lg: "h-ds-md w-ds-md text-ds-md",
18
- xl: "h-ds-lg w-ds-lg text-ds-lg"
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"
19
23
  }
20
24
  },
21
25
  defaultVariants: {
22
26
  size: "md"
23
27
  }
24
28
  }
25
- ), B = b.forwardRef(
29
+ ), L = b.forwardRef(
26
30
  ({
27
31
  users: l,
28
- max: g = 4,
29
- size: s,
30
- showTooltip: I = !0,
32
+ max: p = 4,
33
+ size: a,
34
+ showTooltip: M = !0,
31
35
  borderColor: T = "surface-2",
32
36
  onOverflowClick: h,
33
37
  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 = {
38
+ expandDirection: C = "right",
39
+ expandAmount: z = "default",
40
+ className: S,
41
+ ...j
42
+ }, A) => {
43
+ const s = l.slice(0, p), i = l.length - p, c = {
40
44
  xs: "-ml-ds-02",
41
45
  sm: "-ml-ds-02b",
42
46
  md: "-ml-ds-03",
43
47
  lg: "-ml-ds-04",
44
48
  xl: "-ml-ds-05"
45
- }[s ?? "md"], i = T === "surface-1" ? "border-surface-1" : "border-surface-2", [A, m] = b.useState(!1), P = {
49
+ }[a ?? "md"], d = T === "surface-1" ? "border-surface-1" : "border-surface-2", [P, f] = b.useState(!1), k = {
46
50
  xs: 8,
47
51
  sm: 10,
48
52
  md: 12,
49
53
  lg: 16,
50
54
  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)`;
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)`;
56
60
  }
57
61
  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(
62
+ return /* @__PURE__ */ r(H, { children: /* @__PURE__ */ n(
59
63
  "div",
60
64
  {
61
- ref: j,
65
+ ref: A,
62
66
  role: "group",
63
67
  "aria-label": `${l.length} team members`,
64
68
  tabIndex: 0,
65
- className: n("group flex items-center", z),
66
- onMouseEnter: () => m(!0),
67
- onMouseLeave: () => m(!1),
68
- onFocus: () => m(!0),
69
+ className: o("group flex items-center", S),
70
+ onMouseEnter: () => f(!0),
71
+ onMouseLeave: () => f(!1),
72
+ onFocus: () => f(!0),
69
73
  onBlur: (e) => {
70
- e.currentTarget.contains(e.relatedTarget) || m(!1);
74
+ e.currentTarget.contains(e.relatedTarget) || f(!1);
71
75
  },
72
- ...S,
76
+ ...j,
73
77
  children: [
74
- a.map((e, t) => {
75
- const X = R(e.name);
78
+ s.map((e, t) => {
79
+ const X = B(e.name);
76
80
  if (u)
77
81
  return /* @__PURE__ */ r(
78
82
  "div",
79
83
  {
80
- className: n(
81
- p({ size: s }),
82
- i,
83
- t > 0 && d,
84
- x
84
+ className: o(
85
+ g({ size: a }),
86
+ d,
87
+ t > 0 && c,
88
+ x,
89
+ e.ring && e.ring !== "none" && I[e.ring]
85
90
  ),
86
- style: { zIndex: a.length - t, transform: f(t) },
91
+ style: { zIndex: s.length - t, transform: m(t) },
87
92
  children: u(e, t)
88
93
  },
89
94
  e.name
90
95
  );
91
- const v = /* @__PURE__ */ o(
96
+ const v = /* @__PURE__ */ n(
92
97
  E,
93
98
  {
94
- ring: e.ring,
95
- className: n(
96
- p({ size: s }),
97
- i,
98
- t > 0 && d,
99
- x
99
+ className: o(
100
+ g({ size: a }),
101
+ d,
102
+ t > 0 && c,
103
+ x,
104
+ e.ring && e.ring !== "none" && I[e.ring]
100
105
  ),
101
- style: { zIndex: a.length - t, transform: f(t) },
106
+ style: { zIndex: s.length - t, transform: m(t) },
102
107
  children: [
103
108
  e.image && /* @__PURE__ */ r(F, { src: e.image, alt: e.name }),
104
109
  /* @__PURE__ */ r(
@@ -113,7 +118,7 @@ const p = $(
113
118
  },
114
119
  e.name
115
120
  );
116
- return I ? /* @__PURE__ */ o(y, { children: [
121
+ return M ? /* @__PURE__ */ n(y, { children: [
117
122
  /* @__PURE__ */ r(N, { asChild: !0, children: v }),
118
123
  /* @__PURE__ */ r(
119
124
  w,
@@ -125,39 +130,39 @@ const p = $(
125
130
  )
126
131
  ] }, e.name) : v;
127
132
  }),
128
- c > 0 && /* @__PURE__ */ o(y, { children: [
129
- /* @__PURE__ */ r(N, { asChild: !0, children: h ? /* @__PURE__ */ o(
133
+ i > 0 && /* @__PURE__ */ n(y, { children: [
134
+ /* @__PURE__ */ r(N, { asChild: !0, children: h ? /* @__PURE__ */ n(
130
135
  "button",
131
136
  {
132
137
  type: "button",
133
138
  onClick: h,
134
- className: n(
135
- p({ size: s }),
136
- i,
139
+ className: o(
140
+ g({ size: a }),
137
141
  d,
142
+ c,
138
143
  "flex cursor-pointer items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
139
144
  "hover:scale-105 hover:bg-accent-3 transition-[transform,background-color] duration-300 ease-out"
140
145
  ),
141
- style: { zIndex: 0, transform: f(a.length) },
146
+ style: { zIndex: 0, transform: m(s.length) },
142
147
  children: [
143
148
  "+",
144
- c
149
+ i
145
150
  ]
146
151
  }
147
- ) : /* @__PURE__ */ o(
152
+ ) : /* @__PURE__ */ n(
148
153
  "div",
149
154
  {
150
- className: n(
151
- p({ size: s }),
152
- i,
155
+ className: o(
156
+ g({ size: a }),
153
157
  d,
158
+ c,
154
159
  "flex cursor-default items-center justify-center bg-accent-2 font-body font-semibold text-accent-11",
155
160
  "transition-[transform,opacity] duration-300 ease-out"
156
161
  ),
157
- style: { zIndex: 0, transform: f(a.length) },
162
+ style: { zIndex: 0, transform: m(s.length) },
158
163
  children: [
159
164
  "+",
160
- c
165
+ i
161
166
  ]
162
167
  }
163
168
  ) }),
@@ -166,7 +171,7 @@ const p = $(
166
171
  {
167
172
  className: "border-surface-border-strong bg-surface-1 text-surface-fg",
168
173
  sideOffset: 6,
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)) })
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)) })
170
175
  }
171
176
  )
172
177
  ] })
@@ -175,7 +180,7 @@ const p = $(
175
180
  ) });
176
181
  }
177
182
  );
178
- B.displayName = "AvatarGroup";
183
+ L.displayName = "AvatarGroup";
179
184
  export {
180
- B as AvatarGroup
185
+ L as AvatarGroup
181
186
  };
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.0
8
+ > Version: 0.22.2
9
9
 
10
10
  ---
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devalok/shilp-sutra",
3
- "version": "0.22.0",
3
+ "version": "0.22.2",
4
4
  "description": "Devalok Design System — tokens, components, and patterns for Next.js",
5
5
  "license": "MIT",
6
6
  "type": "module",