@allxsmith/bestax-bulma 5.33.1 → 5.34.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 (34) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/EmptyState.js +139 -0
  4. package/dist/esm/components/EmptyState.js.map +1 -0
  5. package/dist/esm/elements/Buttons.js.map +1 -1
  6. package/dist/esm/elements/SubTitle.js.map +1 -1
  7. package/dist/esm/elements/Title.js.map +1 -1
  8. package/dist/extras.css +1 -1
  9. package/dist/extras.css.map +1 -1
  10. package/dist/index.cjs +1079 -948
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.esm.js +1 -0
  13. package/dist/index.esm.js.map +1 -1
  14. package/dist/types/components/EmptyState.d.ts +149 -0
  15. package/dist/types/elements/Buttons.d.ts +1 -1
  16. package/dist/types/elements/SubTitle.d.ts +13 -2
  17. package/dist/types/elements/Title.d.ts +11 -2
  18. package/dist/types/index.d.ts +1 -0
  19. package/dist/types-cjs/components/EmptyState.d.ts +149 -0
  20. package/dist/types-cjs/elements/Buttons.d.ts +1 -1
  21. package/dist/types-cjs/elements/SubTitle.d.ts +13 -2
  22. package/dist/types-cjs/elements/Title.d.ts +11 -2
  23. package/dist/types-cjs/index.d.ts +1 -0
  24. package/dist/versions/bestax-no-dark-mode.css +1 -1
  25. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  26. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  27. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  28. package/dist/versions/bestax-no-helpers.css +1 -1
  29. package/dist/versions/bestax-no-helpers.css.map +1 -1
  30. package/dist/versions/bestax-prefixed.css +1 -1
  31. package/dist/versions/bestax-prefixed.css.map +1 -1
  32. package/package.json +1 -1
  33. package/src/scss/components/_emptystate.scss +243 -0
  34. package/src/scss/components/_index.scss +1 -0
package/dist/index.esm.js CHANGED
@@ -7,6 +7,7 @@ export { Badge } from './esm/components/Badge.js';
7
7
  export { Breadcrumb } from './esm/components/Breadcrumb.js';
8
8
  export { Card } from './esm/components/Card.js';
9
9
  export { Dropdown, DropdownDivider, DropdownItem, isBrowser } from './esm/components/Dropdown.js';
10
+ export { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIndicator, EmptyStateTitle } from './esm/components/EmptyState.js';
10
11
  export { Menu, MenuItem, MenuLabel, MenuList } from './esm/components/Menu.js';
11
12
  export { Message } from './esm/components/Message.js';
12
13
  export { Modal } from './esm/components/Modal.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,149 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ import { ButtonsProps } from '../elements/Buttons.js';
4
+ import { ParagraphProps } from '../elements/Paragraph.js';
5
+ import { TitleProps } from '../elements/Title.js';
6
+ declare const validEmptyStateColors: readonly ["primary", "link", "info", "success", "warning", "danger"];
7
+ /** The Bulma colors the indicator takes. */
8
+ export type EmptyStateColor = (typeof validEmptyStateColors)[number];
9
+ declare const validEmptyStateHeadings: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
10
+ /** A title's heading level. It's always a heading, so there's no `p`. */
11
+ export type EmptyStateHeading = (typeof validEmptyStateHeadings)[number];
12
+ /**
13
+ * Props for the EmptyState component. The helper props, the other attributes
14
+ * and the `ref` land on the root `<div>`. The native `title` attribute isn't
15
+ * one of them, since `title` here is the heading.
16
+ *
17
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root `<div>`.
18
+ */
19
+ export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'title'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
20
+ /** Additional CSS classes to apply. */
21
+ className?: string;
22
+ /**
23
+ * The picture in the indicator's circle. A string is an `Icon` name, drawn
24
+ * from the icon library `ConfigProvider` sets. Anything else (an `<Icon>`
25
+ * with its own `variant` or `library`, an SVG, an `<img>`) renders as it is.
26
+ * It's decorative and hidden from assistive tech, so the title says what
27
+ * it means.
28
+ */
29
+ icon?: React.ReactNode;
30
+ /**
31
+ * The heading, rendered as `EmptyState.Title`. It's always a real heading,
32
+ * at the level `titleAs` sets.
33
+ */
34
+ title?: React.ReactNode;
35
+ /**
36
+ * The heading level for `title`: the level under the heading of the list
37
+ * it stands in for, such as `h3` for a list under an `h2`. Only this sets
38
+ * the level, and the size comes from `size`.
39
+ */
40
+ titleAs?: EmptyStateHeading;
41
+ /** A sentence or two under the title, rendered as `EmptyState.Description`. */
42
+ description?: React.ReactNode;
43
+ /**
44
+ * Rendered as written, after whatever `icon`, `title` and `description`
45
+ * render. One button can go straight in, and it sits centered under the
46
+ * text. Group two or more in `EmptyState.Actions`, or they stack. Without
47
+ * the props, write the parts here in the order they're shown:
48
+ * `EmptyState.Indicator`, `.Title`, `.Description`, then the actions.
49
+ */
50
+ children?: React.ReactNode;
51
+ /**
52
+ * The indicator's color. It colors the circle and its icon, not the text.
53
+ * Without it the circle is neutral, since an empty list isn't a status.
54
+ */
55
+ color?: EmptyStateColor;
56
+ /**
57
+ * `light` is a soft tint of `color` behind the icon in the color. `filled`
58
+ * is the color itself, with the icon in its invert.
59
+ */
60
+ variant?: 'light' | 'filled';
61
+ /** Sizes the indicator, the title, the description and the spacing together. */
62
+ size?: 'small' | 'normal' | 'medium' | 'large';
63
+ /**
64
+ * `center` stacks everything in a centered column. `left` puts the
65
+ * indicator beside the text, at the start of the line, so on the right in
66
+ * a right-to-left page, and keeps the block at least as tall as the circle
67
+ * whatever block padding is in effect. Without an indicator, it only puts
68
+ * the text at the start of the line. In `left`, the padding at the start
69
+ * of the line is what makes room for the indicator, so pad it with `py`
70
+ * rather than `p` or `px`.
71
+ */
72
+ align?: 'center' | 'left';
73
+ /** Text color helper. */
74
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
75
+ /** Background color helper. */
76
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
77
+ }
78
+ /** Props for EmptyState.Indicator, the circle the picture sits in. */
79
+ export interface EmptyStateIndicatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
80
+ /** Additional CSS classes to apply. */
81
+ className?: string;
82
+ /**
83
+ * The picture: an `Icon`, an SVG or an `<img>`. The indicator is hidden
84
+ * from assistive tech, an `Icon` with an `ariaLabel` included, so anything
85
+ * it means goes in the title or the description.
86
+ */
87
+ children?: React.ReactNode;
88
+ /** Text color helper. */
89
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
90
+ /** Background color helper. */
91
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
92
+ }
93
+ /**
94
+ * Props for EmptyState.Title. It renders `Title` with `as` and never `size`,
95
+ * so the level is `as` alone and the size comes from the EmptyState.
96
+ */
97
+ export interface EmptyStateTitleProps extends Omit<TitleProps, 'as' | 'size' | 'isSpaced'> {
98
+ /**
99
+ * The heading level: the level under the heading of the list the empty
100
+ * state stands in for.
101
+ */
102
+ as?: EmptyStateHeading;
103
+ }
104
+ /** Props for EmptyState.Description, a `<p>` under the title. */
105
+ export type EmptyStateDescriptionProps = ParagraphProps;
106
+ /**
107
+ * Props for EmptyState.Actions, the row of buttons. It renders `Buttons`,
108
+ * and the EmptyState aligns it, so `isCentered` and `isRight` are left out.
109
+ */
110
+ export type EmptyStateActionsProps = Omit<ButtonsProps, 'isCentered' | 'isRight'>;
111
+ /**
112
+ * The circle the picture sits in, hidden from assistive tech whatever is in it.
113
+ *
114
+ * @function
115
+ * @param {EmptyStateIndicatorProps} props - Props for EmptyState.Indicator.
116
+ * @returns {JSX.Element} The rendered indicator.
117
+ */
118
+ export declare const EmptyStateIndicator: React.FC<EmptyStateIndicatorProps>;
119
+ /**
120
+ * The heading, a Bulma `Title` at the level `as` sets, `h2` by default, and at the EmptyState's size.
121
+ *
122
+ * @function
123
+ * @param {EmptyStateTitleProps} props - Props for EmptyState.Title.
124
+ * @returns {JSX.Element} The rendered heading.
125
+ */
126
+ export declare const EmptyStateTitle: React.FC<EmptyStateTitleProps>;
127
+ /**
128
+ * A sentence or two under the title, in the color of the text around it.
129
+ *
130
+ * @function
131
+ * @param {EmptyStateDescriptionProps} props - Props for EmptyState.Description.
132
+ * @returns {JSX.Element} The rendered description.
133
+ */
134
+ export declare const EmptyStateDescription: React.FC<EmptyStateDescriptionProps>;
135
+ /**
136
+ * A row of buttons, centered under the text or at the start of the line beside the indicator.
137
+ *
138
+ * @function
139
+ * @param {EmptyStateActionsProps} props - Props for EmptyState.Actions.
140
+ * @returns {JSX.Element} The rendered row of buttons.
141
+ */
142
+ export declare const EmptyStateActions: React.FC<EmptyStateActionsProps>;
143
+ export declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>> & {
144
+ Indicator: React.FC<EmptyStateIndicatorProps>;
145
+ Title: React.FC<EmptyStateTitleProps>;
146
+ Description: React.FC<ParagraphProps>;
147
+ Actions: React.FC<EmptyStateActionsProps>;
148
+ };
149
+ export default EmptyState;
@@ -8,7 +8,7 @@ export type ButtonsSize = (typeof validButtonsSizes)[number];
8
8
  /**
9
9
  * Props for the Buttons component.
10
10
  */
11
- interface ButtonsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'size'> {
11
+ export interface ButtonsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'size'> {
12
12
  /** Additional CSS classes to apply. */
13
13
  className?: string;
14
14
  /** Text color helper for the button group. */
@@ -16,9 +16,20 @@ export type SubTitleElement = (typeof validSubTitleElements)[number];
16
16
  export interface SubTitleProps extends Omit<React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>, 'color'>, Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {
17
17
  /** Additional CSS classes to apply. */
18
18
  className?: string;
19
- /** Size of the subtitle (Bulma sizes `1`-`6`, as a string or number). */
19
+ /**
20
+ * Size of the subtitle (Bulma sizes `1`-`6`, as a string or number). It
21
+ * also picks the heading level: unless `as` is `p`, `size="5"` renders an
22
+ * `<h5>`, whatever `as` says. For a heading whose level and size differ,
23
+ * set the level with `as` and the size with the `textSize` helper.
24
+ */
20
25
  size?: SubTitleSize;
21
- /** HTML element to render as (h1-h6 or p). */
26
+ /**
27
+ * HTML element to render as (`h1`-`h6` or `p`). With neither `as` nor
28
+ * `size` set it's an `<h1>`, so a subtitle that isn't a heading of its own
29
+ * takes `as="p"`. A `size` overrides `as` unless it's `p`, so
30
+ * `as="h3" size="5"` renders an `<h5>`. To keep the level `as` sets, size
31
+ * the subtitle with the `textSize` helper instead.
32
+ */
22
33
  as?: SubTitleElement;
23
34
  /** Applies the `has-skeleton` class to part of the content. */
24
35
  hasSkeleton?: boolean;
@@ -16,11 +16,20 @@ export type TitleElement = (typeof validTitleElements)[number];
16
16
  export interface TitleProps extends Omit<React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>, 'color'>, Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {
17
17
  /** Additional CSS classes to apply. */
18
18
  className?: string;
19
- /** Size of the title (Bulma sizes `1`-`6`, as a string or number). */
19
+ /**
20
+ * Size of the title (Bulma sizes `1`-`6`, as a string or number). It also
21
+ * picks the heading level: unless `as` is `p`, `size="4"` renders an
22
+ * `<h4>`, whatever `as` says. For a heading whose level and size differ,
23
+ * set the level with `as` and the size with the `textSize` helper.
24
+ */
20
25
  size?: TitleSize;
21
26
  /** Adds margin below the title. */
22
27
  isSpaced?: boolean;
23
- /** HTML element to render as (h1-h6 or p). */
28
+ /**
29
+ * HTML element to render as (`h1`-`h6` or `p`). A `size` overrides it
30
+ * unless it's `p`, so `as="h2" size="4"` renders an `<h4>`. To keep the
31
+ * level `as` sets, size the title with the `textSize` helper instead.
32
+ */
24
33
  as?: TitleElement;
25
34
  /** Applies the `has-skeleton` class to part of the content. */
26
35
  hasSkeleton?: boolean;
@@ -6,6 +6,7 @@ export * from './components/Badge.js';
6
6
  export * from './components/Breadcrumb.js';
7
7
  export * from './components/Card.js';
8
8
  export * from './components/Dropdown.js';
9
+ export * from './components/EmptyState.js';
9
10
  export * from './components/Menu.js';
10
11
  export * from './components/Message.js';
11
12
  export * from './components/Modal.js';
@@ -0,0 +1,149 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ import { ButtonsProps } from '../elements/Buttons.js';
4
+ import { ParagraphProps } from '../elements/Paragraph.js';
5
+ import { TitleProps } from '../elements/Title.js';
6
+ declare const validEmptyStateColors: readonly ["primary", "link", "info", "success", "warning", "danger"];
7
+ /** The Bulma colors the indicator takes. */
8
+ export type EmptyStateColor = (typeof validEmptyStateColors)[number];
9
+ declare const validEmptyStateHeadings: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
10
+ /** A title's heading level. It's always a heading, so there's no `p`. */
11
+ export type EmptyStateHeading = (typeof validEmptyStateHeadings)[number];
12
+ /**
13
+ * Props for the EmptyState component. The helper props, the other attributes
14
+ * and the `ref` land on the root `<div>`. The native `title` attribute isn't
15
+ * one of them, since `title` here is the heading.
16
+ *
17
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root `<div>`.
18
+ */
19
+ export interface EmptyStateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'title'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
20
+ /** Additional CSS classes to apply. */
21
+ className?: string;
22
+ /**
23
+ * The picture in the indicator's circle. A string is an `Icon` name, drawn
24
+ * from the icon library `ConfigProvider` sets. Anything else (an `<Icon>`
25
+ * with its own `variant` or `library`, an SVG, an `<img>`) renders as it is.
26
+ * It's decorative and hidden from assistive tech, so the title says what
27
+ * it means.
28
+ */
29
+ icon?: React.ReactNode;
30
+ /**
31
+ * The heading, rendered as `EmptyState.Title`. It's always a real heading,
32
+ * at the level `titleAs` sets.
33
+ */
34
+ title?: React.ReactNode;
35
+ /**
36
+ * The heading level for `title`: the level under the heading of the list
37
+ * it stands in for, such as `h3` for a list under an `h2`. Only this sets
38
+ * the level, and the size comes from `size`.
39
+ */
40
+ titleAs?: EmptyStateHeading;
41
+ /** A sentence or two under the title, rendered as `EmptyState.Description`. */
42
+ description?: React.ReactNode;
43
+ /**
44
+ * Rendered as written, after whatever `icon`, `title` and `description`
45
+ * render. One button can go straight in, and it sits centered under the
46
+ * text. Group two or more in `EmptyState.Actions`, or they stack. Without
47
+ * the props, write the parts here in the order they're shown:
48
+ * `EmptyState.Indicator`, `.Title`, `.Description`, then the actions.
49
+ */
50
+ children?: React.ReactNode;
51
+ /**
52
+ * The indicator's color. It colors the circle and its icon, not the text.
53
+ * Without it the circle is neutral, since an empty list isn't a status.
54
+ */
55
+ color?: EmptyStateColor;
56
+ /**
57
+ * `light` is a soft tint of `color` behind the icon in the color. `filled`
58
+ * is the color itself, with the icon in its invert.
59
+ */
60
+ variant?: 'light' | 'filled';
61
+ /** Sizes the indicator, the title, the description and the spacing together. */
62
+ size?: 'small' | 'normal' | 'medium' | 'large';
63
+ /**
64
+ * `center` stacks everything in a centered column. `left` puts the
65
+ * indicator beside the text, at the start of the line, so on the right in
66
+ * a right-to-left page, and keeps the block at least as tall as the circle
67
+ * whatever block padding is in effect. Without an indicator, it only puts
68
+ * the text at the start of the line. In `left`, the padding at the start
69
+ * of the line is what makes room for the indicator, so pad it with `py`
70
+ * rather than `p` or `px`.
71
+ */
72
+ align?: 'center' | 'left';
73
+ /** Text color helper. */
74
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
75
+ /** Background color helper. */
76
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
77
+ }
78
+ /** Props for EmptyState.Indicator, the circle the picture sits in. */
79
+ export interface EmptyStateIndicatorProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
80
+ /** Additional CSS classes to apply. */
81
+ className?: string;
82
+ /**
83
+ * The picture: an `Icon`, an SVG or an `<img>`. The indicator is hidden
84
+ * from assistive tech, an `Icon` with an `ariaLabel` included, so anything
85
+ * it means goes in the title or the description.
86
+ */
87
+ children?: React.ReactNode;
88
+ /** Text color helper. */
89
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
90
+ /** Background color helper. */
91
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
92
+ }
93
+ /**
94
+ * Props for EmptyState.Title. It renders `Title` with `as` and never `size`,
95
+ * so the level is `as` alone and the size comes from the EmptyState.
96
+ */
97
+ export interface EmptyStateTitleProps extends Omit<TitleProps, 'as' | 'size' | 'isSpaced'> {
98
+ /**
99
+ * The heading level: the level under the heading of the list the empty
100
+ * state stands in for.
101
+ */
102
+ as?: EmptyStateHeading;
103
+ }
104
+ /** Props for EmptyState.Description, a `<p>` under the title. */
105
+ export type EmptyStateDescriptionProps = ParagraphProps;
106
+ /**
107
+ * Props for EmptyState.Actions, the row of buttons. It renders `Buttons`,
108
+ * and the EmptyState aligns it, so `isCentered` and `isRight` are left out.
109
+ */
110
+ export type EmptyStateActionsProps = Omit<ButtonsProps, 'isCentered' | 'isRight'>;
111
+ /**
112
+ * The circle the picture sits in, hidden from assistive tech whatever is in it.
113
+ *
114
+ * @function
115
+ * @param {EmptyStateIndicatorProps} props - Props for EmptyState.Indicator.
116
+ * @returns {JSX.Element} The rendered indicator.
117
+ */
118
+ export declare const EmptyStateIndicator: React.FC<EmptyStateIndicatorProps>;
119
+ /**
120
+ * The heading, a Bulma `Title` at the level `as` sets, `h2` by default, and at the EmptyState's size.
121
+ *
122
+ * @function
123
+ * @param {EmptyStateTitleProps} props - Props for EmptyState.Title.
124
+ * @returns {JSX.Element} The rendered heading.
125
+ */
126
+ export declare const EmptyStateTitle: React.FC<EmptyStateTitleProps>;
127
+ /**
128
+ * A sentence or two under the title, in the color of the text around it.
129
+ *
130
+ * @function
131
+ * @param {EmptyStateDescriptionProps} props - Props for EmptyState.Description.
132
+ * @returns {JSX.Element} The rendered description.
133
+ */
134
+ export declare const EmptyStateDescription: React.FC<EmptyStateDescriptionProps>;
135
+ /**
136
+ * A row of buttons, centered under the text or at the start of the line beside the indicator.
137
+ *
138
+ * @function
139
+ * @param {EmptyStateActionsProps} props - Props for EmptyState.Actions.
140
+ * @returns {JSX.Element} The rendered row of buttons.
141
+ */
142
+ export declare const EmptyStateActions: React.FC<EmptyStateActionsProps>;
143
+ export declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>> & {
144
+ Indicator: React.FC<EmptyStateIndicatorProps>;
145
+ Title: React.FC<EmptyStateTitleProps>;
146
+ Description: React.FC<ParagraphProps>;
147
+ Actions: React.FC<EmptyStateActionsProps>;
148
+ };
149
+ export default EmptyState;
@@ -8,7 +8,7 @@ export type ButtonsSize = (typeof validButtonsSizes)[number];
8
8
  /**
9
9
  * Props for the Buttons component.
10
10
  */
11
- interface ButtonsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'size'> {
11
+ export interface ButtonsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'size'> {
12
12
  /** Additional CSS classes to apply. */
13
13
  className?: string;
14
14
  /** Text color helper for the button group. */
@@ -16,9 +16,20 @@ export type SubTitleElement = (typeof validSubTitleElements)[number];
16
16
  export interface SubTitleProps extends Omit<React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>, 'color'>, Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {
17
17
  /** Additional CSS classes to apply. */
18
18
  className?: string;
19
- /** Size of the subtitle (Bulma sizes `1`-`6`, as a string or number). */
19
+ /**
20
+ * Size of the subtitle (Bulma sizes `1`-`6`, as a string or number). It
21
+ * also picks the heading level: unless `as` is `p`, `size="5"` renders an
22
+ * `<h5>`, whatever `as` says. For a heading whose level and size differ,
23
+ * set the level with `as` and the size with the `textSize` helper.
24
+ */
20
25
  size?: SubTitleSize;
21
- /** HTML element to render as (h1-h6 or p). */
26
+ /**
27
+ * HTML element to render as (`h1`-`h6` or `p`). With neither `as` nor
28
+ * `size` set it's an `<h1>`, so a subtitle that isn't a heading of its own
29
+ * takes `as="p"`. A `size` overrides `as` unless it's `p`, so
30
+ * `as="h3" size="5"` renders an `<h5>`. To keep the level `as` sets, size
31
+ * the subtitle with the `textSize` helper instead.
32
+ */
22
33
  as?: SubTitleElement;
23
34
  /** Applies the `has-skeleton` class to part of the content. */
24
35
  hasSkeleton?: boolean;
@@ -16,11 +16,20 @@ export type TitleElement = (typeof validTitleElements)[number];
16
16
  export interface TitleProps extends Omit<React.HTMLAttributes<HTMLHeadingElement | HTMLParagraphElement>, 'color'>, Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {
17
17
  /** Additional CSS classes to apply. */
18
18
  className?: string;
19
- /** Size of the title (Bulma sizes `1`-`6`, as a string or number). */
19
+ /**
20
+ * Size of the title (Bulma sizes `1`-`6`, as a string or number). It also
21
+ * picks the heading level: unless `as` is `p`, `size="4"` renders an
22
+ * `<h4>`, whatever `as` says. For a heading whose level and size differ,
23
+ * set the level with `as` and the size with the `textSize` helper.
24
+ */
20
25
  size?: TitleSize;
21
26
  /** Adds margin below the title. */
22
27
  isSpaced?: boolean;
23
- /** HTML element to render as (h1-h6 or p). */
28
+ /**
29
+ * HTML element to render as (`h1`-`h6` or `p`). A `size` overrides it
30
+ * unless it's `p`, so `as="h2" size="4"` renders an `<h4>`. To keep the
31
+ * level `as` sets, size the title with the `textSize` helper instead.
32
+ */
24
33
  as?: TitleElement;
25
34
  /** Applies the `has-skeleton` class to part of the content. */
26
35
  hasSkeleton?: boolean;
@@ -6,6 +6,7 @@ export * from './components/Badge.js';
6
6
  export * from './components/Breadcrumb.js';
7
7
  export * from './components/Card.js';
8
8
  export * from './components/Dropdown.js';
9
+ export * from './components/EmptyState.js';
9
10
  export * from './components/Menu.js';
10
11
  export * from './components/Message.js';
11
12
  export * from './components/Modal.js';