@councilbox/councilbox-ui 2.0.54 → 2.0.55

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 (150) hide show
  1. package/Accordion.js +3 -0
  2. package/Alert.js +3 -0
  3. package/Avatar.js +3 -0
  4. package/AvatarGroup.js +3 -0
  5. package/Block.js +3 -0
  6. package/Button.js +3 -0
  7. package/ButtonBasic.js +3 -0
  8. package/Checkbox.js +3 -0
  9. package/DatePicker.js +3 -0
  10. package/DateRangePicker.js +3 -0
  11. package/DateTimePicker.js +3 -0
  12. package/DragDrop.js +3 -0
  13. package/DrawerPanel.js +3 -0
  14. package/DropDown.js +3 -0
  15. package/EnhancedTable.js +3 -0
  16. package/FabButton.js +3 -0
  17. package/Grid.js +3 -0
  18. package/Header.js +3 -0
  19. package/IconButton.js +3 -0
  20. package/IconButtonSquare.js +3 -0
  21. package/IconFont.js +3 -0
  22. package/InputAutocomplete.js +3 -0
  23. package/InputPassword.js +3 -0
  24. package/InputText.js +3 -0
  25. package/InputTextArea.js +3 -0
  26. package/LoadingSection.js +3 -0
  27. package/MenuItem.js +3 -0
  28. package/MenuLateralLeft.js +3 -0
  29. package/MenuLateralRight.js +3 -0
  30. package/Modal.js +3 -0
  31. package/Radio.js +3 -0
  32. package/RichTextInput.js +3 -0
  33. package/Scrollbar.js +3 -0
  34. package/ScrollbarNew.js +3 -0
  35. package/SelectInput.js +3 -0
  36. package/Slider.js +3 -0
  37. package/Spacing.js +3 -0
  38. package/Stars.js +3 -0
  39. package/Stepper.js +3 -0
  40. package/Table.js +3 -0
  41. package/TableBody.js +3 -0
  42. package/TableCell.js +3 -0
  43. package/TableContainer.js +3 -0
  44. package/TableHead.js +3 -0
  45. package/TableRow.js +3 -0
  46. package/TableSortLabel.js +3 -0
  47. package/Tabs.js +3 -0
  48. package/Tag.js +3 -0
  49. package/TextInput.js +3 -0
  50. package/ThemeProvider.js +3 -0
  51. package/TimePicker.js +3 -0
  52. package/Timeline.js +3 -0
  53. package/ToastProvider.js +3 -0
  54. package/Toggle.js +3 -0
  55. package/Tooltip.js +3 -0
  56. package/Typography.js +3 -0
  57. package/dist/HOCs/useDynamicStyles.js +25 -24
  58. package/dist/build-index.js +70 -0
  59. package/dist/components/1.Introduction.stories.mdx +4 -1
  60. package/dist/components/2.Changelog.stories.mdx +15 -3
  61. package/dist/components/DatePicker/Calendar.js +243 -0
  62. package/dist/components/DatePicker/DatePicker.css +197 -0
  63. package/dist/components/DatePicker/DatePicker.js +384 -0
  64. package/dist/components/DatePicker/DatePicker.stories.js +180 -0
  65. package/dist/components/DatePicker/dateUtils.js +478 -0
  66. package/dist/components/DateRangePicker/DateRangePicker.css +41 -0
  67. package/dist/components/DateRangePicker/DateRangePicker.js +435 -0
  68. package/dist/components/DateRangePicker/DateRangePicker.stories.js +147 -0
  69. package/dist/components/DateRangePicker/RangeCalendar.js +188 -0
  70. package/dist/components/DateTimePicker/DateTimePicker.css +4 -0
  71. package/dist/components/DateTimePicker/DateTimePicker.js +481 -0
  72. package/dist/components/DateTimePicker/DateTimePicker.stories.js +144 -0
  73. package/dist/components/DateTimePicker/TimeColumns.css +46 -0
  74. package/dist/components/DateTimePicker/TimeColumns.js +175 -0
  75. package/dist/components/DragDrop/DragDrop.js +4 -1
  76. package/dist/components/DropDown/DesignDropDown.stories.js +8 -0
  77. package/dist/components/DropDown/DropDown.js +14 -4
  78. package/dist/components/Header/Header.js +32 -10
  79. package/dist/components/IconButton/IconButton.js +3 -2
  80. package/dist/components/IconButtonSquare/IconButtonSquare.js +3 -3
  81. package/dist/components/InputAutocomplete/InputAutocomplete.js +2 -2
  82. package/dist/components/InputText/InputText.css +10 -5
  83. package/dist/components/InputText/InputText.js +4 -4
  84. package/dist/components/MenuItem/MenuItem.js +65 -61
  85. package/dist/components/MenuLateralRight/MenuLateralRight.js +18 -2
  86. package/dist/components/Modal/Modal.js +3 -1
  87. package/dist/components/RichTextInput/DesignRichTextInput.stories.js +119 -0
  88. package/dist/components/RichTextInput/RichTextInput.css +309 -0
  89. package/dist/components/RichTextInput/RichTextInput.js +851 -0
  90. package/dist/components/RichTextInput/RichTextInput.stories.js +33 -0
  91. package/dist/components/Ripple/DesignRipple.js +17 -0
  92. package/dist/components/ScrollbarNew/DesignScrollbarNew.js +24 -0
  93. package/dist/components/ScrollbarNew/ScrollbarNew.css +79 -0
  94. package/dist/components/ScrollbarNew/ScrollbarNew.js +426 -0
  95. package/dist/components/ScrollbarNew/ScrollbarNew.stories.js +37 -0
  96. package/dist/components/SelectInput/SelectInput.js +85 -78
  97. package/dist/components/Tabs/DesignTabs.js +1 -1
  98. package/dist/components/Tabs/Tabs.js +0 -1
  99. package/dist/components/TimePicker/TimePicker.css +3 -0
  100. package/dist/components/TimePicker/TimePicker.js +359 -0
  101. package/dist/components/TimePicker/TimePicker.stories.js +132 -0
  102. package/dist/components/Toast/DesignToast.stories.js +174 -0
  103. package/dist/components/Toast/Toast.css +154 -0
  104. package/dist/components/Toast/Toast.js +165 -0
  105. package/dist/components/Toast/Toast.stories.js +33 -0
  106. package/dist/components/Toast/ToastProvider.js +33 -0
  107. package/dist/components/Toast/ToastRoot.js +89 -0
  108. package/dist/components/Toast/toastStore.js +127 -0
  109. package/dist/components/Toast/useToast.js +42 -0
  110. package/dist/components/Toggle/Toggle.js +20 -14
  111. package/dist/components/Tooltip/Tooltip.js +7 -2
  112. package/dist/styles/styleFont.css +1 -1
  113. package/dist/styles/zIndexConsts.css +2 -0
  114. package/package.json +63 -3
  115. package/toast.js +7 -0
  116. package/useCouncilboxTheme.js +7 -0
  117. package/useToast.js +7 -0
  118. package/dist/components/Accordion/AccordionOld.css +0 -16
  119. package/dist/components/Accordion/AccordionOld.js +0 -91
  120. package/dist/components/Avatar/AvatarOld.js +0 -124
  121. package/dist/components/ButtonBasic/ButtonBasicOld.css +0 -41
  122. package/dist/components/ButtonBasic/ButtonBasicOld.js +0 -211
  123. package/dist/components/Checkbox/CheckboxOld.css +0 -31
  124. package/dist/components/Checkbox/CheckboxOld.js +0 -96
  125. package/dist/components/DrawerPanel/DrawerPanelOld.css +0 -56
  126. package/dist/components/DrawerPanel/DrawerPanelOld.js +0 -211
  127. package/dist/components/DropDown/DropDownOld.css +0 -3
  128. package/dist/components/DropDown/DropDownOld.js +0 -154
  129. package/dist/components/Grid/GridItemOld.js +0 -38
  130. package/dist/components/Grid/GridOld.css +0 -0
  131. package/dist/components/Grid/GridOld.js +0 -46
  132. package/dist/components/IconButton/IconButtonOld.css +0 -0
  133. package/dist/components/IconButton/IconButtonOld.js +0 -122
  134. package/dist/components/IconButtonSquare/IconButtonSquareOld.css +0 -43
  135. package/dist/components/IconButtonSquare/IconButtonSquareOld.js +0 -115
  136. package/dist/components/InputAutocomplete/InputAutocompleteOld.css +0 -5
  137. package/dist/components/InputAutocomplete/InputAutocompleteOld.js +0 -159
  138. package/dist/components/InputText/InputTextOld.css +0 -10
  139. package/dist/components/InputText/InputTextOld.js +0 -314
  140. package/dist/components/MenuItem/MenuItemOld.js +0 -123
  141. package/dist/components/Modal/ModalOld.css +0 -3
  142. package/dist/components/Modal/ModalOld.js +0 -213
  143. package/dist/components/RadioButton/RadioOld.css +0 -31
  144. package/dist/components/RadioButton/RadioOld.js +0 -126
  145. package/dist/components/SelectInput/SelectInputOld.css +0 -17
  146. package/dist/components/SelectInput/SelectInputOld.js +0 -296
  147. package/dist/components/Table/TableOld.css +0 -79
  148. package/dist/components/Table/TableOld.js +0 -133
  149. package/dist/components/Tabs/TabsOld.js +0 -78
  150. package/dist/components/Typography/TypographyOld.js +0 -119
@@ -93,68 +93,72 @@ var MenuItem = function MenuItem(_ref) {
93
93
  };
94
94
  var getContent = function getContent() {
95
95
  var _props$tabIndex;
96
- return /*#__PURE__*/_react["default"].createElement("li", _extends({
97
- id: id,
98
- className: prefixClass("cbx-menuItem ".concat(className || '', " cbx-ripple ").concat(active ? 'cbx-menuItem-active' : '', " ").concat(fullWidth ? 'cbx-menuItem-fullWidth' : '', " ").concat(disabled ? 'cbx-menuItem-disabled' : '')),
99
- onClick: function onClick(e) {
100
- return handleClick(e);
101
- },
102
- onKeyDown: function onKeyDown(e) {
103
- if (disabled) return;
104
- if (e.key === 'Enter' || e.key === ' ') {
105
- e.preventDefault();
106
- handleClick(e);
96
+ return (
97
+ /*#__PURE__*/
98
+ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
99
+ _react["default"].createElement("li", _extends({
100
+ id: id,
101
+ className: prefixClass("cbx-menuItem ".concat(className || '', " cbx-ripple ").concat(active ? 'cbx-menuItem-active' : '', " ").concat(fullWidth ? 'cbx-menuItem-fullWidth' : '', " ").concat(disabled ? 'cbx-menuItem-disabled' : '')),
102
+ onClick: function onClick(e) {
103
+ return handleClick(e);
104
+ },
105
+ onKeyDown: function onKeyDown(e) {
106
+ if (disabled) return;
107
+ if (e.key === 'Enter' || e.key === ' ') {
108
+ e.preventDefault();
109
+ handleClick(e);
110
+ }
111
+ },
112
+ tabIndex: (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : isManagedByParentNavigation || disabled ? -1 : 0,
113
+ "aria-disabled": disabled || undefined,
114
+ onMouseDown: function onMouseDown(e) {
115
+ return e.preventDefault();
116
+ },
117
+ role: props.role || 'menuitem',
118
+ "aria-haspopup": menuItems ? 'menu' : undefined,
119
+ style: _objectSpread(_objectSpread({}, style), stylesInLine),
120
+ value: "".concat(value)
121
+ }, props), /*#__PURE__*/_react["default"].createElement("div", {
122
+ className: prefixClass('cbx-menuItem-container')
123
+ }, icon && /*#__PURE__*/_react["default"].createElement("div", {
124
+ className: prefixClass('cbx-menuItem-container-icon')
125
+ }, badge && /*#__PURE__*/_react["default"].createElement("div", {
126
+ className: prefixClass('cbx-menuItem-badge-icon'),
127
+ role: "status"
128
+ }, /*#__PURE__*/_react["default"].createElement("span", {
129
+ className: "sr-only"
130
+ }, "Notificaci\xF3n pendiente")), typeof icon === 'string' ? /*#__PURE__*/_react["default"].createElement("i", {
131
+ className: icon,
132
+ "aria-hidden": "true"
133
+ }) : icon), /*#__PURE__*/_react["default"].createElement("div", {
134
+ className: prefixClass('cbx-menuItem-container-typography'),
135
+ style: {
136
+ paddingRight: badge && !icon && '1.188rem'
107
137
  }
108
- },
109
- tabIndex: (_props$tabIndex = props.tabIndex) !== null && _props$tabIndex !== void 0 ? _props$tabIndex : isManagedByParentNavigation || disabled ? -1 : 0,
110
- "aria-disabled": disabled || undefined,
111
- onMouseDown: function onMouseDown(e) {
112
- return e.preventDefault();
113
- },
114
- role: props.role || 'menuitem',
115
- "aria-haspopup": menuItems ? 'menu' : undefined,
116
- style: _objectSpread(_objectSpread({}, style), stylesInLine),
117
- value: "".concat(value)
118
- }, props), /*#__PURE__*/_react["default"].createElement("div", {
119
- className: prefixClass('cbx-menuItem-container')
120
- }, icon && /*#__PURE__*/_react["default"].createElement("div", {
121
- className: prefixClass('cbx-menuItem-container-icon')
122
- }, badge && /*#__PURE__*/_react["default"].createElement("div", {
123
- className: prefixClass('cbx-menuItem-badge-icon'),
124
- role: "status"
125
- }, /*#__PURE__*/_react["default"].createElement("span", {
126
- className: "sr-only"
127
- }, "Notificaci\xF3n pendiente")), typeof icon === 'string' ? /*#__PURE__*/_react["default"].createElement("i", {
128
- className: icon,
129
- "aria-hidden": "true"
130
- }) : icon), /*#__PURE__*/_react["default"].createElement("div", {
131
- className: prefixClass('cbx-menuItem-container-typography'),
132
- style: {
133
- paddingRight: badge && !icon && '1.188rem'
134
- }
135
- }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
136
- title: isEllipsisActive ? extractText(children) : '',
137
- placement: placementTooltip || 'right'
138
- }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
139
- color: 'var(--black)',
140
- prefixClass: prefixClass,
141
- ref: typographyRef,
142
- styles: {
143
- whiteSpace: 'nowrap',
144
- textOverflow: 'ellipsis',
145
- overflow: 'hidden'
146
- }
147
- }, children)), badge && !icon && /*#__PURE__*/_react["default"].createElement("div", {
148
- className: prefixClass('cbx-menuItem-badge-typography'),
149
- role: "status"
150
- }, /*#__PURE__*/_react["default"].createElement("span", {
151
- className: "sr-only"
152
- }, "Notificaci\xF3n pendiente"))), (menuItems || endIcon) && /*#__PURE__*/_react["default"].createElement("div", {
153
- className: prefixClass('cbx-menuItem-container-icon-right')
154
- }, /*#__PURE__*/_react["default"].createElement("i", {
155
- className: endIcon || 'ri-arrow-right-s-line',
156
- "aria-hidden": "true"
157
- }))), ripples);
138
+ }, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
139
+ title: isEllipsisActive ? extractText(children) : '',
140
+ placement: placementTooltip || 'right'
141
+ }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
142
+ color: 'var(--black)',
143
+ prefixClass: prefixClass,
144
+ ref: typographyRef,
145
+ styles: {
146
+ whiteSpace: 'nowrap',
147
+ textOverflow: 'ellipsis',
148
+ overflow: 'hidden'
149
+ }
150
+ }, children)), badge && !icon && /*#__PURE__*/_react["default"].createElement("div", {
151
+ className: prefixClass('cbx-menuItem-badge-typography'),
152
+ role: "status"
153
+ }, /*#__PURE__*/_react["default"].createElement("span", {
154
+ className: "sr-only"
155
+ }, "Notificaci\xF3n pendiente"))), (menuItems || endIcon) && /*#__PURE__*/_react["default"].createElement("div", {
156
+ className: prefixClass('cbx-menuItem-container-icon-right')
157
+ }, /*#__PURE__*/_react["default"].createElement("i", {
158
+ className: endIcon || 'ri-arrow-right-s-line',
159
+ "aria-hidden": "true"
160
+ }))), ripples)
161
+ );
158
162
  };
159
163
  return menuItems ? /*#__PURE__*/_react["default"].createElement(_DropDown["default"], _extends({
160
164
  Component: function Component() {
@@ -200,10 +200,26 @@ var MenuLateralRight = function MenuLateralRight(_ref) {
200
200
  return /*#__PURE__*/_react["default"].createElement("div", {
201
201
  key: "under-section-".concat(index),
202
202
  className: prefixClass(mobile ? 'cbx-menuLateralRight-container-under-mobile' : "cbx-menuLateralRight-container-under ".concat(expanded && !item.disabled ? 'cbx-menuLateralRight-container-under-expanded-button' : '')),
203
- onClick: expanded && !item.disabled && !mobile ? item.action : undefined
203
+ onClick: expanded && !item.disabled && !mobile ? item.action : undefined,
204
+ onKeyDown: expanded && !item.disabled && !mobile ? function (event) {
205
+ if (event.key === 'Enter' || event.key === ' ') {
206
+ event.preventDefault();
207
+ item.action(event);
208
+ }
209
+ } : undefined,
210
+ role: expanded && !item.disabled && !mobile ? 'button' : undefined,
211
+ tabIndex: expanded && !item.disabled && !mobile ? 0 : undefined
204
212
  }, item.actionTooltip && /*#__PURE__*/_react["default"].createElement("div", {
205
213
  className: prefixClass('cbx-menuLateralRight-block-tooltip-under'),
206
- onClick: item.setActionTooltip
214
+ onClick: item.setActionTooltip,
215
+ onKeyDown: function onKeyDown(event) {
216
+ if (event.key === 'Enter' || event.key === ' ') {
217
+ event.preventDefault();
218
+ item.setActionTooltip(event);
219
+ }
220
+ },
221
+ role: "button",
222
+ tabIndex: 0
207
223
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
208
224
  prefixClass: prefixClass,
209
225
  color: 'white'
@@ -163,7 +163,9 @@ var Modal = function Modal(_ref) {
163
163
  var handleContentClick = function handleContentClick(e) {
164
164
  e.stopPropagation();
165
165
  };
166
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, visible && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react["default"].createElement("div", _extends({
166
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, visible
167
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
168
+ && /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react["default"].createElement("div", _extends({
167
169
  ref: containerRef,
168
170
  className: prefixClass("cbx-Modal-container ".concat(show ? 'show' : 'hide', " ").concat(classNameDialog || '', " ").concat(className || '', " ")),
169
171
  onClick: handleBackgroundClick,
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ require("../../styles/main.css");
9
+ var _RichTextInput = _interopRequireDefault(require("./RichTextInput"));
10
+ var _ScrollbarNew = _interopRequireDefault(require("../ScrollbarNew/ScrollbarNew"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
13
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
15
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
16
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
17
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
18
+ var DesignRichTextInput = function DesignRichTextInput() {
19
+ var _React$useState = _react["default"].useState('<p>Escribe algo <strong>importante</strong>...</p>'),
20
+ _React$useState2 = _slicedToArray(_React$useState, 2),
21
+ value = _React$useState2[0],
22
+ setValue = _React$useState2[1];
23
+ var _React$useState3 = _react["default"].useState(''),
24
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
25
+ withTags = _React$useState4[0],
26
+ setWithTags = _React$useState4[1];
27
+ var editorRef = _react["default"].useRef(null);
28
+ return /*#__PURE__*/_react["default"].createElement("div", {
29
+ style: {
30
+ height: '100%'
31
+ }
32
+ }, /*#__PURE__*/_react["default"].createElement(_ScrollbarNew["default"], {
33
+ sx: {
34
+ '.cbx-scrollbarNew-view': {
35
+ width: '100%'
36
+ }
37
+ }
38
+ }, /*#__PURE__*/_react["default"].createElement("div", {
39
+ style: {
40
+ width: '100%'
41
+ }
42
+ }, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
43
+ id: "story-richtext-basic",
44
+ floatingText: "Descripci\xF3n",
45
+ placeholder: "Escribe aqu\xED...",
46
+ value: value,
47
+ onChange: setValue,
48
+ required: true,
49
+ toolbarExtra: /*#__PURE__*/_react["default"].createElement("button", {
50
+ type: "button",
51
+ onMouseDown: function onMouseDown(e) {
52
+ return e.preventDefault();
53
+ }
54
+ }, "Tags"),
55
+ loadDraft: /*#__PURE__*/_react["default"].createElement("button", {
56
+ type: "button",
57
+ onMouseDown: function onMouseDown(e) {
58
+ return e.preventDefault();
59
+ }
60
+ }, "Cargar plantilla")
61
+ })), /*#__PURE__*/_react["default"].createElement("div", {
62
+ style: {
63
+ width: '20rem'
64
+ }
65
+ }, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
66
+ id: "story-richtext-narrow",
67
+ floatingText: "Estrecho (para ver el wrap)",
68
+ value: value,
69
+ onChange: setValue,
70
+ toolbarExtra: /*#__PURE__*/_react["default"].createElement("button", {
71
+ type: "button",
72
+ onMouseDown: function onMouseDown(e) {
73
+ return e.preventDefault();
74
+ }
75
+ }, "Tags")
76
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
77
+ id: "story-richtext-error",
78
+ floatingText: "Con error",
79
+ errorText: "Este campo es obligatorio",
80
+ value: '',
81
+ onChange: function onChange() {},
82
+ maxChars: 120
83
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
84
+ id: "story-richtext-disabled",
85
+ floatingText: "Deshabilitado",
86
+ value: '<p>Contenido no editable</p>',
87
+ disabled: true
88
+ })), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
89
+ id: "story-richtext-hideToolbar",
90
+ floatingText: "Sin toolbar (modo simple)",
91
+ hideToolbar: true,
92
+ value: withTags,
93
+ onChange: setWithTags,
94
+ toolbarExtra: /*#__PURE__*/_react["default"].createElement("button", {
95
+ type: "button",
96
+ onMouseDown: function onMouseDown(e) {
97
+ return e.preventDefault();
98
+ },
99
+ onClick: function onClick() {
100
+ var _editorRef$current;
101
+ return (_editorRef$current = editorRef.current) === null || _editorRef$current === void 0 ? void 0 : _editorRef$current.insertHTML('<span>{{tag_ejemplo}}</span>');
102
+ }
103
+ }, "Insertar tag"),
104
+ ref: editorRef
105
+ })), /*#__PURE__*/_react["default"].createElement("div", {
106
+ style: {
107
+ height: '20rem'
108
+ }
109
+ }, /*#__PURE__*/_react["default"].createElement(_RichTextInput["default"], {
110
+ id: "story-richtext-fullHeight",
111
+ floatingText: "Altura completa",
112
+ fullHeight: true,
113
+ value: value,
114
+ onChange: setValue
115
+ }))));
116
+ };
117
+ DesignRichTextInput.displayName = "DesignRichTextInput";
118
+ var _default = DesignRichTextInput;
119
+ exports["default"] = _default;
@@ -0,0 +1,309 @@
1
+ .cbx-richTextInput {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ font-family: var(--font-primary);
6
+ }
7
+
8
+ .cbx-richTextInput-fullHeight {
9
+ height: 100%;
10
+ }
11
+
12
+ .cbx-richTextInput-label {
13
+ display: inline-flex;
14
+ align-items: center;
15
+ font-size: 0.75rem;
16
+ color: var(--gray3);
17
+ margin-bottom: var(--spacing8);
18
+ }
19
+
20
+ .cbx-richTextInput-required {
21
+ color: var(--gray3);
22
+ margin-left: 0.2rem;
23
+ }
24
+
25
+ .cbx-richTextInput-label-errorIcon {
26
+ color: var(--error);
27
+ font-size: 0.9rem;
28
+ margin-left: 0.35rem;
29
+ }
30
+
31
+ .cbx-richTextInput-toolbar {
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: space-between;
35
+ flex-wrap: wrap;
36
+ gap: 0.5rem 2rem;
37
+ padding: var(--spacing4);
38
+ border: 1px solid var(--gray2);
39
+ border-bottom: none;
40
+ border-top-left-radius: 0.75rem;
41
+ border-top-right-radius: 0.75rem;
42
+ background: var(--gray1);
43
+ }
44
+
45
+ .cbx-richTextInput-toolbar-formats {
46
+ display: flex;
47
+ align-items: center;
48
+ flex-wrap: wrap;
49
+ gap: 0.125rem;
50
+ }
51
+
52
+ .cbx-richTextInput-toolbar-actions {
53
+ display: flex;
54
+ align-items: center;
55
+ flex-wrap: wrap;
56
+ gap: var(--spacing8);
57
+ margin-left: auto;
58
+ }
59
+
60
+ .cbx-richTextInput-toolbar .cbx-IconButton {
61
+ width: 2rem;
62
+ height: 2rem;
63
+ border-radius: 0.5rem;
64
+ }
65
+
66
+ .cbx-richTextInput-toolbar .cbx-IconButton i {
67
+ font-size: 1.05rem;
68
+ }
69
+
70
+ .cbx-richTextInput-divider {
71
+ width: 1px;
72
+ align-self: stretch;
73
+ margin: 0.3rem 0.25rem;
74
+ background: var(--gray2);
75
+ flex-shrink: 0;
76
+ }
77
+
78
+ .cbx-richTextInput-body {
79
+ position: relative;
80
+ border: 1px solid var(--gray2);
81
+ border-radius: 0.75rem;
82
+ background: var(--white);
83
+ transition: border-color 150ms ease, box-shadow 150ms ease;
84
+ flex: 1;
85
+ display: flex;
86
+ min-height: 0;
87
+ }
88
+
89
+ .cbx-richTextInput-toolbar+.cbx-richTextInput-body {
90
+ border-top-left-radius: 0;
91
+ border-top-right-radius: 0;
92
+ }
93
+
94
+ .cbx-richTextInput-body:focus-within {
95
+ border-color: var(--primary);
96
+ box-shadow: 0 0 0 3px var(--primary10);
97
+ }
98
+
99
+ .cbx-richTextInput-body-error {
100
+ border-color: var(--error) !important;
101
+ }
102
+
103
+ .cbx-richTextInput-body-error:focus-within {
104
+ box-shadow: 0 0 0 3px rgba(195, 60, 55, 0.12);
105
+ }
106
+
107
+ .cbx-richTextInput-body-disabled {
108
+ background: var(--gray1);
109
+ border-style: dashed;
110
+ }
111
+
112
+ .cbx-richTextInput-body-borderless {
113
+ border-color: transparent;
114
+ background: transparent;
115
+ }
116
+
117
+ .cbx-richTextInput-body-borderless:focus-within {
118
+ box-shadow: none;
119
+ border-color: transparent;
120
+ }
121
+
122
+ .cbx-richTextInput-body-fullHeight {
123
+ height: 100%;
124
+ }
125
+
126
+ .cbx-richTextInput-editor {
127
+ width: 100%;
128
+ min-height: 8rem;
129
+ max-height: inherit;
130
+ padding: var(--spacing12) var(--spacing16);
131
+ font-size: 0.9375rem;
132
+ line-height: 1.5;
133
+ color: var(--gray5);
134
+ outline: none;
135
+ overflow-y: auto;
136
+ word-wrap: break-word;
137
+ }
138
+
139
+ .cbx-richTextInput-body-fullHeight .cbx-richTextInput-editor {
140
+ min-height: 0;
141
+ flex: 1;
142
+ }
143
+
144
+ .cbx-richTextInput-editor:empty:before {
145
+ content: attr(data-placeholder);
146
+ color: var(--gray3);
147
+ pointer-events: none;
148
+ }
149
+
150
+ .cbx-richTextInput-editor a {
151
+ color: var(--primary);
152
+ text-decoration: underline;
153
+ }
154
+
155
+ .cbx-richTextInput-editor blockquote {
156
+ margin: 0.5rem 0;
157
+ padding-left: var(--spacing12);
158
+ border-left: 3px solid var(--gray2);
159
+ color: var(--gray4);
160
+ }
161
+
162
+ .cbx-richTextInput-editor pre {
163
+ margin: 0.5rem 0;
164
+ padding: var(--spacing8) var(--spacing12);
165
+ background: var(--gray1);
166
+ border-radius: 0.5rem;
167
+ font-family: monospace;
168
+ font-size: 0.85rem;
169
+ overflow-x: auto;
170
+ white-space: pre-wrap;
171
+ }
172
+
173
+ .cbx-richTextInput-editor h1,
174
+ .cbx-richTextInput-editor h2 {
175
+ margin: 0.5rem 0;
176
+ line-height: 1.3;
177
+ }
178
+
179
+ .cbx-richTextInput-editor h1 {
180
+ font-size: 1.5rem;
181
+ }
182
+
183
+ .cbx-richTextInput-editor h2 {
184
+ font-size: 1.25rem;
185
+ }
186
+
187
+ .cbx-richTextInput-editor ul,
188
+ .cbx-richTextInput-editor ol {
189
+ padding-left: 1.5rem;
190
+ margin: 0.5rem 0;
191
+ }
192
+
193
+ .cbx-richTextInput-editor p {
194
+ margin: 0 0 0.5rem 0;
195
+ }
196
+
197
+ .cbx-richTextInput-editor p:last-child {
198
+ margin-bottom: 0;
199
+ }
200
+
201
+ .cbx-richTextInput-footer {
202
+ display: flex;
203
+ align-items: flex-start;
204
+ justify-content: space-between;
205
+ gap: var(--spacing8);
206
+ margin-top: var(--spacing4);
207
+ }
208
+
209
+ .cbx-richTextInput-count {
210
+ font-size: 0.75rem;
211
+ color: var(--gray3);
212
+ white-space: nowrap;
213
+ margin-left: auto;
214
+ }
215
+
216
+ .cbx-richTextInput-count-error {
217
+ color: var(--error);
218
+ font-weight: 600;
219
+ }
220
+
221
+ .cbx-richTextInput-error {
222
+ font-size: 0.75rem;
223
+ color: var(--error);
224
+ }
225
+
226
+ .cbx-richTextInput-colorGrid {
227
+ display: grid;
228
+ grid-template-columns: repeat(7, 1.5rem);
229
+ gap: 0.3rem;
230
+ padding: var(--spacing8);
231
+ }
232
+
233
+ .cbx-richTextInput-swatch {
234
+ width: 1.5rem;
235
+ height: 1.5rem;
236
+ border-radius: 0.35rem;
237
+ border: 1px solid rgba(0, 0, 0, 0.12);
238
+ cursor: pointer;
239
+ padding: 0;
240
+ }
241
+
242
+ .cbx-richTextInput-swatch:hover {
243
+ transform: scale(1.1);
244
+ }
245
+
246
+ .cbx-richTextInput-swatch-more {
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ background: var(--white);
251
+ color: var(--gray4);
252
+ }
253
+
254
+ .cbx-richTextInput-hiddenColorInput {
255
+ position: absolute;
256
+ width: 0;
257
+ height: 0;
258
+ padding: 0;
259
+ border: none;
260
+ opacity: 0;
261
+ pointer-events: none;
262
+ }
263
+
264
+ .cbx-richTextInput-linkPopover {
265
+ display: flex;
266
+ flex-direction: column;
267
+ gap: var(--spacing8);
268
+ padding: var(--spacing12);
269
+ min-width: 16rem;
270
+ }
271
+
272
+ .cbx-richTextInput-linkInput {
273
+ width: 100%;
274
+ box-sizing: border-box;
275
+ font-size: 0.875rem;
276
+ padding: var(--spacing8) var(--spacing12);
277
+ border: 1px solid var(--gray2);
278
+ border-radius: 0.5rem;
279
+ outline: none;
280
+ }
281
+
282
+ .cbx-richTextInput-linkInput:focus {
283
+ border-color: var(--primary);
284
+ }
285
+
286
+ .cbx-richTextInput-linkPopover-actions {
287
+ display: flex;
288
+ justify-content: flex-end;
289
+ gap: var(--spacing8);
290
+ }
291
+
292
+ .cbx-richTextInput-linkPopover-actions button {
293
+ font-size: 0.8125rem;
294
+ font-weight: 600;
295
+ padding: var(--spacing4) var(--spacing12);
296
+ border-radius: 0.5rem;
297
+ border: none;
298
+ cursor: pointer;
299
+ }
300
+
301
+ .cbx-richTextInput-linkPopover-apply {
302
+ background: var(--primary);
303
+ color: var(--white);
304
+ }
305
+
306
+ .cbx-richTextInput-linkPopover-remove {
307
+ background: transparent;
308
+ color: var(--error);
309
+ }