@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.
Files changed (37) hide show
  1. package/dist/cyclonedx/bom.json +1 -1
  2. package/dist/index.js +1 -1825
  3. package/dist/pages/alert/alert.js +223 -0
  4. package/dist/pages/alert/alert.props.js +3 -0
  5. package/dist/pages/empty-state/empty-state.js +96 -0
  6. package/dist/pages/empty-state/empty-state.props.js +3 -0
  7. package/dist/pages/loader/loader.js +359 -0
  8. package/dist/pages/loader/loader.props.js +3 -0
  9. package/dist/pages/meter/meter.js +785 -0
  10. package/dist/pages/meter/meter.props.js +3 -0
  11. package/dist/pages/pages.json +115 -0
  12. package/dist/pages/progress/progress.js +550 -0
  13. package/dist/pages/progress/progress.props.js +3 -0
  14. package/dist/pages/progress-circle/progress-circle.js +329 -0
  15. package/dist/pages/progress-circle/progress-circle.props.js +3 -0
  16. package/dist/pages/skeleton/skeleton.js +94 -0
  17. package/dist/pages/skeleton/skeleton.props.js +3 -0
  18. package/dist/pages/skeleton-text/skeleton-text.js +81 -0
  19. package/dist/pages/skeleton-text/skeleton-text.props.js +3 -0
  20. package/dist/pages/spinner/spinner.js +186 -0
  21. package/dist/pages/spinner/spinner.props.js +3 -0
  22. package/dist/pages/toast/toast.js +427 -0
  23. package/dist/pages/toast/toast.props.js +3 -0
  24. package/dist/shared-Xc-n0bn7.js +1826 -0
  25. package/dist/theme.js +27 -13
  26. package/locales/en/specimen/alert.json +37 -0
  27. package/locales/en/specimen/empty-state.json +10 -0
  28. package/locales/en/specimen/loader.json +30 -0
  29. package/locales/en/specimen/meter.json +81 -0
  30. package/locales/en/specimen/progress-circle.json +41 -0
  31. package/locales/en/specimen/progress.json +66 -0
  32. package/locales/en/specimen/skeleton-text.json +12 -0
  33. package/locales/en/specimen/skeleton.json +18 -0
  34. package/locales/en/specimen/spinner.json +33 -0
  35. package/locales/en/specimen/toast.json +79 -0
  36. package/package.json +8 -7
  37. /package/dist/{recipe-CX1gSsN7.js → recipes-CX1gSsN7.js} +0 -0
@@ -0,0 +1,223 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { f as recipe } from "../../recipes-CX1gSsN7.js";
3
+ import { G as Description, H as Title, K as Content, U as Root, W as Indicator, q as CloseTrigger } from "../../shared-Xc-n0bn7.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { scenesOf, specimen, useWords } from "@stealthscale/specimen";
7
+ import { InfoIcon, TriangleAlertIcon, XIcon } from "lucide-react";
8
+ //#region src/alert/examples/failed.example.tsx
9
+ var failed_example_exports = /* @__PURE__ */ __exportAll({
10
+ Failed: () => Failed,
11
+ source: () => source$1
12
+ });
13
+ function Failed(props) {
14
+ const $ = c(21);
15
+ const { t } = useWords("alert");
16
+ let t0;
17
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
18
+ t0 = /* @__PURE__ */ jsx(Indicator, { children: /* @__PURE__ */ jsx(TriangleAlertIcon, {}) });
19
+ $[0] = t0;
20
+ } else t0 = $[0];
21
+ let t1;
22
+ if ($[1] !== t) {
23
+ t1 = t("failed");
24
+ $[1] = t;
25
+ $[2] = t1;
26
+ } else t1 = $[2];
27
+ let t2;
28
+ if ($[3] !== t1) {
29
+ t2 = /* @__PURE__ */ jsx(Title, { children: t1 });
30
+ $[3] = t1;
31
+ $[4] = t2;
32
+ } else t2 = $[4];
33
+ let t3;
34
+ if ($[5] !== t) {
35
+ t3 = t("declined");
36
+ $[5] = t;
37
+ $[6] = t3;
38
+ } else t3 = $[6];
39
+ let t4;
40
+ if ($[7] !== t3) {
41
+ t4 = /* @__PURE__ */ jsx(Description, { children: t3 });
42
+ $[7] = t3;
43
+ $[8] = t4;
44
+ } else t4 = $[8];
45
+ let t5;
46
+ if ($[9] !== t2 || $[10] !== t4) {
47
+ t5 = /* @__PURE__ */ jsxs(Content, { children: [t2, t4] });
48
+ $[9] = t2;
49
+ $[10] = t4;
50
+ $[11] = t5;
51
+ } else t5 = $[11];
52
+ let t6;
53
+ if ($[12] !== t) {
54
+ t6 = t("dismiss", { name: t("failed") });
55
+ $[12] = t;
56
+ $[13] = t6;
57
+ } else t6 = $[13];
58
+ let t7;
59
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
60
+ t7 = /* @__PURE__ */ jsx(XIcon, {});
61
+ $[14] = t7;
62
+ } else t7 = $[14];
63
+ let t8;
64
+ if ($[15] !== t6) {
65
+ t8 = /* @__PURE__ */ jsx(CloseTrigger, {
66
+ label: t6,
67
+ children: t7
68
+ });
69
+ $[15] = t6;
70
+ $[16] = t8;
71
+ } else t8 = $[16];
72
+ let t9;
73
+ if ($[17] !== props || $[18] !== t5 || $[19] !== t8) {
74
+ t9 = /* @__PURE__ */ jsxs(Root, {
75
+ ...props,
76
+ children: [
77
+ t0,
78
+ t5,
79
+ t8
80
+ ]
81
+ });
82
+ $[17] = props;
83
+ $[18] = t5;
84
+ $[19] = t8;
85
+ $[20] = t9;
86
+ } else t9 = $[20];
87
+ return t9;
88
+ }
89
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { TriangleAlertIcon, XIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Alert } from \"@stealthscale/component-feedback\";\n\nexport function Failed(props: Alert.RootProps): ReactElement {\n const { t } = useWords(\"alert\");\n\n return (\n <Alert.Root {...props}>\n <Alert.Indicator>\n <TriangleAlertIcon />\n </Alert.Indicator>\n <Alert.Content>\n <Alert.Title>{t(\"failed\")}</Alert.Title>\n <Alert.Description>{t(\"declined\")}</Alert.Description>\n </Alert.Content>\n <Alert.CloseTrigger label={t(\"dismiss\", { name: t(\"failed\") })}>\n <XIcon />\n </Alert.CloseTrigger>\n </Alert.Root>\n );\n}\n";
90
+ //#endregion
91
+ //#region src/alert/examples/saved.example.tsx
92
+ var saved_example_exports = /* @__PURE__ */ __exportAll({
93
+ Saved: () => Saved,
94
+ source: () => source
95
+ });
96
+ function Saved(props) {
97
+ const $ = c(21);
98
+ const { t } = useWords("alert");
99
+ let t0;
100
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
101
+ t0 = /* @__PURE__ */ jsx(Indicator, { children: /* @__PURE__ */ jsx(InfoIcon, {}) });
102
+ $[0] = t0;
103
+ } else t0 = $[0];
104
+ let t1;
105
+ if ($[1] !== t) {
106
+ t1 = t("saved");
107
+ $[1] = t;
108
+ $[2] = t1;
109
+ } else t1 = $[2];
110
+ let t2;
111
+ if ($[3] !== t1) {
112
+ t2 = /* @__PURE__ */ jsx(Title, { children: t1 });
113
+ $[3] = t1;
114
+ $[4] = t2;
115
+ } else t2 = $[4];
116
+ let t3;
117
+ if ($[5] !== t) {
118
+ t3 = t("restored");
119
+ $[5] = t;
120
+ $[6] = t3;
121
+ } else t3 = $[6];
122
+ let t4;
123
+ if ($[7] !== t3) {
124
+ t4 = /* @__PURE__ */ jsx(Description, { children: t3 });
125
+ $[7] = t3;
126
+ $[8] = t4;
127
+ } else t4 = $[8];
128
+ let t5;
129
+ if ($[9] !== t2 || $[10] !== t4) {
130
+ t5 = /* @__PURE__ */ jsxs(Content, { children: [t2, t4] });
131
+ $[9] = t2;
132
+ $[10] = t4;
133
+ $[11] = t5;
134
+ } else t5 = $[11];
135
+ let t6;
136
+ if ($[12] !== t) {
137
+ t6 = t("dismiss", { name: t("saved") });
138
+ $[12] = t;
139
+ $[13] = t6;
140
+ } else t6 = $[13];
141
+ let t7;
142
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
143
+ t7 = /* @__PURE__ */ jsx(XIcon, {});
144
+ $[14] = t7;
145
+ } else t7 = $[14];
146
+ let t8;
147
+ if ($[15] !== t6) {
148
+ t8 = /* @__PURE__ */ jsx(CloseTrigger, {
149
+ label: t6,
150
+ children: t7
151
+ });
152
+ $[15] = t6;
153
+ $[16] = t8;
154
+ } else t8 = $[16];
155
+ let t9;
156
+ if ($[17] !== props || $[18] !== t5 || $[19] !== t8) {
157
+ t9 = /* @__PURE__ */ jsxs(Root, {
158
+ ...props,
159
+ children: [
160
+ t0,
161
+ t5,
162
+ t8
163
+ ]
164
+ });
165
+ $[17] = props;
166
+ $[18] = t5;
167
+ $[19] = t8;
168
+ $[20] = t9;
169
+ } else t9 = $[20];
170
+ return t9;
171
+ }
172
+ const source = "import { type ReactElement } from \"react\";\n\nimport { InfoIcon, XIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Alert } from \"@stealthscale/component-feedback\";\n\nexport function Saved(props: Alert.RootProps): ReactElement {\n const { t } = useWords(\"alert\");\n\n return (\n <Alert.Root {...props}>\n <Alert.Indicator>\n <InfoIcon />\n </Alert.Indicator>\n <Alert.Content>\n <Alert.Title>{t(\"saved\")}</Alert.Title>\n <Alert.Description>{t(\"restored\")}</Alert.Description>\n </Alert.Content>\n <Alert.CloseTrigger label={t(\"dismiss\", { name: t(\"saved\") })}>\n <XIcon />\n </Alert.CloseTrigger>\n </Alert.Root>\n );\n}\n";
173
+ //#endregion
174
+ //#region src/alert/alert.specimen.tsx
175
+ /**
176
+ * Settings of the scenes that render the failed payment.
177
+ */
178
+ const FAILED = {
179
+ draw: (props) => /* @__PURE__ */ jsx(Failed, {
180
+ ...props,
181
+ live: "off"
182
+ }),
183
+ example: failed_example_exports
184
+ };
185
+ var alert_specimen_default = specimen({
186
+ about: "alert.about",
187
+ id: "components/feedback/alert",
188
+ imports: "import { Alert } from \"@stealthscale/component-feedback\";",
189
+ scenes: scenesOf(recipe, {
190
+ axes: {
191
+ edge: { with: { status: "warning" } },
192
+ layout: { with: { status: "success" } },
193
+ motion: {
194
+ ...FAILED,
195
+ with: { status: "error" }
196
+ },
197
+ size: { direction: "column" },
198
+ status: FAILED,
199
+ variant: {
200
+ ...FAILED,
201
+ with: { status: "error" }
202
+ }
203
+ },
204
+ draw: (props) => /* @__PURE__ */ jsx(Saved, {
205
+ ...props,
206
+ live: "off"
207
+ }),
208
+ example: saved_example_exports,
209
+ namespace: "alert",
210
+ order: [
211
+ "variant",
212
+ "status",
213
+ "size",
214
+ "radius",
215
+ "layout",
216
+ "edge",
217
+ "motion"
218
+ ]
219
+ }),
220
+ title: "alert.title"
221
+ });
222
+ //#endregion
223
+ export { alert_specimen_default as default };
@@ -0,0 +1,3 @@
1
+ export const dropped = {"AsideProps": {"conditions": 284, "foreign": 1041}, "CloseTriggerProps": {"conditions": 284, "foreign": 1051}, "ContentProps": {"conditions": 284, "foreign": 1041}, "DescriptionProps": {"conditions": 284, "foreign": 1041}, "IndicatorProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1041}, "TitleProps": {"conditions": 284, "foreign": 1041}};
2
+ export const parts = {"AsideProps": [], "CloseTriggerProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "label", "refers": [], "required": false, "says": "Accessible name of the button. Defaults to `Dismiss`."}], "ContentProps": [], "DescriptionProps": [], "IndicatorProps": [], "RootProps": [{"accepts": "\"bottom\" | \"end\" | \"top\"", "fallback": "", "kind": "variant", "name": "edge", "refers": [], "required": false, "says": "The edge with a rule in the palette's solid color. Unset by default."}, {"accepts": "\"inline\" | \"stacked\"", "fallback": "", "kind": "variant", "name": "layout", "refers": [], "required": false, "says": "Whether the title is above the description or on the same line with it."}, {"accepts": "Live", "fallback": "", "kind": "option", "name": "live", "refers": ["kit.Live"], "required": false, "says": "Announcement level, which sets the role. Defaults to `polite`."}, {"accepts": "\"fade\" | \"reveal\" | \"rise\"", "fallback": "", "kind": "variant", "name": "motion", "refers": [], "required": false, "says": ""}, {"accepts": "Corner", "fallback": "", "kind": "variant", "name": "radius", "refers": ["kit.Corner"], "required": false, "says": ""}, {"accepts": "\"lg\" | \"md\" | \"sm\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": ""}, {"accepts": "\"error\" | \"info\" | \"neutral\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "status", "refers": [], "required": false, "says": "The severity of the alert. It sets `colorPalette` and nothing else."}, {"accepts": "Flat", "fallback": "", "kind": "variant", "name": "variant", "refers": ["kit.Flat"], "required": false, "says": "The fill and edge of the alert, from the `flat.*` layer styles."}], "TitleProps": []};
3
+ export const shapes = {"kit.Live": [{"accepts": "", "name": "\"assertive\"", "says": ""}, {"accepts": "", "name": "\"off\"", "says": ""}, {"accepts": "", "name": "\"polite\"", "says": ""}], "kit.Corner": [{"accepts": "", "name": "\"full\"", "says": ""}, {"accepts": "", "name": "\"l1\"", "says": ""}, {"accepts": "", "name": "\"l2\"", "says": ""}, {"accepts": "", "name": "\"l3\"", "says": ""}], "kit.Flat": [{"accepts": "", "name": "\"outline\"", "says": ""}, {"accepts": "", "name": "\"plain\"", "says": ""}, {"accepts": "", "name": "\"solid\"", "says": ""}, {"accepts": "", "name": "\"subtle\"", "says": ""}, {"accepts": "", "name": "\"surface\"", "says": ""}]};
@@ -0,0 +1,96 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { d as recipe } from "../../recipes-CX1gSsN7.js";
3
+ import { B as Content, I as Title, L as Root, R as Indicator, z as Description } from "../../shared-Xc-n0bn7.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { scenesOf, specimen, useWords } from "@stealthscale/specimen";
7
+ import { InboxIcon } from "lucide-react";
8
+ //#region src/empty-state/examples/invoices.example.tsx
9
+ var invoices_example_exports = /* @__PURE__ */ __exportAll({
10
+ Invoices: () => Invoices,
11
+ source: () => source
12
+ });
13
+ function Invoices(props) {
14
+ const $ = c(15);
15
+ const { t } = useWords("empty-state");
16
+ let t0;
17
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
18
+ t0 = /* @__PURE__ */ jsx(Indicator, { children: /* @__PURE__ */ jsx(InboxIcon, {}) });
19
+ $[0] = t0;
20
+ } else t0 = $[0];
21
+ let t1;
22
+ if ($[1] !== t) {
23
+ t1 = t("none");
24
+ $[1] = t;
25
+ $[2] = t1;
26
+ } else t1 = $[2];
27
+ let t2;
28
+ if ($[3] !== t1) {
29
+ t2 = /* @__PURE__ */ jsx(Title, {
30
+ as: "h3",
31
+ children: t1
32
+ });
33
+ $[3] = t1;
34
+ $[4] = t2;
35
+ } else t2 = $[4];
36
+ let t3;
37
+ if ($[5] !== t) {
38
+ t3 = t("description");
39
+ $[5] = t;
40
+ $[6] = t3;
41
+ } else t3 = $[6];
42
+ let t4;
43
+ if ($[7] !== t3) {
44
+ t4 = /* @__PURE__ */ jsx(Description, { children: t3 });
45
+ $[7] = t3;
46
+ $[8] = t4;
47
+ } else t4 = $[8];
48
+ let t5;
49
+ if ($[9] !== t2 || $[10] !== t4) {
50
+ t5 = /* @__PURE__ */ jsxs(Content, { children: [
51
+ t0,
52
+ t2,
53
+ t4
54
+ ] });
55
+ $[9] = t2;
56
+ $[10] = t4;
57
+ $[11] = t5;
58
+ } else t5 = $[11];
59
+ let t6;
60
+ if ($[12] !== props || $[13] !== t5) {
61
+ t6 = /* @__PURE__ */ jsx(Root, {
62
+ ...props,
63
+ children: t5
64
+ });
65
+ $[12] = props;
66
+ $[13] = t5;
67
+ $[14] = t6;
68
+ } else t6 = $[14];
69
+ return t6;
70
+ }
71
+ const source = "import { type ReactElement } from \"react\";\n\nimport { InboxIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { EmptyState } from \"@stealthscale/component-feedback\";\n\nexport function Invoices(props: EmptyState.RootProps): ReactElement {\n const { t } = useWords(\"empty-state\");\n\n return (\n <EmptyState.Root {...props}>\n <EmptyState.Content>\n <EmptyState.Indicator>\n <InboxIcon />\n </EmptyState.Indicator>\n <EmptyState.Title as=\"h3\">{t(\"none\")}</EmptyState.Title>\n <EmptyState.Description>{t(\"description\")}</EmptyState.Description>\n </EmptyState.Content>\n </EmptyState.Root>\n );\n}\n";
72
+ //#endregion
73
+ //#region src/empty-state/empty-state.specimen.tsx
74
+ /**
75
+ * Catalogue page for the empty state.
76
+ *
77
+ * @remarks
78
+ * `scenesOf` generates the size scene, one panel per row, because a panel fills the width it
79
+ * gets. The scene renders the example from `examples/` and shows it as its source. The example's
80
+ * title is an `h3` under the scene's `h2`. The words are keys under `empty-state` in
81
+ * `locales/en/specimen/empty-state.json`.
82
+ */
83
+ var empty_state_specimen_default = specimen({
84
+ about: "empty-state.about",
85
+ id: "components/feedback/empty-state",
86
+ imports: "import { EmptyState } from \"@stealthscale/component-feedback\";",
87
+ scenes: scenesOf(recipe, {
88
+ axes: { size: { direction: "column" } },
89
+ draw: (props) => /* @__PURE__ */ jsx(Invoices, { ...props }),
90
+ example: invoices_example_exports,
91
+ namespace: "empty-state"
92
+ }),
93
+ title: "empty-state.title"
94
+ });
95
+ //#endregion
96
+ export { empty_state_specimen_default as default };
@@ -0,0 +1,3 @@
1
+ export const dropped = {"ContentProps": {"conditions": 284, "foreign": 1041}, "DescriptionProps": {"conditions": 284, "foreign": 1041}, "IndicatorProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1041}, "TitleProps": {"conditions": 284, "foreign": 1041}};
2
+ export const parts = {"ContentProps": [], "DescriptionProps": [], "IndicatorProps": [], "RootProps": [{"accepts": "\"lg\" | \"md\" | \"sm\"", "fallback": "", "kind": "variant", "name": "size", "refers": [], "required": false, "says": "The inset of the panel, the gap in the column, the box of the mark and the title's text style."}], "TitleProps": []};
3
+ export const shapes = {};
@@ -0,0 +1,359 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { u as recipe } from "../../recipes-CX1gSsN7.js";
3
+ import { M as LoaderOverlay, N as Loader } 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
+ import { Stack } from "@stealthscale/component-layout";
9
+ import { Button } from "@stealthscale/component-actions";
10
+ import { Text } from "@stealthscale/component-typography";
11
+ //#region src/loader/examples/covered.example.tsx
12
+ var covered_example_exports = /* @__PURE__ */ __exportAll({
13
+ Covered: () => Covered,
14
+ source: () => source$4
15
+ });
16
+ function Covered(props) {
17
+ const $ = c(21);
18
+ const { t } = useWords("loader");
19
+ let t0;
20
+ if ($[0] !== t) {
21
+ t0 = t("lines");
22
+ $[0] = t;
23
+ $[1] = t0;
24
+ } else t0 = $[1];
25
+ let t1;
26
+ if ($[2] !== t0) {
27
+ t1 = /* @__PURE__ */ jsx(Card.Title, { children: t0 });
28
+ $[2] = t0;
29
+ $[3] = t1;
30
+ } else t1 = $[3];
31
+ let t2;
32
+ if ($[4] !== t) {
33
+ t2 = t("ledger");
34
+ $[4] = t;
35
+ $[5] = t2;
36
+ } else t2 = $[5];
37
+ let t3;
38
+ if ($[6] !== t2) {
39
+ t3 = /* @__PURE__ */ jsx(Card.Description, { children: t2 });
40
+ $[6] = t2;
41
+ $[7] = t3;
42
+ } else t3 = $[7];
43
+ let t4;
44
+ if ($[8] !== t1 || $[9] !== t3) {
45
+ t4 = /* @__PURE__ */ jsxs(Card.Header, { children: [t1, t3] });
46
+ $[8] = t1;
47
+ $[9] = t3;
48
+ $[10] = t4;
49
+ } else t4 = $[10];
50
+ let t5;
51
+ if ($[11] !== t) {
52
+ t5 = t("matching");
53
+ $[11] = t;
54
+ $[12] = t5;
55
+ } else t5 = $[12];
56
+ let t6;
57
+ if ($[13] !== t5) {
58
+ t6 = /* @__PURE__ */ jsx(Loader, { text: t5 });
59
+ $[13] = t5;
60
+ $[14] = t6;
61
+ } else t6 = $[14];
62
+ let t7;
63
+ if ($[15] !== props || $[16] !== t6) {
64
+ t7 = /* @__PURE__ */ jsx(LoaderOverlay, {
65
+ ...props,
66
+ children: t6
67
+ });
68
+ $[15] = props;
69
+ $[16] = t6;
70
+ $[17] = t7;
71
+ } else t7 = $[17];
72
+ let t8;
73
+ if ($[18] !== t4 || $[19] !== t7) {
74
+ t8 = /* @__PURE__ */ jsxs(Card.Root, { children: [t4, t7] });
75
+ $[18] = t4;
76
+ $[19] = t7;
77
+ $[20] = t8;
78
+ } else t8 = $[20];
79
+ return t8;
80
+ }
81
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { Card } from \"@stealthscale/component-surfaces\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Loader, LoaderOverlay } from \"@stealthscale/component-feedback\";\n\nexport function Covered(props: Parameters<typeof LoaderOverlay>[0]): ReactElement {\n const { t } = useWords(\"loader\");\n\n return (\n <Card.Root>\n <Card.Header>\n <Card.Title>{t(\"lines\")}</Card.Title>\n <Card.Description>{t(\"ledger\")}</Card.Description>\n </Card.Header>\n <LoaderOverlay {...props}>\n <Loader text={t(\"matching\")} />\n </LoaderOverlay>\n </Card.Root>\n );\n}\n";
82
+ //#endregion
83
+ //#region src/loader/examples/matching.example.tsx
84
+ var matching_example_exports = /* @__PURE__ */ __exportAll({
85
+ Matching: () => Matching,
86
+ source: () => source$3
87
+ });
88
+ function Matching(props) {
89
+ const $ = c(5);
90
+ const { t } = useWords("loader");
91
+ let t0;
92
+ if ($[0] !== t) {
93
+ t0 = t("matching");
94
+ $[0] = t;
95
+ $[1] = t0;
96
+ } else t0 = $[1];
97
+ let t1;
98
+ if ($[2] !== props || $[3] !== t0) {
99
+ t1 = /* @__PURE__ */ jsx(Loader, {
100
+ text: t0,
101
+ ...props
102
+ });
103
+ $[2] = props;
104
+ $[3] = t0;
105
+ $[4] = t1;
106
+ } else t1 = $[4];
107
+ return t1;
108
+ }
109
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Loader } from \"@stealthscale/component-feedback\";\n\nexport function Matching(props: Omit<Parameters<typeof Loader>[0], \"text\">): ReactElement {\n const { t } = useWords(\"loader\");\n\n return <Loader text={t(\"matching\")} {...props} />;\n}\n";
110
+ //#endregion
111
+ //#region src/loader/examples/placements.example.tsx
112
+ var placements_example_exports = /* @__PURE__ */ __exportAll({
113
+ Placements: () => Placements,
114
+ source: () => source$2
115
+ });
116
+ function Placements() {
117
+ const $ = c(11);
118
+ const { t } = useWords("loader");
119
+ let t0;
120
+ if ($[0] !== t) {
121
+ t0 = t("matching");
122
+ $[0] = t;
123
+ $[1] = t0;
124
+ } else t0 = $[1];
125
+ let t1;
126
+ if ($[2] !== t0) {
127
+ t1 = /* @__PURE__ */ jsx(Loader, {
128
+ placement: "start",
129
+ text: t0
130
+ });
131
+ $[2] = t0;
132
+ $[3] = t1;
133
+ } else t1 = $[3];
134
+ let t2;
135
+ if ($[4] !== t) {
136
+ t2 = t("matching");
137
+ $[4] = t;
138
+ $[5] = t2;
139
+ } else t2 = $[5];
140
+ let t3;
141
+ if ($[6] !== t2) {
142
+ t3 = /* @__PURE__ */ jsx(Loader, {
143
+ placement: "end",
144
+ text: t2
145
+ });
146
+ $[6] = t2;
147
+ $[7] = t3;
148
+ } else t3 = $[7];
149
+ let t4;
150
+ if ($[8] !== t1 || $[9] !== t3) {
151
+ t4 = /* @__PURE__ */ jsxs(Stack, {
152
+ align: "flex-start",
153
+ direction: "column",
154
+ gap: "md",
155
+ children: [t1, t3]
156
+ });
157
+ $[8] = t1;
158
+ $[9] = t3;
159
+ $[10] = t4;
160
+ } else t4 = $[10];
161
+ return t4;
162
+ }
163
+ const source$2 = "import { type ReactElement } from \"react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Loader } from \"@stealthscale/component-feedback\";\n\nexport function Placements(): ReactElement {\n const { t } = useWords(\"loader\");\n\n return (\n <Stack align=\"flex-start\" direction=\"column\" gap=\"md\">\n <Loader placement=\"start\" text={t(\"matching\")} />\n <Loader placement=\"end\" text={t(\"matching\")} />\n </Stack>\n );\n}\n";
164
+ //#endregion
165
+ //#region src/loader/examples/saving.example.tsx
166
+ var saving_example_exports = /* @__PURE__ */ __exportAll({
167
+ Saving: () => Saving,
168
+ source: () => source$1
169
+ });
170
+ function Saving() {
171
+ const $ = c(17);
172
+ const { t } = useWords("loader");
173
+ let t0;
174
+ if ($[0] !== t) {
175
+ t0 = t("saving");
176
+ $[0] = t;
177
+ $[1] = t0;
178
+ } else t0 = $[1];
179
+ let t1;
180
+ if ($[2] !== t) {
181
+ t1 = t("save");
182
+ $[2] = t;
183
+ $[3] = t1;
184
+ } else t1 = $[3];
185
+ let t2;
186
+ if ($[4] !== t0 || $[5] !== t1) {
187
+ t2 = /* @__PURE__ */ jsx(Button, { children: /* @__PURE__ */ jsx(Loader, {
188
+ label: t0,
189
+ loading: false,
190
+ children: t1
191
+ }) });
192
+ $[4] = t0;
193
+ $[5] = t1;
194
+ $[6] = t2;
195
+ } else t2 = $[6];
196
+ let t3;
197
+ if ($[7] !== t) {
198
+ t3 = t("saving");
199
+ $[7] = t;
200
+ $[8] = t3;
201
+ } else t3 = $[8];
202
+ let t4;
203
+ if ($[9] !== t) {
204
+ t4 = t("save");
205
+ $[9] = t;
206
+ $[10] = t4;
207
+ } else t4 = $[10];
208
+ let t5;
209
+ if ($[11] !== t3 || $[12] !== t4) {
210
+ t5 = /* @__PURE__ */ jsx(Button, {
211
+ disabled: true,
212
+ children: /* @__PURE__ */ jsx(Loader, {
213
+ label: t3,
214
+ loading: true,
215
+ children: t4
216
+ })
217
+ });
218
+ $[11] = t3;
219
+ $[12] = t4;
220
+ $[13] = t5;
221
+ } else t5 = $[13];
222
+ let t6;
223
+ if ($[14] !== t2 || $[15] !== t5) {
224
+ t6 = /* @__PURE__ */ jsxs(Stack, {
225
+ direction: "row",
226
+ gap: "xl",
227
+ children: [t2, t5]
228
+ });
229
+ $[14] = t2;
230
+ $[15] = t5;
231
+ $[16] = t6;
232
+ } else t6 = $[16];
233
+ return t6;
234
+ }
235
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { Button } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Loader } from \"@stealthscale/component-feedback\";\n\nexport function Saving(): ReactElement {\n const { t } = useWords(\"loader\");\n\n return (\n <Stack direction=\"row\" gap=\"xl\">\n <Button>\n <Loader label={t(\"saving\")} loading={false}>\n {t(\"save\")}\n </Loader>\n </Button>\n <Button disabled>\n <Loader label={t(\"saving\")} loading>\n {t(\"save\")}\n </Loader>\n </Button>\n </Stack>\n );\n}\n";
236
+ //#endregion
237
+ //#region src/loader/examples/value.example.tsx
238
+ var value_example_exports = /* @__PURE__ */ __exportAll({
239
+ Value: () => Value,
240
+ source: () => source
241
+ });
242
+ function Value() {
243
+ const $ = c(11);
244
+ const { t } = useWords("loader");
245
+ let t0;
246
+ if ($[0] !== t) {
247
+ t0 = t("settled");
248
+ $[0] = t;
249
+ $[1] = t0;
250
+ } else t0 = $[1];
251
+ let t1;
252
+ if ($[2] !== t0) {
253
+ t1 = /* @__PURE__ */ jsx(Text, {
254
+ weight: "semibold",
255
+ children: /* @__PURE__ */ jsx(Loader, {
256
+ loading: false,
257
+ children: t0
258
+ })
259
+ });
260
+ $[2] = t0;
261
+ $[3] = t1;
262
+ } else t1 = $[3];
263
+ let t2;
264
+ if ($[4] !== t) {
265
+ t2 = t("settled");
266
+ $[4] = t;
267
+ $[5] = t2;
268
+ } else t2 = $[5];
269
+ let t3;
270
+ if ($[6] !== t2) {
271
+ t3 = /* @__PURE__ */ jsx(Text, {
272
+ weight: "semibold",
273
+ children: /* @__PURE__ */ jsx(Loader, {
274
+ loading: true,
275
+ children: t2
276
+ })
277
+ });
278
+ $[6] = t2;
279
+ $[7] = t3;
280
+ } else t3 = $[7];
281
+ let t4;
282
+ if ($[8] !== t1 || $[9] !== t3) {
283
+ t4 = /* @__PURE__ */ jsxs(Stack, {
284
+ direction: "row",
285
+ gap: "xl",
286
+ children: [t1, t3]
287
+ });
288
+ $[8] = t1;
289
+ $[9] = t3;
290
+ $[10] = t4;
291
+ } else t4 = $[10];
292
+ return t4;
293
+ }
294
+ const source = "import { type ReactElement } from \"react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Loader } from \"@stealthscale/component-feedback\";\n\nexport function Value(): ReactElement {\n const { t } = useWords(\"loader\");\n\n return (\n <Stack direction=\"row\" gap=\"xl\">\n <Text weight=\"semibold\">\n <Loader loading={false}>{t(\"settled\")}</Loader>\n </Text>\n <Text weight=\"semibold\">\n <Loader loading>{t(\"settled\")}</Loader>\n </Text>\n </Stack>\n );\n}\n";
295
+ //#endregion
296
+ //#region src/loader/loader.specimen.tsx
297
+ /**
298
+ * Catalogue page for the loader.
299
+ *
300
+ * @remarks
301
+ * `scenesOf` generates the palette and scrim scenes from the recipe. Every scene renders a
302
+ * component from `examples/` and shows that file as its source. The value and button scenes
303
+ * render the loaded and the loading state next to each other, so the page shows that the box
304
+ * keeps its size. The words are keys under `loader` in the `specimen` namespace, stored in
305
+ * `locales/en/specimen/loader.json`.
306
+ */
307
+ /**
308
+ * Hand-written scene for the spinner on either side of the text.
309
+ */
310
+ const placement = {
311
+ about: "loader.placement.about",
312
+ draw: Placements,
313
+ example: placements_example_exports,
314
+ title: "loader.placement.title"
315
+ };
316
+ /**
317
+ * Hand-written scene for a loader over a value, loaded and loading.
318
+ */
319
+ const value = {
320
+ about: "loader.value.about",
321
+ draw: Value,
322
+ example: value_example_exports,
323
+ title: "loader.value.title"
324
+ };
325
+ /**
326
+ * Hand-written scene for a loader in a button, loaded and loading.
327
+ */
328
+ const button = {
329
+ about: "loader.button.about",
330
+ draw: Saving,
331
+ example: saving_example_exports,
332
+ title: "loader.button.title"
333
+ };
334
+ var loader_specimen_default = specimen({
335
+ about: "loader.about",
336
+ id: "components/feedback/loader",
337
+ imports: "import { Loader, LoaderOverlay } from \"@stealthscale/component-feedback\";",
338
+ scenes: [
339
+ ...scenesOf(recipe, {
340
+ axes: { scrim: {
341
+ draw: (props) => /* @__PURE__ */ jsx(Room, {
342
+ size: "xs",
343
+ children: /* @__PURE__ */ jsx(Covered, { ...props })
344
+ }),
345
+ example: covered_example_exports
346
+ } },
347
+ draw: (props) => /* @__PURE__ */ jsx(Matching, { ...props }),
348
+ example: matching_example_exports,
349
+ namespace: "loader",
350
+ order: ["palette", "scrim"]
351
+ }),
352
+ placement,
353
+ value,
354
+ button
355
+ ],
356
+ title: "loader.title"
357
+ });
358
+ //#endregion
359
+ export { button, loader_specimen_default as default, placement, value };