@allxsmith/bestax-bulma 5.18.2 → 5.20.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 (94) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/constants.cjs +67 -6
  4. package/dist/constants.cjs.map +1 -1
  5. package/dist/constants.d.cts +30 -6
  6. package/dist/constants.esm.js +65 -7
  7. package/dist/constants.esm.js.map +1 -1
  8. package/dist/extras.css +1 -1
  9. package/dist/extras.css.map +1 -1
  10. package/dist/index.cjs +628 -52
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.esm.js +625 -53
  13. package/dist/index.esm.js.map +1 -1
  14. package/dist/types/components/Card.d.ts +2 -0
  15. package/dist/types/components/Carousel.d.ts +8 -2
  16. package/dist/types/components/Modal.d.ts +2 -0
  17. package/dist/types/components/Navbar.d.ts +24 -3
  18. package/dist/types/components/Sidebar.d.ts +2 -0
  19. package/dist/types/components/Steps.d.ts +5 -1
  20. package/dist/types/elements/Button.d.ts +5 -1
  21. package/dist/types/elements/Delete.d.ts +9 -1
  22. package/dist/types/elements/Link.d.ts +7 -1
  23. package/dist/types/elements/Loader.d.ts +39 -0
  24. package/dist/types/elements/Notification.d.ts +29 -3
  25. package/dist/types/elements/Tag.d.ts +7 -1
  26. package/dist/types/elements/Td.d.ts +21 -2
  27. package/dist/types/form/Autocomplete.d.ts +5 -1
  28. package/dist/types/form/Control.d.ts +5 -1
  29. package/dist/types/form/DateInput.d.ts +5 -1
  30. package/dist/types/form/DateInputBase.d.ts +9 -1
  31. package/dist/types/form/DateTimeInput.d.ts +5 -1
  32. package/dist/types/form/DateTimeInputBase.d.ts +11 -4
  33. package/dist/types/form/Input.d.ts +5 -1
  34. package/dist/types/form/Numberinput.d.ts +5 -1
  35. package/dist/types/form/Select.d.ts +5 -1
  36. package/dist/types/form/SelectBase.d.ts +5 -1
  37. package/dist/types/form/Taginput.d.ts +5 -1
  38. package/dist/types/form/TextArea.d.ts +5 -1
  39. package/dist/types/form/TimeInput.d.ts +5 -1
  40. package/dist/types/form/TimeInputBase.d.ts +4 -2
  41. package/dist/types/helpers/Theme.d.ts +6 -1
  42. package/dist/types/helpers/bulmaClassHelpers.d.ts +30 -6
  43. package/dist/types/helpers/shadowDom.d.ts +54 -0
  44. package/dist/types/helpers/statusRegion.d.ts +61 -0
  45. package/dist/types/helpers/useBulmaClasses.d.ts +1 -1
  46. package/dist/types/helpers/useOtherClasses.d.ts +61 -5
  47. package/dist/types/index.d.ts +1 -0
  48. package/dist/types-cjs/components/Card.d.ts +2 -0
  49. package/dist/types-cjs/components/Carousel.d.ts +8 -2
  50. package/dist/types-cjs/components/Modal.d.ts +2 -0
  51. package/dist/types-cjs/components/Navbar.d.ts +24 -3
  52. package/dist/types-cjs/components/Sidebar.d.ts +2 -0
  53. package/dist/types-cjs/components/Steps.d.ts +5 -1
  54. package/dist/types-cjs/elements/Button.d.ts +5 -1
  55. package/dist/types-cjs/elements/Delete.d.ts +9 -1
  56. package/dist/types-cjs/elements/Link.d.ts +7 -1
  57. package/dist/types-cjs/elements/Loader.d.ts +39 -0
  58. package/dist/types-cjs/elements/Notification.d.ts +29 -3
  59. package/dist/types-cjs/elements/Tag.d.ts +7 -1
  60. package/dist/types-cjs/elements/Td.d.ts +21 -2
  61. package/dist/types-cjs/form/Autocomplete.d.ts +5 -1
  62. package/dist/types-cjs/form/Control.d.ts +5 -1
  63. package/dist/types-cjs/form/DateInput.d.ts +5 -1
  64. package/dist/types-cjs/form/DateInputBase.d.ts +9 -1
  65. package/dist/types-cjs/form/DateTimeInput.d.ts +5 -1
  66. package/dist/types-cjs/form/DateTimeInputBase.d.ts +11 -4
  67. package/dist/types-cjs/form/Input.d.ts +5 -1
  68. package/dist/types-cjs/form/Numberinput.d.ts +5 -1
  69. package/dist/types-cjs/form/Select.d.ts +5 -1
  70. package/dist/types-cjs/form/SelectBase.d.ts +5 -1
  71. package/dist/types-cjs/form/Taginput.d.ts +5 -1
  72. package/dist/types-cjs/form/TextArea.d.ts +5 -1
  73. package/dist/types-cjs/form/TimeInput.d.ts +5 -1
  74. package/dist/types-cjs/form/TimeInputBase.d.ts +4 -2
  75. package/dist/types-cjs/helpers/Theme.d.ts +6 -1
  76. package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +30 -6
  77. package/dist/types-cjs/helpers/shadowDom.d.ts +54 -0
  78. package/dist/types-cjs/helpers/statusRegion.d.ts +61 -0
  79. package/dist/types-cjs/helpers/useBulmaClasses.d.ts +1 -1
  80. package/dist/types-cjs/helpers/useOtherClasses.d.ts +61 -5
  81. package/dist/types-cjs/index.d.ts +1 -0
  82. package/dist/versions/bestax-no-dark-mode.css +1 -1
  83. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  84. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  85. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  86. package/dist/versions/bestax-no-helpers.css +1 -1
  87. package/dist/versions/bestax-no-helpers.css.map +1 -1
  88. package/dist/versions/bestax-prefixed.css +1 -1
  89. package/dist/versions/bestax-prefixed.css.map +1 -1
  90. package/package.json +1 -1
  91. package/src/scss/elements/_index.scss +1 -0
  92. package/src/scss/elements/_loader.scss +23 -0
  93. package/src/scss/form/_dateinput.scss +36 -10
  94. package/src/scss/form/_timeinput.scss +30 -9
@@ -156,6 +156,8 @@ export interface CardHeaderTitleProps extends React.HTMLAttributes<HTMLDivElemen
156
156
  }
157
157
  /**
158
158
  * Props for the Card.Header.Icon compound component.
159
+ * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a header icon inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.
160
+ * @extraProp {string} [aria-label='more options'] - Accessible name. Pass your own to replace it. An empty one, or a spread carrying `'aria-label': undefined`, keeps the default rather than leaving the button unnamed.
159
161
  */
160
162
  export interface CardHeaderIconProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
161
163
  /** Bulma color modifier (text color helper). */
@@ -38,11 +38,17 @@ export interface CarouselProps extends Omit<React.HTMLAttributes<HTMLDivElement>
38
38
  repeat?: boolean;
39
39
  /** Enable drag/swipe navigation. Default: true. */
40
40
  hasDrag?: boolean;
41
- /** Show navigation arrows. Default: true. */
41
+ /**
42
+ * Show navigation arrows. Default: true. They render `type="button"`, so a
43
+ * carousel inside a form is not submitted by moving between slides.
44
+ */
42
45
  arrow?: boolean;
43
46
  /** Only show arrows on hover. */
44
47
  arrowHover?: boolean;
45
- /** Show slide indicators. Default: true. */
48
+ /**
49
+ * Show slide indicators. Default: true. They render `type="button"`, so a
50
+ * carousel inside a form is not submitted by picking a slide.
51
+ */
46
52
  indicator?: boolean;
47
53
  /** Position indicators inside carousel. */
48
54
  indicatorInside?: boolean;
@@ -103,6 +103,8 @@ export interface ModalCardFootProps extends React.HTMLAttributes<HTMLElement> {
103
103
  }
104
104
  /**
105
105
  * Props for Modal.Close component.
106
+ * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a close button inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.
107
+ * @extraProp {string} [aria-label='close'] - Accessible name. Pass your own to replace it. An empty one, or a spread carrying `'aria-label': undefined`, keeps the default rather than leaving the button unnamed.
106
108
  */
107
109
  export interface ModalCloseProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
108
110
  /** Additional CSS classes. */
@@ -86,7 +86,13 @@ export interface NavbarItemOwnProps extends Omit<BulmaClassesProps, 'color' | 'b
86
86
  * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
87
87
  */
88
88
  export type NavbarItemProps<T extends React.ElementType = 'a'> = NavbarItemOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarItemOwnProps | 'as'> & {
89
- /** Render as another intrinsic element (`'span'`, `'div'`) or a custom component (e.g. a router link). Defaults to `'a'`. */
89
+ /**
90
+ * Render as another intrinsic element (`'span'`, `'div'`, `'button'`) or a custom component (e.g. a router link). Defaults to `'a'`.
91
+ *
92
+ * `'button'` renders `type="button"`, so an item inside a form does not submit it. Pass
93
+ * `type="submit"` or `type="reset"` and yours is used; any other value, or a spread
94
+ * carrying `type: undefined`, renders `type="button"`.
95
+ */
90
96
  as?: T;
91
97
  };
92
98
  /**
@@ -101,6 +107,7 @@ export declare const NavbarItem: PolymorphicComponent<NavbarItemOwnProps, "a">;
101
107
  /**
102
108
  * Props for the NavbarBurger component.
103
109
  * @extraProp {React.Ref<HTMLButtonElement>} [ref] - Ref forwarded to the burger button element.
110
+ * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a burger inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.
104
111
  */
105
112
  export interface NavbarBurgerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
106
113
  /** Additional CSS classes. */
@@ -122,9 +129,19 @@ export interface NavbarBurgerProps extends React.ButtonHTMLAttributes<HTMLButton
122
129
  * draws an extra bar.
123
130
  */
124
131
  children?: React.ReactNode;
125
- /** Aria label for accessibility. */
132
+ /**
133
+ * Accessible name. Pass your own to replace it. An empty one, or a spread
134
+ * carrying `'aria-label': undefined`, keeps the default rather than leaving
135
+ * the button unnamed.
136
+ * @defaultValue 'menu'
137
+ */
126
138
  'aria-label'?: string;
127
- /** Aria expanded state. */
139
+ /**
140
+ * Expanded state for assistive technology. It follows `active` unless you
141
+ * pass `true` or `false`; a spread carrying `'aria-expanded': undefined`
142
+ * still follows `active`.
143
+ * @defaultValue active
144
+ */
128
145
  'aria-expanded'?: boolean;
129
146
  /** Click handler. */
130
147
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
@@ -254,6 +271,10 @@ export type NavbarLinkProps<T extends React.ElementType = 'a'> = NavbarLinkOwnPr
254
271
  * If your custom component renders something non-interactive, pass `role="button"` and
255
272
  * it takes that fallback too — `tabIndex` and click included. The keyboard path is
256
273
  * attached either way.
274
+ *
275
+ * `'button'` renders `type="button"`, so a link inside a form does not submit it. Pass
276
+ * `type="submit"` or `type="reset"` and yours is used; any other value, or a spread
277
+ * carrying `type: undefined`, renders `type="button"`.
257
278
  */
258
279
  as?: T;
259
280
  };
@@ -50,6 +50,8 @@ interface SidebarTitleProps extends React.HTMLAttributes<HTMLParagraphElement> {
50
50
  /**
51
51
  * Props for the SidebarClose component.
52
52
  * Extends standard button attributes.
53
+ * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a close button inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.
54
+ * @extraProp {string} [aria-label='Close'] - Accessible name. Pass your own to replace it. An empty one, or a spread carrying `'aria-label': undefined`, keeps the default rather than leaving the button unnamed.
53
55
  */
54
56
  type SidebarCloseProps = React.ButtonHTMLAttributes<HTMLButtonElement>;
55
57
  /**
@@ -50,7 +50,11 @@ export interface StepsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
50
50
  mobileMode?: 'minimal' | 'compact' | 'right';
51
51
  /** Displays step numbers in the markers. */
52
52
  showStepNumbers?: boolean;
53
- /** Shows previous/next navigation buttons. */
53
+ /**
54
+ * Shows previous/next navigation buttons. They render `type="button"`, so a
55
+ * multi-step form wrapped around the steps is not submitted by moving
56
+ * between them.
57
+ */
54
58
  hasNavigation?: boolean;
55
59
  /** Label for the previous button. */
56
60
  prevLabel?: string;
@@ -21,7 +21,11 @@ export interface ButtonOwnProps extends Omit<BulmaClassesProps, 'color' | 'backg
21
21
  isLight?: boolean;
22
22
  /** Makes the button rounded. */
23
23
  isRounded?: boolean;
24
- /** Displays a loading spinner. */
24
+ /**
25
+ * Displays a loading spinner.
26
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
27
+ * drawn (with bestax's CSS loaded).
28
+ */
25
29
  isLoading?: boolean;
26
30
  /** Makes the button non-interactive. */
27
31
  isStatic?: boolean;
@@ -21,7 +21,13 @@ interface DeleteProps extends React.HTMLAttributes<HTMLButtonElement>, BulmaClas
21
21
  onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
22
22
  /** Size modifier for the delete button. */
23
23
  size?: 'small' | 'medium' | 'large';
24
- /** ARIA label for accessibility (default: 'Close'). */
24
+ /**
25
+ * Accessible name for the button. An `aria-label` you pass takes precedence
26
+ * over it, unless it is empty or arrives as `undefined` through a spread.
27
+ * An empty `ariaLabel` falls back to the default too, so the button is never
28
+ * left unnamed.
29
+ * @defaultValue 'Close'
30
+ */
25
31
  ariaLabel?: string;
26
32
  /** Whether the button is disabled (default: false). */
27
33
  disabled?: boolean;
@@ -29,6 +35,8 @@ interface DeleteProps extends React.HTMLAttributes<HTMLButtonElement>, BulmaClas
29
35
  /**
30
36
  * The `Delete` component provides a Bulma-styled close/delete button for dismissing modals, notifications, tags, messages, and more.
31
37
  *
38
+ * It renders `type="button"`, so a delete button inside a form does not submit it.
39
+ *
32
40
  * @function
33
41
  * @param {DeleteProps} props - Props for the Delete component.
34
42
  * @returns {JSX.Element} The rendered delete button.
@@ -40,7 +40,13 @@ export interface LinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'backgro
40
40
  * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
41
41
  */
42
42
  export type LinkProps<T extends React.ElementType = 'a'> = LinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof LinkOwnProps | 'as'> & {
43
- /** Render as another intrinsic element (`'span'`, `'button'`) or a custom component (e.g. a router `Link`) instead of `<a>`. Defaults to `'a'`. */
43
+ /**
44
+ * Render as another intrinsic element (`'span'`, `'button'`) or a custom component (e.g. a router `Link`) instead of `<a>`. Defaults to `'a'`.
45
+ *
46
+ * `'button'` renders `type="button"`, so a link inside a form does not submit it. Pass
47
+ * `type="submit"` or `type="reset"` and yours is used; any other value, or a spread
48
+ * carrying `type: undefined`, renders `type="button"`.
49
+ */
44
50
  as?: T;
45
51
  };
46
52
  /**
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
3
+ /**
4
+ * Props for the Loader component.
5
+ *
6
+ * There is no color prop, and the text and background color helpers are left
7
+ * out on purpose: Bulma draws the ring in `--bulma-border`, so a text color
8
+ * never reaches it. For a colored spinner over a region, use `Loading`.
9
+ *
10
+ * @extraProp {React.Ref<HTMLSpanElement>} [ref] - Ref forwarded to the loader element.
11
+ */
12
+ export interface LoaderProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'color' | 'children'>, Omit<BulmaClassesProps, 'color' | 'colorShade' | 'backgroundColor' | 'backgroundColorShade'> {
13
+ /** Additional CSS classes to apply. */
14
+ className?: string;
15
+ /**
16
+ * Accessible name of the progress indicator. Name what is loading
17
+ * (`"Saving row"`) when more than one loader can be on screen at once.
18
+ */
19
+ ariaLabel?: string;
20
+ }
21
+ /**
22
+ * The `Loader` component renders Bulma's `.loader`, a small spinning ring for inline loading states.
23
+ *
24
+ * The ring is `1em` square, so `textSize` scales it. It is exposed as an
25
+ * indeterminate `progressbar` named by `ariaLabel`, and it stops spinning
26
+ * under `prefers-reduced-motion: reduce` while staying drawn.
27
+ *
28
+ * @function
29
+ * @param {LoaderProps} props - Props for the Loader component.
30
+ * @param {React.Ref<HTMLSpanElement>} ref - Forwarded ref to the loader element.
31
+ * @returns {JSX.Element} The rendered loader element.
32
+ *
33
+ * @example
34
+ * <Loader />
35
+ *
36
+ * @example
37
+ * <Loader textSize="3" ariaLabel="Saving" />
38
+ */
39
+ export declare const Loader: React.ForwardRefExoticComponent<LoaderProps & React.RefAttributes<HTMLSpanElement>>;
@@ -20,7 +20,10 @@ export interface NotificationProps extends React.HTMLAttributes<HTMLDivElement>,
20
20
  textColor?: (typeof validColors)[number] | 'inherit' | 'current';
21
21
  /** Use the light color variant. */
22
22
  isLight?: boolean;
23
- /** Shows a close (delete) button in the notification. */
23
+ /**
24
+ * Shows a close (delete) button in the notification. It renders
25
+ * `type="button"`, so it does not submit a form around it.
26
+ */
24
27
  hasDelete?: boolean;
25
28
  /** Callback fired when the delete button is clicked. */
26
29
  onDelete?: () => void;
@@ -42,7 +45,18 @@ export type NotificationPosition = 'top-left' | 'top' | 'top-right' | 'bottom-le
42
45
  * Options for showing a programmatic notification.
43
46
  */
44
47
  export interface NotificationOptions {
45
- /** The message to display. */
48
+ /**
49
+ * The message to display.
50
+ *
51
+ * For a notification other than `danger` and `warning`, NotificationContainer
52
+ * announces the text the message renders, with an element's `aria-label`,
53
+ * or an image's `alt`, standing in for what's inside it, a break between
54
+ * block-level elements, and parts that are `aria-hidden`, `hidden` or
55
+ * inline-styled `display: none` left out. Other ways of naming or hiding
56
+ * content, such as `aria-labelledby`, CSS-generated content or a
57
+ * stylesheet's `display: none`, aren't followed, so a message that relies on
58
+ * them can be announced differently from what a screen reader would read.
59
+ */
46
60
  message: string | React.ReactNode;
47
61
  /**
48
62
  * Bulma color modifier for the notification (renders `is-<color>`).
@@ -147,9 +161,21 @@ export declare const notification: {
147
161
  * container's `position`, so the container renders a stack for each position
148
162
  * in use.
149
163
  *
164
+ * It keeps a visually hidden `role="status"` live region in the page from the
165
+ * moment it mounts, even while nothing is showing, and announces every
166
+ * notification other than `danger` and `warning` through it, a moment after
167
+ * the notification appears. Those notifications carry no `role="status"` of
168
+ * their own, so `getByRole('status')` finds the region, not the notification.
169
+ * The text stays in the region briefly, even if the notification closes in
170
+ * the meantime, and while both are up the page holds two copies of it. A
171
+ * polite notification that closes before its announcement is written, a
172
+ * moment after it appears, isn't announced at all. `danger` and `warning`
173
+ * notifications announce themselves as assertive alerts. The region is hidden
174
+ * with inline styles, so it needs no stylesheet.
175
+ *
150
176
  * @function
151
177
  * @param {{ position?: NotificationPosition }} props - Container props.
152
- * @returns {JSX.Element | null} The rendered notification container, or null if empty.
178
+ * @returns {JSX.Element | null} The rendered notification container, or null on the server and while hydrating.
153
179
  */
154
180
  export declare const NotificationContainer: React.FC<{
155
181
  /**
@@ -24,7 +24,13 @@ export interface TagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'c
24
24
  isLight?: boolean;
25
25
  /** Renders a rounded tag. */
26
26
  isRounded?: boolean;
27
- /** Renders a delete-style tag (delete button). */
27
+ /**
28
+ * Renders a delete-style tag (delete button). The button renders
29
+ * `type="button"`, so it does not submit a form around it, and is named
30
+ * "Delete tag" unless you pass an `aria-label`. An empty one, or a spread
31
+ * carrying `'aria-label': undefined`, keeps that name rather than leaving
32
+ * the button unnamed.
33
+ */
28
34
  isDelete?: boolean;
29
35
  /** Adds hover effect to the tag. */
30
36
  isHoverable?: boolean;
@@ -3,10 +3,29 @@
3
3
  */
4
4
  import React from 'react';
5
5
  import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
6
- /** Valid Bulma color values for table cells. */
6
+ /**
7
+ * The values the table `color` prop accepts, as a readonly tuple.
8
+ *
9
+ * `TableColor` is typed from it, and `Tr`, `Th` and `Td` all take a
10
+ * `TableColor`, so the tuple and those props list the same values. Map over
11
+ * it to build a color picker, or check a value that arrives at runtime before
12
+ * passing it in: the components add no color class for a value outside the
13
+ * tuple.
14
+ *
15
+ * @example
16
+ * import { Tr, Td, validTableColors } from '@allxsmith/bestax-bulma';
17
+ *
18
+ * <Tr>
19
+ * {validTableColors.map(color => (
20
+ * <Td key={color} color={color}>
21
+ * {color}
22
+ * </Td>
23
+ * ))}
24
+ * </Tr>;
25
+ */
7
26
  export declare const validTableColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "dark", "light", "white"];
8
27
  /**
9
- * Valid color values for the Td component (Bulma table cell colors).
28
+ * The color values `Tr`, `Th` and `Td` accept, typed from `validTableColors`.
10
29
  */
11
30
  export type TableColor = (typeof validTableColors)[number];
12
31
  /**
@@ -51,7 +51,11 @@ export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElem
51
51
  maxHeight?: number;
52
52
  /** Render as dropdown style. */
53
53
  dropdown?: boolean;
54
- /** Show loading state. */
54
+ /**
55
+ * Show a loading spinner in the input.
56
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
57
+ * drawn (with bestax's CSS loaded).
58
+ */
55
59
  loading?: boolean;
56
60
  /** Whether the input is disabled. */
57
61
  disabled?: boolean;
@@ -9,7 +9,11 @@ export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>,
9
9
  hasIconsLeft?: boolean;
10
10
  /** Adds right icon container. */
11
11
  hasIconsRight?: boolean;
12
- /** Shows loading indicator. */
12
+ /**
13
+ * Shows a loading spinner inside the control.
14
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
15
+ * drawn (with bestax's CSS loaded).
16
+ */
13
17
  isLoading?: boolean;
14
18
  /** Makes the control expand to fill available space. */
15
19
  isExpanded?: boolean;
@@ -34,7 +34,11 @@ export interface DateInputProps extends DateInputBaseProps {
34
34
  hasIconsLeft?: boolean;
35
35
  /** Force the right icon container. */
36
36
  hasIconsRight?: boolean;
37
- /** Show a loading indicator on the control. */
37
+ /**
38
+ * Show a loading spinner on the control.
39
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
40
+ * drawn (with bestax's CSS loaded).
41
+ */
38
42
  isLoading?: boolean;
39
43
  /** Expand the control to fill its container. */
40
44
  isExpanded?: boolean;
@@ -52,7 +52,15 @@ export interface DateInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
52
52
  position?: PickerPosition;
53
53
  /** Render the popover into `document.body` via portal. */
54
54
  appendToBody?: boolean;
55
- /** Bulma color modifier. */
55
+ /**
56
+ * Bulma color modifier for the input, also carried by the calendar, where it
57
+ * colors the selected date. Today's date and the keyboard focus ring take
58
+ * the color's `-on-scheme` variant, which Bulma adjusts to contrast with the
59
+ * background, so pale colors stay readable; that makes `'primary'` a shade
60
+ * off the unset calendar, which uses plain `primary` for both. Unset, the
61
+ * calendar uses its `--bulma-dateinput-*` variables, which follow `primary`
62
+ * by default.
63
+ */
56
64
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
57
65
  /** Size variant. */
58
66
  size?: 'small' | 'medium' | 'large';
@@ -32,7 +32,11 @@ export interface DateTimeInputProps extends DateTimeInputBaseProps {
32
32
  hasIconsLeft?: boolean;
33
33
  /** Force the right icon container. */
34
34
  hasIconsRight?: boolean;
35
- /** Show a loading indicator on the control. */
35
+ /**
36
+ * Show a loading spinner on the control.
37
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
38
+ * drawn (with bestax's CSS loaded).
39
+ */
36
40
  isLoading?: boolean;
37
41
  /** Expand the control to fill its container. */
38
42
  isExpanded?: boolean;
@@ -54,10 +54,17 @@ export interface DateTimeInputBaseProps extends Omit<React.InputHTMLAttributes<H
54
54
  /** Render the popover into `document.body` via portal. */
55
55
  appendToBody?: boolean;
56
56
  /**
57
- * Bulma color modifier for the input, also carried by the time wheels, where
58
- * it colors the selection band and the keyboard focus ring. Unset, the
59
- * wheels use `--bulma-timeinput-wheel-selected-bg`, which defaults to
60
- * `primary`. The calendar does not take it.
57
+ * Bulma color modifier for the input, also carried by the calendar and the
58
+ * time wheels, where it colors the selected date and the selection band.
59
+ * Today's date and the calendar's keyboard focus ring take the color's
60
+ * `-on-scheme` variant, which Bulma adjusts to contrast with the background,
61
+ * so pale colors stay readable; that makes `'primary'` a shade off the unset
62
+ * calendar, which uses plain `primary` for them. A focused wheel's ring is
63
+ * drawn inside the band in the color's `-invert`, like the selected value,
64
+ * so it shows on the fill. Unset, they use their
65
+ * `--bulma-dateinput-*` and `--bulma-timeinput-wheel-*` variables, which
66
+ * follow `primary` by default. The footer's time pill and Done button stay
67
+ * `primary` either way.
61
68
  */
62
69
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
63
70
  /** Size variant. */
@@ -34,7 +34,11 @@ export interface InputProps extends InputBaseProps {
34
34
  hasIconsLeft?: boolean;
35
35
  /** Force right icon container. */
36
36
  hasIconsRight?: boolean;
37
- /** Shows loading indicator. */
37
+ /**
38
+ * Shows a loading spinner on the wrapping Control.
39
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
40
+ * drawn (with bestax's CSS loaded).
41
+ */
38
42
  isLoading?: boolean;
39
43
  /** Expand the control. */
40
44
  isExpanded?: boolean;
@@ -53,7 +53,11 @@ export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInp
53
53
  disabled?: boolean;
54
54
  /** Whether the input can be typed in. */
55
55
  editable?: boolean;
56
- /** Shows a loading state. */
56
+ /**
57
+ * Shows a loading spinner on the input's control.
58
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
59
+ * drawn (with bestax's CSS loaded).
60
+ */
57
61
  isLoading?: boolean;
58
62
  /** Enables exponential step increments when holding buttons. */
59
63
  exponential?: boolean;
@@ -26,7 +26,11 @@ export interface SelectProps extends SelectBaseProps {
26
26
  iconLeftSize?: ControlBaseProps['iconLeftSize'];
27
27
  /** Force left icon container. */
28
28
  hasIconsLeft?: boolean;
29
- /** Shows loading indicator. */
29
+ /**
30
+ * Replaces the chevron with a loading spinner.
31
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
32
+ * drawn (with bestax's CSS loaded).
33
+ */
30
34
  isLoading?: boolean;
31
35
  /** Expand the control. */
32
36
  isExpanded?: boolean;
@@ -10,7 +10,11 @@ export interface SelectBaseProps extends Omit<React.SelectHTMLAttributes<HTMLSel
10
10
  size?: 'small' | 'medium' | 'large';
11
11
  /** Rounded select corners. */
12
12
  isRounded?: boolean;
13
- /** Shows loading indicator. */
13
+ /**
14
+ * Replaces the chevron with a loading spinner.
15
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
16
+ * drawn (with bestax's CSS loaded).
17
+ */
14
18
  isLoading?: boolean;
15
19
  /** Applies Bulma's is-active modifier. */
16
20
  isActive?: boolean;
@@ -76,7 +76,11 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
76
76
  keepFirst?: boolean;
77
77
  /** Keeps the autocomplete dropdown open after selection. */
78
78
  keepOpen?: boolean;
79
- /** Shows a loading indicator. */
79
+ /**
80
+ * Shows a loading spinner in the input.
81
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
82
+ * drawn (with bestax's CSS loaded).
83
+ */
80
84
  loading?: boolean;
81
85
  /** ARIA label for tag close buttons. */
82
86
  ariaCloseLabel?: string;
@@ -18,7 +18,11 @@ export interface TextAreaProps extends TextAreaBaseProps {
18
18
  labelProps?: FieldProps['labelProps'];
19
19
  /** Horizontal field layout. */
20
20
  horizontal?: boolean;
21
- /** Shows loading indicator on the wrapping Control. */
21
+ /**
22
+ * Shows a loading spinner on the wrapping Control.
23
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
24
+ * drawn (with bestax's CSS loaded).
25
+ */
22
26
  isLoading?: boolean;
23
27
  /** Control size. */
24
28
  controlSize?: ControlBaseProps['size'];
@@ -34,7 +34,11 @@ export interface TimeInputProps extends TimeInputBaseProps {
34
34
  hasIconsLeft?: boolean;
35
35
  /** Force the right icon container. */
36
36
  hasIconsRight?: boolean;
37
- /** Show a loading indicator on the control. */
37
+ /**
38
+ * Show a loading spinner on the control.
39
+ * Under `prefers-reduced-motion: reduce` the spinner stops and stays
40
+ * drawn (with bestax's CSS loaded).
41
+ */
38
42
  isLoading?: boolean;
39
43
  /** Expand the control to fill its container. */
40
44
  isExpanded?: boolean;
@@ -54,8 +54,10 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
54
54
  appendToBody?: boolean;
55
55
  /**
56
56
  * Bulma color modifier for the input, also carried by the wheels, where it
57
- * colors the selection band and the keyboard focus ring. Unset, the wheels
58
- * use `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`.
57
+ * colors the selection band. A focused wheel's keyboard focus ring is drawn
58
+ * inside the band in the color's `-invert`, like the selected value, so it
59
+ * shows on the fill. Unset, the wheels use
60
+ * `--bulma-timeinput-wheel-selected-bg`, which defaults to `primary`.
59
61
  */
60
62
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
61
63
  /** Size variant. */
@@ -77,7 +77,12 @@ export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroun
77
77
  * written at `:root`, which squares everything on the page that takes its
78
78
  * radius from it.
79
79
  *
80
- * For any other radius, set the variable through `bulmaVars`
80
+ * The sizes (`small`, `normal`, `large`, `rounded`) add their
81
+ * `has-radius-<value>` class to the wrapper div and set no variable, so
82
+ * they round the wrapper and leave what is inside it alone. Under `isRoot`
83
+ * there is no wrapper, so they do nothing, and say so in development.
84
+ *
85
+ * To change the radius of what is inside, set the variable through `bulmaVars`
81
86
  * (`bulmaVars={{ '--bulma-radius': '6px' }}`). This prop used to write the
82
87
  * variable for every value, so any other non-empty string still does, but
83
88
  * that route is deprecated and logs a warning in development. A number or
@@ -104,10 +104,31 @@ export declare const validViewports: readonly ["mobile", "tablet", "tablet-only"
104
104
  */
105
105
  export declare const validFloats: readonly ["left", "right"];
106
106
  /**
107
- * Valid Bulma overflow classes.
108
- * @example 'clipped'
107
+ * Valid Bulma overflow values for one axis, taken by `overflowX` and
108
+ * `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.
109
+ * @example 'auto', 'hidden', 'scroll'
109
110
  */
110
- export declare const validOverflows: readonly ["clipped"];
111
+ export declare const validAxisOverflows: readonly ["auto", "clip", "hidden", "scroll", "visible"];
112
+ /**
113
+ * Valid Bulma overflow values for `overflow`.
114
+ *
115
+ * `clipped` renders `is-clipped`, the helper `overflow` started with. Every
116
+ * other value renders `is-overflow-<value>`.
117
+ * @example 'clipped', 'auto', 'hidden'
118
+ */
119
+ export declare const validOverflows: readonly ["clipped", "auto", "clip", "hidden", "scroll", "visible"];
120
+ /**
121
+ * Valid Bulma position values, taken by `pos`. Each renders
122
+ * `is-position-<value>`.
123
+ * @example 'relative', 'absolute', 'sticky'
124
+ */
125
+ export declare const validPositions: readonly ["absolute", "fixed", "relative", "static", "sticky"];
126
+ /**
127
+ * Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders
128
+ * `is-aspect-ratio-<value>`.
129
+ * @example '1by1', '4by3', '16by9'
130
+ */
131
+ export declare const validAspectRatios: readonly ["1by1", "5by4", "4by3", "3by2", "5by3", "16by9", "2by1", "3by1", "4by5", "3by4", "2by3", "3by5", "9by16", "1by2", "1by3"];
111
132
  /**
112
133
  * Valid Bulma interaction classes.
113
134
  * @example 'unselectable', 'clickable'
@@ -132,10 +153,13 @@ export declare const validCursors: readonly ["pointer", "help"];
132
153
  */
133
154
  export declare const cursorClasses: Record<(typeof validCursors)[number], string>;
134
155
  /**
135
- * Valid Bulma border-radius helper classes.
136
- * @example 'radiusless'
156
+ * Valid Bulma border-radius helper values.
157
+ *
158
+ * `radiusless` renders `is-radiusless` and removes the radius. The sizes
159
+ * render `has-radius-<value>` and set one from Bulma's radius scale.
160
+ * @example 'radiusless', 'small', 'rounded'
137
161
  */
138
- export declare const validRadii: readonly ["radiusless"];
162
+ export declare const validRadii: readonly ["radiusless", "small", "normal", "large", "rounded"];
139
163
  /**
140
164
  * Valid Bulma shadow helper classes.
141
165
  * @example 'shadowless'