ywana-core8 0.1.75 → 0.1.77
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/ACCORDION_EVALUATION.md +583 -0
- package/CHECKBOX_EVALUATION.md +273 -0
- package/CHIP_EVALUATION.md +542 -0
- package/COLOR_EVALUATION.md +524 -0
- package/COMPONENTS_EVALUATION.md +477 -0
- package/FORM_EVALUATION.md +459 -0
- package/HEADER_EVALUATION.md +436 -0
- package/ICON_EVALUATION.md +254 -0
- package/LIST_EVALUATION.md +574 -0
- package/PROGRESS_EVALUATION.md +450 -0
- package/RADIO_EVALUATION.md +439 -0
- package/RADIO_VISUAL_FIX.md +183 -0
- package/SECTION_IMPROVEMENTS.md +153 -0
- package/SWITCH_EVALUATION.md +335 -0
- package/SWITCH_VISUAL_FIX.md +232 -0
- package/TAB_EVALUATION.md +626 -0
- package/TEXTFIELD_EVALUATION.md +747 -0
- package/TOOLTIP_FIX.md +157 -0
- package/TREE_EVALUATION.md +708 -0
- package/dist/index.cjs +10893 -1969
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +7768 -1096
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +10921 -2005
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +10893 -1969
- package/dist/index.umd.js.map +1 -1
- package/jest.config.js +24 -0
- package/package.json +10 -1
- package/src/html/accordion.css +208 -4
- package/src/html/accordion.example.js +390 -0
- package/src/html/accordion.js +284 -28
- package/src/html/accordion.unit.test.js +334 -0
- package/src/html/button.css +157 -16
- package/src/html/button.example.js +374 -0
- package/src/html/button.js +240 -60
- package/src/html/button.test.js +422 -0
- package/src/html/checkbox.css +74 -2
- package/src/html/checkbox.example.js +316 -0
- package/src/html/checkbox.js +113 -26
- package/src/html/checkbox.test.js +285 -0
- package/src/html/chip.css +230 -19
- package/src/html/chip.example.js +355 -0
- package/src/html/chip.js +321 -25
- package/src/html/chip.test.js +425 -0
- package/src/html/color.css +435 -6
- package/src/html/color.example.js +527 -0
- package/src/html/color.js +458 -9
- package/src/html/color.test.js +362 -4
- package/src/html/components.example.js +492 -0
- package/src/html/components_enhanced.test.js +581 -0
- package/src/html/form.css +70 -3
- package/src/html/form.example.js +385 -0
- package/src/html/form.js +232 -34
- package/src/html/form.test.js +369 -0
- package/src/html/header2.css +264 -0
- package/src/html/header2.example.js +411 -0
- package/src/html/header2.js +203 -0
- package/src/html/header2.test.js +377 -0
- package/src/html/icon.css +20 -2
- package/src/html/icon.example.js +268 -0
- package/src/html/icon.js +86 -16
- package/src/html/icon.test.js +231 -0
- package/src/html/index.js +4 -1
- package/src/html/list.css +393 -1
- package/src/html/list.example.js +404 -0
- package/src/html/list.js +583 -40
- package/src/html/list.test.js +383 -0
- package/src/html/progress.css +707 -17
- package/src/html/progress.example.js +424 -0
- package/src/html/progress.js +906 -9
- package/src/html/progress.test.js +313 -0
- package/src/html/property.css +399 -0
- package/src/html/property.example.js +553 -0
- package/src/html/property.js +393 -15
- package/src/html/property.test.js +351 -2
- package/src/html/radio-visual-test.js +289 -0
- package/src/html/radio.css +137 -11
- package/src/html/radio.example.js +389 -0
- package/src/html/radio.js +234 -10
- package/src/html/radio.test.js +318 -0
- package/src/html/section.example.js +99 -0
- package/src/html/section.js +40 -3
- package/src/html/section.test.js +131 -0
- package/src/html/selector.css +329 -3
- package/src/html/selector.js +369 -23
- package/src/html/switch-debug.js +197 -0
- package/src/html/switch-test-visual.js +294 -0
- package/src/html/switch.css +200 -0
- package/src/html/switch.example.js +461 -0
- package/src/html/switch.js +283 -23
- package/src/html/switch.test.js +355 -0
- package/src/html/tab.css +289 -0
- package/src/html/tab.example.js +446 -0
- package/src/html/tab.js +387 -22
- package/src/html/tab_enhanced.js +378 -0
- package/src/html/tab_enhanced.test.js +504 -0
- package/src/html/table2.css +576 -0
- package/src/html/table2.example.js +703 -0
- package/src/html/table2.js +1252 -0
- package/src/html/table2.migration.md +328 -0
- package/src/html/table2.test.js +582 -0
- package/src/html/text.css +375 -0
- package/src/html/text.js +311 -20
- package/src/html/textfield2.css +841 -0
- package/src/html/textfield2.example.js +1370 -0
- package/src/html/textfield2.js +1143 -0
- package/src/html/textfield2.test.js +950 -0
- package/src/html/thumbnail.css +289 -2
- package/src/html/thumbnail.js +214 -9
- package/src/html/tokenfield.css +449 -1
- package/src/html/tokenfield.example.js +503 -0
- package/src/html/tokenfield.js +561 -56
- package/src/html/tokenfield.test.js +423 -0
- package/src/html/tooltip-positioning-demo.js +187 -0
- package/src/html/tooltip.css +25 -2
- package/src/html/tree.css +240 -10
- package/src/html/tree.example.js +475 -0
- package/src/html/tree.js +714 -28
- package/src/html/tree_enhanced.test.js +495 -0
- package/table2.test.js +454 -0
- package/src/html/button.tsx +0 -38
@@ -0,0 +1,294 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import RSwitch from 'react-switch'
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Componente de prueba visual para diagnosticar problemas con react-switch
|
6
|
+
*/
|
7
|
+
export const SwitchTestVisual = () => {
|
8
|
+
const [checked, setChecked] = useState(false)
|
9
|
+
|
10
|
+
return (
|
11
|
+
<div style={{
|
12
|
+
padding: '2rem',
|
13
|
+
maxWidth: '800px',
|
14
|
+
fontFamily: 'Arial, sans-serif'
|
15
|
+
}}>
|
16
|
+
<h1>🔧 Diagnóstico Visual de Switch</h1>
|
17
|
+
|
18
|
+
<div style={{
|
19
|
+
background: '#fff3cd',
|
20
|
+
padding: '1rem',
|
21
|
+
borderRadius: '8px',
|
22
|
+
border: '1px solid #ffeaa7',
|
23
|
+
marginBottom: '2rem'
|
24
|
+
}}>
|
25
|
+
<h3>🎯 Objetivo</h3>
|
26
|
+
<p>Este componente usa react-switch directamente con configuraciones optimizadas para verificar que se vea correctamente.</p>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
{/* Prueba básica */}
|
30
|
+
<section style={{ marginBottom: '2rem' }}>
|
31
|
+
<h3>Prueba Básica</h3>
|
32
|
+
<div style={{
|
33
|
+
background: '#ffffff',
|
34
|
+
padding: '2rem',
|
35
|
+
borderRadius: '8px',
|
36
|
+
border: '2px solid #007bff',
|
37
|
+
display: 'flex',
|
38
|
+
alignItems: 'center',
|
39
|
+
gap: '1rem'
|
40
|
+
}}>
|
41
|
+
<span style={{ fontSize: '1.1rem', fontWeight: 'bold' }}>
|
42
|
+
Estado: {checked ? '🟢 ON' : '🔴 OFF'}
|
43
|
+
</span>
|
44
|
+
<RSwitch
|
45
|
+
checked={checked}
|
46
|
+
onChange={setChecked}
|
47
|
+
onColor="#007bff"
|
48
|
+
offColor="#6c757d"
|
49
|
+
onHandleColor="#ffffff"
|
50
|
+
offHandleColor="#ffffff"
|
51
|
+
handleDiameter={20}
|
52
|
+
uncheckedIcon={false}
|
53
|
+
checkedIcon={false}
|
54
|
+
boxShadow="0px 1px 5px rgba(0, 0, 0, 0.6)"
|
55
|
+
activeBoxShadow="0px 0px 1px 10px rgba(0, 0, 0, 0.2)"
|
56
|
+
height={24}
|
57
|
+
width={52}
|
58
|
+
/>
|
59
|
+
<button
|
60
|
+
onClick={() => setChecked(!checked)}
|
61
|
+
style={{
|
62
|
+
padding: '0.5rem 1rem',
|
63
|
+
backgroundColor: '#28a745',
|
64
|
+
color: 'white',
|
65
|
+
border: 'none',
|
66
|
+
borderRadius: '4px',
|
67
|
+
cursor: 'pointer'
|
68
|
+
}}
|
69
|
+
>
|
70
|
+
Toggle
|
71
|
+
</button>
|
72
|
+
</div>
|
73
|
+
</section>
|
74
|
+
|
75
|
+
{/* Diferentes configuraciones */}
|
76
|
+
<section style={{ marginBottom: '2rem' }}>
|
77
|
+
<h3>Diferentes Configuraciones</h3>
|
78
|
+
<div style={{
|
79
|
+
background: '#ffffff',
|
80
|
+
padding: '1.5rem',
|
81
|
+
borderRadius: '8px',
|
82
|
+
border: '1px solid #dee2e6'
|
83
|
+
}}>
|
84
|
+
<div style={{
|
85
|
+
display: 'grid',
|
86
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(250px, 1fr))',
|
87
|
+
gap: '1.5rem'
|
88
|
+
}}>
|
89
|
+
{/* Switch 1: Configuración original */}
|
90
|
+
<div style={{ textAlign: 'center' }}>
|
91
|
+
<h4>Configuración Original</h4>
|
92
|
+
<RSwitch
|
93
|
+
checked={true}
|
94
|
+
onChange={() => {}}
|
95
|
+
onColor="#86d3ff"
|
96
|
+
onHandleColor="#2693e6"
|
97
|
+
handleDiameter={30}
|
98
|
+
uncheckedIcon={false}
|
99
|
+
checkedIcon={false}
|
100
|
+
boxShadow="0px 1px 5px rgba(0, 0, 0, 0.6)"
|
101
|
+
activeBoxShadow="0px 0px 1px 10px rgba(0, 0, 0, 0.2)"
|
102
|
+
height={20}
|
103
|
+
width={48}
|
104
|
+
/>
|
105
|
+
<p style={{ fontSize: '0.8rem', color: '#666', marginTop: '0.5rem' }}>
|
106
|
+
onColor: #86d3ff<br/>
|
107
|
+
handleColor: #2693e6
|
108
|
+
</p>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
{/* Switch 2: Configuración mejorada */}
|
112
|
+
<div style={{ textAlign: 'center' }}>
|
113
|
+
<h4>Configuración Mejorada</h4>
|
114
|
+
<RSwitch
|
115
|
+
checked={true}
|
116
|
+
onChange={() => {}}
|
117
|
+
onColor="#007bff"
|
118
|
+
offColor="#6c757d"
|
119
|
+
onHandleColor="#ffffff"
|
120
|
+
offHandleColor="#ffffff"
|
121
|
+
handleDiameter={20}
|
122
|
+
uncheckedIcon={false}
|
123
|
+
checkedIcon={false}
|
124
|
+
boxShadow="0px 1px 3px rgba(0, 0, 0, 0.3)"
|
125
|
+
activeBoxShadow="0px 0px 0px 2px rgba(0, 123, 255, 0.25)"
|
126
|
+
height={24}
|
127
|
+
width={52}
|
128
|
+
/>
|
129
|
+
<p style={{ fontSize: '0.8rem', color: '#666', marginTop: '0.5rem' }}>
|
130
|
+
onColor: #007bff<br/>
|
131
|
+
handleColor: #ffffff
|
132
|
+
</p>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
{/* Switch 3: Configuración simple */}
|
136
|
+
<div style={{ textAlign: 'center' }}>
|
137
|
+
<h4>Configuración Simple</h4>
|
138
|
+
<RSwitch
|
139
|
+
checked={true}
|
140
|
+
onChange={() => {}}
|
141
|
+
onColor="#28a745"
|
142
|
+
offColor="#dc3545"
|
143
|
+
height={20}
|
144
|
+
width={40}
|
145
|
+
/>
|
146
|
+
<p style={{ fontSize: '0.8rem', color: '#666', marginTop: '0.5rem' }}>
|
147
|
+
Configuración mínima<br/>
|
148
|
+
Verde/Rojo
|
149
|
+
</p>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
</section>
|
154
|
+
|
155
|
+
{/* Estados ON/OFF */}
|
156
|
+
<section style={{ marginBottom: '2rem' }}>
|
157
|
+
<h3>Estados ON/OFF</h3>
|
158
|
+
<div style={{
|
159
|
+
background: '#ffffff',
|
160
|
+
padding: '1.5rem',
|
161
|
+
borderRadius: '8px',
|
162
|
+
border: '1px solid #dee2e6'
|
163
|
+
}}>
|
164
|
+
<div style={{
|
165
|
+
display: 'grid',
|
166
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(200px, 1fr))',
|
167
|
+
gap: '1rem'
|
168
|
+
}}>
|
169
|
+
<div style={{ textAlign: 'center', padding: '1rem', background: '#f8f9fa', borderRadius: '4px' }}>
|
170
|
+
<h4>OFF</h4>
|
171
|
+
<RSwitch
|
172
|
+
checked={false}
|
173
|
+
onChange={() => {}}
|
174
|
+
onColor="#007bff"
|
175
|
+
offColor="#6c757d"
|
176
|
+
onHandleColor="#ffffff"
|
177
|
+
offHandleColor="#ffffff"
|
178
|
+
handleDiameter={18}
|
179
|
+
uncheckedIcon={false}
|
180
|
+
checkedIcon={false}
|
181
|
+
height={22}
|
182
|
+
width={48}
|
183
|
+
/>
|
184
|
+
</div>
|
185
|
+
<div style={{ textAlign: 'center', padding: '1rem', background: '#f8f9fa', borderRadius: '4px' }}>
|
186
|
+
<h4>ON</h4>
|
187
|
+
<RSwitch
|
188
|
+
checked={true}
|
189
|
+
onChange={() => {}}
|
190
|
+
onColor="#007bff"
|
191
|
+
offColor="#6c757d"
|
192
|
+
onHandleColor="#ffffff"
|
193
|
+
offHandleColor="#ffffff"
|
194
|
+
handleDiameter={18}
|
195
|
+
uncheckedIcon={false}
|
196
|
+
checkedIcon={false}
|
197
|
+
height={22}
|
198
|
+
width={48}
|
199
|
+
/>
|
200
|
+
</div>
|
201
|
+
<div style={{ textAlign: 'center', padding: '1rem', background: '#f8f9fa', borderRadius: '4px' }}>
|
202
|
+
<h4>Disabled OFF</h4>
|
203
|
+
<RSwitch
|
204
|
+
checked={false}
|
205
|
+
onChange={() => {}}
|
206
|
+
disabled={true}
|
207
|
+
onColor="#007bff"
|
208
|
+
offColor="#6c757d"
|
209
|
+
onHandleColor="#ffffff"
|
210
|
+
offHandleColor="#ffffff"
|
211
|
+
handleDiameter={18}
|
212
|
+
uncheckedIcon={false}
|
213
|
+
checkedIcon={false}
|
214
|
+
height={22}
|
215
|
+
width={48}
|
216
|
+
/>
|
217
|
+
</div>
|
218
|
+
<div style={{ textAlign: 'center', padding: '1rem', background: '#f8f9fa', borderRadius: '4px' }}>
|
219
|
+
<h4>Disabled ON</h4>
|
220
|
+
<RSwitch
|
221
|
+
checked={true}
|
222
|
+
onChange={() => {}}
|
223
|
+
disabled={true}
|
224
|
+
onColor="#007bff"
|
225
|
+
offColor="#6c757d"
|
226
|
+
onHandleColor="#ffffff"
|
227
|
+
offHandleColor="#ffffff"
|
228
|
+
handleDiameter={18}
|
229
|
+
uncheckedIcon={false}
|
230
|
+
checkedIcon={false}
|
231
|
+
height={22}
|
232
|
+
width={48}
|
233
|
+
/>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
</section>
|
238
|
+
|
239
|
+
{/* Información de diagnóstico */}
|
240
|
+
<section>
|
241
|
+
<h3>📋 Información de Diagnóstico</h3>
|
242
|
+
<div style={{
|
243
|
+
background: '#e9ecef',
|
244
|
+
padding: '1.5rem',
|
245
|
+
borderRadius: '8px',
|
246
|
+
border: '1px solid #adb5bd'
|
247
|
+
}}>
|
248
|
+
<h4>¿Qué deberías ver?</h4>
|
249
|
+
<ul style={{ marginBottom: '1rem' }}>
|
250
|
+
<li><strong>Switch OFF:</strong> Fondo gris oscuro, handle blanco a la izquierda</li>
|
251
|
+
<li><strong>Switch ON:</strong> Fondo azul, handle blanco a la derecha</li>
|
252
|
+
<li><strong>Handle:</strong> Círculo blanco que se desliza suavemente</li>
|
253
|
+
<li><strong>Transición:</strong> Animación fluida al cambiar estado</li>
|
254
|
+
</ul>
|
255
|
+
|
256
|
+
<h4>Si solo ves un círculo gris con borde:</h4>
|
257
|
+
<ul style={{ marginBottom: '1rem' }}>
|
258
|
+
<li>El problema podría ser CSS conflictivo en el proyecto</li>
|
259
|
+
<li>Verifica la consola del navegador por errores</li>
|
260
|
+
<li>Asegúrate de que react-switch se importa correctamente</li>
|
261
|
+
<li>Revisa si hay estilos globales que afecten los elementos div</li>
|
262
|
+
</ul>
|
263
|
+
|
264
|
+
<h4>Versión de react-switch:</h4>
|
265
|
+
<p style={{
|
266
|
+
background: '#ffffff',
|
267
|
+
padding: '0.5rem',
|
268
|
+
borderRadius: '4px',
|
269
|
+
fontFamily: 'monospace',
|
270
|
+
margin: '0.5rem 0'
|
271
|
+
}}>
|
272
|
+
Ejecuta: <code>npm list react-switch</code>
|
273
|
+
</p>
|
274
|
+
|
275
|
+
<h4>Estado actual del switch interactivo:</h4>
|
276
|
+
<pre style={{
|
277
|
+
background: '#ffffff',
|
278
|
+
padding: '1rem',
|
279
|
+
borderRadius: '4px',
|
280
|
+
fontFamily: 'monospace',
|
281
|
+
overflow: 'auto'
|
282
|
+
}}>
|
283
|
+
{JSON.stringify({
|
284
|
+
checked,
|
285
|
+
timestamp: new Date().toISOString()
|
286
|
+
}, null, 2)}
|
287
|
+
</pre>
|
288
|
+
</div>
|
289
|
+
</section>
|
290
|
+
</div>
|
291
|
+
)
|
292
|
+
}
|
293
|
+
|
294
|
+
export default SwitchTestVisual
|
package/src/html/switch.css
CHANGED
@@ -0,0 +1,200 @@
|
|
1
|
+
/* Switch Container Styles */
|
2
|
+
.switch-wrapper,
|
3
|
+
.switch-container {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
gap: 0.5rem;
|
7
|
+
}
|
8
|
+
|
9
|
+
.switch-container {
|
10
|
+
align-items: flex-start;
|
11
|
+
}
|
12
|
+
|
13
|
+
.switch-label {
|
14
|
+
display: flex;
|
15
|
+
align-items: center;
|
16
|
+
gap: 0.75rem;
|
17
|
+
cursor: pointer;
|
18
|
+
font-size: 1rem;
|
19
|
+
color: var(--text-color);
|
20
|
+
}
|
21
|
+
|
22
|
+
.switch-wrapper.disabled,
|
23
|
+
.switch-container.disabled {
|
24
|
+
opacity: 0.6;
|
25
|
+
cursor: not-allowed;
|
26
|
+
}
|
27
|
+
|
28
|
+
.switch-wrapper.disabled .switch-label,
|
29
|
+
.switch-container.disabled .switch-label {
|
30
|
+
cursor: not-allowed;
|
31
|
+
color: var(--text-color-lighter);
|
32
|
+
}
|
33
|
+
|
34
|
+
/* Error states */
|
35
|
+
.switch-wrapper.error .react-switch,
|
36
|
+
.switch-container.error .react-switch {
|
37
|
+
border: 2px solid var(--danger-color, #dc3545);
|
38
|
+
border-radius: 25px;
|
39
|
+
}
|
40
|
+
|
41
|
+
/* Switch2 Styles */
|
42
|
+
.switch2-wrapper,
|
43
|
+
.switch2-container {
|
44
|
+
display: flex;
|
45
|
+
flex-direction: column;
|
46
|
+
gap: 0.5rem;
|
47
|
+
}
|
48
|
+
|
49
|
+
.switch2-container {
|
50
|
+
align-items: flex-start;
|
51
|
+
}
|
52
|
+
|
53
|
+
.switch2-label {
|
54
|
+
display: flex;
|
55
|
+
align-items: center;
|
56
|
+
gap: 0.75rem;
|
57
|
+
cursor: pointer;
|
58
|
+
font-size: 1rem;
|
59
|
+
color: var(--text-color);
|
60
|
+
}
|
61
|
+
|
62
|
+
.switch2 {
|
63
|
+
display: inline-flex;
|
64
|
+
align-items: center;
|
65
|
+
justify-content: center;
|
66
|
+
border-radius: 50%;
|
67
|
+
transition: background-color 0.2s ease;
|
68
|
+
cursor: pointer;
|
69
|
+
}
|
70
|
+
|
71
|
+
.switch2:hover {
|
72
|
+
background-color: rgba(0, 0, 0, 0.04);
|
73
|
+
}
|
74
|
+
|
75
|
+
.switch2:focus {
|
76
|
+
outline: 2px solid var(--primary-color, #2693e6);
|
77
|
+
outline-offset: 2px;
|
78
|
+
}
|
79
|
+
|
80
|
+
.switch2.disabled {
|
81
|
+
cursor: not-allowed;
|
82
|
+
opacity: 0.6;
|
83
|
+
}
|
84
|
+
|
85
|
+
.switch2.disabled:hover {
|
86
|
+
background-color: transparent;
|
87
|
+
}
|
88
|
+
|
89
|
+
.switch2.readonly {
|
90
|
+
cursor: default;
|
91
|
+
}
|
92
|
+
|
93
|
+
.switch2.readonly:hover {
|
94
|
+
background-color: transparent;
|
95
|
+
}
|
96
|
+
|
97
|
+
.switch2.error {
|
98
|
+
color: var(--danger-color, #dc3545);
|
99
|
+
}
|
100
|
+
|
101
|
+
/* Error message styles */
|
102
|
+
.error-message {
|
103
|
+
color: var(--danger-color, #dc3545);
|
104
|
+
font-size: 0.8rem;
|
105
|
+
margin-top: 0.25rem;
|
106
|
+
display: block;
|
107
|
+
}
|
108
|
+
|
109
|
+
/* React Switch customizations */
|
110
|
+
.react-switch {
|
111
|
+
vertical-align: middle;
|
112
|
+
border: none !important;
|
113
|
+
}
|
114
|
+
|
115
|
+
.react-switch > div {
|
116
|
+
border: 1px solid rgba(0, 0, 0, 0.1) !important;
|
117
|
+
}
|
118
|
+
|
119
|
+
.react-switch.error {
|
120
|
+
box-shadow: 0 0 0 2px var(--danger-color, #dc3545) !important;
|
121
|
+
}
|
122
|
+
|
123
|
+
.react-switch.error > div {
|
124
|
+
border-color: var(--danger-color, #dc3545) !important;
|
125
|
+
}
|
126
|
+
|
127
|
+
/* Focus styles for react-switch */
|
128
|
+
.react-switch:focus {
|
129
|
+
outline: 2px solid var(--primary-color, #2693e6);
|
130
|
+
outline-offset: 2px;
|
131
|
+
}
|
132
|
+
|
133
|
+
/* Ensure proper styling for react-switch background */
|
134
|
+
.react-switch > div[style*="background"] {
|
135
|
+
transition: background-color 0.25s ease !important;
|
136
|
+
}
|
137
|
+
|
138
|
+
/* Handle styling */
|
139
|
+
.react-switch > div > div {
|
140
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
|
141
|
+
border: 1px solid rgba(255, 255, 255, 0.8) !important;
|
142
|
+
}
|
143
|
+
|
144
|
+
/* Size variants for Switch2 */
|
145
|
+
.switch2.small {
|
146
|
+
padding: 0.25rem;
|
147
|
+
}
|
148
|
+
|
149
|
+
.switch2.normal {
|
150
|
+
padding: 0.375rem;
|
151
|
+
}
|
152
|
+
|
153
|
+
.switch2.large {
|
154
|
+
padding: 0.5rem;
|
155
|
+
}
|
156
|
+
|
157
|
+
/* Responsive adjustments */
|
158
|
+
@media (max-width: 768px) {
|
159
|
+
.switch-label,
|
160
|
+
.switch2-label {
|
161
|
+
font-size: 0.9rem;
|
162
|
+
gap: 0.5rem;
|
163
|
+
}
|
164
|
+
|
165
|
+
.switch-wrapper,
|
166
|
+
.switch-container,
|
167
|
+
.switch2-wrapper,
|
168
|
+
.switch2-container {
|
169
|
+
gap: 0.25rem;
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
/* High contrast mode support */
|
174
|
+
@media (prefers-contrast: high) {
|
175
|
+
.switch2:focus {
|
176
|
+
outline-width: 3px;
|
177
|
+
}
|
178
|
+
|
179
|
+
.react-switch:focus {
|
180
|
+
outline-width: 3px;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
|
184
|
+
/* Reduced motion support */
|
185
|
+
@media (prefers-reduced-motion: reduce) {
|
186
|
+
.switch2 {
|
187
|
+
transition: none;
|
188
|
+
}
|
189
|
+
|
190
|
+
.react-switch * {
|
191
|
+
transition: none !important;
|
192
|
+
}
|
193
|
+
}
|
194
|
+
|
195
|
+
/* Dark theme support */
|
196
|
+
@media (prefers-color-scheme: dark) {
|
197
|
+
.switch2:hover {
|
198
|
+
background-color: rgba(255, 255, 255, 0.08);
|
199
|
+
}
|
200
|
+
}
|