{"version":3,"sources":["../src/components/Slider/useSlider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useSliderBase_unstable } from '@fluentui/react-slider';\n\nimport type { SliderProps, SliderState } from './Slider.types';\nimport { stringifyDataAttribute } from '../../utils';\n\n/**\n * Returns the state for a Slider component, given its props and ref.\n * The returned state can be modified with hooks before being passed to `renderSlider`.\n */\nexport const useSlider = (props: SliderProps, ref: React.Ref<HTMLInputElement>): SliderState => {\n  const state: SliderState = useSliderBase_unstable(props, ref);\n\n  // Set data attributes for disabled and vertical states to simplify styling of these states.\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-disabled'] = stringifyDataAttribute(state.disabled);\n  // eslint-disable-next-line react-hooks/immutability\n  state.root['data-vertical'] = stringifyDataAttribute(state.vertical);\n\n  return state;\n};\n"],"names":["useSlider","props","ref","state","useSliderBase_unstable","root","stringifyDataAttribute","disabled","vertical"],"mappings":"AAAA;;;;;+BAYaA;;;eAAAA;;;6BAT0B;uBAGA;AAMhC,MAAMA,YAAY,CAACC,OAAoBC;IAC5C,MAAMC,QAAqBC,IAAAA,mCAAsB,EAACH,OAAOC;IAEzD,4FAA4F;IAC5F,oDAAoD;IACpDC,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMI,QAAQ;IACnE,oDAAoD;IACpDJ,MAAME,IAAI,CAAC,gBAAgB,GAAGC,IAAAA,6BAAsB,EAACH,MAAMK,QAAQ;IAEnE,OAAOL;AACT"}