@aseansc/ui 5.5.1 → 5.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +47 -0
- package/fesm2022/aseansc-ui.mjs +933 -597
- package/fesm2022/aseansc-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/tokens/_primitive.scss +5 -3
- package/tokens/_semantic.scss +39 -17
- package/tokens/layout/_main.scss +19 -19
- package/tokens/layout/_menu.scss +170 -171
- package/tokens/preset.css +35 -20
- package/types/aseansc-ui.d.ts +9 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aseansc/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.6.0",
|
|
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",
|
package/tokens/_primitive.scss
CHANGED
|
@@ -48,19 +48,20 @@ $asc-slate-800: #1e293b;
|
|
|
48
48
|
$asc-slate-900: #0f172a;
|
|
49
49
|
$asc-slate-950: #020617;
|
|
50
50
|
|
|
51
|
-
// ── Green —
|
|
51
|
+
// ── Green (success — theo export Figma Alias 2026-10-29: success = green/500) ──
|
|
52
52
|
$asc-green-50: #f0fdf4;
|
|
53
53
|
$asc-green-100: #dcfce7;
|
|
54
54
|
$asc-green-500: #22c55e;
|
|
55
55
|
$asc-green-600: #16a34a;
|
|
56
56
|
$asc-green-700: #15803d;
|
|
57
|
+
$asc-green-950: #052e16;
|
|
57
58
|
|
|
58
|
-
// ── Emerald (success
|
|
59
|
+
// ── Emerald — giữ lại (không xoá), success đã chuyển sang Green theo design ──
|
|
59
60
|
$asc-emerald-50: #ecfdf5;
|
|
60
61
|
$asc-emerald-500: #10b981;
|
|
61
62
|
$asc-emerald-600: #059669;
|
|
62
63
|
|
|
63
|
-
// ── Amber (warning
|
|
64
|
+
// ── Amber — giữ lại (không xoá), warning đã chuyển sang Yellow theo design ───
|
|
64
65
|
$asc-amber-500: #f59e0b;
|
|
65
66
|
|
|
66
67
|
// ── Yellow — vẫn dùng cho Background/yellow (bg nhạt của warning) ────────────
|
|
@@ -86,6 +87,7 @@ $asc-red-600: #dc2626;
|
|
|
86
87
|
|
|
87
88
|
// ── White / Black ─────────────────────────────────────────────────────────────
|
|
88
89
|
$asc-white: #ffffff;
|
|
90
|
+
$asc-white-variable: #fcfcfc; // Figma Color/white/variable — dùng cho Text/Icon.reverse
|
|
89
91
|
$asc-black: #000000;
|
|
90
92
|
|
|
91
93
|
// ── Spacing scale ─────────────────────────────────────────────────────────────
|
package/tokens/_semantic.scss
CHANGED
|
@@ -16,16 +16,16 @@
|
|
|
16
16
|
--asc-color-primary-hover: #{p.$asc-brand-600}; // hover state — Brand.hover
|
|
17
17
|
--asc-color-primary-active: #{p.$asc-brand-700}; // active/pressed — Brand.secondary
|
|
18
18
|
--asc-color-primary-text: #{p.$asc-white}; // text on primary bg — Background.on-brand
|
|
19
|
-
// ── Color: Semantic states — theo
|
|
20
|
-
--asc-color-success: #{p.$asc-
|
|
21
|
-
--asc-color-success-bg: #{p.$asc-
|
|
19
|
+
// ── Color: Semantic states — theo export Figma Alias (light/dark.tokens.json, 2026-10-29) ──
|
|
20
|
+
--asc-color-success: #{p.$asc-green-500}; // Brand.tertiary / Background/Border/Icon/Text.success
|
|
21
|
+
--asc-color-success-bg: #{p.$asc-green-50}; // Background.green
|
|
22
22
|
--asc-color-success-border: #{p.$asc-green-100};
|
|
23
23
|
|
|
24
|
-
--asc-color-warning: #{p.$asc-
|
|
24
|
+
--asc-color-warning: #{p.$asc-yellow-500}; // Background/Border.warning
|
|
25
25
|
--asc-color-warning-bg: #{p.$asc-yellow-50}; // Background.yellow
|
|
26
26
|
--asc-color-warning-border: #{p.$asc-yellow-100};
|
|
27
27
|
|
|
28
|
-
--asc-color-danger: #{p.$asc-red-500}; // Border/Icon/Text.danger
|
|
28
|
+
--asc-color-danger: #{p.$asc-red-500}; // Background/Border/Icon/Text.error (design đổi tên danger → error)
|
|
29
29
|
--asc-color-danger-bg: #{p.$asc-red-50}; // Background.red
|
|
30
30
|
--asc-color-danger-border: #{p.$asc-red-100};
|
|
31
31
|
|
|
@@ -36,14 +36,20 @@
|
|
|
36
36
|
// ── Color: Surface (backgrounds) — Background.* (design-token-color.json) ──
|
|
37
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
38
|
--asc-surface-base: #{p.$asc-white}; // card / panel background — Background.default
|
|
39
|
+
--asc-surface-translucent: #{rgba(p.$asc-white, 0.95)}; // layout main / sidebar / table header — nền trắng hơi trong
|
|
39
40
|
--asc-surface-overlay: #{p.$asc-white}; // dialog / tooltip bg
|
|
40
41
|
--asc-surface-hover: #{p.$asc-grey-50}; // Background.surface
|
|
41
42
|
--asc-surface-active: #{p.$asc-grey-100}; // Background.onSurface
|
|
43
|
+
// Background."surface 0" trong export mới = white 70% (light) / grey-400 (dark) — chưa áp
|
|
44
|
+
// vì đang làm nền table/radio, chờ designer xác nhận. Giữ trắng đặc.
|
|
42
45
|
--asc-surface-0: #{p.$asc-white};
|
|
43
46
|
--asc-surface-50: #{p.$asc-white};
|
|
44
47
|
--asc-formfield-bg: #{p.$asc-white}; // nền input/select/datepicker... (PrimeNG formField.background)
|
|
48
|
+
--asc-formfield-disabled-bg: #{p.$asc-grey-50}; // Input/background/disable
|
|
49
|
+
--asc-formfield-border-color: #{p.$asc-grey-100}; // Input/border/default
|
|
45
50
|
--asc-formfield-focus-border-color: #{p.$asc-grey-300}; // input/border/focus = #A7A7A8
|
|
46
51
|
--asc-formfield-disabled-border-color: #{p.$asc-grey-50}; // input/border/disable = #F2F3F5
|
|
52
|
+
--asc-formfield-placeholder-color: #{p.$asc-grey-600}; // Input/text/unfill
|
|
47
53
|
// Nút xóa (Delete action) trong input/select/datepicker/password... — tròn xám, dấu × trắng
|
|
48
54
|
--asc-input-clear-bg: #{p.$asc-grey-100};
|
|
49
55
|
--asc-input-clear-bg-hover: #{p.$asc-grey-200};
|
|
@@ -53,7 +59,7 @@
|
|
|
53
59
|
--asc-border-color: #{p.$asc-grey-100}; // Border.default
|
|
54
60
|
--asc-border-color-strong: #{p.$asc-grey-300}; // Border.secondary
|
|
55
61
|
--asc-border-color-focus: #{p.$asc-blue-500}; // Border.info
|
|
56
|
-
--asc-border-color-invalid: #{p.$asc-red-500}; // Border.
|
|
62
|
+
--asc-border-color-invalid: #{p.$asc-red-500}; // Border.error
|
|
57
63
|
--asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand — token trước đây chưa có
|
|
58
64
|
|
|
59
65
|
// ── Color: Text — Text.* (design-token-color.json) ───────────────────────────
|
|
@@ -61,13 +67,18 @@
|
|
|
61
67
|
--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
68
|
--asc-text-muted: #{p.$asc-grey-500}; // Text.tertiary
|
|
63
69
|
--asc-text-disabled: #{p.$asc-grey-200}; // Text.disable
|
|
64
|
-
--asc-text-inverse: #{p.$asc-white}; // Text.reverse
|
|
70
|
+
--asc-text-inverse: #{p.$asc-white-variable}; // Text.reverse = #FCFCFC (light + dark)
|
|
65
71
|
--asc-text-placeholder: #{p.$asc-grey-500};
|
|
66
72
|
--asc-text-link: #{p.$asc-blue-600}; // Text.link — ĐỔI: link giờ là xanh dương, không còn dùng brand đỏ
|
|
67
73
|
--asc-text-link-hover: #{p.$asc-blue-700};
|
|
68
|
-
--asc-text-invalid: #{p.$asc-red-500}; // Text.
|
|
74
|
+
--asc-text-invalid: #{p.$asc-red-500}; // Text.error
|
|
69
75
|
--asc-text-brand: #{p.$asc-brand-500}; // Text.brand — token mới, tách riêng khỏi link
|
|
70
76
|
--asc-table-header-color: #A3A3A3; // chữ header AscTable — theo design mới
|
|
77
|
+
--asc-paginator-border: transparent; // Pagination/border/default (light = trắng trên nền trắng)
|
|
78
|
+
--asc-paginator-border-active: transparent;
|
|
79
|
+
// Figma: white/499 (trắng 70%) trên khung #F2F3F5 — khung code giữ trắng 95% nên
|
|
80
|
+
// dùng Background/surface để mục active/hover còn nhìn thấy.
|
|
81
|
+
--asc-sidebar-item-active-bg: #{p.$asc-grey-50};
|
|
71
82
|
--asc-table-border-color: #0C0C0D1A; // kẻ ô table (grey đậm, alpha 10%) — theo design mới
|
|
72
83
|
|
|
73
84
|
// ── Color: Icon — Icon.* (design-token-color.json) — tier mới, trước đây
|
|
@@ -77,8 +88,8 @@
|
|
|
77
88
|
--asc-icon-disabled: #{p.$asc-grey-200};
|
|
78
89
|
--asc-icon-brand: #{p.$asc-brand-500};
|
|
79
90
|
--asc-icon-link: #{p.$asc-blue-600};
|
|
80
|
-
--asc-icon-danger: #{p.$asc-red-500};
|
|
81
|
-
--asc-icon-success: #{p.$asc-
|
|
91
|
+
--asc-icon-danger: #{p.$asc-red-500}; // Icon.error
|
|
92
|
+
--asc-icon-success: #{p.$asc-green-500};
|
|
82
93
|
--asc-icon-info: #{p.$asc-blue-500};
|
|
83
94
|
|
|
84
95
|
// ── Typography ─────────────────────────────────────────────────────────────
|
|
@@ -162,32 +173,43 @@
|
|
|
162
173
|
--asc-color-primary-hover: #{p.$asc-brand-400}; // Brand.hover (dark)
|
|
163
174
|
--asc-color-primary-active: #{p.$asc-brand-300}; // Brand.secondary (dark)
|
|
164
175
|
|
|
165
|
-
--asc-color-success-bg: #
|
|
176
|
+
--asc-color-success-bg: #{p.$asc-green-950}; // Background.green (dark)
|
|
166
177
|
--asc-color-warning-bg: #422006; // Background.yellow (dark)
|
|
167
178
|
--asc-color-danger-bg: #{p.$asc-brand-950}; // Background.red (dark) = #5c0a05
|
|
168
179
|
--asc-color-info-bg: #172554; // Background.blue (dark)
|
|
169
180
|
|
|
170
181
|
--asc-surface-ground: #0c0c0d; // Background.default (dark)
|
|
171
182
|
--asc-surface-base: #{p.$asc-grey-800}; // Background.surface (dark)
|
|
183
|
+
--asc-surface-translucent: #{rgba(p.$asc-grey-800, 0.95)}; // layout main / sidebar / table header (dark)
|
|
172
184
|
--asc-surface-overlay: #{p.$asc-grey-800};
|
|
173
185
|
--asc-surface-hover: #{p.$asc-grey-800};
|
|
174
186
|
--asc-surface-active: #{p.$asc-grey-700}; // Background.onSurface (dark)
|
|
175
187
|
|
|
188
|
+
// Form field (dark) — theo Figma Components: Input/* (dark)
|
|
189
|
+
--asc-formfield-bg: #{p.$asc-grey-800}; // Input/background/default = Background/surface
|
|
190
|
+
--asc-formfield-disabled-bg: #{p.$asc-grey-800}; // Input/background/disable
|
|
191
|
+
--asc-formfield-border-color: #{p.$asc-grey-700}; // Input/border/default
|
|
192
|
+
--asc-formfield-focus-border-color: #{p.$asc-grey-500}; // Input/border/focus = Border/secondary
|
|
193
|
+
--asc-formfield-disabled-border-color: #{p.$asc-grey-800}; // = nền disable
|
|
194
|
+
--asc-formfield-placeholder-color: #{p.$asc-grey-200}; // Input/text/unfill = Text/secondary
|
|
195
|
+
|
|
176
196
|
--asc-border-color: #{p.$asc-grey-700}; // Border.default (dark)
|
|
177
197
|
--asc-border-color-strong: #{p.$asc-grey-500}; // Border.secondary (dark)
|
|
178
|
-
--asc-border-color-focus: #{p.$asc-blue-
|
|
198
|
+
--asc-border-color-focus: #{p.$asc-blue-500}; // Border.info (dark) — không đổi so với light
|
|
179
199
|
--asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand (dark) — không đổi
|
|
180
200
|
|
|
181
201
|
--asc-text-primary: #{p.$asc-grey-10}; // Text.primary (dark)
|
|
182
202
|
--asc-table-header-color: #{p.$asc-grey-10}; // dark giữ như cũ (= Text.primary dark)
|
|
203
|
+
--asc-paginator-border: #{p.$asc-grey-700}; // Pagination/border/default (dark) = Border/default
|
|
204
|
+
--asc-paginator-border-active: #{p.$asc-brand-500}; // Pagination/border/hover (dark) = Border/brand
|
|
205
|
+
--asc-sidebar-item-active-bg: #{rgba(#0c0c0d, 0.7)}; // Sidebar/background/Active (dark) = black/500
|
|
206
|
+
--asc-dialog-bg: #{rgba(#0c0c0d, 0.9)}; // Modal/background (dark) = Background/default
|
|
183
207
|
--asc-text-secondary: #{p.$asc-grey-200}; // Text.secondary (dark)
|
|
184
208
|
--asc-text-muted: #{p.$asc-grey-300}; // Text.tertiary (dark)
|
|
185
209
|
--asc-text-disabled: #{p.$asc-grey-600}; // Text.disable (dark)
|
|
186
210
|
--asc-text-placeholder: #{p.$asc-grey-300};
|
|
187
|
-
// Text.link (dark)
|
|
188
|
-
|
|
189
|
-
--asc-text-link: #{p.$asc-blue-400};
|
|
190
|
-
--asc-text-link-hover: #{p.$asc-blue-400};
|
|
211
|
+
--asc-text-link: #{p.$asc-blue-500}; // Text.link (dark) — export Figma 2026-10-29
|
|
212
|
+
--asc-text-link-hover: #{p.$asc-blue-400}; // design chưa có hover — nhạt hơn 1 bậc trên nền tối
|
|
191
213
|
--asc-text-brand: #{p.$asc-brand-500}; // không đổi
|
|
192
214
|
|
|
193
215
|
--asc-icon-primary: #{p.$asc-grey-10};
|
|
@@ -196,7 +218,7 @@
|
|
|
196
218
|
--asc-icon-brand: #{p.$asc-brand-500};
|
|
197
219
|
--asc-icon-link: #{p.$asc-blue-600}; // không đổi so với light
|
|
198
220
|
--asc-icon-danger: #{p.$asc-red-500};
|
|
199
|
-
--asc-icon-success: #{p.$asc-
|
|
221
|
+
--asc-icon-success: #{p.$asc-green-500};
|
|
200
222
|
--asc-icon-info: #{p.$asc-blue-500};
|
|
201
223
|
|
|
202
224
|
// Button outline (dark) — design chưa có, đảo sang tone sáng để đọc được trên nền tối
|
package/tokens/layout/_main.scss
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
.layout-main-container {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
min-height: 100vh;
|
|
5
|
-
justify-content: space-between;
|
|
6
|
-
padding: 6rem 2rem 0 2rem;
|
|
7
|
-
transition: margin-left var(--layout-section-transition-duration);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.layout-main {
|
|
11
|
-
flex: 1 1 auto;
|
|
12
|
-
padding: 1.5rem 1.5rem 2rem;
|
|
13
|
-
background: var(--asc-surface-
|
|
14
|
-
border-radius: 1.25rem;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
img {
|
|
18
|
-
max-width: none !important;
|
|
19
|
-
}
|
|
1
|
+
.layout-main-container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
min-height: 100vh;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
padding: 6rem 2rem 0 2rem;
|
|
7
|
+
transition: margin-left var(--layout-section-transition-duration);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.layout-main {
|
|
11
|
+
flex: 1 1 auto;
|
|
12
|
+
padding: 1.5rem 1.5rem 2rem;
|
|
13
|
+
background-color: var(--asc-surface-translucent);
|
|
14
|
+
border-radius: 1.25rem;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
img {
|
|
18
|
+
max-width: none !important;
|
|
19
|
+
}
|
package/tokens/layout/_menu.scss
CHANGED
|
@@ -1,171 +1,170 @@
|
|
|
1
|
-
@use 'mixins' as *;
|
|
2
|
-
|
|
3
|
-
.layout-sidebar {
|
|
4
|
-
position: fixed;
|
|
5
|
-
width: var(--layout-sidebar-width);
|
|
6
|
-
// full chiều cao viewport, nổi cách mép 1 khoảng gap
|
|
7
|
-
height: calc(100vh - 2 * var(--layout-sidebar-gap));
|
|
8
|
-
z-index: 999;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
overflow: hidden; // clip scrollbar của .layout-sidebar-content theo border-radius
|
|
12
|
-
user-select: none;
|
|
13
|
-
top: var(--layout-sidebar-gap);
|
|
14
|
-
left: var(--layout-sidebar-gap);
|
|
15
|
-
transition:
|
|
16
|
-
transform var(--layout-section-transition-duration),
|
|
17
|
-
left var(--layout-section-transition-duration);
|
|
18
|
-
background-color: var(--asc-surface-
|
|
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);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Logo đứng yên ở đầu sidebar, không cuộn theo menu
|
|
25
|
-
.layout-sidebar-logo {
|
|
26
|
-
flex-shrink: 0;
|
|
27
|
-
display: flex;
|
|
28
|
-
align-items: center;
|
|
29
|
-
padding: 0 0 var(--layout-sidebar-padding-y, 16px); // khoảng cách logo – menu
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.layout-sidebar-content {
|
|
33
|
-
flex: 1 1 auto;
|
|
34
|
-
min-height: 0;
|
|
35
|
-
overflow-y: auto;
|
|
36
|
-
padding: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.layout-menu {
|
|
40
|
-
margin: 0;
|
|
41
|
-
padding: 0;
|
|
42
|
-
list-style-type: none;
|
|
43
|
-
|
|
44
|
-
.layout-root-menuitem {
|
|
45
|
-
> .layout-menuitem-root-text {
|
|
46
|
-
font-size: 0.857rem;
|
|
47
|
-
text-transform: uppercase;
|
|
48
|
-
font-weight: 700;
|
|
49
|
-
color: var(--text-color);
|
|
50
|
-
margin: 0.75rem 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
> a {
|
|
54
|
-
display: none;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
a {
|
|
59
|
-
user-select: none;
|
|
60
|
-
|
|
61
|
-
&.active-menuitem {
|
|
62
|
-
> .layout-submenu-toggler {
|
|
63
|
-
transform: rotate(-180deg);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
li.active-menuitem {
|
|
69
|
-
> a {
|
|
70
|
-
.layout-submenu-toggler {
|
|
71
|
-
transform: rotate(-180deg);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
ul {
|
|
77
|
-
margin: 0;
|
|
78
|
-
padding: 0;
|
|
79
|
-
list-style-type: none;
|
|
80
|
-
|
|
81
|
-
// Áp dụng cho MỌI cấp submenu (`.layout-menu ul` khớp mọi <ul> con cháu
|
|
82
|
-
// của .layout-menu bất kể độ sâu) — AppMenuitem bind [class.layout-submenu-expanded]
|
|
83
|
-
// trực tiếp lên <ul> submenu của chính nó ở TẤT CẢ các cấp đệ quy, kể cả
|
|
84
|
-
// cấp 1 (submenu của root menuitem), nên rule collapse/expand không được
|
|
85
|
-
// đặt lồng thêm 1 cấp `ul { ul {...} }` (chỉ khớp từ cấp 2 trở đi).
|
|
86
|
-
overflow: hidden;
|
|
87
|
-
border-radius: var(--content-border-radius);
|
|
88
|
-
max-height: 0;
|
|
89
|
-
transition: max-height 400ms cubic-bezier(0.86, 0, 0.07, 1);
|
|
90
|
-
|
|
91
|
-
&.layout-submenu-expanded {
|
|
92
|
-
max-height: 1000px;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
a {
|
|
96
|
-
display: flex;
|
|
97
|
-
align-items: center;
|
|
98
|
-
position: relative;
|
|
99
|
-
outline: 0 none;
|
|
100
|
-
color: var(--text-color);
|
|
101
|
-
cursor: pointer;
|
|
102
|
-
padding:
|
|
103
|
-
border-radius:
|
|
104
|
-
transition:
|
|
105
|
-
background-color var(--element-transition-duration),
|
|
106
|
-
box-shadow var(--element-transition-duration);
|
|
107
|
-
|
|
108
|
-
.layout-menuitem-icon {
|
|
109
|
-
margin-right: 0.5rem;
|
|
110
|
-
flex-shrink: 0;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
}
|
|
1
|
+
@use 'mixins' as *;
|
|
2
|
+
|
|
3
|
+
.layout-sidebar {
|
|
4
|
+
position: fixed;
|
|
5
|
+
width: var(--layout-sidebar-width);
|
|
6
|
+
// full chiều cao viewport, nổi cách mép 1 khoảng gap
|
|
7
|
+
height: calc(100vh - 2 * var(--layout-sidebar-gap));
|
|
8
|
+
z-index: 999;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
overflow: hidden; // clip scrollbar của .layout-sidebar-content theo border-radius
|
|
12
|
+
user-select: none;
|
|
13
|
+
top: var(--layout-sidebar-gap);
|
|
14
|
+
left: var(--layout-sidebar-gap);
|
|
15
|
+
transition:
|
|
16
|
+
transform var(--layout-section-transition-duration),
|
|
17
|
+
left var(--layout-section-transition-duration);
|
|
18
|
+
background-color: var(--asc-surface-translucent);
|
|
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);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Logo đứng yên ở đầu sidebar, không cuộn theo menu
|
|
25
|
+
.layout-sidebar-logo {
|
|
26
|
+
flex-shrink: 0;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: 0 0 var(--layout-sidebar-padding-y, 16px); // khoảng cách logo – menu
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.layout-sidebar-content {
|
|
33
|
+
flex: 1 1 auto;
|
|
34
|
+
min-height: 0;
|
|
35
|
+
overflow-y: auto;
|
|
36
|
+
padding: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.layout-menu {
|
|
40
|
+
margin: 0;
|
|
41
|
+
padding: 0;
|
|
42
|
+
list-style-type: none;
|
|
43
|
+
|
|
44
|
+
.layout-root-menuitem {
|
|
45
|
+
> .layout-menuitem-root-text {
|
|
46
|
+
font-size: 0.857rem;
|
|
47
|
+
text-transform: uppercase;
|
|
48
|
+
font-weight: 700;
|
|
49
|
+
color: var(--text-color);
|
|
50
|
+
margin: 0.75rem 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
> a {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
a {
|
|
59
|
+
user-select: none;
|
|
60
|
+
|
|
61
|
+
&.active-menuitem {
|
|
62
|
+
> .layout-submenu-toggler {
|
|
63
|
+
transform: rotate(-180deg);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
li.active-menuitem {
|
|
69
|
+
> a {
|
|
70
|
+
.layout-submenu-toggler {
|
|
71
|
+
transform: rotate(-180deg);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
ul {
|
|
77
|
+
margin: 0;
|
|
78
|
+
padding: 0;
|
|
79
|
+
list-style-type: none;
|
|
80
|
+
|
|
81
|
+
// Áp dụng cho MỌI cấp submenu (`.layout-menu ul` khớp mọi <ul> con cháu
|
|
82
|
+
// của .layout-menu bất kể độ sâu) — AppMenuitem bind [class.layout-submenu-expanded]
|
|
83
|
+
// trực tiếp lên <ul> submenu của chính nó ở TẤT CẢ các cấp đệ quy, kể cả
|
|
84
|
+
// cấp 1 (submenu của root menuitem), nên rule collapse/expand không được
|
|
85
|
+
// đặt lồng thêm 1 cấp `ul { ul {...} }` (chỉ khớp từ cấp 2 trở đi).
|
|
86
|
+
overflow: hidden;
|
|
87
|
+
border-radius: var(--content-border-radius);
|
|
88
|
+
max-height: 0;
|
|
89
|
+
transition: max-height 400ms cubic-bezier(0.86, 0, 0.07, 1);
|
|
90
|
+
|
|
91
|
+
&.layout-submenu-expanded {
|
|
92
|
+
max-height: 1000px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
a {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
position: relative;
|
|
99
|
+
outline: 0 none;
|
|
100
|
+
color: var(--text-color);
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
padding: 8px; // Figma Sidebar-item
|
|
103
|
+
border-radius: 8px;
|
|
104
|
+
transition:
|
|
105
|
+
background-color var(--element-transition-duration),
|
|
106
|
+
box-shadow var(--element-transition-duration);
|
|
107
|
+
|
|
108
|
+
.layout-menuitem-icon {
|
|
109
|
+
margin-right: 0.5rem;
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
font-size: 20px; // Figma Sidebar-item icon 20×20 (item.iconSize vẫn ghi đè được)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.layout-submenu-toggler {
|
|
115
|
+
font-size: 75%;
|
|
116
|
+
margin-left: auto;
|
|
117
|
+
transition: transform var(--element-transition-duration);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// Figma Sidebar-item Hover/Active: nền trắng 70% (dark: đen 70%), chữ đen 500 — không dùng brand
|
|
121
|
+
&.active-route,
|
|
122
|
+
&:hover {
|
|
123
|
+
background-color: var(--asc-sidebar-item-active-bg);
|
|
124
|
+
font-weight: 500;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&:focus {
|
|
128
|
+
@include focused-inset();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
ul {
|
|
133
|
+
li {
|
|
134
|
+
a {
|
|
135
|
+
margin-left: 1rem;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
li {
|
|
139
|
+
a {
|
|
140
|
+
margin-left: 2rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
li {
|
|
144
|
+
a {
|
|
145
|
+
margin-left: 2.5rem;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
li {
|
|
149
|
+
a {
|
|
150
|
+
margin-left: 3rem;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
li {
|
|
154
|
+
a {
|
|
155
|
+
margin-left: 3.5rem;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
li {
|
|
159
|
+
a {
|
|
160
|
+
margin-left: 4rem;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|