@onesaz/ui 0.4.7 → 0.4.9

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
@@ -1870,6 +1870,8 @@ interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
1870
1870
  }
1871
1871
  declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLElement>>;
1872
1872
  interface SidebarHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
1873
+ /** Use accent color for text */
1874
+ accentColor?: boolean;
1873
1875
  }
1874
1876
  declare const SidebarHeader: React.ForwardRefExoticComponent<SidebarHeaderProps & React.RefAttributes<HTMLDivElement>>;
1875
1877
  interface SidebarContentProps extends React.HTMLAttributes<HTMLDivElement> {
@@ -1951,6 +1953,8 @@ interface SidebarRailProps extends React.HTMLAttributes<HTMLDivElement> {
1951
1953
  }
1952
1954
  declare const SidebarRail: React.ForwardRefExoticComponent<SidebarRailProps & React.RefAttributes<HTMLDivElement>>;
1953
1955
  interface IconRailProps extends React.HTMLAttributes<HTMLDivElement> {
1956
+ /** Expand rail on hover */
1957
+ hoverExpandRail?: boolean;
1954
1958
  }
1955
1959
  declare const IconRail: React.ForwardRefExoticComponent<IconRailProps & React.RefAttributes<HTMLDivElement>>;
1956
1960
  interface IconRailHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
@@ -1973,6 +1977,8 @@ interface IconRailItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement
1973
1977
  asButton?: boolean;
1974
1978
  /** Toggle rail expansion when clicked */
1975
1979
  toggleRail?: boolean;
1980
+ /** Custom color for the icon (CSS color value or Tailwind class) */
1981
+ iconColor?: string;
1976
1982
  }
1977
1983
  declare const IconRailItem: React.ForwardRefExoticComponent<IconRailItemProps & React.RefAttributes<HTMLButtonElement>>;
1978
1984
  interface RailPanelProps extends React.HTMLAttributes<HTMLDivElement> {
package/dist/index.js CHANGED
@@ -955,7 +955,7 @@ var Button = React6.forwardRef(
955
955
  const variantClasses3 = colorOverride ? null : {
956
956
  "bg-accent text-accent-foreground hover:bg-accent-hover": resolvedVariant === "default",
957
957
  "bg-destructive text-destructive-foreground hover:bg-destructive/90": resolvedVariant === "destructive",
958
- "border border-accent bg-transparent text-accent hover:bg-accent/10 dark:border-border dark:text-foreground dark:hover:bg-muted": resolvedVariant === "outline",
958
+ "border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": resolvedVariant === "outline",
959
959
  "bg-muted text-foreground hover:bg-muted/80": resolvedVariant === "secondary",
960
960
  "hover:bg-muted hover:text-foreground": resolvedVariant === "ghost",
961
961
  "text-accent underline-offset-4 hover:underline": resolvedVariant === "link"
@@ -1008,7 +1008,7 @@ var IconButton = React6.forwardRef(
1008
1008
  const variantClasses3 = colorOverride ? null : {
1009
1009
  "bg-accent text-accent-foreground hover:bg-accent-hover": variant === "default",
1010
1010
  "bg-destructive text-destructive-foreground hover:bg-destructive/90": variant === "destructive",
1011
- "border border-accent bg-transparent text-accent hover:bg-accent/10 dark:border-border dark:text-foreground dark:hover:bg-muted": variant === "outline",
1011
+ "border border-input bg-background hover:text-foreground dark:border-border dark:text-foreground dark:hover:bg-muted": variant === "outline",
1012
1012
  "bg-muted text-foreground hover:bg-muted/80": variant === "secondary",
1013
1013
  "hover:bg-muted hover:text-foreground": variant === "ghost",
1014
1014
  "text-accent underline-offset-4 hover:underline": variant === "link"
@@ -8513,12 +8513,16 @@ var Sidebar = React47.forwardRef(
8513
8513
  );
8514
8514
  Sidebar.displayName = "Sidebar";
8515
8515
  var SidebarHeader = React47.forwardRef(
8516
- ({ className, children, ...props }, ref) => {
8516
+ ({ className, accentColor = false, children, ...props }, ref) => {
8517
8517
  return /* @__PURE__ */ jsx47(
8518
8518
  "div",
8519
8519
  {
8520
8520
  ref,
8521
- className: cn("flex items-center h-14 px-4 border-b border-border shrink-0", className),
8521
+ className: cn(
8522
+ "flex items-center h-14 px-4 border-b border-border shrink-0",
8523
+ accentColor && "text-[var(--accent-7)] font-semibold",
8524
+ className
8525
+ ),
8522
8526
  ...props,
8523
8527
  children
8524
8528
  }
@@ -8782,9 +8786,19 @@ var SidebarRail = React48.forwardRef(
8782
8786
  );
8783
8787
  SidebarRail.displayName = "SidebarRail";
8784
8788
  var IconRail = React48.forwardRef(
8785
- ({ className, children, ...props }, ref) => {
8786
- const { railExpanded, overlayRail, expandableRail } = useSidebarRail();
8789
+ ({ className, children, hoverExpandRail = false, ...props }, ref) => {
8790
+ const { railExpanded, overlayRail, expandableRail, setRailExpanded } = useSidebarRail();
8787
8791
  const isExpanded = expandableRail && railExpanded;
8792
+ const handleMouseEnter = () => {
8793
+ if (hoverExpandRail && expandableRail) {
8794
+ setRailExpanded(true);
8795
+ }
8796
+ };
8797
+ const handleMouseLeave = () => {
8798
+ if (hoverExpandRail && expandableRail) {
8799
+ setRailExpanded(false);
8800
+ }
8801
+ };
8788
8802
  return /* @__PURE__ */ jsx48(
8789
8803
  "div",
8790
8804
  {
@@ -8793,6 +8807,8 @@ var IconRail = React48.forwardRef(
8793
8807
  "relative h-full shrink-0",
8794
8808
  isExpanded && !overlayRail ? "w-[var(--rail-expanded-width)]" : "w-[var(--rail-width)]"
8795
8809
  ),
8810
+ onMouseEnter: handleMouseEnter,
8811
+ onMouseLeave: handleMouseLeave,
8796
8812
  ...props,
8797
8813
  children: /* @__PURE__ */ jsx48(
8798
8814
  "div",
@@ -8863,7 +8879,7 @@ var IconRailFooter = React48.forwardRef(
8863
8879
  );
8864
8880
  IconRailFooter.displayName = "IconRailFooter";
8865
8881
  var IconRailItem = React48.forwardRef(
8866
- ({ className, railId, icon, label, asButton = false, toggleRail = false, onClick, ...props }, ref) => {
8882
+ ({ className, railId, icon, label, asButton = false, toggleRail = false, iconColor, onClick, ...props }, ref) => {
8867
8883
  const {
8868
8884
  activeRail,
8869
8885
  setActiveRail,
@@ -8888,6 +8904,7 @@ var IconRailItem = React48.forwardRef(
8888
8904
  setActiveRail(railId);
8889
8905
  }
8890
8906
  };
8907
+ const iconWithColor = iconColor ? /* @__PURE__ */ jsx48("span", { style: { color: iconColor }, className: "flex items-center justify-center", children: icon }) : icon;
8891
8908
  return /* @__PURE__ */ jsxs33(
8892
8909
  "button",
8893
8910
  {
@@ -8899,14 +8916,15 @@ var IconRailItem = React48.forwardRef(
8899
8916
  "flex items-center rounded-md transition-colors cursor-pointer",
8900
8917
  isRailExpanded ? "h-10 px-3 justify-start gap-3 w-full" : "w-10 h-10 justify-center",
8901
8918
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
8902
- isActive ? "bg-accent text-accent-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted",
8919
+ isActive ? "bg-accent text-accent-foreground" : !iconColor && "text-muted-foreground hover:text-foreground hover:bg-muted",
8920
+ iconColor && !isActive && "hover:bg-muted",
8903
8921
  className
8904
8922
  ),
8905
8923
  title: label,
8906
8924
  "aria-label": label,
8907
8925
  ...props,
8908
8926
  children: [
8909
- icon,
8927
+ iconWithColor,
8910
8928
  isRailExpanded && label && /* @__PURE__ */ jsx48("span", { className: "text-sm font-medium truncate", children: label })
8911
8929
  ]
8912
8930
  }