@bysages/solid 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-response-ClGGptX3.mjs → ai-response-slzE03wh.mjs} +4 -2
- package/dist/components/ai/index.mjs +11 -14
- package/dist/components/ai-attachments/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.mjs +12 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/autocomplete/index.mjs +5 -1
- package/dist/components/banner/index.mjs +3 -1
- package/dist/components/breadcrumb/index.mjs +5 -5
- package/dist/components/cascade-select/index.mjs +10 -3
- package/dist/components/command/index.mjs +11 -3
- package/dist/components/config-provider/index.d.mts +4 -1
- package/dist/components/config-provider/index.mjs +3 -1
- package/dist/components/data-view/index.mjs +8 -2
- package/dist/components/dynamic-input/index.mjs +5 -1
- package/dist/components/file-upload/index.d.mts +7 -1
- package/dist/components/file-upload/index.mjs +11 -1
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/image/index.d.mts +4 -0
- package/dist/components/image/index.mjs +9 -3
- package/dist/components/image-viewer/index.d.mts +4 -0
- package/dist/components/image-viewer/index.mjs +15 -7
- package/dist/components/json-tree-view/index.d.mts +5 -2
- package/dist/components/json-tree-view/index.mjs +25 -2
- package/dist/components/layout/index.mjs +8 -4
- package/dist/components/list/index.d.mts +2 -1
- package/dist/components/list/index.mjs +35 -26
- package/dist/components/menubar/index.mjs +1 -0
- package/dist/components/order-list/index.mjs +22 -14
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/spinner/index.mjs +3 -1
- package/dist/components/split-button/index.mjs +5 -1
- package/dist/components/steps/index.d.mts +6 -1
- package/dist/components/steps/index.mjs +7 -1
- package/dist/components/table/index.mjs +33 -21
- package/dist/components/terminal/index.mjs +3 -1
- package/dist/components/toc/index.d.mts +2 -7
- package/dist/components/toc/index.mjs +1 -9
- package/dist/components/transfer/index.mjs +14 -4
- package/dist/components/tree-select/index.mjs +9 -6
- package/dist/components/tree-view/index.d.mts +8 -1
- package/dist/components/tree-view/index.mjs +28 -2
- package/dist/components/virtual-list/index.mjs +1 -0
- package/dist/index-DdsnfV4f.d.mts +16 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{select-CHaXbzLX.mjs → select-CX6OuQlU.mjs} +9 -1
- package/dist/toc-CZmYEaQR.mjs +21 -0
- package/dist/use-component-messages-C4SCVYjD.mjs +17 -0
- package/package.json +3 -3
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { createComponent, mergeProps } from "@solidjs/web";
|
|
2
|
+
import { createComponent, effect, mergeProps, setAttribute, template } from "@solidjs/web";
|
|
3
3
|
import { splitProps } from "solid-js";
|
|
4
|
+
import { chevron_right } from "@bysages/icons";
|
|
4
5
|
import { TreeView as TreeView$1 } from "@ark-ui/solid/tree-view";
|
|
5
6
|
//#region src/components/tree-view/index.tsx
|
|
7
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg aria-hidden=true>`);
|
|
6
8
|
const ArkRoot = TreeView$1.Root;
|
|
7
9
|
function TreeViewRoot(props) {
|
|
8
10
|
const [own, rest] = splitProps(props, ["size"]);
|
|
@@ -10,9 +12,33 @@ function TreeViewRoot(props) {
|
|
|
10
12
|
return own.size ?? "md";
|
|
11
13
|
} }));
|
|
12
14
|
}
|
|
15
|
+
/** The node checkbox rides inside the branch control; the branch
|
|
16
|
+
* itself answers the keyboard, so the checkbox stays visual only. */
|
|
17
|
+
function TreeViewNodeCheckbox(props) {
|
|
18
|
+
return createComponent(TreeView$1.NodeCheckbox, mergeProps(props, { "aria-hidden": "true" }));
|
|
19
|
+
}
|
|
20
|
+
function TreeViewBranchIndicator(props) {
|
|
21
|
+
return createComponent(TreeView$1.BranchIndicator, mergeProps(props, { get children() {
|
|
22
|
+
return props.children ?? (() => {
|
|
23
|
+
var _el$ = _tmpl$();
|
|
24
|
+
effect(() => {
|
|
25
|
+
return {
|
|
26
|
+
e: `0 0 ${chevron_right.width} ${chevron_right.height}`,
|
|
27
|
+
t: chevron_right.body
|
|
28
|
+
};
|
|
29
|
+
}, ({ e, t }, _p$) => {
|
|
30
|
+
e !== _p$?.e && setAttribute(_el$, "viewBox", e);
|
|
31
|
+
t !== _p$?.t && (_el$.innerHTML = t);
|
|
32
|
+
});
|
|
33
|
+
return _el$;
|
|
34
|
+
})();
|
|
35
|
+
} }));
|
|
36
|
+
}
|
|
13
37
|
const TreeView = {
|
|
14
38
|
...TreeView$1,
|
|
15
|
-
Root: TreeViewRoot
|
|
39
|
+
Root: TreeViewRoot,
|
|
40
|
+
NodeCheckbox: TreeViewNodeCheckbox,
|
|
41
|
+
BranchIndicator: TreeViewBranchIndicator
|
|
16
42
|
};
|
|
17
43
|
injectComponentStyle("tree-view");
|
|
18
44
|
//#endregion
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentProps } from "solid-js";
|
|
2
|
+
import { Toc } from "@ark-ui/solid/toc";
|
|
3
|
+
//#region src/components/toc/TocIndicator.d.ts
|
|
4
|
+
/** The active stroke is decoration; hidden so the list reads as links
|
|
5
|
+
* alone. */
|
|
6
|
+
declare function TocIndicator(props: ComponentProps<typeof Toc.Indicator>): import("solid-js").JSX.Element;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/toc/index.d.ts
|
|
9
|
+
/** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
|
|
10
|
+
* beside the scroll, one stroke of primary ink marking where the reader
|
|
11
|
+
* stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
|
|
12
|
+
declare const Toc$1: Omit<typeof Toc, "Indicator"> & {
|
|
13
|
+
Indicator: typeof TocIndicator;
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Toc$1 as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -125,7 +125,7 @@ import { Textarea, TextareaProps } from "./components/textarea/index.mjs";
|
|
|
125
125
|
import { Timeline } from "./components/timeline/index.mjs";
|
|
126
126
|
import { Timer } from "./components/timer/index.mjs";
|
|
127
127
|
import { CreateToasterReturn, Toast, Toaster, createToaster } from "./components/toast/index.mjs";
|
|
128
|
-
import { Toc } from "./
|
|
128
|
+
import { t as Toc } from "./index-DdsnfV4f.mjs";
|
|
129
129
|
import { ToggleGroup } from "./components/toggle-group/index.mjs";
|
|
130
130
|
import { Toggle } from "./components/toggle/index.mjs";
|
|
131
131
|
import { Toolbar, ToolbarProps } from "./components/toolbar/index.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -3,11 +3,12 @@ import { Affix } from "./components/affix/index.mjs";
|
|
|
3
3
|
import { Button } from "./components/button/index.mjs";
|
|
4
4
|
import { Action } from "./components/ai-action/index.mjs";
|
|
5
5
|
import { AiMessage as Message } from "./components/ai-message/index.mjs";
|
|
6
|
+
import { ConfigContextKey, ConfigProvider, useConfig } from "./components/config-provider/index.mjs";
|
|
6
7
|
import { Field } from "./components/field/index.mjs";
|
|
7
8
|
import { AiPromptInput as PromptInput } from "./components/ai-prompt-input/index.mjs";
|
|
8
9
|
import { Collapsible } from "./components/collapsible/index.mjs";
|
|
9
10
|
import { AiReasoning as Reasoning } from "./components/ai-reasoning/index.mjs";
|
|
10
|
-
import { t as Response } from "./ai-response-
|
|
11
|
+
import { t as Response } from "./ai-response-slzE03wh.mjs";
|
|
11
12
|
import { AiSource as Source, AiSources as Sources } from "./components/ai-source/index.mjs";
|
|
12
13
|
import { AiSuggestion as Suggestion } from "./components/ai-suggestion/index.mjs";
|
|
13
14
|
import { AiTool as Tool } from "./components/ai-tool/index.mjs";
|
|
@@ -41,7 +42,6 @@ import { ColorPicker } from "./components/color-picker/index.mjs";
|
|
|
41
42
|
import { Combobox } from "./components/combobox/index.mjs";
|
|
42
43
|
import { Command } from "./components/command/index.mjs";
|
|
43
44
|
import { Comment } from "./components/comment/index.mjs";
|
|
44
|
-
import { ConfigContextKey, ConfigProvider, useConfig } from "./components/config-provider/index.mjs";
|
|
45
45
|
import { Container } from "./components/container/index.mjs";
|
|
46
46
|
import { Pagination } from "./components/pagination/index.mjs";
|
|
47
47
|
import { DataView } from "./components/data-view/index.mjs";
|
|
@@ -101,7 +101,7 @@ import { RadioGroup } from "./components/radio-group/index.mjs";
|
|
|
101
101
|
import { RatingGroup } from "./components/rating-group/index.mjs";
|
|
102
102
|
import { ScrollArea } from "./components/scroll-area/index.mjs";
|
|
103
103
|
import { SegmentGroup } from "./components/segment-group/index.mjs";
|
|
104
|
-
import { n as NativeSelect, t as Select } from "./select-
|
|
104
|
+
import { n as NativeSelect, t as Select } from "./select-CX6OuQlU.mjs";
|
|
105
105
|
import { Separator } from "./components/separator/index.mjs";
|
|
106
106
|
import { SignaturePad } from "./components/signature-pad/index.mjs";
|
|
107
107
|
import { Skeleton } from "./components/skeleton/index.mjs";
|
|
@@ -120,7 +120,7 @@ import { TagsInput } from "./components/tags-input/index.mjs";
|
|
|
120
120
|
import { Timeline } from "./components/timeline/index.mjs";
|
|
121
121
|
import { Timer } from "./components/timer/index.mjs";
|
|
122
122
|
import { Toast, Toaster, createToaster } from "./components/toast/index.mjs";
|
|
123
|
-
import { Toc } from "./
|
|
123
|
+
import { t as Toc } from "./toc-CZmYEaQR.mjs";
|
|
124
124
|
import { Toggle } from "./components/toggle/index.mjs";
|
|
125
125
|
import { Toolbar } from "./components/toolbar/index.mjs";
|
|
126
126
|
import { Typography } from "./components/typography/index.mjs";
|
|
@@ -17,7 +17,9 @@ function NativeSelect(props) {
|
|
|
17
17
|
"invalid",
|
|
18
18
|
"placeholder",
|
|
19
19
|
"disabled",
|
|
20
|
-
"onValueChange"
|
|
20
|
+
"onValueChange",
|
|
21
|
+
"aria-label",
|
|
22
|
+
"aria-labelledby"
|
|
21
23
|
]);
|
|
22
24
|
const [select, setSelect] = createSignal(null);
|
|
23
25
|
onMount(() => {
|
|
@@ -53,6 +55,12 @@ function NativeSelect(props) {
|
|
|
53
55
|
return setSelect;
|
|
54
56
|
}, _el$2);
|
|
55
57
|
spread(_el$2, [fieldProps, {
|
|
58
|
+
get "aria-label"() {
|
|
59
|
+
return own["aria-label"];
|
|
60
|
+
},
|
|
61
|
+
get "aria-labelledby"() {
|
|
62
|
+
return own["aria-labelledby"];
|
|
63
|
+
},
|
|
56
64
|
"data-scope": "select",
|
|
57
65
|
"data-part": "native",
|
|
58
66
|
get disabled() {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { createComponent, mergeProps } from "@solidjs/web";
|
|
3
|
+
import { Toc } from "@ark-ui/solid/toc";
|
|
4
|
+
//#region src/components/toc/TocIndicator.tsx
|
|
5
|
+
/** The active stroke is decoration; hidden so the list reads as links
|
|
6
|
+
* alone. */
|
|
7
|
+
function TocIndicator(props) {
|
|
8
|
+
return createComponent(Toc.Indicator, mergeProps(props, { "aria-hidden": "true" }));
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/toc/index.ts
|
|
12
|
+
/** Ark's Toc, dressed in the paper-and-ink system: a quiet rail of links
|
|
13
|
+
* beside the scroll, one stroke of primary ink marking where the reader
|
|
14
|
+
* stands. The API is Ark's own — Root, Title, List, Item, Link, Indicator. */
|
|
15
|
+
const Toc$1 = {
|
|
16
|
+
...Toc,
|
|
17
|
+
Indicator: TocIndicator
|
|
18
|
+
};
|
|
19
|
+
injectComponentStyle("toc");
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Toc$1 as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConfigContextKey } from "./components/config-provider/index.mjs";
|
|
2
|
+
import { resolveComponentMessages } from "@bysages/core";
|
|
3
|
+
import { createMemo, useContext } from "solid-js";
|
|
4
|
+
//#region src/components/config-provider/use-component-messages.ts
|
|
5
|
+
/** Wrapper copy is resolved once per locale/messages change and stays
|
|
6
|
+
* reactive through the provider snapshot. */
|
|
7
|
+
function useComponentMessages() {
|
|
8
|
+
const config = useContext(ConfigContextKey);
|
|
9
|
+
return createMemo(() => resolveComponentMessages(config().locale ?? "en", config().messages));
|
|
10
|
+
}
|
|
11
|
+
/** Expand the leaf placeholders shared by core ({name}); unknown keys
|
|
12
|
+
* stay visible instead of silently collapsing. */
|
|
13
|
+
function formatComponentMessage(template, values) {
|
|
14
|
+
return template.replace(/\{(\w+)\}/g, (_, key) => key in values ? String(values[key]) : `{${key}}`);
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { useComponentMessages as n, formatComponentMessage as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bysages/solid",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "By Sages Elements components for Solid — styled by the paper-and-ink design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessible",
|
|
@@ -124,8 +124,8 @@
|
|
|
124
124
|
"@tanstack/solid-virtual": "3.13.40",
|
|
125
125
|
"@zag-js/cascade-select": "1.44.0",
|
|
126
126
|
"@zag-js/solid": "1.44.0",
|
|
127
|
-
"@bysages/icons": "0.3.
|
|
128
|
-
"@bysages/core": "0.3.
|
|
127
|
+
"@bysages/icons": "0.3.1",
|
|
128
|
+
"@bysages/core": "0.3.1"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@json-render/core": "0.21.0",
|