@fluentui/react-swatch-picker 0.0.0-nightly-20240517-0405.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 +136 -0
- package/LICENSE +15 -0
- package/README.md +61 -0
- package/dist/index.d.ts +346 -0
- package/lib/ColorSwatch.js +1 -0
- package/lib/ColorSwatch.js.map +1 -0
- package/lib/EmptySwatch.js +1 -0
- package/lib/EmptySwatch.js.map +1 -0
- package/lib/ImageSwatch.js +1 -0
- package/lib/ImageSwatch.js.map +1 -0
- package/lib/SwatchPicker.js +1 -0
- package/lib/SwatchPicker.js.map +1 -0
- package/lib/SwatchPickerRow.js +1 -0
- package/lib/SwatchPickerRow.js.map +1 -0
- package/lib/components/ColorSwatch/ColorSwatch.js +14 -0
- package/lib/components/ColorSwatch/ColorSwatch.js.map +1 -0
- package/lib/components/ColorSwatch/ColorSwatch.types.js +1 -0
- package/lib/components/ColorSwatch/ColorSwatch.types.js.map +1 -0
- package/lib/components/ColorSwatch/index.js +5 -0
- package/lib/components/ColorSwatch/index.js.map +1 -0
- package/lib/components/ColorSwatch/renderColorSwatch.js +14 -0
- package/lib/components/ColorSwatch/renderColorSwatch.js.map +1 -0
- package/lib/components/ColorSwatch/useColorSwatch.js +76 -0
- package/lib/components/ColorSwatch/useColorSwatch.js.map +1 -0
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js +148 -0
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js.map +1 -0
- package/lib/components/EmptySwatch/EmptySwatch.js +14 -0
- package/lib/components/EmptySwatch/EmptySwatch.js.map +1 -0
- package/lib/components/EmptySwatch/EmptySwatch.types.js +1 -0
- package/lib/components/EmptySwatch/EmptySwatch.types.js.map +1 -0
- package/lib/components/EmptySwatch/index.js +5 -0
- package/lib/components/EmptySwatch/index.js.map +1 -0
- package/lib/components/EmptySwatch/renderEmptySwatch.js +8 -0
- package/lib/components/EmptySwatch/renderEmptySwatch.js.map +1 -0
- package/lib/components/EmptySwatch/useEmptySwatch.js +36 -0
- package/lib/components/EmptySwatch/useEmptySwatch.js.map +1 -0
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js +78 -0
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -0
- package/lib/components/ImageSwatch/ImageSwatch.js +14 -0
- package/lib/components/ImageSwatch/ImageSwatch.js.map +1 -0
- package/lib/components/ImageSwatch/ImageSwatch.types.js +1 -0
- package/lib/components/ImageSwatch/ImageSwatch.types.js.map +1 -0
- package/lib/components/ImageSwatch/index.js +5 -0
- package/lib/components/ImageSwatch/index.js.map +1 -0
- package/lib/components/ImageSwatch/renderImageSwatch.js +8 -0
- package/lib/components/ImageSwatch/renderImageSwatch.js.map +1 -0
- package/lib/components/ImageSwatch/useImageSwatch.js +51 -0
- package/lib/components/ImageSwatch/useImageSwatch.js.map +1 -0
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js +102 -0
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js.map +1 -0
- package/lib/components/SwatchPicker/SwatchPicker.js +16 -0
- package/lib/components/SwatchPicker/SwatchPicker.js.map +1 -0
- package/lib/components/SwatchPicker/SwatchPicker.types.js +1 -0
- package/lib/components/SwatchPicker/SwatchPicker.types.js.map +1 -0
- package/lib/components/SwatchPicker/index.js +5 -0
- package/lib/components/SwatchPicker/index.js.map +1 -0
- package/lib/components/SwatchPicker/renderSwatchPicker.js +14 -0
- package/lib/components/SwatchPicker/renderSwatchPicker.js.map +1 -0
- package/lib/components/SwatchPicker/useSwatchPicker.js +54 -0
- package/lib/components/SwatchPicker/useSwatchPicker.js.map +1 -0
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js +44 -0
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +1 -0
- package/lib/components/SwatchPickerRow/SwatchPickerRow.js +14 -0
- package/lib/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -0
- package/lib/components/SwatchPickerRow/SwatchPickerRow.types.js +1 -0
- package/lib/components/SwatchPickerRow/SwatchPickerRow.types.js.map +1 -0
- package/lib/components/SwatchPickerRow/index.js +5 -0
- package/lib/components/SwatchPickerRow/index.js.map +1 -0
- package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js +8 -0
- package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js.map +1 -0
- package/lib/components/SwatchPickerRow/useSwatchPickerRow.js +28 -0
- package/lib/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -0
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js +29 -0
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +1 -0
- package/lib/contexts/index.js +1 -0
- package/lib/contexts/index.js.map +1 -0
- package/lib/contexts/swatchPicker.js +29 -0
- package/lib/contexts/swatchPicker.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib/utils/renderUtils.js +32 -0
- package/lib/utils/renderUtils.js.map +1 -0
- package/lib-commonjs/ColorSwatch.js +6 -0
- package/lib-commonjs/ColorSwatch.js.map +1 -0
- package/lib-commonjs/EmptySwatch.js +6 -0
- package/lib-commonjs/EmptySwatch.js.map +1 -0
- package/lib-commonjs/ImageSwatch.js +6 -0
- package/lib-commonjs/ImageSwatch.js.map +1 -0
- package/lib-commonjs/SwatchPicker.js +6 -0
- package/lib-commonjs/SwatchPicker.js.map +1 -0
- package/lib-commonjs/SwatchPickerRow.js +6 -0
- package/lib-commonjs/SwatchPickerRow.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.js +23 -0
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.types.js +4 -0
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.types.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/index.js +10 -0
- package/lib-commonjs/components/ColorSwatch/index.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/renderColorSwatch.js +22 -0
- package/lib-commonjs/components/ColorSwatch/renderColorSwatch.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/useColorSwatch.js +79 -0
- package/lib-commonjs/components/ColorSwatch/useColorSwatch.js.map +1 -0
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.js +303 -0
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.js +23 -0
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.types.js +4 -0
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.types.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/index.js +10 -0
- package/lib-commonjs/components/EmptySwatch/index.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/renderEmptySwatch.js +16 -0
- package/lib-commonjs/components/EmptySwatch/renderEmptySwatch.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/useEmptySwatch.js +39 -0
- package/lib-commonjs/components/EmptySwatch/useEmptySwatch.js.map +1 -0
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.js +197 -0
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.js +23 -0
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.types.js +4 -0
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.types.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/index.js +10 -0
- package/lib-commonjs/components/ImageSwatch/index.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/renderImageSwatch.js +16 -0
- package/lib-commonjs/components/ImageSwatch/renderImageSwatch.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/useImageSwatch.js +54 -0
- package/lib-commonjs/components/ImageSwatch/useImageSwatch.js.map +1 -0
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.js +246 -0
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.js +25 -0
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.types.js +6 -0
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.types.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/index.js +10 -0
- package/lib-commonjs/components/SwatchPicker/index.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/renderSwatchPicker.js +22 -0
- package/lib-commonjs/components/SwatchPicker/renderSwatchPicker.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/useSwatchPicker.js +57 -0
- package/lib-commonjs/components/SwatchPicker/useSwatchPicker.js.map +1 -0
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.js +74 -0
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.js +23 -0
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.types.js +4 -0
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.types.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/index.js +10 -0
- package/lib-commonjs/components/SwatchPickerRow/index.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/renderSwatchPickerRow.js +16 -0
- package/lib-commonjs/components/SwatchPickerRow/renderSwatchPickerRow.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRow.js +31 -0
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js +47 -0
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +1 -0
- package/lib-commonjs/contexts/index.js +6 -0
- package/lib-commonjs/contexts/index.js.map +1 -0
- package/lib-commonjs/contexts/swatchPicker.js +54 -0
- package/lib-commonjs/contexts/swatchPicker.js.map +1 -0
- package/lib-commonjs/index.js +112 -0
- package/lib-commonjs/index.js.map +1 -0
- package/lib-commonjs/utils/renderUtils.js +43 -0
- package/lib-commonjs/utils/renderUtils.js.map +1 -0
- package/package.json +69 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Change Log - @fluentui/react-swatch-picker
|
|
2
|
+
|
|
3
|
+
This log was last generated on Fri, 17 May 2024 04:20:50 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
<!-- Start content -->
|
|
6
|
+
|
|
7
|
+
## [0.0.0-nightly-20240517-0405.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v0.0.0-nightly-20240517-0405.1)
|
|
8
|
+
|
|
9
|
+
Fri, 17 May 2024 04:20:50 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.6.0..@fluentui/react-swatch-picker_v0.0.0-nightly-20240517-0405.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-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
17
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
18
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
19
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
20
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
21
|
+
- Bump @fluentui/react-conformance to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
22
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20240517-0405.1 ([commit](https://github.com/microsoft/fluentui/commit/4c363b45d0336c09595c7855916edb8be1147f90) by beachball)
|
|
23
|
+
|
|
24
|
+
## [0.6.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.6.0)
|
|
25
|
+
|
|
26
|
+
Thu, 16 May 2024 09:25:18 GMT
|
|
27
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.5.0..@fluentui/react-swatch-picker-preview_v0.6.0)
|
|
28
|
+
|
|
29
|
+
### Minor changes
|
|
30
|
+
|
|
31
|
+
- feat(react-swatch-picker): added contrast ratio utils ([PR #31358](https://github.com/microsoft/fluentui/pull/31358) by vkozlova@microsoft.com)
|
|
32
|
+
|
|
33
|
+
### Patches
|
|
34
|
+
|
|
35
|
+
- chore: Upgrade react-icons version to 2.0.239 to pick up provider export map fix. ([PR #31287](https://github.com/microsoft/fluentui/pull/31287) by ololubek@microsoft.com)
|
|
36
|
+
|
|
37
|
+
## [0.5.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.5.0)
|
|
38
|
+
|
|
39
|
+
Mon, 13 May 2024 12:34:20 GMT
|
|
40
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.4.3..@fluentui/react-swatch-picker-preview_v0.5.0)
|
|
41
|
+
|
|
42
|
+
### Minor changes
|
|
43
|
+
|
|
44
|
+
- feat: Add missing SwatchPicker context exports. ([PR #31328](https://github.com/microsoft/fluentui/pull/31328) by estebanmu@microsoft.com)
|
|
45
|
+
|
|
46
|
+
## [0.4.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.4.3)
|
|
47
|
+
|
|
48
|
+
Thu, 09 May 2024 19:35:12 GMT
|
|
49
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.4.2..@fluentui/react-swatch-picker-preview_v0.4.3)
|
|
50
|
+
|
|
51
|
+
### Patches
|
|
52
|
+
|
|
53
|
+
- Bump @fluentui/react-tabster to v9.21.2 ([PR #31321](https://github.com/microsoft/fluentui/pull/31321) by beachball)
|
|
54
|
+
|
|
55
|
+
## [0.4.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.4.2)
|
|
56
|
+
|
|
57
|
+
Mon, 06 May 2024 12:55:02 GMT
|
|
58
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.4.1..@fluentui/react-swatch-picker-preview_v0.4.2)
|
|
59
|
+
|
|
60
|
+
### Patches
|
|
61
|
+
|
|
62
|
+
- Bump @fluentui/react-context-selector to v9.1.59 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
|
|
63
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.37 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
|
|
64
|
+
- Bump @fluentui/react-shared-contexts to v9.18.0 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
|
|
65
|
+
- Bump @fluentui/react-tabster to v9.21.1 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
|
|
66
|
+
- Bump @fluentui/react-utilities to v9.18.8 ([PR #31271](https://github.com/microsoft/fluentui/pull/31271) by beachball)
|
|
67
|
+
|
|
68
|
+
## [0.4.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.4.1)
|
|
69
|
+
|
|
70
|
+
Thu, 02 May 2024 11:36:38 GMT
|
|
71
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.4.0..@fluentui/react-swatch-picker-preview_v0.4.1)
|
|
72
|
+
|
|
73
|
+
### Patches
|
|
74
|
+
|
|
75
|
+
- chore: upgrade @fluentui/react-icons to 2.0.237. ([PR #31139](https://github.com/microsoft/fluentui/pull/31139) by ololubek@microsoft.com)
|
|
76
|
+
- Bump @fluentui/react-tabster to v9.21.0 ([PR #31231](https://github.com/microsoft/fluentui/pull/31231) by beachball)
|
|
77
|
+
|
|
78
|
+
## [0.4.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.4.0)
|
|
79
|
+
|
|
80
|
+
Tue, 23 Apr 2024 08:17:48 GMT
|
|
81
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.3.0..@fluentui/react-swatch-picker-preview_v0.4.0)
|
|
82
|
+
|
|
83
|
+
### Minor changes
|
|
84
|
+
|
|
85
|
+
- fix: BREAKING CHANGE - api changes and fixes ([PR #31097](https://github.com/microsoft/fluentui/pull/31097) by vkozlova@microsoft.com)
|
|
86
|
+
- Bump @fluentui/react-context-selector to v9.1.58 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
87
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.36 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
88
|
+
- Bump @fluentui/react-shared-contexts to v9.17.0 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
89
|
+
- Bump @fluentui/react-tabster to v9.20.1 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
90
|
+
- Bump @fluentui/react-utilities to v9.18.7 ([PR #31113](https://github.com/microsoft/fluentui/pull/31113) by beachball)
|
|
91
|
+
|
|
92
|
+
## [0.3.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.3.0)
|
|
93
|
+
|
|
94
|
+
Wed, 17 Apr 2024 21:53:58 GMT
|
|
95
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.2.1..@fluentui/react-swatch-picker-preview_v0.3.0)
|
|
96
|
+
|
|
97
|
+
### Minor changes
|
|
98
|
+
|
|
99
|
+
- feat(react-swatch-picker): Added EmptySwatch component ([PR #30953](https://github.com/microsoft/fluentui/pull/30953) by vkozlova@microsoft.com)
|
|
100
|
+
- Bump @fluentui/react-tabster to v9.20.0 ([PR #31100](https://github.com/microsoft/fluentui/pull/31100) by beachball)
|
|
101
|
+
|
|
102
|
+
### Patches
|
|
103
|
+
|
|
104
|
+
- fix(react-swatch-picker): colors in HC mode ([PR #31014](https://github.com/microsoft/fluentui/pull/31014) by vkozlova@microsoft.com)
|
|
105
|
+
- fix(react-swatch-picker): a11y attrs for ImageSwatch ([PR #31060](https://github.com/microsoft/fluentui/pull/31060) by vkozlova@microsoft.com)
|
|
106
|
+
- chore: Update react-icons to 2.0.235 ([PR #31011](https://github.com/microsoft/fluentui/pull/31011) by ololubek@microsoft.com)
|
|
107
|
+
|
|
108
|
+
## [0.2.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.2.1)
|
|
109
|
+
|
|
110
|
+
Tue, 02 Apr 2024 09:48:00 GMT
|
|
111
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.2.0..@fluentui/react-swatch-picker-preview_v0.2.1)
|
|
112
|
+
|
|
113
|
+
### Patches
|
|
114
|
+
|
|
115
|
+
- Bump @fluentui/react-context-selector to v9.1.57 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
|
|
116
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.35 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
|
|
117
|
+
- Bump @fluentui/react-shared-contexts to v9.16.0 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
|
|
118
|
+
- Bump @fluentui/react-tabster to v9.19.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
|
|
119
|
+
- Bump @fluentui/react-utilities to v9.18.6 ([PR #30644](https://github.com/microsoft/fluentui/pull/30644) by beachball)
|
|
120
|
+
|
|
121
|
+
## [0.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.2.0)
|
|
122
|
+
|
|
123
|
+
Thu, 28 Mar 2024 10:43:54 GMT
|
|
124
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker-preview_v0.1.0..@fluentui/react-swatch-picker-preview_v0.2.0)
|
|
125
|
+
|
|
126
|
+
### Minor changes
|
|
127
|
+
|
|
128
|
+
- feat(react-swatch-picker): changed API in rendering utils ([PR #30868](https://github.com/microsoft/fluentui/pull/30868) by vkozlova@microsoft.com)
|
|
129
|
+
|
|
130
|
+
## [0.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker-preview_v0.1.0)
|
|
131
|
+
|
|
132
|
+
Wed, 27 Mar 2024 10:29:33 GMT
|
|
133
|
+
|
|
134
|
+
### Minor changes
|
|
135
|
+
|
|
136
|
+
- 'feat: release react-swatch-picker to unstable ([PR #30881](https://github.com/microsoft/fluentui/pull/30881) by vkozlova@microsoft.com)
|
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@fluentui/react-swatch-picker-preview
|
|
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,61 @@
|
|
|
1
|
+
# @fluentui/react-swatch-picker
|
|
2
|
+
|
|
3
|
+
**React Swatch 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 SwatchPicker is used in graphic and text editors. It allows user to choose a needed color, image or pattern.
|
|
8
|
+
The SwatchPicker can be integrated within a popover or used as a standalone feature.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
To import React SwatchPicker components:
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
import { SwatchPicker, ColorSwatch, SwatchPickerOnSelectEventHandler } from '@fluentui/react-components';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Simple example of SwatchPicker Usage:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
import { SwatchPicker, ColorSwatch, SwatchPickerOnSelectEventHandler } from '@fluentui/react-components';
|
|
22
|
+
|
|
23
|
+
export const App = () => {
|
|
24
|
+
const [selectedValue, setSelectedValue] = React.useState('00B053');
|
|
25
|
+
const [selectedColor, setSelectedColor] = React.useState('#00B053');
|
|
26
|
+
const handleSelect: SwatchPickerOnSelectEventHandler = (_, data) => {
|
|
27
|
+
setSelectedValue(data.selectedValue);
|
|
28
|
+
setSelectedColor(data.selectedColor);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<SwatchPicker aria-label="SwatchPicker default" selectedValue={selectedValue} onSelectionChange={handleSelect}>
|
|
34
|
+
<ColorSwatch color="#FF1921" value="FF1921" aria-label="red" />
|
|
35
|
+
<ColorSwatch color="#FFC12E" value="FFC12E" aria-label="orange" />
|
|
36
|
+
<ColorSwatch color="#FEFF37" value="FEFF37" aria-label="yellow" />
|
|
37
|
+
<ColorSwatch disabled color="#90D057" value="90D057" aria-label="light green" />
|
|
38
|
+
<ColorSwatch color="#00B053" value="00B053" aria-label="green" />
|
|
39
|
+
<ColorSwatch color="#00AFED" value="00AFED" aria-label="light blue" />
|
|
40
|
+
<ColorSwatch color="#006EBD" value="006EBD" aria-label="blue" />
|
|
41
|
+
<ColorSwatch color="#011F5E" value="011F5E" aria-label="dark blue" />
|
|
42
|
+
<ColorSwatch color="#712F9E" value="712F9E" aria-label="purple" />
|
|
43
|
+
</SwatchPicker>
|
|
44
|
+
|
|
45
|
+
<div
|
|
46
|
+
style={{
|
|
47
|
+
backgroundColor: selectedColor,
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
</>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Specification
|
|
56
|
+
|
|
57
|
+
See the [Spec.md](./docs/Spec.md) file for background information on the design/engineering decisions of the component.
|
|
58
|
+
|
|
59
|
+
## API
|
|
60
|
+
|
|
61
|
+
For information about the components, please refer to the [API documentation](https://react.fluentui.dev/?path=/docs/preview-components-swatchpicker--default).
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
|
|
3
|
+
import type { ComponentProps } from '@fluentui/react-utilities';
|
|
4
|
+
import type { ComponentState } from '@fluentui/react-utilities';
|
|
5
|
+
import type { ContextSelector } from '@fluentui/react-context-selector';
|
|
6
|
+
import type { EventData } from '@fluentui/react-utilities';
|
|
7
|
+
import type { EventHandler } from '@fluentui/react-utilities';
|
|
8
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
9
|
+
import * as React_2 from 'react';
|
|
10
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
11
|
+
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* ColorSwatch component is used to render a colors, icons and gradients.
|
|
15
|
+
*/
|
|
16
|
+
export declare const ColorSwatch: ForwardRefComponent<ColorSwatchProps>;
|
|
17
|
+
|
|
18
|
+
export declare const colorSwatchClassNames: SlotClassNames<ColorSwatchSlots>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* ColorSwatch Props
|
|
22
|
+
*/
|
|
23
|
+
export declare type ColorSwatchProps = ComponentProps<ColorSwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'> & {
|
|
24
|
+
/**
|
|
25
|
+
* Border color when contrast is low
|
|
26
|
+
*/
|
|
27
|
+
borderColor?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Swatch color
|
|
30
|
+
*/
|
|
31
|
+
color: string;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the swatch is disabled
|
|
34
|
+
*/
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Swatch value
|
|
38
|
+
*/
|
|
39
|
+
value: string;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export declare type ColorSwatchSlots = {
|
|
43
|
+
root: NonNullable<Slot<'button'>>;
|
|
44
|
+
icon?: Slot<'span'>;
|
|
45
|
+
disabledIcon?: Slot<'span'>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* State used in rendering ColorSwatch
|
|
50
|
+
*/
|
|
51
|
+
export declare type ColorSwatchState = ComponentState<ColorSwatchSlots> & Pick<ColorSwatchProps, 'color' | 'disabled' | 'size' | 'shape' | 'value'> & {
|
|
52
|
+
selected: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* EmptySwatch component is used for adding new color swatches.
|
|
57
|
+
*/
|
|
58
|
+
export declare const EmptySwatch: ForwardRefComponent<EmptySwatchProps>;
|
|
59
|
+
|
|
60
|
+
export declare const emptySwatchClassNames: SlotClassNames<EmptySwatchSlots>;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* EmptySwatch Props
|
|
64
|
+
*/
|
|
65
|
+
export declare type EmptySwatchProps = ComponentProps<EmptySwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'>;
|
|
66
|
+
|
|
67
|
+
export declare type EmptySwatchSlots = {
|
|
68
|
+
root: Slot<'button'>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* State used in rendering EmptySwatch
|
|
73
|
+
*/
|
|
74
|
+
export declare type EmptySwatchState = ComponentState<EmptySwatchSlots> & Pick<EmptySwatchProps, 'size' | 'shape'>;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* ImageSwatch component is used to render an images, patterns and textures.
|
|
78
|
+
*/
|
|
79
|
+
export declare const ImageSwatch: ForwardRefComponent<ImageSwatchProps>;
|
|
80
|
+
|
|
81
|
+
export declare const imageSwatchClassNames: SlotClassNames<ImageSwatchSlots>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* ImageSwatch Props
|
|
85
|
+
*/
|
|
86
|
+
export declare type ImageSwatchProps = ComponentProps<ImageSwatchSlots> & Pick<SwatchPickerProps, 'size' | 'shape'> & {
|
|
87
|
+
/**
|
|
88
|
+
* Swatch color
|
|
89
|
+
*/
|
|
90
|
+
src: string;
|
|
91
|
+
/**
|
|
92
|
+
* Swatch value
|
|
93
|
+
*/
|
|
94
|
+
value: string;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export declare type ImageSwatchSlots = {
|
|
98
|
+
root: Slot<'button'>;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* State used in rendering ImageSwatch
|
|
103
|
+
*/
|
|
104
|
+
export declare type ImageSwatchState = ComponentState<ImageSwatchSlots> & Pick<ImageSwatchProps, 'color' | 'size' | 'shape' | 'value'> & {
|
|
105
|
+
selected: boolean;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Render the final JSX of ColorSwatch
|
|
110
|
+
*/
|
|
111
|
+
export declare const renderColorSwatch_unstable: (state: ColorSwatchState) => JSX.Element;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Render the final JSX of EmptySwatch
|
|
115
|
+
*/
|
|
116
|
+
export declare const renderEmptySwatch_unstable: (state: EmptySwatchState) => JSX.Element;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Render the final JSX of ImageSwatch
|
|
120
|
+
*/
|
|
121
|
+
export declare const renderImageSwatch_unstable: (state: ImageSwatchState) => JSX.Element;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Render the final JSX of SwatchPicker
|
|
125
|
+
*/
|
|
126
|
+
export declare const renderSwatchPicker_unstable: (state: SwatchPickerState, contextValues: SwatchPickerContextValues) => JSX.Element;
|
|
127
|
+
|
|
128
|
+
export declare const renderSwatchPickerGrid: (props: SwatchPickerGridProps) => JSX.Element[];
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Render the final JSX of SwatchPickerRow
|
|
132
|
+
*/
|
|
133
|
+
export declare const renderSwatchPickerRow_unstable: (state: SwatchPickerRowState) => JSX.Element;
|
|
134
|
+
|
|
135
|
+
export declare const swatchCSSVars: {
|
|
136
|
+
color: string;
|
|
137
|
+
borderColor: string;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* SwatchPicker component - TODO: add more docs
|
|
142
|
+
*/
|
|
143
|
+
export declare const SwatchPicker: ForwardRefComponent<SwatchPickerProps>;
|
|
144
|
+
|
|
145
|
+
export declare const swatchPickerClassNames: SlotClassNames<SwatchPickerSlots>;
|
|
146
|
+
|
|
147
|
+
export declare const swatchPickerContextDefaultValue: SwatchPickerContextValue;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* The context through which individual color controls communicate with the picker.
|
|
151
|
+
*/
|
|
152
|
+
export declare type SwatchPickerContextValue = Pick<SwatchPickerProps, 'size' | 'shape' | 'spacing' | 'selectedValue'> & {
|
|
153
|
+
/**
|
|
154
|
+
* Whether layout is grid.
|
|
155
|
+
*/
|
|
156
|
+
isGrid: boolean;
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
* Callback used by ColorSwatch to request a change on it's selected state
|
|
160
|
+
* Should be used to select ColorSwatch
|
|
161
|
+
*/
|
|
162
|
+
requestSelectionChange: (event: React_2.MouseEvent<HTMLButtonElement>, data: {
|
|
163
|
+
selectedValue: string;
|
|
164
|
+
selectedSwatch: string;
|
|
165
|
+
}) => void;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export declare type SwatchPickerContextValues = {
|
|
169
|
+
swatchPicker: SwatchPickerContextValue;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
export declare type SwatchPickerGridProps = {
|
|
173
|
+
items: SwatchProps[];
|
|
174
|
+
columnCount: number;
|
|
175
|
+
renderRow?: (props: {
|
|
176
|
+
children: JSX.Element[];
|
|
177
|
+
rowId: string | number;
|
|
178
|
+
}) => JSX.Element;
|
|
179
|
+
renderSwatch?: (item: SwatchProps) => JSX.Element;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
export declare type SwatchPickerOnSelectEventHandler = EventHandler<SwatchPickerOnSelectionChangeData>;
|
|
183
|
+
|
|
184
|
+
export declare type SwatchPickerOnSelectionChangeData = EventData<'click', React_2.MouseEvent<HTMLButtonElement>> & {
|
|
185
|
+
selectedValue: string;
|
|
186
|
+
selectedSwatch: string;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* SwatchPicker Props
|
|
191
|
+
*/
|
|
192
|
+
export declare type SwatchPickerProps = ComponentProps<SwatchPickerSlots> & {
|
|
193
|
+
/**
|
|
194
|
+
* Default selected value
|
|
195
|
+
*/
|
|
196
|
+
defaultSelectedValue?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Whether SwatchPicker is row or grid
|
|
199
|
+
*/
|
|
200
|
+
layout?: 'row' | 'grid';
|
|
201
|
+
/**
|
|
202
|
+
* Triggers a callback when the value has been changed
|
|
203
|
+
*/
|
|
204
|
+
onSelectionChange?: EventHandler<SwatchPickerOnSelectionChangeData>;
|
|
205
|
+
/**
|
|
206
|
+
* Controlled selected value
|
|
207
|
+
*/
|
|
208
|
+
selectedValue?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Swatch size
|
|
211
|
+
* @defaultvalue 'medium'
|
|
212
|
+
*/
|
|
213
|
+
size?: 'extra-small' | 'small' | 'medium' | 'large';
|
|
214
|
+
/**
|
|
215
|
+
* Swatch shape
|
|
216
|
+
* @defaultvalue 'square'
|
|
217
|
+
*/
|
|
218
|
+
shape?: 'rounded' | 'square' | 'circular';
|
|
219
|
+
/**
|
|
220
|
+
* Spacing between swatches
|
|
221
|
+
* @defaultvalue 'medium'
|
|
222
|
+
*/
|
|
223
|
+
spacing?: 'small' | 'medium';
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export declare const SwatchPickerProvider: React_2.Provider<SwatchPickerContextValue> & React_2.FC<React_2.ProviderProps<SwatchPickerContextValue>>;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* SwatchPickerRow component is used to render a row of swatches.
|
|
230
|
+
*/
|
|
231
|
+
export declare const SwatchPickerRow: ForwardRefComponent<SwatchPickerRowProps>;
|
|
232
|
+
|
|
233
|
+
export declare const swatchPickerRowClassNames: SlotClassNames<SwatchPickerRowSlots>;
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* SwatchPickerRow Props
|
|
237
|
+
*/
|
|
238
|
+
export declare type SwatchPickerRowProps = ComponentProps<SwatchPickerRowSlots>;
|
|
239
|
+
|
|
240
|
+
export declare type SwatchPickerRowSlots = {
|
|
241
|
+
root: Slot<'div'>;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* State used in rendering SwatchPickerRow
|
|
246
|
+
*/
|
|
247
|
+
export declare type SwatchPickerRowState = ComponentState<SwatchPickerRowSlots> & Pick<SwatchPickerProps, 'spacing'>;
|
|
248
|
+
|
|
249
|
+
export declare type SwatchPickerSlots = {
|
|
250
|
+
root: Slot<'div'>;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* State used in rendering SwatchPicker
|
|
255
|
+
*/
|
|
256
|
+
export declare type SwatchPickerState = ComponentState<SwatchPickerSlots> & SwatchPickerContextValue & Pick<SwatchPickerProps, 'layout' | 'size' | 'shape' | 'spacing'> & {
|
|
257
|
+
isGrid: boolean;
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
export declare type SwatchProps = ImageSwatchProps | ColorSwatchProps;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Create the state required to render ColorSwatch.
|
|
264
|
+
*
|
|
265
|
+
* The returned state can be modified with hooks such as useColorSwatchStyles_unstable,
|
|
266
|
+
* before being passed to renderColorSwatch_unstable.
|
|
267
|
+
*
|
|
268
|
+
* @param props - props from this instance of ColorSwatch
|
|
269
|
+
* @param ref - reference to root HTMLButtonElement of ColorSwatch
|
|
270
|
+
*/
|
|
271
|
+
export declare const useColorSwatch_unstable: (props: ColorSwatchProps, ref: React_2.Ref<HTMLButtonElement>) => ColorSwatchState;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Apply styling to the ColorSwatch slots based on the state
|
|
275
|
+
*/
|
|
276
|
+
export declare const useColorSwatchStyles_unstable: (state: ColorSwatchState) => ColorSwatchState;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Create the state required to render EmptySwatch.
|
|
280
|
+
*
|
|
281
|
+
* The returned state can be modified with hooks such as useEmptySwatchStyles_unstable,
|
|
282
|
+
* before being passed to renderEmptySwatch_unstable.
|
|
283
|
+
*
|
|
284
|
+
* @param props - props from this instance of EmptySwatch
|
|
285
|
+
* @param ref - reference to root HTMLDivElement of EmptySwatch
|
|
286
|
+
*/
|
|
287
|
+
export declare const useEmptySwatch_unstable: (props: EmptySwatchProps, ref: React_2.Ref<HTMLButtonElement>) => EmptySwatchState;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Apply styling to the EmptySwatch slots based on the state
|
|
291
|
+
*/
|
|
292
|
+
export declare const useEmptySwatchStyles_unstable: (state: EmptySwatchState) => EmptySwatchState;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Create the state required to render ImageSwatch.
|
|
296
|
+
*
|
|
297
|
+
* The returned state can be modified with hooks such as useImageSwatchStyles_unstable,
|
|
298
|
+
* before being passed to renderImageSwatch_unstable.
|
|
299
|
+
*
|
|
300
|
+
* @param props - props from this instance of ImageSwatch
|
|
301
|
+
* @param ref - reference to root HTMLDivElement of ImageSwatch
|
|
302
|
+
*/
|
|
303
|
+
export declare const useImageSwatch_unstable: (props: ImageSwatchProps, ref: React_2.Ref<HTMLButtonElement>) => ImageSwatchState;
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Apply styling to the ImageSwatch slots based on the state
|
|
307
|
+
*/
|
|
308
|
+
export declare const useImageSwatchStyles_unstable: (state: ImageSwatchState) => ImageSwatchState;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Create the state required to render SwatchPicker.
|
|
312
|
+
*
|
|
313
|
+
* The returned state can be modified with hooks such as useSwatchPickerStyles_unstable,
|
|
314
|
+
* before being passed to renderSwatchPicker_unstable.
|
|
315
|
+
*
|
|
316
|
+
* @param props - props from this instance of SwatchPicker
|
|
317
|
+
* @param ref - reference to root HTMLElement of SwatchPicker
|
|
318
|
+
*/
|
|
319
|
+
export declare const useSwatchPicker_unstable: (props: SwatchPickerProps, ref: React_2.Ref<HTMLDivElement>) => SwatchPickerState;
|
|
320
|
+
|
|
321
|
+
export declare const useSwatchPickerContextValue_unstable: <T>(selector: ContextSelector<SwatchPickerContextValue, T>) => T;
|
|
322
|
+
|
|
323
|
+
export declare const useSwatchPickerContextValues: (state: SwatchPickerState) => SwatchPickerContextValues;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Create the state required to render SwatchPickerRow.
|
|
327
|
+
*
|
|
328
|
+
* The returned state can be modified with hooks such as useSwatchPickerRowStyles_unstable,
|
|
329
|
+
* before being passed to renderSwatchPickerRow_unstable.
|
|
330
|
+
*
|
|
331
|
+
* @param props - props from this instance of SwatchPickerRow
|
|
332
|
+
* @param ref - reference to root HTMLDivElement of SwatchPickerRow
|
|
333
|
+
*/
|
|
334
|
+
export declare const useSwatchPickerRow_unstable: (props: SwatchPickerRowProps, ref: React_2.Ref<HTMLDivElement>) => SwatchPickerRowState;
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Apply styling to the SwatchPickerRow slots based on the state
|
|
338
|
+
*/
|
|
339
|
+
export declare const useSwatchPickerRowStyles_unstable: (state: SwatchPickerRowState) => SwatchPickerRowState;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Apply styling to the SwatchPicker slots based on the state
|
|
343
|
+
*/
|
|
344
|
+
export declare const useSwatchPickerStyles_unstable: (state: SwatchPickerState) => SwatchPickerState;
|
|
345
|
+
|
|
346
|
+
export { }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/ColorSwatch/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ColorSwatch.ts"],"sourcesContent":["export * from './components/ColorSwatch/index';\n"],"names":[],"mappings":"AAAA,cAAc,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/EmptySwatch/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["EmptySwatch.ts"],"sourcesContent":["export * from './components/EmptySwatch/index';\n"],"names":[],"mappings":"AAAA,cAAc,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/ImageSwatch/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ImageSwatch.ts"],"sourcesContent":["export * from './components/ImageSwatch/index';\n"],"names":[],"mappings":"AAAA,cAAc,iCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/SwatchPicker/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SwatchPicker.ts"],"sourcesContent":["export * from './components/SwatchPicker/index';\n"],"names":[],"mappings":"AAAA,cAAc,kCAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/SwatchPickerRow/index';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["SwatchPickerRow.ts"],"sourcesContent":["export * from './components/SwatchPickerRow/index';\n"],"names":[],"mappings":"AAAA,cAAc,qCAAqC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useColorSwatch_unstable } from './useColorSwatch';
|
|
3
|
+
import { renderColorSwatch_unstable } from './renderColorSwatch';
|
|
4
|
+
import { useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
|
+
/**
|
|
7
|
+
* ColorSwatch component is used to render a colors, icons and gradients.
|
|
8
|
+
*/ export const ColorSwatch = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
|
+
const state = useColorSwatch_unstable(props, ref);
|
|
10
|
+
useColorSwatchStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook_unstable('useColorSwatchStyles_unstable')(state);
|
|
12
|
+
return renderColorSwatch_unstable(state);
|
|
13
|
+
});
|
|
14
|
+
ColorSwatch.displayName = 'ColorSwatch';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ColorSwatch.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorSwatch_unstable } from './useColorSwatch';\nimport { renderColorSwatch_unstable } from './renderColorSwatch';\nimport { useColorSwatchStyles_unstable } from './useColorSwatchStyles.styles';\nimport type { ColorSwatchProps } from './ColorSwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorSwatch component is used to render a colors, icons and gradients.\n */\nexport const ColorSwatch: ForwardRefComponent<ColorSwatchProps> = React.forwardRef((props, ref) => {\n const state = useColorSwatch_unstable(props, ref);\n\n useColorSwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useColorSwatchStyles_unstable')(state);\n\n return renderColorSwatch_unstable(state);\n});\n\nColorSwatch.displayName = 'ColorSwatch';\n"],"names":["React","useColorSwatch_unstable","renderColorSwatch_unstable","useColorSwatchStyles_unstable","useCustomStyleHook_unstable","ColorSwatch","forwardRef","props","ref","state","displayName"],"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
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["ColorSwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type ColorSwatchSlots = {\n root: NonNullable<Slot<'button'>>;\n icon?: Slot<'span'>;\n disabledIcon?: Slot<'span'>;\n};\n\n/**\n * ColorSwatch Props\n */\nexport type ColorSwatchProps = ComponentProps<ColorSwatchSlots> &\n Pick<SwatchPickerProps, 'size' | 'shape'> & {\n /**\n * Border color when contrast is low\n */\n borderColor?: string;\n\n /**\n * Swatch color\n */\n color: string;\n\n /**\n * Whether the swatch is disabled\n */\n disabled?: boolean;\n\n /**\n * Swatch value\n */\n value: string;\n };\n\n/**\n * State used in rendering ColorSwatch\n */\nexport type ColorSwatchState = ComponentState<ColorSwatchSlots> &\n Pick<ColorSwatchProps, 'color' | 'disabled' | 'size' | 'shape' | 'value'> & {\n selected: boolean;\n };\n"],"names":[],"mappings":"AAAA,WAyCI"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ColorSwatch';\nexport * from './ColorSwatch.types';\nexport * from './renderColorSwatch';\nexport * from './useColorSwatch';\nexport * from './useColorSwatchStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,gBAAgB;AAC9B,cAAc,sBAAsB;AACpC,cAAc,sBAAsB;AACpC,cAAc,mBAAmB;AACjC,cAAc,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 ColorSwatch
|
|
5
|
+
*/ export const renderColorSwatch_unstable = (state)=>{
|
|
6
|
+
assertSlots(state);
|
|
7
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
|
8
|
+
children: [
|
|
9
|
+
state.root.children,
|
|
10
|
+
state.icon && /*#__PURE__*/ _jsx(state.icon, {}),
|
|
11
|
+
state.disabled && state.disabledIcon && /*#__PURE__*/ _jsx(state.disabledIcon, {})
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderColorSwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ColorSwatchState, ColorSwatchSlots } from './ColorSwatch.types';\n\n/**\n * Render the final JSX of ColorSwatch\n */\nexport const renderColorSwatch_unstable = (state: ColorSwatchState) => {\n assertSlots<ColorSwatchSlots>(state);\n\n return (\n <state.root>\n {state.root.children}\n {state.icon && <state.icon />}\n {state.disabled && state.disabledIcon && <state.disabledIcon />}\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorSwatch_unstable","state","root","children","icon","disabled","disabledIcon"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CAACC;IACzCF,YAA8BE;IAE9B,qBACE,MAACA,MAAMC,IAAI;;YACRD,MAAMC,IAAI,CAACC,QAAQ;YACnBF,MAAMG,IAAI,kBAAI,KAACH,MAAMG,IAAI;YACzBH,MAAMI,QAAQ,IAAIJ,MAAMK,YAAY,kBAAI,KAACL,MAAMK,YAAY;;;AAGlE,EAAE"}
|