@fluentui/react-color-picker 9.3.0 → 9.3.2

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +29 -2
  2. package/lib/components/AlphaSlider/alphaSliderUtils.js +1 -1
  3. package/lib/components/AlphaSlider/alphaSliderUtils.js.map +1 -1
  4. package/lib/components/AlphaSlider/useAlphaSlider.js +1 -0
  5. package/lib/components/AlphaSlider/useAlphaSlider.js.map +1 -1
  6. package/lib/components/AlphaSlider/useAlphaSliderState.js +10 -10
  7. package/lib/components/AlphaSlider/useAlphaSliderState.js.map +1 -1
  8. package/lib/components/ColorArea/useColorArea.js +1 -0
  9. package/lib/components/ColorArea/useColorArea.js.map +1 -1
  10. package/lib/components/ColorSlider/ColorSlider.constants.js +1 -0
  11. package/lib/components/ColorSlider/ColorSlider.constants.js.map +1 -1
  12. package/lib/components/ColorSlider/useColorSlider.js +26 -8
  13. package/lib/components/ColorSlider/useColorSlider.js.map +1 -1
  14. package/lib/components/ColorSlider/useColorSliderStyles.styles.js +4 -3
  15. package/lib/components/ColorSlider/useColorSliderStyles.styles.js.map +1 -1
  16. package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js +3 -2
  17. package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js.map +1 -1
  18. package/lib/utils/adjustChannel.js +2 -1
  19. package/lib/utils/adjustChannel.js.map +1 -1
  20. package/lib-commonjs/components/AlphaSlider/alphaSliderUtils.cjs +1 -1
  21. package/lib-commonjs/components/AlphaSlider/alphaSliderUtils.cjs.map +1 -1
  22. package/lib-commonjs/components/AlphaSlider/useAlphaSlider.cjs +1 -0
  23. package/lib-commonjs/components/AlphaSlider/useAlphaSlider.cjs.map +1 -1
  24. package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.cjs +9 -9
  25. package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.cjs.map +1 -1
  26. package/lib-commonjs/components/ColorArea/useColorArea.cjs +1 -0
  27. package/lib-commonjs/components/ColorArea/useColorArea.cjs.map +1 -1
  28. package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs +1 -0
  29. package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs.map +1 -1
  30. package/lib-commonjs/components/ColorSlider/useColorSlider.cjs +26 -8
  31. package/lib-commonjs/components/ColorSlider/useColorSlider.cjs.map +1 -1
  32. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.cjs +4 -12
  33. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.cjs.map +1 -1
  34. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.cjs +3 -2
  35. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.cjs.map +1 -1
  36. package/lib-commonjs/utils/adjustChannel.cjs +2 -1
  37. package/lib-commonjs/utils/adjustChannel.cjs.map +1 -1
  38. package/package.json +12 -9
@@ -23,5 +23,6 @@ function clampValue(value, channel = 'hue') {
23
23
  return (0, _reactutilities.clamp)(value, _constants.MIN, MAX);
24
24
  }
25
25
  function adjustChannel(channel, actions) {
26
- return actions[channel] || actions.hue;
26
+ var _actions_channel;
27
+ return (_actions_channel = actions[channel]) !== null && _actions_channel !== void 0 ? _actions_channel : actions.hue;
27
28
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/adjustChannel.ts"],"sourcesContent":["import type { ColorChannel } from '../components/ColorSlider/ColorSlider.types';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from './constants';\nimport { clamp } from '@fluentui/react-utilities';\n\n/**\n * Clamps a given value to the valid range for a specified color channel.\n *\n * @param value - The numeric value to be clamped.\n * @param channel - The color channel to use for clamping. Defaults to 'hue'.\n * @returns The clamped value within the range defined by the color channel.\n */\nexport function clampValue(value: number, channel: ColorChannel = 'hue'): number {\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n return clamp(value, MIN, MAX);\n}\n\nexport type ChannelActions<T> = {\n hue: T;\n saturation: T;\n value: T;\n};\n\n/**\n * Adjusts the specified color channel using the provided actions.\n *\n * @template T - The type of the result returned by the actions.\n * @param {ColorChannel} channel - The color channel to adjust.\n * @param {ChannelActions<T>} actions - An object containing actions for each color channel.\n * @returns {T} - The result of the action corresponding to the specified channel, or the hue action if the channel is not found.\n */\nexport function adjustChannel<T>(channel: ColorChannel, actions: ChannelActions<T>): T {\n return actions[channel] || actions.hue;\n}\n"],"names":["MIN","HUE_MAX","MAX","COLOR_MAX","clamp","clampValue","value","channel","adjustChannel","actions","hue"],"mappings":";;;;;;;;;;;iBA8BgBQ;;;cAnBAH;;;;2BAV+B,iBAAc;gCACvC,4BAA4B;AAS3C,SAASA,WAAWC,KAAa,EAAEC,UAAwB,KAAK;IACrE,MAAML,MAAMK,YAAY,QAAQN,kBAAAA,GAAUE,cAAAA;IAC1C,WAAOC,qBAAAA,EAAME,OAAON,cAAAA,EAAKE;AAC3B;AAgBO,SAASM,cAAiBD,OAAqB,EAAEE,OAA0B;IAChF,OAAOA,OAAO,CAACF,QAAQ,IAAIE,QAAQC,GAAG;AACxC"}
1
+ {"version":3,"sources":["../src/utils/adjustChannel.ts"],"sourcesContent":["import type { ColorChannel } from '../components/ColorSlider/ColorSlider.types';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from './constants';\nimport { clamp } from '@fluentui/react-utilities';\n\n/**\n * Clamps a given value to the valid range for a specified color channel.\n *\n * @param value - The numeric value to be clamped.\n * @param channel - The color channel to use for clamping. Defaults to 'hue'.\n * @returns The clamped value within the range defined by the color channel.\n */\nexport function clampValue(value: number, channel: ColorChannel = 'hue'): number {\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n return clamp(value, MIN, MAX);\n}\n\nexport type ChannelActions<T> = {\n hue: T;\n saturation: T;\n value: T;\n};\n\n/**\n * Adjusts the specified color channel using the provided actions.\n *\n * @template T - The type of the result returned by the actions.\n * @param {ColorChannel} channel - The color channel to adjust.\n * @param {ChannelActions<T>} actions - An object containing actions for each color channel.\n * @returns {T} - The result of the action corresponding to the specified channel, or the hue action if the channel is not found.\n */\nexport function adjustChannel<T>(channel: ColorChannel, actions: ChannelActions<T>): T {\n return actions[channel] ?? actions.hue;\n}\n"],"names":["MIN","HUE_MAX","MAX","COLOR_MAX","clamp","clampValue","value","channel","adjustChannel","actions","hue"],"mappings":";;;;;;;;;;;iBA8BgBQ;;;cAnBAH;;;;2BAV+B,iBAAc;gCACvC,4BAA4B;AAS3C,SAASA,WAAWC,KAAa,EAAEC,UAAwB,KAAK;IACrE,MAAML,MAAMK,YAAY,QAAQN,kBAAAA,GAAUE,cAAAA;IAC1C,WAAOC,qBAAAA,EAAME,OAAON,cAAAA,EAAKE;AAC3B;AAgBO,SAASM,cAAiBD,OAAqB,EAAEE,OAA0B;QACzEA;IAAP,OAAOA,CAAAA,mBAAAA,OAAO,CAACF,QAAAA,AAAQ,MAAA,QAAhBE,qBAAAA,KAAAA,IAAAA,mBAAoBA,QAAQC,GAAG;AACxC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-color-picker",
3
- "version": "9.3.0",
3
+ "version": "9.3.2",
4
4
  "description": "ColorPicker component for Fluent UI React.",
5
5
  "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
@@ -19,20 +19,23 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@fluentui/react-context-selector": "^9.2.19",
23
- "@fluentui/react-jsx-runtime": "^9.4.5",
24
- "@fluentui/react-shared-contexts": "^9.26.3",
25
- "@fluentui/react-tabster": "^9.26.17",
22
+ "@fluentui/react-context-selector": "^9.2.21",
23
+ "@fluentui/react-jsx-runtime": "^9.4.7",
24
+ "@fluentui/react-shared-contexts": "^9.26.4",
25
+ "@fluentui/react-tabster": "^9.26.19",
26
26
  "@fluentui/react-theme": "^9.2.2",
27
- "@fluentui/react-utilities": "^9.26.6",
27
+ "@fluentui/react-utilities": "^9.27.0",
28
28
  "@griffel/react": "^1.5.32",
29
29
  "@swc/helpers": "^0.5.1"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@types/react": ">=16.14.0 <20.0.0",
33
- "@types/react-dom": ">=16.9.0 <20.0.0",
34
- "react": ">=16.14.0 <20.0.0",
35
- "react-dom": ">=16.14.0 <20.0.0"
33
+ "react": ">=16.14.0 <20.0.0"
34
+ },
35
+ "peerDependenciesMeta": {
36
+ "@types/react": {
37
+ "optional": true
38
+ }
36
39
  },
37
40
  "exports": {
38
41
  ".": {