@proyecto-viviana/solid-stately 0.2.7 → 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 +30 -283
- package/dist/autocomplete/createAutocompleteState.d.ts +2 -2
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/calendar/createCalendarState.d.ts +22 -7
- package/dist/calendar/createDateFieldState.d.ts +30 -7
- package/dist/calendar/createDatePickerState.d.ts +60 -0
- package/dist/calendar/createRangeCalendarState.d.ts +27 -8
- package/dist/calendar/createTimeFieldState.d.ts +34 -7
- package/dist/calendar/index.d.ts +7 -6
- package/dist/checkbox/createCheckboxGroupState.d.ts +6 -6
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/collections/ListCollection.d.ts +1 -1
- package/dist/collections/createListState.d.ts +8 -8
- package/dist/collections/createMenuState.d.ts +7 -7
- package/dist/collections/createSelectionState.d.ts +5 -5
- package/dist/collections/index.d.ts +5 -5
- package/dist/collections/types.d.ts +12 -12
- package/dist/color/Color.d.ts +1 -1
- package/dist/color/createColorAreaState.d.ts +4 -2
- package/dist/color/createColorFieldState.d.ts +38 -12
- package/dist/color/createColorSliderState.d.ts +9 -2
- package/dist/color/createColorWheelState.d.ts +13 -2
- package/dist/color/getColorChannels.d.ts +1 -1
- package/dist/color/index.d.ts +6 -6
- package/dist/color/types.d.ts +4 -4
- package/dist/combobox/createComboBoxState.d.ts +27 -13
- package/dist/combobox/index.d.ts +1 -1
- package/dist/data/createAsyncList.d.ts +4 -4
- package/dist/data/createListData.d.ts +2 -2
- package/dist/data/createTreeData.d.ts +6 -2
- package/dist/data/index.d.ts +3 -3
- package/dist/datepicker/index.d.ts +2 -4
- package/dist/disclosure/createDisclosureState.d.ts +2 -2
- package/dist/disclosure/index.d.ts +1 -1
- package/dist/dnd/createDragState.d.ts +2 -2
- package/dist/dnd/createDraggableCollectionState.d.ts +2 -2
- package/dist/dnd/createDropState.d.ts +2 -2
- package/dist/dnd/createDroppableCollectionState.d.ts +3 -3
- package/dist/dnd/index.d.ts +5 -5
- package/dist/dnd/types.d.ts +16 -16
- package/dist/form/createFormValidationState.d.ts +3 -3
- package/dist/form/index.d.ts +1 -1
- package/dist/grid/createGridState.d.ts +2 -2
- package/dist/grid/index.d.ts +2 -2
- package/dist/grid/types.d.ts +13 -11
- package/dist/index.d.ts +31 -30
- package/dist/index.js +7924 -7238
- package/dist/index.js.map +1 -1
- package/dist/menu/index.d.ts +2 -2
- package/dist/numberfield/createNumberFieldState.d.ts +2 -2
- package/dist/numberfield/index.d.ts +1 -1
- package/dist/overlays/createOverlayTriggerState.d.ts +2 -2
- package/dist/overlays/index.d.ts +1 -1
- package/dist/radio/createRadioGroupState.d.ts +7 -7
- package/dist/radio/index.d.ts +1 -1
- package/dist/searchfield/createSearchFieldState.d.ts +2 -2
- package/dist/searchfield/index.d.ts +2 -2
- package/dist/select/createSelectState.d.ts +8 -8
- package/dist/select/index.d.ts +1 -1
- package/dist/selection/index.d.ts +5 -5
- package/dist/slider/createSliderState.d.ts +3 -3
- package/dist/slider/index.d.ts +2 -2
- package/dist/steplist/createStepListState.d.ts +48 -0
- package/dist/steplist/index.d.ts +1 -0
- package/dist/table/TableCollection.d.ts +3 -3
- package/dist/table/createTableColumnResizeState.d.ts +54 -0
- package/dist/table/createTableState.d.ts +2 -2
- package/dist/table/index.d.ts +5 -3
- package/dist/table/types.d.ts +10 -10
- package/dist/tabs/createTabListState.d.ts +5 -5
- package/dist/tabs/index.d.ts +1 -1
- package/dist/textfield/createTextFieldState.d.ts +2 -2
- package/dist/textfield/index.d.ts +1 -1
- package/dist/toast/createToastState.d.ts +8 -2
- package/dist/toast/index.d.ts +1 -1
- package/dist/toggle/createToggleGroupState.d.ts +4 -4
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/index.d.ts +2 -2
- package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tree/TreeCollection.d.ts +2 -2
- package/dist/tree/createTreeState.d.ts +2 -2
- package/dist/tree/index.d.ts +3 -3
- package/dist/tree/types.d.ts +19 -13
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/reactivity.d.ts +1 -1
- package/package.json +29 -30
- package/src/autocomplete/createAutocompleteState.d.ts +19 -17
- package/src/autocomplete/createAutocompleteState.ts +24 -30
- package/src/autocomplete/index.d.ts +6 -2
- package/src/autocomplete/index.ts +1 -1
- package/src/calendar/createCalendarState.d.ts +139 -117
- package/src/calendar/createCalendarState.ts +221 -74
- package/src/calendar/createDateFieldState.d.ts +130 -95
- package/src/calendar/createDateFieldState.ts +263 -151
- package/src/calendar/createDatePickerState.ts +347 -0
- package/src/calendar/createRangeCalendarState.d.ts +154 -129
- package/src/calendar/createRangeCalendarState.ts +293 -79
- package/src/calendar/createTimeFieldState.d.ts +81 -79
- package/src/calendar/createTimeFieldState.ts +187 -108
- package/src/calendar/index.d.ts +80 -7
- package/src/calendar/index.ts +21 -12
- package/src/checkbox/createCheckboxGroupState.d.ts +57 -55
- package/src/checkbox/createCheckboxGroupState.ts +20 -29
- package/src/checkbox/index.d.ts +6 -2
- package/src/checkbox/index.ts +1 -1
- package/src/collections/ListCollection.d.ts +25 -22
- package/src/collections/ListCollection.ts +6 -6
- package/src/collections/createListState.d.ts +73 -58
- package/src/collections/createListState.ts +19 -18
- package/src/collections/createMenuState.d.ts +36 -31
- package/src/collections/createMenuState.ts +18 -12
- package/src/collections/createSelectionState.d.ts +78 -65
- package/src/collections/createSelectionState.ts +36 -32
- package/src/collections/index.d.ts +38 -6
- package/src/collections/index.ts +5 -10
- package/src/collections/types.d.ts +101 -101
- package/src/collections/types.ts +12 -12
- package/src/color/Color.d.ts +20 -5
- package/src/color/Color.ts +357 -254
- package/src/color/createColorAreaState.d.ts +67 -65
- package/src/color/createColorAreaState.ts +21 -13
- package/src/color/createColorFieldState.d.ts +46 -44
- package/src/color/createColorFieldState.ts +285 -149
- package/src/color/createColorSliderState.d.ts +58 -56
- package/src/color/createColorSliderState.ts +45 -14
- package/src/color/createColorWheelState.d.ts +42 -40
- package/src/color/createColorWheelState.ts +101 -64
- package/src/color/getColorChannels.ts +7 -5
- package/src/color/index.d.ts +36 -7
- package/src/color/index.ts +6 -9
- package/src/color/types.d.ts +68 -63
- package/src/color/types.ts +11 -19
- package/src/combobox/createComboBoxState.d.ts +107 -105
- package/src/combobox/createComboBoxState.ts +176 -89
- package/src/combobox/index.d.ts +10 -2
- package/src/combobox/index.ts +1 -1
- package/src/data/createAsyncList.ts +89 -63
- package/src/data/createListData.ts +67 -67
- package/src/data/createTreeData.ts +304 -91
- package/src/data/index.ts +3 -3
- package/src/datepicker/index.ts +6 -10
- package/src/disclosure/createDisclosureState.d.ts +47 -43
- package/src/disclosure/createDisclosureState.ts +7 -21
- package/src/disclosure/index.d.ts +10 -2
- package/src/disclosure/index.ts +1 -1
- package/src/dnd/createDragState.d.ts +51 -42
- package/src/dnd/createDragState.ts +12 -14
- package/src/dnd/createDraggableCollectionState.d.ts +52 -41
- package/src/dnd/createDraggableCollectionState.ts +14 -21
- package/src/dnd/createDropState.d.ts +64 -45
- package/src/dnd/createDropState.ts +22 -32
- package/src/dnd/createDroppableCollectionState.d.ts +88 -59
- package/src/dnd/createDroppableCollectionState.ts +40 -43
- package/src/dnd/index.d.ts +54 -6
- package/src/dnd/index.ts +5 -18
- package/src/dnd/types.d.ts +167 -156
- package/src/dnd/types.ts +20 -21
- package/src/form/createFormValidationState.d.ts +47 -45
- package/src/form/createFormValidationState.ts +30 -63
- package/src/form/index.d.ts +16 -2
- package/src/form/index.ts +1 -1
- package/src/grid/createGridState.d.ts +7 -4
- package/src/grid/createGridState.ts +44 -51
- package/src/grid/index.d.ts +3 -3
- package/src/grid/index.ts +2 -8
- package/src/grid/types.d.ts +136 -129
- package/src/grid/types.ts +20 -18
- package/src/index.d.ts +310 -26
- package/src/index.ts +48 -89
- package/src/menu/index.ts +2 -4
- package/src/numberfield/createNumberFieldState.d.ts +56 -54
- package/src/numberfield/createNumberFieldState.ts +26 -31
- package/src/numberfield/index.d.ts +6 -2
- package/src/numberfield/index.ts +1 -1
- package/src/overlays/createOverlayTriggerState.d.ts +22 -20
- package/src/overlays/createOverlayTriggerState.ts +3 -4
- package/src/overlays/index.d.ts +6 -2
- package/src/overlays/index.ts +1 -1
- package/src/radio/createRadioGroupState.d.ts +54 -52
- package/src/radio/createRadioGroupState.ts +27 -29
- package/src/radio/index.d.ts +7 -2
- package/src/radio/index.ts +1 -1
- package/src/searchfield/createSearchFieldState.d.ts +16 -14
- package/src/searchfield/createSearchFieldState.ts +5 -11
- package/src/searchfield/index.d.ts +3 -3
- package/src/searchfield/index.ts +2 -5
- package/src/select/createSelectState.d.ts +63 -61
- package/src/select/createSelectState.ts +27 -27
- package/src/select/index.d.ts +2 -2
- package/src/select/index.ts +1 -5
- package/src/selection/index.ts +6 -7
- package/src/slider/createSliderState.d.ts +60 -60
- package/src/slider/createSliderState.ts +55 -33
- package/src/slider/index.d.ts +3 -3
- package/src/slider/index.ts +2 -6
- package/src/ssr/index.d.ts +1 -1
- package/src/ssr/index.ts +2 -2
- package/src/steplist/createStepListState.ts +191 -0
- package/src/steplist/index.ts +5 -0
- package/src/table/TableCollection.d.ts +42 -40
- package/src/table/TableCollection.ts +61 -64
- package/src/table/createTableColumnResizeState.ts +242 -0
- package/src/table/createTableState.d.ts +7 -4
- package/src/table/createTableState.ts +10 -7
- package/src/table/index.d.ts +14 -4
- package/src/table/index.ts +10 -3
- package/src/table/types.d.ts +98 -92
- package/src/table/types.ts +17 -13
- package/src/tabs/createTabListState.d.ts +59 -57
- package/src/tabs/createTabListState.ts +24 -31
- package/src/tabs/index.d.ts +8 -2
- package/src/tabs/index.ts +1 -1
- package/src/textfield/createTextFieldState.d.ts +16 -14
- package/src/textfield/createTextFieldState.ts +7 -18
- package/src/textfield/index.d.ts +6 -2
- package/src/textfield/index.ts +1 -1
- package/src/toast/createToastState.d.ts +92 -86
- package/src/toast/createToastState.ts +48 -43
- package/src/toast/index.d.ts +12 -2
- package/src/toast/index.ts +1 -1
- package/src/toggle/createToggleGroupState.ts +11 -21
- package/src/toggle/createToggleState.d.ts +19 -19
- package/src/toggle/createToggleState.ts +2 -16
- package/src/toggle/index.d.ts +2 -2
- package/src/toggle/index.ts +2 -6
- package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
- package/src/tooltip/createTooltipTriggerState.ts +12 -11
- package/src/tooltip/index.d.ts +7 -2
- package/src/tooltip/index.ts +1 -1
- package/src/tree/TreeCollection.d.ts +26 -23
- package/src/tree/TreeCollection.ts +29 -22
- package/src/tree/createTreeState.d.ts +7 -4
- package/src/tree/createTreeState.ts +39 -41
- package/src/tree/index.d.ts +10 -4
- package/src/tree/index.ts +3 -3
- package/src/tree/types.d.ts +131 -126
- package/src/tree/types.ts +22 -13
- package/src/utils/index.d.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/reactivity.d.ts +2 -2
- package/src/utils/reactivity.ts +3 -3
|
@@ -4,12 +4,13 @@
|
|
|
4
4
|
* Provides state management for time field components with segment-based editing.
|
|
5
5
|
* Based on @react-stately/datepicker useTimeFieldState
|
|
6
6
|
*/
|
|
7
|
-
import { type Accessor } from
|
|
8
|
-
import { type Time, type CalendarDateTime, type ZonedDateTime } from
|
|
9
|
-
import { type MaybeAccessor } from
|
|
10
|
-
import type { ValidationState } from
|
|
7
|
+
import { type Accessor } from "solid-js";
|
|
8
|
+
import { type Time, type CalendarDateTime, type ZonedDateTime, type DateValue } from "@internationalized/date";
|
|
9
|
+
import { type MaybeAccessor } from "../utils";
|
|
10
|
+
import type { ValidationState } from "./createCalendarState";
|
|
11
|
+
import { type ValidationBehavior, type ValidationFunction, type ValidationResult } from "../form";
|
|
11
12
|
export type TimeValue = Time | CalendarDateTime | ZonedDateTime;
|
|
12
|
-
export type TimeSegmentType =
|
|
13
|
+
export type TimeSegmentType = "hour" | "minute" | "second" | "dayPeriod" | "literal";
|
|
13
14
|
export interface TimeSegment {
|
|
14
15
|
/** The type of segment. */
|
|
15
16
|
type: TimeSegmentType;
|
|
@@ -45,20 +46,36 @@ export interface TimeFieldStateProps<T extends TimeValue = Time> {
|
|
|
45
46
|
isReadOnly?: MaybeAccessor<boolean>;
|
|
46
47
|
/** Whether the field is required. */
|
|
47
48
|
isRequired?: MaybeAccessor<boolean>;
|
|
49
|
+
/** Whether the value is invalid (controlled). */
|
|
50
|
+
isInvalid?: boolean;
|
|
48
51
|
/** The locale to use for formatting. */
|
|
49
52
|
locale?: string;
|
|
50
53
|
/** The granularity (hour, minute, second). */
|
|
51
|
-
granularity?:
|
|
54
|
+
granularity?: "hour" | "minute" | "second";
|
|
52
55
|
/** Whether to show 12 or 24 hour format. */
|
|
53
56
|
hourCycle?: 12 | 24;
|
|
57
|
+
/** Whether to force leading zeroes in the hour segment. */
|
|
58
|
+
shouldForceLeadingZeros?: boolean;
|
|
54
59
|
/** Validation state. */
|
|
55
60
|
validationState?: MaybeAccessor<ValidationState | undefined>;
|
|
61
|
+
/** Validation behavior mode. */
|
|
62
|
+
validationBehavior?: ValidationBehavior;
|
|
63
|
+
/** Custom validation function. */
|
|
64
|
+
validate?: ValidationFunction<T>;
|
|
65
|
+
/** Description text. */
|
|
66
|
+
description?: string;
|
|
67
|
+
/** Error message. */
|
|
68
|
+
errorMessage?: string;
|
|
56
69
|
/** The placeholder value. */
|
|
57
70
|
placeholderValue?: T;
|
|
71
|
+
/** Whether dates outside the min/max range are unavailable. Added for API consistency. */
|
|
72
|
+
isDateUnavailable?: (date: DateValue) => boolean;
|
|
58
73
|
}
|
|
59
74
|
export interface TimeFieldState<T extends TimeValue = Time> {
|
|
60
75
|
/** The current value. */
|
|
61
76
|
value: Accessor<T | null>;
|
|
77
|
+
/** The default value. */
|
|
78
|
+
defaultValue: T | null;
|
|
62
79
|
/** Sets the value. */
|
|
63
80
|
setValue: (value: T | null) => void;
|
|
64
81
|
/** The segments that make up the time. */
|
|
@@ -80,9 +97,19 @@ export interface TimeFieldState<T extends TimeValue = Time> {
|
|
|
80
97
|
/** The validation state. */
|
|
81
98
|
validationState: Accessor<ValidationState | undefined>;
|
|
82
99
|
/** The granularity. */
|
|
83
|
-
granularity:
|
|
100
|
+
granularity: "hour" | "minute" | "second";
|
|
84
101
|
/** Whether the value is invalid. */
|
|
85
102
|
isInvalid: Accessor<boolean>;
|
|
103
|
+
/** Realtime validation results, including native and custom constraints. */
|
|
104
|
+
realtimeValidation: Accessor<ValidationResult>;
|
|
105
|
+
/** Currently displayed validation results. */
|
|
106
|
+
displayValidation: Accessor<ValidationResult>;
|
|
107
|
+
/** Updates the current validation result. */
|
|
108
|
+
updateValidation: (result: ValidationResult) => void;
|
|
109
|
+
/** Resets displayed validation to valid. */
|
|
110
|
+
resetValidation: () => void;
|
|
111
|
+
/** Commits realtime validation to displayed validation. */
|
|
112
|
+
commitValidation: () => void;
|
|
86
113
|
/** The locale. */
|
|
87
114
|
locale: string;
|
|
88
115
|
/** The hour cycle. */
|
package/dist/calendar/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { createCalendarState, type CalendarStateProps, type CalendarState, type ValidationState, } from
|
|
2
|
-
export { createRangeCalendarState, type RangeCalendarStateProps, type RangeCalendarState, type DateRange, type RangeValue, } from
|
|
3
|
-
export { createDateFieldState, type DateFieldStateProps, type DateFieldState, type DateSegment, type DateSegmentType, } from
|
|
4
|
-
export { createTimeFieldState, type TimeFieldStateProps, type TimeFieldState, type TimeSegment, type TimeSegmentType, type TimeValue, } from
|
|
5
|
-
export
|
|
6
|
-
export {
|
|
1
|
+
export { createCalendarState, type CalendarStateProps, type CalendarState, type ValidationState, type CalendarPageBehavior, type CalendarSelectionAlignment, type CalendarDayOfWeek, } from "./createCalendarState";
|
|
2
|
+
export { createRangeCalendarState, type RangeCalendarStateProps, type RangeCalendarState, type DateRange, type RangeValue, } from "./createRangeCalendarState";
|
|
3
|
+
export { createDateFieldState, type DateFieldStateProps, type DateFieldState, type DateSegment, type DateSegmentType, } from "./createDateFieldState";
|
|
4
|
+
export { createTimeFieldState, type TimeFieldStateProps, type TimeFieldState, type TimeSegment, type TimeSegmentType, type TimeValue, } from "./createTimeFieldState";
|
|
5
|
+
export { createDatePickerState, type DatePickerStateOptions, type DatePickerState, } from "./createDatePickerState";
|
|
6
|
+
export type { CalendarDate, CalendarDateTime, ZonedDateTime, DateValue, Time, Calendar, CalendarIdentifier, AnyCalendarDate, } from "@internationalized/date";
|
|
7
|
+
export { createCalendar, GregorianCalendar, today, now, getLocalTimeZone, parseDate, parseDateTime, parseTime, parseAbsolute, parseAbsoluteToLocal, parseZonedDateTime, toCalendarDate, toCalendarDateTime, toZoned, toTime, CalendarDate as CalendarDateClass, CalendarDateTime as CalendarDateTimeClass, ZonedDateTime as ZonedDateTimeClass, Time as TimeClass, DateFormatter, isSameDay, isSameMonth, isSameYear, isToday, isWeekend, startOfMonth, endOfMonth, startOfWeek, endOfWeek, startOfYear, endOfYear, getWeeksInMonth, getDayOfWeek, toCalendar, minDate, maxDate, } from "@internationalized/date";
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This is a 1:1 port of @react-stately/checkbox's useCheckboxGroupState.
|
|
8
8
|
*/
|
|
9
|
-
import { Accessor } from
|
|
10
|
-
import { type MaybeAccessor } from
|
|
11
|
-
import { type FormValidationState, type ValidationFunction, type ValidationResult } from
|
|
9
|
+
import { Accessor } from "solid-js";
|
|
10
|
+
import { type MaybeAccessor } from "../utils";
|
|
11
|
+
import { type FormValidationState, type ValidationFunction, type ValidationResult } from "../form";
|
|
12
12
|
export interface CheckboxGroupProps {
|
|
13
13
|
/** The current selected values (controlled). */
|
|
14
14
|
value?: string[];
|
|
@@ -37,13 +37,13 @@ export interface CheckboxGroupProps {
|
|
|
37
37
|
/** Handler that is called when the checkbox group's focus status changes. */
|
|
38
38
|
onFocusChange?: (isFocused: boolean) => void;
|
|
39
39
|
/** Backward-compatible controlled validation state. */
|
|
40
|
-
validationState?:
|
|
40
|
+
validationState?: "valid" | "invalid";
|
|
41
41
|
/** Custom validation function. */
|
|
42
42
|
validate?: ValidationFunction<readonly string[]>;
|
|
43
43
|
/** Validation behavior for the checkbox group. */
|
|
44
|
-
validationBehavior?:
|
|
44
|
+
validationBehavior?: "aria" | "native";
|
|
45
45
|
}
|
|
46
|
-
export interface CheckboxGroupState extends Pick<FormValidationState,
|
|
46
|
+
export interface CheckboxGroupState extends Pick<FormValidationState, "realtimeValidation" | "displayValidation" | "updateValidation" | "resetValidation" | "commitValidation"> {
|
|
47
47
|
/** Current selected values. */
|
|
48
48
|
readonly value: Accessor<readonly string[]>;
|
|
49
49
|
/** Default selected values. */
|
package/dist/checkbox/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createCheckboxGroupState, type CheckboxGroupProps, type CheckboxGroupState, } from
|
|
1
|
+
export { createCheckboxGroupState, type CheckboxGroupProps, type CheckboxGroupState, } from "./createCheckboxGroupState";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* A simple list collection implementation.
|
|
3
3
|
* Provides a Collection interface over an array of nodes.
|
|
4
4
|
*/
|
|
5
|
-
import type { Collection, CollectionNode, Key } from
|
|
5
|
+
import type { Collection, CollectionNode, Key } from "./types";
|
|
6
6
|
/**
|
|
7
7
|
* A basic implementation of Collection for list-based components.
|
|
8
8
|
*/
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Combines collection and selection state.
|
|
4
4
|
* Based on @react-stately/list.
|
|
5
5
|
*/
|
|
6
|
-
import { type Accessor } from
|
|
7
|
-
import { type MaybeAccessor } from
|
|
8
|
-
import { type SelectionState } from
|
|
9
|
-
import type { Collection, CollectionNode, DisabledBehavior, FocusStrategy, Key, SelectionBehavior, SelectionMode } from
|
|
6
|
+
import { type Accessor } from "solid-js";
|
|
7
|
+
import { type MaybeAccessor } from "../utils";
|
|
8
|
+
import { type SelectionState } from "./createSelectionState";
|
|
9
|
+
import type { Collection, CollectionNode, DisabledBehavior, FocusStrategy, Key, SelectionBehavior, SelectionMode } from "./types";
|
|
10
10
|
export interface ListStateProps<T = unknown> {
|
|
11
11
|
/** The items in the list (for dynamic rendering). */
|
|
12
12
|
items?: T[];
|
|
@@ -27,11 +27,11 @@ export interface ListStateProps<T = unknown> {
|
|
|
27
27
|
/** Whether empty selection is disallowed. */
|
|
28
28
|
disallowEmptySelection?: boolean;
|
|
29
29
|
/** Currently selected keys (controlled). */
|
|
30
|
-
selectedKeys?:
|
|
30
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
31
31
|
/** Default selected keys (uncontrolled). */
|
|
32
|
-
defaultSelectedKeys?:
|
|
32
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
33
33
|
/** Handler for selection changes. */
|
|
34
|
-
onSelectionChange?: (keys:
|
|
34
|
+
onSelectionChange?: (keys: "all" | Set<Key>) => void;
|
|
35
35
|
/** Whether to allow duplicate selection events. */
|
|
36
36
|
allowDuplicateSelectionEvents?: boolean;
|
|
37
37
|
}
|
|
@@ -56,7 +56,7 @@ export declare function createListState<T = unknown>(props: MaybeAccessor<ListSt
|
|
|
56
56
|
/**
|
|
57
57
|
* Props for single selection list state.
|
|
58
58
|
*/
|
|
59
|
-
export interface SingleSelectListStateProps<T = unknown> extends Omit<ListStateProps<T>,
|
|
59
|
+
export interface SingleSelectListStateProps<T = unknown> extends Omit<ListStateProps<T>, "selectionMode" | "selectedKeys" | "defaultSelectedKeys" | "onSelectionChange"> {
|
|
60
60
|
/** The currently selected key (controlled). */
|
|
61
61
|
selectedKey?: Key | null;
|
|
62
62
|
/** The default selected key (uncontrolled). */
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* State management for menu components.
|
|
3
3
|
* Based on @react-stately/menu.
|
|
4
4
|
*/
|
|
5
|
-
import { type MaybeAccessor } from
|
|
6
|
-
import { type ListState, type ListStateProps } from
|
|
7
|
-
import type { Key } from
|
|
8
|
-
export interface MenuStateProps<T = unknown> extends
|
|
5
|
+
import { type MaybeAccessor } from "../utils";
|
|
6
|
+
import { type ListState, type ListStateProps } from "./createListState";
|
|
7
|
+
import type { Key } from "./types";
|
|
8
|
+
export interface MenuStateProps<T = unknown> extends ListStateProps<T> {
|
|
9
9
|
/** Handler called when an item is activated (pressed). */
|
|
10
10
|
onAction?: (key: Key) => void;
|
|
11
11
|
/** Handler called when the menu should close. */
|
|
@@ -38,12 +38,12 @@ export interface MenuTriggerState {
|
|
|
38
38
|
/** Toggle the menu. */
|
|
39
39
|
toggle(): void;
|
|
40
40
|
/** Focus strategy for when the menu opens. */
|
|
41
|
-
readonly focusStrategy: () =>
|
|
41
|
+
readonly focusStrategy: () => "first" | "last" | null;
|
|
42
42
|
/** Set the focus strategy. */
|
|
43
|
-
setFocusStrategy(strategy:
|
|
43
|
+
setFocusStrategy(strategy: "first" | "last" | null): void;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Creates state for a menu trigger (button that opens a menu).
|
|
47
47
|
* This is essentially the same as overlay trigger state but with focus strategy.
|
|
48
48
|
*/
|
|
49
|
-
export { createOverlayTriggerState as createMenuTriggerState } from
|
|
49
|
+
export { createOverlayTriggerState as createMenuTriggerState } from "../overlays";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Selection state management for collections.
|
|
3
3
|
* Based on @react-stately/selection.
|
|
4
4
|
*/
|
|
5
|
-
import { type Accessor } from
|
|
6
|
-
import { type MaybeAccessor } from
|
|
7
|
-
import type { Collection, DisabledBehavior, Key, Selection, SelectionBehavior, SelectionMode } from
|
|
5
|
+
import { type Accessor } from "solid-js";
|
|
6
|
+
import { type MaybeAccessor } from "../utils";
|
|
7
|
+
import type { Collection, DisabledBehavior, Key, Selection, SelectionBehavior, SelectionMode } from "./types";
|
|
8
8
|
export interface SelectionStateProps {
|
|
9
9
|
/** The selection mode. */
|
|
10
10
|
selectionMode?: SelectionMode;
|
|
@@ -13,9 +13,9 @@ export interface SelectionStateProps {
|
|
|
13
13
|
/** Whether empty selection is disallowed. */
|
|
14
14
|
disallowEmptySelection?: boolean;
|
|
15
15
|
/** Currently selected keys (controlled). */
|
|
16
|
-
selectedKeys?:
|
|
16
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
17
17
|
/** Default selected keys (uncontrolled). */
|
|
18
|
-
defaultSelectedKeys?:
|
|
18
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
19
19
|
/** Handler for selection changes. */
|
|
20
20
|
onSelectionChange?: (keys: Selection) => void;
|
|
21
21
|
/** Keys of disabled items. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { Key, SelectionMode, SelectionBehavior, Selection, FocusStrategy, DisabledBehavior, CollectionNode, Collection, ItemProps, SectionProps, CollectionBase, SingleSelection, MultipleSelection, } from
|
|
2
|
-
export { ListCollection, createListCollection } from
|
|
3
|
-
export { createSelectionState, type SelectionStateProps, type SelectionState, } from
|
|
4
|
-
export { createListState, createSingleSelectListState, type ListStateProps, type ListState, type SingleSelectListStateProps, type SingleSelectListState, } from
|
|
5
|
-
export { createMenuState, createMenuTriggerState, type MenuStateProps, type MenuState, type MenuTriggerStateProps, type MenuTriggerState, } from
|
|
1
|
+
export type { Key, SelectionMode, SelectionBehavior, Selection, FocusStrategy, DisabledBehavior, CollectionNode, Collection, ItemProps, SectionProps, CollectionBase, SingleSelection, MultipleSelection, } from "./types";
|
|
2
|
+
export { ListCollection, createListCollection } from "./ListCollection";
|
|
3
|
+
export { createSelectionState, type SelectionStateProps, type SelectionState, } from "./createSelectionState";
|
|
4
|
+
export { createListState, createSingleSelectListState, type ListStateProps, type ListState, type SingleSelectListStateProps, type SingleSelectListState, } from "./createListState";
|
|
5
|
+
export { createMenuState, createMenuTriggerState, type MenuStateProps, type MenuState, type MenuTriggerStateProps, type MenuTriggerState, } from "./createMenuState";
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
* Core types for collection state management.
|
|
3
3
|
* Simplified from @react-stately/collections for SolidJS.
|
|
4
4
|
*/
|
|
5
|
-
import type { JSX } from
|
|
5
|
+
import type { JSX } from "solid-js";
|
|
6
6
|
/** A unique identifier for an item in a collection. */
|
|
7
7
|
export type Key = string | number;
|
|
8
8
|
/** The type of selection allowed in a collection. */
|
|
9
|
-
export type SelectionMode =
|
|
9
|
+
export type SelectionMode = "none" | "single" | "multiple";
|
|
10
10
|
/** How selection behaves when clicking on items. */
|
|
11
|
-
export type SelectionBehavior =
|
|
11
|
+
export type SelectionBehavior = "toggle" | "replace";
|
|
12
12
|
/** Represents the current selection state. */
|
|
13
|
-
export type Selection =
|
|
13
|
+
export type Selection = "all" | Set<Key>;
|
|
14
14
|
/** Strategy for focusing first or last item. */
|
|
15
|
-
export type FocusStrategy =
|
|
15
|
+
export type FocusStrategy = "first" | "last";
|
|
16
16
|
/** Whether disabled keys affect selection, actions, or both. */
|
|
17
|
-
export type DisabledBehavior =
|
|
17
|
+
export type DisabledBehavior = "selection" | "all";
|
|
18
18
|
/**
|
|
19
19
|
* Represents a node in a collection (item or section).
|
|
20
20
|
*/
|
|
21
21
|
export interface CollectionNode<T = unknown> {
|
|
22
22
|
/** The type of node: 'item' or 'section'. */
|
|
23
|
-
type:
|
|
23
|
+
type: "item" | "section";
|
|
24
24
|
/** A unique key for the node. */
|
|
25
25
|
key: Key;
|
|
26
26
|
/** The original value/data for this node. */
|
|
@@ -42,7 +42,7 @@ export interface CollectionNode<T = unknown> {
|
|
|
42
42
|
/** Whether this item is disabled. */
|
|
43
43
|
isDisabled?: boolean;
|
|
44
44
|
/** ARIA label for this node. */
|
|
45
|
-
|
|
45
|
+
"aria-label"?: string;
|
|
46
46
|
/** Additional props for the node. */
|
|
47
47
|
props?: Record<string, unknown>;
|
|
48
48
|
}
|
|
@@ -95,7 +95,7 @@ export interface ItemProps<T = unknown> {
|
|
|
95
95
|
/** The rendered content of the item. */
|
|
96
96
|
children?: JSX.Element;
|
|
97
97
|
/** ARIA label for the item. */
|
|
98
|
-
|
|
98
|
+
"aria-label"?: string;
|
|
99
99
|
/** The original value for dynamic collections. */
|
|
100
100
|
value?: T;
|
|
101
101
|
}
|
|
@@ -108,7 +108,7 @@ export interface SectionProps<T = unknown> {
|
|
|
108
108
|
/** The section header/title. */
|
|
109
109
|
title?: JSX.Element;
|
|
110
110
|
/** ARIA label for the section. */
|
|
111
|
-
|
|
111
|
+
"aria-label"?: string;
|
|
112
112
|
/** The items in this section. */
|
|
113
113
|
children?: JSX.Element;
|
|
114
114
|
/** Items for dynamic rendering. */
|
|
@@ -147,9 +147,9 @@ export interface MultipleSelection {
|
|
|
147
147
|
/** Whether empty selection is allowed. */
|
|
148
148
|
disallowEmptySelection?: boolean;
|
|
149
149
|
/** The currently selected keys (controlled). */
|
|
150
|
-
selectedKeys?:
|
|
150
|
+
selectedKeys?: "all" | Iterable<Key>;
|
|
151
151
|
/** The default selected keys (uncontrolled). */
|
|
152
|
-
defaultSelectedKeys?:
|
|
152
|
+
defaultSelectedKeys?: "all" | Iterable<Key>;
|
|
153
153
|
/** Handler called when selection changes. */
|
|
154
154
|
onSelectionChange?: (keys: Selection) => void;
|
|
155
155
|
/** Keys of disabled items. */
|
package/dist/color/Color.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* ColorArea state management.
|
|
3
3
|
* Based on @react-stately/color useColorAreaState.
|
|
4
4
|
*/
|
|
5
|
-
import { type Accessor } from
|
|
6
|
-
import type { Color, ColorChannel } from
|
|
5
|
+
import { type Accessor } from "solid-js";
|
|
6
|
+
import type { Color, ColorChannel, ColorSpace } from "./types";
|
|
7
7
|
export interface ColorAreaStateOptions {
|
|
8
8
|
/** The current color value (controlled). */
|
|
9
9
|
value?: Color | string;
|
|
@@ -17,6 +17,8 @@ export interface ColorAreaStateOptions {
|
|
|
17
17
|
xChannel?: ColorChannel;
|
|
18
18
|
/** The color channel for the Y axis. */
|
|
19
19
|
yChannel?: ColorChannel;
|
|
20
|
+
/** The color space to use for the color area. */
|
|
21
|
+
colorSpace?: ColorSpace;
|
|
20
22
|
/** Whether the area is disabled. */
|
|
21
23
|
isDisabled?: boolean;
|
|
22
24
|
}
|
|
@@ -1,52 +1,78 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ColorField state management.
|
|
3
|
-
* Based on @react-stately/color useColorFieldState.
|
|
3
|
+
* Based on @react-stately/color useColorFieldState and useColorChannelFieldState.
|
|
4
4
|
*/
|
|
5
|
-
import { type Accessor } from
|
|
6
|
-
import type { Color, ColorChannel, ColorFormat } from
|
|
5
|
+
import { type Accessor } from "solid-js";
|
|
6
|
+
import type { Color, ColorChannel, ColorFormat, ColorSpace } from "./types";
|
|
7
7
|
export interface ColorFieldStateOptions {
|
|
8
8
|
/** The current color value (controlled). */
|
|
9
9
|
value?: Color | string | null;
|
|
10
10
|
/** The default color value (uncontrolled). */
|
|
11
|
-
defaultValue?: Color | string;
|
|
11
|
+
defaultValue?: Color | string | null;
|
|
12
12
|
/** Handler called when the color changes. */
|
|
13
13
|
onChange?: (color: Color | null) => void;
|
|
14
14
|
/** The color channel to edit (for single channel mode). */
|
|
15
15
|
channel?: ColorChannel;
|
|
16
|
-
/** The color
|
|
16
|
+
/** The color space to use for channel mode. */
|
|
17
|
+
colorSpace?: ColorSpace;
|
|
18
|
+
/** The color format for parsing/displaying in hex mode. */
|
|
17
19
|
colorFormat?: ColorFormat;
|
|
20
|
+
/** Locale used to format channel values. */
|
|
21
|
+
locale?: string;
|
|
18
22
|
/** Whether the field is disabled. */
|
|
19
23
|
isDisabled?: boolean;
|
|
20
24
|
/** Whether the field is read-only. */
|
|
21
25
|
isReadOnly?: boolean;
|
|
26
|
+
/** Whether the field is invalid. */
|
|
27
|
+
isInvalid?: boolean;
|
|
28
|
+
/** Whether the field is required. */
|
|
29
|
+
isRequired?: boolean;
|
|
22
30
|
}
|
|
23
31
|
export interface ColorFieldState {
|
|
24
|
-
/** The current color value (null if
|
|
32
|
+
/** The current color value (null if empty). */
|
|
25
33
|
readonly value: Color | null;
|
|
34
|
+
/** The color used for channel calculations. */
|
|
35
|
+
readonly colorValue: Color;
|
|
26
36
|
/** The current input text. */
|
|
27
37
|
readonly inputValue: string;
|
|
38
|
+
/** The numeric value exposed by channel fields. */
|
|
39
|
+
readonly numberValue: number;
|
|
40
|
+
/** The channel minimum value after formatting normalization. */
|
|
41
|
+
readonly minValue: number;
|
|
42
|
+
/** The channel maximum value after formatting normalization. */
|
|
43
|
+
readonly maxValue: number;
|
|
44
|
+
/** The channel keyboard step after formatting normalization. */
|
|
45
|
+
readonly step: number;
|
|
46
|
+
/** The channel page step after formatting normalization. */
|
|
47
|
+
readonly pageSize: number;
|
|
48
|
+
/** Number formatter options for channel fields. */
|
|
49
|
+
readonly formatOptions: Intl.NumberFormatOptions;
|
|
28
50
|
/** Whether the input is invalid. */
|
|
29
51
|
readonly isInvalid: boolean;
|
|
30
52
|
/** Whether the field is disabled. */
|
|
31
53
|
readonly isDisabled: boolean;
|
|
32
54
|
/** Whether the field is read-only. */
|
|
33
55
|
readonly isReadOnly: boolean;
|
|
56
|
+
/** Whether the field is required. */
|
|
57
|
+
readonly isRequired: boolean;
|
|
34
58
|
/** The color channel being edited (if single channel mode). */
|
|
35
59
|
readonly channel: ColorChannel | undefined;
|
|
36
60
|
/** Set the input text value. */
|
|
37
61
|
setInputValue(value: string): void;
|
|
62
|
+
/** Set the color value. */
|
|
63
|
+
setColorValue(value: Color | null): void;
|
|
38
64
|
/** Commit the current input value. */
|
|
39
65
|
commit(): void;
|
|
40
|
-
/** Increment the color
|
|
66
|
+
/** Increment the color value. */
|
|
41
67
|
increment(): void;
|
|
42
|
-
/** Decrement the color
|
|
68
|
+
/** Decrement the color value. */
|
|
43
69
|
decrement(): void;
|
|
44
|
-
/** Increment by page size. */
|
|
70
|
+
/** Increment by page size or to the maximum. */
|
|
45
71
|
incrementToMax(): void;
|
|
46
|
-
/** Decrement to minimum. */
|
|
72
|
+
/** Decrement by page size or to the minimum. */
|
|
47
73
|
decrementToMin(): void;
|
|
48
|
-
/** Validate the current input. */
|
|
49
|
-
validate(): boolean;
|
|
74
|
+
/** Validate the current input or a candidate input. */
|
|
75
|
+
validate(value?: string): boolean;
|
|
50
76
|
}
|
|
51
77
|
/**
|
|
52
78
|
* Creates state for a color field (text input for color values).
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* ColorSlider state management.
|
|
3
3
|
* Based on @react-stately/color useColorSliderState.
|
|
4
4
|
*/
|
|
5
|
-
import { type Accessor } from
|
|
6
|
-
import type { Color, ColorChannel } from
|
|
5
|
+
import { type Accessor } from "solid-js";
|
|
6
|
+
import type { Color, ColorChannel, ColorSpace } from "./types";
|
|
7
|
+
export type ColorSliderOrientation = "horizontal" | "vertical";
|
|
7
8
|
export interface ColorSliderStateOptions {
|
|
8
9
|
/** The current color value (controlled). */
|
|
9
10
|
value?: Color | string;
|
|
@@ -15,6 +16,10 @@ export interface ColorSliderStateOptions {
|
|
|
15
16
|
onChangeEnd?: (color: Color) => void;
|
|
16
17
|
/** The color channel this slider controls. */
|
|
17
18
|
channel: ColorChannel;
|
|
19
|
+
/** The color space to use for channel values. */
|
|
20
|
+
colorSpace?: ColorSpace;
|
|
21
|
+
/** The slider orientation. */
|
|
22
|
+
orientation?: ColorSliderOrientation;
|
|
18
23
|
/** Whether the slider is disabled. */
|
|
19
24
|
isDisabled?: boolean;
|
|
20
25
|
/** The locale for formatting. */
|
|
@@ -27,6 +32,8 @@ export interface ColorSliderState {
|
|
|
27
32
|
readonly isDragging: boolean;
|
|
28
33
|
/** The color channel being controlled. */
|
|
29
34
|
readonly channel: ColorChannel;
|
|
35
|
+
/** The slider orientation. */
|
|
36
|
+
readonly orientation: ColorSliderOrientation;
|
|
30
37
|
/** The step value for the channel. */
|
|
31
38
|
readonly step: number;
|
|
32
39
|
/** The page step value for the channel. */
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* ColorWheel state management.
|
|
3
3
|
* Based on @react-stately/color useColorWheelState.
|
|
4
4
|
*/
|
|
5
|
-
import { type Accessor } from
|
|
6
|
-
import type { Color } from
|
|
5
|
+
import { type Accessor } from "solid-js";
|
|
6
|
+
import type { Color } from "./types";
|
|
7
7
|
export interface ColorWheelStateOptions {
|
|
8
8
|
/** The current color value (controlled). */
|
|
9
9
|
value?: Color | string;
|
|
@@ -19,6 +19,8 @@ export interface ColorWheelStateOptions {
|
|
|
19
19
|
export interface ColorWheelState {
|
|
20
20
|
/** The current color value. */
|
|
21
21
|
readonly value: Color;
|
|
22
|
+
/** The initial color value. */
|
|
23
|
+
readonly defaultValue: Color;
|
|
22
24
|
/** Whether the wheel is being dragged. */
|
|
23
25
|
readonly isDragging: boolean;
|
|
24
26
|
/** Whether the wheel is disabled. */
|
|
@@ -29,12 +31,21 @@ export interface ColorWheelState {
|
|
|
29
31
|
readonly pageStep: number;
|
|
30
32
|
/** Get the current hue value (0-360). */
|
|
31
33
|
getHue(): number;
|
|
34
|
+
/** Set the full color value. */
|
|
35
|
+
setValue(value: Color | string): void;
|
|
32
36
|
/** Set the hue value. */
|
|
33
37
|
setHue(value: number): void;
|
|
34
38
|
/** Set hue from an angle in radians. */
|
|
35
39
|
setHueFromAngle(angle: number): void;
|
|
40
|
+
/** Set hue from a point relative to the wheel center. */
|
|
41
|
+
setHueFromPoint(x: number, y: number, radius: number): void;
|
|
36
42
|
/** Get the thumb angle in radians (0 = right, increases counterclockwise). */
|
|
37
43
|
getThumbAngle(): number;
|
|
44
|
+
/** Get the thumb position relative to the wheel center. */
|
|
45
|
+
getThumbPosition(radius: number): {
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
};
|
|
38
49
|
/** Increment hue value. */
|
|
39
50
|
increment(stepSize?: number): void;
|
|
40
51
|
/** Decrement hue value. */
|
package/dist/color/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Color state management exports.
|
|
3
3
|
*/
|
|
4
|
-
export type { Color, ColorFormat, ColorSpace, ColorChannel, ColorChannelRange, ColorAxes, } from
|
|
5
|
-
export { parseColor, normalizeColor, createRGBColor, createHSLColor, createHSBColor, } from
|
|
6
|
-
export { createColorSliderState, type ColorSliderStateOptions, type ColorSliderState, } from
|
|
7
|
-
export { createColorAreaState, type ColorAreaStateOptions, type ColorAreaState, } from
|
|
8
|
-
export { createColorWheelState, type ColorWheelStateOptions, type ColorWheelState, } from
|
|
9
|
-
export { createColorFieldState, type ColorFieldStateOptions, type ColorFieldState, } from
|
|
4
|
+
export type { Color, ColorFormat, ColorSpace, ColorChannel, ColorChannelRange, ColorAxes, } from "./types";
|
|
5
|
+
export { parseColor, normalizeColor, createRGBColor, createHSLColor, createHSBColor, } from "./Color";
|
|
6
|
+
export { createColorSliderState, type ColorSliderStateOptions, type ColorSliderState, } from "./createColorSliderState";
|
|
7
|
+
export { createColorAreaState, type ColorAreaStateOptions, type ColorAreaState, } from "./createColorAreaState";
|
|
8
|
+
export { createColorWheelState, type ColorWheelStateOptions, type ColorWheelState, } from "./createColorWheelState";
|
|
9
|
+
export { createColorFieldState, type ColorFieldStateOptions, type ColorFieldState, } from "./createColorFieldState";
|
package/dist/color/types.d.ts
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Supported color formats.
|
|
7
7
|
*/
|
|
8
|
-
export type ColorFormat =
|
|
8
|
+
export type ColorFormat = "hex" | "hexa" | "rgb" | "rgba" | "hsl" | "hsla" | "hsb" | "hsba";
|
|
9
9
|
/**
|
|
10
10
|
* Color spaces.
|
|
11
11
|
*/
|
|
12
|
-
export type ColorSpace =
|
|
12
|
+
export type ColorSpace = "rgb" | "hsl" | "hsb";
|
|
13
13
|
/**
|
|
14
14
|
* Color channels.
|
|
15
15
|
*/
|
|
16
|
-
export type ColorChannel =
|
|
16
|
+
export type ColorChannel = "hue" | "saturation" | "brightness" | "lightness" | "red" | "green" | "blue" | "alpha";
|
|
17
17
|
/**
|
|
18
18
|
* Range for a color channel.
|
|
19
19
|
*/
|
|
@@ -45,7 +45,7 @@ export interface Color {
|
|
|
45
45
|
/** Convert to a different format. */
|
|
46
46
|
toFormat(format: ColorFormat): Color;
|
|
47
47
|
/** Convert to a CSS string. */
|
|
48
|
-
toString(format?: ColorFormat |
|
|
48
|
+
toString(format?: ColorFormat | "css"): string;
|
|
49
49
|
/** Clone this color. */
|
|
50
50
|
clone(): Color;
|
|
51
51
|
/** Get the hex value as an integer. */
|