@react-spectrum/color 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ColorArea.main.js +2 -5
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +2 -5
- package/dist/ColorArea.module.js +2 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorEditor.main.js +2 -5
- package/dist/ColorEditor.main.js.map +1 -1
- package/dist/ColorEditor.mjs +2 -5
- package/dist/ColorEditor.module.js +2 -5
- package/dist/ColorEditor.module.js.map +1 -1
- package/dist/ColorField.main.js +2 -5
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +2 -5
- package/dist/ColorField.module.js +2 -5
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorPicker.main.js +2 -5
- package/dist/ColorPicker.main.js.map +1 -1
- package/dist/ColorPicker.mjs +2 -5
- package/dist/ColorPicker.module.js +2 -5
- package/dist/ColorPicker.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -6
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -6
- package/dist/ColorSlider.module.js +3 -6
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +2 -5
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +3 -6
- package/dist/ColorSwatch.module.js +3 -6
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js +2 -5
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.mjs +2 -5
- package/dist/ColorSwatchPicker.module.js +2 -5
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorWheel.main.js +2 -5
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +2 -5
- package/dist/ColorWheel.module.js +2 -5
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/types.d.ts +7 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/{vars.d78ec0e6.css → vars.a54898d8.css} +2 -2
- package/dist/{vars.d78ec0e6.css.map → vars.a54898d8.css.map} +1 -1
- package/package.json +20 -20
- package/src/ColorArea.tsx +5 -8
- package/src/ColorEditor.tsx +5 -8
- package/src/ColorField.tsx +5 -8
- package/src/ColorPicker.tsx +5 -8
- package/src/ColorSlider.tsx +5 -8
- package/src/ColorSwatch.tsx +5 -8
- package/src/ColorSwatchPicker.tsx +5 -8
- package/src/ColorWheel.tsx +5 -8
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@react-spectrum/color",
|
3
|
-
"version": "3.0.
|
3
|
+
"version": "3.0.3",
|
4
4
|
"description": "Spectrum UI components in React",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "dist/main.js",
|
@@ -36,25 +36,25 @@
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
|
-
"@react-aria/color": "^3.0.
|
40
|
-
"@react-aria/focus": "^3.19.
|
41
|
-
"@react-aria/i18n": "^3.12.
|
42
|
-
"@react-aria/interactions": "^3.
|
43
|
-
"@react-aria/utils": "^3.
|
44
|
-
"@react-spectrum/dialog": "^3.8.
|
45
|
-
"@react-spectrum/form": "^3.7.
|
46
|
-
"@react-spectrum/label": "^3.16.
|
47
|
-
"@react-spectrum/overlays": "^5.7.
|
48
|
-
"@react-spectrum/picker": "^3.15.
|
49
|
-
"@react-spectrum/textfield": "^3.12.
|
50
|
-
"@react-spectrum/utils": "^3.12.
|
51
|
-
"@react-spectrum/view": "^3.6.
|
52
|
-
"@react-stately/color": "^3.8.
|
53
|
-
"@react-types/color": "^3.0.
|
54
|
-
"@react-types/shared": "^3.
|
55
|
-
"@react-types/textfield": "^3.
|
39
|
+
"@react-aria/color": "^3.0.3",
|
40
|
+
"@react-aria/focus": "^3.19.1",
|
41
|
+
"@react-aria/i18n": "^3.12.5",
|
42
|
+
"@react-aria/interactions": "^3.23.0",
|
43
|
+
"@react-aria/utils": "^3.27.0",
|
44
|
+
"@react-spectrum/dialog": "^3.8.17",
|
45
|
+
"@react-spectrum/form": "^3.7.11",
|
46
|
+
"@react-spectrum/label": "^3.16.11",
|
47
|
+
"@react-spectrum/overlays": "^5.7.1",
|
48
|
+
"@react-spectrum/picker": "^3.15.5",
|
49
|
+
"@react-spectrum/textfield": "^3.12.8",
|
50
|
+
"@react-spectrum/utils": "^3.12.1",
|
51
|
+
"@react-spectrum/view": "^3.6.15",
|
52
|
+
"@react-stately/color": "^3.8.2",
|
53
|
+
"@react-types/color": "^3.0.2",
|
54
|
+
"@react-types/shared": "^3.27.0",
|
55
|
+
"@react-types/textfield": "^3.11.0",
|
56
56
|
"@swc/helpers": "^0.5.0",
|
57
|
-
"react-aria-components": "^1.
|
57
|
+
"react-aria-components": "^1.6.0"
|
58
58
|
},
|
59
59
|
"devDependencies": {
|
60
60
|
"@adobe/spectrum-css-temp": "3.0.0-alpha.1",
|
@@ -68,5 +68,5 @@
|
|
68
68
|
"publishConfig": {
|
69
69
|
"access": "public"
|
70
70
|
},
|
71
|
-
"gitHead": "
|
71
|
+
"gitHead": "09e7f44bebdc9d89122926b2b439a0a38a2814ea"
|
72
72
|
}
|
package/src/ColorArea.tsx
CHANGED
@@ -23,7 +23,10 @@ import {useColorAreaState} from '@react-stately/color';
|
|
23
23
|
import {useFocusRing} from '@react-aria/focus';
|
24
24
|
import {useProviderProps} from '@react-spectrum/provider';
|
25
25
|
|
26
|
-
|
26
|
+
/**
|
27
|
+
* ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
|
28
|
+
*/
|
29
|
+
export const ColorArea = React.forwardRef(function ColorArea(props: SpectrumColorAreaProps, ref: FocusableRef<HTMLDivElement>) {
|
27
30
|
props = useProviderProps(props);
|
28
31
|
let inputXRef = useRef(null);
|
29
32
|
let inputYRef = useRef(null);
|
@@ -81,10 +84,4 @@ function ColorArea(props: SpectrumColorAreaProps, ref: FocusableRef<HTMLDivEleme
|
|
81
84
|
</ColorThumb>
|
82
85
|
</div>
|
83
86
|
);
|
84
|
-
}
|
85
|
-
|
86
|
-
/**
|
87
|
-
* ColorArea allows users to adjust two channels of an RGB, HSL or HSB color value against a two-dimensional gradient background.
|
88
|
-
*/
|
89
|
-
let _ColorArea = React.forwardRef(ColorArea) as (props: SpectrumColorAreaProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;
|
90
|
-
export {_ColorArea as ColorArea};
|
87
|
+
}) as (props: SpectrumColorAreaProps & {ref?: FocusableRef<HTMLDivElement>}) => ReactElement;
|
package/src/ColorEditor.tsx
CHANGED
@@ -17,7 +17,10 @@ export interface SpectrumColorEditorProps {
|
|
17
17
|
hideAlphaChannel?: boolean
|
18
18
|
}
|
19
19
|
|
20
|
-
|
20
|
+
/**
|
21
|
+
* ColorEditor provides a default UI for editing colors within a ColorPicker.
|
22
|
+
*/
|
23
|
+
export const ColorEditor = React.forwardRef(function ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef<HTMLDivElement>) {
|
21
24
|
let [format, setFormat] = useState<ColorSpace | 'hex'>('hex');
|
22
25
|
let domRef = useDOMRef(ref);
|
23
26
|
let formatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/color');
|
@@ -54,10 +57,4 @@ function ColorEditor(props: SpectrumColorEditorProps, ref: DOMRef<HTMLDivElement
|
|
54
57
|
</div>
|
55
58
|
</div>
|
56
59
|
);
|
57
|
-
}
|
58
|
-
|
59
|
-
/**
|
60
|
-
* ColorEditor provides a default UI for editing colors within a ColorPicker.
|
61
|
-
*/
|
62
|
-
let _ColorEditor = React.forwardRef(ColorEditor);
|
63
|
-
export {_ColorEditor as ColorEditor};
|
60
|
+
});
|
package/src/ColorField.tsx
CHANGED
@@ -23,7 +23,10 @@ import {useFormProps} from '@react-spectrum/form';
|
|
23
23
|
import {useLocale} from '@react-aria/i18n';
|
24
24
|
import {useProviderProps} from '@react-spectrum/provider';
|
25
25
|
|
26
|
-
|
26
|
+
/**
|
27
|
+
* A color field allows users to edit a hex color or individual color channel value.
|
28
|
+
*/
|
29
|
+
export const ColorField = React.forwardRef(function ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {
|
27
30
|
props = useProviderProps(props);
|
28
31
|
props = useFormProps(props);
|
29
32
|
[props] = useContextProps(props, null, ColorFieldContext);
|
@@ -36,13 +39,7 @@ function ColorField(props: SpectrumColorFieldProps, ref: Ref<TextFieldRef>) {
|
|
36
39
|
} else {
|
37
40
|
return <HexColorField {...props} forwardedRef={ref} />;
|
38
41
|
}
|
39
|
-
}
|
40
|
-
|
41
|
-
/**
|
42
|
-
* A color field allows users to edit a hex color or individual color channel value.
|
43
|
-
*/
|
44
|
-
const _ColorField = React.forwardRef(ColorField);
|
45
|
-
export {_ColorField as ColorField};
|
42
|
+
});
|
46
43
|
|
47
44
|
interface ColorChannelFieldProps extends Omit<SpectrumColorFieldProps, 'channel'> {
|
48
45
|
channel: ColorChannel,
|
package/src/ColorPicker.tsx
CHANGED
@@ -37,7 +37,10 @@ export interface SpectrumColorPickerProps extends ValueBase<string | Color, Colo
|
|
37
37
|
rounding?: 'default' | 'none' | 'full'
|
38
38
|
}
|
39
39
|
|
40
|
-
|
40
|
+
/**
|
41
|
+
* A ColorPicker combines a swatch with a customizable popover for editing a color.
|
42
|
+
*/
|
43
|
+
export const ColorPicker = React.forwardRef(function ColorPicker(props: SpectrumColorPickerProps, ref: FocusableRef<HTMLButtonElement>) {
|
41
44
|
let swatchRef = useRef(null);
|
42
45
|
let domRef = useFocusableRef(ref);
|
43
46
|
let labelId = useId();
|
@@ -114,10 +117,4 @@ function ColorPicker(props: SpectrumColorPickerProps, ref: FocusableRef<HTMLButt
|
|
114
117
|
</DialogTrigger>
|
115
118
|
</AriaColorPicker>
|
116
119
|
);
|
117
|
-
}
|
118
|
-
|
119
|
-
/**
|
120
|
-
* A ColorPicker combines a swatch with a customizable popover for editing a color.
|
121
|
-
*/
|
122
|
-
let _ColorPicker = React.forwardRef(ColorPicker);
|
123
|
-
export {_ColorPicker as ColorPicker};
|
120
|
+
});
|
package/src/ColorSlider.tsx
CHANGED
@@ -24,7 +24,10 @@ import {useFocus, useFocusVisible} from '@react-aria/interactions';
|
|
24
24
|
import {useLocale} from '@react-aria/i18n';
|
25
25
|
import {useProviderProps} from '@react-spectrum/provider';
|
26
26
|
|
27
|
-
|
27
|
+
/**
|
28
|
+
* ColorSliders allow users to adjust an individual channel of a color value.
|
29
|
+
*/
|
30
|
+
export const ColorSlider = React.forwardRef(function ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivElement>) {
|
28
31
|
props = useProviderProps(props);
|
29
32
|
let inputRef = useRef(null);
|
30
33
|
let trackRef = useRef(null);
|
@@ -135,10 +138,4 @@ function ColorSlider(props: SpectrumColorSliderProps, ref: FocusableRef<HTMLDivE
|
|
135
138
|
</div>
|
136
139
|
</div>
|
137
140
|
);
|
138
|
-
}
|
139
|
-
|
140
|
-
/**
|
141
|
-
* ColorSliders allow users to adjust an individual channel of a color value.
|
142
|
-
*/
|
143
|
-
let _ColorSlider = React.forwardRef(ColorSlider);
|
144
|
-
export {_ColorSlider as ColorSlider};
|
141
|
+
});
|
package/src/ColorSwatch.tsx
CHANGED
@@ -37,7 +37,10 @@ interface SpectrumColorSwatchContextValue extends Pick<SpectrumColorSwatchProps,
|
|
37
37
|
|
38
38
|
export const SpectrumColorSwatchContext = createContext<SpectrumColorSwatchContextValue | null>(null);
|
39
39
|
|
40
|
-
|
40
|
+
/**
|
41
|
+
* A ColorSwatch displays a preview of a selected color.
|
42
|
+
*/
|
43
|
+
export const ColorSwatch = forwardRef(function ColorSwatch(props: SpectrumColorSwatchProps, ref: DOMRef<HTMLDivElement>): JSX.Element {
|
41
44
|
let domRef = useDOMRef(ref);
|
42
45
|
[props, domRef] = useContextProps(props, domRef, ColorSwatchContext);
|
43
46
|
let {colorSwatchProps, color} = useColorSwatch(props);
|
@@ -93,10 +96,4 @@ function ColorSwatch(props: SpectrumColorSwatchProps, ref: DOMRef<HTMLDivElement
|
|
93
96
|
}
|
94
97
|
|
95
98
|
return swatch;
|
96
|
-
}
|
97
|
-
|
98
|
-
/**
|
99
|
-
* A ColorSwatch displays a preview of a selected color.
|
100
|
-
*/
|
101
|
-
let _ColorSwatch = forwardRef(ColorSwatch);
|
102
|
-
export {_ColorSwatch as ColorSwatch};
|
99
|
+
});
|
@@ -38,7 +38,10 @@ export interface SpectrumColorSwatchPickerProps extends ValueBase<string | Color
|
|
38
38
|
rounding?: 'none' | 'default' | 'full'
|
39
39
|
}
|
40
40
|
|
41
|
-
|
41
|
+
/**
|
42
|
+
* A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.
|
43
|
+
*/
|
44
|
+
export const ColorSwatchPicker = forwardRef(function ColorSwatchPicker(props: SpectrumColorSwatchPickerProps, ref: DOMRef<HTMLDivElement>) {
|
42
45
|
let {
|
43
46
|
density = 'regular',
|
44
47
|
size = 'M',
|
@@ -69,13 +72,7 @@ function ColorSwatchPicker(props: SpectrumColorSwatchPickerProps, ref: DOMRef<HT
|
|
69
72
|
</SpectrumColorSwatchContext.Provider>
|
70
73
|
</AriaColorSwatchPicker>
|
71
74
|
);
|
72
|
-
}
|
73
|
-
|
74
|
-
/**
|
75
|
-
* A ColorSwatchPicker displays a list of color swatches and allows a user to select one of them.
|
76
|
-
*/
|
77
|
-
let _ColorSwatchPicker = forwardRef(ColorSwatchPicker);
|
78
|
-
export {_ColorSwatchPicker as ColorSwatchPicker};
|
75
|
+
});
|
79
76
|
|
80
77
|
function useWrapper(swatch: ReactElement, color: Color, rounding: SpectrumColorSwatchProps['rounding']) {
|
81
78
|
return (
|
package/src/ColorWheel.tsx
CHANGED
@@ -25,7 +25,10 @@ import {useResizeObserver} from '@react-aria/utils';
|
|
25
25
|
|
26
26
|
const WHEEL_THICKNESS = 24;
|
27
27
|
|
28
|
-
|
28
|
+
/**
|
29
|
+
* ColorWheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
|
30
|
+
*/
|
31
|
+
export const ColorWheel = React.forwardRef(function ColorWheel(props: SpectrumColorWheelProps, ref: FocusableRef<HTMLDivElement>) {
|
29
32
|
props = useProviderProps(props);
|
30
33
|
let inputRef = useRef(null);
|
31
34
|
let containerRef = useFocusableRef(ref, inputRef);
|
@@ -104,10 +107,4 @@ function ColorWheel(props: SpectrumColorWheelProps, ref: FocusableRef<HTMLDivEle
|
|
104
107
|
</ColorThumb>
|
105
108
|
</div>
|
106
109
|
);
|
107
|
-
}
|
108
|
-
|
109
|
-
/**
|
110
|
-
* ColorWheels allow users to adjust the hue of an HSL or HSB color value on a circular track.
|
111
|
-
*/
|
112
|
-
let _ColorWheel = React.forwardRef(ColorWheel);
|
113
|
-
export {_ColorWheel as ColorWheel};
|
110
|
+
});
|