@sdcorejs/angular 21.2.13 → 21.2.15
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/assets/STYLE-GUIDE.md +138 -10
- package/assets/scss/core/form.scss +18 -2
- package/assets/scss/core/utilities/_base.scss +3 -3
- package/assets/scss/themes/_presets.scss +52 -0
- package/assets/scss/themes/default.scss +39 -11
- package/assets/scss/themes/material-theme.scss +2 -2
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +1 -1
- package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-button.mjs +12 -2
- package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2582 -0
- package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -0
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
- package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-preview.mjs +2 -2
- package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +92 -7
- package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs +10 -4
- package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-tab.mjs +52 -3
- package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components-table.mjs +502 -79
- package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-components.mjs +1 -0
- package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-forms-select.mjs +2 -2
- package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-i18n.mjs +430 -0
- package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-icon.mjs +6 -0
- package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
- package/fesm2022/sdcorejs-angular-modules-layout.mjs +2 -2
- package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
- package/package.json +5 -1
- package/types/sdcorejs-angular-components-button.d.ts +5 -0
- package/types/sdcorejs-angular-components-file-explorer.d.ts +500 -0
- package/types/sdcorejs-angular-components-side-drawer.d.ts +13 -2
- package/types/sdcorejs-angular-components-tab.d.ts +8 -2
- package/types/sdcorejs-angular-components-table.d.ts +220 -6
- package/types/sdcorejs-angular-components.d.ts +1 -0
- package/types/sdcorejs-angular-i18n.d.ts +85 -0
package/assets/STYLE-GUIDE.md
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
|
|
42
42
|
Control `size="sm"` dùng khung 32px. Floating label ở trạng thái rỗng/chưa focus được căn giữa dòng đầu bằng style dùng chung, kể cả label có wrapper `sd-form-field-label`. Khi focus hoặc có giá trị, label vẫn nổi theo Angular Material; textarea nhiều dòng giữ label ở dòng đầu.
|
|
43
43
|
|
|
44
|
+
Label, icon trợ giúp và dấu required của Material nằm cùng một hàng ở `sm`, cả outline/fill và khi focus. Label dài được cắt bằng dấu ba chấm trong ô hẹp; icon và dấu `*` vẫn hiển thị. Quy tắc dùng chung cho input/input-number/input-color, select (đơn/đa lựa chọn), autocomplete, date/datetime/date-range/time, textarea và tree-select; chip/chip-calendar giữ label Material mặc định.
|
|
45
|
+
|
|
44
46
|
> Convention chung: **mọi utility class đều có `!important`** để đảm bảo override được Angular Material (thường có specificity cao).
|
|
45
47
|
|
|
46
48
|
---
|
|
@@ -103,17 +105,17 @@ projects/sdcorejs-angular/assets/
|
|
|
103
105
|
|
|
104
106
|
## 3. Hệ thống màu sắc
|
|
105
107
|
|
|
106
|
-
Màu được định nghĩa dưới dạng **CSS custom properties** với prefix `--sd-*`, cho phép override runtime (không cần recompile SCSS). Default theme
|
|
108
|
+
Màu được định nghĩa dưới dạng **CSS custom properties** với prefix `--sd-*`, cho phép override runtime (không cần recompile SCSS). Default theme sở hữu màu độc lập. Dùng `$source: 'material'` để chủ động bật nguồn màu tương thích cũ.
|
|
107
109
|
|
|
108
110
|
### 3.1 Color tokens
|
|
109
111
|
|
|
110
112
|
| Token | CSS variable | Default bridge / fallback | Use for |
|
|
111
113
|
|---|---|---|---|
|
|
112
|
-
| `primary` | `--sd-primary` |
|
|
114
|
+
| `primary` | `--sd-primary` | `#005cbb` | Main action color |
|
|
113
115
|
| `primary-light` | `--sd-primary-light` | `color-mix(in srgb, var(--sd-primary) 14%, white)` | Soft primary background |
|
|
114
116
|
| `primary-dark` | `--sd-primary-dark` | `color-mix(in srgb, var(--sd-primary) 84%, black)` | Primary hover/active shade |
|
|
115
117
|
| `primary-contrast` | `--sd-primary-contrast` | `#ffffff` | Text/icon on primary |
|
|
116
|
-
| `secondary` | `--sd-secondary` |
|
|
118
|
+
| `secondary` | `--sd-secondary` | `#5c6270` | Secondary action/accent |
|
|
117
119
|
| `secondary-light` | `--sd-secondary-light` | `color-mix(in srgb, var(--sd-secondary) 12%, white)` | Soft secondary background |
|
|
118
120
|
| `secondary-dark` | `--sd-secondary-dark` | `color-mix(in srgb, var(--sd-secondary) 84%, black)` | Secondary hover/active shade |
|
|
119
121
|
| `secondary-contrast` | `--sd-secondary-contrast` | `#ffffff` | Text/icon on secondary |
|
|
@@ -121,13 +123,13 @@ Màu được định nghĩa dưới dạng **CSS custom properties** với pref
|
|
|
121
123
|
| `*-light` | `--sd-info-light`, ... | `color-mix(in srgb, var(--sd-*) 14%, white)` | Soft semantic background |
|
|
122
124
|
| `*-dark` | `--sd-info-dark`, ... | `color-mix(in srgb, var(--sd-*) 84%, black)` | Semantic hover/active shade |
|
|
123
125
|
| `*-contrast` | `--sd-info-contrast`, ... | `#ffffff` | Text/icon on semantic color |
|
|
124
|
-
| `surface` | `--sd-surface` |
|
|
125
|
-
| `surface-muted` | `--sd-surface-muted` |
|
|
126
|
-
| `text` | `--sd-text` |
|
|
127
|
-
| `text-secondary` | `--sd-text-secondary` |
|
|
126
|
+
| `surface` | `--sd-surface` | `#fdfbff` | Page/component surface |
|
|
127
|
+
| `surface-muted` | `--sd-surface-muted` | `#e7e8ed` | Muted neutral background |
|
|
128
|
+
| `text` | `--sd-text` | `#1a1b1f` | Primary text |
|
|
129
|
+
| `text-secondary` | `--sd-text-secondary` | `#44474f` | Secondary text |
|
|
128
130
|
| `text-muted` | `--sd-text-muted` | `color-mix(in srgb, var(--sd-text) 62%, transparent)` | Muted text |
|
|
129
|
-
| `border` | `--sd-border` |
|
|
130
|
-
| `border-strong` | `--sd-border-strong` |
|
|
131
|
+
| `border` | `--sd-border` | `#c4c6d0` | Divider/subtle border |
|
|
132
|
+
| `border-strong` | `--sd-border-strong` | `#74777f` | Strong border/focus outline |
|
|
131
133
|
| `disabled-bg` | `--sd-disabled-bg` | `color-mix(in srgb, var(--sd-text) 8%, transparent)` | Disabled background |
|
|
132
134
|
| `disabled-text` | `--sd-disabled-text` | `color-mix(in srgb, var(--sd-text) 60%, transparent)` | Disabled text/icon |
|
|
133
135
|
### 3.2 Color utility classes
|
|
@@ -487,7 +489,7 @@ CSS shadow tĩnh, tương đương Angular Material `mat.elevation()` mixin như
|
|
|
487
489
|
|
|
488
490
|
## 14. Custom theme
|
|
489
491
|
|
|
490
|
-
Host apps
|
|
492
|
+
Host apps own Core colors through `sd.theme()`. The default source is `core`: literal base colors and derived `--sd-*` colors. Material-only controls, typography and density remain configured through `mat.theme()`; Core does not globally overwrite Material system colors.
|
|
491
493
|
|
|
492
494
|
```scss
|
|
493
495
|
@use '@sdcorejs/angular/assets/scss/themes/default' as sd;
|
|
@@ -523,9 +525,134 @@ Prefer Material M3 system variables for Material-facing styles:
|
|
|
523
525
|
`--mat-sys-on-surface`, `--mat-sys-error`, `--mat-sys-outline`, and
|
|
524
526
|
`--mat-sys-outline-variant`.
|
|
525
527
|
|
|
528
|
+
### Material-owned colors (compatibility)
|
|
529
|
+
|
|
530
|
+
Apps previously relying on Material to recolor Core must opt in explicitly, after loading `sd-core.scss`:
|
|
531
|
+
|
|
532
|
+
```scss
|
|
533
|
+
html {
|
|
534
|
+
@include sd.theme($source: 'material');
|
|
535
|
+
// Consumer overrides take precedence over the selected source:
|
|
536
|
+
// @include sd.theme((primary: #AE7129), $source: 'material');
|
|
537
|
+
}
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
Omit `$source` (or use `'core'`) for independent Core colors. Scoped calls emit the full palette within that selector; runtime overrides can use `--sd-primary`, `--sd-surface`, etc. Unknown source names fail Sass compilation. Overlay content must also be inside the themed scope.
|
|
541
|
+
|
|
526
542
|
> `sd.theme()` only needs the tokens you want to override; omitted tokens keep their defaults.
|
|
527
543
|
> Keep Material theme configuration in a global stylesheet, not component SCSS.
|
|
528
544
|
|
|
545
|
+
### 14.1 Choose a preset
|
|
546
|
+
|
|
547
|
+
Core ships eight **light** presets in addition to the unchanged `default` palette. They change colors only; typography, spacing, density and corner radius remain unchanged. No dark palette is included.
|
|
548
|
+
|
|
549
|
+
In the consumer's global `styles.scss`, load Core first, then emit the selected palette:
|
|
550
|
+
|
|
551
|
+
```scss
|
|
552
|
+
@use '@sdcorejs/angular/assets/scss/sd-core';
|
|
553
|
+
@use '@sdcorejs/angular/assets/scss/themes/default' as sd;
|
|
554
|
+
|
|
555
|
+
html {
|
|
556
|
+
color-scheme: light;
|
|
557
|
+
@include sd.theme($preset: 'ocean');
|
|
558
|
+
}
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
If `sd-core.scss` is already configured in `angular.json`, do not import it a second time. Keep your override stylesheet after the Core stylesheet in the styles list so that Core defaults do not overwrite it. Importing `themes/default` alone does not install the complete Core component stylesheet.
|
|
562
|
+
|
|
563
|
+
| Preset | Direction | Primary | Primary light | Primary dark | Surface muted |
|
|
564
|
+
|---|---|---|---|---|---|
|
|
565
|
+
| `ocean` | Clear, familiar blue | `#005CBB` | `#E6F0FA` | `#004A96` | `#F1F5F9` |
|
|
566
|
+
| `indigo` | Distinctive blue-violet | `#4F46E5` | `#EEECFD` | `#3730A3` | `#F4F4FA` |
|
|
567
|
+
| `teal` | Calm blue-green | `#0F766E` | `#E5F3F1` | `#115E59` | `#F0F7F6` |
|
|
568
|
+
| `copper` | Warm brown | `#9A6324` | `#F8EFE4` | `#6B4414` | `#F4F2F1` |
|
|
569
|
+
| `slate` | Minimal neutral | `#475569` | `#E9EDF2` | `#334155` | `#F5F6F8` |
|
|
570
|
+
| `forest` | Muted natural green | `#356447` | `#E8F0E9` | `#244831` | `#F3F6F0` |
|
|
571
|
+
| `plum` | Restrained purple | `#7B3F80` | `#F2EAF4` | `#592B60` | `#F7F3F8` |
|
|
572
|
+
| `rose` | Warm muted pink | `#A33D62` | `#FAEAF0` | `#7D2849` | `#FAF4F5` |
|
|
573
|
+
|
|
574
|
+
All eight presets use `surface: #FFFFFF` and `primary-contrast: #FFFFFF`.
|
|
575
|
+
|
|
576
|
+
| Preset | Text | Text secondary | Border | Border strong |
|
|
577
|
+
|---|---|---|---|---|
|
|
578
|
+
| `ocean` | `#182230` | `#475569` | `#CBD5E1` | `#64748B` |
|
|
579
|
+
| `indigo` | `#232238` | `#56546C` | `#D5D3E3` | `#76738D` |
|
|
580
|
+
| `teal` | `#18302D` | `#47635F` | `#C9DCD8` | `#637F79` |
|
|
581
|
+
| `copper` | `#302820` | `#665A4D` | `#DCD3C9` | `#8C7A67` |
|
|
582
|
+
| `slate` | `#1E293B` | `#526174` | `#CDD4DD` | `#6B7A8E` |
|
|
583
|
+
| `forest` | `#253128` | `#53634F` | `#CFD9C9` | `#72826C` |
|
|
584
|
+
| `plum` | `#302334` | `#68576D` | `#DCCFDF` | `#8C7492` |
|
|
585
|
+
| `rose` | `#35262C` | `#70565F` | `#E1CFD6` | `#997480` |
|
|
586
|
+
|
|
587
|
+
Unlisted tokens inherit the default map in section 3: secondary, info, success, warning, error and their variants keep the same meaning across presets. `text-muted`, `disabled-bg` and `disabled-text` remain derived from `--sd-text`. A preset emits the entire public color token set, not just its differences.
|
|
588
|
+
|
|
589
|
+
### 14.2 Mixin contract and overrides
|
|
590
|
+
|
|
591
|
+
```scss
|
|
592
|
+
@mixin theme($theme: (), $source: 'core', $preset: 'default');
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
| Parameter | Accepted values | Default |
|
|
596
|
+
|---|---|---|
|
|
597
|
+
| `$theme` | Map of public color tokens from section 3 | `()` |
|
|
598
|
+
| `$source` | `'core'`, `'material'` | `'core'` |
|
|
599
|
+
| `$preset` | `'default'` and the eight lowercase names above | `'default'` |
|
|
600
|
+
|
|
601
|
+
For the Core source, precedence is **default → preset → consumer overrides**. Existing `sd.theme()`, `sd.theme((...))`, and positional `sd.theme((), 'material')` calls remain valid. Unknown preset/source names fail Sass compilation. Combining `$source: 'material'` with any non-default preset also fails: choose one palette owner.
|
|
602
|
+
|
|
603
|
+
```scss
|
|
604
|
+
html {
|
|
605
|
+
@include sd.theme((
|
|
606
|
+
primary: #6B4414,
|
|
607
|
+
primary-light: #F4F2F1,
|
|
608
|
+
primary-dark: #4A2F0E,
|
|
609
|
+
surface-muted: #F7F5F2,
|
|
610
|
+
), $preset: 'copper');
|
|
611
|
+
}
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
Preset `primary-light` and `primary-dark` are explicit designed values. Overriding only `primary` does **not** recalculate those two colors; override all three when changing the brand family. The `default` palette retains its existing `color-mix()` variants. Runtime `--sd-primary` overrides have the same rule. Do not pass `sd.$default-theme` as your override map when selecting a preset: that full map intentionally overrides the preset values.
|
|
615
|
+
|
|
616
|
+
### 14.3 Per-screen and runtime switching
|
|
617
|
+
|
|
618
|
+
Emit one palette per selector in a global stylesheet, then toggle that selector. Sass itself does not run in the browser.
|
|
619
|
+
|
|
620
|
+
```scss
|
|
621
|
+
html { @include sd.theme($preset: 'ocean'); }
|
|
622
|
+
html[data-core-theme='forest'] { @include sd.theme($preset: 'forest'); }
|
|
623
|
+
html[data-core-theme='plum'] { @include sd.theme($preset: 'plum'); }
|
|
624
|
+
|
|
625
|
+
// Optional per-screen override; sibling screens keep the root palette.
|
|
626
|
+
.customer-screen { @include sd.theme($preset: 'copper'); }
|
|
627
|
+
```
|
|
628
|
+
|
|
629
|
+
```ts
|
|
630
|
+
// Browser event handler; guard DOM access when using SSR.
|
|
631
|
+
document.documentElement.dataset['coreTheme'] = 'forest';
|
|
632
|
+
// Restore the root Ocean palette:
|
|
633
|
+
delete document.documentElement.dataset['coreTheme'];
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
Root switching also reaches overlays attached under `body`. A local screen class does not reach dialogs/select panels rendered outside that screen; apply the theme at the root or arrange the same theme scope on the overlay container. A nested full palette overrides inherited parent tokens.
|
|
637
|
+
|
|
638
|
+
### 14.4 Material integration and accessibility
|
|
639
|
+
|
|
640
|
+
These presets own **Core color tokens**, not the full Material palette. They do not rewrite global `--mat-sys-*`. Core styling that consumes `--sd-*` changes immediately; Material-only styles still follow the consumer's `mat.theme()` configuration. Keep that distinction when testing focus, ripples, calendars, dialogs and third-party controls. Font/density configuration remains separate.
|
|
641
|
+
|
|
642
|
+
Table quick-search/footer backgrounds intentionally remain fixed white; a global `surface` override does not change those regions. Tab header/body classes and inline styles also take precedence where supplied.
|
|
643
|
+
|
|
644
|
+
The preset tests verify white text against primary and primary-dark at **at least 4.5:1**, primary/secondary body text against surface and surface-muted at **at least 4.5:1**, and strong control borders against those surfaces at **at least 3:1**. Subtle `border` is for dividers, not the sole boundary of an interactive control. These checks are palette checks, not a claim that every component/state is accessibility-certified. Recheck actual rendered states after consumer overrides; retain labels/icons for status information.
|
|
645
|
+
|
|
646
|
+
### 14.5 Troubleshooting and verification
|
|
647
|
+
|
|
648
|
+
- **Unknown preset:** names are lowercase and case-sensitive; use `'ocean'`, not `'Ocean'`.
|
|
649
|
+
- **No color change:** verify stylesheet order and inspect `--sd-primary` on the affected element; check local classes, inline styles and nested theme scopes.
|
|
650
|
+
- **Material control differs:** its remaining Material styles need separate Material configuration; presets do not implicitly synchronize the two systems.
|
|
651
|
+
- **Unexpected hover tint after override:** set `primary-light` and `primary-dark` as well as `primary`.
|
|
652
|
+
- **Overlay differs from screen:** use a root theme or theme the overlay container in the global stylesheet.
|
|
653
|
+
|
|
654
|
+
Library maintainers can run `npm run test:theme` from the repository root after installing canonical `versions/v19` dependencies. It compiles consumer Sass and covers all eight presets, token completeness, contrast pairs, override precedence, isolated selectors, legacy Material mode and invalid arguments. Edit only v19 and run `npm run sync` for derived versions.
|
|
655
|
+
|
|
529
656
|
---
|
|
530
657
|
|
|
531
658
|
## 15. Fonts & images shipped
|
|
@@ -606,3 +733,4 @@ Khi sinh UI mới, agent phải rà docs Core UI trước và ưu tiên componen
|
|
|
606
733
|
- **View/read-only label + value**: dùng `<sd-view>` hoặc `[viewed]="true"` trên form component. Không tự dựng cặp label/value bằng class riêng cho các màn hình DETAIL.
|
|
607
734
|
- **Trạng thái, nhãn, counter**: dùng `<sd-badge>` hoặc `useBadge` của `<sd-table>`. Không tự viết badge/pill/status class trong component nếu chỉ để thể hiện trạng thái.
|
|
608
735
|
- **Input trong table hoặc vùng dense**: trong `<sd-table>`, inline filter, editable cell, toolbar/cell dày đặc, truyền `size="sm"` cho các form component hỗ trợ size như `<sd-input>`, `<sd-select>`, `<sd-autocomplete>`, `<sd-date>`, `<sd-date-range>`, `<sd-datetime>`, `<sd-input-number>`, `<sd-textarea>`, `<sd-chip>`, `<sd-chip-calendar>`, `<sd-input-color>`.
|
|
736
|
+
- **Label/required/help trong cell của `sd-table`**: control `sm` không lặp label đã có ở title cột. Cột bắt buộc thêm `*` với `text-error` ngay sau title; guide/help đặt ở icon `info` kèm tooltip trong header, không viết dài hoặc lặp từng hàng. Giữ validator trên control và tên truy cập cho screen reader. Filter/toolbar độc lập và mobile card không có header vẫn cần nhãn nhận diện. Xem quy tắc và mẫu `sdTableTitleDef` trong [sd-table](../components/table/sd-table.md#dense-editable-controls-inside-table-cells).
|
|
@@ -224,10 +224,26 @@
|
|
|
224
224
|
--mat-form-field-container-height: 32px;
|
|
225
225
|
--mat-form-field-container-vertical-padding: 3px;
|
|
226
226
|
|
|
227
|
-
// why:
|
|
228
|
-
//
|
|
227
|
+
// why: Material renders the required marker beside mat-label. Keep the complete
|
|
228
|
+
// floating label in one row, without the inline baseline gap in a 32px field.
|
|
229
|
+
.mdc-floating-label {
|
|
230
|
+
display: inline-flex;
|
|
231
|
+
align-items: center;
|
|
232
|
+
vertical-align: top;
|
|
233
|
+
}
|
|
234
|
+
|
|
229
235
|
.sd-form-field-label {
|
|
230
236
|
display: flex;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
|
|
239
|
+
> span {
|
|
240
|
+
overflow: hidden;
|
|
241
|
+
text-overflow: ellipsis;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.mat-mdc-form-field-required-marker {
|
|
246
|
+
flex-shrink: 0;
|
|
231
247
|
}
|
|
232
248
|
|
|
233
249
|
&.mat-form-field-appearance-outline {
|
|
@@ -37,8 +37,8 @@ body {
|
|
|
37
37
|
font-size: 14px;
|
|
38
38
|
font-weight: 400;
|
|
39
39
|
line-height: 1.5;
|
|
40
|
-
color: var(--sd-text,
|
|
41
|
-
background-color: var(--sd-surface,
|
|
40
|
+
color: var(--sd-text, #1a1b1f);
|
|
41
|
+
background-color: var(--sd-surface, #fdfbff);
|
|
42
42
|
text-align: left;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -128,7 +128,7 @@ sup { top: -0.5em; }
|
|
|
128
128
|
// 7. Links
|
|
129
129
|
// --------------------------------------------------------------------------
|
|
130
130
|
a {
|
|
131
|
-
color: var(--sd-primary,
|
|
131
|
+
color: var(--sd-primary, #005cbb);
|
|
132
132
|
text-decoration: none;
|
|
133
133
|
background-color: transparent; // Xóa nền xám trên link active trong IE 10
|
|
134
134
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Core-owned light palettes. Semantic state colors are inherited from default.
|
|
2
|
+
$presets: (
|
|
3
|
+
'default': (),
|
|
4
|
+
'ocean': (
|
|
5
|
+
primary: #005cbb, primary-light: #e6f0fa, primary-dark: #004a96,
|
|
6
|
+
surface: #ffffff, surface-muted: #f1f5f9,
|
|
7
|
+
text: #182230, text-secondary: #475569,
|
|
8
|
+
border: #cbd5e1, border-strong: #64748b,
|
|
9
|
+
),
|
|
10
|
+
'indigo': (
|
|
11
|
+
primary: #4f46e5, primary-light: #eeecfd, primary-dark: #3730a3,
|
|
12
|
+
surface: #ffffff, surface-muted: #f4f4fa,
|
|
13
|
+
text: #232238, text-secondary: #56546c,
|
|
14
|
+
border: #d5d3e3, border-strong: #76738d,
|
|
15
|
+
),
|
|
16
|
+
'teal': (
|
|
17
|
+
primary: #0f766e, primary-light: #e5f3f1, primary-dark: #115e59,
|
|
18
|
+
surface: #ffffff, surface-muted: #f0f7f6,
|
|
19
|
+
text: #18302d, text-secondary: #47635f,
|
|
20
|
+
border: #c9dcd8, border-strong: #637f79,
|
|
21
|
+
),
|
|
22
|
+
'copper': (
|
|
23
|
+
primary: #9a6324, primary-light: #f8efe4, primary-dark: #6b4414,
|
|
24
|
+
surface: #ffffff, surface-muted: #f4f2f1,
|
|
25
|
+
text: #302820, text-secondary: #665a4d,
|
|
26
|
+
border: #dcd3c9, border-strong: #8c7a67,
|
|
27
|
+
),
|
|
28
|
+
'slate': (
|
|
29
|
+
primary: #475569, primary-light: #e9edf2, primary-dark: #334155,
|
|
30
|
+
surface: #ffffff, surface-muted: #f5f6f8,
|
|
31
|
+
text: #1e293b, text-secondary: #526174,
|
|
32
|
+
border: #cdd4dd, border-strong: #6b7a8e,
|
|
33
|
+
),
|
|
34
|
+
'forest': (
|
|
35
|
+
primary: #356447, primary-light: #e8f0e9, primary-dark: #244831,
|
|
36
|
+
surface: #ffffff, surface-muted: #f3f6f0,
|
|
37
|
+
text: #253128, text-secondary: #53634f,
|
|
38
|
+
border: #cfd9c9, border-strong: #72826c,
|
|
39
|
+
),
|
|
40
|
+
'plum': (
|
|
41
|
+
primary: #7b3f80, primary-light: #f2eaf4, primary-dark: #592b60,
|
|
42
|
+
surface: #ffffff, surface-muted: #f7f3f8,
|
|
43
|
+
text: #302334, text-secondary: #68576d,
|
|
44
|
+
border: #dccfdf, border-strong: #8c7492,
|
|
45
|
+
),
|
|
46
|
+
'rose': (
|
|
47
|
+
primary: #a33d62, primary-light: #faeaf0, primary-dark: #7d2849,
|
|
48
|
+
surface: #ffffff, surface-muted: #faf4f5,
|
|
49
|
+
text: #35262c, text-secondary: #70565f,
|
|
50
|
+
border: #e1cfd6, border-strong: #997480,
|
|
51
|
+
),
|
|
52
|
+
);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
@use "sass:map";
|
|
2
2
|
@use "../core/color";
|
|
3
|
+
@use "./presets";
|
|
3
4
|
|
|
4
5
|
$default-theme: (
|
|
5
|
-
primary:
|
|
6
|
+
primary: #005cbb,
|
|
6
7
|
primary-light: color-mix(in srgb, var(--sd-primary) 14%, white),
|
|
7
8
|
primary-dark: color-mix(in srgb, var(--sd-primary) 84%, black),
|
|
8
9
|
primary-contrast: #ffffff,
|
|
9
10
|
|
|
10
|
-
secondary:
|
|
11
|
+
secondary: #5c6270,
|
|
11
12
|
secondary-light: color-mix(in srgb, var(--sd-secondary) 12%, white),
|
|
12
13
|
secondary-dark: color-mix(in srgb, var(--sd-secondary) 84%, black),
|
|
13
14
|
secondary-contrast: #ffffff,
|
|
@@ -27,18 +28,18 @@ $default-theme: (
|
|
|
27
28
|
warning-dark: color-mix(in srgb, var(--sd-warning) 84%, black),
|
|
28
29
|
warning-contrast: #ffffff,
|
|
29
30
|
|
|
30
|
-
error:
|
|
31
|
+
error: #ba1a1a,
|
|
31
32
|
error-light: color-mix(in srgb, var(--sd-error) 14%, white),
|
|
32
33
|
error-dark: color-mix(in srgb, var(--sd-error) 84%, black),
|
|
33
34
|
error-contrast: #ffffff,
|
|
34
35
|
|
|
35
|
-
surface:
|
|
36
|
-
surface-muted:
|
|
37
|
-
text:
|
|
38
|
-
text-secondary:
|
|
36
|
+
surface: #fdfbff,
|
|
37
|
+
surface-muted: #e7e8ed,
|
|
38
|
+
text: #1a1b1f,
|
|
39
|
+
text-secondary: #44474f,
|
|
39
40
|
text-muted: color-mix(in srgb, var(--sd-text) 62%, transparent),
|
|
40
|
-
border:
|
|
41
|
-
border-strong:
|
|
41
|
+
border: #c4c6d0,
|
|
42
|
+
border-strong: #74777f,
|
|
42
43
|
disabled-bg: color-mix(in srgb, var(--sd-text) 8%, transparent),
|
|
43
44
|
disabled-text: color-mix(in srgb, var(--sd-text) 60%, transparent),
|
|
44
45
|
);
|
|
@@ -50,8 +51,35 @@ $default-theme: (
|
|
|
50
51
|
--mat-form-field-error-focus-trailing-icon-color: var(--sd-error-dark, #{map.get($default-theme, 'error-dark')});
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
// Opt-in compatibility for consumers whose palette is owned by Material.
|
|
55
|
+
$material-source-theme: (
|
|
56
|
+
primary: var(--mat-sys-primary, #005cbb),
|
|
57
|
+
secondary: var(--mat-sys-secondary, #5c6270),
|
|
58
|
+
error: var(--mat-sys-error, #ba1a1a),
|
|
59
|
+
surface: var(--mat-sys-surface, #fdfbff),
|
|
60
|
+
surface-muted: var(--mat-sys-surface-container-highest, #e7e8ed),
|
|
61
|
+
text: var(--mat-sys-on-surface, #1a1b1f),
|
|
62
|
+
text-secondary: var(--mat-sys-on-surface-variant, #44474f),
|
|
63
|
+
border: var(--mat-sys-outline-variant, #c4c6d0),
|
|
64
|
+
border-strong: var(--mat-sys-outline, #74777f),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
@mixin theme($theme: (), $source: 'core', $preset: 'default') {
|
|
68
|
+
@if $source != 'core' and $source != 'material' {
|
|
69
|
+
@error "Unknown Core UI theme source '#{$source}'. Use 'core' or 'material'.";
|
|
70
|
+
}
|
|
71
|
+
@if not map.has-key(presets.$presets, $preset) {
|
|
72
|
+
@error "Unknown Core UI preset '#{$preset}'. Available: #{map.keys(presets.$presets)}.";
|
|
73
|
+
}
|
|
74
|
+
@if $source == 'material' and $preset != 'default' {
|
|
75
|
+
@error "Core UI presets require $source: 'core'. Material source only supports $preset: 'default'.";
|
|
76
|
+
}
|
|
77
|
+
$base: $default-theme;
|
|
78
|
+
@if $source == 'material' {
|
|
79
|
+
$base: map.merge($base, $material-source-theme);
|
|
80
|
+
}
|
|
81
|
+
$base: map.merge($base, map.get(presets.$presets, $preset));
|
|
82
|
+
$theme: map.merge($base, $theme);
|
|
55
83
|
|
|
56
84
|
@each $color in color.$public-colors {
|
|
57
85
|
--sd-#{$color}: #{map.get($theme, $color)};
|
|
@@ -2536,7 +2536,7 @@ class SdApiContractNodeDrawer {
|
|
|
2536
2536
|
[title]="'core.component.api-contract-builder.drawer.save' | sdTranslate"
|
|
2537
2537
|
(click)="save()"></sd-button>
|
|
2538
2538
|
</sd-side-drawer>
|
|
2539
|
-
`, isInline: true, styles: [".sd-acb-drawer{display:flex;flex-direction:column;gap:12px;padding:16px}.sd-acb-drawer__crumbs{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:12px}.sd-acb-drawer__crumb{padding:2px 4px;border:0;border-radius:4px;background:transparent;color:var(--sd-primary, #005cbb);font:inherit;cursor:pointer}.sd-acb-drawer__crumb:hover{background:color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent)}.sd-acb-drawer__crumb--current{color:var(--sd-text, #1a1b1f);font-weight:600;cursor:default}.sd-acb-drawer__crumb-sep{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__children{display:flex;flex-direction:column;gap:6px;padding-top:4px;border-top:1px solid var(--sd-border-color, #e6e6e6)}.sd-acb-drawer__children-title{margin:0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__confirm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }, { kind: "component", type: SdApiContractSourceEditor, selector: "sd-api-contract-source-editor", inputs: ["node", "suggestions", "disabled", "autoId"], outputs: ["nodeChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2539
|
+
`, isInline: true, styles: [".sd-acb-drawer{display:flex;flex-direction:column;gap:12px;padding:16px}.sd-acb-drawer__crumbs{display:flex;flex-wrap:wrap;gap:4px;align-items:center;font-size:12px}.sd-acb-drawer__crumb{padding:2px 4px;border:0;border-radius:4px;background:transparent;color:var(--sd-primary, #005cbb);font:inherit;cursor:pointer}.sd-acb-drawer__crumb:hover{background:color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent)}.sd-acb-drawer__crumb--current{color:var(--sd-text, #1a1b1f);font-weight:600;cursor:default}.sd-acb-drawer__crumb-sep{color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__children{display:flex;flex-direction:column;gap:6px;padding-top:4px;border-top:1px solid var(--sd-border-color, #e6e6e6)}.sd-acb-drawer__children-title{margin:0;font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__empty{margin:0;font-size:12px;font-style:italic;color:var(--sd-text-secondary, #6b6b6b)}.sd-acb-drawer__confirm{display:flex;flex-wrap:wrap;gap:8px;align-items:center;padding:8px 10px;border:1px dashed var(--sd-border-color, #e6e6e6);border-radius:6px;background:var(--sd-surface-muted, #f3f5f8);font-size:12px}\n"], dependencies: [{ kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "size", "form", "label", "helperText", "placeholder", "type", "mask", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }, { kind: "component", type: SdSelect, selector: "sd-select", inputs: ["autoId", "name", "size", "form", "label", "helperText", "placeholder", "valueField", "displayField", "disabledField", "cacheChecksum", "limit", "hyperlink", "minWidthPanel", "hideInlineError", "hideReadError", "required", "disabled", "viewed", "multiple", "showSelectAll", "clearable", "validator", "inlineError", "appearance", "floatLabel", "items", "model"], outputs: ["sdReadStateChange", "modelChange", "sdChange", "sdSelection"] }, { kind: "component", type: SdApiContractNodeSummary, selector: "sd-api-contract-node-summary", inputs: ["name", "node", "readonly", "autoId"], outputs: ["edit", "remove"] }, { kind: "component", type: SdApiContractSourceEditor, selector: "sd-api-contract-source-editor", inputs: ["node", "suggestions", "disabled", "autoId"], outputs: ["nodeChange"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2540
2540
|
}
|
|
2541
2541
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdApiContractNodeDrawer, decorators: [{
|
|
2542
2542
|
type: Component,
|