@xyd-js/components 0.1.0-xyd.11 → 0.1.0-xyd.13

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 (256) 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 +16 -0
  6. package/TODO.md +1 -0
  7. package/content.ts +0 -2
  8. package/dist/CTABanner-BD4wweO5.js +2 -0
  9. package/dist/CTABanner-BD4wweO5.js.map +1 -0
  10. package/dist/CTABanner-DLG0_gv8.js +2 -0
  11. package/dist/CTABanner-DLG0_gv8.js.map +1 -0
  12. package/dist/CTABanner-DpPtA-FL.js +2 -0
  13. package/dist/CTABanner-DpPtA-FL.js.map +1 -0
  14. package/dist/CodeSample--qfqZ1hL.js +2 -0
  15. package/dist/CodeSample--qfqZ1hL.js.map +1 -0
  16. package/dist/CodeSample-CqFaFwwz.js +2 -0
  17. package/dist/CodeSample-CqFaFwwz.js.map +1 -0
  18. package/dist/CodeSample-GbqwRbcO.js +2 -0
  19. package/dist/CodeSample-GbqwRbcO.js.map +1 -0
  20. package/dist/HomeView-BZdY0g_7.js +2 -0
  21. package/dist/{HomeView-DHdqouwJ.js.map → HomeView-BZdY0g_7.js.map} +1 -1
  22. package/dist/HomeView-C_mEMzjV.js +2 -0
  23. package/dist/{HomeView-TDx2tcP_.js.map → HomeView-C_mEMzjV.js.map} +1 -1
  24. package/dist/HomeView-RATm-3zT.js +2 -0
  25. package/dist/HomeView-RATm-3zT.js.map +1 -0
  26. package/dist/Icon-BkXdTctK.js +2 -0
  27. package/dist/Icon-BkXdTctK.js.map +1 -0
  28. package/dist/Icon-BoKcRZAF.js +2 -0
  29. package/dist/Icon-BoKcRZAF.js.map +1 -0
  30. package/dist/Icon-CouPZRkJ.js +2 -0
  31. package/dist/Icon-CouPZRkJ.js.map +1 -0
  32. package/dist/Text-B-E3eaWW.js +2 -0
  33. package/dist/Text-B-E3eaWW.js.map +1 -0
  34. package/dist/Text-B5Ba_pci.js +2 -0
  35. package/dist/Text-B5Ba_pci.js.map +1 -0
  36. package/dist/Text-QH4jjPUM.js +2 -0
  37. package/dist/Text-QH4jjPUM.js.map +1 -0
  38. package/dist/Update-BlhP2VFR.js +2 -0
  39. package/dist/Update-BlhP2VFR.js.map +1 -0
  40. package/dist/Update-CMM38Snc.js +2 -0
  41. package/dist/Update-CMM38Snc.js.map +1 -0
  42. package/dist/Update-D5e_yqty.js +2 -0
  43. package/dist/Update-D5e_yqty.js.map +1 -0
  44. package/dist/VideoGuide-C5aW4OXW.js +2 -0
  45. package/dist/VideoGuide-C5aW4OXW.js.map +1 -0
  46. package/dist/VideoGuide-CoQXlHjQ.js +2 -0
  47. package/dist/VideoGuide-CoQXlHjQ.js.map +1 -0
  48. package/dist/VideoGuide-CwkedH8b.js +2 -0
  49. package/dist/VideoGuide-CwkedH8b.js.map +1 -0
  50. package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js +4 -0
  51. package/dist/_rollupPluginBabelHelpers-9wcO9jN6.js.map +1 -0
  52. package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js +4 -0
  53. package/dist/_rollupPluginBabelHelpers-CiqSP2w-.js.map +1 -0
  54. package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js +4 -0
  55. package/dist/_rollupPluginBabelHelpers-DmvUE1MU.js.map +1 -0
  56. package/dist/brand.js +1 -1
  57. package/dist/brand.js.map +1 -1
  58. package/dist/coder/themes/cosmo-light.js.map +1 -1
  59. package/dist/coder.d.ts +32 -10
  60. package/dist/coder.js +1 -1
  61. package/dist/coder.js.map +1 -1
  62. package/dist/content.d.ts +264 -201
  63. package/dist/content.js +1 -1
  64. package/dist/content.js.map +1 -1
  65. package/dist/index.css +260 -210
  66. package/dist/layouts.d.ts +20 -21
  67. package/dist/layouts.js +1 -1
  68. package/dist/layouts.js.map +1 -1
  69. package/dist/pages.js +1 -1
  70. package/dist/pages.js.map +1 -1
  71. package/dist/system.d.ts +10 -0
  72. package/dist/system.js +2 -0
  73. package/dist/system.js.map +1 -0
  74. package/dist/tslib.es6-Bb9zBh0L.js +2 -0
  75. package/dist/{tslib.es6-BI9zka_a.js.map → tslib.es6-Bb9zBh0L.js.map} +1 -1
  76. package/dist/tslib.es6-Bd9lzVn6.js +2 -0
  77. package/dist/{tslib.es6-sxmRJynD.js.map → tslib.es6-Bd9lzVn6.js.map} +1 -1
  78. package/dist/tslib.es6-DwnOrHRg.js +2 -0
  79. package/dist/tslib.es6-DwnOrHRg.js.map +1 -0
  80. package/dist/views.js +1 -1
  81. package/dist/writer.d.ts +409 -77
  82. package/dist/writer.js +1 -1
  83. package/dist/writer.js.map +1 -1
  84. package/docs/.nojekyll +1 -0
  85. package/docs/assets/hierarchy.js +1 -0
  86. package/docs/assets/highlight.css +22 -0
  87. package/docs/assets/icons.js +18 -0
  88. package/docs/assets/icons.svg +1 -0
  89. package/docs/assets/main.js +60 -0
  90. package/docs/assets/navigation.js +1 -0
  91. package/docs/assets/search.js +1 -0
  92. package/docs/assets/style.css +1640 -0
  93. package/docs/functions/GuideCard.html +6 -0
  94. package/docs/hierarchy.html +1 -0
  95. package/docs/index.html +2 -0
  96. package/docs/interfaces/GuideCardProps.html +18 -0
  97. package/docs/modules.html +1 -0
  98. package/index.ts +0 -1
  99. package/package.json +10 -6
  100. package/project.json +677 -0
  101. package/rollup.config.js +30 -20
  102. package/src/brand/Button/Button.styles.tsx +0 -3
  103. package/src/brand/CTABanner/CTABanner.styles.tsx +2 -4
  104. package/src/brand/Footer/Footer.styles.tsx +0 -3
  105. package/src/coder/Code/Code.styles.tsx +132 -33
  106. package/src/coder/Code/Code.tsx +129 -38
  107. package/src/coder/Code/CodeLoader.tsx +3 -3
  108. package/src/coder/Code/annotations.tsx +28 -8
  109. package/src/coder/Code/highlight.ts +38 -0
  110. package/src/coder/Code/index.ts +2 -1
  111. package/src/coder/CodeCopy/CodeCopy.styles.tsx +13 -11
  112. package/src/coder/CodeCopy/CodeCopy.tsx +5 -3
  113. package/src/coder/CodeSample/CodeSample.tsx +83 -27
  114. package/src/coder/CodeTabs/CodeTabs.styles.tsx +111 -94
  115. package/src/coder/CodeTabs/CodeTabs.tsx +69 -51
  116. package/src/coder/CodeTheme/CodeTheme.tsx +89 -49
  117. package/src/coder/CodeTheme/index.ts +0 -1
  118. package/src/coder/CoderProvider.tsx +26 -0
  119. package/src/coder/index.ts +8 -4
  120. package/src/content/ContentDecoator.styles.tsx +113 -0
  121. package/src/content/ContentDecorator.tsx +17 -0
  122. package/src/content/GridDecorator.styles.tsx +67 -0
  123. package/src/content/GridDecorator.tsx +21 -0
  124. package/src/content/ReactContent.tsx +575 -0
  125. package/src/content/index.ts +10 -2
  126. package/src/icons/index.ts +0 -0
  127. package/src/kit/Loader/Loader.styles.tsx +53 -0
  128. package/src/kit/Loader/Loader.tsx +22 -0
  129. package/src/kit/index.ts +1 -0
  130. package/src/layouts/LayoutPrimary/LayoutPrimary.styles.tsx +270 -306
  131. package/src/layouts/LayoutPrimary/LayoutPrimary.tsx +171 -91
  132. package/src/layouts/LayoutPrimary/index.ts +0 -2
  133. package/src/layouts/index.ts +0 -7
  134. package/src/system/SearchButton/SearchButton.styles.tsx +86 -0
  135. package/src/system/SearchButton/SearchButton.tsx +116 -0
  136. package/src/system/SearchButton/index.ts +1 -0
  137. package/src/system/index.ts +1 -0
  138. package/src/writer/Anchor/Anchor.styles.tsx +11 -0
  139. package/src/{content → writer}/Anchor/Anchor.tsx +20 -22
  140. package/src/writer/Anchor/index.tsx +1 -0
  141. package/src/writer/Badge/Badge.styles.tsx +37 -27
  142. package/src/writer/Badge/Badge.tsx +34 -48
  143. package/src/writer/Banner/Banner.styles.tsx +91 -0
  144. package/src/writer/Banner/Banner.tsx +70 -0
  145. package/src/writer/Banner/index.ts +1 -0
  146. package/src/writer/Blockquote/Blockquote.styles.tsx +6 -4
  147. package/src/writer/Blockquote/Blockquote.tsx +5 -2
  148. package/src/writer/Breadcrumbs/Breadcrumbs.styles.ts +25 -25
  149. package/src/writer/Breadcrumbs/Breadcrumbs.tsx +18 -12
  150. package/src/writer/Button/Button.styles.tsx +137 -0
  151. package/src/writer/Button/Button.tsx +75 -0
  152. package/src/writer/Button/index.ts +2 -0
  153. package/src/writer/Callout/Callout.styles.tsx +35 -42
  154. package/src/writer/Callout/Callout.tsx +30 -15
  155. package/src/writer/Card/Card.styles.tsx +47 -0
  156. package/src/writer/Card/Card.tsx +69 -0
  157. package/src/writer/Card/index.ts +1 -0
  158. package/src/writer/Code/Code.styles.tsx +12 -11
  159. package/src/writer/Code/Code.tsx +6 -3
  160. package/src/writer/ColorSchemeButton/ColorSchemeButton.tsx +172 -0
  161. package/src/writer/ColorSchemeButton/index.ts +1 -0
  162. package/src/writer/Details/Details.styles.tsx +87 -98
  163. package/src/writer/Details/Details.tsx +65 -44
  164. package/src/writer/Example/index.tsx +5 -0
  165. package/src/writer/GuideCard/GuideCard.styles.tsx +100 -103
  166. package/src/writer/GuideCard/GuideCard.tsx +72 -37
  167. package/src/writer/Heading/Heading.styles.tsx +76 -60
  168. package/src/writer/Heading/Heading.tsx +92 -22
  169. package/src/writer/Hr/Hr.styles.tsx +3 -1
  170. package/src/writer/Hr/Hr.tsx +2 -5
  171. package/src/writer/Icon/Icon.tsx +48 -0
  172. package/src/writer/Icon/index.ts +1 -0
  173. package/src/writer/Image/Image.styles.tsx +9 -0
  174. package/src/writer/Image/Image.tsx +19 -0
  175. package/src/writer/Image/index.ts +1 -0
  176. package/src/writer/List/List.styles.tsx +47 -0
  177. package/src/writer/List/List.tsx +29 -0
  178. package/src/writer/List/index.ts +4 -0
  179. package/src/writer/NavLinks/NavLinks.styles.ts +26 -26
  180. package/src/writer/NavLinks/NavLinks.tsx +65 -18
  181. package/src/writer/Pre/Pre.styles.tsx +8 -6
  182. package/src/writer/Pre/Pre.tsx +3 -2
  183. package/src/writer/Steps/Steps.styles.tsx +27 -24
  184. package/src/writer/Steps/Steps.tsx +38 -8
  185. package/src/writer/Table/Table.styles.tsx +65 -34
  186. package/src/writer/Table/Table.tsx +121 -11
  187. package/src/writer/Table/index.ts +0 -11
  188. package/src/writer/Tabs/Tabs.styles.tsx +51 -55
  189. package/src/writer/Tabs/Tabs.tsx +30 -23
  190. package/src/writer/Text/Text.styles.tsx +66 -0
  191. package/src/writer/Text/Text.tsx +79 -0
  192. package/src/writer/Text/index.ts +3 -0
  193. package/src/writer/TocCard/TocCard.module.css +44 -0
  194. package/src/writer/TocCard/TocCard.tsx +42 -0
  195. package/src/writer/TocCard/index.ts +3 -0
  196. package/src/writer/UnderlineNav/Tabs.tsx +51 -0
  197. package/src/writer/UnderlineNav/TabsPrimary.styles.tsx +184 -0
  198. package/src/writer/UnderlineNav/TabsPrimary.tsx +209 -0
  199. package/src/writer/UnderlineNav/TabsSecondary.styles.tsx +77 -0
  200. package/src/writer/UnderlineNav/TabsSecondary.tsx +171 -0
  201. package/src/writer/UnderlineNav/UnderlineNav.styles.tsx +165 -31
  202. package/src/writer/UnderlineNav/UnderlineNav.tsx +257 -22
  203. package/src/writer/UnderlineNav/index.ts +2 -1
  204. package/src/writer/UnderlineNav/useValueChange.ts +60 -0
  205. package/src/writer/Update/Update.styles.tsx +33 -0
  206. package/src/writer/Update/Update.tsx +37 -0
  207. package/src/writer/Update/index.ts +1 -0
  208. package/src/writer/VideoGuide/VideoGuide.module.css +105 -0
  209. package/src/writer/VideoGuide/VideoGuide.tsx +75 -0
  210. package/src/writer/VideoGuide/index.ts +1 -0
  211. package/src/writer/index.ts +23 -1
  212. package/tsconfig.json +9 -3
  213. package/types.d.ts +50 -0
  214. package/writer.ts +1 -1
  215. package/dist/CTABanner-BLDHbq5h.js +0 -2
  216. package/dist/CTABanner-BLDHbq5h.js.map +0 -1
  217. package/dist/CTABanner-n3vc4xW5.js +0 -2
  218. package/dist/CTABanner-n3vc4xW5.js.map +0 -1
  219. package/dist/CodeSample-CVki5fdQ.js +0 -2
  220. package/dist/CodeSample-CVki5fdQ.js.map +0 -1
  221. package/dist/CodeSample-Dkob5gWa.js +0 -2
  222. package/dist/CodeSample-Dkob5gWa.js.map +0 -1
  223. package/dist/HomeView-DHdqouwJ.js +0 -2
  224. package/dist/HomeView-TDx2tcP_.js +0 -2
  225. package/dist/UnderlineNav-9lJPvnIp.js +0 -2
  226. package/dist/UnderlineNav-9lJPvnIp.js.map +0 -1
  227. package/dist/UnderlineNav-VqB7jDQD.js +0 -2
  228. package/dist/UnderlineNav-VqB7jDQD.js.map +0 -1
  229. package/dist/_rollupPluginBabelHelpers-C8nLsqZ7.js +0 -2
  230. package/dist/_rollupPluginBabelHelpers-C8nLsqZ7.js.map +0 -1
  231. package/dist/_rollupPluginBabelHelpers-CrdNG0jb.js +0 -2
  232. package/dist/_rollupPluginBabelHelpers-CrdNG0jb.js.map +0 -1
  233. package/dist/index-TkBHKzGT.js +0 -2
  234. package/dist/index-TkBHKzGT.js.map +0 -1
  235. package/dist/index-YH6Q3iH2.js +0 -2
  236. package/dist/index-YH6Q3iH2.js.map +0 -1
  237. package/dist/tslib.es6-BI9zka_a.js +0 -2
  238. package/dist/tslib.es6-sxmRJynD.js +0 -2
  239. package/src/content/Anchor/Anchor.styles.tsx +0 -5
  240. package/src/content/Anchor/index.tsx +0 -3
  241. package/src/content/Content/Content.styles.tsx +0 -9
  242. package/src/content/Content/Content.tsx +0 -13
  243. package/src/content/Content/index.tsx +0 -3
  244. package/src/content/Content.tsx +0 -179
  245. package/src/content/Subtitle/Subtitle.styles.ts +0 -8
  246. package/src/content/Subtitle/Subtitle.tsx +0 -12
  247. package/src/content/Subtitle/index.tsx +0 -3
  248. package/src/layouts/Layout.styles.tsx +0 -155
  249. package/src/layouts/Layout.tsx +0 -119
  250. package/src/ui/Loader/Loader.styles.tsx +0 -54
  251. package/src/ui/Loader/Loader.tsx +0 -26
  252. package/src/ui/index.ts +0 -1
  253. package/src/writer/Icon/index.tsx +0 -355
  254. package/src/writer/Table/TableV2.styles.tsx +0 -117
  255. package/src/writer/Table/TableV2.tsx +0 -83
  256. /package/src/{ui → kit}/TODO.md +0 -0
@@ -1,104 +1,93 @@
1
- import {css} from "@linaria/core";
1
+ import { css } from "@linaria/core";
2
2
 
3
3
  export const DetailsHost = css`
4
- border-top: 1px solid #ececf1;
5
-
6
- &[open] summary svg[data-icon="true"] { // TODO: bad solution
7
- transform: rotate(90deg);
8
- }
9
- `;
10
-
11
- export const DetailsHostSecondary = css`
12
- background-color: #f7f7f8;
13
- border: 1px solid #ececf1;
14
- border-radius: 8px;
15
- `;
16
-
17
- export const DetailsSummary = css`
18
- padding: 16px 14px 16px 0;
19
- font-size: 18px;
20
- cursor: pointer;
21
- font-weight: 500;
22
- font-variant-numeric: tabular-nums;
23
- line-height: 1.4;
24
- transition: color 0.3s;
25
- display: flex;
26
- flex-direction: row;
27
- align-items: center;
28
- justify-content: flex-start;
29
- list-style: none;
30
-
31
- &:hover {
32
- color: #565869;
33
- }
34
- `;
35
-
36
- export const DetailsSummarySecondary = css`
37
- display: flex;
38
- justify-content: space-between;
39
- align-items: center;
40
- cursor: pointer;
41
- padding: 20px 24px;
42
- `;
43
-
44
- export const DetailsSummaryTertiary = css`
45
- padding: 10px 24px;
46
- `;
47
-
48
- export const DetailsSummaryDeep = css`
49
- display: flex;
50
- align-items: center;
51
- margin-bottom: 8px;
52
- `;
53
-
54
- export const DetailsSummaryDeepText = css`
55
- color: #6e6e80;
56
- text-transform: uppercase;
57
- font-size: 12px;
58
- line-height: 16px;
59
- letter-spacing: .08em;
60
- margin-left: 8px;
61
- font-weight: 700;
62
- `;
63
-
64
- export const DetailsSummaryDeepTextTertiary = css`
65
- text-transform: none;
4
+ @layer defaults {
5
+ border-top: 1px solid var(--xyd-details-border-color);
66
6
 
67
- code {
68
- background: white;
69
- }
70
- `;
71
-
72
- export const DetailsLabel = css`
73
- flex: 1 1 auto;
74
- `;
75
-
76
- export const DetailsLabelTertiary = css`
77
- padding: 10px;
78
- `;
79
-
80
- export const DetailsIcon = css`
81
- flex: 0 0 auto;
82
- font-size: 16px;
83
- display: flex;
84
- align-items: center;
85
- justify-content: center;
86
- padding-right: 6px;
87
- `;
88
-
89
- export const DetailsContent = css`
90
- padding: 0 24px 20px;
91
- `;
92
-
93
- export const DetailsContentSecondary = css`
94
- // TODO: also bad
95
-
96
- code {
97
- background: white;
7
+ &[data-kind="secondary"], &[data-kind="tertiary"] {
8
+ background-color: var(--xyd-details-bgcolor--secondary);
9
+ border: 1px solid var(--xyd-details-border-color);
10
+ border-radius: 8px;
11
+ }
12
+
13
+ &[open] [part="summary"] svg[data-icon="true"] {
14
+ transform: rotate(90deg);
15
+ }
16
+
17
+ [part="summary"] {
18
+ padding: 16px 14px 16px 0;
19
+ cursor: pointer;
20
+ font-weight: var(--xyd-font-weight-medium);
21
+ font-variant-numeric: tabular-nums;
22
+ transition: color 0.3s;
23
+ display: flex;
24
+ flex-direction: row;
25
+ align-items: center;
26
+ justify-content: flex-start;
27
+ list-style: none;
28
+
29
+ &:hover {
30
+ color: var(--xyd-details-summary-color--active);
31
+ }
32
+ }
33
+
34
+ &[data-kind="tertiary"] [part="summary"]{
35
+ padding: 10px 24px;
36
+ }
37
+ &[data-kind="secondary"],
38
+ &[data-kind="tertiary"] {
39
+ [part="summary"] {
40
+ display: flex;
41
+ justify-content: space-between;
42
+ align-items: center;
43
+ cursor: pointer;
44
+ padding: 20px 24px;
45
+ }
46
+ }
47
+
48
+ [part="summary-deep"] {
49
+ display: flex;
50
+ align-items: center;
51
+ margin-bottom: 8px;
52
+ }
53
+
54
+ [part="summary-deep-text"] {
55
+ color: var(--xyd-details-summary-color);
56
+ text-transform: none;
57
+ letter-spacing: .08em;
58
+ margin-left: 8px;
59
+ font-weight: var(--xyd-font-weight-bold);
60
+
61
+ code {
62
+ background: var(--xyd-details-summary-code-bgcolor);
63
+ }
64
+ }
65
+
66
+ [part="summary-deep-label"] {
67
+ flex: 1 1 auto;
68
+ }
69
+
70
+ // TODO: after migration to web-components should be removed cuz 'part="content"' can be also in another element as child
71
+ & > [part="content"] {
72
+ padding: 0 24px 20px;
73
+ }
74
+ &[data-kind="tertiary"] > [part="content"] {
75
+ background-color: var(--xyd-details-content-bgcolor);
76
+ padding-top: 20px;
77
+
78
+ code {
79
+ background: var(--xyd-details-content-bgcolor);
80
+ }
81
+ }
82
+
83
+ [part="icon"] {
84
+ flex: 0 0 auto;
85
+ font-size: var(--xyd-font-size-medium);
86
+ display: flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ padding-right: 6px;
90
+ }
98
91
  }
99
92
  `;
100
93
 
101
- export const DetailsContentTertiary = css`
102
- background: white;
103
- padding-top: 20px;
104
- `;
@@ -2,30 +2,67 @@ import React from "react"
2
2
 
3
3
  import * as cn from "./Details.styles";
4
4
 
5
- interface BaseDetailsProps {
5
+ /**
6
+ * Base interface for all Details component variants
7
+ */
8
+ export interface BaseDetailsProps {
9
+ /** Content to be displayed inside the details element */
6
10
  children: React.ReactNode;
11
+
12
+ /** Label text displayed in the summary */
7
13
  label: string;
14
+
15
+ /** Optional icon element to be displayed in the summary */
8
16
  icon?: React.ReactElement;
17
+
18
+ /** Optional CSS class name for custom styling */
19
+ className?: string;
9
20
  }
10
21
 
11
- interface TertiaryDetailsProps extends BaseDetailsProps {
22
+ /**
23
+ * Props for the tertiary variant of the Details component
24
+ */
25
+ export interface TertiaryDetailsProps extends BaseDetailsProps {
26
+ /** Specifies the tertiary variant */
12
27
  kind: "tertiary";
28
+
29
+ /** Title text or element displayed in the summary */
13
30
  title: string | React.ReactNode;
14
31
  }
15
32
 
16
- interface SecondaryDetailsProps extends BaseDetailsProps {
33
+ /**
34
+ * Props for the secondary variant of the Details component
35
+ */
36
+ export interface SecondaryDetailsProps extends BaseDetailsProps {
37
+ /** Specifies the secondary variant */
17
38
  kind: "secondary";
39
+
40
+ /** Title text or element displayed in the summary */
18
41
  title: string | React.ReactNode;
19
42
  }
20
43
 
21
- interface PrimaryDetailsProps extends BaseDetailsProps {
44
+ /**
45
+ * Props for the primary variant of the Details component
46
+ */
47
+ export interface PrimaryDetailsProps extends BaseDetailsProps {
48
+ /** Specifies the primary variant (default) */
22
49
  kind?: "primary";
23
50
  }
24
51
 
52
+ /** Union type of all possible Details component variants */
25
53
  export type DetailsProps = PrimaryDetailsProps | SecondaryDetailsProps | TertiaryDetailsProps
26
54
 
27
- export function Details(props: DetailsProps) {
28
- const {children, label} = props;
55
+ /**
56
+ * A collapsible details component that supports three variants: primary, secondary, and tertiary.
57
+ * Each variant has a different visual style and structure.
58
+ *
59
+ * @param props - The component props
60
+ * @returns A details element with collapsible content
61
+ *
62
+ * @category Component
63
+ */
64
+ export function Details(props: DetailsProps): React.ReactElement {
65
+ const { children, label } = props;
29
66
 
30
67
  let title
31
68
 
@@ -37,54 +74,45 @@ export function Details(props: DetailsProps) {
37
74
 
38
75
  const kind = props.kind || "primary";
39
76
 
40
- return <details className={`
41
- ${cn.DetailsHost}
42
- ${isDeepKind && cn.DetailsHostSecondary}
43
- `}>
44
- <summary className={`
45
- ${cn.DetailsSummary}
46
- ${isDeepKind && cn.DetailsSummarySecondary}
47
- ${kind === "tertiary" ? cn.DetailsSummaryTertiary : ""}
48
- `}>
77
+ return <details
78
+ part="details"
79
+ className={`${cn.DetailsHost} ${props.className || ""}`}
80
+ data-kind={props.kind}
81
+ >
82
+ <summary part="summary">
49
83
  {kind === "primary" && (
50
84
  <>
51
- {props.icon || <Icon/>}
52
- <Label>
85
+ {props.icon || <$Icon />}
86
+ <div part="summary-deep-label">
53
87
  {label}
54
- </Label>
88
+ </div>
55
89
  </>
56
90
  )}
91
+
57
92
  {isDeepKind && (
58
93
  <div>
59
- <div className={cn.DetailsSummaryDeep}>
60
- {props.icon || <IconDeep/>}
61
- <div className={`
62
- ${cn.DetailsSummaryDeepText}
63
- ${cn.DetailsSummaryDeepTextTertiary}
64
- `}>
94
+ <div part="summary-deep">
95
+ {props.icon || <$IconDeep />}
96
+ <div part="summary-deep-text">
65
97
  {title}
66
98
  </div>
67
99
  </div>
68
- <Label>
100
+ <div part="summary-deep-label">
69
101
  {label}
70
- </Label>
71
- </div>
102
+ </div>
103
+ </div>
72
104
  )}
73
- {isDeepKind && <Icon/>}
105
+ {isDeepKind && <$Icon />}
74
106
  </summary>
75
107
 
76
- <div className={`
77
- ${cn.DetailsContent}
78
- ${isDeepKind && cn.DetailsContentSecondary}
79
- ${kind === "tertiary" && cn.DetailsContentTertiary}
80
- `}>
108
+ <div part="content">
81
109
  {children}
82
110
  </div>
83
111
  </details>
84
112
  }
85
113
 
86
- function Icon() {
87
- return <div className={cn.DetailsIcon}>
114
+ function $Icon() {
115
+ return <div part="icon">
88
116
  <svg
89
117
  // TODO: bad solution
90
118
  data-icon="true"
@@ -103,7 +131,7 @@ function Icon() {
103
131
  </div>
104
132
  }
105
133
 
106
- function IconDeep() {
134
+ function $IconDeep() {
107
135
  return <svg
108
136
  width="1em"
109
137
  height="1em"
@@ -123,16 +151,9 @@ function IconDeep() {
123
151
  </g>
124
152
  <defs>
125
153
  <clipPath id="clip0_1689_2180">
126
- <rect width={24} height={24} fill="white"/>
154
+ <rect width={24} height={24} fill="white" />
127
155
  </clipPath>
128
156
  </defs>
129
157
  </svg>
130
158
  }
131
159
 
132
- function Label({children}: {
133
- children?: React.ReactNode
134
- }) {
135
- return <div className={cn.DetailsLabel}>
136
- {children}
137
- </div>
138
- }
@@ -0,0 +1,5 @@
1
+ import React from "react"
2
+
3
+ export function Example() {
4
+ return <div>Example xD 2</div>
5
+ }
@@ -1,119 +1,116 @@
1
- import {css} from "@linaria/core";
2
- import colors from "@livesession/design-system-colors"
3
-
4
- export const GuideHost = css``;
5
-
6
- export const GuideHostSecondary = css`
7
- //flex-grow: 1;
8
- //width: 100%;
9
- display: flex;
10
- position: relative;
11
- overflow: hidden;
12
- border: 1px solid ${colors.dark16};
13
- background: ${colors.dark8};
14
- border-radius: 8px;
15
- padding: 24px;
16
- z-index: 0;
17
- transition: box-shadow .2s ease-in-out, background-image .2s ease;
18
-
19
- &:hover {
20
- background: ${colors.white};
21
- }
22
- `;
23
-
24
- export const GuideHostSecondaryMd = css`
25
- padding: 21px 25px 25px;
26
- `;
27
-
28
- export const GuideLink = css`
29
- width: 100%;
30
- height: 100%;
31
- `;
32
-
33
- export const GuideItem = css`
34
- border-radius: 8px;
35
- display: flex;
36
-
37
- align-items: flex-start;
38
- cursor: pointer;
39
- transition: opacity .15s;
1
+ import { css } from "@linaria/core";
2
+
3
+ export const GuideHost = css`
4
+ @layer defaults {
5
+ display: block;
6
+
7
+ &[data-kind="secondary"] {
8
+ display: flex;
9
+ position: relative;
10
+ overflow: hidden;
11
+ border: 1px solid var(--xyd-guidecard-border-color--secondary);
12
+ background: var(--xyd-guidecard-bgcolor--secondary);
13
+ border-radius: 8px;
14
+ padding: 24px;
15
+ z-index: 0;
16
+ transition: box-shadow .2s ease-in-out, background-image .2s ease;
17
+
18
+ &:hover {
19
+ background: var(--xyd-guidecard-bgcolor--secondary-hover);
20
+ }
21
+
22
+ &[data-size="md"] {
23
+ padding: 21px 25px 25px;
24
+ }
25
+ }
40
26
 
41
- &:hover {
42
- [data-pointer="true"] {
43
- opacity: 1;
44
- transform: translate(0);
27
+ [part="link"] {
28
+ width: 100%;
29
+ height: 100%;
45
30
  }
46
- }
47
- `;
48
31
 
49
- export const GuideItemSecondary = css`
50
- width: 100%;
51
- height: 100%;
52
- `;
32
+ [part="item"] {
33
+ border-radius: 8px;
34
+ display: flex;
53
35
 
54
- export const GuideIcon = css`
55
- line-height: 0px;
56
- font-size: 24px;
57
- height: 32px;
58
- display: flex;
59
- justify-content: center;
60
- align-items: center;
61
- color: #000;
62
- transition: background .2s ease;
63
- box-sizing: border-box;
64
- flex-shrink: 0;
65
- `;
36
+ align-items: flex-start;
37
+ cursor: pointer;
38
+ transition: opacity .15s;
66
39
 
67
- export const GuideRight = css`
68
- padding-left: 16px;
69
- display: flex;
70
- flex-direction: column;
71
- gap: 4px;
72
- `;
40
+ &:hover {
41
+ [part="pointer"] {
42
+ opacity: 1;
43
+ transform: translate(0);
44
+ }
45
+ }
46
+ }
47
+ &[data-kind="secondary"] [part="item"] {
48
+ width: 100%;
49
+ height: 100%;
50
+ }
73
51
 
74
- export const GuideTitle = css`
75
- display: flex;
76
- color: #000;
77
- font-weight: 600;
78
- align-items: center;
79
- transition: color .15s;
80
- `;
52
+ [part="icon"] {
53
+ height: 32px;
54
+ display: flex;
55
+ justify-content: center;
56
+ align-items: center;
57
+ color: var(--xyd-guidecard-icon-color);
58
+ transition: background .2s ease;
59
+ box-sizing: border-box;
60
+ flex-shrink: 0;
61
+
62
+ svg {
63
+ width: 24px;
64
+ height: 24px;
65
+ }
66
+ }
81
67
 
82
- export const GuideTitleBody = css`
83
- font-size: 16px;
84
- line-height: 20px;
85
- `;
68
+ [part="right"] {
69
+ padding-left: 16px;
70
+ display: flex;
71
+ flex-direction: column;
72
+ gap: 4px;
73
+ }
86
74
 
87
- export const GuideTitleBodyMd = css`
88
- font-size: 18px;
89
- `;
75
+ [part="title"] {
76
+ display: flex;
77
+ color: var(--xyd-guidecard-title-color);
78
+ align-items: center;
79
+ font-weight: var(--xyd-font-weight-semibold);
80
+ transition: color .15s;
81
+ }
90
82
 
91
- export const GuideBody = css`
92
- font-weight: 400;
93
- font-size: 14px;
94
- line-height: 20px;
83
+ [part="title-body"] {
84
+ }
85
+ &[data-size="md"] [part="title-body"] {
86
+ }
95
87
 
96
- color: ${colors.dark80};
97
- white-space: normal;
98
- overflow: hidden;
99
- text-overflow: ellipsis;
100
- `;
88
+ [part="body"] {
89
+ font-weight: var(--xyd-font-weight-normal);
101
90
 
102
- export const GuideBodyMd = css`
103
- font-size: 16px;
104
- `;
91
+ color: var(--xyd-guidecard-color);
92
+ white-space: normal;
93
+ overflow: hidden;
94
+ text-overflow: ellipsis;
95
+ }
96
+ &[data-size="md"] [part="body"] {
97
+ }
105
98
 
106
- export const GuidePointer = css`
107
- opacity: 0;
108
- transform: translate(-4px);
109
- display: flex;
110
- justify-content: center;
111
- transition: opacity .15s ease-in-out, transform .15s ease-in-out;
99
+ [part="pointer"] {
100
+ opacity: 0;
101
+ transform: translate(-4px);
102
+ display: flex;
103
+ justify-content: center;
104
+ transition: opacity .15s ease-in-out, transform .15s ease-in-out;
105
+ }
106
+ }
112
107
  `;
113
108
 
114
109
  export const GuideListHost = css`
115
- display: grid;
116
- grid-template-columns: 1fr 1fr;
117
- justify-content: center;
118
- gap: 24px;
110
+ @layer defaults {
111
+ display: grid;
112
+ grid-template-columns: 1fr 1fr;
113
+ justify-content: center;
114
+ gap: 24px;
115
+ }
119
116
  `;