@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/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, EmptyProps, GroupLabelProps, GroupProps, InputProps, ItemProps, ListProps, PopupProps, PortalProps, PositionerProps, SeparatorProps, 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,19 @@
|
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
declare function
|
|
5
|
+
type Parts = Vocabulary["avatar"];
|
|
6
|
+
export type RootProps = PartComponentProps<"span", StateOf<Parts["root"]>>;
|
|
7
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
8
|
+
export type ImageProps = PartComponentProps<"img", StateOf<Parts["image"]>, {
|
|
9
|
+
/** The picture's address: the element is in the page once it has loaded. */
|
|
6
10
|
src?: string;
|
|
7
|
-
}
|
|
11
|
+
}>;
|
|
12
|
+
/** The picture: in the page once `src` has loaded. */
|
|
13
|
+
declare function Image(props: ImageProps): JSX.Element;
|
|
14
|
+
export type FallbackProps = PartComponentProps<"span", StateOf<Parts["fallback"]>>;
|
|
8
15
|
/** What shows until the picture has loaded, or when it cannot. */
|
|
9
|
-
declare function Fallback(props:
|
|
16
|
+
declare function Fallback(props: FallbackProps): JSX.Element;
|
|
10
17
|
export declare const Avatar: {
|
|
11
18
|
Root: typeof Root;
|
|
12
19
|
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,37 +1,54 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
1
2
|
import type { Calendar as Controller, CalendarDay, 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
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<CalendarProps, "id"> & {
|
|
8
15
|
id?: string;
|
|
9
|
-
}
|
|
16
|
+
}>;
|
|
17
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
18
|
+
export type HeadingProps = PartComponentProps<"div", StateOf<Parts["heading"]>>;
|
|
10
19
|
/** Names the month shown, unless it is given something else to say. */
|
|
11
|
-
declare function Heading(props:
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
declare function Heading(props: HeadingProps): JSX.Element;
|
|
21
|
+
export type PreviousProps = PartComponentProps<"button", StateOf<Parts["previous"]>>;
|
|
22
|
+
export type NextProps = PartComponentProps<"button", StateOf<Parts["next"]>>;
|
|
23
|
+
export type GridProps = PartComponentProps<"table", StateOf<Parts["grid"]>>;
|
|
24
|
+
export type WeekdaysProps = {
|
|
14
25
|
children: (weekday: CalendarWeekday) => JSX.Element;
|
|
15
|
-
}
|
|
16
|
-
/** Draws its child once for each
|
|
17
|
-
declare function
|
|
26
|
+
};
|
|
27
|
+
/** Draws its child once for each day of the week, in the locale's order. */
|
|
28
|
+
declare function Weekdays(props: WeekdaysProps): JSX.Element;
|
|
29
|
+
export type WeeksProps = {
|
|
18
30
|
children: (week: readonly CalendarDay[]) => JSX.Element;
|
|
19
|
-
}
|
|
20
|
-
|
|
31
|
+
};
|
|
32
|
+
/** Draws its child once for each week of the month shown. */
|
|
33
|
+
declare function Weeks(props: WeeksProps): JSX.Element;
|
|
34
|
+
export type HeadCellProps = PartComponentProps<"th", StateOf<Parts["headCell"]>, {
|
|
21
35
|
weekday: CalendarWeekday;
|
|
22
|
-
}
|
|
23
|
-
declare function
|
|
36
|
+
}>;
|
|
37
|
+
declare function HeadCell(props: HeadCellProps): JSX.Element;
|
|
38
|
+
export type CellProps = PartComponentProps<"td", StateOf<Parts["cell"]>, {
|
|
24
39
|
date: string;
|
|
25
|
-
}
|
|
26
|
-
declare function
|
|
40
|
+
}>;
|
|
41
|
+
declare function Cell(props: CellProps): JSX.Element;
|
|
42
|
+
export type DayProps = PartComponentProps<"button", StateOf<Parts["day"]>, {
|
|
27
43
|
date: string;
|
|
28
|
-
}
|
|
44
|
+
}>;
|
|
45
|
+
declare function Day(props: DayProps): JSX.Element;
|
|
29
46
|
export declare const Calendar: {
|
|
30
47
|
Root: typeof Root;
|
|
31
48
|
Heading: typeof Heading;
|
|
32
|
-
Previous: (props:
|
|
33
|
-
Next: (props:
|
|
34
|
-
Grid: (props:
|
|
49
|
+
Previous: (props: PreviousProps) => JSX.Element;
|
|
50
|
+
Next: (props: NextProps) => JSX.Element;
|
|
51
|
+
Grid: (props: GridProps) => JSX.Element;
|
|
35
52
|
Weekdays: typeof Weekdays;
|
|
36
53
|
HeadCell: typeof HeadCell;
|
|
37
54
|
Weeks: typeof Weeks;
|
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 {};
|
package/types/checkbox.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
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;
|
|
@@ -13,12 +15,13 @@ export type RootProps = PartComponentProps & {
|
|
|
13
15
|
form?: string;
|
|
14
16
|
value?: string;
|
|
15
17
|
id?: string;
|
|
16
|
-
}
|
|
18
|
+
}>;
|
|
17
19
|
declare function Root(props: RootProps): JSX.Element;
|
|
18
|
-
|
|
19
|
-
declare function Indicator(props: PartComponentProps & {
|
|
20
|
+
export type IndicatorProps = PartComponentProps<"span", StateOf<Parts["indicator"]>, {
|
|
20
21
|
keepMounted?: boolean;
|
|
21
|
-
}
|
|
22
|
+
}>;
|
|
23
|
+
/** `keepMounted` keeps the mark in the page while the box is unchecked. */
|
|
24
|
+
declare function Indicator(props: IndicatorProps): JSX.Element;
|
|
22
25
|
export declare const Checkbox: {
|
|
23
26
|
Root: typeof Root;
|
|
24
27
|
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 {};
|
package/types/combobox.d.ts
CHANGED
|
@@ -1,64 +1,62 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
2
|
import type { AutocompleteProps } from "@kirana-ui/core/autocomplete";
|
|
3
3
|
import type { ComboboxProps } from "@kirana-ui/core/combobox";
|
|
4
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
5
|
import type { JSX } from "solid-js";
|
|
5
|
-
import type {
|
|
6
|
+
import type { PortalProps, PositionerOptions } from "./popover.tsx";
|
|
6
7
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
open?: boolean;
|
|
15
|
-
defaultOpen?: boolean;
|
|
16
|
-
onOpenChange?: (open: boolean, details: ChangeDetails) => void;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
required?: boolean;
|
|
19
|
-
multiple?: boolean;
|
|
20
|
-
values?: readonly unknown[];
|
|
21
|
-
defaultValues?: readonly unknown[];
|
|
22
|
-
onValuesChange?: (values: unknown[], details: ChangeDetails) => void;
|
|
23
|
-
inline?: boolean;
|
|
24
|
-
virtualized?: ComboboxProps["virtualized"];
|
|
25
|
-
name?: string;
|
|
26
|
-
form?: string;
|
|
27
|
-
items?: readonly {
|
|
28
|
-
value: unknown;
|
|
29
|
-
label: string;
|
|
30
|
-
}[];
|
|
31
|
-
filter?: ((label: string, query: string) => boolean) | null;
|
|
8
|
+
type Parts = Vocabulary["combobox"];
|
|
9
|
+
export type { PortalProps };
|
|
10
|
+
/**
|
|
11
|
+
* `Value` is what an item's `value` is: the root's `value` and `onValueChange` hold one or
|
|
12
|
+
* `null` for none, and with `multiple` its `values` and `onValuesChange` hold several.
|
|
13
|
+
*/
|
|
14
|
+
export type RootProps<Value = unknown> = Omit<ComboboxProps<Value>, "id"> & {
|
|
32
15
|
id?: string;
|
|
33
16
|
children?: JSX.Element;
|
|
34
17
|
};
|
|
35
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
18
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
19
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
|
|
36
20
|
declare function Positioner(props: PositionerProps): JSX.Element;
|
|
37
|
-
|
|
38
|
-
declare function Item(props: PartComponentProps & {
|
|
21
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
39
22
|
value: unknown;
|
|
40
23
|
disabled?: boolean;
|
|
41
24
|
label?: string;
|
|
42
25
|
id?: string;
|
|
43
26
|
index?: number;
|
|
44
|
-
}
|
|
45
|
-
|
|
27
|
+
}>;
|
|
28
|
+
/** `label` is what is filtered and what the input shows; the item's text when left out. */
|
|
29
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
30
|
+
export type ItemIndicatorProps = PartComponentProps<"span", StateOf<Parts["itemIndicator"]>, {
|
|
46
31
|
keepMounted?: boolean;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
32
|
+
}>;
|
|
33
|
+
declare function ItemIndicator(props: ItemIndicatorProps): JSX.Element;
|
|
34
|
+
export type ClearProps = PartComponentProps<"button", StateOf<Parts["clear"]>, {
|
|
50
35
|
keepMounted?: boolean;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
declare function
|
|
36
|
+
}>;
|
|
37
|
+
/** A button that empties the input and the value. Drawn while there is something to clear. */
|
|
38
|
+
declare function Clear(props: ClearProps): JSX.Element;
|
|
39
|
+
export type ChipProps = PartComponentProps<"span", StateOf<Parts["chip"]>, {
|
|
54
40
|
value: unknown;
|
|
55
|
-
}
|
|
41
|
+
}>;
|
|
42
|
+
/** With `multiple`: one chosen value. Its `value` is what its remove button takes away. */
|
|
43
|
+
declare function Chip(props: ChipProps): JSX.Element;
|
|
44
|
+
export type ChipRemoveProps = PartComponentProps<"button", StateOf<Parts["chipRemove"]>>;
|
|
45
|
+
export type EmptyProps = PartComponentProps<"div", StateOf<Parts["empty"]>>;
|
|
56
46
|
/** Drawn while no item is shown for what was typed. */
|
|
57
|
-
declare function Empty(props:
|
|
58
|
-
|
|
59
|
-
declare function Group(props: PartComponentProps & {
|
|
47
|
+
declare function Empty(props: EmptyProps): JSX.Element;
|
|
48
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
60
49
|
id?: string;
|
|
61
|
-
}
|
|
50
|
+
}>;
|
|
51
|
+
/** Items that belong together, named by their `GroupLabel`. Hidden while none is shown. */
|
|
52
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
53
|
+
export type GroupLabelProps = PartComponentProps<"div", StateOf<Parts["groupLabel"]>>;
|
|
54
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
55
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
56
|
+
export type ChipsProps = PartComponentProps<"div", StateOf<Parts["chips"]>>;
|
|
57
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
58
|
+
export type ListProps = PartComponentProps<"div", StateOf<Parts["list"]>>;
|
|
59
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>>;
|
|
62
60
|
export type AutocompleteRootProps = Omit<AutocompleteProps, "id"> & {
|
|
63
61
|
id?: string;
|
|
64
62
|
children?: JSX.Element;
|
|
@@ -67,40 +65,41 @@ export type AutocompleteRootProps = Omit<AutocompleteProps, "id"> & {
|
|
|
67
65
|
declare function AutocompleteRoot(props: AutocompleteRootProps): JSX.Element;
|
|
68
66
|
export declare const Combobox: {
|
|
69
67
|
Root: typeof Root;
|
|
70
|
-
Input: (props:
|
|
71
|
-
Trigger: (props:
|
|
68
|
+
Input: (props: InputProps) => JSX.Element;
|
|
69
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
72
70
|
Clear: typeof Clear;
|
|
73
71
|
/** With `multiple`: what holds the chips and the input. */
|
|
74
|
-
Chips: (props:
|
|
72
|
+
Chips: (props: ChipsProps) => JSX.Element;
|
|
75
73
|
Chip: typeof Chip;
|
|
76
|
-
ChipRemove: (props:
|
|
77
|
-
Portal: (props:
|
|
78
|
-
children?: JSX.Element;
|
|
79
|
-
}) => JSX.Element;
|
|
74
|
+
ChipRemove: (props: ChipRemoveProps) => JSX.Element;
|
|
75
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
80
76
|
Positioner: typeof Positioner;
|
|
81
|
-
Popup: (props:
|
|
77
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* The items' own box inside the popup, when the popup holds more than items (an input): it
|
|
80
|
+
* is then the listbox.
|
|
81
|
+
*/
|
|
82
|
+
List: (props: ListProps) => JSX.Element;
|
|
82
83
|
Group: typeof Group;
|
|
83
|
-
GroupLabel: (props:
|
|
84
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
84
85
|
/** A line between groups. */
|
|
85
|
-
Separator: (props:
|
|
86
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
86
87
|
Item: typeof Item;
|
|
87
88
|
ItemIndicator: typeof ItemIndicator;
|
|
88
89
|
Empty: typeof Empty;
|
|
89
90
|
};
|
|
90
91
|
export declare const Autocomplete: {
|
|
91
92
|
Root: typeof AutocompleteRoot;
|
|
92
|
-
Input: (props:
|
|
93
|
-
Trigger: (props:
|
|
93
|
+
Input: (props: InputProps) => JSX.Element;
|
|
94
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
94
95
|
Clear: typeof Clear;
|
|
95
|
-
Portal: (props:
|
|
96
|
-
children?: JSX.Element;
|
|
97
|
-
}) => JSX.Element;
|
|
96
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
98
97
|
Positioner: typeof Positioner;
|
|
99
|
-
Popup: (props:
|
|
98
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
99
|
+
List: (props: ListProps) => JSX.Element;
|
|
100
100
|
Group: typeof Group;
|
|
101
|
-
GroupLabel: (props:
|
|
102
|
-
Separator: (props:
|
|
101
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
102
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
103
103
|
Item: typeof Item;
|
|
104
104
|
Empty: typeof Empty;
|
|
105
105
|
};
|
|
106
|
-
export {};
|