@stealthscale/component-disclosure 0.2.2 → 0.2.4
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 -5423
- package/dist/pages/accordion/accordion.js +512 -0
- package/dist/pages/accordion/accordion.props.js +3 -0
- package/dist/pages/collapsible/collapsible.js +173 -0
- package/dist/pages/collapsible/collapsible.props.js +3 -0
- package/dist/pages/details/details.js +281 -0
- package/dist/pages/details/details.props.js +3 -0
- package/dist/pages/hover-card/hover-card.js +552 -0
- package/dist/pages/hover-card/hover-card.props.js +3 -0
- package/dist/pages/menu/menu.js +1103 -0
- package/dist/pages/menu/menu.props.js +3 -0
- package/dist/pages/menubar/menubar.js +1181 -0
- package/dist/pages/menubar/menubar.props.js +3 -0
- package/dist/pages/pages.json +138 -0
- package/dist/pages/popover/popover.js +161 -0
- package/dist/pages/popover/popover.props.js +3 -0
- package/dist/pages/steps/steps.js +660 -0
- package/dist/pages/steps/steps.props.js +3 -0
- package/dist/pages/tabs/tabs.js +815 -0
- package/dist/pages/tabs/tabs.props.js +3 -0
- package/dist/pages/toggle-tip/toggle-tip.js +344 -0
- package/dist/pages/toggle-tip/toggle-tip.props.js +3 -0
- package/dist/pages/tooltip/tooltip.js +112 -0
- package/dist/pages/tooltip/tooltip.props.js +3 -0
- package/dist/pages/truncate/truncate.js +235 -0
- package/dist/pages/truncate/truncate.props.js +3 -0
- package/dist/shared-Cfsikh3X.js +5424 -0
- package/dist/theme.js +23 -14
- package/locales/en/specimen/accordion.json +130 -0
- package/locales/en/specimen/collapsible.json +27 -0
- package/locales/en/specimen/details.json +48 -0
- package/locales/en/specimen/hover-card.json +58 -0
- package/locales/en/specimen/menu.json +81 -0
- package/locales/en/specimen/menubar.json +108 -0
- package/locales/en/specimen/popover.json +16 -0
- package/locales/en/specimen/steps.json +86 -0
- package/locales/en/specimen/tabs.json +108 -0
- package/locales/en/specimen/toggle-tip.json +47 -0
- package/locales/en/specimen/tooltip.json +14 -0
- package/locales/en/specimen/truncate.json +31 -0
- package/package.json +10 -9
- /package/dist/{recipe-95yCB2V3.js → recipes-95yCB2V3.js} +0 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { t as Truncate } from "../../shared-Cfsikh3X.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Matrix, Room, specimen, useWords } from "@stealthscale/specimen";
|
|
6
|
+
import { Stack } from "@stealthscale/component-layout";
|
|
7
|
+
import { Code } from "@stealthscale/component-typography";
|
|
8
|
+
import { DataList } from "@stealthscale/component-collections";
|
|
9
|
+
import { Badge } from "@stealthscale/component-data";
|
|
10
|
+
//#region src/truncate/examples/description.example.tsx
|
|
11
|
+
var description_example_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
Description: () => Description,
|
|
13
|
+
source: () => source$3
|
|
14
|
+
});
|
|
15
|
+
function Description(props) {
|
|
16
|
+
const $ = c(5);
|
|
17
|
+
const { t } = useWords("truncate");
|
|
18
|
+
let t0;
|
|
19
|
+
if ($[0] !== t) {
|
|
20
|
+
t0 = t("description.text");
|
|
21
|
+
$[0] = t;
|
|
22
|
+
$[1] = t0;
|
|
23
|
+
} else t0 = $[1];
|
|
24
|
+
let t1;
|
|
25
|
+
if ($[2] !== props || $[3] !== t0) {
|
|
26
|
+
t1 = /* @__PURE__ */ jsx(Truncate, {
|
|
27
|
+
...props,
|
|
28
|
+
children: t0
|
|
29
|
+
});
|
|
30
|
+
$[2] = props;
|
|
31
|
+
$[3] = t0;
|
|
32
|
+
$[4] = t1;
|
|
33
|
+
} else t1 = $[4];
|
|
34
|
+
return t1;
|
|
35
|
+
}
|
|
36
|
+
const source$3 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Truncate, TruncateProps } from \"@stealthscale/component-disclosure\";\n\nexport function Description(props: Omit<TruncateProps, \"children\">): ReactElement {\n const { t } = useWords(\"truncate\");\n\n return <Truncate {...props}>{t(\"description.text\")}</Truncate>;\n}\n";
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/truncate/examples/fits.example.tsx
|
|
39
|
+
var fits_example_exports = /* @__PURE__ */ __exportAll({
|
|
40
|
+
Fits: () => Fits,
|
|
41
|
+
source: () => source$2
|
|
42
|
+
});
|
|
43
|
+
function Fits() {
|
|
44
|
+
const $ = c(4);
|
|
45
|
+
const { t } = useWords("truncate");
|
|
46
|
+
let t0;
|
|
47
|
+
if ($[0] !== t) {
|
|
48
|
+
t0 = t("fits.name");
|
|
49
|
+
$[0] = t;
|
|
50
|
+
$[1] = t0;
|
|
51
|
+
} else t0 = $[1];
|
|
52
|
+
let t1;
|
|
53
|
+
if ($[2] !== t0) {
|
|
54
|
+
t1 = /* @__PURE__ */ jsx(Truncate, {
|
|
55
|
+
focusable: true,
|
|
56
|
+
children: t0
|
|
57
|
+
});
|
|
58
|
+
$[2] = t0;
|
|
59
|
+
$[3] = t1;
|
|
60
|
+
} else t1 = $[3];
|
|
61
|
+
return t1;
|
|
62
|
+
}
|
|
63
|
+
const source$2 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Truncate } from \"@stealthscale/component-disclosure\";\n\nexport function Fits(): ReactElement {\n const { t } = useWords(\"truncate\");\n\n return <Truncate focusable>{t(\"fits.name\")}</Truncate>;\n}\n";
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/truncate/examples/notes.example.tsx
|
|
66
|
+
var notes_example_exports = /* @__PURE__ */ __exportAll({
|
|
67
|
+
Notes: () => Notes,
|
|
68
|
+
source: () => source$1
|
|
69
|
+
});
|
|
70
|
+
const SHIPMENTS = [
|
|
71
|
+
{
|
|
72
|
+
id: "NL-2291",
|
|
73
|
+
key: "held"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "NL-2292",
|
|
77
|
+
key: "delivered"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: "NL-2293",
|
|
81
|
+
key: "rerouted"
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
function Notes() {
|
|
85
|
+
const $ = c(4);
|
|
86
|
+
const { t } = useWords("truncate");
|
|
87
|
+
let t0;
|
|
88
|
+
if ($[0] !== t) {
|
|
89
|
+
t0 = SHIPMENTS.map((t1) => {
|
|
90
|
+
const { id, key } = t1;
|
|
91
|
+
return /* @__PURE__ */ jsxs(DataList.Item, { children: [/* @__PURE__ */ jsx(DataList.ItemLabel, { children: /* @__PURE__ */ jsx(Code, { children: id }) }), /* @__PURE__ */ jsx(DataList.ItemValue, { children: /* @__PURE__ */ jsx(Truncate, {
|
|
92
|
+
focusable: true,
|
|
93
|
+
children: t(`notes.items.${key}`)
|
|
94
|
+
}) })] }, id);
|
|
95
|
+
});
|
|
96
|
+
$[0] = t;
|
|
97
|
+
$[1] = t0;
|
|
98
|
+
} else t0 = $[1];
|
|
99
|
+
let t1;
|
|
100
|
+
if ($[2] !== t0) {
|
|
101
|
+
t1 = /* @__PURE__ */ jsx(DataList.Root, {
|
|
102
|
+
orientation: "horizontal",
|
|
103
|
+
children: t0
|
|
104
|
+
});
|
|
105
|
+
$[2] = t0;
|
|
106
|
+
$[3] = t1;
|
|
107
|
+
} else t1 = $[3];
|
|
108
|
+
return t1;
|
|
109
|
+
}
|
|
110
|
+
const source$1 = "import { type ReactElement } from \"react\";\n\nimport { DataList } from \"@stealthscale/component-collections\";\nimport { Code } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Truncate } from \"@stealthscale/component-disclosure\";\n\nconst SHIPMENTS = [\n { id: \"NL-2291\", key: \"held\" },\n { id: \"NL-2292\", key: \"delivered\" },\n { id: \"NL-2293\", key: \"rerouted\" },\n] as const;\n\nexport function Notes(): ReactElement {\n const { t } = useWords(\"truncate\");\n\n return (\n <DataList.Root orientation=\"horizontal\">\n {SHIPMENTS.map(({ id, key }) => (\n <DataList.Item key={id}>\n <DataList.ItemLabel>\n <Code>{id}</Code>\n </DataList.ItemLabel>\n <DataList.ItemValue>\n <Truncate focusable>{t(`notes.items.${key}`)}</Truncate>\n </DataList.ItemValue>\n </DataList.Item>\n ))}\n </DataList.Root>\n );\n}\n";
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/truncate/examples/shipment.example.tsx
|
|
113
|
+
var shipment_example_exports = /* @__PURE__ */ __exportAll({
|
|
114
|
+
Shipment: () => Shipment,
|
|
115
|
+
source: () => source
|
|
116
|
+
});
|
|
117
|
+
function Shipment() {
|
|
118
|
+
const $ = c(11);
|
|
119
|
+
const { t } = useWords("truncate");
|
|
120
|
+
let t0;
|
|
121
|
+
if ($[0] !== t) {
|
|
122
|
+
t0 = t("shipment.note");
|
|
123
|
+
$[0] = t;
|
|
124
|
+
$[1] = t0;
|
|
125
|
+
} else t0 = $[1];
|
|
126
|
+
let t1;
|
|
127
|
+
if ($[2] !== t0) {
|
|
128
|
+
t1 = /* @__PURE__ */ jsx(Truncate, { children: t0 });
|
|
129
|
+
$[2] = t0;
|
|
130
|
+
$[3] = t1;
|
|
131
|
+
} else t1 = $[3];
|
|
132
|
+
let t2;
|
|
133
|
+
if ($[4] !== t) {
|
|
134
|
+
t2 = t("shipment.status");
|
|
135
|
+
$[4] = t;
|
|
136
|
+
$[5] = t2;
|
|
137
|
+
} else t2 = $[5];
|
|
138
|
+
let t3;
|
|
139
|
+
if ($[6] !== t2) {
|
|
140
|
+
t3 = /* @__PURE__ */ jsx(Badge, {
|
|
141
|
+
palette: "warning",
|
|
142
|
+
children: t2
|
|
143
|
+
});
|
|
144
|
+
$[6] = t2;
|
|
145
|
+
$[7] = t3;
|
|
146
|
+
} else t3 = $[7];
|
|
147
|
+
let t4;
|
|
148
|
+
if ($[8] !== t1 || $[9] !== t3) {
|
|
149
|
+
t4 = /* @__PURE__ */ jsxs(Stack, {
|
|
150
|
+
align: "baseline",
|
|
151
|
+
direction: "row",
|
|
152
|
+
gap: "md",
|
|
153
|
+
children: [t1, t3]
|
|
154
|
+
});
|
|
155
|
+
$[8] = t1;
|
|
156
|
+
$[9] = t3;
|
|
157
|
+
$[10] = t4;
|
|
158
|
+
} else t4 = $[10];
|
|
159
|
+
return t4;
|
|
160
|
+
}
|
|
161
|
+
const source = "import { type ReactElement } from \"react\";\n\nimport { Badge } from \"@stealthscale/component-data\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Truncate } from \"@stealthscale/component-disclosure\";\n\nexport function Shipment(): ReactElement {\n const { t } = useWords(\"truncate\");\n\n return (\n <Stack align=\"baseline\" direction=\"row\" gap=\"md\">\n <Truncate>{t(\"shipment.note\")}</Truncate>\n <Badge palette=\"warning\">{t(\"shipment.status\")}</Badge>\n </Stack>\n );\n}\n";
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region src/truncate/truncate.specimen.tsx
|
|
164
|
+
/**
|
|
165
|
+
* Line counts of the lines scene.
|
|
166
|
+
*/
|
|
167
|
+
const LINES = [
|
|
168
|
+
1,
|
|
169
|
+
2,
|
|
170
|
+
3
|
|
171
|
+
];
|
|
172
|
+
/**
|
|
173
|
+
* Hand-written scene for clipped text beside a badge on a row.
|
|
174
|
+
*/
|
|
175
|
+
const beside = {
|
|
176
|
+
about: "truncate.shipment.about",
|
|
177
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
178
|
+
size: "sm",
|
|
179
|
+
children: /* @__PURE__ */ jsx(Shipment, {})
|
|
180
|
+
}),
|
|
181
|
+
example: shipment_example_exports,
|
|
182
|
+
title: "truncate.shipment.title"
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Hand-written scene for one description at three line counts.
|
|
186
|
+
*/
|
|
187
|
+
const kept = {
|
|
188
|
+
about: "truncate.lines.about",
|
|
189
|
+
draw: () => /* @__PURE__ */ jsx(Matrix, {
|
|
190
|
+
knob: "lines",
|
|
191
|
+
of: LINES,
|
|
192
|
+
children: (lines) => /* @__PURE__ */ jsx(Room, {
|
|
193
|
+
size: "xs",
|
|
194
|
+
children: /* @__PURE__ */ jsx(Description, { lines })
|
|
195
|
+
})
|
|
196
|
+
}),
|
|
197
|
+
example: description_example_exports,
|
|
198
|
+
props: { lines: 1 },
|
|
199
|
+
title: "truncate.lines.title"
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Hand-written scene for clipped notes that take keyboard focus.
|
|
203
|
+
*/
|
|
204
|
+
const reached = {
|
|
205
|
+
about: "truncate.notes.about",
|
|
206
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
207
|
+
size: "sm",
|
|
208
|
+
children: /* @__PURE__ */ jsx(Notes, {})
|
|
209
|
+
}),
|
|
210
|
+
example: notes_example_exports,
|
|
211
|
+
title: "truncate.notes.title"
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Hand-written scene for text that fits.
|
|
215
|
+
*/
|
|
216
|
+
const fitted = {
|
|
217
|
+
about: "truncate.fits.about",
|
|
218
|
+
draw: Fits,
|
|
219
|
+
example: fits_example_exports,
|
|
220
|
+
title: "truncate.fits.title"
|
|
221
|
+
};
|
|
222
|
+
var truncate_specimen_default = specimen({
|
|
223
|
+
about: "truncate.about",
|
|
224
|
+
id: "components/disclosure/truncate",
|
|
225
|
+
imports: "import { Truncate } from \"@stealthscale/component-disclosure\";",
|
|
226
|
+
scenes: [
|
|
227
|
+
beside,
|
|
228
|
+
kept,
|
|
229
|
+
reached,
|
|
230
|
+
fitted
|
|
231
|
+
],
|
|
232
|
+
title: "truncate.title"
|
|
233
|
+
});
|
|
234
|
+
//#endregion
|
|
235
|
+
export { beside, truncate_specimen_default as default, fitted, kept, reached };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"TruncateProps": {"conditions": 284, "foreign": 1039}};
|
|
2
|
+
export const parts = {"TruncateProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "children", "refers": [], "required": true, "says": "Whole text, as a string."}, {"accepts": "boolean", "fallback": "", "kind": "option", "name": "focusable", "refers": [], "required": false, "says": "Whether the text takes a tab stop while it is clipped, false unless stated."}, {"accepts": "number", "fallback": "", "kind": "option", "name": "lines", "refers": [], "required": false, "says": "Lines the text keeps, 1 unless stated."}]};
|
|
3
|
+
export const shapes = {};
|