@allxsmith/bestax-bulma 5.62.0 → 5.63.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 -6
- package/dist/esm/components/EmptyState.js.map +1 -1
- package/dist/esm/components/Timeline.js +5 -9
- package/dist/esm/components/Timeline.js.map +1 -1
- package/dist/esm/components/TreeView.js +3 -7
- package/dist/esm/components/TreeView.js.map +1 -1
- package/dist/esm/elements/Buttons.js +2 -0
- package/dist/esm/elements/Buttons.js.map +1 -1
- package/dist/esm/elements/CopyButton.js +132 -0
- package/dist/esm/elements/CopyButton.js.map +1 -0
- package/dist/esm/elements/DescriptionList.js +1 -5
- package/dist/esm/elements/DescriptionList.js.map +1 -1
- package/dist/esm/elements/Stat.js +196 -0
- package/dist/esm/elements/Stat.js.map +1 -0
- package/dist/esm/elements/Stats.js +48 -0
- package/dist/esm/elements/Stats.js.map +1 -0
- package/dist/esm/elements/statContext.js +10 -0
- package/dist/esm/elements/statContext.js.map +1 -0
- package/dist/esm/form/Combobox.js +2 -1
- package/dist/esm/form/Combobox.js.map +1 -1
- package/dist/esm/helpers/checkIcon.js +20 -0
- package/dist/esm/helpers/checkIcon.js.map +1 -0
- package/dist/esm/helpers/isGiven.js +13 -0
- package/dist/esm/helpers/isGiven.js.map +1 -0
- package/dist/esm/helpers/statusRegion.js +3 -3
- package/dist/esm/helpers/useClipboard.js +176 -0
- package/dist/esm/helpers/useClipboard.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +4946 -4428
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +4 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/elements/Buttons.d.ts +1 -0
- package/dist/types/elements/CopyButton.d.ts +105 -0
- package/dist/types/elements/Stat.d.ts +242 -0
- package/dist/types/elements/Stats.d.ts +40 -0
- package/dist/types/elements/statContext.d.ts +18 -0
- package/dist/types/helpers/checkIcon.d.ts +10 -0
- package/dist/types/helpers/isGiven.d.ts +7 -0
- package/dist/types/helpers/useClipboard.d.ts +65 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types-cjs/elements/Buttons.d.ts +1 -0
- package/dist/types-cjs/elements/CopyButton.d.ts +105 -0
- package/dist/types-cjs/elements/Stat.d.ts +242 -0
- package/dist/types-cjs/elements/Stats.d.ts +40 -0
- package/dist/types-cjs/elements/statContext.d.ts +18 -0
- package/dist/types-cjs/helpers/checkIcon.d.ts +10 -0
- package/dist/types-cjs/helpers/isGiven.d.ts +7 -0
- package/dist/types-cjs/helpers/useClipboard.d.ts +65 -0
- package/dist/types-cjs/index.d.ts +5 -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/_index.scss +1 -0
- package/src/scss/elements/_stat.scss +153 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// Bestax Extras - Stat Styles
|
|
2
|
+
// A figure with its name, and often a change and a note, as a description
|
|
3
|
+
// list: a `<dt>` for the label and a `<dd>` each for the figure, the change
|
|
4
|
+
// and the note. A Stat is a `<div>` in a `Stats` row's `<dl>`, or a `<dl>` of
|
|
5
|
+
// its own. `Stats` is Bulma's `.grid`, which lays the row out, so all it
|
|
6
|
+
// needs here is the list's margins reset; this sets the type.
|
|
7
|
+
//
|
|
8
|
+
// Each part stacks under the one before, in the order it's written. The
|
|
9
|
+
// figure takes the Stat's color, so a `textColor` on the Stat colors it,
|
|
10
|
+
// while the label, the change and the note set their own. A `color` on the
|
|
11
|
+
// change sets its color to that color's `-on-scheme` variant, which Bulma
|
|
12
|
+
// darkens or lightens until it reads as text on the scheme's background. Forced colors replaces every color with the system's, which
|
|
13
|
+
// drops the tone, and the sign in the text and the arrow, drawn in
|
|
14
|
+
// `currentColor`, remain.
|
|
15
|
+
|
|
16
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
17
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
18
|
+
|
|
19
|
+
$stat-label-color: cv.getVar('text-weak') !default;
|
|
20
|
+
$stat-label-size: cv.getVar('size-7') !default;
|
|
21
|
+
$stat-value-color: cv.getVar('text-strong') !default;
|
|
22
|
+
$stat-value-size: cv.getVar('size-3') !default;
|
|
23
|
+
$stat-value-size-small: cv.getVar('size-4') !default;
|
|
24
|
+
$stat-value-size-medium: cv.getVar('size-2') !default;
|
|
25
|
+
$stat-value-size-large: cv.getVar('size-1') !default;
|
|
26
|
+
$stat-value-weight: cv.getVar('weight-semibold') !default;
|
|
27
|
+
// Bulma's title line height, tight for large figures.
|
|
28
|
+
$stat-value-line-height: 1.125 !default;
|
|
29
|
+
$stat-change-color: cv.getVar('text') !default;
|
|
30
|
+
$stat-change-size: cv.getVar('size-7') !default;
|
|
31
|
+
// Between the arrow and the number.
|
|
32
|
+
$stat-change-gap: 0.25em !default;
|
|
33
|
+
$stat-description-color: cv.getVar('text-weak') !default;
|
|
34
|
+
$stat-description-size: cv.getVar('size-7') !default;
|
|
35
|
+
|
|
36
|
+
.#{iv.$class-prefix}stat {
|
|
37
|
+
@include cv.register-vars(
|
|
38
|
+
(
|
|
39
|
+
'stat-label-color': #{$stat-label-color},
|
|
40
|
+
'stat-label-size': #{$stat-label-size},
|
|
41
|
+
'stat-value-color': #{$stat-value-color},
|
|
42
|
+
'stat-value-size': #{$stat-value-size},
|
|
43
|
+
'stat-value-weight': #{$stat-value-weight},
|
|
44
|
+
'stat-value-line-height': #{$stat-value-line-height},
|
|
45
|
+
'stat-change-color': #{$stat-change-color},
|
|
46
|
+
'stat-change-size': #{$stat-change-size},
|
|
47
|
+
'stat-change-gap': #{$stat-change-gap},
|
|
48
|
+
'stat-description-color': #{$stat-description-color},
|
|
49
|
+
'stat-description-size': #{$stat-description-size},
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@each $size,
|
|
55
|
+
$value
|
|
56
|
+
in (
|
|
57
|
+
'small': $stat-value-size-small,
|
|
58
|
+
'medium': $stat-value-size-medium,
|
|
59
|
+
'large': $stat-value-size-large
|
|
60
|
+
)
|
|
61
|
+
{
|
|
62
|
+
.#{iv.$class-prefix}stat.#{iv.$class-prefix}is-#{$size} {
|
|
63
|
+
@include cv.register-vars(
|
|
64
|
+
(
|
|
65
|
+
'stat-value-size': #{$value},
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ---- The row and the Stat ----------------------------------------------------
|
|
72
|
+
|
|
73
|
+
.#{iv.$class-prefix}stats {
|
|
74
|
+
margin-inline: 0;
|
|
75
|
+
margin-block-start: 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.#{iv.$class-prefix}stat {
|
|
79
|
+
margin: 0;
|
|
80
|
+
// On the root, so a `textColor` helper's class outranks it and the figure
|
|
81
|
+
// inherits either.
|
|
82
|
+
color: cv.getVar('stat-value-color');
|
|
83
|
+
|
|
84
|
+
// A Stat on its own is a block, as Bulma spaces its blocks.
|
|
85
|
+
&:not(:last-child) {
|
|
86
|
+
margin-bottom: cv.getVar('block-spacing');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// In a row the grid's gap spaces the tiles.
|
|
91
|
+
.#{iv.$class-prefix}stats > .#{iv.$class-prefix}stat {
|
|
92
|
+
margin-bottom: 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ---- The parts -------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
// Each through the root, so it outranks Bulma's `.content dd` indent.
|
|
98
|
+
.#{iv.$class-prefix}stat .#{iv.$class-prefix}stat-label {
|
|
99
|
+
margin: 0;
|
|
100
|
+
color: cv.getVar('stat-label-color');
|
|
101
|
+
font-size: cv.getVar('stat-label-size');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.#{iv.$class-prefix}stat .#{iv.$class-prefix}stat-value {
|
|
105
|
+
margin: 0;
|
|
106
|
+
font-size: cv.getVar('stat-value-size');
|
|
107
|
+
font-weight: cv.getVar('stat-value-weight');
|
|
108
|
+
line-height: cv.getVar('stat-value-line-height');
|
|
109
|
+
// Digits of one width, so a figure that updates doesn't shift.
|
|
110
|
+
font-variant-numeric: tabular-nums;
|
|
111
|
+
// A long figure wraps rather than widen its tile.
|
|
112
|
+
overflow-wrap: anywhere;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// `loading`'s Skeleton, and a figure's `<dd>` still waiting for its value,
|
|
116
|
+
// are one line of the figure tall, so the tile is as tall as its neighbours
|
|
117
|
+
// and keeps its height when the figure arrives.
|
|
118
|
+
.#{iv.$class-prefix}stat .#{iv.$class-prefix}stat-value:empty,
|
|
119
|
+
.#{iv.$class-prefix}stat
|
|
120
|
+
.#{iv.$class-prefix}stat-value
|
|
121
|
+
> .#{iv.$class-prefix}skeleton-block {
|
|
122
|
+
min-height: 1lh;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.#{iv.$class-prefix}stat .#{iv.$class-prefix}stat-change {
|
|
126
|
+
display: flex;
|
|
127
|
+
align-items: center;
|
|
128
|
+
gap: cv.getVar('stat-change-gap');
|
|
129
|
+
margin: 0;
|
|
130
|
+
color: cv.getVar('stat-change-color');
|
|
131
|
+
font-size: cv.getVar('stat-change-size');
|
|
132
|
+
font-variant-numeric: tabular-nums;
|
|
133
|
+
|
|
134
|
+
> svg {
|
|
135
|
+
flex: none;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// The change's colors, set on the change itself, so `--bulma-stat-change-color`
|
|
140
|
+
// stays the uncolored change's. A theme moves these tones through Bulma's own
|
|
141
|
+
// `-on-scheme` colors.
|
|
142
|
+
@each $name in 'primary', 'link', 'info', 'success', 'warning', 'danger' {
|
|
143
|
+
.#{iv.$class-prefix}stat
|
|
144
|
+
.#{iv.$class-prefix}stat-change.#{iv.$class-prefix}is-#{$name} {
|
|
145
|
+
color: cv.getVar('#{$name}-on-scheme');
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.#{iv.$class-prefix}stat .#{iv.$class-prefix}stat-description {
|
|
150
|
+
margin: 0;
|
|
151
|
+
color: cv.getVar('stat-description-color');
|
|
152
|
+
font-size: cv.getVar('stat-description-size');
|
|
153
|
+
}
|