@flozy/editor 8.0.6 → 8.0.7

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 (131) hide show
  1. package/dist/Editor/ChatEditor.js +1 -2
  2. package/dist/Editor/CommonEditor.js +33 -112
  3. package/dist/Editor/DialogWrapper.js +25 -31
  4. package/dist/Editor/Editor.css +16 -32
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  6. package/dist/Editor/Elements/Button/EditorButton.js +9 -25
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +12 -57
  8. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  10. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  11. package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +1 -4
  12. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
  13. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +1 -6
  14. package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +9 -19
  15. package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +2 -32
  16. package/dist/Editor/Elements/DataView/Layouts/TableView.js +29 -126
  17. package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
  18. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  19. package/dist/Editor/Elements/DataView/styles.js +8 -8
  20. package/dist/Editor/Elements/Embed/Image.js +2 -2
  21. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -0
  22. package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +1 -2
  23. package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -2
  24. package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
  25. package/dist/Editor/Elements/Grid/GridItem.js +3 -2
  26. package/dist/Editor/Elements/Link/Link.js +43 -70
  27. package/dist/Editor/Elements/SimpleText/index.js +12 -7
  28. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  29. package/dist/Editor/Elements/Table/Table.js +16 -17
  30. package/dist/Editor/Elements/Table/TableCell.js +3 -4
  31. package/dist/Editor/Elements/Title/title.js +1 -13
  32. package/dist/Editor/Elements/Variables/Style.js +2 -28
  33. package/dist/Editor/Elements/Variables/VariableButton.js +4 -17
  34. package/dist/Editor/Styles/EditorStyles.js +291 -287
  35. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
  36. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
  37. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  38. package/dist/Editor/Toolbar/FormatTools/TextSize.js +15 -7
  39. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +0 -1
  40. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +8 -9
  41. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
  42. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +85 -210
  43. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
  44. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -16
  45. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +9 -56
  46. package/dist/Editor/Toolbar/PopupTool/index.js +56 -34
  47. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  48. package/dist/Editor/common/ColorPickerButton.js +9 -35
  49. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  50. package/dist/Editor/common/DnD/Draggable.js +1 -0
  51. package/dist/Editor/common/FontLoader/FontList.js +11 -3
  52. package/dist/Editor/common/FontLoader/FontLoader.js +42 -74
  53. package/dist/Editor/common/Icon.js +0 -28
  54. package/dist/Editor/common/ImageSelector/Options/Upload.js +2 -2
  55. package/dist/Editor/common/ImageSelector/Styles.js +9 -3
  56. package/dist/Editor/common/ImageSelector/UploadStyles.js +10 -9
  57. package/dist/Editor/common/LinkSettings/NavComponents.js +5 -0
  58. package/dist/Editor/common/LinkSettings/index.js +5 -0
  59. package/dist/Editor/common/MentionsPopup/Styles.js +12 -6
  60. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +1 -2
  61. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
  62. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
  63. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
  64. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
  65. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
  66. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
  67. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
  68. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
  69. package/dist/Editor/common/RnD/ElementSettings/styles.js +2 -0
  70. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +2 -8
  71. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
  72. package/dist/Editor/common/RnD/Utils/gridDropItem.js +4 -5
  73. package/dist/Editor/common/RnD/Utils/index.js +0 -45
  74. package/dist/Editor/common/RnD/index.js +3 -23
  75. package/dist/Editor/common/Section/index.js +89 -60
  76. package/dist/Editor/common/Shorthands/elements.js +0 -54
  77. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  78. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
  79. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
  80. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  81. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +2 -10
  82. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +11 -35
  83. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  84. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
  85. package/dist/Editor/common/Uploader.js +0 -8
  86. package/dist/Editor/commonStyle.js +69 -114
  87. package/dist/Editor/helper/deserialize/index.js +1 -1
  88. package/dist/Editor/helper/index.js +2 -2
  89. package/dist/Editor/helper/theme.js +2 -200
  90. package/dist/Editor/hooks/useDrag.js +11 -17
  91. package/dist/Editor/hooks/useEditorScroll.js +2 -1
  92. package/dist/Editor/hooks/useMouseMove.js +3 -9
  93. package/dist/Editor/plugins/withEmbeds.js +1 -1
  94. package/dist/Editor/plugins/withHTML.js +21 -20
  95. package/dist/Editor/plugins/withLayout.js +1 -1
  96. package/dist/Editor/plugins/withTable.js +1 -1
  97. package/dist/Editor/theme/ThemeList.js +173 -50
  98. package/dist/Editor/utils/SlateUtilityFunctions.js +49 -157
  99. package/dist/Editor/utils/button.js +14 -0
  100. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -23
  101. package/dist/Editor/utils/draftToSlate.js +2 -3
  102. package/dist/Editor/utils/font.js +37 -40
  103. package/dist/Editor/utils/helper.js +19 -59
  104. package/dist/Editor/utils/link.js +1 -1
  105. package/package.json +3 -6
  106. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  107. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  108. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  109. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  110. package/dist/Editor/common/CustomDialog/index.js +0 -90
  111. package/dist/Editor/common/CustomDialog/style.js +0 -67
  112. package/dist/Editor/common/CustomDialog/styles.js +0 -80
  113. package/dist/Editor/common/CustomSelect.js +0 -33
  114. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
  115. package/dist/Editor/hooks/useEditorTheme.js +0 -153
  116. package/dist/Editor/theme/index.js +0 -144
  117. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  118. package/dist/Editor/themeSettings/buttons/index.js +0 -283
  119. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  120. package/dist/Editor/themeSettings/colorTheme/index.js +0 -292
  121. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  122. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
  123. package/dist/Editor/themeSettings/fonts/index.js +0 -220
  124. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  125. package/dist/Editor/themeSettings/icons.js +0 -60
  126. package/dist/Editor/themeSettings/index.js +0 -320
  127. package/dist/Editor/themeSettings/style.js +0 -152
  128. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  129. package/dist/Editor/themeSettingsAI/index.js +0 -356
  130. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -197
  131. package/dist/Editor/themeSettingsAI/style.js +0 -250
@@ -1,283 +0,0 @@
1
- import React, { useRef, useState } from "react";
2
- import { Accordion, AccordionDetails, AccordionSummary, Button, Fade, Grid, IconButton, Popper, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
-
5
- // Style
6
- import Style from "./style";
7
- import { PenIcon } from "../icons";
8
- import StyleBuilder from "../../common/StyleBuilder";
9
- import { fontOptions } from "../../utils/font";
10
- import { useEditorTheme } from "../../hooks/useEditorTheme";
11
- import { getBreakPointsValue, getElementProperty, getTRBLBreakPoints } from "../../helper/theme";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- import { jsxs as _jsxs } from "react/jsx-runtime";
14
- const buttonStyle = [{
15
- tab: "General",
16
- value: "size",
17
- fields: [{
18
- label: "Font Family",
19
- key: "fontFamily",
20
- type: "textOptions",
21
- options: fontOptions,
22
- webFont: true,
23
- width: 7,
24
- renderOption: option => {
25
- return /*#__PURE__*/_jsx("span", {
26
- style: {
27
- fontFamily: option.value
28
- },
29
- children: option.text
30
- });
31
- }
32
- }, {
33
- label: "Font Size",
34
- key: "textSize",
35
- type: "fontSize",
36
- width: 5,
37
- placeholder: "16px or 1em"
38
- }]
39
- }, {
40
- tab: "Colors",
41
- value: "colors",
42
- fields: [{
43
- label: "Text Color",
44
- key: "textColor",
45
- type: "color",
46
- needPreview: true
47
- }, {
48
- label: "Button Color",
49
- key: "bgColor",
50
- type: "color",
51
- themeEnabled: true
52
- }]
53
- }, {
54
- tab: "Banner Spacing",
55
- value: "bannerSpacing",
56
- fields: [{
57
- label: "Banner Spacing",
58
- key: "bannerSpacing",
59
- type: "bannerSpacing"
60
- }]
61
- }, {
62
- tab: "Border",
63
- value: "border",
64
- fields: [{
65
- label: "Border Radius",
66
- key: "borderRadius",
67
- type: "borderRadius"
68
- }]
69
- }, {
70
- tab: "Hover Colors",
71
- value: "hoverColors",
72
- fields: [{
73
- label: "Hover Text Color",
74
- key: "textColorHover",
75
- type: "color",
76
- needPreview: true
77
- }, {
78
- label: "Hover Button Color",
79
- key: "bgColorHover",
80
- type: "color"
81
- }]
82
- }];
83
- function getBtnSxProps(buttonStyle = {}) {
84
- const newStyle = {
85
- ...buttonStyle
86
- };
87
- if (newStyle?.bannerSpacing) {
88
- newStyle.padding = newStyle?.bannerSpacing;
89
- }
90
- newStyle.borderRadius = {
91
- ...getBreakPointsValue(newStyle?.borderRadius || {}, null, "overrideBorderRadius", true)
92
- };
93
- newStyle.padding = {
94
- ...getTRBLBreakPoints(newStyle?.bannerSpacing || {})
95
- };
96
- delete newStyle?.bannerSpacing;
97
- if (newStyle?.hover) {
98
- newStyle["&:hover"] = newStyle.hover;
99
- delete newStyle.hover;
100
- }
101
- return newStyle;
102
- }
103
- const MAP_HOVER_KEYS = {
104
- color: "textColorHover",
105
- background: "bgColorHover"
106
- };
107
- const MAP_THEME_TO_ELEMENT_KEYS = {
108
- color: "textColor",
109
- background: "bgColor",
110
- fontFamily: (value, prev, buttonEl) => {
111
- if (!buttonEl?.current) {
112
- return prev;
113
- }
114
- const val = getElementProperty(buttonEl?.current, "font-family");
115
- return {
116
- ...prev,
117
- fontFamily: val
118
- };
119
- },
120
- fontSize: "textSize",
121
- borderRadius: "borderRadius",
122
- bannerSpacing: "bannerSpacing",
123
- lockRadius: "lockRadius",
124
- lockbannerSpacing: "lockbannerSpacing",
125
- // fontWeight
126
-
127
- hover: (value = {}, prev = {}) => {
128
- const props = getProps(value, MAP_HOVER_KEYS);
129
- return {
130
- ...prev,
131
- ...props
132
- };
133
- }
134
- };
135
- const MAP_ELEMENT_TO_THEME_KEYS = {
136
- textSize: "fontSize",
137
- textColor: "color",
138
- bgColor: "background",
139
- bannerSpacing: "bannerSpacing",
140
- borderRadius: "borderRadius",
141
- lockRadius: "lockRadius",
142
- lockbannerSpacing: "lockbannerSpacing",
143
- textColorHover: (value, prev) => {
144
- const hover = {
145
- ...(prev?.hover || {})
146
- };
147
- hover.color = value;
148
- return {
149
- ...prev,
150
- hover
151
- };
152
- },
153
- bgColorHover: (value, prev) => {
154
- const hover = {
155
- ...(prev?.hover || {})
156
- };
157
- hover.background = value;
158
- return {
159
- ...prev,
160
- hover
161
- };
162
- },
163
- fontFamily: "fontFamily"
164
- };
165
- function getProps(buttonStyle, MAP_KEYS, buttonEl) {
166
- let props = {};
167
- Object.entries(buttonStyle).forEach(([key, value]) => {
168
- const elementKey = MAP_KEYS[key];
169
- if (elementKey) {
170
- if (typeof elementKey === "string") {
171
- props[elementKey] = value;
172
- } else {
173
- props = elementKey(value, props, buttonEl);
174
- }
175
- }
176
- });
177
- return props;
178
- }
179
- function convertThemeToElementProps(button = {}, buttonEl) {
180
- const props = getProps(button, MAP_THEME_TO_ELEMENT_KEYS, buttonEl);
181
- return props;
182
- }
183
-
184
- // icons
185
-
186
- const Buttons = props => {
187
- const {
188
- className
189
- } = props;
190
- const [anchorEl, setAnchorEl] = useState();
191
- const {
192
- selectedTheme,
193
- updateTheme
194
- } = useEditorTheme();
195
- const {
196
- button
197
- } = selectedTheme?.elementProps || {};
198
- const buttonEl = useRef();
199
- const elementProps = convertThemeToElementProps(button, buttonEl);
200
-
201
- // State
202
- return /*#__PURE__*/_jsxs(Grid, {
203
- className: className,
204
- children: [/*#__PURE__*/_jsxs(Accordion, {
205
- className: "settingAccordion",
206
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
207
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
208
- "aria-controls": "panel1-content",
209
- id: "panel1-header",
210
- children: "Buttons"
211
- }), /*#__PURE__*/_jsx(AccordionDetails, {
212
- children: /*#__PURE__*/_jsxs(Grid, {
213
- container: true,
214
- className: "buttonTypeItem",
215
- justifyContent: "space-between",
216
- alignItems: "center",
217
- wrap: "nowrap",
218
- onClick: e => setAnchorEl(e.currentTarget),
219
- children: [/*#__PURE__*/_jsxs(Grid, {
220
- item: true,
221
- style: {
222
- maxWidth: "calc(100% - 50px)",
223
- overflowX: "auto"
224
- },
225
- children: [/*#__PURE__*/_jsx(Typography, {
226
- variant: "body1",
227
- className: "fw-600 fs-14",
228
- style: {
229
- marginBottom: "10px"
230
- },
231
- children: "Primary Button"
232
- }), /*#__PURE__*/_jsx(Button, {
233
- sx: getBtnSxProps(button),
234
- ref: buttonEl,
235
- children: "Button"
236
- })]
237
- }), /*#__PURE__*/_jsx(IconButton, {
238
- className: "editIcon",
239
- children: /*#__PURE__*/_jsx(PenIcon, {})
240
- })]
241
- })
242
- })]
243
- }), /*#__PURE__*/_jsx(Popper, {
244
- open: Boolean(anchorEl),
245
- anchorEl: anchorEl,
246
- transition: true,
247
- sx: {
248
- zIndex: "100000",
249
- background: "white"
250
- },
251
- placement: "left-start",
252
- children: ({
253
- TransitionProps
254
- }) => /*#__PURE__*/_jsx(Fade, {
255
- ...TransitionProps,
256
- timeout: 350,
257
- children: /*#__PURE__*/_jsx("div", {
258
- children: /*#__PURE__*/_jsx(StyleBuilder, {
259
- title: "Button",
260
- type: "buttonStyle",
261
- element: elementProps,
262
- onSave: data => {
263
- const props = getProps(data, MAP_ELEMENT_TO_THEME_KEYS);
264
- updateTheme(props, {
265
- action: "ELEMENT_PROPS_CHANGE",
266
- fieldName: "button"
267
- });
268
- setAnchorEl(null);
269
- },
270
- onClose: () => {
271
- setAnchorEl(null);
272
- },
273
- renderTabs: buttonStyle,
274
- customProps: {
275
- disableEditTheme: true
276
- }
277
- })
278
- })
279
- })
280
- })]
281
- });
282
- };
283
- export default styled(Buttons)(Style);
@@ -1,21 +0,0 @@
1
- const Style = () => ({
2
- ".buttonTypeItem": {
3
- padding: "8px 10px",
4
- width: "calc(100% + 20px)",
5
- margin: "0 -10px",
6
- "&:hover": {
7
- background: "#ECF2FF",
8
- ".editIcon": {
9
- opacity: "1",
10
- visibility: "visible"
11
- }
12
- },
13
- ".editIcon": {
14
- opacity: "0",
15
- visibility: "hidden",
16
- width: "30px",
17
- height: "30px"
18
- }
19
- }
20
- });
21
- export default Style;
@@ -1,292 +0,0 @@
1
- import React from "react";
2
- import { Accordion, AccordionDetails, AccordionSummary, Divider, FormControlLabel, Grid, IconButton, Radio, RadioGroup, ToggleButton, ToggleButtonGroup, Typography, styled } from "@mui/material";
3
- import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
4
-
5
- // Style
6
- import Style from "./style";
7
-
8
- // icons
9
- import { ChevronLeft } from "@mui/icons-material";
10
- import { EditIcon } from "../icons";
11
- import ColorPickerButton from "../../common/ColorPickerButton";
12
- import { getContrastColor } from "../../utils/helper";
13
- import { jsx as _jsx } from "react/jsx-runtime";
14
- import { jsxs as _jsxs } from "react/jsx-runtime";
15
- const ColorTheme = props => {
16
- const {
17
- className,
18
- colors,
19
- onColorChange,
20
- openDefault
21
- } = props;
22
- const {
23
- primaryColors,
24
- otherColors = []
25
- } = colors || {};
26
-
27
- // State
28
- const [customizeTheme, setCustomizeTheme] = React.useState(false);
29
- const [buttonType, setButtonType] = React.useState("regular");
30
- const customTheme = [{
31
- title: "Text & Line Colors",
32
- data: [{
33
- title: "Headings",
34
- color: "#ccc"
35
- }, {
36
- title: "Subheading text",
37
- color: "#ccc"
38
- }, {
39
- title: "Body text",
40
- color: "#ccc"
41
- }, {
42
- title: "Subtext",
43
- color: "#ccc"
44
- }, {
45
- title: "Lines & dividers",
46
- color: "#ccc"
47
- }]
48
- }, {
49
- title: "Background Colors",
50
- data: [{
51
- title: "Primary background color",
52
- color: "#ccc"
53
- }, {
54
- title: "Secondary background color",
55
- color: "#ccc"
56
- }]
57
- }];
58
- const buttonData = [{
59
- title: "Button background",
60
- color: "#ccc"
61
- }, {
62
- title: "Button text",
63
- color: "#ccc"
64
- }, {
65
- title: "Button border",
66
- color: "#ccc"
67
- }];
68
-
69
- //button
70
- const handleButtonType = (event, buttonType) => {
71
- if (buttonType !== null) {
72
- setButtonType(buttonType);
73
- }
74
- };
75
- return /*#__PURE__*/_jsx(Grid, {
76
- className: className,
77
- children: !customizeTheme ? /*#__PURE__*/_jsxs(Accordion, {
78
- className: "settingAccordion",
79
- defaultExpanded: openDefault,
80
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
81
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreIcon, {}),
82
- "aria-controls": "panel1-content",
83
- id: "panel1-header",
84
- children: "Color Theme"
85
- }), /*#__PURE__*/_jsxs(AccordionDetails, {
86
- children: [/*#__PURE__*/_jsx(Typography, {
87
- variant: "body2",
88
- sx: {
89
- pb: 1
90
- },
91
- className: "fs-12 fw-600",
92
- children: "Primary Color"
93
- }), /*#__PURE__*/_jsx(Grid, {
94
- container: true,
95
- spacing: 1,
96
- sx: {
97
- pb: 2
98
- },
99
- className: "primaryColorBoxes",
100
- wrap: "nowrap",
101
- children: primaryColors?.map((color, i) => {
102
- const textColor = getContrastColor(color);
103
- return /*#__PURE__*/_jsx(Grid, {
104
- item: true,
105
- xs: 6,
106
- children: /*#__PURE__*/_jsx(ColorPickerButton, {
107
- onSave: selectedColor => {
108
- onColorChange(selectedColor, i);
109
- },
110
- hideThemeColors: true,
111
- hideGradient: true,
112
- children: /*#__PURE__*/_jsxs(Grid, {
113
- className: "pmBox",
114
- style: {
115
- backgroundColor: color
116
- },
117
- children: [/*#__PURE__*/_jsx(IconButton, {
118
- className: "editBtn",
119
- children: /*#__PURE__*/_jsx(EditIcon, {})
120
- }), /*#__PURE__*/_jsx(Typography, {
121
- variant: "body2",
122
- className: "fs-12 valyeText",
123
- style: {
124
- color: textColor
125
- },
126
- children: color
127
- })]
128
- })
129
- })
130
- }, i);
131
- })
132
- }), /*#__PURE__*/_jsx(Typography, {
133
- variant: "body2",
134
- sx: {
135
- pb: 1
136
- },
137
- className: "fs-12 fw-600",
138
- children: "Secondary Colors"
139
- }), /*#__PURE__*/_jsx(Grid, {
140
- container: true,
141
- className: "secondaryColorBoxes",
142
- wrap: "nowrap",
143
- sx: {
144
- mb: 1
145
- },
146
- children: otherColors?.slice(0, 4)?.map((color, i) => {
147
- const noOfPrimaryColors = 2;
148
- const colorIndex = noOfPrimaryColors + i;
149
- const textColor = getContrastColor(color);
150
- return /*#__PURE__*/_jsx(Grid, {
151
- item: true,
152
- xs: 6,
153
- children: /*#__PURE__*/_jsx(ColorPickerButton, {
154
- onSave: selectedColor => {
155
- onColorChange(selectedColor, colorIndex);
156
- },
157
- hideThemeColors: true,
158
- hideGradient: true,
159
- children: /*#__PURE__*/_jsxs(Grid, {
160
- className: "sdBox",
161
- style: {
162
- backgroundColor: color
163
- },
164
- children: [/*#__PURE__*/_jsx(IconButton, {
165
- className: "editBtn",
166
- children: /*#__PURE__*/_jsx(EditIcon, {})
167
- }), /*#__PURE__*/_jsx(Typography, {
168
- variant: "body2",
169
- className: "fs-12 valyeText",
170
- style: {
171
- color: textColor
172
- },
173
- children: color
174
- })]
175
- })
176
- })
177
- }, i);
178
- })
179
- })]
180
- })]
181
- }) : /*#__PURE__*/_jsxs(Grid, {
182
- className: "sectionDetail",
183
- children: [/*#__PURE__*/_jsxs(Typography, {
184
- variant: "body1",
185
- className: "sectionTitle flexAlign",
186
- children: [/*#__PURE__*/_jsx(IconButton, {
187
- onClick: () => setCustomizeTheme(false),
188
- children: /*#__PURE__*/_jsx(ChevronLeft, {})
189
- }), "Customize Theme settings"]
190
- }), customTheme.map((item, index) => /*#__PURE__*/_jsxs(Grid, {
191
- className: "settingsSection",
192
- children: [/*#__PURE__*/_jsx(Typography, {
193
- variant: "body1",
194
- className: "sectionTitle",
195
- sx: {
196
- pb: 1
197
- },
198
- children: item.title
199
- }), item.data.map((childitem, childIndex) => /*#__PURE__*/_jsxs(Grid, {
200
- container: true,
201
- justifyContent: "space-between",
202
- sx: {
203
- pt: 2
204
- },
205
- children: [/*#__PURE__*/_jsx(Typography, {
206
- variant: "body1",
207
- className: "fs-14",
208
- children: childitem.title
209
- }), /*#__PURE__*/_jsx(Grid, {
210
- className: "xsColorBox",
211
- sx: {
212
- background: childitem.color
213
- }
214
- })]
215
- }, childIndex))]
216
- }, index)), /*#__PURE__*/_jsxs(Grid, {
217
- className: "settingsSection",
218
- children: [/*#__PURE__*/_jsx(Typography, {
219
- variant: "body1",
220
- className: "sectionTitle",
221
- sx: {
222
- pb: 1
223
- },
224
- children: "Button Colors"
225
- }), /*#__PURE__*/_jsxs(ToggleButtonGroup, {
226
- sx: {
227
- mt: 2
228
- },
229
- className: "toggleType",
230
- value: buttonType,
231
- exclusive: true,
232
- onChange: handleButtonType,
233
- children: [/*#__PURE__*/_jsx(ToggleButton, {
234
- value: "regular",
235
- "aria-label": "regulard",
236
- children: "Regular"
237
- }), /*#__PURE__*/_jsx(ToggleButton, {
238
- value: "hover",
239
- "aria-label": "hover",
240
- children: "Hover"
241
- })]
242
- }), /*#__PURE__*/_jsx(Divider, {
243
- sx: {
244
- mt: 2,
245
- mb: 1
246
- }
247
- }), /*#__PURE__*/_jsxs(RadioGroup, {
248
- sx: {
249
- mt: 1
250
- },
251
- "aria-labelledby": "demo-radio-buttons-group-label",
252
- defaultValue: "primary",
253
- name: "radio-buttons-group",
254
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
255
- value: "primary",
256
- control: /*#__PURE__*/_jsx(Radio, {}),
257
- label: /*#__PURE__*/_jsx(Typography, {
258
- variant: "body1",
259
- className: "fs-14",
260
- children: "Primary button"
261
- })
262
- }), /*#__PURE__*/_jsx(FormControlLabel, {
263
- value: "secondary",
264
- control: /*#__PURE__*/_jsx(Radio, {}),
265
- label: /*#__PURE__*/_jsx(Typography, {
266
- variant: "body1",
267
- className: "fs-14",
268
- children: "Secondary button"
269
- })
270
- })]
271
- }), buttonData.map((item, Index) => /*#__PURE__*/_jsxs(Grid, {
272
- container: true,
273
- justifyContent: "space-between",
274
- sx: {
275
- pt: 2
276
- },
277
- children: [/*#__PURE__*/_jsx(Typography, {
278
- variant: "body1",
279
- className: "fs-14",
280
- children: item.title
281
- }), /*#__PURE__*/_jsx(Grid, {
282
- className: "xsColorBox",
283
- sx: {
284
- background: item.color
285
- }
286
- })]
287
- }, Index))]
288
- })]
289
- })
290
- });
291
- };
292
- export default styled(ColorTheme)(Style);
@@ -1,77 +0,0 @@
1
- const Style = () => ({
2
- ".primaryColorBoxes": {
3
- ".pmBox": {
4
- border: "1px solid #D1D1D1",
5
- height: "65px",
6
- borderRadius: "4px",
7
- position: "relative",
8
- flexShrink: 0,
9
- "&:hover": {
10
- ".editBtn": {
11
- opacity: "1",
12
- visibility: "visible"
13
- }
14
- }
15
- }
16
- },
17
- ".secondaryColorBoxes": {
18
- gap: "10px",
19
- ".sdBox": {
20
- border: "1px solid #D1D1D1",
21
- height: "60px",
22
- borderRadius: "4px",
23
- width: "100%",
24
- flexShrink: 0,
25
- position: "relative",
26
- "&:hover": {
27
- ".editBtn": {
28
- opacity: "1",
29
- visibility: "visible"
30
- }
31
- }
32
- }
33
- },
34
- ".valyeText": {
35
- position: "absolute",
36
- right: "5px",
37
- bottom: "5px"
38
- },
39
- ".editBtn": {
40
- position: "absolute",
41
- right: "2px",
42
- top: "2px",
43
- padding: "2px",
44
- opacity: "0",
45
- visibility: "hidden"
46
- },
47
- ".settingsSection": {
48
- background: "#FFFFFF",
49
- border: "1px solid #E4E6E9",
50
- padding: "12px",
51
- marginTop: "10px",
52
- borderRadius: "7px"
53
- },
54
- ".toggleType": {
55
- width: "100%",
56
- border: "1px solid #2563EB",
57
- background: "#F5F6F9",
58
- borderRadius: "8px",
59
- padding: "3px",
60
- height: "40px",
61
- ".MuiToggleButton-root": {
62
- padding: "10px",
63
- width: "50%",
64
- border: "none",
65
- textTransform: "unset",
66
- fontSize: "14px",
67
- color: "#64748B",
68
- "&.Mui-selected": {
69
- borderRadius: "8px",
70
- background: "#2563EB",
71
- color: "#fff",
72
- fontWeight: "700"
73
- }
74
- }
75
- }
76
- });
77
- export default Style;