@allxsmith/bestax-bulma 5.49.1 → 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/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/EmptyState.js +2 -2
- package/dist/esm/components/Timeline.js +5 -5
- package/dist/esm/components/TreeView.js +3 -3
- package/dist/esm/components/TreeView.js.map +1 -1
- package/dist/esm/elements/DescriptionList.js +133 -0
- package/dist/esm/elements/DescriptionList.js.map +1 -0
- package/dist/esm/elements/RingProgress.js +117 -0
- package/dist/esm/elements/RingProgress.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +246 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/elements/DescriptionList.d.ts +185 -0
- package/dist/types/elements/RingProgress.d.ts +91 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types-cjs/elements/DescriptionList.d.ts +185 -0
- package/dist/types-cjs/elements/RingProgress.d.ts +91 -0
- package/dist/types-cjs/index.d.ts +2 -0
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/elements/_descriptionlist.scss +153 -0
- package/src/scss/elements/_index.scss +2 -0
- package/src/scss/elements/_ringprogress.scss +160 -0
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';
|
|
@@ -56,6 +57,7 @@ export { OrderedList } from './esm/elements/OrderedList.js';
|
|
|
56
57
|
export { Paragraph } from './esm/elements/Paragraph.js';
|
|
57
58
|
export { Pre } from './esm/elements/Pre.js';
|
|
58
59
|
export { Progress } from './esm/elements/Progress.js';
|
|
60
|
+
export { RingProgress } from './esm/elements/RingProgress.js';
|
|
59
61
|
export { Skeleton } from './esm/elements/Skeleton.js';
|
|
60
62
|
export { Span } from './esm/elements/Span.js';
|
|
61
63
|
export { Strong } from './esm/elements/Strong.js';
|
package/dist/index.esm.js.map
CHANGED
|
@@ -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;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
declare const validRingProgressColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "dark", "light", "white"];
|
|
4
|
+
/** The Bulma colors an arc takes, the ones `Progress` takes. */
|
|
5
|
+
export type RingProgressColor = (typeof validRingProgressColors)[number];
|
|
6
|
+
declare const validRingProgressSizes: readonly ["small", "medium", "large"];
|
|
7
|
+
/** One colored part of a ring drawn in sections. */
|
|
8
|
+
export interface RingProgressSection {
|
|
9
|
+
/** Its size, in the same units as the ring's `max`. */
|
|
10
|
+
value: number;
|
|
11
|
+
/** Its color. Without one, it takes the ring's. */
|
|
12
|
+
color?: RingProgressColor;
|
|
13
|
+
/** What it is, such as "Photos", read in the ring's name with its share. */
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Props for the RingProgress component. The helper props, the other
|
|
18
|
+
* attributes and the `ref` land on its root `<div>`.
|
|
19
|
+
*
|
|
20
|
+
* @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root `<div>`.
|
|
21
|
+
* @extraProp {string} [aria-labelledby] - The id of a visible heading that names the ring, in place of `label`. With `sections`, use `label`, since a name from here replaces the one that lists the values.
|
|
22
|
+
* @extraProp {string} [aria-valuetext] - What a screen reader says for the value, such as "7 of 10 tasks". Without it, the value is read as a percentage.
|
|
23
|
+
*/
|
|
24
|
+
export interface RingProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'role'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
25
|
+
/** Additional CSS classes to apply. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* How far along it is, from 0 to `max`. Values outside that range are
|
|
29
|
+
* drawn, and read, at the nearest end. Ignored with `sections`.
|
|
30
|
+
*/
|
|
31
|
+
value?: number;
|
|
32
|
+
/** The value that fills the ring. */
|
|
33
|
+
max?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Several values around one ring, in order clockwise from the top, each
|
|
36
|
+
* with its own color and label. The ring is then an image whose name
|
|
37
|
+
* writes them out, such as "Storage: Documents 40%, Photos 15%", since a
|
|
38
|
+
* screen reader can't take several values from one element. A total over
|
|
39
|
+
* `max` fills the ring and stops.
|
|
40
|
+
*/
|
|
41
|
+
sections?: RingProgressSection[];
|
|
42
|
+
/**
|
|
43
|
+
* What it shows, such as "Upload" or "Storage". It names the ring, so it's
|
|
44
|
+
* read with the value. A development build warns when the ring has no
|
|
45
|
+
* name.
|
|
46
|
+
*/
|
|
47
|
+
label?: string;
|
|
48
|
+
/**
|
|
49
|
+
* A level within a range, such as storage used or a score, rather than a
|
|
50
|
+
* task moving toward done: `role="meter"` in place of `role="progressbar"`.
|
|
51
|
+
* Ignored with `sections`.
|
|
52
|
+
*/
|
|
53
|
+
isMeter?: boolean;
|
|
54
|
+
/** The arc's color, and the color of sections without one. */
|
|
55
|
+
color?: RingProgressColor;
|
|
56
|
+
/** The ring's size. */
|
|
57
|
+
size?: (typeof validRingProgressSizes)[number];
|
|
58
|
+
/** Rounds the ends of the arc. */
|
|
59
|
+
isRounded?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* What sits in the middle of the ring, such as the value as text. It's
|
|
62
|
+
* hidden from assistive tech, which reads the value from the ring itself,
|
|
63
|
+
* so the value isn't heard twice. Say anything more, such as "7 of 10
|
|
64
|
+
* tasks", in `aria-valuetext`.
|
|
65
|
+
*/
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
/** Text color helper. */
|
|
68
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
69
|
+
/** Background color helper. */
|
|
70
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The `RingProgress` component draws a value as a ring that fills as it grows, with anything you pass shown in the middle.
|
|
74
|
+
*
|
|
75
|
+
* It's a `progressbar` for a task moving toward done, or a `meter` with
|
|
76
|
+
* `isMeter` for a level within a range, named by `label`. With `sections`
|
|
77
|
+
* it draws several values around one ring and is an image whose name lists
|
|
78
|
+
* them. It has no state for work with no value: that's `Loader`.
|
|
79
|
+
*
|
|
80
|
+
* @function
|
|
81
|
+
* @param {RingProgressProps} props - Props for the RingProgress component.
|
|
82
|
+
* @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the root `<div>`.
|
|
83
|
+
* @returns {JSX.Element} The rendered ring.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* <RingProgress value={72} label="Upload" color="success">
|
|
87
|
+
* 72%
|
|
88
|
+
* </RingProgress>
|
|
89
|
+
*/
|
|
90
|
+
export declare const RingProgress: React.ForwardRefExoticComponent<RingProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
export default RingProgress;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -55,6 +56,7 @@ export * from './elements/OrderedList.js';
|
|
|
55
56
|
export * from './elements/Paragraph.js';
|
|
56
57
|
export * from './elements/Pre.js';
|
|
57
58
|
export * from './elements/Progress.js';
|
|
59
|
+
export * from './elements/RingProgress.js';
|
|
58
60
|
export * from './elements/Skeleton.js';
|
|
59
61
|
export * from './elements/Span.js';
|
|
60
62
|
export * from './elements/Strong.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;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
declare const validRingProgressColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "dark", "light", "white"];
|
|
4
|
+
/** The Bulma colors an arc takes, the ones `Progress` takes. */
|
|
5
|
+
export type RingProgressColor = (typeof validRingProgressColors)[number];
|
|
6
|
+
declare const validRingProgressSizes: readonly ["small", "medium", "large"];
|
|
7
|
+
/** One colored part of a ring drawn in sections. */
|
|
8
|
+
export interface RingProgressSection {
|
|
9
|
+
/** Its size, in the same units as the ring's `max`. */
|
|
10
|
+
value: number;
|
|
11
|
+
/** Its color. Without one, it takes the ring's. */
|
|
12
|
+
color?: RingProgressColor;
|
|
13
|
+
/** What it is, such as "Photos", read in the ring's name with its share. */
|
|
14
|
+
label: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Props for the RingProgress component. The helper props, the other
|
|
18
|
+
* attributes and the `ref` land on its root `<div>`.
|
|
19
|
+
*
|
|
20
|
+
* @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the root `<div>`.
|
|
21
|
+
* @extraProp {string} [aria-labelledby] - The id of a visible heading that names the ring, in place of `label`. With `sections`, use `label`, since a name from here replaces the one that lists the values.
|
|
22
|
+
* @extraProp {string} [aria-valuetext] - What a screen reader says for the value, such as "7 of 10 tasks". Without it, the value is read as a percentage.
|
|
23
|
+
*/
|
|
24
|
+
export interface RingProgressProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'role'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
25
|
+
/** Additional CSS classes to apply. */
|
|
26
|
+
className?: string;
|
|
27
|
+
/**
|
|
28
|
+
* How far along it is, from 0 to `max`. Values outside that range are
|
|
29
|
+
* drawn, and read, at the nearest end. Ignored with `sections`.
|
|
30
|
+
*/
|
|
31
|
+
value?: number;
|
|
32
|
+
/** The value that fills the ring. */
|
|
33
|
+
max?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Several values around one ring, in order clockwise from the top, each
|
|
36
|
+
* with its own color and label. The ring is then an image whose name
|
|
37
|
+
* writes them out, such as "Storage: Documents 40%, Photos 15%", since a
|
|
38
|
+
* screen reader can't take several values from one element. A total over
|
|
39
|
+
* `max` fills the ring and stops.
|
|
40
|
+
*/
|
|
41
|
+
sections?: RingProgressSection[];
|
|
42
|
+
/**
|
|
43
|
+
* What it shows, such as "Upload" or "Storage". It names the ring, so it's
|
|
44
|
+
* read with the value. A development build warns when the ring has no
|
|
45
|
+
* name.
|
|
46
|
+
*/
|
|
47
|
+
label?: string;
|
|
48
|
+
/**
|
|
49
|
+
* A level within a range, such as storage used or a score, rather than a
|
|
50
|
+
* task moving toward done: `role="meter"` in place of `role="progressbar"`.
|
|
51
|
+
* Ignored with `sections`.
|
|
52
|
+
*/
|
|
53
|
+
isMeter?: boolean;
|
|
54
|
+
/** The arc's color, and the color of sections without one. */
|
|
55
|
+
color?: RingProgressColor;
|
|
56
|
+
/** The ring's size. */
|
|
57
|
+
size?: (typeof validRingProgressSizes)[number];
|
|
58
|
+
/** Rounds the ends of the arc. */
|
|
59
|
+
isRounded?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* What sits in the middle of the ring, such as the value as text. It's
|
|
62
|
+
* hidden from assistive tech, which reads the value from the ring itself,
|
|
63
|
+
* so the value isn't heard twice. Say anything more, such as "7 of 10
|
|
64
|
+
* tasks", in `aria-valuetext`.
|
|
65
|
+
*/
|
|
66
|
+
children?: React.ReactNode;
|
|
67
|
+
/** Text color helper. */
|
|
68
|
+
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
69
|
+
/** Background color helper. */
|
|
70
|
+
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The `RingProgress` component draws a value as a ring that fills as it grows, with anything you pass shown in the middle.
|
|
74
|
+
*
|
|
75
|
+
* It's a `progressbar` for a task moving toward done, or a `meter` with
|
|
76
|
+
* `isMeter` for a level within a range, named by `label`. With `sections`
|
|
77
|
+
* it draws several values around one ring and is an image whose name lists
|
|
78
|
+
* them. It has no state for work with no value: that's `Loader`.
|
|
79
|
+
*
|
|
80
|
+
* @function
|
|
81
|
+
* @param {RingProgressProps} props - Props for the RingProgress component.
|
|
82
|
+
* @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the root `<div>`.
|
|
83
|
+
* @returns {JSX.Element} The rendered ring.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* <RingProgress value={72} label="Upload" color="success">
|
|
87
|
+
* 72%
|
|
88
|
+
* </RingProgress>
|
|
89
|
+
*/
|
|
90
|
+
export declare const RingProgress: React.ForwardRefExoticComponent<RingProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
91
|
+
export default RingProgress;
|
|
@@ -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';
|
|
@@ -55,6 +56,7 @@ export * from './elements/OrderedList.js';
|
|
|
55
56
|
export * from './elements/Paragraph.js';
|
|
56
57
|
export * from './elements/Pre.js';
|
|
57
58
|
export * from './elements/Progress.js';
|
|
59
|
+
export * from './elements/RingProgress.js';
|
|
58
60
|
export * from './elements/Skeleton.js';
|
|
59
61
|
export * from './elements/Span.js';
|
|
60
62
|
export * from './elements/Strong.js';
|