@cambly/syntax-core 7.3.0 → 7.5.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/index.css +24 -21
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +6 -5
- package/dist/index.js +73 -62
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -49
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -123,7 +123,7 @@ __export(src_exports, {
|
|
|
123
123
|
Divider: () => Divider,
|
|
124
124
|
Heading: () => Heading_default,
|
|
125
125
|
IconButton: () => IconButton_default,
|
|
126
|
-
LinkButton: () =>
|
|
126
|
+
LinkButton: () => LinkButton_default,
|
|
127
127
|
MiniActionCard: () => MiniActionCard_default,
|
|
128
128
|
Modal: () => Modal,
|
|
129
129
|
RadioButton: () => RadioButton_default,
|
|
@@ -161,7 +161,7 @@ var Avatar_default = Avatar;
|
|
|
161
161
|
var import_classnames2 = __toESM(require_classnames());
|
|
162
162
|
|
|
163
163
|
// css-module:./Typography.module.css#css-module
|
|
164
|
-
var Typography_module_default = { "typography": "
|
|
164
|
+
var Typography_module_default = { "typography": "_typography_1vnry_1", "size100": "_size100_1vnry_8", "size200": "_size200_1vnry_12", "size300": "_size300_1vnry_16", "size500": "_size500_1vnry_20", "size600": "_size600_1vnry_24", "size700": "_size700_1vnry_28", "size800": "_size800_1vnry_32", "center": "_center_1vnry_37", "forceLeft": "_forceLeft_1vnry_41", "forceRight": "_forceRight_1vnry_45", "start": "_start_1vnry_49", "end": "_end_1vnry_53", "bold": "_bold_1vnry_58", "regular": "_regular_1vnry_62", "interactive": "_interactive_1vnry_66", "semiBold": "_semiBold_1vnry_70", "heavy": "_heavy_1vnry_74", "underline": "_underline_1vnry_78", "inline": "_inline_1vnry_82", "uppercase": "_uppercase_1vnry_86", "lineClamp": "_lineClamp_1vnry_90" };
|
|
165
165
|
|
|
166
166
|
// css-module:../colors/colors.module.css#css-module
|
|
167
167
|
var colors_module_default = { "inheritColor": "_inheritColor_11wj3_2", "destructive700Color": "_destructive700Color_11wj3_6", "gray700Color": "_gray700Color_11wj3_10", "gray900Color": "_gray900Color_11wj3_14", "primary700Color": "_primary700Color_11wj3_18", "whiteColor": "_whiteColor_11wj3_22", "blackBackgroundColor": "_blackBackgroundColor_11wj3_27", "destructive100BackgroundColor": "_destructive100BackgroundColor_11wj3_31", "destructive200BackgroundColor": "_destructive200BackgroundColor_11wj3_35", "destructive300BackgroundColor": "_destructive300BackgroundColor_11wj3_39", "destructive700BackgroundColor": "_destructive700BackgroundColor_11wj3_43", "destructive800BackgroundColor": "_destructive800BackgroundColor_11wj3_47", "destructive900BackgroundColor": "_destructive900BackgroundColor_11wj3_51", "gray10BackgroundColor": "_gray10BackgroundColor_11wj3_55", "gray30BackgroundColor": "_gray30BackgroundColor_11wj3_59", "gray60BackgroundColor": "_gray60BackgroundColor_11wj3_63", "gray80BackgroundColor": "_gray80BackgroundColor_11wj3_67", "gray100BackgroundColor": "_gray100BackgroundColor_11wj3_71", "gray200BackgroundColor": "_gray200BackgroundColor_11wj3_75", "gray300BackgroundColor": "_gray300BackgroundColor_11wj3_79", "gray700BackgroundColor": "_gray700BackgroundColor_11wj3_83", "gray800BackgroundColor": "_gray800BackgroundColor_11wj3_87", "gray900BackgroundColor": "_gray900BackgroundColor_11wj3_91", "orange100BackgroundColor": "_orange100BackgroundColor_11wj3_95", "orange200BackgroundColor": "_orange200BackgroundColor_11wj3_99", "orange300BackgroundColor": "_orange300BackgroundColor_11wj3_103", "orange700BackgroundColor": "_orange700BackgroundColor_11wj3_107", "orange800BackgroundColor": "_orange800BackgroundColor_11wj3_111", "orange900BackgroundColor": "_orange900BackgroundColor_11wj3_115", "primary100BackgroundColor": "_primary100BackgroundColor_11wj3_119", "primary200BackgroundColor": "_primary200BackgroundColor_11wj3_123", "primary300BackgroundColor": "_primary300BackgroundColor_11wj3_127", "primary700BackgroundColor": "_primary700BackgroundColor_11wj3_131", "primary800BackgroundColor": "_primary800BackgroundColor_11wj3_135", "primary900BackgroundColor": "_primary900BackgroundColor_11wj3_139", "success100BackgroundColor": "_success100BackgroundColor_11wj3_143", "success200BackgroundColor": "_success200BackgroundColor_11wj3_147", "success300BackgroundColor": "_success300BackgroundColor_11wj3_151", "success700BackgroundColor": "_success700BackgroundColor_11wj3_155", "success800BackgroundColor": "_success800BackgroundColor_11wj3_159", "success900BackgroundColor": "_success900BackgroundColor_11wj3_163", "purple100BackgroundColor": "_purple100BackgroundColor_11wj3_167", "purple200BackgroundColor": "_purple200BackgroundColor_11wj3_171", "purple300BackgroundColor": "_purple300BackgroundColor_11wj3_175", "purple700BackgroundColor": "_purple700BackgroundColor_11wj3_179", "purple800BackgroundColor": "_purple800BackgroundColor_11wj3_183", "purple900BackgroundColor": "_purple900BackgroundColor_11wj3_187", "whiteBackgroundColor": "_whiteBackgroundColor_11wj3_191", "yellow100BackgroundColor": "_yellow100BackgroundColor_11wj3_195", "yellow200BackgroundColor": "_yellow200BackgroundColor_11wj3_199", "yellow300BackgroundColor": "_yellow300BackgroundColor_11wj3_203", "yellow700BackgroundColor": "_yellow700BackgroundColor_11wj3_207", "yellow800BackgroundColor": "_yellow800BackgroundColor_11wj3_211", "yellow900BackgroundColor": "_yellow900BackgroundColor_11wj3_215" };
|
|
@@ -964,6 +964,7 @@ IconButton.displayName = "IconButton";
|
|
|
964
964
|
var IconButton_default = IconButton;
|
|
965
965
|
|
|
966
966
|
// src/LinkButton/LinkButton.tsx
|
|
967
|
+
var import_react6 = require("react");
|
|
967
968
|
var import_classnames8 = __toESM(require_classnames());
|
|
968
969
|
|
|
969
970
|
// css-module:../Button/Button.module.css#css-module
|
|
@@ -974,56 +975,66 @@ var LinkButton_module_default = { "linkButton": "_linkButton_1b3ot_1", "fitConte
|
|
|
974
975
|
|
|
975
976
|
// src/LinkButton/LinkButton.tsx
|
|
976
977
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
[
|
|
1005
|
-
[LinkButton_module_default.fitContent]: !fullWidth,
|
|
1006
|
-
[Button_module_default3.buttonGap]: size === "lg" || size === "md",
|
|
1007
|
-
[Button_module_default3.secondaryBorder]: color === "secondary",
|
|
1008
|
-
[Button_module_default3.secondaryDestructiveBorder]: color === "destructive-secondary"
|
|
1009
|
-
}
|
|
1010
|
-
),
|
|
1011
|
-
onClick,
|
|
1012
|
-
children: [
|
|
1013
|
-
StartIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StartIcon, { className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size]) }),
|
|
1014
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1015
|
-
Typography_default,
|
|
978
|
+
var LinkButton = (0, import_react6.forwardRef)(
|
|
979
|
+
({
|
|
980
|
+
text,
|
|
981
|
+
href,
|
|
982
|
+
target,
|
|
983
|
+
rel,
|
|
984
|
+
"data-testid": dataTestId,
|
|
985
|
+
color = "primary",
|
|
986
|
+
size = "md",
|
|
987
|
+
fullWidth = false,
|
|
988
|
+
startIcon: StartIcon,
|
|
989
|
+
endIcon: EndIcon,
|
|
990
|
+
onClick
|
|
991
|
+
}, ref) => {
|
|
992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
993
|
+
"a",
|
|
994
|
+
{
|
|
995
|
+
href,
|
|
996
|
+
"data-testid": dataTestId,
|
|
997
|
+
target,
|
|
998
|
+
ref,
|
|
999
|
+
rel,
|
|
1000
|
+
className: (0, import_classnames8.default)(
|
|
1001
|
+
LinkButton_module_default.linkButton,
|
|
1002
|
+
Button_module_default3.button,
|
|
1003
|
+
foregroundColor(color),
|
|
1004
|
+
backgroundColor(color),
|
|
1005
|
+
Button_module_default3[size],
|
|
1016
1006
|
{
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1007
|
+
[Button_module_default3.fullWidth]: fullWidth,
|
|
1008
|
+
[LinkButton_module_default.fitContent]: !fullWidth,
|
|
1009
|
+
[Button_module_default3.buttonGap]: size === "lg" || size === "md",
|
|
1010
|
+
[Button_module_default3.secondaryBorder]: color === "secondary",
|
|
1011
|
+
[Button_module_default3.secondaryDestructiveBorder]: color === "destructive-secondary"
|
|
1020
1012
|
}
|
|
1021
1013
|
),
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1014
|
+
onClick,
|
|
1015
|
+
children: [
|
|
1016
|
+
StartIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1017
|
+
StartIcon,
|
|
1018
|
+
{
|
|
1019
|
+
className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size])
|
|
1020
|
+
}
|
|
1021
|
+
),
|
|
1022
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1023
|
+
Typography_default,
|
|
1024
|
+
{
|
|
1025
|
+
color: foregroundTypographyColor(color),
|
|
1026
|
+
size: textVariant_default[size],
|
|
1027
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { fontWeight: 500 }, children: text })
|
|
1028
|
+
}
|
|
1029
|
+
),
|
|
1030
|
+
EndIcon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(EndIcon, { className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size]) })
|
|
1031
|
+
]
|
|
1032
|
+
}
|
|
1033
|
+
);
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
1036
|
+
LinkButton.displayName = "LinkButton";
|
|
1037
|
+
var LinkButton_default = LinkButton;
|
|
1027
1038
|
|
|
1028
1039
|
// css-module:./MiniActionCard.module.css#css-module
|
|
1029
1040
|
var MiniActionCard_module_default = { "miniActionCard": "_miniActionCard_qebkn_1", "card": "_card_qebkn_9" };
|
|
@@ -1039,7 +1050,7 @@ var MiniActionCard_default = MiniActionCard;
|
|
|
1039
1050
|
var import_classnames9 = __toESM(require_classnames());
|
|
1040
1051
|
|
|
1041
1052
|
// src/Modal/FocusTrap.tsx
|
|
1042
|
-
var
|
|
1053
|
+
var import_react7 = require("react");
|
|
1043
1054
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1044
1055
|
function queryFocusableAll(el) {
|
|
1045
1056
|
const selector = [
|
|
@@ -1069,9 +1080,9 @@ var focusElement = (el) => {
|
|
|
1069
1080
|
function FocusTrap({
|
|
1070
1081
|
children
|
|
1071
1082
|
}) {
|
|
1072
|
-
const elRef = (0,
|
|
1073
|
-
const previouslyFocusedElRef = (0,
|
|
1074
|
-
(0,
|
|
1083
|
+
const elRef = (0, import_react7.useRef)(null);
|
|
1084
|
+
const previouslyFocusedElRef = (0, import_react7.useRef)(null);
|
|
1085
|
+
(0, import_react7.useEffect)(() => {
|
|
1075
1086
|
const { current: element } = elRef;
|
|
1076
1087
|
const focusFirstChild = () => {
|
|
1077
1088
|
const withinIframe = window !== window.parent;
|
|
@@ -1105,9 +1116,9 @@ function FocusTrap({
|
|
|
1105
1116
|
}
|
|
1106
1117
|
|
|
1107
1118
|
// src/Modal/StopScroll.tsx
|
|
1108
|
-
var
|
|
1119
|
+
var import_react8 = require("react");
|
|
1109
1120
|
function StopScroll(props) {
|
|
1110
|
-
(0,
|
|
1121
|
+
(0, import_react8.useEffect)(() => {
|
|
1111
1122
|
const originalStyle = window.getComputedStyle(document.body).overflow;
|
|
1112
1123
|
document.body.style.overflow = "hidden";
|
|
1113
1124
|
return () => {
|
|
@@ -1228,7 +1239,7 @@ function Modal({
|
|
|
1228
1239
|
Modal.displayName = "Modal";
|
|
1229
1240
|
|
|
1230
1241
|
// src/RadioButton/RadioButton.tsx
|
|
1231
|
-
var
|
|
1242
|
+
var import_react9 = require("react");
|
|
1232
1243
|
var import_classnames10 = __toESM(require_classnames());
|
|
1233
1244
|
|
|
1234
1245
|
// css-module:./RadioButton.module.css#css-module
|
|
@@ -1248,7 +1259,7 @@ var RadioButton = ({
|
|
|
1248
1259
|
size = "md",
|
|
1249
1260
|
value
|
|
1250
1261
|
}) => {
|
|
1251
|
-
const [isFocused, setIsFocused] = (0,
|
|
1262
|
+
const [isFocused, setIsFocused] = (0, import_react9.useState)(false);
|
|
1252
1263
|
const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
|
|
1253
1264
|
const sharedStyles = (0, import_classnames10.default)(RadioButton_module_default.background, RadioButton_module_default[size], {
|
|
1254
1265
|
[RadioButton_module_default.errorBorderColor]: error,
|
|
@@ -1319,7 +1330,7 @@ var RadioButton = ({
|
|
|
1319
1330
|
var RadioButton_default = RadioButton;
|
|
1320
1331
|
|
|
1321
1332
|
// src/SelectList/SelectList.tsx
|
|
1322
|
-
var
|
|
1333
|
+
var import_react10 = require("react");
|
|
1323
1334
|
var import_classnames11 = __toESM(require_classnames());
|
|
1324
1335
|
|
|
1325
1336
|
// ../syntax-design-tokens/dist/js/index.js
|
|
@@ -1359,9 +1370,9 @@ function SelectList({
|
|
|
1359
1370
|
selectedValue = "",
|
|
1360
1371
|
size = "md"
|
|
1361
1372
|
}) {
|
|
1362
|
-
const id = (0,
|
|
1373
|
+
const id = (0, import_react10.useId)();
|
|
1363
1374
|
const { isFocusVisible: isFocusVisible2 } = useFocusVisible();
|
|
1364
|
-
const [isFocused, setIsFocused] = (0,
|
|
1375
|
+
const [isFocused, setIsFocused] = (0, import_react10.useState)(false);
|
|
1365
1376
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1366
1377
|
"div",
|
|
1367
1378
|
{
|
|
@@ -1429,7 +1440,7 @@ function SelectList({
|
|
|
1429
1440
|
SelectList.Option = SelectOption_default;
|
|
1430
1441
|
|
|
1431
1442
|
// src/TextField/TextField.tsx
|
|
1432
|
-
var
|
|
1443
|
+
var import_react11 = require("react");
|
|
1433
1444
|
var import_classnames12 = __toESM(require_classnames());
|
|
1434
1445
|
|
|
1435
1446
|
// css-module:./TextField.module.css#css-module
|
|
@@ -1451,7 +1462,7 @@ function TextField({
|
|
|
1451
1462
|
type = "text",
|
|
1452
1463
|
value = ""
|
|
1453
1464
|
}) {
|
|
1454
|
-
const reactId = (0,
|
|
1465
|
+
const reactId = (0, import_react11.useId)();
|
|
1455
1466
|
const inputId = id != null ? id : reactId;
|
|
1456
1467
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
1457
1468
|
Box_default,
|