@fluentui/react-swatch-picker 9.1.3 → 9.1.5
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 +31 -2
- package/lib/ColorSwatch.js.map +1 -1
- package/lib/EmptySwatch.js.map +1 -1
- package/lib/ImageSwatch.js.map +1 -1
- package/lib/SwatchPicker.js.map +1 -1
- package/lib/SwatchPickerRow.js.map +1 -1
- package/lib/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/lib/components/ColorSwatch/ColorSwatch.types.js +3 -1
- package/lib/components/ColorSwatch/ColorSwatch.types.js.map +1 -1
- package/lib/components/ColorSwatch/index.js.map +1 -1
- package/lib/components/ColorSwatch/renderColorSwatch.js.map +1 -1
- package/lib/components/ColorSwatch/useColorSwatch.js.map +1 -1
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js +16 -11
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js.map +1 -1
- package/lib/components/EmptySwatch/EmptySwatch.js.map +1 -1
- package/lib/components/EmptySwatch/EmptySwatch.types.js +3 -1
- package/lib/components/EmptySwatch/EmptySwatch.types.js.map +1 -1
- package/lib/components/EmptySwatch/index.js.map +1 -1
- package/lib/components/EmptySwatch/renderEmptySwatch.js.map +1 -1
- package/lib/components/EmptySwatch/useEmptySwatch.js.map +1 -1
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js +2 -0
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -1
- package/lib/components/ImageSwatch/ImageSwatch.js.map +1 -1
- package/lib/components/ImageSwatch/ImageSwatch.types.js +3 -1
- package/lib/components/ImageSwatch/ImageSwatch.types.js.map +1 -1
- package/lib/components/ImageSwatch/index.js.map +1 -1
- package/lib/components/ImageSwatch/renderImageSwatch.js.map +1 -1
- package/lib/components/ImageSwatch/useImageSwatch.js.map +1 -1
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js +8 -6
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js.map +1 -1
- package/lib/components/SwatchPicker/SwatchPicker.js.map +1 -1
- package/lib/components/SwatchPicker/SwatchPicker.types.js.map +1 -1
- package/lib/components/SwatchPicker/index.js.map +1 -1
- package/lib/components/SwatchPicker/renderSwatchPicker.js.map +1 -1
- package/lib/components/SwatchPicker/useSwatchPicker.js.map +1 -1
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js +2 -0
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +1 -1
- package/lib/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -1
- package/lib/components/SwatchPickerRow/SwatchPickerRow.types.js +3 -1
- package/lib/components/SwatchPickerRow/SwatchPickerRow.types.js.map +1 -1
- package/lib/components/SwatchPickerRow/index.js.map +1 -1
- package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js.map +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js +2 -0
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +1 -1
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/swatchPicker.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utils/renderUtils.js.map +1 -1
- package/lib-commonjs/ColorSwatch.js.map +1 -1
- package/lib-commonjs/EmptySwatch.js.map +1 -1
- package/lib-commonjs/ImageSwatch.js.map +1 -1
- package/lib-commonjs/SwatchPicker.js.map +1 -1
- package/lib-commonjs/SwatchPickerRow.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.types.js +3 -1
- package/lib-commonjs/components/ColorSwatch/ColorSwatch.types.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/index.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/renderColorSwatch.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/useColorSwatch.js.map +1 -1
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.js +28 -20
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.types.js +3 -1
- package/lib-commonjs/components/EmptySwatch/EmptySwatch.types.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/index.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/renderEmptySwatch.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/useEmptySwatch.js.map +1 -1
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.js +1 -0
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.types.js +3 -1
- package/lib-commonjs/components/ImageSwatch/ImageSwatch.types.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/index.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/renderImageSwatch.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/useImageSwatch.js.map +1 -1
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.js +13 -12
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/SwatchPicker.types.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/index.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/renderSwatchPicker.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/useSwatchPicker.js.map +1 -1
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.js +1 -0
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.types.js +3 -1
- package/lib-commonjs/components/SwatchPickerRow/SwatchPickerRow.types.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/index.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/renderSwatchPickerRow.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -1
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js +1 -0
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/index.js.map +1 -1
- package/lib-commonjs/contexts/swatchPicker.js +5 -5
- package/lib-commonjs/contexts/swatchPicker.js.map +1 -1
- package/lib-commonjs/index.js +55 -55
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utils/renderUtils.js.map +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["ImageSwatch.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type ImageSwatchSlots = {\n root: Slot<'button'>;\n};\n\n/**\n * ImageSwatch Props\n */\nexport type ImageSwatchProps = ComponentProps<ImageSwatchSlots> &\n Pick<SwatchPickerProps, 'size' | 'shape'> & {\n /**\n * Swatch color\n */\n src: string;\n\n /**\n * Swatch value\n */\n value: string;\n };\n\n/**\n * State used in rendering ImageSwatch\n */\nexport type ImageSwatchState = ComponentState<ImageSwatchSlots> &\n Pick<ImageSwatchProps, 'color' | 'size' | 'shape' | 'value'> & {\n selected: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAuBA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ImageSwatch';\nexport * from './ImageSwatch.types';\nexport * from './renderImageSwatch';\nexport * from './useImageSwatch';\nexport * from './useImageSwatchStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderImageSwatch.
|
|
1
|
+
{"version":3,"sources":["renderImageSwatch.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { ImageSwatchState, ImageSwatchSlots } from './ImageSwatch.types';\n\n/**\n * Render the final JSX of ImageSwatch\n */\nexport const renderImageSwatch_unstable = (state: ImageSwatchState) => {\n assertSlots<ImageSwatchSlots>(state);\n\n return <state.root />;\n};\n"],"names":["renderImageSwatch_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,6BAA6B,CAACC;IACzCC,IAAAA,2BAAAA,EAA8BD;IAE9B,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useImageSwatch.
|
|
1
|
+
{"version":3,"sources":["useImageSwatch.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useEventCallback, mergeCallbacks } from '@fluentui/react-utilities';\nimport type { ImageSwatchProps, ImageSwatchState } from './ImageSwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the state required to render ImageSwatch.\n *\n * The returned state can be modified with hooks such as useImageSwatchStyles_unstable,\n * before being passed to renderImageSwatch_unstable.\n *\n * @param props - props from this instance of ImageSwatch\n * @param ref - reference to root HTMLDivElement of ImageSwatch\n */\nexport const useImageSwatch_unstable = (\n props: ImageSwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): ImageSwatchState => {\n const { src, value, onClick, style, ...rest } = props;\n const size = useSwatchPickerContextValue_unstable(ctx => ctx.size);\n const shape = useSwatchPickerContextValue_unstable(ctx => ctx.shape);\n const isGrid = useSwatchPickerContextValue_unstable(ctx => ctx.isGrid);\n\n const requestSelectionChange = useSwatchPickerContextValue_unstable(ctx => ctx.requestSelectionChange);\n const selected = useSwatchPickerContextValue_unstable(ctx => ctx.selectedValue === value);\n\n const role = isGrid ? 'gridcell' : 'radio';\n const ariaSelected = isGrid\n ? {\n 'aria-selected': selected,\n }\n : { 'aria-checked': selected };\n\n const onImageSwatchClick = useEventCallback(\n mergeCallbacks(onClick, (event: React.MouseEvent<HTMLButtonElement>) =>\n requestSelectionChange(event, {\n selectedValue: value,\n selectedSwatch: src,\n }),\n ),\n );\n\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...ariaSelected,\n onClick: onImageSwatchClick,\n ...rest,\n style: {\n backgroundImage: `url(${src})`,\n ...style,\n },\n }),\n { elementType: 'button' },\n ),\n value,\n selected,\n size,\n shape,\n };\n};\n"],"names":["useImageSwatch_unstable","props","ref","src","value","onClick","style","rest","size","useSwatchPickerContextValue_unstable","ctx","shape","isGrid","requestSelectionChange","selected","selectedValue","role","ariaSelected","onImageSwatchClick","useEventCallback","mergeCallbacks","event","selectedSwatch","components","root","slot","always","getIntrinsicElementProps","backgroundImage","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;;iEAdU;gCAC0D;8BAE5B;AAW9C,MAAMA,0BAA0B,CACrCC,OACAC;IAEA,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAChD,MAAMO,OAAOC,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIF,IAAI;IACjE,MAAMG,QAAQF,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIC,KAAK;IACnE,MAAMC,SAASH,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIE,MAAM;IAErE,MAAMC,yBAAyBJ,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIG,sBAAsB;IACrG,MAAMC,WAAWL,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIK,aAAa,KAAKX;IAEnF,MAAMY,OAAOJ,SAAS,aAAa;IACnC,MAAMK,eAAeL,SACjB;QACE,iBAAiBE;IACnB,IACA;QAAE,gBAAgBA;IAAS;IAE/B,MAAMI,qBAAqBC,IAAAA,gCAAAA,EACzBC,IAAAA,8BAAAA,EAAef,SAAS,CAACgB,QACvBR,uBAAuBQ,OAAO;YAC5BN,eAAeX;YACfkB,gBAAgBnB;QAClB;IAIJ,OAAO;QACLoB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,UAAU;YACjCzB;YACAc;YACA,GAAGC,YAAY;YACfZ,SAASa;YACT,GAAGX,IAAI;YACPD,OAAO;gBACLsB,iBAAiB,CAAC,IAAI,EAAEzB,IAAI,CAAC,CAAC;gBAC9B,GAAGG,KAAK;YACV;QACF,IACA;YAAEuB,aAAa;QAAS;QAE1BzB;QACAU;QACAN;QACAG;IACF;AACF"}
|
|
@@ -22,17 +22,17 @@ const imageSwatchClassNames = {
|
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
24
|
* Styles for the root slot
|
|
25
|
-
*/ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("
|
|
25
|
+
*/ const useStyles = /*#__PURE__*/ (0, _react.__resetStyles)("r18b5q7m", null, {
|
|
26
26
|
r: [
|
|
27
|
-
".
|
|
28
|
-
".
|
|
29
|
-
".
|
|
30
|
-
".
|
|
31
|
-
".
|
|
32
|
-
".
|
|
27
|
+
".r18b5q7m{display:inline-flex;box-sizing:border-box;border:1px solid var(--colorTransparentStroke);background-size:cover;background-repeat:no-repeat;padding:0;}",
|
|
28
|
+
".r18b5q7m:hover{cursor:pointer;border:none;box-shadow:inset 0 0 0 var(--strokeWidthThick) var(--colorBrandStroke1),inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);}",
|
|
29
|
+
".r18b5q7m:hover:active{border:none;box-shadow:inset 0 0 0 var(--strokeWidthThicker) var(--colorCompoundBrandStrokePressed),inset 0 0 0 var(--strokeWidthThickest) var(--colorStrokeFocus1);}",
|
|
30
|
+
".r18b5q7m:focus{outline:none;}",
|
|
31
|
+
".r18b5q7m:focus-visible{outline:none;}",
|
|
32
|
+
".r18b5q7m[data-fui-focus-visible]{border:none;outline:none;box-shadow:inset 0 0 0 var(--strokeWidthThick) var(--colorStrokeFocus2),inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);}"
|
|
33
33
|
],
|
|
34
34
|
s: [
|
|
35
|
-
"@media (forced-colors: active){.
|
|
35
|
+
"@media (forced-colors: active){.r18b5q7m{forced-color-adjust:none;}.r18b5q7m:hover{box-shadow:inset 0 0 0 var(--strokeWidthThick) var(--colorBrandStroke2Hover),inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus1);}.r18b5q7m:hover:active{box-shadow:inset 0 0 0 var(--strokeWidthThicker) var(--colorBrandStroke2Pressed),inset 0 0 0 var(--strokeWidthThickest) var(--colorStrokeFocus1);}}"
|
|
36
36
|
]
|
|
37
37
|
});
|
|
38
38
|
const useStylesSelected = /*#__PURE__*/ (0, _react.__styles)({
|
|
@@ -55,8 +55,8 @@ const useStylesSelected = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
55
55
|
B4j52fo: 0,
|
|
56
56
|
irswps: "f3bhgqh",
|
|
57
57
|
E5pizo: "f8ps3yo",
|
|
58
|
-
Bvxd0ez: "
|
|
59
|
-
vajtyg: "
|
|
58
|
+
Bvxd0ez: "f106r15f",
|
|
59
|
+
vajtyg: "ft0nc49",
|
|
60
60
|
j6ew2k: "f16jq8vy",
|
|
61
61
|
Bspt33j: "f18nq7tj"
|
|
62
62
|
}
|
|
@@ -72,8 +72,8 @@ const useStylesSelected = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
72
72
|
".f16jq8vy[data-fui-focus-visible]{box-shadow:inset 0 0 0 var(--strokeWidthThicker) var(--colorStrokeFocus2),inset 0 0 0 5px var(--colorStrokeFocus1);}"
|
|
73
73
|
],
|
|
74
74
|
h: [
|
|
75
|
-
".
|
|
76
|
-
".
|
|
75
|
+
".f106r15f:hover{box-shadow:inset 0 0 0 var(--strokeWidthThickest) var(--colorCompoundBrandStrokeHover),inset 0 0 0 6px var(--colorStrokeFocus1);}",
|
|
76
|
+
".ft0nc49:hover:active{box-shadow:inset 0 0 0 var(--strokeWidthThickest) var(--colorCompoundBrandStrokePressed),inset 0 0 0 7px var(--colorStrokeFocus1);}"
|
|
77
77
|
],
|
|
78
78
|
m: [
|
|
79
79
|
[
|
|
@@ -191,6 +191,7 @@ const useShapeStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
191
191
|
]
|
|
192
192
|
});
|
|
193
193
|
const useImageSwatchStyles_unstable = (state)=>{
|
|
194
|
+
'use no memo';
|
|
194
195
|
const styles = useStyles();
|
|
195
196
|
const selectedStyles = useStylesSelected();
|
|
196
197
|
const sizeStyles = useSizeStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useImageSwatchStyles.styles.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useImageSwatchStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses, makeResetStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nexport const imageSwatchClassNames = {\n root: 'fui-ImageSwatch'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeResetStyles({\n display: 'inline-flex',\n boxSizing: 'border-box',\n border: `1px solid ${tokens.colorTransparentStroke}`,\n backgroundSize: 'cover',\n backgroundRepeat: 'no-repeat',\n padding: '0',\n ':hover': {\n cursor: 'pointer',\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke1}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`\n },\n ':hover:active': {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`\n },\n ':focus': {\n outline: 'none'\n },\n ':focus-visible': {\n outline: 'none'\n },\n ...createCustomFocusIndicatorStyle({\n border: 'none',\n outline: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorStrokeFocus2}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`\n }),\n // High contrast styles\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'none',\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThick} ${tokens.colorBrandStroke2Hover}, inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus1}`\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorStrokeFocus1}`\n }\n }\n});\nconst useStylesSelected = makeStyles({\n selected: {\n border: 'none',\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke1}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`,\n ':hover': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokeHover}, inset 0 0 0 6px ${tokens.colorStrokeFocus1}`\n },\n ':hover:active': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThickest} ${tokens.colorCompoundBrandStrokePressed}, inset 0 0 0 7px ${tokens.colorStrokeFocus1}`\n },\n ...createCustomFocusIndicatorStyle({\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorStrokeFocus2}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`\n }),\n '@media (forced-colors: active)': {\n boxShadow: `inset 0 0 0 ${tokens.strokeWidthThicker} ${tokens.colorBrandStroke2Pressed}, inset 0 0 0 5px ${tokens.colorStrokeFocus1}`\n }\n }\n});\nconst useSizeStyles = makeStyles({\n 'extra-small': {\n width: '20px',\n height: '20px'\n },\n small: {\n width: '24px',\n height: '24px'\n },\n medium: {\n width: '28px',\n height: '28px'\n },\n large: {\n width: '32px',\n height: '32px'\n }\n});\nconst useShapeStyles = makeStyles({\n rounded: {\n borderRadius: tokens.borderRadiusMedium,\n ...createCustomFocusIndicatorStyle({\n borderRadius: tokens.borderRadiusMedium\n })\n },\n circular: {\n borderRadius: tokens.borderRadiusCircular,\n ...createCustomFocusIndicatorStyle({\n borderRadius: tokens.borderRadiusCircular\n })\n },\n square: {\n borderRadius: tokens.borderRadiusNone,\n ...createCustomFocusIndicatorStyle({\n borderRadius: tokens.borderRadiusNone\n })\n }\n});\n/**\n * Apply styling to the ImageSwatch slots based on the state\n */ export const useImageSwatchStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const selectedStyles = useStylesSelected();\n const sizeStyles = useSizeStyles();\n const shapeStyles = useShapeStyles();\n const { size = 'medium', shape = 'square' } = state;\n state.root.className = mergeClasses(imageSwatchClassNames.root, styles, sizeStyles[size], shapeStyles[shape], state.selected && selectedStyles.selected, state.root.className);\n return state;\n};\n"],"names":["imageSwatchClassNames","useImageSwatchStyles_unstable","root","useStyles","__resetStyles","r","s","useStylesSelected","__styles","selected","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","Bvxd0ez","vajtyg","j6ew2k","Bspt33j","d","p","h","m","useSizeStyles","a9b677","Bqenvij","small","medium","large","useShapeStyles","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","circular","square","state","styles","selectedStyles","sizeStyles","shapeStyles","size","shape","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAGaA,qBAAqB;eAArBA;;IAqGIC,6BAA6B;eAA7BA;;;uBAxGyC;AAGnD,MAAMD,wBAAwB;IACjCE,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,oBAAA,EAAA,YAAA,MAAA;IAAAC,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;KAAA;AAAA;AAsCtB,MAAMC,oBAAiB,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,UAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAC,GAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;QAAA;KAAA;IAAAC,GAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA;YAAA;SAAA;KAAA;AAAA;AAkB1B,MAAMC,gBAAa,WAAA,GAAG5B,IAAAA,eAAA,EAAA;IAAA,eAAA;QAAA6B,QAAA;QAAAC,SAAA;IAAA;IAAAC,OAAA;QAAAF,QAAA;QAAAC,SAAA;IAAA;IAAAE,QAAA;QAAAH,QAAA;QAAAC,SAAA;IAAA;IAAAG,OAAA;QAAAJ,QAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAAN,GAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;AAAA;AAkBtB,MAAMU,iBAAc,WAAA,GAAGlC,IAAAA,eAAA,EAAA;IAAAmC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;IAAAC,UAAA;QAAAV,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;IAAAE,QAAA;QAAAX,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,SAAA;IAAA;AAAA,GAAA;IAAArB,GAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;KAAA;AAAA;AAsBZ,MAAMhC,gCAAiCuD,CAAAA;IAC9C;IACA,MAAMC,SAAStD;IACf,MAAMuD,iBAAiBnD;IACvB,MAAMoD,aAAavB;IACnB,MAAMwB,cAAclB;IACpB,MAAM,EAAEmB,OAAO,QAAQ,EAAEC,QAAQ,QAAA,EAAU,GAAGN;IAC9CA,MAAMtD,IAAI,CAAC6D,SAAS,GAAGC,IAAAA,mBAAY,EAAChE,sBAAsBE,IAAI,EAAEuD,QAAQE,UAAU,CAACE,KAAK,EAAED,WAAW,CAACE,MAAM,EAAEN,MAAM/C,QAAQ,IAAIiD,eAAejD,QAAQ,EAAE+C,MAAMtD,IAAI,CAAC6D,SAAS;IAC7K,OAAOP;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SwatchPicker.
|
|
1
|
+
{"version":3,"sources":["SwatchPicker.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useSwatchPicker_unstable } from './useSwatchPicker';\nimport { renderSwatchPicker_unstable } from './renderSwatchPicker';\nimport { useSwatchPickerStyles_unstable } from './useSwatchPickerStyles.styles';\nimport type { SwatchPickerProps } from './SwatchPicker.types';\nimport { useSwatchPickerContextValues } from '../../contexts/swatchPicker';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * SwatchPicker component - TODO: add more docs\n */\nexport const SwatchPicker: ForwardRefComponent<SwatchPickerProps> = React.forwardRef((props, ref) => {\n const state = useSwatchPicker_unstable(props, ref);\n const contextValues = useSwatchPickerContextValues(state);\n\n useSwatchPickerStyles_unstable(state);\n useCustomStyleHook_unstable('useSwatchPickerStyles_unstable')(state);\n\n return renderSwatchPicker_unstable(state, contextValues);\n});\n\nSwatchPicker.displayName = 'SwatchPicker';\n"],"names":["SwatchPicker","React","forwardRef","props","ref","state","useSwatchPicker_unstable","contextValues","useSwatchPickerContextValues","useSwatchPickerStyles_unstable","useCustomStyleHook_unstable","renderSwatchPicker_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAYaA;;;eAAAA;;;;iEAZU;iCAEkB;oCACG;6CACG;8BAEF;qCACD;AAKrC,MAAMA,eAAAA,WAAAA,GAAuDC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQC,IAAAA,yCAAAA,EAAyBH,OAAOC;IAC9C,MAAMG,gBAAgBC,IAAAA,0CAAAA,EAA6BH;IAEnDI,IAAAA,2DAAAA,EAA+BJ;IAC/BK,IAAAA,gDAAAA,EAA4B,kCAAkCL;IAE9D,OAAOM,IAAAA,+CAAAA,EAA4BN,OAAOE;AAC5C;AAEAP,aAAaY,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SwatchPicker.types.
|
|
1
|
+
{"version":3,"sources":["SwatchPicker.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot, EventHandler, EventData } from '@fluentui/react-utilities';\nimport { SwatchPickerContextValue } from '../../contexts/swatchPicker';\n\nexport type SwatchPickerSlots = {\n root: Slot<'div'>;\n};\n\nexport type SwatchPickerOnSelectEventHandler = EventHandler<SwatchPickerOnSelectionChangeData>;\n\nexport type SwatchPickerOnSelectionChangeData = EventData<'click', React.MouseEvent<HTMLButtonElement>> & {\n selectedValue: string;\n selectedSwatch: string;\n};\n\n/**\n * SwatchPicker Props\n */\nexport type SwatchPickerProps = ComponentProps<SwatchPickerSlots> & {\n /**\n * Default selected value\n */\n defaultSelectedValue?: string;\n\n /**\n * Whether SwatchPicker is row or grid\n */\n layout?: 'row' | 'grid';\n\n /**\n * Triggers a callback when the value has been changed\n */\n onSelectionChange?: EventHandler<SwatchPickerOnSelectionChangeData>;\n\n /**\n * Controlled selected value\n */\n selectedValue?: string;\n\n /**\n * Swatch size\n * @defaultvalue 'medium'\n */\n size?: 'extra-small' | 'small' | 'medium' | 'large';\n\n /**\n * Swatch shape\n * @defaultvalue 'square'\n */\n shape?: 'rounded' | 'square' | 'circular';\n\n /**\n * Spacing between swatches\n * @defaultvalue 'medium'\n */\n spacing?: 'small' | 'medium';\n};\n\n/**\n * State used in rendering SwatchPicker\n */\nexport type SwatchPickerState = ComponentState<SwatchPickerSlots> &\n SwatchPickerContextValue &\n Pick<SwatchPickerProps, 'layout' | 'size' | 'shape' | 'spacing'> & {\n isGrid: boolean;\n };\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './SwatchPicker';\nexport * from './SwatchPicker.types';\nexport * from './renderSwatchPicker';\nexport * from './useSwatchPicker';\nexport * from './useSwatchPickerStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSwatchPicker.
|
|
1
|
+
{"version":3,"sources":["renderSwatchPicker.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport { SwatchPickerProvider } from '../../contexts/swatchPicker';\nimport type { SwatchPickerContextValues } from '../../contexts/swatchPicker';\nimport type { SwatchPickerState, SwatchPickerSlots } from './SwatchPicker.types';\n\n/**\n * Render the final JSX of SwatchPicker\n */\nexport const renderSwatchPicker_unstable = (state: SwatchPickerState, contextValues: SwatchPickerContextValues) => {\n assertSlots<SwatchPickerSlots>(state);\n\n return (\n <SwatchPickerProvider value={contextValues.swatchPicker}>\n <state.root>{state.root.children}</state.root>\n </SwatchPickerProvider>\n );\n};\n"],"names":["renderSwatchPicker_unstable","state","contextValues","assertSlots","_jsx","SwatchPickerProvider","value","swatchPicker","root","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;4BAVb;gCAE4B;8BACS;AAO9B,MAAMA,8BAA8B,CAACC,OAA0BC;IACpEC,IAAAA,2BAAAA,EAA+BF;IAE/B,OAAA,WAAA,GACEG,IAAAA,eAAA,EAACC,kCAAAA,EAAAA;QAAqBC,OAAOJ,cAAcK,YAAY;kBACrD,WAAA,GAAAH,IAAAA,eAAA,EAACH,MAAMO,IAAI,EAAA;sBAAEP,MAAMO,IAAI,CAACC,QAAQ;;;AAGtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSwatchPicker.
|
|
1
|
+
{"version":3,"sources":["useSwatchPicker.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps, SwatchPickerState } from './SwatchPicker.types';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n\n/**\n * Create the state required to render SwatchPicker.\n *\n * The returned state can be modified with hooks such as useSwatchPickerStyles_unstable,\n * before being passed to renderSwatchPicker_unstable.\n *\n * @param props - props from this instance of SwatchPicker\n * @param ref - reference to root HTMLElement of SwatchPicker\n */\nexport const useSwatchPicker_unstable = (\n props: SwatchPickerProps,\n ref: React.Ref<HTMLDivElement>,\n): SwatchPickerState => {\n const { layout, onSelectionChange, size = 'medium', shape, spacing = 'medium', style, ...rest } = props;\n\n const isGrid = layout === 'grid';\n const focusAttributes = useArrowNavigationGroup({\n circular: true,\n axis: isGrid ? 'grid-linear' : 'both',\n memorizeCurrent: true,\n });\n\n const role = isGrid ? 'grid' : 'radiogroup';\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: props.selectedValue,\n defaultState: props.defaultSelectedValue,\n initialState: '',\n });\n\n const requestSelectionChange: SwatchPickerState['requestSelectionChange'] = useEventCallback((event, data) => {\n onSelectionChange?.(event, {\n type: 'click',\n event,\n selectedValue: data.selectedValue,\n selectedSwatch: data.selectedSwatch,\n });\n setSelectedValue(data.selectedValue);\n });\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n role,\n ...focusAttributes,\n ...rest,\n }),\n { elementType: 'div' },\n ),\n isGrid,\n requestSelectionChange,\n selectedValue,\n size,\n shape,\n spacing,\n };\n};\n"],"names":["useSwatchPicker_unstable","props","ref","layout","onSelectionChange","size","shape","spacing","style","rest","isGrid","focusAttributes","useArrowNavigationGroup","circular","axis","memorizeCurrent","role","selectedValue","setSelectedValue","useControllableState","state","defaultState","defaultSelectedValue","initialState","requestSelectionChange","useEventCallback","event","data","type","selectedSwatch","components","root","slot","always","getIntrinsicElementProps","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;;iEAdU;gCACgE;8BAE/C;AAWjC,MAAMA,2BAA2B,CACtCC,OACAC;IAEA,MAAM,EAAEC,MAAM,EAAEC,iBAAiB,EAAEC,OAAO,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGR;IAElG,MAAMS,SAASP,WAAW;IAC1B,MAAMQ,kBAAkBC,IAAAA,qCAAAA,EAAwB;QAC9CC,UAAU;QACVC,MAAMJ,SAAS,gBAAgB;QAC/BK,iBAAiB;IACnB;IAEA,MAAMC,OAAON,SAAS,SAAS;IAE/B,MAAM,CAACO,eAAeC,iBAAiB,GAAGC,IAAAA,oCAAAA,EAAqB;QAC7DC,OAAOnB,MAAMgB,aAAa;QAC1BI,cAAcpB,MAAMqB,oBAAoB;QACxCC,cAAc;IAChB;IAEA,MAAMC,yBAAsEC,IAAAA,gCAAAA,EAAiB,CAACC,OAAOC;QACnGvB,sBAAAA,QAAAA,sBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,kBAAoBsB,OAAO;YACzBE,MAAM;YACNF;YACAT,eAAeU,KAAKV,aAAa;YACjCY,gBAAgBF,KAAKE,cAAc;QACrC;QACAX,iBAAiBS,KAAKV,aAAa;IACrC;IAEA,OAAO;QACLa,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9BhC;YACAc;YACA,GAAGL,eAAe;YAClB,GAAGF,IAAI;QACT,IACA;YAAE0B,aAAa;QAAM;QAEvBzB;QACAc;QACAP;QACAZ;QACAC;QACAC;IACF;AACF"}
|
|
@@ -73,6 +73,7 @@ const swatchPickerClassNames = {
|
|
|
73
73
|
]
|
|
74
74
|
});
|
|
75
75
|
const useSwatchPickerStyles_unstable = (state)=>{
|
|
76
|
+
'use no memo';
|
|
76
77
|
const styles = useStyles();
|
|
77
78
|
const layoutStyle = state.isGrid ? styles.grid : styles.row;
|
|
78
79
|
const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSwatchPickerStyles.styles.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useSwatchPickerStyles.styles.js"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nexport const swatchPickerClassNames = {\n root: 'fui-SwatchPicker'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeStyles({\n root: {\n padding: `${tokens.spacingHorizontalNone} ${tokens.spacingVerticalNone}`,\n display: 'flex'\n },\n row: {\n flexDirection: 'row'\n },\n grid: {\n flexDirection: 'column'\n },\n spacingSmall: {\n gap: '2px'\n },\n spacingMedium: {\n gap: '4px'\n }\n});\n/**\n * Apply styling to the SwatchPicker slots based on the state\n */ export const useSwatchPickerStyles_unstable = (state)=>{\n 'use no memo';\n const styles = useStyles();\n const layoutStyle = state.isGrid ? styles.grid : styles.row;\n const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;\n state.root.className = mergeClasses(swatchPickerClassNames.root, styles.root, layoutStyle, spacingStyle, state.root.className);\n return state;\n};\n"],"names":["swatchPickerClassNames","useSwatchPickerStyles_unstable","root","useStyles","__styles","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","mc9l5x","row","Beiy3e4","grid","spacingSmall","i8kkvl","Belr9w4","rmohyg","spacingMedium","d","p","state","styles","layoutStyle","isGrid","spacingStyle","spacing","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEaA,sBAAsB;eAAtBA;;IAyBIC,8BAA8B;eAA9BA;;;uBA3BwB;AAElC,MAAMD,yBAAyB;IAClCE,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAF,MAAA;QAAAG,SAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAC,KAAA;QAAAC,SAAA;IAAA;IAAAC,MAAA;QAAAD,SAAA;IAAA;IAAAE,cAAA;QAAAC,QAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;IAAAC,eAAA;QAAAH,QAAA;QAAAC,SAAA;QAAAC,QAAA;IAAA;AAAA,GAAA;IAAAE,GAAA;QAAA;YAAA;YAAA;gBAAAC,GAAA,CAAA;YAAA;SAAA;QAAA;QAAA;QAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;QAAA;YAAA;YAAA;gBAAAA,GAAA,CAAA;YAAA;SAAA;KAAA;AAAA;AAoBX,MAAMnB,iCAAkCoB,CAAAA;IAC/C;IACA,MAAMC,SAASnB;IACf,MAAMoB,cAAcF,MAAMG,MAAM,GAAGF,OAAOT,IAAI,GAAGS,OAAOX,GAAG;IAC3D,MAAMc,eAAeJ,MAAMK,OAAO,KAAK,UAAUJ,OAAOR,YAAY,GAAGQ,OAAOJ,aAAa;IAC3FG,MAAMnB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,mBAAY,EAAC5B,uBAAuBE,IAAI,EAAEoB,OAAOpB,IAAI,EAAEqB,aAAaE,cAAcJ,MAAMnB,IAAI,CAACyB,SAAS;IAC7H,OAAON;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["SwatchPickerRow.
|
|
1
|
+
{"version":3,"sources":["SwatchPickerRow.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useSwatchPickerRow_unstable } from './useSwatchPickerRow';\nimport { renderSwatchPickerRow_unstable } from './renderSwatchPickerRow';\nimport { useSwatchPickerRowStyles_unstable } from './useSwatchPickerRowStyles.styles';\nimport type { SwatchPickerRowProps } from './SwatchPickerRow.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * SwatchPickerRow component is used to render a row of swatches.\n */\nexport const SwatchPickerRow: ForwardRefComponent<SwatchPickerRowProps> = React.forwardRef((props, ref) => {\n const state = useSwatchPickerRow_unstable(props, ref);\n\n useSwatchPickerRowStyles_unstable(state);\n useCustomStyleHook_unstable('useSwatchPickerRowStyles_unstable')(state);\n return renderSwatchPickerRow_unstable(state);\n});\n\nSwatchPickerRow.displayName = 'SwatchPickerRow';\n"],"names":["SwatchPickerRow","React","forwardRef","props","ref","state","useSwatchPickerRow_unstable","useSwatchPickerRowStyles_unstable","useCustomStyleHook_unstable","renderSwatchPickerRow_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;;iEAXU;oCAEqB;uCACG;gDACG;qCAEN;AAKrC,MAAMA,kBAAAA,WAAAA,GAA6DC,OAAMC,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQC,IAAAA,+CAAAA,EAA4BH,OAAOC;IAEjDG,IAAAA,iEAAAA,EAAkCF;IAClCG,IAAAA,gDAAAA,EAA4B,qCAAqCH;IACjE,OAAOI,IAAAA,qDAAAA,EAA+BJ;AACxC;AAEAL,gBAAgBU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"sources":["SwatchPickerRow.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerProps } from '../SwatchPicker/SwatchPicker.types';\n\nexport type SwatchPickerRowSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * SwatchPickerRow Props\n */\nexport type SwatchPickerRowProps = ComponentProps<SwatchPickerRowSlots>;\n\n/**\n * State used in rendering SwatchPickerRow\n */\nexport type SwatchPickerRowState = ComponentState<SwatchPickerRowSlots> & Pick<SwatchPickerProps, 'spacing'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAYA;;CAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './SwatchPickerRow';\nexport * from './SwatchPickerRow.types';\nexport * from './renderSwatchPickerRow';\nexport * from './useSwatchPickerRow';\nexport * from './useSwatchPickerRowStyles.styles';\n"],"names":[],"rangeMappings":";;;;;;;;;","mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderSwatchPickerRow.
|
|
1
|
+
{"version":3,"sources":["renderSwatchPickerRow.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { SwatchPickerRowState, SwatchPickerRowSlots } from './SwatchPickerRow.types';\n\n/**\n * Render the final JSX of SwatchPickerRow\n */\nexport const renderSwatchPickerRow_unstable = (state: SwatchPickerRowState) => {\n assertSlots<SwatchPickerRowSlots>(state);\n return <state.root />;\n};\n"],"names":["renderSwatchPickerRow_unstable","state","assertSlots","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":";;;;+BASaA;;;eAAAA;;;4BARb;gCAE4B;AAMrB,MAAMA,iCAAiC,CAACC;IAC7CC,IAAAA,2BAAAA,EAAkCD;IAClC,OAAA,WAAA,GAAOE,IAAAA,eAAA,EAACF,MAAMG,IAAI,EAAA,CAAA;AACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSwatchPickerRow.
|
|
1
|
+
{"version":3,"sources":["useSwatchPickerRow.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { SwatchPickerRowProps, SwatchPickerRowState } from './SwatchPickerRow.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the state required to render SwatchPickerRow.\n *\n * The returned state can be modified with hooks such as useSwatchPickerRowStyles_unstable,\n * before being passed to renderSwatchPickerRow_unstable.\n *\n * @param props - props from this instance of SwatchPickerRow\n * @param ref - reference to root HTMLDivElement of SwatchPickerRow\n */\nexport const useSwatchPickerRow_unstable = (\n props: SwatchPickerRowProps,\n ref: React.Ref<HTMLDivElement>,\n): SwatchPickerRowState => {\n const { style, ...rest } = props;\n const spacing = useSwatchPickerContextValue_unstable(ctx => ctx.spacing);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref,\n role: 'row',\n ...rest,\n }),\n { elementType: 'div' },\n ),\n spacing,\n };\n};\n"],"names":["useSwatchPickerRow_unstable","props","ref","style","rest","spacing","useSwatchPickerContextValue_unstable","ctx","components","root","slot","always","getIntrinsicElementProps","role","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcaA;;;eAAAA;;;;iEAdU;gCACwB;8BAEM;AAW9C,MAAMA,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGH;IAC3B,MAAMI,UAAUC,IAAAA,kDAAAA,EAAqCC,CAAAA,MAAOA,IAAIF,OAAO;IAEvE,OAAO;QACLG,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,oBAAAA,CAAKC,MAAM,CACfC,IAAAA,wCAAAA,EAAyB,OAAO;YAC9BV;YACAW,MAAM;YACN,GAAGT,IAAI;QACT,IACA;YAAEU,aAAa;QAAM;QAEvBT;IACF;AACF"}
|
|
@@ -39,6 +39,7 @@ const useStyles = /*#__PURE__*/ (0, _react.__styles)({
|
|
|
39
39
|
]
|
|
40
40
|
});
|
|
41
41
|
const useSwatchPickerRowStyles_unstable = (state)=>{
|
|
42
|
+
'use no memo';
|
|
42
43
|
const resetStyles = useResetStyles();
|
|
43
44
|
const styles = useStyles();
|
|
44
45
|
const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useSwatchPickerRowStyles.styles.js"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useSwatchPickerRowStyles.styles.js"],"sourcesContent":["import { makeResetStyles, mergeClasses, makeStyles } from '@griffel/react';\nexport const swatchPickerRowClassNames = {\n root: 'fui-SwatchPickerRow'\n};\n/**\n * Styles for the root slot\n */ const useResetStyles = makeResetStyles({\n display: 'flex',\n flexDirection: 'row'\n});\nconst useStyles = makeStyles({\n spacingSmall: {\n columnGap: '2px'\n },\n spacingMedium: {\n columnGap: '4px'\n }\n});\n/**\n * Apply styling to the SwatchPickerRow slots based on the state\n */ export const useSwatchPickerRowStyles_unstable = (state)=>{\n 'use no memo';\n const resetStyles = useResetStyles();\n const styles = useStyles();\n const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;\n state.root.className = mergeClasses(swatchPickerRowClassNames.root, resetStyles, spacingStyle, state.root.className);\n return state;\n};\n"],"names":["swatchPickerRowClassNames","useSwatchPickerRowStyles_unstable","root","useResetStyles","__resetStyles","useStyles","__styles","spacingSmall","i8kkvl","spacingMedium","d","state","resetStyles","styles","spacingStyle","spacing","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACaA,yBAAyB;eAAzBA;;IAmBIC,iCAAiC;eAAjCA;;;uBApByC;AACnD,MAAMD,4BAA4B;IACrCE,MAAM;AACV;AACA;;CAEA,GAAI,MAAMC,iBAAc,WAAA,GAAGC,IAAAA,oBAAA,EAAA,YAAA,MAAA;IAAA;CAG1B;AACD,MAAMC,YAAS,WAAA,GAAGC,IAAAA,eAAA,EAAA;IAAAC,cAAA;QAAAC,QAAA;IAAA;IAAAC,eAAA;QAAAD,QAAA;IAAA;AAAA,GAAA;IAAAE,GAAA;QAAA;QAAA;KAAA;AAAA;AAUP,MAAMT,oCAAqCU,CAAAA;IAClD;IACA,MAAMC,cAAcT;IACpB,MAAMU,SAASR;IACf,MAAMS,eAAeH,MAAMI,OAAO,KAAK,UAAUF,OAAON,YAAY,GAAGM,OAAOJ,aAAa;IAC3FE,MAAMT,IAAI,CAACc,SAAS,GAAGC,IAAAA,mBAAY,EAACjB,0BAA0BE,IAAI,EAAEU,aAAaE,cAAcH,MAAMT,IAAI,CAACc,SAAS;IACnH,OAAOL;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './swatchPicker';\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;uBAAc"}
|
|
@@ -9,17 +9,17 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
SwatchPickerProvider: function() {
|
|
13
|
+
return SwatchPickerProvider;
|
|
14
14
|
},
|
|
15
15
|
swatchPickerContextDefaultValue: function() {
|
|
16
16
|
return swatchPickerContextDefaultValue;
|
|
17
17
|
},
|
|
18
|
-
SwatchPickerProvider: function() {
|
|
19
|
-
return SwatchPickerProvider;
|
|
20
|
-
},
|
|
21
18
|
useSwatchPickerContextValue_unstable: function() {
|
|
22
19
|
return useSwatchPickerContextValue_unstable;
|
|
20
|
+
},
|
|
21
|
+
useSwatchPickerContextValues: function() {
|
|
22
|
+
return useSwatchPickerContextValues;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["swatchPicker.
|
|
1
|
+
{"version":3,"sources":["swatchPicker.ts"],"sourcesContent":["import * as React from 'react';\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { ContextSelector, Context } from '@fluentui/react-context-selector';\nimport type { SwatchPickerProps, SwatchPickerState } from '../components/SwatchPicker/SwatchPicker.types';\n\n/**\n * The context through which individual color controls communicate with the picker.\n */\nexport type SwatchPickerContextValue = Pick<SwatchPickerProps, 'size' | 'shape' | 'spacing' | 'selectedValue'> & {\n /**\n * Whether layout is grid.\n */\n isGrid: boolean;\n\n /**\n * @internal\n * Callback used by ColorSwatch to request a change on it's selected state\n * Should be used to select ColorSwatch\n */\n requestSelectionChange: (\n event: React.MouseEvent<HTMLButtonElement>,\n data: { selectedValue: string; selectedSwatch: string },\n ) => void;\n};\n\nexport const useSwatchPickerContextValues = (state: SwatchPickerState): SwatchPickerContextValues => {\n const { isGrid, size, shape, spacing, requestSelectionChange, selectedValue } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const swatchPicker: SwatchPickerContextValue = {\n isGrid,\n size,\n shape,\n spacing,\n selectedValue,\n requestSelectionChange,\n };\n\n return { swatchPicker };\n};\n\nexport const swatchPickerContextDefaultValue: SwatchPickerContextValue = {\n requestSelectionChange: () => {\n /*noop*/\n },\n isGrid: false,\n size: 'medium',\n shape: 'square',\n spacing: 'medium',\n selectedValue: undefined,\n};\n\nexport type SwatchPickerContextValues = {\n swatchPicker: SwatchPickerContextValue;\n};\n\nconst SwatchPickerContext = createContext<SwatchPickerContextValue | undefined>(\n undefined,\n) as Context<SwatchPickerContextValue>;\n\nexport const SwatchPickerProvider = SwatchPickerContext.Provider;\n\nexport const useSwatchPickerContextValue_unstable = <T>(selector: ContextSelector<SwatchPickerContextValue, T>): T =>\n useContextSelector(SwatchPickerContext, (ctx = swatchPickerContextDefaultValue) => selector(ctx));\n"],"names":["SwatchPickerProvider","swatchPickerContextDefaultValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues","state","isGrid","size","shape","spacing","requestSelectionChange","selectedValue","swatchPicker","undefined","SwatchPickerContext","createContext","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA4DaA,oBAAAA;eAAAA;;IAnBAC,+BAAAA;eAAAA;;IAqBAC,oCAAAA;eAAAA;;IArCAC,4BAAAA;eAAAA;;;;iEAzBU;sCAC2B;AAwB3C,MAAMA,+BAA+B,CAACC;IAC3C,MAAM,EAAEC,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAEC,sBAAsB,EAAEC,aAAa,EAAE,GAAGN;IAEhF,mGAAmG;IACnG,MAAMO,eAAyC;QAC7CN;QACAC;QACAC;QACAC;QACAE;QACAD;IACF;IAEA,OAAO;QAAEE;IAAa;AACxB;AAEO,MAAMV,kCAA4D;IACvEQ,wBAAwB;IACtB,MAAM,GACR;IACAJ,QAAQ;IACRC,MAAM;IACNC,OAAO;IACPC,SAAS;IACTE,eAAeE;AACjB;AAMA,MAAMC,sBAAsBC,IAAAA,mCAAAA,EAC1BF;AAGK,MAAMZ,uBAAuBa,oBAAoBE,QAAQ;AAEzD,MAAMb,uCAAuC,CAAIc,WACtDC,IAAAA,wCAAAA,EAAmBJ,qBAAqB,CAACK,MAAMjB,+BAA+B,GAAKe,SAASE"}
|
package/lib-commonjs/index.js
CHANGED
|
@@ -9,56 +9,74 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
14
|
-
},
|
|
15
|
-
renderSwatchPicker_unstable: function() {
|
|
16
|
-
return _SwatchPicker.renderSwatchPicker_unstable;
|
|
12
|
+
ColorSwatch: function() {
|
|
13
|
+
return _ColorSwatch.ColorSwatch;
|
|
17
14
|
},
|
|
18
|
-
|
|
19
|
-
return
|
|
15
|
+
EmptySwatch: function() {
|
|
16
|
+
return _EmptySwatch.EmptySwatch;
|
|
20
17
|
},
|
|
21
|
-
|
|
22
|
-
return
|
|
18
|
+
ImageSwatch: function() {
|
|
19
|
+
return _ImageSwatch.ImageSwatch;
|
|
23
20
|
},
|
|
24
|
-
|
|
25
|
-
return _SwatchPicker.
|
|
21
|
+
SwatchPicker: function() {
|
|
22
|
+
return _SwatchPicker.SwatchPicker;
|
|
26
23
|
},
|
|
27
24
|
SwatchPickerProvider: function() {
|
|
28
25
|
return _contexts.SwatchPickerProvider;
|
|
29
26
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
27
|
+
SwatchPickerRow: function() {
|
|
28
|
+
return _SwatchPickerRow.SwatchPickerRow;
|
|
32
29
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
30
|
+
colorSwatchClassNames: function() {
|
|
31
|
+
return _ColorSwatch.colorSwatchClassNames;
|
|
35
32
|
},
|
|
36
|
-
|
|
37
|
-
return
|
|
33
|
+
emptySwatchClassNames: function() {
|
|
34
|
+
return _EmptySwatch.emptySwatchClassNames;
|
|
38
35
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
36
|
+
imageSwatchClassNames: function() {
|
|
37
|
+
return _ImageSwatch.imageSwatchClassNames;
|
|
41
38
|
},
|
|
42
39
|
renderColorSwatch_unstable: function() {
|
|
43
40
|
return _ColorSwatch.renderColorSwatch_unstable;
|
|
44
41
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
42
|
+
renderEmptySwatch_unstable: function() {
|
|
43
|
+
return _EmptySwatch.renderEmptySwatch_unstable;
|
|
47
44
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
45
|
+
renderImageSwatch_unstable: function() {
|
|
46
|
+
return _ImageSwatch.renderImageSwatch_unstable;
|
|
50
47
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
48
|
+
renderSwatchPickerGrid: function() {
|
|
49
|
+
return _renderUtils.renderSwatchPickerGrid;
|
|
50
|
+
},
|
|
51
|
+
renderSwatchPickerRow_unstable: function() {
|
|
52
|
+
return _SwatchPickerRow.renderSwatchPickerRow_unstable;
|
|
53
|
+
},
|
|
54
|
+
renderSwatchPicker_unstable: function() {
|
|
55
|
+
return _SwatchPicker.renderSwatchPicker_unstable;
|
|
53
56
|
},
|
|
54
57
|
swatchCSSVars: function() {
|
|
55
58
|
return _ColorSwatch.swatchCSSVars;
|
|
56
59
|
},
|
|
57
|
-
|
|
58
|
-
return
|
|
60
|
+
swatchPickerClassNames: function() {
|
|
61
|
+
return _SwatchPicker.swatchPickerClassNames;
|
|
59
62
|
},
|
|
60
|
-
|
|
61
|
-
return
|
|
63
|
+
swatchPickerContextDefaultValue: function() {
|
|
64
|
+
return _contexts.swatchPickerContextDefaultValue;
|
|
65
|
+
},
|
|
66
|
+
swatchPickerRowClassNames: function() {
|
|
67
|
+
return _SwatchPickerRow.swatchPickerRowClassNames;
|
|
68
|
+
},
|
|
69
|
+
useColorSwatchStyles_unstable: function() {
|
|
70
|
+
return _ColorSwatch.useColorSwatchStyles_unstable;
|
|
71
|
+
},
|
|
72
|
+
useColorSwatch_unstable: function() {
|
|
73
|
+
return _ColorSwatch.useColorSwatch_unstable;
|
|
74
|
+
},
|
|
75
|
+
useEmptySwatchStyles_unstable: function() {
|
|
76
|
+
return _EmptySwatch.useEmptySwatchStyles_unstable;
|
|
77
|
+
},
|
|
78
|
+
useEmptySwatch_unstable: function() {
|
|
79
|
+
return _EmptySwatch.useEmptySwatch_unstable;
|
|
62
80
|
},
|
|
63
81
|
useImageSwatchStyles_unstable: function() {
|
|
64
82
|
return _ImageSwatch.useImageSwatchStyles_unstable;
|
|
@@ -66,14 +84,11 @@ _export(exports, {
|
|
|
66
84
|
useImageSwatch_unstable: function() {
|
|
67
85
|
return _ImageSwatch.useImageSwatch_unstable;
|
|
68
86
|
},
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
},
|
|
72
|
-
SwatchPickerRow: function() {
|
|
73
|
-
return _SwatchPickerRow.SwatchPickerRow;
|
|
87
|
+
useSwatchPickerContextValue_unstable: function() {
|
|
88
|
+
return _contexts.useSwatchPickerContextValue_unstable;
|
|
74
89
|
},
|
|
75
|
-
|
|
76
|
-
return
|
|
90
|
+
useSwatchPickerContextValues: function() {
|
|
91
|
+
return _contexts.useSwatchPickerContextValues;
|
|
77
92
|
},
|
|
78
93
|
useSwatchPickerRowStyles_unstable: function() {
|
|
79
94
|
return _SwatchPickerRow.useSwatchPickerRowStyles_unstable;
|
|
@@ -81,26 +96,11 @@ _export(exports, {
|
|
|
81
96
|
useSwatchPickerRow_unstable: function() {
|
|
82
97
|
return _SwatchPickerRow.useSwatchPickerRow_unstable;
|
|
83
98
|
},
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
},
|
|
87
|
-
renderSwatchPickerGrid: function() {
|
|
88
|
-
return _renderUtils.renderSwatchPickerGrid;
|
|
89
|
-
},
|
|
90
|
-
EmptySwatch: function() {
|
|
91
|
-
return _EmptySwatch.EmptySwatch;
|
|
92
|
-
},
|
|
93
|
-
renderEmptySwatch_unstable: function() {
|
|
94
|
-
return _EmptySwatch.renderEmptySwatch_unstable;
|
|
95
|
-
},
|
|
96
|
-
useEmptySwatchStyles_unstable: function() {
|
|
97
|
-
return _EmptySwatch.useEmptySwatchStyles_unstable;
|
|
98
|
-
},
|
|
99
|
-
useEmptySwatch_unstable: function() {
|
|
100
|
-
return _EmptySwatch.useEmptySwatch_unstable;
|
|
99
|
+
useSwatchPickerStyles_unstable: function() {
|
|
100
|
+
return _SwatchPicker.useSwatchPickerStyles_unstable;
|
|
101
101
|
},
|
|
102
|
-
|
|
103
|
-
return
|
|
102
|
+
useSwatchPicker_unstable: function() {
|
|
103
|
+
return _SwatchPicker.useSwatchPicker_unstable;
|
|
104
104
|
}
|
|
105
105
|
});
|
|
106
106
|
const _SwatchPicker = require("./SwatchPicker");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n SwatchPicker,\n renderSwatchPicker_unstable,\n useSwatchPickerStyles_unstable,\n useSwatchPicker_unstable,\n swatchPickerClassNames,\n} from './SwatchPicker';\nexport {\n SwatchPickerProvider,\n swatchPickerContextDefaultValue,\n useSwatchPickerContextValue_unstable,\n useSwatchPickerContextValues,\n} from './contexts';\nexport type { SwatchPickerContextValue, SwatchPickerContextValues } from './contexts';\nexport type {\n SwatchPickerProps,\n SwatchPickerSlots,\n SwatchPickerState,\n SwatchPickerOnSelectionChangeData,\n SwatchPickerOnSelectEventHandler,\n} from './SwatchPicker';\nexport {\n ColorSwatch,\n renderColorSwatch_unstable,\n useColorSwatchStyles_unstable,\n useColorSwatch_unstable,\n colorSwatchClassNames,\n swatchCSSVars,\n} from './ColorSwatch';\nexport type { ColorSwatchProps, ColorSwatchSlots, ColorSwatchState } from './ColorSwatch';\nexport {\n ImageSwatch,\n renderImageSwatch_unstable,\n useImageSwatchStyles_unstable,\n useImageSwatch_unstable,\n imageSwatchClassNames,\n} from './ImageSwatch';\nexport type { ImageSwatchProps, ImageSwatchSlots, ImageSwatchState } from './ImageSwatch';\nexport type { SwatchPickerRowProps, SwatchPickerRowSlots, SwatchPickerRowState } from './SwatchPickerRow';\nexport {\n SwatchPickerRow,\n renderSwatchPickerRow_unstable,\n useSwatchPickerRowStyles_unstable,\n useSwatchPickerRow_unstable,\n swatchPickerRowClassNames,\n} from './SwatchPickerRow';\nexport { renderSwatchPickerGrid } from './utils/renderUtils';\nexport type { SwatchProps, SwatchPickerGridProps } from './utils/renderUtils';\nexport {\n EmptySwatch,\n renderEmptySwatch_unstable,\n useEmptySwatchStyles_unstable,\n useEmptySwatch_unstable,\n emptySwatchClassNames,\n} from './EmptySwatch';\nexport type { EmptySwatchProps, EmptySwatchSlots, EmptySwatchState } from './EmptySwatch';\n"],"names":["ColorSwatch","EmptySwatch","ImageSwatch","SwatchPicker","SwatchPickerProvider","SwatchPickerRow","colorSwatchClassNames","emptySwatchClassNames","imageSwatchClassNames","renderColorSwatch_unstable","renderEmptySwatch_unstable","renderImageSwatch_unstable","renderSwatchPickerGrid","renderSwatchPickerRow_unstable","renderSwatchPicker_unstable","swatchCSSVars","swatchPickerClassNames","swatchPickerContextDefaultValue","swatchPickerRowClassNames","useColorSwatchStyles_unstable","useColorSwatch_unstable","useEmptySwatchStyles_unstable","useEmptySwatch_unstable","useImageSwatchStyles_unstable","useImageSwatch_unstable","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues","useSwatchPickerRowStyles_unstable","useSwatchPickerRow_unstable","useSwatchPickerStyles_unstable","useSwatchPicker_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAsBEA,WAAW;eAAXA,wBAAW;;IA2BXC,WAAW;eAAXA,wBAAW;;IAlBXC,WAAW;eAAXA,wBAAW;;IA9BXC,YAAY;eAAZA,0BAAY;;IAOZC,oBAAoB;eAApBA,8BAAoB;;IAgCpBC,eAAe;eAAfA,gCAAe;;IAdfC,qBAAqB;eAArBA,kCAAqB;;IA2BrBC,qBAAqB;eAArBA,kCAAqB;;IAlBrBC,qBAAqB;eAArBA,kCAAqB;;IAZrBC,0BAA0B;eAA1BA,uCAA0B;;IA2B1BC,0BAA0B;eAA1BA,uCAA0B;;IAlB1BC,0BAA0B;eAA1BA,uCAA0B;;IAcnBC,sBAAsB;eAAtBA,mCAAsB;;IAL7BC,8BAA8B;eAA9BA,+CAA8B;;IAvC9BC,2BAA2B;eAA3BA,yCAA2B;;IAyB3BC,aAAa;eAAbA,0BAAa;;IAtBbC,sBAAsB;eAAtBA,oCAAsB;;IAItBC,+BAA+B;eAA/BA,yCAA+B;;IAmC/BC,yBAAyB;eAAzBA,0CAAyB;;IApBzBC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IA0BvBC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IAnBvBC,6BAA6B;eAA7BA,0CAA6B;;IAC7BC,uBAAuB;eAAvBA,oCAAuB;;IAxBvBC,oCAAoC;eAApCA,8CAAoC;;IACpCC,4BAA4B;eAA5BA,sCAA4B;;IA+B5BC,iCAAiC;eAAjCA,kDAAiC;;IACjCC,2BAA2B;eAA3BA,4CAA2B;;IAxC3BC,8BAA8B;eAA9BA,4CAA8B;;IAC9BC,wBAAwB;eAAxBA,sCAAwB;;;8BAEnB;0BAMA;6BAgBA;6BAQA;iCASA;6BACgC;6BAQhC"}
|