@cambly/syntax-core 9.2.0 → 9.4.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/index.d.ts CHANGED
@@ -417,7 +417,7 @@ type BoxProps = {
417
417
  */
418
418
  declare const Box: React$1.ForwardRefExoticComponent<BoxProps & React$1.RefAttributes<HTMLDivElement>>;
419
419
 
420
- declare const Color: readonly ["primary", "secondary", "tertiary", "branded", "destructive-primary", "destructive-secondary", "destructive-tertiary", "success", "gray200", "gray700", "gray800", "gray900", "white", "inherit"];
420
+ declare const Color: readonly ["primary", "secondary", "tertiary", "branded", "inverse", "destructive-primary", "destructive-secondary", "destructive-tertiary", "success", "gray200", "gray700", "gray800", "gray900", "white", "inherit"];
421
421
  declare const Size: readonly ["sm", "md", "lg"];
422
422
 
423
423
  type ButtonProps = {
@@ -438,7 +438,7 @@ type ButtonProps = {
438
438
  *
439
439
  * @defaultValue "primary"
440
440
  */
441
- color?: "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success";
441
+ color?: "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inverse";
442
442
  /**
443
443
  * The size of the button
444
444
  *
@@ -651,7 +651,7 @@ declare namespace Divider {
651
651
  /**
652
652
  * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.
653
653
  */
654
- declare const Heading: ({ align, as, children, color, "data-testid": dataTestId, size, }: {
654
+ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId, lineClamp, size, }: {
655
655
  /**
656
656
  * Aligns the text to the left, right, or center of the container.
657
657
  * * `start` and `end` will align the text to the left or right of the container depending on the locale.
@@ -675,11 +675,15 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
675
675
  *
676
676
  * @defaultValue "gray900"
677
677
  */
678
- color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "gray700" | "gray800" | "white" | "inherit" | undefined;
678
+ color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inverse" | "gray700" | "gray800" | "white" | "inherit" | undefined;
679
679
  /**
680
680
  * Test id for the text.
681
681
  */
682
682
  "data-testid"?: string | undefined;
683
+ /**
684
+ * The number of lines we should truncate the text at
685
+ */
686
+ lineClamp?: number | undefined;
683
687
  /**
684
688
  * Size of the text.
685
689
  *
@@ -1190,7 +1194,7 @@ declare const Typography: ({ align, as, children, color, "data-testid": dataTest
1190
1194
  *
1191
1195
  * @defaultValue "gray900"
1192
1196
  */
1193
- color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "gray700" | "gray800" | "white" | "inherit" | undefined;
1197
+ color?: "gray200" | "gray900" | "primary" | "secondary" | "tertiary" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "branded" | "success" | "inverse" | "gray700" | "gray800" | "white" | "inherit" | undefined;
1194
1198
  /**
1195
1199
  * Test id for the text
1196
1200
  */
package/dist/index.js CHANGED
@@ -508,6 +508,8 @@ function backgroundColor(color) {
508
508
  return colors_module_default2.whiteBackgroundColor;
509
509
  case "branded":
510
510
  return colors_module_default2.yellow700BackgroundColor;
511
+ case "inverse":
512
+ return colors_module_default2.gray60BackgroundColor;
511
513
  default:
512
514
  return colors_module_default2.primary700BackgroundColor;
513
515
  }
@@ -524,6 +526,8 @@ function foregroundColor(color) {
524
526
  return colors_module_default2.destructive700Color;
525
527
  case "branded":
526
528
  return colors_module_default2.gray900Color;
529
+ case "inverse":
530
+ return colors_module_default2.whiteColor;
527
531
  default:
528
532
  return colors_module_default2.whiteColor;
529
533
  }
@@ -540,6 +544,8 @@ function foregroundTypographyColor(color) {
540
544
  return "destructive-primary";
541
545
  case "branded":
542
546
  return "gray900";
547
+ case "inverse":
548
+ return "white";
543
549
  default:
544
550
  return "white";
545
551
  }
@@ -981,6 +987,7 @@ var Heading = ({
981
987
  children,
982
988
  color = "gray900",
983
989
  "data-testid": dataTestId,
990
+ lineClamp,
984
991
  size = 500
985
992
  }) => {
986
993
  const weight = [700, 800].includes(size) ? "heavy" : "bold";
@@ -991,6 +998,7 @@ var Heading = ({
991
998
  as,
992
999
  color,
993
1000
  "data-testid": dataTestId,
1001
+ lineClamp,
994
1002
  size,
995
1003
  weight,
996
1004
  children