cursedbelt 5.14.0 → 5.15.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.
Files changed (59) hide show
  1. package/dist/react/components/DropdownMenu.d.ts +1 -1
  2. package/dist/react/components/DropdownMenu.d.ts.map +1 -1
  3. package/dist/react/components/DropdownMenu.js +29 -2
  4. package/dist/react/components/DropdownMenu.js.map +1 -1
  5. package/dist/react/components/HoverCard.d.ts.map +1 -1
  6. package/dist/react/components/HoverCard.js +3 -1
  7. package/dist/react/components/HoverCard.js.map +1 -1
  8. package/dist/react/components/Popover.d.ts +70 -8
  9. package/dist/react/components/Popover.d.ts.map +1 -1
  10. package/dist/react/components/Popover.js +78 -6
  11. package/dist/react/components/Popover.js.map +1 -1
  12. package/dist/react/components/SelectField.d.ts.map +1 -1
  13. package/dist/react/components/SelectField.js +3 -1
  14. package/dist/react/components/SelectField.js.map +1 -1
  15. package/dist/react/components/TooltipImpl.d.ts.map +1 -1
  16. package/dist/react/components/TooltipImpl.js +3 -1
  17. package/dist/react/components/TooltipImpl.js.map +1 -1
  18. package/dist/react/hooks/useOutsidePress.d.ts +60 -0
  19. package/dist/react/hooks/useOutsidePress.d.ts.map +1 -0
  20. package/dist/react/hooks/useOutsidePress.js +120 -0
  21. package/dist/react/hooks/useOutsidePress.js.map +1 -0
  22. package/dist/react/icons.d.ts +13 -3
  23. package/dist/react/icons.d.ts.map +1 -1
  24. package/dist/react/icons.js +9 -3
  25. package/dist/react/icons.js.map +1 -1
  26. package/dist/react/index.d.ts +2 -1
  27. package/dist/react/index.d.ts.map +1 -1
  28. package/dist/react/index.js +2 -1
  29. package/dist/react/index.js.map +1 -1
  30. package/dist/react/lib/floatingContainer.d.ts +19 -0
  31. package/dist/react/lib/floatingContainer.d.ts.map +1 -0
  32. package/dist/react/lib/floatingContainer.js +36 -0
  33. package/dist/react/lib/floatingContainer.js.map +1 -0
  34. package/dist/react/media/CanvasVideoPlayer.d.ts.map +1 -1
  35. package/dist/react/media/CanvasVideoPlayer.js +2 -1
  36. package/dist/react/media/CanvasVideoPlayer.js.map +1 -1
  37. package/dist/scripts/guardrailsEnforce.d.ts.map +1 -1
  38. package/dist/styles-areas/media.css +4 -4
  39. package/dist/styles-utilities.css +0 -3
  40. package/package.json +3 -2
  41. package/scripts/guardrails-baseline.json +2 -1
  42. package/scripts/guardrailsEnforce.spec.ts +53 -0
  43. package/scripts/guardrailsEnforce.ts +60 -0
  44. package/src/react/components/DropdownMenu.spec.tsx +39 -0
  45. package/src/react/components/DropdownMenu.tsx +37 -5
  46. package/src/react/components/HoverCard.tsx +3 -1
  47. package/src/react/components/Popover.spec.tsx +241 -0
  48. package/src/react/components/Popover.tsx +172 -23
  49. package/src/react/components/SelectField.tsx +3 -1
  50. package/src/react/components/TooltipImpl.tsx +3 -1
  51. package/src/react/hooks/useOutsidePress.spec.tsx +112 -0
  52. package/src/react/hooks/useOutsidePress.ts +159 -0
  53. package/src/react/icons.spec.ts +19 -0
  54. package/src/react/icons.tsx +14 -4
  55. package/src/react/index.ts +2 -1
  56. package/src/react/lib/floatingContainer.ts +42 -0
  57. package/src/react/media/CanvasVideoPlayer.tsx +36 -28
  58. package/src/styles-areas/media.css +4 -4
  59. package/src/styles-utilities.css +0 -3
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Button } from '../components/Button.js';
3
3
  import { IconButton } from '../components/IconButton.js';
4
+ import { Popover } from '../components/Popover.js';
4
5
  import { useHlsSource } from './hlsSource.js';
5
6
  import { DEFAULT_VIDEO_ASPECT_RATIO, type PlayerVideo, ProcessingIndicator } from './VideoPlayer.js';
6
7
 
@@ -271,34 +272,41 @@ export function CanvasVideoPlayer({
271
272
  />
272
273
  <span className='shrink-0 text-xs tabular-nums'>{fmtTime(duration)}</span>
273
274
 
274
- {/* Playback speed */}
275
- <div className='relative shrink-0'>
276
- <Button
277
- variant='ghost'
278
- tooltip='Playback speed'
279
- onClick={() => setSpeedOpen((o) => !o)}
280
- className='h-10 min-w-10 rounded px-1 text-xs tabular-nums text-white hover:bg-white/20'
281
- >
282
- {rate}×
283
- </Button>
284
- {speedOpen ? (
285
- <div className='absolute bottom-full right-0 mb-1 flex flex-col overflow-hidden rounded-md bg-black/90 text-xs'>
286
- {SPEEDS.map((s) => (
287
- <Button
288
- key={s}
289
- variant='ghost'
290
- tooltip={`Set speed to ${s}×`}
291
- onClick={() => changeRate(s)}
292
- className={`h-auto justify-end rounded-none px-3 py-1.5 text-right text-white tabular-nums hover:bg-white/20 ${
293
- s === rate ? 'font-bold text-[color:var(--accent)]' : ''
294
- }`}
295
- >
296
- {s}×
297
- </Button>
298
- ))}
299
- </div>
300
- ) : null}
301
- </div>
275
+ {/* Playback speed — the shared Popover, so a tap anywhere else closes it. `modal`:
276
+ that tap must not also land on the picture and pause the film. */}
277
+ <Popover
278
+ open={speedOpen}
279
+ onOpenChange={setSpeedOpen}
280
+ side='top'
281
+ align='end'
282
+ modal
283
+ unstyled
284
+ label='Playback speed'
285
+ className='flex flex-col overflow-hidden rounded-md bg-black/90 text-xs'
286
+ trigger={
287
+ <Button
288
+ variant='ghost'
289
+ tooltip='Playback speed'
290
+ className='h-10 min-w-10 shrink-0 rounded px-1 text-xs tabular-nums text-white hover:bg-white/20'
291
+ >
292
+ {rate}×
293
+ </Button>
294
+ }
295
+ >
296
+ {SPEEDS.map((s) => (
297
+ <Button
298
+ key={s}
299
+ variant='ghost'
300
+ tooltip={`Set speed to ${s}×`}
301
+ onClick={() => changeRate(s)}
302
+ className={`h-auto justify-end rounded-none px-3 py-1.5 text-right text-white tabular-nums hover:bg-white/20 ${
303
+ s === rate ? 'font-bold text-[color:var(--accent)]' : ''
304
+ }`}
305
+ >
306
+ {s}×
307
+ </Button>
308
+ ))}
309
+ </Popover>
302
310
 
303
311
  {/* Volume */}
304
312
  <div className='flex shrink-0 items-center gap-1'>
@@ -18,7 +18,7 @@
18
18
  * after an app's responsive variant (task 2124). An app that imports every area gets exactly
19
19
  * what `cursedbelt/styles-utilities.css` emits — proved rule by rule in
20
20
  * src/stylesAreas.spec.ts, which is also what fails when this file is stale.
21
- * 95 candidate(s).
21
+ * 94 candidate(s).
22
22
  *
23
23
  * Written by scripts/generateAreaStyles.ts (`bun run styles:areas`), which
24
24
  * `bun run build` runs. The map of what is in which area, and why the areas are
@@ -28,9 +28,9 @@
28
28
  @source inline("appearance-none aspect aspect-square aspect-video backdrop-blur-[2px] bg-accent/15");
29
29
  @source inline("bg-background/65 bg-background/85 bg-black bg-black/55 bg-black/60 bg-black/85 bg-black/90");
30
30
  @source inline("bg-card-raised bg-center bg-cover bg-linear-to-t bg-muted/40 bg-white/90 border-2 border-accent");
31
- @source inline("border-accent-solid border-white/90 border-y-2 bottom-1 bottom-1.5 bottom-2 bottom-full");
32
- @source inline("cursor-crosshair cursor-grab cursor-zoom-in ease-in-out focus-within:opacity-100 from-black/80 g");
33
- @source inline("gap-x-4 grayscale group-focus-within:opacity-100 h-11 hover:bg-black/75 hover:bg-destructive");
31
+ @source inline("border-accent-solid border-white/90 border-y-2 bottom-1 bottom-1.5 bottom-2 cursor-crosshair");
32
+ @source inline("cursor-grab cursor-zoom-in ease-in-out focus-within:opacity-100 from-black/80 g gap-x-4");
33
+ @source inline("grayscale group-focus-within:opacity-100 h-11 hover:bg-black/75 hover:bg-destructive");
34
34
  @source inline("hover:bg-white/20 hover:border-accent-solid invert left-0 left-1 max-h-[40vh] max-h-[48vh]");
35
35
  @source inline("max-h-full max-w-[200px] md:grid-cols-4 min-h-64 min-h-dvh min-w-10 min-w-28 min-w-40 min-w-48 o");
36
36
  @source inline("op opacity-100 opacity-80 pb-2 pr-9 pt-8 right-1 right-1.5 right-3 sh");
@@ -288,9 +288,6 @@
288
288
  .bottom-6 {
289
289
  bottom: calc(var(--spacing) * 6);
290
290
  }
291
- .bottom-full {
292
- bottom: 100%;
293
- }
294
291
  .-left-1\.5 {
295
292
  left: calc(var(--spacing) * -1.5);
296
293
  }