dwv-ui 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,99 @@
1
+ # @dwv/ui
2
+
3
+ Design System da DWV - Componentes React com Tailwind CSS.
4
+
5
+ ## Instalação
6
+
7
+ ```bash
8
+ npm install @dwv/ui
9
+ ```
10
+
11
+ ## Uso
12
+
13
+ ```tsx
14
+ import { Button } from '@dwv/ui'
15
+ import '@dwv/ui/styles.css'
16
+
17
+ const App = () => (
18
+ <Button variant="primary" size="md">
19
+ Click me
20
+ </Button>
21
+ )
22
+ ```
23
+
24
+ ## Componentes disponíveis
25
+
26
+ ### Actions
27
+ - `Button` - Botão com variantes (primary, secondary, outline, ghost, link)
28
+
29
+ ### Forms (em breve)
30
+ - `Input`
31
+ - `Select`
32
+ - `Checkbox`
33
+ - `Radio`
34
+
35
+ ### Feedback (em breve)
36
+ - `Toast`
37
+ - `Alert`
38
+ - `Skeleton`
39
+
40
+ ### Display (em breve)
41
+ - `Badge`
42
+ - `Avatar`
43
+ - `Table`
44
+
45
+ ### Overlays (em breve)
46
+ - `Modal`
47
+ - `Drawer`
48
+ - `Popover`
49
+
50
+ ## Desenvolvimento
51
+
52
+ ```bash
53
+ # Instalar dependências
54
+ npm install
55
+
56
+ # Build
57
+ npm run build
58
+
59
+ # Watch mode
60
+ npm run dev
61
+
62
+ # Type check
63
+ npm run typecheck
64
+ ```
65
+
66
+ ## Publicação
67
+
68
+ ```bash
69
+ # Build e publicar
70
+ npm publish
71
+ ```
72
+
73
+ ## Estrutura
74
+
75
+ ```
76
+ src/
77
+ ├── components/
78
+ │ ├── actions/ # Button, IconButton, Link
79
+ │ ├── forms/ # Input, Select, Checkbox
80
+ │ ├── feedback/ # Toast, Alert, Skeleton
81
+ │ ├── layout/ # Container, Grid, Stack
82
+ │ ├── display/ # Badge, Avatar, Table
83
+ │ └── overlays/ # Modal, Drawer, Popover
84
+ ├── lib/
85
+ │ └── cn.ts # Função de merge de classes
86
+ ├── styles/
87
+ │ └── theme.css # Estilos base e tema
88
+ └── index.ts # Barrel export
89
+ ```
90
+
91
+ ## Guidelines
92
+
93
+ A pasta `guidelines/` contém documentação para o Figma Make entender como usar os componentes corretamente.
94
+
95
+ ## Padrões
96
+
97
+ Este pacote segue os padrões definidos em:
98
+ - `docs/standards/frontend/STANDARDS.md`
99
+ - `docs/standards/frontend/ARCHITECTURE.md`
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { VariantProps } from 'class-variance-authority';
3
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
4
+ import * as class_variance_authority_types from 'class-variance-authority/types';
5
+
6
+ declare const buttonVariants: (props?: ({
7
+ variant?: "primary" | "secondary" | "outline" | "ghost" | "link" | "destructive" | null | undefined;
8
+ size?: "sm" | "md" | "lg" | "icon" | null | undefined;
9
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
10
+
11
+ type Props = ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
12
+ children: ReactNode;
13
+ };
14
+ declare const Button: ({ children, variant, size, className, ...props }: Props) => react_jsx_runtime.JSX.Element;
15
+
16
+ export { Button, type Props as ButtonProps, buttonVariants };
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { cva, cx } from 'class-variance-authority';
3
+ import { twMerge } from 'tailwind-merge';
4
+ import { jsx } from 'react/jsx-runtime';
5
+
6
+ // src/lib/cn.ts
7
+ var cn = (...classes) => twMerge(cx(classes));
8
+ var buttonVariants = cva(
9
+ "inline-flex items-center justify-center gap-2 rounded-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ primary: "bg-brand-600 text-white hover:bg-brand-700 active:bg-brand-800",
14
+ secondary: "bg-neutral-100 text-neutral-900 hover:bg-neutral-200 active:bg-neutral-300",
15
+ outline: "border border-neutral-300 bg-transparent text-neutral-900 hover:bg-neutral-50 active:bg-neutral-100",
16
+ ghost: "bg-transparent text-neutral-900 hover:bg-neutral-100 active:bg-neutral-200",
17
+ link: "bg-transparent text-brand-600 underline-offset-4 hover:underline",
18
+ destructive: "bg-brand-600 text-white hover:bg-brand-700 active:bg-brand-800"
19
+ },
20
+ size: {
21
+ sm: "h-8 px-3 text-sm",
22
+ md: "h-10 px-4 text-sm",
23
+ lg: "h-12 px-6 text-base",
24
+ icon: "h-10 w-10"
25
+ }
26
+ },
27
+ defaultVariants: {
28
+ variant: "primary",
29
+ size: "md"
30
+ }
31
+ }
32
+ );
33
+ var Button = ({ children, variant, size, className, ...props }) => /* @__PURE__ */ jsx("button", { className: cn(buttonVariants({ variant, size }), className), ...props, children });
34
+
35
+ export { Button, buttonVariants };
36
+ //# sourceMappingURL=index.js.map
37
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/cn.ts","../src/ui/actions/Button/styles/variants.ts","../src/ui/actions/Button/index.tsx"],"names":[],"mappings":";;;;;AAKO,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,OAAA,CAAQ,EAAA,CAAG,OAAO,CAAC,CAAA;ACH5D,IAAM,cAAA,GAAiB,GAAA;AAAA,EAC5B,kNAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,gEAAA;AAAA,QACT,SAAA,EAAW,4EAAA;AAAA,QACX,OAAA,EAAS,qGAAA;AAAA,QACT,KAAA,EAAO,4EAAA;AAAA,QACP,IAAA,EAAM,kEAAA;AAAA,QACN,WAAA,EAAa;AAAA,OACf;AAAA,MACA,IAAA,EAAM;AAAA,QACJ,EAAA,EAAI,kBAAA;AAAA,QACJ,EAAA,EAAI,mBAAA;AAAA,QACJ,EAAA,EAAI,qBAAA;AAAA,QACJ,IAAA,EAAM;AAAA;AACR,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS,SAAA;AAAA,MACT,IAAA,EAAM;AAAA;AACR;AAEJ;AChBA,IAAM,MAAA,GAAS,CAAC,EAAE,QAAA,EAAU,OAAA,EAAS,MAAM,SAAA,EAAW,GAAG,KAAA,EAAM,qBAC7D,GAAA,CAAC,QAAA,EAAA,EAAO,WAAW,EAAA,CAAG,cAAA,CAAe,EAAE,OAAA,EAAS,IAAA,EAAM,GAAG,SAAS,CAAA,EAAI,GAAG,KAAA,EACtE,QAAA,EACH","file":"index.js","sourcesContent":["import { cx } from 'class-variance-authority'\nimport { twMerge } from 'tailwind-merge'\n\ntype ClassValue = string | number | boolean | undefined | null | ClassValue[]\n\nexport const cn = (...classes: ClassValue[]) => twMerge(cx(classes))\n","import { cva } from 'class-variance-authority'\n\nexport const buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 rounded-sm font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n primary: 'bg-brand-600 text-white hover:bg-brand-700 active:bg-brand-800',\n secondary: 'bg-neutral-100 text-neutral-900 hover:bg-neutral-200 active:bg-neutral-300',\n outline: 'border border-neutral-300 bg-transparent text-neutral-900 hover:bg-neutral-50 active:bg-neutral-100',\n ghost: 'bg-transparent text-neutral-900 hover:bg-neutral-100 active:bg-neutral-200',\n link: 'bg-transparent text-brand-600 underline-offset-4 hover:underline',\n destructive: 'bg-brand-600 text-white hover:bg-brand-700 active:bg-brand-800'\n },\n size: {\n sm: 'h-8 px-3 text-sm',\n md: 'h-10 px-4 text-sm',\n lg: 'h-12 px-6 text-base',\n icon: 'h-10 w-10'\n }\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md'\n }\n }\n)\n","import { type VariantProps } from 'class-variance-authority'\nimport { type ButtonHTMLAttributes, type ReactNode } from 'react'\nimport { cn } from '../../../lib/cn'\nimport { buttonVariants } from './styles/variants'\n\ntype Props = ButtonHTMLAttributes<HTMLButtonElement> &\n VariantProps<typeof buttonVariants> & {\n children: ReactNode\n }\n\nconst Button = ({ children, variant, size, className, ...props }: Props) => (\n <button className={cn(buttonVariants({ variant, size }), className)} {...props}>\n {children}\n </button>\n)\n\nexport { Button, buttonVariants }\nexport type { Props as ButtonProps }\n"]}
package/dist/lib.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ type ClassValue = string | number | boolean | undefined | null | ClassValue[];
2
+ declare const cn: (...classes: ClassValue[]) => string;
3
+
4
+ export { cn };
package/dist/lib.js ADDED
@@ -0,0 +1,9 @@
1
+ import { cx } from 'class-variance-authority';
2
+ import { twMerge } from 'tailwind-merge';
3
+
4
+ // src/lib/cn.ts
5
+ var cn = (...classes) => twMerge(cx(classes));
6
+
7
+ export { cn };
8
+ //# sourceMappingURL=lib.js.map
9
+ //# sourceMappingURL=lib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/cn.ts"],"names":[],"mappings":";;;;AAKO,IAAM,KAAK,CAAA,GAAI,OAAA,KAA0B,OAAA,CAAQ,EAAA,CAAG,OAAO,CAAC","file":"lib.js","sourcesContent":["import { cx } from 'class-variance-authority'\nimport { twMerge } from 'tailwind-merge'\n\ntype ClassValue = string | number | boolean | undefined | null | ClassValue[]\n\nexport const cn = (...classes: ClassValue[]) => twMerge(cx(classes))\n"]}
@@ -0,0 +1,152 @@
1
+ import { Config } from 'tailwindcss';
2
+
3
+ declare const colors: {
4
+ readonly brand: {
5
+ readonly 100: "#ffdddd";
6
+ readonly 200: "#ffc0c0";
7
+ readonly 300: "#ff9494";
8
+ readonly 400: "#ff5757";
9
+ readonly 500: "#ff2323";
10
+ readonly 600: "#d70000";
11
+ readonly 700: "#b10303";
12
+ readonly 800: "#920A0A";
13
+ readonly 900: "#500000";
14
+ };
15
+ readonly neutral: {
16
+ readonly 0: "#ffffff";
17
+ readonly 50: "#F9F9FA";
18
+ readonly 100: "#F5F5F6";
19
+ readonly 200: "#E6E6E7";
20
+ readonly 300: "#CFCFD2";
21
+ readonly 400: "#AEADB3";
22
+ readonly 500: "#85848C";
23
+ readonly 600: "#6A6971";
24
+ readonly 700: "#5B5A60";
25
+ readonly 800: "#4D4C51";
26
+ readonly 900: "#444347";
27
+ readonly 1000: "#363538";
28
+ };
29
+ readonly dark: {
30
+ readonly 100: "#2C2C2E";
31
+ readonly 200: "#202021";
32
+ readonly 300: "#161618";
33
+ };
34
+ readonly green: {
35
+ readonly 100: "#DFF9E2";
36
+ readonly 200: "#C1F1C7";
37
+ readonly 300: "#91E49B";
38
+ readonly 400: "#5ACE69";
39
+ readonly 500: "#33B444";
40
+ readonly 600: "#28A138";
41
+ readonly 700: "#20752C";
42
+ readonly 800: "#1B4C22";
43
+ readonly 900: "#092A0F";
44
+ };
45
+ readonly yellow: {
46
+ readonly 100: "#FFFDC5";
47
+ readonly 200: "#FFFA87";
48
+ readonly 300: "#FFF148";
49
+ readonly 400: "#FFE31E";
50
+ readonly 500: "#FCC404";
51
+ readonly 600: "#E69D00";
52
+ readonly 700: "#b96d04";
53
+ };
54
+ readonly orange: {
55
+ readonly 100: "#FFEDD3";
56
+ readonly 200: "#FFD8A5";
57
+ readonly 300: "#FFBB6D";
58
+ readonly 400: "#FF9232";
59
+ readonly 500: "#FF720A";
60
+ readonly 600: "#F05906";
61
+ readonly 700: "#C74207";
62
+ };
63
+ readonly blue: {
64
+ readonly 100: "#E0EFFE";
65
+ readonly 200: "#BADFFD";
66
+ readonly 300: "#7CC6FD";
67
+ readonly 400: "#37AAF9";
68
+ readonly 500: "#0D8FEA";
69
+ readonly 600: "#0172CB";
70
+ readonly 700: "#0259A2";
71
+ readonly 800: "#0B406F";
72
+ readonly 900: "#082849";
73
+ };
74
+ readonly pink: {
75
+ readonly 100: "#FDE4F8";
76
+ readonly 500: "#F479D8";
77
+ readonly 700: "#D025B7";
78
+ };
79
+ readonly overlay: {
80
+ readonly 100: "#0A0A0CD9";
81
+ };
82
+ };
83
+ declare const borderRadius: {
84
+ readonly none: "0";
85
+ readonly sm: "0.3125rem";
86
+ readonly md: "0.625rem";
87
+ readonly lg: "0.9375rem";
88
+ readonly all: "50%";
89
+ readonly full: "50%";
90
+ };
91
+ declare const lineHeight: {
92
+ readonly none: "1";
93
+ readonly tight: "1.2";
94
+ readonly normal: "1.5";
95
+ };
96
+ declare const screens: {
97
+ readonly sm: "30em";
98
+ readonly md: "48em";
99
+ readonly lg: "62em";
100
+ readonly xl: "80em";
101
+ readonly '2xl': "96em";
102
+ readonly '3xl': "120em";
103
+ };
104
+ declare const keyframes: {
105
+ readonly 'fade-in': {
106
+ readonly from: {
107
+ readonly opacity: "0";
108
+ };
109
+ readonly to: {
110
+ readonly opacity: "1";
111
+ };
112
+ };
113
+ readonly 'fade-out': {
114
+ readonly from: {
115
+ readonly opacity: "1";
116
+ };
117
+ readonly to: {
118
+ readonly opacity: "0";
119
+ };
120
+ };
121
+ readonly 'scale-in': {
122
+ readonly from: {
123
+ readonly opacity: "0";
124
+ readonly transform: "scale(0.95)";
125
+ };
126
+ readonly to: {
127
+ readonly opacity: "1";
128
+ readonly transform: "scale(1)";
129
+ };
130
+ };
131
+ readonly 'scale-out': {
132
+ readonly from: {
133
+ readonly opacity: "1";
134
+ readonly transform: "scale(1)";
135
+ };
136
+ readonly to: {
137
+ readonly opacity: "0";
138
+ readonly transform: "scale(0.95)";
139
+ };
140
+ };
141
+ };
142
+ declare const animations: {
143
+ readonly 'fade-in': "fade-in 150ms ease-out";
144
+ readonly 'fade-out': "fade-out 150ms ease-in";
145
+ readonly 'scale-in': "scale-in 150ms ease-out";
146
+ readonly 'scale-out': "scale-out 150ms ease-in";
147
+ };
148
+ declare const spacing: Record<number, string>;
149
+
150
+ declare const dwvPreset: Partial<Config>;
151
+
152
+ export { animations, borderRadius, colors, dwvPreset, keyframes, lineHeight, screens, spacing };
package/dist/theme.js ADDED
@@ -0,0 +1,152 @@
1
+ // src/theme/tokens.ts
2
+ var colors = {
3
+ brand: {
4
+ 100: "#ffdddd",
5
+ 200: "#ffc0c0",
6
+ 300: "#ff9494",
7
+ 400: "#ff5757",
8
+ 500: "#ff2323",
9
+ 600: "#d70000",
10
+ 700: "#b10303",
11
+ 800: "#920A0A",
12
+ 900: "#500000"
13
+ },
14
+ neutral: {
15
+ 0: "#ffffff",
16
+ 50: "#F9F9FA",
17
+ 100: "#F5F5F6",
18
+ 200: "#E6E6E7",
19
+ 300: "#CFCFD2",
20
+ 400: "#AEADB3",
21
+ 500: "#85848C",
22
+ 600: "#6A6971",
23
+ 700: "#5B5A60",
24
+ 800: "#4D4C51",
25
+ 900: "#444347",
26
+ 1e3: "#363538"
27
+ },
28
+ dark: {
29
+ 100: "#2C2C2E",
30
+ 200: "#202021",
31
+ 300: "#161618"
32
+ },
33
+ green: {
34
+ 100: "#DFF9E2",
35
+ 200: "#C1F1C7",
36
+ 300: "#91E49B",
37
+ 400: "#5ACE69",
38
+ 500: "#33B444",
39
+ 600: "#28A138",
40
+ 700: "#20752C",
41
+ 800: "#1B4C22",
42
+ 900: "#092A0F"
43
+ },
44
+ yellow: {
45
+ 100: "#FFFDC5",
46
+ 200: "#FFFA87",
47
+ 300: "#FFF148",
48
+ 400: "#FFE31E",
49
+ 500: "#FCC404",
50
+ 600: "#E69D00",
51
+ 700: "#b96d04"
52
+ },
53
+ orange: {
54
+ 100: "#FFEDD3",
55
+ 200: "#FFD8A5",
56
+ 300: "#FFBB6D",
57
+ 400: "#FF9232",
58
+ 500: "#FF720A",
59
+ 600: "#F05906",
60
+ 700: "#C74207"
61
+ },
62
+ blue: {
63
+ 100: "#E0EFFE",
64
+ 200: "#BADFFD",
65
+ 300: "#7CC6FD",
66
+ 400: "#37AAF9",
67
+ 500: "#0D8FEA",
68
+ 600: "#0172CB",
69
+ 700: "#0259A2",
70
+ 800: "#0B406F",
71
+ 900: "#082849"
72
+ },
73
+ pink: {
74
+ 100: "#FDE4F8",
75
+ 500: "#F479D8",
76
+ 700: "#D025B7"
77
+ },
78
+ overlay: {
79
+ 100: "#0A0A0CD9"
80
+ }
81
+ };
82
+ var borderRadius = {
83
+ none: "0",
84
+ sm: "0.3125rem",
85
+ md: "0.625rem",
86
+ lg: "0.9375rem",
87
+ all: "50%",
88
+ full: "50%"
89
+ };
90
+ var lineHeight = {
91
+ none: "1",
92
+ tight: "1.2",
93
+ normal: "1.5"
94
+ };
95
+ var screens = {
96
+ sm: "30em",
97
+ md: "48em",
98
+ lg: "62em",
99
+ xl: "80em",
100
+ "2xl": "96em",
101
+ "3xl": "120em"
102
+ };
103
+ var keyframes = {
104
+ "fade-in": {
105
+ from: { opacity: "0" },
106
+ to: { opacity: "1" }
107
+ },
108
+ "fade-out": {
109
+ from: { opacity: "1" },
110
+ to: { opacity: "0" }
111
+ },
112
+ "scale-in": {
113
+ from: { opacity: "0", transform: "scale(0.95)" },
114
+ to: { opacity: "1", transform: "scale(1)" }
115
+ },
116
+ "scale-out": {
117
+ from: { opacity: "1", transform: "scale(1)" },
118
+ to: { opacity: "0", transform: "scale(0.95)" }
119
+ }
120
+ };
121
+ var animations = {
122
+ "fade-in": "fade-in 150ms ease-out",
123
+ "fade-out": "fade-out 150ms ease-in",
124
+ "scale-in": "scale-in 150ms ease-out",
125
+ "scale-out": "scale-out 150ms ease-in"
126
+ };
127
+ var spacing = Array.from({ length: 100 }, (_, index) => index * 4).reduce((acc, value) => {
128
+ acc[value] = `${value / 4}rem`;
129
+ return acc;
130
+ }, {});
131
+
132
+ // src/theme/preset.ts
133
+ var dwvPreset = {
134
+ theme: {
135
+ extend: {
136
+ colors,
137
+ borderRadius,
138
+ fontFamily: {
139
+ roboto: ["Roboto", "sans-serif"]
140
+ },
141
+ lineHeight,
142
+ screens,
143
+ keyframes,
144
+ animations,
145
+ spacing
146
+ }
147
+ }
148
+ };
149
+
150
+ export { animations, borderRadius, colors, dwvPreset, keyframes, lineHeight, screens, spacing };
151
+ //# sourceMappingURL=theme.js.map
152
+ //# sourceMappingURL=theme.js.map
@@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AE;;;AC3HE,IAAM,SAAA,GAA6B;AAAA,EACxC,KAAA,EAAO;AAAA,IACL,MAAA,EAAQ;AAAA,MACN,MAAA;AAAA,MACA,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,MAAA,EAAQ,CAAC,QAAA,EAAU,YAAY;AAAA,OACjC;AAAA,MACA,UAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA;AACF;AAEJ","file":"theme.js","sourcesContent":["const colors = {\n brand: {\n 100: '#ffdddd',\n 200: '#ffc0c0',\n 300: '#ff9494',\n 400: '#ff5757',\n 500: '#ff2323',\n 600: '#d70000',\n 700: '#b10303',\n 800: '#920A0A',\n 900: '#500000'\n },\n neutral: {\n 0: '#ffffff',\n 50: '#F9F9FA',\n 100: '#F5F5F6',\n 200: '#E6E6E7',\n 300: '#CFCFD2',\n 400: '#AEADB3',\n 500: '#85848C',\n 600: '#6A6971',\n 700: '#5B5A60',\n 800: '#4D4C51',\n 900: '#444347',\n 1000: '#363538'\n },\n dark: {\n 100: '#2C2C2E',\n 200: '#202021',\n 300: '#161618'\n },\n green: {\n 100: '#DFF9E2',\n 200: '#C1F1C7',\n 300: '#91E49B',\n 400: '#5ACE69',\n 500: '#33B444',\n 600: '#28A138',\n 700: '#20752C',\n 800: '#1B4C22',\n 900: '#092A0F'\n },\n yellow: {\n 100: '#FFFDC5',\n 200: '#FFFA87',\n 300: '#FFF148',\n 400: '#FFE31E',\n 500: '#FCC404',\n 600: '#E69D00',\n 700: '#b96d04'\n },\n orange: {\n 100: '#FFEDD3',\n 200: '#FFD8A5',\n 300: '#FFBB6D',\n 400: '#FF9232',\n 500: '#FF720A',\n 600: '#F05906',\n 700: '#C74207'\n },\n blue: {\n 100: '#E0EFFE',\n 200: '#BADFFD',\n 300: '#7CC6FD',\n 400: '#37AAF9',\n 500: '#0D8FEA',\n 600: '#0172CB',\n 700: '#0259A2',\n 800: '#0B406F',\n 900: '#082849'\n },\n pink: {\n 100: '#FDE4F8',\n 500: '#F479D8',\n 700: '#D025B7'\n },\n overlay: {\n 100: '#0A0A0CD9'\n }\n} as const\n\nconst borderRadius = {\n none: '0',\n sm: '0.3125rem',\n md: '0.625rem',\n lg: '0.9375rem',\n all: '50%',\n full: '50%'\n } as const\n\nconst lineHeight = {\n none: '1',\n tight: '1.2',\n normal: '1.5'\n} as const\n\nconst screens = {\n sm: '30em',\n md: '48em',\n lg: '62em',\n xl: '80em',\n '2xl': '96em',\n '3xl': '120em'\n} as const\n\nconst keyframes = {\n 'fade-in': {\n from: { opacity: '0' },\n to: { opacity: '1' }\n },\n 'fade-out': {\n from: { opacity: '1' },\n to: { opacity: '0' }\n },\n 'scale-in': {\n from: { opacity: '0', transform: 'scale(0.95)' },\n to: { opacity: '1', transform: 'scale(1)' }\n },\n 'scale-out': {\n from: { opacity: '1', transform: 'scale(1)' },\n to: { opacity: '0', transform: 'scale(0.95)' }\n }\n} as const\n\nconst animations = {\n 'fade-in': 'fade-in 150ms ease-out',\n 'fade-out': 'fade-out 150ms ease-in',\n 'scale-in': 'scale-in 150ms ease-out',\n 'scale-out': 'scale-out 150ms ease-in'\n} as const\n\nconst spacing = Array.from({ length: 100 }, (_, index) => index * 4).reduce<Record<number, string>>((acc, value) => {\n acc[value] = `${value / 4}rem`\n return acc\n}, {})\n\nexport { animations, borderRadius, colors, keyframes, lineHeight, screens, spacing }\n","import type { Config } from 'tailwindcss'\nimport {\n animations,\n borderRadius,\n colors,\n keyframes,\n lineHeight,\n screens,\n spacing\n} from './tokens'\n\nexport const dwvPreset: Partial<Config> = {\n theme: {\n extend: {\n colors,\n borderRadius,\n fontFamily: {\n roboto: ['Roboto', 'sans-serif']\n },\n lineHeight,\n screens,\n keyframes,\n animations,\n spacing\n }\n }\n}\n"]}
@@ -0,0 +1,180 @@
1
+ # DWV Frontend Guidelines
2
+
3
+ Este arquivo serve como entry point para o Figma Make gerar código alinhado com os padrões do projeto DWV.
4
+
5
+ ## Arquivos de Referência
6
+
7
+ Sempre consultar os seguintes arquivos para contexto específico:
8
+
9
+ - `overview-components.md` - Estrutura e padrões de criação de componentes
10
+ - `overview-styling.md` - Sistema de estilização com CVA e Tailwind
11
+ - `overview-theme.md` - Tema do projeto (cores, espaçamentos, tipografia)
12
+
13
+ ---
14
+
15
+ ## Regras Gerais
16
+
17
+ ### Linguagem e Ferramentas
18
+
19
+ - **Linguagem:** TypeScript (strict mode)
20
+ - **Framework:** React 18+
21
+ - **Estilização:** Tailwind CSS + CVA (class-variance-authority)
22
+ - **Merge de classes:** Usar função `cn()` sempre
23
+ - **Primitivos** Usar componentes baseados no `shadcn`
24
+
25
+ ### Código Limpo
26
+
27
+ - Preferir layouts responsivos com flexbox e grid
28
+ - Evitar position absolute/fixed exceto quando estritamente necessário
29
+ - Manter arquivos pequenos e focados
30
+ - Separar helpers e componentes auxiliares em arquivos próprios
31
+
32
+ ### TypeScript
33
+
34
+ - `any` é proibido, usar `unknown` quando tipo é desconhecido
35
+ - Usar `type` para props, unions, estados
36
+ - Usar `interface` apenas para entidades de backend (com prefixo `I`)
37
+
38
+ ```typescript
39
+ // Props de componente - usa type
40
+ type ButtonProps = {
41
+ children: ReactNode;
42
+ variant?: "primary" | "outline";
43
+ };
44
+
45
+ // Entidade do backend - usa interface com I
46
+ interface IUser {
47
+ id: string;
48
+ name: string;
49
+ }
50
+ ```
51
+
52
+ ### Imports
53
+
54
+ Ordem de imports:
55
+
56
+ ```typescript
57
+ // 1. Externos (react, libs)
58
+ import { useState } from "react";
59
+ import { cva } from "class-variance-authority";
60
+
61
+ // 2. Internos/Projeto (usar aliases)
62
+ import { cn } from "@shared/lib";
63
+ import { Button } from "@shared/ui";
64
+
65
+ // 3. Relativos (mesmo módulo)
66
+ import { buttonVariants } from "./styles/variants";
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Padrões de Componente (Resumo)
72
+
73
+ Ver detalhes completos em `overview-components.md`.
74
+
75
+ ### Estrutura Básica
76
+
77
+ ```typescript
78
+ // 1. Imports
79
+ import { cn } from "@shared/lib";
80
+ import { buttonVariants } from "./styles/variants";
81
+
82
+ // 2. Types
83
+ type Props = {
84
+ children: ReactNode;
85
+ variant?: "primary" | "outline";
86
+ className?: string;
87
+ };
88
+
89
+ // 3. Componente (arrow function)
90
+ const Button = ({ children, variant, className }: Props) => (
91
+ <button className={cn(buttonVariants({ variant }), className)}>
92
+ {children}
93
+ </button>
94
+ );
95
+
96
+ // 4. Export nomeado
97
+ export { Button };
98
+ ```
99
+
100
+ ### Regras
101
+
102
+ - Arrow functions sempre: `const Component = () => ...`
103
+ - Nunca usar `React.FC`
104
+ - Nunca usar `function Component() {}`
105
+ - Props tipadas inline no arquivo ou em `types.ts`
106
+ - Export nomeado, nunca default
107
+
108
+ ---
109
+
110
+ ## Estilização (Resumo)
111
+
112
+ Ver detalhes completos em `overview-styling.md`.
113
+
114
+ ### CVA para Variantes
115
+
116
+ ```typescript
117
+ import { cva, type VariantProps } from "class-variance-authority";
118
+
119
+ const buttonVariants = cva(
120
+ "flex items-center justify-center rounded-sm font-medium", // base
121
+ {
122
+ variants: {
123
+ variant: {
124
+ primary: "bg-brand-600 text-white hover:bg-brand-700",
125
+ outline: "border border-neutral-400 bg-transparent",
126
+ },
127
+ size: {
128
+ sm: "h-8 px-3 text-sm",
129
+ md: "h-10 px-4",
130
+ lg: "h-12 px-6 text-lg",
131
+ },
132
+ },
133
+ defaultVariants: {
134
+ variant: "primary",
135
+ size: "md",
136
+ },
137
+ }
138
+ );
139
+ ```
140
+
141
+ ### cn() para Merge
142
+
143
+ Sempre usar `cn()` para combinar classes:
144
+
145
+ ```typescript
146
+ <button className={cn(buttonVariants({ variant, size }), className)} />
147
+ ```
148
+
149
+ ---
150
+
151
+ ## Tema (Resumo)
152
+
153
+ Ver detalhes completos em `overview-theme.md`.
154
+
155
+ ### Cores Principais
156
+
157
+ | Token | Uso |
158
+ | ----------- | ----------------------- |
159
+ | `brand-*` | Cor primária (vermelho) |
160
+ | `neutral-*` | Tons de cinza |
161
+ | `green-*` | Sucesso |
162
+ | `yellow-*` | Aviso |
163
+ | `blue-*` | Informação |
164
+
165
+ ### Espaçamentos
166
+
167
+ Base de 4px. Usar escala: `1` (4px), `2` (8px), `3` (12px), `4` (16px), etc.
168
+
169
+ ### Border Radius
170
+
171
+ - `rounded-sm` = 5px
172
+ - `rounded-md` = 10px
173
+ - `rounded-lg` = 15px
174
+ - `rounded-full` = 50%
175
+
176
+ ---
177
+
178
+ ## Observações
179
+
180
+ Este guideline é otimizado para geração de código pelo Figma Make. O código gerado será posteriormente transferido e adaptado para o projeto real através de um processo de revisão.