@rblabs-dev/axiom 1.2.1 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -13
- package/app-shell/package.json +4 -0
- package/brand-lockup/package.json +4 -0
- package/central-sign-in/package.json +4 -0
- package/cli/build-brand-assets.mjs +12 -18
- package/cli/project.mjs +6 -0
- package/cli/verify-production-assets.mjs +71 -6
- package/confirm-dialog/package.json +4 -0
- package/core/package.json +4 -0
- package/empty-state/package.json +4 -0
- package/fesm2022/rblabs-dev-axiom-app-shell.mjs +375 -0
- package/fesm2022/rblabs-dev-axiom-app-shell.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-brand-lockup.mjs +154 -0
- package/fesm2022/rblabs-dev-axiom-brand-lockup.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-central-sign-in.mjs +375 -0
- package/fesm2022/rblabs-dev-axiom-central-sign-in.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-confirm-dialog.mjs +329 -0
- package/fesm2022/rblabs-dev-axiom-confirm-dialog.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-core.mjs +181 -0
- package/fesm2022/rblabs-dev-axiom-core.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-empty-state.mjs +252 -0
- package/fesm2022/rblabs-dev-axiom-empty-state.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-message.mjs +194 -0
- package/fesm2022/rblabs-dev-axiom-message.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-monogram.mjs +102 -0
- package/fesm2022/rblabs-dev-axiom-monogram.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-page-header.mjs +199 -0
- package/fesm2022/rblabs-dev-axiom-page-header.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-panel.mjs +207 -0
- package/fesm2022/rblabs-dev-axiom-panel.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-public-shell.mjs +165 -0
- package/fesm2022/rblabs-dev-axiom-public-shell.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-shell-footer.mjs +73 -0
- package/fesm2022/rblabs-dev-axiom-shell-footer.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-status-chip.mjs +161 -0
- package/fesm2022/rblabs-dev-axiom-status-chip.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-technical-value.mjs +173 -0
- package/fesm2022/rblabs-dev-axiom-technical-value.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom-theme-toggle.mjs +117 -0
- package/fesm2022/rblabs-dev-axiom-theme-toggle.mjs.map +1 -0
- package/fesm2022/rblabs-dev-axiom.mjs +15 -2955
- package/fonts/LICENSE +93 -0
- package/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/message/package.json +4 -0
- package/monogram/package.json +4 -0
- package/package.json +77 -2
- package/page-header/package.json +4 -0
- package/panel/package.json +4 -0
- package/public-shell/package.json +4 -0
- package/shell-footer/package.json +4 -0
- package/status-chip/package.json +4 -0
- package/styles/_fonts.scss +7 -7
- package/styles/_index.scss +1 -1
- package/technical-value/package.json +4 -0
- package/theme-toggle/package.json +4 -0
- package/types/rblabs-dev-axiom-app-shell.d.ts +50 -0
- package/types/rblabs-dev-axiom-brand-lockup.d.ts +35 -0
- package/types/rblabs-dev-axiom-central-sign-in.d.ts +82 -0
- package/types/rblabs-dev-axiom-confirm-dialog.d.ts +76 -0
- package/types/rblabs-dev-axiom-core.d.ts +116 -0
- package/types/rblabs-dev-axiom-empty-state.d.ts +55 -0
- package/types/rblabs-dev-axiom-message.d.ts +48 -0
- package/types/rblabs-dev-axiom-monogram.d.ts +12 -0
- package/types/rblabs-dev-axiom-page-header.d.ts +44 -0
- package/types/rblabs-dev-axiom-panel.d.ts +44 -0
- package/types/rblabs-dev-axiom-public-shell.d.ts +28 -0
- package/types/rblabs-dev-axiom-shell-footer.d.ts +17 -0
- package/types/rblabs-dev-axiom-status-chip.d.ts +40 -0
- package/types/rblabs-dev-axiom-technical-value.d.ts +35 -0
- package/types/rblabs-dev-axiom-theme-toggle.d.ts +12 -0
- package/types/rblabs-dev-axiom.d.ts +15 -675
- package/fesm2022/rblabs-dev-axiom.mjs.map +0 -1
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from "@angular/core";
|
|
3
|
+
var RbShellFooterComponent = class RbShellFooterComponent {
|
|
4
|
+
appName = input.required(...ngDevMode ? [{ debugName: "appName" }] : /* istanbul ignore next */ []);
|
|
5
|
+
year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
7
|
+
minVersion: "12.0.0",
|
|
8
|
+
version: "22.2.3",
|
|
9
|
+
ngImport: i0,
|
|
10
|
+
type: RbShellFooterComponent,
|
|
11
|
+
deps: [],
|
|
12
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
13
|
+
});
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
15
|
+
minVersion: "17.1.0",
|
|
16
|
+
version: "22.2.3",
|
|
17
|
+
type: RbShellFooterComponent,
|
|
18
|
+
isStandalone: true,
|
|
19
|
+
selector: "rb-shell-footer",
|
|
20
|
+
inputs: { appName: {
|
|
21
|
+
classPropertyName: "appName",
|
|
22
|
+
publicName: "appName",
|
|
23
|
+
isSignal: true,
|
|
24
|
+
isRequired: true,
|
|
25
|
+
transformFunction: null
|
|
26
|
+
} },
|
|
27
|
+
host: { classAttribute: "rb-shell-footer" },
|
|
28
|
+
ngImport: i0,
|
|
29
|
+
template: `
|
|
30
|
+
<footer class="rb-shell-footer__inner">
|
|
31
|
+
<p class="rb-shell-footer__copy">© {{ year }} RB Labs · {{ appName() }}</p>
|
|
32
|
+
<div class="rb-shell-footer__extra"><ng-content /></div>
|
|
33
|
+
</footer>
|
|
34
|
+
`,
|
|
35
|
+
isInline: true,
|
|
36
|
+
styles: ["@charset \"UTF-8\";rb-shell-footer{display:block;border-block-start:1px solid var(--rb-color-border);color:var(--rb-color-text-subtle);font:var(--rb-type-body-small)}rb-shell-footer .rb-shell-footer__inner{display:flex;flex-wrap:wrap;gap:var(--rb-space-1) var(--rb-space-2);align-items:center;inline-size:min(100%,var(--rb-size-content-max));margin-inline:auto;padding:var(--rb-space-4) var(--rb-space-page)}rb-shell-footer .rb-shell-footer__copy{margin:0}rb-shell-footer .rb-shell-footer__extra{display:inline-flex;flex-wrap:wrap;gap:var(--rb-space-1) var(--rb-space-3);align-items:center}rb-shell-footer .rb-shell-footer__extra:before{content:\"\\b7\"/\"\"}rb-shell-footer .rb-shell-footer__extra:empty{display:none}rb-shell-footer .rb-shell-footer__extra a{color:inherit;text-decoration:underline;text-underline-offset:.2em}rb-shell-footer .rb-shell-footer__extra a:hover{color:var(--rb-color-text-strong)}\n"],
|
|
37
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
38
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
42
|
+
minVersion: "12.0.0",
|
|
43
|
+
version: "22.2.3",
|
|
44
|
+
ngImport: i0,
|
|
45
|
+
type: RbShellFooterComponent,
|
|
46
|
+
decorators: [{
|
|
47
|
+
type: Component,
|
|
48
|
+
args: [{
|
|
49
|
+
selector: "rb-shell-footer",
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
encapsulation: ViewEncapsulation.None,
|
|
52
|
+
host: { class: "rb-shell-footer" },
|
|
53
|
+
template: `
|
|
54
|
+
<footer class="rb-shell-footer__inner">
|
|
55
|
+
<p class="rb-shell-footer__copy">© {{ year }} RB Labs · {{ appName() }}</p>
|
|
56
|
+
<div class="rb-shell-footer__extra"><ng-content /></div>
|
|
57
|
+
</footer>
|
|
58
|
+
`,
|
|
59
|
+
styles: ["@charset \"UTF-8\";rb-shell-footer{display:block;border-block-start:1px solid var(--rb-color-border);color:var(--rb-color-text-subtle);font:var(--rb-type-body-small)}rb-shell-footer .rb-shell-footer__inner{display:flex;flex-wrap:wrap;gap:var(--rb-space-1) var(--rb-space-2);align-items:center;inline-size:min(100%,var(--rb-size-content-max));margin-inline:auto;padding:var(--rb-space-4) var(--rb-space-page)}rb-shell-footer .rb-shell-footer__copy{margin:0}rb-shell-footer .rb-shell-footer__extra{display:inline-flex;flex-wrap:wrap;gap:var(--rb-space-1) var(--rb-space-3);align-items:center}rb-shell-footer .rb-shell-footer__extra:before{content:\"\\b7\"/\"\"}rb-shell-footer .rb-shell-footer__extra:empty{display:none}rb-shell-footer .rb-shell-footer__extra a{color:inherit;text-decoration:underline;text-underline-offset:.2em}rb-shell-footer .rb-shell-footer__extra a:hover{color:var(--rb-color-text-strong)}\n"]
|
|
60
|
+
}]
|
|
61
|
+
}],
|
|
62
|
+
propDecorators: { appName: [{
|
|
63
|
+
type: i0.Input,
|
|
64
|
+
args: [{
|
|
65
|
+
isSignal: true,
|
|
66
|
+
alias: "appName",
|
|
67
|
+
required: true
|
|
68
|
+
}]
|
|
69
|
+
}] }
|
|
70
|
+
});
|
|
71
|
+
export { RbShellFooterComponent };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=rblabs-dev-axiom-shell-footer.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rblabs-dev-axiom-shell-footer.mjs","names":[],"sources":["../../../projects/axiom/shell-footer/src/shell-footer.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ViewEncapsulation, input } from '@angular/core';\n\n/**\n * The standard footer of every shell (docs/design-system.md, section 12.5): \"© <year> RB Labs ·\n * <App name>\", followed on the same line by any projected links or status.\n */\n@Component({\n selector: 'rb-shell-footer',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: { class: 'rb-shell-footer' },\n template: `\n <footer class=\"rb-shell-footer__inner\">\n <p class=\"rb-shell-footer__copy\">© {{ year }} RB Labs · {{ appName() }}</p>\n <div class=\"rb-shell-footer__extra\"><ng-content /></div>\n </footer>\n `,\n styleUrl: './shell-footer.scss',\n})\nexport class RbShellFooterComponent {\n readonly appName = input.required<string>();\n\n protected readonly year = new Date().getFullYear();\n}\n"],"mappings":";;AAmBA,IAAa,yBAAb,MAAa,uBAAsB;CACxB,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAExB,wBAAO,IAAI,KAAI,EAAE,CAAC,YAAW;CAHrC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,SAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA,EAAA,gBAAA,kBAAA;EAAA,UAAA;EAAA,UARvB;;;;;;EAKT,UAAA;EAAA,QAAA,CAAA,i5BAAA;EAAA,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAGU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAblC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,iBACV,wBAAwB;GAAM,eAChC,kBAAkB;GAAI,MAC/B,EAAE,OAAO,kBAAiB;GAAE,UACxB;;;;;;GAKT,QAAA,CAAA,i5BAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input } from "@angular/core";
|
|
3
|
+
import { MatIcon } from "@angular/material/icon";
|
|
4
|
+
import { RB_TONE_ICONS } from "@rblabs-dev/axiom/core";
|
|
5
|
+
var RbStatusChipComponent = class RbStatusChipComponent {
|
|
6
|
+
label = input.required(...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
7
|
+
tone = input("neutral", ...ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []);
|
|
8
|
+
icon = input("", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
9
|
+
size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
10
|
+
resolvedIcon = computed(() => this.icon() || RB_TONE_ICONS[this.tone()], ...ngDevMode ? [{ debugName: "resolvedIcon" }] : /* istanbul ignore next */ []);
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.3",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: RbStatusChipComponent,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
18
|
+
});
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
20
|
+
minVersion: "17.0.0",
|
|
21
|
+
version: "22.2.3",
|
|
22
|
+
type: RbStatusChipComponent,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "rb-status-chip",
|
|
25
|
+
inputs: {
|
|
26
|
+
label: {
|
|
27
|
+
classPropertyName: "label",
|
|
28
|
+
publicName: "label",
|
|
29
|
+
isSignal: true,
|
|
30
|
+
isRequired: true,
|
|
31
|
+
transformFunction: null
|
|
32
|
+
},
|
|
33
|
+
tone: {
|
|
34
|
+
classPropertyName: "tone",
|
|
35
|
+
publicName: "tone",
|
|
36
|
+
isSignal: true,
|
|
37
|
+
isRequired: false,
|
|
38
|
+
transformFunction: null
|
|
39
|
+
},
|
|
40
|
+
icon: {
|
|
41
|
+
classPropertyName: "icon",
|
|
42
|
+
publicName: "icon",
|
|
43
|
+
isSignal: true,
|
|
44
|
+
isRequired: false,
|
|
45
|
+
transformFunction: null
|
|
46
|
+
},
|
|
47
|
+
size: {
|
|
48
|
+
classPropertyName: "size",
|
|
49
|
+
publicName: "size",
|
|
50
|
+
isSignal: true,
|
|
51
|
+
isRequired: false,
|
|
52
|
+
transformFunction: null
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
host: {
|
|
56
|
+
properties: {
|
|
57
|
+
"attr.data-tone": "tone()",
|
|
58
|
+
"attr.data-size": "size()"
|
|
59
|
+
},
|
|
60
|
+
classAttribute: "rb-status-chip"
|
|
61
|
+
},
|
|
62
|
+
ngImport: i0,
|
|
63
|
+
template: `
|
|
64
|
+
@if (resolvedIcon(); as icon) {
|
|
65
|
+
<mat-icon
|
|
66
|
+
class="rb-status-chip__icon"
|
|
67
|
+
fontSet="material-symbols-outlined"
|
|
68
|
+
aria-hidden="true"
|
|
69
|
+
>{{ icon }}</mat-icon
|
|
70
|
+
>
|
|
71
|
+
}
|
|
72
|
+
<span class="rb-status-chip__label">{{ label() }}</span>
|
|
73
|
+
`,
|
|
74
|
+
isInline: true,
|
|
75
|
+
styles: ["rb-status-chip{display:inline-flex;gap:var(--rb-space-1);align-items:center;max-width:100%;min-height:var(--rb-size-control-height-sm);padding:0 var(--rb-space-3);border:1px solid var(--rb-color-border);border-radius:var(--rb-radius-full);background-color:var(--rb-color-surface-sunken);color:var(--rb-color-text-muted);font:var(--rb-type-label-medium);letter-spacing:var(--rb-type-label-medium-tracking);vertical-align:middle;white-space:nowrap}rb-status-chip[data-size=compact]{min-height:var(--rb-space-6);padding:0 var(--rb-space-2)}rb-status-chip .rb-status-chip__icon{flex:none;width:var(--rb-size-icon-sm);height:var(--rb-size-icon-sm);font-size:var(--rb-size-icon-sm)}rb-status-chip .rb-status-chip__label{min-width:0;overflow:hidden;text-overflow:ellipsis}rb-status-chip[data-tone=active]{border-color:var(--rb-color-info-border);background-color:var(--rb-color-info-soft);color:var(--rb-color-info)}rb-status-chip[data-tone=success]{border-color:var(--rb-color-success-border);background-color:var(--rb-color-success-soft);color:var(--rb-color-success)}rb-status-chip[data-tone=warning]{border-color:var(--rb-color-warning-border);background-color:var(--rb-color-warning-soft);color:var(--rb-color-warning)}rb-status-chip[data-tone=danger]{border-color:var(--rb-color-danger-border);background-color:var(--rb-color-danger-soft);color:var(--rb-color-danger)}\n"],
|
|
76
|
+
dependencies: [{
|
|
77
|
+
kind: "component",
|
|
78
|
+
type: MatIcon,
|
|
79
|
+
selector: "mat-icon",
|
|
80
|
+
inputs: [
|
|
81
|
+
"color",
|
|
82
|
+
"inline",
|
|
83
|
+
"svgIcon",
|
|
84
|
+
"fontSet",
|
|
85
|
+
"fontIcon"
|
|
86
|
+
],
|
|
87
|
+
exportAs: ["matIcon"]
|
|
88
|
+
}],
|
|
89
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
90
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
94
|
+
minVersion: "12.0.0",
|
|
95
|
+
version: "22.2.3",
|
|
96
|
+
ngImport: i0,
|
|
97
|
+
type: RbStatusChipComponent,
|
|
98
|
+
decorators: [{
|
|
99
|
+
type: Component,
|
|
100
|
+
args: [{
|
|
101
|
+
selector: "rb-status-chip",
|
|
102
|
+
imports: [MatIcon],
|
|
103
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
|
+
encapsulation: ViewEncapsulation.None,
|
|
105
|
+
host: {
|
|
106
|
+
class: "rb-status-chip",
|
|
107
|
+
"[attr.data-tone]": "tone()",
|
|
108
|
+
"[attr.data-size]": "size()"
|
|
109
|
+
},
|
|
110
|
+
template: `
|
|
111
|
+
@if (resolvedIcon(); as icon) {
|
|
112
|
+
<mat-icon
|
|
113
|
+
class="rb-status-chip__icon"
|
|
114
|
+
fontSet="material-symbols-outlined"
|
|
115
|
+
aria-hidden="true"
|
|
116
|
+
>{{ icon }}</mat-icon
|
|
117
|
+
>
|
|
118
|
+
}
|
|
119
|
+
<span class="rb-status-chip__label">{{ label() }}</span>
|
|
120
|
+
`,
|
|
121
|
+
styles: ["rb-status-chip{display:inline-flex;gap:var(--rb-space-1);align-items:center;max-width:100%;min-height:var(--rb-size-control-height-sm);padding:0 var(--rb-space-3);border:1px solid var(--rb-color-border);border-radius:var(--rb-radius-full);background-color:var(--rb-color-surface-sunken);color:var(--rb-color-text-muted);font:var(--rb-type-label-medium);letter-spacing:var(--rb-type-label-medium-tracking);vertical-align:middle;white-space:nowrap}rb-status-chip[data-size=compact]{min-height:var(--rb-space-6);padding:0 var(--rb-space-2)}rb-status-chip .rb-status-chip__icon{flex:none;width:var(--rb-size-icon-sm);height:var(--rb-size-icon-sm);font-size:var(--rb-size-icon-sm)}rb-status-chip .rb-status-chip__label{min-width:0;overflow:hidden;text-overflow:ellipsis}rb-status-chip[data-tone=active]{border-color:var(--rb-color-info-border);background-color:var(--rb-color-info-soft);color:var(--rb-color-info)}rb-status-chip[data-tone=success]{border-color:var(--rb-color-success-border);background-color:var(--rb-color-success-soft);color:var(--rb-color-success)}rb-status-chip[data-tone=warning]{border-color:var(--rb-color-warning-border);background-color:var(--rb-color-warning-soft);color:var(--rb-color-warning)}rb-status-chip[data-tone=danger]{border-color:var(--rb-color-danger-border);background-color:var(--rb-color-danger-soft);color:var(--rb-color-danger)}\n"]
|
|
122
|
+
}]
|
|
123
|
+
}],
|
|
124
|
+
propDecorators: {
|
|
125
|
+
label: [{
|
|
126
|
+
type: i0.Input,
|
|
127
|
+
args: [{
|
|
128
|
+
isSignal: true,
|
|
129
|
+
alias: "label",
|
|
130
|
+
required: true
|
|
131
|
+
}]
|
|
132
|
+
}],
|
|
133
|
+
tone: [{
|
|
134
|
+
type: i0.Input,
|
|
135
|
+
args: [{
|
|
136
|
+
isSignal: true,
|
|
137
|
+
alias: "tone",
|
|
138
|
+
required: false
|
|
139
|
+
}]
|
|
140
|
+
}],
|
|
141
|
+
icon: [{
|
|
142
|
+
type: i0.Input,
|
|
143
|
+
args: [{
|
|
144
|
+
isSignal: true,
|
|
145
|
+
alias: "icon",
|
|
146
|
+
required: false
|
|
147
|
+
}]
|
|
148
|
+
}],
|
|
149
|
+
size: [{
|
|
150
|
+
type: i0.Input,
|
|
151
|
+
args: [{
|
|
152
|
+
isSignal: true,
|
|
153
|
+
alias: "size",
|
|
154
|
+
required: false
|
|
155
|
+
}]
|
|
156
|
+
}]
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
export { RbStatusChipComponent };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=rblabs-dev-axiom-status-chip.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rblabs-dev-axiom-status-chip.mjs","names":[],"sources":["../../../projects/axiom/status-chip/src/status-chip.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ViewEncapsulation,\n computed,\n input,\n} from '@angular/core';\nimport { MatIcon } from '@angular/material/icon';\nimport { RB_TONE_ICONS, RbStatusTone } from '@rblabs-dev/axiom/core';\n\nexport type RbStatusChipSize = 'default' | 'compact';\n\n/**\n * Read-only status label (docs/design-system.md, section 15.5). The label is always visible and\n * every non-neutral tone has an icon, so the state is never carried by color alone. It is not\n * interactive and not a live region: announce changes through `rb-message` or a status region.\n */\n@Component({\n selector: 'rb-status-chip',\n imports: [MatIcon],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'rb-status-chip',\n '[attr.data-tone]': 'tone()',\n '[attr.data-size]': 'size()',\n },\n template: `\n @if (resolvedIcon(); as icon) {\n <mat-icon\n class=\"rb-status-chip__icon\"\n fontSet=\"material-symbols-outlined\"\n aria-hidden=\"true\"\n >{{ icon }}</mat-icon\n >\n }\n <span class=\"rb-status-chip__label\">{{ label() }}</span>\n `,\n styleUrl: './status-chip.scss',\n})\nexport class RbStatusChipComponent {\n readonly label = input.required<string>();\n readonly tone = input<RbStatusTone>('neutral');\n /** Overrides the tone's default icon. */\n readonly icon = input<string>('');\n /** `compact` fits a single table row line. */\n readonly size = input<RbStatusChipSize>('default');\n\n protected readonly resolvedIcon = computed(() => this.icon() || RB_TONE_ICONS[this.tone()]);\n}\n"],"mappings":";;;;AAwCA,IAAa,wBAAb,MAAa,sBAAqB;CACvB,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,OAAO,MAAoB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAErC,OAAO,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAExB,OAAO,MAAwB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAE/B,eAAe,eAAe,KAAK,KAAI,KAAM,cAAc,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CARhF,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAqB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAArB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAqB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,kBAAA;IAAA,kBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;EAAA,UAbtB;;;;;;;;;;;EAUT,UAAA;EAAA,QAAA,CAAA,21CAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAlBS;GAAO,UAAA;GAAA,QAAA;IAAA;IAAA;IAAA;IAAA;IAAA;GAAA;GAAA,UAAA,CAAA,SAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;EAAA,eAAA,GAAA,kBAAA;CAAA,CAAA;;AAqBN,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EAvBjC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAgB,SACjB,CAAC,OAAO;GAAC,iBACD,wBAAwB;GAAM,eAChC,kBAAkB;GAAI,MAC/B;IACJ,OAAO;IACP,oBAAoB;IACpB,oBAAoB;GACrB;GAAA,UACS;;;;;;;;;;;GAUT,QAAA,CAAA,21CAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, ViewEncapsulation, afterNextRender, afterRenderEffect, computed, inject, input, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { MatTooltip } from "@angular/material/tooltip";
|
|
4
|
+
var RbTechnicalValueComponent = class RbTechnicalValueComponent {
|
|
5
|
+
value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
6
|
+
displayValue = input("", ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
|
|
7
|
+
host = inject(ElementRef);
|
|
8
|
+
destroyRef = inject(DestroyRef);
|
|
9
|
+
text = viewChild.required("text", ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
|
|
10
|
+
truncated = signal(false, ...ngDevMode ? [{ debugName: "truncated" }] : /* istanbul ignore next */ []);
|
|
11
|
+
shownValue = computed(() => this.displayValue() || this.value(), ...ngDevMode ? [{ debugName: "shownValue" }] : /* istanbul ignore next */ []);
|
|
12
|
+
shortened = computed(() => this.shownValue() !== this.value(), ...ngDevMode ? [{ debugName: "shortened" }] : /* istanbul ignore next */ []);
|
|
13
|
+
tooltipEnabled = computed(() => this.value() !== "" && (this.shortened() || this.truncated()), ...ngDevMode ? [{ debugName: "tooltipEnabled" }] : /* istanbul ignore next */ []);
|
|
14
|
+
constructor() {
|
|
15
|
+
afterRenderEffect({ read: () => {
|
|
16
|
+
this.shownValue();
|
|
17
|
+
this.measure();
|
|
18
|
+
} });
|
|
19
|
+
afterNextRender(() => {
|
|
20
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
21
|
+
const observer = new ResizeObserver(() => this.measure());
|
|
22
|
+
observer.observe(this.text().nativeElement);
|
|
23
|
+
this.destroyRef.onDestroy(() => observer.disconnect());
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
copyFullValue(event) {
|
|
27
|
+
if (!this.shortened() || !event.clipboardData) return;
|
|
28
|
+
const selection = this.host.nativeElement.ownerDocument.getSelection();
|
|
29
|
+
const host = this.host.nativeElement;
|
|
30
|
+
if (!selection || !host.contains(selection.anchorNode) || !host.contains(selection.focusNode)) return;
|
|
31
|
+
event.clipboardData.setData("text/plain", this.value());
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
}
|
|
34
|
+
measure() {
|
|
35
|
+
const element = this.text().nativeElement;
|
|
36
|
+
this.truncated.set(element.scrollWidth > element.clientWidth);
|
|
37
|
+
}
|
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
39
|
+
minVersion: "12.0.0",
|
|
40
|
+
version: "22.2.3",
|
|
41
|
+
ngImport: i0,
|
|
42
|
+
type: RbTechnicalValueComponent,
|
|
43
|
+
deps: [],
|
|
44
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
45
|
+
});
|
|
46
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
47
|
+
minVersion: "17.0.0",
|
|
48
|
+
version: "22.2.3",
|
|
49
|
+
type: RbTechnicalValueComponent,
|
|
50
|
+
isStandalone: true,
|
|
51
|
+
selector: "rb-technical-value",
|
|
52
|
+
inputs: {
|
|
53
|
+
value: {
|
|
54
|
+
classPropertyName: "value",
|
|
55
|
+
publicName: "value",
|
|
56
|
+
isSignal: true,
|
|
57
|
+
isRequired: true,
|
|
58
|
+
transformFunction: null
|
|
59
|
+
},
|
|
60
|
+
displayValue: {
|
|
61
|
+
classPropertyName: "displayValue",
|
|
62
|
+
publicName: "displayValue",
|
|
63
|
+
isSignal: true,
|
|
64
|
+
isRequired: false,
|
|
65
|
+
transformFunction: null
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
host: {
|
|
69
|
+
listeners: { "copy": "copyFullValue($event)" },
|
|
70
|
+
classAttribute: "rb-technical-value"
|
|
71
|
+
},
|
|
72
|
+
viewQueries: [{
|
|
73
|
+
propertyName: "text",
|
|
74
|
+
first: true,
|
|
75
|
+
predicate: ["text"],
|
|
76
|
+
descendants: true,
|
|
77
|
+
isSignal: true
|
|
78
|
+
}],
|
|
79
|
+
ngImport: i0,
|
|
80
|
+
template: `
|
|
81
|
+
<span
|
|
82
|
+
#text
|
|
83
|
+
class="rb-technical-value__text"
|
|
84
|
+
[matTooltip]="value()"
|
|
85
|
+
[matTooltipDisabled]="!tooltipEnabled()"
|
|
86
|
+
[attr.aria-hidden]="shortened() ? 'true' : null"
|
|
87
|
+
>{{ shownValue() }}</span
|
|
88
|
+
>
|
|
89
|
+
@if (shortened()) {
|
|
90
|
+
<span class="rb-visually-hidden">{{ value() }}</span>
|
|
91
|
+
}
|
|
92
|
+
`,
|
|
93
|
+
isInline: true,
|
|
94
|
+
styles: ["rb-technical-value{display:block;min-width:0;max-width:100%}rb-technical-value .rb-technical-value__text{display:block;min-width:0;max-width:100%;overflow:hidden;color:inherit;font-family:var(--rb-font-mono);text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:all;user-select:all}\n"],
|
|
95
|
+
dependencies: [{
|
|
96
|
+
kind: "directive",
|
|
97
|
+
type: MatTooltip,
|
|
98
|
+
selector: "[matTooltip]",
|
|
99
|
+
inputs: [
|
|
100
|
+
"matTooltipPosition",
|
|
101
|
+
"matTooltipPositionAtOrigin",
|
|
102
|
+
"matTooltipDisabled",
|
|
103
|
+
"matTooltipShowDelay",
|
|
104
|
+
"matTooltipHideDelay",
|
|
105
|
+
"matTooltipTouchGestures",
|
|
106
|
+
"matTooltip",
|
|
107
|
+
"matTooltipClass"
|
|
108
|
+
],
|
|
109
|
+
exportAs: ["matTooltip"]
|
|
110
|
+
}],
|
|
111
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
112
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
116
|
+
minVersion: "12.0.0",
|
|
117
|
+
version: "22.2.3",
|
|
118
|
+
ngImport: i0,
|
|
119
|
+
type: RbTechnicalValueComponent,
|
|
120
|
+
decorators: [{
|
|
121
|
+
type: Component,
|
|
122
|
+
args: [{
|
|
123
|
+
selector: "rb-technical-value",
|
|
124
|
+
imports: [MatTooltip],
|
|
125
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
126
|
+
encapsulation: ViewEncapsulation.None,
|
|
127
|
+
host: {
|
|
128
|
+
class: "rb-technical-value",
|
|
129
|
+
"(copy)": "copyFullValue($event)"
|
|
130
|
+
},
|
|
131
|
+
template: `
|
|
132
|
+
<span
|
|
133
|
+
#text
|
|
134
|
+
class="rb-technical-value__text"
|
|
135
|
+
[matTooltip]="value()"
|
|
136
|
+
[matTooltipDisabled]="!tooltipEnabled()"
|
|
137
|
+
[attr.aria-hidden]="shortened() ? 'true' : null"
|
|
138
|
+
>{{ shownValue() }}</span
|
|
139
|
+
>
|
|
140
|
+
@if (shortened()) {
|
|
141
|
+
<span class="rb-visually-hidden">{{ value() }}</span>
|
|
142
|
+
}
|
|
143
|
+
`,
|
|
144
|
+
styles: ["rb-technical-value{display:block;min-width:0;max-width:100%}rb-technical-value .rb-technical-value__text{display:block;min-width:0;max-width:100%;overflow:hidden;color:inherit;font-family:var(--rb-font-mono);text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:all;user-select:all}\n"]
|
|
145
|
+
}]
|
|
146
|
+
}],
|
|
147
|
+
ctorParameters: () => [],
|
|
148
|
+
propDecorators: {
|
|
149
|
+
value: [{
|
|
150
|
+
type: i0.Input,
|
|
151
|
+
args: [{
|
|
152
|
+
isSignal: true,
|
|
153
|
+
alias: "value",
|
|
154
|
+
required: true
|
|
155
|
+
}]
|
|
156
|
+
}],
|
|
157
|
+
displayValue: [{
|
|
158
|
+
type: i0.Input,
|
|
159
|
+
args: [{
|
|
160
|
+
isSignal: true,
|
|
161
|
+
alias: "displayValue",
|
|
162
|
+
required: false
|
|
163
|
+
}]
|
|
164
|
+
}],
|
|
165
|
+
text: [{
|
|
166
|
+
type: i0.ViewChild,
|
|
167
|
+
args: ["text", { isSignal: true }]
|
|
168
|
+
}]
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
export { RbTechnicalValueComponent };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=rblabs-dev-axiom-technical-value.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rblabs-dev-axiom-technical-value.mjs","names":[],"sources":["../../../projects/axiom/technical-value/src/technical-value.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n computed,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { MatTooltip } from '@angular/material/tooltip';\n\n/**\n * Identifier, key, hash or path in monospace on one line (docs/design-system.md, section 15.6).\n * A value that does not fit is truncated with an ellipsis and the full value appears in a tooltip.\n * Screen readers and copying always get the full value, even when `displayValue` shortens it.\n */\n@Component({\n selector: 'rb-technical-value',\n imports: [MatTooltip],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'rb-technical-value',\n '(copy)': 'copyFullValue($event)',\n },\n template: `\n <span\n #text\n class=\"rb-technical-value__text\"\n [matTooltip]=\"value()\"\n [matTooltipDisabled]=\"!tooltipEnabled()\"\n [attr.aria-hidden]=\"shortened() ? 'true' : null\"\n >{{ shownValue() }}</span\n >\n @if (shortened()) {\n <span class=\"rb-visually-hidden\">{{ value() }}</span>\n }\n `,\n styleUrl: './technical-value.scss',\n})\nexport class RbTechnicalValueComponent {\n readonly value = input.required<string>();\n /** Shorter text to show instead of the value, such as the first characters of a hash. */\n readonly displayValue = input<string>('');\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n private readonly text = viewChild.required<ElementRef<HTMLElement>>('text');\n private readonly truncated = signal(false);\n\n protected readonly shownValue = computed(() => this.displayValue() || this.value());\n protected readonly shortened = computed(() => this.shownValue() !== this.value());\n protected readonly tooltipEnabled = computed(\n () => this.value() !== '' && (this.shortened() || this.truncated()),\n );\n\n constructor() {\n // Re-measured whenever the text changes and whenever the element is resized.\n afterRenderEffect({\n read: () => {\n this.shownValue();\n this.measure();\n },\n });\n\n afterNextRender(() => {\n if (typeof ResizeObserver === 'undefined') return;\n const observer = new ResizeObserver(() => this.measure());\n observer.observe(this.text().nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /** Copying a selection inside the component copies the full value, not the shortened text. */\n protected copyFullValue(event: ClipboardEvent): void {\n if (!this.shortened() || !event.clipboardData) return;\n const selection = this.host.nativeElement.ownerDocument.getSelection();\n const host = this.host.nativeElement;\n if (!selection || !host.contains(selection.anchorNode) || !host.contains(selection.focusNode))\n return;\n event.clipboardData.setData('text/plain', this.value());\n event.preventDefault();\n }\n\n private measure(): void {\n const element = this.text().nativeElement;\n this.truncated.set(element.scrollWidth > element.clientWidth);\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, inject } from "@angular/core";
|
|
3
|
+
import { MatIconButton } from "@angular/material/button";
|
|
4
|
+
import { MatIcon } from "@angular/material/icon";
|
|
5
|
+
import { MatTooltip } from "@angular/material/tooltip";
|
|
6
|
+
import { ThemeService } from "@rblabs-dev/axiom/core";
|
|
7
|
+
var RbThemeToggleComponent = class RbThemeToggleComponent {
|
|
8
|
+
theme = inject(ThemeService);
|
|
9
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
10
|
+
minVersion: "12.0.0",
|
|
11
|
+
version: "22.2.3",
|
|
12
|
+
ngImport: i0,
|
|
13
|
+
type: RbThemeToggleComponent,
|
|
14
|
+
deps: [],
|
|
15
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
16
|
+
});
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
18
|
+
minVersion: "17.0.0",
|
|
19
|
+
version: "22.2.3",
|
|
20
|
+
type: RbThemeToggleComponent,
|
|
21
|
+
isStandalone: true,
|
|
22
|
+
selector: "rb-theme-toggle",
|
|
23
|
+
ngImport: i0,
|
|
24
|
+
template: `
|
|
25
|
+
@if (!theme.isForced()) {
|
|
26
|
+
<button
|
|
27
|
+
mat-icon-button
|
|
28
|
+
type="button"
|
|
29
|
+
class="rb-theme-toggle"
|
|
30
|
+
aria-label="Dark theme"
|
|
31
|
+
matTooltip="Dark theme"
|
|
32
|
+
[attr.aria-pressed]="theme.isDark()"
|
|
33
|
+
(click)="theme.toggle()"
|
|
34
|
+
>
|
|
35
|
+
<mat-icon fontSet="material-symbols-outlined" aria-hidden="true">dark_mode</mat-icon>
|
|
36
|
+
</button>
|
|
37
|
+
}
|
|
38
|
+
`,
|
|
39
|
+
isInline: true,
|
|
40
|
+
styles: [":host{display:inline-flex}.rb-theme-toggle[aria-pressed=true]{background-color:var(--rb-color-primary-soft);color:var(--rb-color-on-primary-soft)}\n"],
|
|
41
|
+
dependencies: [
|
|
42
|
+
{
|
|
43
|
+
kind: "component",
|
|
44
|
+
type: MatIconButton,
|
|
45
|
+
selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]",
|
|
46
|
+
exportAs: ["matButton", "matAnchor"]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
kind: "component",
|
|
50
|
+
type: MatIcon,
|
|
51
|
+
selector: "mat-icon",
|
|
52
|
+
inputs: [
|
|
53
|
+
"color",
|
|
54
|
+
"inline",
|
|
55
|
+
"svgIcon",
|
|
56
|
+
"fontSet",
|
|
57
|
+
"fontIcon"
|
|
58
|
+
],
|
|
59
|
+
exportAs: ["matIcon"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
kind: "directive",
|
|
63
|
+
type: MatTooltip,
|
|
64
|
+
selector: "[matTooltip]",
|
|
65
|
+
inputs: [
|
|
66
|
+
"matTooltipPosition",
|
|
67
|
+
"matTooltipPositionAtOrigin",
|
|
68
|
+
"matTooltipDisabled",
|
|
69
|
+
"matTooltipShowDelay",
|
|
70
|
+
"matTooltipHideDelay",
|
|
71
|
+
"matTooltipTouchGestures",
|
|
72
|
+
"matTooltip",
|
|
73
|
+
"matTooltipClass"
|
|
74
|
+
],
|
|
75
|
+
exportAs: ["matTooltip"]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
82
|
+
minVersion: "12.0.0",
|
|
83
|
+
version: "22.2.3",
|
|
84
|
+
ngImport: i0,
|
|
85
|
+
type: RbThemeToggleComponent,
|
|
86
|
+
decorators: [{
|
|
87
|
+
type: Component,
|
|
88
|
+
args: [{
|
|
89
|
+
selector: "rb-theme-toggle",
|
|
90
|
+
imports: [
|
|
91
|
+
MatIconButton,
|
|
92
|
+
MatIcon,
|
|
93
|
+
MatTooltip
|
|
94
|
+
],
|
|
95
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
96
|
+
template: `
|
|
97
|
+
@if (!theme.isForced()) {
|
|
98
|
+
<button
|
|
99
|
+
mat-icon-button
|
|
100
|
+
type="button"
|
|
101
|
+
class="rb-theme-toggle"
|
|
102
|
+
aria-label="Dark theme"
|
|
103
|
+
matTooltip="Dark theme"
|
|
104
|
+
[attr.aria-pressed]="theme.isDark()"
|
|
105
|
+
(click)="theme.toggle()"
|
|
106
|
+
>
|
|
107
|
+
<mat-icon fontSet="material-symbols-outlined" aria-hidden="true">dark_mode</mat-icon>
|
|
108
|
+
</button>
|
|
109
|
+
}
|
|
110
|
+
`,
|
|
111
|
+
styles: [":host{display:inline-flex}.rb-theme-toggle[aria-pressed=true]{background-color:var(--rb-color-primary-soft);color:var(--rb-color-on-primary-soft)}\n"]
|
|
112
|
+
}]
|
|
113
|
+
}]
|
|
114
|
+
});
|
|
115
|
+
export { RbThemeToggleComponent };
|
|
116
|
+
|
|
117
|
+
//# sourceMappingURL=rblabs-dev-axiom-theme-toggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rblabs-dev-axiom-theme-toggle.mjs","names":[],"sources":["../../../projects/axiom/theme-toggle/src/theme-toggle.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatTooltip } from '@angular/material/tooltip';\nimport { ThemeService } from '@rblabs-dev/axiom/core';\n\n/**\n * Light/dark switch for the app shell (docs/design-system.md, section 11). The accessible name stays\n * \"Dark theme\" and `aria-pressed` carries the state, so the label never rewrites itself into the\n * opposite action. Renders nothing while the app forces a theme.\n */\n@Component({\n selector: 'rb-theme-toggle',\n imports: [MatIconButton, MatIcon, MatTooltip],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (!theme.isForced()) {\n <button\n mat-icon-button\n type=\"button\"\n class=\"rb-theme-toggle\"\n aria-label=\"Dark theme\"\n matTooltip=\"Dark theme\"\n [attr.aria-pressed]=\"theme.isDark()\"\n (click)=\"theme.toggle()\"\n >\n <mat-icon fontSet=\"material-symbols-outlined\" aria-hidden=\"true\">dark_mode</mat-icon>\n </button>\n }\n `,\n styles: `\n :host {\n display: inline-flex;\n }\n\n .rb-theme-toggle[aria-pressed='true'] {\n background-color: var(--rb-color-primary-soft);\n color: var(--rb-color-on-primary-soft);\n }\n `,\n})\nexport class RbThemeToggleComponent {\n protected readonly theme = inject(ThemeService);\n}\n"],"mappings":";;;;;;AAyCA,IAAa,yBAAb,MAAa,uBAAsB;CACd,QAAQ,OAAO,YAAY;CADnC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAsB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAtB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAsB,cAAA;EAAA,UAAA;EAAA,UAAA;EAAA,UA1BvB;;;;;;;;;;;;;;;EAcT,UAAA;EAAA,QAAA,CAAA,sJAAA;EAAA,cAAA;GAAA;IAAA,MAAA;IAAA,MAhBS;IAAa,UAAA;IAAA,UAAA,CAAA,aAAA,WAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAO,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,SAAA;GAAA;GAAA;IAAA,MAAA;IAAA,MAAE;IAAU,UAAA;IAAA,QAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;KAAA;IAAA;IAAA,UAAA,CAAA,YAAA;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA4BjC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EA9BlC,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAiB,SAClB;IAAC;IAAe;IAAS;GAAU;GAAC,iBAC5B,wBAAwB;GAAM,UACrC;;;;;;;;;;;;;;;GAcT,QAAA,CAAA,sJAAA;EAAA,CAAA"}
|