@antv/dumi-theme-antv 0.2.1 → 0.3.0-beta.1

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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -33
  3. package/dist/builtins/Playground/index.d.ts +24 -0
  4. package/{es/builtins/Example.js → dist/builtins/Playground/index.js} +40 -33
  5. package/dist/builtins/Playground/index.module.less +15 -0
  6. package/dist/context.d.ts +5 -0
  7. package/dist/context.js +2 -0
  8. package/dist/layouts/DocLayout.d.ts +7 -0
  9. package/dist/layouts/DocLayout.js +38 -0
  10. package/dist/layouts/entry/API.d.ts +10 -0
  11. package/dist/layouts/entry/API.js +12 -0
  12. package/dist/layouts/entry/Index.d.ts +7 -0
  13. package/dist/layouts/entry/Index.js +71 -0
  14. package/dist/layouts/entry/Manual.d.ts +8 -0
  15. package/dist/layouts/entry/Manual.js +14 -0
  16. package/dist/locales/en.json +98 -0
  17. package/dist/locales/zh.json +98 -0
  18. package/dist/pages/404.d.ts +6 -0
  19. package/dist/pages/404.js +14 -0
  20. package/dist/pages/Example/index.d.ts +6 -0
  21. package/dist/pages/Example/index.js +139 -0
  22. package/dist/pages/Example/index.module.less +40 -0
  23. package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
  24. package/dist/pages/Examples/components/Accouncement/index.js +60 -0
  25. package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
  26. package/dist/pages/Examples/components/Article/index.d.ts +2 -0
  27. package/dist/pages/Examples/components/Article/index.js +8 -0
  28. package/dist/pages/Examples/components/Article/index.module.less +2 -0
  29. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
  30. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
  31. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
  32. package/{es/builtins/Table.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -41
  33. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
  34. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
  35. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
  36. package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
  37. package/dist/pages/Examples/index.d.ts +8 -0
  38. package/dist/pages/Examples/index.js +75 -0
  39. package/dist/pages/Examples/index.module.less +605 -0
  40. package/dist/pages/Examples/types.d.ts +33 -0
  41. package/dist/pages/Examples/types.js +1 -0
  42. package/dist/plugin/examples.d.ts +7 -0
  43. package/dist/plugin/examples.js +83 -0
  44. package/dist/plugin/index.d.ts +3 -0
  45. package/dist/plugin/index.js +103 -0
  46. package/dist/slots/404.d.ts +2 -0
  47. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  48. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +4 -4
  49. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  50. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  51. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  52. package/dist/slots/CodeEditor/Toolbar.js +152 -0
  53. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  54. package/dist/slots/CodeEditor/index.d.ts +58 -0
  55. package/dist/slots/CodeEditor/index.js +200 -0
  56. package/dist/slots/CodeEditor/index.module.less +11 -0
  57. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  58. package/dist/slots/CodeEditor/utils.js +157 -0
  59. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  60. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  61. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  62. package/dist/slots/CodePreview/index.d.ts +17 -0
  63. package/dist/slots/CodePreview/index.js +29 -0
  64. package/dist/slots/CodePreview/index.module.less +42 -0
  65. package/dist/slots/CodeRunner/index.d.ts +14 -0
  66. package/dist/slots/CodeRunner/index.js +76 -0
  67. package/dist/slots/CodeRunner/index.module.less +0 -0
  68. package/dist/slots/CodeRunner/utils.d.ts +10 -0
  69. package/dist/slots/CodeRunner/utils.js +36 -0
  70. package/dist/slots/Companies/index.d.ts +13 -0
  71. package/dist/slots/Companies/index.js +49 -0
  72. package/dist/slots/Companies/index.module.less +82 -0
  73. package/dist/slots/Detail/News.d.ts +9 -0
  74. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  75. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  76. package/dist/slots/Detail/index.d.ts +26 -0
  77. package/dist/slots/Detail/index.js +124 -0
  78. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  79. package/dist/slots/ExampleSider/index.d.ts +55 -0
  80. package/dist/slots/ExampleSider/index.js +218 -0
  81. package/dist/slots/ExampleSider/index.module.less +141 -0
  82. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +1 -1
  83. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  84. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  85. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  86. package/{es/antv → dist/slots}/Features/index.js +17 -25
  87. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  88. package/dist/slots/Footer/index.d.ts +18 -0
  89. package/dist/slots/Footer/index.js +187 -0
  90. package/dist/slots/Footer/index.module.less +85 -0
  91. package/dist/slots/Header/Logo.d.ts +7 -0
  92. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  93. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  94. package/dist/slots/Header/LogoWhite.js +19 -0
  95. package/dist/slots/Header/Navs.d.ts +17 -0
  96. package/dist/slots/Header/Navs.js +46 -0
  97. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  98. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  99. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  100. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  101. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  102. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  103. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  104. package/dist/slots/Header/Products/getProducts.js +67 -0
  105. package/dist/slots/Header/Products/index.d.ts +9 -0
  106. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  107. package/dist/slots/Header/Search.d.ts +12 -0
  108. package/dist/slots/Header/Search.js +90 -0
  109. package/dist/slots/Header/Search.module.less +39 -0
  110. package/dist/slots/Header/index.d.ts +66 -0
  111. package/dist/slots/Header/index.js +379 -0
  112. package/dist/slots/Header/index.module.less +382 -0
  113. package/dist/slots/Header/utils.d.ts +1 -0
  114. package/dist/slots/Header/utils.js +26 -0
  115. package/dist/slots/Loading/index.d.ts +2 -0
  116. package/dist/slots/Loading/index.js +65 -0
  117. package/dist/slots/Loading/index.module.less +12 -0
  118. package/dist/slots/Loading.d.ts +5 -0
  119. package/dist/slots/Loading.js +8 -0
  120. package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
  121. package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
  122. package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
  123. package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
  124. package/dist/slots/ManualContent/ReadingTime.js +10 -0
  125. package/dist/slots/ManualContent/index.d.ts +9 -0
  126. package/dist/slots/ManualContent/index.js +321 -0
  127. package/dist/slots/ManualContent/index.module.less +656 -0
  128. package/dist/slots/TOC.d.ts +5 -0
  129. package/dist/slots/TOC.js +6 -0
  130. package/dist/slots/_.less +83 -0
  131. package/dist/slots/global.d.ts +1 -0
  132. package/dist/slots/global.js +7 -0
  133. package/dist/slots/hooks.d.ts +16 -0
  134. package/{es/antv → dist/slots}/hooks.js +60 -37
  135. package/dist/slots/utils.d.ts +20 -0
  136. package/dist/slots/utils.js +154 -0
  137. package/dist/types.d.ts +3 -0
  138. package/dist/types.js +1 -0
  139. package/dist/typings.d.ts +137 -0
  140. package/package.json +108 -47
  141. package/es/antv/404/index.d.ts +0 -2
  142. package/es/antv/Banner/Banner.module.less +0 -412
  143. package/es/antv/Banner/Notification.d.ts +0 -10
  144. package/es/antv/Banner/Notification.module.less +0 -108
  145. package/es/antv/Banner/index.d.ts +0 -25
  146. package/es/antv/Banner/index.js +0 -104
  147. package/es/antv/Cases/Cases.module.less +0 -203
  148. package/es/antv/Features/FeatureCard.module.less +0 -51
  149. package/es/antv/Features/Features.module.less +0 -169
  150. package/es/antv/Footer/Footer.module.less +0 -36
  151. package/es/antv/Footer/index.d.ts +0 -12
  152. package/es/antv/Footer/index.js +0 -237
  153. package/es/antv/Header/Logo.d.ts +0 -4
  154. package/es/antv/Products/Product.module.less +0 -146
  155. package/es/antv/Products/getNewProducts.d.ts +0 -24
  156. package/es/antv/Products/getNewProducts.js +0 -35
  157. package/es/antv/Products/getProducts.js +0 -460
  158. package/es/antv/Products/index.d.ts +0 -9
  159. package/es/antv/hooks.d.ts +0 -14
  160. package/es/antv/mixins.less +0 -21
  161. package/es/antv/utils.d.ts +0 -5
  162. package/es/antv/utils.js +0 -49
  163. package/es/builtins/API.d.ts +0 -3
  164. package/es/builtins/API.js +0 -37
  165. package/es/builtins/Alert.d.ts +0 -3
  166. package/es/builtins/Alert.js +0 -7
  167. package/es/builtins/Alert.less +0 -62
  168. package/es/builtins/Badge.d.ts +0 -3
  169. package/es/builtins/Badge.js +0 -7
  170. package/es/builtins/Badge.less +0 -31
  171. package/es/builtins/Example.d.ts +0 -5
  172. package/es/builtins/Example.less +0 -47
  173. package/es/builtins/Previewer.d.ts +0 -39
  174. package/es/builtins/Previewer.js +0 -225
  175. package/es/builtins/Previewer.less +0 -406
  176. package/es/builtins/SourceCode.d.ts +0 -10
  177. package/es/builtins/SourceCode.js +0 -70
  178. package/es/builtins/SourceCode.less +0 -103
  179. package/es/builtins/Table.d.ts +0 -4
  180. package/es/builtins/Table.less +0 -43
  181. package/es/builtins/Tree.d.ts +0 -4
  182. package/es/builtins/Tree.js +0 -213
  183. package/es/builtins/Tree.less +0 -159
  184. package/es/components/Dark.d.ts +0 -9
  185. package/es/components/Dark.js +0 -125
  186. package/es/components/Dark.less +0 -121
  187. package/es/components/LocaleSelect.d.ts +0 -6
  188. package/es/components/LocaleSelect.js +0 -53
  189. package/es/components/LocaleSelect.less +0 -59
  190. package/es/components/Navbar.d.ts +0 -10
  191. package/es/components/Navbar.js +0 -155
  192. package/es/components/Navbar.less +0 -180
  193. package/es/components/SearchBar.d.ts +0 -4
  194. package/es/components/SearchBar.js +0 -81
  195. package/es/components/SearchBar.less +0 -165
  196. package/es/components/SideMenu.d.ts +0 -10
  197. package/es/components/SideMenu.js +0 -99
  198. package/es/components/SideMenu.less +0 -379
  199. package/es/components/SlugList.d.ts +0 -7
  200. package/es/components/SlugList.js +0 -38
  201. package/es/components/SlugList.less +0 -18
  202. package/es/declaration.d.ts +0 -1
  203. package/es/layout.d.ts +0 -5
  204. package/es/layout.js +0 -277
  205. package/es/style/layout.less +0 -402
  206. package/es/style/markdown.less +0 -240
  207. package/es/style/variables.less +0 -37
  208. package/src/antv/404/index.tsx +0 -25
  209. package/src/antv/Banner/Notification.tsx +0 -45
  210. package/src/antv/Banner/index.tsx +0 -139
  211. package/src/antv/Cases/Cases.tsx +0 -116
  212. package/src/antv/Features/FeatureCard.tsx +0 -24
  213. package/src/antv/Features/index.tsx +0 -86
  214. package/src/antv/Footer/Footer.module.less +0 -36
  215. package/src/antv/Footer/index.tsx +0 -272
  216. package/src/antv/Header/Logo.tsx +0 -85
  217. package/src/antv/Products/Product.tsx +0 -80
  218. package/src/antv/Products/getNewProducts.tsx +0 -53
  219. package/src/antv/Products/getProducts.tsx +0 -626
  220. package/src/antv/Products/index.tsx +0 -70
  221. package/src/antv/hooks.ts +0 -87
  222. package/src/antv/mixins.less +0 -21
  223. package/src/antv/utils.ts +0 -44
  224. package/src/builtins/API.tsx +0 -57
  225. package/src/builtins/Alert.less +0 -62
  226. package/src/builtins/Alert.tsx +0 -4
  227. package/src/builtins/Badge.less +0 -31
  228. package/src/builtins/Badge.tsx +0 -4
  229. package/src/builtins/Example.less +0 -47
  230. package/src/builtins/Example.tsx +0 -34
  231. package/src/builtins/Previewer.less +0 -406
  232. package/src/builtins/Previewer.tsx +0 -264
  233. package/src/builtins/SourceCode.less +0 -103
  234. package/src/builtins/SourceCode.tsx +0 -55
  235. package/src/builtins/Table.less +0 -43
  236. package/src/builtins/Table.tsx +0 -42
  237. package/src/builtins/Tree.less +0 -159
  238. package/src/builtins/Tree.tsx +0 -130
  239. package/src/components/Dark.less +0 -121
  240. package/src/components/Dark.tsx +0 -78
  241. package/src/components/LocaleSelect.less +0 -59
  242. package/src/components/LocaleSelect.tsx +0 -53
  243. package/src/components/Navbar.less +0 -180
  244. package/src/components/Navbar.tsx +0 -152
  245. package/src/components/SearchBar.less +0 -165
  246. package/src/components/SearchBar.tsx +0 -68
  247. package/src/components/SideMenu.less +0 -379
  248. package/src/components/SideMenu.tsx +0 -148
  249. package/src/components/SlugList.less +0 -18
  250. package/src/components/SlugList.tsx +0 -20
  251. package/src/declaration.d.ts +0 -1
  252. package/src/layout.tsx +0 -226
  253. package/src/style/layout.less +0 -402
  254. package/src/style/markdown.less +0 -240
  255. package/src/style/variables.less +0 -37
  256. package/src/test/SearchBar.test.ts +0 -32
  257. package/src/test/Table.test.tsx +0 -41
  258. package/src/test/index.test.tsx +0 -377
package/src/antv/hooks.ts DELETED
@@ -1,87 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- export interface NavigatorBannerProps {
3
- post?: {
4
- slug?: string;
5
- title?: string;
6
- };
7
- type: "prev" | "next";
8
- }
9
-
10
- export const useChinaMirrorHost = (): [boolean] => {
11
- const [isChinaMirrorHost, setIsChinaMirrorHost] = useState(false);
12
- useEffect(() => {
13
- if (
14
- window.location.host.includes("gitee.io") &&
15
- window.location.host.includes("antv")
16
- ) {
17
- setIsChinaMirrorHost(true);
18
- }
19
- }, []);
20
- return [isChinaMirrorHost];
21
- };
22
-
23
- export const usePrevAndNext = (): NavigatorBannerProps["post"][] => {
24
- const [prevAndNext, setPrevAndNext] = useState<
25
- NavigatorBannerProps["post"][]
26
- >([]);
27
- useEffect(() => {
28
- const menuNodes = document.querySelectorAll("aside .ant-menu-item a");
29
- const currentMenuNode = document.querySelector(
30
- "aside .ant-menu-item-selected a"
31
- );
32
- const currentIndex = Array.from(menuNodes).findIndex(
33
- (node) => node === currentMenuNode
34
- );
35
- const prevNode =
36
- currentIndex - 1 >= 0 ? menuNodes[currentIndex - 1] : undefined;
37
- const nextNode =
38
- currentIndex + 1 < menuNodes.length
39
- ? menuNodes[currentIndex + 1]
40
- : undefined;
41
- const prev = prevNode
42
- ? {
43
- slug: prevNode.getAttribute("href") || undefined,
44
- title: prevNode.textContent || undefined,
45
- }
46
- : undefined;
47
- const next = nextNode
48
- ? {
49
- slug: nextNode.getAttribute("href") || undefined,
50
- title: nextNode.textContent || undefined,
51
- }
52
- : undefined;
53
- setPrevAndNext([prev, next]);
54
- }, []);
55
- return prevAndNext;
56
- };
57
-
58
- export const useLogoLink = ({
59
- link = "",
60
- siteUrl = "",
61
- lang = "",
62
- }: {
63
- link?: string;
64
- siteUrl?: string;
65
- lang?: string;
66
- }): [string] => {
67
- let defaultLogoLink;
68
- if (link) {
69
- defaultLogoLink = link;
70
- } else if (siteUrl === "https://antv.vision") {
71
- defaultLogoLink = `/${lang}`;
72
- } else {
73
- defaultLogoLink = `https://antv.vision/${lang}`;
74
- }
75
-
76
- const [giteeLogoLink, setGiteeLogoLink] = useState("");
77
- useEffect(() => {
78
- if (
79
- window.location.host.includes("gitee.io") &&
80
- window.location.host.includes("antv")
81
- ) {
82
- setGiteeLogoLink(`https://antv.gitee.io/${lang}`);
83
- }
84
- }, []);
85
-
86
- return [giteeLogoLink || defaultLogoLink];
87
- };
@@ -1,21 +0,0 @@
1
- @import "~antd/es/style/themes/default.less";
2
- @primaryColor: #873bf4;
3
-
4
- .container1440() {
5
- width: 1440px;
6
- max-width: calc(100% - 80px);
7
- margin-left: auto;
8
- margin-right: auto;
9
-
10
- @media only screen and (max-width: 931.99px) {
11
- & {
12
- max-width: calc(100% - 60px);
13
- }
14
- }
15
-
16
- @media only screen and (max-width: 767.99px) {
17
- & {
18
- max-width: calc(100% - 32px);
19
- }
20
- }
21
- }
package/src/antv/utils.ts DELETED
@@ -1,44 +0,0 @@
1
- type Status = 'responded' | 'error' | 'timeout';
2
-
3
- export const ping = (callback: (status: Status) => void): NodeJS.Timeout => {
4
- const url =
5
- 'https://private-a' +
6
- 'lipay' +
7
- 'objects.alip' +
8
- 'ay.com/alip' +
9
- 'ay-rmsdeploy-image/rmsportal/RKuAiriJqrUhyqW.png';
10
- const img = new Image();
11
- let done = false;
12
- const finish = (status: Status) => {
13
- if (!done) {
14
- done = true;
15
- img.src = '';
16
- callback(status);
17
- }
18
- };
19
- img.onload = () => finish('responded');
20
- img.onerror = () => finish('error');
21
- img.src = url;
22
- return setTimeout(() => finish('timeout'), 1500);
23
- };
24
-
25
- export const capitalize = (s: string): string => {
26
- if (typeof s !== 'string') {
27
- return '';
28
- }
29
- return s.charAt(0).toUpperCase() + s.slice(1);
30
- };
31
-
32
- export const getChinaMirrorHost = (host?: string): string => {
33
- const hostString = typeof host === 'undefined' ? window.location.host : host;
34
- // antv.vision => antv.gitee.io
35
- if (hostString === 'antv.vision') {
36
- return 'antv.gitee.io';
37
- }
38
- // g2plot.antv.vision => antv-g2plot.gitee.io
39
- const match = hostString.match(/(.*)\.antv\.vision/);
40
- if (match && match[1]) {
41
- return `antv-${match[1]}.gitee.io`;
42
- }
43
- return hostString;
44
- };
@@ -1,57 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import type { IApiComponentProps} from 'dumi/theme';
3
- import { context, useApiData, AnchorLink } from 'dumi/theme';
4
-
5
- const LOCALE_TEXTS = {
6
- 'zh-CN': {
7
- name: '属性名',
8
- description: '描述',
9
- type: '类型',
10
- default: '默认值',
11
- required: '(必选)',
12
- },
13
- 'en-US': {
14
- name: 'Name',
15
- description: 'Description',
16
- type: 'Type',
17
- default: 'Default',
18
- required: '(required)',
19
- },
20
- };
21
-
22
- export default ({ identifier, export: expt }: IApiComponentProps) => {
23
- const data = useApiData(identifier);
24
- const { locale } = useContext(context);
25
- const texts = /^zh|cn$/i.test(locale) ? LOCALE_TEXTS['zh-CN'] : LOCALE_TEXTS['en-US'];
26
-
27
- return (
28
- <>
29
- {data && (
30
- <table style={{ marginTop: 24 }}>
31
- <thead>
32
- <tr>
33
- <th>{texts.name}</th>
34
- <th>{texts.description}</th>
35
- <th>{texts.type}</th>
36
- <th>{texts.default}</th>
37
- </tr>
38
- </thead>
39
- <tbody>
40
- {data[expt].map(row => (
41
- <tr key={row.identifier}>
42
- <td>{row.identifier}</td>
43
- <td>{row.description || '--'}</td>
44
- <td>
45
- <code>{row.type}</code>
46
- </td>
47
- <td>
48
- <code>{row.default || (row.required && texts.required) || '--'}</code>
49
- </td>
50
- </tr>
51
- ))}
52
- </tbody>
53
- </table>
54
- )}
55
- </>
56
- );
57
- };
@@ -1,62 +0,0 @@
1
- @import (reference) '../style/variables.less';
2
-
3
- .@{prefix}-alert {
4
- @s-border-right: 3px;
5
-
6
- position: relative;
7
- margin: 24px 0;
8
- padding: 10px 20px;
9
- color: @c-text;
10
- font-size: 14px;
11
- line-height: 20px;
12
- border-left: 0;
13
- background: #ffffff;
14
- box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.06);
15
- border-radius: 1px;
16
-
17
- [data-prefers-color=dark] & {
18
- color: @c-text-dark;
19
- background: @c-bg-dark;
20
- box-shadow: 0 1px 2px -2px rgba(0,0,0,0.64), 0 3px 6px 0 rgba(0,0,0,0.48), 0 5px 12px 4px rgba(0,0,0,0.36);
21
- }
22
-
23
- &::after {
24
- content: '';
25
- position: absolute;
26
- display: inline-block;
27
- top: 0;
28
- left: 0;
29
- bottom: 0;
30
- width: @s-border-right;
31
- border-radius: 1px;
32
- }
33
-
34
- &:first-child {
35
- margin-top: 0;
36
- }
37
-
38
- &:not([type]),
39
- &[type='warning'] {
40
- &::after {
41
- background: #ffc121;
42
- }
43
- }
44
-
45
- &[type='info'] {
46
- &::after {
47
- background: #69b9ff;
48
- }
49
- }
50
-
51
- &[type='success'] {
52
- &::after {
53
- background: #8cd225;
54
- }
55
- }
56
-
57
- &[type='error'] {
58
- &::after {
59
- background: #ff4646;
60
- }
61
- }
62
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './Alert.less';
3
-
4
- export default (props: any) => <div className="__dumi-default-alert" {...props} />;
@@ -1,31 +0,0 @@
1
- @import (reference) '../style/variables.less';
2
-
3
- .@{prefix}-badge {
4
- display: inline-block;
5
- margin-left: 6px;
6
- padding: 1px 7px;
7
- color: #fff;
8
- font-size: 13px;
9
- line-height: 20px;
10
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1);
11
- box-shadow: 0 6px 16px -2px rgba(0, 0, 0, 0.06);
12
- border-radius: 1px;
13
- vertical-align: top;
14
-
15
- &:not([type]),
16
- &[type='info'] {
17
- background: #4569d4;
18
- }
19
-
20
- &[type='warning'] {
21
- background: #ffc121;
22
- }
23
-
24
- &[type='success'] {
25
- background: #8cd225;
26
- }
27
-
28
- &[type='error'] {
29
- background: #ff4646;
30
- }
31
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './Badge.less';
3
-
4
- export default (props: any) => <span className="__dumi-default-badge" {...props} />;
@@ -1,47 +0,0 @@
1
- @import (reference) '../style/variables.less';
2
-
3
- .@{prefix}-example-wrapper {
4
- padding-top: 16px;
5
- height: calc(100vh - @s-nav-height - 2px);
6
-
7
- @media @mobile {
8
- padding-top: 16px;
9
- }
10
-
11
- &-toolbar {
12
- display: flex;
13
- color: @c-heading;
14
- font-size: 16px;
15
- font-weight: 500;
16
- justify-content: space-between;
17
- margin-bottom: 16px;
18
- border-bottom: 1px solid @c-border;
19
-
20
- button,
21
- a {
22
- display: inline-block;
23
- margin: 6px 0 6px 12px;
24
- width: 16px;
25
- height: 16px;
26
- font-weight: 400;
27
- border: 0;
28
- outline: none;
29
- vertical-align: middle;
30
- cursor: pointer;
31
-
32
- &:first-child {
33
- background-position-x: -144px;
34
- }
35
-
36
- &:nth-child(2) {
37
- background-position-x: -126px;
38
- }
39
- }
40
- }
41
-
42
- iframe {
43
- width: 100%;
44
- min-height: 100%;
45
- border: 0;
46
- }
47
- }
@@ -1,34 +0,0 @@
1
- import React, { useRef, useEffect, useState } from 'react';
2
- import './Example.less';
3
-
4
- export default (props: { route: any }) => {
5
- const elm = useRef<HTMLIFrameElement>();
6
- const [height, setHeight] = useState(0);
7
-
8
- useEffect(() => {
9
- setHeight(elm.current.contentWindow.document.documentElement.scrollHeight);
10
- }, [elm]);
11
-
12
- return (
13
- props.route.meta.examplePath && (
14
- <div className="__dumi-default-example-wrapper">
15
- <div className="__dumi-default-example-wrapper-toolbar">
16
- {props.route.meta.description || props.route.meta.title}
17
- <span>
18
- <button
19
- className="__dumi-default-icon"
20
- onClick={() => elm.current.contentWindow.location.reload()}
21
- />
22
- <a
23
- target="_blank"
24
- rel="noopener noreferrer"
25
- href={props.route.meta.examplePath}
26
- className="__dumi-default-icon"
27
- />
28
- </span>
29
- </div>
30
- <iframe src={props.route.meta.examplePath} ref={elm} style={{ height }} title="dumi" />
31
- </div>
32
- )
33
- );
34
- };