{"version":3,"sources":["../src/components/SwatchPicker/useSwatchPicker.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useSwatchPickerBase_unstable } from '@fluentui/react-swatch-picker';\nimport type { SwatchPickerProps, SwatchPickerState } from './SwatchPicker.types';\n\nexport {\n  useSwatchPickerContextValues,\n  useSwatchPickerContextValue_unstable as useSwatchPickerContextValue,\n} from '@fluentui/react-swatch-picker';\n\nexport const useSwatchPicker = (props: SwatchPickerProps, ref: React.Ref<HTMLDivElement>): SwatchPickerState => {\n  const { focusMode = 'arrow', layout = 'row' } = props;\n\n  const baseState: SwatchPickerState = useSwatchPickerBase_unstable(props, ref);\n\n  // eslint-disable-next-line react-hooks/immutability\n  baseState.root['data-layout'] = layout;\n\n  if (focusMode === 'arrow') {\n    // eslint-disable-next-line react-hooks/immutability\n    baseState.root.focusgroup = baseState.isGrid ? 'grid manual rowflow' : 'radiogroup';\n  }\n\n  return baseState;\n};\n"],"names":["useSwatchPicker","useSwatchPickerContextValue","useSwatchPickerContextValue_unstable","useSwatchPickerContextValues","props","ref","focusMode","layout","baseState","useSwatchPickerBase_unstable","root","focusgroup","isGrid"],"mappings":"AAAA;;;;;;;;;;;;IAWaA,eAAe;eAAfA;;IAH6BC,2BAA2B;eAAnEC,uDAAoC;;IADpCC,4BAA4B;eAA5BA,+CAA4B;;;mCAJe;AAQtC,MAAMH,kBAAkB,CAACI,OAA0BC;IACxD,MAAM,EAAEC,YAAY,OAAO,EAAEC,SAAS,KAAK,EAAE,GAAGH;IAEhD,MAAMI,YAA+BC,IAAAA,+CAA4B,EAACL,OAAOC;IAEzE,oDAAoD;IACpDG,UAAUE,IAAI,CAAC,cAAc,GAAGH;IAEhC,IAAID,cAAc,SAAS;QACzB,oDAAoD;QACpDE,UAAUE,IAAI,CAACC,UAAU,GAAGH,UAAUI,MAAM,GAAG,wBAAwB;IACzE;IAEA,OAAOJ;AACT"}