@twreporter/react-components 9.4.4 → 9.5.0-rc.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/lib/badge/badge.stories.d.ts +13 -0
- package/lib/badge/index.d.ts +14 -0
- package/lib/bookmark-list/bookmark.d.ts +9 -0
- package/lib/bookmark-list/bookmarks.d.ts +15 -0
- package/lib/bookmark-list/customized-link.d.ts +19 -0
- package/lib/bookmark-list/image-wrapper.d.ts +27 -0
- package/lib/bookmark-list/index.d.ts +26 -0
- package/lib/bookmark-list/redirect-to-sign-in.d.ts +9 -0
- package/lib/bookmark-list/stories/bookmark.stories.d.ts +9 -0
- package/lib/bookmark-widget/index.d.ts +13 -0
- package/lib/button/components/iconButton.d.ts +22 -0
- package/lib/button/components/iconWithTextButton.d.ts +21 -0
- package/lib/button/components/link.d.ts +45 -0
- package/lib/button/components/menuButton.d.ts +29 -0
- package/lib/button/components/pillButton.d.ts +34 -0
- package/lib/button/components/textButton.d.ts +32 -0
- package/lib/button/components/toggleButton.d.ts +18 -0
- package/lib/button/enums/index.d.ts +13 -0
- package/lib/button/index.d.ts +20 -0
- package/lib/button/stories/iconButton.stories.d.ts +42 -0
- package/lib/button/stories/iconWithTextButton.stories.d.ts +37 -0
- package/lib/button/stories/link.stories.d.ts +139 -0
- package/lib/button/stories/menuButton.stories.d.ts +26 -0
- package/lib/button/stories/pillButton.stories.d.ts +92 -0
- package/lib/button/stories/textButton.stories.d.ts +85 -0
- package/lib/button/stories/toggleButton.stories.d.ts +22 -0
- package/lib/button/utils/size.d.ts +8 -0
- package/lib/button/utils/theme.d.ts +218 -0
- package/lib/card/components/article-card.d.ts +34 -0
- package/lib/card/components/dialog.d.ts +14 -0
- package/lib/card/components/short-story.d.ts +26 -0
- package/lib/card/index.d.ts +10 -0
- package/lib/card/stories/articleCard.stories.d.ts +30 -0
- package/lib/card/stories/dialog.stories.d.ts +23 -0
- package/lib/card/stories/shortStory.stories.d.ts +37 -0
- package/lib/checkbox/checkbox.stories.d.ts +21 -0
- package/lib/checkbox/index.d.ts +16 -0
- package/lib/color.stories.d.ts +63 -0
- package/lib/confirmation/index.d.ts +25 -0
- package/lib/customized-link.d.ts +12 -0
- package/lib/divider.d.ts +15 -0
- package/lib/divider.stories.d.ts +33 -0
- package/lib/donation-link.d.ts +10 -0
- package/lib/empty-state/enums/index.d.ts +5 -0
- package/lib/empty-state/index.d.ts +30 -0
- package/lib/empty-state/stories/empty-guide.stories.d.ts +29 -0
- package/lib/error/index.d.ts +8 -0
- package/lib/error/message.d.ts +9 -0
- package/lib/footer/constants/links.d.ts +19 -0
- package/lib/footer/footer.stories.d.ts +15 -0
- package/lib/footer/index.d.ts +9 -0
- package/lib/footer/link.d.ts +18 -0
- package/lib/footer/logo.d.ts +9 -0
- package/lib/hook/index.d.ts +10 -0
- package/lib/hook/use-bookmark.d.ts +15 -0
- package/lib/hook/use-font-face-observer.d.ts +2 -0
- package/lib/hook/use-outside-click.d.ts +2 -0
- package/lib/icon/enum/index.d.ts +25 -0
- package/lib/icon/index.d.ts +227 -0
- package/lib/icon/index.js +4 -2
- package/lib/icon/stories/arrow.stories.d.ts +72 -0
- package/lib/icon/stories/article.stories.d.ts +11 -0
- package/lib/icon/stories/bookmark.stories.d.ts +57 -0
- package/lib/icon/stories/changeIconColor.stories.d.ts +23 -0
- package/lib/icon/stories/clock.stories.d.ts +11 -0
- package/lib/icon/stories/copy.stories.d.ts +11 -0
- package/lib/icon/stories/cross.stories.d.ts +11 -0
- package/lib/icon/stories/filter.stories.d.ts +11 -0
- package/lib/icon/stories/filter.stories.js +16 -0
- package/lib/icon/stories/hamburger.stories.d.ts +11 -0
- package/lib/icon/stories/home.stories.d.ts +11 -0
- package/lib/icon/stories/letter.stories.d.ts +11 -0
- package/lib/icon/stories/loading.stories.d.ts +11 -0
- package/lib/icon/stories/member.stories.d.ts +11 -0
- package/lib/icon/stories/printer.stories.d.ts +11 -0
- package/lib/icon/stories/search.stories.d.ts +11 -0
- package/lib/icon/stories/share.stories.d.ts +11 -0
- package/lib/icon/stories/socialMedia.stories.d.ts +25 -0
- package/lib/icon/stories/text.stories.d.ts +11 -0
- package/lib/icon/stories/topic.stories.d.ts +11 -0
- package/lib/image-with-fallback.d.ts +16 -0
- package/lib/input/components/search-bar.d.ts +29 -0
- package/lib/input/components/text-field.d.ts +26 -0
- package/lib/input/enums/index.d.ts +13 -0
- package/lib/input/index.d.ts +8 -0
- package/lib/input/stories/search-bar.stories.d.ts +33 -0
- package/lib/input/stories/text-field.stories.d.ts +37 -0
- package/lib/input/utils/theme.d.ts +17 -0
- package/lib/is-fetching-wrapper.d.ts +14 -0
- package/lib/junior-link.d.ts +7 -0
- package/lib/link-with-tracker.d.ts +29 -0
- package/lib/listing-page/components/card-list.d.ts +20 -0
- package/lib/listing-page/components/image.d.ts +29 -0
- package/lib/listing-page/components/list-item.d.ts +27 -0
- package/lib/listing-page/components/list.d.ts +31 -0
- package/lib/listing-page/components/page-content.d.ts +2 -0
- package/lib/listing-page/components/topics/index.d.ts +25 -0
- package/lib/listing-page/components/topics/post-item.d.ts +19 -0
- package/lib/listing-page/components/topics/posts.d.ts +2 -0
- package/lib/listing-page/components/topics/section.d.ts +20 -0
- package/lib/listing-page/components/topics/topic-item.d.ts +22 -0
- package/lib/listing-page/constants/mockup-spec.d.ts +46 -0
- package/lib/listing-page/constants/predefined-css.d.ts +2 -0
- package/lib/listing-page/constants/prop-types.d.ts +1 -0
- package/lib/listing-page/constants/topics.d.ts +6 -0
- package/lib/listing-page/index.d.ts +10 -0
- package/lib/listing-page/stories/cardList.stories.d.ts +72 -0
- package/lib/logo/components/logo-footer.d.ts +17 -0
- package/lib/logo/components/logo-header.d.ts +18 -0
- package/lib/logo/components/logo-loading-fallback.d.ts +10 -0
- package/lib/logo/components/logo-symbol.d.ts +19 -0
- package/lib/logo/index.d.ts +12 -0
- package/lib/logo/stories/logoFooter.stories.d.ts +11 -0
- package/lib/logo/stories/logoHeader.stories.d.ts +15 -0
- package/lib/logo/stories/logoLoadingFallback.stories.d.ts +11 -0
- package/lib/logo/stories/logoSymbol.stories.d.ts +15 -0
- package/lib/logo/utils/path.d.ts +5 -0
- package/lib/material-icon.d.ts +17 -0
- package/lib/mobile-member-role-card/index.d.ts +26 -0
- package/lib/mobile-member-role-card/stories/member-role-card.stories.d.ts +34 -0
- package/lib/mobile-pop-up-modal.d.ts +28 -0
- package/lib/more.d.ts +10 -0
- package/lib/pagination/index.d.ts +36 -0
- package/lib/podcast-link.d.ts +7 -0
- package/lib/rwd.d.ts +5 -0
- package/lib/shared-enum.d.ts +4 -0
- package/lib/side-bar/index.d.ts +81 -0
- package/lib/simple-header/index.d.ts +2 -0
- package/lib/simple-header/simpleHeader.stories.d.ts +9 -0
- package/lib/snack-bar/components/snack-bar.d.ts +13 -0
- package/lib/snack-bar/hooks/use-snack-bar.d.ts +9 -0
- package/lib/snack-bar/index.d.ts +8 -0
- package/lib/snack-bar/stories/snackBar.stories.d.ts +28 -0
- package/lib/snack-bar/utils/theme.d.ts +11 -0
- package/lib/storybook/constants/index.d.ts +21 -0
- package/lib/storybook/utils/get-enum-arg.d.ts +7 -0
- package/lib/table-of-contents/index.d.ts +200 -0
- package/lib/text/constants/headline-type.d.ts +4 -0
- package/lib/text/enums/index.d.ts +9 -0
- package/lib/text/headline.d.ts +60 -0
- package/lib/text/paragraph.d.ts +49 -0
- package/lib/text/stories/headline.stories.d.ts +112 -0
- package/lib/text/stories/paragraph.stories.d.ts +78 -0
- package/lib/text/utils/webfonts.d.ts +10 -0
- package/lib/title-bar/components/tab.d.ts +13 -0
- package/lib/title-bar/components/title1.d.ts +11 -0
- package/lib/title-bar/components/title2.d.ts +13 -0
- package/lib/title-bar/index.d.ts +10 -0
- package/lib/title-bar/stories/tab.stories.d.ts +43 -0
- package/lib/title-bar/stories/title1.stories.d.ts +29 -0
- package/lib/title-bar/stories/title2.stories.d.ts +29 -0
- package/lib/utils/link-with-params.d.ts +6 -0
- package/package.json +9 -7
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export default decorateSideBar;
|
|
2
|
+
export function AnchorWrapper({ children }: {
|
|
3
|
+
children: any;
|
|
4
|
+
}): any;
|
|
5
|
+
export namespace AnchorWrapper {
|
|
6
|
+
namespace defaultProps {
|
|
7
|
+
let anchorLabel: string;
|
|
8
|
+
let showAnchor: boolean;
|
|
9
|
+
}
|
|
10
|
+
namespace propTypes {
|
|
11
|
+
export let anchorId: any;
|
|
12
|
+
let anchorLabel_1: any;
|
|
13
|
+
export { anchorLabel_1 as anchorLabel };
|
|
14
|
+
let showAnchor_1: any;
|
|
15
|
+
export { showAnchor_1 as showAnchor };
|
|
16
|
+
export let children: any;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* `decorateSideBar`
|
|
21
|
+
* returns a High Order Component adding the side bar functionalities onto `DecoratedComponent`.
|
|
22
|
+
* It passes props such as `currentAnchorId`, `handleClickAnchor` to the `DecoratedComponent`.
|
|
23
|
+
* `DecoratedSideBar` will map the anchor ids to the sections which are passed as React children,
|
|
24
|
+
* `currentAnchorId` indicates which section is in the viewport right now.
|
|
25
|
+
* `handleClickAnchor` is a function which can be used to scroll to the certain section.
|
|
26
|
+
*
|
|
27
|
+
* For example,
|
|
28
|
+
* ```
|
|
29
|
+
* // react component to render side bar
|
|
30
|
+
* const SideBar = ({anchors, currentAnchorId, handleClickAnchor}) => {
|
|
31
|
+
* const anchorsJSX = []
|
|
32
|
+
* anchors.ForEach((anchor) => {
|
|
33
|
+
* anchorsJSX.push(
|
|
34
|
+
* <div
|
|
35
|
+
* key={anchor.id}
|
|
36
|
+
* onClick={(e) => handleClickAnchor(anchor.id, e)}
|
|
37
|
+
* style={{color: currentAnchorId === anchor.id ? 'black' : 'white'}}
|
|
38
|
+
* >
|
|
39
|
+
* {anchor.label}
|
|
40
|
+
* </div>
|
|
41
|
+
* )
|
|
42
|
+
* })
|
|
43
|
+
* return (
|
|
44
|
+
* <div>
|
|
45
|
+
* {anchorsJSX}
|
|
46
|
+
* </div>
|
|
47
|
+
* )
|
|
48
|
+
* }
|
|
49
|
+
*
|
|
50
|
+
* const DecoratedSideBar = decoratedSideBar(SideBar)
|
|
51
|
+
*
|
|
52
|
+
* const SideBarWithContent = () => {
|
|
53
|
+
* return (
|
|
54
|
+
* <DecoratedSideBar>
|
|
55
|
+
* <AnchorWrapper anchorId="section-1" anchorLabel="Section One">
|
|
56
|
+
* <SectionOne />
|
|
57
|
+
* </AnchorWrapper>
|
|
58
|
+
* <AnchorWrapper anchorId="section-2" anchorLabel="Section Two">
|
|
59
|
+
* <SectionTwo />
|
|
60
|
+
* </AnchorWrapper>
|
|
61
|
+
* <AnchorWrapper anchorId="section-3" anchorLabel="Section Three">
|
|
62
|
+
* <SectionThree />
|
|
63
|
+
* </AnchorWrapper>
|
|
64
|
+
* </DecoratedSideBar>
|
|
65
|
+
* )
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
*
|
|
69
|
+
* The above codes will render three sections and side bar on the same page.
|
|
70
|
+
* When the section, like `SectionTwo`, scrolls into the viewport,
|
|
71
|
+
* the anchor of that section(`Section Two`) will be black, and others will be white.
|
|
72
|
+
*
|
|
73
|
+
* And when user click the anchor, say if `Secetion Two`, the browser will auto scroll to `SectionTwo`,
|
|
74
|
+
* and anchor `Section Two` will be black.
|
|
75
|
+
*
|
|
76
|
+
* ```
|
|
77
|
+
*
|
|
78
|
+
* @param {Object} DecoratedComponent A React component wants to have side bar functionality
|
|
79
|
+
* @returns {Object} A React component with side bar functionalities
|
|
80
|
+
*/
|
|
81
|
+
declare function decorateSideBar(DecoratedComponent: any): any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default SnackBar;
|
|
2
|
+
declare function SnackBar({ text, theme }: {
|
|
3
|
+
text?: string;
|
|
4
|
+
theme?: "normal";
|
|
5
|
+
}): JSX.Element;
|
|
6
|
+
declare namespace SnackBar {
|
|
7
|
+
export namespace propTypes {
|
|
8
|
+
let text: any;
|
|
9
|
+
let theme: any;
|
|
10
|
+
}
|
|
11
|
+
export { THEME };
|
|
12
|
+
}
|
|
13
|
+
import { THEME } from '@twreporter/core/lib/constants/theme';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { SnackBar as component };
|
|
4
|
+
export namespace argTypes {
|
|
5
|
+
export { THEME_STORYBOOK_ARG_TYPE as theme };
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default _default;
|
|
9
|
+
export namespace snackBar {
|
|
10
|
+
namespace args {
|
|
11
|
+
let text: string;
|
|
12
|
+
let theme: "normal";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export namespace clickToShow {
|
|
16
|
+
export function render(props: any): JSX.Element;
|
|
17
|
+
export namespace parameters {
|
|
18
|
+
namespace controls {
|
|
19
|
+
let exclude: string[];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export namespace args_1 {
|
|
23
|
+
let timeout: number;
|
|
24
|
+
}
|
|
25
|
+
export { args_1 as args };
|
|
26
|
+
}
|
|
27
|
+
import SnackBar from '../components/snack-bar';
|
|
28
|
+
import { THEME_STORYBOOK_ARG_TYPE } from '../../storybook/constants';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export namespace BRANCH_STORYBOOK_ARG_TYPE {
|
|
2
|
+
let defaultValue: string;
|
|
3
|
+
let options: string[];
|
|
4
|
+
namespace control {
|
|
5
|
+
let type: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export const THEME_STORYBOOK_ARG_TYPE: {
|
|
9
|
+
defaultValue: any;
|
|
10
|
+
options: any[];
|
|
11
|
+
control: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export const SIZE_STORYBOOK_ARG_TYPE: {
|
|
16
|
+
defaultValue: any;
|
|
17
|
+
options: any[];
|
|
18
|
+
control: {
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { TOCManager as Manager };
|
|
3
|
+
export namespace React {
|
|
4
|
+
export { Anchor };
|
|
5
|
+
export { TableOfContents };
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export default _default;
|
|
9
|
+
/**
|
|
10
|
+
* TOCManager is a bridge between `Anchor` and `TableOfContents`.
|
|
11
|
+
* It provides APIs to make them communicate with each others.
|
|
12
|
+
* For instances, `TOCManager` provides `Anchor`s for `TableOfContents`,
|
|
13
|
+
* hence, `TableOfContents` could know how to render correspoding labels and
|
|
14
|
+
* know how to handle those labels clicked(scroll to that `Anchor`).
|
|
15
|
+
*/
|
|
16
|
+
declare class TOCManager {
|
|
17
|
+
static position: {
|
|
18
|
+
above: string;
|
|
19
|
+
below: string;
|
|
20
|
+
inside: string;
|
|
21
|
+
invisible: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* @constructs
|
|
25
|
+
* @param {Object} props
|
|
26
|
+
* @param {Anchor[]} [props.anchors=[]] - anchors of table of contents
|
|
27
|
+
* @param {Anchor} [props.highlightAnchor=null] - it indicates which anchor is entering the viewport and should be highlighted
|
|
28
|
+
* @param {TableOfContents} [props.toc=null] - table of contents
|
|
29
|
+
* @param {boolean} [props.toStopAutoUpdateHighlightAnchor=false] - it stops automatically updating highlight anchor
|
|
30
|
+
*/
|
|
31
|
+
constructor({ anchors, highlightAnchor, toc, toStopAutoUpdateHighlightAnchor, }?: {
|
|
32
|
+
anchors?: Anchor[];
|
|
33
|
+
highlightAnchor?: Anchor;
|
|
34
|
+
toc?: TableOfContents;
|
|
35
|
+
toStopAutoUpdateHighlightAnchor?: boolean;
|
|
36
|
+
});
|
|
37
|
+
_anchors: Anchor[];
|
|
38
|
+
_highlightAnchor: Anchor;
|
|
39
|
+
_toc: TableOfContents;
|
|
40
|
+
_toStopAutoUpdateHighlightAnchor: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* use `Array.concat` to add `Anchor` into array
|
|
43
|
+
*
|
|
44
|
+
* @method
|
|
45
|
+
* @param {Anchor} anchor - an instance of `Anchor`
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
addAnchor(anchor: Anchor): void;
|
|
49
|
+
/**
|
|
50
|
+
* Re-render `TableOfContents` if needed.
|
|
51
|
+
* Use debounce for optimizing rendering performance.
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
renderTOC: any;
|
|
55
|
+
/**
|
|
56
|
+
* Update highlight anchor.
|
|
57
|
+
* Use debounce for optimizing rendering performance.
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
updateHighlightAnchor: any;
|
|
61
|
+
/**
|
|
62
|
+
* This is a setter function.
|
|
63
|
+
* It indicates which anchor is entering the viewport
|
|
64
|
+
* and should be highlighted in the table of contents.
|
|
65
|
+
* @method
|
|
66
|
+
* @param {Anchor} anchor - an instance of `Anchor`
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
set highlightAnchor(anchor: Anchor);
|
|
70
|
+
/**
|
|
71
|
+
* This a getter function.
|
|
72
|
+
* @method
|
|
73
|
+
* @return {Anchor} - the anchor is highlighted
|
|
74
|
+
*/
|
|
75
|
+
get highlightAnchor(): Anchor;
|
|
76
|
+
/**
|
|
77
|
+
* Sort anchors by the distance to viewport top in ascending order.
|
|
78
|
+
* @param {Anchor[]} anchors
|
|
79
|
+
* @returns {Anchor[]}
|
|
80
|
+
*/
|
|
81
|
+
sortAnchorsByViewportTop(anchors: Anchor[]): Anchor[];
|
|
82
|
+
/**
|
|
83
|
+
* Use memoize to improve performance
|
|
84
|
+
*/
|
|
85
|
+
memoizeSortAnchorsByViewportTop: any;
|
|
86
|
+
/**
|
|
87
|
+
* This is a setter function.
|
|
88
|
+
* @method
|
|
89
|
+
* @return {undefined}
|
|
90
|
+
*/
|
|
91
|
+
set anchors(anchors: Anchor[]);
|
|
92
|
+
/**
|
|
93
|
+
* This is a getter function.
|
|
94
|
+
* @method
|
|
95
|
+
* @returns {Anchor[]}
|
|
96
|
+
*/
|
|
97
|
+
get anchors(): Anchor[];
|
|
98
|
+
/**
|
|
99
|
+
* This is a setter function.
|
|
100
|
+
* @method
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
set toc(toc: TableOfContents);
|
|
104
|
+
/**
|
|
105
|
+
* This is a getter function.
|
|
106
|
+
* @method
|
|
107
|
+
* @returns {TableOfContents}
|
|
108
|
+
*/
|
|
109
|
+
get toc(): TableOfContents;
|
|
110
|
+
/**
|
|
111
|
+
* This is a setter function.
|
|
112
|
+
* @method
|
|
113
|
+
* @returns
|
|
114
|
+
*/
|
|
115
|
+
set toStopAutoUpdateHighlightAnchor(toStopAutoUpdateHighlightAnchor: boolean);
|
|
116
|
+
/**
|
|
117
|
+
* This is a getter function.
|
|
118
|
+
* @method
|
|
119
|
+
* @returns {boolean}
|
|
120
|
+
*/
|
|
121
|
+
get toStopAutoUpdateHighlightAnchor(): boolean;
|
|
122
|
+
}
|
|
123
|
+
declare class Anchor {
|
|
124
|
+
static propTypes: {
|
|
125
|
+
className: any;
|
|
126
|
+
children: any;
|
|
127
|
+
manager: any;
|
|
128
|
+
id: any;
|
|
129
|
+
label: any;
|
|
130
|
+
bottomOffset: any;
|
|
131
|
+
topOffset: any;
|
|
132
|
+
};
|
|
133
|
+
static defaultProps: {
|
|
134
|
+
className: string;
|
|
135
|
+
bottomOffset: string;
|
|
136
|
+
topOffset: string;
|
|
137
|
+
};
|
|
138
|
+
constructor(props: any);
|
|
139
|
+
_ref: any;
|
|
140
|
+
getViewportTop: any;
|
|
141
|
+
handleOnPositionChange: any;
|
|
142
|
+
currentPosition: string;
|
|
143
|
+
/**
|
|
144
|
+
* @returns {number} - the distance between the top edge of anchor and the top of window
|
|
145
|
+
*/
|
|
146
|
+
_getViewportTop(): number;
|
|
147
|
+
/**
|
|
148
|
+
* @param {Object} [posObj={}]
|
|
149
|
+
* @param {string} [posObj.currentPosition=''] - it could be one of
|
|
150
|
+
* Waypoint.below, Waypoint.above, Waypoint.inside and Waypoint.invisible
|
|
151
|
+
*
|
|
152
|
+
* @returns
|
|
153
|
+
*/
|
|
154
|
+
_handleOnPositionChange(posObj?: {
|
|
155
|
+
currentPosition?: string;
|
|
156
|
+
}): void;
|
|
157
|
+
/**
|
|
158
|
+
* This is a getter function.
|
|
159
|
+
* @method
|
|
160
|
+
* @returns {string} - id of anchor
|
|
161
|
+
*/
|
|
162
|
+
get anchorID(): string;
|
|
163
|
+
/**
|
|
164
|
+
* This is a getter function.
|
|
165
|
+
* @method
|
|
166
|
+
* @returns {string} - label of anchor
|
|
167
|
+
*/
|
|
168
|
+
get anchorLable(): string;
|
|
169
|
+
render(): JSX.Element;
|
|
170
|
+
}
|
|
171
|
+
declare class TableOfContents {
|
|
172
|
+
static propTypes: {
|
|
173
|
+
manager: any;
|
|
174
|
+
/**
|
|
175
|
+
* @callback
|
|
176
|
+
* @param {Anchor[]} anchors
|
|
177
|
+
* @param {?Anchor} highlightAnchor
|
|
178
|
+
* @param {Function} handleAnchorClick - callback function for handling clicking anchor
|
|
179
|
+
*/
|
|
180
|
+
render: any;
|
|
181
|
+
scrollDuration: any;
|
|
182
|
+
};
|
|
183
|
+
constructor(props: any);
|
|
184
|
+
state: {
|
|
185
|
+
highlightAnchor: any;
|
|
186
|
+
};
|
|
187
|
+
setHighlightAnchor: any;
|
|
188
|
+
handleAnchorClick: any;
|
|
189
|
+
/**
|
|
190
|
+
* @param {Anchor} anchor - anchor to highlight
|
|
191
|
+
* @returns
|
|
192
|
+
*/
|
|
193
|
+
_setHighlightAnchor(anchor: Anchor): void;
|
|
194
|
+
/**
|
|
195
|
+
* @param {string} anchorID - id of clicked anchor
|
|
196
|
+
* @returns
|
|
197
|
+
*/
|
|
198
|
+
_handleAnchorClick(anchorID: string, callback: any): void;
|
|
199
|
+
render(): any;
|
|
200
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export function H1({ text, type, className, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
text?: string;
|
|
4
|
+
type?: "default";
|
|
5
|
+
className?: string;
|
|
6
|
+
}): JSX.Element;
|
|
7
|
+
export namespace H1 {
|
|
8
|
+
export let displayName: string;
|
|
9
|
+
export namespace propTypes {
|
|
10
|
+
let text: any;
|
|
11
|
+
let type: any;
|
|
12
|
+
let className: any;
|
|
13
|
+
}
|
|
14
|
+
export { Type };
|
|
15
|
+
}
|
|
16
|
+
export function H1({ text, type, className, ...props }: {
|
|
17
|
+
[x: string]: any;
|
|
18
|
+
text?: string;
|
|
19
|
+
type?: "default";
|
|
20
|
+
className?: string;
|
|
21
|
+
}): JSX.Element;
|
|
22
|
+
export namespace H1 { }
|
|
23
|
+
export function H1({ text, type, className, ...props }: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
text?: string;
|
|
26
|
+
type?: "default";
|
|
27
|
+
className?: string;
|
|
28
|
+
}): JSX.Element;
|
|
29
|
+
export namespace H1 { }
|
|
30
|
+
export function H1({ text, type, className, ...props }: {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
text?: string;
|
|
33
|
+
type?: "default";
|
|
34
|
+
className?: string;
|
|
35
|
+
}): JSX.Element;
|
|
36
|
+
export namespace H1 { }
|
|
37
|
+
export function H1({ text, type, className, ...props }: {
|
|
38
|
+
[x: string]: any;
|
|
39
|
+
text?: string;
|
|
40
|
+
type?: "default";
|
|
41
|
+
className?: string;
|
|
42
|
+
}): JSX.Element;
|
|
43
|
+
export namespace H1 { }
|
|
44
|
+
export function H1({ text, type, className, ...props }: {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
text?: string;
|
|
47
|
+
type?: "default";
|
|
48
|
+
className?: string;
|
|
49
|
+
}): JSX.Element;
|
|
50
|
+
export namespace H1 { }
|
|
51
|
+
declare namespace _default {
|
|
52
|
+
export { H1 };
|
|
53
|
+
export { H2 };
|
|
54
|
+
export { H3 };
|
|
55
|
+
export { H4 };
|
|
56
|
+
export { H5 };
|
|
57
|
+
export { H6 };
|
|
58
|
+
}
|
|
59
|
+
export default _default;
|
|
60
|
+
import { Type } from './enums';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function P1({ text, weight, className, children, ...props }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
text?: string;
|
|
4
|
+
weight?: "normal";
|
|
5
|
+
className?: string;
|
|
6
|
+
children: any;
|
|
7
|
+
}): JSX.Element;
|
|
8
|
+
export namespace P1 {
|
|
9
|
+
export let displayName: string;
|
|
10
|
+
export namespace propTypes {
|
|
11
|
+
let text: any;
|
|
12
|
+
let weight: any;
|
|
13
|
+
let className: any;
|
|
14
|
+
let children: any;
|
|
15
|
+
}
|
|
16
|
+
export { Weight };
|
|
17
|
+
}
|
|
18
|
+
export function P1({ text, weight, className, children, ...props }: {
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
text?: string;
|
|
21
|
+
weight?: "normal";
|
|
22
|
+
className?: string;
|
|
23
|
+
children: any;
|
|
24
|
+
}): JSX.Element;
|
|
25
|
+
export namespace P1 { }
|
|
26
|
+
export function P1({ text, weight, className, children, ...props }: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
text?: string;
|
|
29
|
+
weight?: "normal";
|
|
30
|
+
className?: string;
|
|
31
|
+
children: any;
|
|
32
|
+
}): JSX.Element;
|
|
33
|
+
export namespace P1 { }
|
|
34
|
+
export function P1({ text, weight, className, children, ...props }: {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
text?: string;
|
|
37
|
+
weight?: "normal";
|
|
38
|
+
className?: string;
|
|
39
|
+
children: any;
|
|
40
|
+
}): JSX.Element;
|
|
41
|
+
export namespace P1 { }
|
|
42
|
+
declare namespace _default {
|
|
43
|
+
export { P1 };
|
|
44
|
+
export { P2 };
|
|
45
|
+
export { P3 };
|
|
46
|
+
export { P4 };
|
|
47
|
+
}
|
|
48
|
+
export default _default;
|
|
49
|
+
import { Weight } from './enums';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export let title: string;
|
|
3
|
+
export { H1 as component };
|
|
4
|
+
export namespace argTypes {
|
|
5
|
+
let type: {
|
|
6
|
+
defaultValue: any;
|
|
7
|
+
options: any[];
|
|
8
|
+
control: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export default _default;
|
|
15
|
+
export namespace h1 {
|
|
16
|
+
namespace args {
|
|
17
|
+
export { defaultText as text };
|
|
18
|
+
export { defaultType as type };
|
|
19
|
+
}
|
|
20
|
+
namespace parameters {
|
|
21
|
+
namespace controls {
|
|
22
|
+
let exclude: string[];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export namespace h2 {
|
|
27
|
+
export function render(args: any): JSX.Element;
|
|
28
|
+
export namespace args_1 {
|
|
29
|
+
export { defaultText as text };
|
|
30
|
+
export { defaultType as type };
|
|
31
|
+
}
|
|
32
|
+
export { args_1 as args };
|
|
33
|
+
export namespace parameters_1 {
|
|
34
|
+
export namespace controls_1 {
|
|
35
|
+
let exclude_1: string[];
|
|
36
|
+
export { exclude_1 as exclude };
|
|
37
|
+
}
|
|
38
|
+
export { controls_1 as controls };
|
|
39
|
+
}
|
|
40
|
+
export { parameters_1 as parameters };
|
|
41
|
+
}
|
|
42
|
+
export namespace h3 {
|
|
43
|
+
export function render_1(args: any): JSX.Element;
|
|
44
|
+
export { render_1 as render };
|
|
45
|
+
export namespace args_2 {
|
|
46
|
+
export { defaultText as text };
|
|
47
|
+
export { defaultType as type };
|
|
48
|
+
}
|
|
49
|
+
export { args_2 as args };
|
|
50
|
+
export namespace parameters_2 {
|
|
51
|
+
export namespace controls_2 {
|
|
52
|
+
let exclude_2: string[];
|
|
53
|
+
export { exclude_2 as exclude };
|
|
54
|
+
}
|
|
55
|
+
export { controls_2 as controls };
|
|
56
|
+
}
|
|
57
|
+
export { parameters_2 as parameters };
|
|
58
|
+
}
|
|
59
|
+
export namespace h4 {
|
|
60
|
+
export function render_2(args: any): JSX.Element;
|
|
61
|
+
export { render_2 as render };
|
|
62
|
+
export namespace args_3 {
|
|
63
|
+
export { defaultText as text };
|
|
64
|
+
export { defaultType as type };
|
|
65
|
+
}
|
|
66
|
+
export { args_3 as args };
|
|
67
|
+
export namespace parameters_3 {
|
|
68
|
+
export namespace controls_3 {
|
|
69
|
+
let exclude_3: string[];
|
|
70
|
+
export { exclude_3 as exclude };
|
|
71
|
+
}
|
|
72
|
+
export { controls_3 as controls };
|
|
73
|
+
}
|
|
74
|
+
export { parameters_3 as parameters };
|
|
75
|
+
}
|
|
76
|
+
export namespace h5 {
|
|
77
|
+
export function render_3(args: any): JSX.Element;
|
|
78
|
+
export { render_3 as render };
|
|
79
|
+
export namespace args_4 {
|
|
80
|
+
export { defaultText as text };
|
|
81
|
+
export { defaultType as type };
|
|
82
|
+
}
|
|
83
|
+
export { args_4 as args };
|
|
84
|
+
export namespace parameters_4 {
|
|
85
|
+
export namespace controls_4 {
|
|
86
|
+
let exclude_4: string[];
|
|
87
|
+
export { exclude_4 as exclude };
|
|
88
|
+
}
|
|
89
|
+
export { controls_4 as controls };
|
|
90
|
+
}
|
|
91
|
+
export { parameters_4 as parameters };
|
|
92
|
+
}
|
|
93
|
+
export namespace h6 {
|
|
94
|
+
export function render_4(args: any): JSX.Element;
|
|
95
|
+
export { render_4 as render };
|
|
96
|
+
export namespace args_5 {
|
|
97
|
+
export { defaultText as text };
|
|
98
|
+
export { defaultType as type };
|
|
99
|
+
}
|
|
100
|
+
export { args_5 as args };
|
|
101
|
+
export namespace parameters_5 {
|
|
102
|
+
export namespace controls_5 {
|
|
103
|
+
let exclude_5: string[];
|
|
104
|
+
export { exclude_5 as exclude };
|
|
105
|
+
}
|
|
106
|
+
export { controls_5 as controls };
|
|
107
|
+
}
|
|
108
|
+
export { parameters_5 as parameters };
|
|
109
|
+
}
|
|
110
|
+
import { H1 } from '../headline';
|
|
111
|
+
declare const defaultText: "\u6A19\u984C\u300C\u6A19\u984C\u300D\uFF1A\u6A19\u984C\uFF0C\u300A\u6A19\u984C\u300B\u6A19\u984CEnglish\u6A19\u984C123\u6A19\u984C\uFF1F";
|
|
112
|
+
declare const defaultType: "default";
|