@licklist/design 0.78.28 → 0.78.30

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 (144) hide show
  1. package/dist/assets/Trend-Down.svg.js +16 -0
  2. package/dist/assets/Trend-Up.svg.js +16 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +24 -0
  6. package/dist/v2/components/Alert/Alert.js +87 -0
  7. package/dist/v2/components/Alert/Alert.scss.js +6 -0
  8. package/dist/v2/components/Button/Button.d.ts +8 -4
  9. package/dist/v2/components/Button/Button.d.ts.map +1 -1
  10. package/dist/v2/components/Button/Button.js +121 -0
  11. package/dist/v2/components/Button/Button.scss.js +6 -0
  12. package/dist/v2/components/Button/index.d.ts +2 -2
  13. package/dist/v2/components/Button/index.d.ts.map +1 -1
  14. package/dist/v2/components/Checkbox/Checkbox.d.ts +9 -0
  15. package/dist/v2/components/Checkbox/Checkbox.d.ts.map +1 -0
  16. package/dist/v2/components/Checkbox/Checkbox.js +231 -0
  17. package/dist/v2/components/Checkbox/Checkbox.scss.js +6 -0
  18. package/dist/v2/components/Checkbox/index.d.ts +3 -0
  19. package/dist/v2/components/Checkbox/index.d.ts.map +1 -0
  20. package/dist/v2/components/FormField/FormField.d.ts +10 -0
  21. package/dist/v2/components/FormField/FormField.d.ts.map +1 -0
  22. package/dist/v2/components/FormField/FormField.js +98 -0
  23. package/dist/v2/components/FormField/FormField.scss.js +6 -0
  24. package/dist/v2/components/FormField/index.d.ts +3 -0
  25. package/dist/v2/components/FormField/index.d.ts.map +1 -0
  26. package/dist/v2/components/NPSScore/NPSScore.js +546 -0
  27. package/dist/v2/components/NPSScore/NPSScore.scss.js +6 -0
  28. package/dist/v2/components/NewInput/NewInput.d.ts +20 -0
  29. package/dist/v2/components/NewInput/NewInput.d.ts.map +1 -0
  30. package/dist/v2/components/NewInput/NewInput.js +134 -0
  31. package/dist/v2/components/NewInput/index.d.ts +2 -0
  32. package/dist/v2/components/NewInput/index.d.ts.map +1 -0
  33. package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts +10 -0
  34. package/dist/v2/components/NewPageHeader/NewPageHeader.d.ts.map +1 -0
  35. package/dist/v2/components/NewPageHeader/NewPageHeader.js +36 -0
  36. package/dist/v2/components/NewPageHeader/NewPageHeader.scss.js +6 -0
  37. package/dist/v2/components/NewPageHeader/index.d.ts +2 -0
  38. package/dist/v2/components/NewPageHeader/index.d.ts.map +1 -0
  39. package/dist/v2/components/SectionHeader/SectionHeader.d.ts +8 -0
  40. package/dist/v2/components/SectionHeader/SectionHeader.d.ts.map +1 -0
  41. package/dist/v2/components/SectionHeader/SectionHeader.js +13 -0
  42. package/dist/v2/components/SectionHeader/SectionHeader.scss.js +6 -0
  43. package/dist/v2/components/SectionHeader/index.d.ts +3 -0
  44. package/dist/v2/components/SectionHeader/index.d.ts.map +1 -0
  45. package/dist/v2/components/Select/Select.js +128 -0
  46. package/dist/v2/components/Select/Select.scss.js +6 -0
  47. package/dist/v2/components/WYSIWYGEditor/Icons.d.ts +16 -0
  48. package/dist/v2/components/WYSIWYGEditor/Icons.d.ts.map +1 -0
  49. package/dist/v2/components/WYSIWYGEditor/Icons.js +221 -0
  50. package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.d.ts +14 -0
  51. package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.d.ts.map +1 -0
  52. package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.js +358 -0
  53. package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +6 -0
  54. package/dist/v2/components/WYSIWYGEditor/index.d.ts +3 -0
  55. package/dist/v2/components/WYSIWYGEditor/index.d.ts.map +1 -0
  56. package/dist/v2/components/index.d.ts +22 -0
  57. package/dist/v2/components/index.d.ts.map +1 -0
  58. package/dist/v2/dashboard-analytics/blog-posts/Blog.js +103 -0
  59. package/dist/v2/dashboard-analytics/blog-posts/Blog.scss.js +6 -0
  60. package/dist/v2/dashboard-analytics/chart/Chart.js +733 -0
  61. package/dist/v2/dashboard-analytics/chart/Chart.scss.js +6 -0
  62. package/dist/v2/dashboard-analytics/dashboard/Dashboard.js +270 -0
  63. package/dist/v2/dashboard-analytics/dashboard/Dashboard.scss.js +6 -0
  64. package/dist/v2/dashboard-analytics/metric-card/MetricCard.js +65 -0
  65. package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +6 -0
  66. package/dist/v2/dashboard-analytics/venue-card/VenueCard.js +50 -0
  67. package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +6 -0
  68. package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.js +48 -0
  69. package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +6 -0
  70. package/dist/v2/icons/index.js +61 -1
  71. package/dist/v2/index.d.ts +3 -1
  72. package/dist/v2/index.d.ts.map +1 -1
  73. package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +1 -1
  74. package/dist/v2/pages/Settings/SettingsPage.d.ts +13 -0
  75. package/dist/v2/pages/Settings/SettingsPage.d.ts.map +1 -0
  76. package/dist/v2/pages/Settings/SettingsPage.js +88 -0
  77. package/dist/v2/pages/Settings/SettingsPage.scss.js +6 -0
  78. package/dist/v2/pages/Settings/SettingsTabs.d.ts +14 -0
  79. package/dist/v2/pages/Settings/SettingsTabs.d.ts.map +1 -0
  80. package/dist/v2/pages/Settings/SettingsTabs.js +29 -0
  81. package/dist/v2/pages/Settings/SettingsTabs.scss.js +6 -0
  82. package/dist/v2/pages/Settings/components/SidebarCustomisation.js +283 -0
  83. package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +6 -0
  84. package/dist/v2/pages/Settings/components/SidebarNavItem.d.ts +19 -0
  85. package/dist/v2/pages/Settings/components/SidebarNavItem.d.ts.map +1 -0
  86. package/dist/v2/pages/Settings/components/SidebarNavItem.js +41 -0
  87. package/dist/v2/pages/Settings/components/SidebarNavItem.scss.js +6 -0
  88. package/dist/v2/pages/Settings/components/index.d.ts +5 -0
  89. package/dist/v2/pages/Settings/components/index.d.ts.map +1 -0
  90. package/dist/v2/pages/Settings/index.d.ts +7 -0
  91. package/dist/v2/pages/Settings/index.d.ts.map +1 -0
  92. package/dist/v2/styles/form/NewInput.scss.js +6 -0
  93. package/package.json +3 -3
  94. package/src/index.ts +4 -1
  95. package/src/v2/components/Alert/Alert.scss +3 -3
  96. package/src/v2/components/Button/Button.tsx +34 -12
  97. package/src/v2/components/Button/index.ts +2 -2
  98. package/src/v2/components/Checkbox/Checkbox.scss +211 -0
  99. package/src/v2/components/Checkbox/Checkbox.stories.tsx +316 -0
  100. package/src/v2/components/Checkbox/Checkbox.tsx +106 -0
  101. package/src/v2/components/Checkbox/index.ts +3 -0
  102. package/src/v2/components/FormField/FormField.scss +87 -0
  103. package/src/v2/components/FormField/FormField.stories.tsx +71 -0
  104. package/src/v2/components/FormField/FormField.tsx +37 -0
  105. package/src/v2/components/FormField/index.ts +3 -0
  106. package/src/v2/components/NewInput/NewInput.stories.tsx +433 -0
  107. package/src/v2/components/NewInput/NewInput.tsx +96 -0
  108. package/src/v2/components/NewInput/index.ts +1 -0
  109. package/src/v2/components/NewPageHeader/NewPageHeader.scss +47 -0
  110. package/src/v2/components/NewPageHeader/NewPageHeader.stories.tsx +44 -0
  111. package/src/v2/components/NewPageHeader/NewPageHeader.tsx +35 -0
  112. package/src/v2/components/NewPageHeader/index.ts +1 -0
  113. package/src/v2/components/SectionHeader/SectionHeader.scss +11 -0
  114. package/src/v2/components/SectionHeader/SectionHeader.tsx +15 -0
  115. package/src/v2/components/SectionHeader/index.ts +2 -0
  116. package/src/v2/components/Select/Select.scss +5 -5
  117. package/src/v2/components/WYSIWYGEditor/Icons.tsx +93 -0
  118. package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss +310 -0
  119. package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.stories.tsx +252 -0
  120. package/src/v2/components/WYSIWYGEditor/WYSIWYGEditor.tsx +393 -0
  121. package/src/v2/components/WYSIWYGEditor/index.ts +3 -0
  122. package/src/v2/components/index.ts +37 -0
  123. package/src/v2/index.ts +10 -2
  124. package/src/v2/navigation/DashboardLayout/TopNavigation.scss +1 -0
  125. package/src/v2/pages/Settings/SettingsContentPlaceholder.scss +24 -0
  126. package/src/v2/pages/Settings/SettingsPage.scss +52 -0
  127. package/src/v2/pages/Settings/SettingsPage.tsx +46 -0
  128. package/src/v2/pages/Settings/SettingsTabs.scss +44 -0
  129. package/src/v2/pages/Settings/SettingsTabs.tsx +36 -0
  130. package/src/v2/pages/Settings/components/SidebarCustomisation.stories.tsx +48 -0
  131. package/src/v2/pages/Settings/components/SidebarNavItem.scss +76 -0
  132. package/src/v2/pages/Settings/components/SidebarNavItem.stories.tsx +50 -0
  133. package/src/v2/pages/Settings/components/SidebarNavItem.tsx +52 -0
  134. package/src/v2/pages/Settings/components/index.ts +5 -0
  135. package/src/v2/pages/Settings/index.ts +8 -0
  136. package/src/v2/styles/components/Button.scss +51 -53
  137. package/src/v2/styles/form/Layout.scss +15 -0
  138. package/src/v2/styles/form/NewInput.scss +83 -53
  139. package/src/v2/styles/index.scss +1 -0
  140. package/src/v2/styles/tokens/_colors.scss +6 -6
  141. package/src/v2/styles/tokens/_typography.scss +2 -2
  142. package/dist/v2/navigation/icons/index.d.ts +0 -12
  143. package/dist/v2/navigation/icons/index.d.ts.map +0 -1
  144. package/src/v2/navigation/icons/index.tsx +0 -72
@@ -0,0 +1,221 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+
3
+ var BoldIcon = function() {
4
+ return /*#__PURE__*/ jsx("svg", {
5
+ xmlns: "http://www.w3.org/2000/svg",
6
+ width: "34",
7
+ height: "34",
8
+ viewBox: "0 0 24 24",
9
+ fill: "none",
10
+ children: /*#__PURE__*/ jsx("path", {
11
+ d: "M9 11.25H12.375C13.4105 11.25 14.25 10.4105 14.25 9.375C14.25 8.33947 13.4105 7.5 12.375 7.5H9V11.25ZM16.5 14.625C16.5 16.489 14.989 18 13.125 18H7.5V6H12.375C14.239 6 15.75 7.51104 15.75 9.375C15.75 10.2782 15.3952 11.0986 14.8173 11.7043C15.8234 12.2885 16.5 13.3777 16.5 14.625ZM9 12.75V16.5H13.125C14.1605 16.5 15 15.6605 15 14.625C15 13.5895 14.1605 12.75 13.125 12.75H9Z",
12
+ fill: "#626A90"
13
+ })
14
+ });
15
+ };
16
+ var ItalicIcon = function() {
17
+ return /*#__PURE__*/ jsx("svg", {
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ width: "24",
20
+ height: "24",
21
+ viewBox: "0 0 24 24",
22
+ fill: "none",
23
+ children: /*#__PURE__*/ jsx("path", {
24
+ d: "M14.25 18H8.25V16.5H10.445L12.0319 7.5H9.75V6H15.75V7.5H13.555L11.9681 16.5H14.25V18Z",
25
+ fill: "#626A90"
26
+ })
27
+ });
28
+ };
29
+ var UnderlineIcon = function() {
30
+ return /*#__PURE__*/ jsx("svg", {
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ width: "24",
33
+ height: "24",
34
+ viewBox: "0 0 24 24",
35
+ fill: "none",
36
+ children: /*#__PURE__*/ jsx("path", {
37
+ d: "M9 5.25V12C9 13.6568 10.3431 15 12 15C13.6568 15 15 13.6568 15 12V5.25H16.5V12C16.5 14.4853 14.4853 16.5 12 16.5C9.51472 16.5 7.5 14.4853 7.5 12V5.25H9ZM6 18H18V19.5H6V18Z",
38
+ fill: "#626A90"
39
+ })
40
+ });
41
+ };
42
+ var StrikeThroughIcon = function() {
43
+ return /*#__PURE__*/ jsx("svg", {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: "24",
46
+ height: "24",
47
+ viewBox: "0 0 24 24",
48
+ fill: "none",
49
+ children: /*#__PURE__*/ jsx("path", {
50
+ d: "M15.8653 13.5C16.0384 13.8871 16.125 14.317 16.125 14.7897C16.125 15.7969 15.7322 16.5837 14.9465 17.1503C14.1607 17.7167 13.0751 18 11.6896 18C10.4601 18 9.24251 17.7139 8.03694 17.1416V15.4507C9.17653 16.1087 10.3431 16.4377 11.5367 16.4377C13.45 16.4377 14.4096 15.8884 14.4156 14.7897C14.4156 14.3204 14.2537 13.9198 13.9298 13.588C13.9004 13.5579 13.8704 13.5286 13.8398 13.5H5.25V12H18.75V13.5H15.8653ZM12.807 11.25H8.72181C8.59245 11.1325 8.47212 11.0019 8.36082 10.8584C8.03694 10.4406 7.875 9.93419 7.875 9.33905C7.875 8.41202 8.22437 7.62375 8.92312 6.97425C9.62187 6.32474 10.703 6 12.1664 6C13.2701 6 14.3257 6.24606 15.3333 6.7382V8.35193C14.4336 7.83691 13.447 7.5794 12.3734 7.5794C10.514 7.5794 9.58438 8.16595 9.58438 9.33905C9.58438 9.65379 9.74782 9.92847 10.0747 10.1631C10.4016 10.3977 10.8049 10.5851 11.2847 10.7253C11.7499 10.8612 12.2573 11.0361 12.807 11.25Z",
51
+ fill: "#626A90"
52
+ })
53
+ });
54
+ };
55
+ var Heading1Icon = function() {
56
+ return /*#__PURE__*/ jsx("svg", {
57
+ xmlns: "http://www.w3.org/2000/svg",
58
+ width: "15",
59
+ height: "12",
60
+ viewBox: "0 0 15 12",
61
+ fill: "none",
62
+ children: /*#__PURE__*/ jsx("path", {
63
+ d: "M3.3125 4.63086H6.87891V0H10.1914V12H6.87891V7.28418H3.3125V12H0V0H3.3125V4.63086ZM14.54 12H12.9717V7.96191H11.5654V6.85254H12.1152C12.9535 6.85254 13.2871 6.54609 13.2871 5.59961H14.54V12Z",
64
+ fill: "#626A90"
65
+ })
66
+ });
67
+ };
68
+ var Heading2Icon = function() {
69
+ return /*#__PURE__*/ jsx("svg", {
70
+ xmlns: "http://www.w3.org/2000/svg",
71
+ width: "17",
72
+ height: "12",
73
+ viewBox: "0 0 17 12",
74
+ fill: "none",
75
+ children: /*#__PURE__*/ jsx("path", {
76
+ d: "M3.3125 4.63086H6.87891V0H10.1914V12H6.87891V7.28418H3.3125V12H0V0H3.3125V4.63086ZM14.3154 5.45605C15.8385 5.4562 16.7217 6.24039 16.7217 7.41211C16.7216 8.41248 16.2352 8.84564 15.0635 9.47656C14.0813 9.99919 13.6486 10.4133 13.6123 10.7197H16.7217V12H11.7549C11.7549 10.2603 12.3864 9.36835 13.9639 8.53906C14.8381 8.0794 15.1172 7.86234 15.1172 7.42969C15.1171 7.02416 14.8377 6.73535 14.333 6.73535C13.7651 6.73536 13.4225 7.10543 13.3594 7.77246L11.7549 7.68262C11.8631 6.27643 12.783 5.45605 14.3154 5.45605Z",
77
+ fill: "#626A90"
78
+ })
79
+ });
80
+ };
81
+ var ParagraphIcon = function() {
82
+ return /*#__PURE__*/ jsx("svg", {
83
+ xmlns: "http://www.w3.org/2000/svg",
84
+ width: "24",
85
+ height: "24",
86
+ viewBox: "0 0 24 24",
87
+ fill: "none",
88
+ children: /*#__PURE__*/ jsx("path", {
89
+ d: "M12 7.5V18.75H10.5V15C8.01472 15 6 12.9853 6 10.5C6 8.01472 8.01472 6 10.5 6H18V7.5H15.75V18.75H14.25V7.5H12ZM10.5 7.5C8.84314 7.5 7.5 8.84314 7.5 10.5C7.5 12.1568 8.84314 13.5 10.5 13.5V7.5Z",
90
+ fill: "#626A90"
91
+ })
92
+ });
93
+ };
94
+ var BulletListIcon = function() {
95
+ return /*#__PURE__*/ jsx("svg", {
96
+ xmlns: "http://www.w3.org/2000/svg",
97
+ width: "24",
98
+ height: "24",
99
+ viewBox: "0 0 24 24",
100
+ fill: "none",
101
+ children: /*#__PURE__*/ jsx("path", {
102
+ d: "M9 6H18.75V7.5H9V6ZM6.375 7.875C5.75368 7.875 5.25 7.37132 5.25 6.75C5.25 6.12868 5.75368 5.625 6.375 5.625C6.99632 5.625 7.5 6.12868 7.5 6.75C7.5 7.37132 6.99632 7.875 6.375 7.875ZM6.375 13.125C5.75368 13.125 5.25 12.6213 5.25 12C5.25 11.3787 5.75368 10.875 6.375 10.875C6.99632 10.875 7.5 11.3787 7.5 12C7.5 12.6213 6.99632 13.125 6.375 13.125ZM6.375 18.3C5.75368 18.3 5.25 17.7963 5.25 17.175C5.25 16.5537 5.75368 16.05 6.375 16.05C6.99632 16.05 7.5 16.5537 7.5 17.175C7.5 17.7963 6.99632 18.3 6.375 18.3ZM9 11.25H18.75V12.75H9V11.25ZM9 16.5H18.75V18H9V16.5Z",
103
+ fill: "#626A90"
104
+ })
105
+ });
106
+ };
107
+ var NumberedListIcon = function() {
108
+ return /*#__PURE__*/ jsx("svg", {
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ width: "24",
111
+ height: "24",
112
+ viewBox: "0 0 24 24",
113
+ fill: "none",
114
+ children: /*#__PURE__*/ jsx("path", {
115
+ d: "M7.31268 5.625H6.538L5.4375 5.91988V7.08436L6.18752 6.88337L6.18763 9.375H5.25V10.5H8.25V9.375H7.31268V5.625ZM10.5 6H18.75V7.5H10.5V6ZM10.5 11.25H18.75V12.75H10.5V11.25ZM10.5 16.5H18.75V18H10.5V16.5ZM5.15625 14.7188C5.15625 13.8385 5.86979 13.125 6.75 13.125C7.63021 13.125 8.34375 13.8385 8.34375 14.7188C8.34375 15.0829 8.22137 15.419 8.0156 15.6875L8.01203 15.6922L6.9869 16.875H8.25V18H5.25009L5.24969 17.1589L7.10378 15.0262C7.17548 14.9439 7.21875 14.8366 7.21875 14.7188C7.21875 14.4599 7.00889 14.25 6.75 14.25C6.50533 14.25 6.3043 14.4376 6.2831 14.6766L6.27382 14.9062H5.15625V14.7188Z",
116
+ fill: "#626A90"
117
+ })
118
+ });
119
+ };
120
+ var QuoteAltIcon = function() {
121
+ return /*#__PURE__*/ jsx("svg", {
122
+ xmlns: "http://www.w3.org/2000/svg",
123
+ width: "24",
124
+ height: "24",
125
+ viewBox: "0 0 24 24",
126
+ fill: "none",
127
+ children: /*#__PURE__*/ jsx("path", {
128
+ d: "M6.43756 15.9909C5.66487 15.1706 5.25 14.25 5.25 12.7578C5.25 10.1332 7.09238 7.78029 9.77294 6.61743L10.4425 7.65064C7.94103 9.00409 7.45214 10.7595 7.25673 11.8665C7.65947 11.6583 8.18669 11.585 8.70353 11.6329C10.0568 11.7584 11.1234 12.8693 11.1234 14.25C11.1234 15.6998 9.94812 16.875 8.49837 16.875C7.69357 16.875 6.92397 16.5072 6.43756 15.9909ZM13.9375 15.9909C13.1649 15.1706 12.75 14.25 12.75 12.7578C12.75 10.1332 14.5924 7.78029 17.2729 6.61743L17.9425 7.65064C15.441 9.00409 14.9522 10.7595 14.7567 11.8665C15.1594 11.6583 15.6867 11.585 16.2035 11.6329C17.5568 11.7584 18.6234 12.8693 18.6234 14.25C18.6234 15.6998 17.4481 16.875 15.9984 16.875C15.1936 16.875 14.424 16.5072 13.9375 15.9909Z",
129
+ fill: "#626A90"
130
+ })
131
+ });
132
+ };
133
+ var DividerIcon = function() {
134
+ return /*#__PURE__*/ jsxs("svg", {
135
+ xmlns: "http://www.w3.org/2000/svg",
136
+ width: "24",
137
+ height: "24",
138
+ viewBox: "0 0 24 24",
139
+ fill: "none",
140
+ children: [
141
+ /*#__PURE__*/ jsx("rect", {
142
+ x: "5.25",
143
+ y: "11.25",
144
+ width: "13.5",
145
+ height: "1.5",
146
+ fill: "#626A90"
147
+ }),
148
+ /*#__PURE__*/ jsx("circle", {
149
+ cx: "21.75",
150
+ cy: "12",
151
+ r: "0.75",
152
+ fill: "#626A90",
153
+ "fill-opacity": "0.5"
154
+ }),
155
+ /*#__PURE__*/ jsx("circle", {
156
+ cx: "2.25",
157
+ cy: "12",
158
+ r: "0.75",
159
+ fill: "#626A90",
160
+ "fill-opacity": "0.5"
161
+ })
162
+ ]
163
+ });
164
+ };
165
+ var HardBreakIcon = function() {
166
+ return /*#__PURE__*/ jsx("svg", {
167
+ xmlns: "http://www.w3.org/2000/svg",
168
+ width: "24",
169
+ height: "24",
170
+ viewBox: "0 0 24 24",
171
+ fill: "none",
172
+ children: /*#__PURE__*/ jsx("path", {
173
+ d: "M14.25 16.5H15.375C16.4105 16.5 17.25 15.6605 17.25 14.625C17.25 13.5895 16.4105 12.75 15.375 12.75H5.25V11.25H15.375C17.239 11.25 18.75 12.761 18.75 14.625C18.75 16.489 17.239 18 15.375 18H14.25V19.5L11.25 17.25L14.25 15V16.5ZM5.25 6H18.75V7.5H5.25V6ZM9.75 16.5V18H5.25V16.5H9.75Z",
174
+ fill: "#626A90"
175
+ })
176
+ });
177
+ };
178
+ var UndoIcon = function() {
179
+ return /*#__PURE__*/ jsx("svg", {
180
+ xmlns: "http://www.w3.org/2000/svg",
181
+ width: "24",
182
+ height: "24",
183
+ viewBox: "0 0 24 24",
184
+ fill: "none",
185
+ children: /*#__PURE__*/ jsx("path", {
186
+ d: "M6.06131 6.69136C5.88684 6.85818 5.71976 7.03357 5.56136 7.21755C5.32407 7.49319 5.10569 7.78768 4.90881 8.09936C4.77746 8.30727 4.65565 8.52287 4.54421 8.7457C4.48837 8.85736 4.43524 8.9709 4.38469 9.08613C4.2839 9.31587 4.19401 9.5527 4.11539 9.796C4.07598 9.91797 4.03914 10.0416 4.00559 10.1668C3.93079 10.446 3.87328 10.7259 3.83158 11.0051C3.82934 11.0201 3.82751 11.0351 3.82536 11.05C3.81494 11.1228 3.80597 11.1955 3.79774 11.2682C3.79428 11.2986 3.79116 11.329 3.78807 11.3594C3.78326 11.4071 3.77883 11.4547 3.77495 11.5023C3.75889 11.6978 3.75077 11.8926 3.75009 12.0865C3.75003 12.1086 3.74996 12.1307 3.75009 12.1528C3.75089 12.3012 3.75571 12.449 3.76528 12.5961C3.7665 12.6146 3.76808 12.633 3.76943 12.6514C3.82014 13.3498 3.96775 14.0309 4.20377 14.6767L7.62813 11.1377L5.45502 10.5556C5.48179 10.4557 5.51129 10.3567 5.54272 10.2594C5.66865 9.8695 5.83151 9.50078 6.02609 9.15588C6.07459 9.06992 6.12494 8.9854 6.17732 8.90245C6.91264 7.73794 8.02285 6.87449 9.29715 6.43448C9.38818 6.40305 9.48005 6.37386 9.57268 6.34679C10.1284 6.18439 10.7114 6.10131 11.3052 6.10717C11.4042 6.10814 11.5034 6.11157 11.6028 6.11753C12.0008 6.14137 12.4022 6.2058 12.8023 6.31295C13.2945 6.44483 13.7566 6.63317 14.182 6.8709C14.2125 6.88794 14.2416 6.90723 14.2718 6.92476C14.7547 7.20595 15.1899 7.54933 15.5686 7.94261C15.6449 8.02185 15.7186 8.10326 15.7902 8.18637C15.9047 8.31912 16.0139 8.45605 16.1162 8.59793C16.1915 8.70249 16.2625 8.80995 16.3309 8.91903C17.1864 10.2824 17.4949 11.9837 17.0456 13.6609C16.327 16.3424 13.9009 18.1093 11.2507 18.108V19.6078C14.5636 19.6095 17.5967 17.4016 18.4951 14.0497C19.0819 11.8595 18.6347 9.6365 17.4544 7.89634L17.4558 7.89496C17.4301 7.85706 17.4028 7.81984 17.3764 7.78241C17.3604 7.75975 17.3443 7.73721 17.3281 7.71473C17.2772 7.64435 17.2253 7.57483 17.172 7.50619C17.1543 7.48339 17.1368 7.46044 17.1188 7.43783C17.0658 7.37103 17.0112 7.30536 16.9559 7.24034C16.9336 7.21424 16.9115 7.18811 16.8889 7.16231C16.8382 7.10446 16.7867 7.04739 16.7342 6.99105C16.7045 6.95913 16.6747 6.92719 16.6444 6.89576C16.4036 6.64603 16.1448 6.41195 15.869 6.19625C15.8379 6.17193 15.8052 6.14967 15.7737 6.12582C15.715 6.08143 15.657 6.03598 15.5969 5.99323C15.5586 5.96599 15.5191 5.94038 15.4802 5.91382C15.4213 5.87363 15.3622 5.83365 15.302 5.79505C15.2644 5.7709 15.2263 5.74744 15.1881 5.72393C15.1285 5.6872 15.0687 5.65066 15.0079 5.61551C14.959 5.58729 14.9097 5.55983 14.8601 5.53265C14.8028 5.50128 14.745 5.47076 14.6868 5.44081C14.6463 5.41998 14.6055 5.39949 14.5645 5.37935C14.4883 5.3419 14.4111 5.30595 14.3332 5.27093C14.3021 5.25697 14.2713 5.24238 14.24 5.22881C14.1572 5.19297 14.0732 5.15965 13.9886 5.12661C13.953 5.11267 13.9176 5.09792 13.8816 5.08449C13.8148 5.05956 13.7471 5.03652 13.6793 5.01337C13.6344 4.99807 13.5899 4.98161 13.5446 4.9671C13.4284 4.92988 13.3102 4.89544 13.1911 4.86352C12.691 4.72957 12.1893 4.6496 11.6919 4.61976C11.4431 4.60484 11.1954 4.60237 10.9496 4.61217C10.8266 4.61706 10.7042 4.62473 10.5822 4.63564C10.3388 4.65745 10.0974 4.69064 9.85925 4.73577C8.42886 5.00676 7.10753 5.69099 6.06131 6.69136Z",
187
+ fill: "#626A90"
188
+ })
189
+ });
190
+ };
191
+ var RedoIcon = function() {
192
+ return /*#__PURE__*/ jsx("svg", {
193
+ xmlns: "http://www.w3.org/2000/svg",
194
+ width: "24",
195
+ height: "24",
196
+ viewBox: "0 0 24 24",
197
+ fill: "none",
198
+ style: {
199
+ transform: 'scaleX(-1)'
200
+ },
201
+ children: /*#__PURE__*/ jsx("path", {
202
+ d: "M6.06131 6.69136C5.88684 6.85818 5.71976 7.03357 5.56136 7.21755C5.32407 7.49319 5.10569 7.78768 4.90881 8.09936C4.77746 8.30727 4.65565 8.52287 4.54421 8.7457C4.48837 8.85736 4.43524 8.9709 4.38469 9.08613C4.2839 9.31587 4.19401 9.5527 4.11539 9.796C4.07598 9.91797 4.03914 10.0416 4.00559 10.1668C3.93079 10.446 3.87328 10.7259 3.83158 11.0051C3.82934 11.0201 3.82751 11.0351 3.82536 11.05C3.81494 11.1228 3.80597 11.1955 3.79774 11.2682C3.79428 11.2986 3.79116 11.329 3.78807 11.3594C3.78326 11.4071 3.77883 11.4547 3.77495 11.5023C3.75889 11.6978 3.75077 11.8926 3.75009 12.0865C3.75003 12.1086 3.74996 12.1307 3.75009 12.1528C3.75089 12.3012 3.75571 12.449 3.76528 12.5961C3.7665 12.6146 3.76808 12.633 3.76943 12.6514C3.82014 13.3498 3.96775 14.0309 4.20377 14.6767L7.62813 11.1377L5.45502 10.5556C5.48179 10.4557 5.51129 10.3567 5.54272 10.2594C5.66865 9.8695 5.83151 9.50078 6.02609 9.15588C6.07459 9.06992 6.12494 8.9854 6.17732 8.90245C6.91264 7.73794 8.02285 6.87449 9.29715 6.43448C9.38818 6.40305 9.48005 6.37386 9.57268 6.34679C10.1284 6.18439 10.7114 6.10131 11.3052 6.10717C11.4042 6.10814 11.5034 6.11157 11.6028 6.11753C12.0008 6.14137 12.4022 6.2058 12.8023 6.31295C13.2945 6.44483 13.7566 6.63317 14.182 6.8709C14.2125 6.88794 14.2416 6.90723 14.2718 6.92476C14.7547 7.20595 15.1899 7.54933 15.5686 7.94261C15.6449 8.02185 15.7186 8.10326 15.7902 8.18637C15.9047 8.31912 16.0139 8.45605 16.1162 8.59793C16.1915 8.70249 16.2625 8.80995 16.3309 8.91903C17.1864 10.2824 17.4949 11.9837 17.0456 13.6609C16.327 16.3424 13.9009 18.1093 11.2507 18.108V19.6078C14.5636 19.6095 17.5967 17.4016 18.4951 14.0497C19.0819 11.8595 18.6347 9.6365 17.4544 7.89634L17.4558 7.89496C17.4301 7.85706 17.4028 7.81984 17.3764 7.78241C17.3604 7.75975 17.3443 7.73721 17.3281 7.71473C17.2772 7.64435 17.2253 7.57483 17.172 7.50619C17.1543 7.48339 17.1368 7.46044 17.1188 7.43783C17.0658 7.37103 17.0112 7.30536 16.9559 7.24034C16.9336 7.21424 16.9115 7.18811 16.8889 7.16231C16.8382 7.10446 16.7867 7.04739 16.7342 6.99105C16.7045 6.95913 16.6747 6.92719 16.6444 6.89576C16.4036 6.64603 16.1448 6.41195 15.869 6.19625C15.8379 6.17193 15.8052 6.14967 15.7737 6.12582C15.715 6.08143 15.657 6.03598 15.5969 5.99323C15.5586 5.96599 15.5191 5.94038 15.4802 5.91382C15.4213 5.87363 15.3622 5.83365 15.302 5.79505C15.2644 5.7709 15.2263 5.74744 15.1881 5.72393C15.1285 5.6872 15.0687 5.65066 15.0079 5.61551C14.959 5.58729 14.9097 5.55983 14.8601 5.53265C14.8028 5.50128 14.745 5.47076 14.6868 5.44081C14.6463 5.41998 14.6055 5.39949 14.5645 5.37935C14.4883 5.3419 14.4111 5.30595 14.3332 5.27093C14.3021 5.25697 14.2713 5.24238 14.24 5.22881C14.1572 5.19297 14.0732 5.15965 13.9886 5.12661C13.953 5.11267 13.9176 5.09792 13.8816 5.08449C13.8148 5.05956 13.7471 5.03652 13.6793 5.01337C13.6344 4.99807 13.5899 4.98161 13.5446 4.9671C13.4284 4.92988 13.3102 4.89544 13.1911 4.86352C12.691 4.72957 12.1893 4.6496 11.6919 4.61976C11.4431 4.60484 11.1954 4.60237 10.9496 4.61217C10.8266 4.61706 10.7042 4.62473 10.5822 4.63564C10.3388 4.65745 10.0974 4.69064 9.85925 4.73577C8.42886 5.00676 7.10753 5.69099 6.06131 6.69136Z",
203
+ fill: "#626A90"
204
+ })
205
+ });
206
+ };
207
+ var ClearIcon = function() {
208
+ return /*#__PURE__*/ jsx("svg", {
209
+ xmlns: "http://www.w3.org/2000/svg",
210
+ width: "24",
211
+ height: "24",
212
+ viewBox: "0 0 24 24",
213
+ fill: "none",
214
+ children: /*#__PURE__*/ jsx("path", {
215
+ d: "M12.4884 13.549L11.7035 18H10.1804L11.1935 12.2542L5.63599 6.69664L6.69664 5.63599L18.3639 17.3033L17.3032 18.3639L12.4884 13.549ZM11.8295 8.64752L12.0319 7.49995H10.6819L9.18193 5.99995H17.9999V7.49995H13.555L13.1243 9.94234L11.8295 8.64752Z",
216
+ fill: "#626A90"
217
+ })
218
+ });
219
+ };
220
+
221
+ export { BoldIcon, BulletListIcon, ClearIcon, DividerIcon, HardBreakIcon, Heading1Icon, Heading2Icon, ItalicIcon, NumberedListIcon, ParagraphIcon, QuoteAltIcon, RedoIcon, StrikeThroughIcon, UnderlineIcon, UndoIcon };
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import './WYSIWYGEditor.scss';
3
+ export interface WYSIWYGEditorProps {
4
+ label?: string;
5
+ error?: string;
6
+ helpText?: string;
7
+ value?: string;
8
+ onChange?: (value: string) => void;
9
+ onClear?: () => void;
10
+ placeholder?: string;
11
+ disabled?: boolean;
12
+ }
13
+ export declare const WYSIWYGEditor: React.FC<WYSIWYGEditorProps>;
14
+ //# sourceMappingURL=WYSIWYGEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WYSIWYGEditor.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/WYSIWYGEditor/WYSIWYGEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAkBzB,OAAO,sBAAsB,CAAA;AAE7B,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAwWtD,CAAA"}
@@ -0,0 +1,358 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { BoldIcon, ItalicIcon, UnderlineIcon, StrikeThroughIcon, Heading1Icon, Heading2Icon, ParagraphIcon, QuoteAltIcon, BulletListIcon, NumberedListIcon, DividerIcon, HardBreakIcon, UndoIcon, RedoIcon, ClearIcon } from './Icons.js';
4
+ import './WYSIWYGEditor.scss.js';
5
+
6
+ var WYSIWYGEditor = function(param) {
7
+ var label = param.label, error = param.error, helpText = param.helpText, value = param.value, onChange = param.onChange, placeholder = param.placeholder, _param_disabled = param.disabled, disabled = _param_disabled === void 0 ? false : _param_disabled;
8
+ var contentRef = React__default.useRef(null);
9
+ var isInternalChange = React__default.useRef(false);
10
+ // Only update innerHTML when value changes externally (not from user input)
11
+ React__default.useEffect(function() {
12
+ if (contentRef.current) {
13
+ if (isInternalChange.current) {
14
+ isInternalChange.current = false;
15
+ return;
16
+ }
17
+ var currentHTML = contentRef.current.innerHTML;
18
+ if (currentHTML !== value) {
19
+ contentRef.current.innerHTML = value || '';
20
+ }
21
+ }
22
+ }, [
23
+ value
24
+ ]);
25
+ var handleInput = function() {
26
+ if (contentRef.current) {
27
+ isInternalChange.current = true;
28
+ onChange === null || onChange === void 0 ? void 0 : onChange(contentRef.current.innerHTML);
29
+ }
30
+ };
31
+ var execCommand = function(command, value) {
32
+ // Ensure the command is only executed if the editor is focused or if we can force focus to it
33
+ var selection = window.getSelection();
34
+ if (!selection) return;
35
+ var isWithinEditor = false;
36
+ if (selection.rangeCount > 0) {
37
+ var _contentRef_current;
38
+ var range = selection.getRangeAt(0);
39
+ isWithinEditor = ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(range.commonAncestorContainer)) || false;
40
+ }
41
+ // If not within editor, we focus the editor first to ensure the command applies to it
42
+ if (!isWithinEditor && contentRef.current) {
43
+ contentRef.current.focus();
44
+ // We need to re-get the selection after focusing as it might have changed
45
+ var currentSelection = window.getSelection();
46
+ if (currentSelection) {
47
+ // If the editor is empty or we want to ensure cursor is inside, we set it
48
+ if (contentRef.current.innerHTML === '' || contentRef.current.innerHTML === '<p><br></p>') {
49
+ var newRange = document.createRange();
50
+ newRange.selectNodeContents(contentRef.current);
51
+ newRange.collapse(false);
52
+ currentSelection.removeAllRanges();
53
+ currentSelection.addRange(newRange);
54
+ }
55
+ }
56
+ }
57
+ if (command === 'clearFormatting') {
58
+ if (selection.rangeCount > 0) {
59
+ var range1 = selection.getRangeAt(0);
60
+ // Check if selection is inside a list
61
+ var container = range1.commonAncestorContainer;
62
+ if (container.nodeType === Node.TEXT_NODE) {
63
+ container = container.parentNode;
64
+ }
65
+ var isInsideList = false;
66
+ var tempNode = container;
67
+ while(tempNode && tempNode !== contentRef.current){
68
+ if (tempNode.nodeName === 'UL' || tempNode.nodeName === 'OL') {
69
+ isInsideList = true;
70
+ break;
71
+ }
72
+ tempNode = tempNode.parentNode;
73
+ }
74
+ if (isInsideList) {
75
+ // If inside a list, we need to toggle off the list first
76
+ // We check which type of list it is and call the corresponding command
77
+ var listType = '';
78
+ var listNode = container;
79
+ while(listNode && listNode !== contentRef.current){
80
+ if (listNode.nodeName === 'UL') {
81
+ listType = 'insertUnorderedList';
82
+ break;
83
+ } else if (listNode.nodeName === 'OL') {
84
+ listType = 'insertOrderedList';
85
+ break;
86
+ }
87
+ listNode = listNode.parentNode;
88
+ }
89
+ if (listType) {
90
+ document.execCommand(listType, false);
91
+ }
92
+ }
93
+ // If the selection is collapsed, just apply to current block
94
+ if (range1.collapsed) {
95
+ document.execCommand('formatBlock', false, '<p>');
96
+ document.execCommand('removeFormat', false);
97
+ } else {
98
+ // If there's a selection, we check if it contains HR
99
+ var fragment = range1.cloneContents();
100
+ var hasHR = fragment.querySelector('hr');
101
+ if (hasHR) {
102
+ // If it contains HR, we apply removeFormat but avoid formatBlock P
103
+ // which would replace the whole selection including HR with a single P
104
+ document.execCommand('removeFormat', false);
105
+ } else {
106
+ document.execCommand('formatBlock', false, '<p>');
107
+ document.execCommand('removeFormat', false);
108
+ }
109
+ }
110
+ handleInput();
111
+ }
112
+ return;
113
+ }
114
+ if (command === 'insertHorizontalRule') {
115
+ if (selection.rangeCount > 0) {
116
+ var range2 = selection.getRangeAt(0);
117
+ // range.deleteContents() // Removed to avoid clearing highlighted text
118
+ var hr = document.createElement('hr');
119
+ var p = document.createElement('p');
120
+ p.innerHTML = '<br>' // Ensure the paragraph is "typeable"
121
+ ;
122
+ // If something is selected, we collapse to end to insert HR AFTER selection
123
+ if (!range2.collapsed) {
124
+ range2.collapse(false);
125
+ }
126
+ // Insert HR and then the paragraph after it
127
+ range2.insertNode(p);
128
+ range2.insertNode(hr);
129
+ // Move cursor to the new paragraph
130
+ var newRange1 = document.createRange();
131
+ newRange1.setStart(p, 0);
132
+ newRange1.setEnd(p, 0);
133
+ newRange1.collapse(true);
134
+ selection.removeAllRanges();
135
+ selection.addRange(newRange1);
136
+ handleInput();
137
+ return;
138
+ }
139
+ }
140
+ if (command === 'hardBreak') {
141
+ if (selection.rangeCount > 0) {
142
+ var range3 = selection.getRangeAt(0);
143
+ // range.deleteContents() // Removed to avoid clearing highlighted text
144
+ var spacer = document.createElement('div');
145
+ spacer.className = 'wysiwyg-editor__hard-break';
146
+ spacer.innerHTML = '<br>';
147
+ // If something is selected, we collapse to end to insert break AFTER selection
148
+ // or we can just insert it at current position.
149
+ // User says "it should just break to new line", usually that implies keeping the text.
150
+ if (!range3.collapsed) {
151
+ range3.collapse(false);
152
+ }
153
+ range3.insertNode(spacer);
154
+ // Create a new paragraph after the spacer to continue typing
155
+ var p1 = document.createElement('p');
156
+ p1.innerHTML = '<br>';
157
+ spacer.after(p1);
158
+ // Move cursor to the new paragraph
159
+ var newRange2 = document.createRange();
160
+ newRange2.setStart(p1, 0);
161
+ newRange2.setEnd(p1, 0);
162
+ newRange2.collapse(true);
163
+ selection.removeAllRanges();
164
+ selection.addRange(newRange2);
165
+ handleInput();
166
+ return;
167
+ }
168
+ }
169
+ document.execCommand(command, false, value);
170
+ handleInput();
171
+ };
172
+ return /*#__PURE__*/ jsxs("div", {
173
+ className: "wysiwyg-editor",
174
+ children: [
175
+ label && /*#__PURE__*/ jsx("label", {
176
+ className: "wysiwyg-editor__label",
177
+ children: label
178
+ }),
179
+ /*#__PURE__*/ jsxs("div", {
180
+ className: "wysiwyg-editor__wrapper ".concat(error ? 'wysiwyg-editor__wrapper--error' : ''),
181
+ children: [
182
+ /*#__PURE__*/ jsxs("div", {
183
+ className: "wysiwyg-editor__toolbar",
184
+ children: [
185
+ /*#__PURE__*/ jsx("button", {
186
+ type: "button",
187
+ className: "wysiwyg-editor__toolbar-btn",
188
+ title: "Bold",
189
+ onClick: function() {
190
+ return execCommand('bold');
191
+ },
192
+ children: /*#__PURE__*/ jsx(BoldIcon, {})
193
+ }),
194
+ /*#__PURE__*/ jsx("button", {
195
+ type: "button",
196
+ className: "wysiwyg-editor__toolbar-btn",
197
+ title: "Italic",
198
+ onClick: function() {
199
+ return execCommand('italic');
200
+ },
201
+ children: /*#__PURE__*/ jsx(ItalicIcon, {})
202
+ }),
203
+ /*#__PURE__*/ jsx("button", {
204
+ type: "button",
205
+ className: "wysiwyg-editor__toolbar-btn",
206
+ title: "Underline",
207
+ onClick: function() {
208
+ return execCommand('underline');
209
+ },
210
+ children: /*#__PURE__*/ jsx(UnderlineIcon, {})
211
+ }),
212
+ /*#__PURE__*/ jsx("button", {
213
+ type: "button",
214
+ className: "wysiwyg-editor__toolbar-btn",
215
+ title: "Strikethrough",
216
+ onClick: function() {
217
+ return execCommand('strikeThrough');
218
+ },
219
+ children: /*#__PURE__*/ jsx(StrikeThroughIcon, {})
220
+ }),
221
+ /*#__PURE__*/ jsx("button", {
222
+ type: "button",
223
+ className: "wysiwyg-editor__toolbar-btn",
224
+ title: "Heading 1",
225
+ onClick: function() {
226
+ return execCommand('formatBlock', '<h1>');
227
+ },
228
+ children: /*#__PURE__*/ jsx(Heading1Icon, {})
229
+ }),
230
+ /*#__PURE__*/ jsx("button", {
231
+ type: "button",
232
+ className: "wysiwyg-editor__toolbar-btn",
233
+ title: "Heading 2",
234
+ onClick: function() {
235
+ return execCommand('formatBlock', '<h2>');
236
+ },
237
+ children: /*#__PURE__*/ jsx(Heading2Icon, {})
238
+ }),
239
+ /*#__PURE__*/ jsx("button", {
240
+ type: "button",
241
+ className: "wysiwyg-editor__toolbar-btn",
242
+ title: "Paragraph",
243
+ onClick: function() {
244
+ return execCommand('clearFormatting');
245
+ },
246
+ children: /*#__PURE__*/ jsx(ParagraphIcon, {})
247
+ }),
248
+ /*#__PURE__*/ jsx("button", {
249
+ type: "button",
250
+ className: "wysiwyg-editor__toolbar-btn",
251
+ title: "Quote",
252
+ onClick: function() {
253
+ return execCommand('formatBlock', '<blockquote>');
254
+ },
255
+ children: /*#__PURE__*/ jsx(QuoteAltIcon, {})
256
+ }),
257
+ /*#__PURE__*/ jsx("button", {
258
+ type: "button",
259
+ className: "wysiwyg-editor__toolbar-btn",
260
+ title: "Bullet List",
261
+ onClick: function() {
262
+ return execCommand('insertUnorderedList');
263
+ },
264
+ children: /*#__PURE__*/ jsx(BulletListIcon, {})
265
+ }),
266
+ /*#__PURE__*/ jsx("button", {
267
+ type: "button",
268
+ className: "wysiwyg-editor__toolbar-btn",
269
+ title: "Numbered List",
270
+ onClick: function() {
271
+ return execCommand('insertOrderedList');
272
+ },
273
+ children: /*#__PURE__*/ jsx(NumberedListIcon, {})
274
+ }),
275
+ /*#__PURE__*/ jsx("button", {
276
+ type: "button",
277
+ className: "wysiwyg-editor__toolbar-btn",
278
+ title: "Divider",
279
+ onClick: function() {
280
+ return execCommand('insertHorizontalRule');
281
+ },
282
+ children: /*#__PURE__*/ jsx(DividerIcon, {})
283
+ }),
284
+ /*#__PURE__*/ jsx("button", {
285
+ type: "button",
286
+ className: "wysiwyg-editor__toolbar-btn",
287
+ title: "Hard Break",
288
+ onClick: function() {
289
+ return execCommand('hardBreak');
290
+ },
291
+ children: /*#__PURE__*/ jsx(HardBreakIcon, {})
292
+ }),
293
+ /*#__PURE__*/ jsx("button", {
294
+ type: "button",
295
+ className: "wysiwyg-editor__toolbar-btn",
296
+ title: "Undo",
297
+ onClick: function() {
298
+ var selection = window.getSelection();
299
+ if (selection && contentRef.current && !contentRef.current.contains(selection.anchorNode)) {
300
+ contentRef.current.focus();
301
+ }
302
+ if (document.queryCommandEnabled('undo')) {
303
+ document.execCommand('undo', false);
304
+ handleInput();
305
+ }
306
+ },
307
+ children: /*#__PURE__*/ jsx(UndoIcon, {})
308
+ }),
309
+ /*#__PURE__*/ jsx("button", {
310
+ type: "button",
311
+ className: "wysiwyg-editor__toolbar-btn",
312
+ title: "Redo",
313
+ onClick: function() {
314
+ var selection = window.getSelection();
315
+ if (selection && contentRef.current && !contentRef.current.contains(selection.anchorNode)) {
316
+ contentRef.current.focus();
317
+ }
318
+ if (document.queryCommandEnabled('redo')) {
319
+ document.execCommand('redo', false);
320
+ handleInput();
321
+ }
322
+ },
323
+ children: /*#__PURE__*/ jsx(RedoIcon, {})
324
+ }),
325
+ /*#__PURE__*/ jsx("button", {
326
+ type: "button",
327
+ className: "wysiwyg-editor__toolbar-btn",
328
+ title: "Clear Formatting",
329
+ onClick: function() {
330
+ return execCommand('clearFormatting');
331
+ },
332
+ children: /*#__PURE__*/ jsx(ClearIcon, {})
333
+ })
334
+ ]
335
+ }),
336
+ /*#__PURE__*/ jsx("div", {
337
+ ref: contentRef,
338
+ className: "wysiwyg-editor__content ".concat(disabled ? 'wysiwyg-editor__content--disabled' : ''),
339
+ contentEditable: !disabled,
340
+ suppressContentEditableWarning: true,
341
+ onInput: handleInput,
342
+ "data-placeholder": placeholder
343
+ })
344
+ ]
345
+ }),
346
+ helpText && /*#__PURE__*/ jsx("span", {
347
+ className: "wysiwyg-editor__help-text",
348
+ children: helpText
349
+ }),
350
+ error && /*#__PURE__*/ jsx("span", {
351
+ className: "wysiwyg-editor__error-text",
352
+ children: error
353
+ })
354
+ ]
355
+ });
356
+ };
357
+
358
+ export { WYSIWYGEditor };