@fluentui/react-color-picker 9.2.18 → 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.
- package/CHANGELOG.md +33 -2
- package/dist/index.d.cts +342 -0
- package/dist/index.d.ts +67 -8
- package/lib/AlphaSlider.js +1 -1
- package/lib/AlphaSlider.js.map +1 -1
- package/lib/ColorArea.js +1 -1
- package/lib/ColorArea.js.map +1 -1
- package/lib/ColorPicker.js +1 -1
- package/lib/ColorPicker.js.map +1 -1
- package/lib/ColorSlider.js +1 -1
- package/lib/ColorSlider.js.map +1 -1
- package/lib/components/AlphaSlider/AlphaSlider.constants.js +6 -0
- package/lib/components/AlphaSlider/AlphaSlider.constants.js.map +1 -0
- package/lib/components/AlphaSlider/AlphaSlider.js +5 -5
- package/lib/components/AlphaSlider/AlphaSlider.js.map +1 -1
- package/lib/components/AlphaSlider/AlphaSlider.types.js +1 -1
- package/lib/components/AlphaSlider/AlphaSlider.types.js.map +1 -1
- package/lib/components/AlphaSlider/index.js +5 -4
- package/lib/components/AlphaSlider/index.js.map +1 -1
- package/lib/components/AlphaSlider/renderAlphaSlider.js +1 -1
- package/lib/components/AlphaSlider/renderAlphaSlider.js.map +1 -1
- package/lib/components/AlphaSlider/useAlphaSlider.js +11 -5
- package/lib/components/AlphaSlider/useAlphaSlider.js.map +1 -1
- package/lib/components/AlphaSlider/useAlphaSliderState.js +12 -12
- package/lib/components/AlphaSlider/useAlphaSliderState.js.map +1 -1
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js +4 -9
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +1 -1
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js +4 -9
- package/lib/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js.map +1 -1
- package/lib/components/ColorArea/ColorArea.constants.js +6 -0
- package/lib/components/ColorArea/ColorArea.constants.js.map +1 -0
- package/lib/components/ColorArea/ColorArea.js +5 -5
- package/lib/components/ColorArea/ColorArea.js.map +1 -1
- package/lib/components/ColorArea/ColorArea.types.js +1 -1
- package/lib/components/ColorArea/ColorArea.types.js.map +1 -1
- package/lib/components/ColorArea/index.js +5 -4
- package/lib/components/ColorArea/index.js.map +1 -1
- package/lib/components/ColorArea/renderColorArea.js +1 -1
- package/lib/components/ColorArea/renderColorArea.js.map +1 -1
- package/lib/components/ColorArea/useColorArea.js +32 -18
- package/lib/components/ColorArea/useColorArea.js.map +1 -1
- package/lib/components/ColorArea/useColorAreaStyles.styles.js +4 -9
- package/lib/components/ColorArea/useColorAreaStyles.styles.js.map +1 -1
- package/lib/components/ColorArea/useColorAreaStyles.styles.raw.js +4 -9
- package/lib/components/ColorArea/useColorAreaStyles.styles.raw.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.js +6 -6
- package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/ColorPicker.types.js +1 -3
- package/lib/components/ColorPicker/ColorPicker.types.js.map +1 -1
- package/lib/components/ColorPicker/index.js +5 -4
- package/lib/components/ColorPicker/index.js.map +1 -1
- package/lib/components/ColorPicker/renderColorPicker.js +2 -2
- package/lib/components/ColorPicker/renderColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/useColorPicker.js +10 -4
- package/lib/components/ColorPicker/useColorPicker.js.map +1 -1
- package/lib/components/ColorPicker/useColorPickerContextValues.js +15 -1
- package/lib/components/ColorPicker/useColorPickerContextValues.js.map +1 -1
- package/lib/components/ColorPicker/useColorPickerStyles.styles.js +2 -2
- package/lib/components/ColorPicker/useColorPickerStyles.styles.js.map +1 -1
- package/lib/components/ColorPicker/useColorPickerStyles.styles.raw.js +2 -2
- package/lib/components/ColorSlider/ColorSlider.constants.js +8 -0
- package/lib/components/ColorSlider/ColorSlider.constants.js.map +1 -0
- package/lib/components/ColorSlider/ColorSlider.js +5 -5
- package/lib/components/ColorSlider/ColorSlider.js.map +1 -1
- package/lib/components/ColorSlider/ColorSlider.types.js +1 -3
- package/lib/components/ColorSlider/ColorSlider.types.js.map +1 -1
- package/lib/components/ColorSlider/index.js +5 -4
- package/lib/components/ColorSlider/index.js.map +1 -1
- package/lib/components/ColorSlider/renderColorSlider.js +1 -1
- package/lib/components/ColorSlider/renderColorSlider.js.map +1 -1
- package/lib/components/ColorSlider/useColorSlider.js +34 -20
- package/lib/components/ColorSlider/useColorSlider.js.map +1 -1
- package/lib/components/ColorSlider/useColorSliderStyles.styles.js +3 -10
- package/lib/components/ColorSlider/useColorSliderStyles.styles.js.map +1 -1
- package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js +3 -10
- package/lib/components/ColorSlider/useColorSliderStyles.styles.raw.js.map +1 -1
- package/lib/contexts/colorPicker.js +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/types/color.js.map +1 -1
- package/lib/utils/adjustChannel.js +2 -2
- package/lib/utils/adjustChannel.js.map +1 -1
- package/lib/utils/constants.js +6 -2
- package/lib/utils/constants.js.map +1 -1
- package/lib/utils/createHslColor.js +28 -0
- package/lib/utils/createHslColor.js.map +1 -0
- package/lib/utils/getCoordinates.js +1 -1
- package/lib-commonjs/{AlphaSlider.js → AlphaSlider.cjs} +4 -1
- package/lib-commonjs/AlphaSlider.cjs.map +1 -0
- package/lib-commonjs/{ColorArea.js → ColorArea.cjs} +4 -1
- package/lib-commonjs/ColorArea.cjs.map +1 -0
- package/lib-commonjs/{ColorPicker.js → ColorPicker.cjs} +10 -1
- package/lib-commonjs/ColorPicker.cjs.map +1 -0
- package/lib-commonjs/{ColorSlider.js → ColorSlider.cjs} +4 -1
- package/lib-commonjs/ColorSlider.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{AlphaSlider.js → AlphaSlider.cjs} +3 -3
- package/lib-commonjs/components/AlphaSlider/{AlphaSlider.js.map → AlphaSlider.cjs.map} +1 -1
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.constants.cjs +16 -0
- package/lib-commonjs/components/AlphaSlider/AlphaSlider.constants.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{AlphaSlider.types.js → AlphaSlider.types.cjs} +1 -1
- package/lib-commonjs/components/AlphaSlider/{AlphaSlider.types.js.map → AlphaSlider.types.cjs.map} +1 -1
- package/lib-commonjs/components/AlphaSlider/{index.js → index.cjs} +9 -5
- package/lib-commonjs/components/AlphaSlider/index.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{useAlphaSlider.js → useAlphaSlider.cjs} +21 -7
- package/lib-commonjs/components/AlphaSlider/useAlphaSlider.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{useAlphaSliderState.js → useAlphaSliderState.cjs} +12 -12
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{useAlphaSliderStyles.styles.js → useAlphaSliderStyles.styles.cjs} +1 -10
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/AlphaSlider/{useAlphaSliderStyles.styles.raw.js → useAlphaSliderStyles.styles.raw.cjs} +6 -14
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.raw.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/{ColorArea.js → ColorArea.cjs} +3 -3
- package/lib-commonjs/components/ColorArea/{ColorArea.js.map → ColorArea.cjs.map} +1 -1
- package/lib-commonjs/components/ColorArea/ColorArea.constants.cjs +16 -0
- package/lib-commonjs/components/ColorArea/ColorArea.constants.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/{ColorArea.types.js → ColorArea.types.cjs} +1 -1
- package/lib-commonjs/components/ColorArea/{ColorArea.types.js.map → ColorArea.types.cjs.map} +1 -1
- package/lib-commonjs/components/ColorArea/{index.js → index.cjs} +9 -5
- package/lib-commonjs/components/ColorArea/index.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/renderColorArea.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/{useColorArea.js → useColorArea.cjs} +31 -16
- package/lib-commonjs/components/ColorArea/useColorArea.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/{useColorAreaStyles.styles.js → useColorAreaStyles.styles.cjs} +0 -9
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ColorArea/{useColorAreaStyles.styles.raw.js → useColorAreaStyles.styles.raw.cjs} +5 -13
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.raw.cjs.map +1 -0
- package/lib-commonjs/components/ColorPicker/{ColorPicker.js → ColorPicker.cjs} +4 -4
- package/lib-commonjs/components/ColorPicker/{ColorPicker.js.map → ColorPicker.cjs.map} +1 -1
- package/lib-commonjs/components/{ColorSlider/ColorSlider.types.js → ColorPicker/ColorPicker.types.cjs} +1 -3
- package/lib-commonjs/components/ColorPicker/{ColorPicker.types.js.map → ColorPicker.types.cjs.map} +1 -1
- package/lib-commonjs/components/ColorPicker/{index.js → index.cjs} +14 -4
- package/lib-commonjs/components/ColorPicker/index.cjs.map +1 -0
- package/lib-commonjs/components/ColorPicker/{renderColorPicker.js → renderColorPicker.cjs} +1 -1
- package/lib-commonjs/components/ColorPicker/renderColorPicker.cjs.map +1 -0
- package/lib-commonjs/components/ColorPicker/{useColorPicker.js → useColorPicker.cjs} +20 -6
- package/lib-commonjs/components/ColorPicker/useColorPicker.cjs.map +1 -0
- package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.cjs +50 -0
- package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.cjs.map +1 -0
- package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/{ColorSlider.js → ColorSlider.cjs} +3 -3
- package/lib-commonjs/components/ColorSlider/{ColorSlider.js.map → ColorSlider.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs +18 -0
- package/lib-commonjs/components/ColorSlider/ColorSlider.constants.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/{ColorSlider.types.js.map → ColorSlider.types.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSlider/{index.js → index.cjs} +9 -5
- package/lib-commonjs/components/ColorSlider/index.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/renderColorSlider.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/{useColorSlider.js → useColorSlider.cjs} +34 -19
- package/lib-commonjs/components/ColorSlider/useColorSlider.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/{useColorSliderStyles.styles.js → useColorSliderStyles.styles.cjs} +2 -12
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ColorSlider/{useColorSliderStyles.styles.raw.js → useColorSliderStyles.styles.raw.cjs} +19 -29
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.cjs.map +1 -0
- package/lib-commonjs/{index.js → index.cjs} +23 -4
- package/lib-commonjs/index.cjs.map +1 -0
- package/lib-commonjs/{components/ColorPicker/ColorPicker.types.js → types/color.cjs} +1 -3
- package/lib-commonjs/types/color.cjs.map +1 -0
- package/lib-commonjs/utils/{adjustChannel.js → adjustChannel.cjs} +1 -1
- package/lib-commonjs/utils/{adjustChannel.js.map → adjustChannel.cjs.map} +1 -1
- package/lib-commonjs/utils/{constants.js → constants.cjs} +6 -2
- package/lib-commonjs/utils/constants.cjs.map +1 -0
- package/lib-commonjs/utils/createHslColor.cjs +41 -0
- package/lib-commonjs/utils/createHslColor.cjs.map +1 -0
- package/package.json +19 -14
- package/lib-commonjs/AlphaSlider.js.map +0 -1
- package/lib-commonjs/ColorArea.js.map +0 -1
- package/lib-commonjs/ColorPicker.js.map +0 -1
- package/lib-commonjs/ColorSlider.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/index.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/renderAlphaSlider.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/useAlphaSlider.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderState.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.js.map +0 -1
- package/lib-commonjs/components/AlphaSlider/useAlphaSliderStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ColorArea/index.js.map +0 -1
- package/lib-commonjs/components/ColorArea/renderColorArea.js.map +0 -1
- package/lib-commonjs/components/ColorArea/useColorArea.js.map +0 -1
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ColorArea/useColorAreaStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/components/ColorPicker/index.js.map +0 -1
- package/lib-commonjs/components/ColorPicker/renderColorPicker.js.map +0 -1
- package/lib-commonjs/components/ColorPicker/useColorPicker.js.map +0 -1
- package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.js +0 -28
- package/lib-commonjs/components/ColorPicker/useColorPickerContextValues.js.map +0 -1
- package/lib-commonjs/components/ColorPicker/useColorPickerStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ColorSlider/index.js.map +0 -1
- package/lib-commonjs/components/ColorSlider/renderColorSlider.js.map +0 -1
- package/lib-commonjs/components/ColorSlider/useColorSlider.js.map +0 -1
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ColorSlider/useColorSliderStyles.styles.raw.js.map +0 -1
- package/lib-commonjs/index.js.map +0 -1
- package/lib-commonjs/types/color.js.map +0 -1
- package/lib-commonjs/utils/constants.js.map +0 -1
- /package/lib-commonjs/components/AlphaSlider/{alphaSliderUtils.js → alphaSliderUtils.cjs} +0 -0
- /package/lib-commonjs/components/AlphaSlider/{alphaSliderUtils.js.map → alphaSliderUtils.cjs.map} +0 -0
- /package/lib-commonjs/components/AlphaSlider/{renderAlphaSlider.js → renderAlphaSlider.cjs} +0 -0
- /package/lib-commonjs/components/ColorArea/{renderColorArea.js → renderColorArea.cjs} +0 -0
- /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.js → useColorPickerStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.raw.js → useColorPickerStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ColorPicker/{useColorPickerStyles.styles.raw.js.map → useColorPickerStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/{types/color.js → components/ColorSlider/ColorSlider.types.cjs} +0 -0
- /package/lib-commonjs/components/ColorSlider/{renderColorSlider.js → renderColorSlider.cjs} +0 -0
- /package/lib-commonjs/contexts/{colorPicker.js → colorPicker.cjs} +0 -0
- /package/lib-commonjs/contexts/{colorPicker.js.map → colorPicker.cjs.map} +0 -0
- /package/lib-commonjs/utils/{createHsvColor.js → createHsvColor.cjs} +0 -0
- /package/lib-commonjs/utils/{createHsvColor.js.map → createHsvColor.cjs.map} +0 -0
- /package/lib-commonjs/utils/{getCoordinates.js → getCoordinates.cjs} +0 -0
- /package/lib-commonjs/utils/{getCoordinates.js.map → getCoordinates.cjs.map} +0 -0
- /package/lib-commonjs/utils/{getPercent.js → getPercent.cjs} +0 -0
- /package/lib-commonjs/utils/{getPercent.js.map → getPercent.cjs.map} +0 -0
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { __styles, __resetStyles, mergeClasses } from
|
|
4
|
-
import { tokens } from
|
|
3
|
+
import { __styles, __resetStyles, mergeClasses } from "@griffel/react";
|
|
4
|
+
import { tokens } from "@fluentui/react-theme";
|
|
5
|
+
import { colorSliderCSSVars } from "./ColorSlider.constants.js";
|
|
5
6
|
export const colorSliderClassNames = {
|
|
6
7
|
root: 'fui-ColorSlider',
|
|
7
8
|
rail: 'fui-ColorSlider__rail',
|
|
8
9
|
thumb: 'fui-ColorSlider__thumb',
|
|
9
10
|
input: 'fui-ColorSlider__input'
|
|
10
11
|
};
|
|
11
|
-
export const colorSliderCSSVars = {
|
|
12
|
-
sliderDirectionVar: `--fui-Slider--direction`,
|
|
13
|
-
sliderProgressVar: `--fui-Slider--progress`,
|
|
14
|
-
thumbColorVar: `--fui-Slider__thumb--color`,
|
|
15
|
-
railColorVar: `--fui-Slider__rail--color`,
|
|
16
|
-
thumbSizeVar: `--fui-Slider__thumb--size`,
|
|
17
|
-
railSizeVar: `--fui-Slider__rail--size`
|
|
18
|
-
};
|
|
19
12
|
const hueBackground = `linear-gradient(${ /*#__PURE__*/[`var(${colorSliderCSSVars.sliderDirectionVar})`, 'red', 'fuchsia', 'blue', 'aqua', 'lime', 'yellow', 'red'].join(',')})`;
|
|
20
13
|
/**
|
|
21
14
|
* Styles for the root slot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","__resetStyles","mergeClasses","tokens","colorSliderClassNames","root","rail","thumb","input","colorSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","thumbSizeVar","railSizeVar","hueBackground","join","useRootStyles","useStyles","horizontal","Bf4jedk","wkccdc","Budl1dq","vertical","sshi5w","d","useChannelStyles","hue","Bcmaq0h","saturation","value","useRailStyles","Bkecrkj","Ijaq50","nk6f5a","Br312pm","Bw0ie65","qhf8xq","Bvjb7m6","Bpd4iqm","oeaueh","Bw0xxkn","Ftih45","Brfgrao","a9b677","Bqenvij","Fbdkly","mdwyqc","Baz25je","Ccq8qp","Bciustq","lawp4y","useThumbStyles","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","De3pzq","gc50h5","r59vdv","Budzafs","ck0cow","n07z76","Gng75u","Bcvre1j","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","Bz10aip","oyh7mz","B5kzvoi","p","useShapeStyles","rounded","square","useInputStyles","Bceei9c","abs64n","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","jo39rj","C5zqim","Bdlbwnu","B8rk77i","Bbzx7hc","Hwkvcz","B0nnt1c","Brwsv5j","B2b7vog","B4hmq5e","B8jxwem","B18nadz","Ddg5ig","Byj09el","Dac2s3","Dd2y6r","Bk0t58e","Ewenww","Brqi8qb","zz3kca","low6xx","d0s10n","wea7l5","olu5tv","g5nsvh","Bqvnfwh","Biqzhck","kgocjf","i","useColorSliderStyles_unstable","state","rootStyles","styles","railStyles","thumbStyles","inputStyles","shapeStyles","channelStyles","isVertical","className","channel","shape"],"sources":["useColorSliderStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, makeResetStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const colorSliderClassNames = {\n root: 'fui-ColorSlider',\n rail: 'fui-ColorSlider__rail',\n thumb: 'fui-ColorSlider__thumb',\n input: 'fui-ColorSlider__input'\n};\nexport const colorSliderCSSVars = {\n sliderDirectionVar: `--fui-Slider--direction`,\n sliderProgressVar: `--fui-Slider--progress`,\n thumbColorVar: `--fui-Slider__thumb--color`,\n railColorVar: `--fui-Slider__rail--color`,\n thumbSizeVar: `--fui-Slider__thumb--size`,\n railSizeVar: `--fui-Slider__rail--size`\n};\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 * Styles for the root slot\n */ const 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});\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 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});\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 * Styles for the rail slot\n */ const 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 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 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 * Styles for the thumb slot\n */ const 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});\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n }\n});\n/**\n * Styles for the Input slot\n */ const 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 * Apply styling to the ColorSlider slots based on the state\n */ export const useColorSliderStyles_unstable = (state)=>{\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 // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorSliderClassNames.root, rootStyles, isVertical ? styles.vertical : styles.horizontal, state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.rail.className = mergeClasses(colorSliderClassNames.rail, railStyles.rail, channelStyles[state.channel || 'hue'], shapeStyles[state.shape || 'rounded'], isVertical ? railStyles.vertical : railStyles.horizontal, state.rail.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(colorSliderClassNames.thumb, thumbStyles.thumb, isVertical ? thumbStyles.vertical : thumbStyles.horizontal, state.thumb.className);\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(colorSliderClassNames.input, inputStyles.input, isVertical ? inputStyles.vertical : inputStyles.horizontal, state.input.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAAC,aAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE,uBAAuB;EAC7BC,KAAK,EAAE,wBAAwB;EAC/BC,KAAK,EAAE;AACX,CAAC;AACD,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,kBAAkB,EAAE,yBAAyB;EAC7CC,iBAAiB,EAAE,wBAAwB;EAC3CC,aAAa,EAAE,4BAA4B;EAC3CC,YAAY,EAAE,2BAA2B;EACzCC,YAAY,EAAE,2BAA2B;EACzCC,WAAW,EAAE;AACjB,CAAC;AACD,MAAMC,aAAa,GAAG,iCAAmB,CACrC,OAAOP,kBAAkB,CAACC,kBAAkB,GAAG,EAC/C,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,CACR,CAACO,IAAI,CAA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AgI,KAAK,CAACnJ,IAAI,CAAC4J,SAAS,GAAG/J,YAAY,CAACE,qBAAqB,CAACC,IAAI,EAAEoJ,UAAU,EAAEO,UAAU,GAAGN,MAAM,CAAClI,QAAQ,GAAGkI,MAAM,CAACtI,UAAU,EAAEoI,KAAK,CAACnJ,IAAI,CAAC4J,SAAS,CAAC;EACnJ;EACAT,KAAK,CAAClJ,IAAI,CAAC2J,SAAS,GAAG/J,YAAY,CAACE,qBAAqB,CAACE,IAAI,EAAEqJ,UAAU,CAACrJ,IAAI,EAAEyJ,aAAa,CAACP,KAAK,CAACU,OAAO,IAAI,KAAK,CAAC,EAAEJ,WAAW,CAACN,KAAK,CAACW,KAAK,IAAI,SAAS,CAAC,EAAEH,UAAU,GAAGL,UAAU,CAACnI,QAAQ,GAAGmI,UAAU,CAACvI,UAAU,EAAEoI,KAAK,CAAClJ,IAAI,CAAC2J,SAAS,CAAC;EAC9O;EACAT,KAAK,CAACjJ,KAAK,CAAC0J,SAAS,GAAG/J,YAAY,CAACE,qBAAqB,CAACG,KAAK,EAAEqJ,WAAW,CAACrJ,KAAK,EAAEyJ,UAAU,GAAGJ,WAAW,CAACpI,QAAQ,GAAGoI,WAAW,CAACxI,UAAU,EAAEoI,KAAK,CAACjJ,KAAK,CAAC0J,SAAS,CAAC;EACvK;EACAT,KAAK,CAAChJ,KAAK,CAACyJ,SAAS,GAAG/J,YAAY,CAACE,qBAAqB,CAACI,KAAK,EAAEqJ,WAAW,CAACrJ,KAAK,EAAEwJ,UAAU,GAAGH,WAAW,CAACrI,QAAQ,GAAGqI,WAAW,CAACzI,UAAU,EAAEoI,KAAK,CAAChJ,KAAK,CAACyJ,SAAS,CAAC;EACvK,OAAOT,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__styles","__resetStyles","mergeClasses","tokens","colorSliderCSSVars","colorSliderClassNames","root","rail","thumb","input","hueBackground","sliderDirectionVar","join","useRootStyles","useStyles","horizontal","Bf4jedk","wkccdc","Budl1dq","vertical","sshi5w","d","useChannelStyles","hue","Bcmaq0h","saturation","value","useRailStyles","Bkecrkj","Ijaq50","nk6f5a","Br312pm","Bw0ie65","qhf8xq","Bvjb7m6","Bpd4iqm","oeaueh","Bw0xxkn","Ftih45","Brfgrao","a9b677","Bqenvij","Fbdkly","mdwyqc","Baz25je","Ccq8qp","Bciustq","lawp4y","useThumbStyles","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","De3pzq","gc50h5","r59vdv","Budzafs","ck0cow","n07z76","Gng75u","Bcvre1j","Bcgcnre","Bqjgrrk","qa3bma","y0oebl","Biqmznv","Bm6vgfq","Bbv0w2i","uvfttm","eqrjj","Bk5zm6e","m598lv","B4f6apu","ydt019","Bq4z7u6","Bdkvgpv","B0qfbqy","kj8mxx","Bz10aip","oyh7mz","B5kzvoi","p","useShapeStyles","rounded","square","useInputStyles","Bceei9c","abs64n","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","jrapky","Frg6f3","t21cq0","B6of3ja","B74szlk","jo39rj","C5zqim","Bdlbwnu","B8rk77i","Bbzx7hc","Hwkvcz","B0nnt1c","Brwsv5j","B2b7vog","B4hmq5e","B8jxwem","B18nadz","Ddg5ig","Byj09el","Dac2s3","Dd2y6r","Bk0t58e","Ewenww","Brqi8qb","zz3kca","low6xx","d0s10n","wea7l5","olu5tv","g5nsvh","Bqvnfwh","Biqzhck","kgocjf","i","useColorSliderStyles_unstable","state","rootStyles","styles","railStyles","thumbStyles","inputStyles","shapeStyles","channelStyles","isVertical","className","channel","shape"],"sources":["useColorSliderStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, makeResetStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { colorSliderCSSVars } from \"./ColorSlider.constants.js\";\nexport const colorSliderClassNames = {\n root: 'fui-ColorSlider',\n rail: 'fui-ColorSlider__rail',\n thumb: 'fui-ColorSlider__thumb',\n input: 'fui-ColorSlider__input'\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 * Styles for the root slot\n */ const 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});\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 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});\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 * Styles for the rail slot\n */ const 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 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 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 * Styles for the thumb slot\n */ const 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});\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium\n },\n square: {\n borderRadius: tokens.borderRadiusNone\n }\n});\n/**\n * Styles for the Input slot\n */ const 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 * Apply styling to the ColorSlider slots based on the state\n */ export const useColorSliderStyles_unstable = (state)=>{\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 // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(colorSliderClassNames.root, rootStyles, isVertical ? styles.vertical : styles.horizontal, state.root.className);\n // eslint-disable-next-line react-hooks/immutability\n state.rail.className = mergeClasses(colorSliderClassNames.rail, railStyles.rail, channelStyles[state.channel || 'hue'], shapeStyles[state.shape || 'rounded'], isVertical ? railStyles.vertical : railStyles.horizontal, state.rail.className);\n // eslint-disable-next-line react-hooks/immutability\n state.thumb.className = mergeClasses(colorSliderClassNames.thumb, thumbStyles.thumb, isVertical ? thumbStyles.vertical : thumbStyles.horizontal, state.thumb.className);\n // eslint-disable-next-line react-hooks/immutability\n state.input.className = mergeClasses(colorSliderClassNames.input, inputStyles.input, isVertical ? inputStyles.vertical : inputStyles.horizontal, state.input.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAAC,aAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE,iBAAiB;EACvBC,IAAI,EAAE,uBAAuB;EAC7BC,KAAK,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K,CAACmJ,SAAS,CAAC;EACvK,OAAOT,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { makeStyles, makeResetStyles, mergeClasses } from
|
|
3
|
-
import { tokens } from
|
|
2
|
+
import { makeStyles, makeResetStyles, mergeClasses } from "@griffel/react";
|
|
3
|
+
import { tokens } from "@fluentui/react-theme";
|
|
4
|
+
import { colorSliderCSSVars } from "./ColorSlider.constants.js";
|
|
4
5
|
export const colorSliderClassNames = {
|
|
5
6
|
root: 'fui-ColorSlider',
|
|
6
7
|
rail: 'fui-ColorSlider__rail',
|
|
7
8
|
thumb: 'fui-ColorSlider__thumb',
|
|
8
9
|
input: 'fui-ColorSlider__input'
|
|
9
10
|
};
|
|
10
|
-
export const colorSliderCSSVars = {
|
|
11
|
-
sliderDirectionVar: `--fui-Slider--direction`,
|
|
12
|
-
sliderProgressVar: `--fui-Slider--progress`,
|
|
13
|
-
thumbColorVar: `--fui-Slider__thumb--color`,
|
|
14
|
-
railColorVar: `--fui-Slider__rail--color`,
|
|
15
|
-
thumbSizeVar: `--fui-Slider__thumb--size`,
|
|
16
|
-
railSizeVar: `--fui-Slider__rail--size`
|
|
17
|
-
};
|
|
18
11
|
const hueBackground = `linear-gradient(${[
|
|
19
12
|
`var(${colorSliderCSSVars.sliderDirectionVar})`,
|
|
20
13
|
'red',
|
|
@@ -1 +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';\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\nexport const colorSliderCSSVars = {\n sliderDirectionVar: `--fui-Slider--direction`,\n sliderProgressVar: `--fui-Slider--progress`,\n thumbColorVar: `--fui-Slider__thumb--color`,\n railColorVar: `--fui-Slider__rail--color`,\n thumbSizeVar: `--fui-Slider__thumb--size`,\n railSizeVar: `--fui-Slider__rail--size`,\n};\n\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","colorSliderClassNames","root","rail","thumb","input","colorSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar","thumbSizeVar","railSizeVar","hueBackground","join","useRootStyles","position","display","touchAction","alignItems","justifyItems","minHeight","useStyles","horizontal","minWidth","gridTemplateRows","gridTemplateColumns","vertical","useChannelStyles","hue","backgroundImage","saturation","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","inset","boxSizing","strokeWidthThick","colorNeutralBackground1","transform","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;AAEA,SAASA,UAAU,EAAEC,eAAe,EAAEC,YAAY,QAAQ,iBAAiB;AAE3E,SAASC,MAAM,QAAQ,wBAAwB;AAG/C,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,OAAO,MAAMC,qBAAqB;IAChCC,oBAAoB,CAAC,uBAAuB,CAAC;IAC7CC,mBAAmB,CAAC,sBAAsB,CAAC;IAC3CC,eAAe,CAAC,0BAA0B,CAAC;IAC3CC,cAAc,CAAC,yBAAyB,CAAC;IACzCC,cAAc,CAAC,yBAAyB,CAAC;IACzCC,aAAa,CAAC,wBAAwB,CAAC;AACzC,EAAE;AAEF,MAAMC,gBAAgB,CAAC,gBAAgB,EAAE;IACvC,CAAC,IAAI,EAAEP,mBAAmBC,kBAAkB,CAAC,CAAC,CAAC;IAC/C;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAACO,IAAI,CAAC,KA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+E,WAAW/E,IAAI,EACfmF,aAAa,CAACP,MAAMU,OAAO,IAAI,MAAM,EACrCJ,WAAW,CAACN,MAAMW,KAAK,IAAI,UAAU,EACrCH,aAAaL,WAAWvD,QAAQ,GAAGuD,WAAW3D,UAAU,EACxDwD,MAAM5E,IAAI,CAACqF,SAAS;IAGtB,oDAAoD;IACpDT,MAAM3E,KAAK,CAACoF,SAAS,GAAGzF,aACtBE,sBAAsBG,KAAK,EAC3B+E,YAAY/E,KAAK,EACjBmF,aAAaJ,YAAYxD,QAAQ,GAAGwD,YAAY5D,UAAU,EAC1DwD,MAAM3E,KAAK,CAACoF,SAAS;IAGvB,oDAAoD;IACpDT,MAAM1E,KAAK,CAACmF,SAAS,GAAGzF,aACtBE,sBAAsBI,KAAK,EAC3B+E,YAAY/E,KAAK,EACjBkF,aAAaH,YAAYzD,QAAQ,GAAGyD,YAAY7D,UAAU,EAC1DwD,MAAM1E,KAAK,CAACmF,SAAS;IAEvB,OAAOT;AACT,EAAE"}
|
|
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;AAEA,SAASA,UAAU,EAAEC,eAAe,EAAEC,YAAY,QAAQ,iBAAiB;AAE3E,SAASC,MAAM,QAAQ,wBAAwB;AAE/C,SAASC,kBAAkB,QAAQ,6BAA0B;AAE7D,OAAO,MAAMC,wBAA0D;IACrEC,MAAM;IACNC,MAAM;IACNC,OAAO;IACPC,OAAO;AACT,EAAE;AAEF,MAAMC,gBAAgB,CAAC,gBAAgB,EAAE;IACvC,CAAC,IAAI,EAAEN,mBAAmBO,kBAAkB,CAAC,CAAC,CAAC;IAC/C;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAACC,IAAI,CAAC,KAAK,CAAC,CAAC;AAEd;;CAEC,GACD,MAAMC,gBAAgBZ,gBAAgB;IACpCa,UAAU;IACVC,SAAS;IACTC,aAAa;IACbC,YAAY;IACZC,cAAc;IACd,CAACd,mBAAmBe,YAAY,CAAC,EAAE;IACnC,CAACf,mBAAmBgB,WAAW,CAAC,EAAE;IAClCC,WAAW;AACb;AAEA,MAAMC,YAAYtB,WAAW;IAC3BuB,YAAY;QACVC,UAAU;QACV,6GAA6G;QAC7GC,kBAAkB,CAAC,QAAQ,EAAErB,mBAAmBe,YAAY,CAAC,KAAK,CAAC;QACnEO,qBAAqB,CAAC,YAAY,CAAC;IACrC;IAEAC,UAAU;QACRN,WAAW;QACX,6GAA6G;QAC7GI,kBAAkB,CAAC,YAAY,CAAC;QAChCC,qBAAqB,CAAC,QAAQ,EAAEtB,mBAAmBe,YAAY,CAAC,KAAK,CAAC;IACxE;AACF;AAEA,MAAMS,mBAAmB5B,WAAW;IAClC6B,KAAK;QACHC,iBAAiBpB;IACnB;IACAqB,YAAY;QACVD,iBAAiB,CAAC,uC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1
1
|
'use client';
|
|
2
|
-
import { createContext, useContextSelector } from
|
|
2
|
+
import { createContext, useContextSelector } from "@fluentui/react-context-selector";
|
|
3
3
|
export const colorPickerContextDefaultValue = {
|
|
4
4
|
requestChange: ()=>{
|
|
5
5
|
/*noop*/ },
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { ColorSlider, colorSliderClassNames, renderColorSlider_unstable, useColorSliderStyles_unstable, useColorSlider_unstable } from
|
|
2
|
-
export { ColorPicker, colorPickerClassNames, renderColorPicker_unstable, useColorPickerStyles_unstable, useColorPicker_unstable } from
|
|
3
|
-
export { ColorArea, colorAreaClassNames, renderColorArea_unstable, useColorAreaStyles_unstable, useColorArea_unstable } from
|
|
4
|
-
export { AlphaSlider, alphaSliderClassNames, renderAlphaSlider_unstable, useAlphaSliderStyles_unstable, useAlphaSlider_unstable } from
|
|
1
|
+
export { ColorSlider, colorSliderClassNames, renderColorSlider_unstable, useColorSliderBase_unstable, useColorSliderStyles_unstable, useColorSlider_unstable } from "./ColorSlider.js";
|
|
2
|
+
export { ColorPicker, colorPickerClassNames, renderColorPicker_unstable, useColorPickerBase_unstable, useColorPickerContextValues, useColorPickerStyles_unstable, useColorPicker_unstable } from "./ColorPicker.js";
|
|
3
|
+
export { ColorArea, colorAreaClassNames, renderColorArea_unstable, useColorAreaBase_unstable, useColorAreaStyles_unstable, useColorArea_unstable } from "./ColorArea.js";
|
|
4
|
+
export { AlphaSlider, alphaSliderClassNames, renderAlphaSlider_unstable, useAlphaSliderBase_unstable, useAlphaSliderStyles_unstable, useAlphaSlider_unstable } from "./AlphaSlider.js";
|
|
5
|
+
export { useColorPickerContextValue_unstable } from "./contexts/colorPicker.js";
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type {
|
|
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":"AAQA,SACEA,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,uBAAuB,QAClB,mBAAgB;AAQvB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,uBAAuB,QAClB,mBAAgB;AAQvB,SACEC,SAAS,EACTC,mBAAmB,EACnBC,wBAAwB,EACxBC,yBAAyB,EACzBC,2BAA2B,EAC3BC,qBAAqB,QAChB,iBAAc;AAQrB,SACEC,WAAW,EACXC,qBAAqB,EACrBC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,uBAAuB,QAClB,mBAAgB;AAEvB,SAASC,mCAAmC,QAAQ,4BAAyB"}
|
package/lib/types/color.js.map
CHANGED
|
@@ -1 +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"],"names":[],"mappings":"
|
|
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":"AAOA,WAKE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MIN, HUE_MAX, MAX as COLOR_MAX } from
|
|
2
|
-
import { clamp } from
|
|
1
|
+
import { MIN, HUE_MAX, MAX as COLOR_MAX } from "./constants.js";
|
|
2
|
+
import { clamp } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Clamps a given value to the valid range for a specified color channel.
|
|
5
5
|
*
|
|
@@ -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":"AACA,SAASA,GAAG,EAAEC,OAAO,EAAEC,OAAOC,SAAS,QAAQ,
|
|
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":"AACA,SAASA,GAAG,EAAEC,OAAO,EAAEC,OAAOC,SAAS,QAAQ,iBAAc;AAC7D,SAASC,KAAK,QAAQ,4BAA4B;AAElD;;;;;;CAMC,GACD,OAAO,SAASC,WAAWC,KAAa,EAAEC,UAAwB,KAAK;IACrE,MAAML,MAAMK,YAAY,QAAQN,UAAUE;IAC1C,OAAOC,MAAME,OAAON,KAAKE;AAC3B;AAQA;;;;;;;CAOC,GACD,OAAO,SAASM,cAAiBD,OAAqB,EAAEE,OAA0B;IAChF,OAAOA,OAAO,CAACF,QAAQ,IAAIE,QAAQC,GAAG;AACxC"}
|
package/lib/utils/constants.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { tinycolor } from '@ctrl/tinycolor';
|
|
2
1
|
export const MIN = 0;
|
|
3
2
|
export const MAX = 100;
|
|
4
3
|
export const HUE_MAX = 360;
|
|
5
4
|
export const INITIAL_COLOR = '#FFF';
|
|
6
|
-
export const INITIAL_COLOR_HSV =
|
|
5
|
+
export const INITIAL_COLOR_HSV = {
|
|
6
|
+
h: 0,
|
|
7
|
+
s: 0,
|
|
8
|
+
v: 1,
|
|
9
|
+
a: 1
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/constants.ts"],"sourcesContent":["
|
|
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":"AAAA,OAAO,MAAMA,MAAM,EAAE;AACrB,OAAO,MAAMC,MAAM,IAAI;AACvB,OAAO,MAAMC,UAAU,IAAI;AAC3B,OAAO,MAAMC,gBAAgB,OAAO;AACpC,OAAO,MAAMC,oBAAoB;IAAEC,GAAG;IAAGC,GAAG;IAAGC,GAAG;IAAGC,GAAG;AAAE,EAAE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
*/ export function createHslColor(color = {}) {
|
|
8
|
+
const { h = 0, s = 0, v = 0, a = 1 } = color;
|
|
9
|
+
const l = v * (1 - s / 2);
|
|
10
|
+
const hslSaturation = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);
|
|
11
|
+
return {
|
|
12
|
+
h,
|
|
13
|
+
s: hslSaturation,
|
|
14
|
+
l,
|
|
15
|
+
a
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Creates an HSL color string from a given HSV color object.
|
|
20
|
+
*
|
|
21
|
+
* @param color - HSV color object to convert to HSL string.
|
|
22
|
+
* @returns - HSL color string in the format of "hsla(h, s%, l%, a)".
|
|
23
|
+
*/ export function createHslColorString(color = {}) {
|
|
24
|
+
const hslColor = createHslColor(color);
|
|
25
|
+
const saturation = Number((hslColor.s * 100).toFixed(2));
|
|
26
|
+
const lightness = Number((hslColor.l * 100).toFixed(2));
|
|
27
|
+
return `hsla(${hslColor.h}, ${saturation}%, ${lightness}%, ${hslColor.a})`;
|
|
28
|
+
}
|
|
@@ -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,OAAO,SAASA,eAAeC,QAA2B,CAAC,CAAC;IAC1D,MAAM,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAEC,IAAI,CAAC,EAAE,GAAGJ;IACvC,MAAMK,IAAIF,IAAK,CAAA,IAAID,IAAI,CAAA;IACvB,MAAMI,gBAAgBD,MAAM,KAAKA,MAAM,IAAI,IAAI,AAACF,CAAAA,IAAIE,CAAAA,IAAKE,KAAKC,GAAG,CAACH,GAAG,IAAIA;IAEzE,OAAO;QAAEJ;QAAGC,GAAGI;QAAeD;QAAGD;IAAE;AACrC;AAEA;;;;;CAKC,GACD,OAAO,SAASK,qBAAqBT,QAA2B,CAAC,CAAC;IAChE,MAAMU,WAAWX,eAAeC;IAChC,MAAMW,aAAaC,OAAO,AAACF,CAAAA,SAASR,CAAC,GAAG,GAAE,EAAGW,OAAO,CAAC;IACrD,MAAMC,YAAYF,OAAO,AAACF,CAAAA,SAASL,CAAC,GAAG,GAAE,EAAGQ,OAAO,CAAC;IAEpD,OAAO,CAAC,KAAK,EAAEH,SAAST,CAAC,CAAC,EAAE,EAAEU,WAAW,GAAG,EAAEG,UAAU,GAAG,EAAEJ,SAASN,CAAC,CAAC,CAAC,CAAC;AAC5E"}
|
|
@@ -21,6 +21,9 @@ _export(exports, {
|
|
|
21
21
|
renderAlphaSlider_unstable: function() {
|
|
22
22
|
return _index.renderAlphaSlider_unstable;
|
|
23
23
|
},
|
|
24
|
+
useAlphaSliderBase_unstable: function() {
|
|
25
|
+
return _index.useAlphaSliderBase_unstable;
|
|
26
|
+
},
|
|
24
27
|
useAlphaSliderStyles_unstable: function() {
|
|
25
28
|
return _index.useAlphaSliderStyles_unstable;
|
|
26
29
|
},
|
|
@@ -28,4 +31,4 @@ _export(exports, {
|
|
|
28
31
|
return _index.useAlphaSlider_unstable;
|
|
29
32
|
}
|
|
30
33
|
});
|
|
31
|
-
const _index = require("./components/AlphaSlider/index");
|
|
34
|
+
const _index = require("./components/AlphaSlider/index.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/AlphaSlider.ts"],"sourcesContent":["export type {\n AlphaSliderBaseProps,\n AlphaSliderBaseState,\n AlphaSliderProps,\n AlphaSliderSlots,\n AlphaSliderState,\n} from './components/AlphaSlider/index';\nexport {\n AlphaSlider,\n alphaSliderCSSVars,\n alphaSliderClassNames,\n renderAlphaSlider_unstable,\n useAlphaSliderBase_unstable,\n useAlphaSliderStyles_unstable,\n useAlphaSlider_unstable,\n} from './components/AlphaSlider/index';\n"],"names":["AlphaSlider","alphaSliderCSSVars","alphaSliderClassNames","renderAlphaSlider_unstable","useAlphaSliderBase_unstable","useAlphaSliderStyles_unstable","useAlphaSlider_unstable"],"mappings":";;;;;;;;;;;;eAQEA,kBAAW;;;eACXC,yBAAkB;;;eAClBC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,kCAA2B;;;eAC3BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,oCAAiC"}
|
|
@@ -21,6 +21,9 @@ _export(exports, {
|
|
|
21
21
|
renderColorArea_unstable: function() {
|
|
22
22
|
return _index.renderColorArea_unstable;
|
|
23
23
|
},
|
|
24
|
+
useColorAreaBase_unstable: function() {
|
|
25
|
+
return _index.useColorAreaBase_unstable;
|
|
26
|
+
},
|
|
24
27
|
useColorAreaStyles_unstable: function() {
|
|
25
28
|
return _index.useColorAreaStyles_unstable;
|
|
26
29
|
},
|
|
@@ -28,4 +31,4 @@ _export(exports, {
|
|
|
28
31
|
return _index.useColorArea_unstable;
|
|
29
32
|
}
|
|
30
33
|
});
|
|
31
|
-
const _index = require("./components/ColorArea/index");
|
|
34
|
+
const _index = require("./components/ColorArea/index.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorArea.ts"],"sourcesContent":["export type {\n ColorAreaBaseProps,\n ColorAreaBaseState,\n ColorAreaOnColorChangeData,\n ColorAreaProps,\n ColorAreaSlots,\n ColorAreaState,\n} from './components/ColorArea/index';\nexport {\n ColorArea,\n colorAreaCSSVars,\n colorAreaClassNames,\n renderColorArea_unstable,\n useColorAreaBase_unstable,\n useColorAreaStyles_unstable,\n useColorArea_unstable,\n} from './components/ColorArea/index';\n"],"names":["ColorArea","colorAreaCSSVars","colorAreaClassNames","renderColorArea_unstable","useColorAreaBase_unstable","useColorAreaStyles_unstable","useColorArea_unstable"],"mappings":";;;;;;;;;;;;eASEA,gBAAS;;;eACTC,uBAAgB;;;eAChBC,0BAAmB;;;eACnBC,+BAAwB;;;eACxBC,gCAAyB;;;eACzBC,kCAA2B;;;eAC3BC,4BAAqB;;;uBAChB,kCAA+B"}
|
|
@@ -18,6 +18,15 @@ _export(exports, {
|
|
|
18
18
|
renderColorPicker_unstable: function() {
|
|
19
19
|
return _index.renderColorPicker_unstable;
|
|
20
20
|
},
|
|
21
|
+
useColorPickerBaseContextValues_unstable: function() {
|
|
22
|
+
return _index.useColorPickerBaseContextValues_unstable;
|
|
23
|
+
},
|
|
24
|
+
useColorPickerBase_unstable: function() {
|
|
25
|
+
return _index.useColorPickerBase_unstable;
|
|
26
|
+
},
|
|
27
|
+
useColorPickerContextValues: function() {
|
|
28
|
+
return _index.useColorPickerContextValues;
|
|
29
|
+
},
|
|
21
30
|
useColorPickerStyles_unstable: function() {
|
|
22
31
|
return _index.useColorPickerStyles_unstable;
|
|
23
32
|
},
|
|
@@ -25,4 +34,4 @@ _export(exports, {
|
|
|
25
34
|
return _index.useColorPicker_unstable;
|
|
26
35
|
}
|
|
27
36
|
});
|
|
28
|
-
const _index = require("./components/ColorPicker/index");
|
|
37
|
+
const _index = require("./components/ColorPicker/index.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorPicker.ts"],"sourcesContent":["export type {\n ColorPickerBaseProps,\n ColorPickerBaseState,\n ColorPickerOnChangeData,\n ColorPickerProps,\n ColorPickerSlots,\n ColorPickerState,\n} from './components/ColorPicker/index';\nexport {\n ColorPicker,\n colorPickerClassNames,\n renderColorPicker_unstable,\n useColorPickerBaseContextValues_unstable,\n useColorPickerBase_unstable,\n useColorPickerContextValues,\n useColorPickerStyles_unstable,\n useColorPicker_unstable,\n} from './components/ColorPicker/index';\n"],"names":["ColorPicker","colorPickerClassNames","renderColorPicker_unstable","useColorPickerBaseContextValues_unstable","useColorPickerBase_unstable","useColorPickerContextValues","useColorPickerStyles_unstable","useColorPicker_unstable"],"mappings":";;;;;;;;;;;IASEA;iCAAW;;;eACXC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,+CAAwC;;;eACxCC,kCAA2B;;;eAC3BC,kCAA2B;;;eAC3BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,oCAAiC"}
|
|
@@ -21,6 +21,9 @@ _export(exports, {
|
|
|
21
21
|
renderColorSlider_unstable: function() {
|
|
22
22
|
return _index.renderColorSlider_unstable;
|
|
23
23
|
},
|
|
24
|
+
useColorSliderBase_unstable: function() {
|
|
25
|
+
return _index.useColorSliderBase_unstable;
|
|
26
|
+
},
|
|
24
27
|
useColorSliderStyles_unstable: function() {
|
|
25
28
|
return _index.useColorSliderStyles_unstable;
|
|
26
29
|
},
|
|
@@ -28,4 +31,4 @@ _export(exports, {
|
|
|
28
31
|
return _index.useColorSlider_unstable;
|
|
29
32
|
}
|
|
30
33
|
});
|
|
31
|
-
const _index = require("./components/ColorSlider/index");
|
|
34
|
+
const _index = require("./components/ColorSlider/index.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ColorSlider.ts"],"sourcesContent":["export type {\n ColorChannel,\n ColorSliderBaseProps,\n ColorSliderBaseState,\n ColorSliderProps,\n ColorSliderSlots,\n ColorSliderState,\n SliderOnChangeData,\n} from './components/ColorSlider/index';\nexport {\n ColorSlider,\n colorSliderCSSVars,\n colorSliderClassNames,\n renderColorSlider_unstable,\n useColorSliderBase_unstable,\n useColorSliderStyles_unstable,\n useColorSlider_unstable,\n} from './components/ColorSlider/index';\n"],"names":["ColorSlider","colorSliderCSSVars","colorSliderClassNames","renderColorSlider_unstable","useColorSliderBase_unstable","useColorSliderStyles_unstable","useColorSlider_unstable"],"mappings":";;;;;;;;;;;;eAUEA,kBAAW;;;eACXC,yBAAkB;;;eAClBC,4BAAqB;;;eACrBC,iCAA0B;;;eAC1BC,kCAA2B;;;eAC3BC,oCAA6B;;;eAC7BC,8BAAuB;;;uBAClB,oCAAiC"}
|
|
@@ -11,9 +11,9 @@ Object.defineProperty(exports, "AlphaSlider", {
|
|
|
11
11
|
});
|
|
12
12
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
13
13
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
14
|
-
const _useAlphaSlider = require("./useAlphaSlider");
|
|
15
|
-
const _renderAlphaSlider = require("./renderAlphaSlider");
|
|
16
|
-
const _useAlphaSliderStylesstyles = require("./useAlphaSliderStyles.styles");
|
|
14
|
+
const _useAlphaSlider = require("./useAlphaSlider.cjs");
|
|
15
|
+
const _renderAlphaSlider = require("./renderAlphaSlider.cjs");
|
|
16
|
+
const _useAlphaSliderStylesstyles = require("./useAlphaSliderStyles.styles.cjs");
|
|
17
17
|
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
18
18
|
const AlphaSlider = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
19
19
|
const state = (0, _useAlphaSlider.useAlphaSlider_unstable)(props, ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAlphaSlider_unstable } from './useAlphaSlider';\nimport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nimport { useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';\nimport type { AlphaSliderProps } from './AlphaSlider.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * AlphaSlider component\n */\nexport const AlphaSlider: ForwardRefComponent<AlphaSliderProps> = React.forwardRef((props, ref) => {\n const state = useAlphaSlider_unstable(props, ref);\n\n useAlphaSliderStyles_unstable(state);\n useCustomStyleHook_unstable('useAlphaSliderStyles_unstable')(state);\n\n return renderAlphaSlider_unstable(state);\n});\n\nAlphaSlider.displayName = 'AlphaSlider';\n"],"names":["React","useAlphaSlider_unstable","renderAlphaSlider_unstable","useAlphaSliderStyles_unstable","useCustomStyleHook_unstable","AlphaSlider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;gCAES,
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useAlphaSlider_unstable } from './useAlphaSlider';\nimport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nimport { useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';\nimport type { AlphaSliderProps } from './AlphaSlider.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * AlphaSlider component\n */\nexport const AlphaSlider: ForwardRefComponent<AlphaSliderProps> = React.forwardRef((props, ref) => {\n const state = useAlphaSlider_unstable(props, ref);\n\n useAlphaSliderStyles_unstable(state);\n useCustomStyleHook_unstable('useAlphaSliderStyles_unstable')(state);\n\n return renderAlphaSlider_unstable(state);\n});\n\nAlphaSlider.displayName = 'AlphaSlider';\n"],"names":["React","useAlphaSlider_unstable","renderAlphaSlider_unstable","useAlphaSliderStyles_unstable","useCustomStyleHook_unstable","AlphaSlider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;gCAES,sBAAmB;mCAChB,yBAAsB;4CACnB,mCAAgC;qCAElC,kCAAkC;AAKvE,MAAMK,cAAAA,WAAAA,GAAqDL,OAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,YAAQR,uCAAAA,EAAwBM,OAAOC;QAE7CL,yDAAAA,EAA8BM;QAC9BL,gDAAAA,EAA4B,iCAAiCK;IAE7D,WAAOP,6CAAAA,EAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "alphaSliderCSSVars", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return alphaSliderCSSVars;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const alphaSliderCSSVars = {
|
|
12
|
+
sliderDirectionVar: `--fui-AlphaSlider--direction`,
|
|
13
|
+
sliderProgressVar: `--fui-AlphaSlider--progress`,
|
|
14
|
+
thumbColorVar: `--fui-AlphaSlider__thumb--color`,
|
|
15
|
+
railColorVar: `--fui-AlphaSlider__rail--color`
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.constants.ts"],"sourcesContent":["export 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"],"names":["alphaSliderCSSVars","sliderDirectionVar","sliderProgressVar","thumbColorVar","railColorVar"],"mappings":";;;;;;;;;;AAAO,MAAMA,qBAAqB;IAChCC,oBAAoB,CAAC,4BAA4B,CAAC;IAClDC,mBAAmB,CAAC,2BAA2B,CAAC;IAChDC,eAAe,CAAC,+BAA+B,CAAC;IAChDC,cAAc,CAAC,8BAA8B,CAAC;AAChD,EAAE"}
|
package/lib-commonjs/components/AlphaSlider/{AlphaSlider.types.js.map → AlphaSlider.types.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.types.ts"],"sourcesContent":["import type { ComponentState } from '@fluentui/react-utilities';\nimport type { ColorSliderSlots, ColorSliderProps, ColorSliderState } from '../ColorSlider/ColorSlider.types';\n\nexport type AlphaSliderSlots = ColorSliderSlots;\n\n/**\n * AlphaSlider Props\n */\nexport type AlphaSliderProps = Omit<ColorSliderProps, 'channel'> & {\n /**\n * The `transparency` property determines how the alpha channel is interpreted.\n * - When `false`, the alpha channel represents the opacity of the color.\n * - When `true`, the alpha channel represents the transparency of the color.\n * For example, a 30% transparent color has 70% opacity.\n *\n * @defaultvalue false\n */\n transparency?: boolean;\n};\n\n/**\n * State used in rendering AlphaSlider\n */\nexport type AlphaSliderState = ComponentState<AlphaSliderSlots> &\n Pick<AlphaSliderProps, 'vertical'> &\n Omit<ColorSliderState, keyof ColorSliderSlots | 'components'>;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/AlphaSlider.types.ts"],"sourcesContent":["import type { ComponentState } from '@fluentui/react-utilities';\nimport type { ColorSliderSlots, ColorSliderProps, ColorSliderState } from '../ColorSlider/ColorSlider.types';\n\nexport type AlphaSliderSlots = ColorSliderSlots;\n\n/**\n * AlphaSlider Props\n */\nexport type AlphaSliderProps = Omit<ColorSliderProps, 'channel'> & {\n /**\n * The `transparency` property determines how the alpha channel is interpreted.\n * - When `false`, the alpha channel represents the opacity of the color.\n * - When `true`, the alpha channel represents the transparency of the color.\n * For example, a 30% transparent color has 70% opacity.\n *\n * @defaultvalue false\n */\n transparency?: boolean;\n};\n\n/**\n * AlphaSlider Base Props\n */\nexport type AlphaSliderBaseProps = Omit<AlphaSliderProps, 'shape'>;\n\n/**\n * State used in rendering AlphaSlider\n */\nexport type AlphaSliderState = ComponentState<AlphaSliderSlots> &\n Pick<AlphaSliderProps, 'vertical'> &\n Omit<ColorSliderState, keyof ColorSliderSlots | 'components'>;\n\n/**\n * State used in rendering unstyled AlphaSlider\n */\nexport type AlphaSliderBaseState = Omit<AlphaSliderState, 'shape'>;\n"],"names":[],"mappings":"AAgCA;;CAEC,GACD,WAAmE"}
|
|
@@ -13,7 +13,7 @@ _export(exports, {
|
|
|
13
13
|
return _AlphaSlider.AlphaSlider;
|
|
14
14
|
},
|
|
15
15
|
alphaSliderCSSVars: function() {
|
|
16
|
-
return
|
|
16
|
+
return _AlphaSliderconstants.alphaSliderCSSVars;
|
|
17
17
|
},
|
|
18
18
|
alphaSliderClassNames: function() {
|
|
19
19
|
return _useAlphaSliderStylesstyles.alphaSliderClassNames;
|
|
@@ -21,6 +21,9 @@ _export(exports, {
|
|
|
21
21
|
renderAlphaSlider_unstable: function() {
|
|
22
22
|
return _renderAlphaSlider.renderAlphaSlider_unstable;
|
|
23
23
|
},
|
|
24
|
+
useAlphaSliderBase_unstable: function() {
|
|
25
|
+
return _useAlphaSlider.useAlphaSliderBase_unstable;
|
|
26
|
+
},
|
|
24
27
|
useAlphaSliderStyles_unstable: function() {
|
|
25
28
|
return _useAlphaSliderStylesstyles.useAlphaSliderStyles_unstable;
|
|
26
29
|
},
|
|
@@ -28,7 +31,8 @@ _export(exports, {
|
|
|
28
31
|
return _useAlphaSlider.useAlphaSlider_unstable;
|
|
29
32
|
}
|
|
30
33
|
});
|
|
31
|
-
const _AlphaSlider = require("./AlphaSlider");
|
|
32
|
-
const _renderAlphaSlider = require("./renderAlphaSlider");
|
|
33
|
-
const _useAlphaSlider = require("./useAlphaSlider");
|
|
34
|
-
const _useAlphaSliderStylesstyles = require("./useAlphaSliderStyles.styles");
|
|
34
|
+
const _AlphaSlider = require("./AlphaSlider.cjs");
|
|
35
|
+
const _renderAlphaSlider = require("./renderAlphaSlider.cjs");
|
|
36
|
+
const _useAlphaSlider = require("./useAlphaSlider.cjs");
|
|
37
|
+
const _useAlphaSliderStylesstyles = require("./useAlphaSliderStyles.styles.cjs");
|
|
38
|
+
const _AlphaSliderconstants = require("./AlphaSlider.constants.cjs");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/index.ts"],"sourcesContent":["export { AlphaSlider } from './AlphaSlider';\nexport type {\n AlphaSliderBaseProps,\n AlphaSliderBaseState,\n AlphaSliderProps,\n AlphaSliderSlots,\n AlphaSliderState,\n} from './AlphaSlider.types';\nexport { renderAlphaSlider_unstable } from './renderAlphaSlider';\nexport { useAlphaSliderBase_unstable, useAlphaSlider_unstable } from './useAlphaSlider';\nexport { alphaSliderClassNames, useAlphaSliderStyles_unstable } from './useAlphaSliderStyles.styles';\nexport { alphaSliderCSSVars } from './AlphaSlider.constants';\n"],"names":["AlphaSlider","renderAlphaSlider_unstable","useAlphaSliderBase_unstable","useAlphaSlider_unstable","alphaSliderClassNames","useAlphaSliderStyles_unstable","alphaSliderCSSVars"],"mappings":";;;;;;;;;;;IAASA;uCAAW;;IAWXM;uDAAkB;;;eADlBF,iDAAqB;;;eAFrBH,6CAA0B;;;eAC1BC,2CAA2B;;;eACJG,yDAA6B;;;eADvBF,uCAAuB;;;6BATjC,mBAAgB;mCAQD,yBAAsB;gCACI,sBAAmB;4CACnB,mCAAgC;sCAClE,6BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/AlphaSlider/renderAlphaSlider.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { AlphaSliderBaseState, AlphaSliderSlots } from './AlphaSlider.types';\n\n/**\n * Render the final JSX of AlphaSlider\n */\nexport const renderAlphaSlider_unstable = (state: AlphaSliderBaseState): 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"}
|
|
@@ -3,17 +3,32 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
useAlphaSliderBase_unstable: function() {
|
|
14
|
+
return useAlphaSliderBase_unstable;
|
|
15
|
+
},
|
|
16
|
+
useAlphaSlider_unstable: function() {
|
|
9
17
|
return useAlphaSlider_unstable;
|
|
10
18
|
}
|
|
11
19
|
});
|
|
12
20
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
13
|
-
const _useAlphaSliderState = require("./useAlphaSliderState");
|
|
14
|
-
const _colorPicker = require("../../contexts/colorPicker");
|
|
21
|
+
const _useAlphaSliderState = require("./useAlphaSliderState.cjs");
|
|
22
|
+
const _colorPicker = require("../../contexts/colorPicker.cjs");
|
|
15
23
|
const useAlphaSlider_unstable = (props, ref)=>{
|
|
16
24
|
const shapeFromContext = (0, _colorPicker.useColorPickerContextValue_unstable)((ctx)=>ctx.shape);
|
|
25
|
+
const { shape = shapeFromContext, ...baseProps } = props;
|
|
26
|
+
return {
|
|
27
|
+
...useAlphaSliderBase_unstable(baseProps, ref),
|
|
28
|
+
shape
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const useAlphaSliderBase_unstable = (props, ref)=>{
|
|
17
32
|
const nativeProps = (0, _reactutilities.getPartitionedNativeProps)({
|
|
18
33
|
props,
|
|
19
34
|
primarySlotTagName: 'input',
|
|
@@ -22,9 +37,8 @@ const useAlphaSlider_unstable = (props, ref)=>{
|
|
|
22
37
|
'color'
|
|
23
38
|
]
|
|
24
39
|
});
|
|
25
|
-
const {
|
|
40
|
+
const { vertical, root, input, rail, thumb } = props;
|
|
26
41
|
const state = {
|
|
27
|
-
shape,
|
|
28
42
|
vertical,
|
|
29
43
|
components: {
|
|
30
44
|
input: 'input',
|
|
@@ -0,0 +1 @@
|
|
|
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 {\n AlphaSliderBaseProps,\n AlphaSliderBaseState,\n AlphaSliderProps,\n AlphaSliderState,\n} 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 { shape = shapeFromContext, ...baseProps } = props;\n\n return {\n ...useAlphaSliderBase_unstable(baseProps, ref),\n shape,\n };\n};\n\nexport const useAlphaSliderBase_unstable = (\n props: AlphaSliderBaseProps,\n ref: React.Ref<HTMLInputElement>,\n): AlphaSliderBaseState => {\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'input',\n excludedPropNames: ['onChange', 'color'],\n });\n\n const {\n vertical,\n // Slots\n root,\n input,\n rail,\n thumb,\n } = props;\n\n const state: AlphaSliderBaseState = {\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","baseProps","useAlphaSliderBase_unstable","nativeProps","primarySlotTagName","excludedPropNames","vertical","root","input","rail","thumb","state","components","always","defaultProps","elementType","id","primary","type"],"mappings":"AAAA;;;;;;;;;;;;IAmCaY,2BAAAA;;;2BAbAP;;;;gCAnB0C,4BAA4B;qCAOtC,2BAAwB;6BACjB,gCAA6B;AAW1E,MAAMA,0BAA0B,CACrCC,OACAC;IAEA,MAAMC,uBAAmBJ,gDAAAA,EAAoCK,CAAAA,MAAOA,IAAIC,KAAK;IAC7E,MAAM,EAAEA,QAAQF,gBAAgB,EAAE,GAAGG,WAAW,GAAGL;IAEnD,OAAO;QACL,GAAGM,4BAA4BD,WAAWJ,IAAI;QAC9CG;IACF;AACF,EAAE;AAEK,oCAAoC,CACzCJ,OACAC;IAEA,MAAMM,cAAcb,6CAAAA,EAA0B;QAC5CM;QACAQ,oBAAoB;QACpBC,mBAAmB;YAAC;YAAY;SAAQ;IAC1C;IAEA,MAAM,EACJC,QAAQ,EACR,AACAC,IAAI,EACJC,EAFQ,GAEH,EACLC,IAAI,EACJC,KAAK,EACN,GAAGd;IAEJ,MAAMe,QAA8B;QAClCL;QACAM,YAAY;YACVJ,OAAO;YACPC,MAAM;YACNF,MAAM;YACNG,OAAO;QACT;QACAH,MAAMf,oBAAAA,CAAKqB,MAAM,CAACN,MAAM;YACtBO,cAAcX,YAAYI,IAAI;YAC9BQ,aAAa;QACf;QACAP,OAAOhB,oBAAAA,CAAKqB,MAAM,CAACL,OAAO;YACxBM,cAAc;gBACZE,QAAIzB,qBAAAA,EAAM,WAAWK,MAAMoB,EAAE;gBAC7BnB;gBACA,GAAGM,YAAYc,OAAO;gBACtBC,MAAM;YACR;YACAH,aAAa;QACf;QACAN,MAAMjB,oBAAAA,CAAKqB,MAAM,CAACJ,MAAM;YAAEM,aAAa;QAAM;QAC7CL,OAAOlB,oBAAAA,CAAKqB,MAAM,CAACH,OAAO;YAAEK,aAAa;QAAM;IACjD;QAEAtB,iDAAAA,EAA6BkB,OAAOf;IAEpC,OAAOe;AACT,EAAE"}
|