@proyecto-viviana/solidaria-components 0.2.9 → 0.3.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/README.md +39 -272
- package/dist/ActionBar.d.ts +21 -13
- package/dist/ActionBar.d.ts.map +1 -1
- package/dist/ActionGroup.d.ts +8 -8
- package/dist/ActionGroup.d.ts.map +1 -1
- package/dist/Alert.d.ts +5 -5
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Autocomplete.d.ts +5 -5
- package/dist/Autocomplete.d.ts.map +1 -1
- package/dist/Breadcrumbs.d.ts +18 -7
- package/dist/Breadcrumbs.d.ts.map +1 -1
- package/dist/Button.d.ts +24 -5
- package/dist/Button.d.ts.map +1 -1
- package/dist/Calendar.d.ts +38 -7
- package/dist/Calendar.d.ts.map +1 -1
- package/dist/Checkbox.d.ts +32 -7
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Collection.d.ts +19 -14
- package/dist/Collection.d.ts.map +1 -1
- package/dist/Color.d.ts +103 -14
- package/dist/Color.d.ts.map +1 -1
- package/dist/ColorEditor.d.ts +6 -6
- package/dist/ColorEditor.d.ts.map +1 -1
- package/dist/ComboBox.d.ts +85 -19
- package/dist/ComboBox.d.ts.map +1 -1
- package/dist/ContextualHelpTrigger.d.ts +2 -2
- package/dist/ContextualHelpTrigger.d.ts.map +1 -1
- package/dist/DateField.d.ts +8 -6
- package/dist/DateField.d.ts.map +1 -1
- package/dist/DatePicker.d.ts +53 -22
- package/dist/DatePicker.d.ts.map +1 -1
- package/dist/DateRangePickerContext.d.ts +30 -0
- package/dist/DateRangePickerContext.d.ts.map +1 -0
- package/dist/Dialog.d.ts +5 -5
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Disclosure.d.ts +23 -5
- package/dist/Disclosure.d.ts.map +1 -1
- package/dist/DragAndDrop.d.ts +6 -6
- package/dist/DragAndDrop.d.ts.map +1 -1
- package/dist/DragPreview.d.ts +2 -2
- package/dist/DragPreview.d.ts.map +1 -1
- package/dist/DropZone.d.ts +4 -4
- package/dist/DropZone.d.ts.map +1 -1
- package/dist/FieldError.d.ts +9 -5
- package/dist/FieldError.d.ts.map +1 -1
- package/dist/FileTrigger.d.ts +3 -3
- package/dist/FileTrigger.d.ts.map +1 -1
- package/dist/Focusable.d.ts +2 -2
- package/dist/Focusable.d.ts.map +1 -1
- package/dist/Form.d.ts +18 -4
- package/dist/Form.d.ts.map +1 -1
- package/dist/GridList.d.ts +32 -12
- package/dist/GridList.d.ts.map +1 -1
- package/dist/HiddenDateInput.d.ts +26 -0
- package/dist/HiddenDateInput.d.ts.map +1 -0
- package/dist/HiddenTimeInput.d.ts +25 -0
- package/dist/HiddenTimeInput.d.ts.map +1 -0
- package/dist/Icon.d.ts +5 -5
- package/dist/Icon.d.ts.map +1 -1
- package/dist/Keyboard.d.ts +1 -1
- package/dist/Landmark.d.ts +3 -3
- package/dist/Landmark.d.ts.map +1 -1
- package/dist/Link.d.ts +10 -4
- package/dist/Link.d.ts.map +1 -1
- package/dist/ListBox.d.ts +32 -12
- package/dist/ListBox.d.ts.map +1 -1
- package/dist/ListDropTargetDelegate.d.ts +6 -6
- package/dist/ListDropTargetDelegate.d.ts.map +1 -1
- package/dist/Menu.d.ts +65 -14
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Meter.d.ts +3 -3
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Modal.d.ts +5 -5
- package/dist/Modal.d.ts.map +1 -1
- package/dist/NumberField.d.ts +8 -12
- package/dist/NumberField.d.ts.map +1 -1
- package/dist/Popover.d.ts +28 -5
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Pressable.d.ts +2 -2
- package/dist/Pressable.d.ts.map +1 -1
- package/dist/ProgressBar.d.ts +5 -3
- package/dist/ProgressBar.d.ts.map +1 -1
- package/dist/RadioGroup.d.ts +43 -9
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RangeCalendar.d.ts +34 -7
- package/dist/RangeCalendar.d.ts.map +1 -1
- package/dist/RouterProvider.d.ts +2 -2
- package/dist/RouterProvider.d.ts.map +1 -1
- package/dist/SearchField.d.ts +23 -20
- package/dist/SearchField.d.ts.map +1 -1
- package/dist/Select.d.ts +41 -11
- package/dist/Select.d.ts.map +1 -1
- package/dist/SelectionIndicator.d.ts +3 -3
- package/dist/SelectionIndicator.d.ts.map +1 -1
- package/dist/Separator.d.ts +9 -3
- package/dist/Separator.d.ts.map +1 -1
- package/dist/SharedElementTransition.d.ts +6 -4
- package/dist/SharedElementTransition.d.ts.map +1 -1
- package/dist/Slider.d.ts +12 -8
- package/dist/Slider.d.ts.map +1 -1
- package/dist/StepList.d.ts +90 -0
- package/dist/StepList.d.ts.map +1 -0
- package/dist/Switch.d.ts +11 -5
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Table.d.ts +187 -23
- package/dist/Table.d.ts.map +1 -1
- package/dist/Tabs.d.ts +45 -9
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/TagGroup.d.ts +12 -10
- package/dist/TagGroup.d.ts.map +1 -1
- package/dist/Text.d.ts +2 -2
- package/dist/TextField.d.ts +15 -11
- package/dist/TextField.d.ts.map +1 -1
- package/dist/TimeField.d.ts +6 -6
- package/dist/TimeField.d.ts.map +1 -1
- package/dist/Toast.d.ts +29 -14
- package/dist/Toast.d.ts.map +1 -1
- package/dist/ToggleButton.d.ts +11 -5
- package/dist/ToggleButton.d.ts.map +1 -1
- package/dist/ToggleButtonGroup.d.ts +7 -7
- package/dist/ToggleButtonGroup.d.ts.map +1 -1
- package/dist/Toolbar.d.ts +7 -3
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Tooltip.d.ts +50 -8
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tree.d.ts +66 -17
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Virtualizer.d.ts +12 -12
- package/dist/Virtualizer.d.ts.map +1 -1
- package/dist/VirtualizerLayouts.d.ts +2 -2
- package/dist/VirtualizerLayouts.d.ts.map +1 -1
- package/dist/VisuallyHidden.d.ts +1 -1
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/contexts.d.ts +5 -1
- package/dist/contexts.d.ts.map +1 -1
- package/dist/index.d.ts +73 -71
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23247 -18564
- package/dist/index.js.map +1 -1
- package/dist/index.jsx +18110 -0
- package/dist/index.jsx.map +1 -0
- package/dist/useDragAndDrop.d.ts +13 -13
- package/dist/useDragAndDrop.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/virtualizer/Layout.d.ts +1 -1
- package/dist/virtualizer/Layout.d.ts.map +1 -1
- package/package.json +31 -32
- package/src/ActionBar.tsx +75 -72
- package/src/ActionGroup.tsx +53 -61
- package/src/Alert.tsx +17 -42
- package/src/Autocomplete.tsx +39 -44
- package/src/Breadcrumbs.tsx +149 -80
- package/src/Button.tsx +267 -70
- package/src/Calendar.tsx +218 -138
- package/src/Checkbox.tsx +413 -121
- package/src/Collection.tsx +67 -58
- package/src/Color.tsx +803 -380
- package/src/ColorEditor.tsx +131 -149
- package/src/ComboBox.tsx +414 -249
- package/src/ContextualHelpTrigger.tsx +86 -74
- package/src/DateField.tsx +185 -91
- package/src/DatePicker.tsx +524 -213
- package/src/DateRangePickerContext.tsx +44 -0
- package/src/Dialog.tsx +156 -118
- package/src/Disclosure.tsx +127 -80
- package/src/DragAndDrop.tsx +60 -54
- package/src/DragPreview.tsx +13 -11
- package/src/DropZone.tsx +42 -22
- package/src/FieldError.tsx +45 -23
- package/src/FileTrigger.tsx +19 -19
- package/src/Focusable.tsx +21 -24
- package/src/Form.tsx +71 -16
- package/src/GridList.tsx +273 -197
- package/src/HiddenDateInput.tsx +153 -0
- package/src/HiddenTimeInput.tsx +133 -0
- package/src/Icon.tsx +22 -43
- package/src/Keyboard.tsx +3 -3
- package/src/Landmark.tsx +37 -63
- package/src/Link.tsx +125 -75
- package/src/ListBox.tsx +332 -233
- package/src/ListDropTargetDelegate.ts +81 -80
- package/src/Menu.tsx +1023 -274
- package/src/Meter.tsx +38 -56
- package/src/Modal.tsx +243 -175
- package/src/NumberField.tsx +139 -143
- package/src/Popover.tsx +386 -233
- package/src/Pressable.tsx +21 -21
- package/src/ProgressBar.tsx +48 -57
- package/src/RadioGroup.tsx +524 -122
- package/src/RangeCalendar.tsx +157 -90
- package/src/RouterProvider.tsx +30 -47
- package/src/SearchField.tsx +362 -143
- package/src/Select.tsx +656 -233
- package/src/SelectionIndicator.tsx +18 -15
- package/src/Separator.tsx +47 -49
- package/src/SharedElementTransition.tsx +103 -97
- package/src/Slider.tsx +138 -98
- package/src/StepList.tsx +272 -0
- package/src/Switch.tsx +93 -46
- package/src/Table.tsx +1308 -342
- package/src/Tabs.tsx +324 -103
- package/src/TagGroup.tsx +139 -126
- package/src/Text.tsx +3 -3
- package/src/TextField.tsx +389 -79
- package/src/TimeField.tsx +136 -76
- package/src/Toast.tsx +209 -157
- package/src/ToggleButton.tsx +47 -37
- package/src/ToggleButtonGroup.tsx +39 -34
- package/src/Toolbar.tsx +54 -69
- package/src/Tooltip.tsx +387 -119
- package/src/Tree.tsx +651 -368
- package/src/Virtualizer.tsx +208 -180
- package/src/VirtualizerLayouts.ts +45 -30
- package/src/VisuallyHidden.tsx +19 -19
- package/src/contexts.ts +29 -37
- package/src/index.ts +110 -195
- package/src/useDragAndDrop.ts +87 -71
- package/src/utils.tsx +40 -55
- package/src/virtualizer/Layout.ts +14 -22
- package/dist/index.ssr.js +0 -16996
- package/dist/index.ssr.js.map +0 -1
package/dist/Button.d.ts
CHANGED
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
* A pre-wired headless button that combines state + aria hooks.
|
|
5
5
|
* Port of react-aria-components/src/Button.tsx
|
|
6
6
|
*/
|
|
7
|
-
import { type JSX } from
|
|
8
|
-
import { type AriaButtonProps } from
|
|
9
|
-
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from
|
|
7
|
+
import { type JSX } from "solid-js";
|
|
8
|
+
import { type AriaButtonProps, type HoverEvent } from "@proyecto-viviana/solidaria";
|
|
9
|
+
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
10
|
+
type RefLike<T> = ((el: T) => void) | {
|
|
11
|
+
current?: T | null;
|
|
12
|
+
} | undefined;
|
|
10
13
|
export interface ButtonRenderProps {
|
|
11
14
|
/** Whether the button is currently hovered with a mouse. */
|
|
12
15
|
isHovered: boolean;
|
|
@@ -21,17 +24,32 @@ export interface ButtonRenderProps {
|
|
|
21
24
|
/** Whether the button is currently in a pending state. */
|
|
22
25
|
isPending: boolean;
|
|
23
26
|
}
|
|
24
|
-
export interface ButtonProps extends Omit<AriaButtonProps,
|
|
27
|
+
export interface ButtonProps extends Omit<AriaButtonProps, "children">, SlotProps {
|
|
25
28
|
/** The children of the component. A function may be provided to receive render props. */
|
|
26
29
|
children?: RenderChildren<ButtonRenderProps>;
|
|
27
30
|
/** The CSS className for the element. */
|
|
28
31
|
class?: ClassNameOrFunction<ButtonRenderProps>;
|
|
29
32
|
/** The inline style for the element. */
|
|
30
33
|
style?: StyleOrFunction<ButtonRenderProps>;
|
|
34
|
+
/** Custom renderer for the outer button element. */
|
|
35
|
+
render?: (props: JSX.ButtonHTMLAttributes<HTMLButtonElement>, renderProps: ButtonRenderProps) => JSX.Element;
|
|
36
|
+
/** Ref for the underlying button element. */
|
|
37
|
+
ref?: RefLike<HTMLButtonElement>;
|
|
31
38
|
/** Whether the button is in a pending state. */
|
|
32
39
|
isPending?: boolean;
|
|
40
|
+
/** Keeps pending buttons focusable by using aria-disabled without a native disabled attribute. */
|
|
41
|
+
isPendingFocusable?: boolean;
|
|
42
|
+
/** Handler called when hover starts. */
|
|
43
|
+
onHoverStart?: (e: HoverEvent) => void;
|
|
44
|
+
/** Handler called when hover ends. */
|
|
45
|
+
onHoverEnd?: (e: HoverEvent) => void;
|
|
46
|
+
/** Handler called when hover state changes. */
|
|
47
|
+
onHoverChange?: (isHovered: boolean) => void;
|
|
33
48
|
}
|
|
34
|
-
export
|
|
49
|
+
export interface ButtonContextValue extends ButtonProps {
|
|
50
|
+
slots?: Record<string, ButtonProps>;
|
|
51
|
+
}
|
|
52
|
+
export declare const ButtonContext: import("solid-js").Context<ButtonContextValue | null>;
|
|
35
53
|
/**
|
|
36
54
|
* A button allows a user to perform an action.
|
|
37
55
|
*
|
|
@@ -50,4 +68,5 @@ export declare const ButtonContext: import("solid-js").Context<ButtonProps | nul
|
|
|
50
68
|
* ```
|
|
51
69
|
*/
|
|
52
70
|
export declare function Button(props: ButtonProps): JSX.Element;
|
|
71
|
+
export {};
|
|
53
72
|
//# sourceMappingURL=Button.d.ts.map
|
package/dist/Button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,EAOT,MAAM,UAAU,CAAC;AAClB,OAAO,EAOL,KAAK,eAAe,EACpB,KAAK,UAAU,EAEhB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAIjB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AA6DzE,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,0DAA0D;IAC1D,SAAS,EAAE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5E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CA2TtD"}
|
package/dist/Calendar.d.ts
CHANGED
|
@@ -4,17 +4,22 @@
|
|
|
4
4
|
* Pre-wired headless calendar component that combines aria hooks.
|
|
5
5
|
* Port of react-aria-components/src/Calendar.tsx
|
|
6
6
|
*/
|
|
7
|
-
import { type JSX } from
|
|
8
|
-
import { type AriaCalendarProps, type AriaCalendarGridProps } from
|
|
9
|
-
import { type CalendarState, type CalendarStateProps, type CalendarDate, type DateValue } from
|
|
10
|
-
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from
|
|
7
|
+
import { type JSX } from "solid-js";
|
|
8
|
+
import { type AriaCalendarProps, type AriaCalendarGridProps } from "@proyecto-viviana/solidaria";
|
|
9
|
+
import { type CalendarState, type CalendarStateProps, type CalendarDate, type DateValue } from "@proyecto-viviana/solid-stately";
|
|
10
|
+
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
11
|
+
type RefLike<T> = ((el: T) => void) | {
|
|
12
|
+
current?: T | null;
|
|
13
|
+
} | undefined;
|
|
11
14
|
export interface CalendarRenderProps {
|
|
12
15
|
/** Whether the calendar is disabled. */
|
|
13
16
|
isDisabled: boolean;
|
|
14
17
|
/** Whether the calendar is read-only. */
|
|
15
18
|
isReadOnly: boolean;
|
|
19
|
+
/** Whether the current selection is invalid. */
|
|
20
|
+
isInvalid: boolean;
|
|
16
21
|
}
|
|
17
|
-
export interface CalendarProps<T extends DateValue = DateValue> extends Omit<AriaCalendarProps,
|
|
22
|
+
export interface CalendarProps<T extends DateValue = DateValue> extends Omit<AriaCalendarProps, "id" | "isDisabled" | "isReadOnly">, Omit<CalendarStateProps<T>, "locale">, SlotProps {
|
|
18
23
|
/** The children of the component. */
|
|
19
24
|
children?: JSX.Element;
|
|
20
25
|
/** The CSS className for the element. */
|
|
@@ -23,18 +28,22 @@ export interface CalendarProps<T extends DateValue = DateValue> extends Omit<Ari
|
|
|
23
28
|
style?: StyleOrFunction<CalendarRenderProps>;
|
|
24
29
|
/** The locale to use for formatting. */
|
|
25
30
|
locale?: string;
|
|
31
|
+
/** Ref for the calendar root element. */
|
|
32
|
+
ref?: RefLike<HTMLDivElement>;
|
|
26
33
|
}
|
|
27
34
|
export interface CalendarGridRenderProps {
|
|
28
35
|
/** Whether the grid is disabled. */
|
|
29
36
|
isDisabled: boolean;
|
|
30
37
|
}
|
|
31
|
-
export interface CalendarGridProps extends Omit<AriaCalendarGridProps,
|
|
38
|
+
export interface CalendarGridProps extends Omit<AriaCalendarGridProps, "startDate" | "endDate">, SlotProps {
|
|
32
39
|
/** The children of the component (render function receiving weeks). */
|
|
33
40
|
children?: (date: CalendarDate) => JSX.Element;
|
|
34
41
|
/** The CSS className for the element. */
|
|
35
42
|
class?: ClassNameOrFunction<CalendarGridRenderProps>;
|
|
36
43
|
/** The inline style for the element. */
|
|
37
44
|
style?: StyleOrFunction<CalendarGridRenderProps>;
|
|
45
|
+
/** Class name for weekday header cells. */
|
|
46
|
+
headerCellClass?: string;
|
|
38
47
|
/** Number of weeks to offset from the start. */
|
|
39
48
|
offset?: {
|
|
40
49
|
months?: number;
|
|
@@ -45,16 +54,30 @@ export interface CalendarCellRenderProps {
|
|
|
45
54
|
isSelected: boolean;
|
|
46
55
|
/** Whether the cell is focused. */
|
|
47
56
|
isFocused: boolean;
|
|
57
|
+
/** Whether the cell should display a keyboard focus ring. */
|
|
58
|
+
isFocusVisible: boolean;
|
|
48
59
|
/** Whether the cell is disabled. */
|
|
49
60
|
isDisabled: boolean;
|
|
50
61
|
/** Whether the cell is unavailable. */
|
|
51
62
|
isUnavailable: boolean;
|
|
63
|
+
/** Whether the cell is part of an invalid selection. */
|
|
64
|
+
isInvalid: boolean;
|
|
52
65
|
/** Whether the cell is outside the visible month. */
|
|
53
66
|
isOutsideMonth: boolean;
|
|
54
67
|
/** Whether the cell represents today. */
|
|
55
68
|
isToday: boolean;
|
|
56
69
|
/** Whether the cell is pressed. */
|
|
57
70
|
isPressed: boolean;
|
|
71
|
+
/** Whether the cell is hovered. */
|
|
72
|
+
isHovered: boolean;
|
|
73
|
+
/** Whether the cell is the first day slot in its row. */
|
|
74
|
+
isFirstChild: boolean;
|
|
75
|
+
/** Whether the cell is the last day slot in its row. */
|
|
76
|
+
isLastChild: boolean;
|
|
77
|
+
/** Whether the cell is in the first rendered week row. */
|
|
78
|
+
isFirstWeek: boolean;
|
|
79
|
+
/** Whether the cell is in the last rendered week row. */
|
|
80
|
+
isLastWeek: boolean;
|
|
58
81
|
/** The formatted date string. */
|
|
59
82
|
formattedDate: string;
|
|
60
83
|
}
|
|
@@ -67,6 +90,10 @@ export interface CalendarCellProps extends SlotProps {
|
|
|
67
90
|
class?: ClassNameOrFunction<CalendarCellRenderProps>;
|
|
68
91
|
/** The inline style for the element. */
|
|
69
92
|
style?: StyleOrFunction<CalendarCellRenderProps>;
|
|
93
|
+
/** Class name for the table cell wrapper. */
|
|
94
|
+
cellClass?: ClassNameOrFunction<CalendarCellRenderProps>;
|
|
95
|
+
/** Inline style for the table cell wrapper. */
|
|
96
|
+
cellStyle?: StyleOrFunction<CalendarCellRenderProps>;
|
|
70
97
|
}
|
|
71
98
|
export interface CalendarHeaderCellProps extends SlotProps {
|
|
72
99
|
/** The children of the component. */
|
|
@@ -107,6 +134,10 @@ export declare function useCalendarContext(): CalendarState<DateValue>;
|
|
|
107
134
|
*/
|
|
108
135
|
export declare function Calendar<T extends DateValue = CalendarDate>(props: CalendarProps<T>): JSX.Element;
|
|
109
136
|
export interface CalendarHeadingProps extends SlotProps {
|
|
137
|
+
/** The children of the component. */
|
|
138
|
+
children?: RenderChildren<{
|
|
139
|
+
title: string;
|
|
140
|
+
}>;
|
|
110
141
|
/** The CSS className for the element. */
|
|
111
142
|
class?: string;
|
|
112
143
|
/** The inline style for the element. */
|
|
@@ -118,7 +149,7 @@ export interface CalendarHeadingProps extends SlotProps {
|
|
|
118
149
|
export declare function CalendarHeading(props: CalendarHeadingProps): JSX.Element;
|
|
119
150
|
export interface CalendarButtonProps extends SlotProps {
|
|
120
151
|
/** The slot for this button (previous or next). */
|
|
121
|
-
slot?:
|
|
152
|
+
slot?: "previous" | "next";
|
|
122
153
|
/** The children of the component. */
|
|
123
154
|
children?: JSX.Element;
|
|
124
155
|
/** The CSS className for the element. */
|
package/dist/Calendar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"Calendar.d.ts","sourceRoot":"","sources":["../src/Calendar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,EAUT,MAAM,UAAU,CAAC;AAElB,OAAO,EAKL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,SAAS,EAGf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAIf,MAAM,SAAS,CAAC;AAGjB,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AAczE,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,UAAU,EAAE,OAAO,CAAC;IACpB,yCAAyC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,M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CAAC,aAAa,CAAC;IAC1B,sCAAsC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAqBtE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA4FlE;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAM9E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,CAM1E;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAM9E;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAgGlE;AAED,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
package/dist/Checkbox.d.ts
CHANGED
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
* Pre-wired headless checkbox components that combine state + aria hooks.
|
|
5
5
|
* Port of react-aria-components/src/Checkbox.tsx
|
|
6
6
|
*/
|
|
7
|
-
import { type JSX } from
|
|
8
|
-
import { type AriaCheckboxProps, type AriaCheckboxGroupProps } from
|
|
9
|
-
import { type CheckboxGroupState } from
|
|
10
|
-
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from
|
|
7
|
+
import { type JSX } from "solid-js";
|
|
8
|
+
import { type AriaCheckboxProps, type AriaCheckboxGroupProps } from "@proyecto-viviana/solidaria";
|
|
9
|
+
import { type CheckboxGroupState } from "@proyecto-viviana/solid-stately";
|
|
10
|
+
import { type RenderChildren, type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
11
|
+
type RefLike<T> = ((el: T) => void) | {
|
|
12
|
+
current?: T | null;
|
|
13
|
+
} | undefined;
|
|
11
14
|
export interface CheckboxGroupRenderProps {
|
|
12
15
|
/** Whether the checkbox group is disabled. */
|
|
13
16
|
isDisabled: boolean;
|
|
@@ -42,27 +45,48 @@ export interface CheckboxRenderProps {
|
|
|
42
45
|
/** Whether the checkbox is required. */
|
|
43
46
|
isRequired: boolean;
|
|
44
47
|
}
|
|
45
|
-
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps,
|
|
48
|
+
export interface CheckboxGroupProps extends Omit<AriaCheckboxGroupProps, "children" | "label">, SlotProps {
|
|
46
49
|
/** The children of the component. A function may be provided to receive render props. */
|
|
47
50
|
children?: RenderChildren<CheckboxGroupRenderProps>;
|
|
48
51
|
/** The CSS className for the element. */
|
|
49
52
|
class?: ClassNameOrFunction<CheckboxGroupRenderProps>;
|
|
50
53
|
/** The inline style for the element. */
|
|
51
54
|
style?: StyleOrFunction<CheckboxGroupRenderProps>;
|
|
55
|
+
/** Ref for the checkbox group root element. */
|
|
56
|
+
ref?: RefLike<HTMLDivElement>;
|
|
52
57
|
}
|
|
53
|
-
export interface CheckboxProps extends Omit<AriaCheckboxProps,
|
|
58
|
+
export interface CheckboxProps extends Omit<AriaCheckboxProps, "children">, SlotProps {
|
|
54
59
|
/** The children of the component. A function may be provided to receive render props. */
|
|
55
60
|
children?: RenderChildren<CheckboxRenderProps>;
|
|
56
61
|
/** The CSS className for the element. */
|
|
57
62
|
class?: ClassNameOrFunction<CheckboxRenderProps>;
|
|
58
63
|
/** The inline style for the element. */
|
|
59
64
|
style?: StyleOrFunction<CheckboxRenderProps>;
|
|
65
|
+
/** Custom renderer for the outer label element. */
|
|
66
|
+
render?: (props: JSX.LabelHTMLAttributes<HTMLLabelElement>, renderProps: CheckboxRenderProps) => JSX.Element;
|
|
67
|
+
/** Ref for the outer label element. */
|
|
68
|
+
ref?: RefLike<HTMLLabelElement>;
|
|
69
|
+
/** Ref for the underlying input element. */
|
|
70
|
+
inputRef?: RefLike<HTMLInputElement>;
|
|
60
71
|
/** Whether the checkbox is indeterminate. */
|
|
61
72
|
isIndeterminate?: boolean;
|
|
73
|
+
/** A description for the checkbox. */
|
|
74
|
+
description?: JSX.Element;
|
|
75
|
+
/** An error message for the checkbox. */
|
|
76
|
+
errorMessage?: JSX.Element;
|
|
77
|
+
/** Handler called when hover starts. */
|
|
78
|
+
onHoverStart?: () => void;
|
|
79
|
+
/** Handler called when hover ends. */
|
|
80
|
+
onHoverEnd?: () => void;
|
|
81
|
+
/** Handler called when hover state changes. */
|
|
82
|
+
onHoverChange?: (isHovered: boolean) => void;
|
|
62
83
|
}
|
|
63
84
|
export declare const CheckboxGroupContext: import("solid-js").Context<CheckboxGroupProps | null>;
|
|
64
85
|
export declare const CheckboxGroupStateContext: import("solid-js").Context<CheckboxGroupState | null>;
|
|
65
|
-
export
|
|
86
|
+
export interface CheckboxContextValue extends CheckboxProps {
|
|
87
|
+
slots?: Record<string, CheckboxProps>;
|
|
88
|
+
}
|
|
89
|
+
export declare const CheckboxContext: import("solid-js").Context<CheckboxContextValue | null>;
|
|
66
90
|
/**
|
|
67
91
|
* A checkbox group allows a user to select multiple items from a list of options.
|
|
68
92
|
*
|
|
@@ -94,4 +118,5 @@ export declare function CheckboxGroup(props: CheckboxGroupProps): JSX.Element;
|
|
|
94
118
|
* ```
|
|
95
119
|
*/
|
|
96
120
|
export declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
121
|
+
export {};
|
|
97
122
|
//# sourceMappingURL=Checkbox.d.ts.map
|
package/dist/Checkbox.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../src/Checkbox.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,K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,CAAC;IACxB,+CAA+C;IAC/C,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,eAAO,MAAM,oBAAoB,uDAAiD,CAAC;AACnF,eAAO,MAAM,yBAAyB,uDAAiD,CAAC;AACxF,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;CACvC;AACD,eAAO,MAAM,eAAe,yDAAmD,CAAC;AAwDhF;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAwIpE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CA4T1D"}
|
package/dist/Collection.d.ts
CHANGED
|
@@ -4,20 +4,23 @@
|
|
|
4
4
|
* Foundational parity layer for React Spectrum-style composition:
|
|
5
5
|
* Section / Header / Group.
|
|
6
6
|
*/
|
|
7
|
-
import { type JSX } from
|
|
8
|
-
import type { Key } from
|
|
9
|
-
import type { DragTypes, DropOperation, DropTarget } from
|
|
10
|
-
import { createLeafComponent, createBranchComponent, type CollectionProps as AriaCollectionProps, type CollectionBuilderProps as AriaCollectionBuilderProps } from
|
|
11
|
-
import { type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from
|
|
7
|
+
import { type JSX } from "solid-js";
|
|
8
|
+
import type { Key } from "@proyecto-viviana/solid-stately";
|
|
9
|
+
import type { DragTypes, DropOperation, DropTarget } from "@proyecto-viviana/solid-stately";
|
|
10
|
+
import { createLeafComponent, createBranchComponent, type CollectionProps as AriaCollectionProps, type CollectionBuilderProps as AriaCollectionBuilderProps } from "@proyecto-viviana/solidaria";
|
|
11
|
+
import { type ClassNameOrFunction, type StyleOrFunction, type SlotProps } from "./utils";
|
|
12
12
|
export interface CollectionPrimitiveRenderProps {
|
|
13
13
|
/** Whether the primitive has visible children content. */
|
|
14
14
|
hasChildren: boolean;
|
|
15
15
|
}
|
|
16
|
+
type RefLike<T> = ((el: T) => void) | {
|
|
17
|
+
current?: T | null;
|
|
18
|
+
} | undefined;
|
|
16
19
|
export interface CollectionDropTargetDelegate {
|
|
17
20
|
getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
|
|
18
21
|
getDropOperation(target: DropTarget, types: DragTypes, allowedOperations: DropOperation[]): DropOperation;
|
|
19
|
-
getKeyboardNavigationTarget?(target: DropTarget | null, direction:
|
|
20
|
-
getKeyboardPageNavigationTarget?(target: DropTarget | null, direction:
|
|
22
|
+
getKeyboardNavigationTarget?(target: DropTarget | null, direction: "next" | "previous", isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
|
|
23
|
+
getKeyboardPageNavigationTarget?(target: DropTarget | null, direction: "next" | "previous", isValidDropTarget: (target: DropTarget) => boolean): DropTarget | null;
|
|
21
24
|
}
|
|
22
25
|
export interface CollectionRendererContextValue<T> {
|
|
23
26
|
/** Render function used by collection parents to render each item node. */
|
|
@@ -29,7 +32,7 @@ export interface CollectionRendererContextValue<T> {
|
|
|
29
32
|
/** Optional drop target delegate used by DnD-aware collection paths. */
|
|
30
33
|
dropTargetDelegate?: CollectionDropTargetDelegate;
|
|
31
34
|
/** Optional drop indicator renderer for DnD-aware collection paths. */
|
|
32
|
-
renderDropIndicator?: (index: number, position:
|
|
35
|
+
renderDropIndicator?: (index: number, position: "before" | "after" | "on") => JSX.Element | undefined;
|
|
33
36
|
}
|
|
34
37
|
export type CollectionEntry<T> = T | CollectionSection<T>;
|
|
35
38
|
export interface CollectionSection<T> {
|
|
@@ -38,13 +41,15 @@ export interface CollectionSection<T> {
|
|
|
38
41
|
/** Optional section header title. */
|
|
39
42
|
title?: JSX.Element;
|
|
40
43
|
/** Optional aria-label for section grouping. */
|
|
41
|
-
|
|
44
|
+
"aria-label"?: string;
|
|
42
45
|
/** Items contained in the section. */
|
|
43
46
|
items: T[];
|
|
44
47
|
}
|
|
45
48
|
export interface SectionProps extends SlotProps {
|
|
46
49
|
/** Section contents, usually Header + Group/items. */
|
|
47
50
|
children?: JSX.Element;
|
|
51
|
+
/** Ref for the section element. */
|
|
52
|
+
ref?: RefLike<HTMLDivElement>;
|
|
48
53
|
/** The CSS className for the element. */
|
|
49
54
|
class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;
|
|
50
55
|
/** The inline style for the element. */
|
|
@@ -54,7 +59,7 @@ export interface HeaderProps extends SlotProps {
|
|
|
54
59
|
/** Header contents, usually section title text. */
|
|
55
60
|
children?: JSX.Element;
|
|
56
61
|
/** Optional heading level when rendered as a heading role. */
|
|
57
|
-
|
|
62
|
+
"aria-level"?: number;
|
|
58
63
|
/** The CSS className for the element. */
|
|
59
64
|
class?: ClassNameOrFunction<CollectionPrimitiveRenderProps>;
|
|
60
65
|
/** The inline style for the element. */
|
|
@@ -76,18 +81,18 @@ export interface CollectionBranchProps<T> {
|
|
|
76
81
|
collection: Iterable<T>;
|
|
77
82
|
parent?: unknown;
|
|
78
83
|
renderDropIndicator?: (target: {
|
|
79
|
-
type:
|
|
84
|
+
type: "item";
|
|
80
85
|
key: Key;
|
|
81
|
-
dropPosition:
|
|
86
|
+
dropPosition: "before" | "after" | "on";
|
|
82
87
|
}) => JSX.Element | undefined;
|
|
83
88
|
}
|
|
84
89
|
export interface CollectionRootProps<T> {
|
|
85
90
|
collection: Iterable<T>;
|
|
86
91
|
persistedKeys?: Set<Key> | null;
|
|
87
92
|
renderDropIndicator?: (target: {
|
|
88
|
-
type:
|
|
93
|
+
type: "item";
|
|
89
94
|
key: Key;
|
|
90
|
-
dropPosition:
|
|
95
|
+
dropPosition: "before" | "after" | "on";
|
|
91
96
|
}) => JSX.Element | undefined;
|
|
92
97
|
}
|
|
93
98
|
export interface CollectionRenderer<T = unknown> {
|
package/dist/Collection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../src/Collection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["../src/Collection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,GAAG,EAA0D,MAAM,UAAU,CAAC;AAC5F,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OAAO,EAGL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,eAAe,IAAI,mBAAmB,EAC3C,KAAK,sBAAsB,IAAI,0BAA0B,EAC1D,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,SAAS,EAGf,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,8BAA8B;IAC7C,0DAA0D;IAC1D,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,KAAK,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,CAAA;CAAE,GAAG,SAAS,CAAC;AAQzE,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CACpB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,iBAAiB,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,OAAO,GACjD,UAAU,GAAG,IAAI,CAAC;IACrB,gBAAgB,CACd,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,SAAS,EAChB,iBAAiB,EAAE,aAAa,EAAE,GACjC,aAAa,CAAC;IACjB,2BAA2B,CAAC,CAC1B,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,SAAS,EAAE,MAA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