@cypress-design/react-docmenu 0.5.3 → 0.5.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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +6 -0
- package/DocMenuReact.cy.tsx +5 -1
- package/_DocGroup.tsx +7 -1
- package/_DocLink.tsx +14 -4
- package/dist/_DocGroup.d.ts.map +1 -1
- package/dist/_DocLink.d.ts.map +1 -1
- package/dist/index.es.mjs +13 -10
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +13 -10
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -183,10 +183,10 @@ const classes = {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
var DocLink = React__namespace.forwardRef(function (_a, ref) {
|
|
186
|
-
var
|
|
186
|
+
var _b = _a.item, label = _b.label, itemRest = __rest$1(_b, ["label"]), depth = _a.depth, markerIsMoving = _a.markerIsMoving, context = _a.context, onActive = _a.onActive, LinkComponent = _a.LinkComponent;
|
|
187
187
|
var activeLIRef = React__namespace.useRef(null);
|
|
188
188
|
var collapsible = context.collapsible, activePath = context.activePath;
|
|
189
|
-
var active =
|
|
189
|
+
var active = itemRest.href === activePath;
|
|
190
190
|
var setActiveMarkerPosition = function () {
|
|
191
191
|
var _a;
|
|
192
192
|
if (active) {
|
|
@@ -204,20 +204,20 @@ var DocLink = React__namespace.forwardRef(function (_a, ref) {
|
|
|
204
204
|
setActiveMarkerPosition: setActiveMarkerPosition,
|
|
205
205
|
}); });
|
|
206
206
|
return (React__namespace.createElement("li", { ref: activeLIRef, className: "list-none p-0" },
|
|
207
|
-
React__namespace.createElement(LinkComponent, { className: clsx('group relative block w-full pl-[24px]', {
|
|
207
|
+
React__namespace.createElement(LinkComponent, __assign$1({}, itemRest, { className: clsx('group relative block w-full pl-[24px]', {
|
|
208
208
|
'text-indigo-500 dark:text-indigo-400': active,
|
|
209
209
|
'text-gray-700 dark:text-gray-500': !active,
|
|
210
210
|
'py-[8px] text-[16px] leading-[24px]': depth < 0,
|
|
211
211
|
'leading-[20px] text-[14px] py-[12px]': depth >= 0,
|
|
212
|
-
}),
|
|
212
|
+
}), style: {
|
|
213
213
|
paddingLeft: depth >= 0 ? "".concat(depth * 12 + 48, "px") : undefined,
|
|
214
|
-
} },
|
|
214
|
+
} }),
|
|
215
215
|
depth >= 0 ? (React__namespace.createElement("div", { className: clsx('left-[6.5px] absolute top-[4px] bottom-[4px] w-[4px] z-10 rounded-full', {
|
|
216
216
|
hidden: !markerIsMoving || !active,
|
|
217
217
|
'group-hover:block bg-gray-300': !active && collapsible,
|
|
218
218
|
'bg-indigo-500 dark:bg-indigo-400': active && markerIsMoving,
|
|
219
219
|
}) })) : null,
|
|
220
|
-
|
|
220
|
+
label)));
|
|
221
221
|
});
|
|
222
222
|
|
|
223
223
|
var hasActiveItemRecursively = function (items, localActivePath) {
|
|
@@ -307,12 +307,15 @@ var DocGroup = React__namespace.forwardRef(function (_a, ref) {
|
|
|
307
307
|
_b['text-indigo-500 dark:text-indigo-400'] = activePath === group.href,
|
|
308
308
|
_b['text-gray-900 dark:text-gray-100'] = hasActiveItemRecursivelyMemo && activePath !== group.href,
|
|
309
309
|
_b['text-gray-800 dark:text-gray-200'] = !hasActiveItemRecursivelyMemo && activePath !== group.href,
|
|
310
|
-
_b))
|
|
310
|
+
_b)), style: {
|
|
311
|
+
paddingLeft: depth >= 1 ? "".concat((depth - 1) * 12 + 48, "px") : undefined,
|
|
312
|
+
} },
|
|
311
313
|
collapsible ? (React__namespace.createElement(IconChevronDownSmall, { "stroke-color": "gray-400", size: depth ? '8' : '16', className: clsx(classes.expandedIcon, {
|
|
312
314
|
'rotate-0': open,
|
|
313
315
|
'-rotate-90': !open,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
+
}), style: {
|
|
317
|
+
marginLeft: depth >= 1 ? "".concat((depth - 1) * 12 + 28, "px") : undefined,
|
|
318
|
+
} })) : null,
|
|
316
319
|
group.label),
|
|
317
320
|
React__namespace.createElement("div", { className: clsx('relative', collapsible
|
|
318
321
|
? {
|
|
@@ -415,4 +418,4 @@ var DocMenu = function (_a) {
|
|
|
415
418
|
module.exports = DocMenu;
|
|
416
419
|
//# sourceMappingURL=index.umd.js.map
|
|
417
420
|
|
|
418
|
-
/* <wind-keep class="container relative absolute h-[36px] w-[4px] z-50 rounded-full bg-indigo-500 dark:bg-indigo-400 ml-[6.5px] mt-[4px] transition ease-in-out text-indigo-500 dark:text-indigo-400 text-gray-900 dark:text-gray-100 text-gray-800 dark:text-gray-200 rotate-0 -rotate-90
|
|
421
|
+
/* <wind-keep class="container relative absolute h-[36px] w-[4px] z-50 rounded-full bg-indigo-500 dark:bg-indigo-400 ml-[6.5px] mt-[4px] transition ease-in-out text-indigo-500 dark:text-indigo-400 text-gray-900 dark:text-gray-100 text-gray-800 dark:text-gray-200 rotate-0 -rotate-90 transition-all grid grid-rows-[0fr] grid-rows-[1fr] overflow-hidden filter list-none p-0 block w-full pl-[24px] text-gray-700 dark:text-gray-500 py-[8px] text-[16px] leading-[24px] leading-[20px] text-[14px] py-[12px] left-[6.5px] top-[4px] bottom-[4px] z-10 hidden group-hover:block bg-gray-300 text-indigo-400 text-gray-500 bg-indigo-400 left-0 transform transition-transform text-gray-400 dark:text-gray-700 flex py-[10px] items-center text-start font-medium pl-[48px] left-[8px] top-0 w-[1px] h-full bg-gray-100 dark:bg-gray-900"> */
|