@iris-ui-kit/vue 0.2.3 → 0.2.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/admin.cjs CHANGED
@@ -396,7 +396,7 @@ var IrisNavMenu = vue.defineComponent({
396
396
  };
397
397
  const hovered = vue.ref(null);
398
398
  const itemStyle = (opts) => {
399
- const bg = opts.active ? "var(--iris-primary)" : hovered.value && !opts.disabled ? "var(--iris-surface)" : "transparent";
399
+ const bg = opts.active ? "var(--iris-primary)" : opts.hovered && !opts.disabled ? "var(--iris-surface)" : "transparent";
400
400
  return {
401
401
  display: "flex",
402
402
  alignItems: "center",
@@ -457,7 +457,13 @@ var IrisNavMenu = vue.defineComponent({
457
457
  title: node.title,
458
458
  "aria-label": branch ? `${node.title} (section)` : node.title,
459
459
  "aria-current": active && !branch ? "page" : void 0,
460
- style: itemStyle({ depth: 0, active, trail: false, disabled: !!node.disabled }),
460
+ style: itemStyle({
461
+ depth: 0,
462
+ active,
463
+ trail: false,
464
+ hovered: hovered.value === node.key,
465
+ disabled: !!node.disabled
466
+ }),
461
467
  ...hoverHandlers(node.key),
462
468
  onClick: () => select(branch ? core.firstLeaf(node) : node)
463
469
  },
@@ -468,7 +474,7 @@ var IrisNavMenu = vue.defineComponent({
468
474
  const branch = core.isBranch(node);
469
475
  const open = expanded.value.includes(node.key);
470
476
  const active = node.key === props.activeKey;
471
- const trail = branch && activePath.value.includes(node.key);
477
+ const trail = branch && !active && activePath.value.includes(node.key);
472
478
  const row = vue.h(
473
479
  "button",
474
480
  {
@@ -477,12 +483,19 @@ var IrisNavMenu = vue.defineComponent({
477
483
  "data-key": node.key,
478
484
  "data-branch": branch ? "true" : void 0,
479
485
  "data-active": active ? "true" : void 0,
486
+ "data-active-trail": trail ? "true" : void 0,
480
487
  "data-open": branch && open ? "true" : void 0,
481
488
  "data-depth": String(depth),
482
489
  disabled: node.disabled,
483
490
  "aria-expanded": branch ? open ? "true" : "false" : void 0,
484
491
  "aria-current": active ? "page" : void 0,
485
- style: itemStyle({ depth, active, trail, disabled: !!node.disabled }),
492
+ style: itemStyle({
493
+ depth,
494
+ active,
495
+ trail,
496
+ hovered: hovered.value === node.key,
497
+ disabled: !!node.disabled
498
+ }),
486
499
  ...hoverHandlers(node.key),
487
500
  onClick: () => branch ? toggle(node.key) : select(node)
488
501
  },