this.gui 1.0.16 → 1.0.18

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 (104) hide show
  1. package/README.md +191 -23
  2. package/dist/style.css +1 -1
  3. package/dist/this-gui.es.js +2879 -1945
  4. package/dist/this-gui.umd.js +24 -24
  5. package/package.json +3 -4
  6. package/src/App.jsx +19 -40
  7. package/src/CreatePage.jsx +61 -0
  8. package/src/MDXEditor.jsx +51 -0
  9. package/src/Page.jsx +28 -0
  10. package/src/PageDashboard.jsx +56 -0
  11. package/src/SiteBuilder.jsx +95 -26
  12. package/src/example.json +43 -0
  13. package/src/scripts/ComponentRegistry.js +70 -0
  14. package/src/scripts/postinstall.js +60 -10
  15. package/src/scripts/renderComponents.js +11 -0
  16. package/src/stories/Atoms/Badge/Badge.css +1 -0
  17. package/src/stories/Atoms/Badge/Badge.stories.jsx +1 -0
  18. package/src/stories/Atoms/Button/Button.css +259 -58
  19. package/src/stories/Atoms/Button/Button.jsx +8 -11
  20. package/src/stories/Atoms/Button/Button.stories.jsx +65 -40
  21. package/src/stories/Atoms/Container/Container.css +420 -39
  22. package/src/stories/Atoms/Container/Container.jsx +98 -36
  23. package/src/stories/Atoms/Container/Container.stories.jsx +120 -79
  24. package/src/stories/Atoms/Grid/Grid.css +160 -0
  25. package/src/stories/Atoms/Grid/Grid.jsx +43 -0
  26. package/src/stories/Atoms/Grid/Grid.stories.jsx +84 -0
  27. package/src/stories/Atoms/Link/Link.css +6 -26
  28. package/src/stories/Atoms/Link/Link.jsx +11 -21
  29. package/src/stories/Atoms/ProgressBar/ProgressBar.css +1 -1
  30. package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +1 -1
  31. package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +1 -1
  32. package/src/stories/Atoms/Section/Section.css +268 -0
  33. package/src/stories/Atoms/Section/Section.jsx +63 -0
  34. package/src/stories/Atoms/Section/Section.stories.jsx +46 -0
  35. package/src/stories/Atoms/TextArea/TextArea.css +1 -0
  36. package/src/stories/Atoms/TextArea/TextArea.jsx +1 -0
  37. package/src/stories/Atoms/TextArea/TextArea.stories.jsx +1 -0
  38. package/src/stories/Atoms/TextInput/TextInput.css +1 -0
  39. package/src/stories/Atoms/TextInput/TextInput.jsx +1 -0
  40. package/src/stories/Atoms/TextInput/TextInput.stories.jsx +1 -0
  41. package/src/stories/Atoms/Toggle/Toggle.css +1 -0
  42. package/src/stories/Atoms/Toggle/Toggle.jsx +1 -0
  43. package/src/stories/Atoms/Toggle/Toggle.stories.jsx +1 -0
  44. package/src/stories/Atoms/Tooltip/Tooltip.css +1 -0
  45. package/src/stories/Atoms/Tooltip/Tooltip.jsx +1 -0
  46. package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +1 -0
  47. package/src/stories/Atoms/Video/Video.css +1 -0
  48. package/src/stories/Atoms/Video/Video.jsx +1 -0
  49. package/src/stories/Atoms/Video/Video.stories.jsx +1 -0
  50. package/src/stories/Atoms/index.js +4 -0
  51. package/src/stories/Atoms/meta_Atoms.js +4 -1
  52. package/src/stories/Layouts/Accordion/Accordion.css +285 -8
  53. package/src/stories/Layouts/Accordion/Accordion.jsx +62 -19
  54. package/src/stories/Layouts/Accordion/Accordion.stories.jsx +30 -19
  55. package/src/stories/Layouts/index.js +0 -6
  56. package/src/stories/Layouts/meta_Layouts.js +2 -5
  57. package/src/stories/Molecules/Accordion/Accordion.css +1 -1
  58. package/src/stories/Molecules/Accordion/Accordion.jsx +1 -1
  59. package/src/stories/Molecules/Accordion/Accordion.stories.jsx +1 -1
  60. package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +95 -2
  61. package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +232 -13
  62. package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +46 -11
  63. package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +128 -2
  64. package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +69 -14
  65. package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +12 -12
  66. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +145 -2
  67. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +39 -13
  68. package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +27 -11
  69. package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +463 -2
  70. package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +34 -12
  71. package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +36 -12
  72. package/src/stories/Molecules/Card/Card.css +39 -2
  73. package/src/stories/Molecules/Card/Card.jsx +80 -13
  74. package/src/stories/Molecules/Card/Card.stories.jsx +27 -13
  75. package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +33 -2
  76. package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +91 -12
  77. package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +73 -12
  78. package/src/stories/Molecules/Dropdown/Dropdown.css +192 -0
  79. package/src/stories/Molecules/Dropdown/Dropdown.jsx +96 -0
  80. package/src/stories/Molecules/Dropdown/Dropdown.stories.jsx +45 -0
  81. package/src/stories/Molecules/index.js +2 -1
  82. package/src/stories/Molecules/meta_Molecules.js +6 -3
  83. package/src/themes/styles/neurons/light.css +94 -204
  84. package/dist/Styles.md +0 -446
  85. package/dist/context.md +0 -942
  86. package/src/Theme.jsx +0 -28
  87. package/src/components/CodeBlock.jsx +0 -22
  88. package/src/components/ComponentFactory.jsx +0 -36
  89. package/src/components/ComponentRegistry.js +0 -21
  90. package/src/scripts/generateComponents.js +0 -166
  91. package/src/scripts/verifyLayouts.js +0 -175
  92. package/src/scripts/verifyMolecules.js +0 -158
  93. package/src/scripts/verifyTemplates.js +0 -154
  94. package/src/scripts/verify_and_install_atoms.js +0 -211
  95. package/src/stories/Layouts/DropdownMenu/DropdownMenu.css +0 -16
  96. package/src/stories/Layouts/DropdownMenu/DropdownMenu.jsx +0 -31
  97. package/src/stories/Layouts/DropdownMenu/DropdownMenu.stories.jsx +0 -28
  98. package/src/stories/Layouts/Grid/Grid.css +0 -4
  99. package/src/stories/Layouts/Grid/Grid.jsx +0 -13
  100. package/src/stories/Layouts/Grid/Grid.stories.jsx +0 -28
  101. package/src/stories/Layouts/Section/Section.css +0 -16
  102. package/src/stories/Layouts/Section/Section.jsx +0 -31
  103. package/src/stories/Layouts/Section/Section.stories.jsx +0 -28
  104. /package/src/themes/{README.md → README_Styles.md} +0 -0
package/README.md CHANGED
@@ -1,37 +1,205 @@
1
1
  <img src="https://suign.github.io/assets/imgs/this_GUI.svg" alt="Cleaker Me" width="377" height="377">
2
2
 
3
- # THIS.GUI
4
- The goal is to automate the **GUI** generation process so users only pass data or configurations, and **this.GUI** handles the rest.
5
- The package exports:
6
- • Pre-defined components.
7
- MDX and Theme Providers.
8
- • An MDX editor interface.
9
-
10
- Install `this.gui` via **npm**:
11
- ```shell
3
+
4
+
5
+ # **THIS.GUI**
6
+
7
+ **this.GUI** aims to automate the **GUI** generation process by allowing users to pass data or configurations. It then dynamically builds the UI based on these inputs. This package exports pre-defined components, theme providers, MDX integration, and a Site/App builder for rapid prototyping and deployment.
8
+
9
+ #### **Installation & Setup**
10
+
11
+ Install this.gui via **npm**:
12
+
13
+ ```bash
12
14
  npm install this.gui
13
15
  ```
14
- Then run command:
15
- ```bash
16
+
17
+ After installation, you can start the development server using:
18
+
19
+ ```bas
16
20
  npm start
21
+ ```
22
+
23
+ This command will initialize the app, allowing you to use the **Site Builder** and **Component Library**.
24
+
25
+ #### **Key Features**
26
+
27
+ **1. Pre-built Components**
28
+
29
+ ​ • **Atoms**: Smallest building blocks like buttons, inputs, text elements, etc.
30
+
31
+ ​ • **Molecules**: Combinations of atoms to form reusable UI elements like cards, forms, tables, etc.
32
+
33
+ ​ • **Organisms**: More complex components that combine multiple molecules.
34
+
35
+ ​ • **Layouts & Templates**: Predefined page structures that can be customized using the JSON configuration.
36
+
37
+ #### **2. MDX & Theme Providers**
17
38
 
39
+ ​ • MDX integration for dynamic content rendering.
40
+
41
+ ​ • Easy-to-use theme providers for switching between light and dark modes.
42
+
43
+ #### **3. Site & App Builder**
44
+
45
+ ​ • Drag-and-drop interface for building entire pages or applications.
46
+
47
+ ​ • Generates JSON configuration that maps to your UI structure.
48
+
49
+ ​ • The JSON-based UI renderer automatically handles rendering of components based on the passed configuration.
50
+
51
+ **Getting Started**
52
+
53
+ Here’s a quick overview of how to use **this.GUI** in your project.
54
+
55
+ **1. Direct JSX Usage**
56
+
57
+ The **index.js** file allows you to import and use pre-built components directly in your JSX/JS files.
58
+
59
+ ```jsx
60
+ import { Button, TextInput } from 'this.gui/Atoms';
61
+
62
+ function MyComponent() {
63
+ return (
64
+ <div>
65
+ <Button label="Click Me" color="primary" />
66
+ <TextInput placeholder="Enter text" />
67
+ </div>
68
+ );
69
+ }
18
70
  ```
19
- a. Export Pre-built Components
20
- Components are categorized (Atoms, Molecules, etc.) and are exportable so users can easily import them into their MDX files or directly in their React components.
21
71
 
22
- ## **Explanation of Grouping:**
23
- ​ • **Atomic**: Smallest components that are not broken down further.
24
- Alert, Audio, Badge, Button, Caption, Checkbox, Container, Divider, Heading, Icon, Image, Label, Link , Loader, Paragraph, ProgressBar, RadioButton, RangeInput, Select, Slider, Snackbar, Spacer, Spinner, Tag, TextArea, TextInput, Toggle, Tooltip, Video.
72
+ **2. Dynamic UI via JSON**
73
+
74
+ Use the **ComponentRegistry** and **renderComponent** function to build dynamic UIs from JSON configurations.
75
+
76
+ Example JSON:
77
+
78
+ ```json
79
+ {
80
+ "layout": [
81
+ {
82
+ "type": "Button",
83
+ "props": { "label": "Click Me", "color": "primary" }
84
+ },
85
+ {
86
+ "type": "Heading",
87
+ "props": { "text": "Welcome to Our Site", "level": 1 }
88
+ }
89
+ ]
90
+ }
91
+ ```
92
+
93
+ Rendering the above JSON with **this.GUI**:
94
+
95
+ ```jsx
96
+ import React from 'react';
97
+ import { Page } from 'this.gui/Page';
98
+
99
+ const config = {
100
+ layout: [
101
+ { type: 'Button', props: { label: 'Click Me', color: 'primary' } },
102
+ { type: 'Heading', props: { text: 'Welcome to Our Site', level: 1 } }
103
+ ]
104
+ };
105
+
106
+ function App() {
107
+ return <Page config={config} />;
108
+ }
109
+ ```
110
+
111
+ **3. Component Registry & JSON Mapping**
112
+
113
+ **ComponentRegistry** maps JSON keys to the corresponding React components. This allows dynamic rendering of components via JSON without directly importing each component.
114
+
115
+ ```jsx
116
+ const ComponentRegistry = {
117
+ Button: Atoms.Button,
118
+ Heading: Atoms.Heading,
119
+ Paragraph: Atoms.Paragraph,
120
+ *// More mappings...*
121
+ };
122
+ ```
123
+
124
+ **Component Categories**
125
+
126
+ ​ • **Atoms**: Small, reusable components like Buttons, Inputs, Paragraphs.
127
+
128
+ ​ • Examples: Button, TextInput, Paragraph, Image, Icon, etc.
129
+
130
+ ​ • **Molecules**: Components that combine multiple atoms.
131
+
132
+ ​ • Examples: Card, Navbar, Breadcrumbs, FormField, AudioPlayer, etc.
133
+
134
+ ​ • **Organisms**: More complex components combining multiple molecules.
135
+
136
+ ​ • Examples: LoginForm, SidebarLayout, etc.
137
+
138
+ ​ • **Layouts & Templates**: Complete page structures.
139
+
140
+ ​ • Examples: TwoColumnLayout, LandingPageTemplate, etc.
141
+
142
+
143
+
144
+ **Key Components**
145
+
146
+ 1. **Component Registry**
147
+
148
+ • Maps JSON keys to components for dynamic rendering.
149
+
150
+ 2. **JSON Configuration Files**
151
+
152
+ • Define the layout and structure of your UI in JSON.
153
+
154
+ 3. **Rendering Engine**
155
+
156
+ • Reads the JSON configuration and renders the appropriate components dynamically.
157
+
158
+
159
+
160
+ **Example Usage**
161
+
162
+ Here’s an example that showcases how to use the JSON configuration for rendering a dynamic UI.
163
+
164
+ ```json
165
+ {
166
+ "layout": [
167
+ {
168
+ "type": "Card",
169
+ "props": { "variant": "solid", "color": "primary-color", "width": "300px" },
170
+ "children": [
171
+ {
172
+ "type": "Paragraph",
173
+ "props": { "text": "Welcome to our site!" }
174
+ }
175
+ ]
176
+ }
177
+ ]
178
+ }
179
+ ```
180
+
181
+
182
+
183
+ You can pass this JSON configuration to the Page component to render the UI dynamically:
184
+
185
+ ```jsx
186
+ import { Page } from 'this.gui/Page';
187
+ import config from './config.json'; *// Import the JSON configuration*
188
+
189
+ function App() {
190
+ return <Page config={config} />;
191
+ }
192
+ ```
193
+
194
+ **Additional Resources**
195
+
196
+ ​ • **Storybook**: For browsing and testing all pre-built components. Launch Storybook with:
25
197
 
26
- ​ • **Molecules**: Simple combinations of atomic components that together form a small UI feature.
27
- Accordion, AudioPlayer, AvatarWithName, Breadcrumbs, ButtonGroup, Card, ComparisonTable, DataTable, FileUpload, FormField, Header, IconButton, ImageWithCaption, InputGroup, InputWithLabel, List, MediaCard, Modal, Navbar, Notification, PricingTable, SearchBar, Sidebar, VideoWithDescription.
198
+ npm run storybook
28
199
 
29
- • **Organisms**: More complex, combining molecules and atomic components to create larger, more detailed features.
30
- ​ • **Layout**: Components related to structuring and organizing content across the page.
31
- ​ • **Templates**: Layouts of full pages, combining organisms and layout components.
32
- ​ • **Pages**: Complete and functional pages made up of templates and content.
33
- ​ • **Miscellaneous**: Utility components that don’t fit into the above categories but provide important functions, such as popovers, overlays, and media controls.
200
+ •**MDX Editor**: Edit and visualize MDX content in real time.
34
201
 
202
+ **this.GUI** is part of the **Neurons.me** ecosystem, a set of modular data structures designed to work together across multiple domains.
35
203
 
36
204
  # About All.This
37
205
  ###### Modular Data Structures