@instructure/ui-navigation 8.8.1-snapshot.8 → 8.9.1

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 (70) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/es/AppNav/Item/index.js +21 -77
  3. package/es/AppNav/Item/props.js +79 -0
  4. package/es/AppNav/index.js +26 -80
  5. package/es/AppNav/props.js +87 -0
  6. package/es/Navigation/NavigationItem/index.js +25 -60
  7. package/{src/AppNav/types.ts → es/Navigation/NavigationItem/props.js} +37 -14
  8. package/es/Navigation/index.js +18 -57
  9. package/es/Navigation/props.js +68 -0
  10. package/lib/AppNav/Item/index.js +21 -77
  11. package/lib/AppNav/Item/props.js +90 -0
  12. package/lib/AppNav/index.js +25 -80
  13. package/lib/AppNav/props.js +101 -0
  14. package/lib/Navigation/NavigationItem/index.js +25 -60
  15. package/lib/Navigation/NavigationItem/props.js +73 -0
  16. package/lib/Navigation/index.js +19 -61
  17. package/lib/Navigation/props.js +83 -0
  18. package/package.json +24 -25
  19. package/src/AppNav/Item/index.tsx +8 -62
  20. package/src/AppNav/Item/props.ts +107 -0
  21. package/src/AppNav/Item/styles.ts +1 -1
  22. package/src/AppNav/index.tsx +13 -69
  23. package/src/AppNav/props.ts +118 -0
  24. package/src/Navigation/NavigationItem/index.tsx +10 -45
  25. package/src/Navigation/NavigationItem/props.ts +87 -0
  26. package/src/Navigation/NavigationItem/styles.ts +1 -1
  27. package/src/Navigation/index.tsx +13 -56
  28. package/src/Navigation/props.ts +108 -0
  29. package/src/Navigation/styles.ts +1 -1
  30. package/src/index.ts +4 -4
  31. package/types/AppNav/Item/index.d.ts +25 -53
  32. package/types/AppNav/Item/index.d.ts.map +1 -1
  33. package/types/AppNav/Item/props.d.ts +23 -0
  34. package/types/AppNav/Item/props.d.ts.map +1 -0
  35. package/types/AppNav/Item/styles.d.ts +1 -1
  36. package/types/AppNav/index.d.ts +25 -58
  37. package/types/AppNav/index.d.ts.map +1 -1
  38. package/types/AppNav/props.d.ts +23 -0
  39. package/types/AppNav/props.d.ts.map +1 -0
  40. package/types/Navigation/NavigationItem/index.d.ts +19 -35
  41. package/types/Navigation/NavigationItem/index.d.ts.map +1 -1
  42. package/types/Navigation/NavigationItem/props.d.ts +20 -0
  43. package/types/Navigation/NavigationItem/props.d.ts.map +1 -0
  44. package/types/Navigation/NavigationItem/styles.d.ts +1 -1
  45. package/types/Navigation/index.d.ts +26 -42
  46. package/types/Navigation/index.d.ts.map +1 -1
  47. package/types/Navigation/props.d.ts +27 -0
  48. package/types/Navigation/props.d.ts.map +1 -0
  49. package/types/Navigation/styles.d.ts +1 -1
  50. package/types/index.d.ts +4 -4
  51. package/LICENSE.md +0 -27
  52. package/es/AppNav/Item/types.js +0 -1
  53. package/es/AppNav/types.js +0 -1
  54. package/es/Navigation/NavigationItem/types.js +0 -1
  55. package/es/Navigation/types.js +0 -1
  56. package/lib/AppNav/Item/types.js +0 -1
  57. package/lib/AppNav/types.js +0 -1
  58. package/lib/Navigation/NavigationItem/types.js +0 -1
  59. package/lib/Navigation/types.js +0 -1
  60. package/src/AppNav/Item/types.ts +0 -40
  61. package/src/Navigation/NavigationItem/types.ts +0 -37
  62. package/src/Navigation/types.ts +0 -42
  63. package/types/AppNav/Item/types.d.ts +0 -17
  64. package/types/AppNav/Item/types.d.ts.map +0 -1
  65. package/types/AppNav/types.d.ts +0 -16
  66. package/types/AppNav/types.d.ts.map +0 -1
  67. package/types/Navigation/NavigationItem/types.d.ts +0 -14
  68. package/types/Navigation/NavigationItem/types.d.ts.map +0 -1
  69. package/types/Navigation/types.d.ts +0 -18
  70. package/types/Navigation/types.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAalC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAEzC;;;;;;GAMG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,SAAS;;;QAKd;;;WAGG;;QAGH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;;WAGG;;QAEH;;WAEG;;MAEJ;IAED,MAAM,CAAC,YAAY;;;;;;;;;;;MAYlB;IAED,iBAAiB;IAKjB,kBAAkB;IAMlB,WAAW,mBASV;IAED,MAAM;CAuDP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAajC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAG9C;;;;;;GAMG;AACH,cAEM,IAAK,SAAQ,SAAS,CAAC,eAAe,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,iBAAgB;IAE3C,MAAM,CAAC,YAAY;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;MAOlB;IAED,iBAAiB;IAIjB,kBAAkB;IAKlB,WAAW,mBASV;IAED,MAAM;CAuDP;AAED,eAAe,IAAI,CAAA;AACnB,OAAO,EAAE,IAAI,EAAE,CAAA"}
@@ -0,0 +1,23 @@
1
+ /// <reference types="react" />
2
+ import type { AsElementType, PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type AppNavItemOwnProps = {
5
+ renderLabel: React.ReactNode | ((...args: any[]) => any);
6
+ renderAfter?: React.ReactNode | ((...args: any[]) => any);
7
+ renderIcon?: React.ReactNode | ((...args: any[]) => any);
8
+ href?: string;
9
+ onClick?: (...args: any[]) => any;
10
+ isSelected?: boolean;
11
+ elementRef?: (...args: any[]) => any;
12
+ as?: AsElementType;
13
+ cursor?: string;
14
+ isDisabled?: boolean;
15
+ };
16
+ declare type PropKeys = keyof AppNavItemOwnProps;
17
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
18
+ declare type AppNavItemProps = AppNavItemOwnProps & WithStyleProps;
19
+ declare const propTypes: PropValidators<PropKeys>;
20
+ declare const allowedProps: AllowedPropKeys;
21
+ export type { AppNavItemProps };
22
+ export { propTypes, allowedProps };
23
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/AppNav/Item/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,kBAAkB,GAAG;IACxB,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACzD,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kBAAkB,GAAG,cAAc,CAAA;AAE1D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA2CvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAWnB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,CAAA;AAC/B,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { AppNavItemTheme } from '@instructure/shared-types';
2
- import { AppNavItemProps } from './types';
2
+ import { AppNavItemProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -1,9 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { jsx } from '@instructure/emotion';
5
4
  import { Item } from './Item';
6
- import { AppNavProps } from './types';
5
+ import type { AppNavProps } from './props';
7
6
  /**
8
7
  ---
9
8
  category: components
@@ -11,66 +10,34 @@ category: components
11
10
  **/
12
11
  declare class AppNav extends Component<AppNavProps> {
13
12
  static readonly componentId = "AppNav";
14
- static propTypes: {
15
- /**
16
- * Screenreader label for the overall navigation
17
- */
18
- screenReaderLabel: PropTypes.Validator<string>;
19
- /**
20
- * Only accepts `AppNav.Item` as children
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
- * The rate (in ms) the component responds to container resizing or
28
- * an update to one of its child items
29
- */
30
- debounce: PropTypes.Requireable<number>;
31
- /**
32
- * Content to display before the navigation items, such as a logo
33
- */
34
- renderBeforeItems: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
35
- /**
36
- * Content to display after the navigation items, aligned to the far end
37
- * of the navigation
38
- */
39
- renderAfterItems: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
40
- /**
41
- * Valid values are `0`, `none`, `auto`, `xxx-small`, `xx-small`, `x-small`,
42
- * `small`, `medium`, `large`, `x-large`, `xx-large`. Apply these values via
43
- * familiar CSS-like shorthand. For example: `margin="small auto large"`.
44
- */
45
- margin: (props: any, propName: any, componentName: any, location: any) => any;
46
- /**
47
- * Provides a reference to the underlying nav element
48
- */
49
- elementRef: PropTypes.Requireable<(...args: any[]) => any>;
50
- /**
51
- * Customize the text displayed in the menu trigger when links overflow
52
- * the overall nav width.
53
- */
54
- renderTruncateLabel: PropTypes.Requireable<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
55
- /**
56
- * Called whenever the navigation items are updated or the size of
57
- * the navigation changes. Passes in the `visibleItemsCount` as
58
- * a parameter.
59
- */
60
- onUpdate: PropTypes.Requireable<(...args: any[]) => any>;
61
- /**
62
- * Sets the number of navigation items that are visible.
63
- */
64
- visibleItemsCount: PropTypes.Requireable<number>;
65
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
66
- styles: PropTypes.Requireable<object>;
67
- };
13
+ static allowedProps: readonly (keyof {
14
+ screenReaderLabel: string;
15
+ debounce?: number | undefined;
16
+ renderBeforeItems?: import("react").ReactNode | ((...args: any[]) => any);
17
+ renderAfterItems?: import("react").ReactNode | ((...args: any[]) => any);
18
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
19
+ elementRef?: ((...args: any[]) => any) | undefined;
20
+ renderTruncateLabel?: import("react").ReactNode | ((...args: any[]) => any);
21
+ onUpdate?: ((...args: any[]) => any) | undefined;
22
+ visibleItemsCount?: number | undefined;
23
+ children?: import("react").ReactNode;
24
+ })[];
25
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
26
+ screenReaderLabel: string;
27
+ debounce?: number | undefined;
28
+ renderBeforeItems?: import("react").ReactNode | ((...args: any[]) => any);
29
+ renderAfterItems?: import("react").ReactNode | ((...args: any[]) => any);
30
+ margin?: import("@instructure/emotion/types/styleUtils/ThemeablePropValues").Spacing | undefined;
31
+ elementRef?: ((...args: any[]) => any) | undefined;
32
+ renderTruncateLabel?: import("react").ReactNode | ((...args: any[]) => any);
33
+ onUpdate?: ((...args: any[]) => any) | undefined;
34
+ visibleItemsCount?: number | undefined;
35
+ children?: import("react").ReactNode;
36
+ }>;
68
37
  static defaultProps: {
69
38
  children: null;
70
39
  debounce: number;
71
40
  margin: string;
72
- renderBeforeItems: undefined;
73
- renderAfterItems: undefined;
74
41
  elementRef: (el: any) => void;
75
42
  renderTruncateLabel: () => string;
76
43
  onUpdate: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AppNav/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAC3C,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,OAAO,EAAa,GAAG,EAAsB,MAAM,sBAAsB,CAAA;AAWzE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAI7B,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC;;;;GAIG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;QACd;;WAEG;;QAEH;;WAEG;;;;;QAEH;;;WAGG;;QAEH;;WAEG;;QAEH;;;WAGG;;QAEH;;;;WAIG;;QAEH;;WAEG;;QAEH;;;WAGG;;QAEH;;;;WAIG;;QAEH;;WAEG;;;;MAMJ;IAED,MAAM,CAAC,YAAY;;;;;;;;;;MAWlB;IAED,MAAM,CAAC,IAAI,cAAO;IAElB,KAAK;;MAEJ;IAED,KAAK,OAAO;IAEZ,iBAAiB;IA4BjB,kBAAkB;IAKlB,oBAAoB;IAcpB,YAAY;;MA8BX;IAED,YAAY,aAQX;IAGD,cAAc,CAAC,IAAI,KAAA,EAAE,aAAa,KAAA,EAAE,GAAG,KAAA;IAgBvC,UAAU,CAAC,KAAK,KAAA;IAiChB,MAAM;CAoDP;AAED,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,eAAe,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AppNav/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAY,SAAS,EAAE,MAAM,OAAO,CAAA;AAE3C,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAUrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAI7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;;GAIG;AACH,cAEM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,YAAY;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;MASlB;IAED,MAAM,CAAC,IAAI,cAAO;IAElB,KAAK;;MAEJ;IAED,KAAK,OAAO;IAEZ,iBAAiB;IA2BjB,kBAAkB;IAIlB,oBAAoB;IAcpB,YAAY;;MA8BX;IAED,YAAY,aAQX;IAGD,cAAc,CAAC,IAAI,KAAA,EAAE,aAAa,KAAA,EAAE,GAAG,KAAA;IAgBvC,UAAU,CAAC,KAAK,KAAA;IAiChB,MAAM;CAoDP;AAED,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,eAAe,MAAM,CAAA"}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { Spacing, WithStyleProps } from '@instructure/emotion';
3
+ import type { PropValidators } from '@instructure/shared-types';
4
+ declare type AppNavOwnProps = {
5
+ screenReaderLabel: string;
6
+ debounce?: number;
7
+ renderBeforeItems?: React.ReactNode | ((...args: any[]) => any);
8
+ renderAfterItems?: React.ReactNode | ((...args: any[]) => any);
9
+ margin?: Spacing;
10
+ elementRef?: (...args: any[]) => any;
11
+ renderTruncateLabel?: React.ReactNode | ((...args: any[]) => any);
12
+ onUpdate?: (...args: any[]) => any;
13
+ visibleItemsCount?: number;
14
+ children?: React.ReactNode;
15
+ };
16
+ declare type PropKeys = keyof AppNavOwnProps;
17
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
18
+ declare type AppNavProps = AppNavOwnProps & WithStyleProps;
19
+ declare const propTypes: PropValidators<PropKeys>;
20
+ declare const allowedProps: AllowedPropKeys;
21
+ export type { AppNavProps };
22
+ export { propTypes, allowedProps };
23
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/AppNav/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/D,aAAK,cAAc,GAAG;IACpB,iBAAiB,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC/D,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACpC,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,CAAA;IACjE,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,cAAc,CAAA;AAEpC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,WAAW,GAAG,cAAc,GAAG,cAAc,CAAA;AAElD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAgDvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAWnB,CAAA;AAED,YAAY,EAAE,WAAW,EAAE,CAAA;AAC3B,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 { NavigationItemProps } from './types';
4
+ import type { NavigationItemProps } from './props';
6
5
  /**
7
6
  ---
8
7
  parent: Navigation
@@ -11,44 +10,29 @@ id: Navigation.Item
11
10
  **/
12
11
  declare class NavigationItem extends Component<NavigationItemProps> {
13
12
  static readonly componentId = "Navigation.Item";
14
- static propTypes: {
15
- readonly makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- readonly styles: PropTypes.Requireable<object>;
17
- /**
18
- * The visual to display (ex. an Image, Logo, Avatar, or Icon)
19
- */
20
- readonly icon: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
21
- /**
22
- * The text to display for the Navigation Link
23
- */
24
- readonly label: PropTypes.Validator<string | number | boolean | {} | PropTypes.ReactElementLike | PropTypes.ReactNodeArray>;
25
- /**
26
- * The element type to render as (will default to `<a>` if href is provided)
27
- */
28
- readonly as: PropTypes.Requireable<PropTypes.ReactComponentLike>;
29
- /**
30
- * If the NavigationItem goes to a new page, pass an href
31
- */
32
- readonly href: PropTypes.Requireable<string>;
33
- /**
34
- * If the NavigationItem does not go to a new page pass an onClick
35
- */
36
- readonly onClick: PropTypes.Requireable<(...args: any[]) => any>;
37
- /**
38
- * Denotes which NavigationItem is currently selected
39
- */
40
- readonly selected: PropTypes.Requireable<boolean>;
41
- /**
42
- * When minimized is set to true, the `<Navigation />` shows icons only while the text becomes a tooltip. When it is set to false, the `<Navigation />` shows text in addition to the icons
43
- */
44
- readonly minimized: PropTypes.Requireable<boolean>;
45
- };
13
+ static allowedProps: readonly (keyof {
14
+ icon: import("react").ReactNode;
15
+ label: import("react").ReactNode;
16
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
17
+ href?: string | undefined;
18
+ onClick?: ((...args: any[]) => any) | undefined;
19
+ selected?: boolean | undefined;
20
+ minimized?: boolean | undefined;
21
+ })[];
22
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
23
+ icon: import("react").ReactNode;
24
+ label: import("react").ReactNode;
25
+ as?: import("@instructure/shared-types/types/CommonProps").AsElementType | undefined;
26
+ href?: string | undefined;
27
+ onClick?: ((...args: any[]) => any) | undefined;
28
+ selected?: boolean | undefined;
29
+ minimized?: boolean | undefined;
30
+ }>;
46
31
  static defaultProps: {
47
32
  readonly as: "a";
48
33
  readonly onClick: (e: any, selected: any) => void;
49
34
  readonly selected: false;
50
35
  readonly minimized: false;
51
- readonly href: undefined;
52
36
  };
53
37
  componentDidMount(): void;
54
38
  componentDidUpdate(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,SAAS,MAAM,YAAY,CAAA;AAMlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cAEM,cAAe,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,SAAS;;;QAKd;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;MAEK;IAEV,MAAM,CAAC,YAAY;;;;;;MAOT;IAEV,iBAAiB;IAKjB,kBAAkB;IAKlB,UAAU;IA0BV,MAAM;CAaP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAGlD;;;;;GAKG;AACH,cAEM,cAAe,SAAQ,SAAS,CAAC,mBAAmB,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,WAAW,qBAAoB;IAE/C,MAAM,CAAC,YAAY;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAMT;IAEV,iBAAiB;IAIjB,kBAAkB;IAIlB,UAAU;IA0BV,MAAM;CAaP;AAED,eAAe,cAAc,CAAA;AAC7B,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import type { AsElementType, PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type NavigationItemOwnProps = {
5
+ icon: React.ReactNode;
6
+ label: React.ReactNode;
7
+ as?: AsElementType;
8
+ href?: string;
9
+ onClick?: (...args: any[]) => any;
10
+ selected?: boolean;
11
+ minimized?: boolean;
12
+ };
13
+ declare type PropKeys = keyof NavigationItemOwnProps;
14
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
15
+ declare type NavigationItemProps = NavigationItemOwnProps & WithStyleProps;
16
+ declare const propTypes: PropValidators<PropKeys>;
17
+ declare const allowedProps: AllowedPropKeys;
18
+ export type { NavigationItemProps };
19
+ export { propTypes, allowedProps };
20
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Navigation/NavigationItem/props.ts"],"names":[],"mappings":";AAyBA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,sBAAsB,GAAG;IAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,sBAAsB,CAAA;AAE5C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,mBAAmB,GAAG,sBAAsB,GAAG,cAAc,CAAA;AAElE,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CA6BvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAQnB,CAAA;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { NavigationItemTheme } from '@instructure/shared-types';
2
- import { NavigationItemProps } from './types';
2
+ import { NavigationItemProps } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
@@ -1,9 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { Component } from 'react';
3
- import PropTypes from 'prop-types';
4
3
  import { jsx } from '@instructure/emotion';
5
4
  import { NavigationItem } from './NavigationItem';
6
- import { NavigationProps, NavigationState } from './types';
5
+ import type { NavigationProps, NavigationState } from './props';
7
6
  /**
8
7
  ---
9
8
  category: components
@@ -11,52 +10,37 @@ category: components
11
10
  **/
12
11
  declare class Navigation extends Component<NavigationProps, NavigationState> {
13
12
  static readonly componentId = "Navigation";
14
- static propTypes: {
15
- makeStyles: PropTypes.Requireable<(...args: any[]) => any>;
16
- styles: PropTypes.Requireable<object>;
17
- /**
18
- * children of type Navigation.Item
19
- */
20
- children: {
21
- (props: Record<string, any>, propName: string, componentName: string): Error | null;
22
- isRequired: (props: Record<string, any>, propName: string, componentName: string, location?: string | undefined, propFullName?: string | undefined) => Error | null;
13
+ static allowedProps: readonly (keyof {
14
+ minimized?: any;
15
+ defaultMinimized?: boolean | undefined;
16
+ onMinimized?: ((...args: any[]) => any) | undefined;
17
+ label: string;
18
+ toggleLabel: {
19
+ expandedLabel?: string | undefined;
20
+ minimizedLabel?: string | undefined;
23
21
  };
24
- /**
25
- * When minimized is set to true, the `<Navigation />` shows icons only while the text becomes a tooltip. When it is set to false, the `<Navigation />` shows text in addition to the icons
26
- */
27
- minimized: (props: Record<string, any>, propName: string, componentName: string) => Error | null;
28
- /**
29
- * Whether the `<Navigation />` is initially minimized (uncontrolled)
30
- */
31
- defaultMinimized: PropTypes.Requireable<boolean>;
32
- onMinimized: PropTypes.Requireable<(...args: any[]) => any>;
33
- /**
34
- * Screen reader label for the main Navigation
35
- */
36
- label: PropTypes.Validator<string>;
37
- /**
38
- * Screen reader label for the toggle button expanded/minimized state
39
- */
40
- toggleLabel: PropTypes.Validator<PropTypes.InferProps<{
41
- expandedLabel: PropTypes.Requireable<string>;
42
- minimizedLabel: PropTypes.Requireable<string>;
43
- }>>;
44
- /**
45
- * If the `<Navigation.Item>` goes to a new page, pass an href
46
- */
47
- href: PropTypes.Requireable<string>;
48
- /**
49
- * If the `<Navigation.Item>` does not go to a new page pass an onClick
50
- */
51
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
52
- };
22
+ href?: string | undefined;
23
+ onClick?: ((...args: any[]) => any) | undefined;
24
+ children?: import("react").ReactNode;
25
+ })[];
26
+ static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
27
+ minimized?: any;
28
+ defaultMinimized?: boolean | undefined;
29
+ onMinimized?: ((...args: any[]) => any) | undefined;
30
+ label: string;
31
+ toggleLabel: {
32
+ expandedLabel?: string | undefined;
33
+ minimizedLabel?: string | undefined;
34
+ };
35
+ href?: string | undefined;
36
+ onClick?: ((...args: any[]) => any) | undefined;
37
+ children?: import("react").ReactNode;
38
+ }>;
53
39
  static defaultProps: {
54
40
  children: null;
55
41
  defaultMinimized: boolean;
56
42
  onMinimized: (event: any, minimized: any) => void;
57
43
  onClick: (e: any) => void;
58
- href: undefined;
59
- minimized: undefined;
60
44
  };
61
45
  static Item: typeof NavigationItem;
62
46
  constructor(props: any);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Navigation/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AACzD,OAAO,SAAS,MAAM,YAAY,CAAA;AAUlC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK1D;;;;GAIG;AACH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAClE,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;QAKd;;WAEG;;;;;QAEH;;WAEG;;QAEH;;WAEG;;;QAGH;;WAEG;;QAEH;;WAEG;;;;;QAKH;;WAEG;;QAEH;;WAEG;;MAEJ;IAED,MAAM,CAAC,YAAY;;;;;;;MASlB;IAED,MAAM,CAAC,IAAI,wBAAiB;gBAGhB,KAAK,KAAA;IAWjB,iBAAiB;IAKjB,kBAAkB;IAKlB,IAAI,SAAS,YAKZ;IAED,YAAY,CAAC,KAAK;;MAAa;IAK/B,eAAe,uBAOd;IAED,cAAc;IASd,aAAa;IAMb,MAAM;CA0BP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Navigation/index.tsx"],"names":[],"mappings":"AAuBA,eAAe;AACf,OAAO,EAAE,SAAS,EAA0B,MAAM,OAAO,CAAA;AAOzD,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAErD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAM/D;;;;GAIG;AACH,cAEM,UAAW,SAAQ,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAClE,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,YAAY;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;MAOlB;IAED,MAAM,CAAC,IAAI,wBAAiB;gBAGhB,KAAK,KAAA;IAWjB,iBAAiB;IAIjB,kBAAkB;IAIlB,IAAI,SAAS,YAKZ;IAED,YAAY,CAAC,KAAK;;MAAa;IAK/B,eAAe,uBAOd;IAED,cAAc;IASd,aAAa;IAMb,MAAM;CA0BP;AAED,eAAe,UAAU,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,CAAA"}
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import type { PropValidators } from '@instructure/shared-types';
3
+ import type { WithStyleProps } from '@instructure/emotion';
4
+ declare type NavigationOwnProps = {
5
+ minimized?: any;
6
+ defaultMinimized?: boolean;
7
+ onMinimized?: (...args: any[]) => any;
8
+ label: string;
9
+ toggleLabel: {
10
+ expandedLabel?: string;
11
+ minimizedLabel?: string;
12
+ };
13
+ href?: string;
14
+ onClick?: (...args: any[]) => any;
15
+ children?: React.ReactNode;
16
+ };
17
+ declare type NavigationState = {
18
+ minimized: boolean;
19
+ };
20
+ declare type PropKeys = keyof NavigationOwnProps;
21
+ declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
22
+ declare type NavigationProps = NavigationOwnProps & WithStyleProps;
23
+ declare const propTypes: PropValidators<PropKeys>;
24
+ declare const allowedProps: AllowedPropKeys;
25
+ export type { NavigationProps, NavigationState };
26
+ export { propTypes, allowedProps };
27
+ //# sourceMappingURL=props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Navigation/props.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,aAAK,kBAAkB,GAAG;IACxB,SAAS,CAAC,EAAE,GAAG,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE;QACX,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,cAAc,CAAC,EAAE,MAAM,CAAA;KACxB,CAAA;IACD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,CAAA;AAED,aAAK,eAAe,GAAG;IACrB,SAAS,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,kBAAkB,CAAA;AAExC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,eAAe,GAAG,kBAAkB,GAAG,cAAc,CAAA;AAE1D,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAiCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eASnB,CAAA;AAED,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { NavigationTheme } from '@instructure/shared-types';
2
- import { NavigationProps, NavigationState } from './types';
2
+ import { NavigationProps, NavigationState } from './props';
3
3
  /**
4
4
  * ---
5
5
  * private: true
package/types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { AppNav } from './AppNav';
2
2
  export { Navigation, NavigationItem } from './Navigation';
3
- export type { AppNavProps } from './AppNav/types';
4
- export type { AppNavItemProps } from './AppNav/Item/types';
5
- export type { NavigationProps } from './Navigation/types';
6
- export type { NavigationItemProps } from './Navigation/NavigationItem/types';
3
+ export type { AppNavProps } from './AppNav/props';
4
+ export type { AppNavItemProps } from './AppNav/Item/props';
5
+ export type { NavigationProps } from './Navigation/props';
6
+ export type { NavigationItemProps } from './Navigation/NavigationItem/props';
7
7
  //# sourceMappingURL=index.d.ts.map
package/LICENSE.md DELETED
@@ -1,27 +0,0 @@
1
- ---
2
- title: The MIT License (MIT)
3
- category: Getting Started
4
- order: 9
5
- ---
6
-
7
- # The MIT License (MIT)
8
-
9
- Copyright (c) 2015 Instructure, Inc.
10
-
11
- **Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions.**
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.