@aseansc/ui 5.1.0 → 5.2.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 +31 -0
- package/fesm2022/aseansc-ui.mjs +98 -41
- package/fesm2022/aseansc-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/tokens/_semantic.scss +24 -2
- package/tokens/preset.css +17 -1
- package/types/aseansc-ui.d.ts +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aseansc/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.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/_semantic.scss
CHANGED
|
@@ -42,6 +42,12 @@
|
|
|
42
42
|
--asc-surface-0: #{p.$asc-white};
|
|
43
43
|
--asc-surface-50: #{p.$asc-white};
|
|
44
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};
|
|
45
51
|
|
|
46
52
|
// ── Color: Border — Border.* (design-token-color.json) ──────────────────────
|
|
47
53
|
--asc-border-color: #{p.$asc-grey-100}; // Border.default
|
|
@@ -130,9 +136,18 @@
|
|
|
130
136
|
// Dùng cho input, button, select — đảm bảo align nhau
|
|
131
137
|
--asc-h-xs: 24px;
|
|
132
138
|
--asc-h-sm: 32px;
|
|
133
|
-
--asc-h-md: 36px
|
|
139
|
+
--asc-h-md: 40px; // Figma Input medium = 40px (trước 36px)
|
|
134
140
|
--asc-h-lg: 48px;
|
|
135
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%
|
|
136
151
|
}
|
|
137
152
|
|
|
138
153
|
// ── Dark mode overrides ──────────────────────────────────────────────────────
|
|
@@ -164,7 +179,8 @@
|
|
|
164
179
|
--asc-border-color-brand: #{p.$asc-brand-500}; // Border.brand (dark) — không đổi
|
|
165
180
|
|
|
166
181
|
--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)
|
|
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)
|
|
168
184
|
--asc-text-muted: #{p.$asc-grey-300}; // Text.tertiary (dark)
|
|
169
185
|
--asc-text-disabled: #{p.$asc-grey-600}; // Text.disable (dark)
|
|
170
186
|
--asc-text-placeholder: #{p.$asc-grey-300};
|
|
@@ -183,6 +199,12 @@
|
|
|
183
199
|
--asc-icon-success: #{p.$asc-emerald-500};
|
|
184
200
|
--asc-icon-info: #{p.$asc-blue-500};
|
|
185
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
|
+
|
|
186
208
|
--asc-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.3);
|
|
187
209
|
--asc-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
|
|
188
210
|
--asc-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
|
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;
|
|
@@ -142,9 +147,15 @@
|
|
|
142
147
|
--asc-z-toast: 1200;
|
|
143
148
|
--asc-h-xs: 24px;
|
|
144
149
|
--asc-h-sm: 32px;
|
|
145
|
-
--asc-h-md:
|
|
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);
|
package/types/aseansc-ui.d.ts
CHANGED
|
@@ -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> {
|