@bigbinary/neeto-themes-frontend 4.0.8 → 4.0.10

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.
@@ -18,7 +18,6 @@ import { useHistory, useParams, Switch as Switch$1, Route } from 'react-router-d
18
18
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
19
19
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
20
20
  import Close from '@bigbinary/neeto-icons/Close';
21
- import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
22
21
  import Popover from '@bigbinary/neetoui/Popover';
23
22
  import Typography from '@bigbinary/neetoui/Typography';
24
23
  import Switch from '@bigbinary/neetoui/Switch';
@@ -285,7 +284,7 @@ var Card$2 = function Card(_ref) {
285
284
  var isRTL = i18n.dir() === "rtl";
286
285
  var ToggleIcon = isRTL ? Left : Right;
287
286
  return /*#__PURE__*/jsxs("div", {
288
- "data-cy": "theme-".concat(hyphenate(title), "-properties"),
287
+ "data-testid": "theme-".concat(hyphenate(title), "-properties"),
289
288
  className: classnames("neeto-themes-nano-section neeto-ui-border-gray-200 border-b pt-2 transition-all duration-300 last:border-none", className, {
290
289
  "pb-2": !accordionOpenState[name],
291
290
  "pb-3": accordionOpenState[name],
@@ -301,7 +300,7 @@ var Card$2 = function Card(_ref) {
301
300
  children: [/*#__PURE__*/jsxs(Typography, {
302
301
  className: "flex min-w-0 grow items-center gap-2 text-start",
303
302
  component: "span",
304
- "data-cy": "theme-properties",
303
+ "data-testid": "theme-properties",
305
304
  lineHeight: "normal",
306
305
  style: "h4",
307
306
  weight: "semibold",
@@ -675,9 +674,9 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
675
674
  name = _ref.name;
676
675
  return /*#__PURE__*/jsxs("div", {
677
676
  className: "flex items-center justify-between gap-2",
678
- "data-cy": joinHyphenCase(label),
677
+ "data-testid": joinHyphenCase(label),
679
678
  children: [/*#__PURE__*/jsx(Typography, {
680
- "data-cy": "style-fields-labels",
679
+ "data-testid": "style-fields-labels",
681
680
  style: "body2",
682
681
  children: label
683
682
  }), /*#__PURE__*/jsx(Field, {
@@ -689,7 +688,7 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
689
688
  className: "neeto-ui-border-gray-300 neeto-themes-nano-alignment-block flex items-center border",
690
689
  children: [/*#__PURE__*/jsx(Button, {
691
690
  className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-left",
692
- "data-cy": "alignment-left",
691
+ "data-testid": "alignment-left",
693
692
  size: "medium",
694
693
  style: value === "left" ? "primary" : "text",
695
694
  icon: function icon() {
@@ -713,7 +712,7 @@ var AlignmentBlock = function AlignmentBlock(_ref) {
713
712
  className: "neeto-themes-nano-alignment-divider"
714
713
  }), /*#__PURE__*/jsx(Button, {
715
714
  className: "neeto-themes-nano-alignment-button neeto-themes-nano-alignment-button__alignment-center",
716
- "data-cy": "alignment-center",
715
+ "data-testid": "alignment-center",
717
716
  size: "medium",
718
717
  style: value === "center" ? "primary" : "text",
719
718
  icon: function icon() {
@@ -748,9 +747,9 @@ var ColorBlock = function ColorBlock(_ref) {
748
747
  showTransparencyControl = _ref.showTransparencyControl;
749
748
  return /*#__PURE__*/jsxs("div", {
750
749
  className: "flex items-center justify-between",
751
- "data-cy": "theme-style-".concat(joinHyphenCase(label)),
750
+ "data-testid": "theme-style-".concat(joinHyphenCase(label)),
752
751
  children: [/*#__PURE__*/jsx(Typography, {
753
- "data-cy": "style-fields-labels",
752
+ "data-testid": "style-fields-labels",
754
753
  style: "body2",
755
754
  children: label
756
755
  }), /*#__PURE__*/jsx(ColorPicker, {
@@ -774,9 +773,9 @@ var FontPickerBlock = function FontPickerBlock(_ref) {
774
773
  onChange = _ref.onChange;
775
774
  return /*#__PURE__*/jsxs("div", {
776
775
  className: "flex items-center justify-between",
777
- "data-cy": "theme-style-".concat(joinHyphenCase(label)),
776
+ "data-testid": "theme-style-".concat(joinHyphenCase(label)),
778
777
  children: [/*#__PURE__*/jsx(Typography, {
779
- "data-cy": "style-fields-labels",
778
+ "data-testid": "style-fields-labels",
780
779
  style: "body2",
781
780
  children: label
782
781
  }), /*#__PURE__*/jsx("div", {
@@ -809,9 +808,9 @@ var SelectBlock = function SelectBlock(_ref) {
809
808
  onChange = _ref.onChange;
810
809
  return /*#__PURE__*/jsxs("div", {
811
810
  className: "flex items-center justify-between",
812
- "data-cy": "theme-style-".concat(joinHyphenCase(label)),
811
+ "data-testid": "theme-style-".concat(joinHyphenCase(label)),
813
812
  children: [/*#__PURE__*/jsx(Typography, {
814
- "data-cy": "logo-field-labels",
813
+ "data-testid": "logo-field-labels",
815
814
  style: "body2",
816
815
  children: label
817
816
  }), /*#__PURE__*/jsx("div", {
@@ -835,9 +834,9 @@ var SliderBlock = function SliderBlock(_ref) {
835
834
  marks = _ref.marks;
836
835
  return /*#__PURE__*/jsxs("div", {
837
836
  className: "flex items-center justify-between gap-3",
838
- "data-cy": "theme-style-".concat(joinHyphenCase(label)),
837
+ "data-testid": "theme-style-".concat(joinHyphenCase(label)),
839
838
  children: [/*#__PURE__*/jsx(Typography, {
840
- "data-cy": "style-fields-labels",
839
+ "data-testid": "style-fields-labels",
841
840
  style: "body2",
842
841
  children: label
843
842
  }), /*#__PURE__*/jsx(Slider, {
@@ -868,11 +867,11 @@ var SwitchBlock = function SwitchBlock(_ref) {
868
867
  var doesHelpTextExist = i18n.exists(translationKey);
869
868
  return /*#__PURE__*/jsxs("div", {
870
869
  className: "flex items-center justify-between",
871
- "data-cy": "theme-style-content-background",
870
+ "data-testid": "theme-style-content-background",
872
871
  children: [/*#__PURE__*/jsxs("div", {
873
872
  className: "inline-flex items-center gap-4",
874
873
  children: [/*#__PURE__*/jsx(Typography, {
875
- "data-cy": "style-fields-labels",
874
+ "data-testid": "style-fields-labels",
876
875
  style: "body2",
877
876
  className: classnames({
878
877
  "w-32": doesHelpTextExist,
@@ -886,7 +885,7 @@ var SwitchBlock = function SwitchBlock(_ref) {
886
885
  }), /*#__PURE__*/jsx(Switch, _objectSpread$1(_objectSpread$1({}, _objectSpread$1({
887
886
  name: name
888
887
  }, switchProps)), {}, {
889
- "data-cy": "enable-background-color-toggle"
888
+ "data-testid": "enable-background-color-toggle"
890
889
  }))]
891
890
  });
892
891
  };
@@ -901,9 +900,9 @@ var TextBlock = function TextBlock(_ref) {
901
900
  placeholder = _ref.placeholder;
902
901
  return /*#__PURE__*/jsxs("div", {
903
902
  className: "flex items-center justify-between",
904
- "data-cy": "theme-style-".concat(joinHyphenCase(label)),
903
+ "data-testid": "theme-style-".concat(joinHyphenCase(label)),
905
904
  children: [/*#__PURE__*/jsx(Typography, {
906
- "data-cy": "style-fields-labels",
905
+ "data-testid": "style-fields-labels",
907
906
  style: "body2",
908
907
  children: label
909
908
  }), /*#__PURE__*/jsx("div", {
@@ -1192,11 +1191,11 @@ var ImageBlock = function ImageBlock(_ref) {
1192
1191
  }();
1193
1192
  return /*#__PURE__*/jsxs("div", {
1194
1193
  className: "space-y-3",
1195
- "data-cy": "theme-style-".concat(label ? joinHyphenCase(label) : "image-block"),
1194
+ "data-testid": "theme-style-".concat(label ? joinHyphenCase(label) : "image-block"),
1196
1195
  children: [label && /*#__PURE__*/jsx("div", {
1197
1196
  className: "flex items-center justify-between",
1198
1197
  children: /*#__PURE__*/jsx(Typography, {
1199
- "data-cy": "style-fields-labels",
1198
+ "data-testid": "style-fields-labels",
1200
1199
  style: "body2",
1201
1200
  children: label
1202
1201
  })
@@ -1283,7 +1282,7 @@ var ThemeMeta = function ThemeMeta(_ref) {
1283
1282
  title: t("neetoThemes.common.name"),
1284
1283
  children: /*#__PURE__*/jsx(Input$1, {
1285
1284
  autoFocus: true,
1286
- "data-cy": "theme-name-property",
1285
+ "data-testid": "theme-name-property",
1287
1286
  name: "name"
1288
1287
  })
1289
1288
  });
@@ -1406,7 +1405,10 @@ var Customize = function Customize(_ref) {
1406
1405
  }
1407
1406
  }, [isLoadingTheme]);
1408
1407
  if (isLoading) {
1409
- return /*#__PURE__*/jsx(PageLoader, {});
1408
+ return /*#__PURE__*/jsx("div", {
1409
+ className: "flex h-full w-full items-center justify-center",
1410
+ children: /*#__PURE__*/jsx(Spinner, {})
1411
+ });
1410
1412
  }
1411
1413
  return /*#__PURE__*/jsx(Form, {
1412
1414
  formikProps: {
@@ -1489,13 +1491,13 @@ var Customize = function Customize(_ref) {
1489
1491
  }), /*#__PURE__*/jsxs("div", {
1490
1492
  className: "neeto-ui-bg-white neeto-ui-shadow-s sticky bottom-0 start-0 end-0 flex justify-end gap-x-2 px-4 py-6 lg:px-5 xl:px-6",
1491
1493
  children: [/*#__PURE__*/jsx(Button, {
1492
- "data-cy": "reset-button",
1494
+ "data-testid": "reset-button",
1493
1495
  disabled: !dirty || isSubmitting,
1494
1496
  label: t("neetoThemes.buttons.reset"),
1495
1497
  style: "text",
1496
1498
  type: "reset"
1497
1499
  }), /*#__PURE__*/jsx(Button, {
1498
- "data-cy": "save-changes-button",
1500
+ "data-testid": "save-changes-button",
1499
1501
  disabled: !dirty && (themeData === null || themeData === void 0 ? void 0 : themeData.id) || isSubmitting,
1500
1502
  label: t("neetoThemes.buttons.save"),
1501
1503
  loading: isSubmitting,
@@ -1662,7 +1664,7 @@ var Card = function Card(_ref) {
1662
1664
  };
1663
1665
  return /*#__PURE__*/jsx("div", {
1664
1666
  className: "group space-y-2 pt-0.5",
1665
- "data-cy": active ? "active-theme-card" : "theme-card",
1667
+ "data-testid": active ? "active-theme-card" : "theme-card",
1666
1668
  id: theme.id,
1667
1669
  children: /*#__PURE__*/jsxs("div", {
1668
1670
  className: classnames("neeto-themes-theme-thumbnail neeto-ui-rounded-lg relative cursor-pointer border transition-all duration-300 ease-in-out", {
@@ -1680,7 +1682,7 @@ var Card = function Card(_ref) {
1680
1682
  className: "absolute start-0 top-0 z-10 flex h-full w-full items-center justify-center gap-1 p-3",
1681
1683
  children: active ? /*#__PURE__*/jsx("span", {
1682
1684
  className: "neeto-ui-btn neeto-themes-theme-thumbnail__active-label neeto-ui-btn--style-primary neeto-ui-btn--size-medium neeto-ui-rounded-full shrink-0 cursor-auto justify-center",
1683
- "data-cy": "active-theme-label",
1685
+ "data-testid": "active-theme-label",
1684
1686
  children: t("neetoThemes.common.activeTheme")
1685
1687
  }) : /*#__PURE__*/jsx("div", {
1686
1688
  className: classnames({
@@ -1690,7 +1692,7 @@ var Card = function Card(_ref) {
1690
1692
  children: /*#__PURE__*/jsxs("div", {
1691
1693
  className: "relative flex w-full flex-col gap-2",
1692
1694
  children: [/*#__PURE__*/jsx(Button, {
1693
- "data-cy": "preview-theme-button",
1695
+ "data-testid": "preview-theme-button",
1694
1696
  disabled: isPreviewing,
1695
1697
  label: t("neetoThemes.common.previewTheme"),
1696
1698
  size: "medium",
@@ -1704,7 +1706,7 @@ var Card = function Card(_ref) {
1704
1706
  }
1705
1707
  }), /*#__PURE__*/jsx(Button, {
1706
1708
  className: "neeto-themes-theme-thumbnail__apply-btn shrink-0 justify-center",
1707
- "data-cy": "apply-theme-button",
1709
+ "data-testid": "apply-theme-button",
1708
1710
  disabled: isApplyingTheme,
1709
1711
  label: t("neetoThemes.common.useTheme"),
1710
1712
  loading: isApplyingTheme,
@@ -1736,13 +1738,13 @@ var Card = function Card(_ref) {
1736
1738
  className: "flex items-center space-x-2",
1737
1739
  children: [/*#__PURE__*/jsx(Typography, {
1738
1740
  className: "line-clamp-2 min-w-0 grow wrap-anywhere pt-1",
1739
- "data-cy": "theme-name",
1741
+ "data-testid": "theme-name",
1740
1742
  lineHeight: "snug",
1741
1743
  style: "body2",
1742
1744
  children: name
1743
1745
  }), isGlobalTheme && /*#__PURE__*/jsx(Rating, {
1744
1746
  className: "neeto-themes-nano-global-theme-icon",
1745
- "data-cy": "global-theme-icon",
1747
+ "data-testid": "global-theme-icon",
1746
1748
  size: 18
1747
1749
  })]
1748
1750
  }), /*#__PURE__*/jsx(MoreDropdown, {
@@ -1757,18 +1759,18 @@ var Card = function Card(_ref) {
1757
1759
  },
1758
1760
  menuItems: [{
1759
1761
  key: "edit",
1760
- "data-cy": "edit-theme-menu-item",
1762
+ "data-testid": "edit-theme-menu-item",
1761
1763
  label: t("neetoThemes.common.edit"),
1762
1764
  isVisible: isPresent(onEditTheme),
1763
1765
  onClick: handleEditTheme
1764
1766
  }, {
1765
1767
  key: "clone",
1766
- "data-cy": "clone-theme-menu-item",
1768
+ "data-testid": "clone-theme-menu-item",
1767
1769
  label: t("neetoThemes.build.leftSideBar.themes.themeOptions.clone"),
1768
1770
  onClick: handleCloneTheme
1769
1771
  }, {
1770
1772
  key: "set-as-global-theme",
1771
- "data-cy": "set-as-global-theme-menu-item",
1773
+ "data-testid": "set-as-global-theme-menu-item",
1772
1774
  label: t("neetoThemes.build.leftSideBar.themes.themeOptions.setAsGlobalTheme.label"),
1773
1775
  isVisible: !isGlobalTheme,
1774
1776
  onClick: handleApplyGlobalTheme
@@ -1778,7 +1780,7 @@ var Card = function Card(_ref) {
1778
1780
  isVisible: isFunction(onDeleteTheme)
1779
1781
  }, {
1780
1782
  key: "delete",
1781
- "data-cy": "delete-theme-menu-item",
1783
+ "data-testid": "delete-theme-menu-item",
1782
1784
  label: t("neetoThemes.build.leftSideBar.themes.themeOptions.delete"),
1783
1785
  isDisabled: isApplyingTheme,
1784
1786
  isVisible: isFunction(onDeleteTheme),
@@ -1904,19 +1906,19 @@ var Themes = function Themes(_ref) {
1904
1906
  placeholder: t("neetoThemes.common.searchThemes")
1905
1907
  }), isEmpty(filteredThemes) && isEmpty(filteredDefaultThemes) && /*#__PURE__*/jsx(Typography, {
1906
1908
  className: "text-center",
1907
- "data-cy": "no-data-title",
1909
+ "data-testid": "no-data-title",
1908
1910
  style: "body2",
1909
1911
  children: t("neetoThemes.common.noResultsFound")
1910
1912
  }), isNotEmpty(filteredDefaultThemes) && /*#__PURE__*/jsxs(Fragment, {
1911
1913
  children: [/*#__PURE__*/jsx(Typography, {
1912
1914
  className: "my-4 px-6 uppercase lg:px-5 xl:px-6",
1913
- "data-cy": "system-themes-header",
1915
+ "data-testid": "system-themes-header",
1914
1916
  style: "h6",
1915
1917
  weight: "semibold",
1916
1918
  children: t("neetoThemes.build.leftSideBar.themes.systemThemes")
1917
1919
  }), /*#__PURE__*/jsx("div", {
1918
1920
  className: "flex flex-col gap-4 px-6 pb-10 lg:px-5 xl:px-6",
1919
- "data-cy": "system-themes",
1921
+ "data-testid": "system-themes",
1920
1922
  children: filteredDefaultThemes.map(function (theme) {
1921
1923
  return /*#__PURE__*/createElement(Card$1, {
1922
1924
  onApplyTheme: onApplyTheme,
@@ -1938,13 +1940,13 @@ var Themes = function Themes(_ref) {
1938
1940
  className: "mb-6 space-y-3",
1939
1941
  children: [/*#__PURE__*/jsx(Typography, {
1940
1942
  className: "my-4 px-6 uppercase",
1941
- "data-cy": "custom-themes-header",
1943
+ "data-testid": "custom-themes-header",
1942
1944
  style: "h6",
1943
1945
  weight: "semibold",
1944
1946
  children: t("neetoThemes.build.leftSideBar.themes.customThemes")
1945
1947
  }), /*#__PURE__*/jsx("div", {
1946
1948
  className: "flex flex-col gap-4 px-6",
1947
- "data-cy": "custom-themes",
1949
+ "data-testid": "custom-themes",
1948
1950
  children: filteredThemes.map(function (theme) {
1949
1951
  var isActive = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme.id) === theme.id;
1950
1952
  var isPreviewing = (previewingTheme === null || previewingTheme === void 0 ? void 0 : previewingTheme.id) === theme.id;
@@ -2001,7 +2003,7 @@ var TitleBar = function TitleBar(_ref) {
2001
2003
  children: /*#__PURE__*/jsxs("div", {
2002
2004
  className: "flex items-center justify-start space-x-2",
2003
2005
  children: [/*#__PURE__*/jsx(Button, {
2004
- "data-cy": "customize-themes-back-button",
2006
+ "data-testid": "customize-themes-back-button",
2005
2007
  icon: BackButtonIcon,
2006
2008
  iconPosition: "left",
2007
2009
  style: "text",
@@ -2013,7 +2015,7 @@ var TitleBar = function TitleBar(_ref) {
2013
2015
  return handleBackPress(themeId);
2014
2016
  }
2015
2017
  }), /*#__PURE__*/jsxs(Typography, {
2016
- "data-cy": "themes-header",
2018
+ "data-testid": "themes-header",
2017
2019
  lineHeight: "normal",
2018
2020
  style: "h3",
2019
2021
  weight: "semibold",
@@ -2029,7 +2031,7 @@ var TitleBar = function TitleBar(_ref) {
2029
2031
  children: [/*#__PURE__*/jsxs("div", {
2030
2032
  className: "flex space-x-2",
2031
2033
  children: [/*#__PURE__*/jsx(Typography, {
2032
- "data-cy": "themes-header",
2034
+ "data-testid": "themes-header",
2033
2035
  lineHeight: "normal",
2034
2036
  style: "h3",
2035
2037
  weight: "semibold",
@@ -2046,7 +2048,7 @@ var TitleBar = function TitleBar(_ref) {
2046
2048
  }), /*#__PURE__*/jsx("div", {
2047
2049
  className: "self-end",
2048
2050
  children: /*#__PURE__*/jsx(Button, {
2049
- "data-cy": "customize-themes-add-theme-button",
2051
+ "data-testid": "customize-themes-add-theme-button",
2050
2052
  icon: Plus,
2051
2053
  iconPosition: "left",
2052
2054
  style: "text",