@uni-design-system/uni-core 3.0.2 → 4.0.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.
@@ -286,6 +286,17 @@ var ShadowCssMap = {
286
286
  modal: GetBoxShadows(ShadowMap["modal"])
287
287
  };
288
288
  //#endregion
289
+ //#region src/concepts/style/inputs.constants.ts
290
+ var removeInputPlatformStyling = {
291
+ appearance: "none",
292
+ background: "none",
293
+ border: "none",
294
+ outline: "none",
295
+ boxShadow: "none",
296
+ padding: 0,
297
+ width: "100%"
298
+ };
299
+ //#endregion
289
300
  //#region src/concepts/theme/palettes/theme.palette.ts
290
301
  var genericLightTheme = {
291
302
  primary: "#0066B2",
@@ -304,6 +315,38 @@ var genericLightTheme = {
304
315
  onDisabled: "rgba(24, 24, 27, 0.4)"
305
316
  };
306
317
  //#endregion
318
+ //#region src/concepts/typography/typography.records.ts
319
+ var FontWeightMap = {
320
+ thin: 100,
321
+ "extra-light": 200,
322
+ light: 200,
323
+ normal: 400,
324
+ medium: 500,
325
+ "semi-bold": 600,
326
+ bold: 700,
327
+ "extra-bold": 800,
328
+ black: 900,
329
+ "extra-black": 950
330
+ };
331
+ //#endregion
332
+ //#region src/concepts/typography/typeface.helpers.ts
333
+ var px = (value) => `${value}px`;
334
+ /**
335
+ * Converts a TextStyle (numeric, design-token oriented) into a
336
+ * TypeFaceDefinition (CSS-ready) so a theme's `typefaces` map can be
337
+ * derived from its `typography` block instead of being duplicated.
338
+ */
339
+ var toTypeface = (style) => ({
340
+ fontFamily: style.fontFamily,
341
+ fontSize: px(style.fontSize),
342
+ lineHeight: px(style.lineHeight),
343
+ ...style.letterSpacing !== void 0 && { letterSpacing: px(style.letterSpacing) },
344
+ ...style.textTransform === "uppercase" && { textTransform: "uppercase" },
345
+ ...style.fontWeight !== void 0 && { fontWeight: style.fontWeight },
346
+ ...style.fontStyle && { fontStyle: style.fontStyle }
347
+ });
348
+ var toTypefaces = (typography) => Object.fromEntries(Object.entries(typography).map(([role, style]) => [role, toTypeface(style)]));
349
+ //#endregion
307
350
  //#region src/concepts/theme/themes/base.theme.ts
308
351
  var BaseButton = {
309
352
  borderRadius: 100,
@@ -359,6 +402,139 @@ var BaseContainer = {
359
402
  xxl: 28
360
403
  }
361
404
  };
405
+ var BaseTypography = {
406
+ "display-large": {
407
+ fontFamily: "Red Hat Display",
408
+ fontSize: 57,
409
+ lineHeight: 64,
410
+ fontWeight: "normal",
411
+ letterSpacing: -.25
412
+ },
413
+ "display-medium": {
414
+ fontFamily: "Red Hat Display",
415
+ fontSize: 45,
416
+ lineHeight: 52,
417
+ fontWeight: "normal"
418
+ },
419
+ "display-small": {
420
+ fontFamily: "Red Hat Display",
421
+ fontSize: 36,
422
+ lineHeight: 44,
423
+ fontWeight: "normal"
424
+ },
425
+ "headline-large": {
426
+ fontFamily: "Red Hat Display",
427
+ fontSize: 32,
428
+ lineHeight: 40,
429
+ fontWeight: "normal"
430
+ },
431
+ "headline-medium": {
432
+ fontFamily: "Red Hat Display",
433
+ fontSize: 28,
434
+ lineHeight: 36,
435
+ fontWeight: "normal"
436
+ },
437
+ "headline-small": {
438
+ fontFamily: "Red Hat Display",
439
+ fontSize: 24,
440
+ lineHeight: 32,
441
+ fontWeight: "normal"
442
+ },
443
+ "title-large": {
444
+ fontFamily: "Red Hat Display",
445
+ fontSize: 22,
446
+ lineHeight: 28,
447
+ fontWeight: "normal"
448
+ },
449
+ "title-medium": {
450
+ fontFamily: "Red Hat Display",
451
+ fontSize: 16,
452
+ lineHeight: 24,
453
+ fontWeight: "medium",
454
+ letterSpacing: .15
455
+ },
456
+ "title-small": {
457
+ fontFamily: "Red Hat Display",
458
+ fontWeight: "medium",
459
+ fontSize: 14,
460
+ lineHeight: 20,
461
+ letterSpacing: .1
462
+ },
463
+ "body-1-long": {
464
+ fontFamily: "Roboto",
465
+ fontSize: 16,
466
+ lineHeight: 22
467
+ },
468
+ "body-1-short": {
469
+ fontFamily: "Roboto",
470
+ fontSize: 16,
471
+ lineHeight: 24
472
+ },
473
+ "body-2-long": {
474
+ fontFamily: "Roboto",
475
+ fontSize: 14,
476
+ lineHeight: 18
477
+ },
478
+ "body-2-short": {
479
+ fontFamily: "Roboto",
480
+ fontSize: 14,
481
+ lineHeight: 20
482
+ },
483
+ "subtitle-1": {
484
+ fontFamily: "Red Hat Display",
485
+ fontSize: 16,
486
+ lineHeight: 24,
487
+ letterSpacing: .15
488
+ },
489
+ "subtitle-2": {
490
+ fontFamily: "Red Hat Display",
491
+ fontSize: 14,
492
+ lineHeight: 20,
493
+ fontWeight: "medium",
494
+ letterSpacing: .1
495
+ },
496
+ label: {
497
+ fontFamily: "Roboto",
498
+ fontSize: 14,
499
+ lineHeight: 20
500
+ },
501
+ button: {
502
+ fontFamily: "Red Hat Display",
503
+ fontSize: 14,
504
+ lineHeight: 20,
505
+ fontWeight: "medium",
506
+ textTransform: "capitalize"
507
+ },
508
+ caption: {
509
+ fontFamily: "Roboto",
510
+ fontSize: 12,
511
+ lineHeight: 18,
512
+ letterSpacing: .4
513
+ },
514
+ overline: {
515
+ fontFamily: "Red Hat Display",
516
+ fontSize: 10,
517
+ lineHeight: 18,
518
+ letterSpacing: 1.5,
519
+ textTransform: "uppercase"
520
+ },
521
+ paragraph: {
522
+ fontFamily: "Roboto",
523
+ fontSize: 16,
524
+ lineHeight: 24
525
+ },
526
+ quote: {
527
+ fontFamily: "Roboto",
528
+ fontSize: 16,
529
+ lineHeight: 24
530
+ },
531
+ note: {
532
+ fontFamily: "Roboto",
533
+ fontSize: 14,
534
+ lineHeight: 22,
535
+ fontStyle: "italic"
536
+ }
537
+ };
362
538
  var BaseTheme = {
363
539
  id: "BaseTheme",
364
540
  name: "Base Theme",
@@ -393,143 +569,52 @@ var BaseTheme = {
393
569
  "on-inverse-surface-primary": "#D0BCFF",
394
570
  scrim: "#000000",
395
571
  transparent: "rgba(0,0,0,0)",
572
+ ghost: "rgba(0,0,0,0)",
573
+ quaternary: "#79747E",
574
+ "on-quaternary": "#FFFFFF",
575
+ warn: "#B3261E",
576
+ "on-warn": "#FFFFFF",
577
+ success: "#2E7D32",
578
+ "on-success": "#FFFFFF",
579
+ disabled: "rgba(0,0,0,0.12)",
580
+ "on-disabled": "rgba(0,0,0,0.38)",
581
+ "on-primary-container-variant": "rgba(0,0,0,0.4)",
582
+ "on-primary-container-border": "#6750A4",
583
+ "on-secondary-container-variant": "rgba(0,0,0,0.4)",
584
+ "on-secondary-container-border": "#625B71",
585
+ "on-tertiary-container-variant": "rgba(0,0,0,0.4)",
586
+ "on-tertiary-container-border": "#7D5260",
587
+ "warn-container": "#F9DEDC",
588
+ "on-warn-container": "#8C1D18",
589
+ "on-warn-container-variant": "rgba(0,0,0,0.4)",
590
+ "on-warn-container-border": "#8C1D18",
591
+ "success-container": "#C6F0CD",
592
+ "on-success-container": "#1E5128",
593
+ "on-success-container-variant": "rgba(0,0,0,0.4)",
594
+ "on-success-container-border": "#1E5128",
595
+ "disabled-container": "#F2F2F2",
596
+ "on-disabled-container": "rgba(0,0,0,0.38)",
597
+ "inverse-container": "#313033",
598
+ "on-inverse-container": "#F4EFF4",
396
599
  "primary-surface": genericLightTheme.background,
397
600
  "on-primary-surface": genericLightTheme.onLight,
398
- "on-primary-surface-variant": genericLightTheme.primary
399
- },
400
- typography: {
401
- "display-large": {
402
- fontFamily: "Red Hat Display",
403
- fontSize: 57,
404
- lineHeight: 64,
405
- fontWeight: "normal",
406
- letterSpacing: -.25
407
- },
408
- "display-medium": {
409
- fontFamily: "Red Hat Display",
410
- fontSize: 45,
411
- lineHeight: 52,
412
- fontWeight: "normal"
413
- },
414
- "display-small": {
415
- fontFamily: "Red Hat Display",
416
- fontSize: 36,
417
- lineHeight: 44,
418
- fontWeight: "normal"
419
- },
420
- "headline-large": {
421
- fontFamily: "Red Hat Display",
422
- fontSize: 32,
423
- lineHeight: 40,
424
- fontWeight: "normal"
425
- },
426
- "headline-medium": {
427
- fontFamily: "Red Hat Display",
428
- fontSize: 28,
429
- lineHeight: 36,
430
- fontWeight: "normal"
431
- },
432
- "headline-small": {
433
- fontFamily: "Red Hat Display",
434
- fontSize: 24,
435
- lineHeight: 32,
436
- fontWeight: "normal"
437
- },
438
- "title-large": {
439
- fontFamily: "Red Hat Display",
440
- fontSize: 22,
441
- lineHeight: 28,
442
- fontWeight: "normal"
443
- },
444
- "title-medium": {
445
- fontFamily: "Red Hat Display",
446
- fontSize: 16,
447
- lineHeight: 24,
448
- fontWeight: "medium",
449
- letterSpacing: .15
450
- },
451
- "title-small": {
452
- fontFamily: "Red Hat Display",
453
- fontWeight: "medium",
454
- fontSize: 14,
455
- lineHeight: 20,
456
- letterSpacing: .1
457
- },
458
- "body-1-long": {
459
- fontFamily: "Roboto",
460
- fontSize: 16,
461
- lineHeight: 22
462
- },
463
- "body-1-short": {
464
- fontFamily: "Roboto",
465
- fontSize: 16,
466
- lineHeight: 24
467
- },
468
- "body-2-long": {
469
- fontFamily: "Roboto",
470
- fontSize: 14,
471
- lineHeight: 18
472
- },
473
- "body-2-short": {
474
- fontFamily: "Roboto",
475
- fontSize: 14,
476
- lineHeight: 20
477
- },
478
- "subtitle-1": {
479
- fontFamily: "Red Hat Display",
480
- fontSize: 16,
481
- lineHeight: 24,
482
- letterSpacing: .15
483
- },
484
- "subtitle-2": {
485
- fontFamily: "Red Hat Display",
486
- fontSize: 14,
487
- lineHeight: 20,
488
- fontWeight: "medium",
489
- letterSpacing: .1
490
- },
491
- label: {
492
- fontFamily: "Roboto",
493
- fontSize: 14,
494
- lineHeight: 20
495
- },
496
- button: {
497
- fontFamily: "Red Hat Display",
498
- fontSize: 14,
499
- lineHeight: 20,
500
- fontWeight: "medium",
501
- textTransform: "capitalize"
502
- },
503
- caption: {
504
- fontFamily: "Roboto",
505
- fontSize: 12,
506
- lineHeight: 18,
507
- letterSpacing: .4
508
- },
509
- overline: {
510
- fontFamily: "Red Hat Display",
511
- fontSize: 10,
512
- lineHeight: 18,
513
- letterSpacing: 1.5,
514
- textTransform: "uppercase"
515
- },
516
- paragraph: {
517
- fontFamily: "Roboto",
518
- fontSize: 16,
519
- lineHeight: 24
520
- },
521
- quote: {
522
- fontFamily: "Roboto",
523
- fontSize: 16,
524
- lineHeight: 24
525
- },
526
- note: {
527
- fontFamily: "Roboto",
528
- fontSize: 14,
529
- lineHeight: 22,
530
- fontStyle: "italic"
531
- }
601
+ "on-primary-surface-variant": genericLightTheme.primary,
602
+ "secondary-surface": "#F3EDF7",
603
+ "on-secondary-surface": "#1C1B1F",
604
+ "on-secondary-surface-variant": "#6750A4",
605
+ "tertiary-surface": "#F2F2F2",
606
+ "on-tertiary-surface": "#1C1B1F",
607
+ "on-tertiary-surface-variant": "#6750A4",
608
+ "quaternary-surface": "#E8DEF8",
609
+ "on-quaternary-surface": "#1C1B1F",
610
+ "on-quaternary-surface-variant": "#6750A4",
611
+ "disabled-surface": "rgba(0,0,0,0.12)",
612
+ "on-disabled-surface": "rgba(0,0,0,0.5)",
613
+ "on-disabled-surface-variant": "rgba(0,0,0,0.4)",
614
+ "on-inverse-surface-variant": "#D0BCFF",
615
+ "on-background-variant": "#959595"
532
616
  },
617
+ typography: BaseTypography,
533
618
  borders: {
534
619
  primary: `1px solid ${genericLightTheme.primary}`,
535
620
  secondary: `1px solid ${genericLightTheme.secondary}`,
@@ -668,7 +753,25 @@ var BaseTheme = {
668
753
  maxWidth: 560
669
754
  }
670
755
  },
671
- typefaces: {},
756
+ typefaces: {
757
+ ...toTypefaces(BaseTypography),
758
+ badge: {
759
+ fontFamily: "Red Hat Display",
760
+ fontSize: "16px",
761
+ lineHeight: "24px"
762
+ },
763
+ tag: {
764
+ fontFamily: "Red Hat Display",
765
+ fontSize: "15px",
766
+ lineHeight: "20px",
767
+ fontWeight: 600
768
+ },
769
+ input: {
770
+ fontFamily: "Red Hat Display",
771
+ fontSize: "14px",
772
+ lineHeight: "24px"
773
+ }
774
+ },
672
775
  icons: {},
673
776
  components: {
674
777
  alert: { options: {
@@ -1051,7 +1154,54 @@ var DarkTheme = {
1051
1154
  "inverse-surface": "#E6E1E5",
1052
1155
  "inverse-on-surface": "#313033",
1053
1156
  "inverse-on-surface-primary": "#6750A4",
1054
- transparent: "rgba(0,0,0,0)"
1157
+ "on-inverse-surface": "#313033",
1158
+ "on-inverse-surface-primary": "#6750A4",
1159
+ scrim: "#000000",
1160
+ transparent: "rgba(0,0,0,0)",
1161
+ ghost: "rgba(0,0,0,0)",
1162
+ quaternary: "#938F99",
1163
+ "on-quaternary": "#1C1B1F",
1164
+ warn: "#F2B8B5",
1165
+ "on-warn": "#601410",
1166
+ success: "#7FD98F",
1167
+ "on-success": "#00390F",
1168
+ disabled: "rgba(255,255,255,0.12)",
1169
+ "on-disabled": "rgba(255,255,255,0.38)",
1170
+ "on-primary-container-variant": "rgba(255,255,255,0.4)",
1171
+ "on-primary-container-border": "#EADDFF",
1172
+ "on-secondary-container-variant": "rgba(255,255,255,0.4)",
1173
+ "on-secondary-container-border": "#E8DEF8",
1174
+ "on-tertiary-container-variant": "rgba(255,255,255,0.4)",
1175
+ "on-tertiary-container-border": "#FFD8E4",
1176
+ "warn-container": "#8C1D18",
1177
+ "on-warn-container": "#F9DEDC",
1178
+ "on-warn-container-variant": "rgba(255,255,255,0.4)",
1179
+ "on-warn-container-border": "#F9DEDC",
1180
+ "success-container": "#1E5128",
1181
+ "on-success-container": "#C6F0CD",
1182
+ "on-success-container-variant": "rgba(255,255,255,0.4)",
1183
+ "on-success-container-border": "#C6F0CD",
1184
+ "disabled-container": "#2B2930",
1185
+ "on-disabled-container": "rgba(255,255,255,0.38)",
1186
+ "inverse-container": "#E6E1E5",
1187
+ "on-inverse-container": "#313033",
1188
+ "primary-surface": "#1C1B1F",
1189
+ "on-primary-surface": "#E6E1E5",
1190
+ "on-primary-surface-variant": "#D0BCFF",
1191
+ "secondary-surface": "#211F26",
1192
+ "on-secondary-surface": "#E6E1E5",
1193
+ "on-secondary-surface-variant": "#D0BCFF",
1194
+ "tertiary-surface": "#2B2930",
1195
+ "on-tertiary-surface": "#E6E1E5",
1196
+ "on-tertiary-surface-variant": "#D0BCFF",
1197
+ "quaternary-surface": "#36343B",
1198
+ "on-quaternary-surface": "#E6E1E5",
1199
+ "on-quaternary-surface-variant": "#D0BCFF",
1200
+ "disabled-surface": "rgba(255,255,255,0.12)",
1201
+ "on-disabled-surface": "rgba(255,255,255,0.5)",
1202
+ "on-disabled-surface-variant": "rgba(255,255,255,0.4)",
1203
+ "on-inverse-surface-variant": "#6750A4",
1204
+ "on-background-variant": "#8F8C93"
1055
1205
  }
1056
1206
  };
1057
1207
  //#endregion
@@ -1069,20 +1219,6 @@ var UniThemes = {
1069
1219
  };
1070
1220
  var DefaultThemeId = Object.keys(UniThemes)[0];
1071
1221
  //#endregion
1072
- //#region src/concepts/typography/typography.records.ts
1073
- var FontWeightMap = {
1074
- thin: 100,
1075
- "extra-light": 200,
1076
- light: 200,
1077
- normal: 400,
1078
- medium: 500,
1079
- "semi-bold": 600,
1080
- bold: 700,
1081
- "extra-bold": 800,
1082
- black: 900,
1083
- "extra-black": 950
1084
- };
1085
- //#endregion
1086
1222
  //#region src/utils/getValue.ts
1087
1223
  function getValue(data, path, defaultValue) {
1088
1224
  const value = path.split(/[.[\]]/).filter(Boolean).reduce((value, key) => value?.[key], data);
@@ -1130,6 +1266,9 @@ exports.getTriadicHues = getTriadicHues;
1130
1266
  exports.getValue = getValue;
1131
1267
  exports.gradient = gradient;
1132
1268
  exports.randomRangeValue = randomRangeValue;
1269
+ exports.removeInputPlatformStyling = removeInputPlatformStyling;
1270
+ exports.toTypeface = toTypeface;
1271
+ exports.toTypefaces = toTypefaces;
1133
1272
  exports.uniColor = uniColor;
1134
1273
 
1135
1274
  //# sourceMappingURL=index.cjs.map