@onesaz/ui 0.3.21 → 0.3.22

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.ts CHANGED
@@ -205,6 +205,19 @@ interface IconButtonProps extends Omit<ButtonProps, 'size'> {
205
205
  'aria-label': string;
206
206
  }
207
207
  declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
208
+ interface ButtonGroupProps extends React.HTMLAttributes<HTMLDivElement> {
209
+ /** Variant applied to all child buttons (can be overridden per button) */
210
+ variant?: ButtonProps['variant'];
211
+ /** Size applied to all child buttons (can be overridden per button) */
212
+ size?: ButtonProps['size'];
213
+ /** Layout direction */
214
+ orientation?: 'horizontal' | 'vertical';
215
+ /** Disable all child buttons */
216
+ disabled?: boolean;
217
+ /** Stretch group to fill container width */
218
+ fullWidth?: boolean;
219
+ }
220
+ declare const ButtonGroup: React.ForwardRefExoticComponent<ButtonGroupProps & React.RefAttributes<HTMLDivElement>>;
208
221
 
209
222
  interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
210
223
  /** Input size variant */
@@ -1839,4 +1852,4 @@ declare const RailPanelItem: React.ForwardRefExoticComponent<RailPanelItemProps
1839
1852
 
1840
1853
  declare const Playground: () => react_jsx_runtime.JSX.Element;
1841
1854
 
1842
- export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, AreaChart, type AreaChartProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartProps, Box, type BoxProps, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbPage, type BreadcrumbPageProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, type CircularProgressProps, type ColumnGroupModel, type ColumnVisibilityModel, Combobox, type ComboboxMultipleProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, DataGrid, type DataGridProps, DataGrid as DataGridV0, DialogNamespace as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, type DonutChartProps, Drawer, DrawerBody, type DrawerBodyProps, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, FormControl, type FormControlProps, FormGroup, type FormGroupProps, FormHelperText, type FormHelperTextProps, FormLabel, type FormLabelProps, Grid, type GridColDef, type GridProps, type GridRenderCellParams, type GridRenderHeaderParams, type GridRowSelectionModel, type GridSpanParams, type GridValueFormatterParams, type GridValueGetterParams, H1, H2, H3, H4, H5, H6, HStack, IconButton, type IconButtonProps, IconRail, IconRailContent, type IconRailContentProps, IconRailFooter, type IconRailFooterProps, IconRailHeader, type IconRailHeaderProps, IconRailItem, type IconRailItemProps, type IconRailProps, Input, InputAdornment, type InputAdornmentProps, type InputProps, Label, type LabelProps, LineChart, type LineChartProps, LinearProgress, type LinearProgressProps, List, ListDivider, type ListDividerProps, ListItem, ListItemAvatar, type ListItemAvatarProps, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MultiProgressDonut, type MultiProgressDonutProps, NativeSelect, NativeSelectOption, type NativeSelectOptionProps, type NativeSelectProps, PackedBubbleChart, type PackedBubbleChartProps, type PackedBubbleDataItem, PaginationNamespace as Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, type PaginationModel, PaginationNext, PaginationPrevious, type PaginationProps, PieChart, type PieChartProps, type PinnedColumnsModel, type PinnedRowsModel, Playground, Progress, ProgressCard, type ProgressCardProps, ProgressDonut, type ProgressDonutProps, type ProgressProps, RadarChart, type RadarChartProps, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RadioProps, RailPanel, RailPanelGroup, type RailPanelGroupProps, RailPanelItem, type RailPanelItemProps, type RailPanelProps, RangeSlider, type RangeSliderProps, ScatterChart, type ScatterChartProps, SelectNamespace as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarRail, type SidebarRailProps, SidebarSubMenu, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, SkeletonTableRow, type SkeletonTableRowProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, TableNamespace as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeContext, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, TopBar, TopBarBrand, type TopBarBrandProps, TopBarDivider, type TopBarDividerProps, TopBarNav, TopBarNavItem, type TopBarNavItemProps, type TopBarNavProps, type TopBarProps, TopBarSection, type TopBarSectionProps, Typography, type TypographyProps, UnderlineTabsContent, UnderlineTabsList, UnderlineTabsTrigger, type UnderlineTabsTriggerProps, VStack, VerticalTabs, VerticalTabsContent, VerticalTabsGroupLabel, type VerticalTabsGroupLabelProps, VerticalTabsList, VerticalTabsTrigger, type VerticalTabsTriggerProps, VirtualList, type VirtualListProps, cn, useFormControl, useSidebar, useSidebarRail, useTheme };
1855
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, type AlertDescriptionProps, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, type AlertDialogContentProps, AlertDialogDescription, AlertDialogFooter, type AlertDialogFooterProps, AlertDialogHeader, type AlertDialogHeaderProps, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, type AlertProps, AlertTitle, type AlertTitleProps, AreaChart, type AreaChartProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, Badge, type BadgeProps, BarChart, type BarChartProps, Box, type BoxProps, BreadcrumbEllipsis, type BreadcrumbEllipsisProps, BreadcrumbItem, type BreadcrumbItemProps, BreadcrumbLink, type BreadcrumbLinkProps, BreadcrumbPage, type BreadcrumbPageProps, BreadcrumbSeparator, type BreadcrumbSeparatorProps, Breadcrumbs, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, Caption, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, type CircularProgressProps, type ColumnGroupModel, type ColumnVisibilityModel, Combobox, type ComboboxMultipleProps, type ComboboxOption, type ComboboxProps, type ComboboxSingleProps, DataGrid, type DataGridProps, DataGrid as DataGridV0, DialogNamespace as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DonutChart, type DonutChartProps, Drawer, DrawerBody, type DrawerBodyProps, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, type DropdownMenuLabelProps, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, type DropdownMenuSubTriggerProps, DropdownMenuTrigger, FormControl, type FormControlProps, FormGroup, type FormGroupProps, FormHelperText, type FormHelperTextProps, FormLabel, type FormLabelProps, Grid, type GridColDef, type GridProps, type GridRenderCellParams, type GridRenderHeaderParams, type GridRowSelectionModel, type GridSpanParams, type GridValueFormatterParams, type GridValueGetterParams, H1, H2, H3, H4, H5, H6, HStack, IconButton, type IconButtonProps, IconRail, IconRailContent, type IconRailContentProps, IconRailFooter, type IconRailFooterProps, IconRailHeader, type IconRailHeaderProps, IconRailItem, type IconRailItemProps, type IconRailProps, Input, InputAdornment, type InputAdornmentProps, type InputProps, Label, type LabelProps, LineChart, type LineChartProps, LinearProgress, type LinearProgressProps, List, ListDivider, type ListDividerProps, ListItem, ListItemAvatar, type ListItemAvatarProps, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, MultiProgressDonut, type MultiProgressDonutProps, NativeSelect, NativeSelectOption, type NativeSelectOptionProps, type NativeSelectProps, PackedBubbleChart, type PackedBubbleChartProps, type PackedBubbleDataItem, PaginationNamespace as Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, type PaginationLinkProps, type PaginationModel, PaginationNext, PaginationPrevious, type PaginationProps, PieChart, type PieChartProps, type PinnedColumnsModel, type PinnedRowsModel, Playground, Progress, ProgressCard, type ProgressCardProps, ProgressDonut, type ProgressDonutProps, type ProgressProps, RadarChart, type RadarChartProps, Radio, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type RadioProps, RailPanel, RailPanelGroup, type RailPanelGroupProps, RailPanelItem, type RailPanelItemProps, type RailPanelProps, RangeSlider, type RangeSliderProps, ScatterChart, type ScatterChartProps, SelectNamespace as Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Sheet, SheetBody, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetTitle, SheetTrigger, Sidebar, SidebarContent, type SidebarContentProps, SidebarFooter, type SidebarFooterProps, SidebarGroup, type SidebarGroupProps, SidebarHeader, type SidebarHeaderProps, SidebarItem, type SidebarItemProps, type SidebarProps, SidebarRail, type SidebarRailProps, SidebarSubMenu, type SidebarSubMenuProps, SidebarToggle, type SidebarToggleProps, Skeleton, SkeletonAvatar, type SkeletonAvatarProps, SkeletonCard, type SkeletonCardProps, type SkeletonProps, SkeletonTableRow, type SkeletonTableRowProps, SkeletonText, type SkeletonTextProps, Slider, type SliderProps, Spinner, type SpinnerProps, Stack, type StackProps, Switch, type SwitchProps, TableNamespace as Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Text, TextField, type TextFieldProps, Textarea, type TextareaProps, ThemeContext, type ThemeContextValue, ThemeProvider, type ThemeProviderProps, Tooltip, TooltipArrow, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipProps, TooltipProvider, TooltipRoot, TooltipTrigger, TopBar, TopBarBrand, type TopBarBrandProps, TopBarDivider, type TopBarDividerProps, TopBarNav, TopBarNavItem, type TopBarNavItemProps, type TopBarNavProps, type TopBarProps, TopBarSection, type TopBarSectionProps, Typography, type TypographyProps, UnderlineTabsContent, UnderlineTabsList, UnderlineTabsTrigger, type UnderlineTabsTriggerProps, VStack, VerticalTabs, VerticalTabsContent, VerticalTabsGroupLabel, type VerticalTabsGroupLabelProps, VerticalTabsList, VerticalTabsTrigger, type VerticalTabsTriggerProps, VirtualList, type VirtualListProps, cn, useFormControl, useSidebar, useSidebarRail, useTheme };
package/dist/index.js CHANGED
@@ -865,28 +865,35 @@ Caption.displayName = "Caption";
865
865
  // src/components/button.tsx
866
866
  import * as React6 from "react";
867
867
  import { jsx as jsx6 } from "react/jsx-runtime";
868
+ var ButtonGroupContext = React6.createContext({});
869
+ var useButtonGroup = () => React6.useContext(ButtonGroupContext);
868
870
  var Button = React6.forwardRef(
869
- ({ className, variant = "default", size = "default", fullWidth = false, ...props }, ref) => {
871
+ ({ className, variant, size, fullWidth = false, disabled, ...props }, ref) => {
872
+ const groupCtx = useButtonGroup();
873
+ const resolvedVariant = variant ?? groupCtx.variant ?? "default";
874
+ const resolvedSize = size ?? groupCtx.size ?? "default";
875
+ const resolvedDisabled = disabled ?? groupCtx.disabled;
870
876
  return /* @__PURE__ */ jsx6(
871
877
  "button",
872
878
  {
879
+ disabled: resolvedDisabled,
873
880
  className: cn(
874
881
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors cursor-pointer",
875
882
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
876
883
  "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed",
877
884
  {
878
- "bg-accent text-accent-foreground hover:bg-accent-hover": variant === "default",
879
- "bg-destructive text-destructive-foreground hover:bg-destructive/90": variant === "destructive",
880
- "border border-input bg-background hover:bg-muted hover:text-foreground": variant === "outline",
881
- "bg-muted text-foreground hover:bg-muted/80": variant === "secondary",
882
- "hover:bg-muted hover:text-foreground": variant === "ghost",
883
- "text-accent underline-offset-4 hover:underline": variant === "link"
885
+ "bg-accent text-accent-foreground hover:bg-accent-hover": resolvedVariant === "default",
886
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90": resolvedVariant === "destructive",
887
+ "border border-input bg-background hover:bg-muted hover:text-foreground": resolvedVariant === "outline",
888
+ "bg-muted text-foreground hover:bg-muted/80": resolvedVariant === "secondary",
889
+ "hover:bg-muted hover:text-foreground": resolvedVariant === "ghost",
890
+ "text-accent underline-offset-4 hover:underline": resolvedVariant === "link"
884
891
  },
885
892
  {
886
- "h-10 px-4 py-2": size === "default",
887
- "h-9 rounded-md px-3": size === "sm",
888
- "h-11 rounded-md px-8": size === "lg",
889
- "h-10 w-10": size === "icon"
893
+ "h-10 px-4 py-2": resolvedSize === "default",
894
+ "h-9 rounded-md px-3": resolvedSize === "sm",
895
+ "h-11 rounded-md px-8": resolvedSize === "lg",
896
+ "h-10 w-10": resolvedSize === "icon"
890
897
  },
891
898
  fullWidth && "w-full",
892
899
  className
@@ -932,6 +939,54 @@ var IconButton = React6.forwardRef(
932
939
  }
933
940
  );
934
941
  IconButton.displayName = "IconButton";
942
+ var ButtonGroup = React6.forwardRef(
943
+ ({
944
+ className,
945
+ variant,
946
+ size,
947
+ orientation = "horizontal",
948
+ disabled,
949
+ fullWidth = false,
950
+ children,
951
+ ...props
952
+ }, ref) => {
953
+ return /* @__PURE__ */ jsx6(ButtonGroupContext.Provider, { value: { variant, size, disabled }, children: /* @__PURE__ */ jsx6(
954
+ "div",
955
+ {
956
+ ref,
957
+ role: "group",
958
+ className: cn(
959
+ "inline-flex",
960
+ orientation === "vertical" && "flex-col",
961
+ fullWidth && "flex w-full",
962
+ // Horizontal: collapse inner borders and strip inner radius
963
+ orientation === "horizontal" && [
964
+ "[&>*:not(:first-child)]:rounded-l-none",
965
+ "[&>*:not(:last-child)]:rounded-r-none",
966
+ "[&>*:not(:first-child)]:-ml-px",
967
+ // Bring hovered/focused button's border to front
968
+ "[&>*]:relative",
969
+ "[&>*:hover]:z-10",
970
+ "[&>*:focus-visible]:z-10"
971
+ ],
972
+ // Vertical: collapse inner borders and strip inner radius
973
+ orientation === "vertical" && [
974
+ "[&>*:not(:first-child)]:rounded-t-none",
975
+ "[&>*:not(:last-child)]:rounded-b-none",
976
+ "[&>*:not(:first-child)]:-mt-px",
977
+ "[&>*]:relative",
978
+ "[&>*:hover]:z-10",
979
+ "[&>*:focus-visible]:z-10"
980
+ ],
981
+ className
982
+ ),
983
+ ...props,
984
+ children
985
+ }
986
+ ) });
987
+ }
988
+ );
989
+ ButtonGroup.displayName = "ButtonGroup";
935
990
 
936
991
  // src/components/input.tsx
937
992
  import * as React7 from "react";
@@ -8683,6 +8738,7 @@ export {
8683
8738
  BreadcrumbSeparator,
8684
8739
  Breadcrumbs,
8685
8740
  Button,
8741
+ ButtonGroup,
8686
8742
  Caption,
8687
8743
  Card,
8688
8744
  CardContent,