@stealthscale/component-collections 0.1.1 → 0.1.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 -5700
- package/dist/pages/data-list/data-list.js +351 -0
- package/dist/pages/data-list/data-list.props.js +3 -0
- package/dist/pages/listbox/listbox.js +1277 -0
- package/dist/pages/listbox/listbox.props.js +3 -0
- package/dist/pages/pages.json +105 -0
- package/dist/pages/sortable/sortable.js +576 -0
- package/dist/pages/sortable/sortable.props.js +3 -0
- package/dist/pages/status-matrix/status-matrix.js +1403 -0
- package/dist/pages/status-matrix/status-matrix.props.js +3 -0
- package/dist/pages/swipe-actions/swipe-actions.js +212 -0
- package/dist/pages/swipe-actions/swipe-actions.props.js +3 -0
- package/dist/pages/table/table.js +1701 -0
- package/dist/pages/table/table.props.js +3 -0
- package/dist/pages/timeline/timeline.js +380 -0
- package/dist/pages/timeline/timeline.props.js +3 -0
- package/dist/pages/transfer/transfer.js +465 -0
- package/dist/pages/transfer/transfer.props.js +3 -0
- package/dist/pages/tree-view/tree-view.js +1059 -0
- package/dist/pages/tree-view/tree-view.props.js +3 -0
- package/dist/shared-DVn824MJ.js +5701 -0
- package/dist/theme.js +23 -13
- package/locales/en/specimen/data-list.json +64 -0
- package/locales/en/specimen/listbox.json +98 -0
- package/locales/en/specimen/sortable.json +65 -0
- package/locales/en/specimen/status-matrix.json +47 -0
- package/locales/en/specimen/swipe-actions.json +32 -0
- package/locales/en/specimen/table.json +94 -0
- package/locales/en/specimen/timeline.json +72 -0
- package/locales/en/specimen/transfer.json +34 -0
- package/locales/en/specimen/tree-view.json +107 -0
- package/package.json +10 -9
- /package/dist/{recipe-C1oaF8pO.js → recipes-C1oaF8pO.js} +0 -0
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { G as Item, H as Root, J as Empty, K as ItemContent, U as List, W as Items, Y as Board$1, q as Handle } from "../../shared-DVn824MJ.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { ButtonPropsProvider, IconButton } from "@stealthscale/component-actions";
|
|
7
|
+
import { Room, specimen, useWords } from "@stealthscale/specimen";
|
|
8
|
+
import { createPortal } from "react-dom";
|
|
9
|
+
import { EllipsisIcon, GripVerticalIcon } from "lucide-react";
|
|
10
|
+
import { Menu } from "@stealthscale/component-disclosure";
|
|
11
|
+
import { Badge } from "@stealthscale/component-data";
|
|
12
|
+
import { Code, Heading, Span, Text } from "@stealthscale/component-typography";
|
|
13
|
+
import { Stack } from "@stealthscale/component-layout";
|
|
14
|
+
//#region src/sortable/examples/board.example.tsx
|
|
15
|
+
var board_example_exports = /* @__PURE__ */ __exportAll({
|
|
16
|
+
Board: () => Board,
|
|
17
|
+
source: () => source$4
|
|
18
|
+
});
|
|
19
|
+
const LISTS = [
|
|
20
|
+
"todo",
|
|
21
|
+
"doing",
|
|
22
|
+
"done"
|
|
23
|
+
];
|
|
24
|
+
const LIMIT = 3;
|
|
25
|
+
const START = {
|
|
26
|
+
doing: [{ id: "api" }, { id: "tests" }],
|
|
27
|
+
done: [],
|
|
28
|
+
todo: [
|
|
29
|
+
{ id: "spec" },
|
|
30
|
+
{ id: "icons" },
|
|
31
|
+
{ id: "copy" }
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
function Board() {
|
|
35
|
+
const $ = c(27);
|
|
36
|
+
const { t } = useWords("sortable");
|
|
37
|
+
const [columns, setColumns] = useState(START);
|
|
38
|
+
const [saved, setSaved] = useState();
|
|
39
|
+
let T0;
|
|
40
|
+
let T1;
|
|
41
|
+
let t0;
|
|
42
|
+
let t1;
|
|
43
|
+
let t2;
|
|
44
|
+
let t3;
|
|
45
|
+
let t4;
|
|
46
|
+
if ($[0] !== columns || $[1] !== saved || $[2] !== t) {
|
|
47
|
+
let t5;
|
|
48
|
+
if ($[10] !== t) {
|
|
49
|
+
t5 = (list) => [list, t(`board.${list}`)];
|
|
50
|
+
$[10] = t;
|
|
51
|
+
$[11] = t5;
|
|
52
|
+
} else t5 = $[11];
|
|
53
|
+
const titles = new Map(LISTS.map(t5));
|
|
54
|
+
T1 = Stack;
|
|
55
|
+
t3 = "md";
|
|
56
|
+
const t6 = LISTS.map((list_0) => /* @__PURE__ */ jsxs(List, {
|
|
57
|
+
label: titles.get(list_0),
|
|
58
|
+
limit: list_0 === "doing" ? LIMIT : void 0,
|
|
59
|
+
value: list_0,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsxs(Stack, {
|
|
62
|
+
align: "baseline",
|
|
63
|
+
direction: "row",
|
|
64
|
+
justify: "between",
|
|
65
|
+
children: [/* @__PURE__ */ jsx(Heading, {
|
|
66
|
+
as: "h3",
|
|
67
|
+
size: "sm",
|
|
68
|
+
children: titles.get(list_0)
|
|
69
|
+
}), /* @__PURE__ */ jsx(Badge, { children: list_0 === "doing" ? t("board.limit", {
|
|
70
|
+
count: columns[list_0].length,
|
|
71
|
+
limit: LIMIT
|
|
72
|
+
}) : columns[list_0].length })]
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx(Items, { children: columns[list_0].map((card_0, index) => /* @__PURE__ */ jsxs(Item, {
|
|
75
|
+
index,
|
|
76
|
+
label: t(`board.cards.${card_0.id}`),
|
|
77
|
+
value: card_0.id,
|
|
78
|
+
children: [/* @__PURE__ */ jsx(Handle, { children: /* @__PURE__ */ jsx(GripVerticalIcon, {}) }), t(`board.cards.${card_0.id}`)]
|
|
79
|
+
}, card_0.id)) }),
|
|
80
|
+
/* @__PURE__ */ jsx(Empty, { children: t("board.empty") })
|
|
81
|
+
]
|
|
82
|
+
}, list_0));
|
|
83
|
+
let t7;
|
|
84
|
+
if ($[12] !== t6) {
|
|
85
|
+
t7 = /* @__PURE__ */ jsx(Board$1, { children: t6 });
|
|
86
|
+
$[12] = t6;
|
|
87
|
+
$[13] = t7;
|
|
88
|
+
} else t7 = $[13];
|
|
89
|
+
if ($[14] !== columns || $[15] !== t7) {
|
|
90
|
+
t4 = /* @__PURE__ */ jsx(Root, {
|
|
91
|
+
canMove: _temp$3,
|
|
92
|
+
items: columns,
|
|
93
|
+
onItemMove: setSaved,
|
|
94
|
+
onItemsChange: setColumns,
|
|
95
|
+
children: t7
|
|
96
|
+
});
|
|
97
|
+
$[14] = columns;
|
|
98
|
+
$[15] = t7;
|
|
99
|
+
$[16] = t4;
|
|
100
|
+
} else t4 = $[16];
|
|
101
|
+
T0 = Text;
|
|
102
|
+
t0 = "output";
|
|
103
|
+
t1 = "sm";
|
|
104
|
+
t2 = saved === void 0 ? t("board.none") : t("board.saved", {
|
|
105
|
+
list: titles.get(saved.to.list ?? ""),
|
|
106
|
+
position: saved.to.index + 1
|
|
107
|
+
});
|
|
108
|
+
$[0] = columns;
|
|
109
|
+
$[1] = saved;
|
|
110
|
+
$[2] = t;
|
|
111
|
+
$[3] = T0;
|
|
112
|
+
$[4] = T1;
|
|
113
|
+
$[5] = t0;
|
|
114
|
+
$[6] = t1;
|
|
115
|
+
$[7] = t2;
|
|
116
|
+
$[8] = t3;
|
|
117
|
+
$[9] = t4;
|
|
118
|
+
} else {
|
|
119
|
+
T0 = $[3];
|
|
120
|
+
T1 = $[4];
|
|
121
|
+
t0 = $[5];
|
|
122
|
+
t1 = $[6];
|
|
123
|
+
t2 = $[7];
|
|
124
|
+
t3 = $[8];
|
|
125
|
+
t4 = $[9];
|
|
126
|
+
}
|
|
127
|
+
let t5;
|
|
128
|
+
if ($[17] !== T0 || $[18] !== t0 || $[19] !== t1 || $[20] !== t2) {
|
|
129
|
+
t5 = /* @__PURE__ */ jsx(T0, {
|
|
130
|
+
as: t0,
|
|
131
|
+
size: t1,
|
|
132
|
+
children: t2
|
|
133
|
+
});
|
|
134
|
+
$[17] = T0;
|
|
135
|
+
$[18] = t0;
|
|
136
|
+
$[19] = t1;
|
|
137
|
+
$[20] = t2;
|
|
138
|
+
$[21] = t5;
|
|
139
|
+
} else t5 = $[21];
|
|
140
|
+
let t6;
|
|
141
|
+
if ($[22] !== T1 || $[23] !== t3 || $[24] !== t4 || $[25] !== t5) {
|
|
142
|
+
t6 = /* @__PURE__ */ jsxs(T1, {
|
|
143
|
+
gap: t3,
|
|
144
|
+
children: [t4, t5]
|
|
145
|
+
});
|
|
146
|
+
$[22] = T1;
|
|
147
|
+
$[23] = t3;
|
|
148
|
+
$[24] = t4;
|
|
149
|
+
$[25] = t5;
|
|
150
|
+
$[26] = t6;
|
|
151
|
+
} else t6 = $[26];
|
|
152
|
+
return t6;
|
|
153
|
+
}
|
|
154
|
+
function _temp$3(card, from, to) {
|
|
155
|
+
return from !== "todo" || to !== "done";
|
|
156
|
+
}
|
|
157
|
+
const source$4 = "import { type ReactElement, useState } from \"react\";\n\nimport { GripVerticalIcon } from \"lucide-react\";\n\nimport { Badge } from \"@stealthscale/component-data\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { Heading, Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sortable } from \"@stealthscale/component-collections\";\n\ntype Card = \"api\" | \"copy\" | \"icons\" | \"spec\" | \"tests\";\n\nconst LISTS = [\"todo\", \"doing\", \"done\"] as const;\n\nconst LIMIT = 3;\n\nconst START: Record<(typeof LISTS)[number], Array<{ id: Card }>> = {\n doing: [{ id: \"api\" }, { id: \"tests\" }],\n done: [],\n todo: [{ id: \"spec\" }, { id: \"icons\" }, { id: \"copy\" }],\n};\n\nexport function Board(): ReactElement {\n const { t } = useWords(\"sortable\");\n const [columns, setColumns] = useState(START);\n const [saved, setSaved] = useState<Sortable.SortableMove>();\n const titles = new Map<string, string>(LISTS.map((list) => [list, t(`board.${list}`)]));\n\n return (\n <Stack gap=\"md\">\n <Sortable.Root\n canMove={(card, from, to) => from !== \"todo\" || to !== \"done\"}\n items={columns}\n onItemMove={setSaved}\n onItemsChange={setColumns}\n >\n <Sortable.Board>\n {LISTS.map((list) => (\n <Sortable.List\n key={list}\n label={titles.get(list)}\n limit={list === \"doing\" ? LIMIT : undefined}\n value={list}\n >\n <Stack align=\"baseline\" direction=\"row\" justify=\"between\">\n <Heading as=\"h3\" size=\"sm\">\n {titles.get(list)}\n </Heading>\n <Badge>\n {list === \"doing\"\n ? t(\"board.limit\", { count: columns[list].length, limit: LIMIT })\n : columns[list].length}\n </Badge>\n </Stack>\n <Sortable.Items>\n {columns[list].map((card, index) => (\n <Sortable.Item\n index={index}\n key={card.id}\n label={t(`board.cards.${card.id}`)}\n value={card.id}\n >\n <Sortable.Handle>\n <GripVerticalIcon />\n </Sortable.Handle>\n {t(`board.cards.${card.id}`)}\n </Sortable.Item>\n ))}\n </Sortable.Items>\n <Sortable.Empty>{t(\"board.empty\")}</Sortable.Empty>\n </Sortable.List>\n ))}\n </Sortable.Board>\n </Sortable.Root>\n <Text as=\"output\" size=\"sm\">\n {saved === undefined\n ? t(\"board.none\")\n : t(\"board.saved\", {\n list: titles.get(saved.to.list ?? \"\"),\n position: saved.to.index + 1,\n })}\n </Text>\n </Stack>\n );\n}\n";
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/sortable/examples/issues.example.tsx
|
|
160
|
+
var issues_example_exports = /* @__PURE__ */ __exportAll({
|
|
161
|
+
Issues: () => Issues,
|
|
162
|
+
source: () => source$3
|
|
163
|
+
});
|
|
164
|
+
const ISSUES = [
|
|
165
|
+
{
|
|
166
|
+
id: "SCL-118",
|
|
167
|
+
priority: "high"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: "SCL-124",
|
|
171
|
+
priority: "medium"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "SCL-131",
|
|
175
|
+
priority: "low"
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "SCL-137",
|
|
179
|
+
priority: "medium"
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
const PALETTES = {
|
|
183
|
+
high: "error",
|
|
184
|
+
low: "neutral",
|
|
185
|
+
medium: "warning"
|
|
186
|
+
};
|
|
187
|
+
function Issues() {
|
|
188
|
+
const $ = c(14);
|
|
189
|
+
const { t } = useWords("sortable");
|
|
190
|
+
let t0;
|
|
191
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
192
|
+
t0 = [...ISSUES];
|
|
193
|
+
$[0] = t0;
|
|
194
|
+
} else t0 = $[0];
|
|
195
|
+
const [issues, setIssues] = useState(t0);
|
|
196
|
+
let t1;
|
|
197
|
+
if ($[1] !== t) {
|
|
198
|
+
t1 = t("issues.label");
|
|
199
|
+
$[1] = t;
|
|
200
|
+
$[2] = t1;
|
|
201
|
+
} else t1 = $[2];
|
|
202
|
+
let t2;
|
|
203
|
+
if ($[3] !== issues || $[4] !== t) {
|
|
204
|
+
let t3;
|
|
205
|
+
if ($[6] !== t) {
|
|
206
|
+
t3 = (issue, index) => /* @__PURE__ */ jsxs(Item, {
|
|
207
|
+
index,
|
|
208
|
+
label: `${issue.id}, ${t(`issues.titles.${issue.id}`)}`,
|
|
209
|
+
value: issue.id,
|
|
210
|
+
children: [
|
|
211
|
+
/* @__PURE__ */ jsx(Handle, { children: /* @__PURE__ */ jsx(GripVerticalIcon, {}) }),
|
|
212
|
+
/* @__PURE__ */ jsxs(ItemContent, { children: [/* @__PURE__ */ jsx(Code, { children: issue.id }), /* @__PURE__ */ jsx(Span, { children: t(`issues.titles.${issue.id}`) })] }),
|
|
213
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
214
|
+
palette: PALETTES[issue.priority],
|
|
215
|
+
children: t(`issues.${issue.priority}`)
|
|
216
|
+
})
|
|
217
|
+
]
|
|
218
|
+
}, issue.id);
|
|
219
|
+
$[6] = t;
|
|
220
|
+
$[7] = t3;
|
|
221
|
+
} else t3 = $[7];
|
|
222
|
+
t2 = issues.map(t3);
|
|
223
|
+
$[3] = issues;
|
|
224
|
+
$[4] = t;
|
|
225
|
+
$[5] = t2;
|
|
226
|
+
} else t2 = $[5];
|
|
227
|
+
let t3;
|
|
228
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
229
|
+
t3 = /* @__PURE__ */ jsx(Items, {
|
|
230
|
+
"aria-label": t1,
|
|
231
|
+
children: t2
|
|
232
|
+
});
|
|
233
|
+
$[8] = t1;
|
|
234
|
+
$[9] = t2;
|
|
235
|
+
$[10] = t3;
|
|
236
|
+
} else t3 = $[10];
|
|
237
|
+
let t4;
|
|
238
|
+
if ($[11] !== issues || $[12] !== t3) {
|
|
239
|
+
t4 = /* @__PURE__ */ jsx(Root, {
|
|
240
|
+
items: issues,
|
|
241
|
+
onItemsChange: setIssues,
|
|
242
|
+
children: t3
|
|
243
|
+
});
|
|
244
|
+
$[11] = issues;
|
|
245
|
+
$[12] = t3;
|
|
246
|
+
$[13] = t4;
|
|
247
|
+
} else t4 = $[13];
|
|
248
|
+
return t4;
|
|
249
|
+
}
|
|
250
|
+
const source$3 = "import { type ReactElement, useState } from \"react\";\n\nimport { GripVerticalIcon } from \"lucide-react\";\n\nimport { Badge } from \"@stealthscale/component-data\";\nimport { Code, Span } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sortable } from \"@stealthscale/component-collections\";\n\nconst ISSUES = [\n { id: \"SCL-118\", priority: \"high\" },\n { id: \"SCL-124\", priority: \"medium\" },\n { id: \"SCL-131\", priority: \"low\" },\n { id: \"SCL-137\", priority: \"medium\" },\n] as const;\n\nconst PALETTES = { high: \"error\", low: \"neutral\", medium: \"warning\" } as const;\n\nexport function Issues(): ReactElement {\n const { t } = useWords(\"sortable\");\n const [issues, setIssues] = useState<Array<(typeof ISSUES)[number]>>([...ISSUES]);\n\n return (\n <Sortable.Root items={issues} onItemsChange={setIssues}>\n <Sortable.Items aria-label={t(\"issues.label\")}>\n {issues.map((issue, index) => (\n <Sortable.Item\n index={index}\n key={issue.id}\n label={`${issue.id}, ${t(`issues.titles.${issue.id}`)}`}\n value={issue.id}\n >\n <Sortable.Handle>\n <GripVerticalIcon />\n </Sortable.Handle>\n <Sortable.ItemContent>\n <Code>{issue.id}</Code>\n <Span>{t(`issues.titles.${issue.id}`)}</Span>\n </Sortable.ItemContent>\n <Badge palette={PALETTES[issue.priority]}>{t(`issues.${issue.priority}`)}</Badge>\n </Sortable.Item>\n ))}\n </Sortable.Items>\n </Sortable.Root>\n );\n}\n";
|
|
251
|
+
//#endregion
|
|
252
|
+
//#region src/sortable/examples/moves.example.tsx
|
|
253
|
+
var moves_example_exports = /* @__PURE__ */ __exportAll({
|
|
254
|
+
Moves: () => Moves,
|
|
255
|
+
source: () => source$2
|
|
256
|
+
});
|
|
257
|
+
const TASKS = [
|
|
258
|
+
"invoices",
|
|
259
|
+
"payroll",
|
|
260
|
+
"audit",
|
|
261
|
+
"taxes"
|
|
262
|
+
];
|
|
263
|
+
const ACTIONS = [
|
|
264
|
+
"first",
|
|
265
|
+
"up",
|
|
266
|
+
"down",
|
|
267
|
+
"last"
|
|
268
|
+
];
|
|
269
|
+
function indexFor(action, index, count) {
|
|
270
|
+
if (action === "first") return 0;
|
|
271
|
+
if (action === "last") return count - 1;
|
|
272
|
+
return action === "up" ? index - 1 : index + 1;
|
|
273
|
+
}
|
|
274
|
+
function Moves() {
|
|
275
|
+
const $ = c(7);
|
|
276
|
+
const { t } = useWords("sortable");
|
|
277
|
+
let t0;
|
|
278
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
279
|
+
t0 = TASKS.map(_temp$2);
|
|
280
|
+
$[0] = t0;
|
|
281
|
+
} else t0 = $[0];
|
|
282
|
+
const [tasks, setTasks] = useState(t0);
|
|
283
|
+
let t1;
|
|
284
|
+
if ($[1] !== t || $[2] !== tasks) {
|
|
285
|
+
t1 = (t2) => {
|
|
286
|
+
const { move } = t2;
|
|
287
|
+
return /* @__PURE__ */ jsx(Items, {
|
|
288
|
+
"aria-label": t("moves.label"),
|
|
289
|
+
children: tasks.map((task, index) => /* @__PURE__ */ jsxs(Item, {
|
|
290
|
+
index,
|
|
291
|
+
label: t(`moves.${task.id}`),
|
|
292
|
+
value: task.id,
|
|
293
|
+
children: [
|
|
294
|
+
/* @__PURE__ */ jsx(Handle, { children: /* @__PURE__ */ jsx(GripVerticalIcon, {}) }),
|
|
295
|
+
/* @__PURE__ */ jsx(ItemContent, { children: t(`moves.${task.id}`) }),
|
|
296
|
+
/* @__PURE__ */ jsxs(Menu.Root, {
|
|
297
|
+
onSelect: (t3) => {
|
|
298
|
+
const { value } = t3;
|
|
299
|
+
move(task.id, { index: indexFor(value, index, tasks.length) });
|
|
300
|
+
},
|
|
301
|
+
children: [/* @__PURE__ */ jsx(ButtonPropsProvider, {
|
|
302
|
+
value: {
|
|
303
|
+
size: "xs",
|
|
304
|
+
variant: "ghost"
|
|
305
|
+
},
|
|
306
|
+
children: /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
307
|
+
"aria-label": t("moves.more", { name: t(`moves.${task.id}`) }),
|
|
308
|
+
as: IconButton,
|
|
309
|
+
children: /* @__PURE__ */ jsx(EllipsisIcon, {})
|
|
310
|
+
})
|
|
311
|
+
}), createPortal(/* @__PURE__ */ jsx(Menu.Positioner, { children: /* @__PURE__ */ jsx(Menu.Content, { children: ACTIONS.map((action) => /* @__PURE__ */ jsx(Menu.Item, {
|
|
312
|
+
disabled: ["first", "up"].includes(action) ? index === 0 : index === tasks.length - 1,
|
|
313
|
+
value: action,
|
|
314
|
+
children: t(`moves.${action}`)
|
|
315
|
+
}, action)) }) }), document.body)]
|
|
316
|
+
})
|
|
317
|
+
]
|
|
318
|
+
}, task.id))
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
$[1] = t;
|
|
322
|
+
$[2] = tasks;
|
|
323
|
+
$[3] = t1;
|
|
324
|
+
} else t1 = $[3];
|
|
325
|
+
let t2;
|
|
326
|
+
if ($[4] !== t1 || $[5] !== tasks) {
|
|
327
|
+
t2 = /* @__PURE__ */ jsx(Root, {
|
|
328
|
+
items: tasks,
|
|
329
|
+
onItemsChange: setTasks,
|
|
330
|
+
children: t1
|
|
331
|
+
});
|
|
332
|
+
$[4] = t1;
|
|
333
|
+
$[5] = tasks;
|
|
334
|
+
$[6] = t2;
|
|
335
|
+
} else t2 = $[6];
|
|
336
|
+
return t2;
|
|
337
|
+
}
|
|
338
|
+
function _temp$2(id) {
|
|
339
|
+
return { id };
|
|
340
|
+
}
|
|
341
|
+
const source$2 = "import { type ReactElement, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\n\nimport { EllipsisIcon, GripVerticalIcon } from \"lucide-react\";\n\nimport { ButtonPropsProvider, IconButton } from \"@stealthscale/component-actions\";\nimport { Menu } from \"@stealthscale/component-disclosure\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sortable } from \"@stealthscale/component-collections\";\n\nconst TASKS = [\"invoices\", \"payroll\", \"audit\", \"taxes\"] as const;\n\nconst ACTIONS = [\"first\", \"up\", \"down\", \"last\"] as const;\n\nfunction indexFor(action: string, index: number, count: number): number {\n if (action === \"first\") return 0;\n\n if (action === \"last\") return count - 1;\n\n return action === \"up\" ? index - 1 : index + 1;\n}\n\nexport function Moves(): ReactElement {\n const { t } = useWords(\"sortable\");\n const [tasks, setTasks] = useState(TASKS.map((id) => ({ id })));\n\n return (\n <Sortable.Root items={tasks} onItemsChange={setTasks}>\n {({ move }) => (\n <Sortable.Items aria-label={t(\"moves.label\")}>\n {tasks.map((task, index) => (\n <Sortable.Item\n index={index}\n key={task.id}\n label={t(`moves.${task.id}`)}\n value={task.id}\n >\n <Sortable.Handle>\n <GripVerticalIcon />\n </Sortable.Handle>\n <Sortable.ItemContent>{t(`moves.${task.id}`)}</Sortable.ItemContent>\n <Menu.Root\n onSelect={({ value }) => {\n move(task.id, { index: indexFor(value, index, tasks.length) });\n }}\n >\n <ButtonPropsProvider value={{ size: \"xs\", variant: \"ghost\" }}>\n <Menu.Trigger\n aria-label={t(\"moves.more\", { name: t(`moves.${task.id}`) })}\n as={IconButton}\n >\n <EllipsisIcon />\n </Menu.Trigger>\n </ButtonPropsProvider>\n {createPortal(\n <Menu.Positioner>\n <Menu.Content>\n {ACTIONS.map((action) => (\n <Menu.Item\n disabled={\n [\"first\", \"up\"].includes(action)\n ? index === 0\n : index === tasks.length - 1\n }\n key={action}\n value={action}\n >\n {t(`moves.${action}`)}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Positioner>,\n document.body,\n )}\n </Menu.Root>\n </Sortable.Item>\n ))}\n </Sortable.Items>\n )}\n </Sortable.Root>\n );\n}\n";
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/sortable/examples/plain.example.tsx
|
|
344
|
+
var plain_example_exports = /* @__PURE__ */ __exportAll({
|
|
345
|
+
Plain: () => Plain,
|
|
346
|
+
source: () => source$1
|
|
347
|
+
});
|
|
348
|
+
const STAGES$1 = [
|
|
349
|
+
"draft",
|
|
350
|
+
"review",
|
|
351
|
+
"legal",
|
|
352
|
+
"publish"
|
|
353
|
+
];
|
|
354
|
+
function Plain() {
|
|
355
|
+
const $ = c(14);
|
|
356
|
+
const { t } = useWords("sortable");
|
|
357
|
+
let t0;
|
|
358
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
359
|
+
t0 = STAGES$1.map(_temp$1);
|
|
360
|
+
$[0] = t0;
|
|
361
|
+
} else t0 = $[0];
|
|
362
|
+
const [stages, setStages] = useState(t0);
|
|
363
|
+
let t1;
|
|
364
|
+
if ($[1] !== t) {
|
|
365
|
+
t1 = t("plain.label");
|
|
366
|
+
$[1] = t;
|
|
367
|
+
$[2] = t1;
|
|
368
|
+
} else t1 = $[2];
|
|
369
|
+
let t2;
|
|
370
|
+
if ($[3] !== stages || $[4] !== t) {
|
|
371
|
+
let t3;
|
|
372
|
+
if ($[6] !== t) {
|
|
373
|
+
t3 = (stage, index) => /* @__PURE__ */ jsxs(Item, {
|
|
374
|
+
index,
|
|
375
|
+
label: t(`stages.${stage.id}`),
|
|
376
|
+
value: stage.id,
|
|
377
|
+
children: [/* @__PURE__ */ jsx(Handle, { children: /* @__PURE__ */ jsx(GripVerticalIcon, {}) }), t(`stages.${stage.id}`)]
|
|
378
|
+
}, stage.id);
|
|
379
|
+
$[6] = t;
|
|
380
|
+
$[7] = t3;
|
|
381
|
+
} else t3 = $[7];
|
|
382
|
+
t2 = stages.map(t3);
|
|
383
|
+
$[3] = stages;
|
|
384
|
+
$[4] = t;
|
|
385
|
+
$[5] = t2;
|
|
386
|
+
} else t2 = $[5];
|
|
387
|
+
let t3;
|
|
388
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
389
|
+
t3 = /* @__PURE__ */ jsx(Items, {
|
|
390
|
+
"aria-label": t1,
|
|
391
|
+
children: t2
|
|
392
|
+
});
|
|
393
|
+
$[8] = t1;
|
|
394
|
+
$[9] = t2;
|
|
395
|
+
$[10] = t3;
|
|
396
|
+
} else t3 = $[10];
|
|
397
|
+
let t4;
|
|
398
|
+
if ($[11] !== stages || $[12] !== t3) {
|
|
399
|
+
t4 = /* @__PURE__ */ jsx(Root, {
|
|
400
|
+
items: stages,
|
|
401
|
+
onItemsChange: setStages,
|
|
402
|
+
variant: "plain",
|
|
403
|
+
children: t3
|
|
404
|
+
});
|
|
405
|
+
$[11] = stages;
|
|
406
|
+
$[12] = t3;
|
|
407
|
+
$[13] = t4;
|
|
408
|
+
} else t4 = $[13];
|
|
409
|
+
return t4;
|
|
410
|
+
}
|
|
411
|
+
function _temp$1(id) {
|
|
412
|
+
return { id };
|
|
413
|
+
}
|
|
414
|
+
const source$1 = "import { type ReactElement, useState } from \"react\";\n\nimport { GripVerticalIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sortable } from \"@stealthscale/component-collections\";\n\nconst STAGES = [\"draft\", \"review\", \"legal\", \"publish\"] as const;\n\nexport function Plain(): ReactElement {\n const { t } = useWords(\"sortable\");\n const [stages, setStages] = useState(STAGES.map((id) => ({ id })));\n\n return (\n <Sortable.Root items={stages} onItemsChange={setStages} variant=\"plain\">\n <Sortable.Items aria-label={t(\"plain.label\")}>\n {stages.map((stage, index) => (\n <Sortable.Item\n index={index}\n key={stage.id}\n label={t(`stages.${stage.id}`)}\n value={stage.id}\n >\n <Sortable.Handle>\n <GripVerticalIcon />\n </Sortable.Handle>\n {t(`stages.${stage.id}`)}\n </Sortable.Item>\n ))}\n </Sortable.Items>\n </Sortable.Root>\n );\n}\n";
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/sortable/examples/stages.example.tsx
|
|
417
|
+
var stages_example_exports = /* @__PURE__ */ __exportAll({
|
|
418
|
+
Stages: () => Stages,
|
|
419
|
+
source: () => source
|
|
420
|
+
});
|
|
421
|
+
const STAGES = [
|
|
422
|
+
"draft",
|
|
423
|
+
"review",
|
|
424
|
+
"legal",
|
|
425
|
+
"publish",
|
|
426
|
+
"archive"
|
|
427
|
+
];
|
|
428
|
+
function Stages() {
|
|
429
|
+
const $ = c(14);
|
|
430
|
+
const { t } = useWords("sortable");
|
|
431
|
+
let t0;
|
|
432
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
433
|
+
t0 = STAGES.map(_temp);
|
|
434
|
+
$[0] = t0;
|
|
435
|
+
} else t0 = $[0];
|
|
436
|
+
const [stages, setStages] = useState(t0);
|
|
437
|
+
let t1;
|
|
438
|
+
if ($[1] !== t) {
|
|
439
|
+
t1 = t("stages.label");
|
|
440
|
+
$[1] = t;
|
|
441
|
+
$[2] = t1;
|
|
442
|
+
} else t1 = $[2];
|
|
443
|
+
let t2;
|
|
444
|
+
if ($[3] !== stages || $[4] !== t) {
|
|
445
|
+
let t3;
|
|
446
|
+
if ($[6] !== t) {
|
|
447
|
+
t3 = (stage, index) => /* @__PURE__ */ jsxs(Item, {
|
|
448
|
+
disabled: stage.id === "archive",
|
|
449
|
+
index,
|
|
450
|
+
label: t(`stages.${stage.id}`),
|
|
451
|
+
value: stage.id,
|
|
452
|
+
children: [/* @__PURE__ */ jsx(Handle, { children: /* @__PURE__ */ jsx(GripVerticalIcon, {}) }), t(`stages.${stage.id}`)]
|
|
453
|
+
}, stage.id);
|
|
454
|
+
$[6] = t;
|
|
455
|
+
$[7] = t3;
|
|
456
|
+
} else t3 = $[7];
|
|
457
|
+
t2 = stages.map(t3);
|
|
458
|
+
$[3] = stages;
|
|
459
|
+
$[4] = t;
|
|
460
|
+
$[5] = t2;
|
|
461
|
+
} else t2 = $[5];
|
|
462
|
+
let t3;
|
|
463
|
+
if ($[8] !== t1 || $[9] !== t2) {
|
|
464
|
+
t3 = /* @__PURE__ */ jsx(Items, {
|
|
465
|
+
"aria-label": t1,
|
|
466
|
+
children: t2
|
|
467
|
+
});
|
|
468
|
+
$[8] = t1;
|
|
469
|
+
$[9] = t2;
|
|
470
|
+
$[10] = t3;
|
|
471
|
+
} else t3 = $[10];
|
|
472
|
+
let t4;
|
|
473
|
+
if ($[11] !== stages || $[12] !== t3) {
|
|
474
|
+
t4 = /* @__PURE__ */ jsx(Root, {
|
|
475
|
+
items: stages,
|
|
476
|
+
onItemsChange: setStages,
|
|
477
|
+
children: t3
|
|
478
|
+
});
|
|
479
|
+
$[11] = stages;
|
|
480
|
+
$[12] = t3;
|
|
481
|
+
$[13] = t4;
|
|
482
|
+
} else t4 = $[13];
|
|
483
|
+
return t4;
|
|
484
|
+
}
|
|
485
|
+
function _temp(id) {
|
|
486
|
+
return { id };
|
|
487
|
+
}
|
|
488
|
+
const source = "import { type ReactElement, useState } from \"react\";\n\nimport { GripVerticalIcon } from \"lucide-react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Sortable } from \"@stealthscale/component-collections\";\n\nconst STAGES = [\"draft\", \"review\", \"legal\", \"publish\", \"archive\"] as const;\n\nexport function Stages(): ReactElement {\n const { t } = useWords(\"sortable\");\n const [stages, setStages] = useState(STAGES.map((id) => ({ id })));\n\n return (\n <Sortable.Root items={stages} onItemsChange={setStages}>\n <Sortable.Items aria-label={t(\"stages.label\")}>\n {stages.map((stage, index) => (\n <Sortable.Item\n disabled={stage.id === \"archive\"}\n index={index}\n key={stage.id}\n label={t(`stages.${stage.id}`)}\n value={stage.id}\n >\n <Sortable.Handle>\n <GripVerticalIcon />\n </Sortable.Handle>\n {t(`stages.${stage.id}`)}\n </Sortable.Item>\n ))}\n </Sortable.Items>\n </Sortable.Root>\n );\n}\n";
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/sortable/sortable.specimen.tsx
|
|
491
|
+
/**
|
|
492
|
+
* Catalogue page for the sortable kit.
|
|
493
|
+
*
|
|
494
|
+
* @remarks
|
|
495
|
+
* Every scene is hand-written: one list with a fixed last stage, the plain rows the `variant`
|
|
496
|
+
* axis offers, rows with content, a board with a limit and a rule, and moves without a drag
|
|
497
|
+
* through a row menu. Every scene renders a component from `examples/` and shows that file as its
|
|
498
|
+
* source. The words are keys under `sortable` in `locales/en/specimen/sortable.json`.
|
|
499
|
+
*/
|
|
500
|
+
/**
|
|
501
|
+
* Hand-written scene for one list with a fixed last stage.
|
|
502
|
+
*/
|
|
503
|
+
const list = {
|
|
504
|
+
about: "sortable.stages.about",
|
|
505
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
506
|
+
size: "sm",
|
|
507
|
+
children: /* @__PURE__ */ jsx(Stages, {})
|
|
508
|
+
}),
|
|
509
|
+
example: stages_example_exports,
|
|
510
|
+
title: "sortable.stages.title"
|
|
511
|
+
};
|
|
512
|
+
/**
|
|
513
|
+
* Hand-written scene for the plain look, rows without a fill or an edge, beside the card rows of
|
|
514
|
+
* the scene before it.
|
|
515
|
+
*/
|
|
516
|
+
const plainRows = {
|
|
517
|
+
about: "sortable.plain.about",
|
|
518
|
+
axes: ["variant"],
|
|
519
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
520
|
+
size: "sm",
|
|
521
|
+
children: /* @__PURE__ */ jsx(Plain, {})
|
|
522
|
+
}),
|
|
523
|
+
example: plain_example_exports,
|
|
524
|
+
title: "sortable.plain.title"
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Hand-written scene for rows whose content fills the row and ends with a badge.
|
|
528
|
+
*/
|
|
529
|
+
const content = {
|
|
530
|
+
about: "sortable.issues.about",
|
|
531
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
532
|
+
size: "md",
|
|
533
|
+
children: /* @__PURE__ */ jsx(Issues, {})
|
|
534
|
+
}),
|
|
535
|
+
example: issues_example_exports,
|
|
536
|
+
title: "sortable.issues.title"
|
|
537
|
+
};
|
|
538
|
+
/**
|
|
539
|
+
* Hand-written scene for a board with a limit on one list and a rule between two.
|
|
540
|
+
*/
|
|
541
|
+
const lists = {
|
|
542
|
+
about: "sortable.board.about",
|
|
543
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
544
|
+
size: "5xl",
|
|
545
|
+
children: /* @__PURE__ */ jsx(Board, {})
|
|
546
|
+
}),
|
|
547
|
+
example: board_example_exports,
|
|
548
|
+
title: "sortable.board.title"
|
|
549
|
+
};
|
|
550
|
+
/**
|
|
551
|
+
* Hand-written scene for moves through a row menu, without a drag.
|
|
552
|
+
*/
|
|
553
|
+
const moving = {
|
|
554
|
+
about: "sortable.moves.about",
|
|
555
|
+
draw: () => /* @__PURE__ */ jsx(Room, {
|
|
556
|
+
size: "sm",
|
|
557
|
+
children: /* @__PURE__ */ jsx(Moves, {})
|
|
558
|
+
}),
|
|
559
|
+
example: moves_example_exports,
|
|
560
|
+
title: "sortable.moves.title"
|
|
561
|
+
};
|
|
562
|
+
var sortable_specimen_default = specimen({
|
|
563
|
+
about: "sortable.about",
|
|
564
|
+
id: "components/collections/sortable",
|
|
565
|
+
imports: "import { Sortable } from \"@stealthscale/component-collections\";",
|
|
566
|
+
scenes: [
|
|
567
|
+
list,
|
|
568
|
+
plainRows,
|
|
569
|
+
content,
|
|
570
|
+
lists,
|
|
571
|
+
moving
|
|
572
|
+
],
|
|
573
|
+
title: "sortable.title"
|
|
574
|
+
});
|
|
575
|
+
//#endregion
|
|
576
|
+
export { content, sortable_specimen_default as default, list, lists, moving, plainRows };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export const dropped = {"BoardProps": {"conditions": 284, "foreign": 1041}, "EmptyProps": {"conditions": 284, "foreign": 1041}, "HandleProps": {"conditions": 284, "foreign": 1050}, "ItemContentProps": {"conditions": 284, "foreign": 1041}, "ItemProps": {"conditions": 284, "foreign": 1041}, "ItemsProps": {"conditions": 284, "foreign": 1041}, "ListProps": {"conditions": 284, "foreign": 1041}, "RootProps": {"conditions": 284, "foreign": 1040}};
|
|
2
|
+
export const parts = {"BoardProps": [], "EmptyProps": [], "HandleProps": [{"accepts": "\"glow\" | \"pulse\"", "fallback": "", "kind": "variant", "name": "effect", "refers": [], "required": false, "says": "The halo around the button, in the palette's solid at half opacity."}, {"accepts": "Lift", "fallback": "", "kind": "variant", "name": "elevation", "refers": ["kit.Lift"], "required": false, "says": ""}, {"accepts": "\"accent\" | \"error\" | \"info\" | \"neutral\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "fallback": "", "kind": "variant", "name": "palette", "refers": [], "required": false, "says": "Palette of every look. The base sets `primary`."}, {"accepts": "Scale", "fallback": "", "kind": "variant", "name": "size", "refers": ["kit.Scale"], "required": false, "says": ""}, {"accepts": "\"ghost\" | \"glass\" | \"outline\" | \"plain\" | \"solid\" | \"subtle\" | \"surface\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": ""}], "ItemContentProps": [], "ItemProps": [{"accepts": "boolean", "fallback": "", "kind": "option", "name": "disabled", "refers": [], "required": false, "says": "Whether the row keeps its place. Off unless stated."}, {"accepts": "number", "fallback": "", "kind": "option", "name": "index", "refers": [], "required": true, "says": "Index of the row in its list."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "label", "refers": [], "required": true, "says": "Name of the row, which names its handle and the announcements."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Id of the row's item."}], "ItemsProps": [], "ListProps": [{"accepts": "string", "fallback": "", "kind": "option", "name": "label", "refers": [], "required": false, "says": "Name of the list, which names its rows and the announcements."}, {"accepts": "number", "fallback": "", "kind": "option", "name": "limit", "refers": [], "required": false, "says": "Most items the list takes from other lists. No limit unless stated."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "value", "refers": [], "required": true, "says": "Id of the list, its key in the items' record."}], "RootProps": [{"accepts": "((at: SortableAnnouncement) => string)", "fallback": "", "kind": "option", "name": "cancelledLabel", "refers": ["kit.SortableAnnouncement"], "required": false, "says": "Writes the announcement of a drag that was cancelled, with the place the item went back to."}, {"accepts": "((item: ItemOf<Items>, from: string, to: string) => boolean)", "fallback": "", "kind": "option", "name": "canMove", "refers": ["kit.ItemOf", "kit.Items"], "required": false, "says": "Returns whether an item may move from the list it was picked up from into another list. Every move is allowed unless stated."}, {"accepts": "((api: SortableApi) => ReactNode) | ReactNode", "fallback": "", "kind": "option", "name": "children", "refers": ["kit.SortableApi", "react.ReactElement", "react.ReactPortal"], "required": false, "says": "Lists and rows of the kit, or a function that renders them from the root's move without a drag."}, {"accepts": "((at: SortableAnnouncement) => string)", "fallback": "", "kind": "option", "name": "droppedLabel", "refers": ["kit.SortableAnnouncement"], "required": false, "says": "Writes the announcement of a drop, with the place the item took."}, {"accepts": "((refused: SortableRefused) => string)", "fallback": "", "kind": "option", "name": "fullLabel", "refers": ["kit.SortableRefused"], "required": false, "says": "Writes the announcement of a list at its limit refusing the item."}, {"accepts": "((item: string) => string)", "fallback": "", "kind": "option", "name": "handleLabel", "refers": [], "required": false, "says": "Writes the name of an item's handle from the item's name."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "instructions", "refers": [], "required": false, "says": "Instructions every handle is described by."}, {"accepts": "Items", "fallback": "", "kind": "option", "name": "items", "refers": ["kit.Items"], "required": true, "says": "Items the lists render, controlled."}, {"accepts": "((at: SortableAnnouncement) => string)", "fallback": "", "kind": "option", "name": "liftedLabel", "refers": ["kit.SortableAnnouncement"], "required": false, "says": "Writes the announcement of an item picked up, with the place it left."}, {"accepts": "((at: SortableAnnouncement) => string)", "fallback": "", "kind": "option", "name": "movedLabel", "refers": ["kit.SortableAnnouncement"], "required": false, "says": "Writes the announcement of an item moved during a drag, with the place it would take."}, {"accepts": "((move: SortableMove) => void)", "fallback": "", "kind": "option", "name": "onItemMove", "refers": ["kit.SortableMove", "kit.SortablePlace"], "required": false, "says": "Called once with each finished move, from the place the item left to the place it took."}, {"accepts": "((items: Items) => void)", "fallback": "", "kind": "option", "name": "onItemsChange", "refers": ["kit.Items"], "required": false, "says": "Called with the items to render after a change."}, {"accepts": "((refused: SortableRefused) => string)", "fallback": "", "kind": "option", "name": "refusedLabel", "refers": ["kit.SortableRefused"], "required": false, "says": "Writes the announcement of the caller's rule refusing the item a list."}, {"accepts": "string", "fallback": "", "kind": "option", "name": "roleDescription", "refers": [], "required": false, "says": "Role description every handle states in place of \"button\"."}, {"accepts": "\"card\" | \"plain\"", "fallback": "", "kind": "variant", "name": "variant", "refers": [], "required": false, "says": "Look of a row: a panel card with a hairline edge, or a plain row without a fill or a visible edge, for rows inside a panel."}]};
|
|
3
|
+
export const shapes = {"kit.Lift": [{"accepts": "", "name": "\"floating\"", "says": ""}, {"accepts": "", "name": "\"raised\"", "says": ""}], "kit.Scale": [{"accepts": "", "name": "\"2xl\"", "says": ""}, {"accepts": "", "name": "\"3xl\"", "says": ""}, {"accepts": "", "name": "\"4xl\"", "says": ""}, {"accepts": "", "name": "\"lg\"", "says": ""}, {"accepts": "", "name": "\"md\"", "says": ""}, {"accepts": "", "name": "\"sm\"", "says": ""}, {"accepts": "", "name": "\"xl\"", "says": ""}, {"accepts": "", "name": "\"xs\"", "says": ""}], "kit.SortableRefused": [{"accepts": "string", "name": "item", "says": "Name of the item."}, {"accepts": "number", "name": "limit", "says": "Most items the list takes, or undefined for a list the caller's rule refuses."}, {"accepts": "string", "name": "list", "says": "Name of the list."}], "kit.SortableAnnouncement": [{"accepts": "number", "name": "count", "says": "Number of items in the list the item is in."}, {"accepts": "string", "name": "item", "says": "Name of the item."}, {"accepts": "string", "name": "list", "says": "Name of the list, or undefined for the one list of an array."}, {"accepts": "number", "name": "position", "says": "Position of the item in the list, from 1."}], "kit.ItemOf": [{"accepts": "string", "name": "id", "says": "Id of the item, unique across every list of the kit and different from every list's id."}], "react.ReactElement": [{"accepts": "string | JSXElementConstructor<any>", "name": "type", "says": ""}, {"accepts": "unknown", "name": "props", "says": ""}, {"accepts": "string | null", "name": "key", "says": ""}], "react.ReactPortal": [{"accepts": "ReactNode", "name": "children", "says": ""}, {"accepts": "string | JSXElementConstructor<any>", "name": "type", "says": ""}, {"accepts": "unknown", "name": "props", "says": ""}, {"accepts": "string | null", "name": "key", "says": ""}], "kit.SortableApi": [{"accepts": "(id: string, to: SortablePlace) => boolean", "name": "move", "says": "Moves an item to a place without a drag, and returns whether its list took it."}], "kit.SortableMove": [{"accepts": "SortablePlace", "name": "from", "says": "Place the item left."}, {"accepts": "string", "name": "id", "says": "Id of the item."}, {"accepts": "SortablePlace", "name": "to", "says": "Place the item took."}], "kit.SortablePlace": [{"accepts": "number", "name": "index", "says": "Index of the item in its list."}, {"accepts": "string", "name": "list", "says": "Id of the list, or undefined for the one list of an array."}]};
|