@docusaurus/theme-classic 0.0.0-4364 → 0.0.0-4375

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 (35) hide show
  1. package/lib/theme-classic.d.ts +46 -27
  2. package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +3 -3
  3. package/lib-next/theme/DocItem/index.js +6 -2
  4. package/lib-next/theme/DocSidebar/index.js +1 -1
  5. package/lib-next/theme/DocSidebarItem/index.js +3 -16
  6. package/lib-next/theme/DocSidebarItems/index.js +26 -0
  7. package/lib-next/theme/DocSidebarItems/styles.module.css +19 -0
  8. package/lib-next/theme/Heading/index.js +39 -42
  9. package/lib-next/theme/MDXComponents/index.js +6 -6
  10. package/lib-next/theme/NavbarItem/DefaultNavbarItem.js +4 -66
  11. package/lib-next/theme/NavbarItem/DocNavbarItem.js +1 -1
  12. package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +1 -1
  13. package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +5 -5
  14. package/lib-next/theme/NavbarItem/NavbarNavLink.js +70 -0
  15. package/lib-next/theme/NavbarItem/index.js +0 -2
  16. package/lib-next/theme/NavbarItem/utils.js +9 -0
  17. package/lib-next/theme/hooks/useDocs.js +1 -0
  18. package/package.json +12 -12
  19. package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +3 -3
  20. package/src/theme/DocItem/index.tsx +6 -2
  21. package/src/theme/DocSidebar/index.tsx +1 -1
  22. package/src/theme/DocSidebarItem/index.tsx +3 -19
  23. package/src/theme/DocSidebarItems/index.tsx +31 -0
  24. package/src/theme/DocSidebarItems/styles.module.css +19 -0
  25. package/src/theme/Heading/index.tsx +39 -46
  26. package/src/theme/MDXComponents/index.tsx +6 -6
  27. package/src/theme/NavbarItem/DefaultNavbarItem.tsx +6 -62
  28. package/src/theme/NavbarItem/DocNavbarItem.tsx +1 -1
  29. package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +3 -2
  30. package/src/theme/NavbarItem/DropdownNavbarItem.tsx +5 -5
  31. package/src/theme/NavbarItem/NavbarNavLink.tsx +68 -0
  32. package/src/theme/NavbarItem/index.tsx +0 -3
  33. package/src/theme/NavbarItem/utils.ts +10 -0
  34. package/src/theme/hooks/useDocs.ts +1 -0
  35. package/src/theme-classic.d.ts +46 -27
@@ -149,23 +149,33 @@ declare module '@theme/DocSidebar' {
149
149
  declare module '@theme/DocSidebarItem' {
150
150
  import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
151
151
 
152
- type DocSidebarPropsBase = {
152
+ export type DocSidebarPropsBase = {
153
153
  readonly activePath: string;
154
154
  readonly onItemClick?: (item: PropSidebarItem) => void;
155
155
  readonly level: number;
156
156
  readonly tabIndex?: number;
157
157
  };
158
158
 
159
- export interface Props extends DocSidebarPropsBase {
159
+ export interface Props {
160
+ readonly activePath: string;
161
+ readonly onItemClick?: (item: PropSidebarItem) => void;
162
+ readonly level: number;
163
+ readonly tabIndex?: number;
160
164
  readonly item: PropSidebarItem;
161
165
  }
162
- const DocSidebarItem: (props: Props) => JSX.Element;
163
- export default DocSidebarItem;
164
166
 
165
- export type DocSidebarItemsProps = DocSidebarPropsBase & {
167
+ export default function DocSidebarItem(props: Props): JSX.Element;
168
+ }
169
+
170
+ declare module '@theme/DocSidebarItems' {
171
+ import type {Props as DocSidebarItemProps} from '@theme/DocSidebarItem';
172
+ import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
173
+
174
+ export type Props = Omit<DocSidebarItemProps, 'item'> & {
166
175
  readonly items: readonly PropSidebarItem[];
167
176
  };
168
- export const DocSidebarItems: (props: DocSidebarItemsProps) => JSX.Element;
177
+
178
+ export default function DocSidebarItems(props: Props): JSX.Element;
169
179
  }
170
180
 
171
181
  declare module '@theme/DocVersionSuggestions' {
@@ -196,12 +206,13 @@ declare module '@theme/Footer' {
196
206
  declare module '@theme/Heading' {
197
207
  import type {ComponentProps} from 'react';
198
208
 
199
- export type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
200
- export interface Props extends ComponentProps<HeadingType> {}
209
+ type HeadingType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
210
+
211
+ export interface Props extends ComponentProps<HeadingType> {
212
+ as: HeadingType;
213
+ }
201
214
 
202
- const Heading: (Tag: HeadingType) => (props: Props) => JSX.Element;
203
- export default Heading;
204
- export const MainHeading: (props: Props) => JSX.Element;
215
+ export default function Heading(props: Props): JSX.Element;
205
216
  }
206
217
 
207
218
  declare module '@theme/hooks/useHideableNavbar' {
@@ -372,18 +383,9 @@ declare module '@theme/Navbar' {
372
383
  }
373
384
 
374
385
  declare module '@theme/NavbarItem/DefaultNavbarItem' {
375
- import type {ReactNode} from 'react';
376
- import type {LinkProps} from '@docusaurus/Link';
386
+ import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
377
387
 
378
- export type NavLinkProps = LinkProps & {
379
- readonly activeBasePath?: string;
380
- readonly activeBaseRegex?: string;
381
- readonly exact?: boolean;
382
- readonly label?: ReactNode;
383
- readonly prependBaseUrlToHref?: string;
384
- };
385
-
386
- export type DesktopOrMobileNavBarItemProps = NavLinkProps & {
388
+ export type DesktopOrMobileNavBarItemProps = NavbarNavLinkProps & {
387
389
  readonly isDropdownItem?: boolean;
388
390
  readonly className?: string;
389
391
  readonly position?: 'left' | 'right';
@@ -393,17 +395,30 @@ declare module '@theme/NavbarItem/DefaultNavbarItem' {
393
395
  readonly mobile?: boolean;
394
396
  }
395
397
 
396
- export const NavLink: (props: NavLinkProps) => JSX.Element;
398
+ export default function DefaultNavbarItem(props: Props): JSX.Element;
399
+ }
397
400
 
398
- const DefaultNavbarItem: (props: Props) => JSX.Element;
399
- export default DefaultNavbarItem;
401
+ declare module '@theme/NavbarItem/NavbarNavLink' {
402
+ import type {ReactNode} from 'react';
403
+ import type {LinkProps} from '@docusaurus/Link';
404
+
405
+ export type Props = LinkProps & {
406
+ readonly activeBasePath?: string;
407
+ readonly activeBaseRegex?: string;
408
+ readonly exact?: boolean;
409
+ readonly label?: ReactNode;
410
+ readonly prependBaseUrlToHref?: string;
411
+ };
412
+
413
+ export default function NavbarNavLink(props: Props): JSX.Element;
400
414
  }
401
415
 
402
416
  declare module '@theme/NavbarItem/DropdownNavbarItem' {
403
- import type {NavLinkProps} from '@theme/NavbarItem/DefaultNavbarItem';
417
+ import type {Props as NavbarNavLinkProps} from '@theme/NavbarItem/NavbarNavLink';
418
+
404
419
  import type {LinkLikeNavbarItemProps} from '@theme/NavbarItem';
405
420
 
406
- export type DesktopOrMobileNavBarItemProps = NavLinkProps & {
421
+ export type DesktopOrMobileNavBarItemProps = NavbarNavLinkProps & {
407
422
  readonly position?: 'left' | 'right';
408
423
  readonly items: readonly LinkLikeNavbarItemProps[];
409
424
  readonly className?: string;
@@ -526,6 +541,10 @@ declare module '@theme/NavbarItem' {
526
541
  export default NavbarItem;
527
542
  }
528
543
 
544
+ declare module '@theme/NavbarItem/utils' {
545
+ export function getInfimaActiveClassName(mobile?: boolean): string;
546
+ }
547
+
529
548
  declare module '@theme/PaginatorNavLink' {
530
549
  import type {ReactNode} from 'react';
531
550
  import type {PropNavigationLink} from '@docusaurus/plugin-content-docs';