@ngx-smz/ui-kit 0.0.0-stage → 21.9.0-next.10
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/fesm2022/ngx-smz-ui-kit.mjs +9342 -0
- package/fesm2022/ngx-smz-ui-kit.mjs.map +1 -0
- package/package.json +33 -3
- package/tailwind.content.js +12 -0
- package/tailwind.preset.js +85 -0
- package/themes/default.css +89 -0
- package/types/ngx-smz-ui-kit.d.ts +2542 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngx-smz/ui-kit",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "21.9.0-next.10",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"@angular/cdk": ">=21.0.0 <22.0.0",
|
|
6
|
+
"@angular/common": ">=21.0.0 <22.0.0",
|
|
7
|
+
"@angular/core": ">=21.0.0 <22.0.0",
|
|
8
|
+
"@angular/forms": ">=21.0.0 <22.0.0",
|
|
9
|
+
"@angular/router": ">=21.0.0 <22.0.0",
|
|
10
|
+
"rxjs": ">=7.4.0",
|
|
11
|
+
"tailwindcss": ">=3.4.17 <4.0.0"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"tslib": "^2.3.0"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"publishConfig": {
|
|
18
|
+
"access": "public"
|
|
19
|
+
},
|
|
20
|
+
"exports": {
|
|
21
|
+
"./package.json": {
|
|
22
|
+
"default": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"./tailwind.preset": "./tailwind.preset.js",
|
|
25
|
+
"./tailwind.preset.js": "./tailwind.preset.js",
|
|
26
|
+
"./tailwind.content": "./tailwind.content.js",
|
|
27
|
+
"./tailwind.content.js": "./tailwind.content.js",
|
|
28
|
+
"./themes/*": "./themes/*",
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./types/ngx-smz-ui-kit.d.ts",
|
|
31
|
+
"default": "./fesm2022/ngx-smz-ui-kit.mjs"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"module": "fesm2022/ngx-smz-ui-kit.mjs",
|
|
35
|
+
"typings": "types/ngx-smz-ui-kit.d.ts"
|
|
6
36
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Globs que o Tailwind do app consumidor deve escanear para gerar as classes usadas
|
|
5
|
+
* pelos componentes do ui-kit. O Tailwind v3 ignora `content` vindo de presets,
|
|
6
|
+
* entao o app precisa incluir isso no proprio tailwind.config:
|
|
7
|
+
*
|
|
8
|
+
* content: [ 'src/**\/*.{html,ts}', ...require('@ngx-smz/ui-kit/tailwind.content') ]
|
|
9
|
+
*/
|
|
10
|
+
module.exports = [
|
|
11
|
+
path.join(__dirname, 'fesm2022', '**', '*.mjs').replace(/\\/g, '/'),
|
|
12
|
+
];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const channel = (name) => `rgb(var(--smz-color-${name}) / <alpha-value>)`;
|
|
2
|
+
|
|
3
|
+
const colorNames = [
|
|
4
|
+
'primary', 'primary-hover', 'primary-active', 'on-primary',
|
|
5
|
+
'danger', 'danger-hover', 'danger-active', 'on-danger',
|
|
6
|
+
'success', 'success-hover', 'success-active', 'on-success',
|
|
7
|
+
'warning', 'warning-hover', 'warning-active', 'on-warning',
|
|
8
|
+
'surface-0', 'surface-1', 'surface-2', 'surface-3',
|
|
9
|
+
'fg', 'fg-muted', 'fg-subtle',
|
|
10
|
+
'line', 'line-strong',
|
|
11
|
+
'focus',
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const colors = Object.fromEntries(colorNames.map((name) => [`ui-${name}`, channel(name)]));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Vocabulario herdado do `tailwindcss-primeui` (bg-primary, text-color, text-muted-color, bg-surface-100, border-surface,
|
|
18
|
+
* rounded-border), mantido para os apps e layouts existentes. Mapeia para os mesmos tokens do tema; a escala `surface-N` e fixa.
|
|
19
|
+
*/
|
|
20
|
+
const surfaceScale = {
|
|
21
|
+
0: '#ffffff', 50: '#f8fafc', 100: '#f1f5f9', 200: '#e2e8f0', 300: '#cbd5e1', 400: '#94a3b8',
|
|
22
|
+
500: '#64748b', 600: '#475569', 700: '#334155', 800: '#1e293b', 900: '#0f172a', 950: '#020617',
|
|
23
|
+
};
|
|
24
|
+
const legacyColors = {
|
|
25
|
+
primary: { DEFAULT: channel('primary'), contrast: channel('on-primary'), hover: channel('primary-hover'), active: channel('primary-active') },
|
|
26
|
+
surface: { DEFAULT: channel('line'), ...surfaceScale },
|
|
27
|
+
color: channel('fg'),
|
|
28
|
+
'muted-color': channel('fg-muted'),
|
|
29
|
+
'surface-border': channel('line'),
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Preset do @ngx-smz/ui-kit. Mapeia os tokens do tema (variaveis CSS --smz-*)
|
|
34
|
+
* para utilitarios semanticos do Tailwind (bg-ui-primary, rounded-control, h-control...).
|
|
35
|
+
* Cores levam o prefixo `ui-` (bg-ui-primary, text-ui-fg) para nao colidir com plugins ou temas do app
|
|
36
|
+
* Os valores vivem no arquivo de tema (themes/*.css), nunca aqui.
|
|
37
|
+
*/
|
|
38
|
+
module.exports = {
|
|
39
|
+
theme: {
|
|
40
|
+
extend: {
|
|
41
|
+
colors: { ...colors, ...legacyColors },
|
|
42
|
+
fontFamily: {
|
|
43
|
+
ui: 'var(--smz-font-sans)',
|
|
44
|
+
'ui-mono': 'var(--smz-font-mono)',
|
|
45
|
+
},
|
|
46
|
+
fontSize: {
|
|
47
|
+
'ui-xs': ['var(--smz-text-xs)', 'var(--smz-leading)'],
|
|
48
|
+
'ui-sm': ['var(--smz-text-sm)', 'var(--smz-leading)'],
|
|
49
|
+
'ui-md': ['var(--smz-text-md)', 'var(--smz-leading)'],
|
|
50
|
+
'ui-lg': ['var(--smz-text-lg)', 'var(--smz-leading)'],
|
|
51
|
+
'ui-xl': ['var(--smz-text-xl)', 'var(--smz-leading)'],
|
|
52
|
+
},
|
|
53
|
+
height: {
|
|
54
|
+
'control-sm': 'var(--smz-control-h-sm)',
|
|
55
|
+
control: 'var(--smz-control-h)',
|
|
56
|
+
'control-lg': 'var(--smz-control-h-lg)',
|
|
57
|
+
},
|
|
58
|
+
minHeight: {
|
|
59
|
+
'control-sm': 'var(--smz-control-h-sm)',
|
|
60
|
+
control: 'var(--smz-control-h)',
|
|
61
|
+
'control-lg': 'var(--smz-control-h-lg)',
|
|
62
|
+
},
|
|
63
|
+
padding: {
|
|
64
|
+
'control-x-sm': 'var(--smz-control-px-sm)',
|
|
65
|
+
'control-x': 'var(--smz-control-px)',
|
|
66
|
+
'control-x-lg': 'var(--smz-control-px-lg)',
|
|
67
|
+
'input-x-sm': 'var(--smz-input-px-sm)',
|
|
68
|
+
'input-x': 'var(--smz-input-px)',
|
|
69
|
+
},
|
|
70
|
+
borderRadius: {
|
|
71
|
+
control: 'var(--smz-radius-control)',
|
|
72
|
+
card: 'var(--smz-radius-card)',
|
|
73
|
+
overlay: 'var(--smz-radius-overlay)',
|
|
74
|
+
border: 'var(--smz-radius-control)',
|
|
75
|
+
},
|
|
76
|
+
boxShadow: {
|
|
77
|
+
card: 'var(--smz-shadow-card)',
|
|
78
|
+
overlay: 'var(--smz-shadow-overlay)',
|
|
79
|
+
},
|
|
80
|
+
transitionDuration: {
|
|
81
|
+
ui: 'var(--smz-duration)',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Tema padrao do @ngx-smz/ui-kit.
|
|
3
|
+
* Cores sao canais RGB separados por espaco ("37 99 235") para o Tailwind aplicar opacidade (bg-primary/10).
|
|
4
|
+
* Para criar um tema, copie este arquivo e altere os valores. Para desplugar, remova o import.
|
|
5
|
+
*/
|
|
6
|
+
:root {
|
|
7
|
+
--smz-color-primary: 37 99 235;
|
|
8
|
+
--smz-color-primary-hover: 29 78 216;
|
|
9
|
+
--smz-color-primary-active: 30 64 175;
|
|
10
|
+
--smz-color-on-primary: 255 255 255;
|
|
11
|
+
|
|
12
|
+
--smz-color-danger: 220 38 38;
|
|
13
|
+
--smz-color-danger-hover: 185 28 28;
|
|
14
|
+
--smz-color-danger-active: 153 27 27;
|
|
15
|
+
--smz-color-on-danger: 255 255 255;
|
|
16
|
+
|
|
17
|
+
--smz-color-success: 22 163 74;
|
|
18
|
+
--smz-color-success-hover: 21 128 61;
|
|
19
|
+
--smz-color-success-active: 22 101 52;
|
|
20
|
+
--smz-color-on-success: 255 255 255;
|
|
21
|
+
|
|
22
|
+
--smz-color-warning: 245 158 11;
|
|
23
|
+
--smz-color-warning-hover: 217 119 6;
|
|
24
|
+
--smz-color-warning-active: 180 83 9;
|
|
25
|
+
--smz-color-on-warning: 31 41 55;
|
|
26
|
+
|
|
27
|
+
--smz-color-surface-0: 248 250 252;
|
|
28
|
+
--smz-color-surface-1: 255 255 255;
|
|
29
|
+
--smz-color-surface-2: 255 255 255;
|
|
30
|
+
--smz-color-surface-3: 241 245 249;
|
|
31
|
+
|
|
32
|
+
--smz-color-fg: 15 23 42;
|
|
33
|
+
--smz-color-fg-muted: 71 85 105;
|
|
34
|
+
--smz-color-fg-subtle: 148 163 184;
|
|
35
|
+
|
|
36
|
+
--smz-color-line: 226 232 240;
|
|
37
|
+
--smz-color-line-strong: 203 213 225;
|
|
38
|
+
--smz-color-focus: 37 99 235;
|
|
39
|
+
|
|
40
|
+
--smz-font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
41
|
+
--smz-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
42
|
+
--smz-text-xs: 0.75rem;
|
|
43
|
+
--smz-text-sm: 0.8125rem;
|
|
44
|
+
--smz-text-md: 0.875rem;
|
|
45
|
+
--smz-text-lg: 1rem;
|
|
46
|
+
--smz-text-xl: 1.125rem;
|
|
47
|
+
--smz-leading: 1.5;
|
|
48
|
+
|
|
49
|
+
--smz-control-h-sm: 2rem;
|
|
50
|
+
--smz-control-h: 2.5rem;
|
|
51
|
+
--smz-control-h-lg: 3rem;
|
|
52
|
+
--smz-control-px-sm: 0.75rem;
|
|
53
|
+
--smz-control-px: 1rem;
|
|
54
|
+
--smz-control-px-lg: 1.5rem;
|
|
55
|
+
/* Padding horizontal de campos de formulario (padrao: o mesmo dos controles); ajuste so os campos com este token. */
|
|
56
|
+
--smz-input-px-sm: var(--smz-control-px-sm);
|
|
57
|
+
--smz-input-px: var(--smz-control-px);
|
|
58
|
+
|
|
59
|
+
--smz-radius-control: 0.5rem;
|
|
60
|
+
--smz-radius-card: 0.75rem;
|
|
61
|
+
--smz-radius-overlay: 0.75rem;
|
|
62
|
+
|
|
63
|
+
--smz-shadow-card: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.1);
|
|
64
|
+
--smz-shadow-overlay: 0 8px 24px rgb(0 0 0 / 0.12), 0 2px 6px rgb(0 0 0 / 0.08);
|
|
65
|
+
|
|
66
|
+
--smz-duration: 150ms;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:root[data-smz-mode='dark'],
|
|
70
|
+
:root.app-dark,
|
|
71
|
+
:root.dark {
|
|
72
|
+
--smz-color-primary: 96 165 250;
|
|
73
|
+
--smz-color-primary-hover: 147 197 253;
|
|
74
|
+
--smz-color-primary-active: 191 219 254;
|
|
75
|
+
--smz-color-on-primary: 15 23 42;
|
|
76
|
+
|
|
77
|
+
--smz-color-surface-0: 2 6 23;
|
|
78
|
+
--smz-color-surface-1: 15 23 42;
|
|
79
|
+
--smz-color-surface-2: 30 41 59;
|
|
80
|
+
--smz-color-surface-3: 51 65 85;
|
|
81
|
+
|
|
82
|
+
--smz-color-fg: 241 245 249;
|
|
83
|
+
--smz-color-fg-muted: 203 213 225;
|
|
84
|
+
--smz-color-fg-subtle: 148 163 184;
|
|
85
|
+
|
|
86
|
+
--smz-color-line: 51 65 85;
|
|
87
|
+
--smz-color-line-strong: 71 85 105;
|
|
88
|
+
--smz-color-focus: 96 165 250;
|
|
89
|
+
}
|