@kirana-ui/solid 0.1.1 → 0.2.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/dom/accordion.js +9 -6
- package/dom/agent.js +3 -0
- package/dom/autosize.js +1 -1
- package/dom/avatar.js +3 -3
- package/dom/button.js +1 -1
- package/dom/calendar.js +12 -8
- package/dom/carousel.js +6 -6
- package/dom/checkbox.js +3 -3
- package/dom/collapsible.js +3 -3
- package/dom/combobox.js +19 -11
- package/dom/command.js +8 -8
- package/dom/date-field.js +7 -3
- package/dom/date-picker.js +2 -2
- package/dom/dialog.js +5 -2
- package/dom/field.js +3 -3
- package/dom/fieldset.js +2 -2
- package/dom/form.js +1 -1
- package/dom/hover-popup.js +3 -3
- package/dom/input.js +1 -1
- package/dom/label.js +1 -1
- package/dom/listbox.js +5 -5
- package/dom/menu.js +11 -11
- package/dom/menubar.js +1 -1
- package/dom/message-scroller.js +4 -4
- package/dom/navigation-menu.js +18 -21
- package/dom/number-field.js +3 -3
- package/dom/otp.js +4 -4
- package/dom/pagination.js +3 -3
- package/dom/popover.js +20 -7
- package/dom/qr-code.js +3 -3
- package/dom/radio-group.js +4 -4
- package/dom/resizable.js +3 -3
- package/dom/runtime.js +23 -7
- package/dom/scroll-area.js +5 -5
- package/dom/select.js +25 -13
- package/dom/separator.js +1 -1
- package/dom/slider.js +10 -7
- package/dom/switch.js +3 -3
- package/dom/tabs.js +5 -5
- package/dom/testing.js +3 -0
- package/dom/toast.js +57 -20
- package/dom/toggle-group.js +1 -1
- package/dom/toggle.js +1 -1
- package/dom/toolbar.js +4 -4
- package/dom/value-bar.js +3 -3
- package/llms.txt +1588 -224
- package/package.json +18 -2
- package/server/accordion.js +9 -6
- package/server/agent.js +3 -0
- package/server/autosize.js +1 -1
- package/server/avatar.js +3 -3
- package/server/button.js +1 -1
- package/server/calendar.js +12 -8
- package/server/carousel.js +6 -6
- package/server/checkbox.js +3 -3
- package/server/collapsible.js +3 -3
- package/server/combobox.js +19 -11
- package/server/command.js +8 -8
- package/server/date-field.js +7 -3
- package/server/date-picker.js +2 -2
- package/server/dialog.js +5 -2
- package/server/field.js +3 -3
- package/server/fieldset.js +2 -2
- package/server/form.js +1 -1
- package/server/hover-popup.js +3 -3
- package/server/input.js +1 -1
- package/server/label.js +1 -1
- package/server/listbox.js +5 -5
- package/server/menu.js +11 -11
- package/server/menubar.js +1 -1
- package/server/message-scroller.js +4 -4
- package/server/navigation-menu.js +18 -15
- package/server/number-field.js +3 -3
- package/server/otp.js +4 -4
- package/server/pagination.js +3 -3
- package/server/popover.js +20 -7
- package/server/qr-code.js +3 -3
- package/server/radio-group.js +4 -4
- package/server/resizable.js +3 -3
- package/server/runtime.js +23 -7
- package/server/scroll-area.js +5 -5
- package/server/select.js +25 -13
- package/server/separator.js +1 -1
- package/server/slider.js +10 -7
- package/server/switch.js +3 -3
- package/server/tabs.js +5 -5
- package/server/testing.js +3 -0
- package/server/toast.js +57 -20
- package/server/toggle-group.js +1 -1
- package/server/toggle.js +1 -1
- package/server/toolbar.js +4 -4
- package/server/value-bar.js +3 -3
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.jsx +10 -7
- package/src/agent.js +3 -0
- package/src/autosize.jsx +1 -1
- package/src/avatar.jsx +3 -3
- package/src/button.jsx +1 -1
- package/src/calendar.jsx +12 -8
- package/src/carousel.jsx +6 -6
- package/src/checkbox.jsx +3 -3
- package/src/collapsible.jsx +3 -3
- package/src/combobox.jsx +20 -12
- package/src/command.jsx +8 -8
- package/src/date-field.jsx +7 -3
- package/src/date-picker.jsx +2 -2
- package/src/dialog.jsx +8 -2
- package/src/field.jsx +3 -3
- package/src/fieldset.jsx +2 -2
- package/src/form.jsx +1 -1
- package/src/hover-popup.jsx +3 -3
- package/src/input.jsx +1 -1
- package/src/label.jsx +1 -1
- package/src/listbox.jsx +6 -6
- package/src/menu.jsx +11 -11
- package/src/menubar.jsx +1 -1
- package/src/message-scroller.jsx +4 -4
- package/src/navigation-menu.jsx +14 -13
- package/src/number-field.jsx +3 -3
- package/src/otp.jsx +4 -4
- package/src/pagination.jsx +3 -3
- package/src/popover.jsx +20 -4
- package/src/qr-code.jsx +3 -3
- package/src/radio-group.jsx +5 -5
- package/src/resizable.jsx +3 -3
- package/src/runtime.jsx +21 -7
- package/src/scroll-area.jsx +5 -5
- package/src/select.jsx +28 -14
- package/src/separator.jsx +1 -1
- package/src/slider.jsx +11 -8
- package/src/switch.jsx +3 -3
- package/src/tabs.jsx +6 -6
- package/src/testing.js +3 -0
- package/src/toast.jsx +38 -10
- package/src/toggle-group.jsx +2 -2
- package/src/toggle.jsx +1 -1
- package/src/toolbar.jsx +4 -4
- package/src/value-bar.jsx +3 -3
- package/types/accordion.d.ts +21 -19
- package/types/agent.d.ts +1 -0
- package/types/alert-dialog.d.ts +1 -0
- package/types/autocomplete.d.ts +1 -0
- package/types/autosize.d.ts +4 -1
- package/types/avatar.d.ts +12 -5
- package/types/button.d.ts +4 -2
- package/types/calendar.d.ts +35 -18
- package/types/carousel.d.ts +18 -10
- package/types/checkbox.d.ts +9 -6
- package/types/collapsible.d.ts +11 -7
- package/types/combobox.d.ts +61 -62
- package/types/command.d.ts +27 -17
- package/types/context-menu.d.ts +1 -0
- package/types/date-field.d.ts +20 -9
- package/types/date-picker.d.ts +25 -34
- package/types/dialog.d.ts +42 -31
- package/types/direction.d.ts +1 -0
- package/types/drawer.d.ts +1 -0
- package/types/field.d.ts +19 -11
- package/types/fieldset.d.ts +8 -3
- package/types/form.d.ts +5 -2
- package/types/hover-card.d.ts +16 -10
- package/types/hover-popup.d.ts +23 -13
- package/types/index.d.ts +12 -1
- package/types/input.d.ts +4 -3
- package/types/label.d.ts +4 -1
- package/types/listbox.d.ts +18 -20
- package/types/menu.d.ts +56 -42
- package/types/menubar.d.ts +6 -4
- package/types/message-scroller.d.ts +12 -6
- package/types/meter.d.ts +16 -7
- package/types/navigation-menu.d.ts +35 -29
- package/types/number-field.d.ts +13 -6
- package/types/otp.d.ts +17 -10
- package/types/pagination.d.ts +18 -10
- package/types/popover.d.ts +37 -12
- package/types/progress.d.ts +16 -7
- package/types/qr-code.d.ts +10 -4
- package/types/radio-group.d.ts +15 -17
- package/types/resizable.d.ts +12 -7
- package/types/runtime.d.ts +36 -12
- package/types/scroll-area.d.ts +17 -9
- package/types/select.d.ts +55 -46
- package/types/separator.d.ts +5 -3
- package/types/slider.d.ts +25 -13
- package/types/switch.d.ts +7 -4
- package/types/tabs.d.ts +20 -16
- package/types/testing.d.ts +1 -0
- package/types/toast.d.ts +40 -16
- package/types/toggle-group.d.ts +6 -11
- package/types/toggle.d.ts +4 -3
- package/types/toolbar.d.ts +19 -14
- package/types/tooltip.d.ts +16 -10
- package/types/value-bar.d.ts +21 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirana-ui/solid",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Kirana UI Primitives for Solid",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "The Kirana authors",
|
|
@@ -23,6 +23,22 @@
|
|
|
23
23
|
"worker": "./server/runtime.js",
|
|
24
24
|
"default": "./dom/runtime.js"
|
|
25
25
|
},
|
|
26
|
+
"./agent": {
|
|
27
|
+
"types": "./types/agent.d.ts",
|
|
28
|
+
"solid": "./src/agent.js",
|
|
29
|
+
"node": "./server/agent.js",
|
|
30
|
+
"deno": "./server/agent.js",
|
|
31
|
+
"worker": "./server/agent.js",
|
|
32
|
+
"default": "./dom/agent.js"
|
|
33
|
+
},
|
|
34
|
+
"./testing": {
|
|
35
|
+
"types": "./types/testing.d.ts",
|
|
36
|
+
"solid": "./src/testing.js",
|
|
37
|
+
"node": "./server/testing.js",
|
|
38
|
+
"deno": "./server/testing.js",
|
|
39
|
+
"worker": "./server/testing.js",
|
|
40
|
+
"default": "./dom/testing.js"
|
|
41
|
+
},
|
|
26
42
|
"./accordion": {
|
|
27
43
|
"types": "./types/accordion.d.ts",
|
|
28
44
|
"solid": "./src/accordion.jsx",
|
|
@@ -418,7 +434,7 @@
|
|
|
418
434
|
"./package.json": "./package.json"
|
|
419
435
|
},
|
|
420
436
|
"dependencies": {
|
|
421
|
-
"@kirana-ui/core": "0.
|
|
437
|
+
"@kirana-ui/core": "0.2.0"
|
|
422
438
|
},
|
|
423
439
|
"peerDependencies": {
|
|
424
440
|
"solid-js": "^1.9.0"
|
package/server/accordion.js
CHANGED
|
@@ -38,7 +38,7 @@ function Root(props) {
|
|
|
38
38
|
value: made,
|
|
39
39
|
get children() {
|
|
40
40
|
return _$createComponent(Part, _$mergeProps({
|
|
41
|
-
get
|
|
41
|
+
get of() {
|
|
42
42
|
return made.root;
|
|
43
43
|
},
|
|
44
44
|
tag: "div"
|
|
@@ -46,19 +46,22 @@ function Root(props) {
|
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
/** `value` tells this item from the others; an item that is given none makes its own. */
|
|
49
50
|
function Item(props) {
|
|
50
51
|
const [local, rest] = splitProps(props, ["value", "disabled"]);
|
|
51
52
|
const options = toSignal(() => ({
|
|
52
53
|
disabled: local.disabled
|
|
53
54
|
}));
|
|
55
|
+
const generated = createUniqueId();
|
|
54
56
|
// An item is its value for as long as it is in the page.
|
|
55
|
-
const
|
|
57
|
+
const value = untrack(() => local.value);
|
|
58
|
+
const item = useAccordion().item(value === undefined ? generated : value, () => defined(options.get()));
|
|
56
59
|
onMount(() => onCleanup(item.mount()));
|
|
57
60
|
return _$createComponent(ItemContext.Provider, {
|
|
58
61
|
value: item,
|
|
59
62
|
get children() {
|
|
60
63
|
return _$createComponent(Part, _$mergeProps({
|
|
61
|
-
get
|
|
64
|
+
get of() {
|
|
62
65
|
return item.root;
|
|
63
66
|
},
|
|
64
67
|
tag: "div"
|
|
@@ -67,13 +70,13 @@ function Item(props) {
|
|
|
67
70
|
});
|
|
68
71
|
}
|
|
69
72
|
const Header = props => _$createComponent(Part, _$mergeProps({
|
|
70
|
-
get
|
|
73
|
+
get of() {
|
|
71
74
|
return useItem().header;
|
|
72
75
|
},
|
|
73
76
|
tag: "h3"
|
|
74
77
|
}, props));
|
|
75
78
|
const Trigger = props => _$createComponent(Part, _$mergeProps({
|
|
76
|
-
get
|
|
79
|
+
get of() {
|
|
77
80
|
return useItem().trigger;
|
|
78
81
|
},
|
|
79
82
|
tag: "button"
|
|
@@ -89,7 +92,7 @@ function Panel(props) {
|
|
|
89
92
|
},
|
|
90
93
|
get children() {
|
|
91
94
|
return _$createComponent(Part, _$mergeProps({
|
|
92
|
-
get
|
|
95
|
+
get of() {
|
|
93
96
|
return item.panel;
|
|
94
97
|
},
|
|
95
98
|
tag: "div"
|
package/server/agent.js
ADDED
package/server/autosize.js
CHANGED
package/server/avatar.js
CHANGED
|
@@ -15,7 +15,7 @@ function Root(props) {
|
|
|
15
15
|
value: made,
|
|
16
16
|
get children() {
|
|
17
17
|
return _$createComponent(Part, _$mergeProps({
|
|
18
|
-
get
|
|
18
|
+
get of() {
|
|
19
19
|
return made.root;
|
|
20
20
|
},
|
|
21
21
|
tag: "span"
|
|
@@ -35,7 +35,7 @@ function Image(props) {
|
|
|
35
35
|
},
|
|
36
36
|
get children() {
|
|
37
37
|
return _$createComponent(Part, _$mergeProps({
|
|
38
|
-
get
|
|
38
|
+
get of() {
|
|
39
39
|
return made.image;
|
|
40
40
|
},
|
|
41
41
|
tag: "img"
|
|
@@ -53,7 +53,7 @@ function Fallback(props) {
|
|
|
53
53
|
},
|
|
54
54
|
get children() {
|
|
55
55
|
return _$createComponent(Part, _$mergeProps({
|
|
56
|
-
get
|
|
56
|
+
get of() {
|
|
57
57
|
return made.fallback;
|
|
58
58
|
},
|
|
59
59
|
tag: "span"
|
package/server/button.js
CHANGED
package/server/calendar.js
CHANGED
|
@@ -5,6 +5,10 @@ import { createCalendar } from "@kirana-ui/core/calendar";
|
|
|
5
5
|
import { For, createContext, createUniqueId, splitProps, useContext } from "solid-js";
|
|
6
6
|
import { DirectionContext } from "./direction-context.js";
|
|
7
7
|
import { Part, controller, fromSignal } from "./runtime.js";
|
|
8
|
+
/**
|
|
9
|
+
* The calendar its parts are inside. Exported for a component that is made of one (a date picker
|
|
10
|
+
* provides its own to the calendar's parts).
|
|
11
|
+
*/
|
|
8
12
|
const Context = createContext();
|
|
9
13
|
/** For a component made of this one's parts: a date picker. */
|
|
10
14
|
export { Context as CalendarContext };
|
|
@@ -40,7 +44,7 @@ function Root(props) {
|
|
|
40
44
|
value: made,
|
|
41
45
|
get children() {
|
|
42
46
|
return _$createComponent(Part, _$mergeProps({
|
|
43
|
-
get
|
|
47
|
+
get of() {
|
|
44
48
|
return made.root;
|
|
45
49
|
},
|
|
46
50
|
tag: "div"
|
|
@@ -53,7 +57,7 @@ function Heading(props) {
|
|
|
53
57
|
const made = useCalendar();
|
|
54
58
|
const title = fromSignal(made.title);
|
|
55
59
|
return _$createComponent(Part, _$mergeProps({
|
|
56
|
-
get
|
|
60
|
+
get of() {
|
|
57
61
|
return made.heading;
|
|
58
62
|
},
|
|
59
63
|
tag: "div"
|
|
@@ -64,19 +68,19 @@ function Heading(props) {
|
|
|
64
68
|
}));
|
|
65
69
|
}
|
|
66
70
|
const Previous = props => _$createComponent(Part, _$mergeProps({
|
|
67
|
-
get
|
|
71
|
+
get of() {
|
|
68
72
|
return useCalendar().previous;
|
|
69
73
|
},
|
|
70
74
|
tag: "button"
|
|
71
75
|
}, props));
|
|
72
76
|
const Next = props => _$createComponent(Part, _$mergeProps({
|
|
73
|
-
get
|
|
77
|
+
get of() {
|
|
74
78
|
return useCalendar().next;
|
|
75
79
|
},
|
|
76
80
|
tag: "button"
|
|
77
81
|
}, props));
|
|
78
82
|
const Grid = props => _$createComponent(Part, _$mergeProps({
|
|
79
|
-
get
|
|
83
|
+
get of() {
|
|
80
84
|
return useCalendar().grid;
|
|
81
85
|
},
|
|
82
86
|
tag: "table"
|
|
@@ -105,7 +109,7 @@ function HeadCell(props) {
|
|
|
105
109
|
const [local, rest] = splitProps(props, ["weekday"]);
|
|
106
110
|
const part = useCalendar().headCell(local.weekday);
|
|
107
111
|
return _$createComponent(Part, _$mergeProps({
|
|
108
|
-
|
|
112
|
+
of: part,
|
|
109
113
|
tag: "th"
|
|
110
114
|
}, rest));
|
|
111
115
|
}
|
|
@@ -114,7 +118,7 @@ function Cell(props) {
|
|
|
114
118
|
// A cell is its day for as long as it is in the page.
|
|
115
119
|
const part = useCalendar().cell(local.date);
|
|
116
120
|
return _$createComponent(Part, _$mergeProps({
|
|
117
|
-
|
|
121
|
+
of: part,
|
|
118
122
|
tag: "td"
|
|
119
123
|
}, rest));
|
|
120
124
|
}
|
|
@@ -122,7 +126,7 @@ function Day(props) {
|
|
|
122
126
|
const [local, rest] = splitProps(props, ["date"]);
|
|
123
127
|
const part = useCalendar().day(local.date);
|
|
124
128
|
return _$createComponent(Part, _$mergeProps({
|
|
125
|
-
|
|
129
|
+
of: part,
|
|
126
130
|
tag: "button"
|
|
127
131
|
}, rest));
|
|
128
132
|
}
|
package/server/carousel.js
CHANGED
|
@@ -29,7 +29,7 @@ function Root(props) {
|
|
|
29
29
|
value: made,
|
|
30
30
|
get children() {
|
|
31
31
|
return _$createComponent(Part, _$mergeProps({
|
|
32
|
-
get
|
|
32
|
+
get of() {
|
|
33
33
|
return made.root;
|
|
34
34
|
},
|
|
35
35
|
tag: "div"
|
|
@@ -38,7 +38,7 @@ function Root(props) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
const Viewport = props => _$createComponent(Part, _$mergeProps({
|
|
41
|
-
get
|
|
41
|
+
get of() {
|
|
42
42
|
return useCarousel().viewport;
|
|
43
43
|
},
|
|
44
44
|
tag: "div"
|
|
@@ -48,18 +48,18 @@ function Item(props) {
|
|
|
48
48
|
// A slide is its place for as long as it is in the page.
|
|
49
49
|
const part = useCarousel().item(local.index);
|
|
50
50
|
return _$createComponent(Part, _$mergeProps({
|
|
51
|
-
|
|
51
|
+
of: part,
|
|
52
52
|
tag: "div"
|
|
53
53
|
}, rest));
|
|
54
54
|
}
|
|
55
55
|
const Previous = props => _$createComponent(Part, _$mergeProps({
|
|
56
|
-
get
|
|
56
|
+
get of() {
|
|
57
57
|
return useCarousel().previous;
|
|
58
58
|
},
|
|
59
59
|
tag: "button"
|
|
60
60
|
}, props));
|
|
61
61
|
const Next = props => _$createComponent(Part, _$mergeProps({
|
|
62
|
-
get
|
|
62
|
+
get of() {
|
|
63
63
|
return useCarousel().next;
|
|
64
64
|
},
|
|
65
65
|
tag: "button"
|
|
@@ -69,7 +69,7 @@ function Indicator(props) {
|
|
|
69
69
|
// A button is its slide for as long as it is in the page.
|
|
70
70
|
const part = useCarousel().indicator(local.index);
|
|
71
71
|
return _$createComponent(Part, _$mergeProps({
|
|
72
|
-
|
|
72
|
+
of: part,
|
|
73
73
|
tag: "button"
|
|
74
74
|
}, rest));
|
|
75
75
|
}
|
package/server/checkbox.js
CHANGED
|
@@ -35,14 +35,14 @@ function Root(props) {
|
|
|
35
35
|
value: made,
|
|
36
36
|
get children() {
|
|
37
37
|
return _$createComponent(Part, _$mergeProps({
|
|
38
|
-
get
|
|
38
|
+
get of() {
|
|
39
39
|
return made.root;
|
|
40
40
|
},
|
|
41
41
|
tag: "span"
|
|
42
42
|
}, rest, {
|
|
43
43
|
get children() {
|
|
44
44
|
return [local.children, _$createComponent(Part, {
|
|
45
|
-
get
|
|
45
|
+
get of() {
|
|
46
46
|
return made.input;
|
|
47
47
|
},
|
|
48
48
|
tag: "input"
|
|
@@ -63,7 +63,7 @@ function Indicator(props) {
|
|
|
63
63
|
},
|
|
64
64
|
get children() {
|
|
65
65
|
return _$createComponent(Part, _$mergeProps({
|
|
66
|
-
get
|
|
66
|
+
get of() {
|
|
67
67
|
return made.indicator;
|
|
68
68
|
},
|
|
69
69
|
tag: "span"
|
package/server/collapsible.js
CHANGED
|
@@ -24,7 +24,7 @@ function Root(props) {
|
|
|
24
24
|
value: made,
|
|
25
25
|
get children() {
|
|
26
26
|
return _$createComponent(Part, _$mergeProps({
|
|
27
|
-
get
|
|
27
|
+
get of() {
|
|
28
28
|
return made.root;
|
|
29
29
|
},
|
|
30
30
|
tag: "div"
|
|
@@ -33,7 +33,7 @@ function Root(props) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
const Trigger = props => _$createComponent(Part, _$mergeProps({
|
|
36
|
-
get
|
|
36
|
+
get of() {
|
|
37
37
|
return useCollapsible().trigger;
|
|
38
38
|
},
|
|
39
39
|
tag: "button"
|
|
@@ -49,7 +49,7 @@ function Panel(props) {
|
|
|
49
49
|
},
|
|
50
50
|
get children() {
|
|
51
51
|
return _$createComponent(Part, _$mergeProps({
|
|
52
|
-
get
|
|
52
|
+
get of() {
|
|
53
53
|
return made.panel;
|
|
54
54
|
},
|
|
55
55
|
tag: "div"
|
package/server/combobox.js
CHANGED
|
@@ -36,6 +36,7 @@ function Root(props) {
|
|
|
36
36
|
onValuesChange: (values, details) => props.onValuesChange?.(values, details),
|
|
37
37
|
inline: props.inline,
|
|
38
38
|
virtualized: props.virtualized,
|
|
39
|
+
autoHighlight: props.autoHighlight,
|
|
39
40
|
name: props.name,
|
|
40
41
|
form: props.form,
|
|
41
42
|
items: props.items,
|
|
@@ -54,7 +55,7 @@ function Root(props) {
|
|
|
54
55
|
},
|
|
55
56
|
get children() {
|
|
56
57
|
return _$createComponent(Part, {
|
|
57
|
-
get
|
|
58
|
+
get of() {
|
|
58
59
|
return made.hidden;
|
|
59
60
|
},
|
|
60
61
|
tag: "input"
|
|
@@ -75,7 +76,7 @@ const Portal = props => _$createComponent(BodyPortal, {
|
|
|
75
76
|
function Positioner(props) {
|
|
76
77
|
const made = useCombobox();
|
|
77
78
|
return _$createComponent(Part, _$mergeProps({
|
|
78
|
-
get
|
|
79
|
+
get of() {
|
|
79
80
|
return made.positioner;
|
|
80
81
|
},
|
|
81
82
|
tag: "div"
|
|
@@ -98,7 +99,7 @@ function Item(props) {
|
|
|
98
99
|
value: value,
|
|
99
100
|
get children() {
|
|
100
101
|
return _$createComponent(Part, _$mergeProps({
|
|
101
|
-
|
|
102
|
+
of: part,
|
|
102
103
|
tag: "div"
|
|
103
104
|
}, rest));
|
|
104
105
|
}
|
|
@@ -115,7 +116,7 @@ function ItemIndicator(props) {
|
|
|
115
116
|
},
|
|
116
117
|
get children() {
|
|
117
118
|
return _$createComponent(Part, _$mergeProps({
|
|
118
|
-
get
|
|
119
|
+
get of() {
|
|
119
120
|
return made.itemIndicator(value);
|
|
120
121
|
},
|
|
121
122
|
tag: "span"
|
|
@@ -134,7 +135,7 @@ function Clear(props) {
|
|
|
134
135
|
},
|
|
135
136
|
get children() {
|
|
136
137
|
return _$createComponent(Part, _$mergeProps({
|
|
137
|
-
get
|
|
138
|
+
get of() {
|
|
138
139
|
return made.clear;
|
|
139
140
|
},
|
|
140
141
|
tag: "button"
|
|
@@ -152,7 +153,7 @@ function Chip(props) {
|
|
|
152
153
|
value: value,
|
|
153
154
|
get children() {
|
|
154
155
|
return _$createComponent(Part, _$mergeProps({
|
|
155
|
-
get
|
|
156
|
+
get of() {
|
|
156
157
|
return useCombobox().chip(value);
|
|
157
158
|
},
|
|
158
159
|
tag: "span"
|
|
@@ -161,7 +162,7 @@ function Chip(props) {
|
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
164
|
const ChipRemove = props => _$createComponent(Part, _$mergeProps({
|
|
164
|
-
get
|
|
165
|
+
get of() {
|
|
165
166
|
return useCombobox().chipRemove(useContext(ChipContext));
|
|
166
167
|
},
|
|
167
168
|
tag: "button"
|
|
@@ -176,7 +177,7 @@ function Empty(props) {
|
|
|
176
177
|
},
|
|
177
178
|
get children() {
|
|
178
179
|
return _$createComponent(Part, _$mergeProps({
|
|
179
|
-
get
|
|
180
|
+
get of() {
|
|
180
181
|
return made.emptyPart;
|
|
181
182
|
},
|
|
182
183
|
tag: "div"
|
|
@@ -194,7 +195,7 @@ function Group(props) {
|
|
|
194
195
|
value: group,
|
|
195
196
|
get children() {
|
|
196
197
|
return _$createComponent(Part, _$mergeProps({
|
|
197
|
-
get
|
|
198
|
+
get of() {
|
|
198
199
|
return group.root;
|
|
199
200
|
},
|
|
200
201
|
tag: "div"
|
|
@@ -204,13 +205,13 @@ function Group(props) {
|
|
|
204
205
|
}
|
|
205
206
|
/** Names the group it is in. With no group around it, it is plain text. */
|
|
206
207
|
const GroupLabel = props => _$createComponent(Part, _$mergeProps({
|
|
207
|
-
get
|
|
208
|
+
get of() {
|
|
208
209
|
return useContext(GroupContext)?.label ?? useCombobox().groupLabel;
|
|
209
210
|
},
|
|
210
211
|
tag: "div"
|
|
211
212
|
}, props));
|
|
212
213
|
const part = (name, tag) => props => _$createComponent(Part, _$mergeProps({
|
|
213
|
-
get
|
|
214
|
+
get of() {
|
|
214
215
|
return useCombobox()[name];
|
|
215
216
|
},
|
|
216
217
|
tag: tag
|
|
@@ -235,6 +236,7 @@ function AutocompleteRoot(props) {
|
|
|
235
236
|
name: props.name,
|
|
236
237
|
form: props.form,
|
|
237
238
|
virtualized: props.virtualized,
|
|
239
|
+
autoHighlight: props.autoHighlight,
|
|
238
240
|
onValueChange: (value, details) => props.onValueChange?.(value, details),
|
|
239
241
|
onOpenChange: (open, details) => props.onOpenChange?.(open, details)
|
|
240
242
|
}));
|
|
@@ -257,6 +259,11 @@ export const Combobox = {
|
|
|
257
259
|
Portal,
|
|
258
260
|
Positioner,
|
|
259
261
|
Popup: part("popup", "div"),
|
|
262
|
+
/**
|
|
263
|
+
* The items' own box inside the popup, when the popup holds more than items (an input): it
|
|
264
|
+
* is then the listbox.
|
|
265
|
+
*/
|
|
266
|
+
List: part("list", "div"),
|
|
260
267
|
Group,
|
|
261
268
|
GroupLabel,
|
|
262
269
|
/** A line between groups. */
|
|
@@ -273,6 +280,7 @@ export const Autocomplete = {
|
|
|
273
280
|
Portal: Combobox.Portal,
|
|
274
281
|
Positioner: Combobox.Positioner,
|
|
275
282
|
Popup: Combobox.Popup,
|
|
283
|
+
List: Combobox.List,
|
|
276
284
|
Group: Combobox.Group,
|
|
277
285
|
GroupLabel: Combobox.GroupLabel,
|
|
278
286
|
Separator: Combobox.Separator,
|
package/server/command.js
CHANGED
|
@@ -27,7 +27,7 @@ function Root(props) {
|
|
|
27
27
|
value: made,
|
|
28
28
|
get children() {
|
|
29
29
|
return _$createComponent(Part, _$mergeProps({
|
|
30
|
-
get
|
|
30
|
+
get of() {
|
|
31
31
|
return made.root;
|
|
32
32
|
},
|
|
33
33
|
tag: "div"
|
|
@@ -36,13 +36,13 @@ function Root(props) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
const Input = props => _$createComponent(Part, _$mergeProps({
|
|
39
|
-
get
|
|
39
|
+
get of() {
|
|
40
40
|
return useCommand().input;
|
|
41
41
|
},
|
|
42
42
|
tag: "input"
|
|
43
43
|
}, props));
|
|
44
44
|
const List = props => _$createComponent(Part, _$mergeProps({
|
|
45
|
-
get
|
|
45
|
+
get of() {
|
|
46
46
|
return useCommand().list;
|
|
47
47
|
},
|
|
48
48
|
tag: "div"
|
|
@@ -57,7 +57,7 @@ function Empty(props) {
|
|
|
57
57
|
},
|
|
58
58
|
get children() {
|
|
59
59
|
return _$createComponent(Part, _$mergeProps({
|
|
60
|
-
get
|
|
60
|
+
get of() {
|
|
61
61
|
return made.emptyPart;
|
|
62
62
|
},
|
|
63
63
|
tag: "div"
|
|
@@ -74,7 +74,7 @@ function Group(props) {
|
|
|
74
74
|
value: group,
|
|
75
75
|
get children() {
|
|
76
76
|
return _$createComponent(Part, _$mergeProps({
|
|
77
|
-
get
|
|
77
|
+
get of() {
|
|
78
78
|
return group.part;
|
|
79
79
|
},
|
|
80
80
|
tag: "div"
|
|
@@ -85,7 +85,7 @@ function Group(props) {
|
|
|
85
85
|
function GroupHeading(props) {
|
|
86
86
|
const part = useContext(GroupContext)?.heading ?? useCommand().heading;
|
|
87
87
|
return _$createComponent(Part, _$mergeProps({
|
|
88
|
-
|
|
88
|
+
of: part,
|
|
89
89
|
tag: "div"
|
|
90
90
|
}, props));
|
|
91
91
|
}
|
|
@@ -101,7 +101,7 @@ function Item(props) {
|
|
|
101
101
|
}));
|
|
102
102
|
const part = useCommand().item(untrack(() => local.value), () => options.get(), useContext(GroupContext));
|
|
103
103
|
return _$createComponent(Part, _$mergeProps({
|
|
104
|
-
|
|
104
|
+
of: part,
|
|
105
105
|
tag: "div"
|
|
106
106
|
}, rest));
|
|
107
107
|
}
|
|
@@ -113,7 +113,7 @@ function Separator(props) {
|
|
|
113
113
|
}));
|
|
114
114
|
const part = useCommand().separator(() => options.get().alwaysRender);
|
|
115
115
|
return _$createComponent(Part, _$mergeProps({
|
|
116
|
-
|
|
116
|
+
of: part,
|
|
117
117
|
tag: "div"
|
|
118
118
|
}, rest));
|
|
119
119
|
}
|
package/server/date-field.js
CHANGED
|
@@ -5,6 +5,10 @@ import { createDateField } from "@kirana-ui/core/date-field";
|
|
|
5
5
|
import { For, createContext, createUniqueId, splitProps, useContext } from "solid-js";
|
|
6
6
|
import { DirectionContext } from "./direction-context.js";
|
|
7
7
|
import { Part, controller, fromSignal } from "./runtime.js";
|
|
8
|
+
/**
|
|
9
|
+
* The date field its parts are inside. Exported for a component that is made of one (a date picker
|
|
10
|
+
* provides its own to the date field's parts).
|
|
11
|
+
*/
|
|
8
12
|
const Context = createContext();
|
|
9
13
|
/** For a component made of this one's parts: a date picker. */
|
|
10
14
|
export { Context as DateFieldContext };
|
|
@@ -38,7 +42,7 @@ function Root(props) {
|
|
|
38
42
|
value: made,
|
|
39
43
|
get children() {
|
|
40
44
|
return _$createComponent(Part, _$mergeProps({
|
|
41
|
-
get
|
|
45
|
+
get of() {
|
|
42
46
|
return made.root;
|
|
43
47
|
},
|
|
44
48
|
tag: "div"
|
|
@@ -62,7 +66,7 @@ function Segment(props) {
|
|
|
62
66
|
const made = useDateField().segment(local.segment);
|
|
63
67
|
const shown = fromSignal(made.text);
|
|
64
68
|
return _$createComponent(Part, _$mergeProps({
|
|
65
|
-
get
|
|
69
|
+
get of() {
|
|
66
70
|
return made.part;
|
|
67
71
|
},
|
|
68
72
|
tag: "span"
|
|
@@ -73,7 +77,7 @@ function Segment(props) {
|
|
|
73
77
|
}));
|
|
74
78
|
}
|
|
75
79
|
const Input = props => _$createComponent(Part, _$mergeProps({
|
|
76
|
-
get
|
|
80
|
+
get of() {
|
|
77
81
|
return useDateField().input;
|
|
78
82
|
},
|
|
79
83
|
tag: "input"
|
package/server/date-picker.js
CHANGED
|
@@ -72,7 +72,7 @@ export const DatePicker = {
|
|
|
72
72
|
Root,
|
|
73
73
|
/** The typed date: what holds its segments and its hidden input. */
|
|
74
74
|
Field: props => _$createComponent(Part, _$mergeProps({
|
|
75
|
-
get
|
|
75
|
+
get of() {
|
|
76
76
|
return useDatePicker().field.root;
|
|
77
77
|
},
|
|
78
78
|
tag: "div"
|
|
@@ -86,7 +86,7 @@ export const DatePicker = {
|
|
|
86
86
|
Popup: Popover.Popup,
|
|
87
87
|
/** The calendar: what holds its heading, its buttons and its grid. */
|
|
88
88
|
Calendar: props => _$createComponent(Part, _$mergeProps({
|
|
89
|
-
get
|
|
89
|
+
get of() {
|
|
90
90
|
return useDatePicker().calendar.root;
|
|
91
91
|
},
|
|
92
92
|
tag: "div"
|
package/server/dialog.js
CHANGED
|
@@ -37,7 +37,7 @@ const Portal = props => _$createComponent(BodyPortal, {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
const part = (name, tag) => props => _$createComponent(Part, _$mergeProps({
|
|
40
|
-
get
|
|
40
|
+
get of() {
|
|
41
41
|
return useDialog()[name];
|
|
42
42
|
},
|
|
43
43
|
tag: tag
|
|
@@ -97,5 +97,8 @@ function DrawerRoot(props) {
|
|
|
97
97
|
/** A dialog that comes from an edge and is dragged back to it. Its parts are a dialog's. */
|
|
98
98
|
export const Drawer = {
|
|
99
99
|
...Dialog,
|
|
100
|
-
Root: DrawerRoot
|
|
100
|
+
Root: DrawerRoot,
|
|
101
|
+
// The same components: only what `render` reads of their state is a drawer's.
|
|
102
|
+
Backdrop: Dialog.Backdrop,
|
|
103
|
+
Popup: Dialog.Popup
|
|
101
104
|
};
|
package/server/field.js
CHANGED
|
@@ -27,7 +27,7 @@ function Root(props) {
|
|
|
27
27
|
value: made,
|
|
28
28
|
get children() {
|
|
29
29
|
return _$createComponent(Part, _$mergeProps({
|
|
30
|
-
get
|
|
30
|
+
get of() {
|
|
31
31
|
return made.root;
|
|
32
32
|
},
|
|
33
33
|
tag: "div"
|
|
@@ -54,7 +54,7 @@ function FieldError(props) {
|
|
|
54
54
|
},
|
|
55
55
|
get children() {
|
|
56
56
|
return _$createComponent(Part, _$mergeProps({
|
|
57
|
-
get
|
|
57
|
+
get of() {
|
|
58
58
|
return error.part;
|
|
59
59
|
},
|
|
60
60
|
tag: "div"
|
|
@@ -71,7 +71,7 @@ function Validity(props) {
|
|
|
71
71
|
return props.children(fromSignal(useField().validity));
|
|
72
72
|
}
|
|
73
73
|
const part = (key, tag) => props => _$createComponent(Part, _$mergeProps({
|
|
74
|
-
get
|
|
74
|
+
get of() {
|
|
75
75
|
return useField()[key];
|
|
76
76
|
},
|
|
77
77
|
tag: tag
|
package/server/fieldset.js
CHANGED
|
@@ -21,7 +21,7 @@ function Root(props) {
|
|
|
21
21
|
value: made,
|
|
22
22
|
get children() {
|
|
23
23
|
return _$createComponent(Part, _$mergeProps({
|
|
24
|
-
get
|
|
24
|
+
get of() {
|
|
25
25
|
return made.root;
|
|
26
26
|
},
|
|
27
27
|
tag: "fieldset"
|
|
@@ -30,7 +30,7 @@ function Root(props) {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
const Legend = props => _$createComponent(Part, _$mergeProps({
|
|
33
|
-
get
|
|
33
|
+
get of() {
|
|
34
34
|
return useFieldset().legend;
|
|
35
35
|
},
|
|
36
36
|
tag: "div"
|
package/server/form.js
CHANGED
package/server/hover-popup.js
CHANGED
|
@@ -41,14 +41,14 @@ export function hoverPopup(name, create, triggerTag) {
|
|
|
41
41
|
function Positioner(props) {
|
|
42
42
|
const made = use();
|
|
43
43
|
return _$createComponent(Part, _$mergeProps({
|
|
44
|
-
get
|
|
44
|
+
get of() {
|
|
45
45
|
return made.positioner;
|
|
46
46
|
},
|
|
47
47
|
tag: "div"
|
|
48
48
|
}, () => positioned(props, made.positioning)));
|
|
49
49
|
}
|
|
50
50
|
const part = (key, tag) => props => _$createComponent(Part, _$mergeProps({
|
|
51
|
-
get
|
|
51
|
+
get of() {
|
|
52
52
|
return use()[key];
|
|
53
53
|
},
|
|
54
54
|
tag: tag
|
|
@@ -61,7 +61,7 @@ export function hoverPopup(name, create, triggerTag) {
|
|
|
61
61
|
...local
|
|
62
62
|
})));
|
|
63
63
|
return _$createComponent(Part, _$mergeProps({
|
|
64
|
-
get
|
|
64
|
+
get of() {
|
|
65
65
|
return made.trigger;
|
|
66
66
|
},
|
|
67
67
|
tag: triggerTag
|