@cambly/syntax-core 10.24.0 → 10.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Badge/Badge.d.ts +1 -1
- package/dist/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/Checkbox/Checkbox.d.ts +1 -1
- package/dist/Heading/Heading.cjs +2 -2
- package/dist/Heading/Heading.d.ts +2 -2
- package/dist/Heading/Heading.js +1 -1
- package/dist/Modal/FocusTrap.cjs +2 -2
- package/dist/Modal/FocusTrap.js +1 -1
- package/dist/Modal/Modal.cjs +4 -4
- package/dist/Modal/Modal.js +3 -3
- package/dist/RadioButton/RadioButton.d.ts +1 -1
- package/dist/RichSelect/RichSelectBox.d.ts +1 -1
- package/dist/RichSelect/RichSelectList.cjs +3 -3
- package/dist/RichSelect/RichSelectList.d.ts +1 -1
- package/dist/RichSelect/RichSelectList.js +2 -2
- package/dist/RichSelect/RichSelectRadioButton.d.ts +1 -1
- package/dist/SelectList/SelectList.cjs +3 -3
- package/dist/SelectList/SelectList.js +2 -2
- package/dist/TapArea/TapArea.d.ts +1 -1
- package/dist/Typography/Typography.d.ts +5 -5
- package/dist/__chunks/{RQBPUVVA.cjs → 2JHU2ASK.cjs} +3 -3
- package/dist/__chunks/{WFWI5GYG.cjs → 6XZHBBJP.cjs} +2 -2
- package/dist/__chunks/6XZHBBJP.cjs.map +1 -0
- package/dist/__chunks/{2R3NHAWW.cjs → CCDZUAUU.cjs} +1 -1
- package/dist/__chunks/{2R3NHAWW.cjs.map → CCDZUAUU.cjs.map} +1 -1
- package/dist/__chunks/{TAZE73O2.js → CX2IJ7UB.js} +3 -3
- package/dist/__chunks/{QD2ZKJLS.js → FJ7CVAIA.js} +2 -2
- package/dist/__chunks/{K4LTJ5GH.cjs → HNR3FTMR.cjs} +5 -5
- package/dist/__chunks/{KODEDJGB.js → J7FCX3U6.js} +2 -2
- package/dist/__chunks/J7FCX3U6.js.map +1 -0
- package/dist/__chunks/{ZFMV7BOZ.js → KZD6BFDA.js} +2 -2
- package/dist/__chunks/KZD6BFDA.js.map +1 -0
- package/dist/__chunks/{B3SQDLKQ.js → PLUOUSZL.js} +1 -1
- package/dist/__chunks/{B3SQDLKQ.js.map → PLUOUSZL.js.map} +1 -1
- package/dist/__chunks/{PO5IE5IC.js → XISRQSXZ.js} +2 -2
- package/dist/__chunks/{7B7TOXIF.cjs → Z6B4SAEZ.cjs} +3 -3
- package/dist/__chunks/{BA4JPX36.cjs → ZDQ6WQM3.cjs} +2 -2
- package/dist/__chunks/ZDQ6WQM3.cjs.map +1 -0
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/package.json +1 -1
- package/dist/__chunks/BA4JPX36.cjs.map +0 -1
- package/dist/__chunks/KODEDJGB.js.map +0 -1
- package/dist/__chunks/WFWI5GYG.cjs.map +0 -1
- package/dist/__chunks/ZFMV7BOZ.js.map +0 -1
- /package/dist/__chunks/{RQBPUVVA.cjs.map → 2JHU2ASK.cjs.map} +0 -0
- /package/dist/__chunks/{TAZE73O2.js.map → CX2IJ7UB.js.map} +0 -0
- /package/dist/__chunks/{QD2ZKJLS.js.map → FJ7CVAIA.js.map} +0 -0
- /package/dist/__chunks/{K4LTJ5GH.cjs.map → HNR3FTMR.cjs.map} +0 -0
- /package/dist/__chunks/{PO5IE5IC.js.map → XISRQSXZ.js.map} +0 -0
- /package/dist/__chunks/{7B7TOXIF.cjs.map → Z6B4SAEZ.cjs.map} +0 -0
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ declare const Avatar: ({ accessibilityLabel, icon, size, src, }: {
|
|
|
32
32
|
*
|
|
33
33
|
* @defaultValue `md`
|
|
34
34
|
*/
|
|
35
|
-
size?: "
|
|
35
|
+
size?: "xl" | "lg" | "md" | "sm" | "xs" | undefined;
|
|
36
36
|
/**
|
|
37
37
|
* URL of the image to display as the avatar.
|
|
38
38
|
*/
|
package/dist/Badge/Badge.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ declare const Badge: ({ icon: Icon, text, color, }: {
|
|
|
41
41
|
*
|
|
42
42
|
* @defaultValue "primary700"
|
|
43
43
|
*/
|
|
44
|
-
color?: "
|
|
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 };
|
package/dist/Heading/Heading.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _6XZHBBJPcjs = require('../__chunks/6XZHBBJP.cjs');
|
|
5
5
|
require('../__chunks/TJN7NBWU.cjs');
|
|
6
6
|
require('../__chunks/QAS3KERZ.cjs');
|
|
7
7
|
require('../__chunks/WFVGNGEP.cjs');
|
|
@@ -9,5 +9,5 @@ require('../__chunks/TBQR2FPS.cjs');
|
|
|
9
9
|
require('../__chunks/X2SDR4SD.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
exports.default =
|
|
12
|
+
exports.default = _6XZHBBJPcjs.Heading_default;
|
|
13
13
|
//# sourceMappingURL=Heading.cjs.map
|
|
@@ -11,7 +11,7 @@ declare const Heading: ({ align, as, children, color, "data-testid": dataTestId,
|
|
|
11
11
|
*
|
|
12
12
|
* @defaultValue "start"
|
|
13
13
|
*/
|
|
14
|
-
align?: "
|
|
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?: "
|
|
30
|
+
color?: "gray700" | "gray900" | "white" | "inherit" | "primary" | "destructive-primary" | "success" | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* Test id for the text.
|
|
33
33
|
*/
|
package/dist/Heading/Heading.js
CHANGED
package/dist/Modal/FocusTrap.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _ZDQ6WQM3cjs = require('../__chunks/ZDQ6WQM3.cjs');
|
|
5
5
|
require('../__chunks/X2SDR4SD.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = _ZDQ6WQM3cjs.FocusTrap;
|
|
9
9
|
//# sourceMappingURL=FocusTrap.cjs.map
|
package/dist/Modal/FocusTrap.js
CHANGED
package/dist/Modal/Modal.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../__chunks/
|
|
4
|
+
var _HNR3FTMRcjs = require('../__chunks/HNR3FTMR.cjs');
|
|
5
|
+
require('../__chunks/6XZHBBJP.cjs');
|
|
6
6
|
require('../__chunks/HUIHS6RN.cjs');
|
|
7
7
|
require('../__chunks/4TY5KFRY.cjs');
|
|
8
|
-
require('../__chunks/
|
|
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 =
|
|
28
|
+
exports.default = _HNR3FTMRcjs.Modal;
|
|
29
29
|
//# sourceMappingURL=Modal.cjs.map
|
package/dist/Modal/Modal.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Modal
|
|
4
|
-
} from "../__chunks/
|
|
5
|
-
import "../__chunks/
|
|
4
|
+
} from "../__chunks/CX2IJ7UB.js";
|
|
5
|
+
import "../__chunks/KZD6BFDA.js";
|
|
6
6
|
import "../__chunks/QQT35OLE.js";
|
|
7
7
|
import "../__chunks/MOU24MJO.js";
|
|
8
|
-
import "../__chunks/
|
|
8
|
+
import "../__chunks/J7FCX3U6.js";
|
|
9
9
|
import "../__chunks/ZEMGWSJQ.js";
|
|
10
10
|
import "../__chunks/OMFFRI3K.js";
|
|
11
11
|
import "../__chunks/4U4UW4AK.js";
|
|
@@ -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?: "
|
|
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
|
|
4
|
+
var _Z6B4SAEZcjs = require('../__chunks/Z6B4SAEZ.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/
|
|
22
|
+
require('../__chunks/CCDZUAUU.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 =
|
|
51
|
+
exports.default = _Z6B4SAEZcjs.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?: "
|
|
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/
|
|
4
|
+
} from "../__chunks/FJ7CVAIA.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/
|
|
22
|
+
import "../__chunks/PLUOUSZL.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?: "
|
|
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
|
|
4
|
+
var _2JHU2ASKcjs = require('../__chunks/2JHU2ASK.cjs');
|
|
5
5
|
require('../__chunks/4UJE5GMH.cjs');
|
|
6
|
-
require('../__chunks/
|
|
6
|
+
require('../__chunks/CCDZUAUU.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 =
|
|
21
|
+
exports.default = _2JHU2ASKcjs.SelectList;
|
|
22
22
|
//# sourceMappingURL=SelectList.cjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
SelectList
|
|
4
|
-
} from "../__chunks/
|
|
4
|
+
} from "../__chunks/XISRQSXZ.js";
|
|
5
5
|
import "../__chunks/Y47XTR6M.js";
|
|
6
|
-
import "../__chunks/
|
|
6
|
+
import "../__chunks/PLUOUSZL.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?: "
|
|
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?: "
|
|
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" |
|
|
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?: "
|
|
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?:
|
|
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?: "
|
|
136
|
+
weight?: "bold" | "regular" | "interactive" | "medium" | "semiBold" | "heavy" | undefined;
|
|
137
137
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
138
138
|
|
|
139
139
|
export { Typography as default };
|
|
@@ -5,7 +5,7 @@ var _4UJE5GMHcjs = require('./4UJE5GMH.cjs');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _CCDZUAUUcjs = require('./CCDZUAUU.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 ?
|
|
116
|
+
fill: errorText ? _CCDZUAUUcjs.ColorBaseDestructive700 : _CCDZUAUUcjs.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=
|
|
140
|
+
//# sourceMappingURL=2JHU2ASK.cjs.map
|
|
@@ -12,7 +12,7 @@ function cambioWeight({
|
|
|
12
12
|
fontStyle,
|
|
13
13
|
size
|
|
14
14
|
}) {
|
|
15
|
-
if (fontStyle === "serif" && [400, 500].includes(size)) {
|
|
15
|
+
if (fontStyle === "serif" && [400, 500, 600].includes(size)) {
|
|
16
16
|
return "bold";
|
|
17
17
|
} else if (fontStyle === "serif") {
|
|
18
18
|
return "medium";
|
|
@@ -52,4 +52,4 @@ var Heading_default = Heading;
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
exports.Heading_default = Heading_default;
|
|
55
|
-
//# sourceMappingURL=
|
|
55
|
+
//# sourceMappingURL=6XZHBBJP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":";;;;;;;;;AAqHI;AAjHJ,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGkC;AAChC,MAAI,cAAc,WAAW,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,IAAI,GAAG;AAC3D,WAAO;AAAA,EACT,WAAW,cAAc,SAAS;AAChC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAKA,IAAM,UAAU,CAAC;AAAA,EACf,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AACT,MAgFoB;AAClB,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,QAAM,gBAAgB,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,IAAI,UAAU;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QACE,cAAc,YACV,gBACA,aAAa,EAAE,WAAW,KAAK,CAAC;AAAA,MAGrC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ","sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction cambioWeight({\n fontStyle,\n size,\n}: {\n fontStyle: \"serif\" | \"sans-serif\";\n size: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): \"bold\" | \"medium\" | \"regular\" {\n if (fontStyle === \"serif\" && [400, 500, 600].includes(size)) {\n return \"bold\";\n } else if (fontStyle === \"serif\") {\n return \"medium\";\n } else {\n return \"regular\";\n }\n}\n\n/**\n * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.\n */\nconst Heading = ({\n align = \"start\",\n as = \"h1\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n lineClamp,\n size = 500,\n}: {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"success\"\n | \"white\"\n | \"inherit\";\n /**\n * Test id for the text.\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Classic:\n * * `500`: 20px\n * * `600`: 28px\n * * `700`: 40px\n * * `800`: 64px\n *\n * Cambio Mobile:\n * * `400`: 20px\n * * `500`: 23px\n * * `600`: 26px\n * * `700`: 29px\n * * `800`: 33px\n * * `900`: 37px\n * * `1000`: 41px\n * * `1100`: 46px\n *\n * Cambio Desktop (viewport width > 480px):\n * * `400`: 25px\n * * `500`: 31px\n * * `600`: 39px\n * * `700`: 49px\n * * `800`: 61px\n * * `900`: 76px\n * * `1000`: 95px\n * * `1100`: 119px\n *\n * @defaultValue 500\n */\n size?: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): ReactElement => {\n const { themeName } = useTheme();\n const classicWeight = [700, 800].includes(size) ? \"heavy\" : \"bold\";\n\n return (\n <Typography\n align={align}\n as={as}\n color={color}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n lineClamp={lineClamp}\n size={size}\n weight={\n themeName === \"classic\"\n ? classicWeight\n : cambioWeight({ fontStyle, size })\n }\n >\n {children}\n </Typography>\n );\n};\n\nexport default Heading;\n"]}
|
|
@@ -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
|
|
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 22:41: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 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,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
Heading_default
|
|
4
|
-
} from "./
|
|
4
|
+
} from "./KZD6BFDA.js";
|
|
5
5
|
import {
|
|
6
6
|
StopScroll
|
|
7
7
|
} from "./QQT35OLE.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./MOU24MJO.js";
|
|
11
11
|
import {
|
|
12
12
|
FocusTrap
|
|
13
|
-
} from "./
|
|
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=
|
|
176
|
+
//# sourceMappingURL=CX2IJ7UB.js.map
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
ColorBaseDestructive700,
|
|
21
21
|
ColorBaseGray800
|
|
22
|
-
} from "./
|
|
22
|
+
} from "./PLUOUSZL.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=
|
|
281
|
+
//# sourceMappingURL=FJ7CVAIA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client"
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _6XZHBBJPcjs = require('./6XZHBBJP.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _HUIHS6RNcjs = require('./HUIHS6RN.cjs');
|
|
@@ -10,7 +10,7 @@ var _HUIHS6RNcjs = require('./HUIHS6RN.cjs');
|
|
|
10
10
|
var _4TY5KFRYcjs = require('./4TY5KFRY.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
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,
|
|
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,
|
|
@@ -136,7 +136,7 @@ function Modal({
|
|
|
136
136
|
padding: themeName === "classic" ? 9 : 6,
|
|
137
137
|
children: [
|
|
138
138
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
-
|
|
139
|
+
_6XZHBBJPcjs.Heading_default,
|
|
140
140
|
{
|
|
141
141
|
as: "h1",
|
|
142
142
|
size: themeName === "classic" ? 500 : 600,
|
|
@@ -173,4 +173,4 @@ Modal.displayName = "Modal";
|
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
exports.Modal = Modal;
|
|
176
|
-
//# sourceMappingURL=
|
|
176
|
+
//# sourceMappingURL=HNR3FTMR.cjs.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=
|
|
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":[]}
|
|
@@ -12,7 +12,7 @@ function cambioWeight({
|
|
|
12
12
|
fontStyle,
|
|
13
13
|
size
|
|
14
14
|
}) {
|
|
15
|
-
if (fontStyle === "serif" && [400, 500].includes(size)) {
|
|
15
|
+
if (fontStyle === "serif" && [400, 500, 600].includes(size)) {
|
|
16
16
|
return "bold";
|
|
17
17
|
} else if (fontStyle === "serif") {
|
|
18
18
|
return "medium";
|
|
@@ -52,4 +52,4 @@ var Heading_default = Heading;
|
|
|
52
52
|
export {
|
|
53
53
|
Heading_default
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=
|
|
55
|
+
//# sourceMappingURL=KZD6BFDA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction cambioWeight({\n fontStyle,\n size,\n}: {\n fontStyle: \"serif\" | \"sans-serif\";\n size: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): \"bold\" | \"medium\" | \"regular\" {\n if (fontStyle === \"serif\" && [400, 500, 600].includes(size)) {\n return \"bold\";\n } else if (fontStyle === \"serif\") {\n return \"medium\";\n } else {\n return \"regular\";\n }\n}\n\n/**\n * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.\n */\nconst Heading = ({\n align = \"start\",\n as = \"h1\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n lineClamp,\n size = 500,\n}: {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"success\"\n | \"white\"\n | \"inherit\";\n /**\n * Test id for the text.\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Classic:\n * * `500`: 20px\n * * `600`: 28px\n * * `700`: 40px\n * * `800`: 64px\n *\n * Cambio Mobile:\n * * `400`: 20px\n * * `500`: 23px\n * * `600`: 26px\n * * `700`: 29px\n * * `800`: 33px\n * * `900`: 37px\n * * `1000`: 41px\n * * `1100`: 46px\n *\n * Cambio Desktop (viewport width > 480px):\n * * `400`: 25px\n * * `500`: 31px\n * * `600`: 39px\n * * `700`: 49px\n * * `800`: 61px\n * * `900`: 76px\n * * `1000`: 95px\n * * `1100`: 119px\n *\n * @defaultValue 500\n */\n size?: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): ReactElement => {\n const { themeName } = useTheme();\n const classicWeight = [700, 800].includes(size) ? \"heavy\" : \"bold\";\n\n return (\n <Typography\n align={align}\n as={as}\n color={color}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n lineClamp={lineClamp}\n size={size}\n weight={\n themeName === \"classic\"\n ? classicWeight\n : cambioWeight({ fontStyle, size })\n }\n >\n {children}\n </Typography>\n );\n};\n\nexport default Heading;\n"],"mappings":";;;;;;;;;AAqHI;AAjHJ,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGkC;AAChC,MAAI,cAAc,WAAW,CAAC,KAAK,KAAK,GAAG,EAAE,SAAS,IAAI,GAAG;AAC3D,WAAO;AAAA,EACT,WAAW,cAAc,SAAS;AAChC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAKA,IAAM,UAAU,CAAC;AAAA,EACf,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AACT,MAgFoB;AAClB,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,QAAM,gBAAgB,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,IAAI,UAAU;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QACE,cAAc,YACV,gBACA,aAAa,EAAE,WAAW,KAAK,CAAC;AAAA,MAGrC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
|
|
@@ -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
|
|
1
|
+
{"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Mon, 25 Mar 2024 22:41: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 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":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
ColorBaseDestructive700,
|
|
7
7
|
ColorBaseGray800
|
|
8
|
-
} from "./
|
|
8
|
+
} from "./PLUOUSZL.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=
|
|
140
|
+
//# sourceMappingURL=XISRQSXZ.js.map
|
|
@@ -19,7 +19,7 @@ var _UKLQ64N7cjs = require('./UKLQ64N7.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _CCDZUAUUcjs = require('./CCDZUAUU.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 ?
|
|
246
|
+
fill: errorText ? _CCDZUAUUcjs.ColorBaseDestructive700 : _CCDZUAUUcjs.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=
|
|
281
|
+
//# sourceMappingURL=Z6B4SAEZ.cjs.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=
|
|
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
|
|
22
|
+
var _HNR3FTMRcjs = require('./__chunks/HNR3FTMR.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
var
|
|
25
|
+
var _6XZHBBJPcjs = require('./__chunks/6XZHBBJP.cjs');
|
|
26
26
|
require('./__chunks/HUIHS6RN.cjs');
|
|
27
27
|
require('./__chunks/4TY5KFRY.cjs');
|
|
28
|
-
require('./__chunks/
|
|
28
|
+
require('./__chunks/ZDQ6WQM3.cjs');
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
var _W35D2UICcjs = require('./__chunks/W35D2UIC.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
34
|
+
var _2JHU2ASKcjs = require('./__chunks/2JHU2ASK.cjs');
|
|
35
35
|
require('./__chunks/4UJE5GMH.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _Z6B4SAEZcjs = require('./__chunks/Z6B4SAEZ.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/
|
|
70
|
+
require('./__chunks/CCDZUAUU.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 =
|
|
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 = _6XZHBBJPcjs.Heading_default; exports.IconButton = _KWT6ABYPcjs.IconButton_default; exports.LinkButton = _TCZBK2P5cjs.LinkButton_default; exports.Modal = _HNR3FTMRcjs.Modal; exports.Popover = _L5FISA2Ucjs.Popover_default; exports.RadioButton = _ZYCAP5AYcjs.RadioButton_default; exports.RichSelectList = _Z6B4SAEZcjs.RichSelectList_default; exports.SelectList = _2JHU2ASKcjs.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/
|
|
22
|
+
} from "./__chunks/CX2IJ7UB.js";
|
|
23
23
|
import {
|
|
24
24
|
Heading_default
|
|
25
|
-
} from "./__chunks/
|
|
25
|
+
} from "./__chunks/KZD6BFDA.js";
|
|
26
26
|
import "./__chunks/QQT35OLE.js";
|
|
27
27
|
import "./__chunks/MOU24MJO.js";
|
|
28
|
-
import "./__chunks/
|
|
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/
|
|
34
|
+
} from "./__chunks/XISRQSXZ.js";
|
|
35
35
|
import "./__chunks/Y47XTR6M.js";
|
|
36
36
|
import {
|
|
37
37
|
RichSelectList_default
|
|
38
|
-
} from "./__chunks/
|
|
38
|
+
} from "./__chunks/FJ7CVAIA.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/
|
|
70
|
+
import "./__chunks/PLUOUSZL.js";
|
|
71
71
|
import "./__chunks/4NSYLHIG.js";
|
|
72
72
|
import "./__chunks/DDUJFFG7.js";
|
|
73
73
|
import "./__chunks/KWRU2RKT.js";
|
package/package.json
CHANGED
|
@@ -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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"names":[],"mappings":";;;;;;;;;AAqHI;AAjHJ,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGkC;AAChC,MAAI,cAAc,WAAW,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,GAAG;AACtD,WAAO;AAAA,EACT,WAAW,cAAc,SAAS;AAChC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAKA,IAAM,UAAU,CAAC;AAAA,EACf,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AACT,MAgFoB;AAClB,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,QAAM,gBAAgB,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,IAAI,UAAU;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QACE,cAAc,YACV,gBACA,aAAa,EAAE,WAAW,KAAK,CAAC;AAAA,MAGrC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ","sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction cambioWeight({\n fontStyle,\n size,\n}: {\n fontStyle: \"serif\" | \"sans-serif\";\n size: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): \"bold\" | \"medium\" | \"regular\" {\n if (fontStyle === \"serif\" && [400, 500].includes(size)) {\n return \"bold\";\n } else if (fontStyle === \"serif\") {\n return \"medium\";\n } else {\n return \"regular\";\n }\n}\n\n/**\n * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.\n */\nconst Heading = ({\n align = \"start\",\n as = \"h1\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n lineClamp,\n size = 500,\n}: {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"success\"\n | \"white\"\n | \"inherit\";\n /**\n * Test id for the text.\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Classic:\n * * `500`: 20px\n * * `600`: 28px\n * * `700`: 40px\n * * `800`: 64px\n *\n * Cambio Mobile:\n * * `400`: 20px\n * * `500`: 23px\n * * `600`: 26px\n * * `700`: 29px\n * * `800`: 33px\n * * `900`: 37px\n * * `1000`: 41px\n * * `1100`: 46px\n *\n * Cambio Desktop (viewport width > 480px):\n * * `400`: 25px\n * * `500`: 31px\n * * `600`: 39px\n * * `700`: 49px\n * * `800`: 61px\n * * `900`: 76px\n * * `1000`: 95px\n * * `1100`: 119px\n *\n * @defaultValue 500\n */\n size?: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): ReactElement => {\n const { themeName } = useTheme();\n const classicWeight = [700, 800].includes(size) ? \"heavy\" : \"bold\";\n\n return (\n <Typography\n align={align}\n as={as}\n color={color}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n lineClamp={lineClamp}\n size={size}\n weight={\n themeName === \"classic\"\n ? classicWeight\n : cambioWeight({ fontStyle, size })\n }\n >\n {children}\n </Typography>\n );\n};\n\nexport default Heading;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Heading/Heading.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode } from \"react\";\nimport Typography from \"../Typography/Typography\";\nimport { useTheme } from \"../ThemeProvider/ThemeProvider\";\n\nfunction cambioWeight({\n fontStyle,\n size,\n}: {\n fontStyle: \"serif\" | \"sans-serif\";\n size: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): \"bold\" | \"medium\" | \"regular\" {\n if (fontStyle === \"serif\" && [400, 500].includes(size)) {\n return \"bold\";\n } else if (fontStyle === \"serif\") {\n return \"medium\";\n } else {\n return \"regular\";\n }\n}\n\n/**\n * [Heading](https://cambly-syntax.vercel.app/?path=/docs/components-heading--docs) enforces a consistent style & accessibility best practices for headings.\n */\nconst Heading = ({\n align = \"start\",\n as = \"h1\",\n children,\n color = \"gray900\",\n \"data-testid\": dataTestId,\n fontStyle = \"sans-serif\",\n lineClamp,\n size = 500,\n}: {\n /**\n * Aligns the text to the left, right, or center of the container.\n * * `start` and `end` will align the text to the left or right of the container depending on the locale.\n * * `forceLeft` and `forceRight` will align the text to the left or right of the container regardless of the locale (should be used sparingly).\n *\n * @defaultValue \"start\"\n */\n align?: \"start\" | \"end\" | \"forceLeft\" | \"center\" | \"forceRight\";\n /**\n * DOM element to render as.\n *\n * @defaultValue \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n /**\n * The text to be rendered\n */\n children?: ReactNode;\n /**\n * The color of the text.\n *\n * @defaultValue \"gray900\"\n */\n color?:\n | \"gray900\"\n | \"gray700\"\n | \"primary\"\n | \"destructive-primary\"\n | \"success\"\n | \"white\"\n | \"inherit\";\n /**\n * Test id for the text.\n */\n \"data-testid\"?: string;\n /**\n * Style of the font\n *\n * Classic only supports `sans-serif`\n *\n * @defaultValue \"sans-serif\"\n */\n fontStyle?: \"serif\" | \"sans-serif\";\n /**\n * The number of lines we should truncate the text at\n */\n lineClamp?: number | undefined;\n /**\n * Size of the text.\n *\n * Classic:\n * * `500`: 20px\n * * `600`: 28px\n * * `700`: 40px\n * * `800`: 64px\n *\n * Cambio Mobile:\n * * `400`: 20px\n * * `500`: 23px\n * * `600`: 26px\n * * `700`: 29px\n * * `800`: 33px\n * * `900`: 37px\n * * `1000`: 41px\n * * `1100`: 46px\n *\n * Cambio Desktop (viewport width > 480px):\n * * `400`: 25px\n * * `500`: 31px\n * * `600`: 39px\n * * `700`: 49px\n * * `800`: 61px\n * * `900`: 76px\n * * `1000`: 95px\n * * `1100`: 119px\n *\n * @defaultValue 500\n */\n size?: 400 | 500 | 600 | 700 | 800 | 900 | 1000 | 1100;\n}): ReactElement => {\n const { themeName } = useTheme();\n const classicWeight = [700, 800].includes(size) ? \"heavy\" : \"bold\";\n\n return (\n <Typography\n align={align}\n as={as}\n color={color}\n fontStyle={fontStyle}\n data-testid={dataTestId}\n lineClamp={lineClamp}\n size={size}\n weight={\n themeName === \"classic\"\n ? classicWeight\n : cambioWeight({ fontStyle, size })\n }\n >\n {children}\n </Typography>\n );\n};\n\nexport default Heading;\n"],"mappings":";;;;;;;;;AAqHI;AAjHJ,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AACF,GAGkC;AAChC,MAAI,cAAc,WAAW,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,GAAG;AACtD,WAAO;AAAA,EACT,WAAW,cAAc,SAAS;AAChC,WAAO;AAAA,EACT,OAAO;AACL,WAAO;AAAA,EACT;AACF;AAKA,IAAM,UAAU,CAAC;AAAA,EACf,QAAQ;AAAA,EACR,KAAK;AAAA,EACL;AAAA,EACA,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,YAAY;AAAA,EACZ;AAAA,EACA,OAAO;AACT,MAgFoB;AAClB,QAAM,EAAE,UAAU,IAAI,SAAS;AAC/B,QAAM,gBAAgB,CAAC,KAAK,GAAG,EAAE,SAAS,IAAI,IAAI,UAAU;AAE5D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA;AAAA,MACA,QACE,cAAc,YACV,gBACA,aAAa,EAAE,WAAW,KAAK,CAAC;AAAA,MAGrC;AAAA;AAAA,EACH;AAEJ;AAEA,IAAO,kBAAQ;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|