@atlaskit/side-navigation 3.2.0 → 3.3.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.
Files changed (56) hide show
  1. package/CHANGELOG.md +20 -1
  2. package/README.md +7 -3
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/codemods/0.8.0-change-css-fn-prop.tsx +136 -164
  5. package/codemods/__tests__/0.8.0-change-css-fn-prop.tsx +77 -77
  6. package/codemods/helpers/generic.tsx +528 -564
  7. package/constellation/index/examples.mdx +20 -20
  8. package/constellation/index/props.mdx +8 -8
  9. package/constellation/index/usage.mdx +27 -11
  10. package/dist/cjs/components/Header/index.js +4 -0
  11. package/dist/cjs/components/Item/link-item.js +3 -1
  12. package/dist/cjs/components/LoadingItems/index.js +7 -3
  13. package/dist/cjs/components/NavigationContent/index.js +8 -1
  14. package/dist/cjs/components/NavigationHeader/index.js +4 -0
  15. package/dist/cjs/components/NestableNavigationContent/index.js +5 -0
  16. package/dist/cjs/components/NestableNavigationContent/nesting-motion.js +3 -1
  17. package/dist/cjs/components/NestingItem/index.js +4 -0
  18. package/dist/cjs/components/SideNavigation/index.js +5 -0
  19. package/dist/es2019/components/Header/index.js +5 -0
  20. package/dist/es2019/components/Item/link-item.js +3 -1
  21. package/dist/es2019/components/LoadingItems/index.js +7 -3
  22. package/dist/es2019/components/NavigationContent/index.js +8 -1
  23. package/dist/es2019/components/NavigationHeader/index.js +4 -0
  24. package/dist/es2019/components/NestableNavigationContent/index.js +5 -0
  25. package/dist/es2019/components/NestableNavigationContent/nesting-motion.js +4 -0
  26. package/dist/es2019/components/NestingItem/index.js +5 -0
  27. package/dist/es2019/components/SideNavigation/index.js +5 -0
  28. package/dist/esm/components/Header/index.js +5 -0
  29. package/dist/esm/components/Item/link-item.js +3 -1
  30. package/dist/esm/components/LoadingItems/index.js +7 -3
  31. package/dist/esm/components/NavigationContent/index.js +8 -1
  32. package/dist/esm/components/NavigationHeader/index.js +4 -0
  33. package/dist/esm/components/NestableNavigationContent/index.js +5 -0
  34. package/dist/esm/components/NestableNavigationContent/nesting-motion.js +4 -0
  35. package/dist/esm/components/NestingItem/index.js +5 -0
  36. package/dist/esm/components/SideNavigation/index.js +5 -0
  37. package/dist/types/components/LoadingItems/index.d.ts +1 -1
  38. package/dist/types/components/NavigationContent/index.d.ts +3 -0
  39. package/dist/types/components/NavigationHeader/index.d.ts +3 -0
  40. package/dist/types/components/NestableNavigationContent/index.d.ts +0 -1
  41. package/dist/types/components/NestableNavigationContent/nesting-motion.d.ts +3 -0
  42. package/dist/types/components/NestingItem/index.d.ts +3 -0
  43. package/dist/types/components/index.d.ts +2 -2
  44. package/dist/types/index.d.ts +1 -1
  45. package/dist/types-ts4.5/components/LoadingItems/index.d.ts +1 -1
  46. package/dist/types-ts4.5/components/NavigationContent/index.d.ts +3 -0
  47. package/dist/types-ts4.5/components/NavigationHeader/index.d.ts +3 -0
  48. package/dist/types-ts4.5/components/NestableNavigationContent/index.d.ts +0 -1
  49. package/dist/types-ts4.5/components/NestableNavigationContent/nesting-motion.d.ts +3 -0
  50. package/dist/types-ts4.5/components/NestingItem/index.d.ts +3 -0
  51. package/dist/types-ts4.5/components/index.d.ts +2 -2
  52. package/dist/types-ts4.5/index.d.ts +1 -1
  53. package/docs/00-intro.tsx +4 -6
  54. package/docs/ert/footer.tsx +6 -6
  55. package/package.json +97 -97
  56. package/report.api.md +102 -123
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/side-navigation"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -35,7 +36,7 @@ import { SkeletonItemProps } from '@atlaskit/menu';
35
36
 
36
37
  // @public
37
38
  export const ButtonItem: React_2.ForwardRefExoticComponent<
38
- ButtonItemProps & React_2.RefAttributes<HTMLElement>
39
+ ButtonItemProps & React_2.RefAttributes<HTMLElement>
39
40
  >;
40
41
 
41
42
  export { ButtonItemProps };
@@ -50,60 +51,58 @@ export { CustomItemProps };
50
51
 
51
52
  // @public (undocumented)
52
53
  interface CustomItemPropsHack {
53
- // (undocumented)
54
- <TComponentProps extends {}>(
55
- props: CustomItemProps<TComponentProps> & {
56
- ref?: any;
57
- } & Omit<TComponentProps, keyof CustomItemComponentProps>,
58
- ): JSX.Element | null;
54
+ // (undocumented)
55
+ <TComponentProps extends {}>(
56
+ props: CustomItemProps<TComponentProps> & {
57
+ ref?: any;
58
+ } & Omit<TComponentProps, keyof CustomItemComponentProps>,
59
+ ): JSX.Element | null;
59
60
  }
60
61
 
61
62
  // @public
62
63
  export const Footer: ({
63
- useDeprecatedApi,
64
- description,
65
- iconBefore,
66
- testId,
67
- children,
68
- component,
69
- cssFn,
70
- onClick,
64
+ useDeprecatedApi,
65
+ description,
66
+ iconBefore,
67
+ testId,
68
+ children,
69
+ component,
70
+ cssFn,
71
+ onClick,
71
72
  }: FooterFacadeProps) => JSX.Element;
72
73
 
73
74
  // @public (undocumented)
74
75
  type FooterFacadeProps =
75
- | (HeaderProps & {
76
- useDeprecatedApi?: true;
77
- })
78
- | (NewFooterProps & {
79
- useDeprecatedApi?: false;
80
- cssFn?: never;
81
- component?: never;
82
- onClick?: never;
83
- });
76
+ | (HeaderProps & {
77
+ useDeprecatedApi?: true;
78
+ })
79
+ | (NewFooterProps & {
80
+ useDeprecatedApi?: false;
81
+ cssFn?: never;
82
+ component?: never;
83
+ onClick?: never;
84
+ });
84
85
 
85
86
  // @public (undocumented)
86
87
  export type FooterProps = HeaderProps | NewFooterProps;
87
88
 
88
89
  // @public
89
90
  export const GoBackItem: React_2.ForwardRefExoticComponent<
90
- ButtonItemProps & React_2.RefAttributes<HTMLElement>
91
+ ButtonItemProps & React_2.RefAttributes<HTMLElement>
91
92
  >;
92
93
 
93
94
  // @public
94
- export const Header: ForwardRefExoticComponent<
95
- HeaderProps & RefAttributes<HTMLElement>
96
- >;
95
+ export const Header: ForwardRefExoticComponent<HeaderProps & RefAttributes<HTMLElement>>;
97
96
 
98
97
  // @public (undocumented)
99
98
  export type HeaderProps = {
100
- cssFn?: CSSFn;
101
- iconBefore?: React.ReactNode;
102
- onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
103
- description?: JSX.Element | string;
104
- children?: React.ReactNode;
105
- testId?: string;
106
- component?: React.ComponentType<CustomItemComponentProps>;
99
+ cssFn?: CSSFn;
100
+ iconBefore?: React.ReactNode;
101
+ onClick?: (event: React.KeyboardEvent | React.MouseEvent) => void;
102
+ description?: JSX.Element | string;
103
+ children?: React.ReactNode;
104
+ testId?: string;
105
+ component?: React.ComponentType<CustomItemComponentProps>;
107
106
  };
108
107
 
109
108
  // @public
@@ -113,124 +112,106 @@ export { HeadingItemProps };
113
112
 
114
113
  // @public
115
114
  export const LinkItem: React_2.ForwardRefExoticComponent<
116
- LinkItemProps & React_2.RefAttributes<HTMLElement>
115
+ LinkItemProps & React_2.RefAttributes<HTMLElement>
117
116
  >;
118
117
 
119
118
  export { LinkItemProps };
120
119
 
121
120
  // @public
122
121
  export const LoadingItems: ({
123
- children,
124
- isLoading,
125
- fallback,
126
- testId,
122
+ children,
123
+ isLoading,
124
+ fallback,
125
+ testId,
127
126
  }: LoadingItemsProps) => JSX.Element;
128
127
 
129
128
  // @public (undocumented)
130
129
  export interface LoadingItemsProps {
131
- children: React.ReactNode;
132
- fallback: React.ReactNode;
133
- isLoading?: boolean;
134
- testId?: string;
130
+ children: React.ReactNode;
131
+ fallback: React.ReactNode;
132
+ isLoading?: boolean;
133
+ testId?: string;
135
134
  }
136
135
 
137
136
  // @public
138
137
  export const NavigationContent: ForwardRefExoticComponent<
139
- NavigationContentProps &
140
- HTMLAttributes<HTMLElement> &
141
- RefAttributes<HTMLElement>
138
+ NavigationContentProps & HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>
142
139
  >;
143
140
 
144
141
  // @public (undocumented)
145
142
  export interface NavigationContentProps {
146
- // (undocumented)
147
- children: React.ReactNode;
148
- showTopScrollIndicator?: boolean;
149
- testId?: string;
143
+ // (undocumented)
144
+ children: React.ReactNode;
145
+ showTopScrollIndicator?: boolean;
146
+ testId?: string;
150
147
  }
151
148
 
152
149
  // @public
153
- export const NavigationFooter: ({
154
- children,
155
- }: NavigationFooterProps) => JSX.Element;
150
+ export const NavigationFooter: ({ children }: NavigationFooterProps) => JSX.Element;
156
151
 
157
152
  // @public (undocumented)
158
153
  export interface NavigationFooterProps {
159
- // (undocumented)
160
- children: ReactNode;
154
+ // (undocumented)
155
+ children: ReactNode;
161
156
  }
162
157
 
163
158
  // @public
164
- export const NavigationHeader: (
165
- props: NavigationHeaderProps,
166
- ) => jsx.JSX.Element;
159
+ export const NavigationHeader: (props: NavigationHeaderProps) => jsx.JSX.Element;
167
160
 
168
161
  // @public (undocumented)
169
162
  export interface NavigationHeaderProps {
170
- // (undocumented)
171
- children: JSX.Element | JSX.Element[];
163
+ // (undocumented)
164
+ children: JSX.Element | JSX.Element[];
172
165
  }
173
166
 
174
167
  // @public
175
- export const NestableNavigationContent: (
176
- props: NestableNavigationContentProps,
177
- ) => jsx.JSX.Element;
168
+ export const NestableNavigationContent: (props: NestableNavigationContentProps) => jsx.JSX.Element;
178
169
 
179
170
  // @public (undocumented)
180
171
  export interface NestableNavigationContentProps {
181
- children: JSX.Element | JSX.Element[];
182
- initialStack?: string[];
183
- onChange?: (stack: string[]) => void;
184
- onUnknownNest?: (stack: string[]) => void;
185
- // @deprecated
186
- overrides?: {
187
- GoBackItem?: {
188
- render?: (props: {
189
- onClick: () => void;
190
- testId?: string;
191
- }) => React.ReactNode;
192
- };
193
- };
194
- showTopScrollIndicator?: boolean;
195
- stack?: string[];
196
- testId?: string;
172
+ children: JSX.Element | JSX.Element[];
173
+ initialStack?: string[];
174
+ onChange?: (stack: string[]) => void;
175
+ onUnknownNest?: (stack: string[]) => void;
176
+ // @deprecated
177
+ overrides?: {
178
+ GoBackItem?: {
179
+ render?: (props: { onClick: () => void; testId?: string }) => React.ReactNode;
180
+ };
181
+ };
182
+ showTopScrollIndicator?: boolean;
183
+ stack?: string[];
184
+ testId?: string;
197
185
  }
198
186
 
199
187
  // @public
200
- export const NestingItem: <
201
- TCustomComponentProps extends CustomItemComponentProps,
202
- >(
203
- props: NestingItemProps<TCustomComponentProps> &
204
- Omit<TCustomComponentProps, keyof CustomItemComponentProps>,
188
+ export const NestingItem: <TCustomComponentProps extends CustomItemComponentProps>(
189
+ props: NestingItemProps<TCustomComponentProps> &
190
+ Omit<TCustomComponentProps, keyof CustomItemComponentProps>,
205
191
  ) => JSX.Element;
206
192
 
207
193
  // @public (undocumented)
208
194
  interface NestingItemOverrides extends Overrides {
209
- GoBackItem?: {
210
- render?: (props: {
211
- onClick: () => void;
212
- testId?: string;
213
- }) => React_2.ReactNode;
214
- };
195
+ GoBackItem?: {
196
+ render?: (props: { onClick: () => void; testId?: string }) => React_2.ReactNode;
197
+ };
215
198
  }
216
199
 
217
200
  // @public (undocumented)
218
- export interface NestingItemProps<
219
- TCustomComponentProps = CustomItemComponentProps,
220
- > {
221
- children: React_2.ReactNode;
222
- component?: React_2.ComponentType<TCustomComponentProps>;
223
- cssFn?: CSSFn;
224
- description?: JSX.Element | string;
225
- iconAfter?: React_2.ReactNode;
226
- iconBefore?: React_2.ReactNode;
227
- id: string;
228
- isDisabled?: boolean;
229
- isSelected?: boolean;
230
- onClick?: (event: React_2.KeyboardEvent | React_2.MouseEvent) => void;
231
- overrides?: NestingItemOverrides;
232
- testId?: string;
233
- title: React_2.ReactNode;
201
+ export interface NestingItemProps<TCustomComponentProps = CustomItemComponentProps> {
202
+ children: React_2.ReactNode;
203
+ component?: React_2.ComponentType<TCustomComponentProps>;
204
+ cssFn?: CSSFn;
205
+ description?: JSX.Element | string;
206
+ iconAfter?: React_2.ReactNode;
207
+ iconBefore?: React_2.ReactNode;
208
+ id: string;
209
+ isDisabled?: boolean;
210
+ isSelected?: boolean;
211
+ onClick?: (event: React_2.KeyboardEvent | React_2.MouseEvent) => void;
212
+ overrides?: NestingItemOverrides;
213
+ testId?: string;
214
+ title: React_2.ReactNode;
234
215
  }
235
216
 
236
217
  // @public (undocumented)
@@ -238,34 +219,32 @@ type NewFooterProps = Omit<HeaderProps, 'component' | 'cssFn' | 'onClick'>;
238
219
 
239
220
  // @public
240
221
  export const Section: React_2.ForwardRefExoticComponent<
241
- SectionProps & React_2.RefAttributes<HTMLElement>
222
+ SectionProps & React_2.RefAttributes<HTMLElement>
242
223
  >;
243
224
 
244
225
  // @public (undocumented)
245
226
  export interface SectionProps {
246
- children: React_2.ReactNode;
247
- hasSeparator?: boolean;
248
- isList?: boolean;
249
- testId?: string;
250
- title?: string;
227
+ children: React_2.ReactNode;
228
+ hasSeparator?: boolean;
229
+ isList?: boolean;
230
+ testId?: string;
231
+ title?: string;
251
232
  }
252
233
 
253
234
  // @public
254
235
  export const SideNavigation: ForwardRefExoticComponent<
255
- SideNavigationProps & RefAttributes<HTMLElement>
236
+ SideNavigationProps & RefAttributes<HTMLElement>
256
237
  >;
257
238
 
258
239
  // @public (undocumented)
259
240
  export interface SideNavigationProps {
260
- children: JSX.Element | JSX.Element[];
261
- label: string;
262
- testId?: string;
241
+ children: JSX.Element | JSX.Element[];
242
+ label: string;
243
+ testId?: string;
263
244
  }
264
245
 
265
246
  // @public
266
- export const SkeletonHeadingItem: (
267
- props: SkeletonHeadingItemProps,
268
- ) => JSX.Element | null;
247
+ export const SkeletonHeadingItem: (props: SkeletonHeadingItemProps) => JSX.Element | null;
269
248
 
270
249
  export { SkeletonHeadingItemProps };
271
250
 
@@ -276,7 +255,7 @@ export { SkeletonItemProps };
276
255
 
277
256
  // @public
278
257
  export const useShouldNestedElementRender: () => {
279
- shouldRender: boolean;
258
+ shouldRender: boolean;
280
259
  };
281
260
 
282
261
  // @public (undocumented)
@@ -296,7 +275,7 @@ export const VAR_SEPARATOR_COLOR = '--ds-menu-seperator-color';
296
275
 
297
276
  ```json
298
277
  {
299
- "react": "^16.8.0"
278
+ "react": "^16.8.0"
300
279
  }
301
280
  ```
302
281