@instructure/ui-menu 8.25.1-snapshot.0 → 8.26.0

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.
@@ -19,10 +19,10 @@ export declare const MenuItemLocator: {
19
19
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
20
20
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
21
21
  } & {
22
+ visible: () => boolean;
22
23
  toString: (maxLength?: number | undefined, options?: {
23
24
  highlight: boolean;
24
25
  } | undefined) => string;
25
- visible: () => boolean;
26
26
  getId: () => string;
27
27
  getOwnerWindow: () => (Window & typeof globalThis) | null;
28
28
  getOwnerDocument: () => Document;
@@ -158,10 +158,10 @@ export declare const MenuItemLocator: {
158
158
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
159
159
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
160
160
  } & {
161
+ visible: () => boolean;
161
162
  toString: (maxLength?: number | undefined, options?: {
162
163
  highlight: boolean;
163
164
  } | undefined) => string;
164
- visible: () => boolean;
165
165
  getId: () => string;
166
166
  getOwnerWindow: () => (Window & typeof globalThis) | null;
167
167
  getOwnerDocument: () => Document;
@@ -297,10 +297,10 @@ export declare const MenuItemLocator: {
297
297
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
298
298
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
299
299
  } & {
300
+ visible: () => boolean;
300
301
  toString: (maxLength?: number | undefined, options?: {
301
302
  highlight: boolean;
302
303
  } | undefined) => string;
303
- visible: () => boolean;
304
304
  getId: () => string;
305
305
  getOwnerWindow: () => (Window & typeof globalThis) | null;
306
306
  getOwnerDocument: () => Document;
@@ -436,10 +436,10 @@ export declare const MenuItemLocator: {
436
436
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
437
437
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
438
438
  } & {
439
+ visible: () => boolean;
439
440
  toString: (maxLength?: number | undefined, options?: {
440
441
  highlight: boolean;
441
442
  } | undefined) => string;
442
- visible: () => boolean;
443
443
  getId: () => string;
444
444
  getOwnerWindow: () => (Window & typeof globalThis) | null;
445
445
  getOwnerDocument: () => Document;
@@ -1,6 +1,7 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
2
+ import React, { Component } from 'react';
3
3
  import { jsx } from '@instructure/emotion';
4
+ import { MenuContext } from '../../MenuContext';
4
5
  import type { MenuItemProps, MenuItemState } from './props';
5
6
  /**
6
7
  ---
@@ -12,14 +13,14 @@ id: Menu.Item
12
13
  declare class MenuItem extends Component<MenuItemProps, MenuItemState> {
13
14
  static readonly componentId = "Menu.Item";
14
15
  static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
15
- children: import("react").ReactNode;
16
+ children: React.ReactNode;
16
17
  defaultSelected?: boolean | undefined;
17
18
  selected?: boolean | undefined;
18
19
  onSelect?: import("./props").OnMenuItemSelect | undefined;
19
- onClick?: ((e: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
20
- onKeyDown?: ((e: import("react").KeyboardEvent<Element>) => void) | undefined;
21
- onKeyUp?: ((e: import("react").KeyboardEvent<Element>) => void) | undefined;
22
- onMouseOver?: ((e: import("react").MouseEvent<Element, MouseEvent>, args: MenuItem) => void) | undefined;
20
+ onClick?: ((e: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
21
+ onKeyDown?: ((e: React.KeyboardEvent<Element>) => void) | undefined;
22
+ onKeyUp?: ((e: React.KeyboardEvent<Element>) => void) | undefined;
23
+ onMouseOver?: ((e: React.MouseEvent<Element, MouseEvent>, args: MenuItem) => void) | undefined;
23
24
  controls?: string | undefined;
24
25
  disabled?: boolean | undefined;
25
26
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
@@ -28,14 +29,14 @@ declare class MenuItem extends Component<MenuItemProps, MenuItemState> {
28
29
  href?: string | undefined;
29
30
  }>;
30
31
  static allowedProps: readonly (keyof {
31
- children: import("react").ReactNode;
32
+ children: React.ReactNode;
32
33
  defaultSelected?: boolean | undefined;
33
34
  selected?: boolean | undefined;
34
35
  onSelect?: import("./props").OnMenuItemSelect | undefined;
35
- onClick?: ((e: import("react").MouseEvent<Element, MouseEvent>) => void) | undefined;
36
- onKeyDown?: ((e: import("react").KeyboardEvent<Element>) => void) | undefined;
37
- onKeyUp?: ((e: import("react").KeyboardEvent<Element>) => void) | undefined;
38
- onMouseOver?: ((e: import("react").MouseEvent<Element, MouseEvent>, args: MenuItem) => void) | undefined;
36
+ onClick?: ((e: React.MouseEvent<Element, MouseEvent>) => void) | undefined;
37
+ onKeyDown?: ((e: React.KeyboardEvent<Element>) => void) | undefined;
38
+ onKeyUp?: ((e: React.KeyboardEvent<Element>) => void) | undefined;
39
+ onMouseOver?: ((e: React.MouseEvent<Element, MouseEvent>, args: MenuItem) => void) | undefined;
39
40
  controls?: string | undefined;
40
41
  disabled?: boolean | undefined;
41
42
  as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
@@ -47,7 +48,8 @@ declare class MenuItem extends Component<MenuItemProps, MenuItemState> {
47
48
  readonly type: "button";
48
49
  readonly disabled: false;
49
50
  };
50
- static contextType: import("react").Context<{
51
+ context: React.ContextType<typeof MenuContext>;
52
+ static contextType: React.Context<{
51
53
  registerMenuItem: (_value: MenuItem) => void;
52
54
  removeMenuItem: (_value: MenuItem) => void;
53
55
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItem/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAYjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE3D;;;;;;GAMG;AACH,cAGM,QAAS,SAAQ,SAAS,C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MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;MAGT;IAEF,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,OAAO,WAAW,CAAC,CAAA;IACtD,MAAM,CAAC,WAAW;;;OAAc;gBAEpB,KAAK,EAAE,aAAa;IAYhC,IAAI,KAAK,mBAMR;IAED,OAAO,EAAE,MAAM,CAAA;IACf,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAE9B;IAED,iBAAiB;IASjB,kBAAkB;IAIlB,oBAAoB;IAQpB,WAAW,MAAO,gBAAgB,UAqBjC;IAED,aAAa,MAAO,mBAAmB,UActC;IAED,WAAW,MAAO,mBAAmB,UAapC;IAED,eAAe,UAAW,gBAAgB,UAMzC;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,IAAI,iEAWP;IAED,IAAI,QAAQ,YAIX;IAED,IAAI,OAAO,YAEV;IAED,KAAK;IAKL,aAAa;IAsBb,MAAM;CAkCP;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -13,10 +13,10 @@ export declare const MenuItemGroupLocator: {
13
13
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
14
14
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
15
15
  } & {
16
+ visible: () => boolean;
16
17
  toString: (maxLength?: number | undefined, options?: {
17
18
  highlight: boolean;
18
19
  } | undefined) => string;
19
- visible: () => boolean;
20
20
  getId: () => string;
21
21
  getOwnerWindow: () => (Window & typeof globalThis) | null;
22
22
  getOwnerDocument: () => Document;
@@ -152,10 +152,10 @@ export declare const MenuItemGroupLocator: {
152
152
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
153
153
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
154
154
  } & {
155
+ visible: () => boolean;
155
156
  toString: (maxLength?: number | undefined, options?: {
156
157
  highlight: boolean;
157
158
  } | undefined) => string;
158
- visible: () => boolean;
159
159
  getId: () => string;
160
160
  getOwnerWindow: () => (Window & typeof globalThis) | null;
161
161
  getOwnerDocument: () => Document;
@@ -298,10 +298,10 @@ export declare const MenuItemGroupLocator: {
298
298
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
299
299
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
300
300
  } & {
301
+ visible: () => boolean;
301
302
  toString: (maxLength?: number | undefined, options?: {
302
303
  highlight: boolean;
303
304
  } | undefined) => string;
304
- visible: () => boolean;
305
305
  getId: () => string;
306
306
  getOwnerWindow: () => (Window & typeof globalThis) | null;
307
307
  getOwnerDocument: () => Document;
@@ -437,10 +437,10 @@ export declare const MenuItemGroupLocator: {
437
437
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
438
438
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
439
439
  } & {
440
+ visible: () => boolean;
440
441
  toString: (maxLength?: number | undefined, options?: {
441
442
  highlight: boolean;
442
443
  } | undefined) => string;
443
- visible: () => boolean;
444
444
  getId: () => string;
445
445
  getOwnerWindow: () => (Window & typeof globalThis) | null;
446
446
  getOwnerDocument: () => Document;
@@ -576,10 +576,10 @@ export declare const MenuItemGroupLocator: {
576
576
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
577
577
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
578
578
  } & {
579
+ visible: () => boolean;
579
580
  toString: (maxLength?: number | undefined, options?: {
580
581
  highlight: boolean;
581
582
  } | undefined) => string;
582
- visible: () => boolean;
583
583
  getId: () => string;
584
584
  getOwnerWindow: () => (Window & typeof globalThis) | null;
585
585
  getOwnerDocument: () => Document;
@@ -716,10 +716,10 @@ export declare const MenuItemGroupLocator: {
716
716
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
717
717
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
718
718
  } & {
719
+ visible: () => boolean;
719
720
  toString: (maxLength?: number | undefined, options?: {
720
721
  highlight: boolean;
721
722
  } | undefined) => string;
722
- visible: () => boolean;
723
723
  getId: () => string;
724
724
  getOwnerWindow: () => (Window & typeof globalThis) | null;
725
725
  getOwnerDocument: () => Document;
@@ -855,10 +855,10 @@ export declare const MenuItemGroupLocator: {
855
855
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
856
856
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
857
857
  } & {
858
+ visible: () => boolean;
858
859
  toString: (maxLength?: number | undefined, options?: {
859
860
  highlight: boolean;
860
861
  } | undefined) => string;
861
- visible: () => boolean;
862
862
  getId: () => string;
863
863
  getOwnerWindow: () => (Window & typeof globalThis) | null;
864
864
  getOwnerDocument: () => Document;
@@ -994,10 +994,10 @@ export declare const MenuItemGroupLocator: {
994
994
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
995
995
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
996
996
  } & {
997
+ visible: () => boolean;
997
998
  toString: (maxLength?: number | undefined, options?: {
998
999
  highlight: boolean;
999
1000
  } | undefined) => string;
1000
- visible: () => boolean;
1001
1001
  getId: () => string;
1002
1002
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1003
1003
  getOwnerDocument: () => Document;
@@ -1134,10 +1134,10 @@ export declare const MenuItemGroupLocator: {
1134
1134
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1135
1135
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1136
1136
  } & {
1137
+ visible: () => boolean;
1137
1138
  toString: (maxLength?: number | undefined, options?: {
1138
1139
  highlight: boolean;
1139
1140
  } | undefined) => string;
1140
- visible: () => boolean;
1141
1141
  getId: () => string;
1142
1142
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1143
1143
  getOwnerDocument: () => Document;
@@ -1273,10 +1273,10 @@ export declare const MenuItemGroupLocator: {
1273
1273
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1274
1274
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1275
1275
  } & {
1276
+ visible: () => boolean;
1276
1277
  toString: (maxLength?: number | undefined, options?: {
1277
1278
  highlight: boolean;
1278
1279
  } | undefined) => string;
1279
- visible: () => boolean;
1280
1280
  getId: () => string;
1281
1281
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1282
1282
  getOwnerDocument: () => Document;
@@ -1412,10 +1412,10 @@ export declare const MenuItemGroupLocator: {
1412
1412
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1413
1413
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1414
1414
  } & {
1415
+ visible: () => boolean;
1415
1416
  toString: (maxLength?: number | undefined, options?: {
1416
1417
  highlight: boolean;
1417
1418
  } | undefined) => string;
1418
- visible: () => boolean;
1419
1419
  getId: () => string;
1420
1420
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1421
1421
  getOwnerDocument: () => Document;
@@ -1552,10 +1552,10 @@ export declare const MenuItemGroupLocator: {
1552
1552
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1553
1553
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1554
1554
  } & {
1555
+ visible: () => boolean;
1555
1556
  toString: (maxLength?: number | undefined, options?: {
1556
1557
  highlight: boolean;
1557
1558
  } | undefined) => string;
1558
- visible: () => boolean;
1559
1559
  getId: () => string;
1560
1560
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1561
1561
  getOwnerDocument: () => Document;
@@ -1691,10 +1691,10 @@ export declare const MenuItemGroupLocator: {
1691
1691
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1692
1692
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1693
1693
  } & {
1694
+ visible: () => boolean;
1694
1695
  toString: (maxLength?: number | undefined, options?: {
1695
1696
  highlight: boolean;
1696
1697
  } | undefined) => string;
1697
- visible: () => boolean;
1698
1698
  getId: () => string;
1699
1699
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1700
1700
  getOwnerDocument: () => Document;
@@ -1830,10 +1830,10 @@ export declare const MenuItemGroupLocator: {
1830
1830
  findParent: typeof import("@instructure/ui-test-queries/src/utils/queries").findParent;
1831
1831
  findParents: typeof import("@instructure/ui-test-queries/src/utils/queries").findParents;
1832
1832
  } & {
1833
+ visible: () => boolean;
1833
1834
  toString: (maxLength?: number | undefined, options?: {
1834
1835
  highlight: boolean;
1835
1836
  } | undefined) => string;
1836
- visible: () => boolean;
1837
1837
  getId: () => string;
1838
1838
  getOwnerWindow: () => (Window & typeof globalThis) | null;
1839
1839
  getOwnerDocument: () => Document;