@masterteam/components 0.0.243 → 0.0.244

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.
@@ -1,6 +1,6 @@
1
1
  import { providePrimeNG } from 'primeng/config';
2
2
  import Aura from '@primeuix/themes/aura';
3
- import { updatePreset, definePreset } from '@primeuix/themes';
3
+ import { updatePreset, definePreset, usePreset } from '@primeuix/themes';
4
4
  import { MessageService, ConfirmationService } from 'primeng/api';
5
5
  import * as i0 from '@angular/core';
6
6
  import { InjectionToken, makeEnvironmentProviders, computed, inject, LOCALE_ID, Pipe } from '@angular/core';
@@ -160,6 +160,634 @@ function generateTailwindPalette(baseColorHex, baseColorShade = '500') {
160
160
  return palette;
161
161
  }
162
162
 
163
+ /**
164
+ * Masterteam Design System — raw palettes and scales.
165
+ *
166
+ * Transcribed from the DS Storybook foundations (Figma
167
+ * `WTmRAkJVvw0IvZMA7wBdTC`). These are primitives: they name colours, not
168
+ * roles. The mapping from primitive to role lives in `ds-identity.preset.ts`.
169
+ *
170
+ * Adding a value here without a corresponding Figma variable is how a design
171
+ * system drifts — extend the Figma file first, then mirror it.
172
+ */
173
+ /** Primary blue. 800 is the primary button background. */
174
+ const DS_BLUE = {
175
+ 25: '#F5FAFF',
176
+ 50: '#EFF8FF',
177
+ 100: '#D1E9FF',
178
+ 200: '#B2DDFF',
179
+ 300: '#84CAFF',
180
+ 400: '#53B1FD',
181
+ 500: '#2E90FA',
182
+ 600: '#1570EF',
183
+ 700: '#175CD3',
184
+ 800: '#1849A9',
185
+ 900: '#194185',
186
+ 950: '#102A56',
187
+ };
188
+ /** Secondary indigo — accents, tags, selected states. */
189
+ const DS_INDIGO = {
190
+ 25: '#F5F8FF',
191
+ 50: '#EEF4FF',
192
+ 100: '#E0EAFF',
193
+ 200: '#C7D7FE',
194
+ 300: '#A4BCFD',
195
+ 400: '#8098F9',
196
+ 500: '#6172F3',
197
+ 600: '#444CE7',
198
+ 700: '#3538CD',
199
+ 800: '#2D31A6',
200
+ 900: '#2D3282',
201
+ 950: '#1F235B',
202
+ };
203
+ const DS_SUCCESS = {
204
+ 25: '#F6FEF9',
205
+ 50: '#ECFDF3',
206
+ 100: '#DCFAE6',
207
+ 200: '#A9EFC5',
208
+ 300: '#75E0A7',
209
+ 400: '#47CD89',
210
+ 500: '#17B26A',
211
+ 600: '#079455',
212
+ 700: '#067647',
213
+ 800: '#085D3A',
214
+ 900: '#074D31',
215
+ 950: '#053321',
216
+ };
217
+ const DS_WARNING = {
218
+ 25: '#FFFCF5',
219
+ 50: '#FFFAEB',
220
+ 100: '#FEF0C7',
221
+ 200: '#FEDF89',
222
+ 300: '#FEC84B',
223
+ 400: '#FDB022',
224
+ 500: '#F79009',
225
+ 600: '#DC6803',
226
+ 700: '#B54708',
227
+ 800: '#93370D',
228
+ 900: '#7A2E0E',
229
+ 950: '#4E1D09',
230
+ };
231
+ const DS_ERROR = {
232
+ 25: '#FFFBFA',
233
+ 50: '#FEF3F2',
234
+ 100: '#FEE4E2',
235
+ 200: '#FECDCA',
236
+ 300: '#FDA29B',
237
+ 400: '#F97066',
238
+ 500: '#F04438',
239
+ 600: '#D92D20',
240
+ 700: '#B42318',
241
+ 800: '#912018',
242
+ 900: '#7A271A',
243
+ 950: '#55160C',
244
+ };
245
+ /** Neutral scale. Note it stops at 900 in Figma; 0/25/950 are extrapolated
246
+ * because PrimeUIX requires a full 0–950 surface ramp. */
247
+ const DS_GRAY = {
248
+ 0: '#FFFFFF',
249
+ 25: '#FCFCFD',
250
+ 50: '#F9FAFB',
251
+ 100: '#F3F4F6',
252
+ 200: '#E5E7EB',
253
+ 300: '#D1D5DB',
254
+ 400: '#9CA3AF',
255
+ 500: '#6B7280',
256
+ 600: '#4B5563',
257
+ 700: '#374151',
258
+ 800: '#1F2937',
259
+ 900: '#111827',
260
+ 950: '#0A0F1C',
261
+ };
262
+ /**
263
+ * Semantic values that are not part of a ramp. Each one is a named Figma
264
+ * variable in its own right.
265
+ */
266
+ const DS_SEMANTIC = {
267
+ /** Default body / label text. Deliberately navy-black, not gray-900. */
268
+ textStrong: '#000B36',
269
+ textSecondary: '#3C5073',
270
+ textPlaceholder: '#B6BDCA',
271
+ textHelper: '#384250',
272
+ surface: '#FFFFFF',
273
+ border: '#E5E7EB',
274
+ /** Disabled is a colour swap, never an opacity fade. */
275
+ disabledBg: '#D2D6DB',
276
+ disabledText: '#6C7C96',
277
+ inputBorder: '#D2D6DB',
278
+ inputBorderHover: '#1F2A37',
279
+ inputBorderReadonly: '#CED3DC',
280
+ inputBgPressed: '#F3F4F6',
281
+ /** Destructive red. Distinct from the error ramp — this is the button colour. */
282
+ danger: '#A30000',
283
+ dangerSecondaryBg: '#FCDAD7',
284
+ dangerSecondaryBgHover: '#F8BAB5',
285
+ dangerSecondaryBgPressed: '#F3908A',
286
+ /** Tinted secondary button, expressed as primary-at-opacity. */
287
+ secondaryBg: 'rgba(24, 73, 169, 0.2)',
288
+ secondaryBgHover: 'rgba(24, 73, 169, 0.1)',
289
+ focusRing: '#1849A9',
290
+ focusOutline: '#FFFFFF',
291
+ tooltipBg: '#1A2236',
292
+ };
293
+ /** Figma effect styles. Never invent a shadow outside this set. */
294
+ const DS_SHADOW = {
295
+ xs: '0 1px 2px 0 rgba(16, 24, 40, 0.05)',
296
+ sm: '0 1px 3px 0 rgba(16, 24, 40, 0.10), 0 1px 2px 0 rgba(16, 24, 40, 0.06)',
297
+ md: '0 4px 8px -2px rgba(16, 24, 40, 0.10), 0 2px 4px -2px rgba(16, 24, 40, 0.06)',
298
+ lg: '0 12px 16px -6px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03)',
299
+ xl: '0 20px 24px -4px rgba(16, 24, 40, 0.08), 0 8px 8px -4px rgba(16, 24, 40, 0.03)',
300
+ '2xl': '0 24px 48px -12px rgba(16, 24, 40, 0.18)',
301
+ };
302
+ /**
303
+ * Radius scale. The DS names differ from the PrimeUIX names by one step —
304
+ * DS `radius-sm` (4px, the default for buttons and inputs) lands on PrimeUIX
305
+ * `md`, because that is the key PrimeNG components reference. Mapping them
306
+ * here keeps the shift in one place instead of spreading it across overrides.
307
+ */
308
+ const DS_RADIUS = {
309
+ none: '0',
310
+ /** DS radius-xs — code badges, small tags */
311
+ xs: '2px',
312
+ /** DS radius-xs..sm boundary */
313
+ sm: '4px',
314
+ /** DS radius-sm — buttons, inputs, dropdowns (PrimeNG's default reference) */
315
+ md: '4px',
316
+ /** DS radius-md — cards, tooltips, popovers */
317
+ lg: '8px',
318
+ /** DS radius-lg — modals, drawers */
319
+ xl: '16px',
320
+ };
321
+ /** Control heights, in px, from the Figma button spacing frame. */
322
+ const DS_CONTROL_HEIGHT = {
323
+ sm: 24,
324
+ md: 32,
325
+ lg: 40,
326
+ };
327
+ const DS_FONT_FAMILY = "'IBM Plex Sans Arabic', system-ui, 'Segoe UI', sans-serif";
328
+ /** Ordered chart series. Six is the hard maximum. */
329
+ const DS_CHART_SERIES = [
330
+ '#1849A9',
331
+ '#175CD3',
332
+ '#2E90FA',
333
+ '#53B1FD',
334
+ '#B2DDFF',
335
+ '#D1E9FF',
336
+ ];
337
+
338
+ /** Root class that gates the CSS half of the identity. */
339
+ const MT_DESIGN_IDENTITY_CLASS = 'mt-ds';
340
+ /** DS primary button background. Used when the host does not brand the app. */
341
+ const DS_DEFAULT_PRIMARY_COLOR = DS_BLUE[800];
342
+ /**
343
+ * PrimeUIX wants a 50–950 ramp; the DS publishes 25–950. Drop the 25 step and
344
+ * keep the rest — the ramp is dense enough that nothing downstream misses it.
345
+ */
346
+ function toPrimeRamp(scale) {
347
+ return {
348
+ 50: scale[50],
349
+ 100: scale[100],
350
+ 200: scale[200],
351
+ 300: scale[300],
352
+ 400: scale[400],
353
+ 500: scale[500],
354
+ 600: scale[600],
355
+ 700: scale[700],
356
+ 800: scale[800],
357
+ 900: scale[900],
358
+ 950: scale[950],
359
+ };
360
+ }
361
+ /**
362
+ * Control geometry, derived rather than hardcoded so the relationship between
363
+ * height, line-height and border stays visible:
364
+ *
365
+ * height = lineHeight + 2 * paddingY + 2 * border(1px)
366
+ *
367
+ * sm 24px = 18 + 2*2 + 2
368
+ * md 32px = 20 + 2*5 + 2 ← default
369
+ * lg 40px = 24 + 2*7 + 2
370
+ */
371
+ const FIELD = {
372
+ sm: { fontSize: '0.75rem', paddingX: '0.5rem', paddingY: '0.125rem' },
373
+ md: { fontSize: '0.875rem', paddingX: '0.5rem', paddingY: '0.3125rem' },
374
+ lg: { fontSize: '1rem', paddingX: '0.75rem', paddingY: '0.4375rem' },
375
+ };
376
+ /**
377
+ * The DS identity as a partial preset.
378
+ *
379
+ * @param primaryColor Optional brand override. Tenants that white-label the
380
+ * product still need their own colour; when omitted the DS blue is used.
381
+ * Note the DS itself treats the blue as fixed — an override is a deliberate
382
+ * deviation, not a supported DS variant.
383
+ */
384
+ function dsIdentityConfigs(primaryColor) {
385
+ const primary = primaryColor
386
+ ? // A branded run keeps the DS ramp shape but re-anchors the key steps, so
387
+ // hover/pressed stay one and two steps darker as the DS specifies.
388
+ { ...toPrimeRamp(DS_BLUE), 800: primaryColor }
389
+ : toPrimeRamp(DS_BLUE);
390
+ return {
391
+ primitive: {
392
+ borderRadius: { ...DS_RADIUS },
393
+ blue: toPrimeRamp(DS_BLUE),
394
+ indigo: toPrimeRamp(DS_INDIGO),
395
+ green: toPrimeRamp(DS_SUCCESS),
396
+ emerald: toPrimeRamp(DS_SUCCESS),
397
+ amber: toPrimeRamp(DS_WARNING),
398
+ orange: toPrimeRamp(DS_WARNING),
399
+ yellow: toPrimeRamp(DS_WARNING),
400
+ red: toPrimeRamp(DS_ERROR),
401
+ rose: toPrimeRamp(DS_ERROR),
402
+ gray: toPrimeRamp(DS_GRAY),
403
+ slate: toPrimeRamp(DS_GRAY),
404
+ zinc: toPrimeRamp(DS_GRAY),
405
+ },
406
+ semantic: {
407
+ primary,
408
+ transitionDuration: '0.2s',
409
+ /**
410
+ * Disabled is a colour swap, never a fade — a hard DS rule, because a
411
+ * faded control on a tinted surface stops meeting contrast at all.
412
+ */
413
+ disabledOpacity: '1',
414
+ iconSize: '1rem',
415
+ /**
416
+ * Inner 2px primary ring. The outer 3px white halo cannot be expressed as
417
+ * a token (PrimeUIX renders `focusRing` as a single outline) and is added
418
+ * in `ds-identity.css`.
419
+ */
420
+ focusRing: {
421
+ width: '2px',
422
+ style: 'solid',
423
+ color: '{primary.color}',
424
+ offset: '0',
425
+ shadow: 'none',
426
+ },
427
+ formField: {
428
+ paddingX: FIELD.md.paddingX,
429
+ paddingY: FIELD.md.paddingY,
430
+ sm: FIELD.sm,
431
+ lg: FIELD.lg,
432
+ borderRadius: '{border.radius.md}',
433
+ focusRing: {
434
+ width: '0',
435
+ style: 'none',
436
+ color: 'transparent',
437
+ offset: '0',
438
+ shadow: 'none',
439
+ },
440
+ transitionDuration: '{transition.duration}',
441
+ },
442
+ content: { borderRadius: '{border.radius.lg}' },
443
+ overlay: {
444
+ select: {
445
+ borderRadius: '{border.radius.lg}',
446
+ shadow: DS_SHADOW.md,
447
+ },
448
+ popover: {
449
+ borderRadius: '{border.radius.lg}',
450
+ padding: '0.75rem',
451
+ shadow: DS_SHADOW.md,
452
+ },
453
+ modal: {
454
+ // 8px, not the 16px the foundations table implies for "modals" —
455
+ // the DS Modal component itself ships radius-md and shadow-3xl.
456
+ borderRadius: '{border.radius.lg}',
457
+ padding: '1.5rem',
458
+ shadow: '0 32px 64px -12px rgba(16, 24, 40, 0.14)',
459
+ },
460
+ navigation: { shadow: DS_SHADOW.md },
461
+ },
462
+ list: {
463
+ padding: '0.25rem',
464
+ gap: '2px',
465
+ option: {
466
+ padding: '0.375rem 0.5rem',
467
+ borderRadius: '{border.radius.md}',
468
+ },
469
+ optionGroup: { padding: '0.375rem 0.5rem', fontWeight: '600' },
470
+ },
471
+ navigation: {
472
+ item: {
473
+ padding: '0.375rem 0.5rem',
474
+ borderRadius: '{border.radius.md}',
475
+ gap: '0.5rem',
476
+ },
477
+ },
478
+ colorScheme: {
479
+ light: {
480
+ surface: {
481
+ 0: DS_GRAY[0],
482
+ ...toPrimeRamp(DS_GRAY),
483
+ },
484
+ /**
485
+ * The DS anchors the primary button on blue-800, with hover and
486
+ * pressed one and two steps darker. Aura anchors on 500, so the whole
487
+ * triple is remapped rather than inherited.
488
+ */
489
+ primary: {
490
+ color: '{primary.800}',
491
+ contrastColor: DS_GRAY[50],
492
+ hoverColor: '{primary.900}',
493
+ activeColor: '{primary.950}',
494
+ },
495
+ highlight: {
496
+ background: '{primary.50}',
497
+ focusBackground: '{primary.100}',
498
+ color: '{primary.800}',
499
+ focusColor: '{primary.900}',
500
+ },
501
+ mask: { background: 'rgba(16, 24, 40, 0.6)', color: '{surface.200}' },
502
+ formField: {
503
+ background: DS_SEMANTIC.surface,
504
+ disabledBackground: DS_SEMANTIC.disabledBg,
505
+ filledBackground: '{surface.50}',
506
+ filledHoverBackground: '{surface.50}',
507
+ filledFocusBackground: '{surface.50}',
508
+ borderColor: DS_SEMANTIC.inputBorder,
509
+ hoverBorderColor: DS_SEMANTIC.inputBorderHover,
510
+ // The DS keeps the border neutral on focus and signals focus with
511
+ // the underline bar instead (see ds-identity.css).
512
+ focusBorderColor: DS_SEMANTIC.inputBorder,
513
+ invalidBorderColor: DS_SEMANTIC.danger,
514
+ color: DS_SEMANTIC.textStrong,
515
+ disabledColor: DS_SEMANTIC.disabledText,
516
+ placeholderColor: DS_SEMANTIC.textPlaceholder,
517
+ invalidPlaceholderColor: DS_SEMANTIC.danger,
518
+ floatLabelColor: '{surface.500}',
519
+ floatLabelFocusColor: '{primary.800}',
520
+ floatLabelActiveColor: '{surface.500}',
521
+ floatLabelInvalidColor: DS_SEMANTIC.danger,
522
+ iconColor: '{surface.500}',
523
+ shadow: 'none',
524
+ },
525
+ text: {
526
+ color: DS_SEMANTIC.textStrong,
527
+ hoverColor: DS_SEMANTIC.textStrong,
528
+ mutedColor: '{surface.500}',
529
+ hoverMutedColor: '{surface.600}',
530
+ },
531
+ content: {
532
+ background: DS_SEMANTIC.surface,
533
+ hoverBackground: '{surface.50}',
534
+ borderColor: DS_SEMANTIC.border,
535
+ color: '{text.color}',
536
+ hoverColor: '{text.hover.color}',
537
+ },
538
+ list: {
539
+ option: {
540
+ focusBackground: '{surface.100}',
541
+ selectedBackground: '{primary.50}',
542
+ selectedFocusBackground: '{primary.100}',
543
+ color: '{text.color}',
544
+ focusColor: '{text.color}',
545
+ selectedColor: '{primary.800}',
546
+ selectedFocusColor: '{primary.900}',
547
+ },
548
+ },
549
+ },
550
+ /**
551
+ * The DS does not publish a dark theme. Dark mode is still a shipped
552
+ * capability here, so this is an extrapolation: the ramps are the DS
553
+ * ramps, re-anchored to lighter primary steps for contrast on dark
554
+ * surfaces. Treat these values as ours, not as design-approved.
555
+ */
556
+ dark: {
557
+ surface: {
558
+ 0: DS_GRAY[0],
559
+ ...toPrimeRamp(DS_GRAY),
560
+ },
561
+ primary: {
562
+ color: '{primary.400}',
563
+ contrastColor: '{surface.950}',
564
+ hoverColor: '{primary.300}',
565
+ activeColor: '{primary.200}',
566
+ },
567
+ formField: {
568
+ borderColor: '{surface.600}',
569
+ hoverBorderColor: '{surface.500}',
570
+ focusBorderColor: '{surface.600}',
571
+ invalidBorderColor: '{red.400}',
572
+ disabledBackground: '{surface.700}',
573
+ disabledColor: '{surface.400}',
574
+ placeholderColor: '{surface.400}',
575
+ shadow: 'none',
576
+ },
577
+ mask: { background: 'rgba(0, 0, 0, 0.6)', color: '{surface.200}' },
578
+ },
579
+ },
580
+ },
581
+ components: {
582
+ button: {
583
+ root: {
584
+ borderRadius: '{border.radius.md}',
585
+ gap: '0.25rem',
586
+ paddingX: FIELD.md.paddingX,
587
+ paddingY: FIELD.md.paddingY,
588
+ iconOnlyWidth: '2rem',
589
+ sm: { ...FIELD.sm, iconOnlyWidth: '1.5rem' },
590
+ lg: { ...FIELD.lg, iconOnlyWidth: '2.5rem' },
591
+ label: { fontWeight: '500' },
592
+ badgeSize: '1rem',
593
+ },
594
+ colorScheme: {
595
+ light: {
596
+ root: {
597
+ /** DS "neutral" button — the standard Cancel / secondary action. */
598
+ secondary: {
599
+ background: '{surface.100}',
600
+ hoverBackground: '{surface.200}',
601
+ activeBackground: DS_SEMANTIC.disabledBg,
602
+ borderColor: '{surface.100}',
603
+ hoverBorderColor: '{surface.200}',
604
+ activeBorderColor: DS_SEMANTIC.disabledBg,
605
+ color: DS_SEMANTIC.textStrong,
606
+ hoverColor: DS_SEMANTIC.textStrong,
607
+ activeColor: DS_SEMANTIC.textStrong,
608
+ },
609
+ /** DS "danger-primary" — irreversible actions only. */
610
+ danger: {
611
+ background: DS_SEMANTIC.danger,
612
+ hoverBackground: '#8A0000',
613
+ activeBackground: '#6E0000',
614
+ borderColor: DS_SEMANTIC.danger,
615
+ hoverBorderColor: '#8A0000',
616
+ activeBorderColor: '#6E0000',
617
+ color: DS_GRAY[50],
618
+ hoverColor: DS_GRAY[50],
619
+ activeColor: DS_GRAY[50],
620
+ },
621
+ },
622
+ /** DS "transparent" / ghost — link-style text buttons. */
623
+ text: {
624
+ primary: {
625
+ color: DS_BLUE[700],
626
+ hoverBackground: '{primary.50}',
627
+ activeBackground: '{primary.100}',
628
+ },
629
+ danger: {
630
+ color: DS_SEMANTIC.danger,
631
+ hoverBackground: DS_SEMANTIC.dangerSecondaryBg,
632
+ activeBackground: DS_SEMANTIC.dangerSecondaryBgHover,
633
+ },
634
+ },
635
+ /** DS "secondary-solid" is a tint, closest to the outlined slot. */
636
+ outlined: {
637
+ primary: {
638
+ borderColor: '{primary.200}',
639
+ color: '{primary.800}',
640
+ hoverBackground: DS_SEMANTIC.secondaryBgHover,
641
+ activeBackground: DS_SEMANTIC.secondaryBg,
642
+ },
643
+ danger: {
644
+ borderColor: DS_SEMANTIC.dangerSecondaryBgPressed,
645
+ color: DS_SEMANTIC.danger,
646
+ hoverBackground: DS_SEMANTIC.dangerSecondaryBg,
647
+ activeBackground: DS_SEMANTIC.dangerSecondaryBgHover,
648
+ },
649
+ },
650
+ link: {
651
+ color: DS_BLUE[700],
652
+ hoverColor: DS_BLUE[600],
653
+ activeColor: DS_BLUE[800],
654
+ },
655
+ },
656
+ },
657
+ css: () => `
658
+ .p-button.p-button-icon-only { padding-inline: 0; }
659
+ /* Disabled is a colour swap, not a fade. */
660
+ .p-button:disabled {
661
+ background: ${DS_SEMANTIC.disabledBg};
662
+ border-color: ${DS_SEMANTIC.disabledBg};
663
+ color: ${DS_SEMANTIC.disabledText};
664
+ cursor: not-allowed;
665
+ }
666
+ .p-button.p-button-text:disabled,
667
+ .p-button.p-button-outlined:disabled {
668
+ background: transparent;
669
+ color: ${DS_SEMANTIC.disabledText};
670
+ }
671
+ `,
672
+ },
673
+ card: {
674
+ root: {
675
+ borderRadius: '{border.radius.lg}',
676
+ shadow: DS_SHADOW.sm,
677
+ },
678
+ body: { padding: '1rem', gap: '0.5rem' },
679
+ title: { fontSize: '1rem', fontWeight: '600' },
680
+ subtitle: { color: DS_SEMANTIC.textSecondary },
681
+ },
682
+ tabs: {
683
+ tab: {
684
+ padding: '0.5rem 0.75rem',
685
+ fontWeight: '500',
686
+ borderWidth: '0 0 2px 0',
687
+ },
688
+ activeBar: { height: '2px', bottom: '-2px' },
689
+ colorScheme: {
690
+ light: {
691
+ tab: {
692
+ color: '{surface.500}',
693
+ hoverColor: DS_SEMANTIC.textStrong,
694
+ activeColor: '{primary.800}',
695
+ borderColor: DS_SEMANTIC.border,
696
+ hoverBorderColor: '{surface.300}',
697
+ activeBorderColor: '{primary.800}',
698
+ },
699
+ activeBar: { background: '{primary.800}' },
700
+ },
701
+ },
702
+ },
703
+ datatable: {
704
+ headerCell: { padding: '0.5rem 0.75rem' },
705
+ bodyCell: { padding: '0.5rem 0.75rem' },
706
+ footerCell: { padding: '0.5rem 0.75rem' },
707
+ colorScheme: {
708
+ light: {
709
+ headerCell: {
710
+ background: '{surface.50}',
711
+ color: '{surface.600}',
712
+ borderColor: DS_SEMANTIC.border,
713
+ hoverBackground: '{surface.100}',
714
+ },
715
+ bodyCell: { borderColor: DS_SEMANTIC.border },
716
+ row: {
717
+ background: DS_SEMANTIC.surface,
718
+ hoverBackground: '{surface.50}',
719
+ color: DS_SEMANTIC.textStrong,
720
+ selectedBackground: '{primary.50}',
721
+ selectedColor: DS_SEMANTIC.textStrong,
722
+ },
723
+ },
724
+ },
725
+ },
726
+ tag: {
727
+ root: {
728
+ fontSize: '0.75rem',
729
+ fontWeight: '500',
730
+ padding: '0.125rem 0.5rem',
731
+ borderRadius: '{border.radius.md}',
732
+ },
733
+ colorScheme: {
734
+ light: {
735
+ primary: { background: DS_BLUE[100], color: DS_BLUE[700] },
736
+ secondary: { background: '{surface.100}', color: '{surface.700}' },
737
+ success: { background: DS_SUCCESS[100], color: DS_SUCCESS[700] },
738
+ info: { background: DS_BLUE[100], color: DS_BLUE[700] },
739
+ warn: { background: DS_WARNING[100], color: DS_WARNING[700] },
740
+ danger: { background: DS_ERROR[100], color: DS_ERROR[700] },
741
+ },
742
+ },
743
+ },
744
+ toast: {
745
+ root: { borderRadius: '{border.radius.lg}' },
746
+ },
747
+ tooltip: {
748
+ root: {
749
+ borderRadius: '6px',
750
+ padding: '0.5rem 0.75rem',
751
+ maxWidth: '20rem',
752
+ },
753
+ colorScheme: {
754
+ light: {
755
+ root: { background: DS_SEMANTIC.tooltipBg, color: '#ffffff' },
756
+ },
757
+ dark: {
758
+ root: { background: DS_SEMANTIC.tooltipBg, color: '#ffffff' },
759
+ },
760
+ },
761
+ },
762
+ progressbar: {
763
+ root: { borderRadius: '{border.radius.full}', height: '0.5rem' },
764
+ },
765
+ skeleton: {
766
+ colorScheme: {
767
+ light: { root: { background: '#e7e9ed' } },
768
+ },
769
+ },
770
+ avatar: {
771
+ root: { borderRadius: '{border.radius.full}' },
772
+ },
773
+ chip: {
774
+ root: { borderRadius: '{border.radius.full}' },
775
+ },
776
+ },
777
+ };
778
+ }
779
+ /** The DS chart ramp, for hosts that render charts outside PrimeNG. */
780
+ const dsChartSeries = DS_CHART_SERIES;
781
+ /**
782
+ * Adds or removes the root class that activates the CSS half of the identity.
783
+ * No-ops outside the browser so SSR builds stay safe.
784
+ */
785
+ function applyDesignIdentityClass(identity) {
786
+ if (typeof document === 'undefined')
787
+ return;
788
+ document.documentElement.classList.toggle(MT_DESIGN_IDENTITY_CLASS, identity === 'experimental');
789
+ }
790
+
163
791
  const inputBorderRadius = '{border.radius.md}';
164
792
  const toastStyle = {
165
793
  // borderColor: '{surface.300}',
@@ -172,10 +800,24 @@ const toastStyle = {
172
800
  // },
173
801
  // },
174
802
  };
803
+ /**
804
+ * Which identity the app is currently wearing. Tracked because the runtime
805
+ * colour helpers below have to anchor a generated ramp on a different step per
806
+ * identity — classic reads the brand colour as the 500 shade, the DS reads it
807
+ * as 800.
808
+ */
809
+ let activeDesignIdentity = 'classic';
810
+ function getMTDesignIdentity() {
811
+ return activeDesignIdentity;
812
+ }
175
813
  function changePrimaryColor(color) {
814
+ const isDS = activeDesignIdentity === 'experimental';
815
+ const base = color || (isDS ? DS_DEFAULT_PRIMARY_COLOR : '#2AAEC0');
176
816
  updatePreset({
177
817
  semantic: {
178
- primary: generateTailwindPalette(color || '#2AAEC0'),
818
+ primary: isDS
819
+ ? generateTailwindPalette(base, '800')
820
+ : generateTailwindPalette(base),
179
821
  },
180
822
  });
181
823
  }
@@ -515,9 +1157,26 @@ const MTPreset = (themeOptions) => {
515
1157
  // },
516
1158
  },
517
1159
  };
1160
+ // The DS layer is merged last so it wins on the tokens it names, while
1161
+ // everything it stays silent about keeps the classic behaviour.
1162
+ if ((themeOptions?.designIdentity ?? 'classic') === 'experimental') {
1163
+ return definePreset(Aura, configs, dsIdentityConfigs(themeOptions?.primaryColor));
1164
+ }
518
1165
  return definePreset(Aura, configs);
519
1166
  };
1167
+ /**
1168
+ * Switches identity at runtime — for the showcase toggle and for side-by-side
1169
+ * review. Replaces the active preset outright (rather than merging into it, as
1170
+ * `updatePreset` would) so switching back to classic is lossless.
1171
+ */
1172
+ function setMTDesignIdentity(identity, themeOptions) {
1173
+ activeDesignIdentity = identity;
1174
+ applyDesignIdentityClass(identity);
1175
+ usePreset(MTPreset({ ...themeOptions, designIdentity: identity }));
1176
+ }
520
1177
  function provideMTComponents(themeOptions) {
1178
+ activeDesignIdentity = themeOptions?.designIdentity ?? 'classic';
1179
+ applyDesignIdentityClass(activeDesignIdentity);
521
1180
  changeBackgroundColor(themeOptions?.backgroundColor);
522
1181
  return providePrimeNG({
523
1182
  zIndex: {
@@ -1583,5 +2242,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
1583
2242
  * Generated bundle index. Do not edit.
1584
2243
  */
1585
2244
 
1586
- export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, endLoading, generateTailwindPalette, getContrastColor, getLightColor, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
2245
+ export { BaseFacade, BaseFieldConfig, CheckboxFieldConfig, ColorPickerFieldConfig, CrudStateBase, DEFAULT_MT_DATE_FORMATS, DS_BLUE, DS_CHART_SERIES, DS_CONTROL_HEIGHT, DS_DEFAULT_PRIMARY_COLOR, DS_ERROR, DS_FONT_FAMILY, DS_GRAY, DS_INDIGO, DS_RADIUS, DS_SEMANTIC, DS_SHADOW, DS_SUCCESS, DS_WARNING, DateFieldConfig, EditorFieldConfig, EntityListFieldConfig, IconFieldConfig, LocationFieldConfig, LookupMatrixFieldConfig, LookupModuleCheckListFieldConfig, MTDateFormatPipe, MT_DATE_FORMATS, MT_DESIGN_IDENTITY_CLASS, MultiSelectFieldConfig, NumberFieldConfig, PickListFieldConfig, REQUEST_CONTEXT, RadioButtonFieldConfig, RadioCardsFieldConfig, ScheduleItemSelectorFieldConfig, SchedulePredecessorFieldConfig, SchemaConnectionFieldConfig, SelectFieldConfig, SliderFieldConfig, SpacerFieldConfig, TextFieldConfig, TextareaFieldConfig, ToggleFieldConfig, UploadFileFieldConfig, UserSearchFieldConfig, ValidatorConfig, applyDesignIdentityClass, changeBackgroundColor, changePrimaryColor, changeTextColor, createCustomValidator, createEntityAdapter, dsChartSeries, dsIdentityConfigs, endLoading, generateTailwindPalette, getContrastColor, getLightColor, getMTDesignIdentity, handleApiRequest, isInvalid, provideMTComponents, provideMTConfirmation, provideMTDateFormats, provideMTMessages, setLoadingError, setMTDesignIdentity, startLoading, toAngularDateFormat, wrapValidatorWithMessage };
1587
2246
  //# sourceMappingURL=masterteam-components.mjs.map