@starci/grammar 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.
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/common/index.d.ts +74 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +203 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/styles.css +2 -0
- package/dist/core/StateMark.d.ts +6 -0
- package/dist/core/StateMark.d.ts.map +1 -0
- package/dist/core/StateMark.js +9 -0
- package/dist/core/StateMark.js.map +1 -0
- package/dist/core/branch/Rail/index.d.ts +17 -0
- package/dist/core/branch/Rail/index.d.ts.map +1 -0
- package/dist/core/branch/Rail/index.js +11 -0
- package/dist/core/branch/Rail/index.js.map +1 -0
- package/dist/core/branch/SurfaceCard/index.d.ts +34 -0
- package/dist/core/branch/SurfaceCard/index.d.ts.map +1 -0
- package/dist/core/branch/SurfaceCard/index.js +14 -0
- package/dist/core/branch/SurfaceCard/index.js.map +1 -0
- package/dist/core/branch/SurfaceListCard/index.d.ts +29 -0
- package/dist/core/branch/SurfaceListCard/index.d.ts.map +1 -0
- package/dist/core/branch/SurfaceListCard/index.js +16 -0
- package/dist/core/branch/SurfaceListCard/index.js.map +1 -0
- package/dist/core/contracts.d.ts +190 -0
- package/dist/core/contracts.d.ts.map +1 -0
- package/dist/core/contracts.js +91 -0
- package/dist/core/contracts.js.map +1 -0
- package/dist/core/grammar.d.ts +18 -0
- package/dist/core/grammar.d.ts.map +1 -0
- package/dist/core/grammar.js +27 -0
- package/dist/core/grammar.js.map +1 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +8 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/rules.d.ts +45 -0
- package/dist/core/rules.d.ts.map +1 -0
- package/dist/core/rules.js +45 -0
- package/dist/core/rules.js.map +1 -0
- package/dist/core/state.d.ts +10 -0
- package/dist/core/state.d.ts.map +1 -0
- package/dist/core/state.js +24 -0
- package/dist/core/state.js.map +1 -0
- package/dist/core/styles.css +193 -0
- package/dist/offset-pop/index.d.ts +266 -0
- package/dist/offset-pop/index.d.ts.map +1 -0
- package/dist/offset-pop/index.js +69 -0
- package/dist/offset-pop/index.js.map +1 -0
- package/dist/offset-pop/styles.css +393 -0
- package/package.json +72 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { type GrammarContract, type GrammarContractSpec } from "../common/index.js";
|
|
2
|
+
export declare const surfaceCardContract: Readonly<{
|
|
3
|
+
key: "core.surface-card";
|
|
4
|
+
version: string;
|
|
5
|
+
spec: Readonly<{
|
|
6
|
+
readonly version: "1.0.0";
|
|
7
|
+
readonly layer: "branch";
|
|
8
|
+
readonly slots: readonly ["external-label", "content", "whole-action"];
|
|
9
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
10
|
+
readonly variableAxes: readonly ["surface-depth", "state-treatment", "action-mode", "container-response"];
|
|
11
|
+
readonly extensionPolicy: {
|
|
12
|
+
readonly allowedAxes: readonly ["surface-depth", "state-treatment", "container-response"];
|
|
13
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
14
|
+
};
|
|
15
|
+
readonly closedInvariants: readonly ["label-outside-surface", "nested-border-xor-shadow", "one-content-owner", "whole-action-is-overlay", "neutral-state-only"];
|
|
16
|
+
}>;
|
|
17
|
+
base: Readonly<{
|
|
18
|
+
key: string;
|
|
19
|
+
version: string;
|
|
20
|
+
rootKey: string;
|
|
21
|
+
rootVersion: string;
|
|
22
|
+
}> | null;
|
|
23
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const surfaceListCardContract: Readonly<{
|
|
26
|
+
key: "core.surface-list-card";
|
|
27
|
+
version: string;
|
|
28
|
+
spec: Readonly<{
|
|
29
|
+
readonly version: "1.0.0";
|
|
30
|
+
readonly layer: "branch";
|
|
31
|
+
readonly slots: readonly ["external-label", "single-list-shell", "static-row"];
|
|
32
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
33
|
+
readonly variableAxes: readonly ["surface-depth", "state-treatment", "row-count", "container-response"];
|
|
34
|
+
readonly extensionPolicy: {
|
|
35
|
+
readonly allowedAxes: readonly ["surface-depth", "state-treatment", "container-response"];
|
|
36
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
37
|
+
};
|
|
38
|
+
readonly closedInvariants: readonly ["one-list-one-shell", "rows-separated-by-dividers", "affirmative-row-uses-one-check", "nested-border-xor-shadow", "static-rows-have-no-action", "neutral-state-only"];
|
|
39
|
+
}>;
|
|
40
|
+
base: Readonly<{
|
|
41
|
+
key: string;
|
|
42
|
+
version: string;
|
|
43
|
+
rootKey: string;
|
|
44
|
+
rootVersion: string;
|
|
45
|
+
}> | null;
|
|
46
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const railContract: Readonly<{
|
|
49
|
+
key: "core.rail";
|
|
50
|
+
version: string;
|
|
51
|
+
spec: Readonly<{
|
|
52
|
+
readonly version: "1.0.0";
|
|
53
|
+
readonly layer: "branch";
|
|
54
|
+
readonly slots: readonly ["heading", "body", "footer"];
|
|
55
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
56
|
+
readonly variableAxes: readonly ["rail-mode", "rail-width", "state-treatment", "container-response"];
|
|
57
|
+
readonly extensionPolicy: {
|
|
58
|
+
readonly allowedAxes: readonly ["rail-width", "state-treatment", "container-response"];
|
|
59
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
60
|
+
};
|
|
61
|
+
readonly closedInvariants: readonly ["one-rail-landmark", "sticky-disabled-on-narrow-viewport", "body-remains-reachable", "footer-follows-body", "neutral-state-only"];
|
|
62
|
+
}>;
|
|
63
|
+
base: Readonly<{
|
|
64
|
+
key: string;
|
|
65
|
+
version: string;
|
|
66
|
+
rootKey: string;
|
|
67
|
+
rootVersion: string;
|
|
68
|
+
}> | null;
|
|
69
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const visualTreatmentContract: Readonly<{
|
|
72
|
+
key: "core.visual-treatment";
|
|
73
|
+
version: string;
|
|
74
|
+
spec: Readonly<{
|
|
75
|
+
readonly version: "1.0.0";
|
|
76
|
+
readonly layer: "composites";
|
|
77
|
+
readonly slots: readonly ["field", "surface", "display-copy", "floating-cluster"];
|
|
78
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
79
|
+
readonly variableAxes: readonly ["palette", "display-type", "outline-shadow", "floating-composition", "motion"];
|
|
80
|
+
readonly extensionPolicy: {
|
|
81
|
+
readonly allowedAxes: readonly ["palette", "display-type", "outline-shadow", "floating-composition", "motion"];
|
|
82
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
83
|
+
};
|
|
84
|
+
readonly closedInvariants: readonly ["business-neutral", "semantic-html-unchanged", "component-anatomy-unchanged", "state-vocabulary-unchanged", "content-remains-readable-without-decoration"];
|
|
85
|
+
}>;
|
|
86
|
+
base: Readonly<{
|
|
87
|
+
key: string;
|
|
88
|
+
version: string;
|
|
89
|
+
rootKey: string;
|
|
90
|
+
rootVersion: string;
|
|
91
|
+
}> | null;
|
|
92
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
93
|
+
}>;
|
|
94
|
+
export declare const CORE_COMPONENT_CONTRACTS: Readonly<{
|
|
95
|
+
"core.surface-card": Readonly<{
|
|
96
|
+
key: "core.surface-card";
|
|
97
|
+
version: string;
|
|
98
|
+
spec: Readonly<{
|
|
99
|
+
readonly version: "1.0.0";
|
|
100
|
+
readonly layer: "branch";
|
|
101
|
+
readonly slots: readonly ["external-label", "content", "whole-action"];
|
|
102
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
103
|
+
readonly variableAxes: readonly ["surface-depth", "state-treatment", "action-mode", "container-response"];
|
|
104
|
+
readonly extensionPolicy: {
|
|
105
|
+
readonly allowedAxes: readonly ["surface-depth", "state-treatment", "container-response"];
|
|
106
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
107
|
+
};
|
|
108
|
+
readonly closedInvariants: readonly ["label-outside-surface", "nested-border-xor-shadow", "one-content-owner", "whole-action-is-overlay", "neutral-state-only"];
|
|
109
|
+
}>;
|
|
110
|
+
base: Readonly<{
|
|
111
|
+
key: string;
|
|
112
|
+
version: string;
|
|
113
|
+
rootKey: string;
|
|
114
|
+
rootVersion: string;
|
|
115
|
+
}> | null;
|
|
116
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
117
|
+
}>;
|
|
118
|
+
"core.surface-list-card": Readonly<{
|
|
119
|
+
key: "core.surface-list-card";
|
|
120
|
+
version: string;
|
|
121
|
+
spec: Readonly<{
|
|
122
|
+
readonly version: "1.0.0";
|
|
123
|
+
readonly layer: "branch";
|
|
124
|
+
readonly slots: readonly ["external-label", "single-list-shell", "static-row"];
|
|
125
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
126
|
+
readonly variableAxes: readonly ["surface-depth", "state-treatment", "row-count", "container-response"];
|
|
127
|
+
readonly extensionPolicy: {
|
|
128
|
+
readonly allowedAxes: readonly ["surface-depth", "state-treatment", "container-response"];
|
|
129
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
130
|
+
};
|
|
131
|
+
readonly closedInvariants: readonly ["one-list-one-shell", "rows-separated-by-dividers", "affirmative-row-uses-one-check", "nested-border-xor-shadow", "static-rows-have-no-action", "neutral-state-only"];
|
|
132
|
+
}>;
|
|
133
|
+
base: Readonly<{
|
|
134
|
+
key: string;
|
|
135
|
+
version: string;
|
|
136
|
+
rootKey: string;
|
|
137
|
+
rootVersion: string;
|
|
138
|
+
}> | null;
|
|
139
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
140
|
+
}>;
|
|
141
|
+
"core.rail": Readonly<{
|
|
142
|
+
key: "core.rail";
|
|
143
|
+
version: string;
|
|
144
|
+
spec: Readonly<{
|
|
145
|
+
readonly version: "1.0.0";
|
|
146
|
+
readonly layer: "branch";
|
|
147
|
+
readonly slots: readonly ["heading", "body", "footer"];
|
|
148
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
149
|
+
readonly variableAxes: readonly ["rail-mode", "rail-width", "state-treatment", "container-response"];
|
|
150
|
+
readonly extensionPolicy: {
|
|
151
|
+
readonly allowedAxes: readonly ["rail-width", "state-treatment", "container-response"];
|
|
152
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
153
|
+
};
|
|
154
|
+
readonly closedInvariants: readonly ["one-rail-landmark", "sticky-disabled-on-narrow-viewport", "body-remains-reachable", "footer-follows-body", "neutral-state-only"];
|
|
155
|
+
}>;
|
|
156
|
+
base: Readonly<{
|
|
157
|
+
key: string;
|
|
158
|
+
version: string;
|
|
159
|
+
rootKey: string;
|
|
160
|
+
rootVersion: string;
|
|
161
|
+
}> | null;
|
|
162
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
163
|
+
}>;
|
|
164
|
+
"core.visual-treatment": Readonly<{
|
|
165
|
+
key: "core.visual-treatment";
|
|
166
|
+
version: string;
|
|
167
|
+
spec: Readonly<{
|
|
168
|
+
readonly version: "1.0.0";
|
|
169
|
+
readonly layer: "composites";
|
|
170
|
+
readonly slots: readonly ["field", "surface", "display-copy", "floating-cluster"];
|
|
171
|
+
readonly stateInputs: readonly ["neutral", "informative", "affirmative", "cautionary", "negative", "pending", "unavailable"];
|
|
172
|
+
readonly variableAxes: readonly ["palette", "display-type", "outline-shadow", "floating-composition", "motion"];
|
|
173
|
+
readonly extensionPolicy: {
|
|
174
|
+
readonly allowedAxes: readonly ["palette", "display-type", "outline-shadow", "floating-composition", "motion"];
|
|
175
|
+
readonly forbiddenChanges: readonly ["anatomy", "closed-invariant", "owner-substitution"];
|
|
176
|
+
};
|
|
177
|
+
readonly closedInvariants: readonly ["business-neutral", "semantic-html-unchanged", "component-anatomy-unchanged", "state-vocabulary-unchanged", "content-remains-readable-without-decoration"];
|
|
178
|
+
}>;
|
|
179
|
+
base: Readonly<{
|
|
180
|
+
key: string;
|
|
181
|
+
version: string;
|
|
182
|
+
rootKey: string;
|
|
183
|
+
rootVersion: string;
|
|
184
|
+
}> | null;
|
|
185
|
+
resolvedAxes: Readonly<Record<string, unknown>>;
|
|
186
|
+
}>;
|
|
187
|
+
}>;
|
|
188
|
+
export type CoreComponentContract = GrammarContract<string, GrammarContractSpec>;
|
|
189
|
+
export type CoreComponentContractId = keyof typeof CORE_COMPONENT_CONTRACTS;
|
|
190
|
+
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/core/contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,KAAK,eAAe,EACpB,KAAK,mBAAmB,EAC3B,MAAM,oBAAoB,CAAA;AAsF3B,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;EAA8D,CAAA;AAC9F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;EAAuE,CAAA;AAC3G,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;EAA+C,CAAA;AACxE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;EAAsE,CAAA;AAE1G,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;AAChF,MAAM,MAAM,uBAAuB,GAAG,MAAM,OAAO,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineGrammarContract, } from "../common/index.js";
|
|
2
|
+
import { PRESENTATION_STATES } from "./state.js";
|
|
3
|
+
const CLOSED_EXTENSION_BOUNDARIES = [
|
|
4
|
+
"anatomy",
|
|
5
|
+
"closed-invariant",
|
|
6
|
+
"owner-substitution",
|
|
7
|
+
];
|
|
8
|
+
const surfaceCardSpec = {
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
layer: "branch",
|
|
11
|
+
slots: ["external-label", "content", "whole-action"],
|
|
12
|
+
stateInputs: PRESENTATION_STATES,
|
|
13
|
+
variableAxes: ["surface-depth", "state-treatment", "action-mode", "container-response"],
|
|
14
|
+
extensionPolicy: {
|
|
15
|
+
allowedAxes: ["surface-depth", "state-treatment", "container-response"],
|
|
16
|
+
forbiddenChanges: CLOSED_EXTENSION_BOUNDARIES,
|
|
17
|
+
},
|
|
18
|
+
closedInvariants: [
|
|
19
|
+
"label-outside-surface",
|
|
20
|
+
"nested-border-xor-shadow",
|
|
21
|
+
"one-content-owner",
|
|
22
|
+
"whole-action-is-overlay",
|
|
23
|
+
"neutral-state-only",
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
const surfaceListCardSpec = {
|
|
27
|
+
version: "1.0.0",
|
|
28
|
+
layer: "branch",
|
|
29
|
+
slots: ["external-label", "single-list-shell", "static-row"],
|
|
30
|
+
stateInputs: PRESENTATION_STATES,
|
|
31
|
+
variableAxes: ["surface-depth", "state-treatment", "row-count", "container-response"],
|
|
32
|
+
extensionPolicy: {
|
|
33
|
+
allowedAxes: ["surface-depth", "state-treatment", "container-response"],
|
|
34
|
+
forbiddenChanges: CLOSED_EXTENSION_BOUNDARIES,
|
|
35
|
+
},
|
|
36
|
+
closedInvariants: [
|
|
37
|
+
"one-list-one-shell",
|
|
38
|
+
"rows-separated-by-dividers",
|
|
39
|
+
"affirmative-row-uses-one-check",
|
|
40
|
+
"nested-border-xor-shadow",
|
|
41
|
+
"static-rows-have-no-action",
|
|
42
|
+
"neutral-state-only",
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
const railSpec = {
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
layer: "branch",
|
|
48
|
+
slots: ["heading", "body", "footer"],
|
|
49
|
+
stateInputs: PRESENTATION_STATES,
|
|
50
|
+
variableAxes: ["rail-mode", "rail-width", "state-treatment", "container-response"],
|
|
51
|
+
extensionPolicy: {
|
|
52
|
+
allowedAxes: ["rail-width", "state-treatment", "container-response"],
|
|
53
|
+
forbiddenChanges: CLOSED_EXTENSION_BOUNDARIES,
|
|
54
|
+
},
|
|
55
|
+
closedInvariants: [
|
|
56
|
+
"one-rail-landmark",
|
|
57
|
+
"sticky-disabled-on-narrow-viewport",
|
|
58
|
+
"body-remains-reachable",
|
|
59
|
+
"footer-follows-body",
|
|
60
|
+
"neutral-state-only",
|
|
61
|
+
],
|
|
62
|
+
};
|
|
63
|
+
const visualTreatmentSpec = {
|
|
64
|
+
version: "1.0.0",
|
|
65
|
+
layer: "composites",
|
|
66
|
+
slots: ["field", "surface", "display-copy", "floating-cluster"],
|
|
67
|
+
stateInputs: PRESENTATION_STATES,
|
|
68
|
+
variableAxes: ["palette", "display-type", "outline-shadow", "floating-composition", "motion"],
|
|
69
|
+
extensionPolicy: {
|
|
70
|
+
allowedAxes: ["palette", "display-type", "outline-shadow", "floating-composition", "motion"],
|
|
71
|
+
forbiddenChanges: CLOSED_EXTENSION_BOUNDARIES,
|
|
72
|
+
},
|
|
73
|
+
closedInvariants: [
|
|
74
|
+
"business-neutral",
|
|
75
|
+
"semantic-html-unchanged",
|
|
76
|
+
"component-anatomy-unchanged",
|
|
77
|
+
"state-vocabulary-unchanged",
|
|
78
|
+
"content-remains-readable-without-decoration",
|
|
79
|
+
],
|
|
80
|
+
};
|
|
81
|
+
export const surfaceCardContract = defineGrammarContract("core.surface-card", surfaceCardSpec);
|
|
82
|
+
export const surfaceListCardContract = defineGrammarContract("core.surface-list-card", surfaceListCardSpec);
|
|
83
|
+
export const railContract = defineGrammarContract("core.rail", railSpec);
|
|
84
|
+
export const visualTreatmentContract = defineGrammarContract("core.visual-treatment", visualTreatmentSpec);
|
|
85
|
+
export const CORE_COMPONENT_CONTRACTS = Object.freeze({
|
|
86
|
+
"core.surface-card": surfaceCardContract,
|
|
87
|
+
"core.surface-list-card": surfaceListCardContract,
|
|
88
|
+
"core.rail": railContract,
|
|
89
|
+
"core.visual-treatment": visualTreatmentContract,
|
|
90
|
+
});
|
|
91
|
+
//# sourceMappingURL=contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/core/contracts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { GrammarContract } from "../common/index.js";
|
|
2
|
+
import { CORE_COMPONENT_CONTRACTS } from "./contracts.js";
|
|
3
|
+
import { CORE_RULES } from "./rules.js";
|
|
4
|
+
import { CORE_NEUTRAL_TREATMENTS, PRESENTATION_STATES } from "./state.js";
|
|
5
|
+
export type CoreGrammar = Readonly<{
|
|
6
|
+
id: "core";
|
|
7
|
+
version: "1.0.0";
|
|
8
|
+
extends: ReadonlyArray<string>;
|
|
9
|
+
presentationStates: typeof PRESENTATION_STATES;
|
|
10
|
+
treatments: typeof CORE_NEUTRAL_TREATMENTS;
|
|
11
|
+
contracts: typeof CORE_COMPONENT_CONTRACTS;
|
|
12
|
+
contractList: ReadonlyArray<GrammarContract>;
|
|
13
|
+
rules: typeof CORE_RULES;
|
|
14
|
+
invariants: ReadonlyArray<string>;
|
|
15
|
+
}>;
|
|
16
|
+
/** Business-neutral default Grammar assembled entirely from common-kernel contracts. */
|
|
17
|
+
export declare const coreGrammar: CoreGrammar;
|
|
18
|
+
//# sourceMappingURL=grammar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../../src/core/grammar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,EACH,wBAAwB,EAK3B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAEzE,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAC9B,kBAAkB,EAAE,OAAO,mBAAmB,CAAA;IAC9C,UAAU,EAAE,OAAO,uBAAuB,CAAA;IAC1C,SAAS,EAAE,OAAO,wBAAwB,CAAA;IAC1C,YAAY,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAC5C,KAAK,EAAE,OAAO,UAAU,CAAA;IACxB,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACpC,CAAC,CAAA;AAEF,wFAAwF;AACxF,eAAO,MAAM,WAAW,EAAE,WAqBxB,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CORE_COMPONENT_CONTRACTS, railContract, surfaceCardContract, surfaceListCardContract, visualTreatmentContract, } from "./contracts.js";
|
|
2
|
+
import { CORE_RULES } from "./rules.js";
|
|
3
|
+
import { CORE_NEUTRAL_TREATMENTS, PRESENTATION_STATES } from "./state.js";
|
|
4
|
+
/** Business-neutral default Grammar assembled entirely from common-kernel contracts. */
|
|
5
|
+
export const coreGrammar = Object.freeze({
|
|
6
|
+
id: "core",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
extends: Object.freeze([]),
|
|
9
|
+
presentationStates: PRESENTATION_STATES,
|
|
10
|
+
treatments: CORE_NEUTRAL_TREATMENTS,
|
|
11
|
+
contracts: CORE_COMPONENT_CONTRACTS,
|
|
12
|
+
contractList: Object.freeze([
|
|
13
|
+
surfaceCardContract,
|
|
14
|
+
surfaceListCardContract,
|
|
15
|
+
railContract,
|
|
16
|
+
visualTreatmentContract,
|
|
17
|
+
]),
|
|
18
|
+
rules: CORE_RULES,
|
|
19
|
+
invariants: Object.freeze([
|
|
20
|
+
"business-neutral",
|
|
21
|
+
"closed-public-props",
|
|
22
|
+
"no-caller-class-name",
|
|
23
|
+
"no-anatomy-changing-extension",
|
|
24
|
+
"container-owned-responsive-behavior",
|
|
25
|
+
]),
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=grammar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grammar.js","sourceRoot":"","sources":["../../src/core/grammar.ts"],"names":[],"mappings":"AACA,OAAO,EACH,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GAC1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AAczE,wFAAwF;AACxF,MAAM,CAAC,MAAM,WAAW,GAAgB,MAAM,CAAC,MAAM,CAAC;IAClD,EAAE,EAAE,MAAM;IACV,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IAC1B,kBAAkB,EAAE,mBAAmB;IACvC,UAAU,EAAE,uBAAuB;IACnC,SAAS,EAAE,wBAAwB;IACnC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC;QACxB,mBAAmB;QACnB,uBAAuB;QACvB,YAAY;QACZ,uBAAuB;KAC1B,CAAC;IACF,KAAK,EAAE,UAAU;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,kBAAkB;QAClB,qBAAqB;QACrB,sBAAsB;QACtB,+BAA+B;QAC/B,qCAAqC;KACxC,CAAC;CACL,CAAC,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { coreGrammar, type CoreGrammar } from "./grammar.js";
|
|
2
|
+
export { CORE_COMPONENT_CONTRACTS, railContract, surfaceCardContract, surfaceListCardContract, visualTreatmentContract, type CoreComponentContract, type CoreComponentContractId, } from "./contracts.js";
|
|
3
|
+
export { CORE_RULES, type CoreRule } from "./rules.js";
|
|
4
|
+
export { CORE_NEUTRAL_TREATMENTS, PRESENTATION_STATES, assertPresentationState, isPresentationState, treatmentFor, type NeutralTreatment, type PresentationState, } from "./state.js";
|
|
5
|
+
export { SurfaceCard, meta as surfaceCardMeta, type SurfaceCardProps, type WholeCardAction } from "./branch/SurfaceCard/index.js";
|
|
6
|
+
export { SurfaceListCard, meta as surfaceListCardMeta, type SurfaceListCardProps, type SurfaceListItem } from "./branch/SurfaceListCard/index.js";
|
|
7
|
+
export { Rail, meta as railMeta, type RailProps } from "./branch/Rail/index.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EACH,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,GAC/B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,GACzB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,eAAe,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAA;AACjI,OAAO,EAAE,eAAe,EAAE,IAAI,IAAI,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACjJ,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { coreGrammar } from "./grammar.js";
|
|
2
|
+
export { CORE_COMPONENT_CONTRACTS, railContract, surfaceCardContract, surfaceListCardContract, visualTreatmentContract, } from "./contracts.js";
|
|
3
|
+
export { CORE_RULES } from "./rules.js";
|
|
4
|
+
export { CORE_NEUTRAL_TREATMENTS, PRESENTATION_STATES, assertPresentationState, isPresentationState, treatmentFor, } from "./state.js";
|
|
5
|
+
export { SurfaceCard, meta as surfaceCardMeta } from "./branch/SurfaceCard/index.js";
|
|
6
|
+
export { SurfaceListCard, meta as surfaceListCardMeta } from "./branch/SurfaceListCard/index.js";
|
|
7
|
+
export { Rail, meta as railMeta } from "./branch/Rail/index.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,MAAM,cAAc,CAAA;AAC5D,OAAO,EACH,wBAAwB,EACxB,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GAG1B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAiB,MAAM,YAAY,CAAA;AACtD,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,YAAY,GAGf,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,WAAW,EAAE,IAAI,IAAI,eAAe,EAA+C,MAAM,+BAA+B,CAAA;AACjI,OAAO,EAAE,eAAe,EAAE,IAAI,IAAI,mBAAmB,EAAmD,MAAM,mCAAmC,CAAA;AACjJ,OAAO,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,EAAkB,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type CoreRule = {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly concern: "state" | "anatomy" | "layout" | "interaction";
|
|
4
|
+
readonly when: ReadonlyArray<string>;
|
|
5
|
+
readonly decide: ReadonlyArray<string>;
|
|
6
|
+
readonly refuse: ReadonlyArray<string>;
|
|
7
|
+
};
|
|
8
|
+
export declare const CORE_RULES: readonly [{
|
|
9
|
+
readonly id: "core.anatomy.label-outside-surface";
|
|
10
|
+
readonly concern: "anatomy";
|
|
11
|
+
readonly when: readonly ["one optional label names one bounded surface"];
|
|
12
|
+
readonly decide: readonly ["render the label before and outside the surface shell"];
|
|
13
|
+
readonly refuse: readonly ["placing the label inside surface padding", "duplicating the label in content"];
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "core.anatomy.nested-surface";
|
|
16
|
+
readonly concern: "anatomy";
|
|
17
|
+
readonly when: readonly ["one list boundary is nested in a larger surface"];
|
|
18
|
+
readonly decide: readonly ["retain one border", "remove elevation"];
|
|
19
|
+
readonly refuse: readonly ["border and shadow together", "a nested shell used only as decoration"];
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "core.anatomy.static-list";
|
|
22
|
+
readonly concern: "anatomy";
|
|
23
|
+
readonly when: readonly ["zero, one or many static peer statements share one boundary"];
|
|
24
|
+
readonly decide: readonly ["render one list shell", "separate adjacent rows", "show one check for an affirmative row"];
|
|
25
|
+
readonly refuse: readonly ["one shell per row", "interactive row behavior", "more than one state mark per row"];
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "core.interaction.whole-surface-action";
|
|
28
|
+
readonly concern: "interaction";
|
|
29
|
+
readonly when: readonly ["the entire surface has exactly one destination or action"];
|
|
30
|
+
readonly decide: readonly ["render one transparent control overlay after the content"];
|
|
31
|
+
readonly refuse: readonly ["nesting controls", "moving the visible content into the control"];
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "core.state.neutral-input";
|
|
34
|
+
readonly concern: "state";
|
|
35
|
+
readonly when: readonly ["a caller requests generic visual treatment"];
|
|
36
|
+
readonly decide: readonly ["accept one closed neutral presentation state"];
|
|
37
|
+
readonly refuse: readonly ["external semantic input", "copy-driven treatment selection"];
|
|
38
|
+
}, {
|
|
39
|
+
readonly id: "core.layout.container-response";
|
|
40
|
+
readonly concern: "layout";
|
|
41
|
+
readonly when: readonly ["a surface or rail loses useful inline space"];
|
|
42
|
+
readonly decide: readonly ["reflow owned rows within the component container", "disable sticky positioning on a narrow viewport"];
|
|
43
|
+
readonly refuse: readonly ["content clipping", "hiding the primary body", "caller-authored breakpoint classes"];
|
|
44
|
+
}];
|
|
45
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACnB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,CAAA;IAChE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACpC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IACtC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;CACzC,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CqB,CAAA"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const CORE_RULES = [
|
|
2
|
+
{
|
|
3
|
+
id: "core.anatomy.label-outside-surface",
|
|
4
|
+
concern: "anatomy",
|
|
5
|
+
when: ["one optional label names one bounded surface"],
|
|
6
|
+
decide: ["render the label before and outside the surface shell"],
|
|
7
|
+
refuse: ["placing the label inside surface padding", "duplicating the label in content"],
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
id: "core.anatomy.nested-surface",
|
|
11
|
+
concern: "anatomy",
|
|
12
|
+
when: ["one list boundary is nested in a larger surface"],
|
|
13
|
+
decide: ["retain one border", "remove elevation"],
|
|
14
|
+
refuse: ["border and shadow together", "a nested shell used only as decoration"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: "core.anatomy.static-list",
|
|
18
|
+
concern: "anatomy",
|
|
19
|
+
when: ["zero, one or many static peer statements share one boundary"],
|
|
20
|
+
decide: ["render one list shell", "separate adjacent rows", "show one check for an affirmative row"],
|
|
21
|
+
refuse: ["one shell per row", "interactive row behavior", "more than one state mark per row"],
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "core.interaction.whole-surface-action",
|
|
25
|
+
concern: "interaction",
|
|
26
|
+
when: ["the entire surface has exactly one destination or action"],
|
|
27
|
+
decide: ["render one transparent control overlay after the content"],
|
|
28
|
+
refuse: ["nesting controls", "moving the visible content into the control"],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "core.state.neutral-input",
|
|
32
|
+
concern: "state",
|
|
33
|
+
when: ["a caller requests generic visual treatment"],
|
|
34
|
+
decide: ["accept one closed neutral presentation state"],
|
|
35
|
+
refuse: ["external semantic input", "copy-driven treatment selection"],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: "core.layout.container-response",
|
|
39
|
+
concern: "layout",
|
|
40
|
+
when: ["a surface or rail loses useful inline space"],
|
|
41
|
+
decide: ["reflow owned rows within the component container", "disable sticky positioning on a narrow viewport"],
|
|
42
|
+
refuse: ["content clipping", "hiding the primary body", "caller-authored breakpoint classes"],
|
|
43
|
+
},
|
|
44
|
+
];
|
|
45
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/core/rules.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB;QACI,EAAE,EAAE,oCAAoC;QACxC,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,CAAC,8CAA8C,CAAC;QACtD,MAAM,EAAE,CAAC,uDAAuD,CAAC;QACjE,MAAM,EAAE,CAAC,0CAA0C,EAAE,kCAAkC,CAAC;KAC3F;IACD;QACI,EAAE,EAAE,6BAA6B;QACjC,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,CAAC,iDAAiD,CAAC;QACzD,MAAM,EAAE,CAAC,mBAAmB,EAAE,kBAAkB,CAAC;QACjD,MAAM,EAAE,CAAC,4BAA4B,EAAE,wCAAwC,CAAC;KACnF;IACD;QACI,EAAE,EAAE,0BAA0B;QAC9B,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,CAAC,6DAA6D,CAAC;QACrE,MAAM,EAAE,CAAC,uBAAuB,EAAE,wBAAwB,EAAE,uCAAuC,CAAC;QACpG,MAAM,EAAE,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,kCAAkC,CAAC;KAChG;IACD;QACI,EAAE,EAAE,uCAAuC;QAC3C,OAAO,EAAE,aAAa;QACtB,IAAI,EAAE,CAAC,0DAA0D,CAAC;QAClE,MAAM,EAAE,CAAC,0DAA0D,CAAC;QACpE,MAAM,EAAE,CAAC,kBAAkB,EAAE,6CAA6C,CAAC;KAC9E;IACD;QACI,EAAE,EAAE,0BAA0B;QAC9B,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,CAAC,4CAA4C,CAAC;QACpD,MAAM,EAAE,CAAC,8CAA8C,CAAC;QACxD,MAAM,EAAE,CAAC,yBAAyB,EAAE,iCAAiC,CAAC;KACzE;IACD;QACI,EAAE,EAAE,gCAAgC;QACpC,OAAO,EAAE,QAAQ;QACjB,IAAI,EAAE,CAAC,6CAA6C,CAAC;QACrD,MAAM,EAAE,CAAC,kDAAkD,EAAE,iDAAiD,CAAC;QAC/G,MAAM,EAAE,CAAC,kBAAkB,EAAE,yBAAyB,EAAE,oCAAoC,CAAC;KAChG;CACuC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type PresentationState } from "../common/index.js";
|
|
2
|
+
export { PRESENTATION_STATES, assertPresentationState, isPresentationState, type PresentationState, } from "../common/index.js";
|
|
3
|
+
export type NeutralTreatment = {
|
|
4
|
+
readonly state: PresentationState;
|
|
5
|
+
readonly tone: "quiet" | "positive" | "information" | "warning" | "danger" | "inactive" | "pending";
|
|
6
|
+
readonly mark: "none" | "check";
|
|
7
|
+
};
|
|
8
|
+
export declare const CORE_NEUTRAL_TREATMENTS: Readonly<Record<PresentationState, NeutralTreatment>>;
|
|
9
|
+
export declare const treatmentFor: (state: PresentationState) => NeutralTreatment;
|
|
10
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,KAAK,iBAAiB,EACzB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACH,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,EACnB,KAAK,iBAAiB,GACzB,MAAM,oBAAoB,CAAA;AAE3B,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAA;IACnG,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAClC,CAAA;AAaD,eAAO,MAAM,uBAAuB,EAE9B,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,CAAC,CAAA;AAE3D,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,KAAG,gBAGvD,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PRESENTATION_STATES, assertPresentationState, } from "../common/index.js";
|
|
2
|
+
export { PRESENTATION_STATES, assertPresentationState, isPresentationState, } from "../common/index.js";
|
|
3
|
+
const neutralTreatment = (state) => {
|
|
4
|
+
const id = String(state);
|
|
5
|
+
if (id === "affirmative")
|
|
6
|
+
return { state, tone: "positive", mark: "check" };
|
|
7
|
+
if (id === "informative")
|
|
8
|
+
return { state, tone: "information", mark: "none" };
|
|
9
|
+
if (id === "cautionary")
|
|
10
|
+
return { state, tone: "warning", mark: "none" };
|
|
11
|
+
if (id === "negative")
|
|
12
|
+
return { state, tone: "danger", mark: "none" };
|
|
13
|
+
if (id === "pending")
|
|
14
|
+
return { state, tone: "pending", mark: "none" };
|
|
15
|
+
if (id === "unavailable")
|
|
16
|
+
return { state, tone: "inactive", mark: "none" };
|
|
17
|
+
return { state, tone: "quiet", mark: "none" };
|
|
18
|
+
};
|
|
19
|
+
export const CORE_NEUTRAL_TREATMENTS = Object.freeze(Object.fromEntries(PRESENTATION_STATES.map((state) => [state, Object.freeze(neutralTreatment(state))])));
|
|
20
|
+
export const treatmentFor = (state) => {
|
|
21
|
+
assertPresentationState(state);
|
|
22
|
+
return CORE_NEUTRAL_TREATMENTS[state];
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/core/state.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,uBAAuB,GAE1B,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACH,mBAAmB,EACnB,uBAAuB,EACvB,mBAAmB,GAEtB,MAAM,oBAAoB,CAAA;AAQ3B,MAAM,gBAAgB,GAAG,CAAC,KAAwB,EAAoB,EAAE;IACpE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;IACxB,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;IAC3E,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAC7E,IAAI,EAAE,KAAK,YAAY;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IACxE,IAAI,EAAE,KAAK,UAAU;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IACrE,IAAI,EAAE,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IACrE,IAAI,EAAE,KAAK,aAAa;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;IAC1E,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAA;AACjD,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CACnE,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACtF,CAA0D,CAAA;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAoB,EAAE;IACvE,uBAAuB,CAAC,KAAK,CAAC,CAAA;IAC9B,OAAO,uBAAuB,CAAC,KAAK,CAAC,CAAA;AACzC,CAAC,CAAA"}
|