@promptui-lib/core 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.
Files changed (40) hide show
  1. package/dist/index.d.ts +8 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +10 -0
  4. package/dist/tokens/borders.d.ts +31 -0
  5. package/dist/tokens/borders.d.ts.map +1 -0
  6. package/dist/tokens/borders.js +83 -0
  7. package/dist/tokens/colors.d.ts +23 -0
  8. package/dist/tokens/colors.d.ts.map +1 -0
  9. package/dist/tokens/colors.js +73 -0
  10. package/dist/tokens/index.d.ts +5 -0
  11. package/dist/tokens/index.d.ts.map +1 -0
  12. package/dist/tokens/index.js +4 -0
  13. package/dist/tokens/spacing.d.ts +23 -0
  14. package/dist/tokens/spacing.d.ts.map +1 -0
  15. package/dist/tokens/spacing.js +72 -0
  16. package/dist/tokens/typography.d.ts +41 -0
  17. package/dist/tokens/typography.d.ts.map +1 -0
  18. package/dist/tokens/typography.js +91 -0
  19. package/dist/types/ast.types.d.ts +123 -0
  20. package/dist/types/ast.types.d.ts.map +1 -0
  21. package/dist/types/ast.types.js +5 -0
  22. package/dist/types/config.types.d.ts +115 -0
  23. package/dist/types/config.types.d.ts.map +1 -0
  24. package/dist/types/config.types.js +5 -0
  25. package/dist/types/figma.types.d.ts +157 -0
  26. package/dist/types/figma.types.d.ts.map +1 -0
  27. package/dist/types/figma.types.js +5 -0
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/index.js +3 -0
  31. package/dist/utils/classifiers.d.ts +34 -0
  32. package/dist/utils/classifiers.d.ts.map +1 -0
  33. package/dist/utils/classifiers.js +166 -0
  34. package/dist/utils/index.d.ts +3 -0
  35. package/dist/utils/index.d.ts.map +1 -0
  36. package/dist/utils/index.js +2 -0
  37. package/dist/utils/naming.d.ts +72 -0
  38. package/dist/utils/naming.d.ts.map +1 -0
  39. package/dist/utils/naming.js +126 -0
  40. package/package.json +54 -0
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Configuration Types
3
+ * Tipos para configuração do PromptUI
4
+ */
5
+ export interface IPromptUIConfig {
6
+ /** Configuração do Figma */
7
+ figma: IFigmaConfig;
8
+ /** Configuração de output */
9
+ output: IOutputConfig;
10
+ /** Customização de tokens */
11
+ tokens?: ITokensConfig;
12
+ /** Mapeamento de componentes */
13
+ components?: IComponentsConfig;
14
+ }
15
+ export interface IFigmaConfig {
16
+ /** Token de acesso pessoal do Figma */
17
+ token: string;
18
+ /** ID do arquivo Figma */
19
+ fileId: string;
20
+ /** Timeout para requisições (ms) */
21
+ timeout?: number;
22
+ }
23
+ /** Framework de UI suportado */
24
+ export type FrameworkType = 'react' | 'mui' | 'tailwind' | 'bootstrap';
25
+ export interface IOutputConfig {
26
+ /** Caminho base para componentes (ex: src/components) */
27
+ basePath: string;
28
+ /** Framework de UI a usar */
29
+ framework?: FrameworkType;
30
+ /** Formato de estilo: scss ou css (para framework=react) */
31
+ styleFormat?: 'scss' | 'css';
32
+ /** Usar CSS Modules (.module.scss) */
33
+ cssModules?: boolean;
34
+ /** Caminho para arquivo de variáveis SCSS */
35
+ variablesPath?: string;
36
+ /** Forçar sobrescrita de arquivos existentes */
37
+ forceOverwrite?: boolean;
38
+ }
39
+ export interface ITokensConfig {
40
+ /** Mapeamento de cores hex → nome do token */
41
+ colors?: Record<string, string>;
42
+ /** Mapeamento de spacing px → nome do token */
43
+ spacing?: Record<number, string>;
44
+ /** Mapeamento de radius px → nome do token */
45
+ radius?: Record<number, string>;
46
+ /** Mapeamento de font-size px → nome do token */
47
+ fontSize?: Record<number, string>;
48
+ /** Mapeamento de font-weight → nome do token */
49
+ fontWeight?: Record<number, string>;
50
+ /** Mapeamento de shadow → nome do token */
51
+ shadows?: Record<string, string>;
52
+ }
53
+ export interface IComponentsConfig {
54
+ /** Mapeamento de nomes do Figma → nome do componente */
55
+ nameMapping?: Record<string, string>;
56
+ /** Forçar camada para determinados componentes */
57
+ layerOverrides?: Record<string, 'atoms' | 'molecules' | 'organisms'>;
58
+ /** Componentes a ignorar */
59
+ ignore?: string[];
60
+ }
61
+ /**
62
+ * Request para geração de componente
63
+ */
64
+ export interface IGenerateRequest {
65
+ /** ID do node no Figma */
66
+ nodeId: string;
67
+ /** ID do arquivo (opcional se já configurado) */
68
+ fileId?: string;
69
+ /** Caminho de output (opcional, usa config se não informado) */
70
+ outputPath?: string;
71
+ /** Opções de geração */
72
+ options?: IGenerateOptions;
73
+ }
74
+ export interface IGenerateOptions {
75
+ /** Forçar camada específica */
76
+ layer?: 'atoms' | 'molecules' | 'organisms';
77
+ /** Framework de UI */
78
+ framework?: FrameworkType;
79
+ /** Sobrescrever arquivos existentes */
80
+ forceOverwrite?: boolean;
81
+ /** Gerar apenas preview (não escreve arquivos) */
82
+ preview?: boolean;
83
+ /** Nome customizado para o componente */
84
+ componentName?: string;
85
+ }
86
+ /**
87
+ * Response da geração
88
+ */
89
+ export interface IGenerateResponse {
90
+ /** Se a geração foi bem sucedida */
91
+ success: boolean;
92
+ /** Nome do componente gerado */
93
+ componentName: string;
94
+ /** Camada determinada */
95
+ layer: 'atoms' | 'molecules' | 'organisms';
96
+ /** Caminhos dos arquivos gerados */
97
+ files: {
98
+ tsx: string;
99
+ scss: string;
100
+ index: string;
101
+ };
102
+ /** Caminho base do output */
103
+ outputPath: string;
104
+ /** Código gerado (se preview=true) */
105
+ code?: {
106
+ tsx: string;
107
+ scss: string;
108
+ index: string;
109
+ };
110
+ /** Erros encontrados */
111
+ errors?: string[];
112
+ /** Warnings */
113
+ warnings?: string[];
114
+ }
115
+ //# sourceMappingURL=config.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.types.d.ts","sourceRoot":"","sources":["../../src/types/config.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,KAAK,EAAE,YAAY,CAAC;IAEpB,6BAA6B;IAC7B,MA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AU,EAAE,MAAM,CAAC;IAEnB,sCAAsC;IACtC,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IAEF,wBAAwB;IACxB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB,eAAe;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Configuration Types
3
+ * Tipos para configuração do PromptUI
4
+ */
5
+ export {};
@@ -0,0 +1,157 @@
1
+ /**
2
+ * Figma API Types
3
+ * Tipos para representar nodes do Figma
4
+ */
5
+ export type FigmaNodeType = 'DOCUMENT' | 'CANVAS' | 'FRAME' | 'GROUP' | 'COMPONENT' | 'COMPONENT_SET' | 'INSTANCE' | 'VECTOR' | 'BOOLEAN_OPERATION' | 'STAR' | 'LINE' | 'ELLIPSE' | 'REGULAR_POLYGON' | 'RECTANGLE' | 'TEXT' | 'SLICE' | 'SECTION';
6
+ export type AxisAlign = 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN' | 'BASELINE';
7
+ export type LayoutMode = 'NONE' | 'HORIZONTAL' | 'VERTICAL';
8
+ export type LayoutSizing = 'FIXED' | 'HUG' | 'FILL';
9
+ export type BlendMode = 'NORMAL' | 'DARKEN' | 'MULTIPLY' | 'LINEAR_BURN' | 'COLOR_BURN' | 'LIGHTEN' | 'SCREEN' | 'LINEAR_DODGE' | 'COLOR_DODGE' | 'OVERLAY' | 'SOFT_LIGHT' | 'HARD_LIGHT' | 'DIFFERENCE' | 'EXCLUSION' | 'HUE' | 'SATURATION' | 'COLOR' | 'LUMINOSITY';
10
+ export interface IColor {
11
+ r: number;
12
+ g: number;
13
+ b: number;
14
+ a: number;
15
+ }
16
+ export interface ISolidFill {
17
+ type: 'SOLID';
18
+ color: IColor;
19
+ opacity?: number;
20
+ blendMode?: BlendMode;
21
+ }
22
+ export interface IGradientFill {
23
+ type: 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND';
24
+ gradientStops: IGradientStop[];
25
+ opacity?: number;
26
+ }
27
+ export interface IGradientStop {
28
+ position: number;
29
+ color: IColor;
30
+ }
31
+ export interface IImageFill {
32
+ type: 'IMAGE';
33
+ imageRef: string;
34
+ scaleMode: 'FILL' | 'FIT' | 'CROP' | 'TILE';
35
+ opacity?: number;
36
+ }
37
+ export type IFill = ISolidFill | IGradientFill | IImageFill;
38
+ export interface IStroke {
39
+ type: 'SOLID';
40
+ color: IColor;
41
+ opacity?: number;
42
+ }
43
+ export interface IDropShadowEffect {
44
+ type: 'DROP_SHADOW';
45
+ color: IColor;
46
+ offset: {
47
+ x: number;
48
+ y: number;
49
+ };
50
+ radius: number;
51
+ spread?: number;
52
+ visible: boolean;
53
+ }
54
+ export interface IInnerShadowEffect {
55
+ type: 'INNER_SHADOW';
56
+ color: IColor;
57
+ offset: {
58
+ x: number;
59
+ y: number;
60
+ };
61
+ radius: number;
62
+ spread?: number;
63
+ visible: boolean;
64
+ }
65
+ export interface IBlurEffect {
66
+ type: 'LAYER_BLUR' | 'BACKGROUND_BLUR';
67
+ radius: number;
68
+ visible: boolean;
69
+ }
70
+ export type IEffect = IDropShadowEffect | IInnerShadowEffect | IBlurEffect;
71
+ export interface ITextStyle {
72
+ fontFamily: string;
73
+ fontWeight: number;
74
+ fontSize: number;
75
+ lineHeightPx?: number;
76
+ lineHeightPercent?: number;
77
+ letterSpacing?: number;
78
+ textAlignHorizontal?: 'LEFT' | 'CENTER' | 'RIGHT' | 'JUSTIFIED';
79
+ textAlignVertical?: 'TOP' | 'CENTER' | 'BOTTOM';
80
+ textDecoration?: 'NONE' | 'UNDERLINE' | 'STRIKETHROUGH';
81
+ textCase?: 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE';
82
+ }
83
+ export interface IConstraints {
84
+ vertical: 'TOP' | 'BOTTOM' | 'CENTER' | 'TOP_BOTTOM' | 'SCALE';
85
+ horizontal: 'LEFT' | 'RIGHT' | 'CENTER' | 'LEFT_RIGHT' | 'SCALE';
86
+ }
87
+ export interface IFigmaNode {
88
+ id: string;
89
+ name: string;
90
+ type: FigmaNodeType;
91
+ visible?: boolean;
92
+ children?: IFigmaNode[];
93
+ layoutMode?: LayoutMode;
94
+ primaryAxisAlignItems?: AxisAlign;
95
+ counterAxisAlignItems?: AxisAlign;
96
+ primaryAxisSizingMode?: 'FIXED' | 'AUTO';
97
+ counterAxisSizingMode?: 'FIXED' | 'AUTO';
98
+ itemSpacing?: number;
99
+ paddingLeft?: number;
100
+ paddingRight?: number;
101
+ paddingTop?: number;
102
+ paddingBottom?: number;
103
+ layoutWrap?: 'NO_WRAP' | 'WRAP';
104
+ absoluteBoundingBox?: {
105
+ x: number;
106
+ y: number;
107
+ width: number;
108
+ height: number;
109
+ };
110
+ layoutSizingHorizontal?: LayoutSizing;
111
+ layoutSizingVertical?: LayoutSizing;
112
+ minWidth?: number;
113
+ maxWidth?: number;
114
+ minHeight?: number;
115
+ maxHeight?: number;
116
+ constraints?: IConstraints;
117
+ fills?: IFill[];
118
+ strokes?: IStroke[];
119
+ strokeWeight?: number;
120
+ strokeAlign?: 'INSIDE' | 'OUTSIDE' | 'CENTER';
121
+ effects?: IEffect[];
122
+ cornerRadius?: number;
123
+ rectangleCornerRadii?: [number, number, number, number];
124
+ opacity?: number;
125
+ blendMode?: BlendMode;
126
+ clipsContent?: boolean;
127
+ characters?: string;
128
+ style?: ITextStyle;
129
+ componentId?: string;
130
+ componentProperties?: Record<string, IComponentProperty>;
131
+ }
132
+ export interface IComponentProperty {
133
+ type: 'BOOLEAN' | 'TEXT' | 'INSTANCE_SWAP' | 'VARIANT';
134
+ defaultValue: string | boolean;
135
+ variantOptions?: string[];
136
+ }
137
+ export interface IFigmaFile {
138
+ name: string;
139
+ lastModified: string;
140
+ version: string;
141
+ document: IFigmaNode;
142
+ components: Record<string, IFigmaComponent>;
143
+ styles: Record<string, IFigmaStyle>;
144
+ }
145
+ export interface IFigmaComponent {
146
+ key: string;
147
+ name: string;
148
+ description: string;
149
+ componentSetId?: string;
150
+ }
151
+ export interface IFigmaStyle {
152
+ key: string;
153
+ name: string;
154
+ styleType: 'FILL' | 'TEXT' | 'EFFECT' | 'GRID';
155
+ description: string;
156
+ }
157
+ //# sourceMappingURL=figma.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"figma.types.d.ts","sourceRoot":"","sources":["../../src/types/figma.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,aAAa,GACrB,UAAU,GACV,QAAQ,GACR,OAAO,GACP,OAAO,GACP,WAAW,GACX,eAAe,GACf,UAAU,GACV,QAAQ,GACR,mBAAmB,GACnB,MAAM,GACN,MAAM,GACN,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,MAAM,GACN,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,SAAS,GACjB,KAAK,GACL,QAAQ,GACR,KAAK,GACL,eAAe,GACf,UAAU,CAAC;AAEf,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAE5D,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;AAEpD,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,UAAU,GACV,aAAa,GACb,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,cAAc,GACd,aAAa,GACb,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,KAAK,GACL,YAAY,GACZ,OAAO,GACP,YAAY,CAAC;AAEjB,MAAM,WAAW,MAAM;IACrB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,UAAU;IACzB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AE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,UAAU,CAAC;IAGnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;IACvD,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,UAAU,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,WAAW,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Figma API Types
3
+ * Tipos para representar nodes do Figma
4
+ */
5
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './figma.types.js';
2
+ export * from './ast.types.js';
3
+ export * from './config.types.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './figma.types.js';
2
+ export * from './ast.types.js';
3
+ export * from './config.types.js';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Component Classifiers
3
+ * Funções para classificar componentes no Atomic Design
4
+ */
5
+ import type { IFigmaNode, ComponentLayer } from '../types/index.js';
6
+ /**
7
+ * Classifica um componente baseado no nome
8
+ */
9
+ export declare function classifyByName(name: string): ComponentLayer | null;
10
+ /**
11
+ * Conta a profundidade de um node (níveis de filhos)
12
+ */
13
+ export declare function countDepth(node: IFigmaNode): number;
14
+ /**
15
+ * Conta o número total de nodes descendentes
16
+ */
17
+ export declare function countDescendants(node: IFigmaNode): number;
18
+ /**
19
+ * Verifica se um node tem filhos complexos (não apenas texto/shapes)
20
+ */
21
+ export declare function hasComplexChildren(node: IFigmaNode): boolean;
22
+ /**
23
+ * Classifica um componente baseado na estrutura
24
+ */
25
+ export declare function classifyByStructure(node: IFigmaNode): ComponentLayer;
26
+ /**
27
+ * Classificação principal - combina nome + estrutura
28
+ */
29
+ export declare function classifyComponent(node: IFigmaNode, forceLayer?: ComponentLayer): ComponentLayer;
30
+ /**
31
+ * Retorna o path base para a camada
32
+ */
33
+ export declare function getLayerPath(layer: ComponentLayer): string;
34
+ //# sourceMappingURL=classifiers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classifiers.d.ts","sourceRoot":"","sources":["../../src/utils/classifiers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAsEpE;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAsBlE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAOnD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAQzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAY5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CAiBpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,EAChB,UAAU,CAAC,EAAE,cAAc,GAC1B,cAAc,CAchB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAE1D"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Component Classifiers
3
+ * Funções para classificar componentes no Atomic Design
4
+ */
5
+ /**
6
+ * Padrões de nome que indicam átomos
7
+ */
8
+ const ATOM_PATTERNS = [
9
+ /^button/i,
10
+ /^btn/i,
11
+ /^input/i,
12
+ /^textfield/i,
13
+ /^text-field/i,
14
+ /^checkbox/i,
15
+ /^radio/i,
16
+ /^toggle/i,
17
+ /^switch/i,
18
+ /^icon/i,
19
+ /^badge/i,
20
+ /^tag/i,
21
+ /^label/i,
22
+ /^avatar/i,
23
+ /^spinner/i,
24
+ /^loader/i,
25
+ /^divider/i,
26
+ /^separator/i,
27
+ ];
28
+ /**
29
+ * Padrões de nome que indicam moléculas
30
+ */
31
+ const MOLECULE_PATTERNS = [
32
+ /^card/i,
33
+ /^modal/i,
34
+ /^dialog/i,
35
+ /^dropdown/i,
36
+ /^select/i,
37
+ /^menu/i,
38
+ /^tooltip/i,
39
+ /^popover/i,
40
+ /^alert/i,
41
+ /^toast/i,
42
+ /^notification/i,
43
+ /^search/i,
44
+ /^navbar/i,
45
+ /^nav-bar/i,
46
+ /^tab/i,
47
+ /^breadcrumb/i,
48
+ /^pagination/i,
49
+ /^stepper/i,
50
+ /^accordion/i,
51
+ ];
52
+ /**
53
+ * Padrões de nome que indicam organismos
54
+ */
55
+ const ORGANISM_PATTERNS = [
56
+ /^form/i,
57
+ /^table/i,
58
+ /^list/i,
59
+ /^grid/i,
60
+ /^header/i,
61
+ /^footer/i,
62
+ /^sidebar/i,
63
+ /^section/i,
64
+ /^hero/i,
65
+ /^banner/i,
66
+ /^wizard/i,
67
+ /^step/i,
68
+ /^dashboard/i,
69
+ ];
70
+ /**
71
+ * Classifica um componente baseado no nome
72
+ */
73
+ export function classifyByName(name) {
74
+ const normalizedName = name.split('/')[0].trim();
75
+ for (const pattern of ATOM_PATTERNS) {
76
+ if (pattern.test(normalizedName)) {
77
+ return 'atoms';
78
+ }
79
+ }
80
+ for (const pattern of MOLECULE_PATTERNS) {
81
+ if (pattern.test(normalizedName)) {
82
+ return 'molecules';
83
+ }
84
+ }
85
+ for (const pattern of ORGANISM_PATTERNS) {
86
+ if (pattern.test(normalizedName)) {
87
+ return 'organisms';
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ /**
93
+ * Conta a profundidade de um node (níveis de filhos)
94
+ */
95
+ export function countDepth(node) {
96
+ if (!node.children || node.children.length === 0) {
97
+ return 0;
98
+ }
99
+ const childDepths = node.children.map(countDepth);
100
+ return 1 + Math.max(...childDepths);
101
+ }
102
+ /**
103
+ * Conta o número total de nodes descendentes
104
+ */
105
+ export function countDescendants(node) {
106
+ if (!node.children || node.children.length === 0) {
107
+ return 0;
108
+ }
109
+ return node.children.reduce((acc, child) => {
110
+ return acc + 1 + countDescendants(child);
111
+ }, 0);
112
+ }
113
+ /**
114
+ * Verifica se um node tem filhos complexos (não apenas texto/shapes)
115
+ */
116
+ export function hasComplexChildren(node) {
117
+ if (!node.children)
118
+ return false;
119
+ return node.children.some((child) => {
120
+ const isComplex = child.type === 'FRAME' ||
121
+ child.type === 'COMPONENT' ||
122
+ child.type === 'INSTANCE' ||
123
+ child.type === 'GROUP';
124
+ return isComplex && child.children && child.children.length > 0;
125
+ });
126
+ }
127
+ /**
128
+ * Classifica um componente baseado na estrutura
129
+ */
130
+ export function classifyByStructure(node) {
131
+ const depth = countDepth(node);
132
+ const descendants = countDescendants(node);
133
+ const hasComplex = hasComplexChildren(node);
134
+ // Átomo: pouca profundidade, poucos descendentes, sem filhos complexos
135
+ if (depth <= 2 && descendants <= 5 && !hasComplex) {
136
+ return 'atoms';
137
+ }
138
+ // Organismo: muita profundidade ou muitos descendentes
139
+ if (depth >= 4 || descendants >= 15) {
140
+ return 'organisms';
141
+ }
142
+ // Molécula: caso intermediário
143
+ return 'molecules';
144
+ }
145
+ /**
146
+ * Classificação principal - combina nome + estrutura
147
+ */
148
+ export function classifyComponent(node, forceLayer) {
149
+ // Se forçado, usa o valor forçado
150
+ if (forceLayer) {
151
+ return forceLayer;
152
+ }
153
+ // Primeiro tenta classificar pelo nome
154
+ const byName = classifyByName(node.name);
155
+ if (byName) {
156
+ return byName;
157
+ }
158
+ // Fallback para classificação por estrutura
159
+ return classifyByStructure(node);
160
+ }
161
+ /**
162
+ * Retorna o path base para a camada
163
+ */
164
+ export function getLayerPath(layer) {
165
+ return `src/components/${layer}`;
166
+ }
@@ -0,0 +1,3 @@
1
+ export * from './naming.js';
2
+ export * from './classifiers.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './naming.js';
2
+ export * from './classifiers.js';
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Naming Utilities
3
+ * Funções para conversão de nomes entre diferentes convenções
4
+ */
5
+ /**
6
+ * Converte string para kebab-case
7
+ * @example "PrimaryButton" → "primary-button"
8
+ * @example "Button/Primary/Large" → "button-primary-large"
9
+ */
10
+ export declare function toKebabCase(str: string): string;
11
+ /**
12
+ * Converte string para PascalCase
13
+ * @example "primary-button" → "PrimaryButton"
14
+ * @example "Button/Primary/Large" → "ButtonPrimaryLarge"
15
+ */
16
+ export declare function toPascalCase(str: string): string;
17
+ /**
18
+ * Converte string para camelCase
19
+ * @example "primary-button" → "primaryButton"
20
+ */
21
+ export declare function toCamelCase(str: string): string;
22
+ /**
23
+ * Converte string para SCREAMING_SNAKE_CASE
24
+ * @example "primaryButton" → "PRIMARY_BUTTON"
25
+ */
26
+ export declare function toScreamingSnakeCase(str: string): string;
27
+ /**
28
+ * Extrai o nome base de um path de componente do Figma
29
+ * @example "Button/Primary/Large" → "Button"
30
+ * @example "#Card/WithHeader" → "Card"
31
+ */
32
+ export declare function extractBaseName(figmaName: string): string;
33
+ /**
34
+ * Extrai variantes do nome do Figma
35
+ * @example "Button/Primary/Large" → ["Primary", "Large"]
36
+ */
37
+ export declare function extractVariants(figmaName: string): string[];
38
+ /**
39
+ * Gera nome do componente a partir do nome do Figma
40
+ * @example "Button/Primary" → "PrimaryButton"
41
+ * @example "Card/Default" → "Card"
42
+ */
43
+ export declare function generateComponentName(figmaName: string): string;
44
+ /**
45
+ * Gera nome do arquivo a partir do nome do componente
46
+ * @example "PrimaryButton" → "primary-button"
47
+ */
48
+ export declare function generateFileName(componentName: string): string;
49
+ /**
50
+ * Gera classe CSS BEM base
51
+ * @example "PrimaryButton" → "primary-button"
52
+ */
53
+ export declare function generateBEMBlock(componentName: string): string;
54
+ /**
55
+ * Gera classe CSS BEM element
56
+ * @example ("primary-button", "icon") → "primary-button__icon"
57
+ */
58
+ export declare function generateBEMElement(block: string, element: string): string;
59
+ /**
60
+ * Gera classe CSS BEM modifier
61
+ * @example ("primary-button", "disabled") → "primary-button--disabled"
62
+ */
63
+ export declare function generateBEMModifier(block: string, modifier: string): string;
64
+ /**
65
+ * Valida se um nome é válido para componente
66
+ */
67
+ export declare function isValidComponentName(name: string): boolean;
68
+ /**
69
+ * Sanitiza um nome para ser válido
70
+ */
71
+ export declare function sanitizeName(name: string): string;
72
+ //# sourceMappingURL=naming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../../src/utils/naming.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ/C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG/C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAU/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEzE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE3E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAG1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD"}