@allxsmith/bestax-bulma 5.26.2 → 5.26.3

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 (58) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/extras.css +1 -1
  4. package/dist/extras.css.map +1 -1
  5. package/dist/index.cjs +453 -303
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.esm.js +453 -303
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/elements/Progress.d.ts +6 -1
  10. package/dist/types/form/Control.d.ts +14 -2
  11. package/dist/types/form/DateInput.d.ts +13 -3
  12. package/dist/types/form/DateTimeInput.d.ts +13 -3
  13. package/dist/types/form/Input.d.ts +16 -4
  14. package/dist/types/form/InputBase.d.ts +5 -2
  15. package/dist/types/form/Select.d.ts +8 -2
  16. package/dist/types/form/TextArea.d.ts +4 -2
  17. package/dist/types/form/TextAreaBase.d.ts +12 -3
  18. package/dist/types/form/TimeInput.d.ts +13 -3
  19. package/dist/types/form/TimeInputBase.d.ts +5 -1
  20. package/dist/types/form/_pickerInternals/Calendar.d.ts +10 -1
  21. package/dist/types/form/_pickerInternals/PickerPopover.d.ts +6 -0
  22. package/dist/types/helpers/Theme.d.ts +13 -4
  23. package/dist/types/helpers/portal.d.ts +2 -1
  24. package/dist/types/helpers/useAnchoredPosition.d.ts +6 -0
  25. package/dist/types/helpers/useFocusTrap.d.ts +2 -1
  26. package/dist/types/helpers/useOtherClasses.d.ts +13 -1
  27. package/dist/types-cjs/elements/Progress.d.ts +6 -1
  28. package/dist/types-cjs/form/Control.d.ts +14 -2
  29. package/dist/types-cjs/form/DateInput.d.ts +13 -3
  30. package/dist/types-cjs/form/DateTimeInput.d.ts +13 -3
  31. package/dist/types-cjs/form/Input.d.ts +16 -4
  32. package/dist/types-cjs/form/InputBase.d.ts +5 -2
  33. package/dist/types-cjs/form/Select.d.ts +8 -2
  34. package/dist/types-cjs/form/TextArea.d.ts +4 -2
  35. package/dist/types-cjs/form/TextAreaBase.d.ts +12 -3
  36. package/dist/types-cjs/form/TimeInput.d.ts +13 -3
  37. package/dist/types-cjs/form/TimeInputBase.d.ts +5 -1
  38. package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +10 -1
  39. package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +6 -0
  40. package/dist/types-cjs/helpers/Theme.d.ts +13 -4
  41. package/dist/types-cjs/helpers/portal.d.ts +2 -1
  42. package/dist/types-cjs/helpers/useAnchoredPosition.d.ts +6 -0
  43. package/dist/types-cjs/helpers/useFocusTrap.d.ts +2 -1
  44. package/dist/types-cjs/helpers/useOtherClasses.d.ts +13 -1
  45. package/dist/versions/bestax-no-dark-mode.css +1 -1
  46. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  47. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  48. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  49. package/dist/versions/bestax-no-helpers.css +1 -1
  50. package/dist/versions/bestax-no-helpers.css.map +1 -1
  51. package/dist/versions/bestax-prefixed.css +1 -1
  52. package/dist/versions/bestax-prefixed.css.map +1 -1
  53. package/package.json +1 -1
  54. package/src/scss/elements/_index.scss +2 -0
  55. package/src/scss/elements/_progress.scss +17 -0
  56. package/src/scss/elements/_skeleton.scss +21 -0
  57. package/src/scss/form/_picker-popover.scss +16 -0
  58. package/src/scss/form/_timeinput.scss +7 -2
@@ -10,13 +10,16 @@ export interface InputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInput
10
10
  size?: 'small' | 'medium' | 'large';
11
11
  /** Rounded input corners. */
12
12
  isRounded?: boolean;
13
- /** Renders input as static (read only, styled). */
13
+ /** Styles the input as static text. It stays editable; add `readOnly` to stop edits. */
14
14
  isStatic?: boolean;
15
15
  /** Applies hovered state. */
16
16
  isHovered?: boolean;
17
17
  /** Applies focused state. */
18
18
  isFocused?: boolean;
19
- /** Shows loading indicator. */
19
+ /**
20
+ * Adds the `is-loading` class to the `<input>`. Bulma draws no spinner for it there: the
21
+ * spinner belongs to the wrapping `Control`, so set `isLoading` on that `Control`.
22
+ */
20
23
  isLoading?: boolean;
21
24
  /** Additional CSS classes to apply. */
22
25
  className?: string;
@@ -7,7 +7,9 @@ import { SelectBaseProps } from './SelectBase.js';
7
7
  *
8
8
  * Composes Field, Control, and SelectBase into a single convenience component.
9
9
  * Supports all SelectBase props, plus Field-level (label, horizontal) and
10
- * Control-level (icons, loading) props.
10
+ * Control-level (icons) props.
11
+ * Inside an existing `Control` within a `Field` it renders no `Field` or
12
+ * `Control` of its own, so set the Control-level props on that `Control` instead.
11
13
  */
12
14
  export interface SelectProps extends SelectBaseProps {
13
15
  /** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
@@ -18,7 +20,11 @@ export interface SelectProps extends SelectBaseProps {
18
20
  labelProps?: FieldProps['labelProps'];
19
21
  /** Horizontal field layout. */
20
22
  horizontal?: boolean;
21
- /** Icon props for left icon. */
23
+ /**
24
+ * Icon props for left icon.
25
+ * Bulma gives control icons `pointer-events: none`, so a clickable node here
26
+ * never receives a click. Put a button beside the input in its own addon `Control` instead.
27
+ */
22
28
  iconLeft?: ControlBaseProps['iconLeft'];
23
29
  /** Shortcut for left icon name. */
24
30
  iconLeftName?: string;
@@ -8,6 +8,8 @@ import { TextAreaBaseProps } from './TextAreaBase.js';
8
8
  * Composes Field, Control, and TextAreaBase into a single convenience component.
9
9
  * Supports all TextAreaBase props, plus Field-level (label, horizontal) and
10
10
  * Control-level (loading) props.
11
+ * Inside an existing `Control` within a `Field` it renders no `Field` or
12
+ * `Control` of its own, so set the Control-level props on that `Control` instead.
11
13
  */
12
14
  export interface TextAreaProps extends TextAreaBaseProps {
13
15
  /** Field label. Automatically associated with the textarea via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
@@ -19,7 +21,7 @@ export interface TextAreaProps extends TextAreaBaseProps {
19
21
  /** Horizontal field layout. */
20
22
  horizontal?: boolean;
21
23
  /**
22
- * Shows a loading spinner on the wrapping Control.
24
+ * Shows a loading spinner on the `Control` it renders.
23
25
  * Under `prefers-reduced-motion: reduce` the spinner stops and stays
24
26
  * drawn (with bestax's CSS loaded).
25
27
  */
@@ -36,7 +38,7 @@ export interface TextAreaProps extends TextAreaBaseProps {
36
38
  controlClassName?: string;
37
39
  }
38
40
  /**
39
- * The `TextArea` component provides a Bulma-styled multi-line text input, supporting color, size, rounded corners, static/read-only state, hover/focus/loading states, fixed size, and all Bulma helper props.
41
+ * The `TextArea` component provides a Bulma-styled multi-line text input, supporting color, size, hover/focus/loading states, fixed size, and all Bulma helper props.
40
42
  *
41
43
  * @function
42
44
  * @param {TextAreaProps} props - Props for TextArea.
@@ -8,15 +8,24 @@ export interface TextAreaBaseProps extends Omit<React.TextareaHTMLAttributes<HTM
8
8
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
9
9
  /** Size modifier for the textarea. */
10
10
  size?: 'small' | 'medium' | 'large';
11
- /** Rounded textarea corners. */
11
+ /**
12
+ * Adds the `is-rounded` class to the `<textarea>`. Bulma styles it on `.input` only, so the
13
+ * textarea's corners don't change.
14
+ */
12
15
  isRounded?: boolean;
13
- /** Renders textarea as static (styled readonly). */
16
+ /**
17
+ * Adds the `is-static` class to the `<textarea>`. Bulma styles it on `.input` only, so the
18
+ * textarea keeps its border, background and padding.
19
+ */
14
20
  isStatic?: boolean;
15
21
  /** Applies hovered state. */
16
22
  isHovered?: boolean;
17
23
  /** Applies focused state. */
18
24
  isFocused?: boolean;
19
- /** Shows loading indicator on the wrapping Control. */
25
+ /**
26
+ * Accepted and ignored: `TextAreaBase` renders no loading state. The spinner belongs to the
27
+ * wrapping `Control`, so set `isLoading` on that `Control`.
28
+ */
20
29
  isLoading?: boolean;
21
30
  /** Applies Bulma's is-active modifier. */
22
31
  isActive?: boolean;
@@ -5,6 +5,8 @@ import { TimeInputBaseProps } from './TimeInputBase.js';
5
5
  /**
6
6
  * Props for the TimeInput convenience wrapper. Extends `TimeInputBaseProps`
7
7
  * with Field-level (label, horizontal) and Control-level (icons, loading) props.
8
+ * Inside an existing `Control` within a `Field` it renders no `Field` or
9
+ * `Control` of its own, so set the Control-level props on that `Control` instead.
8
10
  * @extraProp {string} [name] - Form field name.
9
11
  * @extraProp {string} [form] - Form id the input belongs to.
10
12
  * @extraProp {boolean} [required=false] - Marks the input as required.
@@ -20,9 +22,17 @@ export interface TimeInputProps extends TimeInputBaseProps {
20
22
  labelProps?: FieldProps['labelProps'];
21
23
  /** Render the field with horizontal layout. */
22
24
  horizontal?: boolean;
23
- /** Icon props for the left icon. */
25
+ /**
26
+ * Icon props for the left icon.
27
+ * Bulma gives control icons `pointer-events: none`, so a clickable node here
28
+ * never receives a click. Put a button beside the input in its own addon `Control` instead.
29
+ */
24
30
  iconLeft?: ControlBaseProps['iconLeft'];
25
- /** Icon props for the right icon. */
31
+ /**
32
+ * Icon props for the right icon.
33
+ * Bulma gives control icons `pointer-events: none`, so a clickable node here
34
+ * never receives a click. Put a button beside the input in its own addon `Control` instead.
35
+ */
26
36
  iconRight?: ControlBaseProps['iconRight'];
27
37
  /** Shortcut for the right icon name. */
28
38
  iconRightName?: string;
@@ -35,7 +45,7 @@ export interface TimeInputProps extends TimeInputBaseProps {
35
45
  /** Force the right icon container. */
36
46
  hasIconsRight?: boolean;
37
47
  /**
38
- * Show a loading spinner on the control.
48
+ * Shows a loading spinner on the `Control` it renders.
39
49
  * Under `prefers-reduced-motion: reduce` the spinner stops and stays
40
50
  * drawn (with bestax's CSS loaded).
41
51
  */
@@ -55,7 +55,11 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
55
55
  closeOnSelect?: boolean;
56
56
  /** Popover anchor position relative to the input. */
57
57
  position?: PickerPosition;
58
- /** Render the popover into `document.body` via portal. */
58
+ /**
59
+ * Render the popover into `document.body` via portal. On a narrow screen
60
+ * an in-place popover spans the bottom of the viewport, while a portaled
61
+ * one stays on its `position` corner.
62
+ */
59
63
  appendToBody?: boolean;
60
64
  /**
61
65
  * Bulma color modifier for the input, also carried by the wheels, where it
@@ -18,7 +18,11 @@ export interface CalendarProps {
18
18
  size?: 'small' | 'medium' | 'large';
19
19
  className?: string;
20
20
  id?: string;
21
- /** When true, focus the cell matching `focusedDate` after each render. */
21
+ /**
22
+ * When true, the day or month grid takes focus as it renders, and again as
23
+ * it comes back from the year list. With or without it, once a grid has
24
+ * focus, focus follows its tab stop from cell to cell.
25
+ */
22
26
  autoFocusCell?: boolean;
23
27
  /** Optional translatable string overrides. */
24
28
  labels?: PickerLabels;
@@ -38,5 +42,10 @@ export interface CalendarProps {
38
42
  */
39
43
  granularity?: DateGranularity;
40
44
  }
45
+ /**
46
+ * Selects the calendar's focused cell, the one tab stop of whichever grid or
47
+ * year list is on show, for a popover to put focus on as it opens.
48
+ */
49
+ export declare const CALENDAR_FOCUSED_CELL = "[data-focused=\"true\"], [data-focused-year=\"true\"]";
41
50
  export declare const Calendar: React.FC<CalendarProps>;
42
51
  export default Calendar;
@@ -22,6 +22,12 @@ export interface PickerPopoverProps {
22
22
  * would be recorded instead, and that cell leaves with the panel.
23
23
  */
24
24
  restoreFocusRef?: React.RefObject<HTMLElement | null>;
25
+ /**
26
+ * Selects the element in the panel that takes focus as it opens, such as a
27
+ * calendar's focused date rather than the first button in its header. When
28
+ * nothing matches, or the match can't take focus, the first tab stop does.
29
+ */
30
+ initialFocusSelector?: string;
25
31
  }
26
32
  export declare const PickerPopover: React.FC<PickerPopoverProps>;
27
33
  export default PickerPopover;
@@ -11,10 +11,6 @@ type BulmaVars = Partial<Record<BulmaVarKey, string>>;
11
11
  *
12
12
  * @property {React.ReactNode} children - Content to render inside the theme scope.
13
13
  * @property {string} [className] - Additional CSS classes (only when isRoot is false).
14
- * @property {'light' | 'dark' | 'system'} [colorMode] - Set Bulma's light/dark scheme by writing
15
- * the `data-theme` attribute on the document root (`<html>`). This is always global, even on a
16
- * scoped Theme. `'system'` removes the attribute so Bulma follows the OS `prefers-color-scheme`.
17
- * Omit to leave the current setting untouched.
18
14
  * @property {BulmaVars} [bulmaVars] - Object mapping Bulma CSS variable names to values.
19
15
  * @property {string} [schemeH] - Scheme hue value.
20
16
  * @property {string} [schemeS] - Scheme saturation value.
@@ -76,6 +72,19 @@ export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroun
76
72
  * server render does not include them.
77
73
  */
78
74
  isRoot?: boolean;
75
+ /**
76
+ * Set Bulma's light/dark scheme by writing its theme attribute on the
77
+ * document root (`<html>`). This is always global, even on a scoped Theme.
78
+ * `'system'` removes the attribute so Bulma follows the OS
79
+ * `prefers-color-scheme`. Omit to leave the current setting untouched.
80
+ *
81
+ * The attribute is `data-theme`. A stylesheet built with a class prefix
82
+ * reads Bulma's prefixed form instead (`data-bestax-theme` for the
83
+ * `bestax-prefixed` builds), so under a `ConfigProvider` `classPrefix`
84
+ * Theme writes both, and `'system'` or unmounting clears or restores both.
85
+ * If the prefix cannot form an attribute name, `'light'` and `'dark'`
86
+ * write only `data-theme` and warn in development.
87
+ */
79
88
  colorMode?: 'light' | 'dark' | 'system';
80
89
  bulmaVars?: BulmaVars;
81
90
  /**
@@ -56,7 +56,8 @@ export interface PortalProps {
56
56
  * Tab order and focus follow the DOM too. Content portaled from inside a
57
57
  * focus trap is no longer inside the trapped element, so the trap neither
58
58
  * reaches it nor holds focus there: render nested overlays inside the
59
- * trapped element, or give them a trap of their own.
59
+ * trapped element, or give them a trap of their own. To trap portaled
60
+ * content, put `useFocusTrap`'s ref on the element inside the `Portal`.
60
61
  *
61
62
  * @function
62
63
  * @param {PortalProps} props - Props for the Portal component.
@@ -39,6 +39,12 @@ export interface UseAnchoredPositionOptions {
39
39
  */
40
40
  styledGap?: (panel: HTMLElement) => number;
41
41
  }
42
+ /**
43
+ * A `styledGap` for a panel whose stylesheet puts the gap in a margin on the
44
+ * side facing the anchor, negative on a portaled panel above it, so the
45
+ * larger magnitude is the gap. In pixels.
46
+ */
47
+ export declare function marginGap(panel: HTMLElement): number;
42
48
  /**
43
49
  * Places a floating panel against its anchor: resolves `auto` to a corner
44
50
  * and, for a panel fixed to the viewport, works out its coordinates. It
@@ -61,7 +61,8 @@ export interface UseFocusTrapOptions {
61
61
  * behaviour, and a modal also has to block the page behind it, which `Modal`
62
62
  * does. Content the container renders through a portal lives elsewhere in
63
63
  * the DOM, so it is outside the trap: render nested overlays inside the
64
- * container, or give them a trap of their own.
64
+ * container, or give them a trap of their own. To trap content a `Portal`
65
+ * renders, pass a ref to the element inside the `Portal` as `containerRef`.
65
66
  *
66
67
  * The container has to be in the DOM when the trap turns on. The trap waits
67
68
  * for hydration, so a container that only appears once the page has
@@ -25,7 +25,17 @@ export interface BulmaOtherProps {
25
25
  * on this axis.
26
26
  */
27
27
  overflowY?: (typeof validAxisOverflows)[number];
28
- /** Applies overlay styling if true. */
28
+ /**
29
+ * Covers the nearest positioned ancestor (`is-overlay`): `position:
30
+ * absolute` with `top`, `right`, `bottom` and `left` at 0.
31
+ *
32
+ * `pos` and `relative` set `position` with `!important`, so beside
33
+ * `overlay` either one replaces the `absolute` and keeps the zero offsets.
34
+ * `pos="fixed"` then covers the viewport instead of the ancestor. `sticky`,
35
+ * `relative` and `static` put the element back in the normal flow, where it
36
+ * covers nothing, and a sticky one sticks at every edge of its scroll
37
+ * container.
38
+ */
29
39
  overlay?: boolean;
30
40
  /** Interaction behavior (e.g., 'unselectable', 'clickable'). */
31
41
  interaction?: (typeof validInteractions)[number];
@@ -63,6 +73,8 @@ export interface BulmaOtherProps {
63
73
  * own CSS. `sticky` in particular does nothing until one is set.
64
74
  *
65
75
  * When `pos` is set it decides the position, and `relative` adds nothing.
76
+ * Beside `overlay` it replaces the overlay's `absolute` but not its zero
77
+ * offsets; see `overlay`.
66
78
  */
67
79
  pos?: (typeof validPositions)[number];
68
80
  /**