@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
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/ColorSlider/useColorSliderStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport type { ColorSliderSlots, ColorSliderState } from './ColorSlider.types';\nimport { colorSliderCSSVars } from './ColorSlider.constants';\n\nexport const colorSliderClassNames: SlotClassNames<ColorSliderSlots> = {\n root: 'fui-ColorSlider',\n rail: 'fui-ColorSlider__rail',\n thumb: 'fui-ColorSlider__thumb',\n input: 'fui-ColorSlider__input',\n};\n\nconst hueBackground = `linear-gradient(${[\n `var(${colorSliderCSSVars.sliderDirectionVar})`,\n 'red',\n 'fuchsia',\n 'blue',\n 'aqua',\n 'lime',\n 'yellow',\n 'red',\n].join(',')})`;\n\n/**\n * Styles for the root slot\n */\nconst useRootStyles = makeResetStyles({\n position: 'relative',\n display: 'inline-grid',\n touchAction: 'none',\n alignItems: 'center',\n justifyItems: 'center',\n [colorSliderCSSVars.thumbSizeVar]: '20px',\n [colorSliderCSSVars.railSizeVar]: '20px',\n minHeight: '32px',\n});\n\nconst useStyles = makeStyles({\n horizontal: {\n minWidth: '200px',\n // 3x3 grid with the rail and thumb in the center cell [2,2] and the hidden input stretching across all cells\n gridTemplateRows: `1fr var(${colorSliderCSSVars.thumbSizeVar}) 1fr`,\n gridTemplateColumns: `1fr 100% 1fr`,\n },\n\n vertical: {\n minHeight: '280px',\n // 3x3 grid with the rail and thumb in the center cell [2,2] and the hidden input stretching across all cells\n gridTemplateRows: `1fr 100% 1fr`,\n gridTemplateColumns: `1fr var(${colorSliderCSSVars.thumbSizeVar}) 1fr`,\n },\n});\n\nconst useChannelStyles = makeStyles({\n hue: {\n backgroundImage: hueBackground,\n },\n saturation: {\n backgroundImage: `linear-gradient(to right, #808080, var(${colorSliderCSSVars.railColorVar}))`,\n },\n value: {\n backgroundImage: `linear-gradient(to right, #000, var(${colorSliderCSSVars.railColorVar}))`,\n },\n});\n\n/**\n * Styles for the rail slot\n */\nconst useRailStyles = makeStyles({\n rail: {\n pointerEvents: 'none',\n gridRowStart: '2',\n gridRowEnd: '2',\n gridColumnStart: '2',\n gridColumnEnd: '2',\n position: 'relative',\n forcedColorAdjust: 'none',\n outlineWidth: '1px',\n outlineStyle: 'solid',\n outlineColor: tokens.colorTransparentStroke,\n '::before': {\n content: \"''\",\n position: 'absolute',\n },\n },\n\n horizontal: {\n width: '100%',\n height: `var(${colorSliderCSSVars.railSizeVar})`,\n '::before': {\n left: '-1px',\n right: '-1px',\n height: `var(${colorSliderCSSVars.railSizeVar})`,\n },\n },\n\n vertical: {\n width: `var(${colorSliderCSSVars.railSizeVar})`,\n height: '100%',\n '::before': {\n width: `var(${colorSliderCSSVars.railSizeVar})`,\n top: '-1px',\n bottom: '1px',\n },\n },\n});\n\n/**\n * Styles for the thumb slot\n */\nconst useThumbStyles = makeStyles({\n thumb: {\n gridRowStart: '2',\n gridRowEnd: '2',\n gridColumnStart: '2',\n gridColumnEnd: '2',\n position: 'absolute',\n width: `var(${colorSliderCSSVars.thumbSizeVar})`,\n height: `var(${colorSliderCSSVars.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(${colorSliderCSSVars.thumbColorVar})`,\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 horizontal: {\n transform: 'translateX(-50%)',\n left: `var(${colorSliderCSSVars.sliderProgressVar})`,\n },\n vertical: {\n transform: 'translateY(50%)',\n bottom: `var(${colorSliderCSSVars.sliderProgressVar})`,\n },\n});\n\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n },\n});\n\n/**\n * Styles for the Input slot\n */\nconst useInputStyles = makeStyles({\n input: {\n cursor: 'pointer',\n opacity: 0,\n gridRowStart: '1',\n gridRowEnd: '-1',\n gridColumnStart: '1',\n gridColumnEnd: '-1',\n padding: '0',\n margin: '0',\n [`:focus-visible ~ .${colorSliderClassNames.thumb}`]: {\n border: `2px solid ${tokens.colorStrokeFocus2}`,\n outline: `${tokens.strokeWidthThick} solid ${tokens.colorTransparentStroke}`,\n borderRadius: tokens.borderRadiusCircular,\n },\n },\n horizontal: {\n height: `var(${colorSliderCSSVars.thumbSizeVar})`,\n width: '100%',\n },\n vertical: {\n height: '100%',\n width: `var(${colorSliderCSSVars.thumbSizeVar})`,\n 'writing-mode': 'vertical-lr',\n direction: 'rtl',\n },\n});\n\n/**\n * Apply styling to the ColorSlider slots based on the state\n */\nexport const useColorSliderStyles_unstable = (state: ColorSliderState): ColorSliderState => {\n const rootStyles = useRootStyles();\n const styles = useStyles();\n const railStyles = useRailStyles();\n const thumbStyles = useThumbStyles();\n const inputStyles = useInputStyles();\n const shapeStyles = useShapeStyles();\n const channelStyles = useChannelStyles();\n const isVertical = state.vertical;\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n colorSliderClassNames.root,\n rootStyles,\n isVertical ? styles.vertical : styles.horizontal,\n state.root.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.rail.className = mergeClasses(\n colorSliderClassNames.rail,\n railStyles.rail,\n channelStyles[state.channel || 'hue'],\n shapeStyles[state.shape || 'rounded'],\n isVertical ? railStyles.vertical : railStyles.horizontal,\n state.rail.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(\n colorSliderClassNames.thumb,\n thumbStyles.thumb,\n isVertical ? thumbStyles.vertical : thumbStyles.horizontal,\n state.thumb.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(\n colorSliderClassNames.input,\n inputStyles.input,\n isVertical ? inputStyles.vertical : inputStyles.horizontal,\n state.input.className,\n );\n return state;\n};\n"],"names":["makeStyles","makeResetStyles","mergeClasses","tokens","colorSliderCSSVars","colorSliderClassNames","root","rail","thumb","input","hueBackground","sliderDirectionVar","join","useRootStyles","position","display","touchAction","alignItems","justifyItems","thumbSizeVar","railSizeVar","minHeight","useStyles","horizontal","minWidth","gridTemplateRows","gridTemplateColumns","vertical","useChannelStyles","hue","backgroundImage","saturation","railColorVar","value","useRailStyles","pointerEvents","gridRowStart","gridRowEnd","gridColumnStart","gridColumnEnd","forcedColorAdjust","outlineWidth","outlineStyle","outlineColor","colorTransparentStroke","content","width","height","left","right","top","bottom","useThumbStyles","borderRadius","borderRadiusCircular","border","strokeWidthThin","colorNeutralForeground4","boxShadow","shadow4","backgroundColor","thumbColorVar","inset","boxSizing","strokeWidthThick","colorNeutralBackground1","transform","sliderProgressVar","useShapeStyles","rounded","borderRadiusMedium","square","borderRadiusNone","useInputStyles","cursor","opacity","padding","margin","colorStrokeFocus2","outline","direction","useColorSliderStyles_unstable","state","rootStyles","styles","railStyles","thumbStyles","inputStyles","shapeStyles","channelStyles","isVertical","className","channel","shape"],"mappings":"AAAA;;;;;;;;;;;;yBAQaK;;;iCAuLA4E;eAAAA;;;uBA7L6C,iBAAiB;4BAEpD,wBAAwB;sCAEZ,6BAA0B;AAEtD,MAAM5E,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,MAAMC,gBAAgB,CAAC,gBAAgB,EAAE;IACvC,CAAC,IAAI,EAAEN,wCAAAA,CAAmBO,kBAAkB,CAAC,CAAC,CAAC;IAC/C;IACA;IACA;IACA;IACA;IAC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gB7D;IACtB,MAAM8D,aAAaR,MAAMvD,QAAQ;IAEjC,oDAAoD;IACpDuD,MAAM5E,IAAI,CAACqF,SAAS,OAAGzF,mBAAAA,EACrBG,sBAAsBC,IAAI,EAC1B6E,YACAO,aAAaN,OAAOzD,QAAQ,GAAGyD,OAAO7D,UAAU,EAChD2D,MAAM5E,IAAI,CAACqF,SAAS;IAGtB,oDAAoD;IACpDT,MAAM3E,IAAI,CAACoF,SAAS,OAAGzF,mBAAAA,EACrBG,sBAAsBE,IAAI,EAC1B8E,WAAW9E,IAAI,EACfkF,aAAa,CAACP,MAAMU,OAAO,IAAI,MAAM,EACrCJ,WAAW,CAACN,MAAMW,KAAK,IAAI,UAAU,EACrCH,aAAaL,WAAW1D,QAAQ,GAAG0D,WAAW9D,UAAU,EACxD2D,MAAM3E,IAAI,CAACoF,SAAS;IAGtB,oDAAoD;IACpDT,MAAM1E,KAAK,CAACmF,SAAS,OAAGzF,mBAAAA,EACtBG,sBAAsBG,KAAK,EAC3B8E,YAAY9E,KAAK,EACjBkF,aAAaJ,YAAY3D,QAAQ,GAAG2D,YAAY/D,UAAU,EAC1D2D,MAAM1E,KAAK,CAACmF,SAAS;IAGvB,oDAAoD;IACpDT,MAAMzE,KAAK,CAACkF,SAAS,OAAGzF,mBAAAA,EACtBG,sBAAsBI,KAAK,EAC3B8E,YAAY9E,KAAK,EACjBiF,aAAaH,YAAY5D,QAAQ,GAAG4D,YAAYhE,UAAU,EAC1D2D,MAAMzE,KAAK,CAACkF,SAAS;IAEvB,OAAOT;AACT,EAAE"}
@@ -45,24 +45,42 @@ _export(exports, {
45
45
  renderColorSlider_unstable: function() {
46
46
  return _ColorSlider.renderColorSlider_unstable;
47
47
  },
48
+ useAlphaSliderBase_unstable: function() {
49
+ return _AlphaSlider.useAlphaSliderBase_unstable;
50
+ },
48
51
  useAlphaSliderStyles_unstable: function() {
49
52
  return _AlphaSlider.useAlphaSliderStyles_unstable;
50
53
  },
51
54
  useAlphaSlider_unstable: function() {
52
55
  return _AlphaSlider.useAlphaSlider_unstable;
53
56
  },
57
+ useColorAreaBase_unstable: function() {
58
+ return _ColorArea.useColorAreaBase_unstable;
59
+ },
54
60
  useColorAreaStyles_unstable: function() {
55
61
  return _ColorArea.useColorAreaStyles_unstable;
56
62
  },
57
63
  useColorArea_unstable: function() {
58
64
  return _ColorArea.useColorArea_unstable;
59
65
  },
66
+ useColorPickerBase_unstable: function() {
67
+ return _ColorPicker.useColorPickerBase_unstable;
68
+ },
69
+ useColorPickerContextValue_unstable: function() {
70
+ return _colorPicker.useColorPickerContextValue_unstable;
71
+ },
72
+ useColorPickerContextValues: function() {
73
+ return _ColorPicker.useColorPickerContextValues;
74
+ },
60
75
  useColorPickerStyles_unstable: function() {
61
76
  return _ColorPicker.useColorPickerStyles_unstable;
62
77
  },
63
78
  useColorPicker_unstable: function() {
64
79
  return _ColorPicker.useColorPicker_unstable;
65
80
  },
81
+ useColorSliderBase_unstable: function() {
82
+ return _ColorSlider.useColorSliderBase_unstable;
83
+ },
66
84
  useColorSliderStyles_unstable: function() {
67
85
  return _ColorSlider.useColorSliderStyles_unstable;
68
86
  },
@@ -70,7 +88,8 @@ _export(exports, {
70
88
  return _ColorSlider.useColorSlider_unstable;
71
89
  }
72
90
  });
73
- const _ColorSlider = require("./ColorSlider");
74
- const _ColorPicker = require("./ColorPicker");
75
- const _ColorArea = require("./ColorArea");
76
- const _AlphaSlider = require("./AlphaSlider");
91
+ const _ColorSlider = require("./ColorSlider.cjs");
92
+ const _ColorPicker = require("./ColorPicker.cjs");
93
+ const _ColorArea = require("./ColorArea.cjs");
94
+ const _AlphaSlider = require("./AlphaSlider.cjs");
95
+ const _colorPicker = require("./contexts/colorPicker.cjs");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {\n ColorChannel,\n ColorSliderBaseProps,\n ColorSliderBaseState,\n ColorSliderProps,\n ColorSliderSlots,\n ColorSliderState,\n} from './ColorSlider';\nexport {\n ColorSlider,\n colorSliderClassNames,\n renderColorSlider_unstable,\n useColorSliderBase_unstable,\n useColorSliderStyles_unstable,\n useColorSlider_unstable,\n} from './ColorSlider';\nexport type {\n ColorPickerBaseProps,\n ColorPickerBaseState,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './ColorPicker';\nexport {\n ColorPicker,\n colorPickerClassNames,\n renderColorPicker_unstable,\n useColorPickerBase_unstable,\n useColorPickerContextValues,\n useColorPickerStyles_unstable,\n useColorPicker_unstable,\n} from './ColorPicker';\nexport type {\n ColorAreaBaseProps,\n ColorAreaBaseState,\n ColorAreaProps,\n ColorAreaSlots,\n ColorAreaState,\n} from './ColorArea';\nexport {\n ColorArea,\n colorAreaClassNames,\n renderColorArea_unstable,\n useColorAreaBase_unstable,\n useColorAreaStyles_unstable,\n useColorArea_unstable,\n} from './ColorArea';\nexport type {\n AlphaSliderBaseProps,\n AlphaSliderBaseState,\n AlphaSliderProps,\n AlphaSliderSlots,\n AlphaSliderState,\n} from './AlphaSlider';\nexport {\n AlphaSlider,\n alphaSliderClassNames,\n renderAlphaSlider_unstable,\n useAlphaSliderBase_unstable,\n useAlphaSliderStyles_unstable,\n useAlphaSlider_unstable,\n} from './AlphaSlider';\nexport type { ColorPickerContextValue, ColorPickerContextValues } from './contexts/colorPicker';\nexport { useColorPickerContextValue_unstable } from './contexts/colorPicker';\n"],"names":["ColorSlider","colorSliderClassNames","renderColorSlider_unstable","useColorSliderBase_unstable","useColorSliderStyles_unstable","useColorSlider_unstable","ColorPicker","colorPickerClassNames","renderColorPicker_unstable","useColorPickerBase_unstable","useColorPickerContextValues","useColorPickerStyles_unstable","useColorPicker_unstable","ColorArea","colorAreaClassNames","renderColorArea_unstable","useColorAreaBase_unstable","useColorAreaStyles_unstable","useColorArea_unstable","AlphaSlider","alphaSliderClassNames","renderAlphaSlider_unstable","useAlphaSliderBase_unstable","useAlphaSliderStyles_unstable","useAlphaSlider_unstable","useColorPickerContextValue_unstable"],"mappings":";;;;;;;;;;;IAuDEmB;uCAAW;;aAfF;eAATN;;eAhBW;eAAXP;;;eAfAN,wBAAW;;;eA+CXoB,kCAAqB;;;eAfrBN,8BAAmB;;;eAhBnBP,kCAAqB;;;eAfrBN,kCAAqB;;;eA+CrBoB,uCAA0B;;;eAf1BN,mCAAwB;;;eAhBxBP,uCAA0B;;;eAf1BN,uCAA0B;;;eA+C1BoB,wCAA2B;;;eAC3BC,0CAA6B;;IAC7BC,uBAAuB;;;;eAjBvBR,oCAAyB;;;eACzBC,sCAA2B;;;eAC3BC,gCAAqB;;;eAlBrBT,wCAA2B;;uCAoCe;eAAnCgB;;;eAnCPf,wCAA2B;;;eAC3BC,0CAA6B;;IAC7BC,uBAAuB;;;IAlBvBT;uDAA2B;;;eAC3BC,0CAA6B;;;eAC7BC,oCAAuB;;;6BAClB,mBAAgB;6BAgBhB,mBAAgB;2BAehB,iBAAc;6BAed,mBAAgB;6BAE6B,4BAAyB"}
@@ -1,6 +1,4 @@
1
- /**
2
- * State used in rendering ColorPicker
3
- */ "use strict";
1
+ "use strict";
4
2
  Object.defineProperty(exports, "__esModule", {
5
3
  value: true
6
4
  });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/color.ts"],"sourcesContent":["export type HsvColor = {\n h: number;\n s: number;\n v: number;\n a?: number;\n};\n\nexport type HslColor = {\n h: number;\n s: number;\n l: number;\n a?: number;\n};\n"],"names":[],"mappings":""}
@@ -16,7 +16,7 @@ _export(exports, {
16
16
  return clampValue;
17
17
  }
18
18
  });
19
- const _constants = require("./constants");
19
+ const _constants = require("./constants.cjs");
20
20
  const _reactutilities = require("@fluentui/react-utilities");
21
21
  function clampValue(value, channel = 'hue') {
22
22
  const MAX = channel === 'hue' ? _constants.HUE_MAX : _constants.MAX;
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/adjustChannel.ts"],"sourcesContent":["import type { ColorChannel } from '../components/ColorSlider/ColorSlider.types';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from './constants';\nimport { clamp } from '@fluentui/react-utilities';\n\n/**\n * Clamps a given value to the valid range for a specified color channel.\n *\n * @param value - The numeric value to be clamped.\n * @param channel - The color channel to use for clamping. Defaults to 'hue'.\n * @returns The clamped value within the range defined by the color channel.\n */\nexport function clampValue(value: number, channel: ColorChannel = 'hue'): number {\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n return clamp(value, MIN, MAX);\n}\n\nexport type ChannelActions<T> = {\n hue: T;\n saturation: T;\n value: T;\n};\n\n/**\n * Adjusts the specified color channel using the provided actions.\n *\n * @template T - The type of the result returned by the actions.\n * @param {ColorChannel} channel - The color channel to adjust.\n * @param {ChannelActions<T>} actions - An object containing actions for each color channel.\n * @returns {T} - The result of the action corresponding to the specified channel, or the hue action if the channel is not found.\n */\nexport function adjustChannel<T>(channel: ColorChannel, actions: ChannelActions<T>): T {\n return actions[channel] || actions.hue;\n}\n"],"names":["MIN","HUE_MAX","MAX","COLOR_MAX","clamp","clampValue","value","channel","adjustChannel","actions","hue"],"mappings":";;;;;;;;;;;iBA8BgBQ;;;cAnBAH;;;;2BAV+B,cAAc;gCACvC,4BAA4B;AAS3C,SAASA,WAAWC,KAAa,EAAEC,UAAwB,KAAK;IACrE,MAAML,MAAMK,YAAY,QAAQN,kBAAAA,GAAUE,cAAAA;IAC1C,WAAOC,qBAAAA,EAAME,OAAON,cAAAA,EAAKE;AAC3B;AAgBO,SAASM,cAAiBD,OAAqB,EAAEE,OAA0B;IAChF,OAAOA,OAAO,CAACF,QAAQ,IAAIE,QAAQC,GAAG;AACxC"}
1
+ {"version":3,"sources":["../src/utils/adjustChannel.ts"],"sourcesContent":["import type { ColorChannel } from '../components/ColorSlider/ColorSlider.types';\nimport { MIN, HUE_MAX, MAX as COLOR_MAX } from './constants';\nimport { clamp } from '@fluentui/react-utilities';\n\n/**\n * Clamps a given value to the valid range for a specified color channel.\n *\n * @param value - The numeric value to be clamped.\n * @param channel - The color channel to use for clamping. Defaults to 'hue'.\n * @returns The clamped value within the range defined by the color channel.\n */\nexport function clampValue(value: number, channel: ColorChannel = 'hue'): number {\n const MAX = channel === 'hue' ? HUE_MAX : COLOR_MAX;\n return clamp(value, MIN, MAX);\n}\n\nexport type ChannelActions<T> = {\n hue: T;\n saturation: T;\n value: T;\n};\n\n/**\n * Adjusts the specified color channel using the provided actions.\n *\n * @template T - The type of the result returned by the actions.\n * @param {ColorChannel} channel - The color channel to adjust.\n * @param {ChannelActions<T>} actions - An object containing actions for each color channel.\n * @returns {T} - The result of the action corresponding to the specified channel, or the hue action if the channel is not found.\n */\nexport function adjustChannel<T>(channel: ColorChannel, actions: ChannelActions<T>): T {\n return actions[channel] || actions.hue;\n}\n"],"names":["MIN","HUE_MAX","MAX","COLOR_MAX","clamp","clampValue","value","channel","adjustChannel","actions","hue"],"mappings":";;;;;;;;;;;iBA8BgBQ;;;cAnBAH;;;;2BAV+B,iBAAc;gCACvC,4BAA4B;AAS3C,SAASA,WAAWC,KAAa,EAAEC,UAAwB,KAAK;IACrE,MAAML,MAAMK,YAAY,QAAQN,kBAAAA,GAAUE,cAAAA;IAC1C,WAAOC,qBAAAA,EAAME,OAAON,cAAAA,EAAKE;AAC3B;AAgBO,SAASM,cAAiBD,OAAqB,EAAEE,OAA0B;IAChF,OAAOA,OAAO,CAACF,QAAQ,IAAIE,QAAQC,GAAG;AACxC"}
@@ -25,9 +25,13 @@ _export(exports, {
25
25
  return MIN;
26
26
  }
27
27
  });
28
- const _tinycolor = require("@ctrl/tinycolor");
29
28
  const MIN = 0;
30
29
  const MAX = 100;
31
30
  const HUE_MAX = 360;
32
31
  const INITIAL_COLOR = '#FFF';
33
- const INITIAL_COLOR_HSV = (0, _tinycolor.tinycolor)(INITIAL_COLOR).toHsv();
32
+ const INITIAL_COLOR_HSV = {
33
+ h: 0,
34
+ s: 0,
35
+ v: 1,
36
+ a: 1
37
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/constants.ts"],"sourcesContent":["export const MIN = 0;\nexport const MAX = 100;\nexport const HUE_MAX = 360;\nexport const INITIAL_COLOR = '#FFF';\nexport const INITIAL_COLOR_HSV = { h: 0, s: 0, v: 1, a: 1 };\n"],"names":["MIN","MAX","HUE_MAX","INITIAL_COLOR","INITIAL_COLOR_HSV","h","s","v","a"],"mappings":";;;;;;;;;;;WAEaE;;;iBACAC;;;qBACAC;;;OAHAH;;;OADAD;;;;AAAN,MAAMA,MAAM,EAAE;AACd,MAAMC,MAAM,IAAI;AAChB,MAAMC,UAAU,IAAI;AACpB,MAAMC,gBAAgB,OAAO;AAC7B,MAAMC,oBAAoB;IAAEC,GAAG;IAAGC,GAAG;IAAGC,GAAG;IAAGC,GAAG;AAAE,EAAE"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ *
3
+ * Creates an HSL color object from a given HSV color object.
4
+ *
5
+ * @param color - HSV color object to convert to HSL.
6
+ * @returns HSL color object with the same hue and alpha values, and converted saturation and lightness values.
7
+ */ "use strict";
8
+ Object.defineProperty(exports, "__esModule", {
9
+ value: true
10
+ });
11
+ function _export(target, all) {
12
+ for(var name in all)Object.defineProperty(target, name, {
13
+ enumerable: true,
14
+ get: all[name]
15
+ });
16
+ }
17
+ _export(exports, {
18
+ createHslColor: function() {
19
+ return createHslColor;
20
+ },
21
+ createHslColorString: function() {
22
+ return createHslColorString;
23
+ }
24
+ });
25
+ function createHslColor(color = {}) {
26
+ const { h = 0, s = 0, v = 0, a = 1 } = color;
27
+ const l = v * (1 - s / 2);
28
+ const hslSaturation = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);
29
+ return {
30
+ h,
31
+ s: hslSaturation,
32
+ l,
33
+ a
34
+ };
35
+ }
36
+ function createHslColorString(color = {}) {
37
+ const hslColor = createHslColor(color);
38
+ const saturation = Number((hslColor.s * 100).toFixed(2));
39
+ const lightness = Number((hslColor.l * 100).toFixed(2));
40
+ return `hsla(${hslColor.h}, ${saturation}%, ${lightness}%, ${hslColor.a})`;
41
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/createHslColor.ts"],"sourcesContent":["import type { HslColor, HsvColor } from '../types/color';\n\n/**\n *\n * Creates an HSL color object from a given HSV color object.\n *\n * @param color - HSV color object to convert to HSL.\n * @returns HSL color object with the same hue and alpha values, and converted saturation and lightness values.\n */\nexport function createHslColor(color: Partial<HsvColor> = {}): HslColor {\n const { h = 0, s = 0, v = 0, a = 1 } = color;\n const l = v * (1 - s / 2);\n const hslSaturation = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);\n\n return { h, s: hslSaturation, l, a };\n}\n\n/**\n * Creates an HSL color string from a given HSV color object.\n *\n * @param color - HSV color object to convert to HSL string.\n * @returns - HSL color string in the format of \"hsla(h, s%, l%, a)\".\n */\nexport function createHslColorString(color: Partial<HsvColor> = {}): string {\n const hslColor = createHslColor(color);\n const saturation = Number((hslColor.s * 100).toFixed(2));\n const lightness = Number((hslColor.l * 100).toFixed(2));\n\n return `hsla(${hslColor.h}, ${saturation}%, ${lightness}%, ${hslColor.a})`;\n}\n"],"names":["createHslColor","color","h","s","v","a","l","hslSaturation","Math","min","createHslColorString","hslColor","saturation","Number","toFixed","lightness"],"mappings":"AAEA;;;;;;CAMC,GACD;;;;;;;;;;;kBAAgBA;;;IAcAU,oBAAAA;;;;AAdT,SAASV,eAAeC,QAA2B,CAAC,CAAC;IAC1D,MAAM,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAE,GAAGJ;IACvC,MAAMK,IAAIF,IAAK,KAAID,KAAI,CAAA;IACvB,MAAMI,gBAAgBD,MAAM,KAAKA,MAAM,IAAI,IAAKF,CAAAA,KAAIE,CAAAA,GAAKE,KAAKC,GAAG,CAACH,GAAG,IAAIA;IAEzE,OAAO;QAAEJ;QAAGC,GAAGI;QAAeD;QAAGD;IAAE;AACrC;AAQO,8BAA8BJ,QAA2B,CAAC,CAAC;IAChE,MAAMU,WAAWX,eAAeC;IAChC,MAAMW,aAAaC,OAAQF,CAAAA,SAASR,CAAC,GAAG,GAAA,CAAE,CAAGW,OAAO,CAAC;IACrD,MAAMC,YAAYF,OAAQF,CAAAA,SAASL,CAAC,GAAG,GAAA,CAAE,CAAGQ,OAAO,CAAC;IAEpD,OAAO,CAAC,KAAK,EAAEH,SAAST,CAAC,CAAC,EAAE,EAAEU,WAAW,GAAG,EAAEG,UAAU,GAAG,EAAEJ,SAASN,CAAC,CAAC,CAAC,CAAC;AAC5E"}
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@fluentui/react-color-picker",
3
- "version": "9.2.19",
3
+ "version": "9.3.0",
4
4
  "description": "ColorPicker component for Fluent UI React.",
5
- "main": "lib-commonjs/index.js",
5
+ "main": "lib-commonjs/index.cjs",
6
6
  "module": "lib/index.js",
7
7
  "typings": "./dist/index.d.ts",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "*.md",
11
11
  "dist/*.d.ts",
12
+ "dist/*.d.cts",
12
13
  "lib",
13
14
  "lib-commonjs"
14
15
  ],
@@ -18,13 +19,12 @@
18
19
  },
19
20
  "license": "MIT",
20
21
  "dependencies": {
21
- "@ctrl/tinycolor": "^3.3.4",
22
- "@fluentui/react-context-selector": "^9.2.18",
23
- "@fluentui/react-jsx-runtime": "^9.4.4",
24
- "@fluentui/react-shared-contexts": "^9.26.2",
25
- "@fluentui/react-tabster": "^9.26.16",
26
- "@fluentui/react-theme": "^9.2.1",
27
- "@fluentui/react-utilities": "^9.26.5",
22
+ "@fluentui/react-context-selector": "^9.2.19",
23
+ "@fluentui/react-jsx-runtime": "^9.4.5",
24
+ "@fluentui/react-shared-contexts": "^9.26.3",
25
+ "@fluentui/react-tabster": "^9.26.17",
26
+ "@fluentui/react-theme": "^9.2.2",
27
+ "@fluentui/react-utilities": "^9.26.6",
28
28
  "@griffel/react": "^1.5.32",
29
29
  "@swc/helpers": "^0.5.1"
30
30
  },
@@ -36,10 +36,14 @@
36
36
  },
37
37
  "exports": {
38
38
  ".": {
39
- "types": "./dist/index.d.ts",
40
- "node": "./lib-commonjs/index.js",
41
- "import": "./lib/index.js",
42
- "require": "./lib-commonjs/index.js"
39
+ "import": {
40
+ "types": "./dist/index.d.ts",
41
+ "default": "./lib/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/index.d.cts",
45
+ "default": "./lib-commonjs/index.cjs"
46
+ }
43
47
  },
44
48
  "./package.json": "./package.json"
45
49
  },
@@ -48,5 +52,6 @@
48
52
  "major",
49
53
  "prerelease"
50
54
  ]
51
- }
55
+ },
56
+ "type": "module"
52
57
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/AlphaSlider.ts"],"sourcesContent":["export type { AlphaSliderProps, AlphaSliderSlots, AlphaSliderState } from './components/AlphaSlider/index';\nexport {\n AlphaSlider,\n alphaSliderCSSVars,\n alphaSliderClassNames,\n renderAlphaSlider_unstable,\n useAlphaSliderStyles_unstable,\n useAlphaSlider_unstable,\n} from './components/AlphaSlider/index';\n"],"names":["AlphaSlider","alphaSliderCSSVars","alphaSliderClassNames","renderAlphaSlider_unstable","useAlphaSliderStyles_unstable","useAlphaSlider_unstable"],"mappings":";;;;;;;;;;;;eAEEA,kBAAW;;;eACXC,yBAAkB;;;eAClBC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,iCAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ColorArea.ts"],"sourcesContent":["export type {\n ColorAreaOnColorChangeData,\n ColorAreaProps,\n ColorAreaSlots,\n ColorAreaState,\n} from './components/ColorArea/index';\nexport {\n ColorArea,\n colorAreaCSSVars,\n colorAreaClassNames,\n renderColorArea_unstable,\n useColorAreaStyles_unstable,\n useColorArea_unstable,\n} from './components/ColorArea/index';\n"],"names":["ColorArea","colorAreaCSSVars","colorAreaClassNames","renderColorArea_unstable","useColorAreaStyles_unstable","useColorArea_unstable"],"mappings":";;;;;;;;;;;;eAOEA,gBAAS;;;eACTC,uBAAgB;;;eAChBC,0BAAmB;;;eACnBC,+BAAwB;;;eACxBC,kCAA2B;;;eAC3BC,4BAAqB;;;uBAChB,+BAA+B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ColorPicker.ts"],"sourcesContent":["export type {\n ColorPickerOnChangeData,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './components/ColorPicker/index';\nexport {\n ColorPicker,\n colorPickerClassNames,\n renderColorPicker_unstable,\n useColorPickerStyles_unstable,\n useColorPicker_unstable,\n} from './components/ColorPicker/index';\n"],"names":["ColorPicker","colorPickerClassNames","renderColorPicker_unstable","useColorPickerStyles_unstable","useColorPicker_unstable"],"mappings":";;;;;;;;;;;;eAOEA,kBAAW;;;eACXC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,iCAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/ColorSlider.ts"],"sourcesContent":["export type {\n ColorSliderProps,\n ColorSliderSlots,\n ColorSliderState,\n SliderOnChangeData,\n} from './components/ColorSlider/index';\nexport {\n ColorSlider,\n colorSliderCSSVars,\n colorSliderClassNames,\n renderColorSlider_unstable,\n useColorSliderStyles_unstable,\n useColorSlider_unstable,\n} from './components/ColorSlider/index';\n"],"names":["ColorSlider","colorSliderCSSVars","colorSliderClassNames","renderColorSlider_unstable","useColorSliderStyles_unstable","useColorSlider_unstable"],"mappings":";;;;;;;;;;;;eAOEA,kBAAW;;;eACXC,yBAAkB;;;eAClBC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,iCAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/AlphaSlider/index.ts"],"sourcesContent":["export { AlphaSlider } from './AlphaSlider';\nexport type { AlphaSliderProps, AlphaSliderSlots, AlphaSliderState } from './AlphaSlider.types';\nexport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nexport { useAlphaSlider_unstable } from './useAlphaSlider';\nexport {\n alphaSliderCSSVars,\n alphaSliderClassNames,\n useAlphaSliderStyles_unstable,\n} from './useAlphaSliderStyles.styles';\n"],"names":["AlphaSlider","renderAlphaSlider_unstable","useAlphaSlider_unstable","alphaSliderCSSVars","alphaSliderClassNames","useAlphaSliderStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,wBAAW;;;eAKlBG,8CAAkB;;;eAClBC,iDAAqB;;;eAJdH,6CAA0B;;;eAKjCI,yDAA6B;;;eAJtBH,uCAAuB;;;6BAHJ,gBAAgB;mCAED,sBAAsB;gCACzB,mBAAmB;4CAKpD,gCAAgC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/AlphaSlider/renderAlphaSlider.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { AlphaSliderState, AlphaSliderSlots } from './AlphaSlider.types';\n\n/**\n * Render the final JSX of AlphaSlider\n */\nexport const renderAlphaSlider_unstable = (state: AlphaSliderState): JSXElement => {\n assertSlots<AlphaSliderSlots>(state);\n\n return (\n <state.root>\n <state.input />\n <state.rail />\n <state.thumb />\n </state.root>\n );\n};\n"],"names":["assertSlots","renderAlphaSlider_unstable","state","root","input","rail","thumb"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,mCAAmC,CAACC;QACzCF,2BAAAA,EAA8BE;IAE9B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;8BACT,eAAA,EAACD,MAAME,KAAK,EAAA,CAAA;8BACZ,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;8BACX,eAAA,EAACH,MAAMI,KAAK,EAAA,CAAA;;;AAGlB,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/AlphaSlider/useAlphaSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getPartitionedNativeProps, useId, slot } from '@fluentui/react-utilities';\nimport type { AlphaSliderProps, AlphaSliderState } from './AlphaSlider.types';\nimport { useAlphaSliderState_unstable } from './useAlphaSliderState';\nimport { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';\n\n/**\n * Create the state required to render AlphaSlider.\n *\n * The returned state can be modified with hooks such as useAlphaSliderStyles_unstable,\n * before being passed to renderAlphaSlider_unstable.\n *\n * @param props - props from this instance of AlphaSlider\n * @param ref - reference to root HTMLInputElement of AlphaSlider\n */\nexport const useAlphaSlider_unstable = (\n props: AlphaSliderProps,\n ref: React.Ref<HTMLInputElement>,\n): AlphaSliderState => {\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 shape = shapeFromContext,\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: AlphaSliderState = {\n shape,\n vertical,\n components: {\n input: 'input',\n rail: 'div',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(root, {\n defaultProps: nativeProps.root,\n elementType: 'div',\n }),\n input: slot.always(input, {\n defaultProps: {\n id: useId('slider-', props.id),\n ref,\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 useAlphaSliderState_unstable(state, props);\n\n return state;\n};\n"],"names":["getPartitionedNativeProps","useId","slot","useAlphaSliderState_unstable","useColorPickerContextValue_unstable","useAlphaSlider_unstable","props","ref","shapeFromContext","ctx","shape","nativeProps","primarySlotTagName","excludedPropNames","vertical","root","input","rail","thumb","state","components","always","defaultProps","elementType","id","primary","type"],"mappings":"AAAA;;;;;+BAiBaK;;;;;;gCAd0C,4BAA4B;qCAEtC,wBAAwB;6BACjB,6BAA6B;AAW1E,gCAAgC,CACrCC,OACAC;IAEA,MAAMC,uBAAmBJ,gDAAAA,EAAoCK,CAAAA,MAAOA,IAAIC,KAAK;IAC7E,MAAMC,kBAAcX,yCAAAA,EAA0B;QAC5CM;QACAM,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;SAAQ;IAC1C;IAEA,MAAM,EACJH,QAAQF,gBAAgB,EACxBM,QAAQ,EAERC,AADA,IACI,EACJC,EAFQ,GAEH,EACLC,IAAI,EACJC,KAAK,EACN,GAAGZ;IAEJ,MAAMa,QAA0B;QAC9BT;QACAI;QACAM,YAAY;YACVJ,OAAO;YACPC,MAAM;YACNF,MAAM;YACNG,OAAO;QACT;QACAH,MAAMb,oBAAAA,CAAKmB,MAAM,CAACN,MAAM;YACtBO,cAAcX,YAAYI,IAAI;YAC9BQ,aAAa;QACf;QACAP,OAAOd,oBAAAA,CAAKmB,MAAM,CAACL,OAAO;YACxBM,cAAc;gBACZE,QAAIvB,qBAAAA,EAAM,WAAWK,MAAMkB,EAAE;gBAC7BjB;gBACA,GAAGI,YAAYc,OAAO;gBACtBC,MAAM;YACR;YACAH,aAAa;QACf;QACAN,MAAMf,oBAAAA,CAAKmB,MAAM,CAACJ,MAAM;YAAEM,aAAa;QAAM;QAC7CL,OAAOhB,oBAAAA,CAAKmB,MAAM,CAACH,OAAO;YAAEK,aAAa;QAAM;IACjD;QAEApB,iDAAAA,EAA6BgB,OAAOb;IAEpC,OAAOa;AACT,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/AlphaSlider/useAlphaSliderState.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { tinycolor } from '@ctrl/tinycolor';\nimport { clamp, useControllableState, useEventCallback } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { alphaSliderCSSVars } from './useAlphaSliderStyles.styles';\nimport type { AlphaSliderState, AlphaSliderProps } from './AlphaSlider.types';\nimport { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';\nimport { MIN, MAX } from '../../utils/constants';\nimport { getPercent } from '../../utils/getPercent';\nimport { adjustToTransparency, calculateTransparencyValue, getSliderDirection } from './alphaSliderUtils';\nimport { createHsvColor } from '../../utils/createHsvColor';\n\nexport const useAlphaSliderState_unstable = (state: AlphaSliderState, props: AlphaSliderProps): AlphaSliderState => {\n const { dir } = useFluent();\n const onChangeFromContext = useColorPickerContextValue_unstable(ctx => ctx.requestChange);\n const colorFromContext = useColorPickerContextValue_unstable(ctx => ctx.color);\n const { color, onChange = onChangeFromContext, transparency = false, vertical = false } = props;\n const hsvColor = color || colorFromContext;\n const hslColor = tinycolor(hsvColor).toHsl();\n\n const [currentValue, setCurrentValue] = useControllableState({\n defaultState: calculateTransparencyValue(transparency, props.defaultColor?.a),\n state: calculateTransparencyValue(transparency, hsvColor?.a),\n initialState: adjustToTransparency(100, transparency),\n });\n\n const clampedValue = clamp(currentValue, MIN, MAX);\n const valuePercent = getPercent(clampedValue, MIN, MAX);\n\n const inputOnChange = state.input.onChange;\n\n const _onChange: React.ChangeEventHandler<HTMLInputElement> = useEventCallback(event => {\n const newValue = adjustToTransparency(Number(event.target.value), transparency);\n const newColor = createHsvColor({ ...hsvColor, a: newValue / 100 });\n setCurrentValue(newValue);\n inputOnChange?.(event);\n onChange?.(event, { type: 'change', event, color: newColor });\n });\n\n const sliderDirection = getSliderDirection(dir, vertical, transparency);\n\n const rootVariables = {\n [alphaSliderCSSVars.sliderDirectionVar]: sliderDirection,\n [alphaSliderCSSVars.sliderProgressVar]: `${valuePercent}%`,\n [alphaSliderCSSVars.thumbColorVar]: `hsla(${hslColor.h} ${hslColor.s * 100}%, ${hslColor.l * 100}%, ${hslColor.a})`,\n [alphaSliderCSSVars.railColorVar]: `hsl(${hslColor.h} ${hslColor.s * 100}%, ${hslColor.l * 100}%)`,\n };\n\n // Root props\n // eslint-disable-next-line react-hooks/immutability\n state.root.style = {\n ...rootVariables,\n ...state.root.style,\n };\n\n // Input Props\n // eslint-disable-next-line react-hooks/immutability\n state.input.value = clampedValue;\n // eslint-disable-next-line react-hooks/immutability\n state.input.onChange = _onChange;\n\n return state;\n};\n"],"names":["tinycolor","clamp","useControllableState","useEventCallback","useFluent_unstable","useFluent","alphaSliderCSSVars","useColorPickerContextValue_unstable","MIN","MAX","getPercent","adjustToTransparency","calculateTransparencyValue","getSliderDirection","createHsvColor","useAlphaSliderState_unstable","state","props","dir","onChangeFromContext","ctx","requestChange","colorFromContext","color","onChange","transparency","vertical","hsvColor","hslColor","toHsl","currentValue","setCurrentValue","defaultState","defaultColor","a","initialState","clampedValue","valuePercent","inputOnChange","input","_onChange","event","newValue","Number","target","value","newColor","type","sliderDirection","rootVariables","sliderDirectionVar","sliderProgressVar","thumbColorVar","h","s","l","railColorVar","root","style"],"mappings":"AAAA;;;;;+BAcae;;;;;;2BAXa,kBAAkB;gCACkB,4BAA4B;qCAC1C,kCAAkC;4CAC/C,gCAAgC;6BAEf,6BAA6B;2BACxD,wBAAwB;4BACtB,yBAAyB;kCACiC,qBAAqB;gCAC3E,6BAA6B;AAErD,qCAAqC,CAACC,OAAyBC;QASXA;IARzD,MAAM,EAAEC,GAAG,EAAE,OAAGb,uCAAAA;IAChB,MAAMc,0BAAsBZ,gDAAAA,EAAoCa,CAAAA,MAAOA,IAAIC,aAAa;IACxF,MAAMC,uBAAmBf,gDAAAA,EAAoCa,CAAAA,MAAOA,IAAIG,KAAK;IAC7E,MAAM,EAAEA,KAAK,EAAEC,WAAWL,mBAAmB,EAAEM,eAAe,KAAK,EAAEC,WAAW,KAAK,EAAE,GAAGT;IAC1F,MAAMU,WAAWJ,SAASD;IAC1B,MAAMM,eAAW5B,oBAAAA,EAAU2B,UAAUE,KAAK;IAE1C,MAAM,CAACC,cAAcC,gBAAgB,GAAG7B,wCAAAA,EAAqB;QAC3D8B,kBAAcpB,4CAAAA,EAA2Ba,cAAAA,CAAcR,sBAAAA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2B,CAAC,GAAG,IAAI,GAAG,EAAE3B,SAASM,CAAC,CAAC,CAAC,CAAC;QACnH,CAAC5B,8CAAAA,CAAmBkD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE5B,SAASyB,CAAC,CAAC,CAAC,EAAEzB,SAAS0B,CAAC,GAAG,IAAI,GAAG,EAAE1B,SAAS2B,CAAC,GAAG,IAAI,EAAE,CAAC;IACpG;IAEA,aAAa;IACb,oDAAoD;IACpDvC,MAAMyC,IAAI,CAACC,KAAK,GAAG;QACjB,GAAGT,aAAa;QAChB,GAAGjC,MAAMyC,IAAI,CAACC,KAAK;IACrB;IAEA,cAAc;IACd,oDAAoD;IACpD1C,MAAMuB,KAAK,CAACM,KAAK,GAAGT;IACpB,oDAAoD;IACpDpB,MAAMuB,KAAK,CAACf,QAAQ,GAAGgB;IAEvB,OAAOxB;AACT,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useAlphaSliderStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { useColorSliderStyles_unstable } from '../ColorSlider/useColorSliderStyles.styles';\nconst TRANSPARENT_IMAGE_URL = 'https://fabricweb.azureedge.net/fabric-website/assets/images/transparent-pattern.png';\nexport const alphaSliderClassNames = {\n root: 'fui-AlphaSlider',\n rail: 'fui-AlphaSlider__rail',\n thumb: 'fui-AlphaSlider__thumb',\n input: 'fui-AlphaSlider__input'\n};\nexport const alphaSliderCSSVars = {\n sliderDirectionVar: `--fui-AlphaSlider--direction`,\n sliderProgressVar: `--fui-AlphaSlider--progress`,\n thumbColorVar: `--fui-AlphaSlider__thumb--color`,\n railColorVar: `--fui-AlphaSlider__rail--color`\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n rail: {\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n backgroundImage: `linear-gradient(var(${alphaSliderCSSVars.sliderDirectionVar}), transparent, var(${alphaSliderCSSVars.railColorVar})), url(${TRANSPARENT_IMAGE_URL})`\n }\n});\n/**\n * Styles for the thumb slot\n */ const useThumbStyles = makeStyles({\n thumb: {\n backgroundColor: tokens.colorNeutralBackground1,\n '::before': {\n backgroundColor: `var(${alphaSliderCSSVars.thumbColorVar})`\n }\n },\n horizontal: {\n transform: 'translateX(-50%)',\n left: `var(${alphaSliderCSSVars.sliderProgressVar})`\n },\n vertical: {\n transform: 'translateY(50%)',\n bottom: `var(${alphaSliderCSSVars.sliderProgressVar})`\n }\n});\n/**\n * Apply styling to the AlphaSlider slots based on the state\n */ export const useAlphaSliderStyles_unstable = (state)=>{\n const styles = useStyles();\n const thumbStyles = useThumbStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(alphaSliderClassNames.root, state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(alphaSliderClassNames.input, state.input.className);\n // eslint-disable-next-line react-hooks/immutability\n state.rail.className = mergeClasses(alphaSliderClassNames.rail, styles.rail, state.rail.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(alphaSliderClassNames.thumb, thumbStyles.thumb, state.vertical ? thumbStyles.vertical : thumbStyles.horizontal, state.thumb.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(alphaSliderClassNames.thumb, thumbStyles.thumb, state.vertical ? thumbStyles.vertical : thumbStyles.horizontal, state.thumb.className);\n useColorSliderStyles_unstable(state);\n return state;\n};\n"],"names":["__styles","mergeClasses","tokens","useColorSliderStyles_unstable","TRANSPARENT_IMAGE_URL","alphaSliderClassNames","root","rail","thumb","input","alphaSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","useStyles","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Bcmaq0h","d","p","useThumbStyles","De3pz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CAACvC,KAAK,EAAEqC,KAAK,CAACH,QAAQ,GAAGK,WAAW,CAACL,QAAQ,GAAGK,WAAW,CAACR,UAAU,EAAEM,KAAK,CAACrC,KAAK,CAACwC,SAAS,CAAC;QAC3K7C,yDAA6B,EAAC0C,KAAK,CAAC;IACpC,OAAOA,KAAK;AAChB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/AlphaSlider/useAlphaSliderStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { useColorSliderStyles_unstable } from '../ColorSlider/useColorSliderStyles.styles';\nimport type { AlphaSliderSlots, AlphaSliderState } from './AlphaSlider.types';\n\nconst TRANSPARENT_IMAGE_URL = 'https://fabricweb.azureedge.net/fabric-website/assets/images/transparent-pattern.png';\n\nexport const alphaSliderClassNames: SlotClassNames<AlphaSliderSlots> = {\n root: 'fui-AlphaSlider',\n rail: 'fui-AlphaSlider__rail',\n thumb: 'fui-AlphaSlider__thumb',\n input: 'fui-AlphaSlider__input',\n};\n\nexport const alphaSliderCSSVars = {\n sliderDirectionVar: `--fui-AlphaSlider--direction`,\n sliderProgressVar: `--fui-AlphaSlider--progress`,\n thumbColorVar: `--fui-AlphaSlider__thumb--color`,\n railColorVar: `--fui-AlphaSlider__rail--color`,\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n rail: {\n border: `1px solid ${tokens.colorNeutralStroke1}`,\n backgroundImage: `linear-gradient(var(${alphaSliderCSSVars.sliderDirectionVar}), transparent, var(${alphaSliderCSSVars.railColorVar})), url(${TRANSPARENT_IMAGE_URL})`,\n },\n});\n\n/**\n * Styles for the thumb slot\n */\nconst useThumbStyles = makeStyles({\n thumb: {\n backgroundColor: tokens.colorNeutralBackground1,\n '::before': {\n backgroundColor: `var(${alphaSliderCSSVars.thumbColorVar})`,\n },\n },\n horizontal: {\n transform: 'translateX(-50%)',\n left: `var(${alphaSliderCSSVars.sliderProgressVar})`,\n },\n vertical: {\n transform: 'translateY(50%)',\n bottom: `var(${alphaSliderCSSVars.sliderProgressVar})`,\n },\n});\n\n/**\n * Apply styling to the AlphaSlider slots based on the state\n */\nexport const useAlphaSliderStyles_unstable = (state: AlphaSliderState): AlphaSliderState => {\n const styles = useStyles();\n const thumbStyles = useThumbStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(alphaSliderClassNames.root, state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(alphaSliderClassNames.input, state.input.className);\n // eslint-disable-next-line react-hooks/immutability\n state.rail.className = mergeClasses(alphaSliderClassNames.rail, styles.rail, state.rail.className);\n\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(\n alphaSliderClassNames.thumb,\n thumbStyles.thumb,\n state.vertical ? thumbStyles.vertical : thumbStyles.horizontal,\n state.thumb.className,\n );\n\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(\n alphaSliderClassNames.thumb,\n thumbStyles.thumb,\n state.vertical ? thumbStyles.vertical : thumbStyles.horizontal,\n state.thumb.className,\n );\n\n useColorSliderStyles_unstable(state);\n return state;\n};\n"],"names":["makeStyles","mergeClasses","tokens","useColorSliderStyles_unstable","TRANSPARENT_IMAGE_URL","alphaSliderClassNames","root","rail","thumb","input","alphaSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","useStyles","border","colorNeutralStroke1","backgroundImage","useThumbStyles","backgroundColor","colorNeutralBackground1","horizontal","transform","left","vertical","bottom","useAlphaSliderStyles_unstable","state","styles","thumbStyles","className"],"mappings":"AAAA;;;;;;;;;;;;sBAiBaU;;;yBAPAL;;;iCA+CAsB;;;;uBAvD4B,iBAAiB;4BACnC,wBAAwB;4CAED,6CAA6C;AAG3F,MAAMvB,wBAAwB;AAEvB,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MA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I,CAACwB,SAAS,OAAG9B,mBAAAA,EAAaI,sBAAsBE,IAAI,EAAEsB,OAAOtB,IAAI,EAAEqB,MAAMrB,IAAI,CAACwB,SAAS;IAEjG,oDAAoD;IACpDH,MAAMpB,KAAK,CAACuB,SAAS,OAAG9B,mBAAAA,EACtBI,sBAAsBG,KAAK,EAC3BsB,YAAYtB,KAAK,EACjBoB,MAAMH,QAAQ,GAAGK,YAAYL,QAAQ,GAAGK,YAAYR,UAAU,EAC9DM,MAAMpB,KAAK,CAACuB,SAAS;IAGvB,oDAAoD;IACpDH,MAAMpB,KAAK,CAACuB,SAAS,OAAG9B,mBAAAA,EACtBI,sBAAsBG,KAAK,EAC3BsB,YAAYtB,KAAK,EACjBoB,MAAMH,QAAQ,GAAGK,YAAYL,QAAQ,GAAGK,YAAYR,UAAU,EAC9DM,MAAMpB,KAAK,CAACuB,SAAS;QAGvB5B,yDAAAA,EAA8ByB;IAC9B,OAAOA;AACT,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ColorArea/index.ts"],"sourcesContent":["export { ColorArea } from './ColorArea';\nexport type { ColorAreaOnColorChangeData, ColorAreaProps, ColorAreaSlots, ColorAreaState } from './ColorArea.types';\nexport { renderColorArea_unstable } from './renderColorArea';\nexport { useColorArea_unstable } from './useColorArea';\nexport { colorAreaCSSVars, colorAreaClassNames, useColorAreaStyles_unstable } from './useColorAreaStyles.styles';\n"],"names":["ColorArea","renderColorArea_unstable","useColorArea_unstable","colorAreaCSSVars","colorAreaClassNames","useColorAreaStyles_unstable"],"mappings":";;;;;;;;;;;;eAASA,oBAAS;;;eAITG,0CAAgB;;;eAAEC,6CAAmB;;;eAFrCH,yCAAwB;;;eAEeI,qDAA2B;;;eADlEH,mCAAqB;;;2BAHJ,cAAc;iCAEC,oBAAoB;8BACvB,iBAAiB;0CAC4B,8BAA8B"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ColorArea/renderColorArea.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 { ColorAreaState, ColorAreaSlots } from './ColorArea.types';\n\n/**\n * Render the final JSX of ColorArea\n */\nexport const renderColorArea_unstable = (state: ColorAreaState): JSXElement => {\n assertSlots<ColorAreaSlots>(state);\n\n return (\n <state.root>\n <state.thumb>\n <state.inputX />\n <state.inputY />\n </state.thumb>\n </state.root>\n );\n};\n"],"names":["assertSlots","renderColorArea_unstable","state","root","thumb","inputX","inputY"],"mappings":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,iCAAiC,CAACC;QACvCF,2BAAAA,EAA4BE;IAE5B,OAAA,WAAA,OACE,eAAA,EAACA,MAAMC,IAAI,EAAA;kBACT,WAAA,OAAA,gBAAA,EAACD,MAAME,KAAK,EAAA;;kCACV,eAAA,EAACF,MAAMG,MAAM,EAAA,CAAA;kCACb,eAAA,EAACH,MAAMI,MAAM,EAAA,CAAA;;;;AAIrB,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/ColorArea/useColorArea.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { tinycolor } from '@ctrl/tinycolor';\nimport { useId, slot, useMergedRefs, mergeCallbacks, getIntrinsicElementProps } from '@fluentui/react-utilities';\nimport type { ColorAreaProps, ColorAreaState } from './ColorArea.types';\nimport type { HsvColor } from '../../types/color';\nimport { colorAreaCSSVars } from './useColorAreaStyles.styles';\nimport { useEventCallback, useControllableState } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useFocusWithin } from '@fluentui/react-tabster';\nimport { INITIAL_COLOR_HSV } from '../../utils/constants';\nimport { getCoordinates } from '../../utils/getCoordinates';\nimport { useColorPickerContextValue_unstable } from '../../contexts/colorPicker';\n\n/**\n * Create the state required to render ColorArea.\n *\n * The returned state can be modified with hooks such as useColorAreaStyles_unstable,\n * before being passed to renderColorArea_unstable.\n *\n * @param props - props from this instance of ColorArea\n * @param ref - reference to root HTMLDivElement of ColorArea\n */\nexport const useColorArea_unstable = (props: ColorAreaProps, ref: React.Ref<HTMLDivElement>): ColorAreaState => {\n const { targetDocument } = useFluent();\n const rootRef = React.useRef<HTMLDivElement>(null);\n const xRef = React.useRef<HTMLInputElement>(null);\n const yRef = React.useRef<HTMLInputElement>(null);\n const focusWithinRef = useFocusWithin();\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\n const {\n onChange = onChangeFromContext as unknown as ColorAreaProps['onChange'],\n shape = shapeFromContext,\n // Slots\n inputX,\n inputY,\n thumb,\n color,\n ...rest\n } = props;\n\n const [hsvColor, setColor] = useControllableState<HsvColor>({\n defaultState: props.defaultColor,\n state: color || colorFromContext,\n initialState: INITIAL_COLOR_HSV,\n });\n const saturation = Math.round(hsvColor.s * 100);\n const value = Math.round(hsvColor.v * 100);\n\n const [activeAxis, setActiveAxis] = React.useState<'x' | 'y' | null>(null);\n\n const requestColorChange = useEventCallback((event: PointerEvent) => {\n if (!rootRef.current) {\n return;\n }\n\n const coordinates = getCoordinates(rootRef.current, event);\n const newColor: HsvColor = {\n ...hsvColor,\n s: coordinates.x,\n v: coordinates.y,\n };\n\n setColor(newColor);\n onChange?.(event, {\n type: 'change',\n event,\n color: newColor,\n });\n });\n\n const handleDocumentPointerMove = React.useCallback(\n (event: PointerEvent) => {\n requestColorChange(event);\n },\n [requestColorChange],\n );\n\n const handleDocumentPointerUp = useEventCallback(() => {\n targetDocument?.removeEventListener('pointermove', handleDocumentPointerMove);\n });\n\n const handleRootOnPointerDown: React.PointerEventHandler<HTMLDivElement> = useEventCallback(event => {\n event.stopPropagation();\n event.preventDefault();\n\n requestColorChange(event.nativeEvent);\n\n targetDocument?.addEventListener('pointermove', handleDocumentPointerMove);\n targetDocument?.addEventListener('pointerup', handleDocumentPointerUp, { once: true });\n });\n\n const handleInputOnChange: React.ChangeEventHandler<HTMLInputElement> = useEventCallback(event => {\n const targetValue = Number(event.target.value) / 100;\n const newColor: HsvColor = {\n ...hsvColor,\n ...(event.target === xRef.current && { s: targetValue }),\n ...(event.target === yRef.current && { v: targetValue }),\n };\n\n setColor(newColor);\n onChange?.(event, { type: 'change', event, color: newColor });\n });\n\n const handleRootOnKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n let deltaX = 0;\n let deltaY = 0;\n let axis: 'x' | 'y' = 'x';\n\n switch (event.key) {\n case 'ArrowUp':\n event.preventDefault();\n\n axis = 'y';\n deltaY = 1;\n\n break;\n case 'ArrowDown':\n event.preventDefault();\n\n axis = 'y';\n deltaY = -1;\n\n break;\n case 'ArrowLeft':\n event.preventDefault();\n\n axis = 'x';\n deltaX = -1;\n\n break;\n case 'ArrowRight':\n event.preventDefault();\n\n axis = 'x';\n deltaX = 1;\n\n break;\n }\n\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n\n const newColor: HsvColor = {\n ...hsvColor,\n s: Math.min(Math.max(hsvColor.s + deltaX / 100, 0), 1),\n v: Math.min(Math.max(hsvColor.v + deltaY / 100, 0), 1),\n };\n\n setColor(newColor);\n setActiveAxis(axis);\n\n onChange?.(event, { type: 'change', event, color: newColor });\n });\n\n const rootVariables = {\n [colorAreaCSSVars.areaXProgressVar]: `${saturation}%`,\n [colorAreaCSSVars.areaYProgressVar]: `${value}%`,\n [colorAreaCSSVars.thumbColorVar]: tinycolor(hsvColor).toRgbString(),\n [colorAreaCSSVars.mainColorVar]: `hsl(${hsvColor.h}, 100%, 50%)`,\n };\n const state: ColorAreaState = {\n shape,\n components: {\n inputX: 'input',\n inputY: 'input',\n root: 'div',\n thumb: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...rest,\n }),\n { elementType: 'div' },\n ),\n inputX: slot.always(inputX, {\n defaultProps: {\n id: useId('sliderX-'),\n type: 'range',\n ...(activeAxis && { tabIndex: activeAxis === 'x' ? 0 : -1 }),\n },\n elementType: 'input',\n }),\n inputY: slot.always(inputY, {\n defaultProps: {\n id: useId('sliderY-'),\n type: 'range',\n tabIndex: activeAxis && activeAxis === 'y' ? 0 : -1,\n },\n elementType: 'input',\n }),\n thumb: slot.always(thumb, { elementType: 'div' }),\n };\n\n state.root.ref = useMergedRefs(state.root.ref, rootRef);\n state.thumb.ref = useMergedRefs(state.thumb.ref, focusWithinRef);\n state.inputX.ref = useMergedRefs(state.inputX.ref, xRef);\n state.inputY.ref = useMergedRefs(state.inputY.ref, yRef);\n\n state.root.style = {\n ...state.root.style,\n ...rootVariables,\n };\n\n state.root.onPointerDown = useEventCallback(mergeCallbacks(state.root.onPointerDown, handleRootOnPointerDown));\n state.root.onKeyDown = useEventCallback(mergeCallbacks(state.root.onKeyDown, handleRootOnKeyDown));\n state.inputX.onChange = useEventCallback(mergeCallbacks(state.inputX.onChange, handleInputOnChange));\n state.inputY.onChange = useEventCallback(mergeCallbacks(state.inputY.onChange, handleInputOnChange));\n\n state.inputX.value = saturation;\n state.inputY.value = value;\n\n return state;\n};\n"],"names":["React","tinycolor","useId","slot","useMergedRefs","mergeCallbacks","getIntrinsicElementProps","colorAreaCSSVars","useEventCallback","useControllableState","useFluent_unstable","useFluent","useFocusWithin","INITIAL_COLOR_HSV","getCoordinates","useColorPickerContextValue_unstable","useColorArea_unstable","props","ref","targetDocument","rootRef","useRef","xRef","yRef","focusWithinRef","onChangeFromContext","ctx","requestChange","colorFromContext","color","shapeFromContext","shape","onChange","inputX","inputY","thumb","rest","hsvColor","setColor","defaultState","defaultColor","state","initialState","saturation","Math","round","s","value","v","activeAxis","setActiveAxis","useState","requestColorChange","event","current","coordinates","newColor","x","y","type","handleDocumentPointerMove","useCallback","handleDocumentPointerUp","removeEventListener","handleRootOnPointerDown","stopPropagation","preventDefault","nativeEvent","addEventListener","once","handleInputOnChange","targetValue","Number","target","handleRootOnKeyDown","deltaX","deltaY","axis","key","min","max","rootVariables","areaXProgressVar","areaYProgressVar","thumbColorVar","toRgbString","mainColorVar","h","components","root","always","elementType","defaultProps","id","tabIndex","style","onPointerDown","onKeyDown"],"mappings":"AAAA;;;;;+BAwBagB;;;;;;;iEAtBU,QAAQ;2BACL,kBAAkB;gCACyC,4BAA4B;0CAGhF,8BAA8B;qCAEf,kCAAkC;8BACnD,0BAA0B;2BACvB,wBAAwB;gCAC3B,6BAA6B;6BACR,6BAA6B;AAW1E,8BAA8B,CAACC,OAAuBC;IAC3D,MAAM,EAAEC,cAAc,EAAE,OAAGR,uCAAAA;IAC3B,MAAMS,UAAUpB,OAAMqB,MAAM,CAAiB;IAC7C,MAAMC,OAAOtB,OAAMqB,MAAM,CAAmB;IAC5C,MAAME,OAAOvB,OAAMqB,MAAM,CAAmB;IAC5C,MAAMG,qBAAiBZ,4BAAAA;IACvB,MAAMa,0BAAsBV,gDAAAA,EAAoCW,CAAAA,MAAOA,IAAIC,aAAa;IACxF,MAAMC,uBAAmBb,gDAAAA,EAAoCW,CAAAA,MAAOA,IAAIG,KAAK;IAC7E,MAAMC,uBAAmBf,gDAAAA,EAAoCW,CAAAA,MAAOA,IAAIK,KAAK;IAE7E,MAAM,EACJC,WAAWP,mBAA4D,EACvEM,QAAQD,gBAAgB,EACxB,AACAG,MAAM,EADE,AAERC,MAAM,EACNC,KAAK,EACLN,KAAK,EACL,GAAGO,MACJ,GAAGnB;IAEJ,MAAM,CAACoB,UAAUC,SAAS,OAAG7B,oCAAAA,EAA+B;QAC1D8B,cAActB,MAAMuB,YAAY;QAChCC,OAAOZ,SAASD;QAChBc,cAAc7B,4BAAAA;IAChB;IACA,MAAM8B,aAAaC,KAAKC,KAAK,CAACR,SAASS,CAAC,GAAG;IAC3C,MAAMC,QAAQH,KAAKC,KAAK,CAACR,SAASW,CAAC,GAAG;IAEtC,MAAM,CAACC,YAAY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GAAG,EAAEI;IACnDmB,MAAMP,MAAM,CAAChB,GAAG,OAAGd,6BAAAA,EAAcqC,MAAMP,MAAM,CAAChB,GAAG,EAAEK;IAEnDkB,MAAMgD,IAAI,CAACM,KAAK,GAAG;QACjB,GAAGtD,MAAMgD,IAAI,CAACM,KAAK;QACnB,GAAGd,aAAa;IAClB;IAEAxC,MAAMgD,IAAI,CAACO,aAAa,OAAGxF,gCAAAA,MAAiBH,8BAAAA,EAAeoC,MAAMgD,IAAI,CAACO,aAAa,EAAEhC;IACrFvB,MAAMgD,IAAI,CAACQ,SAAS,OAAGzF,gCAAAA,MAAiBH,8BAAAA,EAAeoC,MAAMgD,IAAI,CAACQ,SAAS,EAAEvB;IAC7EjC,MAAMR,MAAM,CAACD,QAAQ,OAAGxB,gCAAAA,MAAiBH,8BAAAA,EAAeoC,MAAMR,MAAM,CAACD,QAAQ,EAAEsC;IAC/E7B,MAAMP,MAAM,CAACF,QAAQ,OAAGxB,gCAAAA,MAAiBH,8BAAAA,EAAeoC,MAAMP,MAAM,CAACF,QAAQ,EAAEsC;IAE/E7B,MAAMR,MAAM,CAACc,KAAK,GAAGJ;IACrBF,MAAMP,MAAM,CAACa,KAAK,GAAGA;IAErB,OAAON;AACT,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"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"],"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"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAUCW,gBAAgB;;;IANhBL,mBAAmB;;;IA4Ff8I,2BAA2B;;;;uBA/F0B,gBAAgB;AAG/E,4BAA4B;IAC/B7I,IAAI,EAAE,eAAe;IACrBC,KAAK,EAAE,sBAAsB;IAC7BC,MAAM,EAAE,uBAAuB;IAC/BC,MAAM,EAAE;AACZ,CAAC;AACM,yBAAyB;IAC5BE,gBAAgB,EAAE,CAAA,qBAAA,CAAuB;IACzCC,gBAAgB,EAAE,CAAA,qBAAA,CAAuB;IACzCC,aAAa,EAAE,CAAA,wBAAA,CAA0B;IACzCC,YAAY,EAAE,CAAA,sBAAA,CAAA;AAClB,CAAC;AACD,yBAAA;AACA,MAAMC,YAAY,GAAG,CAAA,yBAAA,CAA2B;AAChD;;CAEA,GAAI,MAAMC,aAAa,GAAA,WAAA,OAAGjB,oBAAA,EAAA,WAAA,WAAA;IAAA;IAAA;CAczB,CAAC;AACF;;CAEA,GAAI,MAAMkB,cAAc,GAAA,W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ACkJ,SAAS,CAAC;IACrI,oDAAA;IACAL,KAAK,CAAC5I,MAAM,CAACiJ,SAAS,OAAGxJ,mBAAY,EAACI,mBAAmB,CAACG,MAAM,EAAE+I,WAAW,CAACvB,KAAK,EAAEoB,KAAK,CAAC5I,MAAM,CAACiJ,SAAS,CAAC;IAC5G,oDAAA;IACAL,KAAK,CAAC3I,MAAM,CAACgJ,SAAS,OAAGxJ,mBAAY,EAACI,mBAAmB,CAACI,MAAM,EAAE8I,WAAW,CAACvB,KAAK,EAAEoB,KAAK,CAAC3I,MAAM,CAACgJ,SAAS,CAAC;IAC5G,OAAOL,KAAK;AAChB,CAAC"}
@@ -1 +0,0 @@
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;;;;;;;;;;;;IAeaW,gBAAAA;;;IAPAL,mBAAAA;;;+BAuGA+D;eAAAA;;;uBA7GyD,iBAAiB;4BAEhE,wBAAwB;8BACP,0BAA0B;AAG3D,4BAA4D;IACjE9D,MAAM;IACNC,OAAO;IACPC,QAAQ;IACRC,QAAQ;AACV,EAAE;AAEK,yBAAyB;IAC9BE,kBAAkB,CAAC,qBAAqB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pDL,MAAM7D,MAAM,CAACkE,SAAS,OAAGzE,mBAAAA,EAAaI,oBAAoBG,MAAM,EAAEgE,YAAYf,KAAK,EAAEY,MAAM7D,MAAM,CAACkE,SAAS;IAE3G,oDAAoD;IACpDL,MAAM5D,MAAM,CAACiE,SAAS,OAAGzE,mBAAAA,EAAaI,oBAAoBI,MAAM,EAAE+D,YAAYf,KAAK,EAAEY,MAAM5D,MAAM,CAACiE,SAAS;IAC3G,OAAOL;AACT,EAAE"}
@@ -1 +0,0 @@
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":";;;;;;;;;;;;eAASA,wBAAW;;;eASXG,iDAAqB;;;eAFrBF,6CAA0B;;;eAEHG,yDAA6B;;;eADpDF,uCAAuB;;;6BARJ,gBAAgB;mCAOD,sBAAsB;gCACzB,mBAAmB;4CACU,gCAAgC"}
@@ -1 +0,0 @@
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":";;;;+BAYaE;;;;;;4BAXb,gDAAiD;gCAErB,4BAA4B;6BAIpB,6BAA6B;AAK1D,mCAAmC,CACxCC,OACAC;QAEAJ,2BAAAA,EAA8BG;IAE9B,OAAA,WAAA,OACE,eAAA,EAACF,gCAAAA,EAAAA;QAAoBI,OAAOD,cAAcE,WAAW;kBACnD,WAAA,OAAA,eAAA,EAACH,MAAMI,IAAI,EAAA;sBAAEJ,MAAMI,IAAI,CAACC,QAAQ;;;AAGtC,EAAE"}
@@ -1 +0,0 @@
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;;;;;+BAcaG;;;;;;gCAXoD,4BAA4B;AAWtF,gCAAgC,CAACC,OAAyBC;IAC/D,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGL;IAEjD,MAAMM,oBAAmDR,gCAAAA,EAAiB,CAACS,OAAOC;QAChFL,kBAAAA,QAAAA,kBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,cAAgBI,OAAO;YACrBE,MAAM;YACNF;YACAL,OAAOM,KAAKN,KAAK;QACnB;IACF;IAEA,OAAO;QACLQ,YAAY;YACVC,MAAM;QACR;QACAA,MAAMd,oBAAAA,CAAKe,MAAM,KACfhB,wCAAAA,EAAyB,OAAO;YAC9BK;YACA,GAAGI,IAAI;QACT,IACA;YAAEQ,aAAa;QAAM;QAEvBX;QACAI;QACAF;IACF;AACF,EAAE"}
@@ -1,28 +0,0 @@
1
- 'use client';
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "useColorPickerContextValues", {
7
- enumerable: true,
8
- get: function() {
9
- return useColorPickerContextValues;
10
- }
11
- });
12
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
13
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
- const useColorPickerContextValues = (state)=>{
15
- const { color, shape, requestChange } = state;
16
- const colorPicker = _react.useMemo(()=>({
17
- requestChange,
18
- color,
19
- shape
20
- }), [
21
- requestChange,
22
- color,
23
- shape
24
- ]);
25
- return {
26
- colorPicker
27
- };
28
- };
@@ -1 +0,0 @@
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;;;;;;;;;;;;iEAEuB,QAAQ;AAIxB,MAAMC,8BAA8B,CAACC;IAC1C,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGH;IAExC,MAAMI,cAAcN,OAAMO,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAF;YACAC;SACF,CAAA,EACA;QAACC;QAAeF;QAAOC;KAAM;IAG/B,OAAO;QAAEE;IAAY;AACvB,EAAE"}
@@ -1 +0,0 @@
1
- {"version":3,"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"],"names":["__styles","mergeClasses","tokens","colorPickerClassNames","root","useStyles","mc9l5x","Beiy3e4","i8kkvl","Belr9w4","rmohyg","d","p","useColorPickerStyles_unstable","state","styles","className"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAGCG,qBAAqB;;;iCAcY;eAA7BU;;;uBAhBwB,gBAAgB;AAElD,8BAA8B;IACjCT,IAAI,EAAE;AACV,CAAC;AACD;;CAEA,GAAI,MAAMC,SAAS,GAAA,WAAA,OAAGL,eAAA,EAAA;IAAAI,IAAA,EAAA;QAAAE,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;QAAAC,MAAA,EAAA;IAAA;AAAA,GAAA;IAAAC,CAAA,EAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAC,CAAA,EAAA,CAAA;YAAA;SAAA;KAAA;AAAA,CAMrB,CAAC;AAGS,uCAAuCE,KAAK,IAAG;IACtD,MAAMC,MAAM,GAAGV,SAAS,CAAC,CAAC;IAC1B,oDAAA;IACAS,KAAK,CAACV,IAAI,CAACY,SAAS,OAAGf,mBAAY,EAACE,qBAAqB,CAACC,IAAI,EAAEW,MAAM,CAACX,IAAI,EAAEU,KAAK,CAACV,IAAI,CAACY,SAAS,CAAC;IAClG,OAAOF,KAAK;AAChB,CAAC"}
@@ -1 +0,0 @@
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":";;;;;;;;;;;;eAASA,wBAAW;;;eAKlBG,8CAAkB;;;eAClBC,iDAAqB;;;eAJdH,6CAA0B;;;eAKjCI,yDAA6B;;;eAJtBH,uCAAuB;;;6BAHJ,gBAAgB;mCAED,sBAAsB;gCACzB,mBAAmB;4CAKpD,gCAAgC"}
@@ -1 +0,0 @@
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":";;;;+BAUaC;;;;;;4BATb,iCAAiD;gCAErB,4BAA4B;AAOjD,mCAAmC,CAACC;QACzCF,2BAAAA,EAA8BE;IAE9B,OAAA,WAAA,OACE,gBAAA,EAACA,MAAMC,IAAI,EAAA;;8BACT,eAAA,EAACD,MAAME,KAAK,EAAA,CAAA;8BACZ,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;8BACX,eAAA,EAACH,MAAMI,KAAK,EAAA,CAAA;;;AAGlB,EAAE"}
@@ -1 +0,0 @@
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;;;;;+BA+BamB;;;;;;2BA5Ba,kBAAkB;gCAOrC,4BAA4B;4CACA,gCAAgC;qCACnB,kCAAkC;6BAE9B,6BAA6B;2BAClC,wBAAwB;4BAC5C,yBAAyB;gCACrB,6BAA6B;+BACG,4BAA4B;AAapF,gCAAgC,CACrCC,OACAC;IAEA,eAAe,2GAA2G;IAE1H,MAAM,EAAEC,GAAG,EAAE,OAAGd,uCAAAA;IAChB,MAAMe,0BAAsBd,gDAAAA,EAAoCe,CAAAA,MAAOA,IAAIC,aAAa;IACxF,MAAMC,uBAAmBjB,gDAAAA,EAAoCe,CAAAA,MAAOA,IAAIG,KAAK;IAC7E,MAAMC,mBAAmBnB,oDAAAA,EAAoCe,CAAAA,MAAOA,IAAIK,KAAK;IAC7E,MAAMC,kBAAc7B,yCAAAA,EAA0B;QAC5CmB;QACAW,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;SAAQ;IAC1C;IAEA,MAAM,EACJL,KAAK,EACLM,UAAU,KAAK,EACfC,WAAWX,mBAAmB,EAC9BM,QAAQD,gBAAgB,EACxBO,QAAQ,EAERC,AADA,IACI,EACJC,EAFQ,GAEH,EACLC,IAAI,EACJC,KAAK,EACN,GAAGnB;IAEJ,MAAMoB,WAAWb,SAASD;IAC1B,MAAMe,eAAWzC,oBAAAA,EAAUwC,UAAUE,KAAK;IAE1C,MAAM,CAACC,cAAcC,gBAAgB,OAAGxC,oCAAAA,EAA+B;QACrEyC,cAAczB,MAAM0B,YAAY;QAChCC,OAAOP;QACPQ,cAAc9B,4BAAAA;IAChB;IAEA,MAAMN,MAAMqB,YAAY,QAAQtB,kBAAAA,GAAUE,cAAAA;IAE1C,MAAMoC,sBAA8C;QA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