@dmsi/wedgekit-react 0.0.501 → 0.0.503

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.
Files changed (57) hide show
  1. package/dist/{chunk-LJWQEZUS.js → chunk-C2YTC2CN.js} +2 -2
  2. package/dist/{chunk-CHUKGR7S.js → chunk-F6RZ7MUE.js} +1 -1
  3. package/dist/{chunk-KOU2TO3N.js → chunk-LKKFQLWD.js} +16 -6
  4. package/dist/components/CalendarRange.cjs +15 -5
  5. package/dist/components/CalendarRange.css +25 -5
  6. package/dist/components/CalendarRange.js +3 -3
  7. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +15 -5
  8. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +25 -5
  9. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +3 -3
  10. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +15 -5
  11. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +25 -5
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +3 -3
  13. package/dist/components/DataGrid/PinnedColumns.cjs +15 -5
  14. package/dist/components/DataGrid/PinnedColumns.css +25 -5
  15. package/dist/components/DataGrid/PinnedColumns.js +3 -3
  16. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +15 -5
  17. package/dist/components/DataGrid/TableBody/LoadingCell.css +25 -5
  18. package/dist/components/DataGrid/TableBody/LoadingCell.js +3 -3
  19. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +15 -5
  20. package/dist/components/DataGrid/TableBody/TableBodyRow.css +25 -5
  21. package/dist/components/DataGrid/TableBody/TableBodyRow.js +3 -3
  22. package/dist/components/DataGrid/TableBody/index.cjs +15 -5
  23. package/dist/components/DataGrid/TableBody/index.css +25 -5
  24. package/dist/components/DataGrid/TableBody/index.js +3 -3
  25. package/dist/components/DataGrid/index.cjs +15 -5
  26. package/dist/components/DataGrid/index.css +25 -5
  27. package/dist/components/DataGrid/index.js +3 -3
  28. package/dist/components/DataGrid/utils.cjs +15 -5
  29. package/dist/components/DataGrid/utils.css +25 -5
  30. package/dist/components/DataGrid/utils.js +3 -3
  31. package/dist/components/DataGridCell.cjs +15 -5
  32. package/dist/components/DataGridCell.js +2 -2
  33. package/dist/components/DateInput.cjs +15 -5
  34. package/dist/components/DateInput.css +25 -5
  35. package/dist/components/DateInput.js +3 -3
  36. package/dist/components/DateRangeInput.cjs +15 -5
  37. package/dist/components/DateRangeInput.css +25 -5
  38. package/dist/components/DateRangeInput.js +3 -3
  39. package/dist/components/MenuOption.cjs +15 -5
  40. package/dist/components/MenuOption.js +1 -1
  41. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +15 -5
  42. package/dist/components/MobileDataGrid/ColumnSelector/index.css +25 -5
  43. package/dist/components/MobileDataGrid/ColumnSelector/index.js +3 -3
  44. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +15 -5
  45. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +25 -5
  46. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +3 -3
  47. package/dist/components/MobileDataGrid/index.cjs +15 -5
  48. package/dist/components/MobileDataGrid/index.css +25 -5
  49. package/dist/components/MobileDataGrid/index.js +3 -3
  50. package/dist/components/NestedMenu.cjs +15 -5
  51. package/dist/components/NestedMenu.js +1 -1
  52. package/dist/components/index.cjs +15 -5
  53. package/dist/components/index.css +25 -5
  54. package/dist/components/index.js +3 -3
  55. package/dist/index.css +25 -5
  56. package/package.json +1 -1
  57. package/src/components/MenuOption.tsx +16 -4
@@ -1272,6 +1272,7 @@ var MenuOption = ({
1272
1272
  const actualRef = ref || internalRef;
1273
1273
  const menuId = (0, import_react6.useRef)(`menu-${uniqueId}`);
1274
1274
  const isMobile = useMatchesMobile();
1275
+ const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react6.useState)(false);
1275
1276
  const handleMouseEnter = () => {
1276
1277
  if (subMenu && onSubMenuHover && !disabled) {
1277
1278
  onSubMenuHover(menuId.current, subMenuLevel);
@@ -1281,6 +1282,7 @@ var MenuOption = ({
1281
1282
  if (subMenu && onSubMenuLeave && !disabled) {
1282
1283
  onSubMenuLeave(subMenuLevel);
1283
1284
  }
1285
+ setIsSubMenuHovered(false);
1284
1286
  };
1285
1287
  const handleMouseMove = () => {
1286
1288
  if (subMenu && onMouseMove && !disabled) {
@@ -1291,9 +1293,11 @@ var MenuOption = ({
1291
1293
  if (onSubMenuEnter) {
1292
1294
  onSubMenuEnter();
1293
1295
  }
1296
+ setIsSubMenuHovered(true);
1294
1297
  };
1295
1298
  const additionalAttributes = {
1296
- "data-selected": selected || null
1299
+ "data-selected": selected || null,
1300
+ "data-submenu-hovered": isSubMenuHovered || null
1297
1301
  };
1298
1302
  const svgStyles = (0, import_clsx9.default)(
1299
1303
  "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
@@ -1302,16 +1306,18 @@ var MenuOption = ({
1302
1306
  const normalStyles = variant === "normal" && !disabled && (0, import_clsx9.default)(
1303
1307
  "bg-transparent text-text-primary-normal",
1304
1308
  "hover:bg-background-action-secondary-hover",
1305
- "focus:bg-background-action-secondary-hover",
1309
+ "focus-visible:bg-background-action-secondary-hover",
1306
1310
  "data-selected:bg-background-action-secondary-hover",
1311
+ "data-submenu-hovered:bg-background-action-secondary-hover",
1307
1312
  "active:bg-background-action-secondary-active"
1308
1313
  );
1309
1314
  const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx9.default)("text-text-primary-disabled");
1310
1315
  const actionStyles = variant === "action" && !disabled && (0, import_clsx9.default)(
1311
1316
  "text-action-400 bg-transparent",
1312
1317
  "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
1313
- "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
1318
+ "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
1314
1319
  "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
1320
+ "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
1315
1321
  "active:bg-background-action-secondary-active active:text-text-action-active"
1316
1322
  );
1317
1323
  const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx9.default)("text-text-action-disabled");
@@ -1363,7 +1369,10 @@ var MenuOption = ({
1363
1369
  "div",
1364
1370
  {
1365
1371
  onMouseEnter: handleSubMenuEnter,
1366
- onMouseLeave: handleMouseLeave,
1372
+ onMouseLeave: () => {
1373
+ handleMouseLeave();
1374
+ setIsSubMenuHovered(false);
1375
+ },
1367
1376
  "data-submenu-parent": menuId.current,
1368
1377
  "data-menu-level": subMenuLevel + 1,
1369
1378
  children: subMenu({
@@ -1373,7 +1382,8 @@ var MenuOption = ({
1373
1382
  position: "right",
1374
1383
  subMenuLevel,
1375
1384
  mobileBackMenuOption,
1376
- mobileHide: isMobile && activeMenu !== menuId.current
1385
+ mobileHide: isMobile && activeMenu !== menuId.current,
1386
+ autoFocusOff: true
1377
1387
  })
1378
1388
  }
1379
1389
  )
@@ -3296,11 +3296,6 @@
3296
3296
  color: var(--color-text-action-critical-hover);
3297
3297
  }
3298
3298
  }
3299
- .focus\:text-text-action-hover {
3300
- &:focus {
3301
- color: var(--color-text-action-hover);
3302
- }
3303
- }
3304
3299
  .focus\:text-text-action-primary-hover {
3305
3300
  &:focus {
3306
3301
  color: var(--color-text-action-primary-hover);
@@ -3344,6 +3339,16 @@
3344
3339
  outline-style: none;
3345
3340
  }
3346
3341
  }
3342
+ .focus-visible\:bg-background-action-secondary-hover {
3343
+ &:focus-visible {
3344
+ background-color: var(--color-background-action-secondary-hover);
3345
+ }
3346
+ }
3347
+ .focus-visible\:text-text-action-hover {
3348
+ &:focus-visible {
3349
+ color: var(--color-text-action-hover);
3350
+ }
3351
+ }
3347
3352
  .focus-visible\:ring-2 {
3348
3353
  &:focus-visible {
3349
3354
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -3796,6 +3801,21 @@
3796
3801
  }
3797
3802
  }
3798
3803
  }
3804
+ .data-submenu-hovered\:bg-background-action-secondary-active {
3805
+ &[data-submenu-hovered] {
3806
+ background-color: var(--color-background-action-secondary-active);
3807
+ }
3808
+ }
3809
+ .data-submenu-hovered\:bg-background-action-secondary-hover {
3810
+ &[data-submenu-hovered] {
3811
+ background-color: var(--color-background-action-secondary-hover);
3812
+ }
3813
+ }
3814
+ .data-submenu-hovered\:text-text-action-active {
3815
+ &[data-submenu-hovered] {
3816
+ color: var(--color-text-action-active);
3817
+ }
3818
+ }
3799
3819
  .data-\[focus\]\:outline-1 {
3800
3820
  &[data-focus] {
3801
3821
  outline-style: var(--tw-outline-style);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MobileDataGridHeader
3
- } from "../../chunk-LJWQEZUS.js";
3
+ } from "../../chunk-C2YTC2CN.js";
4
4
  import "../../chunk-M7INAUAJ.js";
5
5
  import "../../chunk-ELXVDRWS.js";
6
6
  import "../../chunk-3UUCDNX3.js";
@@ -39,10 +39,10 @@ import "../../chunk-SUSUNSVZ.js";
39
39
  import "../../chunk-SBRRNFOP.js";
40
40
  import "../../chunk-Y2GK27RX.js";
41
41
  import "../../chunk-QVWYTQKL.js";
42
- import "../../chunk-CHUKGR7S.js";
42
+ import "../../chunk-F6RZ7MUE.js";
43
43
  import "../../chunk-TCMOGTPB.js";
44
44
  import "../../chunk-DVU5XV7L.js";
45
- import "../../chunk-KOU2TO3N.js";
45
+ import "../../chunk-LKKFQLWD.js";
46
46
  import "../../chunk-HK4S6TRH.js";
47
47
  import "../../chunk-KPBG7D3V.js";
48
48
  import "../../chunk-HXGJVYGQ.js";
@@ -1272,6 +1272,7 @@ var MenuOption = ({
1272
1272
  const actualRef = ref || internalRef;
1273
1273
  const menuId = (0, import_react6.useRef)(`menu-${uniqueId}`);
1274
1274
  const isMobile = useMatchesMobile();
1275
+ const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react6.useState)(false);
1275
1276
  const handleMouseEnter = () => {
1276
1277
  if (subMenu && onSubMenuHover && !disabled) {
1277
1278
  onSubMenuHover(menuId.current, subMenuLevel);
@@ -1281,6 +1282,7 @@ var MenuOption = ({
1281
1282
  if (subMenu && onSubMenuLeave && !disabled) {
1282
1283
  onSubMenuLeave(subMenuLevel);
1283
1284
  }
1285
+ setIsSubMenuHovered(false);
1284
1286
  };
1285
1287
  const handleMouseMove = () => {
1286
1288
  if (subMenu && onMouseMove && !disabled) {
@@ -1291,9 +1293,11 @@ var MenuOption = ({
1291
1293
  if (onSubMenuEnter) {
1292
1294
  onSubMenuEnter();
1293
1295
  }
1296
+ setIsSubMenuHovered(true);
1294
1297
  };
1295
1298
  const additionalAttributes = {
1296
- "data-selected": selected || null
1299
+ "data-selected": selected || null,
1300
+ "data-submenu-hovered": isSubMenuHovered || null
1297
1301
  };
1298
1302
  const svgStyles = (0, import_clsx9.default)(
1299
1303
  "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
@@ -1302,16 +1306,18 @@ var MenuOption = ({
1302
1306
  const normalStyles = variant === "normal" && !disabled && (0, import_clsx9.default)(
1303
1307
  "bg-transparent text-text-primary-normal",
1304
1308
  "hover:bg-background-action-secondary-hover",
1305
- "focus:bg-background-action-secondary-hover",
1309
+ "focus-visible:bg-background-action-secondary-hover",
1306
1310
  "data-selected:bg-background-action-secondary-hover",
1311
+ "data-submenu-hovered:bg-background-action-secondary-hover",
1307
1312
  "active:bg-background-action-secondary-active"
1308
1313
  );
1309
1314
  const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx9.default)("text-text-primary-disabled");
1310
1315
  const actionStyles = variant === "action" && !disabled && (0, import_clsx9.default)(
1311
1316
  "text-action-400 bg-transparent",
1312
1317
  "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
1313
- "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
1318
+ "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
1314
1319
  "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
1320
+ "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
1315
1321
  "active:bg-background-action-secondary-active active:text-text-action-active"
1316
1322
  );
1317
1323
  const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx9.default)("text-text-action-disabled");
@@ -1363,7 +1369,10 @@ var MenuOption = ({
1363
1369
  "div",
1364
1370
  {
1365
1371
  onMouseEnter: handleSubMenuEnter,
1366
- onMouseLeave: handleMouseLeave,
1372
+ onMouseLeave: () => {
1373
+ handleMouseLeave();
1374
+ setIsSubMenuHovered(false);
1375
+ },
1367
1376
  "data-submenu-parent": menuId.current,
1368
1377
  "data-menu-level": subMenuLevel + 1,
1369
1378
  children: subMenu({
@@ -1373,7 +1382,8 @@ var MenuOption = ({
1373
1382
  position: "right",
1374
1383
  subMenuLevel,
1375
1384
  mobileBackMenuOption,
1376
- mobileHide: isMobile && activeMenu !== menuId.current
1385
+ mobileHide: isMobile && activeMenu !== menuId.current,
1386
+ autoFocusOff: true
1377
1387
  })
1378
1388
  }
1379
1389
  )
@@ -3296,11 +3296,6 @@
3296
3296
  color: var(--color-text-action-critical-hover);
3297
3297
  }
3298
3298
  }
3299
- .focus\:text-text-action-hover {
3300
- &:focus {
3301
- color: var(--color-text-action-hover);
3302
- }
3303
- }
3304
3299
  .focus\:text-text-action-primary-hover {
3305
3300
  &:focus {
3306
3301
  color: var(--color-text-action-primary-hover);
@@ -3344,6 +3339,16 @@
3344
3339
  outline-style: none;
3345
3340
  }
3346
3341
  }
3342
+ .focus-visible\:bg-background-action-secondary-hover {
3343
+ &:focus-visible {
3344
+ background-color: var(--color-background-action-secondary-hover);
3345
+ }
3346
+ }
3347
+ .focus-visible\:text-text-action-hover {
3348
+ &:focus-visible {
3349
+ color: var(--color-text-action-hover);
3350
+ }
3351
+ }
3347
3352
  .focus-visible\:ring-2 {
3348
3353
  &:focus-visible {
3349
3354
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -3796,6 +3801,21 @@
3796
3801
  }
3797
3802
  }
3798
3803
  }
3804
+ .data-submenu-hovered\:bg-background-action-secondary-active {
3805
+ &[data-submenu-hovered] {
3806
+ background-color: var(--color-background-action-secondary-active);
3807
+ }
3808
+ }
3809
+ .data-submenu-hovered\:bg-background-action-secondary-hover {
3810
+ &[data-submenu-hovered] {
3811
+ background-color: var(--color-background-action-secondary-hover);
3812
+ }
3813
+ }
3814
+ .data-submenu-hovered\:text-text-action-active {
3815
+ &[data-submenu-hovered] {
3816
+ color: var(--color-text-action-active);
3817
+ }
3818
+ }
3799
3819
  .data-\[focus\]\:outline-1 {
3800
3820
  &[data-focus] {
3801
3821
  outline-style: var(--tw-outline-style);
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MobileDataGrid
3
- } from "../../chunk-LJWQEZUS.js";
3
+ } from "../../chunk-C2YTC2CN.js";
4
4
  import "../../chunk-M7INAUAJ.js";
5
5
  import "../../chunk-ELXVDRWS.js";
6
6
  import "../../chunk-3UUCDNX3.js";
@@ -39,10 +39,10 @@ import "../../chunk-SUSUNSVZ.js";
39
39
  import "../../chunk-SBRRNFOP.js";
40
40
  import "../../chunk-Y2GK27RX.js";
41
41
  import "../../chunk-QVWYTQKL.js";
42
- import "../../chunk-CHUKGR7S.js";
42
+ import "../../chunk-F6RZ7MUE.js";
43
43
  import "../../chunk-TCMOGTPB.js";
44
44
  import "../../chunk-DVU5XV7L.js";
45
- import "../../chunk-KOU2TO3N.js";
45
+ import "../../chunk-LKKFQLWD.js";
46
46
  import "../../chunk-HK4S6TRH.js";
47
47
  import "../../chunk-KPBG7D3V.js";
48
48
  import "../../chunk-HXGJVYGQ.js";
@@ -551,6 +551,7 @@ var MenuOption = ({
551
551
  const actualRef = ref || internalRef;
552
552
  const menuId = (0, import_react5.useRef)(`menu-${uniqueId}`);
553
553
  const isMobile = useMatchesMobile();
554
+ const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react5.useState)(false);
554
555
  const handleMouseEnter = () => {
555
556
  if (subMenu && onSubMenuHover && !disabled) {
556
557
  onSubMenuHover(menuId.current, subMenuLevel);
@@ -560,6 +561,7 @@ var MenuOption = ({
560
561
  if (subMenu && onSubMenuLeave && !disabled) {
561
562
  onSubMenuLeave(subMenuLevel);
562
563
  }
564
+ setIsSubMenuHovered(false);
563
565
  };
564
566
  const handleMouseMove = () => {
565
567
  if (subMenu && onMouseMove && !disabled) {
@@ -570,9 +572,11 @@ var MenuOption = ({
570
572
  if (onSubMenuEnter) {
571
573
  onSubMenuEnter();
572
574
  }
575
+ setIsSubMenuHovered(true);
573
576
  };
574
577
  const additionalAttributes = {
575
- "data-selected": selected || null
578
+ "data-selected": selected || null,
579
+ "data-submenu-hovered": isSubMenuHovered || null
576
580
  };
577
581
  const svgStyles = (0, import_clsx6.default)(
578
582
  "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
@@ -581,16 +585,18 @@ var MenuOption = ({
581
585
  const normalStyles = variant === "normal" && !disabled && (0, import_clsx6.default)(
582
586
  "bg-transparent text-text-primary-normal",
583
587
  "hover:bg-background-action-secondary-hover",
584
- "focus:bg-background-action-secondary-hover",
588
+ "focus-visible:bg-background-action-secondary-hover",
585
589
  "data-selected:bg-background-action-secondary-hover",
590
+ "data-submenu-hovered:bg-background-action-secondary-hover",
586
591
  "active:bg-background-action-secondary-active"
587
592
  );
588
593
  const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx6.default)("text-text-primary-disabled");
589
594
  const actionStyles = variant === "action" && !disabled && (0, import_clsx6.default)(
590
595
  "text-action-400 bg-transparent",
591
596
  "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
592
- "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
597
+ "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
593
598
  "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
599
+ "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
594
600
  "active:bg-background-action-secondary-active active:text-text-action-active"
595
601
  );
596
602
  const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx6.default)("text-text-action-disabled");
@@ -642,7 +648,10 @@ var MenuOption = ({
642
648
  "div",
643
649
  {
644
650
  onMouseEnter: handleSubMenuEnter,
645
- onMouseLeave: handleMouseLeave,
651
+ onMouseLeave: () => {
652
+ handleMouseLeave();
653
+ setIsSubMenuHovered(false);
654
+ },
646
655
  "data-submenu-parent": menuId.current,
647
656
  "data-menu-level": subMenuLevel + 1,
648
657
  children: subMenu({
@@ -652,7 +661,8 @@ var MenuOption = ({
652
661
  position: "right",
653
662
  subMenuLevel,
654
663
  mobileBackMenuOption,
655
- mobileHide: isMobile && activeMenu !== menuId.current
664
+ mobileHide: isMobile && activeMenu !== menuId.current,
665
+ autoFocusOff: true
656
666
  })
657
667
  }
658
668
  )
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  MenuOption
4
- } from "../chunk-KOU2TO3N.js";
4
+ } from "../chunk-LKKFQLWD.js";
5
5
  import {
6
6
  Label
7
7
  } from "../chunk-HXGJVYGQ.js";
@@ -877,6 +877,7 @@ var MenuOption = ({
877
877
  const actualRef = ref || internalRef;
878
878
  const menuId = (0, import_react6.useRef)(`menu-${uniqueId}`);
879
879
  const isMobile = useMatchesMobile();
880
+ const [isSubMenuHovered, setIsSubMenuHovered] = (0, import_react6.useState)(false);
880
881
  const handleMouseEnter = () => {
881
882
  if (subMenu && onSubMenuHover && !disabled) {
882
883
  onSubMenuHover(menuId.current, subMenuLevel);
@@ -886,6 +887,7 @@ var MenuOption = ({
886
887
  if (subMenu && onSubMenuLeave && !disabled) {
887
888
  onSubMenuLeave(subMenuLevel);
888
889
  }
890
+ setIsSubMenuHovered(false);
889
891
  };
890
892
  const handleMouseMove = () => {
891
893
  if (subMenu && onMouseMove && !disabled) {
@@ -896,9 +898,11 @@ var MenuOption = ({
896
898
  if (onSubMenuEnter) {
897
899
  onSubMenuEnter();
898
900
  }
901
+ setIsSubMenuHovered(true);
899
902
  };
900
903
  const additionalAttributes = {
901
- "data-selected": selected || null
904
+ "data-selected": selected || null,
905
+ "data-submenu-hovered": isSubMenuHovered || null
902
906
  };
903
907
  const svgStyles = (0, import_clsx6.default)(
904
908
  "[&>svg]:shrink-0 [&>svg]:fill-icon-action-primary-normal"
@@ -907,16 +911,18 @@ var MenuOption = ({
907
911
  const normalStyles = variant === "normal" && !disabled && (0, import_clsx6.default)(
908
912
  "bg-transparent text-text-primary-normal",
909
913
  "hover:bg-background-action-secondary-hover",
910
- "focus:bg-background-action-secondary-hover",
914
+ "focus-visible:bg-background-action-secondary-hover",
911
915
  "data-selected:bg-background-action-secondary-hover",
916
+ "data-submenu-hovered:bg-background-action-secondary-hover",
912
917
  "active:bg-background-action-secondary-active"
913
918
  );
914
919
  const normalDisabledStyles = variant === "normal" && disabled && (0, import_clsx6.default)("text-text-primary-disabled");
915
920
  const actionStyles = variant === "action" && !disabled && (0, import_clsx6.default)(
916
921
  "text-action-400 bg-transparent",
917
922
  "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
918
- "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
923
+ "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
919
924
  "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
925
+ "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
920
926
  "active:bg-background-action-secondary-active active:text-text-action-active"
921
927
  );
922
928
  const actionDisabledStyles = variant === "action" && disabled && (0, import_clsx6.default)("text-text-action-disabled");
@@ -968,7 +974,10 @@ var MenuOption = ({
968
974
  "div",
969
975
  {
970
976
  onMouseEnter: handleSubMenuEnter,
971
- onMouseLeave: handleMouseLeave,
977
+ onMouseLeave: () => {
978
+ handleMouseLeave();
979
+ setIsSubMenuHovered(false);
980
+ },
972
981
  "data-submenu-parent": menuId.current,
973
982
  "data-menu-level": subMenuLevel + 1,
974
983
  children: subMenu({
@@ -978,7 +987,8 @@ var MenuOption = ({
978
987
  position: "right",
979
988
  subMenuLevel,
980
989
  mobileBackMenuOption,
981
- mobileHide: isMobile && activeMenu !== menuId.current
990
+ mobileHide: isMobile && activeMenu !== menuId.current,
991
+ autoFocusOff: true
982
992
  })
983
993
  }
984
994
  )
@@ -3296,11 +3296,6 @@
3296
3296
  color: var(--color-text-action-critical-hover);
3297
3297
  }
3298
3298
  }
3299
- .focus\:text-text-action-hover {
3300
- &:focus {
3301
- color: var(--color-text-action-hover);
3302
- }
3303
- }
3304
3299
  .focus\:text-text-action-primary-hover {
3305
3300
  &:focus {
3306
3301
  color: var(--color-text-action-primary-hover);
@@ -3344,6 +3339,16 @@
3344
3339
  outline-style: none;
3345
3340
  }
3346
3341
  }
3342
+ .focus-visible\:bg-background-action-secondary-hover {
3343
+ &:focus-visible {
3344
+ background-color: var(--color-background-action-secondary-hover);
3345
+ }
3346
+ }
3347
+ .focus-visible\:text-text-action-hover {
3348
+ &:focus-visible {
3349
+ color: var(--color-text-action-hover);
3350
+ }
3351
+ }
3347
3352
  .focus-visible\:ring-2 {
3348
3353
  &:focus-visible {
3349
3354
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -3796,6 +3801,21 @@
3796
3801
  }
3797
3802
  }
3798
3803
  }
3804
+ .data-submenu-hovered\:bg-background-action-secondary-active {
3805
+ &[data-submenu-hovered] {
3806
+ background-color: var(--color-background-action-secondary-active);
3807
+ }
3808
+ }
3809
+ .data-submenu-hovered\:bg-background-action-secondary-hover {
3810
+ &[data-submenu-hovered] {
3811
+ background-color: var(--color-background-action-secondary-hover);
3812
+ }
3813
+ }
3814
+ .data-submenu-hovered\:text-text-action-active {
3815
+ &[data-submenu-hovered] {
3816
+ color: var(--color-text-action-active);
3817
+ }
3818
+ }
3799
3819
  .data-\[focus\]\:outline-1 {
3800
3820
  &[data-focus] {
3801
3821
  outline-style: var(--tw-outline-style);
@@ -2,7 +2,7 @@ import {
2
2
  DataGrid,
3
3
  DateInput,
4
4
  MobileDataGrid
5
- } from "../chunk-LJWQEZUS.js";
5
+ } from "../chunk-C2YTC2CN.js";
6
6
  import "../chunk-M7INAUAJ.js";
7
7
  import "../chunk-ELXVDRWS.js";
8
8
  import "../chunk-3UUCDNX3.js";
@@ -66,14 +66,14 @@ import {
66
66
  DataGridCell,
67
67
  DragAlongCell,
68
68
  DraggableCellHeader
69
- } from "../chunk-CHUKGR7S.js";
69
+ } from "../chunk-F6RZ7MUE.js";
70
70
  import {
71
71
  Menu
72
72
  } from "../chunk-TCMOGTPB.js";
73
73
  import "../chunk-DVU5XV7L.js";
74
74
  import {
75
75
  MenuOption
76
- } from "../chunk-KOU2TO3N.js";
76
+ } from "../chunk-LKKFQLWD.js";
77
77
  import {
78
78
  Search
79
79
  } from "../chunk-HK4S6TRH.js";
package/dist/index.css CHANGED
@@ -3274,11 +3274,6 @@
3274
3274
  color: var(--color-text-action-critical-hover);
3275
3275
  }
3276
3276
  }
3277
- .focus\:text-text-action-hover {
3278
- &:focus {
3279
- color: var(--color-text-action-hover);
3280
- }
3281
- }
3282
3277
  .focus\:text-text-action-primary-hover {
3283
3278
  &:focus {
3284
3279
  color: var(--color-text-action-primary-hover);
@@ -3322,6 +3317,16 @@
3322
3317
  outline-style: none;
3323
3318
  }
3324
3319
  }
3320
+ .focus-visible\:bg-background-action-secondary-hover {
3321
+ &:focus-visible {
3322
+ background-color: var(--color-background-action-secondary-hover);
3323
+ }
3324
+ }
3325
+ .focus-visible\:text-text-action-hover {
3326
+ &:focus-visible {
3327
+ color: var(--color-text-action-hover);
3328
+ }
3329
+ }
3325
3330
  .focus-visible\:ring-2 {
3326
3331
  &:focus-visible {
3327
3332
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -3774,6 +3779,21 @@
3774
3779
  }
3775
3780
  }
3776
3781
  }
3782
+ .data-submenu-hovered\:bg-background-action-secondary-active {
3783
+ &[data-submenu-hovered] {
3784
+ background-color: var(--color-background-action-secondary-active);
3785
+ }
3786
+ }
3787
+ .data-submenu-hovered\:bg-background-action-secondary-hover {
3788
+ &[data-submenu-hovered] {
3789
+ background-color: var(--color-background-action-secondary-hover);
3790
+ }
3791
+ }
3792
+ .data-submenu-hovered\:text-text-action-active {
3793
+ &[data-submenu-hovered] {
3794
+ color: var(--color-text-action-active);
3795
+ }
3796
+ }
3777
3797
  .data-\[focus\]\:outline-1 {
3778
3798
  &[data-focus] {
3779
3799
  outline-style: var(--tw-outline-style);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.501",
4
+ "version": "0.0.503",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import clsx from "clsx";
4
- import { PropsWithChildren, ReactNode, RefObject, useId, useRef } from "react";
4
+ import { PropsWithChildren, ReactNode, RefObject, useId, useRef, useState } from "react";
5
5
  import { baseTransition, componentGap, componentPadding, layoutGroupGap } from "../classNames";
6
6
  import { AsProps } from "../types";
7
7
  import { Label, Tags } from "./Label";
@@ -35,6 +35,7 @@ type BaseProps = PropsWithChildren<{
35
35
  subMenuLevel: number;
36
36
  mobileBackMenuOption?: () => ReactNode;
37
37
  mobileHide?: boolean;
38
+ autoFocusOff?: boolean;
38
39
  }) => ReactNode;
39
40
  subMenuLevel?: number;
40
41
  onSubMenuHover: (menuId: string, level: number) => void;
@@ -110,6 +111,7 @@ export const MenuOption = ({
110
111
  const actualRef = (ref || internalRef) as RefObject<HTMLDivElement>;
111
112
  const menuId = useRef(`menu-${uniqueId}`);
112
113
  const isMobile = useMatchesMobile();
114
+ const [isSubMenuHovered, setIsSubMenuHovered] = useState(false);
113
115
 
114
116
  const handleMouseEnter = () => {
115
117
  if (subMenu && onSubMenuHover && !disabled) {
@@ -121,6 +123,8 @@ export const MenuOption = ({
121
123
  if (subMenu && onSubMenuLeave && !disabled) {
122
124
  onSubMenuLeave(subMenuLevel);
123
125
  }
126
+
127
+ setIsSubMenuHovered(false);
124
128
  };
125
129
 
126
130
  const handleMouseMove = () => {
@@ -133,10 +137,12 @@ export const MenuOption = ({
133
137
  if (onSubMenuEnter) {
134
138
  onSubMenuEnter();
135
139
  }
140
+ setIsSubMenuHovered(true);
136
141
  };
137
142
 
138
143
  const additionalAttributes = {
139
144
  "data-selected": selected || null,
145
+ "data-submenu-hovered": isSubMenuHovered || null,
140
146
  };
141
147
 
142
148
  const svgStyles = clsx(
@@ -151,8 +157,9 @@ export const MenuOption = ({
151
157
  clsx(
152
158
  "bg-transparent text-text-primary-normal",
153
159
  "hover:bg-background-action-secondary-hover",
154
- "focus:bg-background-action-secondary-hover",
160
+ "focus-visible:bg-background-action-secondary-hover",
155
161
  "data-selected:bg-background-action-secondary-hover",
162
+ "data-submenu-hovered:bg-background-action-secondary-hover",
156
163
  "active:bg-background-action-secondary-active",
157
164
  );
158
165
 
@@ -165,8 +172,9 @@ export const MenuOption = ({
165
172
  clsx(
166
173
  "text-action-400 bg-transparent",
167
174
  "hover:bg-background-action-secondary-hover hover:text-text-action-hover",
168
- "focus:bg-background-action-secondary-hover focus:text-text-action-hover",
175
+ "focus-visible:bg-background-action-secondary-hover focus-visible:text-text-action-hover",
169
176
  "data-selected:bg-background-action-secondary-active data-selected:text-text-action-active",
177
+ "data-submenu-hovered:bg-background-action-secondary-active data-submenu-hovered:text-text-action-active",
170
178
  "active:bg-background-action-secondary-active active:text-text-action-active",
171
179
  );
172
180
 
@@ -244,7 +252,10 @@ export const MenuOption = ({
244
252
  {subMenu && (
245
253
  <div
246
254
  onMouseEnter={handleSubMenuEnter}
247
- onMouseLeave={handleMouseLeave}
255
+ onMouseLeave={() => {
256
+ handleMouseLeave();
257
+ setIsSubMenuHovered(false);
258
+ }}
248
259
  data-submenu-parent={menuId.current}
249
260
  data-menu-level={subMenuLevel + 1}
250
261
  >
@@ -256,6 +267,7 @@ export const MenuOption = ({
256
267
  subMenuLevel,
257
268
  mobileBackMenuOption,
258
269
  mobileHide: isMobile && activeMenu !== menuId.current,
270
+ autoFocusOff: true,
259
271
  })}
260
272
  </div>
261
273
  )}