@fluentui/react-color-picker 0.0.0-nightly-20250319-0406.1
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/CHANGELOG.md +141 -0
- package/LICENSE +15 -0
- package/README.md +50 -0
- package/dist/index.d.ts +281 -0
- package/lib/AlphaSlider.js +1 -0
- package/lib/AlphaSlider.js.map +1 -0
- package/lib/ColorArea.js +1 -0
- package/lib/ColorArea.js.map +1 -0
- package/lib/ColorPicker.js +1 -0
- package/lib/ColorPicker.js.map +1 -0
- package/lib/ColorSlider.js +1 -0
- package/lib/ColorSlider.js.map +1 -0
- package/lib/components/AlphaSlider/AlphaSlider.js +14 -0
- package/lib/components/AlphaSlider/AlphaSlider.js.map +1 -0
- package/lib/components/AlphaSlider/AlphaSlider.types.js +3 -0
- package/lib/components/AlphaSlider/AlphaSlider.types.js.map +1 -0
- package/lib/components/AlphaSlider/alphaSliderUtils.js +31 -0
- package/lib/components/AlphaSlider/alphaSliderUtils.js.map +1 -0
- package/lib/components/AlphaSlider/index.js +4 -0
- package/lib/components/AlphaSlider/index.js.map +1 -0
- package/lib/components/AlphaSlider/renderAlphaSlider.js +14 -0
- package/lib/components/AlphaSlider/renderAlphaSlider.js.map +1 -0
- package/lib/components/AlphaSlider/useAlphaSlider.js +56 -0
- package/lib/components/AlphaSlider/useAlphaSlider.js.map +1 -0
- package/lib/components/AlphaSlider/useAlphaSliderState.js +58 -0
- package/lib/components/AlphaSlider/useAlphaSliderState.js.map +1 -0
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js +80 -0
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +1 -0
- package/lib/components/ColorArea/ColorArea.js +14 -0
- package/lib/components/ColorArea/ColorArea.js.map +1 -0
- package/lib/components/ColorArea/ColorArea.types.js +1 -0
- package/lib/components/ColorArea/ColorArea.types.js.map +1 -0
- package/lib/components/ColorArea/index.js +4 -0
- package/lib/components/ColorArea/index.js.map +1 -0
- package/lib/components/ColorArea/renderColorArea.js +15 -0
- package/lib/components/ColorArea/renderColorArea.js.map +1 -0
- package/lib/components/ColorArea/useColorArea.js +189 -0
- package/lib/components/ColorArea/useColorArea.js.map +1 -0
- package/lib/components/ColorArea/useColorAreaStyles.styles.js +231 -0
- package/lib/components/ColorArea/useColorAreaStyles.styles.js.map +1 -0
- package/lib/components/ColorPicker/ColorPicker.js +16 -0
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -0
- package/lib/components/ColorPicker/ColorPicker.types.js +1 -0
- package/lib/components/ColorPicker/ColorPicker.types.js.map +1 -0
- package/lib/components/ColorPicker/index.js +4 -0
- package/lib/components/ColorPicker/index.js.map +1 -0
- package/lib/components/ColorPicker/renderColorPicker.js +14 -0
- package/lib/components/ColorPicker/renderColorPicker.js.map +1 -0
- package/lib/components/ColorPicker/useColorPicker.js +34 -0
- package/lib/components/ColorPicker/useColorPicker.js.map +1 -0
- package/lib/components/ColorPicker/useColorPickerStyles.styles.js +31 -0
- package/lib/components/ColorPicker/useColorPickerStyles.styles.js.map +1 -0
- package/lib/components/ColorSlider/ColorSlider.js +14 -0
- package/lib/components/ColorSlider/ColorSlider.js.map +1 -0
- package/lib/components/ColorSlider/ColorSlider.types.js +1 -0
- package/lib/components/ColorSlider/ColorSlider.types.js.map +1 -0
- package/lib/components/ColorSlider/index.js +4 -0
- package/lib/components/ColorSlider/index.js.map +1 -0
- package/lib/components/ColorSlider/renderColorSlider.js +14 -0
- package/lib/components/ColorSlider/renderColorSlider.js.map +1 -0
- package/lib/components/ColorSlider/useColorSlider.js +129 -0
- package/lib/components/ColorSlider/useColorSlider.js.map +1 -0
- package/lib/components/ColorSlider/useColorSliderStyles.styles.js +288 -0
- package/lib/components/ColorSlider/useColorSliderStyles.styles.js.map +1 -0
- package/lib/contexts/colorPicker.js +23 -0
- package/lib/contexts/colorPicker.js.map +1 -0
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -0
- package/lib/types/color.js +1 -0
- package/lib/types/color.js.map +1 -0
- package/lib/utils/adjustChannel.js +22 -0
- package/lib/utils/adjustChannel.js.map +1 -0
- package/lib/utils/constants.js +6 -0
- package/lib/utils/constants.js.map +1 -0
- package/lib/utils/createHsvColor.js +17 -0
- package/lib/utils/createHsvColor.js.map +1 -0
- package/lib/utils/getCoordinates.js +24 -0
- package/lib/utils/getCoordinates.js.map +1 -0
- package/lib/utils/getPercent.js +11 -0
- package/lib/utils/getPercent.js.map +1 -0
- package/lib-commonjs/AlphaSlider.js +31 -0
- package/lib-commonjs/AlphaSlider.js.map +1 -0
- package/lib-commonjs/ColorArea.js +31 -0
- package/lib-commonjs/ColorArea.js.map +1 -0
- package/lib-commonjs/ColorPicker.js +28 -0
- package/lib-commonjs/ColorPicker.js.map +1 -0
- package/lib-commonjs/ColorSlider.js +31 -0
- package/lib-commonjs/ColorSlider.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.js +23 -0
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.types.js +6 -0
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.types.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/alphaSliderUtils.js +39 -0
- package/lib-commonjs/components/AlphaSlider/alphaSliderUtils.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/index.js +34 -0
- package/lib-commonjs/components/AlphaSlider/index.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.js +22 -0
- package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSlider.js +58 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSlider.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.js +69 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.js.map +1 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.js +115 -0
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ColorArea/ColorArea.js +23 -0
- package/lib-commonjs/components/ColorArea/ColorArea.js.map +1 -0
- package/lib-commonjs/components/ColorArea/ColorArea.types.js +6 -0
- package/lib-commonjs/components/ColorArea/ColorArea.types.js.map +1 -0
- package/lib-commonjs/components/ColorArea/index.js +34 -0
- package/lib-commonjs/components/ColorArea/index.js.map +1 -0
- package/lib-commonjs/components/ColorArea/renderColorArea.js +23 -0
- package/lib-commonjs/components/ColorArea/renderColorArea.js.map +1 -0
- package/lib-commonjs/components/ColorArea/useColorArea.js +190 -0
- package/lib-commonjs/components/ColorArea/useColorArea.js.map +1 -0
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.js +377 -0
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/ColorPicker.js +25 -0
- package/lib-commonjs/components/ColorPicker/ColorPicker.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/ColorPicker.types.js +6 -0
- package/lib-commonjs/components/ColorPicker/ColorPicker.types.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/index.js +31 -0
- package/lib-commonjs/components/ColorPicker/index.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/renderColorPicker.js +22 -0
- package/lib-commonjs/components/ColorPicker/renderColorPicker.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/useColorPicker.js +37 -0
- package/lib-commonjs/components/ColorPicker/useColorPicker.js.map +1 -0
- package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.js +50 -0
- package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/ColorSlider.js +23 -0
- package/lib-commonjs/components/ColorSlider/ColorSlider.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/ColorSlider.types.js +6 -0
- package/lib-commonjs/components/ColorSlider/ColorSlider.types.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/index.js +34 -0
- package/lib-commonjs/components/ColorSlider/index.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/renderColorSlider.js +22 -0
- package/lib-commonjs/components/ColorSlider/renderColorSlider.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/useColorSlider.js +130 -0
- package/lib-commonjs/components/ColorSlider/useColorSlider.js.map +1 -0
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.js +454 -0
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/colorPicker.js +48 -0
- package/lib-commonjs/contexts/colorPicker.js.map +1 -0
- package/lib-commonjs/index.js +76 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/types/color.js +4 -0
- package/lib-commonjs/types/color.js.map +1 -0
- package/lib-commonjs/utils/adjustChannel.js +27 -0
- package/lib-commonjs/utils/adjustChannel.js.map +1 -0
- package/lib-commonjs/utils/constants.js +33 -0
- package/lib-commonjs/utils/constants.js.map +1 -0
- package/lib-commonjs/utils/createHsvColor.js +27 -0
- package/lib-commonjs/utils/createHsvColor.js.map +1 -0
- package/lib-commonjs/utils/getCoordinates.js +31 -0
- package/lib-commonjs/utils/getCoordinates.js.map +1 -0
- package/lib-commonjs/utils/getPercent.js +21 -0
- package/lib-commonjs/utils/getPercent.js.map +1 -0
- package/package.json +53 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Change Log - @fluentui/react-color-picker
|
|
2
|
+
|
|
3
|
+
This log was last generated on Wed, 19 Mar 2025 04:10:29 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
<!-- Start content -->
|
|
6
|
+
|
|
7
|
+
## [0.0.0-nightly-20250319-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker_v0.0.0-nightly-20250319-0406.1)
|
|
8
|
+
|
|
9
|
+
Wed, 19 Mar 2025 04:10:29 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.3.1..@fluentui/react-color-picker_v0.0.0-nightly-20250319-0406.1)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
21
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
22
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20250319-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/2230a32a129a913bbdb2d9791fed782c456d1264) by beachball)
|
|
23
|
+
|
|
24
|
+
## [0.3.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.3.1)
|
|
25
|
+
|
|
26
|
+
Tue, 11 Mar 2025 18:58:50 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.3.0..@fluentui/react-color-picker-preview_v0.3.1)
|
|
28
|
+
|
|
29
|
+
### Patches
|
|
30
|
+
|
|
31
|
+
- fix: placed thumb half outside of colorSlider and colorArea ([PR #33880](https://github.com/microsoft/fluentui/pull/33880) by vkozlova@microsoft.com)
|
|
32
|
+
- fix: focus on Y axis ([PR #33899](https://github.com/microsoft/fluentui/pull/33899) by v.kozlova13@gmail.com)
|
|
33
|
+
- Bump @fluentui/react-context-selector to v9.1.73 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
|
|
34
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.51 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
|
|
35
|
+
- Bump @fluentui/react-shared-contexts to v9.22.0 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
|
|
36
|
+
- Bump @fluentui/react-tabster to v9.24.1 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
|
|
37
|
+
- Bump @fluentui/react-utilities to v9.18.21 ([PR #33927](https://github.com/microsoft/fluentui/pull/33927) by beachball)
|
|
38
|
+
|
|
39
|
+
## [0.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.3.0)
|
|
40
|
+
|
|
41
|
+
Fri, 21 Feb 2025 14:34:05 GMT
|
|
42
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.2.0..@fluentui/react-color-picker-preview_v0.3.0)
|
|
43
|
+
|
|
44
|
+
### Minor changes
|
|
45
|
+
|
|
46
|
+
- Bump @fluentui/react-tabster to v9.24.0 ([PR #33876](https://github.com/microsoft/fluentui/pull/33876) by beachball)
|
|
47
|
+
|
|
48
|
+
## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.2.0)
|
|
49
|
+
|
|
50
|
+
Tue, 18 Feb 2025 11:26:27 GMT
|
|
51
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.6..@fluentui/react-color-picker-preview_v0.2.0)
|
|
52
|
+
|
|
53
|
+
### Minor changes
|
|
54
|
+
|
|
55
|
+
- custom color channels ([PR #33763](https://github.com/microsoft/fluentui/pull/33763) by v.kozlova13@gmail.com)
|
|
56
|
+
|
|
57
|
+
### Patches
|
|
58
|
+
|
|
59
|
+
- fix: design changes for ColorPicker ([PR #33785](https://github.com/microsoft/fluentui/pull/33785) by vkozlova@microsoft.com)
|
|
60
|
+
|
|
61
|
+
## [0.1.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.6)
|
|
62
|
+
|
|
63
|
+
Fri, 07 Feb 2025 10:42:11 GMT
|
|
64
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.5..@fluentui/react-color-picker-preview_v0.1.6)
|
|
65
|
+
|
|
66
|
+
### Patches
|
|
67
|
+
|
|
68
|
+
- fix: thumb design for ColorPicker - partner's ask ([PR #33743](https://github.com/microsoft/fluentui/pull/33743) by v.kozlova13@gmail.com)
|
|
69
|
+
|
|
70
|
+
## [0.1.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.5)
|
|
71
|
+
|
|
72
|
+
Mon, 27 Jan 2025 20:27:33 GMT
|
|
73
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.4..@fluentui/react-color-picker-preview_v0.1.5)
|
|
74
|
+
|
|
75
|
+
### Patches
|
|
76
|
+
|
|
77
|
+
- fix: default state for ColorSliders ([PR #33715](https://github.com/microsoft/fluentui/pull/33715) by v.kozlova13@gmail.com)
|
|
78
|
+
|
|
79
|
+
## [0.1.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.4)
|
|
80
|
+
|
|
81
|
+
Wed, 22 Jan 2025 14:00:14 GMT
|
|
82
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.3..@fluentui/react-color-picker-preview_v0.1.4)
|
|
83
|
+
|
|
84
|
+
### Patches
|
|
85
|
+
|
|
86
|
+
- chore: Moving @ctrl/tinycolor dependency to be a caret dependency in production packages. ([PR #33611](https://github.com/microsoft/fluentui/pull/33611) by makotom@microsoft.com)
|
|
87
|
+
- fix: focus jumps to inputY instead of next element ([PR #33620](https://github.com/microsoft/fluentui/pull/33620) by vkozlova@microsoft.com)
|
|
88
|
+
- feat: Added `transparent` option to the AlphaSlider ([PR #33572](https://github.com/microsoft/fluentui/pull/33572) by v.kozlova13@gmail.com)
|
|
89
|
+
- Bump @fluentui/react-context-selector to v9.1.72 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
90
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.50 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
91
|
+
- Bump @fluentui/react-tabster to v9.23.3 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
92
|
+
- Bump @fluentui/react-utilities to v9.18.20 ([PR #33631](https://github.com/microsoft/fluentui/pull/33631) by beachball)
|
|
93
|
+
|
|
94
|
+
## [0.1.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.3)
|
|
95
|
+
|
|
96
|
+
Wed, 08 Jan 2025 18:33:32 GMT
|
|
97
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.2..@fluentui/react-color-picker-preview_v0.1.3)
|
|
98
|
+
|
|
99
|
+
### Patches
|
|
100
|
+
|
|
101
|
+
- fix: contrast border of thumb ([PR #33526](https://github.com/microsoft/fluentui/pull/33526) by vkozlova@microsoft.com)
|
|
102
|
+
- feat: added aria-attributes to the ColorPicker ([PR #33543](https://github.com/microsoft/fluentui/pull/33543) by vkozlova@microsoft.com)
|
|
103
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.49 ([PR #33550](https://github.com/microsoft/fluentui/pull/33550) by beachball)
|
|
104
|
+
|
|
105
|
+
## [0.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.2)
|
|
106
|
+
|
|
107
|
+
Mon, 16 Dec 2024 16:26:48 GMT
|
|
108
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.1..@fluentui/react-color-picker-preview_v0.1.2)
|
|
109
|
+
|
|
110
|
+
### Patches
|
|
111
|
+
|
|
112
|
+
- fix(react-color-picker): active axis for ColorPicker ([PR #33415](https://github.com/microsoft/fluentui/pull/33415) by vkozlova@microsoft.com)
|
|
113
|
+
- Bump @fluentui/react-context-selector to v9.1.71 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
114
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.48 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
115
|
+
- Bump @fluentui/react-shared-contexts to v9.21.2 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
116
|
+
- Bump @fluentui/react-tabster to v9.23.2 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
117
|
+
- Bump @fluentui/react-theme to v9.1.24 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
118
|
+
- Bump @fluentui/react-utilities to v9.18.19 ([PR #33468](https://github.com/microsoft/fluentui/pull/33468) by beachball)
|
|
119
|
+
|
|
120
|
+
## [0.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.1)
|
|
121
|
+
|
|
122
|
+
Mon, 09 Dec 2024 17:38:10 GMT
|
|
123
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-color-picker-preview_v0.1.0..@fluentui/react-color-picker-preview_v0.1.1)
|
|
124
|
+
|
|
125
|
+
### Patches
|
|
126
|
+
|
|
127
|
+
- chore: remove usage of "export \*" ([PR #33384](https://github.com/microsoft/fluentui/pull/33384) by olfedias@microsoft.com)
|
|
128
|
+
|
|
129
|
+
## [0.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-color-picker-preview_v0.1.0)
|
|
130
|
+
|
|
131
|
+
Fri, 06 Dec 2024 12:53:39 GMT
|
|
132
|
+
|
|
133
|
+
### Minor changes
|
|
134
|
+
|
|
135
|
+
- 'feat(react-color-picker): Release ColorPicker as unstable ([PR #33395](https://github.com/microsoft/fluentui/pull/33395) by vkozlova@microsoft.com)
|
|
136
|
+
- Bump @fluentui/react-context-selector to v9.1.70 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
|
137
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.47 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
|
138
|
+
- Bump @fluentui/react-shared-contexts to v9.21.1 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
|
139
|
+
- Bump @fluentui/react-tabster to v9.23.1 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
|
140
|
+
- Bump @fluentui/react-theme to v9.1.23 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
|
141
|
+
- Bump @fluentui/react-utilities to v9.18.18 ([PR #33372](https://github.com/microsoft/fluentui/pull/33372) by beachball)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@fluentui/react-color-picker
|
|
2
|
+
|
|
3
|
+
Copyright (c) Microsoft Corporation
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
14
|
+
|
|
15
|
+
Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @fluentui/react-color-picker
|
|
2
|
+
|
|
3
|
+
**React Color Picker components for [Fluent UI React](https://react.fluentui.dev/)**
|
|
4
|
+
|
|
5
|
+
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
|
6
|
+
|
|
7
|
+
The ColorPicker allows users to browse and select colors.
|
|
8
|
+
By default, it enables navigation through a color spectrum and operates in HSV/HSL format.
|
|
9
|
+
However, it is also possible to specify a color using Red-Green-Blue (RGB), an alpha color code, or hexadecimal values in the text boxes.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
To import React ColorPicker components:
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { ColorPicker, ColorSwatch, type ColorPickerOnSelectEventHandler } from '@fluentui/react-components';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Simple example of ColorPicker Usage:
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { tinycolor } from '@ctrl/tinycolor';
|
|
23
|
+
import { ColorPicker, ColorSlider, AlphaSlider, type ColorPickerProps, ColorArea } from '@fluentui/react-components';
|
|
24
|
+
|
|
25
|
+
export const App = () => {
|
|
26
|
+
const [color, setColor] = React.useState(DEFAULT_COLOR_HSV);
|
|
27
|
+
const handleChange: ColorPickerProps['onColorChange'] = (_, data) =>
|
|
28
|
+
setColor({ ...data.color, a: data.color.a ?? 1 });
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<ColorPicker color={color} onColorChange={handleChange}>
|
|
33
|
+
<ColorSlider />
|
|
34
|
+
<AlphaSlider />
|
|
35
|
+
<ColorArea />
|
|
36
|
+
</ColorPicker>
|
|
37
|
+
|
|
38
|
+
<div className={styles.previewColor} style={{ backgroundColor: tinycolor(color).toRgbString() }} />
|
|
39
|
+
</>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Specification
|
|
45
|
+
|
|
46
|
+
See the [Spec.md](./docs/Spec.md) file for background information on the design/engineering decisions of the component.
|
|
47
|
+
|
|
48
|
+
## API
|
|
49
|
+
|
|
50
|
+
For information about the components, please refer to the API documentation.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
2
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
|
3
|
+
import type { EventData } from '@fluentui/react-utilities';
|
|
4
|
+
import type { EventHandler } from '@fluentui/react-utilities';
|
|
5
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
6
|
+
import * as React_2 from 'react';
|
|
7
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
8
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* AlphaSlider component
|
|
12
|
+
*/
|
|
13
|
+
export declare const AlphaSlider: ForwardRefComponent<AlphaSliderProps>;
|
|
14
|
+
|
|
15
|
+
export declare const alphaSliderClassNames: SlotClassNames<AlphaSliderSlots>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* AlphaSlider Props
|
|
19
|
+
*/
|
|
20
|
+
export declare type AlphaSliderProps = Omit<ColorSliderProps, 'channel'> & {
|
|
21
|
+
/**
|
|
22
|
+
* The `transparency` property determines how the alpha channel is interpreted.
|
|
23
|
+
* - When `false`, the alpha channel represents the opacity of the color.
|
|
24
|
+
* - When `true`, the alpha channel represents the transparency of the color.
|
|
25
|
+
* For example, a 30% transparent color has 70% opacity.
|
|
26
|
+
*
|
|
27
|
+
* @defaultvalue false
|
|
28
|
+
*/
|
|
29
|
+
transparency?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare type AlphaSliderSlots = ColorSliderSlots;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* State used in rendering AlphaSlider
|
|
36
|
+
*/
|
|
37
|
+
export declare type AlphaSliderState = ComponentState<AlphaSliderSlots> & Pick<AlphaSliderProps, 'vertical'> & Omit<ColorSliderState, keyof ColorSliderSlots | 'components'>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* ColorArea component
|
|
41
|
+
*/
|
|
42
|
+
export declare const ColorArea: ForwardRefComponent<ColorAreaProps>;
|
|
43
|
+
|
|
44
|
+
export declare const colorAreaClassNames: SlotClassNames<ColorAreaSlots>;
|
|
45
|
+
|
|
46
|
+
declare type ColorAreaOnColorChangeData = EventData<'change', React_2.SyntheticEvent | MouseEvent> & {
|
|
47
|
+
color: HsvColor;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* ColorArea Props
|
|
52
|
+
*/
|
|
53
|
+
export declare type ColorAreaProps = Omit<ComponentProps<Partial<ColorAreaSlots>>, 'color' | 'onChange'> & Pick<ColorPickerProps, 'shape'> & {
|
|
54
|
+
/**
|
|
55
|
+
* The current color of the ColorArea.
|
|
56
|
+
*/
|
|
57
|
+
color?: HsvColor;
|
|
58
|
+
/**
|
|
59
|
+
* The starting value for an uncontrolled ColorArea.
|
|
60
|
+
*/
|
|
61
|
+
defaultColor?: HsvColor;
|
|
62
|
+
/**
|
|
63
|
+
* Triggers a callback when the value has been changed. This will be called on every individual step.
|
|
64
|
+
*/
|
|
65
|
+
onChange?: EventHandler<ColorAreaOnColorChangeData>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export declare type ColorAreaSlots = {
|
|
69
|
+
root: NonNullable<Slot<'div'>>;
|
|
70
|
+
thumb?: NonNullable<Slot<'div'>>;
|
|
71
|
+
inputX?: NonNullable<Slot<'input'>>;
|
|
72
|
+
inputY?: NonNullable<Slot<'input'>>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* State used in rendering ColorArea
|
|
77
|
+
*/
|
|
78
|
+
export declare type ColorAreaState = ComponentState<Required<ColorAreaSlots>> & Pick<ColorAreaProps, 'color' | 'shape'>;
|
|
79
|
+
|
|
80
|
+
declare type ColorChannel = 'hue' | 'saturation' | 'value';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* ColorPicker component
|
|
84
|
+
*/
|
|
85
|
+
export declare const ColorPicker: ForwardRefComponent<ColorPickerProps>;
|
|
86
|
+
|
|
87
|
+
export declare const colorPickerClassNames: SlotClassNames<ColorPickerSlots>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The context through which individual color controls communicate with the picker.
|
|
91
|
+
*/
|
|
92
|
+
declare type ColorPickerContextValue = Pick<ColorPickerProps, 'shape' | 'color'> & {
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
* Callback used by Sliders to request a change on it's selected value
|
|
96
|
+
* Should be used to get value of color channel
|
|
97
|
+
*/
|
|
98
|
+
requestChange: (event: React_2.ChangeEvent<HTMLInputElement>, data: {
|
|
99
|
+
color: HsvColor;
|
|
100
|
+
}) => void;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
declare type ColorPickerContextValues = {
|
|
104
|
+
colorPicker: ColorPickerContextValue;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
declare type ColorPickerOnChangeData = EventData<'change', React_2.ChangeEvent<HTMLInputElement>> & {
|
|
108
|
+
color: HsvColor;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* ColorPicker Props
|
|
113
|
+
*/
|
|
114
|
+
export declare type ColorPickerProps = Omit<ComponentProps<Partial<ColorPickerSlots>>, 'color'> & {
|
|
115
|
+
/**
|
|
116
|
+
* Selected color.
|
|
117
|
+
*/
|
|
118
|
+
color?: HsvColor;
|
|
119
|
+
/**
|
|
120
|
+
* Callback for when the user changes the color.
|
|
121
|
+
*/
|
|
122
|
+
onColorChange?: EventHandler<ColorPickerOnChangeData>;
|
|
123
|
+
/**
|
|
124
|
+
* ColorPicker shape
|
|
125
|
+
* @defaultvalue 'rounded'
|
|
126
|
+
*/
|
|
127
|
+
shape?: 'rounded' | 'square';
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export declare type ColorPickerSlots = {
|
|
131
|
+
root: Slot<'div'>;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* State used in rendering ColorPicker
|
|
136
|
+
*/
|
|
137
|
+
export declare type ColorPickerState = ComponentState<ColorPickerSlots> & ColorPickerContextValue;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* ColorSlider component
|
|
141
|
+
*/
|
|
142
|
+
export declare const ColorSlider: ForwardRefComponent<ColorSliderProps>;
|
|
143
|
+
|
|
144
|
+
export declare const colorSliderClassNames: SlotClassNames<ColorSliderSlots>;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* ColorSlider Props
|
|
148
|
+
*/
|
|
149
|
+
export declare type ColorSliderProps = Omit<ComponentProps<Partial<ColorSliderSlots>, 'input'>, 'defaultValue' | 'onChange' | 'value' | 'color'> & Pick<ColorPickerProps, 'shape'> & {
|
|
150
|
+
/**
|
|
151
|
+
* Color channel of the Slider.
|
|
152
|
+
* @default `hue`
|
|
153
|
+
*/
|
|
154
|
+
channel?: ColorChannel;
|
|
155
|
+
/**
|
|
156
|
+
* Triggers a callback when the value has been changed. This will be called on every individual step.
|
|
157
|
+
*/
|
|
158
|
+
onChange?: EventHandler<SliderOnChangeData>;
|
|
159
|
+
/**
|
|
160
|
+
* Render the Slider in a vertical orientation, smallest value on the bottom.
|
|
161
|
+
* @default `false`
|
|
162
|
+
*/
|
|
163
|
+
vertical?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Color of the ColorPicker
|
|
166
|
+
*/
|
|
167
|
+
color?: HsvColor;
|
|
168
|
+
/**
|
|
169
|
+
* The starting color for an uncontrolled ColorSlider.
|
|
170
|
+
*/
|
|
171
|
+
defaultColor?: HsvColor;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
export declare type ColorSliderSlots = {
|
|
175
|
+
root: NonNullable<Slot<'div'>>;
|
|
176
|
+
rail: NonNullable<Slot<'div'>>;
|
|
177
|
+
thumb: NonNullable<Slot<'div'>>;
|
|
178
|
+
input: NonNullable<Slot<'input'>>;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* State used in rendering ColorSlider
|
|
183
|
+
*/
|
|
184
|
+
export declare type ColorSliderState = ComponentState<ColorSliderSlots> & Pick<ColorSliderProps, 'vertical' | 'shape' | 'channel'>;
|
|
185
|
+
|
|
186
|
+
declare type HsvColor = {
|
|
187
|
+
h: number;
|
|
188
|
+
s: number;
|
|
189
|
+
v: number;
|
|
190
|
+
a?: number;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Render the final JSX of AlphaSlider
|
|
195
|
+
*/
|
|
196
|
+
export declare const renderAlphaSlider_unstable: (state: AlphaSliderState) => JSX.Element;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Render the final JSX of ColorArea
|
|
200
|
+
*/
|
|
201
|
+
export declare const renderColorArea_unstable: (state: ColorAreaState) => JSX.Element;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Render the final JSX of ColorPicker
|
|
205
|
+
*/
|
|
206
|
+
export declare const renderColorPicker_unstable: (state: ColorPickerState, contextValues: ColorPickerContextValues) => JSX.Element;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Render the final JSX of ColorSlider
|
|
210
|
+
*/
|
|
211
|
+
export declare const renderColorSlider_unstable: (state: ColorSliderState) => JSX.Element;
|
|
212
|
+
|
|
213
|
+
declare type SliderOnChangeData = EventData<'change', React_2.ChangeEvent<HTMLInputElement>> & {
|
|
214
|
+
color: HsvColor;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Create the state required to render AlphaSlider.
|
|
219
|
+
*
|
|
220
|
+
* The returned state can be modified with hooks such as useAlphaSliderStyles_unstable,
|
|
221
|
+
* before being passed to renderAlphaSlider_unstable.
|
|
222
|
+
*
|
|
223
|
+
* @param props - props from this instance of AlphaSlider
|
|
224
|
+
* @param ref - reference to root HTMLInputElement of AlphaSlider
|
|
225
|
+
*/
|
|
226
|
+
export declare const useAlphaSlider_unstable: (props: AlphaSliderProps, ref: React_2.Ref<HTMLInputElement>) => AlphaSliderState;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Apply styling to the AlphaSlider slots based on the state
|
|
230
|
+
*/
|
|
231
|
+
export declare const useAlphaSliderStyles_unstable: (state: AlphaSliderState) => AlphaSliderState;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Create the state required to render ColorArea.
|
|
235
|
+
*
|
|
236
|
+
* The returned state can be modified with hooks such as useColorAreaStyles_unstable,
|
|
237
|
+
* before being passed to renderColorArea_unstable.
|
|
238
|
+
*
|
|
239
|
+
* @param props - props from this instance of ColorArea
|
|
240
|
+
* @param ref - reference to root HTMLDivElement of ColorArea
|
|
241
|
+
*/
|
|
242
|
+
export declare const useColorArea_unstable: (props: ColorAreaProps, ref: React_2.Ref<HTMLDivElement>) => ColorAreaState;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Apply styling to the ColorArea slots based on the state
|
|
246
|
+
*/
|
|
247
|
+
export declare const useColorAreaStyles_unstable: (state: ColorAreaState) => ColorAreaState;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Create the state required to render ColorPicker.
|
|
251
|
+
*
|
|
252
|
+
* The returned state can be modified with hooks such as useColorPickerStyles_unstable,
|
|
253
|
+
* before being passed to renderColorPicker_unstable.
|
|
254
|
+
*
|
|
255
|
+
* @param props - props from this instance of ColorPicker
|
|
256
|
+
* @param ref - reference to root HTMLDivElement of ColorPicker
|
|
257
|
+
*/
|
|
258
|
+
export declare const useColorPicker_unstable: (props: ColorPickerProps, ref: React_2.Ref<HTMLDivElement>) => ColorPickerState;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Apply styling to the ColorPicker slots based on the state
|
|
262
|
+
*/
|
|
263
|
+
export declare const useColorPickerStyles_unstable: (state: ColorPickerState) => ColorPickerState;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* Create the state required to render ColorSlider.
|
|
267
|
+
*
|
|
268
|
+
* The returned state can be modified with hooks such as useColorSliderStyles_unstable,
|
|
269
|
+
* before being passed to renderColorSlider_unstable.
|
|
270
|
+
*
|
|
271
|
+
* @param props - props from this instance of ColorSlider
|
|
272
|
+
* @param ref - reference to root HTMLInputElement of ColorSlider
|
|
273
|
+
*/
|
|
274
|
+
export declare const useColorSlider_unstable: (props: ColorSliderProps, ref: React_2.Ref<HTMLInputElement>) => ColorSliderState;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Apply styling to the ColorSlider slots based on the state
|
|
278
|
+
*/
|
|
279
|
+
export declare const useColorSliderStyles_unstable: (state: ColorSliderState) => ColorSliderState;
|
|
280
|
+
|
|
281
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AlphaSlider, alphaSliderCSSVars, alphaSliderClassNames, renderAlphaSlider_unstable, useAlphaSliderStyles_unstable, useAlphaSlider_unstable } from './components/AlphaSlider/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/AlphaSlider.ts"],"sourcesContent":["export type { AlphaSliderProps, AlphaSliderSlots, AlphaSliderState } from './components/AlphaSlider/index';\nexport {\n AlphaSlider,\n alphaSliderCSSVars,\n alphaSliderClassNames,\n renderAlphaSlider_unstable,\n useAlphaSliderStyles_unstable,\n useAlphaSlider_unstable,\n} from './components/AlphaSlider/index';\n"],"names":["AlphaSlider","alphaSliderCSSVars","alphaSliderClassNames","renderAlphaSlider_unstable","useAlphaSliderStyles_unstable","useAlphaSlider_unstable"],"rangeMappings":"","mappings":"AACA,SACEA,WAAW,EACXC,kBAAkB,EAClBC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,iCAAiC"}
|
package/lib/ColorArea.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColorArea, colorAreaCSSVars, colorAreaClassNames, renderColorArea_unstable, useColorAreaStyles_unstable, useColorArea_unstable } from './components/ColorArea/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorArea.ts"],"sourcesContent":["export type {\n ColorAreaOnColorChangeData,\n ColorAreaProps,\n ColorAreaSlots,\n ColorAreaState,\n} from './components/ColorArea/index';\nexport {\n ColorArea,\n colorAreaCSSVars,\n colorAreaClassNames,\n renderColorArea_unstable,\n useColorAreaStyles_unstable,\n useColorArea_unstable,\n} from './components/ColorArea/index';\n"],"names":["ColorArea","colorAreaCSSVars","colorAreaClassNames","renderColorArea_unstable","useColorAreaStyles_unstable","useColorArea_unstable"],"rangeMappings":"","mappings":"AAMA,SACEA,SAAS,EACTC,gBAAgB,EAChBC,mBAAmB,EACnBC,wBAAwB,EACxBC,2BAA2B,EAC3BC,qBAAqB,QAChB,+BAA+B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColorPicker, colorPickerClassNames, renderColorPicker_unstable, useColorPickerStyles_unstable, useColorPicker_unstable } from './components/ColorPicker/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorPicker.ts"],"sourcesContent":["export type {\n ColorPickerOnChangeData,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './components/ColorPicker/index';\nexport {\n ColorPicker,\n colorPickerClassNames,\n renderColorPicker_unstable,\n useColorPickerStyles_unstable,\n useColorPicker_unstable,\n} from './components/ColorPicker/index';\n"],"names":["ColorPicker","colorPickerClassNames","renderColorPicker_unstable","useColorPickerStyles_unstable","useColorPicker_unstable"],"rangeMappings":"","mappings":"AAMA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ColorSlider, colorSliderCSSVars, colorSliderClassNames, renderColorSlider_unstable, useColorSliderStyles_unstable, useColorSlider_unstable } from './components/ColorSlider/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorSlider.ts"],"sourcesContent":["export type {\n ColorSliderProps,\n ColorSliderSlots,\n ColorSliderState,\n SliderOnChangeData,\n} from './components/ColorSlider/index';\nexport {\n ColorSlider,\n colorSliderCSSVars,\n colorSliderClassNames,\n renderColorSlider_unstable,\n useColorSliderStyles_unstable,\n useColorSlider_unstable,\n} from './components/ColorSlider/index';\n"],"names":["ColorSlider","colorSliderCSSVars","colorSliderClassNames","renderColorSlider_unstable","useColorSliderStyles_unstable","useColorSlider_unstable"],"rangeMappings":"","mappings":"AAMA,SACEA,WAAW,EACXC,kBAAkB,EAClBC,qBAAqB,EACrBC,0BAA0B,EAC1BC,6BAA6B,EAC7BC,uBAAuB,QAClB,iCAAiC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAlphaSlider_unstable } from './useAlphaSlider';
|
|
3
|
+
import { renderAlphaSlider_unstable } from './renderAlphaSlider';
|
|
4
|
+
import { useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
|
+
/**
|
|
7
|
+
* AlphaSlider component
|
|
8
|
+
*/ export const AlphaSlider = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
|
+
const state = useAlphaSlider_unstable(props, ref);
|
|
10
|
+
useAlphaSliderStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook_unstable('useAlphaSliderStyles_unstable')(state);
|
|
12
|
+
return renderAlphaSlider_unstable(state);
|
|
13
|
+
});
|
|
14
|
+
AlphaSlider.displayName = 'AlphaSlider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAlphaSlider_unstable } from './useAlphaSlider';\nimport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nimport { useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';\nimport type { AlphaSliderProps } from './AlphaSlider.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * AlphaSlider component\n */\nexport const AlphaSlider: ForwardRefComponent<AlphaSliderProps> = React.forwardRef((props, ref) => {\n const state = useAlphaSlider_unstable(props, ref);\n\n useAlphaSliderStyles_unstable(state);\n useCustomStyleHook_unstable('useAlphaSliderStyles_unstable')(state);\n\n return renderAlphaSlider_unstable(state);\n});\n\nAlphaSlider.displayName = 'AlphaSlider';\n"],"names":["React","useAlphaSlider_unstable","renderAlphaSlider_unstable","useAlphaSliderStyles_unstable","useCustomStyleHook_unstable","AlphaSlider","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,gCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.types.ts"],"sourcesContent":["import type { ComponentState } from '@fluentui/react-utilities';\nimport type { ColorSliderSlots, ColorSliderProps, ColorSliderState } from '../ColorSlider/ColorSlider.types';\n\nexport type AlphaSliderSlots = ColorSliderSlots;\n\n/**\n * AlphaSlider Props\n */\nexport type AlphaSliderProps = Omit<ColorSliderProps, 'channel'> & {\n /**\n * The `transparency` property determines how the alpha channel is interpreted.\n * - When `false`, the alpha channel represents the opacity of the color.\n * - When `true`, the alpha channel represents the transparency of the color.\n * For example, a 30% transparent color has 70% opacity.\n *\n * @defaultvalue false\n */\n transparency?: boolean;\n};\n\n/**\n * State used in rendering AlphaSlider\n */\nexport type AlphaSliderState = ComponentState<AlphaSliderSlots> &\n Pick<AlphaSliderProps, 'vertical'> &\n Omit<ColorSliderState, keyof ColorSliderSlots | 'components'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAoBA;;CAEC,GACD,WAEgE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adjusts the given value based on the transparency flag.
|
|
3
|
+
*
|
|
4
|
+
* @param value - The numeric value to adjust.
|
|
5
|
+
* @param transparency - A boolean flag indicating whether to adjust for transparency.
|
|
6
|
+
* @returns The adjusted value.
|
|
7
|
+
*/ export function adjustToTransparency(value, transparency) {
|
|
8
|
+
return transparency ? 100 - value : value;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the transparency value based on the given parameters.
|
|
12
|
+
*
|
|
13
|
+
* @param transparency - A boolean flag indicating whether to adjust for transparency.
|
|
14
|
+
* @param value - An optional numeric value to adjust.
|
|
15
|
+
* @returns The calculated transparency value or undefined if the value is not provided.
|
|
16
|
+
*/ export function calculateTransparencyValue(transparency, value) {
|
|
17
|
+
return value !== undefined ? adjustToTransparency(value * 100, transparency) : undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Determines the direction of the slider based on the given parameters.
|
|
21
|
+
*
|
|
22
|
+
* @param dir - The text direction, either 'ltr' (left-to-right) or 'rtl' (right-to-left).
|
|
23
|
+
* @param vertical - A boolean indicating if the slider is vertical.
|
|
24
|
+
* @param transparency - A boolean indicating if the slider is for transparency.
|
|
25
|
+
* @returns The direction of the slider as a string representing degrees (e.g., '90deg').
|
|
26
|
+
*/ export function getSliderDirection(dir, vertical, transparency) {
|
|
27
|
+
if (vertical) {
|
|
28
|
+
return transparency ? '180deg' : '0deg';
|
|
29
|
+
}
|
|
30
|
+
return dir === 'ltr' && !transparency ? '90deg' : '-90deg';
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/alphaSliderUtils.ts"],"sourcesContent":["/**\n * Adjusts the given value based on the transparency flag.\n *\n * @param value - The numeric value to adjust.\n * @param transparency - A boolean flag indicating whether to adjust for transparency.\n * @returns The adjusted value.\n */\nexport function adjustToTransparency(value: number, transparency: boolean) {\n return transparency ? 100 - value : value;\n}\n\n/**\n * Calculates the transparency value based on the given parameters.\n *\n * @param transparency - A boolean flag indicating whether to adjust for transparency.\n * @param value - An optional numeric value to adjust.\n * @returns The calculated transparency value or undefined if the value is not provided.\n */\nexport function calculateTransparencyValue(transparency: boolean, value?: number) {\n return value !== undefined ? adjustToTransparency(value * 100, transparency) : undefined;\n}\n\n/**\n * Determines the direction of the slider based on the given parameters.\n *\n * @param dir - The text direction, either 'ltr' (left-to-right) or 'rtl' (right-to-left).\n * @param vertical - A boolean indicating if the slider is vertical.\n * @param transparency - A boolean indicating if the slider is for transparency.\n * @returns The direction of the slider as a string representing degrees (e.g., '90deg').\n */\nexport function getSliderDirection(dir: 'ltr' | 'rtl', vertical: boolean, transparency: boolean) {\n if (vertical) {\n return transparency ? '180deg' : '0deg';\n }\n return dir === 'ltr' && !transparency ? '90deg' : '-90deg';\n}\n"],"names":["adjustToTransparency","value","transparency","calculateTransparencyValue","undefined","getSliderDirection","dir","vertical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;CAMC,GACD,OAAO,SAASA,qBAAqBC,KAAa,EAAEC,YAAqB;IACvE,OAAOA,eAAe,MAAMD,QAAQA;AACtC;AAEA;;;;;;CAMC,GACD,OAAO,SAASE,2BAA2BD,YAAqB,EAAED,KAAc;IAC9E,OAAOA,UAAUG,YAAYJ,qBAAqBC,QAAQ,KAAKC,gBAAgBE;AACjF;AAEA;;;;;;;CAOC,GACD,OAAO,SAASC,mBAAmBC,GAAkB,EAAEC,QAAiB,EAAEL,YAAqB;IAC7F,IAAIK,UAAU;QACZ,OAAOL,eAAe,WAAW;IACnC;IACA,OAAOI,QAAQ,SAAS,CAACJ,eAAe,UAAU;AACpD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AlphaSlider } from './AlphaSlider';
|
|
2
|
+
export { renderAlphaSlider_unstable } from './renderAlphaSlider';
|
|
3
|
+
export { useAlphaSlider_unstable } from './useAlphaSlider';
|
|
4
|
+
export { alphaSliderCSSVars, alphaSliderClassNames, useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/index.ts"],"sourcesContent":["export { AlphaSlider } from './AlphaSlider';\nexport type { AlphaSliderProps, AlphaSliderSlots, AlphaSliderState } from './AlphaSlider.types';\nexport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nexport { useAlphaSlider_unstable } from './useAlphaSlider';\nexport {\n alphaSliderCSSVars,\n alphaSliderClassNames,\n useAlphaSliderStyles_unstable,\n} from './useAlphaSliderStyles.styles';\n"],"names":["AlphaSlider","renderAlphaSlider_unstable","useAlphaSlider_unstable","alphaSliderCSSVars","alphaSliderClassNames","useAlphaSliderStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SACEC,kBAAkB,EAClBC,qBAAqB,EACrBC,6BAA6B,QACxB,gCAAgC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from '@fluentui/react-utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of AlphaSlider
|
|
5
|
+
*/ export const renderAlphaSlider_unstable = (state)=>{
|
|
6
|
+
assertSlots(state);
|
|
7
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ _jsx(state.input, {}),
|
|
10
|
+
/*#__PURE__*/ _jsx(state.rail, {}),
|
|
11
|
+
/*#__PURE__*/ _jsx(state.thumb, {})
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/renderAlphaSlider.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { AlphaSliderState, AlphaSliderSlots } from './AlphaSlider.types';\n\n/**\n * Render the final JSX of AlphaSlider\n */\nexport const renderAlphaSlider_unstable = (state: AlphaSliderState) => {\n assertSlots<AlphaSliderSlots>(state);\n\n return (\n <state.root>\n <state.input />\n <state.rail />\n <state.thumb />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAlphaSlider_unstable","state","root","input","rail","thumb"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBACE,MAACA,MAAMC,IAAI;;0BACT,KAACD,MAAME,KAAK;0BACZ,KAACF,MAAMG,IAAI;0BACX,KAACH,MAAMI,KAAK;;;AAGlB,EAAE"}
|