@fluentui/react-swatch-picker 0.0.0-nightly-20241118-0406.1 → 0.0.0-nightly-20241120-0406.1

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 CHANGED
@@ -1,26 +1,27 @@
1
1
  # Change Log - @fluentui/react-swatch-picker
2
2
 
3
- This log was last generated on Mon, 18 Nov 2024 04:10:50 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 20 Nov 2024 04:10:31 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20241118-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v0.0.0-nightly-20241118-0406.1)
7
+ ## [0.0.0-nightly-20241120-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v0.0.0-nightly-20241120-0406.1)
8
8
 
9
- Mon, 18 Nov 2024 04:10:50 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker_v9.1.13..@fluentui/react-swatch-picker_v0.0.0-nightly-20241118-0406.1)
9
+ Wed, 20 Nov 2024 04:10:31 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-swatch-picker_v9.1.13..@fluentui/react-swatch-picker_v0.0.0-nightly-20241120-0406.1)
11
11
 
12
12
  ### Changes
13
13
 
14
14
  - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-context-selector to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
16
- - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
17
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
18
- - Bump @fluentui/react-tabster to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
19
- - Bump @fluentui/react-theme to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
20
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
21
- - Bump @fluentui/react-provider to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
22
- - Bump @fluentui/react-conformance to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
23
- - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20241118-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/f88b28d7369e92e0c38a14edea18755ff684761d) by beachball)
15
+ - Bump @fluentui/react-context-selector to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
16
+ - Bump @fluentui/react-field to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
17
+ - Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
18
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
19
+ - Bump @fluentui/react-tabster to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
20
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
21
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
22
+ - Bump @fluentui/react-provider to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
23
+ - Bump @fluentui/react-conformance to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
24
+ - Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20241120-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/02bb6aa3fa4c362b23fea77d1af00c09dcdbba49) by beachball)
24
25
 
25
26
  ## [9.1.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-swatch-picker_v9.1.13)
26
27
 
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
- import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
2
+ import { useFieldControlProps_unstable } from '@fluentui/react-field';
3
3
  import { useArrowNavigationGroup } from '@fluentui/react-tabster';
4
+ import { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';
4
5
  /**
5
6
  * Create the state required to render SwatchPicker.
6
7
  *
@@ -10,6 +11,8 @@ import { useArrowNavigationGroup } from '@fluentui/react-tabster';
10
11
  * @param props - props from this instance of SwatchPicker
11
12
  * @param ref - reference to root HTMLElement of SwatchPicker
12
13
  */ export const useSwatchPicker_unstable = (props, ref)=>{
14
+ // Merge props from surrounding <Field>, if any
15
+ props = useFieldControlProps_unstable(props);
13
16
  const { layout, onSelectionChange, size = 'medium', shape, spacing = 'medium', style, ...rest } = props;
14
17
  const isGrid = layout === 'grid';
15
18
  const focusAttributes = useArrowNavigationGroup({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/SwatchPicker/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":["React","getIntrinsicElementProps","useControllableState","useEventCallback","slot","useArrowNavigationGroup","useSwatchPicker_unstable","props","ref","layout","onSelectionChange","size","shape","spacing","style","rest","isGrid","focusAttributes","circular","axis","memorizeCurrent","role","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","requestSelectionChange","event","data","type","selectedSwatch","components","root","always","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAEnH,SAASC,uBAAuB,QAAQ,0BAA0B;AAElE;;;;;;;;CAQC,GACD,OAAO,MAAMC,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,kBAAkBZ,wBAAwB;QAC9Ca,UAAU;QACVC,MAAMH,SAAS,gBAAgB;QAC/BI,iBAAiB;IACnB;IAEA,MAAMC,OAAOL,SAAS,SAAS;IAE/B,MAAM,CAACM,eAAeC,iBAAiB,GAAGrB,qBAAqB;QAC7DsB,OAAOjB,MAAMe,aAAa;QAC1BG,cAAclB,MAAMmB,oBAAoB;QACxCC,cAAc;IAChB;IAEA,MAAMC,yBAAsEzB,iBAAiB,CAAC0B,OAAOC;QACnGpB,8BAAAA,wCAAAA,kBAAoBmB,OAAO;YACzBE,MAAM;YACNF;YACAP,eAAeQ,KAAKR,aAAa;YACjCU,gBAAgBF,KAAKE,cAAc;QACrC;QACAT,iBAAiBO,KAAKR,aAAa;IACrC;IAEA,OAAO;QACLW,YAAY;YACVC,MAAM;QACR;QACAA,MAAM9B,KAAK+B,MAAM,CACflC,yBAAyB,OAAO;YAC9BO;YACAa;YACA,GAAGJ,eAAe;YAClB,GAAGF,IAAI;QACT,IACA;YAAEqB,aAAa;QAAM;QAEvBpB;QACAY;QACAN;QACAX;QACAC;QACAC;IACF;AACF,EAAE"}
1
+ {"version":3,"sources":["../src/components/SwatchPicker/useSwatchPicker.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\n\nimport type { SwatchPickerProps, SwatchPickerState } from './SwatchPicker.types';\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 // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props);\n\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":["React","useFieldControlProps_unstable","useArrowNavigationGroup","getIntrinsicElementProps","useControllableState","useEventCallback","slot","useSwatchPicker_unstable","props","ref","layout","onSelectionChange","size","shape","spacing","style","rest","isGrid","focusAttributes","circular","axis","memorizeCurrent","role","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","requestSelectionChange","event","data","type","selectedSwatch","components","root","always","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,6BAA6B,QAAQ,wBAAwB;AACtE,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,wBAAwB,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,4BAA4B;AAInH;;;;;;;;CAQC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC;IAEA,+CAA+C;IAC/CD,QAAQP,8BAA8BO;IAEtC,MAAM,EAAEE,MAAM,EAAEC,iBAAiB,EAAEC,OAAO,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGR;IAElG,MAAMS,SAASP,WAAW;IAC1B,MAAMQ,kBAAkBhB,wBAAwB;QAC9CiB,UAAU;QACVC,MAAMH,SAAS,gBAAgB;QAC/BI,iBAAiB;IACnB;IAEA,MAAMC,OAAOL,SAAS,SAAS;IAE/B,MAAM,CAACM,eAAeC,iBAAiB,GAAGpB,qBAAqB;QAC7DqB,OAAOjB,MAAMe,aAAa;QAC1BG,cAAclB,MAAMmB,oBAAoB;QACxCC,cAAc;IAChB;IAEA,MAAMC,yBAAsExB,iBAAiB,CAACyB,OAAOC;QACnGpB,8BAAAA,wCAAAA,kBAAoBmB,OAAO;YACzBE,MAAM;YACNF;YACAP,eAAeQ,KAAKR,aAAa;YACjCU,gBAAgBF,KAAKE,cAAc;QACrC;QACAT,iBAAiBO,KAAKR,aAAa;IACrC;IAEA,OAAO;QACLW,YAAY;YACVC,MAAM;QACR;QACAA,MAAM7B,KAAK8B,MAAM,CACfjC,yBAAyB,OAAO;YAC9BM;YACAa;YACA,GAAGJ,eAAe;YAClB,GAAGF,IAAI;QACT,IACA;YAAEqB,aAAa;QAAM;QAEvBpB;QACAY;QACAN;QACAX;QACAC;QACAC;IACF;AACF,EAAE"}
@@ -10,9 +10,12 @@ Object.defineProperty(exports, "useSwatchPicker_unstable", {
10
10
  });
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- const _reactutilities = require("@fluentui/react-utilities");
13
+ const _reactfield = require("@fluentui/react-field");
14
14
  const _reacttabster = require("@fluentui/react-tabster");
15
+ const _reactutilities = require("@fluentui/react-utilities");
15
16
  const useSwatchPicker_unstable = (props, ref)=>{
17
+ // Merge props from surrounding <Field>, if any
18
+ props = (0, _reactfield.useFieldControlProps_unstable)(props);
16
19
  const { layout, onSelectionChange, size = 'medium', shape, spacing = 'medium', style, ...rest } = props;
17
20
  const isGrid = layout === 'grid';
18
21
  const focusAttributes = (0, _reacttabster.useArrowNavigationGroup)({
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/SwatchPicker/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"}
1
+ {"version":3,"sources":["../src/components/SwatchPicker/useSwatchPicker.ts"],"sourcesContent":["import * as React from 'react';\n\nimport { useFieldControlProps_unstable } from '@fluentui/react-field';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { getIntrinsicElementProps, useControllableState, useEventCallback, slot } from '@fluentui/react-utilities';\n\nimport type { SwatchPickerProps, SwatchPickerState } from './SwatchPicker.types';\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 // Merge props from surrounding <Field>, if any\n props = useFieldControlProps_unstable(props);\n\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","useFieldControlProps_unstable","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":";;;;+BAiBaA;;;eAAAA;;;;iEAjBU;4BAEuB;8BACN;gCAC+C;AAahF,MAAMA,2BAA2B,CACtCC,OACAC;IAEA,+CAA+C;IAC/CD,QAAQE,IAAAA,yCAAAA,EAA8BF;IAEtC,MAAM,EAAEG,MAAM,EAAEC,iBAAiB,EAAEC,OAAO,QAAQ,EAAEC,KAAK,EAAEC,UAAU,QAAQ,EAAEC,KAAK,EAAE,GAAGC,MAAM,GAAGT;IAElG,MAAMU,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,OAAOpB,MAAMiB,aAAa;QAC1BI,cAAcrB,MAAMsB,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;YAC9BjC;YACAe;YACA,GAAGL,eAAe;YAClB,GAAGF,IAAI;QACT,IACA;YAAE0B,aAAa;QAAM;QAEvBzB;QACAc;QACAP;QACAZ;QACAC;QACAC;IACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-swatch-picker",
3
- "version": "0.0.0-nightly-20241118-0406.1",
3
+ "version": "0.0.0-nightly-20241120-0406.1",
4
4
  "description": "New fluentui react package",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,21 +12,22 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "@fluentui/react-provider": "0.0.0-nightly-20241118-0406.1",
15
+ "@fluentui/react-provider": "0.0.0-nightly-20241120-0406.1",
16
16
  "@fluentui/eslint-plugin": "*",
17
- "@fluentui/react-conformance": "0.0.0-nightly-20241118-0406.1",
18
- "@fluentui/react-conformance-griffel": "0.0.0-nightly-20241118-0406.1",
17
+ "@fluentui/react-conformance": "0.0.0-nightly-20241120-0406.1",
18
+ "@fluentui/react-conformance-griffel": "0.0.0-nightly-20241120-0406.1",
19
19
  "@fluentui/scripts-api-extractor": "*",
20
20
  "@fluentui/scripts-cypress": "*"
21
21
  },
22
22
  "dependencies": {
23
- "@fluentui/react-context-selector": "0.0.0-nightly-20241118-0406.1",
23
+ "@fluentui/react-context-selector": "0.0.0-nightly-20241120-0406.1",
24
+ "@fluentui/react-field": "0.0.0-nightly-20241120-0406.1",
24
25
  "@fluentui/react-icons": "^2.0.245",
25
- "@fluentui/react-jsx-runtime": "0.0.0-nightly-20241118-0406.1",
26
- "@fluentui/react-shared-contexts": "0.0.0-nightly-20241118-0406.1",
27
- "@fluentui/react-tabster": "0.0.0-nightly-20241118-0406.1",
28
- "@fluentui/react-theme": "0.0.0-nightly-20241118-0406.1",
29
- "@fluentui/react-utilities": "0.0.0-nightly-20241118-0406.1",
26
+ "@fluentui/react-jsx-runtime": "0.0.0-nightly-20241120-0406.1",
27
+ "@fluentui/react-shared-contexts": "0.0.0-nightly-20241120-0406.1",
28
+ "@fluentui/react-tabster": "0.0.0-nightly-20241120-0406.1",
29
+ "@fluentui/react-theme": "0.0.0-nightly-20241120-0406.1",
30
+ "@fluentui/react-utilities": "0.0.0-nightly-20241120-0406.1",
30
31
  "@griffel/react": "^1.5.22",
31
32
  "@swc/helpers": "^0.5.1"
32
33
  },