{"version":3,"file":"SegmentedControl.mjs","sources":["../../../../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["'use client'\n\nimport {\n  type ForwardedRef,\n  type JSX,\n  forwardRef,\n  useEffect,\n  useMemo,\n  useState,\n} from 'react'\nimport * as React from 'react'\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport classNames from 'classnames'\n\nimport { ariaAttr } from '~/src/utils/aria'\nimport { createContext } from '~/src/utils/react'\nimport { cssDimension } from '~/src/utils/style'\nimport { isNil } from '~/src/utils/type'\n\nimport { BaseButton } from '~/src/components/BaseButton'\nimport { Divider } from '~/src/components/Divider'\nimport dividerStyles from '~/src/components/Divider/Divider.module.scss'\nimport { useFormFieldProps } from '~/src/components/FormControl'\nimport { HStack } from '~/src/components/Stack'\nimport { Text } from '~/src/components/Text'\n\nimport {\n  type SegmentedControlItemListProps,\n  type SegmentedControlItemProps,\n  type SegmentedControlProps,\n  type SegmentedControlRadioGroupProps,\n  type SegmentedControlSize,\n  type SegmentedControlTabContentProps,\n  type SegmentedControlTabListProps,\n  type SegmentedControlTabsProps,\n  type SegmentedControlType,\n} from './SegmentedControl.types'\n\nimport styles from './SegmentedControl.module.scss'\n\ntype SegmentedControlContextValue = Required<\n  Pick<\n    SegmentedControlProps<SegmentedControlType, string>,\n    'type' | 'size' | 'width'\n  >\n>\n\nconst [SegmentedControlContextProvider, useSegmentedControlContext] =\n  createContext<SegmentedControlContextValue | null>(null, 'SegmentedControl')\n\ntype SegmentedControlItemListContextValue = {\n  setSelectedItemIndex: (index: number | null) => void\n}\n\nconst [SegmentedControlItemContextProvider, useSegmentedControlItemContext] =\n  createContext<number | null>(null, 'SegmentedControlItem')\n\nconst [\n  SegmentedControlItemListContextProvider,\n  useSegmentedControlItemListContext,\n] = createContext<SegmentedControlItemListContextValue | null>(\n  null,\n  'SegmentedControlItemList'\n)\n\nfunction SegmentedControlDivider({\n  index,\n  selectedItemIndex,\n}: {\n  index: number\n  selectedItemIndex: number | null\n}) {\n  const isAdjacentToSelectedItem =\n    !isNil(selectedItemIndex) &&\n    (selectedItemIndex + 1 === index || selectedItemIndex === index)\n\n  return (\n    <Divider\n      className={classNames(\n        styles.SegmentedControlDivider,\n        isAdjacentToSelectedItem && styles.hidden\n      )}\n      withoutParallelIndent\n      orientation=\"vertical\"\n    />\n  )\n}\n\nfunction SegmentedControlItemListImpl<\n  Type extends SegmentedControlType,\n  Value extends string,\n>(\n  {\n    children,\n    style,\n    className,\n    ...rest\n  }: SegmentedControlItemListProps<Type, Value>,\n  forwardedRef: ForwardedRef<HTMLDivElement>\n) {\n  const [selectedItemIndex, setSelectedItemIndex] = useState<number | null>(\n    null\n  )\n\n  const { type, size, width } = useSegmentedControlContext(\n    'SegmentedControlItemList'\n  )\n\n  const contextValue: SegmentedControlItemListContextValue = useMemo(\n    () => ({\n      setSelectedItemIndex,\n    }),\n    []\n  )\n\n  const SegmentedControlItemList =\n    type === 'radiogroup' ? RadioGroupPrimitive.Root : TabsPrimitive.List\n\n  return (\n    <SegmentedControlItemList\n      asChild\n      ref={forwardedRef}\n      {...rest}\n    >\n      <div\n        style={\n          {\n            '--b-segmented-control-width': cssDimension(width),\n            '--b-segmented-control-item-index': selectedItemIndex,\n            '--b-segmented-control-item-count': React.Children.count(children),\n            ...style,\n          } as React.CSSProperties\n        }\n        className={classNames(\n          styles.SegmentedControl,\n          styles[`size-${size}`],\n          className\n        )}\n      >\n        <SegmentedControlItemListContextProvider value={contextValue}>\n          {React.Children.map(children, (child, index) => (\n            <>\n              {index !== 0 && (\n                <SegmentedControlDivider\n                  index={index}\n                  selectedItemIndex={selectedItemIndex}\n                />\n              )}\n              <SegmentedControlItemContextProvider value={index}>\n                {child}\n              </SegmentedControlItemContextProvider>\n            </>\n          ))}\n          {!isNil(selectedItemIndex) && (\n            <div\n              className={classNames(\n                styles.SegmentedControlIndicator,\n                dividerStyles.variables\n              )}\n            />\n          )}\n        </SegmentedControlItemListContextProvider>\n      </div>\n    </SegmentedControlItemList>\n  )\n}\n\nconst SegmentedControlItemList = forwardRef(SegmentedControlItemListImpl) as <\n  Type extends SegmentedControlType,\n  Value extends string,\n>(\n  props: SegmentedControlItemListProps<Type, Value> & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\nfunction SegmentedControlRadioGroupImpl<Value extends string>(\n  { children, size, ...rest }: SegmentedControlRadioGroupProps<Value>,\n  forwardedRef: React.Ref<HTMLDivElement>\n) {\n  const { hasError, ...ownProps } = useFormFieldProps(rest)\n  return (\n    <SegmentedControlItemList\n      ref={forwardedRef}\n      {...ownProps}\n      size={size}\n    >\n      {children}\n    </SegmentedControlItemList>\n  )\n}\n\nconst SegmentedControlRadioGroup = forwardRef(\n  SegmentedControlRadioGroupImpl\n) as <Value extends string>(\n  props: SegmentedControlRadioGroupProps<Value> & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\n/**\n * `SegmentedControlTabList` is the component that wraps `SegmentedControlItem`.\n * It can be used only when `SegmentedControl` component is used as the `tabs` type.\n *\n * It must be used as a child of `SegmentedControl`.\n */\nexport const SegmentedControlTabList = SegmentedControlItemList as (\n  props: SegmentedControlTabListProps & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\n/**\n * `SegmentedControlTabContent` is the component that wraps the content that corresponds to a specific value of `SegmentedControlItem`.\n * It can be used only when `SegmentedControl` component is used as the `tabs` type.\n *\n * It must be used as a child of `SegmentedControl`.\n */\nexport const SegmentedControlTabContent = TabsPrimitive.Content as <\n  Value extends string,\n>(\n  props: SegmentedControlTabContentProps<Value> & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\nconst SegmentedControlTabs = TabsPrimitive.Root as <Value extends string>(\n  props: SegmentedControlTabsProps<Value> & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\nfunction SegmentedControlImpl<\n  Type extends SegmentedControlType,\n  Value extends string,\n>(\n  {\n    type = 'radiogroup' as Type,\n    size = 'm',\n    width = '100%',\n    onValueChange,\n    children,\n    ...rest\n  }: SegmentedControlProps<Type, Value>,\n  forwardedRef: React.Ref<HTMLDivElement>\n) {\n  const SegmentedControlRoot =\n    type === 'radiogroup' ? SegmentedControlRadioGroup : SegmentedControlTabs\n\n  const contextValue = useMemo(\n    () => ({\n      type,\n      size,\n      width,\n    }),\n    [type, size, width]\n  )\n\n  return (\n    <SegmentedControlContextProvider value={contextValue}>\n      <SegmentedControlRoot\n        ref={forwardedRef}\n        onValueChange={onValueChange}\n        {...rest}\n      >\n        {children}\n      </SegmentedControlRoot>\n    </SegmentedControlContextProvider>\n  )\n}\n\n/**\n * `SegmentedControl` is component that looks like a combination of a radio and a button.\n * They can be used in place of tabs and as input elements in modals.\n * If you have more than five items, use a different element, such as a dropdown.\n *\n * `SegmentedControl` can be used as a radio group, tabs element depending on its `type`.\n * @example\n *\n * ```tsx\n * // Anatomy of the SegmentedControl type=\"radiogroup\"\n * <SegmentedControl type=\"radiogroup\">\n *  <SegmentedControlItem />\n * </SegmentedControl>\n *\n * // Anatomy of the SegmentedControl type=\"tabs\"\n * <SegmentedControl type=\"tabs\">\n *  <SegmentedControlTabList>\n *   <SegmentedControlItem />\n *  </SegmentedControlTabList>\n *\n *  <SegmentedControlTabContent />\n * </SegmentedControl>\n * ```\n */\nexport const SegmentedControl = forwardRef(SegmentedControlImpl) as <\n  Type extends SegmentedControlType,\n  Value extends string,\n>(\n  props: SegmentedControlProps<Type, Value> & {\n    ref?: React.ForwardedRef<HTMLDivElement>\n  }\n) => JSX.Element\n\n/**\n * NOTE: (@ed) A property injected at runtime by the radix-ui lib.\n */\ntype ItemProps<Type extends SegmentedControlType> = (Type extends 'radiogroup'\n  ? { 'data-state'?: 'unchecked' | 'checked' }\n  : { 'data-state'?: 'inactive' | 'active' }) &\n  React.HTMLAttributes<HTMLButtonElement> &\n  Partial<SegmentedControlItemProps<Type>>\n\nfunction getTypography(size: SegmentedControlSize) {\n  return (\n    {\n      xs: '13',\n      s: '13',\n      m: '13',\n      l: '14',\n    } as const\n  )[size]\n}\n\nconst Item = forwardRef<HTMLButtonElement, ItemProps<SegmentedControlType>>(\n  function Item(\n    { children, leftContent, rightContent, className, ...rest },\n    forwardedRef\n  ) {\n    const { type, size } = useSegmentedControlContext('SegmentedControlItem')\n    const { setSelectedItemIndex } = useSegmentedControlItemListContext(\n      'SegmentedControlItem'\n    )\n    const index = useSegmentedControlItemContext('SegmentedControlItem')\n\n    const checked =\n      type === 'radiogroup'\n        ? (rest as ItemProps<typeof type>)?.['data-state'] === 'checked'\n        : (rest as ItemProps<typeof type>)?.['data-state'] === 'active'\n\n    useEffect(\n      function setSelectedItem() {\n        if (checked) {\n          setSelectedItemIndex(index)\n        }\n      },\n      [checked, index, setSelectedItemIndex]\n    )\n\n    return (\n      <BaseButton\n        {...rest}\n        ref={forwardedRef}\n        data-checked={ariaAttr(checked)}\n        className={classNames(styles.SegmentedControlItem, className)}\n      >\n        <HStack\n          className={styles.SegmentedControlItemContainer}\n          align=\"center\"\n          spacing={4}\n        >\n          {leftContent}\n\n          <Text\n            className={styles.SegmentedControlItemLabel}\n            bold\n            typo={getTypography(size)}\n          >\n            {children}\n          </Text>\n\n          {rightContent}\n        </HStack>\n      </BaseButton>\n    )\n  }\n)\n\nfunction SegmentedControlItemImpl<Value extends string>(\n  { children, ...rest }: SegmentedControlItemProps<Value>,\n  forwardedRef: React.Ref<HTMLButtonElement>\n) {\n  const { type } = useSegmentedControlContext('SegmentedControlItem')\n\n  const SegmentedControlItem =\n    type === 'radiogroup' ? RadioGroupPrimitive.Item : TabsPrimitive.Trigger\n\n  return (\n    <SegmentedControlItem\n      asChild\n      ref={forwardedRef}\n      {...rest}\n    >\n      <Item>{children}</Item>\n    </SegmentedControlItem>\n  )\n}\n\n/**\n * `SegmentedControlItem` component is each item in `SegmentedControl`.\n *\n * If the type of `SegmentedControl` is `radiogroup`, this component acts as a radio item.\n * In this case, it must be used as a child of `SegmentedControl`.\n *\n * If the type of `SegmentedControl` is `tabs`, this component acts as a tab item.\n * In this case, it must be used as a child of `SegmentedControlTabList`.\n */\nexport const SegmentedControlItem = forwardRef(SegmentedControlItemImpl) as <\n  Value extends string,\n>(\n  props: SegmentedControlItemProps<Value> & {\n    ref?: React.ForwardedRef<HTMLButtonElement>\n  }\n) => JSX.Element\n"],"names":["SegmentedControlContextProvider","useSegmentedControlContext","createContext","SegmentedControlItemContextProvider","useSegmentedControlItemContext","SegmentedControlItemListContextProvider","useSegmentedControlItemListContext","SegmentedControlDivider","index","selectedItemIndex","isAdjacentToSelectedItem","isNil","_jsx","Divider","className","classNames","styles","hidden","withoutParallelIndent","orientation","SegmentedControlItemListImpl","children","style","rest","forwardedRef","setSelectedItemIndex","useState","type","size","width","contextValue","useMemo","SegmentedControlItemList","RadioGroupPrimitive","TabsPrimitive","asChild","ref","cssDimension","React","Children","count","SegmentedControl","_jsxs","value","map","child","_Fragment","SegmentedControlIndicator","dividerStyles","variables","forwardRef","SegmentedControlRadioGroupImpl","hasError","ownProps","useFormFieldProps","SegmentedControlRadioGroup","SegmentedControlTabList","SegmentedControlTabContent","SegmentedControlTabs","SegmentedControlImpl","onValueChange","SegmentedControlRoot","getTypography","xs","s","m","l","Item","leftContent","rightContent","checked","useEffect","setSelectedItem","BaseButton","ariaAttr","SegmentedControlItem","HStack","SegmentedControlItemContainer","align","spacing","Text","SegmentedControlItemLabel","bold","typo","SegmentedControlItemImpl"],"mappings":";;;;;;;;;;;;;;;;;;AAiDA,MAAM,CAACA,+BAA+B,EAAEC,0BAA0B,CAAC,GACjEC,aAAa,CAAsC,IAAI,EAAE,kBAAkB,CAAC;AAM9E,MAAM,CAACC,mCAAmC,EAAEC,8BAA8B,CAAC,GACzEF,aAAa,CAAgB,IAAI,EAAE,sBAAsB,CAAC;AAE5D,MAAM,CACJG,uCAAuC,EACvCC,kCAAkC,CACnC,GAAGJ,aAAa,C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