@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/types/runtime.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Part as CorePart, PartProps, ReadonlySignal } from "@kirana-ui/core";
|
|
1
|
+
import type { Part as CorePart, PartEvent, PartProps, PartState, ReadonlySignal } from "@kirana-ui/core";
|
|
2
2
|
import type { JSX } from "solid-js";
|
|
3
3
|
/** A core signal as a Solid accessor: tracked by whatever calls it. */
|
|
4
4
|
export declare function fromSignal<T>(source: ReadonlySignal<T>): () => T;
|
|
@@ -8,22 +8,45 @@ export declare function toSignal<T extends Record<string, unknown>>(read: () =>
|
|
|
8
8
|
export declare function controller<P extends Record<string, unknown>, C extends {
|
|
9
9
|
mount(): () => void;
|
|
10
10
|
}>(create: (props: ReadonlySignal<P>) => C, read: () => P): C;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/** The elements a part can be drawn as: every tag Solid's JSX knows. */
|
|
12
|
+
export type PartTag = keyof JSX.IntrinsicElements;
|
|
13
|
+
/** What every part takes besides its element's own props. */
|
|
14
|
+
type Composition<State> = {
|
|
15
|
+
/**
|
|
16
|
+
* Renders the part as the caller's own element, which spreads the props it is given: what
|
|
17
|
+
* the element writes after the spread wins, so the caller decides. The props carry the
|
|
18
|
+
* part's `ref` and, as `children`, what the part holds: the children it was given, then
|
|
19
|
+
* anything of its own (a control's hidden input), so an element that writes no children of
|
|
20
|
+
* its own holds them, and one that does draws `props().children` among them. `state` reads
|
|
21
|
+
* the part's state (`open`, `side` …, from its `data-*` attributes).
|
|
22
|
+
*/
|
|
23
|
+
render?: (props: () => PartProps, state: () => State) => JSX.Element;
|
|
14
24
|
/** Another tag for the part's element. */
|
|
15
|
-
as?: string;
|
|
16
|
-
children?: JSX.Element;
|
|
17
|
-
[attribute: string]: unknown;
|
|
25
|
+
as?: PartTag | (string & {});
|
|
18
26
|
};
|
|
27
|
+
export type { PartEvent };
|
|
28
|
+
type Hearing<Prop> = Prop extends (event: infer Heard) => infer Answer ? Heard extends Event ? (event: PartEvent<Heard>) => Answer : Prop : Prop;
|
|
29
|
+
/**
|
|
30
|
+
* A part's props: its element's own (`Tag`'s attributes, its events with the element as their
|
|
31
|
+
* `currentTarget` and `preventKiranaHandler()` to keep the part's own handler out, a `ref` to
|
|
32
|
+
* that element), `render` and `as`, and the part's `Own` props, which come before the
|
|
33
|
+
* element's of the same name. `State` is what `render` reads: the part's state as the
|
|
34
|
+
* vocabulary defines it.
|
|
35
|
+
*/
|
|
36
|
+
export type PartComponentProps<Tag extends PartTag = "div", State = PartState, Own = {}> = Own & {
|
|
37
|
+
[Name in keyof JSX.IntrinsicElements[Tag] as Name extends keyof Own | keyof Composition<State> ? never : Name]: Hearing<JSX.IntrinsicElements[Tag][Name]>;
|
|
38
|
+
} & Omit<Composition<State>, keyof Own>;
|
|
19
39
|
/**
|
|
20
|
-
*
|
|
21
|
-
* part's and the part's DOM work attached once the element is in the page.
|
|
40
|
+
* The element of a part (`of`), or the caller's through `render`, with the caller's props merged under the
|
|
41
|
+
* part's and the part's DOM work attached once the element is in the page. What the part holds
|
|
42
|
+
* is its children here: with `as` they are the element's, and with `render` they are handed to
|
|
43
|
+
* the caller's function as the `children` of its props, so a control drawn as another element
|
|
44
|
+
* keeps the native input a form and a label reach.
|
|
22
45
|
*/
|
|
23
|
-
export declare function Part(props:
|
|
24
|
-
|
|
46
|
+
export declare function Part(props: {
|
|
47
|
+
of: CorePart;
|
|
25
48
|
tag: string;
|
|
26
|
-
}): JSX.Element;
|
|
49
|
+
} & Record<string, unknown>): JSX.Element;
|
|
27
50
|
/**
|
|
28
51
|
* Its children as children of `target`, an element drawn elsewhere: with no element of its own
|
|
29
52
|
* around them (Solid's `Portal` adds one), so the page is the same as on the other adapters.
|
|
@@ -32,6 +55,7 @@ export declare function Into(props: {
|
|
|
32
55
|
target: HTMLElement;
|
|
33
56
|
children?: JSX.Element;
|
|
34
57
|
}): JSX.Element;
|
|
58
|
+
/** What `PortalProvider` takes. */
|
|
35
59
|
export interface PortalProviderProps {
|
|
36
60
|
/** Where the popups inside are drawn; the end of `<body>` while it is not given. */
|
|
37
61
|
container?: HTMLElement | null | undefined;
|
package/types/scroll-area.d.ts
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
|
-
import type { Orientation } from "@kirana-ui/core";
|
|
1
|
+
import type { 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
|
-
|
|
6
|
-
declare function
|
|
5
|
+
type Parts = Vocabulary["scrollArea"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>>;
|
|
7
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
8
|
+
export type ScrollbarProps = PartComponentProps<"div", StateOf<Parts["scrollbar"]>, {
|
|
7
9
|
orientation?: Orientation;
|
|
8
10
|
keepMounted?: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare function
|
|
11
|
+
}>;
|
|
12
|
+
/** `orientation` is which way it scrolls (`vertical` by default). */
|
|
13
|
+
declare function Scrollbar(props: ScrollbarProps): JSX.Element;
|
|
14
|
+
export type ThumbProps = PartComponentProps<"div", StateOf<Parts["thumb"]>>;
|
|
15
|
+
declare function Thumb(props: ThumbProps): JSX.Element;
|
|
16
|
+
export type CornerProps = PartComponentProps<"div", StateOf<Parts["corner"]>>;
|
|
17
|
+
declare function Corner(props: CornerProps): JSX.Element;
|
|
18
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>>;
|
|
19
|
+
export type ContentProps = PartComponentProps<"div", StateOf<Parts["content"]>>;
|
|
12
20
|
export declare const ScrollArea: {
|
|
13
21
|
Root: typeof Root;
|
|
14
|
-
Viewport: (props:
|
|
15
|
-
Content: (props:
|
|
22
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
23
|
+
Content: (props: ContentProps) => JSX.Element;
|
|
16
24
|
Scrollbar: typeof Scrollbar;
|
|
17
25
|
Thumb: typeof Thumb;
|
|
18
26
|
Corner: typeof Corner;
|
package/types/select.d.ts
CHANGED
|
@@ -1,74 +1,83 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
2
|
import type { SelectProps } from "@kirana-ui/core/select";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { Accessor, JSX } from "solid-js";
|
|
5
|
+
import type { PortalProps, PositionerOptions } from "./popover.tsx";
|
|
5
6
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
required?: boolean;
|
|
15
|
-
name?: string;
|
|
16
|
-
form?: string;
|
|
17
|
-
items?: readonly {
|
|
18
|
-
value: unknown;
|
|
19
|
-
label: string;
|
|
20
|
-
}[];
|
|
21
|
-
virtualized?: SelectProps["virtualized"];
|
|
7
|
+
type Parts = Vocabulary["select"];
|
|
8
|
+
export type { PortalProps };
|
|
9
|
+
/**
|
|
10
|
+
* `Value` is what an item's `value` is: the root's `value` and `onValueChange` hold one or
|
|
11
|
+
* `null` for none, and with `multiple` its `values` and `onValuesChange` hold several.
|
|
12
|
+
*/
|
|
13
|
+
export type RootProps<Value = unknown> = Omit<SelectProps<Value>, "id"> & {
|
|
22
14
|
id?: string;
|
|
23
15
|
children?: JSX.Element;
|
|
24
16
|
};
|
|
25
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
17
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
18
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions & {
|
|
19
|
+
alignItemWithTrigger?: boolean;
|
|
20
|
+
}>;
|
|
26
21
|
/**
|
|
27
22
|
* `alignItemWithTrigger`: the list opens over its trigger, the chosen item's text on the
|
|
28
23
|
* trigger's own, where there is room and unless a finger opened it.
|
|
29
24
|
*/
|
|
30
|
-
declare function Positioner(props: PositionerProps
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
declare function Positioner(props: PositionerProps): JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Shows the chosen value's label, or `placeholder` while nothing is chosen; with `multiple`,
|
|
28
|
+
* the chosen labels with commas between. A function child draws something else: it is given
|
|
29
|
+
* the value and its label, or with `multiple` the values and their labels in the items'
|
|
30
|
+
* order, each as an accessor. Its first parameter's type says which:
|
|
31
|
+
* `(values: Accessor<string[]>, labels) => …`.
|
|
32
|
+
*/
|
|
33
|
+
export type ValueProps<Chosen = unknown> = PartComponentProps<"span", StateOf<Parts["value"]>, {
|
|
35
34
|
placeholder?: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
declare function
|
|
35
|
+
children?: JSX.Element | ((value: Accessor<Chosen>, label: Accessor<Chosen extends readonly unknown[] ? readonly string[] : string | undefined>) => JSX.Element);
|
|
36
|
+
}>;
|
|
37
|
+
declare function Value<Chosen = unknown>(props: ValueProps<Chosen>): JSX.Element;
|
|
38
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
39
39
|
value: unknown;
|
|
40
40
|
disabled?: boolean;
|
|
41
41
|
label?: string;
|
|
42
42
|
index?: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
}>;
|
|
44
|
+
/** `label` is what typeahead matches and the trigger shows; the item's text when left out. */
|
|
45
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
46
|
+
export type ItemTextProps = PartComponentProps<"span", StateOf<Parts["itemText"]>>;
|
|
47
|
+
export type ItemIndicatorProps = PartComponentProps<"span", StateOf<Parts["itemIndicator"]>, {
|
|
45
48
|
keepMounted?: boolean;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
}>;
|
|
50
|
+
declare function ItemIndicator(props: ItemIndicatorProps): JSX.Element;
|
|
51
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
49
52
|
id?: string;
|
|
50
|
-
}
|
|
53
|
+
}>;
|
|
54
|
+
/** Items that belong together, named by their `<Select.GroupLabel>`. */
|
|
55
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
56
|
+
export type GroupLabelProps = PartComponentProps<"div", StateOf<Parts["groupLabel"]>>;
|
|
57
|
+
export type ScrollUpArrowProps = PartComponentProps<"div", StateOf<Parts["scrollUpArrow"]>>;
|
|
58
|
+
export type ScrollDownArrowProps = PartComponentProps<"div", StateOf<Parts["scrollDownArrow"]>>;
|
|
59
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
60
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
61
|
+
export type ListProps = PartComponentProps<"div", StateOf<Parts["list"]>>;
|
|
62
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>>;
|
|
51
63
|
export declare const Select: {
|
|
52
64
|
Root: typeof Root;
|
|
53
|
-
Portal: (props:
|
|
54
|
-
children?: JSX.Element;
|
|
55
|
-
}) => JSX.Element;
|
|
65
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
56
66
|
Positioner: typeof Positioner;
|
|
57
67
|
Value: typeof Value;
|
|
58
68
|
Item: typeof Item;
|
|
59
|
-
ItemText: (props:
|
|
69
|
+
ItemText: (props: ItemTextProps) => JSX.Element;
|
|
60
70
|
ItemIndicator: typeof ItemIndicator;
|
|
61
|
-
Trigger: (props:
|
|
62
|
-
Popup: (props:
|
|
71
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
72
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
63
73
|
/** The items' own box inside the popup, when the popup also holds scroll arrows. */
|
|
64
|
-
List: (props:
|
|
74
|
+
List: (props: ListProps) => JSX.Element;
|
|
65
75
|
/** In the page while there is more of the list above: it scrolls it under a moving pointer. */
|
|
66
|
-
ScrollUpArrow: (props:
|
|
76
|
+
ScrollUpArrow: (props: ScrollUpArrowProps) => JSX.Element;
|
|
67
77
|
/** In the page while there is more of the list below. */
|
|
68
|
-
ScrollDownArrow: (props:
|
|
78
|
+
ScrollDownArrow: (props: ScrollDownArrowProps) => JSX.Element;
|
|
69
79
|
Group: typeof Group;
|
|
70
|
-
GroupLabel: (props:
|
|
80
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
71
81
|
/** A line between groups. */
|
|
72
|
-
Separator: (props:
|
|
82
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
73
83
|
};
|
|
74
|
-
export {};
|
package/types/separator.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { Orientation } from "@kirana-ui/core";
|
|
1
|
+
import type { 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
|
-
export
|
|
5
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Vocabulary["separator"]["root"]>, {
|
|
5
6
|
orientation?: Orientation;
|
|
6
|
-
}
|
|
7
|
+
}>;
|
|
8
|
+
export declare function Separator(props: SeparatorProps): JSX.Element;
|
package/types/slider.d.ts
CHANGED
|
@@ -1,24 +1,36 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { SliderProps, SliderValue } from "@kirana-ui/core/slider";
|
|
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
|
-
|
|
6
|
+
type Parts = Vocabulary["slider"];
|
|
7
|
+
/**
|
|
8
|
+
* `Value` is what the slider is given, `value` or `defaultValue`: a number for one thumb, a
|
|
9
|
+
* list for a range. What `onValueChange` and `onValueCommitted` are told is the same kind.
|
|
10
|
+
*/
|
|
11
|
+
export type RootProps<Value extends SliderValue = SliderValue> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<SliderProps<Value>, "id"> & {
|
|
5
12
|
id?: string;
|
|
6
|
-
}
|
|
7
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
8
|
-
|
|
9
|
-
declare function Thumb(props: PartComponentProps & {
|
|
13
|
+
}>;
|
|
14
|
+
declare function Root<Value extends SliderValue = number>(props: RootProps<Value>): JSX.Element;
|
|
15
|
+
export type ThumbProps = PartComponentProps<"div", StateOf<Parts["thumb"]>, {
|
|
10
16
|
index?: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
declare function
|
|
17
|
+
}>;
|
|
18
|
+
/** `index` is which value of a range the thumb is, from 0. */
|
|
19
|
+
declare function Thumb(props: ThumbProps): JSX.Element;
|
|
20
|
+
export type ValueProps = PartComponentProps<"output", StateOf<Parts["value"]>, {
|
|
14
21
|
children?: (text: () => string, values: () => readonly number[]) => JSX.Element;
|
|
15
|
-
}
|
|
22
|
+
}>;
|
|
23
|
+
/** The written value, or what its child, a function, makes of it and of the values. */
|
|
24
|
+
declare function Value(props: ValueProps): JSX.Element;
|
|
25
|
+
export type ControlProps = PartComponentProps<"div", StateOf<Parts["control"]>>;
|
|
26
|
+
export type TrackProps = PartComponentProps<"div", StateOf<Parts["track"]>>;
|
|
27
|
+
export type IndicatorProps = PartComponentProps<"div", StateOf<Parts["indicator"]>>;
|
|
16
28
|
export declare const Slider: {
|
|
17
29
|
Root: typeof Root;
|
|
18
30
|
Value: typeof Value;
|
|
19
|
-
Control: (props:
|
|
20
|
-
Track: (props:
|
|
21
|
-
Indicator: (props:
|
|
31
|
+
Control: (props: ControlProps) => JSX.Element;
|
|
32
|
+
Track: (props: TrackProps) => JSX.Element;
|
|
33
|
+
Indicator: (props: IndicatorProps) => JSX.Element;
|
|
22
34
|
Thumb: typeof Thumb;
|
|
23
35
|
};
|
|
24
36
|
export {};
|
package/types/switch.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["switch"];
|
|
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;
|
|
@@ -12,10 +14,11 @@ export type RootProps = PartComponentProps & {
|
|
|
12
14
|
form?: string;
|
|
13
15
|
value?: string;
|
|
14
16
|
id?: string;
|
|
15
|
-
}
|
|
17
|
+
}>;
|
|
16
18
|
declare function Root(props: RootProps): JSX.Element;
|
|
19
|
+
export type ThumbProps = PartComponentProps<"span", StateOf<Parts["thumb"]>>;
|
|
17
20
|
export declare const Switch: {
|
|
18
21
|
Root: typeof Root;
|
|
19
|
-
Thumb: (props:
|
|
22
|
+
Thumb: (props: ThumbProps) => JSX.Element;
|
|
20
23
|
};
|
|
21
24
|
export {};
|
package/types/tabs.d.ts
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { TabsProps } from "@kirana-ui/core/tabs";
|
|
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
|
-
orientation?: Orientation;
|
|
6
|
+
type Parts = Vocabulary["tabs"];
|
|
7
|
+
/** `Value` is what a tab's `value` is: the root's `value` holds the active one's. */
|
|
8
|
+
export type RootProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<TabsProps<Value>, "id"> & {
|
|
9
9
|
id?: string;
|
|
10
|
-
}
|
|
11
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
12
|
-
|
|
10
|
+
}>;
|
|
11
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
12
|
+
export type ListProps = PartComponentProps<"div", StateOf<Parts["list"]>, {
|
|
13
13
|
activateOnFocus?: boolean;
|
|
14
14
|
loop?: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare function
|
|
15
|
+
}>;
|
|
16
|
+
declare function List(props: ListProps): JSX.Element;
|
|
17
|
+
export type TabProps = PartComponentProps<"button", StateOf<Parts["tab"]>, {
|
|
17
18
|
value: unknown;
|
|
18
19
|
disabled?: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
}>;
|
|
21
|
+
declare function Tab(props: TabProps): JSX.Element;
|
|
22
|
+
export type IndicatorProps = PartComponentProps<"span", StateOf<Parts["indicator"]>>;
|
|
23
|
+
export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, {
|
|
22
24
|
value: unknown;
|
|
23
25
|
keepMounted?: boolean;
|
|
24
|
-
}
|
|
26
|
+
}>;
|
|
27
|
+
/** `keepMounted` keeps the panel in the page, `hidden`, while its tab is not the active one. */
|
|
28
|
+
declare function Panel(props: PanelProps): JSX.Element;
|
|
25
29
|
export declare const Tabs: {
|
|
26
30
|
Root: typeof Root;
|
|
27
31
|
List: typeof List;
|
|
28
32
|
Tab: typeof Tab;
|
|
29
|
-
Indicator: (props:
|
|
33
|
+
Indicator: (props: IndicatorProps) => JSX.Element;
|
|
30
34
|
Panel: typeof Panel;
|
|
31
35
|
};
|
|
32
36
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@kirana-ui/core/testing";
|
package/types/toast.d.ts
CHANGED
|
@@ -1,33 +1,57 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as Core from "@kirana-ui/core/toast";
|
|
2
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
2
4
|
import type { Accessor, JSX } from "solid-js";
|
|
3
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
-
/**
|
|
5
|
-
|
|
6
|
+
/** What a toast's title, description and action's label may be here: anything Solid draws. */
|
|
7
|
+
export type ToastContent = JSX.Element;
|
|
8
|
+
export type ToastActionOptions<Content = JSX.Element> = Core.ToastActionOptions<Content>;
|
|
9
|
+
export type ToastOptions<Content = JSX.Element> = Core.ToastOptions<Content>;
|
|
10
|
+
export type ToastRecord<Content = JSX.Element> = Core.ToastRecord<Content>;
|
|
11
|
+
export type ToastState<Content = JSX.Element> = Core.ToastState<Content>;
|
|
12
|
+
export type Toaster<Content = JSX.Element> = Core.Toaster<Content>;
|
|
13
|
+
export type { ToasterOptions } from "@kirana-ui/core/toast";
|
|
14
|
+
/**
|
|
15
|
+
* The toasts of a page, made once, in a module: `toaster.add({ title })` from anywhere. A
|
|
16
|
+
* title, a description and an action's label are anything Solid draws, unless `Content` says
|
|
17
|
+
* otherwise.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createToaster: <Content = JSX.Element>(options?: Core.ToasterOptions) => Toaster<Content>;
|
|
20
|
+
type ToastProps = Core.ToastProps<JSX.Element>;
|
|
21
|
+
type Parts = Vocabulary["toast"];
|
|
22
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>, {
|
|
6
23
|
toaster: Toaster;
|
|
7
24
|
label?: string;
|
|
8
25
|
hotkey?: string;
|
|
9
26
|
swipeDirection?: ToastProps["swipeDirection"];
|
|
10
27
|
id?: string;
|
|
11
|
-
}
|
|
28
|
+
}>;
|
|
29
|
+
/** Where a toaster's toasts are drawn. Always in the page: put it once, near the root. */
|
|
30
|
+
declare function Viewport(props: ViewportProps): JSX.Element;
|
|
31
|
+
export type ListProps = {
|
|
32
|
+
children: (toast: Accessor<ToastRecord>) => JSX.Element;
|
|
33
|
+
};
|
|
12
34
|
/**
|
|
13
35
|
* Draws its child once for each toast, the newest first. The child is given the toast as an
|
|
14
36
|
* accessor: one that changes is the same toast, drawn again where it stands.
|
|
15
37
|
*/
|
|
16
|
-
declare function List(props:
|
|
17
|
-
|
|
18
|
-
}): JSX.Element;
|
|
19
|
-
declare function Root(props: PartComponentProps & {
|
|
38
|
+
declare function List(props: ListProps): JSX.Element;
|
|
39
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
20
40
|
toast: ToastRecord;
|
|
21
|
-
}
|
|
41
|
+
}>;
|
|
42
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
43
|
+
export type ContentProps = PartComponentProps<"div", StateOf<Parts["content"]>>;
|
|
44
|
+
export type TitleProps = PartComponentProps<"div", StateOf<Parts["title"]>>;
|
|
45
|
+
export type DescriptionProps = PartComponentProps<"div", StateOf<Parts["description"]>>;
|
|
46
|
+
export type CloseProps = PartComponentProps<"button", StateOf<Parts["close"]>>;
|
|
47
|
+
export type ActionProps = PartComponentProps<"button", StateOf<Parts["action"]>>;
|
|
22
48
|
export declare const Toast: {
|
|
23
49
|
Viewport: typeof Viewport;
|
|
24
50
|
List: typeof List;
|
|
25
51
|
Root: typeof Root;
|
|
26
|
-
Content: (props:
|
|
27
|
-
Title: (props:
|
|
28
|
-
Description: (props:
|
|
29
|
-
Close: (props:
|
|
30
|
-
Action: (props:
|
|
52
|
+
Content: (props: ContentProps) => JSX.Element;
|
|
53
|
+
Title: (props: TitleProps) => JSX.Element;
|
|
54
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
55
|
+
Close: (props: CloseProps) => JSX.Element;
|
|
56
|
+
Action: (props: ActionProps) => JSX.Element;
|
|
31
57
|
};
|
|
32
|
-
export { createToaster } from "@kirana-ui/core/toast";
|
|
33
|
-
export type { ToastOptions, ToastRecord, Toaster } from "@kirana-ui/core/toast";
|
package/types/toggle-group.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { ToggleGroupProps as CoreProps } from "@kirana-ui/core/toggle-group";
|
|
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
|
-
defaultValue?: readonly unknown[];
|
|
7
|
-
onValueChange?: (value: unknown[], details: ChangeDetails) => void;
|
|
8
|
-
multiple?: boolean;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
orientation?: Orientation;
|
|
11
|
-
loop?: boolean;
|
|
12
|
-
};
|
|
6
|
+
/** `Value` is what a toggle's `value` is: the group's `value` holds the pressed ones. */
|
|
7
|
+
export type ToggleGroupProps<Value = unknown> = PartComponentProps<"div", StateOf<Vocabulary["toggleGroup"]["root"]>, CoreProps<Value>>;
|
|
13
8
|
/** Toggles that are one control. Each `<Toggle value>` inside it is one of its toggles. */
|
|
14
|
-
export declare function ToggleGroup(props: ToggleGroupProps): JSX.Element;
|
|
9
|
+
export declare function ToggleGroup<Value = unknown>(props: ToggleGroupProps<Value>): JSX.Element;
|
package/types/toggle.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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
|
-
export type ToggleProps = PartComponentProps
|
|
5
|
+
export type ToggleProps = PartComponentProps<"button", StateOf<Vocabulary["toggle"]["root"]>, {
|
|
5
6
|
pressed?: boolean;
|
|
6
7
|
defaultPressed?: boolean;
|
|
7
8
|
onPressedChange?: (pressed: boolean, details: ChangeDetails) => void;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
/** In a toggle group: what the group's value holds while this one is pressed. */
|
|
10
11
|
value?: unknown;
|
|
11
|
-
}
|
|
12
|
+
}>;
|
|
12
13
|
export declare function Toggle(props: ToggleProps): JSX.Element;
|
package/types/toolbar.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import type { Orientation } from "@kirana-ui/core";
|
|
1
|
+
import type { 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["toolbar"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
5
7
|
orientation?: Orientation;
|
|
6
8
|
loop?: boolean;
|
|
7
9
|
disabled?: boolean;
|
|
8
|
-
}
|
|
10
|
+
}>;
|
|
11
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
12
|
+
type ItemOptions = {
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type ButtonProps = PartComponentProps<"button", StateOf<Parts["button"]>, ItemOptions>;
|
|
16
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>, ItemOptions>;
|
|
17
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, ItemOptions>;
|
|
18
|
+
export type LinkProps = PartComponentProps<"a", StateOf<Parts["link"]>>;
|
|
19
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>>;
|
|
9
20
|
export declare const Toolbar: {
|
|
10
21
|
Root: typeof Root;
|
|
11
|
-
Button: (props:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
}) => JSX.Element;
|
|
18
|
-
Group: (props: PartComponentProps & {
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
}) => JSX.Element;
|
|
21
|
-
Separator: (props: PartComponentProps) => JSX.Element;
|
|
22
|
+
Button: (props: ButtonProps) => JSX.Element;
|
|
23
|
+
Link: (props: LinkProps) => JSX.Element;
|
|
24
|
+
Input: (props: InputProps) => JSX.Element;
|
|
25
|
+
Group: (props: GroupProps) => JSX.Element;
|
|
26
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
22
27
|
};
|
|
23
28
|
export {};
|
package/types/tooltip.d.ts
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { TriggerOptions } from "./hover-popup.tsx";
|
|
4
|
+
import type { PositionerOptions } from "./popover.tsx";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["tooltip"];
|
|
7
|
+
export type { PortalProps, RootProps } from "./hover-popup.tsx";
|
|
8
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>, TriggerOptions>;
|
|
9
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
|
|
10
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
11
|
+
export type ArrowProps = PartComponentProps<"div", StateOf<Parts["arrow"]>>;
|
|
1
12
|
export declare const Tooltip: {
|
|
2
13
|
Root: (props: import("./hover-popup.tsx").RootProps) => import("solid-js").JSX.Element;
|
|
3
|
-
Portal: (props:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
delay?: number;
|
|
9
|
-
closeDelay?: number;
|
|
10
|
-
}) => import("solid-js").JSX.Element;
|
|
11
|
-
Popup: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
12
|
-
Arrow: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
14
|
+
Portal: (props: import("./hover-popup.tsx").PortalProps) => import("solid-js").JSX.Element;
|
|
15
|
+
Positioner: (props: PositionerProps) => import("solid-js").JSX.Element;
|
|
16
|
+
Trigger: (props: TriggerProps) => import("solid-js").JSX.Element;
|
|
17
|
+
Popup: (props: PopupProps) => import("solid-js").JSX.Element;
|
|
18
|
+
Arrow: (props: ArrowProps) => import("solid-js").JSX.Element;
|
|
13
19
|
};
|
package/types/value-bar.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import type { ReadonlySignal } from "@kirana-ui/core";
|
|
2
2
|
import type { ValueBar, ValueBarProps } from "@kirana-ui/core/progress";
|
|
3
3
|
import type { JSX } from "solid-js";
|
|
4
|
-
|
|
5
|
-
export type
|
|
4
|
+
/** A value bar's own props: its value, its range and how the value is written. */
|
|
5
|
+
export type RootOptions = Omit<ValueBarProps, "id"> & {
|
|
6
6
|
id?: string;
|
|
7
7
|
};
|
|
8
|
+
/** A written value's own props: a function child draws something else of the text. */
|
|
9
|
+
export type ValueOptions = {
|
|
10
|
+
children?: (text: () => string | undefined) => JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
/** The props of each part, as the component's entry names them. */
|
|
13
|
+
type PartsProps = {
|
|
14
|
+
Root: RootOptions;
|
|
15
|
+
Value: ValueOptions;
|
|
16
|
+
Track: Record<string, unknown>;
|
|
17
|
+
Indicator: Record<string, unknown>;
|
|
18
|
+
Label: Record<string, unknown>;
|
|
19
|
+
};
|
|
8
20
|
/** The parts of a value drawn as a filled track: a progress bar's, a meter's. */
|
|
9
|
-
export declare function valueBar(name: string, create: (props: ReadonlySignal<ValueBarProps>) => ValueBar): {
|
|
10
|
-
Root: (props:
|
|
11
|
-
Value: (props:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Indicator: (props: PartComponentProps) => JSX.Element;
|
|
16
|
-
Label: (props: PartComponentProps) => JSX.Element;
|
|
21
|
+
export declare function valueBar<Props extends PartsProps>(name: string, create: (props: ReadonlySignal<ValueBarProps>) => ValueBar): {
|
|
22
|
+
Root: (props: Props["Root"]) => JSX.Element;
|
|
23
|
+
Value: (props: Props["Value"]) => JSX.Element;
|
|
24
|
+
Track: (props: Props["Track"]) => JSX.Element;
|
|
25
|
+
Indicator: (props: Props["Indicator"]) => JSX.Element;
|
|
26
|
+
Label: (props: Props["Label"]) => JSX.Element;
|
|
17
27
|
};
|
|
28
|
+
export {};
|