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 +48 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +48 -19
- package/dist/index.js.map +1 -1
- package/dist/styles.css +46 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -302,7 +302,7 @@ var CommandGroup = React27.forwardRef(({ className, heading, children, ...props
|
|
|
302
302
|
}
|
|
303
303
|
));
|
|
304
304
|
CommandGroup.displayName = "CommandGroup";
|
|
305
|
-
var CommandItem = React27.forwardRef(({ className, onSelect, value, ...props }, ref) => {
|
|
305
|
+
var CommandItem = React27.forwardRef(({ className, onSelect, value, style, ...props }, ref) => {
|
|
306
306
|
const handleClick = () => {
|
|
307
307
|
if (onSelect && value) {
|
|
308
308
|
onSelect(value);
|
|
@@ -313,9 +313,15 @@ var CommandItem = React27.forwardRef(({ className, onSelect, value, ...props },
|
|
|
313
313
|
{
|
|
314
314
|
ref,
|
|
315
315
|
className: cn(
|
|
316
|
+
"cls_command_item",
|
|
316
317
|
"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",
|
|
317
318
|
className
|
|
318
319
|
),
|
|
320
|
+
style: {
|
|
321
|
+
// Ensure items have opaque background (inherit from popover container)
|
|
322
|
+
backgroundColor: "inherit",
|
|
323
|
+
...style
|
|
324
|
+
},
|
|
319
325
|
onClick: handleClick,
|
|
320
326
|
...props
|
|
321
327
|
}
|
|
@@ -4450,28 +4456,34 @@ var create_suggestion_config = (prefix_config, on_suggestion_change, on_insert_c
|
|
|
4450
4456
|
render: () => {
|
|
4451
4457
|
return {
|
|
4452
4458
|
onStart: (props) => {
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4459
|
+
queueMicrotask(() => {
|
|
4460
|
+
on_suggestion_change({
|
|
4461
|
+
is_active: true,
|
|
4462
|
+
query: props.query,
|
|
4463
|
+
prefix: prefix_config.char,
|
|
4464
|
+
client_rect: props.clientRect,
|
|
4465
|
+
commands: prefix_config.commands,
|
|
4466
|
+
range: props.range
|
|
4467
|
+
});
|
|
4460
4468
|
});
|
|
4461
4469
|
},
|
|
4462
4470
|
onUpdate: (props) => {
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4471
|
+
queueMicrotask(() => {
|
|
4472
|
+
on_suggestion_change({
|
|
4473
|
+
is_active: true,
|
|
4474
|
+
query: props.query,
|
|
4475
|
+
prefix: prefix_config.char,
|
|
4476
|
+
client_rect: props.clientRect,
|
|
4477
|
+
commands: prefix_config.commands,
|
|
4478
|
+
range: props.range
|
|
4479
|
+
});
|
|
4470
4480
|
});
|
|
4471
4481
|
},
|
|
4472
4482
|
onKeyDown: (props) => {
|
|
4473
4483
|
if (props.event.key === "Escape") {
|
|
4474
|
-
|
|
4484
|
+
queueMicrotask(() => {
|
|
4485
|
+
on_suggestion_change(null);
|
|
4486
|
+
});
|
|
4475
4487
|
return true;
|
|
4476
4488
|
}
|
|
4477
4489
|
if (props.event.key === "ArrowUp" || props.event.key === "ArrowDown" || props.event.key === "Enter") {
|
|
@@ -4480,7 +4492,9 @@ var create_suggestion_config = (prefix_config, on_suggestion_change, on_insert_c
|
|
|
4480
4492
|
return false;
|
|
4481
4493
|
},
|
|
4482
4494
|
onExit: () => {
|
|
4483
|
-
|
|
4495
|
+
queueMicrotask(() => {
|
|
4496
|
+
on_suggestion_change(null);
|
|
4497
|
+
});
|
|
4484
4498
|
}
|
|
4485
4499
|
};
|
|
4486
4500
|
},
|
|
@@ -4633,7 +4647,11 @@ var CommandPopover = ({
|
|
|
4633
4647
|
position: "fixed",
|
|
4634
4648
|
top: position.top,
|
|
4635
4649
|
left: position.left,
|
|
4636
|
-
zIndex: 9999
|
|
4650
|
+
zIndex: 9999,
|
|
4651
|
+
// Fallback background for consuming apps that may use hex CSS variables
|
|
4652
|
+
// (Tailwind's bg-popover generates hsl(var(--popover)) which fails with hex values)
|
|
4653
|
+
backgroundColor: "var(--popover, hsl(0 0% 100%))",
|
|
4654
|
+
color: "var(--popover-foreground, hsl(222.2 84% 4.9%))"
|
|
4637
4655
|
},
|
|
4638
4656
|
children: /* @__PURE__ */ jsxs(Command, { className: "rounded-md", children: [
|
|
4639
4657
|
query && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
|
|
@@ -5797,7 +5815,10 @@ var HazoUiTextarea = ({
|
|
|
5797
5815
|
position: "fixed",
|
|
5798
5816
|
top: edit_context.rect.y,
|
|
5799
5817
|
left: edit_context.rect.x,
|
|
5800
|
-
zIndex: 9999
|
|
5818
|
+
zIndex: 9999,
|
|
5819
|
+
// Fallback background for consuming apps that may use hex CSS variables
|
|
5820
|
+
backgroundColor: "var(--popover, #ffffff)",
|
|
5821
|
+
color: "var(--popover-foreground, #0f172a)"
|
|
5801
5822
|
},
|
|
5802
5823
|
children: /* @__PURE__ */ jsxs("div", { className: "py-1", children: [
|
|
5803
5824
|
/* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: "Change command" }),
|
|
@@ -5811,6 +5832,10 @@ var HazoUiTextarea = ({
|
|
|
5811
5832
|
idx === edit_selected_index && "bg-accent",
|
|
5812
5833
|
cmd.action === edit_context.command.action && "font-medium"
|
|
5813
5834
|
),
|
|
5835
|
+
style: {
|
|
5836
|
+
// Inherit background from parent, use accent color when selected
|
|
5837
|
+
backgroundColor: idx === edit_selected_index ? "var(--accent, #f1f5f9)" : "inherit"
|
|
5838
|
+
},
|
|
5814
5839
|
onClick: () => handle_command_update(cmd),
|
|
5815
5840
|
children: [
|
|
5816
5841
|
cmd.icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
|
|
@@ -5834,6 +5859,10 @@ var HazoUiTextarea = ({
|
|
|
5834
5859
|
"hover:bg-destructive/10",
|
|
5835
5860
|
edit_selected_index === edit_commands.length && "bg-destructive/10"
|
|
5836
5861
|
),
|
|
5862
|
+
style: {
|
|
5863
|
+
// Inherit background from parent, use light destructive color when selected
|
|
5864
|
+
backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
|
|
5865
|
+
},
|
|
5837
5866
|
onClick: handle_command_remove,
|
|
5838
5867
|
children: /* @__PURE__ */ jsx("span", { children: "Remove" })
|
|
5839
5868
|
}
|