@allxsmith/bestax-bulma 5.50.0 → 5.51.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.
package/dist/index.esm.js CHANGED
@@ -41,6 +41,7 @@ export { ToggleButton } from './esm/elements/ToggleButton.js';
41
41
  export { Code } from './esm/elements/Code.js';
42
42
  export { Content } from './esm/elements/Content.js';
43
43
  export { Delete } from './esm/elements/Delete.js';
44
+ export { DescriptionList, DescriptionListItem, DescriptionListLabel, DescriptionListValue } from './esm/elements/DescriptionList.js';
44
45
  export { Divider } from './esm/elements/Divider.js';
45
46
  export { Emphasis } from './esm/elements/Emphasis.js';
46
47
  export { Figure } from './esm/elements/Figure.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,185 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ declare const validDescriptionListOrientations: readonly ["vertical", "horizontal"];
4
+ /** Whether each label sits above its value (`vertical`) or beside it (`horizontal`). */
5
+ export type DescriptionListOrientation = (typeof validDescriptionListOrientations)[number];
6
+ /**
7
+ * Props for the DescriptionList component. The helper props, the other
8
+ * attributes and the `ref` land on the `<dl>`.
9
+ *
10
+ * @extraProp {React.Ref<HTMLDListElement>} [ref] - Ref forwarded to the `<dl>`.
11
+ * @extraProp {string} [aria-labelledby] - The id of the heading above the list, which names it.
12
+ */
13
+ export interface DescriptionListProps extends Omit<React.HTMLAttributes<HTMLDListElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
14
+ /** Additional CSS classes to apply. */
15
+ className?: string;
16
+ /** `DescriptionList.Item`s, one for each fact. */
17
+ children?: React.ReactNode;
18
+ /**
19
+ * Whether each label sits above its value or beside it, at every width no
20
+ * `orientation<Viewport>` prop covers. Those props read the way a
21
+ * `Column`'s `size<Viewport>` props do: `orientationMobile` applies below
22
+ * Bulma's tablet breakpoint, each of the others from its own breakpoint
23
+ * up, and where several apply the widest one wins. With none of them,
24
+ * labels sit above their values below the tablet breakpoint and beside
25
+ * them from it up. Beside, the labels share one column as wide as the
26
+ * longest label, up to `--bulma-description-list-label-max-width`, so the
27
+ * values line up.
28
+ */
29
+ orientation?: DescriptionListOrientation;
30
+ /**
31
+ * The orientation below Bulma's tablet breakpoint (769px). Falls back to
32
+ * `orientation`, then to `vertical`.
33
+ */
34
+ orientationMobile?: DescriptionListOrientation;
35
+ /**
36
+ * The orientation from Bulma's tablet breakpoint (769px) up, until a wider
37
+ * viewport's prop takes over. Falls back to `orientation`, then to
38
+ * `horizontal`.
39
+ */
40
+ orientationTablet?: DescriptionListOrientation;
41
+ /**
42
+ * The orientation from Bulma's desktop breakpoint (1024px) up, until a
43
+ * wider viewport's prop takes over. Falls back to `orientationTablet`, and
44
+ * on down.
45
+ */
46
+ orientationDesktop?: DescriptionListOrientation;
47
+ /**
48
+ * The orientation from Bulma's widescreen breakpoint (1216px) up, until
49
+ * `orientationFullhd` takes over. Falls back to `orientationDesktop`, and
50
+ * on down.
51
+ */
52
+ orientationWidescreen?: DescriptionListOrientation;
53
+ /**
54
+ * The orientation from Bulma's fullhd breakpoint (1408px) up. Falls back to
55
+ * `orientationWidescreen`, and on down.
56
+ */
57
+ orientationFullhd?: DescriptionListOrientation;
58
+ /**
59
+ * Draws a line between items, which helps the eye from a label to its
60
+ * value across a wide list, and shows where each item ends to someone
61
+ * zoomed in.
62
+ */
63
+ hasDividers?: boolean;
64
+ /** Text color helper. It colors the values; the labels keep their own color. */
65
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
66
+ /** Background color helper. */
67
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
68
+ }
69
+ /**
70
+ * Props for DescriptionList.Item, one fact. The helper props, the other
71
+ * attributes and the `ref` land on its `<div>`.
72
+ *
73
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `<div>`.
74
+ */
75
+ export interface DescriptionListItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
76
+ /** Additional CSS classes to apply. */
77
+ className?: string;
78
+ /**
79
+ * The label, such as "Order", as a `DescriptionList.Label` before the
80
+ * children.
81
+ */
82
+ label?: React.ReactNode;
83
+ /**
84
+ * The value, such as "#1234", as a `DescriptionList.Value` after the
85
+ * children. Text, a link, a `Tag`: anything that renders. `undefined`,
86
+ * `null` and `''` render nothing, so when a value is missing, say so in
87
+ * words, such as "Not given", rather than leave a label with nothing after
88
+ * it.
89
+ */
90
+ value?: React.ReactNode;
91
+ /**
92
+ * `DescriptionList.Label`s and `DescriptionList.Value`s, for what `label`
93
+ * and `value` don't cover, such as a label with an info tip or several
94
+ * values. They render between the two, so a `Label` here reads before
95
+ * `value`, and a `Value` here after `label`.
96
+ */
97
+ children?: React.ReactNode;
98
+ /** Text color helper. */
99
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
100
+ /** Background color helper. */
101
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
102
+ }
103
+ /**
104
+ * Props for DescriptionList.Label. The helper props, the other attributes and
105
+ * the `ref` land on its `<dt>`.
106
+ *
107
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dt>`.
108
+ */
109
+ export interface DescriptionListLabelProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
110
+ /** Additional CSS classes to apply. */
111
+ className?: string;
112
+ /**
113
+ * The label. A button may sit in it, such as one that opens a `Popover`
114
+ * about the label, but not a heading, which HTML doesn't allow here.
115
+ */
116
+ children?: React.ReactNode;
117
+ /** Text color helper. */
118
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
119
+ /** Background color helper. */
120
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
121
+ }
122
+ /**
123
+ * Props for DescriptionList.Value. The helper props, the other attributes and
124
+ * the `ref` land on its `<dd>`.
125
+ *
126
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dd>`.
127
+ */
128
+ export interface DescriptionListValueProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
129
+ /** Additional CSS classes to apply. */
130
+ className?: string;
131
+ /** The value. Anything goes, a list or a paragraph included. */
132
+ children?: React.ReactNode;
133
+ /** Text color helper. */
134
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
135
+ /** Background color helper. */
136
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
137
+ }
138
+ /**
139
+ * A label, the name of a fact: a `<dt>`, in the weaker text color.
140
+ *
141
+ * @function
142
+ * @param {DescriptionListLabelProps} props - Props for DescriptionList.Label.
143
+ * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dt>`.
144
+ * @returns {JSX.Element} The rendered label.
145
+ *
146
+ * @example
147
+ * <DescriptionList.Label>Placed on</DescriptionList.Label>
148
+ */
149
+ export declare const DescriptionListLabel: React.ForwardRefExoticComponent<DescriptionListLabelProps & React.RefAttributes<HTMLElement>>;
150
+ /**
151
+ * A value, what the label says about the thing: a `<dd>`. An item may have several.
152
+ *
153
+ * @function
154
+ * @param {DescriptionListValueProps} props - Props for DescriptionList.Value.
155
+ * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dd>`.
156
+ * @returns {JSX.Element} The rendered value.
157
+ *
158
+ * @example
159
+ * <DescriptionList.Value>14 October 2026</DescriptionList.Value>
160
+ */
161
+ export declare const DescriptionListValue: React.ForwardRefExoticComponent<DescriptionListValueProps & React.RefAttributes<HTMLElement>>;
162
+ /**
163
+ * One fact: its label and its value, in a `<div>`, from the `label` and `value` props or from `Label` and `Value` children.
164
+ *
165
+ * @function
166
+ * @param {DescriptionListItemProps} props - Props for DescriptionList.Item.
167
+ * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `<div>`.
168
+ * @returns {JSX.Element} The rendered item.
169
+ *
170
+ * @example
171
+ * <DescriptionList.Item label="Order" value="#1234" />
172
+ *
173
+ * @example
174
+ * <DescriptionList.Item label="Tags">
175
+ * <DescriptionList.Value>Gift</DescriptionList.Value>
176
+ * <DescriptionList.Value>Priority</DescriptionList.Value>
177
+ * </DescriptionList.Item>
178
+ */
179
+ export declare const DescriptionListItem: React.ForwardRefExoticComponent<DescriptionListItemProps & React.RefAttributes<HTMLDivElement>>;
180
+ export declare const DescriptionList: React.ForwardRefExoticComponent<DescriptionListProps & React.RefAttributes<HTMLDListElement>> & {
181
+ Item: React.ForwardRefExoticComponent<DescriptionListItemProps & React.RefAttributes<HTMLDivElement>>;
182
+ Label: React.ForwardRefExoticComponent<DescriptionListLabelProps & React.RefAttributes<HTMLElement>>;
183
+ Value: React.ForwardRefExoticComponent<DescriptionListValueProps & React.RefAttributes<HTMLElement>>;
184
+ };
185
+ export default DescriptionList;
@@ -40,6 +40,7 @@ export * from './elements/ToggleButton.js';
40
40
  export * from './elements/Code.js';
41
41
  export * from './elements/Content.js';
42
42
  export * from './elements/Delete.js';
43
+ export * from './elements/DescriptionList.js';
43
44
  export * from './elements/Divider.js';
44
45
  export * from './elements/Emphasis.js';
45
46
  export * from './elements/Figure.js';
@@ -0,0 +1,185 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
3
+ declare const validDescriptionListOrientations: readonly ["vertical", "horizontal"];
4
+ /** Whether each label sits above its value (`vertical`) or beside it (`horizontal`). */
5
+ export type DescriptionListOrientation = (typeof validDescriptionListOrientations)[number];
6
+ /**
7
+ * Props for the DescriptionList component. The helper props, the other
8
+ * attributes and the `ref` land on the `<dl>`.
9
+ *
10
+ * @extraProp {React.Ref<HTMLDListElement>} [ref] - Ref forwarded to the `<dl>`.
11
+ * @extraProp {string} [aria-labelledby] - The id of the heading above the list, which names it.
12
+ */
13
+ export interface DescriptionListProps extends Omit<React.HTMLAttributes<HTMLDListElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
14
+ /** Additional CSS classes to apply. */
15
+ className?: string;
16
+ /** `DescriptionList.Item`s, one for each fact. */
17
+ children?: React.ReactNode;
18
+ /**
19
+ * Whether each label sits above its value or beside it, at every width no
20
+ * `orientation<Viewport>` prop covers. Those props read the way a
21
+ * `Column`'s `size<Viewport>` props do: `orientationMobile` applies below
22
+ * Bulma's tablet breakpoint, each of the others from its own breakpoint
23
+ * up, and where several apply the widest one wins. With none of them,
24
+ * labels sit above their values below the tablet breakpoint and beside
25
+ * them from it up. Beside, the labels share one column as wide as the
26
+ * longest label, up to `--bulma-description-list-label-max-width`, so the
27
+ * values line up.
28
+ */
29
+ orientation?: DescriptionListOrientation;
30
+ /**
31
+ * The orientation below Bulma's tablet breakpoint (769px). Falls back to
32
+ * `orientation`, then to `vertical`.
33
+ */
34
+ orientationMobile?: DescriptionListOrientation;
35
+ /**
36
+ * The orientation from Bulma's tablet breakpoint (769px) up, until a wider
37
+ * viewport's prop takes over. Falls back to `orientation`, then to
38
+ * `horizontal`.
39
+ */
40
+ orientationTablet?: DescriptionListOrientation;
41
+ /**
42
+ * The orientation from Bulma's desktop breakpoint (1024px) up, until a
43
+ * wider viewport's prop takes over. Falls back to `orientationTablet`, and
44
+ * on down.
45
+ */
46
+ orientationDesktop?: DescriptionListOrientation;
47
+ /**
48
+ * The orientation from Bulma's widescreen breakpoint (1216px) up, until
49
+ * `orientationFullhd` takes over. Falls back to `orientationDesktop`, and
50
+ * on down.
51
+ */
52
+ orientationWidescreen?: DescriptionListOrientation;
53
+ /**
54
+ * The orientation from Bulma's fullhd breakpoint (1408px) up. Falls back to
55
+ * `orientationWidescreen`, and on down.
56
+ */
57
+ orientationFullhd?: DescriptionListOrientation;
58
+ /**
59
+ * Draws a line between items, which helps the eye from a label to its
60
+ * value across a wide list, and shows where each item ends to someone
61
+ * zoomed in.
62
+ */
63
+ hasDividers?: boolean;
64
+ /** Text color helper. It colors the values; the labels keep their own color. */
65
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
66
+ /** Background color helper. */
67
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
68
+ }
69
+ /**
70
+ * Props for DescriptionList.Item, one fact. The helper props, the other
71
+ * attributes and the `ref` land on its `<div>`.
72
+ *
73
+ * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the `<div>`.
74
+ */
75
+ export interface DescriptionListItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
76
+ /** Additional CSS classes to apply. */
77
+ className?: string;
78
+ /**
79
+ * The label, such as "Order", as a `DescriptionList.Label` before the
80
+ * children.
81
+ */
82
+ label?: React.ReactNode;
83
+ /**
84
+ * The value, such as "#1234", as a `DescriptionList.Value` after the
85
+ * children. Text, a link, a `Tag`: anything that renders. `undefined`,
86
+ * `null` and `''` render nothing, so when a value is missing, say so in
87
+ * words, such as "Not given", rather than leave a label with nothing after
88
+ * it.
89
+ */
90
+ value?: React.ReactNode;
91
+ /**
92
+ * `DescriptionList.Label`s and `DescriptionList.Value`s, for what `label`
93
+ * and `value` don't cover, such as a label with an info tip or several
94
+ * values. They render between the two, so a `Label` here reads before
95
+ * `value`, and a `Value` here after `label`.
96
+ */
97
+ children?: React.ReactNode;
98
+ /** Text color helper. */
99
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
100
+ /** Background color helper. */
101
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
102
+ }
103
+ /**
104
+ * Props for DescriptionList.Label. The helper props, the other attributes and
105
+ * the `ref` land on its `<dt>`.
106
+ *
107
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dt>`.
108
+ */
109
+ export interface DescriptionListLabelProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
110
+ /** Additional CSS classes to apply. */
111
+ className?: string;
112
+ /**
113
+ * The label. A button may sit in it, such as one that opens a `Popover`
114
+ * about the label, but not a heading, which HTML doesn't allow here.
115
+ */
116
+ children?: React.ReactNode;
117
+ /** Text color helper. */
118
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
119
+ /** Background color helper. */
120
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
121
+ }
122
+ /**
123
+ * Props for DescriptionList.Value. The helper props, the other attributes and
124
+ * the `ref` land on its `<dd>`.
125
+ *
126
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the `<dd>`.
127
+ */
128
+ export interface DescriptionListValueProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
129
+ /** Additional CSS classes to apply. */
130
+ className?: string;
131
+ /** The value. Anything goes, a list or a paragraph included. */
132
+ children?: React.ReactNode;
133
+ /** Text color helper. */
134
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
135
+ /** Background color helper. */
136
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
137
+ }
138
+ /**
139
+ * A label, the name of a fact: a `<dt>`, in the weaker text color.
140
+ *
141
+ * @function
142
+ * @param {DescriptionListLabelProps} props - Props for DescriptionList.Label.
143
+ * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dt>`.
144
+ * @returns {JSX.Element} The rendered label.
145
+ *
146
+ * @example
147
+ * <DescriptionList.Label>Placed on</DescriptionList.Label>
148
+ */
149
+ export declare const DescriptionListLabel: React.ForwardRefExoticComponent<DescriptionListLabelProps & React.RefAttributes<HTMLElement>>;
150
+ /**
151
+ * A value, what the label says about the thing: a `<dd>`. An item may have several.
152
+ *
153
+ * @function
154
+ * @param {DescriptionListValueProps} props - Props for DescriptionList.Value.
155
+ * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the `<dd>`.
156
+ * @returns {JSX.Element} The rendered value.
157
+ *
158
+ * @example
159
+ * <DescriptionList.Value>14 October 2026</DescriptionList.Value>
160
+ */
161
+ export declare const DescriptionListValue: React.ForwardRefExoticComponent<DescriptionListValueProps & React.RefAttributes<HTMLElement>>;
162
+ /**
163
+ * One fact: its label and its value, in a `<div>`, from the `label` and `value` props or from `Label` and `Value` children.
164
+ *
165
+ * @function
166
+ * @param {DescriptionListItemProps} props - Props for DescriptionList.Item.
167
+ * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the `<div>`.
168
+ * @returns {JSX.Element} The rendered item.
169
+ *
170
+ * @example
171
+ * <DescriptionList.Item label="Order" value="#1234" />
172
+ *
173
+ * @example
174
+ * <DescriptionList.Item label="Tags">
175
+ * <DescriptionList.Value>Gift</DescriptionList.Value>
176
+ * <DescriptionList.Value>Priority</DescriptionList.Value>
177
+ * </DescriptionList.Item>
178
+ */
179
+ export declare const DescriptionListItem: React.ForwardRefExoticComponent<DescriptionListItemProps & React.RefAttributes<HTMLDivElement>>;
180
+ export declare const DescriptionList: React.ForwardRefExoticComponent<DescriptionListProps & React.RefAttributes<HTMLDListElement>> & {
181
+ Item: React.ForwardRefExoticComponent<DescriptionListItemProps & React.RefAttributes<HTMLDivElement>>;
182
+ Label: React.ForwardRefExoticComponent<DescriptionListLabelProps & React.RefAttributes<HTMLElement>>;
183
+ Value: React.ForwardRefExoticComponent<DescriptionListValueProps & React.RefAttributes<HTMLElement>>;
184
+ };
185
+ export default DescriptionList;
@@ -40,6 +40,7 @@ export * from './elements/ToggleButton.js';
40
40
  export * from './elements/Code.js';
41
41
  export * from './elements/Content.js';
42
42
  export * from './elements/Delete.js';
43
+ export * from './elements/DescriptionList.js';
43
44
  export * from './elements/Divider.js';
44
45
  export * from './elements/Emphasis.js';
45
46
  export * from './elements/Figure.js';