@allxsmith/bestax-bulma 5.64.0 → 5.65.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.
Files changed (48) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Carousel.js +12 -66
  4. package/dist/esm/components/Carousel.js.map +1 -1
  5. package/dist/esm/components/Lightbox.js +756 -0
  6. package/dist/esm/components/Lightbox.js.map +1 -0
  7. package/dist/esm/components/Navbar.js.map +1 -1
  8. package/dist/esm/components/Reveal.js +1 -24
  9. package/dist/esm/components/Reveal.js.map +1 -1
  10. package/dist/esm/helpers/chevronIcons.js +24 -0
  11. package/dist/esm/helpers/chevronIcons.js.map +1 -0
  12. package/dist/esm/helpers/usePrefersReducedMotion.js +34 -0
  13. package/dist/esm/helpers/usePrefersReducedMotion.js.map +1 -0
  14. package/dist/esm/helpers/useSwipe.js +82 -0
  15. package/dist/esm/helpers/useSwipe.js.map +1 -0
  16. package/dist/extras.css +1 -1
  17. package/dist/extras.css.map +1 -1
  18. package/dist/index.cjs +924 -149
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.esm.js +1 -0
  21. package/dist/index.esm.js.map +1 -1
  22. package/dist/types/components/Lightbox.d.ts +244 -0
  23. package/dist/types/components/Navbar.d.ts +10 -0
  24. package/dist/types/helpers/chevronIcons.d.ts +14 -0
  25. package/dist/types/helpers/usePrefersReducedMotion.d.ts +10 -0
  26. package/dist/types/helpers/useSwipe.d.ts +66 -0
  27. package/dist/types/index.d.ts +1 -0
  28. package/dist/types-cjs/components/Lightbox.d.ts +244 -0
  29. package/dist/types-cjs/components/Navbar.d.ts +10 -0
  30. package/dist/types-cjs/helpers/chevronIcons.d.ts +14 -0
  31. package/dist/types-cjs/helpers/usePrefersReducedMotion.d.ts +10 -0
  32. package/dist/types-cjs/helpers/useSwipe.d.ts +66 -0
  33. package/dist/types-cjs/index.d.ts +1 -0
  34. package/dist/versions/bestax-no-dark-mode.css +1 -1
  35. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  36. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  37. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  38. package/dist/versions/bestax-no-helpers.css +1 -1
  39. package/dist/versions/bestax-no-helpers.css.map +1 -1
  40. package/dist/versions/bestax-prefixed.css +1 -1
  41. package/dist/versions/bestax-prefixed.css.map +1 -1
  42. package/package.json +6 -6
  43. package/src/scss/CLAUDE.md +1 -1
  44. package/src/scss/components/_index.scss +1 -0
  45. package/src/scss/components/_lightbox.scss +392 -0
  46. package/src/scss/elements/_button.scss +49 -0
  47. package/src/scss/elements/_index.scss +1 -0
  48. package/src/scss/elements/_loader.scss +10 -5
@@ -0,0 +1,66 @@
1
+ import type React from 'react';
2
+ /** Which way a finished swipe went, on screen: where the pointer travelled. */
3
+ export type SwipeDirection = 'left' | 'right' | 'up' | 'down';
4
+ /** Options for `useSwipe`. */
5
+ export interface UseSwipeOptions {
6
+ /**
7
+ * Whether a press starts a drag. Off, the handlers leave a press alone,
8
+ * `preventDefault()` included. A drag already under way still finishes.
9
+ * @defaultValue true
10
+ */
11
+ enabled?: boolean;
12
+ /**
13
+ * Follow the vertical axis too, so a swipe up or down is reported. Off,
14
+ * only the horizontal distance counts and `offsetY` stays `0`.
15
+ * @defaultValue false
16
+ */
17
+ vertical?: boolean;
18
+ /**
19
+ * Called when a drag ends more than 50px from where it started along an
20
+ * axis. With `vertical`, the axis it travelled further along decides.
21
+ * The direction is physical, so a caller that follows the reading
22
+ * direction maps it itself.
23
+ */
24
+ onSwipe: (direction: SwipeDirection) => void;
25
+ }
26
+ /** The mouse and touch handlers `useSwipe` hands back, to spread on the surface. */
27
+ export interface SwipeHandlers<T extends Element = Element> {
28
+ /** Starts a drag. Calls `preventDefault()` while enabled, so the press neither selects text nor drags an image. */
29
+ onMouseDown: (event: React.MouseEvent<T>) => void;
30
+ /** Follows a drag. */
31
+ onMouseMove: (event: React.MouseEvent<T>) => void;
32
+ /** Ends a drag. */
33
+ onMouseUp: () => void;
34
+ /** Ends a drag when the pointer leaves the surface, as a release would. */
35
+ onMouseLeave: () => void;
36
+ /** Starts a drag with the first finger. */
37
+ onTouchStart: (event: React.TouchEvent<T>) => void;
38
+ /** Follows the first finger. */
39
+ onTouchMove: (event: React.TouchEvent<T>) => void;
40
+ /** Ends a drag. */
41
+ onTouchEnd: () => void;
42
+ }
43
+ /** What `useSwipe` returns. */
44
+ export interface UseSwipeResult<T extends Element = Element> {
45
+ /** Whether a drag is under way. */
46
+ isSwiping: boolean;
47
+ /** How far the drag has gone across, in CSS pixels, `0` between drags. */
48
+ offsetX: number;
49
+ /** How far the drag has gone down (up is negative), `0` without `vertical`. */
50
+ offsetY: number;
51
+ /** The handlers to put on the surface that takes the drag. */
52
+ handlers: SwipeHandlers<T>;
53
+ /** Drops the drag under way without reporting a swipe, as when a second finger lands. */
54
+ cancel: () => void;
55
+ }
56
+ /**
57
+ * Follows a mouse or touch drag on a surface and reports a swipe when it
58
+ * ends far enough from where it started. Carousel's drag, shared: it hands
59
+ * back the handlers to put on the surface and the live offset to draw the
60
+ * drag with, and leaves what a swipe does to the component.
61
+ *
62
+ * @function
63
+ * @param {UseSwipeOptions} options - Whether it's on, the axes, and the callback.
64
+ * @returns {UseSwipeResult} The drag's state, its handlers, and a way to drop it.
65
+ */
66
+ export declare function useSwipe<T extends Element = Element>({ enabled, vertical, onSwipe, }: UseSwipeOptions): UseSwipeResult<T>;
@@ -28,6 +28,7 @@ export * from './components/Sidebar.js';
28
28
  export * from './components/Toast.js';
29
29
  export * from './components/Dialog.js';
30
30
  export * from './components/Carousel.js';
31
+ export * from './components/Lightbox.js';
31
32
  export * from './components/Reveal.js';
32
33
  export * from './components/TreeView.js';
33
34
  export * from './components/ScrollArea.js';