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 +28 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +28 -6
- package/dist/index.js.map +1 -1
- package/dist/styles.css +65 -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, selected, style, ...props }, ref) => {
|
|
306
306
|
const handleClick = () => {
|
|
307
307
|
if (onSelect && value) {
|
|
308
308
|
onSelect(value);
|
|
@@ -313,9 +313,18 @@ 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",
|
|
318
|
+
// When selected, apply accent background and ensure all text is visible
|
|
319
|
+
selected && "bg-accent text-accent-foreground [&_.text-muted-foreground]:text-accent-foreground/70",
|
|
317
320
|
className
|
|
318
321
|
),
|
|
322
|
+
style: selected ? {
|
|
323
|
+
// Explicit inline styles as fallback for consumers with non-HSL CSS variables
|
|
324
|
+
backgroundColor: "var(--accent, #f1f5f9)",
|
|
325
|
+
color: "var(--accent-foreground, #0f172a)",
|
|
326
|
+
...style
|
|
327
|
+
} : style,
|
|
319
328
|
onClick: handleClick,
|
|
320
329
|
...props
|
|
321
330
|
}
|
|
@@ -4641,7 +4650,11 @@ var CommandPopover = ({
|
|
|
4641
4650
|
position: "fixed",
|
|
4642
4651
|
top: position.top,
|
|
4643
4652
|
left: position.left,
|
|
4644
|
-
zIndex: 9999
|
|
4653
|
+
zIndex: 9999,
|
|
4654
|
+
// Fallback background for consuming apps that may use hex CSS variables
|
|
4655
|
+
// (Tailwind's bg-popover generates hsl(var(--popover)) which fails with hex values)
|
|
4656
|
+
backgroundColor: "var(--popover, hsl(0 0% 100%))",
|
|
4657
|
+
color: "var(--popover-foreground, hsl(222.2 84% 4.9%))"
|
|
4645
4658
|
},
|
|
4646
4659
|
children: /* @__PURE__ */ jsxs(Command, { className: "rounded-md", children: [
|
|
4647
4660
|
query && /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: [
|
|
@@ -4671,9 +4684,7 @@ var CommandPopover = ({
|
|
|
4671
4684
|
{
|
|
4672
4685
|
value: cmd.action,
|
|
4673
4686
|
onSelect: () => on_select(cmd),
|
|
4674
|
-
|
|
4675
|
-
flat_idx === selected_index && "bg-accent"
|
|
4676
|
-
),
|
|
4687
|
+
selected: flat_idx === selected_index,
|
|
4677
4688
|
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 w-full", children: [
|
|
4678
4689
|
cmd.icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
|
|
4679
4690
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -5805,7 +5816,10 @@ var HazoUiTextarea = ({
|
|
|
5805
5816
|
position: "fixed",
|
|
5806
5817
|
top: edit_context.rect.y,
|
|
5807
5818
|
left: edit_context.rect.x,
|
|
5808
|
-
zIndex: 9999
|
|
5819
|
+
zIndex: 9999,
|
|
5820
|
+
// Fallback background for consuming apps that may use hex CSS variables
|
|
5821
|
+
backgroundColor: "var(--popover, #ffffff)",
|
|
5822
|
+
color: "var(--popover-foreground, #0f172a)"
|
|
5809
5823
|
},
|
|
5810
5824
|
children: /* @__PURE__ */ jsxs("div", { className: "py-1", children: [
|
|
5811
5825
|
/* @__PURE__ */ jsx("div", { className: "px-3 py-2 text-xs text-muted-foreground border-b", children: "Change command" }),
|
|
@@ -5819,6 +5833,10 @@ var HazoUiTextarea = ({
|
|
|
5819
5833
|
idx === edit_selected_index && "bg-accent",
|
|
5820
5834
|
cmd.action === edit_context.command.action && "font-medium"
|
|
5821
5835
|
),
|
|
5836
|
+
style: {
|
|
5837
|
+
// Inherit background from parent, use accent color when selected
|
|
5838
|
+
backgroundColor: idx === edit_selected_index ? "var(--accent, #f1f5f9)" : "inherit"
|
|
5839
|
+
},
|
|
5822
5840
|
onClick: () => handle_command_update(cmd),
|
|
5823
5841
|
children: [
|
|
5824
5842
|
cmd.icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: cmd.icon }),
|
|
@@ -5842,6 +5860,10 @@ var HazoUiTextarea = ({
|
|
|
5842
5860
|
"hover:bg-destructive/10",
|
|
5843
5861
|
edit_selected_index === edit_commands.length && "bg-destructive/10"
|
|
5844
5862
|
),
|
|
5863
|
+
style: {
|
|
5864
|
+
// Inherit background from parent, use light destructive color when selected
|
|
5865
|
+
backgroundColor: edit_selected_index === edit_commands.length ? "rgba(239, 68, 68, 0.1)" : "inherit"
|
|
5866
|
+
},
|
|
5845
5867
|
onClick: handle_command_remove,
|
|
5846
5868
|
children: /* @__PURE__ */ jsx("span", { children: "Remove" })
|
|
5847
5869
|
}
|