@bysages/solid 0.2.3 → 0.3.0
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/README.md +16 -2
- package/dist/{ai-response-B_586r27.mjs → ai-response-ClGGptX3.mjs} +15 -15
- package/dist/chevron-D5RzcayK.mjs +9 -0
- package/dist/components/affix/index.mjs +15 -17
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +12 -10
- package/dist/components/ai-action/index.mjs +2 -2
- package/dist/components/ai-attachments/index.mjs +50 -38
- package/dist/components/ai-message/index.mjs +11 -13
- package/dist/components/ai-prompt-input/index.mjs +70 -53
- package/dist/components/ai-reasoning/index.mjs +10 -6
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.mjs +23 -23
- package/dist/components/ai-suggestion/index.mjs +1 -1
- package/dist/components/ai-tool/index.mjs +29 -17
- package/dist/components/alert/index.mjs +37 -42
- package/dist/components/angle-slider/index.mjs +2 -2
- package/dist/components/aspect-ratio/index.mjs +14 -16
- package/dist/components/autocomplete/index.mjs +3 -2
- package/dist/components/avatar/index.d.mts +3 -0
- package/dist/components/avatar/index.mjs +10 -5
- package/dist/components/avatar-group/index.mjs +11 -13
- package/dist/components/back-top/index.mjs +31 -27
- package/dist/components/badge/index.mjs +14 -16
- package/dist/components/banner/index.mjs +24 -28
- package/dist/components/bento/index.d.mts +24 -0
- package/dist/components/bento/index.mjs +51 -0
- package/dist/components/block-ui/index.d.mts +12 -0
- package/dist/components/block-ui/index.mjs +43 -0
- package/dist/components/breadcrumb/index.mjs +7 -5
- package/dist/components/browser/index.d.mts +21 -0
- package/dist/components/browser/index.mjs +87 -0
- package/dist/components/button/index.mjs +27 -29
- package/dist/components/button-group/index.mjs +18 -20
- package/dist/components/calendar/index.mjs +141 -129
- package/dist/components/card/index.mjs +2 -2
- package/dist/components/cascade-select/index.mjs +160 -121
- package/dist/components/checkbox/index.mjs +2 -2
- package/dist/components/checkbox-group/index.mjs +53 -55
- package/dist/components/chip/index.mjs +22 -20
- package/dist/components/clipboard/index.mjs +2 -2
- package/dist/components/color-picker/index.mjs +2 -2
- package/dist/components/combobox/index.mjs +2 -2
- package/dist/components/command/index.mjs +73 -57
- package/dist/components/comment/index.mjs +77 -62
- package/dist/components/config-provider/index.mjs +10 -8
- package/dist/components/container/index.mjs +14 -16
- package/dist/components/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +110 -0
- package/dist/components/date-input/index.mjs +2 -2
- package/dist/components/date-picker/index.mjs +2 -2
- package/dist/components/deferred-content/index.d.mts +16 -0
- package/dist/components/deferred-content/index.mjs +52 -0
- package/dist/components/descriptions/index.d.mts +9 -1
- package/dist/components/descriptions/index.mjs +43 -16
- package/dist/components/dock/index.d.mts +22 -0
- package/dist/components/dock/index.mjs +64 -0
- package/dist/components/dynamic-input/index.mjs +71 -68
- package/dist/components/editable/index.mjs +2 -2
- package/dist/components/ellipsis/index.mjs +17 -19
- package/dist/components/empty/index.mjs +2 -2
- package/dist/components/file-upload/index.mjs +2 -2
- package/dist/components/float-button/index.mjs +39 -38
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +52 -37
- package/dist/components/grid/index.mjs +19 -21
- package/dist/components/icon/index.d.mts +9 -4
- package/dist/components/icon/index.mjs +37 -36
- package/dist/components/image/index.mjs +44 -43
- package/dist/components/image-viewer/index.mjs +46 -37
- package/dist/components/input/index.d.mts +3 -0
- package/dist/components/input/index.mjs +1 -41
- package/dist/components/input-group/index.mjs +14 -18
- package/dist/components/kbd/index.mjs +8 -10
- package/dist/components/layout/index.mjs +77 -77
- package/dist/components/link/index.mjs +12 -13
- package/dist/components/list/index.mjs +52 -47
- package/dist/components/listbox/index.mjs +2 -2
- package/dist/components/masonry/index.mjs +15 -17
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.mjs +2 -2
- package/dist/components/menubar/index.mjs +58 -57
- package/dist/components/meter/index.mjs +41 -41
- package/dist/components/number-input/index.mjs +2 -2
- package/dist/components/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +160 -0
- package/dist/components/page-header/index.mjs +2 -2
- package/dist/components/pagination/index.mjs +2 -2
- package/dist/components/password-input/index.mjs +2 -2
- package/dist/components/pin-input/index.mjs +2 -2
- package/dist/components/popconfirm/index.mjs +19 -12
- package/dist/components/progress/index.mjs +2 -2
- package/dist/components/progress-group/index.mjs +65 -58
- package/dist/components/radio-group/index.mjs +2 -2
- package/dist/components/rating-group/index.mjs +2 -2
- package/dist/components/result/index.d.mts +22 -0
- package/dist/components/result/index.mjs +66 -0
- package/dist/components/select/index.d.mts +2 -17
- package/dist/components/select/index.mjs +2 -18
- package/dist/components/separator/index.mjs +17 -19
- package/dist/components/skeleton/index.mjs +8 -10
- package/dist/components/slider/index.mjs +2 -2
- package/dist/components/spinner/index.mjs +15 -17
- package/dist/components/split-button/index.mjs +84 -83
- package/dist/components/spotlight/index.d.mts +11 -0
- package/dist/components/spotlight/index.mjs +38 -0
- package/dist/components/stack/index.mjs +20 -22
- package/dist/components/stat/index.mjs +12 -14
- package/dist/components/steps/index.mjs +2 -2
- package/dist/components/switch/index.mjs +2 -2
- package/dist/components/table/index.mjs +308 -211
- package/dist/components/tabs/index.d.mts +2 -0
- package/dist/components/tabs/index.mjs +10 -5
- package/dist/components/tags-input/index.mjs +2 -2
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +84 -0
- package/dist/components/textarea/index.mjs +8 -8
- package/dist/components/timeline/index.d.mts +9 -3
- package/dist/components/timeline/index.mjs +18 -3
- package/dist/components/toggle-group/index.mjs +2 -2
- package/dist/components/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +46 -0
- package/dist/components/transfer/index.mjs +116 -107
- package/dist/components/tree-select/index.mjs +29 -21
- package/dist/components/tree-view/index.mjs +2 -2
- package/dist/components/typography/index.mjs +2 -2
- package/dist/components/user/index.d.mts +19 -0
- package/dist/components/user/index.mjs +68 -0
- package/dist/components/virtual-list/index.d.mts +17 -0
- package/dist/components/virtual-list/index.mjs +71 -0
- package/dist/components/watermark/index.mjs +19 -13
- package/dist/{index-B4XS2n2y.d.mts → index-IfofF-SW.d.mts} +718 -3773
- package/dist/index-YPUiqD3n.d.mts +42 -0
- package/dist/index.d.mts +16 -3
- package/dist/index.mjs +20 -7
- package/dist/input-DoFQ7RXh.mjs +78 -0
- package/dist/{mentions-xbI6vJAP.mjs → mentions-f5Js_2W7.mjs} +76 -70
- package/dist/select-CHaXbzLX.mjs +115 -0
- package/package.json +28 -7
- package/dist/chevron-GWEoEYdO.mjs +0 -9
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import {
|
|
2
|
+
import { createComponent, insert, mergeProps, spread, template } from "@solidjs/web";
|
|
3
3
|
import { For, Show, createEffect, createSignal, splitProps } from "solid-js";
|
|
4
4
|
import { useListCollection } from "@ark-ui/solid/collection";
|
|
5
5
|
import { Combobox } from "@ark-ui/solid/combobox";
|
|
6
|
+
import { Portal } from "solid-js/web";
|
|
6
7
|
import { Dialog } from "@ark-ui/solid/dialog";
|
|
7
8
|
//#region src/components/command/index.tsx
|
|
8
|
-
var _tmpl$ =
|
|
9
|
-
var _tmpl$2 =
|
|
10
|
-
var _tmpl$3 =
|
|
11
|
-
var _tmpl$4 =
|
|
12
|
-
var _tmpl$5 =
|
|
9
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span data-scope=command data-part=item-hint>`);
|
|
10
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div><!><!>`);
|
|
11
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span>`);
|
|
12
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div>`);
|
|
13
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<input>`);
|
|
14
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div data-scope=command data-part=empty>`);
|
|
13
15
|
/** A command row: the machine's item grafted onto a vessel of our own,
|
|
14
16
|
* the label riding the machine's item text. */
|
|
15
17
|
function Row(props) {
|
|
@@ -19,29 +21,35 @@ function Row(props) {
|
|
|
19
21
|
},
|
|
20
22
|
asChild: (itemProps) => (() => {
|
|
21
23
|
var _el$ = _tmpl$2();
|
|
22
|
-
|
|
24
|
+
var _el$2 = _el$.firstChild;
|
|
25
|
+
var _el$4 = _el$2.nextSibling;
|
|
26
|
+
spread(_el$, [itemProps, {
|
|
23
27
|
"data-scope": "command",
|
|
24
28
|
"data-part": "item"
|
|
25
|
-
}
|
|
29
|
+
}], true);
|
|
26
30
|
insert(_el$, createComponent(Combobox.ItemText, { asChild: (textProps) => (() => {
|
|
27
|
-
var _el$
|
|
28
|
-
spread(_el$
|
|
31
|
+
var _el$5 = _tmpl$3();
|
|
32
|
+
spread(_el$5, [textProps, {
|
|
29
33
|
"data-scope": "command",
|
|
30
34
|
"data-part": "item-label"
|
|
31
|
-
}
|
|
32
|
-
insert(_el$
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
}], true);
|
|
36
|
+
insert(_el$5, () => {
|
|
37
|
+
return props.entry.label;
|
|
38
|
+
});
|
|
39
|
+
return _el$5;
|
|
40
|
+
})() }), _el$2);
|
|
35
41
|
insert(_el$, createComponent(Show, {
|
|
36
42
|
get when() {
|
|
37
43
|
return props.entry.hint;
|
|
38
44
|
},
|
|
39
45
|
get children() {
|
|
40
|
-
var _el$
|
|
41
|
-
insert(_el$
|
|
42
|
-
|
|
46
|
+
var _el$3 = _tmpl$();
|
|
47
|
+
insert(_el$3, () => {
|
|
48
|
+
return props.entry.hint;
|
|
49
|
+
});
|
|
50
|
+
return _el$3;
|
|
43
51
|
}
|
|
44
|
-
}),
|
|
52
|
+
}), _el$4);
|
|
45
53
|
return _el$;
|
|
46
54
|
})()
|
|
47
55
|
});
|
|
@@ -115,18 +123,18 @@ function Command(props) {
|
|
|
115
123
|
get children() {
|
|
116
124
|
return createComponent(Portal, { get children() {
|
|
117
125
|
return [createComponent(Dialog.Backdrop, {}), createComponent(Dialog.Positioner, { asChild: (positionerProps) => (() => {
|
|
118
|
-
var _el$
|
|
119
|
-
spread(_el$
|
|
126
|
+
var _el$6 = _tmpl$4();
|
|
127
|
+
spread(_el$6, [positionerProps, {
|
|
120
128
|
"data-scope": "command",
|
|
121
129
|
"data-part": "positioner"
|
|
122
|
-
}
|
|
123
|
-
insert(_el$
|
|
124
|
-
var _el$
|
|
125
|
-
spread(_el$
|
|
130
|
+
}], true);
|
|
131
|
+
insert(_el$6, createComponent(Dialog.Content, { asChild: (contentProps) => (() => {
|
|
132
|
+
var _el$7 = _tmpl$4();
|
|
133
|
+
spread(_el$7, [contentProps, {
|
|
126
134
|
"data-scope": "command",
|
|
127
135
|
"data-part": "content"
|
|
128
|
-
}
|
|
129
|
-
insert(_el$
|
|
136
|
+
}], true);
|
|
137
|
+
insert(_el$7, createComponent(Combobox.Root, {
|
|
130
138
|
get collection() {
|
|
131
139
|
return collection();
|
|
132
140
|
},
|
|
@@ -152,23 +160,25 @@ function Command(props) {
|
|
|
152
160
|
},
|
|
153
161
|
get children() {
|
|
154
162
|
return [createComponent(Combobox.Input, { asChild: (inputProps) => (() => {
|
|
155
|
-
var _el$
|
|
156
|
-
spread(_el$
|
|
157
|
-
|
|
163
|
+
var _el$8 = _tmpl$5();
|
|
164
|
+
spread(_el$8, [inputProps, {
|
|
165
|
+
type: "text",
|
|
158
166
|
get placeholder() {
|
|
159
167
|
return own.placeholder;
|
|
160
168
|
},
|
|
161
169
|
"data-scope": "command",
|
|
162
170
|
"data-part": "input"
|
|
163
|
-
}
|
|
164
|
-
return _el$
|
|
171
|
+
}], false);
|
|
172
|
+
return _el$8;
|
|
165
173
|
})() }), createComponent(Combobox.Content, { asChild: (listProps) => (() => {
|
|
166
|
-
var _el$
|
|
167
|
-
|
|
174
|
+
var _el$9 = _tmpl$2();
|
|
175
|
+
var _el$10 = _el$9.firstChild;
|
|
176
|
+
var _el$12 = _el$10.nextSibling;
|
|
177
|
+
spread(_el$9, [listProps, {
|
|
168
178
|
"data-scope": "command",
|
|
169
179
|
"data-part": "list"
|
|
170
|
-
}
|
|
171
|
-
insert(_el$
|
|
180
|
+
}], true);
|
|
181
|
+
insert(_el$9, createComponent(For, {
|
|
172
182
|
get each() {
|
|
173
183
|
return sections();
|
|
174
184
|
},
|
|
@@ -186,48 +196,54 @@ function Command(props) {
|
|
|
186
196
|
},
|
|
187
197
|
get children() {
|
|
188
198
|
return createComponent(Combobox.ItemGroup, { asChild: (groupProps) => (() => {
|
|
189
|
-
var _el$
|
|
190
|
-
|
|
199
|
+
var _el$13 = _tmpl$2();
|
|
200
|
+
var _el$14 = _el$13.firstChild;
|
|
201
|
+
var _el$15 = _el$14.nextSibling;
|
|
202
|
+
spread(_el$13, [groupProps, {
|
|
191
203
|
"data-scope": "command",
|
|
192
204
|
"data-part": "group"
|
|
193
|
-
}
|
|
194
|
-
insert(_el$
|
|
195
|
-
var _el$
|
|
196
|
-
spread(_el$
|
|
205
|
+
}], true);
|
|
206
|
+
insert(_el$13, createComponent(Combobox.ItemGroupLabel, { asChild: (labelProps) => (() => {
|
|
207
|
+
var _el$16 = _tmpl$4();
|
|
208
|
+
spread(_el$16, [labelProps, {
|
|
197
209
|
"data-scope": "command",
|
|
198
210
|
"data-part": "group-label"
|
|
199
|
-
}
|
|
200
|
-
insert(_el$
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
}], true);
|
|
212
|
+
insert(_el$16, () => {
|
|
213
|
+
return section.group;
|
|
214
|
+
});
|
|
215
|
+
return _el$16;
|
|
216
|
+
})() }), _el$14);
|
|
217
|
+
insert(_el$13, createComponent(For, {
|
|
204
218
|
get each() {
|
|
205
219
|
return section.entries;
|
|
206
220
|
},
|
|
207
221
|
children: (entry) => createComponent(Row, { entry })
|
|
208
|
-
}),
|
|
209
|
-
return _el$
|
|
222
|
+
}), _el$15);
|
|
223
|
+
return _el$13;
|
|
210
224
|
})() });
|
|
211
225
|
}
|
|
212
226
|
})
|
|
213
|
-
}),
|
|
214
|
-
insert(_el$
|
|
227
|
+
}), _el$10);
|
|
228
|
+
insert(_el$9, createComponent(Show, {
|
|
215
229
|
get when() {
|
|
216
230
|
return sections().length === 0;
|
|
217
231
|
},
|
|
218
232
|
get children() {
|
|
219
|
-
var _el$
|
|
220
|
-
insert(_el$
|
|
221
|
-
|
|
233
|
+
var _el$11 = _tmpl$6();
|
|
234
|
+
insert(_el$11, () => {
|
|
235
|
+
return own.emptyText ?? "No matching commands";
|
|
236
|
+
});
|
|
237
|
+
return _el$11;
|
|
222
238
|
}
|
|
223
|
-
}),
|
|
224
|
-
return _el$
|
|
239
|
+
}), _el$12);
|
|
240
|
+
return _el$9;
|
|
225
241
|
})() })];
|
|
226
242
|
}
|
|
227
243
|
}));
|
|
228
|
-
return _el$
|
|
244
|
+
return _el$7;
|
|
229
245
|
})() }));
|
|
230
|
-
return _el$
|
|
246
|
+
return _el$6;
|
|
231
247
|
})() })];
|
|
232
248
|
} });
|
|
233
249
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, effect, insert,
|
|
2
|
+
import { createComponent, effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
3
3
|
import { Show, splitProps } from "solid-js";
|
|
4
4
|
//#region src/components/comment/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
6
|
-
var _tmpl$2 =
|
|
7
|
-
var _tmpl$3 =
|
|
8
|
-
var _tmpl$4 =
|
|
9
|
-
var _tmpl$5 =
|
|
10
|
-
var _tmpl$6 =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div data-scope=comment data-part=avatar>`);
|
|
6
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span data-scope=comment data-part=author>`);
|
|
7
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<time data-scope=comment data-part=datetime>`);
|
|
8
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<header data-scope=comment data-part=header><!><!>`);
|
|
9
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<div data-scope=comment data-part=actions>`);
|
|
10
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<article><div data-scope=comment data-part=body><div data-scope=comment data-part=content></div><!>`);
|
|
11
11
|
/**
|
|
12
12
|
* A voice on the record: the portrait hangs left (the `avatar` prop),
|
|
13
13
|
* the body carries the byline from `author` and `datetime`, the ink is
|
|
@@ -22,65 +22,80 @@ function Comment(props) {
|
|
|
22
22
|
"actions",
|
|
23
23
|
"children"
|
|
24
24
|
]);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
var _el$ = _tmpl$6();
|
|
26
|
+
var _el$3 = _el$.firstChild;
|
|
27
|
+
var _el$9 = _el$3.firstChild;
|
|
28
|
+
var _el$11 = _el$9.nextSibling;
|
|
29
|
+
spread(_el$, [rest, {
|
|
30
|
+
"data-scope": "comment",
|
|
31
|
+
"data-part": "root"
|
|
32
|
+
}], true);
|
|
33
|
+
insert(_el$, createComponent(Show, {
|
|
34
|
+
get when() {
|
|
35
|
+
return own.avatar;
|
|
36
|
+
},
|
|
37
|
+
get children() {
|
|
38
|
+
var _el$2 = _tmpl$();
|
|
39
|
+
insert(_el$2, () => {
|
|
33
40
|
return own.avatar;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
});
|
|
42
|
+
return _el$2;
|
|
43
|
+
}
|
|
44
|
+
}), _el$3);
|
|
45
|
+
insert(_el$3, createComponent(Show, {
|
|
46
|
+
get when() {
|
|
47
|
+
return own.author || own.datetime;
|
|
48
|
+
},
|
|
49
|
+
get children() {
|
|
50
|
+
var _el$4 = _tmpl$4();
|
|
51
|
+
var _el$6 = _el$4.firstChild;
|
|
52
|
+
var _el$8 = _el$6.nextSibling;
|
|
53
|
+
insert(_el$4, createComponent(Show, {
|
|
54
|
+
get when() {
|
|
55
|
+
return own.author;
|
|
56
|
+
},
|
|
57
|
+
get children() {
|
|
58
|
+
var _el$5 = _tmpl$2();
|
|
59
|
+
insert(_el$5, () => {
|
|
49
60
|
return own.author;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
});
|
|
62
|
+
return _el$5;
|
|
63
|
+
}
|
|
64
|
+
}), _el$6);
|
|
65
|
+
insert(_el$4, createComponent(Show, {
|
|
66
|
+
get when() {
|
|
67
|
+
return own.datetime;
|
|
68
|
+
},
|
|
69
|
+
get children() {
|
|
70
|
+
var _el$7 = _tmpl$3();
|
|
71
|
+
insert(_el$7, () => {
|
|
59
72
|
return own.datetime;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
});
|
|
74
|
+
effect(() => own.datetime, (_v$) => {
|
|
75
|
+
setAttribute(_el$7, "datetime", _v$);
|
|
76
|
+
});
|
|
77
|
+
return _el$7;
|
|
78
|
+
}
|
|
79
|
+
}), _el$8);
|
|
80
|
+
return _el$4;
|
|
81
|
+
}
|
|
82
|
+
}), _el$9);
|
|
83
|
+
insert(_el$9, () => {
|
|
84
|
+
return own.children;
|
|
85
|
+
});
|
|
86
|
+
insert(_el$3, createComponent(Show, {
|
|
87
|
+
get when() {
|
|
88
|
+
return own.actions;
|
|
89
|
+
},
|
|
90
|
+
get children() {
|
|
91
|
+
var _el$10 = _tmpl$5();
|
|
92
|
+
insert(_el$10, () => {
|
|
74
93
|
return own.actions;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
}), null);
|
|
82
|
-
return _el$;
|
|
83
|
-
})();
|
|
94
|
+
});
|
|
95
|
+
return _el$10;
|
|
96
|
+
}
|
|
97
|
+
}), _el$11);
|
|
98
|
+
return _el$;
|
|
84
99
|
}
|
|
85
100
|
//#endregion
|
|
86
101
|
export { Comment };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createComponent, insert,
|
|
1
|
+
import { createComponent, insert, spread, template } from "@solidjs/web";
|
|
2
2
|
import { createContext, splitProps, useContext } from "solid-js";
|
|
3
3
|
//#region src/components/config-provider/index.tsx
|
|
4
|
-
var _tmpl$ =
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
5
5
|
/** Solid context for the provider's snapshot — a custom part reads it
|
|
6
6
|
* with `useContext(ConfigContextKey)`. */
|
|
7
7
|
const ConfigContextKey = createContext(() => ({}));
|
|
@@ -37,16 +37,16 @@ function ConfigProvider(props) {
|
|
|
37
37
|
}),
|
|
38
38
|
get children() {
|
|
39
39
|
var _el$ = _tmpl$();
|
|
40
|
-
spread(_el$,
|
|
40
|
+
spread(_el$, [rest, {
|
|
41
41
|
"data-scope": "config-provider",
|
|
42
42
|
"data-part": "root",
|
|
43
|
-
get
|
|
43
|
+
get "data-density"() {
|
|
44
44
|
return own.density;
|
|
45
45
|
},
|
|
46
|
-
get
|
|
46
|
+
get "data-scene"() {
|
|
47
47
|
return own.scene;
|
|
48
48
|
},
|
|
49
|
-
get
|
|
49
|
+
get "data-accent"() {
|
|
50
50
|
return own.accent;
|
|
51
51
|
},
|
|
52
52
|
get dir() {
|
|
@@ -55,8 +55,10 @@ function ConfigProvider(props) {
|
|
|
55
55
|
get lang() {
|
|
56
56
|
return own.locale;
|
|
57
57
|
}
|
|
58
|
-
}
|
|
59
|
-
insert(_el$, () =>
|
|
58
|
+
}], true);
|
|
59
|
+
insert(_el$, () => {
|
|
60
|
+
return own.children;
|
|
61
|
+
});
|
|
60
62
|
return _el$;
|
|
61
63
|
}
|
|
62
64
|
});
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import {
|
|
2
|
+
import { spread, template } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
4
|
//#region src/components/container/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
6
6
|
function Container(props) {
|
|
7
7
|
injectComponentStyle("container");
|
|
8
8
|
const [own, rest] = splitProps(props, ["size", "padding"]);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return _el$;
|
|
22
|
-
})();
|
|
9
|
+
var _el$ = _tmpl$();
|
|
10
|
+
spread(_el$, [rest, {
|
|
11
|
+
"data-scope": "container",
|
|
12
|
+
"data-part": "root",
|
|
13
|
+
get "data-size"() {
|
|
14
|
+
return own.size ?? "readable";
|
|
15
|
+
},
|
|
16
|
+
get "data-padding"() {
|
|
17
|
+
return own.padding === false ? void 0 : "";
|
|
18
|
+
}
|
|
19
|
+
}], false);
|
|
20
|
+
return _el$;
|
|
23
21
|
}
|
|
24
22
|
//#endregion
|
|
25
23
|
export { Container };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/data-view/index.d.ts
|
|
3
|
+
export interface DataViewProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
items: unknown[];
|
|
5
|
+
/** Ledger rows or a lattice of cards. */
|
|
6
|
+
layout?: "list" | "grid";
|
|
7
|
+
/** Records per page; leave unset to show everything at once. */
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
/** Renders one record; the view lays the returned nodes out. */
|
|
10
|
+
renderItem?: (item: unknown, index: number) => JSX.Element;
|
|
11
|
+
header?: JSX.Element;
|
|
12
|
+
}
|
|
13
|
+
/** One vessel, two layouts: the caller renders each record through
|
|
14
|
+
* renderItem, the view lays the records out as a ledger or a lattice
|
|
15
|
+
* and — when a page size is given — pages them with the pagination
|
|
16
|
+
* family's own parts rather than a second implementation. */
|
|
17
|
+
export declare function DataView(props: DataViewProps): JSX.Element;
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Pagination } from "../pagination/index.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { createComponent, effect, insert, memo, setAttribute, spread, template } from "@solidjs/web";
|
|
4
|
+
import { For, Show, createSignal, createUniqueId, splitProps } from "solid-js";
|
|
5
|
+
//#region src/components/data-view/index.tsx
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div data-scope=data-view data-part=pager>`);
|
|
7
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div><div data-scope=data-view data-part=content></div><!>`);
|
|
8
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=data-view data-part=cell>`);
|
|
9
|
+
/** One vessel, two layouts: the caller renders each record through
|
|
10
|
+
* renderItem, the view lays the records out as a ledger or a lattice
|
|
11
|
+
* and — when a page size is given — pages them with the pagination
|
|
12
|
+
* family's own parts rather than a second implementation. */
|
|
13
|
+
function DataView(props) {
|
|
14
|
+
injectComponentStyle("data-view");
|
|
15
|
+
const uid = createUniqueId();
|
|
16
|
+
const [own, rest] = splitProps(props, [
|
|
17
|
+
"items",
|
|
18
|
+
"layout",
|
|
19
|
+
"pageSize",
|
|
20
|
+
"renderItem",
|
|
21
|
+
"header"
|
|
22
|
+
]);
|
|
23
|
+
const [page, setPage] = createSignal(1);
|
|
24
|
+
const pageCount = () => own.pageSize ? Math.max(1, Math.ceil(own.items.length / own.pageSize)) : 1;
|
|
25
|
+
const visible = () => own.pageSize ? own.items.slice((page() - 1) * own.pageSize, page() * own.pageSize) : own.items;
|
|
26
|
+
var _el$ = _tmpl$2();
|
|
27
|
+
var _el$2 = _el$.firstChild;
|
|
28
|
+
var _el$4 = _el$2.nextSibling;
|
|
29
|
+
spread(_el$, [rest, {
|
|
30
|
+
"data-scope": "data-view",
|
|
31
|
+
"data-part": "root",
|
|
32
|
+
"data-uid": uid
|
|
33
|
+
}], true);
|
|
34
|
+
insert(_el$, () => {
|
|
35
|
+
return own.header;
|
|
36
|
+
}, _el$2);
|
|
37
|
+
insert(_el$2, createComponent(For, {
|
|
38
|
+
get each() {
|
|
39
|
+
return visible();
|
|
40
|
+
},
|
|
41
|
+
children: (item, index) => (() => {
|
|
42
|
+
var _el$5 = _tmpl$3();
|
|
43
|
+
insert(_el$5, () => {
|
|
44
|
+
return own.renderItem?.(item, index());
|
|
45
|
+
});
|
|
46
|
+
return _el$5;
|
|
47
|
+
})()
|
|
48
|
+
}));
|
|
49
|
+
insert(_el$, createComponent(Show, {
|
|
50
|
+
get when() {
|
|
51
|
+
return memo(() => {
|
|
52
|
+
return !!own.pageSize;
|
|
53
|
+
})() ? pageCount() > 1 : own.pageSize;
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
var _el$3 = _tmpl$();
|
|
57
|
+
insert(_el$3, createComponent(Pagination.Root, {
|
|
58
|
+
get count() {
|
|
59
|
+
return own.items.length;
|
|
60
|
+
},
|
|
61
|
+
get pageSize() {
|
|
62
|
+
return own.pageSize;
|
|
63
|
+
},
|
|
64
|
+
get page() {
|
|
65
|
+
return page();
|
|
66
|
+
},
|
|
67
|
+
siblingCount: 1,
|
|
68
|
+
onPageChange: (details) => setPage(details.page),
|
|
69
|
+
get children() {
|
|
70
|
+
return [
|
|
71
|
+
createComponent(Pagination.PrevTrigger, {
|
|
72
|
+
"aria-label": "Previous page",
|
|
73
|
+
children: "‹"
|
|
74
|
+
}),
|
|
75
|
+
createComponent(Pagination.Context, { children: (pagination) => createComponent(For, {
|
|
76
|
+
get each() {
|
|
77
|
+
return pagination().pages;
|
|
78
|
+
},
|
|
79
|
+
children: (entry, index) => entry.type === "ellipsis" ? createComponent(Pagination.Ellipsis, {
|
|
80
|
+
get index() {
|
|
81
|
+
return index();
|
|
82
|
+
},
|
|
83
|
+
children: "…"
|
|
84
|
+
}) : createComponent(Pagination.Item, {
|
|
85
|
+
type: "page",
|
|
86
|
+
get value() {
|
|
87
|
+
return entry.value;
|
|
88
|
+
},
|
|
89
|
+
get children() {
|
|
90
|
+
return entry.value;
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}) }),
|
|
94
|
+
createComponent(Pagination.NextTrigger, {
|
|
95
|
+
"aria-label": "Next page",
|
|
96
|
+
children: "›"
|
|
97
|
+
})
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
}));
|
|
101
|
+
return _el$3;
|
|
102
|
+
}
|
|
103
|
+
}), _el$4);
|
|
104
|
+
effect(() => own.layout ?? "list", (_v$) => {
|
|
105
|
+
setAttribute(_el$2, "data-layout", _v$);
|
|
106
|
+
});
|
|
107
|
+
return _el$;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { DataView };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
4
|
import { DateInput as DateInput$1 } from "@ark-ui/solid/date-input";
|
|
5
5
|
//#region src/components/date-input/index.tsx
|
|
6
6
|
function DateInputRoot(props) {
|
|
7
7
|
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
-
return createComponent(DateInput$1.Root, mergeProps(rest, { get
|
|
8
|
+
return createComponent(DateInput$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
9
|
return own.size ?? "md";
|
|
10
10
|
} }));
|
|
11
11
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
4
|
import { DatePicker as DatePicker$1 } from "@ark-ui/solid/date-picker";
|
|
5
5
|
//#region src/components/date-picker/index.tsx
|
|
6
6
|
function DatePickerRoot(props) {
|
|
7
7
|
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
-
return createComponent(DatePicker$1.Root, mergeProps(rest, { get
|
|
8
|
+
return createComponent(DatePicker$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
9
|
return own.size ?? "md";
|
|
10
10
|
} }));
|
|
11
11
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/deferred-content/index.d.ts
|
|
3
|
+
export interface DeferredContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** How much of the placeholder must be visible before the content
|
|
5
|
+
* mounts, from 0 (any pixel) to 1 (the whole box). */
|
|
6
|
+
threshold?: number;
|
|
7
|
+
/** Drawn until the box approaches the viewport. */
|
|
8
|
+
placeholder?: JSX.Element;
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
/** Content that waits to be worth rendering: the slot stays off the
|
|
12
|
+
* tree until the placeholder scrolls near the viewport, then mounts
|
|
13
|
+
* once and stays. The placeholder is drawn by the caller, so the late
|
|
14
|
+
* arrival costs no layout shift it cannot predict. */
|
|
15
|
+
export declare function DeferredContent(props: DeferredContentProps): JSX.Element;
|
|
16
|
+
//#endregion
|