@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/types/combobox.d.ts
CHANGED
|
@@ -1,64 +1,91 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
2
|
import type { AutocompleteProps } from "@kirana-ui/core/autocomplete";
|
|
3
|
-
import type { ComboboxProps } from "@kirana-ui/core/combobox";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
3
|
+
import type { ComboboxEntry, ComboboxProps } from "@kirana-ui/core/combobox";
|
|
4
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
5
|
+
import type { Accessor, JSX } from "solid-js";
|
|
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"]>>;
|
|
60
|
+
export type StatusProps = PartComponentProps<"div", StateOf<Parts["status"]>>;
|
|
61
|
+
export type ValueProps<Chosen = unknown> = {
|
|
62
|
+
/** Shown while nothing is chosen. */
|
|
63
|
+
placeholder?: JSX.Element;
|
|
64
|
+
/**
|
|
65
|
+
* What to show in place of the label. A function is given the value and its label, each to
|
|
66
|
+
* be called where it is read (`null` and `undefined` while nothing is chosen); with
|
|
67
|
+
* `multiple`, the values and their labels, in the order they were chosen.
|
|
68
|
+
*/
|
|
69
|
+
children?: JSX.Element | ((value: Accessor<Chosen>, label: Accessor<Chosen extends readonly unknown[] ? readonly string[] : string | undefined>) => JSX.Element);
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* The chosen value's label, or `placeholder` while nothing is chosen; with `multiple`, the
|
|
73
|
+
* chosen labels with commas between. For a button that is the combobox, its input inside the
|
|
74
|
+
* popup. It draws no element.
|
|
75
|
+
*/
|
|
76
|
+
declare function Value<Chosen = unknown>(props: ValueProps<Chosen>): JSX.Element;
|
|
77
|
+
export type CollectionProps<Value = unknown> = {
|
|
78
|
+
/** A group the root's `items` gave: its items left are then what is drawn. */
|
|
79
|
+
of?: ComboboxEntry<Value> | undefined;
|
|
80
|
+
/** Drawn once for each item left, or for each group that has items left. */
|
|
81
|
+
children: (entry: ComboboxEntry<Value>) => JSX.Element;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Draws the list from the root's `items`: its child once for each item left for what was
|
|
85
|
+
* typed, or for each group that has items left; with `of`, for each of that group's. The root
|
|
86
|
+
* then filters, and no item hides itself. It draws no element.
|
|
87
|
+
*/
|
|
88
|
+
declare function Collection<Value = unknown>(props: CollectionProps<Value>): JSX.Element;
|
|
62
89
|
export type AutocompleteRootProps = Omit<AutocompleteProps, "id"> & {
|
|
63
90
|
id?: string;
|
|
64
91
|
children?: JSX.Element;
|
|
@@ -67,40 +94,51 @@ export type AutocompleteRootProps = Omit<AutocompleteProps, "id"> & {
|
|
|
67
94
|
declare function AutocompleteRoot(props: AutocompleteRootProps): JSX.Element;
|
|
68
95
|
export declare const Combobox: {
|
|
69
96
|
Root: typeof Root;
|
|
70
|
-
Input: (props:
|
|
71
|
-
Trigger: (props:
|
|
97
|
+
Input: (props: InputProps) => JSX.Element;
|
|
98
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
99
|
+
Value: typeof Value;
|
|
72
100
|
Clear: typeof Clear;
|
|
73
101
|
/** With `multiple`: what holds the chips and the input. */
|
|
74
|
-
Chips: (props:
|
|
102
|
+
Chips: (props: ChipsProps) => JSX.Element;
|
|
75
103
|
Chip: typeof Chip;
|
|
76
|
-
ChipRemove: (props:
|
|
77
|
-
Portal: (props:
|
|
78
|
-
children?: JSX.Element;
|
|
79
|
-
}) => JSX.Element;
|
|
104
|
+
ChipRemove: (props: ChipRemoveProps) => JSX.Element;
|
|
105
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
80
106
|
Positioner: typeof Positioner;
|
|
81
|
-
Popup: (props:
|
|
107
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
108
|
+
/**
|
|
109
|
+
* The items' own box inside the popup, when the popup holds more than items (an input): it
|
|
110
|
+
* is then the listbox.
|
|
111
|
+
*/
|
|
112
|
+
List: (props: ListProps) => JSX.Element;
|
|
113
|
+
Collection: typeof Collection;
|
|
82
114
|
Group: typeof Group;
|
|
83
|
-
GroupLabel: (props:
|
|
115
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
84
116
|
/** A line between groups. */
|
|
85
|
-
Separator: (props:
|
|
117
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
86
118
|
Item: typeof Item;
|
|
87
119
|
ItemIndicator: typeof ItemIndicator;
|
|
88
120
|
Empty: typeof Empty;
|
|
121
|
+
/**
|
|
122
|
+
* Says how the list stands ("3 results", "Loading") to software that reads the page, as its
|
|
123
|
+
* text changes. Keep it in the page and change what it holds: inside the popup, or beside
|
|
124
|
+
* the input.
|
|
125
|
+
*/
|
|
126
|
+
Status: (props: StatusProps) => JSX.Element;
|
|
89
127
|
};
|
|
90
128
|
export declare const Autocomplete: {
|
|
91
129
|
Root: typeof AutocompleteRoot;
|
|
92
|
-
Input: (props:
|
|
93
|
-
Trigger: (props:
|
|
130
|
+
Input: (props: InputProps) => JSX.Element;
|
|
131
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
94
132
|
Clear: typeof Clear;
|
|
95
|
-
Portal: (props:
|
|
96
|
-
children?: JSX.Element;
|
|
97
|
-
}) => JSX.Element;
|
|
133
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
98
134
|
Positioner: typeof Positioner;
|
|
99
|
-
Popup: (props:
|
|
135
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
136
|
+
List: (props: ListProps) => JSX.Element;
|
|
137
|
+
Collection: typeof Collection;
|
|
100
138
|
Group: typeof Group;
|
|
101
|
-
GroupLabel: (props:
|
|
102
|
-
Separator: (props:
|
|
139
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
140
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
103
141
|
Item: typeof Item;
|
|
104
142
|
Empty: typeof Empty;
|
|
143
|
+
Status: (props: StatusProps) => JSX.Element;
|
|
105
144
|
};
|
|
106
|
-
export {};
|
package/types/command.d.ts
CHANGED
|
@@ -1,41 +1,53 @@
|
|
|
1
|
-
import type { ChangeDetails } from "@kirana-ui/core";
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
2
|
import type { CommandProps } from "@kirana-ui/core/command";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
4
|
import type { JSX } from "solid-js";
|
|
4
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
5
|
-
|
|
6
|
+
type Parts = Vocabulary["command"];
|
|
7
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
6
8
|
inputValue?: string;
|
|
7
9
|
defaultInputValue?: string;
|
|
8
10
|
onInputValueChange?: (value: string, details: ChangeDetails) => void;
|
|
11
|
+
/** An item was chosen. It takes the place of the element's own `select` event. */
|
|
9
12
|
onSelect?: (value: string, details: ChangeDetails) => void;
|
|
10
13
|
filter?: CommandProps["filter"];
|
|
11
14
|
loop?: boolean;
|
|
15
|
+
/** Whether the first item shown is highlighted from the start. Default: `true`. */
|
|
16
|
+
autoHighlight?: boolean;
|
|
12
17
|
disabled?: boolean;
|
|
13
18
|
id?: string;
|
|
14
|
-
}
|
|
19
|
+
}>;
|
|
15
20
|
declare function Root(props: RootProps): JSX.Element;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
22
|
+
export type ListProps = PartComponentProps<"div", StateOf<Parts["list"]>>;
|
|
23
|
+
export type EmptyProps = PartComponentProps<"div", StateOf<Parts["empty"]>>;
|
|
24
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
20
25
|
id?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
declare function Item(props: PartComponentProps & {
|
|
26
|
+
}>;
|
|
27
|
+
export type GroupHeadingProps = PartComponentProps<"div", StateOf<Parts["groupHeading"]>>;
|
|
28
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
25
29
|
value: string;
|
|
26
30
|
disabled?: boolean;
|
|
27
31
|
label?: string;
|
|
28
32
|
keywords?: readonly string[];
|
|
29
33
|
id?: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
declare function Separator(props: PartComponentProps & {
|
|
34
|
+
}>;
|
|
35
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>, {
|
|
33
36
|
alwaysRender?: boolean;
|
|
34
|
-
}
|
|
37
|
+
}>;
|
|
38
|
+
/** Drawn while no item is shown for what was typed. */
|
|
39
|
+
declare function Empty(props: EmptyProps): JSX.Element;
|
|
40
|
+
/** Items under a `<Command.GroupHeading>`. Hidden while none of them is shown. */
|
|
41
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
42
|
+
declare function GroupHeading(props: GroupHeadingProps): JSX.Element;
|
|
43
|
+
/** `label` is what is filtered, the item's text when left out; `keywords` are other words for it. */
|
|
44
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
45
|
+
/** A line between groups: gone while something is typed, unless `alwaysRender`. */
|
|
46
|
+
declare function Separator(props: SeparatorProps): JSX.Element;
|
|
35
47
|
export declare const Command: {
|
|
36
48
|
Root: typeof Root;
|
|
37
|
-
Input: (props:
|
|
38
|
-
List: (props:
|
|
49
|
+
Input: (props: InputProps) => JSX.Element;
|
|
50
|
+
List: (props: ListProps) => JSX.Element;
|
|
39
51
|
Empty: typeof Empty;
|
|
40
52
|
Group: typeof Group;
|
|
41
53
|
GroupHeading: typeof GroupHeading;
|
package/types/context-menu.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
1
|
export { ContextMenu } from "./menu.tsx";
|
|
2
|
+
export type { ArrowProps, CheckboxItemIndicatorProps, CheckboxItemProps, ContextRootProps as RootProps, ContextTriggerProps as TriggerProps, GroupLabelProps, GroupProps, ItemProps, LinkItemProps, PopupProps, PortalProps, PositionerProps, RadioGroupProps, RadioItemIndicatorProps, RadioItemProps, SeparatorProps, SubmenuRootProps, SubmenuTriggerProps, } from "./menu.tsx";
|
package/types/date-field.d.ts
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
1
2
|
import type { DateField as Controller, DateFieldProps, DateFieldSegment } from "@kirana-ui/core/date-field";
|
|
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["dateField"];
|
|
7
|
+
/**
|
|
8
|
+
* The date field its parts are inside. Exported for a component that is made of one (a date picker
|
|
9
|
+
* provides its own to the date field'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 DateFieldContext };
|
|
7
|
-
|
|
14
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<DateFieldProps, "id"> & {
|
|
8
15
|
id?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
}>;
|
|
17
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
18
|
+
export type SegmentsProps = {
|
|
12
19
|
children: (segment: DateFieldSegment) => JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
declare function
|
|
20
|
+
};
|
|
21
|
+
/** Draws its child once for each piece of the date, in the locale's order. */
|
|
22
|
+
declare function Segments(props: SegmentsProps): JSX.Element;
|
|
23
|
+
export type SegmentProps = PartComponentProps<"span", StateOf<Parts["segment"]>, {
|
|
16
24
|
segment: DateFieldSegment;
|
|
17
|
-
}
|
|
25
|
+
}>;
|
|
26
|
+
/** One piece: a part that is typed, or what stands between two. It writes its own text. */
|
|
27
|
+
declare function Segment(props: SegmentProps): JSX.Element;
|
|
28
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
18
29
|
export declare const DateField: {
|
|
19
30
|
Root: typeof Root;
|
|
20
31
|
Segments: typeof Segments;
|
|
21
32
|
Segment: typeof Segment;
|
|
22
|
-
Input: (props:
|
|
33
|
+
Input: (props: InputProps) => JSX.Element;
|
|
23
34
|
};
|
package/types/date-picker.d.ts
CHANGED
|
@@ -1,49 +1,41 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
1
2
|
import type { DatePickerProps } from "@kirana-ui/core/date-picker";
|
|
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["datePicker"];
|
|
7
|
+
export type { CellProps, DayProps, GridProps, HeadCellProps, HeadingProps, MonthsProps, NextProps, PreviousProps, WeekdaysProps, WeeksProps, } from "./calendar.tsx";
|
|
8
|
+
export type { InputProps, SegmentProps, SegmentsProps } from "./date-field.tsx";
|
|
9
|
+
export type { PopupProps, PortalProps, PositionerProps, TriggerProps } from "./popover.tsx";
|
|
4
10
|
export type RootProps = Omit<DatePickerProps, "id"> & {
|
|
5
11
|
id?: string;
|
|
6
12
|
children?: JSX.Element;
|
|
7
13
|
};
|
|
8
14
|
/** A date field, and a calendar in a popover, with one value between them. It draws nothing. */
|
|
9
15
|
declare function Root(props: RootProps): JSX.Element;
|
|
16
|
+
export type FieldProps = PartComponentProps<"div", StateOf<Parts["field"]>>;
|
|
17
|
+
export type CalendarProps = PartComponentProps<"div", StateOf<Parts["calendar"]>>;
|
|
10
18
|
export declare const DatePicker: {
|
|
11
19
|
Root: typeof Root;
|
|
12
20
|
/** The typed date: what holds its segments and its hidden input. */
|
|
13
|
-
Field: (props:
|
|
14
|
-
Segments: (props:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}) => JSX.Element;
|
|
20
|
-
Input: (props: PartComponentProps) => JSX.Element;
|
|
21
|
-
Trigger: (props: PartComponentProps) => JSX.Element;
|
|
22
|
-
Portal: (props: {
|
|
23
|
-
children?: JSX.Element;
|
|
24
|
-
}) => JSX.Element;
|
|
21
|
+
Field: (props: FieldProps) => JSX.Element;
|
|
22
|
+
Segments: (props: import("./date-field.tsx").SegmentsProps) => JSX.Element;
|
|
23
|
+
Segment: (props: import("./date-field.tsx").SegmentProps) => JSX.Element;
|
|
24
|
+
Input: (props: import("./date-field.tsx").InputProps) => JSX.Element;
|
|
25
|
+
Trigger: (props: import("./popover.tsx").TriggerProps) => JSX.Element;
|
|
26
|
+
Portal: (props: import("./popover.tsx").PortalProps) => JSX.Element;
|
|
25
27
|
Positioner: (props: import("./popover.tsx").PositionerProps) => JSX.Element;
|
|
26
|
-
Popup: (props:
|
|
28
|
+
Popup: (props: import("./popover.tsx").PopupProps) => JSX.Element;
|
|
27
29
|
/** The calendar: what holds its heading, its buttons and its grid. */
|
|
28
|
-
Calendar: (props:
|
|
29
|
-
Heading: (props:
|
|
30
|
-
Previous: (props:
|
|
31
|
-
Next: (props:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Weeks: (props: {
|
|
40
|
-
children: (week: readonly import("@kirana-ui/core/calendar").CalendarDay[]) => JSX.Element;
|
|
41
|
-
}) => JSX.Element;
|
|
42
|
-
Cell: (props: PartComponentProps & {
|
|
43
|
-
date: string;
|
|
44
|
-
}) => JSX.Element;
|
|
45
|
-
Day: (props: PartComponentProps & {
|
|
46
|
-
date: string;
|
|
47
|
-
}) => JSX.Element;
|
|
30
|
+
Calendar: (props: CalendarProps) => JSX.Element;
|
|
31
|
+
Heading: (props: import("./calendar.tsx").HeadingProps) => JSX.Element;
|
|
32
|
+
Previous: (props: import("./calendar.tsx").PreviousProps) => JSX.Element;
|
|
33
|
+
Next: (props: import("./calendar.tsx").NextProps) => JSX.Element;
|
|
34
|
+
Months: (props: import("./calendar.tsx").MonthsProps) => JSX.Element;
|
|
35
|
+
Grid: (props: import("./calendar.tsx").GridProps) => JSX.Element;
|
|
36
|
+
Weekdays: (props: import("./calendar.tsx").WeekdaysProps) => JSX.Element;
|
|
37
|
+
HeadCell: (props: import("./calendar.tsx").HeadCellProps) => JSX.Element;
|
|
38
|
+
Weeks: (props: import("./calendar.tsx").WeeksProps) => JSX.Element;
|
|
39
|
+
Cell: (props: import("./calendar.tsx").CellProps) => JSX.Element;
|
|
40
|
+
Day: (props: import("./calendar.tsx").DayProps) => JSX.Element;
|
|
48
41
|
};
|
|
49
|
-
export {};
|
package/types/dialog.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { ChangeDetails } from "@kirana-ui/core";
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
2
|
import type { DrawerSide, DrawerSnapPoint } from "@kirana-ui/core/drawer";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
4
|
import type { JSX } from "solid-js";
|
|
4
5
|
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["dialog"];
|
|
7
|
+
type DrawerParts = Vocabulary["drawer"];
|
|
5
8
|
export type RootProps = {
|
|
6
9
|
open?: boolean;
|
|
7
10
|
defaultOpen?: boolean;
|
|
@@ -12,50 +15,63 @@ export type RootProps = {
|
|
|
12
15
|
children?: JSX.Element;
|
|
13
16
|
};
|
|
14
17
|
declare function Root(props: RootProps): JSX.Element;
|
|
15
|
-
|
|
18
|
+
export type PortalProps = {
|
|
19
|
+
children?: JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
22
|
+
export type BackdropProps = PartComponentProps<"div", StateOf<Parts["backdrop"]>>;
|
|
23
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>>;
|
|
24
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
25
|
+
export type TitleProps = PartComponentProps<"h2", StateOf<Parts["title"]>>;
|
|
26
|
+
export type DescriptionProps = PartComponentProps<"p", StateOf<Parts["description"]>>;
|
|
27
|
+
export type CloseProps = PartComponentProps<"button", StateOf<Parts["close"]>>;
|
|
28
|
+
export type AlertRootProps = Omit<RootProps, "modal" | "dismissible">;
|
|
29
|
+
declare function AlertRoot(props: AlertRootProps): JSX.Element;
|
|
16
30
|
export declare const Dialog: {
|
|
17
31
|
Root: typeof Root;
|
|
18
|
-
Portal: (props:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Popup: (props:
|
|
24
|
-
Title: (props:
|
|
25
|
-
Description: (props:
|
|
26
|
-
Close: (props:
|
|
32
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
33
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
34
|
+
Backdrop: (props: BackdropProps) => JSX.Element;
|
|
35
|
+
/** What a long dialog scrolls in, around its popup: it may be left out. */
|
|
36
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
37
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
38
|
+
Title: (props: TitleProps) => JSX.Element;
|
|
39
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
40
|
+
Close: (props: CloseProps) => JSX.Element;
|
|
27
41
|
};
|
|
28
42
|
/** A dialog that asks for an answer: a press outside it does not close it. Its parts are a dialog's. */
|
|
29
43
|
export declare const AlertDialog: {
|
|
30
44
|
Root: typeof AlertRoot;
|
|
31
|
-
Portal: (props:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Popup: (props:
|
|
37
|
-
Title: (props:
|
|
38
|
-
Description: (props:
|
|
39
|
-
Close: (props:
|
|
45
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
46
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
47
|
+
Backdrop: (props: BackdropProps) => JSX.Element;
|
|
48
|
+
/** What a long dialog scrolls in, around its popup: it may be left out. */
|
|
49
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
50
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
51
|
+
Title: (props: TitleProps) => JSX.Element;
|
|
52
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
53
|
+
Close: (props: CloseProps) => JSX.Element;
|
|
40
54
|
};
|
|
41
|
-
|
|
55
|
+
export type DrawerRootProps = RootProps & {
|
|
42
56
|
swipeDirection?: DrawerSide;
|
|
43
57
|
snapPoints?: readonly DrawerSnapPoint[];
|
|
44
58
|
snapPoint?: DrawerSnapPoint;
|
|
45
59
|
defaultSnapPoint?: DrawerSnapPoint;
|
|
46
60
|
onSnapPointChange?: (snapPoint: DrawerSnapPoint, details: ChangeDetails) => void;
|
|
47
|
-
}
|
|
61
|
+
};
|
|
62
|
+
declare function DrawerRoot(props: DrawerRootProps): JSX.Element;
|
|
63
|
+
/** A drawer's backdrop and popup say more than a dialog's: how they are being dragged. */
|
|
64
|
+
export type DrawerBackdropProps = PartComponentProps<"div", StateOf<DrawerParts["backdrop"]>>;
|
|
65
|
+
export type DrawerPopupProps = PartComponentProps<"div", StateOf<DrawerParts["popup"]>>;
|
|
48
66
|
/** A dialog that comes from an edge and is dragged back to it. Its parts are a dialog's. */
|
|
49
67
|
export declare const Drawer: {
|
|
50
68
|
Root: typeof DrawerRoot;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
Trigger: (props:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Description: (props: PartComponentProps) => JSX.Element;
|
|
59
|
-
Close: (props: PartComponentProps) => JSX.Element;
|
|
69
|
+
Backdrop: (props: DrawerBackdropProps) => JSX.Element;
|
|
70
|
+
Popup: (props: DrawerPopupProps) => JSX.Element;
|
|
71
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
72
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
73
|
+
Title: (props: TitleProps) => JSX.Element;
|
|
74
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
75
|
+
Close: (props: CloseProps) => JSX.Element;
|
|
60
76
|
};
|
|
61
77
|
export {};
|
package/types/direction.d.ts
CHANGED
package/types/drawer.d.ts
CHANGED
package/types/field.d.ts
CHANGED
|
@@ -1,27 +1,35 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
1
2
|
import type { FieldProps, FieldValidity, ValidityKey } from "@kirana-ui/core/field";
|
|
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["field"];
|
|
7
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<FieldProps, "id"> & {
|
|
5
8
|
id?: string;
|
|
6
|
-
}
|
|
9
|
+
}>;
|
|
7
10
|
declare function Root(props: RootProps): JSX.Element;
|
|
11
|
+
export type ErrorProps = PartComponentProps<"div", StateOf<Parts["error"]>, {
|
|
12
|
+
match?: ValidityKey | boolean;
|
|
13
|
+
}>;
|
|
8
14
|
/**
|
|
9
15
|
* What is wrong, or its children in its place. In the page while it applies. `match` is one of
|
|
10
16
|
* the browser's findings (`"valueMissing"`) to show for only that, or `true` to show always.
|
|
11
17
|
*/
|
|
12
|
-
declare function FieldError(props:
|
|
13
|
-
|
|
14
|
-
}): JSX.Element;
|
|
15
|
-
/** Draws nothing itself: its child, a function, is given the field's validity. */
|
|
16
|
-
declare function Validity(props: {
|
|
18
|
+
declare function FieldError(props: ErrorProps): JSX.Element;
|
|
19
|
+
export type ValidityProps = {
|
|
17
20
|
children: (validity: () => FieldValidity) => JSX.Element;
|
|
18
|
-
}
|
|
21
|
+
};
|
|
22
|
+
/** Draws nothing itself: its child, a function, is given the field's validity. */
|
|
23
|
+
declare function Validity(props: ValidityProps): JSX.Element;
|
|
24
|
+
export type LabelProps = PartComponentProps<"label", StateOf<Parts["label"]>>;
|
|
25
|
+
export type ControlProps = PartComponentProps<"input", StateOf<Parts["control"]>>;
|
|
26
|
+
export type DescriptionProps = PartComponentProps<"p", StateOf<Parts["description"]>>;
|
|
19
27
|
export declare const Field: {
|
|
20
28
|
Root: typeof Root;
|
|
21
|
-
Label: (props:
|
|
29
|
+
Label: (props: LabelProps) => JSX.Element;
|
|
22
30
|
/** An `<input>`; `as="textarea"` or `as="select"` for another. */
|
|
23
|
-
Control: (props:
|
|
24
|
-
Description: (props:
|
|
31
|
+
Control: (props: ControlProps) => JSX.Element;
|
|
32
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
25
33
|
Error: typeof FieldError;
|
|
26
34
|
Validity: typeof Validity;
|
|
27
35
|
};
|
package/types/fieldset.d.ts
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
1
2
|
import type { Fieldset as Controller } from "@kirana-ui/core/fieldset";
|
|
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
|
/** The fieldset a field is in, if it is in one. */
|
|
5
7
|
export declare const FieldsetContext: import("solid-js").Context<Controller | undefined>;
|
|
6
|
-
|
|
8
|
+
type Parts = Vocabulary["fieldset"];
|
|
9
|
+
export type RootProps = PartComponentProps<"fieldset", StateOf<Parts["root"]>, {
|
|
7
10
|
disabled?: boolean;
|
|
8
11
|
id?: string;
|
|
9
|
-
}
|
|
12
|
+
}>;
|
|
13
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
14
|
+
export type LegendProps = PartComponentProps<"div", StateOf<Parts["legend"]>>;
|
|
10
15
|
export declare const Fieldset: {
|
|
11
16
|
Root: typeof Root;
|
|
12
|
-
Legend: (props:
|
|
17
|
+
Legend: (props: LegendProps) => JSX.Element;
|
|
13
18
|
};
|
|
14
19
|
export {};
|
package/types/form.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Form as Controller, FormProps as CoreProps } from "@kirana-ui/core/form";
|
|
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
|
/** The form a field is in, if it is in one. */
|
|
5
7
|
export declare const FormContext: import("solid-js").Context<Controller | undefined>;
|
|
8
|
+
export type FormProps = PartComponentProps<"form", StateOf<Vocabulary["form"]["root"]>, CoreProps>;
|
|
6
9
|
/** A `<form>` whose fields say what is wrong; `onFormSubmit` takes the values once all are valid. */
|
|
7
|
-
export declare function Form(props:
|
|
10
|
+
export declare function Form(props: FormProps): JSX.Element;
|