@kirana-ui/solid 0.1.0 → 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/autocomplete.js +2 -0
- package/dom/autosize.js +19 -0
- package/dom/avatar.js +3 -3
- package/dom/button.js +1 -1
- package/dom/calendar.js +145 -0
- package/dom/carousel.js +83 -0
- package/dom/checkbox.js +5 -4
- package/dom/collapsible.js +3 -3
- package/dom/combobox.js +289 -0
- package/dom/command.js +129 -0
- package/dom/context-menu.js +2 -0
- package/dom/date-field.js +90 -0
- package/dom/date-picker.js +103 -0
- package/dom/dialog.js +32 -1
- package/dom/drawer.js +2 -0
- package/dom/field.js +3 -3
- package/dom/fieldset.js +2 -2
- package/dom/form.js +1 -1
- package/dom/hover-popup.js +19 -4
- package/dom/index.js +26 -1
- package/dom/input.js +26 -0
- package/dom/label.js +18 -0
- package/dom/listbox.js +114 -0
- package/dom/menu.js +261 -0
- package/dom/menubar-context.js +3 -0
- package/dom/menubar.js +33 -0
- package/dom/message-scroller.js +56 -0
- package/dom/navigation-menu.js +147 -0
- package/dom/number-field.js +82 -0
- package/dom/otp.js +95 -0
- package/dom/pagination.js +74 -0
- package/dom/popover.js +22 -7
- package/dom/qr-code.js +48 -0
- package/dom/radio-group.js +6 -5
- package/dom/resizable.js +65 -0
- package/dom/runtime.js +59 -9
- package/dom/scroll-area.js +99 -0
- package/dom/select.js +91 -15
- package/dom/separator.js +1 -1
- package/dom/slider.js +11 -8
- package/dom/switch.js +5 -4
- package/dom/tabs.js +5 -5
- package/dom/testing.js +3 -0
- package/dom/toast.js +150 -0
- package/dom/toggle-group.js +37 -0
- package/dom/toggle.js +12 -4
- package/dom/toolbar-context.js +5 -0
- package/dom/toolbar.js +71 -0
- package/dom/value-bar.js +3 -3
- package/llms.txt +3202 -0
- package/package.json +236 -2
- package/server/accordion.js +9 -6
- package/server/agent.js +3 -0
- package/server/autocomplete.js +2 -0
- package/server/autosize.js +19 -0
- package/server/avatar.js +3 -3
- package/server/button.js +1 -1
- package/server/calendar.js +144 -0
- package/server/carousel.js +83 -0
- package/server/checkbox.js +5 -4
- package/server/collapsible.js +3 -3
- package/server/combobox.js +289 -0
- package/server/command.js +129 -0
- package/server/context-menu.js +2 -0
- package/server/date-field.js +90 -0
- package/server/date-picker.js +103 -0
- package/server/dialog.js +32 -1
- package/server/drawer.js +2 -0
- package/server/field.js +3 -3
- package/server/fieldset.js +2 -2
- package/server/form.js +1 -1
- package/server/hover-popup.js +19 -4
- package/server/index.js +26 -1
- package/server/input.js +26 -0
- package/server/label.js +18 -0
- package/server/listbox.js +114 -0
- package/server/menu.js +261 -0
- package/server/menubar-context.js +3 -0
- package/server/menubar.js +33 -0
- package/server/message-scroller.js +56 -0
- package/server/navigation-menu.js +147 -0
- package/server/number-field.js +81 -0
- package/server/otp.js +94 -0
- package/server/pagination.js +74 -0
- package/server/popover.js +22 -7
- package/server/qr-code.js +48 -0
- package/server/radio-group.js +6 -5
- package/server/resizable.js +65 -0
- package/server/runtime.js +58 -8
- package/server/scroll-area.js +99 -0
- package/server/select.js +91 -15
- package/server/separator.js +1 -1
- package/server/slider.js +11 -8
- package/server/switch.js +5 -4
- package/server/tabs.js +5 -5
- package/server/testing.js +3 -0
- package/server/toast.js +150 -0
- package/server/toggle-group.js +37 -0
- package/server/toggle.js +12 -4
- package/server/toolbar-context.js +5 -0
- package/server/toolbar.js +71 -0
- 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/autocomplete.jsx +2 -0
- package/src/autosize.jsx +8 -0
- package/src/avatar.jsx +3 -3
- package/src/button.jsx +1 -1
- package/src/calendar.jsx +108 -0
- package/src/carousel.jsx +51 -0
- package/src/checkbox.jsx +5 -3
- package/src/collapsible.jsx +3 -3
- package/src/combobox.jsx +187 -0
- package/src/command.jsx +81 -0
- package/src/context-menu.js +2 -0
- package/src/date-field.jsx +71 -0
- package/src/date-picker.jsx +72 -0
- package/src/dialog.jsx +27 -1
- package/src/drawer.js +2 -0
- package/src/field.jsx +3 -3
- package/src/fieldset.jsx +2 -2
- package/src/form.jsx +1 -1
- package/src/hover-popup.jsx +12 -4
- package/src/index.js +26 -1
- package/src/input.jsx +17 -0
- package/src/label.jsx +9 -0
- package/src/listbox.jsx +81 -0
- package/src/menu.jsx +164 -0
- package/src/menubar-context.js +3 -0
- package/src/menubar.jsx +21 -0
- package/src/message-scroller.jsx +27 -0
- package/src/navigation-menu.jsx +96 -0
- package/src/number-field.jsx +75 -0
- package/src/otp.jsx +73 -0
- package/src/pagination.jsx +60 -0
- package/src/popover.jsx +22 -4
- package/src/qr-code.jsx +25 -0
- package/src/radio-group.jsx +7 -5
- package/src/resizable.jsx +46 -0
- package/src/runtime.jsx +54 -9
- package/src/scroll-area.jsx +53 -0
- package/src/select.jsx +72 -14
- package/src/separator.jsx +1 -1
- package/src/slider.jsx +13 -8
- package/src/switch.jsx +5 -3
- package/src/tabs.jsx +6 -6
- package/src/testing.js +3 -0
- package/src/toast.jsx +86 -0
- package/src/toggle-group.jsx +32 -0
- package/src/toggle.jsx +9 -3
- package/src/toolbar-context.js +5 -0
- package/src/toolbar.jsx +43 -0
- 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 +2 -0
- package/types/autosize.d.ts +11 -0
- package/types/avatar.d.ts +12 -5
- package/types/button.d.ts +4 -2
- package/types/calendar.d.ts +57 -0
- package/types/carousel.d.ts +34 -0
- package/types/checkbox.d.ts +10 -6
- package/types/collapsible.d.ts +11 -7
- package/types/combobox.d.ts +105 -0
- package/types/command.d.ts +55 -0
- package/types/context-menu.d.ts +2 -0
- package/types/date-field.d.ts +34 -0
- package/types/date-picker.d.ts +40 -0
- package/types/dialog.d.ts +52 -20
- package/types/direction.d.ts +1 -0
- package/types/drawer.d.ts +2 -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 -7
- package/types/hover-popup.d.ts +23 -10
- package/types/index.d.ts +39 -2
- package/types/input.d.ts +13 -0
- package/types/label.d.ts +7 -0
- package/types/listbox.d.ts +36 -0
- package/types/menu.d.ts +105 -0
- package/types/menubar-context.d.ts +3 -0
- package/types/menubar.d.ts +12 -0
- package/types/message-scroller.d.ts +22 -0
- package/types/meter.d.ts +16 -7
- package/types/navigation-menu.d.ts +50 -0
- package/types/number-field.d.ts +22 -0
- package/types/otp.d.ts +39 -0
- package/types/pagination.d.ts +31 -0
- package/types/popover.d.ts +41 -13
- package/types/progress.d.ts +16 -7
- package/types/qr-code.d.ts +20 -0
- package/types/radio-group.d.ts +15 -16
- package/types/resizable.d.ts +29 -0
- package/types/runtime.d.ts +53 -11
- package/types/scroll-area.d.ts +28 -0
- package/types/select.d.ts +66 -33
- package/types/separator.d.ts +5 -3
- package/types/slider.d.ts +25 -13
- package/types/switch.d.ts +8 -4
- package/types/tabs.d.ts +20 -16
- package/types/testing.d.ts +1 -0
- package/types/toast.d.ts +57 -0
- package/types/toggle-group.d.ts +9 -0
- package/types/toggle.d.ts +6 -3
- package/types/toolbar-context.d.ts +6 -0
- package/types/toolbar.d.ts +28 -0
- package/types/tooltip.d.ts +16 -7
- package/types/value-bar.d.ts +21 -10
package/dom/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/dom/agent.js
ADDED
package/dom/autosize.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
2
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
3
|
+
import { createAutosize } from "@kirana-ui/core/autosize";
|
|
4
|
+
import { Part, controller } from "./runtime.js";
|
|
5
|
+
/** A `<textarea>` as tall as its text. It takes what a `<textarea>` takes. */
|
|
6
|
+
function Textarea(props) {
|
|
7
|
+
const made = controller(createAutosize, () => ({
|
|
8
|
+
value: props.value
|
|
9
|
+
}));
|
|
10
|
+
return _$createComponent(Part, _$mergeProps({
|
|
11
|
+
get of() {
|
|
12
|
+
return made.textarea;
|
|
13
|
+
},
|
|
14
|
+
tag: "textarea"
|
|
15
|
+
}, props));
|
|
16
|
+
}
|
|
17
|
+
export const Autosize = {
|
|
18
|
+
Textarea
|
|
19
|
+
};
|
package/dom/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/dom/button.js
CHANGED
package/dom/calendar.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { memo as _$memo } from "solid-js/web";
|
|
2
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
3
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
4
|
+
import { within } from "@kirana-ui/core";
|
|
5
|
+
import { createCalendar } from "@kirana-ui/core/calendar";
|
|
6
|
+
import { For, createContext, createUniqueId, splitProps, useContext } from "solid-js";
|
|
7
|
+
import { DirectionContext } from "./direction-context.js";
|
|
8
|
+
import { Part, controller, fromSignal } from "./runtime.js";
|
|
9
|
+
/**
|
|
10
|
+
* The calendar its parts are inside. Exported for a component that is made of one (a date picker
|
|
11
|
+
* provides its own to the calendar's parts).
|
|
12
|
+
*/
|
|
13
|
+
const Context = createContext();
|
|
14
|
+
/** For a component made of this one's parts: a date picker. */
|
|
15
|
+
export { Context as CalendarContext };
|
|
16
|
+
function useCalendar() {
|
|
17
|
+
const made = useContext(Context);
|
|
18
|
+
if (!made) throw new Error("A Calendar part must be inside <Calendar.Root>");
|
|
19
|
+
return made;
|
|
20
|
+
}
|
|
21
|
+
function Root(props) {
|
|
22
|
+
const [local, rest] = splitProps(props, ["value", "defaultValue", "onValueChange", "mode", "defaultFocusedValue", "onMonthChange", "locale", "calendarSystem", "min", "max", "isDateUnavailable", "disabled", "readOnly", "fixedWeeks", "id"]);
|
|
23
|
+
const generated = createUniqueId();
|
|
24
|
+
const direction = useContext(DirectionContext);
|
|
25
|
+
const made = controller(within(createCalendar, {
|
|
26
|
+
direction
|
|
27
|
+
}), () => ({
|
|
28
|
+
id: local.id ?? generated,
|
|
29
|
+
value: local.value,
|
|
30
|
+
defaultValue: local.defaultValue,
|
|
31
|
+
mode: local.mode,
|
|
32
|
+
defaultFocusedValue: local.defaultFocusedValue,
|
|
33
|
+
locale: local.locale,
|
|
34
|
+
calendarSystem: local.calendarSystem,
|
|
35
|
+
min: local.min,
|
|
36
|
+
max: local.max,
|
|
37
|
+
isDateUnavailable: local.isDateUnavailable,
|
|
38
|
+
disabled: local.disabled,
|
|
39
|
+
readOnly: local.readOnly,
|
|
40
|
+
fixedWeeks: local.fixedWeeks,
|
|
41
|
+
onValueChange: (value, details) => local.onValueChange?.(value, details),
|
|
42
|
+
onMonthChange: month => local.onMonthChange?.(month)
|
|
43
|
+
}));
|
|
44
|
+
return _$createComponent(Context.Provider, {
|
|
45
|
+
value: made,
|
|
46
|
+
get children() {
|
|
47
|
+
return _$createComponent(Part, _$mergeProps({
|
|
48
|
+
get of() {
|
|
49
|
+
return made.root;
|
|
50
|
+
},
|
|
51
|
+
tag: "div"
|
|
52
|
+
}, rest));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** Names the month shown, unless it is given something else to say. */
|
|
57
|
+
function Heading(props) {
|
|
58
|
+
const made = useCalendar();
|
|
59
|
+
const title = fromSignal(made.title);
|
|
60
|
+
return _$createComponent(Part, _$mergeProps({
|
|
61
|
+
get of() {
|
|
62
|
+
return made.heading;
|
|
63
|
+
},
|
|
64
|
+
tag: "div"
|
|
65
|
+
}, props, {
|
|
66
|
+
get children() {
|
|
67
|
+
return props.children ?? title();
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
const Previous = props => _$createComponent(Part, _$mergeProps({
|
|
72
|
+
get of() {
|
|
73
|
+
return useCalendar().previous;
|
|
74
|
+
},
|
|
75
|
+
tag: "button"
|
|
76
|
+
}, props));
|
|
77
|
+
const Next = props => _$createComponent(Part, _$mergeProps({
|
|
78
|
+
get of() {
|
|
79
|
+
return useCalendar().next;
|
|
80
|
+
},
|
|
81
|
+
tag: "button"
|
|
82
|
+
}, props));
|
|
83
|
+
const Grid = props => _$createComponent(Part, _$mergeProps({
|
|
84
|
+
get of() {
|
|
85
|
+
return useCalendar().grid;
|
|
86
|
+
},
|
|
87
|
+
tag: "table"
|
|
88
|
+
}, props));
|
|
89
|
+
/** Draws its child once for each day of the week, in the locale's order. */
|
|
90
|
+
function Weekdays(props) {
|
|
91
|
+
const weekdays = fromSignal(useCalendar().weekdays);
|
|
92
|
+
return _$createComponent(For, {
|
|
93
|
+
get each() {
|
|
94
|
+
return weekdays();
|
|
95
|
+
},
|
|
96
|
+
children: weekday => props.children(weekday)
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/** Draws its child once for each week of the month shown. */
|
|
100
|
+
function Weeks(props) {
|
|
101
|
+
const weeks = fromSignal(useCalendar().weeks);
|
|
102
|
+
return _$createComponent(For, {
|
|
103
|
+
get each() {
|
|
104
|
+
return weeks();
|
|
105
|
+
},
|
|
106
|
+
children: week => props.children(week)
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
function HeadCell(props) {
|
|
110
|
+
const [local, rest] = splitProps(props, ["weekday"]);
|
|
111
|
+
const part = useCalendar().headCell(local.weekday);
|
|
112
|
+
return _$createComponent(Part, _$mergeProps({
|
|
113
|
+
of: part,
|
|
114
|
+
tag: "th"
|
|
115
|
+
}, rest));
|
|
116
|
+
}
|
|
117
|
+
function Cell(props) {
|
|
118
|
+
const [local, rest] = splitProps(props, ["date"]);
|
|
119
|
+
// A cell is its day for as long as it is in the page.
|
|
120
|
+
const part = useCalendar().cell(local.date);
|
|
121
|
+
return _$createComponent(Part, _$mergeProps({
|
|
122
|
+
of: part,
|
|
123
|
+
tag: "td"
|
|
124
|
+
}, rest));
|
|
125
|
+
}
|
|
126
|
+
function Day(props) {
|
|
127
|
+
const [local, rest] = splitProps(props, ["date"]);
|
|
128
|
+
const part = useCalendar().day(local.date);
|
|
129
|
+
return _$createComponent(Part, _$mergeProps({
|
|
130
|
+
of: part,
|
|
131
|
+
tag: "button"
|
|
132
|
+
}, rest));
|
|
133
|
+
}
|
|
134
|
+
export const Calendar = {
|
|
135
|
+
Root,
|
|
136
|
+
Heading,
|
|
137
|
+
Previous,
|
|
138
|
+
Next,
|
|
139
|
+
Grid,
|
|
140
|
+
Weekdays,
|
|
141
|
+
HeadCell,
|
|
142
|
+
Weeks,
|
|
143
|
+
Cell,
|
|
144
|
+
Day
|
|
145
|
+
};
|
package/dom/carousel.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
2
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
3
|
+
import { within } from "@kirana-ui/core";
|
|
4
|
+
import { createCarousel } from "@kirana-ui/core/carousel";
|
|
5
|
+
import { createContext, createUniqueId, splitProps, useContext } from "solid-js";
|
|
6
|
+
import { DirectionContext } from "./direction-context.js";
|
|
7
|
+
import { Part, controller } from "./runtime.js";
|
|
8
|
+
const Context = createContext();
|
|
9
|
+
function useCarousel() {
|
|
10
|
+
const made = useContext(Context);
|
|
11
|
+
if (!made) throw new Error("A Carousel part must be inside <Carousel.Root>");
|
|
12
|
+
return made;
|
|
13
|
+
}
|
|
14
|
+
function Root(props) {
|
|
15
|
+
const [local, rest] = splitProps(props, ["index", "defaultIndex", "onIndexChange", "orientation", "loop", "id"]);
|
|
16
|
+
const generated = createUniqueId();
|
|
17
|
+
const direction = useContext(DirectionContext);
|
|
18
|
+
const made = controller(within(createCarousel, {
|
|
19
|
+
direction
|
|
20
|
+
}), () => ({
|
|
21
|
+
id: local.id ?? generated,
|
|
22
|
+
index: local.index,
|
|
23
|
+
defaultIndex: local.defaultIndex,
|
|
24
|
+
orientation: local.orientation,
|
|
25
|
+
loop: local.loop,
|
|
26
|
+
onIndexChange: (index, details) => local.onIndexChange?.(index, details)
|
|
27
|
+
}));
|
|
28
|
+
return _$createComponent(Context.Provider, {
|
|
29
|
+
value: made,
|
|
30
|
+
get children() {
|
|
31
|
+
return _$createComponent(Part, _$mergeProps({
|
|
32
|
+
get of() {
|
|
33
|
+
return made.root;
|
|
34
|
+
},
|
|
35
|
+
tag: "div"
|
|
36
|
+
}, rest));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const Viewport = props => _$createComponent(Part, _$mergeProps({
|
|
41
|
+
get of() {
|
|
42
|
+
return useCarousel().viewport;
|
|
43
|
+
},
|
|
44
|
+
tag: "div"
|
|
45
|
+
}, props));
|
|
46
|
+
function Item(props) {
|
|
47
|
+
const [local, rest] = splitProps(props, ["index"]);
|
|
48
|
+
// A slide is its place for as long as it is in the page.
|
|
49
|
+
const part = useCarousel().item(local.index);
|
|
50
|
+
return _$createComponent(Part, _$mergeProps({
|
|
51
|
+
of: part,
|
|
52
|
+
tag: "div"
|
|
53
|
+
}, rest));
|
|
54
|
+
}
|
|
55
|
+
const Previous = props => _$createComponent(Part, _$mergeProps({
|
|
56
|
+
get of() {
|
|
57
|
+
return useCarousel().previous;
|
|
58
|
+
},
|
|
59
|
+
tag: "button"
|
|
60
|
+
}, props));
|
|
61
|
+
const Next = props => _$createComponent(Part, _$mergeProps({
|
|
62
|
+
get of() {
|
|
63
|
+
return useCarousel().next;
|
|
64
|
+
},
|
|
65
|
+
tag: "button"
|
|
66
|
+
}, props));
|
|
67
|
+
function Indicator(props) {
|
|
68
|
+
const [local, rest] = splitProps(props, ["index"]);
|
|
69
|
+
// A button is its slide for as long as it is in the page.
|
|
70
|
+
const part = useCarousel().indicator(local.index);
|
|
71
|
+
return _$createComponent(Part, _$mergeProps({
|
|
72
|
+
of: part,
|
|
73
|
+
tag: "button"
|
|
74
|
+
}, rest));
|
|
75
|
+
}
|
|
76
|
+
export const Carousel = {
|
|
77
|
+
Root,
|
|
78
|
+
Viewport,
|
|
79
|
+
Item,
|
|
80
|
+
Previous,
|
|
81
|
+
Next,
|
|
82
|
+
Indicator
|
|
83
|
+
};
|
package/dom/checkbox.js
CHANGED
|
@@ -13,7 +13,7 @@ function useCheckbox() {
|
|
|
13
13
|
return made;
|
|
14
14
|
}
|
|
15
15
|
function Root(props) {
|
|
16
|
-
const [local, rest] = splitProps(props, ["checked", "defaultChecked", "onCheckedChange", "indeterminate", "disabled", "readOnly", "required", "name", "value", "id", "children"]);
|
|
16
|
+
const [local, rest] = splitProps(props, ["checked", "defaultChecked", "onCheckedChange", "indeterminate", "disabled", "readOnly", "required", "name", "form", "value", "id", "children"]);
|
|
17
17
|
const generated = createUniqueId();
|
|
18
18
|
const field = useContext(FieldContext);
|
|
19
19
|
const made = controller(within(createCheckbox, {
|
|
@@ -27,6 +27,7 @@ function Root(props) {
|
|
|
27
27
|
readOnly: local.readOnly,
|
|
28
28
|
required: local.required,
|
|
29
29
|
name: local.name,
|
|
30
|
+
form: local.form,
|
|
30
31
|
value: local.value,
|
|
31
32
|
onCheckedChange: (checked, details) => local.onCheckedChange?.(checked, details)
|
|
32
33
|
}));
|
|
@@ -34,14 +35,14 @@ function Root(props) {
|
|
|
34
35
|
value: made,
|
|
35
36
|
get children() {
|
|
36
37
|
return _$createComponent(Part, _$mergeProps({
|
|
37
|
-
get
|
|
38
|
+
get of() {
|
|
38
39
|
return made.root;
|
|
39
40
|
},
|
|
40
41
|
tag: "span"
|
|
41
42
|
}, rest, {
|
|
42
43
|
get children() {
|
|
43
44
|
return [_$memo(() => local.children), _$createComponent(Part, {
|
|
44
|
-
get
|
|
45
|
+
get of() {
|
|
45
46
|
return made.input;
|
|
46
47
|
},
|
|
47
48
|
tag: "input"
|
|
@@ -62,7 +63,7 @@ function Indicator(props) {
|
|
|
62
63
|
},
|
|
63
64
|
get children() {
|
|
64
65
|
return _$createComponent(Part, _$mergeProps({
|
|
65
|
-
get
|
|
66
|
+
get of() {
|
|
66
67
|
return made.indicator;
|
|
67
68
|
},
|
|
68
69
|
tag: "span"
|
package/dom/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"
|