@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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.DesignIconButtonTemplate = void 0;
|
|
6
|
+
exports["default"] = exports.Playground = exports.DesignIconButtonTemplate = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _IconButton = _interopRequireDefault(require("./IconButton"));
|
|
9
9
|
var _DesignIconButton = _interopRequireDefault(require("./DesignIconButton.stories"));
|
|
@@ -11,6 +11,150 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
11
11
|
var _default = {
|
|
12
12
|
title: 'Components/IconButton',
|
|
13
13
|
component: _IconButton["default"],
|
|
14
|
+
argTypes: {
|
|
15
|
+
icon: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['editar', 'eliminar', 'campana', 'usuario', 'mas'],
|
|
18
|
+
mapping: {
|
|
19
|
+
editar: /*#__PURE__*/_react["default"].createElement("i", {
|
|
20
|
+
className: "ri-pencil-line",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}),
|
|
23
|
+
eliminar: /*#__PURE__*/_react["default"].createElement("i", {
|
|
24
|
+
className: "ri-delete-bin-line",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}),
|
|
27
|
+
campana: /*#__PURE__*/_react["default"].createElement("i", {
|
|
28
|
+
className: "ri-notification-3-line",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}),
|
|
31
|
+
usuario: /*#__PURE__*/_react["default"].createElement("i", {
|
|
32
|
+
className: "ri-user-3-line",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}),
|
|
35
|
+
mas: /*#__PURE__*/_react["default"].createElement("i", {
|
|
36
|
+
className: "ri-more-2-fill",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
tooltip: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'También se usa como nombre accesible.'
|
|
44
|
+
},
|
|
45
|
+
'aria-label': {
|
|
46
|
+
control: 'text'
|
|
47
|
+
},
|
|
48
|
+
placementTooltip: {
|
|
49
|
+
control: 'select',
|
|
50
|
+
options: ['top', 'right', 'bottom', 'left']
|
|
51
|
+
},
|
|
52
|
+
type: {
|
|
53
|
+
control: 'select',
|
|
54
|
+
options: ['', 'fab', 'square']
|
|
55
|
+
},
|
|
56
|
+
rounded: {
|
|
57
|
+
control: 'boolean'
|
|
58
|
+
},
|
|
59
|
+
disabled: {
|
|
60
|
+
control: 'boolean'
|
|
61
|
+
},
|
|
62
|
+
active: {
|
|
63
|
+
control: 'boolean'
|
|
64
|
+
},
|
|
65
|
+
colorActive: {
|
|
66
|
+
control: 'color'
|
|
67
|
+
},
|
|
68
|
+
color: {
|
|
69
|
+
control: 'color'
|
|
70
|
+
},
|
|
71
|
+
backgroundColor: {
|
|
72
|
+
control: 'color'
|
|
73
|
+
},
|
|
74
|
+
hoverColor: {
|
|
75
|
+
control: 'color'
|
|
76
|
+
},
|
|
77
|
+
badge: {
|
|
78
|
+
control: 'boolean'
|
|
79
|
+
},
|
|
80
|
+
badgeAriaLabel: {
|
|
81
|
+
control: 'text'
|
|
82
|
+
},
|
|
83
|
+
classNameBadge: {
|
|
84
|
+
control: 'text'
|
|
85
|
+
},
|
|
86
|
+
ringing: {
|
|
87
|
+
control: 'boolean'
|
|
88
|
+
},
|
|
89
|
+
animateRinging: {
|
|
90
|
+
control: 'boolean'
|
|
91
|
+
},
|
|
92
|
+
progress: {
|
|
93
|
+
control: {
|
|
94
|
+
type: 'range',
|
|
95
|
+
min: 0,
|
|
96
|
+
max: 100,
|
|
97
|
+
step: 1
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
progressAuto: {
|
|
101
|
+
control: 'boolean'
|
|
102
|
+
},
|
|
103
|
+
colorProgress: {
|
|
104
|
+
control: 'color'
|
|
105
|
+
},
|
|
106
|
+
text: {
|
|
107
|
+
control: 'text',
|
|
108
|
+
description: 'Texto bajo el icono.'
|
|
109
|
+
},
|
|
110
|
+
variant: {
|
|
111
|
+
control: 'select',
|
|
112
|
+
options: ['', 'L', 'M', 'S', 'XS']
|
|
113
|
+
},
|
|
114
|
+
fontWeight: {
|
|
115
|
+
control: 'select',
|
|
116
|
+
options: ['', '400', '500', '600', '700']
|
|
117
|
+
},
|
|
118
|
+
secondaryFont: {
|
|
119
|
+
control: 'boolean'
|
|
120
|
+
},
|
|
121
|
+
textVisibleMenuMobile: {
|
|
122
|
+
control: 'boolean'
|
|
123
|
+
},
|
|
124
|
+
stylesText: {
|
|
125
|
+
control: 'object'
|
|
126
|
+
},
|
|
127
|
+
inModal: {
|
|
128
|
+
control: 'boolean'
|
|
129
|
+
},
|
|
130
|
+
component: {
|
|
131
|
+
control: 'select',
|
|
132
|
+
options: ['button', 'a', 'span']
|
|
133
|
+
},
|
|
134
|
+
onClick: {
|
|
135
|
+
action: 'onClick'
|
|
136
|
+
},
|
|
137
|
+
id: {
|
|
138
|
+
control: 'text'
|
|
139
|
+
},
|
|
140
|
+
className: {
|
|
141
|
+
control: 'text'
|
|
142
|
+
},
|
|
143
|
+
style: {
|
|
144
|
+
control: 'object'
|
|
145
|
+
},
|
|
146
|
+
styles: {
|
|
147
|
+
control: 'object'
|
|
148
|
+
},
|
|
149
|
+
sx: {
|
|
150
|
+
control: 'object'
|
|
151
|
+
},
|
|
152
|
+
prefixClass: {
|
|
153
|
+
table: {
|
|
154
|
+
disable: true
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
14
158
|
parameters: {
|
|
15
159
|
docs: {
|
|
16
160
|
description: {
|
|
@@ -28,6 +172,25 @@ var _default = {
|
|
|
28
172
|
}
|
|
29
173
|
};
|
|
30
174
|
exports["default"] = _default;
|
|
175
|
+
var PlaygroundTemplate = function PlaygroundTemplate(args) {
|
|
176
|
+
return /*#__PURE__*/_react["default"].createElement(_IconButton["default"], args);
|
|
177
|
+
};
|
|
178
|
+
PlaygroundTemplate.displayName = "PlaygroundTemplate";
|
|
179
|
+
var Playground = PlaygroundTemplate.bind({});
|
|
180
|
+
exports.Playground = Playground;
|
|
181
|
+
Playground.args = {
|
|
182
|
+
icon: 'editar',
|
|
183
|
+
tooltip: 'Editar',
|
|
184
|
+
placementTooltip: 'bottom',
|
|
185
|
+
type: '',
|
|
186
|
+
rounded: false,
|
|
187
|
+
disabled: false,
|
|
188
|
+
active: false,
|
|
189
|
+
badge: false,
|
|
190
|
+
ringing: false,
|
|
191
|
+
progress: 0,
|
|
192
|
+
progressAuto: false
|
|
193
|
+
};
|
|
31
194
|
var TemplateIconButton = function TemplateIconButton(args) {
|
|
32
195
|
return /*#__PURE__*/_react["default"].createElement(_DesignIconButton["default"], args);
|
|
33
196
|
};
|
|
@@ -35,6 +198,8 @@ TemplateIconButton.displayName = "TemplateIconButton";
|
|
|
35
198
|
var DesignIconButtonTemplate = TemplateIconButton.bind({});
|
|
36
199
|
exports.DesignIconButtonTemplate = DesignIconButtonTemplate;
|
|
37
200
|
DesignIconButtonTemplate.parameters = {
|
|
38
|
-
|
|
201
|
+
controls: {
|
|
202
|
+
disable: true
|
|
203
|
+
}
|
|
39
204
|
};
|
|
40
205
|
DesignIconButtonTemplate.args = {};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports["default"] = exports.DesignIconButtonSquareTemplate = void 0;
|
|
6
|
+
exports["default"] = exports.Playground = exports.DesignIconButtonSquareTemplate = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _IconButtonSquare = _interopRequireDefault(require("./IconButtonSquare"));
|
|
9
9
|
var _DesignIconButtonSquare = _interopRequireDefault(require("./DesignIconButtonSquare.stories"));
|
|
@@ -11,7 +11,157 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default":
|
|
|
11
11
|
var _default = {
|
|
12
12
|
title: 'Components/IconButtonSquare',
|
|
13
13
|
component: _IconButtonSquare["default"],
|
|
14
|
+
argTypes: {
|
|
15
|
+
icon: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['editar', 'eliminar', 'campana', 'usuario', 'mas'],
|
|
18
|
+
mapping: {
|
|
19
|
+
editar: /*#__PURE__*/_react["default"].createElement("i", {
|
|
20
|
+
className: "ri-pencil-line",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
}),
|
|
23
|
+
eliminar: /*#__PURE__*/_react["default"].createElement("i", {
|
|
24
|
+
className: "ri-delete-bin-line",
|
|
25
|
+
"aria-hidden": "true"
|
|
26
|
+
}),
|
|
27
|
+
campana: /*#__PURE__*/_react["default"].createElement("i", {
|
|
28
|
+
className: "ri-notification-3-line",
|
|
29
|
+
"aria-hidden": "true"
|
|
30
|
+
}),
|
|
31
|
+
usuario: /*#__PURE__*/_react["default"].createElement("i", {
|
|
32
|
+
className: "ri-user-3-line",
|
|
33
|
+
"aria-hidden": "true"
|
|
34
|
+
}),
|
|
35
|
+
mas: /*#__PURE__*/_react["default"].createElement("i", {
|
|
36
|
+
className: "ri-more-2-fill",
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
tooltip: {
|
|
42
|
+
control: 'text',
|
|
43
|
+
description: 'También se usa como nombre accesible.'
|
|
44
|
+
},
|
|
45
|
+
'aria-label': {
|
|
46
|
+
control: 'text'
|
|
47
|
+
},
|
|
48
|
+
placementTooltip: {
|
|
49
|
+
control: 'select',
|
|
50
|
+
options: ['top', 'right', 'bottom', 'left']
|
|
51
|
+
},
|
|
52
|
+
type: {
|
|
53
|
+
table: {
|
|
54
|
+
disable: true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
rounded: {
|
|
58
|
+
control: 'boolean'
|
|
59
|
+
},
|
|
60
|
+
disabled: {
|
|
61
|
+
control: 'boolean'
|
|
62
|
+
},
|
|
63
|
+
active: {
|
|
64
|
+
control: 'boolean'
|
|
65
|
+
},
|
|
66
|
+
colorActive: {
|
|
67
|
+
control: 'color'
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
control: 'color'
|
|
71
|
+
},
|
|
72
|
+
backgroundColor: {
|
|
73
|
+
control: 'color'
|
|
74
|
+
},
|
|
75
|
+
hoverColor: {
|
|
76
|
+
control: 'color'
|
|
77
|
+
},
|
|
78
|
+
badge: {
|
|
79
|
+
control: 'boolean'
|
|
80
|
+
},
|
|
81
|
+
badgeAriaLabel: {
|
|
82
|
+
control: 'text'
|
|
83
|
+
},
|
|
84
|
+
classNameBadge: {
|
|
85
|
+
control: 'text'
|
|
86
|
+
},
|
|
87
|
+
ringing: {
|
|
88
|
+
control: 'boolean'
|
|
89
|
+
},
|
|
90
|
+
animateRinging: {
|
|
91
|
+
control: 'boolean'
|
|
92
|
+
},
|
|
93
|
+
progress: {
|
|
94
|
+
control: {
|
|
95
|
+
type: 'range',
|
|
96
|
+
min: 0,
|
|
97
|
+
max: 100,
|
|
98
|
+
step: 1
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
progressAuto: {
|
|
102
|
+
control: 'boolean'
|
|
103
|
+
},
|
|
104
|
+
colorProgress: {
|
|
105
|
+
control: 'color'
|
|
106
|
+
},
|
|
107
|
+
text: {
|
|
108
|
+
control: 'text',
|
|
109
|
+
description: 'Texto bajo el icono.'
|
|
110
|
+
},
|
|
111
|
+
variant: {
|
|
112
|
+
control: 'select',
|
|
113
|
+
options: ['', 'L', 'M', 'S', 'XS']
|
|
114
|
+
},
|
|
115
|
+
fontWeight: {
|
|
116
|
+
control: 'select',
|
|
117
|
+
options: ['', '400', '500', '600', '700']
|
|
118
|
+
},
|
|
119
|
+
secondaryFont: {
|
|
120
|
+
control: 'boolean'
|
|
121
|
+
},
|
|
122
|
+
textVisibleMenuMobile: {
|
|
123
|
+
control: 'boolean'
|
|
124
|
+
},
|
|
125
|
+
stylesText: {
|
|
126
|
+
control: 'object'
|
|
127
|
+
},
|
|
128
|
+
inModal: {
|
|
129
|
+
control: 'boolean'
|
|
130
|
+
},
|
|
131
|
+
component: {
|
|
132
|
+
control: 'select',
|
|
133
|
+
options: ['button', 'a', 'span']
|
|
134
|
+
},
|
|
135
|
+
onClick: {
|
|
136
|
+
action: 'onClick'
|
|
137
|
+
},
|
|
138
|
+
id: {
|
|
139
|
+
control: 'text'
|
|
140
|
+
},
|
|
141
|
+
className: {
|
|
142
|
+
control: 'text'
|
|
143
|
+
},
|
|
144
|
+
style: {
|
|
145
|
+
control: 'object'
|
|
146
|
+
},
|
|
147
|
+
styles: {
|
|
148
|
+
control: 'object'
|
|
149
|
+
},
|
|
150
|
+
sx: {
|
|
151
|
+
control: 'object'
|
|
152
|
+
},
|
|
153
|
+
prefixClass: {
|
|
154
|
+
table: {
|
|
155
|
+
disable: true
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
14
159
|
parameters: {
|
|
160
|
+
docs: {
|
|
161
|
+
description: {
|
|
162
|
+
component: "\n## IconButtonSquare\n\nVariante cuadrada de `IconButton`. Es un atajo de `<IconButton type=\"square\" />`: acepta exactamente las mismas props y tiene el mismo comportamiento.\n\n## Funcionamiento\n\n- Renderiza un `IconButton` con `type=\"square\"` y reenv\xEDa todas las props y la `ref`.\n- Admite las mismas opciones que `IconButton`: `icon`, `onClick`, `tooltip`, `disabled`, `active`, `loading`, `color`, `backgroundColor`, `hoverColor`, `size`, `sx`...\n\n## Accesibilidad\n\n### Nombre accesible\n\n- Al ser un `IconButton`, se renderiza como un `button` nativo, enfocable con **Tab** y activable con **Enter** o **Espacio**.\n- El nombre accesible se toma de `aria-label`, de `tooltip` o de `text`, en ese orden.\n- Integra `useA11yGuard` a trav\xE9s de `IconButton`: en modo estricto exige `aria-label`, `tooltip` o `text`.\n\n### Estados\n\n- `disabled` usa el atributo nativo: el bot\xF3n sale del orden de tabulaci\xF3n y no responde a clics.\n- El icono debe ser decorativo (`aria-hidden=\"true\"`), ya que el nombre lo aporta `aria-label` o `tooltip`.\n\n## Recomendaciones de uso\n\n- Proporcionar siempre `tooltip` o `aria-label` con la acci\xF3n que realiza (por ejemplo, \"Editar\", \"Eliminar\"), no el nombre del icono.\n- Usar `IconButton` (redondo) o `IconButtonSquare` seg\xFAn el dise\xF1o; la accesibilidad es la misma.\n\n## Consideraciones\n\n- Toda la l\xF3gica y la accesibilidad viven en `IconButton`; consultar su documentaci\xF3n para el detalle completo de props.\n- El estado `active` solo se indica visualmente: no se expone `aria-pressed`."
|
|
163
|
+
}
|
|
164
|
+
},
|
|
15
165
|
storybookCodePanel: {
|
|
16
166
|
disabled: false,
|
|
17
167
|
files: [{
|
|
@@ -27,6 +177,24 @@ var _default = {
|
|
|
27
177
|
}
|
|
28
178
|
};
|
|
29
179
|
exports["default"] = _default;
|
|
180
|
+
var PlaygroundTemplate = function PlaygroundTemplate(args) {
|
|
181
|
+
return /*#__PURE__*/_react["default"].createElement(_IconButtonSquare["default"], args);
|
|
182
|
+
};
|
|
183
|
+
PlaygroundTemplate.displayName = "PlaygroundTemplate";
|
|
184
|
+
var Playground = PlaygroundTemplate.bind({});
|
|
185
|
+
exports.Playground = Playground;
|
|
186
|
+
Playground.args = {
|
|
187
|
+
icon: 'editar',
|
|
188
|
+
tooltip: 'Editar',
|
|
189
|
+
placementTooltip: 'bottom',
|
|
190
|
+
rounded: false,
|
|
191
|
+
disabled: false,
|
|
192
|
+
active: false,
|
|
193
|
+
badge: false,
|
|
194
|
+
ringing: false,
|
|
195
|
+
progress: 0,
|
|
196
|
+
progressAuto: false
|
|
197
|
+
};
|
|
30
198
|
var TemplateIconButtonSquare = function TemplateIconButtonSquare(args) {
|
|
31
199
|
return /*#__PURE__*/_react["default"].createElement(_DesignIconButtonSquare["default"], args);
|
|
32
200
|
};
|
|
@@ -34,6 +202,8 @@ TemplateIconButtonSquare.displayName = "TemplateIconButtonSquare";
|
|
|
34
202
|
var DesignIconButtonSquareTemplate = TemplateIconButtonSquare.bind({});
|
|
35
203
|
exports.DesignIconButtonSquareTemplate = DesignIconButtonSquareTemplate;
|
|
36
204
|
DesignIconButtonSquareTemplate.parameters = {
|
|
37
|
-
|
|
205
|
+
controls: {
|
|
206
|
+
disable: true
|
|
207
|
+
}
|
|
38
208
|
};
|
|
39
209
|
DesignIconButtonSquareTemplate.args = {};
|
|
@@ -7,22 +7,40 @@ exports["default"] = exports.Success = exports.Multiple = exports.Helper = expor
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _InputAutocomplete = _interopRequireDefault(require("./InputAutocomplete"));
|
|
9
9
|
var _Checkbox = _interopRequireDefault(require("../Checkbox/Checkbox"));
|
|
10
|
+
var _excluded = ["value", "onChange"],
|
|
11
|
+
_excluded2 = ["onChange"];
|
|
10
12
|
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
13
|
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
13
14
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
15
|
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
15
16
|
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
17
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
16
18
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
17
19
|
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."); }
|
|
18
20
|
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; } }
|
|
19
21
|
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; }
|
|
20
22
|
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; } }
|
|
21
23
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
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; }
|
|
22
26
|
var _default = {
|
|
23
27
|
title: 'Components/Input Autocomplete',
|
|
24
28
|
component: _InputAutocomplete["default"],
|
|
25
29
|
argTypes: {
|
|
30
|
+
label: {
|
|
31
|
+
control: 'text'
|
|
32
|
+
},
|
|
33
|
+
placeholder: {
|
|
34
|
+
control: 'text'
|
|
35
|
+
},
|
|
36
|
+
options: {
|
|
37
|
+
control: 'object',
|
|
38
|
+
description: 'Lista de opciones (textos u objetos con label/value).'
|
|
39
|
+
},
|
|
40
|
+
value: {
|
|
41
|
+
control: 'object',
|
|
42
|
+
description: 'Opción seleccionada (o array en modo múltiple).'
|
|
43
|
+
},
|
|
26
44
|
variant: {
|
|
27
45
|
options: ['outlined', 'filled', 'standard'],
|
|
28
46
|
control: {
|
|
@@ -30,13 +48,122 @@ var _default = {
|
|
|
30
48
|
}
|
|
31
49
|
},
|
|
32
50
|
required: {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
51
|
+
control: 'boolean'
|
|
52
|
+
},
|
|
53
|
+
disabled: {
|
|
54
|
+
control: 'boolean'
|
|
55
|
+
},
|
|
56
|
+
fullWidth: {
|
|
57
|
+
control: 'boolean'
|
|
58
|
+
},
|
|
59
|
+
clearable: {
|
|
60
|
+
control: 'boolean'
|
|
61
|
+
},
|
|
62
|
+
freeSolo: {
|
|
63
|
+
control: 'boolean',
|
|
64
|
+
description: 'Permite texto que no es una opción.'
|
|
65
|
+
},
|
|
66
|
+
clearOnBlur: {
|
|
67
|
+
control: 'boolean'
|
|
68
|
+
},
|
|
69
|
+
selectOnFocus: {
|
|
70
|
+
control: 'boolean'
|
|
71
|
+
},
|
|
72
|
+
loading: {
|
|
73
|
+
control: 'boolean'
|
|
74
|
+
},
|
|
75
|
+
loadingText: {
|
|
76
|
+
control: 'text'
|
|
77
|
+
},
|
|
78
|
+
error: {
|
|
79
|
+
control: 'text'
|
|
80
|
+
},
|
|
81
|
+
success: {
|
|
82
|
+
control: 'boolean'
|
|
83
|
+
},
|
|
84
|
+
helper: {
|
|
85
|
+
control: 'text'
|
|
86
|
+
},
|
|
87
|
+
autoComplete: {
|
|
88
|
+
control: 'text'
|
|
89
|
+
},
|
|
90
|
+
'aria-label': {
|
|
91
|
+
control: 'text'
|
|
92
|
+
},
|
|
93
|
+
onChange: {
|
|
94
|
+
action: 'onChange'
|
|
95
|
+
},
|
|
96
|
+
onInputChange: {
|
|
97
|
+
action: 'onInputChange'
|
|
98
|
+
},
|
|
99
|
+
InputProps: {
|
|
100
|
+
control: 'object'
|
|
101
|
+
},
|
|
102
|
+
id: {
|
|
103
|
+
control: 'text'
|
|
104
|
+
},
|
|
105
|
+
className: {
|
|
106
|
+
control: 'text'
|
|
107
|
+
},
|
|
108
|
+
style: {
|
|
109
|
+
control: 'object'
|
|
110
|
+
},
|
|
111
|
+
styles: {
|
|
112
|
+
control: 'object'
|
|
113
|
+
},
|
|
114
|
+
sx: {
|
|
115
|
+
control: 'object'
|
|
116
|
+
},
|
|
117
|
+
multiple: {
|
|
118
|
+
control: false,
|
|
119
|
+
description: 'Ver la story "Multiple".'
|
|
120
|
+
},
|
|
121
|
+
inputValue: {
|
|
122
|
+
control: false
|
|
123
|
+
},
|
|
124
|
+
defaultValue: {
|
|
125
|
+
control: false
|
|
126
|
+
},
|
|
127
|
+
getOptionLabel: {
|
|
128
|
+
control: false
|
|
129
|
+
},
|
|
130
|
+
getOptionValue: {
|
|
131
|
+
control: false
|
|
132
|
+
},
|
|
133
|
+
getOptionSelected: {
|
|
134
|
+
control: false
|
|
135
|
+
},
|
|
136
|
+
filterOptions: {
|
|
137
|
+
control: false
|
|
138
|
+
},
|
|
139
|
+
renderValue: {
|
|
140
|
+
control: false
|
|
141
|
+
},
|
|
142
|
+
renderOption: {
|
|
143
|
+
control: false
|
|
144
|
+
},
|
|
145
|
+
noOptionsText: {
|
|
146
|
+
table: {
|
|
147
|
+
disable: true
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
children: {
|
|
151
|
+
table: {
|
|
152
|
+
disable: true
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
prefixClass: {
|
|
156
|
+
table: {
|
|
157
|
+
disable: true
|
|
36
158
|
}
|
|
37
159
|
}
|
|
38
160
|
},
|
|
39
161
|
parameters: {
|
|
162
|
+
docs: {
|
|
163
|
+
description: {
|
|
164
|
+
component: "\n## InputAutocomplete\n\nCampo de texto con sugerencias: al escribir, filtra una lista de opciones y permite elegir una (o varias). Su API est\xE1 inspirada en el `Autocomplete` de MUI.\n\n## Funcionamiento\n\n### Opciones y valor\n\n- `options`: lista de opciones. Pueden ser textos u objetos.\n- `getOptionLabel(opci\xF3n)`: texto que se muestra de cada opci\xF3n. Por defecto usa `label`, `text`, `translation` o `value`.\n- `getOptionValue(opci\xF3n)`: valor de cada opci\xF3n. Por defecto usa `value` o `id`.\n- `getOptionSelected(opci\xF3n, valor)`: indica si una opci\xF3n est\xE1 seleccionada.\n- `value`, `defaultValue` y `onChange(evento, valor)`: valor seleccionado.\n- `multiple`: permite elegir varias opciones; `value` es un array.\n- `renderOption(opci\xF3n)`: personaliza c\xF3mo se pinta cada opci\xF3n.\n\n### Texto y filtrado\n\n- `inputValue` y `onInputChange(evento, texto)`: texto escrito en el campo (controlado o no).\n- `filterOptions(opciones, { inputValue })`: filtrado propio. Por defecto filtra las opciones cuyo texto contiene lo escrito.\n- `freeSolo`: permite dejar un texto que no coincide con ninguna opci\xF3n.\n- `clearOnBlur` (por defecto `true`) y `selectOnFocus`: comportamiento del texto al salir y entrar en el campo.\n\n### Carga y limpieza\n\n- `loading`: muestra un indicador de carga y el texto `loadingText` (\"Buscando resultados...\" por defecto) en la lista, \xFAtil para b\xFAsquedas en el servidor.\n- `clearable` (por defecto `true`): muestra un bot\xF3n para borrar el valor.\n\n## Accesibilidad\n\n### Campo\n\n- El campo tiene `role=\"combobox\"`, `aria-autocomplete=\"list\"`, `aria-expanded` y `aria-controls` apuntando a la lista.\n- Durante la carga lleva `aria-busy=\"true\"`.\n- Integra `useA11yGuard`: en modo estricto exige `label`, `aria-label` o `placeholder`.\n\n### Lista de sugerencias\n\n- La lista tiene `role=\"listbox\"` y cada sugerencia `role=\"option\"` con `aria-selected`.\n- El texto de carga es una regi\xF3n `role=\"status\"` con `aria-live=\"polite\"`, que se anuncia mientras se buscan resultados.\n\n### Teclado\n\n- **Flecha abajo** / **Flecha arriba**: abren la lista y mueven el foco entre las sugerencias.\n- **Enter**: abre la lista desde el campo; sobre una sugerencia, la elige.\n- **Escape**: cierra la lista (desde el campo o desde una sugerencia).\n- **Tab**: cierra la lista y devuelve el foco al campo.\n\n## Recomendaciones de uso\n\n- Usar siempre `label` visible y pasar `loadingText` traducido.\n- Si no hay resultados, mostrar un mensaje propio cerca del campo, ya que el componente no muestra ni anuncia \"sin resultados\" (ver Consideraciones).\n- Para listas cortas y cerradas, usar `SelectInput`.\n\n## Consideraciones\n\n- Cuando el filtro no devuelve ninguna opci\xF3n, la lista simplemente se cierra: no hay mensaje de \"sin resultados\" ni se anuncia.\n- El n\xFAmero de sugerencias disponibles no se anuncia al escribir.\n- El foco se mueve f\xEDsicamente a las sugerencias (no se usa `aria-activedescendant`), por lo que para seguir escribiendo hay que volver al campo.\n- El bot\xF3n de borrar est\xE1 fuera del orden de tabulaci\xF3n y no tiene `aria-label` propio (el `IconButton` usa el texto gen\xE9rico \"Bot\xF3n\")."
|
|
165
|
+
}
|
|
166
|
+
},
|
|
40
167
|
storybookCodePanel: {
|
|
41
168
|
disabled: false,
|
|
42
169
|
files: [{
|
|
@@ -48,8 +175,24 @@ var _default = {
|
|
|
48
175
|
}
|
|
49
176
|
};
|
|
50
177
|
exports["default"] = _default;
|
|
51
|
-
var Template = function Template(
|
|
52
|
-
|
|
178
|
+
var Template = function Template(_ref) {
|
|
179
|
+
var valueArg = _ref.value,
|
|
180
|
+
_onChange = _ref.onChange,
|
|
181
|
+
args = _objectWithoutProperties(_ref, _excluded);
|
|
182
|
+
var _React$useState = _react["default"].useState(valueArg !== null && valueArg !== void 0 ? valueArg : null),
|
|
183
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
184
|
+
value = _React$useState2[0],
|
|
185
|
+
setValue = _React$useState2[1];
|
|
186
|
+
_react["default"].useEffect(function () {
|
|
187
|
+
return setValue(valueArg !== null && valueArg !== void 0 ? valueArg : null);
|
|
188
|
+
}, [valueArg]);
|
|
189
|
+
return /*#__PURE__*/_react["default"].createElement(_InputAutocomplete["default"], _extends({}, args, {
|
|
190
|
+
value: value,
|
|
191
|
+
onChange: function onChange(event, newValue) {
|
|
192
|
+
setValue(newValue);
|
|
193
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event, newValue);
|
|
194
|
+
}
|
|
195
|
+
}));
|
|
53
196
|
};
|
|
54
197
|
Template.displayName = "Template";
|
|
55
198
|
var Default = Template.bind({});
|
|
@@ -78,7 +221,18 @@ Default.args = {
|
|
|
78
221
|
translation: 'ghjghjghj',
|
|
79
222
|
value: 'statute_4243'
|
|
80
223
|
}],
|
|
81
|
-
label: '
|
|
224
|
+
label: 'Trámite',
|
|
225
|
+
placeholder: 'Busca un trámite',
|
|
226
|
+
value: null,
|
|
227
|
+
required: false,
|
|
228
|
+
disabled: false,
|
|
229
|
+
fullWidth: false,
|
|
230
|
+
clearable: true,
|
|
231
|
+
freeSolo: false,
|
|
232
|
+
loading: false,
|
|
233
|
+
loadingText: 'Buscando resultados...',
|
|
234
|
+
error: '',
|
|
235
|
+
helper: ''
|
|
82
236
|
};
|
|
83
237
|
var Helper = Template.bind({});
|
|
84
238
|
exports.Helper = Helper;
|
|
@@ -215,11 +369,13 @@ var multipleRowStyle = {
|
|
|
215
369
|
alignItems: 'center',
|
|
216
370
|
width: '100%'
|
|
217
371
|
};
|
|
218
|
-
var MultipleTemplate = function MultipleTemplate(
|
|
219
|
-
var
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
372
|
+
var MultipleTemplate = function MultipleTemplate(_ref2) {
|
|
373
|
+
var onChange = _ref2.onChange,
|
|
374
|
+
args = _objectWithoutProperties(_ref2, _excluded2);
|
|
375
|
+
var _React$useState3 = _react["default"].useState(args.value || []),
|
|
376
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
377
|
+
value = _React$useState4[0],
|
|
378
|
+
setValue = _React$useState4[1];
|
|
223
379
|
var allSelected = value.length === PEOPLE.length;
|
|
224
380
|
var options = [].concat(_toConsumableArray(allSelected ? [] : [{
|
|
225
381
|
id: ALL,
|
|
@@ -230,6 +386,7 @@ var MultipleTemplate = function MultipleTemplate(args) {
|
|
|
230
386
|
setValue(newValues.includes(ALL) ? PEOPLE.map(function (person) {
|
|
231
387
|
return person.id;
|
|
232
388
|
}) : newValues);
|
|
389
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(ev);
|
|
233
390
|
};
|
|
234
391
|
return /*#__PURE__*/_react["default"].createElement(_InputAutocomplete["default"], _extends({}, args, {
|
|
235
392
|
multiple: true,
|
|
@@ -267,6 +424,10 @@ exports.Multiple = Multiple;
|
|
|
267
424
|
Multiple.args = {
|
|
268
425
|
variant: 'outlined',
|
|
269
426
|
label: 'People',
|
|
270
|
-
noOptionsText: 'No results',
|
|
271
427
|
value: [1, 3]
|
|
428
|
+
};
|
|
429
|
+
Multiple.parameters = {
|
|
430
|
+
controls: {
|
|
431
|
+
exclude: ['options', 'value']
|
|
432
|
+
}
|
|
272
433
|
};
|