@antv/dumi-theme-antv 0.2.2 → 0.3.0-beta.10

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 (265) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +32 -33
  3. package/dist/builtins/Playground/index.d.ts +21 -0
  4. package/dist/builtins/Playground/index.js +69 -0
  5. package/dist/builtins/Playground/index.module.less +15 -0
  6. package/dist/context.d.ts +6 -0
  7. package/dist/context.js +2 -0
  8. package/dist/layouts/DocLayout.d.ts +7 -0
  9. package/dist/layouts/DocLayout.js +48 -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 +79 -0
  14. package/dist/layouts/entry/Manual.d.ts +8 -0
  15. package/dist/layouts/entry/Manual.js +13 -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 +18 -0
  20. package/dist/pages/Example/index.d.ts +6 -0
  21. package/dist/pages/Example/index.js +115 -0
  22. package/dist/pages/Example/index.module.less +82 -0
  23. package/dist/pages/Example/utils.d.ts +1 -0
  24. package/dist/pages/Example/utils.js +9 -0
  25. package/dist/pages/Examples/components/Accouncement/index.d.ts +6 -0
  26. package/dist/pages/Examples/components/Accouncement/index.js +60 -0
  27. package/dist/pages/Examples/components/Accouncement/index.module.less +9 -0
  28. package/dist/pages/Examples/components/Article/index.d.ts +2 -0
  29. package/dist/pages/Examples/components/Article/index.js +8 -0
  30. package/dist/pages/Examples/components/Article/index.module.less +2 -0
  31. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.d.ts +10 -0
  32. package/dist/pages/Examples/components/ExampleTopicMenu/components/LeftMenu/index.js +74 -0
  33. package/dist/pages/Examples/components/ExampleTopicMenu/index.d.ts +9 -0
  34. package/{es/builtins/Example.js → dist/pages/Examples/components/ExampleTopicMenu/index.js} +47 -33
  35. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.d.ts +10 -0
  36. package/dist/pages/Examples/components/GalleryPageContent/DemoCard/index.js +33 -0
  37. package/dist/pages/Examples/components/GalleryPageContent/index.d.ts +10 -0
  38. package/dist/pages/Examples/components/GalleryPageContent/index.js +81 -0
  39. package/dist/pages/Examples/index.d.ts +8 -0
  40. package/dist/pages/Examples/index.js +95 -0
  41. package/dist/pages/Examples/index.module.less +607 -0
  42. package/dist/pages/Examples/types.d.ts +34 -0
  43. package/dist/pages/Examples/types.js +1 -0
  44. package/dist/plugin/examples.d.ts +21 -0
  45. package/dist/plugin/examples.js +105 -0
  46. package/dist/plugin/index.d.ts +3 -0
  47. package/dist/plugin/index.js +113 -0
  48. package/dist/plugin/utils.d.ts +5 -0
  49. package/dist/plugin/utils.js +46 -0
  50. package/dist/slots/404.d.ts +2 -0
  51. package/{es/antv/404/index.js → dist/slots/404.js} +4 -9
  52. package/{es/antv/Cases/Cases.d.ts → dist/slots/Cases/index.d.ts} +5 -4
  53. package/{es/antv/Cases/Cases.js → dist/slots/Cases/index.js} +25 -25
  54. package/{src/antv/Cases/Cases.module.less → dist/slots/Cases/index.module.less} +36 -5
  55. package/dist/slots/CodeEditor/Toolbar.d.ts +67 -0
  56. package/dist/slots/CodeEditor/Toolbar.js +140 -0
  57. package/dist/slots/CodeEditor/Toolbar.module.less +81 -0
  58. package/dist/slots/CodeEditor/index.d.ts +58 -0
  59. package/dist/slots/CodeEditor/index.js +226 -0
  60. package/dist/slots/CodeEditor/index.module.less +11 -0
  61. package/dist/slots/CodeEditor/utils.d.ts +42 -0
  62. package/dist/slots/CodeEditor/utils.js +157 -0
  63. package/dist/slots/CodePreview/CodeHeader.d.ts +19 -0
  64. package/dist/slots/CodePreview/CodeHeader.js +32 -0
  65. package/dist/slots/CodePreview/CodeHeader.module.less +0 -0
  66. package/dist/slots/CodePreview/index.d.ts +17 -0
  67. package/dist/slots/CodePreview/index.js +29 -0
  68. package/dist/slots/CodePreview/index.module.less +43 -0
  69. package/dist/slots/CodeRunner/index.d.ts +15 -0
  70. package/dist/slots/CodeRunner/index.js +79 -0
  71. package/dist/slots/CodeRunner/index.module.less +0 -0
  72. package/dist/slots/CodeRunner/utils.d.ts +11 -0
  73. package/dist/slots/CodeRunner/utils.js +36 -0
  74. package/dist/slots/Companies/index.d.ts +13 -0
  75. package/dist/slots/Companies/index.js +49 -0
  76. package/dist/slots/Companies/index.module.less +82 -0
  77. package/dist/slots/Detail/News.d.ts +10 -0
  78. package/{es/antv/Banner/Notification.js → dist/slots/Detail/News.js} +8 -11
  79. package/{src/antv/Banner/Notification.module.less → dist/slots/Detail/News.module.less} +15 -3
  80. package/dist/slots/Detail/index.d.ts +27 -0
  81. package/dist/slots/Detail/index.js +124 -0
  82. package/{src/antv/Banner/Banner.module.less → dist/slots/Detail/index.module.less} +42 -74
  83. package/dist/slots/ExampleSider/index.d.ts +21 -0
  84. package/dist/slots/ExampleSider/index.js +196 -0
  85. package/dist/slots/ExampleSider/index.module.less +141 -0
  86. package/{es/antv → dist/slots}/Features/FeatureCard.d.ts +2 -1
  87. package/{es/antv → dist/slots}/Features/FeatureCard.js +6 -6
  88. package/{src/antv → dist/slots}/Features/FeatureCard.module.less +8 -1
  89. package/{es/antv → dist/slots}/Features/index.d.ts +2 -2
  90. package/{es/antv → dist/slots}/Features/index.js +19 -26
  91. package/{src/antv/Features/Features.module.less → dist/slots/Features/index.module.less} +34 -3
  92. package/dist/slots/Footer/index.d.ts +18 -0
  93. package/dist/slots/Footer/index.js +188 -0
  94. package/dist/slots/Footer/index.module.less +86 -0
  95. package/dist/slots/Header/Logo.d.ts +7 -0
  96. package/{es/antv → dist/slots}/Header/Logo.js +6 -2
  97. package/dist/slots/Header/LogoWhite.d.ts +7 -0
  98. package/dist/slots/Header/LogoWhite.js +19 -0
  99. package/dist/slots/Header/Navs.d.ts +26 -0
  100. package/dist/slots/Header/Navs.js +63 -0
  101. package/dist/slots/Header/Products/NavigatorBanner.d.ts +10 -0
  102. package/dist/slots/Header/Products/NavigatorBanner.js +34 -0
  103. package/dist/slots/Header/Products/NavigatorBanner.module.less +39 -0
  104. package/{es/antv → dist/slots/Header}/Products/Product.d.ts +3 -3
  105. package/{es/antv → dist/slots/Header}/Products/Product.js +11 -16
  106. package/{src/antv → dist/slots/Header}/Products/Product.module.less +10 -8
  107. package/{es/antv → dist/slots/Header}/Products/getProducts.d.ts +2 -7
  108. package/dist/slots/Header/Products/getProducts.js +67 -0
  109. package/dist/slots/Header/Products/index.d.ts +9 -0
  110. package/{es/antv → dist/slots/Header}/Products/index.js +15 -22
  111. package/dist/slots/Header/Search.d.ts +12 -0
  112. package/dist/slots/Header/Search.js +90 -0
  113. package/dist/slots/Header/Search.module.less +39 -0
  114. package/dist/slots/Header/index.d.ts +66 -0
  115. package/dist/slots/Header/index.js +380 -0
  116. package/dist/slots/Header/index.module.less +382 -0
  117. package/dist/slots/Header/utils.d.ts +1 -0
  118. package/dist/slots/Header/utils.js +26 -0
  119. package/dist/slots/Loading/index.d.ts +7 -0
  120. package/dist/slots/Loading/index.js +79 -0
  121. package/dist/slots/Loading/index.module.less +279 -0
  122. package/dist/slots/ManualContent/NavigatorBanner.d.ts +9 -0
  123. package/dist/slots/ManualContent/NavigatorBanner.js +36 -0
  124. package/dist/slots/ManualContent/NavigatorBanner.module.less +39 -0
  125. package/dist/slots/ManualContent/ReadingTime.d.ts +3 -0
  126. package/dist/slots/ManualContent/ReadingTime.js +10 -0
  127. package/dist/slots/ManualContent/index.d.ts +9 -0
  128. package/dist/slots/ManualContent/index.js +344 -0
  129. package/dist/slots/ManualContent/index.module.less +668 -0
  130. package/dist/slots/ManualContent/utils.d.ts +3 -0
  131. package/dist/slots/ManualContent/utils.js +35 -0
  132. package/dist/slots/SEO.d.ts +10 -0
  133. package/dist/slots/SEO.js +59 -0
  134. package/dist/slots/TOC.d.ts +5 -0
  135. package/dist/slots/TOC.js +6 -0
  136. package/dist/slots/_.less +83 -0
  137. package/dist/slots/global.d.ts +1 -0
  138. package/dist/slots/global.js +7 -0
  139. package/dist/slots/hooks.d.ts +16 -0
  140. package/{es/antv → dist/slots}/hooks.js +60 -37
  141. package/dist/slots/utils.d.ts +5 -0
  142. package/dist/slots/utils.js +112 -0
  143. package/dist/types.d.ts +86 -0
  144. package/dist/types.js +1 -0
  145. package/dist/typings.d.ts +24 -0
  146. package/package.json +110 -47
  147. package/es/antv/404/index.d.ts +0 -2
  148. package/es/antv/Banner/Banner.module.less +0 -412
  149. package/es/antv/Banner/Notification.d.ts +0 -10
  150. package/es/antv/Banner/Notification.module.less +0 -108
  151. package/es/antv/Banner/index.d.ts +0 -25
  152. package/es/antv/Banner/index.js +0 -104
  153. package/es/antv/Cases/Cases.module.less +0 -203
  154. package/es/antv/Features/FeatureCard.module.less +0 -51
  155. package/es/antv/Features/Features.module.less +0 -169
  156. package/es/antv/Footer/Footer.module.less +0 -36
  157. package/es/antv/Footer/index.d.ts +0 -12
  158. package/es/antv/Footer/index.js +0 -237
  159. package/es/antv/Header/Logo.d.ts +0 -4
  160. package/es/antv/Products/Product.module.less +0 -146
  161. package/es/antv/Products/getNewProducts.d.ts +0 -24
  162. package/es/antv/Products/getNewProducts.js +0 -35
  163. package/es/antv/Products/getProducts.js +0 -460
  164. package/es/antv/Products/index.d.ts +0 -9
  165. package/es/antv/hooks.d.ts +0 -14
  166. package/es/antv/mixins.less +0 -21
  167. package/es/antv/utils.d.ts +0 -5
  168. package/es/antv/utils.js +0 -49
  169. package/es/builtins/API.d.ts +0 -3
  170. package/es/builtins/API.js +0 -37
  171. package/es/builtins/Alert.d.ts +0 -3
  172. package/es/builtins/Alert.js +0 -7
  173. package/es/builtins/Alert.less +0 -62
  174. package/es/builtins/Badge.d.ts +0 -3
  175. package/es/builtins/Badge.js +0 -7
  176. package/es/builtins/Badge.less +0 -31
  177. package/es/builtins/Example.d.ts +0 -5
  178. package/es/builtins/Example.less +0 -47
  179. package/es/builtins/Previewer.d.ts +0 -39
  180. package/es/builtins/Previewer.js +0 -225
  181. package/es/builtins/Previewer.less +0 -406
  182. package/es/builtins/SourceCode.d.ts +0 -10
  183. package/es/builtins/SourceCode.js +0 -70
  184. package/es/builtins/SourceCode.less +0 -103
  185. package/es/builtins/Table.d.ts +0 -4
  186. package/es/builtins/Table.js +0 -56
  187. package/es/builtins/Table.less +0 -43
  188. package/es/builtins/Tree.d.ts +0 -4
  189. package/es/builtins/Tree.js +0 -213
  190. package/es/builtins/Tree.less +0 -159
  191. package/es/components/Dark.d.ts +0 -9
  192. package/es/components/Dark.js +0 -125
  193. package/es/components/Dark.less +0 -121
  194. package/es/components/LocaleSelect.d.ts +0 -6
  195. package/es/components/LocaleSelect.js +0 -53
  196. package/es/components/LocaleSelect.less +0 -59
  197. package/es/components/Navbar.d.ts +0 -10
  198. package/es/components/Navbar.js +0 -155
  199. package/es/components/Navbar.less +0 -180
  200. package/es/components/SearchBar.d.ts +0 -4
  201. package/es/components/SearchBar.js +0 -81
  202. package/es/components/SearchBar.less +0 -165
  203. package/es/components/SideMenu.d.ts +0 -10
  204. package/es/components/SideMenu.js +0 -99
  205. package/es/components/SideMenu.less +0 -379
  206. package/es/components/SlugList.d.ts +0 -7
  207. package/es/components/SlugList.js +0 -38
  208. package/es/components/SlugList.less +0 -18
  209. package/es/declaration.d.ts +0 -1
  210. package/es/layout.d.ts +0 -5
  211. package/es/layout.js +0 -276
  212. package/es/style/layout.less +0 -402
  213. package/es/style/markdown.less +0 -240
  214. package/es/style/variables.less +0 -37
  215. package/src/antv/404/index.tsx +0 -25
  216. package/src/antv/Banner/Notification.tsx +0 -45
  217. package/src/antv/Banner/index.tsx +0 -139
  218. package/src/antv/Cases/Cases.tsx +0 -116
  219. package/src/antv/Features/FeatureCard.tsx +0 -24
  220. package/src/antv/Features/index.tsx +0 -86
  221. package/src/antv/Footer/Footer.module.less +0 -36
  222. package/src/antv/Footer/index.tsx +0 -272
  223. package/src/antv/Header/Logo.tsx +0 -85
  224. package/src/antv/Products/Product.tsx +0 -80
  225. package/src/antv/Products/getNewProducts.tsx +0 -53
  226. package/src/antv/Products/getProducts.tsx +0 -626
  227. package/src/antv/Products/index.tsx +0 -70
  228. package/src/antv/hooks.ts +0 -87
  229. package/src/antv/mixins.less +0 -21
  230. package/src/antv/utils.ts +0 -44
  231. package/src/builtins/API.tsx +0 -57
  232. package/src/builtins/Alert.less +0 -62
  233. package/src/builtins/Alert.tsx +0 -4
  234. package/src/builtins/Badge.less +0 -31
  235. package/src/builtins/Badge.tsx +0 -4
  236. package/src/builtins/Example.less +0 -47
  237. package/src/builtins/Example.tsx +0 -34
  238. package/src/builtins/Previewer.less +0 -406
  239. package/src/builtins/Previewer.tsx +0 -264
  240. package/src/builtins/SourceCode.less +0 -103
  241. package/src/builtins/SourceCode.tsx +0 -55
  242. package/src/builtins/Table.less +0 -43
  243. package/src/builtins/Table.tsx +0 -42
  244. package/src/builtins/Tree.less +0 -159
  245. package/src/builtins/Tree.tsx +0 -130
  246. package/src/components/Dark.less +0 -121
  247. package/src/components/Dark.tsx +0 -78
  248. package/src/components/LocaleSelect.less +0 -59
  249. package/src/components/LocaleSelect.tsx +0 -53
  250. package/src/components/Navbar.less +0 -180
  251. package/src/components/Navbar.tsx +0 -152
  252. package/src/components/SearchBar.less +0 -165
  253. package/src/components/SearchBar.tsx +0 -68
  254. package/src/components/SideMenu.less +0 -379
  255. package/src/components/SideMenu.tsx +0 -148
  256. package/src/components/SlugList.less +0 -18
  257. package/src/components/SlugList.tsx +0 -20
  258. package/src/declaration.d.ts +0 -1
  259. package/src/layout.tsx +0 -225
  260. package/src/style/layout.less +0 -402
  261. package/src/style/markdown.less +0 -240
  262. package/src/style/variables.less +0 -37
  263. package/src/test/SearchBar.test.ts +0 -32
  264. package/src/test/Table.test.tsx +0 -41
  265. package/src/test/index.test.tsx +0 -377
@@ -1,406 +0,0 @@
1
- @import (reference) '../style/variables.less';
2
-
3
- .@{prefix}-previewer {
4
- background-color: #fff;
5
- border: 1px solid @c-border;
6
- border-radius: 1px;
7
-
8
- [data-prefers-color=dark] & {
9
- background-color: @c-bg-dark;
10
- border-color: @c-border-dark;
11
- }
12
-
13
- &[data-debug] {
14
- margin-top: 32px;
15
- border-color: #ffcb00;
16
-
17
- &::before {
18
- content: 'DEV ONLY';
19
- float: left;
20
- margin-left: -1px;
21
- margin-top: -18px;
22
- padding: 3px 6px;
23
- font-size: 12px;
24
- line-height: 1;
25
- background-color: #ffcb00;
26
- color: #735600;
27
- text-shadow: 0.5px 0.5px 0 rgba(255, 255, 255, 0.5);
28
- border-top-left-radius: 1px;
29
- border-top-right-radius: 1px;
30
- }
31
- }
32
-
33
- &[data-iframe] {
34
- .@{prefix}-previewer-browser-nav {
35
- padding: 2px 6px;
36
- background-color: @c-border;
37
-
38
- &::before {
39
- @s-btn: 12px;
40
- @s-btn-gap: 8px;
41
-
42
- content: '';
43
- display: inline-block;
44
- width: @s-btn;
45
- height: @s-btn;
46
- border-radius: 50%;
47
- background-color: #fd6458;
48
- box-shadow: (@s-btn + @s-btn-gap) 0 0 #ffbf2b, (@s-btn + @s-btn-gap) * 2 0 0 #24cc3d;
49
- }
50
- }
51
-
52
- .@{prefix}-previewer-demo > iframe {
53
- border: 0;
54
- width: 100%;
55
- height: 300px;
56
- }
57
- }
58
-
59
- + .@{prefix}-previewer {
60
- margin-top: 32px;
61
- }
62
-
63
- &-demo {
64
- padding: 40px 24px;
65
- }
66
-
67
- &-target {
68
- border-color: fade(@c-primary, 50%);
69
- box-shadow: 0 0 0 5px fade(@c-primary, 5%);
70
-
71
- [data-prefers-color=dark] & {
72
- box-shadow: 0 0 0 5px fade(@c-primary, 30%);
73
- }
74
- }
75
-
76
- &-desc {
77
- > div:last-child {
78
- padding: 1.2em 1em 1em;
79
- color: @c-text;
80
- border-top: 1px solid @c-border;
81
-
82
- [data-prefers-color=dark] & {
83
- border-color: @c-border-dark;
84
- }
85
- }
86
-
87
- .markdown > p:first-child {
88
- margin-top: 0;
89
- }
90
-
91
- .markdown > p:last-child {
92
- margin-bottom: 0;
93
- }
94
-
95
- &[data-title] {
96
- position: relative;
97
-
98
- > a:first-child {
99
- position: absolute;
100
- top: 0;
101
- left: 1em;
102
- margin-left: -4px;
103
- padding: 0 4px;
104
- color: @c-heading;
105
- font-size: inherit;
106
- font-weight: 500;
107
- background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0)) 100%;
108
- transform: translateY(-50%);
109
- pointer-events: auto;
110
- cursor: pointer;
111
-
112
- [data-prefers-color=dark] & {
113
- color: @c-heading-dark;
114
- background: linear-gradient(to top, @c-bg-dark, @c-bg-dark 50%, rgba(255, 255, 255, 0)) 100%;
115
- }
116
- }
117
-
118
- &:empty {
119
- padding-top: 0;
120
-
121
- // modify action area style when only has title field
122
- + .@{prefix}-previewer-actions {
123
- height: 46px;
124
- border-top-style: solid;
125
- }
126
- }
127
- }
128
- }
129
-
130
- &-actions {
131
- display: flex;
132
- height: 40px;
133
- padding: 0 1em;
134
- align-items: center;
135
- border-top: 1px dashed @c-border;
136
-
137
- [data-prefers-color=dark] & {
138
- border-color: @c-border-dark;
139
- }
140
-
141
- > a:not(:last-child),
142
- > button:not(:last-child) {
143
- margin-right: 8px;
144
- }
145
-
146
- > a {
147
- display: flex;
148
- }
149
-
150
- button {
151
- position: relative;
152
- display: inline-block;
153
- width: 16px;
154
- height: 16px;
155
- padding: 0;
156
- border: 0;
157
- box-sizing: border-box;
158
- cursor: pointer;
159
- opacity: 0.6;
160
- outline: none;
161
- transition: opacity 0.2s, background 0.2s;
162
-
163
- [data-prefers-color=dark] & {
164
- opacity: 1;
165
- }
166
-
167
- // expand click area
168
- &::after {
169
- content: '';
170
- position: absolute;
171
- top: -8px;
172
- left: -8px;
173
- right: -8px;
174
- bottom: -8px;
175
- }
176
-
177
- &:hover {
178
- opacity: 0.8;
179
- }
180
-
181
- &:active {
182
- opacity: 0.9;
183
- }
184
-
185
- &:disabled {
186
- opacity: 0.2;
187
- cursor: not-allowed;
188
- }
189
-
190
- &[role='codesandbox'] {
191
- background-position: -18px 0;
192
- }
193
-
194
- &[role='codepen'] {
195
- background-position: -36px 0;
196
- }
197
-
198
- &[role='source'] {
199
- background-position: -72px 0;
200
- }
201
-
202
- &[role='change-jsx'] {
203
- background-position: -90px 0;
204
- }
205
-
206
- &[role='change-tsx'] {
207
- background-position: -108px 0;
208
- }
209
-
210
- &[role='open-demo'] {
211
- background-position: -126px 0;
212
- }
213
-
214
- &[role='motions'] {
215
- background-position: -162px 0;
216
- }
217
-
218
- &[role='sketch-component'] {
219
- background-position: -182px 0;
220
- }
221
-
222
- &[role='sketch-group'] {
223
- background-position: -200px 0;
224
- }
225
-
226
- &[role='copy'][data-status='ready'] {
227
- background-position: -54px 0;
228
- }
229
-
230
- &[role='copy'][data-status='copied'] {
231
- pointer-events: none;
232
- background-position: -54px -16px;
233
- }
234
-
235
- &[role='refresh'] {
236
- background-position-x: -144px;
237
- }
238
- }
239
-
240
- // split action buttons by a blank node
241
- > span {
242
- flex: 1;
243
- display: inline-block;
244
- }
245
- }
246
-
247
- &-source {
248
- border-top: 1px dashed @c-border;
249
-
250
- [data-prefers-color=dark] & {
251
- border-color: @c-border-dark;
252
- }
253
-
254
- &-tab {
255
- border-top: 1px dashed @c-border;
256
-
257
- [data-prefers-color=dark] & {
258
- border-color: @c-border-dark;
259
- }
260
-
261
- .@{prefix}-tabs-tab-btn {
262
- position: relative;
263
- padding-left: 32px;
264
-
265
- &::before,
266
- &::after {
267
- content: '';
268
- position: absolute;
269
- margin-right: 4px;
270
- display: inline-block;
271
- box-sizing: border-box;
272
- }
273
-
274
- &::before {
275
- left: 16px;
276
- top: 50%;
277
- margin-top: -6px;
278
- width: 10px;
279
- height: 12px;
280
- border: 1px solid @c-secondary;
281
- }
282
-
283
- &::after {
284
- top: 50%;
285
- left: 23px;
286
- margin-top: -7px;
287
- width: 4px;
288
- height: 4px;
289
- background: #fff;
290
- border-bottom: 1px solid @c-secondary;
291
- transform: rotate(45deg);
292
- [data-prefers-color=dark] & {
293
- background: @c-bg-dark;
294
- }
295
- }
296
- }
297
- }
298
- }
299
- }
300
-
301
- .@{prefix}-tabs {
302
- overflow: hidden;
303
-
304
- &.@{prefix}-tabs-top {
305
- flex-direction: column;
306
-
307
- .@{prefix}-tabs-ink-bar {
308
- bottom: 0;
309
- }
310
- }
311
-
312
- &-nav {
313
- display: flex;
314
-
315
- &-wrap {
316
- display: flex;
317
- white-space: nowrap;
318
- overflow: hidden;
319
-
320
- &&-ping-left {
321
- box-shadow: 5px 0 5px -5px rgba(0, 0, 0, 0.1) inset;
322
- }
323
-
324
- &&-ping-right ~ * > .@{prefix}-tabs-nav-more {
325
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
326
- }
327
- }
328
-
329
- &-list {
330
- position: relative;
331
- display: flex;
332
- transition: transform 0.2s;
333
- }
334
-
335
- &-more {
336
- height: 100%;
337
- cursor: pointer;
338
- background: none;
339
- border: 0;
340
- transition: box-shadow 0.2s;
341
- }
342
- }
343
-
344
- &-tab {
345
- display: flex;
346
-
347
- &-btn {
348
- padding: 0 16px;
349
- font-size: 14px;
350
- line-height: 36px;
351
- border: 0;
352
- outline: none;
353
- background: transparent;
354
- box-sizing: border-box;
355
- cursor: pointer;
356
-
357
- &:hover {
358
- color: @c-primary;
359
- }
360
- }
361
- }
362
-
363
- &-ink-bar {
364
- position: absolute;
365
- height: 2px;
366
- background: @c-primary;
367
- transition: left 0.2s, width 0.2s;
368
- pointer-events: none;
369
-
370
- [data-prefers-color=dark] & {
371
- background: @c-primary-dark;
372
- }
373
- }
374
-
375
- &-dropdown {
376
- position: absolute;
377
- background: #fff;
378
- border: 1px solid @c-border;
379
- max-height: 200px;
380
- overflow: auto;
381
-
382
- > ul {
383
- list-style: none;
384
- margin: 0;
385
- padding: 0;
386
-
387
- > li {
388
- padding: 4px 12px;
389
- font-size: 14px;
390
- cursor: pointer;
391
-
392
- &:hover {
393
- color: @c-primary;
394
- }
395
-
396
- &:not(:last-child) {
397
- border-bottom: 1px dashed @c-border;
398
- }
399
- }
400
- }
401
-
402
- &-hidden {
403
- display: none;
404
- }
405
- }
406
- }
@@ -1,10 +0,0 @@
1
- import type { Language } from 'prism-react-renderer';
2
- import 'prismjs/themes/prism.css';
3
- import './SourceCode.less';
4
- export interface ICodeBlockProps {
5
- code: string;
6
- lang: Language;
7
- showCopy?: boolean;
8
- }
9
- declare const _default: ({ code, lang, showCopy }: ICodeBlockProps) => JSX.Element;
10
- export default _default;
@@ -1,70 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
- import { useCopy } from 'dumi/theme';
14
- import Highlight, { defaultProps } from 'prism-react-renderer';
15
- import 'prismjs/themes/prism.css';
16
- import React from 'react';
17
- import './SourceCode.less';
18
- /**
19
- * define DSL which can be highlighted as similar language
20
- */
21
-
22
- var SIMILAR_DSL = {
23
- acss: 'css',
24
- axml: 'xml'
25
- };
26
- export default (function (_ref) {
27
- var code = _ref.code,
28
- lang = _ref.lang,
29
- _ref$showCopy = _ref.showCopy,
30
- showCopy = _ref$showCopy === void 0 ? true : _ref$showCopy;
31
-
32
- var _useCopy = useCopy(),
33
- _useCopy2 = _slicedToArray(_useCopy, 2),
34
- copyCode = _useCopy2[0],
35
- copyStatus = _useCopy2[1];
36
-
37
- return /*#__PURE__*/React.createElement("div", {
38
- className: "__dumi-default-code-block"
39
- }, /*#__PURE__*/React.createElement(Highlight, Object.assign({}, defaultProps, {
40
- code: code,
41
- language: SIMILAR_DSL[lang] || lang,
42
- theme: undefined
43
- }), function (_ref2) {
44
- var className = _ref2.className,
45
- style = _ref2.style,
46
- tokens = _ref2.tokens,
47
- getLineProps = _ref2.getLineProps,
48
- getTokenProps = _ref2.getTokenProps;
49
- return /*#__PURE__*/React.createElement("pre", {
50
- className: className,
51
- style: style
52
- }, showCopy && /*#__PURE__*/React.createElement("button", {
53
- className: "__dumi-default-icon __dumi-default-code-block-copy-btn",
54
- "data-status": copyStatus,
55
- onClick: function onClick() {
56
- return copyCode(code);
57
- }
58
- }), tokens.map(function (line, i) {
59
- return /*#__PURE__*/React.createElement("div", Object.assign({}, getLineProps({
60
- line: line,
61
- key: i
62
- })), line.map(function (token, key) {
63
- return /*#__PURE__*/React.createElement("span", Object.assign({}, getTokenProps({
64
- token: token,
65
- key: key
66
- })));
67
- }));
68
- }));
69
- }));
70
- });
@@ -1,103 +0,0 @@
1
- @import (reference) '../style/variables.less';
2
-
3
- .@{prefix}-code-block {
4
- position: relative;
5
- font-size: 14px;
6
- background-color: @c-light-bg;
7
-
8
- [data-prefers-color=dark] & {
9
- color: @c-text-dark;
10
- background: #262626;
11
- }
12
-
13
- & + &,
14
- & + table {
15
- margin-top: 16px;
16
- }
17
-
18
- > pre[class*='language-'] {
19
- margin: 0;
20
- background: transparent;
21
-
22
- .token-line:not(:last-child) .plain:empty {
23
- display: inline-block;
24
- min-height: 1em;
25
- }
26
- }
27
-
28
- &-copy-btn {
29
- position: absolute;
30
- top: 1.1em;
31
- right: 1em;
32
- display: inline-block;
33
- width: 16px;
34
- height: 16px;
35
- padding: 0;
36
- border: 0;
37
- outline: none;
38
- cursor: pointer;
39
- opacity: 0.6;
40
- transition: opacity 0.2s, background 0.2s;
41
-
42
- &:hover {
43
- opacity: 0.8;
44
- }
45
-
46
- &:active {
47
- opacity: 0.9;
48
- }
49
-
50
- &[data-status='ready'] {
51
- background-position: -54px 0;
52
- }
53
-
54
- &[data-status='copied'] {
55
- opacity: 1;
56
- pointer-events: none;
57
- background-position: -54px -16px;
58
- }
59
- }
60
-
61
- &:not(:hover) &-copy-btn {
62
- visibility: hidden;
63
- opacity: 0;
64
- }
65
- }
66
-
67
- code[class*="language-"], pre[class*="language-"] {
68
- &::selection, & ::selection{
69
- color: inherit;
70
- }
71
- }
72
-
73
- [data-prefers-color=dark] {
74
- code[class*="language-"], pre[class*="language-"] {
75
- color: @c-text-dark;
76
- text-shadow: 0 1px #000;
77
-
78
- &::selection, & ::selection{
79
- background-color: #364a63;
80
- }
81
- }
82
- .token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string {
83
- background: transparent;
84
- }
85
- .token.property, .token.tag, .token.constant, .token.symbol, .token.deleted {
86
- color: #f92672;
87
- }
88
- .token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted {
89
- color: #a6e22e;
90
- }
91
- .token.atrule, .token.attr-value, .token.keyword {
92
- color: #e6db74;
93
- }
94
- .token.punctuation {
95
- color: @c-text-dark;
96
- }
97
- .token.keyword {
98
- color: #66d9ef;
99
- }
100
- .token.boolean, .token.number {
101
- color: #ae81ff;
102
- }
103
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './Table.less';
3
- declare const Table: React.FC;
4
- export default Table;
@@ -1,56 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
-
3
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
-
5
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6
-
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
8
-
9
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
10
-
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
-
13
- import React, { useEffect, useRef, useState } from 'react';
14
- import throttle from 'lodash.throttle';
15
- import './Table.less';
16
-
17
- var Table = function Table(_ref) {
18
- var children = _ref.children;
19
- var container = useRef();
20
-
21
- var _useState = useState(false),
22
- _useState2 = _slicedToArray(_useState, 2),
23
- leftFolded = _useState2[0],
24
- setLeftFolded = _useState2[1];
25
-
26
- var _useState3 = useState(false),
27
- _useState4 = _slicedToArray(_useState3, 2),
28
- rightFolded = _useState4[0],
29
- setRightFolded = _useState4[1]; // watch content scroll to render folded shadow
30
-
31
-
32
- useEffect(function () {
33
- var elm = container.current;
34
- var handler = throttle(function () {
35
- setLeftFolded(elm.scrollLeft > 0);
36
- setRightFolded(elm.scrollLeft < elm.scrollWidth - elm.offsetWidth);
37
- }, 100);
38
- handler();
39
- elm.addEventListener('scroll', handler);
40
- window.addEventListener('resize', handler);
41
- return function () {
42
- elm.removeEventListener('scroll', handler);
43
- window.removeEventListener('resize', handler);
44
- };
45
- }, []);
46
- return /*#__PURE__*/React.createElement("div", {
47
- className: "__dumi-default-table"
48
- }, /*#__PURE__*/React.createElement("div", {
49
- className: "__dumi-default-table-content",
50
- ref: container,
51
- "data-left-folded": leftFolded || undefined,
52
- "data-right-folded": rightFolded || undefined
53
- }, /*#__PURE__*/React.createElement("table", null, children)));
54
- };
55
-
56
- export default Table;
@@ -1,43 +0,0 @@
1
- .__dumi-default-table {
2
- margin: 16px 0 32px;
3
- transform: translate(0, 0);
4
-
5
- &-content {
6
- overflow: auto;
7
-
8
- &::before,
9
- &::after {
10
- content: '';
11
- display: block;
12
- position: fixed;
13
- z-index: 1;
14
- top: 0;
15
- bottom: 0;
16
- width: 6px;
17
- pointer-events: none;
18
- }
19
-
20
- &[data-left-folded]::before {
21
- left: 0;
22
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
23
-
24
- [data-prefers-color=dark] & {
25
- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
26
- }
27
- }
28
-
29
- &[data-right-folded]::after {
30
- right: 0;
31
- background-image: linear-gradient(to left, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
32
-
33
- [data-prefers-color=dark] & {
34
- background-image: linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
35
- }
36
- }
37
-
38
- > table > thead > tr > th,
39
- > table > tr > th {
40
- white-space: nowrap;
41
- }
42
- }
43
- }
@@ -1,4 +0,0 @@
1
- import type { ComponentProps } from 'react';
2
- import './Tree.less';
3
- declare const _default: (props: ComponentProps<'div'>) => JSX.Element;
4
- export default _default;