hazo_ui 2.4.3 → 2.4.5

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.cjs CHANGED
@@ -361,7 +361,7 @@ var CommandGroup = React27__namespace.forwardRef(({ className, heading, children
361
361
  }
362
362
  ));
363
363
  CommandGroup.displayName = "CommandGroup";
364
- var CommandItem = React27__namespace.forwardRef(({ className, onSelect, value, ...props }, ref) => {
364
+ var CommandItem = React27__namespace.forwardRef(({ className, onSelect, value, selected, style, ...props }, ref) => {
365
365
  const handleClick = () => {
366
366
  if (onSelect && value) {
367
367
  onSelect(value);
@@ -372,9 +372,18 @@ var CommandItem = React27__namespace.forwardRef(({ className, onSelect, value, .
372
372
  {
373
373
  ref,
374
374
  className: cn(
375
+ "cls_command_item",
375
376
  "relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none hover:bg-accent hover:text-accent-foreground aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
377
+ // When selected, apply accent background and ensure all text is visible
378
+ selected && "bg-accent text-accent-foreground [&_.text-muted-foreground]:text-accent-foreground/70",
376
379
  className
377
380
  ),
381
+ style: selected ? {
382
+ // Explicit inline styles as fallback for consumers with non-HSL CSS variables
383
+ backgroundColor: "var(--accent, #f1f5f9)",
384
+ color: "var(--accent-foreground, #0f172a)",
385
+ ...style
386
+ } : style,
378
387
  onClick: handleClick,
379
388
  ...props
380
389
  }
@@ -4700,7 +4709,11 @@ var CommandPopover = ({
4700
4709
  position: "fixed",
4701
4710
  top: position.top,
4702
4711
  left: position.left,
4703
- zIndex: 9999
4712
+ zIndex: 9999,
4713
+ // Fallback background for consuming apps that may use hex CSS variables
4714
+ // (Tailwind's bg-popover generates hsl(var(--popover)) which fails with hex values)
4715
+ backgroundColor: "var(--popover, hsl(0 0% 100%))",
4716
+ color: "var(--popover-foreground, hsl(222.2 84% 4.9%))"
4704
4717
  },
4705
4718
  children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "rounded-md", children: [
4706
4719
  query && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
@@ -4730,9 +4743,7 @@ var CommandPopover = ({
4730
4743
  {
4731
4744
  value: cmd.action,
4732
4745
  onSelect: () => on_select(cmd),
4733
- className: cn(
4734
- flat_idx === selected_index && "bg-accent"
4735
- ),
4746
+ selected: flat_idx === selected_index,
4736
4747
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 w-full", children: [
4737
4748
  cmd.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
4738
4749
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
@@ -5864,7 +5875,10 @@ var HazoUiTextarea = ({
5864
5875
  position: "fixed",
5865
5876
  top: edit_context.rect.y,
5866
5877
  left: edit_context.rect.x,
5867
- zIndex: 9999
5878
+ zIndex: 9999,
5879
+ // Fallback background for consuming apps that may use hex CSS variables
5880
+ backgroundColor: "var(--popover, #ffffff)",
5881
+ color: "var(--popover-foreground, #0f172a)"
5868
5882
  },
5869
5883
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-1", children: [
5870
5884
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: "Change command" }),
@@ -5878,6 +5892,10 @@ var HazoUiTextarea = ({
5878
5892
  idx === edit_selected_index && "bg-accent",
5879
5893
  cmd.action === edit_context.command.action && "font-medium"
5880
5894
  ),
5895
+ style: {
5896
+ // Inherit background from parent, use accent color when selected
5897
+ backgroundColor: idx === edit_selected_index ? "var(--accent, #f1f5f9)" : "inherit"
5898
+ },
5881
5899
  onClick: () => handle_command_update(cmd),
5882
5900
  children: [
5883
5901
  cmd.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
@@ -5901,6 +5919,10 @@ var HazoUiTextarea = ({
5901
5919
  "hover:bg-destructive/10",
5902
5920
  edit_selected_index === edit_commands.length && "bg-destructive/10"
5903
5921
  ),
5922
+ style: {
5923
+ // Inherit background from parent, use light destructive color when selected
5924
+ backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
5925
+ },
5904
5926
  onClick: handle_command_remove,
5905
5927
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Remove" })
5906
5928
  }