@kirana-ui/solid 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/accordion.js +9 -6
- package/dom/agent.js +3 -0
- package/dom/autocomplete.js +2 -0
- package/dom/autosize.js +19 -0
- package/dom/avatar.js +3 -3
- package/dom/button.js +1 -1
- package/dom/calendar.js +145 -0
- package/dom/carousel.js +83 -0
- package/dom/checkbox.js +5 -4
- package/dom/collapsible.js +3 -3
- package/dom/combobox.js +289 -0
- package/dom/command.js +129 -0
- package/dom/context-menu.js +2 -0
- package/dom/date-field.js +90 -0
- package/dom/date-picker.js +103 -0
- package/dom/dialog.js +32 -1
- package/dom/drawer.js +2 -0
- package/dom/field.js +3 -3
- package/dom/fieldset.js +2 -2
- package/dom/form.js +1 -1
- package/dom/hover-popup.js +19 -4
- package/dom/index.js +26 -1
- package/dom/input.js +26 -0
- package/dom/label.js +18 -0
- package/dom/listbox.js +114 -0
- package/dom/menu.js +261 -0
- package/dom/menubar-context.js +3 -0
- package/dom/menubar.js +33 -0
- package/dom/message-scroller.js +56 -0
- package/dom/navigation-menu.js +147 -0
- package/dom/number-field.js +82 -0
- package/dom/otp.js +95 -0
- package/dom/pagination.js +74 -0
- package/dom/popover.js +22 -7
- package/dom/qr-code.js +48 -0
- package/dom/radio-group.js +6 -5
- package/dom/resizable.js +65 -0
- package/dom/runtime.js +59 -9
- package/dom/scroll-area.js +99 -0
- package/dom/select.js +91 -15
- package/dom/separator.js +1 -1
- package/dom/slider.js +11 -8
- package/dom/switch.js +5 -4
- package/dom/tabs.js +5 -5
- package/dom/testing.js +3 -0
- package/dom/toast.js +150 -0
- package/dom/toggle-group.js +37 -0
- package/dom/toggle.js +12 -4
- package/dom/toolbar-context.js +5 -0
- package/dom/toolbar.js +71 -0
- package/dom/value-bar.js +3 -3
- package/llms.txt +3202 -0
- package/package.json +236 -2
- package/server/accordion.js +9 -6
- package/server/agent.js +3 -0
- package/server/autocomplete.js +2 -0
- package/server/autosize.js +19 -0
- package/server/avatar.js +3 -3
- package/server/button.js +1 -1
- package/server/calendar.js +144 -0
- package/server/carousel.js +83 -0
- package/server/checkbox.js +5 -4
- package/server/collapsible.js +3 -3
- package/server/combobox.js +289 -0
- package/server/command.js +129 -0
- package/server/context-menu.js +2 -0
- package/server/date-field.js +90 -0
- package/server/date-picker.js +103 -0
- package/server/dialog.js +32 -1
- package/server/drawer.js +2 -0
- package/server/field.js +3 -3
- package/server/fieldset.js +2 -2
- package/server/form.js +1 -1
- package/server/hover-popup.js +19 -4
- package/server/index.js +26 -1
- package/server/input.js +26 -0
- package/server/label.js +18 -0
- package/server/listbox.js +114 -0
- package/server/menu.js +261 -0
- package/server/menubar-context.js +3 -0
- package/server/menubar.js +33 -0
- package/server/message-scroller.js +56 -0
- package/server/navigation-menu.js +147 -0
- package/server/number-field.js +81 -0
- package/server/otp.js +94 -0
- package/server/pagination.js +74 -0
- package/server/popover.js +22 -7
- package/server/qr-code.js +48 -0
- package/server/radio-group.js +6 -5
- package/server/resizable.js +65 -0
- package/server/runtime.js +58 -8
- package/server/scroll-area.js +99 -0
- package/server/select.js +91 -15
- package/server/separator.js +1 -1
- package/server/slider.js +11 -8
- package/server/switch.js +5 -4
- package/server/tabs.js +5 -5
- package/server/testing.js +3 -0
- package/server/toast.js +150 -0
- package/server/toggle-group.js +37 -0
- package/server/toggle.js +12 -4
- package/server/toolbar-context.js +5 -0
- package/server/toolbar.js +71 -0
- package/server/value-bar.js +3 -3
- package/skills/kirana-ui-primitives/SKILL.md +142 -0
- package/src/accordion.jsx +10 -7
- package/src/agent.js +3 -0
- package/src/autocomplete.jsx +2 -0
- package/src/autosize.jsx +8 -0
- package/src/avatar.jsx +3 -3
- package/src/button.jsx +1 -1
- package/src/calendar.jsx +108 -0
- package/src/carousel.jsx +51 -0
- package/src/checkbox.jsx +5 -3
- package/src/collapsible.jsx +3 -3
- package/src/combobox.jsx +187 -0
- package/src/command.jsx +81 -0
- package/src/context-menu.js +2 -0
- package/src/date-field.jsx +71 -0
- package/src/date-picker.jsx +72 -0
- package/src/dialog.jsx +27 -1
- package/src/drawer.js +2 -0
- package/src/field.jsx +3 -3
- package/src/fieldset.jsx +2 -2
- package/src/form.jsx +1 -1
- package/src/hover-popup.jsx +12 -4
- package/src/index.js +26 -1
- package/src/input.jsx +17 -0
- package/src/label.jsx +9 -0
- package/src/listbox.jsx +81 -0
- package/src/menu.jsx +164 -0
- package/src/menubar-context.js +3 -0
- package/src/menubar.jsx +21 -0
- package/src/message-scroller.jsx +27 -0
- package/src/navigation-menu.jsx +96 -0
- package/src/number-field.jsx +75 -0
- package/src/otp.jsx +73 -0
- package/src/pagination.jsx +60 -0
- package/src/popover.jsx +22 -4
- package/src/qr-code.jsx +25 -0
- package/src/radio-group.jsx +7 -5
- package/src/resizable.jsx +46 -0
- package/src/runtime.jsx +54 -9
- package/src/scroll-area.jsx +53 -0
- package/src/select.jsx +72 -14
- package/src/separator.jsx +1 -1
- package/src/slider.jsx +13 -8
- package/src/switch.jsx +5 -3
- package/src/tabs.jsx +6 -6
- package/src/testing.js +3 -0
- package/src/toast.jsx +86 -0
- package/src/toggle-group.jsx +32 -0
- package/src/toggle.jsx +9 -3
- package/src/toolbar-context.js +5 -0
- package/src/toolbar.jsx +43 -0
- package/src/value-bar.jsx +3 -3
- package/types/accordion.d.ts +21 -19
- package/types/agent.d.ts +1 -0
- package/types/alert-dialog.d.ts +1 -0
- package/types/autocomplete.d.ts +2 -0
- package/types/autosize.d.ts +11 -0
- package/types/avatar.d.ts +12 -5
- package/types/button.d.ts +4 -2
- package/types/calendar.d.ts +57 -0
- package/types/carousel.d.ts +34 -0
- package/types/checkbox.d.ts +10 -6
- package/types/collapsible.d.ts +11 -7
- package/types/combobox.d.ts +105 -0
- package/types/command.d.ts +55 -0
- package/types/context-menu.d.ts +2 -0
- package/types/date-field.d.ts +34 -0
- package/types/date-picker.d.ts +40 -0
- package/types/dialog.d.ts +52 -20
- package/types/direction.d.ts +1 -0
- package/types/drawer.d.ts +2 -0
- package/types/field.d.ts +19 -11
- package/types/fieldset.d.ts +8 -3
- package/types/form.d.ts +5 -2
- package/types/hover-card.d.ts +16 -7
- package/types/hover-popup.d.ts +23 -10
- package/types/index.d.ts +39 -2
- package/types/input.d.ts +13 -0
- package/types/label.d.ts +7 -0
- package/types/listbox.d.ts +36 -0
- package/types/menu.d.ts +105 -0
- package/types/menubar-context.d.ts +3 -0
- package/types/menubar.d.ts +12 -0
- package/types/message-scroller.d.ts +22 -0
- package/types/meter.d.ts +16 -7
- package/types/navigation-menu.d.ts +50 -0
- package/types/number-field.d.ts +22 -0
- package/types/otp.d.ts +39 -0
- package/types/pagination.d.ts +31 -0
- package/types/popover.d.ts +41 -13
- package/types/progress.d.ts +16 -7
- package/types/qr-code.d.ts +20 -0
- package/types/radio-group.d.ts +15 -16
- package/types/resizable.d.ts +29 -0
- package/types/runtime.d.ts +53 -11
- package/types/scroll-area.d.ts +28 -0
- package/types/select.d.ts +66 -33
- package/types/separator.d.ts +5 -3
- package/types/slider.d.ts +25 -13
- package/types/switch.d.ts +8 -4
- package/types/tabs.d.ts +20 -16
- package/types/testing.d.ts +1 -0
- package/types/toast.d.ts +57 -0
- package/types/toggle-group.d.ts +9 -0
- package/types/toggle.d.ts +6 -3
- package/types/toolbar-context.d.ts +6 -0
- package/types/toolbar.d.ts +28 -0
- package/types/tooltip.d.ts +16 -7
- package/types/value-bar.d.ts +21 -10
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { ListboxProps } from "@kirana-ui/core/listbox";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["listbox"];
|
|
7
|
+
/** `Value` is what an item's `value` is: the root's `value` holds the chosen ones. */
|
|
8
|
+
export type RootProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<ListboxProps<Value>, "id"> & {
|
|
9
|
+
id?: string;
|
|
10
|
+
}>;
|
|
11
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
12
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
|
|
13
|
+
value: unknown;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
label?: string;
|
|
16
|
+
index?: number;
|
|
17
|
+
}>;
|
|
18
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
19
|
+
export type ItemIndicatorProps = PartComponentProps<"span", StateOf<Parts["itemIndicator"]>, {
|
|
20
|
+
keepMounted?: boolean;
|
|
21
|
+
}>;
|
|
22
|
+
declare function ItemIndicator(props: ItemIndicatorProps): JSX.Element;
|
|
23
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
24
|
+
id?: string;
|
|
25
|
+
}>;
|
|
26
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
27
|
+
export type GroupLabelProps = PartComponentProps<"div", StateOf<Parts["groupLabel"]>>;
|
|
28
|
+
declare function GroupLabel(props: GroupLabelProps): JSX.Element;
|
|
29
|
+
export declare const Listbox: {
|
|
30
|
+
Root: typeof Root;
|
|
31
|
+
Item: typeof Item;
|
|
32
|
+
ItemIndicator: typeof ItemIndicator;
|
|
33
|
+
Group: typeof Group;
|
|
34
|
+
GroupLabel: typeof GroupLabel;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
package/types/menu.d.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { MenuRadioGroupProps } from "@kirana-ui/core/menu";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PortalProps, PositionerOptions } from "./popover.tsx";
|
|
6
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
7
|
+
type Parts = Vocabulary["menu"];
|
|
8
|
+
export type { PortalProps };
|
|
9
|
+
export type RootProps = {
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean, details: ChangeDetails) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
modal?: boolean;
|
|
16
|
+
id?: string;
|
|
17
|
+
children?: JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
export type ContextRootProps = RootProps;
|
|
20
|
+
export type SubmenuRootProps = RootProps;
|
|
21
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
|
|
22
|
+
declare function Positioner(props: PositionerProps): JSX.Element;
|
|
23
|
+
type ItemOptions = {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
label?: string;
|
|
26
|
+
closeOnClick?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, ItemOptions>;
|
|
29
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
30
|
+
export type LinkItemProps = PartComponentProps<"a", StateOf<Parts["linkItem"]>, ItemOptions>;
|
|
31
|
+
/** An item that is a link: `href` and the rest go to its `<a>`. */
|
|
32
|
+
declare function LinkItem(props: LinkItemProps): JSX.Element;
|
|
33
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
34
|
+
id?: string;
|
|
35
|
+
}>;
|
|
36
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
37
|
+
export type GroupLabelProps = PartComponentProps<"div", StateOf<Parts["groupLabel"]>>;
|
|
38
|
+
export type CheckboxItemProps = PartComponentProps<"div", StateOf<Parts["checkboxItem"]>, ItemOptions & {
|
|
39
|
+
checked?: boolean;
|
|
40
|
+
defaultChecked?: boolean;
|
|
41
|
+
onCheckedChange?: (checked: boolean, details: ChangeDetails) => void;
|
|
42
|
+
}>;
|
|
43
|
+
declare function CheckboxItem(props: CheckboxItemProps): JSX.Element;
|
|
44
|
+
export type CheckboxItemIndicatorProps = PartComponentProps<"span", StateOf<Parts["checkboxItemIndicator"]>, {
|
|
45
|
+
keepMounted?: boolean;
|
|
46
|
+
}>;
|
|
47
|
+
declare function CheckboxItemIndicator(props: CheckboxItemIndicatorProps): JSX.Element;
|
|
48
|
+
/** `Value` is what a radio item's `value` is: the group's `value` holds the chosen one. */
|
|
49
|
+
export type RadioGroupProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["radioGroup"]>, MenuRadioGroupProps<Value>>;
|
|
50
|
+
declare function RadioGroup<Value = unknown>(props: RadioGroupProps<Value>): JSX.Element;
|
|
51
|
+
export type RadioItemProps = PartComponentProps<"div", StateOf<Parts["radioItem"]>, ItemOptions & {
|
|
52
|
+
value: unknown;
|
|
53
|
+
}>;
|
|
54
|
+
declare function RadioItem(props: RadioItemProps): JSX.Element;
|
|
55
|
+
export type RadioItemIndicatorProps = PartComponentProps<"span", StateOf<Parts["radioItemIndicator"]>, {
|
|
56
|
+
keepMounted?: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
declare function RadioItemIndicator(props: RadioItemIndicatorProps): JSX.Element;
|
|
59
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
60
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
61
|
+
export type ArrowProps = PartComponentProps<"div", StateOf<Parts["arrow"]>>;
|
|
62
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>>;
|
|
63
|
+
export type SubmenuTriggerProps = PartComponentProps<"div", StateOf<Parts["submenuTrigger"]>>;
|
|
64
|
+
export type ContextTriggerProps = PartComponentProps<"div", StateOf<Vocabulary["contextMenu"]["trigger"]>>;
|
|
65
|
+
export declare const Menu: {
|
|
66
|
+
Root: (props: RootProps) => JSX.Element;
|
|
67
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
68
|
+
Positioner: typeof Positioner;
|
|
69
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
70
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
71
|
+
Arrow: (props: ArrowProps) => JSX.Element;
|
|
72
|
+
Item: typeof Item;
|
|
73
|
+
LinkItem: typeof LinkItem;
|
|
74
|
+
Group: typeof Group;
|
|
75
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
76
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
77
|
+
CheckboxItem: typeof CheckboxItem;
|
|
78
|
+
CheckboxItemIndicator: typeof CheckboxItemIndicator;
|
|
79
|
+
RadioGroup: typeof RadioGroup;
|
|
80
|
+
RadioItem: typeof RadioItem;
|
|
81
|
+
RadioItemIndicator: typeof RadioItemIndicator;
|
|
82
|
+
SubmenuRoot: (props: SubmenuRootProps) => JSX.Element;
|
|
83
|
+
SubmenuTrigger: (props: SubmenuTriggerProps) => JSX.Element;
|
|
84
|
+
};
|
|
85
|
+
export declare const ContextMenu: {
|
|
86
|
+
Root: (props: ContextRootProps) => JSX.Element;
|
|
87
|
+
/** The area a secondary press, or a long press on a touch screen, opens the menu in. */
|
|
88
|
+
Trigger: (props: ContextTriggerProps) => JSX.Element;
|
|
89
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
90
|
+
Positioner: typeof Positioner;
|
|
91
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
92
|
+
Arrow: (props: ArrowProps) => JSX.Element;
|
|
93
|
+
Item: typeof Item;
|
|
94
|
+
LinkItem: typeof LinkItem;
|
|
95
|
+
Group: typeof Group;
|
|
96
|
+
GroupLabel: (props: GroupLabelProps) => JSX.Element;
|
|
97
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
98
|
+
CheckboxItem: typeof CheckboxItem;
|
|
99
|
+
CheckboxItemIndicator: typeof CheckboxItemIndicator;
|
|
100
|
+
RadioGroup: typeof RadioGroup;
|
|
101
|
+
RadioItem: typeof RadioItem;
|
|
102
|
+
RadioItemIndicator: typeof RadioItemIndicator;
|
|
103
|
+
SubmenuRoot: (props: SubmenuRootProps) => JSX.Element;
|
|
104
|
+
SubmenuTrigger: (props: SubmenuTriggerProps) => JSX.Element;
|
|
105
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Orientation, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
5
|
+
export type MenubarProps = PartComponentProps<"div", StateOf<Vocabulary["menubar"]["root"]>, {
|
|
6
|
+
loop?: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
orientation?: Orientation;
|
|
9
|
+
id?: string;
|
|
10
|
+
}>;
|
|
11
|
+
/** A row of menus that work as one. Each `<Menu.Root>` inside it is one of its items. */
|
|
12
|
+
export declare function Menubar(props: MenubarProps): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
5
|
+
type Parts = Vocabulary["messageScroller"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
7
|
+
initial?: "bottom" | "top";
|
|
8
|
+
threshold?: number;
|
|
9
|
+
onAtBottomChange?: (atBottom: boolean, details: ChangeDetails) => void;
|
|
10
|
+
id?: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
13
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>>;
|
|
14
|
+
export type ContentProps = PartComponentProps<"div", StateOf<Parts["content"]>>;
|
|
15
|
+
export type ButtonProps = PartComponentProps<"button", StateOf<Parts["button"]>>;
|
|
16
|
+
export declare const MessageScroller: {
|
|
17
|
+
Root: typeof Root;
|
|
18
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
19
|
+
Content: (props: ContentProps) => JSX.Element;
|
|
20
|
+
Button: (props: ButtonProps) => JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
package/types/meter.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
+
import type { RootOptions, ValueOptions } from "./value-bar.tsx";
|
|
5
|
+
type Parts = Vocabulary["meter"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, RootOptions>;
|
|
7
|
+
export type ValueProps = PartComponentProps<"span", StateOf<Parts["value"]>, ValueOptions>;
|
|
8
|
+
export type TrackProps = PartComponentProps<"div", StateOf<Parts["track"]>>;
|
|
9
|
+
export type IndicatorProps = PartComponentProps<"div", StateOf<Parts["indicator"]>>;
|
|
10
|
+
export type LabelProps = PartComponentProps<"span", StateOf<Parts["label"]>>;
|
|
1
11
|
export declare const Meter: {
|
|
2
|
-
Root: (props:
|
|
3
|
-
Value: (props:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Indicator: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
8
|
-
Label: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
12
|
+
Root: (props: RootProps) => import("solid-js").JSX.Element;
|
|
13
|
+
Value: (props: ValueProps) => import("solid-js").JSX.Element;
|
|
14
|
+
Track: (props: TrackProps) => import("solid-js").JSX.Element;
|
|
15
|
+
Indicator: (props: IndicatorProps) => import("solid-js").JSX.Element;
|
|
16
|
+
Label: (props: LabelProps) => import("solid-js").JSX.Element;
|
|
9
17
|
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { NavigationMenuProps } from "@kirana-ui/core/navigation-menu";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PortalProps, PositionerOptions } from "./popover.tsx";
|
|
6
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
7
|
+
type Parts = Vocabulary["navigationMenu"];
|
|
8
|
+
export type { PortalProps };
|
|
9
|
+
/** `Value` is what tells an item from the others: the root's `value` holds the open one's. */
|
|
10
|
+
export type RootProps<Value = unknown> = PartComponentProps<"nav", StateOf<Parts["root"]>, Omit<NavigationMenuProps<Value>, "id"> & {
|
|
11
|
+
id?: string;
|
|
12
|
+
}>;
|
|
13
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
14
|
+
export type ItemProps = PartComponentProps<"li", StateOf<Parts["item"]>, {
|
|
15
|
+
value?: unknown;
|
|
16
|
+
}>;
|
|
17
|
+
/** `value` tells this item from the others; an item that is given none makes its own. */
|
|
18
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
19
|
+
export type ContentProps = PartComponentProps<"div", StateOf<Parts["content"]>>;
|
|
20
|
+
/** An item's content: drawn in `<NavigationMenu.Viewport>`, while it is shown. */
|
|
21
|
+
declare function Content(props: ContentProps): JSX.Element;
|
|
22
|
+
export type LinkProps = PartComponentProps<"a", StateOf<Parts["link"]>, {
|
|
23
|
+
active?: boolean;
|
|
24
|
+
closeOnClick?: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
declare function Link(props: LinkProps): JSX.Element;
|
|
27
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
|
|
28
|
+
declare function Positioner(props: PositionerProps): JSX.Element;
|
|
29
|
+
export type ListProps = PartComponentProps<"ul", StateOf<Parts["list"]>>;
|
|
30
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
31
|
+
export type IconProps = PartComponentProps<"span", StateOf<Parts["icon"]>>;
|
|
32
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
33
|
+
export type ViewportProps = PartComponentProps<"div", StateOf<Parts["viewport"]>>;
|
|
34
|
+
export type ArrowProps = PartComponentProps<"div", StateOf<Parts["arrow"]>>;
|
|
35
|
+
export type BackdropProps = PartComponentProps<"div", StateOf<Parts["backdrop"]>>;
|
|
36
|
+
export declare const NavigationMenu: {
|
|
37
|
+
Root: typeof Root;
|
|
38
|
+
List: (props: ListProps) => JSX.Element;
|
|
39
|
+
Item: typeof Item;
|
|
40
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
41
|
+
Icon: (props: IconProps) => JSX.Element;
|
|
42
|
+
Content: typeof Content;
|
|
43
|
+
Link: typeof Link;
|
|
44
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
45
|
+
Positioner: typeof Positioner;
|
|
46
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
47
|
+
Viewport: (props: ViewportProps) => JSX.Element;
|
|
48
|
+
Arrow: (props: ArrowProps) => JSX.Element;
|
|
49
|
+
Backdrop: (props: BackdropProps) => JSX.Element;
|
|
50
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { NumberFieldProps } from "@kirana-ui/core/number-field";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["numberField"];
|
|
7
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<NumberFieldProps, "id"> & {
|
|
8
|
+
id?: string;
|
|
9
|
+
}>;
|
|
10
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
11
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>>;
|
|
12
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
13
|
+
export type IncrementProps = PartComponentProps<"button", StateOf<Parts["increment"]>>;
|
|
14
|
+
export type DecrementProps = PartComponentProps<"button", StateOf<Parts["decrement"]>>;
|
|
15
|
+
export declare const NumberField: {
|
|
16
|
+
Root: typeof Root;
|
|
17
|
+
Group: (props: GroupProps) => JSX.Element;
|
|
18
|
+
Input: (props: InputProps) => JSX.Element;
|
|
19
|
+
Increment: (props: IncrementProps) => JSX.Element;
|
|
20
|
+
Decrement: (props: DecrementProps) => JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
package/types/otp.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ChangeDetails, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { OtpProps } from "@kirana-ui/core/otp";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["otp"];
|
|
7
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
8
|
+
length?: number;
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (value: string, details: ChangeDetails) => void;
|
|
12
|
+
onComplete?: (value: string) => void;
|
|
13
|
+
mode?: OtpProps["mode"];
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
name?: string;
|
|
16
|
+
form?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
}>;
|
|
19
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
20
|
+
export type SlotProps = PartComponentProps<"div", StateOf<Parts["slot"]>, {
|
|
21
|
+
index: number;
|
|
22
|
+
}>;
|
|
23
|
+
/** One cell: it shows its character, then whatever it is given (a caret). */
|
|
24
|
+
declare function Slot(props: SlotProps): JSX.Element;
|
|
25
|
+
export type CaretProps = PartComponentProps<"div", StateOf<Parts["caret"]>>;
|
|
26
|
+
/** Drawn in its cell while the cell is the active one and empty. */
|
|
27
|
+
declare function Caret(props: CaretProps): JSX.Element;
|
|
28
|
+
export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
|
|
29
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>>;
|
|
30
|
+
export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>>;
|
|
31
|
+
export declare const Otp: {
|
|
32
|
+
Root: typeof Root;
|
|
33
|
+
Input: (props: InputProps) => JSX.Element;
|
|
34
|
+
Group: (props: GroupProps) => JSX.Element;
|
|
35
|
+
Slot: typeof Slot;
|
|
36
|
+
Separator: (props: SeparatorProps) => JSX.Element;
|
|
37
|
+
Caret: typeof Caret;
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { PaginationEntry, PaginationProps } from "@kirana-ui/core/pagination";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["pagination"];
|
|
7
|
+
export type RootProps = PartComponentProps<"nav", StateOf<Parts["root"]>, Omit<PaginationProps, "id"> & {
|
|
8
|
+
id?: string;
|
|
9
|
+
}>;
|
|
10
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
11
|
+
export type ItemsProps = {
|
|
12
|
+
children: (entry: PaginationEntry) => JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
/** Draws its child once for each piece of the row: a page, or the mark for pages left out. */
|
|
15
|
+
declare function Items(props: ItemsProps): JSX.Element;
|
|
16
|
+
export type ItemProps = PartComponentProps<"button", StateOf<Parts["item"]>, {
|
|
17
|
+
page: number;
|
|
18
|
+
}>;
|
|
19
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
20
|
+
export type EllipsisProps = PartComponentProps<"span", StateOf<Parts["ellipsis"]>>;
|
|
21
|
+
export type PreviousProps = PartComponentProps<"button", StateOf<Parts["previous"]>>;
|
|
22
|
+
export type NextProps = PartComponentProps<"button", StateOf<Parts["next"]>>;
|
|
23
|
+
export declare const Pagination: {
|
|
24
|
+
Root: typeof Root;
|
|
25
|
+
Items: typeof Items;
|
|
26
|
+
Item: typeof Item;
|
|
27
|
+
Ellipsis: (props: EllipsisProps) => JSX.Element;
|
|
28
|
+
Previous: (props: PreviousProps) => JSX.Element;
|
|
29
|
+
Next: (props: NextProps) => JSX.Element;
|
|
30
|
+
};
|
|
31
|
+
export {};
|
package/types/popover.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import type { ChangeDetails, PositionOptions, Signal } from "@kirana-ui/core";
|
|
1
|
+
import type { Anchor, ChangeDetails, PositionOptions, Signal, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Popover as Controller } from "@kirana-ui/core/popover";
|
|
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["popover"];
|
|
7
|
+
/**
|
|
8
|
+
* The popover its parts are inside. Exported for a component that is made of one (a date picker
|
|
9
|
+
* provides its own to the popover's parts).
|
|
10
|
+
*/
|
|
11
|
+
declare const Context: import("solid-js").Context<Controller | undefined>;
|
|
12
|
+
/** For a component made of this one's parts: a date picker. */
|
|
13
|
+
export { Context as PopoverContext };
|
|
4
14
|
export type RootProps = {
|
|
5
15
|
open?: boolean;
|
|
6
16
|
defaultOpen?: boolean;
|
|
@@ -9,20 +19,38 @@ export type RootProps = {
|
|
|
9
19
|
children?: JSX.Element;
|
|
10
20
|
};
|
|
11
21
|
declare function Root(props: RootProps): JSX.Element;
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
|
|
22
|
+
export type PortalProps = {
|
|
23
|
+
children?: JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
/** A positioner's own props: where its popup goes, and what it is placed against. */
|
|
26
|
+
export type PositionerOptions = Partial<Omit<PositionOptions, "anchor">> & {
|
|
27
|
+
/**
|
|
28
|
+
* What the popup is placed against, when that is not its trigger: an element, a place in
|
|
29
|
+
* the viewport (an object with `getBoundingClientRect`), or a function that gives one (a
|
|
30
|
+
* signal's accessor, or `() => element` for a variable a `ref` fills). It may change
|
|
31
|
+
* while the popup is open: the popup follows.
|
|
32
|
+
*/
|
|
33
|
+
anchor?: Anchor | (() => Anchor | null | undefined) | null | undefined;
|
|
34
|
+
};
|
|
35
|
+
export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
|
|
36
|
+
/**
|
|
37
|
+
* A positioner's own props, written where its placement reads them, before its element
|
|
38
|
+
* attaches: the one place they are named. Gives back what is left, for the part's element.
|
|
39
|
+
*/
|
|
40
|
+
export declare function positioned<P extends PositionerOptions>(props: P, positioning: Signal<Partial<PositionOptions>>): Omit<P, keyof PositionerOptions>;
|
|
15
41
|
declare function Positioner(props: PositionerProps): JSX.Element;
|
|
42
|
+
export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
|
|
43
|
+
export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
|
|
44
|
+
export type TitleProps = PartComponentProps<"h2", StateOf<Parts["title"]>>;
|
|
45
|
+
export type DescriptionProps = PartComponentProps<"p", StateOf<Parts["description"]>>;
|
|
46
|
+
export type CloseProps = PartComponentProps<"button", StateOf<Parts["close"]>>;
|
|
16
47
|
export declare const Popover: {
|
|
17
48
|
Root: typeof Root;
|
|
18
|
-
Portal: (props:
|
|
19
|
-
children?: JSX.Element;
|
|
20
|
-
}) => JSX.Element;
|
|
49
|
+
Portal: (props: PortalProps) => JSX.Element;
|
|
21
50
|
Positioner: typeof Positioner;
|
|
22
|
-
Trigger: (props:
|
|
23
|
-
Popup: (props:
|
|
24
|
-
Title: (props:
|
|
25
|
-
Description: (props:
|
|
26
|
-
Close: (props:
|
|
51
|
+
Trigger: (props: TriggerProps) => JSX.Element;
|
|
52
|
+
Popup: (props: PopupProps) => JSX.Element;
|
|
53
|
+
Title: (props: TitleProps) => JSX.Element;
|
|
54
|
+
Description: (props: DescriptionProps) => JSX.Element;
|
|
55
|
+
Close: (props: CloseProps) => JSX.Element;
|
|
27
56
|
};
|
|
28
|
-
export {};
|
package/types/progress.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
4
|
+
import type { RootOptions, ValueOptions } from "./value-bar.tsx";
|
|
5
|
+
type Parts = Vocabulary["progress"];
|
|
6
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, RootOptions>;
|
|
7
|
+
export type ValueProps = PartComponentProps<"span", StateOf<Parts["value"]>, ValueOptions>;
|
|
8
|
+
export type TrackProps = PartComponentProps<"div", StateOf<Parts["track"]>>;
|
|
9
|
+
export type IndicatorProps = PartComponentProps<"div", StateOf<Parts["indicator"]>>;
|
|
10
|
+
export type LabelProps = PartComponentProps<"span", StateOf<Parts["label"]>>;
|
|
1
11
|
export declare const Progress: {
|
|
2
|
-
Root: (props:
|
|
3
|
-
Value: (props:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Indicator: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
8
|
-
Label: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
|
|
12
|
+
Root: (props: RootProps) => import("solid-js").JSX.Element;
|
|
13
|
+
Value: (props: ValueProps) => import("solid-js").JSX.Element;
|
|
14
|
+
Track: (props: TrackProps) => import("solid-js").JSX.Element;
|
|
15
|
+
Indicator: (props: IndicatorProps) => import("solid-js").JSX.Element;
|
|
16
|
+
Label: (props: LabelProps) => import("solid-js").JSX.Element;
|
|
9
17
|
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { QrCorrection } from "@kirana-ui/core/qr-code";
|
|
3
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
4
|
+
import type { JSX } from "solid-js";
|
|
5
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
6
|
+
type Parts = Vocabulary["qrCode"];
|
|
7
|
+
export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
|
|
8
|
+
value: string;
|
|
9
|
+
correction?: QrCorrection;
|
|
10
|
+
id?: string;
|
|
11
|
+
}>;
|
|
12
|
+
declare function Root(props: RootProps): JSX.Element;
|
|
13
|
+
export type FrameProps = PartComponentProps<"svg", StateOf<Parts["frame"]>>;
|
|
14
|
+
export type PatternProps = PartComponentProps<"path", StateOf<Parts["pattern"]>>;
|
|
15
|
+
export declare const QrCode: {
|
|
16
|
+
Root: typeof Root;
|
|
17
|
+
Frame: (props: FrameProps) => JSX.Element;
|
|
18
|
+
Pattern: (props: PatternProps) => JSX.Element;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
package/types/radio-group.d.ts
CHANGED
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { RadioGroupProps } from "@kirana-ui/core/radio-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
|
-
|
|
7
|
-
onValueChange?: (value: unknown, details: ChangeDetails) => void;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
readOnly?: boolean;
|
|
10
|
-
required?: boolean;
|
|
11
|
-
name?: string;
|
|
6
|
+
type Parts = Vocabulary["radioGroup"];
|
|
7
|
+
/** `Value` is what an item's `value` is: the root's `value` holds the chosen one, or `null`. */
|
|
8
|
+
export type RootProps<Value = unknown> = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<RadioGroupProps<Value>, "id"> & {
|
|
12
9
|
id?: string;
|
|
13
|
-
}
|
|
14
|
-
declare function Root(props: RootProps): JSX.Element;
|
|
15
|
-
|
|
10
|
+
}>;
|
|
11
|
+
declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
|
|
12
|
+
export type ItemProps = PartComponentProps<"span", StateOf<Parts["item"]>, {
|
|
16
13
|
value: unknown;
|
|
17
14
|
disabled?: boolean;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
}>;
|
|
16
|
+
declare function Item(props: ItemProps): JSX.Element;
|
|
17
|
+
export type IndicatorProps = PartComponentProps<"span", StateOf<Parts["indicator"]>, {
|
|
21
18
|
keepMounted?: boolean;
|
|
22
|
-
}
|
|
19
|
+
}>;
|
|
20
|
+
/** `keepMounted` keeps the mark in the page while its item is not the chosen one. */
|
|
21
|
+
declare function Indicator(props: IndicatorProps): JSX.Element;
|
|
23
22
|
export declare const RadioGroup: {
|
|
24
23
|
Root: typeof Root;
|
|
25
24
|
Item: typeof Item;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ChangeDetails, Orientation, StateOf } from "@kirana-ui/core";
|
|
2
|
+
import type { Vocabulary } from "@kirana-ui/core/vocabulary";
|
|
3
|
+
import type { JSX } from "solid-js";
|
|
4
|
+
import type { PartComponentProps } from "./runtime.tsx";
|
|
5
|
+
type Parts = Vocabulary["resizable"];
|
|
6
|
+
export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
|
|
7
|
+
orientation?: Orientation;
|
|
8
|
+
onSizesChange?: (sizes: number[], details: ChangeDetails) => void;
|
|
9
|
+
keyboardStep?: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
}>;
|
|
13
|
+
declare function Group(props: GroupProps): JSX.Element;
|
|
14
|
+
export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, {
|
|
15
|
+
defaultSize?: number;
|
|
16
|
+
minSize?: number;
|
|
17
|
+
maxSize?: number;
|
|
18
|
+
}>;
|
|
19
|
+
declare function Panel(props: PanelProps): JSX.Element;
|
|
20
|
+
export type HandleProps = PartComponentProps<"div", StateOf<Parts["handle"]>, {
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
}>;
|
|
23
|
+
declare function Handle(props: HandleProps): JSX.Element;
|
|
24
|
+
export declare const Resizable: {
|
|
25
|
+
Group: typeof Group;
|
|
26
|
+
Panel: typeof Panel;
|
|
27
|
+
Handle: typeof Handle;
|
|
28
|
+
};
|
|
29
|
+
export {};
|
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,64 @@ 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;
|
|
49
|
+
} & Record<string, unknown>): JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* Its children as children of `target`, an element drawn elsewhere: with no element of its own
|
|
52
|
+
* around them (Solid's `Portal` adds one), so the page is the same as on the other adapters.
|
|
53
|
+
*/
|
|
54
|
+
export declare function Into(props: {
|
|
55
|
+
target: HTMLElement;
|
|
56
|
+
children?: JSX.Element;
|
|
26
57
|
}): JSX.Element;
|
|
58
|
+
/** What `PortalProvider` takes. */
|
|
59
|
+
export interface PortalProviderProps {
|
|
60
|
+
/** Where the popups inside are drawn; the end of `<body>` while it is not given. */
|
|
61
|
+
container?: HTMLElement | null | undefined;
|
|
62
|
+
children?: JSX.Element;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Says where every popup inside it is drawn, the popups those open included: an element of
|
|
66
|
+
* the page (a shadow root's host, a full-screen element) in place of `<body>`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function PortalProvider(props: PortalProviderProps): JSX.Element;
|
|
27
69
|
/** Its children in a container at the end of the page, while `mounted`. */
|
|
28
70
|
export declare function Portal(props: {
|
|
29
71
|
mounted: ReadonlySignal<boolean>;
|