@pablozaiden/webapp 1.3.1 → 1.3.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/README.md CHANGED
@@ -34,7 +34,8 @@ The web export includes `Presence`, `Collapsible`, `AsyncState`, `AnimatedList`,
34
34
  `Tabs`, `TabPanels`, and `TabPanel`. Use stable React keys with `AnimatedList`;
35
35
  it preserves removed keyed children for the exit duration and marks them
36
36
  inaccessible while they leave. The primitives honor
37
- `prefers-reduced-motion` and skip visual movement when it is enabled.
37
+ `prefers-reduced-motion`; transient appearance animations use opacity-only
38
+ fades, while structural primitives such as `Collapsible` animate their layout.
38
39
 
39
40
  ```tsx
40
41
  <AnimatedList>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pablozaiden/webapp",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Opinionated Bun + React webapp framework for single-server apps",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -857,12 +857,12 @@ export function ConfirmDialog({
857
857
  const presence = usePresence(open);
858
858
  if (!presence.mounted) return null;
859
859
  return createPortal(
860
- <div className={`wapp-dialog-backdrop wapp-confirm-dialog-backdrop wapp-motion-${presence.state}`} role="presentation" aria-hidden={open ? undefined : true}>
860
+ <div className={`wapp-dialog-backdrop wapp-motion-${presence.state}`} role="presentation" aria-hidden={open ? undefined : true}>
861
861
  <Dialog
862
862
  title={title}
863
863
  onClose={onCancel}
864
864
  keyboardShortcutsEnabled={open && presence.mounted}
865
- className={`wapp-confirm-dialog wapp-motion-${presence.state}`}
865
+ className={`wapp-motion-${presence.state}`}
866
866
  actions={(
867
867
  <>
868
868
  <Button type="button" variant="ghost" onClick={onCancel}>Cancel</Button>
@@ -683,16 +683,22 @@ textarea::placeholder {
683
683
  }
684
684
 
685
685
  @keyframes wapp-view-transition-old {
686
+ from {
687
+ opacity: 1;
688
+ }
689
+
686
690
  to {
687
691
  opacity: 0;
688
- transform: translateY(calc(var(--wapp-motion-distance) * -1));
689
692
  }
690
693
  }
691
694
 
692
695
  @keyframes wapp-view-transition-new {
693
696
  from {
694
697
  opacity: 0;
695
- transform: translateY(var(--wapp-motion-distance));
698
+ }
699
+
700
+ to {
701
+ opacity: 1;
696
702
  }
697
703
  }
698
704
 
@@ -708,24 +714,20 @@ textarea::placeholder {
708
714
  @keyframes wapp-fade-in {
709
715
  from {
710
716
  opacity: 0;
711
- transform: translateY(var(--wapp-motion-distance));
712
717
  }
713
718
 
714
719
  to {
715
720
  opacity: 1;
716
- transform: translateY(0);
717
721
  }
718
722
  }
719
723
 
720
724
  @keyframes wapp-fade-out {
721
725
  from {
722
726
  opacity: 1;
723
- transform: translateY(0);
724
727
  }
725
728
 
726
729
  to {
727
730
  opacity: 0;
728
- transform: translateY(calc(var(--wapp-motion-distance) * -1));
729
731
  }
730
732
  }
731
733
 
@@ -1341,7 +1343,6 @@ textarea::placeholder {
1341
1343
 
1342
1344
  .wapp-floating-panel {
1343
1345
  z-index: 1000;
1344
- transform-origin: top left;
1345
1346
  }
1346
1347
 
1347
1348
  .wapp-floating-panel.wapp-motion-enter {
@@ -1355,58 +1356,48 @@ textarea::placeholder {
1355
1356
  @keyframes wapp-floating-panel-enter {
1356
1357
  from {
1357
1358
  opacity: 0;
1358
- transform: translateY(0.25rem) scale(0.98);
1359
1359
  }
1360
1360
 
1361
1361
  to {
1362
1362
  opacity: 1;
1363
- transform: translateY(0) scale(1);
1364
1363
  }
1365
1364
  }
1366
1365
 
1367
1366
  @keyframes wapp-floating-panel-exit {
1368
1367
  from {
1369
1368
  opacity: 1;
1370
- transform: translateY(0) scale(1);
1371
1369
  }
1372
1370
 
1373
1371
  to {
1374
1372
  opacity: 0;
1375
- transform: translateY(0.25rem) scale(0.98);
1376
1373
  }
1377
1374
  }
1378
1375
 
1379
1376
  .wapp-action-menu.wapp-motion-enter {
1380
- transform-origin: top right;
1381
1377
  animation-name: wapp-menu-enter;
1382
1378
  }
1383
1379
 
1384
1380
  .wapp-action-menu.wapp-motion-exit {
1385
- transform-origin: top right;
1386
1381
  animation-name: wapp-menu-exit;
1387
1382
  }
1388
1383
 
1389
1384
  @keyframes wapp-menu-enter {
1390
1385
  from {
1391
1386
  opacity: 0;
1392
- transform: translateY(-0.25rem) scale(0.98);
1393
1387
  }
1394
1388
 
1395
1389
  to {
1396
1390
  opacity: 1;
1397
- transform: translateY(0) scale(1);
1398
1391
  }
1399
1392
  }
1400
1393
 
1401
1394
  @keyframes wapp-menu-exit {
1402
1395
  from {
1403
1396
  opacity: 1;
1404
- transform: translateY(0) scale(1);
1405
1397
  }
1406
1398
 
1407
1399
  to {
1408
1400
  opacity: 0;
1409
- transform: translateY(-0.25rem) scale(0.98);
1410
1401
  }
1411
1402
  }
1412
1403
 
@@ -1947,12 +1938,10 @@ textarea::placeholder {
1947
1938
  @keyframes wapp-toast-enter {
1948
1939
  from {
1949
1940
  opacity: 0;
1950
- transform: translateY(0.5rem);
1951
1941
  }
1952
1942
 
1953
1943
  to {
1954
1944
  opacity: 1;
1955
- transform: translateY(0);
1956
1945
  }
1957
1946
  }
1958
1947
 
@@ -1966,9 +1955,12 @@ textarea::placeholder {
1966
1955
  }
1967
1956
 
1968
1957
  @keyframes wapp-toast-exit {
1958
+ from {
1959
+ opacity: 1;
1960
+ }
1961
+
1969
1962
  to {
1970
1963
  opacity: 0;
1971
- transform: translateY(0.25rem);
1972
1964
  }
1973
1965
  }
1974
1966
 
@@ -2242,16 +2234,6 @@ textarea::placeholder {
2242
2234
  animation: wapp-fade-in var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2243
2235
  }
2244
2236
 
2245
- .wapp-confirm-dialog-backdrop {
2246
- display: flex;
2247
- align-items: center;
2248
- justify-content: center;
2249
- min-width: 0;
2250
- overflow-x: hidden;
2251
- overflow-y: auto;
2252
- padding: max(0.75rem, var(--wapp-safe-area-top)) max(0.75rem, var(--wapp-safe-area-right)) max(0.75rem, var(--wapp-safe-area-bottom)) max(0.75rem, var(--wapp-safe-area-left));
2253
- }
2254
-
2255
2237
  .wapp-dialog {
2256
2238
  position: fixed;
2257
2239
  top: 50%;
@@ -2265,77 +2247,11 @@ textarea::placeholder {
2265
2247
  background: var(--wapp-surface);
2266
2248
  padding: 0;
2267
2249
  box-shadow: 0 24px 55px rgb(0 0 0 / 0.38);
2268
- animation: wapp-dialog-enter var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2269
- }
2270
-
2271
- .wapp-dialog.wapp-motion-exit,
2272
- .wapp-modal.wapp-motion-exit {
2273
- animation-name: wapp-dialog-exit;
2274
- }
2275
-
2276
- @keyframes wapp-dialog-enter {
2277
- from {
2278
- opacity: 0;
2279
- transform: translate(-50%, calc(-50% + 0.5rem)) scale(0.98);
2280
- }
2281
-
2282
- to {
2283
- opacity: 1;
2284
- transform: translate(-50%, -50%) scale(1);
2285
- }
2286
- }
2287
-
2288
- @keyframes wapp-dialog-exit {
2289
- from {
2290
- opacity: 1;
2291
- transform: translate(-50%, -50%) scale(1);
2292
- }
2293
-
2294
- to {
2295
- opacity: 0;
2296
- transform: translate(-50%, calc(-50% + 0.5rem)) scale(0.98);
2297
- }
2298
- }
2299
-
2300
- .wapp-confirm-dialog-backdrop > .wapp-confirm-dialog {
2301
- position: relative;
2302
- top: auto;
2303
- left: auto;
2304
- width: min(28rem, 100%);
2305
- max-width: 100%;
2306
- max-height: calc(var(--wapp-viewport-height) - 1.5rem - var(--wapp-safe-area-top) - var(--wapp-safe-area-bottom));
2307
- transform: none;
2308
- display: flex;
2309
- flex-direction: column;
2310
- animation-name: wapp-confirm-dialog-enter;
2311
- }
2312
-
2313
- .wapp-confirm-dialog-backdrop > .wapp-confirm-dialog.wapp-motion-exit {
2314
- animation-name: wapp-confirm-dialog-exit;
2315
- }
2316
-
2317
- @keyframes wapp-confirm-dialog-enter {
2318
- from {
2319
- opacity: 0;
2320
- transform: translateY(0.5rem) scale(0.98);
2321
- }
2322
-
2323
- to {
2324
- opacity: 1;
2325
- transform: translateY(0) scale(1);
2326
- }
2250
+ animation: wapp-fade-in var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2327
2251
  }
2328
2252
 
2329
- @keyframes wapp-confirm-dialog-exit {
2330
- from {
2331
- opacity: 1;
2332
- transform: translateY(0) scale(1);
2333
- }
2334
-
2335
- to {
2336
- opacity: 0;
2337
- transform: translateY(0.5rem) scale(0.98);
2338
- }
2253
+ .wapp-dialog.wapp-motion-exit {
2254
+ animation-name: wapp-fade-out;
2339
2255
  }
2340
2256
 
2341
2257
  .wapp-dialog-title {
@@ -2383,13 +2299,6 @@ textarea::placeholder {
2383
2299
  padding: 1.25rem 1.5rem;
2384
2300
  }
2385
2301
 
2386
- .wapp-confirm-dialog .wapp-dialog-body {
2387
- min-width: 0;
2388
- flex: 1 1 auto;
2389
- overflow-x: hidden;
2390
- overflow-y: auto;
2391
- }
2392
-
2393
2302
  .wapp-dialog-body p {
2394
2303
  margin: 0;
2395
2304
  color: color-mix(in srgb, var(--wapp-text), var(--wapp-muted) 28%);
@@ -2403,17 +2312,6 @@ textarea::placeholder {
2403
2312
  padding: 1rem 1.5rem;
2404
2313
  }
2405
2314
 
2406
- @media (max-width: 639px) {
2407
- .wapp-confirm-dialog .wapp-dialog-actions {
2408
- flex-direction: column-reverse;
2409
- align-items: stretch;
2410
- }
2411
-
2412
- .wapp-confirm-dialog .wapp-dialog-actions .wapp-button {
2413
- width: 100%;
2414
- }
2415
- }
2416
-
2417
2315
  .wapp-modal-layer {
2418
2316
  position: fixed;
2419
2317
  inset: 0;
@@ -2454,7 +2352,11 @@ textarea::placeholder {
2454
2352
  background: var(--wapp-surface);
2455
2353
  box-shadow: 0 24px 55px rgb(0 0 0 / 0.38);
2456
2354
  outline: none;
2457
- animation: wapp-dialog-enter var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2355
+ animation: wapp-fade-in var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2356
+ }
2357
+
2358
+ .wapp-modal.wapp-motion-exit {
2359
+ animation-name: wapp-fade-out;
2458
2360
  }
2459
2361
 
2460
2362
  .wapp-modal-sm {