maestral 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,90 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, computed, inject, input } from "@angular/core";
3
+ import { FormField } from "@angular/forms/signals";
4
+ import { MsField } from "maestral/field";
5
+ let nextId = 0;
6
+ var MsInput = class MsInput {
7
+ id = input(...ngDevMode ? [void 0, { debugName: "id" }] : /* istanbul ignore next */ []);
8
+ field = inject(MsField, { optional: true });
9
+ formField = inject(FormField, {
10
+ self: true,
11
+ optional: true
12
+ });
13
+ generatedId = this.field?.fallbackControlId ?? `ms-input-${nextId++}`;
14
+ effectiveId = computed(() => this.id() ?? this.generatedId, ...ngDevMode ? [{ debugName: "effectiveId" }] : /* istanbul ignore next */ []);
15
+ visibleErrors = computed(() => {
16
+ const state = this.formField?.state();
17
+ return state?.touched() ? state.errors() : [];
18
+ }, ...ngDevMode ? [{ debugName: "visibleErrors" }] : /* istanbul ignore next */ []);
19
+ validationRequired = computed(() => !!this.formField?.state().required(), ...ngDevMode ? [{ debugName: "validationRequired" }] : /* istanbul ignore next */ []);
20
+ constructor() {
21
+ this.field?.registerControl({
22
+ id: this.effectiveId,
23
+ errors: this.visibleErrors,
24
+ required: this.validationRequired
25
+ });
26
+ }
27
+ static ɵfac = i0.ɵɵngDeclareFactory({
28
+ minVersion: "12.0.0",
29
+ version: "22.2.4",
30
+ ngImport: i0,
31
+ type: MsInput,
32
+ deps: [],
33
+ target: i0.ɵɵFactoryTarget.Directive
34
+ });
35
+ static ɵdir = i0.ɵɵngDeclareDirective({
36
+ minVersion: "17.1.0",
37
+ version: "22.2.4",
38
+ type: MsInput,
39
+ isStandalone: true,
40
+ selector: "input[msInput], textarea[msInput]",
41
+ inputs: { id: {
42
+ classPropertyName: "id",
43
+ publicName: "id",
44
+ isSignal: true,
45
+ isRequired: false,
46
+ transformFunction: null
47
+ } },
48
+ host: {
49
+ properties: {
50
+ "id": "effectiveId()",
51
+ "attr.aria-describedby": "field?.describedBy() ?? null",
52
+ "attr.aria-invalid": "field?.invalid() ? \"true\" : null",
53
+ "attr.aria-required": "field?.isRequired() ? \"true\" : null"
54
+ },
55
+ classAttribute: "ms-input"
56
+ },
57
+ ngImport: i0
58
+ });
59
+ };
60
+ i0.ɵɵngDeclareClassMetadata({
61
+ minVersion: "12.0.0",
62
+ version: "22.2.4",
63
+ ngImport: i0,
64
+ type: MsInput,
65
+ decorators: [{
66
+ type: Directive,
67
+ args: [{
68
+ selector: "input[msInput], textarea[msInput]",
69
+ host: {
70
+ class: "ms-input",
71
+ "[id]": "effectiveId()",
72
+ "[attr.aria-describedby]": "field?.describedBy() ?? null",
73
+ "[attr.aria-invalid]": "field?.invalid() ? \"true\" : null",
74
+ "[attr.aria-required]": "field?.isRequired() ? \"true\" : null"
75
+ }
76
+ }]
77
+ }],
78
+ ctorParameters: () => [],
79
+ propDecorators: { id: [{
80
+ type: i0.Input,
81
+ args: [{
82
+ isSignal: true,
83
+ alias: "id",
84
+ required: false
85
+ }]
86
+ }] }
87
+ });
88
+ export { MsInput };
89
+
90
+ //# sourceMappingURL=maestral-input.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maestral-input.mjs","names":[],"sources":["../../../projects/maestral/input/input.ts"],"sourcesContent":["import { Directive, computed, inject, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { MsField } from 'maestral/field';\n\nlet nextId = 0;\n\n/**\n * Styles a native `<input>` or `<textarea>`.\n *\n * Inside `<ms-field>` it takes its id, `aria-describedby`, `aria-invalid` and\n * `aria-required` from the field. When the element is also bound to a Signal\n * Forms field (`[formField]`), it reports that field's validation state to\n * `<ms-field>`, which then shows the matching error message.\n */\n@Directive({\n selector: 'input[msInput], textarea[msInput]',\n host: {\n class: 'ms-input',\n '[id]': 'effectiveId()',\n '[attr.aria-describedby]': 'field?.describedBy() ?? null',\n '[attr.aria-invalid]': 'field?.invalid() ? \"true\" : null',\n '[attr.aria-required]': 'field?.isRequired() ? \"true\" : null',\n },\n})\nexport class MsInput {\n /** Optional custom id. When omitted, an id is generated. */\n readonly id = input<string>();\n\n protected readonly field = inject(MsField, { optional: true });\n private readonly formField = inject(FormField, { self: true, optional: true });\n\n private readonly generatedId = this.field?.fallbackControlId ?? `ms-input-${nextId++}`;\n readonly effectiveId = computed(() => this.id() ?? this.generatedId);\n\n /**\n * Errors are shown only once the field is touched, which happens when the\n * user leaves it or when the form is submitted. Nobody is told they made a\n * mistake while they are still typing.\n */\n private readonly visibleErrors = computed(() => {\n const state = this.formField?.state();\n return state?.touched() ? state.errors() : [];\n });\n\n private readonly validationRequired = computed(() => !!this.formField?.state().required());\n\n constructor() {\n this.field?.registerControl({\n id: this.effectiveId,\n errors: this.visibleErrors,\n required: this.validationRequired,\n });\n }\n}\n"],"mappings":";;;;AAIA,IAAI,SAAS;AAoBb,IAAa,UAAb,MAAa,QAAO;CAET,KAAK,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,KAAA,CAAA,+BAAA,CAAA,CAAA;CAEV,QAAQ,OAAO,SAAS,EAAE,UAAU,KAAI,CAAE;CAC5C,YAAY,OAAO,WAAW;EAAE,MAAM;EAAM,UAAU;CAAI,CAAE;CAE5D,cAAc,KAAK,OAAO,qBAAqB,YAAY;CACnE,cAAc,eAAe,KAAK,GAAE,KAAM,KAAK,aAAY,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAOnD,gBAAgB,eAAc;EAC7C,MAAM,QAAQ,KAAK,WAAW,MAAK;EACnC,OAAO,OAAO,QAAO,IAAK,MAAM,OAAM,IAAK,CAAA;CAC7C,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,gBAAA,CAAA,+BAAA,CAAA,CAAA;CAEe,qBAAqB,eAAe,CAAC,CAAC,KAAK,WAAW,MAAK,CAAE,CAAC,SAAQ,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,qBAAA,CAAA,+BAAA,CAAA,CAAA;CAE1F,cAAA;EACE,KAAK,OAAO,gBAAgB;GAC1B,IAAI,KAAK;GACT,QAAQ,KAAK;GACb,UAAU,KAAK;EAChB,CAAA;CACH;CA5BW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAO,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAP,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAO,cAAA;EAAA,UAAA;EAAA,QAAA,EAAA,IAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,MAAA;GAAA,YAAA;IAAA,MAAA;IAAA,yBAAA;IAAA,qBAAA;IAAA,sBAAA;GAAA;GAAA,gBAAA;EAAA;EAAA,UAAA;CAAA,CAAA;;AAAP,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAO,YAAA,CAAA;EAVnB,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM;IACJ,OAAO;IACP,QAAQ;IACR,2BAA2B;IAC3B,uBAAuB;IACvB,wBAAwB;GACzB;EACF,CAAA"}
@@ -0,0 +1,4 @@
1
+ const MAESTRAL_VERSION = "0.1.0";
2
+ export { MAESTRAL_VERSION };
3
+
4
+ //# sourceMappingURL=maestral.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maestral.mjs","names":[],"sources":["../../../projects/maestral/src/public-api.ts"],"sourcesContent":["/*\n * Public API Surface of maestral\n */\n\nexport const MAESTRAL_VERSION = '0.1.0';\n"],"mappings":"AAIA,MAAa,mBAAmB"}
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "maestral",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Accessible Angular components on native elements, with forms and theming at the core.",
5
+ "license": "MIT",
6
+ "author": "Anamaria Orsulic",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/AnamariaMarjanovic/maestral.git"
10
+ },
11
+ "keywords": [
12
+ "angular",
13
+ "components",
14
+ "design-system",
15
+ "accessibility",
16
+ "forms",
17
+ "design-tokens"
18
+ ],
19
+ "peerDependencies": {
20
+ "@angular/common": "^22.2.0",
21
+ "@angular/core": "^22.2.0",
22
+ "@angular/forms": "^22.2.0"
23
+ },
24
+ "dependencies": {
25
+ "tslib": "^2.3.0"
26
+ },
27
+ "sideEffects": [
28
+ "*.css"
29
+ ],
30
+ "exports": {
31
+ "./styles/*": {
32
+ "default": "./styles/*"
33
+ },
34
+ "./package.json": {
35
+ "default": "./package.json"
36
+ },
37
+ ".": {
38
+ "types": "./types/maestral.d.ts",
39
+ "default": "./fesm2022/maestral.mjs"
40
+ },
41
+ "./button": {
42
+ "types": "./types/maestral-button.d.ts",
43
+ "default": "./fesm2022/maestral-button.mjs"
44
+ },
45
+ "./error-summary": {
46
+ "types": "./types/maestral-error-summary.d.ts",
47
+ "default": "./fesm2022/maestral-error-summary.mjs"
48
+ },
49
+ "./field": {
50
+ "types": "./types/maestral-field.d.ts",
51
+ "default": "./fesm2022/maestral-field.mjs"
52
+ },
53
+ "./input": {
54
+ "types": "./types/maestral-input.d.ts",
55
+ "default": "./fesm2022/maestral-input.mjs"
56
+ }
57
+ },
58
+ "module": "fesm2022/maestral.mjs",
59
+ "typings": "types/maestral.d.ts",
60
+ "type": "module"
6
61
  }
@@ -0,0 +1,13 @@
1
+ /* Hides content visually but keeps it available to screen readers,
2
+ e.g. the "Error:" prefix of field error messages. */
3
+ .ms-visually-hidden {
4
+ position: absolute;
5
+ inline-size: 1px;
6
+ block-size: 1px;
7
+ padding: 0;
8
+ margin: -1px;
9
+ overflow: hidden;
10
+ clip-path: inset(50%);
11
+ white-space: nowrap;
12
+ border: 0;
13
+ }
@@ -0,0 +1,104 @@
1
+ .ms-button {
2
+ /* Private per-variant tokens; variants below only swap these */
3
+ --_bg: var(--ms-color-primary);
4
+ --_bg-hover: var(--ms-color-primary-hover);
5
+ --_fg: var(--ms-color-on-primary);
6
+ --_border: transparent;
7
+
8
+ display: inline-flex;
9
+ align-items: center;
10
+ justify-content: center;
11
+ gap: var(--ms-space-2);
12
+ min-height: var(--ms-control-height);
13
+ padding: 0 var(--ms-space-4);
14
+
15
+ font: inherit;
16
+ font-size: var(--ms-text-sm);
17
+ font-weight: 600;
18
+ line-height: 1;
19
+ text-decoration: none;
20
+
21
+ background: var(--_bg);
22
+ color: var(--_fg);
23
+ border: 1px solid var(--_border);
24
+ cursor: pointer;
25
+
26
+ /* Sail shape. Logical property, so the tack mirrors in right-to-left
27
+ layouts: bottom-left in LTR, bottom-right in RTL. */
28
+ border-radius: var(--ms-radius-sail);
29
+ border-end-start-radius: var(--ms-radius-tack);
30
+
31
+ transition:
32
+ background-color var(--ms-duration-fast) var(--ms-ease),
33
+ border-color var(--ms-duration-fast) var(--ms-ease);
34
+ }
35
+
36
+ .ms-button:hover:not(:disabled, [aria-disabled="true"]) {
37
+ background: var(--_bg-hover);
38
+ }
39
+
40
+ /* The outline follows border-radius, so the focus ring keeps the sail shape */
41
+ .ms-button:focus-visible {
42
+ outline: 2px solid var(--ms-color-focus-ring);
43
+ outline-offset: 2px;
44
+ }
45
+
46
+ .ms-button:disabled,
47
+ .ms-button[aria-disabled="true"] {
48
+ opacity: 0.5;
49
+ cursor: not-allowed;
50
+ }
51
+
52
+ /* Variants */
53
+ .ms-button[data-variant="secondary"] {
54
+ --_bg: var(--ms-color-surface-raised);
55
+ --_bg-hover: var(--ms-color-surface);
56
+ --_fg: var(--ms-color-text);
57
+ --_border: var(--ms-color-border);
58
+ }
59
+
60
+ .ms-button[data-variant="ghost"] {
61
+ --_bg: transparent;
62
+ --_bg-hover: var(--ms-color-primary-subtle);
63
+ --_fg: var(--ms-color-primary);
64
+ }
65
+
66
+ .ms-button[data-variant="danger"] {
67
+ --_bg: var(--ms-color-danger);
68
+ /* Mixing toward text color darkens in light mode, lightens in dark mode */
69
+ --_bg-hover: color-mix(in oklch, var(--ms-color-danger) 85%, var(--ms-color-text));
70
+ --_fg: var(--ms-color-on-danger);
71
+ }
72
+
73
+ /* Toggle buttons: aria-pressed="true" marks the selected option.
74
+ The state shows as border and background, not as color alone. */
75
+ .ms-button[aria-pressed="true"] {
76
+ --_bg: var(--ms-color-primary-subtle);
77
+ --_bg-hover: var(--ms-color-primary-subtle);
78
+ --_fg: var(--ms-color-primary);
79
+ --_border: var(--ms-color-primary);
80
+ }
81
+
82
+ /* Sizes */
83
+ .ms-button[data-size="sm"] {
84
+ min-height: calc(var(--ms-control-height) - 0.5rem);
85
+ padding: 0 var(--ms-space-3);
86
+ }
87
+
88
+ .ms-button[data-size="lg"] {
89
+ min-height: calc(var(--ms-control-height) + 0.5rem);
90
+ padding: 0 var(--ms-space-6);
91
+ font-size: var(--ms-text-md);
92
+ }
93
+
94
+ /* Windows High Contrast: keep the button outline visible */
95
+ @media (forced-colors: active) {
96
+ .ms-button {
97
+ border-color: ButtonText;
98
+ }
99
+
100
+ .ms-button[aria-pressed="true"] {
101
+ background: Highlight;
102
+ color: HighlightText;
103
+ }
104
+ }
@@ -0,0 +1,57 @@
1
+ /* Custom elements are inline by default; the summary is a block. */
2
+ ms-error-summary {
3
+ display: block;
4
+ }
5
+
6
+ .ms-error-summary {
7
+ padding: var(--ms-space-4) var(--ms-space-6);
8
+ color: var(--ms-color-text);
9
+ background: var(--ms-color-surface-raised);
10
+ border: 2px solid var(--ms-color-danger);
11
+ border-inline-start-width: 6px;
12
+ border-radius: var(--ms-radius-md);
13
+ }
14
+
15
+ /* Focus is moved here programmatically, so :focus (not :focus-visible)
16
+ keeps the ring visible after a mouse click on the submit button. */
17
+ .ms-error-summary:focus {
18
+ outline: 3px solid var(--ms-color-focus-ring);
19
+ outline-offset: 2px;
20
+ }
21
+
22
+ .ms-error-summary__title {
23
+ margin: 0 0 var(--ms-space-3);
24
+ font-size: var(--ms-text-lg);
25
+ font-weight: 700;
26
+ }
27
+
28
+ .ms-error-summary__list {
29
+ display: grid;
30
+ gap: var(--ms-space-2);
31
+ margin: 0;
32
+ padding: 0;
33
+ list-style: none;
34
+ }
35
+
36
+ .ms-error-summary__link {
37
+ font-weight: 600;
38
+ color: var(--ms-color-danger);
39
+ text-decoration: underline;
40
+ text-underline-offset: 0.2em;
41
+ }
42
+
43
+ .ms-error-summary__link:hover {
44
+ text-decoration-thickness: 2px;
45
+ }
46
+
47
+ .ms-error-summary__link:focus-visible {
48
+ outline: 2px solid var(--ms-color-focus-ring);
49
+ outline-offset: 2px;
50
+ border-radius: var(--ms-radius-sm);
51
+ }
52
+
53
+ @media (forced-colors: active) {
54
+ .ms-error-summary {
55
+ border-color: CanvasText;
56
+ }
57
+ }
@@ -0,0 +1,31 @@
1
+ .ms-field {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: var(--ms-space-1);
5
+ }
6
+
7
+ .ms-field__label {
8
+ font-size: var(--ms-text-sm);
9
+ font-weight: 600;
10
+ color: var(--ms-color-text);
11
+ }
12
+
13
+ .ms-field__required {
14
+ margin-inline-start: 0.125rem;
15
+ color: var(--ms-color-danger);
16
+ }
17
+
18
+ .ms-field__hint,
19
+ .ms-field__error {
20
+ margin: 0;
21
+ font-size: var(--ms-text-sm);
22
+ }
23
+
24
+ .ms-field__hint {
25
+ color: var(--ms-color-text-muted);
26
+ }
27
+
28
+ .ms-field__error {
29
+ font-weight: 600;
30
+ color: var(--ms-color-danger);
31
+ }
@@ -0,0 +1,68 @@
1
+ .ms-input {
2
+ box-sizing: border-box;
3
+ inline-size: 100%;
4
+ min-block-size: var(--ms-control-height);
5
+ padding: var(--ms-space-2) var(--ms-space-3);
6
+
7
+ /* 16px or more keeps iOS Safari from zooming in on focus */
8
+ font: inherit;
9
+ font-size: var(--ms-text-md);
10
+ color: var(--ms-color-text);
11
+
12
+ background: var(--ms-color-surface-raised);
13
+ border: 1px solid var(--ms-color-border-control);
14
+
15
+ /* Sail shape, mirrored in right-to-left layouts */
16
+ border-radius: var(--ms-radius-sail);
17
+ border-end-start-radius: var(--ms-radius-tack);
18
+
19
+ transition:
20
+ border-color var(--ms-duration-fast) var(--ms-ease),
21
+ box-shadow var(--ms-duration-fast) var(--ms-ease);
22
+ }
23
+
24
+ .ms-input::placeholder {
25
+ color: var(--ms-color-text-muted);
26
+ opacity: 1;
27
+ }
28
+
29
+ .ms-input:hover:not(:disabled) {
30
+ border-color: var(--ms-color-text-muted);
31
+ }
32
+
33
+ .ms-input:focus-visible {
34
+ outline: 2px solid var(--ms-color-focus-ring);
35
+ outline-offset: 1px;
36
+ border-color: var(--ms-color-primary);
37
+ }
38
+
39
+ /* Invalid state is not shown by color alone: the border also gets thicker
40
+ (inset shadow, so the layout does not shift) and the field shows a message. */
41
+ .ms-input[aria-invalid="true"] {
42
+ border-color: var(--ms-color-danger);
43
+ box-shadow: inset 0 0 0 1px var(--ms-color-danger);
44
+ }
45
+
46
+ .ms-input[aria-invalid="true"]:focus-visible {
47
+ outline-color: var(--ms-color-danger);
48
+ }
49
+
50
+ .ms-input:disabled {
51
+ opacity: 0.5;
52
+ cursor: not-allowed;
53
+ }
54
+
55
+ textarea.ms-input {
56
+ min-block-size: 6rem;
57
+ resize: vertical;
58
+ }
59
+
60
+ @media (forced-colors: active) {
61
+ .ms-input {
62
+ border-color: FieldText;
63
+ }
64
+
65
+ .ms-input[aria-invalid="true"] {
66
+ border-width: 3px;
67
+ }
68
+ }
@@ -0,0 +1,11 @@
1
+ /* Layer order: later layers win. Consumer styles outside any layer
2
+ always override all of these, no !important needed. */
3
+ @layer maestral.tokens, maestral.base, maestral.components;
4
+
5
+ @import url("./tokens.css") layer(maestral.tokens);
6
+ @import url("./base.css") layer(maestral.base);
7
+
8
+ @import url("./components/button.css") layer(maestral.components);
9
+ @import url("./components/input.css") layer(maestral.components);
10
+ @import url("./components/field.css") layer(maestral.components);
11
+ @import url("./components/error-summary.css") layer(maestral.components);
@@ -0,0 +1,100 @@
1
+ /* ── Primitive tokens: raw palette, used only by the semantic layer ── */
2
+ :root {
3
+ /* Indigo: the Adriatic at dusk */
4
+ --ms-indigo-50: oklch(97% 0.02 268);
5
+ --ms-indigo-100: oklch(93% 0.04 268);
6
+ --ms-indigo-200: oklch(86% 0.07 268);
7
+ --ms-indigo-300: oklch(76% 0.11 268);
8
+ --ms-indigo-400: oklch(64% 0.15 268);
9
+ --ms-indigo-500: oklch(54% 0.16 268);
10
+ --ms-indigo-600: oklch(46% 0.15 268);
11
+ --ms-indigo-700: oklch(39% 0.13 268);
12
+ --ms-indigo-900: oklch(28% 0.06 268);
13
+
14
+ /* Slate: cool neutrals with a hint of blue */
15
+ --ms-slate-0: oklch(100% 0 0);
16
+ --ms-slate-50: oklch(98.5% 0.004 260);
17
+ --ms-slate-100: oklch(96% 0.007 260);
18
+ --ms-slate-200: oklch(91.5% 0.012 260);
19
+ --ms-slate-300: oklch(85% 0.018 260);
20
+ --ms-slate-400: oklch(70% 0.025 260);
21
+ --ms-slate-500: oklch(56% 0.03 260);
22
+ --ms-slate-600: oklch(45% 0.03 260);
23
+ --ms-slate-700: oklch(36% 0.03 260);
24
+ --ms-slate-800: oklch(27% 0.03 262);
25
+ --ms-slate-900: oklch(21% 0.03 264);
26
+ --ms-slate-950: oklch(16% 0.025 265);
27
+
28
+ --ms-red-300: oklch(74% 0.12 20);
29
+ --ms-red-600: oklch(50% 0.17 20);
30
+ }
31
+
32
+ /* ── Semantic tokens: the only tokens components may use ── */
33
+ :root {
34
+ color-scheme: light dark;
35
+
36
+ /* Colors: light-dark() picks a value based on color-scheme.
37
+ Every text/background pair passes WCAG 2.2 AA in both schemes. */
38
+ --ms-color-bg: light-dark(var(--ms-slate-0), var(--ms-slate-950));
39
+ --ms-color-surface: light-dark(var(--ms-slate-50), var(--ms-slate-900));
40
+ --ms-color-surface-raised: light-dark(var(--ms-slate-0), var(--ms-slate-800));
41
+ --ms-color-border: light-dark(var(--ms-slate-200), var(--ms-slate-700));
42
+ /* Boundary of form controls: needs 3:1 against its background (WCAG 1.4.11) */
43
+ --ms-color-border-control: light-dark(var(--ms-slate-500), var(--ms-slate-500));
44
+ --ms-color-text: light-dark(var(--ms-slate-900), var(--ms-slate-50));
45
+ --ms-color-text-muted: light-dark(var(--ms-slate-600), var(--ms-slate-300));
46
+
47
+ --ms-color-primary: light-dark(var(--ms-indigo-600), var(--ms-indigo-300));
48
+ --ms-color-primary-hover: light-dark(var(--ms-indigo-700), var(--ms-indigo-200));
49
+ --ms-color-primary-subtle: light-dark(var(--ms-indigo-50), var(--ms-indigo-900));
50
+ --ms-color-on-primary: light-dark(var(--ms-slate-0), var(--ms-slate-950));
51
+
52
+ --ms-color-danger: light-dark(var(--ms-red-600), var(--ms-red-300));
53
+ --ms-color-on-danger: light-dark(var(--ms-slate-0), var(--ms-slate-950));
54
+
55
+ --ms-color-focus-ring: var(--ms-color-primary);
56
+
57
+ /* Shape: the "sail" signature. Controls round three corners and keep the
58
+ tack (the sail's lower front corner) sharp. Setting both values equal
59
+ gives a classic rounded shape; the theme generator will offer presets. */
60
+ --ms-radius-sail: 0.875rem;
61
+ --ms-radius-tack: 0.1875rem;
62
+
63
+ /* General radius scale for surfaces such as cards and popovers */
64
+ --ms-radius-sm: 4px;
65
+ --ms-radius-md: 8px;
66
+ --ms-radius-lg: 14px;
67
+ --ms-radius-full: 9999px;
68
+
69
+ --ms-space-1: 0.25rem;
70
+ --ms-space-2: 0.5rem;
71
+ --ms-space-3: 0.75rem;
72
+ --ms-space-4: 1rem;
73
+ --ms-space-6: 1.5rem;
74
+ --ms-space-8: 2rem;
75
+
76
+ --ms-control-height: 2.5rem;
77
+
78
+ /* Typography */
79
+ --ms-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
80
+ --ms-font-mono: ui-monospace, "SF Mono", Menlo, monospace;
81
+ --ms-text-sm: 0.875rem;
82
+ --ms-text-md: 1rem;
83
+ --ms-text-lg: 1.125rem;
84
+
85
+ /* Motion */
86
+ --ms-duration-fast: 120ms;
87
+ --ms-duration-normal: 200ms;
88
+ --ms-ease: cubic-bezier(0.2, 0, 0, 1);
89
+ }
90
+
91
+ /* Manual theme override: <html data-ms-theme="dark"> */
92
+ [data-ms-theme="light"] { color-scheme: light; }
93
+ [data-ms-theme="dark"] { color-scheme: dark; }
94
+
95
+ @media (prefers-reduced-motion: reduce) {
96
+ :root {
97
+ --ms-duration-fast: 0ms;
98
+ --ms-duration-normal: 0ms;
99
+ }
100
+ }
@@ -0,0 +1,20 @@
1
+ import * as i0 from "@angular/core";
2
+ export type MsButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
3
+ export type MsButtonSize = 'sm' | 'md' | 'lg';
4
+ export declare class MsButton {
5
+ readonly variant: import("@angular/core").InputSignal<MsButtonVariant>;
6
+ readonly size: import("@angular/core").InputSignal<MsButtonSize>;
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsButton, never>;
8
+ static ɵdir: i0.ɵɵDirectiveDeclaration<MsButton, "button[msButton], a[msButton]", never, {
9
+ "variant": {
10
+ "alias": "variant";
11
+ "required": false;
12
+ "isSignal": true;
13
+ };
14
+ "size": {
15
+ "alias": "size";
16
+ "required": false;
17
+ "isSignal": true;
18
+ };
19
+ }, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,56 @@
1
+ import { FieldTree } from "@angular/forms/signals";
2
+ import * as i0 from "@angular/core";
3
+ interface MsErrorSummaryItem {
4
+ readonly key: number;
5
+ readonly message: string;
6
+ readonly targetId: string | null;
7
+ /** The element the field is bound to with `[formField]`, if any. */
8
+ readonly element: HTMLElement | null;
9
+ }
10
+ /**
11
+ * Lists every invalid field after the user tries to submit a form, and
12
+ * moves focus to the list so screen reader users hear about the problem
13
+ * straight away. Each item links to its field.
14
+ *
15
+ * Place it at the top of the `<form>` it summarises:
16
+ *
17
+ * ```html
18
+ * <form novalidate (submit)="onSubmit($event)">
19
+ * <ms-error-summary [form]="contactForm" />
20
+ * ...
21
+ * </form>
22
+ * ```
23
+ */
24
+ export declare class MsErrorSummary {
25
+ /** The Signal Forms field tree of the form to summarise. */
26
+ readonly form: import("@angular/core").InputSignal<FieldTree<unknown>>;
27
+ readonly title: import("@angular/core").InputSignal<string>;
28
+ private readonly messages;
29
+ private readonly host;
30
+ private readonly injector;
31
+ private readonly destroyRef;
32
+ protected readonly titleId: string;
33
+ private readonly summary;
34
+ /** Becomes true on the first submit attempt. */
35
+ private readonly attempted;
36
+ /** One item per invalid field, in form order, with that field's first error. */
37
+ protected readonly items: import("@angular/core").Signal<MsErrorSummaryItem[]>;
38
+ protected readonly visible: import("@angular/core").Signal<boolean>;
39
+ constructor();
40
+ private onSubmitAttempt;
41
+ protected focusField(event: Event, item: MsErrorSummaryItem): void;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<MsErrorSummary, never>;
43
+ static ɵcmp: i0.ɵɵComponentDeclaration<MsErrorSummary, "ms-error-summary", never, {
44
+ "form": {
45
+ "alias": "form";
46
+ "required": true;
47
+ "isSignal": true;
48
+ };
49
+ "title": {
50
+ "alias": "title";
51
+ "required": false;
52
+ "isSignal": true;
53
+ };
54
+ }, {}, never, never, true, never>;
55
+ }
56
+ export {};