@widergy/energy-ui 3.163.0 → 3.165.0
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/CHANGELOG.md +23 -4
- package/dist/components/UTAlert/README.md +100 -0
- package/dist/components/UTAlert/stories/UTAlert.stories.js +239 -0
- package/dist/components/UTAlert/stories/storiesConstants.js +107 -0
- package/dist/components/UTBanner/index.js +11 -5
- package/dist/components/UTBanner/stories/UTBanner.stories.js +8 -0
- package/dist/components/UTBaseInputField/UTBaseInputField.stories.js +393 -0
- package/dist/components/UTDatePicker/versions/V0/index.js +3 -0
- package/dist/components/UTDatePicker/versions/V1/index.js +5 -8
- package/dist/components/UTSnackbar/README.md +105 -0
- package/dist/components/UTSnackbar/constants.js +128 -0
- package/dist/components/UTSnackbar/index.js +136 -0
- package/dist/components/UTSnackbar/stories/UTSnackbar.stories.js +316 -0
- package/dist/components/UTSnackbar/stories/storiesConstants.js +168 -0
- package/dist/components/UTSnackbar/styles.module.scss +82 -0
- package/dist/components/UTSnackbar/theme.js +57 -0
- package/dist/components/UTSnackbar/types.js +20 -0
- package/dist/components/UTTextArea/UTTextArea.stories.js +342 -0
- package/dist/components/UTTextInput/UTTextInput.stories.js +439 -0
- package/dist/components/UTTextInput/versions/V0/index.js +1 -0
- package/dist/constants/testIds.js +10 -4
- package/dist/esm/components/UTAlert/README.md +100 -0
- package/dist/esm/components/UTAlert/stories/UTAlert.stories.js +231 -0
- package/dist/esm/components/UTAlert/stories/storiesConstants.js +101 -0
- package/dist/esm/components/UTBanner/index.js +11 -5
- package/dist/esm/components/UTBanner/stories/UTBanner.stories.js +8 -0
- package/dist/esm/components/UTBaseInputField/UTBaseInputField.stories.js +385 -0
- package/dist/esm/components/UTDatePicker/versions/V0/index.js +3 -0
- package/dist/esm/components/UTDatePicker/versions/V1/index.js +5 -8
- package/dist/esm/components/UTSnackbar/README.md +105 -0
- package/dist/esm/components/UTSnackbar/constants.js +122 -0
- package/dist/esm/components/UTSnackbar/index.js +129 -0
- package/dist/esm/components/UTSnackbar/stories/UTSnackbar.stories.js +308 -0
- package/dist/esm/components/UTSnackbar/stories/storiesConstants.js +162 -0
- package/dist/esm/components/UTSnackbar/styles.module.scss +82 -0
- package/dist/esm/components/UTSnackbar/theme.js +50 -0
- package/dist/esm/components/UTSnackbar/types.js +14 -0
- package/dist/esm/components/UTTextArea/UTTextArea.stories.js +334 -0
- package/dist/esm/components/UTTextInput/UTTextInput.stories.js +431 -0
- package/dist/esm/components/UTTextInput/versions/V0/index.js +1 -0
- package/dist/esm/constants/testIds.js +10 -4
- package/dist/esm/index.js +2 -1
- package/dist/esm/utils/hooks/useCSSVariables/constants.js +9 -0
- package/dist/index.js +7 -0
- package/dist/utils/hooks/useCSSVariables/constants.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ARG_TYPES = void 0;
|
|
7
|
+
var _utils = require("stories/utils");
|
|
8
|
+
var _constants = require("../constants");
|
|
9
|
+
const ARG_TYPES = exports.ARG_TYPES = {
|
|
10
|
+
button: {
|
|
11
|
+
control: 'object',
|
|
12
|
+
description: 'Configuración del botón de acción primaria. Se hace spread en UTButton — incluir `title` como label y `onClick` como callback.',
|
|
13
|
+
table: {
|
|
14
|
+
defaultValue: {
|
|
15
|
+
summary: 'undefined'
|
|
16
|
+
},
|
|
17
|
+
type: {
|
|
18
|
+
summary: 'shape'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
colorTheme: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
description: 'Tipo de color de la notificación. `success`, `error`, `warning` e `info` usan colores semánticos con ícono asociado. `white` usa colores neutros sin semántica.',
|
|
25
|
+
options: Object.values(_constants.COLOR_THEMES),
|
|
26
|
+
table: {
|
|
27
|
+
defaultValue: {
|
|
28
|
+
summary: _constants.COLOR_THEMES.success
|
|
29
|
+
},
|
|
30
|
+
type: {
|
|
31
|
+
summary: (0, _utils.joinArgTypes)(Object.values(_constants.COLOR_THEMES))
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
control: 'text',
|
|
37
|
+
description: 'Nombre del ícono Tabler para sobreescribir el ícono por defecto (ej: `IconStar`). Si no se indica, se usa el ícono correspondiente al `colorTheme`.',
|
|
38
|
+
table: {
|
|
39
|
+
defaultValue: {
|
|
40
|
+
summary: 'undefined'
|
|
41
|
+
},
|
|
42
|
+
type: {
|
|
43
|
+
summary: 'string'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
description: {
|
|
48
|
+
control: 'text',
|
|
49
|
+
description: 'Texto secundario debajo del mensaje principal.',
|
|
50
|
+
table: {
|
|
51
|
+
defaultValue: {
|
|
52
|
+
summary: 'undefined'
|
|
53
|
+
},
|
|
54
|
+
type: {
|
|
55
|
+
summary: 'string'
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
dataTestId: {
|
|
60
|
+
control: false,
|
|
61
|
+
description: 'Identificador de test raíz. Los sub-elementos derivan su testId automáticamente: `.icon`, `.label`, `.description.label`, `.close`, `.button.secondaryAction`, `.secondaryButton.tertiaryAction`.',
|
|
62
|
+
table: {
|
|
63
|
+
defaultValue: {
|
|
64
|
+
summary: 'undefined'
|
|
65
|
+
},
|
|
66
|
+
type: {
|
|
67
|
+
summary: 'string'
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
message: {
|
|
72
|
+
control: 'text',
|
|
73
|
+
description: 'Mensaje principal a mostrar. Soporta markdown.',
|
|
74
|
+
table: {
|
|
75
|
+
defaultValue: {
|
|
76
|
+
summary: 'undefined'
|
|
77
|
+
},
|
|
78
|
+
type: {
|
|
79
|
+
summary: 'string'
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
onClose: {
|
|
84
|
+
control: false,
|
|
85
|
+
description: 'Callback ejecutado al cerrar el snackbar.',
|
|
86
|
+
table: {
|
|
87
|
+
defaultValue: {
|
|
88
|
+
summary: 'undefined'
|
|
89
|
+
},
|
|
90
|
+
type: {
|
|
91
|
+
summary: 'function'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
open: {
|
|
96
|
+
control: 'boolean',
|
|
97
|
+
description: 'Controla si el snackbar está visible.',
|
|
98
|
+
table: {
|
|
99
|
+
defaultValue: {
|
|
100
|
+
summary: 'false'
|
|
101
|
+
},
|
|
102
|
+
type: {
|
|
103
|
+
summary: 'boolean'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
secondaryButton: {
|
|
108
|
+
control: 'object',
|
|
109
|
+
description: 'Configuración del botón de acción secundaria. Se hace spread en UTButton — incluir `title` como label y `onClick` como callback.',
|
|
110
|
+
table: {
|
|
111
|
+
defaultValue: {
|
|
112
|
+
summary: 'undefined'
|
|
113
|
+
},
|
|
114
|
+
type: {
|
|
115
|
+
summary: 'shape'
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
timeDuration: {
|
|
120
|
+
control: 'number',
|
|
121
|
+
description: 'Duración en milisegundos antes del cierre automático.',
|
|
122
|
+
table: {
|
|
123
|
+
defaultValue: {
|
|
124
|
+
summary: 'undefined'
|
|
125
|
+
},
|
|
126
|
+
type: {
|
|
127
|
+
summary: 'number'
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
topRight: {
|
|
132
|
+
control: 'boolean',
|
|
133
|
+
description: 'Si es `true`, el snackbar aparece en la esquina superior derecha. Si es `false`, en la inferior izquierda.',
|
|
134
|
+
table: {
|
|
135
|
+
defaultValue: {
|
|
136
|
+
summary: 'false'
|
|
137
|
+
},
|
|
138
|
+
type: {
|
|
139
|
+
summary: 'boolean'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
variant: {
|
|
144
|
+
control: 'inline-radio',
|
|
145
|
+
description: '`dark` usa el color del `colorTheme` como fondo con texto blanco; `light` usa una versión clara con texto oscuro accesible.',
|
|
146
|
+
options: Object.values(_constants.VARIANTS),
|
|
147
|
+
table: {
|
|
148
|
+
defaultValue: {
|
|
149
|
+
summary: _constants.VARIANTS.dark
|
|
150
|
+
},
|
|
151
|
+
type: {
|
|
152
|
+
summary: (0, _utils.joinArgTypes)(Object.values(_constants.VARIANTS))
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
withoutIcon: {
|
|
157
|
+
control: 'boolean',
|
|
158
|
+
description: 'Si es `true`, oculta el ícono.',
|
|
159
|
+
table: {
|
|
160
|
+
defaultValue: {
|
|
161
|
+
summary: 'undefined'
|
|
162
|
+
},
|
|
163
|
+
type: {
|
|
164
|
+
summary: 'boolean'
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
.snackbarContent {
|
|
2
|
+
flex-wrap: nowrap;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.message {
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
min-width: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.messageContent {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: flex-start;
|
|
14
|
+
gap: var(--UT-snackbar-gap-icon, 8px);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.icon {
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
margin-top: var(--UT-snackbar-icon-offset, 2px);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.textContent {
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: var(--UT-snackbar-gap-description, 4px);
|
|
26
|
+
min-width: 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.action {
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
gap: var(--UT-snackbar-gap-actions, 4px);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.successDark {
|
|
35
|
+
background-color: var(--semanticSuccess04);
|
|
36
|
+
color: var(--light01);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.errorDark {
|
|
40
|
+
background-color: var(--actionError04);
|
|
41
|
+
color: var(--light01);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.warningDark {
|
|
45
|
+
background-color: var(--semanticWarning04);
|
|
46
|
+
color: var(--light01);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.infoDark {
|
|
50
|
+
background-color: var(--semanticInformation04);
|
|
51
|
+
color: var(--light01);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.successLight {
|
|
55
|
+
background-color: var(--semanticSuccess01);
|
|
56
|
+
color: var(--semanticSuccess05);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.errorLight {
|
|
60
|
+
background-color: var(--actionError01);
|
|
61
|
+
color: var(--actionError05);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.warningLight {
|
|
65
|
+
background-color: var(--semanticWarning01);
|
|
66
|
+
color: var(--semanticWarning05);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.infoLight {
|
|
70
|
+
background-color: var(--semanticInformation01);
|
|
71
|
+
color: var(--semanticInformation05);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.whiteLight {
|
|
75
|
+
background-color: var(--light01);
|
|
76
|
+
color: var(--dark05);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.whiteDark {
|
|
80
|
+
background-color: var(--dark04);
|
|
81
|
+
color: var(--light01);
|
|
82
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retrieveMuiTheme = void 0;
|
|
7
|
+
var _styles = require("@material-ui/core/styles");
|
|
8
|
+
const retrieveMuiTheme = theme => {
|
|
9
|
+
var _theme$Fonts;
|
|
10
|
+
return (0, _styles.createTheme)({
|
|
11
|
+
typography: {
|
|
12
|
+
fontFamily: theme === null || theme === void 0 || (_theme$Fonts = theme.Fonts) === null || _theme$Fonts === void 0 ? void 0 : _theme$Fonts.fontFamily
|
|
13
|
+
},
|
|
14
|
+
overrides: {
|
|
15
|
+
MuiSnackbarContent: {
|
|
16
|
+
root: {
|
|
17
|
+
minWidth: 288,
|
|
18
|
+
maxWidth: 568,
|
|
19
|
+
padding: 'var(--UT-snackbar-padding-y, 8px) var(--UT-snackbar-padding-x, 12px)',
|
|
20
|
+
borderRadius: 'var(--UT-snackbar-radius, 4px)',
|
|
21
|
+
'@media (max-width : 767px)': {
|
|
22
|
+
borderRadius: 0,
|
|
23
|
+
maxWidth: 'initial',
|
|
24
|
+
width: '100%'
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
message: {
|
|
28
|
+
flex: 1,
|
|
29
|
+
padding: 0
|
|
30
|
+
},
|
|
31
|
+
action: {
|
|
32
|
+
marginLeft: 'var(--UT-snackbar-gap-action-area, 12px)',
|
|
33
|
+
marginRight: 0,
|
|
34
|
+
paddingLeft: 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
MuiSnackbar: {
|
|
38
|
+
root: {
|
|
39
|
+
'@media (max-width : 767px)': {
|
|
40
|
+
left: 0,
|
|
41
|
+
maxWidth: 'initial',
|
|
42
|
+
right: 0,
|
|
43
|
+
width: '100%'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
anchorOriginBottomLeft: {
|
|
47
|
+
bottom: 0,
|
|
48
|
+
'@media (max-width : 767px)': {
|
|
49
|
+
bottom: 0,
|
|
50
|
+
left: 0
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buttonType = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
const buttonType = exports.buttonType = (0, _propTypes.shape)({
|
|
9
|
+
colorTheme: _propTypes.string,
|
|
10
|
+
dataTestId: _propTypes.string,
|
|
11
|
+
disabled: _propTypes.bool,
|
|
12
|
+
Icon: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.func]),
|
|
13
|
+
iconPlacement: _propTypes.string,
|
|
14
|
+
loading: _propTypes.bool,
|
|
15
|
+
onClick: _propTypes.func,
|
|
16
|
+
size: _propTypes.string,
|
|
17
|
+
title: _propTypes.node,
|
|
18
|
+
type: _propTypes.string,
|
|
19
|
+
variant: _propTypes.string
|
|
20
|
+
});
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.V0Legado = exports.V0ConTooltip = exports.SoloLectura = exports.Requerido = exports.Playground = exports.Pequeno = exports.MasFilas = exports.Deshabilitado = exports.Default = exports.ConTitulo = exports.ConTextoDeAyuda = exports.ConLimiteDeCaracteres = exports.ConError = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _ = _interopRequireDefault(require("."));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
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
|
+
var _default = exports.default = {
|
|
13
|
+
title: 'Energy-UI/UTTextArea',
|
|
14
|
+
component: _.default,
|
|
15
|
+
args: {
|
|
16
|
+
version: 'V1',
|
|
17
|
+
placeholder: 'Escribí tu texto aquí...'
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
version: {
|
|
21
|
+
control: 'select',
|
|
22
|
+
description: 'Versión del componente. V1 extiende UTTextInput con soporte para design tokens.',
|
|
23
|
+
options: ['V0', 'V1'],
|
|
24
|
+
table: {
|
|
25
|
+
defaultValue: {
|
|
26
|
+
summary: 'V0'
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
summary: "'V0' | 'V1'"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
title: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Texto del label que aparece sobre el campo. (solo V1)',
|
|
36
|
+
table: {
|
|
37
|
+
defaultValue: {
|
|
38
|
+
summary: 'undefined'
|
|
39
|
+
},
|
|
40
|
+
type: {
|
|
41
|
+
summary: 'string'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
placeholder: {
|
|
46
|
+
control: 'text',
|
|
47
|
+
description: 'Texto de placeholder que se muestra cuando el campo está vacío.',
|
|
48
|
+
table: {
|
|
49
|
+
defaultValue: {
|
|
50
|
+
summary: 'undefined'
|
|
51
|
+
},
|
|
52
|
+
type: {
|
|
53
|
+
summary: 'string'
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
value: {
|
|
58
|
+
control: 'text',
|
|
59
|
+
description: 'Valor actual del campo de texto.',
|
|
60
|
+
table: {
|
|
61
|
+
defaultValue: {
|
|
62
|
+
summary: 'undefined'
|
|
63
|
+
},
|
|
64
|
+
type: {
|
|
65
|
+
summary: 'string'
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
onChange: {
|
|
70
|
+
action: 'onChange',
|
|
71
|
+
description: 'Callback que se ejecuta al cambiar el valor del campo.',
|
|
72
|
+
table: {
|
|
73
|
+
defaultValue: {
|
|
74
|
+
summary: 'undefined'
|
|
75
|
+
},
|
|
76
|
+
type: {
|
|
77
|
+
summary: 'func'
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
disabled: {
|
|
82
|
+
control: 'boolean',
|
|
83
|
+
description: 'Si es `true`, el campo está deshabilitado y no acepta interacciones.',
|
|
84
|
+
table: {
|
|
85
|
+
defaultValue: {
|
|
86
|
+
summary: 'false'
|
|
87
|
+
},
|
|
88
|
+
type: {
|
|
89
|
+
summary: 'bool'
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
readOnly: {
|
|
94
|
+
control: 'boolean',
|
|
95
|
+
description: 'Si es `true`, el campo muestra el valor pero no permite editarlo.',
|
|
96
|
+
table: {
|
|
97
|
+
defaultValue: {
|
|
98
|
+
summary: 'false'
|
|
99
|
+
},
|
|
100
|
+
type: {
|
|
101
|
+
summary: 'bool'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
required: {
|
|
106
|
+
control: 'boolean',
|
|
107
|
+
description: 'Si es `true`, muestra un indicador `*` junto al label. (solo V1)',
|
|
108
|
+
table: {
|
|
109
|
+
defaultValue: {
|
|
110
|
+
summary: 'false'
|
|
111
|
+
},
|
|
112
|
+
type: {
|
|
113
|
+
summary: 'bool'
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
error: {
|
|
118
|
+
control: 'text',
|
|
119
|
+
description: 'Mensaje de error. Si se pasa un string, se muestra como validación debajo del campo. (solo V1)',
|
|
120
|
+
table: {
|
|
121
|
+
defaultValue: {
|
|
122
|
+
summary: 'undefined'
|
|
123
|
+
},
|
|
124
|
+
type: {
|
|
125
|
+
summary: 'string | bool'
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
helpText: {
|
|
130
|
+
control: 'text',
|
|
131
|
+
description: 'Texto de ayuda que se muestra debajo del campo en color gris. (solo V1)',
|
|
132
|
+
table: {
|
|
133
|
+
defaultValue: {
|
|
134
|
+
summary: 'undefined'
|
|
135
|
+
},
|
|
136
|
+
type: {
|
|
137
|
+
summary: 'string'
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
maxLength: {
|
|
142
|
+
control: 'number',
|
|
143
|
+
description: 'Límite máximo de caracteres. En V1 habilita el contador de caracteres automáticamente.',
|
|
144
|
+
table: {
|
|
145
|
+
defaultValue: {
|
|
146
|
+
summary: 'undefined'
|
|
147
|
+
},
|
|
148
|
+
type: {
|
|
149
|
+
summary: 'number'
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
maxRows: {
|
|
154
|
+
control: 'number',
|
|
155
|
+
description: 'Cantidad máxima de filas visibles antes de activar el scroll.',
|
|
156
|
+
table: {
|
|
157
|
+
defaultValue: {
|
|
158
|
+
summary: '4'
|
|
159
|
+
},
|
|
160
|
+
type: {
|
|
161
|
+
summary: 'number'
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
inputSize: {
|
|
166
|
+
control: 'select',
|
|
167
|
+
description: 'Tamaño del campo de texto. Afecta el padding interno. (solo V1)',
|
|
168
|
+
options: ['medium', 'small'],
|
|
169
|
+
table: {
|
|
170
|
+
defaultValue: {
|
|
171
|
+
summary: 'medium'
|
|
172
|
+
},
|
|
173
|
+
type: {
|
|
174
|
+
summary: "'medium' | 'small'"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
titleVariant: {
|
|
179
|
+
control: 'select',
|
|
180
|
+
description: 'Tamaño del label del campo. (solo V1)',
|
|
181
|
+
options: ['large', 'small'],
|
|
182
|
+
table: {
|
|
183
|
+
defaultValue: {
|
|
184
|
+
summary: 'large'
|
|
185
|
+
},
|
|
186
|
+
type: {
|
|
187
|
+
summary: "'large' | 'small'"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
tooltip: {
|
|
192
|
+
control: 'text',
|
|
193
|
+
description: 'Texto del tooltip que aparece al hacer hover sobre el ícono de ayuda. (V0)',
|
|
194
|
+
table: {
|
|
195
|
+
defaultValue: {
|
|
196
|
+
summary: 'undefined'
|
|
197
|
+
},
|
|
198
|
+
type: {
|
|
199
|
+
summary: 'string'
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
parameters: {
|
|
205
|
+
docs: {
|
|
206
|
+
description: {
|
|
207
|
+
component: 'UTTextArea es un campo de texto multilínea. La versión V1 extiende UTTextInput con `showCharacterCount=true` y `maxRows=4` por defecto. La versión V0 es la implementación legada con estilos propios.'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const StatefulTextArea = args => {
|
|
213
|
+
var _args$value;
|
|
214
|
+
const [value, setValue] = (0, _react.useState)((_args$value = args.value) !== null && _args$value !== void 0 ? _args$value : '');
|
|
215
|
+
return /*#__PURE__*/_react.default.createElement(_.default, _extends({}, args, {
|
|
216
|
+
value: value,
|
|
217
|
+
onChange: setValue
|
|
218
|
+
}));
|
|
219
|
+
};
|
|
220
|
+
const Playground = exports.Playground = {
|
|
221
|
+
render: args => /*#__PURE__*/_react.default.createElement(StatefulTextArea, args),
|
|
222
|
+
args: {
|
|
223
|
+
title: 'Descripción',
|
|
224
|
+
placeholder: 'Escribí tu texto aquí...',
|
|
225
|
+
maxLength: 200,
|
|
226
|
+
maxRows: 4,
|
|
227
|
+
version: 'V1'
|
|
228
|
+
},
|
|
229
|
+
name: 'Playground'
|
|
230
|
+
};
|
|
231
|
+
const Default = exports.Default = {
|
|
232
|
+
args: {
|
|
233
|
+
placeholder: 'Escribí tu texto aquí...',
|
|
234
|
+
version: 'V1'
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
const ConTitulo = exports.ConTitulo = {
|
|
238
|
+
args: {
|
|
239
|
+
title: 'Motivo de contacto',
|
|
240
|
+
placeholder: 'Describí tu consulta...',
|
|
241
|
+
version: 'V1'
|
|
242
|
+
},
|
|
243
|
+
name: 'Con título'
|
|
244
|
+
};
|
|
245
|
+
const Requerido = exports.Requerido = {
|
|
246
|
+
args: {
|
|
247
|
+
title: 'Motivo de contacto',
|
|
248
|
+
placeholder: 'Este campo es obligatorio',
|
|
249
|
+
required: true,
|
|
250
|
+
version: 'V1'
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
const ConError = exports.ConError = {
|
|
254
|
+
args: {
|
|
255
|
+
title: 'Descripción',
|
|
256
|
+
placeholder: 'Escribí tu texto aquí...',
|
|
257
|
+
value: 'Texto con error',
|
|
258
|
+
error: 'El texto ingresado no cumple con el formato requerido.',
|
|
259
|
+
version: 'V1'
|
|
260
|
+
},
|
|
261
|
+
name: 'Con error'
|
|
262
|
+
};
|
|
263
|
+
const Deshabilitado = exports.Deshabilitado = {
|
|
264
|
+
args: {
|
|
265
|
+
title: 'Descripción',
|
|
266
|
+
placeholder: 'Campo deshabilitado',
|
|
267
|
+
disabled: true,
|
|
268
|
+
version: 'V1'
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
const SoloLectura = exports.SoloLectura = {
|
|
272
|
+
args: {
|
|
273
|
+
title: 'Observaciones',
|
|
274
|
+
value: 'Este es un texto de solo lectura que no puede ser editado por el usuario, solo visualizado.',
|
|
275
|
+
readOnly: true,
|
|
276
|
+
version: 'V1'
|
|
277
|
+
},
|
|
278
|
+
name: 'Solo lectura'
|
|
279
|
+
};
|
|
280
|
+
const ConTextoDeAyuda = exports.ConTextoDeAyuda = {
|
|
281
|
+
args: {
|
|
282
|
+
title: 'Descripción',
|
|
283
|
+
placeholder: 'Escribí una breve descripción...',
|
|
284
|
+
helpText: 'Máximo 500 caracteres. No incluyas datos personales.',
|
|
285
|
+
version: 'V1'
|
|
286
|
+
},
|
|
287
|
+
name: 'Con texto de ayuda'
|
|
288
|
+
};
|
|
289
|
+
const ConLimiteDeCaracteres = exports.ConLimiteDeCaracteres = {
|
|
290
|
+
render: args => /*#__PURE__*/_react.default.createElement(StatefulTextArea, args),
|
|
291
|
+
args: {
|
|
292
|
+
title: 'Descripción',
|
|
293
|
+
placeholder: 'Escribí tu texto aquí...',
|
|
294
|
+
maxLength: 100,
|
|
295
|
+
maxRows: 4,
|
|
296
|
+
version: 'V1'
|
|
297
|
+
},
|
|
298
|
+
name: 'Con límite de caracteres'
|
|
299
|
+
};
|
|
300
|
+
const Pequeno = exports.Pequeno = {
|
|
301
|
+
args: {
|
|
302
|
+
title: 'Comentario',
|
|
303
|
+
placeholder: 'Comentario corto...',
|
|
304
|
+
inputSize: 'small',
|
|
305
|
+
titleVariant: 'small',
|
|
306
|
+
maxLength: 80,
|
|
307
|
+
version: 'V1'
|
|
308
|
+
},
|
|
309
|
+
name: 'Pequeño'
|
|
310
|
+
};
|
|
311
|
+
const MasFilas = exports.MasFilas = {
|
|
312
|
+
render: args => /*#__PURE__*/_react.default.createElement(StatefulTextArea, args),
|
|
313
|
+
args: {
|
|
314
|
+
title: 'Descripción extendida',
|
|
315
|
+
placeholder: 'El área crece hasta 8 filas...',
|
|
316
|
+
maxRows: 8,
|
|
317
|
+
maxLength: 500,
|
|
318
|
+
version: 'V1'
|
|
319
|
+
},
|
|
320
|
+
name: 'Más filas (maxRows=8)'
|
|
321
|
+
};
|
|
322
|
+
const V0Legado = exports.V0Legado = {
|
|
323
|
+
args: {
|
|
324
|
+
title: 'Descripción',
|
|
325
|
+
placeholder: 'Versión legada V0...',
|
|
326
|
+
version: 'V0',
|
|
327
|
+
value: '',
|
|
328
|
+
onChange: () => {}
|
|
329
|
+
},
|
|
330
|
+
name: 'V0 (legado)'
|
|
331
|
+
};
|
|
332
|
+
const V0ConTooltip = exports.V0ConTooltip = {
|
|
333
|
+
args: {
|
|
334
|
+
title: 'Observaciones',
|
|
335
|
+
placeholder: 'Escribí tus observaciones...',
|
|
336
|
+
tooltip: 'Este campo se usa para registrar observaciones adicionales sobre el caso.',
|
|
337
|
+
version: 'V0',
|
|
338
|
+
value: '',
|
|
339
|
+
onChange: () => {}
|
|
340
|
+
},
|
|
341
|
+
name: 'V0 con tooltip'
|
|
342
|
+
};
|