@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.
Files changed (213) hide show
  1. package/dom/accordion.js +9 -6
  2. package/dom/agent.js +3 -0
  3. package/dom/autocomplete.js +2 -0
  4. package/dom/autosize.js +19 -0
  5. package/dom/avatar.js +3 -3
  6. package/dom/button.js +1 -1
  7. package/dom/calendar.js +145 -0
  8. package/dom/carousel.js +83 -0
  9. package/dom/checkbox.js +5 -4
  10. package/dom/collapsible.js +3 -3
  11. package/dom/combobox.js +289 -0
  12. package/dom/command.js +129 -0
  13. package/dom/context-menu.js +2 -0
  14. package/dom/date-field.js +90 -0
  15. package/dom/date-picker.js +103 -0
  16. package/dom/dialog.js +32 -1
  17. package/dom/drawer.js +2 -0
  18. package/dom/field.js +3 -3
  19. package/dom/fieldset.js +2 -2
  20. package/dom/form.js +1 -1
  21. package/dom/hover-popup.js +19 -4
  22. package/dom/index.js +26 -1
  23. package/dom/input.js +26 -0
  24. package/dom/label.js +18 -0
  25. package/dom/listbox.js +114 -0
  26. package/dom/menu.js +261 -0
  27. package/dom/menubar-context.js +3 -0
  28. package/dom/menubar.js +33 -0
  29. package/dom/message-scroller.js +56 -0
  30. package/dom/navigation-menu.js +147 -0
  31. package/dom/number-field.js +82 -0
  32. package/dom/otp.js +95 -0
  33. package/dom/pagination.js +74 -0
  34. package/dom/popover.js +22 -7
  35. package/dom/qr-code.js +48 -0
  36. package/dom/radio-group.js +6 -5
  37. package/dom/resizable.js +65 -0
  38. package/dom/runtime.js +59 -9
  39. package/dom/scroll-area.js +99 -0
  40. package/dom/select.js +91 -15
  41. package/dom/separator.js +1 -1
  42. package/dom/slider.js +11 -8
  43. package/dom/switch.js +5 -4
  44. package/dom/tabs.js +5 -5
  45. package/dom/testing.js +3 -0
  46. package/dom/toast.js +150 -0
  47. package/dom/toggle-group.js +37 -0
  48. package/dom/toggle.js +12 -4
  49. package/dom/toolbar-context.js +5 -0
  50. package/dom/toolbar.js +71 -0
  51. package/dom/value-bar.js +3 -3
  52. package/llms.txt +3202 -0
  53. package/package.json +236 -2
  54. package/server/accordion.js +9 -6
  55. package/server/agent.js +3 -0
  56. package/server/autocomplete.js +2 -0
  57. package/server/autosize.js +19 -0
  58. package/server/avatar.js +3 -3
  59. package/server/button.js +1 -1
  60. package/server/calendar.js +144 -0
  61. package/server/carousel.js +83 -0
  62. package/server/checkbox.js +5 -4
  63. package/server/collapsible.js +3 -3
  64. package/server/combobox.js +289 -0
  65. package/server/command.js +129 -0
  66. package/server/context-menu.js +2 -0
  67. package/server/date-field.js +90 -0
  68. package/server/date-picker.js +103 -0
  69. package/server/dialog.js +32 -1
  70. package/server/drawer.js +2 -0
  71. package/server/field.js +3 -3
  72. package/server/fieldset.js +2 -2
  73. package/server/form.js +1 -1
  74. package/server/hover-popup.js +19 -4
  75. package/server/index.js +26 -1
  76. package/server/input.js +26 -0
  77. package/server/label.js +18 -0
  78. package/server/listbox.js +114 -0
  79. package/server/menu.js +261 -0
  80. package/server/menubar-context.js +3 -0
  81. package/server/menubar.js +33 -0
  82. package/server/message-scroller.js +56 -0
  83. package/server/navigation-menu.js +147 -0
  84. package/server/number-field.js +81 -0
  85. package/server/otp.js +94 -0
  86. package/server/pagination.js +74 -0
  87. package/server/popover.js +22 -7
  88. package/server/qr-code.js +48 -0
  89. package/server/radio-group.js +6 -5
  90. package/server/resizable.js +65 -0
  91. package/server/runtime.js +58 -8
  92. package/server/scroll-area.js +99 -0
  93. package/server/select.js +91 -15
  94. package/server/separator.js +1 -1
  95. package/server/slider.js +11 -8
  96. package/server/switch.js +5 -4
  97. package/server/tabs.js +5 -5
  98. package/server/testing.js +3 -0
  99. package/server/toast.js +150 -0
  100. package/server/toggle-group.js +37 -0
  101. package/server/toggle.js +12 -4
  102. package/server/toolbar-context.js +5 -0
  103. package/server/toolbar.js +71 -0
  104. package/server/value-bar.js +3 -3
  105. package/skills/kirana-ui-primitives/SKILL.md +142 -0
  106. package/src/accordion.jsx +10 -7
  107. package/src/agent.js +3 -0
  108. package/src/autocomplete.jsx +2 -0
  109. package/src/autosize.jsx +8 -0
  110. package/src/avatar.jsx +3 -3
  111. package/src/button.jsx +1 -1
  112. package/src/calendar.jsx +108 -0
  113. package/src/carousel.jsx +51 -0
  114. package/src/checkbox.jsx +5 -3
  115. package/src/collapsible.jsx +3 -3
  116. package/src/combobox.jsx +187 -0
  117. package/src/command.jsx +81 -0
  118. package/src/context-menu.js +2 -0
  119. package/src/date-field.jsx +71 -0
  120. package/src/date-picker.jsx +72 -0
  121. package/src/dialog.jsx +27 -1
  122. package/src/drawer.js +2 -0
  123. package/src/field.jsx +3 -3
  124. package/src/fieldset.jsx +2 -2
  125. package/src/form.jsx +1 -1
  126. package/src/hover-popup.jsx +12 -4
  127. package/src/index.js +26 -1
  128. package/src/input.jsx +17 -0
  129. package/src/label.jsx +9 -0
  130. package/src/listbox.jsx +81 -0
  131. package/src/menu.jsx +164 -0
  132. package/src/menubar-context.js +3 -0
  133. package/src/menubar.jsx +21 -0
  134. package/src/message-scroller.jsx +27 -0
  135. package/src/navigation-menu.jsx +96 -0
  136. package/src/number-field.jsx +75 -0
  137. package/src/otp.jsx +73 -0
  138. package/src/pagination.jsx +60 -0
  139. package/src/popover.jsx +22 -4
  140. package/src/qr-code.jsx +25 -0
  141. package/src/radio-group.jsx +7 -5
  142. package/src/resizable.jsx +46 -0
  143. package/src/runtime.jsx +54 -9
  144. package/src/scroll-area.jsx +53 -0
  145. package/src/select.jsx +72 -14
  146. package/src/separator.jsx +1 -1
  147. package/src/slider.jsx +13 -8
  148. package/src/switch.jsx +5 -3
  149. package/src/tabs.jsx +6 -6
  150. package/src/testing.js +3 -0
  151. package/src/toast.jsx +86 -0
  152. package/src/toggle-group.jsx +32 -0
  153. package/src/toggle.jsx +9 -3
  154. package/src/toolbar-context.js +5 -0
  155. package/src/toolbar.jsx +43 -0
  156. package/src/value-bar.jsx +3 -3
  157. package/types/accordion.d.ts +21 -19
  158. package/types/agent.d.ts +1 -0
  159. package/types/alert-dialog.d.ts +1 -0
  160. package/types/autocomplete.d.ts +2 -0
  161. package/types/autosize.d.ts +11 -0
  162. package/types/avatar.d.ts +12 -5
  163. package/types/button.d.ts +4 -2
  164. package/types/calendar.d.ts +57 -0
  165. package/types/carousel.d.ts +34 -0
  166. package/types/checkbox.d.ts +10 -6
  167. package/types/collapsible.d.ts +11 -7
  168. package/types/combobox.d.ts +105 -0
  169. package/types/command.d.ts +55 -0
  170. package/types/context-menu.d.ts +2 -0
  171. package/types/date-field.d.ts +34 -0
  172. package/types/date-picker.d.ts +40 -0
  173. package/types/dialog.d.ts +52 -20
  174. package/types/direction.d.ts +1 -0
  175. package/types/drawer.d.ts +2 -0
  176. package/types/field.d.ts +19 -11
  177. package/types/fieldset.d.ts +8 -3
  178. package/types/form.d.ts +5 -2
  179. package/types/hover-card.d.ts +16 -7
  180. package/types/hover-popup.d.ts +23 -10
  181. package/types/index.d.ts +39 -2
  182. package/types/input.d.ts +13 -0
  183. package/types/label.d.ts +7 -0
  184. package/types/listbox.d.ts +36 -0
  185. package/types/menu.d.ts +105 -0
  186. package/types/menubar-context.d.ts +3 -0
  187. package/types/menubar.d.ts +12 -0
  188. package/types/message-scroller.d.ts +22 -0
  189. package/types/meter.d.ts +16 -7
  190. package/types/navigation-menu.d.ts +50 -0
  191. package/types/number-field.d.ts +22 -0
  192. package/types/otp.d.ts +39 -0
  193. package/types/pagination.d.ts +31 -0
  194. package/types/popover.d.ts +41 -13
  195. package/types/progress.d.ts +16 -7
  196. package/types/qr-code.d.ts +20 -0
  197. package/types/radio-group.d.ts +15 -16
  198. package/types/resizable.d.ts +29 -0
  199. package/types/runtime.d.ts +53 -11
  200. package/types/scroll-area.d.ts +28 -0
  201. package/types/select.d.ts +66 -33
  202. package/types/separator.d.ts +5 -3
  203. package/types/slider.d.ts +25 -13
  204. package/types/switch.d.ts +8 -4
  205. package/types/tabs.d.ts +20 -16
  206. package/types/testing.d.ts +1 -0
  207. package/types/toast.d.ts +57 -0
  208. package/types/toggle-group.d.ts +9 -0
  209. package/types/toggle.d.ts +6 -3
  210. package/types/toolbar-context.d.ts +6 -0
  211. package/types/toolbar.d.ts +28 -0
  212. package/types/tooltip.d.ts +16 -7
  213. package/types/value-bar.d.ts +21 -10
@@ -1,21 +1,25 @@
1
- import type { ChangeDetails } from "@kirana-ui/core";
1
+ import type { ChangeDetails, StateOf } from "@kirana-ui/core";
2
+ import type { Vocabulary } from "@kirana-ui/core/vocabulary";
2
3
  import type { JSX } from "solid-js";
3
4
  import type { PartComponentProps } from "./runtime.tsx";
4
- export type RootProps = PartComponentProps & {
5
+ type Parts = Vocabulary["collapsible"];
6
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
5
7
  open?: boolean;
6
8
  defaultOpen?: boolean;
7
9
  onOpenChange?: (open: boolean, details: ChangeDetails) => void;
8
10
  disabled?: boolean;
9
11
  id?: string;
10
- };
12
+ }>;
11
13
  declare function Root(props: RootProps): JSX.Element;
12
- /** `keepMounted` keeps the closed panel in the page, `hidden`. */
13
- declare function Panel(props: PartComponentProps & {
14
+ export type TriggerProps = PartComponentProps<"button", StateOf<Parts["trigger"]>>;
15
+ export type PanelProps = PartComponentProps<"div", StateOf<Parts["panel"]>, {
14
16
  keepMounted?: boolean;
15
- }): JSX.Element;
17
+ }>;
18
+ /** `keepMounted` keeps the closed panel in the page, `hidden`. */
19
+ declare function Panel(props: PanelProps): JSX.Element;
16
20
  export declare const Collapsible: {
17
21
  Root: typeof Root;
18
- Trigger: (props: PartComponentProps) => JSX.Element;
22
+ Trigger: (props: TriggerProps) => JSX.Element;
19
23
  Panel: typeof Panel;
20
24
  };
21
25
  export {};
@@ -0,0 +1,105 @@
1
+ import type { StateOf } from "@kirana-ui/core";
2
+ import type { AutocompleteProps } from "@kirana-ui/core/autocomplete";
3
+ import type { ComboboxProps } from "@kirana-ui/core/combobox";
4
+ import type { Vocabulary } from "@kirana-ui/core/vocabulary";
5
+ import type { JSX } from "solid-js";
6
+ import type { PortalProps, PositionerOptions } from "./popover.tsx";
7
+ import type { PartComponentProps } from "./runtime.tsx";
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"> & {
15
+ id?: string;
16
+ children?: JSX.Element;
17
+ };
18
+ declare function Root<Value = unknown>(props: RootProps<Value>): JSX.Element;
19
+ export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
20
+ declare function Positioner(props: PositionerProps): JSX.Element;
21
+ export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
22
+ value: unknown;
23
+ disabled?: boolean;
24
+ label?: string;
25
+ id?: string;
26
+ index?: number;
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"]>, {
31
+ keepMounted?: boolean;
32
+ }>;
33
+ declare function ItemIndicator(props: ItemIndicatorProps): JSX.Element;
34
+ export type ClearProps = PartComponentProps<"button", StateOf<Parts["clear"]>, {
35
+ keepMounted?: boolean;
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"]>, {
40
+ value: unknown;
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"]>>;
46
+ /** Drawn while no item is shown for what was typed. */
47
+ declare function Empty(props: EmptyProps): JSX.Element;
48
+ export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
49
+ id?: string;
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 AutocompleteRootProps = Omit<AutocompleteProps, "id"> & {
61
+ id?: string;
62
+ children?: JSX.Element;
63
+ };
64
+ /** A combobox whose text is the value: the list only suggests. */
65
+ declare function AutocompleteRoot(props: AutocompleteRootProps): JSX.Element;
66
+ export declare const Combobox: {
67
+ Root: typeof Root;
68
+ Input: (props: InputProps) => JSX.Element;
69
+ Trigger: (props: TriggerProps) => JSX.Element;
70
+ Clear: typeof Clear;
71
+ /** With `multiple`: what holds the chips and the input. */
72
+ Chips: (props: ChipsProps) => JSX.Element;
73
+ Chip: typeof Chip;
74
+ ChipRemove: (props: ChipRemoveProps) => JSX.Element;
75
+ Portal: (props: PortalProps) => JSX.Element;
76
+ Positioner: typeof Positioner;
77
+ Popup: (props: PopupProps) => JSX.Element;
78
+ /**
79
+ * The items' own box inside the popup, when the popup holds more than items (an input): it
80
+ * is then the listbox.
81
+ */
82
+ List: (props: ListProps) => JSX.Element;
83
+ Group: typeof Group;
84
+ GroupLabel: (props: GroupLabelProps) => JSX.Element;
85
+ /** A line between groups. */
86
+ Separator: (props: SeparatorProps) => JSX.Element;
87
+ Item: typeof Item;
88
+ ItemIndicator: typeof ItemIndicator;
89
+ Empty: typeof Empty;
90
+ };
91
+ export declare const Autocomplete: {
92
+ Root: typeof AutocompleteRoot;
93
+ Input: (props: InputProps) => JSX.Element;
94
+ Trigger: (props: TriggerProps) => JSX.Element;
95
+ Clear: typeof Clear;
96
+ Portal: (props: PortalProps) => JSX.Element;
97
+ Positioner: typeof Positioner;
98
+ Popup: (props: PopupProps) => JSX.Element;
99
+ List: (props: ListProps) => JSX.Element;
100
+ Group: typeof Group;
101
+ GroupLabel: (props: GroupLabelProps) => JSX.Element;
102
+ Separator: (props: SeparatorProps) => JSX.Element;
103
+ Item: typeof Item;
104
+ Empty: typeof Empty;
105
+ };
@@ -0,0 +1,55 @@
1
+ import type { ChangeDetails, StateOf } from "@kirana-ui/core";
2
+ import type { CommandProps } from "@kirana-ui/core/command";
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["command"];
7
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, {
8
+ inputValue?: string;
9
+ defaultInputValue?: string;
10
+ onInputValueChange?: (value: string, details: ChangeDetails) => void;
11
+ /** An item was chosen. It takes the place of the element's own `select` event. */
12
+ onSelect?: (value: string, details: ChangeDetails) => void;
13
+ filter?: CommandProps["filter"];
14
+ loop?: boolean;
15
+ disabled?: boolean;
16
+ id?: string;
17
+ }>;
18
+ declare function Root(props: RootProps): JSX.Element;
19
+ export type InputProps = PartComponentProps<"input", StateOf<Parts["input"]>>;
20
+ export type ListProps = PartComponentProps<"div", StateOf<Parts["list"]>>;
21
+ export type EmptyProps = PartComponentProps<"div", StateOf<Parts["empty"]>>;
22
+ export type GroupProps = PartComponentProps<"div", StateOf<Parts["group"]>, {
23
+ id?: string;
24
+ }>;
25
+ export type GroupHeadingProps = PartComponentProps<"div", StateOf<Parts["groupHeading"]>>;
26
+ export type ItemProps = PartComponentProps<"div", StateOf<Parts["item"]>, {
27
+ value: string;
28
+ disabled?: boolean;
29
+ label?: string;
30
+ keywords?: readonly string[];
31
+ id?: string;
32
+ }>;
33
+ export type SeparatorProps = PartComponentProps<"div", StateOf<Parts["separator"]>, {
34
+ alwaysRender?: boolean;
35
+ }>;
36
+ /** Drawn while no item is shown for what was typed. */
37
+ declare function Empty(props: EmptyProps): JSX.Element;
38
+ /** Items under a `<Command.GroupHeading>`. Hidden while none of them is shown. */
39
+ declare function Group(props: GroupProps): JSX.Element;
40
+ declare function GroupHeading(props: GroupHeadingProps): JSX.Element;
41
+ /** `label` is what is filtered, the item's text when left out; `keywords` are other words for it. */
42
+ declare function Item(props: ItemProps): JSX.Element;
43
+ /** A line between groups: gone while something is typed, unless `alwaysRender`. */
44
+ declare function Separator(props: SeparatorProps): JSX.Element;
45
+ export declare const Command: {
46
+ Root: typeof Root;
47
+ Input: (props: InputProps) => JSX.Element;
48
+ List: (props: ListProps) => JSX.Element;
49
+ Empty: typeof Empty;
50
+ Group: typeof Group;
51
+ GroupHeading: typeof GroupHeading;
52
+ Item: typeof Item;
53
+ Separator: typeof Separator;
54
+ };
55
+ export {};
@@ -0,0 +1,2 @@
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";
@@ -0,0 +1,34 @@
1
+ import type { StateOf } from "@kirana-ui/core";
2
+ import type { DateField as Controller, DateFieldProps, DateFieldSegment } from "@kirana-ui/core/date-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["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
+ */
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 DateFieldContext };
14
+ export type RootProps = PartComponentProps<"div", StateOf<Parts["root"]>, Omit<DateFieldProps, "id"> & {
15
+ id?: string;
16
+ }>;
17
+ declare function Root(props: RootProps): JSX.Element;
18
+ export type SegmentsProps = {
19
+ children: (segment: DateFieldSegment) => JSX.Element;
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"]>, {
24
+ segment: DateFieldSegment;
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"]>>;
29
+ export declare const DateField: {
30
+ Root: typeof Root;
31
+ Segments: typeof Segments;
32
+ Segment: typeof Segment;
33
+ Input: (props: InputProps) => JSX.Element;
34
+ };
@@ -0,0 +1,40 @@
1
+ import type { StateOf } from "@kirana-ui/core";
2
+ import type { DatePickerProps } from "@kirana-ui/core/date-picker";
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["datePicker"];
7
+ export type { CellProps, DayProps, GridProps, HeadCellProps, HeadingProps, 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";
10
+ export type RootProps = Omit<DatePickerProps, "id"> & {
11
+ id?: string;
12
+ children?: JSX.Element;
13
+ };
14
+ /** A date field, and a calendar in a popover, with one value between them. It draws nothing. */
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"]>>;
18
+ export declare const DatePicker: {
19
+ Root: typeof Root;
20
+ /** The typed date: what holds its segments and its hidden input. */
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;
27
+ Positioner: (props: import("./popover.tsx").PositionerProps) => JSX.Element;
28
+ Popup: (props: import("./popover.tsx").PopupProps) => JSX.Element;
29
+ /** The calendar: what holds its heading, its buttons and its grid. */
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
+ Grid: (props: import("./calendar.tsx").GridProps) => JSX.Element;
35
+ Weekdays: (props: import("./calendar.tsx").WeekdaysProps) => JSX.Element;
36
+ HeadCell: (props: import("./calendar.tsx").HeadCellProps) => JSX.Element;
37
+ Weeks: (props: import("./calendar.tsx").WeeksProps) => JSX.Element;
38
+ Cell: (props: import("./calendar.tsx").CellProps) => JSX.Element;
39
+ Day: (props: import("./calendar.tsx").DayProps) => JSX.Element;
40
+ };
package/types/dialog.d.ts CHANGED
@@ -1,6 +1,10 @@
1
- import type { ChangeDetails } from "@kirana-ui/core";
1
+ import type { ChangeDetails, StateOf } from "@kirana-ui/core";
2
+ import type { DrawerSide, DrawerSnapPoint } from "@kirana-ui/core/drawer";
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["dialog"];
7
+ type DrawerParts = Vocabulary["drawer"];
4
8
  export type RootProps = {
5
9
  open?: boolean;
6
10
  defaultOpen?: boolean;
@@ -11,30 +15,58 @@ export type RootProps = {
11
15
  children?: JSX.Element;
12
16
  };
13
17
  declare function Root(props: RootProps): JSX.Element;
14
- 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 PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
24
+ export type TitleProps = PartComponentProps<"h2", StateOf<Parts["title"]>>;
25
+ export type DescriptionProps = PartComponentProps<"p", StateOf<Parts["description"]>>;
26
+ export type CloseProps = PartComponentProps<"button", StateOf<Parts["close"]>>;
27
+ export type AlertRootProps = Omit<RootProps, "modal" | "dismissible">;
28
+ declare function AlertRoot(props: AlertRootProps): JSX.Element;
15
29
  export declare const Dialog: {
16
30
  Root: typeof Root;
17
- Portal: (props: {
18
- children?: JSX.Element;
19
- }) => JSX.Element;
20
- Trigger: (props: PartComponentProps) => JSX.Element;
21
- Backdrop: (props: PartComponentProps) => JSX.Element;
22
- Popup: (props: PartComponentProps) => JSX.Element;
23
- Title: (props: PartComponentProps) => JSX.Element;
24
- Description: (props: PartComponentProps) => JSX.Element;
25
- Close: (props: PartComponentProps) => JSX.Element;
31
+ Portal: (props: PortalProps) => JSX.Element;
32
+ Trigger: (props: TriggerProps) => JSX.Element;
33
+ Backdrop: (props: BackdropProps) => JSX.Element;
34
+ Popup: (props: PopupProps) => JSX.Element;
35
+ Title: (props: TitleProps) => JSX.Element;
36
+ Description: (props: DescriptionProps) => JSX.Element;
37
+ Close: (props: CloseProps) => JSX.Element;
26
38
  };
27
39
  /** A dialog that asks for an answer: a press outside it does not close it. Its parts are a dialog's. */
28
40
  export declare const AlertDialog: {
29
41
  Root: typeof AlertRoot;
30
- Portal: (props: {
31
- children?: JSX.Element;
32
- }) => JSX.Element;
33
- Trigger: (props: PartComponentProps) => JSX.Element;
34
- Backdrop: (props: PartComponentProps) => JSX.Element;
35
- Popup: (props: PartComponentProps) => JSX.Element;
36
- Title: (props: PartComponentProps) => JSX.Element;
37
- Description: (props: PartComponentProps) => JSX.Element;
38
- Close: (props: PartComponentProps) => JSX.Element;
42
+ Portal: (props: PortalProps) => JSX.Element;
43
+ Trigger: (props: TriggerProps) => JSX.Element;
44
+ Backdrop: (props: BackdropProps) => JSX.Element;
45
+ Popup: (props: PopupProps) => JSX.Element;
46
+ Title: (props: TitleProps) => JSX.Element;
47
+ Description: (props: DescriptionProps) => JSX.Element;
48
+ Close: (props: CloseProps) => JSX.Element;
49
+ };
50
+ export type DrawerRootProps = RootProps & {
51
+ swipeDirection?: DrawerSide;
52
+ snapPoints?: readonly DrawerSnapPoint[];
53
+ snapPoint?: DrawerSnapPoint;
54
+ defaultSnapPoint?: DrawerSnapPoint;
55
+ onSnapPointChange?: (snapPoint: DrawerSnapPoint, details: ChangeDetails) => void;
56
+ };
57
+ declare function DrawerRoot(props: DrawerRootProps): JSX.Element;
58
+ /** A drawer's backdrop and popup say more than a dialog's: how they are being dragged. */
59
+ export type DrawerBackdropProps = PartComponentProps<"div", StateOf<DrawerParts["backdrop"]>>;
60
+ export type DrawerPopupProps = PartComponentProps<"div", StateOf<DrawerParts["popup"]>>;
61
+ /** A dialog that comes from an edge and is dragged back to it. Its parts are a dialog's. */
62
+ export declare const Drawer: {
63
+ Root: typeof DrawerRoot;
64
+ Backdrop: (props: DrawerBackdropProps) => JSX.Element;
65
+ Popup: (props: DrawerPopupProps) => JSX.Element;
66
+ Portal: (props: PortalProps) => JSX.Element;
67
+ Trigger: (props: TriggerProps) => JSX.Element;
68
+ Title: (props: TitleProps) => JSX.Element;
69
+ Description: (props: DescriptionProps) => JSX.Element;
70
+ Close: (props: CloseProps) => JSX.Element;
39
71
  };
40
72
  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;
@@ -0,0 +1,2 @@
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;
@@ -1,10 +1,19 @@
1
+ import type { StateOf } from "@kirana-ui/core";
2
+ import type { Vocabulary } from "@kirana-ui/core/vocabulary";
3
+ import type { TriggerOptions } from "./hover-popup.tsx";
4
+ import type { PositionerOptions } from "./popover.tsx";
5
+ import type { PartComponentProps } from "./runtime.tsx";
6
+ type Parts = Vocabulary["hoverCard"];
7
+ export type { PortalProps, RootProps } from "./hover-popup.tsx";
8
+ export type TriggerProps = PartComponentProps<"a", StateOf<Parts["trigger"]>, TriggerOptions>;
9
+ export type PositionerProps = PartComponentProps<"div", StateOf<Parts["positioner"]>, PositionerOptions>;
10
+ export type PopupProps = PartComponentProps<"div", StateOf<Parts["popup"]>>;
11
+ export type ArrowProps = PartComponentProps<"div", StateOf<Parts["arrow"]>>;
1
12
  export declare const HoverCard: {
2
13
  Root: (props: import("./hover-popup.tsx").RootProps) => import("solid-js").JSX.Element;
3
- Portal: (props: {
4
- children?: import("solid-js").JSX.Element;
5
- }) => import("solid-js").JSX.Element;
6
- Positioner: (props: import("./popover.tsx").PositionerProps) => import("solid-js").JSX.Element;
7
- Trigger: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
8
- Popup: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
9
- Arrow: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
14
+ Portal: (props: import("./hover-popup.tsx").PortalProps) => import("solid-js").JSX.Element;
15
+ Positioner: (props: PositionerProps) => import("solid-js").JSX.Element;
16
+ Trigger: (props: TriggerProps) => import("solid-js").JSX.Element;
17
+ Popup: (props: PopupProps) => import("solid-js").JSX.Element;
18
+ Arrow: (props: ArrowProps) => import("solid-js").JSX.Element;
10
19
  };
@@ -1,8 +1,7 @@
1
1
  import type { ChangeDetails, ReadonlySignal } from "@kirana-ui/core";
2
2
  import type { HoverPopup, HoverPopupProps } from "@kirana-ui/core/tooltip";
3
3
  import type { JSX } from "solid-js";
4
- import type { PositionerProps } from "./popover.tsx";
5
- import type { PartComponentProps } from "./runtime.tsx";
4
+ import type { PositionerOptions } from "./popover.tsx";
6
5
  export type RootProps = {
7
6
  open?: boolean;
8
7
  defaultOpen?: boolean;
@@ -13,14 +12,28 @@ export type RootProps = {
13
12
  id?: string;
14
13
  children?: JSX.Element;
15
14
  };
15
+ export type PortalProps = {
16
+ children?: JSX.Element;
17
+ };
18
+ /** A trigger's own props: `delay` and `closeDelay` here come before the root's. */
19
+ export type TriggerOptions = {
20
+ delay?: number;
21
+ closeDelay?: number;
22
+ };
23
+ /** The props of each part that draws an element, as the component's entry names them. */
24
+ type PartsProps = {
25
+ Trigger: TriggerOptions;
26
+ Positioner: PositionerOptions;
27
+ Popup: Record<string, unknown>;
28
+ Arrow: Record<string, unknown>;
29
+ };
16
30
  /** The parts of a popup the pointer opens: a tooltip's, a hover card's. */
17
- export declare function hoverPopup(name: string, create: (props: ReadonlySignal<HoverPopupProps>) => HoverPopup, triggerTag: string): {
31
+ export declare function hoverPopup<Props extends PartsProps>(name: string, create: (props: ReadonlySignal<HoverPopupProps>) => HoverPopup, triggerTag: string): {
18
32
  Root: (props: RootProps) => JSX.Element;
19
- Portal: (props: {
20
- children?: JSX.Element;
21
- }) => JSX.Element;
22
- Positioner: (props: PositionerProps) => JSX.Element;
23
- Trigger: (props: PartComponentProps) => JSX.Element;
24
- Popup: (props: PartComponentProps) => JSX.Element;
25
- Arrow: (props: PartComponentProps) => JSX.Element;
33
+ Portal: (props: PortalProps) => JSX.Element;
34
+ Positioner: (props: Props["Positioner"]) => JSX.Element;
35
+ Trigger: (props: Props["Trigger"]) => JSX.Element;
36
+ Popup: (props: Props["Popup"]) => JSX.Element;
37
+ Arrow: (props: Props["Arrow"]) => JSX.Element;
26
38
  };
39
+ export {};
package/types/index.d.ts CHANGED
@@ -1,24 +1,61 @@
1
1
  export { Accordion } from "./accordion.tsx";
2
2
  export { Checkbox } from "./checkbox.tsx";
3
3
  export { Collapsible } from "./collapsible.tsx";
4
- export { AlertDialog, Dialog } from "./dialog.tsx";
4
+ export { AlertDialog, Dialog, Drawer } from "./dialog.tsx";
5
+ export { MessageScroller } from "./message-scroller.tsx";
5
6
  export { HoverCard } from "./hover-card.tsx";
7
+ export { Combobox } from "./combobox.tsx";
8
+ export { Listbox } from "./listbox.tsx";
9
+ export { ContextMenu, Menu } from "./menu.tsx";
10
+ export { Menubar } from "./menubar.tsx";
11
+ export { NavigationMenu } from "./navigation-menu.tsx";
12
+ export { Otp } from "./otp.tsx";
13
+ export { DateField } from "./date-field.tsx";
14
+ export { Input } from "./input.tsx";
15
+ export { Label } from "./label.tsx";
16
+ export { Command } from "./command.tsx";
17
+ export { NumberField } from "./number-field.tsx";
18
+ export { Autocomplete } from "./autocomplete.tsx";
19
+ export { Pagination } from "./pagination.tsx";
20
+ export { DatePicker } from "./date-picker.tsx";
21
+ export { Calendar } from "./calendar.tsx";
22
+ export { QrCode } from "./qr-code.tsx";
23
+ export { Autosize } from "./autosize.tsx";
24
+ export { Carousel } from "./carousel.tsx";
25
+ export { Toast, createToaster } from "./toast.tsx";
26
+ export type { ToastActionOptions, ToastContent, ToastOptions, ToastRecord, ToastState, Toaster, ToasterOptions, } from "./toast.tsx";
27
+ export { Resizable } from "./resizable.tsx";
6
28
  export { Popover } from "./popover.tsx";
7
29
  export { RadioGroup } from "./radio-group.tsx";
8
30
  export { Select } from "./select.tsx";
9
31
  export { Switch } from "./switch.tsx";
10
32
  export { Tabs } from "./tabs.tsx";
11
33
  export { Tooltip } from "./tooltip.tsx";
12
- export type { PartComponentProps } from "./runtime.tsx";
34
+ export type { PartComponentProps, PartEvent, PartTag } from "./runtime.tsx";
13
35
  export { Avatar } from "./avatar.tsx";
14
36
  export { Button } from "./button.tsx";
15
37
  export { Meter } from "./meter.tsx";
16
38
  export { Progress } from "./progress.tsx";
17
39
  export { Separator } from "./separator.tsx";
18
40
  export { Toggle } from "./toggle.tsx";
41
+ export { ToggleGroup } from "./toggle-group.tsx";
42
+ export { Toolbar } from "./toolbar.tsx";
43
+ export { ScrollArea } from "./scroll-area.tsx";
19
44
  export { Slider } from "./slider.tsx";
20
45
  export { Field } from "./field.tsx";
21
46
  export { Fieldset } from "./fieldset.tsx";
22
47
  export { Form } from "./form.tsx";
23
48
  export { DirectionProvider, useDirection } from "./direction.tsx";
24
49
  export type { DirectionProviderProps } from "./direction.tsx";
50
+ export { PortalProvider } from "./runtime.tsx";
51
+ export type { PortalProviderProps } from "./runtime.tsx";
52
+ export type { Align, Anchor, AnchorOption, Bindable, ChangeDetails, ChangeSource, ComponentDefinition, Direction, ItemLabels, ListCollection, Orientation, Part, PartDefinition, PartProps, PartState, PartStyle, PhysicalSide, PositionOptions, ReadonlySignal, Side, Signal, StateDefinition, StateOf, } from "@kirana-ui/core";
53
+ export type { CalendarDay, CalendarValue, CalendarWeekday, DateRange, IsoDate, } from "@kirana-ui/core/calendar";
54
+ export type { DateFieldSegment, DateUnit } from "@kirana-ui/core/date-field";
55
+ export type { DrawerSide, DrawerSnapPoint } from "@kirana-ui/core/drawer";
56
+ export type { FieldValidity, ValidityKey } from "@kirana-ui/core/field";
57
+ export type { FormErrors, FormValues, ValidationMode } from "@kirana-ui/core/form";
58
+ export type { PaginationEntry } from "@kirana-ui/core/pagination";
59
+ export type { QrCorrection } from "@kirana-ui/core/qr-code";
60
+ export type { SelectShown } from "@kirana-ui/core/select";
61
+ export type { SliderChangeDetails, SliderTold } from "@kirana-ui/core/slider";
@@ -0,0 +1,13 @@
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
+ export type InputProps = PartComponentProps<"input", StateOf<Vocabulary["input"]["input"]>, {
6
+ disabled?: boolean;
7
+ onValueChange?: (value: string, details: ChangeDetails) => void;
8
+ }>;
9
+ /**
10
+ * An `<input>`; `as="textarea"` for a text area. It takes what an `<input>` takes, and inside
11
+ * a `<Field.Root>` it is the field's control.
12
+ */
13
+ export declare function Input(props: InputProps): JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { 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 LabelProps = PartComponentProps<"label", StateOf<Vocabulary["label"]["label"]>>;
6
+ /** A `<label>`. Inside a `<Field.Root>` it is the field's label. */
7
+ export declare function Label(props: LabelProps): JSX.Element;