@pablozaiden/webapp 1.3.0 → 1.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pablozaiden/webapp",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Opinionated Bun + React webapp framework for single-server apps",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -143,7 +143,17 @@ export function AppShell({
143
143
  tabIndex={0}
144
144
  aria-label="Close sidebar"
145
145
  aria-hidden={state === "exit" ? true : undefined}
146
- onClick={closeSidebar}
146
+ onPointerDown={(event) => {
147
+ if (event.button === 0) {
148
+ event.preventDefault();
149
+ closeSidebar();
150
+ }
151
+ }}
152
+ onClick={(event) => {
153
+ if (event.detail === 0) {
154
+ closeSidebar();
155
+ }
156
+ }}
147
157
  onKeyDown={(event) => {
148
158
  if (event.key === "Enter" || event.key === " ") {
149
159
  event.preventDefault();
@@ -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-motion-${presence.state}`} role="presentation" aria-hidden={open ? undefined : true}>
860
+ <div className={`wapp-dialog-backdrop wapp-confirm-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-motion-${presence.state}`}
865
+ className={`wapp-confirm-dialog wapp-motion-${presence.state}`}
866
866
  actions={(
867
867
  <>
868
868
  <Button type="button" variant="ghost" onClick={onCancel}>Cancel</Button>
@@ -2242,6 +2242,16 @@ textarea::placeholder {
2242
2242
  animation: wapp-fade-in var(--wapp-motion-fast) var(--wapp-motion-ease) both;
2243
2243
  }
2244
2244
 
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
+
2245
2255
  .wapp-dialog {
2246
2256
  position: fixed;
2247
2257
  top: 50%;
@@ -2287,6 +2297,47 @@ textarea::placeholder {
2287
2297
  }
2288
2298
  }
2289
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
+ }
2327
+ }
2328
+
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
+ }
2339
+ }
2340
+
2290
2341
  .wapp-dialog-title {
2291
2342
  display: flex;
2292
2343
  align-items: flex-start;
@@ -2332,6 +2383,13 @@ textarea::placeholder {
2332
2383
  padding: 1.25rem 1.5rem;
2333
2384
  }
2334
2385
 
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
+
2335
2393
  .wapp-dialog-body p {
2336
2394
  margin: 0;
2337
2395
  color: color-mix(in srgb, var(--wapp-text), var(--wapp-muted) 28%);
@@ -2345,6 +2403,17 @@ textarea::placeholder {
2345
2403
  padding: 1rem 1.5rem;
2346
2404
  }
2347
2405
 
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
+
2348
2417
  .wapp-modal-layer {
2349
2418
  position: fixed;
2350
2419
  inset: 0;