@majoo-ui/react 2.0.1 → 2.1.0-rc.1

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 (202) hide show
  1. package/charts.esm.js +3 -1453
  2. package/colors/Colors.esm.js +93 -0
  3. package/components/accordion/Accordion.esm.js +109 -0
  4. package/components/alertDialog/AlertDialog.esm.js +440 -0
  5. package/components/avatar/Avatar.esm.js +83 -0
  6. package/components/badge/Badge.esm.js +255 -0
  7. package/components/banner/Banner.esm.js +341 -0
  8. package/components/barChart/BarChart.esm.js +212 -0
  9. package/components/breadcrumb/Breadcrumb.esm.js +65 -0
  10. package/components/breadcrumb/index.esm.js +19 -0
  11. package/components/button/Button.esm.js +331 -0
  12. package/components/buttonGroup/ButtonGroup.esm.js +350 -0
  13. package/components/card/Card.esm.js +236 -0
  14. package/components/chart/assets/data_kosong.png.esm.js +3 -0
  15. package/components/chart/lineChart/LineChart.esm.js +358 -0
  16. package/components/chart/lineChart/components/Comparator.esm.js +82 -0
  17. package/components/chart/lineChart/components/ComparatorController.esm.js +112 -0
  18. package/components/chart/lineChart/components/ComparatorItem.esm.js +104 -0
  19. package/components/chart/lineChart/components/ProductList.esm.js +78 -0
  20. package/components/chart/lineChart/components/TitleLegend.esm.js +107 -0
  21. package/components/chart/lineChart/components/Tooltip.esm.js +90 -0
  22. package/components/chart/utils/index.esm.js +109 -0
  23. package/components/checkboxTable/CheckboxTable.esm.js +287 -0
  24. package/components/colorPicker/ColorPicker.esm.js +342 -0
  25. package/components/colorPicker/InputColorPicker.esm.js +120 -0
  26. package/components/colorPicker/assets/img_colormap.gif.esm.js +3 -0
  27. package/components/colorPicker/components/ColorFields.esm.js +144 -0
  28. package/components/colorPicker/components/ColorMap.esm.js +1188 -0
  29. package/components/contentEditor/ContentEditor.esm.js +251 -0
  30. package/components/contentEditor/assets/Inline-code-outline.svg.esm.js +3 -0
  31. package/components/contentEditor/assets/Link-outline.svg.esm.js +3 -0
  32. package/components/contentEditor/assets/List-bulleted-outline.svg.esm.js +3 -0
  33. package/components/contentEditor/assets/List-numbered-outline.svg.esm.js +3 -0
  34. package/components/contentEditor/assets/Redo-outline.svg.esm.js +3 -0
  35. package/components/contentEditor/assets/Text-bold-filled.svg.esm.js +3 -0
  36. package/components/contentEditor/assets/Text-clear-format-outline.svg.esm.js +3 -0
  37. package/components/contentEditor/assets/Text-italic-outline.svg.esm.js +3 -0
  38. package/components/contentEditor/assets/Text-strikethrough-outline.svg.esm.js +3 -0
  39. package/components/contentEditor/assets/Text-underline-outline.svg.esm.js +3 -0
  40. package/components/contentEditor/assets/Undo-outline.svg.esm.js +3 -0
  41. package/components/contextMenu/ContextMenu.esm.js +298 -0
  42. package/components/datePicker/AdvancedOption.esm.js +37 -0
  43. package/components/datePicker/CustomDatePicker.esm.js +121 -0
  44. package/components/datePicker/DatePicker.esm.js +244 -0
  45. package/components/datePicker/DatePickerMulti.esm.js +70 -0
  46. package/components/datePicker/InputDatePicker.esm.js +290 -0
  47. package/components/datePicker/InputDateRangePicker.esm.js +174 -0
  48. package/components/datePicker/components/Calendar.esm.js +654 -0
  49. package/components/datePicker/components/CalendarMulti.esm.js +407 -0
  50. package/components/datePicker/components/CalendarTimePicker.esm.js +104 -0
  51. package/components/datePicker/components/DateNumber.esm.js +89 -0
  52. package/components/datePicker/components/MobileCalendar.esm.js +522 -0
  53. package/components/datePicker/state/reducer.esm.js +286 -0
  54. package/components/datePicker/timePicker/InputTimePicker.esm.js +205 -0
  55. package/components/datePicker/timePicker/TimePicker.esm.js +481 -0
  56. package/components/devicePreview/DevicePreview.esm.js +631 -0
  57. package/components/devicePreview/deviceFrame/android-transparant.png.esm.js +3 -0
  58. package/components/devicePreview/deviceFrame/android-wide-transparant.png.esm.js +3 -0
  59. package/components/devicePreview/deviceFrame/bg-email.png.esm.js +3 -0
  60. package/components/devicePreview/deviceFrame/bg-notification.png.esm.js +3 -0
  61. package/components/devicePreview/deviceFrame/bg-sms.png.esm.js +3 -0
  62. package/components/devicePreview/deviceFrame/bg-whatsapp.png.esm.js +3 -0
  63. package/components/devicePreview/deviceFrame/desktop-transparant.png.esm.js +3 -0
  64. package/components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js +3 -0
  65. package/components/devicePreview/deviceFrame/iphone-transparant.png.esm.js +3 -0
  66. package/components/dialog/Dialog.esm.js +106 -0
  67. package/components/drawer/Drawer.esm.js +294 -0
  68. package/components/dropdownMenu/DropdownMenu.esm.js +281 -0
  69. package/components/editableTable/EditableMobile.esm.js +361 -0
  70. package/components/editableTable/EditableTable.esm.js +618 -0
  71. package/components/editableTable/transition.esm.js +37 -0
  72. package/components/form/components/FormGroup/FormGroup.esm.js +142 -0
  73. package/components/form/components/FormHelper/Helper.esm.js +50 -0
  74. package/components/form/components/FormLabel/Label.esm.js +90 -0
  75. package/components/form/components/InputAddon/InputAddon.esm.js +105 -0
  76. package/components/form/components/InputCheckbox/CheckboxGroup.esm.js +60 -0
  77. package/components/form/components/InputCheckbox/InputCheckbox.esm.js +129 -0
  78. package/components/form/components/InputCheckbox/icon/CheckOutline.esm.js +33 -0
  79. package/components/form/components/InputCheckbox/icon/MinusOutline.esm.js +33 -0
  80. package/components/form/components/InputCombobox/InputCombobox.esm.js +169 -0
  81. package/components/form/components/InputCounter/InputCounter.esm.js +226 -0
  82. package/components/form/components/InputCreatable/InputCreatable.esm.js +229 -0
  83. package/components/form/components/InputDateRange/InputDateRange.esm.js +46 -0
  84. package/components/form/components/InputElement/InputElement.esm.js +35 -0
  85. package/components/form/components/InputGroup/InputGroup.esm.js +188 -0
  86. package/components/form/components/InputLetter/InputLetter.esm.js +68 -0
  87. package/components/form/components/InputNumber/InputNumber.esm.js +248 -0
  88. package/components/form/components/InputNumber/NumberFormat.esm.js +1263 -0
  89. package/components/form/components/InputOTP/InputOTP.esm.js +70 -0
  90. package/components/form/components/InputRadio/InputRadio.esm.js +273 -0
  91. package/components/form/components/InputRadio/InputRadioGroup.esm.js +35 -0
  92. package/components/form/components/InputRadio/context.esm.js +5 -0
  93. package/components/form/components/InputResourceList/InputResourceList.esm.js +429 -0
  94. package/components/form/components/InputSearchbox/CloseFilled.esm.js +34 -0
  95. package/components/form/components/InputSearchbox/InputSearchbox.esm.js +90 -0
  96. package/components/form/components/InputSearchbox/SearchOutline.esm.js +26 -0
  97. package/components/form/components/InputSelect/InputSelect.esm.js +964 -0
  98. package/components/form/components/InputSelectCheck/InputSelectCheck.esm.js +1388 -0
  99. package/components/form/components/InputSelectCheck/OptionGroupItem.esm.js +39 -0
  100. package/components/form/components/InputSelectCheck/icon/CheckOutline.esm.js +33 -0
  101. package/components/form/components/InputSelectTag/InputSelectTag.esm.js +62 -0
  102. package/components/form/components/InputSignature/InputSignature.esm.js +122 -0
  103. package/components/form/components/InputSignature/SignatureModal.esm.js +67 -0
  104. package/components/form/components/InputSwitch/InputSwitch.esm.js +96 -0
  105. package/components/form/components/InputSwitch/InputSwitchWithImage.esm.js +136 -0
  106. package/components/form/components/InputTags/InputTags.esm.js +268 -0
  107. package/components/form/components/InputText/InputText.esm.js +197 -0
  108. package/components/form/components/InputTextArea/InputTextArea.esm.js +77 -0
  109. package/components/heading/Heading.esm.js +64 -0
  110. package/components/iconButton/IconButton.esm.js +71 -0
  111. package/components/image/Image.esm.js +141 -0
  112. package/components/link/Link.esm.js +59 -0
  113. package/components/loadingBar/LoadingBar.esm.js +113 -0
  114. package/components/mapPicker/InputMapPicker.esm.js +160 -0
  115. package/components/mapPicker/MapPicker.esm.js +122 -0
  116. package/components/mapPicker/MapPicker.styles.esm.js +70 -0
  117. package/components/mapPicker/assets/images/Mapsicle.png.esm.js +3 -0
  118. package/components/mapPicker/components/AddressCard.esm.js +25 -0
  119. package/components/mapPicker/components/ButtonSelect.esm.js +46 -0
  120. package/components/mapPicker/components/ChangeView.esm.js +20 -0
  121. package/components/mapPicker/components/InputSearch.esm.js +74 -0
  122. package/components/mapPicker/components/MarkerIcon.esm.js +22 -0
  123. package/components/mapPicker/components/MarkerSvg.esm.js +62 -0
  124. package/components/mapPicker/components/ZoomControls.esm.js +36 -0
  125. package/components/mapPicker/hooks/useMapSearch.esm.js +161 -0
  126. package/components/modalDialog/ModalDialog.esm.js +247 -0
  127. package/components/notificationBadge/NotificationBadge.esm.js +149 -0
  128. package/components/pageDialog/PageDialog.esm.js +291 -0
  129. package/components/pageDialog/logo.svg.esm.js +3 -0
  130. package/components/pagination/Pagination.esm.js +94 -0
  131. package/components/pagination/PaginationButton.esm.js +346 -0
  132. package/components/pagination/PaginationInfo.esm.js +146 -0
  133. package/components/paper/Paper.esm.js +76 -0
  134. package/components/paragraph/Paragraph.esm.js +52 -0
  135. package/components/pieChart/PieChart.esm.js +287 -0
  136. package/components/popover/Popover.esm.js +142 -0
  137. package/components/progress/Progress.esm.js +170 -0
  138. package/components/progressIndicator/ProgressIndicator.esm.js +287 -0
  139. package/components/scrollSync/ScrollSync.esm.js +172 -0
  140. package/components/scrollSync/ScrollSyncNode.esm.js +87 -0
  141. package/components/scrollSync/utils.esm.js +9 -0
  142. package/components/separator/Separator.esm.js +43 -0
  143. package/components/skeleton/Skeleton.esm.js +131 -0
  144. package/components/slider/Slider.esm.js +345 -0
  145. package/components/stepWizard/StepWizard.esm.js +451 -0
  146. package/components/stepWizard/index.esm.js +14 -0
  147. package/components/table/MobileTable.esm.js +415 -0
  148. package/components/table/Table.esm.js +1472 -0
  149. package/components/table/components/columns/DateColumn.esm.js +26 -0
  150. package/components/table/components/columns/DecimalColumn.esm.js +36 -0
  151. package/components/table/components/columns/PriceColumn.esm.js +57 -0
  152. package/components/table/components/columns/RowDraggableColumn.esm.js +24 -0
  153. package/components/table/components/columns/RowExpanderColumn.esm.js +32 -0
  154. package/components/table/components/columns/RowExpanderMultipleColumn.esm.js +24 -0
  155. package/components/table/components/columns/RowMenuColumn.esm.js +101 -0
  156. package/components/table/components/columns/RowSelectionCallbackColumn.esm.js +38 -0
  157. package/components/table/components/columns/RowSelectionColumn.esm.js +34 -0
  158. package/components/table/images/img-emptydata.webp.esm.js +3 -0
  159. package/components/table/images/img-emptysearchdata.webp.esm.js +3 -0
  160. package/components/tableOfContent/TableOfContent.esm.js +267 -0
  161. package/components/tableOfContent/index.esm.js +18 -0
  162. package/components/tableOfContent/transition.esm.js +38 -0
  163. package/components/tabs/Tabs.esm.js +282 -0
  164. package/components/tag/Tag.esm.js +161 -0
  165. package/components/tagList/TagList.esm.js +90 -0
  166. package/components/tagStatus/TagStatus.esm.js +134 -0
  167. package/components/text/Text.esm.js +140 -0
  168. package/components/toast/Toast.esm.js +297 -0
  169. package/components/toast/ToastContainer.esm.js +73 -0
  170. package/components/toast/context/ToastContext.esm.js +5 -0
  171. package/components/toast/context/ToastProvider.esm.js +96 -0
  172. package/components/tooltip/Tooltip.esm.js +175 -0
  173. package/components/upload/Upload.esm.js +1103 -0
  174. package/components/upload/utils/canvasPreview.esm.js +39 -0
  175. package/components/upload/utils/imgPreview.esm.js +21 -0
  176. package/config/stitches.config.esm.js +216 -0
  177. package/editor.esm.js +1 -264
  178. package/hooks/useListOption/useListOption.esm.js +56 -0
  179. package/hooks/useToggle/useToggle.esm.js +8 -0
  180. package/index.esm.js +106 -42293
  181. package/layout/box/Box.esm.js +24 -0
  182. package/layout/flex/Flex.esm.js +135 -0
  183. package/layout/grid/Grid.esm.js +270 -0
  184. package/layout/pageContainer/PageContainer.esm.js +60 -0
  185. package/majoo-provider/MajooProvider.esm.js +42 -0
  186. package/majoo-provider/ThemeProvider.esm.js +41 -0
  187. package/majoo-provider/globalStyles.esm.js +242 -0
  188. package/majoo-provider/styles/modern-normalize.esm.js +95 -0
  189. package/map.esm.js +2 -734
  190. package/package.json +8 -4
  191. package/utils/calendar.esm.js +26 -0
  192. package/utils/element.esm.js +21 -0
  193. package/utils/object.esm.js +12 -0
  194. package/utils/request.esm.js +74 -0
  195. package/utils/strings.esm.js +6 -0
  196. package/{useMediaQuery.esm.js → utils/useMediaQuery.esm.js} +1 -1
  197. package/utils/useNavigatorOnline.esm.js +19 -0
  198. package/utils/variant.esm.js +12 -0
  199. package/wrapper/ConditionalWrapper.esm.js +9 -0
  200. package/ModalDialog.esm.js +0 -2669
  201. package/Separator.esm.js +0 -3002
  202. package/stitches.config.esm.js +0 -2284
@@ -0,0 +1,39 @@
1
+ import { __awaiter } from 'tslib';
2
+
3
+ const TO_RADIANS = Math.PI / 180;
4
+ function canvasPreview(image_1, canvas_1, crop_1) {
5
+ return __awaiter(this, arguments, void 0, function* (image, canvas, crop, scale = 1, rotate = 0, ratio) {
6
+ const ctx = canvas.getContext('2d');
7
+ if (!ctx) {
8
+ throw new Error('No 2d context');
9
+ }
10
+ const scaleX = image.naturalWidth / image.width;
11
+ let scaleY = image.naturalHeight / image.height;
12
+ if (ratio === 1) {
13
+ scaleY = scaleX;
14
+ }
15
+ const pixelRatio = 1;
16
+ canvas.width = Math.round(crop.width * scaleX * pixelRatio);
17
+ canvas.height = Math.round(crop.height * scaleY * pixelRatio);
18
+ ctx.scale(pixelRatio, pixelRatio);
19
+ ctx.imageSmoothingQuality = 'high';
20
+ const cropX = crop.x * scaleX;
21
+ const cropY = crop.y * scaleY;
22
+ const rotateRads = rotate * TO_RADIANS;
23
+ const centerX = image.naturalWidth / 2;
24
+ let centerY = image.naturalHeight / 2;
25
+ if (ratio === 1) {
26
+ centerY = centerX;
27
+ }
28
+ ctx.save();
29
+ ctx.translate(-cropX, -cropY);
30
+ ctx.translate(centerX, centerY);
31
+ ctx.rotate(rotateRads);
32
+ ctx.scale(scale, scale);
33
+ ctx.translate(-centerX, -centerY);
34
+ ctx.drawImage(image, 0, 0, image.naturalWidth, image.naturalHeight, 0, 0, image.naturalWidth, image.naturalHeight);
35
+ ctx.restore();
36
+ });
37
+ }
38
+
39
+ export { canvasPreview };
@@ -0,0 +1,21 @@
1
+ import { __awaiter } from 'tslib';
2
+ import { canvasPreview } from './canvasPreview.esm.js';
3
+
4
+ function toBlob(canvas, type) {
5
+ return new Promise(resolve => {
6
+ canvas.toBlob(resolve, type);
7
+ });
8
+ }
9
+ function imgPreview(image_1, crop_1) {
10
+ return __awaiter(this, arguments, void 0, function* (image, crop, scale = 1, rotate = 0, ratio, type) {
11
+ if (ratio === 1) {
12
+ crop.width = crop.height;
13
+ }
14
+ const canvas = document.createElement('canvas');
15
+ canvasPreview(image, canvas, crop, scale, rotate, ratio);
16
+ const blob = yield toBlob(canvas, type);
17
+ return blob;
18
+ });
19
+ }
20
+
21
+ export { imgPreview };
@@ -0,0 +1,216 @@
1
+ import 'core-js/modules/es.iterator.constructor.js';
2
+ import 'core-js/modules/es.iterator.reduce.js';
3
+ import 'core-js/modules/es.set.difference.v2.js';
4
+ import 'core-js/modules/es.set.intersection.v2.js';
5
+ import 'core-js/modules/es.set.is-disjoint-from.v2.js';
6
+ import 'core-js/modules/es.set.is-subset-of.v2.js';
7
+ import 'core-js/modules/es.set.is-superset-of.v2.js';
8
+ import 'core-js/modules/es.set.symmetric-difference.v2.js';
9
+ import 'core-js/modules/es.set.union.v2.js';
10
+ import { createStitches } from '@stitches/react';
11
+ import { foundations } from '@majoo-ui/core';
12
+ import img$3 from '../components/pageDialog/logo.svg.esm.js';
13
+ import img$2 from '../components/devicePreview/deviceFrame/ic-majoo-profpic.png.esm.js';
14
+ import img$1 from '../components/table/images/img-emptydata.webp.esm.js';
15
+ import img from '../components/table/images/img-emptysearchdata.webp.esm.js';
16
+
17
+ const {
18
+ styled,
19
+ css,
20
+ globalCss,
21
+ keyframes,
22
+ getCssText,
23
+ theme,
24
+ createTheme,
25
+ config
26
+ } = createStitches({
27
+ theme: {
28
+ colors: Object.assign({}, foundations.colors),
29
+ space: Object.assign({}, foundations.space),
30
+ shadows: Object.assign({}, foundations.shadows),
31
+ fontSizes: Object.assign({}, foundations.fontSizes),
32
+ fonts: Object.assign({}, foundations.fonts),
33
+ fontWeights: Object.assign({}, foundations.fontWeights),
34
+ lineHeights: Object.assign({}, foundations.lineHeights),
35
+ letterSpacings: Object.assign({}, foundations.letterSpacings),
36
+ radii: Object.assign({}, foundations.radii),
37
+ sizes: Object.assign({}, foundations.sizes),
38
+ zIndices: Object.assign({}, foundations.zIndices),
39
+ toastPosition: Object.assign({}, foundations.toastPosition),
40
+ brandAssets: {
41
+ logo: `url("${img$3}")`,
42
+ icon: `url("${img$2}")`,
43
+ emptyData: `url("${img$1}")`,
44
+ emptySearchData: `url("${img}")`
45
+ }
46
+ },
47
+ media: {
48
+ sm: '(min-width: 359px)',
49
+ md: '(min-width: 767px)',
50
+ lg: '(min-width: 1023px)',
51
+ xl: '(min-width: 1199px)',
52
+ '2xl': '(min-width: 1399px)',
53
+ '3xl': '(min-width: 1600px)'
54
+ },
55
+ utils: {
56
+ m: value => ({
57
+ margin: value
58
+ }),
59
+ mt: value => ({
60
+ marginTop: value
61
+ }),
62
+ mr: value => ({
63
+ marginRight: value
64
+ }),
65
+ mb: value => ({
66
+ marginBottom: value
67
+ }),
68
+ ml: value => ({
69
+ marginLeft: value
70
+ }),
71
+ mx: value => ({
72
+ marginLeft: value,
73
+ marginRight: value
74
+ }),
75
+ my: value => ({
76
+ marginTop: value,
77
+ marginBottom: value
78
+ }),
79
+ size: value => ({
80
+ width: value,
81
+ height: value
82
+ }),
83
+ subtleColor: value => ({
84
+ color: `$${value}800`,
85
+ backgroundColor: `$${value}100`
86
+ })
87
+ }
88
+ });
89
+ const darkThemeColors = {
90
+ bgWhite: '#003030',
91
+ bgGray: '#003030',
92
+ bgDark: '#FFFFFF',
93
+ textPrimary: '#FFFFFF',
94
+ textSecondary: '#FFFFFF',
95
+ bgHeader: '#004a48',
96
+ btnPrimary: '#001f1f',
97
+ btnSecondary: '#003030',
98
+ primary50: '#001f1f',
99
+ primary100: '#001f1f',
100
+ iconPrimary: '#FFFFFF',
101
+ bgBorder: '#004a49'
102
+ };
103
+ createTheme({
104
+ colors: darkThemeColors
105
+ });
106
+ const blueThemeColors = {
107
+ btnPrimary: '#124FE3',
108
+ btnHoverPrimary: '#124FE3',
109
+ btnActivePrimary: '#183B90',
110
+ textBrand: '#124FE3',
111
+ primary50: '#EDF2FD',
112
+ primary100: '#D1DDFA',
113
+ primary200: '#A3BBF6',
114
+ primary300: '#6B93F0',
115
+ primary400: '#3A70EE',
116
+ primary500: '#124FE3',
117
+ primary600: '#0D41BA',
118
+ primary700: '#093395',
119
+ primary800: '#09276C',
120
+ primary900: '#081A45',
121
+ btnNegative: '#D50B3E',
122
+ btnHoverNegative: '#AF0932',
123
+ btnActiveNegative: '#880727',
124
+ textRed: '#D50B3E',
125
+ btnHoverSecondary: '#EDF2FD',
126
+ btnActiveSecondary: '#D1DDFA',
127
+ btnHoverNegativeSecondary: '#FCE9EA',
128
+ btnActiveNegativeSecondary: '#F5BCC0',
129
+ gray50: '#F6F8FA',
130
+ gray100: '#ECEFF5',
131
+ gray150: '#D6DCE3',
132
+ gray200: '#D6DCE3',
133
+ gray300: '#AFBECB',
134
+ gray400: '#819CB0',
135
+ gray500: '#627F95',
136
+ gray600: '#4C677B',
137
+ gray700: '#3F5264',
138
+ gray800: '#384655',
139
+ gray900: '#323C49',
140
+ textDisable: '#819BAF',
141
+ bgBorder: '#EBEFF3',
142
+ textPrimary: '#29323C',
143
+ textSecondary: '#3F5265',
144
+ borderFocus: '#BBDDFF',
145
+ iconBrand: '#124FE3',
146
+ iconAccent: '#8DC8FF',
147
+ bgBrand: '#124FE3',
148
+ iconGreen: '#9BE9D8',
149
+ borderActive: '#29323C',
150
+ red50: '#FEF0F3',
151
+ red100: '#FCD8DE',
152
+ red200: '#F9A8B4',
153
+ red300: '#F47689',
154
+ red400: '#E83D57',
155
+ red500: '#D50B3E',
156
+ red600: '#AF0932',
157
+ red700: '#880727',
158
+ red800: '#62051C',
159
+ red900: '#3B0311',
160
+ red1000: '#1F0209',
161
+ bgGray: '#F6F8F9',
162
+ bgSuccess: '#EEFBF4',
163
+ bgFailed: '#FEF0F4',
164
+ bgInactive: '#F7F7F8',
165
+ textGreen: '#17663A',
166
+ hlFailed: '#D50B3E',
167
+ hlSuccess: '#56B35F',
168
+ hlPending: '#F07167',
169
+ hlNews: '#124FE3',
170
+ textBlue: '#0075AD',
171
+ cardBorder: '#EBEFF3',
172
+ bgSelectedLight: '#EFF7FF',
173
+ btnSelect: '#29323C',
174
+ chartBrand: '#124FE3',
175
+ chartLightBrand: '#EBEFF3',
176
+ iconPrimary: '#29323C',
177
+ bgAccent: '#D9EBFF'
178
+ };
179
+ createTheme({
180
+ colors: blueThemeColors,
181
+ shadows: {
182
+ card: 'none'
183
+ },
184
+ sizes: {
185
+ cardLineHeight: '0px'
186
+ },
187
+ fontWeights: {
188
+ cardLabel: '400',
189
+ cardLabelMd: '400',
190
+ cardDesc: '700'
191
+ },
192
+ fontSizes: {
193
+ cardLabelMd: '12px',
194
+ cardDescMd: '14px'
195
+ },
196
+ lineHeights: {
197
+ cardLabelMd: '16px',
198
+ cardDescMd: '20px'
199
+ }
200
+ });
201
+ const runtimeColorTokenNames = Array.from(new Set([...Object.keys(foundations.colors), ...Object.keys(darkThemeColors), ...Object.keys(blueThemeColors)]));
202
+ function getRuntimeColorVariable(tokenName) {
203
+ return `var(--colors-${String(tokenName)})`;
204
+ }
205
+ function buildRuntimeColors() {
206
+ return runtimeColorTokenNames.reduce((accumulator, tokenName) => {
207
+ // Some semantic tokens are present in generated CSS variables but omitted from theme.colors at runtime.
208
+ accumulator[tokenName] = getRuntimeColorVariable(tokenName);
209
+ return accumulator;
210
+ }, {});
211
+ }
212
+ // Use CSS variable strings for runtime props passed outside Stitches.
213
+ const runtimeColors = buildRuntimeColors();
214
+ const colors = runtimeColors;
215
+
216
+ export { colors, config, createTheme, css, getCssText, globalCss, keyframes, styled, theme };
package/editor.esm.js CHANGED
@@ -1,264 +1 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { useState, useEffect } from 'react';
3
- import { EditorState } from 'draft-js';
4
- import { Editor } from 'react-draft-wysiwyg';
5
- import { s as styled } from './stitches.config.esm.js';
6
- import '@stitches/react';
7
- import '@majoo-ui/core';
8
-
9
- var img$a = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M19.375 10L15 14.375L14.1187 13.4938L17.6063 10L14.1187 6.50625L15 5.625L19.375 10ZM0.625 10L5 5.625L5.88125 6.50625L2.39375 10L5.88125 13.4938L5 14.375L0.625 10Z' fill='%23272A2A'/%3e%3c/svg%3e";
10
-
11
- var img$9 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M11.4062 15.625H5.625V4.375H10.9375C11.5639 4.37504 12.1771 4.55435 12.7048 4.89174C13.2325 5.22914 13.6526 5.71052 13.9155 6.27903C14.1784 6.84754 14.2731 7.47942 14.1884 8.10001C14.1037 8.72061 13.8431 9.30399 13.4375 9.78125C13.9673 10.205 14.3528 10.7825 14.5408 11.4344C14.7289 12.0862 14.7102 12.7803 14.4875 13.4211C14.2647 14.0619 13.8488 14.6179 13.297 15.0126C12.7452 15.4073 12.0847 15.6213 11.4062 15.625ZM7.5 13.75H11.3937C11.5784 13.75 11.7613 13.7136 11.9319 13.643C12.1025 13.5723 12.2575 13.4687 12.3881 13.3381C12.5187 13.2075 12.6223 13.0525 12.693 12.8819C12.7636 12.7113 12.8 12.5284 12.8 12.3438C12.8 12.1591 12.7636 11.9762 12.693 11.8056C12.6223 11.635 12.5187 11.48 12.3881 11.3494C12.2575 11.2188 12.1025 11.1152 11.9319 11.0445C11.7613 10.9739 11.5784 10.9375 11.3937 10.9375H7.5V13.75ZM7.5 9.0625H10.9375C11.1222 9.0625 11.305 9.02613 11.4756 8.95546C11.6463 8.88478 11.8013 8.7812 11.9319 8.65062C12.0625 8.52004 12.166 8.36501 12.2367 8.1944C12.3074 8.02378 12.3438 7.84092 12.3438 7.65625C12.3438 7.47158 12.3074 7.28872 12.2367 7.1181C12.166 6.94749 12.0625 6.79246 11.9319 6.66188C11.8013 6.5313 11.6463 6.42772 11.4756 6.35704C11.305 6.28637 11.1222 6.25 10.9375 6.25H7.5V9.0625Z' fill='%23272A2A'/%3e%3c/svg%3e";
12
-
13
- var img$8 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M15.625 5.625V4.375H7.5V5.625H10.7125L7.98125 14.375H4.375V15.625H12.5V14.375H9.2875L12.0187 5.625H15.625Z' fill='%23272A2A'/%3e%3c/svg%3e";
14
-
15
- var img$7 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.5 16.25H17.5V17.5H2.5V16.25ZM10 14.375C8.83968 14.375 7.72688 13.9141 6.90641 13.0936C6.08594 12.2731 5.625 11.1603 5.625 10V3.125H6.875V10C6.875 10.8288 7.20424 11.6237 7.79029 12.2097C8.37634 12.7958 9.1712 13.125 10 13.125C10.8288 13.125 11.6237 12.7958 12.2097 12.2097C12.7958 11.6237 13.125 10.8288 13.125 10V3.125H14.375V10C14.375 11.1603 13.9141 12.2731 13.0936 13.0936C12.2731 13.9141 11.1603 14.375 10 14.375Z' fill='%23272A2A'/%3e%3c/svg%3e";
16
-
17
- var img$6 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.5 9.375H11.2225C10.945 9.30038 10.6662 9.23058 10.3863 9.16562C8.63125 8.75062 7.63875 8.44687 7.63875 7.02625C7.6245 6.78101 7.66081 6.53546 7.74542 6.30484C7.83004 6.07422 7.96115 5.86345 8.13062 5.68562C8.6615 5.24906 9.32644 5.00851 10.0137 5.00437C11.7825 4.96062 12.5981 5.56063 13.265 6.47313L14.2744 5.73563C13.8019 5.0571 13.1578 4.51616 12.4078 4.16807C11.6578 3.81998 10.8288 3.67722 10.0056 3.75437C8.99439 3.76083 8.01887 4.12909 7.25563 4.7925C6.96634 5.08594 6.74024 5.43552 6.59125 5.8197C6.44227 6.20388 6.37356 6.6145 6.38937 7.02625C6.36197 7.4768 6.4466 7.92713 6.63572 8.33699C6.82483 8.74685 7.11254 9.10347 7.47312 9.375H2.5V10.625H11.0325C12.2619 10.9812 12.9969 11.445 13.0156 12.7237C13.0359 12.9969 12.9985 13.2713 12.9056 13.529C12.8128 13.7867 12.6667 14.0219 12.4769 14.2194C11.8155 14.7407 10.9938 15.0166 10.1519 15C9.52345 14.9818 8.90738 14.8209 8.35029 14.5295C7.7932 14.2382 7.30966 13.8239 6.93625 13.3181L5.97812 14.1206C6.46358 14.7676 7.08994 15.2955 7.80972 15.6645C8.52951 16.0334 9.32384 16.2336 10.1325 16.25H10.195C11.3492 16.2633 12.4695 15.8596 13.35 15.1131C13.6625 14.798 13.9054 14.4209 14.0632 14.0061C14.2209 13.5914 14.2898 13.1481 14.2656 12.705C14.289 11.947 14.0332 11.2069 13.5469 10.625H17.5V9.375Z' fill='%23272A2A'/%3e%3c/svg%3e";
18
-
19
- var img$5 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M18.3988 10.3575L13.4081 5.36625C13.1736 5.13187 12.8556 5.00021 12.5241 5.00021C12.1925 5.00021 11.8745 5.13187 11.64 5.36625L8.29125 8.715L5.625 1.25H4.375L1.25 10H2.5L3.12438 8.125H6.87437L7.37625 9.63L2.86625 14.14C2.75012 14.2561 2.658 14.3939 2.59515 14.5456C2.5323 14.6973 2.49995 14.8599 2.49995 15.0241C2.49995 15.1883 2.5323 15.3508 2.59515 15.5025C2.658 15.6542 2.75012 15.792 2.86625 15.9081L5.7075 18.75H11.7013L18.3988 12.0519C18.5101 11.9406 18.5984 11.8085 18.6587 11.6631C18.719 11.5177 18.75 11.3618 18.75 11.2044C18.75 11.047 18.719 10.8911 18.6587 10.7457C18.5984 10.6003 18.5101 10.4681 18.3988 10.3569V10.3575ZM3.54063 6.875L4.9975 2.5L6.4575 6.875H3.54063ZM11.1844 17.5H6.225L3.75 15.0238L7.695 11.0794L12.65 16.0337L11.1844 17.5ZM13.5344 15.15L8.57938 10.1956L12.5244 6.25L17.4788 11.2044L13.5344 15.15Z' fill='%23272A2A'/%3e%3c/svg%3e";
20
-
21
- var img$4 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.5 6.25H4.88438L7.12625 4.00875L6.25 3.125L2.5 6.875L6.25 10.625L7.12625 9.74062L4.88625 7.5H12.5C13.4946 7.5 14.4484 7.89509 15.1517 8.59835C15.8549 9.30161 16.25 10.2554 16.25 11.25C16.25 12.2446 15.8549 13.1984 15.1517 13.9017C14.4484 14.6049 13.4946 15 12.5 15H7.5V16.25H12.5C13.8261 16.25 15.0979 15.7232 16.0355 14.7855C16.9732 13.8479 17.5 12.5761 17.5 11.25C17.5 9.92392 16.9732 8.65215 16.0355 7.71447C15.0979 6.77678 13.8261 6.25 12.5 6.25Z' fill='%23272A2A'/%3e%3c/svg%3e";
22
-
23
- var img$3 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.5 6.25H15.1156L12.8737 4.00875L13.75 3.125L17.5 6.875L13.75 10.625L12.8737 9.74062L15.1137 7.5H7.5C6.50544 7.5 5.55161 7.89509 4.84835 8.59835C4.14509 9.30161 3.75 10.2554 3.75 11.25C3.75 12.2446 4.14509 13.1984 4.84835 13.9017C5.55161 14.6049 6.50544 15 7.5 15H12.5V16.25H7.5C6.17392 16.25 4.90215 15.7232 3.96447 14.7855C3.02678 13.8479 2.5 12.5761 2.5 11.25C2.5 9.92392 3.02678 8.65215 3.96447 7.71447C4.90215 6.77678 6.17392 6.25 7.5 6.25Z' fill='%23272A2A'/%3e%3c/svg%3e";
24
-
25
- var img$2 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4.375 7.5C5.41053 7.5 6.25 6.66053 6.25 5.625C6.25 4.58947 5.41053 3.75 4.375 3.75C3.33947 3.75 2.5 4.58947 2.5 5.625C2.5 6.66053 3.33947 7.5 4.375 7.5Z' fill='%23272A2A'/%3e%3cpath d='M4.375 16.25C5.41053 16.25 6.25 15.4105 6.25 14.375C6.25 13.3395 5.41053 12.5 4.375 12.5C3.33947 12.5 2.5 13.3395 2.5 14.375C2.5 15.4105 3.33947 16.25 4.375 16.25Z' fill='%23272A2A'/%3e%3cpath d='M10 13.75H18.75V15H10V13.75ZM10 5H18.75V6.25H10V5Z' fill='%23272A2A'/%3e%3c/svg%3e";
26
-
27
- var img$1 = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M10 13.75H18.75V15H10V13.75ZM10 5H18.75V6.25H10V5ZM5 7.5V2.5H3.75V3.125H2.5V4.375H3.75V7.5H2.5V8.75H6.25V7.5H5ZM6.25 17.5H2.5V15C2.5 14.6685 2.6317 14.3505 2.86612 14.1161C3.10054 13.8817 3.41848 13.75 3.75 13.75H5V12.5H2.5V11.25H5C5.33152 11.25 5.64946 11.3817 5.88388 11.6161C6.1183 11.8505 6.25 12.1685 6.25 12.5V13.75C6.25 14.0815 6.1183 14.3995 5.88388 14.6339C5.64946 14.8683 5.33152 15 5 15H3.75V16.25H6.25V17.5Z' fill='%23272A2A'/%3e%3c/svg%3e";
28
-
29
- var img = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M18.2813 4.225C17.9329 3.8754 17.5189 3.59801 17.0631 3.40874C16.6073 3.21947 16.1186 3.12204 15.625 3.12204C15.1315 3.12204 14.6428 3.21947 14.187 3.40874C13.7312 3.59801 13.3172 3.8754 12.9688 4.225L13.8563 5.1125C14.089 4.87981 14.3652 4.69523 14.6692 4.56931C14.9733 4.44338 15.2991 4.37856 15.6282 4.37856C15.9572 4.37856 16.2831 4.44338 16.5871 4.56931C16.8911 4.69523 17.1674 4.87981 17.4 5.1125C17.6327 5.34518 17.8173 5.62142 17.9432 5.92544C18.0692 6.22946 18.134 6.5553 18.134 6.88437C18.134 7.21344 18.0692 7.53928 17.9432 7.8433C17.8173 8.14732 17.6327 8.42356 17.4 8.65625L12.4 13.6562C11.9309 14.1262 11.2944 14.3905 10.6304 14.3911C9.96638 14.3917 9.32935 14.1285 8.85942 13.6594C8.38949 13.1903 8.12515 12.5537 8.12457 11.8897C8.12398 11.2257 8.38719 10.5887 8.85629 10.1187L9.73754 9.23125L8.85629 8.34375L7.96879 9.23125C7.61919 9.57963 7.3418 9.99361 7.15253 10.4494C6.96326 10.9052 6.86583 11.3939 6.86583 11.8875C6.86583 12.381 6.96326 12.8697 7.15253 13.3256C7.3418 13.7814 7.61919 14.1954 7.96879 14.5437C8.67597 15.2419 9.63134 15.6308 10.625 15.625C11.1205 15.627 11.6114 15.5309 12.0695 15.3421C12.5276 15.1533 12.9437 14.8756 13.2938 14.525L18.2938 9.525C18.9944 8.82021 19.3866 7.86616 19.3842 6.87241C19.3819 5.87866 18.9852 4.92647 18.2813 4.225Z' fill='%23272A2A'/%3e%3cpath d='M2.61879 15.5125C2.38541 15.2802 2.20022 15.0041 2.07386 14.7C1.94749 14.3959 1.88244 14.0699 1.88244 13.7406C1.88244 13.4113 1.94749 13.0853 2.07386 12.7812C2.20022 12.4772 2.38541 12.201 2.61879 11.9687L7.61879 6.96875C7.85109 6.73537 8.1272 6.55018 8.43127 6.42381C8.73534 6.29745 9.06138 6.2324 9.39067 6.2324C9.71995 6.2324 10.046 6.29745 10.3501 6.42381C10.6541 6.55018 10.9302 6.73537 11.1625 6.96875C11.3944 7.20287 11.577 7.48116 11.6994 7.78713C11.8218 8.0931 11.8815 8.42052 11.875 8.75C11.8769 9.0805 11.8133 9.4081 11.6878 9.71385C11.5623 10.0196 11.3774 10.2974 11.1438 10.5312L9.81879 11.875L10.7063 12.7625L12.0313 11.4375C12.7366 10.7322 13.1328 9.77558 13.1328 8.77812C13.1328 7.78066 12.7366 6.82406 12.0313 6.11875C11.326 5.41344 10.3694 5.0172 9.37192 5.0172C8.37446 5.0172 7.41785 5.41344 6.71254 6.11875L1.71254 11.1187C1.362 11.4672 1.08382 11.8816 0.893994 12.338C0.704168 12.7944 0.606445 13.2838 0.606445 13.7781C0.606445 14.2724 0.704168 14.7618 0.893994 15.2182C1.08382 15.6746 1.362 16.089 1.71254 16.4375C2.42431 17.1303 3.38185 17.5124 4.37504 17.5C5.37698 17.501 6.33862 17.1055 7.05004 16.4L6.16254 15.5125C5.93025 15.7459 5.65413 15.9311 5.35006 16.0574C5.04599 16.1838 4.71995 16.2488 4.39067 16.2488C4.06138 16.2488 3.73534 16.1838 3.43127 16.0574C3.1272 15.9311 2.85109 15.7459 2.61879 15.5125Z' fill='%23272A2A'/%3e%3c/svg%3e";
30
-
31
- function seqNumberVariants(variantFn, max) {
32
- var _a;
33
- let variants = {};
34
- for (let i = 1; (_a = i <= max) !== null && _a !== void 0 ? _a : 100; i++) {
35
- variants = Object.assign(Object.assign({}, variants), {
36
- [i]: variantFn(i)
37
- });
38
- }
39
- return variants;
40
- }
41
- const Container = styled('div', {
42
- width: 460,
43
- '& > .wrapper-root > .toolbar-root': {
44
- border: '1px solid $bgOutline',
45
- borderRadius: 8,
46
- backgroundColor: '$bgWhite'
47
- },
48
- '& > .wrapper-root > .toolbar-root > div > .rdw-option-wrapper': {
49
- border: 'none !important',
50
- height: 'unset !important',
51
- borderRadius: '4px !important'
52
- },
53
- '& > .wrapper-root > .toolbar-root > div > .rdw-option-wrapper:hover': {
54
- boxShadow: 'none !important',
55
- backgroundColor: '$gray100 !important'
56
- },
57
- '& > .wrapper-root > .toolbar-root > div > .rdw-option-active': {
58
- backgroundColor: '$gray100 !important'
59
- },
60
- '& > .wrapper-root > .toolbar-root > div > .rdw-link-modal': {
61
- height: 'unset !important'
62
- },
63
- '& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper': {
64
- border: 'unset !important'
65
- },
66
- '& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper:hover': {
67
- boxShadow: 'none !important',
68
- backgroundColor: '$gray100 !important'
69
- },
70
- '& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper:active': {
71
- backgroundColor: '$gray100 !important'
72
- },
73
- '& > .wrapper-root > .editor-root': {
74
- border: '1px solid $bgOutline',
75
- borderRadius: 8,
76
- backgroundColor: '$bgWhite',
77
- padding: '$spacing-05',
78
- height: 400,
79
- '& > .DraftEditor-root > .public-DraftEditorPlaceholder-root': {
80
- fontWeight: 400,
81
- color: '$textDisable'
82
- }
83
- },
84
- '& > .wrapper-root > .editor-root > div > div > div > div > div > .public-DraftStyleDefault-ltr': {
85
- textAlign: 'unset !important'
86
- },
87
- variants: {
88
- editorHeight: seqNumberVariants(value => ({
89
- '& > .wrapper-root > .editor-root': {
90
- height: value
91
- }
92
- }), 1000),
93
- disabled: {
94
- true: {
95
- '& > .wrapper-root > .editor-root': {
96
- backgroundColor: '$formDisable',
97
- color: '$textDisable'
98
- },
99
- '& > .wrapper-root > .toolbar-root': {
100
- backgroundColor: '$formDisable',
101
- color: '$textDisable'
102
- },
103
- '& > .wrapper-root > .toolbar-root > div > .rdw-option-wrapper': {
104
- backgroundColor: '$formDisable !important',
105
- '& img': {
106
- filter: 'contrast(0)'
107
- }
108
- },
109
- '& > .wrapper-root > .toolbar-root > .rdw-dropdown-wrapper': {
110
- backgroundColor: '$formDisable !important',
111
- '& img': {
112
- filter: 'contrast(0)'
113
- },
114
- '& a': {
115
- pointerEvents: 'none'
116
- },
117
- '& > a > div': {
118
- borderTop: '6px solid $textDisable'
119
- }
120
- },
121
- '& > .wrapper-root > .toolbar-root > div > .rdw-dropdown-wrapper': {
122
- backgroundColor: '$formDisable !important',
123
- '& a': {
124
- pointerEvents: 'none'
125
- },
126
- '& > a > span': {
127
- color: '$textDisable'
128
- },
129
- '& > a > div': {
130
- borderTop: '6px solid $textDisable'
131
- }
132
- }
133
- }
134
- }
135
- }
136
- });
137
- const MaxLengthText = styled('p', {
138
- fontSize: 12,
139
- fontWeight: 400,
140
- color: '$textSecondary',
141
- textAlign: 'right',
142
- padding: '$spacing-03',
143
- variants: {
144
- warning: {
145
- true: {
146
- color: '$textRed'
147
- }
148
- }
149
- }
150
- });
151
- function ContentEditor(props) {
152
- var _a, _b, _c, _d;
153
- const {
154
- css,
155
- editorState: value,
156
- onChange,
157
- toolbar,
158
- editorHeight,
159
- uploadCallback,
160
- maxLength,
161
- disabled,
162
- placeholder
163
- } = props;
164
- const [editorState, setEditorState] = useState(() => EditorState.createEmpty());
165
- useEffect(() => {
166
- if (value) {
167
- setEditorState(value);
168
- }
169
- }, [value]);
170
- function onEditorStateChange(e) {
171
- setEditorState(e);
172
- onChange === null || onChange === void 0 ? void 0 : onChange(e);
173
- }
174
- const config = {
175
- options: ['history', 'fontFamily', 'inline', 'remove', 'blockType', 'textAlign', 'colorPicker', 'list', 'link', 'image'],
176
- history: {
177
- options: ['undo', 'redo'],
178
- undo: {
179
- icon: img$4
180
- },
181
- redo: {
182
- icon: img$3
183
- }
184
- },
185
- inline: {
186
- options: ['bold', 'italic', 'underline', 'strikethrough', 'monospace'],
187
- bold: {
188
- icon: img$9
189
- },
190
- italic: {
191
- icon: img$8
192
- },
193
- underline: {
194
- icon: img$7
195
- },
196
- strikethrough: {
197
- icon: img$6
198
- },
199
- monospace: {
200
- icon: img$a
201
- }
202
- },
203
- remove: {
204
- icon: img$5
205
- },
206
- blockType: {
207
- inDropdown: true,
208
- options: ['Normal', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'Blockquote', 'Code']
209
- },
210
- textAlign: {
211
- inDropdown: true
212
- },
213
- list: {
214
- inDropdown: false,
215
- options: ['unordered', 'ordered'],
216
- unordered: {
217
- icon: img$2
218
- },
219
- ordered: {
220
- icon: img$1
221
- }
222
- },
223
- link: {
224
- inDropdown: false,
225
- defaultTargetOption: '_self',
226
- options: ['link'],
227
- link: {
228
- icon: img
229
- }
230
- },
231
- fontFamily: {
232
- options: ['Inter', 'Roboto', 'Poppins', 'Tinos', 'Montserrat']
233
- },
234
- image: {
235
- uploadCallback: uploadCallback,
236
- previewImage: true,
237
- alt: {
238
- present: true,
239
- mandatory: false
240
- },
241
- inputAccept: 'image/gif,image/jpeg,image/jpg,image/png,image/svg'
242
- }
243
- };
244
- return jsxs(Container, {
245
- css: css,
246
- editorHeight: editorHeight,
247
- disabled: disabled,
248
- children: [jsx(Editor, {
249
- wrapperClassName: "wrapper-root",
250
- editorClassName: "editor-root",
251
- toolbarClassName: "toolbar-root",
252
- placeholder: placeholder,
253
- editorState: editorState,
254
- onEditorStateChange: onEditorStateChange,
255
- toolbar: toolbar ? toolbar(config) : config,
256
- readOnly: disabled
257
- }), maxLength && typeof maxLength === 'number' && jsx(MaxLengthText, {
258
- warning: ((_b = (_a = editorState === null || editorState === void 0 ? void 0 : editorState.getCurrentContent()) === null || _a === void 0 ? void 0 : _a.getPlainText()) === null || _b === void 0 ? void 0 : _b.length) > maxLength,
259
- children: `${(_d = (_c = editorState === null || editorState === void 0 ? void 0 : editorState.getCurrentContent()) === null || _c === void 0 ? void 0 : _c.getPlainText()) === null || _d === void 0 ? void 0 : _d.length} / ${maxLength}`
260
- })]
261
- });
262
- }
263
-
264
- export { ContentEditor };
1
+ export { default as ContentEditor } from './components/contentEditor/ContentEditor.esm.js';
@@ -0,0 +1,56 @@
1
+ import 'core-js/modules/es.array.includes.js';
2
+ import 'core-js/modules/es.array.push.js';
3
+ import 'core-js/modules/es.iterator.constructor.js';
4
+ import 'core-js/modules/es.iterator.for-each.js';
5
+ import 'core-js/modules/es.iterator.map.js';
6
+ import isArray from 'lodash/isArray';
7
+ import isFunction from 'lodash/isFunction';
8
+ import get from 'lodash/get';
9
+ import isNil from 'lodash/isNil';
10
+
11
+ // transform to labelInValue select AntDesign
12
+ function useListOption(list, nameKey, valueKey, disableList, separator) {
13
+ if (!list) return [];
14
+ return list.map((item, index) => {
15
+ const name = [];
16
+ if (isArray(nameKey)) {
17
+ nameKey.forEach(key => {
18
+ name.push(get(item, key));
19
+ });
20
+ } else if (isNil(nameKey)) {
21
+ name.push(item);
22
+ } else {
23
+ name.push(get(item, nameKey));
24
+ }
25
+ let value;
26
+ if (isNil(valueKey)) {
27
+ value = item;
28
+ } else if (isArray(valueKey)) {
29
+ for (let i = 0; i < valueKey.length; i += 1) {
30
+ const val = get(item, valueKey[i]);
31
+ if (val !== undefined) {
32
+ value = val;
33
+ // stop loop jika value ada
34
+ break;
35
+ }
36
+ }
37
+ } else {
38
+ value = get(item, valueKey);
39
+ }
40
+ const isDisabled = disableList ? disableList === null || disableList === void 0 ? void 0 : disableList.includes(value) : false;
41
+ const label = isFunction(separator) ?
42
+ // @ts-ignore
43
+ separator(name.length <= 1 ? name[0] : name, item, index) :
44
+ // @ts-ignore
45
+ name.join(separator || ' - ');
46
+ return {
47
+ name: label,
48
+ rec: item,
49
+ value,
50
+ key: value,
51
+ isDisabled
52
+ };
53
+ });
54
+ }
55
+
56
+ export { useListOption };
@@ -0,0 +1,8 @@
1
+ import { useReducer } from 'react';
2
+
3
+ const toggleReducer = (state, nextValue) => typeof nextValue === 'boolean' ? nextValue : !state;
4
+ const useToggle = initialValue => {
5
+ return useReducer(toggleReducer, initialValue);
6
+ };
7
+
8
+ export { useToggle };