hazo_ui 2.4.2 → 2.4.4

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, style, ...props }, ref) => {
365
365
  const handleClick = () => {
366
366
  if (onSelect && value) {
367
367
  onSelect(value);
@@ -372,9 +372,15 @@ 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",
376
377
  className
377
378
  ),
379
+ style: {
380
+ // Ensure items have opaque background (inherit from popover container)
381
+ backgroundColor: "inherit",
382
+ ...style
383
+ },
378
384
  onClick: handleClick,
379
385
  ...props
380
386
  }
@@ -4509,28 +4515,34 @@ var create_suggestion_config = (prefix_config, on_suggestion_change, on_insert_c
4509
4515
  render: () => {
4510
4516
  return {
4511
4517
  onStart: (props) => {
4512
- on_suggestion_change({
4513
- is_active: true,
4514
- query: props.query,
4515
- prefix: prefix_config.char,
4516
- client_rect: props.clientRect,
4517
- commands: prefix_config.commands,
4518
- range: props.range
4518
+ queueMicrotask(() => {
4519
+ on_suggestion_change({
4520
+ is_active: true,
4521
+ query: props.query,
4522
+ prefix: prefix_config.char,
4523
+ client_rect: props.clientRect,
4524
+ commands: prefix_config.commands,
4525
+ range: props.range
4526
+ });
4519
4527
  });
4520
4528
  },
4521
4529
  onUpdate: (props) => {
4522
- on_suggestion_change({
4523
- is_active: true,
4524
- query: props.query,
4525
- prefix: prefix_config.char,
4526
- client_rect: props.clientRect,
4527
- commands: prefix_config.commands,
4528
- range: props.range
4530
+ queueMicrotask(() => {
4531
+ on_suggestion_change({
4532
+ is_active: true,
4533
+ query: props.query,
4534
+ prefix: prefix_config.char,
4535
+ client_rect: props.clientRect,
4536
+ commands: prefix_config.commands,
4537
+ range: props.range
4538
+ });
4529
4539
  });
4530
4540
  },
4531
4541
  onKeyDown: (props) => {
4532
4542
  if (props.event.key === "Escape") {
4533
- on_suggestion_change(null);
4543
+ queueMicrotask(() => {
4544
+ on_suggestion_change(null);
4545
+ });
4534
4546
  return true;
4535
4547
  }
4536
4548
  if (props.event.key === "ArrowUp" || props.event.key === "ArrowDown" || props.event.key === "Enter") {
@@ -4539,7 +4551,9 @@ var create_suggestion_config = (prefix_config, on_suggestion_change, on_insert_c
4539
4551
  return false;
4540
4552
  },
4541
4553
  onExit: () => {
4542
- on_suggestion_change(null);
4554
+ queueMicrotask(() => {
4555
+ on_suggestion_change(null);
4556
+ });
4543
4557
  }
4544
4558
  };
4545
4559
  },
@@ -4692,7 +4706,11 @@ var CommandPopover = ({
4692
4706
  position: "fixed",
4693
4707
  top: position.top,
4694
4708
  left: position.left,
4695
- zIndex: 9999
4709
+ zIndex: 9999,
4710
+ // Fallback background for consuming apps that may use hex CSS variables
4711
+ // (Tailwind's bg-popover generates hsl(var(--popover)) which fails with hex values)
4712
+ backgroundColor: "var(--popover, hsl(0 0% 100%))",
4713
+ color: "var(--popover-foreground, hsl(222.2 84% 4.9%))"
4696
4714
  },
4697
4715
  children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "rounded-md", children: [
4698
4716
  query && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
@@ -5856,7 +5874,10 @@ var HazoUiTextarea = ({
5856
5874
  position: "fixed",
5857
5875
  top: edit_context.rect.y,
5858
5876
  left: edit_context.rect.x,
5859
- zIndex: 9999
5877
+ zIndex: 9999,
5878
+ // Fallback background for consuming apps that may use hex CSS variables
5879
+ backgroundColor: "var(--popover, #ffffff)",
5880
+ color: "var(--popover-foreground, #0f172a)"
5860
5881
  },
5861
5882
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "py-1", children: [
5862
5883
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: "Change command" }),
@@ -5870,6 +5891,10 @@ var HazoUiTextarea = ({
5870
5891
  idx === edit_selected_index && "bg-accent",
5871
5892
  cmd.action === edit_context.command.action && "font-medium"
5872
5893
  ),
5894
+ style: {
5895
+ // Inherit background from parent, use accent color when selected
5896
+ backgroundColor: idx === edit_selected_index ? "var(--accent, #f1f5f9)" : "inherit"
5897
+ },
5873
5898
  onClick: () => handle_command_update(cmd),
5874
5899
  children: [
5875
5900
  cmd.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
@@ -5893,6 +5918,10 @@ var HazoUiTextarea = ({
5893
5918
  "hover:bg-destructive/10",
5894
5919
  edit_selected_index === edit_commands.length && "bg-destructive/10"
5895
5920
  ),
5921
+ style: {
5922
+ // Inherit background from parent, use light destructive color when selected
5923
+ backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
5924
+ },
5896
5925
  onClick: handle_command_remove,
5897
5926
  children: /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Remove" })
5898
5927
  }