ywana-core8 0.1.103 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +4941 -324
- package/dist/index.js +42339 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +37459 -31678
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +39635 -34010
- package/dist/index.umd.js.map +1 -1
- package/package.json +26 -29
- package/src/Test.stories.jsx +28 -0
- package/src/desktop/Desktop.stories.jsx +110 -0
- package/src/desktop/WindowContext.js +135 -0
- package/src/desktop/WindowManager.js +355 -0
- package/src/desktop/desktop.css +55 -4
- package/src/desktop/desktop.js +312 -6
- package/src/desktop/index.js +7 -0
- package/src/desktop/window.css +229 -36
- package/src/desktop/window.js +255 -20
- package/src/desktop.backup/desktop.css +6 -0
- package/src/desktop.backup/desktop.js +13 -0
- package/src/desktop.backup/window.css +58 -0
- package/src/desktop.backup/window.js +27 -0
- package/src/html/Accordion.stories.jsx +178 -0
- package/src/html/Button.stories.jsx +175 -0
- package/src/html/Checkbox.stories.jsx +131 -0
- package/src/html/Chip.stories.jsx +189 -0
- package/src/html/Color.stories.jsx +234 -0
- package/src/html/Form.stories.jsx +271 -0
- package/src/html/Icon.stories.jsx +233 -0
- package/src/html/Progress.stories.jsx +247 -0
- package/src/html/Radio.stories.jsx +289 -0
- package/src/html/StyleTest.stories.jsx +81 -0
- package/src/html/Switch.stories.jsx +329 -0
- package/src/html/Tab.stories.jsx +239 -0
- package/src/html/Table.stories.jsx +188 -0
- package/src/html/Table2.stories.jsx +238 -0
- package/src/html/TextField2.stories.jsx +337 -0
- package/src/html/Tree.stories.jsx +285 -0
- package/src/html/accordion.example.js +0 -74
- package/src/html/accordion.js +1 -6
- package/src/html/button.js +2 -13
- package/src/html/checkbox.js +1 -9
- package/src/html/chip.js +2 -19
- package/src/html/color.js +1 -14
- package/src/html/form.js +4 -15
- package/src/html/header2.js +1 -12
- package/src/html/icon.js +1 -7
- package/src/html/index.js +1 -1
- package/src/html/list.js +1 -19
- package/src/html/menu.js +9 -5
- package/src/html/progress.js +5 -53
- package/src/html/property.js +9 -25
- package/src/html/radio.js +2 -16
- package/src/html/section.js +1 -6
- package/src/html/selector.js +2 -19
- package/src/html/switch.css +134 -100
- package/src/html/switch.example.js +46 -36
- package/src/html/switch.js +43 -192
- package/src/html/tab.js +3 -24
- package/src/html/text.js +1 -12
- package/src/html/textfield2.js +5 -42
- package/src/html/thumbnail.js +1 -12
- package/src/html/tokenfield.js +2 -21
- package/src/html/tree.js +3 -35
- package/src/index.js +1 -0
- package/__previewjs__/Wrapper.tsx +0 -14
- package/build-doc.sh +0 -10
- package/db/db.json +0 -89
- package/db/routes.json +0 -0
- package/dist/index.cjs +0 -36722
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/doc/README.md +0 -196
- package/doc/evalulations/ACCORDION_EVALUATION.md +0 -583
- package/doc/evalulations/CHECKBOX_EVALUATION.md +0 -273
- package/doc/evalulations/CHIP_EVALUATION.md +0 -542
- package/doc/evalulations/COLOR_EVALUATION.md +0 -524
- package/doc/evalulations/COMPONENTS_EVALUATION.md +0 -477
- package/doc/evalulations/FORM_EVALUATION.md +0 -459
- package/doc/evalulations/HEADER_EVALUATION.md +0 -436
- package/doc/evalulations/ICON_EVALUATION.md +0 -254
- package/doc/evalulations/LIST_EVALUATION.md +0 -574
- package/doc/evalulations/PROGRESS_EVALUATION.md +0 -450
- package/doc/evalulations/RADIO_EVALUATION.md +0 -439
- package/doc/evalulations/RADIO_VISUAL_FIX.md +0 -183
- package/doc/evalulations/SECTION_IMPROVEMENTS.md +0 -153
- package/doc/evalulations/SWITCH_EVALUATION.md +0 -335
- package/doc/evalulations/SWITCH_VISUAL_FIX.md +0 -232
- package/doc/evalulations/TAB_EVALUATION.md +0 -626
- package/doc/evalulations/TEXTFIELD_EVALUATION.md +0 -747
- package/doc/evalulations/TOOLTIP_FIX.md +0 -157
- package/doc/evalulations/TREE_EVALUATION.md +0 -708
- package/doc/index.html +0 -0
- package/doc/package-lock.json +0 -17298
- package/doc/package.json +0 -34
- package/doc/public/index.html +0 -24
- package/doc/scripts/generate-examples.js +0 -129
- package/doc/src/App.css +0 -171
- package/doc/src/App.js +0 -114
- package/doc/src/components/ExamplePage.js +0 -129
- package/doc/src/components/WelcomePage.js +0 -84
- package/doc/src/index.css +0 -246
- package/doc/src/index.js +0 -17
- package/doc/src/theme.css +0 -256
- package/jest.config.js +0 -24
- package/preview.config.js +0 -38
- package/publish.sh +0 -6
- package/src/desktop/dektop.test.js +0 -11
- package/src/domain/CollectionAPI.test.js +0 -19
- package/src/domain/ContentEditor.test.js +0 -52
- package/src/domain2/CollectionAPI.test.js +0 -19
- package/src/domain2/CollectionContext.test.js +0 -71
- package/src/domain2/CollectionPage.test.js +0 -112
- package/src/domain2/DynamicForm.test.js +0 -47
- package/src/html/accordion.test.js +0 -37
- package/src/html/accordion.unit.test.js +0 -334
- package/src/html/button.example.new.js +0 -416
- package/src/html/button.test.js +0 -422
- package/src/html/checkbox.test.js +0 -285
- package/src/html/chip.test.js +0 -425
- package/src/html/color.example.js.backup +0 -527
- package/src/html/color.test.js +0 -377
- package/src/html/components.example.js.backup +0 -492
- package/src/html/components_enhanced.test.js +0 -581
- package/src/html/form.example.js.backup +0 -385
- package/src/html/form.test.js +0 -369
- package/src/html/header2.example.js.backup +0 -411
- package/src/html/header2.test.js +0 -377
- package/src/html/icon.example.js.backup +0 -268
- package/src/html/icon.test.js +0 -231
- package/src/html/label.test.js +0 -0
- package/src/html/list.example.js.backup +0 -404
- package/src/html/list.test.js +0 -383
- package/src/html/progress.example.js.backup +0 -424
- package/src/html/progress.test.js +0 -313
- package/src/html/property.example.js.backup +0 -553
- package/src/html/property.test.js +0 -371
- package/src/html/radio.example.js.backup +0 -389
- package/src/html/radio.test.js +0 -318
- package/src/html/section.example.js.backup +0 -99
- package/src/html/section.test.js +0 -131
- package/src/html/selector.test.js +0 -20
- package/src/html/switch.example.js.backup +0 -461
- package/src/html/switch.test.js +0 -355
- package/src/html/tab.example.js.backup +0 -446
- package/src/html/tab.test.js +0 -25
- package/src/html/tab_enhanced.test.js +0 -504
- package/src/html/table.test.js +0 -70
- package/src/html/table2.test.js +0 -582
- package/src/html/text.test.js +0 -15
- package/src/html/textfield.test.js +0 -51
- package/src/html/textfield2.example.js.backup +0 -1370
- package/src/html/textfield2.test.js +0 -950
- package/src/html/tokenfield.example.js.backup +0 -503
- package/src/html/tokenfield.test.js +0 -423
- package/src/html/tree.example.js.backup +0 -475
- package/src/html/tree.test.js +0 -43
- package/src/html/tree_enhanced.test.js +0 -495
- package/src/http/token.test.js +0 -50
- package/src/incubator/pdfViewer.js +0 -33
- package/src/incubator/wizard.test.js +0 -127
- package/src/site/site.test.js +0 -230
- package/src/site/view.test.js +0 -41
- package/src/widgets/calendar/Calendar.test.js +0 -28
- package/src/widgets/explorer/Explorer.test.js +0 -121
- package/src/widgets/ide/editor.test.js +0 -33
- package/src/widgets/kanban/Kanban.test.js +0 -78
- package/src/widgets/login/LoginBox.test.js +0 -12
- package/src/widgets/login/ResetPasswordBox.test.js +0 -34
- package/src/widgets/login/validations.test.js +0 -51
- package/src/widgets/planner/Planner.test.js +0 -60
- package/src/widgets/upload/Upload.test.js +0 -32
- package/table2.test.js +0 -454
@@ -0,0 +1,233 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Icon } from './icon.js'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Iconos básicos
|
6
|
+
*/
|
7
|
+
export const BasicIcons = () => (
|
8
|
+
<div style={{ padding: '20px' }}>
|
9
|
+
<h3>Iconos Básicos</h3>
|
10
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
11
|
+
<Icon icon="home" />
|
12
|
+
<Icon icon="settings" />
|
13
|
+
<Icon icon="favorite" />
|
14
|
+
<Icon icon="info" />
|
15
|
+
<Icon icon="star" />
|
16
|
+
<Icon icon="search" />
|
17
|
+
</div>
|
18
|
+
<p><em>Iconos simples sin interacción</em></p>
|
19
|
+
</div>
|
20
|
+
)
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Diferentes tamaños
|
24
|
+
*/
|
25
|
+
export const IconSizes = () => (
|
26
|
+
<div style={{ padding: '20px' }}>
|
27
|
+
<h3>Diferentes Tamaños</h3>
|
28
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
29
|
+
<Icon icon="star" size="small" />
|
30
|
+
<Icon icon="star" size="normal" />
|
31
|
+
<Icon icon="star" size="large" />
|
32
|
+
</div>
|
33
|
+
<p><em>Tamaños: small, normal, large</em></p>
|
34
|
+
</div>
|
35
|
+
)
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Iconos clickables
|
39
|
+
*/
|
40
|
+
export const ClickableIcons = () => {
|
41
|
+
const [clickCount, setClickCount] = useState(0)
|
42
|
+
|
43
|
+
const handleClick = () => {
|
44
|
+
setClickCount(prev => prev + 1)
|
45
|
+
}
|
46
|
+
|
47
|
+
return (
|
48
|
+
<div style={{ padding: '20px' }}>
|
49
|
+
<h3>Iconos Clickables</h3>
|
50
|
+
<p>Clicks: {clickCount}</p>
|
51
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
52
|
+
<Icon
|
53
|
+
icon="thumb_up"
|
54
|
+
clickable
|
55
|
+
action={handleClick}
|
56
|
+
tooltip={{
|
57
|
+
text: 'Hacer clic para incrementar',
|
58
|
+
top: '-3rem',
|
59
|
+
left: '-2rem'
|
60
|
+
}}
|
61
|
+
/>
|
62
|
+
<Icon
|
63
|
+
icon="refresh"
|
64
|
+
clickable
|
65
|
+
action={() => setClickCount(0)}
|
66
|
+
tooltip={{
|
67
|
+
text: 'Resetear contador',
|
68
|
+
top: '-3rem',
|
69
|
+
left: '-2rem'
|
70
|
+
}}
|
71
|
+
/>
|
72
|
+
<Icon
|
73
|
+
icon="add"
|
74
|
+
clickable
|
75
|
+
action={() => alert('¡Añadido!')}
|
76
|
+
/>
|
77
|
+
</div>
|
78
|
+
</div>
|
79
|
+
)
|
80
|
+
}
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Estados disabled
|
84
|
+
*/
|
85
|
+
export const DisabledIcons = () => {
|
86
|
+
const [isDisabled, setIsDisabled] = useState(false)
|
87
|
+
|
88
|
+
const toggleDisabled = () => {
|
89
|
+
setIsDisabled(prev => !prev)
|
90
|
+
}
|
91
|
+
|
92
|
+
return (
|
93
|
+
<div style={{ padding: '20px' }}>
|
94
|
+
<h3>Estados Disabled</h3>
|
95
|
+
<p>Estado disabled: {isDisabled ? 'Activado' : 'Desactivado'}</p>
|
96
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
97
|
+
<Icon
|
98
|
+
icon="toggle_on"
|
99
|
+
clickable
|
100
|
+
action={toggleDisabled}
|
101
|
+
tooltip={{
|
102
|
+
text: 'Alternar estado disabled',
|
103
|
+
top: '-3rem',
|
104
|
+
left: '-3rem'
|
105
|
+
}}
|
106
|
+
/>
|
107
|
+
<Icon
|
108
|
+
icon="delete"
|
109
|
+
clickable
|
110
|
+
disabled={isDisabled}
|
111
|
+
action={() => alert('¡Eliminado!')}
|
112
|
+
tooltip={{
|
113
|
+
text: isDisabled ? 'Icono deshabilitado' : 'Eliminar elemento',
|
114
|
+
top: '-3rem',
|
115
|
+
left: '-2rem'
|
116
|
+
}}
|
117
|
+
/>
|
118
|
+
</div>
|
119
|
+
</div>
|
120
|
+
)
|
121
|
+
}
|
122
|
+
|
123
|
+
/**
|
124
|
+
* Iconos con tooltips
|
125
|
+
*/
|
126
|
+
export const IconsWithTooltips = () => (
|
127
|
+
<div style={{ padding: '20px' }}>
|
128
|
+
<h3>Iconos con Tooltips</h3>
|
129
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
130
|
+
<Icon
|
131
|
+
icon="help"
|
132
|
+
clickable
|
133
|
+
tooltip={{
|
134
|
+
text: 'Ayuda y soporte',
|
135
|
+
top: '-3rem',
|
136
|
+
left: '-2rem'
|
137
|
+
}}
|
138
|
+
action={() => alert('¡Ayuda!')}
|
139
|
+
/>
|
140
|
+
<Icon
|
141
|
+
icon="download"
|
142
|
+
clickable
|
143
|
+
tooltip={{
|
144
|
+
text: 'Descargar archivo',
|
145
|
+
top: '-3rem',
|
146
|
+
left: '-2rem'
|
147
|
+
}}
|
148
|
+
action={() => alert('¡Descargando!')}
|
149
|
+
/>
|
150
|
+
<Icon
|
151
|
+
icon="share"
|
152
|
+
clickable
|
153
|
+
tooltip={{
|
154
|
+
text: 'Compartir contenido',
|
155
|
+
top: '-3rem',
|
156
|
+
left: '-2rem'
|
157
|
+
}}
|
158
|
+
action={() => alert('¡Compartido!')}
|
159
|
+
/>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
)
|
163
|
+
|
164
|
+
/**
|
165
|
+
* Accesibilidad
|
166
|
+
*/
|
167
|
+
export const AccessibleIcons = () => (
|
168
|
+
<div style={{ padding: '20px' }}>
|
169
|
+
<h3>Accesibilidad Mejorada</h3>
|
170
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
171
|
+
<Icon
|
172
|
+
icon="accessibility"
|
173
|
+
clickable
|
174
|
+
ariaLabel="Configuración de accesibilidad"
|
175
|
+
action={() => alert('Configuración de accesibilidad')}
|
176
|
+
/>
|
177
|
+
<Icon
|
178
|
+
icon="visibility"
|
179
|
+
clickable
|
180
|
+
ariaLabel="Alternar visibilidad"
|
181
|
+
action={() => alert('Visibilidad alternada')}
|
182
|
+
/>
|
183
|
+
<Icon
|
184
|
+
icon="hearing"
|
185
|
+
clickable
|
186
|
+
ariaLabel="Configuración de audio"
|
187
|
+
action={() => alert('Configuración de audio')}
|
188
|
+
/>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
)
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Estilos personalizados
|
195
|
+
*/
|
196
|
+
export const CustomStyledIcons = () => (
|
197
|
+
<div style={{ padding: '20px' }}>
|
198
|
+
<h3>Estilos Personalizados</h3>
|
199
|
+
<div style={{ display: 'flex', gap: '1rem', alignItems: 'center' }}>
|
200
|
+
<Icon
|
201
|
+
icon="palette"
|
202
|
+
style={{ color: '#e91e63', fontSize: '2rem' }}
|
203
|
+
/>
|
204
|
+
<Icon
|
205
|
+
icon="brush"
|
206
|
+
style={{ color: '#2196f3', fontSize: '2rem' }}
|
207
|
+
/>
|
208
|
+
<Icon
|
209
|
+
icon="color_lens"
|
210
|
+
style={{ color: '#4caf50', fontSize: '2rem' }}
|
211
|
+
/>
|
212
|
+
<Icon
|
213
|
+
icon="format_paint"
|
214
|
+
style={{ color: '#ff9800', fontSize: '2rem' }}
|
215
|
+
/>
|
216
|
+
</div>
|
217
|
+
</div>
|
218
|
+
)
|
219
|
+
|
220
|
+
/**
|
221
|
+
* Todos los ejemplos
|
222
|
+
*/
|
223
|
+
export const AllExamples = () => (
|
224
|
+
<div>
|
225
|
+
<BasicIcons />
|
226
|
+
<IconSizes />
|
227
|
+
<ClickableIcons />
|
228
|
+
<DisabledIcons />
|
229
|
+
<IconsWithTooltips />
|
230
|
+
<AccessibleIcons />
|
231
|
+
<CustomStyledIcons />
|
232
|
+
</div>
|
233
|
+
)
|
@@ -0,0 +1,247 @@
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
2
|
+
import { CircularProgress, LinearProgress } from './progress.js'
|
3
|
+
import { Button } from './button.js'
|
4
|
+
|
5
|
+
/**
|
6
|
+
* Progress circular
|
7
|
+
*/
|
8
|
+
export const CircularProgressExamples = () => {
|
9
|
+
const [progress, setProgress] = useState(45)
|
10
|
+
|
11
|
+
useEffect(() => {
|
12
|
+
const timer = setInterval(() => {
|
13
|
+
setProgress(prev => (prev >= 100 ? 0 : prev + 1))
|
14
|
+
}, 100)
|
15
|
+
return () => clearInterval(timer)
|
16
|
+
}, [])
|
17
|
+
|
18
|
+
return (
|
19
|
+
<div style={{ padding: '20px' }}>
|
20
|
+
<h3>CircularProgress - Indicadores Circulares</h3>
|
21
|
+
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(150px, 1fr))', gap: '2rem', textAlign: 'center' }}>
|
22
|
+
<div>
|
23
|
+
<h4>Indeterminate</h4>
|
24
|
+
<CircularProgress
|
25
|
+
variant="indeterminate"
|
26
|
+
size="large"
|
27
|
+
color="primary"
|
28
|
+
/>
|
29
|
+
</div>
|
30
|
+
|
31
|
+
<div>
|
32
|
+
<h4>With Value</h4>
|
33
|
+
<CircularProgress
|
34
|
+
variant="determinate"
|
35
|
+
value={progress}
|
36
|
+
size="large"
|
37
|
+
color="success"
|
38
|
+
showValue={true}
|
39
|
+
/>
|
40
|
+
</div>
|
41
|
+
|
42
|
+
<div>
|
43
|
+
<h4>With Icon</h4>
|
44
|
+
<CircularProgress
|
45
|
+
variant="determinate"
|
46
|
+
value={75}
|
47
|
+
size="xlarge"
|
48
|
+
color="warning"
|
49
|
+
icon="download"
|
50
|
+
/>
|
51
|
+
</div>
|
52
|
+
|
53
|
+
<div>
|
54
|
+
<h4>Custom Format</h4>
|
55
|
+
<CircularProgress
|
56
|
+
variant="determinate"
|
57
|
+
value={progress}
|
58
|
+
size="large"
|
59
|
+
color="error"
|
60
|
+
showValue={true}
|
61
|
+
valueFormat={(value) => `${Math.round(value)}%`}
|
62
|
+
/>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
</div>
|
66
|
+
)
|
67
|
+
}
|
68
|
+
|
69
|
+
/**
|
70
|
+
* Progress lineal
|
71
|
+
*/
|
72
|
+
export const LinearProgressExamples = () => {
|
73
|
+
const [progress, setProgress] = useState(45)
|
74
|
+
const [isRunning, setIsRunning] = useState(true)
|
75
|
+
|
76
|
+
useEffect(() => {
|
77
|
+
if (!isRunning) return
|
78
|
+
|
79
|
+
const timer = setInterval(() => {
|
80
|
+
setProgress(prev => (prev >= 100 ? 0 : prev + 1))
|
81
|
+
}, 100)
|
82
|
+
return () => clearInterval(timer)
|
83
|
+
}, [isRunning])
|
84
|
+
|
85
|
+
return (
|
86
|
+
<div style={{ padding: '20px' }}>
|
87
|
+
<h3>LinearProgress - Barras de Progreso</h3>
|
88
|
+
|
89
|
+
<div style={{ marginBottom: '1rem' }}>
|
90
|
+
<Button
|
91
|
+
label={isRunning ? 'Pausar' : 'Reanudar'}
|
92
|
+
action={() => setIsRunning(!isRunning)}
|
93
|
+
icon={isRunning ? 'pause' : 'play_arrow'}
|
94
|
+
/>
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1.5rem' }}>
|
98
|
+
<div>
|
99
|
+
<h4>Basic Progress</h4>
|
100
|
+
<LinearProgress
|
101
|
+
value={progress}
|
102
|
+
showValue={true}
|
103
|
+
showLabel={true}
|
104
|
+
label="File Upload"
|
105
|
+
color="primary"
|
106
|
+
/>
|
107
|
+
</div>
|
108
|
+
|
109
|
+
<div>
|
110
|
+
<h4>With Buffer</h4>
|
111
|
+
<LinearProgress
|
112
|
+
value={progress * 0.7}
|
113
|
+
buffer={progress}
|
114
|
+
showValue={true}
|
115
|
+
showLabel={true}
|
116
|
+
label="Video Streaming"
|
117
|
+
color="secondary"
|
118
|
+
/>
|
119
|
+
</div>
|
120
|
+
|
121
|
+
<div>
|
122
|
+
<h4>Striped Animation</h4>
|
123
|
+
<LinearProgress
|
124
|
+
value={85}
|
125
|
+
showValue={true}
|
126
|
+
showLabel={true}
|
127
|
+
label="Processing"
|
128
|
+
color="success"
|
129
|
+
striped={true}
|
130
|
+
animated={true}
|
131
|
+
/>
|
132
|
+
</div>
|
133
|
+
|
134
|
+
<div>
|
135
|
+
<h4>Indeterminate</h4>
|
136
|
+
<LinearProgress
|
137
|
+
variant="indeterminate"
|
138
|
+
showLabel={true}
|
139
|
+
label="Loading..."
|
140
|
+
color="warning"
|
141
|
+
size="medium"
|
142
|
+
/>
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div>
|
146
|
+
<h4>With Time Estimation</h4>
|
147
|
+
<LinearProgress
|
148
|
+
value={progress}
|
149
|
+
showValue={true}
|
150
|
+
showLabel={true}
|
151
|
+
label="Large File Download"
|
152
|
+
color="error"
|
153
|
+
size="large"
|
154
|
+
showTimeEstimation={true}
|
155
|
+
/>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
)
|
160
|
+
}
|
161
|
+
|
162
|
+
/**
|
163
|
+
* Tamaños y colores
|
164
|
+
*/
|
165
|
+
export const ProgressSizesAndColors = () => (
|
166
|
+
<div style={{ padding: '20px' }}>
|
167
|
+
<h3>Tamaños</h3>
|
168
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', marginBottom: '2rem' }}>
|
169
|
+
<LinearProgress value={60} size="small" label="Small" showValue={true} />
|
170
|
+
<LinearProgress value={70} size="medium" label="Medium" showValue={true} />
|
171
|
+
<LinearProgress value={80} size="large" label="Large" showValue={true} />
|
172
|
+
</div>
|
173
|
+
|
174
|
+
<h3>Colores</h3>
|
175
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
176
|
+
<LinearProgress value={50} color="primary" label="Primary" showValue={true} />
|
177
|
+
<LinearProgress value={60} color="secondary" label="Secondary" showValue={true} />
|
178
|
+
<LinearProgress value={70} color="success" label="Success" showValue={true} />
|
179
|
+
<LinearProgress value={80} color="warning" label="Warning" showValue={true} />
|
180
|
+
<LinearProgress value={90} color="error" label="Error" showValue={true} />
|
181
|
+
</div>
|
182
|
+
</div>
|
183
|
+
)
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Estados interactivos
|
187
|
+
*/
|
188
|
+
export const InteractiveProgress = () => {
|
189
|
+
const [value, setValue] = useState(50)
|
190
|
+
|
191
|
+
return (
|
192
|
+
<div style={{ padding: '20px' }}>
|
193
|
+
<h3>Control Interactivo</h3>
|
194
|
+
|
195
|
+
<div style={{ marginBottom: '2rem' }}>
|
196
|
+
<label>
|
197
|
+
Valor: {value}%
|
198
|
+
<input
|
199
|
+
type="range"
|
200
|
+
min="0"
|
201
|
+
max="100"
|
202
|
+
value={value}
|
203
|
+
onChange={(e) => setValue(Number(e.target.value))}
|
204
|
+
style={{ width: '100%', margin: '0.5rem 0' }}
|
205
|
+
/>
|
206
|
+
</label>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem' }}>
|
210
|
+
<div style={{ textAlign: 'center' }}>
|
211
|
+
<h4>Circular</h4>
|
212
|
+
<CircularProgress
|
213
|
+
variant="determinate"
|
214
|
+
value={value}
|
215
|
+
size="xlarge"
|
216
|
+
color="primary"
|
217
|
+
showValue={true}
|
218
|
+
/>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div>
|
222
|
+
<h4>Linear</h4>
|
223
|
+
<LinearProgress
|
224
|
+
value={value}
|
225
|
+
showValue={true}
|
226
|
+
showLabel={true}
|
227
|
+
label="Interactive Progress"
|
228
|
+
color="primary"
|
229
|
+
size="large"
|
230
|
+
/>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
</div>
|
234
|
+
)
|
235
|
+
}
|
236
|
+
|
237
|
+
/**
|
238
|
+
* Todos los ejemplos
|
239
|
+
*/
|
240
|
+
export const AllExamples = () => (
|
241
|
+
<div>
|
242
|
+
<CircularProgressExamples />
|
243
|
+
<LinearProgressExamples />
|
244
|
+
<ProgressSizesAndColors />
|
245
|
+
<InteractiveProgress />
|
246
|
+
</div>
|
247
|
+
)
|