this.gui 1.0.16 → 1.0.17
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.
- package/README.md +191 -23
- package/dist/style.css +1 -1
- package/dist/this-gui.es.js +2777 -1923
- package/dist/this-gui.umd.js +23 -23
- package/package.json +2 -4
- package/src/App.jsx +4 -1
- package/src/Page.jsx +28 -0
- package/src/example.json +43 -0
- package/src/scripts/ComponentRegistry.js +70 -0
- package/src/scripts/postinstall.js +40 -1
- package/src/scripts/renderComponents.js +11 -0
- package/src/stories/Atoms/Badge/Badge.css +1 -0
- package/src/stories/Atoms/Badge/Badge.stories.jsx +1 -0
- package/src/stories/Atoms/Grid/Grid.css +160 -0
- package/src/stories/Atoms/Grid/Grid.jsx +43 -0
- package/src/stories/Atoms/Grid/Grid.stories.jsx +84 -0
- package/src/stories/Atoms/ProgressBar/ProgressBar.css +1 -1
- package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +1 -1
- package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +1 -1
- package/src/stories/Atoms/Section/Section.css +268 -0
- package/src/stories/Atoms/Section/Section.jsx +63 -0
- package/src/stories/Atoms/Section/Section.stories.jsx +46 -0
- package/src/stories/Atoms/TextArea/TextArea.css +1 -0
- package/src/stories/Atoms/TextArea/TextArea.jsx +1 -0
- package/src/stories/Atoms/TextArea/TextArea.stories.jsx +1 -0
- package/src/stories/Atoms/TextInput/TextInput.css +1 -0
- package/src/stories/Atoms/TextInput/TextInput.jsx +1 -0
- package/src/stories/Atoms/TextInput/TextInput.stories.jsx +1 -0
- package/src/stories/Atoms/Toggle/Toggle.css +1 -0
- package/src/stories/Atoms/Toggle/Toggle.jsx +1 -0
- package/src/stories/Atoms/Toggle/Toggle.stories.jsx +1 -0
- package/src/stories/Atoms/Tooltip/Tooltip.css +1 -0
- package/src/stories/Atoms/Tooltip/Tooltip.jsx +1 -0
- package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +1 -0
- package/src/stories/Atoms/Video/Video.css +1 -0
- package/src/stories/Atoms/Video/Video.jsx +1 -0
- package/src/stories/Atoms/Video/Video.stories.jsx +1 -0
- package/src/stories/Atoms/index.js +4 -0
- package/src/stories/Atoms/meta_Atoms.js +4 -1
- package/src/stories/Layouts/Accordion/Accordion.css +285 -8
- package/src/stories/Layouts/Accordion/Accordion.jsx +62 -19
- package/src/stories/Layouts/Accordion/Accordion.stories.jsx +30 -19
- package/src/stories/Layouts/index.js +0 -6
- package/src/stories/Layouts/meta_Layouts.js +2 -5
- package/src/stories/Molecules/Accordion/Accordion.css +1 -1
- package/src/stories/Molecules/Accordion/Accordion.jsx +1 -1
- package/src/stories/Molecules/Accordion/Accordion.stories.jsx +1 -1
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.css +95 -2
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.jsx +232 -13
- package/src/stories/Molecules/AudioPlayer/AudioPlayer.stories.jsx +46 -11
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.css +128 -2
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.jsx +69 -14
- package/src/stories/Molecules/AvatarWithName/AvatarWithName.stories.jsx +12 -12
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.css +145 -2
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.jsx +39 -13
- package/src/stories/Molecules/Breadcrumbs/Breadcrumbs.stories.jsx +27 -11
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.css +463 -2
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.jsx +34 -12
- package/src/stories/Molecules/ButtonGroup/ButtonGroup.stories.jsx +36 -12
- package/src/stories/Molecules/Card/Card.css +39 -2
- package/src/stories/Molecules/Card/Card.jsx +80 -13
- package/src/stories/Molecules/Card/Card.stories.jsx +27 -13
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.css +33 -2
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.jsx +91 -12
- package/src/stories/Molecules/ComparisonTable/ComparisonTable.stories.jsx +73 -12
- package/src/stories/Molecules/Dropdown/Dropdown.css +192 -0
- package/src/stories/Molecules/Dropdown/Dropdown.jsx +96 -0
- package/src/stories/Molecules/Dropdown/Dropdown.stories.jsx +45 -0
- package/src/stories/Molecules/index.js +2 -1
- package/src/stories/Molecules/meta_Molecules.js +6 -3
- package/dist/Styles.md +0 -446
- package/dist/context.md +0 -942
- package/src/Theme.jsx +0 -28
- package/src/components/CodeBlock.jsx +0 -22
- package/src/components/ComponentFactory.jsx +0 -36
- package/src/components/ComponentRegistry.js +0 -21
- package/src/scripts/generateComponents.js +0 -166
- package/src/scripts/verifyLayouts.js +0 -175
- package/src/scripts/verifyMolecules.js +0 -158
- package/src/scripts/verifyTemplates.js +0 -154
- package/src/scripts/verify_and_install_atoms.js +0 -211
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.css +0 -16
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.jsx +0 -31
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.stories.jsx +0 -28
- package/src/stories/Layouts/Grid/Grid.css +0 -4
- package/src/stories/Layouts/Grid/Grid.jsx +0 -13
- package/src/stories/Layouts/Grid/Grid.stories.jsx +0 -28
- package/src/stories/Layouts/Section/Section.css +0 -16
- package/src/stories/Layouts/Section/Section.jsx +0 -31
- package/src/stories/Layouts/Section/Section.stories.jsx +0 -28
- /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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
15
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|