@allxsmith/bestax-bulma 5.19.0 → 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 (47) 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 +30 -0
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.esm.js +30 -1
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/elements/Button.d.ts +5 -1
  10. package/dist/types/elements/Loader.d.ts +39 -0
  11. package/dist/types/form/Autocomplete.d.ts +5 -1
  12. package/dist/types/form/Control.d.ts +5 -1
  13. package/dist/types/form/DateInput.d.ts +5 -1
  14. package/dist/types/form/DateTimeInput.d.ts +5 -1
  15. package/dist/types/form/Input.d.ts +5 -1
  16. package/dist/types/form/Numberinput.d.ts +5 -1
  17. package/dist/types/form/Select.d.ts +5 -1
  18. package/dist/types/form/SelectBase.d.ts +5 -1
  19. package/dist/types/form/Taginput.d.ts +5 -1
  20. package/dist/types/form/TextArea.d.ts +5 -1
  21. package/dist/types/form/TimeInput.d.ts +5 -1
  22. package/dist/types/index.d.ts +1 -0
  23. package/dist/types-cjs/elements/Button.d.ts +5 -1
  24. package/dist/types-cjs/elements/Loader.d.ts +39 -0
  25. package/dist/types-cjs/form/Autocomplete.d.ts +5 -1
  26. package/dist/types-cjs/form/Control.d.ts +5 -1
  27. package/dist/types-cjs/form/DateInput.d.ts +5 -1
  28. package/dist/types-cjs/form/DateTimeInput.d.ts +5 -1
  29. package/dist/types-cjs/form/Input.d.ts +5 -1
  30. package/dist/types-cjs/form/Numberinput.d.ts +5 -1
  31. package/dist/types-cjs/form/Select.d.ts +5 -1
  32. package/dist/types-cjs/form/SelectBase.d.ts +5 -1
  33. package/dist/types-cjs/form/Taginput.d.ts +5 -1
  34. package/dist/types-cjs/form/TextArea.d.ts +5 -1
  35. package/dist/types-cjs/form/TimeInput.d.ts +5 -1
  36. package/dist/types-cjs/index.d.ts +1 -0
  37. package/dist/versions/bestax-no-dark-mode.css +1 -1
  38. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  39. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  40. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  41. package/dist/versions/bestax-no-helpers.css +1 -1
  42. package/dist/versions/bestax-no-helpers.css.map +1 -1
  43. package/dist/versions/bestax-prefixed.css +1 -1
  44. package/dist/versions/bestax-prefixed.css.map +1 -1
  45. package/package.json +1 -1
  46. package/src/scss/elements/_index.scss +1 -0
  47. package/src/scss/elements/_loader.scss +23 -0
@@ -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;
@@ -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>>;
@@ -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;
@@ -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;
@@ -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;
@@ -38,6 +38,7 @@ export * from './elements/IconText.js';
38
38
  export * from './elements/Image.js';
39
39
  export * from './elements/Link.js';
40
40
  export * from './elements/ListItem.js';
41
+ export * from './elements/Loader.js';
41
42
  export * from './elements/Notification.js';
42
43
  export * from './elements/OrderedList.js';
43
44
  export * from './elements/Paragraph.js';
@@ -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;
@@ -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>>;
@@ -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;
@@ -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;
@@ -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;
@@ -38,6 +38,7 @@ export * from './elements/IconText.js';
38
38
  export * from './elements/Image.js';
39
39
  export * from './elements/Link.js';
40
40
  export * from './elements/ListItem.js';
41
+ export * from './elements/Loader.js';
41
42
  export * from './elements/Notification.js';
42
43
  export * from './elements/OrderedList.js';
43
44
  export * from './elements/Paragraph.js';