@oxyhq/bloom 0.34.3 → 0.35.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/lib/commonjs/avatar-group/AvatarGroup.js +3 -2
- package/lib/commonjs/avatar-group/AvatarGroup.js.map +1 -1
- package/lib/commonjs/avatar-group/AvatarGroup.web.js +5 -5
- package/lib/commonjs/avatar-group/AvatarGroupBase.js +217 -48
- package/lib/commonjs/avatar-group/AvatarGroupBase.js.map +1 -1
- package/lib/commonjs/avatar-group/cluster-layout.js +217 -0
- package/lib/commonjs/avatar-group/cluster-layout.js.map +1 -0
- package/lib/module/avatar-group/AvatarGroup.js +3 -2
- package/lib/module/avatar-group/AvatarGroup.js.map +1 -1
- package/lib/module/avatar-group/AvatarGroup.web.js +5 -5
- package/lib/module/avatar-group/AvatarGroupBase.js +217 -48
- package/lib/module/avatar-group/AvatarGroupBase.js.map +1 -1
- package/lib/module/avatar-group/cluster-layout.js +213 -0
- package/lib/module/avatar-group/cluster-layout.js.map +1 -0
- package/lib/typescript/commonjs/avatar-group/AvatarGroup.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar-group/AvatarGroupBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar-group/cluster-layout.d.ts +48 -0
- package/lib/typescript/commonjs/avatar-group/cluster-layout.d.ts.map +1 -0
- package/lib/typescript/commonjs/avatar-group/types.d.ts +23 -5
- package/lib/typescript/commonjs/avatar-group/types.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/AvatarGroup.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/AvatarGroupBase.d.ts.map +1 -1
- package/lib/typescript/module/avatar-group/cluster-layout.d.ts +48 -0
- package/lib/typescript/module/avatar-group/cluster-layout.d.ts.map +1 -0
- package/lib/typescript/module/avatar-group/types.d.ts +23 -5
- package/lib/typescript/module/avatar-group/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/AvatarGroupCluster.test.tsx +123 -0
- package/src/avatar-group/AvatarGroup.stories.tsx +68 -0
- package/src/avatar-group/AvatarGroup.tsx +3 -2
- package/src/avatar-group/AvatarGroup.web.tsx +5 -5
- package/src/avatar-group/AvatarGroupBase.tsx +298 -89
- package/src/avatar-group/cluster-layout.ts +204 -0
- package/src/avatar-group/types.ts +23 -5
|
@@ -30,14 +30,27 @@ export interface AvatarGroupProps {
|
|
|
30
30
|
items: AvatarGroupItem[];
|
|
31
31
|
/**
|
|
32
32
|
* How the avatars are arranged.
|
|
33
|
-
* - `'stack'` (default): overlapping facepile with a thin separator
|
|
34
|
-
* trailing `+N` overflow chip, and the first item on top.
|
|
33
|
+
* - `'stack'` (default): overlapping horizontal facepile with a thin separator
|
|
34
|
+
* ring, a trailing `+N` overflow chip, and the first item on top.
|
|
35
35
|
* - `'row'`: avatars placed adjacent with a positive `spacing` gap and NO
|
|
36
36
|
* separator ring — an "adjacent row" of icons (e.g. a top-tokens strip).
|
|
37
37
|
* Still collapses into the `+N` overflow chip at `max`.
|
|
38
|
+
* - `'cluster'`: a compact 2D "magnetic bubble cluster" (iMessage-style) —
|
|
39
|
+
* avatars of VARYING sizes deterministically packed into a round bounding
|
|
40
|
+
* box with a uniform gap: the first item (primary) is the largest and sits
|
|
41
|
+
* centred/in front, the rest nestle around it. Scales from 2 (a "front +
|
|
42
|
+
* behind" pair) up through a dense pack (~20), collapsing into a trailing
|
|
43
|
+
* `+N` bubble past `max`. Unlike the horizontal layouts, `size` is the
|
|
44
|
+
* overall box diameter (see `size`) and `max` defaults to 20 (see `max`), so
|
|
45
|
+
* it drops in where a single round Avatar would.
|
|
46
|
+
*/
|
|
47
|
+
layout?: 'stack' | 'row' | 'cluster';
|
|
48
|
+
/**
|
|
49
|
+
* Diameter in pixels. For `'stack'`/`'row'` this is the diameter of EACH
|
|
50
|
+
* avatar. For `'cluster'` this is the diameter of the whole bounding box (the
|
|
51
|
+
* packed bubbles are sized as fractions of it), so the cluster occupies the
|
|
52
|
+
* same footprint as a single `size`-px Avatar.
|
|
38
53
|
*/
|
|
39
|
-
layout?: 'stack' | 'row';
|
|
40
|
-
/** Diameter of each avatar in pixels. */
|
|
41
54
|
size?: number;
|
|
42
55
|
/**
|
|
43
56
|
* Rendition variant forwarded to each {@link Avatar}'s `variant` prop, which
|
|
@@ -46,7 +59,12 @@ export interface AvatarGroupProps {
|
|
|
46
59
|
* `'thumb'`; pass `undefined` to request full-size renditions.
|
|
47
60
|
*/
|
|
48
61
|
variant?: string;
|
|
49
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Maximum number of avatars to render before collapsing into the overflow
|
|
64
|
+
* chip. Defaults to 5 for `'stack'`/`'row'`, and to 20 for `'cluster'` (which
|
|
65
|
+
* packs densely). In `'cluster'` the cap is inclusive of the `+N` bubble: past
|
|
66
|
+
* the cap the last slot becomes the overflow bubble.
|
|
67
|
+
*/
|
|
50
68
|
max?: number;
|
|
51
69
|
/**
|
|
52
70
|
* Real total count of members. When provided and larger than the number of
|