opus-toolkit-components 1.7.4 → 1.7.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.
|
@@ -46323,46 +46323,46 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
46323
46323
|
|
|
46324
46324
|
|
|
46325
46325
|
|
|
46326
|
-
/**
|
|
46327
|
-
* Icon props (importing from your Icon component typedef).
|
|
46328
|
-
* @typedef {import('../Icon/Icon').IconProps} IconProps
|
|
46326
|
+
/**
|
|
46327
|
+
* Icon props (importing from your Icon component typedef).
|
|
46328
|
+
* @typedef {import('../Icon/Icon').IconProps} IconProps
|
|
46329
46329
|
*/
|
|
46330
46330
|
|
|
46331
|
-
/**
|
|
46332
|
-
* A sidebar leaf item (no children).
|
|
46333
|
-
* @typedef {Object} SidebarItemMenu
|
|
46334
|
-
* @property {string|number} key
|
|
46335
|
-
* @property {string} name
|
|
46336
|
-
* @property {string} [path]
|
|
46337
|
-
* @property {string} [href]
|
|
46338
|
-
* @property {IconProps} [iconProps]
|
|
46331
|
+
/**
|
|
46332
|
+
* A sidebar leaf item (no children).
|
|
46333
|
+
* @typedef {Object} SidebarItemMenu
|
|
46334
|
+
* @property {string|number} key
|
|
46335
|
+
* @property {string} name
|
|
46336
|
+
* @property {string} [path]
|
|
46337
|
+
* @property {string} [href]
|
|
46338
|
+
* @property {IconProps} [iconProps]
|
|
46339
46339
|
*/
|
|
46340
46340
|
|
|
46341
|
-
/**
|
|
46342
|
-
* Props for SidebarItem.
|
|
46343
|
-
*
|
|
46344
|
-
* @typedef {Object} SidebarItemProps
|
|
46345
|
-
*
|
|
46346
|
-
* @property {SidebarItemMenu} menu
|
|
46347
|
-
* The menu item to render.
|
|
46348
|
-
*
|
|
46349
|
-
* @property {boolean} open
|
|
46350
|
-
* Whether the sidebar is expanded.
|
|
46351
|
-
*
|
|
46352
|
-
* @property {boolean} [active=false]
|
|
46353
|
-
* Whether this item is currently active.
|
|
46354
|
-
*
|
|
46355
|
-
* @property {keyof JSX.IntrinsicElements | React.ComponentType<any>} [as='div']
|
|
46356
|
-
* Polymorphic wrapper: div, a, button, Link, etc.
|
|
46357
|
-
*
|
|
46358
|
-
* @property {() => void} [onClick]
|
|
46359
|
-
* Fired when the item is clicked.
|
|
46341
|
+
/**
|
|
46342
|
+
* Props for SidebarItem.
|
|
46343
|
+
*
|
|
46344
|
+
* @typedef {Object} SidebarItemProps
|
|
46345
|
+
*
|
|
46346
|
+
* @property {SidebarItemMenu} menu
|
|
46347
|
+
* The menu item to render.
|
|
46348
|
+
*
|
|
46349
|
+
* @property {boolean} open
|
|
46350
|
+
* Whether the sidebar is expanded.
|
|
46351
|
+
*
|
|
46352
|
+
* @property {boolean} [active=false]
|
|
46353
|
+
* Whether this item is currently active.
|
|
46354
|
+
*
|
|
46355
|
+
* @property {keyof JSX.IntrinsicElements | React.ComponentType<any>} [as='div']
|
|
46356
|
+
* Polymorphic wrapper: div, a, button, Link, etc.
|
|
46357
|
+
*
|
|
46358
|
+
* @property {() => void} [onClick]
|
|
46359
|
+
* Fired when the item is clicked.
|
|
46360
46360
|
*/
|
|
46361
46361
|
|
|
46362
|
-
/**
|
|
46363
|
-
* Fully typed SidebarItem component.
|
|
46364
|
-
*
|
|
46365
|
-
* @param {SidebarItemProps & React.HTMLAttributes<HTMLElement>} props
|
|
46362
|
+
/**
|
|
46363
|
+
* Fully typed SidebarItem component.
|
|
46364
|
+
*
|
|
46365
|
+
* @param {SidebarItemProps & React.HTMLAttributes<HTMLElement>} props
|
|
46366
46366
|
*/
|
|
46367
46367
|
|
|
46368
46368
|
function SidebarItem(_ref) {
|
|
@@ -46370,12 +46370,22 @@ function SidebarItem(_ref) {
|
|
|
46370
46370
|
menu,
|
|
46371
46371
|
open,
|
|
46372
46372
|
active = false,
|
|
46373
|
-
as: Component = "
|
|
46373
|
+
as: Component = "a",
|
|
46374
46374
|
onClick
|
|
46375
46375
|
} = _ref,
|
|
46376
46376
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
46377
|
-
|
|
46378
|
-
|
|
46377
|
+
// Support both "href" and "path"
|
|
46378
|
+
const navTarget = menu.href || menu.path;
|
|
46379
|
+
const wrapperProps = {};
|
|
46380
|
+
if (Component === "a" && navTarget) {
|
|
46381
|
+
wrapperProps.href = navTarget;
|
|
46382
|
+
}
|
|
46383
|
+
if ((Component === null || Component === void 0 ? void 0 : Component.displayName) === "Link" && navTarget) {
|
|
46384
|
+
wrapperProps.to = navTarget;
|
|
46385
|
+
}
|
|
46386
|
+
return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(Component, _objectSpread(_objectSpread(_objectSpread({
|
|
46387
|
+
onClick: onClick
|
|
46388
|
+
}, wrapperProps), {}, {
|
|
46379
46389
|
className: "group relative flex cursor-pointer items-center justify-between p-4 transition-all duration-500 ease-in-out ".concat(active ? "bg-[--color-primary-hover]" : "", " ")
|
|
46380
46390
|
}, props), {}, {
|
|
46381
46391
|
children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
|