@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.
Files changed (64) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/EmptyState.js +2 -6
  4. package/dist/esm/components/EmptyState.js.map +1 -1
  5. package/dist/esm/components/Timeline.js +5 -9
  6. package/dist/esm/components/Timeline.js.map +1 -1
  7. package/dist/esm/components/TreeView.js +3 -7
  8. package/dist/esm/components/TreeView.js.map +1 -1
  9. package/dist/esm/elements/Buttons.js +2 -0
  10. package/dist/esm/elements/Buttons.js.map +1 -1
  11. package/dist/esm/elements/CopyButton.js +132 -0
  12. package/dist/esm/elements/CopyButton.js.map +1 -0
  13. package/dist/esm/elements/DescriptionList.js +1 -5
  14. package/dist/esm/elements/DescriptionList.js.map +1 -1
  15. package/dist/esm/elements/Stat.js +196 -0
  16. package/dist/esm/elements/Stat.js.map +1 -0
  17. package/dist/esm/elements/Stats.js +48 -0
  18. package/dist/esm/elements/Stats.js.map +1 -0
  19. package/dist/esm/elements/statContext.js +10 -0
  20. package/dist/esm/elements/statContext.js.map +1 -0
  21. package/dist/esm/form/Combobox.js +2 -1
  22. package/dist/esm/form/Combobox.js.map +1 -1
  23. package/dist/esm/helpers/checkIcon.js +20 -0
  24. package/dist/esm/helpers/checkIcon.js.map +1 -0
  25. package/dist/esm/helpers/isGiven.js +13 -0
  26. package/dist/esm/helpers/isGiven.js.map +1 -0
  27. package/dist/esm/helpers/statusRegion.js +3 -3
  28. package/dist/esm/helpers/useClipboard.js +176 -0
  29. package/dist/esm/helpers/useClipboard.js.map +1 -0
  30. package/dist/extras.css +1 -1
  31. package/dist/extras.css.map +1 -1
  32. package/dist/index.cjs +4946 -4428
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.esm.js +4 -0
  35. package/dist/index.esm.js.map +1 -1
  36. package/dist/types/elements/Buttons.d.ts +1 -0
  37. package/dist/types/elements/CopyButton.d.ts +105 -0
  38. package/dist/types/elements/Stat.d.ts +242 -0
  39. package/dist/types/elements/Stats.d.ts +40 -0
  40. package/dist/types/elements/statContext.d.ts +18 -0
  41. package/dist/types/helpers/checkIcon.d.ts +10 -0
  42. package/dist/types/helpers/isGiven.d.ts +7 -0
  43. package/dist/types/helpers/useClipboard.d.ts +65 -0
  44. package/dist/types/index.d.ts +5 -0
  45. package/dist/types-cjs/elements/Buttons.d.ts +1 -0
  46. package/dist/types-cjs/elements/CopyButton.d.ts +105 -0
  47. package/dist/types-cjs/elements/Stat.d.ts +242 -0
  48. package/dist/types-cjs/elements/Stats.d.ts +40 -0
  49. package/dist/types-cjs/elements/statContext.d.ts +18 -0
  50. package/dist/types-cjs/helpers/checkIcon.d.ts +10 -0
  51. package/dist/types-cjs/helpers/isGiven.d.ts +7 -0
  52. package/dist/types-cjs/helpers/useClipboard.d.ts +65 -0
  53. package/dist/types-cjs/index.d.ts +5 -0
  54. package/dist/versions/bestax-no-dark-mode.css +1 -1
  55. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  56. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  57. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  58. package/dist/versions/bestax-no-helpers.css +1 -1
  59. package/dist/versions/bestax-no-helpers.css.map +1 -1
  60. package/dist/versions/bestax-prefixed.css +1 -1
  61. package/dist/versions/bestax-prefixed.css.map +1 -1
  62. package/package.json +1 -1
  63. package/src/scss/elements/_index.scss +1 -0
  64. 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
+ }