@cambly/syntax-core 7.2.0 → 7.4.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.mjs CHANGED
@@ -160,6 +160,7 @@ var Typography = ({
160
160
  as = "div",
161
161
  children,
162
162
  color = "gray900",
163
+ "data-testid": dataTestId,
163
164
  inline = false,
164
165
  lineClamp = void 0,
165
166
  size = 200,
@@ -183,6 +184,7 @@ var Typography = ({
183
184
  underline && Typography_module_default.underline,
184
185
  lineClamp != null && Typography_module_default.lineClamp
185
186
  ),
187
+ "data-testid": dataTestId,
186
188
  style: {
187
189
  WebkitLineClamp: lineClamp
188
190
  },
@@ -860,10 +862,22 @@ var Heading = ({
860
862
  as = "h1",
861
863
  children,
862
864
  color = "gray900",
865
+ "data-testid": dataTestId,
863
866
  size = 500
864
867
  }) => {
865
868
  const weight = [700, 800].includes(size) ? "heavy" : "bold";
866
- return /* @__PURE__ */ jsx10(Typography_default, { align, as, color, size, weight, children });
869
+ return /* @__PURE__ */ jsx10(
870
+ Typography_default,
871
+ {
872
+ align,
873
+ as,
874
+ color,
875
+ "data-testid": dataTestId,
876
+ size,
877
+ weight,
878
+ children
879
+ }
880
+ );
867
881
  };
868
882
  var Heading_default = Heading;
869
883
 
@@ -922,6 +936,7 @@ var IconButton_default = IconButton;
922
936
 
923
937
  // src/LinkButton/LinkButton.tsx
924
938
  var import_classnames8 = __toESM(require_classnames());
939
+ import { forwardRef as forwardRef4 } from "react";
925
940
 
926
941
  // css-module:../Button/Button.module.css#css-module
927
942
  var Button_module_default3 = { "button": "_button_1iunh_1", "buttonGap": "_buttonGap_1iunh_9", "fullWidth": "_fullWidth_1iunh_50", "sm": "_sm_1iunh_54", "md": "_md_1iunh_61", "lg": "_lg_1iunh_68", "icon": "_icon_1iunh_75", "smIcon": "_smIcon_1iunh_79", "mdIcon": "_mdIcon_1iunh_86", "lgIcon": "_lgIcon_1iunh_93", "secondaryBorder": "_secondaryBorder_1iunh_100", "secondaryDestructiveBorder": "_secondaryDestructiveBorder_1iunh_104", "loading": "_loading_1iunh_118", "syntaxButtonLoadingRotate": "_syntaxButtonLoadingRotate_1iunh_1", "loadingCircle": "_loadingCircle_1iunh_122" };
@@ -931,56 +946,66 @@ var LinkButton_module_default = { "linkButton": "_linkButton_1b3ot_1", "fitConte
931
946
 
932
947
  // src/LinkButton/LinkButton.tsx
933
948
  import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
934
- function LinkButton({
935
- text,
936
- href,
937
- target,
938
- rel,
939
- "data-testid": dataTestId,
940
- color = "primary",
941
- size = "md",
942
- fullWidth = false,
943
- startIcon: StartIcon,
944
- endIcon: EndIcon,
945
- onClick
946
- }) {
947
- return /* @__PURE__ */ jsxs4(
948
- "a",
949
- {
950
- href,
951
- "data-testid": dataTestId,
952
- target,
953
- rel,
954
- className: (0, import_classnames8.default)(
955
- LinkButton_module_default.linkButton,
956
- Button_module_default3.button,
957
- foregroundColor(color),
958
- backgroundColor(color),
959
- Button_module_default3[size],
960
- {
961
- [Button_module_default3.fullWidth]: fullWidth,
962
- [LinkButton_module_default.fitContent]: !fullWidth,
963
- [Button_module_default3.buttonGap]: size === "lg" || size === "md",
964
- [Button_module_default3.secondaryBorder]: color === "secondary",
965
- [Button_module_default3.secondaryDestructiveBorder]: color === "destructive-secondary"
966
- }
967
- ),
968
- onClick,
969
- children: [
970
- StartIcon && /* @__PURE__ */ jsx12(StartIcon, { className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size]) }),
971
- /* @__PURE__ */ jsx12(
972
- Typography_default,
949
+ var LinkButton = forwardRef4(
950
+ ({
951
+ text,
952
+ href,
953
+ target,
954
+ rel,
955
+ "data-testid": dataTestId,
956
+ color = "primary",
957
+ size = "md",
958
+ fullWidth = false,
959
+ startIcon: StartIcon,
960
+ endIcon: EndIcon,
961
+ onClick
962
+ }, ref) => {
963
+ return /* @__PURE__ */ jsxs4(
964
+ "a",
965
+ {
966
+ href,
967
+ "data-testid": dataTestId,
968
+ target,
969
+ ref,
970
+ rel,
971
+ className: (0, import_classnames8.default)(
972
+ LinkButton_module_default.linkButton,
973
+ Button_module_default3.button,
974
+ foregroundColor(color),
975
+ backgroundColor(color),
976
+ Button_module_default3[size],
973
977
  {
974
- color: foregroundTypographyColor(color),
975
- size: textVariant_default[size],
976
- children: /* @__PURE__ */ jsx12("span", { style: { fontWeight: 500 }, children: text })
978
+ [Button_module_default3.fullWidth]: fullWidth,
979
+ [LinkButton_module_default.fitContent]: !fullWidth,
980
+ [Button_module_default3.buttonGap]: size === "lg" || size === "md",
981
+ [Button_module_default3.secondaryBorder]: color === "secondary",
982
+ [Button_module_default3.secondaryDestructiveBorder]: color === "destructive-secondary"
977
983
  }
978
984
  ),
979
- EndIcon && /* @__PURE__ */ jsx12(EndIcon, { className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size]) })
980
- ]
981
- }
982
- );
983
- }
985
+ onClick,
986
+ children: [
987
+ StartIcon && /* @__PURE__ */ jsx12(
988
+ StartIcon,
989
+ {
990
+ className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size])
991
+ }
992
+ ),
993
+ /* @__PURE__ */ jsx12(
994
+ Typography_default,
995
+ {
996
+ color: foregroundTypographyColor(color),
997
+ size: textVariant_default[size],
998
+ children: /* @__PURE__ */ jsx12("span", { style: { fontWeight: 500 }, children: text })
999
+ }
1000
+ ),
1001
+ EndIcon && /* @__PURE__ */ jsx12(EndIcon, { className: (0, import_classnames8.default)(Button_module_default3.icon, iconSize_default[size]) })
1002
+ ]
1003
+ }
1004
+ );
1005
+ }
1006
+ );
1007
+ LinkButton.displayName = "LinkButton";
1008
+ var LinkButton_default = LinkButton;
984
1009
 
985
1010
  // css-module:./MiniActionCard.module.css#css-module
986
1011
  var MiniActionCard_module_default = { "miniActionCard": "_miniActionCard_qebkn_1", "card": "_card_qebkn_9" };
@@ -1468,7 +1493,7 @@ export {
1468
1493
  Divider,
1469
1494
  Heading_default as Heading,
1470
1495
  IconButton_default as IconButton,
1471
- LinkButton,
1496
+ LinkButton_default as LinkButton,
1472
1497
  MiniActionCard_default as MiniActionCard,
1473
1498
  Modal,
1474
1499
  RadioButton_default as RadioButton,