@bysages/solid 0.3.1 → 0.4.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/dist/{ai-response-slzE03wh.mjs → ai-response-D2uINBIi.mjs} +13 -5
- package/dist/chevron-BHQrYKPM.mjs +8 -0
- package/dist/components/accordion/index.d.mts +22 -2
- package/dist/components/accordion/index.mjs +68 -2
- package/dist/components/affix/index.d.mts +3 -1
- package/dist/components/affix/index.mjs +5 -4
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +6 -5
- package/dist/components/ai-action/index.d.mts +3 -1
- package/dist/components/ai-action/index.mjs +3 -2
- package/dist/components/ai-attachments/index.d.mts +8 -4
- package/dist/components/ai-attachments/index.mjs +38 -36
- package/dist/components/ai-message/index.d.mts +3 -1
- package/dist/components/ai-message/index.mjs +3 -2
- package/dist/components/ai-prompt-input/index.d.mts +3 -1
- package/dist/components/ai-prompt-input/index.mjs +47 -43
- package/dist/components/ai-reasoning/index.d.mts +3 -1
- package/dist/components/ai-reasoning/index.mjs +4 -3
- package/dist/components/ai-response/index.d.mts +3 -1
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +6 -2
- package/dist/components/ai-source/index.mjs +5 -4
- package/dist/components/ai-suggestion/index.d.mts +3 -1
- package/dist/components/ai-suggestion/index.mjs +3 -2
- package/dist/components/ai-tool/index.d.mts +3 -1
- package/dist/components/ai-tool/index.mjs +4 -3
- package/dist/components/alert/index.mjs +31 -34
- package/dist/components/angle-slider/index.d.mts +1 -1
- package/dist/components/angle-slider/index.mjs +13 -5
- package/dist/components/aspect-ratio/index.d.mts +3 -1
- package/dist/components/aspect-ratio/index.mjs +3 -2
- package/dist/components/autocomplete/index.d.mts +4 -1
- package/dist/components/autocomplete/index.mjs +10 -1
- package/dist/components/avatar/index.d.mts +1 -1
- package/dist/components/avatar/index.mjs +10 -1
- package/dist/components/avatar-group/index.d.mts +3 -1
- package/dist/components/avatar-group/index.mjs +3 -2
- package/dist/components/back-top/index.d.mts +3 -1
- package/dist/components/back-top/index.mjs +9 -5
- package/dist/components/badge/index.d.mts +3 -1
- package/dist/components/badge/index.mjs +3 -2
- package/dist/components/banner/index.mjs +6 -2
- package/dist/components/block-ui/index.d.mts +3 -1
- package/dist/components/block-ui/index.mjs +3 -2
- package/dist/components/button/index.d.mts +3 -1
- package/dist/components/button/index.mjs +3 -2
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +29 -21
- package/dist/components/carousel/index.d.mts +5 -1
- package/dist/components/carousel/index.mjs +13 -1
- package/dist/components/cascade-select/index.d.mts +3 -1
- package/dist/components/cascade-select/index.mjs +73 -72
- package/dist/components/checkbox/index.d.mts +1 -1
- package/dist/components/checkbox/index.mjs +13 -5
- package/dist/components/checkbox-group/index.d.mts +4 -9
- package/dist/components/checkbox-group/index.mjs +65 -68
- package/dist/components/chip/index.d.mts +3 -1
- package/dist/components/chip/index.mjs +3 -2
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +8 -1
- package/dist/components/clipboard/index.d.mts +1 -1
- package/dist/components/clipboard/index.mjs +13 -5
- package/dist/components/collapsible/index.d.mts +15 -1
- package/dist/components/collapsible/index.mjs +39 -2
- package/dist/components/color-picker/index.d.mts +13 -2
- package/dist/components/color-picker/index.mjs +95 -8
- package/dist/components/combobox/index.d.mts +24 -1
- package/dist/components/combobox/index.mjs +129 -8
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +13 -1
- package/dist/components/comment/index.d.mts +3 -1
- package/dist/components/comment/index.mjs +3 -2
- package/dist/components/config-provider/index.d.mts +3 -1
- package/dist/components/config-provider/index.mjs +3 -2
- package/dist/components/container/index.d.mts +3 -1
- package/dist/components/container/index.mjs +3 -2
- package/dist/components/data-view/index.d.mts +3 -1
- package/dist/components/data-view/index.mjs +5 -6
- package/dist/components/date-input/index.d.mts +1 -1
- package/dist/components/date-input/index.mjs +13 -5
- package/dist/components/date-picker/index.d.mts +1 -1
- package/dist/components/date-picker/index.mjs +13 -5
- package/dist/components/deferred-content/index.d.mts +3 -1
- package/dist/components/deferred-content/index.mjs +3 -2
- package/dist/components/descriptions/index.d.mts +7 -0
- package/dist/components/descriptions/index.mjs +21 -2
- package/dist/components/dialog/index.d.mts +17 -1
- package/dist/components/dialog/index.mjs +84 -2
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +8 -1
- package/dist/components/drawer/index.d.mts +17 -1
- package/dist/components/drawer/index.mjs +83 -2
- package/dist/components/dynamic-input/index.d.mts +3 -1
- package/dist/components/dynamic-input/index.mjs +10 -6
- package/dist/components/editable/index.d.mts +1 -1
- package/dist/components/editable/index.mjs +13 -5
- package/dist/components/ellipsis/index.d.mts +3 -1
- package/dist/components/ellipsis/index.mjs +3 -2
- package/dist/components/field/index.d.mts +5 -1
- package/dist/components/field/index.mjs +13 -1
- package/dist/components/fieldset/index.d.mts +5 -1
- package/dist/components/fieldset/index.mjs +13 -1
- package/dist/components/file-upload/index.d.mts +1 -7
- package/dist/components/file-upload/index.mjs +13 -5
- package/dist/components/floating-panel/index.d.mts +5 -1
- package/dist/components/floating-panel/index.mjs +13 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +8 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +10 -4
- package/dist/components/frame/index.d.mts +6 -1
- package/dist/components/frame/index.mjs +10 -1
- package/dist/components/grid/index.d.mts +3 -1
- package/dist/components/grid/index.mjs +3 -2
- package/dist/components/highlight/index.d.mts +3 -1
- package/dist/components/highlight/index.mjs +2 -1
- package/dist/components/hover-card/index.d.mts +19 -1
- package/dist/components/hover-card/index.mjs +91 -2
- package/dist/components/icon/index.d.mts +8 -7
- package/dist/components/icon/index.mjs +4 -3
- package/dist/components/image/index.d.mts +4 -2
- package/dist/components/image/index.mjs +34 -33
- package/dist/components/image-cropper/index.d.mts +5 -1
- package/dist/components/image-cropper/index.mjs +13 -1
- package/dist/components/image-viewer/index.d.mts +2 -23
- package/dist/components/image-viewer/index.mjs +3 -159
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +5 -4
- package/dist/components/json-tree-view/index.mjs +15 -18
- package/dist/components/kbd/index.d.mts +3 -1
- package/dist/components/kbd/index.mjs +3 -2
- package/dist/components/link/index.d.mts +3 -1
- package/dist/components/link/index.mjs +3 -2
- package/dist/components/listbox/index.d.mts +1 -1
- package/dist/components/listbox/index.mjs +13 -5
- package/dist/components/marquee/index.d.mts +5 -1
- package/dist/components/marquee/index.mjs +13 -1
- package/dist/components/masonry/index.d.mts +3 -1
- package/dist/components/masonry/index.mjs +3 -2
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +2 -2
- package/dist/components/menu/index.d.mts +21 -1
- package/dist/components/menu/index.mjs +62 -5
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +30 -9
- package/dist/components/navigation-menu/index.d.mts +5 -1
- package/dist/components/navigation-menu/index.mjs +13 -1
- package/dist/components/number-input/index.d.mts +1 -1
- package/dist/components/number-input/index.mjs +13 -5
- package/dist/components/order-list/index.d.mts +3 -1
- package/dist/components/order-list/index.mjs +67 -63
- package/dist/components/pagination/index.d.mts +1 -1
- package/dist/components/pagination/index.mjs +13 -5
- package/dist/components/password-input/index.d.mts +1 -1
- package/dist/components/password-input/index.mjs +13 -5
- package/dist/components/pin-input/index.d.mts +1 -1
- package/dist/components/pin-input/index.mjs +13 -5
- package/dist/components/popconfirm/index.d.mts +3 -1
- package/dist/components/popconfirm/index.mjs +16 -8
- package/dist/components/popover/index.d.mts +19 -1
- package/dist/components/popover/index.mjs +91 -2
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +9 -1
- package/dist/components/progress/index.d.mts +1 -1
- package/dist/components/progress/index.mjs +13 -5
- package/dist/components/progress-group/index.d.mts +3 -1
- package/dist/components/progress-group/index.mjs +4 -3
- package/dist/components/qr-code/index.d.mts +5 -1
- package/dist/components/qr-code/index.mjs +13 -1
- package/dist/components/radio-group/index.d.mts +1 -1
- package/dist/components/radio-group/index.mjs +13 -5
- package/dist/components/rating-group/index.d.mts +2 -2
- package/dist/components/rating-group/index.mjs +13 -5
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +5 -3
- package/dist/components/scroll-area/index.d.mts +5 -1
- package/dist/components/scroll-area/index.mjs +13 -1
- package/dist/components/segment-group/index.d.mts +1 -1
- package/dist/components/segment-group/index.mjs +11 -6
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +3 -1
- package/dist/components/separator/index.mjs +3 -2
- package/dist/components/signature-pad/index.d.mts +5 -1
- package/dist/components/signature-pad/index.mjs +13 -1
- package/dist/components/skeleton/index.d.mts +3 -1
- package/dist/components/skeleton/index.mjs +3 -2
- package/dist/components/slider/index.d.mts +1 -1
- package/dist/components/slider/index.mjs +13 -5
- package/dist/components/spinner/index.d.mts +3 -1
- package/dist/components/spinner/index.mjs +3 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +14 -3
- package/dist/components/splitter/index.d.mts +5 -1
- package/dist/components/splitter/index.mjs +13 -1
- package/dist/components/spotlight/index.d.mts +3 -1
- package/dist/components/spotlight/index.mjs +3 -2
- package/dist/components/stack/index.d.mts +3 -1
- package/dist/components/stack/index.mjs +6 -5
- package/dist/components/steps/index.d.mts +20 -3
- package/dist/components/steps/index.mjs +66 -7
- package/dist/components/swap/index.d.mts +5 -1
- package/dist/components/swap/index.mjs +13 -1
- package/dist/components/switch/index.d.mts +1 -1
- package/dist/components/switch/index.mjs +13 -5
- package/dist/components/table/index.d.mts +3 -1
- package/dist/components/table/index.mjs +169 -151
- package/dist/components/tabs/index.d.mts +20 -2
- package/dist/components/tabs/index.mjs +59 -3
- package/dist/components/tags-input/index.d.mts +1 -1
- package/dist/components/tags-input/index.mjs +13 -5
- package/dist/components/terminal/index.d.mts +3 -1
- package/dist/components/terminal/index.mjs +3 -2
- package/dist/components/textarea/index.d.mts +3 -1
- package/dist/components/textarea/index.mjs +3 -2
- package/dist/components/timer/index.d.mts +5 -1
- package/dist/components/timer/index.mjs +13 -1
- package/dist/components/toast/index.d.mts +8 -2
- package/dist/components/toast/index.mjs +14 -2
- package/dist/components/toc/index.d.mts +11 -2
- package/dist/components/toc/index.mjs +1 -1
- package/dist/components/toggle/index.d.mts +5 -1
- package/dist/components/toggle/index.mjs +13 -1
- package/dist/components/toggle-group/index.d.mts +1 -1
- package/dist/components/toggle-group/index.mjs +13 -5
- package/dist/components/toolbar/index.d.mts +3 -1
- package/dist/components/toolbar/index.mjs +3 -2
- package/dist/components/tooltip/index.d.mts +16 -1
- package/dist/components/tooltip/index.mjs +55 -2
- package/dist/components/tour/index.d.mts +16 -3
- package/dist/components/tour/index.mjs +74 -9
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +54 -50
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +37 -30
- package/dist/components/tree-view/index.d.mts +1 -8
- package/dist/components/tree-view/index.mjs +16 -21
- package/dist/components/user/index.d.mts +3 -1
- package/dist/components/user/index.mjs +8 -2
- package/dist/components/virtual-list/index.d.mts +3 -1
- package/dist/components/virtual-list/index.mjs +13 -9
- package/dist/components/watermark/index.d.mts +3 -1
- package/dist/components/watermark/index.mjs +4 -3
- package/dist/element-dGIhOTJ6.mjs +16 -0
- package/dist/family-Cmd8HEyK.mjs +11 -0
- package/dist/icon-DTqmJCd5.mjs +48 -0
- package/dist/id-2ygNzPHF.mjs +12 -0
- package/dist/image-viewer-B9A5lXsk.mjs +228 -0
- package/dist/{index-B1xiJ5ki.d.mts → index-B1-quIrl.d.mts} +6 -2
- package/dist/{index-DDX7x8aT.d.mts → index-DEArHiFI.d.mts} +16 -7
- package/dist/index-DhripUtf.d.mts +39 -0
- package/dist/{index-YPUiqD3n.d.mts → index-ID48LCMU.d.mts} +28 -2
- package/dist/{index-IfofF-SW.d.mts → index-nFXK_8hJ.d.mts} +53 -23
- package/dist/index-wW28BYf1.d.mts +124 -0
- package/dist/index.d.mts +23 -22
- package/dist/index.mjs +13 -12
- package/dist/{input-DoFQ7RXh.mjs → input-CPAJdwDb.mjs} +3 -2
- package/dist/media-player-BC8D_d29.mjs +796 -0
- package/dist/{mentions-f5Js_2W7.mjs → mentions-CeG5u8Qm.mjs} +67 -51
- package/dist/select-7YjMSBGx.mjs +292 -0
- package/dist/{toc-CZmYEaQR.mjs → toc-DYKaKQ_X.mjs} +12 -2
- package/package.json +3 -3
- package/dist/chevron-D5RzcayK.mjs +0 -9
- package/dist/index-DdsnfV4f.d.mts +0 -16
- package/dist/select-CX6OuQlU.mjs +0 -123
|
@@ -1,10 +1,99 @@
|
|
|
1
|
+
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
3
|
+
import { n as withElementProps, t as isElement } from "../../element-dGIhOTJ6.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
5
|
+
import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
|
|
6
|
+
import { Show, createComponent as createComponent$1, mergeProps as mergeProps$1 } from "solid-js";
|
|
2
7
|
import { HoverCard as HoverCard$1 } from "@ark-ui/solid/hover-card";
|
|
3
|
-
//#region src/components/hover-card/index.
|
|
8
|
+
//#region src/components/hover-card/index.tsx
|
|
9
|
+
var _tmpl$ = /* @__PURE__ */ template(`<h3>`);
|
|
10
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<p>`);
|
|
4
11
|
/** Ark's HoverCard, dressed in the paper-and-ink system: a preview card
|
|
5
12
|
* that dissolves in over a quiet inline link, never stealing focus. The
|
|
6
13
|
* API is Ark's own — Root, Trigger, Positioner, Content, Arrow, ArrowTip. */
|
|
7
|
-
|
|
14
|
+
function HoverCardRoot(props) {
|
|
15
|
+
const id = useElementId("hover-card", () => props.id);
|
|
16
|
+
return createComponent$1(HoverCard$1.Root, mergeProps$1(props, { get id() {
|
|
17
|
+
return id();
|
|
18
|
+
} }));
|
|
19
|
+
}
|
|
20
|
+
function HoverCardFacade(props) {
|
|
21
|
+
injectComponentStyle("hover-card");
|
|
22
|
+
const triggerElement = () => isElement(props.trigger) ? props.trigger : void 0;
|
|
23
|
+
const triggerChildren = () => triggerElement() ? void 0 : props.trigger;
|
|
24
|
+
const triggerAsChild = (propsFn) => {
|
|
25
|
+
const trigger = triggerElement();
|
|
26
|
+
return trigger ? withElementProps(trigger, propsFn()) : props.trigger;
|
|
27
|
+
};
|
|
28
|
+
return createComponent(HoverCardRoot, mergeProps(() => {
|
|
29
|
+
return props.open === void 0 ? {} : { open: props.open };
|
|
30
|
+
}, () => {
|
|
31
|
+
return props.defaultOpen === void 0 ? {} : { defaultOpen: props.defaultOpen };
|
|
32
|
+
}, () => {
|
|
33
|
+
return props.placement === void 0 ? {} : { positioning: { placement: props.placement } };
|
|
34
|
+
}, {
|
|
35
|
+
onOpenChange: (details) => props.onOpenChange?.(details.open),
|
|
36
|
+
get children() {
|
|
37
|
+
return [createComponent(HoverCard$1.Trigger, {
|
|
38
|
+
get disabled() {
|
|
39
|
+
return props.disabled;
|
|
40
|
+
},
|
|
41
|
+
get asChild() {
|
|
42
|
+
return triggerElement() ? triggerAsChild : void 0;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
return triggerChildren();
|
|
46
|
+
}
|
|
47
|
+
}), createComponent(HoverCard$1.Positioner, { get children() {
|
|
48
|
+
return createComponent(HoverCard$1.Content, { get children() {
|
|
49
|
+
return [
|
|
50
|
+
createComponent(HoverCard$1.Arrow, { get children() {
|
|
51
|
+
return createComponent(HoverCard$1.ArrowTip, {});
|
|
52
|
+
} }),
|
|
53
|
+
(() => {
|
|
54
|
+
var _el$ = _tmpl$();
|
|
55
|
+
insert(_el$, () => {
|
|
56
|
+
return props.label;
|
|
57
|
+
});
|
|
58
|
+
return _el$;
|
|
59
|
+
})(),
|
|
60
|
+
createComponent(Show, {
|
|
61
|
+
get when() {
|
|
62
|
+
return props.description;
|
|
63
|
+
},
|
|
64
|
+
get children() {
|
|
65
|
+
var _el$2 = _tmpl$2();
|
|
66
|
+
insert(_el$2, () => {
|
|
67
|
+
return props.description;
|
|
68
|
+
});
|
|
69
|
+
return _el$2;
|
|
70
|
+
}
|
|
71
|
+
}),
|
|
72
|
+
createComponent(Show, {
|
|
73
|
+
get when() {
|
|
74
|
+
return props.content;
|
|
75
|
+
},
|
|
76
|
+
get children() {
|
|
77
|
+
var _el$3 = _tmpl$2();
|
|
78
|
+
insert(_el$3, () => {
|
|
79
|
+
return props.content;
|
|
80
|
+
});
|
|
81
|
+
return _el$3;
|
|
82
|
+
}
|
|
83
|
+
}),
|
|
84
|
+
memo(() => {
|
|
85
|
+
return props.children;
|
|
86
|
+
})
|
|
87
|
+
];
|
|
88
|
+
} });
|
|
89
|
+
} })];
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
const HoverCard = defineFamily(HoverCardFacade, {
|
|
94
|
+
...HoverCard$1,
|
|
95
|
+
Root: HoverCardRoot
|
|
96
|
+
});
|
|
8
97
|
injectComponentStyle("hover-card");
|
|
9
98
|
//#endregion
|
|
10
99
|
export { HoverCard };
|
|
@@ -3,9 +3,9 @@ import { IconifyIcon } from "@bysages/core/icons";
|
|
|
3
3
|
//#region src/components/icon/index.d.ts
|
|
4
4
|
/** The inkwell: a standard box that keeps any inline svg at its optical
|
|
5
5
|
* measure and in the text's own ink — the icon carries no pigment and no
|
|
6
|
-
* size of its own. Bring
|
|
7
|
-
*
|
|
8
|
-
* own; the well renders either. */
|
|
6
|
+
* size of its own. Bring an `@bysages/icons` export or any other
|
|
7
|
+
* IconifyIcon through `glyph`, a built-in core-registry name through
|
|
8
|
+
* `name`, or your own svg; the well renders either. */
|
|
9
9
|
export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
10
10
|
/** Size steps follow the surrounding font size; `inherit` is the
|
|
11
11
|
* default — one em of the text the icon sits in. */
|
|
@@ -13,12 +13,13 @@ export interface IconProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
|
13
13
|
/** The accessible name. Without it the icon is presentation-only and
|
|
14
14
|
* hidden from the accessibility tree. */
|
|
15
15
|
label?: string;
|
|
16
|
-
/**
|
|
16
|
+
/** An `@bysages/icons` export or any IconifyIcon. Ignored when children
|
|
17
17
|
* are given — an explicit glyph always wins. */
|
|
18
18
|
glyph?: IconifyIcon;
|
|
19
|
-
/** A
|
|
20
|
-
* themselves. Ignored when `glyph` or children are given. */
|
|
19
|
+
/** A built-in name from the curated core registry. Ignored when `glyph` or children are given. */
|
|
21
20
|
name?: string;
|
|
22
21
|
}
|
|
23
|
-
export declare
|
|
22
|
+
export declare const Icon: ((props: IconProps) => JSX.Element) & {
|
|
23
|
+
Root: (props: IconProps) => JSX.Element;
|
|
24
|
+
};
|
|
24
25
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
@@ -5,7 +6,7 @@ import { getIcon } from "@bysages/core/icons";
|
|
|
5
6
|
//#region src/components/icon/index.tsx
|
|
6
7
|
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
7
8
|
var _tmpl$2 = /* @__PURE__ */ template(`<svg fill=currentColor aria-hidden=true>`);
|
|
8
|
-
function Icon(props) {
|
|
9
|
+
const Icon = withSelfRoot(function Icon(props) {
|
|
9
10
|
injectComponentStyle("icon");
|
|
10
11
|
const [own, rest] = splitProps(props, [
|
|
11
12
|
"size",
|
|
@@ -15,7 +16,7 @@ function Icon(props) {
|
|
|
15
16
|
"children"
|
|
16
17
|
]);
|
|
17
18
|
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
|
|
19
|
+
if (own.name && own.children == null && own.glyph == null && !resolved) console.error(`[icons] unknown icon name "${own.name}" — not in the core default registry; pass it explicitly as glyph`);
|
|
19
20
|
var _el$ = _tmpl$();
|
|
20
21
|
spread(_el$, [rest, {
|
|
21
22
|
get role() {
|
|
@@ -49,6 +50,6 @@ function Icon(props) {
|
|
|
49
50
|
})() : null);
|
|
50
51
|
});
|
|
51
52
|
return _el$;
|
|
52
|
-
}
|
|
53
|
+
});
|
|
53
54
|
//#endregion
|
|
54
55
|
export { Icon };
|
|
@@ -2,7 +2,7 @@ import { JSX } from "solid-js";
|
|
|
2
2
|
//#region src/components/image/index.d.ts
|
|
3
3
|
/** A framed picture: while the source loads, the frame keeps the
|
|
4
4
|
* skeleton's breath; the picture dissolves in when it lands; a broken
|
|
5
|
-
* source leaves the `fallback` prop — or the placeholder
|
|
5
|
+
* source leaves the `fallback` prop — or the placeholder icon when the
|
|
6
6
|
* caller has nothing local to say. The frame's size is the consumer's
|
|
7
7
|
* to give. */
|
|
8
8
|
export interface ImageProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
@@ -17,5 +17,7 @@ export interface ImageProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
|
17
17
|
/** What a broken source leaves instead of the picture. */
|
|
18
18
|
fallback?: JSX.Element;
|
|
19
19
|
}
|
|
20
|
-
export declare
|
|
20
|
+
export declare const Image: ((props: ImageProps) => JSX.Element) & {
|
|
21
|
+
Root: (props: ImageProps) => JSX.Element;
|
|
22
|
+
};
|
|
21
23
|
//#endregion
|
|
@@ -1,22 +1,16 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
4
|
+
import { createComponent, effect, insert, ref, setAttribute, spread, template } from "@solidjs/web";
|
|
3
5
|
import { Show, createEffect, createSignal, on, splitProps } from "solid-js";
|
|
4
6
|
//#region src/components/image/index.tsx
|
|
5
|
-
var _tmpl$ = /* @__PURE__ */ template(`<
|
|
6
|
-
var _tmpl$2 = /* @__PURE__ */ template(`<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** The mark for a source that never arrived: a quiet mountain-and-sun,
|
|
11
|
-
* drawn in the stylesheet's stroke and hidden from the reader. */
|
|
12
|
-
function placeholderGlyph() {
|
|
13
|
-
return [
|
|
14
|
-
_tmpl$(),
|
|
15
|
-
_tmpl$2(),
|
|
16
|
-
_tmpl$3()
|
|
17
|
-
];
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div data-scope=image data-part=fallback>`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<figure><img data-scope=image data-part=img decoding=async>`, 1);
|
|
9
|
+
/** The registry icon for a source that never arrived, hidden from the reader. */
|
|
10
|
+
function placeholderIcon() {
|
|
11
|
+
return iconNode("image");
|
|
18
12
|
}
|
|
19
|
-
function Image(props) {
|
|
13
|
+
const Image = withSelfRoot(function Image(props) {
|
|
20
14
|
injectComponentStyle("image");
|
|
21
15
|
const [own, rest] = splitProps(props, [
|
|
22
16
|
"src",
|
|
@@ -28,10 +22,14 @@ function Image(props) {
|
|
|
28
22
|
"fallback"
|
|
29
23
|
]);
|
|
30
24
|
const [state, setState] = createSignal("loading");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
let image;
|
|
26
|
+
createEffect(on(() => own.src, () => {
|
|
27
|
+
setState("loading");
|
|
28
|
+
if (image?.complete) setState(image.naturalWidth > 0 ? "loaded" : "error");
|
|
29
|
+
}));
|
|
30
|
+
var _el$ = _tmpl$2();
|
|
31
|
+
var _el$2 = _el$.firstChild;
|
|
32
|
+
spread(_el$, [rest, {
|
|
35
33
|
"data-scope": "image",
|
|
36
34
|
"data-part": "root",
|
|
37
35
|
get "data-state"() {
|
|
@@ -41,18 +39,21 @@ function Image(props) {
|
|
|
41
39
|
return own.fit ?? "cover";
|
|
42
40
|
}
|
|
43
41
|
}], true);
|
|
44
|
-
_el$
|
|
45
|
-
_el$
|
|
46
|
-
|
|
42
|
+
_el$2.addEventListener("error", () => setState("error"));
|
|
43
|
+
_el$2.addEventListener("load", () => setState("loaded"));
|
|
44
|
+
ref(() => {
|
|
45
|
+
return (element) => image = element;
|
|
46
|
+
}, _el$2);
|
|
47
|
+
insert(_el$, createComponent(Show, {
|
|
47
48
|
get when() {
|
|
48
49
|
return state() === "error";
|
|
49
50
|
},
|
|
50
51
|
get children() {
|
|
51
|
-
var _el$
|
|
52
|
-
insert(_el$
|
|
53
|
-
return own.fallback ??
|
|
52
|
+
var _el$3 = _tmpl$();
|
|
53
|
+
insert(_el$3, () => {
|
|
54
|
+
return own.fallback ?? placeholderIcon();
|
|
54
55
|
});
|
|
55
|
-
return _el$
|
|
56
|
+
return _el$3;
|
|
56
57
|
}
|
|
57
58
|
}), null);
|
|
58
59
|
effect(() => {
|
|
@@ -64,13 +65,13 @@ function Image(props) {
|
|
|
64
65
|
i: own.loading ?? "lazy"
|
|
65
66
|
};
|
|
66
67
|
}, ({ e, t, a, o, i }, _p$) => {
|
|
67
|
-
e !== _p$?.e && setAttribute(_el$
|
|
68
|
-
t !== _p$?.t && setAttribute(_el$
|
|
69
|
-
a !== _p$?.a && setAttribute(_el$
|
|
70
|
-
o !== _p$?.o && setAttribute(_el$
|
|
71
|
-
i !== _p$?.i && setAttribute(_el$
|
|
68
|
+
e !== _p$?.e && setAttribute(_el$2, "src", e);
|
|
69
|
+
t !== _p$?.t && setAttribute(_el$2, "alt", t);
|
|
70
|
+
a !== _p$?.a && setAttribute(_el$2, "width", a);
|
|
71
|
+
o !== _p$?.o && setAttribute(_el$2, "height", o);
|
|
72
|
+
i !== _p$?.i && setAttribute(_el$2, "loading", i);
|
|
72
73
|
});
|
|
73
|
-
return _el
|
|
74
|
-
}
|
|
74
|
+
return _el$;
|
|
75
|
+
});
|
|
75
76
|
//#endregion
|
|
76
77
|
export { Image };
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
1
2
|
import { ImageCropper as ImageCropper$1 } from "@ark-ui/solid/image-cropper";
|
|
2
3
|
//#region src/components/image-cropper/index.d.ts
|
|
3
4
|
/** Ark's ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
4
5
|
* holding the photograph, one lit selection window framed by light hairlines.
|
|
5
6
|
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
6
7
|
* Context. */
|
|
7
|
-
|
|
8
|
+
declare function ImageCropperRoot(props: ComponentProps<typeof ImageCropper$1.Root>): import("solid-js").JSX.Element;
|
|
9
|
+
export declare const ImageCropper: typeof ImageCropperRoot & Omit<typeof ImageCropper$1, "Root"> & {
|
|
10
|
+
Root: typeof ImageCropperRoot;
|
|
11
|
+
};
|
|
8
12
|
//#endregion
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
+
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { createComponent, mergeProps } from "solid-js";
|
|
2
5
|
import { ImageCropper as ImageCropper$1 } from "@ark-ui/solid/image-cropper";
|
|
3
6
|
//#region src/components/image-cropper/index.ts
|
|
4
7
|
/** Ark's ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
5
8
|
* holding the photograph, one lit selection window framed by light hairlines.
|
|
6
9
|
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
7
10
|
* Context. */
|
|
8
|
-
|
|
11
|
+
function ImageCropperRoot(props) {
|
|
12
|
+
const id = useElementId("image-cropper", () => props.id);
|
|
13
|
+
return createComponent(ImageCropper$1.Root, mergeProps(props, { get id() {
|
|
14
|
+
return id();
|
|
15
|
+
} }));
|
|
16
|
+
}
|
|
17
|
+
const ImageCropper = defineFamily(ImageCropperRoot, {
|
|
18
|
+
...ImageCropper$1,
|
|
19
|
+
Root: ImageCropperRoot
|
|
20
|
+
});
|
|
9
21
|
injectComponentStyle("image-cropper");
|
|
10
22
|
//#endregion
|
|
11
23
|
export { ImageCropper };
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A lightbox: the picture over a dimmed page, with a small toolbar
|
|
5
|
-
* beneath it. Zoom is the reader's hand (half to three times, clamped),
|
|
6
|
-
* a quarter turn at a time rotates, Escape and the scrim close — the
|
|
7
|
-
* dialog machine carries the modal part. `open` may stay with the
|
|
8
|
-
* caller; left undefined the viewer keeps it to itself.
|
|
9
|
-
*/
|
|
10
|
-
export interface ImageViewerProps {
|
|
11
|
-
src: string;
|
|
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;
|
|
17
|
-
open?: boolean;
|
|
18
|
-
zoomable?: boolean;
|
|
19
|
-
/** The openness changed — from the scrim, Escape or the toolbar. */
|
|
20
|
-
onOpenChange?: (open: boolean) => void;
|
|
21
|
-
}
|
|
22
|
-
export declare function ImageViewer(props: ImageViewerProps): JSX.Element;
|
|
23
|
-
//#endregion
|
|
1
|
+
import { n as ImageViewerProps, t as ImageViewer } from "../../index-DhripUtf.mjs";
|
|
2
|
+
export { ImageViewer, ImageViewerProps };
|
|
@@ -1,160 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
5
|
-
import { createComponent, effect, insert, memo, setAttribute, setStyleProperty, template } from "@solidjs/web";
|
|
6
|
-
import { Show, createEffect, createSignal, splitProps } from "solid-js";
|
|
7
|
-
import { Portal } from "solid-js/web";
|
|
8
|
-
import { Dialog } from "@ark-ui/solid/dialog";
|
|
9
|
-
//#region src/components/image-viewer/index.tsx
|
|
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>`);
|
|
21
|
-
const MIN_SCALE = .5;
|
|
22
|
-
const MAX_SCALE = 3;
|
|
23
|
-
const SCALE_STEP = .25;
|
|
24
|
-
/** The toolbar's line-drawn glyphs, fresh per render. */
|
|
25
|
-
const TOOL_GLYPHS = {
|
|
26
|
-
zoomIn: () => [
|
|
27
|
-
_tmpl$(),
|
|
28
|
-
_tmpl$2(),
|
|
29
|
-
_tmpl$3(),
|
|
30
|
-
_tmpl$4()
|
|
31
|
-
],
|
|
32
|
-
zoomOut: () => [
|
|
33
|
-
_tmpl$(),
|
|
34
|
-
_tmpl$2(),
|
|
35
|
-
_tmpl$3()
|
|
36
|
-
],
|
|
37
|
-
rotate: () => [_tmpl$5(), _tmpl$6()],
|
|
38
|
-
close: () => [_tmpl$7(), _tmpl$8()]
|
|
39
|
-
};
|
|
40
|
-
function ImageViewer(props) {
|
|
41
|
-
injectComponentStyle("image-viewer");
|
|
42
|
-
const [own] = splitProps(props, [
|
|
43
|
-
"src",
|
|
44
|
-
"alt",
|
|
45
|
-
"width",
|
|
46
|
-
"height",
|
|
47
|
-
"open",
|
|
48
|
-
"zoomable",
|
|
49
|
-
"onOpenChange"
|
|
50
|
-
]);
|
|
51
|
-
const messages = useComponentMessages();
|
|
52
|
-
const [localOpen, setLocalOpen] = createSignal(false);
|
|
53
|
-
const [scale, setScale] = createSignal(1);
|
|
54
|
-
const [rotation, setRotation] = createSignal(0);
|
|
55
|
-
const isOpen = () => own.open ?? localOpen();
|
|
56
|
-
const setOpen = (value) => {
|
|
57
|
-
if (own.open === void 0) setLocalOpen(value);
|
|
58
|
-
own.onOpenChange?.(value);
|
|
59
|
-
};
|
|
60
|
-
createEffect(() => {
|
|
61
|
-
if (isOpen()) {
|
|
62
|
-
setScale(1);
|
|
63
|
-
setRotation(0);
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
function zoom(step) {
|
|
67
|
-
setScale(Math.min(MAX_SCALE, Math.max(MIN_SCALE, scale() + step)));
|
|
68
|
-
}
|
|
69
|
-
function rotate() {
|
|
70
|
-
setRotation((rotation() + 90) % 360);
|
|
71
|
-
}
|
|
72
|
-
function toolButton(label, glyph, onClick) {
|
|
73
|
-
return createComponent(Button, {
|
|
74
|
-
variant: "ghost",
|
|
75
|
-
square: true,
|
|
76
|
-
size: "lg",
|
|
77
|
-
"aria-label": label,
|
|
78
|
-
onClick,
|
|
79
|
-
get children() {
|
|
80
|
-
var _el$12 = _tmpl$9();
|
|
81
|
-
insert(_el$12, glyph);
|
|
82
|
-
return _el$12;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return createComponent(Dialog.Root, {
|
|
87
|
-
get open() {
|
|
88
|
-
return isOpen();
|
|
89
|
-
},
|
|
90
|
-
onOpenChange: (details) => setOpen(details.open),
|
|
91
|
-
lazyMount: true,
|
|
92
|
-
unmountOnExit: true,
|
|
93
|
-
get children() {
|
|
94
|
-
return createComponent(Portal, { get children() {
|
|
95
|
-
return [createComponent(Dialog.Backdrop, { class: "bs-image-viewer-backdrop" }), createComponent(Dialog.Positioner, {
|
|
96
|
-
class: "bs-image-viewer-positioner",
|
|
97
|
-
get children() {
|
|
98
|
-
return createComponent(Dialog.Content, {
|
|
99
|
-
class: "bs-image-viewer-content",
|
|
100
|
-
get "aria-label"() {
|
|
101
|
-
return own.alt || "Image preview";
|
|
102
|
-
},
|
|
103
|
-
onClick: (event) => {
|
|
104
|
-
if (event.target === event.currentTarget) setOpen(false);
|
|
105
|
-
},
|
|
106
|
-
get children() {
|
|
107
|
-
return [(() => {
|
|
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);
|
|
123
|
-
});
|
|
124
|
-
return _el$13;
|
|
125
|
-
})(), (() => {
|
|
126
|
-
var _el$14 = _tmpl$11();
|
|
127
|
-
insert(_el$14, createComponent(ButtonGroup, { get children() {
|
|
128
|
-
return [
|
|
129
|
-
createComponent(Show, {
|
|
130
|
-
get when() {
|
|
131
|
-
return own.zoomable ?? true;
|
|
132
|
-
},
|
|
133
|
-
get children() {
|
|
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
|
-
})];
|
|
139
|
-
}
|
|
140
|
-
}),
|
|
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
|
-
})
|
|
147
|
-
];
|
|
148
|
-
} }));
|
|
149
|
-
return _el$14;
|
|
150
|
-
})()];
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
})];
|
|
155
|
-
} });
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
//#endregion
|
|
1
|
+
import "../button-group/index.mjs";
|
|
2
|
+
import "../dialog/index.mjs";
|
|
3
|
+
import { t as ImageViewer } from "../../image-viewer-B9A5lXsk.mjs";
|
|
160
4
|
export { ImageViewer };
|
|
@@ -15,5 +15,7 @@ export interface InputProps extends JSX.InputHTMLAttributes<HTMLInputElement> {
|
|
|
15
15
|
* the label id, the described-by wiring and the invalid state for free,
|
|
16
16
|
* which is also the seam the Form validation layer will drive. Disabled
|
|
17
17
|
* rides the native attribute. */
|
|
18
|
-
export declare
|
|
18
|
+
export declare const Input: ((props: InputProps) => JSX.Element) & {
|
|
19
|
+
Root: (props: InputProps) => JSX.Element;
|
|
20
|
+
};
|
|
19
21
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Input } from "../../input-
|
|
1
|
+
import { t as Input } from "../../input-CPAJdwDb.mjs";
|
|
2
2
|
export { Input };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
2
|
+
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
|
|
2
3
|
//#region src/components/json-tree-view/index.d.ts
|
|
3
4
|
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
4
5
|
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
5
6
|
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
6
|
-
declare function
|
|
7
|
-
export declare const JsonTreeView: Omit<typeof JsonTreeView$1, "
|
|
8
|
-
|
|
7
|
+
declare function JsonTreeViewRoot(props: ComponentProps<typeof JsonTreeView$1.Root>): import("solid-js").JSX.Element;
|
|
8
|
+
export declare const JsonTreeView: typeof JsonTreeViewRoot & Omit<typeof JsonTreeView$1, "Root"> & {
|
|
9
|
+
Root: typeof JsonTreeViewRoot;
|
|
9
10
|
};
|
|
10
11
|
//#endregion
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
+
import { t as defineFamily } from "../../family-Cmd8HEyK.mjs";
|
|
2
|
+
import { r as iconNode } from "../../icon-DTqmJCd5.mjs";
|
|
3
|
+
import { t as useElementId } from "../../id-2ygNzPHF.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent,
|
|
5
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
6
|
+
import { createComponent as createComponent$1, mergeProps as mergeProps$1 } from "solid-js";
|
|
3
7
|
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/solid/json-tree-view";
|
|
4
|
-
import { chevron_right } from "@bysages/icons";
|
|
5
8
|
//#region src/components/json-tree-view/index.tsx
|
|
6
|
-
var _tmpl$ = /* @__PURE__ */ template(`<svg aria-hidden=true>`);
|
|
7
9
|
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
8
10
|
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
9
11
|
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
12
|
+
function JsonTreeViewRoot(props) {
|
|
13
|
+
const id = useElementId("json-tree-view", () => props.id);
|
|
14
|
+
return createComponent$1(JsonTreeView$1.Root, mergeProps$1(props, { get id() {
|
|
15
|
+
return id();
|
|
16
|
+
} }));
|
|
17
|
+
}
|
|
10
18
|
function JsonTreeViewTree(props) {
|
|
11
19
|
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
|
-
})();
|
|
20
|
+
return props.arrow ?? iconNode("chevron-right");
|
|
25
21
|
} }));
|
|
26
22
|
}
|
|
27
|
-
const JsonTreeView = {
|
|
23
|
+
const JsonTreeView = defineFamily(JsonTreeViewRoot, {
|
|
28
24
|
...JsonTreeView$1,
|
|
25
|
+
Root: JsonTreeViewRoot,
|
|
29
26
|
Tree: JsonTreeViewTree
|
|
30
|
-
};
|
|
27
|
+
});
|
|
31
28
|
injectComponentStyle("json-tree-view");
|
|
32
29
|
//#endregion
|
|
33
30
|
export { JsonTreeView };
|
|
@@ -2,5 +2,7 @@ import { JSX } from "solid-js";
|
|
|
2
2
|
//#region src/components/kbd/index.d.ts
|
|
3
3
|
/** A keycap in miniature, riding the type it annotates. */
|
|
4
4
|
export type KbdProps = JSX.HTMLAttributes<HTMLElement>;
|
|
5
|
-
export declare
|
|
5
|
+
export declare const Kbd: ((props: KbdProps) => JSX.Element) & {
|
|
6
|
+
Root: (props: KbdProps) => JSX.Element;
|
|
7
|
+
};
|
|
6
8
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { spread, template } from "@solidjs/web";
|
|
3
4
|
//#region src/components/kbd/index.tsx
|
|
4
5
|
var _tmpl$ = /* @__PURE__ */ template(`<kbd>`);
|
|
5
|
-
function Kbd(props) {
|
|
6
|
+
const Kbd = withSelfRoot(function Kbd(props) {
|
|
6
7
|
injectComponentStyle("kbd");
|
|
7
8
|
var _el$ = _tmpl$();
|
|
8
9
|
spread(_el$, [props, {
|
|
@@ -10,6 +11,6 @@ function Kbd(props) {
|
|
|
10
11
|
"data-part": "root"
|
|
11
12
|
}], false);
|
|
12
13
|
return _el$;
|
|
13
|
-
}
|
|
14
|
+
});
|
|
14
15
|
//#endregion
|
|
15
16
|
export { Kbd };
|
|
@@ -6,5 +6,7 @@ export interface LinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
|
6
6
|
/** A link is ink in the accent's voice: quiet at rest, deepening under
|
|
7
7
|
* the hand, the halo at focus. The underline follows the prose —
|
|
8
8
|
* always, on hover, or never. */
|
|
9
|
-
export declare
|
|
9
|
+
export declare const Link: ((props: LinkProps) => JSX.Element) & {
|
|
10
|
+
Root: (props: LinkProps) => JSX.Element;
|
|
11
|
+
};
|
|
10
12
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as withSelfRoot } from "../../family-Cmd8HEyK.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { claimElement, spread, template } from "@solidjs/web";
|
|
3
4
|
import { splitProps } from "solid-js";
|
|
@@ -6,7 +7,7 @@ var _tmpl$ = /* @__PURE__ */ template(`<a>`);
|
|
|
6
7
|
/** A link is ink in the accent's voice: quiet at rest, deepening under
|
|
7
8
|
* the hand, the halo at focus. The underline follows the prose —
|
|
8
9
|
* always, on hover, or never. */
|
|
9
|
-
function Link(props) {
|
|
10
|
+
const Link = withSelfRoot(function Link(props) {
|
|
10
11
|
injectComponentStyle("link");
|
|
11
12
|
const [own, rest] = splitProps(props, ["underline"]);
|
|
12
13
|
var _el$ = _tmpl$();
|
|
@@ -19,6 +20,6 @@ function Link(props) {
|
|
|
19
20
|
}
|
|
20
21
|
}], false);
|
|
21
22
|
return _el$;
|
|
22
|
-
}
|
|
23
|
+
});
|
|
23
24
|
//#endregion
|
|
24
25
|
export { Link };
|