@vtspecian/ui-core-design-system 0.1.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/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # @victorts1991/ui-core-design-system
2
+
3
+ A high-performance, accessible, and scalable UI Design System built for modern web applications. This project follows industry-leading architectural patterns for component libraries, ensuring a robust foundation for React-based ecosystems.
4
+
5
+ ## 🚀 **Tech Stack**
6
+
7
+ * **React 19**: Leveraging the newest concurrent rendering features and hooks.
8
+ * **Tailwind CSS 4**: Utilizing the latest CSS-engine for optimized, utility-first styling.
9
+ * **TypeScript 5**: Strict type-safety across all components and utility functions.
10
+ * **tsup**: Advanced bundler powered by **esbuild** for dual-format (ESM/CJS) distribution.
11
+ * **Storybook 8**: Comprehensive documentation and isolated development environment.
12
+ * **Vitest & React Testing Library**: Modern testing suite for reliable unit and interaction testing.
13
+
14
+ ## đź›  **Project Architecture**
15
+
16
+ The project follows a modular structure designed for maintainability and clear separation of concerns:
17
+
18
+ ```text
19
+ src/
20
+ ├── components/ # Atomic UI components with logic and variants
21
+ ├── styles/ # Global styles and Tailwind v4 theme definitions
22
+ ├── test/ # Test setup and global configuration
23
+ └── index.ts # Library public API (Entry point)
24
+ ```
25
+
26
+ ## đź§Ş **Quality Assurance (QA)**
27
+
28
+ As an **Architect-led project**, code reliability is a priority. Every component is tested for interaction logic and visual states.
29
+
30
+ ### **Automated Testing**
31
+ To run the unit test suite:
32
+ ```bash
33
+ npm test
34
+ ```
35
+
36
+ ### **Documentation & Visual Testing**
37
+ To explore the component library in isolation via **Storybook**:
38
+ ```bash
39
+ npm run storybook
40
+ ```
41
+
42
+ ## 🏗 **Development Workflow**
43
+
44
+ 1. **Building for Production**: Generates an optimized bundle in the **dist/** directory, including type definitions.
45
+ ```bash
46
+ npm run build
47
+ ```
48
+ 2. **Linting**: Static analysis to ensure code consistency.
49
+ ```bash
50
+ npm run lint
51
+ ```
52
+
53
+ ## đź“– **Component Principles**
54
+
55
+ * **Accessibility First**: Every component is designed with **ARIA compliance** and keyboard navigation in mind.
56
+ * **Performance**: Zero-runtime overhead by leveraging **Tailwind CSS 4** and optimized build steps.
57
+ * **Extensibility**: Components use the **composition pattern**, allowing consumers to extend functionality via props and className merging.
package/dist/index.cjs ADDED
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!u.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=g(e,o))||a.enumerable});return t};var y=t=>h(n({},"__esModule",{value:!0}),t);var f={};x(f,{Button:()=>v});module.exports=y(f);var s=require("react/jsx-runtime"),v=({children:t,variant:e="primary",size:r="md",isLoading:a=!1,className:o="",disabled:i,...c})=>{let l="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",d={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},m={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},b=`${l} ${d[e]} ${m[r]} ${o}`;return(0,s.jsx)("button",{className:b,disabled:i||a,...c,children:a?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,s.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,s.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):t})};0&&(module.exports={Button});
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/components/Button.tsx"],"sourcesContent":["export * from './components/Button'","import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,IAAA,eAAAC,EAAAH,GC+CU,IAAAI,EAAA,6BArCGC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,SACE,OAAC,UACC,UAAWM,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,KACC,QAAC,QAAK,UAAU,0BACd,qBAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,oBAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,KACxG,OAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAH,EAEJ,CAEJ","names":["index_exports","__export","Button","__toCommonJS","import_jsx_runtime","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ children: ReactNode;
6
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
7
+ size?: 'sm' | 'md' | 'lg';
8
+ isLoading?: boolean;
9
+ }
10
+ declare const Button: ({ children, variant, size, isLoading, className, disabled, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Button, type ButtonProps };
@@ -0,0 +1,12 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
3
+
4
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
5
+ children: ReactNode;
6
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
7
+ size?: 'sm' | 'md' | 'lg';
8
+ isLoading?: boolean;
9
+ }
10
+ declare const Button: ({ children, variant, size, isLoading, className, disabled, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
11
+
12
+ export { Button, type ButtonProps };
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";var g=({children:s,variant:r="primary",size:a="md",isLoading:t=!1,className:n="",disabled:i,...c})=>{let l="inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50",d={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-100 text-gray-900 hover:bg-gray-200",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"hover:bg-gray-100 text-gray-700"},m={sm:"h-8 px-3 text-xs",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},b=`${l} ${d[r]} ${m[a]} ${n}`;return e("button",{className:b,disabled:i||t,...c,children:t?o("span",{className:"flex items-center gap-2",children:[o("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Loading..."]}):s})};export{g as Button};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Button.tsx"],"sourcesContent":["import { ButtonHTMLAttributes, ReactNode } from 'react';\n\n// A interface estende ButtonHTMLAttributes para incluir onClick, disabled, className, etc.\nexport interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n children: ReactNode;\n variant?: 'primary' | 'secondary' | 'danger' | 'ghost';\n size?: 'sm' | 'md' | 'lg';\n isLoading?: boolean;\n}\n\nexport const Button = ({\n children,\n variant = 'primary',\n size = 'md',\n isLoading = false,\n className = '',\n disabled,\n ...props // Repassa todas as outras propriedades nativas (como onClick)\n}: ButtonProps) => {\n \n // Definição manual das classes caso não esteja usando uma lib de variants ainda\n const baseStyles = \"inline-flex items-center justify-center rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50\";\n \n const variants = {\n primary: \"bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"bg-gray-100 text-gray-900 hover:bg-gray-200\",\n danger: \"bg-red-600 text-white hover:bg-red-700\",\n ghost: \"hover:bg-gray-100 text-gray-700\",\n };\n\n const sizes = {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-10 px-4 text-sm\",\n lg: \"h-12 px-6 text-base\",\n };\n\n // Combinação das classes (recomendo usar a lib 'clsx' ou 'tailwind-merge' futuramente)\n const combinedClasses = `${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`;\n\n return (\n <button\n className={combinedClasses}\n disabled={disabled || isLoading} // O botão fica desativado se estiver carregando\n {...props} // Aplica o onClick e outros atributos passados\n >\n {isLoading ? (\n <span className=\"flex items-center gap-2\">\n <svg className=\"animate-spin h-4 w-4\" viewBox=\"0 0 24 24\">\n <circle className=\"opacity-25\" cx=\"12\" cy=\"12\" r=\"10\" stroke=\"currentColor\" strokeWidth=\"4\" fill=\"none\" />\n <path className=\"opacity-75\" fill=\"currentColor\" d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\" />\n </svg>\n Loading...\n </span>\n ) : (\n children\n )}\n </button>\n );\n};"],"mappings":"AA+CU,OACE,OAAAA,EADF,QAAAC,MAAA,oBArCH,IAAMC,EAAS,CAAC,CACrB,SAAAC,EACA,QAAAC,EAAU,UACV,KAAAC,EAAO,KACP,UAAAC,EAAY,GACZ,UAAAC,EAAY,GACZ,SAAAC,EACA,GAAGC,CACL,IAAmB,CAGjB,IAAMC,EAAa,oLAEbC,EAAW,CACf,QAAS,2CACT,UAAW,8CACX,OAAQ,yCACR,MAAO,iCACT,EAEMC,EAAQ,CACZ,GAAI,mBACJ,GAAI,oBACJ,GAAI,qBACN,EAGMC,EAAkB,GAAGH,CAAU,IAAIC,EAASP,CAAO,CAAC,IAAIQ,EAAMP,CAAI,CAAC,IAAIE,CAAS,GAEtF,OACEP,EAAC,UACC,UAAWa,EACX,SAAUL,GAAYF,EACrB,GAAGG,EAEH,SAAAH,EACCL,EAAC,QAAK,UAAU,0BACd,UAAAA,EAAC,OAAI,UAAU,uBAAuB,QAAQ,YAC5C,UAAAD,EAAC,UAAO,UAAU,aAAa,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,OAAO,eAAe,YAAY,IAAI,KAAK,OAAO,EACxGA,EAAC,QAAK,UAAU,aAAa,KAAK,eAAe,EAAE,kHAAkH,GACvK,EAAM,cAER,EAEAG,EAEJ,CAEJ","names":["jsx","jsxs","Button","children","variant","size","isLoading","className","disabled","props","baseStyles","variants","sizes","combinedClasses"]}
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@vtspecian/ui-core-design-system",
3
+ "version": "0.1.0",
4
+ "description": "A scalable UI Design System built with React, Tailwind CSS and TypeScript.",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./styles.css": "./dist/index.css"
19
+ },
20
+ "scripts": {
21
+ "dev": "tsup src/index.ts --format cjs,esm --watch --dts --clean",
22
+ "build": "tsup src/index.ts --format cjs,esm --minify --clean --dts",
23
+ "lint": "tsc",
24
+ "test": "vitest run",
25
+ "test:watch": "vitest",
26
+ "storybook": "storybook dev -p 6006",
27
+ "build-storybook": "storybook build"
28
+ },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/victorts1991/ui-core-design-system.git"
32
+ },
33
+ "author": "Victor Toupitzen Specian",
34
+ "license": "MIT",
35
+ "publishConfig": {
36
+ "access": "public"
37
+ },
38
+ "dependencies": {
39
+ "clsx": "^2.1.1",
40
+ "tailwind-merge": "^3.4.0"
41
+ },
42
+ "devDependencies": {
43
+ "@storybook/addon-essentials": "^8.6.15",
44
+ "@storybook/addon-interactions": "^8.6.15",
45
+ "@storybook/addon-links": "^8.6.15",
46
+ "@storybook/addon-onboarding": "^8.6.15",
47
+ "@storybook/react-vite": "^8.6.15",
48
+ "@storybook/test": "^8.6.15",
49
+ "@tailwindcss/vite": "^4.1.18",
50
+ "@testing-library/jest-dom": "^6.9.1",
51
+ "@testing-library/react": "^16.3.1",
52
+ "@testing-library/user-event": "^14.6.1",
53
+ "@types/react": "^19.2.7",
54
+ "@types/react-dom": "^19.2.3",
55
+ "@vitejs/plugin-react": "^5.1.2",
56
+ "autoprefixer": "^10.4.23",
57
+ "jsdom": "^27.3.0",
58
+ "postcss": "^8.5.6",
59
+ "react": "^19.2.3",
60
+ "react-dom": "^19.2.3",
61
+ "storybook": "^8.6.15",
62
+ "tailwindcss": "^4.1.18",
63
+ "tsup": "^8.5.1",
64
+ "typescript": "^5.9.3",
65
+ "vite": "^6.4.1",
66
+ "vitest": "^4.0.16"
67
+ },
68
+ "peerDependencies": {
69
+ "react": "^18.0.0 || ^19.0.0",
70
+ "react-dom": "^18.0.0 || ^19.0.0"
71
+ }
72
+ }