@fluentui/react-swatch-picker 9.5.4 → 9.74.3-experimental.esm.20260709-49ee7a20cf.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 +18 -2
- package/dist/index.d.cts +358 -0
- package/lib/ColorSwatch.js +1 -1
- package/lib/ColorSwatch.js.map +1 -1
- package/lib/EmptySwatch.js +1 -1
- package/lib/EmptySwatch.js.map +1 -1
- package/lib/ImageSwatch.js +1 -1
- package/lib/ImageSwatch.js.map +1 -1
- package/lib/SwatchPicker.js +1 -1
- package/lib/SwatchPicker.js.map +1 -1
- package/lib/SwatchPickerRow.js +1 -1
- package/lib/SwatchPickerRow.js.map +1 -1
- package/lib/components/ColorSwatch/ColorSwatch.js +5 -5
- package/lib/components/ColorSwatch/ColorSwatch.js.map +1 -1
- package/lib/components/ColorSwatch/index.js +4 -4
- package/lib/components/ColorSwatch/index.js.map +1 -1
- package/lib/components/ColorSwatch/renderColorSwatch.js +1 -1
- package/lib/components/ColorSwatch/useColorSwatch.js +6 -6
- package/lib/components/ColorSwatch/useColorSwatch.js.map +1 -1
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js +3 -3
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.js.map +1 -1
- package/lib/components/ColorSwatch/useColorSwatchStyles.styles.raw.js +3 -3
- package/lib/components/EmptySwatch/EmptySwatch.js +5 -5
- package/lib/components/EmptySwatch/EmptySwatch.js.map +1 -1
- package/lib/components/EmptySwatch/index.js +4 -4
- package/lib/components/EmptySwatch/index.js.map +1 -1
- package/lib/components/EmptySwatch/renderEmptySwatch.js +1 -1
- package/lib/components/EmptySwatch/useEmptySwatch.js +2 -2
- package/lib/components/EmptySwatch/useEmptySwatch.js.map +1 -1
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js +3 -3
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +1 -1
- package/lib/components/EmptySwatch/useEmptySwatchStyles.styles.raw.js +3 -3
- package/lib/components/ImageSwatch/ImageSwatch.js +5 -5
- package/lib/components/ImageSwatch/ImageSwatch.js.map +1 -1
- package/lib/components/ImageSwatch/index.js +4 -4
- package/lib/components/ImageSwatch/index.js.map +1 -1
- package/lib/components/ImageSwatch/renderImageSwatch.js +1 -1
- package/lib/components/ImageSwatch/useImageSwatch.js +2 -2
- package/lib/components/ImageSwatch/useImageSwatch.js.map +1 -1
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js +3 -3
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.js.map +1 -1
- package/lib/components/ImageSwatch/useImageSwatchStyles.styles.raw.js +3 -3
- package/lib/components/SwatchPicker/SwatchPicker.js +6 -6
- package/lib/components/SwatchPicker/SwatchPicker.js.map +1 -1
- package/lib/components/SwatchPicker/index.js +4 -4
- package/lib/components/SwatchPicker/index.js.map +1 -1
- package/lib/components/SwatchPicker/renderSwatchPicker.js +2 -2
- package/lib/components/SwatchPicker/renderSwatchPicker.js.map +1 -1
- package/lib/components/SwatchPicker/useSwatchPicker.js +3 -3
- package/lib/components/SwatchPicker/useSwatchPickerContextValues.js +1 -1
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js +2 -2
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +1 -1
- package/lib/components/SwatchPicker/useSwatchPickerStyles.styles.raw.js +2 -2
- package/lib/components/SwatchPickerRow/SwatchPickerRow.js +5 -5
- package/lib/components/SwatchPickerRow/SwatchPickerRow.js.map +1 -1
- package/lib/components/SwatchPickerRow/index.js +4 -4
- package/lib/components/SwatchPickerRow/index.js.map +1 -1
- package/lib/components/SwatchPickerRow/renderSwatchPickerRow.js +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRow.js +2 -2
- package/lib/components/SwatchPickerRow/useSwatchPickerRow.js.map +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +1 -1
- package/lib/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.raw.js +1 -1
- package/lib/contexts/index.js +2 -2
- package/lib/contexts/index.js.map +1 -1
- package/lib/contexts/swatchPicker.js +1 -1
- package/lib/index.js +7 -7
- package/lib/index.js.map +1 -1
- package/lib/utils/renderUtils.js +2 -2
- package/lib/utils/renderUtils.js.map +1 -1
- package/lib-commonjs/{ColorSwatch.js → ColorSwatch.cjs} +1 -1
- package/lib-commonjs/{ColorSwatch.js.map → ColorSwatch.cjs.map} +1 -1
- package/lib-commonjs/{EmptySwatch.js → EmptySwatch.cjs} +1 -1
- package/lib-commonjs/{EmptySwatch.js.map → EmptySwatch.cjs.map} +1 -1
- package/lib-commonjs/{ImageSwatch.js → ImageSwatch.cjs} +1 -1
- package/lib-commonjs/{ImageSwatch.js.map → ImageSwatch.cjs.map} +1 -1
- package/lib-commonjs/{SwatchPicker.js → SwatchPicker.cjs} +1 -1
- package/lib-commonjs/{SwatchPicker.js.map → SwatchPicker.cjs.map} +1 -1
- package/lib-commonjs/{SwatchPickerRow.js → SwatchPickerRow.cjs} +1 -1
- package/lib-commonjs/{SwatchPickerRow.js.map → SwatchPickerRow.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSwatch/{ColorSwatch.js → ColorSwatch.cjs} +3 -3
- package/lib-commonjs/components/ColorSwatch/{ColorSwatch.js.map → ColorSwatch.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSwatch/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/ColorSwatch/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSwatch/{useColorSwatch.js → useColorSwatch.cjs} +2 -2
- package/lib-commonjs/components/ColorSwatch/{useColorSwatch.js.map → useColorSwatch.cjs.map} +1 -1
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/EmptySwatch/{EmptySwatch.js → EmptySwatch.cjs} +3 -3
- package/lib-commonjs/components/EmptySwatch/{EmptySwatch.js.map → EmptySwatch.cjs.map} +1 -1
- package/lib-commonjs/components/EmptySwatch/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/EmptySwatch/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/EmptySwatch/{useEmptySwatch.js → useEmptySwatch.cjs} +1 -1
- package/lib-commonjs/components/EmptySwatch/{useEmptySwatch.js.map → useEmptySwatch.cjs.map} +1 -1
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/ImageSwatch/{ImageSwatch.js → ImageSwatch.cjs} +3 -3
- package/lib-commonjs/components/ImageSwatch/{ImageSwatch.js.map → ImageSwatch.cjs.map} +1 -1
- package/lib-commonjs/components/ImageSwatch/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/ImageSwatch/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/ImageSwatch/{useImageSwatch.js → useImageSwatch.cjs} +1 -1
- package/lib-commonjs/components/ImageSwatch/{useImageSwatch.js.map → useImageSwatch.cjs.map} +1 -1
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/SwatchPicker/{SwatchPicker.js → SwatchPicker.cjs} +4 -4
- package/lib-commonjs/components/SwatchPicker/{SwatchPicker.js.map → SwatchPicker.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPicker/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/SwatchPicker/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPicker/{renderSwatchPicker.js → renderSwatchPicker.cjs} +1 -1
- package/lib-commonjs/components/SwatchPicker/{renderSwatchPicker.js.map → renderSwatchPicker.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.cjs.map +1 -0
- package/lib-commonjs/components/SwatchPickerRow/{SwatchPickerRow.js → SwatchPickerRow.cjs} +3 -3
- package/lib-commonjs/components/SwatchPickerRow/{SwatchPickerRow.js.map → SwatchPickerRow.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPickerRow/{index.js → index.cjs} +4 -4
- package/lib-commonjs/components/SwatchPickerRow/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPickerRow/{useSwatchPickerRow.js → useSwatchPickerRow.cjs} +1 -1
- package/lib-commonjs/components/SwatchPickerRow/{useSwatchPickerRow.js.map → useSwatchPickerRow.cjs.map} +1 -1
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.cjs.map +1 -0
- package/lib-commonjs/contexts/{index.js → index.cjs} +2 -2
- package/lib-commonjs/contexts/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/{index.js → index.cjs} +11 -11
- package/lib-commonjs/{index.js.map → index.cjs.map} +1 -1
- package/lib-commonjs/utils/{renderUtils.js → renderUtils.cjs} +4 -4
- package/lib-commonjs/utils/{renderUtils.js.map → renderUtils.cjs.map} +1 -1
- package/package.json +21 -20
- package/lib-commonjs/components/ColorSwatch/useColorSwatchStyles.styles.js.map +0 -1
- package/lib-commonjs/components/EmptySwatch/useEmptySwatchStyles.styles.js.map +0 -1
- package/lib-commonjs/components/ImageSwatch/useImageSwatchStyles.styles.js.map +0 -1
- package/lib-commonjs/components/SwatchPicker/useSwatchPickerStyles.styles.js.map +0 -1
- package/lib-commonjs/components/SwatchPickerRow/useSwatchPickerRowStyles.styles.js.map +0 -1
- /package/lib-commonjs/components/ColorSwatch/{ColorSwatch.types.js → ColorSwatch.types.cjs} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{ColorSwatch.types.js.map → ColorSwatch.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{renderColorSwatch.js → renderColorSwatch.cjs} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{renderColorSwatch.js.map → renderColorSwatch.cjs.map} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{useColorSwatchStyles.styles.js → useColorSwatchStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{useColorSwatchStyles.styles.raw.js → useColorSwatchStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ColorSwatch/{useColorSwatchStyles.styles.raw.js.map → useColorSwatchStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{EmptySwatch.types.js → EmptySwatch.types.cjs} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{EmptySwatch.types.js.map → EmptySwatch.types.cjs.map} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{renderEmptySwatch.js → renderEmptySwatch.cjs} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{renderEmptySwatch.js.map → renderEmptySwatch.cjs.map} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{useEmptySwatchStyles.styles.js → useEmptySwatchStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{useEmptySwatchStyles.styles.raw.js → useEmptySwatchStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/EmptySwatch/{useEmptySwatchStyles.styles.raw.js.map → useEmptySwatchStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{ImageSwatch.types.js → ImageSwatch.types.cjs} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{ImageSwatch.types.js.map → ImageSwatch.types.cjs.map} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{renderImageSwatch.js → renderImageSwatch.cjs} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{renderImageSwatch.js.map → renderImageSwatch.cjs.map} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{useImageSwatchStyles.styles.js → useImageSwatchStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{useImageSwatchStyles.styles.raw.js → useImageSwatchStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/ImageSwatch/{useImageSwatchStyles.styles.raw.js.map → useImageSwatchStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{SwatchPicker.types.js → SwatchPicker.types.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{SwatchPicker.types.js.map → SwatchPicker.types.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPicker.js → useSwatchPicker.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPicker.js.map → useSwatchPicker.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPickerContextValues.js → useSwatchPickerContextValues.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPickerContextValues.js.map → useSwatchPickerContextValues.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPickerStyles.styles.js → useSwatchPickerStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPickerStyles.styles.raw.js → useSwatchPickerStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPicker/{useSwatchPickerStyles.styles.raw.js.map → useSwatchPickerStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{SwatchPickerRow.types.js → SwatchPickerRow.types.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{SwatchPickerRow.types.js.map → SwatchPickerRow.types.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{renderSwatchPickerRow.js → renderSwatchPickerRow.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{renderSwatchPickerRow.js.map → renderSwatchPickerRow.cjs.map} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{useSwatchPickerRowStyles.styles.js → useSwatchPickerRowStyles.styles.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{useSwatchPickerRowStyles.styles.raw.js → useSwatchPickerRowStyles.styles.raw.cjs} +0 -0
- /package/lib-commonjs/components/SwatchPickerRow/{useSwatchPickerRowStyles.styles.raw.js.map → useSwatchPickerRowStyles.styles.raw.cjs.map} +0 -0
- /package/lib-commonjs/contexts/{swatchPicker.js → swatchPicker.cjs} +0 -0
- /package/lib-commonjs/contexts/{swatchPicker.js.map → swatchPicker.cjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { makeResetStyles, makeStyles, mergeClasses } from
|
|
3
|
-
import { tokens } from
|
|
4
|
-
import { createCustomFocusIndicatorStyle } from
|
|
2
|
+
import { makeResetStyles, makeStyles, mergeClasses } from "@griffel/react";
|
|
3
|
+
import { tokens } from "@fluentui/react-theme";
|
|
4
|
+
import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
|
|
5
5
|
export const colorSwatchClassNames = {
|
|
6
6
|
root: 'fui-ColorSwatch',
|
|
7
7
|
icon: 'fui-ColorSwatch__icon',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useEmptySwatch_unstable } from
|
|
4
|
-
import { renderEmptySwatch_unstable } from
|
|
5
|
-
import { useEmptySwatchStyles_unstable } from
|
|
6
|
-
import { useCustomStyleHook_unstable } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useEmptySwatch_unstable } from "./useEmptySwatch.js";
|
|
4
|
+
import { renderEmptySwatch_unstable } from "./renderEmptySwatch.js";
|
|
5
|
+
import { useEmptySwatchStyles_unstable } from "./useEmptySwatchStyles.styles.js";
|
|
6
|
+
import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
|
|
7
7
|
/**
|
|
8
8
|
* EmptySwatch component is used for adding new color swatches.
|
|
9
9
|
*/ export const EmptySwatch = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/EmptySwatch/EmptySwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useEmptySwatch_unstable } from './useEmptySwatch';\nimport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nimport { useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\nimport type { EmptySwatchProps } from './EmptySwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * EmptySwatch component is used for adding new color swatches.\n */\nexport const EmptySwatch: ForwardRefComponent<EmptySwatchProps> = React.forwardRef((props, ref) => {\n const state = useEmptySwatch_unstable(props, ref);\n\n useEmptySwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useEmptySwatchStyles_unstable')(state);\n return renderEmptySwatch_unstable(state);\n});\n\nEmptySwatch.displayName = 'EmptySwatch';\n"],"names":["React","useEmptySwatch_unstable","renderEmptySwatch_unstable","useEmptySwatchStyles_unstable","useCustomStyleHook_unstable","EmptySwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/EmptySwatch/EmptySwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useEmptySwatch_unstable } from './useEmptySwatch';\nimport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nimport { useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\nimport type { EmptySwatchProps } from './EmptySwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * EmptySwatch component is used for adding new color swatches.\n */\nexport const EmptySwatch: ForwardRefComponent<EmptySwatchProps> = React.forwardRef((props, ref) => {\n const state = useEmptySwatch_unstable(props, ref);\n\n useEmptySwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useEmptySwatchStyles_unstable')(state);\n return renderEmptySwatch_unstable(state);\n});\n\nEmptySwatch.displayName = 'EmptySwatch';\n"],"names":["React","useEmptySwatch_unstable","renderEmptySwatch_unstable","useEmptySwatchStyles_unstable","useCustomStyleHook_unstable","EmptySwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAC7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { EmptySwatch } from
|
|
2
|
-
export { renderEmptySwatch_unstable } from
|
|
3
|
-
export { useEmptySwatch_unstable } from
|
|
4
|
-
export { emptySwatchClassNames, useEmptySwatchStyles_unstable } from
|
|
1
|
+
export { EmptySwatch } from "./EmptySwatch.js";
|
|
2
|
+
export { renderEmptySwatch_unstable } from "./renderEmptySwatch.js";
|
|
3
|
+
export { useEmptySwatch_unstable } from "./useEmptySwatch.js";
|
|
4
|
+
export { emptySwatchClassNames, useEmptySwatchStyles_unstable } from "./useEmptySwatchStyles.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/EmptySwatch/index.ts"],"sourcesContent":["export { EmptySwatch } from './EmptySwatch';\nexport type { EmptySwatchProps, EmptySwatchSlots, EmptySwatchState } from './EmptySwatch.types';\nexport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nexport { useEmptySwatch_unstable } from './useEmptySwatch';\nexport { emptySwatchClassNames, useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\n"],"names":["EmptySwatch","renderEmptySwatch_unstable","useEmptySwatch_unstable","emptySwatchClassNames","useEmptySwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/EmptySwatch/index.ts"],"sourcesContent":["export { EmptySwatch } from './EmptySwatch';\nexport type { EmptySwatchProps, EmptySwatchSlots, EmptySwatchState } from './EmptySwatch.types';\nexport { renderEmptySwatch_unstable } from './renderEmptySwatch';\nexport { useEmptySwatch_unstable } from './useEmptySwatch';\nexport { emptySwatchClassNames, useEmptySwatchStyles_unstable } from './useEmptySwatchStyles.styles';\n"],"names":["EmptySwatch","renderEmptySwatch_unstable","useEmptySwatch_unstable","emptySwatchClassNames","useEmptySwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of EmptySwatch
|
|
5
5
|
*/ export const renderEmptySwatch_unstable = (state)=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getIntrinsicElementProps, slot } from
|
|
3
|
-
import { useSwatchPickerContextValue_unstable } from
|
|
2
|
+
import { getIntrinsicElementProps, slot } from "@fluentui/react-utilities";
|
|
3
|
+
import { useSwatchPickerContextValue_unstable } from "../../contexts/swatchPicker.js";
|
|
4
4
|
/**
|
|
5
5
|
* Create the state required to render EmptySwatch.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/EmptySwatch/useEmptySwatch.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { EmptySwatchProps, EmptySwatchState } from './EmptySwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the state required to render EmptySwatch.\n *\n * The returned state can be modified with hooks such as useEmptySwatchStyles_unstable,\n * before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatch_unstable = (\n props: EmptySwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchState => {\n const { size, shape, ...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 role = isGrid ? 'gridcell' : 'radio';\n const a11yProps = isGrid ? {} : { 'aria-checked': false };\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...a11yProps,\n ...rest,\n }),\n { elementType: 'button' },\n ),\n size: size ?? _size,\n shape: shape ?? _shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useEmptySwatch_unstable","props","ref","size","shape","rest","_size","ctx","_shape","isGrid","role","a11yProps","components","root","always","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,oCAAoC,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/EmptySwatch/useEmptySwatch.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type { EmptySwatchProps, EmptySwatchState } from './EmptySwatch.types';\nimport { useSwatchPickerContextValue_unstable } from '../../contexts/swatchPicker';\n\n/**\n * Create the state required to render EmptySwatch.\n *\n * The returned state can be modified with hooks such as useEmptySwatchStyles_unstable,\n * before being passed to renderEmptySwatch_unstable.\n *\n * @param props - props from this instance of EmptySwatch\n * @param ref - reference to root HTMLDivElement of EmptySwatch\n */\nexport const useEmptySwatch_unstable = (\n props: EmptySwatchProps,\n ref: React.Ref<HTMLButtonElement>,\n): EmptySwatchState => {\n const { size, shape, ...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 role = isGrid ? 'gridcell' : 'radio';\n const a11yProps = isGrid ? {} : { 'aria-checked': false };\n return {\n components: {\n root: 'button',\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref,\n role,\n ...a11yProps,\n ...rest,\n }),\n { elementType: 'button' },\n ),\n size: size ?? _size,\n shape: shape ?? _shape,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useEmptySwatch_unstable","props","ref","size","shape","rest","_size","ctx","_shape","isGrid","role","a11yProps","components","root","always","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,oCAAoC,QAAQ,iCAA8B;AAEnF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC;IAEA,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGJ;IACjC,MAAMK,QAAQP,qCAAqCQ,CAAAA,MAAOA,IAAIJ,IAAI;IAClE,MAAMK,SAAST,qCAAqCQ,CAAAA,MAAOA,IAAIH,KAAK;IACpE,MAAMK,SAASV,qCAAqCQ,CAAAA,MAAOA,IAAIE,MAAM;IAErE,MAAMC,OAAOD,SAAS,aAAa;IACnC,MAAME,YAAYF,SAAS,CAAC,IAAI;QAAE,gBAAgB;IAAM;IACxD,OAAO;QACLG,YAAY;YACVC,MAAM;QACR;QACAA,MAAMf,KAAKgB,MAAM,CACfjB,yBAAyB,UAAU;YACjCK;YACAQ;YACA,GAAGC,SAAS;YACZ,GAAGN,IAAI;QACT,IACA;YAAEU,aAAa;QAAS;QAE1BZ,MAAMA,iBAAAA,kBAAAA,OAAQG;QACdF,OAAOA,kBAAAA,mBAAAA,QAASI;IAClB;AACF,EAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { __resetStyles, __styles, mergeClasses } from
|
|
4
|
-
import { tokens } from
|
|
5
|
-
import { createCustomFocusIndicatorStyle } from
|
|
3
|
+
import { __resetStyles, __styles, mergeClasses } from "@griffel/react";
|
|
4
|
+
import { tokens } from "@fluentui/react-theme";
|
|
5
|
+
import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
|
|
6
6
|
export const emptySwatchClassNames = {
|
|
7
7
|
root: 'fui-EmptySwatch'
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createCustomFocusIndicatorStyle","emptySwatchClassNames","root","useStyles","useSizeStyles","a9b677","Bqenvij","small","medium","large","d","useShapeStyles","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","circular","square","p","useEmptySwatchStyles_unstable","state","styles","sizeStyles","shapeStyles","_state_size","size","_state_shape","className","shape"],"sources":["useEmptySwatchStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from
|
|
1
|
+
{"version":3,"names":["__resetStyles","__styles","mergeClasses","tokens","createCustomFocusIndicatorStyle","emptySwatchClassNames","root","useStyles","useSizeStyles","a9b677","Bqenvij","small","medium","large","d","useShapeStyles","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","circular","square","p","useEmptySwatchStyles_unstable","state","styles","sizeStyles","shapeStyles","_state_size","size","_state_shape","className","shape"],"sources":["useEmptySwatchStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens } from \"@fluentui/react-theme\";\nimport { createCustomFocusIndicatorStyle } from \"@fluentui/react-tabster\";\nexport const emptySwatchClassNames = {\n root: 'fui-EmptySwatch'\n};\n/**\n * Styles for the root slot\n */ const useStyles = makeResetStyles({\n backgroundColor: tokens.colorTransparentBackground,\n border: `1px dashed ${tokens.colorNeutralForeground4}`\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 EmptySwatch slots based on the state\n */ export const useEmptySwatchStyles_unstable = (state)=>{\n const styles = useStyles();\n const sizeStyles = useSizeStyles();\n const shapeStyles = useShapeStyles();\n var _state_size;\n const size = (_state_size = state.size) !== null && _state_size !== void 0 ? _state_size : 'medium';\n var _state_shape;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(emptySwatchClassNames.root, styles, sizeStyles[size], shapeStyles[(_state_shape = state.shape) !== null && _state_shape !== void 0 ? _state_shape : 'square'], state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAAAC,QAAA,EAAsCC,YAAY,QAAQ,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGP,aAAA,sIAGrB,CAAC;AACF,MAAMQ,aAAa,gBAAGP,QAAA;EAAA;IAAAQ,MAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAF,MAAA;IAAAC,OAAA;EAAA;EAAAE,MAAA;IAAAH,MAAA;IAAAC,OAAA;EAAA;EAAAG,KAAA;IAAAJ,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAI,CAAA;AAAA,CAiBrB,CAAC;AACF,MAAMC,cAAc,gBAAGd,QAAA;EAAAe,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAV,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAE,MAAA;IAAAX,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAAZ,CAAA;IAAAe,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAmBtB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,6BAA6B,GAAIC,KAAK,IAAG;EACtD,MAAMC,MAAM,GAAGzB,SAAS,CAAC,CAAC;EAC1B,MAAM0B,UAAU,GAAGzB,aAAa,CAAC,CAAC;EAClC,MAAM0B,WAAW,GAAGnB,cAAc,CAAC,CAAC;EACpC,IAAIoB,WAAW;EACf,MAAMC,IAAI,GAAG,CAACD,WAAW,GAAGJ,KAAK,CAACK,IAAI,MAAM,IAAI,IAAID,WAAW,KAAK,KAAK,CAAC,GAAGA,WAAW,GAAG,QAAQ;EACnG,IAAIE,YAAY;EAChB;EACAN,KAAK,CAACzB,IAAI,CAACgC,SAAS,GAAGpC,YAAY,CAACG,qBAAqB,CAACC,IAAI,EAAE0B,MAAM,EAAEC,UAAU,CAACG,IAAI,CAAC,EAAEF,WAAW,CAAC,CAACG,YAAY,GAAGN,KAAK,CAACQ,KAAK,MAAM,IAAI,IAAIF,YAAY,KAAK,KAAK,CAAC,GAAGA,YAAY,GAAG,QAAQ,CAAC,EAAEN,KAAK,CAACzB,IAAI,CAACgC,SAAS,CAAC;EACxN,OAAOP,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { makeResetStyles, makeStyles, mergeClasses } from
|
|
3
|
-
import { tokens } from
|
|
4
|
-
import { createCustomFocusIndicatorStyle } from
|
|
2
|
+
import { makeResetStyles, makeStyles, mergeClasses } from "@griffel/react";
|
|
3
|
+
import { tokens } from "@fluentui/react-theme";
|
|
4
|
+
import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
|
|
5
5
|
export const emptySwatchClassNames = {
|
|
6
6
|
root: 'fui-EmptySwatch'
|
|
7
7
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useImageSwatch_unstable } from
|
|
4
|
-
import { renderImageSwatch_unstable } from
|
|
5
|
-
import { useImageSwatchStyles_unstable } from
|
|
6
|
-
import { useCustomStyleHook_unstable } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useImageSwatch_unstable } from "./useImageSwatch.js";
|
|
4
|
+
import { renderImageSwatch_unstable } from "./renderImageSwatch.js";
|
|
5
|
+
import { useImageSwatchStyles_unstable } from "./useImageSwatchStyles.styles.js";
|
|
6
|
+
import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
|
|
7
7
|
/**
|
|
8
8
|
* ImageSwatch component is used to render an images, patterns and textures.
|
|
9
9
|
*/ export const ImageSwatch = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ImageSwatch/ImageSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useImageSwatch_unstable } from './useImageSwatch';\nimport { renderImageSwatch_unstable } from './renderImageSwatch';\nimport { useImageSwatchStyles_unstable } from './useImageSwatchStyles.styles';\nimport type { ImageSwatchProps } from './ImageSwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ImageSwatch component is used to render an images, patterns and textures.\n */\nexport const ImageSwatch: ForwardRefComponent<ImageSwatchProps> = React.forwardRef((props, ref) => {\n const state = useImageSwatch_unstable(props, ref);\n\n useImageSwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useImageSwatchStyles_unstable')(state);\n\n return renderImageSwatch_unstable(state);\n});\n\nImageSwatch.displayName = 'ImageSwatch';\n"],"names":["React","useImageSwatch_unstable","renderImageSwatch_unstable","useImageSwatchStyles_unstable","useCustomStyleHook_unstable","ImageSwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/ImageSwatch/ImageSwatch.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useImageSwatch_unstable } from './useImageSwatch';\nimport { renderImageSwatch_unstable } from './renderImageSwatch';\nimport { useImageSwatchStyles_unstable } from './useImageSwatchStyles.styles';\nimport type { ImageSwatchProps } from './ImageSwatch.types';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ImageSwatch component is used to render an images, patterns and textures.\n */\nexport const ImageSwatch: ForwardRefComponent<ImageSwatchProps> = React.forwardRef((props, ref) => {\n const state = useImageSwatch_unstable(props, ref);\n\n useImageSwatchStyles_unstable(state);\n useCustomStyleHook_unstable('useImageSwatchStyles_unstable')(state);\n\n return renderImageSwatch_unstable(state);\n});\n\nImageSwatch.displayName = 'ImageSwatch';\n"],"names":["React","useImageSwatch_unstable","renderImageSwatch_unstable","useImageSwatchStyles_unstable","useCustomStyleHook_unstable","ImageSwatch","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,6BAA6B,QAAQ,mCAAgC;AAE9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,4BAAqDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzF,MAAMC,QAAQR,wBAAwBM,OAAOC;IAE7CL,8BAA8BM;IAC9BL,4BAA4B,iCAAiCK;IAE7D,OAAOP,2BAA2BO;AACpC,GAAG;AAEHJ,YAAYK,WAAW,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ImageSwatch } from
|
|
2
|
-
export { renderImageSwatch_unstable } from
|
|
3
|
-
export { useImageSwatch_unstable } from
|
|
4
|
-
export { imageSwatchClassNames, useImageSwatchStyles_unstable } from
|
|
1
|
+
export { ImageSwatch } from "./ImageSwatch.js";
|
|
2
|
+
export { renderImageSwatch_unstable } from "./renderImageSwatch.js";
|
|
3
|
+
export { useImageSwatch_unstable } from "./useImageSwatch.js";
|
|
4
|
+
export { imageSwatchClassNames, useImageSwatchStyles_unstable } from "./useImageSwatchStyles.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ImageSwatch/index.ts"],"sourcesContent":["export { ImageSwatch } from './ImageSwatch';\nexport type { ImageSwatchProps, ImageSwatchSlots, ImageSwatchState } from './ImageSwatch.types';\nexport { renderImageSwatch_unstable } from './renderImageSwatch';\nexport { useImageSwatch_unstable } from './useImageSwatch';\nexport { imageSwatchClassNames, useImageSwatchStyles_unstable } from './useImageSwatchStyles.styles';\n"],"names":["ImageSwatch","renderImageSwatch_unstable","useImageSwatch_unstable","imageSwatchClassNames","useImageSwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/ImageSwatch/index.ts"],"sourcesContent":["export { ImageSwatch } from './ImageSwatch';\nexport type { ImageSwatchProps, ImageSwatchSlots, ImageSwatchState } from './ImageSwatch.types';\nexport { renderImageSwatch_unstable } from './renderImageSwatch';\nexport { useImageSwatch_unstable } from './useImageSwatch';\nexport { imageSwatchClassNames, useImageSwatchStyles_unstable } from './useImageSwatchStyles.styles';\n"],"names":["ImageSwatch","renderImageSwatch_unstable","useImageSwatch_unstable","imageSwatchClassNames","useImageSwatchStyles_unstable"],"mappings":"AAAA,SAASA,WAAW,QAAQ,mBAAgB;AAE5C,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,uBAAuB,QAAQ,sBAAmB;AAC3D,SAASC,qBAAqB,EAAEC,6BAA6B,QAAQ,mCAAgC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of ImageSwatch
|
|
5
5
|
*/ export const renderImageSwatch_unstable = (state)=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getIntrinsicElementProps, slot, useEventCallback, mergeCallbacks } from
|
|
3
|
-
import { useSwatchPickerContextValue_unstable } from
|
|
2
|
+
import { getIntrinsicElementProps, slot, useEventCallback, mergeCallbacks } from "@fluentui/react-utilities";
|
|
3
|
+
import { useSwatchPickerContextValue_unstable } from "../../contexts/swatchPicker.js";
|
|
4
4
|
/**
|
|
5
5
|
* Create the state required to render ImageSwatch.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/ImageSwatch/useImageSwatch.ts"],"sourcesContent":["'use client';\n\nimport type * 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":["getIntrinsicElementProps","slot","useEventCallback","mergeCallbacks","useSwatchPickerContextValue_unstable","useImageSwatch_unstable","props","ref","src","value","onClick","style","rest","size","ctx","shape","isGrid","requestSelectionChange","selected","selectedValue","role","ariaSelected","onImageSwatchClick","event","selectedSwatch","components","root","always","backgroundImage","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,4BAA4B;AAE7G,SAASC,oCAAoC,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/ImageSwatch/useImageSwatch.ts"],"sourcesContent":["'use client';\n\nimport type * 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":["getIntrinsicElementProps","slot","useEventCallback","mergeCallbacks","useSwatchPickerContextValue_unstable","useImageSwatch_unstable","props","ref","src","value","onClick","style","rest","size","ctx","shape","isGrid","requestSelectionChange","selected","selectedValue","role","ariaSelected","onImageSwatchClick","event","selectedSwatch","components","root","always","backgroundImage","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,EAAEC,gBAAgB,EAAEC,cAAc,QAAQ,4BAA4B;AAE7G,SAASC,oCAAoC,QAAQ,iCAA8B;AAEnF;;;;;;;;CAQC,GACD,OAAO,MAAMC,0BAA0B,CACrCC,OACAC;IAEA,MAAM,EAAEC,GAAG,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGN;IAChD,MAAMO,OAAOT,qCAAqCU,CAAAA,MAAOA,IAAID,IAAI;IACjE,MAAME,QAAQX,qCAAqCU,CAAAA,MAAOA,IAAIC,KAAK;IACnE,MAAMC,SAASZ,qCAAqCU,CAAAA,MAAOA,IAAIE,MAAM;IAErE,MAAMC,yBAAyBb,qCAAqCU,CAAAA,MAAOA,IAAIG,sBAAsB;IACrG,MAAMC,WAAWd,qCAAqCU,CAAAA,MAAOA,IAAIK,aAAa,KAAKV;IAEnF,MAAMW,OAAOJ,SAAS,aAAa;IACnC,MAAMK,eAAeL,SACjB;QACE,iBAAiBE;IACnB,IACA;QAAE,gBAAgBA;IAAS;IAE/B,MAAMI,qBAAqBpB,iBACzBC,eAAeO,SAAS,CAACa,QACvBN,uBAAuBM,OAAO;YAC5BJ,eAAeV;YACfe,gBAAgBhB;QAClB;IAIJ,OAAO;QACLiB,YAAY;YACVC,MAAM;QACR;QACAA,MAAMzB,KAAK0B,MAAM,CACf3B,yBAAyB,UAAU;YACjCO;YACAa;YACA,GAAGC,YAAY;YACfX,SAASY;YACT,GAAGV,IAAI;YACPD,OAAO;gBACLiB,iBAAiB,CAAC,IAAI,EAAEpB,IAAI,CAAC,CAAC;gBAC9B,GAAGG,KAAK;YACV;QACF,IACA;YAAEkB,aAAa;QAAS;QAE1BpB;QACAS;QACAL;QACAE;IACF;AACF,EAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { __styles, mergeClasses, __resetStyles } from
|
|
4
|
-
import { tokens } from
|
|
5
|
-
import { createCustomFocusIndicatorStyle } from
|
|
3
|
+
import { __styles, mergeClasses, __resetStyles } from "@griffel/react";
|
|
4
|
+
import { tokens } from "@fluentui/react-theme";
|
|
5
|
+
import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
|
|
6
6
|
export const imageSwatchClassNames = {
|
|
7
7
|
root: 'fui-ImageSwatch'
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","__resetStyles","tokens","createCustomFocusIndicatorStyle","imageSwatchClassNames","root","useStyles","r","s","useStylesSelected","selected","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","Bvxd0ez","vajtyg","j6ew2k","Bv9i2bc","d","p","h","m","useSizeStyles","a9b677","Bqenvij","small","medium","large","useShapeStyles","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","circular","square","useImageSwatchStyles_unstable","state","styles","selectedStyles","sizeStyles","shapeStyles","size","shape","className"],"sources":["useImageSwatchStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses, makeResetStyles } from
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","__resetStyles","tokens","createCustomFocusIndicatorStyle","imageSwatchClassNames","root","useStyles","r","s","useStylesSelected","selected","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","E5pizo","Bvxd0ez","vajtyg","j6ew2k","Bv9i2bc","d","p","h","m","useSizeStyles","a9b677","Bqenvij","small","medium","large","useShapeStyles","rounded","Beyfa6y","Bbmb7ep","Btl43ni","B7oj6ja","Dimara","Bw81rd7","kdpuga","dm238s","B6xbmo0","B3whbx2","circular","square","useImageSwatchStyles_unstable","state","styles","selectedStyles","sizeStyles","shapeStyles","size","shape","className"],"sources":["useImageSwatchStyles.styles.js"],"sourcesContent":["'use client';\nimport { 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 const styles = useStyles();\n const selectedStyles = useStylesSelected();\n const sizeStyles = useSizeStyles();\n const shapeStyles = useShapeStyles();\n const { size = 'medium', shape = 'square' } = state;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(imageSwatchClassNames.root, styles, sizeStyles[size], shapeStyles[shape], state.selected && selectedStyles.selected, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,EAAAC,aAAA,QAAyB,gBAAgB;AAC1E,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,+BAA+B,QAAQ,yBAAyB;AACzE,OAAO,MAAMC,qBAAqB,GAAG;EACjCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,aAAA;EAAAM,CAAA;EAAAC,CAAA;AAAA,CAqCrB,CAAC;AACF,MAAMC,iBAAiB,gBAAGV,QAAA;EAAAW,QAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAC,CAAA;IAAAC,CAAA;EAAA;EAAAC,CAAA;EAAAC,CAAA;IAAAA,CAAA;EAAA;AAAA,CAiBzB,CAAC;AACF,MAAMC,aAAa,gBAAGtC,QAAA;EAAA;IAAAuC,MAAA;IAAAC,OAAA;EAAA;EAAAC,KAAA;IAAAF,MAAA;IAAAC,OAAA;EAAA;EAAAE,MAAA;IAAAH,MAAA;IAAAC,OAAA;EAAA;EAAAG,KAAA;IAAAJ,MAAA;IAAAC,OAAA;EAAA;AAAA;EAAAN,CAAA;AAAA,CAiBrB,CAAC;AACF,MAAMU,cAAc,gBAAG5C,QAAA;EAAA6C,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAC,QAAA;IAAAV,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;EAAAE,MAAA;IAAAX,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,OAAA;EAAA;AAAA;EAAArB,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAmBtB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMuB,6BAA6B,GAAIC,KAAK,IAAG;EACtD,MAAMC,MAAM,GAAGrD,SAAS,CAAC,CAAC;EAC1B,MAAMsD,cAAc,GAAGnD,iBAAiB,CAAC,CAAC;EAC1C,MAAMoD,UAAU,GAAGxB,aAAa,CAAC,CAAC;EAClC,MAAMyB,WAAW,GAAGnB,cAAc,CAAC,CAAC;EACpC,MAAM;IAAEoB,IAAI,GAAG,QAAQ;IAAEC,KAAK,GAAG;EAAS,CAAC,GAAGN,KAAK;EACnD;EACAA,KAAK,CAACrD,IAAI,CAAC4D,SAAS,GAAGjE,YAAY,CAACI,qBAAqB,CAACC,IAAI,EAAEsD,MAAM,EAAEE,UAAU,CAACE,IAAI,CAAC,EAAED,WAAW,CAACE,KAAK,CAAC,EAAEN,KAAK,CAAChD,QAAQ,IAAIkD,cAAc,CAAClD,QAAQ,EAAEgD,KAAK,CAACrD,IAAI,CAAC4D,SAAS,CAAC;EAC9K,OAAOP,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { makeStyles, mergeClasses, makeResetStyles } from
|
|
3
|
-
import { tokens } from
|
|
4
|
-
import { createCustomFocusIndicatorStyle } from
|
|
2
|
+
import { makeStyles, mergeClasses, makeResetStyles } from "@griffel/react";
|
|
3
|
+
import { tokens } from "@fluentui/react-theme";
|
|
4
|
+
import { createCustomFocusIndicatorStyle } from "@fluentui/react-tabster";
|
|
5
5
|
export const imageSwatchClassNames = {
|
|
6
6
|
root: 'fui-ImageSwatch'
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useSwatchPicker_unstable } from
|
|
4
|
-
import { renderSwatchPicker_unstable } from
|
|
5
|
-
import { useSwatchPickerStyles_unstable } from
|
|
6
|
-
import { useSwatchPickerContextValues } from
|
|
7
|
-
import { useCustomStyleHook_unstable } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useSwatchPicker_unstable } from "./useSwatchPicker.js";
|
|
4
|
+
import { renderSwatchPicker_unstable } from "./renderSwatchPicker.js";
|
|
5
|
+
import { useSwatchPickerStyles_unstable } from "./useSwatchPickerStyles.styles.js";
|
|
6
|
+
import { useSwatchPickerContextValues } from "./useSwatchPickerContextValues.js";
|
|
7
|
+
import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
|
|
8
8
|
/**
|
|
9
9
|
* SwatchPicker component - TODO: add more docs
|
|
10
10
|
*/ export const SwatchPicker = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["'use client';\n\nimport * 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 './useSwatchPickerContextValues';\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":["React","useSwatchPicker_unstable","renderSwatchPicker_unstable","useSwatchPickerStyles_unstable","useSwatchPickerContextValues","useCustomStyleHook_unstable","SwatchPicker","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPicker/SwatchPicker.tsx"],"sourcesContent":["'use client';\n\nimport * 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 './useSwatchPickerContextValues';\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":["React","useSwatchPicker_unstable","renderSwatchPicker_unstable","useSwatchPickerStyles_unstable","useSwatchPickerContextValues","useCustomStyleHook_unstable","SwatchPicker","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,2BAA2B,QAAQ,0BAAuB;AACnE,SAASC,8BAA8B,QAAQ,oCAAiC;AAEhF,SAASC,4BAA4B,QAAQ,oCAAiC;AAC9E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,6BAAuDN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQT,yBAAyBO,OAAOC;IAC9C,MAAME,gBAAgBP,6BAA6BM;IAEnDP,+BAA+BO;IAC/BL,4BAA4B,kCAAkCK;IAE9D,OAAOR,4BAA4BQ,OAAOC;AAC5C,GAAG;AAEHL,aAAaM,WAAW,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SwatchPicker } from
|
|
2
|
-
export { renderSwatchPicker_unstable } from
|
|
3
|
-
export { useSwatchPicker_unstable } from
|
|
4
|
-
export { swatchPickerClassNames, useSwatchPickerStyles_unstable } from
|
|
1
|
+
export { SwatchPicker } from "./SwatchPicker.js";
|
|
2
|
+
export { renderSwatchPicker_unstable } from "./renderSwatchPicker.js";
|
|
3
|
+
export { useSwatchPicker_unstable } from "./useSwatchPicker.js";
|
|
4
|
+
export { swatchPickerClassNames, useSwatchPickerStyles_unstable } from "./useSwatchPickerStyles.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPicker/index.ts"],"sourcesContent":["export { SwatchPicker } from './SwatchPicker';\nexport type {\n SwatchPickerOnSelectEventHandler,\n SwatchPickerOnSelectionChangeData,\n SwatchPickerProps,\n SwatchPickerSlots,\n SwatchPickerState,\n} from './SwatchPicker.types';\nexport { renderSwatchPicker_unstable } from './renderSwatchPicker';\nexport { useSwatchPicker_unstable } from './useSwatchPicker';\nexport { swatchPickerClassNames, useSwatchPickerStyles_unstable } from './useSwatchPickerStyles.styles';\n"],"names":["SwatchPicker","renderSwatchPicker_unstable","useSwatchPicker_unstable","swatchPickerClassNames","useSwatchPickerStyles_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPicker/index.ts"],"sourcesContent":["export { SwatchPicker } from './SwatchPicker';\nexport type {\n SwatchPickerOnSelectEventHandler,\n SwatchPickerOnSelectionChangeData,\n SwatchPickerProps,\n SwatchPickerSlots,\n SwatchPickerState,\n} from './SwatchPicker.types';\nexport { renderSwatchPicker_unstable } from './renderSwatchPicker';\nexport { useSwatchPicker_unstable } from './useSwatchPicker';\nexport { swatchPickerClassNames, useSwatchPickerStyles_unstable } from './useSwatchPickerStyles.styles';\n"],"names":["SwatchPicker","renderSwatchPicker_unstable","useSwatchPicker_unstable","swatchPickerClassNames","useSwatchPickerStyles_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAiB;AAQ9C,SAASC,2BAA2B,QAAQ,0BAAuB;AACnE,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,sBAAsB,EAAEC,8BAA8B,QAAQ,oCAAiC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from
|
|
3
|
-
import { SwatchPickerProvider } from
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
|
+
import { SwatchPickerProvider } from "../../contexts/swatchPicker.js";
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of SwatchPicker
|
|
6
6
|
*/ export const renderSwatchPicker_unstable = (state, contextValues)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPicker/renderSwatchPicker.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 { 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 = (\n state: SwatchPickerState,\n contextValues: SwatchPickerContextValues,\n): JSXElement => {\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":["assertSlots","SwatchPickerProvider","renderSwatchPicker_unstable","state","contextValues","value","swatchPicker","root","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,oBAAoB,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPicker/renderSwatchPicker.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 { 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 = (\n state: SwatchPickerState,\n contextValues: SwatchPickerContextValues,\n): JSXElement => {\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":["assertSlots","SwatchPickerProvider","renderSwatchPicker_unstable","state","contextValues","value","swatchPicker","root","children"],"mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,QAAQ,4BAA4B;AAExD,SAASC,oBAAoB,QAAQ,iCAA8B;AAInE;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEAJ,YAA+BG;IAE/B,qBACE,KAACF;QAAqBI,OAAOD,cAAcE,YAAY;kBACrD,cAAA,KAACH,MAAMI,IAAI;sBAAEJ,MAAMI,IAAI,CAACC,QAAQ;;;AAGtC,EAAE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { useFieldControlProps_unstable } from
|
|
3
|
-
import { useArrowNavigationGroup } from
|
|
4
|
-
import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from
|
|
2
|
+
import { useFieldControlProps_unstable } from "@fluentui/react-field";
|
|
3
|
+
import { useArrowNavigationGroup } from "@fluentui/react-tabster";
|
|
4
|
+
import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from "@fluentui/react-utilities";
|
|
5
5
|
/**
|
|
6
6
|
* Create the state required to render SwatchPicker.
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
export const useSwatchPickerContextValues = (state)=>{
|
|
4
4
|
const { isGrid, size, shape, spacing, requestSelectionChange, selectedValue } = state;
|
|
5
5
|
const swatchPicker = React.useMemo(()=>({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { __styles, mergeClasses } from
|
|
4
|
-
import { tokens } from
|
|
3
|
+
import { __styles, mergeClasses } from "@griffel/react";
|
|
4
|
+
import { tokens } from "@fluentui/react-theme";
|
|
5
5
|
export const swatchPickerClassNames = {
|
|
6
6
|
root: 'fui-SwatchPicker'
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","tokens","swatchPickerClassNames","root","useStyles","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","mc9l5x","row","Beiy3e4","grid","spacingSmall","i8kkvl","Belr9w4","rmohyg","spacingMedium","d","p","useSwatchPickerStyles_unstable","state","styles","layoutStyle","isGrid","spacingStyle","spacing","className"],"sources":["useSwatchPickerStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tokens","swatchPickerClassNames","root","useStyles","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","mc9l5x","row","Beiy3e4","grid","spacingSmall","i8kkvl","Belr9w4","rmohyg","spacingMedium","d","p","useSwatchPickerStyles_unstable","state","styles","layoutStyle","isGrid","spacingStyle","spacing","className"],"sources":["useSwatchPickerStyles.styles.js"],"sourcesContent":["'use client';\nimport { 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 const styles = useStyles();\n const layoutStyle = state.isGrid ? styles.grid : styles.row;\n const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(swatchPickerClassNames.root, styles.root, layoutStyle, spacingStyle, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,OAAO,MAAMC,sBAAsB,GAAG;EAClCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,SAAS,gBAAGL,QAAA;EAAAI,IAAA;IAAAE,OAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,GAAA;IAAAC,OAAA;EAAA;EAAAC,IAAA;IAAAD,OAAA;EAAA;EAAAE,YAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;EAAAC,aAAA;IAAAH,MAAA;IAAAC,OAAA;IAAAC,MAAA;EAAA;AAAA;EAAAE,CAAA;IAAAC,CAAA;EAAA;IAAAA,CAAA;EAAA;IAAAA,CAAA;EAAA;AAAA,CAiBrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,8BAA8B,GAAIC,KAAK,IAAG;EACvD,MAAMC,MAAM,GAAGnB,SAAS,CAAC,CAAC;EAC1B,MAAMoB,WAAW,GAAGF,KAAK,CAACG,MAAM,GAAGF,MAAM,CAACV,IAAI,GAAGU,MAAM,CAACZ,GAAG;EAC3D,MAAMe,YAAY,GAAGJ,KAAK,CAACK,OAAO,KAAK,OAAO,GAAGJ,MAAM,CAACT,YAAY,GAAGS,MAAM,CAACL,aAAa;EAC3F;EACAI,KAAK,CAACnB,IAAI,CAACyB,SAAS,GAAG5B,YAAY,CAACE,sBAAsB,CAACC,IAAI,EAAEoB,MAAM,CAACpB,IAAI,EAAEqB,WAAW,EAAEE,YAAY,EAAEJ,KAAK,CAACnB,IAAI,CAACyB,SAAS,CAAC;EAC9H,OAAON,KAAK;AAChB,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { makeStyles, mergeClasses } from
|
|
3
|
-
import { tokens } from
|
|
2
|
+
import { makeStyles, mergeClasses } from "@griffel/react";
|
|
3
|
+
import { tokens } from "@fluentui/react-theme";
|
|
4
4
|
export const swatchPickerClassNames = {
|
|
5
5
|
root: 'fui-SwatchPicker'
|
|
6
6
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import * as React from
|
|
3
|
-
import { useSwatchPickerRow_unstable } from
|
|
4
|
-
import { renderSwatchPickerRow_unstable } from
|
|
5
|
-
import { useSwatchPickerRowStyles_unstable } from
|
|
6
|
-
import { useCustomStyleHook_unstable } from
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useSwatchPickerRow_unstable } from "./useSwatchPickerRow.js";
|
|
4
|
+
import { renderSwatchPickerRow_unstable } from "./renderSwatchPickerRow.js";
|
|
5
|
+
import { useSwatchPickerRowStyles_unstable } from "./useSwatchPickerRowStyles.styles.js";
|
|
6
|
+
import { useCustomStyleHook_unstable } from "@fluentui/react-shared-contexts";
|
|
7
7
|
/**
|
|
8
8
|
* SwatchPickerRow component is used to render a row of swatches.
|
|
9
9
|
*/ export const SwatchPickerRow = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPickerRow/SwatchPickerRow.tsx"],"sourcesContent":["'use client';\n\nimport * 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":["React","useSwatchPickerRow_unstable","renderSwatchPickerRow_unstable","useSwatchPickerRowStyles_unstable","useCustomStyleHook_unstable","SwatchPickerRow","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPickerRow/SwatchPickerRow.tsx"],"sourcesContent":["'use client';\n\nimport * 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":["React","useSwatchPickerRow_unstable","renderSwatchPickerRow_unstable","useSwatchPickerRowStyles_unstable","useCustomStyleHook_unstable","SwatchPickerRow","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,2BAA2B,QAAQ,0BAAuB;AACnE,SAASC,8BAA8B,QAAQ,6BAA0B;AACzE,SAASC,iCAAiC,QAAQ,uCAAoC;AAEtF,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,gCAA6DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACjG,MAAMC,QAAQR,4BAA4BM,OAAOC;IAEjDL,kCAAkCM;IAClCL,4BAA4B,qCAAqCK;IACjE,OAAOP,+BAA+BO;AACxC,GAAG;AAEHJ,gBAAgBK,WAAW,GAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { SwatchPickerRow } from
|
|
2
|
-
export { renderSwatchPickerRow_unstable } from
|
|
3
|
-
export { useSwatchPickerRow_unstable } from
|
|
4
|
-
export { swatchPickerRowClassNames, useSwatchPickerRowStyles_unstable } from
|
|
1
|
+
export { SwatchPickerRow } from "./SwatchPickerRow.js";
|
|
2
|
+
export { renderSwatchPickerRow_unstable } from "./renderSwatchPickerRow.js";
|
|
3
|
+
export { useSwatchPickerRow_unstable } from "./useSwatchPickerRow.js";
|
|
4
|
+
export { swatchPickerRowClassNames, useSwatchPickerRowStyles_unstable } from "./useSwatchPickerRowStyles.styles.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPickerRow/index.ts"],"sourcesContent":["export { SwatchPickerRow } from './SwatchPickerRow';\nexport type { SwatchPickerRowProps, SwatchPickerRowSlots, SwatchPickerRowState } from './SwatchPickerRow.types';\nexport { renderSwatchPickerRow_unstable } from './renderSwatchPickerRow';\nexport { useSwatchPickerRow_unstable } from './useSwatchPickerRow';\nexport { swatchPickerRowClassNames, useSwatchPickerRowStyles_unstable } from './useSwatchPickerRowStyles.styles';\n"],"names":["SwatchPickerRow","renderSwatchPickerRow_unstable","useSwatchPickerRow_unstable","swatchPickerRowClassNames","useSwatchPickerRowStyles_unstable"],"mappings":"AAAA,SAASA,eAAe,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPickerRow/index.ts"],"sourcesContent":["export { SwatchPickerRow } from './SwatchPickerRow';\nexport type { SwatchPickerRowProps, SwatchPickerRowSlots, SwatchPickerRowState } from './SwatchPickerRow.types';\nexport { renderSwatchPickerRow_unstable } from './renderSwatchPickerRow';\nexport { useSwatchPickerRow_unstable } from './useSwatchPickerRow';\nexport { swatchPickerRowClassNames, useSwatchPickerRowStyles_unstable } from './useSwatchPickerRowStyles.styles';\n"],"names":["SwatchPickerRow","renderSwatchPickerRow_unstable","useSwatchPickerRow_unstable","swatchPickerRowClassNames","useSwatchPickerRowStyles_unstable"],"mappings":"AAAA,SAASA,eAAe,QAAQ,uBAAoB;AAEpD,SAASC,8BAA8B,QAAQ,6BAA0B;AACzE,SAASC,2BAA2B,QAAQ,0BAAuB;AACnE,SAASC,yBAAyB,EAAEC,iCAAiC,QAAQ,uCAAoC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
-
import { assertSlots } from
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of SwatchPickerRow
|
|
5
5
|
*/ export const renderSwatchPickerRow_unstable = (state)=>{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { getIntrinsicElementProps, slot } from
|
|
3
|
-
import { useSwatchPickerContextValue_unstable } from
|
|
2
|
+
import { getIntrinsicElementProps, slot } from "@fluentui/react-utilities";
|
|
3
|
+
import { useSwatchPickerContextValue_unstable } from "../../contexts/swatchPicker.js";
|
|
4
4
|
/**
|
|
5
5
|
* Create the state required to render SwatchPickerRow.
|
|
6
6
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/SwatchPickerRow/useSwatchPickerRow.ts"],"sourcesContent":["'use client';\n\nimport type * 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":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useSwatchPickerRow_unstable","props","ref","style","rest","spacing","ctx","components","root","always","role","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,oCAAoC,QAAQ,
|
|
1
|
+
{"version":3,"sources":["../src/components/SwatchPickerRow/useSwatchPickerRow.ts"],"sourcesContent":["'use client';\n\nimport type * 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":["getIntrinsicElementProps","slot","useSwatchPickerContextValue_unstable","useSwatchPickerRow_unstable","props","ref","style","rest","spacing","ctx","components","root","always","role","elementType"],"mappings":"AAAA;AAGA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAE3E,SAASC,oCAAoC,QAAQ,iCAA8B;AAEnF;;;;;;;;CAQC,GACD,OAAO,MAAMC,8BAA8B,CACzCC,OACAC;IAEA,MAAM,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGH;IAC3B,MAAMI,UAAUN,qCAAqCO,CAAAA,MAAOA,IAAID,OAAO;IAEvE,OAAO;QACLE,YAAY;YACVC,MAAM;QACR;QACAA,MAAMV,KAAKW,MAAM,CACfZ,yBAAyB,OAAO;YAC9BK;YACAQ,MAAM;YACN,GAAGN,IAAI;QACT,IACA;YAAEO,aAAa;QAAM;QAEvBN;IACF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__resetStyles","mergeClasses","__styles","swatchPickerRowClassNames","root","useResetStyles","useStyles","spacingSmall","i8kkvl","spacingMedium","d","useSwatchPickerRowStyles_unstable","state","resetStyles","styles","spacingStyle","spacing","className"],"sources":["useSwatchPickerRowStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeResetStyles, mergeClasses, makeStyles } from
|
|
1
|
+
{"version":3,"names":["__resetStyles","mergeClasses","__styles","swatchPickerRowClassNames","root","useResetStyles","useStyles","spacingSmall","i8kkvl","spacingMedium","d","useSwatchPickerRowStyles_unstable","state","resetStyles","styles","spacingStyle","spacing","className"],"sources":["useSwatchPickerRowStyles.styles.js"],"sourcesContent":["'use client';\nimport { 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 const resetStyles = useResetStyles();\n const styles = useStyles();\n const spacingStyle = state.spacing === 'small' ? styles.spacingSmall : styles.spacingMedium;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(swatchPickerRowClassNames.root, resetStyles, spacingStyle, state.root.className);\n return state;\n};\n"],"mappings":"AAAA,YAAY;;AACZ,SAAAA,aAAA,EAA0BC,YAAY,EAAAC,QAAA,QAAoB,gBAAgB;AAC1E,OAAO,MAAMC,yBAAyB,GAAG;EACrCC,IAAI,EAAE;AACV,CAAC;AACD;AACA;AACA;AAAI,MAAMC,cAAc,gBAAGL,aAAA,kEAG1B,CAAC;AACF,MAAMM,SAAS,gBAAGJ,QAAA;EAAAK,YAAA;IAAAC,MAAA;EAAA;EAAAC,aAAA;IAAAD,MAAA;EAAA;AAAA;EAAAE,CAAA;AAAA,CAOjB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,iCAAiC,GAAIC,KAAK,IAAG;EAC1D,MAAMC,WAAW,GAAGR,cAAc,CAAC,CAAC;EACpC,MAAMS,MAAM,GAAGR,SAAS,CAAC,CAAC;EAC1B,MAAMS,YAAY,GAAGH,KAAK,CAACI,OAAO,KAAK,OAAO,GAAGF,MAAM,CAACP,YAAY,GAAGO,MAAM,CAACL,aAAa;EAC3F;EACAG,KAAK,CAACR,IAAI,CAACa,SAAS,GAAGhB,YAAY,CAACE,yBAAyB,CAACC,IAAI,EAAES,WAAW,EAAEE,YAAY,EAAEH,KAAK,CAACR,IAAI,CAACa,SAAS,CAAC;EACpH,OAAOL,KAAK;AAChB,CAAC","ignoreList":[]}
|
package/lib/contexts/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { SwatchPickerProvider, swatchPickerContextDefaultValue, useSwatchPickerContextValue_unstable } from
|
|
2
|
-
export { useSwatchPickerContextValues } from
|
|
1
|
+
export { SwatchPickerProvider, swatchPickerContextDefaultValue, useSwatchPickerContextValue_unstable } from "./swatchPicker.js";
|
|
2
|
+
export { useSwatchPickerContextValues } from "../components/SwatchPicker/useSwatchPickerContextValues.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SwatchPickerContextValue, SwatchPickerContextValues } from './swatchPicker';\nexport {\n SwatchPickerProvider,\n swatchPickerContextDefaultValue,\n useSwatchPickerContextValue_unstable,\n} from './swatchPicker';\nexport { useSwatchPickerContextValues } from '../components/SwatchPicker/useSwatchPickerContextValues';\n"],"names":["SwatchPickerProvider","swatchPickerContextDefaultValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues"],"mappings":"AACA,SACEA,oBAAoB,EACpBC,+BAA+B,EAC/BC,oCAAoC,QAC/B,
|
|
1
|
+
{"version":3,"sources":["../src/contexts/index.ts"],"sourcesContent":["export type { SwatchPickerContextValue, SwatchPickerContextValues } from './swatchPicker';\nexport {\n SwatchPickerProvider,\n swatchPickerContextDefaultValue,\n useSwatchPickerContextValue_unstable,\n} from './swatchPicker';\nexport { useSwatchPickerContextValues } from '../components/SwatchPicker/useSwatchPickerContextValues';\n"],"names":["SwatchPickerProvider","swatchPickerContextDefaultValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues"],"mappings":"AACA,SACEA,oBAAoB,EACpBC,+BAA+B,EAC/BC,oCAAoC,QAC/B,oBAAiB;AACxB,SAASC,4BAA4B,QAAQ,6DAA0D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { createContext, useContextSelector } from
|
|
2
|
+
import { createContext, useContextSelector } from "@fluentui/react-context-selector";
|
|
3
3
|
export const swatchPickerContextDefaultValue = {
|
|
4
4
|
requestSelectionChange: ()=>{
|
|
5
5
|
/*noop*/ },
|