@cambly/syntax-core 10.6.0 → 10.6.1

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _J2CQS3FIcjs = require('../__chunks/J2CQS3FI.cjs');
3
+ var _SBMJ42MEcjs = require('../__chunks/SBMJ42ME.cjs');
4
4
  require('../__chunks/5TKLFG5Y.cjs');
5
5
  require('../__chunks/PBOQIXCB.cjs');
6
6
  require('../__chunks/RAVU4WEO.cjs');
@@ -12,8 +12,8 @@ require('../__chunks/LDFTT3OI.cjs');
12
12
  require('../__chunks/IJVFSOXU.cjs');
13
13
  require('../__chunks/36B62A3Z.cjs');
14
14
  require('../__chunks/3HVG5AGO.cjs');
15
- require('../__chunks/PZYWUTMW.cjs');
16
- require('../__chunks/YTZDAVG6.cjs');
15
+ require('../__chunks/M3L2KJQY.cjs');
16
+ require('../__chunks/7RN4IO67.cjs');
17
17
  require('../__chunks/FMSI35YS.cjs');
18
18
  require('../__chunks/ZDMSFZS3.cjs');
19
19
  require('../__chunks/2RCQTGOZ.cjs');
@@ -44,5 +44,5 @@ require('../__chunks/RFHPSEBF.cjs');
44
44
  require('../__chunks/I64JGYX7.cjs');
45
45
 
46
46
 
47
- exports.default = _J2CQS3FIcjs.RichSelectList_default;
47
+ exports.default = _SBMJ42MEcjs.RichSelectList_default;
48
48
  //# sourceMappingURL=RichSelectList.cjs.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RichSelectList_default
3
- } from "../__chunks/CUQH7RLJ.js";
3
+ } from "../__chunks/6MSWOE4Q.js";
4
4
  import "../__chunks/JHAV5OTQ.js";
5
5
  import "../__chunks/LJHH6KUW.js";
6
6
  import "../__chunks/2R4YCOYE.js";
@@ -12,8 +12,8 @@ import "../__chunks/HOGVXDTO.js";
12
12
  import "../__chunks/XFFSBU7E.js";
13
13
  import "../__chunks/5DBWL6IK.js";
14
14
  import "../__chunks/4PWSK5GI.js";
15
- import "../__chunks/JIXNBF5N.js";
16
- import "../__chunks/NJ6FU6DK.js";
15
+ import "../__chunks/OXKLJY2L.js";
16
+ import "../__chunks/DFKMFASG.js";
17
17
  import "../__chunks/JKXOZUCV.js";
18
18
  import "../__chunks/PTWXXDFF.js";
19
19
  import "../__chunks/DNTOWEIQ.js";
@@ -1,8 +1,8 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _CVONHKQWcjs = require('../__chunks/CVONHKQW.cjs');
3
+ var _PNYDSMUMcjs = require('../__chunks/PNYDSMUM.cjs');
4
4
  require('../__chunks/GKECCWR3.cjs');
5
- require('../__chunks/YTZDAVG6.cjs');
5
+ require('../__chunks/7RN4IO67.cjs');
6
6
  require('../__chunks/LTM57QMY.cjs');
7
7
  require('../__chunks/ZX5KONS2.cjs');
8
8
  require('../__chunks/NGUJFGAC.cjs');
@@ -12,5 +12,5 @@ require('../__chunks/GVEA7SLQ.cjs');
12
12
  require('../__chunks/I64JGYX7.cjs');
13
13
 
14
14
 
15
- exports.default = _CVONHKQWcjs.SelectList;
15
+ exports.default = _PNYDSMUMcjs.SelectList;
16
16
  //# sourceMappingURL=SelectList.cjs.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  SelectList
3
- } from "../__chunks/HPZBIU65.js";
3
+ } from "../__chunks/6ZCCQPKZ.js";
4
4
  import "../__chunks/HOUO3WV6.js";
5
- import "../__chunks/NJ6FU6DK.js";
5
+ import "../__chunks/DFKMFASG.js";
6
6
  import "../__chunks/2O6FDRTF.js";
7
7
  import "../__chunks/B2TFERTM.js";
8
8
  import "../__chunks/ERXGNP37.js";
@@ -1,10 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _PZYWUTMWcjs = require('../__chunks/PZYWUTMW.cjs');
3
+ var _M3L2KJQYcjs = require('../__chunks/M3L2KJQY.cjs');
4
4
  require('../__chunks/7GJ2SD7O.cjs');
5
5
  require('../__chunks/FZRIE7EX.cjs');
6
6
  require('../__chunks/I64JGYX7.cjs');
7
7
 
8
8
 
9
- exports.default = _PZYWUTMWcjs.TapArea_default;
9
+ exports.default = _M3L2KJQYcjs.TapArea_default;
10
10
  //# sourceMappingURL=TapArea.cjs.map
@@ -30,6 +30,14 @@ declare const TapArea: React__default.ForwardRefExoticComponent<React__default.A
30
30
  * The callback to be called when the tap area is clicked
31
31
  */
32
32
  onClick: (event: React__default.SyntheticEvent<HTMLDivElement>) => void;
33
+ /**
34
+ * The callback to be called when the tap area is hovered
35
+ */
36
+ onMouseEnter?: ((event: React__default.SyntheticEvent<HTMLDivElement>) => void) | undefined;
37
+ /**
38
+ * The callback to be called when the tap area is no longer hovered
39
+ */
40
+ onMouseLeave?: ((event: React__default.SyntheticEvent<HTMLDivElement>) => void) | undefined;
33
41
  /**
34
42
  * Border radius of the tap area.
35
43
  *
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  TapArea_default
3
- } from "../__chunks/JIXNBF5N.js";
3
+ } from "../__chunks/OXKLJY2L.js";
4
4
  import "../__chunks/TPMQI44L.js";
5
5
  import "../__chunks/YJ7YDIGB.js";
6
6
  import "../__chunks/LULBCTQR.js";
@@ -11,11 +11,11 @@ import {
11
11
  } from "./XFFSBU7E.js";
12
12
  import {
13
13
  TapArea_default
14
- } from "./JIXNBF5N.js";
14
+ } from "./OXKLJY2L.js";
15
15
  import {
16
16
  ColorBaseDestructive700,
17
17
  ColorBaseGray800
18
- } from "./NJ6FU6DK.js";
18
+ } from "./DFKMFASG.js";
19
19
  import {
20
20
  RichSelectSection_default
21
21
  } from "./JKXOZUCV.js";
@@ -267,4 +267,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
267
267
  export {
268
268
  RichSelectList_default
269
269
  };
270
- //# sourceMappingURL=CUQH7RLJ.js.map
270
+ //# sourceMappingURL=6MSWOE4Q.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  ColorBaseDestructive700,
6
6
  ColorBaseGray800
7
- } from "./NJ6FU6DK.js";
7
+ } from "./DFKMFASG.js";
8
8
  import {
9
9
  Focus_module_default
10
10
  } from "./2O6FDRTF.js";
@@ -124,4 +124,4 @@ SelectList.Option = SelectOption_default;
124
124
  export {
125
125
  SelectList
126
126
  };
127
- //# sourceMappingURL=HPZBIU65.js.map
127
+ //# sourceMappingURL=6ZCCQPKZ.js.map
@@ -6,4 +6,4 @@ var ColorBaseGray800 = "#353535";
6
6
 
7
7
 
8
8
  exports.ColorBaseDestructive700 = ColorBaseDestructive700; exports.ColorBaseGray800 = ColorBaseGray800;
9
- //# sourceMappingURL=YTZDAVG6.cjs.map
9
+ //# sourceMappingURL=7RN4IO67.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 Wed, 14 Feb 2024 23:31:48 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 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 Thu, 22 Feb 2024 14:48:40 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 Elevation400 = \"0px 16px 32px 0px #00000040\";\n"]}
@@ -6,4 +6,4 @@ export {
6
6
  ColorBaseDestructive700,
7
7
  ColorBaseGray800
8
8
  };
9
- //# sourceMappingURL=NJ6FU6DK.js.map
9
+ //# sourceMappingURL=DFKMFASG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../syntax-design-tokens/dist/js/index.js"],"sourcesContent":["/**\n * Do not edit directly\n * Generated on Wed, 14 Feb 2024 23:31:48 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 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 Thu, 22 Feb 2024 14:48:40 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 Elevation400 = \"0px 16px 32px 0px #00000040\";\n"],"mappings":";AASO,IAAM,0BAA0B;AAWhC,IAAM,mBAAmB;","names":[]}
@@ -45,6 +45,8 @@ var TapArea = _react.forwardRef.call(void 0,
45
45
  disabled: disabledProp = false,
46
46
  fullWidth = true,
47
47
  onClick,
48
+ onMouseEnter,
49
+ onMouseLeave,
48
50
  rounding = "none",
49
51
  tabIndex = 0
50
52
  } = _b, accessibilityProps = _I64JGYX7cjs.__objRest.call(void 0, _b, [
@@ -54,6 +56,8 @@ var TapArea = _react.forwardRef.call(void 0,
54
56
  "disabled",
55
57
  "fullWidth",
56
58
  "onClick",
59
+ "onMouseEnter",
60
+ "onMouseLeave",
57
61
  "rounding",
58
62
  "tabIndex"
59
63
  ]);
@@ -78,6 +82,18 @@ var TapArea = _react.forwardRef.call(void 0,
78
82
  onClick(event);
79
83
  }
80
84
  };
85
+ const handleOnMouseEnter = (event) => {
86
+ if (disabled)
87
+ return;
88
+ dispatch({ type: "MOUSE_ENTER" });
89
+ onMouseEnter == null ? void 0 : onMouseEnter(event);
90
+ };
91
+ const handleOnMouseLeave = (event) => {
92
+ if (disabled)
93
+ return;
94
+ dispatch({ type: "MOUSE_LEAVE" });
95
+ onMouseLeave == null ? void 0 : onMouseLeave(event);
96
+ };
81
97
  const isHoveredOrFocussed = !disabled && (hovered || focussed);
82
98
  const roundingClasses = rounding !== "none" && _7GJ2SD7Ocjs.rounding_module_default[`rounding${rounding}`];
83
99
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
@@ -95,8 +111,8 @@ var TapArea = _react.forwardRef.call(void 0,
95
111
  "data-testid": dataTestId,
96
112
  onClick: handleClick,
97
113
  onKeyDown: handleKeyDown,
98
- onMouseEnter: () => dispatch({ type: "MOUSE_ENTER" }),
99
- onMouseLeave: () => dispatch({ type: "MOUSE_LEAVE" }),
114
+ onMouseEnter: handleOnMouseEnter,
115
+ onMouseLeave: handleOnMouseLeave,
100
116
  onFocus: () => dispatch({ type: "FOCUS" }),
101
117
  onBlur: () => dispatch({ type: "BLUR" }),
102
118
  ref,
@@ -116,4 +132,4 @@ var TapArea_default = TapArea;
116
132
 
117
133
 
118
134
  exports.TapArea_default = TapArea_default;
119
- //# sourceMappingURL=PZYWUTMW.cjs.map
135
+ //# sourceMappingURL=M3L2KJQY.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/TapArea/TapArea.tsx","css-module:./TapArea.module.css#css-module"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,OAEK;AACP,OAAO,gBAAgB;;;ACNuE,IAAO,yBAAQ,EAAC,WAAU,oBAAmB,aAAY,sBAAqB,YAAW,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,qBAAoB,8BAA6B;;;AD2JlT,SAuBI,KAvBJ;AA1FN,SAAS,QACP,OAIA,QAGA;AACA,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK;AACH,aAAO,iCAAK,QAAL,EAAY,UAAU,MAAM;AAAA,IACrC,KAAK;AACH,aAAO,iCAAK,QAA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B;AAEA,UAAM,sBAAsB,CAAC,aAAa,WAAW;AACrD,UAAM,kBACJ,aAAa,UAAU,wBAAe,WAAW,UAAU;AAE7D,WACE;AAAA,MAAC;AAAA,uCACK,qBADL;AAAA,QAEC,iBAAe,YAAY,mBAAmB,eAAe;AAAA,QAC7D,cAAY,kDAAsB,mBAAmB,YAAY;AAAA,QACjE,WAAW;AAAA,UACT,uBAAO;AAAA,UACP,uBAAO,GAAG,WAAW,aAAa,WAAW;AAAA,UAC7C,aAAa,uBAAO;AAAA,UACpB,uBAAuB,uBAAO;AAAA,UAC9B;AAAA,QACF;AAAA,QACA,eAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS,MAAM,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,QACzC,QAAQ,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,QACvC;AAAA,QACA,MAAK;AAAA,QACL,UAAU,WAAW,SAAY;AAAA,QAEhC;AAAA,WAAC,aAAa,WAAW,aACxB,oBAAC,SAAI,WAAW,WAAW,uBAAO,SAAS,eAAe,GAAG;AAAA,UAE9D;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;AAEtB,IAAO,kBAAQ","sourcesContent":["import React, {\n type ReactNode,\n forwardRef,\n useReducer,\n type AriaAttributes,\n} from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./TapArea.module.css\";\nimport roundingStyles from \"../rounding.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TapAreaProps = AriaAttributes & {\n /**\n * The children to be rendered inside the tap area.\n */\n children?: ReactNode;\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * Test id for the tap area\n */\n \"data-testid\"?: string;\n /**\n * If `true`, the tap area will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the tap area will be full width\n */\n fullWidth?: boolean;\n /**\n * The callback to be called when the tap area is clicked\n */\n onClick: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * The callback to be called when the tap area is hovered\n */\n onMouseEnter?: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * The callback to be called when the tap area is no longer hovered\n */\n onMouseLeave?: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * Border radius of the tap area.\n *\n * * `none`: 0px\n * * `sm`: 8px\n * * `md`: 12px\n * * `lg`: 16px\n * * `xl`: 32px\n * * `full`: 999px\n *\n * @defaultValue \"none\"\n */\n rounding?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"full\" | \"none\";\n /**\n * The tab index of the tap area\n */\n tabIndex?: 0 | -1;\n};\n\nfunction reducer(\n state: {\n hovered: boolean;\n focussed: boolean;\n },\n action: {\n type: \"BLUR\" | \"FOCUS\" | \"MOUSE_ENTER\" | \"MOUSE_LEAVE\";\n },\n) {\n switch (action.type) {\n case \"BLUR\":\n return { ...state, focussed: false };\n case \"FOCUS\":\n return { ...state, focussed: true };\n case \"MOUSE_ENTER\":\n return { ...state, hovered: true };\n case \"MOUSE_LEAVE\":\n return { ...state, hovered: false };\n default:\n return state;\n }\n}\n\n/**\n * [TapArea](https://cambly-syntax.vercel.app/?path=/docs/components-taparea--docs) allows components to be clickable and touchable in an accessible way.\n */\nconst TapArea = forwardRef<HTMLDivElement, TapAreaProps>(\n (\n {\n children,\n accessibilityLabel,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n fullWidth = true,\n onClick,\n onMouseEnter,\n onMouseLeave,\n rounding = \"none\",\n tabIndex = 0,\n ...accessibilityProps\n }: TapAreaProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const [{ hovered, focussed }, dispatch] = useReducer(reducer, {\n hovered: false,\n focussed: false,\n });\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled) {\n undefined;\n } else {\n event.currentTarget.blur();\n onClick(event);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n event.preventDefault();\n onClick(event);\n }\n };\n\n const handleOnMouseEnter: React.MouseEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n dispatch({ type: \"MOUSE_ENTER\" });\n onMouseEnter?.(event);\n };\n\n const handleOnMouseLeave: React.MouseEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n dispatch({ type: \"MOUSE_LEAVE\" });\n onMouseLeave?.(event);\n };\n\n const isHoveredOrFocussed = !disabled && (hovered || focussed);\n const roundingClasses =\n rounding !== \"none\" && roundingStyles[`rounding${rounding}`];\n\n return (\n <div\n {...accessibilityProps}\n aria-disabled={disabled || accessibilityProps[\"aria-disabled\"]}\n aria-label={accessibilityLabel ?? accessibilityProps[\"aria-label\"]}\n className={classNames(\n styles.tapArea,\n styles[`${disabled ? \"disabled\" : \"enabled\"}`],\n fullWidth && styles.fullWidth,\n isHoveredOrFocussed && styles.hoveredOrFocussed,\n roundingClasses,\n )}\n data-testid={dataTestId}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n onFocus={() => dispatch({ type: \"FOCUS\" })}\n onBlur={() => dispatch({ type: \"BLUR\" })}\n ref={ref}\n role=\"button\"\n tabIndex={disabled ? undefined : tabIndex}\n >\n {!disabled && (hovered || focussed) && (\n <div className={classNames(styles.overlay, roundingClasses)} />\n )}\n {children}\n </div>\n );\n },\n);\n\nTapArea.displayName = \"TapArea\";\n\nexport default TapArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TapArea/TapArea.module.css\"; export default {\"tapArea\":\"_tapArea_g6gkz_1\",\"fullWidth\":\"_fullWidth_g6gkz_5\",\"disabled\":\"_disabled_g6gkz_9\",\"enabled\":\"_enabled_g6gkz_16\",\"overlay\":\"_overlay_g6gkz_29\",\"hoveredOrFocussed\":\"_hoveredOrFocussed_g6gkz_39\"}"]}
@@ -45,6 +45,8 @@ var TapArea = forwardRef(
45
45
  disabled: disabledProp = false,
46
46
  fullWidth = true,
47
47
  onClick,
48
+ onMouseEnter,
49
+ onMouseLeave,
48
50
  rounding = "none",
49
51
  tabIndex = 0
50
52
  } = _b, accessibilityProps = __objRest(_b, [
@@ -54,6 +56,8 @@ var TapArea = forwardRef(
54
56
  "disabled",
55
57
  "fullWidth",
56
58
  "onClick",
59
+ "onMouseEnter",
60
+ "onMouseLeave",
57
61
  "rounding",
58
62
  "tabIndex"
59
63
  ]);
@@ -78,6 +82,18 @@ var TapArea = forwardRef(
78
82
  onClick(event);
79
83
  }
80
84
  };
85
+ const handleOnMouseEnter = (event) => {
86
+ if (disabled)
87
+ return;
88
+ dispatch({ type: "MOUSE_ENTER" });
89
+ onMouseEnter == null ? void 0 : onMouseEnter(event);
90
+ };
91
+ const handleOnMouseLeave = (event) => {
92
+ if (disabled)
93
+ return;
94
+ dispatch({ type: "MOUSE_LEAVE" });
95
+ onMouseLeave == null ? void 0 : onMouseLeave(event);
96
+ };
81
97
  const isHoveredOrFocussed = !disabled && (hovered || focussed);
82
98
  const roundingClasses = rounding !== "none" && rounding_module_default[`rounding${rounding}`];
83
99
  return /* @__PURE__ */ jsxs(
@@ -95,8 +111,8 @@ var TapArea = forwardRef(
95
111
  "data-testid": dataTestId,
96
112
  onClick: handleClick,
97
113
  onKeyDown: handleKeyDown,
98
- onMouseEnter: () => dispatch({ type: "MOUSE_ENTER" }),
99
- onMouseLeave: () => dispatch({ type: "MOUSE_LEAVE" }),
114
+ onMouseEnter: handleOnMouseEnter,
115
+ onMouseLeave: handleOnMouseLeave,
100
116
  onFocus: () => dispatch({ type: "FOCUS" }),
101
117
  onBlur: () => dispatch({ type: "BLUR" }),
102
118
  ref,
@@ -116,4 +132,4 @@ var TapArea_default = TapArea;
116
132
  export {
117
133
  TapArea_default
118
134
  };
119
- //# sourceMappingURL=JIXNBF5N.js.map
135
+ //# sourceMappingURL=OXKLJY2L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/TapArea/TapArea.tsx","css-module:./TapArea.module.css#css-module"],"sourcesContent":["import React, {\n type ReactNode,\n forwardRef,\n useReducer,\n type AriaAttributes,\n} from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./TapArea.module.css\";\nimport roundingStyles from \"../rounding.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TapAreaProps = AriaAttributes & {\n /**\n * The children to be rendered inside the tap area.\n */\n children?: ReactNode;\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * Test id for the tap area\n */\n \"data-testid\"?: string;\n /**\n * If `true`, the tap area will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the tap area will be full width\n */\n fullWidth?: boolean;\n /**\n * The callback to be called when the tap area is clicked\n */\n onClick: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * The callback to be called when the tap area is hovered\n */\n onMouseEnter?: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * The callback to be called when the tap area is no longer hovered\n */\n onMouseLeave?: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * Border radius of the tap area.\n *\n * * `none`: 0px\n * * `sm`: 8px\n * * `md`: 12px\n * * `lg`: 16px\n * * `xl`: 32px\n * * `full`: 999px\n *\n * @defaultValue \"none\"\n */\n rounding?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"full\" | \"none\";\n /**\n * The tab index of the tap area\n */\n tabIndex?: 0 | -1;\n};\n\nfunction reducer(\n state: {\n hovered: boolean;\n focussed: boolean;\n },\n action: {\n type: \"BLUR\" | \"FOCUS\" | \"MOUSE_ENTER\" | \"MOUSE_LEAVE\";\n },\n) {\n switch (action.type) {\n case \"BLUR\":\n return { ...state, focussed: false };\n case \"FOCUS\":\n return { ...state, focussed: true };\n case \"MOUSE_ENTER\":\n return { ...state, hovered: true };\n case \"MOUSE_LEAVE\":\n return { ...state, hovered: false };\n default:\n return state;\n }\n}\n\n/**\n * [TapArea](https://cambly-syntax.vercel.app/?path=/docs/components-taparea--docs) allows components to be clickable and touchable in an accessible way.\n */\nconst TapArea = forwardRef<HTMLDivElement, TapAreaProps>(\n (\n {\n children,\n accessibilityLabel,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n fullWidth = true,\n onClick,\n onMouseEnter,\n onMouseLeave,\n rounding = \"none\",\n tabIndex = 0,\n ...accessibilityProps\n }: TapAreaProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const [{ hovered, focussed }, dispatch] = useReducer(reducer, {\n hovered: false,\n focussed: false,\n });\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled) {\n undefined;\n } else {\n event.currentTarget.blur();\n onClick(event);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n event.preventDefault();\n onClick(event);\n }\n };\n\n const handleOnMouseEnter: React.MouseEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n dispatch({ type: \"MOUSE_ENTER\" });\n onMouseEnter?.(event);\n };\n\n const handleOnMouseLeave: React.MouseEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n dispatch({ type: \"MOUSE_LEAVE\" });\n onMouseLeave?.(event);\n };\n\n const isHoveredOrFocussed = !disabled && (hovered || focussed);\n const roundingClasses =\n rounding !== \"none\" && roundingStyles[`rounding${rounding}`];\n\n return (\n <div\n {...accessibilityProps}\n aria-disabled={disabled || accessibilityProps[\"aria-disabled\"]}\n aria-label={accessibilityLabel ?? accessibilityProps[\"aria-label\"]}\n className={classNames(\n styles.tapArea,\n styles[`${disabled ? \"disabled\" : \"enabled\"}`],\n fullWidth && styles.fullWidth,\n isHoveredOrFocussed && styles.hoveredOrFocussed,\n roundingClasses,\n )}\n data-testid={dataTestId}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleOnMouseEnter}\n onMouseLeave={handleOnMouseLeave}\n onFocus={() => dispatch({ type: \"FOCUS\" })}\n onBlur={() => dispatch({ type: \"BLUR\" })}\n ref={ref}\n role=\"button\"\n tabIndex={disabled ? undefined : tabIndex}\n >\n {!disabled && (hovered || focussed) && (\n <div className={classNames(styles.overlay, roundingClasses)} />\n )}\n {children}\n </div>\n );\n },\n);\n\nTapArea.displayName = \"TapArea\";\n\nexport default TapArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TapArea/TapArea.module.css\"; export default {\"tapArea\":\"_tapArea_g6gkz_1\",\"fullWidth\":\"_fullWidth_g6gkz_5\",\"disabled\":\"_disabled_g6gkz_9\",\"enabled\":\"_enabled_g6gkz_16\",\"overlay\":\"_overlay_g6gkz_29\",\"hoveredOrFocussed\":\"_hoveredOrFocussed_g6gkz_39\"}"],"mappings":";;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,OAEK;AACP,OAAO,gBAAgB;;;ACNuE,IAAO,yBAAQ,EAAC,WAAU,oBAAmB,aAAY,sBAAqB,YAAW,qBAAoB,WAAU,qBAAoB,WAAU,qBAAoB,qBAAoB,8BAA6B;;;AD2JlT,SAuBI,KAvBJ;AA1FN,SAAS,QACP,OAIA,QAGA;AACA,UAAQ,OAAO,MAAM;AAAA,IACnB,KAAK;AACH,aAAO,iCAAK,QAAL,EAAY,UAAU,MAAM;AAAA,IACrC,KAAK;AACH,aAAO,iCAAK,QAAL,EAAY,UAAU,KAAK;AAAA,IACpC,KAAK;AACH,aAAO,iCAAK,QAAL,EAAY,SAAS,KAAK;AAAA,IACnC,KAAK;AACH,aAAO,iCAAK,QAAL,EAAY,SAAS,MAAM;AAAA,IACpC;AACE,aAAO;AAAA,EACX;AACF;AAKA,IA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AAY,kDAAsB,mBAAmB,YAAY;AAAA,QACjE,WAAW;AAAA,UACT,uBAAO;AAAA,UACP,uBAAO,GAAG,WAAW,aAAa,WAAW;AAAA,UAC7C,aAAa,uBAAO;AAAA,UACpB,uBAAuB,uBAAO;AAAA,UAC9B;AAAA,QACF;AAAA,QACA,eAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,cAAc;AAAA,QACd,cAAc;AAAA,QACd,SAAS,MAAM,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,QACzC,QAAQ,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,QACvC;AAAA,QACA,MAAK;AAAA,QACL,UAAU,WAAW,SAAY;AAAA,QAEhC;AAAA,WAAC,aAAa,WAAW,aACxB,oBAAC,SAAI,WAAW,WAAW,uBAAO,SAAS,eAAe,GAAG;AAAA,UAE9D;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;AAEtB,IAAO,kBAAQ;","names":[]}
@@ -4,7 +4,7 @@ var _GKECCWR3cjs = require('./GKECCWR3.cjs');
4
4
 
5
5
 
6
6
 
7
- var _YTZDAVG6cjs = require('./YTZDAVG6.cjs');
7
+ var _7RN4IO67cjs = require('./7RN4IO67.cjs');
8
8
 
9
9
 
10
10
  var _LTM57QMYcjs = require('./LTM57QMY.cjs');
@@ -100,7 +100,7 @@ function SelectList({
100
100
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
101
101
  "path",
102
102
  {
103
- fill: errorText ? _YTZDAVG6cjs.ColorBaseDestructive700 : _YTZDAVG6cjs.ColorBaseGray800,
103
+ fill: errorText ? _7RN4IO67cjs.ColorBaseDestructive700 : _7RN4IO67cjs.ColorBaseGray800,
104
104
  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"
105
105
  }
106
106
  )
@@ -124,4 +124,4 @@ SelectList.Option = _GKECCWR3cjs.SelectOption_default;
124
124
 
125
125
 
126
126
  exports.SelectList = SelectList;
127
- //# sourceMappingURL=CVONHKQW.cjs.map
127
+ //# sourceMappingURL=PNYDSMUM.cjs.map
@@ -11,11 +11,11 @@ var _QNBZ64IEcjs = require('./QNBZ64IE.cjs');
11
11
  var _IJVFSOXUcjs = require('./IJVFSOXU.cjs');
12
12
 
13
13
 
14
- var _PZYWUTMWcjs = require('./PZYWUTMW.cjs');
14
+ var _M3L2KJQYcjs = require('./M3L2KJQY.cjs');
15
15
 
16
16
 
17
17
 
18
- var _YTZDAVG6cjs = require('./YTZDAVG6.cjs');
18
+ var _7RN4IO67cjs = require('./7RN4IO67.cjs');
19
19
 
20
20
 
21
21
  var _FMSI35YScjs = require('./FMSI35YS.cjs');
@@ -202,7 +202,7 @@ function RichSelectList(props) {
202
202
  )
203
203
  ),
204
204
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
205
- _PZYWUTMWcjs.TapArea_default,
205
+ _M3L2KJQYcjs.TapArea_default,
206
206
  _I64JGYX7cjs.__spreadProps.call(void 0, _I64JGYX7cjs.__spreadValues.call(void 0, {
207
207
  "data-testid": dataTestId,
208
208
  disabled,
@@ -232,7 +232,7 @@ function RichSelectList(props) {
232
232
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
233
233
  "path",
234
234
  {
235
- fill: errorText ? _YTZDAVG6cjs.ColorBaseDestructive700 : _YTZDAVG6cjs.ColorBaseGray800,
235
+ fill: errorText ? _7RN4IO67cjs.ColorBaseDestructive700 : _7RN4IO67cjs.ColorBaseGray800,
236
236
  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"
237
237
  }
238
238
  )
@@ -267,4 +267,4 @@ var RichSelectList_default = Object.assign(RichSelectList, {
267
267
 
268
268
 
269
269
  exports.RichSelectList_default = RichSelectList_default;
270
- //# sourceMappingURL=J2CQS3FI.cjs.map
270
+ //# sourceMappingURL=SBMJ42ME.cjs.map
package/dist/index.cjs CHANGED
@@ -27,11 +27,11 @@ require('./__chunks/SJFWRAOP.cjs');
27
27
  var _JLUYEG2Lcjs = require('./__chunks/JLUYEG2L.cjs');
28
28
 
29
29
 
30
- var _CVONHKQWcjs = require('./__chunks/CVONHKQW.cjs');
30
+ var _PNYDSMUMcjs = require('./__chunks/PNYDSMUM.cjs');
31
31
  require('./__chunks/GKECCWR3.cjs');
32
32
 
33
33
 
34
- var _J2CQS3FIcjs = require('./__chunks/J2CQS3FI.cjs');
34
+ var _SBMJ42MEcjs = require('./__chunks/SBMJ42ME.cjs');
35
35
  require('./__chunks/5TKLFG5Y.cjs');
36
36
 
37
37
 
@@ -55,8 +55,8 @@ require('./__chunks/36B62A3Z.cjs');
55
55
  require('./__chunks/3HVG5AGO.cjs');
56
56
 
57
57
 
58
- var _PZYWUTMWcjs = require('./__chunks/PZYWUTMW.cjs');
59
- require('./__chunks/YTZDAVG6.cjs');
58
+ var _M3L2KJQYcjs = require('./__chunks/M3L2KJQY.cjs');
59
+ require('./__chunks/7RN4IO67.cjs');
60
60
  require('./__chunks/FMSI35YS.cjs');
61
61
  require('./__chunks/ZDMSFZS3.cjs');
62
62
  require('./__chunks/2RCQTGOZ.cjs');
@@ -127,5 +127,5 @@ require('./__chunks/I64JGYX7.cjs');
127
127
 
128
128
 
129
129
 
130
- exports.Avatar = _EWCLQBKVcjs.Avatar_default; exports.AvatarGroup = _W7CSNF2Mcjs.AvatarGroup; exports.Badge = _JYDZTZIKcjs.Badge_default; exports.Box = _5SMR5MWYcjs.Box_default; exports.Button = _RAVU4WEOcjs.Button_default; exports.ButtonGroup = _PBOQIXCBcjs.ButtonGroup_default; exports.Card = _K77KFPIVcjs.Card; exports.Checkbox = _GOSWBV5Dcjs.Checkbox_default; exports.Chip = _QQWCNTE4cjs.Chip_default; exports.Divider = _3TXXNWWAcjs.Divider; exports.Heading = _FZ5HWA3Scjs.Heading_default; exports.IconButton = _LDFTT3OIcjs.IconButton_default; exports.LinkButton = _JLUYEG2Lcjs.LinkButton_default; exports.Modal = _HR5QOB3Ucjs.Modal; exports.Popover = _QNBZ64IEcjs.Popover_default; exports.RadioButton = _LMCK5YO5cjs.RadioButton_default; exports.RichSelectList = _J2CQS3FIcjs.RichSelectList_default; exports.SelectList = _CVONHKQWcjs.SelectList; exports.TapArea = _PZYWUTMWcjs.TapArea_default; exports.TextArea = _FMSBGH2Icjs.TextArea_default; exports.TextField = _KCYZNZBOcjs.TextField; exports.Tooltip = _ZG64UIHGcjs.Tooltip_default; exports.Typography = _ZX5KONS2cjs.Typography_default;
130
+ exports.Avatar = _EWCLQBKVcjs.Avatar_default; exports.AvatarGroup = _W7CSNF2Mcjs.AvatarGroup; exports.Badge = _JYDZTZIKcjs.Badge_default; exports.Box = _5SMR5MWYcjs.Box_default; exports.Button = _RAVU4WEOcjs.Button_default; exports.ButtonGroup = _PBOQIXCBcjs.ButtonGroup_default; exports.Card = _K77KFPIVcjs.Card; exports.Checkbox = _GOSWBV5Dcjs.Checkbox_default; exports.Chip = _QQWCNTE4cjs.Chip_default; exports.Divider = _3TXXNWWAcjs.Divider; exports.Heading = _FZ5HWA3Scjs.Heading_default; exports.IconButton = _LDFTT3OIcjs.IconButton_default; exports.LinkButton = _JLUYEG2Lcjs.LinkButton_default; exports.Modal = _HR5QOB3Ucjs.Modal; exports.Popover = _QNBZ64IEcjs.Popover_default; exports.RadioButton = _LMCK5YO5cjs.RadioButton_default; exports.RichSelectList = _SBMJ42MEcjs.RichSelectList_default; exports.SelectList = _PNYDSMUMcjs.SelectList; exports.TapArea = _M3L2KJQYcjs.TapArea_default; exports.TextArea = _FMSBGH2Icjs.TextArea_default; exports.TextField = _KCYZNZBOcjs.TextField; exports.Tooltip = _ZG64UIHGcjs.Tooltip_default; exports.Typography = _ZX5KONS2cjs.Typography_default;
131
131
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -27,11 +27,11 @@ import {
27
27
  } from "./__chunks/EIYMXZ2V.js";
28
28
  import {
29
29
  SelectList
30
- } from "./__chunks/HPZBIU65.js";
30
+ } from "./__chunks/6ZCCQPKZ.js";
31
31
  import "./__chunks/HOUO3WV6.js";
32
32
  import {
33
33
  RichSelectList_default
34
- } from "./__chunks/CUQH7RLJ.js";
34
+ } from "./__chunks/6MSWOE4Q.js";
35
35
  import "./__chunks/JHAV5OTQ.js";
36
36
  import {
37
37
  ButtonGroup_default
@@ -55,8 +55,8 @@ import "./__chunks/5DBWL6IK.js";
55
55
  import "./__chunks/4PWSK5GI.js";
56
56
  import {
57
57
  TapArea_default
58
- } from "./__chunks/JIXNBF5N.js";
59
- import "./__chunks/NJ6FU6DK.js";
58
+ } from "./__chunks/OXKLJY2L.js";
59
+ import "./__chunks/DFKMFASG.js";
60
60
  import "./__chunks/JKXOZUCV.js";
61
61
  import "./__chunks/PTWXXDFF.js";
62
62
  import "./__chunks/DNTOWEIQ.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.6.0",
4
+ "version": "10.6.1",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
7
7
  "module": "./dist/index.js",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/TapArea/TapArea.tsx","css-module:./TapArea.module.css#css-module"],"sourcesContent":["import React, {\n type ReactNode,\n forwardRef,\n useReducer,\n type AriaAttributes,\n} from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./TapArea.module.css\";\nimport roundingStyles from \"../rounding.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TapAreaProps = AriaAttributes & {\n /**\n * The children to be rendered inside the tap area.\n */\n children?: ReactNode;\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * Test id for the tap area\n */\n \"data-testid\"?: string;\n /**\n * If `true`, the tap area will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the tap area will be full width\n */\n fullWidth?: boolean;\n /**\n * The callback to be called when the tap area is clicked\n */\n onClick: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * Border radius of the tap area.\n *\n * * `none`: 0px\n * * `sm`: 8px\n * * `md`: 12px\n * * `lg`: 16px\n * * `xl`: 32px\n * * `full`: 999px\n *\n * @defaultValue \"none\"\n */\n rounding?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"full\" | \"none\";\n /**\n * The tab index of the tap area\n */\n tabIndex?: 0 | -1;\n};\n\nfunction reducer(\n state: {\n hovered: boolean;\n focussed: boolean;\n },\n action: {\n type: \"BLUR\" | \"FOCUS\" | \"MOUSE_ENTER\" | \"MOUSE_LEAVE\";\n },\n) {\n switch (action.type) {\n case \"BLUR\":\n return { ...state, focussed: false };\n case \"FOCUS\":\n return { ...state, focussed: true };\n case \"MOUSE_ENTER\":\n return { ...state, hovered: true };\n case \"MOUSE_LEAVE\":\n return { ...state, hovered: false };\n default:\n return state;\n }\n}\n\n/**\n * [TapArea](https://cambly-syntax.vercel.app/?path=/docs/components-taparea--docs) allows components to be clickable and touchable in an accessible way.\n */\nconst TapArea = forwardRef<HTMLDivElement, TapAreaProps>(\n (\n {\n children,\n accessibilityLabel,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n fullWidth = true,\n onClick,\n rounding = \"none\",\n tabIndex = 0,\n ...accessibilityProps\n }: TapAreaProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const [{ hovered, focussed }, dispatch] = useReducer(reducer, {\n hovered: false,\n focussed: false,\n });\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled) {\n undefined;\n } else {\n event.currentTarget.blur();\n onClick(event);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n event.preventDefault();\n onClick(event);\n }\n };\n\n const isHoveredOrFocussed = !disabled && (hovered || focussed);\n const roundingClasses =\n rounding !== \"none\" && roundingStyles[`rounding${rounding}`];\n\n return (\n <div\n {...accessibilityProps}\n aria-disabled={disabled || accessibilityProps[\"aria-disabled\"]}\n aria-label={accessibilityLabel ?? accessibilityProps[\"aria-label\"]}\n className={classNames(\n styles.tapArea,\n styles[`${disabled ? \"disabled\" : \"enabled\"}`],\n fullWidth && styles.fullWidth,\n isHoveredOrFocussed && styles.hoveredOrFocussed,\n roundingClasses,\n )}\n data-testid={dataTestId}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => dispatch({ type: \"MOUSE_ENTER\" })}\n onMouseLeave={() => dispatch({ type: \"MOUSE_LEAVE\" })}\n onFocus={() => dispatch({ type: \"FOCUS\" })}\n onBlur={() => dispatch({ type: \"BLUR\" })}\n ref={ref}\n role=\"button\"\n tabIndex={disabled ? undefined : tabIndex}\n >\n {!disabled && (hovered || focussed) && (\n <div className={classNames(styles.overlay, roundingClasses)} />\n )}\n {children}\n </div>\n );\n },\n);\n\nTapArea.displayName = \"TapArea\";\n\nexport default TapArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TapArea/TapArea.module.css\"; export default {\"tapArea\":\"_tapArea_g6gkz_1\",\"fullWidth\":\"_fullWidth_g6gkz_5\",\"disabled\":\"_disabled_g6gkz_9\",\"enabled\":\"_enabled_g6gkz_16\",\"overlay\":\"_overlay_g6gkz_29\",\"hoveredOrFocussed\":\"_hoveredOrFocussed_g6gkz_39\"}"],"mappings":";;;;;;;;;;;;;AAAA;AAAA,EAEE;AAAA,EACA;AAAA,OAEK;AACP,OAAO,gBAAgB;;;ACNuE,IAAO,yBAAQ,EAAC,WAAU,oBAAm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C,iBAAe,YAAY,mBAAmB,eAAe;AAAA,QAC7D,cAAY,kDAAsB,mBAAmB,YAAY;AAAA,QACjE,WAAW;AAAA,UACT,uBAAO;AAAA,UACP,uBAAO,GAAG,WAAW,aAAa,WAAW;AAAA,UAC7C,aAAa,uBAAO;AAAA,UACpB,uBAAuB,uBAAO;AAAA,UAC9B;AAAA,QACF;AAAA,QACA,eAAa;AAAA,QACb,SAAS;AAAA,QACT,WAAW;AAAA,QACX,cAAc,MAAM,SAAS,EAAE,MAAM,cAAc,CAAC;AAAA,QACpD,cAAc,MAAM,SAAS,EAAE,MAAM,cAAc,CAAC;AAAA,QACpD,SAAS,MAAM,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,QACzC,QAAQ,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,QACvC;AAAA,QACA,MAAK;AAAA,QACL,UAAU,WAAW,SAAY;AAAA,QAEhC;AAAA,WAAC,aAAa,WAAW,aACxB,oBAAC,SAAI,WAAW,WAAW,uBAAO,SAAS,eAAe,GAAG;AAAA,UAE9D;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AAEA,QAAQ,cAAc;AAEtB,IAAO,kBAAQ","sourcesContent":["import React, {\n type ReactNode,\n forwardRef,\n useReducer,\n type AriaAttributes,\n} from \"react\";\nimport classNames from \"classnames\";\nimport styles from \"./TapArea.module.css\";\nimport roundingStyles from \"../rounding.module.css\";\nimport useIsHydrated from \"../useIsHydrated\";\n\ntype TapAreaProps = AriaAttributes & {\n /**\n * The children to be rendered inside the tap area.\n */\n children?: ReactNode;\n /**\n * The label to be used for accessibility\n */\n accessibilityLabel?: string;\n /**\n * Test id for the tap area\n */\n \"data-testid\"?: string;\n /**\n * If `true`, the tap area will be disabled\n *\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * If `true`, the tap area will be full width\n */\n fullWidth?: boolean;\n /**\n * The callback to be called when the tap area is clicked\n */\n onClick: (event: React.SyntheticEvent<HTMLDivElement>) => void;\n /**\n * Border radius of the tap area.\n *\n * * `none`: 0px\n * * `sm`: 8px\n * * `md`: 12px\n * * `lg`: 16px\n * * `xl`: 32px\n * * `full`: 999px\n *\n * @defaultValue \"none\"\n */\n rounding?: \"xl\" | \"lg\" | \"md\" | \"sm\" | \"full\" | \"none\";\n /**\n * The tab index of the tap area\n */\n tabIndex?: 0 | -1;\n};\n\nfunction reducer(\n state: {\n hovered: boolean;\n focussed: boolean;\n },\n action: {\n type: \"BLUR\" | \"FOCUS\" | \"MOUSE_ENTER\" | \"MOUSE_LEAVE\";\n },\n) {\n switch (action.type) {\n case \"BLUR\":\n return { ...state, focussed: false };\n case \"FOCUS\":\n return { ...state, focussed: true };\n case \"MOUSE_ENTER\":\n return { ...state, hovered: true };\n case \"MOUSE_LEAVE\":\n return { ...state, hovered: false };\n default:\n return state;\n }\n}\n\n/**\n * [TapArea](https://cambly-syntax.vercel.app/?path=/docs/components-taparea--docs) allows components to be clickable and touchable in an accessible way.\n */\nconst TapArea = forwardRef<HTMLDivElement, TapAreaProps>(\n (\n {\n children,\n accessibilityLabel,\n \"data-testid\": dataTestId,\n disabled: disabledProp = false,\n fullWidth = true,\n onClick,\n rounding = \"none\",\n tabIndex = 0,\n ...accessibilityProps\n }: TapAreaProps,\n ref,\n ) => {\n const isHydrated = useIsHydrated();\n const disabled = !isHydrated || disabledProp;\n const [{ hovered, focussed }, dispatch] = useReducer(reducer, {\n hovered: false,\n focussed: false,\n });\n\n const handleClick: React.MouseEventHandler<HTMLDivElement> = (event) => {\n if (disabled) {\n undefined;\n } else {\n event.currentTarget.blur();\n onClick(event);\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (\n event,\n ) => {\n if (disabled) return;\n if (event.key === \"Enter\" || event.key === \" \" || event.key === \"Space\") {\n event.preventDefault();\n onClick(event);\n }\n };\n\n const isHoveredOrFocussed = !disabled && (hovered || focussed);\n const roundingClasses =\n rounding !== \"none\" && roundingStyles[`rounding${rounding}`];\n\n return (\n <div\n {...accessibilityProps}\n aria-disabled={disabled || accessibilityProps[\"aria-disabled\"]}\n aria-label={accessibilityLabel ?? accessibilityProps[\"aria-label\"]}\n className={classNames(\n styles.tapArea,\n styles[`${disabled ? \"disabled\" : \"enabled\"}`],\n fullWidth && styles.fullWidth,\n isHoveredOrFocussed && styles.hoveredOrFocussed,\n roundingClasses,\n )}\n data-testid={dataTestId}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => dispatch({ type: \"MOUSE_ENTER\" })}\n onMouseLeave={() => dispatch({ type: \"MOUSE_LEAVE\" })}\n onFocus={() => dispatch({ type: \"FOCUS\" })}\n onBlur={() => dispatch({ type: \"BLUR\" })}\n ref={ref}\n role=\"button\"\n tabIndex={disabled ? undefined : tabIndex}\n >\n {!disabled && (hovered || focussed) && (\n <div className={classNames(styles.overlay, roundingClasses)} />\n )}\n {children}\n </div>\n );\n },\n);\n\nTapArea.displayName = \"TapArea\";\n\nexport default TapArea;\n","import \"/home/runner/work/syntax/syntax/packages/syntax-core/src/TapArea/TapArea.module.css\"; export default {\"tapArea\":\"_tapArea_g6gkz_1\",\"fullWidth\":\"_fullWidth_g6gkz_5\",\"disabled\":\"_disabled_g6gkz_9\",\"enabled\":\"_enabled_g6gkz_16\",\"overlay\":\"_overlay_g6gkz_29\",\"hoveredOrFocussed\":\"_hoveredOrFocussed_g6gkz_39\"}"]}