@allxsmith/bestax-bulma 5.18.2 → 5.19.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/constants.cjs +67 -6
  4. package/dist/constants.cjs.map +1 -1
  5. package/dist/constants.d.cts +30 -6
  6. package/dist/constants.esm.js +65 -7
  7. package/dist/constants.esm.js.map +1 -1
  8. package/dist/extras.css +1 -1
  9. package/dist/extras.css.map +1 -1
  10. package/dist/index.cjs +598 -52
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.esm.js +596 -53
  13. package/dist/index.esm.js.map +1 -1
  14. package/dist/types/components/Card.d.ts +2 -0
  15. package/dist/types/components/Carousel.d.ts +8 -2
  16. package/dist/types/components/Modal.d.ts +2 -0
  17. package/dist/types/components/Navbar.d.ts +24 -3
  18. package/dist/types/components/Sidebar.d.ts +2 -0
  19. package/dist/types/components/Steps.d.ts +5 -1
  20. package/dist/types/elements/Delete.d.ts +9 -1
  21. package/dist/types/elements/Link.d.ts +7 -1
  22. package/dist/types/elements/Notification.d.ts +29 -3
  23. package/dist/types/elements/Tag.d.ts +7 -1
  24. package/dist/types/elements/Td.d.ts +21 -2
  25. package/dist/types/form/DateInputBase.d.ts +9 -1
  26. package/dist/types/form/DateTimeInputBase.d.ts +11 -4
  27. package/dist/types/form/TimeInputBase.d.ts +4 -2
  28. package/dist/types/helpers/Theme.d.ts +6 -1
  29. package/dist/types/helpers/bulmaClassHelpers.d.ts +30 -6
  30. package/dist/types/helpers/shadowDom.d.ts +54 -0
  31. package/dist/types/helpers/statusRegion.d.ts +61 -0
  32. package/dist/types/helpers/useBulmaClasses.d.ts +1 -1
  33. package/dist/types/helpers/useOtherClasses.d.ts +61 -5
  34. package/dist/types-cjs/components/Card.d.ts +2 -0
  35. package/dist/types-cjs/components/Carousel.d.ts +8 -2
  36. package/dist/types-cjs/components/Modal.d.ts +2 -0
  37. package/dist/types-cjs/components/Navbar.d.ts +24 -3
  38. package/dist/types-cjs/components/Sidebar.d.ts +2 -0
  39. package/dist/types-cjs/components/Steps.d.ts +5 -1
  40. package/dist/types-cjs/elements/Delete.d.ts +9 -1
  41. package/dist/types-cjs/elements/Link.d.ts +7 -1
  42. package/dist/types-cjs/elements/Notification.d.ts +29 -3
  43. package/dist/types-cjs/elements/Tag.d.ts +7 -1
  44. package/dist/types-cjs/elements/Td.d.ts +21 -2
  45. package/dist/types-cjs/form/DateInputBase.d.ts +9 -1
  46. package/dist/types-cjs/form/DateTimeInputBase.d.ts +11 -4
  47. package/dist/types-cjs/form/TimeInputBase.d.ts +4 -2
  48. package/dist/types-cjs/helpers/Theme.d.ts +6 -1
  49. package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +30 -6
  50. package/dist/types-cjs/helpers/shadowDom.d.ts +54 -0
  51. package/dist/types-cjs/helpers/statusRegion.d.ts +61 -0
  52. package/dist/types-cjs/helpers/useBulmaClasses.d.ts +1 -1
  53. package/dist/types-cjs/helpers/useOtherClasses.d.ts +61 -5
  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/form/_dateinput.scss +36 -10
  64. package/src/scss/form/_timeinput.scss +30 -9
@@ -9,6 +9,7 @@ $dateinput-cell-hover-bg: hsla(0, 0%, 50%, 0.13) !default;
9
9
  $dateinput-cell-selected-bg: cv.getVar('primary') !default;
10
10
  $dateinput-cell-selected-color: cv.getVar('primary-invert') !default;
11
11
  $dateinput-cell-today-color: cv.getVar('primary') !default;
12
+ $dateinput-focus-ring-color: cv.getVar('primary') !default;
12
13
  $dateinput-cell-disabled-color: cv.getVar('text-weak') !default;
13
14
  $dateinput-cell-other-month-color: cv.getVar('text-weak') !default;
14
15
  $dateinput-header-padding: 0.5rem 0 !default;
@@ -27,6 +28,7 @@ $dateinput-nav-button-size: 1.75rem !default;
27
28
  'dateinput-cell-selected-bg': #{$dateinput-cell-selected-bg},
28
29
  'dateinput-cell-selected-color': #{$dateinput-cell-selected-color},
29
30
  'dateinput-cell-today-color': #{$dateinput-cell-today-color},
31
+ 'dateinput-focus-ring-color': #{$dateinput-focus-ring-color},
30
32
  'dateinput-cell-disabled-color': #{$dateinput-cell-disabled-color},
31
33
  'dateinput-cell-other-month-color': #{$dateinput-cell-other-month-color},
32
34
  'dateinput-header-padding': #{$dateinput-header-padding},
@@ -80,7 +82,7 @@ $dateinput-nav-button-size: 1.75rem !default;
80
82
  background-color: cv.getVar('dateinput-cell-hover-bg');
81
83
  }
82
84
  &:focus-visible {
83
- outline: 2px solid cv.getVar('primary');
85
+ outline: 2px solid cv.getVar('dateinput-focus-ring-color');
84
86
  outline-offset: 2px;
85
87
  }
86
88
  }
@@ -121,7 +123,7 @@ $dateinput-nav-button-size: 1.75rem !default;
121
123
  background-color: cv.getVar('dateinput-cell-hover-bg');
122
124
  }
123
125
  &:focus-visible {
124
- outline: 2px solid cv.getVar('primary');
126
+ outline: 2px solid cv.getVar('dateinput-focus-ring-color');
125
127
  outline-offset: 1px;
126
128
  }
127
129
  &:disabled {
@@ -172,7 +174,7 @@ $dateinput-nav-button-size: 1.75rem !default;
172
174
  &:hover:not(:disabled):not(.#{iv.$class-prefix}is-selected) {
173
175
  background-color: cv.getVar('dateinput-cell-hover-bg');
174
176
  }
175
- // Hover for the selected cell: darken the primary fill rather than
177
+ // Hover for the selected cell: darken the selection fill rather than
176
178
  // replacing it, so the selection stays visible under the cursor while
177
179
  // still giving interactive feedback.
178
180
  &.#{iv.$class-prefix}is-selected:hover:not(:disabled) {
@@ -183,10 +185,10 @@ $dateinput-nav-button-size: 1.75rem !default;
183
185
  );
184
186
  }
185
187
  // Inset focus ring so it can't bleed into an adjacent selected cell's
186
- // primary fill (the grid gap is only 2px). Outline respects the cell's
188
+ // fill (the grid gap is only 2px). Outline respects the cell's
187
189
  // border-radius in modern browsers.
188
190
  &:focus-visible {
189
- outline: 2px solid cv.getVar('primary');
191
+ outline: 2px solid cv.getVar('dateinput-focus-ring-color');
190
192
  outline-offset: -2px;
191
193
  }
192
194
  // Today: tinted bold text (no ring), so it doesn't collide visually with
@@ -199,10 +201,11 @@ $dateinput-nav-button-size: 1.75rem !default;
199
201
  background-color: cv.getVar('dateinput-cell-selected-bg');
200
202
  color: cv.getVar('dateinput-cell-selected-color');
201
203
  }
202
- // When focus lands on the selected cell, swap the ring to scheme-main so
203
- // it stays visible against the primary-colored fill.
204
+ // On the selected cell the inset ring sits on the selection fill, so it
205
+ // takes the selected value's colour, which is chosen to contrast with that
206
+ // fill whatever colour it is.
204
207
  &.#{iv.$class-prefix}is-selected:focus-visible {
205
- outline-color: cv.getVar('scheme-main');
208
+ outline-color: cv.getVar('dateinput-cell-selected-color');
206
209
  }
207
210
  &.#{iv.$class-prefix}is-other-month {
208
211
  color: cv.getVar('dateinput-cell-other-month-color');
@@ -250,7 +253,7 @@ $dateinput-nav-button-size: 1.75rem !default;
250
253
  );
251
254
  }
252
255
  &:focus-visible {
253
- outline: 2px solid cv.getVar('primary');
256
+ outline: 2px solid cv.getVar('dateinput-focus-ring-color');
254
257
  outline-offset: -2px;
255
258
  }
256
259
  &.#{iv.$class-prefix}is-today {
@@ -261,8 +264,10 @@ $dateinput-nav-button-size: 1.75rem !default;
261
264
  background-color: cv.getVar('dateinput-cell-selected-bg');
262
265
  color: cv.getVar('dateinput-cell-selected-color');
263
266
  }
267
+ // The focused year is always the selected one, so this is the ring a
268
+ // keyboard user sees in the year view; it contrasts with the fill as above.
264
269
  &.#{iv.$class-prefix}is-selected:focus-visible {
265
- outline-color: cv.getVar('scheme-main');
270
+ outline-color: cv.getVar('dateinput-cell-selected-color');
266
271
  }
267
272
  &:disabled {
268
273
  color: cv.getVar('dateinput-cell-disabled-color');
@@ -271,6 +276,27 @@ $dateinput-nav-button-size: 1.75rem !default;
271
276
  }
272
277
  }
273
278
 
279
+ // Colour variants. `color` lands on the calendar root as `is-<colour>`, and
280
+ // the root re-points its accent variables at that colour: the selection fill
281
+ // paired with its `-invert` for the selected value. Today's tint and the focus
282
+ // ring sit on the calendar's surface rather than on a fill, so they take the
283
+ // colour's `-on-scheme` variant, which Bulma darkens or lightens until it
284
+ // contrasts with `scheme-main`; plain `warning` or `info` text on a light
285
+ // surface is too faint to read. Every rule that paints an accent reads one of
286
+ // these, so they follow without rules of their own.
287
+ @each $name in 'primary', 'link', 'info', 'success', 'warning', 'danger' {
288
+ .#{iv.$class-prefix}dateinput.#{iv.$class-prefix}is-#{$name} {
289
+ @include cv.register-vars(
290
+ (
291
+ 'dateinput-cell-selected-bg': #{cv.getVar($name)},
292
+ 'dateinput-cell-selected-color': #{cv.getVar('#{$name}-invert')},
293
+ 'dateinput-cell-today-color': #{cv.getVar('#{$name}-on-scheme')},
294
+ 'dateinput-focus-ring-color': #{cv.getVar('#{$name}-on-scheme')},
295
+ )
296
+ );
297
+ }
298
+ }
299
+
274
300
  .#{iv.$class-prefix}dateinput.#{iv.$class-prefix}is-small
275
301
  .#{iv.$class-prefix}dateinput-cell {
276
302
  width: 1.75rem;
@@ -2,11 +2,20 @@
2
2
  @use 'bulma/sass/utilities/css-variables' as cv;
3
3
 
4
4
  $timeinput-wheel-width: 3rem !default;
5
+ // Registered, and read by nothing: the wheels position every item from its
6
+ // height in script, so the component passes the height to them itself (taller
7
+ // on small viewports) rather than reading a CSS length. Kept so a theme that
8
+ // sets it still compiles.
5
9
  $timeinput-wheel-item-height: 2rem !default;
6
10
  $timeinput-wheel-gap: 0.4rem !default;
7
- $timeinput-wheel-bg: cv.getVar('scheme-main') !default;
11
+ // Transparent, so the drum shows the surface it sits on: the popover, the
12
+ // inline frame or DateTimeInput's time card, each of which has a background
13
+ // variable of its own that a painted default would cover.
14
+ $timeinput-wheel-bg: transparent !default;
8
15
  $timeinput-wheel-color: cv.getVar('text') !default;
9
16
  $timeinput-wheel-dim-color: cv.getVar('text-weak') !default;
17
+ // The calendar's cell hover, so both halves of a DateTimeInput answer the
18
+ // pointer alike, on light and dark schemes.
10
19
  $timeinput-wheel-hover-bg: hsla(0, 0%, 50%, 0.13) !default;
11
20
  $timeinput-wheel-selected-bg: cv.getVar('primary') !default;
12
21
  $timeinput-wheel-selected-color: cv.getVar('primary-invert') !default;
@@ -80,6 +89,7 @@ $timeinput-footer-padding: 0.5rem 0 0 !default;
80
89
  .#{iv.$class-prefix}timeinput-wheel {
81
90
  position: relative;
82
91
  width: cv.getVar('timeinput-wheel-width');
92
+ background-color: cv.getVar('timeinput-wheel-bg');
83
93
  outline: none;
84
94
  overflow: hidden;
85
95
  touch-action: none;
@@ -114,11 +124,14 @@ $timeinput-footer-padding: 0.5rem 0 0 !default;
114
124
  // pinning a ring to the selected item caused a broken-outline artefact
115
125
  // whenever position was mid-flight (item offset from band).
116
126
  //
117
- // The ring reads the band's colour, so a coloured wheel keeps one accent.
118
- &:focus-visible {
119
- outline: 2px solid cv.getVar('timeinput-wheel-selected-bg');
120
- outline-offset: 2px;
121
- border-radius: cv.getVar('timeinput-wheel-radius');
127
+ // The ring is drawn inset on the band. An outline on the wheel itself sits
128
+ // outside its border box, and the mask above clips everything there, so it
129
+ // never painted. On the band it sits on the selection fill, so it takes the
130
+ // selected value's colour, which contrasts with that fill whatever colour
131
+ // the band is.
132
+ &:focus-visible .#{iv.$class-prefix}timeinput-wheel-band {
133
+ outline: 2px solid cv.getVar('timeinput-wheel-selected-color');
134
+ outline-offset: -2px;
122
135
  }
123
136
 
124
137
  &.#{iv.$class-prefix}is-dragging .#{iv.$class-prefix}timeinput-wheel-item {
@@ -153,6 +166,14 @@ $timeinput-footer-padding: 0.5rem 0 0 !default;
153
166
 
154
167
  &:hover:not(:disabled):not(.#{iv.$class-prefix}is-selected) {
155
168
  color: cv.getVar('timeinput-wheel-color');
169
+
170
+ // Only where the pointer can hover: a touch browser can leave `:hover` on
171
+ // the last item a finger lifted from, and a drag leaves that item off the
172
+ // band, where the fill would stick. The fill is not in the transition list
173
+ // above, so it snaps on and off the way the calendar cells' hover does.
174
+ @media (hover: hover) {
175
+ background-color: cv.getVar('timeinput-wheel-hover-bg');
176
+ }
156
177
  }
157
178
 
158
179
  // The selected item (whichever is currently centred over the band) is
@@ -254,9 +275,9 @@ $timeinput-footer-padding: 0.5rem 0 0 !default;
254
275
  }
255
276
 
256
277
  // Mobile (small viewport): bigger touch targets, larger numbers, more iOS-native
257
- // feel. Item *height* is set inline by JS and bumped from 40px to 48px on small
258
- // viewports by TimeInputBase; the rules below adjust everything that's CSS-only
259
- // (font size, wheel width, gap, separator, mask intensity).
278
+ // feel. Item *height* is set inline by JS, and made taller on small viewports by
279
+ // the component; the rules below adjust everything that's CSS-only (font size,
280
+ // wheel width, gap, separator, mask intensity).
260
281
  @media (max-width: 768px) {
261
282
  // Registered through `cv.register-vars` like the defaults above, so the
262
283
  // overrides land on the names the rules read.