@nxgt/material 1.0.4 → 1.1.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.
- package/LICENSE +21 -0
- package/README.md +447 -51
- package/dist/components.js +3 -2
- package/dist/{dist-BVcMAlfA.js → dist-CwhEp6Y-.js} +4 -4
- package/dist/dnd.js +2 -2
- package/dist/{hooks-BPv0i6YN.js → hooks-CHmfdtMs.js} +81 -47
- package/dist/hooks.js +3 -3
- package/dist/{i18n-1Eg35q8-.js → i18n-D4R3sSqT.js} +102 -0
- package/dist/i18n.js +1 -1
- package/dist/lib/components/index.d.ts +15 -0
- package/dist/lib/components/ui/anchor-heading.d.ts +9 -0
- package/dist/lib/components/ui/anchor-heading.stories.d.ts +13 -0
- package/dist/lib/components/ui/anchor-heading.utils.d.ts +2 -0
- package/dist/lib/components/ui/api-endpoint.d.ts +9 -0
- package/dist/lib/components/ui/api-endpoint.stories.d.ts +14 -0
- package/dist/lib/components/ui/api-operation.d.ts +13 -0
- package/dist/lib/components/ui/api-operation.stories.d.ts +13 -0
- package/dist/lib/components/ui/cards/cards.stories.d.ts +20 -0
- package/dist/lib/components/ui/cards/cards.stories.data.d.ts +8 -0
- package/dist/lib/components/ui/cards/index.d.ts +9 -0
- package/dist/lib/components/ui/cards/partials/crew-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/feature-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/media-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/overlay-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/pricing-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/profile-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/quote-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/partials/spotlight-card.d.ts +2 -0
- package/dist/lib/components/ui/cards/types.d.ts +56 -0
- package/dist/lib/components/ui/code/code-group.d.ts +13 -0
- package/dist/lib/components/ui/code/code-group.stories.d.ts +14 -0
- package/dist/lib/components/ui/code/index.d.ts +2 -0
- package/dist/lib/components/ui/copy-button/copy-button.d.ts +5 -3
- package/dist/lib/components/ui/doc/doc-api.stories.d.ts +13 -0
- package/dist/lib/components/ui/doc/doc-blocks.stories.d.ts +13 -0
- package/dist/lib/components/ui/doc/doc-context.d.ts +61 -0
- package/dist/lib/components/ui/doc/doc.d.ts +11 -0
- package/dist/lib/components/ui/doc/doc.keyboard.d.ts +20 -0
- package/dist/lib/components/ui/doc/doc.keyboard.test.d.ts +1 -0
- package/dist/lib/components/ui/doc/doc.slice.d.ts +97 -0
- package/dist/lib/components/ui/doc/doc.stories.d.ts +15 -0
- package/dist/lib/components/ui/doc/doc.stories.data.d.ts +7 -0
- package/dist/lib/components/ui/doc/doc.utils.d.ts +29 -0
- package/dist/lib/components/ui/doc/doc.utils.test.d.ts +1 -0
- package/dist/lib/components/ui/doc/index.d.ts +36 -0
- package/dist/lib/components/ui/doc/partials/doc-article.d.ts +6 -0
- package/dist/lib/components/ui/doc/partials/doc-child-cards.d.ts +4 -0
- package/dist/lib/components/ui/doc/partials/doc-copy-actions.d.ts +7 -0
- package/dist/lib/components/ui/doc/partials/doc-empty.d.ts +3 -0
- package/dist/lib/components/ui/doc/partials/doc-header.d.ts +18 -0
- package/dist/lib/components/ui/doc/partials/doc-link.d.ts +3 -0
- package/dist/lib/components/ui/doc/partials/doc-nav.d.ts +4 -0
- package/dist/lib/components/ui/doc/partials/doc-page.d.ts +6 -0
- package/dist/lib/components/ui/doc/partials/doc-pager.d.ts +4 -0
- package/dist/lib/components/ui/doc/partials/doc-progress.d.ts +3 -0
- package/dist/lib/components/ui/doc/partials/doc-search.d.ts +1 -0
- package/dist/lib/components/ui/doc/partials/doc-see-also.d.ts +4 -0
- package/dist/lib/components/ui/doc/partials/doc-sidebar.d.ts +4 -0
- package/dist/lib/components/ui/doc/partials/doc-skip-link.d.ts +2 -0
- package/dist/lib/components/ui/doc/partials/doc-toc.d.ts +6 -0
- package/dist/lib/components/ui/doc/partials/doc-topbar.d.ts +4 -0
- package/dist/lib/components/ui/doc/types.d.ts +46 -0
- package/dist/lib/components/ui/doc/use-doc.d.ts +43 -0
- package/dist/lib/components/ui/feedback/empty-state.stories.d.ts +1 -0
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/scroll-progress.d.ts +6 -0
- package/dist/lib/components/ui/feedback/scroll-progress.stories.d.ts +13 -0
- package/dist/lib/components/ui/figure.d.ts +7 -0
- package/dist/lib/components/ui/figure.stories.d.ts +13 -0
- package/dist/lib/components/ui/forms/index.d.ts +1 -0
- package/dist/lib/components/ui/hero.d.ts +10 -0
- package/dist/lib/components/ui/hero.stories.d.ts +13 -0
- package/dist/lib/components/ui/highlight-text.d.ts +6 -0
- package/dist/lib/components/ui/highlight-text.stories.d.ts +12 -0
- package/dist/lib/components/ui/list-tile.d.ts +2 -1
- package/dist/lib/components/ui/list-tile.stories.d.ts +1 -0
- package/dist/lib/components/ui/metrics/index.d.ts +6 -0
- package/dist/lib/components/ui/metrics/metrics.stories.d.ts +16 -0
- package/dist/lib/components/ui/metrics/metrics.stories.data.d.ts +5 -0
- package/dist/lib/components/ui/metrics/partials/breakdown-card.d.ts +2 -0
- package/dist/lib/components/ui/metrics/partials/goal-card.d.ts +2 -0
- package/dist/lib/components/ui/metrics/partials/rank-card.d.ts +2 -0
- package/dist/lib/components/ui/metrics/partials/sparkline.d.ts +5 -0
- package/dist/lib/components/ui/metrics/partials/trend-card.d.ts +2 -0
- package/dist/lib/components/ui/metrics/types.d.ts +35 -0
- package/dist/lib/components/ui/pager.d.ts +20 -0
- package/dist/lib/components/ui/pager.stories.d.ts +13 -0
- package/dist/lib/components/ui/param-table.d.ts +13 -0
- package/dist/lib/components/ui/param-table.stories.d.ts +13 -0
- package/dist/lib/components/ui/see-also.d.ts +17 -0
- package/dist/lib/components/ui/see-also.stories.d.ts +12 -0
- package/dist/lib/components/ui/skip-link.d.ts +3 -0
- package/dist/lib/components/ui/skip-link.stories.d.ts +12 -0
- package/dist/lib/components/ui/steps.d.ts +13 -0
- package/dist/lib/components/ui/steps.stories.d.ts +13 -0
- package/dist/lib/components/ui/tabs.d.ts +4 -1
- package/dist/lib/components/ui/tabs.stories.d.ts +1 -0
- package/dist/lib/components/ui/toc.d.ts +21 -0
- package/dist/lib/components/ui/toc.stories.d.ts +13 -0
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/use-heading-spy.d.ts +6 -0
- package/dist/lib/i18n/resources/en/index.d.ts +57 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +57 -0
- package/dist/lib/i18n/resources/fr/index.d.ts +57 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +57 -0
- package/dist/lib/i18n/resources/index.d.ts +114 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/lib/string.utils.d.ts +9 -0
- package/dist/lib/lib/url.utils.d.ts +2 -0
- package/dist/{lib-CaKARQ-7.js → lib-Rq5clPUe.js} +620 -584
- package/dist/lib.js +3 -3
- package/dist/{main-B-cRR76_.js → main-D7WtUVbv.js} +35341 -33380
- package/dist/main.js +6 -6
- package/dist/material.css +1 -1
- package/package.json +2 -1
|
@@ -2,6 +2,9 @@ export * from './ui/accordion';
|
|
|
2
2
|
export * from './ui/accordion-card';
|
|
3
3
|
export * from './ui/action-card';
|
|
4
4
|
export * from './ui/activity';
|
|
5
|
+
export * from './ui/anchor-heading';
|
|
6
|
+
export * from './ui/api-endpoint';
|
|
7
|
+
export * from './ui/api-operation';
|
|
5
8
|
export * from './ui/app-bar';
|
|
6
9
|
export * from './ui/app-shell';
|
|
7
10
|
export * from './ui/attributes';
|
|
@@ -16,6 +19,7 @@ export * from './ui/breadcrumb';
|
|
|
16
19
|
export * from './ui/buttons';
|
|
17
20
|
export * from './ui/calendar';
|
|
18
21
|
export * from './ui/card';
|
|
22
|
+
export * from './ui/cards';
|
|
19
23
|
export * from './ui/carousel';
|
|
20
24
|
export * from './ui/charts';
|
|
21
25
|
export * from './ui/chat';
|
|
@@ -42,6 +46,7 @@ export * from './ui/date-range-field';
|
|
|
42
46
|
export * from './ui/description';
|
|
43
47
|
export * from './ui/dialog';
|
|
44
48
|
export * from './ui/dnd';
|
|
49
|
+
export * from './ui/doc';
|
|
45
50
|
export * from './ui/drawer';
|
|
46
51
|
export * from './ui/dropdown-menu';
|
|
47
52
|
export * from './ui/duration-field';
|
|
@@ -53,12 +58,15 @@ export * from './ui/event-chip';
|
|
|
53
58
|
export * from './ui/extended-label';
|
|
54
59
|
export * from './ui/feedback';
|
|
55
60
|
export * from './ui/field';
|
|
61
|
+
export * from './ui/figure';
|
|
56
62
|
export * from './ui/file-list';
|
|
57
63
|
export * from './ui/filter';
|
|
58
64
|
export * from './ui/forms';
|
|
59
65
|
export * from './ui/galleries';
|
|
60
66
|
export * from './ui/helper-text';
|
|
67
|
+
export * from './ui/hero';
|
|
61
68
|
export * from './ui/hidrate-loading';
|
|
69
|
+
export * from './ui/highlight-text';
|
|
62
70
|
export * from './ui/hover-card';
|
|
63
71
|
export * from './ui/icon';
|
|
64
72
|
export * from './ui/image-cropper';
|
|
@@ -76,12 +84,15 @@ export * from './ui/layout';
|
|
|
76
84
|
export * from './ui/list-tile';
|
|
77
85
|
export * from './ui/load-more-button';
|
|
78
86
|
export * from './ui/menubar';
|
|
87
|
+
export * from './ui/metrics';
|
|
79
88
|
export * from './ui/navigation-rail';
|
|
80
89
|
export * from './ui/notifications';
|
|
81
90
|
export * from './ui/number-field';
|
|
82
91
|
export * from './ui/opening-hours';
|
|
83
92
|
export * from './ui/otp-field';
|
|
93
|
+
export * from './ui/pager';
|
|
84
94
|
export * from './ui/pagination';
|
|
95
|
+
export * from './ui/param-table';
|
|
85
96
|
export * from './ui/password-field';
|
|
86
97
|
export * from './ui/pdf-viewer';
|
|
87
98
|
export * from './ui/percent-field';
|
|
@@ -97,6 +108,7 @@ export * from './ui/responsive-grid';
|
|
|
97
108
|
export * from './ui/rich-text-editor';
|
|
98
109
|
export * from './ui/scroll-to-top';
|
|
99
110
|
export * from './ui/search-field';
|
|
111
|
+
export * from './ui/see-also';
|
|
100
112
|
export * from './ui/select';
|
|
101
113
|
export * from './ui/select-card-field';
|
|
102
114
|
export * from './ui/select-chip-field';
|
|
@@ -105,11 +117,13 @@ export * from './ui/separator';
|
|
|
105
117
|
export * from './ui/sheet';
|
|
106
118
|
export * from './ui/sidebar';
|
|
107
119
|
export * from './ui/skeleton';
|
|
120
|
+
export * from './ui/skip-link';
|
|
108
121
|
export * from './ui/slider';
|
|
109
122
|
export * from './ui/sortable-list';
|
|
110
123
|
export * from './ui/stat-card';
|
|
111
124
|
export * from './ui/status-indicator';
|
|
112
125
|
export * from './ui/stepper';
|
|
126
|
+
export * from './ui/steps';
|
|
113
127
|
export * from './ui/stx-player';
|
|
114
128
|
export * from './ui/summary-data';
|
|
115
129
|
export * from './ui/switch';
|
|
@@ -124,6 +138,7 @@ export * from './ui/time-field';
|
|
|
124
138
|
export * from './ui/time-picker';
|
|
125
139
|
export * from './ui/timeline';
|
|
126
140
|
export * from './ui/timezone-field';
|
|
141
|
+
export * from './ui/toc';
|
|
127
142
|
export * from './ui/toggle';
|
|
128
143
|
export * from './ui/toggle-group';
|
|
129
144
|
export * from './ui/tooltip';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
export { headingText } from './anchor-heading.utils';
|
|
3
|
+
export type AnchorHeadingProps = {
|
|
4
|
+
level?: 1 | 2 | 3 | 4;
|
|
5
|
+
id?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
} & Omit<ComponentProps<'h2'>, 'children'>;
|
|
9
|
+
export declare function AnchorHeading({ level, id, children, className, ...props }: AnchorHeadingProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { AnchorHeading } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof AnchorHeading;
|
|
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,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ApiEndpointMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
3
|
+
export type ApiEndpointProps = {
|
|
4
|
+
method: ApiEndpointMethod;
|
|
5
|
+
path: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function ApiEndpoint({ method, path, children, className, }: ApiEndpointProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ApiEndpoint } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof ApiEndpoint;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Get: Story;
|
|
14
|
+
export declare const Dark: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ApiEndpointMethod } from './api-endpoint';
|
|
3
|
+
import { CodeGroupTab } from './code/code-group';
|
|
4
|
+
import { ParamTableRow } from './param-table';
|
|
5
|
+
export type ApiOperationProps = {
|
|
6
|
+
method: ApiEndpointMethod;
|
|
7
|
+
path: string;
|
|
8
|
+
params?: ParamTableRow[];
|
|
9
|
+
examples?: CodeGroupTab[];
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function ApiOperation({ method, path, params, examples, children, className, }: ApiOperationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { ApiOperation } from '..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof ApiOperation;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const Get: Story;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 Feature: Story;
|
|
11
|
+
export declare const Media: Story;
|
|
12
|
+
export declare const Pricing: Story;
|
|
13
|
+
export declare const Profile: Story;
|
|
14
|
+
export declare const Quote: Story;
|
|
15
|
+
export declare const Overlay: Story;
|
|
16
|
+
export declare const Spotlight: Story;
|
|
17
|
+
export declare const Crew: Story;
|
|
18
|
+
export declare const Gallery: Story;
|
|
19
|
+
export declare const Phone: Story;
|
|
20
|
+
export declare const Dark: Story;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function FeatureDemo(): import("react").JSX.Element;
|
|
2
|
+
export declare function MediaDemo(): import("react").JSX.Element;
|
|
3
|
+
export declare function PricingDemo(): import("react").JSX.Element;
|
|
4
|
+
export declare function ProfileDemo(): import("react").JSX.Element;
|
|
5
|
+
export declare function QuoteDemo(): import("react").JSX.Element;
|
|
6
|
+
export declare function OverlayDemo(): import("react").JSX.Element;
|
|
7
|
+
export declare function SpotlightDemo(): import("react").JSX.Element;
|
|
8
|
+
export declare function CrewDemo(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { CrewCard } from './partials/crew-card';
|
|
2
|
+
export { FeatureCard } from './partials/feature-card';
|
|
3
|
+
export { MediaCard } from './partials/media-card';
|
|
4
|
+
export { OverlayCard } from './partials/overlay-card';
|
|
5
|
+
export { PricingCard } from './partials/pricing-card';
|
|
6
|
+
export { ProfileCard } from './partials/profile-card';
|
|
7
|
+
export { QuoteCard } from './partials/quote-card';
|
|
8
|
+
export { SpotlightCard } from './partials/spotlight-card';
|
|
9
|
+
export type { CrewCardProps, FeatureCardProps, MediaCardProps, OverlayCardProps, PricingCardProps, ProfileCardProps, QuoteCardProps, SpotlightCardProps, } from './types';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Card } from '../card';
|
|
3
|
+
export type FeatureCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
4
|
+
eyebrow?: ReactNode;
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export type MediaCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
11
|
+
title: ReactNode;
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
media?: ReactNode;
|
|
14
|
+
footer?: ReactNode;
|
|
15
|
+
};
|
|
16
|
+
export type PricingCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
17
|
+
name: ReactNode;
|
|
18
|
+
price: ReactNode;
|
|
19
|
+
period?: ReactNode;
|
|
20
|
+
description?: ReactNode;
|
|
21
|
+
features?: ReactNode[];
|
|
22
|
+
actions?: ReactNode;
|
|
23
|
+
highlighted?: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type ProfileCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
26
|
+
name: ReactNode;
|
|
27
|
+
subtitle?: ReactNode;
|
|
28
|
+
meta?: ReactNode;
|
|
29
|
+
avatar?: ReactNode;
|
|
30
|
+
actions?: ReactNode;
|
|
31
|
+
};
|
|
32
|
+
export type QuoteCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
33
|
+
quote: ReactNode;
|
|
34
|
+
author: ReactNode;
|
|
35
|
+
subtitle?: ReactNode;
|
|
36
|
+
avatar?: ReactNode;
|
|
37
|
+
};
|
|
38
|
+
export type OverlayCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
39
|
+
title: ReactNode;
|
|
40
|
+
description?: ReactNode;
|
|
41
|
+
media?: ReactNode;
|
|
42
|
+
eyebrow?: ReactNode;
|
|
43
|
+
actions?: ReactNode;
|
|
44
|
+
};
|
|
45
|
+
export type SpotlightCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
46
|
+
eyebrow?: ReactNode;
|
|
47
|
+
title: ReactNode;
|
|
48
|
+
description?: ReactNode;
|
|
49
|
+
icon?: ReactNode;
|
|
50
|
+
};
|
|
51
|
+
export type CrewCardProps = Omit<ComponentProps<typeof Card>, 'title'> & {
|
|
52
|
+
title: ReactNode;
|
|
53
|
+
description?: ReactNode;
|
|
54
|
+
people?: ReactNode;
|
|
55
|
+
actions?: ReactNode;
|
|
56
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type CodeGroupTab = {
|
|
3
|
+
label: string;
|
|
4
|
+
code: string;
|
|
5
|
+
language?: string;
|
|
6
|
+
filename?: ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type CodeGroupProps = {
|
|
9
|
+
tabs: CodeGroupTab[];
|
|
10
|
+
showLineNumbers?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function CodeGroup({ tabs, showLineNumbers, className, }: CodeGroupProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { CodeGroup } from '../..';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof CodeGroup;
|
|
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;
|
|
14
|
+
export declare const Dark: Story;
|
|
@@ -2,6 +2,8 @@ export type { CodeBlockProps } from './code-block';
|
|
|
2
2
|
export { CodeBlock } from './code-block';
|
|
3
3
|
export type { CodeDiffProps } from './code-diff';
|
|
4
4
|
export { CodeDiff } from './code-diff';
|
|
5
|
+
export type { CodeGroupProps, CodeGroupTab } from './code-group';
|
|
6
|
+
export { CodeGroup } from './code-group';
|
|
5
7
|
export { highlightCode } from './highlight';
|
|
6
8
|
export type { JsonViewerProps } from './json-viewer';
|
|
7
9
|
export { JsonViewer } from './json-viewer';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { IconButtonProps } from '../buttons';
|
|
2
|
-
export type CopyButtonProps = Omit<IconButtonProps, 'onClick' | 'children' | 'tooltip'> & {
|
|
3
|
-
value: string;
|
|
3
|
+
export type CopyButtonProps = Omit<IconButtonProps, 'onClick' | 'children' | 'tooltip' | 'value'> & {
|
|
4
|
+
value: string | (() => string);
|
|
4
5
|
label?: string;
|
|
5
6
|
copiedLabel?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
6
8
|
};
|
|
7
|
-
export declare function CopyButton({ value, label, copiedLabel, variant, color, ...props }: CopyButtonProps): import("react").JSX.Element;
|
|
9
|
+
export declare function CopyButton({ value, label, copiedLabel, icon, variant, color, ...props }: CopyButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 Dark: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 Gallery: Story;
|
|
13
|
+
export declare const Dark: Story;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DocModel } from './use-doc';
|
|
3
|
+
export type DocContextValue = DocModel;
|
|
4
|
+
export declare function DocProvider({ value, children, }: {
|
|
5
|
+
value: DocContextValue;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function useDocContext(): {
|
|
9
|
+
items: import('./types').DocNavItem[];
|
|
10
|
+
pathname: string;
|
|
11
|
+
toc: import('./types').DocTocItem[];
|
|
12
|
+
brand: ReactNode;
|
|
13
|
+
actions: ReactNode;
|
|
14
|
+
searchable: boolean;
|
|
15
|
+
linkComponent: import('./types').DocLinkComponent | undefined;
|
|
16
|
+
chrome: import('./types').DocChromeState;
|
|
17
|
+
chromeActions: {
|
|
18
|
+
setSidebarOpen: (payload: boolean) => void;
|
|
19
|
+
setSearchOpen: (payload: boolean) => void;
|
|
20
|
+
setQuery: (payload: string) => void;
|
|
21
|
+
setActiveHeadingId: (payload: string | null) => void;
|
|
22
|
+
toggleCollapsed: (payload: string) => void;
|
|
23
|
+
setCollapsedIds: (payload: string[]) => void;
|
|
24
|
+
};
|
|
25
|
+
navigate: (href: string) => void;
|
|
26
|
+
onNavigate: ((href: string) => void) | undefined;
|
|
27
|
+
pager: {
|
|
28
|
+
previous?: import('./types').DocPagerLink;
|
|
29
|
+
next?: import('./types').DocPagerLink;
|
|
30
|
+
};
|
|
31
|
+
hits: import('./types').DocSearchHit[];
|
|
32
|
+
activeHref: string | undefined;
|
|
33
|
+
articleRef: import('react').RefObject<HTMLElement | null>;
|
|
34
|
+
};
|
|
35
|
+
export declare function useOptionalDocContext(): {
|
|
36
|
+
items: import('./types').DocNavItem[];
|
|
37
|
+
pathname: string;
|
|
38
|
+
toc: import('./types').DocTocItem[];
|
|
39
|
+
brand: ReactNode;
|
|
40
|
+
actions: ReactNode;
|
|
41
|
+
searchable: boolean;
|
|
42
|
+
linkComponent: import('./types').DocLinkComponent | undefined;
|
|
43
|
+
chrome: import('./types').DocChromeState;
|
|
44
|
+
chromeActions: {
|
|
45
|
+
setSidebarOpen: (payload: boolean) => void;
|
|
46
|
+
setSearchOpen: (payload: boolean) => void;
|
|
47
|
+
setQuery: (payload: string) => void;
|
|
48
|
+
setActiveHeadingId: (payload: string | null) => void;
|
|
49
|
+
toggleCollapsed: (payload: string) => void;
|
|
50
|
+
setCollapsedIds: (payload: string[]) => void;
|
|
51
|
+
};
|
|
52
|
+
navigate: (href: string) => void;
|
|
53
|
+
onNavigate: ((href: string) => void) | undefined;
|
|
54
|
+
pager: {
|
|
55
|
+
previous?: import('./types').DocPagerLink;
|
|
56
|
+
next?: import('./types').DocPagerLink;
|
|
57
|
+
};
|
|
58
|
+
hits: import('./types').DocSearchHit[];
|
|
59
|
+
activeHref: string | undefined;
|
|
60
|
+
articleRef: import('react').RefObject<HTMLElement | null>;
|
|
61
|
+
} | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { UseDocOptions } from './use-doc';
|
|
3
|
+
export type DocProps = UseDocOptions & {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Documentation site shell. Layout is CSS-first, matching the usual docs
|
|
9
|
+
* breakpoints: one column below `md`, sidebar from `md`, TOC rail from `xl`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function Doc({ children, className, ...options }: DocProps): import("react").JSX.Element;
|
|
@@ -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,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 {};
|