this.gui 1.0.12 → 1.0.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 (266) hide show
  1. package/package.json +5 -2
  2. package/src/App.jsx +31 -0
  3. package/src/MDXEditor.jsx +32 -0
  4. package/src/MdxProvider.jsx +20 -0
  5. package/src/Theme.jsx +28 -0
  6. package/src/components/CodeBlock.jsx +22 -0
  7. package/src/components/ComponentFactory.jsx +36 -0
  8. package/src/components/ComponentRegistry.js +21 -0
  9. package/src/index.mdx +154 -0
  10. package/src/main.jsx +18 -0
  11. package/src/scripts/generateComponents.js +166 -0
  12. package/src/scripts/logASCIIArt.js +12 -0
  13. package/src/scripts/postinstall.js +64 -0
  14. package/src/scripts/verifyMolecules.js +158 -0
  15. package/src/scripts/verify_and_install_atoms.js +211 -0
  16. package/src/stories/Atoms/Alert/Alert.css +29 -0
  17. package/src/stories/Atoms/Alert/Alert.jsx +41 -0
  18. package/src/stories/Atoms/Alert/Alert.stories.jsx +41 -0
  19. package/src/stories/Atoms/Audio/Audio.css +29 -0
  20. package/src/stories/Atoms/Audio/Audio.jsx +41 -0
  21. package/src/stories/Atoms/Audio/Audio.stories.jsx +41 -0
  22. package/src/stories/Atoms/Badge/Badge.css +29 -0
  23. package/src/stories/Atoms/Badge/Badge.jsx +41 -0
  24. package/src/stories/Atoms/Badge/Badge.stories.jsx +41 -0
  25. package/src/stories/Atoms/Button/Button.css +70 -0
  26. package/src/stories/Atoms/Button/Button.jsx +98 -0
  27. package/src/stories/Atoms/Button/Button.stories.jsx +54 -0
  28. package/src/stories/Atoms/Caption/Caption.css +29 -0
  29. package/src/stories/Atoms/Caption/Caption.jsx +41 -0
  30. package/src/stories/Atoms/Caption/Caption.stories.jsx +41 -0
  31. package/src/stories/Atoms/Checkbox/Checkbox.css +29 -0
  32. package/src/stories/Atoms/Checkbox/Checkbox.jsx +41 -0
  33. package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +41 -0
  34. package/src/stories/Atoms/Container/Container.css +29 -0
  35. package/src/stories/Atoms/Container/Container.jsx +41 -0
  36. package/src/stories/Atoms/Container/Container.stories.jsx +41 -0
  37. package/src/stories/Atoms/Divider/Divider.css +29 -0
  38. package/src/stories/Atoms/Divider/Divider.jsx +41 -0
  39. package/src/stories/Atoms/Divider/Divider.stories.jsx +41 -0
  40. package/src/stories/Atoms/Heading/Heading.css +29 -0
  41. package/src/stories/Atoms/Heading/Heading.jsx +41 -0
  42. package/src/stories/Atoms/Heading/Heading.stories.jsx +41 -0
  43. package/src/stories/Atoms/Icon/Icon.css +48 -0
  44. package/src/stories/Atoms/Icon/Icon.jsx +51 -0
  45. package/src/stories/Atoms/Icon/Icon.stories.jsx +72 -0
  46. package/src/stories/Atoms/Image/Image.css +29 -0
  47. package/src/stories/Atoms/Image/Image.jsx +41 -0
  48. package/src/stories/Atoms/Image/Image.stories.jsx +41 -0
  49. package/src/stories/Atoms/Label/Label.css +29 -0
  50. package/src/stories/Atoms/Label/Label.jsx +41 -0
  51. package/src/stories/Atoms/Label/Label.stories.jsx +41 -0
  52. package/src/stories/Atoms/Link/Link.css +29 -0
  53. package/src/stories/Atoms/Link/Link.jsx +41 -0
  54. package/src/stories/Atoms/Link/Link.stories.jsx +41 -0
  55. package/src/stories/Atoms/Loader/Loader.css +29 -0
  56. package/src/stories/Atoms/Loader/Loader.jsx +41 -0
  57. package/src/stories/Atoms/Loader/Loader.stories.jsx +41 -0
  58. package/src/stories/Atoms/Paragraph/Paragraph.css +29 -0
  59. package/src/stories/Atoms/Paragraph/Paragraph.jsx +41 -0
  60. package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +41 -0
  61. package/src/stories/Atoms/ProgressBar/ProgressBar.css +29 -0
  62. package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +41 -0
  63. package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +41 -0
  64. package/src/stories/Atoms/RadioButton/RadioButton.css +29 -0
  65. package/src/stories/Atoms/RadioButton/RadioButton.jsx +41 -0
  66. package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +41 -0
  67. package/src/stories/Atoms/RangeInput/RangeInput.css +29 -0
  68. package/src/stories/Atoms/RangeInput/RangeInput.jsx +41 -0
  69. package/src/stories/Atoms/RangeInput/RangeInput.stories.jsx +41 -0
  70. package/src/stories/Atoms/Select/Select.css +29 -0
  71. package/src/stories/Atoms/Select/Select.jsx +41 -0
  72. package/src/stories/Atoms/Select/Select.stories.jsx +41 -0
  73. package/src/stories/Atoms/Slider/Slider.css +29 -0
  74. package/src/stories/Atoms/Slider/Slider.jsx +41 -0
  75. package/src/stories/Atoms/Slider/Slider.stories.jsx +41 -0
  76. package/src/stories/Atoms/Snackbar/Snackbar.css +29 -0
  77. package/src/stories/Atoms/Snackbar/Snackbar.jsx +41 -0
  78. package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +41 -0
  79. package/src/stories/Atoms/Spacer/Spacer.css +29 -0
  80. package/src/stories/Atoms/Spacer/Spacer.jsx +41 -0
  81. package/src/stories/Atoms/Spacer/Spacer.stories.jsx +41 -0
  82. package/src/stories/Atoms/Spinner/Spinner.css +29 -0
  83. package/src/stories/Atoms/Spinner/Spinner.jsx +41 -0
  84. package/src/stories/Atoms/Spinner/Spinner.stories.jsx +41 -0
  85. package/src/stories/Atoms/Tag/Tag.css +29 -0
  86. package/src/stories/Atoms/Tag/Tag.jsx +41 -0
  87. package/src/stories/Atoms/Tag/Tag.stories.jsx +41 -0
  88. package/src/stories/Atoms/TextArea/TextArea.css +29 -0
  89. package/src/stories/Atoms/TextArea/TextArea.jsx +41 -0
  90. package/src/stories/Atoms/TextArea/TextArea.stories.jsx +41 -0
  91. package/src/stories/Atoms/TextInput/TextInput.css +29 -0
  92. package/src/stories/Atoms/TextInput/TextInput.jsx +41 -0
  93. package/src/stories/Atoms/TextInput/TextInput.stories.jsx +41 -0
  94. package/src/stories/Atoms/Toggle/Toggle.css +29 -0
  95. package/src/stories/Atoms/Toggle/Toggle.jsx +41 -0
  96. package/src/stories/Atoms/Toggle/Toggle.stories.jsx +41 -0
  97. package/src/stories/Atoms/Tooltip/Tooltip.css +29 -0
  98. package/src/stories/Atoms/Tooltip/Tooltip.jsx +41 -0
  99. package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +41 -0
  100. package/src/stories/Atoms/Video/Video.css +29 -0
  101. package/src/stories/Atoms/Video/Video.jsx +41 -0
  102. package/src/stories/Atoms/Video/Video.stories.jsx +41 -0
  103. package/src/stories/Atoms/index.js +65 -0
  104. package/src/stories/Atoms/meta_Atoms.js +46 -0
  105. package/src/stories/Components.js +198 -0
  106. package/src/stories/Components.md +189 -0
  107. package/src/stories/Getting Started.mdx +239 -0
  108. package/src/stories/Layouts/Grid/Grid.css +4 -0
  109. package/src/stories/Layouts/Grid/Grid.jsx +15 -0
  110. package/src/stories/Layouts/Grid/Grid.stories.jsx +26 -0
  111. package/src/stories/Layouts/Layout.js +28 -0
  112. package/src/stories/MDX.mdx +118 -0
  113. package/src/stories/Miscellaneous/Miscellaneous.js +24 -0
  114. package/src/stories/Molecules/Accordion/Accordion.css +4 -0
  115. package/src/stories/Molecules/Accordion/Accordion.jsx +25 -0
  116. package/src/stories/Molecules/Accordion/Accordion.stories.jsx +20 -0
  117. package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +4 -0
  118. package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +25 -0
  119. package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +20 -0
  120. package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +4 -0
  121. package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +25 -0
  122. package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +20 -0
  123. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +4 -0
  124. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +25 -0
  125. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +20 -0
  126. package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +4 -0
  127. package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +25 -0
  128. package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +20 -0
  129. package/src/stories/Molecules/Card/Card.css +4 -0
  130. package/src/stories/Molecules/Card/Card.jsx +25 -0
  131. package/src/stories/Molecules/Card/Card.stories.jsx +20 -0
  132. package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +4 -0
  133. package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +25 -0
  134. package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +20 -0
  135. package/src/stories/Molecules/DataTable/DataTable.css +4 -0
  136. package/src/stories/Molecules/DataTable/DataTable.jsx +25 -0
  137. package/src/stories/Molecules/DataTable/DataTable.stories.jsx +20 -0
  138. package/src/stories/Molecules/FileUpload/FileUpload.css +4 -0
  139. package/src/stories/Molecules/FileUpload/FileUpload.jsx +25 -0
  140. package/src/stories/Molecules/FileUpload/FileUpload.stories.jsx +20 -0
  141. package/src/stories/Molecules/FormField/FormField.css +4 -0
  142. package/src/stories/Molecules/FormField/FormField.jsx +25 -0
  143. package/src/stories/Molecules/FormField/FormField.stories.jsx +20 -0
  144. package/src/stories/Molecules/Header/Header.css +35 -0
  145. package/src/stories/Molecules/Header/Header.jsx +76 -0
  146. package/src/stories/Molecules/Header/Header.stories.jsx +28 -0
  147. package/src/stories/Molecules/IconButton/IconButton.css +4 -0
  148. package/src/stories/Molecules/IconButton/IconButton.jsx +25 -0
  149. package/src/stories/Molecules/IconButton/IconButton.stories.jsx +20 -0
  150. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.css +4 -0
  151. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.jsx +25 -0
  152. package/src/stories/Molecules/ImageWithCaption/ImageWithCaption.stories.jsx +20 -0
  153. package/src/stories/Molecules/InputGroup/InputGroup.css +4 -0
  154. package/src/stories/Molecules/InputGroup/InputGroup.jsx +25 -0
  155. package/src/stories/Molecules/InputGroup/InputGroup.stories.jsx +20 -0
  156. package/src/stories/Molecules/InputWithLabel/InputWithLabel.css +4 -0
  157. package/src/stories/Molecules/InputWithLabel/InputWithLabel.jsx +25 -0
  158. package/src/stories/Molecules/InputWithLabel/InputWithLabel.stories.jsx +20 -0
  159. package/src/stories/Molecules/List/List.css +4 -0
  160. package/src/stories/Molecules/List/List.jsx +25 -0
  161. package/src/stories/Molecules/List/List.stories.jsx +20 -0
  162. package/src/stories/Molecules/MediaCard/MediaCard.css +4 -0
  163. package/src/stories/Molecules/MediaCard/MediaCard.jsx +25 -0
  164. package/src/stories/Molecules/MediaCard/MediaCard.stories.jsx +20 -0
  165. package/src/stories/Molecules/Modal/Modal.css +4 -0
  166. package/src/stories/Molecules/Modal/Modal.jsx +25 -0
  167. package/src/stories/Molecules/Modal/Modal.stories.jsx +20 -0
  168. package/src/stories/Molecules/Molecules.js +44 -0
  169. package/src/stories/Molecules/Navbar/Navbar.css +87 -0
  170. package/src/stories/Molecules/Navbar/Navbar.jsx +87 -0
  171. package/src/stories/Molecules/Navbar/Navbar.stories.jsx +20 -0
  172. package/src/stories/Molecules/Notification/Notification.css +4 -0
  173. package/src/stories/Molecules/Notification/Notification.jsx +25 -0
  174. package/src/stories/Molecules/Notification/Notification.stories.jsx +20 -0
  175. package/src/stories/Molecules/PricingTable/PricingTable.css +4 -0
  176. package/src/stories/Molecules/PricingTable/PricingTable.jsx +25 -0
  177. package/src/stories/Molecules/PricingTable/PricingTable.stories.jsx +20 -0
  178. package/src/stories/Molecules/SearchBar/SearchBar.css +4 -0
  179. package/src/stories/Molecules/SearchBar/SearchBar.jsx +25 -0
  180. package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +20 -0
  181. package/src/stories/Molecules/SelectTheme/SelectTheme.css +25 -0
  182. package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +44 -0
  183. package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +25 -0
  184. package/src/stories/Molecules/Sidebar/Sidebar.css +4 -0
  185. package/src/stories/Molecules/Sidebar/Sidebar.jsx +25 -0
  186. package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +20 -0
  187. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.css +4 -0
  188. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.jsx +25 -0
  189. package/src/stories/Molecules/VideoWithDescription/VideoWithDescription.stories.jsx +20 -0
  190. package/src/stories/Molecules/index.js +57 -0
  191. package/src/stories/Organisms/Organisms.js +39 -0
  192. package/src/stories/Organisms/Profile/UserFriends/UserFriends.context.jsx +15 -0
  193. package/src/stories/Organisms/Profile/UserFriends/UserFriends.css +4 -0
  194. package/src/stories/Organisms/Profile/UserFriends/UserFriends.jsx +13 -0
  195. package/src/stories/Organisms/Profile/UserFriends/UserFriends.stories.jsx +26 -0
  196. package/src/stories/Organisms/Profile/UserPosts/UserPosts.context.jsx +15 -0
  197. package/src/stories/Organisms/Profile/UserPosts/UserPosts.css +4 -0
  198. package/src/stories/Organisms/Profile/UserPosts/UserPosts.jsx +13 -0
  199. package/src/stories/Organisms/Profile/UserPosts/UserPosts.stories.jsx +26 -0
  200. package/src/stories/Organisms/Profile/UserProfile/UserProfile.context.jsx +15 -0
  201. package/src/stories/Organisms/Profile/UserProfile/UserProfile.css +4 -0
  202. package/src/stories/Organisms/Profile/UserProfile/UserProfile.jsx +13 -0
  203. package/src/stories/Organisms/Profile/UserProfile/UserProfile.stories.jsx +26 -0
  204. package/src/stories/Pages/Page/Page.css +69 -0
  205. package/src/stories/Pages/Page/Page.jsx +69 -0
  206. package/src/stories/Pages/Page/Page.stories.js +26 -0
  207. package/src/stories/Pages/Page/Pages.js +31 -0
  208. package/src/stories/Templates/Templates.js +27 -0
  209. package/src/stories/assets/accessibility.png +0 -0
  210. package/src/stories/assets/accessibility.svg +1 -0
  211. package/src/stories/assets/addon-library.png +0 -0
  212. package/src/stories/assets/assets.png +0 -0
  213. package/src/stories/assets/avif-test-image.avif +0 -0
  214. package/src/stories/assets/context.png +0 -0
  215. package/src/stories/assets/discord.svg +1 -0
  216. package/src/stories/assets/docs.png +0 -0
  217. package/src/stories/assets/figma-plugin.png +0 -0
  218. package/src/stories/assets/github.svg +1 -0
  219. package/src/stories/assets/share.png +0 -0
  220. package/src/stories/assets/styling.png +0 -0
  221. package/src/stories/assets/testing.png +0 -0
  222. package/src/stories/assets/theming.png +0 -0
  223. package/src/stories/assets/tutorials.svg +1 -0
  224. package/src/stories/assets/youtube.svg +1 -0
  225. package/src/styles/Header.modules.css +32 -0
  226. package/src/styles/global.css +59 -0
  227. package/src/themes/ThemeProvider.jsx +36 -0
  228. package/src/themes/Themes.js +44 -0
  229. package/src/themes/dark.js +22 -0
  230. package/src/themes/light.js +22 -0
  231. package/src/themes/typ/Readme.md +4 -0
  232. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700.woff2 +0 -0
  233. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700italic.woff2 +0 -0
  234. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-italic.woff2 +0 -0
  235. package/src/themes/typ/github/open-sans-v17-latin-ext_latin-regular.woff2 +0 -0
  236. package/src/themes/typ/github.css +416 -0
  237. package/src/themes/typ/gothic/GUST e-foundry License.txt +29 -0
  238. package/src/themes/typ/gothic/didact-gothic-c-ext.woff2 +0 -0
  239. package/src/themes/typ/gothic/didact-gothic-c.woff2 +0 -0
  240. package/src/themes/typ/gothic/texgyreadventor-bold.woff +0 -0
  241. package/src/themes/typ/gothic/texgyreadventor-bolditalic.woff +0 -0
  242. package/src/themes/typ/gothic/texgyreadventor-italic.woff +0 -0
  243. package/src/themes/typ/gothic/texgyreadventor-regular.woff +0 -0
  244. package/src/themes/typ/gothic.css +410 -0
  245. package/src/themes/typ/newsprint/pt-serif-v11-latin-700.woff2 +0 -0
  246. package/src/themes/typ/newsprint/pt-serif-v11-latin-700italic.woff2 +0 -0
  247. package/src/themes/typ/newsprint/pt-serif-v11-latin-italic.woff2 +0 -0
  248. package/src/themes/typ/newsprint/pt-serif-v11-latin-regular.woff2 +0 -0
  249. package/src/themes/typ/newsprint.css +622 -0
  250. package/src/themes/typ/night/codeblock.dark.css +113 -0
  251. package/src/themes/typ/night/credit.html +1 -0
  252. package/src/themes/typ/night/cursor.png +0 -0
  253. package/src/themes/typ/night/cursor@2x.png +0 -0
  254. package/src/themes/typ/night/mermaid.dark.css +7 -0
  255. package/src/themes/typ/night/sourcemode.dark.css +38 -0
  256. package/src/themes/typ/night.css +1032 -0
  257. package/src/themes/typ/pixyll/lato-v14-latin-300.woff +0 -0
  258. package/src/themes/typ/pixyll/lato-v14-latin-300italic.woff +0 -0
  259. package/src/themes/typ/pixyll/lato-v14-latin-900.woff +0 -0
  260. package/src/themes/typ/pixyll/lato-v14-latin-900italic.woff +0 -0
  261. package/src/themes/typ/pixyll/merriweather-v19-latin-300.woff +0 -0
  262. package/src/themes/typ/pixyll/merriweather-v19-latin-300italic.woff +0 -0
  263. package/src/themes/typ/pixyll/merriweather-v19-latin-700.woff +0 -0
  264. package/src/themes/typ/pixyll/merriweather-v19-latin-700italic.woff +0 -0
  265. package/src/themes/typ/pixyll.css +528 -0
  266. package/src/themes/typ/whitey.css +299 -0
@@ -0,0 +1,158 @@
1
+ // verifyMolecules.js
2
+
3
+ import fs from 'fs';
4
+ import path from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import Molecules from '../stories/Molecules/Molecules.js'; // Import the Molecules constant
7
+
8
+ // Define __dirname for ES modules
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+
12
+ // Helper function to check if a file exists relative to the script's directory
13
+ const fileExists = (relativeFilePath) => {
14
+ const fullPath = path.resolve(__dirname, relativeFilePath);
15
+ return fs.existsSync(fullPath);
16
+ };
17
+
18
+ // Default CSS template
19
+ const createDefaultCSSTemplate = (componentName) => `
20
+ .${componentName.toLowerCase()} {
21
+ /* Default styles for ${componentName} */
22
+ }
23
+ `;
24
+
25
+ // Default JSX template
26
+ const createDefaultJSX = (componentName) => `
27
+ import React from 'react';
28
+ import PropTypes from 'prop-types';
29
+ import './${componentName}.css';
30
+
31
+ /**
32
+ * ${componentName} component
33
+ */
34
+ export const ${componentName} = (props) => {
35
+ return (
36
+ <div className="${componentName.toLowerCase()}" {...props}>
37
+ {/* Component implementation */}
38
+ </div>
39
+ );
40
+ };
41
+
42
+ ${componentName}.propTypes = {
43
+ // Define prop types here
44
+ };
45
+
46
+ ${componentName}.defaultProps = {
47
+ // Define default props here
48
+ };
49
+
50
+ export default ${componentName};
51
+ `;
52
+
53
+ // Default Storybook template
54
+ const createDefaultStorybookTemplate = (componentName, category) => `
55
+ import { ${componentName} } from './${componentName}';
56
+
57
+ // Storybook configuration for ${componentName} component
58
+ export default {
59
+ title: 'Molecules/${category}/${componentName}',
60
+ component: ${componentName},
61
+ parameters: {
62
+ layout: 'centered',
63
+ },
64
+ argTypes: {
65
+ // Define argTypes here
66
+ },
67
+ };
68
+
69
+ export const Default = {
70
+ args: {
71
+ // Define default args here
72
+ },
73
+ };
74
+ `;
75
+
76
+ // Helper function to write files
77
+ const writeFile = (filePath, content) => {
78
+ const fullPath = path.resolve(__dirname, filePath);
79
+ fs.mkdirSync(path.dirname(fullPath), { recursive: true });
80
+ fs.writeFileSync(fullPath, content, 'utf8');
81
+ console.log(`✅ Created: ${filePath}`);
82
+ };
83
+
84
+ // Function to verify each path and create missing files with default content
85
+ async function verifyPaths(component, paths, category) {
86
+ const missingFiles = []; // Initialize missingFiles array
87
+
88
+ for (const [key, filePath] of Object.entries(paths)) {
89
+ const componentName = component.name.trim();
90
+ const adjustedPath = path.join(
91
+ '..',
92
+ 'stories',
93
+ 'Molecules',
94
+ componentName,
95
+ filePath.replace('./', '')
96
+ );
97
+
98
+ if (!fileExists(adjustedPath)) {
99
+ console.log(`❌ Missing: ${adjustedPath}`);
100
+ missingFiles.push(adjustedPath);
101
+
102
+ // Automatically create the missing file with default content
103
+ if (key === 'css') {
104
+ writeFile(adjustedPath, createDefaultCSSTemplate(componentName));
105
+ } else if (key === 'jsx') {
106
+ writeFile(adjustedPath, createDefaultJSX(componentName));
107
+ } else if (key === 'stories') {
108
+ writeFile(adjustedPath, createDefaultStorybookTemplate(componentName, category));
109
+ }
110
+ } else {
111
+ console.log(`✅ Exists: ${adjustedPath}`);
112
+ }
113
+ }
114
+
115
+ return missingFiles; // Return missingFiles array
116
+ }
117
+
118
+ // Main function to handle installation and verification
119
+ async function installAndVerifyMolecules(Molecules) {
120
+ const missingFilesReport = [];
121
+
122
+ // Loop through each category (Navigation, FormElements, etc.)
123
+ for (const category of Object.keys(Molecules.Molecules)) {
124
+ console.log(`\nVerifying category: ${category}`);
125
+
126
+ // Loop through each component in the category
127
+ for (const component of Molecules.Molecules[category]) {
128
+ console.log(`\nVerifying component: ${component.name.trim()}`);
129
+
130
+ // Verify each path for the component and get missing files
131
+ const missingFiles = await verifyPaths(component, component.paths, category);
132
+
133
+ // If files are missing, report them
134
+ if (missingFiles.length > 0) {
135
+ missingFilesReport.push({
136
+ component: component.name.trim(),
137
+ missingFiles,
138
+ });
139
+ }
140
+ }
141
+ }
142
+
143
+ // If there are missing files, summarize the report
144
+ if (missingFilesReport.length > 0) {
145
+ console.log('\nInstallation or verification required for the following components:');
146
+ missingFilesReport.forEach((report) => {
147
+ console.log(`\nComponent: ${report.component}`);
148
+ report.missingFiles.forEach((file) => {
149
+ console.log(` ❌ Missing file: ${file}`);
150
+ });
151
+ });
152
+ } else {
153
+ console.log('\nAll components verified successfully! ✅');
154
+ }
155
+ }
156
+
157
+ // Run the verification script
158
+ installAndVerifyMolecules(Molecules);
@@ -0,0 +1,211 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import Atomic from '../stories/_Atomic/Atomic.js'; // Import the Atomic constant
5
+
6
+ // Define __dirname for ES modules
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+
10
+ // Helper function to check if a file exists relative to the script's directory
11
+ const fileExists = (relativeFilePath) => {
12
+ const fullPath = path.resolve(__dirname, relativeFilePath);
13
+ return fs.existsSync(fullPath);
14
+ };
15
+
16
+ // Default CSS template
17
+ const createDefaultCSSTemplate = (componentName) => `
18
+ .${componentName.toLowerCase()} {
19
+ padding: 16px;
20
+ border-radius: 8px;
21
+ background-color: #f0f0f0;
22
+ border: 1px solid #ddd;
23
+ }
24
+
25
+ .${componentName.toLowerCase()}--primary {
26
+ background-color: #e3f2fd;
27
+ border-color: #1e88e5;
28
+ }
29
+
30
+ .${componentName.toLowerCase()}--secondary {
31
+ background-color: #fff;
32
+ border-color: #ccc;
33
+ }
34
+
35
+ .${componentName.toLowerCase()}--small {
36
+ padding: 8px;
37
+ }
38
+
39
+ .${componentName.toLowerCase()}--medium {
40
+ padding: 16px;
41
+ }
42
+
43
+ .${componentName.toLowerCase()}--large {
44
+ padding: 32px;
45
+ }
46
+ `;
47
+
48
+ // Default JSX template
49
+ const createDefaultJSX = (componentName) => `
50
+ import React from 'react';
51
+ import PropTypes from 'prop-types';
52
+ import './${componentName}.css';
53
+
54
+ /**
55
+ * ${componentName} component for user interaction
56
+ */
57
+ export const ${componentName} = ({ primary, size, children, ...props }) => {
58
+ const mode = primary ? '${componentName.toLowerCase()}--primary' : '${componentName.toLowerCase()}--secondary';
59
+ return (
60
+ <div
61
+ className={['${componentName.toLowerCase()}', \`${componentName.toLowerCase()}--\${size}\`, mode].join(' ')}
62
+ {...props}
63
+ >
64
+ {children}
65
+ </div>
66
+ );
67
+ };
68
+
69
+ ${componentName}.propTypes = {
70
+ /**
71
+ * Is this the primary style for the component?
72
+ */
73
+ primary: PropTypes.bool,
74
+ /**
75
+ * Size of the component
76
+ */
77
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
78
+ /**
79
+ * Content to be rendered inside the component
80
+ */
81
+ children: PropTypes.node.isRequired,
82
+ };
83
+
84
+ ${componentName}.defaultProps = {
85
+ primary: false,
86
+ size: 'medium',
87
+ };
88
+
89
+ export default ${componentName};
90
+ `;
91
+ // Default Storybook template
92
+ const createDefaultStorybookTemplate = (componentName) => `
93
+ import { ${componentName} } from './${componentName}';
94
+
95
+ // Storybook configuration for ${componentName} component
96
+ export default {
97
+ title: '_Atomic/${componentName}',
98
+ component: ${componentName},
99
+ parameters: {
100
+ layout: 'centered',
101
+ },
102
+ argTypes: {
103
+ children: { control: 'text' },
104
+ },
105
+ };
106
+
107
+ export const Primary = {
108
+ args: {
109
+ primary: true,
110
+ children: 'This is a primary ${componentName}',
111
+ },
112
+ };
113
+
114
+ export const Secondary = {
115
+ args: {
116
+ children: 'This is a secondary ${componentName}',
117
+ },
118
+ };
119
+
120
+ export const Large = {
121
+ args: {
122
+ size: 'large',
123
+ children: 'This is a large ${componentName}',
124
+ },
125
+ };
126
+
127
+ export const Small = {
128
+ args: {
129
+ size: 'small',
130
+ children: 'This is a small ${componentName}',
131
+ },
132
+ };
133
+ `;
134
+
135
+ // Helper function to write files
136
+ const writeFile = (filePath, content) => {
137
+ const fullPath = path.resolve(__dirname, filePath);
138
+ fs.mkdirSync(path.dirname(fullPath), { recursive: true });
139
+ fs.writeFileSync(fullPath, content, 'utf8');
140
+ console.log(`✅ Created: ${filePath}`);
141
+ };
142
+
143
+ // Function to verify each path and create missing files with default content
144
+ async function verifyPaths(component, paths) {
145
+ const missingFiles = []; // Initialize missingFiles array
146
+
147
+ for (const [key, filePath] of Object.entries(paths)) {
148
+ const categoryDir = component.name.trim().replace(' ', '');
149
+ const adjustedPath = path.join('..', 'stories', '_Atomic', categoryDir, filePath);
150
+
151
+ if (!fileExists(adjustedPath)) {
152
+ console.log(`❌ Missing: ${adjustedPath}`);
153
+ missingFiles.push(adjustedPath);
154
+
155
+ // Automatically create the missing file with default content
156
+ if (key === 'css') {
157
+ writeFile(adjustedPath, createDefaultCSSTemplate(component.name.trim()));
158
+ } else if (key === 'jsx') {
159
+ writeFile(adjustedPath, createDefaultJSX(component.name.trim()));
160
+ } else if (key === 'stories') {
161
+ writeFile(adjustedPath, createDefaultStorybookTemplate(component.name.trim()));
162
+ }
163
+ } else {
164
+ console.log(`✅ Exists: ${adjustedPath}`);
165
+ }
166
+ }
167
+
168
+ return missingFiles; // Return missingFiles array
169
+ }
170
+
171
+ // Main function to handle installation and verification
172
+ async function installAndVerifyAtomic(Atomic) {
173
+ const missingFilesReport = [];
174
+
175
+ // Loop through each category (Text, Interactive, etc.)
176
+ for (const category of Object.keys(Atomic.Atomic)) {
177
+ console.log(`\nVerifying category: ${category}`);
178
+
179
+ // Loop through each component in the category
180
+ for (const component of Atomic.Atomic[category]) {
181
+ console.log(`\nVerifying component: ${component.name}`);
182
+
183
+ // Verify each path for the component and get missing files
184
+ const missingFiles = await verifyPaths(component, component.paths);
185
+
186
+ // If files are missing, report them
187
+ if (missingFiles.length > 0) {
188
+ missingFilesReport.push({
189
+ component: component.name,
190
+ missingFiles,
191
+ });
192
+ }
193
+ }
194
+ }
195
+
196
+ // If there are missing files, summarize the report
197
+ if (missingFilesReport.length > 0) {
198
+ console.log("\nInstallation or verification required for the following components:");
199
+ missingFilesReport.forEach((report) => {
200
+ console.log(`\nComponent: ${report.component}`);
201
+ report.missingFiles.forEach((file) => {
202
+ console.log(` ❌ Missing file: ${file}`);
203
+ });
204
+ });
205
+ } else {
206
+ console.log("\nAll components verified successfully! ✅");
207
+ }
208
+ }
209
+
210
+ // Run the verification script
211
+ installAndVerifyAtomic(Atomic);
@@ -0,0 +1,29 @@
1
+
2
+ .alert {
3
+ padding: 16px;
4
+ border-radius: 8px;
5
+ background-color: #f0f0f0;
6
+ border: 1px solid #ddd;
7
+ }
8
+
9
+ .alert--primary {
10
+ background-color: #e3f2fd;
11
+ border-color: #1e88e5;
12
+ }
13
+
14
+ .alert--secondary {
15
+ background-color: #fff;
16
+ border-color: #ccc;
17
+ }
18
+
19
+ .alert--small {
20
+ padding: 8px;
21
+ }
22
+
23
+ .alert--medium {
24
+ padding: 16px;
25
+ }
26
+
27
+ .alert--large {
28
+ padding: 32px;
29
+ }
@@ -0,0 +1,41 @@
1
+
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import './Alert.css';
5
+
6
+ /**
7
+ * Alert component for user interaction
8
+ */
9
+ export const Alert = ({ primary, size, children, ...props }) => {
10
+ const mode = primary ? 'alert--primary' : 'alert--secondary';
11
+ return (
12
+ <div
13
+ className={['alert', `alert--${size}`, mode].join(' ')}
14
+ {...props}
15
+ >
16
+ {children}
17
+ </div>
18
+ );
19
+ };
20
+
21
+ Alert.propTypes = {
22
+ /**
23
+ * Is this the primary style for the component?
24
+ */
25
+ primary: PropTypes.bool,
26
+ /**
27
+ * Size of the component
28
+ */
29
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
30
+ /**
31
+ * Content to be rendered inside the component
32
+ */
33
+ children: PropTypes.node.isRequired,
34
+ };
35
+
36
+ Alert.defaultProps = {
37
+ primary: false,
38
+ size: 'medium',
39
+ };
40
+
41
+ export default Alert;
@@ -0,0 +1,41 @@
1
+
2
+ import { Alert } from './Alert';
3
+
4
+ // Storybook configuration for Alert component
5
+ export default {
6
+ title: 'Atoms/Feedback/Alert',
7
+ component: Alert,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ argTypes: {
12
+ children: { control: 'text' },
13
+ },
14
+ };
15
+
16
+ export const Primary = {
17
+ args: {
18
+ primary: true,
19
+ children: 'This is a primary Alert',
20
+ },
21
+ };
22
+
23
+ export const Secondary = {
24
+ args: {
25
+ children: 'This is a secondary Alert',
26
+ },
27
+ };
28
+
29
+ export const Large = {
30
+ args: {
31
+ size: 'large',
32
+ children: 'This is a large Alert',
33
+ },
34
+ };
35
+
36
+ export const Small = {
37
+ args: {
38
+ size: 'small',
39
+ children: 'This is a small Alert',
40
+ },
41
+ };
@@ -0,0 +1,29 @@
1
+
2
+ .audio {
3
+ padding: 16px;
4
+ border-radius: 8px;
5
+ background-color: #f0f0f0;
6
+ border: 1px solid #ddd;
7
+ }
8
+
9
+ .audio--primary {
10
+ background-color: #e3f2fd;
11
+ border-color: #1e88e5;
12
+ }
13
+
14
+ .audio--secondary {
15
+ background-color: #fff;
16
+ border-color: #ccc;
17
+ }
18
+
19
+ .audio--small {
20
+ padding: 8px;
21
+ }
22
+
23
+ .audio--medium {
24
+ padding: 16px;
25
+ }
26
+
27
+ .audio--large {
28
+ padding: 32px;
29
+ }
@@ -0,0 +1,41 @@
1
+
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import './Audio.css';
5
+
6
+ /**
7
+ * Audio component for user interaction
8
+ */
9
+ export const Audio = ({ primary, size, children, ...props }) => {
10
+ const mode = primary ? 'audio--primary' : 'audio--secondary';
11
+ return (
12
+ <div
13
+ className={['audio', `audio--${size}`, mode].join(' ')}
14
+ {...props}
15
+ >
16
+ {children}
17
+ </div>
18
+ );
19
+ };
20
+
21
+ Audio.propTypes = {
22
+ /**
23
+ * Is this the primary style for the component?
24
+ */
25
+ primary: PropTypes.bool,
26
+ /**
27
+ * Size of the component
28
+ */
29
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
30
+ /**
31
+ * Content to be rendered inside the component
32
+ */
33
+ children: PropTypes.node.isRequired,
34
+ };
35
+
36
+ Audio.defaultProps = {
37
+ primary: false,
38
+ size: 'medium',
39
+ };
40
+
41
+ export default Audio;
@@ -0,0 +1,41 @@
1
+
2
+ import { Audio } from './Audio';
3
+
4
+ // Storybook configuration for Audio component
5
+ export default {
6
+ title: 'Atoms/Media/Audio',
7
+ component: Audio,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ argTypes: {
12
+ children: { control: 'text' },
13
+ },
14
+ };
15
+
16
+ export const Primary = {
17
+ args: {
18
+ primary: true,
19
+ children: 'This is a primary Audio',
20
+ },
21
+ };
22
+
23
+ export const Secondary = {
24
+ args: {
25
+ children: 'This is a secondary Audio',
26
+ },
27
+ };
28
+
29
+ export const Large = {
30
+ args: {
31
+ size: 'large',
32
+ children: 'This is a large Audio',
33
+ },
34
+ };
35
+
36
+ export const Small = {
37
+ args: {
38
+ size: 'small',
39
+ children: 'This is a small Audio',
40
+ },
41
+ };
@@ -0,0 +1,29 @@
1
+
2
+ .badge {
3
+ padding: 16px;
4
+ border-radius: 8px;
5
+ background-color: #f0f0f0;
6
+ border: 1px solid #ddd;
7
+ }
8
+
9
+ .badge--primary {
10
+ background-color: #e3f2fd;
11
+ border-color: #1e88e5;
12
+ }
13
+
14
+ .badge--secondary {
15
+ background-color: #fff;
16
+ border-color: #ccc;
17
+ }
18
+
19
+ .badge--small {
20
+ padding: 8px;
21
+ }
22
+
23
+ .badge--medium {
24
+ padding: 16px;
25
+ }
26
+
27
+ .badge--large {
28
+ padding: 32px;
29
+ }
@@ -0,0 +1,41 @@
1
+
2
+ import React from 'react';
3
+ import PropTypes from 'prop-types';
4
+ import './Badge.css';
5
+
6
+ /**
7
+ * Badge component for user interaction
8
+ */
9
+ export const Badge = ({ primary, size, children, ...props }) => {
10
+ const mode = primary ? 'badge--primary' : 'badge--secondary';
11
+ return (
12
+ <div
13
+ className={['badge', `badge--${size}`, mode].join(' ')}
14
+ {...props}
15
+ >
16
+ {children}
17
+ </div>
18
+ );
19
+ };
20
+
21
+ Badge.propTypes = {
22
+ /**
23
+ * Is this the primary style for the component?
24
+ */
25
+ primary: PropTypes.bool,
26
+ /**
27
+ * Size of the component
28
+ */
29
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
30
+ /**
31
+ * Content to be rendered inside the component
32
+ */
33
+ children: PropTypes.node.isRequired,
34
+ };
35
+
36
+ Badge.defaultProps = {
37
+ primary: false,
38
+ size: 'medium',
39
+ };
40
+
41
+ export default Badge;
@@ -0,0 +1,41 @@
1
+
2
+ import { Badge } from './Badge';
3
+
4
+ // Storybook configuration for Badge component
5
+ export default {
6
+ title: 'Atoms/Visual/Badge',
7
+ component: Badge,
8
+ parameters: {
9
+ layout: 'centered',
10
+ },
11
+ argTypes: {
12
+ children: { control: 'text' },
13
+ },
14
+ };
15
+
16
+ export const Primary = {
17
+ args: {
18
+ primary: true,
19
+ children: 'This is a primary Badge',
20
+ },
21
+ };
22
+
23
+ export const Secondary = {
24
+ args: {
25
+ children: 'This is a secondary Badge',
26
+ },
27
+ };
28
+
29
+ export const Large = {
30
+ args: {
31
+ size: 'large',
32
+ children: 'This is a large Badge',
33
+ },
34
+ };
35
+
36
+ export const Small = {
37
+ args: {
38
+ size: 'small',
39
+ children: 'This is a small Badge',
40
+ },
41
+ };