@flozy/editor 10.2.4 → 10.2.6

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 (32) hide show
  1. package/dist/Editor/CommonEditor.js +11 -0
  2. package/dist/Editor/Elements/Accordion/Accordion.js +27 -8
  3. package/dist/Editor/Elements/Accordion/AccordionSummary.js +1 -23
  4. package/dist/Editor/Elements/AppHeader/AppHeader.js +7 -2
  5. package/dist/Editor/Elements/Button/EditorButton.js +6 -4
  6. package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +26 -26
  7. package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +8 -8
  8. package/dist/Editor/Elements/Form/Form.js +1 -3
  9. package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +0 -1
  10. package/dist/Editor/Elements/Table/TableCell.js +7 -3
  11. package/dist/Editor/common/Checkbox/index.js +46 -0
  12. package/dist/Editor/common/Checkbox/styles.js +45 -0
  13. package/dist/Editor/common/ColorPickerButton.js +3 -0
  14. package/dist/Editor/common/LinkSettings/NavComponents.js +45 -65
  15. package/dist/Editor/common/LinkSettings/index.js +13 -26
  16. package/dist/Editor/common/LinkSettings/navOptions.js +2 -2
  17. package/dist/Editor/common/LinkSettings/style.js +164 -244
  18. package/dist/Editor/common/RadioGroup/index.js +48 -0
  19. package/dist/Editor/common/RadioGroup/styles.js +29 -0
  20. package/dist/Editor/common/RnD/ElementOptions/Actions.js +4 -5
  21. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
  22. package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -1
  23. package/dist/Editor/common/Select/index.js +44 -7
  24. package/dist/Editor/common/Select/styles.js +30 -2
  25. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +2 -2
  26. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +12 -9
  27. package/dist/Editor/common/SwipeableDrawer/style.js +14 -12
  28. package/dist/Editor/common/iconListV2.js +21 -0
  29. package/dist/Editor/commonStyle.js +18 -0
  30. package/dist/Editor/utils/helper.js +25 -7
  31. package/dist/Editor/utils/insertAppHeader.js +1 -1
  32. package/package.json +1 -1
@@ -1,36 +1,71 @@
1
- const ButtonNavSettingsStyles = theme => ({
2
- dialogContainer: {
3
- "& .MuiDialogContent-root": {
4
- padding: "0px 16px"
5
- },
6
- "& .MuiDialogActions-root": {
7
- padding: "10px"
1
+ const ButtonNavSettingsStyles = theme => {
2
+ const {
3
+ editor,
4
+ grey
5
+ } = theme?.palette || {};
6
+ const {
7
+ borderColor,
8
+ background,
9
+ textColor,
10
+ activeColor,
11
+ miniToolBarBackground
12
+ } = editor || {};
13
+ const commonContainerStyle = {
14
+ backgroundColor: miniToolBarBackground,
15
+ "& .MuiTypography-root": {
16
+ color: textColor
8
17
  },
9
- "& .MuiTypography-h6": {
18
+ "& .link-settings-title": {
19
+ fontSize: "18px",
20
+ padding: "12px 0px",
10
21
  fontWeight: 600,
11
- fontSize: "16px",
12
- paddingRight: "20px"
13
- },
14
- "& .MuiGrid-container": {
15
- marginTop: "0px"
16
- },
17
- "& .MuiGrid-item": {
18
- padding: "14px"
19
- },
20
- "& .MuiPaper-root": {
21
- padding: "10px !important",
22
- borderRadius: "20px !important",
23
- backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
24
- border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
22
+ color: theme?.palette?.editor?.textColor,
23
+ borderRadius: "8px",
24
+ marginTop: "2px",
25
+ "& li": {
26
+ padding: "6px 16px",
27
+ margin: "5px !important",
28
+ borderRadius: "4px !important"
29
+ },
30
+ "& .MuiList-root": {
31
+ padding: "0px"
32
+ },
25
33
  "& .MuiTypography-root": {
26
- color: theme?.palette?.editor?.textColor
34
+ fontSize: "12px !important",
35
+ fontWeight: 500,
36
+ fontFamily: "'Inter',sans-serif"
27
37
  },
28
- "& .MuiSvgIcon-root": {
38
+ "& .Mui-selected": {
39
+ background: theme?.palette?.editor?.menuOptionSelectedOption,
29
40
  color: theme?.palette?.editor?.textColor
41
+ }
42
+ },
43
+ "& .MuiInputBase-root, fieldset": {
44
+ background: theme?.palette?.editor?.inputFieldBgColor,
45
+ borderRadius: "8px",
46
+ // border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
47
+ "& fieldset": {
48
+ // border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
49
+ background: "transparent",
50
+ borderRadius: "8px"
30
51
  },
31
- "& .MuiFormLabel-root": {
32
- color: theme?.palette?.editor?.textColor,
33
- backgroundColor: "transparent"
52
+ "& input": {
53
+ border: `1px solid transparent`,
54
+ background: theme?.palette?.editor?.inputFieldBgColor,
55
+ borderRadius: "8px",
56
+ color: theme?.palette?.editor?.textColor
57
+ }
58
+ },
59
+ "& .MuiSvgIcon-root": {
60
+ color: textColor
61
+ },
62
+ "& .MuiFormLabel-root": {
63
+ color: textColor,
64
+ backgroundColor: background
65
+ },
66
+ "& .Mui-checked": {
67
+ "& .MuiSvgIcon-root": {
68
+ color: `${activeColor} !important`
34
69
  }
35
70
  },
36
71
  "& .dialog-title": {
@@ -60,47 +95,6 @@ const ButtonNavSettingsStyles = theme => ({
60
95
  borderRadius: "8px",
61
96
  color: theme?.palette?.editor?.textColor
62
97
  }
63
- },
64
- "& .radioBtnGrp": {
65
- paddingRight: "0px",
66
- paddingLeft: "0px"
67
- }
68
- },
69
- "& .MuiFormControlLabel-root": {
70
- "& .MuiCheckbox-root": {
71
- "& svg": {
72
- color: `${theme?.palette?.editor?.radioBtnBorder}`
73
- }
74
- }
75
- },
76
- "& .ccheckbox-primary": {
77
- padding: "0px",
78
- "& .MuiCheckbox-root": {
79
- padding: "8px 8px 8px 10px",
80
- "&:hover": {
81
- background: "unset !important"
82
- }
83
- },
84
- "& button": {
85
- width: "18px !important",
86
- height: "18px !important",
87
- borderRadius: "3px",
88
- border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
89
- "& svg": {
90
- width: "14px",
91
- height: "14px"
92
- }
93
- },
94
- "& .checkedIcon": {
95
- background: "#2563EB",
96
- borderColor: "#2563EB",
97
- padding: "0px"
98
- },
99
- "& .unCheckedIcon": {
100
- background: theme?.palette?.editor?.checkedIconBg
101
- },
102
- "& p": {
103
- margin: "0px !important"
104
98
  }
105
99
  },
106
100
  "& .trigger-text": {
@@ -109,194 +103,120 @@ const ButtonNavSettingsStyles = theme => ({
109
103
  fontFamily: "'Inter',sans-serif",
110
104
  color: theme?.palette?.editor?.textColor
111
105
  }
112
- },
113
- customRadioBtn: {
114
- "& .Mui-checked": {
115
- "& span": {
116
- "& .MuiSvgIcon-root": {
117
- color: `#2563EB !important`
118
- }
106
+ };
107
+ return {
108
+ dialogContainer: {
109
+ "& .MuiDialogContent-root": {
110
+ margin: "0px 20px",
111
+ padding: "0px 4px",
112
+ borderTop: `1px solid ${borderColor}`,
113
+ borderBottom: `1px solid ${borderColor}`
114
+ },
115
+ "& .MuiDialogActions-root": {
116
+ padding: "10px"
117
+ },
118
+ "& .MuiTypography-h6": {
119
+ fontWeight: 600,
120
+ fontSize: "20px",
121
+ paddingRight: "20px"
122
+ },
123
+ "& .MuiGrid-container": {
124
+ marginTop: "0px"
125
+ },
126
+ "& .MuiGrid-item": {
127
+ padding: "14px"
128
+ },
129
+ "& .MuiPaper-root": {
130
+ padding: "10px !important",
131
+ borderRadius: "20px !important",
132
+ backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
133
+ border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
134
+ ...commonContainerStyle
119
135
  }
120
136
  },
121
- "& .MuiRadio-root": {
122
- "& span": {
123
- "& .MuiSvgIcon-root": {
124
- color: `${theme?.palette?.editor?.radioBtnBorder}`
137
+ swipeableDrawerContainer: commonContainerStyle,
138
+ customSelect: {
139
+ zIndex: "1302 !important",
140
+ "& .MuiPopover-paper": {
141
+ background: theme?.palette?.editor?.textWeightPopUpBackground,
142
+ color: theme?.palette?.editor?.textColor,
143
+ borderRadius: "8px",
144
+ marginTop: "2px",
145
+ "& li": {
146
+ padding: "6px 16px",
147
+ margin: "5px !important",
148
+ borderRadius: "4px !important"
149
+ },
150
+ "& .MuiList-root": {
151
+ padding: "0px"
152
+ },
153
+ "& .MuiTypography-root": {
154
+ fontSize: "12px !important",
155
+ fontWeight: 500,
156
+ fontFamily: "'Inter',sans-serif"
157
+ },
158
+ "& .Mui-selected": {
159
+ background: theme?.palette?.editor?.menuOptionSelectedOption,
160
+ color: theme?.palette?.editor?.textColor
125
161
  }
126
162
  }
127
- }
128
- },
129
- customSelect: {
130
- zIndex: "1302 !important",
131
- "& .MuiPopover-paper": {
132
- background: theme?.palette?.editor?.textWeightPopUpBackground,
133
- color: theme?.palette?.editor?.textColor,
134
- borderRadius: "8px",
135
- marginTop: "2px",
136
- "& li": {
137
- padding: "6px 16px",
138
- margin: "5px !important",
139
- borderRadius: "4px !important"
140
- },
141
- "& .MuiList-root": {
142
- padding: "0px"
143
- },
144
- "& .MuiTypography-root": {
145
- fontSize: "12px !important",
146
- fontWeight: 500,
147
- fontFamily: "'Inter',sans-serif"
148
- },
149
- "& .Mui-selected": {
150
- background: theme?.palette?.editor?.menuOptionSelectedOption,
151
- color: theme?.palette?.editor?.textColor
152
- }
153
- }
154
- },
155
- saveBtn: {
156
- color: "#fff !important",
157
- background: "#2563EB !important",
158
- fontSize: "14px !important",
159
- fontWeight: "700 !important",
160
- padding: "8px 24px !important",
161
- textTransform: "none !important",
162
- borderRadius: "8px !important",
163
- fontFamily: "'Inter',sans-serif !important",
164
- "&:hover": {
163
+ },
164
+ saveBtn: {
165
165
  color: "#fff !important",
166
- background: "#2563EB !important"
167
- }
168
- },
169
- closeBtn: {
170
- backgroundColor: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
171
- color: `${theme?.palette?.editor?.customDialogueCloseBtnColor} !important`,
172
- fontSize: "14px !important",
173
- fontWeight: "700 !important",
174
- padding: "8px 22px !important",
175
- textTransform: "none !important",
176
- border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder} !important`,
177
- borderRadius: "8px !important",
178
- fontFamily: "'Inter',sans-serif !important",
179
- "&:hover": {
180
- border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder} !important`,
181
- backgroundColor: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
182
- color: `${theme?.palette?.editor?.customDialogueCloseBtnColor} !important`
183
- }
184
- },
185
- closeIcon: {
186
- background: theme?.palette?.editor?.closeButtonBackground,
187
- borderRadius: "8px",
188
- padding: "2px",
189
- marginRight: "8px",
190
- "& svg": {
191
- fill: theme?.palette?.editor?.closeButtonSvgStroke
192
- }
193
- },
194
- gridDivider: {
195
- borderRight: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
196
- "& .MuiTypography-root": {
197
- color: "#64748B !important",
198
- fontFamily: "'Inter',sans-serif",
199
- fontWeight: 500,
200
- fontSize: "16px"
201
- }
202
- },
203
- mobileActionBtns: {
204
- display: "flex",
205
- justifyContent: "flex-end",
206
- gap: "8px",
207
- paddingTop: "14px",
208
- marginTop: "14px",
209
- borderTop: `1px solid ${theme?.palette?.grey[300]}`
210
- },
211
- customAutoComplete: {
212
- "& .MuiAutocomplete-listbox": {
213
- padding: "0px",
214
- "& li": {
215
- margin: "5px",
216
- borderRadius: "8px",
217
- color: theme?.palette?.editor?.menuOptionTextColor,
218
- fontSize: "14px",
219
- padding: "8px 12px",
220
- '&[aria-selected="true"]': {
221
- backgroundColor: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
222
- }
223
- },
224
- "& .Mui-selected": {
225
- background: `${theme?.palette?.editor?.menuOptionSelectedOption} !important`
166
+ background: "#2563EB !important",
167
+ fontSize: "14px !important",
168
+ fontWeight: "700 !important",
169
+ padding: "8px 24px !important",
170
+ textTransform: "none !important",
171
+ borderRadius: "8px !important",
172
+ fontFamily: "'Inter',sans-serif !important",
173
+ "&:hover": {
174
+ color: "#fff !important",
175
+ background: "#2563EB !important"
226
176
  }
227
177
  },
228
- "& .MuiPaper-root": {
229
- borderRadius: "8px",
230
- background: theme?.palette?.editor?.textWeightPopUpBackground
231
- }
232
- },
233
- drawerContainer: {
234
- "& .link-settings-title": {
235
- fontSize: "18px",
236
- padding: "12px 0px",
237
- fontWeight: 600,
238
- color: theme?.palette?.editor?.textColor
178
+ closeBtn: {
179
+ backgroundColor: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
180
+ color: `${theme?.palette?.editor?.customDialogueCloseBtnColor} !important`,
181
+ fontSize: "14px !important",
182
+ fontWeight: "700 !important",
183
+ padding: "8px 22px !important",
184
+ textTransform: "none !important",
185
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder} !important`,
186
+ borderRadius: "8px !important",
187
+ fontFamily: "'Inter',sans-serif !important",
188
+ "&:hover": {
189
+ border: `1px solid ${theme?.palette?.editor?.customDialogueCloseBtnBorder} !important`,
190
+ backgroundColor: `${theme?.palette?.editor?.closeButtonBgColor} !important`,
191
+ color: `${theme?.palette?.editor?.customDialogueCloseBtnColor} !important`
192
+ }
239
193
  },
240
- "& .MuiInputBase-root, fieldset": {
241
- background: theme?.palette?.editor?.inputFieldBgColor,
194
+ closeIcon: {
195
+ background: theme?.palette?.editor?.closeButtonBackground,
242
196
  borderRadius: "8px",
243
- border: `1px solid ${theme?.palette?.editor?.inputFieldBorder} !important`,
244
- "& fieldset": {
245
- // border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`,
246
- background: "transparent",
247
- borderRadius: "8px"
248
- },
249
- "& input": {
250
- border: `1px solid transparent`,
251
- background: theme?.palette?.editor?.inputFieldBgColor,
252
- borderRadius: "8px",
253
- color: theme?.palette?.editor?.textColor
197
+ padding: "2px",
198
+ marginRight: "8px",
199
+ "& svg": {
200
+ fill: theme?.palette?.editor?.closeButtonSvgStroke
254
201
  }
255
202
  },
256
- "& .MuiFormLabel-root": {
257
- color: theme?.palette?.editor?.textColor,
258
- backgroundColor: "transparent !important"
259
- },
260
- "& .MuiTypography-root": {
261
- color: theme?.palette?.editor?.textColor
262
- },
263
- "& .MuiFormControlLabel-root": {
264
- "& .MuiCheckbox-root": {
265
- "& svg": {
266
- color: `${theme?.palette?.editor?.radioBtnBorder}`
267
- }
203
+ gridDivider: {
204
+ borderRight: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
205
+ "& .MuiTypography-root": {
206
+ color: "#64748B !important",
207
+ fontFamily: "'Inter',sans-serif",
208
+ fontWeight: 500,
209
+ fontSize: "16px"
268
210
  }
269
211
  },
270
- "& .ccheckbox-primary": {
271
- padding: "0px",
272
- "& .MuiCheckbox-root": {
273
- padding: "8px 8px 8px 10px",
274
- "&:hover": {
275
- background: "unset !important"
276
- }
277
- },
278
- "& button": {
279
- width: "18px !important",
280
- height: "18px !important",
281
- borderRadius: "3px",
282
- border: `1px solid ${theme?.palette?.editor?.buttonBorder3}`,
283
- "& svg": {
284
- width: "14px",
285
- height: "14px"
286
- }
287
- },
288
- "& .checkedIcon": {
289
- background: "#2563EB",
290
- borderColor: "#2563EB",
291
- padding: "0px"
292
- },
293
- "& .unCheckedIcon": {
294
- background: theme?.palette?.editor?.checkedIconBg
295
- },
296
- "& p": {
297
- margin: "0px !important"
298
- }
212
+ mobileActionBtns: {
213
+ display: "flex",
214
+ justifyContent: "flex-end",
215
+ gap: "8px",
216
+ paddingTop: "14px",
217
+ marginTop: "14px",
218
+ borderTop: `1px solid ${grey[300]}`
299
219
  }
300
- }
301
- });
220
+ };
221
+ };
302
222
  export default ButtonNavSettingsStyles;
@@ -0,0 +1,48 @@
1
+ import { RadioGroup as Core, Radio, FormControl, FormControlLabel, IconButton, Typography } from "@mui/material";
2
+ import RadioGroupStyles from "./styles";
3
+ import { useEditorContext } from "../../hooks/useMouseMove";
4
+ import { CheckedRadioIcon } from "../iconListV2";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ function RadioGroup(props) {
7
+ const {
8
+ value,
9
+ options,
10
+ onChange,
11
+ label,
12
+ labelProps,
13
+ radioProps,
14
+ translation,
15
+ ...rest
16
+ } = props;
17
+ const {
18
+ theme
19
+ } = useEditorContext();
20
+ const classes = RadioGroupStyles(theme);
21
+ return /*#__PURE__*/_jsx(FormControl, {
22
+ children: /*#__PURE__*/_jsx(Core, {
23
+ value: value,
24
+ sx: classes.customRadioGroup,
25
+ ...rest,
26
+ children: options?.map((option, i) => {
27
+ return /*#__PURE__*/_jsx(FormControlLabel, {
28
+ value: option.value,
29
+ control: /*#__PURE__*/_jsx(Radio, {
30
+ checkedIcon: /*#__PURE__*/_jsx(CheckedRadioIcon, {}),
31
+ icon: /*#__PURE__*/_jsx(IconButton, {
32
+ className: "unCheckedIcon"
33
+ }),
34
+ ...(radioProps || {})
35
+ }),
36
+ label: /*#__PURE__*/_jsx(Typography, {
37
+ variant: "body1",
38
+ sx: classes.label,
39
+ ...(labelProps || {}),
40
+ children: translation(option.label)
41
+ }),
42
+ onChange: () => onChange(option)
43
+ }, i);
44
+ })
45
+ })
46
+ });
47
+ }
48
+ export default RadioGroup;
@@ -0,0 +1,29 @@
1
+ const SelectStyles = (theme = {}) => {
2
+ const {
3
+ buttonBorder3,
4
+ checkedIconBg,
5
+ tv_text,
6
+ inputFieldBgColor
7
+ } = theme?.palette?.editor || {};
8
+ return {
9
+ customRadioGroup: {
10
+ gap: "4px",
11
+ "& button": {
12
+ border: `1px solid ${buttonBorder3}`
13
+ },
14
+ "& .unCheckedIcon": {
15
+ background: checkedIconBg,
16
+ width: "17px",
17
+ height: "17px",
18
+ padding: "0px"
19
+ },
20
+ "& .radio-icon-path": {
21
+ fill: inputFieldBgColor
22
+ }
23
+ },
24
+ label: {
25
+ color: `${tv_text} !important`
26
+ }
27
+ };
28
+ };
29
+ export default SelectStyles;
@@ -1,12 +1,11 @@
1
1
  import { Button, IconButton } from "@mui/material";
2
- import CloseRoundedIcon from '@mui/icons-material/CloseRounded';
2
+ import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
3
3
  import AutoAwesomeIcon from "@mui/icons-material/AutoAwesome";
4
4
  import DragIndicatorIcon from "@mui/icons-material/DragIndicator";
5
5
  import MoreVertIcon from "@mui/icons-material/MoreVert";
6
- import AddRoundedIcon from '@mui/icons-material/AddRounded';
7
- import ArrowUpwardRoundedIcon from '@mui/icons-material/ArrowUpwardRounded';
8
- import ArrowDownwardRoundedIcon from '@mui/icons-material/ArrowDownwardRounded';
9
- import SaveIcon from "@mui/icons-material/Save";
6
+ import AddRoundedIcon from "@mui/icons-material/AddRounded";
7
+ import ArrowUpwardRoundedIcon from "@mui/icons-material/ArrowUpwardRounded";
8
+ import ArrowDownwardRoundedIcon from "@mui/icons-material/ArrowDownwardRounded";
10
9
  import LinkIcon from "./Icons/LinkIcon";
11
10
  import FilterFramesIcon from "@mui/icons-material/FilterFrames";
12
11
  import { GridAddSectionIcon, SignatureIcon, WorkflowIcon } from "../../iconslist";
@@ -140,7 +140,6 @@ const useElementSettingsStyle = theme => ({
140
140
  }
141
141
  },
142
142
  "& .popUpHeader": {
143
- fontSize: "16px",
144
143
  fontFamily: "'Inter',sans-serif",
145
144
  fontWeight: "700",
146
145
  fontSize: "16px",
@@ -15,7 +15,6 @@ const useOptionsPopupStyle = ({
15
15
  background: theme?.palette?.editor?.miniToolBarBackground
16
16
  },
17
17
  "& .sectionOptionTitle": {
18
- fontSize: "16px",
19
18
  fontFamily: "'Inter',sans-serif",
20
19
  fontWeight: "700",
21
20
  fontSize: "16px",
@@ -1,22 +1,59 @@
1
- import { Select as Core } from "@mui/material";
1
+ import { Select as Core, MenuItem, Typography } from "@mui/material";
2
2
  import SelectStyles from "./styles";
3
3
  import { useEditorContext } from "../../hooks/useMouseMove";
4
- import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
4
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { Fragment as _Fragment } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
8
  function Select(props) {
7
9
  const {
8
10
  children,
11
+ value,
12
+ onChange,
13
+ options,
14
+ label,
15
+ labelProps,
16
+ showDefault,
17
+ translation,
9
18
  ...rest
10
19
  } = props;
11
20
  const {
12
21
  theme
13
22
  } = useEditorContext();
14
23
  const classes = SelectStyles(theme);
15
- return /*#__PURE__*/_jsx(Core, {
16
- MenuProps: classes.MenuProps,
17
- IconComponent: KeyboardArrowDownRoundedIcon,
18
- ...rest,
19
- children: children
24
+ const menuOptions = showDefault ? [{
25
+ label: "None",
26
+ value: ""
27
+ }, ...(options || [])] : options;
28
+ return /*#__PURE__*/_jsxs(_Fragment, {
29
+ children: [label ? /*#__PURE__*/_jsx(Typography, {
30
+ variant: "body2",
31
+ sx: {
32
+ paddingBottom: "4px"
33
+ },
34
+ ...(labelProps || {}),
35
+ children: label
36
+ }) : null, /*#__PURE__*/_jsx(Core, {
37
+ size: "small",
38
+ fullWidth: true,
39
+ defaultValue: "",
40
+ value: value || "",
41
+ onChange: onChange,
42
+ sx: classes.select,
43
+ MenuProps: classes.MenuProps,
44
+ IconComponent: KeyboardArrowDownRoundedIcon,
45
+ displayEmpty: true,
46
+ ...rest,
47
+ children: menuOptions?.map((option, i) => {
48
+ return /*#__PURE__*/_jsx(MenuItem, {
49
+ value: option.value,
50
+ children: /*#__PURE__*/_jsx(Typography, {
51
+ variant: "body2",
52
+ children: translation(option.label)
53
+ })
54
+ }, i);
55
+ })
56
+ })]
20
57
  });
21
58
  }
22
59
  export default Select;
@@ -1,16 +1,44 @@
1
1
  const SelectStyles = (theme = {}) => {
2
2
  const {
3
3
  textColor,
4
- background
4
+ textWeightPopUpBackground,
5
+ menuOptionSelectedOption
5
6
  } = theme?.palette?.editor || {};
6
7
  return {
7
8
  MenuProps: {
9
+ sx: {
10
+ zIndex: "1302 !important"
11
+ },
8
12
  PaperProps: {
9
13
  sx: {
14
+ background: textWeightPopUpBackground,
10
15
  color: textColor,
11
- background
16
+ borderRadius: "8px",
17
+ marginTop: "2px",
18
+ "& li": {
19
+ padding: "6px 16px",
20
+ margin: "5px !important",
21
+ borderRadius: "4px !important"
22
+ },
23
+ "& .MuiList-root": {
24
+ padding: "0px"
25
+ },
26
+ "& .MuiTypography-root": {
27
+ fontSize: "12px !important",
28
+ fontWeight: 500,
29
+ fontFamily: "'Inter',sans-serif"
30
+ },
31
+ "& .Mui-selected": {
32
+ background: menuOptionSelectedOption,
33
+ color: textColor
34
+ }
12
35
  }
13
36
  }
37
+ },
38
+ select: {
39
+ "& .MuiSelect-icon": {
40
+ color: "#64748B !important"
41
+ }
14
42
  }
15
43
  };
16
44
  };