@node-core/ui-components 1.0.1-4ebead0c76b580d1bf722ebcd0f644e82dc06c0d → 1.0.1-53352b306fcbcdb527095209221fd17b7fc955b9

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 (263) hide show
  1. package/Common/AlertBox/index.js +5 -0
  2. package/Common/AlertBox/index.module.css +50 -50
  3. package/Common/AvatarGroup/Avatar/index.js +11 -0
  4. package/Common/AvatarGroup/Avatar/index.module.css +50 -30
  5. package/Common/AvatarGroup/Overlay/index.js +6 -0
  6. package/Common/AvatarGroup/Overlay/index.module.css +28 -21
  7. package/Common/AvatarGroup/index.js +21 -0
  8. package/Common/AvatarGroup/index.module.css +12 -11
  9. package/Common/Badge/index.js +7 -0
  10. package/Common/Badge/index.module.css +48 -26
  11. package/Common/BadgeGroup/index.js +6 -0
  12. package/Common/BadgeGroup/index.module.css +130 -54
  13. package/Common/Banner/index.js +4 -0
  14. package/Common/Banner/index.module.css +30 -27
  15. package/Common/BaseActiveLink/index.js +14 -0
  16. package/Common/BaseButton/index.js +10 -0
  17. package/Common/BaseButton/index.module.css +332 -105
  18. package/Common/BaseCodeBox/index.js +50 -0
  19. package/Common/BaseCodeBox/index.module.css +76 -58
  20. package/Common/BaseCrossLink/index.js +12 -0
  21. package/Common/BaseCrossLink/index.module.css +57 -39
  22. package/Common/BaseLinkTabs/index.js +5 -0
  23. package/Common/BaseLinkTabs/index.module.css +67 -33
  24. package/Common/BasePagination/Ellipsis/index.js +4 -0
  25. package/Common/BasePagination/Ellipsis/index.module.css +14 -8
  26. package/Common/BasePagination/PaginationListItem/index.js +6 -0
  27. package/Common/BasePagination/PaginationListItem/index.module.css +36 -21
  28. package/Common/BasePagination/PrevNextArrow.js +7 -0
  29. package/Common/BasePagination/index.js +10 -0
  30. package/Common/BasePagination/index.module.css +27 -26
  31. package/Common/BasePagination/useGetPageElements.js +77 -0
  32. package/Common/Blockquote/index.js +4 -0
  33. package/Common/Blockquote/index.module.css +44 -23
  34. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.js +9 -0
  35. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +3 -3
  36. package/Common/Breadcrumbs/BreadcrumbItem/index.js +6 -0
  37. package/Common/Breadcrumbs/BreadcrumbItem/index.module.css +38 -27
  38. package/Common/Breadcrumbs/BreadcrumbLink/index.js +5 -0
  39. package/Common/Breadcrumbs/BreadcrumbLink/index.module.css +26 -16
  40. package/Common/Breadcrumbs/BreadcrumbRoot/index.js +4 -0
  41. package/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +8 -7
  42. package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.js +4 -0
  43. package/Common/Breadcrumbs/index.js +22 -0
  44. package/Common/ChangeHistory/index.js +9 -0
  45. package/Common/ChangeHistory/index.module.css +181 -66
  46. package/Common/CodeTabs/index.js +5 -0
  47. package/Common/CodeTabs/index.module.css +47 -36
  48. package/Common/DataTag/index.js +18 -0
  49. package/Common/DataTag/index.module.css +30 -32
  50. package/Common/GlowingBackdrop/index.js +5 -0
  51. package/Common/GlowingBackdrop/index.module.css +126 -28
  52. package/Common/LanguageDropDown/index.js +11 -0
  53. package/Common/LanguageDropDown/index.module.css +140 -42
  54. package/Common/Modal/index.js +10 -0
  55. package/Common/Modal/index.module.css +217 -62
  56. package/Common/NodejsLogo/index.js +7 -0
  57. package/Common/NodejsLogo/index.module.css +3 -4
  58. package/Common/Notification/index.js +6 -0
  59. package/Common/Notification/index.module.css +101 -17
  60. package/Common/Preview/index.js +7 -0
  61. package/Common/Preview/index.module.css +269 -65
  62. package/Common/Select/index.js +49 -0
  63. package/Common/Select/index.module.css +294 -127
  64. package/Common/Separator/index.js +7 -0
  65. package/Common/Separator/index.module.css +7 -10
  66. package/Common/Skeleton/index.js +18 -0
  67. package/Common/Skeleton/index.module.css +118 -21
  68. package/Common/Tabs/index.js +6 -0
  69. package/Common/Tabs/index.module.css +58 -40
  70. package/Common/ThemeToggle/index.js +7 -0
  71. package/Common/ThemeToggle/index.module.css +18 -11
  72. package/Common/Tooltip/index.js +8 -0
  73. package/Common/Tooltip/index.module.css +119 -29
  74. package/Containers/Article/index.js +4 -0
  75. package/Containers/Article/index.module.css +127 -58
  76. package/Containers/DocSideBar/index.js +1 -0
  77. package/Containers/Footer/index.js +22 -0
  78. package/Containers/Footer/index.module.css +51 -36
  79. package/Containers/MetaBar/index.js +12 -0
  80. package/Containers/MetaBar/index.module.css +101 -69
  81. package/Containers/NavBar/NavItem/index.js +7 -0
  82. package/Containers/NavBar/NavItem/index.module.css +50 -36
  83. package/Containers/NavBar/index.js +18 -0
  84. package/Containers/NavBar/index.module.css +176 -96
  85. package/Containers/Sidebar/ProgressionIcon/index.js +3 -0
  86. package/Containers/Sidebar/SidebarGroup/index.js +9 -0
  87. package/Containers/Sidebar/SidebarGroup/index.module.css +180 -52
  88. package/Containers/Sidebar/SidebarItem/index.js +11 -0
  89. package/Containers/Sidebar/SidebarItem/index.module.css +49 -38
  90. package/Containers/Sidebar/index.js +15 -0
  91. package/Containers/Sidebar/index.module.css +42 -24
  92. package/Icons/HexagonGrid.js +3 -0
  93. package/Icons/InstallationMethod/Choco.js +3 -0
  94. package/Icons/InstallationMethod/Devbox.js +3 -0
  95. package/Icons/InstallationMethod/Docker.js +3 -0
  96. package/Icons/InstallationMethod/FNM.js +3 -0
  97. package/Icons/InstallationMethod/Homebrew.js +3 -0
  98. package/Icons/InstallationMethod/N.js +5 -0
  99. package/Icons/InstallationMethod/NVM.js +3 -0
  100. package/Icons/InstallationMethod/Volta.js +3 -0
  101. package/Icons/InstallationMethod/{index.ts → index.js} +0 -1
  102. package/Icons/Logos/JsWhite.js +3 -0
  103. package/Icons/Logos/Nodejs.js +12 -0
  104. package/Icons/Logos/index.js +3 -0
  105. package/Icons/OperatingSystem/AIX.js +3 -0
  106. package/Icons/OperatingSystem/Apple.js +3 -0
  107. package/Icons/OperatingSystem/Linux.js +3 -0
  108. package/Icons/OperatingSystem/Microsoft.js +3 -0
  109. package/Icons/OperatingSystem/{index.ts → index.js} +0 -1
  110. package/Icons/PackageManager/Npm.js +3 -0
  111. package/Icons/PackageManager/Pnpm.js +3 -0
  112. package/Icons/PackageManager/Yarn.js +3 -0
  113. package/Icons/PackageManager/{index.ts → index.js} +0 -1
  114. package/Icons/Social/Bluesky.js +3 -0
  115. package/Icons/Social/Discord.js +3 -0
  116. package/Icons/Social/GitHub.js +3 -0
  117. package/Icons/Social/LinkedIn.js +3 -0
  118. package/Icons/Social/Mastodon.js +3 -0
  119. package/Icons/Social/Slack.js +3 -0
  120. package/Icons/Social/X.js +3 -0
  121. package/Icons/Social/{index.ts → index.js} +0 -1
  122. package/MDX/CodeTabs.js +16 -0
  123. package/Providers/NotificationProvider/index.js +16 -0
  124. package/Providers/NotificationProvider/index.module.css +7 -0
  125. package/package.json +6 -54
  126. package/stylelint/one-utility-class-per-line.mjs +34 -50
  127. package/stylelint/utils.mjs +19 -25
  128. package/styles/index.css +1124 -26
  129. package/types.js +1 -0
  130. package/Common/AlertBox/index.stories.tsx +0 -96
  131. package/Common/AlertBox/index.tsx +0 -24
  132. package/Common/AvatarGroup/Avatar/index.stories.tsx +0 -22
  133. package/Common/AvatarGroup/Avatar/index.tsx +0 -67
  134. package/Common/AvatarGroup/Overlay/index.stories.tsx +0 -33
  135. package/Common/AvatarGroup/Overlay/index.tsx +0 -37
  136. package/Common/AvatarGroup/__tests__/index.test.jsx +0 -55
  137. package/Common/AvatarGroup/index.stories.tsx +0 -56
  138. package/Common/AvatarGroup/index.tsx +0 -83
  139. package/Common/Badge/index.stories.tsx +0 -38
  140. package/Common/Badge/index.tsx +0 -35
  141. package/Common/BadgeGroup/index.stories.tsx +0 -35
  142. package/Common/BadgeGroup/index.tsx +0 -35
  143. package/Common/Banner/index.stories.tsx +0 -29
  144. package/Common/Banner/index.tsx +0 -18
  145. package/Common/BaseActiveLink/__tests__/index.test.jsx +0 -52
  146. package/Common/BaseActiveLink/index.tsx +0 -34
  147. package/Common/BaseButton/index.stories.tsx +0 -67
  148. package/Common/BaseButton/index.tsx +0 -59
  149. package/Common/BaseCodeBox/index.stories.tsx +0 -39
  150. package/Common/BaseCodeBox/index.tsx +0 -122
  151. package/Common/BaseCrossLink/index.stories.tsx +0 -38
  152. package/Common/BaseCrossLink/index.tsx +0 -46
  153. package/Common/BaseLinkTabs/index.stories.tsx +0 -34
  154. package/Common/BaseLinkTabs/index.tsx +0 -53
  155. package/Common/BasePagination/Ellipsis/index.stories.tsx +0 -10
  156. package/Common/BasePagination/Ellipsis/index.tsx +0 -11
  157. package/Common/BasePagination/PaginationListItem/__tests__/index.test.jsx +0 -58
  158. package/Common/BasePagination/PaginationListItem/index.stories.tsx +0 -40
  159. package/Common/BasePagination/PaginationListItem/index.tsx +0 -39
  160. package/Common/BasePagination/PrevNextArrow.tsx +0 -15
  161. package/Common/BasePagination/__tests__/index.test.jsx +0 -180
  162. package/Common/BasePagination/index.stories.tsx +0 -67
  163. package/Common/BasePagination/index.tsx +0 -77
  164. package/Common/BasePagination/useGetPageElements.tsx +0 -132
  165. package/Common/Blockquote/index.stories.tsx +0 -45
  166. package/Common/Blockquote/index.tsx +0 -11
  167. package/Common/Breadcrumbs/BreadcrumbHomeLink/index.tsx +0 -30
  168. package/Common/Breadcrumbs/BreadcrumbItem/index.tsx +0 -42
  169. package/Common/Breadcrumbs/BreadcrumbLink/index.tsx +0 -37
  170. package/Common/Breadcrumbs/BreadcrumbRoot/index.tsx +0 -20
  171. package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.tsx +0 -9
  172. package/Common/Breadcrumbs/index.stories.tsx +0 -94
  173. package/Common/Breadcrumbs/index.tsx +0 -81
  174. package/Common/ChangeHistory/index.stories.tsx +0 -130
  175. package/Common/ChangeHistory/index.tsx +0 -67
  176. package/Common/CodeTabs/index.stories.tsx +0 -73
  177. package/Common/CodeTabs/index.tsx +0 -16
  178. package/Common/DataTag/index.stories.tsx +0 -40
  179. package/Common/DataTag/index.tsx +0 -39
  180. package/Common/GlowingBackdrop/index.stories.tsx +0 -10
  181. package/Common/GlowingBackdrop/index.tsx +0 -13
  182. package/Common/LanguageDropDown/index.stories.tsx +0 -19
  183. package/Common/LanguageDropDown/index.tsx +0 -56
  184. package/Common/Modal/index.stories.tsx +0 -34
  185. package/Common/Modal/index.tsx +0 -50
  186. package/Common/NodejsLogo/index.stories.tsx +0 -14
  187. package/Common/NodejsLogo/index.tsx +0 -26
  188. package/Common/Notification/index.stories.tsx +0 -36
  189. package/Common/Notification/index.tsx +0 -34
  190. package/Common/Preview/index.stories.tsx +0 -44
  191. package/Common/Preview/index.tsx +0 -25
  192. package/Common/Select/__tests__/index.test.jsx +0 -67
  193. package/Common/Select/index.stories.tsx +0 -111
  194. package/Common/Select/index.tsx +0 -187
  195. package/Common/Separator/index.stories.tsx +0 -32
  196. package/Common/Separator/index.tsx +0 -27
  197. package/Common/Skeleton/index.tsx +0 -39
  198. package/Common/Tabs/__tests__/index.test.jsx +0 -52
  199. package/Common/Tabs/index.stories.tsx +0 -50
  200. package/Common/Tabs/index.tsx +0 -54
  201. package/Common/ThemeToggle/__tests__/index.test.jsx +0 -35
  202. package/Common/ThemeToggle/index.stories.tsx +0 -10
  203. package/Common/ThemeToggle/index.tsx +0 -15
  204. package/Common/Tooltip/index.stories.tsx +0 -73
  205. package/Common/Tooltip/index.tsx +0 -48
  206. package/Containers/Article/index.stories.tsx +0 -39
  207. package/Containers/Article/index.tsx +0 -9
  208. package/Containers/Footer/index.stories.tsx +0 -27
  209. package/Containers/Footer/index.tsx +0 -95
  210. package/Containers/MetaBar/__tests__/index.test.jsx +0 -63
  211. package/Containers/MetaBar/index.stories.tsx +0 -80
  212. package/Containers/MetaBar/index.tsx +0 -72
  213. package/Containers/NavBar/NavItem/index.stories.tsx +0 -38
  214. package/Containers/NavBar/NavItem/index.tsx +0 -44
  215. package/Containers/NavBar/index.stories.tsx +0 -45
  216. package/Containers/NavBar/index.tsx +0 -94
  217. package/Containers/Sidebar/ProgressionIcon/index.tsx +0 -16
  218. package/Containers/Sidebar/SidebarGroup/index.stories.tsx +0 -36
  219. package/Containers/Sidebar/SidebarGroup/index.tsx +0 -49
  220. package/Containers/Sidebar/SidebarItem/index.stories.tsx +0 -15
  221. package/Containers/Sidebar/SidebarItem/index.tsx +0 -43
  222. package/Containers/Sidebar/index.stories.tsx +0 -88
  223. package/Containers/Sidebar/index.tsx +0 -70
  224. package/Icons/HexagonGrid.stories.tsx +0 -10
  225. package/Icons/HexagonGrid.tsx +0 -1434
  226. package/Icons/InstallationMethod/Choco.tsx +0 -78
  227. package/Icons/InstallationMethod/Devbox.tsx +0 -21
  228. package/Icons/InstallationMethod/Docker.tsx +0 -20
  229. package/Icons/InstallationMethod/FNM.tsx +0 -132
  230. package/Icons/InstallationMethod/Homebrew.tsx +0 -69
  231. package/Icons/InstallationMethod/N.tsx +0 -32
  232. package/Icons/InstallationMethod/NVM.tsx +0 -63
  233. package/Icons/InstallationMethod/Volta.tsx +0 -34
  234. package/Icons/Logos/JsGreen.tsx +0 -24
  235. package/Icons/Logos/JsWhite.tsx +0 -37
  236. package/Icons/Logos/Nodejs.tsx +0 -372
  237. package/Icons/Logos/NodejsStackedBlack.tsx +0 -98
  238. package/Icons/Logos/NodejsStackedDark.tsx +0 -124
  239. package/Icons/Logos/NodejsStackedLight.tsx +0 -123
  240. package/Icons/Logos/NodejsStackedWhite.tsx +0 -98
  241. package/Icons/Logos/index.ts +0 -17
  242. package/Icons/OperatingSystem/AIX.tsx +0 -46
  243. package/Icons/OperatingSystem/Apple.tsx +0 -23
  244. package/Icons/OperatingSystem/Linux.tsx +0 -969
  245. package/Icons/OperatingSystem/Microsoft.tsx +0 -19
  246. package/Icons/PackageManager/Npm.tsx +0 -21
  247. package/Icons/PackageManager/Pnpm.tsx +0 -22
  248. package/Icons/PackageManager/Yarn.tsx +0 -22
  249. package/Icons/Social/Bluesky.tsx +0 -19
  250. package/Icons/Social/Discord.tsx +0 -20
  251. package/Icons/Social/GitHub.tsx +0 -16
  252. package/Icons/Social/LinkedIn.tsx +0 -16
  253. package/Icons/Social/Mastodon.tsx +0 -36
  254. package/Icons/Social/Slack.tsx +0 -31
  255. package/Icons/Social/X.tsx +0 -16
  256. package/MDX/CodeTabs.tsx +0 -47
  257. package/stylelint/__tests__/index.test.mjs +0 -80
  258. package/styles/animations.css +0 -47
  259. package/styles/base.css +0 -17
  260. package/styles/effects.css +0 -12
  261. package/styles/markdown.css +0 -173
  262. package/styles/theme.css +0 -175
  263. package/types.ts +0 -25
@@ -1,64 +1,48 @@
1
1
  import stylelint from 'stylelint';
2
-
3
2
  import { indentClassNames } from './utils.mjs';
4
-
5
- const {
6
- createPlugin,
7
- utils: { report, ruleMessages },
8
- } = stylelint;
9
-
3
+ const { createPlugin, utils: { report, ruleMessages }, } = stylelint;
10
4
  const name = 'nodejs/one-utility-class-per-line';
11
-
12
5
  const messages = ruleMessages(name, {
13
- className: classNames =>
14
- `Each line should contain only one Tailwind utility class; "${classNames}"`,
15
- spacing: classNames =>
16
- `Each utility class used with @apply should be indented by 2 spaces on a new line; ${classNames}`,
6
+ className: classNames => `Each line should contain only one Tailwind utility class; "${classNames}"`,
7
+ spacing: classNames => `Each utility class used with @apply should be indented by 2 spaces on a new line; ${classNames}`,
17
8
  });
18
-
19
9
  const meta = {
20
- url: 'https://github.com/nodejs/nodejs.org/blob/main/COLLABORATOR_GUIDE.md#styling-a-component',
21
- fixable: true,
10
+ url: 'https://github.com/nodejs/nodejs.org/blob/main/COLLABORATOR_GUIDE.md#styling-a-component',
11
+ fixable: true,
22
12
  };
23
-
24
13
  /** @type {import('stylelint').Rule} */
25
14
  const rule = () => (root, result) => {
26
- root.walkAtRules('apply', rule => {
27
- if (!rule.params.includes(' ')) {
28
- // If there are no spaces in the params, we don't need to check anything
29
- return;
30
- }
31
-
32
- // Since we use 2 spaces for indentation, each line in the apply rule
33
- // should be indented with two extra whitespaces.
34
- const classes = rule.params.split(`${rule.raws.before} `);
35
- const classNames = classes.join('');
36
-
37
- // Check if the params contain any spaces
38
- if (classNames.includes(' ')) {
39
- if (classNames.includes('\n')) {
40
- return report({
41
- ruleName: name,
42
- result: result,
43
- message: messages.spacing(JSON.stringify(rule.params)),
44
- node: rule,
45
- fix: indentClassNames(rule),
46
- });
47
- }
48
-
49
- return report({
50
- ruleName: name,
51
- result,
52
- message: messages.className(rule.params),
53
- node: rule,
54
- fix: indentClassNames(rule),
55
- });
56
- }
57
- });
15
+ root.walkAtRules('apply', rule => {
16
+ if (!rule.params.includes(' ')) {
17
+ // If there are no spaces in the params, we don't need to check anything
18
+ return;
19
+ }
20
+ // Since we use 2 spaces for indentation, each line in the apply rule
21
+ // should be indented with two extra whitespaces.
22
+ const classes = rule.params.split(`${rule.raws.before} `);
23
+ const classNames = classes.join('');
24
+ // Check if the params contain any spaces
25
+ if (classNames.includes(' ')) {
26
+ if (classNames.includes('\n')) {
27
+ return report({
28
+ ruleName: name,
29
+ result: result,
30
+ message: messages.spacing(JSON.stringify(rule.params)),
31
+ node: rule,
32
+ fix: indentClassNames(rule),
33
+ });
34
+ }
35
+ return report({
36
+ ruleName: name,
37
+ result: result,
38
+ message: messages.className(rule.params),
39
+ node: rule,
40
+ fix: indentClassNames(rule),
41
+ });
42
+ }
43
+ });
58
44
  };
59
-
60
45
  rule.ruleName = name;
61
46
  rule.messages = messages;
62
47
  rule.meta = meta;
63
-
64
48
  export default createPlugin(name, rule);
@@ -8,22 +8,17 @@
8
8
  * @returns {Object|null} The modified rule with properly formatted class names, or null if the rule is invalid.
9
9
  */
10
10
  export const indentClassNames = rule => {
11
- // Ensure that the rule contains necessary properties
12
- if (!rule || !rule.params || !rule.raws || !rule.raws.before) {
13
- return null;
14
- }
15
-
16
- const indent = ' '.repeat(rule.raws.before.length + 1);
17
-
18
- // Clean and split the class names
19
- const cleanedClasses = cleanClassNames(rule.params);
20
-
21
- // Apply the indentation and join the class names back together
22
- rule.params = applyIndentation(cleanedClasses, indent);
23
-
24
- return rule;
11
+ // Ensure that the rule contains necessary properties
12
+ if (!rule || !rule.params || !rule.raws || !rule.raws.before) {
13
+ return null;
14
+ }
15
+ const indent = ' '.repeat(rule.raws.before.length + 1);
16
+ // Clean and split the class names
17
+ const cleanedClasses = cleanClassNames(rule.params);
18
+ // Apply the indentation and join the class names back together
19
+ rule.params = applyIndentation(cleanedClasses, indent);
20
+ return rule;
25
21
  };
26
-
27
22
  /**
28
23
  * Cleans the input string by removing unnecessary whitespace and newlines.
29
24
  *
@@ -31,12 +26,11 @@ export const indentClassNames = rule => {
31
26
  * @returns {string} The cleaned class names string.
32
27
  */
33
28
  export const cleanClassNames = params => {
34
- return params
35
- .replace(/[\n\r]+/g, '') // Remove new lines
36
- .replace(/\s+/g, ' ') // Replace multiple spaces with a single space
37
- .trim(); // Trim leading/trailing spaces
29
+ return params
30
+ .replace(/[\n\r]+/g, '') // Remove new lines
31
+ .replace(/\s+/g, ' ') // Replace multiple spaces with a single space
32
+ .trim(); // Trim leading/trailing spaces
38
33
  };
39
-
40
34
  /**
41
35
  * Applies the correct indentation to each class name in the string.
42
36
  *
@@ -45,9 +39,9 @@ export const cleanClassNames = params => {
45
39
  * @returns {string} The class names string with applied indentation.
46
40
  */
47
41
  export const applyIndentation = (classes, indent) => {
48
- return classes
49
- .split(' ') // Split into an array of class names
50
- .map(className => indent + className) // Add indentation to each class
51
- .join('\n') // Join with new lines
52
- .trim(); // Remove extra space at the end
42
+ return classes
43
+ .split(' ') // Split into an array of class names
44
+ .map(className => indent + className) // Add indentation to each class
45
+ .join('\n') // Join with new lines
46
+ .trim(); // Remove extra space at the end
53
47
  };