@kirana-ui/solid 0.0.0-stage → 0.1.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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/dom/accordion.js +106 -0
  3. package/dom/alert-dialog.js +2 -0
  4. package/dom/avatar.js +68 -0
  5. package/dom/button.js +18 -0
  6. package/dom/checkbox.js +76 -0
  7. package/dom/collapsible.js +64 -0
  8. package/dom/dialog.js +73 -0
  9. package/dom/direction-context.js +3 -0
  10. package/dom/direction.js +27 -0
  11. package/dom/field-context.js +3 -0
  12. package/dom/field.js +88 -0
  13. package/dom/fieldset.js +41 -0
  14. package/dom/form.js +29 -0
  15. package/dom/hover-card.js +3 -0
  16. package/dom/hover-popup.js +63 -0
  17. package/dom/index.js +22 -0
  18. package/dom/meter.js +3 -0
  19. package/dom/popover.js +68 -0
  20. package/dom/progress.js +3 -0
  21. package/dom/radio-group.js +100 -0
  22. package/dom/runtime.js +99 -0
  23. package/dom/select.js +149 -0
  24. package/dom/separator.js +17 -0
  25. package/dom/slider.js +93 -0
  26. package/dom/switch.js +62 -0
  27. package/dom/tabs.js +97 -0
  28. package/dom/toggle.js +20 -0
  29. package/dom/tooltip.js +3 -0
  30. package/dom/value-bar.js +62 -0
  31. package/package.json +229 -4
  32. package/server/accordion.js +106 -0
  33. package/server/alert-dialog.js +2 -0
  34. package/server/avatar.js +68 -0
  35. package/server/button.js +18 -0
  36. package/server/checkbox.js +76 -0
  37. package/server/collapsible.js +64 -0
  38. package/server/dialog.js +73 -0
  39. package/server/direction-context.js +3 -0
  40. package/server/direction.js +27 -0
  41. package/server/field-context.js +3 -0
  42. package/server/field.js +87 -0
  43. package/server/fieldset.js +41 -0
  44. package/server/form.js +29 -0
  45. package/server/hover-card.js +3 -0
  46. package/server/hover-popup.js +63 -0
  47. package/server/index.js +22 -0
  48. package/server/meter.js +3 -0
  49. package/server/popover.js +68 -0
  50. package/server/progress.js +3 -0
  51. package/server/radio-group.js +100 -0
  52. package/server/runtime.js +98 -0
  53. package/server/select.js +149 -0
  54. package/server/separator.js +17 -0
  55. package/server/slider.js +92 -0
  56. package/server/switch.js +61 -0
  57. package/server/tabs.js +97 -0
  58. package/server/toggle.js +20 -0
  59. package/server/tooltip.js +3 -0
  60. package/server/value-bar.js +61 -0
  61. package/src/accordion.jsx +68 -0
  62. package/src/alert-dialog.js +2 -0
  63. package/src/avatar.jsx +35 -0
  64. package/src/button.jsx +9 -0
  65. package/src/checkbox.jsx +57 -0
  66. package/src/collapsible.jsx +35 -0
  67. package/src/dialog.jsx +47 -0
  68. package/src/direction-context.js +3 -0
  69. package/src/direction.jsx +17 -0
  70. package/src/field-context.js +3 -0
  71. package/src/field.jsx +64 -0
  72. package/src/fieldset.jsx +24 -0
  73. package/src/form.jsx +26 -0
  74. package/src/hover-card.jsx +3 -0
  75. package/src/hover-popup.jsx +40 -0
  76. package/src/index.js +22 -0
  77. package/src/meter.jsx +3 -0
  78. package/src/popover.jsx +49 -0
  79. package/src/progress.jsx +3 -0
  80. package/src/radio-group.jsx +66 -0
  81. package/src/runtime.jsx +88 -0
  82. package/src/select.jsx +85 -0
  83. package/src/separator.jsx +8 -0
  84. package/src/slider.jsx +74 -0
  85. package/src/switch.jsx +47 -0
  86. package/src/tabs.jsx +58 -0
  87. package/src/toggle.jsx +18 -0
  88. package/src/tooltip.jsx +3 -0
  89. package/src/value-bar.jsx +45 -0
  90. package/types/accordion.d.ts +30 -0
  91. package/types/alert-dialog.d.ts +1 -0
  92. package/types/avatar.d.ts +15 -0
  93. package/types/button.d.ts +9 -0
  94. package/types/checkbox.d.ts +25 -0
  95. package/types/collapsible.d.ts +21 -0
  96. package/types/dialog.d.ts +40 -0
  97. package/types/direction-context.d.ts +3 -0
  98. package/types/direction.d.ts +14 -0
  99. package/types/field-context.d.ts +3 -0
  100. package/types/field.d.ts +28 -0
  101. package/types/fieldset.d.ts +14 -0
  102. package/types/form.d.ts +7 -0
  103. package/types/hover-card.d.ts +10 -0
  104. package/types/hover-popup.d.ts +26 -0
  105. package/types/index.d.ts +24 -0
  106. package/types/meter.d.ts +9 -0
  107. package/types/popover.d.ts +28 -0
  108. package/types/progress.d.ts +9 -0
  109. package/types/radio-group.d.ts +28 -0
  110. package/types/runtime.d.ts +31 -0
  111. package/types/select.d.ts +50 -0
  112. package/types/separator.d.ts +6 -0
  113. package/types/slider.d.ts +24 -0
  114. package/types/switch.d.ts +20 -0
  115. package/types/tabs.d.ts +32 -0
  116. package/types/toggle.d.ts +10 -0
  117. package/types/tooltip.d.ts +10 -0
  118. package/types/value-bar.d.ts +17 -0
  119. package/README.md +0 -3
@@ -0,0 +1,28 @@
1
+ import type { ChangeDetails, PositionOptions, Signal } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ import type { PartComponentProps } from "./runtime.tsx";
4
+ export type RootProps = {
5
+ open?: boolean;
6
+ defaultOpen?: boolean;
7
+ onOpenChange?: (open: boolean, details: ChangeDetails) => void;
8
+ id?: string;
9
+ children?: JSX.Element;
10
+ };
11
+ declare function Root(props: RootProps): JSX.Element;
12
+ export type PositionerProps = PartComponentProps & Partial<PositionOptions>;
13
+ /** A positioner's own props, written where its placement reads them, before its element attaches. */
14
+ export declare function positioned<P extends PositionerProps>(props: P, positioning: Signal<Partial<PositionOptions>>): PartComponentProps;
15
+ declare function Positioner(props: PositionerProps): JSX.Element;
16
+ export declare const Popover: {
17
+ Root: typeof Root;
18
+ Portal: (props: {
19
+ children?: JSX.Element;
20
+ }) => JSX.Element;
21
+ Positioner: typeof Positioner;
22
+ Trigger: (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;
27
+ };
28
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare const Progress: {
2
+ Root: (props: import("./value-bar.tsx").RootProps) => import("solid-js").JSX.Element;
3
+ Value: (props: Omit<import("./runtime.tsx").PartComponentProps, "children"> & {
4
+ children?: (text: () => string | undefined) => import("solid-js").JSX.Element;
5
+ }) => import("solid-js").JSX.Element;
6
+ Track: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
7
+ Indicator: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
8
+ Label: (props: import("./runtime.tsx").PartComponentProps) => import("solid-js").JSX.Element;
9
+ };
@@ -0,0 +1,28 @@
1
+ import type { ChangeDetails } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ 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
+ disabled?: boolean;
9
+ readOnly?: boolean;
10
+ required?: boolean;
11
+ name?: string;
12
+ id?: string;
13
+ };
14
+ declare function Root(props: RootProps): JSX.Element;
15
+ declare function Item(props: PartComponentProps & {
16
+ value: unknown;
17
+ disabled?: boolean;
18
+ }): JSX.Element;
19
+ /** `keepMounted` keeps the mark in the page while its item is not the chosen one. */
20
+ declare function Indicator(props: PartComponentProps & {
21
+ keepMounted?: boolean;
22
+ }): JSX.Element;
23
+ export declare const RadioGroup: {
24
+ Root: typeof Root;
25
+ Item: typeof Item;
26
+ Indicator: typeof Indicator;
27
+ };
28
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { Part as CorePart, PartProps, ReadonlySignal } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ /** A core signal as a Solid accessor: tracked by whatever calls it. */
4
+ export declare function fromSignal<T>(source: ReadonlySignal<T>): () => T;
5
+ /** A core signal that follows Solid state: the core hears a changed prop before anything renders. */
6
+ export declare function toSignal<T extends Record<string, unknown>>(read: () => T): ReadonlySignal<T>;
7
+ /** A component's controller, made once, following its props. */
8
+ export declare function controller<P extends Record<string, unknown>, C extends {
9
+ mount(): () => void;
10
+ }>(create: (props: ReadonlySignal<P>) => C, read: () => P): C;
11
+ export type PartComponentProps = {
12
+ /** Renders the part as the caller's own element, which spreads the props it is given. */
13
+ render?: (props: () => PartProps) => JSX.Element;
14
+ /** Another tag for the part's element. */
15
+ as?: string;
16
+ children?: JSX.Element;
17
+ [attribute: string]: unknown;
18
+ };
19
+ /**
20
+ * A part's element (or the caller's, through `render`), with the caller's props merged under the
21
+ * part's and the part's DOM work attached once the element is in the page.
22
+ */
23
+ export declare function Part(props: PartComponentProps & {
24
+ part: CorePart;
25
+ tag: string;
26
+ }): JSX.Element;
27
+ /** Its children in a container at the end of the page, while `mounted`. */
28
+ export declare function Portal(props: {
29
+ mounted: ReadonlySignal<boolean>;
30
+ children?: JSX.Element;
31
+ }): JSX.Element;
@@ -0,0 +1,50 @@
1
+ import type { ChangeDetails } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ import type { PositionerProps } from "./popover.tsx";
4
+ 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
+ }[];
19
+ id?: string;
20
+ children?: JSX.Element;
21
+ };
22
+ declare function Root(props: RootProps): JSX.Element;
23
+ 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
+ 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 & {
30
+ value: unknown;
31
+ disabled?: boolean;
32
+ label?: string;
33
+ }): JSX.Element;
34
+ declare function ItemIndicator(props: PartComponentProps & {
35
+ keepMounted?: boolean;
36
+ }): JSX.Element;
37
+ export declare const Select: {
38
+ Root: typeof Root;
39
+ Portal: (props: {
40
+ children?: JSX.Element;
41
+ }) => JSX.Element;
42
+ Positioner: typeof Positioner;
43
+ Value: typeof Value;
44
+ Item: typeof Item;
45
+ ItemText: (props: PartComponentProps) => JSX.Element;
46
+ ItemIndicator: typeof ItemIndicator;
47
+ Trigger: (props: PartComponentProps) => JSX.Element;
48
+ Popup: (props: PartComponentProps) => JSX.Element;
49
+ };
50
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { Orientation } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ import type { PartComponentProps } from "./runtime.tsx";
4
+ export declare function Separator(props: PartComponentProps & {
5
+ orientation?: Orientation;
6
+ }): JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type { SliderProps } from "@kirana-ui/core/slider";
2
+ import type { JSX } from "solid-js";
3
+ import type { PartComponentProps } from "./runtime.tsx";
4
+ export type RootProps = PartComponentProps & Omit<SliderProps, "id"> & {
5
+ 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 & {
10
+ 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"> & {
14
+ children?: (text: () => string, values: () => readonly number[]) => JSX.Element;
15
+ }): JSX.Element;
16
+ export declare const Slider: {
17
+ Root: typeof Root;
18
+ Value: typeof Value;
19
+ Control: (props: PartComponentProps) => JSX.Element;
20
+ Track: (props: PartComponentProps) => JSX.Element;
21
+ Indicator: (props: PartComponentProps) => JSX.Element;
22
+ Thumb: typeof Thumb;
23
+ };
24
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { ChangeDetails } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ import type { PartComponentProps } from "./runtime.tsx";
4
+ export type RootProps = PartComponentProps & {
5
+ checked?: boolean;
6
+ defaultChecked?: boolean;
7
+ onCheckedChange?: (checked: boolean, details: ChangeDetails) => void;
8
+ disabled?: boolean;
9
+ readOnly?: boolean;
10
+ required?: boolean;
11
+ name?: string;
12
+ value?: string;
13
+ id?: string;
14
+ };
15
+ declare function Root(props: RootProps): JSX.Element;
16
+ export declare const Switch: {
17
+ Root: typeof Root;
18
+ Thumb: (props: PartComponentProps) => JSX.Element;
19
+ };
20
+ export {};
@@ -0,0 +1,32 @@
1
+ import type { ChangeDetails, Orientation } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ 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;
9
+ id?: string;
10
+ };
11
+ declare function Root(props: RootProps): JSX.Element;
12
+ declare function List(props: PartComponentProps & {
13
+ activateOnFocus?: boolean;
14
+ loop?: boolean;
15
+ }): JSX.Element;
16
+ declare function Tab(props: PartComponentProps & {
17
+ value: unknown;
18
+ 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 & {
22
+ value: unknown;
23
+ keepMounted?: boolean;
24
+ }): JSX.Element;
25
+ export declare const Tabs: {
26
+ Root: typeof Root;
27
+ List: typeof List;
28
+ Tab: typeof Tab;
29
+ Indicator: (props: PartComponentProps) => JSX.Element;
30
+ Panel: typeof Panel;
31
+ };
32
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ChangeDetails } from "@kirana-ui/core";
2
+ import type { JSX } from "solid-js";
3
+ import type { PartComponentProps } from "./runtime.tsx";
4
+ export type ToggleProps = PartComponentProps & {
5
+ pressed?: boolean;
6
+ defaultPressed?: boolean;
7
+ onPressedChange?: (pressed: boolean, details: ChangeDetails) => void;
8
+ disabled?: boolean;
9
+ };
10
+ export declare function Toggle(props: ToggleProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ export declare const Tooltip: {
2
+ 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;
10
+ };
@@ -0,0 +1,17 @@
1
+ import type { ReadonlySignal } from "@kirana-ui/core";
2
+ import type { ValueBar, ValueBarProps } from "@kirana-ui/core/progress";
3
+ import type { JSX } from "solid-js";
4
+ import type { PartComponentProps } from "./runtime.tsx";
5
+ export type RootProps = PartComponentProps & Omit<ValueBarProps, "id"> & {
6
+ id?: string;
7
+ };
8
+ /** 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;
17
+ };
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.