@councilbox/councilbox-ui 2.0.58 → 2.0.59
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/ScrollbarOld.js +3 -0
- package/dist/build-index.js +7 -7
- package/dist/components/1.Introduction.stories.mdx +579 -67
- package/dist/components/2.Changelog.stories.mdx +1392 -595
- package/dist/components/3.Guide.stories.mdx +570 -216
- package/dist/components/Accordion/Accordion.stories.js +55 -4
- package/dist/components/Alert/Alert.stories.js +50 -0
- package/dist/components/Avatar/Avatar.stories.js +69 -10
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +51 -4
- package/dist/components/Block/Block.stories.js +23 -2
- package/dist/components/Button/Button.stories.js +47 -21
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +80 -27
- package/dist/components/Checkbox/Checkbox.stories.js +73 -4
- package/dist/components/DatePicker/DatePicker.stories.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +1 -1
- package/dist/components/DragDrop/DragDrop.stories.js +116 -16
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +227 -1
- package/dist/components/DropDown/DropDown.stories.js +198 -1
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +218 -8
- package/dist/components/FabButton/FabButton.stories.js +102 -1
- package/dist/components/Grid/Grid.stories.js +178 -4
- package/dist/components/Header/Header.stories.js +588 -13
- package/dist/components/IconButton/IconButton.stories.js +167 -2
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +172 -2
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +174 -13
- package/dist/components/InputPassword/InputPassword.stories.js +114 -4
- package/dist/components/InputText/InputText.stories.js +170 -9
- package/dist/components/InputTextArea/InputTextArea.stories.js +108 -2
- package/dist/components/LoadingSection/LoadingSection.stories.js +45 -3
- package/dist/components/MenuItem/MenuItem.stories.js +92 -7
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +208 -2
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +193 -2
- package/dist/components/Modal/Modal.stories.js +181 -19
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +148 -5
- package/dist/components/RadioButton/Radio.stories.js +104 -4
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +7 -1
- package/dist/components/RichTextInput/RichTextInput.stories.js +5 -0
- package/dist/components/Ripple/Ripple.stories.js +72 -4
- package/dist/components/Scrollbar/Scrollbar.css +60 -19
- package/dist/components/Scrollbar/Scrollbar.js +386 -62
- package/dist/components/Scrollbar/Scrollbar.stories.js +5 -0
- 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 +140 -0
- package/dist/components/SelectInput/SelectInput.stories.js +139 -8
- package/dist/components/Slider/Slider.stories.js +94 -3
- package/dist/components/Spacing/Spacing.stories.js +6 -1
- package/dist/components/Stars/Stars.stories.js +104 -3
- package/dist/components/Stepper/Stepper.stories.js +91 -1
- package/dist/components/Table/Table.stories.js +171 -9
- package/dist/components/Tabs/Tabs.stories.js +122 -3
- package/dist/components/Tag/Tag.stories.js +105 -2
- package/dist/components/TextInput/TextInput.stories.js +92 -4
- package/dist/components/TimePicker/TimePicker.stories.js +1 -1
- package/dist/components/Timeline/Timeline.stories.js +93 -2
- package/dist/components/Toast/Toast.stories.js +6 -0
- package/dist/components/Toggle/Toggle.stories.js +80 -4
- package/dist/components/Tooltip/Tooltip.stories.js +105 -3
- package/dist/components/Typography/Typography.stories.js +51 -10
- package/package.json +5 -5
- package/IconFont.js +0 -3
- package/dist/components/IconFont/IconFont.css +0 -0
- package/dist/components/IconFont/IconFont.js +0 -86
- package/dist/components/IconFont/IconFont.stories.js +0 -36
- package/dist/fonts/IconNames.json +0 -6848
|
@@ -6,19 +6,104 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.Validation = exports.Helper = exports.ErrorTemplate = exports.Disabled = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _InputPassword = _interopRequireDefault(require("./InputPassword"));
|
|
9
|
+
var _excluded = ["value", "onChange"];
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
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); }
|
|
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
|
+
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; }
|
|
19
|
+
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; }
|
|
10
20
|
var _default = {
|
|
11
21
|
title: 'Components/Input Password',
|
|
12
22
|
component: _InputPassword["default"],
|
|
13
23
|
argTypes: {
|
|
24
|
+
label: {
|
|
25
|
+
control: 'text'
|
|
26
|
+
},
|
|
27
|
+
value: {
|
|
28
|
+
control: 'text'
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
control: 'text'
|
|
32
|
+
},
|
|
14
33
|
variant: {
|
|
15
34
|
options: ['outlined', 'filled', 'standard'],
|
|
16
35
|
control: {
|
|
17
36
|
type: 'radio'
|
|
18
37
|
}
|
|
38
|
+
},
|
|
39
|
+
required: {
|
|
40
|
+
control: 'boolean'
|
|
41
|
+
},
|
|
42
|
+
disabled: {
|
|
43
|
+
control: 'boolean'
|
|
44
|
+
},
|
|
45
|
+
fullWidth: {
|
|
46
|
+
control: 'boolean'
|
|
47
|
+
},
|
|
48
|
+
error: {
|
|
49
|
+
control: 'text',
|
|
50
|
+
description: 'Mensaje de error (vacío para quitarlo).'
|
|
51
|
+
},
|
|
52
|
+
helper: {
|
|
53
|
+
control: 'text'
|
|
54
|
+
},
|
|
55
|
+
validation: {
|
|
56
|
+
control: 'boolean',
|
|
57
|
+
description: 'Muestra la barra de seguridad.'
|
|
58
|
+
},
|
|
59
|
+
percentageError: {
|
|
60
|
+
control: {
|
|
61
|
+
type: 'range',
|
|
62
|
+
min: 0,
|
|
63
|
+
max: 100,
|
|
64
|
+
step: 1
|
|
65
|
+
},
|
|
66
|
+
description: 'Seguridad de la contraseña (0-100).'
|
|
67
|
+
},
|
|
68
|
+
autoComplete: {
|
|
69
|
+
control: 'select',
|
|
70
|
+
options: ['off', 'current-password', 'new-password']
|
|
71
|
+
},
|
|
72
|
+
'aria-label': {
|
|
73
|
+
control: 'text'
|
|
74
|
+
},
|
|
75
|
+
onChange: {
|
|
76
|
+
action: 'onChange'
|
|
77
|
+
},
|
|
78
|
+
onKeyUp: {
|
|
79
|
+
action: 'onKeyUp'
|
|
80
|
+
},
|
|
81
|
+
onClick: {
|
|
82
|
+
action: 'onClick'
|
|
83
|
+
},
|
|
84
|
+
id: {
|
|
85
|
+
control: 'text'
|
|
86
|
+
},
|
|
87
|
+
className: {
|
|
88
|
+
control: 'text'
|
|
89
|
+
},
|
|
90
|
+
width: {
|
|
91
|
+
table: {
|
|
92
|
+
disable: true
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
helperText: {
|
|
96
|
+
table: {
|
|
97
|
+
disable: true
|
|
98
|
+
}
|
|
19
99
|
}
|
|
20
100
|
},
|
|
21
101
|
parameters: {
|
|
102
|
+
docs: {
|
|
103
|
+
description: {
|
|
104
|
+
component: "\n## InputPassword\n\nCampo de contrase\xF1a basado en `InputText`, con un bot\xF3n para mostrar u ocultar el texto y una barra opcional que indica la seguridad de la contrase\xF1a.\n\n## Funcionamiento\n\n- Se comporta como un `InputText` de tipo `password`: admite `label`, `onChange`, `onKeyUp`, `error`, `helper`, `disabled`, `fullWidth` y el resto de props del campo.\n- **Mostrar / ocultar**: el bot\xF3n con el icono del ojo alterna el tipo del campo entre `password` y `text`.\n- **Barra de seguridad**: con `validation`, se muestra bajo el campo una barra que se rellena seg\xFAn `percentageError` (de 0 a 100):\n - Hasta 30: rojo, \"D\xE9bil\".\n - De 31 a 89: amarillo, \"Media\".\n - Desde 90: verde, \"Segura\".\n- El c\xE1lculo de `percentageError` lo hace el consumidor; el componente solo lo representa.\n\n## Accesibilidad\n\n### Etiqueta y nombre accesible\n\n- Hereda de `InputText` la vinculaci\xF3n del `label` con el campo, los mensajes de error y ayuda (`aria-describedby`, `aria-invalid`) y el anuncio del error con `role=\"alert\"`.\n- Integra `useA11yGuard`: en modo estricto exige `label` o `aria-label`.\n\n### Bot\xF3n de mostrar / ocultar\n\n- Es un `IconButton` accesible por teclado, con `aria-label` \"Mostrar contrase\xF1a\" u \"Ocultar contrase\xF1a\" seg\xFAn el estado.\n- Expone su estado con `aria-pressed` (activado cuando la contrase\xF1a se est\xE1 mostrando).\n- Se deshabilita junto con el campo.\n\n### Barra de seguridad\n\n- Se expone como `role=\"progressbar\"` con `aria-valuenow`, `aria-valuemin=\"0\"` y `aria-valuemax=\"100\"`.\n- Su nombre accesible indica el nivel en texto: \"Seguridad de la contrase\xF1a: D\xE9bil / Media / Segura\", de modo que no depende solo del color.\n\n## Recomendaciones de uso\n\n- Explicar los requisitos de la contrase\xF1a en `helper` antes de que el usuario escriba, no solo cuando falla.\n- Usar `autoComplete=\"new-password\"` en formularios de registro o cambio, y `autoComplete=\"current-password\"` en el inicio de sesi\xF3n, para que los gestores de contrase\xF1as funcionen bien.\n\n## Consideraciones\n\n- Los textos del bot\xF3n (\"Mostrar contrase\xF1a\" / \"Ocultar contrase\xF1a\") y de la barra de seguridad est\xE1n fijos en castellano y no se pueden traducir por props.\n- Los cambios de nivel de la barra de seguridad no se anuncian autom\xE1ticamente mientras se escribe; el lector solo los lee al llegar a la barra."
|
|
105
|
+
}
|
|
106
|
+
},
|
|
22
107
|
storybookCodePanel: {
|
|
23
108
|
disabled: false,
|
|
24
109
|
files: [{
|
|
@@ -34,16 +119,40 @@ var _default = {
|
|
|
34
119
|
}
|
|
35
120
|
};
|
|
36
121
|
exports["default"] = _default;
|
|
37
|
-
var Template = function Template(
|
|
38
|
-
|
|
122
|
+
var Template = function Template(_ref) {
|
|
123
|
+
var valueArg = _ref.value,
|
|
124
|
+
_onChange = _ref.onChange,
|
|
125
|
+
args = _objectWithoutProperties(_ref, _excluded);
|
|
126
|
+
var _React$useState = _react["default"].useState(valueArg !== null && valueArg !== void 0 ? valueArg : ''),
|
|
127
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
128
|
+
value = _React$useState2[0],
|
|
129
|
+
setValue = _React$useState2[1];
|
|
130
|
+
_react["default"].useEffect(function () {
|
|
131
|
+
return setValue(valueArg !== null && valueArg !== void 0 ? valueArg : '');
|
|
132
|
+
}, [valueArg]);
|
|
133
|
+
return /*#__PURE__*/_react["default"].createElement(_InputPassword["default"], _extends({}, args, {
|
|
134
|
+
value: value,
|
|
135
|
+
onChange: function onChange(event) {
|
|
136
|
+
setValue(event.target.value);
|
|
137
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
39
140
|
};
|
|
40
141
|
Template.displayName = "Template";
|
|
41
142
|
var Default = Template.bind({});
|
|
42
143
|
exports.Default = Default;
|
|
43
144
|
Default.args = {
|
|
44
145
|
variant: 'outlined',
|
|
45
|
-
label: '
|
|
46
|
-
value: 'abc123.'
|
|
146
|
+
label: 'Contraseña',
|
|
147
|
+
value: 'abc123.',
|
|
148
|
+
required: false,
|
|
149
|
+
disabled: false,
|
|
150
|
+
fullWidth: false,
|
|
151
|
+
error: '',
|
|
152
|
+
helper: '',
|
|
153
|
+
validation: false,
|
|
154
|
+
percentageError: 0,
|
|
155
|
+
autoComplete: 'current-password'
|
|
47
156
|
};
|
|
48
157
|
var Helper = Template.bind({});
|
|
49
158
|
exports.Helper = Helper;
|
|
@@ -70,6 +179,7 @@ ErrorTemplate.args = {
|
|
|
70
179
|
var Disabled = Template.bind({});
|
|
71
180
|
exports.Disabled = Disabled;
|
|
72
181
|
Disabled.args = {
|
|
182
|
+
label: 'Contraseña',
|
|
73
183
|
value: 'Occaecat',
|
|
74
184
|
disabled: true
|
|
75
185
|
};
|
|
@@ -6,21 +6,156 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.Success = exports.StartAdornment = exports.Helper = exports.ErrorTemplate = exports.EndAdornment = exports.Disabled = exports.Default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _InputText = _interopRequireDefault(require("./InputText"));
|
|
9
|
+
var _excluded = ["value", "onChange"];
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
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); }
|
|
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
|
+
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; }
|
|
19
|
+
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; }
|
|
10
20
|
var _default = {
|
|
11
21
|
title: 'Components/InputText',
|
|
12
22
|
component: _InputText["default"],
|
|
13
23
|
argTypes: {
|
|
24
|
+
label: {
|
|
25
|
+
control: 'text'
|
|
26
|
+
},
|
|
27
|
+
value: {
|
|
28
|
+
control: 'text'
|
|
29
|
+
},
|
|
30
|
+
placeholder: {
|
|
31
|
+
control: 'text'
|
|
32
|
+
},
|
|
14
33
|
variant: {
|
|
15
34
|
options: ['outlined', 'filled', 'standard'],
|
|
16
35
|
control: {
|
|
17
36
|
type: 'radio'
|
|
18
37
|
}
|
|
19
38
|
},
|
|
39
|
+
type: {
|
|
40
|
+
control: 'select',
|
|
41
|
+
options: ['text', 'number', 'email', 'tel', 'url', 'textArea']
|
|
42
|
+
},
|
|
20
43
|
required: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
44
|
+
control: 'boolean'
|
|
45
|
+
},
|
|
46
|
+
disabled: {
|
|
47
|
+
control: 'boolean'
|
|
48
|
+
},
|
|
49
|
+
readOnly: {
|
|
50
|
+
control: 'boolean'
|
|
51
|
+
},
|
|
52
|
+
fullWidth: {
|
|
53
|
+
control: 'boolean'
|
|
54
|
+
},
|
|
55
|
+
width: {
|
|
56
|
+
control: 'text'
|
|
57
|
+
},
|
|
58
|
+
multiline: {
|
|
59
|
+
control: 'boolean'
|
|
60
|
+
},
|
|
61
|
+
rows: {
|
|
62
|
+
control: 'number'
|
|
63
|
+
},
|
|
64
|
+
error: {
|
|
65
|
+
control: 'text',
|
|
66
|
+
description: 'Mensaje de error (vacío para quitarlo).'
|
|
67
|
+
},
|
|
68
|
+
success: {
|
|
69
|
+
control: 'boolean'
|
|
70
|
+
},
|
|
71
|
+
helper: {
|
|
72
|
+
control: 'text'
|
|
73
|
+
},
|
|
74
|
+
helperText: {
|
|
75
|
+
control: 'text'
|
|
76
|
+
},
|
|
77
|
+
tooltipText: {
|
|
78
|
+
control: 'text'
|
|
79
|
+
},
|
|
80
|
+
shrink: {
|
|
81
|
+
control: 'boolean',
|
|
82
|
+
description: 'Fuerza la etiqueta flotante arriba.'
|
|
83
|
+
},
|
|
84
|
+
startAdornment: {
|
|
85
|
+
control: 'select',
|
|
86
|
+
options: ['', 'ri-search-line', 'ri-user-line', 'ri-mail-line', 'ri-lock-line']
|
|
87
|
+
},
|
|
88
|
+
endAdornment: {
|
|
89
|
+
control: 'select',
|
|
90
|
+
options: ['', 'ri-search-line', 'ri-calendar-line', 'ri-information-line']
|
|
91
|
+
},
|
|
92
|
+
autoComplete: {
|
|
93
|
+
control: 'text'
|
|
94
|
+
},
|
|
95
|
+
'aria-label': {
|
|
96
|
+
control: 'text'
|
|
97
|
+
},
|
|
98
|
+
InputProps: {
|
|
99
|
+
control: 'object'
|
|
100
|
+
},
|
|
101
|
+
onChange: {
|
|
102
|
+
action: 'onChange'
|
|
103
|
+
},
|
|
104
|
+
onFocus: {
|
|
105
|
+
action: 'onFocus'
|
|
106
|
+
},
|
|
107
|
+
onBlur: {
|
|
108
|
+
action: 'onBlur'
|
|
109
|
+
},
|
|
110
|
+
onClick: {
|
|
111
|
+
action: 'onClick'
|
|
112
|
+
},
|
|
113
|
+
onMouseEnter: {
|
|
114
|
+
action: 'onMouseEnter'
|
|
115
|
+
},
|
|
116
|
+
onMouseLeave: {
|
|
117
|
+
action: 'onMouseLeave'
|
|
118
|
+
},
|
|
119
|
+
id: {
|
|
120
|
+
control: 'text'
|
|
121
|
+
},
|
|
122
|
+
className: {
|
|
123
|
+
control: 'text'
|
|
124
|
+
},
|
|
125
|
+
style: {
|
|
126
|
+
control: 'object'
|
|
127
|
+
},
|
|
128
|
+
sx: {
|
|
129
|
+
control: 'object'
|
|
130
|
+
},
|
|
131
|
+
defaultValue: {
|
|
132
|
+
table: {
|
|
133
|
+
disable: true
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
renderValue: {
|
|
137
|
+
table: {
|
|
138
|
+
disable: true
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
handleOpen: {
|
|
142
|
+
table: {
|
|
143
|
+
disable: true
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
options: {
|
|
147
|
+
table: {
|
|
148
|
+
disable: true
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
children: {
|
|
152
|
+
table: {
|
|
153
|
+
disable: true
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
prefixClass: {
|
|
157
|
+
table: {
|
|
158
|
+
disable: true
|
|
24
159
|
}
|
|
25
160
|
}
|
|
26
161
|
},
|
|
@@ -45,18 +180,44 @@ var _default = {
|
|
|
45
180
|
}
|
|
46
181
|
};
|
|
47
182
|
exports["default"] = _default;
|
|
48
|
-
var Template = function Template(
|
|
49
|
-
|
|
183
|
+
var Template = function Template(_ref) {
|
|
184
|
+
var valueArg = _ref.value,
|
|
185
|
+
_onChange = _ref.onChange,
|
|
186
|
+
args = _objectWithoutProperties(_ref, _excluded);
|
|
187
|
+
var _React$useState = _react["default"].useState(valueArg !== null && valueArg !== void 0 ? valueArg : ''),
|
|
188
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
189
|
+
value = _React$useState2[0],
|
|
190
|
+
setValue = _React$useState2[1];
|
|
191
|
+
_react["default"].useEffect(function () {
|
|
192
|
+
return setValue(valueArg !== null && valueArg !== void 0 ? valueArg : '');
|
|
193
|
+
}, [valueArg]);
|
|
194
|
+
return /*#__PURE__*/_react["default"].createElement(_InputText["default"], _extends({}, args, {
|
|
195
|
+
value: value,
|
|
196
|
+
onChange: function onChange(event) {
|
|
197
|
+
setValue(event.target.value);
|
|
198
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
199
|
+
}
|
|
200
|
+
}));
|
|
50
201
|
};
|
|
51
202
|
Template.displayName = "Template";
|
|
52
203
|
var Default = Template.bind({});
|
|
53
204
|
exports.Default = Default;
|
|
54
205
|
Default.args = {
|
|
55
206
|
variant: 'outlined',
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
207
|
+
label: 'Nombre',
|
|
208
|
+
placeholder: 'Escribe tu nombre',
|
|
209
|
+
value: '',
|
|
210
|
+
type: 'text',
|
|
211
|
+
required: false,
|
|
212
|
+
disabled: false,
|
|
213
|
+
readOnly: false,
|
|
214
|
+
fullWidth: false,
|
|
215
|
+
multiline: false,
|
|
216
|
+
error: '',
|
|
217
|
+
success: false,
|
|
218
|
+
helper: '',
|
|
219
|
+
startAdornment: '',
|
|
220
|
+
endAdornment: ''
|
|
60
221
|
};
|
|
61
222
|
var Helper = Template.bind({});
|
|
62
223
|
exports.Helper = Helper;
|
|
@@ -3,23 +3,91 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.DesignInputTextAreaTemplate = void 0;
|
|
6
|
+
exports["default"] = exports.Playground = exports.DesignInputTextAreaTemplate = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _InputTextArea = _interopRequireDefault(require("./InputTextArea"));
|
|
9
9
|
var _DesignInputTextArea = _interopRequireDefault(require("./DesignInputTextArea.stories"));
|
|
10
|
+
var _excluded = ["value", "onChange"];
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
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); }
|
|
13
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
+
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."); }
|
|
15
|
+
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; } }
|
|
16
|
+
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; }
|
|
17
|
+
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; } }
|
|
18
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
11
21
|
var _default = {
|
|
12
22
|
title: 'Components/InputTextArea',
|
|
13
23
|
component: _InputTextArea["default"],
|
|
14
24
|
argTypes: {
|
|
25
|
+
label: {
|
|
26
|
+
control: 'text'
|
|
27
|
+
},
|
|
28
|
+
value: {
|
|
29
|
+
control: 'text'
|
|
30
|
+
},
|
|
31
|
+
placeholder: {
|
|
32
|
+
control: 'text'
|
|
33
|
+
},
|
|
15
34
|
variant: {
|
|
16
35
|
options: ['outlined', 'filled', 'standard'],
|
|
17
36
|
control: {
|
|
18
37
|
type: 'radio'
|
|
19
38
|
}
|
|
39
|
+
},
|
|
40
|
+
maxSize: {
|
|
41
|
+
control: 'number',
|
|
42
|
+
description: 'Máximo de caracteres.'
|
|
43
|
+
},
|
|
44
|
+
hideCount: {
|
|
45
|
+
control: 'boolean'
|
|
46
|
+
},
|
|
47
|
+
rows: {
|
|
48
|
+
control: 'number'
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
control: 'boolean'
|
|
52
|
+
},
|
|
53
|
+
error: {
|
|
54
|
+
control: 'text',
|
|
55
|
+
description: 'Mensaje de error (vacío para quitarlo).'
|
|
56
|
+
},
|
|
57
|
+
helper: {
|
|
58
|
+
control: 'text'
|
|
59
|
+
},
|
|
60
|
+
helperText: {
|
|
61
|
+
control: 'text'
|
|
62
|
+
},
|
|
63
|
+
autoComplete: {
|
|
64
|
+
control: 'text'
|
|
65
|
+
},
|
|
66
|
+
'aria-label': {
|
|
67
|
+
control: 'text'
|
|
68
|
+
},
|
|
69
|
+
onChange: {
|
|
70
|
+
action: 'onChange',
|
|
71
|
+
description: 'Recibe el texto, no el evento.'
|
|
72
|
+
},
|
|
73
|
+
id: {
|
|
74
|
+
control: 'text'
|
|
75
|
+
},
|
|
76
|
+
sx: {
|
|
77
|
+
control: 'object'
|
|
78
|
+
},
|
|
79
|
+
type: {
|
|
80
|
+
table: {
|
|
81
|
+
disable: true
|
|
82
|
+
}
|
|
20
83
|
}
|
|
21
84
|
},
|
|
22
85
|
parameters: {
|
|
86
|
+
docs: {
|
|
87
|
+
description: {
|
|
88
|
+
component: "\n## InputTextArea\n\n\xC1rea de texto multil\xEDnea basada en `InputText`, con l\xEDmite de caracteres y contador visible.\n\n## Funcionamiento\n\n- `value` y `onChange`: componente controlado. A diferencia de `InputText`, `onChange` recibe directamente el texto (no el evento).\n- `maxSize`: n\xFAmero m\xE1ximo de caracteres (500 por defecto). Se aplica con `maxLength` nativo, as\xED que no se puede escribir m\xE1s.\n- `hideCount`: oculta el contador `usados / m\xE1ximo`.\n- `rows`: n\xFAmero de filas visibles.\n- `label`, `placeholder`, `helper`, `helperText`, `error`, `disabled` y `variant`, como en `InputText`.\n- `autoComplete` vale `'off'` por defecto.\n\n## Accesibilidad\n\n### Etiqueta y nombre accesible\n\n- El `label` queda vinculado al `textarea`. El `id` se genera autom\xE1ticamente si no se indica.\n- Integra `useA11yGuard`: en modo estricto exige `label`, `aria-label` o `placeholder`.\n\n### Mensajes y contador\n\n- El mensaje de error o de ayuda y el contador se asocian al campo con `aria-describedby`, de modo que el lector los lee al entrar en el campo.\n- Con `error`, el campo lleva `aria-invalid=\"true\"` y el mensaje se anuncia con `role=\"alert\"`.\n- El contador incluye un texto oculto para lectores (\"Caracteres usados: 120/500\").\n- Cuando quedan 10 caracteres o menos, el contador pasa a ser una regi\xF3n `aria-live=\"polite\"` y anuncia cu\xE1ntos quedan (\"quedan 8 caracteres\").\n\n## Recomendaciones de uso\n\n- Usar siempre `label` visible en lugar de depender solo del `placeholder`.\n- Ajustar `maxSize` al l\xEDmite real que acepta el servidor, para que el usuario no pierda texto al guardar.\n- No ocultar el contador (`hideCount`) si el l\xEDmite es bajo y el usuario puede alcanzarlo con facilidad.\n\n## Consideraciones\n\n- Los textos ocultos del contador (\"Caracteres usados\", \"quedan N caracteres\") est\xE1n fijos en castellano.\n- Como el l\xEDmite se aplica con `maxLength`, al pegar un texto m\xE1s largo el navegador lo corta sin avisar."
|
|
89
|
+
}
|
|
90
|
+
},
|
|
23
91
|
storybookCodePanel: {
|
|
24
92
|
disabled: false,
|
|
25
93
|
files: [{
|
|
@@ -31,10 +99,48 @@ var _default = {
|
|
|
31
99
|
}
|
|
32
100
|
};
|
|
33
101
|
exports["default"] = _default;
|
|
102
|
+
var PlaygroundTemplate = function PlaygroundTemplate(_ref) {
|
|
103
|
+
var valueArg = _ref.value,
|
|
104
|
+
_onChange = _ref.onChange,
|
|
105
|
+
args = _objectWithoutProperties(_ref, _excluded);
|
|
106
|
+
var _React$useState = _react["default"].useState(valueArg !== null && valueArg !== void 0 ? valueArg : ''),
|
|
107
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
108
|
+
value = _React$useState2[0],
|
|
109
|
+
setValue = _React$useState2[1];
|
|
110
|
+
_react["default"].useEffect(function () {
|
|
111
|
+
return setValue(valueArg !== null && valueArg !== void 0 ? valueArg : '');
|
|
112
|
+
}, [valueArg]);
|
|
113
|
+
return /*#__PURE__*/_react["default"].createElement(_InputTextArea["default"], _extends({}, args, {
|
|
114
|
+
value: value,
|
|
115
|
+
onChange: function onChange(text) {
|
|
116
|
+
setValue(text);
|
|
117
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(text);
|
|
118
|
+
}
|
|
119
|
+
}));
|
|
120
|
+
};
|
|
121
|
+
PlaygroundTemplate.displayName = "PlaygroundTemplate";
|
|
122
|
+
var Playground = PlaygroundTemplate.bind({});
|
|
123
|
+
exports.Playground = Playground;
|
|
124
|
+
Playground.args = {
|
|
125
|
+
label: 'Motivo',
|
|
126
|
+
value: '',
|
|
127
|
+
placeholder: 'Describe el motivo',
|
|
128
|
+
variant: 'outlined',
|
|
129
|
+
maxSize: 200,
|
|
130
|
+
hideCount: false,
|
|
131
|
+
rows: 4,
|
|
132
|
+
disabled: false,
|
|
133
|
+
error: '',
|
|
134
|
+
helper: ''
|
|
135
|
+
};
|
|
34
136
|
var TemplateIconButton = function TemplateIconButton(args) {
|
|
35
137
|
return /*#__PURE__*/_react["default"].createElement(_DesignInputTextArea["default"], args);
|
|
36
138
|
};
|
|
37
139
|
TemplateIconButton.displayName = "TemplateIconButton";
|
|
38
140
|
var DesignInputTextAreaTemplate = TemplateIconButton.bind({});
|
|
39
141
|
exports.DesignInputTextAreaTemplate = DesignInputTextAreaTemplate;
|
|
40
|
-
DesignInputTextAreaTemplate.parameters = {
|
|
142
|
+
DesignInputTextAreaTemplate.parameters = {
|
|
143
|
+
controls: {
|
|
144
|
+
disable: true
|
|
145
|
+
}
|
|
146
|
+
};
|
|
@@ -11,13 +11,50 @@ var _default = {
|
|
|
11
11
|
title: 'Components/LoadingSection',
|
|
12
12
|
component: _LoadingSection["default"],
|
|
13
13
|
argTypes: {
|
|
14
|
-
|
|
14
|
+
label: {
|
|
15
|
+
control: 'text',
|
|
16
|
+
description: 'Qué se está cargando (nombre accesible).'
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
15
19
|
control: {
|
|
16
|
-
type: '
|
|
20
|
+
type: 'range',
|
|
21
|
+
min: 12,
|
|
22
|
+
max: 120,
|
|
23
|
+
step: 2
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
thickness: {
|
|
27
|
+
control: {
|
|
28
|
+
type: 'range',
|
|
29
|
+
min: 1,
|
|
30
|
+
max: 12,
|
|
31
|
+
step: 1
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
color: {
|
|
35
|
+
control: 'color'
|
|
36
|
+
},
|
|
37
|
+
id: {
|
|
38
|
+
control: 'text'
|
|
39
|
+
},
|
|
40
|
+
style: {
|
|
41
|
+
control: 'object'
|
|
42
|
+
},
|
|
43
|
+
sx: {
|
|
44
|
+
control: 'object'
|
|
45
|
+
},
|
|
46
|
+
prefixClass: {
|
|
47
|
+
table: {
|
|
48
|
+
disable: true
|
|
17
49
|
}
|
|
18
50
|
}
|
|
19
51
|
},
|
|
20
52
|
parameters: {
|
|
53
|
+
docs: {
|
|
54
|
+
description: {
|
|
55
|
+
component: "\n## LoadingSection\n\nIndicador de carga circular animado, para mostrar que una secci\xF3n o una acci\xF3n est\xE1 en curso.\n\n## Funcionamiento\n\n- `size`: di\xE1metro en p\xEDxeles (60 por defecto).\n- `color`: color del trazo (`var(--primary)` por defecto).\n- `thickness`: grosor del trazo (7 por defecto).\n- `label`: texto que describe qu\xE9 se est\xE1 cargando.\n- `style`, `sx` e `id` para el contenedor.\n\n## Accesibilidad\n\n### Rol y nombre accesible\n\n- El indicador se expone como `role=\"progressbar\"` con `aria-busy=\"true\"`.\n- Su nombre accesible es `label` (`aria-label`). Si no se indica, se usa \"Cargando\".\n- Integra `useA11yGuard`: en modo estricto exige `label`.\n\n### Iconograf\xEDa\n\n- El SVG animado es decorativo (`aria-hidden=\"true\"`): solo se anuncia el texto de `label`.\n\n## Recomendaciones de uso\n\n- Pasar siempre `label` traducido y concreto (por ejemplo, \"Cargando participantes\"), en lugar del gen\xE9rico \"Cargando\".\n- Si la carga sustituye a un contenido, mostrar el indicador en el mismo lugar donde aparecer\xE1 ese contenido.\n- Para cargas largas, acompa\xF1arlo de un texto visible que explique qu\xE9 est\xE1 pasando.\n\n## Consideraciones\n\n- El indicador es indeterminado: no expone `aria-valuenow`, por lo que no informa del porcentaje de avance.\n- Que aparezca o desaparezca no se anuncia por s\xED solo. Si es importante avisar del fin de la carga, hacerlo con un mensaje (por ejemplo, un toast o una regi\xF3n `aria-live`)."
|
|
56
|
+
}
|
|
57
|
+
},
|
|
21
58
|
storybookCodePanel: {
|
|
22
59
|
disabled: false,
|
|
23
60
|
files: [{
|
|
@@ -39,4 +76,9 @@ var Template = function Template(args) {
|
|
|
39
76
|
Template.displayName = "Template";
|
|
40
77
|
var Default = Template.bind({});
|
|
41
78
|
exports.Default = Default;
|
|
42
|
-
Default.args = {
|
|
79
|
+
Default.args = {
|
|
80
|
+
label: 'Cargando participantes',
|
|
81
|
+
size: 60,
|
|
82
|
+
thickness: 7,
|
|
83
|
+
color: 'var(--primary)'
|
|
84
|
+
};
|