@bysages/solid 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/ai-response-ClGGptX3.mjs +139 -0
- package/dist/chevron-D5RzcayK.mjs +9 -0
- package/dist/components/accordion/index.d.mts +7 -0
- package/dist/components/accordion/index.mjs +10 -0
- package/dist/components/affix/index.d.mts +20 -0
- package/dist/components/affix/index.mjs +33 -0
- package/dist/components/ai/index.d.mts +2 -0
- package/dist/components/ai/index.mjs +71 -0
- package/dist/components/ai-action/index.d.mts +13 -0
- package/dist/components/ai-action/index.mjs +27 -0
- package/dist/components/ai-attachments/index.d.mts +20 -0
- package/dist/components/ai-attachments/index.mjs +110 -0
- package/dist/components/ai-message/index.d.mts +13 -0
- package/dist/components/ai-message/index.mjs +22 -0
- package/dist/components/ai-prompt-input/index.d.mts +45 -0
- package/dist/components/ai-prompt-input/index.mjs +153 -0
- package/dist/components/ai-reasoning/index.d.mts +13 -0
- package/dist/components/ai-reasoning/index.mjs +38 -0
- package/dist/components/ai-response/index.d.mts +20 -0
- package/dist/components/ai-response/index.mjs +2 -0
- package/dist/components/ai-source/index.d.mts +13 -0
- package/dist/components/ai-source/index.mjs +36 -0
- package/dist/components/ai-suggestion/index.d.mts +13 -0
- package/dist/components/ai-suggestion/index.mjs +22 -0
- package/dist/components/ai-tool/index.d.mts +23 -0
- package/dist/components/ai-tool/index.mjs +90 -0
- package/dist/components/alert/index.d.mts +22 -0
- package/dist/components/alert/index.mjs +87 -0
- package/dist/components/angle-slider/index.d.mts +15 -0
- package/dist/components/angle-slider/index.mjs +18 -0
- package/dist/components/aspect-ratio/index.d.mts +10 -0
- package/dist/components/aspect-ratio/index.mjs +23 -0
- package/dist/components/autocomplete/index.d.mts +21 -0
- package/dist/components/autocomplete/index.mjs +76 -0
- package/dist/components/avatar/index.d.mts +23 -0
- package/dist/components/avatar/index.mjs +20 -0
- package/dist/components/avatar-group/index.d.mts +11 -0
- package/dist/components/avatar-group/index.mjs +20 -0
- package/dist/components/back-top/index.d.mts +29 -0
- package/dist/components/back-top/index.mjs +93 -0
- package/dist/components/badge/index.d.mts +10 -0
- package/dist/components/badge/index.mjs +23 -0
- package/dist/components/banner/index.d.mts +24 -0
- package/dist/components/banner/index.mjs +67 -0
- 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.d.mts +11 -0
- package/dist/components/breadcrumb/index.mjs +45 -0
- package/dist/components/browser/index.d.mts +21 -0
- package/dist/components/browser/index.mjs +87 -0
- package/dist/components/button/index.d.mts +15 -0
- package/dist/components/button/index.mjs +43 -0
- package/dist/components/button-group/index.d.mts +23 -0
- package/dist/components/button-group/index.mjs +38 -0
- package/dist/components/calendar/index.d.mts +17 -0
- package/dist/components/calendar/index.mjs +209 -0
- package/dist/components/card/index.d.mts +11 -0
- package/dist/components/card/index.mjs +33 -0
- package/dist/components/carousel/index.d.mts +9 -0
- package/dist/components/carousel/index.mjs +12 -0
- package/dist/components/cascade-select/index.d.mts +31 -0
- package/dist/components/cascade-select/index.mjs +304 -0
- package/dist/components/checkbox/index.d.mts +15 -0
- package/dist/components/checkbox/index.mjs +18 -0
- package/dist/components/checkbox-group/index.d.mts +28 -0
- package/dist/components/checkbox-group/index.mjs +97 -0
- package/dist/components/chip/index.d.mts +12 -0
- package/dist/components/chip/index.mjs +36 -0
- package/dist/components/client-only/index.d.mts +2 -0
- package/dist/components/client-only/index.mjs +2 -0
- package/dist/components/clipboard/index.d.mts +16 -0
- package/dist/components/clipboard/index.mjs +19 -0
- package/dist/components/collapsible/index.d.mts +7 -0
- package/dist/components/collapsible/index.mjs +10 -0
- package/dist/components/collection/index.d.mts +2 -0
- package/dist/components/collection/index.mjs +2 -0
- package/dist/components/color-picker/index.d.mts +19 -0
- package/dist/components/color-picker/index.mjs +18 -0
- package/dist/components/combobox/index.d.mts +17 -0
- package/dist/components/combobox/index.mjs +18 -0
- package/dist/components/command/index.d.mts +43 -0
- package/dist/components/command/index.mjs +253 -0
- package/dist/components/comment/index.d.mts +17 -0
- package/dist/components/comment/index.mjs +101 -0
- package/dist/components/config-provider/index.d.mts +48 -0
- package/dist/components/config-provider/index.mjs +67 -0
- package/dist/components/container/index.d.mts +13 -0
- package/dist/components/container/index.mjs +23 -0
- package/dist/components/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +110 -0
- package/dist/components/date-input/index.d.mts +15 -0
- package/dist/components/date-input/index.mjs +18 -0
- package/dist/components/date-picker/index.d.mts +17 -0
- package/dist/components/date-picker/index.mjs +18 -0
- 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 +26 -0
- package/dist/components/descriptions/index.mjs +69 -0
- package/dist/components/dialog/index.d.mts +9 -0
- package/dist/components/dialog/index.mjs +11 -0
- package/dist/components/dock/index.d.mts +22 -0
- package/dist/components/dock/index.mjs +64 -0
- package/dist/components/download-trigger/index.d.mts +2 -0
- package/dist/components/download-trigger/index.mjs +2 -0
- package/dist/components/drawer/index.d.mts +9 -0
- package/dist/components/drawer/index.mjs +12 -0
- package/dist/components/dynamic-input/index.d.mts +30 -0
- package/dist/components/dynamic-input/index.mjs +119 -0
- package/dist/components/editable/index.d.mts +15 -0
- package/dist/components/editable/index.mjs +18 -0
- package/dist/components/ellipsis/index.d.mts +10 -0
- package/dist/components/ellipsis/index.mjs +27 -0
- package/dist/components/empty/index.d.mts +10 -0
- package/dist/components/empty/index.mjs +31 -0
- package/dist/components/field/index.d.mts +8 -0
- package/dist/components/field/index.mjs +11 -0
- package/dist/components/fieldset/index.d.mts +7 -0
- package/dist/components/fieldset/index.mjs +10 -0
- package/dist/components/file-upload/index.d.mts +17 -0
- package/dist/components/file-upload/index.mjs +18 -0
- package/dist/components/float-button/index.d.mts +61 -0
- package/dist/components/float-button/index.mjs +129 -0
- package/dist/components/floating-panel/index.d.mts +9 -0
- package/dist/components/floating-panel/index.mjs +12 -0
- package/dist/components/focus-trap/index.d.mts +2 -0
- package/dist/components/focus-trap/index.mjs +2 -0
- package/dist/components/form/index.d.mts +2 -0
- package/dist/components/form/index.mjs +125 -0
- package/dist/components/format/index.d.mts +9 -0
- package/dist/components/format/index.mjs +10 -0
- package/dist/components/frame/index.d.mts +10 -0
- package/dist/components/frame/index.mjs +12 -0
- package/dist/components/grid/index.d.mts +13 -0
- package/dist/components/grid/index.mjs +42 -0
- package/dist/components/highlight/index.d.mts +7 -0
- package/dist/components/highlight/index.mjs +11 -0
- package/dist/components/hover-card/index.d.mts +7 -0
- package/dist/components/hover-card/index.mjs +10 -0
- package/dist/components/icon/index.d.mts +24 -0
- package/dist/components/icon/index.mjs +54 -0
- package/dist/components/image/index.d.mts +17 -0
- package/dist/components/image/index.mjs +70 -0
- package/dist/components/image-cropper/index.d.mts +8 -0
- package/dist/components/image-cropper/index.mjs +11 -0
- package/dist/components/image-viewer/index.d.mts +19 -0
- package/dist/components/image-viewer/index.mjs +152 -0
- package/dist/components/input/index.d.mts +19 -0
- package/dist/components/input/index.mjs +2 -0
- package/dist/components/input-group/index.d.mts +18 -0
- package/dist/components/input-group/index.mjs +36 -0
- package/dist/components/json-tree-view/index.d.mts +7 -0
- package/dist/components/json-tree-view/index.mjs +10 -0
- package/dist/components/kbd/index.d.mts +6 -0
- package/dist/components/kbd/index.mjs +15 -0
- package/dist/components/layout/index.d.mts +60 -0
- package/dist/components/layout/index.mjs +192 -0
- package/dist/components/link/index.d.mts +10 -0
- package/dist/components/link/index.mjs +24 -0
- package/dist/components/list/index.d.mts +26 -0
- package/dist/components/list/index.mjs +97 -0
- package/dist/components/listbox/index.d.mts +17 -0
- package/dist/components/listbox/index.mjs +19 -0
- package/dist/components/marquee/index.d.mts +7 -0
- package/dist/components/marquee/index.mjs +10 -0
- package/dist/components/masonry/index.d.mts +11 -0
- package/dist/components/masonry/index.mjs +34 -0
- package/dist/components/mentions/index.d.mts +2 -0
- package/dist/components/mentions/index.mjs +3 -0
- package/dist/components/menu/index.d.mts +13 -0
- package/dist/components/menu/index.mjs +38 -0
- package/dist/components/menubar/index.d.mts +32 -0
- package/dist/components/menubar/index.mjs +83 -0
- package/dist/components/meter/index.d.mts +21 -0
- package/dist/components/meter/index.mjs +95 -0
- package/dist/components/navigation-menu/index.d.mts +8 -0
- package/dist/components/navigation-menu/index.mjs +11 -0
- package/dist/components/number-input/index.d.mts +15 -0
- package/dist/components/number-input/index.mjs +18 -0
- package/dist/components/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +160 -0
- package/dist/components/page-header/index.d.mts +11 -0
- package/dist/components/page-header/index.mjs +34 -0
- package/dist/components/pagination/index.d.mts +17 -0
- package/dist/components/pagination/index.mjs +18 -0
- package/dist/components/password-input/index.d.mts +15 -0
- package/dist/components/password-input/index.mjs +18 -0
- package/dist/components/pin-input/index.d.mts +14 -0
- package/dist/components/pin-input/index.mjs +18 -0
- package/dist/components/popconfirm/index.d.mts +17 -0
- package/dist/components/popconfirm/index.mjs +85 -0
- package/dist/components/popover/index.d.mts +8 -0
- package/dist/components/popover/index.mjs +11 -0
- package/dist/components/presence/index.d.mts +2 -0
- package/dist/components/presence/index.mjs +2 -0
- package/dist/components/progress/index.d.mts +15 -0
- package/dist/components/progress/index.mjs +18 -0
- package/dist/components/progress-group/index.d.mts +22 -0
- package/dist/components/progress-group/index.mjs +84 -0
- package/dist/components/qr-code/index.d.mts +8 -0
- package/dist/components/qr-code/index.mjs +11 -0
- package/dist/components/radio-group/index.d.mts +15 -0
- package/dist/components/radio-group/index.mjs +18 -0
- package/dist/components/rating-group/index.d.mts +15 -0
- package/dist/components/rating-group/index.mjs +18 -0
- package/dist/components/result/index.d.mts +22 -0
- package/dist/components/result/index.mjs +66 -0
- package/dist/components/scroll-area/index.d.mts +7 -0
- package/dist/components/scroll-area/index.mjs +10 -0
- package/dist/components/segment-group/index.d.mts +17 -0
- package/dist/components/segment-group/index.mjs +23 -0
- package/dist/components/select/index.d.mts +2 -0
- package/dist/components/select/index.mjs +2 -0
- package/dist/components/separator/index.d.mts +11 -0
- package/dist/components/separator/index.mjs +27 -0
- package/dist/components/signature-pad/index.d.mts +8 -0
- package/dist/components/signature-pad/index.mjs +11 -0
- package/dist/components/skeleton/index.d.mts +7 -0
- package/dist/components/skeleton/index.mjs +15 -0
- package/dist/components/slider/index.d.mts +15 -0
- package/dist/components/slider/index.mjs +18 -0
- package/dist/components/spinner/index.d.mts +9 -0
- package/dist/components/spinner/index.mjs +26 -0
- package/dist/components/split-button/index.d.mts +36 -0
- package/dist/components/split-button/index.mjs +124 -0
- package/dist/components/splitter/index.d.mts +7 -0
- package/dist/components/splitter/index.mjs +10 -0
- package/dist/components/spotlight/index.d.mts +11 -0
- package/dist/components/spotlight/index.mjs +38 -0
- package/dist/components/stack/index.d.mts +11 -0
- package/dist/components/stack/index.mjs +45 -0
- package/dist/components/stat/index.d.mts +17 -0
- package/dist/components/stat/index.mjs +44 -0
- package/dist/components/steps/index.d.mts +18 -0
- package/dist/components/steps/index.mjs +18 -0
- package/dist/components/swap/index.d.mts +8 -0
- package/dist/components/swap/index.mjs +11 -0
- package/dist/components/switch/index.d.mts +15 -0
- package/dist/components/switch/index.mjs +18 -0
- package/dist/components/table/index.d.mts +77 -0
- package/dist/components/table/index.mjs +837 -0
- package/dist/components/tabs/index.d.mts +19 -0
- package/dist/components/tabs/index.mjs +23 -0
- package/dist/components/tags-input/index.d.mts +16 -0
- package/dist/components/tags-input/index.mjs +18 -0
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +84 -0
- package/dist/components/textarea/index.d.mts +14 -0
- package/dist/components/textarea/index.mjs +37 -0
- package/dist/components/timeline/index.d.mts +15 -0
- package/dist/components/timeline/index.mjs +44 -0
- package/dist/components/timer/index.d.mts +8 -0
- package/dist/components/timer/index.mjs +11 -0
- package/dist/components/toast/index.d.mts +11 -0
- package/dist/components/toast/index.mjs +13 -0
- package/dist/components/toc/index.d.mts +7 -0
- package/dist/components/toc/index.mjs +10 -0
- package/dist/components/toggle/index.d.mts +7 -0
- package/dist/components/toggle/index.mjs +10 -0
- package/dist/components/toggle-group/index.d.mts +14 -0
- package/dist/components/toggle-group/index.mjs +18 -0
- package/dist/components/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +46 -0
- package/dist/components/tooltip/index.d.mts +7 -0
- package/dist/components/tooltip/index.mjs +10 -0
- package/dist/components/tour/index.d.mts +11 -0
- package/dist/components/tour/index.mjs +13 -0
- package/dist/components/transfer/index.d.mts +24 -0
- package/dist/components/transfer/index.mjs +175 -0
- package/dist/components/tree-select/index.d.mts +28 -0
- package/dist/components/tree-select/index.mjs +253 -0
- package/dist/components/tree-view/index.d.mts +18 -0
- package/dist/components/tree-view/index.mjs +19 -0
- package/dist/components/typography/index.d.mts +11 -0
- package/dist/components/typography/index.mjs +34 -0
- package/dist/components/user/index.d.mts +19 -0
- package/dist/components/user/index.mjs +68 -0
- package/dist/components/virtual-list/index.d.mts +17 -0
- package/dist/components/virtual-list/index.mjs +71 -0
- package/dist/components/watermark/index.d.mts +17 -0
- package/dist/components/watermark/index.mjs +77 -0
- package/dist/index-B1xiJ5ki.d.mts +1811 -0
- package/dist/index-DDX7x8aT.d.mts +95 -0
- package/dist/index-IfofF-SW.d.mts +10356 -0
- package/dist/index-YPUiqD3n.d.mts +42 -0
- package/dist/index.d.mts +141 -15209
- package/dist/index.mjs +141 -6171
- package/dist/input-DoFQ7RXh.mjs +78 -0
- package/dist/mentions-f5Js_2W7.mjs +263 -0
- package/dist/select-CHaXbzLX.mjs +115 -0
- package/package.json +101 -7
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { Field } from "../field/index.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { claimElement, createComponent, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
5
|
+
import { Show, splitProps } from "solid-js";
|
|
6
|
+
//#region src/components/ai-prompt-input/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5">`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true><rect x=4.5 y=4.5 width=7 height=7 fill=currentColor>`);
|
|
9
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<div data-scope=ai>`);
|
|
10
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<div data-scope=ai data-part=prompt-footer><div data-scope=ai data-part=prompt-end><!><!>`);
|
|
11
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<form><div data-scope=ai data-part=prompt-main><!><!><!></div><!>`);
|
|
12
|
+
function arrowUpGlyph() {
|
|
13
|
+
return _tmpl$();
|
|
14
|
+
}
|
|
15
|
+
function stopGlyph() {
|
|
16
|
+
return _tmpl$2();
|
|
17
|
+
}
|
|
18
|
+
/** The prompt vessel: the shared field textarea — self-growing on the
|
|
19
|
+
* machine's autoresize — with the submit seal riding its last line.
|
|
20
|
+
* Around the body, the slot props answer the composer's anatomy:
|
|
21
|
+
* `header` for attachments riding above, `leading` for the tools at
|
|
22
|
+
* the text's left, `trailing` for the seal itself, `footer` for the
|
|
23
|
+
* tools beneath, and `footerEnd` for the controls that close the
|
|
24
|
+
* footer row — the seal falls there by default, so a model picker
|
|
25
|
+
* dropped in rides the send's shoulder. An empty slot renders no part,
|
|
26
|
+
* so the bare vessel stays one quiet line. Controlled — bind `value`
|
|
27
|
+
* and take the text on `onSubmit`. Enter sends; Shift+Enter breaks the
|
|
28
|
+
* line. While `busy` the seal becomes a stop seal and Enter holds its
|
|
29
|
+
* breath. */
|
|
30
|
+
function PromptInput(props) {
|
|
31
|
+
injectComponentStyle("ai");
|
|
32
|
+
const [own, rest] = splitProps(props, [
|
|
33
|
+
"value",
|
|
34
|
+
"onValueChange",
|
|
35
|
+
"onSubmit",
|
|
36
|
+
"onStop",
|
|
37
|
+
"placeholder",
|
|
38
|
+
"disabled",
|
|
39
|
+
"busy",
|
|
40
|
+
"header",
|
|
41
|
+
"leading",
|
|
42
|
+
"trailing",
|
|
43
|
+
"footer",
|
|
44
|
+
"footerEnd"
|
|
45
|
+
]);
|
|
46
|
+
const send = () => {
|
|
47
|
+
const value = (own.value ?? "").trim();
|
|
48
|
+
if (!value || own.disabled || own.busy) return;
|
|
49
|
+
own.onSubmit?.(value);
|
|
50
|
+
own.onValueChange?.("");
|
|
51
|
+
};
|
|
52
|
+
const row = (part, content) => content != null ? (() => {
|
|
53
|
+
var _el$3 = _tmpl$3();
|
|
54
|
+
setAttribute(_el$3, "data-part", part);
|
|
55
|
+
insert(_el$3, content);
|
|
56
|
+
return _el$3;
|
|
57
|
+
})() : null;
|
|
58
|
+
const seal = () => own.busy ? createComponent(Button, {
|
|
59
|
+
variant: "solid",
|
|
60
|
+
size: "sm",
|
|
61
|
+
square: true,
|
|
62
|
+
type: "button",
|
|
63
|
+
"aria-label": "Stop",
|
|
64
|
+
get disabled() {
|
|
65
|
+
return own.disabled;
|
|
66
|
+
},
|
|
67
|
+
onClick: () => own.onStop?.(),
|
|
68
|
+
get children() {
|
|
69
|
+
return stopGlyph();
|
|
70
|
+
}
|
|
71
|
+
}) : createComponent(Button, {
|
|
72
|
+
variant: "solid",
|
|
73
|
+
size: "sm",
|
|
74
|
+
square: true,
|
|
75
|
+
type: "submit",
|
|
76
|
+
"aria-label": "Send",
|
|
77
|
+
get disabled() {
|
|
78
|
+
return own.disabled || !(own.value ?? "").trim();
|
|
79
|
+
},
|
|
80
|
+
get children() {
|
|
81
|
+
return arrowUpGlyph();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
const trailing = () => own.footer != null ? own.trailing : own.trailing ?? seal();
|
|
85
|
+
var _el$4 = _tmpl$5();
|
|
86
|
+
var _el$5 = _el$4.firstChild;
|
|
87
|
+
var _el$6 = _el$5.firstChild;
|
|
88
|
+
var _el$7 = _el$6.nextSibling;
|
|
89
|
+
var _el$8 = _el$7.nextSibling;
|
|
90
|
+
var _el$13 = _el$5.nextSibling;
|
|
91
|
+
claimElement(_el$4);
|
|
92
|
+
spread(_el$4, [rest, {
|
|
93
|
+
"data-scope": "ai",
|
|
94
|
+
"data-part": "prompt",
|
|
95
|
+
onSubmit: (event) => {
|
|
96
|
+
event.preventDefault();
|
|
97
|
+
send();
|
|
98
|
+
}
|
|
99
|
+
}], true);
|
|
100
|
+
insert(_el$4, () => {
|
|
101
|
+
return row("prompt-header", own.header);
|
|
102
|
+
}, _el$5);
|
|
103
|
+
insert(_el$5, () => {
|
|
104
|
+
return row("prompt-leading", own.leading);
|
|
105
|
+
}, _el$6);
|
|
106
|
+
insert(_el$5, createComponent(Field.Root, { get children() {
|
|
107
|
+
return createComponent(Field.Textarea, {
|
|
108
|
+
autoresize: true,
|
|
109
|
+
rows: 1,
|
|
110
|
+
get value() {
|
|
111
|
+
return own.value ?? "";
|
|
112
|
+
},
|
|
113
|
+
get placeholder() {
|
|
114
|
+
return own.placeholder ?? "Send a message";
|
|
115
|
+
},
|
|
116
|
+
get disabled() {
|
|
117
|
+
return own.disabled;
|
|
118
|
+
},
|
|
119
|
+
onInput: (event) => own.onValueChange?.(event.currentTarget.value),
|
|
120
|
+
onKeyDown: (event) => {
|
|
121
|
+
if (event.key === "Enter" && !event.shiftKey) {
|
|
122
|
+
event.preventDefault();
|
|
123
|
+
send();
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
} }), _el$7);
|
|
128
|
+
insert(_el$5, () => {
|
|
129
|
+
return row("prompt-trailing", trailing());
|
|
130
|
+
}, _el$8);
|
|
131
|
+
insert(_el$4, createComponent(Show, {
|
|
132
|
+
get when() {
|
|
133
|
+
return own.footer != null;
|
|
134
|
+
},
|
|
135
|
+
get children() {
|
|
136
|
+
var _el$9 = _tmpl$4();
|
|
137
|
+
var _el$10 = _el$9.firstChild;
|
|
138
|
+
var _el$11 = _el$10.firstChild;
|
|
139
|
+
var _el$12 = _el$11.nextSibling;
|
|
140
|
+
insert(_el$9, () => {
|
|
141
|
+
return own.footer;
|
|
142
|
+
}, _el$10);
|
|
143
|
+
insert(_el$10, () => {
|
|
144
|
+
return own.footerEnd;
|
|
145
|
+
}, _el$11);
|
|
146
|
+
insert(_el$10, seal, _el$12);
|
|
147
|
+
return _el$9;
|
|
148
|
+
}
|
|
149
|
+
}), _el$13);
|
|
150
|
+
return _el$4;
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
153
|
+
export { PromptInput as AiPromptInput, PromptInput };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/ai-reasoning/index.d.ts
|
|
3
|
+
export interface ReasoningProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The trigger's words — the fold arrives open under them. */
|
|
5
|
+
label?: string;
|
|
6
|
+
/** The fold arrives open when set — rides the shared collapsible. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** The model's thought, folded by the shared collapsible in its quiet
|
|
10
|
+
* register: bare ink for a trigger, the thought on one hairline. */
|
|
11
|
+
export declare function Reasoning(props: ReasoningProps): JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Reasoning as AiReasoning };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as chevron } from "../../chevron-D5RzcayK.mjs";
|
|
2
|
+
import { Collapsible } from "../collapsible/index.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { createComponent, insert, mergeProps, template } from "@solidjs/web";
|
|
5
|
+
import { splitProps } from "solid-js";
|
|
6
|
+
//#region src/components/ai-reasoning/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div data-scope=ai data-part=reasoning-content>`);
|
|
9
|
+
/** The model's thought, folded by the shared collapsible in its quiet
|
|
10
|
+
* register: bare ink for a trigger, the thought on one hairline. */
|
|
11
|
+
function Reasoning(props) {
|
|
12
|
+
injectComponentStyle("ai");
|
|
13
|
+
const [own, rest] = splitProps(props, ["label", "children"]);
|
|
14
|
+
return createComponent(Collapsible.Root, mergeProps(rest, {
|
|
15
|
+
"data-ai": "reasoning",
|
|
16
|
+
get children() {
|
|
17
|
+
return [createComponent(Collapsible.Trigger, { get children() {
|
|
18
|
+
return [(() => {
|
|
19
|
+
var _el$ = _tmpl$();
|
|
20
|
+
insert(_el$, () => {
|
|
21
|
+
return own.label ?? "Thinking";
|
|
22
|
+
});
|
|
23
|
+
return _el$;
|
|
24
|
+
})(), createComponent(Collapsible.Indicator, { get children() {
|
|
25
|
+
return chevron();
|
|
26
|
+
} })];
|
|
27
|
+
} }), createComponent(Collapsible.Content, { get children() {
|
|
28
|
+
var _el$2 = _tmpl$2();
|
|
29
|
+
insert(_el$2, () => {
|
|
30
|
+
return own.children;
|
|
31
|
+
});
|
|
32
|
+
return _el$2;
|
|
33
|
+
} })];
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { Reasoning as AiReasoning, Reasoning };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/ai-response/index.d.ts
|
|
3
|
+
export interface ResponseProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The markdown text to set on the paper — streamed in freely; raw
|
|
5
|
+
* HTML and executable links stay inert. */
|
|
6
|
+
content: string;
|
|
7
|
+
/** Optional code-highlighting function re-inking fenced blocks; the
|
|
8
|
+
* component stays agnostic about which engine provides it. */
|
|
9
|
+
highlighter?: (code: string, lang?: string) => string;
|
|
10
|
+
/** The copy stamp's accessible name before the copy lands. */
|
|
11
|
+
copyLabel?: string;
|
|
12
|
+
/** The copy stamp's accessible name once the text has landed. */
|
|
13
|
+
copiedLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
/** Markdown set on the paper. Rendering goes through
|
|
16
|
+
* `@tanstack/markdown`, whose defaults leave raw HTML and executable
|
|
17
|
+
* links inert — streaming-safe by construction. */
|
|
18
|
+
export declare function Response(props: ResponseProps): JSX.Element;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { Response as AiResponse };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/ai-source/index.d.ts
|
|
3
|
+
export interface SourceProps extends JSX.HTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
/** Where the ink came from — also the link text when no children are
|
|
5
|
+
* given; opens in a new tab, referrer-free. */
|
|
6
|
+
href: string;
|
|
7
|
+
}
|
|
8
|
+
/** One place the ink came from; href and the rest ride the anchor. */
|
|
9
|
+
export declare function Source(props: SourceProps): JSX.Element;
|
|
10
|
+
/** The reading list under a response: where this ink came from. */
|
|
11
|
+
export declare function Sources(props: JSX.HTMLAttributes<HTMLOListElement>): JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Source as AiSource, Sources as AiSources };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { claimElement, insert, spread, template } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
//#region src/components/ai-source/index.tsx
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<li data-scope=ai data-part=source><a>`);
|
|
6
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<ol>`);
|
|
7
|
+
/** One place the ink came from; href and the rest ride the anchor. */
|
|
8
|
+
function Source(props) {
|
|
9
|
+
injectComponentStyle("ai");
|
|
10
|
+
const [own, rest] = splitProps(props, ["href", "children"]);
|
|
11
|
+
var _el$ = _tmpl$();
|
|
12
|
+
var _el$2 = _el$.firstChild;
|
|
13
|
+
claimElement(_el$2);
|
|
14
|
+
spread(_el$2, [rest, {
|
|
15
|
+
get href() {
|
|
16
|
+
return own.href;
|
|
17
|
+
},
|
|
18
|
+
target: "_blank",
|
|
19
|
+
rel: "noreferrer"
|
|
20
|
+
}], true);
|
|
21
|
+
insert(_el$2, () => {
|
|
22
|
+
return own.children ?? own.href;
|
|
23
|
+
});
|
|
24
|
+
return _el$;
|
|
25
|
+
}
|
|
26
|
+
/** The reading list under a response: where this ink came from. */
|
|
27
|
+
function Sources(props) {
|
|
28
|
+
var _el$3 = _tmpl$2();
|
|
29
|
+
spread(_el$3, [props, {
|
|
30
|
+
"data-scope": "ai",
|
|
31
|
+
"data-part": "sources"
|
|
32
|
+
}], false);
|
|
33
|
+
return _el$3;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Source as AiSource, Source, Sources as AiSources, Sources };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/ai-suggestion/index.d.ts
|
|
3
|
+
export interface SuggestionProps extends Omit<JSX.HTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
4
|
+
/** The next stroke this seal proposes — also its label; handed
|
|
5
|
+
* back whole on `onSelect`. */
|
|
6
|
+
prompt: string;
|
|
7
|
+
onSelect?: (prompt: string) => void;
|
|
8
|
+
}
|
|
9
|
+
/** A seal-cut button proposing the next stroke; selection hands back
|
|
10
|
+
* the prompt. The shared Button in its outline register. */
|
|
11
|
+
export declare function Suggestion(props: SuggestionProps): JSX.Element;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { Suggestion as AiSuggestion };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
4
|
+
import { splitProps } from "solid-js";
|
|
5
|
+
//#region src/components/ai-suggestion/index.tsx
|
|
6
|
+
/** A seal-cut button proposing the next stroke; selection hands back
|
|
7
|
+
* the prompt. The shared Button in its outline register. */
|
|
8
|
+
function Suggestion(props) {
|
|
9
|
+
injectComponentStyle("ai");
|
|
10
|
+
const [own, rest] = splitProps(props, ["prompt", "onSelect"]);
|
|
11
|
+
return createComponent(Button, mergeProps({
|
|
12
|
+
variant: "outline",
|
|
13
|
+
size: "sm"
|
|
14
|
+
}, rest, {
|
|
15
|
+
onClick: () => own.onSelect?.(own.prompt),
|
|
16
|
+
get children() {
|
|
17
|
+
return own.prompt;
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Suggestion as AiSuggestion, Suggestion };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/ai-tool/index.d.ts
|
|
3
|
+
export type ToolStatus = "pending" | "running" | "completed" | "error";
|
|
4
|
+
export interface ToolProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** The name the tool was reached by — shown raw on the trigger
|
|
6
|
+
* unless friendlier `label` words are given. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Friendlier trigger words than the raw tool name. */
|
|
9
|
+
label?: JSX.Element;
|
|
10
|
+
/** The state the call reached — pending, running, completed, or
|
|
11
|
+
* error; stamped on the fold and whispered in the status chip. */
|
|
12
|
+
status?: ToolStatus;
|
|
13
|
+
/** The fold arrives open when set — rides the shared collapsible. */
|
|
14
|
+
defaultOpen?: boolean;
|
|
15
|
+
input?: string;
|
|
16
|
+
output?: string;
|
|
17
|
+
}
|
|
18
|
+
/** A tool call: the shared collapsible as the vessel — the name it was
|
|
19
|
+
* reached by and the state it reached in on the trigger, its input and
|
|
20
|
+
* output folded inside. */
|
|
21
|
+
export declare function Tool(props: ToolProps): JSX.Element;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Tool as AiTool };
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { t as chevron } from "../../chevron-D5RzcayK.mjs";
|
|
2
|
+
import { Collapsible } from "../collapsible/index.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { createComponent, insert, mergeProps, template } from "@solidjs/web";
|
|
5
|
+
import { Show, splitProps } from "solid-js";
|
|
6
|
+
//#region src/components/ai-tool/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<span data-scope=ai data-part=tool-status>`);
|
|
9
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span data-scope=ai data-part=tool-label>Input`);
|
|
10
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<pre>`);
|
|
11
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<span data-scope=ai data-part=tool-label>Output`);
|
|
12
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<div data-scope=ai data-part=tool-body><!><!>`);
|
|
13
|
+
/** A tool call: the shared collapsible as the vessel — the name it was
|
|
14
|
+
* reached by and the state it reached in on the trigger, its input and
|
|
15
|
+
* output folded inside. */
|
|
16
|
+
function Tool(props) {
|
|
17
|
+
injectComponentStyle("ai");
|
|
18
|
+
const [own, rest] = splitProps(props, [
|
|
19
|
+
"name",
|
|
20
|
+
"label",
|
|
21
|
+
"status",
|
|
22
|
+
"input",
|
|
23
|
+
"output"
|
|
24
|
+
]);
|
|
25
|
+
return createComponent(Collapsible.Root, mergeProps(rest, { "data-ai": "tool" }, () => {
|
|
26
|
+
return own.status ? { "data-status": own.status } : {};
|
|
27
|
+
}, { get children() {
|
|
28
|
+
return [createComponent(Collapsible.Trigger, { get children() {
|
|
29
|
+
return [
|
|
30
|
+
(() => {
|
|
31
|
+
var _el$ = _tmpl$();
|
|
32
|
+
insert(_el$, () => {
|
|
33
|
+
return own.label ?? own.name;
|
|
34
|
+
});
|
|
35
|
+
return _el$;
|
|
36
|
+
})(),
|
|
37
|
+
createComponent(Show, {
|
|
38
|
+
get when() {
|
|
39
|
+
return own.status;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
var _el$2 = _tmpl$2();
|
|
43
|
+
insert(_el$2, () => {
|
|
44
|
+
return own.status.charAt(0).toUpperCase() + own.status.slice(1);
|
|
45
|
+
});
|
|
46
|
+
return _el$2;
|
|
47
|
+
}
|
|
48
|
+
}),
|
|
49
|
+
createComponent(Collapsible.Indicator, { get children() {
|
|
50
|
+
return chevron();
|
|
51
|
+
} })
|
|
52
|
+
];
|
|
53
|
+
} }), createComponent(Collapsible.Content, { get children() {
|
|
54
|
+
var _el$3 = _tmpl$6();
|
|
55
|
+
var _el$6 = _el$3.firstChild;
|
|
56
|
+
var _el$9 = _el$6.nextSibling;
|
|
57
|
+
insert(_el$3, createComponent(Show, {
|
|
58
|
+
get when() {
|
|
59
|
+
return own.input !== void 0;
|
|
60
|
+
},
|
|
61
|
+
get children() {
|
|
62
|
+
return [_tmpl$3(), (() => {
|
|
63
|
+
var _el$5 = _tmpl$4();
|
|
64
|
+
insert(_el$5, () => {
|
|
65
|
+
return own.input;
|
|
66
|
+
});
|
|
67
|
+
return _el$5;
|
|
68
|
+
})()];
|
|
69
|
+
}
|
|
70
|
+
}), _el$6);
|
|
71
|
+
insert(_el$3, createComponent(Show, {
|
|
72
|
+
get when() {
|
|
73
|
+
return own.output !== void 0;
|
|
74
|
+
},
|
|
75
|
+
get children() {
|
|
76
|
+
return [_tmpl$5(), (() => {
|
|
77
|
+
var _el$8 = _tmpl$4();
|
|
78
|
+
insert(_el$8, () => {
|
|
79
|
+
return own.output;
|
|
80
|
+
});
|
|
81
|
+
return _el$8;
|
|
82
|
+
})()];
|
|
83
|
+
}
|
|
84
|
+
}), _el$9);
|
|
85
|
+
return _el$3;
|
|
86
|
+
} })];
|
|
87
|
+
} }));
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { Tool as AiTool, Tool };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/alert/index.d.ts
|
|
3
|
+
export type AlertStatus = "ink" | "info" | "success" | "warning" | "danger";
|
|
4
|
+
/** A notice drawn on the page: a wash of the status pigment, one heavier
|
|
5
|
+
* hairline on the leading edge, the serif for its title. Root, Icon,
|
|
6
|
+
* Body, Title, Description — the icon reads the status from the Root. */
|
|
7
|
+
export interface AlertProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
status?: AlertStatus;
|
|
9
|
+
}
|
|
10
|
+
declare function AlertRoot(props: AlertProps): JSX.Element;
|
|
11
|
+
declare function Icon(): JSX.Element;
|
|
12
|
+
declare function Body(props: JSX.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
13
|
+
declare function Title(props: JSX.HTMLAttributes<HTMLParagraphElement>): JSX.Element;
|
|
14
|
+
declare function Description(props: JSX.HTMLAttributes<HTMLParagraphElement>): JSX.Element;
|
|
15
|
+
export declare const Alert: typeof AlertRoot & {
|
|
16
|
+
Root: typeof AlertRoot;
|
|
17
|
+
Icon: typeof Icon;
|
|
18
|
+
Body: typeof Body;
|
|
19
|
+
Title: typeof Title;
|
|
20
|
+
Description: typeof Description;
|
|
21
|
+
};
|
|
22
|
+
//#endregion
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
3
|
+
import { createContext, splitProps, useContext } from "solid-js";
|
|
4
|
+
//#region src/components/alert/index.tsx
|
|
5
|
+
var _tmpl$ = /* @__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>`);
|
|
6
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
7
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<span data-scope=alert data-part=icon>`);
|
|
8
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<p>`);
|
|
9
|
+
const StatusContext = createContext(() => "ink");
|
|
10
|
+
function glyph(status) {
|
|
11
|
+
const paths = {
|
|
12
|
+
info: "M12 8v5m0 3v.01M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z",
|
|
13
|
+
success: "m4 12.5 5 5L20 6.5",
|
|
14
|
+
warning: "M12 4 2.5 20h19L12 4Zm0 6v4m0 3v.01",
|
|
15
|
+
danger: "M6 6l12 12M18 6 6 18",
|
|
16
|
+
ink: "M12 8v5m0 3v.01M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18Z"
|
|
17
|
+
};
|
|
18
|
+
var _el$ = _tmpl$();
|
|
19
|
+
var _el$2 = _el$.firstChild;
|
|
20
|
+
effect(() => paths[status], (_v$) => {
|
|
21
|
+
setAttribute(_el$2, "d", _v$);
|
|
22
|
+
});
|
|
23
|
+
return _el$;
|
|
24
|
+
}
|
|
25
|
+
function AlertRoot(props) {
|
|
26
|
+
const [own, rest] = splitProps(props, ["status"]);
|
|
27
|
+
const status = () => own.status ?? "ink";
|
|
28
|
+
return createComponent(StatusContext.Provider, {
|
|
29
|
+
value: status,
|
|
30
|
+
get children() {
|
|
31
|
+
var _el$3 = _tmpl$2();
|
|
32
|
+
spread(_el$3, [rest, {
|
|
33
|
+
get role() {
|
|
34
|
+
return status() === "ink" || status() === "info" ? "status" : "alert";
|
|
35
|
+
},
|
|
36
|
+
"data-scope": "alert",
|
|
37
|
+
"data-part": "root",
|
|
38
|
+
get "data-status"() {
|
|
39
|
+
return status();
|
|
40
|
+
}
|
|
41
|
+
}], false);
|
|
42
|
+
return _el$3;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function Icon() {
|
|
47
|
+
const status = useContext(StatusContext);
|
|
48
|
+
var _el$4 = _tmpl$3();
|
|
49
|
+
insert(_el$4, () => {
|
|
50
|
+
return glyph(status());
|
|
51
|
+
});
|
|
52
|
+
return _el$4;
|
|
53
|
+
}
|
|
54
|
+
function Body(props) {
|
|
55
|
+
var _el$5 = _tmpl$2();
|
|
56
|
+
spread(_el$5, [props, {
|
|
57
|
+
"data-scope": "alert",
|
|
58
|
+
"data-part": "body"
|
|
59
|
+
}], false);
|
|
60
|
+
return _el$5;
|
|
61
|
+
}
|
|
62
|
+
function Title(props) {
|
|
63
|
+
var _el$6 = _tmpl$4();
|
|
64
|
+
spread(_el$6, [props, {
|
|
65
|
+
"data-scope": "alert",
|
|
66
|
+
"data-part": "title"
|
|
67
|
+
}], false);
|
|
68
|
+
return _el$6;
|
|
69
|
+
}
|
|
70
|
+
function Description(props) {
|
|
71
|
+
var _el$7 = _tmpl$4();
|
|
72
|
+
spread(_el$7, [props, {
|
|
73
|
+
"data-scope": "alert",
|
|
74
|
+
"data-part": "description"
|
|
75
|
+
}], false);
|
|
76
|
+
return _el$7;
|
|
77
|
+
}
|
|
78
|
+
const Alert = Object.assign(AlertRoot, {
|
|
79
|
+
Root: AlertRoot,
|
|
80
|
+
Icon,
|
|
81
|
+
Body,
|
|
82
|
+
Title,
|
|
83
|
+
Description
|
|
84
|
+
});
|
|
85
|
+
injectComponentStyle("alert");
|
|
86
|
+
//#endregion
|
|
87
|
+
export { Alert };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AngleSlider as AngleSlider$1, AngleSliderRootProps } from "@ark-ui/solid/angle-slider";
|
|
2
|
+
//#region src/components/angle-slider/index.d.ts
|
|
3
|
+
/** Ark's AngleSlider, dressed in the paper-and-ink system: a flat paper dial
|
|
4
|
+
* the thumb sweeps as a pigment needle over hairline degree ticks. The API
|
|
5
|
+
* is Ark's own — Root, Label, ValueText, Control, Thumb, MarkerGroup,
|
|
6
|
+
* Marker, HiddenInput. */
|
|
7
|
+
type AngleSliderOwnProps = {
|
|
8
|
+
/** One rung of the dial ladder — the diameter the needle sweeps. */
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
};
|
|
11
|
+
declare function AngleSliderRoot(props: AngleSliderRootProps & AngleSliderOwnProps): import("solid-js").JSX.Element;
|
|
12
|
+
export declare const AngleSlider: Omit<typeof AngleSlider$1, "Root"> & {
|
|
13
|
+
Root: typeof AngleSliderRoot;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { AngleSlider as AngleSlider$1 } from "@ark-ui/solid/angle-slider";
|
|
5
|
+
//#region src/components/angle-slider/index.tsx
|
|
6
|
+
function AngleSliderRoot(props) {
|
|
7
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
+
return createComponent(AngleSlider$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
|
+
return own.size ?? "md";
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
const AngleSlider = {
|
|
13
|
+
...AngleSlider$1,
|
|
14
|
+
Root: AngleSliderRoot
|
|
15
|
+
};
|
|
16
|
+
injectComponentStyle("angle-slider");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { AngleSlider };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/aspect-ratio/index.d.ts
|
|
3
|
+
/** A frame that keeps its shape: the box holds the given ratio whatever
|
|
4
|
+
* the width it is dealt, and the child fills the frame it is given. */
|
|
5
|
+
export interface AspectRatioProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
/** A CSS `aspect-ratio` value — "16 / 9", "4 / 3", "1 / 1". */
|
|
7
|
+
ratio?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function AspectRatio(props: AspectRatioProps): JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { spread, template } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
//#region src/components/aspect-ratio/index.tsx
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<div>`);
|
|
6
|
+
function AspectRatio(props) {
|
|
7
|
+
injectComponentStyle("aspect-ratio");
|
|
8
|
+
const [own, rest] = splitProps(props, ["ratio"]);
|
|
9
|
+
var _el$ = _tmpl$();
|
|
10
|
+
spread(_el$, [rest, {
|
|
11
|
+
get style() {
|
|
12
|
+
return {
|
|
13
|
+
...rest.style,
|
|
14
|
+
"--bs-aspect-ratio": own.ratio ?? "1 / 1"
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
"data-scope": "aspect-ratio",
|
|
18
|
+
"data-part": "root"
|
|
19
|
+
}], false);
|
|
20
|
+
return _el$;
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { AspectRatio };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//#region src/components/autocomplete/index.d.ts
|
|
2
|
+
export interface AutoCompleteProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
items?: string[];
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
/** One rung of the control-height ladder for the field row. */
|
|
7
|
+
size?: "sm" | "md" | "lg";
|
|
8
|
+
/** Field text to match against; defaults to the item itself. */
|
|
9
|
+
filter?: (item: string, input: string) => boolean;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Free text with suggestions: the reader types anything, the list
|
|
14
|
+
* narrows to help, and both a pick and a custom value end up in the
|
|
15
|
+
* same `value`. A preset of the combobox machinery — same parts,
|
|
16
|
+
* same styling, one job. `items` seeds the suggestion list once;
|
|
17
|
+
* matching is a case-insensitive substring unless `filter` says
|
|
18
|
+
* otherwise.
|
|
19
|
+
*/
|
|
20
|
+
export declare function AutoComplete(props: AutoCompleteProps): import("solid-js").JSX.Element;
|
|
21
|
+
//#endregion
|