@cambly/syntax-core 4.8.0 → 4.8.2
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 +15 -14
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +27 -25
- package/dist/index.js +110 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +104 -89
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -376,6 +376,9 @@ function foregroundColor(color) {
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
+
// src/Button/Button.tsx
|
|
380
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
381
|
+
|
|
379
382
|
// css-module:./Button.module.css#css-module
|
|
380
383
|
var Button_module_default = { "button": "_button_13egy_1", "buttonGap": "_buttonGap_13egy_9", "fullWidth": "_fullWidth_13egy_50", "sm": "_sm_13egy_54", "md": "_md_13egy_61", "lg": "_lg_13egy_68", "icon": "_icon_13egy_75", "smIcon": "_smIcon_13egy_79", "mdIcon": "_mdIcon_13egy_86", "lgIcon": "_lgIcon_13egy_93", "textContainer": "_textContainer_13egy_100", "secondaryBorder": "_secondaryBorder_13egy_105", "secondaryDestructiveBorder": "_secondaryDestructiveBorder_13egy_109", "loading": "_loading_13egy_123", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_13egy_1", "loadingCircle": "_loadingCircle_13egy_127", "buttonText": "_buttonText_13egy_135", "buttonTextSmall": "_buttonTextSmall_13egy_142", "buttonTextMedium": "_buttonTextMedium_13egy_146", "buttonTextLarge": "_buttonTextLarge_13egy_150" };
|
|
381
384
|
|
|
@@ -397,68 +400,72 @@ var iconSize = {
|
|
|
397
400
|
["md"]: Button_module_default.mdIcon,
|
|
398
401
|
["lg"]: Button_module_default.lgIcon
|
|
399
402
|
};
|
|
400
|
-
var Button = (
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
[
|
|
429
|
-
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
430
|
-
[Button_module_default.secondaryBorder]: color === "secondary",
|
|
431
|
-
[Button_module_default.secondaryDestructiveBorder]: color === "destructive-secondary"
|
|
432
|
-
}
|
|
433
|
-
),
|
|
434
|
-
children: [
|
|
435
|
-
!loading && StartIcon && /* @__PURE__ */ jsx3(StartIcon, { className: (0, import_classnames3.default)(Button_module_default.icon, iconSize[size]) }),
|
|
436
|
-
(loading && loadingText || !loading && text) && /* @__PURE__ */ jsx3("div", { className: Button_module_default.textContainer, children: /* @__PURE__ */ jsx3("div", { className: (0, import_classnames3.default)(Button_module_default.buttonText, textVariant[size]), children: loading ? loadingText : text }) }),
|
|
437
|
-
!loading && EndIcon && /* @__PURE__ */ jsx3(EndIcon, { className: (0, import_classnames3.default)(Button_module_default.icon, iconSize[size]) }),
|
|
438
|
-
loading && /* @__PURE__ */ jsx3(
|
|
439
|
-
"svg",
|
|
403
|
+
var Button = forwardRef2(
|
|
404
|
+
({
|
|
405
|
+
text,
|
|
406
|
+
loadingText,
|
|
407
|
+
color = "primary",
|
|
408
|
+
size = "md",
|
|
409
|
+
accessibilityLabel,
|
|
410
|
+
disabled = false,
|
|
411
|
+
loading = false,
|
|
412
|
+
fullWidth = false,
|
|
413
|
+
startIcon: StartIcon,
|
|
414
|
+
endIcon: EndIcon,
|
|
415
|
+
onClick,
|
|
416
|
+
tooltip
|
|
417
|
+
}, ref) => {
|
|
418
|
+
return /* @__PURE__ */ jsxs(
|
|
419
|
+
"button",
|
|
420
|
+
{
|
|
421
|
+
ref,
|
|
422
|
+
"aria-label": accessibilityLabel,
|
|
423
|
+
type: "button",
|
|
424
|
+
title: tooltip,
|
|
425
|
+
disabled: disabled || loading,
|
|
426
|
+
onClick,
|
|
427
|
+
className: (0, import_classnames3.default)(
|
|
428
|
+
Button_module_default.button,
|
|
429
|
+
foregroundColor(color),
|
|
430
|
+
backgroundColor(color),
|
|
431
|
+
Button_module_default[size],
|
|
440
432
|
{
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
children: /* @__PURE__ */ jsx3(
|
|
446
|
-
"circle",
|
|
447
|
-
{
|
|
448
|
-
className: Button_module_default.loadingCircle,
|
|
449
|
-
cx: "44",
|
|
450
|
-
cy: "44",
|
|
451
|
-
r: "20.2",
|
|
452
|
-
fill: "none",
|
|
453
|
-
strokeWidth: "3.6"
|
|
454
|
-
}
|
|
455
|
-
)
|
|
433
|
+
[Button_module_default.fullWidth]: fullWidth,
|
|
434
|
+
[Button_module_default.buttonGap]: size === "lg" || size === "md",
|
|
435
|
+
[Button_module_default.secondaryBorder]: color === "secondary",
|
|
436
|
+
[Button_module_default.secondaryDestructiveBorder]: color === "destructive-secondary"
|
|
456
437
|
}
|
|
457
|
-
)
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
}
|
|
438
|
+
),
|
|
439
|
+
children: [
|
|
440
|
+
!loading && StartIcon && /* @__PURE__ */ jsx3(StartIcon, { className: (0, import_classnames3.default)(Button_module_default.icon, iconSize[size]) }),
|
|
441
|
+
(loading && loadingText || !loading && text) && /* @__PURE__ */ jsx3("div", { className: Button_module_default.textContainer, children: /* @__PURE__ */ jsx3("div", { className: (0, import_classnames3.default)(Button_module_default.buttonText, textVariant[size]), children: loading ? loadingText : text }) }),
|
|
442
|
+
!loading && EndIcon && /* @__PURE__ */ jsx3(EndIcon, { className: (0, import_classnames3.default)(Button_module_default.icon, iconSize[size]) }),
|
|
443
|
+
loading && /* @__PURE__ */ jsx3(
|
|
444
|
+
"svg",
|
|
445
|
+
{
|
|
446
|
+
className: (0, import_classnames3.default)(Button_module_default.loading, foregroundColor(color)),
|
|
447
|
+
viewBox: "22 22 44 44",
|
|
448
|
+
width: loadingIconSize[size],
|
|
449
|
+
height: loadingIconSize[size],
|
|
450
|
+
children: /* @__PURE__ */ jsx3(
|
|
451
|
+
"circle",
|
|
452
|
+
{
|
|
453
|
+
className: Button_module_default.loadingCircle,
|
|
454
|
+
cx: "44",
|
|
455
|
+
cy: "44",
|
|
456
|
+
r: "20.2",
|
|
457
|
+
fill: "none",
|
|
458
|
+
strokeWidth: "3.6"
|
|
459
|
+
}
|
|
460
|
+
)
|
|
461
|
+
}
|
|
462
|
+
)
|
|
463
|
+
]
|
|
464
|
+
}
|
|
465
|
+
);
|
|
466
|
+
}
|
|
467
|
+
);
|
|
468
|
+
Button.displayName = "Button";
|
|
462
469
|
var Button_default = Button;
|
|
463
470
|
|
|
464
471
|
// css-module:./ButtonGroup.module.css#css-module
|
|
@@ -580,6 +587,7 @@ var Heading_default = Heading;
|
|
|
580
587
|
|
|
581
588
|
// src/IconButton/IconButton.tsx
|
|
582
589
|
var import_classnames6 = __toESM(require_classnames());
|
|
590
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
583
591
|
|
|
584
592
|
// css-module:./IconButton.module.css#css-module
|
|
585
593
|
var IconButton_module_default = { "iconButton": "_iconButton_dzhn0_1", "sm": "_sm_dzhn0_46", "md": "_md_dzhn0_51", "lg": "_lg_dzhn0_56", "smIcon": "_smIcon_dzhn0_61", "mdIcon": "_mdIcon_dzhn0_68", "lgIcon": "_lgIcon_dzhn0_75" };
|
|
@@ -591,33 +599,37 @@ var iconSize2 = {
|
|
|
591
599
|
["md"]: IconButton_module_default.mdIcon,
|
|
592
600
|
["lg"]: IconButton_module_default.lgIcon
|
|
593
601
|
};
|
|
594
|
-
var IconButton = (
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
}
|
|
602
|
+
var IconButton = forwardRef3(
|
|
603
|
+
({
|
|
604
|
+
accessibilityLabel,
|
|
605
|
+
color = "primary",
|
|
606
|
+
disabled = false,
|
|
607
|
+
icon: Icon,
|
|
608
|
+
size = "md",
|
|
609
|
+
tooltip,
|
|
610
|
+
onClick
|
|
611
|
+
}, ref) => {
|
|
612
|
+
return /* @__PURE__ */ jsx9(
|
|
613
|
+
"button",
|
|
614
|
+
{
|
|
615
|
+
"aria-label": accessibilityLabel,
|
|
616
|
+
type: "button",
|
|
617
|
+
title: tooltip,
|
|
618
|
+
disabled,
|
|
619
|
+
onClick,
|
|
620
|
+
className: (0, import_classnames6.default)(
|
|
621
|
+
IconButton_module_default.iconButton,
|
|
622
|
+
foregroundColor(color),
|
|
623
|
+
backgroundColor(color),
|
|
624
|
+
IconButton_module_default[size]
|
|
625
|
+
),
|
|
626
|
+
ref,
|
|
627
|
+
children: /* @__PURE__ */ jsx9(Icon, { className: iconSize2[size] })
|
|
628
|
+
}
|
|
629
|
+
);
|
|
630
|
+
}
|
|
631
|
+
);
|
|
632
|
+
IconButton.displayName = "IconButton";
|
|
621
633
|
var IconButton_default = IconButton;
|
|
622
634
|
|
|
623
635
|
// src/Checkbox/Checkbox.tsx
|
|
@@ -804,7 +816,7 @@ var import_classnames8 = __toESM(require_classnames());
|
|
|
804
816
|
import { useState as useState3 } from "react";
|
|
805
817
|
|
|
806
818
|
// css-module:./RadioButton.module.css#css-module
|
|
807
|
-
var RadioButton_module_default = { "radioBaseContainer": "
|
|
819
|
+
var RadioButton_module_default = { "radioBaseContainer": "_radioBaseContainer_ne98c_1", "smBase": "_smBase_ne98c_9", "mdBase": "_mdBase_ne98c_14", "radioStyleOverride": "_radioStyleOverride_ne98c_19", "smOverride": "_smOverride_ne98c_24", "mdOverride": "_mdOverride_ne98c_29", "background": "_background_ne98c_34", "sm": "_sm_ne98c_9", "md": "_md_ne98c_14", "neutralBorder": "_neutralBorder_ne98c_51", "smCheckedBorder": "_smCheckedBorder_ne98c_55", "mdCheckedBorder": "_mdCheckedBorder_ne98c_59", "errorBorderColor": "_errorBorderColor_ne98c_63", "borderColor": "_borderColor_ne98c_67" };
|
|
808
820
|
|
|
809
821
|
// src/RadioButton/RadioButton.tsx
|
|
810
822
|
import { jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
@@ -879,7 +891,10 @@ var RadioButton_default = RadioButton;
|
|
|
879
891
|
|
|
880
892
|
// src/SelectList/SelectList.tsx
|
|
881
893
|
var import_classnames9 = __toESM(require_classnames());
|
|
882
|
-
import {
|
|
894
|
+
import {
|
|
895
|
+
useId,
|
|
896
|
+
useState as useState4
|
|
897
|
+
} from "react";
|
|
883
898
|
|
|
884
899
|
// ../syntax-design-tokens/dist/js/index.js
|
|
885
900
|
var ColorBaseDestructive700 = "#d32a4b";
|