@allxsmith/bestax-bulma 5.63.0 → 5.64.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 (44) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/ScrollArea.js +7 -7
  4. package/dist/esm/components/ScrollArea.js.map +1 -1
  5. package/dist/esm/components/TableOfContents.js +85 -0
  6. package/dist/esm/components/TableOfContents.js.map +1 -0
  7. package/dist/esm/form/PasswordInput.js +105 -0
  8. package/dist/esm/form/PasswordInput.js.map +1 -0
  9. package/dist/esm/form/PasswordInputBase.js +177 -0
  10. package/dist/esm/form/PasswordInputBase.js.map +1 -0
  11. package/dist/esm/helpers/useScrollSpy.js +286 -0
  12. package/dist/esm/helpers/useScrollSpy.js.map +1 -0
  13. package/dist/extras.css +1 -1
  14. package/dist/extras.css.map +1 -1
  15. package/dist/index.cjs +616 -7
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.esm.js +4 -0
  18. package/dist/index.esm.js.map +1 -1
  19. package/dist/types/components/TableOfContents.d.ts +87 -0
  20. package/dist/types/form/PasswordInput.d.ts +98 -0
  21. package/dist/types/form/PasswordInputBase.d.ts +91 -0
  22. package/dist/types/helpers/useScrollSpy.d.ts +61 -0
  23. package/dist/types/index.d.ts +5 -0
  24. package/dist/types-cjs/components/TableOfContents.d.ts +87 -0
  25. package/dist/types-cjs/form/PasswordInput.d.ts +98 -0
  26. package/dist/types-cjs/form/PasswordInputBase.d.ts +91 -0
  27. package/dist/types-cjs/helpers/useScrollSpy.d.ts +61 -0
  28. package/dist/types-cjs/index.d.ts +5 -0
  29. package/dist/versions/bestax-no-dark-mode.css +1 -1
  30. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  31. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  32. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  33. package/dist/versions/bestax-no-helpers.css +1 -1
  34. package/dist/versions/bestax-no-helpers.css.map +1 -1
  35. package/dist/versions/bestax-prefixed.css +1 -1
  36. package/dist/versions/bestax-prefixed.css.map +1 -1
  37. package/package.json +1 -1
  38. package/src/scss/CLAUDE.md +3 -0
  39. package/src/scss/_input-trigger.scss +76 -0
  40. package/src/scss/components/_index.scss +1 -0
  41. package/src/scss/components/_tableofcontents.scss +42 -0
  42. package/src/scss/form/_index.scss +1 -0
  43. package/src/scss/form/_passwordinput.scss +112 -0
  44. package/src/scss/form/_picker-popover.scss +24 -63
@@ -0,0 +1,91 @@
1
+ import { InputBaseProps } from './InputBase.js';
2
+ /** How PasswordInput's visibility toggle draws itself. */
3
+ export type PasswordInputVariant = 'icon' | 'text';
4
+ /** The strings PasswordInput's toggle shows and announces, for translating. */
5
+ export interface PasswordInputLabels {
6
+ /**
7
+ * The toggle's name. With the `icon` variant it's the name in both states,
8
+ * and `aria-pressed` says whether the password shows. With `text`, it's the
9
+ * name while the password is hidden, and it has to contain `show`, the word
10
+ * on the button.
11
+ * @defaultValue 'Show password'
12
+ */
13
+ showPassword?: string;
14
+ /**
15
+ * The `text` variant's name while the password shows. It has to contain
16
+ * `hide`.
17
+ * @defaultValue 'Hide password'
18
+ */
19
+ hidePassword?: string;
20
+ /**
21
+ * The `text` variant's word while the password is hidden.
22
+ * @defaultValue 'Show'
23
+ */
24
+ show?: string;
25
+ /**
26
+ * The `text` variant's word while the password shows.
27
+ * @defaultValue 'Hide'
28
+ */
29
+ hide?: string;
30
+ }
31
+ /**
32
+ * Props for PasswordInputBase, the input and its toggle without a Field or a
33
+ * Control.
34
+ *
35
+ * @helperProps Helper props go on the `.password-input-container` `<div>`, with
36
+ * `className` and `style`, so they move and size the field and its toggle
37
+ * together. The other attributes go on the `<input>`.
38
+ * @extraProp {string} [autoComplete="current-password"] - Tells the browser and password managers this is an existing password. Pass `"new-password"` where the user makes one up, on a sign-up or change-password form.
39
+ * @extraProp {boolean} [spellCheck=false] - Off, so a browser's spellcheck never sees the password once it shows.
40
+ * @extraProp {string} [autoCorrect="off"] - Off, so a phone's keyboard doesn't change what's typed.
41
+ * @extraProp {string} [autoCapitalize="none"] - Off, so a phone's keyboard doesn't capitalize the first letter.
42
+ * @extraProp {string} [value] - The password, controlled. React writes a controlled input's value into its `value` attribute, as it does on any input, so the password sits in the page's markup. Uncontrolled, read with `FormData`, the field never puts what's typed there.
43
+ * @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the `<input>`.
44
+ */
45
+ export interface PasswordInputBaseProps extends Omit<InputBaseProps, 'type'> {
46
+ /**
47
+ * Whether the password shows, when you hold the state. Setting it makes
48
+ * the visibility controlled: the toggle only calls `onVisibleChange`, and
49
+ * so does hiding again on its own. Apply that `false` and the field is a
50
+ * password field by the time the form reads it; keep `visible` true and
51
+ * the field stays shown.
52
+ */
53
+ visible?: boolean;
54
+ /**
55
+ * Whether the password shows at first, when the input holds its own state.
56
+ * @defaultValue false
57
+ */
58
+ defaultVisible?: boolean;
59
+ /**
60
+ * Called with the new visibility on each toggle, and with `false` when the
61
+ * form submits or resets, or the page is left, which it also is on the way
62
+ * into the back-forward cache. React renders those hides at once, a state
63
+ * update you make here included, so the form reads a password field. One
64
+ * that fires while React is rendering or committing, which includes your
65
+ * `useEffect` and `useLayoutEffect` callbacks, such as a `requestSubmit()`
66
+ * from an effect, can't render there, and lands just after the form is
67
+ * read: hide the password first, or submit from an event handler.
68
+ */
69
+ onVisibleChange?: (visible: boolean) => void;
70
+ /**
71
+ * How the toggle draws itself: an eye icon with a fixed name and
72
+ * `aria-pressed`, or the words "Show" and "Hide" with a name that follows
73
+ * them.
74
+ * @defaultValue 'icon'
75
+ */
76
+ variant?: PasswordInputVariant;
77
+ /** Translations for the toggle. */
78
+ labels?: PasswordInputLabels;
79
+ }
80
+ /**
81
+ * The raw PasswordInput: a password field with a button inside it that shows what was typed, without Field/Control wrapping.
82
+ *
83
+ * Use `PasswordInput` for the convenience wrapper.
84
+ *
85
+ * @function
86
+ * @param {PasswordInputBaseProps} props - Props for PasswordInputBase.
87
+ * @param {React.Ref<HTMLInputElement>} ref - Forwarded ref to the `<input>`.
88
+ * @returns {JSX.Element} The input and its toggle, in a container.
89
+ */
90
+ export declare const PasswordInputBase: import("react").ForwardRefExoticComponent<PasswordInputBaseProps & import("react").RefAttributes<HTMLInputElement>>;
91
+ export default PasswordInputBase;
@@ -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;
@@ -34,6 +34,7 @@ export * from './components/ScrollArea.js';
34
34
  export * from './components/Command.js';
35
35
  export * from './components/DataTable.js';
36
36
  export * from './components/Affix.js';
37
+ export * from './components/TableOfContents.js';
37
38
  export * from './elements/Block.js';
38
39
  export * from './elements/Box.js';
39
40
  export * from './elements/Button.js';
@@ -108,12 +109,16 @@ export { SelectBase } from './form/SelectBase.js';
108
109
  export type { SelectBaseProps } from './form/SelectBase.js';
109
110
  export { TextAreaBase } from './form/TextAreaBase.js';
110
111
  export type { TextAreaBaseProps } from './form/TextAreaBase.js';
112
+ export { PasswordInputBase } from './form/PasswordInputBase.js';
113
+ export type { PasswordInputBaseProps, PasswordInputLabels, PasswordInputVariant, } from './form/PasswordInputBase.js';
111
114
  export { Input } from './form/Input.js';
112
115
  export type { InputProps } from './form/Input.js';
113
116
  export { Select } from './form/Select.js';
114
117
  export type { SelectProps } from './form/Select.js';
115
118
  export { TextArea } from './form/TextArea.js';
116
119
  export type { TextAreaProps } from './form/TextArea.js';
120
+ export { PasswordInput } from './form/PasswordInput.js';
121
+ export type { PasswordInputProps } from './form/PasswordInput.js';
117
122
  export { DateInputBase } from './form/DateInputBase.js';
118
123
  export type { DateInputBaseProps } from './form/DateInputBase.js';
119
124
  export { DateInput } from './form/DateInput.js';