@cambly/syntax-core 10.24.0 → 10.25.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.
Files changed (44) hide show
  1. package/dist/Avatar/Avatar.d.ts +1 -1
  2. package/dist/Badge/Badge.d.ts +1 -1
  3. package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
  4. package/dist/Checkbox/Checkbox.d.ts +1 -1
  5. package/dist/Heading/Heading.d.ts +2 -2
  6. package/dist/Modal/FocusTrap.cjs +2 -2
  7. package/dist/Modal/FocusTrap.js +1 -1
  8. package/dist/Modal/Modal.cjs +3 -3
  9. package/dist/Modal/Modal.js +2 -2
  10. package/dist/RadioButton/RadioButton.d.ts +1 -1
  11. package/dist/RichSelect/RichSelectBox.d.ts +1 -1
  12. package/dist/RichSelect/RichSelectList.cjs +3 -3
  13. package/dist/RichSelect/RichSelectList.d.ts +1 -1
  14. package/dist/RichSelect/RichSelectList.js +2 -2
  15. package/dist/RichSelect/RichSelectRadioButton.d.ts +1 -1
  16. package/dist/SelectList/SelectList.cjs +3 -3
  17. package/dist/SelectList/SelectList.js +2 -2
  18. package/dist/TapArea/TapArea.d.ts +1 -1
  19. package/dist/Typography/Typography.d.ts +5 -5
  20. package/dist/__chunks/{7B7TOXIF.cjs → BSJEH3VS.cjs} +3 -3
  21. package/dist/__chunks/{PO5IE5IC.js → C5O3IZ3E.js} +2 -2
  22. package/dist/__chunks/{KODEDJGB.js → J7FCX3U6.js} +2 -2
  23. package/dist/__chunks/J7FCX3U6.js.map +1 -0
  24. package/dist/__chunks/{RQBPUVVA.cjs → MFKYNKOB.cjs} +3 -3
  25. package/dist/__chunks/{B3SQDLKQ.js → OMFY5XWC.js} +1 -1
  26. package/dist/__chunks/{B3SQDLKQ.js.map → OMFY5XWC.js.map} +1 -1
  27. package/dist/__chunks/{QD2ZKJLS.js → QJFLG22W.js} +2 -2
  28. package/dist/__chunks/{2R3NHAWW.cjs → SDPPUEJV.cjs} +1 -1
  29. package/dist/__chunks/{2R3NHAWW.cjs.map → SDPPUEJV.cjs.map} +1 -1
  30. package/dist/__chunks/{K4LTJ5GH.cjs → VGKS62YP.cjs} +3 -3
  31. package/dist/__chunks/{TAZE73O2.js → YJYZ5SFR.js} +2 -2
  32. package/dist/__chunks/{BA4JPX36.cjs → ZDQ6WQM3.cjs} +2 -2
  33. package/dist/__chunks/ZDQ6WQM3.cjs.map +1 -0
  34. package/dist/index.cjs +6 -6
  35. package/dist/index.js +5 -5
  36. package/package.json +1 -1
  37. package/dist/__chunks/BA4JPX36.cjs.map +0 -1
  38. package/dist/__chunks/KODEDJGB.js.map +0 -1
  39. /package/dist/__chunks/{7B7TOXIF.cjs.map → BSJEH3VS.cjs.map} +0 -0
  40. /package/dist/__chunks/{PO5IE5IC.js.map → C5O3IZ3E.js.map} +0 -0
  41. /package/dist/__chunks/{RQBPUVVA.cjs.map → MFKYNKOB.cjs.map} +0 -0
  42. /package/dist/__chunks/{QD2ZKJLS.js.map → QJFLG22W.js.map} +0 -0
  43. /package/dist/__chunks/{K4LTJ5GH.cjs.map → VGKS62YP.cjs.map} +0 -0
  44. /package/dist/__chunks/{TAZE73O2.js.map → YJYZ5SFR.js.map} +0 -0
@@ -32,7 +32,7 @@ declare const Avatar: ({ accessibilityLabel, icon, size, src, }: {
32
32
  *
33
33
  * @defaultValue `md`
34
34
  */
35
- size?: "xs" | "sm" | "md" | "lg" | "xl" | undefined;
35
+ size?: "xl" | "lg" | "md" | "sm" | "xs" | undefined;
36
36
  /**
37
37
  * URL of the image to display as the avatar.
38
38
  */
@@ -41,7 +41,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
41
41
  *
42
42
  * @defaultValue "primary700"
43
43
  */
44
- color?: "gray200" | "gray900" | "destructive700" | "orange700" | "yellow700" | "success700" | "primary700" | "purple700" | "sky" | "success300" | "destructive300" | "orange" | "tan" | "gray370" | "gray870" | "lilac" | "thistle" | "pink" | undefined;
44
+ color?: "destructive300" | "destructive700" | "gray200" | "gray900" | "orange700" | "primary700" | "purple700" | "success300" | "success700" | "yellow700" | "gray370" | "gray870" | "lilac" | "orange" | "pink" | "sky" | "tan" | "thistle" | undefined;
45
45
  }) => JSX.Element;
46
46
 
47
47
  export { Badge as default };
@@ -25,7 +25,7 @@ declare const ButtonGroup: ({ orientation, size, children, }: {
25
25
  *
26
26
  * @defaultValue "md"
27
27
  */
28
- size?: "sm" | "md" | "lg" | undefined;
28
+ size?: "lg" | "md" | "sm" | undefined;
29
29
  /**
30
30
  * Buttons to be rendered inside the button group
31
31
  */
@@ -32,7 +32,7 @@ declare const Checkbox: ({ checked, "data-testid": dataTestId, disabled: disable
32
32
  *
33
33
  * @defaultValue "md"
34
34
  */
35
- size?: "sm" | "md" | undefined;
35
+ size?: "md" | "sm" | undefined;
36
36
  /**
37
37
  * The text accompanying the checkbox
38
38
  */
@@ -11,7 +11,7 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
11
11
  *
12
12
  * @defaultValue "start"
13
13
  */
14
- align?: "start" | "end" | "forceLeft" | "center" | "forceRight" | undefined;
14
+ align?: "center" | "end" | "start" | "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?: "gray900" | "primary" | "destructive-primary" | "success" | "gray700" | "white" | "inherit" | undefined;
30
+ color?: "gray700" | "gray900" | "white" | "inherit" | "primary" | "destructive-primary" | "success" | undefined;
31
31
  /**
32
32
  * Test id for the text.
33
33
  */
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
2
2
 
3
3
 
4
- var _BA4JPX36cjs = require('../__chunks/BA4JPX36.cjs');
4
+ var _ZDQ6WQM3cjs = require('../__chunks/ZDQ6WQM3.cjs');
5
5
  require('../__chunks/X2SDR4SD.cjs');
6
6
 
7
7
 
8
- exports.default = _BA4JPX36cjs.FocusTrap;
8
+ exports.default = _ZDQ6WQM3cjs.FocusTrap;
9
9
  //# sourceMappingURL=FocusTrap.cjs.map
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  FocusTrap
4
- } from "../__chunks/KODEDJGB.js";
4
+ } from "../__chunks/J7FCX3U6.js";
5
5
  import "../__chunks/UWGNJENA.js";
6
6
  export {
7
7
  FocusTrap as default
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
2
2
 
3
3
 
4
- var _K4LTJ5GHcjs = require('../__chunks/K4LTJ5GH.cjs');
4
+ var _VGKS62YPcjs = require('../__chunks/VGKS62YP.cjs');
5
5
  require('../__chunks/WFWI5GYG.cjs');
6
6
  require('../__chunks/HUIHS6RN.cjs');
7
7
  require('../__chunks/4TY5KFRY.cjs');
8
- require('../__chunks/BA4JPX36.cjs');
8
+ require('../__chunks/ZDQ6WQM3.cjs');
9
9
  require('../__chunks/KWT6ABYP.cjs');
10
10
  require('../__chunks/W2JRKN5E.cjs');
11
11
  require('../__chunks/WFVGNGEP.cjs');
@@ -25,5 +25,5 @@ require('../__chunks/K4AUV2VK.cjs');
25
25
  require('../__chunks/X2SDR4SD.cjs');
26
26
 
27
27
 
28
- exports.default = _K4LTJ5GHcjs.Modal;
28
+ exports.default = _VGKS62YPcjs.Modal;
29
29
  //# sourceMappingURL=Modal.cjs.map
@@ -1,11 +1,11 @@
1
1
  "use client"
2
2
  import {
3
3
  Modal
4
- } from "../__chunks/TAZE73O2.js";
4
+ } from "../__chunks/YJYZ5SFR.js";
5
5
  import "../__chunks/ZFMV7BOZ.js";
6
6
  import "../__chunks/QQT35OLE.js";
7
7
  import "../__chunks/MOU24MJO.js";
8
- import "../__chunks/KODEDJGB.js";
8
+ import "../__chunks/J7FCX3U6.js";
9
9
  import "../__chunks/ZEMGWSJQ.js";
10
10
  import "../__chunks/OMFFRI3K.js";
11
11
  import "../__chunks/4U4UW4AK.js";
@@ -50,7 +50,7 @@ declare const RadioButton: ({ checked, "data-testid": dataTestId, dangerouslyFor
50
50
  *
51
51
  * @defaultValue "md"
52
52
  */
53
- size?: "sm" | "md" | undefined;
53
+ size?: "md" | "sm" | undefined;
54
54
  /**
55
55
  * Value of the selected radio option
56
56
  */
@@ -49,7 +49,7 @@ declare const _default: React__default.ForwardRefExoticComponent<RichSelectBoxPr
49
49
  Chip: React__default.ForwardRefExoticComponent<RichSelectItemProps & React__default.RefAttributes<HTMLDivElement>>;
50
50
  RadioButton: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
51
51
  name: string;
52
- size?: "sm" | "md" | undefined;
52
+ size?: "md" | "sm" | undefined;
53
53
  } & React__default.RefAttributes<HTMLDivElement>>;
54
54
  };
55
55
 
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
2
2
 
3
3
 
4
- var _7B7TOXIFcjs = require('../__chunks/7B7TOXIF.cjs');
4
+ var _BSJEH3VScjs = require('../__chunks/BSJEH3VS.cjs');
5
5
  require('../__chunks/WZZQUJZF.cjs');
6
6
  require('../__chunks/VBQTLO2P.cjs');
7
7
  require('../__chunks/IXDYGNLN.cjs');
@@ -19,7 +19,7 @@ require('../__chunks/W2JRKN5E.cjs');
19
19
  require('../__chunks/WFVGNGEP.cjs');
20
20
  require('../__chunks/HWQUS53M.cjs');
21
21
  require('../__chunks/UKLQ64N7.cjs');
22
- require('../__chunks/2R3NHAWW.cjs');
22
+ require('../__chunks/SDPPUEJV.cjs');
23
23
  require('../__chunks/J3ES6ZT6.cjs');
24
24
  require('../__chunks/MF7LLV7V.cjs');
25
25
  require('../__chunks/OVXHL32N.cjs');
@@ -48,5 +48,5 @@ require('../__chunks/E5P6WRJD.cjs');
48
48
  require('../__chunks/X2SDR4SD.cjs');
49
49
 
50
50
 
51
- exports.default = _7B7TOXIFcjs.RichSelectList_default;
51
+ exports.default = _BSJEH3VScjs.RichSelectList_default;
52
52
  //# sourceMappingURL=RichSelectList.cjs.map
@@ -75,7 +75,7 @@ declare const _default: typeof RichSelectList & {
75
75
  Chip: React__default.ForwardRefExoticComponent<RichSelectItemProps & React__default.RefAttributes<HTMLDivElement>>;
76
76
  RadioButton: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
77
77
  name: string;
78
- size?: "sm" | "md" | undefined;
78
+ size?: "md" | "sm" | undefined;
79
79
  } & React__default.RefAttributes<HTMLDivElement>>;
80
80
  };
81
81
 
@@ -1,7 +1,7 @@
1
1
  "use client"
2
2
  import {
3
3
  RichSelectList_default
4
- } from "../__chunks/QD2ZKJLS.js";
4
+ } from "../__chunks/QJFLG22W.js";
5
5
  import "../__chunks/6EKM3QTW.js";
6
6
  import "../__chunks/COW4SDSF.js";
7
7
  import "../__chunks/KITXUOU4.js";
@@ -19,7 +19,7 @@ import "../__chunks/OMFFRI3K.js";
19
19
  import "../__chunks/4U4UW4AK.js";
20
20
  import "../__chunks/GFKDPMFK.js";
21
21
  import "../__chunks/5MJ6NOUC.js";
22
- import "../__chunks/B3SQDLKQ.js";
22
+ import "../__chunks/OMFY5XWC.js";
23
23
  import "../__chunks/4NSYLHIG.js";
24
24
  import "../__chunks/DDUJFFG7.js";
25
25
  import "../__chunks/KWRU2RKT.js";
@@ -5,7 +5,7 @@ import 'react-aria';
5
5
 
6
6
  declare const _default: React__default.ForwardRefExoticComponent<RichSelectItemProps & {
7
7
  name: string;
8
- size?: "sm" | "md" | undefined;
8
+ size?: "md" | "sm" | undefined;
9
9
  } & React__default.RefAttributes<HTMLDivElement>>;
10
10
 
11
11
  export { _default as default };
@@ -1,9 +1,9 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
2
2
 
3
3
 
4
- var _RQBPUVVAcjs = require('../__chunks/RQBPUVVA.cjs');
4
+ var _MFKYNKOBcjs = require('../__chunks/MFKYNKOB.cjs');
5
5
  require('../__chunks/4UJE5GMH.cjs');
6
- require('../__chunks/2R3NHAWW.cjs');
6
+ require('../__chunks/SDPPUEJV.cjs');
7
7
  require('../__chunks/XLUVINJW.cjs');
8
8
  require('../__chunks/E4LISCR7.cjs');
9
9
  require('../__chunks/WFVGNGEP.cjs');
@@ -18,5 +18,5 @@ require('../__chunks/NOELZTQX.cjs');
18
18
  require('../__chunks/X2SDR4SD.cjs');
19
19
 
20
20
 
21
- exports.default = _RQBPUVVAcjs.SelectList;
21
+ exports.default = _MFKYNKOBcjs.SelectList;
22
22
  //# sourceMappingURL=SelectList.cjs.map
@@ -1,9 +1,9 @@
1
1
  "use client"
2
2
  import {
3
3
  SelectList
4
- } from "../__chunks/PO5IE5IC.js";
4
+ } from "../__chunks/C5O3IZ3E.js";
5
5
  import "../__chunks/Y47XTR6M.js";
6
- import "../__chunks/B3SQDLKQ.js";
6
+ import "../__chunks/OMFY5XWC.js";
7
7
  import "../__chunks/KKADUD65.js";
8
8
  import "../__chunks/XQM7YZ26.js";
9
9
  import "../__chunks/4U4UW4AK.js";
@@ -50,7 +50,7 @@ declare const TapArea: React__default.ForwardRefExoticComponent<React__default.A
50
50
  *
51
51
  * @defaultValue "none"
52
52
  */
53
- rounding?: "sm" | "md" | "lg" | "xl" | "full" | "none" | undefined;
53
+ rounding?: "none" | "xl" | "lg" | "md" | "sm" | "full" | undefined;
54
54
  /**
55
55
  * The tab index of the tap area
56
56
  */
@@ -12,13 +12,13 @@ declare const Typography: React.ForwardRefExoticComponent<{
12
12
  *
13
13
  * @defaultValue "start"
14
14
  */
15
- align?: "start" | "end" | "forceLeft" | "center" | "forceRight" | undefined;
15
+ align?: "center" | "end" | "start" | "forceLeft" | "forceRight" | undefined;
16
16
  /**
17
17
  * DOM element to render as.
18
18
  *
19
19
  * @defaultValue "div"
20
20
  */
21
- as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | undefined;
21
+ as?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
22
22
  /**
23
23
  * The text to be rendered
24
24
  */
@@ -30,7 +30,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
30
30
  *
31
31
  * @defaultValue "gray900"
32
32
  */
33
- color?: "gray900" | "primary" | "destructive-primary" | "success" | "gray700" | "white" | "inherit" | "destructive-darkBackground" | "success-darkBackground" | undefined;
33
+ color?: "gray700" | "gray900" | "white" | "inherit" | "primary" | "destructive-primary" | "destructive-darkBackground" | "success" | "success-darkBackground" | undefined;
34
34
  /**
35
35
  * Test id for the text
36
36
  */
@@ -97,7 +97,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
97
97
  *
98
98
  * @defaultValue 200
99
99
  */
100
- size?: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100 | 100 | 200 | 300 | undefined;
100
+ size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100 | undefined;
101
101
  /**
102
102
  * The tooltip to be displayed when the user hovers the text
103
103
  */
@@ -133,7 +133,7 @@ declare const Typography: React.ForwardRefExoticComponent<{
133
133
  *
134
134
  * @defaultValue "regular"
135
135
  */
136
- weight?: "regular" | "interactive" | "medium" | "semiBold" | "bold" | "heavy" | undefined;
136
+ weight?: "bold" | "regular" | "interactive" | "medium" | "semiBold" | "heavy" | undefined;
137
137
  } & React.RefAttributes<HTMLDivElement>>;
138
138
 
139
139
  export { Typography as default };
@@ -19,7 +19,7 @@ var _UKLQ64N7cjs = require('./UKLQ64N7.cjs');
19
19
 
20
20
 
21
21
 
22
- var _2R3NHAWWcjs = require('./2R3NHAWW.cjs');
22
+ var _SDPPUEJVcjs = require('./SDPPUEJV.cjs');
23
23
 
24
24
 
25
25
  var _J3ES6ZT6cjs = require('./J3ES6ZT6.cjs');
@@ -243,7 +243,7 @@ function RichSelectList(props) {
243
243
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
244
244
  "path",
245
245
  {
246
- fill: errorText ? _2R3NHAWWcjs.ColorBaseDestructive700 : _2R3NHAWWcjs.ColorBaseGray800,
246
+ fill: errorText ? _SDPPUEJVcjs.ColorBaseDestructive700 : _SDPPUEJVcjs.ColorBaseGray800,
247
247
  d: "M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z"
248
248
  }
249
249
  )
@@ -278,4 +278,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
278
278
 
279
279
 
280
280
  exports.RichSelectList_default = RichSelectList_default;
281
- //# sourceMappingURL=7B7TOXIF.cjs.map
281
+ //# sourceMappingURL=BSJEH3VS.cjs.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  ColorBaseDestructive700,
7
7
  ColorBaseGray800
8
- } from "./B3SQDLKQ.js";
8
+ } from "./OMFY5XWC.js";
9
9
  import {
10
10
  Focus_module_default
11
11
  } from "./KKADUD65.js";
@@ -137,4 +137,4 @@ SelectList.Option = SelectOption_default;
137
137
  export {
138
138
  SelectList
139
139
  };
140
- //# sourceMappingURL=PO5IE5IC.js.map
140
+ //# sourceMappingURL=C5O3IZ3E.js.map
@@ -24,7 +24,7 @@ function queryFocusableAll(el) {
24
24
  return el.querySelectorAll(selector);
25
25
  }
26
26
  var focusElement = (el) => {
27
- if (typeof el.focus === "function") {
27
+ if (el && typeof el.focus === "function") {
28
28
  el.focus();
29
29
  }
30
30
  };
@@ -69,4 +69,4 @@ function FocusTrap({
69
69
  export {
70
70
  FocusTrap
71
71
  };
72
- //# sourceMappingURL=KODEDJGB.js.map
72
+ //# sourceMappingURL=J7FCX3U6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Modal/FocusTrap.tsx"],"sourcesContent":["import React, { useEffect, useRef, type ReactElement } from \"react\";\n\nfunction queryFocusableAll(el: HTMLDivElement): NodeListOf<HTMLElement> {\n // Focusable, interactive elements that could possibly be in children\n const selector = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"iframe\",\n \"object\",\n \"embed\",\n '[tabindex=\"-1\"]',\n '[tabindex=\"0\"]',\n \"[contenteditable]\",\n \"audio[controls]\",\n \"video[controls]\",\n \"summary\",\n ].join(\",\");\n return el.querySelectorAll(selector);\n}\n\nconst focusElement = (el?: HTMLElement) => {\n if (el && typeof el.focus === \"function\") {\n el.focus();\n }\n};\n\n/**\n * FocusTrap is used by components like Modal to ensure that only elements within children components can be focused.\n */\nexport default function FocusTrap({\n children,\n}: {\n children?: ReactElement | null;\n}): ReactElement {\n const elRef = useRef<HTMLDivElement | null>(null);\n const previouslyFocusedElRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const { current: element } = elRef;\n\n // Focus the first child element among all the focusable, interactive elements within `children`\n const focusFirstChild = () => {\n const withinIframe = window !== window.parent;\n if (element && !withinIframe) {\n focusElement(queryFocusableAll(element)[0]);\n }\n };\n\n const handleFocus: (event: FocusEvent) => void = (event: FocusEvent) => {\n if (\n !element ||\n (event.target instanceof Node && element.contains(event.target))\n ) {\n return;\n }\n\n // This prevents stack overflow when multiple FocusTraps are rendered\n if (\n event.target instanceof Element &&\n event.target.closest('[data-testid=\"syntax-focus-trap\"]') !== null\n ) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n focusFirstChild();\n };\n\n // If an element has focus currently, keep a reference to that element\n previouslyFocusedElRef.current = document.activeElement as HTMLElement;\n focusFirstChild();\n document.addEventListener(\"focus\", handleFocus, true);\n\n return function cleanup() {\n const { current: previouslyFocusedEl } = previouslyFocusedElRef;\n document.removeEventListener(\"focus\", handleFocus, true);\n // If we previously stored a reference to a focused element, return focus to that element\n if (previouslyFocusedEl) {\n focusElement(previouslyFocusedEl);\n }\n };\n }, [elRef, previouslyFocusedElRef]);\n\n return (\n <div data-testid=\"syntax-focus-trap\" ref={elRef}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;AAAA,SAAgB,WAAW,cAAiC;AAyFxD;AAvFJ,SAAS,kBAAkB,IAA6C;AAEtE,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,GAAG;AACV,SAAO,GAAG,iBAAiB,QAAQ;AACrC;AAEA,IAAM,eAAe,CAAC,OAAqB;AACzC,MAAI,MAAM,OAAO,GAAG,UAAU,YAAY;AACxC,OAAG,MAAM;AAAA,EACX;AACF;AAKe,SAAR,UAA2B;AAAA,EAChC;AACF,GAEiB;AACf,QAAM,QAAQ,OAA8B,IAAI;AAChD,QAAM,yBAAyB,OAA2B,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,EAAE,SAAS,QAAQ,IAAI;AAG7B,UAAM,kBAAkB,MAAM;AAC5B,YAAM,eAAe,WAAW,OAAO;AACvC,UAAI,WAAW,CAAC,cAAc;AAC5B,qBAAa,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAAA,MAC5C;AAAA,IACF;AAEA,UAAM,cAA2C,CAAC,UAAsB;AACtE,UACE,CAAC,WACA,MAAM,kBAAkB,QAAQ,QAAQ,SAAS,MAAM,MAAM,GAC9D;AACA;AAAA,MACF;AAGA,UACE,MAAM,kBAAkB,WACxB,MAAM,OAAO,QAAQ,mCAAmC,MAAM,MAC9D;AACA;AAAA,MACF;AAEA,YAAM,gBAAgB;AACtB,YAAM,eAAe;AACrB,sBAAgB;AAAA,IAClB;AAGA,2BAAuB,UAAU,SAAS;AAC1C,oBAAgB;AAChB,aAAS,iBAAiB,SAAS,aAAa,IAAI;AAEpD,WAAO,SAAS,UAAU;AACxB,YAAM,EAAE,SAAS,oBAAoB,IAAI;AACzC,eAAS,oBAAoB,SAAS,aAAa,IAAI;AAEvD,UAAI,qBAAqB;AACvB,qBAAa,mBAAmB;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,sBAAsB,CAAC;AAElC,SACE,oBAAC,SAAI,eAAY,qBAAoB,KAAK,OACvC,UACH;AAEJ;","names":[]}
@@ -5,7 +5,7 @@ var _4UJE5GMHcjs = require('./4UJE5GMH.cjs');
5
5
 
6
6
 
7
7
 
8
- var _2R3NHAWWcjs = require('./2R3NHAWW.cjs');
8
+ var _SDPPUEJVcjs = require('./SDPPUEJV.cjs');
9
9
 
10
10
 
11
11
  var _XLUVINJWcjs = require('./XLUVINJW.cjs');
@@ -113,7 +113,7 @@ function SelectList({
113
113
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
114
114
  "path",
115
115
  {
116
- fill: errorText ? _2R3NHAWWcjs.ColorBaseDestructive700 : _2R3NHAWWcjs.ColorBaseGray800,
116
+ fill: errorText ? _SDPPUEJVcjs.ColorBaseDestructive700 : _SDPPUEJVcjs.ColorBaseGray800,
117
117
  d: "M15.88 9.29 12 13.17 8.12 9.29a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.39-.39.39-1.02 0-1.41-.39-.38-1.03-.39-1.42 0z"
118
118
  }
119
119
  )
@@ -137,4 +137,4 @@ SelectList.Option = _4UJE5GMHcjs.SelectOption_default;
137
137
 
138
138
 
139
139
  exports.SelectList = SelectList;
140
- //# sourceMappingURL=RQBPUVVA.cjs.map
140
+ //# sourceMappingURL=MFKYNKOB.cjs.map
@@ -8,4 +8,4 @@ export {
8
8
  ColorBaseDestructive700,
9
9
  ColorBaseGray800
10
10
  };
11
- //# sourceMappingURL=B3SQDLKQ.js.map
11
+ //# sourceMappingURL=OMFY5XWC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 25 Mar 2024 13:38:37 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 ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\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\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB;","names":[]}
1
+ {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 25 Mar 2024 16:29:29 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 ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\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\";\n"],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB;","names":[]}
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  ColorBaseDestructive700,
21
21
  ColorBaseGray800
22
- } from "./B3SQDLKQ.js";
22
+ } from "./OMFY5XWC.js";
23
23
  import {
24
24
  RichSelectSection_default
25
25
  } from "./4NSYLHIG.js";
@@ -278,4 +278,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
278
278
  export {
279
279
  RichSelectList_default
280
280
  };
281
- //# sourceMappingURL=QD2ZKJLS.js.map
281
+ //# sourceMappingURL=QJFLG22W.js.map
@@ -8,4 +8,4 @@ var ColorBaseGray800 = "#353535";
8
8
 
9
9
 
10
10
  exports.ColorBaseDestructive700 = ColorBaseDestructive700; exports.ColorBaseGray800 = ColorBaseGray800;
11
- //# sourceMappingURL=2R3NHAWW.cjs.map
11
+ //# sourceMappingURL=SDPPUEJV.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB","sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 25 Mar 2024 13:38:37 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 ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\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\";\n"]}
1
+ {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"names":[],"mappings":";;;AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB","sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 25 Mar 2024 16:29:29 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 ColorCambioWhite = \"#ffffff\";\nexport const ColorCambioGray100 = \"#faf4eb\";\nexport const ColorCambioGray200 = \"#e4dbd3\";\nexport const ColorCambioGray300 = \"#beb4ab\";\nexport const ColorCambioGray370 = \"#beb4ab\";\nexport const ColorCambioGray700 = \"#888077\";\nexport const ColorCambioGray800 = \"#5c554d\";\nexport const ColorCambioGray870 = \"#5c554d\";\nexport const ColorCambioGray900 = \"#312b23\";\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\";\n"]}
@@ -10,7 +10,7 @@ var _HUIHS6RNcjs = require('./HUIHS6RN.cjs');
10
10
  var _4TY5KFRYcjs = require('./4TY5KFRY.cjs');
11
11
 
12
12
 
13
- var _BA4JPX36cjs = require('./BA4JPX36.cjs');
13
+ var _ZDQ6WQM3cjs = require('./ZDQ6WQM3.cjs');
14
14
 
15
15
 
16
16
  var _KWT6ABYPcjs = require('./KWT6ABYP.cjs');
@@ -67,7 +67,7 @@ function Modal({
67
67
  "data-testid": dataTestId
68
68
  }) {
69
69
  const { themeName } = _TBQR2FPScjs.useTheme.call(void 0, );
70
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _4TY5KFRYcjs.Layer, { zIndex, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _HUIHS6RNcjs.StopScroll, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _BA4JPX36cjs.FocusTrap, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
70
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _4TY5KFRYcjs.Layer, { zIndex, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _HUIHS6RNcjs.StopScroll, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _ZDQ6WQM3cjs.FocusTrap, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
71
71
  "div",
72
72
  {
73
73
  className: _classnames2.default.call(void 0,
@@ -173,4 +173,4 @@ Modal.displayName = "Modal";
173
173
 
174
174
 
175
175
  exports.Modal = Modal;
176
- //# sourceMappingURL=K4LTJ5GH.cjs.map
176
+ //# sourceMappingURL=VGKS62YP.cjs.map
@@ -10,7 +10,7 @@ import {
10
10
  } from "./MOU24MJO.js";
11
11
  import {
12
12
  FocusTrap
13
- } from "./KODEDJGB.js";
13
+ } from "./J7FCX3U6.js";
14
14
  import {
15
15
  IconButton_default
16
16
  } from "./ZEMGWSJQ.js";
@@ -173,4 +173,4 @@ Modal.displayName = "Modal";
173
173
  export {
174
174
  Modal
175
175
  };
176
- //# sourceMappingURL=TAZE73O2.js.map
176
+ //# sourceMappingURL=YJYZ5SFR.js.map
@@ -24,7 +24,7 @@ function queryFocusableAll(el) {
24
24
  return el.querySelectorAll(selector);
25
25
  }
26
26
  var focusElement = (el) => {
27
- if (typeof el.focus === "function") {
27
+ if (el && typeof el.focus === "function") {
28
28
  el.focus();
29
29
  }
30
30
  };
@@ -69,4 +69,4 @@ function FocusTrap({
69
69
 
70
70
 
71
71
  exports.FocusTrap = FocusTrap;
72
- //# sourceMappingURL=BA4JPX36.cjs.map
72
+ //# sourceMappingURL=ZDQ6WQM3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Modal/FocusTrap.tsx"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,cAAiC;AAyFxD;AAvFJ,SAAS,kBAAkB,IAA6C;AAEtE,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,GAAG;AACV,SAAO,GAAG,iBAAiB,QAAQ;AACrC;AAEA,IAAM,eAAe,CAAC,OAAqB;AACzC,MAAI,MAAM,OAAO,GAAG,UAAU,YAAY;AACxC,OAAG,MAAM;AAAA,EACX;AACF;AAKe,SAAR,UAA2B;AAAA,EAChC;AACF,GAEiB;AACf,QAAM,QAAQ,OAA8B,IAAI;AAChD,QAAM,yBAAyB,OAA2B,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,EAAE,SAAS,QAAQ,IAAI;AAG7B,UAAM,kBAAkB,MAAM;AAC5B,YAAM,eAAe,WAAW,OAAO;AACvC,UAAI,WAAW,CAAC,cAAc;AAC5B,qBAAa,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAAA,MAC5C;AAAA,IACF;AAEA,UAAM,cAA2C,CAAC,UAAsB;AACtE,UACE,CAAC,WACA,MAAM,kBAAkB,QAAQ,QAAQ,SAAS,MAAM,MAAM,GAC9D;AACA;AAAA,MACF;AAGA,UACE,MAAM,kBAAkB,WACxB,MAAM,OAAO,QAAQ,mCAAmC,MAAM,MAC9D;AACA;AAAA,MACF;AAEA,YAAM,gBAAgB;AACtB,YAAM,eAAe;AACrB,sBAAgB;AAAA,IAClB;AAGA,2BAAuB,UAAU,SAAS;AAC1C,oBAAgB;AAChB,aAAS,iBAAiB,SAAS,aAAa,IAAI;AAEpD,WAAO,SAAS,UAAU;AACxB,YAAM,EAAE,SAAS,oBAAoB,IAAI;AACzC,eAAS,oBAAoB,SAAS,aAAa,IAAI;AAEvD,UAAI,qBAAqB;AACvB,qBAAa,mBAAmB;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,sBAAsB,CAAC;AAElC,SACE,oBAAC,SAAI,eAAY,qBAAoB,KAAK,OACvC,UACH;AAEJ","sourcesContent":["import React, { useEffect, useRef, type ReactElement } from \"react\";\n\nfunction queryFocusableAll(el: HTMLDivElement): NodeListOf<HTMLElement> {\n // Focusable, interactive elements that could possibly be in children\n const selector = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"iframe\",\n \"object\",\n \"embed\",\n '[tabindex=\"-1\"]',\n '[tabindex=\"0\"]',\n \"[contenteditable]\",\n \"audio[controls]\",\n \"video[controls]\",\n \"summary\",\n ].join(\",\");\n return el.querySelectorAll(selector);\n}\n\nconst focusElement = (el?: HTMLElement) => {\n if (el && typeof el.focus === \"function\") {\n el.focus();\n }\n};\n\n/**\n * FocusTrap is used by components like Modal to ensure that only elements within children components can be focused.\n */\nexport default function FocusTrap({\n children,\n}: {\n children?: ReactElement | null;\n}): ReactElement {\n const elRef = useRef<HTMLDivElement | null>(null);\n const previouslyFocusedElRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const { current: element } = elRef;\n\n // Focus the first child element among all the focusable, interactive elements within `children`\n const focusFirstChild = () => {\n const withinIframe = window !== window.parent;\n if (element && !withinIframe) {\n focusElement(queryFocusableAll(element)[0]);\n }\n };\n\n const handleFocus: (event: FocusEvent) => void = (event: FocusEvent) => {\n if (\n !element ||\n (event.target instanceof Node && element.contains(event.target))\n ) {\n return;\n }\n\n // This prevents stack overflow when multiple FocusTraps are rendered\n if (\n event.target instanceof Element &&\n event.target.closest('[data-testid=\"syntax-focus-trap\"]') !== null\n ) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n focusFirstChild();\n };\n\n // If an element has focus currently, keep a reference to that element\n previouslyFocusedElRef.current = document.activeElement as HTMLElement;\n focusFirstChild();\n document.addEventListener(\"focus\", handleFocus, true);\n\n return function cleanup() {\n const { current: previouslyFocusedEl } = previouslyFocusedElRef;\n document.removeEventListener(\"focus\", handleFocus, true);\n // If we previously stored a reference to a focused element, return focus to that element\n if (previouslyFocusedEl) {\n focusElement(previouslyFocusedEl);\n }\n };\n }, [elRef, previouslyFocusedElRef]);\n\n return (\n <div data-testid=\"syntax-focus-trap\" ref={elRef}>\n {children}\n </div>\n );\n}\n"]}
package/dist/index.cjs CHANGED
@@ -19,23 +19,23 @@ var _TCZBK2P5cjs = require('./__chunks/TCZBK2P5.cjs');
19
19
  var _UAN64LE7cjs = require('./__chunks/UAN64LE7.cjs');
20
20
 
21
21
 
22
- var _K4LTJ5GHcjs = require('./__chunks/K4LTJ5GH.cjs');
22
+ var _VGKS62YPcjs = require('./__chunks/VGKS62YP.cjs');
23
23
 
24
24
 
25
25
  var _WFWI5GYGcjs = require('./__chunks/WFWI5GYG.cjs');
26
26
  require('./__chunks/HUIHS6RN.cjs');
27
27
  require('./__chunks/4TY5KFRY.cjs');
28
- require('./__chunks/BA4JPX36.cjs');
28
+ require('./__chunks/ZDQ6WQM3.cjs');
29
29
 
30
30
 
31
31
  var _W35D2UICcjs = require('./__chunks/W35D2UIC.cjs');
32
32
 
33
33
 
34
- var _RQBPUVVAcjs = require('./__chunks/RQBPUVVA.cjs');
34
+ var _MFKYNKOBcjs = require('./__chunks/MFKYNKOB.cjs');
35
35
  require('./__chunks/4UJE5GMH.cjs');
36
36
 
37
37
 
38
- var _7B7TOXIFcjs = require('./__chunks/7B7TOXIF.cjs');
38
+ var _BSJEH3VScjs = require('./__chunks/BSJEH3VS.cjs');
39
39
  require('./__chunks/WZZQUJZF.cjs');
40
40
 
41
41
 
@@ -67,7 +67,7 @@ require('./__chunks/HWQUS53M.cjs');
67
67
 
68
68
 
69
69
  var _UKLQ64N7cjs = require('./__chunks/UKLQ64N7.cjs');
70
- require('./__chunks/2R3NHAWW.cjs');
70
+ require('./__chunks/SDPPUEJV.cjs');
71
71
  require('./__chunks/J3ES6ZT6.cjs');
72
72
  require('./__chunks/MF7LLV7V.cjs');
73
73
  require('./__chunks/OVXHL32N.cjs');
@@ -136,5 +136,5 @@ require('./__chunks/X2SDR4SD.cjs');
136
136
 
137
137
 
138
138
 
139
- exports.Avatar = _VRVOFKLIcjs.Avatar_default; exports.AvatarGroup = _4MLT3AHKcjs.AvatarGroup; exports.Badge = _MKGPWRABcjs.Badge_default; exports.Box = _E4LISCR7cjs.Box_default; exports.Button = _IXDYGNLNcjs.Button_default; exports.ButtonGroup = _VBQTLO2Pcjs.ButtonGroup_default; exports.Card = _OV5U4YJNcjs.Card; exports.Checkbox = _UAN64LE7cjs.Checkbox_default; exports.Chip = _I75WZ7AVcjs.Chip_default; exports.Divider = _MG2NM3WUcjs.Divider; exports.Heading = _WFWI5GYGcjs.Heading_default; exports.IconButton = _KWT6ABYPcjs.IconButton_default; exports.LinkButton = _TCZBK2P5cjs.LinkButton_default; exports.Modal = _K4LTJ5GHcjs.Modal; exports.Popover = _L5FISA2Ucjs.Popover_default; exports.RadioButton = _ZYCAP5AYcjs.RadioButton_default; exports.RichSelectList = _7B7TOXIFcjs.RichSelectList_default; exports.SelectList = _RQBPUVVAcjs.SelectList; exports.TapArea = _UKLQ64N7cjs.TapArea_default; exports.TextArea = _W35D2UICcjs.TextArea_default; exports.TextField = _MQ7FU53Wcjs.TextField; exports.ThemeProvider = _TBQR2FPScjs.ThemeProvider; exports.Tooltip = _XJL3R42Dcjs.Tooltip_default; exports.Typography = _TJN7NBWUcjs.Typography_default; exports.useTheme = _TBQR2FPScjs.useTheme;
139
+ exports.Avatar = _VRVOFKLIcjs.Avatar_default; exports.AvatarGroup = _4MLT3AHKcjs.AvatarGroup; exports.Badge = _MKGPWRABcjs.Badge_default; exports.Box = _E4LISCR7cjs.Box_default; exports.Button = _IXDYGNLNcjs.Button_default; exports.ButtonGroup = _VBQTLO2Pcjs.ButtonGroup_default; exports.Card = _OV5U4YJNcjs.Card; exports.Checkbox = _UAN64LE7cjs.Checkbox_default; exports.Chip = _I75WZ7AVcjs.Chip_default; exports.Divider = _MG2NM3WUcjs.Divider; exports.Heading = _WFWI5GYGcjs.Heading_default; exports.IconButton = _KWT6ABYPcjs.IconButton_default; exports.LinkButton = _TCZBK2P5cjs.LinkButton_default; exports.Modal = _VGKS62YPcjs.Modal; exports.Popover = _L5FISA2Ucjs.Popover_default; exports.RadioButton = _ZYCAP5AYcjs.RadioButton_default; exports.RichSelectList = _BSJEH3VScjs.RichSelectList_default; exports.SelectList = _MFKYNKOBcjs.SelectList; exports.TapArea = _UKLQ64N7cjs.TapArea_default; exports.TextArea = _W35D2UICcjs.TextArea_default; exports.TextField = _MQ7FU53Wcjs.TextField; exports.ThemeProvider = _TBQR2FPScjs.ThemeProvider; exports.Tooltip = _XJL3R42Dcjs.Tooltip_default; exports.Typography = _TJN7NBWUcjs.Typography_default; exports.useTheme = _TBQR2FPScjs.useTheme;
140
140
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -19,23 +19,23 @@ import {
19
19
  } from "./__chunks/P2BCEYCC.js";
20
20
  import {
21
21
  Modal
22
- } from "./__chunks/TAZE73O2.js";
22
+ } from "./__chunks/YJYZ5SFR.js";
23
23
  import {
24
24
  Heading_default
25
25
  } from "./__chunks/ZFMV7BOZ.js";
26
26
  import "./__chunks/QQT35OLE.js";
27
27
  import "./__chunks/MOU24MJO.js";
28
- import "./__chunks/KODEDJGB.js";
28
+ import "./__chunks/J7FCX3U6.js";
29
29
  import {
30
30
  TextArea_default
31
31
  } from "./__chunks/3LO2QLOH.js";
32
32
  import {
33
33
  SelectList
34
- } from "./__chunks/PO5IE5IC.js";
34
+ } from "./__chunks/C5O3IZ3E.js";
35
35
  import "./__chunks/Y47XTR6M.js";
36
36
  import {
37
37
  RichSelectList_default
38
- } from "./__chunks/QD2ZKJLS.js";
38
+ } from "./__chunks/QJFLG22W.js";
39
39
  import "./__chunks/6EKM3QTW.js";
40
40
  import {
41
41
  ButtonGroup_default
@@ -67,7 +67,7 @@ import "./__chunks/GFKDPMFK.js";
67
67
  import {
68
68
  TapArea_default
69
69
  } from "./__chunks/5MJ6NOUC.js";
70
- import "./__chunks/B3SQDLKQ.js";
70
+ import "./__chunks/OMFY5XWC.js";
71
71
  import "./__chunks/4NSYLHIG.js";
72
72
  import "./__chunks/DDUJFFG7.js";
73
73
  import "./__chunks/KWRU2RKT.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": "10.24.0",
4
+ "version": "10.25.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Modal/FocusTrap.tsx"],"names":[],"mappings":";;;AAAA,SAAgB,WAAW,cAAiC;AAyFxD;AAvFJ,SAAS,kBAAkB,IAA6C;AAEtE,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,GAAG;AACV,SAAO,GAAG,iBAAiB,QAAQ;AACrC;AAEA,IAAM,eAAe,CAAC,OAAoB;AACxC,MAAI,OAAO,GAAG,UAAU,YAAY;AAClC,OAAG,MAAM;AAAA,EACX;AACF;AAKe,SAAR,UAA2B;AAAA,EAChC;AACF,GAEiB;AACf,QAAM,QAAQ,OAA8B,IAAI;AAChD,QAAM,yBAAyB,OAA2B,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,EAAE,SAAS,QAAQ,IAAI;AAG7B,UAAM,kBAAkB,MAAM;AAC5B,YAAM,eAAe,WAAW,OAAO;AACvC,UAAI,WAAW,CAAC,cAAc;AAC5B,qBAAa,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAAA,MAC5C;AAAA,IACF;AAEA,UAAM,cAA2C,CAAC,UAAsB;AACtE,UACE,CAAC,WACA,MAAM,kBAAkB,QAAQ,QAAQ,SAAS,MAAM,MAAM,GAC9D;AACA;AAAA,MACF;AAGA,UACE,MAAM,kBAAkB,WACxB,MAAM,OAAO,QAAQ,mCAAmC,MAAM,MAC9D;AACA;AAAA,MACF;AAEA,YAAM,gBAAgB;AACtB,YAAM,eAAe;AACrB,sBAAgB;AAAA,IAClB;AAGA,2BAAuB,UAAU,SAAS;AAC1C,oBAAgB;AAChB,aAAS,iBAAiB,SAAS,aAAa,IAAI;AAEpD,WAAO,SAAS,UAAU;AACxB,YAAM,EAAE,SAAS,oBAAoB,IAAI;AACzC,eAAS,oBAAoB,SAAS,aAAa,IAAI;AAEvD,UAAI,qBAAqB;AACvB,qBAAa,mBAAmB;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,sBAAsB,CAAC;AAElC,SACE,oBAAC,SAAI,eAAY,qBAAoB,KAAK,OACvC,UACH;AAEJ","sourcesContent":["import React, { useEffect, useRef, type ReactElement } from \"react\";\n\nfunction queryFocusableAll(el: HTMLDivElement): NodeListOf<HTMLElement> {\n // Focusable, interactive elements that could possibly be in children\n const selector = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"iframe\",\n \"object\",\n \"embed\",\n '[tabindex=\"-1\"]',\n '[tabindex=\"0\"]',\n \"[contenteditable]\",\n \"audio[controls]\",\n \"video[controls]\",\n \"summary\",\n ].join(\",\");\n return el.querySelectorAll(selector);\n}\n\nconst focusElement = (el: HTMLElement) => {\n if (typeof el.focus === \"function\") {\n el.focus();\n }\n};\n\n/**\n * FocusTrap is used by components like Modal to ensure that only elements within children components can be focused.\n */\nexport default function FocusTrap({\n children,\n}: {\n children?: ReactElement | null;\n}): ReactElement {\n const elRef = useRef<HTMLDivElement | null>(null);\n const previouslyFocusedElRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const { current: element } = elRef;\n\n // Focus the first child element among all the focusable, interactive elements within `children`\n const focusFirstChild = () => {\n const withinIframe = window !== window.parent;\n if (element && !withinIframe) {\n focusElement(queryFocusableAll(element)[0]);\n }\n };\n\n const handleFocus: (event: FocusEvent) => void = (event: FocusEvent) => {\n if (\n !element ||\n (event.target instanceof Node && element.contains(event.target))\n ) {\n return;\n }\n\n // This prevents stack overflow when multiple FocusTraps are rendered\n if (\n event.target instanceof Element &&\n event.target.closest('[data-testid=\"syntax-focus-trap\"]') !== null\n ) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n focusFirstChild();\n };\n\n // If an element has focus currently, keep a reference to that element\n previouslyFocusedElRef.current = document.activeElement as HTMLElement;\n focusFirstChild();\n document.addEventListener(\"focus\", handleFocus, true);\n\n return function cleanup() {\n const { current: previouslyFocusedEl } = previouslyFocusedElRef;\n document.removeEventListener(\"focus\", handleFocus, true);\n // If we previously stored a reference to a focused element, return focus to that element\n if (previouslyFocusedEl) {\n focusElement(previouslyFocusedEl);\n }\n };\n }, [elRef, previouslyFocusedElRef]);\n\n return (\n <div data-testid=\"syntax-focus-trap\" ref={elRef}>\n {children}\n </div>\n );\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/Modal/FocusTrap.tsx"],"sourcesContent":["import React, { useEffect, useRef, type ReactElement } from \"react\";\n\nfunction queryFocusableAll(el: HTMLDivElement): NodeListOf<HTMLElement> {\n // Focusable, interactive elements that could possibly be in children\n const selector = [\n \"a[href]\",\n \"area[href]\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"button:not([disabled])\",\n \"iframe\",\n \"object\",\n \"embed\",\n '[tabindex=\"-1\"]',\n '[tabindex=\"0\"]',\n \"[contenteditable]\",\n \"audio[controls]\",\n \"video[controls]\",\n \"summary\",\n ].join(\",\");\n return el.querySelectorAll(selector);\n}\n\nconst focusElement = (el: HTMLElement) => {\n if (typeof el.focus === \"function\") {\n el.focus();\n }\n};\n\n/**\n * FocusTrap is used by components like Modal to ensure that only elements within children components can be focused.\n */\nexport default function FocusTrap({\n children,\n}: {\n children?: ReactElement | null;\n}): ReactElement {\n const elRef = useRef<HTMLDivElement | null>(null);\n const previouslyFocusedElRef = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const { current: element } = elRef;\n\n // Focus the first child element among all the focusable, interactive elements within `children`\n const focusFirstChild = () => {\n const withinIframe = window !== window.parent;\n if (element && !withinIframe) {\n focusElement(queryFocusableAll(element)[0]);\n }\n };\n\n const handleFocus: (event: FocusEvent) => void = (event: FocusEvent) => {\n if (\n !element ||\n (event.target instanceof Node && element.contains(event.target))\n ) {\n return;\n }\n\n // This prevents stack overflow when multiple FocusTraps are rendered\n if (\n event.target instanceof Element &&\n event.target.closest('[data-testid=\"syntax-focus-trap\"]') !== null\n ) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n focusFirstChild();\n };\n\n // If an element has focus currently, keep a reference to that element\n previouslyFocusedElRef.current = document.activeElement as HTMLElement;\n focusFirstChild();\n document.addEventListener(\"focus\", handleFocus, true);\n\n return function cleanup() {\n const { current: previouslyFocusedEl } = previouslyFocusedElRef;\n document.removeEventListener(\"focus\", handleFocus, true);\n // If we previously stored a reference to a focused element, return focus to that element\n if (previouslyFocusedEl) {\n focusElement(previouslyFocusedEl);\n }\n };\n }, [elRef, previouslyFocusedElRef]);\n\n return (\n <div data-testid=\"syntax-focus-trap\" ref={elRef}>\n {children}\n </div>\n );\n}\n"],"mappings":";;;AAAA,SAAgB,WAAW,cAAiC;AAyFxD;AAvFJ,SAAS,kBAAkB,IAA6C;AAEtE,QAAM,WAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,KAAK,GAAG;AACV,SAAO,GAAG,iBAAiB,QAAQ;AACrC;AAEA,IAAM,eAAe,CAAC,OAAoB;AACxC,MAAI,OAAO,GAAG,UAAU,YAAY;AAClC,OAAG,MAAM;AAAA,EACX;AACF;AAKe,SAAR,UAA2B;AAAA,EAChC;AACF,GAEiB;AACf,QAAM,QAAQ,OAA8B,IAAI;AAChD,QAAM,yBAAyB,OAA2B,IAAI;AAE9D,YAAU,MAAM;AACd,UAAM,EAAE,SAAS,QAAQ,IAAI;AAG7B,UAAM,kBAAkB,MAAM;AAC5B,YAAM,eAAe,WAAW,OAAO;AACvC,UAAI,WAAW,CAAC,cAAc;AAC5B,qBAAa,kBAAkB,OAAO,EAAE,CAAC,CAAC;AAAA,MAC5C;AAAA,IACF;AAEA,UAAM,cAA2C,CAAC,UAAsB;AACtE,UACE,CAAC,WACA,MAAM,kBAAkB,QAAQ,QAAQ,SAAS,MAAM,MAAM,GAC9D;AACA;AAAA,MACF;AAGA,UACE,MAAM,kBAAkB,WACxB,MAAM,OAAO,QAAQ,mCAAmC,MAAM,MAC9D;AACA;AAAA,MACF;AAEA,YAAM,gBAAgB;AACtB,YAAM,eAAe;AACrB,sBAAgB;AAAA,IAClB;AAGA,2BAAuB,UAAU,SAAS;AAC1C,oBAAgB;AAChB,aAAS,iBAAiB,SAAS,aAAa,IAAI;AAEpD,WAAO,SAAS,UAAU;AACxB,YAAM,EAAE,SAAS,oBAAoB,IAAI;AACzC,eAAS,oBAAoB,SAAS,aAAa,IAAI;AAEvD,UAAI,qBAAqB;AACvB,qBAAa,mBAAmB;AAAA,MAClC;AAAA,IACF;AAAA,EACF,GAAG,CAAC,OAAO,sBAAsB,CAAC;AAElC,SACE,oBAAC,SAAI,eAAY,qBAAoB,KAAK,OACvC,UACH;AAEJ;","names":[]}