@aseansc/ui 4.1.0 → 5.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aseansc/ui",
3
- "version": "4.1.0",
3
+ "version": "5.0.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",
@@ -39,7 +39,9 @@
39
39
  --asc-surface-overlay: #{p.$asc-white}; // dialog / tooltip bg
40
40
  --asc-surface-hover: #{p.$asc-grey-50}; // Background.surface
41
41
  --asc-surface-active: #{p.$asc-grey-100}; // Background.onSurface
42
- --asc-surface-50: #{p.$asc-grey-50};
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)
43
45
 
44
46
  // ── Color: Border — Border.* (design-token-color.json) ──────────────────────
45
47
  --asc-border-color: #{p.$asc-grey-100}; // Border.default
@@ -59,6 +61,8 @@
59
61
  --asc-text-link-hover: #{p.$asc-blue-700};
60
62
  --asc-text-invalid: #{p.$asc-red-500}; // Text.danger
61
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
62
66
 
63
67
  // ── Color: Icon — Icon.* (design-token-color.json) — tier mới, trước đây
64
68
  // component tự tái dùng --asc-text-*, giờ có set riêng theo đúng design ──────
@@ -160,7 +164,7 @@
160
164
  --asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand (dark) — không đổi
161
165
 
162
166
  --asc-text-primary: #{p.$asc-grey-10}; // Text.primary (dark)
163
- --asc-text-secondary: #{p.$asc-grey-200}; // Text.secondary (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)
164
168
  --asc-text-muted: #{p.$asc-grey-300}; // Text.tertiary (dark)
165
169
  --asc-text-disabled: #{p.$asc-grey-600}; // Text.disable (dark)
166
170
  --asc-text-placeholder: #{p.$asc-grey-300};
@@ -10,7 +10,7 @@
10
10
  .layout-main {
11
11
  flex: 1 1 auto;
12
12
  padding: 1.5rem 1.5rem 2rem;
13
- background: var(--surface-overlay);
13
+ background: var(--asc-surface-base); // trắng (light) / grey-800 (dark)
14
14
  border-radius: 1.25rem;
15
15
  }
16
16
 
@@ -2,18 +2,35 @@
2
2
 
3
3
  .layout-sidebar {
4
4
  position: fixed;
5
- width: 20rem;
6
- height: calc(100vh - 8rem);
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));
7
8
  z-index: 999;
8
- overflow-y: auto;
9
+ display: flex;
10
+ flex-direction: column;
11
+ overflow: hidden; // clip scrollbar của .layout-sidebar-content theo border-radius
9
12
  user-select: none;
10
- top: 6rem;
11
- left: 2rem;
13
+ top: var(--layout-sidebar-gap);
14
+ left: var(--layout-sidebar-gap);
12
15
  transition:
13
16
  transform var(--layout-section-transition-duration),
14
17
  left var(--layout-section-transition-duration);
15
- background-color: var(--surface-overlay);
16
- border-radius: var(--content-border-radius);
18
+ background-color: var(--asc-surface-base);
19
+ border-radius: 20px;
20
+ }
21
+
22
+ // Logo đứng yên ở đầu sidebar, không cuộn theo menu
23
+ .layout-sidebar-logo {
24
+ flex-shrink: 0;
25
+ display: flex;
26
+ align-items: center;
27
+ padding: 1rem 1.5rem 0.5rem;
28
+ }
29
+
30
+ .layout-sidebar-content {
31
+ flex: 1 1 auto;
32
+ min-height: 0;
33
+ overflow-y: auto;
17
34
  padding: 0.5rem 1.5rem;
18
35
  }
19
36
 
@@ -40,8 +40,14 @@
40
40
  }
41
41
 
42
42
  &.layout-static {
43
+ // Sidebar chiếm full chiều cao bên trái — topbar & main nằm bên phải sidebar
44
+ .layout-topbar {
45
+ left: var(--layout-sidebar-offset);
46
+ width: calc(100% - var(--layout-sidebar-offset));
47
+ }
48
+
43
49
  .layout-main-container {
44
- margin-left: 22rem;
50
+ margin-left: var(--layout-sidebar-offset);
45
51
  }
46
52
 
47
53
  &.layout-static-inactive {
@@ -50,6 +56,11 @@
50
56
  left: 0;
51
57
  }
52
58
 
59
+ .layout-topbar {
60
+ left: 0;
61
+ width: 100%;
62
+ }
63
+
53
64
  .layout-main-container {
54
65
  margin-left: 0;
55
66
  padding-left: 2rem;
@@ -1,159 +1,164 @@
1
- @use "mixins" as *;
2
-
3
- .layout-topbar {
4
- position: fixed;
5
- height: 4rem;
6
- z-index: 997;
7
- left: 0;
8
- top: 0;
9
- width: 100%;
10
- padding: 0 2rem;
11
- background-color: var(--surface-card);
12
- transition: left var(--layout-section-transition-duration);
13
- display: flex;
14
- align-items: center;
15
-
16
- .layout-topbar-logo-container {
17
- display: flex;
18
- align-items: center;
19
- }
20
-
21
- .layout-topbar-logo {
22
- display: inline-flex;
23
- align-items: center;
24
- font-size: 1.5rem;
25
- border-radius: var(--content-border-radius);
26
- color: var(--text-color);
27
- font-weight: 500;
28
- gap: 0.5rem;
29
-
30
- svg {
31
- width: 3rem;
32
- }
33
-
34
- &:focus-visible {
35
- @include focused();
36
- }
37
- }
38
-
39
- .layout-topbar-action {
40
- display: inline-flex;
41
- justify-content: center;
42
- align-items: center;
43
- color: var(--text-color-secondary);
44
- border-radius: 50%;
45
- width: 2.5rem;
46
- height: 2.5rem;
47
- color: var(--text-color);
48
- transition: background-color var(--element-transition-duration);
49
- cursor: pointer;
50
-
51
- &:hover {
52
- background-color: var(--surface-hover);
53
- }
54
-
55
- &:focus-visible {
56
- @include focused();
57
- }
58
-
59
- i {
60
- font-size: 1.25rem;
61
- }
62
-
63
- span {
64
- font-size: 1rem;
65
- display: none;
66
- }
67
-
68
- &.layout-topbar-action-highlight {
69
- background-color: var(--primary-color);
70
- color: var(--primary-contrast-color);
71
- }
72
- }
73
-
74
- .layout-menu-button {
75
- margin-right: 0.5rem;
76
- }
77
-
78
- .layout-topbar-menu-button {
79
- display: none;
80
- }
81
-
82
- .layout-topbar-actions {
83
- margin-left: auto;
84
- display: flex;
85
- gap: 1rem;
86
- }
87
-
88
- .layout-topbar-menu-content {
89
- display: flex;
90
- gap: 1rem;
91
- }
92
-
93
- .layout-config-menu {
94
- display: flex;
95
- gap: 1rem;
96
- }
97
- }
98
-
99
- @media (max-width: 991px) {
100
- .layout-topbar {
101
- padding: 0 2rem;
102
-
103
- .layout-topbar-logo-container {
104
- width: auto;
105
- }
106
-
107
- .layout-menu-button {
108
- margin-left: 0;
109
- margin-right: 0.5rem;
110
- }
111
-
112
- .layout-topbar-menu-button {
113
- display: inline-flex;
114
- }
115
-
116
- .layout-topbar-menu {
117
- position: absolute;
118
- background-color: var(--surface-overlay);
119
- transform-origin: top;
120
- box-shadow:
121
- 0px 3px 5px rgba(0, 0, 0, 0.02),
122
- 0px 0px 2px rgba(0, 0, 0, 0.05),
123
- 0px 1px 4px rgba(0, 0, 0, 0.08);
124
- border-radius: var(--content-border-radius);
125
- padding: 1rem;
126
- right: 2rem;
127
- top: 4rem;
128
- min-width: 15rem;
129
- border: 1px solid var(--surface-border);
130
-
131
- .layout-topbar-menu-content {
132
- gap: 0.5rem;
133
- }
134
-
135
- .layout-topbar-action {
136
- display: flex;
137
- width: 100%;
138
- height: auto;
139
- justify-content: flex-start;
140
- border-radius: var(--content-border-radius);
141
- padding: 0.5rem 1rem;
142
-
143
- i {
144
- font-size: 1rem;
145
- margin-right: 0.5rem;
146
- }
147
-
148
- span {
149
- font-weight: medium;
150
- display: block;
151
- }
152
- }
153
- }
154
-
155
- .layout-topbar-menu-content {
156
- flex-direction: column;
157
- }
158
- }
159
- }
1
+ @use "mixins" as *;
2
+
3
+ .layout-topbar {
4
+ position: fixed;
5
+ height: 4rem;
6
+ z-index: 997;
7
+ left: 0;
8
+ top: 0;
9
+ width: 100%;
10
+ padding: 0 2rem;
11
+ // Nền bán trong suốt theo màu nền trang + blur — nội dung cuộn phía sau không đè chữ lên topbar
12
+ background-color: color-mix(in srgb, var(--surface-ground) 70%, transparent);
13
+ -webkit-backdrop-filter: blur(12px);
14
+ backdrop-filter: blur(12px);
15
+ transition:
16
+ left var(--layout-section-transition-duration),
17
+ width var(--layout-section-transition-duration);
18
+ display: flex;
19
+ align-items: center;
20
+
21
+ .layout-topbar-logo-container {
22
+ display: flex;
23
+ align-items: center;
24
+ }
25
+
26
+ .layout-topbar-logo {
27
+ display: inline-flex;
28
+ align-items: center;
29
+ font-size: 1.5rem;
30
+ border-radius: var(--content-border-radius);
31
+ color: var(--text-color);
32
+ font-weight: 500;
33
+ gap: 0.5rem;
34
+
35
+ svg {
36
+ width: 3rem;
37
+ }
38
+
39
+ &:focus-visible {
40
+ @include focused();
41
+ }
42
+ }
43
+
44
+ .layout-topbar-action {
45
+ display: inline-flex;
46
+ justify-content: center;
47
+ align-items: center;
48
+ color: var(--text-color-secondary);
49
+ border-radius: 50%;
50
+ width: 2.5rem;
51
+ height: 2.5rem;
52
+ color: var(--text-color);
53
+ transition: background-color var(--element-transition-duration);
54
+ cursor: pointer;
55
+
56
+ &:hover {
57
+ background-color: var(--surface-hover);
58
+ }
59
+
60
+ &:focus-visible {
61
+ @include focused();
62
+ }
63
+
64
+ i {
65
+ font-size: 1.25rem;
66
+ }
67
+
68
+ span {
69
+ font-size: 1rem;
70
+ display: none;
71
+ }
72
+
73
+ &.layout-topbar-action-highlight {
74
+ background-color: var(--primary-color);
75
+ color: var(--primary-contrast-color);
76
+ }
77
+ }
78
+
79
+ .layout-menu-button {
80
+ margin-right: 0.5rem;
81
+ }
82
+
83
+ .layout-topbar-menu-button {
84
+ display: none;
85
+ }
86
+
87
+ .layout-topbar-actions {
88
+ margin-left: auto;
89
+ display: flex;
90
+ gap: 1rem;
91
+ }
92
+
93
+ .layout-topbar-menu-content {
94
+ display: flex;
95
+ gap: 1rem;
96
+ }
97
+
98
+ .layout-config-menu {
99
+ display: flex;
100
+ gap: 1rem;
101
+ }
102
+ }
103
+
104
+ @media (max-width: 991px) {
105
+ .layout-topbar {
106
+ padding: 0 2rem;
107
+
108
+ .layout-topbar-logo-container {
109
+ width: auto;
110
+ }
111
+
112
+ .layout-menu-button {
113
+ margin-left: 0;
114
+ margin-right: 0.5rem;
115
+ }
116
+
117
+ .layout-topbar-menu-button {
118
+ display: inline-flex;
119
+ }
120
+
121
+ .layout-topbar-menu {
122
+ position: absolute;
123
+ background-color: var(--surface-overlay);
124
+ transform-origin: top;
125
+ box-shadow:
126
+ 0px 3px 5px rgba(0, 0, 0, 0.02),
127
+ 0px 0px 2px rgba(0, 0, 0, 0.05),
128
+ 0px 1px 4px rgba(0, 0, 0, 0.08);
129
+ border-radius: var(--content-border-radius);
130
+ padding: 1rem;
131
+ right: 2rem;
132
+ top: 4rem;
133
+ min-width: 15rem;
134
+ border: 1px solid var(--surface-border);
135
+
136
+ .layout-topbar-menu-content {
137
+ gap: 0.5rem;
138
+ }
139
+
140
+ .layout-topbar-action {
141
+ display: flex;
142
+ width: 100%;
143
+ height: auto;
144
+ justify-content: flex-start;
145
+ border-radius: var(--content-border-radius);
146
+ padding: 0.5rem 1rem;
147
+
148
+ i {
149
+ font-size: 1rem;
150
+ margin-right: 0.5rem;
151
+ }
152
+
153
+ span {
154
+ font-weight: medium;
155
+ display: block;
156
+ }
157
+ }
158
+ }
159
+
160
+ .layout-topbar-menu-content {
161
+ flex-direction: column;
162
+ }
163
+ }
164
+ }
@@ -11,6 +11,10 @@
11
11
  --maskbg: var(--p-mask-background);
12
12
  --content-border-radius: var(--p-content-border-radius);
13
13
  --layout-section-transition-duration: 0.2s;
14
+ --layout-sidebar-width: 212px;
15
+ --layout-sidebar-gap: 1rem; // khoảng hở giữa sidebar nổi và mép viewport
16
+ // mép phải của sidebar tính từ mép trái viewport — topbar/main bắt đầu từ đây
17
+ --layout-sidebar-offset: calc(var(--layout-sidebar-gap) + var(--layout-sidebar-width));
14
18
  --element-transition-duration: var(--p-transition-duration);
15
19
  --focus-ring-width: var(--p-focus-ring-width);
16
20
  --focus-ring-style: var(--p-focus-ring-style);
@@ -1,5 +1,7 @@
1
1
  :root[class*='app-dark'] {
2
2
  --surface-ground: var(--p-surface-950);
3
+ // _common.scss hardcode --text-color #0F0F0F cho light — dark phải override, không thì chữ đen trên nền tối
4
+ --text-color: var(--p-text-color);
3
5
  --code-background: var(--p-surface-800);
4
6
  --code-color: var(--p-surface-100);
5
7
  }
@@ -1,5 +1,6 @@
1
1
  :root {
2
- --surface-ground: var(--p-surface-100);
2
+ // TẠM: màu be phẳng lấy theo tone ảnh nền trong design, chờ chốt lại với UI/UX
3
+ --surface-ground: #EAE6E1;
3
4
  --code-background: var(--p-surface-900);
4
5
  --code-color: var(--p-surface-200);
5
6
  }
package/tokens/preset.css CHANGED
@@ -76,7 +76,9 @@
76
76
  --asc-surface-overlay: #ffffff;
77
77
  --asc-surface-hover: #f2f3f5;
78
78
  --asc-surface-active: #dedfe0;
79
- --asc-surface-50: #f2f3f5;
79
+ --asc-surface-0: #ffffff;
80
+ --asc-surface-50: #ffffff;
81
+ --asc-formfield-bg: #ffffff;
80
82
  --asc-border-color: #dedfe0;
81
83
  --asc-border-color-strong: #a7a7a8;
82
84
  --asc-border-color-focus: #3b82f6;
@@ -92,6 +94,8 @@
92
94
  --asc-text-link-hover: #1d4ed8;
93
95
  --asc-text-invalid: #ef4444;
94
96
  --asc-text-brand: #f74036;
97
+ --asc-table-header-color: #A3A3A3;
98
+ --asc-table-border-color: #0C0C0D1A;
95
99
  --asc-icon-primary: #0f0f0f;
96
100
  --asc-icon-secondary: #8d8e8f;
97
101
  --asc-icon-disabled: #c0c0c2;
@@ -164,7 +168,7 @@
164
168
  --asc-border-color-focus: #60a5fa;
165
169
  --asc-border-color-brand: #f74036;
166
170
  --asc-text-primary: #fafafc;
167
- --asc-text-secondary: #c0c0c2;
171
+ --asc-table-header-color: #fafafc;
168
172
  --asc-text-muted: #a7a7a8;
169
173
  --asc-text-disabled: #5b5b5c;
170
174
  --asc-text-placeholder: #a7a7a8;
@@ -639,6 +643,9 @@
639
643
  --maskbg: var(--p-mask-background);
640
644
  --content-border-radius: var(--p-content-border-radius);
641
645
  --layout-section-transition-duration: 0.2s;
646
+ --layout-sidebar-width: 212px;
647
+ --layout-sidebar-gap: 1rem;
648
+ --layout-sidebar-offset: calc(var(--layout-sidebar-gap) + var(--layout-sidebar-width));
642
649
  --element-transition-duration: var(--p-transition-duration);
643
650
  --focus-ring-width: var(--p-focus-ring-width);
644
651
  --focus-ring-style: var(--p-focus-ring-style);
@@ -648,13 +655,14 @@
648
655
  }
649
656
 
650
657
  :root {
651
- --surface-ground: var(--p-surface-100);
658
+ --surface-ground: #EAE6E1;
652
659
  --code-background: var(--p-surface-900);
653
660
  --code-color: var(--p-surface-200);
654
661
  }
655
662
 
656
663
  :root[class*=app-dark] {
657
664
  --surface-ground: var(--p-surface-950);
665
+ --text-color: var(--p-text-color);
658
666
  --code-background: var(--p-surface-800);
659
667
  --code-color: var(--p-surface-100);
660
668
  }
@@ -745,7 +753,7 @@ a {
745
753
  .layout-main {
746
754
  flex: 1 1 auto;
747
755
  padding: 1.5rem 1.5rem 2rem;
748
- background: var(--surface-overlay);
756
+ background: var(--asc-surface-base);
749
757
  border-radius: 1.25rem;
750
758
  }
751
759
 
@@ -761,8 +769,10 @@ img {
761
769
  top: 0;
762
770
  width: 100%;
763
771
  padding: 0 2rem;
764
- background-color: var(--surface-card);
765
- transition: left var(--layout-section-transition-duration);
772
+ background-color: color-mix(in srgb, var(--surface-ground) 70%, transparent);
773
+ -webkit-backdrop-filter: blur(12px);
774
+ backdrop-filter: blur(12px);
775
+ transition: left var(--layout-section-transition-duration), width var(--layout-section-transition-duration);
766
776
  display: flex;
767
777
  align-items: center;
768
778
  }
@@ -910,16 +920,31 @@ img {
910
920
  }
911
921
  .layout-sidebar {
912
922
  position: fixed;
913
- width: 20rem;
914
- height: calc(100vh - 8rem);
923
+ width: var(--layout-sidebar-width);
924
+ height: calc(100vh - 2 * var(--layout-sidebar-gap));
915
925
  z-index: 999;
916
- overflow-y: auto;
926
+ display: flex;
927
+ flex-direction: column;
928
+ overflow: hidden;
917
929
  user-select: none;
918
- top: 6rem;
919
- left: 2rem;
930
+ top: var(--layout-sidebar-gap);
931
+ left: var(--layout-sidebar-gap);
920
932
  transition: transform var(--layout-section-transition-duration), left var(--layout-section-transition-duration);
921
- background-color: var(--surface-overlay);
922
- border-radius: var(--content-border-radius);
933
+ background-color: var(--asc-surface-base);
934
+ border-radius: 20px;
935
+ }
936
+
937
+ .layout-sidebar-logo {
938
+ flex-shrink: 0;
939
+ display: flex;
940
+ align-items: center;
941
+ padding: 1rem 1.5rem 0.5rem;
942
+ }
943
+
944
+ .layout-sidebar-content {
945
+ flex: 1 1 auto;
946
+ min-height: 0;
947
+ overflow-y: auto;
923
948
  padding: 0.5rem 1.5rem;
924
949
  }
925
950
 
@@ -1064,13 +1089,21 @@ img {
1064
1089
  .layout-wrapper.layout-overlay.layout-overlay-active .layout-sidebar {
1065
1090
  transform: translateX(0);
1066
1091
  }
1092
+ .layout-wrapper.layout-static .layout-topbar {
1093
+ left: var(--layout-sidebar-offset);
1094
+ width: calc(100% - var(--layout-sidebar-offset));
1095
+ }
1067
1096
  .layout-wrapper.layout-static .layout-main-container {
1068
- margin-left: 22rem;
1097
+ margin-left: var(--layout-sidebar-offset);
1069
1098
  }
1070
1099
  .layout-wrapper.layout-static.layout-static-inactive .layout-sidebar {
1071
1100
  transform: translateX(-100%);
1072
1101
  left: 0;
1073
1102
  }
1103
+ .layout-wrapper.layout-static.layout-static-inactive .layout-topbar {
1104
+ left: 0;
1105
+ width: 100%;
1106
+ }
1074
1107
  .layout-wrapper.layout-static.layout-static-inactive .layout-main-container {
1075
1108
  margin-left: 0;
1076
1109
  padding-left: 2rem;