@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.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
- text,
402
- loadingText,
403
- color = "primary",
404
- size = "md",
405
- accessibilityLabel,
406
- disabled = false,
407
- loading = false,
408
- fullWidth = false,
409
- startIcon: StartIcon,
410
- endIcon: EndIcon,
411
- onClick,
412
- tooltip
413
- }) => {
414
- return /* @__PURE__ */ jsxs(
415
- "button",
416
- {
417
- "aria-label": accessibilityLabel,
418
- type: "button",
419
- title: tooltip,
420
- disabled: disabled || loading,
421
- onClick,
422
- className: (0, import_classnames3.default)(
423
- Button_module_default.button,
424
- foregroundColor(color),
425
- backgroundColor(color),
426
- Button_module_default[size],
427
- {
428
- [Button_module_default.fullWidth]: fullWidth,
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
- className: (0, import_classnames3.default)(Button_module_default.loading, foregroundColor(color)),
442
- viewBox: "22 22 44 44",
443
- width: loadingIconSize[size],
444
- height: loadingIconSize[size],
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
- accessibilityLabel,
596
- color = "primary",
597
- disabled = false,
598
- icon: Icon,
599
- size = "md",
600
- tooltip,
601
- onClick
602
- }) => {
603
- return /* @__PURE__ */ jsx9(
604
- "button",
605
- {
606
- "aria-label": accessibilityLabel,
607
- type: "button",
608
- title: tooltip,
609
- disabled,
610
- onClick,
611
- className: (0, import_classnames6.default)(
612
- IconButton_module_default.iconButton,
613
- foregroundColor(color),
614
- backgroundColor(color),
615
- IconButton_module_default[size]
616
- ),
617
- children: /* @__PURE__ */ jsx9(Icon, { className: iconSize2[size] })
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": "_radioBaseContainer_144ms_1", "smBase": "_smBase_144ms_8", "mdBase": "_mdBase_144ms_13", "radioStyleOverride": "_radioStyleOverride_144ms_18", "smOverride": "_smOverride_144ms_23", "mdOverride": "_mdOverride_144ms_28", "background": "_background_144ms_33", "sm": "_sm_144ms_8", "md": "_md_144ms_13", "neutralBorder": "_neutralBorder_144ms_50", "smCheckedBorder": "_smCheckedBorder_144ms_54", "mdCheckedBorder": "_mdCheckedBorder_144ms_58", "errorBorderColor": "_errorBorderColor_144ms_62", "borderColor": "_borderColor_144ms_66" };
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 { useId, useState as useState4 } from "react";
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";