@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/.babelrc.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** @type { import('@storybook/react-vite').StorybookConfig } */
|
|
2
|
+
const config = {
|
|
3
|
+
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
|
|
4
|
+
addons: [
|
|
5
|
+
"@storybook/addon-links",
|
|
6
|
+
"@storybook/addon-essentials",
|
|
7
|
+
"@storybook/addon-interactions",
|
|
8
|
+
{
|
|
9
|
+
name: "@storybook/addon-styling",
|
|
10
|
+
options: {
|
|
11
|
+
// Check out https://github.com/storybookjs/addon-styling/blob/main/docs/api.md
|
|
12
|
+
// For more details on this addon's options.
|
|
13
|
+
postCss: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
],
|
|
17
|
+
framework: {
|
|
18
|
+
name: "@storybook/react-vite",
|
|
19
|
+
options: {},
|
|
20
|
+
},
|
|
21
|
+
docs: {
|
|
22
|
+
autodocs: "tag",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export default config;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
2
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
3
|
+
<link
|
|
4
|
+
href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,400;1,700&display=swap"
|
|
5
|
+
rel="stylesheet"
|
|
6
|
+
/>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { withThemeByDataAttribute } from "@storybook/addon-styling";
|
|
2
|
+
|
|
3
|
+
import "tailwindcss/tailwind.css";
|
|
4
|
+
import "../src/index.css";
|
|
5
|
+
import "./theme.css"; // The normal css has theming on :hover, but we need to have it on :root for stories to work
|
|
6
|
+
|
|
7
|
+
/* snipped for brevity */
|
|
8
|
+
|
|
9
|
+
export const decorators = [
|
|
10
|
+
withThemeByDataAttribute({
|
|
11
|
+
themes: {
|
|
12
|
+
light: "light",
|
|
13
|
+
dark: "dark",
|
|
14
|
+
},
|
|
15
|
+
defaultTheme: "dark",
|
|
16
|
+
attributeName: "data-mode",
|
|
17
|
+
}),
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
/** @type { import('@storybook/react').Preview } */
|
|
21
|
+
const preview = {
|
|
22
|
+
parameters: {
|
|
23
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
24
|
+
controls: {
|
|
25
|
+
matchers: {
|
|
26
|
+
color: /(background|color)$/i,
|
|
27
|
+
date: /Date$/,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default preview;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
html {
|
|
2
|
+
font-family: Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
3
|
+
Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
4
|
+
/* This must be identical to the theme in index.css */
|
|
5
|
+
--val-theme-white: #fcfcfc;
|
|
6
|
+
--val-theme-light-gray: #d6d6d6;
|
|
7
|
+
--val-theme-medium-gray: #c9c9c9;
|
|
8
|
+
--val-theme-dark-gray: #575757;
|
|
9
|
+
--val-theme-medium-black: #303030;
|
|
10
|
+
--val-theme-warm-black: #1a1a1a;
|
|
11
|
+
--val-theme-yellow: #ffff00;
|
|
12
|
+
--val-theme-red: #f02929;
|
|
13
|
+
--val-theme-green: #1ced1c;
|
|
14
|
+
|
|
15
|
+
/* light theme */
|
|
16
|
+
--val-theme-base: var(--val-theme-white);
|
|
17
|
+
--val-theme-highlight: var(--val-theme-yellow);
|
|
18
|
+
--val-theme-border: var(--val-theme-medium-gray);
|
|
19
|
+
--val-theme-fill: var(--val-theme-light-gray);
|
|
20
|
+
--val-theme-primary: var(--val-theme-warm-black);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* dark theme */
|
|
24
|
+
*[data-mode="dark"] {
|
|
25
|
+
--val-theme-base: var(--val-theme-warm-black);
|
|
26
|
+
--val-theme-highlight: var(--val-theme-yellow);
|
|
27
|
+
--val-theme-border: var(--val-theme-dark-gray);
|
|
28
|
+
--val-theme-fill: var(--val-theme-medium-black);
|
|
29
|
+
--val-theme-primary: var(--val-theme-white);
|
|
30
|
+
}
|
package/CHANGELOG.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { LexicalEditor } from 'lexical';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
import { RichText } from '@valbuild/core';
|
|
4
|
+
|
|
5
|
+
interface RichTextEditorProps {
|
|
6
|
+
richtext: RichText;
|
|
7
|
+
onEditor?: (editor: LexicalEditor) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const RichTextEditor: FC<RichTextEditorProps>;
|
|
10
|
+
|
|
11
|
+
type ImageData = {
|
|
12
|
+
src: string;
|
|
13
|
+
addMetadata: boolean;
|
|
14
|
+
metadata?: {
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
sha256: string;
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
url: string;
|
|
21
|
+
metadata?: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
sha256: string;
|
|
25
|
+
};
|
|
26
|
+
} | null;
|
|
27
|
+
|
|
28
|
+
type TextData = string;
|
|
29
|
+
|
|
30
|
+
type Inputs = {
|
|
31
|
+
[path: string]: {
|
|
32
|
+
status: "requested";
|
|
33
|
+
} | {
|
|
34
|
+
status: "completed";
|
|
35
|
+
type: "text";
|
|
36
|
+
data: TextData;
|
|
37
|
+
} | {
|
|
38
|
+
status: "completed";
|
|
39
|
+
type: "image";
|
|
40
|
+
data: ImageData;
|
|
41
|
+
} | {
|
|
42
|
+
status: "completed";
|
|
43
|
+
type: "richtext";
|
|
44
|
+
data: RichText;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
type FormProps = {
|
|
48
|
+
onSubmit: (nextInputs: Inputs) => void;
|
|
49
|
+
inputs: Inputs;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type ValWindow = {
|
|
53
|
+
position: {
|
|
54
|
+
left: number;
|
|
55
|
+
top: number;
|
|
56
|
+
};
|
|
57
|
+
} & FormProps;
|
|
58
|
+
type ValOverlayProps = {
|
|
59
|
+
editMode: boolean;
|
|
60
|
+
setEditMode: (editMode: boolean) => void;
|
|
61
|
+
valWindow?: ValWindow;
|
|
62
|
+
closeValWindow: () => void;
|
|
63
|
+
};
|
|
64
|
+
declare function ValOverlay({ editMode, setEditMode, valWindow, closeValWindow, }: ValOverlayProps): JSX.Element;
|
|
65
|
+
|
|
66
|
+
declare function Style(): JSX.Element;
|
|
67
|
+
|
|
68
|
+
export { Inputs, RichTextEditor, Style, ValOverlay };
|