@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.
Files changed (153) hide show
  1. package/lib/badge/badge.stories.d.ts +13 -0
  2. package/lib/badge/index.d.ts +14 -0
  3. package/lib/bookmark-list/bookmark.d.ts +9 -0
  4. package/lib/bookmark-list/bookmarks.d.ts +15 -0
  5. package/lib/bookmark-list/customized-link.d.ts +19 -0
  6. package/lib/bookmark-list/image-wrapper.d.ts +27 -0
  7. package/lib/bookmark-list/index.d.ts +26 -0
  8. package/lib/bookmark-list/redirect-to-sign-in.d.ts +9 -0
  9. package/lib/bookmark-list/stories/bookmark.stories.d.ts +9 -0
  10. package/lib/bookmark-widget/index.d.ts +13 -0
  11. package/lib/button/components/iconButton.d.ts +22 -0
  12. package/lib/button/components/iconWithTextButton.d.ts +21 -0
  13. package/lib/button/components/link.d.ts +45 -0
  14. package/lib/button/components/menuButton.d.ts +29 -0
  15. package/lib/button/components/pillButton.d.ts +34 -0
  16. package/lib/button/components/textButton.d.ts +32 -0
  17. package/lib/button/components/toggleButton.d.ts +18 -0
  18. package/lib/button/enums/index.d.ts +13 -0
  19. package/lib/button/index.d.ts +20 -0
  20. package/lib/button/stories/iconButton.stories.d.ts +42 -0
  21. package/lib/button/stories/iconWithTextButton.stories.d.ts +37 -0
  22. package/lib/button/stories/link.stories.d.ts +139 -0
  23. package/lib/button/stories/menuButton.stories.d.ts +26 -0
  24. package/lib/button/stories/pillButton.stories.d.ts +92 -0
  25. package/lib/button/stories/textButton.stories.d.ts +85 -0
  26. package/lib/button/stories/toggleButton.stories.d.ts +22 -0
  27. package/lib/button/utils/size.d.ts +8 -0
  28. package/lib/button/utils/theme.d.ts +218 -0
  29. package/lib/card/components/article-card.d.ts +34 -0
  30. package/lib/card/components/dialog.d.ts +14 -0
  31. package/lib/card/components/short-story.d.ts +26 -0
  32. package/lib/card/index.d.ts +10 -0
  33. package/lib/card/stories/articleCard.stories.d.ts +30 -0
  34. package/lib/card/stories/dialog.stories.d.ts +23 -0
  35. package/lib/card/stories/shortStory.stories.d.ts +37 -0
  36. package/lib/checkbox/checkbox.stories.d.ts +21 -0
  37. package/lib/checkbox/index.d.ts +16 -0
  38. package/lib/color.stories.d.ts +63 -0
  39. package/lib/confirmation/index.d.ts +25 -0
  40. package/lib/customized-link.d.ts +12 -0
  41. package/lib/divider.d.ts +15 -0
  42. package/lib/divider.stories.d.ts +33 -0
  43. package/lib/donation-link.d.ts +10 -0
  44. package/lib/empty-state/enums/index.d.ts +5 -0
  45. package/lib/empty-state/index.d.ts +30 -0
  46. package/lib/empty-state/stories/empty-guide.stories.d.ts +29 -0
  47. package/lib/error/index.d.ts +8 -0
  48. package/lib/error/message.d.ts +9 -0
  49. package/lib/footer/constants/links.d.ts +19 -0
  50. package/lib/footer/footer.stories.d.ts +15 -0
  51. package/lib/footer/index.d.ts +9 -0
  52. package/lib/footer/link.d.ts +18 -0
  53. package/lib/footer/logo.d.ts +9 -0
  54. package/lib/hook/index.d.ts +10 -0
  55. package/lib/hook/use-bookmark.d.ts +15 -0
  56. package/lib/hook/use-font-face-observer.d.ts +2 -0
  57. package/lib/hook/use-outside-click.d.ts +2 -0
  58. package/lib/icon/enum/index.d.ts +25 -0
  59. package/lib/icon/index.d.ts +227 -0
  60. package/lib/icon/index.js +4 -2
  61. package/lib/icon/stories/arrow.stories.d.ts +72 -0
  62. package/lib/icon/stories/article.stories.d.ts +11 -0
  63. package/lib/icon/stories/bookmark.stories.d.ts +57 -0
  64. package/lib/icon/stories/changeIconColor.stories.d.ts +23 -0
  65. package/lib/icon/stories/clock.stories.d.ts +11 -0
  66. package/lib/icon/stories/copy.stories.d.ts +11 -0
  67. package/lib/icon/stories/cross.stories.d.ts +11 -0
  68. package/lib/icon/stories/filter.stories.d.ts +11 -0
  69. package/lib/icon/stories/filter.stories.js +16 -0
  70. package/lib/icon/stories/hamburger.stories.d.ts +11 -0
  71. package/lib/icon/stories/home.stories.d.ts +11 -0
  72. package/lib/icon/stories/letter.stories.d.ts +11 -0
  73. package/lib/icon/stories/loading.stories.d.ts +11 -0
  74. package/lib/icon/stories/member.stories.d.ts +11 -0
  75. package/lib/icon/stories/printer.stories.d.ts +11 -0
  76. package/lib/icon/stories/search.stories.d.ts +11 -0
  77. package/lib/icon/stories/share.stories.d.ts +11 -0
  78. package/lib/icon/stories/socialMedia.stories.d.ts +25 -0
  79. package/lib/icon/stories/text.stories.d.ts +11 -0
  80. package/lib/icon/stories/topic.stories.d.ts +11 -0
  81. package/lib/image-with-fallback.d.ts +16 -0
  82. package/lib/input/components/search-bar.d.ts +29 -0
  83. package/lib/input/components/text-field.d.ts +26 -0
  84. package/lib/input/enums/index.d.ts +13 -0
  85. package/lib/input/index.d.ts +8 -0
  86. package/lib/input/stories/search-bar.stories.d.ts +33 -0
  87. package/lib/input/stories/text-field.stories.d.ts +37 -0
  88. package/lib/input/utils/theme.d.ts +17 -0
  89. package/lib/is-fetching-wrapper.d.ts +14 -0
  90. package/lib/junior-link.d.ts +7 -0
  91. package/lib/link-with-tracker.d.ts +29 -0
  92. package/lib/listing-page/components/card-list.d.ts +20 -0
  93. package/lib/listing-page/components/image.d.ts +29 -0
  94. package/lib/listing-page/components/list-item.d.ts +27 -0
  95. package/lib/listing-page/components/list.d.ts +31 -0
  96. package/lib/listing-page/components/page-content.d.ts +2 -0
  97. package/lib/listing-page/components/topics/index.d.ts +25 -0
  98. package/lib/listing-page/components/topics/post-item.d.ts +19 -0
  99. package/lib/listing-page/components/topics/posts.d.ts +2 -0
  100. package/lib/listing-page/components/topics/section.d.ts +20 -0
  101. package/lib/listing-page/components/topics/topic-item.d.ts +22 -0
  102. package/lib/listing-page/constants/mockup-spec.d.ts +46 -0
  103. package/lib/listing-page/constants/predefined-css.d.ts +2 -0
  104. package/lib/listing-page/constants/prop-types.d.ts +1 -0
  105. package/lib/listing-page/constants/topics.d.ts +6 -0
  106. package/lib/listing-page/index.d.ts +10 -0
  107. package/lib/listing-page/stories/cardList.stories.d.ts +72 -0
  108. package/lib/logo/components/logo-footer.d.ts +17 -0
  109. package/lib/logo/components/logo-header.d.ts +18 -0
  110. package/lib/logo/components/logo-loading-fallback.d.ts +10 -0
  111. package/lib/logo/components/logo-symbol.d.ts +19 -0
  112. package/lib/logo/index.d.ts +12 -0
  113. package/lib/logo/stories/logoFooter.stories.d.ts +11 -0
  114. package/lib/logo/stories/logoHeader.stories.d.ts +15 -0
  115. package/lib/logo/stories/logoLoadingFallback.stories.d.ts +11 -0
  116. package/lib/logo/stories/logoSymbol.stories.d.ts +15 -0
  117. package/lib/logo/utils/path.d.ts +5 -0
  118. package/lib/material-icon.d.ts +17 -0
  119. package/lib/mobile-member-role-card/index.d.ts +26 -0
  120. package/lib/mobile-member-role-card/stories/member-role-card.stories.d.ts +34 -0
  121. package/lib/mobile-pop-up-modal.d.ts +28 -0
  122. package/lib/more.d.ts +10 -0
  123. package/lib/pagination/index.d.ts +36 -0
  124. package/lib/podcast-link.d.ts +7 -0
  125. package/lib/rwd.d.ts +5 -0
  126. package/lib/shared-enum.d.ts +4 -0
  127. package/lib/side-bar/index.d.ts +81 -0
  128. package/lib/simple-header/index.d.ts +2 -0
  129. package/lib/simple-header/simpleHeader.stories.d.ts +9 -0
  130. package/lib/snack-bar/components/snack-bar.d.ts +13 -0
  131. package/lib/snack-bar/hooks/use-snack-bar.d.ts +9 -0
  132. package/lib/snack-bar/index.d.ts +8 -0
  133. package/lib/snack-bar/stories/snackBar.stories.d.ts +28 -0
  134. package/lib/snack-bar/utils/theme.d.ts +11 -0
  135. package/lib/storybook/constants/index.d.ts +21 -0
  136. package/lib/storybook/utils/get-enum-arg.d.ts +7 -0
  137. package/lib/table-of-contents/index.d.ts +200 -0
  138. package/lib/text/constants/headline-type.d.ts +4 -0
  139. package/lib/text/enums/index.d.ts +9 -0
  140. package/lib/text/headline.d.ts +60 -0
  141. package/lib/text/paragraph.d.ts +49 -0
  142. package/lib/text/stories/headline.stories.d.ts +112 -0
  143. package/lib/text/stories/paragraph.stories.d.ts +78 -0
  144. package/lib/text/utils/webfonts.d.ts +10 -0
  145. package/lib/title-bar/components/tab.d.ts +13 -0
  146. package/lib/title-bar/components/title1.d.ts +11 -0
  147. package/lib/title-bar/components/title2.d.ts +13 -0
  148. package/lib/title-bar/index.d.ts +10 -0
  149. package/lib/title-bar/stories/tab.stories.d.ts +43 -0
  150. package/lib/title-bar/stories/title1.stories.d.ts +29 -0
  151. package/lib/title-bar/stories/title2.stories.d.ts +29 -0
  152. package/lib/utils/link-with-params.d.ts +6 -0
  153. package/package.json +9 -7
@@ -0,0 +1,78 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { P1 as component };
4
+ export namespace argTypes {
5
+ let weight: {
6
+ defaultValue: any;
7
+ options: any[];
8
+ control: {
9
+ type: string;
10
+ };
11
+ };
12
+ }
13
+ }
14
+ export default _default;
15
+ export namespace p1 {
16
+ namespace args {
17
+ export { defaultText as text };
18
+ export { defaultWeight as weight };
19
+ }
20
+ namespace parameters {
21
+ namespace controls {
22
+ let exclude: string[];
23
+ }
24
+ }
25
+ }
26
+ export namespace p2 {
27
+ export function render(args: any): JSX.Element;
28
+ export namespace args_1 {
29
+ export { defaultText as text };
30
+ export { defaultWeight as weight };
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 p3 {
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 { defaultWeight as weight };
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 p4 {
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 { defaultWeight as weight };
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
+ import { P1 } from '../paragraph';
77
+ declare const defaultText: "\u5167\u6587\u300C\u5167\u6587\u300D\uFF1A\u5167\u6587\uFF0C\u300A\u5167\u6587\u300B\u5167\u6587English\u5167\u6587123\u5167\u6587\uFF1F";
78
+ declare const defaultWeight: "normal";
@@ -0,0 +1,10 @@
1
+ declare namespace _default {
2
+ export { fontFaces };
3
+ export { fontGCSFiles };
4
+ }
5
+ export default _default;
6
+ declare const fontFaces: {
7
+ "Noto Sans TC": any;
8
+ "Tauhu Oo": any;
9
+ };
10
+ declare let fontGCSFiles: any[];
@@ -0,0 +1,13 @@
1
+ export default TitleTab;
2
+ declare function TitleTab({ title, tabs, activeTabIndex }: {
3
+ title?: string;
4
+ tabs?: any[];
5
+ activeTabIndex?: number;
6
+ }): JSX.Element;
7
+ declare namespace TitleTab {
8
+ namespace propTypes {
9
+ let title: any;
10
+ let tabs: any;
11
+ let activeTabIndex: any;
12
+ }
13
+ }
@@ -0,0 +1,11 @@
1
+ export default Title1;
2
+ declare function Title1({ title, subtitle }: {
3
+ title?: string;
4
+ subtitle?: string;
5
+ }): JSX.Element;
6
+ declare namespace Title1 {
7
+ namespace propTypes {
8
+ let title: any;
9
+ let subtitle: any;
10
+ }
11
+ }
@@ -0,0 +1,13 @@
1
+ export default Title2;
2
+ declare function Title2({ title, subtitle, renderButton }: {
3
+ title?: string;
4
+ subtitle?: string;
5
+ renderButton: any;
6
+ }): JSX.Element;
7
+ declare namespace Title2 {
8
+ namespace propTypes {
9
+ let title: any;
10
+ let subtitle: any;
11
+ let renderButton: any;
12
+ }
13
+ }
@@ -0,0 +1,10 @@
1
+ declare namespace _default {
2
+ export { Title1 };
3
+ export { Title2 };
4
+ export { TitleTab };
5
+ }
6
+ export default _default;
7
+ import Title1 from './components/title1';
8
+ import Title2 from './components/title2';
9
+ import TitleTab from './components/tab';
10
+ export { Title1, Title2, TitleTab };
@@ -0,0 +1,43 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { Tab as component };
4
+ }
5
+ export default _default;
6
+ export namespace tab {
7
+ namespace args {
8
+ let title_1: string;
9
+ export { title_1 as title };
10
+ export let tabs: {
11
+ text: string;
12
+ isExternal: boolean;
13
+ link: string;
14
+ }[];
15
+ }
16
+ }
17
+ export namespace humanRightsTab {
18
+ export namespace args_1 {
19
+ let title_2: string;
20
+ export { title_2 as title };
21
+ let tabs_1: {
22
+ text: string;
23
+ isExternal: boolean;
24
+ link: string;
25
+ }[];
26
+ export { tabs_1 as tabs };
27
+ }
28
+ export { args_1 as args };
29
+ }
30
+ export namespace animalTab {
31
+ export namespace args_2 {
32
+ let title_3: string;
33
+ export { title_3 as title };
34
+ let tabs_2: {
35
+ text: string;
36
+ isExternal: boolean;
37
+ link: string;
38
+ }[];
39
+ export { tabs_2 as tabs };
40
+ }
41
+ export { args_2 as args };
42
+ }
43
+ import Tab from '../components/tab';
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { Title1 as component };
4
+ }
5
+ export default _default;
6
+ export namespace bar {
7
+ namespace args {
8
+ let title_1: string;
9
+ export { title_1 as title };
10
+ export let subtitle: string;
11
+ }
12
+ }
13
+ export namespace tagBar {
14
+ export namespace args_1 {
15
+ let title_2: string;
16
+ export { title_2 as title };
17
+ }
18
+ export { args_1 as args };
19
+ }
20
+ export namespace bookmarkBar {
21
+ export namespace args_2 {
22
+ let title_3: string;
23
+ export { title_3 as title };
24
+ let subtitle_1: string;
25
+ export { subtitle_1 as subtitle };
26
+ }
27
+ export { args_2 as args };
28
+ }
29
+ import Title1 from '../components/title1';
@@ -0,0 +1,29 @@
1
+ declare namespace _default {
2
+ export let title: string;
3
+ export { Title2 as component };
4
+ export namespace argTypes {
5
+ namespace showButton {
6
+ let defaultValue: boolean;
7
+ namespace control {
8
+ let type: string;
9
+ }
10
+ }
11
+ }
12
+ }
13
+ export default _default;
14
+ export namespace title2 {
15
+ function render(args: any): JSX.Element;
16
+ namespace args {
17
+ let title_1: string;
18
+ export { title_1 as title };
19
+ export let subtitle: string;
20
+ let showButton_1: boolean;
21
+ export { showButton_1 as showButton };
22
+ }
23
+ namespace parameters {
24
+ namespace controls {
25
+ let exclude: string[];
26
+ }
27
+ }
28
+ }
29
+ import Title2 from '../components/title2';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @param { string } originalUrl - The original url
3
+ * @param { Object } params - search params to be set
4
+ * @return { string } originalUrl with search params
5
+ */
6
+ export default function linkWithParams(originalUrl: string, params: any): string;
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "@twreporter/react-components",
3
- "version": "9.4.4",
3
+ "version": "9.5.0-rc.0",
4
4
  "main": "lib/index.js",
5
+ "types": "lib/index.d.ts",
5
6
  "repository": "https://github.com/twreporter/twreporter-npm-packages.git",
6
7
  "author": "twreporter <developer@twreporter.org>",
7
8
  "license": "MIT",
8
9
  "scripts": {
9
10
  "clean": "make clean",
10
- "build": "make build",
11
+ "build": "make build && tsc --noEmit false",
11
12
  "dev": "make dev",
12
- "prepublishOnly": "make build",
13
+ "prepublishOnly": "make build && tsc --noEmit false",
13
14
  "storybook": "storybook dev -p 3000",
14
15
  "build-storybook": "storybook build",
15
16
  "chromatic": "npx chromatic --exit-zero-on-changes"
16
17
  },
17
18
  "dependencies": {
18
- "@twreporter/core": "^1.24.2",
19
- "@twreporter/redux": "^8.3.1",
19
+ "@twreporter/core": "^1.24.3-rc.0",
20
+ "@twreporter/redux": "^8.3.2-rc.0",
20
21
  "fontfaceobserver-es": "^3.3.3",
21
22
  "hoist-non-react-statics": "^2.3.1",
22
23
  "lodash": "^4.0.0",
@@ -52,7 +53,8 @@
52
53
  "babel-loader": "^8.2.4",
53
54
  "chromatic": "^6.5.4",
54
55
  "react-dom": "^18.2.0",
55
- "storybook": "^8.1.11"
56
+ "storybook": "^8.1.11",
57
+ "typescript": "^5.7.3"
56
58
  },
57
- "gitHead": "7125c4d886b5a8c9877a9714c0730fcc03c3833a"
59
+ "gitHead": "53b64eb9f37b4d8df44e6bb8db7bece5cae16f87"
58
60
  }