@councilbox/councilbox-ui 2.0.54 → 2.0.56
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.
- package/Accordion.js +3 -0
- package/Alert.js +3 -0
- package/Avatar.js +3 -0
- package/AvatarGroup.js +3 -0
- package/Block.js +3 -0
- package/Button.js +3 -0
- package/ButtonBasic.js +3 -0
- package/Checkbox.js +3 -0
- package/DatePicker.js +3 -0
- package/DateRangePicker.js +3 -0
- package/DateTimePicker.js +3 -0
- package/DragDrop.js +3 -0
- package/DrawerPanel.js +3 -0
- package/DropDown.js +3 -0
- package/EnhancedTable.js +3 -0
- package/FabButton.js +3 -0
- package/Grid.js +3 -0
- package/Header.js +3 -0
- package/IconButton.js +3 -0
- package/IconButtonSquare.js +3 -0
- package/IconFont.js +3 -0
- package/InputAutocomplete.js +3 -0
- package/InputPassword.js +3 -0
- package/InputText.js +3 -0
- package/InputTextArea.js +3 -0
- package/LoadingSection.js +3 -0
- package/MenuItem.js +3 -0
- package/MenuLateralLeft.js +3 -0
- package/MenuLateralRight.js +3 -0
- package/Modal.js +3 -0
- package/Radio.js +3 -0
- package/RichTextInput.js +3 -0
- package/Scrollbar.js +3 -0
- package/ScrollbarOld.js +3 -0
- package/SelectInput.js +3 -0
- package/Slider.js +3 -0
- package/Spacing.js +3 -0
- package/Stars.js +3 -0
- package/Stepper.js +3 -0
- package/Table.js +3 -0
- package/TableBody.js +3 -0
- package/TableCell.js +3 -0
- package/TableContainer.js +3 -0
- package/TableHead.js +3 -0
- package/TableRow.js +3 -0
- package/TableSortLabel.js +3 -0
- package/Tabs.js +3 -0
- package/Tag.js +3 -0
- package/TextInput.js +3 -0
- package/ThemeProvider.js +3 -0
- package/TimePicker.js +3 -0
- package/Timeline.js +3 -0
- package/ToastProvider.js +3 -0
- package/Toggle.js +3 -0
- package/Tooltip.js +3 -0
- package/Typography.js +3 -0
- package/dist/HOCs/useDynamicStyles.js +25 -24
- package/dist/HOCs/usePopoverPosition.js +2 -0
- package/dist/build-index.js +70 -0
- package/dist/components/1.Introduction.stories.mdx +4 -1
- package/dist/components/2.Changelog.stories.mdx +25 -2
- package/dist/components/Button/Button.js +15 -0
- package/dist/components/ButtonBasic/ButtonBasic.js +15 -0
- package/dist/components/Checkbox/Checkbox.js +2 -2
- package/dist/components/DatePicker/Calendar.js +243 -0
- package/dist/components/DatePicker/DatePicker.css +197 -0
- package/dist/components/DatePicker/DatePicker.js +465 -0
- package/dist/components/DatePicker/DatePicker.stories.js +180 -0
- package/dist/components/DatePicker/dateUtils.js +525 -0
- package/dist/components/DateRangePicker/DateRangePicker.css +41 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +530 -0
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +147 -0
- package/dist/components/DateRangePicker/RangeCalendar.js +188 -0
- package/dist/components/DateTimePicker/DateTimePicker.css +4 -0
- package/dist/components/DateTimePicker/DateTimePicker.js +541 -0
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +144 -0
- package/dist/components/DateTimePicker/TimeColumns.css +46 -0
- package/dist/components/DateTimePicker/TimeColumns.js +175 -0
- package/dist/components/DragDrop/DragDrop.js +21 -5
- package/dist/components/DropDown/DesignDropDown.stories.js +8 -0
- package/dist/components/DropDown/DropDown.js +14 -4
- package/dist/components/Header/Header.js +134 -25
- package/dist/components/IconButton/IconButton.js +3 -2
- package/dist/components/IconButtonSquare/IconButtonSquare.js +3 -3
- package/dist/components/InputAutocomplete/InputAutocomplete.js +17 -2
- package/dist/components/InputPassword/InputPassword.js +14 -1
- package/dist/components/InputText/InputText.css +10 -5
- package/dist/components/InputText/InputText.js +4 -4
- package/dist/components/InputTextArea/InputTextArea.js +14 -0
- package/dist/components/LoadingSection/LoadingSection.js +16 -4
- package/dist/components/MenuItem/MenuItem.js +78 -61
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +16 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.js +34 -4
- package/dist/components/Modal/Modal.js +16 -1
- package/dist/components/RadioButton/Radio.js +15 -0
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +119 -0
- package/dist/components/RichTextInput/RichTextInput.css +352 -0
- package/dist/components/RichTextInput/RichTextInput.js +1057 -0
- package/dist/components/RichTextInput/RichTextInput.stories.js +33 -0
- package/dist/components/Ripple/DesignRipple.js +17 -0
- package/dist/components/Scrollbar/Scrollbar.css +60 -19
- package/dist/components/Scrollbar/Scrollbar.js +384 -62
- package/dist/components/ScrollbarOld/DesignScrollbarOld.js +24 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.css +38 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.js +104 -0
- package/dist/components/ScrollbarOld/ScrollbarOld.stories.js +37 -0
- package/dist/components/SelectInput/SelectInput.js +112 -86
- package/dist/components/Slider/Slider.js +15 -0
- package/dist/components/Stars/Stars.js +13 -0
- package/dist/components/Stepper/Stepper.js +15 -2
- package/dist/components/Table/TableSortLabel.js +11 -0
- package/dist/components/Tabs/DesignTabs.js +1 -1
- package/dist/components/Tabs/Tabs.js +13 -2
- package/dist/components/Tag/Tag.js +16 -0
- package/dist/components/TextInput/TextInput.js +13 -0
- package/dist/components/TimePicker/TimePicker.css +3 -0
- package/dist/components/TimePicker/TimePicker.js +441 -0
- package/dist/components/TimePicker/TimePicker.stories.js +132 -0
- package/dist/components/Toast/DesignToast.stories.js +174 -0
- package/dist/components/Toast/Toast.css +154 -0
- package/dist/components/Toast/Toast.js +178 -0
- package/dist/components/Toast/Toast.stories.js +33 -0
- package/dist/components/Toast/ToastProvider.js +33 -0
- package/dist/components/Toast/ToastRoot.js +89 -0
- package/dist/components/Toast/toastStore.js +138 -0
- package/dist/components/Toast/useToast.js +42 -0
- package/dist/components/Toggle/Toggle.js +20 -14
- package/dist/components/Tooltip/Tooltip.js +24 -2
- package/dist/styles/styleFont.css +1 -1
- package/dist/styles/zIndexConsts.css +2 -0
- package/package.json +63 -3
- package/toast.js +7 -0
- package/useCouncilboxTheme.js +7 -0
- package/useToast.js +7 -0
- package/dist/components/Accordion/AccordionOld.css +0 -16
- package/dist/components/Accordion/AccordionOld.js +0 -91
- package/dist/components/Avatar/AvatarOld.js +0 -124
- package/dist/components/ButtonBasic/ButtonBasicOld.css +0 -41
- package/dist/components/ButtonBasic/ButtonBasicOld.js +0 -211
- package/dist/components/Checkbox/CheckboxOld.css +0 -31
- package/dist/components/Checkbox/CheckboxOld.js +0 -96
- package/dist/components/DrawerPanel/DrawerPanelOld.css +0 -56
- package/dist/components/DrawerPanel/DrawerPanelOld.js +0 -211
- package/dist/components/DropDown/DropDownOld.css +0 -3
- package/dist/components/DropDown/DropDownOld.js +0 -154
- package/dist/components/Grid/GridItemOld.js +0 -38
- package/dist/components/Grid/GridOld.css +0 -0
- package/dist/components/Grid/GridOld.js +0 -46
- package/dist/components/IconButton/IconButtonOld.css +0 -0
- package/dist/components/IconButton/IconButtonOld.js +0 -122
- package/dist/components/IconButtonSquare/IconButtonSquareOld.css +0 -43
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +0 -115
- package/dist/components/InputAutocomplete/InputAutocompleteOld.css +0 -5
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +0 -159
- package/dist/components/InputText/InputTextOld.css +0 -10
- package/dist/components/InputText/InputTextOld.js +0 -314
- package/dist/components/MenuItem/MenuItemOld.js +0 -123
- package/dist/components/Modal/ModalOld.css +0 -3
- package/dist/components/Modal/ModalOld.js +0 -213
- package/dist/components/RadioButton/RadioOld.css +0 -31
- package/dist/components/RadioButton/RadioOld.js +0 -126
- package/dist/components/SelectInput/SelectInputOld.css +0 -17
- package/dist/components/SelectInput/SelectInputOld.js +0 -296
- package/dist/components/Table/TableOld.css +0 -79
- package/dist/components/Table/TableOld.js +0 -133
- package/dist/components/Tabs/TabsOld.js +0 -78
- package/dist/components/Typography/TypographyOld.js +0 -119
|
@@ -15,6 +15,7 @@ require("./header.css");
|
|
|
15
15
|
var _DropDown = _interopRequireDefault(require("../DropDown/DropDown"));
|
|
16
16
|
var _IconButton = _interopRequireDefault(require("../IconButton/IconButton"));
|
|
17
17
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
18
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
18
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
19
20
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
20
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -53,6 +54,10 @@ var Header = function Header(_ref) {
|
|
|
53
54
|
actionLogoLeft = _ref.actionLogoLeft,
|
|
54
55
|
backIcon = _ref.backIcon,
|
|
55
56
|
dropdownLeftIcon = _ref.dropdownLeftIcon,
|
|
57
|
+
ariaLabelButtonBack = _ref.ariaLabelButtonBack,
|
|
58
|
+
ariaLabelDropdownLeft = _ref.ariaLabelDropdownLeft,
|
|
59
|
+
ariaLabelDropdownMore = _ref.ariaLabelDropdownMore,
|
|
60
|
+
ariaLabelThirdDropdownUser = _ref.ariaLabelThirdDropdownUser,
|
|
56
61
|
finishButtonVariant = _ref.finishButtonVariant,
|
|
57
62
|
finishButtonIcon = _ref.finishButtonIcon,
|
|
58
63
|
iconButtonBackProps = _ref.iconButtonBackProps,
|
|
@@ -71,6 +76,7 @@ var Header = function Header(_ref) {
|
|
|
71
76
|
buttonNotificationIcon = _ref.buttonNotificationIcon,
|
|
72
77
|
buttonNotificationProps = _ref.buttonNotificationProps,
|
|
73
78
|
buttonNotificationBadge = _ref.buttonNotificationBadge,
|
|
79
|
+
buttonNotificationAriaLabel = _ref.buttonNotificationAriaLabel,
|
|
74
80
|
styleIconButtonRightContainer = _ref.styleIconButtonRightContainer,
|
|
75
81
|
styleIconButtonRight = _ref.styleIconButtonRight,
|
|
76
82
|
placementTooltipThirdDropdownUser = _ref.placementTooltipThirdDropdownUser,
|
|
@@ -83,12 +89,15 @@ var Header = function Header(_ref) {
|
|
|
83
89
|
buttonFileManagerItems = _ref.buttonFileManagerItems,
|
|
84
90
|
buttonFileManagerProps = _ref.buttonFileManagerProps,
|
|
85
91
|
buttonFileManagerDropDownProps = _ref.buttonFileManagerDropDownProps,
|
|
92
|
+
buttonFileManagerAriaLabel = _ref.buttonFileManagerAriaLabel,
|
|
86
93
|
sx = _ref.sx,
|
|
87
94
|
propPrefixClass = _ref.prefixClass,
|
|
88
95
|
showTypographyLogoLeft = _ref.showTypographyLogoLeft,
|
|
89
96
|
buttonNotificationIconItems = _ref.buttonNotificationIconItems,
|
|
90
97
|
buttonNotificationIconDropDownProps = _ref.buttonNotificationIconDropDownProps,
|
|
91
|
-
thirdBlockActions = _ref.thirdBlockActions
|
|
98
|
+
thirdBlockActions = _ref.thirdBlockActions,
|
|
99
|
+
altLogoLeft = _ref.altLogoLeft,
|
|
100
|
+
altLogoRight = _ref.altLogoRight;
|
|
92
101
|
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
93
102
|
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
94
103
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
@@ -101,6 +110,75 @@ var Header = function Header(_ref) {
|
|
|
101
110
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
102
111
|
isEllipsisActive = _React$useState2[0],
|
|
103
112
|
setIsEllipsisActive = _React$useState2[1];
|
|
113
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
114
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
115
|
+
if (back) {
|
|
116
|
+
requireAccessibleText(ariaLabelButtonBack, {
|
|
117
|
+
component: 'Header',
|
|
118
|
+
prop: '"ariaLabelButtonBack"',
|
|
119
|
+
hint: 'El botón de volver (solo icono) necesita un "ariaLabelButtonBack" para ser identificado por los lectores de pantalla.',
|
|
120
|
+
receivedProps: {
|
|
121
|
+
back: !!back,
|
|
122
|
+
backIcon: backIcon
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (dropdownLeft) {
|
|
127
|
+
requireAccessibleText(ariaLabelDropdownLeft, {
|
|
128
|
+
component: 'Header',
|
|
129
|
+
prop: '"ariaLabelDropdownLeft"',
|
|
130
|
+
hint: 'El desplegable de la izquierda (botón solo icono) necesita un "ariaLabelDropdownLeft" para ser identificado por los lectores de pantalla.',
|
|
131
|
+
receivedProps: {
|
|
132
|
+
dropdownLeftIcon: dropdownLeftIcon
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (itemsDropDownMore) {
|
|
137
|
+
requireAccessibleText(ariaLabelDropdownMore, {
|
|
138
|
+
component: 'Header',
|
|
139
|
+
prop: '"ariaLabelDropdownMore"',
|
|
140
|
+
hint: 'El desplegable de "más opciones" (botón solo icono) necesita un "ariaLabelDropdownMore" para ser identificado por los lectores de pantalla.',
|
|
141
|
+
receivedProps: {
|
|
142
|
+
moreIcon: moreIcon
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
if (!logoAndDropdownSeparate || iconButtonRight || itemsDropDownUser) {
|
|
147
|
+
requireAccessibleText(ariaLabelThirdDropdownUser, {
|
|
148
|
+
component: 'Header',
|
|
149
|
+
prop: '"ariaLabelThirdDropdownUser"',
|
|
150
|
+
hint: 'El botón/desplegable de usuario de la derecha (icono, sin texto visible) necesita un "ariaLabelThirdDropdownUser" para ser identificado por los lectores de pantalla.',
|
|
151
|
+
receivedProps: {
|
|
152
|
+
iconButtonRight: !!iconButtonRight,
|
|
153
|
+
itemsDropDownUser: !!itemsDropDownUser,
|
|
154
|
+
logoAndDropdownSeparate: logoAndDropdownSeparate
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
if (onClickButtonNotification || buttonNotificationIconItems) {
|
|
159
|
+
requireAccessibleText(buttonNotificationAriaLabel, {
|
|
160
|
+
component: 'Header',
|
|
161
|
+
prop: '"buttonNotificationAriaLabel"',
|
|
162
|
+
hint: 'El botón de notificaciones (solo icono) necesita un "buttonNotificationAriaLabel" para ser identificado por los lectores de pantalla.',
|
|
163
|
+
receivedProps: {
|
|
164
|
+
buttonNotificationIcon: buttonNotificationIcon
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
if (onClickButtonFileManager) {
|
|
169
|
+
requireAccessibleText(buttonFileManagerAriaLabel, {
|
|
170
|
+
component: 'Header',
|
|
171
|
+
prop: '"buttonFileManagerAriaLabel"',
|
|
172
|
+
hint: 'El botón del gestor de archivos (solo icono) necesita un "buttonFileManagerAriaLabel" para ser identificado por los lectores de pantalla.',
|
|
173
|
+
receivedProps: {
|
|
174
|
+
buttonFileManagerIcon: buttonFileManagerIcon
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
var resolvedAriaLabelButtonBack = ariaLabelButtonBack || 'Button Left';
|
|
179
|
+
var resolvedAriaLabelDropdownLeft = ariaLabelDropdownLeft || 'Drop Down Button Left';
|
|
180
|
+
var resolvedAriaLabelDropdownMore = ariaLabelDropdownMore || 'Drop Down Button More';
|
|
181
|
+
var resolvedAriaLabelThirdDropdownUser = ariaLabelThirdDropdownUser || 'Button user';
|
|
104
182
|
_react["default"].useEffect(function () {
|
|
105
183
|
if (!companyNameRef.current) return;
|
|
106
184
|
var element = companyNameRef.current;
|
|
@@ -152,7 +230,7 @@ var Header = function Header(_ref) {
|
|
|
152
230
|
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_ButtonBasic["default"], _extends({
|
|
153
231
|
id: 'cbx-header-third-dropdown-user',
|
|
154
232
|
variant: 'tertiary',
|
|
155
|
-
"aria-label":
|
|
233
|
+
"aria-label": resolvedAriaLabelThirdDropdownUser,
|
|
156
234
|
style: {
|
|
157
235
|
paddingRight: '0.125rem'
|
|
158
236
|
},
|
|
@@ -165,7 +243,7 @@ var Header = function Header(_ref) {
|
|
|
165
243
|
id: 'cbx-header-third-logo-right',
|
|
166
244
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
167
245
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
168
|
-
alt:
|
|
246
|
+
alt: altLogoRight
|
|
169
247
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
170
248
|
className: prefixClass('cbx-header-third-button-user-logo'),
|
|
171
249
|
style: _objectSpread({}, styleIconButtonRightContainer)
|
|
@@ -174,11 +252,11 @@ var Header = function Header(_ref) {
|
|
|
174
252
|
style: _objectSpread({}, styleIconButtonRight)
|
|
175
253
|
})))
|
|
176
254
|
}, iconButtonRightProps))));
|
|
177
|
-
}, [tooltipThirdDropdownUser, placementTooltipThirdDropdownUser, logoRightXS, logoRight, breakpoints, innerWidth, styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps]);
|
|
255
|
+
}, [tooltipThirdDropdownUser, placementTooltipThirdDropdownUser, logoRightXS, logoRight, breakpoints, innerWidth, styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, altLogoRight, resolvedAriaLabelThirdDropdownUser]);
|
|
178
256
|
var renderlogoAndDropdownSeparated = _react["default"].useMemo(function () {
|
|
179
257
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, iconButtonRight && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
180
258
|
prefixClass: prefixClass,
|
|
181
|
-
"aria-label":
|
|
259
|
+
"aria-label": resolvedAriaLabelThirdDropdownUser,
|
|
182
260
|
id: 'cbx-header-third-button-user',
|
|
183
261
|
className: prefixClass('cbx-header-third-button-user cbx-header-button'),
|
|
184
262
|
styles: _objectSpread({}, styleIconButtonRightContainer),
|
|
@@ -193,9 +271,9 @@ var Header = function Header(_ref) {
|
|
|
193
271
|
id: 'cbx-header-third-logo-right',
|
|
194
272
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
195
273
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
196
|
-
alt:
|
|
274
|
+
alt: altLogoRight
|
|
197
275
|
}));
|
|
198
|
-
}, [styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, logoRight, logoRightXS, innerWidth, breakpoints]);
|
|
276
|
+
}, [styleIconButtonRightContainer, styleIconButtonRight, iconButtonRightProps, logoRight, logoRightXS, innerWidth, breakpoints, altLogoRight, resolvedAriaLabelThirdDropdownUser]);
|
|
199
277
|
var getCompanyName = _react["default"].useCallback(function () {
|
|
200
278
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
201
279
|
className: prefixClass('cbx-header-first-container-app-logo-text-empty')
|
|
@@ -234,7 +312,7 @@ var Header = function Header(_ref) {
|
|
|
234
312
|
className: prefixClass('cbx-header-first-container-button-dropdown-left')
|
|
235
313
|
}, /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
236
314
|
prefixClass: prefixClass,
|
|
237
|
-
"aria-label":
|
|
315
|
+
"aria-label": resolvedAriaLabelButtonBack,
|
|
238
316
|
id: 'cbx-header-first-button-left',
|
|
239
317
|
className: prefixClass('cbx-header-first-button-left cbx-header-button'),
|
|
240
318
|
onClick: back,
|
|
@@ -249,7 +327,7 @@ var Header = function Header(_ref) {
|
|
|
249
327
|
Component: function Component() {
|
|
250
328
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
251
329
|
prefixClass: prefixClass,
|
|
252
|
-
"aria-label":
|
|
330
|
+
"aria-label": resolvedAriaLabelDropdownLeft,
|
|
253
331
|
id: 'cbx-header-button-more',
|
|
254
332
|
className: prefixClass('cbx-header-first-button-left cbx-header-button'),
|
|
255
333
|
icon: dropdownLeftIcon || /*#__PURE__*/_react["default"].createElement("i", {
|
|
@@ -262,6 +340,14 @@ var Header = function Header(_ref) {
|
|
|
262
340
|
}, dropdownLeftProps))), logoLeft ? logoLeft !== 'noLogo' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
263
341
|
className: prefixClass("cbx-header-first-container-app-logo".concat(showTypographyLogoLeft ? '-empty' : '')),
|
|
264
342
|
onClick: actionLogoLeft,
|
|
343
|
+
onKeyDown: actionLogoLeft ? function (event) {
|
|
344
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
345
|
+
event.preventDefault();
|
|
346
|
+
actionLogoLeft(event);
|
|
347
|
+
}
|
|
348
|
+
} : undefined,
|
|
349
|
+
role: actionLogoLeft ? 'button' : undefined,
|
|
350
|
+
tabIndex: actionLogoLeft ? 0 : undefined,
|
|
265
351
|
style: {
|
|
266
352
|
cursor: actionLogoLeft ? 'pointer' : 'auto'
|
|
267
353
|
}
|
|
@@ -269,16 +355,24 @@ var Header = function Header(_ref) {
|
|
|
269
355
|
id: 'cbx-header-first-app-logo',
|
|
270
356
|
src: innerWidth < breakpoints.md ? logoLeftXS || logoLeft : logoLeft,
|
|
271
357
|
className: prefixClass('App-logo-header-ui'),
|
|
272
|
-
alt:
|
|
358
|
+
alt: altLogoLeft
|
|
273
359
|
}), showTypographyLogoLeft && getCompanyName()) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
274
360
|
className: prefixClass('cbx-header-first-container-app-logo-empty'),
|
|
275
361
|
onClick: actionLogoLeft,
|
|
362
|
+
onKeyDown: actionLogoLeft ? function (event) {
|
|
363
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
364
|
+
event.preventDefault();
|
|
365
|
+
actionLogoLeft(event);
|
|
366
|
+
}
|
|
367
|
+
} : undefined,
|
|
368
|
+
role: actionLogoLeft ? 'button' : undefined,
|
|
369
|
+
tabIndex: actionLogoLeft ? 0 : undefined,
|
|
276
370
|
style: {
|
|
277
371
|
cursor: actionLogoLeft ? 'pointer' : 'auto'
|
|
278
372
|
}
|
|
279
373
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
280
374
|
style: _objectSpread({}, colorNoLogo),
|
|
281
|
-
alt:
|
|
375
|
+
alt: altLogoLeft,
|
|
282
376
|
id: 'cbx-header-first-app-logo',
|
|
283
377
|
className: prefixClass('cbx-header-first-app-logo-empty')
|
|
284
378
|
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
@@ -316,7 +410,7 @@ var Header = function Header(_ref) {
|
|
|
316
410
|
Component: function Component() {
|
|
317
411
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
318
412
|
prefixClass: prefixClass,
|
|
319
|
-
"aria-label":
|
|
413
|
+
"aria-label": resolvedAriaLabelDropdownMore,
|
|
320
414
|
id: 'cbx-header-button-more',
|
|
321
415
|
className: prefixClass('cbx-header-second-button-more cbx-header-button'),
|
|
322
416
|
icon: moreIcon || /*#__PURE__*/_react["default"].createElement("i", {
|
|
@@ -330,7 +424,7 @@ var Header = function Header(_ref) {
|
|
|
330
424
|
className: prefixClass('cbx-header-second-container-finish')
|
|
331
425
|
}, innerWidth < breakpoints.md ? /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
332
426
|
prefixClass: prefixClass,
|
|
333
|
-
"aria-label": textFinishButton
|
|
427
|
+
"aria-label": textFinishButton,
|
|
334
428
|
id: 'cbx-header-button-logout',
|
|
335
429
|
className: prefixClass('cbx-header-second-button-icon-logout cbx-header-button'),
|
|
336
430
|
onClick: finish,
|
|
@@ -346,8 +440,7 @@ var Header = function Header(_ref) {
|
|
|
346
440
|
whiteSpace: 'nowrap'
|
|
347
441
|
},
|
|
348
442
|
text: textFinishButton,
|
|
349
|
-
onClick: finish
|
|
350
|
-
"aria-label": 'Actions Button'
|
|
443
|
+
onClick: finish
|
|
351
444
|
}, finishButtonBasicProps)))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
352
445
|
className: prefixClass('cbx-header-third-block'),
|
|
353
446
|
style: {
|
|
@@ -376,7 +469,7 @@ var Header = function Header(_ref) {
|
|
|
376
469
|
Component: function Component() {
|
|
377
470
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
378
471
|
prefixClass: prefixClass,
|
|
379
|
-
"aria-label":
|
|
472
|
+
"aria-label": buttonFileManagerAriaLabel || 'File manager',
|
|
380
473
|
id: 'cbx-header-third-button-buttonFileManager',
|
|
381
474
|
className: prefixClass('cbx-header-third-button-buttonFileManager'),
|
|
382
475
|
onClick: onClickButtonFileManager,
|
|
@@ -397,7 +490,7 @@ var Header = function Header(_ref) {
|
|
|
397
490
|
Component: function Component() {
|
|
398
491
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
399
492
|
prefixClass: prefixClass,
|
|
400
|
-
"aria-label":
|
|
493
|
+
"aria-label": buttonNotificationAriaLabel || 'Notifications',
|
|
401
494
|
id: 'cbx-header-third-button-notification',
|
|
402
495
|
className: prefixClass('cbx-header-third-button-notification'),
|
|
403
496
|
onClick: onClickButtonNotification,
|
|
@@ -411,7 +504,7 @@ var Header = function Header(_ref) {
|
|
|
411
504
|
closeOnOptionClick: true
|
|
412
505
|
}, buttonNotificationIconDropDownProps))) : onClickButtonNotification && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
413
506
|
prefixClass: prefixClass,
|
|
414
|
-
"aria-label":
|
|
507
|
+
"aria-label": buttonNotificationAriaLabel || 'Notifications',
|
|
415
508
|
id: 'cbx-header-third-button-notification',
|
|
416
509
|
className: prefixClass('cbx-header-third-button-notification'),
|
|
417
510
|
onClick: onClickButtonNotification,
|
|
@@ -423,10 +516,10 @@ var Header = function Header(_ref) {
|
|
|
423
516
|
id: 'cbx-header-third-logo-right',
|
|
424
517
|
className: prefixClass('cbx-header-third-logo-right'),
|
|
425
518
|
src: innerWidth < breakpoints.md ? logoRightXS || logoRight : logoRight,
|
|
426
|
-
alt:
|
|
519
|
+
alt: altLogoRight
|
|
427
520
|
})), !!iconButtonRight && !itemsDropDownUser && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
428
521
|
prefixClass: prefixClass,
|
|
429
|
-
"aria-label":
|
|
522
|
+
"aria-label": resolvedAriaLabelThirdDropdownUser,
|
|
430
523
|
id: 'cbx-header-third-button-user',
|
|
431
524
|
className: prefixClass('cbx-header-third-button-user cbx-header-button'),
|
|
432
525
|
icon: iconButtonRight,
|
|
@@ -465,7 +558,7 @@ var Header = function Header(_ref) {
|
|
|
465
558
|
Component: function Component() {
|
|
466
559
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
467
560
|
prefixClass: prefixClass,
|
|
468
|
-
"aria-label":
|
|
561
|
+
"aria-label": buttonFileManagerAriaLabel || 'File manager',
|
|
469
562
|
id: 'cbx-header-third-button-buttonFileManager',
|
|
470
563
|
className: prefixClass('cbx-header-third-button-buttonFileManager'),
|
|
471
564
|
onClick: onClickButtonFileManager,
|
|
@@ -486,7 +579,7 @@ var Header = function Header(_ref) {
|
|
|
486
579
|
Component: function Component() {
|
|
487
580
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
488
581
|
prefixClass: prefixClass,
|
|
489
|
-
"aria-label":
|
|
582
|
+
"aria-label": buttonNotificationAriaLabel || 'Notifications',
|
|
490
583
|
id: 'cbx-header-third-button-notification',
|
|
491
584
|
className: prefixClass('cbx-header-third-button-notification'),
|
|
492
585
|
onClick: onClickButtonNotification,
|
|
@@ -503,7 +596,7 @@ var Header = function Header(_ref) {
|
|
|
503
596
|
closeOnOptionClick: true
|
|
504
597
|
}, buttonNotificationIconDropDownProps))) : onClickButtonNotification && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
505
598
|
prefixClass: prefixClass,
|
|
506
|
-
"aria-label":
|
|
599
|
+
"aria-label": buttonNotificationAriaLabel || 'Notifications',
|
|
507
600
|
id: 'cbx-header-third-button-notification',
|
|
508
601
|
className: prefixClass('cbx-header-third-button-notification'),
|
|
509
602
|
onClick: onClickButtonNotification,
|
|
@@ -556,6 +649,10 @@ Header.propTypes = {
|
|
|
556
649
|
itemsDropDownSearch: _propTypes["default"].node,
|
|
557
650
|
itemsDropDownMore: _propTypes["default"].node,
|
|
558
651
|
dropdownLeftIcon: _propTypes["default"].node,
|
|
652
|
+
ariaLabelButtonBack: _propTypes["default"].string,
|
|
653
|
+
ariaLabelDropdownLeft: _propTypes["default"].string,
|
|
654
|
+
ariaLabelDropdownMore: _propTypes["default"].string,
|
|
655
|
+
ariaLabelThirdDropdownUser: _propTypes["default"].string,
|
|
559
656
|
finishButtonVariant: _propTypes["default"].node,
|
|
560
657
|
finishButtonIcon: _propTypes["default"].node,
|
|
561
658
|
actionLogoLeft: _propTypes["default"].func,
|
|
@@ -563,9 +660,13 @@ Header.propTypes = {
|
|
|
563
660
|
buttonNotificationIcon: _propTypes["default"].any,
|
|
564
661
|
buttonNotificationProps: _propTypes["default"].any,
|
|
565
662
|
buttonNotificationBadge: _propTypes["default"].bool,
|
|
663
|
+
buttonNotificationAriaLabel: _propTypes["default"].string,
|
|
664
|
+
buttonFileManagerAriaLabel: _propTypes["default"].string,
|
|
566
665
|
tooltipThirdDropdownUser: _propTypes["default"].string,
|
|
567
666
|
placementTooltipThirdDropdownUser: _propTypes["default"].string,
|
|
568
|
-
showTypographyLogoLeft: _propTypes["default"].bool
|
|
667
|
+
showTypographyLogoLeft: _propTypes["default"].bool,
|
|
668
|
+
altLogoLeft: _propTypes["default"].string,
|
|
669
|
+
altLogoRight: _propTypes["default"].string
|
|
569
670
|
};
|
|
570
671
|
Header.defaultProps = {
|
|
571
672
|
back: '',
|
|
@@ -593,15 +694,23 @@ Header.defaultProps = {
|
|
|
593
694
|
itemsDropDownMore: '',
|
|
594
695
|
actionLogoLeft: undefined,
|
|
595
696
|
dropdownLeftIcon: '',
|
|
697
|
+
ariaLabelButtonBack: '',
|
|
698
|
+
ariaLabelDropdownLeft: '',
|
|
699
|
+
ariaLabelDropdownMore: '',
|
|
700
|
+
ariaLabelThirdDropdownUser: '',
|
|
596
701
|
finishButtonVariant: '',
|
|
597
702
|
finishButtonIcon: '',
|
|
598
703
|
demoMode: false,
|
|
599
704
|
buttonNotificationIcon: undefined,
|
|
600
705
|
buttonNotificationProps: undefined,
|
|
601
706
|
buttonNotificationBadge: false,
|
|
707
|
+
buttonNotificationAriaLabel: '',
|
|
708
|
+
buttonFileManagerAriaLabel: '',
|
|
602
709
|
tooltipThirdDropdownUser: '',
|
|
603
710
|
placementTooltipThirdDropdownUser: 'bottom',
|
|
604
|
-
showTypographyLogoLeft: false
|
|
711
|
+
showTypographyLogoLeft: false,
|
|
712
|
+
altLogoLeft: 'Main logo',
|
|
713
|
+
altLogoRight: 'Secondary logo'
|
|
605
714
|
};
|
|
606
715
|
var _default = Header;
|
|
607
716
|
exports["default"] = _default;
|
|
@@ -30,7 +30,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
30
30
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
31
31
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
32
32
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
33
|
-
var IconButton = function
|
|
33
|
+
var IconButton = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
34
34
|
var id = _ref.id,
|
|
35
35
|
className = _ref.className,
|
|
36
36
|
onClick = _ref.onClick,
|
|
@@ -220,6 +220,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
220
220
|
};
|
|
221
221
|
var getButton = function getButton() {
|
|
222
222
|
return /*#__PURE__*/_react["default"].createElement("button", _extends({
|
|
223
|
+
ref: ref,
|
|
223
224
|
id: id,
|
|
224
225
|
disabled: disabled,
|
|
225
226
|
className: prefixClass("cbx-IconButton ".concat(className || '', " ").concat(type === 'fab' ? 'cbx-IconButton-fabButton' : '', " ").concat(type === 'square' ? 'cbx-IconButton-squareButton' : '', " ").concat(type === 'rounded' || rounded ? 'cbx-IconButton-rounded' : '', " ").concat(disabled ? 'cbx-IconButton-disabled' : '', " ").concat(active ? 'cbx-IconButton-active' : '', " ").concat(hoverColor ? 'cbx-IconButton-hoverColor' : '')),
|
|
@@ -252,7 +253,7 @@ var IconButton = function IconButton(_ref) {
|
|
|
252
253
|
}, getButton());
|
|
253
254
|
};
|
|
254
255
|
return tooltip ? getTooltip() : getButton();
|
|
255
|
-
};
|
|
256
|
+
});
|
|
256
257
|
IconButton.propTypes = {
|
|
257
258
|
id: _propTypes["default"].string,
|
|
258
259
|
className: _propTypes["default"].string,
|
|
@@ -14,7 +14,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
14
14
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
15
15
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
17
|
-
var IconButtonSquare = function
|
|
17
|
+
var IconButtonSquare = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
18
18
|
var sx = _ref.sx,
|
|
19
19
|
propPrefixClass = _ref.prefixClass,
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -22,11 +22,11 @@ var IconButtonSquare = function IconButtonSquare(_ref) {
|
|
|
22
22
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
23
23
|
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
24
24
|
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], _extends({
|
|
25
|
+
ref: ref,
|
|
25
26
|
prefixClass: prefixClass,
|
|
26
27
|
type: 'square'
|
|
27
28
|
}, props));
|
|
28
|
-
};
|
|
29
|
-
IconButtonSquare.displayName = "IconButtonSquare";
|
|
29
|
+
});
|
|
30
30
|
IconButtonSquare.propTypes = {};
|
|
31
31
|
IconButtonSquare.defaultProps = {};
|
|
32
32
|
var _default = IconButtonSquare;
|
|
@@ -18,6 +18,7 @@ var _LoadingSection = _interopRequireDefault(require("../LoadingSection/LoadingS
|
|
|
18
18
|
var _autoDetectScroll = require("../../utils/autoDetectScroll");
|
|
19
19
|
var _utils = require("../../utils");
|
|
20
20
|
var _useFallbackId = _interopRequireDefault(require("../../utils/useFallbackId"));
|
|
21
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
21
22
|
var _excluded = ["children", "className", "onChange", "onInputChange", "label", "value", "autoComplete", "inputValue", "style", "styles", "sx", "loadingText", "loading", "prefixClass", "options", "disabled", "getOptionLabel", "clearable", "getOptionSelected", "defaultValue", "filterOptions", "freeSolo", "InputProps", "clearOnBlur", "selectOnFocus", "id"];
|
|
22
23
|
/* eslint-disable no-tabs */
|
|
23
24
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -91,6 +92,20 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
91
92
|
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
92
93
|
dynamicPrefixClass = _useDynamicStyles.prefixClass;
|
|
93
94
|
var prefixClass = propPrefixClass || dynamicPrefixClass;
|
|
95
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
96
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
97
|
+
requireAccessibleText(label || props['aria-label'] || props.placeholder, {
|
|
98
|
+
component: 'InputAutocomplete',
|
|
99
|
+
prop: '"label", "aria-label" o "placeholder"',
|
|
100
|
+
hint: 'Un campo de autocompletado debe contar con una etiqueta visible (label), un "aria-label" o un "placeholder" descriptivo para ser identificado por los lectores de pantalla.',
|
|
101
|
+
receivedProps: {
|
|
102
|
+
label: label,
|
|
103
|
+
ariaLabel: props['aria-label'],
|
|
104
|
+
placeholder: props.placeholder,
|
|
105
|
+
id: id,
|
|
106
|
+
disabled: disabled
|
|
107
|
+
}
|
|
108
|
+
});
|
|
94
109
|
var _React$useState3 = _react["default"].useState({
|
|
95
110
|
showDropdown: false,
|
|
96
111
|
showSearchInput: false
|
|
@@ -386,13 +401,13 @@ var InputAutocomplete = function InputAutocomplete(_ref) {
|
|
|
386
401
|
}), shouldShowDropdown && /*#__PURE__*/_react["default"].createElement("div", {
|
|
387
402
|
className: prefixClass("cbx-inputAutocomplete-options-container ".concat(uiState.showDropdown && !isClosing ? 'cbx-inputAutocomplete-options-container-open' : 'cbx-inputAutocomplete-options-container-close')),
|
|
388
403
|
style: _objectSpread({}, positions),
|
|
389
|
-
onKeyDown: handleListKeyDown,
|
|
390
404
|
ref: dropdownRef
|
|
391
405
|
}, /*#__PURE__*/_react["default"].createElement("ul", {
|
|
392
406
|
className: prefixClass('cbx-inputAutocomplete-options'),
|
|
393
407
|
ref: optionContainerRef,
|
|
394
408
|
id: listboxId,
|
|
395
|
-
role: "listbox"
|
|
409
|
+
role: "listbox",
|
|
410
|
+
onKeyDown: handleListKeyDown
|
|
396
411
|
}, !loading && (filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.map(function (item, index) {
|
|
397
412
|
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], _extends({}, item, {
|
|
398
413
|
value: item.value || getOptionLabel(item),
|
|
@@ -11,6 +11,7 @@ require("../../styles/main.css");
|
|
|
11
11
|
require("./InputPassword.css");
|
|
12
12
|
var _CouncilboxThemeContext = require("../ThemeProvider/CouncilboxThemeContext");
|
|
13
13
|
var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
14
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
14
15
|
var _excluded = ["id", "className", "onChange", "onKeyUp", "onClick", "label", "disabled", "error", "helper", "width", "validation", "percentageError", "helperText", "fullWidth"];
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
16
17
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
@@ -43,6 +44,18 @@ var InputPassword = function InputPassword(_ref) {
|
|
|
43
44
|
showPassword = _React$useState2[0],
|
|
44
45
|
setShowPassword = _React$useState2[1];
|
|
45
46
|
var themeData = (0, _CouncilboxThemeContext.useCouncilboxTheme)();
|
|
47
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
48
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
49
|
+
requireAccessibleText(label || props['aria-label'], {
|
|
50
|
+
component: 'InputPassword',
|
|
51
|
+
prop: '"label" o "aria-label"',
|
|
52
|
+
hint: 'Un campo de contraseña debe contar con una etiqueta visible (label) o un "aria-label" para ser identificado por los lectores de pantalla.',
|
|
53
|
+
receivedProps: {
|
|
54
|
+
label: label,
|
|
55
|
+
id: id,
|
|
56
|
+
disabled: disabled
|
|
57
|
+
}
|
|
58
|
+
});
|
|
46
59
|
var getColorPercent = function getColorPercent(percent) {
|
|
47
60
|
var color = themeData.theme.colors.error;
|
|
48
61
|
if (percent > 30 && percent < 90) {
|
|
@@ -114,7 +127,7 @@ InputPassword.propTypes = {
|
|
|
114
127
|
percentageError: _propTypes["default"].number
|
|
115
128
|
};
|
|
116
129
|
InputPassword.defaultProps = {
|
|
117
|
-
label: '
|
|
130
|
+
label: '',
|
|
118
131
|
helper: '',
|
|
119
132
|
width: '',
|
|
120
133
|
id: '',
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
|
|
154
154
|
.cbx-inputText-fieldset {
|
|
155
155
|
font-size: 1rem;
|
|
156
|
-
transition: border 0.2s;
|
|
156
|
+
transition: border-color 0.2s;
|
|
157
157
|
color: var(--gray5);
|
|
158
158
|
padding-right: var(--spacing8);
|
|
159
159
|
text-align: left;
|
|
@@ -193,12 +193,11 @@
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
.cbx-inputText-fieldset-outlined.hover {
|
|
196
|
-
border:
|
|
196
|
+
border-color: black;
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
.cbx-inputText-fieldset-outlined.focused {
|
|
200
200
|
border-radius: inherit;
|
|
201
|
-
border-style: solid;
|
|
202
201
|
border: 2px solid var(--primary);
|
|
203
202
|
border-radius: 4px;
|
|
204
203
|
height: 53px;
|
|
@@ -207,7 +206,7 @@
|
|
|
207
206
|
}
|
|
208
207
|
|
|
209
208
|
.cbx-inputText-fieldset-outlined.focusedNo.value {
|
|
210
|
-
border:
|
|
209
|
+
border-color: #bbbbbb;
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
.cbx-inputText-fieldset.focused legend,
|
|
@@ -304,7 +303,9 @@
|
|
|
304
303
|
}
|
|
305
304
|
|
|
306
305
|
.cbx-input:focus~.cbx-inputText-bar:before,
|
|
307
|
-
.cbx-input:focus~.cbx-inputText-bar:after
|
|
306
|
+
.cbx-input:focus~.cbx-inputText-bar:after,
|
|
307
|
+
.cbx-inputText-bar.focused:before,
|
|
308
|
+
.cbx-inputText-bar.focused:after {
|
|
308
309
|
width: 50%;
|
|
309
310
|
}
|
|
310
311
|
|
|
@@ -437,6 +438,10 @@ textarea.cbx-inputText.cbx-inputText-standard~.cbx-inputText-fieldset-standard {
|
|
|
437
438
|
transform: translate(40px, -9px) scale(0.75);
|
|
438
439
|
}
|
|
439
440
|
|
|
441
|
+
.cbx-inputText-icon-startAdornment .cbx-inputText-fieldset legend {
|
|
442
|
+
margin-left: 1.625rem;
|
|
443
|
+
}
|
|
444
|
+
|
|
440
445
|
.cbx-inputText-autocomplete-button-open {
|
|
441
446
|
position: absolute;
|
|
442
447
|
right: 0.313rem;
|
|
@@ -99,7 +99,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
99
99
|
widthLabel = _React$useState8[0],
|
|
100
100
|
setWidthLabel = _React$useState8[1];
|
|
101
101
|
var textareaRef = _react["default"].useRef(null);
|
|
102
|
-
var inputShrink = !!(shrink || value || defaultValue || props !== null && props !== void 0 && props.InputLabelProps && props !== null && props !== void 0 && (_props$InputLabelProp = props.InputLabelProps) !== null && _props$InputLabelProp !== void 0 && _props$InputLabelProp.shrink);
|
|
102
|
+
var inputShrink = !!(shrink || value !== '' || defaultValue !== undefined || props !== null && props !== void 0 && props.InputLabelProps && props !== null && props !== void 0 && (_props$InputLabelProp = props.InputLabelProps) !== null && _props$InputLabelProp !== void 0 && _props$InputLabelProp.shrink);
|
|
103
103
|
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
104
104
|
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
105
105
|
var accessibleLabel = label || ariaLabel || placeholder;
|
|
@@ -339,7 +339,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
339
339
|
onBlur: handleInputBlur,
|
|
340
340
|
onMouseEnter: handleMouseEnter,
|
|
341
341
|
onMouseLeave: handleMouseLeave,
|
|
342
|
-
value: value
|
|
342
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
343
343
|
onChange: handleInputChange,
|
|
344
344
|
disabled: disabled,
|
|
345
345
|
type: type,
|
|
@@ -360,7 +360,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
360
360
|
onMouseEnter: handleMouseEnter,
|
|
361
361
|
onKeyDown: handleKeyDown,
|
|
362
362
|
onMouseLeave: handleMouseLeave,
|
|
363
|
-
value: value
|
|
363
|
+
value: value !== null && value !== void 0 ? value : '',
|
|
364
364
|
onChange: handleInputChange,
|
|
365
365
|
disabled: disabled,
|
|
366
366
|
type: type,
|
|
@@ -372,7 +372,7 @@ var InputText = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
|
372
372
|
"aria-invalid": !!error,
|
|
373
373
|
"aria-describedby": describedBy
|
|
374
374
|
}, accessibleLabelProps, props)), (getVariant() === 'filled' || getVariant() === 'standard') && /*#__PURE__*/_react["default"].createElement("span", {
|
|
375
|
-
className: prefixClass(
|
|
375
|
+
className: prefixClass("cbx-inputText-bar ".concat(isInputFocused ? 'focused' : ''))
|
|
376
376
|
}), !renderValue && getLabel(), type === 'autocomplete' && (options === null || options === void 0 ? void 0 : options.length) > 0 && /*#__PURE__*/_react["default"].createElement("button", {
|
|
377
377
|
type: "button",
|
|
378
378
|
className: prefixClass('cbx-inputText-autocomplete-button-open'),
|
|
@@ -12,6 +12,7 @@ var _InputText = _interopRequireDefault(require("../InputText/InputText"));
|
|
|
12
12
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
13
13
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
14
14
|
var _useFallbackId = _interopRequireDefault(require("../../utils/useFallbackId"));
|
|
15
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
15
16
|
var _excluded = ["value", "onChange", "label", "maxSize", "hideCount", "disabled", "autoComplete", "placeholder", "error", "rows", "variant", "id", "helper", "helperText", "sx"];
|
|
16
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
17
18
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
@@ -54,6 +55,19 @@ var InputTextArea = function InputTextArea(_ref) {
|
|
|
54
55
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
55
56
|
focus = _React$useState4[0],
|
|
56
57
|
setFocus = _React$useState4[1];
|
|
58
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
59
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
60
|
+
requireAccessibleText(label || props['aria-label'] || placeholder, {
|
|
61
|
+
component: 'InputTextArea',
|
|
62
|
+
prop: '"label", "aria-label" o "placeholder"',
|
|
63
|
+
hint: 'Un área de texto debe contar con una etiqueta visible (label), un "aria-label" o un "placeholder" descriptivo para ser identificada por los lectores de pantalla.',
|
|
64
|
+
receivedProps: {
|
|
65
|
+
label: label,
|
|
66
|
+
placeholder: placeholder,
|
|
67
|
+
id: id,
|
|
68
|
+
disabled: disabled
|
|
69
|
+
}
|
|
70
|
+
});
|
|
57
71
|
var fallbackId = (0, _useFallbackId["default"])('cbx-inputTextArea-id');
|
|
58
72
|
var textareaId = id || fallbackId;
|
|
59
73
|
var messageId = "".concat(textareaId, "-message");
|