@wire-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 (78) hide show
  1. package/dist/components/aspect-ratio/AspectRatio.d.ts +4 -0
  2. package/dist/components/aspect-ratio/AspectRatio.types.d.ts +5 -0
  3. package/dist/components/aspect-ratio/index.d.ts +2 -0
  4. package/dist/components/breadcrumb/Breadcrumb.d.ts +15 -0
  5. package/dist/components/breadcrumb/Breadcrumb.types.d.ts +15 -0
  6. package/dist/components/breadcrumb/index.d.ts +2 -0
  7. package/dist/components/calendar/Calendar.d.ts +17 -0
  8. package/dist/components/calendar/Calendar.types.d.ts +69 -0
  9. package/dist/components/calendar/index.d.ts +2 -0
  10. package/dist/components/combobox/Combobox.d.ts +17 -0
  11. package/dist/components/combobox/Combobox.types.d.ts +65 -0
  12. package/dist/components/combobox/index.d.ts +2 -0
  13. package/dist/components/context-menu/ContextMenu.d.ts +15 -0
  14. package/dist/components/context-menu/ContextMenu.types.d.ts +27 -0
  15. package/dist/components/context-menu/index.d.ts +2 -0
  16. package/dist/components/date-picker/DatePicker.d.ts +19 -0
  17. package/dist/components/date-picker/DatePicker.types.d.ts +33 -0
  18. package/dist/components/date-picker/index.d.ts +2 -0
  19. package/dist/components/file-upload/FileUpload.d.ts +18 -0
  20. package/dist/components/file-upload/FileUpload.types.d.ts +41 -0
  21. package/dist/components/file-upload/index.d.ts +2 -0
  22. package/dist/components/form/Form.d.ts +17 -0
  23. package/dist/components/form/Form.types.d.ts +38 -0
  24. package/dist/components/form/index.d.ts +2 -0
  25. package/dist/components/index.d.ts +19 -0
  26. package/dist/components/menu-bar/MenuBar.d.ts +17 -0
  27. package/dist/components/menu-bar/MenuBar.types.d.ts +36 -0
  28. package/dist/components/menu-bar/index.d.ts +2 -0
  29. package/dist/components/navigation-menu/NavigationMenu.d.ts +17 -0
  30. package/dist/components/navigation-menu/NavigationMenu.types.d.ts +38 -0
  31. package/dist/components/navigation-menu/index.d.ts +2 -0
  32. package/dist/components/number-input/NumberInput.d.ts +11 -0
  33. package/dist/components/number-input/NumberInput.types.d.ts +37 -0
  34. package/dist/components/number-input/index.d.ts +2 -0
  35. package/dist/components/pagination/Pagination.d.ts +25 -0
  36. package/dist/components/pagination/Pagination.types.d.ts +39 -0
  37. package/dist/components/pagination/index.d.ts +2 -0
  38. package/dist/components/resizable-panels/ResizablePanels.d.ts +13 -0
  39. package/dist/components/resizable-panels/ResizablePanels.types.d.ts +28 -0
  40. package/dist/components/resizable-panels/index.d.ts +2 -0
  41. package/dist/components/skeleton/Skeleton.d.ts +3 -0
  42. package/dist/components/skeleton/Skeleton.types.d.ts +5 -0
  43. package/dist/components/skeleton/index.d.ts +2 -0
  44. package/dist/components/spinner/Spinner.d.ts +4 -0
  45. package/dist/components/spinner/Spinner.types.d.ts +7 -0
  46. package/dist/components/spinner/index.d.ts +2 -0
  47. package/dist/components/tag/Tag.d.ts +10 -0
  48. package/dist/components/tag/Tag.types.d.ts +10 -0
  49. package/dist/components/tag/index.d.ts +2 -0
  50. package/dist/components/tag-input/TagInput.d.ts +16 -0
  51. package/dist/components/tag-input/TagInput.types.d.ts +29 -0
  52. package/dist/components/tag-input/index.d.ts +2 -0
  53. package/dist/components/toast/Toast.d.ts +24 -0
  54. package/dist/components/toast/Toast.types.d.ts +36 -0
  55. package/dist/components/toast/index.d.ts +2 -0
  56. package/dist/components/tree-view/TreeView.d.ts +7 -0
  57. package/dist/components/tree-view/TreeView.types.d.ts +46 -0
  58. package/dist/components/tree-view/index.d.ts +2 -0
  59. package/dist/index.d.ts +23 -4
  60. package/dist/primitives/create-controllable-state.d.ts +26 -0
  61. package/dist/primitives/create-debounce.d.ts +19 -0
  62. package/dist/primitives/create-disclosure.d.ts +25 -0
  63. package/dist/primitives/create-floating.d.ts +43 -0
  64. package/dist/primitives/create-focus-trap.d.ts +24 -0
  65. package/dist/primitives/create-focus-visible.d.ts +21 -0
  66. package/dist/primitives/create-id.d.ts +11 -0
  67. package/dist/primitives/create-intersection-observer.d.ts +22 -0
  68. package/dist/primitives/create-keyboard.d.ts +41 -0
  69. package/dist/primitives/create-media-query.d.ts +10 -0
  70. package/dist/primitives/create-merged-refs.d.ts +17 -0
  71. package/dist/primitives/create-reduce-motion.d.ts +11 -0
  72. package/dist/primitives/create-resize-observer.d.ts +17 -0
  73. package/dist/primitives/create-scroll-lock.d.ts +14 -0
  74. package/dist/primitives/create-throttle.d.ts +20 -0
  75. package/dist/primitives/index.d.ts +23 -0
  76. package/dist/wire-ui-solid.cjs.js +1 -1
  77. package/dist/wire-ui-solid.es.js +4226 -721
  78. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { JSX } from 'solid-js';
2
+ import { NumberInputDecrementProps, NumberInputFieldProps, NumberInputIncrementProps, NumberInputRootProps } from './NumberInput.types';
3
+ declare function Root(props: NumberInputRootProps): JSX.Element;
4
+ declare function Field(props: NumberInputFieldProps): JSX.Element;
5
+ export declare const NumberInput: {
6
+ Root: typeof Root;
7
+ Field: typeof Field;
8
+ Increment: (props: NumberInputIncrementProps | NumberInputDecrementProps) => JSX.Element;
9
+ Decrement: (props: NumberInputIncrementProps | NumberInputDecrementProps) => JSX.Element;
10
+ };
11
+ export {};
@@ -0,0 +1,37 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface NumberInputRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
3
+ /** Controlled value. Use `null` to represent an empty input. */
4
+ value?: number | null;
5
+ /** Initial value (uncontrolled). */
6
+ defaultValue?: number | null;
7
+ /** Called when the value changes. */
8
+ onChange?: (value: number | null) => void;
9
+ /** Minimum allowed value. */
10
+ min?: number;
11
+ /** Maximum allowed value. */
12
+ max?: number;
13
+ /** Increment / decrement step. Defaults to 1. */
14
+ step?: number;
15
+ /** Decimal precision. Defaults to step's decimal count. */
16
+ precision?: number;
17
+ /** Disable input + buttons. */
18
+ disabled?: boolean;
19
+ /** Read-only field (buttons still disabled). */
20
+ readOnly?: boolean;
21
+ }
22
+ export type NumberInputFieldProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'type'>;
23
+ export type NumberInputIncrementProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
24
+ export type NumberInputDecrementProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
25
+ export interface NumberInputContextValue {
26
+ readonly value: number | null;
27
+ readonly min: number;
28
+ readonly max: number;
29
+ readonly step: number;
30
+ readonly precision: number;
31
+ readonly disabled: boolean;
32
+ readonly readOnly: boolean;
33
+ setValue: (value: number | null) => void;
34
+ increment: () => void;
35
+ decrement: () => void;
36
+ stepBy: (delta: number) => void;
37
+ }
@@ -0,0 +1,2 @@
1
+ export { NumberInput } from './NumberInput';
2
+ export type { NumberInputRootProps, NumberInputFieldProps, NumberInputIncrementProps, NumberInputDecrementProps, } from './NumberInput.types';
@@ -0,0 +1,25 @@
1
+ import { JSX } from 'solid-js';
2
+ import { PaginationButtonProps, PaginationEllipsisProps, PaginationItemProps, PaginationItemValue, PaginationListProps, PaginationRootProps } from './Pagination.types';
3
+ /**
4
+ * Build the list of items: a mix of page numbers and 'ellipsis' markers.
5
+ * Mirrors the MUI / shadcn behavior.
6
+ */
7
+ export declare function getPaginationItems(totalPages: number, page: number, siblingCount?: number, boundaryCount?: number): PaginationItemValue[];
8
+ declare function Root(props: PaginationRootProps): JSX.Element;
9
+ interface PaginationItemsProps {
10
+ children: (item: PaginationItemValue, index: number) => JSX.Element;
11
+ }
12
+ declare function Items(props: PaginationItemsProps): JSX.Element;
13
+ declare function List(props: PaginationListProps): JSX.Element;
14
+ declare function Item(props: PaginationItemProps): JSX.Element;
15
+ declare function Ellipsis(props: PaginationEllipsisProps): JSX.Element;
16
+ export declare const Pagination: {
17
+ Root: typeof Root;
18
+ List: typeof List;
19
+ Items: typeof Items;
20
+ Item: typeof Item;
21
+ Previous: (props: PaginationButtonProps) => JSX.Element;
22
+ Next: (props: PaginationButtonProps) => JSX.Element;
23
+ Ellipsis: typeof Ellipsis;
24
+ };
25
+ export {};
@@ -0,0 +1,39 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface PaginationRootProps extends Omit<JSX.HTMLAttributes<HTMLElement>, 'onChange'> {
3
+ /** Total number of pages (>= 1). */
4
+ totalPages: number;
5
+ /** Controlled current page (1-based). */
6
+ page?: number;
7
+ /** Initial page (1-based, uncontrolled). */
8
+ defaultPage?: number;
9
+ /** Called when the page changes. */
10
+ onChange?: (page: number) => void;
11
+ /** How many sibling pages to show on each side of the current page. Default 1. */
12
+ siblingCount?: number;
13
+ /** How many pages to always show at the start/end (boundary). Default 1. */
14
+ boundaryCount?: number;
15
+ }
16
+ export type PaginationListProps = JSX.HTMLAttributes<HTMLUListElement>;
17
+ export interface PaginationItemProps extends JSX.LiHTMLAttributes<HTMLLIElement> {
18
+ /** Page number (1-based). */
19
+ page: number;
20
+ /** Disable the button. */
21
+ disabled?: boolean;
22
+ }
23
+ export interface PaginationButtonProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
24
+ /** Disable the button. */
25
+ disabled?: boolean;
26
+ }
27
+ export type PaginationEllipsisProps = JSX.HTMLAttributes<HTMLLIElement>;
28
+ /** A page entry computed by the Pagination engine. `'ellipsis'` marks a gap. */
29
+ export type PaginationItemValue = number | 'ellipsis';
30
+ export interface PaginationContextValue {
31
+ readonly page: number;
32
+ readonly totalPages: number;
33
+ readonly items: PaginationItemValue[];
34
+ readonly canPrev: boolean;
35
+ readonly canNext: boolean;
36
+ goTo: (page: number) => void;
37
+ prev: () => void;
38
+ next: () => void;
39
+ }
@@ -0,0 +1,2 @@
1
+ export { Pagination, getPaginationItems } from './Pagination';
2
+ export type { PaginationRootProps, PaginationListProps, PaginationItemProps, PaginationButtonProps, PaginationEllipsisProps, PaginationItemValue, } from './Pagination.types';
@@ -0,0 +1,13 @@
1
+ import { JSX } from 'solid-js';
2
+ import { PanelGroupProps, PanelHandleProps, PanelProps } from './ResizablePanels.types';
3
+ declare function Group(props: PanelGroupProps): JSX.Element;
4
+ declare function Panel(props: PanelProps): JSX.Element;
5
+ declare function Handle(props: PanelHandleProps & {
6
+ 'aria-label'?: string;
7
+ }): JSX.Element;
8
+ export declare const ResizablePanels: {
9
+ Group: typeof Group;
10
+ Panel: typeof Panel;
11
+ Handle: typeof Handle;
12
+ };
13
+ export {};
@@ -0,0 +1,28 @@
1
+ import { JSX } from 'solid-js';
2
+ export type PanelOrientation = 'horizontal' | 'vertical';
3
+ export interface PanelGroupProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
+ orientation?: PanelOrientation;
5
+ /** Controlled sizes (percentages, summing to ~100). One per Panel. */
6
+ sizes?: number[];
7
+ /** Initial sizes (uncontrolled). */
8
+ defaultSizes?: number[];
9
+ /** Called whenever sizes change. */
10
+ onSizesChange?: (sizes: number[]) => void;
11
+ }
12
+ export interface PanelProps extends JSX.HTMLAttributes<HTMLDivElement> {
13
+ /** Default size in percent of the group. */
14
+ defaultSize?: number;
15
+ /** Minimum size in percent. */
16
+ minSize?: number;
17
+ /** Maximum size in percent. */
18
+ maxSize?: number;
19
+ }
20
+ export interface PanelHandleProps extends JSX.HTMLAttributes<HTMLDivElement> {
21
+ /** Disable resizing on this handle. */
22
+ disabled?: boolean;
23
+ }
24
+ export interface PanelConfig {
25
+ defaultSize?: number;
26
+ minSize?: number;
27
+ maxSize?: number;
28
+ }
@@ -0,0 +1,2 @@
1
+ export { ResizablePanels } from './ResizablePanels';
2
+ export type { PanelOrientation, PanelGroupProps, PanelProps, PanelHandleProps, PanelConfig, } from './ResizablePanels.types';
@@ -0,0 +1,3 @@
1
+ import { SkeletonProps } from './Skeleton.types';
2
+ declare function Skeleton(props: SkeletonProps): import("solid-js").JSX.Element;
3
+ export { Skeleton };
@@ -0,0 +1,5 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface SkeletonProps extends JSX.HTMLAttributes<HTMLDivElement> {
3
+ /** When false, render children instead of the skeleton (handy for conditional loading). */
4
+ loading?: boolean;
5
+ }
@@ -0,0 +1,2 @@
1
+ export { Skeleton } from './Skeleton';
2
+ export type { SkeletonProps } from './Skeleton.types';
@@ -0,0 +1,4 @@
1
+ import { JSX } from 'solid-js';
2
+ import { SpinnerProps } from './Spinner.types';
3
+ declare function Spinner(props: SpinnerProps): JSX.Element;
4
+ export { Spinner };
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface SpinnerProps extends JSX.HTMLAttributes<HTMLSpanElement> {
3
+ /** Accessible label announced to screen readers. Defaults to "Loading". */
4
+ label?: string;
5
+ /** Hides the visual element from screen readers (the label is still announced). Defaults to true. */
6
+ decorative?: boolean;
7
+ }
@@ -0,0 +1,2 @@
1
+ export { Spinner } from './Spinner';
2
+ export type { SpinnerProps } from './Spinner.types';
@@ -0,0 +1,10 @@
1
+ import { TagLabelProps, TagRemoveProps, TagRootProps } from './Tag.types';
2
+ declare function Root(props: TagRootProps): import("solid-js").JSX.Element;
3
+ declare function Label(props: TagLabelProps): import("solid-js").JSX.Element;
4
+ declare function Remove(props: TagRemoveProps): import("solid-js").JSX.Element;
5
+ export declare const Tag: {
6
+ Root: typeof Root;
7
+ Label: typeof Label;
8
+ Remove: typeof Remove;
9
+ };
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface TagRootProps extends JSX.HTMLAttributes<HTMLSpanElement> {
3
+ /** Disabled state: removes interaction and applies data-disabled. */
4
+ disabled?: boolean;
5
+ }
6
+ export type TagLabelProps = JSX.HTMLAttributes<HTMLSpanElement>;
7
+ export interface TagRemoveProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
8
+ /** Accessible label for the remove button. Defaults to "Remove". */
9
+ 'aria-label'?: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ export { Tag } from './Tag';
2
+ export type { TagRootProps, TagLabelProps, TagRemoveProps } from './Tag.types';
@@ -0,0 +1,16 @@
1
+ import { JSX } from 'solid-js';
2
+ import { TagInputFieldProps, TagInputListProps, TagInputRootProps } from './TagInput.types';
3
+ declare function Root(props: TagInputRootProps): JSX.Element;
4
+ interface TagInputItemsProps {
5
+ children: (tag: string, index: number, remove: () => void) => JSX.Element;
6
+ }
7
+ declare function Items(props: TagInputItemsProps): JSX.Element;
8
+ declare function List(props: TagInputListProps): JSX.Element;
9
+ declare function Field(props: TagInputFieldProps): JSX.Element;
10
+ export declare const TagInput: {
11
+ Root: typeof Root;
12
+ List: typeof List;
13
+ Items: typeof Items;
14
+ Field: typeof Field;
15
+ };
16
+ export {};
@@ -0,0 +1,29 @@
1
+ import { JSX } from 'solid-js';
2
+ export interface TagInputRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
3
+ /** Controlled list of tags. */
4
+ value?: string[];
5
+ /** Initial list (uncontrolled). */
6
+ defaultValue?: string[];
7
+ /** Called when tags are added or removed. */
8
+ onChange?: (value: string[]) => void;
9
+ /** Disable input + remove buttons. */
10
+ disabled?: boolean;
11
+ /** Maximum number of tags. */
12
+ maxTags?: number;
13
+ /** Reject duplicate values (case-sensitive). Defaults to true. */
14
+ allowDuplicates?: boolean;
15
+ /** Characters that commit the current input as a tag. Defaults to ['Enter', ',']. */
16
+ commitKeys?: string[];
17
+ /** Optional validator — return false to reject the tag. */
18
+ validate?: (tag: string, current: string[]) => boolean;
19
+ }
20
+ export type TagInputListProps = JSX.HTMLAttributes<HTMLDivElement>;
21
+ export type TagInputFieldProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange'>;
22
+ export interface TagInputContextValue {
23
+ readonly tags: string[];
24
+ readonly disabled: boolean;
25
+ readonly maxTags?: number;
26
+ addTag: (raw: string) => boolean;
27
+ removeTag: (index: number) => void;
28
+ readonly commitKeys: string[];
29
+ }
@@ -0,0 +1,2 @@
1
+ export { TagInput } from './TagInput';
2
+ export type { TagInputRootProps, TagInputListProps, TagInputFieldProps } from './TagInput.types';
@@ -0,0 +1,24 @@
1
+ import { JSX } from 'solid-js';
2
+ import { ToastCloseProps, ToastData, ToastDescriptionProps, ToastProviderProps, ToastRootProps, ToastStatus, ToastTitleProps, ToastViewportProps } from './Toast.types';
3
+ export declare function useToast(): {
4
+ toast: (toast: Omit<ToastData, "id"> & {
5
+ id?: string;
6
+ }) => string;
7
+ dismiss: (id: string) => void;
8
+ readonly toasts: ToastData<Record<string, unknown>>[];
9
+ };
10
+ declare function Provider(props: ToastProviderProps): JSX.Element;
11
+ declare function Viewport(props: ToastViewportProps): JSX.Element;
12
+ declare function Root(props: ToastRootProps): JSX.Element;
13
+ declare function Title(props: ToastTitleProps): JSX.Element;
14
+ declare function Description(props: ToastDescriptionProps): JSX.Element;
15
+ declare function Close(props: ToastCloseProps): JSX.Element;
16
+ export declare const Toast: {
17
+ Provider: typeof Provider;
18
+ Viewport: typeof Viewport;
19
+ Root: typeof Root;
20
+ Title: typeof Title;
21
+ Description: typeof Description;
22
+ Close: typeof Close;
23
+ };
24
+ export type { ToastStatus, ToastData };
@@ -0,0 +1,36 @@
1
+ import { JSX } from 'solid-js';
2
+ export type ToastStatus = 'default' | 'success' | 'warning' | 'danger' | 'info';
3
+ /** A single toast in the queue. Consumers can extend with arbitrary fields via the generic. */
4
+ export interface ToastData<T extends Record<string, unknown> = Record<string, unknown>> {
5
+ id: string;
6
+ title?: JSX.Element;
7
+ description?: JSX.Element;
8
+ status?: ToastStatus;
9
+ /** Auto-dismiss timeout in ms. 0 or negative = persistent. Defaults to 5000. */
10
+ duration?: number;
11
+ /** Pause auto-dismiss while pointer is over the toast. Defaults to true. */
12
+ pauseOnHover?: boolean;
13
+ /** Custom data passed through to the consumer's render-prop. */
14
+ data?: T;
15
+ }
16
+ export interface ToastProviderProps {
17
+ children?: JSX.Element;
18
+ /** Default duration applied to toasts that don't specify one. */
19
+ defaultDuration?: number;
20
+ }
21
+ export interface ToastViewportProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'> {
22
+ /** Render-prop receiving each toast and a dismiss callback. */
23
+ children: (toast: ToastData, dismiss: () => void) => JSX.Element;
24
+ }
25
+ export type ToastRootProps = JSX.HTMLAttributes<HTMLDivElement>;
26
+ export type ToastTitleProps = JSX.HTMLAttributes<HTMLDivElement>;
27
+ export type ToastDescriptionProps = JSX.HTMLAttributes<HTMLDivElement>;
28
+ export type ToastCloseProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
29
+ export interface ToastContextValue {
30
+ readonly toasts: ToastData[];
31
+ add: (toast: Omit<ToastData, 'id'> & {
32
+ id?: string;
33
+ }) => string;
34
+ dismiss: (id: string) => void;
35
+ readonly defaultDuration: number;
36
+ }
@@ -0,0 +1,2 @@
1
+ export { Toast, useToast } from './Toast';
2
+ export type { ToastStatus, ToastData, ToastProviderProps, ToastViewportProps, ToastRootProps, ToastTitleProps, ToastDescriptionProps, ToastCloseProps, } from './Toast.types';
@@ -0,0 +1,7 @@
1
+ import { JSX } from 'solid-js';
2
+ import { TreeViewRootProps } from './TreeView.types';
3
+ declare function Root(props: TreeViewRootProps): JSX.Element;
4
+ export declare const TreeView: {
5
+ Root: typeof Root;
6
+ };
7
+ export {};
@@ -0,0 +1,46 @@
1
+ import { JSX } from 'solid-js';
2
+ /** Node descriptor — the consumer's data; passed through to renderers. */
3
+ export interface TreeNode<T = unknown> {
4
+ id: string;
5
+ label?: JSX.Element;
6
+ children?: TreeNode<T>[];
7
+ disabled?: boolean;
8
+ data?: T;
9
+ }
10
+ export type TreeSelectionMode = 'none' | 'single' | 'multiple';
11
+ export interface TreeViewRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'onSelectionChange'> {
12
+ /** Tree data. */
13
+ nodes: TreeNode[];
14
+ /** Controlled expanded ids. */
15
+ expanded?: string[];
16
+ /** Initial expanded ids (uncontrolled). */
17
+ defaultExpanded?: string[];
18
+ /** Called when the expanded set changes. */
19
+ onExpandedChange?: (expanded: string[]) => void;
20
+ /** Selection behavior. */
21
+ selectionMode?: TreeSelectionMode;
22
+ /** Controlled selection. */
23
+ selected?: string[];
24
+ /** Initial selection (uncontrolled). */
25
+ defaultSelected?: string[];
26
+ /** Called when selection changes. */
27
+ onSelectionChange?: (selected: string[]) => void;
28
+ /** Render-prop: receives a node + its render-state for each visible row. */
29
+ renderItem: (node: TreeNode, state: TreeItemState) => JSX.Element;
30
+ }
31
+ export interface TreeItemState {
32
+ level: number;
33
+ expanded: boolean;
34
+ selected: boolean;
35
+ hasChildren: boolean;
36
+ disabled: boolean;
37
+ toggle: () => void;
38
+ select: () => void;
39
+ }
40
+ export interface TreeViewContextValue {
41
+ readonly expanded: Set<string>;
42
+ readonly selected: Set<string>;
43
+ readonly selectionMode: TreeSelectionMode;
44
+ toggleExpanded: (id: string) => void;
45
+ selectNode: (id: string) => void;
46
+ }
@@ -0,0 +1,2 @@
1
+ export { TreeView } from './TreeView';
2
+ export type { TreeNode, TreeSelectionMode, TreeItemState, TreeViewRootProps, } from './TreeView.types';
package/dist/index.d.ts CHANGED
@@ -1,31 +1,50 @@
1
- export { Accordion, Alert, Avatar, Badge, Button, Card, Checkbox, Divider, Drawer, Dropdown, Icon, Image, Input, List, Modal, OTP, Password, ProgressBar, Radio, Rating, Search, Select, Switch, Textarea, Timeago, Tooltip, } from './components';
1
+ export { Accordion, Alert, AspectRatio, Avatar, Badge, Breadcrumb, Button, Calendar, Card, Checkbox, Combobox, ContextMenu, DatePicker, Divider, Drawer, Dropdown, FileUpload, Form, Icon, Image, Input, List, MenuBar, Modal, NavigationMenu, NumberInput, OTP, Pagination, getPaginationItems, Password, ProgressBar, Radio, Rating, ResizablePanels, Search, Select, Skeleton, Spinner, Switch, Tag, TagInput, Textarea, Timeago, Toast, useToast, Tooltip, TreeView, } from './components';
2
2
  export { iconNames, iconSizes } from './components/icon';
3
- export { createClickOutside, createInteractiveState } from './primitives';
4
- export type { InteractiveStateOptions, InteractiveStateResult } from './primitives';
3
+ export { createClickOutside, createControllableState, createDebounce, createDebouncedCallback, createDisclosure, createFloating, createFocusTrap, createFocusVisible, createId, createIntersectionObserver, createInteractiveState, createKeyboard, createMediaQuery, createMergedRefs, createReduceMotion, createResizeObserver, createScrollLock, createThrottle, createThrottledCallback, } from './primitives';
4
+ export type { CreateControllableStateOptions, CreateDisclosureOptions, CreateDisclosureResult, CreateFloatingOptions, CreateFloatingResult, FloatingSide, FloatingAlign, FloatingStrategy, CreateFocusTrapOptions, CreateFocusVisibleResult, CreateIntersectionObserverOptions, InteractiveStateOptions, InteractiveStateResult, KeyboardMap, KeyHandler, KeyboardHandlerOptions, CreateKeyboardOptions, ElementSize, } from './primitives';
5
5
  export type { Size, Status, HorizontalPosition, BaseFormFieldProps, BaseOption } from './types';
6
6
  export type { AccordionRootProps, AccordionRootSingleProps, AccordionRootMultipleProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps, } from './components/accordion';
7
7
  export type { AlertRootProps, AlertTitleProps, AlertDescriptionProps, AlertDismissProps } from './components/alert';
8
- export type { AvatarRootProps, AvatarImageProps, AvatarFallbackProps, AvatarImageStatus, } from './components/avatar';
8
+ export type { AspectRatioProps } from './components/aspect-ratio';
9
+ export type { AvatarRootProps, AvatarImageProps, AvatarFallbackProps, AvatarImageStatus } from './components/avatar';
9
10
  export type { BadgeProps } from './components/badge';
11
+ export type { BreadcrumbRootProps, BreadcrumbListProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbSeparatorProps, } from './components/breadcrumb';
10
12
  export type { ButtonProps } from './components/button';
13
+ export type { WeekStart, CalendarRootProps, CalendarNavProps, CalendarPrevButtonProps, CalendarNextButtonProps, CalendarTitleProps, CalendarGridProps, CalendarDay, } from './components/calendar';
11
14
  export type { CardProps } from './components/card';
12
15
  export type { CheckboxRootProps, CheckboxItemProps, CheckboxIndicatorProps, CheckboxLabelProps, } from './components/checkbox';
16
+ export type { ComboboxOption, ComboboxRootProps, ComboboxInputProps, ComboboxTriggerProps, ComboboxContentProps, ComboboxEmptyProps, ComboboxItemRenderProps, ComboboxItemsProps, } from './components/combobox';
17
+ export type { ContextMenuRootProps, ContextMenuTriggerProps, ContextMenuContentProps, ContextMenuItemProps, ContextMenuSeparatorProps, } from './components/context-menu';
18
+ export type { DatePickerRootProps, DatePickerTriggerProps, DatePickerValueProps, DatePickerContentProps, } from './components/date-picker';
13
19
  export type { DividerProps } from './components/divider';
14
20
  export type { DrawerRootProps, DrawerPortalProps, DrawerOverlayProps, DrawerContentProps, DrawerHeaderProps, DrawerCloseProps, } from './components/drawer';
15
21
  export type { DropdownRootProps, DropdownTriggerProps, DropdownMenuProps, DropdownPosition, } from './components/dropdown';
22
+ export type { FileUploadRootProps, FileUploadInputProps, FileUploadTriggerProps, FileUploadDropzoneProps, } from './components/file-upload';
23
+ export type { FormRootProps, FormFieldProps, FormLabelProps, FormControlProps, FormDescriptionProps, FormErrorProps, } from './components/form';
16
24
  export type { IconName, IconSize, IconProps } from './components/icon';
17
25
  export type { ImageProps } from './components/image';
18
26
  export type { InputRootProps, InputFieldProps, InputLabelProps, InputErrorProps } from './components/input';
19
27
  export type { ListProps } from './components/list';
28
+ export type { MenuBarRootProps, MenuBarMenuProps, MenuBarTriggerProps, MenuBarContentProps, MenuBarItemProps, MenuBarSeparatorProps, } from './components/menu-bar';
20
29
  export type { ModalRootProps, ModalPortalProps, ModalOverlayProps, ModalContentProps, ModalCloseProps, } from './components/modal';
30
+ export type { NavigationMenuRootProps, NavigationMenuListProps, NavigationMenuItemProps, NavigationMenuTriggerProps, NavigationMenuContentProps, NavigationMenuLinkProps, } from './components/navigation-menu';
31
+ export type { NumberInputRootProps, NumberInputFieldProps, NumberInputIncrementProps, NumberInputDecrementProps, } from './components/number-input';
21
32
  export type { OTPRootProps, OTPSlotProps, OTPSeparatorProps } from './components/otp';
33
+ export type { PaginationRootProps, PaginationListProps, PaginationItemProps, PaginationButtonProps, PaginationEllipsisProps, PaginationItemValue, } from './components/pagination';
22
34
  export type { PasswordRootProps, PasswordFieldProps, PasswordToggleProps, PasswordLabelProps, PasswordErrorProps, } from './components/password';
23
35
  export type { ProgressBarProps } from './components/progress-bar';
24
36
  export type { RadioRootProps, RadioItemProps, RadioIndicatorProps, RadioLabelProps } from './components/radio';
25
37
  export type { RatingProps } from './components/rating';
38
+ export type { PanelOrientation, PanelGroupProps, PanelProps, PanelHandleProps, PanelConfig, } from './components/resizable-panels';
26
39
  export type { SearchRootProps, SearchInputProps, SearchContentProps, SearchItemProps, SearchEmptyProps, SearchOption, } from './components/search';
27
40
  export type { SelectRootProps, SelectTriggerProps, SelectValueProps, SelectContentProps, SelectItemProps, SelectSeparatorProps, SelectGroupProps, SelectGroupLabelProps, } from './components/select';
41
+ export type { SkeletonProps } from './components/skeleton';
42
+ export type { SpinnerProps } from './components/spinner';
28
43
  export type { SwitchRootProps, SwitchThumbProps } from './components/switch';
44
+ export type { TagRootProps, TagLabelProps, TagRemoveProps } from './components/tag';
45
+ export type { TagInputRootProps, TagInputListProps, TagInputFieldProps } from './components/tag-input';
29
46
  export type { TextareaRootProps, TextareaFieldProps, TextareaLabelProps, TextareaErrorProps, } from './components/textarea';
30
47
  export type { TimeagoProps, TimeagoFormatConfig, TimeagoPlural } from './components/timeago';
48
+ export type { ToastStatus, ToastData, ToastProviderProps, ToastViewportProps, ToastRootProps, ToastTitleProps, ToastDescriptionProps, ToastCloseProps, } from './components/toast';
31
49
  export type { TooltipRootProps, TooltipTriggerProps, TooltipContentProps } from './components/tooltip';
50
+ export type { TreeNode, TreeSelectionMode, TreeItemState, TreeViewRootProps } from './components/tree-view';
@@ -0,0 +1,26 @@
1
+ export interface CreateControllableStateOptions<T> {
2
+ /** Controlled value — when provided, state is owned by the parent */
3
+ value?: T;
4
+ /** Initial value when uncontrolled */
5
+ defaultValue?: T;
6
+ /** Called when the value changes (in both controlled and uncontrolled modes) */
7
+ onChange?: (value: T) => void;
8
+ }
9
+ type ControllableSetter<T> = (next: T | undefined | ((prev: T | undefined) => T | undefined)) => void;
10
+ /**
11
+ * Unified state for components that can be controlled or uncontrolled.
12
+ *
13
+ * - If `value` is provided on `options`, the state is controlled — the setter only fires `onChange`.
14
+ * - If `value` is undefined, the state is uncontrolled — the setter updates internal state and fires `onChange`.
15
+ *
16
+ * Pass `options` as a plain object or with getters to make `value` reactive:
17
+ * `{ get value() { return props.value; }, onChange: props.onValueChange }`
18
+ *
19
+ * @example
20
+ * const [open, setOpen] = createControllableState({ get value() { return props.open }, defaultValue: false, onChange: props.onOpenChange })
21
+ */
22
+ export declare function createControllableState<T>(options: CreateControllableStateOptions<T> & {
23
+ defaultValue: T;
24
+ }): [() => T, ControllableSetter<T>];
25
+ export declare function createControllableState<T>(options: CreateControllableStateOptions<T>): [() => T | undefined, ControllableSetter<T | undefined>];
26
+ export {};
@@ -0,0 +1,19 @@
1
+ import { Accessor } from 'solid-js';
2
+ /**
3
+ * Returns a reactive value debounced — only updates after `delay` ms have passed without a change.
4
+ *
5
+ * Pass the input as an accessor so Solid can track changes reactively.
6
+ *
7
+ * @example
8
+ * const debouncedQuery = createDebounce(() => query(), 250)
9
+ * createEffect(() => { search(debouncedQuery()) })
10
+ */
11
+ export declare function createDebounce<T>(value: Accessor<T>, delay: number): Accessor<T>;
12
+ /**
13
+ * Returns a stable, debounced callback that fires `delay` ms after the most recent invocation.
14
+ * Always calls the latest `callback` reference, so closure-captured values stay fresh.
15
+ *
16
+ * @example
17
+ * const debouncedSave = createDebouncedCallback((value: string) => save(value), 500)
18
+ */
19
+ export declare function createDebouncedCallback<Args extends unknown[]>(callback: (...args: Args) => void, delay: number): (...args: Args) => void;
@@ -0,0 +1,25 @@
1
+ import { Accessor } from 'solid-js';
2
+ export interface CreateDisclosureOptions {
3
+ /** Initial open state */
4
+ defaultOpen?: boolean;
5
+ /** Called whenever the open state changes */
6
+ onOpenChange?: (open: boolean) => void;
7
+ }
8
+ export interface CreateDisclosureResult {
9
+ /** Reactive accessor for the current open state */
10
+ isOpen: Accessor<boolean>;
11
+ open: () => void;
12
+ close: () => void;
13
+ toggle: () => void;
14
+ setOpen: (value: boolean) => void;
15
+ }
16
+ /**
17
+ * Manages a boolean open/close state with stable open/close/toggle handlers.
18
+ *
19
+ * Use this for modals, drawers, dropdowns, accordions — anything with a binary
20
+ * open state that doesn't need to be controlled from the outside.
21
+ *
22
+ * @example
23
+ * const { isOpen, open, close, toggle } = createDisclosure({ defaultOpen: false })
24
+ */
25
+ export declare function createDisclosure(options?: CreateDisclosureOptions): CreateDisclosureResult;
@@ -0,0 +1,43 @@
1
+ import { Accessor, JSX } from 'solid-js';
2
+ export type FloatingSide = 'top' | 'right' | 'bottom' | 'left';
3
+ export type FloatingAlign = 'start' | 'center' | 'end';
4
+ export type FloatingStrategy = 'absolute' | 'fixed';
5
+ export interface CreateFloatingOptions {
6
+ /** Whether the floating element is open (positioning only runs when open) */
7
+ open?: boolean;
8
+ /** Preferred side relative to the reference element */
9
+ side?: FloatingSide;
10
+ /** Alignment along the chosen side */
11
+ align?: FloatingAlign;
12
+ /** Gap in pixels between reference and floating element */
13
+ offset?: number;
14
+ /** Positioning strategy — `fixed` is safer inside transformed/clipping ancestors */
15
+ strategy?: FloatingStrategy;
16
+ /** Flip to the opposite side when there isn't enough room */
17
+ flip?: boolean;
18
+ /** Shift the floating element along its main axis to stay in the viewport */
19
+ shift?: boolean;
20
+ }
21
+ export interface CreateFloatingResult {
22
+ x: Accessor<number>;
23
+ y: Accessor<number>;
24
+ side: Accessor<FloatingSide>;
25
+ align: Accessor<FloatingAlign>;
26
+ strategy: FloatingStrategy;
27
+ floatingStyles: () => JSX.CSSProperties;
28
+ update: () => void;
29
+ }
30
+ /**
31
+ * Positions a floating element relative to a reference element.
32
+ *
33
+ * Lightweight, zero-dependency positioning for tooltips, popovers, dropdowns, and similar UI.
34
+ * Recomputes on scroll and resize while open. Pass element accessors so Solid can track
35
+ * ref changes reactively.
36
+ *
37
+ * @example
38
+ * let referenceEl: HTMLButtonElement | undefined;
39
+ * let floatingEl: HTMLDivElement | undefined;
40
+ * const { floatingStyles, side } = createFloating(() => referenceEl, () => floatingEl, { get open() { return isOpen() }, side: 'bottom' })
41
+ * return <div ref={floatingEl} style={floatingStyles()} data-side={side()}>...</div>
42
+ */
43
+ export declare function createFloating<R extends HTMLElement, F extends HTMLElement>(referenceRef: Accessor<R | null | undefined>, floatingRef: Accessor<F | null | undefined>, options?: CreateFloatingOptions): CreateFloatingResult;
@@ -0,0 +1,24 @@
1
+ import { Accessor } from 'solid-js';
2
+ export interface CreateFocusTrapOptions {
3
+ /** Whether the trap is active */
4
+ active?: boolean;
5
+ /** Restore focus to the previously focused element when the trap deactivates */
6
+ returnFocus?: boolean;
7
+ /** Element to focus initially. Defaults to the first focusable child. */
8
+ initialFocus?: Accessor<HTMLElement | null | undefined> | HTMLElement | null | undefined;
9
+ }
10
+ /**
11
+ * Traps keyboard focus inside the given container while active.
12
+ *
13
+ * Cycles Tab / Shift+Tab between the first and last focusable descendants. On activation,
14
+ * focus moves to `initialFocus` (or the first focusable child). On deactivation, focus
15
+ * returns to whatever was focused before, unless `returnFocus` is false.
16
+ *
17
+ * Pass `options` as a plain object or with getters to make `active` reactive:
18
+ * `{ get active() { return isOpen() } }`
19
+ *
20
+ * @example
21
+ * let dialogEl: HTMLDivElement | undefined;
22
+ * createFocusTrap(() => dialogEl, { get active() { return isOpen() } })
23
+ */
24
+ export declare function createFocusTrap(containerRef: Accessor<HTMLElement | null | undefined>, options?: CreateFocusTrapOptions): void;