@allxsmith/bestax-bulma 5.19.0 → 5.22.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 (60) 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 +247 -25
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.esm.js +244 -26
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/components/Collapse.d.ts +13 -9
  10. package/dist/types/components/Collapses.d.ts +53 -0
  11. package/dist/types/components/collapsesContext.d.ts +19 -0
  12. package/dist/types/elements/Button.d.ts +5 -1
  13. package/dist/types/elements/Loader.d.ts +39 -0
  14. package/dist/types/form/Autocomplete.d.ts +5 -1
  15. package/dist/types/form/Control.d.ts +5 -1
  16. package/dist/types/form/DateInput.d.ts +5 -1
  17. package/dist/types/form/DateTimeInput.d.ts +5 -1
  18. package/dist/types/form/Input.d.ts +5 -1
  19. package/dist/types/form/Numberinput.d.ts +5 -1
  20. package/dist/types/form/Select.d.ts +5 -1
  21. package/dist/types/form/SelectBase.d.ts +5 -1
  22. package/dist/types/form/Taginput.d.ts +5 -1
  23. package/dist/types/form/TextArea.d.ts +5 -1
  24. package/dist/types/form/TimeInput.d.ts +5 -1
  25. package/dist/types/helpers/ClientOnly.d.ts +40 -0
  26. package/dist/types/helpers/inertProps.d.ts +11 -0
  27. package/dist/types/helpers/useIsHydrated.d.ts +5 -0
  28. package/dist/types/index.d.ts +5 -0
  29. package/dist/types-cjs/components/Collapse.d.ts +13 -9
  30. package/dist/types-cjs/components/Collapses.d.ts +53 -0
  31. package/dist/types-cjs/components/collapsesContext.d.ts +19 -0
  32. package/dist/types-cjs/elements/Button.d.ts +5 -1
  33. package/dist/types-cjs/elements/Loader.d.ts +39 -0
  34. package/dist/types-cjs/form/Autocomplete.d.ts +5 -1
  35. package/dist/types-cjs/form/Control.d.ts +5 -1
  36. package/dist/types-cjs/form/DateInput.d.ts +5 -1
  37. package/dist/types-cjs/form/DateTimeInput.d.ts +5 -1
  38. package/dist/types-cjs/form/Input.d.ts +5 -1
  39. package/dist/types-cjs/form/Numberinput.d.ts +5 -1
  40. package/dist/types-cjs/form/Select.d.ts +5 -1
  41. package/dist/types-cjs/form/SelectBase.d.ts +5 -1
  42. package/dist/types-cjs/form/Taginput.d.ts +5 -1
  43. package/dist/types-cjs/form/TextArea.d.ts +5 -1
  44. package/dist/types-cjs/form/TimeInput.d.ts +5 -1
  45. package/dist/types-cjs/helpers/ClientOnly.d.ts +40 -0
  46. package/dist/types-cjs/helpers/inertProps.d.ts +11 -0
  47. package/dist/types-cjs/helpers/useIsHydrated.d.ts +5 -0
  48. package/dist/types-cjs/index.d.ts +5 -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/components/_collapse.scss +13 -4
  59. package/src/scss/elements/_index.scss +1 -0
  60. package/src/scss/elements/_loader.scss +23 -0
@@ -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;
@@ -0,0 +1,40 @@
1
+ import React from 'react';
2
+ /**
3
+ * Props for the ClientOnly component.
4
+ */
5
+ export interface ClientOnlyProps {
6
+ /**
7
+ * Content to render once the page has hydrated. A function is called only
8
+ * then, so an inline expression that reads `window`, `document` or
9
+ * `localStorage` never runs on the server.
10
+ */
11
+ children?: React.ReactNode | (() => React.ReactNode);
12
+ /**
13
+ * Rendered on the server and during hydration instead of `children`, such
14
+ * as a placeholder the same size as the content so the layout doesn't
15
+ * shift when it arrives.
16
+ * @defaultValue null
17
+ */
18
+ fallback?: React.ReactNode;
19
+ }
20
+ /**
21
+ * Renders its children only in the browser, after hydration, and a `fallback` until then, so content that depends on browser-only state doesn't cause a hydration mismatch.
22
+ *
23
+ * The server render and the hydrating client render both show `fallback`,
24
+ * which keeps them identical; the children replace it in the commit that
25
+ * follows. In an app without server rendering the children show on the first
26
+ * render.
27
+ *
28
+ * @function
29
+ * @param {ClientOnlyProps} props - Props for the ClientOnly component.
30
+ * @returns The children once hydrated, otherwise the fallback.
31
+ *
32
+ * @example
33
+ * // The server's time zone is not the reader's.
34
+ * <ClientOnly fallback={<Skeleton variant="lines" lines={1} />}>
35
+ * {() => (
36
+ * <p>Times are shown in {Intl.DateTimeFormat().resolvedOptions().timeZone}.</p>
37
+ * )}
38
+ * </ClientOnly>
39
+ */
40
+ export declare function ClientOnly({ children, fallback }: ClientOnlyProps): React.JSX.Element;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ /**
3
+ * The prop that makes an element inert, spelled for the React in use, or
4
+ * nothing when `inert` is false.
5
+ *
6
+ * Both majors must render `inert=""`, and each warns on the other's spelling
7
+ * and then drops the attribute. React 19 treats `inert` as a boolean and
8
+ * rejects the empty string. React 18 does not know the attribute, so it
9
+ * passes a string through and rejects `true`.
10
+ */
11
+ export declare const inertProps: (inert: boolean, major?: number) => React.HTMLAttributes<HTMLElement>;
@@ -6,6 +6,11 @@
6
6
  * DOM-only behaviour (such as portalling) past hydration so the first client
7
7
  * render matches the server markup instead of tripping hydration recovery.
8
8
  *
9
+ * Only a component that hydrates ever sees `false` on the client. One that
10
+ * mounts later (after a route change, or in an app with no server rendering)
11
+ * gets `true` on its first render, so it pays for no extra render. It
12
+ * subscribes to nothing, so no later render flips it back.
13
+ *
9
14
  * @function useIsHydrated
10
15
  * @returns `true` once the hydrating render has completed, otherwise `false`.
11
16
  */
@@ -15,6 +15,7 @@ export * from './components/Panel.js';
15
15
  export * from './components/Tabs.js';
16
16
  export * from './components/Loading.js';
17
17
  export * from './components/Collapse.js';
18
+ export * from './components/Collapses.js';
18
19
  export * from './components/Tooltip.js';
19
20
  export * from './components/Steps.js';
20
21
  export * from './components/Sidebar.js';
@@ -38,6 +39,7 @@ export * from './elements/IconText.js';
38
39
  export * from './elements/Image.js';
39
40
  export * from './elements/Link.js';
40
41
  export * from './elements/ListItem.js';
42
+ export * from './elements/Loader.js';
41
43
  export * from './elements/Notification.js';
42
44
  export * from './elements/OrderedList.js';
43
45
  export * from './elements/Paragraph.js';
@@ -105,6 +107,9 @@ export * from './helpers/mergeBulmaStyles.js';
105
107
  export * from './helpers/useBulmaClasses.js';
106
108
  export * from './helpers/Theme.js';
107
109
  export * from './helpers/Config.js';
110
+ export { ClientOnly } from './helpers/ClientOnly.js';
111
+ export type { ClientOnlyProps } from './helpers/ClientOnly.js';
112
+ export { useIsHydrated } from './helpers/useIsHydrated.js';
108
113
  export * from './layout/Container.js';
109
114
  export * from './layout/Footer.js';
110
115
  export * from './layout/Hero.js';