buildgrid-ui 0.0.1-alpha.1

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.
@@ -0,0 +1,22 @@
1
+ import type { StorybookConfig } from "@storybook/react-vite";
2
+ import { mergeConfig } from "vite";
3
+
4
+ const config: StorybookConfig = {
5
+ stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
6
+ addons: [
7
+ "@storybook/addon-onboarding",
8
+ "@storybook/addon-essentials",
9
+ "@chromatic-com/storybook",
10
+ "@storybook/addon-interactions",
11
+ ],
12
+ framework: {
13
+ name: "@storybook/react-vite",
14
+ options: {},
15
+ },
16
+ viteFinal: (config) => {
17
+ return mergeConfig(config, {
18
+ plugins: [],
19
+ });
20
+ },
21
+ };
22
+ export default config;
@@ -0,0 +1,14 @@
1
+ import type { Preview } from "@storybook/react";
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: {
7
+ color: /(background|color)$/i,
8
+ date: /Date$/i,
9
+ },
10
+ },
11
+ },
12
+ };
13
+
14
+ export default preview;
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "buildgrid-ui",
3
+ "version": "0.0.1-alpha.1",
4
+ "main": "dist/buildgrid-ui.umd.js",
5
+ "module": "dist/buildgrid-ui.esm.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "storybook": "storybook dev -p 6006",
10
+ "build-storybook": "storybook build"
11
+ },
12
+ "keywords": [],
13
+ "author": "",
14
+ "license": "ISC",
15
+ "description": "",
16
+ "dependencies": {
17
+ "@shadcn/ui": "^0.0.4",
18
+ "react": "^19.0.0",
19
+ "react-dom": "^19.0.0",
20
+ "vite": "^6.0.6"
21
+ },
22
+ "devDependencies": {
23
+ "@chromatic-com/storybook": "^3.2.3",
24
+ "@storybook/addon-essentials": "^8.4.7",
25
+ "@storybook/addon-interactions": "^8.4.7",
26
+ "@storybook/addon-onboarding": "^8.4.7",
27
+ "@storybook/blocks": "^8.4.7",
28
+ "@storybook/react": "^8.4.7",
29
+ "@storybook/react-vite": "^8.4.7",
30
+ "@storybook/test": "^8.4.7",
31
+ "@types/react": "^19.0.2",
32
+ "@vitejs/plugin-react": "^4.3.4",
33
+ "storybook": "^8.4.7",
34
+ "typescript": "^5.7.2"
35
+ }
36
+ }
@@ -0,0 +1,16 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+
3
+ import Button from "./Button";
4
+
5
+ const meta: Meta<typeof Button> = {
6
+ component: Button,
7
+ };
8
+
9
+ export default meta;
10
+ type Story = StoryObj<typeof Button>;
11
+
12
+ export const Primary: Story = {
13
+ args: {
14
+ label: "Button example",
15
+ },
16
+ };
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ export interface ButtonProps {
4
+ label: string;
5
+ onClick?: () => void;
6
+ }
7
+
8
+ const Button: React.FC<ButtonProps> = ({ label, onClick }) => (
9
+ <button
10
+ onClick={onClick}
11
+ className="px-4 py-2 bg-blue-500 text-white rounded"
12
+ >
13
+ {label}
14
+ </button>
15
+ );
16
+
17
+ export default Button;
@@ -0,0 +1 @@
1
+ export * from ".";
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { default as Button } from "./components/button/Button";
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "lib": ["dom", "esnext"],
6
+ "jsx": "react-jsx",
7
+ "strict": true,
8
+ "moduleResolution": "node",
9
+ "esModuleInterop": true,
10
+ "declaration": true,
11
+ "outDir": "dist"
12
+ },
13
+ "include": ["src"]
14
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,22 @@
1
+ import { defineConfig } from "vite";
2
+ import react from "@vitejs/plugin-react";
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ build: {
7
+ lib: {
8
+ entry: "src/index.ts",
9
+ name: "BuildgridUI",
10
+ fileName: (format) => `buildgrid-ui.${format}.js`,
11
+ },
12
+ rollupOptions: {
13
+ external: ["react", "react-dom"],
14
+ output: {
15
+ globals: {
16
+ react: "React",
17
+ "react-dom": "ReactDOM",
18
+ },
19
+ },
20
+ },
21
+ },
22
+ });