@ojiepermana/angular 0.0.3 → 0.1.1

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 (41) hide show
  1. package/README.md +55 -9
  2. package/fesm2022/ojiepermana-angular-internal.mjs +433 -2
  3. package/fesm2022/ojiepermana-angular-internal.mjs.map +1 -1
  4. package/fesm2022/ojiepermana-angular-layout.mjs +52 -59
  5. package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -1
  6. package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs +721 -0
  7. package/fesm2022/ojiepermana-angular-navigation-horizontal.mjs.map +1 -0
  8. package/fesm2022/ojiepermana-angular-navigation-vertical.mjs +1647 -0
  9. package/fesm2022/ojiepermana-angular-navigation-vertical.mjs.map +1 -0
  10. package/fesm2022/ojiepermana-angular-navigation.mjs +472 -0
  11. package/fesm2022/ojiepermana-angular-navigation.mjs.map +1 -0
  12. package/fesm2022/ojiepermana-angular-shell.mjs +6 -1
  13. package/fesm2022/ojiepermana-angular-shell.mjs.map +1 -1
  14. package/fesm2022/ojiepermana-angular-theme-component.mjs +12 -26
  15. package/fesm2022/ojiepermana-angular-theme-component.mjs.map +1 -1
  16. package/fesm2022/ojiepermana-angular-theme-service.mjs +2 -6
  17. package/fesm2022/ojiepermana-angular-theme-service.mjs.map +1 -1
  18. package/fesm2022/ojiepermana-angular.mjs.map +1 -1
  19. package/layout/README.md +3 -3
  20. package/{theme/styles/layout → layout/src/component/horizontal}/horizontal.css +39 -26
  21. package/{theme/styles/layout → layout/src/component/vertical}/vertical.css +10 -12
  22. package/{theme/styles/layout/index.css → layout/src/layout.css} +0 -3
  23. package/navigation/README.md +301 -0
  24. package/navigation/horizontal/README.md +49 -0
  25. package/navigation/vertical/README.md +0 -0
  26. package/package.json +13 -1
  27. package/shell/README.md +5 -1
  28. package/styles/index.css +1 -1
  29. package/theme/README.md +3 -6
  30. package/theme/styles/adapters/material-ui/index.css +1 -5
  31. package/theme/styles/presets/styles/flat.css +3 -6
  32. package/theme/styles/presets/styles/glass.css +1 -7
  33. package/theme/styles/presets/styles/index.css +1 -1
  34. package/theme/styles/roles/index.css +18 -0
  35. package/theme/styles/tokens/foundation.css +4 -7
  36. package/types/ojiepermana-angular-internal.d.ts +65 -1
  37. package/types/ojiepermana-angular-layout.d.ts +1 -1
  38. package/types/ojiepermana-angular-navigation-horizontal.d.ts +81 -0
  39. package/types/ojiepermana-angular-navigation-vertical.d.ts +262 -0
  40. package/types/ojiepermana-angular-navigation.d.ts +228 -0
  41. package/types/ojiepermana-angular-shell.d.ts +2 -0
@@ -22,8 +22,7 @@ class StyleSwitcherComponent {
22
22
  aria-label="Glass style"
23
23
  [attr.aria-pressed]="theme.style() === 'glass'"
24
24
  [matTooltip]="label()"
25
- (click)="toggle()"
26
- >
25
+ (click)="toggle()">
27
26
  @if (theme.style() === 'flat') {
28
27
  <svg lucideLayoutDashboard aria-hidden="true"></svg>
29
28
  } @else {
@@ -47,8 +46,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
47
46
  aria-label="Glass style"
48
47
  [attr.aria-pressed]="theme.style() === 'glass'"
49
48
  [matTooltip]="label()"
50
- (click)="toggle()"
51
- >
49
+ (click)="toggle()">
52
50
  @if (theme.style() === 'flat') {
53
51
  <svg lucideLayoutDashboard aria-hidden="true"></svg>
54
52
  } @else {
@@ -71,19 +69,15 @@ class ColorPickerComponent {
71
69
  class="color-picker-button focus-ring inline-flex size-11 items-center justify-center rounded-full p-1.5"
72
70
  [class.color-picker-button-selected]="theme.color() === c.value"
73
71
  [attr.aria-label]="
74
- theme.color() === c.value
75
- ? 'Theme color: ' + c.label + ' (selected)'
76
- : 'Theme color: ' + c.label
72
+ theme.color() === c.value ? 'Theme color: ' + c.label + ' (selected)' : 'Theme color: ' + c.label
77
73
  "
78
74
  [attr.aria-pressed]="theme.color() === c.value"
79
75
  [matTooltip]="c.label"
80
- (click)="theme.setColor(c.value)"
81
- >
76
+ (click)="theme.setColor(c.value)">
82
77
  <span
83
78
  class="color-picker-swatch size-7 rounded-full border"
84
79
  [attr.data-theme-color]="c.value"
85
- aria-hidden="true"
86
- ></span>
80
+ aria-hidden="true"></span>
87
81
  </button>
88
82
  }
89
83
  </div>
@@ -99,19 +93,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
99
93
  class="color-picker-button focus-ring inline-flex size-11 items-center justify-center rounded-full p-1.5"
100
94
  [class.color-picker-button-selected]="theme.color() === c.value"
101
95
  [attr.aria-label]="
102
- theme.color() === c.value
103
- ? 'Theme color: ' + c.label + ' (selected)'
104
- : 'Theme color: ' + c.label
96
+ theme.color() === c.value ? 'Theme color: ' + c.label + ' (selected)' : 'Theme color: ' + c.label
105
97
  "
106
98
  [attr.aria-pressed]="theme.color() === c.value"
107
99
  [matTooltip]="c.label"
108
- (click)="theme.setColor(c.value)"
109
- >
100
+ (click)="theme.setColor(c.value)">
110
101
  <span
111
102
  class="color-picker-swatch size-7 rounded-full border"
112
103
  [attr.data-theme-color]="c.value"
113
- aria-hidden="true"
114
- ></span>
104
+ aria-hidden="true"></span>
115
105
  </button>
116
106
  }
117
107
  </div>
@@ -134,8 +124,7 @@ class SchemeSwitcherComponent {
134
124
  mat-icon-button
135
125
  [attr.aria-label]="'Color scheme: ' + currentOption().label"
136
126
  [matTooltip]="'Color scheme: ' + currentOption().label"
137
- [matMenuTriggerFor]="menu"
138
- >
127
+ [matMenuTriggerFor]="menu">
139
128
  @switch (theme.scheme()) {
140
129
  @case ('light') {
141
130
  <svg lucideSun aria-hidden="true"></svg>
@@ -156,8 +145,7 @@ class SchemeSwitcherComponent {
156
145
  mat-menu-item
157
146
  role="menuitemradio"
158
147
  [attr.aria-checked]="theme.scheme() === option.value"
159
- (click)="theme.setScheme(option.value)"
160
- >
148
+ (click)="theme.setScheme(option.value)">
161
149
  @switch (option.value) {
162
150
  @case ('light') {
163
151
  <svg lucideSun aria-hidden="true"></svg>
@@ -198,8 +186,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
198
186
  mat-icon-button
199
187
  [attr.aria-label]="'Color scheme: ' + currentOption().label"
200
188
  [matTooltip]="'Color scheme: ' + currentOption().label"
201
- [matMenuTriggerFor]="menu"
202
- >
189
+ [matMenuTriggerFor]="menu">
203
190
  @switch (theme.scheme()) {
204
191
  @case ('light') {
205
192
  <svg lucideSun aria-hidden="true"></svg>
@@ -220,8 +207,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
220
207
  mat-menu-item
221
208
  role="menuitemradio"
222
209
  [attr.aria-checked]="theme.scheme() === option.value"
223
- (click)="theme.setScheme(option.value)"
224
- >
210
+ (click)="theme.setScheme(option.value)">
225
211
  @switch (option.value) {
226
212
  @case ('light') {
227
213
  <svg lucideSun aria-hidden="true"></svg>
@@ -1 +1 @@
1
- {"version":3,"file":"ojiepermana-angular-theme-component.mjs","sources":["../../../projects/library/theme/component/src/style-switcher.ts","../../../projects/library/theme/component/src/color-picker.ts","../../../projects/library/theme/component/src/scheme-switcher.ts","../../../projects/library/theme/component/ojiepermana-angular-theme-component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { libraryLucideConfigProvider } from '@ojiepermana/angular/internal';\nimport { LucideBlend, LucideLayoutDashboard } from '@lucide/angular';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'style-switcher',\n imports: [MatIconButton, MatTooltip, LucideBlend, LucideLayoutDashboard],\n providers: [libraryLucideConfigProvider],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button\n class=\"ngt-icon-button\"\n type=\"button\"\n mat-icon-button\n aria-label=\"Glass style\"\n [attr.aria-pressed]=\"theme.style() === 'glass'\"\n [matTooltip]=\"label()\"\n (click)=\"toggle()\"\n >\n @if (theme.style() === 'flat') {\n <svg lucideLayoutDashboard aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideBlend aria-hidden=\"true\"></svg>\n }\n </button>\n `,\n})\nexport class StyleSwitcherComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly label = computed(() =>\n this.theme.style() === 'glass' ? 'Glass style enabled' : 'Glass style disabled',\n );\n\n protected toggle(): void {\n this.theme.setStyle(this.theme.style() === 'flat' ? 'glass' : 'flat');\n }\n}","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'color-picker',\n imports: [MatTooltip],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: `\n .color-picker-button {\n border: 1px solid transparent;\n background: transparent;\n }\n\n .color-picker-button-selected {\n border-color: color-mix(in oklab, var(--ring) 42%, var(--border));\n background: color-mix(in oklab, var(--accent) 60%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ring) 26%, transparent);\n }\n\n .color-picker-swatch {\n background: var(--theme-primary);\n border-color: color-mix(in oklab, var(--theme-primary) 42%, white 58%);\n }\n `,\n template: `\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"Theme colors\">\n @for (c of colors(); track c.value) {\n <button\n type=\"button\"\n class=\"color-picker-button focus-ring inline-flex size-11 items-center justify-center rounded-full p-1.5\"\n [class.color-picker-button-selected]=\"theme.color() === c.value\"\n [attr.aria-label]=\"\n theme.color() === c.value\n ? 'Theme color: ' + c.label + ' (selected)'\n : 'Theme color: ' + c.label\n \"\n [attr.aria-pressed]=\"theme.color() === c.value\"\n [matTooltip]=\"c.label\"\n (click)=\"theme.setColor(c.value)\"\n >\n <span\n class=\"color-picker-swatch size-7 rounded-full border\"\n [attr.data-theme-color]=\"c.value\"\n aria-hidden=\"true\"\n ></span>\n </button>\n }\n </div>\n `,\n})\nexport class ColorPickerComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly colors = this.theme.colorOptions;\n}\n","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { libraryLucideConfigProvider } from '@ojiepermana/angular/internal';\nimport { LucideMonitorCog, LucideMoonStar, LucideSun } from '@lucide/angular';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'scheme-switcher',\n imports: [\n MatIconButton,\n MatMenu,\n MatMenuItem,\n MatMenuTrigger,\n MatTooltip,\n LucideSun,\n LucideMoonStar,\n LucideMonitorCog,\n ],\n providers: [libraryLucideConfigProvider],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button\n class=\"ngt-icon-button\"\n type=\"button\"\n mat-icon-button\n [attr.aria-label]=\"'Color scheme: ' + currentOption().label\"\n [matTooltip]=\"'Color scheme: ' + currentOption().label\"\n [matMenuTriggerFor]=\"menu\"\n >\n @switch (theme.scheme()) {\n @case ('light') {\n <svg lucideSun aria-hidden=\"true\"></svg>\n }\n @case ('dark') {\n <svg lucideMoonStar aria-hidden=\"true\"></svg>\n }\n @default {\n <svg lucideMonitorCog aria-hidden=\"true\"></svg>\n }\n }\n </button>\n\n <mat-menu #menu=\"matMenu\">\n @for (option of options; track option.value) {\n <button\n type=\"button\"\n mat-menu-item\n role=\"menuitemradio\"\n [attr.aria-checked]=\"theme.scheme() === option.value\"\n (click)=\"theme.setScheme(option.value)\"\n >\n @switch (option.value) {\n @case ('light') {\n <svg lucideSun aria-hidden=\"true\"></svg>\n }\n @case ('dark') {\n <svg lucideMoonStar aria-hidden=\"true\"></svg>\n }\n @default {\n <svg lucideMonitorCog aria-hidden=\"true\"></svg>\n }\n }\n <span>{{ option.label }}</span>\n </button>\n }\n </mat-menu>\n `,\n})\nexport class SchemeSwitcherComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly options = [\n { value: 'light' as const, label: 'Light' },\n { value: 'dark' as const, label: 'Dark' },\n { value: 'system' as const, label: 'System' },\n ];\n\n protected readonly currentOption = computed(\n () => this.options.find((option) => option.value === this.theme.scheme()) ?? this.options[2],\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA8Ba,sBAAsB,CAAA;AACd,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;IAE5B,KAAK,GAAG,QAAQ,CAAC,MAClC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,OAAO,GAAG,qBAAqB,GAAG,sBAAsB,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAChF;IAES,MAAM,GAAA;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACvE;uGATW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAtB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,SAAA,EApBtB,CAAC,2BAA2B,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAE9B;;;;;;;;;;;;;;;;AAgBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAnBS,aAAa,EAAA,QAAA,EAAA,sFAAA,EAAA,QAAA,EAAA,CAAA,WAAA,EA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oBAAA,EAAA,4BAAA,CAAA,EAAA,OAAA,EAAA,CAAA,YAAA,EAAA,YAAA,EAAA,YAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACd,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACV,SAAS,EAAA,QAAA,EAAA,gBAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACT,cAAc,gEACd,gBAAgB,EAAA,QAAA,EAAA,uBAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAoDP,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBA9DnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,OAAO,EAAE;wBACP,aAAa;wBACb,OAAO;wBACP,WAAW;wBACX,cAAc;wBACd,UAAU;wBACV,SAAS;wBACT,cAAc;wBACd,gBAAgB;AACjB,qBAAA;oBACD,SAAS,EAAE,CAAC,2BAA2B,CAAC;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CT,EAAA,CAAA;AACF,iBAAA;;;ACrED;;AAEG;;;;"}
1
+ {"version":3,"file":"ojiepermana-angular-theme-component.mjs","sources":["../../../projects/library/theme/component/src/style-switcher.ts","../../../projects/library/theme/component/src/color-picker.ts","../../../projects/library/theme/component/src/scheme-switcher.ts","../../../projects/library/theme/component/ojiepermana-angular-theme-component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { libraryLucideConfigProvider } from '@ojiepermana/angular/internal';\nimport { LucideBlend, LucideLayoutDashboard } from '@lucide/angular';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'style-switcher',\n imports: [MatIconButton, MatTooltip, LucideBlend, LucideLayoutDashboard],\n providers: [libraryLucideConfigProvider],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button\n class=\"ngt-icon-button\"\n type=\"button\"\n mat-icon-button\n aria-label=\"Glass style\"\n [attr.aria-pressed]=\"theme.style() === 'glass'\"\n [matTooltip]=\"label()\"\n (click)=\"toggle()\">\n @if (theme.style() === 'flat') {\n <svg lucideLayoutDashboard aria-hidden=\"true\"></svg>\n } @else {\n <svg lucideBlend aria-hidden=\"true\"></svg>\n }\n </button>\n `,\n})\nexport class StyleSwitcherComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly label = computed(() =>\n this.theme.style() === 'glass' ? 'Glass style enabled' : 'Glass style disabled',\n );\n\n protected toggle(): void {\n this.theme.setStyle(this.theme.style() === 'flat' ? 'glass' : 'flat');\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'color-picker',\n imports: [MatTooltip],\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: `\n .color-picker-button {\n border: 1px solid transparent;\n background: transparent;\n }\n\n .color-picker-button-selected {\n border-color: color-mix(in oklab, var(--ring) 42%, var(--border));\n background: color-mix(in oklab, var(--accent) 60%, transparent);\n box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--ring) 26%, transparent);\n }\n\n .color-picker-swatch {\n background: var(--theme-primary);\n border-color: color-mix(in oklab, var(--theme-primary) 42%, white 58%);\n }\n `,\n template: `\n <div class=\"flex items-center gap-1\" role=\"group\" aria-label=\"Theme colors\">\n @for (c of colors(); track c.value) {\n <button\n type=\"button\"\n class=\"color-picker-button focus-ring inline-flex size-11 items-center justify-center rounded-full p-1.5\"\n [class.color-picker-button-selected]=\"theme.color() === c.value\"\n [attr.aria-label]=\"\n theme.color() === c.value ? 'Theme color: ' + c.label + ' (selected)' : 'Theme color: ' + c.label\n \"\n [attr.aria-pressed]=\"theme.color() === c.value\"\n [matTooltip]=\"c.label\"\n (click)=\"theme.setColor(c.value)\">\n <span\n class=\"color-picker-swatch size-7 rounded-full border\"\n [attr.data-theme-color]=\"c.value\"\n aria-hidden=\"true\"></span>\n </button>\n }\n </div>\n `,\n})\nexport class ColorPickerComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly colors = this.theme.colorOptions;\n}\n","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { libraryLucideConfigProvider } from '@ojiepermana/angular/internal';\nimport { LucideMonitorCog, LucideMoonStar, LucideSun } from '@lucide/angular';\nimport { ThemeService } from '@ojiepermana/angular/theme/service';\n\n@Component({\n selector: 'scheme-switcher',\n imports: [\n MatIconButton,\n MatMenu,\n MatMenuItem,\n MatMenuTrigger,\n MatTooltip,\n LucideSun,\n LucideMoonStar,\n LucideMonitorCog,\n ],\n providers: [libraryLucideConfigProvider],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <button\n class=\"ngt-icon-button\"\n type=\"button\"\n mat-icon-button\n [attr.aria-label]=\"'Color scheme: ' + currentOption().label\"\n [matTooltip]=\"'Color scheme: ' + currentOption().label\"\n [matMenuTriggerFor]=\"menu\">\n @switch (theme.scheme()) {\n @case ('light') {\n <svg lucideSun aria-hidden=\"true\"></svg>\n }\n @case ('dark') {\n <svg lucideMoonStar aria-hidden=\"true\"></svg>\n }\n @default {\n <svg lucideMonitorCog aria-hidden=\"true\"></svg>\n }\n }\n </button>\n\n <mat-menu #menu=\"matMenu\">\n @for (option of options; track option.value) {\n <button\n type=\"button\"\n mat-menu-item\n role=\"menuitemradio\"\n [attr.aria-checked]=\"theme.scheme() === option.value\"\n (click)=\"theme.setScheme(option.value)\">\n @switch (option.value) {\n @case ('light') {\n <svg lucideSun aria-hidden=\"true\"></svg>\n }\n @case ('dark') {\n <svg lucideMoonStar aria-hidden=\"true\"></svg>\n }\n @default {\n <svg lucideMonitorCog aria-hidden=\"true\"></svg>\n }\n }\n <span>{{ option.label }}</span>\n </button>\n }\n </mat-menu>\n `,\n})\nexport class SchemeSwitcherComponent {\n protected readonly theme = inject(ThemeService);\n\n protected readonly options = [\n { value: 'light' as const, label: 'Light' },\n { value: 'dark' as const, label: 'Dark' },\n { value: 'system' as const, label: 'System' },\n ];\n\n protected readonly currentOption = computed(\n () => this.options.find((option) => option.value === this.theme.scheme()) ?? this.options[2],\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MA6Ba,sBAAsB,CAAA;AACd,IAAA,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;IAE5B,KAAK,GAAG,QAAQ,CAAC,MAClC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,OAAO,GAAG,qBAAqB,GAAG,sBAAsB,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAChF;IAES,MAAM,GAAA;QACd,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACvE;uGATW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAA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EAAE,iBAAiB;AAC3B,oBAAA,OAAO,EAAE;wBACP,aAAa;wBACb,OAAO;wBACP,WAAW;wBACX,cAAc;wBACd,UAAU;wBACV,SAAS;wBACT,cAAc;wBACd,gBAAgB;AACjB,qBAAA;oBACD,SAAS,EAAE,CAAC,2BAA2B,CAAC;oBACxC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CT,EAAA,CAAA;AACF,iBAAA;;;ACnED;;AAEG;;;;"}
@@ -210,9 +210,7 @@ function normalizeThemeColorLabels(value) {
210
210
  if (normalizedEntries.length !== entries.length) {
211
211
  warnInvalidThemeConfig('Ignoring unsupported entries in colorLabels config.');
212
212
  }
213
- return normalizedEntries.length > 0
214
- ? Object.fromEntries(normalizedEntries)
215
- : undefined;
213
+ return normalizedEntries.length > 0 ? Object.fromEntries(normalizedEntries) : undefined;
216
214
  }
217
215
  function normalizeThemeConfig(config) {
218
216
  const colors = normalizeThemeColors(config.colors);
@@ -232,9 +230,7 @@ function normalizeThemeConfig(config) {
232
230
  };
233
231
  }
234
232
  function provideNgTheme(config = {}) {
235
- return makeEnvironmentProviders([
236
- { provide: NG_THEME_CONFIG, useValue: normalizeThemeConfig(config) },
237
- ]);
233
+ return makeEnvironmentProviders([{ provide: NG_THEME_CONFIG, useValue: normalizeThemeConfig(config) }]);
238
234
  }
239
235
 
240
236
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ojiepermana-angular-theme-service.mjs","sources":["../../../projects/library/theme/service/src/theme.token.ts","../../../projects/library/theme/service/src/theme.types.ts","../../../projects/library/theme/service/src/theme.service.ts","../../../projects/library/theme/service/src/theme.provider.ts","../../../projects/library/theme/service/ojiepermana-angular-theme-service.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgThemeConfig } from './theme.types';\n\nexport const DEFAULT_NG_THEME_CONFIG: NgThemeConfig = {\n defaultScheme: 'system',\n defaultColor: 'brand',\n defaultStyle: 'flat',\n};\n\nexport const NG_THEME_CONFIG = new InjectionToken<NgThemeConfig>('NG_THEME_CONFIG', {\n providedIn: 'root',\n factory: () => ({ ...DEFAULT_NG_THEME_CONFIG }),\n});\n","export const THEME_SCHEMES = ['light', 'dark', 'system'] as const;\nexport type ThemeScheme = (typeof THEME_SCHEMES)[number];\n\nexport const THEME_COLORS = ['brand', 'blue', 'green', 'red', 'cyan', 'purple', 'orange'] as const;\nexport type ThemeColor = (typeof THEME_COLORS)[number];\n\nexport const THEME_STYLES = ['flat', 'glass'] as const;\nexport type ThemeStyle = (typeof THEME_STYLES)[number];\n\nconst THEME_SCHEME_SET = new Set<ThemeScheme>(THEME_SCHEMES);\nconst THEME_COLOR_SET = new Set<ThemeColor>(THEME_COLORS);\nconst THEME_STYLE_SET = new Set<ThemeStyle>(THEME_STYLES);\n\nexport function isThemeScheme(value: unknown): value is ThemeScheme {\n return typeof value === 'string' && THEME_SCHEME_SET.has(value as ThemeScheme);\n}\n\nexport function isThemeColor(value: unknown): value is ThemeColor {\n return typeof value === 'string' && THEME_COLOR_SET.has(value as ThemeColor);\n}\n\nexport function isThemeStyle(value: unknown): value is ThemeStyle {\n return typeof value === 'string' && THEME_STYLE_SET.has(value as ThemeStyle);\n}\n\nexport interface ThemeColorOption {\n readonly value: ThemeColor;\n readonly label: string;\n}\n\nexport type ThemeColorLabels = Partial<Record<ThemeColor, string>>;\n\nexport interface NgThemeConfig {\n defaultScheme: ThemeScheme;\n defaultColor: ThemeColor;\n defaultStyle: ThemeStyle;\n colors?: readonly ThemeColor[];\n colorLabels?: ThemeColorLabels;\n}\n","import {\n DestroyRef,\n Injectable,\n PLATFORM_ID,\n computed,\n effect,\n inject,\n signal,\n} from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { LocalStorageStateAdapter } from '@ojiepermana/angular/internal';\nimport { NG_THEME_CONFIG } from './theme.token';\nimport {\n isThemeColor,\n isThemeScheme,\n isThemeStyle,\n NgThemeConfig,\n ThemeStyle,\n ThemeColor,\n ThemeColorLabels,\n ThemeColorOption,\n ThemeScheme,\n} from './theme.types';\n\nconst THEME_COLOR_OPTIONS: readonly ThemeColorOption[] = [\n { value: 'brand', label: 'Brand' },\n { value: 'blue', label: 'Blue' },\n { value: 'green', label: 'Green' },\n { value: 'red', label: 'Red' },\n { value: 'cyan', label: 'Cyan' },\n { value: 'purple', label: 'Purple' },\n { value: 'orange', label: 'Orange' },\n] as const;\n\nfunction createThemeColorOptions(\n allowedColors: readonly ThemeColor[] | undefined,\n colorLabels: ThemeColorLabels | undefined,\n): readonly ThemeColorOption[] {\n const allowedSet = allowedColors ? new Set(allowedColors) : null;\n\n return THEME_COLOR_OPTIONS.filter((option) => !allowedSet || allowedSet.has(option.value)).map(\n (option) => ({\n value: option.value,\n label: colorLabels?.[option.value] ?? option.label,\n }),\n );\n}\n\nconst STORAGE_KEYS = {\n scheme: 'theme-scheme',\n color: 'theme-color',\n style: 'theme-style',\n} as const;\n\ntype ThemeStorageAxis = keyof typeof STORAGE_KEYS;\n\nconst LEGACY_STORAGE_PREFIX = 'ng-theme:v2';\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly config = inject(NG_THEME_CONFIG);\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly storage = new LocalStorageStateAdapter<ThemeStorageAxis>({\n isBrowser: this.isBrowser,\n storage: this.document.defaultView?.localStorage ?? null,\n keys: STORAGE_KEYS,\n legacyPrefix: LEGACY_STORAGE_PREFIX,\n });\n private readonly mediaQuery = this.isBrowser\n ? typeof this.document.defaultView?.matchMedia === 'function'\n ? this.document.defaultView.matchMedia('(prefers-color-scheme: dark)')\n : null\n : null;\n private readonly systemPrefersDark = signal(this.mediaQuery?.matches ?? false);\n private readonly availableColorOptions = createThemeColorOptions(\n this.config.colors,\n this.config.colorLabels,\n );\n\n readonly scheme = signal<ThemeScheme>(\n this.storage.read('scheme', this.config.defaultScheme, isThemeScheme),\n );\n readonly color = signal<ThemeColor>(\n this.storage.read('color', this.config.defaultColor, isThemeColor),\n );\n readonly style = signal<ThemeStyle>(\n this.storage.read('style', this.config.defaultStyle, isThemeStyle),\n );\n readonly colorOptions = computed<readonly ThemeColorOption[]>(() => this.availableColorOptions);\n\n readonly resolvedScheme = computed<'light' | 'dark'>(() => {\n if (this.scheme() !== 'system') return this.scheme() as 'light' | 'dark';\n return this.systemPrefersDark() ? 'dark' : 'light';\n });\n\n constructor() {\n if (this.mediaQuery) {\n const syncSystemPreference = (event: MediaQueryListEvent): void => {\n this.systemPrefersDark.set(event.matches);\n };\n\n this.mediaQuery.addEventListener('change', syncSystemPreference);\n this.destroyRef.onDestroy(() => {\n this.mediaQuery?.removeEventListener('change', syncSystemPreference);\n });\n }\n\n effect(() => {\n if (this.isBrowser) {\n this.applyToDOM();\n }\n });\n }\n\n /**\n * Updates the selected theme scheme and persists the choice for future sessions.\n */\n setScheme(value: ThemeScheme): void {\n this.storage.persist('scheme', value);\n this.scheme.set(value);\n }\n\n /**\n * Updates the active theme color when it is part of the configured preset list.\n */\n setColor(value: ThemeColor): void {\n if (!this.colorOptions().some((option) => option.value === value)) {\n return;\n }\n\n this.storage.persist('color', value);\n this.color.set(value);\n }\n\n /**\n * Updates the active style preset and persists it to local storage.\n */\n setStyle(value: ThemeStyle): void {\n this.storage.persist('style', value);\n this.style.set(value);\n }\n\n /**\n * Cycles the scheme through light, dark, and system while keeping the DOM contract in sync.\n */\n toggleScheme(): void {\n const next: ThemeScheme =\n this.scheme() === 'light' ? 'dark' : this.scheme() === 'dark' ? 'system' : 'light';\n this.setScheme(next);\n }\n\n /**\n * Clears persisted theme state and restores the configured defaults for all theme axes.\n */\n reset(): void {\n this.storage.clear('scheme');\n this.storage.clear('color');\n this.storage.clear('style');\n this.scheme.set(this.config.defaultScheme);\n this.color.set(this.config.defaultColor);\n this.style.set(this.config.defaultStyle);\n }\n\n private applyToDOM(): void {\n const element = this.document.documentElement;\n\n element.classList.toggle('dark', this.resolvedScheme() === 'dark');\n element.dataset['themeScheme'] = this.scheme();\n element.dataset['themeColor'] = this.color();\n element.dataset['themeStyle'] = this.style();\n element.style.colorScheme = this.resolvedScheme();\n }\n}\n","import { EnvironmentProviders, isDevMode, makeEnvironmentProviders } from '@angular/core';\nimport { DEFAULT_NG_THEME_CONFIG, NG_THEME_CONFIG } from './theme.token';\nimport {\n isThemeColor,\n isThemeScheme,\n isThemeStyle,\n NgThemeConfig,\n ThemeColor,\n ThemeColorLabels,\n ThemeScheme,\n ThemeStyle,\n} from './theme.types';\n\nfunction warnInvalidThemeConfig(message: string): void {\n if (isDevMode()) {\n console.warn(`[provideNgTheme] ${message}`);\n }\n}\n\nfunction normalizeThemeScheme(value: unknown): ThemeScheme {\n if (typeof value === 'undefined' || isThemeScheme(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultScheme;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultScheme ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultScheme)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultScheme;\n}\n\nfunction normalizeThemeColor(value: unknown): ThemeColor {\n if (typeof value === 'undefined' || isThemeColor(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultColor;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultColor ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultColor)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultColor;\n}\n\nfunction normalizeThemeStyle(value: unknown): ThemeStyle {\n if (typeof value === 'undefined' || isThemeStyle(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultStyle;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultStyle ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultStyle)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultStyle;\n}\n\nfunction normalizeThemeColors(value: unknown): readonly ThemeColor[] | undefined {\n if (typeof value === 'undefined') {\n return undefined;\n }\n\n if (!Array.isArray(value)) {\n warnInvalidThemeConfig('Ignoring invalid colors config because it is not an array.');\n return undefined;\n }\n\n const normalizedColors = Array.from(new Set(value.filter(isThemeColor)));\n\n if (normalizedColors.length !== value.length) {\n warnInvalidThemeConfig('Ignoring unsupported values in colors config.');\n }\n\n return normalizedColors.length > 0 ? normalizedColors : undefined;\n}\n\nfunction normalizeThemeColorLabels(value: unknown): ThemeColorLabels | undefined {\n if (typeof value === 'undefined') {\n return undefined;\n }\n\n if (!value || Array.isArray(value) || typeof value !== 'object') {\n warnInvalidThemeConfig('Ignoring invalid colorLabels config because it is not an object map.');\n return undefined;\n }\n\n const entries = Object.entries(value);\n const normalizedEntries = entries.flatMap(([color, label]) => {\n if (isThemeColor(color) && typeof label === 'string' && label.trim().length > 0) {\n return [[color, label.trim()] as const];\n }\n\n return [];\n });\n\n if (normalizedEntries.length !== entries.length) {\n warnInvalidThemeConfig('Ignoring unsupported entries in colorLabels config.');\n }\n\n return normalizedEntries.length > 0\n ? (Object.fromEntries(normalizedEntries) as ThemeColorLabels)\n : undefined;\n}\n\nfunction normalizeThemeConfig(config: Partial<NgThemeConfig>): NgThemeConfig {\n const colors = normalizeThemeColors(config.colors);\n const colorLabels = normalizeThemeColorLabels(config.colorLabels);\n let defaultColor = normalizeThemeColor(config.defaultColor);\n\n if (colors && !colors.includes(defaultColor)) {\n warnInvalidThemeConfig(\n `Adjusting defaultColor ${JSON.stringify(defaultColor)} to ${JSON.stringify(colors[0])} so it stays within the configured colors list.`,\n );\n defaultColor = colors[0];\n }\n\n return {\n ...DEFAULT_NG_THEME_CONFIG,\n defaultScheme: normalizeThemeScheme(config.defaultScheme),\n defaultColor,\n defaultStyle: normalizeThemeStyle(config.defaultStyle),\n ...(colors ? { colors } : {}),\n ...(colorLabels ? { colorLabels } : {}),\n };\n}\n\nexport function provideNgTheme(config: Partial<NgThemeConfig> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: NG_THEME_CONFIG, useValue: normalizeThemeConfig(config) },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAGO,MAAM,uBAAuB,GAAkB;AACpD,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,YAAY,EAAE,MAAM;CACrB;MAEY,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,EAAE,CAAC;AAChD,CAAA;;ACZM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU;AAG1D,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU;AAG3F,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;AAGtD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAc,aAAa,CAAC;AAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAa,YAAY,CAAC;AACzD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAa,YAAY,CAAC;AAEnD,SAAU,aAAa,CAAC,KAAc,EAAA;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,KAAoB,CAAC;AAChF;AAEM,SAAU,YAAY,CAAC,KAAc,EAAA;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,KAAmB,CAAC;AAC9E;AAEM,SAAU,YAAY,CAAC,KAAc,EAAA;IACzC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,CAAC;IACjE,IAAI,YAAY,GAAG,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;IAE3D,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;QAC5C,sBAAsB,CACpB,0BAA0B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA,IAAA,EAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA,+CAAA,CAAiD,CACxI;AACD,QAAA,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC;IAC1B;IAEA,OAAO;AACL,QAAA,GAAG,uBAAuB;AAC1B,QAAA,aAAa,EAAE,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC;QACzD,YAAY;AACZ,QAAA,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;AACtD,QAAA,IAAI,MAAM,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAC7B,QAAA,IAAI,WAAW,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;KACxC;AACH;AAEM,SAAU,cAAc,CAAC,MAAA,GAAiC,EAAE,EAAA;AAChE,IAAA,OAAO,wBAAwB,CAAC;QAC9B,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAAE;AACrE,KAAA,CAAC;AACJ;;AChIA;;AAEG;;;;"}
1
+ {"version":3,"file":"ojiepermana-angular-theme-service.mjs","sources":["../../../projects/library/theme/service/src/theme.token.ts","../../../projects/library/theme/service/src/theme.types.ts","../../../projects/library/theme/service/src/theme.service.ts","../../../projects/library/theme/service/src/theme.provider.ts","../../../projects/library/theme/service/ojiepermana-angular-theme-service.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { NgThemeConfig } from './theme.types';\n\nexport const DEFAULT_NG_THEME_CONFIG: NgThemeConfig = {\n defaultScheme: 'system',\n defaultColor: 'brand',\n defaultStyle: 'flat',\n};\n\nexport const NG_THEME_CONFIG = new InjectionToken<NgThemeConfig>('NG_THEME_CONFIG', {\n providedIn: 'root',\n factory: () => ({ ...DEFAULT_NG_THEME_CONFIG }),\n});\n","export const THEME_SCHEMES = ['light', 'dark', 'system'] as const;\nexport type ThemeScheme = (typeof THEME_SCHEMES)[number];\n\nexport const THEME_COLORS = ['brand', 'blue', 'green', 'red', 'cyan', 'purple', 'orange'] as const;\nexport type ThemeColor = (typeof THEME_COLORS)[number];\n\nexport const THEME_STYLES = ['flat', 'glass'] as const;\nexport type ThemeStyle = (typeof THEME_STYLES)[number];\n\nconst THEME_SCHEME_SET = new Set<ThemeScheme>(THEME_SCHEMES);\nconst THEME_COLOR_SET = new Set<ThemeColor>(THEME_COLORS);\nconst THEME_STYLE_SET = new Set<ThemeStyle>(THEME_STYLES);\n\nexport function isThemeScheme(value: unknown): value is ThemeScheme {\n return typeof value === 'string' && THEME_SCHEME_SET.has(value as ThemeScheme);\n}\n\nexport function isThemeColor(value: unknown): value is ThemeColor {\n return typeof value === 'string' && THEME_COLOR_SET.has(value as ThemeColor);\n}\n\nexport function isThemeStyle(value: unknown): value is ThemeStyle {\n return typeof value === 'string' && THEME_STYLE_SET.has(value as ThemeStyle);\n}\n\nexport interface ThemeColorOption {\n readonly value: ThemeColor;\n readonly label: string;\n}\n\nexport type ThemeColorLabels = Partial<Record<ThemeColor, string>>;\n\nexport interface NgThemeConfig {\n defaultScheme: ThemeScheme;\n defaultColor: ThemeColor;\n defaultStyle: ThemeStyle;\n colors?: readonly ThemeColor[];\n colorLabels?: ThemeColorLabels;\n}\n","import { DestroyRef, Injectable, PLATFORM_ID, computed, effect, inject, signal } from '@angular/core';\nimport { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { LocalStorageStateAdapter } from '@ojiepermana/angular/internal';\nimport { NG_THEME_CONFIG } from './theme.token';\nimport {\n isThemeColor,\n isThemeScheme,\n isThemeStyle,\n NgThemeConfig,\n ThemeStyle,\n ThemeColor,\n ThemeColorLabels,\n ThemeColorOption,\n ThemeScheme,\n} from './theme.types';\n\nconst THEME_COLOR_OPTIONS: readonly ThemeColorOption[] = [\n { value: 'brand', label: 'Brand' },\n { value: 'blue', label: 'Blue' },\n { value: 'green', label: 'Green' },\n { value: 'red', label: 'Red' },\n { value: 'cyan', label: 'Cyan' },\n { value: 'purple', label: 'Purple' },\n { value: 'orange', label: 'Orange' },\n] as const;\n\nfunction createThemeColorOptions(\n allowedColors: readonly ThemeColor[] | undefined,\n colorLabels: ThemeColorLabels | undefined,\n): readonly ThemeColorOption[] {\n const allowedSet = allowedColors ? new Set(allowedColors) : null;\n\n return THEME_COLOR_OPTIONS.filter((option) => !allowedSet || allowedSet.has(option.value)).map((option) => ({\n value: option.value,\n label: colorLabels?.[option.value] ?? option.label,\n }));\n}\n\nconst STORAGE_KEYS = {\n scheme: 'theme-scheme',\n color: 'theme-color',\n style: 'theme-style',\n} as const;\n\ntype ThemeStorageAxis = keyof typeof STORAGE_KEYS;\n\nconst LEGACY_STORAGE_PREFIX = 'ng-theme:v2';\n\n@Injectable({ providedIn: 'root' })\nexport class ThemeService {\n private readonly config = inject(NG_THEME_CONFIG);\n private readonly document = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\n private readonly storage = new LocalStorageStateAdapter<ThemeStorageAxis>({\n isBrowser: this.isBrowser,\n storage: this.document.defaultView?.localStorage ?? null,\n keys: STORAGE_KEYS,\n legacyPrefix: LEGACY_STORAGE_PREFIX,\n });\n private readonly mediaQuery = this.isBrowser\n ? typeof this.document.defaultView?.matchMedia === 'function'\n ? this.document.defaultView.matchMedia('(prefers-color-scheme: dark)')\n : null\n : null;\n private readonly systemPrefersDark = signal(this.mediaQuery?.matches ?? false);\n private readonly availableColorOptions = createThemeColorOptions(this.config.colors, this.config.colorLabels);\n\n readonly scheme = signal<ThemeScheme>(this.storage.read('scheme', this.config.defaultScheme, isThemeScheme));\n readonly color = signal<ThemeColor>(this.storage.read('color', this.config.defaultColor, isThemeColor));\n readonly style = signal<ThemeStyle>(this.storage.read('style', this.config.defaultStyle, isThemeStyle));\n readonly colorOptions = computed<readonly ThemeColorOption[]>(() => this.availableColorOptions);\n\n readonly resolvedScheme = computed<'light' | 'dark'>(() => {\n if (this.scheme() !== 'system') return this.scheme() as 'light' | 'dark';\n return this.systemPrefersDark() ? 'dark' : 'light';\n });\n\n constructor() {\n if (this.mediaQuery) {\n const syncSystemPreference = (event: MediaQueryListEvent): void => {\n this.systemPrefersDark.set(event.matches);\n };\n\n this.mediaQuery.addEventListener('change', syncSystemPreference);\n this.destroyRef.onDestroy(() => {\n this.mediaQuery?.removeEventListener('change', syncSystemPreference);\n });\n }\n\n effect(() => {\n if (this.isBrowser) {\n this.applyToDOM();\n }\n });\n }\n\n /**\n * Updates the selected theme scheme and persists the choice for future sessions.\n */\n setScheme(value: ThemeScheme): void {\n this.storage.persist('scheme', value);\n this.scheme.set(value);\n }\n\n /**\n * Updates the active theme color when it is part of the configured preset list.\n */\n setColor(value: ThemeColor): void {\n if (!this.colorOptions().some((option) => option.value === value)) {\n return;\n }\n\n this.storage.persist('color', value);\n this.color.set(value);\n }\n\n /**\n * Updates the active style preset and persists it to local storage.\n */\n setStyle(value: ThemeStyle): void {\n this.storage.persist('style', value);\n this.style.set(value);\n }\n\n /**\n * Cycles the scheme through light, dark, and system while keeping the DOM contract in sync.\n */\n toggleScheme(): void {\n const next: ThemeScheme = this.scheme() === 'light' ? 'dark' : this.scheme() === 'dark' ? 'system' : 'light';\n this.setScheme(next);\n }\n\n /**\n * Clears persisted theme state and restores the configured defaults for all theme axes.\n */\n reset(): void {\n this.storage.clear('scheme');\n this.storage.clear('color');\n this.storage.clear('style');\n this.scheme.set(this.config.defaultScheme);\n this.color.set(this.config.defaultColor);\n this.style.set(this.config.defaultStyle);\n }\n\n private applyToDOM(): void {\n const element = this.document.documentElement;\n\n element.classList.toggle('dark', this.resolvedScheme() === 'dark');\n element.dataset['themeScheme'] = this.scheme();\n element.dataset['themeColor'] = this.color();\n element.dataset['themeStyle'] = this.style();\n element.style.colorScheme = this.resolvedScheme();\n }\n}\n","import { EnvironmentProviders, isDevMode, makeEnvironmentProviders } from '@angular/core';\nimport { DEFAULT_NG_THEME_CONFIG, NG_THEME_CONFIG } from './theme.token';\nimport {\n isThemeColor,\n isThemeScheme,\n isThemeStyle,\n NgThemeConfig,\n ThemeColor,\n ThemeColorLabels,\n ThemeScheme,\n ThemeStyle,\n} from './theme.types';\n\nfunction warnInvalidThemeConfig(message: string): void {\n if (isDevMode()) {\n console.warn(`[provideNgTheme] ${message}`);\n }\n}\n\nfunction normalizeThemeScheme(value: unknown): ThemeScheme {\n if (typeof value === 'undefined' || isThemeScheme(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultScheme;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultScheme ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultScheme)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultScheme;\n}\n\nfunction normalizeThemeColor(value: unknown): ThemeColor {\n if (typeof value === 'undefined' || isThemeColor(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultColor;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultColor ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultColor)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultColor;\n}\n\nfunction normalizeThemeStyle(value: unknown): ThemeStyle {\n if (typeof value === 'undefined' || isThemeStyle(value)) {\n return value ?? DEFAULT_NG_THEME_CONFIG.defaultStyle;\n }\n\n warnInvalidThemeConfig(\n `Ignoring invalid defaultStyle ${JSON.stringify(value)}. Falling back to ${JSON.stringify(DEFAULT_NG_THEME_CONFIG.defaultStyle)}.`,\n );\n\n return DEFAULT_NG_THEME_CONFIG.defaultStyle;\n}\n\nfunction normalizeThemeColors(value: unknown): readonly ThemeColor[] | undefined {\n if (typeof value === 'undefined') {\n return undefined;\n }\n\n if (!Array.isArray(value)) {\n warnInvalidThemeConfig('Ignoring invalid colors config because it is not an array.');\n return undefined;\n }\n\n const normalizedColors = Array.from(new Set(value.filter(isThemeColor)));\n\n if (normalizedColors.length !== value.length) {\n warnInvalidThemeConfig('Ignoring unsupported values in colors config.');\n }\n\n return normalizedColors.length > 0 ? normalizedColors : undefined;\n}\n\nfunction normalizeThemeColorLabels(value: unknown): ThemeColorLabels | undefined {\n if (typeof value === 'undefined') {\n return undefined;\n }\n\n if (!value || Array.isArray(value) || typeof value !== 'object') {\n warnInvalidThemeConfig('Ignoring invalid colorLabels config because it is not an object map.');\n return undefined;\n }\n\n const entries = Object.entries(value);\n const normalizedEntries = entries.flatMap(([color, label]) => {\n if (isThemeColor(color) && typeof label === 'string' && label.trim().length > 0) {\n return [[color, label.trim()] as const];\n }\n\n return [];\n });\n\n if (normalizedEntries.length !== entries.length) {\n warnInvalidThemeConfig('Ignoring unsupported entries in colorLabels config.');\n }\n\n return normalizedEntries.length > 0 ? (Object.fromEntries(normalizedEntries) as ThemeColorLabels) : undefined;\n}\n\nfunction normalizeThemeConfig(config: Partial<NgThemeConfig>): NgThemeConfig {\n const colors = normalizeThemeColors(config.colors);\n const colorLabels = normalizeThemeColorLabels(config.colorLabels);\n let defaultColor = normalizeThemeColor(config.defaultColor);\n\n if (colors && !colors.includes(defaultColor)) {\n warnInvalidThemeConfig(\n `Adjusting defaultColor ${JSON.stringify(defaultColor)} to ${JSON.stringify(colors[0])} so it stays within the configured colors list.`,\n );\n defaultColor = colors[0];\n }\n\n return {\n ...DEFAULT_NG_THEME_CONFIG,\n defaultScheme: normalizeThemeScheme(config.defaultScheme),\n defaultColor,\n defaultStyle: normalizeThemeStyle(config.defaultStyle),\n ...(colors ? { colors } : {}),\n ...(colorLabels ? { colorLabels } : {}),\n };\n}\n\nexport function provideNgTheme(config: Partial<NgThemeConfig> = {}): EnvironmentProviders {\n return makeEnvironmentProviders([{ provide: NG_THEME_CONFIG, useValue: normalizeThemeConfig(config) }]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAGO,MAAM,uBAAuB,GAAkB;AACpD,IAAA,aAAa,EAAE,QAAQ;AACvB,IAAA,YAAY,EAAE,OAAO;AACrB,IAAA,YAAY,EAAE,MAAM;CACrB;MAEY,eAAe,GAAG,IAAI,cAAc,CAAgB,iBAAiB,EAAE;AAClF,IAAA,UAAU,EAAE,MAAM;IAClB,OAAO,EAAE,OAAO,EAAE,GAAG,uBAAuB,EAAE,CAAC;AAChD,CAAA;;ACZM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU;AAG1D,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAU;AAG3F,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU;AAGtD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAc,aAAa,CAAC;AAC5D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAa,YAAY,CAAC;AACzD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAa,YAAY,CAAC;AAEnD,SAAU,aAAa,CAAC,KAAc,EAAA;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,gBAAgB,CAAC,GAAG,CAAC,KAAoB,CAAC;AAChF;AAEM,SAAU,YAAY,CAAC,KAAc,EAAA;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,KAAmB,CAAC;AAC9E;AAEM,SAAU,YAAY,CAAC,KAAc,EAAA;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,KAAmB,CAAC;AAC9E;;ACPA,MAAM,mB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MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;QAC5C,sBAAsB,CACpB,0BAA0B,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA,IAAA,EAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA,+CAAA,CAAiD,CACxI;AACD,QAAA,YAAY,GAAG,MAAM,CAAC,CAAC,CAAC;IAC1B;IAEA,OAAO;AACL,QAAA,GAAG,uBAAuB;AAC1B,QAAA,aAAa,EAAE,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC;QACzD,YAAY;AACZ,QAAA,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,YAAY,CAAC;AACtD,QAAA,IAAI,MAAM,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAC7B,QAAA,IAAI,WAAW,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC;KACxC;AACH;AAEM,SAAU,cAAc,CAAC,MAAA,GAAiC,EAAE,EAAA;AAChE,IAAA,OAAO,wBAAwB,CAAC,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACzG;;AC5HA;;AAEG;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ojiepermana-angular.mjs","sources":["../../../projects/library/public-api.ts","../../../projects/library/ojiepermana-angular.ts"],"sourcesContent":["/* Public API Surface of @ojiepermana/angular */\n\nexport {};","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;ACAA;;AAEG"}
1
+ {"version":3,"file":"ojiepermana-angular.mjs","sources":["../../../projects/library/public-api.ts","../../../projects/library/ojiepermana-angular.ts"],"sourcesContent":["/* Public API Surface of @ojiepermana/angular */\n\nexport {};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;ACAA;;AAEG"}
package/layout/README.md CHANGED
@@ -65,10 +65,10 @@ Persistence keys are fixed by the runtime. Deprecated config fields such as `sto
65
65
 
66
66
  ## Styles
67
67
 
68
- The layout stylesheet source is `projects/library/layout/styles/index.css` inside this workspace.
68
+ The layout-wide stylesheet source is `projects/library/layout/src/layout.css` inside this workspace.
69
69
 
70
- It owns the `data-layout-*` selectors and imports the mode-scoped shell styles.
71
- Layout-wide axis selectors such as `data-layout-container` and `data-layout-mode='empty'` stay in `projects/library/layout/styles/index.css`, while the flat shell rules now live in `projects/library/layout/styles/horizontal/flat.css` and `projects/library/layout/styles/vertical/flat.css`.
70
+ It owns the `data-layout-*` selectors that are global to the runtime.
71
+ The horizontal shell rules now live beside `src/component/horizontal/horizontal.ts`, and the vertical shell rules live beside `src/component/vertical/vertical.ts` through component-level CSS metadata.
72
72
 
73
73
  Layout styles consume theme tokens. For application usage, prefer the aggregate stylesheet entry at `projects/library/styles/index.css` in this workspace or `@ojiepermana/angular/styles/index.css` from the published package.
74
74
  The shared bundle now includes reduced-motion-aware transitions for shell chrome colors, shadows, and radii while keeping structural mode changes immediate to avoid layout jank.
@@ -1,11 +1,11 @@
1
- horizontal[data-layout-mode='horizontal'] {
1
+ :host {
2
2
  display: block;
3
3
  block-size: 100dvh;
4
4
  min-block-size: 100dvh;
5
5
  overflow: hidden;
6
6
  }
7
7
 
8
- horizontal[data-layout-mode='horizontal'] > layout {
8
+ :host > layout {
9
9
  display: block;
10
10
  block-size: 100dvh;
11
11
  min-block-size: 100dvh;
@@ -16,7 +16,7 @@ horizontal[data-layout-mode='horizontal'] > layout {
16
16
  transition: var(--ngt-chrome-transition);
17
17
  }
18
18
 
19
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) {
19
+ :host > layout > :is(content, shell-content) {
20
20
  display: flex;
21
21
  flex-direction: column;
22
22
  inline-size: min(100%, var(--layout-shell-max-width));
@@ -34,8 +34,9 @@ horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content)
34
34
  transition: var(--ngt-shell-transition);
35
35
  }
36
36
 
37
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header {
37
+ :host > layout > :is(content, shell-content) > header {
38
38
  display: var(--layout-header-display);
39
+ grid-template-areas: 'brand navigation action';
39
40
  grid-template-columns: auto minmax(0, 1fr) auto;
40
41
  align-items: center;
41
42
  gap: 1rem;
@@ -47,43 +48,53 @@ horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content)
47
48
  transition: var(--ngt-chrome-transition);
48
49
  }
49
50
 
50
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > brand,
51
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > panel {
51
+ :host > layout > :is(content, shell-content) > header > brand,
52
+ :host > layout > :is(content, shell-content) > header > action {
52
53
  display: flex;
53
54
  min-inline-size: 0;
54
55
  align-items: center;
55
56
  }
56
57
 
57
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > brand {
58
+ :host > layout > :is(content, shell-content) > header > brand {
59
+ grid-area: brand;
58
60
  justify-content: flex-start;
61
+ justify-self: start;
59
62
  }
60
63
 
61
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > nav {
64
+ :host > layout > :is(content, shell-content) > header > navigation {
65
+ grid-area: navigation;
62
66
  display: flex;
67
+ inline-size: 100%;
63
68
  min-inline-size: 0;
64
69
  align-items: center;
70
+ justify-self: stretch;
65
71
  justify-content: center;
66
72
  gap: 0.75rem;
67
73
  flex-wrap: wrap;
68
74
  }
69
75
 
70
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > panel {
76
+ :host > layout > :is(content, shell-content) > header > navigation > .layout-horizontal-navigation-slot {
77
+ flex: 0 1 auto;
78
+ display: block;
79
+ min-inline-size: 0;
80
+ max-inline-size: 100%;
81
+ }
82
+
83
+ :host > layout > :is(content, shell-content) > header > action {
84
+ grid-area: action;
71
85
  justify-content: flex-end;
86
+ justify-self: end;
72
87
  gap: 0.5rem;
73
88
  }
74
89
 
75
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > main {
90
+ :host > layout > :is(content, shell-content) > main {
76
91
  flex: 1 1 auto;
77
92
  block-size: 100%;
78
93
  min-inline-size: 0;
79
94
  min-block-size: 0;
80
95
  overflow: auto;
81
96
  background-color: var(--background);
82
- background-image: linear-gradient(
83
- 180deg,
84
- color-mix(in oklab, var(--background) 94%, white 6%),
85
- var(--background)
86
- );
97
+ background-image: linear-gradient(180deg, color-mix(in oklab, var(--background) 94%, white 6%), var(--background));
87
98
  color: var(--foreground);
88
99
  transition:
89
100
  background-color var(--ngt-motion-duration-medium) var(--ngt-motion-ease-standard),
@@ -91,27 +102,29 @@ horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content)
91
102
  }
92
103
 
93
104
  @media (max-width: 60rem) {
94
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header {
105
+ :host > layout > :is(content, shell-content) > header {
106
+ grid-template-areas:
107
+ 'brand action'
108
+ 'navigation navigation';
95
109
  grid-template-columns: minmax(0, 1fr) auto;
96
110
  align-items: flex-start;
97
111
  }
98
112
 
99
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header > nav {
100
- grid-column: 1 / -1;
101
- justify-content: flex-start;
113
+ :host > layout > :is(content, shell-content) > header > navigation {
114
+ justify-content: center;
102
115
  }
103
116
  }
104
117
 
105
118
  @media (max-width: 40rem) {
106
- horizontal[data-layout-mode='horizontal'] > layout > :is(content, shell-content) > header {
119
+ :host > layout > :is(content, shell-content) > header {
120
+ grid-template-areas:
121
+ 'brand'
122
+ 'navigation'
123
+ 'action';
107
124
  grid-template-columns: 1fr;
108
125
  }
109
126
 
110
- horizontal[data-layout-mode='horizontal']
111
- > layout
112
- > :is(content, shell-content)
113
- > header
114
- > panel {
115
- justify-content: flex-start;
127
+ :host > layout > :is(content, shell-content) > header > action {
128
+ justify-content: flex-end;
116
129
  }
117
130
  }
@@ -1,11 +1,11 @@
1
- vertical[data-layout-mode='vertical'] {
1
+ :host {
2
2
  display: block;
3
3
  block-size: 100dvh;
4
4
  min-block-size: 100dvh;
5
5
  overflow: hidden;
6
6
  }
7
7
 
8
- vertical[data-layout-mode='vertical'] > layout {
8
+ :host > layout {
9
9
  display: block;
10
10
  block-size: 100dvh;
11
11
  min-block-size: 100dvh;
@@ -16,7 +16,7 @@ vertical[data-layout-mode='vertical'] > layout {
16
16
  transition: var(--ngt-chrome-transition);
17
17
  }
18
18
 
19
- vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) {
19
+ :host > layout > :is(content, shell-content) {
20
20
  display: flex;
21
21
  flex-direction: column;
22
22
  inline-size: min(100%, var(--layout-shell-max-width));
@@ -34,7 +34,7 @@ vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) {
34
34
  transition: var(--ngt-shell-transition);
35
35
  }
36
36
 
37
- vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) > aside {
37
+ :host > layout > :is(content, shell-content) > aside {
38
38
  display: var(--layout-sidebar-display);
39
39
  flex-direction: column;
40
40
  inline-size: 100%;
@@ -46,18 +46,14 @@ vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) > a
46
46
  transition: var(--ngt-chrome-transition);
47
47
  }
48
48
 
49
- vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) > main {
49
+ :host > layout > :is(content, shell-content) > main {
50
50
  flex: 1 1 auto;
51
51
  block-size: 100%;
52
52
  min-inline-size: 0;
53
53
  min-block-size: 0;
54
54
  overflow: auto;
55
55
  background-color: var(--background);
56
- background-image: linear-gradient(
57
- 180deg,
58
- color-mix(in oklab, var(--background) 94%, white 6%),
59
- var(--background)
60
- );
56
+ background-image: linear-gradient(180deg, color-mix(in oklab, var(--background) 94%, white 6%), var(--background));
61
57
  color: var(--foreground);
62
58
  transition:
63
59
  background-color var(--ngt-motion-duration-medium) var(--ngt-motion-ease-standard),
@@ -65,12 +61,14 @@ vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) > m
65
61
  }
66
62
 
67
63
  @media (min-width: 48rem) {
68
- vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) {
64
+ :host > layout > :is(content, shell-content) {
69
65
  flex-direction: row;
70
66
  }
71
67
 
72
- vertical[data-layout-mode='vertical'] > layout > :is(content, shell-content) > aside {
68
+ :host > layout > :is(content, shell-content) > aside {
69
+ flex: 0 0 var(--layout-sidebar-width);
73
70
  inline-size: var(--layout-sidebar-width);
71
+ min-inline-size: var(--layout-sidebar-width);
74
72
  border-bottom: 0;
75
73
  border-right: 1px solid var(--sidebar-chrome-border);
76
74
  }
@@ -1,6 +1,3 @@
1
- @import './horizontal.css';
2
- @import './vertical.css';
3
-
4
1
  [data-layout-container='full'] {
5
2
  --layout-shell-max-width: 100%;
6
3
  --layout-shell-padding: 0rem;