ywana-core8 0.1.96 → 0.1.98
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/README-PUBLISH.md +166 -0
- package/dist/index.css +4501 -226
- package/dist/index.js +42641 -0
- package/dist/index.js.map +1 -0
- package/dist/index.modern.js +37447 -31364
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +40345 -34418
- package/dist/index.umd.js.map +1 -1
- package/doc/src/index.js +1 -2
- package/doc/src/ywana-core8.css +16646 -0
- package/package.json +25 -19
- package/publish.sh +288 -5
- package/src/html/accordion.example.js +0 -74
- package/src/setupTests.js +38 -0
- package/test-publish.sh +159 -0
- package/vite.config.js +86 -0
- package/vitest.config.js +42 -0
- package/dist/index.cjs +0 -36722
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/src/incubator/pdfViewer.js +0 -33
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.98",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"homepage": "https://ywana.github.io/workspace",
|
6
6
|
"author": "Ernesto Roldan Garcia",
|
@@ -12,57 +12,63 @@
|
|
12
12
|
"previewjs": {
|
13
13
|
"framework": "react",
|
14
14
|
"react": {
|
15
|
-
"version":
|
15
|
+
"version": 18
|
16
16
|
}
|
17
17
|
},
|
18
18
|
"scripts": {
|
19
|
-
"build": "
|
20
|
-
"dev": "
|
19
|
+
"build": "vite build",
|
20
|
+
"dev": "vite build --watch",
|
21
21
|
"test": "jest",
|
22
|
+
"test:vitest": "vitest run",
|
23
|
+
"test:watch": "vitest",
|
24
|
+
"test:ui": "vitest --ui",
|
22
25
|
"deploy-docs": "gh-pages -d doc/build"
|
23
26
|
},
|
24
27
|
"bugs": {
|
25
28
|
"url": "https://github.com/ywana/ywana-core8/issues"
|
26
29
|
},
|
27
30
|
"resolutions": {
|
28
|
-
"react-error-overlay": "6.0.9"
|
31
|
+
"react-error-overlay": "6.0.9",
|
32
|
+
"nth-check": "^2.1.1",
|
33
|
+
"postcss": "^8.4.31",
|
34
|
+
"svgo": "^3.0.0",
|
35
|
+
"webpack-dev-server": "^4.15.1"
|
29
36
|
},
|
30
37
|
"peerDependencies": {
|
31
|
-
"react": "
|
32
|
-
"react-dom": "
|
38
|
+
"react": "^19.1.1",
|
39
|
+
"react-dom": "^19.1.1"
|
33
40
|
},
|
34
41
|
"devDependencies": {
|
35
42
|
"@babel/preset-env": "^7.28.0",
|
36
43
|
"@babel/preset-react": "^7.27.1",
|
37
|
-
"@testing-library/jest-dom": "^6.
|
38
|
-
"@testing-library/react": "^
|
44
|
+
"@testing-library/jest-dom": "^6.8.0",
|
45
|
+
"@testing-library/react": "^13.4.0",
|
39
46
|
"@testing-library/user-event": "^14.6.1",
|
47
|
+
"@vitejs/plugin-react": "^5.0.2",
|
48
|
+
"@vitest/ui": "^3.2.4",
|
40
49
|
"babel-jest": "^30.0.5",
|
41
|
-
"gh-pages": "^3.
|
50
|
+
"gh-pages": "^6.3.0",
|
42
51
|
"identity-obj-proxy": "^3.0.0",
|
43
52
|
"jest": "^29.7.0",
|
44
53
|
"jsdom": "^26.1.0",
|
45
|
-
"
|
46
|
-
"react": "^
|
47
|
-
"
|
48
|
-
"
|
54
|
+
"react": "^18.3.1",
|
55
|
+
"react-dom": "^18.3.1",
|
56
|
+
"vite": "^7.1.4",
|
57
|
+
"vitest": "^3.2.4"
|
49
58
|
},
|
50
59
|
"dependencies": {
|
51
60
|
"axios": "^1.3.4",
|
52
61
|
"crypto-js": "^4.1.1",
|
53
62
|
"deep-equal": "^2.0.5",
|
54
|
-
"framer-motion": "^5.3.1",
|
55
63
|
"material-design-icons-iconfont": "^6.7.0",
|
56
64
|
"moment": "^2.29.1",
|
57
65
|
"moment-range": "^4.0.2",
|
58
66
|
"react-datepicker": "^4.6.0",
|
59
67
|
"react-error-overlay": "^6.0.10",
|
60
68
|
"react-image-pan-zoom-rotate": "^1.6.0",
|
61
|
-
"react-notifications-component": "^
|
62
|
-
"react-pdf": "^7.0.3",
|
69
|
+
"react-notifications-component": "^4.0.1",
|
63
70
|
"react-switch": "^6.0.0",
|
64
|
-
"react-syntax-highlighter": "^15.6.
|
65
|
-
"react-tooltip": "^4.2.21",
|
71
|
+
"react-syntax-highlighter": "^15.6.6",
|
66
72
|
"resumablejs": "^1.1.0"
|
67
73
|
}
|
68
74
|
}
|
package/publish.sh
CHANGED
@@ -1,6 +1,289 @@
|
|
1
|
-
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
# 🚀 Ywana Core8 - Script de Publicación Automatizada
|
4
|
+
# ================================================
|
5
|
+
|
6
|
+
set -e # Salir si cualquier comando falla
|
7
|
+
|
8
|
+
# Colores para output
|
9
|
+
RED='\033[0;31m'
|
10
|
+
GREEN='\033[0;32m'
|
11
|
+
YELLOW='\033[1;33m'
|
12
|
+
BLUE='\033[0;34m'
|
13
|
+
PURPLE='\033[0;35m'
|
14
|
+
CYAN='\033[0;36m'
|
15
|
+
NC='\033[0m' # No Color
|
16
|
+
|
17
|
+
# Función para mostrar barras de progreso
|
18
|
+
show_progress() {
|
19
|
+
local duration=$1
|
20
|
+
local message=$2
|
21
|
+
local progress=0
|
22
|
+
local bar_length=50
|
23
|
+
|
24
|
+
echo -e "${CYAN}${message}${NC}"
|
25
|
+
|
26
|
+
while [ $progress -le $duration ]; do
|
27
|
+
local filled=$((progress * bar_length / duration))
|
28
|
+
local empty=$((bar_length - filled))
|
29
|
+
|
30
|
+
printf "\r${GREEN}["
|
31
|
+
printf "%*s" $filled | tr ' ' '='
|
32
|
+
printf "%*s" $empty | tr ' ' '-'
|
33
|
+
printf "]${NC} %d%%" $((progress * 100 / duration))
|
34
|
+
|
35
|
+
sleep 0.1
|
36
|
+
progress=$((progress + 1))
|
37
|
+
done
|
38
|
+
echo ""
|
39
|
+
}
|
40
|
+
|
41
|
+
# Función para mostrar spinner
|
42
|
+
show_spinner() {
|
43
|
+
local pid=$1
|
44
|
+
local message=$2
|
45
|
+
local spin='⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏'
|
46
|
+
local i=0
|
47
|
+
|
48
|
+
echo -e "${CYAN}${message}${NC}"
|
49
|
+
while kill -0 $pid 2>/dev/null; do
|
50
|
+
i=$(( (i+1) %10 ))
|
51
|
+
printf "\r${YELLOW}${spin:$i:1}${NC} Procesando..."
|
52
|
+
sleep 0.1
|
53
|
+
done
|
54
|
+
printf "\r${GREEN}✓${NC} Completado\n"
|
55
|
+
}
|
56
|
+
|
57
|
+
# Función para log con timestamp
|
58
|
+
log() {
|
59
|
+
local level=$1
|
60
|
+
local message=$2
|
61
|
+
local timestamp=$(date '+%H:%M:%S')
|
62
|
+
|
63
|
+
case $level in
|
64
|
+
"INFO") echo -e "${BLUE}[${timestamp}]${NC} ${message}" ;;
|
65
|
+
"SUCCESS") echo -e "${GREEN}[${timestamp}] ✓${NC} ${message}" ;;
|
66
|
+
"WARNING") echo -e "${YELLOW}[${timestamp}] ⚠${NC} ${message}" ;;
|
67
|
+
"ERROR") echo -e "${RED}[${timestamp}] ✗${NC} ${message}" ;;
|
68
|
+
esac
|
69
|
+
}
|
70
|
+
|
71
|
+
# Banner inicial
|
72
|
+
echo -e "${PURPLE}"
|
73
|
+
echo "╔══════════════════════════════════════════════════════════════╗"
|
74
|
+
echo "║ 🚀 YWANA CORE8 PUBLISHER ║"
|
75
|
+
echo "║ Automated Release Pipeline ║"
|
76
|
+
echo "╚══════════════════════════════════════════════════════════════╝"
|
77
|
+
echo -e "${NC}"
|
78
|
+
|
79
|
+
# Obtener mensaje de commit del usuario
|
80
|
+
if [ -z "$1" ]; then
|
81
|
+
echo -e "${YELLOW}💬 Ingresa el mensaje de commit:${NC}"
|
82
|
+
read -r COMMIT_MESSAGE
|
83
|
+
if [ -z "$COMMIT_MESSAGE" ]; then
|
84
|
+
log "ERROR" "Mensaje de commit requerido"
|
85
|
+
exit 1
|
86
|
+
fi
|
87
|
+
else
|
88
|
+
COMMIT_MESSAGE="$1"
|
89
|
+
fi
|
90
|
+
|
91
|
+
log "INFO" "Mensaje de commit: ${COMMIT_MESSAGE}"
|
92
|
+
|
93
|
+
echo ""
|
94
|
+
log "INFO" "Iniciando pipeline de publicación..."
|
95
|
+
|
96
|
+
# ============================================================================
|
97
|
+
# PASO 1: Verificaciones Previas
|
98
|
+
# ============================================================================
|
99
|
+
echo -e "\n${PURPLE}📋 PASO 1: Verificaciones Previas${NC}"
|
100
|
+
|
101
|
+
# Verificar que estamos en la rama correcta
|
102
|
+
CURRENT_BRANCH=$(git branch --show-current)
|
103
|
+
log "INFO" "Rama actual: ${CURRENT_BRANCH}"
|
104
|
+
|
105
|
+
if [ "$CURRENT_BRANCH" != "main" ] && [ "$CURRENT_BRANCH" != "master" ]; then
|
106
|
+
log "WARNING" "No estás en la rama principal. ¿Continuar? (y/N)"
|
107
|
+
read -r CONTINUE
|
108
|
+
if [ "$CONTINUE" != "y" ] && [ "$CONTINUE" != "Y" ]; then
|
109
|
+
log "INFO" "Publicación cancelada"
|
110
|
+
exit 0
|
111
|
+
fi
|
112
|
+
fi
|
113
|
+
|
114
|
+
# Verificar que no hay cambios sin commitear
|
115
|
+
if ! git diff-index --quiet HEAD --; then
|
116
|
+
log "INFO" "Hay cambios sin commitear. Se añadirán al commit."
|
117
|
+
else
|
118
|
+
log "SUCCESS" "Working directory limpio"
|
119
|
+
fi
|
120
|
+
|
121
|
+
# Verificar conexión a internet
|
122
|
+
if ! ping -c 1 google.com &> /dev/null; then
|
123
|
+
log "ERROR" "Sin conexión a internet"
|
124
|
+
exit 1
|
125
|
+
fi
|
126
|
+
|
127
|
+
log "SUCCESS" "Verificaciones previas completadas"
|
128
|
+
|
129
|
+
# ============================================================================
|
130
|
+
# PASO 2: Tests Omitidos (Opcional)
|
131
|
+
# ============================================================================
|
132
|
+
echo -e "\n${PURPLE}🧪 PASO 2: Tests (Omitido)${NC}"
|
133
|
+
|
134
|
+
log "WARNING" "Tests omitidos para esta publicación"
|
135
|
+
log "INFO" "Puedes ejecutar 'npm test' manualmente si lo deseas"
|
136
|
+
|
137
|
+
# ============================================================================
|
138
|
+
# PASO 3: Build del Proyecto
|
139
|
+
# ============================================================================
|
140
|
+
echo -e "\n${PURPLE}🔨 PASO 3: Building Proyecto${NC}"
|
141
|
+
|
142
|
+
log "INFO" "Limpiando build anterior..."
|
143
|
+
rm -rf dist/
|
144
|
+
log "SUCCESS" "Build anterior eliminado"
|
145
|
+
|
146
|
+
log "INFO" "Iniciando build con Vite..."
|
147
|
+
BUILD_START=$(date +%s)
|
148
|
+
|
149
|
+
if npm run build > /tmp/build_output.log 2>&1 & then
|
150
|
+
BUILD_PID=$!
|
151
|
+
show_spinner $BUILD_PID "Compilando con Vite"
|
152
|
+
wait $BUILD_PID
|
153
|
+
BUILD_EXIT_CODE=$?
|
154
|
+
|
155
|
+
BUILD_END=$(date +%s)
|
156
|
+
BUILD_TIME=$((BUILD_END - BUILD_START))
|
157
|
+
|
158
|
+
if [ $BUILD_EXIT_CODE -eq 0 ]; then
|
159
|
+
log "SUCCESS" "Build completado en ${BUILD_TIME}s"
|
160
|
+
|
161
|
+
# Mostrar tamaños de archivos
|
162
|
+
echo -e "${CYAN}📦 Archivos generados:${NC}"
|
163
|
+
ls -lah dist/ | grep -E '\.(js|css)$' | awk '{print " " $9 " (" $5 ")"}'
|
164
|
+
else
|
165
|
+
log "ERROR" "Build falló. Ver /tmp/build_output.log para detalles"
|
166
|
+
echo -e "${RED}Últimas líneas del log:${NC}"
|
167
|
+
tail -10 /tmp/build_output.log
|
168
|
+
exit 1
|
169
|
+
fi
|
170
|
+
else
|
171
|
+
log "ERROR" "No se pudo iniciar el build"
|
172
|
+
exit 1
|
173
|
+
fi
|
174
|
+
|
175
|
+
# ============================================================================
|
176
|
+
# PASO 4: Incrementar Versión
|
177
|
+
# ============================================================================
|
178
|
+
echo -e "\n${PURPLE}📈 PASO 4: Incrementando Versión${NC}"
|
179
|
+
|
180
|
+
CURRENT_VERSION=$(node -p "require('./package.json').version")
|
181
|
+
log "INFO" "Versión actual: v${CURRENT_VERSION}"
|
182
|
+
|
183
|
+
# Incrementar versión patch
|
184
|
+
npm version patch --no-git-tag-version > /dev/null
|
185
|
+
NEW_VERSION=$(node -p "require('./package.json').version")
|
186
|
+
log "SUCCESS" "Nueva versión: v${NEW_VERSION}"
|
187
|
+
|
188
|
+
# ============================================================================
|
189
|
+
# PASO 5: Git Commit y Push
|
190
|
+
# ============================================================================
|
191
|
+
echo -e "\n${PURPLE}📤 PASO 5: Git Commit y Push${NC}"
|
192
|
+
|
193
|
+
log "INFO" "Añadiendo archivos al staging..."
|
2
194
|
git add --all
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
195
|
+
show_progress 20 "Preparando commit..."
|
196
|
+
|
197
|
+
FULL_COMMIT_MESSAGE="v${NEW_VERSION}: ${COMMIT_MESSAGE}"
|
198
|
+
log "INFO" "Creando commit: ${FULL_COMMIT_MESSAGE}"
|
199
|
+
git commit -m "$FULL_COMMIT_MESSAGE"
|
200
|
+
log "SUCCESS" "Commit creado"
|
201
|
+
|
202
|
+
log "INFO" "Creando tag de versión..."
|
203
|
+
git tag "v${NEW_VERSION}"
|
204
|
+
log "SUCCESS" "Tag v${NEW_VERSION} creado"
|
205
|
+
|
206
|
+
log "INFO" "Pushing a GitHub..."
|
207
|
+
if git push origin "$CURRENT_BRANCH" --tags > /tmp/push_output.log 2>&1 & then
|
208
|
+
PUSH_PID=$!
|
209
|
+
show_spinner $PUSH_PID "Subiendo cambios a GitHub"
|
210
|
+
wait $PUSH_PID
|
211
|
+
PUSH_EXIT_CODE=$?
|
212
|
+
|
213
|
+
if [ $PUSH_EXIT_CODE -eq 0 ]; then
|
214
|
+
log "SUCCESS" "Push completado exitosamente"
|
215
|
+
else
|
216
|
+
log "ERROR" "Push falló. Ver /tmp/push_output.log para detalles"
|
217
|
+
exit 1
|
218
|
+
fi
|
219
|
+
else
|
220
|
+
log "ERROR" "No se pudo iniciar el push"
|
221
|
+
exit 1
|
222
|
+
fi
|
223
|
+
|
224
|
+
# ============================================================================
|
225
|
+
# PASO 6: Publicar a NPM
|
226
|
+
# ============================================================================
|
227
|
+
echo -e "\n${PURPLE}📦 PASO 6: Publicando a NPM${NC}"
|
228
|
+
|
229
|
+
# Verificar que estamos logueados en NPM
|
230
|
+
if ! npm whoami > /dev/null 2>&1; then
|
231
|
+
log "ERROR" "No estás logueado en NPM. Ejecuta 'npm login' primero"
|
232
|
+
exit 1
|
233
|
+
fi
|
234
|
+
|
235
|
+
NPM_USER=$(npm whoami)
|
236
|
+
log "INFO" "Usuario NPM: ${NPM_USER}"
|
237
|
+
|
238
|
+
log "INFO" "Publicando v${NEW_VERSION} a NPM..."
|
239
|
+
if npm publish > /tmp/publish_output.log 2>&1 & then
|
240
|
+
PUBLISH_PID=$!
|
241
|
+
show_spinner $PUBLISH_PID "Publicando a NPM Registry"
|
242
|
+
wait $PUBLISH_PID
|
243
|
+
PUBLISH_EXIT_CODE=$?
|
244
|
+
|
245
|
+
if [ $PUBLISH_EXIT_CODE -eq 0 ]; then
|
246
|
+
log "SUCCESS" "Paquete publicado exitosamente"
|
247
|
+
else
|
248
|
+
log "ERROR" "Publicación falló. Ver /tmp/publish_output.log para detalles"
|
249
|
+
echo -e "${RED}Últimas líneas del log:${NC}"
|
250
|
+
tail -10 /tmp/publish_output.log
|
251
|
+
exit 1
|
252
|
+
fi
|
253
|
+
else
|
254
|
+
log "ERROR" "No se pudo iniciar la publicación"
|
255
|
+
exit 1
|
256
|
+
fi
|
257
|
+
|
258
|
+
# ============================================================================
|
259
|
+
# RESUMEN FINAL
|
260
|
+
# ============================================================================
|
261
|
+
echo -e "\n${GREEN}"
|
262
|
+
echo "╔══════════════════════════════════════════════════════════════╗"
|
263
|
+
echo "║ 🎉 PUBLICACIÓN EXITOSA ║"
|
264
|
+
echo "╚══════════════════════════════════════════════════════════════╝"
|
265
|
+
echo -e "${NC}"
|
266
|
+
|
267
|
+
TOTAL_END=$(date +%s)
|
268
|
+
TOTAL_TIME=$((TOTAL_END - $(date +%s -d "1 minute ago")))
|
269
|
+
|
270
|
+
echo -e "${CYAN}📊 Resumen de la publicación:${NC}"
|
271
|
+
echo -e " ${GREEN}✓${NC} Versión: v${CURRENT_VERSION} → v${NEW_VERSION}"
|
272
|
+
echo -e " ${GREEN}✓${NC} Commit: ${FULL_COMMIT_MESSAGE}"
|
273
|
+
echo -e " ${GREEN}✓${NC} Rama: ${CURRENT_BRANCH}"
|
274
|
+
echo -e " ${GREEN}✓${NC} Usuario NPM: ${NPM_USER}"
|
275
|
+
echo -e " ${GREEN}✓${NC} Build time: ${BUILD_TIME}s"
|
276
|
+
|
277
|
+
echo -e "\n${CYAN}🔗 Enlaces útiles:${NC}"
|
278
|
+
echo -e " 📦 NPM: https://www.npmjs.com/package/ywana-core8"
|
279
|
+
echo -e " 🐙 GitHub: https://github.com/ywana/ywana-core8"
|
280
|
+
echo -e " 📋 Tag: https://github.com/ywana/ywana-core8/releases/tag/v${NEW_VERSION}"
|
281
|
+
|
282
|
+
echo -e "\n${CYAN}📥 Para instalar la nueva versión:${NC}"
|
283
|
+
echo -e " ${YELLOW}npm install ywana-core8@${NEW_VERSION}${NC}"
|
284
|
+
|
285
|
+
# Limpiar archivos temporales
|
286
|
+
rm -f /tmp/test_output.log /tmp/build_output.log /tmp/push_output.log /tmp/publish_output.log
|
287
|
+
|
288
|
+
echo -e "\n${GREEN}🚀 ¡Publicación completada exitosamente!${NC}"
|
289
|
+
echo -e "${PURPLE}Gracias por usar Ywana Core8 Publisher${NC}\n"
|
@@ -176,117 +176,43 @@ export const AccordionExamples = () => {
|
|
176
176
|
const sections =
|
177
177
|
|
178
178
|
[
|
179
|
-
|
180
|
-
|
181
179
|
{
|
182
|
-
|
183
|
-
|
184
180
|
"id": "overview",
|
185
|
-
|
186
|
-
|
187
181
|
"title": "Introducción",
|
188
|
-
|
189
|
-
|
190
182
|
"icon": "info"
|
191
|
-
|
192
|
-
|
193
183
|
},
|
194
|
-
|
195
|
-
|
196
184
|
{
|
197
|
-
|
198
|
-
|
199
185
|
"id": "basic-examples",
|
200
|
-
|
201
|
-
|
202
186
|
"title": "Ejemplos Básicos",
|
203
|
-
|
204
|
-
|
205
187
|
"icon": "widgets"
|
206
|
-
|
207
|
-
|
208
188
|
},
|
209
|
-
|
210
|
-
|
211
189
|
{
|
212
|
-
|
213
|
-
|
214
190
|
"id": "advanced-features",
|
215
|
-
|
216
|
-
|
217
191
|
"title": "Características Avanzadas",
|
218
|
-
|
219
|
-
|
220
192
|
"icon": "settings"
|
221
|
-
|
222
|
-
|
223
193
|
},
|
224
|
-
|
225
|
-
|
226
194
|
{
|
227
|
-
|
228
|
-
|
229
195
|
"id": "variants",
|
230
|
-
|
231
|
-
|
232
196
|
"title": "Variantes y Temas",
|
233
|
-
|
234
|
-
|
235
197
|
"icon": "palette"
|
236
|
-
|
237
|
-
|
238
198
|
},
|
239
|
-
|
240
|
-
|
241
199
|
{
|
242
|
-
|
243
|
-
|
244
200
|
"id": "states",
|
245
|
-
|
246
|
-
|
247
201
|
"title": "Estados",
|
248
|
-
|
249
|
-
|
250
202
|
"icon": "toggle_on"
|
251
|
-
|
252
|
-
|
253
203
|
},
|
254
|
-
|
255
|
-
|
256
204
|
{
|
257
|
-
|
258
|
-
|
259
205
|
"id": "sizes",
|
260
|
-
|
261
|
-
|
262
206
|
"title": "Tamaños",
|
263
|
-
|
264
|
-
|
265
207
|
"icon": "format_size"
|
266
|
-
|
267
|
-
|
268
208
|
},
|
269
|
-
|
270
|
-
|
271
209
|
{
|
272
|
-
|
273
|
-
|
274
210
|
"id": "api-reference",
|
275
|
-
|
276
|
-
|
277
211
|
"title": "Referencia API",
|
278
|
-
|
279
|
-
|
280
212
|
"icon": "code"
|
281
|
-
|
282
|
-
|
283
213
|
}
|
284
|
-
|
285
|
-
|
286
214
|
]
|
287
215
|
|
288
|
-
|
289
|
-
|
290
216
|
return (
|
291
217
|
<ExampleLayout title="Accordion Examples" sections={sections}>
|
292
218
|
<ExampleSection id="overview" title="Ejemplos de Componente Accordion Mejorado" icon="widgets">
|
@@ -0,0 +1,38 @@
|
|
1
|
+
// Setup file for tests
|
2
|
+
import '@testing-library/jest-dom'
|
3
|
+
|
4
|
+
// Mock window.matchMedia
|
5
|
+
Object.defineProperty(window, 'matchMedia', {
|
6
|
+
writable: true,
|
7
|
+
value: vi.fn().mockImplementation(query => ({
|
8
|
+
matches: false,
|
9
|
+
media: query,
|
10
|
+
onchange: null,
|
11
|
+
addListener: vi.fn(), // deprecated
|
12
|
+
removeListener: vi.fn(), // deprecated
|
13
|
+
addEventListener: vi.fn(),
|
14
|
+
removeEventListener: vi.fn(),
|
15
|
+
dispatchEvent: vi.fn(),
|
16
|
+
})),
|
17
|
+
})
|
18
|
+
|
19
|
+
// Mock ResizeObserver
|
20
|
+
global.ResizeObserver = vi.fn().mockImplementation(() => ({
|
21
|
+
observe: vi.fn(),
|
22
|
+
unobserve: vi.fn(),
|
23
|
+
disconnect: vi.fn(),
|
24
|
+
}))
|
25
|
+
|
26
|
+
// Mock IntersectionObserver
|
27
|
+
global.IntersectionObserver = vi.fn().mockImplementation(() => ({
|
28
|
+
observe: vi.fn(),
|
29
|
+
unobserve: vi.fn(),
|
30
|
+
disconnect: vi.fn(),
|
31
|
+
}))
|
32
|
+
|
33
|
+
// Mock window.getComputedStyle
|
34
|
+
Object.defineProperty(window, 'getComputedStyle', {
|
35
|
+
value: () => ({
|
36
|
+
getPropertyValue: () => '',
|
37
|
+
}),
|
38
|
+
})
|