@channel.io/bezier-react 3.4.0 → 3.4.1

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.
@@ -11,10 +11,10 @@ var type = require('../../utils/type.js');
11
11
  var Divider_module = require('../Divider/Divider.module.scss.js');
12
12
  var SegmentedControl_module = require('./SegmentedControl.module.scss.js');
13
13
  var jsxRuntime = require('react/jsx-runtime');
14
- var Divider = require('../Divider/Divider.js');
15
14
  var BaseButton = require('../BaseButton/BaseButton.js');
16
15
  var Stack = require('../Stack/Stack.js');
17
16
  var Text = require('../Text/Text.js');
17
+ var Divider = require('../Divider/Divider.js');
18
18
  var FormControl = require('../FormControl/FormControl.js');
19
19
 
20
20
  function _interopNamespaceDefault(e) {
@@ -39,6 +39,17 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
39
39
  const [SegmentedControlContextProvider, useSegmentedControlContext] = react.createContext(null, 'SegmentedControl');
40
40
  const [SegmentedControlItemContextProvider, useSegmentedControlItemContext] = react.createContext(null, 'SegmentedControlItem');
41
41
  const [SegmentedControlItemListContextProvider, useSegmentedControlItemListContext] = react.createContext(null, 'SegmentedControlItemList');
42
+ function SegmentedControlDivider({
43
+ index,
44
+ selectedItemIndex
45
+ }) {
46
+ const isAdjacentToSelectedItem = !type.isNil(selectedItemIndex) && (selectedItemIndex + 1 === index || selectedItemIndex === index);
47
+ return /*#__PURE__*/jsxRuntime.jsx(Divider.Divider, {
48
+ className: index$1.default(SegmentedControl_module.default.SegmentedControlDivider, isAdjacentToSelectedItem && SegmentedControl_module.default.hidden),
49
+ withoutParallelIndent: true,
50
+ orientation: "vertical"
51
+ });
52
+ }
42
53
  function SegmentedControlItemListImpl({
43
54
  children,
44
55
  style: style$1,
@@ -70,9 +81,9 @@ function SegmentedControlItemListImpl({
70
81
  children: /*#__PURE__*/jsxRuntime.jsxs(SegmentedControlItemListContextProvider, {
71
82
  value: contextValue,
72
83
  children: [React__namespace.Children.map(children, (child, index) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
73
- children: [index !== 0 && /*#__PURE__*/jsxRuntime.jsx(Divider.Divider, {
74
- withoutParallelIndent: true,
75
- orientation: "vertical"
84
+ children: [index !== 0 && /*#__PURE__*/jsxRuntime.jsx(SegmentedControlDivider, {
85
+ index: index,
86
+ selectedItemIndex: selectedItemIndex
76
87
  }), /*#__PURE__*/jsxRuntime.jsx(SegmentedControlItemContextProvider, {
77
88
  value: index,
78
89
  children: child
@@ -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 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,CACJG,uCAAuC,EACvCC,kCAAkC,CACnC,GAAGJ,mBAAa,CACf,IAAI,EACJ,0BACF,CAAC;AAED,SAASK,4BAA4BA,CAInC;EACEC,QAAQ;SACRC,OAAK;EACLC,SAAS;EACT,GAAGC;AACuC,CAAC,EAC7CC,YAA0C,EAC1C;EACA,MAAM,CAACC,iBAAiB,EAAEC,oBAAoB,CAAC,GAAGC,cAAQ,CACxD,IACF,CAAC;EAED,MAAM;UAAEC,MAAI;IAAEC,IAAI;AAAEC,IAAAA;A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,GAAGf,0BAA0B,CAAC,sBAAsB,CAAC;AAEnE,EAAA,MAAMuE,oBAAoB,GACxBxD,IAAI,KAAK,YAAY,GAAGM,YAAwB,GAAGC,aAAqB;EAE1E,oBACEC,cAAA,CAACgD,oBAAoB,EAAA;IACnB/C,OAAO,EAAA,IAAA;AACPC,IAAAA,GAAG,EAAEd,YAAa;AAAA,IAAA,GACdD,IAAI;IAAAH,QAAA,eAERgB,cAAA,CAACwC,IAAI,EAAA;AAAAxD,MAAAA,QAAA,EAAEA;KAAe;AAAC,GACH,CAAC;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACagE,oBAAoB,gBAAGzB,gBAAU,CAACkC,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 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,mBAAa,CAAsC,IAAI,EAAE,kBAA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e;AAAC,GACH,CAAC;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACasD,oBAAoB,gBAAGzB,gBAAU,CAACkC,wBAAwB;;;;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var styles = {"SegmentedControl":"b-QJFyw","size-xs":"b-KfsMM","SegmentedControlItem":"b-Fxuhx","SegmentedControlIndicator":"b-G5Rub","size-s":"b-YkgBA","size-m":"b-GGYhm","size-l":"b-4ubIM","SegmentedControlItemContainer":"b-eMgAF","SegmentedControlItemLabel":"b-yS7U6"};
5
+ var styles = {"SegmentedControl":"b-QJFyw","size-xs":"b-KfsMM","SegmentedControlItem":"b-Fxuhx","SegmentedControlIndicator":"b-G5Rub","size-s":"b-YkgBA","size-m":"b-GGYhm","size-l":"b-4ubIM","SegmentedControlItemContainer":"b-eMgAF","SegmentedControlItemLabel":"b-yS7U6","SegmentedControlDivider":"b-RgPrE","hidden":"b-FM5TV"};
6
6
 
7
7
  exports.default = styles;
8
8
  //# sourceMappingURL=SegmentedControl.module.scss.js.map