@councilbox/councilbox-ui 2.0.52 → 2.0.54
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/dist/HOCs/overlayA11yStack.js +47 -0
- package/dist/HOCs/useA11yGuard.js +38 -0
- package/dist/HOCs/useDynamicStyles.js +18 -38
- package/dist/HOCs/useMenuNavigation.js +110 -0
- package/dist/HOCs/useOverlay.js +87 -0
- package/dist/HOCs/usePopoverPosition.js +228 -0
- package/dist/HOCs/useRipple.js +17 -35
- package/dist/HOCs/useWindowSize.js +24 -42
- package/dist/build-index.js +49 -99
- package/dist/components/1.Introduction.stories.mdx +1 -1
- package/dist/components/2.Changelog.stories.mdx +45 -0
- package/dist/components/3.Guide.stories.mdx +1 -1
- package/dist/components/Accordion/Accordion.css +7 -0
- package/dist/components/Accordion/Accordion.js +97 -102
- package/dist/components/Accordion/Accordion.stories.js +10 -12
- package/dist/components/Accordion/AccordionOld.js +32 -56
- package/dist/components/Accordion/DesignAccordion.stories.js +10 -21
- package/dist/components/Alert/Alert.js +55 -55
- package/dist/components/Alert/Alert.stories.js +10 -11
- package/dist/components/Avatar/Avatar.js +82 -74
- package/dist/components/Avatar/Avatar.stories.js +19 -23
- package/dist/components/Avatar/AvatarOld.js +46 -60
- package/dist/components/Avatar/DesignAvatar.stories.js +18 -26
- package/dist/components/Avatar/DesignAvatarText.stories.js +31 -40
- package/dist/components/AvatarGroup/AvatarGroup.js +7 -14
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +6 -13
- package/dist/components/AvatarGroup/DesignAvatarGroup.stories.js +34 -45
- package/dist/components/Block/Block.css +3 -3
- package/dist/components/Block/Block.js +31 -45
- package/dist/components/Block/Block.stories.js +5 -12
- package/dist/components/Block/DesignBlock.stories.js +7 -13
- package/dist/components/Button/Button.js +44 -66
- package/dist/components/Button/Button.stories.js +8 -14
- package/dist/components/Button/button.css +1 -1
- package/dist/components/ButtonBasic/ButtonBasic.css +6 -1
- package/dist/components/ButtonBasic/ButtonBasic.js +96 -118
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +14 -15
- package/dist/components/ButtonBasic/ButtonBasicOld.js +57 -77
- package/dist/components/Checkbox/Checkbox.css +6 -0
- package/dist/components/Checkbox/Checkbox.js +81 -100
- package/dist/components/Checkbox/Checkbox.stories.js +10 -11
- package/dist/components/Checkbox/CheckboxOld.js +19 -35
- package/dist/components/DragDrop/DragDrop.css +20 -9
- package/dist/components/DragDrop/DragDrop.js +80 -76
- package/dist/components/DragDrop/DragDrop.stories.js +9 -16
- package/dist/components/DrawerPanel/DesignDrawerPanel.js +35 -53
- package/dist/components/DrawerPanel/DrawerPanel.js +157 -146
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +10 -12
- package/dist/components/DrawerPanel/DrawerPanelOld.js +76 -98
- package/dist/components/DropDown/DesignDropDown.stories.js +79 -97
- package/dist/components/DropDown/DropDown.js +168 -342
- package/dist/components/DropDown/DropDown.stories.js +6 -12
- package/dist/components/DropDown/DropDownOld.js +57 -89
- package/dist/components/DropDown/PopoverPlayground.js +68 -98
- package/dist/components/EnhancedTable/DesignEnhancedTable.stories.js +26 -36
- package/dist/components/EnhancedTable/EnhancedMyTable.js +16 -19
- package/dist/components/EnhancedTable/EnhancedTable.js +77 -136
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +5 -12
- package/dist/components/EnhancedTable/EnhancedTableBody.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableCell.js +25 -34
- package/dist/components/EnhancedTable/EnhancedTableContainer.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableHead.js +11 -14
- package/dist/components/EnhancedTable/EnhancedTableRow.js +15 -18
- package/dist/components/EnhancedTable/EnhancedTableSortLabel.js +15 -18
- package/dist/components/FabButton/DesignFabButton.stories.js +9 -16
- package/dist/components/FabButton/FabButton.js +51 -54
- package/dist/components/FabButton/FabButton.stories.js +10 -12
- package/dist/components/Grid/DesignGrid.stories.js +7 -14
- package/dist/components/Grid/Grid.js +38 -46
- package/dist/components/Grid/Grid.stories.js +6 -13
- package/dist/components/Grid/GridItem.js +37 -39
- package/dist/components/Grid/GridItemOld.js +13 -18
- package/dist/components/Grid/GridOld.js +14 -21
- package/dist/components/Header/DesignHeader.stories.js +20 -24
- package/dist/components/Header/Header.js +201 -242
- package/dist/components/Header/Header.stories.js +9 -21
- package/dist/components/Header/header.css +10 -5
- package/dist/components/IconButton/DesignIconButton.stories.js +31 -36
- package/dist/components/IconButton/IconButton.css +6 -1
- package/dist/components/IconButton/IconButton.js +132 -138
- package/dist/components/IconButton/IconButton.stories.js +12 -13
- package/dist/components/IconButton/IconButtonOld.js +41 -57
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +5 -11
- package/dist/components/IconButtonSquare/IconButtonSquare.js +11 -25
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +7 -13
- package/dist/components/IconButtonSquare/IconButtonSquareOld.js +44 -62
- package/dist/components/IconFont/IconFont.js +27 -48
- package/dist/components/IconFont/IconFont.stories.js +5 -11
- package/dist/components/InputAutocomplete/InputAutocomplete.css +6 -0
- package/dist/components/InputAutocomplete/InputAutocomplete.js +184 -260
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +5 -11
- package/dist/components/InputAutocomplete/InputAutocompleteOld.js +43 -62
- package/dist/components/InputPassword/InputPassword.css +0 -6
- package/dist/components/InputPassword/InputPassword.js +58 -73
- package/dist/components/InputPassword/InputPassword.stories.js +5 -11
- package/dist/components/InputText/InputText.css +86 -78
- package/dist/components/InputText/InputText.js +207 -211
- package/dist/components/InputText/InputText.stories.js +11 -11
- package/dist/components/InputText/InputTextOld.js +48 -74
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +38 -51
- package/dist/components/InputTextArea/InputTextArea.js +84 -93
- package/dist/components/InputTextArea/InputTextArea.stories.js +5 -12
- package/dist/components/LoadingSection/LoadingSection.js +44 -51
- package/dist/components/LoadingSection/LoadingSection.stories.js +5 -11
- package/dist/components/MenuItem/DesignMenuItem.stories.js +20 -34
- package/dist/components/MenuItem/MenuItem.css +7 -2
- package/dist/components/MenuItem/MenuItem.js +100 -113
- package/dist/components/MenuItem/MenuItem.stories.js +6 -15
- package/dist/components/MenuItem/MenuItemOld.js +40 -56
- package/dist/components/MenuLateralLeft/MenuLateralLeft.css +24 -0
- package/dist/components/MenuLateralLeft/MenuLateralLeft.js +123 -160
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +5 -12
- package/dist/components/MenuLateralRight/MenuLateralRight.css +2 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.js +73 -77
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +5 -12
- package/dist/components/Modal/DesignModal.stories.js +15 -30
- package/dist/components/Modal/Modal.css +35 -15
- package/dist/components/Modal/Modal.js +154 -145
- package/dist/components/Modal/Modal.stories.js +7 -16
- package/dist/components/Modal/ModalOld.js +73 -90
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +4 -10
- package/dist/components/PaginationFooter/PaginationFooter.css +10 -0
- package/dist/components/PaginationFooter/PaginationFooter.js +99 -91
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +5 -12
- package/dist/components/RadioButton/Radio.css +19 -18
- package/dist/components/RadioButton/Radio.js +65 -83
- package/dist/components/RadioButton/Radio.stories.js +27 -36
- package/dist/components/RadioButton/RadioOld.js +23 -39
- package/dist/components/Ripple/DesignRipple.js +25 -41
- package/dist/components/Ripple/Ripple.stories.js +5 -11
- package/dist/components/Scrollbar/DesignScrollbar.js +5 -10
- package/dist/components/Scrollbar/Scrollbar.js +37 -56
- package/dist/components/Scrollbar/Scrollbar.stories.js +5 -12
- package/dist/components/SelectInput/DesignSelectInput.js +22 -45
- package/dist/components/SelectInput/SelectInput.js +101 -155
- package/dist/components/SelectInput/SelectInput.stories.js +6 -15
- package/dist/components/SelectInput/SelectInputOld.js +52 -81
- package/dist/components/Slider/DesignSlider.js +8 -14
- package/dist/components/Slider/Slider.css +57 -37
- package/dist/components/Slider/Slider.js +85 -84
- package/dist/components/Slider/Slider.stories.js +5 -12
- package/dist/components/Spacing/Spacing.js +38 -45
- package/dist/components/Spacing/Spacing.stories.js +5 -11
- package/dist/components/Stars/DesignStars.js +17 -30
- package/dist/components/Stars/Stars.css +55 -104
- package/dist/components/Stars/Stars.js +89 -73
- package/dist/components/Stars/Stars.stories.js +5 -12
- package/dist/components/Stepper/DesignStepper.stories.js +16 -30
- package/dist/components/Stepper/Stepper.css +46 -10
- package/dist/components/Stepper/Stepper.js +118 -134
- package/dist/components/Stepper/Stepper.stories.js +5 -12
- package/dist/components/Table/DesignTable.stories.js +200 -211
- package/dist/components/Table/Table.css +33 -2
- package/dist/components/Table/Table.js +30 -38
- package/dist/components/Table/Table.stories.js +5 -12
- package/dist/components/Table/TableBody.js +22 -34
- package/dist/components/Table/TableCell.js +71 -61
- package/dist/components/Table/TableContainer.js +22 -34
- package/dist/components/Table/TableHead.js +22 -34
- package/dist/components/Table/TableOld.js +52 -84
- package/dist/components/Table/TableRow.js +33 -37
- package/dist/components/Table/TableSortLabel.js +42 -52
- package/dist/components/Tabs/DesignTabs.js +14 -28
- package/dist/components/Tabs/Tabs.css +30 -11
- package/dist/components/Tabs/Tabs.js +151 -137
- package/dist/components/Tabs/Tabs.stories.js +5 -12
- package/dist/components/Tabs/TabsOld.js +28 -42
- package/dist/components/Tag/DesignTags.stories.js +24 -39
- package/dist/components/Tag/Tag.css +61 -42
- package/dist/components/Tag/Tag.js +93 -91
- package/dist/components/Tag/Tag.stories.js +5 -12
- package/dist/components/TextInput/TextInput.js +38 -54
- package/dist/components/TextInput/TextInput.stories.js +5 -11
- package/dist/components/ThemeProvider/Colors.js +2 -2
- package/dist/components/ThemeProvider/CouncilboxThemeContext.js +7 -10
- package/dist/components/ThemeProvider/ThemeProvider.js +34 -52
- package/dist/components/Timeline/DesignTimeline.stories.js +4 -10
- package/dist/components/Timeline/Timeline.js +66 -46
- package/dist/components/Timeline/Timeline.stories.js +5 -12
- package/dist/components/Toggle/Toggle.css +10 -0
- package/dist/components/Toggle/Toggle.js +115 -98
- package/dist/components/Toggle/Toggle.stories.js +10 -11
- package/dist/components/Tooltip/DesignTooltip.stories.js +10 -16
- package/dist/components/Tooltip/Tooltip.css +17 -1
- package/dist/components/Tooltip/Tooltip.js +190 -366
- package/dist/components/Tooltip/Tooltip.stories.js +5 -12
- package/dist/components/Typography/Typography.css +57 -6
- package/dist/components/Typography/Typography.js +44 -97
- package/dist/components/Typography/Typography.stories.js +5 -11
- package/dist/components/Typography/TypographyOld.js +29 -42
- package/dist/index.js +2 -6
- package/dist/reportWebVitals.js +8 -14
- package/dist/storybook.test.js +2 -4
- package/dist/styles/colorConsts.css +4 -4
- package/dist/styles/main.css +16 -0
- package/dist/styles/stylesheet.js +10 -22
- package/dist/testing/TestAutocomplete.js +74 -97
- package/dist/testing/TestComponents.js +5 -10
- package/dist/testing/TestDropdown.js +33 -41
- package/dist/utils/autoDetectScroll.js +12 -35
- package/dist/utils/index.js +37 -63
- package/dist/utils/useFallbackId.js +19 -0
- package/package.json +5 -2
|
@@ -3,51 +3,53 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports["default"] = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
9
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
13
|
-
|
|
14
10
|
require("../../styles/main.css");
|
|
15
|
-
|
|
16
11
|
require("./Alert.css");
|
|
17
|
-
|
|
18
12
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(
|
|
21
|
-
|
|
22
|
-
function _extends() { _extends = Object.assign
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
-
|
|
13
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
30
22
|
var Alert = function Alert(_ref) {
|
|
31
23
|
var id = _ref.id,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
24
|
+
className = _ref.className,
|
|
25
|
+
title = _ref.title,
|
|
26
|
+
type = _ref.type,
|
|
27
|
+
variant = _ref.variant,
|
|
28
|
+
fontWeight = _ref.fontWeight,
|
|
29
|
+
textAlign = _ref.textAlign,
|
|
30
|
+
colorText = _ref.colorText,
|
|
31
|
+
secondaryFont = _ref.secondaryFont,
|
|
32
|
+
component = _ref.component,
|
|
33
|
+
description = _ref.description,
|
|
34
|
+
icon = _ref.icon,
|
|
35
|
+
typographyProps = _ref.typographyProps,
|
|
36
|
+
sx = _ref.sx,
|
|
37
|
+
style = _ref.style;
|
|
38
|
+
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
39
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
40
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
41
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
42
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
43
|
+
requireAccessibleText(title || description, {
|
|
44
|
+
component: 'Alert',
|
|
45
|
+
prop: '"title" o "description"',
|
|
46
|
+
hint: 'Una alerta (role="alert/status") debe contener texto en "title" o "description" para comunicar información a los lectores de pantalla.',
|
|
47
|
+
receivedProps: {
|
|
48
|
+
title: title,
|
|
49
|
+
description: description,
|
|
50
|
+
type: type
|
|
51
|
+
}
|
|
52
|
+
});
|
|
51
53
|
var stylesType = {
|
|
52
54
|
info: {
|
|
53
55
|
container: {
|
|
@@ -89,34 +91,33 @@ var Alert = function Alert(_ref) {
|
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
};
|
|
92
|
-
|
|
93
94
|
var getStyles = function getStyles(element) {
|
|
94
95
|
var typeStyles = type;
|
|
95
|
-
|
|
96
96
|
if (type !== 'info' && type !== 'success' && type !== 'error') {
|
|
97
97
|
typeStyles = 'info';
|
|
98
98
|
}
|
|
99
|
-
|
|
100
99
|
return stylesType[typeStyles][element];
|
|
101
100
|
};
|
|
102
|
-
|
|
103
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
|
101
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
104
102
|
id: id,
|
|
105
103
|
className: "".concat(prefixClass('cbx-alert-container'), " ").concat(className || ''),
|
|
106
104
|
style: _objectSpread(_objectSpread(_objectSpread({
|
|
107
105
|
alignItems: description ? '' : 'center'
|
|
108
|
-
}, getStyles('container')), style), stylesInLine)
|
|
109
|
-
|
|
106
|
+
}, getStyles('container')), style), stylesInLine),
|
|
107
|
+
role: type === 'error' ? 'alert' : 'status',
|
|
108
|
+
"aria-live": type === 'error' ? 'assertive' : 'polite'
|
|
109
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
110
110
|
className: prefixClass('cbx-alert-block'),
|
|
111
111
|
style: _objectSpread({}, getStyles('iconContainer'))
|
|
112
|
-
}, /*#__PURE__*/_react
|
|
113
|
-
className: icon || getStyles('icon')
|
|
114
|
-
|
|
112
|
+
}, /*#__PURE__*/_react["default"].createElement("i", {
|
|
113
|
+
className: icon || getStyles('icon'),
|
|
114
|
+
"aria-hidden": "true"
|
|
115
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
115
116
|
className: prefixClass('cbx-alert-block-text'),
|
|
116
117
|
style: {
|
|
117
118
|
marginTop: description ? '0.25rem' : ''
|
|
118
119
|
}
|
|
119
|
-
}, /*#__PURE__*/_react
|
|
120
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], _extends({
|
|
120
121
|
styles: _objectSpread({}, getStyles('textContainer')),
|
|
121
122
|
variant: variant,
|
|
122
123
|
fontWeight: fontWeight,
|
|
@@ -127,14 +128,13 @@ var Alert = function Alert(_ref) {
|
|
|
127
128
|
prefixClass: prefixClass
|
|
128
129
|
}, typographyProps), title), description));
|
|
129
130
|
};
|
|
130
|
-
|
|
131
131
|
Alert.displayName = "Alert";
|
|
132
132
|
Alert.propTypes = {
|
|
133
|
-
title: _propTypes
|
|
134
|
-
id: _propTypes
|
|
135
|
-
className: _propTypes
|
|
136
|
-
type: _propTypes
|
|
137
|
-
description: _propTypes
|
|
133
|
+
title: _propTypes["default"].string,
|
|
134
|
+
id: _propTypes["default"].string,
|
|
135
|
+
className: _propTypes["default"].string,
|
|
136
|
+
type: _propTypes["default"].string,
|
|
137
|
+
description: _propTypes["default"].node
|
|
138
138
|
};
|
|
139
139
|
Alert.defaultProps = {
|
|
140
140
|
title: '',
|
|
@@ -145,4 +145,4 @@ Alert.defaultProps = {
|
|
|
145
145
|
icon: ''
|
|
146
146
|
};
|
|
147
147
|
var _default = Alert;
|
|
148
|
-
exports
|
|
148
|
+
exports["default"] = _default;
|
|
@@ -3,17 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports["default"] = exports.Default = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _Alert = _interopRequireDefault(require("./Alert"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
10
|
var _default = {
|
|
15
11
|
title: 'Components/Alert',
|
|
16
|
-
component: _Alert
|
|
12
|
+
component: _Alert["default"],
|
|
17
13
|
argTypes: {
|
|
18
14
|
type: {
|
|
19
15
|
options: ['info', 'success', 'error'],
|
|
@@ -23,6 +19,11 @@ var _default = {
|
|
|
23
19
|
}
|
|
24
20
|
},
|
|
25
21
|
parameters: {
|
|
22
|
+
docs: {
|
|
23
|
+
description: {
|
|
24
|
+
component: "\n## Alert\n\nComponente que permite comunicar mensajes importantes de informaci\xF3n, \xE9xito o error al usuario dentro de la interfaz.\n\nEl componente utiliza roles y regiones vivas ARIA para garantizar que las tecnolog\xEDas de asistencia anuncien el mensaje de forma adecuada.\n\n## Accesibilidad\n\n### Regiones vivas y roles din\xE1micos\n\n- El componente asigna autom\xE1ticamente un rol y nivel de prioridad (`aria-live`) seg\xFAn el tipo de alerta (`type`):\n - Cuando el tipo es error (`type=\"error\"`):\n - `role=\"alert\"`\n - `aria-live=\"assertive\"`\n - Interrumpe al lector de pantalla para anunciar el mensaje de forma inmediata.\n - Cuando el tipo es informaci\xF3n o \xE9xito (`type=\"info\"` o `type=\"success\"`):\n - `role=\"status\"`\n - `aria-live=\"polite\"`\n - Informa al usuario sin interrumpir su lectura o tarea actual.\n\n### Control de contenido accesible\n\n- El componente integra la guardia `useA11yGuard` para evitar renderizar alertas sin contenido \xFAtil.\n- Exige la presencia obligatoria de texto en el t\xEDtulo (`title`) o en la descripci\xF3n (`description`).\n- En caso de no proporcionar ninguno de estos elementos, la guardia lanza una excepci\xF3n informando del problema.\n\n### Iconograf\xEDa\n\n- Los iconos representativos del estado son \xFAnicamente decorativos.\n- Se marcan expl\xEDcitamente con `aria-hidden=\"true\"` para evitar que los lectores de pantalla anuncien informaci\xF3n redundante o nombres de clases.\n\n### Estructura del texto\n\n- El t\xEDtulo se renderiza apoy\xE1ndose en el componente `Typography`, garantizando contraste y legibilidad adecuados.\n- La descripci\xF3n permite contenido secundario o enriquecido (`node`) manteniendo la coherencia sem\xE1ntica del mensaje.\n\n## Recomendaciones de uso\n\n- Utilizar mensajes claros y concisos que expliquen la situaci\xF3n y la acci\xF3n requerida.\n- Reservar los mensajes de error \xFAnicamente para situaciones cr\xEDticas o fallos de acci\xF3n prioritarios.\n- Evitar ocultar o destruir alertas din\xE1micas con tiempos demasiado reducidos para permitir que todos los usuarios procesen la informaci\xF3n.\n\n## Consideraciones\n\nEl componente gestiona autom\xE1ticamente el comportamiento de lectura mediante los atributos `role` y `aria-live`.\nNo es necesario a\xF1adir atributos ARIA adicionales salvo que se requiera vincular la alerta a un elemento espec\xEDfico mediante `aria-describedby`.\n\t\t\t"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
26
27
|
storybookCodePanel: {
|
|
27
28
|
disabled: false,
|
|
28
29
|
files: [{
|
|
@@ -37,12 +38,10 @@ var _default = {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
};
|
|
40
|
-
exports
|
|
41
|
-
|
|
41
|
+
exports["default"] = _default;
|
|
42
42
|
var Template = function Template(args) {
|
|
43
|
-
return /*#__PURE__*/_react
|
|
43
|
+
return /*#__PURE__*/_react["default"].createElement(_Alert["default"], args);
|
|
44
44
|
};
|
|
45
|
-
|
|
46
45
|
Template.displayName = "Template";
|
|
47
46
|
var Default = Template.bind({});
|
|
48
47
|
exports.Default = Default;
|
|
@@ -1,40 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
7
|
+
exports["default"] = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
10
|
require("../../styles/main.css");
|
|
13
|
-
|
|
14
11
|
require("./Avatar.css");
|
|
15
|
-
|
|
16
12
|
var _Typography = _interopRequireDefault(require("../Typography/Typography"));
|
|
17
|
-
|
|
18
13
|
var _useDynamicStyles2 = _interopRequireDefault(require("../../HOCs/useDynamicStyles"));
|
|
19
|
-
|
|
20
14
|
var _Tooltip = _interopRequireDefault(require("../Tooltip/Tooltip"));
|
|
21
|
-
|
|
22
|
-
var _excluded = ["backgroundColor", "text", "src", "label", "colorText", "variantText", "fontWeightText", "textAlignText", "variantLabel", "colorLabel", "fontWeightLabel", "textAlignLabel", "sizeAvatar", "sizeText", "sx", "style", "tooltip", "placementTooltip"];
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
|
|
34
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
35
|
-
|
|
36
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
37
|
-
|
|
15
|
+
var _useA11yGuard2 = require("../../HOCs/useA11yGuard");
|
|
16
|
+
var _excluded = ["backgroundColor", "text", "src", "label", "colorText", "variantText", "fontWeightText", "textAlignText", "variantLabel", "colorLabel", "fontWeightLabel", "textAlignLabel", "sizeAvatar", "sizeText", "sx", "style", "tooltip", "placementTooltip", "alt"];
|
|
17
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
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); }
|
|
19
|
+
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; }
|
|
20
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
|
+
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; }
|
|
25
|
+
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; }
|
|
38
26
|
var stylesAvatar = {
|
|
39
27
|
SM: {
|
|
40
28
|
width: 'var(--spacing32)',
|
|
@@ -55,36 +43,52 @@ var stylesAvatarLabel = {
|
|
|
55
43
|
height: 'var(--spacing24)'
|
|
56
44
|
}
|
|
57
45
|
};
|
|
58
|
-
|
|
59
46
|
var Avatar = function Avatar(_ref) {
|
|
60
47
|
var backgroundColor = _ref.backgroundColor,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var _useDynamicStyles = (0, _useDynamicStyles2
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
48
|
+
text = _ref.text,
|
|
49
|
+
src = _ref.src,
|
|
50
|
+
label = _ref.label,
|
|
51
|
+
colorText = _ref.colorText,
|
|
52
|
+
variantText = _ref.variantText,
|
|
53
|
+
fontWeightText = _ref.fontWeightText,
|
|
54
|
+
textAlignText = _ref.textAlignText,
|
|
55
|
+
variantLabel = _ref.variantLabel,
|
|
56
|
+
colorLabel = _ref.colorLabel,
|
|
57
|
+
fontWeightLabel = _ref.fontWeightLabel,
|
|
58
|
+
textAlignLabel = _ref.textAlignLabel,
|
|
59
|
+
sizeAvatar = _ref.sizeAvatar,
|
|
60
|
+
sizeText = _ref.sizeText,
|
|
61
|
+
sx = _ref.sx,
|
|
62
|
+
style = _ref.style,
|
|
63
|
+
tooltip = _ref.tooltip,
|
|
64
|
+
placementTooltip = _ref.placementTooltip,
|
|
65
|
+
alt = _ref.alt,
|
|
66
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
67
|
+
var _useDynamicStyles = (0, _useDynamicStyles2["default"])(sx),
|
|
68
|
+
stylesInLine = _useDynamicStyles.stylesInLine,
|
|
69
|
+
prefixClass = _useDynamicStyles.prefixClass;
|
|
70
|
+
var _useA11yGuard = (0, _useA11yGuard2.useA11yGuard)(),
|
|
71
|
+
requireAccessibleText = _useA11yGuard.requireAccessibleText;
|
|
84
72
|
var hasImage = typeof src === 'string' && src !== null && src !== '';
|
|
85
|
-
|
|
73
|
+
var isCustomElement = /*#__PURE__*/_react["default"].isValidElement(src);
|
|
74
|
+
var accessibleLabel = alt || tooltip || label || text || 'Avatar';
|
|
75
|
+
if (hasImage) {
|
|
76
|
+
requireAccessibleText(alt || tooltip || label, {
|
|
77
|
+
component: 'Avatar',
|
|
78
|
+
prop: '"alt", "tooltip" o "label"',
|
|
79
|
+
hint: 'Cuando se usa "src" como imagen hay que indicar qué representa para los lectores de pantalla.',
|
|
80
|
+
receivedProps: {
|
|
81
|
+
src: src,
|
|
82
|
+
alt: alt,
|
|
83
|
+
tooltip: tooltip,
|
|
84
|
+
label: label,
|
|
85
|
+
text: text
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
86
90
|
className: prefixClass('cbx-avatar-block')
|
|
87
|
-
}, /*#__PURE__*/_react
|
|
91
|
+
}, /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
88
92
|
className: prefixClass('cbx-avatar-block-text'),
|
|
89
93
|
style: _objectSpread(_objectSpread(_objectSpread({
|
|
90
94
|
backgroundColor: hasImage ? 'transparent' : backgroundColor,
|
|
@@ -96,29 +100,32 @@ var Avatar = function Avatar(_ref) {
|
|
|
96
100
|
justifyContent: 'center',
|
|
97
101
|
borderRadius: '50%'
|
|
98
102
|
}, style), stylesInLine)
|
|
99
|
-
}, props
|
|
103
|
+
}, props, !hasImage && !isCustomElement ? {
|
|
104
|
+
role: 'img',
|
|
105
|
+
'aria-label': accessibleLabel
|
|
106
|
+
} : {}), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
|
100
107
|
title: tooltip || '',
|
|
101
108
|
placement: placementTooltip
|
|
102
|
-
}, /*#__PURE__*/_react
|
|
109
|
+
}, /*#__PURE__*/_react["default"].isValidElement(src) ? src : src ? /*#__PURE__*/_react["default"].createElement("img", {
|
|
103
110
|
src: src,
|
|
104
|
-
alt:
|
|
111
|
+
alt: alt || tooltip || label || 'Avatar',
|
|
105
112
|
style: {
|
|
106
113
|
width: '100%',
|
|
107
114
|
height: '100%',
|
|
108
115
|
borderRadius: '50%'
|
|
109
116
|
}
|
|
110
|
-
}) : /*#__PURE__*/_react
|
|
117
|
+
}) : /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
111
118
|
variant: variantText || (!variantText && !!label ? 'XS' : 'M'),
|
|
112
119
|
color: colorText || 'var(--gray4)',
|
|
113
120
|
fontWeight: fontWeightText,
|
|
114
121
|
textAlign: textAlignText,
|
|
115
122
|
prefixClass: prefixClass
|
|
116
|
-
}, text))), label && /*#__PURE__*/_react
|
|
123
|
+
}, text))), label && /*#__PURE__*/_react["default"].createElement("div", {
|
|
117
124
|
className: prefixClass('cbx-avatar-label'),
|
|
118
125
|
style: {
|
|
119
126
|
marginLeft: sizeAvatar === 'XS' ? 'var(--spacing4)' : 'var(--spacing8)'
|
|
120
127
|
}
|
|
121
|
-
}, /*#__PURE__*/_react
|
|
128
|
+
}, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
|
|
122
129
|
variant: variantLabel || 'M',
|
|
123
130
|
color: colorLabel,
|
|
124
131
|
fontWeight: fontWeightLabel,
|
|
@@ -126,23 +133,23 @@ var Avatar = function Avatar(_ref) {
|
|
|
126
133
|
prefixClass: prefixClass
|
|
127
134
|
}, label)));
|
|
128
135
|
};
|
|
129
|
-
|
|
130
136
|
Avatar.displayName = "Avatar";
|
|
131
137
|
Avatar.propTypes = {
|
|
132
|
-
backgroundColor: _propTypes
|
|
133
|
-
text: _propTypes
|
|
134
|
-
src: _propTypes
|
|
135
|
-
label: _propTypes
|
|
136
|
-
colorText: _propTypes
|
|
137
|
-
variantText: _propTypes
|
|
138
|
-
fontWeightText: _propTypes
|
|
139
|
-
textAlignText: _propTypes
|
|
140
|
-
variantLabel: _propTypes
|
|
141
|
-
colorLabel: _propTypes
|
|
142
|
-
fontWeightLabel: _propTypes
|
|
143
|
-
textAlignLabel: _propTypes
|
|
144
|
-
sizeAvatar: _propTypes
|
|
145
|
-
sizeText: _propTypes
|
|
138
|
+
backgroundColor: _propTypes["default"].string,
|
|
139
|
+
text: _propTypes["default"].any,
|
|
140
|
+
src: _propTypes["default"].any,
|
|
141
|
+
label: _propTypes["default"].string,
|
|
142
|
+
colorText: _propTypes["default"].string,
|
|
143
|
+
variantText: _propTypes["default"].string,
|
|
144
|
+
fontWeightText: _propTypes["default"].string,
|
|
145
|
+
textAlignText: _propTypes["default"].string,
|
|
146
|
+
variantLabel: _propTypes["default"].string,
|
|
147
|
+
colorLabel: _propTypes["default"].string,
|
|
148
|
+
fontWeightLabel: _propTypes["default"].string,
|
|
149
|
+
textAlignLabel: _propTypes["default"].string,
|
|
150
|
+
sizeAvatar: _propTypes["default"].string,
|
|
151
|
+
sizeText: _propTypes["default"].string,
|
|
152
|
+
alt: _propTypes["default"].string
|
|
146
153
|
};
|
|
147
154
|
Avatar.defaultProps = {
|
|
148
155
|
backgroundColor: '',
|
|
@@ -158,7 +165,8 @@ Avatar.defaultProps = {
|
|
|
158
165
|
fontWeightLabel: '',
|
|
159
166
|
textAlignLabel: '',
|
|
160
167
|
sizeAvatar: '',
|
|
161
|
-
sizeText: ''
|
|
168
|
+
sizeText: '',
|
|
169
|
+
alt: ''
|
|
162
170
|
};
|
|
163
171
|
var _default = Avatar;
|
|
164
|
-
exports
|
|
172
|
+
exports["default"] = _default;
|
|
@@ -3,33 +3,25 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
7
|
-
|
|
6
|
+
exports["default"] = exports.DesignAvatarTemplate = exports.Default = void 0;
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
|
|
10
8
|
var _imgMan = _interopRequireDefault(require("../../assets/img/imgMan.png"));
|
|
11
|
-
|
|
12
9
|
var _imgGirl = _interopRequireDefault(require("../../assets/img/imgGirl.png"));
|
|
13
|
-
|
|
14
10
|
var _imgDefault = _interopRequireDefault(require("../../assets/img/imgDefault.png"));
|
|
15
|
-
|
|
16
11
|
var _Avatar = _interopRequireDefault(require("./Avatar"));
|
|
17
|
-
|
|
18
12
|
var _DesignAvatar = _interopRequireDefault(require("./DesignAvatar.stories"));
|
|
19
|
-
|
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
22
14
|
// import DesignAvatarText from './DesignAvatarText.stories';
|
|
23
15
|
var _default = {
|
|
24
16
|
title: 'Components/Avatar',
|
|
25
|
-
component: _Avatar
|
|
17
|
+
component: _Avatar["default"],
|
|
26
18
|
argTypes: {
|
|
27
19
|
src: {
|
|
28
20
|
options: ['imgGirl', 'imgMan', 'imgDefault', 'empty'],
|
|
29
21
|
mapping: {
|
|
30
|
-
imgGirl: _imgGirl
|
|
31
|
-
imgMan: _imgMan
|
|
32
|
-
imgDefault: _imgDefault
|
|
22
|
+
imgGirl: _imgGirl["default"],
|
|
23
|
+
imgMan: _imgMan["default"],
|
|
24
|
+
imgDefault: _imgDefault["default"],
|
|
33
25
|
empty: ''
|
|
34
26
|
},
|
|
35
27
|
control: {
|
|
@@ -54,6 +46,11 @@ var _default = {
|
|
|
54
46
|
}
|
|
55
47
|
},
|
|
56
48
|
parameters: {
|
|
49
|
+
docs: {
|
|
50
|
+
description: {
|
|
51
|
+
component: "\n## Avatar\n\nComponente que representa visualmente a un usuario o entidad mediante una imagen, iniciales de texto o un elemento gr\xE1fico personalizado.\n\nEl componente garantiza la presencia de alternativas textuales mediante atributos expl\xEDcitos para lectores de pantalla.\n\n## Accesibilidad\n\n### Identificaci\xF3n y texto alternativo\n\n- El componente asigna la etiqueta accesible adecuada dependiendo del modo de renderizado:\n - Cuando se utiliza una imagen (`src` como cadena de texto):\n - La etiqueta de la imagen toma el valor definido mediante `alt`, `tooltip` o `label`.\n - Es obligatorio proporcionar una alternativa textual expl\xEDcita para describir al usuario o entidad que representa.\n - Cuando se utilizan iniciales de texto o sin imagen:\n - El contenedor se identifica como imagen gr\xE1fica mediante `role=\"img\"`.\n - Define una etiqueta accesible priorizando `alt`, `tooltip`, `label` o las iniciales en `text`.\n\n### Control de accesibilidad mediante `useA11yGuard`\n\n- Integra la guardia `useA11yGuard` para validar la presencia de texto accesible cuando se incluye un recurso de imagen.\n- Si se proporciona la propiedad `src`, se exige la presencia de `alt`, `tooltip` o `label`.\n- En caso de no incluir una alternativa textual descriptiva para la imagen, la guardia lanza una excepci\xF3n detallada en modo desarrollo.\n\n### Soporte de elementos y etiquetas secundarias\n\n- La propiedad `label` adjunta un texto visible al lado del Avatar manteniendo la coherencia sem\xE1ntica mediante el componente `Typography`.\n- Cuando se a\xF1ade un `tooltip`, la informaci\xF3n complementaria se vincula visualmente y queda disponible para tecnolog\xEDas asistivas.\n\n## Recomendaciones de uso\n\n- Proporcionar siempre un texto alternativo preciso en la propiedad `alt` cuando el Avatar represente a una persona u organizaci\xF3n concreta (por ejemplo, `alt=\"Fotograf\xEDa de perfil de Mar\xEDa Garc\xEDa\"`).\n- Evitar textos alternativos gen\xE9ricos como \"avatar\" o \"imagen\" cuando se disponga del nombre del usuario.\n- Asegurar un contraste adecuado entre el color de fondo (`backgroundColor`) y el texto de las iniciales (`colorText`).\n\n## Consideraciones\n\nEl componente gestiona autom\xE1ticamente la asignaci\xF3n de `role=\"img\"` y la etiqueta accesible seg\xFAn el modo de representaci\xF3n utilizado.\nNo es necesario a\xF1adir atributos ARIA adicionales salvo que el Avatar sea interactivo (en cuyo caso debe envolverse en un control navegable como `button` o `a`).\n\t\t\t"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
57
54
|
storybookCodePanel: {
|
|
58
55
|
disabled: false,
|
|
59
56
|
files: [{
|
|
@@ -68,25 +65,22 @@ var _default = {
|
|
|
68
65
|
}
|
|
69
66
|
}
|
|
70
67
|
};
|
|
71
|
-
exports
|
|
72
|
-
|
|
68
|
+
exports["default"] = _default;
|
|
73
69
|
var Template = function Template(args) {
|
|
74
|
-
return /*#__PURE__*/_react
|
|
70
|
+
return /*#__PURE__*/_react["default"].createElement(_Avatar["default"], args);
|
|
75
71
|
};
|
|
76
|
-
|
|
77
72
|
Template.displayName = "Template";
|
|
78
|
-
|
|
79
73
|
var TemplateAvatar = function TemplateAvatar(args) {
|
|
80
|
-
return /*#__PURE__*/_react
|
|
74
|
+
return /*#__PURE__*/_react["default"].createElement(_DesignAvatar["default"], args);
|
|
81
75
|
};
|
|
82
|
-
|
|
83
76
|
TemplateAvatar.displayName = "TemplateAvatar";
|
|
84
77
|
// const TemplateAvatarText = args => <DesignAvatarText {...args} />;
|
|
78
|
+
|
|
85
79
|
var Default = Template.bind({});
|
|
86
80
|
exports.Default = Default;
|
|
87
81
|
Default.args = {
|
|
88
82
|
text: '',
|
|
89
|
-
src: _imgDefault
|
|
83
|
+
src: _imgDefault["default"],
|
|
90
84
|
label: ''
|
|
91
85
|
};
|
|
92
86
|
var DesignAvatarTemplate = TemplateAvatar.bind({});
|
|
@@ -96,7 +90,9 @@ DesignAvatarTemplate.parameters = {
|
|
|
96
90
|
disable: true
|
|
97
91
|
}
|
|
98
92
|
};
|
|
99
|
-
DesignAvatarTemplate.args = {};
|
|
93
|
+
DesignAvatarTemplate.args = {};
|
|
94
|
+
|
|
95
|
+
// export const DesignAvatarTextTemplate = TemplateAvatarText.bind({});
|
|
100
96
|
// DesignAvatarTextTemplate.parameters = {
|
|
101
97
|
// controls: { disable: true },
|
|
102
98
|
// };
|