@valbuild/ui 0.12.0
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/.babelrc.json +10 -0
- package/.storybook/main.js +25 -0
- package/.storybook/preview-head.html +6 -0
- package/.storybook/preview.js +33 -0
- package/.storybook/theme.css +30 -0
- package/CHANGELOG.md +0 -0
- package/dist/valbuild-ui.cjs.d.ts +68 -0
- package/dist/valbuild-ui.cjs.js +50938 -0
- package/dist/valbuild-ui.esm.js +50938 -0
- package/package.json +80 -0
- package/postcss.config.js +6 -0
- package/rollup.config.js +23 -0
- package/server/dist/valbuild-ui-server.cjs.d.ts +5 -0
- package/server/dist/valbuild-ui-server.cjs.js +8 -0
- package/server/dist/valbuild-ui-server.esm.js +8 -0
- package/server/package.json +4 -0
- package/server.vite.config.ts +29 -0
- package/tailwind.config.js +52 -0
- package/tsconfig.json +17 -0
- package/vite.config.ts +33 -0
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@valbuild/ui",
|
|
3
|
+
"version": "0.12.0",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"typecheck": "tsc --noEmit",
|
|
7
|
+
"build": "vite build && vite --config server.vite.config.ts build && rollup --config rollup.config.js",
|
|
8
|
+
"storybook": "storybook dev -p 6006",
|
|
9
|
+
"build-storybook": "storybook build"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@lexical/list": "^0.10.0",
|
|
13
|
+
"@lexical/react": "^0.10.0",
|
|
14
|
+
"@lexical/rich-text": "^0.10.0",
|
|
15
|
+
"@lexical/selection": "^0.10.0",
|
|
16
|
+
"@lexical/utils": "^0.10.0",
|
|
17
|
+
"@types/express": "^4.17.17",
|
|
18
|
+
"@types/react": "^18.0.26",
|
|
19
|
+
"classnames": "^2.3.2",
|
|
20
|
+
"lexical": "^0.10.0",
|
|
21
|
+
"react-feather": "^2.0.10",
|
|
22
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
23
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
24
|
+
"rollup-plugin-typescript2": "^0.34.1"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@storybook/addon-essentials": "^7.0.12",
|
|
28
|
+
"@storybook/addon-interactions": "^7.0.12",
|
|
29
|
+
"@storybook/addon-links": "^7.0.12",
|
|
30
|
+
"@storybook/addon-styling": "^1.0.8",
|
|
31
|
+
"@storybook/blocks": "^7.0.12",
|
|
32
|
+
"@storybook/builder-vite": "^7.0.12",
|
|
33
|
+
"@storybook/react": "^7.0.12",
|
|
34
|
+
"@storybook/react-vite": "^7.0.12",
|
|
35
|
+
"@storybook/testing-library": "^0.0.14-next.2",
|
|
36
|
+
"autoprefixer": "^10.4.13",
|
|
37
|
+
"postcss": "^8.4.21",
|
|
38
|
+
"prop-types": "^15.8.1",
|
|
39
|
+
"react": "^18.2.0",
|
|
40
|
+
"react-dom": "^18.2.0",
|
|
41
|
+
"react-test-renderer": "^18.2.0",
|
|
42
|
+
"rollup": "^3.17.3",
|
|
43
|
+
"rollup-plugin-dts": "^5.3.0",
|
|
44
|
+
"storybook": "^7.0.12",
|
|
45
|
+
"tailwindcss": "^3.2.7",
|
|
46
|
+
"vite": "^4.1.4"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": ">=16.8.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependenciesMeta": {
|
|
52
|
+
"@types/express": {
|
|
53
|
+
"optional": true
|
|
54
|
+
},
|
|
55
|
+
"@types/react": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"preconstruct": {
|
|
60
|
+
"entrypoints": [
|
|
61
|
+
"./index.tsx",
|
|
62
|
+
"./server.ts"
|
|
63
|
+
],
|
|
64
|
+
"exports": true
|
|
65
|
+
},
|
|
66
|
+
"main": "dist/valbuild-ui.cjs.js",
|
|
67
|
+
"module": "dist/valbuild-ui.esm.js",
|
|
68
|
+
"exports": {
|
|
69
|
+
".": {
|
|
70
|
+
"module": "./dist/valbuild-ui.esm.js",
|
|
71
|
+
"default": "./dist/valbuild-ui.cjs.js"
|
|
72
|
+
},
|
|
73
|
+
"./server": {
|
|
74
|
+
"module": "./server/dist/valbuild-ui-server.esm.js",
|
|
75
|
+
"default": "./server/dist/valbuild-ui-server.cjs.js"
|
|
76
|
+
},
|
|
77
|
+
"./package.json": "./package.json"
|
|
78
|
+
},
|
|
79
|
+
"types": "dist/valbuild-ui.cjs.d.ts"
|
|
80
|
+
}
|
package/rollup.config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
+
const { default: dts } = require("rollup-plugin-dts");
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* This rollup config is used solely for bundling type definitions. Vite builds
|
|
6
|
+
* the rest!
|
|
7
|
+
*
|
|
8
|
+
* @type{import("rollup").RollupOptions[]}
|
|
9
|
+
*/
|
|
10
|
+
const config = [
|
|
11
|
+
{
|
|
12
|
+
input: "./src/vite-index.tsx",
|
|
13
|
+
output: [{ file: "dist/valbuild-ui.cjs.d.ts", format: "es" }],
|
|
14
|
+
plugins: [dts()],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
input: "./src/vite-server.ts",
|
|
18
|
+
output: [{ file: "server/dist/valbuild-ui-server.cjs.d.ts", format: "es" }],
|
|
19
|
+
plugins: [dts()],
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
module.exports = config;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
|
|
3
|
+
// https://vitejs.dev/config/
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
build: {
|
|
6
|
+
outDir: "./server/dist",
|
|
7
|
+
lib: {
|
|
8
|
+
entry: {
|
|
9
|
+
"valbuild-ui-server": "./src/vite-server.ts",
|
|
10
|
+
},
|
|
11
|
+
formats: ["cjs", "es"],
|
|
12
|
+
/**
|
|
13
|
+
* Sets file names to match the output from Preconstruct
|
|
14
|
+
*/
|
|
15
|
+
fileName(format, entryName) {
|
|
16
|
+
switch (format) {
|
|
17
|
+
case "es":
|
|
18
|
+
return `${entryName}.esm.js`;
|
|
19
|
+
case "cjs":
|
|
20
|
+
return `${entryName}.cjs.js`;
|
|
21
|
+
default:
|
|
22
|
+
throw Error(`Unexpected format: ${format}`);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
// Output semi-readable code and let consumers handle minification
|
|
27
|
+
minify: false,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
content: [__dirname + "/src/**/*.{js,ts,jsx,tsx}"],
|
|
4
|
+
darkMode: ["class", '[data-mode="dark"]'],
|
|
5
|
+
theme: {
|
|
6
|
+
colors: {
|
|
7
|
+
base: "var(--val-theme-base)",
|
|
8
|
+
highlight: "var(--val-theme-highlight)",
|
|
9
|
+
border: "var(--val-theme-border)",
|
|
10
|
+
fill: "var(--val-theme-fill)",
|
|
11
|
+
primary: "var(--val-theme-primary)",
|
|
12
|
+
//
|
|
13
|
+
white: "#FCFCFC",
|
|
14
|
+
"light-gray": "#D6D6D6",
|
|
15
|
+
"dark-gray": "#575757",
|
|
16
|
+
"medium-black": "#303030",
|
|
17
|
+
"warm-black": "#1A1A1A",
|
|
18
|
+
yellow: "#FFFF00",
|
|
19
|
+
red: "#F02929",
|
|
20
|
+
green: "#1CED1C",
|
|
21
|
+
},
|
|
22
|
+
spacing: {
|
|
23
|
+
0: "0px",
|
|
24
|
+
1: "4px",
|
|
25
|
+
2: "8px",
|
|
26
|
+
3: "12px",
|
|
27
|
+
4: "16px",
|
|
28
|
+
},
|
|
29
|
+
screens: {
|
|
30
|
+
tablet: "640px",
|
|
31
|
+
},
|
|
32
|
+
fontFamily: {
|
|
33
|
+
sans: "'Roboto', sans-serif",
|
|
34
|
+
serif: "'JetBrains Mono', monospace",
|
|
35
|
+
},
|
|
36
|
+
keyframes: {
|
|
37
|
+
rotateLeft: {
|
|
38
|
+
"0%": { transform: "rotate(0deg)" },
|
|
39
|
+
"100%": { transform: "rotate(45deg)" },
|
|
40
|
+
},
|
|
41
|
+
rotateRight: {
|
|
42
|
+
"0%": { transform: "rotate(0deg)" },
|
|
43
|
+
"100%": { transform: "rotate(-45deg)" },
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
animation: {
|
|
47
|
+
rotateLeft: "rotateLeft 200ms ease-in-out",
|
|
48
|
+
rotateRight: "rotateRight 200ms ease-in-out",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
plugins: [],
|
|
52
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"strict": true,
|
|
5
|
+
"allowJs": true,
|
|
6
|
+
"isolatedModules": true,
|
|
7
|
+
"jsx": "react-jsx",
|
|
8
|
+
"lib": ["es6", "dom"],
|
|
9
|
+
"module": "esnext",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"target": "ES5",
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"rootDir": "src"
|
|
15
|
+
},
|
|
16
|
+
"include": ["src/**/*"]
|
|
17
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineConfig } from "vite";
|
|
2
|
+
import react from "@vitejs/plugin-react";
|
|
3
|
+
|
|
4
|
+
// https://vitejs.dev/config/
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
entry: {
|
|
10
|
+
"valbuild-ui": "./src/vite-index.tsx",
|
|
11
|
+
},
|
|
12
|
+
formats: ["cjs", "es"],
|
|
13
|
+
/**
|
|
14
|
+
* Sets file names to match the output from Preconstruct
|
|
15
|
+
*/
|
|
16
|
+
fileName(format, entryName) {
|
|
17
|
+
switch (format) {
|
|
18
|
+
case "es":
|
|
19
|
+
return `${entryName}.esm.js`;
|
|
20
|
+
case "cjs":
|
|
21
|
+
return `${entryName}.cjs.js`;
|
|
22
|
+
default:
|
|
23
|
+
throw Error(`Unexpected format: ${format}`);
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
// Output semi-readable code and let consumers handle minification
|
|
28
|
+
minify: false,
|
|
29
|
+
rollupOptions: {
|
|
30
|
+
external: ["react", "react/jsx-runtime", "react/jsx-dev-runtime"],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|