@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,53 +1,54 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { effect, insert,
|
|
2
|
+
import { effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
|
-
import { getIcon } from "@bysages/icons";
|
|
4
|
+
import { getIcon } from "@bysages/core/icons";
|
|
5
5
|
//#region src/components/icon/index.tsx
|
|
6
|
-
var _tmpl$ =
|
|
7
|
-
var _tmpl$2 =
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
7
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg fill=currentColor aria-hidden=true>`);
|
|
8
8
|
function Icon(props) {
|
|
9
9
|
injectComponentStyle("icon");
|
|
10
10
|
const [own, rest] = splitProps(props, [
|
|
11
11
|
"size",
|
|
12
12
|
"label",
|
|
13
|
+
"glyph",
|
|
13
14
|
"name",
|
|
14
15
|
"children"
|
|
15
16
|
]);
|
|
16
|
-
const
|
|
17
|
-
if (own.name && own.children == null && !
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
const resolved = own.glyph ?? (own.name && own.children == null ? getIcon(own.name) : void 0);
|
|
18
|
+
if (own.name && own.children == null && own.glyph == null && !resolved) console.error(`[icons] unknown icon name "${own.name}" — not in the wrappers' whitelist; import the glyph from @bysages/icons and pass it as glyph`);
|
|
19
|
+
var _el$ = _tmpl$();
|
|
20
|
+
spread(_el$, [rest, {
|
|
21
|
+
get role() {
|
|
22
|
+
return own.label != null ? "img" : void 0;
|
|
23
|
+
},
|
|
24
|
+
get "aria-label"() {
|
|
25
|
+
return own.label;
|
|
26
|
+
},
|
|
27
|
+
get "aria-hidden"() {
|
|
28
|
+
return own.label != null ? void 0 : "true";
|
|
29
|
+
},
|
|
30
|
+
"data-scope": "icon",
|
|
31
|
+
"data-part": "root",
|
|
32
|
+
get "data-size"() {
|
|
33
|
+
return own.size ?? "inherit";
|
|
34
|
+
}
|
|
35
|
+
}], true);
|
|
36
|
+
insert(_el$, () => {
|
|
37
|
+
return own.children ?? (resolved ? (() => {
|
|
37
38
|
var _el$2 = _tmpl$2();
|
|
38
|
-
effect((
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, {
|
|
44
|
-
e
|
|
45
|
-
t
|
|
39
|
+
effect(() => {
|
|
40
|
+
return {
|
|
41
|
+
e: `0 0 ${resolved.width ?? 24} ${resolved.height ?? 24}`,
|
|
42
|
+
t: resolved.body
|
|
43
|
+
};
|
|
44
|
+
}, ({ e, t }, _p$) => {
|
|
45
|
+
e !== _p$?.e && setAttribute(_el$2, "viewBox", e);
|
|
46
|
+
t !== _p$?.t && (_el$2.innerHTML = t);
|
|
46
47
|
});
|
|
47
48
|
return _el$2;
|
|
48
|
-
})() : null)
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
})() : null);
|
|
50
|
+
});
|
|
51
|
+
return _el$;
|
|
51
52
|
}
|
|
52
53
|
//#endregion
|
|
53
54
|
export { Icon };
|
|
@@ -8,6 +8,10 @@ import { JSX } from "solid-js";
|
|
|
8
8
|
export interface ImageProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
9
9
|
src: string;
|
|
10
10
|
alt?: string;
|
|
11
|
+
/** Intrinsic dimensions for the image element, reserving the layout
|
|
12
|
+
* box before bytes arrive. */
|
|
13
|
+
width?: number | string;
|
|
14
|
+
height?: number | string;
|
|
11
15
|
fit?: "cover" | "contain" | "fill" | "none";
|
|
12
16
|
loading?: "lazy" | "eager";
|
|
13
17
|
/** What a broken source leaves instead of the picture. */
|
|
@@ -1,12 +1,12 @@
|
|
|
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, createEffect, createSignal, on, splitProps } from "solid-js";
|
|
4
4
|
//#region src/components/image/index.tsx
|
|
5
|
-
var _tmpl$ =
|
|
6
|
-
var _tmpl$2 =
|
|
7
|
-
var _tmpl$3 =
|
|
8
|
-
var _tmpl$4 =
|
|
9
|
-
var _tmpl$5 =
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg><rect x=3 y=4 width=18 height=16 rx=1.5></svg>`, 2);
|
|
6
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg><circle cx=9 cy=10 r=1.5></svg>`, 2);
|
|
7
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<svg><path d="m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5"></svg>`, 2);
|
|
8
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=image data-part=fallback>`);
|
|
9
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<figure><img data-scope=image data-part=img decoding=async>`, 1);
|
|
10
10
|
/** The mark for a source that never arrived: a quiet mountain-and-sun,
|
|
11
11
|
* drawn in the stylesheet's stroke and hidden from the reader. */
|
|
12
12
|
function placeholderGlyph() {
|
|
@@ -21,49 +21,56 @@ function Image(props) {
|
|
|
21
21
|
const [own, rest] = splitProps(props, [
|
|
22
22
|
"src",
|
|
23
23
|
"alt",
|
|
24
|
+
"width",
|
|
25
|
+
"height",
|
|
24
26
|
"fit",
|
|
25
27
|
"loading",
|
|
26
28
|
"fallback"
|
|
27
29
|
]);
|
|
28
30
|
const [state, setState] = createSignal("loading");
|
|
29
31
|
createEffect(on(() => own.src, () => setState("loading")));
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
32
|
+
var _el$4 = _tmpl$5();
|
|
33
|
+
var _el$5 = _el$4.firstChild;
|
|
34
|
+
spread(_el$4, [rest, {
|
|
35
|
+
"data-scope": "image",
|
|
36
|
+
"data-part": "root",
|
|
37
|
+
get "data-state"() {
|
|
38
|
+
return state();
|
|
39
|
+
},
|
|
40
|
+
get "data-fit"() {
|
|
41
|
+
return own.fit ?? "cover";
|
|
42
|
+
}
|
|
43
|
+
}], true);
|
|
44
|
+
_el$5.addEventListener("error", () => setState("error"));
|
|
45
|
+
_el$5.addEventListener("load", () => setState("loaded"));
|
|
46
|
+
insert(_el$4, createComponent(Show, {
|
|
47
|
+
get when() {
|
|
48
|
+
return state() === "error";
|
|
49
|
+
},
|
|
50
|
+
get children() {
|
|
51
|
+
var _el$6 = _tmpl$4();
|
|
52
|
+
insert(_el$6, () => {
|
|
53
|
+
return own.fallback ?? placeholderGlyph();
|
|
54
|
+
});
|
|
55
|
+
return _el$6;
|
|
56
|
+
}
|
|
57
|
+
}), null);
|
|
58
|
+
effect(() => {
|
|
59
|
+
return {
|
|
60
|
+
e: own.src,
|
|
61
|
+
t: own.alt ?? "",
|
|
62
|
+
a: own.width,
|
|
63
|
+
o: own.height,
|
|
64
|
+
i: own.loading ?? "lazy"
|
|
65
|
+
};
|
|
66
|
+
}, ({ e, t, a, o, i }, _p$) => {
|
|
67
|
+
e !== _p$?.e && setAttribute(_el$5, "src", e);
|
|
68
|
+
t !== _p$?.t && setAttribute(_el$5, "alt", t);
|
|
69
|
+
a !== _p$?.a && setAttribute(_el$5, "width", a);
|
|
70
|
+
o !== _p$?.o && setAttribute(_el$5, "height", o);
|
|
71
|
+
i !== _p$?.i && setAttribute(_el$5, "loading", i);
|
|
72
|
+
});
|
|
73
|
+
return _el$4;
|
|
67
74
|
}
|
|
68
75
|
//#endregion
|
|
69
76
|
export { Image };
|
|
@@ -10,6 +10,10 @@ import { JSX } from "solid-js";
|
|
|
10
10
|
export interface ImageViewerProps {
|
|
11
11
|
src: string;
|
|
12
12
|
alt?: string;
|
|
13
|
+
/** Intrinsic dimensions for the image element, reserving the layout
|
|
14
|
+
* box before bytes arrive. */
|
|
15
|
+
width?: number | string;
|
|
16
|
+
height?: number | string;
|
|
13
17
|
open?: boolean;
|
|
14
18
|
zoomable?: boolean;
|
|
15
19
|
/** The openness changed — from the scrim, Escape or the toolbar. */
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { n as useComponentMessages } from "../../use-component-messages-C4SCVYjD.mjs";
|
|
2
3
|
import { ButtonGroup } from "../button-group/index.mjs";
|
|
3
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
-
import {
|
|
5
|
+
import { createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "@solidjs/web";
|
|
5
6
|
import { Show, createEffect, createSignal, splitProps } from "solid-js";
|
|
7
|
+
import { Portal } from "solid-js/web";
|
|
6
8
|
import { Dialog } from "@ark-ui/solid/dialog";
|
|
7
9
|
//#region src/components/image-viewer/index.tsx
|
|
8
|
-
var _tmpl$ =
|
|
9
|
-
var _tmpl$2 =
|
|
10
|
-
var _tmpl$3 =
|
|
11
|
-
var _tmpl$4 =
|
|
12
|
-
var _tmpl$5 =
|
|
13
|
-
var _tmpl$6 =
|
|
14
|
-
var _tmpl$7 =
|
|
15
|
-
var _tmpl$8 =
|
|
16
|
-
var _tmpl$9 =
|
|
17
|
-
var _tmpl$
|
|
18
|
-
var _tmpl$
|
|
10
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg><circle cx=11 cy=11 r=7></svg>`, 2);
|
|
11
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg><path d="m16.2 16.2 4.8 4.8"></svg>`, 2);
|
|
12
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<svg><path d="M8 11h6"></svg>`, 2);
|
|
13
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<svg><path d="M11 8v6"></svg>`, 2);
|
|
14
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, 2);
|
|
15
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, 2);
|
|
16
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<svg><path d="m6 6 12 12"></svg>`, 2);
|
|
17
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<svg><path d="M18 6 6 18"></svg>`, 2);
|
|
18
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`);
|
|
19
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<img data-scope=image-viewer data-part=viewport>`);
|
|
20
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<div data-scope=image-viewer data-part=toolbar>`);
|
|
19
21
|
const MIN_SCALE = .5;
|
|
20
22
|
const MAX_SCALE = 3;
|
|
21
23
|
const SCALE_STEP = .25;
|
|
@@ -40,10 +42,13 @@ function ImageViewer(props) {
|
|
|
40
42
|
const [own] = splitProps(props, [
|
|
41
43
|
"src",
|
|
42
44
|
"alt",
|
|
45
|
+
"width",
|
|
46
|
+
"height",
|
|
43
47
|
"open",
|
|
44
48
|
"zoomable",
|
|
45
49
|
"onOpenChange"
|
|
46
50
|
]);
|
|
51
|
+
const messages = useComponentMessages();
|
|
47
52
|
const [localOpen, setLocalOpen] = createSignal(false);
|
|
48
53
|
const [scale, setScale] = createSignal(1);
|
|
49
54
|
const [rotation, setRotation] = createSignal(0);
|
|
@@ -72,9 +77,9 @@ function ImageViewer(props) {
|
|
|
72
77
|
"aria-label": label,
|
|
73
78
|
onClick,
|
|
74
79
|
get children() {
|
|
75
|
-
var _el$
|
|
76
|
-
insert(_el$
|
|
77
|
-
return _el$
|
|
80
|
+
var _el$12 = _tmpl$9();
|
|
81
|
+
insert(_el$12, glyph);
|
|
82
|
+
return _el$12;
|
|
78
83
|
}
|
|
79
84
|
});
|
|
80
85
|
}
|
|
@@ -87,12 +92,12 @@ function ImageViewer(props) {
|
|
|
87
92
|
unmountOnExit: true,
|
|
88
93
|
get children() {
|
|
89
94
|
return createComponent(Portal, { get children() {
|
|
90
|
-
return [createComponent(Dialog.Backdrop, {
|
|
91
|
-
|
|
95
|
+
return [createComponent(Dialog.Backdrop, { class: "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
|
|
96
|
+
class: "bs-image-viewer-positioner",
|
|
92
97
|
get children() {
|
|
93
98
|
return createComponent(Dialog.Content, {
|
|
94
|
-
|
|
95
|
-
get
|
|
99
|
+
class: "bs-image-viewer-content",
|
|
100
|
+
get "aria-label"() {
|
|
96
101
|
return own.alt || "Image preview";
|
|
97
102
|
},
|
|
98
103
|
onClick: (event) => {
|
|
@@ -100,36 +105,48 @@ function ImageViewer(props) {
|
|
|
100
105
|
},
|
|
101
106
|
get children() {
|
|
102
107
|
return [(() => {
|
|
103
|
-
var _el$
|
|
104
|
-
effect((
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
var _el$13 = _tmpl$10();
|
|
109
|
+
effect(() => {
|
|
110
|
+
return {
|
|
111
|
+
e: own.src,
|
|
112
|
+
t: own.alt ?? "",
|
|
113
|
+
a: own.width,
|
|
114
|
+
o: own.height,
|
|
115
|
+
i: `scale(${scale()}) rotate(${rotation()}deg)`
|
|
116
|
+
};
|
|
117
|
+
}, ({ e, t, a, o, i }, _p$) => {
|
|
118
|
+
e !== _p$?.e && setAttribute(_el$13, "src", e);
|
|
119
|
+
t !== _p$?.t && setAttribute(_el$13, "alt", t);
|
|
120
|
+
a !== _p$?.a && setAttribute(_el$13, "width", a);
|
|
121
|
+
o !== _p$?.o && setAttribute(_el$13, "height", o);
|
|
122
|
+
i !== _p$?.i && setStyleProperty(_el$13, "transform", i);
|
|
114
123
|
});
|
|
115
|
-
return _el$
|
|
124
|
+
return _el$13;
|
|
116
125
|
})(), (() => {
|
|
117
|
-
var _el$
|
|
118
|
-
insert(_el$
|
|
126
|
+
var _el$14 = _tmpl$11();
|
|
127
|
+
insert(_el$14, createComponent(ButtonGroup, { get children() {
|
|
119
128
|
return [
|
|
120
129
|
createComponent(Show, {
|
|
121
130
|
get when() {
|
|
122
131
|
return own.zoomable ?? true;
|
|
123
132
|
},
|
|
124
133
|
get children() {
|
|
125
|
-
return [memo(() =>
|
|
134
|
+
return [memo(() => {
|
|
135
|
+
return toolButton(messages().imageViewer.zoomIn, TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP));
|
|
136
|
+
}), memo(() => {
|
|
137
|
+
return toolButton(messages().imageViewer.zoomOut, TOOL_GLYPHS.zoomOut, () => zoom(-.25));
|
|
138
|
+
})];
|
|
126
139
|
}
|
|
127
140
|
}),
|
|
128
|
-
memo(() =>
|
|
129
|
-
|
|
141
|
+
memo(() => {
|
|
142
|
+
return toolButton(messages().imageViewer.rotate, TOOL_GLYPHS.rotate, rotate);
|
|
143
|
+
}),
|
|
144
|
+
memo(() => {
|
|
145
|
+
return toolButton(messages().imageViewer.close, TOOL_GLYPHS.close, () => setOpen(false));
|
|
146
|
+
})
|
|
130
147
|
];
|
|
131
148
|
} }));
|
|
132
|
-
return _el$
|
|
149
|
+
return _el$14;
|
|
133
150
|
})()];
|
|
134
151
|
}
|
|
135
152
|
});
|
|
@@ -5,6 +5,9 @@ export interface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {
|
|
|
5
5
|
onValueChange?: (value: string) => void;
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
invalid?: boolean;
|
|
8
|
+
/** Entry mask - `9` digit, `a` letter, `*` either, anything else is
|
|
9
|
+
* literal. e.g. `"999-99-9999"`, `"(999) 999-9999"`. */
|
|
10
|
+
mask?: string;
|
|
8
11
|
}
|
|
9
12
|
/** The bare text input: the field recipe — border, surface, focus halo —
|
|
10
13
|
* on a native control. Standing alone it styles itself from the `invalid`
|
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { mergeProps, spread, template } from "solid-js/web";
|
|
3
|
-
import { mergeProps as mergeProps$1, splitProps } from "solid-js";
|
|
4
|
-
import { useFieldContext } from "@ark-ui/solid/field";
|
|
5
|
-
//#region src/components/input/index.tsx
|
|
6
|
-
var _tmpl$ = /*#__PURE__*/ template(`<input>`);
|
|
7
|
-
/** The bare text input: the field recipe — border, surface, focus halo —
|
|
8
|
-
* on a native control. Standing alone it styles itself from the `invalid`
|
|
9
|
-
* prop; inside a `Field.Root` it consumes the field context, picking up
|
|
10
|
-
* the label id, the described-by wiring and the invalid state for free,
|
|
11
|
-
* which is also the seam the Form validation layer will drive. Disabled
|
|
12
|
-
* rides the native attribute. */
|
|
13
|
-
function Input(props) {
|
|
14
|
-
injectComponentStyle("input");
|
|
15
|
-
const field = useFieldContext();
|
|
16
|
-
const [own, rest] = splitProps(props, [
|
|
17
|
-
"value",
|
|
18
|
-
"size",
|
|
19
|
-
"invalid",
|
|
20
|
-
"onValueChange"
|
|
21
|
-
]);
|
|
22
|
-
return (() => {
|
|
23
|
-
var _el$ = _tmpl$();
|
|
24
|
-
spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
|
|
25
|
-
get value() {
|
|
26
|
-
return own.value;
|
|
27
|
-
},
|
|
28
|
-
"data-scope": "input",
|
|
29
|
-
"data-part": "root",
|
|
30
|
-
get "data-size"() {
|
|
31
|
-
return own.size ?? "md";
|
|
32
|
-
},
|
|
33
|
-
get "data-invalid"() {
|
|
34
|
-
return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
|
|
35
|
-
},
|
|
36
|
-
onInput: (event) => own.onValueChange?.(event.currentTarget.value)
|
|
37
|
-
})), false, false);
|
|
38
|
-
return _el$;
|
|
39
|
-
})();
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
1
|
+
import { t as Input } from "../../input-DoFQ7RXh.mjs";
|
|
42
2
|
export { Input };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import {
|
|
2
|
+
import { spread, template } from "@solidjs/web";
|
|
3
3
|
//#region src/components/input-group/index.tsx
|
|
4
|
-
var _tmpl$ =
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
5
5
|
/**
|
|
6
6
|
* Merged controls: attachments and the entry fused into one seal. The
|
|
7
7
|
* Root draws the single hairline and carries the group's focus halo;
|
|
@@ -12,24 +12,20 @@ var _tmpl$ = /*#__PURE__*/ template(`<div>`);
|
|
|
12
12
|
* adds no visuals of its own.
|
|
13
13
|
*/
|
|
14
14
|
function InputGroupRoot(props) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return _el$;
|
|
22
|
-
})();
|
|
15
|
+
var _el$ = _tmpl$();
|
|
16
|
+
spread(_el$, [props, {
|
|
17
|
+
"data-scope": "input-group",
|
|
18
|
+
"data-part": "root"
|
|
19
|
+
}], false);
|
|
20
|
+
return _el$;
|
|
23
21
|
}
|
|
24
22
|
function InputGroupAddon(props) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return _el$2;
|
|
32
|
-
})();
|
|
23
|
+
var _el$2 = _tmpl$();
|
|
24
|
+
spread(_el$2, [props, {
|
|
25
|
+
"data-scope": "input-group",
|
|
26
|
+
"data-part": "addon"
|
|
27
|
+
}], false);
|
|
28
|
+
return _el$2;
|
|
33
29
|
}
|
|
34
30
|
const InputGroup = Object.assign(InputGroupRoot, {
|
|
35
31
|
Root: InputGroupRoot,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
|
|
1
|
+
import { JsonTreeView as JsonTreeView$1, JsonTreeViewTreeProps } from "@ark-ui/solid/json-tree-view";
|
|
2
2
|
//#region src/components/json-tree-view/index.d.ts
|
|
3
3
|
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
4
4
|
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
5
5
|
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
6
|
-
|
|
6
|
+
declare function JsonTreeViewTree(props: JsonTreeViewTreeProps): import("solid-js").JSX.Element;
|
|
7
|
+
export declare const JsonTreeView: Omit<typeof JsonTreeView$1, "Tree"> & {
|
|
8
|
+
Tree: typeof JsonTreeViewTree;
|
|
9
|
+
};
|
|
7
10
|
//#endregion
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, effect, mergeProps, setAttribute, template } from "@solidjs/web";
|
|
2
3
|
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
|
|
3
|
-
|
|
4
|
+
import { chevron_right } from "@bysages/icons";
|
|
5
|
+
//#region src/components/json-tree-view/index.tsx
|
|
6
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg aria-hidden=true>`);
|
|
4
7
|
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
5
8
|
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
6
9
|
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
7
|
-
|
|
10
|
+
function JsonTreeViewTree(props) {
|
|
11
|
+
return createComponent(JsonTreeView$1.Tree, mergeProps(props, { get arrow() {
|
|
12
|
+
return props.arrow ?? (() => {
|
|
13
|
+
var _el$ = _tmpl$();
|
|
14
|
+
effect(() => {
|
|
15
|
+
return {
|
|
16
|
+
e: `0 0 ${chevron_right.width} ${chevron_right.height}`,
|
|
17
|
+
t: chevron_right.body
|
|
18
|
+
};
|
|
19
|
+
}, ({ e, t }, _p$) => {
|
|
20
|
+
e !== _p$?.e && setAttribute(_el$, "viewBox", e);
|
|
21
|
+
t !== _p$?.t && (_el$.innerHTML = t);
|
|
22
|
+
});
|
|
23
|
+
return _el$;
|
|
24
|
+
})();
|
|
25
|
+
} }));
|
|
26
|
+
}
|
|
27
|
+
const JsonTreeView = {
|
|
28
|
+
...JsonTreeView$1,
|
|
29
|
+
Tree: JsonTreeViewTree
|
|
30
|
+
};
|
|
8
31
|
injectComponentStyle("json-tree-view");
|
|
9
32
|
//#endregion
|
|
10
33
|
export { JsonTreeView };
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import {
|
|
2
|
+
import { spread, template } from "@solidjs/web";
|
|
3
3
|
//#region src/components/kbd/index.tsx
|
|
4
|
-
var _tmpl$ =
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template(`<kbd>`);
|
|
5
5
|
function Kbd(props) {
|
|
6
6
|
injectComponentStyle("kbd");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return _el$;
|
|
14
|
-
})();
|
|
7
|
+
var _el$ = _tmpl$();
|
|
8
|
+
spread(_el$, [props, {
|
|
9
|
+
"data-scope": "kbd",
|
|
10
|
+
"data-part": "root"
|
|
11
|
+
}], false);
|
|
12
|
+
return _el$;
|
|
15
13
|
}
|
|
16
14
|
//#endregion
|
|
17
15
|
export { Kbd };
|