@stealthscale/component-messaging 0.2.1 → 0.2.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.
- package/dist/cyclonedx/bom.json +1 -1
- package/dist/index.js +1 -2247
- package/dist/pages/attachment/attachment.js +488 -0
- package/dist/pages/attachment/attachment.props.js +3 -0
- package/dist/pages/composer/composer.js +959 -0
- package/dist/pages/composer/composer.props.js +3 -0
- package/dist/pages/conversation/conversation.js +1237 -0
- package/dist/pages/conversation/conversation.props.js +3 -0
- package/dist/pages/message/message.js +1055 -0
- package/dist/pages/message/message.props.js +3 -0
- package/dist/pages/pages.json +66 -0
- package/dist/pages/reactions/reactions.js +246 -0
- package/dist/pages/reactions/reactions.props.js +3 -0
- package/dist/shared-B0H4dgkB.js +2248 -0
- package/dist/theme.js +1 -1
- package/locales/en/specimen/attachment.json +66 -0
- package/locales/en/specimen/composer.json +56 -0
- package/locales/en/specimen/conversation.json +70 -0
- package/locales/en/specimen/message.json +88 -0
- package/locales/en/specimen/reactions.json +23 -0
- package/package.json +10 -9
- /package/dist/{recipe-D1oVFnRU.js → recipes-D1oVFnRU.js} +0 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { o as recipe } from "../../recipes-D1oVFnRU.js";
|
|
3
|
+
import { F as Description, I as Content, L as Actions, M as Root, N as Media, P as Group, f as Content$1, j as Title, l as Root$1, m as Avatar$1, p as Bubble, u as Header } from "../../shared-B0H4dgkB.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { DownloadTrigger, IconButton } from "@stealthscale/component-actions";
|
|
7
|
+
import { Room, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
8
|
+
import { CircleAlertIcon, DownloadIcon, FileSpreadsheetIcon, FileTextIcon, RotateCcwIcon, XIcon } from "lucide-react";
|
|
9
|
+
import { Spinner } from "@stealthscale/component-feedback";
|
|
10
|
+
import { Avatar } from "@stealthscale/component-media";
|
|
11
|
+
import { Strong } from "@stealthscale/component-typography";
|
|
12
|
+
//#region src/attachment/examples/whiteboard.webp
|
|
13
|
+
var whiteboard_default = "data:image/webp;base64,UklGRuQCAABXRUJQVlA4INgCAADQHwCdASrwALQAPm02kkckIyGhKjgqMIANiWVu4WnJPsk3AP6T+QGnH/GOpI+VzQNnovFV/YD3XP9D+wHuA3lr0Jf2A65HIlvCH93M7RQ4/Y+90659FnKUjISXWgu8o3oqfNDTmXVJFToafY+Md6I/gd48uLKOhp9OTo23qA8PQLz+6HiJSj+pQJ413uPmoHXgJZyQHHdBs2Ot+oVkXgjUzxilLJckvqo86kibgeq5oAOvcGc8tdr+PbDhNwNrwa4xUDomuOQz+u9NCh7XXp79LdnkxbRtxKnltRU/tD/35NLvIkusWlaaGYCcLWD3mw0+zWAc8jIW0CBpTIb2ex97p1z6LOgkAAD+/bbIA4qgAAFOeYSJ1/rRILTrlFreIbloL6++YmQL8dDdQMwLMtSk8XDvPYyDdkQBBFRZYFoiwm2tezPbHGom4bAGapAhdMFvzH9EdeanOO1fAzdSwDXMD2Tp0/UNvh+Ttssftkfk3UByW7Zqu9nLBisPBcA4depxLDe3T9lNAZav2wxpl/AKQRib60JWokmxKxLebSUfYhv7Cag5Gwxvz/bV9pUiQ08c4NOxgTyyzLHmKYaxyo9WGrGEUDt8DRH8z55GzB3LwmfN/qQH7j79/W012BkY0lhCvpQV13l5JmH2surR/ycGgaO5yLSiJkdh3h2b76fHJQ9I3t60co8HOsXmkqt0NlyTR6CNyc2PLPiCIs0rGJy63RxYc1CWJV7+gHKxa51u9BsH8f5dJmVLV7lSCqvP7HvmlECuCvsolWzYA/DNTm93mZA0thb4x3GF/1piHSOJdxUvQUEN4A0dSYK434PEpvj6BBkS34mNT/lkwDruUPpuekL2f4vybVyZ+XCEEi2SEWxI9Y3935A5tf9qq74D6cHtsBUdy1k+0VEe9CvZF+UOGyG5+wF+ogMcvqWD4lH2Y9UkkXcBWyNLd+qUw96W/YhoywsAAAAAAA==";
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/attachment/examples/files.example.tsx
|
|
16
|
+
var files_example_exports = /* @__PURE__ */ __exportAll({
|
|
17
|
+
Files: () => Files,
|
|
18
|
+
source: () => source$2
|
|
19
|
+
});
|
|
20
|
+
function Files(props) {
|
|
21
|
+
const $ = c(66);
|
|
22
|
+
const { t } = useWords("attachment");
|
|
23
|
+
let t0;
|
|
24
|
+
if ($[0] !== t) {
|
|
25
|
+
t0 = t("label");
|
|
26
|
+
$[0] = t;
|
|
27
|
+
$[1] = t0;
|
|
28
|
+
} else t0 = $[1];
|
|
29
|
+
let t1;
|
|
30
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
31
|
+
t1 = /* @__PURE__ */ jsx(Media, { children: /* @__PURE__ */ jsx(FileSpreadsheetIcon, { "aria-hidden": true }) });
|
|
32
|
+
$[2] = t1;
|
|
33
|
+
} else t1 = $[2];
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[3] !== t) {
|
|
36
|
+
t2 = t("payouts");
|
|
37
|
+
$[3] = t;
|
|
38
|
+
$[4] = t2;
|
|
39
|
+
} else t2 = $[4];
|
|
40
|
+
let t3;
|
|
41
|
+
if ($[5] !== t2) {
|
|
42
|
+
t3 = /* @__PURE__ */ jsx(Title, { children: t2 });
|
|
43
|
+
$[5] = t2;
|
|
44
|
+
$[6] = t3;
|
|
45
|
+
} else t3 = $[6];
|
|
46
|
+
let t4;
|
|
47
|
+
if ($[7] !== t) {
|
|
48
|
+
t4 = t("payoutsDetail");
|
|
49
|
+
$[7] = t;
|
|
50
|
+
$[8] = t4;
|
|
51
|
+
} else t4 = $[8];
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[9] !== t4) {
|
|
54
|
+
t5 = /* @__PURE__ */ jsx(Description, { children: t4 });
|
|
55
|
+
$[9] = t4;
|
|
56
|
+
$[10] = t5;
|
|
57
|
+
} else t5 = $[10];
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[11] !== t3 || $[12] !== t5) {
|
|
60
|
+
t6 = /* @__PURE__ */ jsxs(Content, { children: [t3, t5] });
|
|
61
|
+
$[11] = t3;
|
|
62
|
+
$[12] = t5;
|
|
63
|
+
$[13] = t6;
|
|
64
|
+
} else t6 = $[13];
|
|
65
|
+
let t7;
|
|
66
|
+
if ($[14] !== t) {
|
|
67
|
+
t7 = t("download", { name: t("payouts") });
|
|
68
|
+
$[14] = t;
|
|
69
|
+
$[15] = t7;
|
|
70
|
+
} else t7 = $[15];
|
|
71
|
+
let t8;
|
|
72
|
+
if ($[16] !== t) {
|
|
73
|
+
t8 = t("csv");
|
|
74
|
+
$[16] = t;
|
|
75
|
+
$[17] = t8;
|
|
76
|
+
} else t8 = $[17];
|
|
77
|
+
let t9;
|
|
78
|
+
if ($[18] !== t) {
|
|
79
|
+
t9 = t("payouts");
|
|
80
|
+
$[18] = t;
|
|
81
|
+
$[19] = t9;
|
|
82
|
+
} else t9 = $[19];
|
|
83
|
+
let t10;
|
|
84
|
+
if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
|
|
85
|
+
t10 = /* @__PURE__ */ jsx(DownloadIcon, { size: "1em" });
|
|
86
|
+
$[20] = t10;
|
|
87
|
+
} else t10 = $[20];
|
|
88
|
+
let t11;
|
|
89
|
+
if ($[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
|
|
90
|
+
t11 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(DownloadTrigger, {
|
|
91
|
+
"aria-label": t7,
|
|
92
|
+
data: t8,
|
|
93
|
+
fileName: t9,
|
|
94
|
+
mimeType: "text/csv",
|
|
95
|
+
shape: "square",
|
|
96
|
+
size: "xs",
|
|
97
|
+
variant: "ghost",
|
|
98
|
+
children: t10
|
|
99
|
+
}) });
|
|
100
|
+
$[21] = t7;
|
|
101
|
+
$[22] = t8;
|
|
102
|
+
$[23] = t9;
|
|
103
|
+
$[24] = t11;
|
|
104
|
+
} else t11 = $[24];
|
|
105
|
+
let t12;
|
|
106
|
+
if ($[25] !== t11 || $[26] !== t6) {
|
|
107
|
+
t12 = /* @__PURE__ */ jsxs(Root, { children: [
|
|
108
|
+
t1,
|
|
109
|
+
t6,
|
|
110
|
+
t11
|
|
111
|
+
] });
|
|
112
|
+
$[25] = t11;
|
|
113
|
+
$[26] = t6;
|
|
114
|
+
$[27] = t12;
|
|
115
|
+
} else t12 = $[27];
|
|
116
|
+
let t13;
|
|
117
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
+
t13 = /* @__PURE__ */ jsx(Media, { children: /* @__PURE__ */ jsx("img", {
|
|
119
|
+
alt: "",
|
|
120
|
+
src: whiteboard_default
|
|
121
|
+
}) });
|
|
122
|
+
$[28] = t13;
|
|
123
|
+
} else t13 = $[28];
|
|
124
|
+
let t14;
|
|
125
|
+
if ($[29] !== t) {
|
|
126
|
+
t14 = t("whiteboard");
|
|
127
|
+
$[29] = t;
|
|
128
|
+
$[30] = t14;
|
|
129
|
+
} else t14 = $[30];
|
|
130
|
+
let t15;
|
|
131
|
+
if ($[31] !== t14) {
|
|
132
|
+
t15 = /* @__PURE__ */ jsx(Title, { children: t14 });
|
|
133
|
+
$[31] = t14;
|
|
134
|
+
$[32] = t15;
|
|
135
|
+
} else t15 = $[32];
|
|
136
|
+
let t16;
|
|
137
|
+
if ($[33] !== t) {
|
|
138
|
+
t16 = t("whiteboardDetail");
|
|
139
|
+
$[33] = t;
|
|
140
|
+
$[34] = t16;
|
|
141
|
+
} else t16 = $[34];
|
|
142
|
+
let t17;
|
|
143
|
+
if ($[35] !== t16) {
|
|
144
|
+
t17 = /* @__PURE__ */ jsx(Description, { children: t16 });
|
|
145
|
+
$[35] = t16;
|
|
146
|
+
$[36] = t17;
|
|
147
|
+
} else t17 = $[36];
|
|
148
|
+
let t18;
|
|
149
|
+
if ($[37] !== t15 || $[38] !== t17) {
|
|
150
|
+
t18 = /* @__PURE__ */ jsxs(Root, { children: [t13, /* @__PURE__ */ jsxs(Content, { children: [t15, t17] })] });
|
|
151
|
+
$[37] = t15;
|
|
152
|
+
$[38] = t17;
|
|
153
|
+
$[39] = t18;
|
|
154
|
+
} else t18 = $[39];
|
|
155
|
+
let t19;
|
|
156
|
+
if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
|
|
157
|
+
t19 = /* @__PURE__ */ jsx(Media, { children: /* @__PURE__ */ jsx(Spinner, {
|
|
158
|
+
"aria-hidden": true,
|
|
159
|
+
size: "sm"
|
|
160
|
+
}) });
|
|
161
|
+
$[40] = t19;
|
|
162
|
+
} else t19 = $[40];
|
|
163
|
+
let t20;
|
|
164
|
+
if ($[41] !== t) {
|
|
165
|
+
t20 = t("contract");
|
|
166
|
+
$[41] = t;
|
|
167
|
+
$[42] = t20;
|
|
168
|
+
} else t20 = $[42];
|
|
169
|
+
let t21;
|
|
170
|
+
if ($[43] !== t20) {
|
|
171
|
+
t21 = /* @__PURE__ */ jsx(Title, { children: t20 });
|
|
172
|
+
$[43] = t20;
|
|
173
|
+
$[44] = t21;
|
|
174
|
+
} else t21 = $[44];
|
|
175
|
+
let t22;
|
|
176
|
+
if ($[45] !== t) {
|
|
177
|
+
t22 = t("progress", { percent: 42 });
|
|
178
|
+
$[45] = t;
|
|
179
|
+
$[46] = t22;
|
|
180
|
+
} else t22 = $[46];
|
|
181
|
+
let t23;
|
|
182
|
+
if ($[47] !== t22) {
|
|
183
|
+
t23 = /* @__PURE__ */ jsx(Description, { children: t22 });
|
|
184
|
+
$[47] = t22;
|
|
185
|
+
$[48] = t23;
|
|
186
|
+
} else t23 = $[48];
|
|
187
|
+
let t24;
|
|
188
|
+
if ($[49] !== t21 || $[50] !== t23) {
|
|
189
|
+
t24 = /* @__PURE__ */ jsxs(Content, { children: [t21, t23] });
|
|
190
|
+
$[49] = t21;
|
|
191
|
+
$[50] = t23;
|
|
192
|
+
$[51] = t24;
|
|
193
|
+
} else t24 = $[51];
|
|
194
|
+
let t25;
|
|
195
|
+
if ($[52] !== t) {
|
|
196
|
+
t25 = t("cancel", { name: t("contract") });
|
|
197
|
+
$[52] = t;
|
|
198
|
+
$[53] = t25;
|
|
199
|
+
} else t25 = $[53];
|
|
200
|
+
let t26;
|
|
201
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
202
|
+
t26 = /* @__PURE__ */ jsx(XIcon, { size: "1em" });
|
|
203
|
+
$[54] = t26;
|
|
204
|
+
} else t26 = $[54];
|
|
205
|
+
let t27;
|
|
206
|
+
if ($[55] !== t25) {
|
|
207
|
+
t27 = /* @__PURE__ */ jsx(Actions, { children: /* @__PURE__ */ jsx(IconButton, {
|
|
208
|
+
"aria-label": t25,
|
|
209
|
+
size: "xs",
|
|
210
|
+
variant: "ghost",
|
|
211
|
+
children: t26
|
|
212
|
+
}) });
|
|
213
|
+
$[55] = t25;
|
|
214
|
+
$[56] = t27;
|
|
215
|
+
} else t27 = $[56];
|
|
216
|
+
let t28;
|
|
217
|
+
if ($[57] !== t24 || $[58] !== t27) {
|
|
218
|
+
t28 = /* @__PURE__ */ jsxs(Root, {
|
|
219
|
+
state: "uploading",
|
|
220
|
+
children: [
|
|
221
|
+
t19,
|
|
222
|
+
t24,
|
|
223
|
+
t27
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
$[57] = t24;
|
|
227
|
+
$[58] = t27;
|
|
228
|
+
$[59] = t28;
|
|
229
|
+
} else t28 = $[59];
|
|
230
|
+
let t29;
|
|
231
|
+
if ($[60] !== props || $[61] !== t0 || $[62] !== t12 || $[63] !== t18 || $[64] !== t28) {
|
|
232
|
+
t29 = /* @__PURE__ */ jsxs(Group, {
|
|
233
|
+
"aria-label": t0,
|
|
234
|
+
...props,
|
|
235
|
+
children: [
|
|
236
|
+
t12,
|
|
237
|
+
t18,
|
|
238
|
+
t28
|
|
239
|
+
]
|
|
240
|
+
});
|
|
241
|
+
$[60] = props;
|
|
242
|
+
$[61] = t0;
|
|
243
|
+
$[62] = t12;
|
|
244
|
+
$[63] = t18;
|
|
245
|
+
$[64] = t28;
|
|
246
|
+
$[65] = t29;
|
|
247
|
+
} else t29 = $[65];
|
|
248
|
+
return t29;
|
|
249
|
+
}
|
|
250
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { DownloadIcon, FileSpreadsheetIcon, XIcon } from \"lucide-react\";\n\nimport { DownloadTrigger, IconButton } from \"@stealthscale/component-actions\";\nimport { Spinner } from \"@stealthscale/component-feedback\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Attachment } from \"@stealthscale/component-messaging\";\n\nimport whiteboard from \"./whiteboard.webp\";\n\nexport function Files(props: Attachment.GroupProps): ReactElement {\n const { t } = useWords(\"attachment\");\n\n return (\n <Attachment.Group aria-label={t(\"label\")} {...props}>\n <Attachment.Root>\n <Attachment.Media>\n <FileSpreadsheetIcon aria-hidden />\n </Attachment.Media>\n <Attachment.Content>\n <Attachment.Title>{t(\"payouts\")}</Attachment.Title>\n <Attachment.Description>{t(\"payoutsDetail\")}</Attachment.Description>\n </Attachment.Content>\n <Attachment.Actions>\n <DownloadTrigger\n aria-label={t(\"download\", { name: t(\"payouts\") })}\n data={t(\"csv\")}\n fileName={t(\"payouts\")}\n mimeType=\"text/csv\"\n shape=\"square\"\n size=\"xs\"\n variant=\"ghost\"\n >\n <DownloadIcon size=\"1em\" />\n </DownloadTrigger>\n </Attachment.Actions>\n </Attachment.Root>\n <Attachment.Root>\n <Attachment.Media>\n <img alt=\"\" src={whiteboard} />\n </Attachment.Media>\n <Attachment.Content>\n <Attachment.Title>{t(\"whiteboard\")}</Attachment.Title>\n <Attachment.Description>{t(\"whiteboardDetail\")}</Attachment.Description>\n </Attachment.Content>\n </Attachment.Root>\n <Attachment.Root state=\"uploading\">\n <Attachment.Media>\n <Spinner aria-hidden size=\"sm\" />\n </Attachment.Media>\n <Attachment.Content>\n <Attachment.Title>{t(\"contract\")}</Attachment.Title>\n <Attachment.Description>{t(\"progress\", { percent: 42 })}</Attachment.Description>\n </Attachment.Content>\n <Attachment.Actions>\n <IconButton aria-label={t(\"cancel\", { name: t(\"contract\") })} size=\"xs\" variant=\"ghost\">\n <XIcon size=\"1em\" />\n </IconButton>\n </Attachment.Actions>\n </Attachment.Root>\n </Attachment.Group>\n );\n}\n";
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/attachment/examples/roadmap.webp
|
|
253
|
+
var roadmap_default = "data:image/webp;base64,UklGRpADAABXRUJQVlA4IIQDAAAQIgCdASrwALQAPm02mEikIyKhJTco8IANiWdu4XHhCAJOu0+Gplfm8xuepbbQeYDogbzT6AH6zdbRkWXjqanrAZZekvmh+OlAAr8mssqq/qqQTN1RIFwtTq0Byg46ru0AAogTEMWpd8IgTEMVxr+OdyhUIqq/s4KS5ubN5bTqFjxgnd6WaEt+UfpTzNSvlNMwonXGeA/SeQSRmIJXUKB846wgNDtYhc4xx4lgMc7lCoRVV/ZwUlziNXJFVO88oEI3rjw5ojTMcHl56lBdS9bqJBlRpkHSAt0SQrmW6242myV55G+sWNHU43vC7mW5vKnSVVOpqvCl66DzfJfXkmfx8KF51KPtqvJpv3gf8eERuJRFVX9kHksgAAD+/y278sJiXObSBt/00IFlWSrkl0RI8I8KwIa/9W/wiTIImBrrABacsTJ4NAkhRCMPhr3fZgeSvH9GvD/Z/pGdehtCgxJ8YtzxVrrxcrVOpOteG6FzAExuAWMFLV6BZNhbMOUiIzimqQMdXN6+Q3nVSgKik0gWZSj3IXaYvYOcZklZfdhvWs88cssnAG982k03s6b1RAW8OGrHmF/+mdInd/7LU/4AzKaywK9kV9637Mv2xQBbN5Fg2mjHAFuE3/2v1yBXk3zbCzAbhPwBvEVqcJbSYkjwbb5HXEKBizFL6Yc/C6vyeR44btwv0eIr/iXWIICfXHuNMA9uNn3X93Mu9qoEelxcN/8ndm4kmDbzpQFSZT53t9cdlsC+qFxHrgCCH++CdiTEXDR4u0xzqW0mKVF/niBWstLTGjFn+BpATLf2nx0lRYEtbK7THdZv+fblpu/mv5f91SuL5b698q1baJXBgAn7R0gsn9MmUXUJseXf4Z5PW/n3GK8vAnpek3P1yf29et/zuvYaPVZdwKoEuIYKW0LxIlcj7meIwsHRfzHhEJqhC2U6OxVdX9qmEcNKfuFDYzFYDS1ZRnm5O/+YeNiRQtNcDadhKV8PRFlAocMEeHWTLP5+mRzihdHLuKrkv37hwz1Qee2wQTJxrUWHg4volzwatz/xoi5Lj4Kk1677IFmd5DLSWyYa0rQTtlKzmFvwKBXTwgxjy2XVYg4x5P2bAx+W/BAsQu+3c999zcod5udTk2OMO2Xpozv/95+qWbgfTmyNZwlMWBhizTrptR4AJgGciVHyvIYlQ5BD5elwc6OOMyAAAAA=";
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/attachment/examples/sprint.webp
|
|
256
|
+
var sprint_default = "data:image/webp;base64,UklGRhYDAABXRUJQVlA4IAoDAABQHwCdASrwALQAPm02lUekIyIhKbNIwIANiWNu3V3oKNoWfxmpSn4p3OHoGc8V/i/2j36r2bvQ7/XK0gfEf9R9r/ECoSieSqzPOg9jUuc/XxKu606I4Ulv2aGfmfiUrVDZZ1o92wlipZkjzCq+7Sh3NEtv3i7pALea/WgcylMptCrmfEx8jOUBvhzwcUnyECT7orPCNQbhkqa5s9L0Tju7upv+Az2Zpp86TTzdoiocUiiiJITnK9iG/l31M5nP9PQ7sBgsUe6qDb1nIQ6qh/R8CT21FWRCAgEiYFpxEwQ2RB1cvGlBepIPdrjPB0yNBwRkbdAVLodN+r6JpKfXHxHW+VigAP77ybiOq1+/a93wHsFrRwIVgtaOBCsFcACUP5bQ5twFiw0SwquNEFFRGGHRlPCvAq5Aa+tdUnowzhwfPw0tlPK8ZOw/c92yCoRkZM8uMIkAkcQcHxkLf8Nf+a273+ZCUw//kB805tdo3M3VVvrQYoLIDFplvCl0m2TJT1r14p7A/gE8v1hdKjFv988HealVLcQun8L9sJ/TZBVhMjOVuc+AXNirdKHjV93LnnqcUBgoBbow6Ogk8+XkqUwAEyTZYMc0uFhDbETSIEyjBgG0tmj3tCDQ8zEq9wFLt5Xkpcq9KZGOnMKGgBlcCRUwktLhlhYfV8+8CupqZVXf+PjatdsiNlXM3LCs/08EZdwC9JKHjsslnMBNbDk3M9qPz1bONS/Y+kW0c5mb/qd3SBz4WuKs+bYePvquxyOVaBUOuazEQN5JdOxzTf9LJ7PPHRpB1+fM2osUnfLyPmdDgGkgTnVwuaHtQqZItltboT8kVqbnHgAyruUg5GEKgQi74v+n5rnE7/XNl+xLDBllzNObVr2QB/TFFE+xFkO83HG0+U5r5TJ24vmJv2uDnO1wrOd7iNf9x3w/H4/J8NqMtYoHET2D8/z/col2GskGOPo+NNHl11fjd202VStZfCxcZ5xI+QADtTSDk/sAaK8ZX/Cl6DdVlnxgB4KganL7e7CgVwgAAAAAAAAA";
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/attachment/examples/photos.example.tsx
|
|
259
|
+
var photos_example_exports = /* @__PURE__ */ __exportAll({
|
|
260
|
+
Photos: () => Photos,
|
|
261
|
+
source: () => source$1
|
|
262
|
+
});
|
|
263
|
+
const PHOTOS = [
|
|
264
|
+
["board", whiteboard_default],
|
|
265
|
+
["sprint", sprint_default],
|
|
266
|
+
["roadmap", roadmap_default]
|
|
267
|
+
];
|
|
268
|
+
function Photos() {
|
|
269
|
+
const $ = c(27);
|
|
270
|
+
const { t } = useWords("attachment");
|
|
271
|
+
let t0;
|
|
272
|
+
if ($[0] !== t) {
|
|
273
|
+
t0 = t("ada");
|
|
274
|
+
$[0] = t;
|
|
275
|
+
$[1] = t0;
|
|
276
|
+
} else t0 = $[1];
|
|
277
|
+
let t1;
|
|
278
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
279
|
+
t1 = /* @__PURE__ */ jsx(Avatar.Fallback, {});
|
|
280
|
+
$[2] = t1;
|
|
281
|
+
} else t1 = $[2];
|
|
282
|
+
let t2;
|
|
283
|
+
if ($[3] !== t0) {
|
|
284
|
+
t2 = /* @__PURE__ */ jsx(Avatar$1, { children: /* @__PURE__ */ jsx(Avatar.Root, {
|
|
285
|
+
"aria-hidden": true,
|
|
286
|
+
name: t0,
|
|
287
|
+
size: "sm",
|
|
288
|
+
children: t1
|
|
289
|
+
}) });
|
|
290
|
+
$[3] = t0;
|
|
291
|
+
$[4] = t2;
|
|
292
|
+
} else t2 = $[4];
|
|
293
|
+
let t3;
|
|
294
|
+
if ($[5] !== t) {
|
|
295
|
+
t3 = t("ada");
|
|
296
|
+
$[5] = t;
|
|
297
|
+
$[6] = t3;
|
|
298
|
+
} else t3 = $[6];
|
|
299
|
+
let t4;
|
|
300
|
+
if ($[7] !== t3) {
|
|
301
|
+
t4 = /* @__PURE__ */ jsx(Header, { children: /* @__PURE__ */ jsx(Strong, { children: t3 }) });
|
|
302
|
+
$[7] = t3;
|
|
303
|
+
$[8] = t4;
|
|
304
|
+
} else t4 = $[8];
|
|
305
|
+
let t5;
|
|
306
|
+
if ($[9] !== t) {
|
|
307
|
+
t5 = t("photos");
|
|
308
|
+
$[9] = t;
|
|
309
|
+
$[10] = t5;
|
|
310
|
+
} else t5 = $[10];
|
|
311
|
+
let t6;
|
|
312
|
+
if ($[11] !== t5) {
|
|
313
|
+
t6 = /* @__PURE__ */ jsx(Bubble, { children: t5 });
|
|
314
|
+
$[11] = t5;
|
|
315
|
+
$[12] = t6;
|
|
316
|
+
} else t6 = $[12];
|
|
317
|
+
let t7;
|
|
318
|
+
if ($[13] !== t) {
|
|
319
|
+
t7 = t("label");
|
|
320
|
+
$[13] = t;
|
|
321
|
+
$[14] = t7;
|
|
322
|
+
} else t7 = $[14];
|
|
323
|
+
let t8;
|
|
324
|
+
if ($[15] !== t) {
|
|
325
|
+
t8 = PHOTOS.map((t9) => {
|
|
326
|
+
const [photo, source] = t9;
|
|
327
|
+
return /* @__PURE__ */ jsxs(Root, { children: [/* @__PURE__ */ jsx(Media, { children: /* @__PURE__ */ jsx("img", {
|
|
328
|
+
alt: "",
|
|
329
|
+
src: source
|
|
330
|
+
}) }), /* @__PURE__ */ jsxs(Content, { children: [/* @__PURE__ */ jsx(Title, { children: t(`${photo}.name`) }), /* @__PURE__ */ jsx(Description, { children: t(`${photo}.detail`) })] })] }, photo);
|
|
331
|
+
});
|
|
332
|
+
$[15] = t;
|
|
333
|
+
$[16] = t8;
|
|
334
|
+
} else t8 = $[16];
|
|
335
|
+
let t9;
|
|
336
|
+
if ($[17] !== t7 || $[18] !== t8) {
|
|
337
|
+
t9 = /* @__PURE__ */ jsx(Group, {
|
|
338
|
+
"aria-label": t7,
|
|
339
|
+
orientation: "vertical",
|
|
340
|
+
size: "sm",
|
|
341
|
+
children: t8
|
|
342
|
+
});
|
|
343
|
+
$[17] = t7;
|
|
344
|
+
$[18] = t8;
|
|
345
|
+
$[19] = t9;
|
|
346
|
+
} else t9 = $[19];
|
|
347
|
+
let t10;
|
|
348
|
+
if ($[20] !== t4 || $[21] !== t6 || $[22] !== t9) {
|
|
349
|
+
t10 = /* @__PURE__ */ jsxs(Content$1, { children: [
|
|
350
|
+
t4,
|
|
351
|
+
t6,
|
|
352
|
+
t9
|
|
353
|
+
] });
|
|
354
|
+
$[20] = t4;
|
|
355
|
+
$[21] = t6;
|
|
356
|
+
$[22] = t9;
|
|
357
|
+
$[23] = t10;
|
|
358
|
+
} else t10 = $[23];
|
|
359
|
+
let t11;
|
|
360
|
+
if ($[24] !== t10 || $[25] !== t2) {
|
|
361
|
+
t11 = /* @__PURE__ */ jsxs(Root$1, { children: [t2, t10] });
|
|
362
|
+
$[24] = t10;
|
|
363
|
+
$[25] = t2;
|
|
364
|
+
$[26] = t11;
|
|
365
|
+
} else t11 = $[26];
|
|
366
|
+
return t11;
|
|
367
|
+
}
|
|
368
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { Avatar } from \"@stealthscale/component-media\";\nimport { Strong } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Attachment, Message } from \"@stealthscale/component-messaging\";\n\nimport roadmap from \"./roadmap.webp\";\nimport sprint from \"./sprint.webp\";\nimport whiteboard from \"./whiteboard.webp\";\n\nconst PHOTOS = [\n [\"board\", whiteboard],\n [\"sprint\", sprint],\n [\"roadmap\", roadmap],\n] as const;\n\nexport function Photos(): ReactElement {\n const { t } = useWords(\"attachment\");\n\n return (\n <Message.Root>\n <Message.Avatar>\n <Avatar.Root aria-hidden name={t(\"ada\")} size=\"sm\">\n <Avatar.Fallback />\n </Avatar.Root>\n </Message.Avatar>\n <Message.Content>\n <Message.Header>\n <Strong>{t(\"ada\")}</Strong>\n </Message.Header>\n <Message.Bubble>{t(\"photos\")}</Message.Bubble>\n <Attachment.Group aria-label={t(\"label\")} orientation=\"vertical\" size=\"sm\">\n {PHOTOS.map(([photo, source]) => (\n <Attachment.Root key={photo}>\n <Attachment.Media>\n <img alt=\"\" src={source} />\n </Attachment.Media>\n <Attachment.Content>\n <Attachment.Title>{t(`${photo}.name`)}</Attachment.Title>\n <Attachment.Description>{t(`${photo}.detail`)}</Attachment.Description>\n </Attachment.Content>\n </Attachment.Root>\n ))}\n </Attachment.Group>\n </Message.Content>\n </Message.Root>\n );\n}\n";
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/attachment/examples/states.example.tsx
|
|
371
|
+
var states_example_exports = /* @__PURE__ */ __exportAll({
|
|
372
|
+
States: () => States,
|
|
373
|
+
source: () => source
|
|
374
|
+
});
|
|
375
|
+
const STATES = [
|
|
376
|
+
"idle",
|
|
377
|
+
"uploading",
|
|
378
|
+
"processing",
|
|
379
|
+
"error",
|
|
380
|
+
"done"
|
|
381
|
+
];
|
|
382
|
+
function States() {
|
|
383
|
+
const $ = c(7);
|
|
384
|
+
const { t } = useWords("attachment");
|
|
385
|
+
let t0;
|
|
386
|
+
if ($[0] !== t) {
|
|
387
|
+
t0 = t("label");
|
|
388
|
+
$[0] = t;
|
|
389
|
+
$[1] = t0;
|
|
390
|
+
} else t0 = $[1];
|
|
391
|
+
let t1;
|
|
392
|
+
if ($[2] !== t) {
|
|
393
|
+
t1 = STATES.map((state) => /* @__PURE__ */ jsxs(Root, {
|
|
394
|
+
state,
|
|
395
|
+
children: [
|
|
396
|
+
/* @__PURE__ */ jsxs(Media, { children: [
|
|
397
|
+
state === "uploading" || state === "processing" ? /* @__PURE__ */ jsx(Spinner, {
|
|
398
|
+
"aria-hidden": true,
|
|
399
|
+
size: "sm"
|
|
400
|
+
}) : null,
|
|
401
|
+
state === "error" ? /* @__PURE__ */ jsx(CircleAlertIcon, { "aria-hidden": true }) : null,
|
|
402
|
+
state === "idle" || state === "done" ? /* @__PURE__ */ jsx(FileTextIcon, { "aria-hidden": true }) : null
|
|
403
|
+
] }),
|
|
404
|
+
/* @__PURE__ */ jsxs(Content, { children: [/* @__PURE__ */ jsx(Title, { children: t(`${state}.name`) }), /* @__PURE__ */ jsx(Description, { children: t(`${state}.detail`) })] }),
|
|
405
|
+
/* @__PURE__ */ jsxs(Actions, { children: [state === "error" ? /* @__PURE__ */ jsx(IconButton, {
|
|
406
|
+
"aria-label": t("retry", { name: t(`${state}.name`) }),
|
|
407
|
+
size: "xs",
|
|
408
|
+
variant: "ghost",
|
|
409
|
+
children: /* @__PURE__ */ jsx(RotateCcwIcon, { size: "1em" })
|
|
410
|
+
}) : null, /* @__PURE__ */ jsx(IconButton, {
|
|
411
|
+
"aria-label": t("remove", { name: t(`${state}.name`) }),
|
|
412
|
+
size: "xs",
|
|
413
|
+
variant: "ghost",
|
|
414
|
+
children: /* @__PURE__ */ jsx(XIcon, { size: "1em" })
|
|
415
|
+
})] })
|
|
416
|
+
]
|
|
417
|
+
}, state));
|
|
418
|
+
$[2] = t;
|
|
419
|
+
$[3] = t1;
|
|
420
|
+
} else t1 = $[3];
|
|
421
|
+
let t2;
|
|
422
|
+
if ($[4] !== t0 || $[5] !== t1) {
|
|
423
|
+
t2 = /* @__PURE__ */ jsx(Group, {
|
|
424
|
+
"aria-label": t0,
|
|
425
|
+
children: t1
|
|
426
|
+
});
|
|
427
|
+
$[4] = t0;
|
|
428
|
+
$[5] = t1;
|
|
429
|
+
$[6] = t2;
|
|
430
|
+
} else t2 = $[6];
|
|
431
|
+
return t2;
|
|
432
|
+
}
|
|
433
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { CircleAlertIcon, FileTextIcon, RotateCcwIcon, XIcon } from \"lucide-react\";\n\nimport { IconButton } from \"@stealthscale/component-actions\";\nimport { Spinner } from \"@stealthscale/component-feedback\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Attachment } from \"@stealthscale/component-messaging\";\n\nconst STATES = [\"idle\", \"uploading\", \"processing\", \"error\", \"done\"] as const;\n\nexport function States(): ReactElement {\n const { t } = useWords(\"attachment\");\n\n return (\n <Attachment.Group aria-label={t(\"label\")}>\n {STATES.map((state) => (\n <Attachment.Root key={state} state={state}>\n <Attachment.Media>\n {state === \"uploading\" || state === \"processing\" ? (\n <Spinner aria-hidden size=\"sm\" />\n ) : null}\n {state === \"error\" ? <CircleAlertIcon aria-hidden /> : null}\n {state === \"idle\" || state === \"done\" ? <FileTextIcon aria-hidden /> : null}\n </Attachment.Media>\n <Attachment.Content>\n <Attachment.Title>{t(`${state}.name`)}</Attachment.Title>\n <Attachment.Description>{t(`${state}.detail`)}</Attachment.Description>\n </Attachment.Content>\n <Attachment.Actions>\n {state === \"error\" ? (\n <IconButton\n aria-label={t(\"retry\", { name: t(`${state}.name`) })}\n size=\"xs\"\n variant=\"ghost\"\n >\n <RotateCcwIcon size=\"1em\" />\n </IconButton>\n ) : null}\n <IconButton\n aria-label={t(\"remove\", { name: t(`${state}.name`) })}\n size=\"xs\"\n variant=\"ghost\"\n >\n <XIcon size=\"1em\" />\n </IconButton>\n </Attachment.Actions>\n </Attachment.Root>\n ))}\n </Attachment.Group>\n );\n}\n";
|
|
434
|
+
//#endregion
|
|
435
|
+
//#region src/attachment/attachment.specimen.tsx
|
|
436
|
+
/**
|
|
437
|
+
* Catalogue page for the attachment.
|
|
438
|
+
*
|
|
439
|
+
* @remarks
|
|
440
|
+
* `scenesOf` generates the orientation and size scenes from a group of three files in a room at
|
|
441
|
+
* the `sm` measure, the width of a phone. Hand-written scenes render every state and photos under
|
|
442
|
+
* a message. The words are keys under `attachment` in `locales/en/specimen/attachment.json`.
|
|
443
|
+
*/
|
|
444
|
+
/**
|
|
445
|
+
* Hand-written scene for an attachment in each state.
|
|
446
|
+
*/
|
|
447
|
+
const stated = {
|
|
448
|
+
about: "attachment.states.about",
|
|
449
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
450
|
+
size: "sm",
|
|
451
|
+
children: /* @__PURE__ */ jsx(States, {})
|
|
452
|
+
}),
|
|
453
|
+
example: states_example_exports,
|
|
454
|
+
title: "attachment.states.title"
|
|
455
|
+
};
|
|
456
|
+
/**
|
|
457
|
+
* Hand-written scene for tiles under a message.
|
|
458
|
+
*/
|
|
459
|
+
const pictured = {
|
|
460
|
+
about: "attachment.photosScene.about",
|
|
461
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
462
|
+
size: "md",
|
|
463
|
+
children: /* @__PURE__ */ jsx(Photos, {})
|
|
464
|
+
}),
|
|
465
|
+
example: photos_example_exports,
|
|
466
|
+
title: "attachment.photosScene.title"
|
|
467
|
+
};
|
|
468
|
+
var attachment_specimen_default = specimen({
|
|
469
|
+
about: "attachment.about",
|
|
470
|
+
id: "components/messaging/attachment",
|
|
471
|
+
imports: "import { Attachment } from \"@stealthscale/component-messaging\";",
|
|
472
|
+
scenes: [
|
|
473
|
+
...scenesOf(recipe, {
|
|
474
|
+
draw: (props) => /* @__PURE__ */ jsx(Room, {
|
|
475
|
+
size: "sm",
|
|
476
|
+
children: /* @__PURE__ */ jsx(Files, { ...props })
|
|
477
|
+
}),
|
|
478
|
+
example: files_example_exports,
|
|
479
|
+
namespace: "attachment",
|
|
480
|
+
order: ["orientation", "size"]
|
|
481
|
+
}),
|
|
482
|
+
stated,
|
|
483
|
+
pictured
|
|
484
|
+
],
|
|
485
|
+
title: "attachment.title"
|
|
486
|
+
});
|
|
487
|
+
//#endregion
|
|
488
|
+
export { attachment_specimen_default as default, pictured, stated };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"ActionsProps": {"conditions": 284, "foreign": 1041}, "ContentProps": {"conditions": 284, "foreign": 1041}, "DescriptionProps": {"conditions": 284, "foreign": 1041}, "GroupProps": {"conditions": 284, "foreign": 1041}, "MediaProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1041}, "TitleProps": {"conditions": 284, "foreign": 1041}, "AvatarProps": {"conditions": 284, "foreign": 1041}, "BubbleProps": {"conditions": 284, "foreign": 1041}, "FooterProps": {"conditions": 284, "foreign": 1041}, "HeaderProps": {"conditions": 284, "foreign": 1041}, "StatusProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"ActionsProps": [], "ContentProps": [], "DescriptionProps": [], "GroupProps": [{"accepts": "\"horizontal\" | \"vertical\"", "fallback": "", "kind": "variant", "name": "orientation", "refers": [], "required": false, "says": "Whether an attachment is a row or a tile, and whether a group stacks or wraps them."}, {"accepts": "\"md\" | \"sm\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": ""}], "MediaProps": [], "RootProps": [{"accepts": "\"horizontal\" | \"vertical\"", "fallback": "", "kind": "variant", "name": "orientation", "refers": [], "required": false, "says": "Whether an attachment is a row or a tile, and whether a group stacks or wraps them."}, {"accepts": "\"md\" | \"sm\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": ""}, {"accepts": "AttachmentState", "fallback": "", "kind": "option", "name": "state", "refers": ["kit.AttachmentState"], "required": false, "says": "Where the file is on its way, `done` unless stated."}], "TitleProps": [], "AvatarProps": [], "BubbleProps": [{"accepts": "boolean", "fallback": "", "kind": "option", "name": "failed", "refers": [], "required": false, "says": "Whether the message did not send."}], "FooterProps": [], "HeaderProps": [], "StatusProps": [{"accepts": "MessageStatus", "fallback": "", "kind": "option", "name": "status", "refers": ["kit.MessageStatus"], "required": true, "says": "How far the message has got."}]};
|
|
3
|
+
export const shapes = {"kit.AttachmentState": [{"accepts": "", "name": "\"done\"", "says": ""}, {"accepts": "", "name": "\"error\"", "says": ""}, {"accepts": "", "name": "\"idle\"", "says": ""}, {"accepts": "", "name": "\"processing\"", "says": ""}, {"accepts": "", "name": "\"uploading\"", "says": ""}], "kit.MessageStatus": [{"accepts": "", "name": "\"delivered\"", "says": ""}, {"accepts": "", "name": "\"failed\"", "says": ""}, {"accepts": "", "name": "\"read\"", "says": ""}, {"accepts": "", "name": "\"sending\"", "says": ""}, {"accepts": "", "name": "\"sent\"", "says": ""}]};
|