@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,12 +1,13 @@
|
|
|
1
1
|
import { Button } from "../button/index.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
3
|
+
import { t as Input } from "../../input-DoFQ7RXh.mjs";
|
|
3
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
-
import { createComponent, insert, memo,
|
|
5
|
+
import { createComponent, insert, memo, spread, template } from "@solidjs/web";
|
|
5
6
|
import { Index, splitProps } from "solid-js";
|
|
6
7
|
//#region src/components/dynamic-input/index.tsx
|
|
7
|
-
var _tmpl$ =
|
|
8
|
-
var _tmpl$2 =
|
|
9
|
-
var _tmpl$3 =
|
|
8
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div><div data-scope=dynamic-input data-part=add>`);
|
|
9
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=dynamic-input data-part=row><!><!>`);
|
|
10
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="M18 6 6 18M6 6l12 12">`);
|
|
10
11
|
/**
|
|
11
12
|
* A column of entry rows: one Input per line, each with a quiet remove
|
|
12
13
|
* seal, and an add row at the tail. The list is controlled — every edit
|
|
@@ -16,6 +17,7 @@ var _tmpl$3 = /*#__PURE__*/ template(`<svg width=16 height=16 viewBox="0 0 24 24
|
|
|
16
17
|
* emptied itself would leave the reader no place to type.
|
|
17
18
|
*/
|
|
18
19
|
function DynamicInput(props) {
|
|
20
|
+
const messages = useComponentMessages();
|
|
19
21
|
injectComponentStyle("dynamic-input");
|
|
20
22
|
const [own, rest] = splitProps(props, [
|
|
21
23
|
"value",
|
|
@@ -44,69 +46,74 @@ function DynamicInput(props) {
|
|
|
44
46
|
};
|
|
45
47
|
const canRemove = () => values().length > Math.max(own.min ?? 0, 1);
|
|
46
48
|
const canAdd = () => own.max === void 0 || values().length < own.max;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
49
|
+
var _el$ = _tmpl$();
|
|
50
|
+
var _el$2 = _el$.firstChild;
|
|
51
|
+
spread(_el$, [rest, {
|
|
52
|
+
"data-scope": "dynamic-input",
|
|
53
|
+
"data-part": "root"
|
|
54
|
+
}], true);
|
|
55
|
+
insert(_el$, createComponent(Index, {
|
|
56
|
+
get each() {
|
|
57
|
+
return values();
|
|
58
|
+
},
|
|
59
|
+
children: (value, index) => (() => {
|
|
60
|
+
var _el$3 = _tmpl$2();
|
|
61
|
+
var _el$4 = _el$3.firstChild;
|
|
62
|
+
var _el$5 = _el$4.nextSibling;
|
|
63
|
+
insert(_el$3, createComponent(Input, {
|
|
64
|
+
get value() {
|
|
65
|
+
return value();
|
|
66
|
+
},
|
|
67
|
+
get placeholder() {
|
|
68
|
+
return own.placeholder;
|
|
69
|
+
},
|
|
70
|
+
get disabled() {
|
|
71
|
+
return own.disabled;
|
|
72
|
+
},
|
|
73
|
+
get invalid() {
|
|
74
|
+
return own.invalid;
|
|
75
|
+
},
|
|
76
|
+
get size() {
|
|
77
|
+
return own.size ?? "md";
|
|
78
|
+
},
|
|
79
|
+
onValueChange: (next) => update(index, next)
|
|
80
|
+
}), _el$4);
|
|
81
|
+
insert(_el$3, createComponent(Button, {
|
|
82
|
+
variant: "ghost",
|
|
83
|
+
get size() {
|
|
84
|
+
return own.size ?? "md";
|
|
85
|
+
},
|
|
86
|
+
square: true,
|
|
87
|
+
get disabled() {
|
|
88
|
+
return own.disabled || !canRemove();
|
|
89
|
+
},
|
|
90
|
+
get "aria-label"() {
|
|
91
|
+
return `${messages().dynamicEntry.remove} ${index + 1}`;
|
|
92
|
+
},
|
|
93
|
+
onClick: () => remove(index),
|
|
94
|
+
get children() {
|
|
95
|
+
return crossIcon();
|
|
96
|
+
}
|
|
97
|
+
}), _el$5);
|
|
98
|
+
return _el$3;
|
|
99
|
+
})()
|
|
100
|
+
}), _el$2);
|
|
101
|
+
insert(_el$2, createComponent(Button, {
|
|
102
|
+
variant: "ghost",
|
|
103
|
+
get size() {
|
|
104
|
+
return own.size ?? "md";
|
|
105
|
+
},
|
|
106
|
+
get disabled() {
|
|
107
|
+
return own.disabled || !canAdd();
|
|
108
|
+
},
|
|
109
|
+
onClick: () => add(),
|
|
110
|
+
get children() {
|
|
111
|
+
return ["+", memo(() => {
|
|
112
|
+
return own.addLabel ?? "Add entry";
|
|
113
|
+
})];
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
return _el$;
|
|
110
117
|
}
|
|
111
118
|
/** The one glyph a remove seal needs: a single crossing stroke. */
|
|
112
119
|
function crossIcon() {
|
|
@@ -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 { Editable as Editable$1 } from "@ark-ui/solid/editable";
|
|
5
5
|
//#region src/components/editable/index.tsx
|
|
6
6
|
function EditableRoot(props) {
|
|
7
7
|
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
-
return createComponent(Editable$1.Root, mergeProps(rest, { get
|
|
8
|
+
return createComponent(Editable$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
9
|
return own.size ?? "md";
|
|
10
10
|
} }));
|
|
11
11
|
}
|
|
@@ -1,29 +1,27 @@
|
|
|
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/ellipsis/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
6
6
|
function Ellipsis(props) {
|
|
7
7
|
injectComponentStyle("ellipsis");
|
|
8
8
|
const [own, rest] = splitProps(props, ["lines"]);
|
|
9
9
|
const multiline = () => (own.lines ?? 1) > 1;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return _el$;
|
|
26
|
-
})();
|
|
10
|
+
var _el$ = _tmpl$();
|
|
11
|
+
spread(_el$, [rest, {
|
|
12
|
+
get style() {
|
|
13
|
+
return {
|
|
14
|
+
...rest.style,
|
|
15
|
+
...multiline() ? { "--bs-ellipsis-lines": String(own.lines) } : {}
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
"data-scope": "ellipsis",
|
|
19
|
+
"data-part": "root",
|
|
20
|
+
get "data-multiline"() {
|
|
21
|
+
return multiline() ? "" : void 0;
|
|
22
|
+
}
|
|
23
|
+
}], false);
|
|
24
|
+
return _el$;
|
|
27
25
|
}
|
|
28
26
|
//#endregion
|
|
29
27
|
export { Ellipsis };
|
|
@@ -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/empty/index.tsx
|
|
4
4
|
/** An empty state: the page holds its breath. Root centers the column,
|
|
5
5
|
* Visual carries the mark, Title and Description carry the ink, Actions
|
|
@@ -8,7 +8,7 @@ function part(name, tag) {
|
|
|
8
8
|
return ((props) => {
|
|
9
9
|
return createComponent(tag, mergeProps(props, {
|
|
10
10
|
"data-scope": "empty",
|
|
11
|
-
get
|
|
11
|
+
get "data-part"() {
|
|
12
12
|
return name.toLowerCase();
|
|
13
13
|
}
|
|
14
14
|
}));
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
1
2
|
import { FileUpload as FileUpload$1, FileUploadRootProps } from "@ark-ui/solid/file-upload";
|
|
2
3
|
//#region src/components/file-upload/index.d.ts
|
|
4
|
+
/** The inner trigger repeats the click binding the dropzone already
|
|
5
|
+
* owns: keyboard users enter through the dropzone, so the button
|
|
6
|
+
* leaves the tab order and the semantic tree entirely. */
|
|
7
|
+
declare function FileUploadTrigger(props: ComponentProps<typeof FileUpload$1.Trigger>): import("solid-js").JSX.Element;
|
|
3
8
|
/** Ark's FileUpload, dressed in the paper-and-ink system: a dashed
|
|
4
9
|
* dropzone that floods with subtle light on drag-over, and accepted files
|
|
5
10
|
* as loose hairline slips. The API is Ark's own — Root, Label, Trigger,
|
|
@@ -11,7 +16,8 @@ type FileUploadOwnProps = {
|
|
|
11
16
|
size?: "sm" | "md" | "lg";
|
|
12
17
|
};
|
|
13
18
|
declare function FileUploadRoot(props: FileUploadRootProps & FileUploadOwnProps): import("solid-js").JSX.Element;
|
|
14
|
-
export declare const FileUpload: Omit<typeof FileUpload$1, "Root"> & {
|
|
19
|
+
export declare const FileUpload: Omit<typeof FileUpload$1, "Root" | "Trigger"> & {
|
|
15
20
|
Root: typeof FileUploadRoot;
|
|
21
|
+
Trigger: typeof FileUploadTrigger;
|
|
16
22
|
};
|
|
17
23
|
//#endregion
|
|
@@ -1,17 +1,27 @@
|
|
|
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 { FileUpload as FileUpload$1 } from "@ark-ui/solid/file-upload";
|
|
5
5
|
//#region src/components/file-upload/index.tsx
|
|
6
|
+
/** The inner trigger repeats the click binding the dropzone already
|
|
7
|
+
* owns: keyboard users enter through the dropzone, so the button
|
|
8
|
+
* leaves the tab order and the semantic tree entirely. */
|
|
9
|
+
function FileUploadTrigger(props) {
|
|
10
|
+
return createComponent(FileUpload$1.Trigger, mergeProps(props, {
|
|
11
|
+
tabindex: -1,
|
|
12
|
+
"aria-hidden": "true"
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
6
15
|
function FileUploadRoot(props) {
|
|
7
16
|
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
-
return createComponent(FileUpload$1.Root, mergeProps(rest, { get
|
|
17
|
+
return createComponent(FileUpload$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
18
|
return own.size ?? "md";
|
|
10
19
|
} }));
|
|
11
20
|
}
|
|
12
21
|
const FileUpload = {
|
|
13
22
|
...FileUpload$1,
|
|
14
|
-
Root: FileUploadRoot
|
|
23
|
+
Root: FileUploadRoot,
|
|
24
|
+
Trigger: FileUploadTrigger
|
|
15
25
|
};
|
|
16
26
|
injectComponentStyle("file-upload");
|
|
17
27
|
//#endregion
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
-
import { createComponent, insert, mergeProps, spread, template } from "
|
|
4
|
+
import { createComponent, insert, mergeProps, spread, template } from "@solidjs/web";
|
|
4
5
|
import { createContext, createSignal, splitProps, useContext } from "solid-js";
|
|
5
6
|
//#region src/components/float-button/index.tsx
|
|
6
|
-
var _tmpl$ =
|
|
7
|
-
var _tmpl$2 =
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div><span data-scope=float-button data-part=item-label aria-hidden=true>`);
|
|
8
9
|
/** Solid context for {@link FloatButtonContext}, exported so a custom
|
|
9
10
|
* part can read the group's state with `useContext`. */
|
|
10
11
|
const FloatButtonContextKey = createContext();
|
|
@@ -40,16 +41,16 @@ function FloatButtonRoot(props) {
|
|
|
40
41
|
value: context,
|
|
41
42
|
get children() {
|
|
42
43
|
var _el$ = _tmpl$();
|
|
43
|
-
spread(_el$,
|
|
44
|
+
spread(_el$, [rest, {
|
|
44
45
|
"data-scope": "float-button",
|
|
45
46
|
"data-part": "root",
|
|
46
|
-
get
|
|
47
|
+
get "data-placement"() {
|
|
47
48
|
return own.placement ?? "bottom-end";
|
|
48
49
|
},
|
|
49
|
-
get
|
|
50
|
+
get "data-state"() {
|
|
50
51
|
return open() ? "open" : "closed";
|
|
51
52
|
}
|
|
52
|
-
}
|
|
53
|
+
}], false);
|
|
53
54
|
return _el$;
|
|
54
55
|
}
|
|
55
56
|
});
|
|
@@ -62,6 +63,7 @@ const STEP_DOWN = {
|
|
|
62
63
|
function FloatButtonTrigger(props) {
|
|
63
64
|
const [own, rest] = splitProps(props, ["label", "children"]);
|
|
64
65
|
const context = useContext(FloatButtonContextKey);
|
|
66
|
+
const messages = useComponentMessages();
|
|
65
67
|
return createComponent(Button, mergeProps(rest, {
|
|
66
68
|
variant: "solid",
|
|
67
69
|
square: true,
|
|
@@ -69,10 +71,10 @@ function FloatButtonTrigger(props) {
|
|
|
69
71
|
return context?.size() ?? "lg";
|
|
70
72
|
},
|
|
71
73
|
onClick: () => context?.toggle(),
|
|
72
|
-
get
|
|
73
|
-
return own.label ||
|
|
74
|
+
get "aria-label"() {
|
|
75
|
+
return own.label || messages().floatButton.actions;
|
|
74
76
|
},
|
|
75
|
-
get
|
|
77
|
+
get "aria-expanded"() {
|
|
76
78
|
return context?.open() ?? false;
|
|
77
79
|
},
|
|
78
80
|
get children() {
|
|
@@ -88,35 +90,36 @@ function FloatButtonItem(props) {
|
|
|
88
90
|
"children"
|
|
89
91
|
]);
|
|
90
92
|
const context = useContext(FloatButtonContextKey);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return
|
|
119
|
-
})
|
|
93
|
+
var _el$2 = _tmpl$2();
|
|
94
|
+
var _el$3 = _el$2.firstChild;
|
|
95
|
+
spread(_el$2, [rest, {
|
|
96
|
+
"data-scope": "float-button",
|
|
97
|
+
"data-part": "item"
|
|
98
|
+
}], true);
|
|
99
|
+
insert(_el$2, createComponent(Button, {
|
|
100
|
+
variant: "outline",
|
|
101
|
+
square: true,
|
|
102
|
+
get size() {
|
|
103
|
+
return context ? STEP_DOWN[context.size()] : "md";
|
|
104
|
+
},
|
|
105
|
+
get disabled() {
|
|
106
|
+
return own.disabled;
|
|
107
|
+
},
|
|
108
|
+
get "aria-label"() {
|
|
109
|
+
return own.label;
|
|
110
|
+
},
|
|
111
|
+
onClick: (event) => {
|
|
112
|
+
own.onClick?.(event);
|
|
113
|
+
context?.close();
|
|
114
|
+
},
|
|
115
|
+
get children() {
|
|
116
|
+
return own.children;
|
|
117
|
+
}
|
|
118
|
+
}), _el$3);
|
|
119
|
+
insert(_el$3, () => {
|
|
120
|
+
return own.label;
|
|
121
|
+
});
|
|
122
|
+
return _el$2;
|
|
120
123
|
}
|
|
121
124
|
const FloatButton = Object.assign(FloatButtonRoot, {
|
|
122
125
|
Root: FloatButtonRoot,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { a as SolidFormApi, c as FormApi, i as FormProps, l as FieldApi, n as FormField, o as createField, r as FormFieldProps, s as createForm, t as Form } from "../../index-B1xiJ5ki.mjs";
|
|
2
|
-
export { type FieldApi, Form, type FormApi, FormField, FormFieldProps, FormProps, type SolidFormApi, createField, createForm };
|
|
2
|
+
export { type FieldApi, Form, type FormApi, FormField, FormFieldProps, FormProps, type SolidFormApi, createField, createField as useField, createForm, createForm as useForm };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, insert, memo, mergeProps, spread, template } from "
|
|
2
|
+
import { claimElement, createComponent, insert, memo, mergeProps, spread, template } from "@solidjs/web";
|
|
3
3
|
import { Show, createContext, splitProps, useContext } from "solid-js";
|
|
4
4
|
import { Field } from "@ark-ui/solid/field";
|
|
5
5
|
import { createField, createForm } from "@tanstack/solid-form";
|
|
6
6
|
//#region src/components/form/index.tsx
|
|
7
|
-
var _tmpl$ =
|
|
8
|
-
var _tmpl$2 =
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<form>`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
9
9
|
const FormContext = createContext(null);
|
|
10
10
|
/** A validator's complaint is a string or a Standard Schema issue; both
|
|
11
11
|
* reduce to the sentence the field shows. */
|
|
@@ -25,15 +25,16 @@ function Form(props) {
|
|
|
25
25
|
},
|
|
26
26
|
get children() {
|
|
27
27
|
var _el$ = _tmpl$();
|
|
28
|
-
|
|
28
|
+
claimElement(_el$);
|
|
29
|
+
spread(_el$, [rest, {
|
|
29
30
|
"data-scope": "form",
|
|
30
31
|
"data-part": "root",
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
novalidate: true,
|
|
33
|
+
onSubmit: (event) => {
|
|
33
34
|
event.preventDefault();
|
|
34
35
|
own.form.handleSubmit();
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
+
}], false);
|
|
37
38
|
return _el$;
|
|
38
39
|
}
|
|
39
40
|
});
|
|
@@ -57,38 +58,52 @@ function FormField(props) {
|
|
|
57
58
|
const meta = field().state.meta;
|
|
58
59
|
return (meta.isTouched ? meta.errors ?? [] : [meta.errorMap?.onSubmit].flat().filter(Boolean)).map(errorText).filter(Boolean);
|
|
59
60
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
61
|
+
var _el$2 = _tmpl$2();
|
|
62
|
+
spread(_el$2, [rest, { get "data-form-field"() {
|
|
63
|
+
return own.name;
|
|
64
|
+
} }], true);
|
|
65
|
+
insert(_el$2, createComponent(Field.Root, {
|
|
66
|
+
get invalid() {
|
|
67
|
+
return own.invalid || errors().length > 0;
|
|
68
|
+
},
|
|
69
|
+
get required() {
|
|
70
|
+
return own.required;
|
|
71
|
+
},
|
|
72
|
+
get disabled() {
|
|
73
|
+
return own.disabled;
|
|
74
|
+
},
|
|
75
|
+
get children() {
|
|
76
|
+
return [
|
|
77
|
+
memo(() => {
|
|
78
|
+
return memo(() => {
|
|
79
|
+
return !!own.label;
|
|
80
|
+
})() ? createComponent(Field.Label, { get children() {
|
|
78
81
|
return own.label;
|
|
79
|
-
} }) : null
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
} }) : null;
|
|
83
|
+
}),
|
|
84
|
+
memo(() => {
|
|
85
|
+
return memo(() => {
|
|
86
|
+
return typeof own.children === "function";
|
|
87
|
+
})() ? own.children(field) : own.children;
|
|
88
|
+
}),
|
|
89
|
+
memo(() => {
|
|
90
|
+
return memo(() => {
|
|
91
|
+
return !!(own.hint && errors().length === 0);
|
|
92
|
+
})() ? createComponent(Field.HelperText, { get children() {
|
|
82
93
|
return own.hint;
|
|
83
|
-
} }) : null
|
|
84
|
-
|
|
94
|
+
} }) : null;
|
|
95
|
+
}),
|
|
96
|
+
memo(() => {
|
|
97
|
+
return memo(() => {
|
|
98
|
+
return errors().length > 0;
|
|
99
|
+
})() ? createComponent(Field.ErrorText, { get children() {
|
|
85
100
|
return errors()[0];
|
|
86
|
-
} }) : null
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
} }) : null;
|
|
102
|
+
})
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
return _el$2;
|
|
92
107
|
};
|
|
93
108
|
return createComponent(Show, {
|
|
94
109
|
get when() {
|
|
@@ -107,4 +122,4 @@ function FormField(props) {
|
|
|
107
122
|
});
|
|
108
123
|
}
|
|
109
124
|
//#endregion
|
|
110
|
-
export { Form, FormField, createField, createForm };
|
|
125
|
+
export { Form, FormField, createField, createField as useField, createForm, createForm as useForm };
|
|
@@ -1,8 +1,8 @@
|
|
|
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/grid/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
6
6
|
/** The same named steps of the space ramp the stack uses — one
|
|
7
7
|
* vocabulary of distance across the layout primitives. */
|
|
8
8
|
const gapVars = {
|
|
@@ -20,25 +20,23 @@ function Grid(props) {
|
|
|
20
20
|
"gap",
|
|
21
21
|
"minChildWidth"
|
|
22
22
|
]);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return _el$;
|
|
41
|
-
})();
|
|
23
|
+
var _el$ = _tmpl$();
|
|
24
|
+
spread(_el$, [rest, {
|
|
25
|
+
get style() {
|
|
26
|
+
return {
|
|
27
|
+
...rest.style,
|
|
28
|
+
"--bs-grid-columns": String(own.columns ?? 12),
|
|
29
|
+
"--bs-grid-gap": gapVars[own.gap ?? "md"] ?? gapVars.md,
|
|
30
|
+
...own.minChildWidth != null ? { "--bs-grid-min-child-width": own.minChildWidth } : {}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
"data-scope": "grid",
|
|
34
|
+
"data-part": "root",
|
|
35
|
+
get "data-autofill"() {
|
|
36
|
+
return own.minChildWidth != null ? "" : void 0;
|
|
37
|
+
}
|
|
38
|
+
}], false);
|
|
39
|
+
return _el$;
|
|
42
40
|
}
|
|
43
41
|
//#endregion
|
|
44
42
|
export { Grid };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { JSX } from "solid-js";
|
|
2
|
+
import { IconifyIcon } from "@bysages/core/icons";
|
|
2
3
|
//#region src/components/icon/index.d.ts
|
|
3
4
|
/** The inkwell: a standard box that keeps any inline svg at its optical
|
|
4
5
|
* measure and in the text's own ink — the icon carries no pigment and no
|
|
5
|
-
* size of its own. Bring a glyph through `
|
|
6
|
-
*
|
|
6
|
+
* size of its own. Bring a glyph through `glyph` (a direct registry
|
|
7
|
+
* import), through `name` from the whitelisted registry, or bring your
|
|
8
|
+
* own; the well renders either. */
|
|
7
9
|
export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
8
10
|
/** Size steps follow the surrounding font size; `inherit` is the
|
|
9
11
|
* default — one em of the text the icon sits in. */
|
|
@@ -11,8 +13,11 @@ export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
|
11
13
|
/** The accessible name. Without it the icon is presentation-only and
|
|
12
14
|
* hidden from the accessibility tree. */
|
|
13
15
|
label?: string;
|
|
14
|
-
/** A glyph from the registry. Ignored when children
|
|
15
|
-
* explicit glyph always wins
|
|
16
|
+
/** A glyph from the registry, imported directly. Ignored when children
|
|
17
|
+
* are given — an explicit glyph always wins. */
|
|
18
|
+
glyph?: IconifyIcon;
|
|
19
|
+
/** A registry name — only the whitelisted set the wrappers draw
|
|
20
|
+
* themselves. Ignored when `glyph` or children are given. */
|
|
16
21
|
name?: string;
|
|
17
22
|
}
|
|
18
23
|
export declare function Icon(props: IconProps): JSX.Element;
|