@griddo/ax 11.11.8-rc.0 → 11.11.8

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.
Files changed (104) hide show
  1. package/config/jest/componentsMock.js +5 -7
  2. package/package.json +2 -2
  3. package/src/__tests__/components/Browser/Browser.test.tsx +87 -438
  4. package/src/__tests__/components/ConfigPanel/ConfigPanel.test.tsx +3 -1
  5. package/src/__tests__/components/Fields/Button/Button.test.tsx +27 -29
  6. package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +1 -1
  7. package/src/components/Browser/index.tsx +139 -301
  8. package/src/components/Browser/style.tsx +6 -75
  9. package/src/components/BrowserContent/index.tsx +2 -2
  10. package/src/components/Button/index.tsx +1 -2
  11. package/src/components/ConfigPanel/Form/ConnectedField/PageConnectedField/Field/index.tsx +4 -2
  12. package/src/components/Fields/AsyncSelect/style.tsx +0 -13
  13. package/src/components/Fields/FieldGroup/index.tsx +2 -5
  14. package/src/components/Fields/FieldGroup/style.tsx +7 -32
  15. package/src/components/Fields/HeadingField/index.tsx +2 -2
  16. package/src/components/Fields/HiddenField/style.tsx +1 -1
  17. package/src/components/Fields/NumberField/index.tsx +16 -15
  18. package/src/components/Fields/NumberField/style.tsx +0 -2
  19. package/src/components/Fields/ReferenceField/index.tsx +1 -1
  20. package/src/components/Fields/Select/index.tsx +1 -5
  21. package/src/components/Fields/Select/style.tsx +0 -56
  22. package/src/components/Fields/SummaryButton/index.tsx +9 -18
  23. package/src/components/Fields/SummaryButton/style.tsx +2 -1
  24. package/src/components/Fields/TagsField/index.tsx +9 -8
  25. package/src/components/Fields/UrlField/index.tsx +27 -26
  26. package/src/components/Fields/index.tsx +0 -2
  27. package/src/components/FloatingPanel/index.tsx +2 -5
  28. package/src/components/FloatingPanel/style.tsx +1 -2
  29. package/src/components/IconAction/index.tsx +1 -1
  30. package/src/components/MainWrapper/AppBar/index.tsx +1 -8
  31. package/src/components/MainWrapper/index.tsx +1 -7
  32. package/src/components/Notification/index.tsx +2 -2
  33. package/src/components/OcassionalToast/index.tsx +8 -1
  34. package/src/components/OcassionalToast/style.tsx +15 -1
  35. package/src/components/PageFinder/index.tsx +1 -1
  36. package/src/components/ResizePanel/index.tsx +3 -4
  37. package/src/components/ResizePanel/style.tsx +1 -1
  38. package/src/components/SearchField/style.tsx +2 -2
  39. package/src/components/SideModal/index.tsx +1 -2
  40. package/src/components/Tabs/index.tsx +4 -13
  41. package/src/components/Tabs/style.tsx +8 -7
  42. package/src/components/Toast/index.tsx +2 -4
  43. package/src/components/Tooltip/index.tsx +3 -4
  44. package/src/components/index.tsx +0 -10
  45. package/src/forms/fields.tsx +68 -70
  46. package/src/hooks/forms.tsx +1 -22
  47. package/src/hooks/index.tsx +3 -13
  48. package/src/hooks/modals.tsx +15 -103
  49. package/src/hooks/users.tsx +8 -25
  50. package/src/modules/Forms/atoms.tsx +2 -2
  51. package/src/modules/FramePreview/index.tsx +16 -55
  52. package/src/modules/FramePreview/style.tsx +2 -34
  53. package/src/modules/GlobalEditor/Editor/index.tsx +3 -37
  54. package/src/modules/GlobalEditor/PageBrowser/index.tsx +2 -19
  55. package/src/modules/GlobalEditor/Preview/index.tsx +2 -0
  56. package/src/modules/GlobalEditor/Preview/style.tsx +1 -1
  57. package/src/modules/GlobalEditor/index.tsx +57 -119
  58. package/src/modules/PageEditor/Editor/index.tsx +2 -33
  59. package/src/modules/PageEditor/PageBrowser/index.tsx +2 -20
  60. package/src/modules/PageEditor/Preview/index.tsx +2 -0
  61. package/src/modules/PageEditor/Preview/style.tsx +1 -1
  62. package/src/modules/PageEditor/atoms.tsx +1 -1
  63. package/src/modules/PageEditor/index.tsx +66 -130
  64. package/src/modules/PublicPreview/index.tsx +5 -8
  65. package/src/schemas/pages/GlobalPage.ts +70 -87
  66. package/src/schemas/pages/Page.ts +70 -87
  67. package/src/types/index.tsx +0 -12
  68. package/src/__tests__/components/Browser/Browser.utils.test.ts +0 -55
  69. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/ErrorItem.test.tsx +0 -158
  70. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorsBanner.test.tsx +0 -90
  71. package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.test.tsx +0 -178
  72. package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.utils.test.tsx +0 -150
  73. package/src/__tests__/components/KeywordsPreviewModal/KeywordItem/KeywordItem.test.tsx +0 -91
  74. package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +0 -122
  75. package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.utils.test.ts +0 -15
  76. package/src/__tests__/components/KeywordsPreviewModal/atoms.test.tsx +0 -101
  77. package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +0 -318
  78. package/src/__tests__/modules/FramePreview/FramePreview.utils.test.ts +0 -242
  79. package/src/__tests__/modules/FramePreview/HeadingsOverlay/HeadingsOverlay.test.tsx +0 -185
  80. package/src/components/Browser/utils.tsx +0 -13
  81. package/src/components/Fields/SEOPreview/index.tsx +0 -36
  82. package/src/components/Fields/SEOPreview/style.tsx +0 -24
  83. package/src/components/FloatingNote/index.tsx +0 -35
  84. package/src/components/FloatingNote/style.tsx +0 -26
  85. package/src/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/index.tsx +0 -85
  86. package/src/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/style.tsx +0 -80
  87. package/src/components/HeadingsPreviewModal/ErrorsBanner/index.tsx +0 -57
  88. package/src/components/HeadingsPreviewModal/ErrorsBanner/style.tsx +0 -82
  89. package/src/components/HeadingsPreviewModal/HeadingItem/index.tsx +0 -71
  90. package/src/components/HeadingsPreviewModal/HeadingItem/style.tsx +0 -77
  91. package/src/components/HeadingsPreviewModal/index.tsx +0 -146
  92. package/src/components/HeadingsPreviewModal/style.tsx +0 -82
  93. package/src/components/HeadingsPreviewModal/utils.tsx +0 -257
  94. package/src/components/KeywordsPreviewModal/KeywordItem/index.tsx +0 -46
  95. package/src/components/KeywordsPreviewModal/KeywordItem/style.tsx +0 -64
  96. package/src/components/KeywordsPreviewModal/atoms.tsx +0 -96
  97. package/src/components/KeywordsPreviewModal/index.tsx +0 -99
  98. package/src/components/KeywordsPreviewModal/style.tsx +0 -87
  99. package/src/components/KeywordsPreviewModal/utils.tsx +0 -22
  100. package/src/components/PageInfoBanner/index.tsx +0 -38
  101. package/src/components/PageInfoBanner/styles.tsx +0 -40
  102. package/src/modules/FramePreview/HeadingsOverlay/index.tsx +0 -113
  103. package/src/modules/FramePreview/HeadingsOverlay/style.tsx +0 -24
  104. package/src/modules/FramePreview/utils.tsx +0 -140
@@ -1,9 +1,9 @@
1
- import { memo, useEffect, useState } from "react";
1
+ import React, { memo, useEffect, useState } from "react";
2
2
 
3
3
  import { IconAction, TextField, FloatingPanel, FieldsBehavior, PageFinder } from "@ax/components";
4
4
  import { useModal } from "@ax/hooks";
5
5
  import { isReqOk } from "@ax/helpers";
6
- import type { IPage, IUrlField, Field, ISelectOption } from "@ax/types";
6
+ import { IPage, IUrlField, Field, ISelectOption } from "@ax/types";
7
7
  import { pages as pagesApi } from "@ax/api";
8
8
  import { findAnchorsFromPage, findAnchorsFromTab, findTabsFromPage } from "./utils";
9
9
 
@@ -29,7 +29,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
29
29
  const [internalPageName, setInternalPageName] = useState(null);
30
30
  const [pageData, setPageData] = useState<IPage | null>(null);
31
31
 
32
- const pageID = value?.linkTo ? value.linkTo : null;
32
+ const pageID = value && value.linkTo ? value.linkTo : null;
33
33
 
34
34
  // biome-ignore lint/correctness/useExhaustiveDependencies: TODO: fix this
35
35
  useEffect(() => {
@@ -67,13 +67,13 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
67
67
 
68
68
  const handleOnClick = () => {
69
69
  toggleModal();
70
- handlePanel?.(isOpen);
70
+ handlePanel && handlePanel(isOpen);
71
71
  };
72
72
 
73
73
  const handleReset = () => {
74
74
  onChange(null);
75
75
  setInternalPageName(null);
76
- resetValidation?.();
76
+ resetValidation && resetValidation();
77
77
  };
78
78
 
79
79
  const handleSetPage = (page: IPage | IPage[]) => {
@@ -85,10 +85,10 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
85
85
  linkTo: selectedPage.id,
86
86
  linkToURL: selectedPage.fullUrl,
87
87
  title: selectedPage.title,
88
- noFollow: !selectedPage.follow,
88
+ noFollow: !selectedPage.follow ? true : false,
89
89
  });
90
- handleValidation?.(selectedPage.id.toString(), validators);
91
- handlePanel?.(isOpen);
90
+ handleValidation && handleValidation(selectedPage.id.toString(), validators);
91
+ handlePanel && handlePanel(isOpen);
92
92
  };
93
93
 
94
94
  const handleChange = (newValue: string) => onChange({ ...value, href: newValue });
@@ -113,7 +113,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
113
113
  };
114
114
 
115
115
  const validator = { format: "fullURL" };
116
- const defensiveHref = value?.href ? value.href : "";
116
+ const defensiveHref = value && value.href ? value.href : "";
117
117
 
118
118
  let field = (
119
119
  <TextField
@@ -140,7 +140,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
140
140
  );
141
141
  }
142
142
 
143
- const titleValue = value?.title ? value.title : internalPageName ? internalPageName : "";
143
+ const titleValue = value && value.title ? value.title : internalPageName ? internalPageName : "";
144
144
  const noFollowValue =
145
145
  value && value.noFollow !== undefined
146
146
  ? value.noFollow
@@ -160,7 +160,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
160
160
  type: "UniqueCheck" as Field,
161
161
  name: "newTab",
162
162
  options: [{ title: "Open in new tab" }],
163
- value: value?.newTab ? value.newTab : null,
163
+ value: value && value.newTab ? value.newTab : null,
164
164
  onChange: handleNewTabChange,
165
165
  },
166
166
  {
@@ -175,7 +175,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
175
175
  return (
176
176
  <S.UrlFieldWrapper data-testid="url-field-wrapper">
177
177
  {field}
178
- {value?.linkTo && isTabsVisible && (
178
+ {value && value.linkTo && isTabsVisible && (
179
179
  <S.AnchorWrapper>
180
180
  <FieldsBehavior
181
181
  title="Tab"
@@ -188,7 +188,7 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
188
188
  />
189
189
  </S.AnchorWrapper>
190
190
  )}
191
- {value?.linkTo && isVisible && (
191
+ {value && value.linkTo && isVisible && (
192
192
  <S.AnchorWrapper>
193
193
  <FieldsBehavior
194
194
  title="Anchor"
@@ -203,19 +203,20 @@ const UrlField = (props: IUrlFieldProps): JSX.Element => {
203
203
  )}
204
204
  {showAdvanced && (
205
205
  <S.AdvancedWrapper>
206
- {advancedFields?.map((adField) => {
207
- return (
208
- <FieldsBehavior
209
- key={adField.name}
210
- options={adField.options}
211
- name={adField.name}
212
- title={adField.title}
213
- fieldType={adField.type}
214
- value={adField.value}
215
- onChange={adField.onChange}
216
- />
217
- );
218
- })}
206
+ {advancedFields &&
207
+ advancedFields.map((adField) => {
208
+ return (
209
+ <FieldsBehavior
210
+ key={adField.name}
211
+ options={adField.options}
212
+ name={adField.name}
213
+ title={adField.title}
214
+ fieldType={adField.type}
215
+ value={adField.value}
216
+ onChange={adField.onChange}
217
+ />
218
+ );
219
+ })}
219
220
  </S.AdvancedWrapper>
220
221
  )}
221
222
  <FloatingPanel
@@ -17,7 +17,6 @@ import FormCategorySelect from "./FormCategorySelect";
17
17
  import FormContainer from "./FormContainer";
18
18
  import FormFieldArray from "./FormFieldArray";
19
19
  import HeadingField from "./HeadingField";
20
- import SEOPreview from "./SEOPreview";
21
20
  import HiddenField from "./HiddenField";
22
21
  import ImageField from "./ImageField";
23
22
  import LinkField from "./LinkField";
@@ -65,7 +64,6 @@ export {
65
64
  FormContainer,
66
65
  FormFieldArray,
67
66
  HeadingField,
68
- SEOPreview,
69
67
  HiddenField,
70
68
  ImageField,
71
69
  LinkField,
@@ -1,4 +1,4 @@
1
- import { memo, useRef } from "react";
1
+ import React, { memo, useRef } from "react";
2
2
  import { createPortal } from "react-dom";
3
3
 
4
4
  import { useHandleClickOutside } from "@ax/hooks";
@@ -16,13 +16,12 @@ const FloatingPanel = (props: IFloatingPanelProps): JSX.Element | null => {
16
16
  handlePanel,
17
17
  secondary,
18
18
  closeOnOutsideClick = true,
19
- width,
20
19
  } = props;
21
20
 
22
21
  const node = useRef<HTMLElement>(null);
23
22
 
24
23
  const handleClickOutside = (e: any) => {
25
- if (node.current?.contains(e.target) || isOpenedSecond || !closeOnOutsideClick) {
24
+ if ((node.current && node.current.contains(e.target)) || isOpenedSecond || !closeOnOutsideClick) {
26
25
  return;
27
26
  }
28
27
  toggleModal();
@@ -47,7 +46,6 @@ const FloatingPanel = (props: IFloatingPanelProps): JSX.Element | null => {
47
46
  isOpen={isOpen}
48
47
  isOpenedSecond={isOpenedSecond}
49
48
  secondary={secondary}
50
- width={width}
51
49
  >
52
50
  <S.Header>
53
51
  <S.Title>{title}</S.Title>
@@ -72,7 +70,6 @@ export interface IFloatingPanelProps {
72
70
  handlePanel?: (value: boolean) => void;
73
71
  secondary?: boolean;
74
72
  closeOnOutsideClick?: boolean;
75
- width?: number;
76
73
  }
77
74
 
78
75
  export default memo(FloatingPanel);
@@ -17,13 +17,12 @@ export const Wrapper = styled.section<{
17
17
  isOpen: boolean;
18
18
  isOpenedSecond: boolean | undefined;
19
19
  secondary?: boolean;
20
- width?: number;
21
20
  }>`
22
21
  position: fixed;
23
22
  right: 0;
24
23
  top: 0;
25
24
  z-index: 1200;
26
- width: ${(p) => (p.width ? `${p.width}px` : `calc(${p.theme.spacing.xl} * 6)`)};
25
+ width: calc(${(p) => p.theme.spacing.xl} * 6);
27
26
  height: 100vh;
28
27
  background: ${(p) => p.theme.colors.uiBackground01};
29
28
  box-shadow: ${(p) => (p.secondary || !p.isOpen ? `none` : p.theme.shadow.rightPanel)};
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { Icon } from "@ax/components";
2
3
 
3
4
  import * as S from "./style";
@@ -19,7 +20,6 @@ const IconAction = (props: IIconActionProps): JSX.Element => {
19
20
  size={size}
20
21
  inversed={inversed}
21
22
  active={active}
22
- tabIndex={0}
23
23
  >
24
24
  <S.Icon data-testid={`icon-action-${icon}`}>
25
25
  <Icon name={icon} />
@@ -190,7 +190,6 @@ const AppBar = (props: IProps): JSX.Element => {
190
190
  setSelectedTab={tabs.action}
191
191
  isInAppBar={true}
192
192
  inversed={inversed}
193
- disabled={tabs.disabled}
194
193
  />
195
194
  </S.TabsContent>
196
195
  </S.WrapperTabs>
@@ -292,13 +291,7 @@ export interface IAppBarProps {
292
291
  backLink?: boolean | string;
293
292
  rightButton?: { label: string; disabled?: boolean; action: (e: any) => void };
294
293
  rightLineButton?: { label: string; disabled?: boolean; action: (e: any) => void };
295
- tabs?: {
296
- tabSet?: any;
297
- icons?: { name: string; text: string }[];
298
- selectedTab: string;
299
- action: (e: any) => void;
300
- disabled?: boolean;
301
- };
294
+ tabs?: { tabSet?: any; icons?: { name: string; text: string }[]; selectedTab: string; action: (e: any) => void };
302
295
  downArrowMenu?: { displayed: boolean; options: any; button: any };
303
296
  title: string;
304
297
  subtitle?: string;
@@ -38,13 +38,7 @@ export interface IWrapperProps {
38
38
  fixedAppBar?: boolean;
39
39
  additionalClass?: string;
40
40
  downArrowMenu?: { displayed: boolean; options: any; button: any };
41
- tabs?: {
42
- tabSet?: any;
43
- icons?: { name: string; text: string }[];
44
- selectedTab: string;
45
- action: (e: any) => void;
46
- disabled?: boolean;
47
- };
41
+ tabs?: { tabSet?: any; icons?: { name: string; text: string }[]; selectedTab: string; action: (e: any) => void };
48
42
  pageStatus?: string;
49
43
  language?: { locale: string; id: number | null } | null;
50
44
  availableLanguages?: ILanguage[];
@@ -1,4 +1,4 @@
1
- import { useState } from "react";
1
+ import React, { useState } from "react";
2
2
  import { Icon } from "@ax/components";
3
3
  import SubNotification from "./SubNotification";
4
4
 
@@ -45,7 +45,7 @@ const Notification = (props: INotificationProps): JSX.Element => {
45
45
  const handleClick = () => (onClick ? onClick() : handleErrorClick());
46
46
 
47
47
  const handleClose = () => {
48
- resetError?.();
48
+ resetError && resetError();
49
49
  setIsVisible(false);
50
50
  };
51
51
 
@@ -1,10 +1,11 @@
1
1
  import { createPortal } from "react-dom";
2
+
2
3
  import { Icon } from "@ax/components";
3
4
 
4
5
  import * as S from "./style";
5
6
 
6
7
  const OcassionalToast = (props: IOcassionalToastProps): JSX.Element => {
7
- const { message, icon = "alert" } = props;
8
+ const { message, icon = "alert", onDismiss } = props;
8
9
 
9
10
  return createPortal(
10
11
  <S.Wrapper data-testid="occasional-toast-wrapper">
@@ -12,6 +13,11 @@ const OcassionalToast = (props: IOcassionalToastProps): JSX.Element => {
12
13
  <Icon name={icon} />
13
14
  </S.IconWrapper>
14
15
  <S.Text data-testid="occasional-toast-message">{message}</S.Text>
16
+ {onDismiss && (
17
+ <S.DismissButton type="button" onClick={onDismiss}>
18
+ <Icon name="close" size="16px" />
19
+ </S.DismissButton>
20
+ )}
15
21
  </S.Wrapper>,
16
22
  document.body,
17
23
  );
@@ -20,6 +26,7 @@ const OcassionalToast = (props: IOcassionalToastProps): JSX.Element => {
20
26
  export interface IOcassionalToastProps {
21
27
  message: string | React.ReactNode;
22
28
  icon?: string;
29
+ onDismiss?: () => void;
23
30
  }
24
31
 
25
32
  export default OcassionalToast;
@@ -37,4 +37,18 @@ const IconWrapper = styled.div`
37
37
  }
38
38
  `;
39
39
 
40
- export { Wrapper, Text, IconWrapper };
40
+ const DismissButton = styled.button`
41
+ background: none;
42
+ border: none;
43
+ svg {
44
+ path {
45
+ fill: ${(p) => p.theme.color.textHighEmphasisInverse};
46
+ }
47
+ }
48
+ cursor: pointer;
49
+ margin-left: ${(p) => p.theme.spacing.xs};
50
+ display: flex;
51
+ align-items: center;
52
+ `;
53
+
54
+ export { Wrapper, Text, IconWrapper, DismissButton };
@@ -120,7 +120,7 @@ const PageFinder = (props: IPageFinderProps): JSX.Element => {
120
120
  if (isReqOk(response.status)) {
121
121
  setState((state) => ({ ...state, items: response.data.items, totalItems: response.data.totalItems }));
122
122
  } else {
123
- console.error("Error en getAndSetItems");
123
+ console.log("Error en getAndSetItems");
124
124
  }
125
125
  setIsLoading(false);
126
126
  };
@@ -4,10 +4,10 @@ import ResizeHandle from "./ResizeHandle";
4
4
 
5
5
  import * as S from "./style";
6
6
 
7
- const MIN_WIDTH = 368;
7
+ const MIN_WIDTH = 344;
8
8
 
9
9
  const ResizePanel = (props: IResizePanelProps): JSX.Element => {
10
- const { leftPanel, rightPanel, fixed = true, full = false, disabled } = props;
10
+ const { leftPanel, rightPanel, fixed = true, full = false } = props;
11
11
 
12
12
  const [rwidth, setRwidth] = useState(MIN_WIDTH);
13
13
  const rightPanelRef = useRef<HTMLDivElement>(null);
@@ -44,7 +44,7 @@ const ResizePanel = (props: IResizePanelProps): JSX.Element => {
44
44
  leftPanel
45
45
  )}
46
46
  </S.LeftPanel>
47
- {!disabled && <ResizeHandle onMouseMove={resize} />}
47
+ <ResizeHandle onMouseMove={resize} />
48
48
  <S.RightPanel ref={rightPanelRef} data-testid="right-panel" style={{ width: rwidth ? `${rwidth}px` : "auto" }}>
49
49
  {rightPanel}
50
50
  </S.RightPanel>
@@ -57,7 +57,6 @@ export interface IResizePanelProps {
57
57
  rightPanel: JSX.Element | JSX.Element[];
58
58
  fixed?: boolean;
59
59
  full?: boolean;
60
- disabled?: boolean;
61
60
  }
62
61
 
63
62
  export default ResizePanel;
@@ -11,7 +11,7 @@ const RightPanel = styled.section`
11
11
  position: relative;
12
12
  padding: ${(p) => `0 ${p.theme.spacing.m} ${p.theme.spacing.m} ${p.theme.spacing.m}`};
13
13
  flex-shrink: 0;
14
- min-width: 368px;
14
+ min-width: 344px;
15
15
  max-width: ${(p) => `calc(100% - 500px - ${p.theme.spacing.m})`};
16
16
  flex-direction: column;
17
17
  `;
@@ -1,6 +1,6 @@
1
- import styled from "styled-components";
1
+ import { Button } from "@ax/components";
2
2
 
3
- import Button from "../Button";
3
+ import styled from "styled-components";
4
4
 
5
5
  const Wrapper = styled.div`
6
6
  display: flex;
@@ -140,7 +140,6 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
140
140
 
141
141
  const filteredOptions = options.options?.map((option) => {
142
142
  const optionComponent = typeof option === "string" ? option : option.component;
143
- const optionKey = typeof option === "string" ? option : (option.id ?? option.editorID ?? optionComponent);
144
143
  const displayName = getDisplayName(optionComponent);
145
144
  if (searchQuery.length > 0) {
146
145
  const name = displayName.toLowerCase();
@@ -148,7 +147,7 @@ const SideModal = (props: ISideModalProps): JSX.Element | null => {
148
147
  if (!name.includes(search)) return null;
149
148
  }
150
149
  return (
151
- <SideModalOption option={option} handleClick={handleClick} key={optionKey} theme={theme}>
150
+ <SideModalOption option={option} handleClick={handleClick} key={optionComponent} theme={theme}>
152
151
  {displayName}
153
152
  </SideModalOption>
154
153
  );
@@ -1,10 +1,10 @@
1
- import { useEffect } from "react";
1
+ import React, { useEffect } from "react";
2
2
  import { Icon, Tooltip } from "@ax/components";
3
3
 
4
4
  import * as S from "./style";
5
5
 
6
6
  const Tabs = (props: ITabsProps): JSX.Element => {
7
- const { tabs, icons, active, setSelectedTab, isInAppBar, noMargins, inversed, disabled } = props;
7
+ const { tabs, icons, active, setSelectedTab, isInAppBar, noMargins, inversed } = props;
8
8
 
9
9
  useEffect(() => {
10
10
  tabs && tabs.length === 1 && setSelectedTab(tabs[0]);
@@ -14,10 +14,7 @@ const Tabs = (props: ITabsProps): JSX.Element => {
14
14
  return (
15
15
  <S.TabsRow isInAppBar={isInAppBar} noMargins={noMargins} data-testid="tabs-row">
16
16
  {tabs.map((tab: any) => {
17
- const handleClick = () => {
18
- if (disabled) return;
19
- setSelectedTab(tab);
20
- };
17
+ const handleClick = () => setSelectedTab(tab);
21
18
  return (
22
19
  <S.TabItem
23
20
  isInAppBar={isInAppBar}
@@ -25,7 +22,6 @@ const Tabs = (props: ITabsProps): JSX.Element => {
25
22
  active={tab === active}
26
23
  onClick={handleClick}
27
24
  data-testid="tab"
28
- isDisabled={disabled}
29
25
  >
30
26
  {tab}
31
27
  </S.TabItem>
@@ -39,17 +35,13 @@ const Tabs = (props: ITabsProps): JSX.Element => {
39
35
  return (
40
36
  <S.TabsRow icons={true} isInAppBar={isInAppBar} data-testid="icons-tabs-row">
41
37
  {icons.map((tab: ITabIcon) => {
42
- const handleClick = () => {
43
- if (disabled) return;
44
- setSelectedTab(tab.name);
45
- };
38
+ const handleClick = () => setSelectedTab(tab.name);
46
39
  return (
47
40
  <S.TabItem
48
41
  key={tab.name}
49
42
  active={tab.name === active}
50
43
  onClick={handleClick}
51
44
  inversed={inversed}
52
- isDisabled={disabled}
53
45
  data-testid="icon-tab"
54
46
  >
55
47
  <S.TabIcon>
@@ -75,7 +67,6 @@ export interface ITabsProps {
75
67
  setSelectedTab: any;
76
68
  noMargins?: boolean;
77
69
  inversed?: boolean;
78
- disabled?: boolean;
79
70
  }
80
71
 
81
72
  export interface ITabIcon {
@@ -8,14 +8,15 @@ const TabsRow = styled.div<{ icons?: boolean; isInAppBar?: boolean; noMargins?:
8
8
  height: ${(p) => (p.noMargins || p.isInAppBar ? "auto" : "100%")};
9
9
  `;
10
10
 
11
- const TabItem = styled.button<{ active: boolean; isInAppBar?: boolean; inversed?: boolean; isDisabled?: boolean }>`
11
+ const TabItem = styled.button<{ active: boolean; isInAppBar?: boolean; inversed?: boolean }>`
12
12
  flex-grow: 1;
13
- ${(p) => p.theme.textStyle.headingXS};
14
13
  border: none;
15
- border-bottom: ${(p) => (p.active ? "4px solid" : "none")};
16
- border-color: ${(p) => (p.isDisabled ? p.theme.color.interactiveDisabled : p.inversed ? p.theme.color.iconHighEmphasisInverse : p.theme.color.interactive01)};
14
+ border-bottom: 4px solid
15
+ ${(p) =>
16
+ !p.active ? "transparent" : p.inversed ? p.theme.color.iconHighEmphasisInverse : p.theme.color.interactive01};
17
+ ${(p) => p.theme.textStyle.headingXS};
17
18
  color: ${(p) => (p.active ? p.theme.color.textHighEmphasis : p.theme.color.textMediumEmphasis)};
18
- cursor: ${(p) => (p.active || p.isDisabled ? "initial" : "pointer")};
19
+ cursor: ${(p) => (p.active ? "initial" : "pointer")};
19
20
  background: transparent;
20
21
  height: ${(p) => (p.isInAppBar ? "100%" : "48px")};
21
22
 
@@ -23,7 +24,7 @@ const TabItem = styled.button<{ active: boolean; isInAppBar?: boolean; inversed?
23
24
  color: ${(p) => (p.active ? p.theme.color.textHighEmphasis : p.theme.color.interactive01)};
24
25
  svg {
25
26
  path {
26
- fill: ${(p) => (p.isDisabled ? p.theme.color.interactiveDisabled : p.inversed ? p.theme.color.iconHighEmphasisInverse : p.theme.color.interactive01)};
27
+ fill: ${(p) => (p.inversed ? p.theme.color.iconHighEmphasisInverse : p.theme.color.interactive01)};
27
28
  }
28
29
  }
29
30
  }
@@ -38,7 +39,7 @@ const TabItem = styled.button<{ active: boolean; isInAppBar?: boolean; inversed?
38
39
  height: ${(p) => p.theme.spacing.m};
39
40
  path {
40
41
  fill: ${(p) =>
41
- !p.active || p.isDisabled
42
+ !p.active
42
43
  ? p.theme.color.interactiveDisabled
43
44
  : p.inversed
44
45
  ? p.theme.color.iconHighEmphasisInverse
@@ -1,4 +1,4 @@
1
- import { useRef, useEffect } from "react";
1
+ import React, { useRef, useEffect } from "react";
2
2
  import { useLocation } from "react-router-dom";
3
3
 
4
4
  import { createPortal } from "react-dom";
@@ -14,9 +14,7 @@ const Toast = (props: IToastProps): JSX.Element => {
14
14
  const isEditor = pathname.includes("/editor");
15
15
 
16
16
  let temp: NodeJS.Timeout;
17
- const setTemp = (time: number) => {
18
- temp = setTimeout(() => setIsVisible(false), time);
19
- };
17
+ const setTemp = (time: number) => (temp = setTimeout(() => setIsVisible(false), time));
20
18
 
21
19
  const close = () => {
22
20
  if (toast.current) {
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from "react";
1
2
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
2
3
 
3
4
  import { useHandleClickOutside } from "@ax/hooks";
@@ -5,7 +6,7 @@ import { useHandleClickOutside } from "@ax/hooks";
5
6
  import * as S from "./style";
6
7
 
7
8
  const Tooltip = (props: ITooltipProps) => {
8
- const { content, children, hideOnClick = true, bottom, left, expanded, top, className } = props;
9
+ const { content, children, hideOnClick = true, bottom, left, expanded, top } = props;
9
10
 
10
11
  const initialState: IState = {
11
12
  active: false,
@@ -99,7 +100,6 @@ const Tooltip = (props: ITooltipProps) => {
99
100
  onMouseLeave={hideTip}
100
101
  onMouseDown={handleClick}
101
102
  expanded={expanded}
102
- className={className}
103
103
  >
104
104
  <div ref={childrenRef}>{children}</div>
105
105
  <S.Tip
@@ -127,14 +127,13 @@ interface IState {
127
127
  }
128
128
 
129
129
  export interface ITooltipProps {
130
- content?: React.ReactNode;
130
+ content?: string | boolean | JSX.Element[] | JSX.Element;
131
131
  children: any;
132
132
  hideOnClick?: boolean;
133
133
  bottom?: boolean;
134
134
  left?: number;
135
135
  expanded?: boolean;
136
136
  top?: number;
137
- className?: string;
138
137
  }
139
138
 
140
139
  export default Tooltip;
@@ -45,7 +45,6 @@ import {
45
45
  RadioGroup,
46
46
  ReferenceField,
47
47
  RichText,
48
- SEOPreview,
49
48
  Select,
50
49
  SummaryButton,
51
50
  TextArea,
@@ -65,16 +64,13 @@ import FilterTagsBar from "./FilterTagsBar";
65
64
  import Flag from "./Flag";
66
65
  import FloatingButton from "./FloatingButton";
67
66
  import FloatingMenu from "./FloatingMenu";
68
- import FloatingNote from "./FloatingNote";
69
67
  import FloatingPanel from "./FloatingPanel";
70
68
  import Gallery from "./Gallery";
71
69
  import GuardModal from "./GuardModal";
72
- import HeadingsPreviewModal from "./HeadingsPreviewModal";
73
70
  import Icon from "./Icon";
74
71
  import IconAction from "./IconAction";
75
72
  import Image from "./Image";
76
73
  import InformativeMenu from "./InformativeMenu";
77
- import KeywordsPreviewModal from "./KeywordsPreviewModal";
78
74
  import LanguageMenu from "./LanguageMenu";
79
75
  import { ListItem, ListTitle } from "./Lists";
80
76
  import Loader from "./Loader";
@@ -88,7 +84,6 @@ import Nav from "./Nav";
88
84
  import Notification from "./Notification";
89
85
  import OcassionalToast from "./OcassionalToast";
90
86
  import PageFinder from "./PageFinder";
91
- import PageInfoBanner from "./PageInfoBanner";
92
87
  import Pagination from "./Pagination";
93
88
  import ProgressBar from "./ProgressBar";
94
89
  import ReorderArrows from "./ReorderArrows";
@@ -169,14 +164,12 @@ export {
169
164
  Flag,
170
165
  FloatingButton,
171
166
  FloatingMenu,
172
- FloatingNote,
173
167
  FloatingPanel,
174
168
  FormCategorySelect,
175
169
  FormContainer,
176
170
  FormFieldArray,
177
171
  Gallery,
178
172
  GuardModal,
179
- HeadingsPreviewModal,
180
173
  HeadingField,
181
174
  HiddenField,
182
175
  Icon,
@@ -184,7 +177,6 @@ export {
184
177
  Image,
185
178
  ImageField,
186
179
  InformativeMenu,
187
- KeywordsPreviewModal,
188
180
  IntegrationsField,
189
181
  LanguageMenu,
190
182
  LastAccessFilter,
@@ -206,7 +198,6 @@ export {
206
198
  NumberField,
207
199
  OcassionalToast,
208
200
  PageFinder,
209
- PageInfoBanner,
210
201
  Pagination,
211
202
  PermissionsFilter,
212
203
  ProgressBar,
@@ -222,7 +213,6 @@ export {
222
213
  SearchField,
223
214
  SearchTagsBar,
224
215
  Select,
225
- SEOPreview,
226
216
  SharePageModal,
227
217
  SideModal,
228
218
  SiteFilter,