@xyd-js/components 0.1.0-build.168

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 (314) hide show
  1. package/.idea/git_toolbox_blame.xml +6 -0
  2. package/.idea/modules.xml +8 -0
  3. package/.idea/vcs.xml +6 -0
  4. package/.idea/xyd-components.iml +12 -0
  5. package/CHANGELOG.md +1369 -0
  6. package/LICENSE +21 -0
  7. package/README.md +3 -0
  8. package/TODO.md +1 -0
  9. package/coder.ts +1 -0
  10. package/content.ts +1 -0
  11. package/dist/Button-BLA2ghHZ.js +2 -0
  12. package/dist/Button-BLA2ghHZ.js.map +1 -0
  13. package/dist/Button-BTJ2hIal.js +2 -0
  14. package/dist/Button-BTJ2hIal.js.map +1 -0
  15. package/dist/Button-r4BCrEjy.js +2 -0
  16. package/dist/Button-r4BCrEjy.js.map +1 -0
  17. package/dist/CodeSample-BZ5tvyWY.js +2 -0
  18. package/dist/CodeSample-BZ5tvyWY.js.map +1 -0
  19. package/dist/CodeSample-BqXDbWdi.js +2 -0
  20. package/dist/CodeSample-BqXDbWdi.js.map +1 -0
  21. package/dist/CodeSample-Cqv86IdN.js +2 -0
  22. package/dist/CodeSample-Cqv86IdN.js.map +1 -0
  23. package/dist/Icon--77MqplU.js +2 -0
  24. package/dist/Icon--77MqplU.js.map +1 -0
  25. package/dist/Icon-DbNmvK_Q.js +2 -0
  26. package/dist/Icon-DbNmvK_Q.js.map +1 -0
  27. package/dist/Icon-uVIU1LW6.js +2 -0
  28. package/dist/Icon-uVIU1LW6.js.map +1 -0
  29. package/dist/PageFirstSlide-BDNmCTiJ.js +2 -0
  30. package/dist/PageFirstSlide-BDNmCTiJ.js.map +1 -0
  31. package/dist/PageFirstSlide-BpZ42bEU.js +2 -0
  32. package/dist/PageFirstSlide-BpZ42bEU.js.map +1 -0
  33. package/dist/PageFirstSlide-CqxiyK57.js +2 -0
  34. package/dist/PageFirstSlide-CqxiyK57.js.map +1 -0
  35. package/dist/TabsAnalytics-B_JYpawG.js +2 -0
  36. package/dist/TabsAnalytics-B_JYpawG.js.map +1 -0
  37. package/dist/TabsAnalytics-DAOfTZgv.js +2 -0
  38. package/dist/TabsAnalytics-DAOfTZgv.js.map +1 -0
  39. package/dist/TabsAnalytics-Dhyadlbu.js +2 -0
  40. package/dist/TabsAnalytics-Dhyadlbu.js.map +1 -0
  41. package/dist/Update-53fEhmjh.js +2 -0
  42. package/dist/Update-53fEhmjh.js.map +1 -0
  43. package/dist/Update-CFi6uapq.js +2 -0
  44. package/dist/Update-CFi6uapq.js.map +1 -0
  45. package/dist/Update-CiMIOgZi.js +2 -0
  46. package/dist/Update-CiMIOgZi.js.map +1 -0
  47. package/dist/VideoGuide-C0K9fFar.js +2 -0
  48. package/dist/VideoGuide-C0K9fFar.js.map +1 -0
  49. package/dist/VideoGuide-CJYkuLst.js +2 -0
  50. package/dist/VideoGuide-CJYkuLst.js.map +1 -0
  51. package/dist/VideoGuide-DBY-EyxG.js +2 -0
  52. package/dist/VideoGuide-DBY-EyxG.js.map +1 -0
  53. package/dist/_rollupPluginBabelHelpers-CvhQFv1t.js +4 -0
  54. package/dist/_rollupPluginBabelHelpers-CvhQFv1t.js.map +1 -0
  55. package/dist/_rollupPluginBabelHelpers-DSwDY1Dm.js +4 -0
  56. package/dist/_rollupPluginBabelHelpers-DSwDY1Dm.js.map +1 -0
  57. package/dist/_rollupPluginBabelHelpers-Dc-ocx4G.js +4 -0
  58. package/dist/_rollupPluginBabelHelpers-Dc-ocx4G.js.map +1 -0
  59. package/dist/coder/themes/classic.css +57 -0
  60. package/dist/coder/themes/classic.d.ts +96 -0
  61. package/dist/coder/themes/classic.js +2 -0
  62. package/dist/coder/themes/classic.js.map +1 -0
  63. package/dist/coder/themes/cosmo.css +64 -0
  64. package/dist/coder/themes/cosmo.d.ts +96 -0
  65. package/dist/coder/themes/cosmo.js +2 -0
  66. package/dist/coder/themes/cosmo.js.map +1 -0
  67. package/dist/coder.d.ts +94 -0
  68. package/dist/coder.js +2 -0
  69. package/dist/coder.js.map +1 -0
  70. package/dist/content.d.ts +411 -0
  71. package/dist/content.js +2 -0
  72. package/dist/content.js.map +1 -0
  73. package/dist/index.css +282 -0
  74. package/dist/index.d.ts +2 -0
  75. package/dist/index.js +2 -0
  76. package/dist/index.js.map +1 -0
  77. package/dist/layouts.d.ts +33 -0
  78. package/dist/layouts.js +2 -0
  79. package/dist/layouts.js.map +1 -0
  80. package/dist/pages.d.ts +176 -0
  81. package/dist/pages.js +2 -0
  82. package/dist/pages.js.map +1 -0
  83. package/dist/system.d.ts +45 -0
  84. package/dist/system.js +2 -0
  85. package/dist/system.js.map +1 -0
  86. package/dist/useUXClick-DK3cTAMR.js +2 -0
  87. package/dist/useUXClick-DK3cTAMR.js.map +1 -0
  88. package/dist/useUXClick-DO6qBcRy.js +2 -0
  89. package/dist/useUXClick-DO6qBcRy.js.map +1 -0
  90. package/dist/useUXClick-NwpsiuK9.js +2 -0
  91. package/dist/useUXClick-NwpsiuK9.js.map +1 -0
  92. package/dist/useUXEvents-CJtgGV4R.js +2 -0
  93. package/dist/useUXEvents-CJtgGV4R.js.map +1 -0
  94. package/dist/useUXEvents-Cxgl7xb-.js +2 -0
  95. package/dist/useUXEvents-Cxgl7xb-.js.map +1 -0
  96. package/dist/useUXEvents-XqAGxoEj.js +2 -0
  97. package/dist/useUXEvents-XqAGxoEj.js.map +1 -0
  98. package/dist/useUXScrollDepth-3rk3Z95r.js +2 -0
  99. package/dist/useUXScrollDepth-3rk3Z95r.js.map +1 -0
  100. package/dist/useUXScrollDepth-BwK-XOBg.js +2 -0
  101. package/dist/useUXScrollDepth-BwK-XOBg.js.map +1 -0
  102. package/dist/useUXScrollDepth-DKre7PBz.js +2 -0
  103. package/dist/useUXScrollDepth-DKre7PBz.js.map +1 -0
  104. package/dist/uxsdk.d.ts +53 -0
  105. package/dist/uxsdk.js +2 -0
  106. package/dist/uxsdk.js.map +1 -0
  107. package/dist/views.d.ts +18 -0
  108. package/dist/views.js +2 -0
  109. package/dist/views.js.map +1 -0
  110. package/dist/writer.d.ts +580 -0
  111. package/dist/writer.js +2 -0
  112. package/dist/writer.js.map +1 -0
  113. package/docs/.nojekyll +1 -0
  114. package/docs/assets/hierarchy.js +1 -0
  115. package/docs/assets/highlight.css +22 -0
  116. package/docs/assets/icons.js +18 -0
  117. package/docs/assets/icons.svg +1 -0
  118. package/docs/assets/main.js +60 -0
  119. package/docs/assets/navigation.js +1 -0
  120. package/docs/assets/search.js +1 -0
  121. package/docs/assets/style.css +1640 -0
  122. package/docs/functions/GuideCard.html +6 -0
  123. package/docs/hierarchy.html +1 -0
  124. package/docs/index.html +2 -0
  125. package/docs/interfaces/GuideCardProps.html +18 -0
  126. package/docs/modules.html +1 -0
  127. package/index.ts +0 -0
  128. package/layouts.ts +1 -0
  129. package/output.txt +13 -0
  130. package/package.json +81 -0
  131. package/pages.ts +1 -0
  132. package/postcss.config.cjs +5 -0
  133. package/rollup.config.js +195 -0
  134. package/src/coder/Code/Code.styles.tsx +151 -0
  135. package/src/coder/Code/Code.tsx +171 -0
  136. package/src/coder/Code/CodeLoader.tsx +10 -0
  137. package/src/coder/Code/annotations.tsx +51 -0
  138. package/src/coder/Code/highlight.ts +208 -0
  139. package/src/coder/Code/index.ts +16 -0
  140. package/src/coder/CodeCopy/CodeCopy.styles.tsx +21 -0
  141. package/src/coder/CodeCopy/CodeCopy.tsx +36 -0
  142. package/src/coder/CodeCopy/index.ts +7 -0
  143. package/src/coder/CodeSample/CodeSample.tsx +118 -0
  144. package/src/coder/CodeSample/CodeSampleAnalytics.tsx +112 -0
  145. package/src/coder/CodeSample/index.ts +11 -0
  146. package/src/coder/CodeSample/withLocalStored.tsx +50 -0
  147. package/src/coder/CodeTabs/CodeTabs.styles.tsx +126 -0
  148. package/src/coder/CodeTabs/CodeTabs.tsx +128 -0
  149. package/src/coder/CodeTabs/index.ts +6 -0
  150. package/src/coder/CodeTheme/CodeTheme.tsx +126 -0
  151. package/src/coder/CodeTheme/index.ts +7 -0
  152. package/src/coder/CoderProvider.tsx +26 -0
  153. package/src/coder/README.md +1 -0
  154. package/src/coder/hooks/highlight.ts +182 -0
  155. package/src/coder/index.ts +37 -0
  156. package/src/coder/themes/classic.css +57 -0
  157. package/src/coder/themes/classic.ts +270 -0
  158. package/src/coder/themes/cosmo.css +64 -0
  159. package/src/coder/themes/cosmo.ts +264 -0
  160. package/src/content/AppearanceDecorator.styles.tsx +11 -0
  161. package/src/content/ContentDecoator.styles.tsx +180 -0
  162. package/src/content/ContentDecorator.tsx +17 -0
  163. package/src/content/GridDecorator.styles.tsx +86 -0
  164. package/src/content/GridDecorator.tsx +23 -0
  165. package/src/content/ReactContent.tsx +671 -0
  166. package/src/content/TODO.md +1 -0
  167. package/src/content/index.ts +13 -0
  168. package/src/kit/Loader/Loader.styles.tsx +53 -0
  169. package/src/kit/Loader/Loader.tsx +22 -0
  170. package/src/kit/TODO.md +2 -0
  171. package/src/kit/index.ts +1 -0
  172. package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +325 -0
  173. package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +252 -0
  174. package/src/layouts/LayoutPrimary/index.ts +3 -0
  175. package/src/layouts/index.ts +6 -0
  176. package/src/pages/PageBlogHome/PageBlogHome.styles.tsx +67 -0
  177. package/src/pages/PageBlogHome/PageBlogHome.tsx +64 -0
  178. package/src/pages/PageBlogHome/index.ts +3 -0
  179. package/src/pages/PageBlogHome/types.ts +35 -0
  180. package/src/pages/PageBlogPost/PageBlogPost.styles.tsx +4 -0
  181. package/src/pages/PageBlogPost/PageBlogPost.tsx +9 -0
  182. package/src/pages/PageBlogPost/index.ts +3 -0
  183. package/src/pages/PageFirstSlide/PageFirstSlide.styles.tsx +134 -0
  184. package/src/pages/PageFirstSlide/PageFirstSlide.tsx +56 -0
  185. package/src/pages/PageFirstSlide/index.ts +1 -0
  186. package/src/pages/PageFirstSlide/types.ts +67 -0
  187. package/src/pages/PageHome/PageHome.styles.tsx +51 -0
  188. package/src/pages/PageHome/PageHome.tsx +62 -0
  189. package/src/pages/PageHome/index.ts +3 -0
  190. package/src/pages/PageHome/types.ts +79 -0
  191. package/src/pages/index.ts +7 -0
  192. package/src/system/Baseline/Baseline.styles.tsx +128 -0
  193. package/src/system/Baseline/Baseline.tsx +40 -0
  194. package/src/system/Baseline/bun.svg +1 -0
  195. package/src/system/Baseline/check.svg +1 -0
  196. package/src/system/Baseline/index.ts +1 -0
  197. package/src/system/Baseline/logo.svg +1 -0
  198. package/src/system/Baseline/node.svg +7 -0
  199. package/src/system/Baseline/npm.svg +5 -0
  200. package/src/system/Baseline/pnpm.svg +1 -0
  201. package/src/system/Footer/Footer.styles.tsx +213 -0
  202. package/src/system/Footer/Footer.tsx +105 -0
  203. package/src/system/Footer/index.ts +1 -0
  204. package/src/system/SearchButton/SearchButton.styles.tsx +89 -0
  205. package/src/system/SearchButton/SearchButton.tsx +118 -0
  206. package/src/system/SearchButton/index.ts +1 -0
  207. package/src/system/index.ts +3 -0
  208. package/src/utils/useStyle.ts +19 -0
  209. package/src/uxsdk/const.ts +1 -0
  210. package/src/uxsdk/index.ts +21 -0
  211. package/src/uxsdk/useUXClick.ts +21 -0
  212. package/src/uxsdk/useUXEvents.ts +105 -0
  213. package/src/uxsdk/useUXScrollDepth.ts +49 -0
  214. package/src/uxsdk/useUXUnreachableElementTracker.ts +100 -0
  215. package/src/views/HomeView/HomeView.styles.tsx +37 -0
  216. package/src/views/HomeView/HomeView.tsx +34 -0
  217. package/src/views/HomeView/index.ts +3 -0
  218. package/src/writer/Anchor/Anchor.styles.tsx +26 -0
  219. package/src/writer/Anchor/Anchor.tsx +51 -0
  220. package/src/writer/Anchor/index.tsx +1 -0
  221. package/src/writer/Badge/Badge.styles.tsx +44 -0
  222. package/src/writer/Badge/Badge.tsx +47 -0
  223. package/src/writer/Badge/index.ts +7 -0
  224. package/src/writer/Banner/Banner.styles.tsx +111 -0
  225. package/src/writer/Banner/Banner.tsx +151 -0
  226. package/src/writer/Banner/index.ts +1 -0
  227. package/src/writer/Blockquote/Blockquote.styles.tsx +20 -0
  228. package/src/writer/Blockquote/Blockquote.tsx +38 -0
  229. package/src/writer/Blockquote/index.ts +7 -0
  230. package/src/writer/BlogCard/BlogCard.styles.tsx +4 -0
  231. package/src/writer/BlogCard/BlogCard.tsx +9 -0
  232. package/src/writer/BlogCard/index.ts +3 -0
  233. package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +24 -0
  234. package/src/writer/Breadcrumbs/Breadcrumbs.tsx +57 -0
  235. package/src/writer/Breadcrumbs/index.ts +7 -0
  236. package/src/writer/Button/Button.styles.tsx +149 -0
  237. package/src/writer/Button/Button.tsx +82 -0
  238. package/src/writer/Button/index.ts +2 -0
  239. package/src/writer/Callout/Callout.styles.tsx +102 -0
  240. package/src/writer/Callout/Callout.tsx +166 -0
  241. package/src/writer/Callout/index.tsx +3 -0
  242. package/src/writer/Card/Card.styles.tsx +110 -0
  243. package/src/writer/Card/Card.tsx +94 -0
  244. package/src/writer/Card/index.ts +1 -0
  245. package/src/writer/Code/Code.styles.tsx +16 -0
  246. package/src/writer/Code/Code.tsx +16 -0
  247. package/src/writer/Code/index.ts +3 -0
  248. package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +191 -0
  249. package/src/writer/ColorSchemeButton/index.ts +1 -0
  250. package/src/writer/Details/Details.styles.tsx +101 -0
  251. package/src/writer/Details/Details.tsx +168 -0
  252. package/src/writer/Details/DetailsProps.tsx +34 -0
  253. package/src/writer/Details/index.ts +6 -0
  254. package/src/writer/GuideCard/GuideCard.styles.tsx +129 -0
  255. package/src/writer/GuideCard/GuideCard.tsx +123 -0
  256. package/src/writer/GuideCard/index.ts +1 -0
  257. package/src/writer/Heading/Heading.styles.tsx +93 -0
  258. package/src/writer/Heading/Heading.tsx +123 -0
  259. package/src/writer/Heading/index.ts +7 -0
  260. package/src/writer/Hr/Hr.styles.tsx +7 -0
  261. package/src/writer/Hr/Hr.tsx +10 -0
  262. package/src/writer/Hr/index.ts +3 -0
  263. package/src/writer/Icon/Icon.styles.tsx +15 -0
  264. package/src/writer/Icon/Icon.tsx +99 -0
  265. package/src/writer/Icon/index.ts +1 -0
  266. package/src/writer/IconSocial/IconSocial.tsx +107 -0
  267. package/src/writer/IconSocial/index.ts +1 -0
  268. package/src/writer/Image/Image.styles.tsx +9 -0
  269. package/src/writer/Image/Image.tsx +35 -0
  270. package/src/writer/Image/index.ts +1 -0
  271. package/src/writer/List/List.styles.tsx +47 -0
  272. package/src/writer/List/List.tsx +29 -0
  273. package/src/writer/List/index.ts +4 -0
  274. package/src/writer/NavLinks/NavLinks.styles.ts +32 -0
  275. package/src/writer/NavLinks/NavLinks.tsx +95 -0
  276. package/src/writer/NavLinks/index.ts +7 -0
  277. package/src/writer/Pre/Pre.styles.tsx +13 -0
  278. package/src/writer/Pre/Pre.tsx +14 -0
  279. package/src/writer/Pre/index.ts +3 -0
  280. package/src/writer/README.md +1 -0
  281. package/src/writer/Steps/Steps.styles.tsx +91 -0
  282. package/src/writer/Steps/Steps.tsx +75 -0
  283. package/src/writer/Steps/index.ts +5 -0
  284. package/src/writer/Table/Table.styles.tsx +100 -0
  285. package/src/writer/Table/Table.tsx +158 -0
  286. package/src/writer/Table/index.ts +3 -0
  287. package/src/writer/Tabs/Tabs.tsx +67 -0
  288. package/src/writer/Tabs/TabsAnalytics.tsx +25 -0
  289. package/src/writer/Tabs/TabsPrimary.styles.tsx +187 -0
  290. package/src/writer/Tabs/TabsPrimary.tsx +215 -0
  291. package/src/writer/Tabs/TabsProps.tsx +13 -0
  292. package/src/writer/Tabs/TabsSecondary.styles.tsx +78 -0
  293. package/src/writer/Tabs/TabsSecondary.tsx +176 -0
  294. package/src/writer/Tabs/index.ts +2 -0
  295. package/src/writer/Tabs/useValueChange.ts +84 -0
  296. package/src/writer/Text/Text.styles.tsx +66 -0
  297. package/src/writer/Text/Text.tsx +79 -0
  298. package/src/writer/Text/index.ts +3 -0
  299. package/src/writer/TocCard/TocCard.module.css +44 -0
  300. package/src/writer/TocCard/TocCard.tsx +42 -0
  301. package/src/writer/TocCard/index.ts +3 -0
  302. package/src/writer/Update/Update.styles.tsx +33 -0
  303. package/src/writer/Update/Update.tsx +37 -0
  304. package/src/writer/Update/index.ts +1 -0
  305. package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
  306. package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
  307. package/src/writer/VideoGuide/index.ts +1 -0
  308. package/src/writer/index.ts +53 -0
  309. package/system.ts +1 -0
  310. package/tsconfig.json +46 -0
  311. package/types.d.ts +52 -0
  312. package/uxsdk.ts +1 -0
  313. package/views.ts +2 -0
  314. package/writer.ts +1 -0
@@ -0,0 +1,129 @@
1
+ import { css } from "@linaria/core";
2
+
3
+ export const globals = css`
4
+ :global() {
5
+ html[data-color-primary="true"] {
6
+ xyd-guidecard [part="icon"] svg {
7
+ fill: var(--color-primary) !important; // TODO: fix important
8
+ color: var(--color-primary) !important; // TODO: fix important
9
+ }
10
+ }
11
+ }
12
+ `
13
+
14
+ export const GuideHost = css`
15
+ @layer defaults {
16
+ display: block;
17
+ height: auto;
18
+
19
+ &[data-kind="secondary"] {
20
+ display: flex;
21
+ position: relative;
22
+ overflow: hidden;
23
+ border: 1px solid var(--xyd-guidecard-border-color--secondary);
24
+ background: var(--xyd-guidecard-bgcolor--secondary);
25
+ border-radius: 8px;
26
+ padding: 24px;
27
+ z-index: 0;
28
+ transition: box-shadow .2s ease-in-out, background-image .2s ease;
29
+ /* height: auto; */
30
+ height: 100%;
31
+
32
+ &:hover {
33
+ background: var(--xyd-guidecard-bgcolor--secondary-hover);
34
+ }
35
+
36
+ &[data-size="md"] {
37
+ padding: 21px 25px 25px;
38
+ }
39
+ }
40
+
41
+ [part="link"] {
42
+ width: 100%;
43
+ height: 100%;
44
+ }
45
+
46
+ [part="item"] {
47
+ border-radius: 8px;
48
+ display: flex;
49
+ align-items: flex-start;
50
+
51
+ cursor: pointer;
52
+ transition: opacity .15s;
53
+
54
+ &:hover {
55
+ [part="pointer"] {
56
+ opacity: 1;
57
+ transform: translate(0);
58
+ }
59
+ }
60
+ }
61
+ &[data-kind="secondary"] [part="item"] {
62
+ width: 100%;
63
+ height: 100%;
64
+ }
65
+
66
+ [part="icon"] {
67
+ display: flex;
68
+ justify-content: center;
69
+ align-items: center;
70
+ color: var(--xyd-guidecard-icon-color);
71
+ transition: background .2s ease;
72
+ box-sizing: border-box;
73
+ flex-shrink: 0;
74
+
75
+ svg {
76
+ width: 24px;
77
+ height: 24px;
78
+ }
79
+ }
80
+
81
+ [part="right"] {
82
+ padding-left: 16px;
83
+ display: flex;
84
+ flex-direction: column;
85
+ gap: 4px;
86
+ }
87
+
88
+ [part="title"] {
89
+ display: flex;
90
+ color: var(--xyd-guidecard-title-color);
91
+ align-items: center;
92
+ font-weight: var(--xyd-font-weight-semibold);
93
+ transition: color .15s;
94
+ }
95
+
96
+ [part="title-body"] {
97
+ }
98
+ &[data-size="md"] [part="title-body"] {
99
+ }
100
+
101
+ [part="body"] {
102
+ font-weight: var(--xyd-font-weight-normal);
103
+
104
+ color: var(--xyd-guidecard-color);
105
+ white-space: normal;
106
+ overflow: hidden;
107
+ text-overflow: ellipsis;
108
+ }
109
+ &[data-size="md"] [part="body"] {
110
+ }
111
+
112
+ [part="pointer"] {
113
+ opacity: 0;
114
+ transform: translate(-4px);
115
+ display: flex;
116
+ justify-content: center;
117
+ transition: opacity .15s ease-in-out, transform .15s ease-in-out;
118
+ }
119
+ }
120
+ `;
121
+
122
+ export const GuideListHost = css`
123
+ @layer defaults {
124
+ display: grid;
125
+ grid-template-columns: 1fr 1fr;
126
+ justify-content: center;
127
+ gap: 24px;
128
+ }
129
+ `;
@@ -0,0 +1,123 @@
1
+ import React from "react"
2
+
3
+ import * as cn from "./GuideCard.styles";
4
+
5
+ import { Icon } from "../Icon"
6
+
7
+ /**
8
+ * Props for the GuideCard component
9
+ */
10
+ export interface GuideCardProps {
11
+ /** Content to be displayed in the card body */
12
+ children: React.ReactNode;
13
+
14
+ /** URL the card links to */
15
+ href: string
16
+
17
+ /** Title displayed at the top of the card */
18
+ title?: string;
19
+
20
+ /** Optional icon displayed to the left of the content */
21
+ icon?: React.ReactNode | string;
22
+
23
+ /** Visual style variant of the card */
24
+ kind?: "secondary"
25
+
26
+ /** Size variant of the card */
27
+ size?: "sm" | "md"
28
+
29
+ /** Additional CSS class names to apply to the card */
30
+ className?: string
31
+
32
+ /** Additional props to pass to the link element */
33
+ as?: React.ElementType
34
+ }
35
+
36
+ /**
37
+ * A card component that displays content with a title and optional icon.
38
+ * The entire card is clickable and links to the specified URL.
39
+ *
40
+ * @category Component
41
+ */
42
+ export function GuideCard({
43
+ children,
44
+ href,
45
+ icon,
46
+ title,
47
+ kind,
48
+ size,
49
+ className,
50
+ as,
51
+ }: GuideCardProps) {
52
+ const Link = as || $Link
53
+
54
+ const iconElement = icon && typeof icon === 'string' ? <Icon name={icon} /> : icon
55
+
56
+ return <xyd-guidecard
57
+ className={`${cn.GuideHost} ${className || ""}`}
58
+ data-kind={kind}
59
+ data-size={size}
60
+ >
61
+ <Link part="link" href={href}>
62
+ <div part="item">
63
+ {iconElement && <div part="icon">
64
+ {iconElement}
65
+ </div>}
66
+ <div part="right">
67
+ {title && <GuideCard.Title>{title}</GuideCard.Title>}
68
+ <div part="body">
69
+ {children}
70
+ </div>
71
+ </div>
72
+ </div>
73
+ </Link>
74
+ </xyd-guidecard>
75
+ }
76
+ GuideCard.Title = function GuideCardTitle({ children }: { children: React.ReactNode }) {
77
+ return <div part="title">
78
+ <div part="title-body">
79
+ {children}
80
+ </div>
81
+ <$Pointer />
82
+ </div>
83
+ }
84
+
85
+ /**
86
+ * A container component for grouping multiple GuideCard components.
87
+ * Provides consistent spacing and layout for a list of guide cards.
88
+ */
89
+ GuideCard.List = function GuideCardList({ children }: { children: React.ReactNode }) {
90
+ return <xyd-guidecard-list className={cn.GuideListHost}>
91
+ {children}
92
+ </xyd-guidecard-list>
93
+ }
94
+
95
+ /**
96
+ * Internal component that renders the arrow pointer icon.
97
+ */
98
+ function $Pointer() {
99
+ return <div part="pointer">
100
+ <svg
101
+ xmlns="http://www.w3.org/2000/svg"
102
+ width={24}
103
+ height={24}
104
+ fill="currentColor"
105
+ viewBox="0 0 24 24"
106
+ >
107
+ <path
108
+ fillRule="evenodd"
109
+ d="M9.293 7.293a1 1 0 0 1 1.414 0l4 4a1 1 0 0 1 0 1.414l-4 4a1 1 0 0 1-1.414-1.414L12.586 12 9.293 8.707a1 1 0 0 1 0-1.414Z"
110
+ clipRule="evenodd"
111
+ />
112
+ </svg>
113
+ </div>
114
+ }
115
+
116
+ function $Link({ href, children, ...rest }) {
117
+ return <a
118
+ href={href}
119
+ {...rest}
120
+ >
121
+ {children}
122
+ </a>
123
+ }
@@ -0,0 +1 @@
1
+ export {GuideCard} from "./GuideCard";
@@ -0,0 +1,93 @@
1
+ import { css } from "@linaria/core";
2
+
3
+ export const HeadingHost = css`
4
+ @layer defaults {
5
+ color: var(--xyd-heading-color);
6
+ line-height: var(--xyd-line-height-xlarge);
7
+ font-weight: var(--xyd-font-weight-semibold);
8
+
9
+ position: relative;
10
+ display: table;
11
+ margin: 0;
12
+ padding: 0 24px 0 0;
13
+ scroll-margin-top: 30px;
14
+ cursor: default;
15
+
16
+ &[id] {
17
+ cursor: pointer;
18
+ }
19
+ &[data-noanchor="true"] {
20
+ cursor: default;
21
+ }
22
+
23
+ &[data-has-label="true"] {
24
+ display: flex;
25
+ align-items: center;
26
+ gap: 8px;
27
+
28
+ xyd-badge {
29
+ font-size: var(--xyd-font-size-xsmall);
30
+ line-height: var(--xyd-line-height-xsmall);
31
+ letter-spacing: 2px;
32
+ }
33
+ }
34
+
35
+ &:hover {
36
+ svg {
37
+ opacity: 1;
38
+ }
39
+ }
40
+
41
+ &[data-kind="muted"] {
42
+ color: var(--xyd-heading-color--muted);
43
+ cursor: default;
44
+ font-weight: var(--xyd-font-weight-medium);
45
+ }
46
+
47
+ &[data-size="1"] {
48
+ font-size: var(--xyd-font-size-2xl);
49
+ line-height: var(--xyd-line-height-2xl);
50
+ }
51
+
52
+ &[data-size="2"] {
53
+ font-size: var(--xyd-font-size-xxlarge);
54
+ line-height: var(--xyd-line-height-xxlarge);
55
+ }
56
+
57
+ &[data-size="3"] {
58
+ font-size: var(--xyd-font-size-xlarge);
59
+ line-height: var(--xyd-line-height-xlarge);
60
+ }
61
+
62
+ &[data-size="4"] {
63
+ font-size: var(--xyd-font-size-large);
64
+ line-height: var(--xyd-line-height-large);
65
+ }
66
+
67
+ &[data-size="5"] {
68
+ font-size: var(--xyd-font-size-medium);
69
+ line-height: var(--xyd-line-height-medium);
70
+ }
71
+
72
+ &[data-size="6"] {
73
+ font-size: var(--xyd-font-size-small);
74
+ line-height: var(--xyd-line-height-small);
75
+ }
76
+
77
+ [part="icon"] {
78
+ position: absolute;
79
+ top: 50%;
80
+ right: 0;
81
+ margin-top: -6px;
82
+ opacity: 0;
83
+ color: var(--xyd-heading-icon-color);
84
+ transition: opacity .15s ease;
85
+ }
86
+ &[data-active="true"] {
87
+ [part="icon"] {
88
+ opacity: 1;
89
+ }
90
+ }
91
+ }
92
+ `;
93
+
@@ -0,0 +1,123 @@
1
+ import React, { } from "react"
2
+
3
+ import * as cn from "./Heading.styles";
4
+ import { Badge } from "../../../writer";
5
+
6
+ /**
7
+ * Props for the Heading component
8
+ * @interface HeadingProps
9
+ */
10
+ export interface HeadingProps {
11
+ /** Content to be rendered inside the heading */
12
+ children: React.ReactNode
13
+
14
+ /** The size of the heading (1-6, corresponding to h1-h6) */
15
+ size: 1 | 2 | 3 | 4 | 5 | 6
16
+
17
+ /** Optional HTML element to render as (div or span) */
18
+ as?: "div" | "span"
19
+
20
+ /** Optional ID for the heading element */
21
+ id?: string
22
+
23
+ /** Optional visual style variant */
24
+ kind?: "muted"
25
+
26
+ /** Optional click handler */
27
+ onClick?: () => void
28
+
29
+ /** Optional additional CSS class name */
30
+ className?: string
31
+
32
+ /** Optional active state */
33
+ active?: boolean
34
+
35
+ /** Optional label for the heading */
36
+ label?: string
37
+
38
+ /** Optional subtitle for the heading */
39
+ subtitle?: string
40
+
41
+ /** Optional to hide the anchor icon */
42
+ noanchor?: boolean
43
+
44
+ /** Optional ref for the heading element */
45
+ ref?: React.RefObject<HTMLHeadingElement>
46
+
47
+ style?: React.CSSProperties
48
+ }
49
+
50
+ /**
51
+ * A flexible heading component that can render as any heading level (h1-h6) or as a div/span
52
+ *
53
+ * @category Component
54
+ */
55
+ export function Heading(props: HeadingProps) {
56
+ const {
57
+ children,
58
+ size = 1,
59
+ as,
60
+ id,
61
+ onClick,
62
+ className,
63
+ kind,
64
+ active,
65
+ label,
66
+ subtitle,
67
+ noanchor,
68
+ ref,
69
+ style,
70
+ } = props
71
+ let HeadingComponent = as ? as : `h${size}` as "h1" | "h2" | "h3" | "h4" | "h5" | "h6"
72
+
73
+ return <>
74
+ <HeadingComponent
75
+ style={style || undefined}
76
+ className={` ${cn.HeadingHost} ${className || ''}`}
77
+ data-size={size}
78
+ data-kind={kind}
79
+ data-has-label={String(label ? "true" : "false")}
80
+ data-noanchor={String(noanchor || "false")}
81
+ data-active={String(active || "false")}
82
+ onClick={noanchor ? undefined : onClick}
83
+ id={id}
84
+ ref={ref}
85
+ >
86
+ {children}
87
+
88
+ {label && <Badge size="sm">{label}</Badge>}
89
+
90
+ {id && !noanchor && <$Anchor />}
91
+ </HeadingComponent>
92
+
93
+ {
94
+ subtitle ? <Heading
95
+ {...props}
96
+ size={4}
97
+ kind="muted"
98
+ subtitle={undefined}
99
+ label={undefined}
100
+ >
101
+ {subtitle}
102
+ </Heading> : null
103
+ }
104
+ </>
105
+ }
106
+
107
+ function $Anchor() {
108
+ return <svg
109
+ part="icon"
110
+ xmlns="http://www.w3.org/2000/svg"
111
+ width={15}
112
+ height={15}
113
+ fill="currentColor"
114
+ viewBox="0 0 24 24"
115
+ role="presentation"
116
+ >
117
+ <path
118
+ fillRule="evenodd"
119
+ d="M18.293 5.707a4.657 4.657 0 0 0-6.586 0l-1 1a1 1 0 1 1-1.414-1.414l1-1a6.657 6.657 0 1 1 9.414 9.414l-1 1a1 1 0 0 1-1.414-1.414l1-1a4.657 4.657 0 0 0 0-6.586Zm-2.586 2.586a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414-1.414l6-6a1 1 0 0 1 1.414 0Zm-9 1a1 1 0 0 1 0 1.414l-1 1a4.657 4.657 0 0 0 6.586 6.586l1-1a1 1 0 0 1 1.414 1.414l-1 1a6.657 6.657 0 1 1-9.414-9.414l1-1a1 1 0 0 1 1.414 0Z"
120
+ clipRule="evenodd"
121
+ />
122
+ </svg>
123
+ }
@@ -0,0 +1,7 @@
1
+ export {
2
+ Heading
3
+ } from "./Heading";
4
+
5
+ export type {
6
+ HeadingProps
7
+ } from "./Heading"
@@ -0,0 +1,7 @@
1
+ import {css} from "@linaria/core";
2
+
3
+ export const HrHost = css`
4
+ @layer defaults {
5
+ border: 0.5px solid var(--xyd-hr-border-color);
6
+ }
7
+ `;
@@ -0,0 +1,10 @@
1
+ import React from "react"
2
+
3
+ import * as cn from "./Hr.styles";
4
+
5
+ export interface HrProps {
6
+ }
7
+
8
+ export function Hr() {
9
+ return <hr part="hr" className={cn.HrHost}/>
10
+ }
@@ -0,0 +1,3 @@
1
+ export {Hr} from "./Hr"
2
+
3
+ export type {HrProps} from "./Hr"
@@ -0,0 +1,15 @@
1
+ import { css } from "@linaria/core";
2
+
3
+ export const ExternalArrowHost = css`
4
+ @layer defaults {
5
+ --external-arrow2-size: 7px;
6
+
7
+ width: var(--external-arrow2-size);
8
+ height: var(--external-arrow2-size);
9
+ margin-top: calc(var(--external-arrow2-size) * -1);
10
+ margin-left: calc(var(--external-arrow2-size) / 2);
11
+
12
+ fill: currentColor;
13
+ color: currentColor;
14
+ }
15
+ `;
@@ -0,0 +1,99 @@
1
+ import React, {createContext, ReactElement, SVGProps, use} from "react";
2
+ import parse, { HTMLReactParserOptions, Element } from "html-react-parser";
3
+
4
+ import * as cn from "./Icon.styles"
5
+ // TODO: html-react-parser is not the best choice, but it works for now
6
+
7
+ export const IconProvider = createContext({
8
+ iconSet: {}
9
+ })
10
+
11
+ interface IconProps {
12
+ name: string;
13
+ size?: number;
14
+ color?: string;
15
+ }
16
+
17
+ export function Icon(props: IconProps): ReactElement | null {
18
+ const {name, size = 24, color} = props
19
+
20
+ const iconProvider = use(IconProvider)
21
+ const iconSet = iconProvider?.iconSet
22
+
23
+ if (!iconSet) {
24
+ return null
25
+ }
26
+
27
+ const ico = iconSet[name]
28
+ if (!ico || !ico.svg) {
29
+ return null
30
+ }
31
+
32
+ const icon = parseIcon(ico.svg) as ReactElement<SVGProps<SVGSVGElement>>
33
+
34
+ if (React.isValidElement(icon)) {
35
+ return React.cloneElement(icon, {
36
+ width: size,
37
+ height: size,
38
+ color: color || icon.props.color || 'currentColor',
39
+ fill: color || icon.props.fill || 'currentColor',
40
+ style: {
41
+ width: size,
42
+ height: size,
43
+ color: color || icon.props.color || 'currentColor',
44
+ fill: color || icon.props.color || 'currentColor',
45
+ }
46
+ })
47
+ }
48
+
49
+ return null
50
+ }
51
+
52
+ Icon.ExternalArrow = function ExternalArrow() {
53
+ return <svg
54
+ className={cn.ExternalArrowHost}
55
+ aria-hidden="true"
56
+ viewBox="0 0 6 6"
57
+ >
58
+ <path
59
+ d="M1.25215 5.54731L0.622742 4.9179L3.78169 1.75597H1.3834L1.38936 0.890915H5.27615V4.78069H4.40513L4.41109 2.38538L1.25215 5.54731Z"
60
+ fill="var(--accents-3)"
61
+ />
62
+ </svg>
63
+ }
64
+
65
+
66
+ function parseIcon(svg: string) {
67
+ const options: HTMLReactParserOptions = {
68
+ htmlparser2: { xmlMode: true }, // preserves case of *attributes*, still lowercase tags
69
+ replace(domNode) {
70
+ if (domNode.type === "tag") {
71
+ const el = domNode as Element;
72
+
73
+ // ✅ Fix tag name casing
74
+ if (el.name === "lineargradient") el.name = "linearGradient";
75
+ if (el.name === "radialgradient") el.name = "radialGradient";
76
+ if (el.name === "clippath") el.name = "clipPath";
77
+ if (el.name === "pattern") el.name = "pattern"; // example: stays same
78
+
79
+ // ✅ Fix attribute casing for React
80
+ const attrs = el.attribs || {};
81
+ if ("stop-color" in attrs) {
82
+ attrs.stopColor = attrs["stop-color"];
83
+ delete attrs["stop-color"];
84
+ }
85
+ if ("fill-rule" in attrs) {
86
+ attrs.fillRule = attrs["fill-rule"];
87
+ delete attrs["fill-rule"];
88
+ }
89
+ if ("clip-rule" in attrs) {
90
+ attrs.clipRule = attrs["clip-rule"];
91
+ delete attrs["clip-rule"];
92
+ }
93
+ }
94
+ return domNode;
95
+ },
96
+ };
97
+
98
+ return parse(svg, options);
99
+ }
@@ -0,0 +1 @@
1
+ export * from "./Icon"