ywana-core8 0.1.102 → 0.2.1
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 +42338 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +37458 -31678
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +39634 -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 +254 -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 +6 -22
- 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
package/src/html/switch.css
CHANGED
@@ -19,182 +19,216 @@
|
|
19
19
|
color: var(--text-color);
|
20
20
|
}
|
21
21
|
|
22
|
-
|
23
|
-
.switch
|
24
|
-
|
25
|
-
|
22
|
+
/* Switch Component */
|
23
|
+
.switch {
|
24
|
+
position: relative;
|
25
|
+
display: inline-block;
|
26
|
+
cursor: pointer;
|
27
|
+
outline: none;
|
28
|
+
border-radius: 50px;
|
29
|
+
transition: all 0.2s ease;
|
26
30
|
}
|
27
31
|
|
28
|
-
.switch
|
29
|
-
|
30
|
-
|
31
|
-
color: var(--text-color-lighter);
|
32
|
+
.switch:focus {
|
33
|
+
outline: 2px solid var(--primary-color, #007bff);
|
34
|
+
outline-offset: 2px;
|
32
35
|
}
|
33
36
|
|
34
|
-
|
35
|
-
|
36
|
-
.switch-container.error .react-switch {
|
37
|
-
border: 2px solid var(--danger-color, #dc3545);
|
38
|
-
border-radius: 25px;
|
37
|
+
.switch:hover:not(.switch--disabled) {
|
38
|
+
transform: scale(1.02);
|
39
39
|
}
|
40
40
|
|
41
|
-
/*
|
42
|
-
.
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
41
|
+
/* Switch Track */
|
42
|
+
.switch__track {
|
43
|
+
width: 48px;
|
44
|
+
height: 24px;
|
45
|
+
background-color: var(--switch-off-color, #ccc);
|
46
|
+
border-radius: 50px;
|
47
|
+
position: relative;
|
48
|
+
transition: background-color 0.25s ease;
|
49
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
47
50
|
}
|
48
51
|
|
49
|
-
.
|
50
|
-
|
52
|
+
.switch--checked .switch__track {
|
53
|
+
background-color: var(--switch-on-color, #007bff);
|
51
54
|
}
|
52
55
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
56
|
+
/* Switch Handle */
|
57
|
+
.switch__handle {
|
58
|
+
position: absolute;
|
59
|
+
top: 2px;
|
60
|
+
left: 2px;
|
61
|
+
width: 18px;
|
62
|
+
height: 18px;
|
63
|
+
background-color: white;
|
64
|
+
border-radius: 50%;
|
65
|
+
transition: transform 0.25s ease, box-shadow 0.15s ease;
|
66
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
67
|
+
border: 1px solid rgba(255, 255, 255, 0.8);
|
60
68
|
}
|
61
69
|
|
62
|
-
.
|
63
|
-
|
64
|
-
align-items: center;
|
65
|
-
justify-content: center;
|
66
|
-
border-radius: 50%;
|
67
|
-
transition: background-color 0.2s ease;
|
68
|
-
cursor: pointer;
|
70
|
+
.switch--checked .switch__handle {
|
71
|
+
transform: translateX(24px);
|
69
72
|
}
|
70
73
|
|
71
|
-
.
|
72
|
-
|
74
|
+
.switch:active:not(.switch--disabled) .switch__handle {
|
75
|
+
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
|
73
76
|
}
|
74
77
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
+
/* Switch Sizes */
|
79
|
+
.switch--small .switch__track {
|
80
|
+
width: 32px;
|
81
|
+
height: 16px;
|
78
82
|
}
|
79
83
|
|
80
|
-
.
|
81
|
-
|
82
|
-
|
84
|
+
.switch--small .switch__handle {
|
85
|
+
width: 12px;
|
86
|
+
height: 12px;
|
87
|
+
top: 1px;
|
88
|
+
left: 1px;
|
83
89
|
}
|
84
90
|
|
85
|
-
.
|
86
|
-
|
91
|
+
.switch--small.switch--checked .switch__handle {
|
92
|
+
transform: translateX(16px);
|
87
93
|
}
|
88
94
|
|
89
|
-
.
|
90
|
-
|
95
|
+
.switch--normal .switch__track {
|
96
|
+
width: 48px;
|
97
|
+
height: 24px;
|
91
98
|
}
|
92
99
|
|
93
|
-
.
|
94
|
-
|
100
|
+
.switch--normal .switch__handle {
|
101
|
+
width: 18px;
|
102
|
+
height: 18px;
|
103
|
+
top: 2px;
|
104
|
+
left: 2px;
|
95
105
|
}
|
96
106
|
|
97
|
-
.
|
98
|
-
|
107
|
+
.switch--normal.switch--checked .switch__handle {
|
108
|
+
transform: translateX(24px);
|
99
109
|
}
|
100
110
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
font-size: 0.8rem;
|
105
|
-
margin-top: 0.25rem;
|
106
|
-
display: block;
|
111
|
+
.switch--large .switch__track {
|
112
|
+
width: 56px;
|
113
|
+
height: 28px;
|
107
114
|
}
|
108
115
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
116
|
+
.switch--large .switch__handle {
|
117
|
+
width: 22px;
|
118
|
+
height: 22px;
|
119
|
+
top: 2px;
|
120
|
+
left: 2px;
|
113
121
|
}
|
114
122
|
|
115
|
-
.
|
116
|
-
|
123
|
+
.switch--large.switch--checked .switch__handle {
|
124
|
+
transform: translateX(28px);
|
117
125
|
}
|
118
126
|
|
119
|
-
|
120
|
-
|
127
|
+
/* Switch States */
|
128
|
+
.switch--disabled {
|
129
|
+
cursor: not-allowed;
|
130
|
+
opacity: 0.6;
|
121
131
|
}
|
122
132
|
|
123
|
-
.
|
124
|
-
|
133
|
+
.switch--disabled:hover {
|
134
|
+
transform: none;
|
125
135
|
}
|
126
136
|
|
127
|
-
|
128
|
-
|
129
|
-
outline: 2px solid var(--primary-color, #2693e6);
|
130
|
-
outline-offset: 2px;
|
137
|
+
.switch--readonly {
|
138
|
+
cursor: default;
|
131
139
|
}
|
132
140
|
|
133
|
-
|
134
|
-
|
135
|
-
transition: background-color 0.25s ease !important;
|
141
|
+
.switch--readonly:hover {
|
142
|
+
transform: none;
|
136
143
|
}
|
137
144
|
|
138
|
-
|
139
|
-
|
140
|
-
box-shadow: 0
|
141
|
-
border: 1px solid rgba(255, 255, 255, 0.8) !important;
|
145
|
+
.switch--error .switch__track {
|
146
|
+
border-color: var(--danger-color, #dc3545);
|
147
|
+
box-shadow: 0 0 0 1px var(--danger-color, #dc3545);
|
142
148
|
}
|
143
149
|
|
144
|
-
/*
|
145
|
-
.
|
146
|
-
|
150
|
+
/* Error message styles */
|
151
|
+
.error-message {
|
152
|
+
color: var(--danger-color, #dc3545);
|
153
|
+
font-size: 0.8rem;
|
154
|
+
margin-top: 0.25rem;
|
155
|
+
display: block;
|
147
156
|
}
|
148
157
|
|
149
|
-
|
150
|
-
|
158
|
+
/* Container States */
|
159
|
+
.switch-wrapper.disabled,
|
160
|
+
.switch-container.disabled {
|
161
|
+
opacity: 0.6;
|
162
|
+
cursor: not-allowed;
|
151
163
|
}
|
152
164
|
|
153
|
-
.
|
154
|
-
|
165
|
+
.switch-wrapper.disabled .switch-label,
|
166
|
+
.switch-container.disabled .switch-label {
|
167
|
+
cursor: not-allowed;
|
168
|
+
color: var(--text-color-lighter);
|
155
169
|
}
|
156
170
|
|
157
171
|
/* Responsive adjustments */
|
158
172
|
@media (max-width: 768px) {
|
159
|
-
.switch-label
|
160
|
-
.switch2-label {
|
173
|
+
.switch-label {
|
161
174
|
font-size: 0.9rem;
|
162
175
|
gap: 0.5rem;
|
163
176
|
}
|
164
177
|
|
165
178
|
.switch-wrapper,
|
166
|
-
.switch-container
|
167
|
-
.switch2-wrapper,
|
168
|
-
.switch2-container {
|
179
|
+
.switch-container {
|
169
180
|
gap: 0.25rem;
|
170
181
|
}
|
182
|
+
|
183
|
+
/* Slightly larger touch targets on mobile */
|
184
|
+
.switch--small .switch__track {
|
185
|
+
width: 36px;
|
186
|
+
height: 18px;
|
187
|
+
}
|
188
|
+
|
189
|
+
.switch--small .switch__handle {
|
190
|
+
width: 14px;
|
191
|
+
height: 14px;
|
192
|
+
}
|
171
193
|
}
|
172
194
|
|
173
195
|
/* High contrast mode support */
|
174
196
|
@media (prefers-contrast: high) {
|
175
|
-
.
|
197
|
+
.switch:focus {
|
176
198
|
outline-width: 3px;
|
177
199
|
}
|
178
200
|
|
179
|
-
.
|
180
|
-
|
201
|
+
.switch__track {
|
202
|
+
border-width: 2px;
|
203
|
+
}
|
204
|
+
|
205
|
+
.switch__handle {
|
206
|
+
border-width: 2px;
|
207
|
+
border-color: #000;
|
181
208
|
}
|
182
209
|
}
|
183
210
|
|
184
211
|
/* Reduced motion support */
|
185
212
|
@media (prefers-reduced-motion: reduce) {
|
186
|
-
.
|
213
|
+
.switch,
|
214
|
+
.switch__track,
|
215
|
+
.switch__handle {
|
187
216
|
transition: none;
|
188
217
|
}
|
189
|
-
|
190
|
-
.react-switch * {
|
191
|
-
transition: none !important;
|
192
|
-
}
|
193
218
|
}
|
194
219
|
|
195
220
|
/* Dark theme support */
|
196
221
|
@media (prefers-color-scheme: dark) {
|
197
|
-
.
|
198
|
-
background-color:
|
222
|
+
.switch__handle {
|
223
|
+
background-color: #f8f9fa;
|
224
|
+
border-color: rgba(255, 255, 255, 0.2);
|
225
|
+
}
|
226
|
+
|
227
|
+
.switch__track {
|
228
|
+
border-color: rgba(255, 255, 255, 0.2);
|
229
|
+
}
|
230
|
+
|
231
|
+
.switch-label {
|
232
|
+
color: var(--text-color-dark, #e2e8f0);
|
199
233
|
}
|
200
234
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
|
-
import { Switch
|
2
|
+
import { Switch } from './switch'
|
3
3
|
import { ExampleLayout, ExampleSection, ExampleSubsection, CodeSnippet } from './ExampleLayout'
|
4
4
|
|
5
5
|
/**
|
@@ -265,27 +265,30 @@ export const SwitchExamples = () => {
|
|
265
265
|
</div>
|
266
266
|
</section>
|
267
267
|
|
268
|
-
{/*
|
268
|
+
{/* Switch con colores personalizados */}
|
269
269
|
<section style={{ marginBottom: '2rem' }}>
|
270
|
-
<h3>
|
270
|
+
<h3>Switch con Colores Personalizados</h3>
|
271
271
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem' }}>
|
272
|
-
<
|
273
|
-
id="analytics"
|
274
|
-
label="Análisis de uso"
|
272
|
+
<Switch
|
273
|
+
id="analytics"
|
274
|
+
label="Análisis de uso"
|
275
275
|
checked={settings.analytics}
|
276
276
|
onChange={handleChange}
|
277
|
+
onColor="#28a745"
|
277
278
|
/>
|
278
|
-
<
|
279
|
-
id="marketing"
|
280
|
-
label="Comunicaciones de marketing"
|
279
|
+
<Switch
|
280
|
+
id="marketing"
|
281
|
+
label="Comunicaciones de marketing"
|
281
282
|
checked={settings.marketing}
|
282
283
|
onChange={handleChange}
|
284
|
+
onColor="#fd7e14"
|
283
285
|
/>
|
284
|
-
<
|
285
|
-
id="location"
|
286
|
-
label="Servicios de ubicación"
|
286
|
+
<Switch
|
287
|
+
id="location"
|
288
|
+
label="Servicios de ubicación"
|
287
289
|
checked={settings.location}
|
288
290
|
onChange={handleChange}
|
291
|
+
onColor="#6f42c1"
|
289
292
|
/>
|
290
293
|
</div>
|
291
294
|
</section>
|
@@ -302,11 +305,12 @@ export const SwitchExamples = () => {
|
|
302
305
|
checked={true}
|
303
306
|
onChange={() => {}}
|
304
307
|
/>
|
305
|
-
<
|
306
|
-
id="size2-small"
|
308
|
+
<Switch
|
309
|
+
id="size2-small"
|
307
310
|
size="small"
|
308
311
|
checked={true}
|
309
312
|
onChange={() => {}}
|
313
|
+
onColor="#28a745"
|
310
314
|
/>
|
311
315
|
</div>
|
312
316
|
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
|
@@ -317,11 +321,12 @@ export const SwitchExamples = () => {
|
|
317
321
|
checked={true}
|
318
322
|
onChange={() => {}}
|
319
323
|
/>
|
320
|
-
<
|
321
|
-
id="size2-normal"
|
324
|
+
<Switch
|
325
|
+
id="size2-normal"
|
322
326
|
size="normal"
|
323
327
|
checked={true}
|
324
328
|
onChange={() => {}}
|
329
|
+
onColor="#fd7e14"
|
325
330
|
/>
|
326
331
|
</div>
|
327
332
|
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}>
|
@@ -332,11 +337,12 @@ export const SwitchExamples = () => {
|
|
332
337
|
checked={true}
|
333
338
|
onChange={() => {}}
|
334
339
|
/>
|
335
|
-
<
|
336
|
-
id="size2-large"
|
340
|
+
<Switch
|
341
|
+
id="size2-large"
|
337
342
|
size="large"
|
338
343
|
checked={true}
|
339
344
|
onChange={() => {}}
|
345
|
+
onColor="#6f42c1"
|
340
346
|
/>
|
341
347
|
</div>
|
342
348
|
</div>
|
@@ -353,26 +359,27 @@ export const SwitchExamples = () => {
|
|
353
359
|
disabled={true}
|
354
360
|
onChange={handleChange}
|
355
361
|
/>
|
356
|
-
<
|
357
|
-
id="readonly"
|
358
|
-
label="
|
362
|
+
<Switch
|
363
|
+
id="readonly"
|
364
|
+
label="Switch solo lectura"
|
359
365
|
checked={true}
|
360
366
|
readOnly={true}
|
361
367
|
onChange={handleChange}
|
362
368
|
/>
|
363
|
-
<Switch
|
364
|
-
id="error-switch"
|
365
|
-
label="Switch con error"
|
369
|
+
<Switch
|
370
|
+
id="error-switch"
|
371
|
+
label="Switch con error"
|
366
372
|
checked={settings.notifications}
|
367
373
|
error={validationErrors.notifications}
|
368
374
|
onChange={handleChange}
|
369
375
|
/>
|
370
|
-
<
|
371
|
-
id="error-switch2"
|
372
|
-
label="
|
376
|
+
<Switch
|
377
|
+
id="error-switch2"
|
378
|
+
label="Switch con error personalizado"
|
373
379
|
checked={settings.analytics}
|
374
380
|
error={validationErrors.analytics}
|
375
381
|
onChange={handleChange}
|
382
|
+
onColor="#dc3545"
|
376
383
|
/>
|
377
384
|
</div>
|
378
385
|
</section>
|
@@ -388,19 +395,21 @@ export const SwitchExamples = () => {
|
|
388
395
|
}}>
|
389
396
|
<h4>Conectividad</h4>
|
390
397
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', marginBottom: '1.5rem' }}>
|
391
|
-
<
|
392
|
-
id="wifi"
|
393
|
-
label="Wi-Fi"
|
398
|
+
<Switch
|
399
|
+
id="wifi"
|
400
|
+
label="Wi-Fi"
|
394
401
|
checked={settings.wifi}
|
395
402
|
onChange={handleChange}
|
396
403
|
ariaLabel="Activar o desactivar conexión Wi-Fi"
|
404
|
+
onColor="#28a745"
|
397
405
|
/>
|
398
|
-
<
|
399
|
-
id="bluetooth"
|
400
|
-
label="Bluetooth"
|
406
|
+
<Switch
|
407
|
+
id="bluetooth"
|
408
|
+
label="Bluetooth"
|
401
409
|
checked={settings.bluetooth}
|
402
410
|
onChange={handleChange}
|
403
411
|
ariaLabel="Activar o desactivar Bluetooth"
|
412
|
+
onColor="#17a2b8"
|
404
413
|
/>
|
405
414
|
</div>
|
406
415
|
|
@@ -489,10 +498,11 @@ export const SwitchExamples = () => {
|
|
489
498
|
label="Switch accesible 1"
|
490
499
|
onChange={handleChange}
|
491
500
|
/>
|
492
|
-
<
|
493
|
-
id="a11y2"
|
494
|
-
label="
|
501
|
+
<Switch
|
502
|
+
id="a11y2"
|
503
|
+
label="Switch accesible 2"
|
495
504
|
onChange={handleChange}
|
505
|
+
onColor="#6f42c1"
|
496
506
|
/>
|
497
507
|
<Switch
|
498
508
|
id="a11y3"
|