this.gui 1.0.15 → 1.0.16
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 +0 -39
- package/dist/style.css +1 -1
- package/dist/this-gui.es.js +3751 -1882
- package/dist/this-gui.umd.js +34 -22
- package/package.json +14 -12
- package/src/App.jsx +50 -21
- package/src/SiteBuilder.jsx +39 -0
- package/src/index.mdx +10 -0
- package/src/main.jsx +11 -14
- package/src/scripts/verifyLayouts.js +175 -0
- package/src/scripts/verifyTemplates.js +154 -0
- package/src/stories/Atoms/Alert/Alert.css +196 -14
- package/src/stories/Atoms/Alert/Alert.jsx +43 -28
- package/src/stories/Atoms/Alert/Alert.stories.jsx +154 -28
- package/src/stories/Atoms/Audio/Audio.css +246 -16
- package/src/stories/Atoms/Audio/Audio.jsx +204 -29
- package/src/stories/Atoms/Audio/Audio.stories.jsx +178 -28
- package/src/stories/Atoms/Badge/Badge.css +234 -15
- package/src/stories/Atoms/Badge/Badge.jsx +44 -31
- package/src/stories/Atoms/Badge/Badge.stories.jsx +108 -29
- package/src/stories/Atoms/Button/Button.css +106 -45
- package/src/stories/Atoms/Button/Button.jsx +31 -82
- package/src/stories/Atoms/Button/Button.stories.jsx +170 -40
- package/src/stories/Atoms/Caption/Caption.css +156 -16
- package/src/stories/Atoms/Caption/Caption.jsx +62 -31
- package/src/stories/Atoms/Caption/Caption.stories.jsx +194 -28
- package/src/stories/Atoms/Checkbox/Checkbox.css +168 -15
- package/src/stories/Atoms/Checkbox/Checkbox.jsx +73 -31
- package/src/stories/Atoms/Checkbox/Checkbox.stories.jsx +98 -27
- package/src/stories/Atoms/Container/Container.css +75 -15
- package/src/stories/Atoms/Container/Container.jsx +41 -28
- package/src/stories/Atoms/Container/Container.stories.jsx +92 -29
- package/src/stories/Atoms/Divider/Divider.css +131 -13
- package/src/stories/Atoms/Divider/Divider.jsx +54 -33
- package/src/stories/Atoms/Divider/Divider.stories.jsx +93 -29
- package/src/stories/Atoms/Heading/Heading.css +99 -16
- package/src/stories/Atoms/Heading/Heading.jsx +57 -29
- package/src/stories/Atoms/Heading/Heading.stories.jsx +117 -28
- package/src/stories/Atoms/Icon/Icon.css +219 -27
- package/src/stories/Atoms/Icon/Icon.jsx +67 -38
- package/src/stories/Atoms/Icon/Icon.stories.jsx +156 -51
- package/src/stories/Atoms/Image/Image.css +231 -15
- package/src/stories/Atoms/Image/Image.jsx +166 -32
- package/src/stories/Atoms/Image/Image.stories.jsx +319 -28
- package/src/stories/Atoms/Label/Label.css +158 -16
- package/src/stories/Atoms/Label/Label.jsx +61 -31
- package/src/stories/Atoms/Label/Label.stories.jsx +167 -28
- package/src/stories/Atoms/Link/Link.css +58 -16
- package/src/stories/Atoms/Link/Link.jsx +73 -32
- package/src/stories/Atoms/Link/Link.stories.jsx +141 -29
- package/src/stories/Atoms/Loader/Loader.css +93 -16
- package/src/stories/Atoms/Loader/Loader.jsx +47 -30
- package/src/stories/Atoms/Loader/Loader.stories.jsx +86 -28
- package/src/stories/Atoms/Logo/Logo.css +94 -0
- package/src/stories/Atoms/Logo/Logo.jsx +53 -0
- package/src/stories/Atoms/Logo/Logo.stories.jsx +120 -0
- package/src/stories/Atoms/Paragraph/Paragraph.css +167 -16
- package/src/stories/Atoms/Paragraph/Paragraph.jsx +67 -31
- package/src/stories/Atoms/Paragraph/Paragraph.stories.jsx +130 -28
- package/src/stories/Atoms/ProgressBar/ProgressBar.css +115 -17
- package/src/stories/Atoms/ProgressBar/ProgressBar.jsx +30 -31
- package/src/stories/Atoms/ProgressBar/ProgressBar.stories.jsx +72 -27
- package/src/stories/Atoms/RadioButton/RadioButton.css +118 -17
- package/src/stories/Atoms/RadioButton/RadioButton.jsx +77 -31
- package/src/stories/Atoms/RadioButton/RadioButton.stories.jsx +99 -27
- package/src/stories/Atoms/Range/Range.css +169 -0
- package/src/stories/Atoms/Range/Range.jsx +87 -0
- package/src/stories/Atoms/Range/Range.stories.jsx +110 -0
- package/src/stories/Atoms/Select/Select.css +74 -16
- package/src/stories/Atoms/Select/Select.jsx +62 -30
- package/src/stories/Atoms/Select/Select.stories.jsx +95 -27
- package/src/stories/Atoms/Slider/Slider.css +77 -16
- package/src/stories/Atoms/Slider/Slider.jsx +119 -31
- package/src/stories/Atoms/Slider/Slider.stories.jsx +77 -28
- package/src/stories/Atoms/Snackbar/Snackbar.css +297 -13
- package/src/stories/Atoms/Snackbar/Snackbar.jsx +62 -31
- package/src/stories/Atoms/Snackbar/Snackbar.stories.jsx +63 -26
- package/src/stories/Atoms/Spacer/Spacer.css +101 -16
- package/src/stories/Atoms/Spacer/Spacer.jsx +26 -32
- package/src/stories/Atoms/Spacer/Spacer.stories.jsx +50 -30
- package/src/stories/Atoms/Spinner/Spinner.css +97 -16
- package/src/stories/Atoms/Spinner/Spinner.jsx +50 -26
- package/src/stories/Atoms/Spinner/Spinner.stories.jsx +47 -30
- package/src/stories/Atoms/Tag/Tag.css +97 -14
- package/src/stories/Atoms/Tag/Tag.jsx +58 -24
- package/src/stories/Atoms/Tag/Tag.stories.jsx +55 -29
- package/src/stories/Atoms/TextArea/TextArea.css +84 -15
- package/src/stories/Atoms/TextArea/TextArea.jsx +107 -31
- package/src/stories/Atoms/TextArea/TextArea.stories.jsx +24 -30
- package/src/stories/Atoms/TextInput/TextInput.css +89 -17
- package/src/stories/Atoms/TextInput/TextInput.jsx +118 -27
- package/src/stories/Atoms/TextInput/TextInput.stories.jsx +52 -25
- package/src/stories/Atoms/Toggle/Toggle.css +105 -17
- package/src/stories/Atoms/Toggle/Toggle.jsx +55 -28
- package/src/stories/Atoms/Toggle/Toggle.stories.jsx +23 -30
- package/src/stories/Atoms/Tooltip/Tooltip.css +367 -14
- package/src/stories/Atoms/Tooltip/Tooltip.jsx +32 -28
- package/src/stories/Atoms/Tooltip/Tooltip.stories.jsx +41 -31
- package/src/stories/Atoms/Video/Video.css +27 -18
- package/src/stories/Atoms/Video/Video.jsx +65 -29
- package/src/stories/Atoms/Video/Video.stories.jsx +29 -30
- package/src/stories/Atoms/index.js +5 -2
- package/src/stories/Atoms/meta_Atoms.js +3 -1
- package/src/stories/Layouts/Accordion/Accordion.css +16 -0
- package/src/stories/Layouts/Accordion/Accordion.jsx +31 -0
- package/src/stories/Layouts/Accordion/Accordion.stories.jsx +28 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.css +16 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.jsx +31 -0
- package/src/stories/Layouts/DropdownMenu/DropdownMenu.stories.jsx +28 -0
- package/src/stories/Layouts/Flexbox/Flexbox.css +16 -0
- package/src/stories/Layouts/Flexbox/Flexbox.jsx +11 -0
- package/src/stories/Layouts/Flexbox/Flexbox.stories.jsx +28 -0
- package/src/stories/Layouts/Footer/Footer.css +16 -0
- package/src/stories/Layouts/Footer/Footer.jsx +31 -0
- package/src/stories/Layouts/Footer/Footer.stories.jsx +28 -0
- package/src/stories/Layouts/Grid/Grid.jsx +2 -4
- package/src/stories/Layouts/Grid/Grid.stories.jsx +20 -18
- package/src/stories/Layouts/Header/Header.css +16 -0
- package/src/stories/Layouts/Header/Header.jsx +31 -0
- package/src/stories/Layouts/Header/Header.stories.jsx +28 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.css +16 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.jsx +31 -0
- package/src/stories/Layouts/HeroBanner/HeroBanner.stories.jsx +28 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.css +16 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.jsx +31 -0
- package/src/stories/Layouts/HeroImageVideo/HeroImageVideo.stories.jsx +28 -0
- package/src/stories/Layouts/Pagination/Pagination.css +16 -0
- package/src/stories/Layouts/Pagination/Pagination.jsx +31 -0
- package/src/stories/Layouts/Pagination/Pagination.stories.jsx +28 -0
- package/src/stories/Layouts/Section/Section.css +16 -0
- package/src/stories/Layouts/Section/Section.jsx +31 -0
- package/src/stories/Layouts/Section/Section.stories.jsx +28 -0
- package/src/stories/Layouts/Sidebar/Sidebar.css +16 -0
- package/src/stories/Layouts/Sidebar/Sidebar.jsx +71 -0
- package/src/stories/Layouts/Sidebar/Sidebar.stories.jsx +28 -0
- package/src/stories/Layouts/Tabs/Tabs.css +16 -0
- package/src/stories/Layouts/Tabs/Tabs.jsx +31 -0
- package/src/stories/Layouts/Tabs/Tabs.stories.jsx +28 -0
- package/src/stories/Layouts/index.js +31 -0
- package/src/stories/Layouts/meta_Layouts.js +31 -0
- package/src/stories/Molecules/Navbar/Navbar.css +63 -59
- package/src/stories/Molecules/Navbar/Navbar.jsx +43 -48
- package/src/stories/Molecules/Navbar/Navbar.stories.jsx +58 -8
- package/src/stories/Molecules/SearchBar/SearchBar.css +66 -1
- package/src/stories/Molecules/SearchBar/SearchBar.jsx +59 -11
- package/src/stories/Molecules/SearchBar/SearchBar.stories.jsx +16 -7
- package/src/stories/Molecules/SelectTheme/SelectTheme.jsx +16 -38
- package/src/stories/Molecules/SelectTheme/SelectTheme.stories.jsx +1 -2
- package/src/stories/Molecules/Sidebar/Sidebar.css +65 -2
- package/src/stories/Molecules/Sidebar/Sidebar.jsx +66 -11
- package/src/stories/Molecules/Sidebar/Sidebar.stories.jsx +20 -5
- package/src/stories/Templates/AdminDashboard/AdminDashboard.css +7 -0
- package/src/stories/Templates/AdminDashboard/AdminDashboard.jsx +24 -0
- package/src/stories/Templates/AdminDashboard/AdminDashboard.stories.jsx +20 -0
- package/src/stories/Templates/CallToAction/CallToAction.css +7 -0
- package/src/stories/Templates/CallToAction/CallToAction.jsx +24 -0
- package/src/stories/Templates/CallToAction/CallToAction.stories.jsx +20 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.css +7 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.jsx +24 -0
- package/src/stories/Templates/FeaturesList/FeaturesList.stories.jsx +20 -0
- package/src/stories/Templates/FormSection/FormSection.css +7 -0
- package/src/stories/Templates/FormSection/FormSection.jsx +24 -0
- package/src/stories/Templates/FormSection/FormSection.stories.jsx +20 -0
- package/src/stories/Templates/HeroSection/HeroSection.css +7 -0
- package/src/stories/Templates/HeroSection/HeroSection.jsx +24 -0
- package/src/stories/Templates/HeroSection/HeroSection.stories.jsx +20 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.css +7 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.jsx +24 -0
- package/src/stories/Templates/LocationInfo/LocationInfo.stories.jsx +20 -0
- package/src/stories/Templates/ProductPage/ProductPage.css +7 -0
- package/src/stories/Templates/ProductPage/ProductPage.jsx +24 -0
- package/src/stories/Templates/ProductPage/ProductPage.stories.jsx +20 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.css +7 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.jsx +24 -0
- package/src/stories/Templates/RegistrationPage/RegistrationPage.stories.jsx +20 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.css +7 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.jsx +24 -0
- package/src/stories/Templates/ShoppingCart/ShoppingCart.stories.jsx +20 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.css +7 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.jsx +24 -0
- package/src/stories/Templates/SidebarTopNav/SidebarTopNav.stories.jsx +20 -0
- package/src/stories/Templates/SignInPage/SignInPage.css +7 -0
- package/src/stories/Templates/SignInPage/SignInPage.jsx +24 -0
- package/src/stories/Templates/SignInPage/SignInPage.stories.jsx +20 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.css +7 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.jsx +24 -0
- package/src/stories/Templates/SocialMediaLinks/SocialMediaLinks.stories.jsx +20 -0
- package/src/stories/Templates/Testimonials/Testimonials.css +7 -0
- package/src/stories/Templates/Testimonials/Testimonials.jsx +24 -0
- package/src/stories/Templates/Testimonials/Testimonials.stories.jsx +20 -0
- package/src/stories/Templates/index.js +33 -0
- package/src/stories/Templates/{Templates.js → meta_Templates.js} +3 -1
- package/src/stories/assets/logo.png +0 -0
- package/src/stories/assets/logo.svg +106 -0
- package/src/stories/assets/test.svg +3 -0
- package/src/themes/README.md +301 -0
- package/src/themes/ThemeProvider.jsx +47 -22
- package/src/themes/styles/dracula/dark.css +0 -0
- package/src/themes/styles/dracula/light.css +0 -0
- package/src/themes/styles/github/dark.css +0 -0
- package/src/themes/styles/github/light.css +0 -0
- package/src/themes/styles/neurons/dark.css +247 -0
- package/src/themes/styles/neurons/light.css +280 -0
- package/dist/github-3688a83a.js +0 -5
- package/dist/gothic-94a7ecd6.js +0 -5
- package/dist/newsprint-32bf94d9.js +0 -5
- package/dist/night-4a954853.js +0 -5
- package/dist/pixyll-94de4610.js +0 -5
- package/dist/whitey-db68723e.js +0 -5
- package/src/MDXEditor.jsx +0 -32
- package/src/stories/Atoms/RangeInput/RangeInput.css +0 -29
- package/src/stories/Atoms/RangeInput/RangeInput.jsx +0 -41
- package/src/stories/Atoms/RangeInput/RangeInput.stories.jsx +0 -41
- package/src/stories/Components.md +0 -189
- package/src/stories/Layouts/Layout.js +0 -28
- package/src/styles/Header.modules.css +0 -32
- package/src/styles/global.css +0 -59
- package/src/themes/Themes.js +0 -44
- package/src/themes/dark.js +0 -22
- package/src/themes/light.js +0 -22
- package/src/themes/typ/Readme.md +0 -4
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-700italic.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-italic.woff2 +0 -0
- package/src/themes/typ/github/open-sans-v17-latin-ext_latin-regular.woff2 +0 -0
- package/src/themes/typ/github.css +0 -416
- package/src/themes/typ/gothic/GUST e-foundry License.txt +0 -29
- package/src/themes/typ/gothic/didact-gothic-c-ext.woff2 +0 -0
- package/src/themes/typ/gothic/didact-gothic-c.woff2 +0 -0
- package/src/themes/typ/gothic/texgyreadventor-bold.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-bolditalic.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-italic.woff +0 -0
- package/src/themes/typ/gothic/texgyreadventor-regular.woff +0 -0
- package/src/themes/typ/gothic.css +0 -410
- package/src/themes/typ/newsprint/pt-serif-v11-latin-700.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-700italic.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-italic.woff2 +0 -0
- package/src/themes/typ/newsprint/pt-serif-v11-latin-regular.woff2 +0 -0
- package/src/themes/typ/newsprint.css +0 -622
- package/src/themes/typ/night/codeblock.dark.css +0 -113
- package/src/themes/typ/night/credit.html +0 -1
- package/src/themes/typ/night/cursor.png +0 -0
- package/src/themes/typ/night/cursor@2x.png +0 -0
- package/src/themes/typ/night/mermaid.dark.css +0 -7
- package/src/themes/typ/night/sourcemode.dark.css +0 -38
- package/src/themes/typ/night.css +0 -1032
- package/src/themes/typ/pixyll/lato-v14-latin-300.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-300italic.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-900.woff +0 -0
- package/src/themes/typ/pixyll/lato-v14-latin-900italic.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-300.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-300italic.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-700.woff +0 -0
- package/src/themes/typ/pixyll/merriweather-v19-latin-700italic.woff +0 -0
- package/src/themes/typ/pixyll.css +0 -528
- package/src/themes/typ/whitey.css +0 -299
- /package/src/stories/Molecules/{Molecules.js → meta_Molecules.js} +0 -0
- /package/src/stories/Organisms/{Organisms.js → meta_Organisms.js} +0 -0
package/package.json
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "this.gui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "This Graphic User Interface.",
|
|
5
5
|
"main": "dist/this-gui.umd.js",
|
|
6
6
|
"module": "dist/this-gui.es.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"author": "suiGn",
|
|
9
|
+
"license": "MIT",
|
|
7
10
|
"repository": {
|
|
8
11
|
"type": "git",
|
|
9
12
|
"url": "git+https://github.com/neurons-me/GUI.git"
|
|
10
13
|
},
|
|
11
14
|
"scripts": {
|
|
12
|
-
|
|
15
|
+
"start": "node ./src/scripts/logASCIIArt.js && concurrently \"vite --open\" \"storybook dev -p 6006 --no-open\"",
|
|
13
16
|
"dev": "vite",
|
|
14
17
|
"build": "vite build",
|
|
15
18
|
"prepublishOnly": "npm run build",
|
|
16
19
|
"storybook": "storybook dev -p ${STORYBOOK_PORT:-6006}",
|
|
17
20
|
"build-storybook": "storybook build",
|
|
18
|
-
"postinstall": "node src/scripts/postinstall.js"
|
|
21
|
+
"postinstall": "node src/scripts/postinstall.js"
|
|
19
22
|
},
|
|
20
|
-
"type": "module",
|
|
21
|
-
"author": "suiGn",
|
|
22
|
-
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@storybook/builder-vite": "^8.2.9",
|
|
25
|
-
"@vitejs/plugin-react": "^4.3.1",
|
|
26
25
|
"autoprefixer": "^10.4.20",
|
|
26
|
+
"classnames": "^2.5.1",
|
|
27
27
|
"dotenv": "^16.4.5",
|
|
28
28
|
"figlet": "^1.7.0",
|
|
29
|
-
"fs": "^0.0.1-security",
|
|
30
29
|
"postcss": "^8.4.45",
|
|
30
|
+
"react-icons": "^5.3.0",
|
|
31
|
+
"react-router-dom": "^6.26.2",
|
|
31
32
|
"tailwindcss": "^3.4.10"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
@@ -39,7 +40,7 @@
|
|
|
39
40
|
"@mdx-js/loader": "^3.0.1",
|
|
40
41
|
"@mdx-js/react": "^3.0.1",
|
|
41
42
|
"@mdx-js/rollup": "^3.0.1",
|
|
42
|
-
"@storybook/addon-docs": "^8.3.
|
|
43
|
+
"@storybook/addon-docs": "^8.3.4",
|
|
43
44
|
"@storybook/addon-essentials": "^8.3.0",
|
|
44
45
|
"@storybook/addon-interactions": "^8.3.0",
|
|
45
46
|
"@storybook/addon-links": "^8.3.0",
|
|
@@ -47,20 +48,21 @@
|
|
|
47
48
|
"@storybook/blocks": "^8.2.9",
|
|
48
49
|
"@storybook/manager-api": "^8.2.9",
|
|
49
50
|
"@storybook/react": "^8.3.0",
|
|
50
|
-
"@storybook/react-vite": "^8.3.
|
|
51
|
+
"@storybook/react-vite": "^8.3.4",
|
|
51
52
|
"@storybook/test": "^8.2.9",
|
|
52
53
|
"@storybook/theming": "^8.2.9",
|
|
54
|
+
"@vitejs/plugin-react": "^4.3.2",
|
|
53
55
|
"concurrently": "^9.0.1",
|
|
54
56
|
"cross-env": "^7.0.3",
|
|
55
57
|
"prop-types": "^15.8.1",
|
|
56
58
|
"react": "^18.0.0",
|
|
57
59
|
"react-dom": "^18.0.0",
|
|
58
60
|
"storybook": "^8.2.9",
|
|
59
|
-
"vite": "^4.
|
|
61
|
+
"vite": "^5.4.8"
|
|
60
62
|
},
|
|
61
63
|
"files": [
|
|
62
64
|
"dist",
|
|
63
|
-
"src",
|
|
65
|
+
"src",
|
|
64
66
|
"README.md",
|
|
65
67
|
"package.json"
|
|
66
68
|
]
|
package/src/App.jsx
CHANGED
|
@@ -1,31 +1,60 @@
|
|
|
1
|
-
// src/App.jsx
|
|
1
|
+
// This.GUI/src/App.jsx
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { BrowserRouter as Router, Route,
|
|
4
|
-
import { ThemeProvider } from './themes/ThemeProvider';
|
|
3
|
+
import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom';
|
|
4
|
+
import { ThemeProvider } from './themes/ThemeProvider';
|
|
5
|
+
import MdxProvider from './MdxProvider'; // MDX Provider
|
|
6
|
+
import SiteBuilder from './SiteBuilder'; // Import the site builder component
|
|
7
|
+
import { SelectTheme } from './stories/Molecules/SelectTheme/SelectTheme'; // Import SelectTheme
|
|
8
|
+
import { useTheme } from './themes/ThemeProvider'; // Import the hook
|
|
5
9
|
|
|
6
10
|
const App = () => {
|
|
7
11
|
return (
|
|
8
12
|
<ThemeProvider>
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
</
|
|
25
|
-
</
|
|
26
|
-
</
|
|
13
|
+
<MdxProvider>
|
|
14
|
+
<Router>
|
|
15
|
+
{/* Top navigation */}
|
|
16
|
+
<nav>
|
|
17
|
+
<Link to="/" style={{ marginRight: '20px' }}>Site Builder</Link>
|
|
18
|
+
<Link to="/storybook" style={{ marginRight: '20px' }}>Storybook</Link>
|
|
19
|
+
</nav>
|
|
20
|
+
|
|
21
|
+
{/* Render SelectTheme in the main app */}
|
|
22
|
+
<ThemeSwitcher />
|
|
23
|
+
|
|
24
|
+
{/* Route definitions */}
|
|
25
|
+
<Routes>
|
|
26
|
+
<Route path="/" element={<SiteBuilder />} /> {/* Site builder interface */}
|
|
27
|
+
<Route path="/storybook" element={<Storybook />} /> {/* Documentation */}
|
|
28
|
+
</Routes>
|
|
29
|
+
</Router>
|
|
30
|
+
</MdxProvider>
|
|
27
31
|
</ThemeProvider>
|
|
28
32
|
);
|
|
29
33
|
};
|
|
30
34
|
|
|
35
|
+
// Component to handle theme switching using the context
|
|
36
|
+
const ThemeSwitcher = () => {
|
|
37
|
+
const { setTheme, setMode } = useTheme();
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<SelectTheme
|
|
41
|
+
onThemeChange={(newTheme) => {
|
|
42
|
+
setTheme(newTheme);
|
|
43
|
+
}}
|
|
44
|
+
onModeChange={(newMode) => {
|
|
45
|
+
setMode(newMode);
|
|
46
|
+
}}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// Storybook IFrame for browsing documentation
|
|
52
|
+
const Storybook = () => (
|
|
53
|
+
<iframe
|
|
54
|
+
src="http://localhost:6006" // Adjust based on your Storybook setup
|
|
55
|
+
style={{ width: '100%', height: '100vh', border: 'none' }}
|
|
56
|
+
title="Storybook"
|
|
57
|
+
></iframe>
|
|
58
|
+
);
|
|
59
|
+
|
|
31
60
|
export default App;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import GUI from '../index';
|
|
3
|
+
|
|
4
|
+
const SiteBuilder = () => {
|
|
5
|
+
const [pageContent, setPageContent] = useState([]); // Store the page components
|
|
6
|
+
|
|
7
|
+
// Example links for the sidebar
|
|
8
|
+
const sidebarLinks = [
|
|
9
|
+
{ label: 'Dashboard', url: '/dashboard' },
|
|
10
|
+
{ label: 'Settings', url: '/settings' },
|
|
11
|
+
{ label: 'Profile', url: '/profile' },
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
// Function to handle adding components
|
|
15
|
+
const addComponent = (component) => {
|
|
16
|
+
setPageContent([...pageContent, component]);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className="site-builder">
|
|
21
|
+
{/* Fixed Navbar at the top */}
|
|
22
|
+
<GUI.Molecules.Navbar links={sidebarLinks} /> {/* Using the same links for simplicity */}
|
|
23
|
+
|
|
24
|
+
<div style={{ display: 'flex' }}>
|
|
25
|
+
{/* Sidebar with components to drag and drop */}
|
|
26
|
+
<GUI.Molecules.Sidebar links={sidebarLinks} addComponent={addComponent} />
|
|
27
|
+
|
|
28
|
+
{/* Main content area where components are dropped */}
|
|
29
|
+
<main className="builder-content" style={{ flex: 1, padding: '20px' }}>
|
|
30
|
+
{pageContent.map((Component, idx) => (
|
|
31
|
+
<div key={idx}>{Component}</div>
|
|
32
|
+
))}
|
|
33
|
+
</main>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default SiteBuilder;
|
package/src/index.mdx
CHANGED
|
@@ -15,6 +15,16 @@ import GUI from '../index';
|
|
|
15
15
|
}
|
|
16
16
|
/>
|
|
17
17
|
|
|
18
|
+
<GUI.Molecules.Sidebar
|
|
19
|
+
links={[
|
|
20
|
+
{ url: '#home', label: 'Home', isActive: true },
|
|
21
|
+
{ url: '#about', label: 'About', isActive: false },
|
|
22
|
+
{ url: '#services', label: 'Services', isActive: false },
|
|
23
|
+
]}
|
|
24
|
+
logo={<img src="https://example.com/logo.png" alt="Logo" />}
|
|
25
|
+
userControls={<button>Logout</button>}
|
|
26
|
+
/>
|
|
27
|
+
|
|
18
28
|
# Welcome to THIS.GUI
|
|
19
29
|
|
|
20
30
|
## Understanding MDX (Markdown + JSX)
|
package/src/main.jsx
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
//
|
|
1
|
+
// main.jsx
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import MdxProvider from './MdxProvider';
|
|
6
|
-
import { ThemeProvider } from './themes/ThemeProvider'; // Import ThemeProvider
|
|
7
|
-
import './styles/global.css'; // Import the global CSS
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import App from './App'; // Import App component
|
|
8
5
|
|
|
9
|
-
|
|
6
|
+
// Grab the container element
|
|
7
|
+
const container = document.getElementById('root');
|
|
8
|
+
const root = createRoot(container);
|
|
9
|
+
|
|
10
|
+
// Render your app using createRoot
|
|
11
|
+
root.render(
|
|
10
12
|
<React.StrictMode>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<MDXContent />
|
|
14
|
-
</MdxProvider>
|
|
15
|
-
</ThemeProvider>
|
|
16
|
-
</React.StrictMode>,
|
|
17
|
-
document.getElementById('root')
|
|
13
|
+
<App /> {/* Render the entire App component */}
|
|
14
|
+
</React.StrictMode>
|
|
18
15
|
);
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import Layout from '../stories/Layouts/meta_Layouts.js'; // Import the Layout 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 for Layouts
|
|
17
|
+
const createDefaultCSSTemplate = (componentName) => `
|
|
18
|
+
.${componentName.toLowerCase()} {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-wrap: wrap;
|
|
21
|
+
padding: 16px;
|
|
22
|
+
gap: 8px;
|
|
23
|
+
border: 1px solid #ddd;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.${componentName.toLowerCase()}--primary {
|
|
27
|
+
background-color: #e3f2fd;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.${componentName.toLowerCase()}--secondary {
|
|
31
|
+
background-color: #fff;
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
|
|
35
|
+
// Default JSX template for Layouts
|
|
36
|
+
const createDefaultJSX = (componentName) => `
|
|
37
|
+
import React from 'react';
|
|
38
|
+
import PropTypes from 'prop-types';
|
|
39
|
+
import './${componentName}.css';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* ${componentName} layout component
|
|
43
|
+
*/
|
|
44
|
+
export const ${componentName} = ({ children, primary, ...props }) => {
|
|
45
|
+
const mode = primary ? '${componentName.toLowerCase()}--primary' : '${componentName.toLowerCase()}--secondary';
|
|
46
|
+
return (
|
|
47
|
+
<div className={['${componentName.toLowerCase()}', mode].join(' ')} {...props}>
|
|
48
|
+
{children}
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
${componentName}.propTypes = {
|
|
54
|
+
/**
|
|
55
|
+
* Primary style for the layout
|
|
56
|
+
*/
|
|
57
|
+
primary: PropTypes.bool,
|
|
58
|
+
/**
|
|
59
|
+
* Children components to be rendered inside the layout
|
|
60
|
+
*/
|
|
61
|
+
children: PropTypes.node.isRequired,
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
${componentName}.defaultProps = {
|
|
65
|
+
primary: false,
|
|
66
|
+
};
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
// Default Storybook template for Layouts
|
|
70
|
+
const createDefaultStorybookTemplate = (componentName) => `
|
|
71
|
+
import { ${componentName} } from './${componentName}';
|
|
72
|
+
|
|
73
|
+
// Storybook configuration for ${componentName} component
|
|
74
|
+
export default {
|
|
75
|
+
title: 'Layouts/${componentName}',
|
|
76
|
+
component: ${componentName},
|
|
77
|
+
parameters: {
|
|
78
|
+
layout: 'fullscreen',
|
|
79
|
+
},
|
|
80
|
+
argTypes: {
|
|
81
|
+
children: { control: 'text' },
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const Primary = {
|
|
86
|
+
args: {
|
|
87
|
+
primary: true,
|
|
88
|
+
children: 'This is a primary ${componentName} layout.',
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Secondary = {
|
|
93
|
+
args: {
|
|
94
|
+
primary: false,
|
|
95
|
+
children: 'This is a secondary ${componentName} layout.',
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
`;
|
|
99
|
+
|
|
100
|
+
// Helper function to write files
|
|
101
|
+
const writeFile = (filePath, content) => {
|
|
102
|
+
const fullPath = path.resolve(__dirname, filePath);
|
|
103
|
+
fs.mkdirSync(path.dirname(fullPath), { recursive: true });
|
|
104
|
+
fs.writeFileSync(fullPath, content, 'utf8');
|
|
105
|
+
console.log(`✅ Created: ${filePath}`);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// Function to verify each path and create missing files with default content
|
|
109
|
+
async function verifyPaths(component, paths) {
|
|
110
|
+
const missingFiles = []; // Initialize missingFiles array
|
|
111
|
+
|
|
112
|
+
for (const [key, filePath] of Object.entries(paths)) {
|
|
113
|
+
const adjustedPath = path.join('..', 'stories', 'Layouts', filePath);
|
|
114
|
+
|
|
115
|
+
if (!fileExists(adjustedPath)) {
|
|
116
|
+
console.log(`❌ Missing: ${adjustedPath}`);
|
|
117
|
+
missingFiles.push(adjustedPath);
|
|
118
|
+
|
|
119
|
+
// Automatically create the missing file with default content
|
|
120
|
+
if (key === 'css') {
|
|
121
|
+
writeFile(adjustedPath, createDefaultCSSTemplate(component.name.trim()));
|
|
122
|
+
} else if (key === 'jsx') {
|
|
123
|
+
writeFile(adjustedPath, createDefaultJSX(component.name.trim()));
|
|
124
|
+
} else if (key === 'stories') {
|
|
125
|
+
writeFile(adjustedPath, createDefaultStorybookTemplate(component.name.trim()));
|
|
126
|
+
}
|
|
127
|
+
} else {
|
|
128
|
+
console.log(`✅ Exists: ${adjustedPath}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return missingFiles; // Return missingFiles array
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Main function to handle installation and verification
|
|
136
|
+
async function installAndVerifyLayouts(Layout) {
|
|
137
|
+
const missingFilesReport = [];
|
|
138
|
+
|
|
139
|
+
// Loop through each category (Grid, Navigation, etc.)
|
|
140
|
+
for (const category of Object.keys(Layout.Layout)) {
|
|
141
|
+
console.log(`\nVerifying category: ${category}`);
|
|
142
|
+
|
|
143
|
+
// Loop through each component in the category
|
|
144
|
+
for (const component of Layout.Layout[category]) {
|
|
145
|
+
console.log(`\nVerifying component: ${component.name}`);
|
|
146
|
+
|
|
147
|
+
// Verify each path for the component and get missing files
|
|
148
|
+
const missingFiles = await verifyPaths(component, component.paths);
|
|
149
|
+
|
|
150
|
+
// If files are missing, report them
|
|
151
|
+
if (missingFiles.length > 0) {
|
|
152
|
+
missingFilesReport.push({
|
|
153
|
+
component: component.name,
|
|
154
|
+
missingFiles,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// If there are missing files, summarize the report
|
|
161
|
+
if (missingFilesReport.length > 0) {
|
|
162
|
+
console.log("\nInstallation or verification required for the following components:");
|
|
163
|
+
missingFilesReport.forEach((report) => {
|
|
164
|
+
console.log(`\nComponent: ${report.component}`);
|
|
165
|
+
report.missingFiles.forEach((file) => {
|
|
166
|
+
console.log(` ❌ Missing file: ${file}`);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
} else {
|
|
170
|
+
console.log("\nAll components verified successfully! ✅");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Run the verification script
|
|
175
|
+
installAndVerifyLayouts(Layout);
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import Templates from '../stories/Templates/meta_Templates.js'; // Import the Templates 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 for Templates
|
|
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
|
+
|
|
26
|
+
// Default JSX template for Templates
|
|
27
|
+
const createDefaultJSX = (componentName) => `
|
|
28
|
+
import React from 'react';
|
|
29
|
+
import PropTypes from 'prop-types';
|
|
30
|
+
import './${componentName}.css';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* ${componentName} template component
|
|
34
|
+
*/
|
|
35
|
+
export const ${componentName} = ({ children, ...props }) => {
|
|
36
|
+
return (
|
|
37
|
+
<div className="${componentName.toLowerCase()}" {...props}>
|
|
38
|
+
{children}
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
${componentName}.propTypes = {
|
|
44
|
+
/**
|
|
45
|
+
* Children components to be rendered inside the template
|
|
46
|
+
*/
|
|
47
|
+
children: PropTypes.node.isRequired,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export default ${componentName};
|
|
51
|
+
`;
|
|
52
|
+
|
|
53
|
+
// Default Storybook template for Templates
|
|
54
|
+
const createDefaultStorybookTemplate = (componentName, category) => `
|
|
55
|
+
import { ${componentName} } from './${componentName}';
|
|
56
|
+
|
|
57
|
+
// Storybook configuration for ${componentName} template
|
|
58
|
+
export default {
|
|
59
|
+
title: 'Templates/${category}/${componentName}',
|
|
60
|
+
component: ${componentName},
|
|
61
|
+
parameters: {
|
|
62
|
+
layout: 'fullscreen',
|
|
63
|
+
},
|
|
64
|
+
argTypes: {
|
|
65
|
+
children: { control: 'text' },
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const Default = {
|
|
70
|
+
args: {
|
|
71
|
+
children: 'This is a default ${componentName} template.',
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
// Helper function to write files and create directories if needed
|
|
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 basePath = path.join('..', 'stories', 'Templates', category, componentName);
|
|
91
|
+
|
|
92
|
+
const adjustedPath = path.join(basePath, path.basename(filePath));
|
|
93
|
+
|
|
94
|
+
if (!fileExists(adjustedPath)) {
|
|
95
|
+
console.log(`❌ Missing: ${adjustedPath}`);
|
|
96
|
+
missingFiles.push(adjustedPath);
|
|
97
|
+
|
|
98
|
+
// Automatically create the missing file with default content
|
|
99
|
+
if (key === 'css') {
|
|
100
|
+
writeFile(adjustedPath, createDefaultCSSTemplate(componentName));
|
|
101
|
+
} else if (key === 'jsx') {
|
|
102
|
+
writeFile(adjustedPath, createDefaultJSX(componentName));
|
|
103
|
+
} else if (key === 'stories') {
|
|
104
|
+
writeFile(adjustedPath, createDefaultStorybookTemplate(componentName, category));
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
console.log(`✅ Exists: ${adjustedPath}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return missingFiles; // Return missingFiles array
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Main function to handle installation and verification of Templates
|
|
115
|
+
async function installAndVerifyTemplates(Templates) {
|
|
116
|
+
const missingFilesReport = [];
|
|
117
|
+
|
|
118
|
+
// Loop through each category (LandingPages, DashboardLayouts, etc.)
|
|
119
|
+
for (const category of Object.keys(Templates.Templates)) {
|
|
120
|
+
console.log(`\nVerifying category: ${category}`);
|
|
121
|
+
|
|
122
|
+
// Loop through each component in the category
|
|
123
|
+
for (const component of Templates.Templates[category]) {
|
|
124
|
+
console.log(`\nVerifying component: ${component.name.trim()}`);
|
|
125
|
+
|
|
126
|
+
// Verify each path for the component and get missing files
|
|
127
|
+
const missingFiles = await verifyPaths(component, component.paths, category);
|
|
128
|
+
|
|
129
|
+
// If files are missing, report them
|
|
130
|
+
if (missingFiles.length > 0) {
|
|
131
|
+
missingFilesReport.push({
|
|
132
|
+
component: component.name.trim(),
|
|
133
|
+
missingFiles,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// If there are missing files, summarize the report
|
|
140
|
+
if (missingFilesReport.length > 0) {
|
|
141
|
+
console.log("\nInstallation or verification required for the following components:");
|
|
142
|
+
missingFilesReport.forEach((report) => {
|
|
143
|
+
console.log(`\nComponent: ${report.component}`);
|
|
144
|
+
report.missingFiles.forEach((file) => {
|
|
145
|
+
console.log(` ❌ Missing file: ${file}`);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
} else {
|
|
149
|
+
console.log("\nAll components verified successfully! ✅");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Run the verification script
|
|
154
|
+
installAndVerifyTemplates(Templates);
|