@aseansc/ui 5.9.2 → 5.11.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 +48 -0
- package/fesm2022/aseansc-ui.mjs +468 -254
- package/fesm2022/aseansc-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/tokens/layout/_main.scss +5 -3
- package/tokens/layout/_menu.scss +198 -170
- package/tokens/layout/_responsive.scss +67 -3
- package/tokens/layout/_topbar.scss +2 -2
- package/tokens/layout/variables/_common.scss +8 -1
- package/tokens/preset.css +85 -13
- package/types/aseansc-ui.d.ts +46 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aseansc/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.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/layout/_main.scss
CHANGED
|
@@ -3,16 +3,18 @@
|
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
min-height: 100vh;
|
|
5
5
|
justify-content: space-between;
|
|
6
|
-
padding
|
|
6
|
+
// padding-top = cao topbar (fixed) + khoảng topbar ↔ nội dung, để topbar không che nội dung
|
|
7
|
+
padding: calc(var(--layout-topbar-height) + var(--layout-content-top-gap)) var(--layout-content-gap) 0
|
|
8
|
+
var(--layout-content-gap);
|
|
7
9
|
transition: margin-left var(--layout-section-transition-duration);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
.layout-main {
|
|
11
13
|
flex: 1 1 auto;
|
|
12
|
-
padding:
|
|
14
|
+
padding: var(--layout-main-padding);
|
|
13
15
|
background-color: var(--asc-surface-translucent);
|
|
14
16
|
border-radius: 1.25rem;
|
|
15
|
-
margin-bottom:
|
|
17
|
+
margin-bottom: var(--layout-main-margin-bottom);
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
img {
|
package/tokens/layout/_menu.scss
CHANGED
|
@@ -1,170 +1,198 @@
|
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.layout-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
|
|
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
|
+
width var(--layout-section-transition-duration);
|
|
19
|
+
background-color: var(--asc-surface-translucent);
|
|
20
|
+
border-radius: 20px;
|
|
21
|
+
// Padding sidebar theo design: dọc 16px, ngang 12px
|
|
22
|
+
padding: var(--layout-sidebar-padding-y, 16px) var(--layout-sidebar-padding-x, 12px);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Logo đứng yên ở đầu sidebar, không cuộn theo menu
|
|
26
|
+
.layout-sidebar-logo {
|
|
27
|
+
flex-shrink: 0;
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
padding: 0 0 var(--layout-sidebar-padding-y, 16px); // khoảng cách logo – menu
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Logo thu gọn (sideBarLogoCollapsed) chỉ hiện ở dạng dải — xem _responsive.scss
|
|
34
|
+
.layout-sidebar-logo-collapsed {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Chữ cái đầu thay icon (mục không có icon) chỉ hiện ở dạng dải. Dạng đầy đủ giữ đúng khoảng
|
|
39
|
+
// như icon rỗng trước đây: rộng 0, chỉ còn margin-right của .layout-menuitem-icon.
|
|
40
|
+
.layout-menuitem-initial {
|
|
41
|
+
width: 0;
|
|
42
|
+
overflow: hidden;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Popup menu con khi sidebar dạng dải — Figma: rộng 200, item 184×36 (gắn vào body)
|
|
46
|
+
.asc-sidebar-rail-popup.p-menu {
|
|
47
|
+
width: 200px;
|
|
48
|
+
min-width: 200px;
|
|
49
|
+
|
|
50
|
+
.p-menu-list {
|
|
51
|
+
padding: 8px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.p-menu-item-link-active {
|
|
55
|
+
background-color: var(--asc-sidebar-item-active-bg);
|
|
56
|
+
font-weight: 500;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.layout-sidebar-content {
|
|
61
|
+
flex: 1 1 auto;
|
|
62
|
+
min-height: 0;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
padding: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.layout-menu {
|
|
68
|
+
margin: 0;
|
|
69
|
+
padding: 0;
|
|
70
|
+
list-style-type: none;
|
|
71
|
+
|
|
72
|
+
.layout-root-menuitem {
|
|
73
|
+
> .layout-menuitem-root-text {
|
|
74
|
+
font-size: 0.857rem;
|
|
75
|
+
text-transform: uppercase;
|
|
76
|
+
font-weight: 700;
|
|
77
|
+
color: var(--text-color);
|
|
78
|
+
margin: 0.75rem 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
> a {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
a {
|
|
87
|
+
user-select: none;
|
|
88
|
+
|
|
89
|
+
&.active-menuitem {
|
|
90
|
+
> .layout-submenu-toggler {
|
|
91
|
+
transform: rotate(90deg); // CaretRight → CaretDown
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
li.active-menuitem {
|
|
97
|
+
> a {
|
|
98
|
+
.layout-submenu-toggler {
|
|
99
|
+
transform: rotate(90deg); // CaretRight → CaretDown
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
ul {
|
|
105
|
+
margin: 0;
|
|
106
|
+
padding: 0;
|
|
107
|
+
list-style-type: none;
|
|
108
|
+
|
|
109
|
+
// Áp dụng cho MỌI cấp submenu (`.layout-menu ul` khớp mọi <ul> con cháu
|
|
110
|
+
// của .layout-menu bất kể độ sâu) — AppMenuitem bind [class.layout-submenu-expanded]
|
|
111
|
+
// trực tiếp lên <ul> submenu của chính nó ở TẤT CẢ các cấp đệ quy, kể cả
|
|
112
|
+
// cấp 1 (submenu của root menuitem), nên rule collapse/expand không được
|
|
113
|
+
// đặt lồng thêm 1 cấp `ul { ul {...} }` (chỉ khớp từ cấp 2 trở đi).
|
|
114
|
+
overflow: hidden;
|
|
115
|
+
border-radius: var(--content-border-radius);
|
|
116
|
+
max-height: 0;
|
|
117
|
+
transition: max-height 400ms cubic-bezier(0.86, 0, 0.07, 1);
|
|
118
|
+
|
|
119
|
+
&.layout-submenu-expanded {
|
|
120
|
+
max-height: 1000px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
a {
|
|
124
|
+
display: flex;
|
|
125
|
+
align-items: center;
|
|
126
|
+
position: relative;
|
|
127
|
+
outline: 0 none;
|
|
128
|
+
color: var(--text-color);
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
padding: 8px; // Figma Sidebar-item
|
|
131
|
+
border-radius: 8px;
|
|
132
|
+
transition:
|
|
133
|
+
background-color var(--element-transition-duration),
|
|
134
|
+
box-shadow var(--element-transition-duration);
|
|
135
|
+
|
|
136
|
+
.layout-menuitem-icon {
|
|
137
|
+
margin-right: 0.5rem;
|
|
138
|
+
flex-shrink: 0;
|
|
139
|
+
font-size: 20px; // Figma Sidebar-item icon 20×20 (item.iconSize vẫn ghi đè được)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Figma: Phosphor CaretRight/CaretDown 18×18 (asc-svg-icon size="18px")
|
|
143
|
+
.layout-submenu-toggler {
|
|
144
|
+
margin-left: auto;
|
|
145
|
+
transition: transform var(--element-transition-duration);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Figma Sidebar-item Hover/Active: nền trắng 70% (dark: đen 70%), chữ đen 500 — không dùng brand
|
|
149
|
+
&.active-route,
|
|
150
|
+
&:hover {
|
|
151
|
+
background-color: var(--asc-sidebar-item-active-bg);
|
|
152
|
+
font-weight: 500;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&:focus {
|
|
156
|
+
@include focused-inset();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
ul {
|
|
161
|
+
li {
|
|
162
|
+
a {
|
|
163
|
+
margin-left: 1rem;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
li {
|
|
167
|
+
a {
|
|
168
|
+
margin-left: 2rem;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
li {
|
|
172
|
+
a {
|
|
173
|
+
margin-left: 2.5rem;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
li {
|
|
177
|
+
a {
|
|
178
|
+
margin-left: 3rem;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
li {
|
|
182
|
+
a {
|
|
183
|
+
margin-left: 3.5rem;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
li {
|
|
187
|
+
a {
|
|
188
|
+
margin-left: 4rem;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
&.layout-overlay {
|
|
13
13
|
.layout-main-container {
|
|
14
14
|
margin-left: 0;
|
|
15
|
-
padding-left:
|
|
15
|
+
padding-left: var(--layout-content-gap);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.layout-sidebar {
|
|
@@ -63,7 +63,71 @@
|
|
|
63
63
|
|
|
64
64
|
.layout-main-container {
|
|
65
65
|
margin-left: 0;
|
|
66
|
-
padding-left:
|
|
66
|
+
padding-left: var(--layout-content-gap);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Thu gọn dạng dải icon (layout.sidebarCollapse = 'rail') — Figma "Trạng thái Thu gọn":
|
|
71
|
+
// dải 84px, item 60×40, icon 20, ẩn chữ / tiêu đề / mũi tên; nhóm mở popup (app.menuitem).
|
|
72
|
+
&.layout-sidebar-rail {
|
|
73
|
+
// Khai lại offset ở đây: biến tính ở :root không tự tính lại theo width mới
|
|
74
|
+
--layout-sidebar-width: var(--layout-sidebar-rail-width);
|
|
75
|
+
--layout-sidebar-offset: calc(var(--layout-sidebar-gap) + var(--layout-sidebar-width));
|
|
76
|
+
|
|
77
|
+
.layout-sidebar-logo {
|
|
78
|
+
justify-content: center;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.layout-sidebar-logo--has-collapsed {
|
|
82
|
+
.layout-sidebar-logo-full {
|
|
83
|
+
display: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.layout-sidebar-logo-collapsed {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: center;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.layout-sidebar-content {
|
|
93
|
+
overflow-x: hidden;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.layout-menu {
|
|
97
|
+
.layout-menuitem-root-text,
|
|
98
|
+
.layout-menuitem-text,
|
|
99
|
+
.layout-submenu-toggler {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Menu con nằm trong popup, không xổ trên dải
|
|
104
|
+
.layout-root-menuitem ul ul {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
ul a {
|
|
109
|
+
justify-content: center;
|
|
110
|
+
height: 40px;
|
|
111
|
+
padding: 10px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.layout-menuitem-icon {
|
|
115
|
+
margin-right: 0;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.layout-menuitem-initial {
|
|
119
|
+
width: 20px;
|
|
120
|
+
overflow: visible;
|
|
121
|
+
text-align: center;
|
|
122
|
+
font-size: 14px;
|
|
123
|
+
line-height: 20px;
|
|
124
|
+
font-weight: 600;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// Nhóm chứa trang đang mở: nền như mục active
|
|
128
|
+
.layout-root-menuitem > ul > li:has(.active-route) > a {
|
|
129
|
+
background-color: var(--asc-sidebar-item-active-bg);
|
|
130
|
+
}
|
|
67
131
|
}
|
|
68
132
|
}
|
|
69
133
|
}
|
|
@@ -82,7 +146,7 @@
|
|
|
82
146
|
.layout-wrapper {
|
|
83
147
|
.layout-main-container {
|
|
84
148
|
margin-left: 0;
|
|
85
|
-
padding-left:
|
|
149
|
+
padding-left: var(--layout-content-gap);
|
|
86
150
|
}
|
|
87
151
|
|
|
88
152
|
.layout-sidebar {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
.layout-topbar {
|
|
4
4
|
position: fixed;
|
|
5
|
-
height:
|
|
5
|
+
height: var(--layout-topbar-height);
|
|
6
6
|
z-index: 997;
|
|
7
7
|
left: 0;
|
|
8
8
|
top: 0;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
border-radius: var(--content-border-radius);
|
|
130
130
|
padding: 1rem;
|
|
131
131
|
right: 2rem;
|
|
132
|
-
top:
|
|
132
|
+
top: var(--layout-topbar-height);
|
|
133
133
|
min-width: 15rem;
|
|
134
134
|
border: 1px solid var(--surface-border);
|
|
135
135
|
|
|
@@ -12,7 +12,14 @@
|
|
|
12
12
|
--content-border-radius: var(--p-content-border-radius);
|
|
13
13
|
--layout-section-transition-duration: 0.2s;
|
|
14
14
|
--layout-sidebar-width: 212px;
|
|
15
|
-
--layout-sidebar-
|
|
15
|
+
--layout-sidebar-rail-width: 84px; // sidebar thu gọn dạng dải icon (layout.sidebarCollapse = 'rail')
|
|
16
|
+
--layout-sidebar-gap: 12px; // khoảng hở giữa sidebar nổi và mép viewport
|
|
17
|
+
// Khoảng cách layout viết bằng px: html font-size 14px nên rem ra số lẻ (14, 21, 28…). App ghi đè được.
|
|
18
|
+
--layout-topbar-height: 64px;
|
|
19
|
+
--layout-content-gap: 16px; // sidebar ↔ nội dung, nội dung ↔ mép phải
|
|
20
|
+
--layout-content-top-gap: 12px; // topbar ↔ nội dung
|
|
21
|
+
--layout-main-padding: 24px; // padding trong card .layout-main
|
|
22
|
+
--layout-main-margin-bottom: 12px; // card ↔ đáy viewport
|
|
16
23
|
// mép phải của sidebar tính từ mép trái viewport — topbar/main bắt đầu từ đây
|
|
17
24
|
--layout-sidebar-offset: calc(var(--layout-sidebar-gap) + var(--layout-sidebar-width));
|
|
18
25
|
--element-transition-duration: var(--p-transition-duration);
|