@proyecto-viviana/solid-stately 0.2.4 → 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/LICENSE +21 -0
- package/README.md +30 -283
- package/dist/autocomplete/createAutocompleteState.d.ts +3 -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 +12 -3
- 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 +23 -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 +20 -0
- 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 +111 -0
- package/dist/data/createListData.d.ts +65 -0
- package/dist/data/createTreeData.d.ts +65 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/datepicker/index.d.ts +8 -0
- 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 +17 -11
- package/dist/index.d.ts +31 -25
- package/dist/index.js +7990 -6264
- package/dist/index.js.map +1 -7
- package/dist/menu/index.d.ts +8 -0
- 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 +13 -4
- 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 +20 -3
- package/dist/select/index.d.ts +1 -1
- package/dist/selection/index.d.ts +11 -0
- 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 +15 -3
- package/dist/toast/index.d.ts +1 -1
- package/dist/toggle/createToggleGroupState.d.ts +45 -0
- package/dist/toggle/createToggleState.d.ts +2 -2
- package/dist/toggle/index.d.ts +2 -1
- package/dist/tooltip/createTooltipTriggerState.d.ts +2 -2
- package/dist/tooltip/index.d.ts +1 -1
- package/dist/tree/TreeCollection.d.ts +5 -4
- 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 +30 -30
- package/src/autocomplete/createAutocompleteState.d.ts +19 -17
- package/src/autocomplete/createAutocompleteState.ts +25 -32
- 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 +286 -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 +57 -30
- 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 +152 -146
- package/src/collections/createListState.d.ts +73 -58
- package/src/collections/createListState.ts +267 -264
- package/src/collections/createMenuState.d.ts +36 -31
- package/src/collections/createMenuState.ts +112 -106
- package/src/collections/createSelectionState.d.ts +78 -65
- package/src/collections/createSelectionState.ts +340 -336
- package/src/collections/index.d.ts +38 -6
- package/src/collections/index.ts +41 -46
- package/src/collections/types.d.ts +101 -101
- package/src/collections/types.ts +181 -169
- package/src/color/Color.d.ts +20 -5
- package/src/color/Color.ts +1054 -951
- package/src/color/createColorAreaState.d.ts +67 -65
- package/src/color/createColorAreaState.ts +301 -293
- package/src/color/createColorFieldState.d.ts +46 -44
- package/src/color/createColorFieldState.ts +428 -292
- package/src/color/createColorSliderState.d.ts +58 -56
- package/src/color/createColorSliderState.ts +272 -241
- package/src/color/createColorWheelState.d.ts +42 -40
- package/src/color/createColorWheelState.ts +248 -211
- package/src/color/getColorChannels.ts +36 -0
- package/src/color/index.d.ts +36 -7
- package/src/color/index.ts +44 -47
- package/src/color/types.d.ts +68 -63
- package/src/color/types.ts +119 -127
- package/src/combobox/createComboBoxState.d.ts +107 -105
- package/src/combobox/createComboBoxState.ts +790 -703
- package/src/combobox/index.d.ts +10 -2
- package/src/combobox/index.ts +13 -13
- package/src/data/createAsyncList.ts +403 -0
- package/src/data/createListData.ts +298 -0
- package/src/data/createTreeData.ts +646 -0
- package/src/data/index.ts +25 -0
- package/src/datepicker/index.ts +32 -0
- package/src/disclosure/createDisclosureState.d.ts +47 -43
- package/src/disclosure/createDisclosureState.ts +9 -23
- 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 +151 -153
- package/src/dnd/createDraggableCollectionState.d.ts +52 -41
- package/src/dnd/createDraggableCollectionState.ts +158 -165
- package/src/dnd/createDropState.d.ts +64 -45
- package/src/dnd/createDropState.ts +202 -212
- package/src/dnd/createDroppableCollectionState.d.ts +88 -59
- package/src/dnd/createDroppableCollectionState.ts +354 -357
- package/src/dnd/index.d.ts +54 -6
- package/src/dnd/index.ts +63 -76
- package/src/dnd/types.d.ts +167 -156
- package/src/dnd/types.ts +316 -317
- package/src/form/createFormValidationState.d.ts +47 -45
- package/src/form/createFormValidationState.ts +356 -389
- package/src/form/index.d.ts +16 -2
- package/src/form/index.ts +15 -15
- 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 +24 -17
- package/src/index.d.ts +310 -26
- package/src/index.ts +87 -79
- package/src/menu/index.ts +17 -0
- package/src/numberfield/createNumberFieldState.d.ts +56 -54
- package/src/numberfield/createNumberFieldState.ts +422 -383
- package/src/numberfield/index.d.ts +6 -2
- package/src/numberfield/index.ts +5 -5
- package/src/overlays/createOverlayTriggerState.d.ts +22 -20
- package/src/overlays/createOverlayTriggerState.ts +66 -67
- package/src/overlays/index.d.ts +6 -2
- package/src/overlays/index.ts +5 -5
- package/src/radio/createRadioGroupState.d.ts +54 -52
- package/src/radio/createRadioGroupState.ts +66 -30
- 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 +56 -62
- 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 +290 -181
- package/src/select/index.d.ts +2 -2
- package/src/select/index.ts +1 -5
- package/src/selection/index.ts +27 -0
- package/src/slider/createSliderState.d.ts +60 -60
- package/src/slider/createSliderState.ts +233 -211
- 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 +58 -39
- 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 -81
- package/src/toast/createToastState.ts +56 -44
- package/src/toast/index.d.ts +12 -2
- package/src/toast/index.ts +1 -1
- package/src/toggle/createToggleGroupState.ts +117 -0
- 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 +6 -4
- package/src/tooltip/createTooltipTriggerState.d.ts +17 -17
- package/src/tooltip/createTooltipTriggerState.ts +184 -183
- package/src/tooltip/index.d.ts +7 -2
- package/src/tooltip/index.ts +6 -6
- package/src/tree/TreeCollection.d.ts +26 -23
- package/src/tree/TreeCollection.ts +215 -175
- package/src/tree/createTreeState.d.ts +7 -4
- package/src/tree/createTreeState.ts +390 -392
- package/src/tree/index.d.ts +10 -4
- package/src/tree/index.ts +13 -13
- package/src/tree/types.d.ts +131 -126
- package/src/tree/types.ts +183 -174
- 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
package/src/color/index.ts
CHANGED
|
@@ -1,47 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color state management exports.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
type ColorFieldStateOptions,
|
|
46
|
-
type ColorFieldState,
|
|
47
|
-
} from './createColorFieldState';
|
|
1
|
+
/**
|
|
2
|
+
* Color state management exports.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export type {
|
|
6
|
+
Color,
|
|
7
|
+
ColorFormat,
|
|
8
|
+
ColorSpace,
|
|
9
|
+
ColorChannel,
|
|
10
|
+
ColorChannelRange,
|
|
11
|
+
ColorAxes,
|
|
12
|
+
} from "./types";
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
parseColor,
|
|
16
|
+
normalizeColor,
|
|
17
|
+
createRGBColor,
|
|
18
|
+
createHSLColor,
|
|
19
|
+
createHSBColor,
|
|
20
|
+
} from "./Color";
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
createColorSliderState,
|
|
24
|
+
type ColorSliderStateOptions,
|
|
25
|
+
type ColorSliderState,
|
|
26
|
+
} from "./createColorSliderState";
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
createColorAreaState,
|
|
30
|
+
type ColorAreaStateOptions,
|
|
31
|
+
type ColorAreaState,
|
|
32
|
+
} from "./createColorAreaState";
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
createColorWheelState,
|
|
36
|
+
type ColorWheelStateOptions,
|
|
37
|
+
type ColorWheelState,
|
|
38
|
+
} from "./createColorWheelState";
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
createColorFieldState,
|
|
42
|
+
type ColorFieldStateOptions,
|
|
43
|
+
type ColorFieldState,
|
|
44
|
+
} from "./createColorFieldState";
|
package/src/color/types.d.ts
CHANGED
|
@@ -5,102 +5,107 @@
|
|
|
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 =
|
|
17
|
+
| "hue"
|
|
18
|
+
| "saturation"
|
|
19
|
+
| "brightness"
|
|
20
|
+
| "lightness"
|
|
21
|
+
| "red"
|
|
22
|
+
| "green"
|
|
23
|
+
| "blue"
|
|
24
|
+
| "alpha";
|
|
17
25
|
/**
|
|
18
26
|
* Range for a color channel.
|
|
19
27
|
*/
|
|
20
28
|
export interface ColorChannelRange {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
/** Minimum value. */
|
|
30
|
+
minValue: number;
|
|
31
|
+
/** Maximum value. */
|
|
32
|
+
maxValue: number;
|
|
33
|
+
/** Step for keyboard increment. */
|
|
34
|
+
step: number;
|
|
35
|
+
/** Page step for larger increments. */
|
|
36
|
+
pageSize: number;
|
|
29
37
|
}
|
|
30
38
|
/**
|
|
31
39
|
* Color axes for a color space.
|
|
32
40
|
*/
|
|
33
41
|
export interface ColorAxes {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
/** X-axis channel. */
|
|
43
|
+
xChannel: ColorChannel;
|
|
44
|
+
/** Y-axis channel. */
|
|
45
|
+
yChannel: ColorChannel;
|
|
46
|
+
/** Z-axis channel (the one not on x or y). */
|
|
47
|
+
zChannel: ColorChannel;
|
|
40
48
|
}
|
|
41
49
|
/**
|
|
42
50
|
* Color interface representing a color value.
|
|
43
51
|
*/
|
|
44
52
|
export interface Color {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
getColorName(locale: string): string;
|
|
76
|
-
/** Get the hue name (e.g., "red", "blue"). */
|
|
77
|
-
getHueName(locale: string): string;
|
|
53
|
+
/** Convert to a different format. */
|
|
54
|
+
toFormat(format: ColorFormat): Color;
|
|
55
|
+
/** Convert to a CSS string. */
|
|
56
|
+
toString(format?: ColorFormat | "css"): string;
|
|
57
|
+
/** Clone this color. */
|
|
58
|
+
clone(): Color;
|
|
59
|
+
/** Get the hex value as an integer. */
|
|
60
|
+
toHexInt(): number;
|
|
61
|
+
/** Get the value of a specific channel. */
|
|
62
|
+
getChannelValue(channel: ColorChannel): number;
|
|
63
|
+
/** Create a new color with a channel value changed. */
|
|
64
|
+
withChannelValue(channel: ColorChannel, value: number): Color;
|
|
65
|
+
/** Get the range for a channel. */
|
|
66
|
+
getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
67
|
+
/** Get the localized name of a channel. */
|
|
68
|
+
getChannelName(channel: ColorChannel, locale: string): string;
|
|
69
|
+
/** Get the format options for a channel. */
|
|
70
|
+
getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
71
|
+
/** Format the value of a channel. */
|
|
72
|
+
formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
73
|
+
/** Get the color space. */
|
|
74
|
+
getColorSpace(): ColorSpace;
|
|
75
|
+
/** Get the axes for a color space. */
|
|
76
|
+
getColorSpaceAxes(xyChannels?: { xChannel?: ColorChannel; yChannel?: ColorChannel }): ColorAxes;
|
|
77
|
+
/** Get all channels for this color space. */
|
|
78
|
+
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
79
|
+
/** Get a human-readable color name. */
|
|
80
|
+
getColorName(locale: string): string;
|
|
81
|
+
/** Get the hue name (e.g., "red", "blue"). */
|
|
82
|
+
getHueName(locale: string): string;
|
|
78
83
|
}
|
|
79
84
|
/**
|
|
80
85
|
* RGB color value.
|
|
81
86
|
*/
|
|
82
87
|
export interface RGBColor {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
red: number;
|
|
89
|
+
green: number;
|
|
90
|
+
blue: number;
|
|
91
|
+
alpha: number;
|
|
87
92
|
}
|
|
88
93
|
/**
|
|
89
94
|
* HSL color value.
|
|
90
95
|
*/
|
|
91
96
|
export interface HSLColor {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
hue: number;
|
|
98
|
+
saturation: number;
|
|
99
|
+
lightness: number;
|
|
100
|
+
alpha: number;
|
|
96
101
|
}
|
|
97
102
|
/**
|
|
98
103
|
* HSB color value.
|
|
99
104
|
*/
|
|
100
105
|
export interface HSBColor {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
106
|
+
hue: number;
|
|
107
|
+
saturation: number;
|
|
108
|
+
brightness: number;
|
|
109
|
+
alpha: number;
|
|
105
110
|
}
|
|
106
|
-
//# sourceMappingURL=types.d.ts.map
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
package/src/color/types.ts
CHANGED
|
@@ -1,127 +1,119 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Color types for color picker components.
|
|
3
|
-
* Based on @react-stately/color.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Supported color formats.
|
|
8
|
-
*/
|
|
9
|
-
export type ColorFormat =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
|
|
73
|
-
/** Get the
|
|
74
|
-
|
|
75
|
-
/** Get the
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
|
|
79
|
-
/** Get the
|
|
80
|
-
|
|
81
|
-
/** Get the
|
|
82
|
-
|
|
83
|
-
/** Get
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
/** Get the
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
* HSB color value.
|
|
121
|
-
*/
|
|
122
|
-
export interface HSBColor {
|
|
123
|
-
hue: number;
|
|
124
|
-
saturation: number;
|
|
125
|
-
brightness: number;
|
|
126
|
-
alpha: number;
|
|
127
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Color types for color picker components.
|
|
3
|
+
* Based on @react-stately/color.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Supported color formats.
|
|
8
|
+
*/
|
|
9
|
+
export type ColorFormat = "hex" | "hexa" | "rgb" | "rgba" | "hsl" | "hsla" | "hsb" | "hsba";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Color spaces.
|
|
13
|
+
*/
|
|
14
|
+
export type ColorSpace = "rgb" | "hsl" | "hsb";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Color channels.
|
|
18
|
+
*/
|
|
19
|
+
export type ColorChannel =
|
|
20
|
+
| "hue"
|
|
21
|
+
| "saturation"
|
|
22
|
+
| "brightness"
|
|
23
|
+
| "lightness"
|
|
24
|
+
| "red"
|
|
25
|
+
| "green"
|
|
26
|
+
| "blue"
|
|
27
|
+
| "alpha";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Range for a color channel.
|
|
31
|
+
*/
|
|
32
|
+
export interface ColorChannelRange {
|
|
33
|
+
/** Minimum value. */
|
|
34
|
+
minValue: number;
|
|
35
|
+
/** Maximum value. */
|
|
36
|
+
maxValue: number;
|
|
37
|
+
/** Step for keyboard increment. */
|
|
38
|
+
step: number;
|
|
39
|
+
/** Page step for larger increments. */
|
|
40
|
+
pageSize: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Color axes for a color space.
|
|
45
|
+
*/
|
|
46
|
+
export interface ColorAxes {
|
|
47
|
+
/** X-axis channel. */
|
|
48
|
+
xChannel: ColorChannel;
|
|
49
|
+
/** Y-axis channel. */
|
|
50
|
+
yChannel: ColorChannel;
|
|
51
|
+
/** Z-axis channel (the one not on x or y). */
|
|
52
|
+
zChannel: ColorChannel;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Color interface representing a color value.
|
|
57
|
+
*/
|
|
58
|
+
export interface Color {
|
|
59
|
+
/** Convert to a different format. */
|
|
60
|
+
toFormat(format: ColorFormat): Color;
|
|
61
|
+
/** Convert to a CSS string. */
|
|
62
|
+
toString(format?: ColorFormat | "css"): string;
|
|
63
|
+
/** Clone this color. */
|
|
64
|
+
clone(): Color;
|
|
65
|
+
/** Get the hex value as an integer. */
|
|
66
|
+
toHexInt(): number;
|
|
67
|
+
/** Get the value of a specific channel. */
|
|
68
|
+
getChannelValue(channel: ColorChannel): number;
|
|
69
|
+
/** Create a new color with a channel value changed. */
|
|
70
|
+
withChannelValue(channel: ColorChannel, value: number): Color;
|
|
71
|
+
/** Get the range for a channel. */
|
|
72
|
+
getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
73
|
+
/** Get the localized name of a channel. */
|
|
74
|
+
getChannelName(channel: ColorChannel, locale: string): string;
|
|
75
|
+
/** Get the format options for a channel. */
|
|
76
|
+
getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
77
|
+
/** Format the value of a channel. */
|
|
78
|
+
formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
79
|
+
/** Get the color space. */
|
|
80
|
+
getColorSpace(): ColorSpace;
|
|
81
|
+
/** Get the axes for a color space. */
|
|
82
|
+
getColorSpaceAxes(xyChannels?: { xChannel?: ColorChannel; yChannel?: ColorChannel }): ColorAxes;
|
|
83
|
+
/** Get all channels for this color space. */
|
|
84
|
+
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
85
|
+
/** Get a human-readable color name. */
|
|
86
|
+
getColorName(locale: string): string;
|
|
87
|
+
/** Get the hue name (e.g., "red", "blue"). */
|
|
88
|
+
getHueName(locale: string): string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* RGB color value.
|
|
93
|
+
*/
|
|
94
|
+
export interface RGBColor {
|
|
95
|
+
red: number;
|
|
96
|
+
green: number;
|
|
97
|
+
blue: number;
|
|
98
|
+
alpha: number;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* HSL color value.
|
|
103
|
+
*/
|
|
104
|
+
export interface HSLColor {
|
|
105
|
+
hue: number;
|
|
106
|
+
saturation: number;
|
|
107
|
+
lightness: number;
|
|
108
|
+
alpha: number;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* HSB color value.
|
|
113
|
+
*/
|
|
114
|
+
export interface HSBColor {
|
|
115
|
+
hue: number;
|
|
116
|
+
saturation: number;
|
|
117
|
+
brightness: number;
|
|
118
|
+
alpha: number;
|
|
119
|
+
}
|