@cambly/syntax-core 6.3.0 → 6.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
@@ -40,7 +40,7 @@ declare const Badge: ({ text, color, }: {
40
40
  *
41
41
  * @defaultValue "primary700"
42
42
  */
43
- color?: "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | undefined;
43
+ color?: "gray200" | "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | undefined;
44
44
  }) => JSX.Element;
45
45
 
46
46
  type AlignItems = "baseline" | "center" | "end" | "start" | "stretch";
@@ -81,7 +81,7 @@ declare const Box: React$1.ForwardRefExoticComponent<{
81
81
  /**
82
82
  * The background color of the box.
83
83
  */
84
- backgroundColor?: "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | "black" | "destructive100" | "destructive200" | "destructive300" | "destructive800" | "destructive900" | "gray10" | "gray100" | "gray200" | "gray30" | "gray60" | "gray300" | "gray700" | "gray80" | "gray800" | "orange100" | "orange200" | "orange300" | "orange800" | "orange900" | "primary100" | "primary200" | "primary300" | "primary800" | "primary900" | "purple100" | "purple200" | "purple300" | "purple800" | "purple900" | "success100" | "success200" | "success300" | "success800" | "success900" | "white" | "yellow100" | "yellow200" | "yellow300" | "yellow800" | "yellow900" | undefined;
84
+ backgroundColor?: "gray200" | "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | "black" | "destructive100" | "destructive200" | "destructive300" | "destructive800" | "destructive900" | "gray10" | "gray100" | "gray30" | "gray60" | "gray300" | "gray700" | "gray80" | "gray800" | "orange100" | "orange200" | "orange300" | "orange800" | "orange900" | "primary100" | "primary200" | "primary300" | "primary800" | "primary900" | "purple100" | "purple200" | "purple300" | "purple800" | "purple900" | "success100" | "success200" | "success300" | "success800" | "success900" | "white" | "yellow100" | "yellow200" | "yellow300" | "yellow800" | "yellow900" | undefined;
85
85
  /**
86
86
  * The children to be rendered inside the box.
87
87
  */
@@ -538,7 +538,7 @@ declare const Heading: ({ align, as, children, color, size, }: {
538
538
  *
539
539
  * @defaultValue "gray900"
540
540
  */
541
- color?: "gray900" | "gray200" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
541
+ color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
542
542
  /**
543
543
  * Size of the text.
544
544
  *
@@ -940,7 +940,7 @@ declare const Typography: ({ align, as, children, color, inline, lineClamp, size
940
940
  *
941
941
  * @defaultValue "gray900"
942
942
  */
943
- color?: "gray900" | "gray200" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
943
+ color?: "gray200" | "gray900" | "gray700" | "gray800" | "white" | "primary" | "secondary" | "tertiary" | "branded" | "destructive-primary" | "destructive-secondary" | "destructive-tertiary" | "success" | "inherit" | undefined;
944
944
  /**
945
945
  * Whether the text should flow inline with other elements.
946
946
  *
package/dist/index.js CHANGED
@@ -426,6 +426,15 @@ var Box_default = Box;
426
426
 
427
427
  // src/Badge/Badge.tsx
428
428
  var import_jsx_runtime4 = require("react/jsx-runtime");
429
+ var textColorForBackgroundColor = (color) => {
430
+ switch (color) {
431
+ case "gray200":
432
+ case "yellow700":
433
+ return "gray900";
434
+ default:
435
+ return "white";
436
+ }
437
+ };
429
438
  var Badge = ({
430
439
  text,
431
440
  color = "primary700"
@@ -440,7 +449,7 @@ var Badge = ({
440
449
  children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
441
450
  Typography_default,
442
451
  {
443
- color: color === "yellow700" ? "gray900" : "white",
452
+ color: textColorForBackgroundColor(color),
444
453
  size: 100,
445
454
  weight: "bold",
446
455
  children: text