@agent-native/design-system 0.0.0-stage → 0.229.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 +78 -2
- package/THIRD_PARTY_NOTICES.md +58 -0
- package/css/appearances.css +91 -0
- package/css/main.css +174 -0
- package/css/parts/accordion.css +104 -0
- package/css/parts/alert-dialog.css +159 -0
- package/css/parts/app-shell.css +45 -0
- package/css/parts/aspect-ratio.css +20 -0
- package/css/parts/autocomplete.css +366 -0
- package/css/parts/avatar.css +108 -0
- package/css/parts/badge.css +100 -0
- package/css/parts/blockquote.css +23 -0
- package/css/parts/button.css +238 -0
- package/css/parts/callout.css +108 -0
- package/css/parts/card.css +144 -0
- package/css/parts/checkbox-cards.css +59 -0
- package/css/parts/checkbox-group.css +20 -0
- package/css/parts/checkbox.css +127 -0
- package/css/parts/code.css +194 -0
- package/css/parts/collapsible.css +40 -0
- package/css/parts/combobox.css +171 -0
- package/css/parts/context-menu.css +18 -0
- package/css/parts/data-list.css +130 -0
- package/css/parts/dialog.css +251 -0
- package/css/parts/drawer.css +289 -0
- package/css/parts/em.css +16 -0
- package/css/parts/field.css +55 -0
- package/css/parts/fieldset.css +34 -0
- package/css/parts/form.css +18 -0
- package/css/parts/heading.css +25 -0
- package/css/parts/icon-button.css +30 -0
- package/css/parts/input.css +206 -0
- package/css/parts/inset.css +90 -0
- package/css/parts/item.css +208 -0
- package/css/parts/kbd.css +126 -0
- package/css/parts/link.css +99 -0
- package/css/parts/menu.css +342 -0
- package/css/parts/menubar.css +71 -0
- package/css/parts/meter.css +112 -0
- package/css/parts/navigation-menu.css +199 -0
- package/css/parts/number-field.css +124 -0
- package/css/parts/otp-field.css +137 -0
- package/css/parts/page-header.css +45 -0
- package/css/parts/popover.css +149 -0
- package/css/parts/preview-card.css +116 -0
- package/css/parts/progress.css +159 -0
- package/css/parts/quote.css +18 -0
- package/css/parts/radio-cards.css +188 -0
- package/css/parts/radio-group.css +124 -0
- package/css/parts/scroll-area.css +95 -0
- package/css/parts/segmented-control.css +191 -0
- package/css/parts/select.css +378 -0
- package/css/parts/separator.css +48 -0
- package/css/parts/sidebar.css +211 -0
- package/css/parts/skeleton.css +65 -0
- package/css/parts/slider.css +156 -0
- package/css/parts/spinner.css +52 -0
- package/css/parts/strong.css +15 -0
- package/css/parts/switch.css +138 -0
- package/css/parts/tab-nav.css +48 -0
- package/css/parts/table.css +177 -0
- package/css/parts/tabs.css +214 -0
- package/css/parts/text-area.css +140 -0
- package/css/parts/text.css +245 -0
- package/css/parts/toast.css +302 -0
- package/css/parts/toggle-group.css +25 -0
- package/css/parts/toggle.css +181 -0
- package/css/parts/toolbar.css +133 -0
- package/css/parts/tooltip.css +61 -0
- package/css/parts/visually-hidden.css +21 -0
- package/css/styles.css +73 -0
- package/css/themes/agent-native.css +2321 -0
- package/css/themes/analytics.css +1159 -0
- package/css/themes/assets.css +1159 -0
- package/css/themes/baseline.css +1107 -0
- package/css/themes/brain.css +1159 -0
- package/css/themes/calendar.css +1159 -0
- package/css/themes/chat.css +1159 -0
- package/css/themes/clips.css +1159 -0
- package/css/themes/content.css +1159 -0
- package/css/themes/crm.css +1159 -0
- package/css/themes/design.css +1159 -0
- package/css/themes/desktop.css +1159 -0
- package/css/themes/dispatch.css +1159 -0
- package/css/themes/docs.css +1159 -0
- package/css/themes/factory.css +1159 -0
- package/css/themes/forms.css +1159 -0
- package/css/themes/mail.css +1159 -0
- package/css/themes/plan.css +1159 -0
- package/css/themes/slides.css +1159 -0
- package/css/themes/tasks.css +1159 -0
- package/css/tokens.css +1249 -0
- package/package.json +67 -4
- package/src/catalog/components/alert-dialog.ts +9 -0
- package/src/catalog/components/aspect-ratio.ts +6 -0
- package/src/catalog/components/autocomplete.ts +23 -0
- package/src/catalog/components/avatar.ts +16 -0
- package/src/catalog/components/badge.ts +19 -0
- package/src/catalog/components/blockquote.ts +10 -0
- package/src/catalog/components/button.ts +24 -0
- package/src/catalog/components/callout.ts +17 -0
- package/src/catalog/components/card.ts +10 -0
- package/src/catalog/components/checkbox-cards.ts +14 -0
- package/src/catalog/components/checkbox-group.ts +13 -0
- package/src/catalog/components/checkbox.ts +13 -0
- package/src/catalog/components/code.ts +22 -0
- package/src/catalog/components/combobox.ts +23 -0
- package/src/catalog/components/context-menu.ts +20 -0
- package/src/catalog/components/data-list.ts +14 -0
- package/src/catalog/components/dialog.ts +9 -0
- package/src/catalog/components/drawer.ts +9 -0
- package/src/catalog/components/em.ts +7 -0
- package/src/catalog/components/heading.ts +11 -0
- package/src/catalog/components/index.ts +54 -0
- package/src/catalog/components/input.ts +23 -0
- package/src/catalog/components/inset.ts +15 -0
- package/src/catalog/components/item.ts +21 -0
- package/src/catalog/components/kbd.ts +9 -0
- package/src/catalog/components/link.ts +19 -0
- package/src/catalog/components/menu.ts +20 -0
- package/src/catalog/components/menubar.ts +20 -0
- package/src/catalog/components/meter.ts +19 -0
- package/src/catalog/components/number-field.ts +10 -0
- package/src/catalog/components/otp-field.ts +9 -0
- package/src/catalog/components/popover.ts +9 -0
- package/src/catalog/components/preview-card.ts +9 -0
- package/src/catalog/components/progress.ts +24 -0
- package/src/catalog/components/quote.ts +7 -0
- package/src/catalog/components/radio-cards.ts +14 -0
- package/src/catalog/components/radio-group.ts +13 -0
- package/src/catalog/components/scroll-area.ts +15 -0
- package/src/catalog/components/segmented-control.ts +8 -0
- package/src/catalog/components/select.ts +26 -0
- package/src/catalog/components/separator.ts +14 -0
- package/src/catalog/components/skeleton.ts +8 -0
- package/src/catalog/components/slider.ts +19 -0
- package/src/catalog/components/spinner.ts +15 -0
- package/src/catalog/components/strong.ts +7 -0
- package/src/catalog/components/switch.ts +19 -0
- package/src/catalog/components/tab-nav.ts +18 -0
- package/src/catalog/components/table.ts +34 -0
- package/src/catalog/components/tabs.ts +18 -0
- package/src/catalog/components/text-area.ts +24 -0
- package/src/catalog/components/text.ts +11 -0
- package/src/catalog/components/toast.ts +12 -0
- package/src/catalog/components/toggle-group.ts +17 -0
- package/src/catalog/components/toggle.ts +17 -0
- package/src/catalog/components/toolbar.ts +6 -0
- package/src/catalog/index.ts +4 -0
- package/src/catalog/parts.ts +915 -0
- package/src/catalog/prop-types-source.ts +93 -0
- package/src/catalog/prop-types.generated.ts +1402 -0
- package/src/catalog/props.ts +225 -0
- package/src/css.ts +318 -0
- package/src/generated-css.ts +21 -0
- package/src/index.ts +8 -0
- package/src/model/compare.ts +127 -0
- package/src/model/dom.ts +253 -0
- package/src/model/ids.ts +25 -0
- package/src/model/index.ts +6 -0
- package/src/model/styles.ts +254 -0
- package/src/model/types.ts +97 -0
- package/src/model/validate.ts +133 -0
- package/src/themes/appearances.ts +105 -0
- package/src/themes/baseline.ts +27 -0
- package/src/themes/index.ts +85 -0
- package/src/themes/reference.ts +9 -0
- package/src/themes/shadcn.ts +239 -0
- package/src/themes/types.ts +53 -0
- package/src/tokens/at.ts +13 -0
- package/src/tokens/base.ts +48 -0
- package/src/tokens/color/bezier.ts +111 -0
- package/src/tokens/color/index.ts +2 -0
- package/src/tokens/color/radix-generator.ts +516 -0
- package/src/tokens/dtcg.ts +298 -0
- package/src/tokens/files/foundations.tokens.json +318 -0
- package/src/tokens/files/palette.tokens.json +58 -0
- package/src/tokens/files/themes/agent-native.dark.tokens.json +405 -0
- package/src/tokens/files/themes/agent-native.light.tokens.json +405 -0
- package/src/tokens/files/themes/analytics.dark.tokens.json +391 -0
- package/src/tokens/files/themes/analytics.light.tokens.json +391 -0
- package/src/tokens/files/themes/assets.dark.tokens.json +391 -0
- package/src/tokens/files/themes/assets.light.tokens.json +391 -0
- package/src/tokens/files/themes/brain.dark.tokens.json +391 -0
- package/src/tokens/files/themes/brain.light.tokens.json +391 -0
- package/src/tokens/files/themes/calendar.dark.tokens.json +391 -0
- package/src/tokens/files/themes/calendar.light.tokens.json +391 -0
- package/src/tokens/files/themes/chat.dark.tokens.json +391 -0
- package/src/tokens/files/themes/chat.light.tokens.json +391 -0
- package/src/tokens/files/themes/clips.dark.tokens.json +391 -0
- package/src/tokens/files/themes/clips.light.tokens.json +391 -0
- package/src/tokens/files/themes/content.dark.tokens.json +391 -0
- package/src/tokens/files/themes/content.light.tokens.json +391 -0
- package/src/tokens/files/themes/crm.dark.tokens.json +391 -0
- package/src/tokens/files/themes/crm.light.tokens.json +391 -0
- package/src/tokens/files/themes/design.dark.tokens.json +391 -0
- package/src/tokens/files/themes/design.light.tokens.json +391 -0
- package/src/tokens/files/themes/desktop.dark.tokens.json +391 -0
- package/src/tokens/files/themes/desktop.light.tokens.json +391 -0
- package/src/tokens/files/themes/dispatch.dark.tokens.json +391 -0
- package/src/tokens/files/themes/dispatch.light.tokens.json +391 -0
- package/src/tokens/files/themes/docs.dark.tokens.json +391 -0
- package/src/tokens/files/themes/docs.light.tokens.json +391 -0
- package/src/tokens/files/themes/factory.dark.tokens.json +391 -0
- package/src/tokens/files/themes/factory.light.tokens.json +391 -0
- package/src/tokens/files/themes/forms.dark.tokens.json +391 -0
- package/src/tokens/files/themes/forms.light.tokens.json +391 -0
- package/src/tokens/files/themes/mail.dark.tokens.json +391 -0
- package/src/tokens/files/themes/mail.light.tokens.json +391 -0
- package/src/tokens/files/themes/plan.dark.tokens.json +391 -0
- package/src/tokens/files/themes/plan.light.tokens.json +391 -0
- package/src/tokens/files/themes/slides.dark.tokens.json +391 -0
- package/src/tokens/files/themes/slides.light.tokens.json +391 -0
- package/src/tokens/files/themes/tasks.dark.tokens.json +391 -0
- package/src/tokens/files/themes/tasks.light.tokens.json +391 -0
- package/src/tokens/palette.ts +354 -0
- package/src/tokens/primitives.ts +84 -0
- package/src/tokens/roles.ts +269 -0
- package/src/tokens/round-trip.ts +277 -0
- package/src/tokens/source.ts +302 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CONTROL_SIZES,
|
|
3
|
+
type ControlSize,
|
|
4
|
+
RADIUS_PRESETS,
|
|
5
|
+
type RadiusPreset,
|
|
6
|
+
} from "../tokens/roles.js";
|
|
7
|
+
|
|
8
|
+
/** How a component applies its color, from the strongest fill to none. */
|
|
9
|
+
export const VARIANTS = [
|
|
10
|
+
"solid",
|
|
11
|
+
"soft",
|
|
12
|
+
"surface",
|
|
13
|
+
"outline",
|
|
14
|
+
"ghost",
|
|
15
|
+
] as const;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Which scale a component draws from. `accent` is the theme's brand scale;
|
|
19
|
+
* the statuses are the palette's status scales.
|
|
20
|
+
*/
|
|
21
|
+
export const COLORS = [
|
|
22
|
+
"accent",
|
|
23
|
+
"gray",
|
|
24
|
+
"danger",
|
|
25
|
+
"warning",
|
|
26
|
+
"success",
|
|
27
|
+
"info",
|
|
28
|
+
] as const;
|
|
29
|
+
|
|
30
|
+
/** Text sizes, one per step of the type scale: 0 is 10px, 1 the 12px UI base, 2 13px. */
|
|
31
|
+
export const TEXT_SIZES = [
|
|
32
|
+
"0",
|
|
33
|
+
"1",
|
|
34
|
+
"2",
|
|
35
|
+
"3",
|
|
36
|
+
"4",
|
|
37
|
+
"5",
|
|
38
|
+
"6",
|
|
39
|
+
"7",
|
|
40
|
+
"8",
|
|
41
|
+
"9",
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
/** Corner radius, overriding the theme's for one component: the radius presets. */
|
|
45
|
+
export const RADII = RADIUS_PRESETS;
|
|
46
|
+
|
|
47
|
+
export type Variant = (typeof VARIANTS)[number];
|
|
48
|
+
export type Color = (typeof COLORS)[number];
|
|
49
|
+
export type TextSize = (typeof TEXT_SIZES)[number];
|
|
50
|
+
export type Radius = RadiusPreset;
|
|
51
|
+
|
|
52
|
+
/** The palette scale each color reads: `accent` is the brand scale. */
|
|
53
|
+
export const COLOR_SCALES: Readonly<Record<Color, string>> = {
|
|
54
|
+
accent: "brand",
|
|
55
|
+
gray: "gray",
|
|
56
|
+
danger: "danger",
|
|
57
|
+
warning: "warning",
|
|
58
|
+
success: "success",
|
|
59
|
+
info: "info",
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export interface EnumPropDef<V extends string = string> {
|
|
63
|
+
type: "enum";
|
|
64
|
+
values: readonly V[];
|
|
65
|
+
default?: V;
|
|
66
|
+
description: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface BooleanPropDef {
|
|
70
|
+
type: "boolean";
|
|
71
|
+
default?: boolean;
|
|
72
|
+
description: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** A prop the component passes through or renders, not written as an attribute. */
|
|
76
|
+
export interface ValuePropDef {
|
|
77
|
+
type: "string" | "number" | "node" | "function";
|
|
78
|
+
description: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type PropDef = EnumPropDef | BooleanPropDef | ValuePropDef;
|
|
82
|
+
|
|
83
|
+
export type PropDefs = Readonly<Record<string, PropDef>>;
|
|
84
|
+
|
|
85
|
+
/** The value type a prop definition accepts. */
|
|
86
|
+
export type PropValue<D> =
|
|
87
|
+
D extends EnumPropDef<infer V>
|
|
88
|
+
? V
|
|
89
|
+
: D extends BooleanPropDef
|
|
90
|
+
? boolean
|
|
91
|
+
: never;
|
|
92
|
+
|
|
93
|
+
/** The props a component's definitions give it, all optional. */
|
|
94
|
+
export type PropsOf<D extends PropDefs> = {
|
|
95
|
+
-readonly [K in keyof D as D[K] extends EnumPropDef | BooleanPropDef
|
|
96
|
+
? K
|
|
97
|
+
: never]?: PropValue<D[K]>;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export function enumProp<const V extends string>(
|
|
101
|
+
values: readonly V[],
|
|
102
|
+
description: string,
|
|
103
|
+
defaultValue?: NoInfer<V>,
|
|
104
|
+
): EnumPropDef<V> {
|
|
105
|
+
return defaultValue === undefined
|
|
106
|
+
? { type: "enum", values, description }
|
|
107
|
+
: { type: "enum", values, default: defaultValue, description };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function booleanProp(description: string): BooleanPropDef {
|
|
111
|
+
return { type: "boolean", default: false, description };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** `size` over a component's subset of the control sizes. */
|
|
115
|
+
export function sizeProp<const V extends ControlSize>(
|
|
116
|
+
values: readonly V[],
|
|
117
|
+
defaultValue: NoInfer<V>,
|
|
118
|
+
measures = "Control height",
|
|
119
|
+
): EnumPropDef<V> {
|
|
120
|
+
const heights = values
|
|
121
|
+
.map((value) => `${value} is ${CONTROL_HEIGHT_PX[value]}px`)
|
|
122
|
+
.join(", ");
|
|
123
|
+
return enumProp(values, `${measures}: ${heights}.`, defaultValue);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const CONTROL_HEIGHT_PX: Readonly<Record<ControlSize, number>> = {
|
|
127
|
+
"1": 16,
|
|
128
|
+
"2": 20,
|
|
129
|
+
"3": 24,
|
|
130
|
+
"4": 32,
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
/** `variant` over a component's subset of the variants. */
|
|
134
|
+
export function variantProp<const V extends Variant>(
|
|
135
|
+
values: readonly V[],
|
|
136
|
+
defaultValue: NoInfer<V>,
|
|
137
|
+
): EnumPropDef<V> {
|
|
138
|
+
return enumProp(values, "How the component applies its color.", defaultValue);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export const colorProp: EnumPropDef<Color> = enumProp(
|
|
142
|
+
COLORS,
|
|
143
|
+
"The scale the component draws from. Unset, it inherits the nearest color, and the theme's accent at the root.",
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* `color` for a popup's highlighted row: gray unless set, so menus and lists
|
|
148
|
+
* keep the system's neutral highlight in every theme.
|
|
149
|
+
*/
|
|
150
|
+
export const popupColorProp: EnumPropDef<Color> = enumProp(
|
|
151
|
+
COLORS,
|
|
152
|
+
"The scale the highlighted row draws from; gray unless set.",
|
|
153
|
+
"gray",
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
export const highContrastProp: BooleanPropDef = booleanProp(
|
|
157
|
+
"Uses the scale's darkest steps, for text and fills that need more contrast.",
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
export const radiusProp: EnumPropDef<Radius> = enumProp<Radius>(
|
|
161
|
+
RADII,
|
|
162
|
+
"Overrides the theme's corner radius for this component.",
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
/** The data attribute a prop is written to: `highContrast` is `data-high-contrast`. */
|
|
166
|
+
export function propAttribute(name: string): string {
|
|
167
|
+
return `data-${name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`)}`;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* The data attributes for a component's props, with each definition's
|
|
172
|
+
* default filled in, so the CSS always sees a value. A boolean is written
|
|
173
|
+
* only when true. A value outside the definition throws: a misspelled
|
|
174
|
+
* variant must fail where it is written, not render as the default.
|
|
175
|
+
*/
|
|
176
|
+
export function propAttributes(
|
|
177
|
+
defs: PropDefs,
|
|
178
|
+
props: object,
|
|
179
|
+
): Record<string, string | undefined> {
|
|
180
|
+
const values: Readonly<Record<string, unknown>> = { ...props };
|
|
181
|
+
const attributes: Record<string, string | undefined> = {};
|
|
182
|
+
for (const [name, def] of Object.entries(defs)) {
|
|
183
|
+
if (def.type === "enum") {
|
|
184
|
+
const value = values[name] ?? def.default;
|
|
185
|
+
if (value === undefined) continue;
|
|
186
|
+
if (typeof value !== "string" || !def.values.includes(value)) {
|
|
187
|
+
throw new TypeError(
|
|
188
|
+
`${name}="${String(value)}" is not one of ${def.values.join(", ")}`,
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
attributes[propAttribute(name)] = value;
|
|
192
|
+
} else if (def.type === "boolean") {
|
|
193
|
+
if (values[name] === true) attributes[propAttribute(name)] = "";
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return attributes;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Font weights, one per weight token. Radix Themes has all but semibold. */
|
|
200
|
+
export const TEXT_WEIGHTS = [
|
|
201
|
+
"light",
|
|
202
|
+
"regular",
|
|
203
|
+
"medium",
|
|
204
|
+
"semibold",
|
|
205
|
+
"bold",
|
|
206
|
+
] as const;
|
|
207
|
+
|
|
208
|
+
export type TextWeight = (typeof TEXT_WEIGHTS)[number];
|
|
209
|
+
|
|
210
|
+
/** The props Radix Themes gives every text component. */
|
|
211
|
+
export const textProps = {
|
|
212
|
+
weight: enumProp(TEXT_WEIGHTS, "Font weight, one of the weight tokens."),
|
|
213
|
+
align: enumProp(["left", "center", "right"], "Text alignment."),
|
|
214
|
+
trim: enumProp(
|
|
215
|
+
["normal", "start", "end", "both"],
|
|
216
|
+
"Trims the leading above the first line, below the last, or both, so text sits flush with its box.",
|
|
217
|
+
),
|
|
218
|
+
truncate: booleanProp("Truncates to one line with an ellipsis."),
|
|
219
|
+
wrap: enumProp(
|
|
220
|
+
["wrap", "nowrap", "pretty", "balance"],
|
|
221
|
+
"How lines break: `pretty` avoids orphans, `balance` evens line lengths.",
|
|
222
|
+
),
|
|
223
|
+
color: colorProp,
|
|
224
|
+
highContrast: highContrastProp,
|
|
225
|
+
} as const;
|
package/src/css.ts
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { COLOR_SCALES, COLORS } from "./catalog/props.js";
|
|
2
|
+
import { APPEARANCES } from "./themes/appearances.js";
|
|
3
|
+
import { SHADCN_SLOTS } from "./themes/shadcn.js";
|
|
4
|
+
import type { ThemeDefinition } from "./themes/types.js";
|
|
5
|
+
import {
|
|
6
|
+
createPalette,
|
|
7
|
+
DEFAULT_PALETTE_INPUT,
|
|
8
|
+
type Palette,
|
|
9
|
+
} from "./tokens/palette.js";
|
|
10
|
+
import {
|
|
11
|
+
staticPrimitives,
|
|
12
|
+
RADIUS_STEPS,
|
|
13
|
+
type TokenMap,
|
|
14
|
+
} from "./tokens/primitives.js";
|
|
15
|
+
import {
|
|
16
|
+
DENSITIES,
|
|
17
|
+
densityTokens,
|
|
18
|
+
RADIUS_PRESETS,
|
|
19
|
+
radiusTokens,
|
|
20
|
+
STANDARD_SHAPE_TOKENS,
|
|
21
|
+
} from "./tokens/roles.js";
|
|
22
|
+
|
|
23
|
+
const GENERATED_HEADER =
|
|
24
|
+
"/* Generated by packages/design-system/scripts/build-css.ts from src/. Do not edit. */";
|
|
25
|
+
|
|
26
|
+
const COLOR_SCOPES = [".light", ".dark", "[data-palette]"] as const;
|
|
27
|
+
|
|
28
|
+
function block(selector: string, tokens: TokenMap, indent = ""): string {
|
|
29
|
+
const entries = Object.entries(tokens);
|
|
30
|
+
if (entries.length === 0) return "";
|
|
31
|
+
const body = entries
|
|
32
|
+
.map(([name, value]) => `${indent} ${name}: ${value};`)
|
|
33
|
+
.join("\n");
|
|
34
|
+
const selectors = selector.split("\n").join(`\n${indent}`);
|
|
35
|
+
return `${indent}${selectors} {\n${body}\n${indent}}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function p3Block(rules: string[]): string {
|
|
39
|
+
const inner = rules
|
|
40
|
+
.filter(Boolean)
|
|
41
|
+
.map((rule) =>
|
|
42
|
+
rule
|
|
43
|
+
.split("\n")
|
|
44
|
+
.map((line) => ` ${line}`)
|
|
45
|
+
.join("\n"),
|
|
46
|
+
)
|
|
47
|
+
.join("\n\n");
|
|
48
|
+
return `@supports (color: color(display-p3 1 1 1)) {\n @media (color-gamut: p3) {\n${inner}\n }\n}`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function colorScopeTokens(scale: string): TokenMap {
|
|
52
|
+
const tokens: TokenMap = {};
|
|
53
|
+
for (let step = 1; step <= 12; step++) {
|
|
54
|
+
tokens[`--accent-${step}`] = `var(--${scale}-${step})`;
|
|
55
|
+
}
|
|
56
|
+
for (let step = 1; step <= 12; step++) {
|
|
57
|
+
tokens[`--accent-a${step}`] = `var(--${scale}-a${step})`;
|
|
58
|
+
}
|
|
59
|
+
tokens["--accent-contrast"] = `var(--${scale}-contrast)`;
|
|
60
|
+
tokens["--accent-surface"] = `var(--${scale}-surface)`;
|
|
61
|
+
tokens["--accent-solid"] = `var(--${scale}-solid)`;
|
|
62
|
+
tokens["--accent-solid-hover"] = `var(--${scale}-solid-hover)`;
|
|
63
|
+
tokens["--accent-text"] = `var(--${scale}-text)`;
|
|
64
|
+
tokens["--accent-indicator"] = `var(--${scale}-indicator, var(--${scale}-9))`;
|
|
65
|
+
tokens["--accent-track"] = `var(--${scale}-track, var(--${scale}-9))`;
|
|
66
|
+
return tokens;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function colorScopesCss(): string[] {
|
|
70
|
+
return COLORS.map((color) =>
|
|
71
|
+
block(
|
|
72
|
+
color === "accent"
|
|
73
|
+
? [":root", ...COLOR_SCOPES, `[data-color="accent"]`].join(",\n")
|
|
74
|
+
: `[data-color="${color}"]`,
|
|
75
|
+
colorScopeTokens(COLOR_SCALES[color]),
|
|
76
|
+
),
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function radiusStepTokens(): TokenMap {
|
|
81
|
+
const tokens: TokenMap = {};
|
|
82
|
+
RADIUS_STEPS.forEach((value, index) => {
|
|
83
|
+
tokens[`--radius-${index + 1}`] = `calc(${value}px * var(--radius-factor))`;
|
|
84
|
+
});
|
|
85
|
+
return tokens;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const preset = (name: string, value: string) => `[${name}][${name}="${value}"]`;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Primitives and presets: the static ramps, the default color scales in both
|
|
92
|
+
* appearances (sRGB with P3 overrides), and the density, radius and corner
|
|
93
|
+
* presets. Theme-independent.
|
|
94
|
+
*/
|
|
95
|
+
export function tokensCss(
|
|
96
|
+
palette: Palette = createPalette(DEFAULT_PALETTE_INPUT),
|
|
97
|
+
): string {
|
|
98
|
+
const sections: string[] = [GENERATED_HEADER];
|
|
99
|
+
|
|
100
|
+
sections.push(
|
|
101
|
+
block(":root", { "--radius-factor": "1", ...staticPrimitives() }),
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
sections.push(block(":root,\n.light", palette.light.srgb));
|
|
105
|
+
sections.push(block(".dark", palette.dark.srgb));
|
|
106
|
+
sections.push(
|
|
107
|
+
p3Block([
|
|
108
|
+
block(":root,\n.light", palette.light.p3),
|
|
109
|
+
block(".dark", palette.dark.p3),
|
|
110
|
+
]),
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
sections.push(...colorScopesCss());
|
|
114
|
+
|
|
115
|
+
sections.push(block(":root", densityTokens("default")));
|
|
116
|
+
for (const density of DENSITIES) {
|
|
117
|
+
sections.push(
|
|
118
|
+
block(preset("data-density", density), densityTokens(density)),
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
for (const radius of RADIUS_PRESETS) {
|
|
123
|
+
sections.push(
|
|
124
|
+
block(preset("data-radius", radius), {
|
|
125
|
+
...radiusStepTokens(),
|
|
126
|
+
...STANDARD_SHAPE_TOKENS,
|
|
127
|
+
...radiusTokens(radius),
|
|
128
|
+
}),
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
sections.push(
|
|
133
|
+
block(preset("data-corners", "round"), {
|
|
134
|
+
"--corner-shape": "round",
|
|
135
|
+
"--corner-scale": "1",
|
|
136
|
+
}),
|
|
137
|
+
);
|
|
138
|
+
sections.push(
|
|
139
|
+
`@supports (corner-shape: superellipse(2)) {\n${block(
|
|
140
|
+
preset("data-corners", "squircle"),
|
|
141
|
+
{
|
|
142
|
+
"--corner-shape": "superellipse(1.3)",
|
|
143
|
+
"--corner-scale": "1.25",
|
|
144
|
+
},
|
|
145
|
+
" ",
|
|
146
|
+
)}\n}`,
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
return `${sections.filter(Boolean).join("\n\n")}\n`;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const NO_PALETTE = ":not([data-palette], [data-palette] *)";
|
|
153
|
+
const ROOT_LIGHT_SCALES = [":root", ".light"]
|
|
154
|
+
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
155
|
+
.join(",\n");
|
|
156
|
+
const ROOT_DARK_SCALES = `.dark${NO_PALETTE}`;
|
|
157
|
+
const THEME_LIGHT_SCALES = [":scope", ":scope.light", ".light"]
|
|
158
|
+
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
159
|
+
.join(",\n");
|
|
160
|
+
const THEME_DARK_SCALES = [":scope.dark", ".dark"]
|
|
161
|
+
.map((selector) => `${selector}${NO_PALETTE}`)
|
|
162
|
+
.join(",\n");
|
|
163
|
+
|
|
164
|
+
function withResets(own: TokenMap, keys: ReadonlySet<string>): TokenMap {
|
|
165
|
+
const tokens: TokenMap = { ...own };
|
|
166
|
+
for (const key of keys) {
|
|
167
|
+
if (!(key in tokens)) tokens[key as `--${string}`] = "initial";
|
|
168
|
+
}
|
|
169
|
+
return tokens;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* A theme's roles, values and tokens. The default theme is written twice:
|
|
174
|
+
* unscoped, so it applies with no attribute, and inside `@scope`, like every
|
|
175
|
+
* other theme, so the nearest `data-app-theme` ancestor wins by scope proximity.
|
|
176
|
+
* Only `allThemes` in the same stylesheet need resets against each other.
|
|
177
|
+
*/
|
|
178
|
+
export function themeCss(
|
|
179
|
+
theme: ThemeDefinition,
|
|
180
|
+
allThemes: readonly ThemeDefinition[] = [theme],
|
|
181
|
+
): string {
|
|
182
|
+
const sections: string[] = [GENERATED_HEADER];
|
|
183
|
+
const baseSelectors = (root: string) =>
|
|
184
|
+
theme.readsScales ? [root, ...COLOR_SCOPES].join(",\n") : root;
|
|
185
|
+
const appearanceKeys = new Set(
|
|
186
|
+
allThemes.flatMap((other) => [
|
|
187
|
+
...Object.keys(other.base),
|
|
188
|
+
...Object.keys(other.dark),
|
|
189
|
+
...Object.keys(other.light),
|
|
190
|
+
]),
|
|
191
|
+
);
|
|
192
|
+
const tokenKeys = new Set(
|
|
193
|
+
allThemes.flatMap((other) => Object.keys(other.tokens)),
|
|
194
|
+
);
|
|
195
|
+
|
|
196
|
+
if (theme.isDefault) {
|
|
197
|
+
sections.push(block(baseSelectors(":root"), theme.base));
|
|
198
|
+
sections.push(block(".dark", theme.dark));
|
|
199
|
+
sections.push(block(".light", theme.light));
|
|
200
|
+
sections.push(block(":root", theme.tokens));
|
|
201
|
+
sections.push(
|
|
202
|
+
block(ROOT_LIGHT_SCALES, {
|
|
203
|
+
...theme.palette.light.srgb,
|
|
204
|
+
...colorScopeTokens("brand"),
|
|
205
|
+
}),
|
|
206
|
+
);
|
|
207
|
+
sections.push(
|
|
208
|
+
block(ROOT_DARK_SCALES, {
|
|
209
|
+
...theme.palette.dark.srgb,
|
|
210
|
+
...colorScopeTokens("brand"),
|
|
211
|
+
}),
|
|
212
|
+
);
|
|
213
|
+
sections.push(
|
|
214
|
+
p3Block([
|
|
215
|
+
block(ROOT_LIGHT_SCALES, theme.palette.light.p3),
|
|
216
|
+
block(ROOT_DARK_SCALES, theme.palette.dark.p3),
|
|
217
|
+
]),
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const scoped = [
|
|
222
|
+
block(
|
|
223
|
+
baseSelectors(":scope"),
|
|
224
|
+
{ ...withResets(theme.base, appearanceKeys), ...theme.scopedOnly?.base },
|
|
225
|
+
" ",
|
|
226
|
+
),
|
|
227
|
+
block(
|
|
228
|
+
":scope.dark,\n.dark",
|
|
229
|
+
{ ...theme.dark, ...theme.scopedOnly?.dark },
|
|
230
|
+
" ",
|
|
231
|
+
),
|
|
232
|
+
block(":scope.light,\n.light", theme.light, " "),
|
|
233
|
+
block(":scope", withResets(theme.tokens, tokenKeys), " "),
|
|
234
|
+
block(
|
|
235
|
+
THEME_LIGHT_SCALES,
|
|
236
|
+
{ ...theme.palette.light.srgb, ...colorScopeTokens("brand") },
|
|
237
|
+
" ",
|
|
238
|
+
),
|
|
239
|
+
block(
|
|
240
|
+
THEME_DARK_SCALES,
|
|
241
|
+
{ ...theme.palette.dark.srgb, ...colorScopeTokens("brand") },
|
|
242
|
+
" ",
|
|
243
|
+
),
|
|
244
|
+
p3Block([
|
|
245
|
+
block(THEME_LIGHT_SCALES, theme.palette.light.p3),
|
|
246
|
+
block(THEME_DARK_SCALES, theme.palette.dark.p3),
|
|
247
|
+
])
|
|
248
|
+
.split("\n")
|
|
249
|
+
.map((line) => ` ${line}`)
|
|
250
|
+
.join("\n"),
|
|
251
|
+
].filter(Boolean);
|
|
252
|
+
sections.push(
|
|
253
|
+
`@scope ([data-app-theme="${theme.name}"]) {\n${scoped.join("\n\n")}\n}`,
|
|
254
|
+
);
|
|
255
|
+
|
|
256
|
+
return `${sections.filter(Boolean).join("\n\n")}\n`;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* The color tints (`data-appearance` on the root) as overrides of the active
|
|
261
|
+
* theme's own values, so roles and the shadcn aliases both follow them. More
|
|
262
|
+
* specific than any theme's root rules, in either appearance; the Agent-Native
|
|
263
|
+
* theme opts out.
|
|
264
|
+
*/
|
|
265
|
+
export function appearancesCss(): string {
|
|
266
|
+
const slots: ReadonlySet<string> = new Set(SHADCN_SLOTS);
|
|
267
|
+
const own = (values: Readonly<Record<string, string>>): TokenMap => {
|
|
268
|
+
const tokens: TokenMap = {};
|
|
269
|
+
for (const [slot, value] of Object.entries(values)) {
|
|
270
|
+
if (!slots.has(slot)) {
|
|
271
|
+
throw new Error(`Appearance value "${slot}" is not a theme slot`);
|
|
272
|
+
}
|
|
273
|
+
tokens[`--theme-${slot}`] = value;
|
|
274
|
+
}
|
|
275
|
+
return tokens;
|
|
276
|
+
};
|
|
277
|
+
const sections: string[] = [GENERATED_HEADER];
|
|
278
|
+
const optOut = ':not([data-app-theme="agent-native"])';
|
|
279
|
+
for (const [name, { light, dark }] of Object.entries(APPEARANCES)) {
|
|
280
|
+
sections.push(
|
|
281
|
+
block(`:root[data-appearance="${name}"]${optOut}`, own(light)),
|
|
282
|
+
);
|
|
283
|
+
sections.push(
|
|
284
|
+
block(`:root.dark[data-appearance="${name}"]${optOut}`, own(dark)),
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
return `${sections.join("\n\n")}\n`;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export interface PaletteCssOptions {
|
|
291
|
+
/** The `data-palette` value the CSS applies under. */
|
|
292
|
+
id: string;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Color scales generated from a brand color, scoped to `[data-palette="<id>"]`,
|
|
297
|
+
* for a build step or a runtime `<style>` element. They restyle roles that
|
|
298
|
+
* read the scales (the baseline theme's); a palette theme's colors are its
|
|
299
|
+
* own values.
|
|
300
|
+
*/
|
|
301
|
+
export function paletteCss(
|
|
302
|
+
palette: Palette,
|
|
303
|
+
{ id }: PaletteCssOptions,
|
|
304
|
+
): string {
|
|
305
|
+
if (!/^[a-z0-9-]+$/i.test(id)) {
|
|
306
|
+
throw new TypeError(`Palette id must be alphanumeric with dashes: ${id}`);
|
|
307
|
+
}
|
|
308
|
+
const scope = `[data-palette="${id}"]`;
|
|
309
|
+
const light = [scope, `${scope} .light`].join(",\n");
|
|
310
|
+
const dark = [`.dark${scope}`, `.dark ${scope}`, `${scope} .dark`].join(
|
|
311
|
+
",\n",
|
|
312
|
+
);
|
|
313
|
+
return [
|
|
314
|
+
block(light, palette.light.srgb),
|
|
315
|
+
block(dark, palette.dark.srgb),
|
|
316
|
+
p3Block([block(light, palette.light.p3), block(dark, palette.dark.p3)]),
|
|
317
|
+
].join("\n\n");
|
|
318
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { appearancesCss, themeCss, tokensCss } from "./css.js";
|
|
2
|
+
import { agentNativeTheme, THEMES } from "./themes/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Every generated stylesheet, keyed by its path under `css/`. Each theme has
|
|
6
|
+
* its own file: an app loads the default theme (through toolkit) and its own,
|
|
7
|
+
* so a theme resets only what the default sets.
|
|
8
|
+
*/
|
|
9
|
+
export function generatedStylesheets(): Record<string, string> {
|
|
10
|
+
const files: Record<string, string> = {
|
|
11
|
+
"tokens.css": tokensCss(),
|
|
12
|
+
"appearances.css": appearancesCss(),
|
|
13
|
+
};
|
|
14
|
+
for (const theme of THEMES) {
|
|
15
|
+
files[`themes/${theme.name}.css`] = themeCss(
|
|
16
|
+
theme,
|
|
17
|
+
theme.isDefault ? [theme] : [agentNativeTheme, theme],
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
return files;
|
|
21
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./catalog/index.js";
|
|
2
|
+
export * from "./tokens/color/index.js";
|
|
3
|
+
export * from "./css.js";
|
|
4
|
+
export * from "./model/index.js";
|
|
5
|
+
export * from "./themes/index.js";
|
|
6
|
+
export * from "./tokens/palette.js";
|
|
7
|
+
export * from "./tokens/primitives.js";
|
|
8
|
+
export * from "./tokens/roles.js";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { RowSnapshot } from "./dom.js";
|
|
2
|
+
|
|
3
|
+
export type RowField = Exclude<keyof RowSnapshot, "id">;
|
|
4
|
+
|
|
5
|
+
export type RowDifference =
|
|
6
|
+
| { rowId: string; field: "missing"; reference: RowSnapshot }
|
|
7
|
+
| { rowId: string; field: "extra"; ours: RowSnapshot }
|
|
8
|
+
| {
|
|
9
|
+
rowId: string;
|
|
10
|
+
field: RowField;
|
|
11
|
+
ours: RowSnapshot[RowField];
|
|
12
|
+
reference: RowSnapshot[RowField];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A difference a part set makes on purpose. `rowId` "*" accepts it on every
|
|
17
|
+
* row. A reason is required: an unexplained exception is how the two sets
|
|
18
|
+
* drift apart without anyone deciding they should.
|
|
19
|
+
*/
|
|
20
|
+
export interface AcceptedRowDifference {
|
|
21
|
+
rowId: string;
|
|
22
|
+
field: RowField | "missing" | "extra";
|
|
23
|
+
reason: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface EquivalenceReport {
|
|
27
|
+
compared: number;
|
|
28
|
+
differences: RowDifference[];
|
|
29
|
+
accepted: Array<RowDifference & { reason: string }>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const FIELDS: readonly RowField[] = [
|
|
33
|
+
"part",
|
|
34
|
+
"parentId",
|
|
35
|
+
"position",
|
|
36
|
+
"kind",
|
|
37
|
+
"name",
|
|
38
|
+
"selected",
|
|
39
|
+
"checked",
|
|
40
|
+
"expanded",
|
|
41
|
+
"disabled",
|
|
42
|
+
"pending",
|
|
43
|
+
"value",
|
|
44
|
+
"effect",
|
|
45
|
+
"badge",
|
|
46
|
+
"slot",
|
|
47
|
+
"regions",
|
|
48
|
+
"hosts",
|
|
49
|
+
"complete",
|
|
50
|
+
];
|
|
51
|
+
|
|
52
|
+
function indexById(rows: readonly RowSnapshot[], side: string) {
|
|
53
|
+
const byId = new Map<string, RowSnapshot>();
|
|
54
|
+
for (const row of rows) {
|
|
55
|
+
if (!row.id) throw new Error(`A ${side} row has no data-row-id value`);
|
|
56
|
+
if (byId.has(row.id)) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
`Row ${row.id} is rendered twice by the ${side} part set`,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
byId.set(row.id, row);
|
|
62
|
+
}
|
|
63
|
+
return byId;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Structural equivalence of two renders of the same model: the same rows, in
|
|
68
|
+
* the same tree and order, with the same names, kinds, states, effects,
|
|
69
|
+
* badges, slots and regions. Never visual: the part sets are meant to look different.
|
|
70
|
+
*/
|
|
71
|
+
export function compareRowSnapshots(
|
|
72
|
+
ours: readonly RowSnapshot[],
|
|
73
|
+
reference: readonly RowSnapshot[],
|
|
74
|
+
accepted: readonly AcceptedRowDifference[] = [],
|
|
75
|
+
): EquivalenceReport {
|
|
76
|
+
for (const entry of accepted) {
|
|
77
|
+
if (entry.reason.trim().length < 10) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
`Accepted difference ${entry.rowId} ${entry.field} needs a reason of 10+ characters`,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const oursById = indexById(ours, "our");
|
|
84
|
+
const referenceById = indexById(reference, "reference");
|
|
85
|
+
const all: RowDifference[] = [];
|
|
86
|
+
|
|
87
|
+
for (const [rowId, referenceRow] of referenceById) {
|
|
88
|
+
const ourRow = oursById.get(rowId);
|
|
89
|
+
if (!ourRow) {
|
|
90
|
+
all.push({ rowId, field: "missing", reference: referenceRow });
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
for (const field of FIELDS) {
|
|
94
|
+
if (ourRow[field] !== referenceRow[field]) {
|
|
95
|
+
all.push({
|
|
96
|
+
rowId,
|
|
97
|
+
field,
|
|
98
|
+
ours: ourRow[field],
|
|
99
|
+
reference: referenceRow[field],
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
for (const [rowId, ourRow] of oursById) {
|
|
105
|
+
if (!referenceById.has(rowId))
|
|
106
|
+
all.push({ rowId, field: "extra", ours: ourRow });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const reasonFor = (difference: RowDifference) =>
|
|
110
|
+
accepted.find(
|
|
111
|
+
(entry) =>
|
|
112
|
+
(entry.rowId === "*" || entry.rowId === difference.rowId) &&
|
|
113
|
+
entry.field === difference.field,
|
|
114
|
+
)?.reason;
|
|
115
|
+
|
|
116
|
+
const report: EquivalenceReport = {
|
|
117
|
+
compared: referenceById.size,
|
|
118
|
+
differences: [],
|
|
119
|
+
accepted: [],
|
|
120
|
+
};
|
|
121
|
+
for (const difference of all) {
|
|
122
|
+
const reason = reasonFor(difference);
|
|
123
|
+
if (reason === undefined) report.differences.push(difference);
|
|
124
|
+
else report.accepted.push({ ...difference, reason });
|
|
125
|
+
}
|
|
126
|
+
return report;
|
|
127
|
+
}
|