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