@aseansc/ui 5.1.0 → 5.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aseansc/ui",
3
- "version": "5.1.0",
3
+ "version": "5.2.1",
4
4
  "description": "ASC Internal UI Component Library — Angular 22 + PrimeNG 21 + TailwindCSS 4 (PrimeNG capped at 21.x — 22.x requires a paid PrimeUI license key, xem README.md)",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ASC Team",
@@ -1,191 +1,213 @@
1
- @use 'primitive' as p;
2
-
3
- // ─────────────────────────────────────────────────────────────────────────────
4
- // Layer 2 — Semantic Tokens
5
- //
6
- // Role-based. Đây là layer component styles nên dùng.
7
- // Expose thành CSS custom properties để support runtime theming (dark mode).
8
- // ─────────────────────────────────────────────────────────────────────────────
9
-
10
- :root {
11
- // ── Color: Primary (brand) — theo design-token-color.json (Brand.default/hover/secondary) ──
12
- --asc-color-primary-lighter: #{p.$asc-brand-50}; // Background.brand-lv1
13
- --asc-color-primary-light: #{p.$asc-brand-100}; // Background.brand-lv2
14
- --asc-color-primary-subtle: #{p.$asc-brand-200};
15
- --asc-color-primary: #{p.$asc-brand-500}; // default state — Brand.default
16
- --asc-color-primary-hover: #{p.$asc-brand-600}; // hover state — Brand.hover
17
- --asc-color-primary-active: #{p.$asc-brand-700}; // active/pressed — Brand.secondary
18
- --asc-color-primary-text: #{p.$asc-white}; // text on primary bg — Background.on-brand
19
- // ── Color: Semantic states — theo design-token-color.json ───────────────────
20
- --asc-color-success: #{p.$asc-emerald-500}; // Brand.tertiary / Text.success
21
- --asc-color-success-bg: #{p.$asc-emerald-50}; // Background.green
22
- --asc-color-success-border: #{p.$asc-green-100};
23
-
24
- --asc-color-warning: #{p.$asc-amber-500}; // Border/Icon/Text.warning
25
- --asc-color-warning-bg: #{p.$asc-yellow-50}; // Background.yellow
26
- --asc-color-warning-border: #{p.$asc-yellow-100};
27
-
28
- --asc-color-danger: #{p.$asc-red-500}; // Border/Icon/Text.danger
29
- --asc-color-danger-bg: #{p.$asc-red-50}; // Background.red
30
- --asc-color-danger-border: #{p.$asc-red-100};
31
-
32
- --asc-color-info: #{p.$asc-blue-500}; // Border/Icon/Text.info
33
- --asc-color-info-bg: #{p.$asc-blue-50}; // Background.blue
34
- --asc-color-info-border: #{p.$asc-blue-100};
35
-
36
- // ── Color: Surface (backgrounds) — Background.* (design-token-color.json) ──
37
- --asc-surface-ground: #{p.$asc-grey-10}; // page background — Background.default dùng #fff, nhưng ground cần khác base 1 chút để phân lớp — giữ tone grey-10 gần trắng
38
- --asc-surface-base: #{p.$asc-white}; // card / panel background — Background.default
39
- --asc-surface-overlay: #{p.$asc-white}; // dialog / tooltip bg
40
- --asc-surface-hover: #{p.$asc-grey-50}; // Background.surface
41
- --asc-surface-active: #{p.$asc-grey-100}; // Background.onSurface
42
- --asc-surface-0: #{p.$asc-white};
43
- --asc-surface-50: #{p.$asc-white};
44
- --asc-formfield-bg: #{p.$asc-white}; // nền input/select/datepicker... (PrimeNG formField.background)
45
-
46
- // ── Color: Border — Border.* (design-token-color.json) ──────────────────────
47
- --asc-border-color: #{p.$asc-grey-100}; // Border.default
48
- --asc-border-color-strong: #{p.$asc-grey-300}; // Border.secondary
49
- --asc-border-color-focus: #{p.$asc-blue-500}; // Border.info
50
- --asc-border-color-invalid: #{p.$asc-red-500}; // Border.danger
51
- --asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand — token trước đây chưa có
52
-
53
- // ── Color: Text — Text.* (design-token-color.json) ───────────────────────────
54
- --asc-text-primary: #{p.$asc-grey-900}; // Text.primary
55
- --asc-text-secondary: #{p.$asc-grey-600}; // Text.secondary — sửa theo tài liệu MD gốc (file color mới bị trùng giá trị với tertiary, nghi lỗi copy)
56
- --asc-text-muted: #{p.$asc-grey-500}; // Text.tertiary
57
- --asc-text-disabled: #{p.$asc-grey-200}; // Text.disable
58
- --asc-text-inverse: #{p.$asc-white}; // Text.reverse
59
- --asc-text-placeholder: #{p.$asc-grey-500};
60
- --asc-text-link: #{p.$asc-blue-600}; // Text.link — ĐỔI: link giờ là xanh dương, không còn dùng brand đỏ
61
- --asc-text-link-hover: #{p.$asc-blue-700};
62
- --asc-text-invalid: #{p.$asc-red-500}; // Text.danger
63
- --asc-text-brand: #{p.$asc-brand-500}; // Text.brand — token mới, tách riêng khỏi link
64
- --asc-table-header-color: #A3A3A3; // chữ header AscTable — theo design mới
65
- --asc-table-border-color: #0C0C0D1A; // kẻ ô table (grey đậm, alpha 10%) — theo design mới
66
-
67
- // ── Color: Icon — Icon.* (design-token-color.json) — tier mới, trước đây
68
- // component tự tái dùng --asc-text-*, giờ có set riêng theo đúng design ──────
69
- --asc-icon-primary: #{p.$asc-grey-900};
70
- --asc-icon-secondary: #{p.$asc-grey-400};
71
- --asc-icon-disabled: #{p.$asc-grey-200};
72
- --asc-icon-brand: #{p.$asc-brand-500};
73
- --asc-icon-link: #{p.$asc-blue-600};
74
- --asc-icon-danger: #{p.$asc-red-500};
75
- --asc-icon-success: #{p.$asc-emerald-500};
76
- --asc-icon-info: #{p.$asc-blue-500};
77
-
78
- // ── Typography ─────────────────────────────────────────────────────────────
79
- --asc-font-family: 'Inter', -apple-system, BlinkMacSystemFont,
80
- 'Segoe UI', sans-serif;
81
- --asc-font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
82
- --asc-font-size-base: #{p.$asc-text-sm}; // 14px — base cho components
83
- --asc-line-height-base: #{p.$asc-leading-normal};
84
-
85
- // ── Spacing ────────────────────────────────────────────────────────────────
86
- // Component internal spacing — dùng trong padding/gap của component
87
- --asc-space-component-xs: #{p.$asc-space-1}; // 4px
88
- --asc-space-component-sm: #{p.$asc-space-2}; // 8px
89
- --asc-space-component-md: #{p.$asc-space-3}; // 12px
90
- --asc-space-component-lg: #{p.$asc-space-4}; // 16px
91
- --asc-space-component-xl: #{p.$asc-space-6}; // 24px
92
-
93
- // ── Border radius ──────────────────────────────────────────────────────────
94
- --asc-radius-sm: #{p.$asc-radius-base}; // 4px — badge, tag
95
- --asc-radius-md: #{p.$asc-radius-md}; // 6px — input, button
96
- --asc-radius-lg: #{p.$asc-radius-lg}; // 8px — card, panel
97
- --asc-radius-xl: #{p.$asc-radius-xl}; // 12px — dialog
98
- --asc-radius-full: #{p.$asc-radius-full}; // pill
99
-
100
- // ── Shadows ────────────────────────────────────────────────────────────────
101
- --asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
102
- --asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
103
- --asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
104
- --asc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
105
- --asc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
106
-
107
- // ── font-size ────────────────────────────────────────────────────────────────
108
- --asc-text-xs: #{p.$asc-text-xs};
109
- --asc-text-sm: #{p.$asc-text-sm};
110
- --asc-text-md: #{p.$asc-text-base};
111
- --asc-text-lg: #{p.$asc-text-lg};
112
- --asc-text-xl: #{p.$asc-text-xl};
113
-
114
- // ── Transitions ────────────────────────────────────────────────────────────
115
- --asc-transition-fast: #{p.$asc-duration-150} #{p.$asc-ease-in-out};
116
- --asc-transition-base: #{p.$asc-duration-200} #{p.$asc-ease-in-out};
117
- --asc-transition-slow: #{p.$asc-duration-300} #{p.$asc-ease-in-out};
118
-
119
- // ── Z-index ────────────────────────────────────────────────────────────────
120
- --asc-z-dropdown: 1000;
121
- --asc-z-sticky: 1020;
122
- --asc-z-fixed: 1030;
123
- --asc-z-modal-bg: 1040;
124
- --asc-z-modal: 1050;
125
- --asc-z-popover: 1060;
126
- --asc-z-tooltip: 1100;
127
- --asc-z-toast: 1200;
128
-
129
- // ── Component height scale ─────────────────────────────────────────────────
130
- // Dùng cho input, button, select — đảm bảo align nhau
131
- --asc-h-xs: 24px;
132
- --asc-h-sm: 32px;
133
- --asc-h-md: 36px;
134
- --asc-h-lg: 48px;
135
- --asc-h-xl: 56px;
136
- }
137
-
138
- // ── Dark mode overrides ──────────────────────────────────────────────────────
139
- // Class `.app-dark` được toggle bởi AscThemeService trên <html>
140
- .app-dark {
141
- // Brand.default KHÔNG đổi giữa light/dark (vẫn brand-500) — chỉ hover/active
142
- // nhạt dần cho hợp nền tối, theo đúng design-token-color.json (dark.Brand).
143
- --asc-color-primary-lighter: #{p.$asc-brand-900}; // Background.brand-lv1 (dark)
144
- --asc-color-primary-light: #{p.$asc-brand-800}; // Background.brand-lv2 (dark)
145
- --asc-color-primary-subtle: #{p.$asc-brand-700};
146
- --asc-color-primary: #{p.$asc-brand-500}; // Brand.default (dark) — không đổi so với light
147
- --asc-color-primary-hover: #{p.$asc-brand-400}; // Brand.hover (dark)
148
- --asc-color-primary-active: #{p.$asc-brand-300}; // Brand.secondary (dark)
149
-
150
- --asc-color-success-bg: #022c22; // Background.green (dark)
151
- --asc-color-warning-bg: #422006; // Background.yellow (dark)
152
- --asc-color-danger-bg: #{p.$asc-brand-950}; // Background.red (dark) = #5c0a05
153
- --asc-color-info-bg: #172554; // Background.blue (dark)
154
-
155
- --asc-surface-ground: #0c0c0d; // Background.default (dark)
156
- --asc-surface-base: #{p.$asc-grey-800}; // Background.surface (dark)
157
- --asc-surface-overlay: #{p.$asc-grey-800};
158
- --asc-surface-hover: #{p.$asc-grey-800};
159
- --asc-surface-active: #{p.$asc-grey-700}; // Background.onSurface (dark)
160
-
161
- --asc-border-color: #{p.$asc-grey-700}; // Border.default (dark)
162
- --asc-border-color-strong: #{p.$asc-grey-500}; // Border.secondary (dark)
163
- --asc-border-color-focus: #{p.$asc-blue-400};
164
- --asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand (dark) — không đổi
165
-
166
- --asc-text-primary: #{p.$asc-grey-10}; // Text.primary (dark)
167
- --asc-table-header-color: #{p.$asc-grey-10}; // dark giữ như cũ (= Text.primary dark) --asc-text-secondary: #{p.$asc-grey-200}; // Text.secondary (dark)
168
- --asc-text-muted: #{p.$asc-grey-300}; // Text.tertiary (dark)
169
- --asc-text-disabled: #{p.$asc-grey-600}; // Text.disable (dark)
170
- --asc-text-placeholder: #{p.$asc-grey-300};
171
- // Text.link (dark) trong design-token-color.json bị #ef4444 (trùng màu danger,
172
- // nghi lỗi copy-paste) — dùng blue-400 (nhạt hơn cho nền tối) thay vì giá trị lỗi đó.
173
- --asc-text-link: #{p.$asc-blue-400};
174
- --asc-text-link-hover: #{p.$asc-blue-400};
175
- --asc-text-brand: #{p.$asc-brand-500}; // không đổi
176
-
177
- --asc-icon-primary: #{p.$asc-grey-10};
178
- --asc-icon-secondary: #{p.$asc-grey-400}; // không đổi so với light
179
- --asc-icon-disabled: #{p.$asc-grey-600};
180
- --asc-icon-brand: #{p.$asc-brand-500};
181
- --asc-icon-link: #{p.$asc-blue-600}; // không đổi so với light
182
- --asc-icon-danger: #{p.$asc-red-500};
183
- --asc-icon-success: #{p.$asc-emerald-500};
184
- --asc-icon-info: #{p.$asc-blue-500};
185
-
186
- --asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
187
- --asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
188
- --asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
189
- --asc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
190
- --asc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
191
- }
1
+ @use 'primitive' as p;
2
+
3
+ // ─────────────────────────────────────────────────────────────────────────────
4
+ // Layer 2 — Semantic Tokens
5
+ //
6
+ // Role-based. Đây là layer component styles nên dùng.
7
+ // Expose thành CSS custom properties để support runtime theming (dark mode).
8
+ // ─────────────────────────────────────────────────────────────────────────────
9
+
10
+ :root {
11
+ // ── Color: Primary (brand) — theo design-token-color.json (Brand.default/hover/secondary) ──
12
+ --asc-color-primary-lighter: #{p.$asc-brand-50}; // Background.brand-lv1
13
+ --asc-color-primary-light: #{p.$asc-brand-100}; // Background.brand-lv2
14
+ --asc-color-primary-subtle: #{p.$asc-brand-200};
15
+ --asc-color-primary: #{p.$asc-brand-500}; // default state — Brand.default
16
+ --asc-color-primary-hover: #{p.$asc-brand-600}; // hover state — Brand.hover
17
+ --asc-color-primary-active: #{p.$asc-brand-700}; // active/pressed — Brand.secondary
18
+ --asc-color-primary-text: #{p.$asc-white}; // text on primary bg — Background.on-brand
19
+ // ── Color: Semantic states — theo design-token-color.json ───────────────────
20
+ --asc-color-success: #{p.$asc-emerald-500}; // Brand.tertiary / Text.success
21
+ --asc-color-success-bg: #{p.$asc-emerald-50}; // Background.green
22
+ --asc-color-success-border: #{p.$asc-green-100};
23
+
24
+ --asc-color-warning: #{p.$asc-amber-500}; // Border/Icon/Text.warning
25
+ --asc-color-warning-bg: #{p.$asc-yellow-50}; // Background.yellow
26
+ --asc-color-warning-border: #{p.$asc-yellow-100};
27
+
28
+ --asc-color-danger: #{p.$asc-red-500}; // Border/Icon/Text.danger
29
+ --asc-color-danger-bg: #{p.$asc-red-50}; // Background.red
30
+ --asc-color-danger-border: #{p.$asc-red-100};
31
+
32
+ --asc-color-info: #{p.$asc-blue-500}; // Border/Icon/Text.info
33
+ --asc-color-info-bg: #{p.$asc-blue-50}; // Background.blue
34
+ --asc-color-info-border: #{p.$asc-blue-100};
35
+
36
+ // ── Color: Surface (backgrounds) — Background.* (design-token-color.json) ──
37
+ --asc-surface-ground: #{p.$asc-grey-10}; // page background — Background.default dùng #fff, nhưng ground cần khác base 1 chút để phân lớp — giữ tone grey-10 gần trắng
38
+ --asc-surface-base: #{p.$asc-white}; // card / panel background — Background.default
39
+ --asc-surface-overlay: #{p.$asc-white}; // dialog / tooltip bg
40
+ --asc-surface-hover: #{p.$asc-grey-50}; // Background.surface
41
+ --asc-surface-active: #{p.$asc-grey-100}; // Background.onSurface
42
+ --asc-surface-0: #{p.$asc-white};
43
+ --asc-surface-50: #{p.$asc-white};
44
+ --asc-formfield-bg: #{p.$asc-white}; // nền input/select/datepicker... (PrimeNG formField.background)
45
+ --asc-formfield-focus-border-color: #{p.$asc-grey-300}; // input/border/focus = #A7A7A8
46
+ --asc-formfield-disabled-border-color: #{p.$asc-grey-50}; // input/border/disable = #F2F3F5
47
+ // Nút xóa (Delete action) trong input/select/datepicker/password... — tròn xám, dấu × trắng
48
+ --asc-input-clear-bg: #{p.$asc-grey-100};
49
+ --asc-input-clear-bg-hover: #{p.$asc-grey-200};
50
+ --asc-input-clear-color: #{p.$asc-white};
51
+
52
+ // ── Color: Border — Border.* (design-token-color.json) ──────────────────────
53
+ --asc-border-color: #{p.$asc-grey-100}; // Border.default
54
+ --asc-border-color-strong: #{p.$asc-grey-300}; // Border.secondary
55
+ --asc-border-color-focus: #{p.$asc-blue-500}; // Border.info
56
+ --asc-border-color-invalid: #{p.$asc-red-500}; // Border.danger
57
+ --asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand — token trước đây chưa có
58
+
59
+ // ── Color: Text — Text.* (design-token-color.json) ───────────────────────────
60
+ --asc-text-primary: #{p.$asc-grey-900}; // Text.primary
61
+ --asc-text-secondary: #{p.$asc-grey-600}; // Text.secondary — sửa theo tài liệu MD gốc (file color mới bị trùng giá trị với tertiary, nghi lỗi copy)
62
+ --asc-text-muted: #{p.$asc-grey-500}; // Text.tertiary
63
+ --asc-text-disabled: #{p.$asc-grey-200}; // Text.disable
64
+ --asc-text-inverse: #{p.$asc-white}; // Text.reverse
65
+ --asc-text-placeholder: #{p.$asc-grey-500};
66
+ --asc-text-link: #{p.$asc-blue-600}; // Text.link — ĐỔI: link giờ là xanh dương, không còn dùng brand đỏ
67
+ --asc-text-link-hover: #{p.$asc-blue-700};
68
+ --asc-text-invalid: #{p.$asc-red-500}; // Text.danger
69
+ --asc-text-brand: #{p.$asc-brand-500}; // Text.brand — token mới, tách riêng khỏi link
70
+ --asc-table-header-color: #A3A3A3; // chữ header AscTable — theo design mới
71
+ --asc-table-border-color: #0C0C0D1A; // kẻ ô table (grey đậm, alpha 10%) — theo design mới
72
+
73
+ // ── Color: Icon — Icon.* (design-token-color.json) — tier mới, trước đây
74
+ // component tự tái dùng --asc-text-*, giờ có set riêng theo đúng design ──────
75
+ --asc-icon-primary: #{p.$asc-grey-900};
76
+ --asc-icon-secondary: #{p.$asc-grey-400};
77
+ --asc-icon-disabled: #{p.$asc-grey-200};
78
+ --asc-icon-brand: #{p.$asc-brand-500};
79
+ --asc-icon-link: #{p.$asc-blue-600};
80
+ --asc-icon-danger: #{p.$asc-red-500};
81
+ --asc-icon-success: #{p.$asc-emerald-500};
82
+ --asc-icon-info: #{p.$asc-blue-500};
83
+
84
+ // ── Typography ─────────────────────────────────────────────────────────────
85
+ --asc-font-family: 'Inter', -apple-system, BlinkMacSystemFont,
86
+ 'Segoe UI', sans-serif;
87
+ --asc-font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
88
+ --asc-font-size-base: #{p.$asc-text-sm}; // 14px — base cho components
89
+ --asc-line-height-base: #{p.$asc-leading-normal};
90
+
91
+ // ── Spacing ────────────────────────────────────────────────────────────────
92
+ // Component internal spacing — dùng trong padding/gap của component
93
+ --asc-space-component-xs: #{p.$asc-space-1}; // 4px
94
+ --asc-space-component-sm: #{p.$asc-space-2}; // 8px
95
+ --asc-space-component-md: #{p.$asc-space-3}; // 12px
96
+ --asc-space-component-lg: #{p.$asc-space-4}; // 16px
97
+ --asc-space-component-xl: #{p.$asc-space-6}; // 24px
98
+
99
+ // ── Border radius ──────────────────────────────────────────────────────────
100
+ --asc-radius-sm: #{p.$asc-radius-base}; // 4px — badge, tag
101
+ --asc-radius-md: #{p.$asc-radius-md}; // 6px — input, button
102
+ --asc-radius-lg: #{p.$asc-radius-lg}; // 8px — card, panel
103
+ --asc-radius-xl: #{p.$asc-radius-xl}; // 12px — dialog
104
+ --asc-radius-full: #{p.$asc-radius-full}; // pill
105
+
106
+ // ── Shadows ────────────────────────────────────────────────────────────────
107
+ --asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
108
+ --asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
109
+ --asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
110
+ --asc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
111
+ --asc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
112
+
113
+ // ── font-size ────────────────────────────────────────────────────────────────
114
+ --asc-text-xs: #{p.$asc-text-xs};
115
+ --asc-text-sm: #{p.$asc-text-sm};
116
+ --asc-text-md: #{p.$asc-text-base};
117
+ --asc-text-lg: #{p.$asc-text-lg};
118
+ --asc-text-xl: #{p.$asc-text-xl};
119
+
120
+ // ── Transitions ────────────────────────────────────────────────────────────
121
+ --asc-transition-fast: #{p.$asc-duration-150} #{p.$asc-ease-in-out};
122
+ --asc-transition-base: #{p.$asc-duration-200} #{p.$asc-ease-in-out};
123
+ --asc-transition-slow: #{p.$asc-duration-300} #{p.$asc-ease-in-out};
124
+
125
+ // ── Z-index ────────────────────────────────────────────────────────────────
126
+ --asc-z-dropdown: 1000;
127
+ --asc-z-sticky: 1020;
128
+ --asc-z-fixed: 1030;
129
+ --asc-z-modal-bg: 1040;
130
+ --asc-z-modal: 1050;
131
+ --asc-z-popover: 1060;
132
+ --asc-z-tooltip: 1100;
133
+ --asc-z-toast: 1200;
134
+
135
+ // ── Component height scale ─────────────────────────────────────────────────
136
+ // Dùng cho input, button, select — đảm bảo align nhau
137
+ --asc-h-xs: 24px;
138
+ --asc-h-sm: 36px; // Figma Input small = 36px (trước 32px)
139
+ --asc-h-md: 40px; // Figma Input medium = 40px (trước 36px)
140
+ --asc-h-lg: 48px;
141
+ --asc-h-xl: 56px;
142
+
143
+ // ── Button (Figma Button/Anatomy) ──────────────────────────────────────────
144
+ // Nền solid lấy từ theme primary (#F74036 / hover #E6271B) — xem preset.ts
145
+ --asc-button-solid-text: #FCFCFC; // button/solid/text-default
146
+ --asc-button-outline-border: #525252; // button/outline/border-default
147
+ --asc-button-outline-text: #262626; // button/outline/text-default
148
+ --asc-button-outline-bg-hover: #{p.$asc-grey-50}; // design chưa có — dùng Background.surface
149
+ --asc-button-outline-bg-active: #{p.$asc-grey-100};
150
+ --asc-button-disabled-opacity: 0.35; // disable: 35%
151
+ }
152
+
153
+ // ── Dark mode overrides ──────────────────────────────────────────────────────
154
+ // Class `.app-dark` được toggle bởi AscThemeService trên <html>
155
+ .app-dark {
156
+ // Brand.default KHÔNG đổi giữa light/dark (vẫn brand-500) — chỉ hover/active
157
+ // nhạt dần cho hợp nền tối, theo đúng design-token-color.json (dark.Brand).
158
+ --asc-color-primary-lighter: #{p.$asc-brand-900}; // Background.brand-lv1 (dark)
159
+ --asc-color-primary-light: #{p.$asc-brand-800}; // Background.brand-lv2 (dark)
160
+ --asc-color-primary-subtle: #{p.$asc-brand-700};
161
+ --asc-color-primary: #{p.$asc-brand-500}; // Brand.default (dark) — không đổi so với light
162
+ --asc-color-primary-hover: #{p.$asc-brand-400}; // Brand.hover (dark)
163
+ --asc-color-primary-active: #{p.$asc-brand-300}; // Brand.secondary (dark)
164
+
165
+ --asc-color-success-bg: #022c22; // Background.green (dark)
166
+ --asc-color-warning-bg: #422006; // Background.yellow (dark)
167
+ --asc-color-danger-bg: #{p.$asc-brand-950}; // Background.red (dark) = #5c0a05
168
+ --asc-color-info-bg: #172554; // Background.blue (dark)
169
+
170
+ --asc-surface-ground: #0c0c0d; // Background.default (dark)
171
+ --asc-surface-base: #{p.$asc-grey-800}; // Background.surface (dark)
172
+ --asc-surface-overlay: #{p.$asc-grey-800};
173
+ --asc-surface-hover: #{p.$asc-grey-800};
174
+ --asc-surface-active: #{p.$asc-grey-700}; // Background.onSurface (dark)
175
+
176
+ --asc-border-color: #{p.$asc-grey-700}; // Border.default (dark)
177
+ --asc-border-color-strong: #{p.$asc-grey-500}; // Border.secondary (dark)
178
+ --asc-border-color-focus: #{p.$asc-blue-400};
179
+ --asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand (dark) — không đổi
180
+
181
+ --asc-text-primary: #{p.$asc-grey-10}; // Text.primary (dark)
182
+ --asc-table-header-color: #{p.$asc-grey-10}; // dark giữ như cũ (= Text.primary dark)
183
+ --asc-text-secondary: #{p.$asc-grey-200}; // Text.secondary (dark)
184
+ --asc-text-muted: #{p.$asc-grey-300}; // Text.tertiary (dark)
185
+ --asc-text-disabled: #{p.$asc-grey-600}; // Text.disable (dark)
186
+ --asc-text-placeholder: #{p.$asc-grey-300};
187
+ // Text.link (dark) trong design-token-color.json bị #ef4444 (trùng màu danger,
188
+ // nghi lỗi copy-paste) — dùng blue-400 (nhạt hơn cho nền tối) thay vì giá trị lỗi đó.
189
+ --asc-text-link: #{p.$asc-blue-400};
190
+ --asc-text-link-hover: #{p.$asc-blue-400};
191
+ --asc-text-brand: #{p.$asc-brand-500}; // không đổi
192
+
193
+ --asc-icon-primary: #{p.$asc-grey-10};
194
+ --asc-icon-secondary: #{p.$asc-grey-400}; // không đổi so với light
195
+ --asc-icon-disabled: #{p.$asc-grey-600};
196
+ --asc-icon-brand: #{p.$asc-brand-500};
197
+ --asc-icon-link: #{p.$asc-blue-600}; // không đổi so với light
198
+ --asc-icon-danger: #{p.$asc-red-500};
199
+ --asc-icon-success: #{p.$asc-emerald-500};
200
+ --asc-icon-info: #{p.$asc-blue-500};
201
+
202
+ // Button outline (dark) — design chưa có, đảo sang tone sáng để đọc được trên nền tối
203
+ --asc-button-outline-border: #{p.$asc-grey-400};
204
+ --asc-button-outline-text: #{p.$asc-grey-10};
205
+ --asc-button-outline-bg-hover: #{p.$asc-grey-800};
206
+ --asc-button-outline-bg-active: #{p.$asc-grey-700};
207
+
208
+ --asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
209
+ --asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
210
+ --asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
211
+ --asc-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
212
+ --asc-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
213
+ }
@@ -17,6 +17,8 @@
17
17
  left var(--layout-section-transition-duration);
18
18
  background-color: var(--asc-surface-base);
19
19
  border-radius: 20px;
20
+ // Padding sidebar theo design: dọc 16px, ngang 12px
21
+ padding: var(--layout-sidebar-padding-y, 16px) var(--layout-sidebar-padding-x, 12px);
20
22
  }
21
23
 
22
24
  // Logo đứng yên ở đầu sidebar, không cuộn theo menu
@@ -24,14 +26,14 @@
24
26
  flex-shrink: 0;
25
27
  display: flex;
26
28
  align-items: center;
27
- padding: 1rem 1.5rem 0.5rem;
29
+ padding: 0 0 var(--layout-sidebar-padding-y, 16px); // khoảng cách logo – menu
28
30
  }
29
31
 
30
32
  .layout-sidebar-content {
31
33
  flex: 1 1 auto;
32
34
  min-height: 0;
33
35
  overflow-y: auto;
34
- padding: 0.5rem 1.5rem;
36
+ padding: 0;
35
37
  }
36
38
 
37
39
  .layout-menu {
@@ -97,7 +99,7 @@
97
99
  outline: 0 none;
98
100
  color: var(--text-color);
99
101
  cursor: pointer;
100
- padding: 0.75rem 1rem;
102
+ padding: 10px 8px;
101
103
  border-radius: var(--content-border-radius);
102
104
  transition:
103
105
  background-color var(--element-transition-duration),
package/tokens/preset.css CHANGED
@@ -79,6 +79,11 @@
79
79
  --asc-surface-0: #ffffff;
80
80
  --asc-surface-50: #ffffff;
81
81
  --asc-formfield-bg: #ffffff;
82
+ --asc-formfield-focus-border-color: #a7a7a8;
83
+ --asc-formfield-disabled-border-color: #f2f3f5;
84
+ --asc-input-clear-bg: #dedfe0;
85
+ --asc-input-clear-bg-hover: #c0c0c2;
86
+ --asc-input-clear-color: #ffffff;
82
87
  --asc-border-color: #dedfe0;
83
88
  --asc-border-color-strong: #a7a7a8;
84
89
  --asc-border-color-focus: #3b82f6;
@@ -141,10 +146,16 @@
141
146
  --asc-z-tooltip: 1100;
142
147
  --asc-z-toast: 1200;
143
148
  --asc-h-xs: 24px;
144
- --asc-h-sm: 32px;
145
- --asc-h-md: 36px;
149
+ --asc-h-sm: 36px;
150
+ --asc-h-md: 40px;
146
151
  --asc-h-lg: 48px;
147
152
  --asc-h-xl: 56px;
153
+ --asc-button-solid-text: #FCFCFC;
154
+ --asc-button-outline-border: #525252;
155
+ --asc-button-outline-text: #262626;
156
+ --asc-button-outline-bg-hover: #f2f3f5;
157
+ --asc-button-outline-bg-active: #dedfe0;
158
+ --asc-button-disabled-opacity: 0.35;
148
159
  }
149
160
 
150
161
  .app-dark {
@@ -169,6 +180,7 @@
169
180
  --asc-border-color-brand: #f74036;
170
181
  --asc-text-primary: #fafafc;
171
182
  --asc-table-header-color: #fafafc;
183
+ --asc-text-secondary: #c0c0c2;
172
184
  --asc-text-muted: #a7a7a8;
173
185
  --asc-text-disabled: #5b5b5c;
174
186
  --asc-text-placeholder: #a7a7a8;
@@ -183,6 +195,10 @@
183
195
  --asc-icon-danger: #ef4444;
184
196
  --asc-icon-success: #10b981;
185
197
  --asc-icon-info: #3b82f6;
198
+ --asc-button-outline-border: #8d8e8f;
199
+ --asc-button-outline-text: #fafafc;
200
+ --asc-button-outline-bg-hover: #282829;
201
+ --asc-button-outline-bg-active: #424242;
186
202
  --asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
187
203
  --asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
188
204
  --asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
@@ -932,20 +948,21 @@ img {
932
948
  transition: transform var(--layout-section-transition-duration), left var(--layout-section-transition-duration);
933
949
  background-color: var(--asc-surface-base);
934
950
  border-radius: 20px;
951
+ padding: var(--layout-sidebar-padding-y, 16px) var(--layout-sidebar-padding-x, 12px);
935
952
  }
936
953
 
937
954
  .layout-sidebar-logo {
938
955
  flex-shrink: 0;
939
956
  display: flex;
940
957
  align-items: center;
941
- padding: 1rem 1.5rem 0.5rem;
958
+ padding: 0 0 var(--layout-sidebar-padding-y, 16px);
942
959
  }
943
960
 
944
961
  .layout-sidebar-content {
945
962
  flex: 1 1 auto;
946
963
  min-height: 0;
947
964
  overflow-y: auto;
948
- padding: 0.5rem 1.5rem;
965
+ padding: 0;
949
966
  }
950
967
 
951
968
  .layout-menu {
@@ -999,7 +1016,7 @@ img {
999
1016
  outline: 0 none;
1000
1017
  color: var(--text-color);
1001
1018
  cursor: pointer;
1002
- padding: 0.75rem 1rem;
1019
+ padding: 10px 8px;
1003
1020
  border-radius: var(--content-border-radius);
1004
1021
  transition: background-color var(--element-transition-duration), box-shadow var(--element-transition-duration);
1005
1022
  }
@@ -674,9 +674,20 @@ declare class AscFormFieldComponent implements AfterContentInit {
674
674
  readonly layout: _angular_core.InputSignal<AscFormLayout>;
675
675
  /**
676
676
  * Width cột label khi `layout="horizontal"` — nhận bất kỳ CSS length nào (`'10rem'`, `'160px'`, `'20%'`).
677
+ * Không truyền → không gắn inline style, width lấy theo CSS custom property
678
+ * `--asc-field-label-width` (đặt global hoặc theo vùng), fallback `max-content`.
677
679
  * Không ảnh hưởng layout `vertical`/`inline`.
678
680
  */
679
- readonly labelWidth: _angular_core.InputSignal<string>;
681
+ readonly labelWidth: _angular_core.InputSignal<string | undefined>;
682
+ /** Icon trước label (class icon, vd `'pi pi-user'`) — chỉ áp dụng typeLabel='default' */
683
+ readonly labelIcon: _angular_core.InputSignal<string>;
684
+ /** Icon sau label, trước dấu * (vd `'pi pi-info-circle'`) — chỉ áp dụng typeLabel='default' */
685
+ readonly labelSuffixIcon: _angular_core.InputSignal<string>;
686
+ /**
687
+ * Tooltip gắn vào icon sau label. Truyền tooltip mà không truyền `labelSuffixIcon`
688
+ * → tự hiện icon `pi pi-info-circle`.
689
+ */
690
+ readonly labelTooltip: _angular_core.InputSignal<string>;
680
691
  /**
681
692
  * Ẩn label text.
682
693
  * Dùng khi typeLabel='FloatLabel'/'IftaLabel' và label đã được hiển thị bên trong.
@@ -718,12 +729,17 @@ declare class AscFormFieldComponent implements AfterContentInit {
718
729
  * → chỉ cần set ở 1 trong 2 nơi (thường là ngay trên control), không cần lặp lại.
719
730
  */
720
731
  protected readonly resolvedMode: _angular_core.Signal<"edit" | "view">;
732
+ protected readonly resolvedLabelSuffixIcon: _angular_core.Signal<string>;
733
+ /** Dấu * bắt buộc — ẩn ở mode view (chỉ đọc, không cần nhập) */
734
+ protected readonly showRequiredMark: _angular_core.Signal<boolean>;
735
+ /** Chữ "(tùy chọn)" — ẩn ở mode view */
736
+ protected readonly showOptionalMark: _angular_core.Signal<boolean>;
721
737
  /** true nếu control bên trong đang disabled — form-field tự đọc qua ContentChild, không cần set thủ công */
722
738
  protected readonly resolvedDisabled: _angular_core.Signal<boolean>;
723
739
  protected readonly hostCls: _angular_core.Signal<string>;
724
740
  ngAfterContentInit(): void;
725
741
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AscFormFieldComponent, never>;
726
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<AscFormFieldComponent, "asc-form-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "typeLabel": { "alias": "typeLabel"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "labelWidth": { "alias": "labelWidth"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "forId": { "alias": "forId"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, {}, ["_innerControl"], ["*"], true, never>;
742
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AscFormFieldComponent, "asc-form-field", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "typeLabel": { "alias": "typeLabel"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "labelWidth": { "alias": "labelWidth"; "required": false; "isSignal": true; }; "labelIcon": { "alias": "labelIcon"; "required": false; "isSignal": true; }; "labelSuffixIcon": { "alias": "labelSuffixIcon"; "required": false; "isSignal": true; }; "labelTooltip": { "alias": "labelTooltip"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "optional": { "alias": "optional"; "required": false; "isSignal": true; }; "forId": { "alias": "forId"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, {}, ["_innerControl"], ["*"], true, never>;
727
743
  }
728
744
 
729
745
  declare class AscInputComponent extends BaseControlAccessor<string> {