@cambly/syntax-core 22.4.0 → 23.1.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.
@@ -25,7 +25,7 @@ declare const Avatar: ({ accessibilityLabel, icon, size, src, }: {
25
25
  *
26
26
  * @defaultValue `md`
27
27
  */
28
- size?: "sm" | "md" | "lg" | "xs" | "xl" | undefined;
28
+ size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
29
29
  /**
30
30
  * URL of the image to display as the avatar.
31
31
  */
@@ -11,7 +11,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
11
11
  className?: string | undefined;
12
12
  }> | React.ComponentType<{
13
13
  color?: "inherit" | "black" | "destructive100" | "destructive200" | "destructive300" | "destructive700" | "destructive800" | "destructive900" | "gray10" | "gray100" | "gray200" | "gray30" | "gray60" | "gray300" | "gray700" | "gray80" | "gray800" | "gray900" | "orange100" | "orange200" | "orange300" | "orange700" | "orange800" | "orange900" | "primary100" | "primary200" | "primary300" | "primary700" | "primary800" | "primary900" | "purple100" | "purple200" | "purple300" | "purple700" | "purple800" | "purple900" | "success100" | "success200" | "success300" | "success700" | "success800" | "success900" | "white" | "yellow100" | "yellow200" | "yellow300" | "yellow700" | "yellow800" | "yellow900" | "white40" | "white70" | "gray270" | "gray370" | "gray870" | "cream" | "lilac" | "navy" | "orange" | "pink" | "purple" | "red" | "sky" | "slate" | "tan" | "teal" | "thistle" | undefined;
14
- size?: 100 | 200 | 300 | 400 | 500 | 700 | 800 | 900 | 600 | 1000 | undefined;
14
+ size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | undefined;
15
15
  path?: string | undefined;
16
16
  rtlMirror?: boolean | undefined;
17
17
  } & React.RefAttributes<SVGSVGElement>> | undefined;
@@ -19,11 +19,12 @@ type CardProps = {
19
19
  * The size of the card which specifies the padding and spacing of the card.
20
20
  *
21
21
  * `compact`: 8px padding
22
- * `roomy`: 16px padding
22
+ * `medium`: 16px padding
23
+ * `roomy`: 24px padding
23
24
  *
24
- * @defaultValue `roomy`
25
+ * @defaultValue `medium`
25
26
  */
26
- size?: "compact" | "roomy";
27
+ size?: "compact" | "medium" | "roomy";
27
28
  };
28
29
  /**
29
30
  * [Card](https://cambly-syntax.vercel.app/?path=/docs/components-card--docs) is a basic container component to apply consistent styling and render child components.
package/dist/Card/Card.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Card_default
4
- } from "../__chunks/PUWF2Z5A.js";
4
+ } from "../__chunks/3N244M3S.js";
5
5
  import "../__chunks/X552U42S.js";
6
6
  import "../__chunks/4U4UW4AK.js";
7
7
  import "../__chunks/4U4UW4AK.js";
@@ -11,7 +11,7 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
11
11
  *
12
12
  * @defaultValue "start"
13
13
  */
14
- align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
14
+ align?: "center" | "start" | "end" | "forceLeft" | "forceRight" | undefined;
15
15
  /**
16
16
  * DOM element to render as.
17
17
  *
@@ -27,7 +27,7 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
27
27
  *
28
28
  * @defaultValue "gray900"
29
29
  */
30
- color?: "primary" | "destructive-primary" | "inherit" | "gray700" | "gray900" | "white" | "success" | undefined;
30
+ color?: "inherit" | "gray700" | "gray900" | "white" | "primary" | "destructive-primary" | "success" | undefined;
31
31
  /**
32
32
  * Test id for the text.
33
33
  */
@@ -58,7 +58,7 @@ declare const LinkTapArea: React__default.ForwardRefExoticComponent<React__defau
58
58
  *
59
59
  * @defaultValue "none"
60
60
  */
61
- rounding?: "sm" | "md" | "none" | "full" | undefined;
61
+ rounding?: "sm" | "md" | "full" | "none" | undefined;
62
62
  /**
63
63
  * The tab index of the tap area
64
64
  */
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  RichSelectList_default
4
- } from "../__chunks/FJBPLDAY.js";
4
+ } from "../__chunks/ECYEQCWJ.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/RRLXFGHP.js";
15
+ import "../__chunks/RKMUJHPO.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/24GKJ5FL.js";
4
+ } from "../__chunks/UMJL2E7W.js";
5
5
  import "../__chunks/SPQ7DQHG.js";
6
- import "../__chunks/RRLXFGHP.js";
6
+ import "../__chunks/RKMUJHPO.js";
7
7
  import "../__chunks/KKADUD65.js";
8
8
  import "../__chunks/X552U42S.js";
9
9
  import "../__chunks/4U4UW4AK.js";
@@ -52,7 +52,7 @@ declare const TapArea: React__default.ForwardRefExoticComponent<React__default.A
52
52
  *
53
53
  * @defaultValue "none"
54
54
  */
55
- rounding?: "sm" | "md" | "none" | "full" | undefined;
55
+ rounding?: "sm" | "md" | "full" | "none" | undefined;
56
56
  /**
57
57
  * The tab index of the tap area
58
58
  */
@@ -31,10 +31,16 @@ type ToastProps = {
31
31
  * @defaultValue 5000
32
32
  */
33
33
  timeout?: number;
34
+ /**
35
+ * The z-index of the toast
36
+ *
37
+ * @defaultValue 0
38
+ */
39
+ zIndex?: number;
34
40
  };
35
41
  /**
36
42
  * [Toast](https://cambly-syntax.vercel.app/?path=/docs/components-toast--docs) is a component to display a small, dismissible notification.
37
43
  */
38
- declare function Toast({ body, "data-testid": dataTestId, heading, icon: Icon, on, timeout, }: ToastProps): JSX.Element;
44
+ declare function Toast({ body, "data-testid": dataTestId, heading, icon: Icon, on, timeout, zIndex, }: ToastProps): JSX.Element;
39
45
 
40
46
  export { Toast as default };
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  Toast
4
- } from "../__chunks/CAB67Z66.js";
4
+ } from "../__chunks/RQVUNK7V.js";
5
5
  import "../__chunks/X552U42S.js";
6
6
  import "../__chunks/4U4UW4AK.js";
7
7
  import "../__chunks/4U4UW4AK.js";
@@ -12,7 +12,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
12
12
  *
13
13
  * @defaultValue "start"
14
14
  */
15
- align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
15
+ align?: "center" | "start" | "end" | "forceLeft" | "forceRight" | undefined;
16
16
  /**
17
17
  * DOM element to render as.
18
18
  *
@@ -28,7 +28,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
28
28
  *
29
29
  * @defaultValue "gray900"
30
30
  */
31
- color?: "primary" | "destructive-primary" | "inherit" | "gray700" | "gray900" | "white" | "destructive-lightBackground" | "destructive-darkBackground" | "success" | "success-darkBackground" | "white-secondary" | undefined;
31
+ color?: "inherit" | "gray700" | "gray900" | "white" | "primary" | "destructive-primary" | "success" | "destructive-darkBackground" | "destructive-lightBackground" | "success-darkBackground" | "white-secondary" | undefined;
32
32
  /**
33
33
  * Test id for the text
34
34
  */
@@ -111,7 +111,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
111
111
  *
112
112
  * @defaultValue "regular"
113
113
  */
114
- weight?: "bold" | "regular" | "medium" | "semiBold" | undefined;
114
+ weight?: "regular" | "medium" | "semiBold" | "bold" | undefined;
115
115
  /**
116
116
  * Controls how whitespace within the element is handled.
117
117
  *
@@ -119,7 +119,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
119
119
  *
120
120
  * @defaultValue "inherit"
121
121
  */
122
- whiteSpace?: "inherit" | "nowrap" | "normal" | "preLine" | undefined;
122
+ whiteSpace?: "inherit" | "normal" | "nowrap" | "preLine" | undefined;
123
123
  } & React.RefAttributes<HTMLDivElement>>;
124
124
 
125
125
  export { Typography as default };
@@ -13,14 +13,21 @@ var Card = forwardRef(function Card2(props, ref) {
13
13
  const _a = props, { children } = _a, cardProps = __objRest(_a, ["children"]);
14
14
  const {
15
15
  backgroundColor = "white",
16
- size = "roomy",
16
+ size = "medium",
17
17
  "data-testid": dataTestId
18
18
  } = cardProps;
19
+ const getPadding = (paddingSize) => {
20
+ if (paddingSize === "compact")
21
+ return 2;
22
+ if (paddingSize === "roomy")
23
+ return 6;
24
+ return 4;
25
+ };
19
26
  return /* @__PURE__ */ jsx(
20
27
  Box_default,
21
28
  {
22
29
  rounding: "md",
23
- padding: size === "compact" ? 2 : 4,
30
+ padding: getPadding(size),
24
31
  width: "100%",
25
32
  backgroundColor,
26
33
  "data-testid": dataTestId,
@@ -34,4 +41,4 @@ var Card_default = Card;
34
41
  export {
35
42
  Card_default
36
43
  };
37
- //# sourceMappingURL=PUWF2Z5A.js.map
44
+ //# sourceMappingURL=3N244M3S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport Box from \"../Box/Box\";\nimport type allColors from \"../colors/allColors\";\n\ntype CardProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The background color of the box.\n * @defaultValue `white`\n */\n backgroundColor?: (typeof allColors)[number];\n /**\n * The child components to render within Card.\n */\n children: JSX.Element;\n /**\n * The size of the card which specifies the padding and spacing of the card.\n *\n * `compact`: 8px padding\n * `medium`: 16px padding\n * `roomy`: 24px padding\n *\n * @defaultValue `medium`\n */\n size?: \"compact\" | \"medium\" | \"roomy\";\n};\n\n/**\n * [Card](https://cambly-syntax.vercel.app/?path=/docs/components-card--docs) is a basic container component to apply consistent styling and render child components.\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n props: CardProps,\n ref,\n): JSX.Element {\n const { children, ...cardProps } = props;\n const {\n backgroundColor = \"white\",\n size = \"medium\",\n \"data-testid\": dataTestId,\n } = cardProps;\n const getPadding = (paddingSize?: \"compact\" | \"medium\" | \"roomy\") => {\n if (paddingSize === \"compact\") return 2;\n if (paddingSize === \"roomy\") return 6;\n return 4;\n };\n\n return (\n <Box\n rounding=\"md\"\n padding={getPadding(size)}\n width=\"100%\"\n backgroundColor={backgroundColor}\n data-testid={dataTestId}\n ref={ref}\n >\n {children}\n </Box>\n );\n});\n\nexport default Card;\n"],"mappings":";;;;;;;;;AAAA,SAAS,kBAAkB;AAkDvB;AAjBJ,IAAM,OAAO,WAAsC,SAASA,MAC1D,OACA,KACa;AACb,QAAmC,YAA3B,WArCV,IAqCqC,IAAd,sBAAc,IAAd,CAAb;AACR,QAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,OAAO;AAAA,IACP,eAAe;AAAA,EACjB,IAAI;AACJ,QAAM,aAAa,CAAC,gBAAiD;AACnE,QAAI,gBAAgB;AAAW,aAAO;AACtC,QAAI,gBAAgB;AAAS,aAAO;AACpC,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,SAAS,WAAW,IAAI;AAAA,MACxB,OAAM;AAAA,MACN;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,eAAQ;","names":["Card"]}
@@ -14,7 +14,7 @@ import {
14
14
  ColorBaseDestructive700,
15
15
  ColorBaseGray700,
16
16
  ColorCambioWhite100
17
- } from "./RRLXFGHP.js";
17
+ } from "./RKMUJHPO.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=FJBPLDAY.js.map
296
+ //# sourceMappingURL=ECYEQCWJ.js.map
@@ -10,4 +10,4 @@ export {
10
10
  ColorBaseGray700,
11
11
  ColorCambioWhite100
12
12
  };
13
- //# sourceMappingURL=RRLXFGHP.js.map
13
+ //# sourceMappingURL=RKMUJHPO.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Thu, 04 Dec 2025 22:29:28 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 Mon, 26 Jan 2026 18:06:08 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":[]}
@@ -20,7 +20,8 @@ function Toast({
20
20
  heading,
21
21
  icon: Icon,
22
22
  on = "lightBackground",
23
- timeout = 5e3
23
+ timeout = 5e3,
24
+ zIndex = 0
24
25
  }) {
25
26
  const [displayToast, setDisplayToast] = useState(true);
26
27
  useEffect(() => {
@@ -47,7 +48,8 @@ function Toast({
47
48
  left: 0,
48
49
  right: 0,
49
50
  bottom: 50,
50
- boxShadow: "0px 16px 32px 0px rgba(0, 0, 0, 0.25)"
51
+ boxShadow: "0px 16px 32px 0px rgba(0, 0, 0, 0.25)",
52
+ zIndex
51
53
  }
52
54
  },
53
55
  "data-testid": dataTestId,
@@ -73,4 +75,4 @@ function Toast({
73
75
  export {
74
76
  Toast
75
77
  };
76
- //# sourceMappingURL=CAB67Z66.js.map
78
+ //# sourceMappingURL=RQVUNK7V.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Toast/Toast.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useState } from \"react\";\nimport Box from \"../Box/Box\";\nimport Typography from \"../Typography/Typography\";\nimport type InternalIcon from \"../Icon/Icon\";\n\nfunction typographyColor({\n on,\n}: {\n on: \"lightBackground\" | \"darkBackground\";\n}): \"white\" | \"gray900\" {\n return on === \"lightBackground\" ? \"white\" : \"gray900\";\n}\n\ntype ToastProps = {\n /**\n * The optional text of the toast under the heading\n */\n body?: string;\n /**\n * Test id for the toast\n */\n \"data-testid\"?: string;\n heading: string;\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 /**\n * Indicate whether the toast renders on a light or dark background. Changes the color of the toast\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The number of milliseconds to wait before automatically dismissing the toast\n *\n * @defaultValue 5000\n */\n timeout?: number;\n /**\n * The z-index of the toast\n *\n * @defaultValue 0\n */\n zIndex?: number;\n};\n/**\n * [Toast](https://cambly-syntax.vercel.app/?path=/docs/components-toast--docs) is a component to display a small, dismissible notification.\n */\n\nexport default function Toast({\n body,\n \"data-testid\": dataTestId,\n heading,\n icon: Icon,\n on = \"lightBackground\",\n timeout = 5000,\n zIndex = 0,\n}: ToastProps): JSX.Element {\n const [displayToast, setDisplayToast] = useState<boolean>(true);\n\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setDisplayToast(false);\n }, timeout);\n return () => clearTimeout(timeoutId);\n }, [timeout]);\n\n return (\n <Box\n position=\"fixed\"\n width=\"fit-content\"\n marginStart=\"auto\"\n marginEnd=\"auto\"\n padding={4}\n rounding=\"md\"\n display={displayToast ? \"flex\" : \"none\"}\n gap={5}\n alignItems=\"center\"\n backgroundColor={on === \"lightBackground\" ? \"gray900\" : \"white\"}\n dangerouslySetInlineStyle={{\n __style: {\n left: 0,\n right: 0,\n bottom: 50,\n boxShadow: \"0px 16px 32px 0px rgba(0, 0, 0, 0.25)\",\n zIndex: zIndex,\n },\n }}\n data-testid={dataTestId}\n >\n {Icon && <Icon color={typographyColor({ on })} size={400} />}\n <Box display=\"flex\" direction=\"column\" gap={1}>\n <Typography\n size={300}\n weight=\"semiBold\"\n color={typographyColor({ on })}\n >\n {heading}\n </Typography>\n {body && (\n <Typography lineClamp={2} color={typographyColor({ on })}>\n {body}\n </Typography>\n )}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAA8B,WAAW,gBAAgB;AA8F1C,cACT,YADS;AAzFf,SAAS,gBAAgB;AAAA,EACvB;AACF,GAEwB;AACtB,SAAO,OAAO,oBAAoB,UAAU;AAC9C;AA0Ce,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AAAA,EACV,SAAS;AACX,GAA4B;AAC1B,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,YAAY,WAAW,MAAM;AACjC,sBAAgB,KAAK;AAAA,IACvB,GAAG,OAAO;AACV,WAAO,MAAM,aAAa,SAAS;AAAA,EACrC,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,OAAM;AAAA,MACN,aAAY;AAAA,MACZ,WAAU;AAAA,MACV,SAAS;AAAA,MACT,UAAS;AAAA,MACT,SAAS,eAAe,SAAS;AAAA,MACjC,KAAK;AAAA,MACL,YAAW;AAAA,MACX,iBAAiB,OAAO,oBAAoB,YAAY;AAAA,MACxD,2BAA2B;AAAA,QACzB,SAAS;AAAA,UACP,MAAM;AAAA,UACN,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAW;AAAA,UACX;AAAA,QACF;AAAA,MACF;AAAA,MACA,eAAa;AAAA,MAEZ;AAAA,gBAAQ,oBAAC,QAAK,OAAO,gBAAgB,EAAE,GAAG,CAAC,GAAG,MAAM,KAAK;AAAA,QAC1D,qBAAC,eAAI,SAAQ,QAAO,WAAU,UAAS,KAAK,GAC1C;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,QAAO;AAAA,cACP,OAAO,gBAAgB,EAAE,GAAG,CAAC;AAAA,cAE5B;AAAA;AAAA,UACH;AAAA,UACC,QACC,oBAAC,sBAAW,WAAW,GAAG,OAAO,gBAAgB,EAAE,GAAG,CAAC,GACpD,gBACH;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -6,7 +6,7 @@ import {
6
6
  ColorBaseDestructive700,
7
7
  ColorBaseGray700,
8
8
  ColorCambioWhite100
9
- } from "./RRLXFGHP.js";
9
+ } from "./RKMUJHPO.js";
10
10
  import {
11
11
  Focus_module_default
12
12
  } from "./KKADUD65.js";
@@ -141,4 +141,4 @@ SelectList.Option = SelectOption_default;
141
141
  export {
142
142
  SelectList
143
143
  };
144
- //# sourceMappingURL=24GKJ5FL.js.map
144
+ //# sourceMappingURL=UMJL2E7W.js.map
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@ import {
10
10
  } from "./__chunks/66CPOSY2.js";
11
11
  import {
12
12
  Card_default
13
- } from "./__chunks/PUWF2Z5A.js";
13
+ } from "./__chunks/3N244M3S.js";
14
14
  import {
15
15
  LinkButton_default
16
16
  } from "./__chunks/TH3OGGTK.js";
@@ -38,11 +38,11 @@ import {
38
38
  } from "./__chunks/STLN5GZL.js";
39
39
  import {
40
40
  SelectList
41
- } from "./__chunks/24GKJ5FL.js";
41
+ } from "./__chunks/UMJL2E7W.js";
42
42
  import "./__chunks/SPQ7DQHG.js";
43
43
  import {
44
44
  RichSelectList_default
45
- } from "./__chunks/FJBPLDAY.js";
45
+ } from "./__chunks/ECYEQCWJ.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/RRLXFGHP.js";
66
+ import "./__chunks/RKMUJHPO.js";
67
67
  import "./__chunks/Y53Z25OG.js";
68
68
  import "./__chunks/DDUJFFG7.js";
69
69
  import "./__chunks/N7G37EKF.js";
@@ -80,7 +80,7 @@ import "./__chunks/6TM2ES2T.js";
80
80
  import "./__chunks/ODMJANSX.js";
81
81
  import {
82
82
  Toast
83
- } from "./__chunks/CAB67Z66.js";
83
+ } from "./__chunks/RQVUNK7V.js";
84
84
  import {
85
85
  ThemeProvider
86
86
  } from "./__chunks/KTX4P4Q2.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.4.0",
4
+ "version": "23.1.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":["../../src/Toast/Toast.tsx"],"sourcesContent":["import { type ComponentProps, useEffect, useState } from \"react\";\nimport Box from \"../Box/Box\";\nimport Typography from \"../Typography/Typography\";\nimport type InternalIcon from \"../Icon/Icon\";\n\nfunction typographyColor({\n on,\n}: {\n on: \"lightBackground\" | \"darkBackground\";\n}): \"white\" | \"gray900\" {\n return on === \"lightBackground\" ? \"white\" : \"gray900\";\n}\n\ntype ToastProps = {\n /**\n * The optional text of the toast under the heading\n */\n body?: string;\n /**\n * Test id for the toast\n */\n \"data-testid\"?: string;\n heading: string;\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 /**\n * Indicate whether the toast renders on a light or dark background. Changes the color of the toast\n *\n * @defaulValue `lightBackground`\n */\n on?: \"lightBackground\" | \"darkBackground\";\n /**\n * The number of milliseconds to wait before automatically dismissing the toast\n *\n * @defaultValue 5000\n */\n timeout?: number;\n};\n/**\n * [Toast](https://cambly-syntax.vercel.app/?path=/docs/components-toast--docs) is a component to display a small, dismissible notification.\n */\n\nexport default function Toast({\n body,\n \"data-testid\": dataTestId,\n heading,\n icon: Icon,\n on = \"lightBackground\",\n timeout = 5000,\n}: ToastProps): JSX.Element {\n const [displayToast, setDisplayToast] = useState<boolean>(true);\n\n useEffect(() => {\n const timeoutId = setTimeout(() => {\n setDisplayToast(false);\n }, timeout);\n return () => clearTimeout(timeoutId);\n }, [timeout]);\n\n return (\n <Box\n position=\"fixed\"\n width=\"fit-content\"\n marginStart=\"auto\"\n marginEnd=\"auto\"\n padding={4}\n rounding=\"md\"\n display={displayToast ? \"flex\" : \"none\"}\n gap={5}\n alignItems=\"center\"\n backgroundColor={on === \"lightBackground\" ? \"gray900\" : \"white\"}\n dangerouslySetInlineStyle={{\n __style: {\n left: 0,\n right: 0,\n bottom: 50,\n boxShadow: \"0px 16px 32px 0px rgba(0, 0, 0, 0.25)\",\n },\n }}\n data-testid={dataTestId}\n >\n {Icon && <Icon color={typographyColor({ on })} size={400} />}\n <Box display=\"flex\" direction=\"column\" gap={1}>\n <Typography\n size={300}\n weight=\"semiBold\"\n color={typographyColor({ on })}\n >\n {heading}\n </Typography>\n {body && (\n <Typography lineClamp={2} color={typographyColor({ on })}>\n {body}\n </Typography>\n )}\n </Box>\n </Box>\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAA8B,WAAW,gBAAgB;AAsF1C,cACT,YADS;AAjFf,SAAS,gBAAgB;AAAA,EACvB;AACF,GAEwB;AACtB,SAAO,OAAO,oBAAoB,UAAU;AAC9C;AAoCe,SAAR,MAAuB;AAAA,EAC5B;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,GAA4B;AAC1B,QAAM,CAAC,cAAc,eAAe,IAAI,SAAkB,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,YAAY,WAAW,MAAM;AACjC,sBAAgB,KAAK;AAAA,IACvB,GAAG,OAAO;AACV,WAAO,MAAM,aAAa,SAAS;AAAA,EACrC,GAAG,CAAC,OAAO,CAAC;AAEZ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,OAAM;AAAA,MACN,aAAY;AAAA,MACZ,WAAU;AAAA,MACV,SAAS;AAAA,MACT,UAAS;AAAA,MACT,SAAS,eAAe,SAAS;AAAA,MACjC,KAAK;AAAA,MACL,YAAW;AAAA,MACX,iBAAiB,OAAO,oBAAoB,YAAY;AAAA,MACxD,2BAA2B;AAAA,QACzB,SAAS;AAAA,UACP,MAAM;AAAA,UACN,OAAO;AAAA,UACP,QAAQ;AAAA,UACR,WAAW;AAAA,QACb;AAAA,MACF;AAAA,MACA,eAAa;AAAA,MAEZ;AAAA,gBAAQ,oBAAC,QAAK,OAAO,gBAAgB,EAAE,GAAG,CAAC,GAAG,MAAM,KAAK;AAAA,QAC1D,qBAAC,eAAI,SAAQ,QAAO,WAAU,UAAS,KAAK,GAC1C;AAAA;AAAA,YAAC;AAAA;AAAA,cACC,MAAM;AAAA,cACN,QAAO;AAAA,cACP,OAAO,gBAAgB,EAAE,GAAG,CAAC;AAAA,cAE5B;AAAA;AAAA,UACH;AAAA,UACC,QACC,oBAAC,sBAAW,WAAW,GAAG,OAAO,gBAAgB,EAAE,GAAG,CAAC,GACpD,gBACH;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Card/Card.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport Box from \"../Box/Box\";\nimport type allColors from \"../colors/allColors\";\n\ntype CardProps = {\n /**\n * Test id for the button\n */\n \"data-testid\"?: string;\n /**\n * The background color of the box.\n * @defaultValue `white`\n */\n backgroundColor?: (typeof allColors)[number];\n /**\n * The child components to render within Card.\n */\n children: JSX.Element;\n /**\n * The size of the card which specifies the padding and spacing of the card.\n *\n * `compact`: 8px padding\n * `roomy`: 16px padding\n *\n * @defaultValue `roomy`\n */\n size?: \"compact\" | \"roomy\";\n};\n\n/**\n * [Card](https://cambly-syntax.vercel.app/?path=/docs/components-card--docs) is a basic container component to apply consistent styling and render child components.\n */\nconst Card = forwardRef<HTMLDivElement, CardProps>(function Card(\n props: CardProps,\n ref,\n): JSX.Element {\n const { children, ...cardProps } = props;\n const {\n backgroundColor = \"white\",\n size = \"roomy\",\n \"data-testid\": dataTestId,\n } = cardProps;\n\n return (\n <Box\n rounding=\"md\"\n padding={size === \"compact\" ? 2 : 4}\n width=\"100%\"\n backgroundColor={backgroundColor}\n data-testid={dataTestId}\n ref={ref}\n >\n {children}\n </Box>\n );\n});\n\nexport default Card;\n"],"mappings":";;;;;;;;;AAAA,SAAS,kBAAkB;AA4CvB;AAZJ,IAAM,OAAO,WAAsC,SAASA,MAC1D,OACA,KACa;AACb,QAAmC,YAA3B,WApCV,IAoCqC,IAAd,sBAAc,IAAd,CAAb;AACR,QAAM;AAAA,IACJ,kBAAkB;AAAA,IAClB,OAAO;AAAA,IACP,eAAe;AAAA,EACjB,IAAI;AAEJ,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAS;AAAA,MACT,SAAS,SAAS,YAAY,IAAI;AAAA,MAClC,OAAM;AAAA,MACN;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MAEC;AAAA;AAAA,EACH;AAEJ,CAAC;AAED,IAAO,eAAQ;","names":["Card"]}