@eqtylab/equality 4.4.2 → 4.5.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.
package/dist/index.d.cts CHANGED
@@ -771,6 +771,7 @@ interface SectionHeadingProps {
771
771
  declare const SectionHeading: ({ heading, description, renderRightContent, className, }: SectionHeadingProps) => react_jsx_runtime.JSX.Element;
772
772
 
773
773
  type SegmentedControlsDisplay = 'both' | 'text-only' | 'icon-only';
774
+ type SegmentedControlsSize = 'sm' | 'md' | 'lg';
774
775
  interface SegmentedControlOption {
775
776
  /** Unique value used to identify the option. */
776
777
  value: string;
@@ -790,9 +791,11 @@ interface SegmentedControlsProps {
790
791
  * `icon-only` requires every option to define an `icon` and falls back to `both` otherwise.
791
792
  */
792
793
  display?: SegmentedControlsDisplay;
794
+ /** Matches the height of a `Button` of the same size. */
795
+ size?: SegmentedControlsSize;
793
796
  className?: string;
794
797
  }
795
- declare const SegmentedControls: ({ options, value, onValueChange, display, className, }: SegmentedControlsProps) => react_jsx_runtime.JSX.Element;
798
+ declare const SegmentedControls: ({ options, value, onValueChange, display, size, className, }: SegmentedControlsProps) => react_jsx_runtime.JSX.Element;
796
799
 
797
800
  declare const useSelectSearchQuery: () => {
798
801
  query: string;
@@ -1097,4 +1100,4 @@ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
1097
1100
  */
1098
1101
  declare const scheduleHighlight: (root?: Node) => Promise<void>;
1099
1102
 
1100
- export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
1103
+ export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
package/dist/index.d.ts CHANGED
@@ -771,6 +771,7 @@ interface SectionHeadingProps {
771
771
  declare const SectionHeading: ({ heading, description, renderRightContent, className, }: SectionHeadingProps) => react_jsx_runtime.JSX.Element;
772
772
 
773
773
  type SegmentedControlsDisplay = 'both' | 'text-only' | 'icon-only';
774
+ type SegmentedControlsSize = 'sm' | 'md' | 'lg';
774
775
  interface SegmentedControlOption {
775
776
  /** Unique value used to identify the option. */
776
777
  value: string;
@@ -790,9 +791,11 @@ interface SegmentedControlsProps {
790
791
  * `icon-only` requires every option to define an `icon` and falls back to `both` otherwise.
791
792
  */
792
793
  display?: SegmentedControlsDisplay;
794
+ /** Matches the height of a `Button` of the same size. */
795
+ size?: SegmentedControlsSize;
793
796
  className?: string;
794
797
  }
795
- declare const SegmentedControls: ({ options, value, onValueChange, display, className, }: SegmentedControlsProps) => react_jsx_runtime.JSX.Element;
798
+ declare const SegmentedControls: ({ options, value, onValueChange, display, size, className, }: SegmentedControlsProps) => react_jsx_runtime.JSX.Element;
796
799
 
797
800
  declare const useSelectSearchQuery: () => {
798
801
  query: string;
@@ -1097,4 +1100,4 @@ declare const CODE_BLOCK_ATTRIBUTE = "data-equality-code-block";
1097
1100
  */
1098
1101
  declare const scheduleHighlight: (root?: Node) => Promise<void>;
1099
1102
 
1100
- export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
1103
+ export { Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, Avatar, AvatarFallback, AvatarImage, Badge, type BadgeDisplayMode, type BadgeProps, BarGraph, type BarGraphProps, BarGraphSegment, type BarGraphSegmentProps, BgGradient, Button, type ButtonProps, CODE_BLOCK_ATTRIBUTE, Card, CardContent, CardContentHeader, type CardContentHeaderProps, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, CodeBlock, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, ControlStatusBadge, type ControlStatusBadgeDisplayMode, CopyButton, type CopyButtonProps, DateRangePicker, Dialog, DialogClose, DialogContainer, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogHeaderIcon, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DisplayField, type DisplayFieldProps, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerHeaderActions, DrawerInnerContent, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuEmpty, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSearch, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, ELEVATION, type Elevation, EmptyTableState, FilterDropdown, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, FormatDate, type FormatDateDisplayMode, type FormatDateProps, Heading, Icon, IconButton, type IconButtonProps, type IconProps, InfoCard, Input, type InputProps, Label, ListOrGridViewToggle, LoadingOverlay, MetricCard, MotionCollapsibleContent, NotFound, PORTAL_ROOT_ID, Pagination, PanelLabel, Popover, PopoverContent, PopoverTrigger, PortalContainerProvider, Progress, ProgressIndicator, type ProgressIndicatorProps, ProgressIndicatorStep, type ProgressIndicatorStepProps, RadialGraph, type RadialGraphProps, RadioDropdown, RadioGroup, RadioGroupItem, ResourceBadge, type ResourceDisplayMode, type ResourceType, ScrollArea, ScrollBar, SearchBar, SectionHeading, type SegmentedControlOption, SegmentedControls, type SegmentedControlsDisplay, type SegmentedControlsProps, type SegmentedControlsSize, Select, SelectContent, SelectEmpty, SelectGroup, SelectItem, SelectLabel, SelectSearch, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContainer, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetHeaderIcon, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Skeleton, SortButton, type SortField, type SortMode, type SortOrder, SortSelector, Spinner, Switch, TableBody, TableCaption, TableCell, TableContainer, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContainer, TabsContent, TabsList, TabsTrigger, Textarea, type Theme, ThemeProvider, Toast, ToastAction, type ToastActionElement, ToastClose, ToastContainer, ToastDescription, type ToastProps$1 as ToastProps, ToastProvider, ToastRoot, ToastTitle, ToastViewport, Toaster, type ToasterToast, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TruncatedDescription, type ViewMode, type ViewOrder, badgeVariants, buttonVariants, reducer, scheduleHighlight, toast, useDropdownMenuSearchQuery, useFormField, usePortalContainer, useSelectSearchQuery, useTheme, useToast };
package/dist/index.js CHANGED
@@ -1853,6 +1853,12 @@ function handleListKeyDown(state, event, { searchSelector, itemSelector }) {
1853
1853
  const edgeItem = event.key === "ArrowUp" ? items[0] : items[items.length - 1];
1854
1854
  if (edgeItem && edgeItem === target?.closest(itemSelector)) {
1855
1855
  event.preventDefault();
1856
+ if (event.key === "ArrowDown") {
1857
+ for (let el = target; el; el = el.parentElement) {
1858
+ el.scrollTop = 0;
1859
+ if (el === event.currentTarget) break;
1860
+ }
1861
+ }
1856
1862
  state.requestFocus();
1857
1863
  return;
1858
1864
  }
@@ -3828,6 +3834,7 @@ var SegmentedControls = ({
3828
3834
  value,
3829
3835
  onValueChange,
3830
3836
  display = "both",
3837
+ size = "md",
3831
3838
  className
3832
3839
  }) => {
3833
3840
  const allHaveIcons = options.every((option) => option.icon != null);
@@ -3839,6 +3846,7 @@ var SegmentedControls = ({
3839
3846
  left: 0,
3840
3847
  width: 0
3841
3848
  });
3849
+ const [animateIndicator, setAnimateIndicator] = useState(false);
3842
3850
  const updateIndicator = useCallback(() => {
3843
3851
  const activeSegment = segmentRefs.current[value];
3844
3852
  if (activeSegment) {
@@ -3847,7 +3855,11 @@ var SegmentedControls = ({
3847
3855
  }, [value]);
3848
3856
  useLayoutEffect(() => {
3849
3857
  updateIndicator();
3850
- }, [updateIndicator, options, effectiveDisplay]);
3858
+ }, [updateIndicator, options, effectiveDisplay, size]);
3859
+ useEffect(() => {
3860
+ const frame = requestAnimationFrame(() => setAnimateIndicator(true));
3861
+ return () => cancelAnimationFrame(frame);
3862
+ }, []);
3851
3863
  useLayoutEffect(() => {
3852
3864
  const container = containerRef.current;
3853
3865
  if (!container) return;
@@ -3855,44 +3867,57 @@ var SegmentedControls = ({
3855
3867
  observer.observe(container);
3856
3868
  return () => observer.disconnect();
3857
3869
  }, [updateIndicator]);
3858
- return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: cn(styles49["segmented-controls"], className), children: [
3859
- options.map((option) => {
3860
- const currentlyActive = option.value === value;
3861
- const showIcon = option.icon != null && effectiveDisplay !== "text-only";
3862
- const showLabel = effectiveDisplay !== "icon-only";
3863
- return /* @__PURE__ */ jsxs(
3864
- "button",
3865
- {
3866
- ref: (el) => {
3867
- segmentRefs.current[option.value] = el;
3868
- },
3869
- type: "button",
3870
- "aria-pressed": currentlyActive,
3871
- "aria-label": isIconOnly ? option.label : void 0,
3872
- title: isIconOnly ? option.label : void 0,
3873
- className: cn(
3874
- styles49["segment"],
3875
- isIconOnly && styles49["segment--icon-only"],
3876
- currentlyActive ? styles49["segment--active"] : styles49["segment--inactive"]
3877
- ),
3878
- onClick: () => onValueChange(option.value),
3879
- children: [
3880
- showIcon && /* @__PURE__ */ jsx(Icon, { icon: option.icon, size: "xs", className: styles49["segment-icon"] }),
3881
- showLabel && /* @__PURE__ */ jsx("span", { children: option.label }),
3882
- !isIconOnly && option.suffix && /* @__PURE__ */ jsx("span", { className: styles49["segment-suffix"], children: option.suffix })
3883
- ]
3884
- },
3885
- option.value
3886
- );
3887
- }),
3888
- /* @__PURE__ */ jsx(
3889
- "div",
3890
- {
3891
- className: styles49["active-segment-indicator"],
3892
- style: { transform: `translateX(${indicator.left}px)`, width: `${indicator.width}px` }
3893
- }
3894
- )
3895
- ] });
3870
+ return /* @__PURE__ */ jsxs(
3871
+ "div",
3872
+ {
3873
+ ref: containerRef,
3874
+ className: cn(styles49["segmented-controls"], styles49[`size--${size}`], className),
3875
+ children: [
3876
+ options.map((option) => {
3877
+ const currentlyActive = option.value === value;
3878
+ const showIcon = option.icon != null && effectiveDisplay !== "text-only";
3879
+ const showLabel = effectiveDisplay !== "icon-only";
3880
+ return /* @__PURE__ */ jsxs(
3881
+ "button",
3882
+ {
3883
+ ref: (el) => {
3884
+ segmentRefs.current[option.value] = el;
3885
+ },
3886
+ type: "button",
3887
+ "aria-pressed": currentlyActive,
3888
+ "aria-label": isIconOnly ? option.label : void 0,
3889
+ title: isIconOnly ? option.label : void 0,
3890
+ className: cn(
3891
+ styles49["segment"],
3892
+ isIconOnly && styles49["segment--icon-only"],
3893
+ currentlyActive ? styles49["segment--active"] : styles49["segment--inactive"]
3894
+ ),
3895
+ onClick: () => onValueChange(option.value),
3896
+ children: [
3897
+ showIcon && /* @__PURE__ */ jsx(Icon, { icon: option.icon, size: "xs", className: styles49["segment-icon"] }),
3898
+ showLabel && /* @__PURE__ */ jsx("span", { children: option.label }),
3899
+ !isIconOnly && option.suffix && /* @__PURE__ */ jsx("span", { className: styles49["segment-suffix"], children: option.suffix })
3900
+ ]
3901
+ },
3902
+ option.value
3903
+ );
3904
+ }),
3905
+ /* @__PURE__ */ jsx(
3906
+ "div",
3907
+ {
3908
+ className: cn(
3909
+ styles49["active-segment-indicator"],
3910
+ animateIndicator && styles49["active-segment-indicator--animated"]
3911
+ ),
3912
+ style: {
3913
+ transform: `translateX(${indicator.left}px)`,
3914
+ "--indicator-width": `${indicator.width}px`
3915
+ }
3916
+ }
3917
+ )
3918
+ ]
3919
+ }
3920
+ );
3896
3921
  };
3897
3922
  var Separator3 = React15.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx(
3898
3923
  SeparatorPrimitive.Root,