@agentero/design-system 0.20.2 → 0.21.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"types": "./src/avatar/index.d.ts",
|
|
34
34
|
"import": "./src/avatar/index.js"
|
|
35
35
|
},
|
|
36
|
+
"./avatar-group": {
|
|
37
|
+
"types": "./src/avatar-group/index.d.ts",
|
|
38
|
+
"import": "./src/avatar-group/index.js"
|
|
39
|
+
},
|
|
36
40
|
"./button": {
|
|
37
41
|
"types": "./src/button/index.d.ts",
|
|
38
42
|
"import": "./src/button/index.js"
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ComponentProps, ComponentPropsWithRef, ReactNode } from 'react';
|
|
2
|
+
import { Avatar } from '../avatar';
|
|
3
|
+
type AvatarSize = ComponentProps<typeof Avatar>['size'];
|
|
4
|
+
type AvatarVariant = ComponentProps<typeof Avatar>['variant'];
|
|
5
|
+
export declare const avatarGroupRecipe: import('tailwind-variants').TVReturnType<{
|
|
6
|
+
size: {
|
|
7
|
+
xs: {
|
|
8
|
+
item: string;
|
|
9
|
+
};
|
|
10
|
+
sm: {
|
|
11
|
+
item: string;
|
|
12
|
+
};
|
|
13
|
+
md: {
|
|
14
|
+
item: string;
|
|
15
|
+
};
|
|
16
|
+
lg: {
|
|
17
|
+
item: string;
|
|
18
|
+
};
|
|
19
|
+
xl: {
|
|
20
|
+
item: string;
|
|
21
|
+
};
|
|
22
|
+
'2xl': {
|
|
23
|
+
item: string;
|
|
24
|
+
};
|
|
25
|
+
'3xl': {
|
|
26
|
+
item: string;
|
|
27
|
+
};
|
|
28
|
+
'4xl': {
|
|
29
|
+
item: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
root: string;
|
|
34
|
+
item: string;
|
|
35
|
+
}, undefined, {
|
|
36
|
+
size: {
|
|
37
|
+
xs: {
|
|
38
|
+
item: string;
|
|
39
|
+
};
|
|
40
|
+
sm: {
|
|
41
|
+
item: string;
|
|
42
|
+
};
|
|
43
|
+
md: {
|
|
44
|
+
item: string;
|
|
45
|
+
};
|
|
46
|
+
lg: {
|
|
47
|
+
item: string;
|
|
48
|
+
};
|
|
49
|
+
xl: {
|
|
50
|
+
item: string;
|
|
51
|
+
};
|
|
52
|
+
'2xl': {
|
|
53
|
+
item: string;
|
|
54
|
+
};
|
|
55
|
+
'3xl': {
|
|
56
|
+
item: string;
|
|
57
|
+
};
|
|
58
|
+
'4xl': {
|
|
59
|
+
item: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
root: string;
|
|
64
|
+
item: string;
|
|
65
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
66
|
+
size: {
|
|
67
|
+
xs: {
|
|
68
|
+
item: string;
|
|
69
|
+
};
|
|
70
|
+
sm: {
|
|
71
|
+
item: string;
|
|
72
|
+
};
|
|
73
|
+
md: {
|
|
74
|
+
item: string;
|
|
75
|
+
};
|
|
76
|
+
lg: {
|
|
77
|
+
item: string;
|
|
78
|
+
};
|
|
79
|
+
xl: {
|
|
80
|
+
item: string;
|
|
81
|
+
};
|
|
82
|
+
'2xl': {
|
|
83
|
+
item: string;
|
|
84
|
+
};
|
|
85
|
+
'3xl': {
|
|
86
|
+
item: string;
|
|
87
|
+
};
|
|
88
|
+
'4xl': {
|
|
89
|
+
item: string;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
}, {
|
|
93
|
+
root: string;
|
|
94
|
+
item: string;
|
|
95
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
96
|
+
export type AvatarGroupProps = Omit<ComponentPropsWithRef<'div'>, 'children'> & {
|
|
97
|
+
children?: ReactNode;
|
|
98
|
+
max?: number;
|
|
99
|
+
size?: AvatarSize;
|
|
100
|
+
/** Shape applied uniformly to every avatar and the `+N` bubble. Defaults to `circle`. */
|
|
101
|
+
variant?: AvatarVariant;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Stacks `<Avatar>` children into an overlapping row, collapsing everything past
|
|
105
|
+
* `max` (default 3) into a trailing `+N` bubble. Pass `<Avatar>` elements
|
|
106
|
+
* directly — the group clones each to force a uniform `size`/`variant` and the
|
|
107
|
+
* overlap, so wrapped children won't pick those up.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* <AvatarGroup size="sm" max={3}>
|
|
111
|
+
* <Avatar fallback="AL" colorize="Ada Lovelace" />
|
|
112
|
+
* <Avatar fallback="GH" colorize="Grace Hopper" />
|
|
113
|
+
* <Avatar fallback="MK" colorize="Mary Kom" />
|
|
114
|
+
* </AvatarGroup>
|
|
115
|
+
*/
|
|
116
|
+
export declare const AvatarGroup: ({ children, max, size, variant, className, ref, ...props }: AvatarGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Avatar as t } from "../avatar/avatar.js";
|
|
4
|
+
import { tv as n } from "tailwind-variants";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { Children as a, cloneElement as o, isValidElement as s } from "react";
|
|
7
|
+
//#region src/avatar-group/avatar-group.tsx
|
|
8
|
+
var c = n({
|
|
9
|
+
slots: {
|
|
10
|
+
root: "inline-flex items-center",
|
|
11
|
+
item: "relative first:ms-0 [--avatar-border-color:var(--color-bg-default-base-primary)] [--avatar-border-width:0.125rem]"
|
|
12
|
+
},
|
|
13
|
+
variants: { size: {
|
|
14
|
+
xs: { item: "-ms-1.5" },
|
|
15
|
+
sm: { item: "-ms-2" },
|
|
16
|
+
md: { item: "-ms-2.5" },
|
|
17
|
+
lg: { item: "-ms-3" },
|
|
18
|
+
xl: { item: "-ms-3.5" },
|
|
19
|
+
"2xl": { item: "-ms-4" },
|
|
20
|
+
"3xl": { item: "-ms-4.5" },
|
|
21
|
+
"4xl": { item: "-ms-5" }
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { size: "md" }
|
|
24
|
+
}), l = ({ children: n, max: l = 3, size: u = "md", variant: d, className: f, ref: p, ...m }) => {
|
|
25
|
+
let h = c({ size: u }), g = h.item(), _ = a.toArray(n).filter(s), v = _.slice(0, Math.max(0, l)), y = _.length - v.length;
|
|
26
|
+
return /* @__PURE__ */ i("div", {
|
|
27
|
+
ref: p,
|
|
28
|
+
"data-slot": "avatar-group",
|
|
29
|
+
...m,
|
|
30
|
+
className: e(h.root(), f),
|
|
31
|
+
children: [v.map((t) => o(t, {
|
|
32
|
+
size: u,
|
|
33
|
+
variant: d,
|
|
34
|
+
className: e(g, t.props.className)
|
|
35
|
+
})), y > 0 && /* @__PURE__ */ r(t, {
|
|
36
|
+
"data-slot": "avatar-group-overflow",
|
|
37
|
+
size: u,
|
|
38
|
+
variant: d,
|
|
39
|
+
fallback: `+${y}`,
|
|
40
|
+
className: g
|
|
41
|
+
})]
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { l as AvatarGroup, c as avatarGroupRecipe };
|