-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #353 from aversini/feat-moving-flexbox-and-themepr…
…ovider-to-ui-system feat: moving Flexgrid and ThemeProvider to ui-system
- Loading branch information
Showing
63 changed files
with
827 additions
and
489 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"packages/eslint-plugin-client": "1.0.1", | ||
"packages/ui-components": "5.0.0", | ||
"packages/ui-hooks": "2.2.0" | ||
"packages/ui-hooks": "2.2.0", | ||
"packages/ui-system": "0.0.0" | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta name="theme-color" content="#64748b"> | ||
<link rel="icon" type="image/png" href="/favicon.ico?v=2"> | ||
|
||
<title>UI System</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import "@versini/ui-system/dist/style.css"; | ||
|
||
import * as System from "@versini/ui-system"; | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
|
||
Object.keys(System).forEach(() => { | ||
/** | ||
* This is simply to loop through all system components | ||
* and trick rollup into bundling them (instead of | ||
* simply tree-shaking anything that is imported but | ||
* not used...) | ||
*/ | ||
}); | ||
|
||
ReactDOM.createRoot(document.getElementById("root")!).render( | ||
<React.StrictMode>hello</React.StrictMode>, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/// <reference types="vite/client" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,63 @@ | ||
/** @type {import('vite').UserConfig} */ | ||
|
||
import { resolve } from "node:path"; | ||
|
||
import fs from "fs-extra"; | ||
import { defineConfig } from "vite"; | ||
import { defineConfig, loadEnv } from "vite"; | ||
|
||
const VENDOR_CHUNK = "vendorChunk"; | ||
const packageJson = fs.readJSONSync("../ui-components/package.json"); | ||
const prodDependencies = Object.keys(packageJson.dependencies).filter( | ||
(dependency) => | ||
dependency !== "react" && | ||
dependency !== "react-dom" && | ||
dependency !== "react/jsx-runtime" && | ||
dependency !== "react-dom/server" && | ||
dependency !== "tailwindcss", | ||
); | ||
prodDependencies.push( | ||
"react-dom", | ||
"react-dom/server", | ||
"react", | ||
"react/jsx-runtime", | ||
); | ||
|
||
export default defineConfig({ | ||
esbuild: { | ||
supported: { | ||
"top-level-await": true, //browsers can handle top-level-await features | ||
export default defineConfig(({ mode }) => { | ||
const env = loadEnv(mode, process.cwd()); | ||
const packageJson = fs.readJSONSync( | ||
`../ui-${env.VITE_UI_TARGET}/package.json`, | ||
); | ||
const prodDependencies = Object.keys(packageJson.dependencies).filter( | ||
(dependency) => | ||
dependency !== "react" && | ||
dependency !== "react-dom" && | ||
dependency !== "react/jsx-runtime" && | ||
dependency !== "react-dom/server" && | ||
dependency !== "tailwindcss", | ||
); | ||
prodDependencies.push( | ||
"react-dom", | ||
"react-dom/server", | ||
"react", | ||
"react/jsx-runtime", | ||
); | ||
|
||
return { | ||
esbuild: { | ||
supported: { | ||
"top-level-await": true, //browsers can handle top-level-await features | ||
}, | ||
}, | ||
}, | ||
build: { | ||
rollupOptions: { | ||
output: { | ||
assetFileNames: "assets/style[extname]", | ||
entryFileNames: "assets/[name].js", | ||
/** | ||
* Manually creating chunks for prod dependencies. | ||
*/ | ||
manualChunks: { | ||
[VENDOR_CHUNK]: prodDependencies, | ||
build: { | ||
outDir: `dist/${env.VITE_UI_TARGET}`, | ||
emptyOutDir: false, | ||
rollupOptions: { | ||
input: { | ||
index: resolve(__dirname, "src", env.VITE_UI_TARGET, "index.html"), | ||
}, | ||
chunkFileNames(chunkInfo) { | ||
if (chunkInfo.name.includes(VENDOR_CHUNK)) { | ||
return "assets/vendor.js"; | ||
} | ||
return "[name]-[hash].js"; | ||
output: { | ||
assetFileNames: "assets/style[extname]", | ||
entryFileNames: "assets/[name].js", | ||
/** | ||
* Manually creating chunks for prod dependencies. | ||
*/ | ||
manualChunks: { | ||
[VENDOR_CHUNK]: prodDependencies, | ||
}, | ||
chunkFileNames(chunkInfo) { | ||
if (chunkInfo.name.includes(VENDOR_CHUNK)) { | ||
return "assets/vendor.js"; | ||
} | ||
return "[name]-[hash].js"; | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
plugins: [], | ||
plugins: [], | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/documentation/src/GettingStarted/1-overview.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
packages/documentation/src/GettingStarted/2-Installation.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
packages/documentation/src/GettingStarted/3-configuration.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 2 additions & 6 deletions
8
packages/documentation/src/GettingStarted/5-alpha-beta.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
/** @type {import('tailwindcss').Config} */ | ||
|
||
import { twPlugin } from "@versini/ui-components/dist/utilities"; | ||
import { twPlugin as componentsPlugin } from "@versini/ui-components/dist/utilities"; | ||
import { twPlugin as systemPlugin } from "@versini/ui-system/dist/utilities"; | ||
|
||
export default twPlugin.merge({ | ||
darkMode: "selector", | ||
content: ["./src/**/*.{js,ts,jsx,tsx}", "./.ladle/**/*.tsx"], | ||
}); | ||
export default systemPlugin.merge( | ||
componentsPlugin.merge({ | ||
darkMode: "selector", | ||
content: ["./src/**/*.{js,ts,jsx,tsx}", "./.ladle/**/*.tsx"], | ||
}), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { customCSS } from "../lib/customCSS"; | ||
import { twPlugin } from "../lib/tailwindPlugin"; | ||
import { tokens } from "../lib/tokens"; | ||
import { customCSS } from "../../../lib/customCSS"; | ||
import { twPlugin } from "../../../lib/tailwindPlugin"; | ||
import { tokens } from "../../../lib/tokens"; | ||
|
||
export { customCSS, tokens, twPlugin }; |
Oops, something went wrong.