@sdcorejs/angular 19.2.13 → 19.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.
Files changed (61) hide show
  1. package/assets/STYLE-GUIDE.md +138 -10
  2. package/assets/scss/core/form.scss +18 -2
  3. package/assets/scss/core/utilities/_base.scss +3 -3
  4. package/assets/scss/themes/_presets.scss +52 -0
  5. package/assets/scss/themes/default.scss +39 -11
  6. package/assets/scss/themes/material-theme.scss +2 -2
  7. package/components/button/src/button.component.d.ts +5 -0
  8. package/components/file-explorer/index.d.ts +2 -0
  9. package/components/file-explorer/src/components/file-icon.component.d.ts +15 -0
  10. package/components/file-explorer/src/components/folder-tree.component.d.ts +29 -0
  11. package/components/file-explorer/src/components/item-list.component.d.ts +34 -0
  12. package/components/file-explorer/src/components/preview-panel.component.d.ts +52 -0
  13. package/components/file-explorer/src/components/transfer-panel.component.d.ts +29 -0
  14. package/components/file-explorer/src/file-explorer-icons.generated.d.ts +8 -0
  15. package/components/file-explorer/src/file-explorer.component.d.ts +135 -0
  16. package/components/file-explorer/src/file-explorer.model.d.ts +268 -0
  17. package/components/file-explorer/src/file-explorer.utils.d.ts +54 -0
  18. package/components/file-explorer/src/file-explorer.view-model.d.ts +90 -0
  19. package/components/index.d.ts +1 -0
  20. package/components/side-drawer/src/side-drawer.component.d.ts +12 -1
  21. package/components/tab/src/tab-group.component.d.ts +7 -1
  22. package/components/table/src/components/mobile-cards/mobile-cards.component.d.ts +6 -1
  23. package/components/table/src/directives/sd-aggregate-layout.directive.d.ts +17 -0
  24. package/components/table/src/models/index.d.ts +1 -0
  25. package/components/table/src/models/table-aggregate.model.d.ts +142 -0
  26. package/components/table/src/models/table-column.model.d.ts +29 -5
  27. package/components/table/src/models/table-option.model.d.ts +10 -0
  28. package/components/table/src/pipes/sd-aggregate-rows.pipe.d.ts +15 -0
  29. package/components/table/src/services/table-aggregate.util.d.ts +40 -0
  30. package/components/table/src/services/table-local/table-local.util.d.ts +1 -0
  31. package/components/table/src/table.component.d.ts +23 -0
  32. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +1 -1
  33. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-button.mjs +12 -2
  35. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2582 -0
  37. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -0
  38. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
  39. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  40. package/fesm2022/sdcorejs-angular-components-preview.mjs +2 -2
  41. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +91 -6
  43. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +10 -4
  45. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-tab.mjs +51 -2
  47. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-table.mjs +501 -78
  49. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  51. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-forms-select.mjs +2 -2
  53. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-i18n.mjs +430 -0
  55. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-modules-icon.mjs +6 -0
  57. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-modules-layout.mjs +2 -2
  59. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  60. package/i18n/src/en.d.ts +85 -0
  61. package/package.json +9 -5
@@ -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 bridge các token nền tảng sang Angular Material M3 `--mat-sys-*` khi có thể.
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` | `var(--mat-sys-primary, #005cbb)` | Main action color |
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` | `var(--mat-sys-secondary, #5c6270)` | Secondary action/accent |
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` | `var(--mat-sys-surface, #fdfbff)` | Page/component surface |
125
- | `surface-muted` | `--sd-surface-muted` | `var(--mat-sys-surface-container-highest, #e7e8ed)` | Muted neutral background |
126
- | `text` | `--sd-text` | `var(--mat-sys-on-surface, #1a1b1f)` | Primary text |
127
- | `text-secondary` | `--sd-text-secondary` | `var(--mat-sys-on-surface-variant, #44474f)` | Secondary text |
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` | `var(--mat-sys-outline-variant, #c4c6d0)` | Divider/subtle border |
130
- | `border-strong` | `--sd-border-strong` | `var(--mat-sys-outline, #74777f)` | Strong border/focus outline |
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 can override SDCoreJS semantic tokens with `sd.theme()`. When an app owns the global Angular Material theme, use the Material M3 token API with `mat.theme()`.
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: inline-flex + vertical-align: middle tạo khoảng baseline dưới label,
228
- // khiến chữ thấp hơn tâm của field 32px. Flex block giữ nguyên transform float của Material.
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, var(--mat-sys-on-surface, #1a1b1f));
41
- background-color: var(--sd-surface, var(--mat-sys-surface, #fdfbff));
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, var(--mat-sys-primary, #005cbb));
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: var(--mat-sys-primary, #005cbb),
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: var(--mat-sys-secondary, #5c6270),
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: var(--mat-sys-error, #ba1a1a),
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: var(--mat-sys-surface, #fdfbff),
36
- surface-muted: var(--mat-sys-surface-container-highest, #e7e8ed),
37
- text: var(--mat-sys-on-surface, #1a1b1f),
38
- text-secondary: var(--mat-sys-on-surface-variant, #44474f),
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: var(--mat-sys-outline-variant, #c4c6d0),
41
- border-strong: var(--mat-sys-outline, #74777f),
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
- @mixin theme($theme: ()) {
54
- $theme: map.merge($default-theme, $theme);
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)};
@@ -17,6 +17,6 @@ html {
17
17
  }
18
18
 
19
19
  body {
20
- background: var(--mat-sys-surface);
21
- color: var(--mat-sys-on-surface);
20
+ background: var(--sd-surface);
21
+ color: var(--sd-text);
22
22
  }
@@ -39,6 +39,11 @@ export declare class SdButton implements OnInit, OnDestroy {
39
39
  block: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
40
40
  htmlType: import("@angular/core").InputSignalWithTransform<SdButtonHtmlType, SdButtonHtmlType | null | undefined>;
41
41
  autoId: import("@angular/core").Signal<string | undefined>;
42
+ /**
43
+ * Accessible name of the trigger. Menu triggers use title/tooltip; icon-only buttons use the tooltip
44
+ * because their icon is `aria-hidden` and they have no visible text.
45
+ */
46
+ readonly ariaLabel: import("@angular/core").Signal<string | null>;
42
47
  buttonClasses: import("@angular/core").Signal<{
43
48
  'c-square': boolean;
44
49
  'c-sm': boolean;
@@ -0,0 +1,2 @@
1
+ export * from './src/file-explorer.component';
2
+ export type * from './src/file-explorer.model';
@@ -0,0 +1,15 @@
1
+ import type { SdFileExplorerIconName } from '../file-explorer-icons.generated';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Built-in file-type icon (folder, PDF, spreadsheet, image, code…), drawn from the embedded SVG set.
5
+ * Decorative: always `aria-hidden` with an empty `alt`, the item name next to it carries the meaning.
6
+ */
7
+ export declare class SdFileExplorerFileIcon {
8
+ /** Icon to draw. */
9
+ readonly icon: import("@angular/core").InputSignal<SdFileExplorerIconName>;
10
+ /** Rendered size in pixels (the SVGs use a 64 × 64 canvas with built-in padding). */
11
+ readonly size: import("@angular/core").InputSignal<number>;
12
+ protected readonly src: import("@angular/core").Signal<string>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdFileExplorerFileIcon, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdFileExplorerFileIcon, "sd-file-explorer-file-icon", never, { "icon": { "alias": "icon"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
15
+ }
@@ -0,0 +1,29 @@
1
+ import type { SdFileExplorerTreeNode } from '../file-explorer.view-model';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Folder tree of the explorer (internal). Rendered as a flat `role="tree"` list whose depth is carried by
5
+ * `aria-level`, with a roving tabindex and the WAI-ARIA tree keyboard model.
6
+ */
7
+ export declare class SdFileExplorerFolderTree {
8
+ #private;
9
+ /** Visible nodes in display order. */
10
+ readonly nodes: import("@angular/core").InputSignal<readonly SdFileExplorerTreeNode[]>;
11
+ /** Accessible name of the tree. */
12
+ readonly label: import("@angular/core").InputSignal<string>;
13
+ /** A node was activated (click, Enter, Space). */
14
+ readonly select: import("@angular/core").OutputEmitterRef<SdFileExplorerTreeNode>;
15
+ /** Expand / collapse requested. */
16
+ readonly toggle: import("@angular/core").OutputEmitterRef<SdFileExplorerTreeNode>;
17
+ /** Retry loading the children of a node whose listing failed. */
18
+ readonly retry: import("@angular/core").OutputEmitterRef<SdFileExplorerTreeNode>;
19
+ protected readonly focusedKey: import("@angular/core").WritableSignal<string | null>;
20
+ protected readonly retryLabel: import("@angular/core").Signal<string>;
21
+ /** Node owning the roving tabindex: the focused node if still visible, else the selected one. */
22
+ protected readonly activeKey: import("@angular/core").Signal<string>;
23
+ protected toggleLabel(node: SdFileExplorerTreeNode): string;
24
+ protected onToggle(event: Event, node: SdFileExplorerTreeNode): void;
25
+ protected onRetry(event: Event, node: SdFileExplorerTreeNode): void;
26
+ protected onKeydown(event: KeyboardEvent, index: number): void;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdFileExplorerFolderTree, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdFileExplorerFolderTree, "sd-file-explorer-folder-tree", never, { "nodes": { "alias": "nodes"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "select": "select"; "toggle": "toggle"; "retry": "retry"; }, never, never, true, never>;
29
+ }
@@ -0,0 +1,34 @@
1
+ import type { SdFileExplorerView } from '../file-explorer.model';
2
+ import type { SdFileExplorerItemView } from '../file-explorer.view-model';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Items of the current folder (or search results) as a list or a grid (internal).
6
+ * Rows and cards are focusable; `Enter` / `Space` activate them like a click.
7
+ */
8
+ export declare class SdFileExplorerItemList {
9
+ /** Items to render, already formatted. */
10
+ readonly items: import("@angular/core").InputSignal<readonly SdFileExplorerItemView[]>;
11
+ /** `list` or `grid`. */
12
+ readonly view: import("@angular/core").InputSignal<SdFileExplorerView>;
13
+ /** Show download buttons for files. */
14
+ readonly canDownload: import("@angular/core").InputSignal<boolean>;
15
+ /** Show share buttons for files. */
16
+ readonly canShare: import("@angular/core").InputSignal<boolean>;
17
+ /** Narrow layout: hides the modified column. */
18
+ readonly compact: import("@angular/core").InputSignal<boolean>;
19
+ /** Id of the file currently shown in the preview panel. */
20
+ readonly activeId: import("@angular/core").InputSignal<string | null>;
21
+ /** Accessible name of the list. */
22
+ readonly label: import("@angular/core").InputSignal<string>;
23
+ /** Row / card activated. */
24
+ readonly activate: import("@angular/core").OutputEmitterRef<SdFileExplorerItemView>;
25
+ /** Download button pressed. */
26
+ readonly download: import("@angular/core").OutputEmitterRef<SdFileExplorerItemView>;
27
+ /** Share button pressed. */
28
+ readonly share: import("@angular/core").OutputEmitterRef<SdFileExplorerItemView>;
29
+ /** Width of the row action column: one 32 px icon button per enabled action. */
30
+ protected readonly actionsWidth: import("@angular/core").Signal<string | null>;
31
+ protected onKeydown(event: KeyboardEvent, view: SdFileExplorerItemView): void;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdFileExplorerItemList, never>;
33
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdFileExplorerItemList, "sd-file-explorer-item-list", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "view": { "alias": "view"; "required": false; "isSignal": true; }; "canDownload": { "alias": "canDownload"; "required": false; "isSignal": true; }; "canShare": { "alias": "canShare"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "activeId": { "alias": "activeId"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; }, { "activate": "activate"; "download": "download"; "share": "share"; }, never, never, true, never>;
34
+ }
@@ -0,0 +1,52 @@
1
+ import { Type } from '@angular/core';
2
+ import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
3
+ import type { SdFileExplorerItemView, SdFileExplorerMetaRow, SdFileExplorerPreviewState } from '../file-explorer.view-model';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * File detail of the explorer (internal): an `<sd-side-drawer>` opened in the explorer's item area (right of the
7
+ * folder tree, below the header) through the drawer's `container` input, with the preview stage and metadata in its
8
+ * body and share / download in its footer.
9
+ *
10
+ * The explorer owns the open file: a non-null `view` opens the drawer, `null` closes it. When the user closes
11
+ * the drawer (close button, `Escape`, backdrop) the panel emits `close`.
12
+ *
13
+ * PDFs render with `<sd-preview-pdf>`, imported on demand so the PDF.js bundle is only fetched the first
14
+ * time a PDF is previewed.
15
+ */
16
+ export declare class SdFileExplorerPreviewPanel {
17
+ #private;
18
+ /** File shown in the drawer; `null` closes the drawer. */
19
+ readonly view: import("@angular/core").InputSignal<SdFileExplorerItemView | null>;
20
+ /** What the stage renders. */
21
+ readonly state: import("@angular/core").InputSignal<SdFileExplorerPreviewState>;
22
+ /** Metadata rows (name, type, size, modified). */
23
+ readonly meta: import("@angular/core").InputSignal<readonly SdFileExplorerMetaRow[]>;
24
+ /** Show the download button. */
25
+ readonly canDownload: import("@angular/core").InputSignal<boolean>;
26
+ /** Show the share button. */
27
+ readonly canShare: import("@angular/core").InputSignal<boolean>;
28
+ /** Element the drawer opens inside: the explorer's item area, right of the folder tree. */
29
+ readonly container: import("@angular/core").InputSignal<HTMLElement | null>;
30
+ /** E2E scope of the detail content and its buttons. */
31
+ readonly autoId: import("@angular/core").InputSignal<string | undefined>;
32
+ /** The user closed the drawer (close button, `Escape` or backdrop). */
33
+ readonly close: import("@angular/core").OutputEmitterRef<void>;
34
+ /** Download button pressed. */
35
+ readonly download: import("@angular/core").OutputEmitterRef<void>;
36
+ /** Share button pressed. */
37
+ readonly share: import("@angular/core").OutputEmitterRef<void>;
38
+ /** Retry button of the error state pressed. */
39
+ readonly retry: import("@angular/core").OutputEmitterRef<void>;
40
+ /** The `<img>` failed to load. */
41
+ readonly imageError: import("@angular/core").OutputEmitterRef<void>;
42
+ protected readonly drawer: import("@angular/core").Signal<SdSideDrawer | undefined>;
43
+ protected readonly drawerTitle: import("@angular/core").Signal<string>;
44
+ protected readonly drawerAutoId: import("@angular/core").Signal<string | undefined>;
45
+ protected readonly pdfComponent: import("@angular/core").WritableSignal<Type<unknown> | null>;
46
+ protected readonly pdfFailed: import("@angular/core").WritableSignal<boolean>;
47
+ protected readonly pdfInputs: import("@angular/core").Signal<Record<string, unknown>>;
48
+ constructor();
49
+ protected onDrawerClosed(): void;
50
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdFileExplorerPreviewPanel, never>;
51
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdFileExplorerPreviewPanel, "sd-file-explorer-preview-panel", never, { "view": { "alias": "view"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": true; "isSignal": true; }; "meta": { "alias": "meta"; "required": false; "isSignal": true; }; "canDownload": { "alias": "canDownload"; "required": false; "isSignal": true; }; "canShare": { "alias": "canShare"; "required": false; "isSignal": true; }; "container": { "alias": "container"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "close": "close"; "download": "download"; "share": "share"; "retry": "retry"; "imageError": "imageError"; }, never, never, true, never>;
52
+ }
@@ -0,0 +1,29 @@
1
+ import type { SdFileExplorerTransferView } from '../file-explorer.view-model';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * Transfer queue docked at the bottom of the explorer (internal). Shows one card per upload / download with
5
+ * its status, a progress bar and the cancel / retry / dismiss actions allowed by its state.
6
+ */
7
+ export declare class SdFileExplorerTransferPanel {
8
+ /** Cards to render, newest last. */
9
+ readonly transfers: import("@angular/core").InputSignal<readonly SdFileExplorerTransferView[]>;
10
+ /** Header text ("Transfers · 2 items"). */
11
+ readonly title: import("@angular/core").InputSignal<string>;
12
+ /** Hide the cards, keep the header. */
13
+ readonly collapsed: import("@angular/core").InputSignal<boolean>;
14
+ /** Show the "Clear finished" button. */
15
+ readonly canClear: import("@angular/core").InputSignal<boolean>;
16
+ /** Narrow layout: "Clear finished" becomes an icon button so the header stays on one line. */
17
+ readonly compact: import("@angular/core").InputSignal<boolean>;
18
+ /** E2E scope of the panel. */
19
+ readonly autoId: import("@angular/core").InputSignal<string | undefined>;
20
+ readonly toggleCollapsed: import("@angular/core").OutputEmitterRef<void>;
21
+ readonly clear: import("@angular/core").OutputEmitterRef<void>;
22
+ readonly cancel: import("@angular/core").OutputEmitterRef<string>;
23
+ readonly retry: import("@angular/core").OutputEmitterRef<string>;
24
+ readonly dismiss: import("@angular/core").OutputEmitterRef<string>;
25
+ protected readonly titleId: string;
26
+ protected readonly listId: string;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<SdFileExplorerTransferPanel, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<SdFileExplorerTransferPanel, "sd-file-explorer-transfer-panel", never, { "transfers": { "alias": "transfers"; "required": true; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "collapsed": { "alias": "collapsed"; "required": false; "isSignal": true; }; "canClear": { "alias": "canClear"; "required": false; "isSignal": true; }; "compact": { "alias": "compact"; "required": false; "isSignal": true; }; "autoId": { "alias": "autoId"; "required": false; "isSignal": true; }; }, { "toggleCollapsed": "toggleCollapsed"; "clear": "clear"; "cancel": "cancel"; "retry": "retry"; "dismiss": "dismiss"; }, never, never, true, never>;
29
+ }
@@ -0,0 +1,8 @@
1
+ /** Name of a built-in SdFileExplorer file-type icon. */
2
+ export type SdFileExplorerIconName = 'file-3d' | 'file-7z' | 'file-ai' | 'file-app' | 'file-archive' | 'file-audio' | 'file-book' | 'file-code' | 'file-css' | 'file-csv' | 'file-design' | 'file-document' | 'file-figma' | 'file-font' | 'file-generic' | 'file-gif' | 'file-html' | 'file-image' | 'file-jpg' | 'file-js' | 'file-json' | 'file-markdown' | 'file-mov' | 'file-mp3' | 'file-mp4' | 'file-pdf' | 'file-png' | 'file-presentation' | 'file-psd' | 'file-python' | 'file-rar' | 'file-spreadsheet' | 'file-sql' | 'file-svg' | 'file-tar' | 'file-text' | 'file-ts' | 'file-video' | 'file-wav' | 'file-webp' | 'file-xml' | 'file-yaml' | 'file-zip' | 'folder-closed' | 'folder-open';
3
+ /** Icon markup (64 × 64 viewBox), without title / ARIA / fixed size — rendered decoratively. */
4
+ export declare const SD_FILE_EXPLORER_ICON_SVGS: Readonly<Record<SdFileExplorerIconName, string>>;
5
+ /** Lower-case extension (including compound ones such as `tar.gz`) → icon. */
6
+ export declare const SD_FILE_EXPLORER_ICON_EXTENSIONS: Readonly<Record<string, SdFileExplorerIconName>>;
7
+ /** Exact MIME type, or a family prefix ending with `/`, → icon. Used when the extension is unknown. */
8
+ export declare const SD_FILE_EXPLORER_ICON_MIME: Readonly<Record<string, SdFileExplorerIconName>>;