@instructure/ui-menu 8.8.1-snapshot.3 → 8.8.1-snapshot.63

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 (61) hide show
  1. package/es/Menu/MenuItem/index.js +14 -60
  2. package/es/Menu/MenuItem/props.js +67 -0
  3. package/es/Menu/MenuItemGroup/index.js +10 -57
  4. package/es/Menu/MenuItemGroup/props.js +71 -0
  5. package/es/Menu/MenuItemSeparator/index.js +5 -8
  6. package/{src/Menu/MenuItemSeparator/types.ts → es/Menu/MenuItemSeparator/props.js} +5 -5
  7. package/es/Menu/index.js +5 -151
  8. package/es/Menu/props.js +167 -0
  9. package/lib/Menu/MenuItem/index.js +15 -62
  10. package/lib/Menu/MenuItem/props.js +79 -0
  11. package/lib/Menu/MenuItemGroup/index.js +11 -62
  12. package/lib/Menu/MenuItemGroup/props.js +87 -0
  13. package/lib/Menu/MenuItemSeparator/index.js +6 -9
  14. package/{src/Menu/MenuItemGroup/types.ts → lib/Menu/MenuItemSeparator/props.js} +13 -16
  15. package/lib/Menu/index.js +6 -156
  16. package/lib/Menu/props.js +182 -0
  17. package/package.json +21 -21
  18. package/src/Menu/MenuItem/index.tsx +14 -56
  19. package/src/Menu/MenuItem/props.ts +109 -0
  20. package/src/Menu/MenuItem/styles.ts +1 -1
  21. package/src/Menu/MenuItemGroup/index.tsx +9 -56
  22. package/src/Menu/MenuItemGroup/props.ts +110 -0
  23. package/src/Menu/MenuItemSeparator/index.tsx +6 -9
  24. package/src/Menu/{MenuItem/types.ts → MenuItemSeparator/props.ts} +19 -19
  25. package/src/Menu/index.tsx +6 -139
  26. package/src/Menu/props.ts +235 -0
  27. package/src/index.ts +4 -4
  28. package/types/Menu/MenuItem/index.d.ts +37 -45
  29. package/types/Menu/MenuItem/index.d.ts.map +1 -1
  30. package/types/Menu/MenuItem/props.d.ts +27 -0
  31. package/types/Menu/MenuItem/props.d.ts.map +1 -0
  32. package/types/Menu/MenuItem/styles.d.ts +1 -1
  33. package/types/Menu/MenuItemGroup/index.d.ts +29 -46
  34. package/types/Menu/MenuItemGroup/index.d.ts.map +1 -1
  35. package/types/Menu/MenuItemGroup/props.d.ts +25 -0
  36. package/types/Menu/MenuItemGroup/props.d.ts.map +1 -0
  37. package/types/Menu/MenuItemSeparator/index.d.ts +3 -6
  38. package/types/Menu/MenuItemSeparator/index.d.ts.map +1 -1
  39. package/types/Menu/MenuItemSeparator/props.d.ts +11 -0
  40. package/types/Menu/MenuItemSeparator/props.d.ts.map +1 -0
  41. package/types/Menu/index.d.ts +60 -122
  42. package/types/Menu/index.d.ts.map +1 -1
  43. package/types/Menu/{types.d.ts → props.d.ts} +12 -4
  44. package/types/Menu/props.d.ts.map +1 -0
  45. package/types/index.d.ts +4 -4
  46. package/es/Menu/MenuItem/types.js +0 -1
  47. package/es/Menu/MenuItemGroup/types.js +0 -1
  48. package/es/Menu/MenuItemSeparator/types.js +0 -1
  49. package/es/Menu/types.js +0 -1
  50. package/lib/Menu/MenuItem/types.js +0 -1
  51. package/lib/Menu/MenuItemGroup/types.js +0 -1
  52. package/lib/Menu/MenuItemSeparator/types.js +0 -1
  53. package/lib/Menu/types.js +0 -1
  54. package/src/Menu/types.ts +0 -63
  55. package/types/Menu/MenuItem/types.d.ts +0 -19
  56. package/types/Menu/MenuItem/types.d.ts.map +0 -1
  57. package/types/Menu/MenuItemGroup/types.d.ts +0 -17
  58. package/types/Menu/MenuItemGroup/types.d.ts.map +0 -1
  59. package/types/Menu/MenuItemSeparator/types.d.ts +0 -5
  60. package/types/Menu/MenuItemSeparator/types.d.ts.map +0 -1
  61. package/types/Menu/types.d.ts.map +0 -1
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@
23
23
  */
24
24
  export { Menu, MenuItem, MenuItemGroup, MenuItemSeparator } from './Menu'
25
25
 
26
- export type { MenuProps } from './Menu/types'
27
- export type { MenuItemProps } from './Menu/MenuItem/types'
28
- export type { MenuGroupProps } from './Menu/MenuItemGroup/types'
29
- export type { MenuSeparatorProps } from './Menu/MenuItemSeparator/types'
26
+ export type { MenuProps } from './Menu/props'
27
+ export type { MenuItemProps } from './Menu/MenuItem/props'
28
+ export type { MenuGroupProps } from './Menu/MenuItemGroup/props'
29
+ export type { MenuSeparatorProps } from './Menu/MenuItemSeparator/props'
@@ -1,8 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { jsx } from '@instructure/emotion';
5
- import { MenuItemProps } from './types';
4
+ import type { MenuItemProps } from './props';
6
5
  /**
7
6
  ---
8
7
  parent: Menu
@@ -11,49 +10,42 @@ id: Menu.Item
11
10
  **/
12
11
  declare class MenuItem extends Component<MenuItemProps> {
13
12
  static readonly componentId = "Menu.Item";
14
- static propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- children: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
18
- defaultSelected: PropTypes.Requireable<boolean>;
19
- /**
20
- * whether the menu item is selected or not (must be accompanied by an `onSelect` prop)
21
- */
22
- selected: (props: Record<string, any>, propName: string, componentName: string) => Error | null;
23
- /**
24
- * when used with the `selected` prop, the component will not control its own state
25
- */
26
- onSelect: PropTypes.Requireable<(...args: any[]) => any>;
27
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
28
- onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
29
- onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
30
- onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
31
- /**
32
- * the id of the element that the menu item will act upon
33
- */
34
- controls: PropTypes.Requireable<string>;
35
- disabled: PropTypes.Requireable<boolean>;
36
- /**
37
- * the element type to render as (will default to `<a>` if href is provided)
38
- */
39
- as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
40
- type: PropTypes.Requireable<string>;
41
- value: PropTypes.Requireable<string | number>;
42
- href: PropTypes.Requireable<string>;
43
- };
13
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
14
+ children: import("react").ReactNode;
15
+ defaultSelected?: boolean | undefined;
16
+ selected?: any;
17
+ onSelect?: ((...args: any[]) => any) | undefined;
18
+ onClick?: ((...args: any[]) => any) | undefined;
19
+ onKeyDown?: ((...args: any[]) => any) | undefined;
20
+ onKeyUp?: ((...args: any[]) => any) | undefined;
21
+ onMouseOver?: ((...args: any[]) => any) | undefined;
22
+ controls?: string | undefined;
23
+ disabled?: boolean | undefined;
24
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
25
+ type?: "button" | "checkbox" | "radio" | "flyout" | undefined;
26
+ value?: string | number | undefined;
27
+ href?: string | undefined;
28
+ }>;
29
+ static allowedProps: readonly (keyof {
30
+ children: import("react").ReactNode;
31
+ defaultSelected?: boolean | undefined;
32
+ selected?: any;
33
+ onSelect?: ((...args: any[]) => any) | undefined;
34
+ onClick?: ((...args: any[]) => any) | undefined;
35
+ onKeyDown?: ((...args: any[]) => any) | undefined;
36
+ onKeyUp?: ((...args: any[]) => any) | undefined;
37
+ onMouseOver?: ((...args: any[]) => any) | undefined;
38
+ controls?: string | undefined;
39
+ disabled?: boolean | undefined;
40
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
41
+ type?: "button" | "checkbox" | "radio" | "flyout" | undefined;
42
+ value?: string | number | undefined;
43
+ href?: string | undefined;
44
+ })[];
44
45
  static defaultProps: {
45
- type: string;
46
- disabled: boolean;
47
- onSelect: (e: any, value: any, selected: any, item: any) => void;
48
- defaultSelected: undefined;
49
- selected: undefined;
50
- onClick: undefined;
51
- onKeyDown: undefined;
52
- onKeyUp: undefined;
53
- onMouseOver: undefined;
54
- controls: undefined;
55
- value: undefined;
56
- href: undefined;
46
+ readonly type: "button";
47
+ readonly disabled: false;
48
+ readonly onSelect: (e: any, value: any, selected: any, item: any) => void;
57
49
  };
58
50
  static contextType: import("react").Context<{
59
51
  registerMenuItem: () => void;
@@ -67,7 +59,7 @@ declare class MenuItem extends Component<MenuItemProps> {
67
59
  handleKeyDown: (e: any) => void;
68
60
  handleKeyUp: (e: any) => void;
69
61
  handleMouseOver: (event: any) => void;
70
- get elementType(): any;
62
+ get elementType(): import("@instructure/shared-types/types/CommonProps").AsElementType;
71
63
  get role(): "button" | "menuitemcheckbox" | "menuitemradio" | "menuitem";
72
64
  get selected(): any;
73
65
  get focused(): boolean;
@@ -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;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAUlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEvC;;;;;GAKG;AACH,cAEM,QAAS,SAAQ,SAAS,CAAC,aAAa,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,SAAS;;;;;QASd;;WAEG;;QAEH;;WAEG;;;;;;QAMH;;WAEG;;;QAGH;;WAEG;;;;;MAKJ;IAED,MAAM,CAAC,YAAY;;;;;;;;;;;;;MAclB;IAED,MAAM,CAAC,WAAW;;;OAAc;gBAGpB,KAAK,KAAA;IAcjB,iBAAiB;IAUjB,kBAAkB;IAKlB,oBAAoB;IASpB,WAAW,mBAqBV;IAGD,aAAa,mBAcZ;IAGD,WAAW,mBAaV;IAGD,eAAe,uBAMd;IAED,IAAI,WAAW,QAEd;IAED,IAAI,IAAI,iEAWP;IAED,IAAI,QAAQ,QAKX;IAED,IAAI,OAAO,YAGV;IAED,KAAK;IAKL,aAAa;IAuBb,MAAM;CAsCP;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
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;AASjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;GAKG;AACH,cAEM,QAAS,SAAQ,SAAS,CAAC,aAAa,CAAC;IAC7C,MAAM,CAAC,QAAQ,CAAC,WAAW,eAAc;IAEzC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;MAKT;IAEV,MAAM,CAAC,WAAW;;;OAAc;gBAGpB,KAAK,KAAA;IAcjB,iBAAiB;IAUjB,kBAAkB;IAKlB,oBAAoB;IASpB,WAAW,mBAqBV;IAGD,aAAa,mBAcZ;IAGD,WAAW,mBAaV;IAGD,eAAe,uBAMd;IAED,IAAI,WAAW,wEAEd;IAED,IAAI,IAAI,iEAWP;IAED,IAAI,QAAQ,QAKX;IAED,IAAI,OAAO,YAGV;IAED,KAAK;IAKL,aAAa;IAuBb,MAAM;CAsCP;AAED,eAAe,QAAQ,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,CAAA"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { AsElementType, PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type MenuItemOwnProps = {
5
+ children: React.ReactNode;
6
+ defaultSelected?: boolean;
7
+ selected?: any;
8
+ onSelect?: (...args: any[]) => any;
9
+ onClick?: (...args: any[]) => any;
10
+ onKeyDown?: (...args: any[]) => any;
11
+ onKeyUp?: (...args: any[]) => any;
12
+ onMouseOver?: (...args: any[]) => any;
13
+ controls?: string;
14
+ disabled?: boolean;
15
+ as?: AsElementType;
16
+ type?: 'button' | 'checkbox' | 'radio' | 'flyout';
17
+ value?: string | number;
18
+ href?: string;
19
+ };
20
+ declare type PropKeys = keyof MenuItemOwnProps;
21
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
22
+ declare type MenuItemProps = MenuItemOwnProps & WithStyleProps;
23
+ declare const propTypes: PropValidators<PropKeys>;
24
+ declare const allowedProps: AllowedPropKeys;
25
+ export type { MenuItemProps };
26
+ export { propTypes, allowedProps };
27
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItem/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,gBAAgB,GAAG;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACnC,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACrC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;IACjD,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,gBAAgB,CAAA;AAEtC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,aAAa,GAAG,gBAAgB,GAAG,cAAc,CAAA;AAEtD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAiCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAenB,CAAA;AAED,YAAY,EAAE,aAAa,EAAE,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { MenuItemTheme } from '@instructure/shared-types';
2
- import { MenuItemProps } from './types';
2
+ import { MenuItemProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -1,8 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { jsx } from '@instructure/emotion';
5
- import { MenuGroupProps } from './types';
4
+ import type { MenuGroupProps } from './props';
6
5
  /**
7
6
  ---
8
7
  parent: Menu
@@ -11,52 +10,36 @@ id: Menu.Group
11
10
  **/
12
11
  declare class MenuItemGroup extends Component<MenuGroupProps> {
13
12
  static readonly componentId = "Menu.Group";
14
- static propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- label: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
18
- allowMultiple: PropTypes.Requireable<boolean>;
19
- /**
20
- * children of type `Menu.Item`, `Menu.Separator`
21
- */
22
- children: {
23
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
24
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
25
- };
26
- /**
27
- * an array of the values (or indices by default) for the selected items
28
- */
29
- selected: (props: Record<string, any>, propName: string, componentName: string) => Error | null;
30
- /**
31
- * an array of the values (or indices by default) for the selected items on initial render
32
- */
33
- defaultSelected: PropTypes.Requireable<any[]>;
34
- /**
35
- * call this function when a menu item is selected
36
- */
37
- onSelect: PropTypes.Requireable<(...args: any[]) => any>;
38
- onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
39
- onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
40
- /**
41
- * the id of the element that the menu items will act upon
42
- */
43
- controls: PropTypes.Requireable<string>;
44
- /**
45
- * returns a reference to the `MenuItem`
46
- */
47
- itemRef: PropTypes.Requireable<(...args: any[]) => any>;
48
- disabled: PropTypes.Requireable<boolean>;
49
- /**
50
- * should the group appear in the tab order (the first item will have a tabIndex of 0)
51
- */
52
- isTabbable: PropTypes.Requireable<boolean>;
53
- };
13
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
14
+ label: import("react").ReactNode;
15
+ allowMultiple?: boolean | undefined;
16
+ children?: import("react").ReactNode;
17
+ selected?: any;
18
+ defaultSelected?: any[] | undefined;
19
+ onSelect?: ((...args: any[]) => any) | undefined;
20
+ onMouseOver?: ((...args: any[]) => any) | undefined;
21
+ onKeyDown?: ((...args: any[]) => any) | undefined;
22
+ controls?: string | undefined;
23
+ itemRef?: ((...args: any[]) => any) | undefined;
24
+ disabled?: boolean | undefined;
25
+ isTabbable?: boolean | undefined;
26
+ }>;
27
+ static allowedProps: readonly (keyof {
28
+ label: import("react").ReactNode;
29
+ allowMultiple?: boolean | undefined;
30
+ children?: import("react").ReactNode;
31
+ selected?: any;
32
+ defaultSelected?: any[] | undefined;
33
+ onSelect?: ((...args: any[]) => any) | undefined;
34
+ onMouseOver?: ((...args: any[]) => any) | undefined;
35
+ onKeyDown?: ((...args: any[]) => any) | undefined;
36
+ controls?: string | undefined;
37
+ itemRef?: ((...args: any[]) => any) | undefined;
38
+ disabled?: boolean | undefined;
39
+ isTabbable?: boolean | undefined;
40
+ })[];
54
41
  static defaultProps: {
55
- onMouseOver: undefined;
56
42
  disabled: boolean;
57
- controls: undefined;
58
- onKeyDown: undefined;
59
- selected: undefined;
60
43
  children: null;
61
44
  isTabbable: boolean;
62
45
  allowMultiple: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAgB,MAAM,OAAO,CAAA;AACzD,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAmBrD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;GAKG;AACH,cAEM,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;QAOd;;WAEG;;;;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;;QAIH;;WAEG;;QAEH;;WAEG;;;QAGH;;WAEG;;MAEJ;IAED,MAAM,CAAC,YAAY;;;;;;;;;;;;MAclB;gBAGW,KAAK,KAAA;IAcjB,iBAAiB;IAKjB,kBAAkB;IAMlB,YAAY,yDAsBX;IAGD,cAAc,sEAmBb;IAGD,oBAAoB,CAAC,KAAK,KAAA;IAwB1B,IAAI,QAAQ,UAaX;IAED,WAAW;IAUX,cAAc;IAyCd,MAAM;CAuBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemGroup/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAgB,MAAM,OAAO,CAAA;AAEzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAgBrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cAEM,aAAc,SAAQ,SAAS,CAAC,cAAc,CAAC;IACnD,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;MAUlB;gBAGW,KAAK,KAAA;IAcjB,iBAAiB;IAKjB,kBAAkB;IAMlB,YAAY,yDAsBX;IAGD,cAAc,sEAmBb;IAGD,oBAAoB,CAAC,KAAK,KAAA;IAwB1B,IAAI,QAAQ,UAaX;IAED,WAAW;IAUX,cAAc;IAyCd,MAAM;CAsBP;AAED,eAAe,aAAa,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type MenuGroupOwnProps = {
5
+ label: React.ReactNode;
6
+ allowMultiple?: boolean;
7
+ children?: React.ReactNode;
8
+ selected?: any;
9
+ defaultSelected?: any[];
10
+ onSelect?: (...args: any[]) => any;
11
+ onMouseOver?: (...args: any[]) => any;
12
+ onKeyDown?: (...args: any[]) => any;
13
+ controls?: string;
14
+ itemRef?: (...args: any[]) => any;
15
+ disabled?: boolean;
16
+ isTabbable?: boolean;
17
+ };
18
+ declare type PropKeys = keyof MenuGroupOwnProps;
19
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
20
+ declare type MenuGroupProps = MenuGroupOwnProps & WithStyleProps;
21
+ declare const propTypes: PropValidators<PropKeys>;
22
+ declare const allowedProps: AllowedPropKeys;
23
+ export type { MenuGroupProps };
24
+ export { propTypes, allowedProps };
25
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemGroup/props.ts"],"names":[],"mappings":";AAiCA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,iBAAiB,GAAG;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,eAAe,CAAC,EAAE,GAAG,EAAE,CAAA;IACvB,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACrC,SAAS,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GAAG,cAAc,CAAA;AAExD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAkCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAanB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,8 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { jsx } from '@instructure/emotion';
5
- import { MenuSeparatorProps } from './types';
4
+ import type { MenuSeparatorProps } from './props';
6
5
  /**
7
6
  ---
8
7
  parent: Menu
@@ -12,10 +11,8 @@ id: Menu.Separator
12
11
  **/
13
12
  declare class MenuItemSeparator extends Component<MenuSeparatorProps> {
14
13
  static readonly componentId = "Menu.Separator";
15
- static propTypes: {
16
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
17
- styles: PropTypes.Requireable<object>;
18
- };
14
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<never>;
15
+ static allowedProps: readonly never[];
19
16
  componentDidMount(): void;
20
17
  componentDidUpdate(): void;
21
18
  render(): jsx.JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemSeparator/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C;;;;;;GAMG;AACH,cAEM,iBAAkB,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,oBAAmB;IAE9C,MAAM,CAAC,SAAS;;;MAKf;IAED,iBAAiB;IAKjB,kBAAkB;IAKlB,MAAM;CAUP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemSeparator/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAQrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEjD;;;;;;GAMG;AACH,cAEM,iBAAkB,SAAQ,SAAS,CAAC,kBAAkB,CAAC;IAC3D,MAAM,CAAC,QAAQ,CAAC,WAAW,oBAAmB;IAE9C,MAAM,CAAC,SAAS,+EAAY;IAC5B,MAAM,CAAC,YAAY,mBAAe;IAElC,iBAAiB;IAKjB,kBAAkB;IAKlB,MAAM;CAUP;AAED,eAAe,iBAAiB,CAAA;AAChC,OAAO,EAAE,iBAAiB,EAAE,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { WithStyleProps } from '@instructure/emotion';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ declare type MenuSeparatorOwnProps = {};
4
+ declare type PropKeys = keyof MenuSeparatorOwnProps;
5
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
6
+ declare type MenuSeparatorProps = MenuSeparatorOwnProps & WithStyleProps;
7
+ declare const propTypes: PropValidators<PropKeys>;
8
+ declare const allowedProps: AllowedPropKeys;
9
+ export type { MenuSeparatorProps };
10
+ export { propTypes, allowedProps };
11
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Menu/MenuItemSeparator/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI/D,aAAK,qBAAqB,GAAG,EAAE,CAAA;AAE/B,aAAK,QAAQ,GAAG,MAAM,qBAAqB,CAAA;AAE3C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,kBAAkB,GAAG,qBAAqB,GAAG,cAAc,CAAA;AAEhE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAAM,CAAA;AAE9C,QAAA,MAAM,YAAY,EAAE,eAAoB,CAAA;AAExC,YAAY,EAAE,kBAAkB,EAAE,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,11 +1,10 @@
1
1
  /** @jsx jsx */
2
- import { Component } from 'react';
3
- import PropTypes from 'prop-types';
2
+ import { Component, ReactElement } from 'react';
4
3
  import { MenuItem } from './MenuItem';
5
4
  import { MenuItemGroup } from './MenuItemGroup';
6
5
  import { MenuItemSeparator } from './MenuItemSeparator';
7
6
  import { jsx } from '@instructure/emotion';
8
- import { MenuProps } from './types';
7
+ import type { MenuProps } from './props';
9
8
  /**
10
9
  ---
11
10
  category: components
@@ -13,122 +12,64 @@ category: components
13
12
  **/
14
13
  declare class Menu extends Component<MenuProps> {
15
14
  static readonly componentId = "Menu";
16
- static propTypes: {
17
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
18
- styles: PropTypes.Requireable<object>;
19
- /**
20
- * Children of type `Menu.Item`, `Menu.Group`, `Menu.Separator`, or `Menu`
21
- */
22
- children: {
23
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
24
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
25
- };
26
- /**
27
- * Description of the `<Menu />`
28
- */
29
- label: PropTypes.Requireable<string>;
30
- /**
31
- * Is the `<Menu />` disabled
32
- */
33
- disabled: PropTypes.Requireable<boolean>;
34
- /**
35
- * The trigger element, if the `<Menu />` is to render as a popover
36
- */
37
- trigger: PropTypes.Requireable<PropTypes.ReactNodeLike>;
38
- /**
39
- * If a trigger is supplied, where should the `<Menu />` be placed (relative to the trigger)
40
- */
41
- placement: PropTypes.Requireable<string>;
42
- /**
43
- * Should the `<Menu />` be open for the initial render
44
- */
45
- defaultShow: PropTypes.Requireable<boolean>;
46
- /**
47
- * Is the `<Menu />` open (should be accompanied by `onToggle`)
48
- */
49
- show: (props: Record<string, any>, propName: string, componentName: string) => Error | null;
50
- /**
51
- * Callback fired when the `<Menu />` is toggled open/closed. When used with `show`,
52
- * the component will not control its own state.
53
- */
54
- onToggle: PropTypes.Requireable<(...args: any[]) => any>;
55
- /**
56
- * Callback fired when an item within the `<Menu />` is selected
57
- */
58
- onSelect: PropTypes.Requireable<(...args: any[]) => any>;
59
- /**
60
- * If a trigger is supplied, callback fired when the `<Menu />` is closed
61
- */
62
- onDismiss: PropTypes.Requireable<(...args: any[]) => any>;
63
- /**
64
- * If a trigger is supplied, callback fired when the `<Menu />` trigger is blurred
65
- */
66
- onBlur: PropTypes.Requireable<(...args: any[]) => any>;
67
- /**
68
- * If a trigger is supplied, callback fired when the `<Menu />` trigger is focused
69
- */
70
- onFocus: PropTypes.Requireable<(...args: any[]) => any>;
71
- /**
72
- * If a trigger is supplied, callback fired onMouseOver for the `<Menu />` trigger
73
- */
74
- onMouseOver: PropTypes.Requireable<(...args: any[]) => any>;
75
- /**
76
- * Callback fired on the onKeyDown of the `<Menu />`
77
- */
78
- onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
79
- /**
80
- * Callback fired on the onKeyUp of the `<Menu />`
81
- */
82
- onKeyUp: PropTypes.Requireable<(...args: any[]) => any>;
83
- menuRef: PropTypes.Requireable<(...args: any[]) => any>;
84
- /**
85
- * A function that returns a reference to the `<Popover />`
86
- */
87
- popoverRef: PropTypes.Requireable<(...args: any[]) => any>;
88
- /**
89
- * If a trigger is supplied, an element or a function returning an element to use as the mount node
90
- * for the `<Menu />` (defaults to `document.body`)
91
- */
92
- mountNode: PropTypes.Requireable<PropTypes.ReactElementLike | Element | ((...args: any[]) => any)>;
93
- /**
94
- * The parent in which to constrain the menu.
95
- * One of: 'window', 'scroll-parent', 'parent', 'none', an element,
96
- * or a function returning an element
97
- */
98
- constrain: PropTypes.Requireable<string | PropTypes.ReactElementLike | Element | ((...args: any[]) => any)>;
99
- /**
100
- * If a trigger is supplied, an element, function returning an element, or array of elements that will not
101
- * be hidden from the screen reader when the `<Menu />` is open
102
- */
103
- liveRegion: PropTypes.Requireable<((...args: any[]) => any) | PropTypes.ReactElementLike | (PropTypes.ReactElementLike | null | undefined)[]>;
104
- /**
105
- * If a trigger is supplied, should the `<Menu />` hide when an item is selected
106
- */
107
- shouldHideOnSelect: PropTypes.Requireable<boolean>;
108
- /**
109
- * If a trigger is supplied, should the `<Menu />` focus the trigger on after closing
110
- */
111
- shouldFocusTriggerOnClose: PropTypes.Requireable<boolean>;
112
- /**
113
- * The type of `<Menu />`
114
- */
115
- type: PropTypes.Requireable<string>;
116
- id: PropTypes.Requireable<string>;
117
- /**
118
- * Whether or not an arrow pointing to the trigger should be rendered
119
- */
120
- withArrow: PropTypes.Requireable<boolean>;
121
- /**
122
- * The horizontal offset for the positioned content.
123
- * Works only if `trigger` is provided.
124
- */
125
- offsetX: PropTypes.Requireable<string | number>;
126
- /**
127
- * The vertical offset for the positioned content.
128
- * Works only if `trigger` is provided.
129
- */
130
- offsetY: PropTypes.Requireable<string | number>;
131
- };
15
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
16
+ children?: import("react").ReactNode;
17
+ label?: string | undefined;
18
+ disabled?: boolean | undefined;
19
+ trigger?: import("react").ReactNode;
20
+ placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
21
+ defaultShow?: boolean | undefined;
22
+ show?: any;
23
+ onToggle?: ((...args: any[]) => any) | undefined;
24
+ onSelect?: ((...args: any[]) => any) | undefined;
25
+ onDismiss?: ((...args: any[]) => any) | undefined;
26
+ onBlur?: ((...args: any[]) => any) | undefined;
27
+ onFocus?: ((...args: any[]) => any) | undefined;
28
+ onMouseOver?: ((...args: any[]) => any) | undefined;
29
+ onKeyDown?: ((...args: any[]) => any) | undefined;
30
+ onKeyUp?: ((...args: any[]) => any) | undefined;
31
+ menuRef?: ((...args: any[]) => any) | undefined;
32
+ popoverRef?: ((...args: any[]) => any) | undefined;
33
+ mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
34
+ constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
35
+ liveRegion?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | ((...args: any[]) => any) | undefined;
36
+ shouldHideOnSelect?: boolean | undefined;
37
+ shouldFocusTriggerOnClose?: boolean | undefined;
38
+ type?: "flyout" | undefined;
39
+ id?: string | undefined;
40
+ withArrow?: boolean | undefined;
41
+ offsetX?: string | number | undefined;
42
+ offsetY?: string | number | undefined;
43
+ }>;
44
+ static allowedProps: readonly (keyof {
45
+ children?: import("react").ReactNode;
46
+ label?: string | undefined;
47
+ disabled?: boolean | undefined;
48
+ trigger?: import("react").ReactNode;
49
+ placement?: import("@instructure/ui-position").PlacementPropValues | undefined;
50
+ defaultShow?: boolean | undefined;
51
+ show?: any;
52
+ onToggle?: ((...args: any[]) => any) | undefined;
53
+ onSelect?: ((...args: any[]) => any) | undefined;
54
+ onDismiss?: ((...args: any[]) => any) | undefined;
55
+ onBlur?: ((...args: any[]) => any) | undefined;
56
+ onFocus?: ((...args: any[]) => any) | undefined;
57
+ onMouseOver?: ((...args: any[]) => any) | undefined;
58
+ onKeyDown?: ((...args: any[]) => any) | undefined;
59
+ onKeyUp?: ((...args: any[]) => any) | undefined;
60
+ menuRef?: ((...args: any[]) => any) | undefined;
61
+ popoverRef?: ((...args: any[]) => any) | undefined;
62
+ mountNode?: import("@instructure/ui-position").PositionMountNode | undefined;
63
+ constrain?: import("@instructure/ui-position").PositionConstraint | undefined;
64
+ liveRegion?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ReactElement<any, string | import("react").JSXElementConstructor<any>>[] | ((...args: any[]) => any) | undefined;
65
+ shouldHideOnSelect?: boolean | undefined;
66
+ shouldFocusTriggerOnClose?: boolean | undefined;
67
+ type?: "flyout" | undefined;
68
+ id?: string | undefined;
69
+ withArrow?: boolean | undefined;
70
+ offsetX?: string | number | undefined;
71
+ offsetY?: string | number | undefined;
72
+ })[];
132
73
  static defaultProps: {
133
74
  children: null;
134
75
  label: null;
@@ -151,9 +92,6 @@ declare class Menu extends Component<MenuProps> {
151
92
  liveRegion: null;
152
93
  shouldHideOnSelect: boolean;
153
94
  shouldFocusTriggerOnClose: boolean;
154
- show: undefined;
155
- id: undefined;
156
- type: undefined;
157
95
  withArrow: boolean;
158
96
  offsetX: number;
159
97
  offsetY: number;