@proyecto-viviana/solid-stately 0.2.3 → 0.2.7
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/dist/autocomplete/createAutocompleteState.d.ts +2 -1
- package/dist/checkbox/createCheckboxGroupState.d.ts +10 -1
- package/dist/collections/types.d.ts +11 -0
- package/dist/color/getColorChannels.d.ts +20 -0
- package/dist/data/createAsyncList.d.ts +111 -0
- package/dist/data/createListData.d.ts +65 -0
- package/dist/data/createTreeData.d.ts +61 -0
- package/dist/data/index.d.ts +3 -0
- package/dist/datepicker/index.d.ts +10 -0
- package/dist/grid/types.d.ts +5 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +3737 -2697
- package/dist/index.js.map +1 -7
- package/dist/menu/index.d.ts +8 -0
- package/dist/radio/createRadioGroupState.d.ts +10 -1
- package/dist/select/createSelectState.d.ts +17 -0
- package/dist/selection/index.d.ts +11 -0
- package/dist/toast/createToastState.d.ts +7 -1
- package/dist/toggle/createToggleGroupState.d.ts +45 -0
- package/dist/toggle/index.d.ts +1 -0
- package/dist/tree/TreeCollection.d.ts +3 -2
- package/package.json +6 -5
- package/src/autocomplete/createAutocompleteState.ts +10 -11
- package/src/calendar/createDateFieldState.ts +24 -1
- package/src/checkbox/createCheckboxGroupState.ts +42 -6
- package/src/collections/ListCollection.ts +152 -146
- package/src/collections/createListState.ts +266 -264
- package/src/collections/createMenuState.ts +106 -106
- package/src/collections/createSelectionState.ts +336 -336
- package/src/collections/index.ts +46 -46
- package/src/collections/types.ts +181 -169
- package/src/color/Color.ts +951 -951
- package/src/color/createColorAreaState.ts +293 -293
- package/src/color/createColorFieldState.ts +292 -292
- package/src/color/createColorSliderState.ts +241 -241
- package/src/color/createColorWheelState.ts +211 -211
- package/src/color/getColorChannels.ts +34 -0
- package/src/color/index.ts +47 -47
- package/src/color/types.ts +127 -127
- package/src/combobox/createComboBoxState.ts +703 -703
- package/src/combobox/index.ts +13 -13
- package/src/data/createAsyncList.ts +377 -0
- package/src/data/createListData.ts +298 -0
- package/src/data/createTreeData.ts +433 -0
- package/src/data/index.ts +25 -0
- package/src/datepicker/index.ts +36 -0
- package/src/disclosure/createDisclosureState.ts +4 -4
- package/src/dnd/createDragState.ts +153 -153
- package/src/dnd/createDraggableCollectionState.ts +165 -165
- package/src/dnd/createDropState.ts +212 -212
- package/src/dnd/createDroppableCollectionState.ts +357 -357
- package/src/dnd/index.ts +76 -76
- package/src/dnd/types.ts +317 -317
- package/src/form/createFormValidationState.ts +389 -389
- package/src/form/index.ts +15 -15
- package/src/grid/types.ts +5 -0
- package/src/index.ts +49 -0
- package/src/menu/index.ts +19 -0
- package/src/numberfield/createNumberFieldState.ts +427 -383
- package/src/numberfield/index.ts +5 -5
- package/src/overlays/createOverlayTriggerState.ts +67 -67
- package/src/overlays/index.ts +5 -5
- package/src/radio/createRadioGroupState.ts +44 -6
- package/src/searchfield/createSearchFieldState.ts +62 -62
- package/src/searchfield/index.ts +5 -5
- package/src/select/createSelectState.ts +290 -181
- package/src/select/index.ts +5 -5
- package/src/selection/index.ts +28 -0
- package/src/slider/createSliderState.ts +211 -211
- package/src/slider/index.ts +6 -6
- package/src/tabs/createTabListState.ts +37 -11
- package/src/toast/createToastState.d.ts +6 -1
- package/src/toast/createToastState.ts +8 -1
- package/src/toggle/createToggleGroupState.ts +127 -0
- package/src/toggle/index.ts +6 -0
- package/src/tooltip/createTooltipTriggerState.ts +183 -183
- package/src/tooltip/index.ts +6 -6
- package/src/tree/TreeCollection.ts +208 -175
- package/src/tree/createTreeState.ts +392 -392
- package/src/tree/index.ts +13 -13
- package/src/tree/types.ts +174 -174
package/src/color/types.ts
CHANGED
|
@@ -1,127 +1,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 =
|
|
10
|
-
| 'hex'
|
|
11
|
-
| 'hexa'
|
|
12
|
-
| 'rgb'
|
|
13
|
-
| 'rgba'
|
|
14
|
-
| 'hsl'
|
|
15
|
-
| 'hsla'
|
|
16
|
-
| 'hsb'
|
|
17
|
-
| 'hsba';
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Color spaces.
|
|
21
|
-
*/
|
|
22
|
-
export type ColorSpace = 'rgb' | 'hsl' | 'hsb';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Color channels.
|
|
26
|
-
*/
|
|
27
|
-
export type ColorChannel =
|
|
28
|
-
| 'hue'
|
|
29
|
-
| 'saturation'
|
|
30
|
-
| 'brightness'
|
|
31
|
-
| 'lightness'
|
|
32
|
-
| 'red'
|
|
33
|
-
| 'green'
|
|
34
|
-
| 'blue'
|
|
35
|
-
| 'alpha';
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Range for a color channel.
|
|
39
|
-
*/
|
|
40
|
-
export interface ColorChannelRange {
|
|
41
|
-
/** Minimum value. */
|
|
42
|
-
minValue: number;
|
|
43
|
-
/** Maximum value. */
|
|
44
|
-
maxValue: number;
|
|
45
|
-
/** Step for keyboard increment. */
|
|
46
|
-
step: number;
|
|
47
|
-
/** Page step for larger increments. */
|
|
48
|
-
pageSize: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Color axes for a color space.
|
|
53
|
-
*/
|
|
54
|
-
export interface ColorAxes {
|
|
55
|
-
/** X-axis channel. */
|
|
56
|
-
xChannel: ColorChannel;
|
|
57
|
-
/** Y-axis channel. */
|
|
58
|
-
yChannel: ColorChannel;
|
|
59
|
-
/** Z-axis channel (the one not on x or y). */
|
|
60
|
-
zChannel: ColorChannel;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Color interface representing a color value.
|
|
65
|
-
*/
|
|
66
|
-
export interface Color {
|
|
67
|
-
/** Convert to a different format. */
|
|
68
|
-
toFormat(format: ColorFormat): Color;
|
|
69
|
-
/** Convert to a CSS string. */
|
|
70
|
-
toString(format?: ColorFormat | 'css'): string;
|
|
71
|
-
/** Clone this color. */
|
|
72
|
-
clone(): Color;
|
|
73
|
-
/** Get the hex value as an integer. */
|
|
74
|
-
toHexInt(): number;
|
|
75
|
-
/** Get the value of a specific channel. */
|
|
76
|
-
getChannelValue(channel: ColorChannel): number;
|
|
77
|
-
/** Create a new color with a channel value changed. */
|
|
78
|
-
withChannelValue(channel: ColorChannel, value: number): Color;
|
|
79
|
-
/** Get the range for a channel. */
|
|
80
|
-
getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
81
|
-
/** Get the localized name of a channel. */
|
|
82
|
-
getChannelName(channel: ColorChannel, locale: string): string;
|
|
83
|
-
/** Get the format options for a channel. */
|
|
84
|
-
getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
85
|
-
/** Format the value of a channel. */
|
|
86
|
-
formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
87
|
-
/** Get the color space. */
|
|
88
|
-
getColorSpace(): ColorSpace;
|
|
89
|
-
/** Get the axes for a color space. */
|
|
90
|
-
getColorSpaceAxes(xyChannels?: { xChannel?: ColorChannel; yChannel?: ColorChannel }): ColorAxes;
|
|
91
|
-
/** Get all channels for this color space. */
|
|
92
|
-
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
93
|
-
/** Get a human-readable color name. */
|
|
94
|
-
getColorName(locale: string): string;
|
|
95
|
-
/** Get the hue name (e.g., "red", "blue"). */
|
|
96
|
-
getHueName(locale: string): string;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* RGB color value.
|
|
101
|
-
*/
|
|
102
|
-
export interface RGBColor {
|
|
103
|
-
red: number;
|
|
104
|
-
green: number;
|
|
105
|
-
blue: number;
|
|
106
|
-
alpha: number;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* HSL color value.
|
|
111
|
-
*/
|
|
112
|
-
export interface HSLColor {
|
|
113
|
-
hue: number;
|
|
114
|
-
saturation: number;
|
|
115
|
-
lightness: number;
|
|
116
|
-
alpha: number;
|
|
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 =
|
|
10
|
+
| 'hex'
|
|
11
|
+
| 'hexa'
|
|
12
|
+
| 'rgb'
|
|
13
|
+
| 'rgba'
|
|
14
|
+
| 'hsl'
|
|
15
|
+
| 'hsla'
|
|
16
|
+
| 'hsb'
|
|
17
|
+
| 'hsba';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Color spaces.
|
|
21
|
+
*/
|
|
22
|
+
export type ColorSpace = 'rgb' | 'hsl' | 'hsb';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Color channels.
|
|
26
|
+
*/
|
|
27
|
+
export type ColorChannel =
|
|
28
|
+
| 'hue'
|
|
29
|
+
| 'saturation'
|
|
30
|
+
| 'brightness'
|
|
31
|
+
| 'lightness'
|
|
32
|
+
| 'red'
|
|
33
|
+
| 'green'
|
|
34
|
+
| 'blue'
|
|
35
|
+
| 'alpha';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Range for a color channel.
|
|
39
|
+
*/
|
|
40
|
+
export interface ColorChannelRange {
|
|
41
|
+
/** Minimum value. */
|
|
42
|
+
minValue: number;
|
|
43
|
+
/** Maximum value. */
|
|
44
|
+
maxValue: number;
|
|
45
|
+
/** Step for keyboard increment. */
|
|
46
|
+
step: number;
|
|
47
|
+
/** Page step for larger increments. */
|
|
48
|
+
pageSize: number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Color axes for a color space.
|
|
53
|
+
*/
|
|
54
|
+
export interface ColorAxes {
|
|
55
|
+
/** X-axis channel. */
|
|
56
|
+
xChannel: ColorChannel;
|
|
57
|
+
/** Y-axis channel. */
|
|
58
|
+
yChannel: ColorChannel;
|
|
59
|
+
/** Z-axis channel (the one not on x or y). */
|
|
60
|
+
zChannel: ColorChannel;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Color interface representing a color value.
|
|
65
|
+
*/
|
|
66
|
+
export interface Color {
|
|
67
|
+
/** Convert to a different format. */
|
|
68
|
+
toFormat(format: ColorFormat): Color;
|
|
69
|
+
/** Convert to a CSS string. */
|
|
70
|
+
toString(format?: ColorFormat | 'css'): string;
|
|
71
|
+
/** Clone this color. */
|
|
72
|
+
clone(): Color;
|
|
73
|
+
/** Get the hex value as an integer. */
|
|
74
|
+
toHexInt(): number;
|
|
75
|
+
/** Get the value of a specific channel. */
|
|
76
|
+
getChannelValue(channel: ColorChannel): number;
|
|
77
|
+
/** Create a new color with a channel value changed. */
|
|
78
|
+
withChannelValue(channel: ColorChannel, value: number): Color;
|
|
79
|
+
/** Get the range for a channel. */
|
|
80
|
+
getChannelRange(channel: ColorChannel): ColorChannelRange;
|
|
81
|
+
/** Get the localized name of a channel. */
|
|
82
|
+
getChannelName(channel: ColorChannel, locale: string): string;
|
|
83
|
+
/** Get the format options for a channel. */
|
|
84
|
+
getChannelFormatOptions(channel: ColorChannel): Intl.NumberFormatOptions;
|
|
85
|
+
/** Format the value of a channel. */
|
|
86
|
+
formatChannelValue(channel: ColorChannel, locale: string): string;
|
|
87
|
+
/** Get the color space. */
|
|
88
|
+
getColorSpace(): ColorSpace;
|
|
89
|
+
/** Get the axes for a color space. */
|
|
90
|
+
getColorSpaceAxes(xyChannels?: { xChannel?: ColorChannel; yChannel?: ColorChannel }): ColorAxes;
|
|
91
|
+
/** Get all channels for this color space. */
|
|
92
|
+
getColorChannels(): [ColorChannel, ColorChannel, ColorChannel];
|
|
93
|
+
/** Get a human-readable color name. */
|
|
94
|
+
getColorName(locale: string): string;
|
|
95
|
+
/** Get the hue name (e.g., "red", "blue"). */
|
|
96
|
+
getHueName(locale: string): string;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* RGB color value.
|
|
101
|
+
*/
|
|
102
|
+
export interface RGBColor {
|
|
103
|
+
red: number;
|
|
104
|
+
green: number;
|
|
105
|
+
blue: number;
|
|
106
|
+
alpha: number;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* HSL color value.
|
|
111
|
+
*/
|
|
112
|
+
export interface HSLColor {
|
|
113
|
+
hue: number;
|
|
114
|
+
saturation: number;
|
|
115
|
+
lightness: number;
|
|
116
|
+
alpha: number;
|
|
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
|
+
}
|