@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,304 @@
|
|
|
1
|
+
import { t as Input } from "../../input-DoFQ7RXh.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { createComponent, delegateEvents, effect, insert, setAttribute, spread, template } from "@solidjs/web";
|
|
4
|
+
import { For, Show, createMemo, createSignal, createUniqueId, mergeProps as mergeProps$1, splitProps } from "solid-js";
|
|
5
|
+
import { Portal } from "solid-js/web";
|
|
6
|
+
import { useEnvironmentContext } from "@ark-ui/solid/environment";
|
|
7
|
+
import { useFilter, useLocaleContext } from "@ark-ui/solid/locale";
|
|
8
|
+
import * as cascade from "@zag-js/cascade-select";
|
|
9
|
+
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
10
|
+
//#region src/components/cascade-select/index.tsx
|
|
11
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
|
|
12
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
|
|
13
|
+
var _tmpl$3 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
|
|
14
|
+
var _tmpl$4 = /* @__PURE__ */ template(`<ul>`);
|
|
15
|
+
var _tmpl$5 = /* @__PURE__ */ template(`<span data-scope=cascade-select data-part=branch-indicator aria-hidden=true>`);
|
|
16
|
+
var _tmpl$6 = /* @__PURE__ */ template(`<li><span></span><span>`);
|
|
17
|
+
var _tmpl$7 = /* @__PURE__ */ template(`<div data-scope=cascade-select data-part=search>`);
|
|
18
|
+
var _tmpl$8 = /* @__PURE__ */ template(`<div><div><div data-scope=cascade-select data-part=corridor>`);
|
|
19
|
+
var _tmpl$9 = /* @__PURE__ */ template(`<div><div><button><span></span><span>`);
|
|
20
|
+
var _tmpl$10 = /* @__PURE__ */ template(`<p data-scope=cascade-select data-part=empty>Nothing matches`);
|
|
21
|
+
var _tmpl$11 = /* @__PURE__ */ template(`<button type=button data-scope=cascade-select data-part=match>`);
|
|
22
|
+
function chevronDown() {
|
|
23
|
+
return _tmpl$();
|
|
24
|
+
}
|
|
25
|
+
function chevronRight() {
|
|
26
|
+
return _tmpl$2();
|
|
27
|
+
}
|
|
28
|
+
function checkGlyph() {
|
|
29
|
+
return _tmpl$3();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A corridor of linked columns: pick a branch and the next column
|
|
33
|
+
* dissolves open beside it, until a leaf click settles the whole path.
|
|
34
|
+
* `value` is the selected path (or paths, when `multiple`) — the
|
|
35
|
+
* joined labels ride the trigger. `highlightTrigger: "hover"` turns the
|
|
36
|
+
* classic cascading menu: pointing is enough to unfold. `filterable`
|
|
37
|
+
* swaps the corridor for a flat list of matching paths while a query
|
|
38
|
+
* runs — each hit still reads as its full route.
|
|
39
|
+
*/
|
|
40
|
+
function CascadeSelect(props) {
|
|
41
|
+
injectComponentStyle("cascade-select");
|
|
42
|
+
const [own, rest] = splitProps(props, [
|
|
43
|
+
"value",
|
|
44
|
+
"data",
|
|
45
|
+
"placeholder",
|
|
46
|
+
"highlightTrigger",
|
|
47
|
+
"filterable",
|
|
48
|
+
"multiple",
|
|
49
|
+
"disabled",
|
|
50
|
+
"size",
|
|
51
|
+
"onValueChange"
|
|
52
|
+
]);
|
|
53
|
+
const id = createUniqueId();
|
|
54
|
+
const locale = useLocaleContext();
|
|
55
|
+
const env = useEnvironmentContext();
|
|
56
|
+
const collection = createMemo(() => cascade.collection({
|
|
57
|
+
nodeToValue: (node) => node.value,
|
|
58
|
+
nodeToString: (node) => node.label,
|
|
59
|
+
nodeToChildren: (node) => node.children ?? [],
|
|
60
|
+
rootNode: {
|
|
61
|
+
value: "ROOT",
|
|
62
|
+
label: "",
|
|
63
|
+
children: own.data
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
const service = useMachine(cascade.machine, () => ({
|
|
67
|
+
id,
|
|
68
|
+
collection: collection(),
|
|
69
|
+
dir: locale().dir,
|
|
70
|
+
getRootNode: env().getRootNode.bind(env()),
|
|
71
|
+
disabled: own.disabled || void 0,
|
|
72
|
+
multiple: own.multiple || void 0,
|
|
73
|
+
...own.value !== void 0 ? { value: own.value } : {},
|
|
74
|
+
...own.highlightTrigger != null ? { highlightTrigger: own.highlightTrigger } : {},
|
|
75
|
+
onValueChange(details) {
|
|
76
|
+
own.onValueChange?.(details.value);
|
|
77
|
+
}
|
|
78
|
+
}));
|
|
79
|
+
const api = createMemo(() => cascade.connect(service, normalizeProps));
|
|
80
|
+
const [query, setQuery] = createSignal("");
|
|
81
|
+
const filterFns = useFilter({ sensitivity: "base" });
|
|
82
|
+
const filtering = () => own.filterable && query().trim().length > 0;
|
|
83
|
+
/** The corridor's answer to a query: every leaf whose route matches —
|
|
84
|
+
* the query may land on any hop, and the whole route still shows. */
|
|
85
|
+
const matchPaths = createMemo(() => {
|
|
86
|
+
if (!filtering()) return [];
|
|
87
|
+
const q = query().trim();
|
|
88
|
+
const hits = [];
|
|
89
|
+
const walk = (nodes, path, labels, matched) => {
|
|
90
|
+
for (const node of nodes ?? []) {
|
|
91
|
+
const hit = matched || filterFns().contains(node.label, q);
|
|
92
|
+
const nextPath = [...path, node.value];
|
|
93
|
+
const nextLabels = [...labels, node.label];
|
|
94
|
+
if (node.children?.length) walk(node.children, nextPath, nextLabels, hit);
|
|
95
|
+
else if (hit) hits.push({
|
|
96
|
+
path: nextPath,
|
|
97
|
+
labels: nextLabels
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
walk(own.data, [], [], false);
|
|
102
|
+
return hits;
|
|
103
|
+
});
|
|
104
|
+
const isSelected = (path) => (own.value ?? []).some((p) => p.join("/") === path.join("/"));
|
|
105
|
+
function pickMatch(path) {
|
|
106
|
+
if (own.multiple) {
|
|
107
|
+
const current = own.value ?? [];
|
|
108
|
+
const key = path.join("/");
|
|
109
|
+
const next = current.some((p) => p.join("/") === key) ? current.filter((p) => p.join("/") !== key) : [...current, path];
|
|
110
|
+
api().setValue(next);
|
|
111
|
+
} else {
|
|
112
|
+
api().selectValue(path);
|
|
113
|
+
api().setOpen(false);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** The machine's `valueAsString` only updates through its select
|
|
117
|
+
* event, so an externally-set `value` would render the
|
|
118
|
+
* placeholder forever — resolve the labels from the data instead. */
|
|
119
|
+
function labelsFor(path) {
|
|
120
|
+
const out = [];
|
|
121
|
+
let nodes = own.data;
|
|
122
|
+
for (const value of path) {
|
|
123
|
+
const node = nodes?.find((n) => n.value === value);
|
|
124
|
+
if (!node) return null;
|
|
125
|
+
out.push(node.label);
|
|
126
|
+
nodes = node.children;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
const display = () => {
|
|
131
|
+
const parts = (own.value ?? []).map((path) => labelsFor(path)?.join(" / ")).filter((label) => label != null);
|
|
132
|
+
return parts.length > 0 ? parts.join(", ") : null;
|
|
133
|
+
};
|
|
134
|
+
/** One column per walk of the highlighted path — the list binds to
|
|
135
|
+
* the node, the next column hangs off its highlighted child. */
|
|
136
|
+
function renderColumn(node, indexPath, valuePath) {
|
|
137
|
+
const nodeProps = {
|
|
138
|
+
item: node,
|
|
139
|
+
indexPath,
|
|
140
|
+
value: valuePath
|
|
141
|
+
};
|
|
142
|
+
const nodeState = () => api().getItemState(nodeProps);
|
|
143
|
+
const children = collection().getNodeChildren(node);
|
|
144
|
+
var _el$4 = _tmpl$4();
|
|
145
|
+
spread(_el$4, () => {
|
|
146
|
+
return mergeProps$1(() => api().getListProps(nodeProps));
|
|
147
|
+
}, true);
|
|
148
|
+
insert(_el$4, createComponent(For, {
|
|
149
|
+
each: children,
|
|
150
|
+
children: (item, index) => {
|
|
151
|
+
const itemValue = collection().getNodeValue(item);
|
|
152
|
+
const itemProps = {
|
|
153
|
+
item,
|
|
154
|
+
indexPath: [...indexPath, index()],
|
|
155
|
+
value: [...valuePath, itemValue]
|
|
156
|
+
};
|
|
157
|
+
const itemState = () => api().getItemState(itemProps);
|
|
158
|
+
var _el$5 = _tmpl$6();
|
|
159
|
+
var _el$6 = _el$5.firstChild;
|
|
160
|
+
var _el$8 = _el$6.nextSibling;
|
|
161
|
+
spread(_el$5, () => {
|
|
162
|
+
return mergeProps$1(() => api().getItemProps(itemProps));
|
|
163
|
+
}, true);
|
|
164
|
+
spread(_el$6, () => {
|
|
165
|
+
return mergeProps$1(() => api().getItemTextProps(itemProps));
|
|
166
|
+
}, true);
|
|
167
|
+
insert(_el$6, () => {
|
|
168
|
+
return item.label;
|
|
169
|
+
});
|
|
170
|
+
insert(_el$5, createComponent(Show, {
|
|
171
|
+
get when() {
|
|
172
|
+
return itemState().hasChildren;
|
|
173
|
+
},
|
|
174
|
+
get children() {
|
|
175
|
+
var _el$7 = _tmpl$5();
|
|
176
|
+
insert(_el$7, chevronRight);
|
|
177
|
+
return _el$7;
|
|
178
|
+
}
|
|
179
|
+
}), _el$8);
|
|
180
|
+
spread(_el$8, () => {
|
|
181
|
+
return mergeProps$1(() => api().getItemIndicatorProps(itemProps));
|
|
182
|
+
}, true);
|
|
183
|
+
insert(_el$8, checkGlyph);
|
|
184
|
+
return _el$5;
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
187
|
+
const list = _el$4;
|
|
188
|
+
const next = nodeState().highlightedChild;
|
|
189
|
+
return [list, next != null && collection().isBranchNode(next) ? renderColumn(next, [...indexPath, nodeState().highlightedIndex], [...valuePath, collection().getNodeValue(next)]) : null];
|
|
190
|
+
}
|
|
191
|
+
var _el$9 = _tmpl$9();
|
|
192
|
+
var _el$10 = _el$9.firstChild;
|
|
193
|
+
var _el$11 = _el$10.firstChild;
|
|
194
|
+
var _el$12 = _el$11.firstChild;
|
|
195
|
+
var _el$13 = _el$12.nextSibling;
|
|
196
|
+
spread(_el$9, [
|
|
197
|
+
rest,
|
|
198
|
+
() => {
|
|
199
|
+
return mergeProps$1(() => api().getRootProps());
|
|
200
|
+
},
|
|
201
|
+
{ get "data-size"() {
|
|
202
|
+
return own.size ?? "md";
|
|
203
|
+
} }
|
|
204
|
+
], true);
|
|
205
|
+
spread(_el$10, () => {
|
|
206
|
+
return mergeProps$1(() => api().getControlProps());
|
|
207
|
+
}, true);
|
|
208
|
+
spread(_el$11, () => {
|
|
209
|
+
return mergeProps$1(() => api().getTriggerProps(), {
|
|
210
|
+
get disabled() {
|
|
211
|
+
return own.disabled || void 0;
|
|
212
|
+
},
|
|
213
|
+
onclick(event) {
|
|
214
|
+
api().getTriggerProps().onclick?.(event);
|
|
215
|
+
setQuery("");
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}, true);
|
|
219
|
+
spread(_el$12, () => {
|
|
220
|
+
return mergeProps$1(() => api().getValueTextProps());
|
|
221
|
+
}, true);
|
|
222
|
+
insert(_el$12, () => {
|
|
223
|
+
return display() ?? own.placeholder ?? "Select…";
|
|
224
|
+
});
|
|
225
|
+
spread(_el$13, () => {
|
|
226
|
+
return mergeProps$1(() => api().getIndicatorProps());
|
|
227
|
+
}, true);
|
|
228
|
+
insert(_el$13, chevronDown);
|
|
229
|
+
insert(_el$9, createComponent(Portal, { get children() {
|
|
230
|
+
var _el$14 = _tmpl$8();
|
|
231
|
+
var _el$15 = _el$14.firstChild;
|
|
232
|
+
var _el$17 = _el$15.firstChild;
|
|
233
|
+
spread(_el$14, () => {
|
|
234
|
+
return mergeProps$1(() => api().getPositionerProps());
|
|
235
|
+
}, true);
|
|
236
|
+
spread(_el$15, [() => {
|
|
237
|
+
return mergeProps$1(() => api().getContentProps());
|
|
238
|
+
}, { get "data-size"() {
|
|
239
|
+
return own.size ?? "md";
|
|
240
|
+
} }], true);
|
|
241
|
+
insert(_el$15, createComponent(Show, {
|
|
242
|
+
get when() {
|
|
243
|
+
return own.filterable;
|
|
244
|
+
},
|
|
245
|
+
get children() {
|
|
246
|
+
var _el$16 = _tmpl$7();
|
|
247
|
+
insert(_el$16, createComponent(Input, {
|
|
248
|
+
size: "sm",
|
|
249
|
+
get value() {
|
|
250
|
+
return query();
|
|
251
|
+
},
|
|
252
|
+
onValueChange: setQuery,
|
|
253
|
+
placeholder: "Filter…",
|
|
254
|
+
"aria-label": "Filter options"
|
|
255
|
+
}));
|
|
256
|
+
return _el$16;
|
|
257
|
+
}
|
|
258
|
+
}), _el$17);
|
|
259
|
+
insert(_el$17, createComponent(Show, {
|
|
260
|
+
get when() {
|
|
261
|
+
return !filtering();
|
|
262
|
+
},
|
|
263
|
+
get fallback() {
|
|
264
|
+
return createComponent(Show, {
|
|
265
|
+
get when() {
|
|
266
|
+
return matchPaths().length > 0;
|
|
267
|
+
},
|
|
268
|
+
get fallback() {
|
|
269
|
+
return _tmpl$10();
|
|
270
|
+
},
|
|
271
|
+
get children() {
|
|
272
|
+
return createComponent(For, {
|
|
273
|
+
get each() {
|
|
274
|
+
return matchPaths();
|
|
275
|
+
},
|
|
276
|
+
children: (hit) => (() => {
|
|
277
|
+
var _el$19 = _tmpl$11();
|
|
278
|
+
_el$19._$$click = () => pickMatch(hit.path);
|
|
279
|
+
insert(_el$19, () => {
|
|
280
|
+
return hit.labels.join(" / ");
|
|
281
|
+
});
|
|
282
|
+
effect(() => isSelected(hit.path) || void 0, (_v$) => {
|
|
283
|
+
setAttribute(_el$19, "data-selected", _v$);
|
|
284
|
+
});
|
|
285
|
+
return _el$19;
|
|
286
|
+
})()
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
},
|
|
291
|
+
get children() {
|
|
292
|
+
return renderColumn(collection().rootNode, [], []);
|
|
293
|
+
}
|
|
294
|
+
}));
|
|
295
|
+
effect(() => filtering() ? "flat" : "columns", (_v$) => {
|
|
296
|
+
setAttribute(_el$17, "data-flow", _v$);
|
|
297
|
+
});
|
|
298
|
+
return _el$14;
|
|
299
|
+
} }), null);
|
|
300
|
+
return _el$9;
|
|
301
|
+
}
|
|
302
|
+
delegateEvents(["click"]);
|
|
303
|
+
//#endregion
|
|
304
|
+
export { CascadeSelect };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Checkbox as Checkbox$1, CheckboxRootProps } from "@ark-ui/solid/checkbox";
|
|
2
|
+
//#region src/components/checkbox/index.d.ts
|
|
3
|
+
/** Ark's Checkbox, dressed in the paper-and-ink system: a square-cut seal
|
|
4
|
+
* that fills flat with primary ink when ticked, the mark springing into
|
|
5
|
+
* place. The API is Ark's own — Root, Label, Control, Indicator,
|
|
6
|
+
* HiddenInput. */
|
|
7
|
+
type CheckboxOwnProps = {
|
|
8
|
+
/** One rung for the control's box: the tick scales with it. */
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
};
|
|
11
|
+
declare function CheckboxRoot(props: CheckboxRootProps & CheckboxOwnProps): import("solid-js").JSX.Element;
|
|
12
|
+
export declare const Checkbox: Omit<typeof Checkbox$1, "Root"> & {
|
|
13
|
+
Root: typeof CheckboxRoot;
|
|
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 { Checkbox as Checkbox$1 } from "@ark-ui/solid/checkbox";
|
|
5
|
+
//#region src/components/checkbox/index.tsx
|
|
6
|
+
function CheckboxRoot(props) {
|
|
7
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
+
return createComponent(Checkbox$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
|
+
return own.size ?? "md";
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
const Checkbox = {
|
|
13
|
+
...Checkbox$1,
|
|
14
|
+
Root: CheckboxRoot
|
|
15
|
+
};
|
|
16
|
+
injectComponentStyle("checkbox");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Checkbox };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/checkbox-group/index.d.ts
|
|
3
|
+
export interface CheckboxOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface CheckboxGroupProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
9
|
+
value?: string[];
|
|
10
|
+
options: CheckboxOption[];
|
|
11
|
+
layout?: "vertical" | "horizontal";
|
|
12
|
+
/** One register for every box: falls onto each root's data-size for
|
|
13
|
+
* the stylesheet to retune. */
|
|
14
|
+
size?: "sm" | "md" | "lg";
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onValueChange?: (value: string[]) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
21
|
+
* checkboxes bound to a single array. Toggling a box adds or removes its
|
|
22
|
+
* value; the group itself is semantics (`role="group"`), the boxes stay
|
|
23
|
+
* the machine-driven originals. Inside a `Field.Root` the group picks up
|
|
24
|
+
* the field context, so the invalid and disabled states a Form routes to
|
|
25
|
+
* its name dress every box at once.
|
|
26
|
+
*/
|
|
27
|
+
export declare function CheckboxGroup(props: CheckboxGroupProps): JSX.Element;
|
|
28
|
+
//#endregion
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, insert, spread, template } from "@solidjs/web";
|
|
3
|
+
import { For, createUniqueId, splitProps } from "solid-js";
|
|
4
|
+
import { useFieldContext } from "@ark-ui/solid/field";
|
|
5
|
+
import { Checkbox } from "@ark-ui/solid/checkbox";
|
|
6
|
+
//#region src/components/checkbox-group/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
|
|
8
|
+
var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
|
|
9
|
+
function checkGlyph() {
|
|
10
|
+
return _tmpl$();
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
14
|
+
* checkboxes bound to a single array. Toggling a box adds or removes its
|
|
15
|
+
* value; the group itself is semantics (`role="group"`), the boxes stay
|
|
16
|
+
* the machine-driven originals. Inside a `Field.Root` the group picks up
|
|
17
|
+
* the field context, so the invalid and disabled states a Form routes to
|
|
18
|
+
* its name dress every box at once.
|
|
19
|
+
*/
|
|
20
|
+
function CheckboxGroup(props) {
|
|
21
|
+
injectComponentStyle("checkbox-group");
|
|
22
|
+
injectComponentStyle("checkbox");
|
|
23
|
+
const field = useFieldContext();
|
|
24
|
+
const uid = createUniqueId();
|
|
25
|
+
const [own, rest] = splitProps(props, [
|
|
26
|
+
"value",
|
|
27
|
+
"options",
|
|
28
|
+
"layout",
|
|
29
|
+
"size",
|
|
30
|
+
"invalid",
|
|
31
|
+
"disabled",
|
|
32
|
+
"onValueChange"
|
|
33
|
+
]);
|
|
34
|
+
const selected = () => new Set(own.value ?? []);
|
|
35
|
+
const isInvalid = () => own.invalid || field?.().invalid === true;
|
|
36
|
+
const isDisabled = () => own.disabled || field?.().disabled === true;
|
|
37
|
+
function toggle(value) {
|
|
38
|
+
const next = new Set(selected());
|
|
39
|
+
if (next.has(value)) next.delete(value);
|
|
40
|
+
else next.add(value);
|
|
41
|
+
own.onValueChange?.([...next]);
|
|
42
|
+
}
|
|
43
|
+
var _el$2 = _tmpl$2();
|
|
44
|
+
spread(_el$2, [rest, {
|
|
45
|
+
role: "group",
|
|
46
|
+
"data-scope": "checkbox-group",
|
|
47
|
+
"data-part": "root",
|
|
48
|
+
get "data-layout"() {
|
|
49
|
+
return own.layout ?? "vertical";
|
|
50
|
+
},
|
|
51
|
+
get "data-invalid"() {
|
|
52
|
+
return isInvalid() ? "" : void 0;
|
|
53
|
+
}
|
|
54
|
+
}], true);
|
|
55
|
+
insert(_el$2, createComponent(For, {
|
|
56
|
+
get each() {
|
|
57
|
+
return own.options;
|
|
58
|
+
},
|
|
59
|
+
children: (option) => createComponent(Checkbox.Root, {
|
|
60
|
+
get ids() {
|
|
61
|
+
return {
|
|
62
|
+
label: `${uid}:${option.value}:label`,
|
|
63
|
+
hiddenInput: `${uid}:${option.value}:input`
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
get checked() {
|
|
67
|
+
return selected().has(option.value);
|
|
68
|
+
},
|
|
69
|
+
get "data-size"() {
|
|
70
|
+
return own.size ?? "md";
|
|
71
|
+
},
|
|
72
|
+
get invalid() {
|
|
73
|
+
return isInvalid();
|
|
74
|
+
},
|
|
75
|
+
get disabled() {
|
|
76
|
+
return isDisabled() || option.disabled === true;
|
|
77
|
+
},
|
|
78
|
+
onCheckedChange: () => toggle(option.value),
|
|
79
|
+
get children() {
|
|
80
|
+
return [
|
|
81
|
+
createComponent(Checkbox.Control, { get children() {
|
|
82
|
+
return createComponent(Checkbox.Indicator, { get children() {
|
|
83
|
+
return checkGlyph();
|
|
84
|
+
} });
|
|
85
|
+
} }),
|
|
86
|
+
createComponent(Checkbox.Label, { get children() {
|
|
87
|
+
return option.label;
|
|
88
|
+
} }),
|
|
89
|
+
createComponent(Checkbox.HiddenInput, {})
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
}));
|
|
94
|
+
return _el$2;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { CheckboxGroup };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { JSX } from "solid-js";
|
|
2
|
+
//#region src/components/chip/index.d.ts
|
|
3
|
+
/** A counting coin: the numeric value, capped at `max` with an ellipsis
|
|
4
|
+
* of the remainder ("99+"). */
|
|
5
|
+
export interface ChipProps extends JSX.HTMLAttributes<HTMLSpanElement> {
|
|
6
|
+
value: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
tone?: "ink" | "info" | "success" | "warning" | "danger";
|
|
9
|
+
variant?: "solid" | "subtle" | "outline";
|
|
10
|
+
}
|
|
11
|
+
export declare function Chip(props: ChipProps): JSX.Element;
|
|
12
|
+
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { insert, memo, spread, template } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
//#region src/components/chip/index.tsx
|
|
5
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span>`);
|
|
6
|
+
function Chip(props) {
|
|
7
|
+
injectComponentStyle("chip");
|
|
8
|
+
const [own, rest] = splitProps(props, [
|
|
9
|
+
"value",
|
|
10
|
+
"max",
|
|
11
|
+
"tone",
|
|
12
|
+
"variant"
|
|
13
|
+
]);
|
|
14
|
+
var _el$ = _tmpl$();
|
|
15
|
+
spread(_el$, [rest, {
|
|
16
|
+
"data-scope": "chip",
|
|
17
|
+
"data-part": "root",
|
|
18
|
+
get "data-tone"() {
|
|
19
|
+
return own.tone ?? "ink";
|
|
20
|
+
},
|
|
21
|
+
get "data-variant"() {
|
|
22
|
+
return own.variant ?? "solid";
|
|
23
|
+
}
|
|
24
|
+
}], true);
|
|
25
|
+
insert(_el$, (() => {
|
|
26
|
+
var _c$ = memo(() => {
|
|
27
|
+
return !!(own.max != null && own.value > own.max);
|
|
28
|
+
});
|
|
29
|
+
return () => {
|
|
30
|
+
return _c$() ? `${own.max}+` : String(own.value);
|
|
31
|
+
};
|
|
32
|
+
})());
|
|
33
|
+
return _el$;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { Chip };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Clipboard as Clipboard$1, ClipboardRootProps } from "@ark-ui/solid/clipboard";
|
|
2
|
+
//#region src/components/clipboard/index.d.ts
|
|
3
|
+
/** Ark's Clipboard, dressed in the paper-and-ink system: a hairline value
|
|
4
|
+
* field beside an icon-sized copy trigger whose ink turns bamboo while the
|
|
5
|
+
* copy is confirmed. The API is Ark's own — Root, Label, Control, Input,
|
|
6
|
+
* Trigger, Indicator, Context, HiddenInput. */
|
|
7
|
+
type ClipboardOwnProps = {
|
|
8
|
+
/** One rung of the control-height ladder for the value field and
|
|
9
|
+
* its copy seal. */
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
};
|
|
12
|
+
declare function ClipboardRoot(props: ClipboardRootProps & ClipboardOwnProps): import("solid-js").JSX.Element;
|
|
13
|
+
export declare const Clipboard: Omit<typeof Clipboard$1, "Root"> & {
|
|
14
|
+
Root: typeof ClipboardRoot;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
|
+
import { splitProps } from "solid-js";
|
|
4
|
+
import { Clipboard as Clipboard$1 } from "@ark-ui/solid/clipboard";
|
|
5
|
+
//#region src/components/clipboard/index.tsx
|
|
6
|
+
const ArkRoot = Clipboard$1.Root;
|
|
7
|
+
function ClipboardRoot(props) {
|
|
8
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
9
|
+
return createComponent(ArkRoot, mergeProps(rest, { get "data-size"() {
|
|
10
|
+
return own.size ?? "md";
|
|
11
|
+
} }));
|
|
12
|
+
}
|
|
13
|
+
const Clipboard = {
|
|
14
|
+
...Clipboard$1,
|
|
15
|
+
Root: ClipboardRoot
|
|
16
|
+
};
|
|
17
|
+
injectComponentStyle("clipboard");
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Clipboard };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Collapsible as Collapsible$1 } from "@ark-ui/solid/collapsible";
|
|
2
|
+
//#region src/components/collapsible/index.d.ts
|
|
3
|
+
/** Ark's Collapsible, dressed in the paper-and-ink system: one control on
|
|
4
|
+
* the paper, its panel dissolving open to the machine's measured height.
|
|
5
|
+
* The API is Ark's own — Root, Trigger, Content, Indicator. */
|
|
6
|
+
export declare const Collapsible: typeof Collapsible$1;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Collapsible as Collapsible$1 } from "@ark-ui/solid/collapsible";
|
|
3
|
+
//#region src/components/collapsible/index.ts
|
|
4
|
+
/** Ark's Collapsible, dressed in the paper-and-ink system: one control on
|
|
5
|
+
* the paper, its panel dissolving open to the machine's measured height.
|
|
6
|
+
* The API is Ark's own — Root, Trigger, Content, Indicator. */
|
|
7
|
+
const Collapsible = Collapsible$1;
|
|
8
|
+
injectComponentStyle("collapsible");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Collapsible };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CollectionItem, CollectionOptions, FilePathTreeNode, FlatTreeNode, GridCollection, GridCollectionOptions, ListCollection, TreeCollection, TreeCollectionOptions, TreeNode, UseAsyncListProps, UseAsyncListReturn, UseListCollectionProps, UseListCollectionReturn, UseListSelectionProps, UseListSelectionReturn, createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection } from "@ark-ui/solid/collection";
|
|
2
|
+
export { type CollectionItem, type CollectionOptions, type FilePathTreeNode, type FlatTreeNode, type GridCollection, type GridCollectionOptions, type ListCollection, type TreeCollection, type TreeCollectionOptions, type TreeNode, type UseAsyncListProps, type UseAsyncListReturn, type UseListCollectionProps, type UseListCollectionReturn, type UseListSelectionProps, type UseListSelectionReturn, createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection } from "@ark-ui/solid/collection";
|
|
2
|
+
export { createFileTreeCollection, createGridCollection, createListCollection, createTreeCollection, useAsyncList, useListCollection, useListSelection };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ColorPicker as ColorPicker$1, ColorPickerRootProps } from "@ark-ui/solid/color-picker";
|
|
2
|
+
//#region src/components/color-picker/index.d.ts
|
|
3
|
+
/** Ark's ColorPicker, dressed in the paper-and-ink system: a seal-sized swatch
|
|
4
|
+
* on the paper, opening into an area and channel sliders where pigment is
|
|
5
|
+
* picked. The API is Ark's own — Root, Label, Control, Trigger, Positioner,
|
|
6
|
+
* Content, Area, AreaThumb, AreaBackground, ValueText, ValueSwatch,
|
|
7
|
+
* ChannelSlider, ChannelSliderLabel, ChannelSliderTrack, ChannelSliderThumb,
|
|
8
|
+
* ChannelSliderValueText, ChannelInput, TransparencyGrid, SwatchGroup,
|
|
9
|
+
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
10
|
+
* FormatSelect, HiddenInput, Context. */
|
|
11
|
+
type ColorPickerOwnProps = {
|
|
12
|
+
/** One rung of the control-height ladder for the swatch seal. */
|
|
13
|
+
size?: "sm" | "md" | "lg";
|
|
14
|
+
};
|
|
15
|
+
declare function ColorPickerRoot(props: ColorPickerRootProps & ColorPickerOwnProps): import("solid-js").JSX.Element;
|
|
16
|
+
export declare const ColorPicker: Omit<typeof ColorPicker$1, "Root"> & {
|
|
17
|
+
Root: typeof ColorPickerRoot;
|
|
18
|
+
};
|
|
19
|
+
//#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 { ColorPicker as ColorPicker$1 } from "@ark-ui/solid/color-picker";
|
|
5
|
+
//#region src/components/color-picker/index.tsx
|
|
6
|
+
function ColorPickerRoot(props) {
|
|
7
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
+
return createComponent(ColorPicker$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
|
+
return own.size ?? "md";
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
const ColorPicker = {
|
|
13
|
+
...ColorPicker$1,
|
|
14
|
+
Root: ColorPickerRoot
|
|
15
|
+
};
|
|
16
|
+
injectComponentStyle("color-picker");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { ColorPicker };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CollectionItem } from "@ark-ui/solid/collection";
|
|
2
|
+
import { Combobox as Combobox$1, ComboboxRootProps } from "@ark-ui/solid/combobox";
|
|
3
|
+
//#region src/components/combobox/index.d.ts
|
|
4
|
+
/** Ark's Combobox, dressed in the paper-and-ink system: the field carries
|
|
5
|
+
* the control recipe and its matches dissolve open as a paper vessel, the
|
|
6
|
+
* checked row taking the flat ink fill. The API is Ark's own — Root, Label,
|
|
7
|
+
* Control, Input, Trigger, ClearTrigger, Positioner, Content, List, Empty,
|
|
8
|
+
* Item, ItemText, ItemIndicator, ItemGroup, ItemGroupLabel. */
|
|
9
|
+
type ComboboxOwnProps = {
|
|
10
|
+
/** One rung of the control-height ladder for the field row. */
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
};
|
|
13
|
+
declare function ComboboxRoot<T extends CollectionItem>(props: ComboboxRootProps<T> & ComboboxOwnProps): import("solid-js").JSX.Element;
|
|
14
|
+
export declare const Combobox: Omit<typeof Combobox$1, "Root"> & {
|
|
15
|
+
Root: typeof ComboboxRoot;
|
|
16
|
+
};
|
|
17
|
+
//#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 { Combobox as Combobox$1 } from "@ark-ui/solid/combobox";
|
|
5
|
+
//#region src/components/combobox/index.tsx
|
|
6
|
+
function ComboboxRoot(props) {
|
|
7
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
8
|
+
return createComponent(Combobox$1.Root, mergeProps(rest, { get "data-size"() {
|
|
9
|
+
return own.size ?? "md";
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
const Combobox = {
|
|
13
|
+
...Combobox$1,
|
|
14
|
+
Root: ComboboxRoot
|
|
15
|
+
};
|
|
16
|
+
injectComponentStyle("combobox");
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Combobox };
|