@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.
- package/dist/components/aspect-ratio/AspectRatio.d.ts +4 -0
- package/dist/components/aspect-ratio/AspectRatio.types.d.ts +5 -0
- package/dist/components/aspect-ratio/index.d.ts +2 -0
- package/dist/components/breadcrumb/Breadcrumb.d.ts +15 -0
- package/dist/components/breadcrumb/Breadcrumb.types.d.ts +15 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/calendar/Calendar.d.ts +17 -0
- package/dist/components/calendar/Calendar.types.d.ts +69 -0
- package/dist/components/calendar/index.d.ts +2 -0
- package/dist/components/combobox/Combobox.d.ts +17 -0
- package/dist/components/combobox/Combobox.types.d.ts +65 -0
- package/dist/components/combobox/index.d.ts +2 -0
- package/dist/components/context-menu/ContextMenu.d.ts +15 -0
- package/dist/components/context-menu/ContextMenu.types.d.ts +27 -0
- package/dist/components/context-menu/index.d.ts +2 -0
- package/dist/components/date-picker/DatePicker.d.ts +19 -0
- package/dist/components/date-picker/DatePicker.types.d.ts +33 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/file-upload/FileUpload.d.ts +18 -0
- package/dist/components/file-upload/FileUpload.types.d.ts +41 -0
- package/dist/components/file-upload/index.d.ts +2 -0
- package/dist/components/form/Form.d.ts +17 -0
- package/dist/components/form/Form.types.d.ts +38 -0
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/index.d.ts +19 -0
- package/dist/components/menu-bar/MenuBar.d.ts +17 -0
- package/dist/components/menu-bar/MenuBar.types.d.ts +36 -0
- package/dist/components/menu-bar/index.d.ts +2 -0
- package/dist/components/navigation-menu/NavigationMenu.d.ts +17 -0
- package/dist/components/navigation-menu/NavigationMenu.types.d.ts +38 -0
- package/dist/components/navigation-menu/index.d.ts +2 -0
- package/dist/components/number-input/NumberInput.d.ts +11 -0
- package/dist/components/number-input/NumberInput.types.d.ts +37 -0
- package/dist/components/number-input/index.d.ts +2 -0
- package/dist/components/pagination/Pagination.d.ts +25 -0
- package/dist/components/pagination/Pagination.types.d.ts +39 -0
- package/dist/components/pagination/index.d.ts +2 -0
- package/dist/components/resizable-panels/ResizablePanels.d.ts +13 -0
- package/dist/components/resizable-panels/ResizablePanels.types.d.ts +28 -0
- package/dist/components/resizable-panels/index.d.ts +2 -0
- package/dist/components/skeleton/Skeleton.d.ts +3 -0
- package/dist/components/skeleton/Skeleton.types.d.ts +5 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/spinner/Spinner.d.ts +4 -0
- package/dist/components/spinner/Spinner.types.d.ts +7 -0
- package/dist/components/spinner/index.d.ts +2 -0
- package/dist/components/tag/Tag.d.ts +10 -0
- package/dist/components/tag/Tag.types.d.ts +10 -0
- package/dist/components/tag/index.d.ts +2 -0
- package/dist/components/tag-input/TagInput.d.ts +16 -0
- package/dist/components/tag-input/TagInput.types.d.ts +29 -0
- package/dist/components/tag-input/index.d.ts +2 -0
- package/dist/components/toast/Toast.d.ts +24 -0
- package/dist/components/toast/Toast.types.d.ts +36 -0
- package/dist/components/toast/index.d.ts +2 -0
- package/dist/components/tree-view/TreeView.d.ts +7 -0
- package/dist/components/tree-view/TreeView.types.d.ts +46 -0
- package/dist/components/tree-view/index.d.ts +2 -0
- package/dist/index.d.ts +23 -4
- package/dist/primitives/create-controllable-state.d.ts +26 -0
- package/dist/primitives/create-debounce.d.ts +19 -0
- package/dist/primitives/create-disclosure.d.ts +25 -0
- package/dist/primitives/create-floating.d.ts +43 -0
- package/dist/primitives/create-focus-trap.d.ts +24 -0
- package/dist/primitives/create-focus-visible.d.ts +21 -0
- package/dist/primitives/create-id.d.ts +11 -0
- package/dist/primitives/create-intersection-observer.d.ts +22 -0
- package/dist/primitives/create-keyboard.d.ts +41 -0
- package/dist/primitives/create-media-query.d.ts +10 -0
- package/dist/primitives/create-merged-refs.d.ts +17 -0
- package/dist/primitives/create-reduce-motion.d.ts +11 -0
- package/dist/primitives/create-resize-observer.d.ts +17 -0
- package/dist/primitives/create-scroll-lock.d.ts +14 -0
- package/dist/primitives/create-throttle.d.ts +20 -0
- package/dist/primitives/index.d.ts +23 -0
- package/dist/wire-ui-solid.cjs.js +1 -1
- package/dist/wire-ui-solid.es.js +4226 -721
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbListProps, BreadcrumbRootProps, BreadcrumbSeparatorProps } from './Breadcrumb.types';
|
|
3
|
+
declare function Root(props: BreadcrumbRootProps): JSX.Element;
|
|
4
|
+
declare function List(props: BreadcrumbListProps): JSX.Element;
|
|
5
|
+
declare function Item(props: BreadcrumbItemProps): JSX.Element;
|
|
6
|
+
declare function Link(props: BreadcrumbLinkProps): JSX.Element;
|
|
7
|
+
declare function Separator(props: BreadcrumbSeparatorProps): JSX.Element;
|
|
8
|
+
export declare const Breadcrumb: {
|
|
9
|
+
Root: typeof Root;
|
|
10
|
+
List: typeof List;
|
|
11
|
+
Item: typeof Item;
|
|
12
|
+
Link: typeof Link;
|
|
13
|
+
Separator: typeof Separator;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface BreadcrumbRootProps extends JSX.HTMLAttributes<HTMLElement> {
|
|
3
|
+
/** Accessible label for the navigation landmark. Defaults to "Breadcrumb". */
|
|
4
|
+
'aria-label'?: string;
|
|
5
|
+
}
|
|
6
|
+
export type BreadcrumbListProps = JSX.OlHTMLAttributes<HTMLOListElement>;
|
|
7
|
+
export interface BreadcrumbItemProps extends JSX.LiHTMLAttributes<HTMLLIElement> {
|
|
8
|
+
/** Marks this item as the current page (sets aria-current and data-current). */
|
|
9
|
+
current?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface BreadcrumbLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
12
|
+
/** Render the child element instead of `<a>` (Solid: applies attributes via DOM API). */
|
|
13
|
+
asChild?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type BreadcrumbSeparatorProps = JSX.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CalendarGridProps, CalendarNavProps, CalendarNextButtonProps, CalendarPrevButtonProps, CalendarRootProps, CalendarTitleProps } from './Calendar.types';
|
|
3
|
+
declare function Root(props: CalendarRootProps): JSX.Element;
|
|
4
|
+
declare function Nav(props: CalendarNavProps): JSX.Element;
|
|
5
|
+
declare function PrevButton(props: CalendarPrevButtonProps): JSX.Element;
|
|
6
|
+
declare function NextButton(props: CalendarNextButtonProps): JSX.Element;
|
|
7
|
+
declare function Title(props: CalendarTitleProps): JSX.Element;
|
|
8
|
+
declare function Grid(props: CalendarGridProps): JSX.Element;
|
|
9
|
+
export declare const Calendar: {
|
|
10
|
+
Root: typeof Root;
|
|
11
|
+
Nav: typeof Nav;
|
|
12
|
+
PrevButton: typeof PrevButton;
|
|
13
|
+
NextButton: typeof NextButton;
|
|
14
|
+
Title: typeof Title;
|
|
15
|
+
Grid: typeof Grid;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type WeekStart = 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
3
|
+
export interface CalendarRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
4
|
+
/** Controlled selected date. Use null for empty. */
|
|
5
|
+
value?: Date | null;
|
|
6
|
+
/** Initial selected date (uncontrolled). */
|
|
7
|
+
defaultValue?: Date | null;
|
|
8
|
+
/** Called when the selection changes. */
|
|
9
|
+
onChange?: (date: Date | null) => void;
|
|
10
|
+
/** Initial month displayed (uncontrolled). Defaults to today. */
|
|
11
|
+
defaultMonth?: Date;
|
|
12
|
+
/** Controlled month displayed. */
|
|
13
|
+
month?: Date;
|
|
14
|
+
/** Called when the visible month changes. */
|
|
15
|
+
onMonthChange?: (month: Date) => void;
|
|
16
|
+
/** Earliest selectable date. */
|
|
17
|
+
minDate?: Date;
|
|
18
|
+
/** Latest selectable date. */
|
|
19
|
+
maxDate?: Date;
|
|
20
|
+
/** Custom predicate to disable specific dates. */
|
|
21
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
22
|
+
/** First day of the week. 0 = Sunday, 1 = Monday, ... Default 0. */
|
|
23
|
+
weekStartsOn?: WeekStart;
|
|
24
|
+
/** Locale for month/weekday names. Default 'en-US'. */
|
|
25
|
+
locale?: string;
|
|
26
|
+
}
|
|
27
|
+
export type CalendarNavProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
export type CalendarPrevButtonProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
29
|
+
export type CalendarNextButtonProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
30
|
+
export type CalendarTitleProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
31
|
+
export interface CalendarGridProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
32
|
+
/** Render-prop for each day cell. Receives the date and its render-state. */
|
|
33
|
+
renderDay?: (day: CalendarDay) => JSX.Element;
|
|
34
|
+
/** Render-prop for the weekday header row. */
|
|
35
|
+
renderWeekday?: (weekday: {
|
|
36
|
+
name: string;
|
|
37
|
+
short: string;
|
|
38
|
+
}) => JSX.Element;
|
|
39
|
+
}
|
|
40
|
+
export interface CalendarDay {
|
|
41
|
+
date: Date;
|
|
42
|
+
dayOfMonth: number;
|
|
43
|
+
isToday: boolean;
|
|
44
|
+
isSelected: boolean;
|
|
45
|
+
isOutsideMonth: boolean;
|
|
46
|
+
isDisabled: boolean;
|
|
47
|
+
isWeekend: boolean;
|
|
48
|
+
/** Spread these onto your button element. Includes ARIA + data-* attributes. */
|
|
49
|
+
props: JSX.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
50
|
+
'data-today'?: string;
|
|
51
|
+
'data-selected'?: string;
|
|
52
|
+
'data-outside-month'?: string;
|
|
53
|
+
'data-disabled'?: string;
|
|
54
|
+
'data-weekend'?: string;
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export interface CalendarContextValue {
|
|
58
|
+
readonly month: Date;
|
|
59
|
+
readonly value: Date | null;
|
|
60
|
+
readonly weekStartsOn: WeekStart;
|
|
61
|
+
readonly locale: string;
|
|
62
|
+
readonly minDate?: Date;
|
|
63
|
+
readonly maxDate?: Date;
|
|
64
|
+
isDateDisabled?: (date: Date) => boolean;
|
|
65
|
+
goToMonth: (offset: number) => void;
|
|
66
|
+
selectDate: (date: Date) => void;
|
|
67
|
+
readonly canGoPrev: boolean;
|
|
68
|
+
readonly canGoNext: boolean;
|
|
69
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { ComboboxContentProps, ComboboxEmptyProps, ComboboxInputProps, ComboboxItemsProps, ComboboxRootProps, ComboboxTriggerProps } from './Combobox.types';
|
|
3
|
+
declare function Root(props: ComboboxRootProps): JSX.Element;
|
|
4
|
+
declare function Input(props: ComboboxInputProps): JSX.Element;
|
|
5
|
+
declare function Trigger(props: ComboboxTriggerProps): JSX.Element;
|
|
6
|
+
declare function Content(props: ComboboxContentProps): JSX.Element;
|
|
7
|
+
declare function Items(props: ComboboxItemsProps): JSX.Element;
|
|
8
|
+
declare function Empty(props: ComboboxEmptyProps): JSX.Element;
|
|
9
|
+
export declare const Combobox: {
|
|
10
|
+
Root: typeof Root;
|
|
11
|
+
Input: typeof Input;
|
|
12
|
+
Trigger: typeof Trigger;
|
|
13
|
+
Content: typeof Content;
|
|
14
|
+
Items: typeof Items;
|
|
15
|
+
Empty: typeof Empty;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ComboboxOption {
|
|
3
|
+
/** Stable identifier (compared with `===`). */
|
|
4
|
+
value: string;
|
|
5
|
+
/** Human-readable label shown in the input when selected. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional subtitle shown in the listbox row. */
|
|
8
|
+
subtitle?: string;
|
|
9
|
+
/** Disable selection of this option. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ComboboxRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
13
|
+
/** Available options. */
|
|
14
|
+
options: ComboboxOption[];
|
|
15
|
+
/** Controlled selected value. Use `null` for empty. */
|
|
16
|
+
value?: string | null;
|
|
17
|
+
/** Initial selected value (uncontrolled). */
|
|
18
|
+
defaultValue?: string | null;
|
|
19
|
+
/** Called when the selection changes. */
|
|
20
|
+
onChange?: (value: string | null, option: ComboboxOption | null) => void;
|
|
21
|
+
/** Controlled input text. */
|
|
22
|
+
inputValue?: string;
|
|
23
|
+
/** Initial input text (uncontrolled). */
|
|
24
|
+
defaultInputValue?: string;
|
|
25
|
+
/** Called when the user types. */
|
|
26
|
+
onInputChange?: (value: string) => void;
|
|
27
|
+
/** Custom filter. Default: case-insensitive label match. */
|
|
28
|
+
filter?: (option: ComboboxOption, inputValue: string) => boolean;
|
|
29
|
+
/** Disable the entire combobox. */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** Called when the open state changes. */
|
|
32
|
+
onOpenChange?: (open: boolean) => void;
|
|
33
|
+
/** Controlled open state. */
|
|
34
|
+
open?: boolean;
|
|
35
|
+
/** Initial open state. */
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export type ComboboxInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'role' | 'aria-controls' | 'aria-activedescendant'>;
|
|
39
|
+
export type ComboboxTriggerProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
40
|
+
export type ComboboxContentProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
41
|
+
export type ComboboxEmptyProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
42
|
+
export interface ComboboxItemRenderProps {
|
|
43
|
+
option: ComboboxOption;
|
|
44
|
+
highlighted: boolean;
|
|
45
|
+
selected: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface ComboboxItemsProps {
|
|
48
|
+
children: (props: ComboboxItemRenderProps) => JSX.Element;
|
|
49
|
+
}
|
|
50
|
+
export interface ComboboxContextValue {
|
|
51
|
+
readonly options: ComboboxOption[];
|
|
52
|
+
readonly filtered: ComboboxOption[];
|
|
53
|
+
readonly selected: string | null;
|
|
54
|
+
readonly inputValue: string;
|
|
55
|
+
readonly open: boolean;
|
|
56
|
+
readonly highlightedIndex: number;
|
|
57
|
+
readonly disabled: boolean;
|
|
58
|
+
readonly listboxId: string;
|
|
59
|
+
getOptionId: (value: string) => string;
|
|
60
|
+
setOpen: (open: boolean) => void;
|
|
61
|
+
setInputValue: (text: string) => void;
|
|
62
|
+
commitOption: (option: ComboboxOption) => void;
|
|
63
|
+
setHighlightedIndex: (index: number) => void;
|
|
64
|
+
moveHighlight: (delta: number) => void;
|
|
65
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { ContextMenuContentProps, ContextMenuItemProps, ContextMenuRootProps, ContextMenuSeparatorProps, ContextMenuTriggerProps } from './ContextMenu.types';
|
|
3
|
+
declare function Root(props: ContextMenuRootProps): JSX.Element;
|
|
4
|
+
declare function Trigger(props: ContextMenuTriggerProps): JSX.Element;
|
|
5
|
+
declare function Content(props: ContextMenuContentProps): JSX.Element;
|
|
6
|
+
declare function Item(props: ContextMenuItemProps): JSX.Element;
|
|
7
|
+
declare function Separator(props: ContextMenuSeparatorProps): JSX.Element;
|
|
8
|
+
export declare const ContextMenu: {
|
|
9
|
+
Root: typeof Root;
|
|
10
|
+
Trigger: typeof Trigger;
|
|
11
|
+
Content: typeof Content;
|
|
12
|
+
Item: typeof Item;
|
|
13
|
+
Separator: typeof Separator;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface ContextMenuRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
+
open?: boolean;
|
|
4
|
+
defaultOpen?: boolean;
|
|
5
|
+
onOpenChange?: (open: boolean) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export type ContextMenuTriggerProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
9
|
+
export type ContextMenuContentProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
10
|
+
export interface ContextMenuItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Called when the item is selected (and closes the menu). */
|
|
13
|
+
onSelect?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export type ContextMenuSeparatorProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
16
|
+
export interface ContextMenuContextValue {
|
|
17
|
+
readonly open: boolean;
|
|
18
|
+
readonly disabled: boolean;
|
|
19
|
+
readonly position: {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
};
|
|
23
|
+
openAt: (x: number, y: number) => void;
|
|
24
|
+
close: () => void;
|
|
25
|
+
setContentEl: (el: HTMLDivElement | null) => void;
|
|
26
|
+
getContentEl: () => HTMLDivElement | null;
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { CalendarRootProps } from '../calendar/Calendar.types';
|
|
3
|
+
import { DatePickerContentProps, DatePickerRootProps, DatePickerTriggerProps, DatePickerValueProps } from './DatePicker.types';
|
|
4
|
+
declare function Root(props: DatePickerRootProps): JSX.Element;
|
|
5
|
+
declare function Trigger(props: DatePickerTriggerProps): JSX.Element;
|
|
6
|
+
declare function Value(props: DatePickerValueProps): JSX.Element;
|
|
7
|
+
declare function Content(props: DatePickerContentProps): JSX.Element;
|
|
8
|
+
interface DatePickerCalendarProps extends Omit<CalendarRootProps, 'value' | 'onChange'> {
|
|
9
|
+
children?: JSX.Element;
|
|
10
|
+
}
|
|
11
|
+
declare function CalendarBridge(props: DatePickerCalendarProps): JSX.Element;
|
|
12
|
+
export declare const DatePicker: {
|
|
13
|
+
Root: typeof Root;
|
|
14
|
+
Trigger: typeof Trigger;
|
|
15
|
+
Value: typeof Value;
|
|
16
|
+
Content: typeof Content;
|
|
17
|
+
Calendar: typeof CalendarBridge;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface DatePickerRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
+
value?: Date | null;
|
|
4
|
+
defaultValue?: Date | null;
|
|
5
|
+
onChange?: (date: Date | null) => void;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
closeOnSelect?: boolean;
|
|
11
|
+
/** Locale for the formatted display value. */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/** Format options for the displayed date. */
|
|
14
|
+
formatOptions?: Intl.DateTimeFormatOptions;
|
|
15
|
+
}
|
|
16
|
+
export type DatePickerTriggerProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
17
|
+
export interface DatePickerValueProps extends Omit<JSX.HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
18
|
+
placeholder?: JSX.Element;
|
|
19
|
+
children?: (date: Date | null, formatted: string) => JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export type DatePickerContentProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
export interface DatePickerContextValue {
|
|
23
|
+
readonly value: Date | null;
|
|
24
|
+
readonly open: boolean;
|
|
25
|
+
readonly disabled: boolean;
|
|
26
|
+
readonly closeOnSelect: boolean;
|
|
27
|
+
readonly locale: string;
|
|
28
|
+
readonly formatOptions: Intl.DateTimeFormatOptions;
|
|
29
|
+
setOpen: (open: boolean) => void;
|
|
30
|
+
setValue: (date: Date | null) => void;
|
|
31
|
+
readonly triggerId: string;
|
|
32
|
+
readonly contentId: string;
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { FileUploadDropzoneProps, FileUploadInputProps, FileUploadRootProps, FileUploadTriggerProps } from './FileUpload.types';
|
|
3
|
+
declare function Root(props: FileUploadRootProps): JSX.Element;
|
|
4
|
+
declare function Input(props: FileUploadInputProps): JSX.Element;
|
|
5
|
+
declare function Trigger(props: FileUploadTriggerProps): JSX.Element;
|
|
6
|
+
declare function Dropzone(props: FileUploadDropzoneProps): JSX.Element;
|
|
7
|
+
interface FileUploadItemsProps {
|
|
8
|
+
children: (file: File, index: number, remove: () => void) => JSX.Element;
|
|
9
|
+
}
|
|
10
|
+
declare function Items(props: FileUploadItemsProps): JSX.Element;
|
|
11
|
+
export declare const FileUpload: {
|
|
12
|
+
Root: typeof Root;
|
|
13
|
+
Input: typeof Input;
|
|
14
|
+
Trigger: typeof Trigger;
|
|
15
|
+
Dropzone: typeof Dropzone;
|
|
16
|
+
Items: typeof Items;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface FileUploadRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
+
/** Controlled list of files. */
|
|
4
|
+
value?: File[];
|
|
5
|
+
/** Initial file list (uncontrolled). */
|
|
6
|
+
defaultValue?: File[];
|
|
7
|
+
/** Called whenever the file list changes. */
|
|
8
|
+
onChange?: (files: File[]) => void;
|
|
9
|
+
/** Allow selecting multiple files. */
|
|
10
|
+
multiple?: boolean;
|
|
11
|
+
/** Accept attribute, e.g. "image/*" or ".pdf,.doc". */
|
|
12
|
+
accept?: string;
|
|
13
|
+
/** Maximum number of files. */
|
|
14
|
+
maxFiles?: number;
|
|
15
|
+
/** Maximum size per file in bytes. */
|
|
16
|
+
maxSize?: number;
|
|
17
|
+
/** Disable the dropzone + trigger. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Called when files are rejected (too many, too large, wrong type). */
|
|
20
|
+
onReject?: (rejected: {
|
|
21
|
+
file: File;
|
|
22
|
+
reason: 'maxFiles' | 'maxSize' | 'accept';
|
|
23
|
+
}[]) => void;
|
|
24
|
+
}
|
|
25
|
+
export type FileUploadInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, 'type' | 'value' | 'defaultValue' | 'onChange'>;
|
|
26
|
+
export type FileUploadTriggerProps = JSX.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
27
|
+
export type FileUploadDropzoneProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
28
|
+
export interface FileUploadContextValue {
|
|
29
|
+
readonly files: File[];
|
|
30
|
+
readonly disabled: boolean;
|
|
31
|
+
readonly multiple: boolean;
|
|
32
|
+
readonly accept?: string;
|
|
33
|
+
readonly maxFiles?: number;
|
|
34
|
+
readonly maxSize?: number;
|
|
35
|
+
readonly isDragging: boolean;
|
|
36
|
+
addFiles: (incoming: File[]) => void;
|
|
37
|
+
removeFile: (index: number) => void;
|
|
38
|
+
openPicker: () => void;
|
|
39
|
+
registerInput: (el: HTMLInputElement | null) => void;
|
|
40
|
+
setDragging: (v: boolean) => void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { FormControlProps, FormDescriptionProps, FormErrorProps, FormFieldProps, FormLabelProps, FormRootProps } from './Form.types';
|
|
3
|
+
declare function Root(props: FormRootProps): JSX.Element;
|
|
4
|
+
declare function Field(props: FormFieldProps): JSX.Element;
|
|
5
|
+
declare function Label(props: FormLabelProps): JSX.Element;
|
|
6
|
+
declare function Control(props: FormControlProps): JSX.Element;
|
|
7
|
+
declare function Description(props: FormDescriptionProps): JSX.Element;
|
|
8
|
+
declare function ErrorMessage(props: FormErrorProps): JSX.Element;
|
|
9
|
+
export declare const Form: {
|
|
10
|
+
Root: typeof Root;
|
|
11
|
+
Field: typeof Field;
|
|
12
|
+
Label: typeof Label;
|
|
13
|
+
Control: typeof Control;
|
|
14
|
+
Description: typeof Description;
|
|
15
|
+
Error: typeof ErrorMessage;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export type FormRootProps = JSX.FormHTMLAttributes<HTMLFormElement>;
|
|
3
|
+
export interface FormFieldProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Optional name (used as id prefix and on the `name` attr if Control wraps a native field). */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** Marks the whole field as invalid; toggles aria-invalid + data-invalid on the control. */
|
|
7
|
+
invalid?: boolean;
|
|
8
|
+
/** Marks the field as required (toggles aria-required + data-required). */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
/** Marks the field as disabled (toggles disabled + data-disabled on the control). */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface FormLabelProps extends JSX.LabelHTMLAttributes<HTMLLabelElement> {
|
|
14
|
+
/** When true, mutate the child element's attributes instead of rendering a <label>. */
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface FormControlProps {
|
|
18
|
+
/** A single form control (input, select, textarea, etc). The Field's id, aria-* and disabled props will be merged in. */
|
|
19
|
+
children: JSX.Element;
|
|
20
|
+
}
|
|
21
|
+
export type FormDescriptionProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
22
|
+
export interface FormErrorProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/** When true, render even if the surrounding Field is not invalid. */
|
|
24
|
+
forceMount?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface FormFieldContextValue {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly descriptionId: string;
|
|
29
|
+
readonly errorId: string;
|
|
30
|
+
readonly name?: string;
|
|
31
|
+
readonly invalid: boolean;
|
|
32
|
+
readonly required: boolean;
|
|
33
|
+
readonly disabled: boolean;
|
|
34
|
+
readonly hasDescription: boolean;
|
|
35
|
+
readonly hasError: boolean;
|
|
36
|
+
registerDescription: (present: boolean) => void;
|
|
37
|
+
registerError: (present: boolean) => void;
|
|
38
|
+
}
|
|
@@ -1,26 +1,45 @@
|
|
|
1
1
|
export { Accordion } from './accordion';
|
|
2
2
|
export { Alert } from './alert';
|
|
3
|
+
export { AspectRatio } from './aspect-ratio';
|
|
3
4
|
export { Avatar } from './avatar';
|
|
4
5
|
export { Badge } from './badge';
|
|
6
|
+
export { Breadcrumb } from './breadcrumb';
|
|
5
7
|
export { Button } from './button';
|
|
8
|
+
export { Calendar } from './calendar';
|
|
6
9
|
export { Card } from './card';
|
|
7
10
|
export { Checkbox } from './checkbox';
|
|
11
|
+
export { Combobox } from './combobox';
|
|
12
|
+
export { ContextMenu } from './context-menu';
|
|
13
|
+
export { DatePicker } from './date-picker';
|
|
8
14
|
export { Divider } from './divider';
|
|
9
15
|
export { Drawer } from './drawer';
|
|
10
16
|
export { Dropdown } from './dropdown';
|
|
17
|
+
export { FileUpload } from './file-upload';
|
|
18
|
+
export { Form } from './form';
|
|
11
19
|
export { Icon } from './icon';
|
|
12
20
|
export { Image } from './image';
|
|
13
21
|
export { Input } from './input';
|
|
14
22
|
export { List } from './list';
|
|
23
|
+
export { MenuBar } from './menu-bar';
|
|
15
24
|
export { Modal } from './modal';
|
|
25
|
+
export { NavigationMenu } from './navigation-menu';
|
|
26
|
+
export { NumberInput } from './number-input';
|
|
16
27
|
export { OTP } from './otp';
|
|
28
|
+
export { Pagination, getPaginationItems } from './pagination';
|
|
17
29
|
export { Password } from './password';
|
|
18
30
|
export { ProgressBar } from './progress-bar';
|
|
19
31
|
export { Radio } from './radio';
|
|
20
32
|
export { Rating } from './rating';
|
|
33
|
+
export { ResizablePanels } from './resizable-panels';
|
|
21
34
|
export { Search } from './search';
|
|
22
35
|
export { Select } from './select';
|
|
36
|
+
export { Skeleton } from './skeleton';
|
|
37
|
+
export { Spinner } from './spinner';
|
|
23
38
|
export { Switch } from './switch';
|
|
39
|
+
export { Tag } from './tag';
|
|
40
|
+
export { TagInput } from './tag-input';
|
|
24
41
|
export { Textarea } from './textarea';
|
|
25
42
|
export { Timeago } from './timeago';
|
|
43
|
+
export { Toast, useToast } from './toast';
|
|
26
44
|
export { Tooltip } from './tooltip';
|
|
45
|
+
export { TreeView } from './tree-view';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { MenuBarContentProps, MenuBarItemProps, MenuBarMenuProps, MenuBarRootProps, MenuBarSeparatorProps, MenuBarTriggerProps } from './MenuBar.types';
|
|
3
|
+
declare function Root(props: MenuBarRootProps): JSX.Element;
|
|
4
|
+
declare function Menu(props: MenuBarMenuProps): JSX.Element;
|
|
5
|
+
declare function Trigger(props: MenuBarTriggerProps): JSX.Element;
|
|
6
|
+
declare function Content(props: MenuBarContentProps): JSX.Element;
|
|
7
|
+
declare function Item(props: MenuBarItemProps): JSX.Element;
|
|
8
|
+
declare function Separator(props: MenuBarSeparatorProps): JSX.Element;
|
|
9
|
+
export declare const MenuBar: {
|
|
10
|
+
Root: typeof Root;
|
|
11
|
+
Menu: typeof Menu;
|
|
12
|
+
Trigger: typeof Trigger;
|
|
13
|
+
Content: typeof Content;
|
|
14
|
+
Item: typeof Item;
|
|
15
|
+
Separator: typeof Separator;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface MenuBarRootProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
+
/** Controlled active menu id (open menu). */
|
|
4
|
+
value?: string | null;
|
|
5
|
+
/** Initial open menu (uncontrolled). */
|
|
6
|
+
defaultValue?: string | null;
|
|
7
|
+
/** Called when the open menu changes. */
|
|
8
|
+
onValueChange?: (value: string | null) => void;
|
|
9
|
+
}
|
|
10
|
+
export interface MenuBarMenuProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
11
|
+
/** Unique id for this menu (matches Root's `value`). */
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuBarTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type MenuBarContentProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
18
|
+
export interface MenuBarItemProps extends JSX.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
onSelect?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export type MenuBarSeparatorProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
export interface MenuBarContextValue {
|
|
24
|
+
readonly openMenu: string | null;
|
|
25
|
+
setOpenMenu: (value: string | null) => void;
|
|
26
|
+
registerMenu: (id: string) => void;
|
|
27
|
+
unregisterMenu: (id: string) => void;
|
|
28
|
+
getMenuOrder: () => string[];
|
|
29
|
+
}
|
|
30
|
+
export interface MenuBarMenuContextValue {
|
|
31
|
+
readonly value: string;
|
|
32
|
+
readonly open: boolean;
|
|
33
|
+
close: () => void;
|
|
34
|
+
open_: () => void;
|
|
35
|
+
toggle: () => void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
import { NavigationMenuContentProps, NavigationMenuItemProps, NavigationMenuLinkProps, NavigationMenuListProps, NavigationMenuRootProps, NavigationMenuTriggerProps } from './NavigationMenu.types';
|
|
3
|
+
declare function Root(props: NavigationMenuRootProps): JSX.Element;
|
|
4
|
+
declare function List(props: NavigationMenuListProps): JSX.Element;
|
|
5
|
+
declare function Item(props: NavigationMenuItemProps): JSX.Element;
|
|
6
|
+
declare function Trigger(props: NavigationMenuTriggerProps): JSX.Element;
|
|
7
|
+
declare function Content(props: NavigationMenuContentProps): JSX.Element;
|
|
8
|
+
declare function Link(props: NavigationMenuLinkProps): JSX.Element;
|
|
9
|
+
export declare const NavigationMenu: {
|
|
10
|
+
Root: typeof Root;
|
|
11
|
+
List: typeof List;
|
|
12
|
+
Item: typeof Item;
|
|
13
|
+
Trigger: typeof Trigger;
|
|
14
|
+
Content: typeof Content;
|
|
15
|
+
Link: typeof Link;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { JSX } from 'solid-js';
|
|
2
|
+
export interface NavigationMenuRootProps extends Omit<JSX.HTMLAttributes<HTMLElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
+
/** Controlled open item value. */
|
|
4
|
+
value?: string | null;
|
|
5
|
+
/** Initial open item (uncontrolled). */
|
|
6
|
+
defaultValue?: string | null;
|
|
7
|
+
/** Called when the open item changes. */
|
|
8
|
+
onValueChange?: (value: string | null) => void;
|
|
9
|
+
/** Open delay (ms) when hovering a trigger. Default 100. */
|
|
10
|
+
delayDuration?: number;
|
|
11
|
+
/** Time (ms) the user has to move from trigger → content before it closes. Default 300. */
|
|
12
|
+
skipDelayDuration?: number;
|
|
13
|
+
}
|
|
14
|
+
export type NavigationMenuListProps = JSX.HTMLAttributes<HTMLUListElement>;
|
|
15
|
+
export interface NavigationMenuItemProps extends JSX.LiHTMLAttributes<HTMLLIElement> {
|
|
16
|
+
/** Unique identifier for this item. Required only if it has Trigger/Content children. */
|
|
17
|
+
value?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface NavigationMenuTriggerProps extends JSX.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type NavigationMenuContentProps = JSX.HTMLAttributes<HTMLDivElement>;
|
|
23
|
+
export interface NavigationMenuLinkProps extends JSX.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
24
|
+
active?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface NavigationMenuRootContextValue {
|
|
27
|
+
readonly value: string | null;
|
|
28
|
+
setValue: (value: string | null) => void;
|
|
29
|
+
readonly delayDuration: number;
|
|
30
|
+
readonly skipDelayDuration: number;
|
|
31
|
+
/** Cancel any pending close. Called when cursor enters a Trigger or Content. */
|
|
32
|
+
cancelClose: () => void;
|
|
33
|
+
/** Schedule a close after `skipDelayDuration`. Called when cursor leaves a Trigger or Content. */
|
|
34
|
+
scheduleClose: () => void;
|
|
35
|
+
}
|
|
36
|
+
export interface NavigationMenuItemContextValue {
|
|
37
|
+
readonly value: string;
|
|
38
|
+
}
|