@channel.io/bezier-react 3.1.2 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -174,6 +174,14 @@ const SegmentedControl = /*#__PURE__*/React.forwardRef(SegmentedControlImpl);
174
174
  * NOTE: (@ed) A property injected at runtime by the radix-ui lib.
175
175
  */
176
176
 
177
+ function getTypography(size) {
178
+ return {
179
+ xs: '13',
180
+ s: '13',
181
+ m: '13',
182
+ l: '14'
183
+ }[size];
184
+ }
177
185
  const Item = /*#__PURE__*/React.forwardRef(function Item({
178
186
  children,
179
187
  leftContent,
@@ -203,12 +211,11 @@ const Item = /*#__PURE__*/React.forwardRef(function Item({
203
211
  children: /*#__PURE__*/jsxRuntime.jsxs(Stack.HStack, {
204
212
  className: SegmentedControl_module.default.SegmentedControlItemContainer,
205
213
  align: "center",
206
- spacing: 2,
214
+ spacing: 4,
207
215
  children: [leftContent, /*#__PURE__*/jsxRuntime.jsx(Text.Text, {
208
216
  className: SegmentedControl_module.default.SegmentedControlItemLabel,
209
217
  bold: true,
210
- truncated: true,
211
- typo: size === 'xs' ? '13' : '14',
218
+ typo: getTypography(size),
212
219
  children: children
213
220
  }), rightContent]
214
221
  })
@@ -1 +1 @@
1
- {"version":3,"file":"SegmentedControl.js","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 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 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 <Divider\n withoutParallelIndent\n orientation=\"vertical\"\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\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={2}\n >\n {leftContent}\n <Text\n className={styles.SegmentedControlItemLabel}\n bold\n truncated\n typo={size === 'xs' ? '13' : '14'}\n >\n {children}\n </Text>\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","SegmentedControlItemListImpl","children","style","className","rest","forwardedRef","selectedItemIndex","setSelectedItemIndex","useState","type","size","width","contextValue","useMemo","SegmentedControlItemList","RadioGroupPrimitive","TabsPrimitive","_jsx","asChild","ref","cssDimension","React","Children","count","classNames","styles","SegmentedControl","_jsxs","value","map","child","index","_Fragment","Divider","withoutParallelIndent","orientation","isNil","SegmentedControlIndicator","dividerStyles","variables","forwardRef","SegmentedControlRadioGroupImpl","hasError","ownProps","useFormFieldProps","SegmentedControlRadioGroup","SegmentedControlTabList","SegmentedControlTabContent","SegmentedControlTabs","SegmentedControlImpl","onValueChange","SegmentedControlRoot","Item","leftContent","rightContent","checked","useEffect","setSelectedItem","BaseButton","ariaAttr","SegmentedControlItem","HStack","SegmentedControlItemContainer","align","spacing","Text","SegmentedControlItemLabel","bold","truncated","typo","SegmentedControlItemImpl"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAM,CAACA,+BAA+B,EAAEC,0BAA0B,CAAC,GACjEC,mBAAa,CAAsC,IAAI,EAAE,kBAAkB,CAAC;AAM9E,MAAM,CAACC,mCAAmC,EAAEC,8BAA8B,CAAC,GACzEF,mBAAa,CAAgB,IAAI,EAA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AC,EACNqD,YAAY;KACP;AAAC,GACC,CAAC;AAEjB,CACF,CAAC;AAED,SAASgB,wBAAwBA,CAC/B;EAAErE,QAAQ;EAAE,GAAGG;AAAuC,CAAC,EACvDC,YAA0C,EAC1C;EACA,MAAM;AAAEI,IAAAA;AAAK,GAAC,GAAGf,0BAA0B,CAAC,sBAAsB,CAAC;AAEnE,EAAA,MAAMkE,oBAAoB,GACxBnD,IAAI,KAAK,YAAY,GAAGM,YAAwB,GAAGC,aAAqB;EAE1E,oBACEC,cAAA,CAAC2C,oBAAoB,EAAA;IACnB1C,OAAO,EAAA,IAAA;AACPC,IAAAA,GAAG,EAAEd,YAAa;AAAA,IAAA,GACdD,IAAI;IAAAH,QAAA,eAERgB,cAAA,CAACmC,IAAI,EAAA;AAAAnD,MAAAA,QAAA,EAAEA;KAAe;AAAC,GACH,CAAC;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa2D,oBAAoB,gBAAGpB,gBAAU,CAAC8B,wBAAwB;;;;;;;"}
1
+ {"version":3,"file":"SegmentedControl.js","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 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 <Divider\n withoutParallelIndent\n orientation=\"vertical\"\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","SegmentedControlItemListImpl","children","style","className","rest","forwardedRef","selectedItemIndex","setSelectedItemIndex","useState","type","size","width","contextValue","useMemo","SegmentedControlItemList","RadioGroupPrimitive","TabsPrimitive","_jsx","asChild","ref","cssDimension","React","Children","count","classNames","styles","SegmentedControl","_jsxs","value","map","child","index","_Fragment","Divider","withoutParallelIndent","orientation","isNil","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,mBAAa,CAAsC,IAAI,EAAE,kBAAkB,CAAC;AAM9E,MAAM,CAACC,mCAAmC,EAAEC,8BAA8B,CAAC,GACzEF,mBAAa,CAAgB,IAAI,EAAE,sBAAsB,CAAC;AAE5D,MAAM,CACJ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