@fluentui/react-color-picker 9.2.19 → 9.3.0

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 (211) hide show
  1. package/CHANGELOG.md +24 -2
  2. package/dist/index.d.cts +342 -0
  3. package/dist/index.d.ts +67 -8
  4. package/lib/AlphaSlider.js +1 -1
  5. package/lib/AlphaSlider.js.map +1 -1
  6. package/lib/ColorArea.js +1 -1
  7. package/lib/ColorArea.js.map +1 -1
  8. package/lib/ColorPicker.js +1 -1
  9. package/lib/ColorPicker.js.map +1 -1
  10. package/lib/ColorSlider.js +1 -1
  11. package/lib/ColorSlider.js.map +1 -1
  12. package/lib/components/AlphaSlider/AlphaSlider.constants.js +6 -0
  13. package/lib/components/AlphaSlider/AlphaSlider.constants.js.map +1 -0
  14. package/lib/components/AlphaSlider/AlphaSlider.js +5 -5
  15. package/lib/components/AlphaSlider/AlphaSlider.js.map +1 -1
  16. package/lib/components/AlphaSlider/AlphaSlider.types.js +1 -1
  17. package/lib/components/AlphaSlider/AlphaSlider.types.js.map +1 -1
  18. package/lib/components/AlphaSlider/index.js +5 -4
  19. package/lib/components/AlphaSlider/index.js.map +1 -1
  20. package/lib/components/AlphaSlider/renderAlphaSlider.js +1 -1
  21. package/lib/components/AlphaSlider/renderAlphaSlider.js.map +1 -1
  22. package/lib/components/AlphaSlider/useAlphaSlider.js +11 -5
  23. package/lib/components/AlphaSlider/useAlphaSlider.js.map +1 -1
  24. package/lib/components/AlphaSlider/useAlphaSliderState.js +12 -12
  25. package/lib/components/AlphaSlider/useAlphaSliderState.js.map +1 -1
  26. package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js +4 -9
  27. package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +1 -1
  28. package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js +4 -9
  29. package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js.map +1 -1
  30. package/lib/components/ColorArea/ColorArea.constants.js +6 -0
  31. package/lib/components/ColorArea/ColorArea.constants.js.map +1 -0
  32. package/lib/components/ColorArea/ColorArea.js +5 -5
  33. package/lib/components/ColorArea/ColorArea.js.map +1 -1
  34. package/lib/components/ColorArea/ColorArea.types.js +1 -1
  35. package/lib/components/ColorArea/ColorArea.types.js.map +1 -1
  36. package/lib/components/ColorArea/index.js +5 -4
  37. package/lib/components/ColorArea/index.js.map +1 -1
  38. package/lib/components/ColorArea/renderColorArea.js +1 -1
  39. package/lib/components/ColorArea/renderColorArea.js.map +1 -1
  40. package/lib/components/ColorArea/useColorArea.js +32 -18
  41. package/lib/components/ColorArea/useColorArea.js.map +1 -1
  42. package/lib/components/ColorArea/useColorAreaStyles.styles.js +4 -9
  43. package/lib/components/ColorArea/useColorAreaStyles.styles.js.map +1 -1
  44. package/lib/components/ColorArea/useColorAreaStyles.styles.raw.js +4 -9
  45. package/lib/components/ColorArea/useColorAreaStyles.styles.raw.js.map +1 -1
  46. package/lib/components/ColorPicker/ColorPicker.js +6 -6
  47. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  48. package/lib/components/ColorPicker/ColorPicker.types.js +1 -3
  49. package/lib/components/ColorPicker/ColorPicker.types.js.map +1 -1
  50. package/lib/components/ColorPicker/index.js +5 -4
  51. package/lib/components/ColorPicker/index.js.map +1 -1
  52. package/lib/components/ColorPicker/renderColorPicker.js +2 -2
  53. package/lib/components/ColorPicker/renderColorPicker.js.map +1 -1
  54. package/lib/components/ColorPicker/useColorPicker.js +10 -4
  55. package/lib/components/ColorPicker/useColorPicker.js.map +1 -1
  56. package/lib/components/ColorPicker/useColorPickerContextValues.js +15 -1
  57. package/lib/components/ColorPicker/useColorPickerContextValues.js.map +1 -1
  58. package/lib/components/ColorPicker/useColorPickerStyles.styles.js +2 -2
  59. package/lib/components/ColorPicker/useColorPickerStyles.styles.js.map +1 -1
  60. package/lib/components/ColorPicker/useColorPickerStyles.styles.raw.js +2 -2
  61. package/lib/components/ColorSlider/ColorSlider.constants.js +8 -0
  62. package/lib/components/ColorSlider/ColorSlider.constants.js.map +1 -0
  63. package/lib/components/ColorSlider/ColorSlider.js +5 -5
  64. package/lib/components/ColorSlider/ColorSlider.js.map +1 -1
  65. package/lib/components/ColorSlider/ColorSlider.types.js +1 -3
  66. package/lib/components/ColorSlider/ColorSlider.types.js.map +1 -1
  67. package/lib/components/ColorSlider/index.js +5 -4
  68. package/lib/components/ColorSlider/index.js.map +1 -1
  69. package/lib/components/ColorSlider/renderColorSlider.js +1 -1
  70. package/lib/components/ColorSlider/renderColorSlider.js.map +1 -1
  71. package/lib/components/ColorSlider/useColorSlider.js +34 -20
  72. package/lib/components/ColorSlider/useColorSlider.js.map +1 -1
  73. package/lib/components/ColorSlider/useColorSliderStyles.styles.js +3 -10
  74. package/lib/components/ColorSlider/useColorSliderStyles.styles.js.map +1 -1
  75. package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js +3 -10
  76. package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js.map +1 -1
  77. package/lib/contexts/colorPicker.js +1 -1
  78. package/lib/index.js +5 -4
  79. package/lib/index.js.map +1 -1
  80. package/lib/types/color.js.map +1 -1
  81. package/lib/utils/adjustChannel.js +2 -2
  82. package/lib/utils/adjustChannel.js.map +1 -1
  83. package/lib/utils/constants.js +6 -2
  84. package/lib/utils/constants.js.map +1 -1
  85. package/lib/utils/createHslColor.js +28 -0
  86. package/lib/utils/createHslColor.js.map +1 -0
  87. package/lib/utils/getCoordinates.js +1 -1
  88. package/lib-commonjs/{AlphaSlider.js → AlphaSlider.cjs} +4 -1
  89. package/lib-commonjs/AlphaSlider.cjs.map +1 -0
  90. package/lib-commonjs/{ColorArea.js → ColorArea.cjs} +4 -1
  91. package/lib-commonjs/ColorArea.cjs.map +1 -0
  92. package/lib-commonjs/{ColorPicker.js → ColorPicker.cjs} +10 -1
  93. package/lib-commonjs/ColorPicker.cjs.map +1 -0
  94. package/lib-commonjs/{ColorSlider.js → ColorSlider.cjs} +4 -1
  95. package/lib-commonjs/ColorSlider.cjs.map +1 -0
  96. package/lib-commonjs/components/AlphaSlider/{AlphaSlider.js → AlphaSlider.cjs} +3 -3
  97. package/lib-commonjs/components/AlphaSlider/{AlphaSlider.js.map → AlphaSlider.cjs.map} +1 -1
  98. package/lib-commonjs/components/AlphaSlider/AlphaSlider.constants.cjs +16 -0
  99. package/lib-commonjs/components/AlphaSlider/AlphaSlider.constants.cjs.map +1 -0
  100. package/lib-commonjs/components/AlphaSlider/{AlphaSlider.types.js → AlphaSlider.types.cjs} +1 -1
  101. package/lib-commonjs/components/AlphaSlider/{AlphaSlider.types.js.map → AlphaSlider.types.cjs.map} +1 -1
  102. package/lib-commonjs/components/AlphaSlider/{index.js → index.cjs} +9 -5
  103. package/lib-commonjs/components/AlphaSlider/index.cjs.map +1 -0
  104. package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.cjs.map +1 -0
  105. package/lib-commonjs/components/AlphaSlider/{useAlphaSlider.js → useAlphaSlider.cjs} +21 -7
  106. package/lib-commonjs/components/AlphaSlider/useAlphaSlider.cjs.map +1 -0
  107. package/lib-commonjs/components/AlphaSlider/{useAlphaSliderState.js → useAlphaSliderState.cjs} +12 -12
  108. package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.cjs.map +1 -0
  109. package/lib-commonjs/components/AlphaSlider/{useAlphaSliderStyles.styles.js → useAlphaSliderStyles.styles.cjs} +1 -10
  110. package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.cjs.map +1 -0
  111. package/lib-commonjs/components/AlphaSlider/{useAlphaSliderStyles.styles.raw.js → useAlphaSliderStyles.styles.raw.cjs} +6 -14
  112. package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.raw.cjs.map +1 -0
  113. package/lib-commonjs/components/ColorArea/{ColorArea.js → ColorArea.cjs} +3 -3
  114. package/lib-commonjs/components/ColorArea/{ColorArea.js.map → ColorArea.cjs.map} +1 -1
  115. package/lib-commonjs/components/ColorArea/ColorArea.constants.cjs +16 -0
  116. package/lib-commonjs/components/ColorArea/ColorArea.constants.cjs.map +1 -0
  117. package/lib-commonjs/components/ColorArea/{ColorArea.types.js → ColorArea.types.cjs} +1 -1
  118. package/lib-commonjs/components/ColorArea/{ColorArea.types.js.map → ColorArea.types.cjs.map} +1 -1
  119. package/lib-commonjs/components/ColorArea/{index.js → index.cjs} +9 -5
  120. package/lib-commonjs/components/ColorArea/index.cjs.map +1 -0
  121. package/lib-commonjs/components/ColorArea/renderColorArea.cjs.map +1 -0
  122. package/lib-commonjs/components/ColorArea/{useColorArea.js → useColorArea.cjs} +31 -16
  123. package/lib-commonjs/components/ColorArea/useColorArea.cjs.map +1 -0
  124. package/lib-commonjs/components/ColorArea/{useColorAreaStyles.styles.js → useColorAreaStyles.styles.cjs} +0 -9
  125. package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.cjs.map +1 -0
  126. package/lib-commonjs/components/ColorArea/{useColorAreaStyles.styles.raw.js → useColorAreaStyles.styles.raw.cjs} +5 -13
  127. package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.raw.cjs.map +1 -0
  128. package/lib-commonjs/components/ColorPicker/{ColorPicker.js → ColorPicker.cjs} +4 -4
  129. package/lib-commonjs/components/ColorPicker/{ColorPicker.js.map → ColorPicker.cjs.map} +1 -1
  130. package/lib-commonjs/components/{ColorSlider/ColorSlider.types.js → ColorPicker/ColorPicker.types.cjs} +1 -3
  131. package/lib-commonjs/components/ColorPicker/{ColorPicker.types.js.map → ColorPicker.types.cjs.map} +1 -1
  132. package/lib-commonjs/components/ColorPicker/{index.js → index.cjs} +14 -4
  133. package/lib-commonjs/components/ColorPicker/index.cjs.map +1 -0
  134. package/lib-commonjs/components/ColorPicker/{renderColorPicker.js → renderColorPicker.cjs} +1 -1
  135. package/lib-commonjs/components/ColorPicker/renderColorPicker.cjs.map +1 -0
  136. package/lib-commonjs/components/ColorPicker/{useColorPicker.js → useColorPicker.cjs} +20 -6
  137. package/lib-commonjs/components/ColorPicker/useColorPicker.cjs.map +1 -0
  138. package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.cjs +50 -0
  139. package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.cjs.map +1 -0
  140. package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.cjs.map +1 -0
  141. package/lib-commonjs/components/ColorSlider/{ColorSlider.js → ColorSlider.cjs} +3 -3
  142. package/lib-commonjs/components/ColorSlider/{ColorSlider.js.map → ColorSlider.cjs.map} +1 -1
  143. package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs +18 -0
  144. package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs.map +1 -0
  145. package/lib-commonjs/components/ColorSlider/{ColorSlider.types.js.map → ColorSlider.types.cjs.map} +1 -1
  146. package/lib-commonjs/components/ColorSlider/{index.js → index.cjs} +9 -5
  147. package/lib-commonjs/components/ColorSlider/index.cjs.map +1 -0
  148. package/lib-commonjs/components/ColorSlider/renderColorSlider.cjs.map +1 -0
  149. package/lib-commonjs/components/ColorSlider/{useColorSlider.js → useColorSlider.cjs} +34 -19
  150. package/lib-commonjs/components/ColorSlider/useColorSlider.cjs.map +1 -0
  151. package/lib-commonjs/components/ColorSlider/{useColorSliderStyles.styles.js → useColorSliderStyles.styles.cjs} +2 -12
  152. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.cjs.map +1 -0
  153. package/lib-commonjs/components/ColorSlider/{useColorSliderStyles.styles.raw.js → useColorSliderStyles.styles.raw.cjs} +19 -29
  154. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.cjs.map +1 -0
  155. package/lib-commonjs/{index.js → index.cjs} +23 -4
  156. package/lib-commonjs/index.cjs.map +1 -0
  157. package/lib-commonjs/{components/ColorPicker/ColorPicker.types.js → types/color.cjs} +1 -3
  158. package/lib-commonjs/types/color.cjs.map +1 -0
  159. package/lib-commonjs/utils/{adjustChannel.js → adjustChannel.cjs} +1 -1
  160. package/lib-commonjs/utils/{adjustChannel.js.map → adjustChannel.cjs.map} +1 -1
  161. package/lib-commonjs/utils/{constants.js → constants.cjs} +6 -2
  162. package/lib-commonjs/utils/constants.cjs.map +1 -0
  163. package/lib-commonjs/utils/createHslColor.cjs +41 -0
  164. package/lib-commonjs/utils/createHslColor.cjs.map +1 -0
  165. package/package.json +19 -14
  166. package/lib-commonjs/AlphaSlider.js.map +0 -1
  167. package/lib-commonjs/ColorArea.js.map +0 -1
  168. package/lib-commonjs/ColorPicker.js.map +0 -1
  169. package/lib-commonjs/ColorSlider.js.map +0 -1
  170. package/lib-commonjs/components/AlphaSlider/index.js.map +0 -1
  171. package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.js.map +0 -1
  172. package/lib-commonjs/components/AlphaSlider/useAlphaSlider.js.map +0 -1
  173. package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.js.map +0 -1
  174. package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +0 -1
  175. package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js.map +0 -1
  176. package/lib-commonjs/components/ColorArea/index.js.map +0 -1
  177. package/lib-commonjs/components/ColorArea/renderColorArea.js.map +0 -1
  178. package/lib-commonjs/components/ColorArea/useColorArea.js.map +0 -1
  179. package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.js.map +0 -1
  180. package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.raw.js.map +0 -1
  181. package/lib-commonjs/components/ColorPicker/index.js.map +0 -1
  182. package/lib-commonjs/components/ColorPicker/renderColorPicker.js.map +0 -1
  183. package/lib-commonjs/components/ColorPicker/useColorPicker.js.map +0 -1
  184. package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.js +0 -28
  185. package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.js.map +0 -1
  186. package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.js.map +0 -1
  187. package/lib-commonjs/components/ColorSlider/index.js.map +0 -1
  188. package/lib-commonjs/components/ColorSlider/renderColorSlider.js.map +0 -1
  189. package/lib-commonjs/components/ColorSlider/useColorSlider.js.map +0 -1
  190. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.js.map +0 -1
  191. package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.js.map +0 -1
  192. package/lib-commonjs/index.js.map +0 -1
  193. package/lib-commonjs/types/color.js.map +0 -1
  194. package/lib-commonjs/utils/constants.js.map +0 -1
  195. /package/lib-commonjs/components/AlphaSlider/{alphaSliderUtils.js → alphaSliderUtils.cjs} +0 -0
  196. /package/lib-commonjs/components/AlphaSlider/{alphaSliderUtils.js.map → alphaSliderUtils.cjs.map} +0 -0
  197. /package/lib-commonjs/components/AlphaSlider/{renderAlphaSlider.js → renderAlphaSlider.cjs} +0 -0
  198. /package/lib-commonjs/components/ColorArea/{renderColorArea.js → renderColorArea.cjs} +0 -0
  199. /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.js → useColorPickerStyles.styles.cjs} +0 -0
  200. /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.raw.js → useColorPickerStyles.styles.raw.cjs} +0 -0
  201. /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.raw.js.map → useColorPickerStyles.styles.raw.cjs.map} +0 -0
  202. /package/lib-commonjs/{types/color.js → components/ColorSlider/ColorSlider.types.cjs} +0 -0
  203. /package/lib-commonjs/components/ColorSlider/{renderColorSlider.js → renderColorSlider.cjs} +0 -0
  204. /package/lib-commonjs/contexts/{colorPicker.js → colorPicker.cjs} +0 -0
  205. /package/lib-commonjs/contexts/{colorPicker.js.map → colorPicker.cjs.map} +0 -0
  206. /package/lib-commonjs/utils/{createHsvColor.js → createHsvColor.cjs} +0 -0
  207. /package/lib-commonjs/utils/{createHsvColor.js.map → createHsvColor.cjs.map} +0 -0
  208. /package/lib-commonjs/utils/{getCoordinates.js → getCoordinates.cjs} +0 -0
  209. /package/lib-commonjs/utils/{getCoordinates.js.map → getCoordinates.cjs.map} +0 -0
  210. /package/lib-commonjs/utils/{getPercent.js → getPercent.cjs} +0 -0
  211. /package/lib-commonjs/utils/{getPercent.js.map → getPercent.cjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","tokens","createFocusOutlineStyle","colorAreaClassNames","root","thumb","inputX","inputY","colorAreaCSSVars","areaXProgressVar","areaYProgressVar","thumbColorVar","mainColorVar","thumbSizeVar","useRootStyles","useThumbStyles","qhf8xq","a9b677","Bqenvij","Bkecrkj","oeaueh","Bvjb7m6","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","De3pzq","Bz10aip","oyh7mz","B5kzvoi","Brfgrao","lawp4y","Fbdkly","mdwyqc","Bciustq","gc50h5","r59vdv","Budzafs","ck0cow","n07z76","Gng75u","Bcvre1j","Ftih45","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","focusIndicator","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","d","p","f","i","m","useInputStyles","input","B68tc82","Bmxbyg5","Bpg54ce","Bhzewxz","abs64n","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","useShapeStyles","rounded","square","useColorAreaStyles_unstable","state","rootStyles","thumbStyles","inputStyles","shapeStyles","className","shape"],"sources":["useColorAreaStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nexport const colorAreaClassNames = {\n root: 'fui-ColorArea',\n thumb: 'fui-ColorArea__thumb',\n inputX: 'fui-ColorArea__inputX',\n inputY: 'fui-ColorArea__inputY'\n};\nexport const colorAreaCSSVars = {\n areaXProgressVar: `--fui-AreaX--progress`,\n areaYProgressVar: `--fui-AreaY--progress`,\n thumbColorVar: `--fui-Area__thumb--color`,\n mainColorVar: `--fui-Area--main-color`\n};\n// Internal CSS variables\nconst thumbSizeVar = `--fui-Slider__thumb--size`;\n/**\n * Styles for the root slot\n */ const useRootStyles = makeResetStyles({\n position: 'relative',\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n background: `linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, transparent), var(${colorAreaCSSVars.mainColorVar})`,\n forcedColorAdjust: 'none',\n display: 'inline-grid',\n touchAction: 'none',\n alignItems: 'start',\n justifyItems: 'start',\n [thumbSizeVar]: '20px',\n minWidth: '300px',\n minHeight: '300px',\n boxSizing: 'border-box',\n marginBottom: tokens.spacingVerticalSNudge\n});\n/**\n * Styles for the thumb slot\n */ const useThumbStyles = makeStyles({\n thumb: {\n position: 'absolute',\n width: `var(${thumbSizeVar})`,\n height: `var(${thumbSizeVar})`,\n pointerEvents: 'none',\n outlineStyle: 'none',\n forcedColorAdjust: 'none',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForeground4}`,\n boxShadow: tokens.shadow4,\n backgroundColor: `var(${colorAreaCSSVars.thumbColorVar})`,\n transform: 'translate(-50%, 50%)',\n left: `var(${colorAreaCSSVars.areaXProgressVar})`,\n bottom: `var(${colorAreaCSSVars.areaYProgressVar})`,\n '::before': {\n position: 'absolute',\n inset: '0px',\n borderRadius: tokens.borderRadiusCircular,\n boxSizing: 'border-box',\n content: \"''\",\n border: `${tokens.strokeWidthThick} solid ${tokens.colorNeutralBackground1}`\n }\n },\n focusIndicator: createFocusOutlineStyle({\n selector: 'focus-within',\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n outlineRadius: tokens.borderRadiusCircular\n }\n })\n});\n/**\n * Styles for the Input slot\n */ const useInputStyles = makeStyles({\n input: {\n overflow: 'hidden',\n position: 'absolute',\n pointerEvents: 'none',\n top: 0,\n left: 0,\n opacity: 0,\n padding: '0',\n margin: '0',\n width: '100%',\n height: '100%'\n }\n});\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n }\n});\n/**\n * Apply styling to the ColorArea slots based on the state\n */ export const useColorAreaStyles_unstable = (state)=>{\n const rootStyles = useRootStyles();\n const thumbStyles = useThumbStyles();\n const inputStyles = useInputStyles();\n const shapeStyles = useShapeStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorAreaClassNames.root, rootStyles, shapeStyles[state.shape || 'rounded'], state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(colorAreaClassNames.thumb, thumbStyles.thumb, thumbStyles.focusIndicator, state.thumb.className);\n // eslint-disable-next-line react-hooks/immutability\n state.inputX.className = mergeClasses(colorAreaClassNames.inputX, inputStyles.input, state.inputX.className);\n // eslint-disable-next-line react-hooks/immutability\n state.inputY.className = mergeClasses(colorAreaClassNames.inputY, inputStyles.input, state.inputY.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,EAAE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+I,WAAW,CAACvB,KAAK,EAAEoB,KAAK,CAAC5I,MAAM,CAACiJ,SAAS,CAAC;EAC5G;EACAL,KAAK,CAAC3I,MAAM,CAACgJ,SAAS,GAAGxJ,YAAY,CAACI,mBAAmB,CAACI,MAAM,EAAE8I,WAAW,CAACvB,KAAK,EAAEoB,KAAK,CAAC3I,MAAM,CAACgJ,SAAS,CAAC;EAC5G,OAAOL,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__resetStyles","__styles","mergeClasses","shorthands","tokens","createFocusOutlineStyle","colorAreaCSSVars","colorAreaClassNames","root","thumb","inputX","inputY","thumbSizeVar","useRootStyles","useThumbStyles","qhf8xq","a9b677","Bqenvij","Bkecrkj","oeaueh","Bvjb7m6","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","De3pzq","Bz10aip","oyh7mz","B5kzvoi","Brfgrao","lawp4y","Fbdkly","mdwyqc","Bciustq","gc50h5","r59vdv","Budzafs","ck0cow","n07z76","Gng75u","Bcvre1j","Ftih45","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","focusIndicator","Brovlpu","B486eqv","Bssx7fj","uh7if5","clntm0","Dlk2r6","h6p2u","I6qiy5","yzno9d","By0wis0","B2j2mmj","wigs8","pbfy6t","B0v4ure","Byrf0fs","Bsiemmq","Bwckmig","skfxo0","Iidy0u","B98u21t","Bvwlmkc","jo1ztg","Ba1iezr","Blmvk6g","B24cy0v","Bil7v7r","Br3gin4","nr063g","ghq09","Bbgo44z","Bseh09z","az1dzo","Ba3ybja","B6352mv","vppk2z","Biaj6j7","B2pnrqr","B29w5g4","Bhhzhcn","Bec0n69","d","p","f","i","m","useInputStyles","input","B68tc82","Bmxbyg5","Bpg54ce","Bhzewxz","abs64n","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","useShapeStyles","rounded","square","useColorAreaStyles_unstable","state","rootStyles","thumbStyles","inputStyles","shapeStyles","className","shape"],"sources":["useColorAreaStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { createFocusOutlineStyle } from \"@fluentui/react-tabster\";\nimport { colorAreaCSSVars } from \"./ColorArea.constants.js\";\nexport const colorAreaClassNames = {\n root: 'fui-ColorArea',\n thumb: 'fui-ColorArea__thumb',\n inputX: 'fui-ColorArea__inputX',\n inputY: 'fui-ColorArea__inputY'\n};\n// Internal CSS variables\nconst thumbSizeVar = `--fui-Slider__thumb--size`;\n/**\n * Styles for the root slot\n */ const useRootStyles = makeResetStyles({\n position: 'relative',\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n background: `linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, transparent), var(${colorAreaCSSVars.mainColorVar})`,\n forcedColorAdjust: 'none',\n display: 'inline-grid',\n touchAction: 'none',\n alignItems: 'start',\n justifyItems: 'start',\n [thumbSizeVar]: '20px',\n minWidth: '300px',\n minHeight: '300px',\n boxSizing: 'border-box',\n marginBottom: tokens.spacingVerticalSNudge\n});\n/**\n * Styles for the thumb slot\n */ const useThumbStyles = makeStyles({\n thumb: {\n position: 'absolute',\n width: `var(${thumbSizeVar})`,\n height: `var(${thumbSizeVar})`,\n pointerEvents: 'none',\n outlineStyle: 'none',\n forcedColorAdjust: 'none',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForeground4}`,\n boxShadow: tokens.shadow4,\n backgroundColor: `var(${colorAreaCSSVars.thumbColorVar})`,\n transform: 'translate(-50%, 50%)',\n left: `var(${colorAreaCSSVars.areaXProgressVar})`,\n bottom: `var(${colorAreaCSSVars.areaYProgressVar})`,\n '::before': {\n position: 'absolute',\n inset: '0px',\n borderRadius: tokens.borderRadiusCircular,\n boxSizing: 'border-box',\n content: \"''\",\n border: `${tokens.strokeWidthThick} solid ${tokens.colorNeutralBackground1}`\n }\n },\n focusIndicator: createFocusOutlineStyle({\n selector: 'focus-within',\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n outlineRadius: tokens.borderRadiusCircular\n }\n })\n});\n/**\n * Styles for the Input slot\n */ const useInputStyles = makeStyles({\n input: {\n overflow: 'hidden',\n position: 'absolute',\n pointerEvents: 'none',\n top: 0,\n left: 0,\n opacity: 0,\n padding: '0',\n margin: '0',\n width: '100%',\n height: '100%'\n }\n});\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n }\n});\n/**\n * Apply styling to the ColorArea slots based on the state\n */ export const useColorAreaStyles_unstable = (state)=>{\n const rootStyles = useRootStyles();\n const thumbStyles = useThumbStyles();\n const inputStyles = useInputStyles();\n const shapeStyles = useShapeStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorAreaClassNames.root, rootStyles, shapeStyles[state.shape || 'rounded'], state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(colorAreaClassNames.thumb, thumbStyles.thumb, thumbStyles.focusIndicator, state.thumb.className);\n // eslint-disable-next-line react-hooks/immutability\n state.inputX.className = mergeClasses(colorAreaClassNames.inputX, inputStyles.input, state.inputX.className);\n // eslint-disable-next-line react-hooks/immutability\n state.inputY.className = mergeClasses(colorAreaClassNames.inputY, inputStyles.input, state.inputY.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAA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AACtI,MAAM,CAAC2I,SAAS,GAAGpJ,YAAY,CAACK,mBAAmB,CAACI,MAAM,EAAEyI,WAAW,CAACvB,KAAK,EAAEoB,KAAK,CAACtI,MAAM,CAAC2I,SAAS,CAAC;EAC5G,OAAOL,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -1,19 +1,14 @@
1
1
  'use client';
2
- import { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';
3
- import { tokens } from '@fluentui/react-theme';
4
- import { createFocusOutlineStyle } from '@fluentui/react-tabster';
2
+ import { makeResetStyles, makeStyles, mergeClasses, shorthands } from "@griffel/react";
3
+ import { tokens } from "@fluentui/react-theme";
4
+ import { createFocusOutlineStyle } from "@fluentui/react-tabster";
5
+ import { colorAreaCSSVars } from "./ColorArea.constants.js";
5
6
  export const colorAreaClassNames = {
6
7
  root: 'fui-ColorArea',
7
8
  thumb: 'fui-ColorArea__thumb',
8
9
  inputX: 'fui-ColorArea__inputX',
9
10
  inputY: 'fui-ColorArea__inputY'
10
11
  };
11
- export const colorAreaCSSVars = {
12
- areaXProgressVar: `--fui-AreaX--progress`,
13
- areaYProgressVar: `--fui-AreaY--progress`,
14
- thumbColorVar: `--fui-Area__thumb--color`,
15
- mainColorVar: `--fui-Area--main-color`
16
- };
17
12
  // Internal CSS variables
18
13
  const thumbSizeVar = `--fui-Slider__thumb--size`;
19
14
  /**
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorArea/useColorAreaStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { ColorAreaSlots, ColorAreaState } from './ColorArea.types';\n\nexport const colorAreaClassNames: SlotClassNames<ColorAreaSlots> = {\n root: 'fui-ColorArea',\n thumb: 'fui-ColorArea__thumb',\n inputX: 'fui-ColorArea__inputX',\n inputY: 'fui-ColorArea__inputY',\n};\n\nexport const colorAreaCSSVars = {\n areaXProgressVar: `--fui-AreaX--progress`,\n areaYProgressVar: `--fui-AreaY--progress`,\n thumbColorVar: `--fui-Area__thumb--color`,\n mainColorVar: `--fui-Area--main-color`,\n};\n\n// Internal CSS variables\nconst thumbSizeVar = `--fui-Slider__thumb--size`;\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeResetStyles({\n position: 'relative',\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n background: `linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, transparent), var(${colorAreaCSSVars.mainColorVar})`,\n forcedColorAdjust: 'none',\n display: 'inline-grid',\n touchAction: 'none',\n alignItems: 'start',\n justifyItems: 'start',\n [thumbSizeVar]: '20px',\n minWidth: '300px',\n minHeight: '300px',\n boxSizing: 'border-box',\n marginBottom: tokens.spacingVerticalSNudge,\n});\n\n/**\n * Styles for the thumb slot\n */\nconst useThumbStyles = makeStyles({\n thumb: {\n position: 'absolute',\n width: `var(${thumbSizeVar})`,\n height: `var(${thumbSizeVar})`,\n pointerEvents: 'none',\n outlineStyle: 'none',\n forcedColorAdjust: 'none',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForeground4}`,\n boxShadow: tokens.shadow4,\n backgroundColor: `var(${colorAreaCSSVars.thumbColorVar})`,\n transform: 'translate(-50%, 50%)',\n left: `var(${colorAreaCSSVars.areaXProgressVar})`,\n bottom: `var(${colorAreaCSSVars.areaYProgressVar})`,\n '::before': {\n position: 'absolute',\n inset: '0px',\n borderRadius: tokens.borderRadiusCircular,\n boxSizing: 'border-box',\n content: \"''\",\n border: `${tokens.strokeWidthThick} solid ${tokens.colorNeutralBackground1}`,\n },\n },\n focusIndicator: createFocusOutlineStyle({\n selector: 'focus-within',\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n outlineRadius: tokens.borderRadiusCircular,\n },\n }),\n});\n\n/**\n * Styles for the Input slot\n */\nconst useInputStyles = makeStyles({\n input: {\n overflow: 'hidden',\n position: 'absolute',\n pointerEvents: 'none',\n top: 0,\n left: 0,\n opacity: 0,\n padding: '0',\n margin: '0',\n width: '100%',\n height: '100%',\n },\n});\n\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n },\n});\n\n/**\n * Apply styling to the ColorArea slots based on the state\n */\nexport const useColorAreaStyles_unstable = (state: ColorAreaState): ColorAreaState => {\n const rootStyles = useRootStyles();\n const thumbStyles = useThumbStyles();\n const inputStyles = useInputStyles();\n const shapeStyles = useShapeStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n colorAreaClassNames.root,\n rootStyles,\n shapeStyles[state.shape || 'rounded'],\n state.root.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(\n colorAreaClassNames.thumb,\n thumbStyles.thumb,\n thumbStyles.focusIndicator,\n state.thumb.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.inputX.className = mergeClasses(colorAreaClassNames.inputX, inputStyles.input, state.inputX.className);\n\n // eslint-disable-next-line react-hooks/immutability\n state.inputY.className = mergeClasses(colorAreaClassNames.inputY, inputStyles.input, state.inputY.className);\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","createFocusOutlineStyle","colorAreaClassNames","root","thumb","inputX","inputY","colorAreaCSSVars","areaXProgressVar","areaYProgressVar","thumbColorVar","mainColorVar","thumbSizeVar","useRootStyles","position","border","colorNeutralStroke1","background","forcedColorAdjust","display","touchAction","alignItems","justifyItems","minWidth","minHeight","boxSizing","marginBottom","spacingVerticalSNudge","useThumbStyles","width","height","pointerEvents","outlineStyle","borderRadius","borderRadiusCircular","strokeWidthThin","colorNeutralForeground4","boxShadow","shadow4","backgroundColor","transform","left","bottom","inset","content","strokeWidthThick","colorNeutralBackground1","focusIndicator","selector","style","outlineWidth","borderWidth","outlineRadius","useInputStyles","input","overflow","top","opacity","padding","margin","useShapeStyles","rounded","borderRadiusMedium","square","borderRadiusNone","useColorAreaStyles_unstable","state","rootStyles","thumbStyles","inputStyles","shapeStyles","className","shape"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAEvF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,uBAAuB,QAAQ,0BAA0B;AAGlE,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,QAAQ;AACV,EAAE;AAEF,OAAO,MAAMC,mBAAmB;IAC9BC,kBAAkB,CAAC,qBAAqB,CAAC;IACzCC,kBAAkB,CAAC,qBAAqB,CAAC;IACzCC,eAAe,CAAC,wBAAwB,CAAC;IACzCC,cAAc,CAAC,sBAAsB,CAAC;AACxC,EAAE;AAEF,yBAAyB;AACzB,MAAMC,eAAe,CAAC,yBAAyB,CAAC;AAEhD;;CAEC,GACD,MAAMC,gBAAgBjB,gBAAgB;IACpCkB,UAAU;IACVC,QAAQ,CAAC,UAAU,EAAEf,OAAOgB,mBAAmB,EAAE;IACjDC,YAAY,CAAC,iGAAiG,EAAEV,iBAAiBI,YAAY,CAAC,CAAC,CAAC;IAChJO,mBAAmB;IACnBC,SAAS;IACTC,aAAa;IACbC,YAAY;IACZC,cAAc;IACd,CAACV,aAAa,EAAE;IAChBW,UAAU;IACVC,WAAW;IACXC,WAAW;IACXC,cAAc1B,OAAO2B,qBAAqB;AAC5C;AAEA;;CAEC,GACD,MAAMC,iBAAiB/B,WAAW;IAChCO,OAAO;QACLU,UAAU;QACVe,OAAO,CAAC,IAAI,EAAEjB,aAAa,CAAC,CAAC;QAC7BkB,QAAQ,CAAC,IAAI,EAAElB,aAAa,CAAC,CAAC;QAC9BmB,eAAe;QACfC,cAAc;QACdd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oDAAoD;IACpDM,MAAM/D,IAAI,CAACoE,SAAS,GAAGzE,aACrBI,oBAAoBC,IAAI,EACxBgE,YACAG,WAAW,CAACJ,MAAMM,KAAK,IAAI,UAAU,EACrCN,MAAM/D,IAAI,CAACoE,SAAS;IAGtB,oDAAoD;IACpDL,MAAM9D,KAAK,CAACmE,SAAS,GAAGzE,aACtBI,oBAAoBE,KAAK,EACzBgE,YAAYhE,KAAK,EACjBgE,YAAYrB,cAAc,EAC1BmB,MAAM9D,KAAK,CAACmE,SAAS;IAGvB,oDAAoD;IACpDL,MAAM7D,MAAM,CAACkE,SAAS,GAAGzE,aAAaI,oBAAoBG,MAAM,EAAEgE,YAAYf,KAAK,EAAEY,MAAM7D,MAAM,CAACkE,SAAS;IAE3G,oDAAoD;IACpDL,MAAM5D,MAAM,CAACiE,SAAS,GAAGzE,aAAaI,oBAAoBI,MAAM,EAAE+D,YAAYf,KAAK,EAAEY,MAAM5D,MAAM,CAACiE,SAAS;IAC3G,OAAOL;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/ColorArea/useColorAreaStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeResetStyles, makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport type { ColorAreaSlots, ColorAreaState } from './ColorArea.types';\nimport { colorAreaCSSVars } from './ColorArea.constants';\n\nexport const colorAreaClassNames: SlotClassNames<ColorAreaSlots> = {\n root: 'fui-ColorArea',\n thumb: 'fui-ColorArea__thumb',\n inputX: 'fui-ColorArea__inputX',\n inputY: 'fui-ColorArea__inputY',\n};\n\n// Internal CSS variables\nconst thumbSizeVar = `--fui-Slider__thumb--size`;\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeResetStyles({\n position: 'relative',\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n background: `linear-gradient(to bottom, transparent, #000), linear-gradient(to right, #fff, transparent), var(${colorAreaCSSVars.mainColorVar})`,\n forcedColorAdjust: 'none',\n display: 'inline-grid',\n touchAction: 'none',\n alignItems: 'start',\n justifyItems: 'start',\n [thumbSizeVar]: '20px',\n minWidth: '300px',\n minHeight: '300px',\n boxSizing: 'border-box',\n marginBottom: tokens.spacingVerticalSNudge,\n});\n\n/**\n * Styles for the thumb slot\n */\nconst useThumbStyles = makeStyles({\n thumb: {\n position: 'absolute',\n width: `var(${thumbSizeVar})`,\n height: `var(${thumbSizeVar})`,\n pointerEvents: 'none',\n outlineStyle: 'none',\n forcedColorAdjust: 'none',\n borderRadius: tokens.borderRadiusCircular,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralForeground4}`,\n boxShadow: tokens.shadow4,\n backgroundColor: `var(${colorAreaCSSVars.thumbColorVar})`,\n transform: 'translate(-50%, 50%)',\n left: `var(${colorAreaCSSVars.areaXProgressVar})`,\n bottom: `var(${colorAreaCSSVars.areaYProgressVar})`,\n '::before': {\n position: 'absolute',\n inset: '0px',\n borderRadius: tokens.borderRadiusCircular,\n boxSizing: 'border-box',\n content: \"''\",\n border: `${tokens.strokeWidthThick} solid ${tokens.colorNeutralBackground1}`,\n },\n },\n focusIndicator: createFocusOutlineStyle({\n selector: 'focus-within',\n style: {\n outlineWidth: tokens.strokeWidthThick,\n ...shorthands.borderWidth(tokens.strokeWidthThick),\n outlineRadius: tokens.borderRadiusCircular,\n },\n }),\n});\n\n/**\n * Styles for the Input slot\n */\nconst useInputStyles = makeStyles({\n input: {\n overflow: 'hidden',\n position: 'absolute',\n pointerEvents: 'none',\n top: 0,\n left: 0,\n opacity: 0,\n padding: '0',\n margin: '0',\n width: '100%',\n height: '100%',\n },\n});\n\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n },\n});\n\n/**\n * Apply styling to the ColorArea slots based on the state\n */\nexport const useColorAreaStyles_unstable = (state: ColorAreaState): ColorAreaState => {\n const rootStyles = useRootStyles();\n const thumbStyles = useThumbStyles();\n const inputStyles = useInputStyles();\n const shapeStyles = useShapeStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n colorAreaClassNames.root,\n rootStyles,\n shapeStyles[state.shape || 'rounded'],\n state.root.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(\n colorAreaClassNames.thumb,\n thumbStyles.thumb,\n thumbStyles.focusIndicator,\n state.thumb.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.inputX.className = mergeClasses(colorAreaClassNames.inputX, inputStyles.input, state.inputX.className);\n\n // eslint-disable-next-line react-hooks/immutability\n state.inputY.className = mergeClasses(colorAreaClassNames.inputY, inputStyles.input, state.inputY.className);\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","createFocusOutlineStyle","colorAreaCSSVars","colorAreaClassNames","root","thumb","inputX","inputY","thumbSizeVar","useRootStyles","position","border","colorNeutralStroke1","background","mainColorVar","forcedColorAdjust","display","touchAction","alignItems","justifyItems","minWidth","minHeight","boxSizing","marginBottom","spacingVerticalSNudge","useThumbStyles","width","height","pointerEvents","outlineStyle","borderRadius","borderRadiusCircular","strokeWidthThin","colorNeutralForeground4","boxShadow","shadow4","backgroundColor","thumbColorVar","transform","left","areaXProgressVar","bottom","areaYProgressVar","inset","content","strokeWidthThick","colorNeutralBackground1","focusIndicator","selector","style","outlineWidth","borderWidth","outlineRadius","useInputStyles","input","overflow","top","opacity","padding","margin","useShapeStyles","rounded","borderRadiusMedium","square","borderRadiusNone","useColorAreaStyles_unstable","state","rootStyles","thumbStyles","inputStyles","shapeStyles","className","shape"],"mappings":"AAAA;AAEA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iBAAiB;AAEvF,SAASC,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,uBAAuB,QAAQ,0BA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AM3D,MAAM,CAACgE,SAAS,GAAGzE,aAAaK,oBAAoBI,MAAM,EAAE8D,YAAYf,KAAK,EAAEY,MAAM3D,MAAM,CAACgE,SAAS;IAC3G,OAAOL;AACT,EAAE"}
@@ -1,10 +1,10 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useColorPicker_unstable } from './useColorPicker';
4
- import { renderColorPicker_unstable } from './renderColorPicker';
5
- import { useColorPickerStyles_unstable } from './useColorPickerStyles.styles';
6
- import { useColorPickerContextValues } from './useColorPickerContextValues';
7
- import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
2
+ import * as React from "react";
3
+ import { useColorPicker_unstable } from "./useColorPicker.js";
4
+ import { renderColorPicker_unstable } from "./renderColorPicker.js";
5
+ import { useColorPickerStyles_unstable } from "./useColorPickerStyles.styles.js";
6
+ import { useColorPickerContextValues } from "./useColorPickerContextValues.js";
7
+ import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
8
8
  /**
9
9
  * ColorPicker component
10
10
  */ export const ColorPicker = /*#__PURE__*/ React.forwardRef((props, ref)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorPicker_unstable } from './useColorPicker';\nimport { renderColorPicker_unstable } from './renderColorPicker';\nimport { useColorPickerStyles_unstable } from './useColorPickerStyles.styles';\nimport type { ColorPickerProps } from './ColorPicker.types';\nimport { useColorPickerContextValues } from './useColorPickerContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorPicker component\n */\nexport const ColorPicker: ForwardRefComponent<ColorPickerProps> = React.forwardRef((props, ref) => {\n const state = useColorPicker_unstable(props, ref);\n const contextValues = useColorPickerContextValues(state);\n\n useColorPickerStyles_unstable(state);\n useCustomStyleHook_unstable('useColorPickerStyles_unstable')(state);\n\n return renderColorPicker_unstable(state, contextValues);\n});\n\nColorPicker.displayName = 'ColorPicker';\n"],"names":["React","useColorPicker_unstable","renderColorPicker_unstable","useColorPickerStyles_unstable","useColorPickerContextValues","useCustomStyleHook_unstable","ColorPicker","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,6BAA6B,QAAQ,gCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,gCAAgC;AAC5E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQT,wBAAwBO,OAAOC;IAC7C,MAAME,gBAAgBP,4BAA4BM;IAElDP,8BAA8BO;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOR,2BAA2BQ,OAAOC;AAC3C,GAAG;AAEHL,YAAYM,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/ColorPicker.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorPicker_unstable } from './useColorPicker';\nimport { renderColorPicker_unstable } from './renderColorPicker';\nimport { useColorPickerStyles_unstable } from './useColorPickerStyles.styles';\nimport type { ColorPickerProps } from './ColorPicker.types';\nimport { useColorPickerContextValues } from './useColorPickerContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorPicker component\n */\nexport const ColorPicker: ForwardRefComponent<ColorPickerProps> = React.forwardRef((props, ref) => {\n const state = useColorPicker_unstable(props, ref);\n const contextValues = useColorPickerContextValues(state);\n\n useColorPickerStyles_unstable(state);\n useCustomStyleHook_unstable('useColorPickerStyles_unstable')(state);\n\n return renderColorPicker_unstable(state, contextValues);\n});\n\nColorPicker.displayName = 'ColorPicker';\n"],"names":["React","useColorPicker_unstable","renderColorPicker_unstable","useColorPickerStyles_unstable","useColorPickerContextValues","useCustomStyleHook_unstable","ColorPicker","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,mCAAgC;AAC5E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQT,wBAAwBO,OAAOC;IAC7C,MAAME,gBAAgBP,4BAA4BM;IAElDP,8BAA8BO;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOR,2BAA2BQ,OAAOC;AAC3C,GAAG;AAEHL,YAAYM,WAAW,GAAG"}
@@ -1,3 +1 @@
1
- /**
2
- * State used in rendering ColorPicker
3
- */ export { };
1
+ /** State used in rendering unstyled ColorPicker */ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/ColorPicker.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, EventHandler, EventData } from '@fluentui/react-utilities';\nimport type { ColorPickerContextValue } from '../../contexts/colorPicker';\nimport type { HsvColor } from '../../types/color';\n\nexport type ColorPickerOnChangeData = EventData<'change', React.ChangeEvent<HTMLInputElement>> & {\n color: HsvColor;\n};\n\nexport type ColorPickerSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * ColorPicker Props\n */\nexport type ColorPickerProps = Omit<ComponentProps<Partial<ColorPickerSlots>>, 'color'> & {\n /**\n * Selected color.\n */\n color?: HsvColor;\n\n /**\n * Callback for when the user changes the color.\n */\n onColorChange?: EventHandler<ColorPickerOnChangeData>;\n\n /**\n * ColorPicker shape\n * @defaultvalue 'rounded'\n */\n shape?: 'rounded' | 'square';\n};\n\n/**\n * State used in rendering ColorPicker\n */\nexport type ColorPickerState = ComponentState<ColorPickerSlots> & ColorPickerContextValue;\n"],"names":[],"mappings":"AAkCA;;CAEC,GACD,WAA0F"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/ColorPicker.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, EventHandler, EventData } from '@fluentui/react-utilities';\nimport type { ColorPickerContextValue } from '../../contexts/colorPicker';\nimport type { HsvColor } from '../../types/color';\n\nexport type ColorPickerOnChangeData = EventData<'change', React.ChangeEvent<HTMLInputElement>> & {\n color: HsvColor;\n};\n\nexport type ColorPickerSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * ColorPicker Props\n */\nexport type ColorPickerProps = Omit<ComponentProps<Partial<ColorPickerSlots>>, 'color'> & {\n /**\n * Selected color.\n */\n color?: HsvColor;\n\n /**\n * Callback for when the user changes the color.\n */\n onColorChange?: EventHandler<ColorPickerOnChangeData>;\n\n /**\n * ColorPicker shape\n * @defaultvalue 'rounded'\n */\n shape?: 'rounded' | 'square';\n};\n\n/** ColorPicker Base Props */\nexport type ColorPickerBaseProps = Omit<ColorPickerProps, 'shape'>;\n\n/**\n * State used in rendering ColorPicker\n */\nexport type ColorPickerState = ComponentState<ColorPickerSlots> & ColorPickerContextValue;\n\n/** State used in rendering unstyled ColorPicker */\nexport type ColorPickerBaseState = Omit<ColorPickerState, 'shape'>;\n"],"names":[],"mappings":"AA0CA,iDAAiD,GACjD,WAAmE"}
@@ -1,4 +1,5 @@
1
- export { ColorPicker } from './ColorPicker';
2
- export { renderColorPicker_unstable } from './renderColorPicker';
3
- export { useColorPicker_unstable } from './useColorPicker';
4
- export { colorPickerClassNames, useColorPickerStyles_unstable } from './useColorPickerStyles.styles';
1
+ export { ColorPicker } from "./ColorPicker.js";
2
+ export { renderColorPicker_unstable } from "./renderColorPicker.js";
3
+ export { useColorPickerBase_unstable, useColorPicker_unstable } from "./useColorPicker.js";
4
+ export { useColorPickerBaseContextValues_unstable, useColorPickerContextValues } from "./useColorPickerContextValues.js";
5
+ export { colorPickerClassNames, useColorPickerStyles_unstable } from "./useColorPickerStyles.styles.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/index.ts"],"sourcesContent":["export { ColorPicker } from './ColorPicker';\nexport type {\n ColorPickerOnChangeData,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './ColorPicker.types';\nexport { renderColorPicker_unstable } from './renderColorPicker';\nexport { useColorPicker_unstable } from './useColorPicker';\nexport { colorPickerClassNames, useColorPickerStyles_unstable } from './useColorPickerStyles.styles';\n"],"names":["ColorPicker","renderColorPicker_unstable","useColorPicker_unstable","colorPickerClassNames","useColorPickerStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,gBAAgB;AAO5C,SAASC,0BAA0B,QAAQ,sBAAsB;AACjE,SAASC,uBAAuB,QAAQ,mBAAmB;AAC3D,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,gCAAgC"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/index.ts"],"sourcesContent":["export { ColorPicker } from './ColorPicker';\nexport type {\n ColorPickerBaseProps,\n ColorPickerBaseState,\n ColorPickerOnChangeData,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './ColorPicker.types';\nexport { renderColorPicker_unstable } from './renderColorPicker';\nexport { useColorPickerBase_unstable, useColorPicker_unstable } from './useColorPicker';\nexport { useColorPickerBaseContextValues_unstable, useColorPickerContextValues } from './useColorPickerContextValues';\nexport { colorPickerClassNames, useColorPickerStyles_unstable } from './useColorPickerStyles.styles';\n"],"names":["ColorPicker","renderColorPicker_unstable","useColorPickerBase_unstable","useColorPicker_unstable","useColorPickerBaseContextValues_unstable","useColorPickerContextValues","colorPickerClassNames","useColorPickerStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAS5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,2BAA2B,EAAEC,uBAAuB,QAAQ,sBAAmB;AACxF,SAASC,wCAAwC,EAAEC,2BAA2B,QAAQ,mCAAgC;AACtH,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from '@fluentui/react-utilities';
3
- import { ColorPickerProvider } from '../../contexts/colorPicker';
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
+ import { ColorPickerProvider } from "../../contexts/colorPicker.js";
4
4
  /**
5
5
  * Render the final JSX of ColorPicker
6
6
  */ export const renderColorPicker_unstable = (state, contextValues)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/renderColorPicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorPickerState, ColorPickerSlots } from './ColorPicker.types';\nimport type { ColorPickerContextValues } from '../../contexts/colorPicker';\nimport { ColorPickerProvider } from '../../contexts/colorPicker';\n\n/**\n * Render the final JSX of ColorPicker\n */\nexport const renderColorPicker_unstable = (\n state: ColorPickerState,\n contextValues: ColorPickerContextValues,\n): JSXElement => {\n assertSlots<ColorPickerSlots>(state);\n\n return (\n <ColorPickerProvider value={contextValues.colorPicker}>\n <state.root>{state.root.children}</state.root>\n </ColorPickerProvider>\n );\n};\n"],"names":["assertSlots","ColorPickerProvider","renderColorPicker_unstable","state","contextValues","value","colorPicker","root","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD,SAASC,mBAAmB,QAAQ,6BAA6B;AAEjE;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEAJ,YAA8BG;IAE9B,qBACE,KAACF;QAAoBI,OAAOD,cAAcE,WAAW;kBACnD,cAAA,KAACH,MAAMI,IAAI;sBAAEJ,MAAMI,IAAI,CAACC,QAAQ;;;AAGtC,EAAE"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/renderColorPicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorPickerBaseState, ColorPickerSlots } from './ColorPicker.types';\nimport type { ColorPickerContextValues } from '../../contexts/colorPicker';\nimport { ColorPickerProvider } from '../../contexts/colorPicker';\n\n/**\n * Render the final JSX of ColorPicker\n */\nexport const renderColorPicker_unstable = (\n state: ColorPickerBaseState,\n contextValues: ColorPickerContextValues,\n): JSXElement => {\n assertSlots<ColorPickerSlots>(state);\n\n return (\n <ColorPickerProvider value={contextValues.colorPicker}>\n <state.root>{state.root.children}</state.root>\n </ColorPickerProvider>\n );\n};\n"],"names":["assertSlots","ColorPickerProvider","renderColorPicker_unstable","state","contextValues","value","colorPicker","root","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD,SAASC,mBAAmB,QAAQ,gCAA6B;AAEjE;;CAEC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEAJ,YAA8BG;IAE9B,qBACE,KAACF;QAAoBI,OAAOD,cAAcE,WAAW;kBACnD,cAAA,KAACH,MAAMI,IAAI;sBAAEJ,MAAMI,IAAI,CAACC,QAAQ;;;AAGtC,EAAE"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';
2
+ import { getIntrinsicElementProps, slot, useEventCallback } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Create the state required to render ColorPicker.
5
5
  *
@@ -8,8 +8,8 @@ import { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/reac
8
8
  *
9
9
  * @param props - props from this instance of ColorPicker
10
10
  * @param ref - reference to root HTMLDivElement of ColorPicker
11
- */ export const useColorPicker_unstable = (props, ref)=>{
12
- const { color, onColorChange, shape, ...rest } = props;
11
+ */ export const useColorPickerBase_unstable = (props, ref)=>{
12
+ const { color, onColorChange, ...rest } = props;
13
13
  const requestChange = useEventCallback((event, data)=>{
14
14
  onColorChange === null || onColorChange === void 0 ? void 0 : onColorChange(event, {
15
15
  type: 'change',
@@ -28,7 +28,13 @@ import { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/reac
28
28
  elementType: 'div'
29
29
  }),
30
30
  color,
31
- requestChange,
31
+ requestChange
32
+ };
33
+ };
34
+ export const useColorPicker_unstable = (props, ref)=>{
35
+ const { shape, ...baseProps } = props;
36
+ return {
37
+ ...useColorPickerBase_unstable(baseProps, ref),
32
38
  shape
33
39
  };
34
40
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/useColorPicker.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type { ColorPickerProps, ColorPickerState } from './ColorPicker.types';\n/**\n * Create the state required to render ColorPicker.\n *\n * The returned state can be modified with hooks such as useColorPickerStyles_unstable,\n * before being passed to renderColorPicker_unstable.\n *\n * @param props - props from this instance of ColorPicker\n * @param ref - reference to root HTMLDivElement of ColorPicker\n */\nexport const useColorPicker_unstable = (props: ColorPickerProps, ref: React.Ref<HTMLDivElement>): ColorPickerState => {\n const { color, onColorChange, shape, ...rest } = props;\n\n const requestChange: ColorPickerState['requestChange'] = useEventCallback((event, data) => {\n onColorChange?.(event, {\n type: 'change',\n event,\n color: data.color,\n });\n });\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...rest,\n }),\n { elementType: 'div' },\n ),\n color,\n requestChange,\n shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useEventCallback","useColorPicker_unstable","props","ref","color","onColorChange","shape","rest","requestChange","event","data","type","components","root","always","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAE7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CAACC,OAAyBC;IAC/D,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGL;IAEjD,MAAMM,gBAAmDR,iBAAiB,CAACS,OAAOC;QAChFL,0BAAAA,oCAAAA,cAAgBI,OAAO;YACrBE,MAAM;YACNF;YACAL,OAAOM,KAAKN,KAAK;QACnB;IACF;IAEA,OAAO;QACLQ,YAAY;YACVC,MAAM;QACR;QACAA,MAAMd,KAAKe,MAAM,CACfhB,yBAAyB,OAAO;YAC9BK;YACA,GAAGI,IAAI;QACT,IACA;YAAEQ,aAAa;QAAM;QAEvBX;QACAI;QACAF;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/useColorPicker.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot, useEventCallback } from '@fluentui/react-utilities';\nimport type {\n ColorPickerBaseProps,\n ColorPickerBaseState,\n ColorPickerProps,\n ColorPickerState,\n} from './ColorPicker.types';\n/**\n * Create the state required to render ColorPicker.\n *\n * The returned state can be modified with hooks such as useColorPickerStyles_unstable,\n * before being passed to renderColorPicker_unstable.\n *\n * @param props - props from this instance of ColorPicker\n * @param ref - reference to root HTMLDivElement of ColorPicker\n */\nexport const useColorPickerBase_unstable = (\n props: ColorPickerBaseProps,\n ref: React.Ref<HTMLDivElement>,\n): ColorPickerBaseState => {\n const { color, onColorChange, ...rest } = props;\n\n const requestChange: ColorPickerBaseState['requestChange'] = useEventCallback((event, data) => {\n onColorChange?.(event, {\n type: 'change',\n event,\n color: data.color,\n });\n });\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...rest,\n }),\n { elementType: 'div' },\n ),\n color,\n requestChange,\n };\n};\n\nexport const useColorPicker_unstable = (props: ColorPickerProps, ref: React.Ref<HTMLDivElement>): ColorPickerState => {\n const { shape, ...baseProps } = props;\n\n return {\n ...useColorPickerBase_unstable(baseProps, ref),\n shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useEventCallback","useColorPickerBase_unstable","props","ref","color","onColorChange","rest","requestChange","event","data","type","components","root","always","elementType","useColorPicker_unstable","shape","baseProps"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,gBAAgB,QAAQ,4BAA4B;AAO7F;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGC,MAAM,GAAGJ;IAE1C,MAAMK,gBAAuDP,iBAAiB,CAACQ,OAAOC;QACpFJ,0BAAAA,oCAAAA,cAAgBG,OAAO;YACrBE,MAAM;YACNF;YACAJ,OAAOK,KAAKL,KAAK;QACnB;IACF;IAEA,OAAO;QACLO,YAAY;YACVC,MAAM;QACR;QACAA,MAAMb,KAAKc,MAAM,CACff,yBAAyB,OAAO;YAC9BK;YACA,GAAGG,IAAI;QACT,IACA;YAAEQ,aAAa;QAAM;QAEvBV;QACAG;IACF;AACF,EAAE;AAEF,OAAO,MAAMQ,0BAA0B,CAACb,OAAyBC;IAC/D,MAAM,EAAEa,KAAK,EAAE,GAAGC,WAAW,GAAGf;IAEhC,OAAO;QACL,GAAGD,4BAA4BgB,WAAWd,IAAI;QAC9Ca;IACF;AACF,EAAE"}
@@ -1,5 +1,19 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
+ export const useColorPickerBaseContextValues_unstable = (state)=>{
4
+ const { color, requestChange } = state;
5
+ const colorPicker = React.useMemo(()=>({
6
+ requestChange,
7
+ color,
8
+ shape: undefined
9
+ }), [
10
+ requestChange,
11
+ color
12
+ ]);
13
+ return {
14
+ colorPicker
15
+ };
16
+ };
3
17
  export const useColorPickerContextValues = (state)=>{
4
18
  const { color, shape, requestChange } = state;
5
19
  const colorPicker = React.useMemo(()=>({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorPicker/useColorPickerContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ColorPickerContextValue, ColorPickerContextValues } from '../../contexts/colorPicker';\nimport type { ColorPickerState } from './ColorPicker.types';\n\nexport const useColorPickerContextValues = (state: ColorPickerState): ColorPickerContextValues => {\n const { color, shape, requestChange } = state;\n\n const colorPicker = React.useMemo<ColorPickerContextValue>(\n () => ({\n requestChange,\n color,\n shape,\n }),\n [requestChange, color, shape],\n );\n\n return { colorPicker };\n};\n"],"names":["React","useColorPickerContextValues","state","color","shape","requestChange","colorPicker","useMemo"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,8BAA8B,CAACC;IAC1C,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGH;IAExC,MAAMI,cAAcN,MAAMO,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAF;YACAC;QACF,CAAA,GACA;QAACC;QAAeF;QAAOC;KAAM;IAG/B,OAAO;QAAEE;IAAY;AACvB,EAAE"}
1
+ {"version":3,"sources":["../src/components/ColorPicker/useColorPickerContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ColorPickerContextValue, ColorPickerContextValues } from '../../contexts/colorPicker';\nimport type { ColorPickerBaseState, ColorPickerState } from './ColorPicker.types';\n\nexport const useColorPickerBaseContextValues_unstable = (state: ColorPickerBaseState): ColorPickerContextValues => {\n const { color, requestChange } = state;\n\n const colorPicker = React.useMemo<ColorPickerContextValue>(\n () => ({\n requestChange,\n color,\n shape: undefined,\n }),\n [requestChange, color],\n );\n\n return { colorPicker };\n};\n\nexport const useColorPickerContextValues = (state: ColorPickerState): ColorPickerContextValues => {\n const { color, shape, requestChange } = state;\n\n const colorPicker = React.useMemo<ColorPickerContextValue>(\n () => ({\n requestChange,\n color,\n shape,\n }),\n [requestChange, color, shape],\n );\n\n return { colorPicker };\n};\n"],"names":["React","useColorPickerBaseContextValues_unstable","state","color","requestChange","colorPicker","useMemo","shape","undefined","useColorPickerContextValues"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAI/B,OAAO,MAAMC,2CAA2C,CAACC;IACvD,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGF;IAEjC,MAAMG,cAAcL,MAAMM,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAD;YACAI,OAAOC;QACT,CAAA,GACA;QAACJ;QAAeD;KAAM;IAGxB,OAAO;QAAEE;IAAY;AACvB,EAAE;AAEF,OAAO,MAAMI,8BAA8B,CAACP;IAC1C,MAAM,EAAEC,KAAK,EAAEI,KAAK,EAAEH,aAAa,EAAE,GAAGF;IAExC,MAAMG,cAAcL,MAAMM,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAD;YACAI;QACF,CAAA,GACA;QAACH;QAAeD;QAAOI;KAAM;IAG/B,OAAO;QAAEF;IAAY;AACvB,EAAE"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { __styles, mergeClasses } from '@griffel/react';
4
- import { tokens } from '@fluentui/react-theme';
3
+ import { __styles, mergeClasses } from "@griffel/react";
4
+ import { tokens } from "@fluentui/react-theme";
5
5
  export const colorPickerClassNames = {
6
6
  root: 'fui-ColorPicker'
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"names":["__styles","mergeClasses","tokens","colorPickerClassNames","root","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","rmohyg","d","p","useColorPickerStyles_unstable","state","styles","className"],"sources":["useColorPickerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const colorPickerClassNames = {\n root: 'fui-ColorPicker'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: tokens.spacingVerticalXS\n }\n});\n/**\n * Apply styling to the ColorPicker slots based on the state\n */ export const useColorPickerStyles_unstable = (state)=>{\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorPickerClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAI,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;AAAA,CAMrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,MAAMC,MAAM,GAAGV,SAAS,CAAC,CAAC;EAC1B;EACAS,KAAK,CAACV,IAAI,CAACY,SAAS,GAAGf,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAEW,MAAM,CAACX,IAAI,EAAEU,KAAK,CAACV,IAAI,CAACY,SAAS,CAAC;EAClG,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__styles","mergeClasses","tokens","colorPickerClassNames","root","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","rmohyg","d","p","useColorPickerStyles_unstable","state","styles","className"],"sources":["useColorPickerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nexport const colorPickerClassNames = {\n root: 'fui-ColorPicker'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: tokens.spacingVerticalXS\n }\n});\n/**\n * Apply styling to the ColorPicker slots based on the state\n */ export const useColorPickerStyles_unstable = (state)=>{\n const styles = useStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorPickerClassNames.root, styles.root, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAI,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;AAAA,CAMrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,MAAMC,MAAM,GAAGV,SAAS,CAAC,CAAC;EAC1B;EACAS,KAAK,CAACV,IAAI,CAACY,SAAS,GAAGf,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAEW,MAAM,CAACX,IAAI,EAAEU,KAAK,CAACV,IAAI,CAACY,SAAS,CAAC;EAClG,OAAOF,KAAK;AAChB,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
- import { makeStyles, mergeClasses } from '@griffel/react';
3
- import { tokens } from '@fluentui/react-theme';
2
+ import { makeStyles, mergeClasses } from "@griffel/react";
3
+ import { tokens } from "@fluentui/react-theme";
4
4
  export const colorPickerClassNames = {
5
5
  root: 'fui-ColorPicker'
6
6
  };
@@ -0,0 +1,8 @@
1
+ export const colorSliderCSSVars = {
2
+ sliderDirectionVar: `--fui-Slider--direction`,
3
+ sliderProgressVar: `--fui-Slider--progress`,
4
+ thumbColorVar: `--fui-Slider__thumb--color`,
5
+ railColorVar: `--fui-Slider__rail--color`,
6
+ thumbSizeVar: `--fui-Slider__thumb--size`,
7
+ railSizeVar: `--fui-Slider__rail--size`
8
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ColorSlider/ColorSlider.constants.ts"],"sourcesContent":["export const colorSliderCSSVars = {\n sliderDirectionVar: `--fui-Slider--direction`,\n sliderProgressVar: `--fui-Slider--progress`,\n thumbColorVar: `--fui-Slider__thumb--color`,\n railColorVar: `--fui-Slider__rail--color`,\n thumbSizeVar: `--fui-Slider__thumb--size`,\n railSizeVar: `--fui-Slider__rail--size`,\n};\n"],"names":["colorSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","thumbSizeVar","railSizeVar"],"mappings":"AAAA,OAAO,MAAMA,qBAAqB;IAChCC,oBAAoB,CAAC,uBAAuB,CAAC;IAC7CC,mBAAmB,CAAC,sBAAsB,CAAC;IAC3CC,eAAe,CAAC,0BAA0B,CAAC;IAC3CC,cAAc,CAAC,yBAAyB,CAAC;IACzCC,cAAc,CAAC,yBAAyB,CAAC;IACzCC,aAAa,CAAC,wBAAwB,CAAC;AACzC,EAAE"}
@@ -1,9 +1,9 @@
1
1
  'use client';
2
- import * as React from 'react';
3
- import { useColorSlider_unstable } from './useColorSlider';
4
- import { renderColorSlider_unstable } from './renderColorSlider';
5
- import { useColorSliderStyles_unstable } from './useColorSliderStyles.styles';
6
- import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
2
+ import * as React from "react";
3
+ import { useColorSlider_unstable } from "./useColorSlider.js";
4
+ import { renderColorSlider_unstable } from "./renderColorSlider.js";
5
+ import { useColorSliderStyles_unstable } from "./useColorSliderStyles.styles.js";
6
+ import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
7
7
  /**
8
8
  * ColorSlider component
9
9
  */ export const ColorSlider = /*#__PURE__*/ React.forwardRef((props, ref)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSlider/ColorSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorSlider_unstable } from './useColorSlider';\nimport { renderColorSlider_unstable } from './renderColorSlider';\nimport { useColorSliderStyles_unstable } from './useColorSliderStyles.styles';\nimport type { ColorSliderProps } from './ColorSlider.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorSlider component\n */\nexport const ColorSlider: ForwardRefComponent<ColorSliderProps> = React.forwardRef((props, ref) => {\n const state = useColorSlider_unstable(props, ref);\n\n useColorSliderStyles_unstable(state);\n useCustomStyleHook_unstable('useColorSliderStyles_unstable')(state);\n\n return renderColorSlider_unstable(state);\n});\n\nColorSlider.displayName = 'ColorSlider';\n"],"names":["React","useColorSlider_unstable","renderColorSlider_unstable","useColorSliderStyles_unstable","useCustomStyleHook_unstable","ColorSlider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,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"}
1
+ {"version":3,"sources":["../src/components/ColorSlider/ColorSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useColorSlider_unstable } from './useColorSlider';\nimport { renderColorSlider_unstable } from './renderColorSlider';\nimport { useColorSliderStyles_unstable } from './useColorSliderStyles.styles';\nimport type { ColorSliderProps } from './ColorSlider.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ColorSlider component\n */\nexport const ColorSlider: ForwardRefComponent<ColorSliderProps> = React.forwardRef((props, ref) => {\n const state = useColorSlider_unstable(props, ref);\n\n useColorSliderStyles_unstable(state);\n useCustomStyleHook_unstable('useColorSliderStyles_unstable')(state);\n\n return renderColorSlider_unstable(state);\n});\n\nColorSlider.displayName = 'ColorSlider';\n"],"names":["React","useColorSlider_unstable","renderColorSlider_unstable","useColorSliderStyles_unstable","useCustomStyleHook_unstable","ColorSlider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;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"}
@@ -1,3 +1 @@
1
- /**
2
- * State used in rendering ColorSlider
3
- */ export { };
1
+ export { };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSlider/ColorSlider.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, EventHandler, EventData } from '@fluentui/react-utilities';\nimport type { HsvColor } from '../../types/color';\nimport type { ColorPickerProps } from '../ColorPicker/ColorPicker.types';\n\nexport type SliderOnChangeData = EventData<'change', React.ChangeEvent<HTMLInputElement>> & {\n color: HsvColor;\n};\n\nexport type ColorSliderSlots = {\n root: NonNullable<Slot<'div'>>;\n rail: NonNullable<Slot<'div'>>;\n thumb: NonNullable<Slot<'div'>>;\n input: NonNullable<Slot<'input'>>;\n};\n\nexport type ColorChannel = 'hue' | 'saturation' | 'value';\n\n/**\n * ColorSlider Props\n */\nexport type ColorSliderProps = Omit<\n ComponentProps<Partial<ColorSliderSlots>, 'input'>,\n 'defaultValue' | 'onChange' | 'value' | 'color'\n> &\n Pick<ColorPickerProps, 'shape'> & {\n /**\n * Color channel of the Slider.\n * @default `hue`\n */\n channel?: ColorChannel;\n\n /**\n * Triggers a callback when the value has been changed. This will be called on every individual step.\n */\n onChange?: EventHandler<SliderOnChangeData>;\n\n /**\n * Render the Slider in a vertical orientation, smallest value on the bottom.\n * @default `false`\n */\n vertical?: boolean;\n\n /**\n * Color of the ColorPicker\n */\n color?: HsvColor;\n\n /**\n * The starting color for an uncontrolled ColorSlider.\n */\n defaultColor?: HsvColor;\n };\n\n/**\n * State used in rendering ColorSlider\n */\nexport type ColorSliderState = ComponentState<ColorSliderSlots> &\n Pick<ColorSliderProps, 'vertical' | 'shape' | 'channel'>;\n"],"names":[],"mappings":"AAsDA;;CAEC,GACD,WAC2D"}
1
+ {"version":3,"sources":["../src/components/ColorSlider/ColorSlider.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, EventHandler, EventData } from '@fluentui/react-utilities';\nimport type { HsvColor } from '../../types/color';\nimport type { ColorPickerProps } from '../ColorPicker/ColorPicker.types';\n\nexport type SliderOnChangeData = EventData<'change', React.ChangeEvent<HTMLInputElement>> & {\n color: HsvColor;\n};\n\nexport type ColorSliderSlots = {\n root: NonNullable<Slot<'div'>>;\n rail: NonNullable<Slot<'div'>>;\n thumb: NonNullable<Slot<'div'>>;\n input: NonNullable<Slot<'input'>>;\n};\n\nexport type ColorChannel = 'hue' | 'saturation' | 'value';\n\n/**\n * ColorSlider Props\n */\nexport type ColorSliderProps = Omit<\n ComponentProps<Partial<ColorSliderSlots>, 'input'>,\n 'defaultValue' | 'onChange' | 'value' | 'color'\n> &\n Pick<ColorPickerProps, 'shape'> & {\n /**\n * Color channel of the Slider.\n * @default `hue`\n */\n channel?: ColorChannel;\n\n /**\n * Triggers a callback when the value has been changed. This will be called on every individual step.\n */\n onChange?: EventHandler<SliderOnChangeData>;\n\n /**\n * Render the Slider in a vertical orientation, smallest value on the bottom.\n * @default `false`\n */\n vertical?: boolean;\n\n /**\n * Color of the ColorPicker\n */\n color?: HsvColor;\n\n /**\n * The starting color for an uncontrolled ColorSlider.\n */\n defaultColor?: HsvColor;\n };\n\nexport type ColorSliderBaseProps = Omit<ColorSliderProps, 'shape'>;\n\n/**\n * State used in rendering ColorSlider\n */\nexport type ColorSliderState = ComponentState<ColorSliderSlots> &\n Pick<ColorSliderProps, 'vertical' | 'shape' | 'channel'>;\n\nexport type ColorSliderBaseState = Omit<ColorSliderState, 'shape'>;\n"],"names":[],"mappings":"AA8DA,WAAmE"}
@@ -1,4 +1,5 @@
1
- export { ColorSlider } from './ColorSlider';
2
- export { renderColorSlider_unstable } from './renderColorSlider';
3
- export { useColorSlider_unstable } from './useColorSlider';
4
- export { colorSliderCSSVars, colorSliderClassNames, useColorSliderStyles_unstable } from './useColorSliderStyles.styles';
1
+ export { ColorSlider } from "./ColorSlider.js";
2
+ export { renderColorSlider_unstable } from "./renderColorSlider.js";
3
+ export { useColorSliderBase_unstable, useColorSlider_unstable } from "./useColorSlider.js";
4
+ export { colorSliderClassNames, useColorSliderStyles_unstable } from "./useColorSliderStyles.styles.js";
5
+ export { colorSliderCSSVars } from "./ColorSlider.constants.js";
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSlider/index.ts"],"sourcesContent":["export { ColorSlider } from './ColorSlider';\nexport type { ColorSliderProps, ColorSliderSlots, ColorSliderState, SliderOnChangeData } from './ColorSlider.types';\nexport { renderColorSlider_unstable } from './renderColorSlider';\nexport { useColorSlider_unstable } from './useColorSlider';\nexport {\n colorSliderCSSVars,\n colorSliderClassNames,\n useColorSliderStyles_unstable,\n} from './useColorSliderStyles.styles';\n"],"names":["ColorSlider","renderColorSlider_unstable","useColorSlider_unstable","colorSliderCSSVars","colorSliderClassNames","useColorSliderStyles_unstable"],"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"}
1
+ {"version":3,"sources":["../src/components/ColorSlider/index.ts"],"sourcesContent":["export { ColorSlider } from './ColorSlider';\nexport type {\n ColorChannel,\n ColorSliderBaseProps,\n ColorSliderBaseState,\n ColorSliderProps,\n ColorSliderSlots,\n ColorSliderState,\n SliderOnChangeData,\n} from './ColorSlider.types';\nexport { renderColorSlider_unstable } from './renderColorSlider';\nexport { useColorSliderBase_unstable, useColorSlider_unstable } from './useColorSlider';\nexport { colorSliderClassNames, useColorSliderStyles_unstable } from './useColorSliderStyles.styles';\nexport { colorSliderCSSVars } from './ColorSlider.constants';\n"],"names":["ColorSlider","renderColorSlider_unstable","useColorSliderBase_unstable","useColorSlider_unstable","colorSliderClassNames","useColorSliderStyles_unstable","colorSliderCSSVars"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAU5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,2BAA2B,EAAEC,uBAAuB,QAAQ,sBAAmB;AACxF,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC;AACrG,SAASC,kBAAkB,QAAQ,6BAA0B"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
2
- import { assertSlots } from '@fluentui/react-utilities';
2
+ import { assertSlots } from "@fluentui/react-utilities";
3
3
  /**
4
4
  * Render the final JSX of ColorSlider
5
5
  */ export const renderColorSlider_unstable = (state)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSlider/renderColorSlider.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorSliderState, ColorSliderSlots } from './ColorSlider.types';\n\n/**\n * Render the final JSX of ColorSlider\n */\nexport const renderColorSlider_unstable = (state: ColorSliderState): JSXElement => {\n assertSlots<ColorSliderSlots>(state);\n\n return (\n <state.root>\n <state.input />\n <state.rail />\n <state.thumb />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorSlider_unstable","state","root","input","rail","thumb"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;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"}
1
+ {"version":3,"sources":["../src/components/ColorSlider/renderColorSlider.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ColorSliderBaseState, ColorSliderSlots } from './ColorSlider.types';\n\n/**\n * Render the final JSX of ColorSlider\n */\nexport const renderColorSlider_unstable = (state: ColorSliderBaseState): JSXElement => {\n assertSlots<ColorSliderSlots>(state);\n\n return (\n <state.root>\n <state.input />\n <state.rail />\n <state.thumb />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorSlider_unstable","state","root","input","rail","thumb"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;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"}
@@ -1,28 +1,26 @@
1
1
  'use client';
2
- import { tinycolor } from '@ctrl/tinycolor';
3
- import { getPartitionedNativeProps, useId, slot, useControllableState, useEventCallback } from '@fluentui/react-utilities';
4
- import { colorSliderCSSVars } from './useColorSliderStyles.styles';
5
- import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
6
- import { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';
7
- import { MIN, HUE_MAX, MAX as COLOR_MAX } from '../../utils/constants';
8
- import { getPercent } from '../../utils/getPercent';
9
- import { createHsvColor } from '../../utils/createHsvColor';
10
- import { clampValue, adjustChannel } from '../../utils/adjustChannel';
11
- import { INITIAL_COLOR_HSV } from '../../utils/constants';
2
+ import { getPartitionedNativeProps, useId, slot, useControllableState, useEventCallback } from "@fluentui/react-utilities";
3
+ import { colorSliderCSSVars } from "./ColorSlider.constants.js";
4
+ import { useFluent_unstable as useFluent } from "@fluentui/react-shared-contexts";
5
+ import { useColorPickerContextValue_unstable } from "../../contexts/colorPicker.js";
6
+ import { MIN, HUE_MAX, MAX as COLOR_MAX } from "../../utils/constants.js";
7
+ import { getPercent } from "../../utils/getPercent.js";
8
+ import { createHsvColor } from "../../utils/createHsvColor.js";
9
+ import { clampValue, adjustChannel } from "../../utils/adjustChannel.js";
10
+ import { INITIAL_COLOR_HSV } from "../../utils/constants.js";
11
+ import { createHslColor, createHslColorString } from "../../utils/createHslColor.js";
12
12
  /**
13
- * Create the state required to render ColorSlider.
13
+ * Create the base state required to render unstyled ColorSlider.
14
14
  *
15
- * The returned state can be modified with hooks such as useColorSliderStyles_unstable,
16
- * before being passed to renderColorSlider_unstable.
15
+ * The returned state can be modified with hooks before being passed to renderColorSlider_unstable.
17
16
  *
18
17
  * @param props - props from this instance of ColorSlider
19
18
  * @param ref - reference to root HTMLInputElement of ColorSlider
20
- */ export const useColorSlider_unstable = (props, ref)=>{
19
+ */ export const useColorSliderBase_unstable = (props, ref)=>{
21
20
  'use no memo'; // justified: compiler would optimize useColorSlider_unstable — manual opt-out to preserve runtime behavior
22
21
  const { dir } = useFluent();
23
22
  const onChangeFromContext = useColorPickerContextValue_unstable((ctx)=>ctx.requestChange);
24
23
  const colorFromContext = useColorPickerContextValue_unstable((ctx)=>ctx.color);
25
- const shapeFromContext = useColorPickerContextValue_unstable((ctx)=>ctx.shape);
26
24
  const nativeProps = getPartitionedNativeProps({
27
25
  props,
28
26
  primarySlotTagName: 'input',
@@ -31,10 +29,10 @@ import { INITIAL_COLOR_HSV } from '../../utils/constants';
31
29
  'color'
32
30
  ]
33
31
  });
34
- const { color, channel = 'hue', onChange = onChangeFromContext, shape = shapeFromContext, vertical, // Slots
32
+ const { color, channel = 'hue', onChange = onChangeFromContext, vertical, // Slots
35
33
  root, input, rail, thumb } = props;
36
34
  const hsvColor = color || colorFromContext;
37
- const hslColor = tinycolor(hsvColor).toHsl();
35
+ const hslColor = createHslColor(hsvColor);
38
36
  const [currentColor, setCurrentColor] = useControllableState({
39
37
  defaultState: props.defaultColor,
40
38
  state: hsvColor,
@@ -77,11 +75,10 @@ import { INITIAL_COLOR_HSV } from '../../utils/constants';
77
75
  const rootVariables = {
78
76
  [colorSliderCSSVars.sliderDirectionVar]: vertical ? '180deg' : dir === 'ltr' ? '-90deg' : '90deg',
79
77
  [colorSliderCSSVars.sliderProgressVar]: `${valuePercent}%`,
80
- [colorSliderCSSVars.thumbColorVar]: channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : tinycolor(hsvColor).toRgbString(),
81
- [colorSliderCSSVars.railColorVar]: channel === 'hue' ? `hsl(${hslColor.h} ${hslColor.s * 100}%, ${hslColor.l * 100}%)` : `hsl(${hslColor.h} 100%, 50%)`
78
+ [colorSliderCSSVars.thumbColorVar]: channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : createHslColorString(hsvColor),
79
+ [colorSliderCSSVars.railColorVar]: channel === 'hue' ? `hsl(${hslColor.h}, ${hslColor.s * 100}%, ${hslColor.l * 100}%)` : `hsl(${hslColor.h}, 100%, 50%)`
82
80
  };
83
81
  const state = {
84
- shape,
85
82
  vertical,
86
83
  channel,
87
84
  components: {
@@ -127,3 +124,20 @@ import { INITIAL_COLOR_HSV } from '../../utils/constants';
127
124
  state.input.onChange = _onChange;
128
125
  return state;
129
126
  };
127
+ /**
128
+ * Create the state required to render ColorSlider.
129
+ *
130
+ * The returned state can be modified with hooks such as useColorSliderStyles_unstable,
131
+ * before being passed to renderColorSlider_unstable.
132
+ *
133
+ * @param props - props from this instance of ColorSlider
134
+ * @param ref - reference to root HTMLInputElement of ColorSlider
135
+ */ export const useColorSlider_unstable = (props, ref)=>{
136
+ const shapeFromContext = useColorPickerContextValue_unstable((ctx)=>ctx.shape);
137
+ const { shape = shapeFromContext, ...baseProps } = props;
138
+ const state = {
139
+ ...useColorSliderBase_unstable(baseProps, ref),
140
+ shape
141
+ };
142
+ return state;
143
+ };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/ColorSlider/useColorSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { tinycolor } from '@ctrl/tinycolor';\nimport {\n getPartitionedNativeProps,\n useId,\n slot,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { colorSliderCSSVars } from './useColorSliderStyles.styles';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type { ColorSliderProps, ColorSliderState } from './ColorSlider.types';\nimport { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from '../../utils/constants';\nimport { getPercent } from '../../utils/getPercent';\nimport { createHsvColor } from '../../utils/createHsvColor';\nimport { clampValue, type ChannelActions, adjustChannel } from '../../utils/adjustChannel';\nimport type { HsvColor } from '../../types/color';\nimport { INITIAL_COLOR_HSV } from '../../utils/constants';\n\n/**\n * Create the state required to render ColorSlider.\n *\n * The returned state can be modified with hooks such as useColorSliderStyles_unstable,\n * before being passed to renderColorSlider_unstable.\n *\n * @param props - props from this instance of ColorSlider\n * @param ref - reference to root HTMLInputElement of ColorSlider\n */\nexport const useColorSlider_unstable = (\n props: ColorSliderProps,\n ref: React.Ref<HTMLInputElement>,\n): ColorSliderState => {\n 'use no memo'; // justified: compiler would optimize useColorSlider_unstable — manual opt-out to preserve runtime behavior\n\n const { dir } = useFluent();\n const onChangeFromContext = useColorPickerContextValue_unstable(ctx => ctx.requestChange);\n const colorFromContext = useColorPickerContextValue_unstable(ctx => ctx.color);\n const shapeFromContext = useColorPickerContextValue_unstable(ctx => ctx.shape);\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange', 'color'],\n });\n\n const {\n color,\n channel = 'hue',\n onChange = onChangeFromContext,\n shape = shapeFromContext,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const hsvColor = color || colorFromContext;\n const hslColor = tinycolor(hsvColor).toHsl();\n\n const [currentColor, setCurrentColor] = useControllableState<HsvColor>({\n defaultState: props.defaultColor,\n state: hsvColor,\n initialState: INITIAL_COLOR_HSV,\n });\n\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n\n const valueChannelActions: ChannelActions<number> = {\n hue: clampValue(currentColor.h),\n saturation: clampValue(currentColor.s * 100),\n value: clampValue(currentColor.v * 100),\n };\n\n const clampedValue = adjustChannel(channel, valueChannelActions);\n const valuePercent = getPercent(clampedValue, MIN, MAX);\n\n const inputOnChange = input?.onChange;\n\n const _onChange: React.ChangeEventHandler<HTMLInputElement> = useEventCallback(event => {\n const newValue = Number(event.target.value);\n const colorActions: ChannelActions<() => HsvColor> = {\n hue: () => createHsvColor({ ...hsvColor, h: newValue }),\n saturation: () => createHsvColor({ ...hsvColor, s: newValue / 100 }),\n value: () => createHsvColor({ ...hsvColor, v: newValue / 100 }),\n };\n const newColor = adjustChannel(channel, colorActions)();\n\n setCurrentColor(newColor);\n\n inputOnChange?.(event);\n onChange?.(event, {\n type: 'change',\n event,\n color: newColor,\n });\n });\n\n const rootVariables = {\n [colorSliderCSSVars.sliderDirectionVar]: vertical ? '180deg' : dir === 'ltr' ? '-90deg' : '90deg',\n [colorSliderCSSVars.sliderProgressVar]: `${valuePercent}%`,\n [colorSliderCSSVars.thumbColorVar]:\n channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : tinycolor(hsvColor).toRgbString(),\n [colorSliderCSSVars.railColorVar]:\n channel === 'hue'\n ? `hsl(${hslColor.h} ${hslColor.s * 100}%, ${hslColor.l * 100}%)`\n : `hsl(${hslColor.h} 100%, 50%)`,\n };\n\n const state: ColorSliderState = {\n shape,\n vertical,\n channel,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: {\n role: 'group',\n ...nativeProps.root,\n },\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n min: MIN,\n max: MAX,\n tabIndex: 0,\n ['aria-orientation']: vertical ? 'vertical' : 'horizontal',\n ...nativeProps.primary,\n type: 'range',\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Root props\n state.root.style = {\n ...rootVariables,\n ...state.root.style,\n };\n\n // Input Props\n state.input.value = clampedValue;\n state.input.onChange = _onChange;\n return state;\n};\n"],"names":["tinycolor","getPartitionedNativeProps","useId","slot","useControllableState","useEventCallback","colorSliderCSSVars","useFluent_unstable","useFluent","useColorPickerContextValue_unstable","MIN","HUE_MAX","MAX","COLOR_MAX","getPercent","createHsvColor","clampValue","adjustChannel","INITIAL_COLOR_HSV","useColorSlider_unstable","props","ref","dir","onChangeFromContext","ctx","requestChange","colorFromContext","color","shapeFromContext","shape","nativeProps","primarySlotTagName","excludedPropNames","channel","onChange","vertical","root","input","rail","thumb","hsvColor","hslColor","toHsl","currentColor","setCurrentColor","defaultState","defaultColor","state","initialState","valueChannelActions","hue","h","saturation","s","value","v","clampedValue","valuePercent","inputOnChange","_onChange","event","newValue","Number","target","colorActions","newColor","type","rootVariables","sliderDirectionVar","sliderProgressVar","thumbColorVar","toRgbString","railColorVar","l","components","always","defaultProps","role","elementType","id","min","max","tabIndex","primary","style"],"mappings":"AAAA;AAGA,SAASA,SAAS,QAAQ,kBAAkB;AAC5C,SACEC,yBAAyB,EACzBC,KAAK,EACLC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,QACX,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,gCAAgC;AACnE,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAElF,SAASC,mCAAmC,QAAQ,6BAA6B;AACjF,SAASC,GAAG,EAAEC,OAAO,EAAEC,OAAOC,SAAS,QAAQ,wBAAwB;AACvE,SAASC,UAAU,QAAQ,yBAAyB;AACpD,SAASC,cAAc,QAAQ,6BAA6B;AAC5D,SAASC,UAAU,EAAuBC,aAAa,QAAQ,4BAA4B;AAE3F,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC;IAEA,eAAe,2GAA2G;IAE1H,MAAM,EAAEC,GAAG,EAAE,GAAGd;IAChB,MAAMe,sBAAsBd,oCAAoCe,CAAAA,MAAOA,IAAIC,aAAa;IACxF,MAAMC,mBAAmBjB,oCAAoCe,CAAAA,MAAOA,IAAIG,KAAK;IAC7E,MAAMC,mBAAmBnB,oCAAoCe,CAAAA,MAAOA,IAAIK,KAAK;IAC7E,MAAMC,cAAc7B,0BAA0B;QAC5CmB;QACAW,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;SAAQ;IAC1C;IAEA,MAAM,EACJL,KAAK,EACLM,UAAU,KAAK,EACfC,WAAWX,mBAAmB,EAC9BM,QAAQD,gBAAgB,EACxBO,QA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IACdrC,MAAMV,KAAK,CAACiB,KAAK,GAAGE;IACpBT,MAAMV,KAAK,CAACH,QAAQ,GAAGyB;IACvB,OAAOZ;AACT,EAAE"}
1
+ {"version":3,"sources":["../src/components/ColorSlider/useColorSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport {\n getPartitionedNativeProps,\n useId,\n slot,\n useControllableState,\n useEventCallback,\n} from '@fluentui/react-utilities';\nimport { colorSliderCSSVars } from './ColorSlider.constants';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport type {\n ColorSliderBaseProps,\n ColorSliderBaseState,\n ColorSliderProps,\n ColorSliderState,\n} from './ColorSlider.types';\nimport { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from '../../utils/constants';\nimport { getPercent } from '../../utils/getPercent';\nimport { createHsvColor } from '../../utils/createHsvColor';\nimport { clampValue, type ChannelActions, adjustChannel } from '../../utils/adjustChannel';\nimport type { HsvColor } from '../../types/color';\nimport { INITIAL_COLOR_HSV } from '../../utils/constants';\nimport { createHslColor, createHslColorString } from '../../utils/createHslColor';\n\n/**\n * Create the base state required to render unstyled ColorSlider.\n *\n * The returned state can be modified with hooks before being passed to renderColorSlider_unstable.\n *\n * @param props - props from this instance of ColorSlider\n * @param ref - reference to root HTMLInputElement of ColorSlider\n */\nexport const useColorSliderBase_unstable = (\n props: ColorSliderBaseProps,\n ref: React.Ref<HTMLInputElement>,\n): ColorSliderBaseState => {\n 'use no memo'; // justified: compiler would optimize useColorSlider_unstable — manual opt-out to preserve runtime behavior\n\n const { dir } = useFluent();\n const onChangeFromContext = useColorPickerContextValue_unstable(ctx => ctx.requestChange);\n const colorFromContext = useColorPickerContextValue_unstable(ctx => ctx.color);\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange', 'color'],\n });\n\n const {\n color,\n channel = 'hue',\n onChange = onChangeFromContext,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const hsvColor = color || colorFromContext;\n const hslColor = createHslColor(hsvColor);\n\n const [currentColor, setCurrentColor] = useControllableState<HsvColor>({\n defaultState: props.defaultColor,\n state: hsvColor,\n initialState: INITIAL_COLOR_HSV,\n });\n\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n\n const valueChannelActions: ChannelActions<number> = {\n hue: clampValue(currentColor.h),\n saturation: clampValue(currentColor.s * 100),\n value: clampValue(currentColor.v * 100),\n };\n\n const clampedValue = adjustChannel(channel, valueChannelActions);\n const valuePercent = getPercent(clampedValue, MIN, MAX);\n\n const inputOnChange = input?.onChange;\n\n const _onChange: React.ChangeEventHandler<HTMLInputElement> = useEventCallback(event => {\n const newValue = Number(event.target.value);\n const colorActions: ChannelActions<() => HsvColor> = {\n hue: () => createHsvColor({ ...hsvColor, h: newValue }),\n saturation: () => createHsvColor({ ...hsvColor, s: newValue / 100 }),\n value: () => createHsvColor({ ...hsvColor, v: newValue / 100 }),\n };\n const newColor = adjustChannel(channel, colorActions)();\n\n setCurrentColor(newColor);\n\n inputOnChange?.(event);\n onChange?.(event, {\n type: 'change',\n event,\n color: newColor,\n });\n });\n\n const rootVariables = {\n [colorSliderCSSVars.sliderDirectionVar]: vertical ? '180deg' : dir === 'ltr' ? '-90deg' : '90deg',\n [colorSliderCSSVars.sliderProgressVar]: `${valuePercent}%`,\n [colorSliderCSSVars.thumbColorVar]:\n channel === 'hue' ? `hsl(${clampedValue}, 100%, 50%)` : createHslColorString(hsvColor),\n [colorSliderCSSVars.railColorVar]:\n channel === 'hue'\n ? `hsl(${hslColor.h}, ${hslColor.s * 100}%, ${hslColor.l * 100}%)`\n : `hsl(${hslColor.h}, 100%, 50%)`,\n };\n\n const state: ColorSliderBaseState = {\n vertical,\n channel,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: {\n role: 'group',\n ...nativeProps.root,\n },\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\n min: MIN,\n max: MAX,\n tabIndex: 0,\n ['aria-orientation']: vertical ? 'vertical' : 'horizontal',\n ...nativeProps.primary,\n type: 'range',\n },\n elementType: 'input',\n }),\n rail: slot.always(rail, { elementType: 'div' }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n // Root props\n state.root.style = {\n ...rootVariables,\n ...state.root.style,\n };\n\n // Input Props\n state.input.value = clampedValue;\n state.input.onChange = _onChange;\n return state;\n};\n\n/**\n * Create the state required to render ColorSlider.\n *\n * The returned state can be modified with hooks such as useColorSliderStyles_unstable,\n * before being passed to renderColorSlider_unstable.\n *\n * @param props - props from this instance of ColorSlider\n * @param ref - reference to root HTMLInputElement of ColorSlider\n */\nexport const useColorSlider_unstable = (\n props: ColorSliderProps,\n ref: React.Ref<HTMLInputElement>,\n): ColorSliderState => {\n const shapeFromContext = useColorPickerContextValue_unstable(ctx => ctx.shape);\n\n const { shape = shapeFromContext, ...baseProps } = props;\n\n const state: ColorSliderState = {\n ...useColorSliderBase_unstable(baseProps, ref),\n shape,\n };\n\n return state;\n};\n"],"names":["getPartitionedNativeProps","useId","slot","useControllableState","useEventCallback","colorSliderCSSVars","useFluent_unstable","useFluent","useColorPickerContextValue_unstable","MIN","HUE_MAX","MAX","COLOR_MAX","getPercent","createHsvColor","clampValue","adjustChannel","INITIAL_COLOR_HSV","createHslColor","createHslColorString","useColorSliderBase_unstable","props","ref","dir","onChangeFromContext","ctx","requestChange","colorFromContext","color","nativeProps","primarySlotTagName","excludedPropNames","channel","onChange","vertical","root","input","rail","thumb","hsvColor","hslColor","currentColor","setCurrentColor","defaultState","defaultColor","state","initialState","valueChannelActions","hue","h","saturation","s","value","v","clampedValue","valuePercent","inputOnChange","_onChange","event","newValue","Number","target","colorActions","newColor","type","rootVariables","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","l","components","always","defaultProps","role","elementType","id","min","max","tabIndex","primary","style","useColorSlider_unstable","shapeFromContext","shape","baseProps"],"mappings":"AAAA;AAGA,SACEA,yBAAyB,EACzBC,KAAK,EACLC,IAAI,EACJC,oBAAoB,EACpBC,gBAAgB,QACX,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,6BAA0B;AAC7D,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAOlF,SAASC,mCAAmC,QAAQ,gCAA6B;AACjF,SAASC,GAAG,EAAEC,OAAO,EAAEC,OAAOC,SAAS,QAAQ,2BAAwB;AACvE,SAASC,UAAU,QAAQ,4BAAyB;AACpD,SAASC,cAAc,QAAQ,gCAA6B;AAC5D,SAASC,UAAU,EAAuBC,aAAa,QAAQ,+BAA4B;AAE3F,SAASC,iBAAiB,QAAQ,2BAAwB;AAC1D,SAASC,cAAc,EAAEC,oBAAoB,QAAQ,gCAA6B;AAElF;;;;;;;CAOC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,eAAe,2GAA2G;IAE1H,MAAM,EAAEC,GAAG,EAAE,GAAGhB;IAChB,MAAMiB,sBAAsBhB,oCAAoCiB,CAAAA,MAAOA,IAAIC,aAAa;IACxF,MAAMC,mBAAmBnB,oCAAoCiB,CAAAA,MAAOA,IAAIG,KAAK;IAC7E,MAAMC,cAAc7B,0BAA0B;QAC5CqB;QACAS,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;SAAQ;IAC1C;IAEA,MAAM,EACJH,KAAK,EACLI,UAAU,KAAK,EACfC,WAAWT,mBAAmB,EAC9BU,QAAQ,EACR,QAAQ;IACRC,IAAI,EACJC,KAAK,EACLC,IAAI,EACJC,KAAK,EACN,GAAGjB;IAEJ,MAAMkB,WAAWX,SAASD;IAC1B,MAAMa,WAAWtB,eAAeqB;IAEhC,MAAM,CAACE,cAAcC,gBAAgB,GAAGvC,qBAA+B;QACrEwC,cAActB,MAAMuB,YAAY;QAChCC,OAAON;QACPO,cAAc7B;IAChB;IAEA,MAAMN,MA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