@trackunit/ui-design-tokens 0.0.56 → 0.0.58

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/index.js CHANGED
@@ -426,6 +426,21 @@ const rentalStatusPalette = {
426
426
  IN_REPAIR: { 100: "255 233 233", 600: "255 90 90" },
427
427
  OTHER_RENTAL_STATUS: { 100: "238 239 239", 600: "151 154 154" },
428
428
  };
429
+ /**
430
+ * Colors of the different site types.
431
+ *
432
+ * The generator has an issue with underscores in variant names, which is why they are not used below.
433
+ */
434
+ const sitesPalette = {
435
+ SITE: {
436
+ AREA: tailwindPalette.blue["600"],
437
+ CLASSIC_POI: tailwindPalette.neutral["500"],
438
+ CLASSIC_ZONE: tailwindPalette.neutral["500"],
439
+ DEPOT: tailwindPalette.violet["600"],
440
+ WORK_PLACE: tailwindPalette.emerald["500"],
441
+ CONSTRUCTION_SITE: tailwindPalette.amber["500"],
442
+ },
443
+ };
429
444
  /**
430
445
  * Grouped Theme Colors
431
446
  */
@@ -442,11 +457,13 @@ const groupedPalettes = {
442
457
  UTILIZATION: utilizationPalette,
443
458
  // Rental
444
459
  RENTAL: rentalStatusPalette,
460
+ // Sites
461
+ SITES: sitesPalette,
445
462
  };
446
463
  /**
447
464
  * The full theme color palette (flattened)
448
465
  */
449
- const trackunitPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, generalPalette), intentPalette), criticalityPalette), activityPalette), utilizationPalette), rentalStatusPalette);
466
+ const trackunitPalette = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, generalPalette), intentPalette), criticalityPalette), activityPalette), utilizationPalette), rentalStatusPalette), sitesPalette);
450
467
 
451
468
  /**
452
469
  * A collection of all the tokens related to the named colors in the default theme.
@@ -485,6 +502,7 @@ const themeColors = {
485
502
  PICKUP_READY: { name: "pickup_ready", variants: trackunitPalette.PICKUP_READY },
486
503
  RETURNED: { name: "returned", variants: trackunitPalette.RETURNED },
487
504
  TRANSFER: { name: "transfer", variants: trackunitPalette.TRANSFER },
505
+ SITE: { name: "site", variants: trackunitPalette.SITE },
488
506
  };
489
507
 
490
508
  const outputOptions = ["HEX", "CSS"];
@@ -507,11 +525,12 @@ function color(ColorKey, arg2, arg3) {
507
525
  variant = arg2;
508
526
  }
509
527
  }
528
+ const variableName = `--color-${colorName}-${String(variant)}`.replace(/[^a-zA-Z0-9]/g, "-");
510
529
  if (output === "CSS") {
511
- return colorVariableToCss(`--color-${colorName}-${String(variant)}`);
530
+ return colorVariableToCss(variableName);
512
531
  }
513
- if (output === "HEX") {
514
- return getHEX(`--color-${colorName}-${String(variant)}`);
532
+ else if (output === "HEX") {
533
+ return getHEX(variableName);
515
534
  }
516
535
  return colorName;
517
536
  }
@@ -587,4 +606,4 @@ const tokens = {
587
606
  fontFamily: `'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif`,
588
607
  };
589
608
 
590
- export { DEFAULT_CHART_COLORS, activityPalette, color, criticalityPalette, elevation, fontSize, fontWeight, generalPalette, getReorderedChartColors, groupedPalettes, intentPalette, rentalStatusPalette, tailwindPalette, themeColors, tokens, trackunitPalette, utilizationPalette };
609
+ export { DEFAULT_CHART_COLORS, activityPalette, color, criticalityPalette, elevation, fontSize, fontWeight, generalPalette, getReorderedChartColors, groupedPalettes, intentPalette, rentalStatusPalette, sitesPalette, tailwindPalette, themeColors, tokens, trackunitPalette, utilizationPalette };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/ui-design-tokens",
3
- "version": "0.0.56",
3
+ "version": "0.0.58",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "module": "./index.js",
@@ -302,6 +302,23 @@ export declare const rentalStatusPalette: {
302
302
  */
303
303
  export type RentalStatusColorKeys = keyof typeof rentalStatusPalette;
304
304
  export type RentalStatusColors = `${Lowercase<RentalStatusColorKeys>}`;
305
+ /**
306
+ * Colors of the different site types.
307
+ *
308
+ * The generator has an issue with underscores in variant names, which is why they are not used below.
309
+ */
310
+ export declare const sitesPalette: {
311
+ readonly SITE: {
312
+ readonly AREA: "37 99 235";
313
+ readonly CLASSIC_POI: "115 115 115";
314
+ readonly CLASSIC_ZONE: "115 115 115";
315
+ readonly DEPOT: "124 58 237";
316
+ readonly WORK_PLACE: "16 185 129";
317
+ readonly CONSTRUCTION_SITE: "245 158 11";
318
+ };
319
+ };
320
+ export type SitesColorKeys = keyof typeof sitesPalette;
321
+ export type SitesColors = `${Lowercase<SitesColorKeys>}`;
305
322
  /**
306
323
  * Grouped Theme Colors
307
324
  */
@@ -550,11 +567,29 @@ export declare const groupedPalettes: {
550
567
  readonly 600: "151 154 154";
551
568
  };
552
569
  };
570
+ readonly SITES: {
571
+ readonly SITE: {
572
+ readonly AREA: "37 99 235";
573
+ readonly CLASSIC_POI: "115 115 115";
574
+ readonly CLASSIC_ZONE: "115 115 115";
575
+ readonly DEPOT: "124 58 237";
576
+ readonly WORK_PLACE: "16 185 129";
577
+ readonly CONSTRUCTION_SITE: "245 158 11";
578
+ };
579
+ };
553
580
  };
554
581
  /**
555
582
  * The full theme color palette (flattened)
556
583
  */
557
584
  export declare const trackunitPalette: {
585
+ readonly SITE: {
586
+ readonly AREA: "37 99 235";
587
+ readonly CLASSIC_POI: "115 115 115";
588
+ readonly CLASSIC_ZONE: "115 115 115";
589
+ readonly DEPOT: "124 58 237";
590
+ readonly WORK_PLACE: "16 185 129";
591
+ readonly CONSTRUCTION_SITE: "245 158 11";
592
+ };
558
593
  readonly ON_RENT: {
559
594
  readonly 100: "223 244 254";
560
595
  readonly 600: "90 200 250";