@bysages/solid 0.2.3 → 0.3.1
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-slzE03wh.mjs} +19 -17
- 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 +21 -22
- package/dist/components/ai-action/index.mjs +2 -2
- package/dist/components/ai-attachments/index.mjs +52 -38
- package/dist/components/ai-message/index.mjs +11 -13
- package/dist/components/ai-prompt-input/index.mjs +81 -55
- 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 +8 -3
- 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 +26 -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 +12 -10
- 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 +167 -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 +83 -59
- package/dist/components/comment/index.mjs +77 -62
- package/dist/components/config-provider/index.d.mts +4 -1
- package/dist/components/config-provider/index.mjs +13 -9
- 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 +116 -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 +75 -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.d.mts +7 -1
- package/dist/components/file-upload/index.mjs +13 -3
- package/dist/components/float-button/index.mjs +42 -39
- 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.d.mts +4 -0
- package/dist/components/image/index.mjs +50 -43
- package/dist/components/image-viewer/index.d.mts +4 -0
- package/dist/components/image-viewer/index.mjs +54 -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/json-tree-view/index.d.mts +5 -2
- package/dist/components/json-tree-view/index.mjs +25 -2
- package/dist/components/kbd/index.mjs +8 -10
- package/dist/components/layout/index.mjs +81 -77
- package/dist/components/link/index.mjs +12 -13
- package/dist/components/list/index.d.mts +2 -1
- package/dist/components/list/index.mjs +62 -48
- 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 +59 -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 +168 -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 +17 -17
- package/dist/components/split-button/index.mjs +88 -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.d.mts +6 -1
- package/dist/components/steps/index.mjs +9 -3
- package/dist/components/switch/index.mjs +2 -2
- package/dist/components/table/index.mjs +323 -214
- 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 +86 -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/toc/index.d.mts +2 -7
- package/dist/components/toc/index.mjs +1 -9
- 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 +126 -107
- package/dist/components/tree-select/index.mjs +36 -25
- package/dist/components/tree-view/index.d.mts +8 -1
- package/dist/components/tree-view/index.mjs +29 -3
- 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 +72 -0
- package/dist/components/watermark/index.mjs +19 -13
- package/dist/index-DdsnfV4f.d.mts +16 -0
- 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 +17 -4
- package/dist/index.mjs +22 -9
- package/dist/input-DoFQ7RXh.mjs +78 -0
- package/dist/{mentions-xbI6vJAP.mjs → mentions-f5Js_2W7.mjs} +76 -70
- package/dist/select-CX6OuQlU.mjs +123 -0
- package/dist/toc-CZmYEaQR.mjs +21 -0
- package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
- package/package.json +28 -7
- package/dist/chevron-GWEoEYdO.mjs +0 -9
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
2
|
+
import { t as Input } from "../../input-DoFQ7RXh.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
-
import {
|
|
4
|
+
import { createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
4
5
|
import { For, Show, createMemo, createSignal, splitProps } from "solid-js";
|
|
6
|
+
import { Portal } from "solid-js/web";
|
|
5
7
|
import { useFilter } from "@ark-ui/solid/locale";
|
|
6
8
|
import { Popover } from "@ark-ui/solid/popover";
|
|
7
9
|
import { TreeView, createTreeCollection } from "@ark-ui/solid/tree-view";
|
|
8
10
|
//#region src/components/tree-select/index.tsx
|
|
9
|
-
var _tmpl$ =
|
|
10
|
-
var _tmpl$2 =
|
|
11
|
-
var _tmpl$3 =
|
|
12
|
-
var _tmpl$4 =
|
|
13
|
-
var _tmpl$5 =
|
|
14
|
-
var _tmpl$6 =
|
|
11
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
|
|
12
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span>`);
|
|
13
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=tree-select data-part=search>`);
|
|
14
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=tree-select data-part=body>`);
|
|
15
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<button><span data-part=chevron aria-hidden=true>`);
|
|
16
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<p data-scope=tree-select data-part=empty>Nothing matches`);
|
|
15
17
|
function chevron() {
|
|
16
18
|
return _tmpl$();
|
|
17
19
|
}
|
|
@@ -23,6 +25,7 @@ function chevron() {
|
|
|
23
25
|
* matches keep their ancestors and the branches fan open.
|
|
24
26
|
*/
|
|
25
27
|
function TreeSelect(props) {
|
|
28
|
+
const messages = useComponentMessages();
|
|
26
29
|
injectComponentStyle("tree-select");
|
|
27
30
|
injectComponentStyle("tree-view");
|
|
28
31
|
const [own, rest] = splitProps(props, [
|
|
@@ -96,10 +99,7 @@ function TreeSelect(props) {
|
|
|
96
99
|
get fallback() {
|
|
97
100
|
return createComponent(TreeView.Item, { asChild: (propsFn) => (() => {
|
|
98
101
|
var _el$2 = _tmpl$2();
|
|
99
|
-
spread(_el$2,
|
|
100
|
-
display: "flex",
|
|
101
|
-
"inline-size": "100%"
|
|
102
|
-
} }), false, true);
|
|
102
|
+
spread(_el$2, propsFn, true);
|
|
103
103
|
insert(_el$2, createComponent(TreeView.ItemText, { get children() {
|
|
104
104
|
return rowProps.node.label;
|
|
105
105
|
} }));
|
|
@@ -147,25 +147,28 @@ function TreeSelect(props) {
|
|
|
147
147
|
},
|
|
148
148
|
get children() {
|
|
149
149
|
return [createComponent(Popover.Trigger, { asChild: (propsFn) => (() => {
|
|
150
|
-
var _el$5 = _tmpl$5()
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
var _el$5 = _tmpl$5();
|
|
151
|
+
var _el$6 = _el$5.firstChild;
|
|
152
|
+
spread(_el$5, [propsFn, {
|
|
153
|
+
type: "button",
|
|
153
154
|
"data-scope": "tree-select",
|
|
154
155
|
"data-part": "control",
|
|
155
|
-
get
|
|
156
|
+
get "data-size"() {
|
|
156
157
|
return own.size ?? "md";
|
|
157
158
|
},
|
|
158
|
-
get
|
|
159
|
+
get "data-open"() {
|
|
159
160
|
return open() ? "" : void 0;
|
|
160
161
|
},
|
|
161
|
-
get
|
|
162
|
+
get "data-placeholder"() {
|
|
162
163
|
return label() == null ? "" : void 0;
|
|
163
164
|
},
|
|
164
165
|
get disabled() {
|
|
165
166
|
return own.disabled;
|
|
166
167
|
}
|
|
167
|
-
}
|
|
168
|
-
insert(_el$5, () =>
|
|
168
|
+
}], true);
|
|
169
|
+
insert(_el$5, () => {
|
|
170
|
+
return label() ?? own.placeholder ?? "Select…";
|
|
171
|
+
}, _el$6);
|
|
169
172
|
insert(_el$6, chevron);
|
|
170
173
|
return _el$5;
|
|
171
174
|
})() }), createComponent(Portal, { get children() {
|
|
@@ -173,7 +176,7 @@ function TreeSelect(props) {
|
|
|
173
176
|
return createComponent(Popover.Content, {
|
|
174
177
|
"data-scope": "tree-select",
|
|
175
178
|
"data-part": "content",
|
|
176
|
-
get
|
|
179
|
+
get "data-size"() {
|
|
177
180
|
return own.size ?? "md";
|
|
178
181
|
},
|
|
179
182
|
get children() {
|
|
@@ -189,8 +192,12 @@ function TreeSelect(props) {
|
|
|
189
192
|
return query();
|
|
190
193
|
},
|
|
191
194
|
onValueChange: setQuery,
|
|
192
|
-
placeholder
|
|
193
|
-
|
|
195
|
+
get placeholder() {
|
|
196
|
+
return messages().select.filter;
|
|
197
|
+
},
|
|
198
|
+
get "aria-label"() {
|
|
199
|
+
return messages().select.filter;
|
|
200
|
+
}
|
|
194
201
|
}));
|
|
195
202
|
return _el$3;
|
|
196
203
|
}
|
|
@@ -210,9 +217,13 @@ function TreeSelect(props) {
|
|
|
210
217
|
},
|
|
211
218
|
selectionMode: "single",
|
|
212
219
|
get selectedValue() {
|
|
213
|
-
return memo(() =>
|
|
220
|
+
return memo(() => {
|
|
221
|
+
return !!own.value;
|
|
222
|
+
})() ? [own.value] : [];
|
|
214
223
|
}
|
|
215
|
-
}, () =>
|
|
224
|
+
}, () => {
|
|
225
|
+
return filtering() ? { expandedValue: expandedWhileFiltering() } : { defaultExpandedValue: firstLevel() };
|
|
226
|
+
}, {
|
|
216
227
|
onSelectionChange: pick,
|
|
217
228
|
get children() {
|
|
218
229
|
return createComponent(TreeView.Tree, { get children() {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
1
2
|
import { TreeNode, TreeView as TreeView$1, TreeViewRootProps } from "@ark-ui/solid/tree-view";
|
|
2
3
|
//#region src/components/tree-view/index.d.ts
|
|
3
4
|
/** Ark's TreeView, dressed in the paper-and-ink system: quiet rows where
|
|
@@ -12,7 +13,13 @@ type TreeViewOwnProps = {
|
|
|
12
13
|
size?: "sm" | "md" | "lg";
|
|
13
14
|
};
|
|
14
15
|
declare function TreeViewRoot<T extends TreeNode>(props: TreeViewRootProps<T> & TreeViewOwnProps): import("solid-js").JSX.Element;
|
|
15
|
-
|
|
16
|
+
/** The node checkbox rides inside the branch control; the branch
|
|
17
|
+
* itself answers the keyboard, so the checkbox stays visual only. */
|
|
18
|
+
declare function TreeViewNodeCheckbox(props: ComponentProps<typeof TreeView$1.NodeCheckbox>): import("solid-js").JSX.Element;
|
|
19
|
+
declare function TreeViewBranchIndicator(props: ComponentProps<typeof TreeView$1.BranchIndicator>): import("solid-js").JSX.Element;
|
|
20
|
+
export declare const TreeView: Omit<typeof TreeView$1, "Root" | "NodeCheckbox" | "BranchIndicator"> & {
|
|
16
21
|
Root: typeof TreeViewRoot;
|
|
22
|
+
NodeCheckbox: typeof TreeViewNodeCheckbox;
|
|
23
|
+
BranchIndicator: typeof TreeViewBranchIndicator;
|
|
17
24
|
};
|
|
18
25
|
//#endregion
|
|
@@ -1,18 +1,44 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "
|
|
2
|
+
import { createComponent, effect, mergeProps, setAttribute, template } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
|
+
import { chevron_right } from "@bysages/icons";
|
|
4
5
|
import { TreeView as TreeView$1 } from "@ark-ui/solid/tree-view";
|
|
5
6
|
//#region src/components/tree-view/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg aria-hidden=true>`);
|
|
6
8
|
const ArkRoot = TreeView$1.Root;
|
|
7
9
|
function TreeViewRoot(props) {
|
|
8
10
|
const [own, rest] = splitProps(props, ["size"]);
|
|
9
|
-
return createComponent(ArkRoot, mergeProps(rest, { get
|
|
11
|
+
return createComponent(ArkRoot, mergeProps(rest, { get "data-size"() {
|
|
10
12
|
return own.size ?? "md";
|
|
11
13
|
} }));
|
|
12
14
|
}
|
|
15
|
+
/** The node checkbox rides inside the branch control; the branch
|
|
16
|
+
* itself answers the keyboard, so the checkbox stays visual only. */
|
|
17
|
+
function TreeViewNodeCheckbox(props) {
|
|
18
|
+
return createComponent(TreeView$1.NodeCheckbox, mergeProps(props, { "aria-hidden": "true" }));
|
|
19
|
+
}
|
|
20
|
+
function TreeViewBranchIndicator(props) {
|
|
21
|
+
return createComponent(TreeView$1.BranchIndicator, mergeProps(props, { get children() {
|
|
22
|
+
return props.children ?? (() => {
|
|
23
|
+
var _el$ = _tmpl$();
|
|
24
|
+
effect(() => {
|
|
25
|
+
return {
|
|
26
|
+
e: `0 0 ${chevron_right.width} ${chevron_right.height}`,
|
|
27
|
+
t: chevron_right.body
|
|
28
|
+
};
|
|
29
|
+
}, ({ e, t }, _p$) => {
|
|
30
|
+
e !== _p$?.e && setAttribute(_el$, "viewBox", e);
|
|
31
|
+
t !== _p$?.t && (_el$.innerHTML = t);
|
|
32
|
+
});
|
|
33
|
+
return _el$;
|
|
34
|
+
})();
|
|
35
|
+
} }));
|
|
36
|
+
}
|
|
13
37
|
const TreeView = {
|
|
14
38
|
...TreeView$1,
|
|
15
|
-
Root: TreeViewRoot
|
|
39
|
+
Root: TreeViewRoot,
|
|
40
|
+
NodeCheckbox: TreeViewNodeCheckbox,
|
|
41
|
+
BranchIndicator: TreeViewBranchIndicator
|
|
16
42
|
};
|
|
17
43
|
injectComponentStyle("tree-view");
|
|
18
44
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
3
|
//#region src/components/typography/index.tsx
|
|
4
4
|
/** The typographic voices, named so prose can ask for one: display and
|
|
5
5
|
* heading ride the song-serif, the rest ride the hei. Nothing here is
|
|
@@ -8,7 +8,7 @@ function part(name, tag) {
|
|
|
8
8
|
function Component(props) {
|
|
9
9
|
return createComponent(tag, mergeProps(props, {
|
|
10
10
|
"data-scope": "typography",
|
|
11
|
-
get
|
|
11
|
+
get "data-part"() {
|
|
12
12
|
return name.toLowerCase();
|
|
13
13
|
}
|
|
14
14
|
}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/user/index.d.ts
|
|
3
|
+
export interface UserProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The person's name — the loud line. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The quiet echo beneath the name: a role, a title, an address. */
|
|
7
|
+
description?: string;
|
|
8
|
+
/** Seal diameter: one rung of the Avatar's own ladder. */
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
src?: string;
|
|
11
|
+
shape?: "circle" | "square";
|
|
12
|
+
children?: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
/** A person on one line: the seal before the words, the name and its
|
|
15
|
+
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
16
|
+
* renders it here, so every size and shape the Avatar knows the user
|
|
17
|
+
* inherits; this row only lays the words out beside it. */
|
|
18
|
+
export declare function User(props: UserProps): JSX.Element;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, insert, memo, spread, template } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { Avatar } from "@ark-ui/solid/avatar";
|
|
5
|
+
//#region src/components/user/index.tsx
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><div data-scope=user data-part=meta><span data-scope=user data-part=name></span><!><!>`);
|
|
7
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span data-scope=user data-part=description>`);
|
|
8
|
+
/** A person on one line: the seal before the words, the name and its
|
|
9
|
+
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
10
|
+
* renders it here, so every size and shape the Avatar knows the user
|
|
11
|
+
* inherits; this row only lays the words out beside it. */
|
|
12
|
+
function User(props) {
|
|
13
|
+
injectComponentStyle("user");
|
|
14
|
+
const [own, rest] = splitProps(props, [
|
|
15
|
+
"name",
|
|
16
|
+
"description",
|
|
17
|
+
"size",
|
|
18
|
+
"src",
|
|
19
|
+
"shape",
|
|
20
|
+
"children"
|
|
21
|
+
]);
|
|
22
|
+
const initials = () => own.name.split(/\s+/).filter(Boolean).slice(0, 2).map((word) => word[0]?.toUpperCase() ?? "").join("");
|
|
23
|
+
var _el$ = _tmpl$();
|
|
24
|
+
var _el$2 = _el$.firstChild;
|
|
25
|
+
var _el$3 = _el$2.firstChild;
|
|
26
|
+
var _el$4 = _el$3.nextSibling;
|
|
27
|
+
var _el$5 = _el$4.nextSibling;
|
|
28
|
+
spread(_el$, [rest, {
|
|
29
|
+
"data-scope": "user",
|
|
30
|
+
"data-part": "root"
|
|
31
|
+
}], true);
|
|
32
|
+
insert(_el$, createComponent(Avatar.Root, {
|
|
33
|
+
get "data-size"() {
|
|
34
|
+
return own.size;
|
|
35
|
+
},
|
|
36
|
+
get "data-shape"() {
|
|
37
|
+
return own.shape ?? "circle";
|
|
38
|
+
},
|
|
39
|
+
get children() {
|
|
40
|
+
return createComponent(Avatar.Fallback, { get children() {
|
|
41
|
+
return initials();
|
|
42
|
+
} });
|
|
43
|
+
}
|
|
44
|
+
}), _el$2);
|
|
45
|
+
insert(_el$3, () => {
|
|
46
|
+
return own.name;
|
|
47
|
+
});
|
|
48
|
+
insert(_el$2, (() => {
|
|
49
|
+
var _c$ = memo(() => {
|
|
50
|
+
return !!own.description;
|
|
51
|
+
});
|
|
52
|
+
return () => {
|
|
53
|
+
return _c$() ? (() => {
|
|
54
|
+
var _el$6 = _tmpl$2();
|
|
55
|
+
insert(_el$6, () => {
|
|
56
|
+
return own.description;
|
|
57
|
+
});
|
|
58
|
+
return _el$6;
|
|
59
|
+
})() : null;
|
|
60
|
+
};
|
|
61
|
+
})(), _el$4);
|
|
62
|
+
insert(_el$2, () => {
|
|
63
|
+
return own.children;
|
|
64
|
+
}, _el$5);
|
|
65
|
+
return _el$;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { User };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/virtual-list/index.d.ts
|
|
3
|
+
export interface VirtualListProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
items: unknown[];
|
|
5
|
+
/** The height every row occupies — fixed rows keep it simple. */
|
|
6
|
+
itemHeight?: number;
|
|
7
|
+
/** The viewport height the ledger scrolls within. */
|
|
8
|
+
height?: number | string;
|
|
9
|
+
/** Renders one record into its positioned row. */
|
|
10
|
+
renderItem?: (item: unknown, index: number) => JSX.Element;
|
|
11
|
+
}
|
|
12
|
+
/** A ledger that only mounts the rows on stage: the viewport keeps its
|
|
13
|
+
* scroll length by a spacer sized from the row height, the rows
|
|
14
|
+
* themselves are positioned against it — a ten-thousand-row list
|
|
15
|
+
* costs the DOM a window, not the ledger. */
|
|
16
|
+
export declare function VirtualList(props: VirtualListProps): JSX.Element;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, effect, insert, ref, setStyleProperty, spread, template } from "@solidjs/web";
|
|
3
|
+
import { For, createSignal, splitProps } from "solid-js";
|
|
4
|
+
import { createVirtualizer } from "@tanstack/solid-virtual";
|
|
5
|
+
//#region src/components/virtual-list/index.tsx
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><div data-scope=virtual-list data-part=inner style=position:relative>`);
|
|
7
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=virtual-list data-part=row style=position:absolute;top:0;inset-inline-start:0;inline-size:100%>`);
|
|
8
|
+
/** A ledger that only mounts the rows on stage: the viewport keeps its
|
|
9
|
+
* scroll length by a spacer sized from the row height, the rows
|
|
10
|
+
* themselves are positioned against it — a ten-thousand-row list
|
|
11
|
+
* costs the DOM a window, not the ledger. */
|
|
12
|
+
function VirtualList(props) {
|
|
13
|
+
injectComponentStyle("virtual-list");
|
|
14
|
+
const [own, rest] = splitProps(props, [
|
|
15
|
+
"items",
|
|
16
|
+
"itemHeight",
|
|
17
|
+
"height",
|
|
18
|
+
"renderItem",
|
|
19
|
+
"style"
|
|
20
|
+
]);
|
|
21
|
+
const restStyle = own.style;
|
|
22
|
+
const [viewport, setViewport] = createSignal(null);
|
|
23
|
+
const virtualizer = createVirtualizer({
|
|
24
|
+
count: own.items.length,
|
|
25
|
+
getScrollElement: () => viewport(),
|
|
26
|
+
estimateSize: () => own.itemHeight ?? 40,
|
|
27
|
+
overscan: 6
|
|
28
|
+
});
|
|
29
|
+
var _el$ = _tmpl$();
|
|
30
|
+
var _el$2 = _el$.firstChild;
|
|
31
|
+
ref(() => {
|
|
32
|
+
return setViewport;
|
|
33
|
+
}, _el$);
|
|
34
|
+
spread(_el$, [rest, {
|
|
35
|
+
tabindex: 0,
|
|
36
|
+
"data-scope": "virtual-list",
|
|
37
|
+
"data-part": "root",
|
|
38
|
+
get style() {
|
|
39
|
+
return {
|
|
40
|
+
...typeof restStyle === "object" && restStyle ? restStyle : {},
|
|
41
|
+
"block-size": typeof own.height === "number" ? `${own.height}px` : own.height ?? "320px"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}], true);
|
|
45
|
+
insert(_el$2, createComponent(For, {
|
|
46
|
+
get each() {
|
|
47
|
+
return virtualizer.getVirtualItems();
|
|
48
|
+
},
|
|
49
|
+
children: (row) => (() => {
|
|
50
|
+
var _el$3 = _tmpl$2();
|
|
51
|
+
insert(_el$3, () => {
|
|
52
|
+
return own.renderItem?.(own.items[row.index], row.index);
|
|
53
|
+
});
|
|
54
|
+
effect(() => {
|
|
55
|
+
return {
|
|
56
|
+
e: `translateY(${row.start}px)`,
|
|
57
|
+
t: `${row.size}px`
|
|
58
|
+
};
|
|
59
|
+
}, ({ e, t }, _p$) => {
|
|
60
|
+
e !== _p$?.e && setStyleProperty(_el$3, "transform", e);
|
|
61
|
+
t !== _p$?.t && setStyleProperty(_el$3, "block-size", t);
|
|
62
|
+
});
|
|
63
|
+
return _el$3;
|
|
64
|
+
})()
|
|
65
|
+
}));
|
|
66
|
+
effect(() => `${virtualizer.getTotalSize()}px`, (_v$) => {
|
|
67
|
+
setStyleProperty(_el$2, "block-size", _v$);
|
|
68
|
+
});
|
|
69
|
+
return _el$;
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { VirtualList };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { effect, insert,
|
|
2
|
+
import { effect, insert, ref, setStyleProperty, spread, template } from "@solidjs/web";
|
|
3
3
|
import { createEffect, createSignal, splitProps } from "solid-js";
|
|
4
4
|
//#region src/components/watermark/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><div data-scope=watermark data-part=content></div><div data-scope=watermark data-part=marks aria-hidden=true>`);
|
|
6
6
|
/** Font-relative measures ride the root's own measure; absolute units
|
|
7
7
|
* pass through untouched — the canvas needs a number, the prop may
|
|
8
8
|
* speak in CSS. */
|
|
@@ -55,17 +55,23 @@ function Watermark(props) {
|
|
|
55
55
|
paint.fillText(own.content, 0, 0);
|
|
56
56
|
setTile(`url(${canvas.toDataURL()})`);
|
|
57
57
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
58
|
+
var _el$ = _tmpl$();
|
|
59
|
+
var _el$2 = _el$.firstChild;
|
|
60
|
+
var _el$3 = _el$2.nextSibling;
|
|
61
|
+
ref(() => {
|
|
62
|
+
return setHost;
|
|
63
|
+
}, _el$);
|
|
64
|
+
spread(_el$, [rest, {
|
|
65
|
+
"data-scope": "watermark",
|
|
66
|
+
"data-part": "root"
|
|
67
|
+
}], true);
|
|
68
|
+
insert(_el$2, () => {
|
|
69
|
+
return rest.children;
|
|
70
|
+
});
|
|
71
|
+
effect(() => tile(), (_v$) => {
|
|
72
|
+
setStyleProperty(_el$3, "background-image", _v$);
|
|
73
|
+
});
|
|
74
|
+
return _el$;
|
|
69
75
|
}
|
|
70
76
|
//#endregion
|
|
71
77
|
export { Watermark };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
2
|
+
import { Toc } from "@ark-ui/solid/toc";
|
|
3
|
+
//#region src/components/toc/TocIndicator.d.ts
|
|
4
|
+
/** The active stroke is decoration; hidden so the list reads as links
|
|
5
|
+
* alone. */
|
|
6
|
+
declare function TocIndicator(props: ComponentProps<typeof Toc.Indicator>): import("solid-js").JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/toc/index.d.ts
|
|
9
|
+
/** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
|
|
10
|
+
* beside the scroll, one stroke of primary ink marking where the reader
|
|
11
|
+
* stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
|
|
12
|
+
declare const Toc$1: Omit<typeof Toc, "Indicator"> & {
|
|
13
|
+
Indicator: typeof TocIndicator;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Toc$1 as t };
|