{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AA4CM,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAAwD,CAAC;AACtG,MAAM,0DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAKvE,MAAM,4CAAkC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,kBAAkB,KAA6B,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,0DAAkB,EAAE;IAChC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,yDAAmB,EAAE,OAAO,OAAO;IAEtD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,aAAa,MAAM,WAAW,IAAI;YAClC,YAAY,MAAM,UAAU;mBAC5B;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,GAAG;QACL,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW,IAAI;QACvC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,0CAAwB,QAAQ;QAAC,OAAO;qBACvC,0DAAC,CAAA,GAAA,iDAAsB,SACpB,YAAY,QAAQ;AAK/B","sources":["packages/react-aria-components/src/ToggleButtonGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaToggleButtonGroupProps, useToggleButtonGroup} from 'react-aria/useToggleButtonGroup';\n\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps\n} from './utils';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {forwardRefType, GlobalDOMAttributes, Orientation} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {SharedElementTransition} from './SharedElementTransition';\nimport {ToggleGroupState, useToggleGroupState} from 'react-stately/useToggleGroupState';\n\nexport interface ToggleButtonGroupRenderProps {\n  /**\n   * The orientation of the toggle button group.\n   * @selector [data-orientation=\"horizontal | vertical\"]\n   */\n  orientation: Orientation,\n  /**\n   * Whether the toggle button group is disabled.\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean,\n  /**\n   * State of the toggle button group.\n   */\n  state: ToggleGroupState\n}\n\nexport interface ToggleButtonGroupProps extends AriaToggleButtonGroupProps, RenderProps<ToggleButtonGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state.\n   * @default 'react-aria-ToggleButtonGroup'\n   */\n  className?: ClassNameOrFunction<ToggleButtonGroupRenderProps>\n}\n\nexport const ToggleButtonGroupContext = createContext<ContextValue<ToggleButtonGroupProps, HTMLDivElement>>({});\nexport const ToggleGroupStateContext = createContext<ToggleGroupState | null>(null);\n\n/**\n * A toggle button group allows a user to toggle multiple options, with single or multiple selection.\n */\nexport const ToggleButtonGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButtonGroup(props: ToggleButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n  [props, ref] = useContextProps(props, ref, ToggleButtonGroupContext);\n  let state = useToggleGroupState(props);\n  let {groupProps} = useToggleButtonGroup(props, state, ref);\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      orientation: props.orientation || 'horizontal',\n      isDisabled: state.isDisabled,\n      state\n    },\n    defaultClassName: 'react-aria-ToggleButtonGroup'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps, groupProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-orientation={props.orientation || 'horizontal'}\n      data-disabled={props.isDisabled || undefined}>\n      <ToggleGroupStateContext.Provider value={state}>\n        <SharedElementTransition>\n          {renderProps.children}\n        </SharedElementTransition>\n      </ToggleGroupStateContext.Provider>\n    </dom.div>\n  );\n});\n"],"names":[],"version":3,"file":"ToggleButtonGroup.cjs.map"}