@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Bestax Extras - DescriptionList Styles
|
|
2
|
+
// Facts about one thing, each a label and its value: a `<dl>` with a `<div>`
|
|
3
|
+
// per item, a `<dt>` per label and a `<dd>` per value. Bulma styles a `<dl>`
|
|
4
|
+
// only inside `.content`, where it indents the values, so this lays one out.
|
|
5
|
+
//
|
|
6
|
+
// The list is a grid, and each item spans it on `subgrid`, so every label
|
|
7
|
+
// sits in the first column and every value in the last. Stacked, the grid
|
|
8
|
+
// has one column; beside, it has two, the labels' as wide as the longest
|
|
9
|
+
// label. The columns are all an orientation changes. The grid follows the
|
|
10
|
+
// writing direction, so a right-to-left page needs no rules of its own, and
|
|
11
|
+
// the gaps are in em, so `textSize` on the list scales them with the text.
|
|
12
|
+
|
|
13
|
+
@use "bulma/sass/utilities/initial-variables" as iv;
|
|
14
|
+
@use "bulma/sass/utilities/css-variables" as cv;
|
|
15
|
+
@use "bulma/sass/utilities/mixins" as mx;
|
|
16
|
+
|
|
17
|
+
// Between items.
|
|
18
|
+
$description-list-gap: 0.75em !default;
|
|
19
|
+
// Between the labels' column and the values', side by side.
|
|
20
|
+
$description-list-column-gap: 1.5em !default;
|
|
21
|
+
// Between a label and its value stacked, and between several labels or
|
|
22
|
+
// several values in one item.
|
|
23
|
+
$description-list-row-gap: 0.25em !default;
|
|
24
|
+
// The most the labels' column takes side by side. Longer labels wrap.
|
|
25
|
+
$description-list-label-max-width: 40% !default;
|
|
26
|
+
$description-list-label-color: cv.getVar("text-weak") !default;
|
|
27
|
+
$description-list-label-weight: cv.getVar("weight-normal") !default;
|
|
28
|
+
$description-list-value-color: cv.getVar("text") !default;
|
|
29
|
+
$description-list-divider-color: cv.getVar("border-weak") !default;
|
|
30
|
+
$description-list-divider-width: 1px !default;
|
|
31
|
+
|
|
32
|
+
.#{iv.$class-prefix}description-list {
|
|
33
|
+
@include cv.register-vars(
|
|
34
|
+
(
|
|
35
|
+
"description-list-gap": #{$description-list-gap},
|
|
36
|
+
"description-list-column-gap": #{$description-list-column-gap},
|
|
37
|
+
"description-list-row-gap": #{$description-list-row-gap},
|
|
38
|
+
"description-list-label-max-width": #{$description-list-label-max-width},
|
|
39
|
+
"description-list-label-color": #{$description-list-label-color},
|
|
40
|
+
"description-list-label-weight": #{$description-list-label-weight},
|
|
41
|
+
"description-list-value-color": #{$description-list-value-color},
|
|
42
|
+
"description-list-divider-color": #{$description-list-divider-color},
|
|
43
|
+
"description-list-divider-width": #{$description-list-divider-width},
|
|
44
|
+
)
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// ---- The two orientations, as the list's columns ----------------------------
|
|
49
|
+
|
|
50
|
+
@mixin -vertical {
|
|
51
|
+
grid-template-columns: minmax(0, 1fr);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@mixin -horizontal {
|
|
55
|
+
grid-template-columns: fit-content(#{cv.getVar("description-list-label-max-width")}) minmax(0, 1fr);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ---- Structure ----------------------------------------------------------------
|
|
59
|
+
|
|
60
|
+
.#{iv.$class-prefix}description-list {
|
|
61
|
+
display: grid;
|
|
62
|
+
@include -vertical;
|
|
63
|
+
column-gap: cv.getVar("description-list-column-gap");
|
|
64
|
+
row-gap: cv.getVar("description-list-gap");
|
|
65
|
+
margin: 0;
|
|
66
|
+
padding: 0;
|
|
67
|
+
// On the root, so a `textColor` helper's class outranks it and the values
|
|
68
|
+
// inherit either.
|
|
69
|
+
color: cv.getVar("description-list-value-color");
|
|
70
|
+
|
|
71
|
+
&:not(:last-child) {
|
|
72
|
+
margin-bottom: cv.getVar("block-spacing");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.#{iv.$class-prefix}description-list-item {
|
|
77
|
+
display: grid;
|
|
78
|
+
grid-column: 1 / -1;
|
|
79
|
+
// A browser without `subgrid` keeps this one column, so its items stay
|
|
80
|
+
// stacked at every width rather than misplace a value.
|
|
81
|
+
grid-template-columns: minmax(0, 1fr);
|
|
82
|
+
grid-template-columns: subgrid;
|
|
83
|
+
// Each label from the top of the first column and each value from the top
|
|
84
|
+
// of the last, so several of either line up from the item's first line.
|
|
85
|
+
grid-auto-flow: row dense;
|
|
86
|
+
align-items: baseline;
|
|
87
|
+
row-gap: cv.getVar("description-list-row-gap");
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Through the root, so it outranks Bulma's `.content dd` indent.
|
|
91
|
+
.#{iv.$class-prefix}description-list .#{iv.$class-prefix}description-list-label {
|
|
92
|
+
grid-column: 1 / 2;
|
|
93
|
+
margin: 0;
|
|
94
|
+
color: cv.getVar("description-list-label-color");
|
|
95
|
+
font-weight: cv.getVar("description-list-label-weight");
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.#{iv.$class-prefix}description-list .#{iv.$class-prefix}description-list-value {
|
|
99
|
+
grid-column: -2 / -1;
|
|
100
|
+
margin: 0;
|
|
101
|
+
// An order number, an email or a URL wraps rather than widen the list.
|
|
102
|
+
overflow-wrap: anywhere;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.#{iv.$class-prefix}description-list.#{iv.$class-prefix}has-dividers
|
|
106
|
+
> .#{iv.$class-prefix}description-list-item
|
|
107
|
+
+ .#{iv.$class-prefix}description-list-item {
|
|
108
|
+
border-block-start: cv.getVar("description-list-divider-width") solid cv.getVar("description-list-divider-color");
|
|
109
|
+
padding-block-start: cv.getVar("description-list-gap");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ---- Orientation ----------------------------------------------------------------
|
|
113
|
+
|
|
114
|
+
// With no orientation given: stacked on a phone, beside from tablet up.
|
|
115
|
+
@include mx.tablet {
|
|
116
|
+
.#{iv.$class-prefix}description-list {
|
|
117
|
+
@include -horizontal;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
@mixin -orientations($suffix) {
|
|
122
|
+
.#{iv.$class-prefix}description-list.#{iv.$class-prefix}is-vertical#{$suffix} {
|
|
123
|
+
@include -vertical;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.#{iv.$class-prefix}description-list.#{iv.$class-prefix}is-horizontal#{$suffix} {
|
|
127
|
+
@include -horizontal;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// `orientation` at every width, then each viewport's prop from its own
|
|
132
|
+
// breakpoint, narrowest first, so where several apply the widest one wins.
|
|
133
|
+
@include -orientations("");
|
|
134
|
+
|
|
135
|
+
@include mx.mobile {
|
|
136
|
+
@include -orientations("-mobile");
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
@include mx.tablet {
|
|
140
|
+
@include -orientations("-tablet");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
@include mx.desktop {
|
|
144
|
+
@include -orientations("-desktop");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@include mx.widescreen {
|
|
148
|
+
@include -orientations("-widescreen");
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@include mx.fullhd {
|
|
152
|
+
@include -orientations("-fullhd");
|
|
153
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
// Bestax Extras - RingProgress Styles
|
|
2
|
+
// A value drawn as a ring, with anything the app passes in the middle. Bulma
|
|
3
|
+
// has a linear progress bar and no ring.
|
|
4
|
+
//
|
|
5
|
+
// The ring is an SVG: a track circle, and an arc per value whose length and
|
|
6
|
+
// start the component sets as custom properties, in percent of the way
|
|
7
|
+
// round. Each arc has `pathLength="100"`, so a percentage is a dash length
|
|
8
|
+
// as it is, and nothing is measured. Forced colors leaves SVG strokes in the
|
|
9
|
+
// author's colours, so a rule here gives them the system's.
|
|
10
|
+
|
|
11
|
+
@use "bulma/sass/utilities/initial-variables" as iv;
|
|
12
|
+
@use "bulma/sass/utilities/css-variables" as cv;
|
|
13
|
+
|
|
14
|
+
$ring-progress-size: 5rem !default;
|
|
15
|
+
$ring-progress-size-small: 3.5rem !default;
|
|
16
|
+
$ring-progress-size-medium: 7rem !default;
|
|
17
|
+
$ring-progress-size-large: 9rem !default;
|
|
18
|
+
// In the ring's own units: the ring is 100 across and its circle has a
|
|
19
|
+
// radius of 42, so a thickness up to 16 fits.
|
|
20
|
+
$ring-progress-thickness: 10 !default;
|
|
21
|
+
// The unfilled ring, the color Bulma gives a progress bar's track.
|
|
22
|
+
$ring-progress-track-color: cv.getVar("border-weak") !default;
|
|
23
|
+
$ring-progress-arc-color: cv.getVar("primary") !default;
|
|
24
|
+
$ring-progress-duration: cv.getVar("duration") !default;
|
|
25
|
+
$ring-progress-label-color: cv.getVar("text-strong") !default;
|
|
26
|
+
$ring-progress-label-weight: cv.getVar("weight-semibold") !default;
|
|
27
|
+
// A fifth of the ring, so the middle grows and shrinks with it: 1rem at the
|
|
28
|
+
// default size.
|
|
29
|
+
$ring-progress-label-size: calc(#{cv.getVar("ring-progress-size")} / 5) !default;
|
|
30
|
+
|
|
31
|
+
.#{iv.$class-prefix}ring-progress {
|
|
32
|
+
@include cv.register-vars(
|
|
33
|
+
(
|
|
34
|
+
"ring-progress-size": #{$ring-progress-size},
|
|
35
|
+
"ring-progress-thickness": #{$ring-progress-thickness},
|
|
36
|
+
"ring-progress-track-color": #{$ring-progress-track-color},
|
|
37
|
+
"ring-progress-arc-color": #{$ring-progress-arc-color},
|
|
38
|
+
"ring-progress-duration": #{$ring-progress-duration},
|
|
39
|
+
"ring-progress-label-color": #{$ring-progress-label-color},
|
|
40
|
+
"ring-progress-label-weight": #{$ring-progress-label-weight},
|
|
41
|
+
"ring-progress-label-size": #{$ring-progress-label-size},
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@each $size, $value in ("small": $ring-progress-size-small, "medium": $ring-progress-size-medium, "large": $ring-progress-size-large) {
|
|
47
|
+
.#{iv.$class-prefix}ring-progress.#{iv.$class-prefix}is-#{$size} {
|
|
48
|
+
@include cv.register-vars(
|
|
49
|
+
(
|
|
50
|
+
"ring-progress-size": #{$value},
|
|
51
|
+
)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// ---- The ring and its middle ---------------------------------------------------
|
|
57
|
+
|
|
58
|
+
// One grid cell holds both the ring and the label, so the label sits in the
|
|
59
|
+
// middle at any size.
|
|
60
|
+
.#{iv.$class-prefix}ring-progress {
|
|
61
|
+
display: inline-grid;
|
|
62
|
+
place-items: center;
|
|
63
|
+
inline-size: cv.getVar("ring-progress-size");
|
|
64
|
+
block-size: cv.getVar("ring-progress-size");
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
// On the root, so a `textColor` helper's class outranks it and the middle
|
|
67
|
+
// inherits either.
|
|
68
|
+
color: cv.getVar("ring-progress-label-color");
|
|
69
|
+
// The gap between sections, in percent of the way round: none until
|
|
70
|
+
// forced colors needs one, below.
|
|
71
|
+
--ring-progress-gap: 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.#{iv.$class-prefix}ring-progress-ring,
|
|
75
|
+
.#{iv.$class-prefix}ring-progress-label {
|
|
76
|
+
grid-area: 1 / 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.#{iv.$class-prefix}ring-progress-ring {
|
|
80
|
+
inline-size: 100%;
|
|
81
|
+
block-size: 100%;
|
|
82
|
+
// A circle's path starts at three o'clock and runs clockwise; this puts
|
|
83
|
+
// the start at the top.
|
|
84
|
+
transform: rotate(-90deg);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.#{iv.$class-prefix}ring-progress-track,
|
|
88
|
+
.#{iv.$class-prefix}ring-progress-arc {
|
|
89
|
+
fill: none;
|
|
90
|
+
stroke-width: cv.getVar("ring-progress-thickness");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.#{iv.$class-prefix}ring-progress-track {
|
|
94
|
+
stroke: cv.getVar("ring-progress-track-color");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.#{iv.$class-prefix}ring-progress-arc {
|
|
98
|
+
stroke: cv.getVar("ring-progress-arc-color");
|
|
99
|
+
// In px, which here are the circle's path units: Firefox drops a
|
|
100
|
+
// dasharray whose calc() works in bare numbers.
|
|
101
|
+
stroke-dasharray: max(0px, calc((var(--ring-progress-length) - var(--ring-progress-gap)) * 1px)) 100px;
|
|
102
|
+
stroke-dashoffset: calc(var(--ring-progress-start) * -1px);
|
|
103
|
+
transition-property: stroke-dasharray, stroke-dashoffset;
|
|
104
|
+
transition-duration: cv.getVar("ring-progress-duration");
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.#{iv.$class-prefix}ring-progress.#{iv.$class-prefix}is-rounded .#{iv.$class-prefix}ring-progress-arc {
|
|
108
|
+
stroke-linecap: round;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.#{iv.$class-prefix}ring-progress-label {
|
|
112
|
+
font-size: cv.getVar("ring-progress-label-size");
|
|
113
|
+
font-weight: cv.getVar("ring-progress-label-weight");
|
|
114
|
+
line-height: 1.2;
|
|
115
|
+
text-align: center;
|
|
116
|
+
// Inside the ring, clear of the arc.
|
|
117
|
+
max-inline-size: 70%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// ---- Colors ----------------------------------------------------------------------
|
|
121
|
+
|
|
122
|
+
// On the root, the color of every arc; on an arc, that section's own.
|
|
123
|
+
@each $name in "primary", "link", "info", "success", "warning", "danger", "black", "dark", "light", "white" {
|
|
124
|
+
.#{iv.$class-prefix}ring-progress.#{iv.$class-prefix}is-#{$name} {
|
|
125
|
+
@include cv.register-vars(
|
|
126
|
+
(
|
|
127
|
+
"ring-progress-arc-color": #{cv.getVar($name)},
|
|
128
|
+
)
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.#{iv.$class-prefix}ring-progress-arc.#{iv.$class-prefix}is-#{$name} {
|
|
133
|
+
stroke: cv.getVar($name);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ---- Media ---------------------------------------------------------------------
|
|
138
|
+
|
|
139
|
+
@media (prefers-reduced-motion: reduce) {
|
|
140
|
+
.#{iv.$class-prefix}ring-progress-arc {
|
|
141
|
+
transition: none;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// SVG strokes keep the author's colours in forced colors, so the ring takes
|
|
146
|
+
// the system's, and sections, now one colour, get gaps between them.
|
|
147
|
+
@media (forced-colors: active) {
|
|
148
|
+
.#{iv.$class-prefix}ring-progress.#{iv.$class-prefix}has-sections {
|
|
149
|
+
--ring-progress-gap: 1.5;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.#{iv.$class-prefix}ring-progress-track {
|
|
153
|
+
stroke: GrayText;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Through the root, so it outranks a section's own color class.
|
|
157
|
+
.#{iv.$class-prefix}ring-progress .#{iv.$class-prefix}ring-progress-arc {
|
|
158
|
+
stroke: CanvasText;
|
|
159
|
+
}
|
|
160
|
+
}
|