@wallarm-org/design-system 4.14.0 → 4.15.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/dist/components/AgentAvatar/AgentAvatar.js +71 -54
- package/dist/components/AgentGlyph/AgentGlyph.js +38 -87
- package/dist/components/Avatar/AgentItem.d.ts +33 -0
- package/dist/components/Avatar/AgentItem.js +183 -0
- package/dist/components/Avatar/classes.d.ts +3 -0
- package/dist/components/Avatar/classes.js +16 -1
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Chat/ChatTrigger.d.ts +1 -1
- package/dist/components/Chat/ChatTrigger.js +5 -3
- package/dist/components/FilterDropdown/FilterDropdownOption.d.ts +6 -1
- package/dist/components/FilterDropdown/FilterDropdownOption.js +66 -49
- package/dist/components/FilterDropdown/FilterDropdownTrigger.d.ts +6 -0
- package/dist/components/FilterDropdown/FilterDropdownTrigger.js +127 -109
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FilterInputValueMenu.d.ts +3 -1
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.js +12 -10
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/ValueMenuItem.js +13 -11
- package/dist/components/FilterInput/types.d.ts +5 -0
- package/dist/components/Select/SelectInput/SelectInputItemRenderer.js +19 -18
- package/dist/components/Select/SelectValueIcon.js +3 -1
- package/dist/components/Select/types.d.ts +6 -1
- package/dist/components/Table/TableBody/TableBodyCell.js +2 -2
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/agent-characters/geom.d.ts +4 -0
- package/dist/lib/agent-characters/geom.js +12 -1
- package/dist/lib/agent-characters/look.d.ts +2 -0
- package/dist/lib/agent-characters/look.js +2 -1
- package/dist/metadata/components.json +198 -8
- package/dist/metadata/guidelines.json +1 -1
- package/dist/utils/isValidSvg.js +1 -1
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as compiler_runtime_c } from "react/compiler-runtime";
|
|
3
3
|
import { useContext, useEffect, useId, useImperativeHandle, useRef, useState } from "react";
|
|
4
4
|
import { charTree } from "../../lib/agent-characters/char.js";
|
|
5
|
-
import {
|
|
6
|
-
import { defaultLook, hash32, rng } from "../../lib/agent-characters/look.js";
|
|
5
|
+
import { hash32, lookOf, rng } from "../../lib/agent-characters/look.js";
|
|
7
6
|
import { getRuntime } from "../../lib/agent-characters/runtime.js";
|
|
8
7
|
import { cn } from "../../utils/cn.js";
|
|
9
8
|
import { mergeRefs } from "../../utils/mergeRefs.js";
|
|
@@ -11,42 +10,44 @@ import { renderSvgNode } from "../../utils/renderSvgNode.js";
|
|
|
11
10
|
import { AgentAvatarGroupContext } from "./AgentAvatarGroup.js";
|
|
12
11
|
import { layerKey, useBakedLayers } from "./useBakedLayers.js";
|
|
13
12
|
import { NO_DONE, useAgentMotion, useCharacter } from "./useCharacter.js";
|
|
14
|
-
const lookOf = (id)=>CAST.find((p)=>p.id === id) ?? defaultLook(id ?? "");
|
|
15
13
|
let COPY;
|
|
16
14
|
const copyId = ()=>{
|
|
17
15
|
COPY ??= getRuntime().nextId();
|
|
18
16
|
return COPY;
|
|
19
17
|
};
|
|
20
18
|
const Frame = (t0)=>{
|
|
21
|
-
const $ = compiler_runtime_c(
|
|
19
|
+
const $ = compiler_runtime_c(40);
|
|
22
20
|
const { t, size, veil, agent, seed, label, live, rest, svgRef } = t0;
|
|
23
21
|
let className;
|
|
24
22
|
let props;
|
|
23
|
+
let style;
|
|
25
24
|
if ($[0] !== rest) {
|
|
26
|
-
({ className, ...props } = rest);
|
|
25
|
+
({ className, style, ...props } = rest);
|
|
27
26
|
$[0] = rest;
|
|
28
27
|
$[1] = className;
|
|
29
28
|
$[2] = props;
|
|
29
|
+
$[3] = style;
|
|
30
30
|
} else {
|
|
31
31
|
className = $[1];
|
|
32
32
|
props = $[2];
|
|
33
|
+
style = $[3];
|
|
33
34
|
}
|
|
34
35
|
let t1;
|
|
35
|
-
if ($[
|
|
36
|
+
if ($[4] !== t.layers || $[5] !== veil) {
|
|
36
37
|
let t2;
|
|
37
|
-
if ($[
|
|
38
|
+
if ($[7] !== veil) {
|
|
38
39
|
t2 = (l)=>!l.veil || veil;
|
|
39
|
-
$[
|
|
40
|
-
$[
|
|
41
|
-
} else t2 = $[
|
|
40
|
+
$[7] = veil;
|
|
41
|
+
$[8] = t2;
|
|
42
|
+
} else t2 = $[8];
|
|
42
43
|
t1 = t.layers.filter(t2);
|
|
43
|
-
$[
|
|
44
|
-
$[
|
|
45
|
-
$[
|
|
46
|
-
} else t1 = $[
|
|
44
|
+
$[4] = t.layers;
|
|
45
|
+
$[5] = veil;
|
|
46
|
+
$[6] = t1;
|
|
47
|
+
} else t1 = $[6];
|
|
47
48
|
const baked = useBakedLayers(t1, size);
|
|
48
49
|
let t2;
|
|
49
|
-
if ($[
|
|
50
|
+
if ($[9] !== baked || $[10] !== t.layers) {
|
|
50
51
|
t2 = (n)=>{
|
|
51
52
|
if (void 0 === n.attrs["data-j"]) return;
|
|
52
53
|
const layer = t.layers[Number(n.attrs["data-j"])];
|
|
@@ -54,13 +55,13 @@ const Frame = (t0)=>{
|
|
|
54
55
|
"data-ready": true
|
|
55
56
|
} : void 0;
|
|
56
57
|
};
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
$[
|
|
60
|
-
} else t2 = $[
|
|
58
|
+
$[9] = baked;
|
|
59
|
+
$[10] = t.layers;
|
|
60
|
+
$[11] = t2;
|
|
61
|
+
} else t2 = $[11];
|
|
61
62
|
const bakedImage = t2;
|
|
62
63
|
let t3;
|
|
63
|
-
if ($[
|
|
64
|
+
if ($[12] !== agent || $[13] !== baked || $[14] !== bakedImage || $[15] !== className || $[16] !== label || $[17] !== live || $[18] !== props || $[19] !== seed || $[20] !== style || $[21] !== svgRef || $[22] !== t.children || $[23] !== t.ghosting || $[24] !== t.height || $[25] !== t.layers || $[26] !== t.state || $[27] !== t.veiled || $[28] !== t.width) {
|
|
64
65
|
const withImages = (n_0)=>{
|
|
65
66
|
if (void 0 === n_0.attrs["data-j"]) return n_0.children ? {
|
|
66
67
|
...n_0,
|
|
@@ -88,28 +89,42 @@ const Frame = (t0)=>{
|
|
|
88
89
|
const t5 = t.width;
|
|
89
90
|
const t6 = t.height;
|
|
90
91
|
let t7;
|
|
91
|
-
if ($[
|
|
92
|
+
if ($[30] !== label) {
|
|
92
93
|
t7 = label ? {
|
|
93
94
|
role: "img",
|
|
94
95
|
"aria-label": label
|
|
95
96
|
} : {
|
|
96
97
|
"aria-hidden": true
|
|
97
98
|
};
|
|
98
|
-
$[
|
|
99
|
-
$[
|
|
100
|
-
} else t7 = $[
|
|
99
|
+
$[30] = label;
|
|
100
|
+
$[31] = t7;
|
|
101
|
+
} else t7 = $[31];
|
|
101
102
|
let t8;
|
|
102
|
-
if ($[
|
|
103
|
-
t8 = cn("shrink-0", className);
|
|
104
|
-
$[
|
|
105
|
-
$[
|
|
106
|
-
} else t8 = $[
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
103
|
+
if ($[32] !== className) {
|
|
104
|
+
t8 = cn("w-(--agent-w)! h-(--agent-h)! shrink-0", className);
|
|
105
|
+
$[32] = className;
|
|
106
|
+
$[33] = t8;
|
|
107
|
+
} else t8 = $[33];
|
|
108
|
+
const t9 = `${t.width}px`;
|
|
109
|
+
const t10 = `${t.height}px`;
|
|
110
|
+
let t11;
|
|
111
|
+
if ($[34] !== style || $[35] !== t10 || $[36] !== t9) {
|
|
112
|
+
t11 = {
|
|
113
|
+
"--agent-w": t9,
|
|
114
|
+
"--agent-h": t10,
|
|
115
|
+
...style
|
|
116
|
+
};
|
|
117
|
+
$[34] = style;
|
|
118
|
+
$[35] = t10;
|
|
119
|
+
$[36] = t9;
|
|
120
|
+
$[37] = t11;
|
|
121
|
+
} else t11 = $[37];
|
|
122
|
+
let t12;
|
|
123
|
+
if ($[38] !== bakedImage) {
|
|
124
|
+
t12 = (n_1, i)=>renderSvgNode(n_1, i, bakedImage);
|
|
125
|
+
$[38] = bakedImage;
|
|
126
|
+
$[39] = t12;
|
|
127
|
+
} else t12 = $[39];
|
|
113
128
|
t3 = /*#__PURE__*/ jsx("svg", {
|
|
114
129
|
...props,
|
|
115
130
|
ref: svgRef,
|
|
@@ -125,26 +140,28 @@ const Frame = (t0)=>{
|
|
|
125
140
|
height: t6,
|
|
126
141
|
...t7,
|
|
127
142
|
className: t8,
|
|
128
|
-
|
|
143
|
+
style: t11,
|
|
144
|
+
children: t.children.map(withImages).map(t12)
|
|
129
145
|
});
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
132
|
-
$[
|
|
133
|
-
$[
|
|
134
|
-
$[
|
|
135
|
-
$[
|
|
136
|
-
$[
|
|
137
|
-
$[
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
|
|
146
|
+
$[12] = agent;
|
|
147
|
+
$[13] = baked;
|
|
148
|
+
$[14] = bakedImage;
|
|
149
|
+
$[15] = className;
|
|
150
|
+
$[16] = label;
|
|
151
|
+
$[17] = live;
|
|
152
|
+
$[18] = props;
|
|
153
|
+
$[19] = seed;
|
|
154
|
+
$[20] = style;
|
|
155
|
+
$[21] = svgRef;
|
|
156
|
+
$[22] = t.children;
|
|
157
|
+
$[23] = t.ghosting;
|
|
158
|
+
$[24] = t.height;
|
|
159
|
+
$[25] = t.layers;
|
|
160
|
+
$[26] = t.state;
|
|
161
|
+
$[27] = t.veiled;
|
|
162
|
+
$[28] = t.width;
|
|
163
|
+
$[29] = t3;
|
|
164
|
+
} else t3 = $[29];
|
|
148
165
|
return t3;
|
|
149
166
|
};
|
|
150
167
|
const StaticAvatar = (t0)=>{
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as compiler_runtime_c } from "react/compiler-runtime";
|
|
3
|
-
import { CAST } from "../../lib/agent-characters/data.gen.js";
|
|
4
3
|
import { shapeOf } from "../../lib/agent-characters/geom.js";
|
|
5
4
|
import { glyphTree } from "../../lib/agent-characters/glyph.js";
|
|
6
|
-
import {
|
|
5
|
+
import { lookOf } from "../../lib/agent-characters/look.js";
|
|
7
6
|
import { cn } from "../../utils/cn.js";
|
|
8
7
|
import { renderSvgNode } from "../../utils/renderSvgNode.js";
|
|
9
|
-
const lookOf = (id)=>CAST.find((p)=>p.id === id) ?? defaultLook(id ?? "");
|
|
10
8
|
const AgentGlyph = (t0)=>{
|
|
11
|
-
const $ = compiler_runtime_c(
|
|
9
|
+
const $ = compiler_runtime_c(36);
|
|
12
10
|
let agent;
|
|
13
11
|
let className;
|
|
14
12
|
let look;
|
|
@@ -86,36 +84,43 @@ const AgentGlyph = (t0)=>{
|
|
|
86
84
|
} else t7 = $[18];
|
|
87
85
|
const clipId = `agent-glyph-crown-${t7.id}`;
|
|
88
86
|
const partial = hasApplications && "partial" === coverage && "idle" === state;
|
|
89
|
-
let t10;
|
|
90
|
-
let t11;
|
|
91
|
-
let t12;
|
|
92
|
-
let t13;
|
|
93
|
-
let t14;
|
|
94
|
-
let t15;
|
|
95
|
-
let t16;
|
|
96
|
-
let t17;
|
|
97
|
-
let t18;
|
|
98
|
-
let t19;
|
|
99
87
|
let t8;
|
|
100
|
-
let t9;
|
|
101
88
|
if ($[19] !== agent || $[20] !== align || $[21] !== c || $[22] !== className || $[23] !== clipId || $[24] !== partial || $[25] !== props || $[26] !== ref || $[27] !== size || $[28] !== state || $[29] !== style) {
|
|
102
89
|
const t = glyphTree(c, size, partial ? "partly" : state, clipId);
|
|
103
90
|
const optical = "optical" === align;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
91
|
+
const t9 = `${t.width}px`;
|
|
92
|
+
const t10 = `${t.height}px`;
|
|
93
|
+
const t11 = optical && {
|
|
94
|
+
"--oy": `${t.oy}px`
|
|
95
|
+
};
|
|
96
|
+
let t12;
|
|
97
|
+
if ($[31] !== style || $[32] !== t10 || $[33] !== t11 || $[34] !== t9) {
|
|
98
|
+
t12 = {
|
|
99
|
+
"--agent-w": t9,
|
|
100
|
+
"--agent-h": t10,
|
|
101
|
+
...t11,
|
|
102
|
+
...style
|
|
103
|
+
};
|
|
104
|
+
$[31] = style;
|
|
105
|
+
$[32] = t10;
|
|
106
|
+
$[33] = t11;
|
|
107
|
+
$[34] = t9;
|
|
108
|
+
$[35] = t12;
|
|
109
|
+
} else t12 = $[35];
|
|
110
|
+
t8 = /*#__PURE__*/ jsx("svg", {
|
|
111
|
+
...props,
|
|
112
|
+
ref: ref,
|
|
113
|
+
"data-slot": "agent-glyph",
|
|
114
|
+
"data-agent": agent,
|
|
115
|
+
"data-state": state,
|
|
116
|
+
viewBox: "-8 -14 136 128",
|
|
117
|
+
width: t.width,
|
|
118
|
+
height: t.height,
|
|
119
|
+
"aria-hidden": "true",
|
|
120
|
+
className: cn("block w-(--agent-w)! h-(--agent-h)! shrink-0", optical && "translate-y-[var(--oy)]", t.opacity && "opacity-55", className),
|
|
121
|
+
style: t12,
|
|
122
|
+
children: t.children.map(_temp)
|
|
123
|
+
});
|
|
119
124
|
$[19] = agent;
|
|
120
125
|
$[20] = align;
|
|
121
126
|
$[21] = c;
|
|
@@ -127,63 +132,9 @@ const AgentGlyph = (t0)=>{
|
|
|
127
132
|
$[27] = size;
|
|
128
133
|
$[28] = state;
|
|
129
134
|
$[29] = style;
|
|
130
|
-
$[30] =
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
$[33] = t13;
|
|
134
|
-
$[34] = t14;
|
|
135
|
-
$[35] = t15;
|
|
136
|
-
$[36] = t16;
|
|
137
|
-
$[37] = t17;
|
|
138
|
-
$[38] = t18;
|
|
139
|
-
$[39] = t19;
|
|
140
|
-
$[40] = t8;
|
|
141
|
-
$[41] = t9;
|
|
142
|
-
} else {
|
|
143
|
-
t10 = $[30];
|
|
144
|
-
t11 = $[31];
|
|
145
|
-
t12 = $[32];
|
|
146
|
-
t13 = $[33];
|
|
147
|
-
t14 = $[34];
|
|
148
|
-
t15 = $[35];
|
|
149
|
-
t16 = $[36];
|
|
150
|
-
t17 = $[37];
|
|
151
|
-
t18 = $[38];
|
|
152
|
-
t19 = $[39];
|
|
153
|
-
t8 = $[40];
|
|
154
|
-
t9 = $[41];
|
|
155
|
-
}
|
|
156
|
-
let t20;
|
|
157
|
-
if ($[42] !== t10 || $[43] !== t11 || $[44] !== t12 || $[45] !== t13 || $[46] !== t14 || $[47] !== t15 || $[48] !== t16 || $[49] !== t17 || $[50] !== t18 || $[51] !== t19 || $[52] !== t8 || $[53] !== t9) {
|
|
158
|
-
t20 = /*#__PURE__*/ jsx("svg", {
|
|
159
|
-
...t8,
|
|
160
|
-
ref: t9,
|
|
161
|
-
"data-slot": t10,
|
|
162
|
-
"data-agent": t11,
|
|
163
|
-
"data-state": t12,
|
|
164
|
-
viewBox: t13,
|
|
165
|
-
width: t14,
|
|
166
|
-
height: t15,
|
|
167
|
-
"aria-hidden": t16,
|
|
168
|
-
className: t17,
|
|
169
|
-
style: t18,
|
|
170
|
-
children: t19
|
|
171
|
-
});
|
|
172
|
-
$[42] = t10;
|
|
173
|
-
$[43] = t11;
|
|
174
|
-
$[44] = t12;
|
|
175
|
-
$[45] = t13;
|
|
176
|
-
$[46] = t14;
|
|
177
|
-
$[47] = t15;
|
|
178
|
-
$[48] = t16;
|
|
179
|
-
$[49] = t17;
|
|
180
|
-
$[50] = t18;
|
|
181
|
-
$[51] = t19;
|
|
182
|
-
$[52] = t8;
|
|
183
|
-
$[53] = t9;
|
|
184
|
-
$[54] = t20;
|
|
185
|
-
} else t20 = $[54];
|
|
186
|
-
return t20;
|
|
135
|
+
$[30] = t8;
|
|
136
|
+
} else t8 = $[30];
|
|
137
|
+
return t8;
|
|
187
138
|
};
|
|
188
139
|
AgentGlyph.displayName = "AgentGlyph";
|
|
189
140
|
function _temp(n, i) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FC, HTMLAttributes, Ref } from 'react';
|
|
2
|
+
import type { AgentCharacterId, AgentLook } from '../../lib/agent-characters/data.gen.js';
|
|
3
|
+
import { type TestableProps } from '../../utils/testId.js';
|
|
4
|
+
import { type AgentGlyphState } from '../AgentGlyph/index.js';
|
|
5
|
+
type AgentItemLook = {
|
|
6
|
+
agent: AgentCharacterId;
|
|
7
|
+
look?: never;
|
|
8
|
+
} | {
|
|
9
|
+
look: AgentLook;
|
|
10
|
+
agent?: never;
|
|
11
|
+
};
|
|
12
|
+
/** 16–24 px draw the flat glyph, 40 px and up the 3D character (D1). */
|
|
13
|
+
export type AgentItemSize = 16 | 20 | 24 | 40 | 48 | 56;
|
|
14
|
+
export type AgentItemProps = HTMLAttributes<HTMLSpanElement> & TestableProps & AgentItemLook & {
|
|
15
|
+
ref?: Ref<HTMLSpanElement>;
|
|
16
|
+
/** 20 beside text-sm (table rows, attributes), 16 beside text-xs (D3); 40 and up for cards that show the agent. */
|
|
17
|
+
size?: AgentItemSize;
|
|
18
|
+
state?: AgentGlyphState;
|
|
19
|
+
hasApplications?: boolean;
|
|
20
|
+
coverage?: 'full' | 'partial';
|
|
21
|
+
/** 3D sizes only: animated, as in an Overview row. */
|
|
22
|
+
live?: boolean;
|
|
23
|
+
/** 3D sizes only: the agent's uid, keeping its timing distinct from its neighbours. Defaults to `agent`. */
|
|
24
|
+
seed?: string;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The agent user item: the agent's character, its name and an optional description, with no plate (agents stand as
|
|
28
|
+
* silhouettes). Takes the same `AvatarContent` / `AvatarName` / `AvatarDescription` children as a person's
|
|
29
|
+
* `Avatar`, so a place swaps a person for an agent by swapping the root. The gap is measured from the body, not
|
|
30
|
+
* the character's box, so every agent sits as close to its name as a person's plate does.
|
|
31
|
+
*/
|
|
32
|
+
export declare const AgentItem: FC<AgentItemProps>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { insetPx } from "../../lib/agent-characters/geom.js";
|
|
4
|
+
import { lookOf } from "../../lib/agent-characters/look.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { TestIdProvider } from "../../utils/testId.js";
|
|
7
|
+
import { AgentAvatar } from "../AgentAvatar/index.js";
|
|
8
|
+
import { AgentGlyph } from "../AgentGlyph/index.js";
|
|
9
|
+
import { AvatarSizeProvider } from "./AvatarContext.js";
|
|
10
|
+
import { agentItemVariants } from "./classes.js";
|
|
11
|
+
const AgentItem = (t0)=>{
|
|
12
|
+
const $ = c(53);
|
|
13
|
+
let agent;
|
|
14
|
+
let children;
|
|
15
|
+
let className;
|
|
16
|
+
let coverage;
|
|
17
|
+
let hasApplications;
|
|
18
|
+
let live;
|
|
19
|
+
let look;
|
|
20
|
+
let props;
|
|
21
|
+
let ref;
|
|
22
|
+
let seed;
|
|
23
|
+
let state;
|
|
24
|
+
let style;
|
|
25
|
+
let t1;
|
|
26
|
+
let testId;
|
|
27
|
+
if ($[0] !== t0) {
|
|
28
|
+
({ ref, agent, look, size: t1, state, hasApplications, coverage, live, seed, className, style, children, "data-testid": testId, ...props } = t0);
|
|
29
|
+
$[0] = t0;
|
|
30
|
+
$[1] = agent;
|
|
31
|
+
$[2] = children;
|
|
32
|
+
$[3] = className;
|
|
33
|
+
$[4] = coverage;
|
|
34
|
+
$[5] = hasApplications;
|
|
35
|
+
$[6] = live;
|
|
36
|
+
$[7] = look;
|
|
37
|
+
$[8] = props;
|
|
38
|
+
$[9] = ref;
|
|
39
|
+
$[10] = seed;
|
|
40
|
+
$[11] = state;
|
|
41
|
+
$[12] = style;
|
|
42
|
+
$[13] = t1;
|
|
43
|
+
$[14] = testId;
|
|
44
|
+
} else {
|
|
45
|
+
agent = $[1];
|
|
46
|
+
children = $[2];
|
|
47
|
+
className = $[3];
|
|
48
|
+
coverage = $[4];
|
|
49
|
+
hasApplications = $[5];
|
|
50
|
+
live = $[6];
|
|
51
|
+
look = $[7];
|
|
52
|
+
props = $[8];
|
|
53
|
+
ref = $[9];
|
|
54
|
+
seed = $[10];
|
|
55
|
+
state = $[11];
|
|
56
|
+
style = $[12];
|
|
57
|
+
t1 = $[13];
|
|
58
|
+
testId = $[14];
|
|
59
|
+
}
|
|
60
|
+
const size = void 0 === t1 ? 20 : t1;
|
|
61
|
+
let t2;
|
|
62
|
+
if ($[15] !== agent || $[16] !== look) {
|
|
63
|
+
t2 = look ? {
|
|
64
|
+
look
|
|
65
|
+
} : {
|
|
66
|
+
agent: agent
|
|
67
|
+
};
|
|
68
|
+
$[15] = agent;
|
|
69
|
+
$[16] = look;
|
|
70
|
+
$[17] = t2;
|
|
71
|
+
} else t2 = $[17];
|
|
72
|
+
let t3;
|
|
73
|
+
if ($[18] !== coverage || $[19] !== hasApplications || $[20] !== state || $[21] !== t2) {
|
|
74
|
+
t3 = {
|
|
75
|
+
...t2,
|
|
76
|
+
state,
|
|
77
|
+
hasApplications,
|
|
78
|
+
coverage,
|
|
79
|
+
className: "col-start-1 row-start-1 -mx-(--agent-inset)"
|
|
80
|
+
};
|
|
81
|
+
$[18] = coverage;
|
|
82
|
+
$[19] = hasApplications;
|
|
83
|
+
$[20] = state;
|
|
84
|
+
$[21] = t2;
|
|
85
|
+
$[22] = t3;
|
|
86
|
+
} else t3 = $[22];
|
|
87
|
+
const character = t3;
|
|
88
|
+
let t4;
|
|
89
|
+
if ($[23] !== className || $[24] !== size) {
|
|
90
|
+
t4 = cn(agentItemVariants({
|
|
91
|
+
size
|
|
92
|
+
}), className);
|
|
93
|
+
$[23] = className;
|
|
94
|
+
$[24] = size;
|
|
95
|
+
$[25] = t4;
|
|
96
|
+
} else t4 = $[25];
|
|
97
|
+
let t5;
|
|
98
|
+
if ($[26] !== agent || $[27] !== look) {
|
|
99
|
+
t5 = look ?? lookOf(agent);
|
|
100
|
+
$[26] = agent;
|
|
101
|
+
$[27] = look;
|
|
102
|
+
$[28] = t5;
|
|
103
|
+
} else t5 = $[28];
|
|
104
|
+
let t6;
|
|
105
|
+
if ($[29] !== size || $[30] !== t5) {
|
|
106
|
+
t6 = insetPx(t5, size);
|
|
107
|
+
$[29] = size;
|
|
108
|
+
$[30] = t5;
|
|
109
|
+
$[31] = t6;
|
|
110
|
+
} else t6 = $[31];
|
|
111
|
+
const t7 = `${t6}px`;
|
|
112
|
+
let t8;
|
|
113
|
+
if ($[32] !== style || $[33] !== t7) {
|
|
114
|
+
t8 = {
|
|
115
|
+
"--agent-inset": t7,
|
|
116
|
+
...style
|
|
117
|
+
};
|
|
118
|
+
$[32] = style;
|
|
119
|
+
$[33] = t7;
|
|
120
|
+
$[34] = t8;
|
|
121
|
+
} else t8 = $[34];
|
|
122
|
+
const t9 = t8;
|
|
123
|
+
let t10;
|
|
124
|
+
if ($[35] !== agent || $[36] !== character || $[37] !== live || $[38] !== seed || $[39] !== size || $[40] !== testId) {
|
|
125
|
+
t10 = size <= 24 ? /*#__PURE__*/ jsx(AgentGlyph, {
|
|
126
|
+
...character,
|
|
127
|
+
size: size,
|
|
128
|
+
"data-testid": testId && `${testId}--glyph`
|
|
129
|
+
}) : /*#__PURE__*/ jsx(AgentAvatar, {
|
|
130
|
+
...character,
|
|
131
|
+
size: size,
|
|
132
|
+
live: live,
|
|
133
|
+
seed: seed ?? agent ?? "",
|
|
134
|
+
"data-testid": testId && `${testId}--avatar`
|
|
135
|
+
});
|
|
136
|
+
$[35] = agent;
|
|
137
|
+
$[36] = character;
|
|
138
|
+
$[37] = live;
|
|
139
|
+
$[38] = seed;
|
|
140
|
+
$[39] = size;
|
|
141
|
+
$[40] = testId;
|
|
142
|
+
$[41] = t10;
|
|
143
|
+
} else t10 = $[41];
|
|
144
|
+
let t11;
|
|
145
|
+
if ($[42] !== children || $[43] !== props || $[44] !== ref || $[45] !== t10 || $[46] !== t4 || $[47] !== t9 || $[48] !== testId) {
|
|
146
|
+
t11 = /*#__PURE__*/ jsx(AvatarSizeProvider, {
|
|
147
|
+
value: "sm",
|
|
148
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
149
|
+
...props,
|
|
150
|
+
ref: ref,
|
|
151
|
+
"data-slot": "agent-item",
|
|
152
|
+
"data-testid": testId,
|
|
153
|
+
className: t4,
|
|
154
|
+
style: t9,
|
|
155
|
+
children: [
|
|
156
|
+
t10,
|
|
157
|
+
children
|
|
158
|
+
]
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
$[42] = children;
|
|
162
|
+
$[43] = props;
|
|
163
|
+
$[44] = ref;
|
|
164
|
+
$[45] = t10;
|
|
165
|
+
$[46] = t4;
|
|
166
|
+
$[47] = t9;
|
|
167
|
+
$[48] = testId;
|
|
168
|
+
$[49] = t11;
|
|
169
|
+
} else t11 = $[49];
|
|
170
|
+
let t12;
|
|
171
|
+
if ($[50] !== t11 || $[51] !== testId) {
|
|
172
|
+
t12 = /*#__PURE__*/ jsx(TestIdProvider, {
|
|
173
|
+
value: testId,
|
|
174
|
+
children: t11
|
|
175
|
+
});
|
|
176
|
+
$[50] = t11;
|
|
177
|
+
$[51] = testId;
|
|
178
|
+
$[52] = t12;
|
|
179
|
+
} else t12 = $[52];
|
|
180
|
+
return t12;
|
|
181
|
+
};
|
|
182
|
+
AgentItem.displayName = "AgentItem";
|
|
183
|
+
export { AgentItem };
|
|
@@ -12,6 +12,9 @@ export declare const avatarFallbackVariants: (props?: ({
|
|
|
12
12
|
initials?: boolean | null | undefined;
|
|
13
13
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
14
14
|
export declare const avatarOverlayClassNames: string;
|
|
15
|
+
export declare const agentItemVariants: (props?: ({
|
|
16
|
+
size?: 16 | 20 | 24 | 40 | 48 | 56 | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
15
18
|
export declare const avatarContentClassNames: string;
|
|
16
19
|
export declare const avatarNameVariants: (props?: ({
|
|
17
20
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
@@ -37,6 +37,21 @@ const avatarFallbackVariants = cva(cn('inline-flex items-center justify-center s
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const avatarOverlayClassNames = cn('hidden place-items-center text-icon-primary', 'group-hover/avatar:grid group-focus-visible/avatar:grid group-disabled/avatar:not-data-[visible]:hidden', 'data-[visible]:grid', 'group-has-[>img[data-state=visible]]/avatar:bg-component-avatar-overlay');
|
|
40
|
+
const agentItemVariants = cva('inline-grid max-w-full shrink-0 items-center justify-start gap-x-6 align-middle font-sans', {
|
|
41
|
+
variants: {
|
|
42
|
+
size: {
|
|
43
|
+
16: '[&_[data-slot=avatar-name]]:text-xs',
|
|
44
|
+
20: '',
|
|
45
|
+
24: '',
|
|
46
|
+
40: '',
|
|
47
|
+
48: '',
|
|
48
|
+
56: ''
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
defaultVariants: {
|
|
52
|
+
size: 20
|
|
53
|
+
}
|
|
54
|
+
});
|
|
40
55
|
const avatarContentClassNames = cn('col-start-2 row-start-1 flex min-w-0 flex-col text-left');
|
|
41
56
|
const avatarNameVariants = cva('truncate font-normal text-text-primary', {
|
|
42
57
|
variants: {
|
|
@@ -62,4 +77,4 @@ const avatarDescriptionVariants = cva('truncate font-normal text-text-secondary'
|
|
|
62
77
|
size: 'lg'
|
|
63
78
|
}
|
|
64
79
|
});
|
|
65
|
-
export { avatarContentClassNames, avatarDescriptionVariants, avatarFallbackVariants, avatarImageClassNames, avatarNameVariants, avatarOverlayClassNames, avatarPlateVariants, avatarVariants };
|
|
80
|
+
export { agentItemVariants, avatarContentClassNames, avatarDescriptionVariants, avatarFallbackVariants, avatarImageClassNames, avatarNameVariants, avatarOverlayClassNames, avatarPlateVariants, avatarVariants };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { AgentItem, type AgentItemProps, type AgentItemSize } from './AgentItem.js';
|
|
1
2
|
export { Avatar, type AvatarProps, type AvatarStatusChangeDetails } from './Avatar.js';
|
|
2
3
|
export { AvatarContent, type AvatarContentProps } from './AvatarContent.js';
|
|
3
4
|
export { AvatarDescription, type AvatarDescriptionProps } from './AvatarDescription.js';
|
|
@@ -2,7 +2,7 @@ import { type ButtonHTMLAttributes, type FC, type Ref } from 'react';
|
|
|
2
2
|
import { type TestableProps } from '../../utils/testId.js';
|
|
3
3
|
/**
|
|
4
4
|
* The app-header button that opens Wally (Figma 101:1034): a ghost small icon `Button` with the
|
|
5
|
-
*
|
|
5
|
+
* Wally glyph at 24 px and an "Ask Wally" tooltip. It holds no open state — wire `onClick`/`aria-expanded`
|
|
6
6
|
* yourself, or wrap it in `<DrawerTrigger asChild>`.
|
|
7
7
|
*/
|
|
8
8
|
export interface ChatTriggerProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'color'>, TestableProps {
|
|
@@ -2,9 +2,9 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import { useId } from "react";
|
|
4
4
|
import { useTestId } from "../../utils/testId.js";
|
|
5
|
+
import { AgentGlyph } from "../AgentGlyph/index.js";
|
|
5
6
|
import { Button } from "../Button/index.js";
|
|
6
7
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../Tooltip/index.js";
|
|
7
|
-
import { WallyIcon } from "../WallyIcon/index.js";
|
|
8
8
|
const ChatTrigger = (t0)=>{
|
|
9
9
|
const $ = c(24);
|
|
10
10
|
let id;
|
|
@@ -42,8 +42,10 @@ const ChatTrigger = (t0)=>{
|
|
|
42
42
|
const t3 = testId && `${testId}--icon`;
|
|
43
43
|
let t4;
|
|
44
44
|
if ($[8] !== t3) {
|
|
45
|
-
t4 = /*#__PURE__*/ jsx(
|
|
46
|
-
|
|
45
|
+
t4 = /*#__PURE__*/ jsx(AgentGlyph, {
|
|
46
|
+
agent: "wally",
|
|
47
|
+
size: 24,
|
|
48
|
+
align: "box",
|
|
47
49
|
"data-testid": t3
|
|
48
50
|
});
|
|
49
51
|
$[8] = t3;
|
|
@@ -6,10 +6,15 @@ export interface FilterDropdownOptionProps<T extends CollectionItem = Collection
|
|
|
6
6
|
item: T;
|
|
7
7
|
/** Secondary text at the right end of the row, such as a count. */
|
|
8
8
|
hint?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Leading element before the text, such as an agent's 16 px `AgentGlyph`. It keeps its own size:
|
|
11
|
+
* the row does not resize it.
|
|
12
|
+
*/
|
|
13
|
+
icon?: ReactNode;
|
|
9
14
|
/** Row text. Defaults to the item's label from the collection. */
|
|
10
15
|
children?: ReactNode;
|
|
11
16
|
}
|
|
12
|
-
export declare function FilterDropdownOption<T extends CollectionItem>({ item, hint, children, 'data-testid': testIdProp, ...props }: FilterDropdownOptionProps<T>): import("react").JSX.Element;
|
|
17
|
+
export declare function FilterDropdownOption<T extends CollectionItem>({ item, hint, icon, children, 'data-testid': testIdProp, ...props }: FilterDropdownOptionProps<T>): import("react").JSX.Element;
|
|
13
18
|
export declare namespace FilterDropdownOption {
|
|
14
19
|
var displayName: string;
|
|
15
20
|
}
|