@stealthscale/component-feedback 0.2.1 → 0.2.3
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 -1825
- package/dist/pages/alert/alert.js +223 -0
- package/dist/pages/alert/alert.props.js +3 -0
- package/dist/pages/empty-state/empty-state.js +96 -0
- package/dist/pages/empty-state/empty-state.props.js +3 -0
- package/dist/pages/loader/loader.js +359 -0
- package/dist/pages/loader/loader.props.js +3 -0
- package/dist/pages/meter/meter.js +785 -0
- package/dist/pages/meter/meter.props.js +3 -0
- package/dist/pages/pages.json +115 -0
- package/dist/pages/progress/progress.js +550 -0
- package/dist/pages/progress/progress.props.js +3 -0
- package/dist/pages/progress-circle/progress-circle.js +329 -0
- package/dist/pages/progress-circle/progress-circle.props.js +3 -0
- package/dist/pages/skeleton/skeleton.js +94 -0
- package/dist/pages/skeleton/skeleton.props.js +3 -0
- package/dist/pages/skeleton-text/skeleton-text.js +81 -0
- package/dist/pages/skeleton-text/skeleton-text.props.js +3 -0
- package/dist/pages/spinner/spinner.js +186 -0
- package/dist/pages/spinner/spinner.props.js +3 -0
- package/dist/pages/toast/toast.js +427 -0
- package/dist/pages/toast/toast.props.js +3 -0
- package/dist/shared-Xc-n0bn7.js +1826 -0
- package/dist/theme.js +27 -13
- package/locales/en/specimen/alert.json +37 -0
- package/locales/en/specimen/empty-state.json +10 -0
- package/locales/en/specimen/loader.json +30 -0
- package/locales/en/specimen/meter.json +81 -0
- package/locales/en/specimen/progress-circle.json +41 -0
- package/locales/en/specimen/progress.json +66 -0
- package/locales/en/specimen/skeleton-text.json +12 -0
- package/locales/en/specimen/skeleton.json +18 -0
- package/locales/en/specimen/spinner.json +33 -0
- package/locales/en/specimen/toast.json +79 -0
- package/package.json +8 -7
- /package/dist/{recipe-CX1gSsN7.js → recipes-CX1gSsN7.js} +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"LabelProps": {"conditions": 284, "foreign": 1041}, "MarkerProps": {"conditions": 284, "foreign": 1041}, "RangeProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1038}, "SegmentProps": {"conditions": 284, "foreign": 1040}, "TrackProps": {"conditions": 284, "foreign": 1041}, "ValueTextProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"LabelProps": [], "MarkerProps": [{"accepts": "number", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Value the marker is placed at, in the units of `min` and `max`."}], "RangeProps": [], "RootProps": [{"accepts": "boolean", "fallback": "", "kind": "variant", "name": "animated", "refers": [], "required": false, "says": "Moves the stripes, adding them where `striped` is not set."}, {"accepts": "number | null", "fallback": "50", "kind": "option", "name": "defaultValue", "refers": [], "required": false, "says": "The initial value of the progress bar when rendered. Use when you don't need to control the value of the progress bar."}, {"accepts": "\"ltr\" | \"rtl\"", "fallback": "\"ltr\"", "kind": "option", "name": "dir", "refers": [], "required": false, "says": "The document's text/writing direction."}, {"accepts": "\"glow\" | \"pulse\"", "fallback": "", "kind": "variant", "name": "effect", "refers": [], "required": false, "says": "The halo around the range, in the palette's solid."}, {"accepts": "NumberFormatOptions", "fallback": "{ style: \"percent\" }", "kind": "option", "name": "formatOptions", "refers": [], "required": false, "says": "The options to use for formatting the value."}, {"accepts": "(() => Document | Node | ShadowRoot)", "fallback": "", "kind": "option", "name": "getRootNode", "refers": [], "required": false, "says": "A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "id", "refers": [], "required": false, "says": "The unique identifier of the machine."}, {"accepts": "ElementIds", "fallback": "", "kind": "option", "name": "ids", "refers": ["progress.ElementIds"], "required": false, "says": "The ids of the elements in the progress bar. Useful for composition."}, {"accepts": "\"inline\" | \"stacked\"", "fallback": "", "kind": "variant", "name": "layout", "refers": [], "required": false, "says": ""}, {"accepts": "string", "fallback": "\"en-US\"", "kind": "option", "name": "locale", "refers": [], "required": false, "says": "The locale to use for formatting the value."}, {"accepts": "number", "fallback": "100", "kind": "option", "name": "max", "refers": [], "required": false, "says": "The maximum allowed value of the progress bar."}, {"accepts": "number", "fallback": "0", "kind": "option", "name": "min", "refers": [], "required": false, "says": "The minimum allowed value of the progress bar."}, {"accepts": "((details: ValueChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onValueChange", "refers": ["progress.ValueChangeDetails"], "required": false, "says": "Callback fired when the value changes."}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": ""}, {"accepts": "\"full\" | \"rounded\" | \"square\"", "fallback": "", "kind": "variant", "name": "shape", "refers": [], "required": false, "says": ""}, {"accepts": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": ""}, {"accepts": "boolean", "fallback": "", "kind": "variant", "name": "striped", "refers": [], "required": false, "says": ""}, {"accepts": "number | null", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": false, "says": "The controlled value of the progress bar."}, {"accepts": "\"outline\" | \"subtle\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": ""}], "SegmentProps": [{"accepts": "SegmentColor", "fallback": "", "kind": "option", "name": "color", "refers": ["kit.SegmentColor"], "required": false, "says": "Color the segment fills in: a series color, or a palette's solid. The series color at the segment's place unless stated."}, {"accepts": "number", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Amount the segment stands for, in the units of `min` and `max`."}], "TrackProps": [], "ValueTextProps": []};
|
|
3
|
+
export const shapes = {"progress.ElementIds": [{"accepts": "string", "name": "root", "says": ""}, {"accepts": "string", "name": "track", "says": ""}, {"accepts": "string", "name": "label", "says": ""}, {"accepts": "string", "name": "circle", "says": ""}], "progress.ValueChangeDetails": [{"accepts": "number | null", "name": "value", "says": ""}], "kit.SegmentColor": [{"accepts": "", "name": "\"accent\"", "says": ""}, {"accepts": "", "name": "\"error\"", "says": ""}, {"accepts": "", "name": "\"info\"", "says": ""}, {"accepts": "", "name": "\"neutral\"", "says": ""}, {"accepts": "", "name": "\"primary\"", "says": ""}, {"accepts": "", "name": "\"secondary\"", "says": ""}, {"accepts": "", "name": "\"series.1\"", "says": ""}, {"accepts": "", "name": "\"series.2\"", "says": ""}, {"accepts": "", "name": "\"series.3\"", "says": ""}, {"accepts": "", "name": "\"series.4\"", "says": ""}, {"accepts": "", "name": "\"series.5\"", "says": ""}, {"accepts": "", "name": "\"series.6\"", "says": ""}, {"accepts": "", "name": "\"series.7\"", "says": ""}, {"accepts": "", "name": "\"series.8\"", "says": ""}, {"accepts": "", "name": "\"success\"", "says": ""}, {"accepts": "", "name": "\"warning\"", "says": ""}]};
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { i as recipe } from "../../recipes-CX1gSsN7.js";
|
|
3
|
+
import { S as Circle, _ as ValueText, b as Range, v as Track, x as Label, y as Root } from "../../shared-Xc-n0bn7.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Matrix, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/progress-circle/examples/checklist.example.tsx
|
|
8
|
+
var checklist_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Checklist: () => Checklist,
|
|
10
|
+
source: () => source$3
|
|
11
|
+
});
|
|
12
|
+
const DONE = 3;
|
|
13
|
+
const STEPS = 5;
|
|
14
|
+
function Checklist() {
|
|
15
|
+
const $ = c(14);
|
|
16
|
+
const { t } = useWords("progress-circle");
|
|
17
|
+
let t0;
|
|
18
|
+
if ($[0] !== t) {
|
|
19
|
+
t0 = t("steps", {
|
|
20
|
+
count: DONE,
|
|
21
|
+
total: STEPS
|
|
22
|
+
});
|
|
23
|
+
$[0] = t;
|
|
24
|
+
$[1] = t0;
|
|
25
|
+
} else t0 = $[1];
|
|
26
|
+
let t1;
|
|
27
|
+
let t2;
|
|
28
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29
|
+
t1 = /* @__PURE__ */ jsx(Track, {});
|
|
30
|
+
t2 = /* @__PURE__ */ jsx(Range, {});
|
|
31
|
+
$[2] = t1;
|
|
32
|
+
$[3] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t1 = $[2];
|
|
35
|
+
t2 = $[3];
|
|
36
|
+
}
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] !== t0) {
|
|
39
|
+
t3 = /* @__PURE__ */ jsxs(Circle, {
|
|
40
|
+
"aria-valuetext": t0,
|
|
41
|
+
children: [t1, t2]
|
|
42
|
+
});
|
|
43
|
+
$[4] = t0;
|
|
44
|
+
$[5] = t3;
|
|
45
|
+
} else t3 = $[5];
|
|
46
|
+
let t4;
|
|
47
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
48
|
+
t4 = /* @__PURE__ */ jsx(ValueText, { children: `${String(DONE)}/${String(STEPS)}` });
|
|
49
|
+
$[6] = t4;
|
|
50
|
+
} else t4 = $[6];
|
|
51
|
+
let t5;
|
|
52
|
+
if ($[7] !== t) {
|
|
53
|
+
t5 = t("checklist");
|
|
54
|
+
$[7] = t;
|
|
55
|
+
$[8] = t5;
|
|
56
|
+
} else t5 = $[8];
|
|
57
|
+
let t6;
|
|
58
|
+
if ($[9] !== t5) {
|
|
59
|
+
t6 = /* @__PURE__ */ jsx(Label, { children: t5 });
|
|
60
|
+
$[9] = t5;
|
|
61
|
+
$[10] = t6;
|
|
62
|
+
} else t6 = $[10];
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[11] !== t3 || $[12] !== t6) {
|
|
65
|
+
t7 = /* @__PURE__ */ jsxs(Root, {
|
|
66
|
+
layout: "inline",
|
|
67
|
+
max: STEPS,
|
|
68
|
+
palette: "success",
|
|
69
|
+
size: "xl",
|
|
70
|
+
value: DONE,
|
|
71
|
+
children: [
|
|
72
|
+
t3,
|
|
73
|
+
t4,
|
|
74
|
+
t6
|
|
75
|
+
]
|
|
76
|
+
});
|
|
77
|
+
$[11] = t3;
|
|
78
|
+
$[12] = t6;
|
|
79
|
+
$[13] = t7;
|
|
80
|
+
} else t7 = $[13];
|
|
81
|
+
return t7;
|
|
82
|
+
}
|
|
83
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ProgressCircle } from \"@stealthscale/component-feedback\";\n\nconst DONE = 3;\n\nconst STEPS = 5;\n\nexport function Checklist(): ReactElement {\n const { t } = useWords(\"progress-circle\");\n\n return (\n <ProgressCircle.Root layout=\"inline\" max={STEPS} palette=\"success\" size=\"xl\" value={DONE}>\n <ProgressCircle.Circle aria-valuetext={t(\"steps\", { count: DONE, total: STEPS })}>\n <ProgressCircle.Track />\n <ProgressCircle.Range />\n </ProgressCircle.Circle>\n <ProgressCircle.ValueText>{`${String(DONE)}/${String(STEPS)}`}</ProgressCircle.ValueText>\n <ProgressCircle.Label>{t(\"checklist\")}</ProgressCircle.Label>\n </ProgressCircle.Root>\n );\n}\n";
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/progress-circle/examples/quota.example.tsx
|
|
86
|
+
var quota_example_exports = /* @__PURE__ */ __exportAll({
|
|
87
|
+
Quota: () => Quota,
|
|
88
|
+
source: () => source$2
|
|
89
|
+
});
|
|
90
|
+
const USED = 7.4;
|
|
91
|
+
const TOTAL = 10;
|
|
92
|
+
function Quota() {
|
|
93
|
+
const $ = c(14);
|
|
94
|
+
const { t } = useWords("progress-circle");
|
|
95
|
+
let t0;
|
|
96
|
+
if ($[0] !== t) {
|
|
97
|
+
t0 = t("quota.used", {
|
|
98
|
+
total: TOTAL,
|
|
99
|
+
used: USED
|
|
100
|
+
});
|
|
101
|
+
$[0] = t;
|
|
102
|
+
$[1] = t0;
|
|
103
|
+
} else t0 = $[1];
|
|
104
|
+
let t1;
|
|
105
|
+
let t2;
|
|
106
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
107
|
+
t1 = /* @__PURE__ */ jsx(Track, {});
|
|
108
|
+
t2 = /* @__PURE__ */ jsx(Range, {});
|
|
109
|
+
$[2] = t1;
|
|
110
|
+
$[3] = t2;
|
|
111
|
+
} else {
|
|
112
|
+
t1 = $[2];
|
|
113
|
+
t2 = $[3];
|
|
114
|
+
}
|
|
115
|
+
let t3;
|
|
116
|
+
if ($[4] !== t0) {
|
|
117
|
+
t3 = /* @__PURE__ */ jsxs(Circle, {
|
|
118
|
+
"aria-valuetext": t0,
|
|
119
|
+
children: [t1, t2]
|
|
120
|
+
});
|
|
121
|
+
$[4] = t0;
|
|
122
|
+
$[5] = t3;
|
|
123
|
+
} else t3 = $[5];
|
|
124
|
+
let t4;
|
|
125
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
126
|
+
t4 = /* @__PURE__ */ jsx(ValueText, {});
|
|
127
|
+
$[6] = t4;
|
|
128
|
+
} else t4 = $[6];
|
|
129
|
+
let t5;
|
|
130
|
+
if ($[7] !== t) {
|
|
131
|
+
t5 = t("quota.label");
|
|
132
|
+
$[7] = t;
|
|
133
|
+
$[8] = t5;
|
|
134
|
+
} else t5 = $[8];
|
|
135
|
+
let t6;
|
|
136
|
+
if ($[9] !== t5) {
|
|
137
|
+
t6 = /* @__PURE__ */ jsx(Label, { children: t5 });
|
|
138
|
+
$[9] = t5;
|
|
139
|
+
$[10] = t6;
|
|
140
|
+
} else t6 = $[10];
|
|
141
|
+
let t7;
|
|
142
|
+
if ($[11] !== t3 || $[12] !== t6) {
|
|
143
|
+
t7 = /* @__PURE__ */ jsxs(Root, {
|
|
144
|
+
max: TOTAL,
|
|
145
|
+
palette: "warning",
|
|
146
|
+
size: "xl",
|
|
147
|
+
value: USED,
|
|
148
|
+
children: [
|
|
149
|
+
t3,
|
|
150
|
+
t4,
|
|
151
|
+
t6
|
|
152
|
+
]
|
|
153
|
+
});
|
|
154
|
+
$[11] = t3;
|
|
155
|
+
$[12] = t6;
|
|
156
|
+
$[13] = t7;
|
|
157
|
+
} else t7 = $[13];
|
|
158
|
+
return t7;
|
|
159
|
+
}
|
|
160
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ProgressCircle } from \"@stealthscale/component-feedback\";\n\nconst USED = 7.4;\n\nconst TOTAL = 10;\n\nexport function Quota(): ReactElement {\n const { t } = useWords(\"progress-circle\");\n\n return (\n <ProgressCircle.Root max={TOTAL} palette=\"warning\" size=\"xl\" value={USED}>\n <ProgressCircle.Circle aria-valuetext={t(\"quota.used\", { total: TOTAL, used: USED })}>\n <ProgressCircle.Track />\n <ProgressCircle.Range />\n </ProgressCircle.Circle>\n <ProgressCircle.ValueText />\n <ProgressCircle.Label>{t(\"quota.label\")}</ProgressCircle.Label>\n </ProgressCircle.Root>\n );\n}\n";
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/progress-circle/examples/syncing.example.tsx
|
|
163
|
+
var syncing_example_exports = /* @__PURE__ */ __exportAll({
|
|
164
|
+
Syncing: () => Syncing,
|
|
165
|
+
source: () => source$1
|
|
166
|
+
});
|
|
167
|
+
function Syncing(props) {
|
|
168
|
+
const $ = c(8);
|
|
169
|
+
const { t } = useWords("progress-circle");
|
|
170
|
+
let t0;
|
|
171
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
172
|
+
t0 = /* @__PURE__ */ jsxs(Circle, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Range, {})] });
|
|
173
|
+
$[0] = t0;
|
|
174
|
+
} else t0 = $[0];
|
|
175
|
+
let t1;
|
|
176
|
+
if ($[1] !== t) {
|
|
177
|
+
t1 = t("syncing");
|
|
178
|
+
$[1] = t;
|
|
179
|
+
$[2] = t1;
|
|
180
|
+
} else t1 = $[2];
|
|
181
|
+
let t2;
|
|
182
|
+
if ($[3] !== t1) {
|
|
183
|
+
t2 = /* @__PURE__ */ jsx(Label, { children: t1 });
|
|
184
|
+
$[3] = t1;
|
|
185
|
+
$[4] = t2;
|
|
186
|
+
} else t2 = $[4];
|
|
187
|
+
let t3;
|
|
188
|
+
if ($[5] !== props || $[6] !== t2) {
|
|
189
|
+
t3 = /* @__PURE__ */ jsxs(Root, {
|
|
190
|
+
layout: "inline",
|
|
191
|
+
size: "sm",
|
|
192
|
+
value: null,
|
|
193
|
+
...props,
|
|
194
|
+
children: [t0, t2]
|
|
195
|
+
});
|
|
196
|
+
$[5] = props;
|
|
197
|
+
$[6] = t2;
|
|
198
|
+
$[7] = t3;
|
|
199
|
+
} else t3 = $[7];
|
|
200
|
+
return t3;
|
|
201
|
+
}
|
|
202
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ProgressCircle } from \"@stealthscale/component-feedback\";\n\nexport function Syncing(props: ProgressCircle.RootProps): ReactElement {\n const { t } = useWords(\"progress-circle\");\n\n return (\n <ProgressCircle.Root layout=\"inline\" size=\"sm\" value={null} {...props}>\n <ProgressCircle.Circle>\n <ProgressCircle.Track />\n <ProgressCircle.Range />\n </ProgressCircle.Circle>\n <ProgressCircle.Label>{t(\"syncing\")}</ProgressCircle.Label>\n </ProgressCircle.Root>\n );\n}\n";
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/progress-circle/examples/upload.example.tsx
|
|
205
|
+
var upload_example_exports = /* @__PURE__ */ __exportAll({
|
|
206
|
+
Upload: () => Upload,
|
|
207
|
+
source: () => source
|
|
208
|
+
});
|
|
209
|
+
function Upload(props) {
|
|
210
|
+
const $ = c(9);
|
|
211
|
+
const { t } = useWords("progress-circle");
|
|
212
|
+
let t0;
|
|
213
|
+
let t1;
|
|
214
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
215
|
+
t0 = /* @__PURE__ */ jsxs(Circle, { children: [/* @__PURE__ */ jsx(Track, {}), /* @__PURE__ */ jsx(Range, {})] });
|
|
216
|
+
t1 = /* @__PURE__ */ jsx(ValueText, {});
|
|
217
|
+
$[0] = t0;
|
|
218
|
+
$[1] = t1;
|
|
219
|
+
} else {
|
|
220
|
+
t0 = $[0];
|
|
221
|
+
t1 = $[1];
|
|
222
|
+
}
|
|
223
|
+
let t2;
|
|
224
|
+
if ($[2] !== t) {
|
|
225
|
+
t2 = t("upload");
|
|
226
|
+
$[2] = t;
|
|
227
|
+
$[3] = t2;
|
|
228
|
+
} else t2 = $[3];
|
|
229
|
+
let t3;
|
|
230
|
+
if ($[4] !== t2) {
|
|
231
|
+
t3 = /* @__PURE__ */ jsx(Label, { children: t2 });
|
|
232
|
+
$[4] = t2;
|
|
233
|
+
$[5] = t3;
|
|
234
|
+
} else t3 = $[5];
|
|
235
|
+
let t4;
|
|
236
|
+
if ($[6] !== props || $[7] !== t3) {
|
|
237
|
+
t4 = /* @__PURE__ */ jsxs(Root, {
|
|
238
|
+
size: "lg",
|
|
239
|
+
value: 62,
|
|
240
|
+
...props,
|
|
241
|
+
children: [
|
|
242
|
+
t0,
|
|
243
|
+
t1,
|
|
244
|
+
t3
|
|
245
|
+
]
|
|
246
|
+
});
|
|
247
|
+
$[6] = props;
|
|
248
|
+
$[7] = t3;
|
|
249
|
+
$[8] = t4;
|
|
250
|
+
} else t4 = $[8];
|
|
251
|
+
return t4;
|
|
252
|
+
}
|
|
253
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ProgressCircle } from \"@stealthscale/component-feedback\";\n\nexport function Upload(props: ProgressCircle.RootProps): ReactElement {\n const { t } = useWords(\"progress-circle\");\n\n return (\n <ProgressCircle.Root size=\"lg\" value={62} {...props}>\n <ProgressCircle.Circle>\n <ProgressCircle.Track />\n <ProgressCircle.Range />\n </ProgressCircle.Circle>\n <ProgressCircle.ValueText />\n <ProgressCircle.Label>{t(\"upload\")}</ProgressCircle.Label>\n </ProgressCircle.Root>\n );\n}\n";
|
|
254
|
+
//#endregion
|
|
255
|
+
//#region src/progress-circle/progress-circle.specimen.tsx
|
|
256
|
+
/**
|
|
257
|
+
* Catalogue page for the progress circle.
|
|
258
|
+
*
|
|
259
|
+
* @remarks
|
|
260
|
+
* `scenesOf` generates one scene per recipe axis from an upload at 62% with its figure in the
|
|
261
|
+
* ring. The `shape` scene uses the thickest ring, and the `palette` scene crosses the looks.
|
|
262
|
+
* Hand-written scenes render a value the machine does not know in both looks, a checklist
|
|
263
|
+
* counted in steps and a storage quota counted in gigabytes. The words are keys under
|
|
264
|
+
* `progress-circle` in `locales/en/specimen/progress-circle.json`.
|
|
265
|
+
*/
|
|
266
|
+
/**
|
|
267
|
+
* Looks of the unknown-value scene.
|
|
268
|
+
*/
|
|
269
|
+
const LOOKS = ["outline", "subtle"];
|
|
270
|
+
/**
|
|
271
|
+
* Hand-written scene for a value the machine does not know, in both looks.
|
|
272
|
+
*/
|
|
273
|
+
const unknown = {
|
|
274
|
+
about: "progress-circle.unknown.about",
|
|
275
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
276
|
+
knob: "variant",
|
|
277
|
+
of: LOOKS,
|
|
278
|
+
children: (variant) => /* @__PURE__ */ jsx(Syncing, { variant })
|
|
279
|
+
}),
|
|
280
|
+
example: syncing_example_exports,
|
|
281
|
+
props: { variant: "outline" },
|
|
282
|
+
title: "progress-circle.unknown.title"
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Hand-written scene for a checklist counted in steps.
|
|
286
|
+
*/
|
|
287
|
+
const steps = {
|
|
288
|
+
about: "progress-circle.counted.about",
|
|
289
|
+
draw: () => /* @__PURE__ */ jsx(Checklist, {}),
|
|
290
|
+
example: checklist_example_exports,
|
|
291
|
+
title: "progress-circle.counted.title"
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Hand-written scene for a storage quota in its own units.
|
|
295
|
+
*/
|
|
296
|
+
const units = {
|
|
297
|
+
about: "progress-circle.units.about",
|
|
298
|
+
draw: () => /* @__PURE__ */ jsx(Quota, {}),
|
|
299
|
+
example: quota_example_exports,
|
|
300
|
+
title: "progress-circle.units.title"
|
|
301
|
+
};
|
|
302
|
+
var progress_circle_specimen_default = specimen({
|
|
303
|
+
about: "progress-circle.about",
|
|
304
|
+
id: "components/feedback/progress-circle",
|
|
305
|
+
imports: "import { ProgressCircle } from \"@stealthscale/component-feedback\";",
|
|
306
|
+
scenes: [
|
|
307
|
+
...scenesOf(recipe, {
|
|
308
|
+
axes: {
|
|
309
|
+
palette: { across: "variant" },
|
|
310
|
+
shape: { with: { size: "xl" } }
|
|
311
|
+
},
|
|
312
|
+
draw: (props) => /* @__PURE__ */ jsx(Upload, { ...props }),
|
|
313
|
+
example: upload_example_exports,
|
|
314
|
+
namespace: "progress-circle",
|
|
315
|
+
order: [
|
|
316
|
+
"size",
|
|
317
|
+
"shape",
|
|
318
|
+
"palette",
|
|
319
|
+
"layout"
|
|
320
|
+
]
|
|
321
|
+
}),
|
|
322
|
+
unknown,
|
|
323
|
+
steps,
|
|
324
|
+
units
|
|
325
|
+
],
|
|
326
|
+
title: "progress-circle.title"
|
|
327
|
+
});
|
|
328
|
+
//#endregion
|
|
329
|
+
export { progress_circle_specimen_default as default, steps, units, unknown };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"CircleProps": {"conditions": 284, "foreign": 1178}, "LabelProps": {"conditions": 284, "foreign": 1041}, "RangeProps": {"conditions": 284, "foreign": 1178}, "RootProps": {"conditions": 284, "foreign": 1038}, "TrackProps": {"conditions": 284, "foreign": 1178}, "ValueTextProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"CircleProps": [], "LabelProps": [], "RangeProps": [], "RootProps": [{"accepts": "number | null", "fallback": "50", "kind": "option", "name": "defaultValue", "refers": [], "required": false, "says": "The initial value of the progress bar when rendered. Use when you don't need to control the value of the progress bar."}, {"accepts": "\"ltr\" | \"rtl\"", "fallback": "\"ltr\"", "kind": "option", "name": "dir", "refers": [], "required": false, "says": "The document's text/writing direction."}, {"accepts": "NumberFormatOptions", "fallback": "{ style: \"percent\" }", "kind": "option", "name": "formatOptions", "refers": [], "required": false, "says": "The options to use for formatting the value."}, {"accepts": "(() => Document | Node | ShadowRoot)", "fallback": "", "kind": "option", "name": "getRootNode", "refers": [], "required": false, "says": "A root node to correctly resolve document in custom environments. E.x.: Iframes, Electron."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "id", "refers": [], "required": false, "says": "The unique identifier of the machine."}, {"accepts": "ElementIds", "fallback": "", "kind": "option", "name": "ids", "refers": ["progress.ElementIds"], "required": false, "says": "The ids of the elements in the progress bar. Useful for composition."}, {"accepts": "\"inline\" | \"stacked\"", "fallback": "", "kind": "variant", "name": "layout", "refers": [], "required": false, "says": "Where the label goes: under the ring, or beside it."}, {"accepts": "string", "fallback": "\"en-US\"", "kind": "option", "name": "locale", "refers": [], "required": false, "says": "The locale to use for formatting the value."}, {"accepts": "number", "fallback": "100", "kind": "option", "name": "max", "refers": [], "required": false, "says": "The maximum allowed value of the progress bar."}, {"accepts": "number", "fallback": "0", "kind": "option", "name": "min", "refers": [], "required": false, "says": "The minimum allowed value of the progress bar."}, {"accepts": "((details: ValueChangeDetails) => void)", "fallback": "", "kind": "option", "name": "onValueChange", "refers": ["progress.ValueChangeDetails"], "required": false, "says": "Callback fired when the value changes."}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": ""}, {"accepts": "\"full\" | \"square\"", "fallback": "", "kind": "variant", "name": "shape", "refers": [], "required": false, "says": "The ends of the range."}, {"accepts": "\"lg\" | \"md\" | \"sm\" | \"xl\" | \"xs\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "The ring's width and thickness, and the value text's style."}, {"accepts": "number | null", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": false, "says": "The controlled value of the progress bar."}, {"accepts": "\"outline\" | \"subtle\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Strokes the track in the palette's muted role, or in the muted ground."}], "TrackProps": [], "ValueTextProps": []};
|
|
3
|
+
export const shapes = {"progress.ElementIds": [{"accepts": "string", "name": "root", "says": ""}, {"accepts": "string", "name": "track", "says": ""}, {"accepts": "string", "name": "label", "says": ""}, {"accepts": "string", "name": "circle", "says": ""}], "progress.ValueChangeDetails": [{"accepts": "number | null", "name": "value", "says": ""}]};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { n as recipe } from "../../recipes-CX1gSsN7.js";
|
|
3
|
+
import { f as Skeleton } from "../../shared-Xc-n0bn7.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Room, scenesOf, specimen, useWords } from "@stealthscale/specimen";
|
|
7
|
+
import { Card } from "@stealthscale/component-surfaces";
|
|
8
|
+
//#region src/skeleton/examples/profile.example.tsx
|
|
9
|
+
var profile_example_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
Profile: () => Profile,
|
|
11
|
+
source: () => source
|
|
12
|
+
});
|
|
13
|
+
function Profile(props) {
|
|
14
|
+
const $ = c(14);
|
|
15
|
+
const { t } = useWords("skeleton");
|
|
16
|
+
let t0;
|
|
17
|
+
if ($[0] !== t) {
|
|
18
|
+
t0 = t("name");
|
|
19
|
+
$[0] = t;
|
|
20
|
+
$[1] = t0;
|
|
21
|
+
} else t0 = $[1];
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[2] !== t0) {
|
|
24
|
+
t1 = /* @__PURE__ */ jsx(Card.Title, { children: t0 });
|
|
25
|
+
$[2] = t0;
|
|
26
|
+
$[3] = t1;
|
|
27
|
+
} else t1 = $[3];
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[4] !== t) {
|
|
30
|
+
t2 = t("role");
|
|
31
|
+
$[4] = t;
|
|
32
|
+
$[5] = t2;
|
|
33
|
+
} else t2 = $[5];
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[6] !== t2) {
|
|
36
|
+
t3 = /* @__PURE__ */ jsx(Card.Description, { children: t2 });
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
$[7] = t3;
|
|
39
|
+
} else t3 = $[7];
|
|
40
|
+
let t4;
|
|
41
|
+
if ($[8] !== t1 || $[9] !== t3) {
|
|
42
|
+
t4 = /* @__PURE__ */ jsx(Card.Root, {
|
|
43
|
+
size: "sm",
|
|
44
|
+
children: /* @__PURE__ */ jsxs(Card.Header, { children: [t1, t3] })
|
|
45
|
+
});
|
|
46
|
+
$[8] = t1;
|
|
47
|
+
$[9] = t3;
|
|
48
|
+
$[10] = t4;
|
|
49
|
+
} else t4 = $[10];
|
|
50
|
+
let t5;
|
|
51
|
+
if ($[11] !== props || $[12] !== t4) {
|
|
52
|
+
t5 = /* @__PURE__ */ jsx(Skeleton, {
|
|
53
|
+
...props,
|
|
54
|
+
children: t4
|
|
55
|
+
});
|
|
56
|
+
$[11] = props;
|
|
57
|
+
$[12] = t4;
|
|
58
|
+
$[13] = t5;
|
|
59
|
+
} else t5 = $[13];
|
|
60
|
+
return t5;
|
|
61
|
+
}
|
|
62
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { Card } from \"@stealthscale/component-surfaces\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Skeleton } from \"@stealthscale/component-feedback\";\n\nexport function Profile(props: Parameters<typeof Skeleton>[0]): ReactElement {\n const { t } = useWords(\"skeleton\");\n\n return (\n <Skeleton {...props}>\n <Card.Root size=\"sm\">\n <Card.Header>\n <Card.Title>{t(\"name\")}</Card.Title>\n <Card.Description>{t(\"role\")}</Card.Description>\n </Card.Header>\n </Card.Root>\n </Skeleton>\n );\n}\n";
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/skeleton/skeleton.specimen.tsx
|
|
65
|
+
/**
|
|
66
|
+
* Catalogue page for the skeleton.
|
|
67
|
+
*
|
|
68
|
+
* @remarks
|
|
69
|
+
* `scenesOf` generates one scene per recipe axis. Every scene renders the profile card from
|
|
70
|
+
* `examples/` and shows that file as its source. The card gives the skeleton a box, because an
|
|
71
|
+
* empty skeleton collapses to zero height. Each card renders in a `Room` at a sidebar's width.
|
|
72
|
+
* The words are keys under `skeleton` in `locales/en/specimen/skeleton.json`.
|
|
73
|
+
*/
|
|
74
|
+
var skeleton_specimen_default = specimen({
|
|
75
|
+
about: "skeleton.about",
|
|
76
|
+
id: "components/feedback/skeleton",
|
|
77
|
+
imports: "import { Skeleton } from \"@stealthscale/component-feedback\";",
|
|
78
|
+
scenes: scenesOf(recipe, {
|
|
79
|
+
draw: (props) => /* @__PURE__ */ jsx(Room, {
|
|
80
|
+
size: "xs",
|
|
81
|
+
children: /* @__PURE__ */ jsx(Profile, { ...props })
|
|
82
|
+
}),
|
|
83
|
+
example: profile_example_exports,
|
|
84
|
+
namespace: "skeleton",
|
|
85
|
+
order: [
|
|
86
|
+
"loading",
|
|
87
|
+
"motion",
|
|
88
|
+
"radius"
|
|
89
|
+
]
|
|
90
|
+
}),
|
|
91
|
+
title: "skeleton.title"
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { skeleton_specimen_default as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"SkeletonProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"SkeletonProps": [{"accepts": "boolean", "fallback": "", "kind": "variant", "name": "loading", "refers": [], "required": false, "says": "Whether the content is still loading. `true` paints the placeholder and hides the content."}, {"accepts": "\"none\" | \"pulse\" | \"shimmer\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": "Animation of the placeholder while loading."}, {"accepts": "Corner", "fallback": "", "kind": "variant", "name": "radius", "refers": ["kit.Corner"], "required": false, "says": ""}]};
|
|
3
|
+
export const shapes = {"kit.Corner": [{"accepts": "", "name": "\"full\"", "says": ""}, {"accepts": "", "name": "\"l1\"", "says": ""}, {"accepts": "", "name": "\"l2\"", "says": ""}, {"accepts": "", "name": "\"l3\"", "says": ""}]};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { n as recipe } from "../../recipes-CX1gSsN7.js";
|
|
3
|
+
import { d as SkeletonText } from "../../shared-Xc-n0bn7.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { Matrix, specimen, valuesOf } from "@stealthscale/specimen";
|
|
7
|
+
//#region src/skeleton-text/examples/paragraph.example.tsx
|
|
8
|
+
var paragraph_example_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
+
Paragraph: () => Paragraph,
|
|
10
|
+
source: () => source
|
|
11
|
+
});
|
|
12
|
+
function Paragraph(props) {
|
|
13
|
+
const $ = c(2);
|
|
14
|
+
let t0;
|
|
15
|
+
if ($[0] !== props) {
|
|
16
|
+
t0 = /* @__PURE__ */ jsx(SkeletonText, { ...props });
|
|
17
|
+
$[0] = props;
|
|
18
|
+
$[1] = t0;
|
|
19
|
+
} else t0 = $[1];
|
|
20
|
+
return t0;
|
|
21
|
+
}
|
|
22
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { SkeletonText } from \"@stealthscale/component-feedback\";\n\nexport function Paragraph(props: Parameters<typeof SkeletonText>[0]): ReactElement {\n return <SkeletonText {...props} />;\n}\n";
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/skeleton-text/skeleton-text.specimen.tsx
|
|
25
|
+
/**
|
|
26
|
+
* Catalogue page for the skeleton text.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Both scenes are hand-written, because the recipe has no axes. The line scene varies the
|
|
30
|
+
* `lines` prop, and the motion scene varies the skeleton recipe's `motion` axis, which the bars
|
|
31
|
+
* take. Each scene renders the example from `examples/` once per value and shows it as its
|
|
32
|
+
* source with the first value. The cells run in one column, because the bars fill the width they
|
|
33
|
+
* get. The words are keys under `skeleton-text` in `locales/en/specimen/skeleton-text.json`.
|
|
34
|
+
*/
|
|
35
|
+
/**
|
|
36
|
+
* Line counts of the line scene.
|
|
37
|
+
*/
|
|
38
|
+
const COUNTS = [
|
|
39
|
+
1,
|
|
40
|
+
3,
|
|
41
|
+
6
|
|
42
|
+
];
|
|
43
|
+
/**
|
|
44
|
+
* Hand-written scene for one, three and six lines.
|
|
45
|
+
*/
|
|
46
|
+
const lines = {
|
|
47
|
+
about: "skeleton-text.lines.about",
|
|
48
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
49
|
+
direction: "column",
|
|
50
|
+
knob: "lines",
|
|
51
|
+
of: COUNTS,
|
|
52
|
+
children: (count) => /* @__PURE__ */ jsx(Paragraph, { lines: count })
|
|
53
|
+
}),
|
|
54
|
+
example: paragraph_example_exports,
|
|
55
|
+
props: { lines: 1 },
|
|
56
|
+
title: "skeleton-text.lines.title"
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Hand-written scene for every motion of the skeleton recipe.
|
|
60
|
+
*/
|
|
61
|
+
const motion = {
|
|
62
|
+
about: "skeleton-text.motion.about",
|
|
63
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
64
|
+
direction: "column",
|
|
65
|
+
knob: "motion",
|
|
66
|
+
of: valuesOf(recipe, "motion"),
|
|
67
|
+
children: (value) => /* @__PURE__ */ jsx(Paragraph, { motion: value })
|
|
68
|
+
}),
|
|
69
|
+
example: paragraph_example_exports,
|
|
70
|
+
props: { motion: "none" },
|
|
71
|
+
title: "skeleton-text.motion.title"
|
|
72
|
+
};
|
|
73
|
+
var skeleton_text_specimen_default = specimen({
|
|
74
|
+
about: "skeleton-text.about",
|
|
75
|
+
id: "components/feedback/skeleton-text",
|
|
76
|
+
imports: "import { SkeletonText } from \"@stealthscale/component-feedback\";",
|
|
77
|
+
scenes: [lines, motion],
|
|
78
|
+
title: "skeleton-text.title"
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
export { skeleton_text_specimen_default as default, lines, motion };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"SkeletonTextProps": {"conditions": 284, "foreign": 1041}};
|
|
2
|
+
export const parts = {"SkeletonTextProps": [{"accepts": "number", "fallback": "", "kind": "option", "name": "lines", "refers": [], "required": false, "says": "Number of bars. Defaults to 3, and a value below 1 renders one bar."}, {"accepts": "\"none\" | \"pulse\" | \"shimmer\"", "fallback": "", "kind": "option", "name": "motion", "refers": [], "required": false, "says": "Animation of every bar. The skeleton recipe's default applies when absent."}, {"accepts": "Corner", "fallback": "", "kind": "option", "name": "radius", "refers": ["kit.Corner"], "required": false, "says": "Corner radius of every bar. The skeleton recipe's default applies when absent."}]};
|
|
3
|
+
export const shapes = {"kit.Corner": [{"accepts": "", "name": "\"full\"", "says": ""}, {"accepts": "", "name": "\"l1\"", "says": ""}, {"accepts": "", "name": "\"l2\"", "says": ""}, {"accepts": "", "name": "\"l3\"", "says": ""}]};
|