@allxsmith/bestax-bulma 5.63.0 → 5.65.0

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 (65) 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/Reveal.js +1 -24
  8. package/dist/esm/components/Reveal.js.map +1 -1
  9. package/dist/esm/components/ScrollArea.js +7 -7
  10. package/dist/esm/components/ScrollArea.js.map +1 -1
  11. package/dist/esm/components/TableOfContents.js +85 -0
  12. package/dist/esm/components/TableOfContents.js.map +1 -0
  13. package/dist/esm/form/PasswordInput.js +105 -0
  14. package/dist/esm/form/PasswordInput.js.map +1 -0
  15. package/dist/esm/form/PasswordInputBase.js +177 -0
  16. package/dist/esm/form/PasswordInputBase.js.map +1 -0
  17. package/dist/esm/helpers/chevronIcons.js +24 -0
  18. package/dist/esm/helpers/chevronIcons.js.map +1 -0
  19. package/dist/esm/helpers/usePrefersReducedMotion.js +34 -0
  20. package/dist/esm/helpers/usePrefersReducedMotion.js.map +1 -0
  21. package/dist/esm/helpers/useScrollSpy.js +286 -0
  22. package/dist/esm/helpers/useScrollSpy.js.map +1 -0
  23. package/dist/esm/helpers/useSwipe.js +82 -0
  24. package/dist/esm/helpers/useSwipe.js.map +1 -0
  25. package/dist/extras.css +1 -1
  26. package/dist/extras.css.map +1 -1
  27. package/dist/index.cjs +1582 -198
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.esm.js +5 -0
  30. package/dist/index.esm.js.map +1 -1
  31. package/dist/types/components/Lightbox.d.ts +244 -0
  32. package/dist/types/components/TableOfContents.d.ts +87 -0
  33. package/dist/types/form/PasswordInput.d.ts +98 -0
  34. package/dist/types/form/PasswordInputBase.d.ts +91 -0
  35. package/dist/types/helpers/chevronIcons.d.ts +14 -0
  36. package/dist/types/helpers/usePrefersReducedMotion.d.ts +10 -0
  37. package/dist/types/helpers/useScrollSpy.d.ts +61 -0
  38. package/dist/types/helpers/useSwipe.d.ts +66 -0
  39. package/dist/types/index.d.ts +6 -0
  40. package/dist/types-cjs/components/Lightbox.d.ts +244 -0
  41. package/dist/types-cjs/components/TableOfContents.d.ts +87 -0
  42. package/dist/types-cjs/form/PasswordInput.d.ts +98 -0
  43. package/dist/types-cjs/form/PasswordInputBase.d.ts +91 -0
  44. package/dist/types-cjs/helpers/chevronIcons.d.ts +14 -0
  45. package/dist/types-cjs/helpers/usePrefersReducedMotion.d.ts +10 -0
  46. package/dist/types-cjs/helpers/useScrollSpy.d.ts +61 -0
  47. package/dist/types-cjs/helpers/useSwipe.d.ts +66 -0
  48. package/dist/types-cjs/index.d.ts +6 -0
  49. package/dist/versions/bestax-no-dark-mode.css +1 -1
  50. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  51. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  52. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  53. package/dist/versions/bestax-no-helpers.css +1 -1
  54. package/dist/versions/bestax-no-helpers.css.map +1 -1
  55. package/dist/versions/bestax-prefixed.css +1 -1
  56. package/dist/versions/bestax-prefixed.css.map +1 -1
  57. package/package.json +1 -1
  58. package/src/scss/CLAUDE.md +3 -0
  59. package/src/scss/_input-trigger.scss +76 -0
  60. package/src/scss/components/_index.scss +2 -0
  61. package/src/scss/components/_lightbox.scss +392 -0
  62. package/src/scss/components/_tableofcontents.scss +42 -0
  63. package/src/scss/form/_index.scss +1 -0
  64. package/src/scss/form/_passwordinput.scss +112 -0
  65. package/src/scss/form/_picker-popover.scss +24 -63
@@ -0,0 +1,61 @@
1
+ /** Options for useScrollSpy. */
2
+ export interface UseScrollSpyOptions {
3
+ /**
4
+ * **Required.** The ids of the sections to watch, without the `#`, in the
5
+ * order they come on the page. Each one is looked up each time the hook
6
+ * checks, so an id with no element on the page is skipped until one
7
+ * appears, and a section replaced under the same id keeps working.
8
+ */
9
+ ids: string[];
10
+ /**
11
+ * Pixels from the viewport's top where a section counts as reached. Unset,
12
+ * it's the page's `scroll-padding-top`, read when the hook mounts and on
13
+ * resize, so the highlight agrees with where a jump lands under a sticky
14
+ * header. A `scroll-padding-top` that mixes a percentage with a length in
15
+ * `calc()` isn't read: pass `offset` then.
16
+ */
17
+ offset?: number;
18
+ /** Called with the new current id when it changes, or `null` above the first section. */
19
+ onCurrentChange?: (id: string | null) => void;
20
+ }
21
+ /**
22
+ * The `useScrollSpy` hook returns the id of the section being read: the last
23
+ * of `ids` whose top is at or above the offset line, or the last one once the
24
+ * page is scrolled to its end. After a jump to one of them, it's that one
25
+ * until the reader scrolls on. `null` above the first section, on the server
26
+ * and until the page hydrates.
27
+ *
28
+ * It checks once per frame while the page scrolls, and on resize. A jump is
29
+ * a plain click on a link to one of the ids (the main button, no modifier
30
+ * key, opening in this page), noted and never stopped, so the browser jumps
31
+ * as it always does; and the `#id` a page opened afresh opens at. Back,
32
+ * Forward and a reload aren't jumps. That `#id` is read once, when `ids`
33
+ * first has some: a section rendered after that isn't held, even if the
34
+ * page opened at it, and the reading rule marks where the page is. Once the
35
+ * page has been still for a
36
+ * moment, the section stays current only if it's where a jump puts it: its
37
+ * top at the line, give or take a shift of the layout smaller than its own
38
+ * height, or, at the end of the page, on screen below the line. Otherwise,
39
+ * as after a flick right after the click, the reading rule takes over. The
40
+ * next scroll after that lets it go, the browser's own included, so when
41
+ * content loading above it makes the browser scroll to keep the reader's
42
+ * place, the rule takes over too.
43
+ *
44
+ * A section that isn't drawn (`display: none`) is never current. A section
45
+ * that moves while nothing scrolls is seen at the next scroll or resize. It
46
+ * watches the document only: not a panel that scrolls inside it, and not
47
+ * sections inside a shadow root, which an `#id` link can't reach either.
48
+ * Whether a page was opened afresh is read from how the document loaded, so
49
+ * in an app that changes routes on the client, a route change can briefly
50
+ * mark the address bar's section until the page settles, when the reading
51
+ * rule takes over, and after a reload a route change to an `#id` holds
52
+ * nothing.
53
+ *
54
+ * @function
55
+ * @param {UseScrollSpyOptions} options - The ids to watch, the offset, and a change callback.
56
+ * @returns {string | null} The current section's id, or `null`.
57
+ *
58
+ * @example
59
+ * const current = useScrollSpy({ ids: ['profile', 'security', 'billing'] });
60
+ */
61
+ export declare function useScrollSpy({ ids, offset, onCurrentChange, }: UseScrollSpyOptions): string | null;
@@ -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,12 +28,14 @@ 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';
34
35
  export * from './components/Command.js';
35
36
  export * from './components/DataTable.js';
36
37
  export * from './components/Affix.js';
38
+ export * from './components/TableOfContents.js';
37
39
  export * from './elements/Block.js';
38
40
  export * from './elements/Box.js';
39
41
  export * from './elements/Button.js';
@@ -108,12 +110,16 @@ export { SelectBase } from './form/SelectBase.js';
108
110
  export type { SelectBaseProps } from './form/SelectBase.js';
109
111
  export { TextAreaBase } from './form/TextAreaBase.js';
110
112
  export type { TextAreaBaseProps } from './form/TextAreaBase.js';
113
+ export { PasswordInputBase } from './form/PasswordInputBase.js';
114
+ export type { PasswordInputBaseProps, PasswordInputLabels, PasswordInputVariant, } from './form/PasswordInputBase.js';
111
115
  export { Input } from './form/Input.js';
112
116
  export type { InputProps } from './form/Input.js';
113
117
  export { Select } from './form/Select.js';
114
118
  export type { SelectProps } from './form/Select.js';
115
119
  export { TextArea } from './form/TextArea.js';
116
120
  export type { TextAreaProps } from './form/TextArea.js';
121
+ export { PasswordInput } from './form/PasswordInput.js';
122
+ export type { PasswordInputProps } from './form/PasswordInput.js';
117
123
  export { DateInputBase } from './form/DateInputBase.js';
118
124
  export type { DateInputBaseProps } from './form/DateInputBase.js';
119
125
  export { DateInput } from './form/DateInput.js';