@datametria/vue-components 1.2.0 → 2.0.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.
- package/README.md +548 -657
- package/dist/index.es.js +2353 -1364
- package/dist/index.umd.js +10 -10
- package/dist/vue-components.css +1 -1
- package/package.json +102 -98
- package/src/components/DatametriaAlert.vue +137 -137
- package/src/components/DatametriaAutocomplete.vue +184 -138
- package/src/components/DatametriaAvatar.vue +177 -33
- package/src/components/DatametriaBadge.vue +98 -98
- package/src/components/DatametriaBreadcrumb.vue +21 -21
- package/src/components/DatametriaButton.vue +177 -165
- package/src/components/DatametriaCard.vue +12 -12
- package/src/components/DatametriaCheckbox.vue +8 -8
- package/src/components/DatametriaChip.vue +145 -149
- package/src/components/DatametriaContainer.vue +4 -4
- package/src/components/DatametriaDatePicker.vue +686 -68
- package/src/components/DatametriaDivider.vue +13 -13
- package/src/components/DatametriaFileUpload.vue +272 -140
- package/src/components/DatametriaGrid.vue +3 -3
- package/src/components/DatametriaInput.vue +15 -15
- package/src/components/DatametriaMenu.vue +604 -619
- package/src/components/DatametriaModal.vue +16 -16
- package/src/components/DatametriaNavbar.vue +230 -252
- package/src/components/DatametriaPasswordInput.vue +430 -0
- package/src/components/DatametriaProgress.vue +18 -18
- package/src/components/DatametriaRadio.vue +20 -20
- package/src/components/DatametriaSelect.vue +15 -15
- package/src/components/DatametriaSkeleton.vue +243 -239
- package/src/components/DatametriaSlider.vue +395 -407
- package/src/components/DatametriaSortableTable.vue +585 -0
- package/src/components/DatametriaSpinner.vue +7 -7
- package/src/components/DatametriaSwitch.vue +16 -16
- package/src/components/DatametriaTable.vue +14 -14
- package/src/components/DatametriaTextarea.vue +28 -28
- package/src/components/DatametriaTimePicker.vue +285 -285
- package/src/components/DatametriaToast.vue +176 -176
- package/src/components/DatametriaTooltip.vue +408 -408
- package/src/components/__tests__/DatametriaAlert.test.js +35 -35
- package/src/components/__tests__/DatametriaAlert.test.ts +190 -0
- package/src/components/__tests__/DatametriaAutocomplete.test.ts +180 -0
- package/src/components/__tests__/DatametriaAvatar.test.ts +152 -0
- package/src/components/__tests__/DatametriaBadge.test.js +29 -29
- package/src/components/__tests__/DatametriaBadge.test.ts +167 -0
- package/src/components/__tests__/DatametriaBreadcrumb.test.ts +75 -0
- package/src/components/__tests__/DatametriaButton.test.js +30 -30
- package/src/components/__tests__/DatametriaButton.test.ts +283 -0
- package/src/components/__tests__/DatametriaCard.test.ts +201 -0
- package/src/components/__tests__/DatametriaCheckbox.test.ts +47 -0
- package/src/components/__tests__/DatametriaChip.test.js +38 -38
- package/src/components/__tests__/DatametriaContainer.test.ts +52 -0
- package/src/components/__tests__/DatametriaDatePicker.test.ts +234 -0
- package/src/components/__tests__/DatametriaDivider.test.ts +54 -0
- package/src/components/__tests__/DatametriaFileUpload.test.ts +291 -0
- package/src/components/__tests__/DatametriaGrid.test.ts +31 -0
- package/src/components/__tests__/DatametriaInput.test.ts +72 -0
- package/src/components/__tests__/DatametriaMenu.test.ts +366 -0
- package/src/components/__tests__/DatametriaModal.test.ts +86 -0
- package/src/components/__tests__/DatametriaNavbar.test.js +48 -48
- package/src/components/__tests__/DatametriaNavbar.test.ts +203 -0
- package/src/components/__tests__/DatametriaPasswordInput.test.js +305 -0
- package/src/components/__tests__/DatametriaProgress.test.ts +90 -0
- package/src/components/__tests__/DatametriaRadio.test.ts +77 -0
- package/src/components/__tests__/DatametriaSelect.test.ts +77 -0
- package/src/components/__tests__/DatametriaSlider.test.ts +261 -0
- package/src/components/__tests__/DatametriaSortableTable.test.js +168 -0
- package/src/components/__tests__/DatametriaSpinner.test.ts +156 -0
- package/src/components/__tests__/DatametriaSwitch.test.ts +64 -0
- package/src/components/__tests__/DatametriaTable.test.ts +97 -0
- package/src/components/__tests__/DatametriaTextarea.test.ts +66 -0
- package/src/components/__tests__/DatametriaToast.test.js +48 -48
- package/src/components/__tests__/DatametriaToast.test.ts +99 -0
- package/src/composables/useAccessibilityScale.ts +94 -94
- package/src/composables/useBreakpoints.ts +82 -82
- package/src/composables/useHapticFeedback.ts +439 -439
- package/src/composables/useRipple.ts +218 -218
- package/src/index.ts +68 -61
- package/src/stories/Variants.stories.js +95 -95
- package/src/styles/design-tokens.css +623 -623
- package/src/theme/ThemeProvider.vue +96 -0
- package/src/theme/__tests__/ThemeProvider.test.ts +208 -0
- package/src/theme/__tests__/constants.test.ts +31 -0
- package/src/theme/__tests__/presets.test.ts +166 -0
- package/src/theme/__tests__/tokens.test.ts +155 -0
- package/src/theme/__tests__/types.test.ts +153 -0
- package/src/theme/__tests__/useTheme.test.ts +146 -0
- package/src/theme/constants.ts +14 -0
- package/src/theme/index.ts +12 -0
- package/src/theme/presets/datametria.ts +94 -0
- package/src/theme/presets/default.ts +94 -0
- package/src/theme/presets/index.ts +8 -0
- package/src/theme/tokens/colors.ts +28 -0
- package/src/theme/tokens/index.ts +47 -0
- package/src/theme/tokens/spacing.ts +21 -0
- package/src/theme/tokens/typography.ts +35 -0
- package/src/theme/types.ts +111 -0
- package/src/theme/useTheme.ts +28 -0
- package/src/types/index.ts +19 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Types Tests
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, it, expect } from 'vitest'
|
|
8
|
+
import type { Theme, ThemeTokens, ColorTokens, TypographyTokens } from '../types'
|
|
9
|
+
|
|
10
|
+
describe('Theme Types', () => {
|
|
11
|
+
it('should validate ColorTokens structure', () => {
|
|
12
|
+
const colors: ColorTokens = {
|
|
13
|
+
primary: '#0072CE',
|
|
14
|
+
secondary: '#4B0078',
|
|
15
|
+
success: '#10b981',
|
|
16
|
+
warning: '#f59e0b',
|
|
17
|
+
error: '#ef4444',
|
|
18
|
+
info: '#06b6d4',
|
|
19
|
+
neutral: {
|
|
20
|
+
50: '#f9fafb',
|
|
21
|
+
100: '#f3f4f6',
|
|
22
|
+
200: '#e5e7eb',
|
|
23
|
+
300: '#d1d5db',
|
|
24
|
+
400: '#9ca3af',
|
|
25
|
+
500: '#6b7280',
|
|
26
|
+
600: '#4b5563',
|
|
27
|
+
700: '#374151',
|
|
28
|
+
800: '#1f2937',
|
|
29
|
+
900: '#111827'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
expect(colors.primary).toBe('#0072CE')
|
|
34
|
+
expect(colors.neutral[50]).toBe('#f9fafb')
|
|
35
|
+
expect(colors.neutral[900]).toBe('#111827')
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('should validate TypographyTokens structure', () => {
|
|
39
|
+
const typography: TypographyTokens = {
|
|
40
|
+
fontFamily: {
|
|
41
|
+
sans: 'Arial, sans-serif',
|
|
42
|
+
mono: 'Courier, monospace'
|
|
43
|
+
},
|
|
44
|
+
fontSize: {
|
|
45
|
+
xs: '0.75rem',
|
|
46
|
+
sm: '0.875rem',
|
|
47
|
+
base: '1rem',
|
|
48
|
+
lg: '1.125rem',
|
|
49
|
+
xl: '1.25rem',
|
|
50
|
+
'2xl': '1.5rem',
|
|
51
|
+
'3xl': '1.875rem',
|
|
52
|
+
'4xl': '2.25rem'
|
|
53
|
+
},
|
|
54
|
+
fontWeight: {
|
|
55
|
+
normal: 400,
|
|
56
|
+
medium: 500,
|
|
57
|
+
semibold: 600,
|
|
58
|
+
bold: 700
|
|
59
|
+
},
|
|
60
|
+
lineHeight: {
|
|
61
|
+
tight: 1.25,
|
|
62
|
+
normal: 1.5,
|
|
63
|
+
relaxed: 1.75
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
expect(typography.fontFamily.sans).toBe('Arial, sans-serif')
|
|
68
|
+
expect(typography.fontSize.base).toBe('1rem')
|
|
69
|
+
expect(typography.fontWeight.bold).toBe(700)
|
|
70
|
+
expect(typography.lineHeight.normal).toBe(1.5)
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('should validate Theme structure', () => {
|
|
74
|
+
const theme: Theme = {
|
|
75
|
+
name: 'Test Theme',
|
|
76
|
+
tokens: {
|
|
77
|
+
colors: {
|
|
78
|
+
primary: '#000',
|
|
79
|
+
secondary: '#fff',
|
|
80
|
+
success: '#0f0',
|
|
81
|
+
warning: '#ff0',
|
|
82
|
+
error: '#f00',
|
|
83
|
+
info: '#00f',
|
|
84
|
+
neutral: {
|
|
85
|
+
50: '#f9fafb',
|
|
86
|
+
100: '#f3f4f6',
|
|
87
|
+
200: '#e5e7eb',
|
|
88
|
+
300: '#d1d5db',
|
|
89
|
+
400: '#9ca3af',
|
|
90
|
+
500: '#6b7280',
|
|
91
|
+
600: '#4b5563',
|
|
92
|
+
700: '#374151',
|
|
93
|
+
800: '#1f2937',
|
|
94
|
+
900: '#111827'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
typography: {
|
|
98
|
+
fontFamily: { sans: 'Arial', mono: 'Courier' },
|
|
99
|
+
fontSize: {
|
|
100
|
+
xs: '0.75rem',
|
|
101
|
+
sm: '0.875rem',
|
|
102
|
+
base: '1rem',
|
|
103
|
+
lg: '1.125rem',
|
|
104
|
+
xl: '1.25rem',
|
|
105
|
+
'2xl': '1.5rem',
|
|
106
|
+
'3xl': '1.875rem',
|
|
107
|
+
'4xl': '2.25rem'
|
|
108
|
+
},
|
|
109
|
+
fontWeight: { normal: 400, medium: 500, semibold: 600, bold: 700 },
|
|
110
|
+
lineHeight: { tight: 1.25, normal: 1.5, relaxed: 1.75 }
|
|
111
|
+
},
|
|
112
|
+
spacing: {
|
|
113
|
+
0: '0',
|
|
114
|
+
1: '0.25rem',
|
|
115
|
+
2: '0.5rem',
|
|
116
|
+
3: '0.75rem',
|
|
117
|
+
4: '1rem',
|
|
118
|
+
6: '1.5rem',
|
|
119
|
+
8: '2rem',
|
|
120
|
+
12: '3rem',
|
|
121
|
+
16: '4rem',
|
|
122
|
+
20: '5rem',
|
|
123
|
+
24: '6rem'
|
|
124
|
+
},
|
|
125
|
+
radius: {
|
|
126
|
+
none: '0',
|
|
127
|
+
sm: '0.25rem',
|
|
128
|
+
md: '0.375rem',
|
|
129
|
+
lg: '0.5rem',
|
|
130
|
+
xl: '0.75rem',
|
|
131
|
+
full: '9999px'
|
|
132
|
+
},
|
|
133
|
+
shadows: {
|
|
134
|
+
none: 'none',
|
|
135
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
136
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
|
|
137
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
|
|
138
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1)',
|
|
139
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
|
140
|
+
},
|
|
141
|
+
transitions: {
|
|
142
|
+
fast: '150ms',
|
|
143
|
+
base: '200ms',
|
|
144
|
+
slow: '300ms'
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
expect(theme.name).toBe('Test Theme')
|
|
150
|
+
expect(theme.tokens.colors.primary).toBe('#000')
|
|
151
|
+
expect(theme.tokens.spacing[4]).toBe('1rem')
|
|
152
|
+
})
|
|
153
|
+
})
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTheme Composable Tests
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { describe, it, expect } from 'vitest'
|
|
8
|
+
import { mount } from '@vue/test-utils'
|
|
9
|
+
import { h } from 'vue'
|
|
10
|
+
import ThemeProvider from '../ThemeProvider.vue'
|
|
11
|
+
import { useTheme } from '../useTheme'
|
|
12
|
+
import { defaultTokens } from '../tokens'
|
|
13
|
+
import type { Theme } from '../types'
|
|
14
|
+
|
|
15
|
+
const testTheme: Theme = {
|
|
16
|
+
name: 'Test Theme',
|
|
17
|
+
tokens: defaultTokens
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe('useTheme', () => {
|
|
21
|
+
it('should throw error when used outside ThemeProvider', () => {
|
|
22
|
+
// Suprimir warnings do Vue durante este teste
|
|
23
|
+
const originalWarn = console.warn
|
|
24
|
+
console.warn = () => {}
|
|
25
|
+
|
|
26
|
+
expect(() => {
|
|
27
|
+
const TestComponent = {
|
|
28
|
+
setup() {
|
|
29
|
+
useTheme()
|
|
30
|
+
return () => h('div', 'Test')
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
mount(TestComponent)
|
|
34
|
+
}).toThrow('useTheme must be used within a ThemeProvider')
|
|
35
|
+
|
|
36
|
+
// Restaurar console.warn
|
|
37
|
+
console.warn = originalWarn
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
it('should return theme when used inside ThemeProvider', () => {
|
|
41
|
+
const TestComponent = {
|
|
42
|
+
setup() {
|
|
43
|
+
const theme = useTheme()
|
|
44
|
+
expect(theme).toBeDefined()
|
|
45
|
+
expect(theme.value.name).toBe('Test Theme')
|
|
46
|
+
return () => h('div', theme.value.name)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const wrapper = mount(ThemeProvider, {
|
|
51
|
+
props: { theme: testTheme },
|
|
52
|
+
slots: {
|
|
53
|
+
default: h(TestComponent)
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
expect(wrapper.text()).toContain('Test Theme')
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
it('should return theme tokens', () => {
|
|
61
|
+
const TestComponent = {
|
|
62
|
+
setup() {
|
|
63
|
+
const theme = useTheme()
|
|
64
|
+
expect(theme.value.tokens).toBeDefined()
|
|
65
|
+
expect(theme.value.tokens.colors.primary).toBe('#0072CE')
|
|
66
|
+
return () => h('div', 'Test')
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
mount(ThemeProvider, {
|
|
71
|
+
props: { theme: testTheme },
|
|
72
|
+
slots: {
|
|
73
|
+
default: h(TestComponent)
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('should access all token categories', () => {
|
|
79
|
+
const TestComponent = {
|
|
80
|
+
setup() {
|
|
81
|
+
const theme = useTheme()
|
|
82
|
+
expect(theme.value.tokens.colors).toBeDefined()
|
|
83
|
+
expect(theme.value.tokens.typography).toBeDefined()
|
|
84
|
+
expect(theme.value.tokens.spacing).toBeDefined()
|
|
85
|
+
expect(theme.value.tokens.radius).toBeDefined()
|
|
86
|
+
expect(theme.value.tokens.shadows).toBeDefined()
|
|
87
|
+
expect(theme.value.tokens.transitions).toBeDefined()
|
|
88
|
+
return () => h('div', 'Test')
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
mount(ThemeProvider, {
|
|
93
|
+
props: { theme: testTheme },
|
|
94
|
+
slots: {
|
|
95
|
+
default: h(TestComponent)
|
|
96
|
+
}
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
|
|
100
|
+
it('should work in nested components', () => {
|
|
101
|
+
const GrandchildComponent = {
|
|
102
|
+
setup() {
|
|
103
|
+
const theme = useTheme()
|
|
104
|
+
return () => h('div', { class: 'grandchild' }, theme.value.name)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const ChildComponent = {
|
|
109
|
+
setup() {
|
|
110
|
+
return () => h('div', { class: 'child' }, h(GrandchildComponent))
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const wrapper = mount(ThemeProvider, {
|
|
115
|
+
props: { theme: testTheme },
|
|
116
|
+
slots: {
|
|
117
|
+
default: h(ChildComponent)
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
expect(wrapper.find('.grandchild').text()).toContain('Test Theme')
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
it('should provide helpful error message', () => {
|
|
125
|
+
// Suprimir warnings do Vue durante este teste
|
|
126
|
+
const originalWarn = console.warn
|
|
127
|
+
console.warn = () => {}
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
const TestComponent = {
|
|
131
|
+
setup() {
|
|
132
|
+
useTheme()
|
|
133
|
+
return () => h('div', 'Test')
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
mount(TestComponent)
|
|
137
|
+
} catch (error) {
|
|
138
|
+
expect(error).toBeInstanceOf(Error)
|
|
139
|
+
expect((error as Error).message).toContain('ThemeProvider')
|
|
140
|
+
expect((error as Error).message).toContain('Wrap your component tree')
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Restaurar console.warn
|
|
144
|
+
console.warn = originalWarn
|
|
145
|
+
})
|
|
146
|
+
})
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme System Constants
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { InjectionKey, ComputedRef } from 'vue'
|
|
8
|
+
import type { Theme } from './types'
|
|
9
|
+
|
|
10
|
+
export const THEME_INJECTION_KEY: InjectionKey<ComputedRef<Theme>> = Symbol('theme')
|
|
11
|
+
|
|
12
|
+
export const DEFAULT_THEME_PREFIX = 'dm'
|
|
13
|
+
|
|
14
|
+
export const CSS_VARIABLE_PREFIX = '--'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme System Exports
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { default as ThemeProvider } from './ThemeProvider.vue'
|
|
8
|
+
export { useTheme } from './useTheme'
|
|
9
|
+
export * from './types'
|
|
10
|
+
export * from './constants'
|
|
11
|
+
export * from './tokens'
|
|
12
|
+
export * from './presets'
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DATAMETRIA Theme Preset
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Theme } from '../types'
|
|
8
|
+
|
|
9
|
+
export const datametriaTheme: Theme = {
|
|
10
|
+
name: 'DATAMETRIA',
|
|
11
|
+
tokens: {
|
|
12
|
+
colors: {
|
|
13
|
+
primary: '#0072CE',
|
|
14
|
+
secondary: '#4B0078',
|
|
15
|
+
success: '#10b981',
|
|
16
|
+
warning: '#f59e0b',
|
|
17
|
+
error: '#ef4444',
|
|
18
|
+
info: '#06b6d4',
|
|
19
|
+
neutral: {
|
|
20
|
+
50: '#f9fafb',
|
|
21
|
+
100: '#f3f4f6',
|
|
22
|
+
200: '#e5e7eb',
|
|
23
|
+
300: '#d1d5db',
|
|
24
|
+
400: '#9ca3af',
|
|
25
|
+
500: '#6b7280',
|
|
26
|
+
600: '#4b5563',
|
|
27
|
+
700: '#374151',
|
|
28
|
+
800: '#1f2937',
|
|
29
|
+
900: '#111827'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
typography: {
|
|
33
|
+
fontFamily: {
|
|
34
|
+
sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
35
|
+
mono: 'Menlo, Monaco, Consolas, "Courier New", monospace'
|
|
36
|
+
},
|
|
37
|
+
fontSize: {
|
|
38
|
+
xs: '0.75rem',
|
|
39
|
+
sm: '0.875rem',
|
|
40
|
+
base: '1rem',
|
|
41
|
+
lg: '1.125rem',
|
|
42
|
+
xl: '1.25rem',
|
|
43
|
+
'2xl': '1.5rem',
|
|
44
|
+
'3xl': '1.875rem',
|
|
45
|
+
'4xl': '2.25rem'
|
|
46
|
+
},
|
|
47
|
+
fontWeight: {
|
|
48
|
+
normal: 400,
|
|
49
|
+
medium: 500,
|
|
50
|
+
semibold: 600,
|
|
51
|
+
bold: 700
|
|
52
|
+
},
|
|
53
|
+
lineHeight: {
|
|
54
|
+
tight: 1.25,
|
|
55
|
+
normal: 1.5,
|
|
56
|
+
relaxed: 1.75
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
spacing: {
|
|
60
|
+
0: '0',
|
|
61
|
+
1: '0.25rem',
|
|
62
|
+
2: '0.5rem',
|
|
63
|
+
3: '0.75rem',
|
|
64
|
+
4: '1rem',
|
|
65
|
+
6: '1.5rem',
|
|
66
|
+
8: '2rem',
|
|
67
|
+
12: '3rem',
|
|
68
|
+
16: '4rem',
|
|
69
|
+
20: '5rem',
|
|
70
|
+
24: '6rem'
|
|
71
|
+
},
|
|
72
|
+
radius: {
|
|
73
|
+
none: '0',
|
|
74
|
+
sm: '0.25rem',
|
|
75
|
+
md: '0.375rem',
|
|
76
|
+
lg: '0.5rem',
|
|
77
|
+
xl: '0.75rem',
|
|
78
|
+
full: '9999px'
|
|
79
|
+
},
|
|
80
|
+
shadows: {
|
|
81
|
+
none: 'none',
|
|
82
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
83
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
84
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
85
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
|
86
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
|
87
|
+
},
|
|
88
|
+
transitions: {
|
|
89
|
+
fast: '150ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
90
|
+
base: '200ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
91
|
+
slow: '300ms cubic-bezier(0.4, 0, 0.2, 1)'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Theme Preset (Generic)
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { Theme } from '../types'
|
|
8
|
+
|
|
9
|
+
export const defaultTheme: Theme = {
|
|
10
|
+
name: 'Default',
|
|
11
|
+
tokens: {
|
|
12
|
+
colors: {
|
|
13
|
+
primary: '#3b82f6',
|
|
14
|
+
secondary: '#8b5cf6',
|
|
15
|
+
success: '#10b981',
|
|
16
|
+
warning: '#f59e0b',
|
|
17
|
+
error: '#ef4444',
|
|
18
|
+
info: '#06b6d4',
|
|
19
|
+
neutral: {
|
|
20
|
+
50: '#f9fafb',
|
|
21
|
+
100: '#f3f4f6',
|
|
22
|
+
200: '#e5e7eb',
|
|
23
|
+
300: '#d1d5db',
|
|
24
|
+
400: '#9ca3af',
|
|
25
|
+
500: '#6b7280',
|
|
26
|
+
600: '#4b5563',
|
|
27
|
+
700: '#374151',
|
|
28
|
+
800: '#1f2937',
|
|
29
|
+
900: '#111827'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
typography: {
|
|
33
|
+
fontFamily: {
|
|
34
|
+
sans: 'system-ui, -apple-system, sans-serif',
|
|
35
|
+
mono: 'ui-monospace, monospace'
|
|
36
|
+
},
|
|
37
|
+
fontSize: {
|
|
38
|
+
xs: '0.75rem',
|
|
39
|
+
sm: '0.875rem',
|
|
40
|
+
base: '1rem',
|
|
41
|
+
lg: '1.125rem',
|
|
42
|
+
xl: '1.25rem',
|
|
43
|
+
'2xl': '1.5rem',
|
|
44
|
+
'3xl': '1.875rem',
|
|
45
|
+
'4xl': '2.25rem'
|
|
46
|
+
},
|
|
47
|
+
fontWeight: {
|
|
48
|
+
normal: 400,
|
|
49
|
+
medium: 500,
|
|
50
|
+
semibold: 600,
|
|
51
|
+
bold: 700
|
|
52
|
+
},
|
|
53
|
+
lineHeight: {
|
|
54
|
+
tight: 1.25,
|
|
55
|
+
normal: 1.5,
|
|
56
|
+
relaxed: 1.75
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
spacing: {
|
|
60
|
+
0: '0',
|
|
61
|
+
1: '0.25rem',
|
|
62
|
+
2: '0.5rem',
|
|
63
|
+
3: '0.75rem',
|
|
64
|
+
4: '1rem',
|
|
65
|
+
6: '1.5rem',
|
|
66
|
+
8: '2rem',
|
|
67
|
+
12: '3rem',
|
|
68
|
+
16: '4rem',
|
|
69
|
+
20: '5rem',
|
|
70
|
+
24: '6rem'
|
|
71
|
+
},
|
|
72
|
+
radius: {
|
|
73
|
+
none: '0',
|
|
74
|
+
sm: '0.25rem',
|
|
75
|
+
md: '0.375rem',
|
|
76
|
+
lg: '0.5rem',
|
|
77
|
+
xl: '0.75rem',
|
|
78
|
+
full: '9999px'
|
|
79
|
+
},
|
|
80
|
+
shadows: {
|
|
81
|
+
none: 'none',
|
|
82
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
83
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
84
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
85
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
|
86
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
|
87
|
+
},
|
|
88
|
+
transitions: {
|
|
89
|
+
fast: '150ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
90
|
+
base: '200ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
91
|
+
slow: '300ms cubic-bezier(0.4, 0, 0.2, 1)'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Color Tokens
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ColorTokens } from '../types'
|
|
8
|
+
|
|
9
|
+
export const defaultColors: ColorTokens = {
|
|
10
|
+
primary: '#0072CE',
|
|
11
|
+
secondary: '#4B0078',
|
|
12
|
+
success: '#10b981',
|
|
13
|
+
warning: '#f59e0b',
|
|
14
|
+
error: '#ef4444',
|
|
15
|
+
info: '#06b6d4',
|
|
16
|
+
neutral: {
|
|
17
|
+
50: '#f9fafb',
|
|
18
|
+
100: '#f3f4f6',
|
|
19
|
+
200: '#e5e7eb',
|
|
20
|
+
300: '#d1d5db',
|
|
21
|
+
400: '#9ca3af',
|
|
22
|
+
500: '#6b7280',
|
|
23
|
+
600: '#4b5563',
|
|
24
|
+
700: '#374151',
|
|
25
|
+
800: '#1f2937',
|
|
26
|
+
900: '#111827'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Theme Tokens Index
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { ThemeTokens, RadiusTokens, ShadowTokens, TransitionTokens } from '../types'
|
|
8
|
+
import { defaultColors } from './colors'
|
|
9
|
+
import { defaultTypography } from './typography'
|
|
10
|
+
import { defaultSpacing } from './spacing'
|
|
11
|
+
|
|
12
|
+
export const defaultRadius: RadiusTokens = {
|
|
13
|
+
none: '0',
|
|
14
|
+
sm: '0.25rem',
|
|
15
|
+
md: '0.375rem',
|
|
16
|
+
lg: '0.5rem',
|
|
17
|
+
xl: '0.75rem',
|
|
18
|
+
full: '9999px'
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const defaultShadows: ShadowTokens = {
|
|
22
|
+
none: 'none',
|
|
23
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
24
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
25
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)',
|
|
26
|
+
xl: '0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)',
|
|
27
|
+
'2xl': '0 25px 50px -12px rgba(0, 0, 0, 0.25)'
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const defaultTransitions: TransitionTokens = {
|
|
31
|
+
fast: '150ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
32
|
+
base: '200ms cubic-bezier(0.4, 0, 0.2, 1)',
|
|
33
|
+
slow: '300ms cubic-bezier(0.4, 0, 0.2, 1)'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const defaultTokens: ThemeTokens = {
|
|
37
|
+
colors: defaultColors,
|
|
38
|
+
typography: defaultTypography,
|
|
39
|
+
spacing: defaultSpacing,
|
|
40
|
+
radius: defaultRadius,
|
|
41
|
+
shadows: defaultShadows,
|
|
42
|
+
transitions: defaultTransitions
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export * from './colors'
|
|
46
|
+
export * from './typography'
|
|
47
|
+
export * from './spacing'
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Spacing Tokens
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { SpacingTokens } from '../types'
|
|
8
|
+
|
|
9
|
+
export const defaultSpacing: SpacingTokens = {
|
|
10
|
+
0: '0',
|
|
11
|
+
1: '0.25rem',
|
|
12
|
+
2: '0.5rem',
|
|
13
|
+
3: '0.75rem',
|
|
14
|
+
4: '1rem',
|
|
15
|
+
6: '1.5rem',
|
|
16
|
+
8: '2rem',
|
|
17
|
+
12: '3rem',
|
|
18
|
+
16: '4rem',
|
|
19
|
+
20: '5rem',
|
|
20
|
+
24: '6rem'
|
|
21
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typography Tokens
|
|
3
|
+
* @author Vander Loto - CTO DATAMETRIA
|
|
4
|
+
* @date 13/11/2025
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { TypographyTokens } from '../types'
|
|
8
|
+
|
|
9
|
+
export const defaultTypography: TypographyTokens = {
|
|
10
|
+
fontFamily: {
|
|
11
|
+
sans: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',
|
|
12
|
+
mono: 'Menlo, Monaco, Consolas, "Courier New", monospace'
|
|
13
|
+
},
|
|
14
|
+
fontSize: {
|
|
15
|
+
xs: '0.75rem',
|
|
16
|
+
sm: '0.875rem',
|
|
17
|
+
base: '1rem',
|
|
18
|
+
lg: '1.125rem',
|
|
19
|
+
xl: '1.25rem',
|
|
20
|
+
'2xl': '1.5rem',
|
|
21
|
+
'3xl': '1.875rem',
|
|
22
|
+
'4xl': '2.25rem'
|
|
23
|
+
},
|
|
24
|
+
fontWeight: {
|
|
25
|
+
normal: 400,
|
|
26
|
+
medium: 500,
|
|
27
|
+
semibold: 600,
|
|
28
|
+
bold: 700
|
|
29
|
+
},
|
|
30
|
+
lineHeight: {
|
|
31
|
+
tight: 1.25,
|
|
32
|
+
normal: 1.5,
|
|
33
|
+
relaxed: 1.75
|
|
34
|
+
}
|
|
35
|
+
}
|