@cambly/syntax-core 22.2.4 → 22.3.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.
@@ -23,7 +23,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
23
23
  *
24
24
  * @defaultValue "sky"
25
25
  */
26
- color?: "destructive300" | "success300" | "yellow700" | "gray370" | "gray870" | "cream" | "lilac" | "orange" | "pink" | "sky" | "tan" | "thistle" | "silver" | "blackandwhite" | undefined;
26
+ color?: "destructive100" | "destructive300" | "success100" | "success300" | "yellow700" | "gray370" | "gray870" | "cream" | "lilac" | "orange" | "pink" | "sky" | "tan" | "thistle" | "silver" | "blackandwhite" | "graytertiary" | undefined;
27
27
  }) => JSX.Element;
28
28
 
29
29
  export { Badge as default };
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Badge_default
4
- } from "../__chunks/WAZXVASL.js";
4
+ } from "../__chunks/UCZXBZIM.js";
5
5
  import "../__chunks/X552U42S.js";
6
6
  import "../__chunks/4U4UW4AK.js";
7
7
  import "../__chunks/4U4UW4AK.js";
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  RichSelectList_default
4
- } from "../__chunks/GACBJJPV.js";
4
+ } from "../__chunks/T45OV23J.js";
5
5
  import "../__chunks/R6OBV53M.js";
6
6
  import "../__chunks/36DG472B.js";
7
7
  import "../__chunks/WJ4QY73I.js";
@@ -12,7 +12,7 @@ import "../__chunks/576PJXFR.js";
12
12
  import "../__chunks/3WKVZ2UU.js";
13
13
  import "../__chunks/KEJPRZJ5.js";
14
14
  import "../__chunks/4U4UW4AK.js";
15
- import "../__chunks/VYTCS7ZI.js";
15
+ import "../__chunks/LT74X66Y.js";
16
16
  import "../__chunks/Y53Z25OG.js";
17
17
  import "../__chunks/DDUJFFG7.js";
18
18
  import "../__chunks/N7G37EKF.js";
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  SelectList
4
- } from "../__chunks/Y4KXOKZN.js";
4
+ } from "../__chunks/IU7WRY4P.js";
5
5
  import "../__chunks/SPQ7DQHG.js";
6
- import "../__chunks/VYTCS7ZI.js";
6
+ import "../__chunks/LT74X66Y.js";
7
7
  import "../__chunks/KKADUD65.js";
8
8
  import "../__chunks/X552U42S.js";
9
9
  import "../__chunks/4U4UW4AK.js";
@@ -1,8 +1,8 @@
1
1
  "use client"
2
2
  import {
3
3
  TextField
4
- } from "../__chunks/YNRTHU5Z.js";
5
- import "../__chunks/WAZXVASL.js";
4
+ } from "../__chunks/ZJMZR5UG.js";
5
+ import "../__chunks/UCZXBZIM.js";
6
6
  import "../__chunks/4U4UW4AK.js";
7
7
  import "../__chunks/X552U42S.js";
8
8
  import "../__chunks/4U4UW4AK.js";
@@ -6,7 +6,7 @@ import {
6
6
  ColorBaseDestructive700,
7
7
  ColorBaseGray700,
8
8
  ColorCambioWhite100
9
- } from "./VYTCS7ZI.js";
9
+ } from "./LT74X66Y.js";
10
10
  import {
11
11
  Focus_module_default
12
12
  } from "./KKADUD65.js";
@@ -140,4 +140,4 @@ SelectList.Option = SelectOption_default;
140
140
  export {
141
141
  SelectList
142
142
  };
143
- //# sourceMappingURL=Y4KXOKZN.js.map
143
+ //# sourceMappingURL=IU7WRY4P.js.map
@@ -10,4 +10,4 @@ export {
10
10
  ColorBaseGray700,
11
11
  ColorCambioWhite100
12
12
  };
13
- //# sourceMappingURL=VYTCS7ZI.js.map
13
+ //# sourceMappingURL=LT74X66Y.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Wed, 25 Jun 2025 03:45:17 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAUhC,IAAM,mBAAmB;AAqCzB,IAAM,sBAAsB;","names":[]}
1
+ {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Wed, 06 Aug 2025 19:04:06 GMT\n */\n\nexport const ColorBaseBlack = \"#000000\";\nexport const ColorBaseDestructive100 = \"#fef3f5\";\nexport const ColorBaseDestructive200 = \"#fad6de\";\nexport const ColorBaseDestructive300 = \"#f2a2b2\";\nexport const ColorBaseDestructive700 = \"#d32a4b\";\nexport const ColorBaseDestructive800 = \"#81162c\";\nexport const ColorBaseDestructive900 = \"#55101d\";\nexport const ColorBaseGray10 = \"#cbcbcb\"; // Used as the default color for dividers and inner strokes\nexport const ColorBaseGray30 = \"#000000\"; // For IconButton background when on top of an image\nexport const ColorBaseGray60 = \"#000000\"; // Used for icon background in classroom video grid\nexport const ColorBaseGray80 = \"#000000\"; // Used as the background for modals\nexport const ColorBaseGray100 = \"#f7f7f7\";\nexport const ColorBaseGray200 = \"#f0f0f0\"; // Used for light mode backgrounds when showing card content on top\nexport const ColorBaseGray300 = \"#d0d0d0\"; // Used for component outlines, eg: select and textfield\nexport const ColorBaseGray700 = \"#767676\"; // For secondary text in light mode\nexport const ColorBaseGray800 = \"#353535\";\nexport const ColorBaseGray900 = \"#191919\"; // Default text color, Classroom background\nexport const ColorBaseOrange100 = \"#fdf2f0\";\nexport const ColorBaseOrange200 = \"#f6cdc4\";\nexport const ColorBaseOrange300 = \"#ec9987\";\nexport const ColorBaseOrange700 = \"#c34124\";\nexport const ColorBaseOrange800 = \"#732818\";\nexport const ColorBaseOrange900 = \"#4d1a10\";\nexport const ColorBasePrimary100 = \"#eff6fa\";\nexport const ColorBasePrimary200 = \"#c1dbe7\";\nexport const ColorBasePrimary300 = \"#84b7d0\";\nexport const ColorBasePrimary700 = \"#236482\";\nexport const ColorBasePrimary800 = \"#274858\";\nexport const ColorBasePrimary900 = \"#1b303b\";\nexport const ColorBaseSuccess100 = \"#eff7f1\";\nexport const ColorBaseSuccess200 = \"#bddcc6\";\nexport const ColorBaseSuccess300 = \"#81ba92\";\nexport const ColorBaseSuccess700 = \"#397b4d\";\nexport const ColorBaseSuccess800 = \"#2d4936\";\nexport const ColorBaseSuccess900 = \"#1e3124\";\nexport const ColorBasePurple100 = \"#f9f5fa\";\nexport const ColorBasePurple200 = \"#e8dceb\";\nexport const ColorBasePurple300 = \"#cdb4d3\";\nexport const ColorBasePurple700 = \"#8b5f95\";\nexport const ColorBasePurple800 = \"#523b58\";\nexport const ColorBasePurple900 = \"#37273b\";\nexport const ColorBaseYellow100 = \"#fdf5d9\";\nexport const ColorBaseYellow200 = \"#fbe8a3\";\nexport const ColorBaseYellow300 = \"#f8d663\";\nexport const ColorBaseYellow700 = \"#ffc929\";\nexport const ColorBaseYellow800 = \"#765f1c\";\nexport const ColorBaseYellow900 = \"#3b3009\";\nexport const ColorBaseWhite = \"#ffffff\";\nexport const ColorCambioBlack = \"#050500\";\nexport const ColorCambioWhite40 = \"#ffffff\";\nexport const ColorCambioWhite70 = \"#ffffff\";\nexport const ColorCambioWhite100 = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray270 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#5e5952\";\nexport const ColorCambioGray800 = \"#363432\";\nexport const ColorCambioGray870 = \"#5e5952\";\nexport const ColorCambioGray900 = \"#262625\";\nexport const ColorCambioDestructive100 = \"#ffdeda\";\nexport const ColorCambioDestructive300 = \"#ff8071\";\nexport const ColorCambioDestructive370 = \"#ff8071\";\nexport const ColorCambioDestructive700 = \"#c93f32\";\nexport const ColorCambioDestructive770 = \"#c93f32\";\nexport const ColorCambioDestructive900 = \"#6d0002\";\nexport const ColorCambioSuccess100 = \"#daf2c8\";\nexport const ColorCambioSuccess300 = \"#84ce64\";\nexport const ColorCambioSuccess370 = \"#84ce64\";\nexport const ColorCambioSuccess700 = \"#3c7f20\";\nexport const ColorCambioSuccess770 = \"#3c7f20\";\nexport const ColorCambioSuccess900 = \"#103e00\";\nexport const ColorCambioRed = \"#f56e56\";\nexport const ColorCambioOrange = \"#ff8f57\";\nexport const ColorCambioTan = \"#ffb47d\";\nexport const ColorCambioCream = \"#fffad1\";\nexport const ColorCambioPurple = \"#6840a8\";\nexport const ColorCambioLilac = \"#b59ef0\";\nexport const ColorCambioThistle = \"#d69ca4\";\nexport const ColorCambioPink = \"#ffccea\";\nexport const ColorCambioNavy = \"#191142\";\nexport const ColorCambioTeal = \"#44a6cf\";\nexport const ColorCambioSlate = \"#7c9fc6\";\nexport const ColorCambioSky = \"#b1e8fc\";\nexport const ColorCambioYellow700 = \"#ffe733\";\nexport const ColorCambioTransparentFull = \"#000000\";\nexport const Elevation400 = \"0px 16px 32px 0px #00000040\";\nexport const SyntaxFontSansSerif = \"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif\";\nexport const ShadowInteractive = \"0px 3px 16px 0px rgba(144, 134, 130, 0.05), 0px 2px 30px 0px rgba(144, 134, 130, 0.02)\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAUhC,IAAM,mBAAmB;AAqCzB,IAAM,sBAAsB;","names":[]}
@@ -14,7 +14,7 @@ import {
14
14
  ColorBaseDestructive700,
15
15
  ColorBaseGray700,
16
16
  ColorCambioWhite100
17
- } from "./VYTCS7ZI.js";
17
+ } from "./LT74X66Y.js";
18
18
  import {
19
19
  RichSelectSection_default
20
20
  } from "./Y53Z25OG.js";
@@ -293,4 +293,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
293
293
  export {
294
294
  RichSelectList_default
295
295
  };
296
- //# sourceMappingURL=GACBJJPV.js.map
296
+ //# sourceMappingURL=T45OV23J.js.map
@@ -25,7 +25,11 @@ var textColorForBackgroundColor = (color) => {
25
25
  case "cream":
26
26
  case "silver":
27
27
  case "yellow700":
28
+ case "success100":
29
+ case "destructive100":
28
30
  return "gray900";
31
+ case "graytertiary":
32
+ return "gray700";
29
33
  default:
30
34
  return "white";
31
35
  }
@@ -36,6 +40,8 @@ var backgroundColorForColor = (color) => {
36
40
  return void 0;
37
41
  case "blackandwhite":
38
42
  return void 0;
43
+ case "graytertiary":
44
+ return void 0;
39
45
  default:
40
46
  return color;
41
47
  }
@@ -56,6 +62,13 @@ var inlineStylesForColor = (color) => {
56
62
  paddingTop: "3px",
57
63
  paddingBottom: "3px"
58
64
  };
65
+ case "graytertiary":
66
+ return {
67
+ background: "white",
68
+ border: "1px solid var(--color-base-gray-300)",
69
+ paddingTop: "3px",
70
+ paddingBottom: "3px"
71
+ };
59
72
  default:
60
73
  return {};
61
74
  }
@@ -108,4 +121,4 @@ var Badge_default = Badge;
108
121
  export {
109
122
  Badge_default
110
123
  };
111
- //# sourceMappingURL=WAZXVASL.js.map
124
+ //# sourceMappingURL=UCZXBZIM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["css-module:./Badge.module.css#css-module","../../src/Badge/Badge.tsx"],"sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Badge/Badge.module.css\"; export default {\"icon\":\"_icon_1g9xb_1\"}","import { type ComponentProps } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport styles from \"./Badge.module.css\";\nimport type InternalIcon from \"../Icon/Icon\";\n\nconst badgeColor = [\n \"sky\",\n \"success300\",\n \"destructive300\",\n \"orange\",\n \"tan\",\n \"gray370\",\n \"gray870\",\n \"lilac\",\n \"thistle\",\n \"pink\",\n \"cream\",\n \"yellow700\",\n \"silver\",\n \"blackandwhite\",\n \"success100\",\n \"destructive100\",\n \"graytertiary\",\n] as const;\n\ntype BadgeColor = (typeof badgeColor)[number];\n\nconst textColorForBackgroundColor = (\n color: BadgeColor,\n): \"gray900\" | \"white\" | \"gray700\" => {\n switch (color) {\n case \"gray370\":\n case \"destructive300\":\n case \"orange\":\n case \"tan\":\n case \"success300\":\n case \"sky\":\n case \"thistle\":\n case \"pink\":\n case \"lilac\":\n case \"cream\":\n case \"silver\":\n case \"yellow700\":\n case \"success100\":\n case \"destructive100\":\n return \"gray900\";\n case \"graytertiary\":\n return \"gray700\";\n default:\n return \"white\";\n }\n};\n\nconst backgroundColorForColor = (\n color: BadgeColor,\n):\n | Exclude<BadgeColor, \"silver\" | \"blackandwhite\" | \"graytertiary\">\n | undefined => {\n switch (color) {\n case \"silver\":\n return undefined;\n case \"blackandwhite\":\n return undefined;\n case \"graytertiary\":\n return undefined;\n default:\n return color;\n }\n};\n\nconst inlineStylesForColor = (\n color: BadgeColor,\n): Record<string, string | number | null> => {\n switch (color) {\n case \"silver\":\n return {\n background:\n \"linear-gradient(85deg, #CECECE -8.89%, #EEECEC 38.35%, #FFF 49.64%, #E9E8E8 66.22%) padding-box, \\\n linear-gradient(83.45deg, #A9A9A9 2.57%, #E5E2E2 61.77%, #6E6E6E 100.3%) border-box\",\n border: \"1px solid transparent\",\n paddingTop: \"3px\",\n paddingBottom: \"3px\",\n };\n case \"blackandwhite\":\n return {\n background:\n \"linear-gradient(65deg, #000 12.53%, #949494 45.45%, #000 81.69%)\",\n border: \"1px solid transparent\",\n paddingTop: \"3px\",\n paddingBottom: \"3px\",\n };\n case \"graytertiary\":\n return {\n background: \"white\",\n border: \"1px solid var(--color-base-gray-300)\",\n paddingTop: \"3px\",\n paddingBottom: \"3px\",\n };\n default:\n return {};\n }\n};\n\n/**\n * [Badge](https://cambly-syntax.vercel.app/?path=/docs/components-badge--docs) is a component to display short text and give additional context to features and other components.\n */\nconst Badge = ({\n icon: Icon,\n text,\n color = \"sky\",\n}: {\n /**\n * The icon to be displayed. Please use a [Material Icon](https://material.io/resources/icons/)\n */\n icon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The text to display inside the badge\n */\n text: string;\n /**\n * The color of the badge\n *\n * @defaultValue \"sky\"\n */\n color?: (typeof badgeColor)[number];\n}): JSX.Element => {\n return (\n <Box\n display=\"inlineFlex\"\n paddingX={2}\n paddingY={1}\n rounding={\"sm\"}\n backgroundColor={backgroundColorForColor(color)}\n alignItems=\"center\"\n justifyContent=\"center\"\n minHeight={24}\n dangerouslySetInlineStyle={{\n __style: inlineStylesForColor(color),\n }}\n >\n <Typography\n size={0}\n weight=\"medium\"\n color={textColorForBackgroundColor(color)}\n >\n <Box display=\"flex\" gap={1} alignItems=\"center\" justifyContent=\"start\">\n {Icon && <Icon className={styles.icon} size={100} />}\n <Typography\n color={textColorForBackgroundColor(color)}\n size={0}\n weight=\"medium\"\n transform=\"uppercase\"\n >\n {text}\n </Typography>\n </Box>\n </Typography>\n </Box>\n );\n};\n\nexport default Badge;\n"],"mappings":";;;;;;;;;AAA0F,IAAO,uBAAQ,EAAC,QAAO,gBAAe;;;ACoJxH,SACW,KADX;AAxHR,IAAM,8BAA8B,CAClC,UACoC;AACpC,UAAQ,OAAO;AAAA,IACb,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AA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Q,QAAO,KAAK,GAAG,YAAW,UAAS,gBAAe,SAC5D;AAAA,oBAAQ,oBAAC,QAAK,WAAW,qBAAO,MAAM,MAAM,KAAK;AAAA,YAClD;AAAA,cAAC;AAAA;AAAA,gBACC,OAAO,4BAA4B,KAAK;AAAA,gBACxC,MAAM;AAAA,gBACN,QAAO;AAAA,gBACP,WAAU;AAAA,gBAET;AAAA;AAAA,YACH;AAAA,aACF;AAAA;AAAA,MACF;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Badge_default
4
- } from "./WAZXVASL.js";
4
+ } from "./UCZXBZIM.js";
5
5
  import {
6
6
  Box_default
7
7
  } from "./X552U42S.js";
@@ -118,4 +118,4 @@ function TextField({
118
118
  export {
119
119
  TextField
120
120
  };
121
- //# sourceMappingURL=YNRTHU5Z.js.map
121
+ //# sourceMappingURL=ZJMZR5UG.js.map
package/dist/index.js CHANGED
@@ -38,11 +38,11 @@ import {
38
38
  } from "./__chunks/STLN5GZL.js";
39
39
  import {
40
40
  SelectList
41
- } from "./__chunks/Y4KXOKZN.js";
41
+ } from "./__chunks/IU7WRY4P.js";
42
42
  import "./__chunks/SPQ7DQHG.js";
43
43
  import {
44
44
  RichSelectList_default
45
- } from "./__chunks/GACBJJPV.js";
45
+ } from "./__chunks/T45OV23J.js";
46
46
  import "./__chunks/R6OBV53M.js";
47
47
  import {
48
48
  ButtonGroup_default
@@ -63,7 +63,7 @@ import {
63
63
  IconButton_default
64
64
  } from "./__chunks/KEJPRZJ5.js";
65
65
  import "./__chunks/4U4UW4AK.js";
66
- import "./__chunks/VYTCS7ZI.js";
66
+ import "./__chunks/LT74X66Y.js";
67
67
  import "./__chunks/Y53Z25OG.js";
68
68
  import "./__chunks/DDUJFFG7.js";
69
69
  import "./__chunks/N7G37EKF.js";
@@ -86,10 +86,10 @@ import {
86
86
  } from "./__chunks/KTX4P4Q2.js";
87
87
  import {
88
88
  TextField
89
- } from "./__chunks/YNRTHU5Z.js";
89
+ } from "./__chunks/ZJMZR5UG.js";
90
90
  import {
91
91
  Badge_default
92
- } from "./__chunks/WAZXVASL.js";
92
+ } from "./__chunks/UCZXBZIM.js";
93
93
  import {
94
94
  TextArea_default
95
95
  } from "./__chunks/OCGBS7FM.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cambly/syntax-core",
3
3
  "description": "Cambly design system core components",
4
- "version": "22.2.4",
4
+ "version": "22.3.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["css-module:./Badge.module.css#css-module","../../src/Badge/Badge.tsx"],"sourcesContent":["import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/Badge/Badge.module.css\"; export default {\"icon\":\"_icon_1g9xb_1\"}","import { type ComponentProps } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport Box from \"../Box/Box\";\nimport styles from \"./Badge.module.css\";\nimport type InternalIcon from \"../Icon/Icon\";\n\nconst badgeColor = [\n \"sky\",\n \"success300\",\n \"destructive300\",\n \"orange\",\n \"tan\",\n \"gray370\",\n \"gray870\",\n \"lilac\",\n \"thistle\",\n \"pink\",\n \"cream\",\n \"yellow700\",\n \"silver\",\n \"blackandwhite\",\n] as const;\n\ntype BadgeColor = (typeof badgeColor)[number];\n\nconst textColorForBackgroundColor = (\n color: BadgeColor,\n): \"gray900\" | \"white\" => {\n switch (color) {\n case \"gray370\":\n case \"destructive300\":\n case \"orange\":\n case \"tan\":\n case \"success300\":\n case \"sky\":\n case \"thistle\":\n case \"pink\":\n case \"lilac\":\n case \"cream\":\n case \"silver\":\n case \"yellow700\":\n return \"gray900\";\n default:\n return \"white\";\n }\n};\n\nconst backgroundColorForColor = (\n color: BadgeColor,\n): Exclude<BadgeColor, \"silver\" | \"blackandwhite\"> | undefined => {\n switch (color) {\n case \"silver\":\n return undefined;\n case \"blackandwhite\":\n return undefined;\n default:\n return color;\n }\n};\n\nconst inlineStylesForColor = (\n color: BadgeColor,\n): Record<string, string | number | null> => {\n switch (color) {\n case \"silver\":\n return {\n background:\n \"linear-gradient(85deg, #CECECE -8.89%, #EEECEC 38.35%, #FFF 49.64%, #E9E8E8 66.22%) padding-box, \\\n linear-gradient(83.45deg, #A9A9A9 2.57%, #E5E2E2 61.77%, #6E6E6E 100.3%) border-box\",\n border: \"1px solid transparent\",\n paddingTop: \"3px\",\n paddingBottom: \"3px\",\n };\n case \"blackandwhite\":\n return {\n background:\n \"linear-gradient(65deg, #000 12.53%, #949494 45.45%, #000 81.69%)\",\n border: \"1px solid transparent\",\n paddingTop: \"3px\",\n paddingBottom: \"3px\",\n };\n default:\n return {};\n }\n};\n\n/**\n * [Badge](https://cambly-syntax.vercel.app/?path=/docs/components-badge--docs) is a component to display short text and give additional context to features and other components.\n */\nconst Badge = ({\n icon: Icon,\n text,\n color = \"sky\",\n}: {\n /**\n * The icon to be displayed. Please use a [Material Icon](https://material.io/resources/icons/)\n */\n icon?:\n | React.ComponentType<{ className?: string }>\n | React.ComponentType<ComponentProps<typeof InternalIcon>>;\n /**\n * The text to display inside the badge\n */\n text: string;\n /**\n * The color of the badge\n *\n * @defaultValue \"sky\"\n */\n color?: (typeof badgeColor)[number];\n}): JSX.Element => {\n return (\n <Box\n display=\"inlineFlex\"\n paddingX={2}\n paddingY={1}\n rounding={\"sm\"}\n backgroundColor={backgroundColorForColor(color)}\n alignItems=\"center\"\n justifyContent=\"center\"\n minHeight={24}\n dangerouslySetInlineStyle={{\n __style: inlineStylesForColor(color),\n }}\n >\n <Typography\n size={0}\n weight=\"medium\"\n color={textColorForBackgroundColor(color)}\n >\n <Box display=\"flex\" gap={1} alignItems=\"center\" justifyContent=\"start\">\n {Icon && <Icon className={styles.icon} size={100} />}\n <Typography\n color={textColorForBackgroundColor(color)}\n size={0}\n weight=\"medium\"\n transform=\"uppercase\"\n >\n {text}\n </Typography>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