@choice-ui/react 1.8.1 → 1.8.3

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.
@@ -239,6 +239,13 @@ const buttonTv = tcv({
239
239
  loading: false,
240
240
  variant: "dark",
241
241
  class: { button: "active:bg-gray-600" }
242
+ },
243
+ {
244
+ disabled: false,
245
+ loading: false,
246
+ variant: "secondary",
247
+ active: false,
248
+ class: { button: "hover:bg-secondary-background" }
242
249
  }
243
250
  ],
244
251
  defaultVariants: {
@@ -2,6 +2,7 @@ import { MenuItemProps } from '../components/menu-item';
2
2
  export interface MenuContextItemProps extends MenuItemProps {
3
3
  customActive?: boolean;
4
4
  exclusiveIndex?: number;
5
+ href?: string;
5
6
  onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
6
7
  onKeyDown?: (e: React.KeyboardEvent<HTMLButtonElement>) => void;
7
8
  onMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
- import { Check } from "@choiceform/icons-react";
2
+ import { Check, Launch } from "@choiceform/icons-react";
3
3
  import { useListItem, useFloatingTree } from "@floating-ui/react";
4
4
  import { memo, forwardRef, useContext, useMemo, startTransition, useCallback } from "react";
5
5
  import { useEventCallback } from "usehooks-ts";
@@ -15,7 +15,9 @@ const MenuContextItem = memo(
15
15
  size,
16
16
  shortcut,
17
17
  prefixElement,
18
+ suffixElement,
18
19
  variant,
20
+ href,
19
21
  onClick,
20
22
  onMouseUp,
21
23
  onTouchStart,
@@ -80,6 +82,13 @@ const MenuContextItem = memo(
80
82
  }),
81
83
  [shortcut == null ? void 0 : shortcut.modifier, shortcut == null ? void 0 : shortcut.keys]
82
84
  );
85
+ const suffixConfig = useMemo(() => {
86
+ if (suffixElement !== void 0) return suffixElement;
87
+ if (href) {
88
+ return /* @__PURE__ */ jsx(Launch, { className: "h-3 w-3" });
89
+ }
90
+ return void 0;
91
+ }, [suffixElement, href]);
83
92
  const combinedRef = useCallback(
84
93
  (node) => {
85
94
  item.ref(node);
@@ -102,6 +111,7 @@ const MenuContextItem = memo(
102
111
  disabled,
103
112
  selected,
104
113
  prefixElement: prefixConfig,
114
+ suffixElement: suffixConfig,
105
115
  shortcut: shortcutConfig,
106
116
  variant,
107
117
  size,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choice-ui/react",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "description": "A desktop-first React UI component library built for professional desktop applications with comprehensive documentation",
5
5
  "sideEffects": false,
6
6
  "type": "module",