@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.
Files changed (208) hide show
  1. package/dom/accordion.js +9 -6
  2. package/dom/agent.js +3 -0
  3. package/dom/autosize.js +1 -1
  4. package/dom/avatar.js +39 -14
  5. package/dom/button.js +1 -1
  6. package/dom/calendar.js +78 -19
  7. package/dom/carousel.js +6 -6
  8. package/dom/checkbox-group-context.js +3 -0
  9. package/dom/checkbox-group.js +38 -0
  10. package/dom/checkbox.js +9 -5
  11. package/dom/collapsible.js +3 -3
  12. package/dom/combobox.js +72 -14
  13. package/dom/command.js +10 -9
  14. package/dom/date-field.js +7 -3
  15. package/dom/date-picker.js +9 -3
  16. package/dom/dialog.js +13 -3
  17. package/dom/field.js +3 -3
  18. package/dom/fieldset.js +2 -2
  19. package/dom/form.js +1 -1
  20. package/dom/hover-popup.js +3 -3
  21. package/dom/index.js +1 -0
  22. package/dom/input.js +1 -1
  23. package/dom/label.js +1 -1
  24. package/dom/listbox.js +5 -5
  25. package/dom/menu.js +11 -11
  26. package/dom/menubar.js +1 -1
  27. package/dom/message-scroller.js +4 -4
  28. package/dom/navigation-menu.js +18 -21
  29. package/dom/number-field.js +39 -6
  30. package/dom/otp.js +6 -5
  31. package/dom/pagination.js +3 -3
  32. package/dom/popover.js +37 -8
  33. package/dom/primitive.js +92 -0
  34. package/dom/qr-code.js +3 -3
  35. package/dom/radio-group.js +7 -6
  36. package/dom/resizable.js +3 -3
  37. package/dom/runtime.js +23 -7
  38. package/dom/scroll-area.js +5 -5
  39. package/dom/select.js +26 -13
  40. package/dom/separator.js +1 -1
  41. package/dom/slider.js +11 -8
  42. package/dom/switch.js +3 -3
  43. package/dom/tabs.js +5 -5
  44. package/dom/testing.js +3 -0
  45. package/dom/toast.js +57 -20
  46. package/dom/toggle-group.js +1 -1
  47. package/dom/toggle.js +1 -1
  48. package/dom/toolbar.js +4 -4
  49. package/dom/value-bar.js +3 -3
  50. package/llms.txt +1846 -252
  51. package/package.json +34 -2
  52. package/server/accordion.js +9 -6
  53. package/server/agent.js +3 -0
  54. package/server/autosize.js +1 -1
  55. package/server/avatar.js +39 -14
  56. package/server/button.js +1 -1
  57. package/server/calendar.js +78 -19
  58. package/server/carousel.js +6 -6
  59. package/server/checkbox-group-context.js +3 -0
  60. package/server/checkbox-group.js +38 -0
  61. package/server/checkbox.js +9 -5
  62. package/server/collapsible.js +3 -3
  63. package/server/combobox.js +72 -14
  64. package/server/command.js +10 -9
  65. package/server/date-field.js +7 -3
  66. package/server/date-picker.js +9 -3
  67. package/server/dialog.js +13 -3
  68. package/server/field.js +3 -3
  69. package/server/fieldset.js +2 -2
  70. package/server/form.js +1 -1
  71. package/server/hover-popup.js +3 -3
  72. package/server/index.js +1 -0
  73. package/server/input.js +1 -1
  74. package/server/label.js +1 -1
  75. package/server/listbox.js +5 -5
  76. package/server/menu.js +11 -11
  77. package/server/menubar.js +1 -1
  78. package/server/message-scroller.js +4 -4
  79. package/server/navigation-menu.js +18 -15
  80. package/server/number-field.js +39 -6
  81. package/server/otp.js +6 -5
  82. package/server/pagination.js +3 -3
  83. package/server/popover.js +37 -8
  84. package/server/primitive.js +92 -0
  85. package/server/qr-code.js +3 -3
  86. package/server/radio-group.js +7 -6
  87. package/server/resizable.js +3 -3
  88. package/server/runtime.js +23 -7
  89. package/server/scroll-area.js +5 -5
  90. package/server/select.js +26 -13
  91. package/server/separator.js +1 -1
  92. package/server/slider.js +11 -8
  93. package/server/switch.js +3 -3
  94. package/server/tabs.js +5 -5
  95. package/server/testing.js +3 -0
  96. package/server/toast.js +57 -20
  97. package/server/toggle-group.js +1 -1
  98. package/server/toggle.js +1 -1
  99. package/server/toolbar.js +4 -4
  100. package/server/value-bar.js +3 -3
  101. package/skills/kirana-ui-primitives/SKILL.md +163 -0
  102. package/src/accordion.jsx +10 -7
  103. package/src/agent.js +3 -0
  104. package/src/autosize.jsx +1 -1
  105. package/src/avatar.jsx +17 -10
  106. package/src/button.jsx +1 -1
  107. package/src/calendar.jsx +72 -16
  108. package/src/carousel.jsx +6 -6
  109. package/src/checkbox-group-context.js +3 -0
  110. package/src/checkbox-group.jsx +33 -0
  111. package/src/checkbox.jsx +8 -4
  112. package/src/collapsible.jsx +3 -3
  113. package/src/combobox.jsx +70 -13
  114. package/src/command.jsx +10 -8
  115. package/src/date-field.jsx +7 -3
  116. package/src/date-picker.jsx +8 -2
  117. package/src/dialog.jsx +12 -2
  118. package/src/field.jsx +3 -3
  119. package/src/fieldset.jsx +2 -2
  120. package/src/form.jsx +1 -1
  121. package/src/hover-popup.jsx +3 -3
  122. package/src/index.js +1 -0
  123. package/src/input.jsx +1 -1
  124. package/src/label.jsx +1 -1
  125. package/src/listbox.jsx +6 -6
  126. package/src/menu.jsx +11 -11
  127. package/src/menubar.jsx +1 -1
  128. package/src/message-scroller.jsx +4 -4
  129. package/src/navigation-menu.jsx +14 -13
  130. package/src/number-field.jsx +26 -6
  131. package/src/otp.jsx +6 -4
  132. package/src/pagination.jsx +3 -3
  133. package/src/popover.jsx +35 -5
  134. package/src/primitive.jsx +81 -0
  135. package/src/qr-code.jsx +3 -3
  136. package/src/radio-group.jsx +7 -7
  137. package/src/resizable.jsx +3 -3
  138. package/src/runtime.jsx +21 -7
  139. package/src/scroll-area.jsx +5 -5
  140. package/src/select.jsx +29 -14
  141. package/src/separator.jsx +1 -1
  142. package/src/slider.jsx +12 -8
  143. package/src/switch.jsx +3 -3
  144. package/src/tabs.jsx +6 -6
  145. package/src/testing.js +3 -0
  146. package/src/toast.jsx +38 -10
  147. package/src/toggle-group.jsx +2 -2
  148. package/src/toggle.jsx +1 -1
  149. package/src/toolbar.jsx +4 -4
  150. package/src/value-bar.jsx +3 -3
  151. package/types/accordion.d.ts +21 -19
  152. package/types/agent.d.ts +1 -0
  153. package/types/alert-dialog.d.ts +1 -0
  154. package/types/autocomplete.d.ts +1 -0
  155. package/types/autosize.d.ts +4 -1
  156. package/types/avatar.d.ts +14 -6
  157. package/types/button.d.ts +4 -2
  158. package/types/calendar.d.ts +48 -19
  159. package/types/carousel.d.ts +18 -10
  160. package/types/checkbox-group-context.d.ts +3 -0
  161. package/types/checkbox-group.d.ts +13 -0
  162. package/types/checkbox.d.ts +10 -6
  163. package/types/collapsible.d.ts +11 -7
  164. package/types/combobox.d.ts +102 -64
  165. package/types/command.d.ts +29 -17
  166. package/types/context-menu.d.ts +1 -0
  167. package/types/date-field.d.ts +20 -9
  168. package/types/date-picker.d.ts +26 -34
  169. package/types/dialog.d.ts +47 -31
  170. package/types/direction.d.ts +1 -0
  171. package/types/drawer.d.ts +1 -0
  172. package/types/field.d.ts +19 -11
  173. package/types/fieldset.d.ts +8 -3
  174. package/types/form.d.ts +5 -2
  175. package/types/hover-card.d.ts +16 -10
  176. package/types/hover-popup.d.ts +23 -13
  177. package/types/index.d.ts +15 -1
  178. package/types/input.d.ts +4 -3
  179. package/types/label.d.ts +4 -1
  180. package/types/listbox.d.ts +18 -20
  181. package/types/menu.d.ts +56 -42
  182. package/types/menubar.d.ts +6 -4
  183. package/types/message-scroller.d.ts +12 -6
  184. package/types/meter.d.ts +16 -7
  185. package/types/navigation-menu.d.ts +35 -29
  186. package/types/number-field.d.ts +22 -7
  187. package/types/otp.d.ts +18 -10
  188. package/types/pagination.d.ts +18 -10
  189. package/types/popover.d.ts +52 -13
  190. package/types/primitive.d.ts +50 -0
  191. package/types/progress.d.ts +16 -7
  192. package/types/qr-code.d.ts +10 -4
  193. package/types/radio-group.d.ts +18 -17
  194. package/types/resizable.d.ts +12 -7
  195. package/types/runtime.d.ts +36 -12
  196. package/types/scroll-area.d.ts +17 -9
  197. package/types/select.d.ts +55 -46
  198. package/types/separator.d.ts +5 -3
  199. package/types/slider.d.ts +25 -13
  200. package/types/switch.d.ts +7 -4
  201. package/types/tabs.d.ts +20 -16
  202. package/types/testing.d.ts +1 -0
  203. package/types/toast.d.ts +40 -16
  204. package/types/toggle-group.d.ts +6 -11
  205. package/types/toggle.d.ts +4 -3
  206. package/types/toolbar.d.ts +19 -14
  207. package/types/tooltip.d.ts +16 -10
  208. package/types/value-bar.d.ts +21 -10
@@ -1,64 +1,91 @@
1
- import type { ChangeDetails } from "@kirana-ui/core";
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 { JSX } from "solid-js";
5
- import type { PositionerProps } from "./popover.tsx";
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
- export type RootProps = {
8
- value?: unknown;
9
- defaultValue?: unknown;
10
- onValueChange?: (value: unknown, details: ChangeDetails) => void;
11
- inputValue?: string;
12
- defaultInputValue?: string;
13
- onInputValueChange?: (value: string, details: ChangeDetails) => void;
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
- /** `label` is what is filtered and what the input shows; the item's text when left out. */
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
- }): JSX.Element;
45
- declare function ItemIndicator(props: PartComponentProps & {
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
- }): JSX.Element;
48
- /** A button that empties the input and the value. Drawn while there is something to clear. */
49
- declare function Clear(props: PartComponentProps & {
32
+ }>;
33
+ declare function ItemIndicator(props: ItemIndicatorProps): JSX.Element;
34
+ export type ClearProps = PartComponentProps<"button", StateOf<Parts["clear"]>, {
50
35
  keepMounted?: boolean;
51
- }): JSX.Element;
52
- /** With `multiple`: one chosen value. Its `value` is what its remove button takes away. */
53
- declare function Chip(props: PartComponentProps & {
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
- }): JSX.Element;
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: PartComponentProps): JSX.Element;
58
- /** Items that belong together, named by their `GroupLabel`. Hidden while none is shown. */
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
- }): JSX.Element;
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: PartComponentProps) => JSX.Element;
71
- Trigger: (props: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
102
+ Chips: (props: ChipsProps) => JSX.Element;
75
103
  Chip: typeof Chip;
76
- ChipRemove: (props: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
115
+ GroupLabel: (props: GroupLabelProps) => JSX.Element;
84
116
  /** A line between groups. */
85
- Separator: (props: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
93
- Trigger: (props: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
135
+ Popup: (props: PopupProps) => JSX.Element;
136
+ List: (props: ListProps) => JSX.Element;
137
+ Collection: typeof Collection;
100
138
  Group: typeof Group;
101
- GroupLabel: (props: PartComponentProps) => JSX.Element;
102
- Separator: (props: PartComponentProps) => JSX.Element;
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 {};
@@ -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
- export type RootProps = PartComponentProps & {
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
- /** Drawn while no item is shown for what was typed. */
17
- declare function Empty(props: PartComponentProps): JSX.Element;
18
- /** Items under a `<Command.GroupHeading>`. Hidden while none of them is shown. */
19
- declare function Group(props: PartComponentProps & {
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
- }): JSX.Element;
22
- declare function GroupHeading(props: PartComponentProps): JSX.Element;
23
- /** `label` is what is filtered, the item's text when left out; `keywords` are other words for it. */
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
- }): JSX.Element;
31
- /** A line between groups: gone while something is typed, unless `alwaysRender`. */
32
- declare function Separator(props: PartComponentProps & {
34
+ }>;
35
+ export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>, {
33
36
  alwaysRender?: boolean;
34
- }): JSX.Element;
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: PartComponentProps) => JSX.Element;
38
- List: (props: PartComponentProps) => JSX.Element;
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;
@@ -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";
@@ -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
- declare function Root(props: PartComponentProps & Omit<DateFieldProps, "id"> & {
14
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<DateFieldProps, "id"> & {
8
15
  id?: string;
9
- }): JSX.Element;
10
- /** Draws its child once for each piece of the date, in the locale's order. */
11
- declare function Segments(props: {
16
+ }>;
17
+ declare function Root(props: RootProps): JSX.Element;
18
+ export type SegmentsProps = {
12
19
  children: (segment: DateFieldSegment) => JSX.Element;
13
- }): JSX.Element;
14
- /** One piece: a part that is typed, or what stands between two. It writes its own text. */
15
- declare function Segment(props: PartComponentProps & {
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
- }): JSX.Element;
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: PartComponentProps) => JSX.Element;
33
+ Input: (props: InputProps) => JSX.Element;
23
34
  };
@@ -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: PartComponentProps) => JSX.Element;
14
- Segments: (props: {
15
- children: (segment: import("@kirana-ui/core/date-field").DateFieldSegment) => JSX.Element;
16
- }) => JSX.Element;
17
- Segment: (props: PartComponentProps & {
18
- segment: import("@kirana-ui/core/date-field").DateFieldSegment;
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: PartComponentProps) => JSX.Element;
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: PartComponentProps) => JSX.Element;
29
- Heading: (props: PartComponentProps) => JSX.Element;
30
- Previous: (props: PartComponentProps) => JSX.Element;
31
- Next: (props: PartComponentProps) => JSX.Element;
32
- Grid: (props: PartComponentProps) => JSX.Element;
33
- Weekdays: (props: {
34
- children: (weekday: import("@kirana-ui/core/calendar").CalendarWeekday) => JSX.Element;
35
- }) => JSX.Element;
36
- HeadCell: (props: PartComponentProps & {
37
- weekday: import("@kirana-ui/core/calendar").CalendarWeekday;
38
- }) => JSX.Element;
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
- declare function AlertRoot(props: Omit<RootProps, "modal" | "dismissible">): JSX.Element;
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
- children?: JSX.Element;
20
- }) => JSX.Element;
21
- Trigger: (props: PartComponentProps) => JSX.Element;
22
- Backdrop: (props: PartComponentProps) => JSX.Element;
23
- Popup: (props: PartComponentProps) => JSX.Element;
24
- Title: (props: PartComponentProps) => JSX.Element;
25
- Description: (props: PartComponentProps) => JSX.Element;
26
- Close: (props: PartComponentProps) => JSX.Element;
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
- children?: JSX.Element;
33
- }) => JSX.Element;
34
- Trigger: (props: PartComponentProps) => JSX.Element;
35
- Backdrop: (props: PartComponentProps) => JSX.Element;
36
- Popup: (props: PartComponentProps) => JSX.Element;
37
- Title: (props: PartComponentProps) => JSX.Element;
38
- Description: (props: PartComponentProps) => JSX.Element;
39
- Close: (props: PartComponentProps) => JSX.Element;
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
- declare function DrawerRoot(props: RootProps & {
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
- }): JSX.Element;
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
- Portal: (props: {
52
- children?: JSX.Element;
53
- }) => JSX.Element;
54
- Trigger: (props: PartComponentProps) => JSX.Element;
55
- Backdrop: (props: PartComponentProps) => JSX.Element;
56
- Popup: (props: PartComponentProps) => JSX.Element;
57
- Title: (props: PartComponentProps) => JSX.Element;
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 {};
@@ -1,5 +1,6 @@
1
1
  import type { Direction } from "@kirana-ui/core";
2
2
  import type { JSX } from "solid-js";
3
+ /** What `DirectionProvider` takes. */
3
4
  export interface DirectionProviderProps {
4
5
  /** The reading direction of what is inside. `ltr` when left out. */
5
6
  direction?: Direction;
package/types/drawer.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { Drawer } from "./dialog.tsx";
2
+ export type { CloseProps, DescriptionProps, DrawerBackdropProps as BackdropProps, DrawerPopupProps as PopupProps, DrawerRootProps as RootProps, PortalProps, TitleProps, TriggerProps, } from "./dialog.tsx";
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
- export type RootProps = PartComponentProps & Omit<FieldProps, "id"> & {
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: PartComponentProps & {
13
- match?: ValidityKey | boolean;
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
- }): JSX.Element;
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: PartComponentProps) => JSX.Element;
29
+ Label: (props: LabelProps) => JSX.Element;
22
30
  /** An `<input>`; `as="textarea"` or `as="select"` for another. */
23
- Control: (props: PartComponentProps) => JSX.Element;
24
- Description: (props: PartComponentProps) => JSX.Element;
31
+ Control: (props: ControlProps) => JSX.Element;
32
+ Description: (props: DescriptionProps) => JSX.Element;
25
33
  Error: typeof FieldError;
26
34
  Validity: typeof Validity;
27
35
  };
@@ -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
- declare function Root(props: PartComponentProps & {
8
+ type Parts = Vocabulary["fieldset"];
9
+ export type RootProps = PartComponentProps<"fieldset", StateOf<Parts["root"]>, {
7
10
  disabled?: boolean;
8
11
  id?: string;
9
- }): JSX.Element;
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: PartComponentProps) => JSX.Element;
17
+ Legend: (props: LegendProps) => JSX.Element;
13
18
  };
14
19
  export {};
package/types/form.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import type { Form as Controller, FormProps } from "@kirana-ui/core/form";
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: PartComponentProps & FormProps): JSX.Element;
10
+ export declare function Form(props: FormProps): JSX.Element;