@kirana-ui/solid 0.1.1 → 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/dom/accordion.js +9 -6
- package/dom/agent.js +3 -0
- package/dom/autosize.js +1 -1
- package/dom/avatar.js +39 -14
- package/dom/button.js +1 -1
- package/dom/calendar.js +78 -19
- package/dom/carousel.js +6 -6
- package/dom/checkbox-group-context.js +3 -0
- package/dom/checkbox-group.js +38 -0
- package/dom/checkbox.js +9 -5
- package/dom/collapsible.js +3 -3
- package/dom/combobox.js +72 -14
- package/dom/command.js +10 -9
- package/dom/date-field.js +7 -3
- package/dom/date-picker.js +9 -3
- package/dom/dialog.js +13 -3
- 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/index.js +1 -0
- 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 +39 -6
- package/dom/otp.js +6 -5
- package/dom/pagination.js +3 -3
- package/dom/popover.js +37 -8
- package/dom/primitive.js +92 -0
- package/dom/qr-code.js +3 -3
- package/dom/radio-group.js +7 -6
- package/dom/resizable.js +3 -3
- package/dom/runtime.js +23 -7
- package/dom/scroll-area.js +5 -5
- package/dom/select.js +26 -13
- package/dom/separator.js +1 -1
- package/dom/slider.js +11 -8
- 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 +1846 -252
- package/package.json +34 -2
- package/server/accordion.js +9 -6
- package/server/agent.js +3 -0
- package/server/autosize.js +1 -1
- package/server/avatar.js +39 -14
- package/server/button.js +1 -1
- package/server/calendar.js +78 -19
- package/server/carousel.js +6 -6
- package/server/checkbox-group-context.js +3 -0
- package/server/checkbox-group.js +38 -0
- package/server/checkbox.js +9 -5
- package/server/collapsible.js +3 -3
- package/server/combobox.js +72 -14
- package/server/command.js +10 -9
- package/server/date-field.js +7 -3
- package/server/date-picker.js +9 -3
- package/server/dialog.js +13 -3
- 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/index.js +1 -0
- 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 +39 -6
- package/server/otp.js +6 -5
- package/server/pagination.js +3 -3
- package/server/popover.js +37 -8
- package/server/primitive.js +92 -0
- package/server/qr-code.js +3 -3
- package/server/radio-group.js +7 -6
- package/server/resizable.js +3 -3
- package/server/runtime.js +23 -7
- package/server/scroll-area.js +5 -5
- package/server/select.js +26 -13
- package/server/separator.js +1 -1
- package/server/slider.js +11 -8
- 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 +163 -0
- package/src/accordion.jsx +10 -7
- package/src/agent.js +3 -0
- package/src/autosize.jsx +1 -1
- package/src/avatar.jsx +17 -10
- package/src/button.jsx +1 -1
- package/src/calendar.jsx +72 -16
- package/src/carousel.jsx +6 -6
- package/src/checkbox-group-context.js +3 -0
- package/src/checkbox-group.jsx +33 -0
- package/src/checkbox.jsx +8 -4
- package/src/collapsible.jsx +3 -3
- package/src/combobox.jsx +70 -13
- package/src/command.jsx +10 -8
- package/src/date-field.jsx +7 -3
- package/src/date-picker.jsx +8 -2
- package/src/dialog.jsx +12 -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/index.js +1 -0
- 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 +26 -6
- package/src/otp.jsx +6 -4
- package/src/pagination.jsx +3 -3
- package/src/popover.jsx +35 -5
- package/src/primitive.jsx +81 -0
- package/src/qr-code.jsx +3 -3
- package/src/radio-group.jsx +7 -7
- package/src/resizable.jsx +3 -3
- package/src/runtime.jsx +21 -7
- package/src/scroll-area.jsx +5 -5
- package/src/select.jsx +29 -14
- package/src/separator.jsx +1 -1
- package/src/slider.jsx +12 -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 +14 -6
- package/types/button.d.ts +4 -2
- package/types/calendar.d.ts +48 -19
- package/types/carousel.d.ts +18 -10
- package/types/checkbox-group-context.d.ts +3 -0
- package/types/checkbox-group.d.ts +13 -0
- package/types/checkbox.d.ts +10 -6
- package/types/collapsible.d.ts +11 -7
- package/types/combobox.d.ts +102 -64
- package/types/command.d.ts +29 -17
- package/types/context-menu.d.ts +1 -0
- package/types/date-field.d.ts +20 -9
- package/types/date-picker.d.ts +26 -34
- package/types/dialog.d.ts +47 -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 +15 -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 +22 -7
- package/types/otp.d.ts +18 -10
- package/types/pagination.d.ts +18 -10
- package/types/popover.d.ts +52 -13
- package/types/primitive.d.ts +50 -0
- package/types/progress.d.ts +16 -7
- package/types/qr-code.d.ts +10 -4
- package/types/radio-group.d.ts +18 -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/src/toast.jsx
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { createToast } from "@kirana-ui/core/toast";
|
|
2
|
-
import { For, createContext, createMemo, createUniqueId, splitProps, useContext } from "solid-js";
|
|
1
|
+
import { createToast, createToaster as createCoreToaster } from "@kirana-ui/core/toast";
|
|
2
|
+
import { For, Show, createContext, createMemo, createUniqueId, splitProps, useContext, } from "solid-js";
|
|
3
3
|
import { Part, controller, fromSignal } from "./runtime.jsx";
|
|
4
|
+
/**
|
|
5
|
+
* The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A
|
|
6
|
+
* title, a description and an action's label are anything Solid draws, unless `Content` says
|
|
7
|
+
* otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export const createToaster = createCoreToaster;
|
|
4
10
|
const Context = createContext();
|
|
5
11
|
const ToastContext = createContext();
|
|
6
12
|
function useToast() {
|
|
@@ -27,7 +33,7 @@ function Viewport(props) {
|
|
|
27
33
|
swipeDirection: local.swipeDirection,
|
|
28
34
|
}));
|
|
29
35
|
return (<Context.Provider value={made}>
|
|
30
|
-
<Part
|
|
36
|
+
<Part of={made.viewport} tag="div" {...rest}/>
|
|
31
37
|
</Context.Provider>);
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
@@ -46,13 +52,35 @@ function Root(props) {
|
|
|
46
52
|
// A root is its toast for as long as it is in the page.
|
|
47
53
|
const parts = useToast().toast(local.toast.id);
|
|
48
54
|
return (<ToastContext.Provider value={parts}>
|
|
49
|
-
<Part
|
|
55
|
+
<Part of={parts.root} tag="div" {...rest}/>
|
|
50
56
|
</ToastContext.Provider>);
|
|
51
57
|
}
|
|
52
|
-
const Content = (props) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
const Content = (props) => <Part of={useParts().content} tag="div" {...props}/>;
|
|
59
|
+
/**
|
|
60
|
+
* A part that says something of the toast's: the caller's children when it has any, what the
|
|
61
|
+
* toast was added with otherwise, and nothing in the page when there is neither.
|
|
62
|
+
*/
|
|
63
|
+
function Said(props) {
|
|
64
|
+
const [local, rest] = splitProps(props, ["said", "tag", "children"]);
|
|
65
|
+
const parts = useParts();
|
|
66
|
+
const toast = fromSignal(parts.record);
|
|
67
|
+
const children = createMemo(() => local.children ?? (local.said === "action" ? toast()?.action?.label : toast()?.[local.said]));
|
|
68
|
+
return (
|
|
69
|
+
// A `render` draws what it likes; without one, an element with nothing to say is not drawn.
|
|
70
|
+
<Show when={children() != null || rest.render}>
|
|
71
|
+
<Part of={parts[local.said]} tag={local.tag} {...rest}>
|
|
72
|
+
{children()}
|
|
73
|
+
</Part>
|
|
74
|
+
</Show>);
|
|
75
|
+
}
|
|
76
|
+
/** The toast's title, unless it is given children of its own. */
|
|
77
|
+
const Title = (props) => <Said said="title" tag="div" {...props}/>;
|
|
78
|
+
/** The toast's description, unless it is given children of its own. */
|
|
79
|
+
const Description = (props) => <Said said="description" tag="div" {...props}/>;
|
|
80
|
+
const Close = (props) => <Part of={useParts().close} tag="button" {...props}/>;
|
|
81
|
+
/**
|
|
82
|
+
* The toast's action, its label unless it is given children of its own. A press tells the
|
|
83
|
+
* action (`onAction`), then closes the toast unless the action called `details.cancel()`.
|
|
84
|
+
*/
|
|
85
|
+
const Action = (props) => <Said said="action" tag="button" {...props}/>;
|
|
57
86
|
export const Toast = { Viewport, List, Root, Content, Title, Description, Close, Action };
|
|
58
|
-
export { createToaster } from "@kirana-ui/core/toast";
|
package/src/toggle-group.jsx
CHANGED
|
@@ -17,7 +17,7 @@ export function ToggleGroup(props) {
|
|
|
17
17
|
]);
|
|
18
18
|
const direction = useContext(DirectionContext);
|
|
19
19
|
const toolbar = useContext(ToolbarContext) ?? undefined;
|
|
20
|
-
const made = controller(within(createToggleGroup, { direction, toolbar }), () => ({
|
|
20
|
+
const made = controller(within((createToggleGroup), { direction, toolbar }), () => ({
|
|
21
21
|
value: local.value,
|
|
22
22
|
defaultValue: local.defaultValue,
|
|
23
23
|
multiple: local.multiple,
|
|
@@ -27,6 +27,6 @@ export function ToggleGroup(props) {
|
|
|
27
27
|
onValueChange: (value, details) => local.onValueChange?.(value, details),
|
|
28
28
|
}));
|
|
29
29
|
return (<ToggleGroupContext.Provider value={made}>
|
|
30
|
-
<Part
|
|
30
|
+
<Part of={made.root} tag="div" {...rest}/>
|
|
31
31
|
</ToggleGroupContext.Provider>);
|
|
32
32
|
}
|
package/src/toggle.jsx
CHANGED
|
@@ -20,5 +20,5 @@ export function Toggle(props) {
|
|
|
20
20
|
value: local.value,
|
|
21
21
|
onPressedChange: (pressed, details) => local.onPressedChange?.(pressed, details),
|
|
22
22
|
}));
|
|
23
|
-
return <Part
|
|
23
|
+
return <Part of={made.root} tag="button" {...rest}/>;
|
|
24
24
|
}
|
package/src/toolbar.jsx
CHANGED
|
@@ -21,7 +21,7 @@ function Root(props) {
|
|
|
21
21
|
return (<ToolbarContext.Provider value={made}>
|
|
22
22
|
{/* A toggle group around the toolbar is not the group of the toolbar's toggles. */}
|
|
23
23
|
<ToggleGroupContext.Provider value={null}>
|
|
24
|
-
<Part
|
|
24
|
+
<Part of={made.root} tag="div" {...rest}/>
|
|
25
25
|
</ToggleGroupContext.Provider>
|
|
26
26
|
</ToolbarContext.Provider>);
|
|
27
27
|
}
|
|
@@ -29,10 +29,10 @@ const item = (name, tag) => (props) => {
|
|
|
29
29
|
const [local, rest] = splitProps(props, ["disabled"]);
|
|
30
30
|
const options = toSignal(() => ({ disabled: local.disabled }));
|
|
31
31
|
const part = useToolbar()[name](() => defined(options.get()));
|
|
32
|
-
return <Part
|
|
32
|
+
return <Part of={part} tag={tag} {...rest}/>;
|
|
33
33
|
};
|
|
34
|
-
const Link = (props) => <Part
|
|
35
|
-
const Separator = (props) => (<Part
|
|
34
|
+
const Link = (props) => <Part of={useToolbar().link()} tag="a" {...props}/>;
|
|
35
|
+
const Separator = (props) => (<Part of={useToolbar().separator} tag="div" {...props}/>);
|
|
36
36
|
export const Toolbar = {
|
|
37
37
|
Root,
|
|
38
38
|
Button: item("button", "button"),
|
package/src/value-bar.jsx
CHANGED
|
@@ -22,7 +22,7 @@ export function valueBar(name, create) {
|
|
|
22
22
|
const generated = createUniqueId();
|
|
23
23
|
const made = controller(create, () => ({ ...local, id: local.id ?? generated }));
|
|
24
24
|
return (<Context.Provider value={made}>
|
|
25
|
-
<Part
|
|
25
|
+
<Part of={made.root} tag="div" {...rest}/>
|
|
26
26
|
</Context.Provider>);
|
|
27
27
|
}
|
|
28
28
|
/** The written value, or what its child, a function, makes of it. */
|
|
@@ -30,11 +30,11 @@ export function valueBar(name, create) {
|
|
|
30
30
|
const [local, rest] = splitProps(props, ["children"]);
|
|
31
31
|
const made = use();
|
|
32
32
|
const text = fromSignal(made.text);
|
|
33
|
-
return (<Part
|
|
33
|
+
return (<Part of={made.value} tag="span" {...rest}>
|
|
34
34
|
{local.children ? local.children(text) : text()}
|
|
35
35
|
</Part>);
|
|
36
36
|
}
|
|
37
|
-
const part = (key, tag) => (props) =>
|
|
37
|
+
const part = (key, tag) => (props) => <Part of={use()[key]} tag={tag} {...props}/>;
|
|
38
38
|
return {
|
|
39
39
|
Root,
|
|
40
40
|
Value,
|
package/types/accordion.d.ts
CHANGED
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { AccordionProps } from "@kirana-ui/core/accordion";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
4
|
import type { JSX } from "solid-js";
|
|
3
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
onValueChange?: (value: unknown[], details: ChangeDetails) => void;
|
|
8
|
-
multiple?: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
orientation?: Orientation;
|
|
11
|
-
loop?: boolean;
|
|
6
|
+
type Parts = Vocabulary["accordion"];
|
|
7
|
+
/** `Value` is what tells an item from the others: what the items' `value` and the root's hold. */
|
|
8
|
+
export type RootProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<AccordionProps<Value>, "id"> & {
|
|
12
9
|
id?: string;
|
|
13
|
-
}
|
|
14
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
15
|
-
|
|
16
|
-
value
|
|
10
|
+
}>;
|
|
11
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
12
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
13
|
+
value?: unknown;
|
|
17
14
|
disabled?: boolean;
|
|
18
|
-
}
|
|
19
|
-
/** `
|
|
20
|
-
declare function
|
|
15
|
+
}>;
|
|
16
|
+
/** `value` tells this item from the others; an item that is given none makes its own. */
|
|
17
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
18
|
+
export type HeaderProps = PartComponentProps<"h3", StateOf<Parts["header"]>>;
|
|
19
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
20
|
+
export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, {
|
|
21
21
|
keepMounted?: boolean;
|
|
22
|
-
}
|
|
22
|
+
}>;
|
|
23
|
+
/** `keepMounted` keeps the closed panel in the page, `hidden`. */
|
|
24
|
+
declare function Panel(props: PanelProps): JSX.Element;
|
|
23
25
|
export declare const Accordion: {
|
|
24
26
|
Root: typeof Root;
|
|
25
27
|
Item: typeof Item;
|
|
26
|
-
Header: (props:
|
|
27
|
-
Trigger: (props:
|
|
28
|
+
Header: (props: HeaderProps) => JSX.Element;
|
|
29
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
28
30
|
Panel: typeof Panel;
|
|
29
31
|
};
|
|
30
32
|
export {};
|
package/types/agent.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@kirana-ui/core/agent";
|
package/types/alert-dialog.d.ts
CHANGED
package/types/autocomplete.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { Autocomplete } from "./combobox.tsx";
|
|
2
|
+
export type { AutocompleteRootProps as RootProps, ClearProps, CollectionProps, EmptyProps, GroupLabelProps, GroupProps, InputProps, ItemProps, ListProps, PopupProps, PortalProps, PositionerProps, SeparatorProps, StatusProps, TriggerProps, } from "./combobox.tsx";
|
package/types/autosize.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
1
3
|
import type { JSX } from "solid-js";
|
|
2
4
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
5
|
+
export type TextareaProps = PartComponentProps<"textarea", StateOf<Vocabulary["autosize"]["textarea"]>>;
|
|
3
6
|
/** A `<textarea>` as tall as its text. It takes what a `<textarea>` takes. */
|
|
4
|
-
declare function Textarea(props:
|
|
7
|
+
declare function Textarea(props: TextareaProps): JSX.Element;
|
|
5
8
|
export declare const Autosize: {
|
|
6
9
|
Textarea: typeof Textarea;
|
|
7
10
|
};
|
package/types/avatar.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { AvatarFallbackProps, AvatarImageProps } from "@kirana-ui/core/avatar";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
1
4
|
import type { JSX } from "solid-js";
|
|
2
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
declare function
|
|
6
|
+
type Parts = Vocabulary["avatar"];
|
|
7
|
+
export type RootProps = PartComponentProps<"span", StateOf<Parts["root"]>>;
|
|
8
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
9
|
+
export type ImageProps = PartComponentProps<"img", StateOf<Parts["image"]>, {
|
|
10
|
+
/** The picture's address: the element is in the page once it has loaded. */
|
|
6
11
|
src?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
declare function
|
|
12
|
+
} & AvatarImageProps>;
|
|
13
|
+
/** The picture: in the page once `src` has loaded, or all along with `keepMounted`. */
|
|
14
|
+
declare function Image(props: ImageProps): JSX.Element;
|
|
15
|
+
export type FallbackProps = PartComponentProps<"span", StateOf<Parts["fallback"]>, AvatarFallbackProps>;
|
|
16
|
+
/** What shows until the picture has loaded, or when it cannot; after `delay`, when given one. */
|
|
17
|
+
declare function Fallback(props: FallbackProps): JSX.Element;
|
|
10
18
|
export declare const Avatar: {
|
|
11
19
|
Root: typeof Root;
|
|
12
20
|
Image: typeof Image;
|
package/types/button.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
1
3
|
import type { JSX } from "solid-js";
|
|
2
4
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
3
|
-
export type ButtonProps = PartComponentProps
|
|
5
|
+
export type ButtonProps = PartComponentProps<"button", StateOf<Vocabulary["button"]["root"]>, {
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
focusableWhenDisabled?: boolean;
|
|
6
8
|
nativeButton?: boolean;
|
|
7
|
-
}
|
|
9
|
+
}>;
|
|
8
10
|
/** A `<button>`, or with `as` and `nativeButton={false}` another element that acts as one. */
|
|
9
11
|
export declare function Button(props: ButtonProps): JSX.Element;
|
package/types/calendar.d.ts
CHANGED
|
@@ -1,40 +1,69 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Calendar as Controller, CalendarDay, CalendarMode, CalendarMonth, CalendarProps, CalendarWeekday } from "@kirana-ui/core/calendar";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
4
|
import type { JSX } from "solid-js";
|
|
3
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["calendar"];
|
|
7
|
+
/**
|
|
8
|
+
* The calendar its parts are inside. Exported for a component that is made of one (a date picker
|
|
9
|
+
* provides its own to the calendar's parts).
|
|
10
|
+
*/
|
|
4
11
|
declare const Context: import("solid-js").Context<Controller | undefined>;
|
|
5
12
|
/** For a component made of this one's parts: a date picker. */
|
|
6
13
|
export { Context as CalendarContext };
|
|
7
|
-
|
|
14
|
+
/** `value` and `onValueChange` are typed by `mode`: a day, a range, or a list of days. */
|
|
15
|
+
export type RootProps<Mode extends CalendarMode = "single"> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<CalendarProps<Mode>, "id"> & {
|
|
8
16
|
id?: string;
|
|
9
|
-
}
|
|
17
|
+
}>;
|
|
18
|
+
declare function Root<Mode extends CalendarMode = "single">(props: RootProps<Mode>): JSX.Element;
|
|
19
|
+
export type HeadingProps = PartComponentProps<"div", StateOf<Parts["heading"]>>;
|
|
10
20
|
/** Names the month shown, unless it is given something else to say. */
|
|
11
|
-
declare function Heading(props:
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
declare function Heading(props: HeadingProps): JSX.Element;
|
|
22
|
+
export type PreviousProps = PartComponentProps<"button", StateOf<Parts["previous"]>>;
|
|
23
|
+
export type NextProps = PartComponentProps<"button", StateOf<Parts["next"]>>;
|
|
24
|
+
export type GridProps = PartComponentProps<"table", StateOf<Parts["grid"]>>;
|
|
25
|
+
export type MonthsProps = {
|
|
26
|
+
children: (month: CalendarMonth) => JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Draws its child once for each month shown (`months` on the root), side by side: the parts
|
|
30
|
+
* inside each are that month's. Left out for one month.
|
|
31
|
+
*/
|
|
32
|
+
declare function Months(props: MonthsProps): JSX.Element;
|
|
33
|
+
export type WeekdaysProps = {
|
|
14
34
|
children: (weekday: CalendarWeekday) => JSX.Element;
|
|
15
|
-
}
|
|
16
|
-
/** Draws its child once for each
|
|
17
|
-
declare function
|
|
35
|
+
};
|
|
36
|
+
/** Draws its child once for each day of the week, in the locale's order. */
|
|
37
|
+
declare function Weekdays(props: WeekdaysProps): JSX.Element;
|
|
38
|
+
export type WeeksProps = {
|
|
18
39
|
children: (week: readonly CalendarDay[]) => JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
|
|
40
|
+
};
|
|
41
|
+
/** Draws its child once for each week of the month shown. */
|
|
42
|
+
declare function Weeks(props: WeeksProps): JSX.Element;
|
|
43
|
+
export type HeadCellProps = PartComponentProps<"th", StateOf<Parts["headCell"]>, {
|
|
21
44
|
weekday: CalendarWeekday;
|
|
22
|
-
}
|
|
23
|
-
declare function
|
|
45
|
+
}>;
|
|
46
|
+
declare function HeadCell(props: HeadCellProps): JSX.Element;
|
|
47
|
+
export type CellProps = PartComponentProps<"td", StateOf<Parts["cell"]>, {
|
|
24
48
|
date: string;
|
|
25
|
-
}
|
|
26
|
-
declare function
|
|
49
|
+
}>;
|
|
50
|
+
declare function Cell(props: CellProps): JSX.Element;
|
|
51
|
+
export type DayProps = PartComponentProps<"button", StateOf<Parts["day"]>, {
|
|
27
52
|
date: string;
|
|
28
|
-
}
|
|
53
|
+
}>;
|
|
54
|
+
declare function Day(props: DayProps): JSX.Element;
|
|
55
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
29
56
|
export declare const Calendar: {
|
|
30
57
|
Root: typeof Root;
|
|
31
58
|
Heading: typeof Heading;
|
|
32
|
-
Previous: (props:
|
|
33
|
-
Next: (props:
|
|
34
|
-
|
|
59
|
+
Previous: (props: PreviousProps) => JSX.Element;
|
|
60
|
+
Next: (props: NextProps) => JSX.Element;
|
|
61
|
+
Months: typeof Months;
|
|
62
|
+
Grid: (props: GridProps) => JSX.Element;
|
|
35
63
|
Weekdays: typeof Weekdays;
|
|
36
64
|
HeadCell: typeof HeadCell;
|
|
37
65
|
Weeks: typeof Weeks;
|
|
38
66
|
Cell: typeof Cell;
|
|
39
67
|
Day: typeof Day;
|
|
68
|
+
Input: (props: InputProps) => JSX.Element;
|
|
40
69
|
};
|
package/types/carousel.d.ts
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
import type { ChangeDetails, Orientation } from "@kirana-ui/core";
|
|
1
|
+
import type { ChangeDetails, Orientation, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
3
|
import type { JSX } from "solid-js";
|
|
3
4
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
-
|
|
5
|
+
type Parts = Vocabulary["carousel"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
5
7
|
index?: number;
|
|
6
8
|
defaultIndex?: number;
|
|
7
9
|
onIndexChange?: (index: number, details: ChangeDetails) => void;
|
|
8
10
|
orientation?: Orientation;
|
|
9
11
|
loop?: boolean;
|
|
10
12
|
id?: string;
|
|
11
|
-
}
|
|
12
|
-
declare function
|
|
13
|
+
}>;
|
|
14
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
15
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>>;
|
|
16
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
13
17
|
index: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
18
|
+
}>;
|
|
19
|
+
export type PreviousProps = PartComponentProps<"button", StateOf<Parts["previous"]>>;
|
|
20
|
+
export type NextProps = PartComponentProps<"button", StateOf<Parts["next"]>>;
|
|
21
|
+
export type IndicatorProps = PartComponentProps<"button", StateOf<Parts["indicator"]>, {
|
|
16
22
|
index: number;
|
|
17
|
-
}
|
|
23
|
+
}>;
|
|
24
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
25
|
+
declare function Indicator(props: IndicatorProps): JSX.Element;
|
|
18
26
|
export declare const Carousel: {
|
|
19
27
|
Root: typeof Root;
|
|
20
|
-
Viewport: (props:
|
|
28
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
21
29
|
Item: typeof Item;
|
|
22
|
-
Previous: (props:
|
|
23
|
-
Next: (props:
|
|
30
|
+
Previous: (props: PreviousProps) => JSX.Element;
|
|
31
|
+
Next: (props: NextProps) => JSX.Element;
|
|
24
32
|
Indicator: typeof Indicator;
|
|
25
33
|
};
|
|
26
34
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { CheckboxGroupProps as CoreProps } from "@kirana-ui/core/checkbox-group";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
export type CheckboxGroupProps = PartComponentProps<"div", StateOf<Vocabulary["checkboxGroup"]["root"]>, Omit<CoreProps, "id"> & {
|
|
7
|
+
id?: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* Checkboxes that hold one list of values. Each `<Checkbox.Root value>` inside it is checked
|
|
11
|
+
* while the list has its value; with `allValues`, a `<Checkbox.Root parent>` stands for them all.
|
|
12
|
+
*/
|
|
13
|
+
export declare function CheckboxGroup(props: CheckboxGroupProps): JSX.Element;
|
package/types/checkbox.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import type { ChangeDetails } from "@kirana-ui/core";
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
3
|
import type { JSX } from "solid-js";
|
|
3
4
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
-
|
|
5
|
+
type Parts = Vocabulary["checkbox"];
|
|
6
|
+
export type RootProps = PartComponentProps<"span", StateOf<Parts["root"]>, {
|
|
5
7
|
checked?: boolean;
|
|
6
8
|
defaultChecked?: boolean;
|
|
7
9
|
onCheckedChange?: (checked: boolean, details: ChangeDetails) => void;
|
|
8
10
|
indeterminate?: boolean;
|
|
11
|
+
parent?: boolean;
|
|
9
12
|
disabled?: boolean;
|
|
10
13
|
readOnly?: boolean;
|
|
11
14
|
required?: boolean;
|
|
@@ -13,12 +16,13 @@ export type RootProps = PartComponentProps & {
|
|
|
13
16
|
form?: string;
|
|
14
17
|
value?: string;
|
|
15
18
|
id?: string;
|
|
16
|
-
}
|
|
19
|
+
}>;
|
|
17
20
|
declare function Root(props: RootProps): JSX.Element;
|
|
18
|
-
|
|
19
|
-
declare function Indicator(props: PartComponentProps & {
|
|
21
|
+
export type IndicatorProps = PartComponentProps<"span", StateOf<Parts["indicator"]>, {
|
|
20
22
|
keepMounted?: boolean;
|
|
21
|
-
}
|
|
23
|
+
}>;
|
|
24
|
+
/** `keepMounted` keeps the mark in the page while the box is unchecked. */
|
|
25
|
+
declare function Indicator(props: IndicatorProps): JSX.Element;
|
|
22
26
|
export declare const Checkbox: {
|
|
23
27
|
Root: typeof Root;
|
|
24
28
|
Indicator: typeof Indicator;
|
package/types/collapsible.d.ts
CHANGED
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import type { ChangeDetails } from "@kirana-ui/core";
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
3
|
import type { JSX } from "solid-js";
|
|
3
4
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
-
|
|
5
|
+
type Parts = Vocabulary["collapsible"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
5
7
|
open?: boolean;
|
|
6
8
|
defaultOpen?: boolean;
|
|
7
9
|
onOpenChange?: (open: boolean, details: ChangeDetails) => void;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
id?: string;
|
|
10
|
-
}
|
|
12
|
+
}>;
|
|
11
13
|
declare function Root(props: RootProps): JSX.Element;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
15
|
+
export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, {
|
|
14
16
|
keepMounted?: boolean;
|
|
15
|
-
}
|
|
17
|
+
}>;
|
|
18
|
+
/** `keepMounted` keeps the closed panel in the page, `hidden`. */
|
|
19
|
+
declare function Panel(props: PanelProps): JSX.Element;
|
|
16
20
|
export declare const Collapsible: {
|
|
17
21
|
Root: typeof Root;
|
|
18
|
-
Trigger: (props:
|
|
22
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
19
23
|
Panel: typeof Panel;
|
|
20
24
|
};
|
|
21
25
|
export {};
|