{"version":3,"sources":["../src/components/ColorPicker/useColorPickerContextValues.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ColorPickerContextValue, ColorPickerContextValues } from '../../contexts/colorPicker';\nimport type { ColorPickerBaseState, ColorPickerState } from './ColorPicker.types';\n\nexport const useColorPickerBaseContextValues_unstable = (state: ColorPickerBaseState): ColorPickerContextValues => {\n  const { color, requestChange } = state;\n\n  const colorPicker = React.useMemo<ColorPickerContextValue>(\n    () => ({\n      requestChange,\n      color,\n      shape: undefined,\n    }),\n    [requestChange, color],\n  );\n\n  return { colorPicker };\n};\n\nexport const useColorPickerContextValues = (state: ColorPickerState): ColorPickerContextValues => {\n  const { color, shape, requestChange } = state;\n\n  const colorPicker = React.useMemo<ColorPickerContextValue>(\n    () => ({\n      requestChange,\n      color,\n      shape,\n    }),\n    [requestChange, color, shape],\n  );\n\n  return { colorPicker };\n};\n"],"names":["React","useColorPickerBaseContextValues_unstable","state","color","requestChange","colorPicker","useMemo","shape","undefined","useColorPickerContextValues"],"mappings":"AAAA;;;;;;;;;;;;IAMaC,wCAAAA;;;+BAeAQ;eAAAA;;;;iEAnBU,QAAQ;AAIxB,iDAAiD,CAACP;IACvD,MAAM,EAAEC,KAAK,EAAEC,aAAa,EAAE,GAAGF;IAEjC,MAAMG,cAAcL,OAAMM,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAD;YACAI,OAAOC;SACT,CAAA,EACA;QAACJ;QAAeD;KAAM;IAGxB,OAAO;QAAEE;IAAY;AACvB,EAAE;AAEK,oCAAoC,CAACH;IAC1C,MAAM,EAAEC,KAAK,EAAEI,KAAK,EAAEH,aAAa,EAAE,GAAGF;IAExC,MAAMG,cAAcL,OAAMM,OAAO,CAC/B,IAAO,CAAA;YACLF;YACAD;YACAI;SACF,CAAA,EACA;QAACH;QAAeD;QAAOI;KAAM;IAG/B,OAAO;QAAEF;IAAY;AACvB,EAAE"}