@nxgt/material 1.0.5 → 1.2.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 (116) hide show
  1. package/README.md +26 -8
  2. package/dist/components.js +3 -2
  3. package/dist/{dist-DdZVa0Zr.js → dist-DNEsJ1nV.js} +2 -2
  4. package/dist/dnd.js +2 -2
  5. package/dist/{hooks-BPv0i6YN.js → hooks-CHmfdtMs.js} +81 -47
  6. package/dist/hooks.js +3 -3
  7. package/dist/{i18n-1Eg35q8-.js → i18n-D4R3sSqT.js} +102 -0
  8. package/dist/i18n.js +1 -1
  9. package/dist/lib/components/index.d.ts +15 -0
  10. package/dist/lib/components/ui/anchor-heading.d.ts +9 -0
  11. package/dist/lib/components/ui/anchor-heading.stories.d.ts +13 -0
  12. package/dist/lib/components/ui/anchor-heading.utils.d.ts +2 -0
  13. package/dist/lib/components/ui/api-endpoint.d.ts +9 -0
  14. package/dist/lib/components/ui/api-endpoint.stories.d.ts +14 -0
  15. package/dist/lib/components/ui/api-operation.d.ts +13 -0
  16. package/dist/lib/components/ui/api-operation.stories.d.ts +13 -0
  17. package/dist/lib/components/ui/cards/cards.stories.d.ts +23 -0
  18. package/dist/lib/components/ui/cards/cards.stories.data.d.ts +11 -0
  19. package/dist/lib/components/ui/cards/index.d.ts +12 -0
  20. package/dist/lib/components/ui/cards/partials/crew-card.d.ts +2 -0
  21. package/dist/lib/components/ui/cards/partials/feature-card.d.ts +2 -0
  22. package/dist/lib/components/ui/cards/partials/media-card.d.ts +2 -0
  23. package/dist/lib/components/ui/cards/partials/notice-card.d.ts +2 -0
  24. package/dist/lib/components/ui/cards/partials/overlay-card.d.ts +2 -0
  25. package/dist/lib/components/ui/cards/partials/pricing-card.d.ts +2 -0
  26. package/dist/lib/components/ui/cards/partials/profile-card.d.ts +2 -0
  27. package/dist/lib/components/ui/cards/partials/quote-card.d.ts +2 -0
  28. package/dist/lib/components/ui/cards/partials/split-card.d.ts +2 -0
  29. package/dist/lib/components/ui/cards/partials/spotlight-card.d.ts +2 -0
  30. package/dist/lib/components/ui/cards/partials/ticket-card.d.ts +2 -0
  31. package/dist/lib/components/ui/cards/types.d.ts +76 -0
  32. package/dist/lib/components/ui/code/code-group.d.ts +13 -0
  33. package/dist/lib/components/ui/code/code-group.stories.d.ts +14 -0
  34. package/dist/lib/components/ui/code/index.d.ts +2 -0
  35. package/dist/lib/components/ui/copy-button/copy-button.d.ts +5 -3
  36. package/dist/lib/components/ui/doc/doc-api.stories.d.ts +13 -0
  37. package/dist/lib/components/ui/doc/doc-blocks.stories.d.ts +13 -0
  38. package/dist/lib/components/ui/doc/doc-context.d.ts +61 -0
  39. package/dist/lib/components/ui/doc/doc.d.ts +11 -0
  40. package/dist/lib/components/ui/doc/doc.keyboard.d.ts +20 -0
  41. package/dist/lib/components/ui/doc/doc.keyboard.test.d.ts +1 -0
  42. package/dist/lib/components/ui/doc/doc.slice.d.ts +97 -0
  43. package/dist/lib/components/ui/doc/doc.stories.d.ts +15 -0
  44. package/dist/lib/components/ui/doc/doc.stories.data.d.ts +7 -0
  45. package/dist/lib/components/ui/doc/doc.utils.d.ts +29 -0
  46. package/dist/lib/components/ui/doc/doc.utils.test.d.ts +1 -0
  47. package/dist/lib/components/ui/doc/index.d.ts +36 -0
  48. package/dist/lib/components/ui/doc/partials/doc-article.d.ts +6 -0
  49. package/dist/lib/components/ui/doc/partials/doc-child-cards.d.ts +4 -0
  50. package/dist/lib/components/ui/doc/partials/doc-copy-actions.d.ts +7 -0
  51. package/dist/lib/components/ui/doc/partials/doc-empty.d.ts +3 -0
  52. package/dist/lib/components/ui/doc/partials/doc-header.d.ts +18 -0
  53. package/dist/lib/components/ui/doc/partials/doc-link.d.ts +3 -0
  54. package/dist/lib/components/ui/doc/partials/doc-nav.d.ts +4 -0
  55. package/dist/lib/components/ui/doc/partials/doc-page.d.ts +6 -0
  56. package/dist/lib/components/ui/doc/partials/doc-pager.d.ts +4 -0
  57. package/dist/lib/components/ui/doc/partials/doc-progress.d.ts +3 -0
  58. package/dist/lib/components/ui/doc/partials/doc-search.d.ts +1 -0
  59. package/dist/lib/components/ui/doc/partials/doc-see-also.d.ts +4 -0
  60. package/dist/lib/components/ui/doc/partials/doc-sidebar.d.ts +4 -0
  61. package/dist/lib/components/ui/doc/partials/doc-skip-link.d.ts +2 -0
  62. package/dist/lib/components/ui/doc/partials/doc-toc.d.ts +6 -0
  63. package/dist/lib/components/ui/doc/partials/doc-topbar.d.ts +4 -0
  64. package/dist/lib/components/ui/doc/types.d.ts +46 -0
  65. package/dist/lib/components/ui/doc/use-doc.d.ts +43 -0
  66. package/dist/lib/components/ui/feedback/empty-state.stories.d.ts +1 -0
  67. package/dist/lib/components/ui/feedback/index.d.ts +1 -0
  68. package/dist/lib/components/ui/feedback/scroll-progress.d.ts +6 -0
  69. package/dist/lib/components/ui/feedback/scroll-progress.stories.d.ts +13 -0
  70. package/dist/lib/components/ui/figure.d.ts +7 -0
  71. package/dist/lib/components/ui/figure.stories.d.ts +13 -0
  72. package/dist/lib/components/ui/hero.d.ts +10 -0
  73. package/dist/lib/components/ui/hero.stories.d.ts +13 -0
  74. package/dist/lib/components/ui/highlight-text.d.ts +6 -0
  75. package/dist/lib/components/ui/highlight-text.stories.d.ts +12 -0
  76. package/dist/lib/components/ui/list-tile.d.ts +2 -1
  77. package/dist/lib/components/ui/list-tile.stories.d.ts +1 -0
  78. package/dist/lib/components/ui/metrics/index.d.ts +6 -0
  79. package/dist/lib/components/ui/metrics/metrics.stories.d.ts +16 -0
  80. package/dist/lib/components/ui/metrics/metrics.stories.data.d.ts +5 -0
  81. package/dist/lib/components/ui/metrics/partials/breakdown-card.d.ts +2 -0
  82. package/dist/lib/components/ui/metrics/partials/goal-card.d.ts +2 -0
  83. package/dist/lib/components/ui/metrics/partials/rank-card.d.ts +2 -0
  84. package/dist/lib/components/ui/metrics/partials/sparkline.d.ts +5 -0
  85. package/dist/lib/components/ui/metrics/partials/trend-card.d.ts +2 -0
  86. package/dist/lib/components/ui/metrics/types.d.ts +35 -0
  87. package/dist/lib/components/ui/pager.d.ts +20 -0
  88. package/dist/lib/components/ui/pager.stories.d.ts +13 -0
  89. package/dist/lib/components/ui/param-table.d.ts +13 -0
  90. package/dist/lib/components/ui/param-table.stories.d.ts +13 -0
  91. package/dist/lib/components/ui/see-also.d.ts +17 -0
  92. package/dist/lib/components/ui/see-also.stories.d.ts +12 -0
  93. package/dist/lib/components/ui/skip-link.d.ts +3 -0
  94. package/dist/lib/components/ui/skip-link.stories.d.ts +12 -0
  95. package/dist/lib/components/ui/steps.d.ts +13 -0
  96. package/dist/lib/components/ui/steps.stories.d.ts +13 -0
  97. package/dist/lib/components/ui/tabs.d.ts +4 -1
  98. package/dist/lib/components/ui/tabs.stories.d.ts +1 -0
  99. package/dist/lib/components/ui/toc.d.ts +21 -0
  100. package/dist/lib/components/ui/toc.stories.d.ts +13 -0
  101. package/dist/lib/hooks/index.d.ts +1 -0
  102. package/dist/lib/hooks/use-heading-spy.d.ts +6 -0
  103. package/dist/lib/i18n/resources/en/index.d.ts +57 -0
  104. package/dist/lib/i18n/resources/en/material.json.d.ts +57 -0
  105. package/dist/lib/i18n/resources/fr/index.d.ts +57 -0
  106. package/dist/lib/i18n/resources/fr/material.json.d.ts +57 -0
  107. package/dist/lib/i18n/resources/index.d.ts +114 -0
  108. package/dist/lib/i18n/translator.d.ts +1 -1
  109. package/dist/lib/lib/string.utils.d.ts +9 -0
  110. package/dist/lib/lib/url.utils.d.ts +2 -0
  111. package/dist/{lib-CaKARQ-7.js → lib-Rq5clPUe.js} +620 -584
  112. package/dist/lib.js +3 -3
  113. package/dist/{main-CHByIwHT.js → main-Df-oZmsh.js} +35823 -33747
  114. package/dist/main.js +6 -6
  115. package/dist/material.css +1 -1
  116. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ export type DocKeyboardActions = {
2
+ openSearch: () => void;
3
+ closeOverlays: () => void;
4
+ goPrevious?: () => void;
5
+ goNext?: () => void;
6
+ };
7
+ export declare function isTypingTarget(target: unknown): boolean;
8
+ export declare function isDocSearchHotkey(event: {
9
+ key: string;
10
+ metaKey: boolean;
11
+ ctrlKey: boolean;
12
+ }): boolean;
13
+ export declare function handleDocKeyDown(event: {
14
+ key: string;
15
+ metaKey: boolean;
16
+ ctrlKey: boolean;
17
+ altKey?: boolean;
18
+ target?: unknown;
19
+ preventDefault: () => void;
20
+ }, actions: DocKeyboardActions): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,97 @@
1
+ import { PayloadAction } from '@reduxjs/toolkit';
2
+ import { DocChromeState } from './types';
3
+ export declare const docSlice: import('@reduxjs/toolkit').Slice<DocChromeState, {
4
+ setSidebarOpen: (state: {
5
+ sidebarOpen: boolean;
6
+ searchOpen: boolean;
7
+ query: string;
8
+ activeHeadingId: string | null;
9
+ collapsedIds: string[];
10
+ }, action: PayloadAction<boolean>) => void;
11
+ setSearchOpen: (state: {
12
+ sidebarOpen: boolean;
13
+ searchOpen: boolean;
14
+ query: string;
15
+ activeHeadingId: string | null;
16
+ collapsedIds: string[];
17
+ }, action: PayloadAction<boolean>) => void;
18
+ setQuery: (state: {
19
+ sidebarOpen: boolean;
20
+ searchOpen: boolean;
21
+ query: string;
22
+ activeHeadingId: string | null;
23
+ collapsedIds: string[];
24
+ }, action: PayloadAction<string>) => void;
25
+ setActiveHeadingId: (state: {
26
+ sidebarOpen: boolean;
27
+ searchOpen: boolean;
28
+ query: string;
29
+ activeHeadingId: string | null;
30
+ collapsedIds: string[];
31
+ }, action: PayloadAction<string | null>) => void;
32
+ toggleCollapsed: (state: {
33
+ sidebarOpen: boolean;
34
+ searchOpen: boolean;
35
+ query: string;
36
+ activeHeadingId: string | null;
37
+ collapsedIds: string[];
38
+ }, action: PayloadAction<string>) => void;
39
+ setCollapsedIds: (state: {
40
+ sidebarOpen: boolean;
41
+ searchOpen: boolean;
42
+ query: string;
43
+ activeHeadingId: string | null;
44
+ collapsedIds: string[];
45
+ }, action: PayloadAction<string[]>) => void;
46
+ }, "doc", "doc", import('@reduxjs/toolkit').SliceSelectors<DocChromeState>>;
47
+ export declare const docActions: import('@reduxjs/toolkit').CaseReducerActions<{
48
+ setSidebarOpen: (state: {
49
+ sidebarOpen: boolean;
50
+ searchOpen: boolean;
51
+ query: string;
52
+ activeHeadingId: string | null;
53
+ collapsedIds: string[];
54
+ }, action: PayloadAction<boolean>) => void;
55
+ setSearchOpen: (state: {
56
+ sidebarOpen: boolean;
57
+ searchOpen: boolean;
58
+ query: string;
59
+ activeHeadingId: string | null;
60
+ collapsedIds: string[];
61
+ }, action: PayloadAction<boolean>) => void;
62
+ setQuery: (state: {
63
+ sidebarOpen: boolean;
64
+ searchOpen: boolean;
65
+ query: string;
66
+ activeHeadingId: string | null;
67
+ collapsedIds: string[];
68
+ }, action: PayloadAction<string>) => void;
69
+ setActiveHeadingId: (state: {
70
+ sidebarOpen: boolean;
71
+ searchOpen: boolean;
72
+ query: string;
73
+ activeHeadingId: string | null;
74
+ collapsedIds: string[];
75
+ }, action: PayloadAction<string | null>) => void;
76
+ toggleCollapsed: (state: {
77
+ sidebarOpen: boolean;
78
+ searchOpen: boolean;
79
+ query: string;
80
+ activeHeadingId: string | null;
81
+ collapsedIds: string[];
82
+ }, action: PayloadAction<string>) => void;
83
+ setCollapsedIds: (state: {
84
+ sidebarOpen: boolean;
85
+ searchOpen: boolean;
86
+ query: string;
87
+ activeHeadingId: string | null;
88
+ collapsedIds: string[];
89
+ }, action: PayloadAction<string[]>) => void;
90
+ }, "doc">;
91
+ export declare const docSelectors: {
92
+ selectSidebarOpen: (state: DocChromeState) => boolean;
93
+ selectSearchOpen: (state: DocChromeState) => boolean;
94
+ selectQuery: (state: DocChromeState) => string;
95
+ selectActiveHeadingId: (state: DocChromeState) => string | null;
96
+ selectIsCollapsed: (state: DocChromeState, id: string) => boolean;
97
+ };
@@ -0,0 +1,15 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Doc } from '../..';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Doc;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
13
+ export declare const Phone: Story;
14
+ export declare const Dark: Story;
15
+ export declare const NotFound: Story;
@@ -0,0 +1,7 @@
1
+ import { DocNavItem, DocTocItem } from './types';
2
+ export declare const ITEMS: DocNavItem[];
3
+ export declare const TOC: Record<string, DocTocItem[]>;
4
+ export declare const PAGES: Record<string, {
5
+ title: string;
6
+ description: string;
7
+ }>;
@@ -0,0 +1,29 @@
1
+ import { slugify } from '../../../lib/string.utils';
2
+ import { headingText } from '../anchor-heading.utils';
3
+ import { DocNavItem, DocPagerLink, DocSearchHit } from './types';
4
+ export { headingText, slugify };
5
+ export declare function navLabel(item: DocNavItem): string;
6
+ /**
7
+ * Whether `href` covers `pathname` — an exact match, or a whole-segment prefix.
8
+ * `/docs` covers `/docs/install` but not `/docs-old`.
9
+ */
10
+ export declare function isDocPathActive(pathname: string, href: string): boolean;
11
+ export declare function flattenDocNav(items: DocNavItem[], group?: string): DocSearchHit[];
12
+ /**
13
+ * The nav href to light for the current path: the longest one that covers it.
14
+ */
15
+ export declare function findActiveDocHref(items: DocNavItem[], pathname: string): string | undefined;
16
+ export declare function findDocPager(items: DocNavItem[], pathname: string): {
17
+ previous?: DocPagerLink;
18
+ next?: DocPagerLink;
19
+ };
20
+ export { isExternalHref } from '../../../lib/url.utils';
21
+ /** Child pages of the nav entry whose href is exactly `pathname`. */
22
+ export declare function findDocChildren(items: DocNavItem[], pathname: string): DocNavItem[];
23
+ /** Other href children of the parent that contains `pathname`. */
24
+ export declare function findDocSiblings(items: DocNavItem[], pathname: string): DocNavItem[];
25
+ /**
26
+ * Keep items whose label matches `query`, plus ancestors.
27
+ * A matching parent keeps its full subtree.
28
+ */
29
+ export declare function filterDocNav(items: DocNavItem[], query: string): DocNavItem[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ export type { DocProps } from './doc';
2
+ export { Doc } from './doc';
3
+ export { handleDocKeyDown, isDocSearchHotkey, isTypingTarget, } from './doc.keyboard';
4
+ export { docActions, docSelectors, docSlice } from './doc.slice';
5
+ export { filterDocNav, findActiveDocHref, findDocChildren, findDocPager, findDocSiblings, flattenDocNav, headingText, isDocPathActive, isExternalHref, navLabel, slugify, } from './doc.utils';
6
+ export { DocProvider, useDocContext, useOptionalDocContext, } from './doc-context';
7
+ export type { DocArticleProps } from './partials/doc-article';
8
+ export { DocArticle } from './partials/doc-article';
9
+ export { DocChildCards } from './partials/doc-child-cards';
10
+ export { DocCopyMarkdown, DocCopyPage } from './partials/doc-copy-actions';
11
+ export type { DocEmptyProps } from './partials/doc-empty';
12
+ export { DocEmpty } from './partials/doc-empty';
13
+ export type { DocHeaderCrumb, DocHeaderProps } from './partials/doc-header';
14
+ export { DocHeader } from './partials/doc-header';
15
+ export { DefaultDocLink, DocLink } from './partials/doc-link';
16
+ export type { DocNavProps } from './partials/doc-nav';
17
+ export { DocNav } from './partials/doc-nav';
18
+ export type { DocPageProps } from './partials/doc-page';
19
+ export { DocPage } from './partials/doc-page';
20
+ export type { DocPagerProps } from './partials/doc-pager';
21
+ export { DocPager } from './partials/doc-pager';
22
+ export type { DocProgressProps } from './partials/doc-progress';
23
+ export { DocProgress } from './partials/doc-progress';
24
+ export { DocSearch } from './partials/doc-search';
25
+ export type { DocSeeAlsoProps } from './partials/doc-see-also';
26
+ export { DocSeeAlso } from './partials/doc-see-also';
27
+ export type { DocSidebarProps } from './partials/doc-sidebar';
28
+ export { DocSidebar } from './partials/doc-sidebar';
29
+ export { DocSkipLink } from './partials/doc-skip-link';
30
+ export type { DocTocProps } from './partials/doc-toc';
31
+ export { DocToc } from './partials/doc-toc';
32
+ export type { DocTopbarProps } from './partials/doc-topbar';
33
+ export { DocTopbar } from './partials/doc-topbar';
34
+ export type { DocChromeState, DocLinkComponent, DocLinkProps, DocNavItem, DocPagerLink, DocSearchHit, DocTocItem, } from './types';
35
+ export type { DocModel, UseDocOptions } from './use-doc';
36
+ export { useDoc } from './use-doc';
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ export type DocArticleProps = {
3
+ children?: ReactNode;
4
+ className?: string;
5
+ };
6
+ export declare function DocArticle({ children, className }: DocArticleProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DocChildCardsProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocChildCards({ className }: DocChildCardsProps): import("react").JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function DocCopyPage({ title }: {
3
+ title: ReactNode;
4
+ }): import("react").JSX.Element;
5
+ export declare function DocCopyMarkdown({ markdown }: {
6
+ markdown?: string;
7
+ }): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { EmptyStateProps } from '../../feedback/empty-state';
2
+ export type DocEmptyProps = EmptyStateProps;
3
+ export declare function DocEmpty({ variant, className, ...props }: DocEmptyProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export type DocHeaderCrumb = {
3
+ title: ReactNode;
4
+ href?: string;
5
+ };
6
+ export type DocHeaderProps = {
7
+ title: ReactNode;
8
+ description?: ReactNode;
9
+ badge?: ReactNode;
10
+ crumbs?: DocHeaderCrumb[];
11
+ editHref?: string;
12
+ updatedAt?: ReactNode | Date;
13
+ copyPage?: boolean;
14
+ copyMarkdown?: boolean;
15
+ markdown?: string;
16
+ className?: string;
17
+ };
18
+ export declare function DocHeader({ title, description, badge, crumbs, editHref, updatedAt, copyPage, copyMarkdown, markdown, className, }: DocHeaderProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { DocLinkProps } from '../types';
2
+ export declare function DefaultDocLink({ href, className, children, onClick, ...props }: DocLinkProps): import("react").JSX.Element;
3
+ export declare function DocLink({ href, className, onClick, children, ...props }: DocLinkProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DocNavProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocNav({ className }: DocNavProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { DocHeaderProps } from './doc-header';
3
+ export type DocPageProps = DocHeaderProps & {
4
+ children?: ReactNode;
5
+ };
6
+ export declare function DocPage({ children, className, ...header }: DocPageProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DocPagerProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocPager({ className }: DocPagerProps): import("react").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { ScrollProgressProps } from '../../feedback/scroll-progress';
2
+ export type DocProgressProps = ScrollProgressProps;
3
+ export declare function DocProgress(props: DocProgressProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function DocSearch(): import("react").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ export type DocSeeAlsoProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocSeeAlso({ className }: DocSeeAlsoProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DocSidebarProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocSidebar({ className }: DocSidebarProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SkipLinkProps } from '../../skip-link';
2
+ export declare function DocSkipLink(props: SkipLinkProps): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export type DocTocProps = {
2
+ className?: string;
3
+ /** `rail` is the xl+ column. `panel` is the in-page collapsible used below xl. */
4
+ placement?: 'rail' | 'panel';
5
+ };
6
+ export declare function DocToc({ className, placement }: DocTocProps): import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export type DocTopbarProps = {
2
+ className?: string;
3
+ };
4
+ export declare function DocTopbar({ className }: DocTopbarProps): import("react").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { ComponentType, MouseEventHandler, ReactNode } from 'react';
2
+ export type DocLinkProps = {
3
+ href: string;
4
+ className?: string;
5
+ children?: ReactNode;
6
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
7
+ };
8
+ export type DocLinkComponent = ComponentType<DocLinkProps>;
9
+ export type DocNavItem = {
10
+ id: string;
11
+ title: ReactNode;
12
+ /** Plain-text label for search and aria. Defaults to `title` when it is a string. */
13
+ label?: string;
14
+ href?: string;
15
+ icon?: ReactNode;
16
+ badge?: ReactNode;
17
+ description?: ReactNode;
18
+ items?: DocNavItem[];
19
+ disabled?: boolean;
20
+ };
21
+ export type DocTocItem = {
22
+ id: string;
23
+ title: ReactNode;
24
+ level: 2 | 3 | 4;
25
+ };
26
+ export type DocPagerLink = {
27
+ title: ReactNode;
28
+ href: string;
29
+ description?: ReactNode;
30
+ };
31
+ export type DocSearchHit = {
32
+ id: string;
33
+ title: string;
34
+ href: string;
35
+ group?: string;
36
+ icon?: ReactNode;
37
+ description?: string;
38
+ disabled?: boolean;
39
+ };
40
+ export type DocChromeState = {
41
+ sidebarOpen: boolean;
42
+ searchOpen: boolean;
43
+ query: string;
44
+ activeHeadingId: string | null;
45
+ collapsedIds: string[];
46
+ };
@@ -0,0 +1,43 @@
1
+ import { ReactNode } from 'react';
2
+ import { DocLinkComponent, DocNavItem, DocPagerLink, DocTocItem } from './types';
3
+ export type UseDocOptions = {
4
+ items: DocNavItem[];
5
+ pathname: string;
6
+ toc?: DocTocItem[];
7
+ brand?: ReactNode;
8
+ actions?: ReactNode;
9
+ searchable?: boolean;
10
+ onNavigate?: (href: string) => void;
11
+ linkComponent?: DocLinkComponent;
12
+ previous?: DocPagerLink | null;
13
+ next?: DocPagerLink | null;
14
+ defaultCollapsedIds?: string[];
15
+ };
16
+ export declare function useDoc({ items, pathname, toc, brand, actions, searchable, onNavigate, linkComponent, previous, next, defaultCollapsedIds, }: UseDocOptions): {
17
+ items: DocNavItem[];
18
+ pathname: string;
19
+ toc: DocTocItem[];
20
+ brand: ReactNode;
21
+ actions: ReactNode;
22
+ searchable: boolean;
23
+ linkComponent: DocLinkComponent | undefined;
24
+ chrome: import('./types').DocChromeState;
25
+ chromeActions: {
26
+ setSidebarOpen: (payload: boolean) => void;
27
+ setSearchOpen: (payload: boolean) => void;
28
+ setQuery: (payload: string) => void;
29
+ setActiveHeadingId: (payload: string | null) => void;
30
+ toggleCollapsed: (payload: string) => void;
31
+ setCollapsedIds: (payload: string[]) => void;
32
+ };
33
+ navigate: (href: string) => void;
34
+ onNavigate: ((href: string) => void) | undefined;
35
+ pager: {
36
+ previous?: DocPagerLink;
37
+ next?: DocPagerLink;
38
+ };
39
+ hits: import('./types').DocSearchHit[];
40
+ activeHref: string | undefined;
41
+ articleRef: import('react').RefObject<HTMLElement | null>;
42
+ };
43
+ export type DocModel = ReturnType<typeof useDoc>;
@@ -8,4 +8,5 @@ export declare const Empty: Story;
8
8
  export declare const NotFound: Story;
9
9
  export declare const Unauthorized: Story;
10
10
  export declare const WithAction: Story;
11
+ export declare const Dark: Story;
11
12
  export declare const FullyCustom: Story;
@@ -8,6 +8,7 @@ export * from './custom-dialog';
8
8
  export * from './empty-state';
9
9
  export * from './progress';
10
10
  export * from './progress-field';
11
+ export * from './scroll-progress';
11
12
  export * from './spinner';
12
13
  export * from './toast';
13
14
  export * from './toasts';
@@ -0,0 +1,6 @@
1
+ import { ComponentProps, RefObject } from 'react';
2
+ export type ScrollProgressProps = ComponentProps<'div'> & {
3
+ /** Scrollable element. Defaults to the window. */
4
+ target?: RefObject<HTMLElement | null>;
5
+ };
6
+ export declare function ScrollProgress({ className, target, 'aria-label': ariaLabel, ...props }: ScrollProgressProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { ScrollProgress } from './scroll-progress';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof ScrollProgress;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Window: Story;
13
+ export declare const InContainer: Story;
@@ -0,0 +1,7 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ export type FigureProps = {
3
+ caption?: ReactNode;
4
+ children?: ReactNode;
5
+ className?: string;
6
+ } & Omit<ComponentProps<'figure'>, 'children'>;
7
+ export declare function Figure({ caption, children, className, ...props }: FigureProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Figure } from '..';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Figure;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ export type HeroProps = {
3
+ eyebrow?: ReactNode;
4
+ title: ReactNode;
5
+ description?: ReactNode;
6
+ actions?: ReactNode;
7
+ children?: ReactNode;
8
+ className?: string;
9
+ };
10
+ export declare function Hero({ eyebrow, title, description, actions, children, className, }: HeroProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { Hero } from '..';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof Hero;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ tags: string[];
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const Default: Story;
@@ -0,0 +1,6 @@
1
+ export type HighlightTextProps = {
2
+ text: string;
3
+ query?: string;
4
+ className?: string;
5
+ };
6
+ export declare function HighlightText({ text, query, className, }: HighlightTextProps): import("react").JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ import { HighlightText } from './highlight-text';
3
+ declare const meta: {
4
+ title: string;
5
+ component: typeof HighlightText;
6
+ parameters: {
7
+ layout: string;
8
+ };
9
+ };
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+ export declare const Default: Story;
@@ -5,8 +5,9 @@ export type ListTileProps = {
5
5
  title: ReactNode;
6
6
  subtitle?: ReactNode;
7
7
  selected?: boolean;
8
+ size?: 'sm' | 'md';
8
9
  href?: string;
9
10
  disabled?: boolean;
10
11
  onClick?: MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>;
11
12
  } & Omit<HTMLAttributes<HTMLElement>, 'children' | 'title' | 'onClick'>;
12
- export declare function ListTile({ title, subtitle, leading, trailing, className, selected, href, disabled, onClick, ...props }: ListTileProps): import("react").JSX.Element;
13
+ export declare function ListTile({ title, subtitle, leading, trailing, className, selected, size, href, disabled, onClick, ...props }: ListTileProps): import("react").JSX.Element;
@@ -12,6 +12,7 @@ export default meta;
12
12
  type Story = StoryObj<typeof meta>;
13
13
  export declare const Default: Story;
14
14
  export declare const Leading: Story;
15
+ export declare const Small: Story;
15
16
  export declare const Selected: Story;
16
17
  export declare const Clickable: Story;
17
18
  export declare const AsLink: Story;
@@ -0,0 +1,6 @@
1
+ export { BreakdownCard } from './partials/breakdown-card';
2
+ export { GoalCard } from './partials/goal-card';
3
+ export { RankCard } from './partials/rank-card';
4
+ export { Sparkline } from './partials/sparkline';
5
+ export { TrendCard } from './partials/trend-card';
6
+ export type { BreakdownCardProps, BreakdownItem, GoalCardProps, RankCardProps, RankItem, TrendCardProps, } from './types';
@@ -0,0 +1,16 @@
1
+ import { StoryObj } from '@storybook/react';
2
+ declare const meta: {
3
+ title: string;
4
+ parameters: {
5
+ layout: string;
6
+ };
7
+ };
8
+ export default meta;
9
+ type Story = StoryObj<typeof meta>;
10
+ export declare const Trend: Story;
11
+ export declare const Goal: Story;
12
+ export declare const Breakdown: Story;
13
+ export declare const Rank: Story;
14
+ export declare const Dashboard: Story;
15
+ export declare const Phone: Story;
16
+ export declare const Dark: Story;
@@ -0,0 +1,5 @@
1
+ export declare const SERIES: number[];
2
+ export declare function TrendDemo(): import("react").JSX.Element;
3
+ export declare function GoalDemo(): import("react").JSX.Element;
4
+ export declare function BreakdownDemo(): import("react").JSX.Element;
5
+ export declare function RankDemo(): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { BreakdownCardProps } from '../types';
2
+ export declare function BreakdownCard({ label, items, className, ...props }: BreakdownCardProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { GoalCardProps } from '../types';
2
+ export declare function GoalCard({ label, value, target, unit, className, ...props }: GoalCardProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { RankCardProps } from '../types';
2
+ export declare function RankCard({ label, items, className, ...props }: RankCardProps): import("react").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type SparklineProps = {
2
+ series: number[];
3
+ className?: string;
4
+ };
5
+ export declare function Sparkline({ series, className }: SparklineProps): import("react").JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { TrendCardProps } from '../types';
2
+ export declare function TrendCard({ label, value, delta, deltaTone, series, className, ...props }: TrendCardProps): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import { Card } from '../card';
3
+ import { StatDeltaTone } from '../stat-card/format-stat-delta';
4
+ export type TrendCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
5
+ label: ReactNode;
6
+ value: ReactNode;
7
+ delta?: number | ReactNode;
8
+ deltaTone?: StatDeltaTone;
9
+ series?: number[];
10
+ };
11
+ export type GoalCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
12
+ label: ReactNode;
13
+ value: number;
14
+ target: number;
15
+ unit?: ReactNode;
16
+ };
17
+ export type BreakdownItem = {
18
+ label: ReactNode;
19
+ value?: ReactNode;
20
+ percent: number;
21
+ };
22
+ export type BreakdownCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
23
+ label: ReactNode;
24
+ items: BreakdownItem[];
25
+ };
26
+ export type RankItem = {
27
+ title: ReactNode;
28
+ subtitle?: ReactNode;
29
+ trailing?: ReactNode;
30
+ rank?: number;
31
+ };
32
+ export type RankCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
33
+ label: ReactNode;
34
+ items: RankItem[];
35
+ };