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