@axiom-lattice/protocols 7.4.0 → 7.5.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,1562 @@
1
+ import type { PlatformBranding } from "./PlatformSettingsProtocol";
2
+
3
+ /**
4
+ * Structured branding field registry.
5
+ *
6
+ * Every layer (gateway validation, client hydration, Admin controls, auth
7
+ * preview, Ops schemas) derives its field list and validation kind from this
8
+ * module. Adding a field here is the only required change for those layers.
9
+ */
10
+
11
+ /** Auth surfaces that share the same CSS contract. */
12
+ export const AUTH_SURFACE_KINDS = [
13
+ "login",
14
+ "register",
15
+ "invite",
16
+ "oidc-email",
17
+ "tenant-select",
18
+ "platform-admin-login",
19
+ ] as const;
20
+
21
+ export type AuthSurfaceKind = (typeof AUTH_SURFACE_KINDS)[number];
22
+
23
+ /** Structured login layout identifiers. */
24
+ export const LOGIN_LAYOUT_IDS = [
25
+ "centered",
26
+ "split-brand",
27
+ "split-story",
28
+ "split-showcase",
29
+ "centered-editorial",
30
+ "full-bleed",
31
+ ] as const;
32
+
33
+ export type LoginLayoutId = (typeof LOGIN_LAYOUT_IDS)[number];
34
+
35
+ /** Built-in font presets; arbitrary families belong in `customCss`. */
36
+ export const AUTH_FONT_FAMILY_IDS = ["system", "inter", "serif", "mono"] as const;
37
+
38
+ export type AuthFontFamilyId = (typeof AUTH_FONT_FAMILY_IDS)[number];
39
+
40
+ export interface AuthFontFamilyDefinition {
41
+ labelKey: string;
42
+ stack: string;
43
+ }
44
+
45
+ export const AUTH_FONT_FAMILIES: Record<
46
+ AuthFontFamilyId,
47
+ AuthFontFamilyDefinition
48
+ > = {
49
+ system: {
50
+ labelKey: "platformAdmin.settings.branding.font.system",
51
+ stack:
52
+ 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
53
+ },
54
+ inter: {
55
+ labelKey: "platformAdmin.settings.branding.font.inter",
56
+ stack:
57
+ 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
58
+ },
59
+ serif: {
60
+ labelKey: "platformAdmin.settings.branding.font.serif",
61
+ stack: 'Georgia, "Times New Roman", Times, serif',
62
+ },
63
+ mono: {
64
+ labelKey: "platformAdmin.settings.branding.font.mono",
65
+ stack:
66
+ '"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace',
67
+ },
68
+ };
69
+
70
+ export const AUTH_SLOT_IDS = [
71
+ "logo",
72
+ "eyebrow",
73
+ "headline",
74
+ "description",
75
+ "points",
76
+ "stats",
77
+ "quote",
78
+ "trustLogos",
79
+ "productShot",
80
+ "media",
81
+ "footerNote",
82
+ "form",
83
+ ] as const;
84
+
85
+ export type AuthSlotId = (typeof AUTH_SLOT_IDS)[number];
86
+
87
+ export type PlatformBrandingFieldKind =
88
+ | "text"
89
+ | "asset-url"
90
+ | "video-url"
91
+ | "color"
92
+ | "css"
93
+ | "enum"
94
+ | "percent"
95
+ | "integer";
96
+
97
+ export interface PlatformBrandingFieldDefinition {
98
+ kind: PlatformBrandingFieldKind;
99
+ maxLength?: number;
100
+ values?: readonly string[];
101
+ min?: number;
102
+ max?: number;
103
+ /** Layouts that own this field. Omitted means every layout. */
104
+ layouts?: readonly LoginLayoutId[];
105
+ }
106
+
107
+ /**
108
+ * The single source of truth for structured branding fields.
109
+ *
110
+ * `background*` fields are page-level: `centered` uses image/overlay and
111
+ * `full-bleed` uses image or video. `panel*` fields belong to split-brand.
112
+ */
113
+ export const PLATFORM_BRANDING_FIELDS = {
114
+ brandName: { kind: "text", maxLength: 80 },
115
+ logoUrl: { kind: "asset-url" },
116
+ faviconUrl: { kind: "asset-url" },
117
+ primaryColor: { kind: "color" },
118
+ backgroundColor: { kind: "color" },
119
+ loginTitle: { kind: "text", maxLength: 200 },
120
+ loginSubtitle: { kind: "text", maxLength: 200 },
121
+ footerNote: {
122
+ kind: "text",
123
+ maxLength: 160,
124
+ layouts: ["centered", "centered-editorial", "full-bleed"],
125
+ },
126
+ customCss: { kind: "css", maxLength: 65536 },
127
+ loginLayout: { kind: "enum", values: LOGIN_LAYOUT_IDS },
128
+ cardStyle: {
129
+ kind: "enum",
130
+ values: ["card", "plain", "glass", "outline"],
131
+ },
132
+ cardPosition: {
133
+ kind: "enum",
134
+ values: ["center", "left", "right"],
135
+ layouts: ["full-bleed"],
136
+ },
137
+ surfaceColor: { kind: "color" },
138
+ textColor: { kind: "color" },
139
+ textSecondaryColor: { kind: "color" },
140
+ borderColor: { kind: "color" },
141
+ radius: { kind: "integer", min: 0, max: 40 },
142
+ fontFamily: { kind: "enum", values: AUTH_FONT_FAMILY_IDS },
143
+ fieldStyle: {
144
+ kind: "enum",
145
+ values: ["soft", "outline", "filled", "underline", "none"],
146
+ },
147
+ logoSize: { kind: "integer", min: 32, max: 96 },
148
+ titleSize: { kind: "integer", min: 18, max: 56 },
149
+ bodySize: { kind: "integer", min: 12, max: 20 },
150
+ pagePadding: { kind: "integer", min: 12, max: 48 },
151
+ cardPadding: { kind: "integer", min: 16, max: 48 },
152
+ cardWidth: { kind: "integer", min: 320, max: 560 },
153
+ cardShadow: {
154
+ kind: "enum",
155
+ values: ["none", "soft", "floating", "hard"],
156
+ },
157
+ cardEffect: {
158
+ kind: "enum",
159
+ values: ["none", "gradient-border", "inner-glow"],
160
+ },
161
+ logoStyle: { kind: "enum", values: ["plain", "badge"] },
162
+ formDensity: {
163
+ kind: "enum",
164
+ values: ["compact", "comfortable", "airy"],
165
+ },
166
+ ssoLayout: { kind: "enum", values: ["stack", "inline"] },
167
+ backgroundPattern: {
168
+ kind: "enum",
169
+ values: ["none", "grid", "dots", "aurora"],
170
+ layouts: ["centered", "full-bleed"],
171
+ },
172
+ backgroundTreatment: {
173
+ kind: "enum",
174
+ values: ["none", "vignette", "grain", "duotone"],
175
+ layouts: ["centered", "full-bleed"],
176
+ },
177
+ imageFit: { kind: "enum", values: ["cover", "contain"] },
178
+ imagePosition: {
179
+ kind: "enum",
180
+ values: ["center", "top", "bottom", "left", "right"],
181
+ },
182
+ imageTreatment: {
183
+ kind: "enum",
184
+ values: ["none", "grayscale", "duotone"],
185
+ },
186
+
187
+ panelPosition: {
188
+ kind: "enum",
189
+ values: ["left", "right"],
190
+ layouts: ["split-brand", "split-showcase"],
191
+ },
192
+ panelContentAlign: {
193
+ kind: "enum",
194
+ values: ["left", "center"],
195
+ layouts: ["split-brand", "split-showcase"],
196
+ },
197
+ panelVisual: {
198
+ kind: "enum",
199
+ values: ["orbit", "mesh", "waves", "aurora", "topography", "none"],
200
+ layouts: ["split-brand", "split-showcase"],
201
+ },
202
+ panelTitle: {
203
+ kind: "text",
204
+ maxLength: 120,
205
+ layouts: ["split-brand", "split-showcase"],
206
+ },
207
+ panelDescription: {
208
+ kind: "text",
209
+ maxLength: 240,
210
+ layouts: ["split-brand", "split-showcase"],
211
+ },
212
+ panelPoint1: {
213
+ kind: "text",
214
+ maxLength: 60,
215
+ layouts: ["split-brand", "split-showcase"],
216
+ },
217
+ panelPoint2: {
218
+ kind: "text",
219
+ maxLength: 60,
220
+ layouts: ["split-brand", "split-showcase"],
221
+ },
222
+ panelPoint3: {
223
+ kind: "text",
224
+ maxLength: 60,
225
+ layouts: ["split-brand", "split-showcase"],
226
+ },
227
+ panelImageUrl: { kind: "asset-url", layouts: ["split-brand"] },
228
+ panelVideoUrl: { kind: "video-url", layouts: ["split-brand"] },
229
+
230
+ panelProductImageUrl: {
231
+ kind: "asset-url",
232
+ layouts: ["split-showcase"],
233
+ },
234
+ panelProductImageAlt: {
235
+ kind: "text",
236
+ maxLength: 120,
237
+ layouts: ["split-showcase"],
238
+ },
239
+
240
+ panelEyebrow: {
241
+ kind: "text",
242
+ maxLength: 80,
243
+ layouts: ["split-story", "split-showcase", "centered-editorial"],
244
+ },
245
+ panelStat1Value: { kind: "text", maxLength: 20, layouts: ["split-story"] },
246
+ panelStat1Label: { kind: "text", maxLength: 40, layouts: ["split-story"] },
247
+ panelStat2Value: { kind: "text", maxLength: 20, layouts: ["split-story"] },
248
+ panelStat2Label: { kind: "text", maxLength: 40, layouts: ["split-story"] },
249
+ panelStat3Value: { kind: "text", maxLength: 20, layouts: ["split-story"] },
250
+ panelStat3Label: { kind: "text", maxLength: 40, layouts: ["split-story"] },
251
+ panelQuote: { kind: "text", maxLength: 240, layouts: ["split-story"] },
252
+ panelQuoteAuthor: { kind: "text", maxLength: 80, layouts: ["split-story"] },
253
+ panelQuoteRole: { kind: "text", maxLength: 80, layouts: ["split-story"] },
254
+ panelTrustLogo1: { kind: "asset-url", layouts: ["split-story", "split-showcase", "centered-editorial"] },
255
+ panelTrustLogo2: { kind: "asset-url", layouts: ["split-story", "split-showcase", "centered-editorial"] },
256
+ panelTrustLogo3: { kind: "asset-url", layouts: ["split-story", "split-showcase", "centered-editorial"] },
257
+ panelTrustLogo4: { kind: "asset-url", layouts: ["split-story", "split-showcase", "centered-editorial"] },
258
+
259
+ backgroundImageUrl: {
260
+ kind: "asset-url",
261
+ layouts: ["centered", "full-bleed"],
262
+ },
263
+ backgroundVideoUrl: { kind: "video-url", layouts: ["full-bleed"] },
264
+ backgroundOverlayColor: {
265
+ kind: "color",
266
+ layouts: ["centered", "full-bleed"],
267
+ },
268
+ backgroundOverlayOpacity: {
269
+ kind: "percent",
270
+ min: 0,
271
+ max: 100,
272
+ layouts: ["centered", "full-bleed"],
273
+ },
274
+ } as const satisfies Record<string, PlatformBrandingFieldDefinition>;
275
+
276
+ export type PlatformBrandingField = keyof typeof PLATFORM_BRANDING_FIELDS;
277
+
278
+ /** Stable field order used by hydration, validation, and UI rendering. */
279
+ export const PLATFORM_BRANDING_FIELD_KEYS = Object.keys(
280
+ PLATFORM_BRANDING_FIELDS,
281
+ ) as PlatformBrandingField[];
282
+ export interface AuthSlotDefinition {
283
+ fields: readonly PlatformBrandingField[];
284
+ layouts: readonly LoginLayoutId[];
285
+ renderer: string;
286
+ required?: boolean;
287
+ empty?: "hide" | "always";
288
+ }
289
+
290
+ /** Slot registry: the single source for layout composition and capability docs. */
291
+ export const AUTH_SLOT_REGISTRY = {
292
+ logo: {
293
+ fields: ["logoUrl"],
294
+ layouts: LOGIN_LAYOUT_IDS,
295
+ renderer: "LogoSlot",
296
+ empty: "hide",
297
+ },
298
+ eyebrow: {
299
+ fields: ["panelEyebrow"],
300
+ layouts: ["split-story", "split-showcase", "centered-editorial"],
301
+ renderer: "EyebrowSlot",
302
+ empty: "hide",
303
+ },
304
+ headline: {
305
+ fields: ["panelTitle", "loginTitle", "brandName"],
306
+ layouts: LOGIN_LAYOUT_IDS,
307
+ renderer: "HeadlineSlot",
308
+ empty: "hide",
309
+ },
310
+ description: {
311
+ fields: ["panelDescription", "loginSubtitle"],
312
+ layouts: LOGIN_LAYOUT_IDS,
313
+ renderer: "DescriptionSlot",
314
+ empty: "hide",
315
+ },
316
+ points: {
317
+ fields: ["panelPoint1", "panelPoint2", "panelPoint3"],
318
+ layouts: ["split-brand", "split-story", "split-showcase"],
319
+ renderer: "PointsSlot",
320
+ empty: "hide",
321
+ },
322
+ stats: {
323
+ fields: [
324
+ "panelStat1Value",
325
+ "panelStat1Label",
326
+ "panelStat2Value",
327
+ "panelStat2Label",
328
+ "panelStat3Value",
329
+ "panelStat3Label",
330
+ ],
331
+ layouts: ["split-story"],
332
+ renderer: "StatsSlot",
333
+ empty: "hide",
334
+ },
335
+ quote: {
336
+ fields: ["panelQuote", "panelQuoteAuthor", "panelQuoteRole"],
337
+ layouts: ["split-story"],
338
+ renderer: "QuoteSlot",
339
+ empty: "hide",
340
+ },
341
+ trustLogos: {
342
+ fields: [
343
+ "panelTrustLogo1",
344
+ "panelTrustLogo2",
345
+ "panelTrustLogo3",
346
+ "panelTrustLogo4",
347
+ ],
348
+ layouts: ["split-story", "split-showcase", "centered-editorial"],
349
+ renderer: "TrustLogosSlot",
350
+ empty: "hide",
351
+ },
352
+ productShot: {
353
+ fields: ["panelProductImageUrl", "panelProductImageAlt"],
354
+ layouts: ["split-showcase"],
355
+ renderer: "ProductShotSlot",
356
+ empty: "hide",
357
+ },
358
+ media: {
359
+ fields: [
360
+ "panelImageUrl",
361
+ "panelVideoUrl",
362
+ "backgroundImageUrl",
363
+ "backgroundVideoUrl",
364
+ ],
365
+ layouts: ["split-brand", "split-story", "full-bleed"],
366
+ renderer: "MediaSlot",
367
+ empty: "hide",
368
+ },
369
+ footerNote: {
370
+ fields: ["footerNote"],
371
+ layouts: ["centered", "centered-editorial", "full-bleed"],
372
+ renderer: "FooterNoteSlot",
373
+ empty: "hide",
374
+ },
375
+ form: {
376
+ fields: [],
377
+ layouts: LOGIN_LAYOUT_IDS,
378
+ renderer: "FormSlot",
379
+ required: true,
380
+ empty: "always",
381
+ },
382
+ } as const satisfies Record<AuthSlotId, AuthSlotDefinition>;
383
+ export type PlatformBrandingFieldGroup =
384
+ | "brand"
385
+ | "layout"
386
+ | "color"
387
+ | "type"
388
+ | "spacing"
389
+ | "surface"
390
+ | "background"
391
+ | "media"
392
+ | "panel"
393
+ | "content"
394
+ | "advanced";
395
+
396
+ /** UI grouping for the field registry; exhaustive over every field. */
397
+ export const PLATFORM_BRANDING_FIELD_GROUPS = {
398
+ brandName: "brand",
399
+ logoUrl: "brand",
400
+ faviconUrl: "brand",
401
+ primaryColor: "color",
402
+ backgroundColor: "color",
403
+ loginTitle: "content",
404
+ loginSubtitle: "content",
405
+ footerNote: "content",
406
+ customCss: "advanced",
407
+ loginLayout: "layout",
408
+ cardStyle: "surface",
409
+ cardPosition: "layout",
410
+ surfaceColor: "color",
411
+ textColor: "color",
412
+ textSecondaryColor: "color",
413
+ borderColor: "color",
414
+ radius: "surface",
415
+ fontFamily: "type",
416
+ fieldStyle: "surface",
417
+ logoSize: "brand",
418
+ titleSize: "type",
419
+ bodySize: "type",
420
+ pagePadding: "spacing",
421
+ cardPadding: "spacing",
422
+ cardWidth: "spacing",
423
+ cardShadow: "surface",
424
+ cardEffect: "surface",
425
+ logoStyle: "brand",
426
+ formDensity: "spacing",
427
+ ssoLayout: "spacing",
428
+ backgroundPattern: "background",
429
+ backgroundTreatment: "background",
430
+ imageFit: "media",
431
+ imagePosition: "media",
432
+ imageTreatment: "media",
433
+ panelPosition: "layout",
434
+ panelContentAlign: "layout",
435
+ panelVisual: "layout",
436
+ panelTitle: "panel",
437
+ panelDescription: "panel",
438
+ panelPoint1: "panel",
439
+ panelPoint2: "panel",
440
+ panelPoint3: "panel",
441
+ panelImageUrl: "panel",
442
+ panelVideoUrl: "panel",
443
+ panelEyebrow: "panel",
444
+ panelStat1Value: "panel",
445
+ panelStat1Label: "panel",
446
+ panelStat2Value: "panel",
447
+ panelStat2Label: "panel",
448
+ panelStat3Value: "panel",
449
+ panelStat3Label: "panel",
450
+ panelQuote: "panel",
451
+ panelQuoteAuthor: "panel",
452
+ panelQuoteRole: "panel",
453
+ panelTrustLogo1: "panel",
454
+ panelTrustLogo2: "panel",
455
+ panelTrustLogo3: "panel",
456
+ panelTrustLogo4: "panel",
457
+ panelProductImageUrl: "panel",
458
+ panelProductImageAlt: "panel",
459
+ backgroundImageUrl: "background",
460
+ backgroundVideoUrl: "background",
461
+ backgroundOverlayColor: "background",
462
+ backgroundOverlayOpacity: "background",
463
+ } as const satisfies Record<PlatformBrandingField, PlatformBrandingFieldGroup>;
464
+
465
+ export const PLATFORM_BRANDING_FIELD_GROUP_ORDER = [
466
+ "layout",
467
+ "brand",
468
+ "color",
469
+ "type",
470
+ "spacing",
471
+ "surface",
472
+ "background",
473
+ "media",
474
+ "panel",
475
+ "content",
476
+ "advanced",
477
+ ] as const satisfies readonly PlatformBrandingFieldGroup[];
478
+
479
+ /**
480
+ * Visual fields reset when applying a style preset. Copy/content fields are
481
+ * preserved so a preset never overwrites the user's brand name or text.
482
+ */
483
+ export const AUTH_BRANDING_PRESET_RESET_FIELDS = [
484
+ "loginLayout",
485
+ "cardStyle",
486
+ "cardPosition",
487
+ "surfaceColor",
488
+ "primaryColor",
489
+ "backgroundColor",
490
+ "textColor",
491
+ "textSecondaryColor",
492
+ "borderColor",
493
+ "radius",
494
+ "fontFamily",
495
+ "fieldStyle",
496
+ "logoSize",
497
+ "titleSize",
498
+ "bodySize",
499
+ "pagePadding",
500
+ "cardPadding",
501
+ "cardWidth",
502
+ "cardShadow",
503
+ "cardEffect",
504
+ "logoStyle",
505
+ "formDensity",
506
+ "ssoLayout",
507
+ "backgroundPattern",
508
+ "backgroundTreatment",
509
+ "imageFit",
510
+ "imagePosition",
511
+ "imageTreatment",
512
+ "panelPosition",
513
+ "panelContentAlign",
514
+ "panelVisual",
515
+ "backgroundImageUrl",
516
+ "backgroundVideoUrl",
517
+ "backgroundOverlayColor",
518
+ "backgroundOverlayOpacity",
519
+ "panelImageUrl",
520
+ "panelVideoUrl",
521
+ ] as const satisfies readonly PlatformBrandingField[];
522
+
523
+ function keysOfKind(kind: PlatformBrandingFieldKind): PlatformBrandingField[] {
524
+ return PLATFORM_BRANDING_FIELD_KEYS.filter(
525
+ (key) => PLATFORM_BRANDING_FIELDS[key].kind === kind,
526
+ );
527
+ }
528
+
529
+ export const BRANDING_TEXT_KEYS = keysOfKind("text");
530
+ export const BRANDING_ASSET_URL_KEYS = keysOfKind("asset-url");
531
+ export const BRANDING_VIDEO_URL_KEYS = keysOfKind("video-url");
532
+ export const BRANDING_COLOR_KEYS = keysOfKind("color");
533
+ export const BRANDING_CSS_KEYS = keysOfKind("css");
534
+ export const BRANDING_ENUM_KEYS = keysOfKind("enum");
535
+ export const BRANDING_PERCENT_KEYS = keysOfKind("percent");
536
+ export const BRANDING_INTEGER_KEYS = keysOfKind("integer");
537
+
538
+ export interface LoginLayoutDefinition {
539
+ id: LoginLayoutId;
540
+ labelKey: string;
541
+ supports: readonly AuthSurfaceKind[];
542
+ fields: readonly PlatformBrandingField[];
543
+ slots: readonly AuthSlotId[];
544
+ parts: readonly string[];
545
+ }
546
+
547
+ export const DEFAULT_LOGIN_LAYOUT: LoginLayoutId = "centered";
548
+
549
+ const BRAND_PANEL_SUPPORTS = [
550
+ "login",
551
+ "register",
552
+ "platform-admin-login",
553
+ ] as const satisfies readonly AuthSurfaceKind[];
554
+
555
+ export const LOGIN_LAYOUTS: Record<LoginLayoutId, LoginLayoutDefinition> = {
556
+ centered: {
557
+ id: "centered",
558
+ labelKey: "platformAdmin.settings.branding.layout.centered",
559
+ supports: AUTH_SURFACE_KINDS,
560
+ slots: ["logo", "headline", "description", "footerNote", "form"],
561
+ fields: [
562
+ "backgroundImageUrl",
563
+ "backgroundPattern",
564
+ "backgroundTreatment",
565
+ "backgroundOverlayColor",
566
+ "backgroundOverlayOpacity",
567
+ "footerNote",
568
+ ],
569
+ parts: [
570
+ "page",
571
+ "auth-panel",
572
+ "card",
573
+ "header",
574
+ "logo",
575
+ "logo-image",
576
+ "title",
577
+ "subtitle",
578
+ "sso-button",
579
+ "divider",
580
+ "form",
581
+ "field",
582
+ "input",
583
+ "submit",
584
+ "alert",
585
+ "footer",
586
+ "link",
587
+ "cancel",
588
+ ],
589
+ },
590
+ "split-brand": {
591
+ id: "split-brand",
592
+ labelKey: "platformAdmin.settings.branding.layout.splitBrand",
593
+ supports: BRAND_PANEL_SUPPORTS,
594
+ slots: ["logo", "headline", "description", "points", "media", "form"],
595
+ fields: [
596
+ "panelPosition",
597
+ "panelContentAlign",
598
+ "panelVisual",
599
+ "panelTitle",
600
+ "panelDescription",
601
+ "panelPoint1",
602
+ "panelPoint2",
603
+ "panelPoint3",
604
+ "panelImageUrl",
605
+ "panelVideoUrl",
606
+ ],
607
+ parts: [
608
+ "page",
609
+ "auth-layout",
610
+ "brand-panel",
611
+ "brand-name",
612
+ "panel-title",
613
+ "panel-description",
614
+ "panel-points",
615
+ "panel-point",
616
+ "panel-graphic",
617
+ "panel-image",
618
+ "panel-video",
619
+ "auth-panel",
620
+ "card",
621
+ ],
622
+ },
623
+ "split-story": {
624
+ id: "split-story",
625
+ labelKey: "platformAdmin.settings.branding.layout.splitStory",
626
+ supports: BRAND_PANEL_SUPPORTS,
627
+ slots: [
628
+ "logo",
629
+ "eyebrow",
630
+ "headline",
631
+ "description",
632
+ "points",
633
+ "stats",
634
+ "quote",
635
+ "trustLogos",
636
+ "media",
637
+ "form",
638
+ ],
639
+ fields: [
640
+ "panelPosition",
641
+ "panelContentAlign",
642
+ "panelVisual",
643
+ "panelEyebrow",
644
+ "panelTitle",
645
+ "panelDescription",
646
+ "panelPoint1",
647
+ "panelPoint2",
648
+ "panelPoint3",
649
+ "panelStat1Value",
650
+ "panelStat1Label",
651
+ "panelStat2Value",
652
+ "panelStat2Label",
653
+ "panelStat3Value",
654
+ "panelStat3Label",
655
+ "panelQuote",
656
+ "panelQuoteAuthor",
657
+ "panelQuoteRole",
658
+ "panelTrustLogo1",
659
+ "panelTrustLogo2",
660
+ "panelTrustLogo3",
661
+ "panelTrustLogo4",
662
+ "panelImageUrl",
663
+ "panelVideoUrl",
664
+ ],
665
+ parts: [
666
+ "page",
667
+ "auth-layout",
668
+ "story-panel",
669
+ "story-panel-content",
670
+ "story-eyebrow",
671
+ "story-stats",
672
+ "story-stat",
673
+ "story-stat-value",
674
+ "story-stat-label",
675
+ "story-testimonial",
676
+ "story-quote",
677
+ "story-author",
678
+ "story-role",
679
+ "story-trust",
680
+ "story-trust-logo",
681
+ "brand-name",
682
+ "panel-title",
683
+ "panel-description",
684
+ "panel-points",
685
+ "panel-point",
686
+ "panel-graphic",
687
+ "panel-image",
688
+ "panel-video",
689
+ "auth-panel",
690
+ "card",
691
+ ],
692
+ },
693
+ "centered-editorial": {
694
+ id: "centered-editorial",
695
+ labelKey: "platformAdmin.settings.branding.layout.centeredEditorial",
696
+ supports: AUTH_SURFACE_KINDS,
697
+ slots: ["logo", "eyebrow", "headline", "description", "footerNote", "form", "trustLogos"],
698
+ fields: [
699
+ "panelEyebrow",
700
+ "footerNote",
701
+ "panelTrustLogo1",
702
+ "panelTrustLogo2",
703
+ "panelTrustLogo3",
704
+ "panelTrustLogo4",
705
+ ],
706
+ parts: [
707
+ "page",
708
+ "auth-panel",
709
+ "centered-editorial-header",
710
+ "editorial-eyebrow",
711
+ "editorial-headline",
712
+ "editorial-description",
713
+ "card",
714
+ "header",
715
+ "logo",
716
+ "logo-image",
717
+ "title",
718
+ "subtitle",
719
+ "form",
720
+ "field",
721
+ "input",
722
+ "submit",
723
+ "alert",
724
+ "footer",
725
+ "link",
726
+ "cancel",
727
+ "story-trust",
728
+ "story-trust-logo",
729
+ ],
730
+ },
731
+ "split-showcase": {
732
+ id: "split-showcase",
733
+ labelKey: "platformAdmin.settings.branding.layout.splitShowcase",
734
+ supports: BRAND_PANEL_SUPPORTS,
735
+ slots: [
736
+ "logo",
737
+ "eyebrow",
738
+ "headline",
739
+ "description",
740
+ "points",
741
+ "productShot",
742
+ "trustLogos",
743
+ "form",
744
+ ],
745
+ fields: [
746
+ "panelPosition",
747
+ "panelContentAlign",
748
+ "panelVisual",
749
+ "panelEyebrow",
750
+ "panelTitle",
751
+ "panelDescription",
752
+ "panelPoint1",
753
+ "panelPoint2",
754
+ "panelPoint3",
755
+ "panelProductImageUrl",
756
+ "panelProductImageAlt",
757
+ "panelTrustLogo1",
758
+ "panelTrustLogo2",
759
+ "panelTrustLogo3",
760
+ "panelTrustLogo4",
761
+ ],
762
+ parts: [
763
+ "page",
764
+ "auth-layout",
765
+ "showcase-panel",
766
+ "showcase-panel-content",
767
+ "showcase-eyebrow",
768
+ "product-frame",
769
+ "product-shot",
770
+ "brand-name",
771
+ "panel-title",
772
+ "panel-description",
773
+ "panel-points",
774
+ "panel-point",
775
+ "panel-graphic",
776
+ "story-trust",
777
+ "story-trust-logo",
778
+ "auth-panel",
779
+ "card",
780
+ ],
781
+ },
782
+ "full-bleed": {
783
+ id: "full-bleed",
784
+ labelKey: "platformAdmin.settings.branding.layout.fullBleed",
785
+ supports: BRAND_PANEL_SUPPORTS,
786
+ slots: ["logo", "media", "footerNote", "form"],
787
+ fields: [
788
+ "cardPosition",
789
+ "footerNote",
790
+ "backgroundImageUrl",
791
+ "backgroundVideoUrl",
792
+ "backgroundPattern",
793
+ "backgroundTreatment",
794
+ "backgroundOverlayColor",
795
+ "backgroundOverlayOpacity",
796
+ ],
797
+ parts: [
798
+ "page",
799
+ "background",
800
+ "background-image",
801
+ "background-video",
802
+ "background-overlay",
803
+ "auth-panel",
804
+ "card",
805
+ ],
806
+ },
807
+ };
808
+
809
+ export interface AuthBrandingPreset {
810
+ id: string;
811
+ labelKey: string;
812
+ descriptionKey: string;
813
+ branding: Partial<PlatformBranding>;
814
+ customCss?: string;
815
+ }
816
+
817
+ /**
818
+ * Curated starting points for the real auth preview.
819
+ *
820
+ * Presets are data, not freeform HTML: they set structured layout/token fields
821
+ * so the preview and the saved page always use the same renderer.
822
+ */
823
+ export const AUTH_BRANDING_PRESETS = {
824
+ classic: {
825
+ id: "classic",
826
+ labelKey: "platformAdmin.settings.branding.preset.classic.label",
827
+ descriptionKey: "platformAdmin.settings.branding.preset.classic.description",
828
+ branding: {
829
+ loginLayout: "centered",
830
+ cardStyle: "card",
831
+ primaryColor: "#4f46e5",
832
+ backgroundColor: "#f8fafc",
833
+ surfaceColor: "#ffffff",
834
+ textColor: "#0f172a",
835
+ textSecondaryColor: "#64748b",
836
+ borderColor: "#e2e8f0",
837
+ radius: 12,
838
+ fontFamily: "system",
839
+ },
840
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
841
+ background-image: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--axiom-auth-primary) 12%, transparent), transparent 42%);
842
+ }
843
+ #axiom-auth-root [data-axiom-part="card"] {
844
+ border-color: transparent;
845
+ box-shadow: 0 32px 80px -32px color-mix(in srgb, var(--axiom-auth-primary) 45%, transparent);
846
+ }`,
847
+ },
848
+ minimal: {
849
+ id: "minimal",
850
+ labelKey: "platformAdmin.settings.branding.preset.minimal.label",
851
+ descriptionKey: "platformAdmin.settings.branding.preset.minimal.description",
852
+ branding: {
853
+ loginLayout: "centered",
854
+ cardStyle: "plain",
855
+ primaryColor: "#111111",
856
+ backgroundColor: "#ffffff",
857
+ surfaceColor: "#ffffff",
858
+ textColor: "#111111",
859
+ textSecondaryColor: "#666666",
860
+ borderColor: "#e5e5e5",
861
+ radius: 0,
862
+ fontFamily: "system",
863
+ formDensity: "compact",
864
+ ssoLayout: "inline",
865
+ fieldStyle: "underline",
866
+ },
867
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
868
+ background-image: linear-gradient(180deg, #ffffff, #fafafa);
869
+ }
870
+ #axiom-auth-root [data-axiom-part="card"] {
871
+ border: 0;
872
+ box-shadow: none;
873
+ }
874
+ #axiom-auth-root [data-axiom-part="title"] {
875
+ letter-spacing: -0.04em;
876
+ }`,
877
+ },
878
+ editorial: {
879
+ id: "editorial",
880
+ labelKey: "platformAdmin.settings.branding.preset.editorial.label",
881
+ descriptionKey: "platformAdmin.settings.branding.preset.editorial.description",
882
+ branding: {
883
+ loginLayout: "split-brand",
884
+ panelPosition: "left",
885
+ panelContentAlign: "left",
886
+ panelVisual: "waves",
887
+ cardStyle: "card",
888
+ primaryColor: "#1f2937",
889
+ backgroundColor: "#f5f1e8",
890
+ surfaceColor: "#fffdf8",
891
+ textColor: "#1f2937",
892
+ textSecondaryColor: "#6b7280",
893
+ borderColor: "#e5e0d5",
894
+ radius: 4,
895
+ fontFamily: "serif",
896
+ },
897
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
898
+ background-image: radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--axiom-auth-primary) 9%, transparent), transparent 42%), linear-gradient(135deg, #f5f1e8, #efe9dc);
899
+ }
900
+ #axiom-auth-root [data-axiom-part="brand-panel"] {
901
+ background: linear-gradient(145deg, color-mix(in srgb, var(--axiom-auth-primary) 70%, #000), var(--axiom-auth-primary) 55%, color-mix(in srgb, var(--axiom-auth-primary) 80%, #000));
902
+ }
903
+ #axiom-auth-root [data-axiom-part="panel-title"] {
904
+ letter-spacing: -0.03em;
905
+ }`,
906
+ },
907
+ product: {
908
+ id: "product",
909
+ labelKey: "platformAdmin.settings.branding.preset.product.label",
910
+ descriptionKey: "platformAdmin.settings.branding.preset.product.description",
911
+ branding: {
912
+ loginLayout: "split-brand",
913
+ panelPosition: "right",
914
+ panelContentAlign: "center",
915
+ panelVisual: "mesh",
916
+ cardStyle: "card",
917
+ primaryColor: "#2563eb",
918
+ backgroundColor: "#eff6ff",
919
+ surfaceColor: "#ffffff",
920
+ textColor: "#0f172a",
921
+ textSecondaryColor: "#475569",
922
+ borderColor: "#bfdbfe",
923
+ radius: 16,
924
+ fontFamily: "inter",
925
+ },
926
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
927
+ background-image: radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--axiom-auth-primary) 16%, transparent), transparent 42%);
928
+ }
929
+ #axiom-auth-root [data-axiom-part="brand-panel"] {
930
+ background: linear-gradient(150deg, color-mix(in srgb, var(--axiom-auth-primary) 80%, #000), var(--axiom-auth-primary) 45%, color-mix(in srgb, var(--axiom-auth-primary) 70%, #fff));
931
+ }
932
+ #axiom-auth-root [data-axiom-part="card"] {
933
+ box-shadow: 0 32px 80px -36px color-mix(in srgb, var(--axiom-auth-primary) 55%, transparent);
934
+ }`,
935
+ },
936
+ midnight: {
937
+ id: "midnight",
938
+ labelKey: "platformAdmin.settings.branding.preset.midnight.label",
939
+ descriptionKey: "platformAdmin.settings.branding.preset.midnight.description",
940
+ branding: {
941
+ loginLayout: "full-bleed",
942
+ cardPosition: "center",
943
+ cardStyle: "glass",
944
+ cardEffect: "inner-glow",
945
+ formDensity: "airy",
946
+ fieldStyle: "filled",
947
+ primaryColor: "#f97316",
948
+ backgroundColor: "#09090b",
949
+ surfaceColor: "#18181b",
950
+ textColor: "#fafafa",
951
+ textSecondaryColor: "#a1a1aa",
952
+ borderColor: "#27272a",
953
+ radius: 18,
954
+ fontFamily: "system",
955
+ backgroundOverlayColor: "#000000",
956
+ backgroundOverlayOpacity: 55,
957
+ },
958
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
959
+ background-image: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--axiom-auth-primary) 20%, transparent), transparent 38%), radial-gradient(circle at 80% 90%, rgba(124, 58, 237, 0.18), transparent 42%);
960
+ }
961
+ #axiom-auth-root [data-axiom-part="card"] {
962
+ border-color: rgba(255, 255, 255, 0.12);
963
+ box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
964
+ }`,
965
+ },
966
+ cinematic: {
967
+ id: "cinematic",
968
+ labelKey: "platformAdmin.settings.branding.preset.cinematic.label",
969
+ descriptionKey: "platformAdmin.settings.branding.preset.cinematic.description",
970
+ branding: {
971
+ loginLayout: "full-bleed",
972
+ cardPosition: "right",
973
+ cardStyle: "glass",
974
+ backgroundTreatment: "vignette",
975
+ fieldStyle: "filled",
976
+ primaryColor: "#e11d48",
977
+ backgroundColor: "#0a0a0a",
978
+ surfaceColor: "#111111",
979
+ textColor: "#f5f5f5",
980
+ textSecondaryColor: "#a3a3a3",
981
+ borderColor: "#262626",
982
+ radius: 4,
983
+ fontFamily: "system",
984
+ backgroundOverlayColor: "#000000",
985
+ backgroundOverlayOpacity: 65,
986
+ },
987
+ customCss: `#axiom-auth-root [data-axiom-part="background-overlay"] {
988
+ background: radial-gradient(circle at 25% 30%, transparent 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.88) 100%);
989
+ opacity: 1;
990
+ }
991
+ #axiom-auth-root [data-axiom-part="card"] {
992
+ border-color: rgba(255, 255, 255, 0.14);
993
+ box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65);
994
+ }`,
995
+ },
996
+ playful: {
997
+ id: "playful",
998
+ labelKey: "platformAdmin.settings.branding.preset.playful.label",
999
+ descriptionKey: "platformAdmin.settings.branding.preset.playful.description",
1000
+ branding: {
1001
+ loginLayout: "centered",
1002
+ cardStyle: "card",
1003
+ cardEffect: "inner-glow",
1004
+ logoStyle: "badge",
1005
+ primaryColor: "#db2777",
1006
+ backgroundColor: "#fff1f2",
1007
+ surfaceColor: "#ffffff",
1008
+ textColor: "#500724",
1009
+ textSecondaryColor: "#9d174d",
1010
+ borderColor: "#fecdd3",
1011
+ radius: 28,
1012
+ fontFamily: "inter",
1013
+ },
1014
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
1015
+ background-image: radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--axiom-auth-primary) 18%, transparent), transparent 35%), radial-gradient(circle at 85% 80%, rgba(251, 113, 133, 0.22), transparent 38%);
1016
+ }
1017
+ #axiom-auth-root [data-axiom-part="card"] {
1018
+ box-shadow: 0 32px 80px -28px color-mix(in srgb, var(--axiom-auth-primary) 45%, transparent);
1019
+ }`,
1020
+ },
1021
+ enterprise: {
1022
+ id: "enterprise",
1023
+ labelKey: "platformAdmin.settings.branding.preset.enterprise.label",
1024
+ descriptionKey: "platformAdmin.settings.branding.preset.enterprise.description",
1025
+ branding: {
1026
+ loginLayout: "centered",
1027
+ cardStyle: "card",
1028
+ primaryColor: "#0f766e",
1029
+ backgroundColor: "#f0fdfa",
1030
+ surfaceColor: "#ffffff",
1031
+ textColor: "#134e4a",
1032
+ textSecondaryColor: "#5f7f7a",
1033
+ borderColor: "#99f6e4",
1034
+ radius: 8,
1035
+ fontFamily: "system",
1036
+ logoStyle: "badge",
1037
+ formDensity: "compact",
1038
+ backgroundPattern: "grid",
1039
+ fieldStyle: "outline",
1040
+ },
1041
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
1042
+ background-image: linear-gradient(color-mix(in srgb, var(--axiom-auth-primary) 6%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--axiom-auth-primary) 6%, transparent) 1px, transparent 1px);
1043
+ background-size: 32px 32px;
1044
+ }
1045
+ #axiom-auth-root [data-axiom-part="card"] {
1046
+ box-shadow: 0 24px 64px -32px color-mix(in srgb, var(--axiom-auth-primary) 35%, transparent);
1047
+ }`,
1048
+ },
1049
+ noir: {
1050
+ id: "noir",
1051
+ labelKey: "platformAdmin.settings.branding.preset.noir.label",
1052
+ descriptionKey: "platformAdmin.settings.branding.preset.noir.description",
1053
+ branding: {
1054
+ loginLayout: "split-brand",
1055
+ panelPosition: "left",
1056
+ panelVisual: "orbit",
1057
+ cardStyle: "outline",
1058
+ primaryColor: "#111827",
1059
+ backgroundColor: "#f9fafb",
1060
+ surfaceColor: "#ffffff",
1061
+ textColor: "#111827",
1062
+ textSecondaryColor: "#6b7280",
1063
+ borderColor: "#e5e7eb",
1064
+ radius: 0,
1065
+ fontFamily: "mono",
1066
+ },
1067
+ customCss: `#axiom-auth-root [data-axiom-part="brand-panel"] {
1068
+ background: var(--axiom-auth-primary);
1069
+ }
1070
+ #axiom-auth-root [data-axiom-part="brand-panel"]::after {
1071
+ background-image: linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
1072
+ background-size: 24px 24px;
1073
+ opacity: 0.45;
1074
+ }
1075
+ #axiom-auth-root [data-axiom-part="card"] {
1076
+ border-color: var(--axiom-auth-primary);
1077
+ box-shadow: 8px 8px 0 var(--axiom-auth-text);
1078
+ }`,
1079
+ },
1080
+ aurora: {
1081
+ id: "aurora",
1082
+ labelKey: "platformAdmin.settings.branding.preset.aurora.label",
1083
+ descriptionKey: "platformAdmin.settings.branding.preset.aurora.description",
1084
+ branding: {
1085
+ loginLayout: "full-bleed",
1086
+ cardPosition: "center",
1087
+ cardStyle: "glass",
1088
+ cardEffect: "inner-glow",
1089
+ logoStyle: "badge",
1090
+ formDensity: "airy",
1091
+ fieldStyle: "filled",
1092
+ primaryColor: "#22d3ee",
1093
+ backgroundColor: "#07111f",
1094
+ surfaceColor: "#0f1b2d",
1095
+ textColor: "#e2f8ff",
1096
+ textSecondaryColor: "#9cb8c9",
1097
+ borderColor: "#1e3a4f",
1098
+ radius: 24,
1099
+ fontFamily: "inter",
1100
+ logoSize: 56,
1101
+ titleSize: 34,
1102
+ bodySize: 16,
1103
+ pagePadding: 24,
1104
+ cardPadding: 32,
1105
+ cardWidth: 440,
1106
+ cardShadow: "floating",
1107
+ backgroundPattern: "aurora",
1108
+ backgroundOverlayColor: "#000000",
1109
+ backgroundOverlayOpacity: 45,
1110
+ },
1111
+ customCss: `#axiom-auth-root [data-axiom-part="card"] {
1112
+ border-color: color-mix(in srgb, var(--axiom-auth-primary) 22%, transparent);
1113
+ box-shadow: 0 40px 110px -30px color-mix(in srgb, var(--axiom-auth-primary) 35%, transparent);
1114
+ }
1115
+ #axiom-auth-root [data-axiom-part="card"]::before {
1116
+ content: "";
1117
+ position: absolute;
1118
+ inset: 0;
1119
+ border-radius: inherit;
1120
+ pointer-events: none;
1121
+ background: linear-gradient(135deg, color-mix(in srgb, var(--axiom-auth-primary) 12%, transparent), transparent 45%);
1122
+ }`,
1123
+ },
1124
+ swiss: {
1125
+ id: "swiss",
1126
+ labelKey: "platformAdmin.settings.branding.preset.swiss.label",
1127
+ descriptionKey: "platformAdmin.settings.branding.preset.swiss.description",
1128
+ branding: {
1129
+ loginLayout: "centered",
1130
+ cardStyle: "card",
1131
+ cardEffect: "gradient-border",
1132
+ formDensity: "compact",
1133
+ fieldStyle: "underline",
1134
+ primaryColor: "#ef4444",
1135
+ backgroundColor: "#f4f4f0",
1136
+ surfaceColor: "#ffffff",
1137
+ textColor: "#111111",
1138
+ textSecondaryColor: "#555555",
1139
+ borderColor: "#d4d4d0",
1140
+ radius: 0,
1141
+ fontFamily: "inter",
1142
+ logoSize: 52,
1143
+ titleSize: 44,
1144
+ bodySize: 15,
1145
+ pagePadding: 32,
1146
+ cardPadding: 36,
1147
+ cardWidth: 460,
1148
+ cardShadow: "none",
1149
+ backgroundPattern: "grid",
1150
+ },
1151
+ customCss: `#axiom-auth-root [data-axiom-part="title"] {
1152
+ letter-spacing: -0.05em;
1153
+ }
1154
+ #axiom-auth-root [data-axiom-part="card"] {
1155
+ border: 1px solid var(--axiom-auth-text);
1156
+ }`,
1157
+ },
1158
+ luxe: {
1159
+ id: "luxe",
1160
+ labelKey: "platformAdmin.settings.branding.preset.luxe.label",
1161
+ descriptionKey: "platformAdmin.settings.branding.preset.luxe.description",
1162
+ branding: {
1163
+ loginLayout: "split-brand",
1164
+ panelPosition: "right",
1165
+ panelContentAlign: "center",
1166
+ panelVisual: "topography",
1167
+ cardStyle: "glass",
1168
+ logoStyle: "badge",
1169
+ formDensity: "airy",
1170
+ fieldStyle: "filled",
1171
+ primaryColor: "#a16207",
1172
+ backgroundColor: "#0c0a09",
1173
+ surfaceColor: "#1c1917",
1174
+ textColor: "#fafaf9",
1175
+ textSecondaryColor: "#a8a29e",
1176
+ borderColor: "#44403c",
1177
+ radius: 20,
1178
+ fontFamily: "serif",
1179
+ logoSize: 72,
1180
+ titleSize: 32,
1181
+ bodySize: 16,
1182
+ pagePadding: 24,
1183
+ cardPadding: 32,
1184
+ cardWidth: 420,
1185
+ cardShadow: "floating",
1186
+ },
1187
+ customCss: `#axiom-auth-root [data-axiom-part="brand-panel"] {
1188
+ background: linear-gradient(145deg, #1c1917, #292524 55%, #0c0a09);
1189
+ }
1190
+ #axiom-auth-root [data-axiom-part="panel-title"] {
1191
+ letter-spacing: -0.04em;
1192
+ }
1193
+ #axiom-auth-root [data-axiom-part="card"] {
1194
+ border-color: color-mix(in srgb, var(--axiom-auth-primary) 35%, transparent);
1195
+ box-shadow: 0 40px 110px -40px color-mix(in srgb, var(--axiom-auth-primary) 55%, transparent);
1196
+ }`,
1197
+ },
1198
+ narrative: {
1199
+ id: "narrative",
1200
+ labelKey: "platformAdmin.settings.branding.preset.narrative.label",
1201
+ descriptionKey: "platformAdmin.settings.branding.preset.narrative.description",
1202
+ branding: {
1203
+ loginLayout: "split-story",
1204
+ panelPosition: "right",
1205
+ panelContentAlign: "center",
1206
+ panelVisual: "aurora",
1207
+ cardStyle: "glass",
1208
+ cardEffect: "inner-glow",
1209
+ logoStyle: "badge",
1210
+ formDensity: "airy",
1211
+ fieldStyle: "filled",
1212
+ primaryColor: "#0f766e",
1213
+ backgroundColor: "#f0fdfa",
1214
+ surfaceColor: "#ffffff",
1215
+ textColor: "#134e4a",
1216
+ textSecondaryColor: "#5f7f7a",
1217
+ borderColor: "#99f6e4",
1218
+ radius: 20,
1219
+ fontFamily: "serif",
1220
+ logoSize: 64,
1221
+ titleSize: 40,
1222
+ bodySize: 16,
1223
+ pagePadding: 24,
1224
+ cardPadding: 32,
1225
+ cardWidth: 420,
1226
+ cardShadow: "floating",
1227
+ panelEyebrow: "Trusted by modern teams",
1228
+ panelTitle: "Build with confidence",
1229
+ panelDescription: "A foundation for teams that care about craft, security, and speed.",
1230
+ panelPoint1: "SOC 2 ready workflows",
1231
+ panelPoint2: "Fast onboarding",
1232
+ panelPoint3: "Clear audit trails",
1233
+ panelStat1Value: "99.99%",
1234
+ panelStat1Label: "Uptime",
1235
+ panelStat2Value: "4.9/5",
1236
+ panelStat2Label: "Customer rating",
1237
+ panelStat3Value: "12k+",
1238
+ panelStat3Label: "Teams onboarded",
1239
+ panelQuote: "The calmest, most reliable launch experience we have shipped.",
1240
+ panelQuoteAuthor: "Maya Chen",
1241
+ panelQuoteRole: "VP Engineering, Northstar",
1242
+ },
1243
+ customCss: `#axiom-auth-root [data-axiom-part="story-panel"] {
1244
+ background: linear-gradient(145deg, color-mix(in srgb, var(--axiom-auth-primary) 82%, #000), var(--axiom-auth-primary) 55%, color-mix(in srgb, var(--axiom-auth-primary) 72%, #fff));
1245
+ }
1246
+ #axiom-auth-root [data-axiom-part="story-stat"] {
1247
+ padding: 12px 14px;
1248
+ border: 1px solid rgba(255, 255, 255, 0.18);
1249
+ border-radius: 12px;
1250
+ background: rgba(255, 255, 255, 0.08);
1251
+ }
1252
+ #axiom-auth-root [data-axiom-part="story-testimonial"] {
1253
+ border-left: 2px solid rgba(255, 255, 255, 0.45);
1254
+ padding-left: 16px;
1255
+ }`,
1256
+ },
1257
+ "editorial-centered": {
1258
+ id: "editorial-centered",
1259
+ labelKey: "platformAdmin.settings.branding.preset.editorialCentered.label",
1260
+ descriptionKey: "platformAdmin.settings.branding.preset.editorialCentered.description",
1261
+ branding: {
1262
+ loginLayout: "centered-editorial",
1263
+ cardStyle: "card",
1264
+ cardEffect: "gradient-border",
1265
+ formDensity: "airy",
1266
+ primaryColor: "#7c2d12",
1267
+ backgroundColor: "#faf7f2",
1268
+ surfaceColor: "#fffdf9",
1269
+ textColor: "#1c1917",
1270
+ textSecondaryColor: "#78716c",
1271
+ borderColor: "#e7e5e4",
1272
+ radius: 10,
1273
+ fontFamily: "serif",
1274
+ logoSize: 56,
1275
+ titleSize: 46,
1276
+ bodySize: 16,
1277
+ pagePadding: 32,
1278
+ cardPadding: 32,
1279
+ cardWidth: 440,
1280
+ cardShadow: "soft",
1281
+ panelEyebrow: "Crafted for thoughtful teams",
1282
+ },
1283
+ customCss: `#axiom-auth-root [data-axiom-part="page"] {
1284
+ background-image: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--axiom-auth-primary) 10%, transparent), transparent 44%);
1285
+ }
1286
+ #axiom-auth-root [data-axiom-part="editorial-headline"] {
1287
+ font-weight: 400;
1288
+ }`,
1289
+ },
1290
+ brutalist: {
1291
+ id: "brutalist",
1292
+ labelKey: "platformAdmin.settings.branding.preset.brutalist.label",
1293
+ descriptionKey: "platformAdmin.settings.branding.preset.brutalist.description",
1294
+ branding: {
1295
+ loginLayout: "centered",
1296
+ cardStyle: "card",
1297
+ formDensity: "compact",
1298
+ ssoLayout: "inline",
1299
+ fieldStyle: "outline",
1300
+ primaryColor: "#000000",
1301
+ backgroundColor: "#f5f5f0",
1302
+ surfaceColor: "#ffffff",
1303
+ textColor: "#000000",
1304
+ textSecondaryColor: "#333333",
1305
+ borderColor: "#000000",
1306
+ radius: 0,
1307
+ fontFamily: "mono",
1308
+ logoSize: 48,
1309
+ titleSize: 40,
1310
+ bodySize: 14,
1311
+ pagePadding: 24,
1312
+ cardPadding: 32,
1313
+ cardWidth: 480,
1314
+ cardShadow: "hard",
1315
+ backgroundPattern: "dots",
1316
+ },
1317
+ customCss: `#axiom-auth-root [data-axiom-part="title"] {
1318
+ text-transform: uppercase;
1319
+ letter-spacing: -0.03em;
1320
+ }
1321
+ #axiom-auth-root [data-axiom-part="card"] {
1322
+ border: 3px solid var(--axiom-auth-text);
1323
+ box-shadow: 8px 8px 0 var(--axiom-auth-text);
1324
+ }`,
1325
+ },
1326
+ } as const satisfies Record<string, AuthBrandingPreset>;
1327
+
1328
+ export const AUTH_BRANDING_PRESET_IDS = Object.keys(
1329
+ AUTH_BRANDING_PRESETS,
1330
+ ) as Array<keyof typeof AUTH_BRANDING_PRESETS>;
1331
+ export interface AuthBrandingCase {
1332
+ id: string;
1333
+ labelKey: string;
1334
+ descriptionKey: string;
1335
+ /** Visual starting point; the case overlays content and assets on top. */
1336
+ presetId: keyof typeof AUTH_BRANDING_PRESETS;
1337
+ branding: Partial<PlatformBranding>;
1338
+ customCss?: string;
1339
+ }
1340
+
1341
+ /**
1342
+ * Complete first-party examples built from the platform logo and repo-hosted
1343
+ * SVG assets. The case stays structured; no HTML is stored or injected.
1344
+ */
1345
+ export const AUTH_BRANDING_CASES = {
1346
+ "editorial-launch": {
1347
+ id: "editorial-launch",
1348
+ labelKey: "platformAdmin.settings.branding.case.editorialLaunch.label",
1349
+ descriptionKey:
1350
+ "platformAdmin.settings.branding.case.editorialLaunch.description",
1351
+ presetId: "editorial-centered",
1352
+ branding: {
1353
+ brandName: "AlphaFina",
1354
+ logoUrl: "/logo.png",
1355
+ loginTitle: "A quieter way to sign in",
1356
+ loginSubtitle: "One account for every workspace.",
1357
+ footerNote: "SOC 2 ready · SSO · Audit logs",
1358
+ panelEyebrow: "Crafted for thoughtful teams",
1359
+ panelTrustLogo1: "/cases/trust-northstar.svg",
1360
+ panelTrustLogo2: "/cases/trust-acme.svg",
1361
+ panelTrustLogo3: "/cases/trust-vertex.svg",
1362
+ panelTrustLogo4: "/cases/trust-lumen.svg",
1363
+ },
1364
+ },
1365
+ "product-showcase": {
1366
+ id: "product-showcase",
1367
+ labelKey: "platformAdmin.settings.branding.case.productShowcase.label",
1368
+ descriptionKey:
1369
+ "platformAdmin.settings.branding.case.productShowcase.description",
1370
+ presetId: "product",
1371
+ branding: {
1372
+ brandName: "AlphaFina",
1373
+ logoUrl: "/logo.png",
1374
+ loginLayout: "split-showcase",
1375
+ panelPosition: "right",
1376
+ panelContentAlign: "center",
1377
+ cardStyle: "glass",
1378
+ panelEyebrow: "Product tour",
1379
+ panelTitle: "One workspace for every launch",
1380
+ panelDescription:
1381
+ "Plan, build, and ship agent workflows without losing the thread.",
1382
+ panelPoint1: "Live run visibility",
1383
+ panelPoint2: "Audit-ready activity",
1384
+ panelPoint3: "One shared context",
1385
+ panelProductImageUrl: "/cases/product-dashboard.svg",
1386
+ panelProductImageAlt: "AlphaFina workspace dashboard",
1387
+ panelTrustLogo1: "/cases/trust-northstar.svg",
1388
+ panelTrustLogo2: "/cases/trust-acme.svg",
1389
+ panelTrustLogo3: "/cases/trust-vertex.svg",
1390
+ panelTrustLogo4: "/cases/trust-lumen.svg",
1391
+ imageFit: "cover",
1392
+ imagePosition: "top",
1393
+ imageTreatment: "none",
1394
+ },
1395
+ customCss: `#axiom-auth-root [data-axiom-part="showcase-panel"] {
1396
+ background: linear-gradient(150deg, color-mix(in srgb, var(--axiom-auth-primary) 82%, #000), var(--axiom-auth-primary) 48%, color-mix(in srgb, var(--axiom-auth-primary) 68%, #fff));
1397
+ }
1398
+ #axiom-auth-root [data-axiom-part="product-frame"] {
1399
+ background: rgba(255, 255, 255, 0.16);
1400
+ border-color: rgba(255, 255, 255, 0.28);
1401
+ }`,
1402
+ },
1403
+ "data-story": {
1404
+ id: "data-story",
1405
+ labelKey: "platformAdmin.settings.branding.case.dataStory.label",
1406
+ descriptionKey:
1407
+ "platformAdmin.settings.branding.case.dataStory.description",
1408
+ presetId: "narrative",
1409
+ branding: {
1410
+ brandName: "AlphaFina",
1411
+ logoUrl: "/logo.png",
1412
+ loginLayout: "split-story",
1413
+ panelEyebrow: "Trusted by modern teams",
1414
+ panelTitle: "Build with confidence",
1415
+ panelDescription:
1416
+ "A foundation for teams that care about craft, security, and speed.",
1417
+ panelPoint1: "SOC 2 ready workflows",
1418
+ panelPoint2: "Fast onboarding",
1419
+ panelPoint3: "Clear audit trails",
1420
+ panelStat1Value: "99.99%",
1421
+ panelStat1Label: "Uptime",
1422
+ panelStat2Value: "4.9/5",
1423
+ panelStat2Label: "Customer rating",
1424
+ panelStat3Value: "12k+",
1425
+ panelStat3Label: "Teams onboarded",
1426
+ panelQuote:
1427
+ "The calmest, most reliable launch experience we have shipped.",
1428
+ panelQuoteAuthor: "Maya Chen",
1429
+ panelQuoteRole: "VP Engineering, Northstar",
1430
+ panelTrustLogo1: "/cases/trust-northstar.svg",
1431
+ panelTrustLogo2: "/cases/trust-acme.svg",
1432
+ panelTrustLogo3: "/cases/trust-vertex.svg",
1433
+ panelTrustLogo4: "/cases/trust-lumen.svg",
1434
+ },
1435
+ },
1436
+ "aurora-launch": {
1437
+ id: "aurora-launch",
1438
+ labelKey: "platformAdmin.settings.branding.case.auroraLaunch.label",
1439
+ descriptionKey:
1440
+ "platformAdmin.settings.branding.case.auroraLaunch.description",
1441
+ presetId: "aurora",
1442
+ branding: {
1443
+ brandName: "AlphaFina",
1444
+ logoUrl: "/logo.png",
1445
+ loginLayout: "full-bleed",
1446
+ backgroundImageUrl: "/cases/aurora-bg.svg",
1447
+ backgroundOverlayColor: "#000000",
1448
+ backgroundOverlayOpacity: 35,
1449
+ imageFit: "cover",
1450
+ imagePosition: "center",
1451
+ imageTreatment: "none",
1452
+ cardStyle: "glass",
1453
+ cardPosition: "center",
1454
+ loginTitle: "Sign in to the network",
1455
+ loginSubtitle: "One secure account for every team and agent.",
1456
+ footerNote: "Encrypted sessions · SSO · Audit trails",
1457
+ },
1458
+ },
1459
+ "cinematic-video": {
1460
+ id: "cinematic-video",
1461
+ labelKey: "platformAdmin.settings.branding.case.cinematicVideo.label",
1462
+ descriptionKey:
1463
+ "platformAdmin.settings.branding.case.cinematicVideo.description",
1464
+ presetId: "cinematic",
1465
+ branding: {
1466
+ brandName: "AlphaFina",
1467
+ logoUrl: "/logo.png",
1468
+ loginLayout: "full-bleed",
1469
+ backgroundVideoUrl: "/cases/14471967_3840_2160_30fps.mp4",
1470
+ backgroundImageUrl: "/cases/aurora-bg.svg",
1471
+ backgroundOverlayColor: "#000000",
1472
+ backgroundOverlayOpacity: 65,
1473
+ imageFit: "cover",
1474
+ imagePosition: "center",
1475
+ imageTreatment: "none",
1476
+ cardStyle: "glass",
1477
+ cardPosition: "right",
1478
+ loginTitle: "Sign in to the network",
1479
+ loginSubtitle: "One secure account for every team and agent.",
1480
+ },
1481
+ },
1482
+ "aurora-video": {
1483
+ id: "aurora-video",
1484
+ labelKey: "platformAdmin.settings.branding.case.auroraVideo.label",
1485
+ descriptionKey:
1486
+ "platformAdmin.settings.branding.case.auroraVideo.description",
1487
+ presetId: "aurora",
1488
+ branding: {
1489
+ brandName: "AlphaFina",
1490
+ logoUrl: "/logo.png",
1491
+ loginLayout: "full-bleed",
1492
+ backgroundVideoUrl: "/cases/15404923_1920_1080_60fps.mp4",
1493
+ backgroundImageUrl: "/cases/aurora-bg.svg",
1494
+ backgroundOverlayColor: "#000000",
1495
+ backgroundOverlayOpacity: 30,
1496
+ imageFit: "cover",
1497
+ imagePosition: "center",
1498
+ imageTreatment: "none",
1499
+ cardStyle: "glass",
1500
+ cardPosition: "center",
1501
+ loginTitle: "Sign in to the network",
1502
+ loginSubtitle: "One secure account for every team and agent.",
1503
+ },
1504
+ },
1505
+ } as const satisfies Record<string, AuthBrandingCase>;
1506
+
1507
+ export const AUTH_BRANDING_CASE_IDS = Object.keys(
1508
+ AUTH_BRANDING_CASES,
1509
+ ) as Array<keyof typeof AUTH_BRANDING_CASES>;
1510
+
1511
+ /** True for a registered login layout id. */
1512
+ export function isLoginLayoutId(value: unknown): value is LoginLayoutId {
1513
+ return (
1514
+ typeof value === "string" &&
1515
+ (LOGIN_LAYOUT_IDS as readonly string[]).includes(value)
1516
+ );
1517
+ }
1518
+
1519
+ /** True for a registered font preset id. */
1520
+ export function isAuthFontFamilyId(
1521
+ value: unknown,
1522
+ ): value is AuthFontFamilyId {
1523
+ return (
1524
+ typeof value === "string" &&
1525
+ (AUTH_FONT_FAMILY_IDS as readonly string[]).includes(value)
1526
+ );
1527
+ }
1528
+
1529
+ /** Fields owned by a layout; common fields are excluded. */
1530
+ export function layoutSpecificFields(
1531
+ layout: LoginLayoutId,
1532
+ ): PlatformBrandingField[] {
1533
+ return PLATFORM_BRANDING_FIELD_KEYS.filter((key) => {
1534
+ const definition: PlatformBrandingFieldDefinition =
1535
+ PLATFORM_BRANDING_FIELDS[key];
1536
+ return definition.layouts?.includes(layout) ?? false;
1537
+ });
1538
+ }
1539
+
1540
+ /** True when the layout can render the given auth surface. */
1541
+ export function layoutSupportsSurface(
1542
+ layout: LoginLayoutId,
1543
+ surface: AuthSurfaceKind,
1544
+ ): boolean {
1545
+ return LOGIN_LAYOUTS[layout].supports.includes(surface);
1546
+ }
1547
+
1548
+ /**
1549
+ * Resolves a requested layout against the current surface.
1550
+ *
1551
+ * Unknown or unsupported layouts fall back to centered, which every surface
1552
+ * supports.
1553
+ */
1554
+ export function resolveLoginLayout(
1555
+ layout: unknown,
1556
+ surface: AuthSurfaceKind,
1557
+ ): LoginLayoutId {
1558
+ if (isLoginLayoutId(layout) && layoutSupportsSurface(layout, surface)) {
1559
+ return layout;
1560
+ }
1561
+ return DEFAULT_LOGIN_LAYOUT;
1562
+ }