@allxsmith/bestax-bulma 5.26.5 → 5.27.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 (56) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/extras.css +1 -1
  4. package/dist/extras.css.map +1 -1
  5. package/dist/index.cjs +974 -96
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.esm.js +973 -97
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/components/Tabs.d.ts +25 -3
  10. package/dist/types/form/DateInputBase.d.ts +5 -2
  11. package/dist/types/form/DateRangeInput.d.ts +91 -0
  12. package/dist/types/form/DateRangeInputBase.d.ts +172 -0
  13. package/dist/types/form/DateTimeInputBase.d.ts +7 -2
  14. package/dist/types/form/File.d.ts +15 -2
  15. package/dist/types/form/FormContext.d.ts +11 -0
  16. package/dist/types/form/Numberinput.d.ts +8 -1
  17. package/dist/types/form/TimeInputBase.d.ts +1 -1
  18. package/dist/types/form/_pickerInternals/Calendar.d.ts +45 -4
  19. package/dist/types/form/_pickerInternals/PickerPopover.d.ts +1 -0
  20. package/dist/types/form/_pickerInternals/dateUtils.d.ts +24 -0
  21. package/dist/types/form/_pickerInternals/formatters.d.ts +14 -0
  22. package/dist/types/form/_pickerInternals/pickerTypes.d.ts +27 -0
  23. package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
  24. package/dist/types/helpers/statusRegion.d.ts +1 -0
  25. package/dist/types/index.d.ts +4 -0
  26. package/dist/types-cjs/components/Tabs.d.ts +25 -3
  27. package/dist/types-cjs/form/DateInputBase.d.ts +5 -2
  28. package/dist/types-cjs/form/DateRangeInput.d.ts +91 -0
  29. package/dist/types-cjs/form/DateRangeInputBase.d.ts +172 -0
  30. package/dist/types-cjs/form/DateTimeInputBase.d.ts +7 -2
  31. package/dist/types-cjs/form/File.d.ts +15 -2
  32. package/dist/types-cjs/form/FormContext.d.ts +11 -0
  33. package/dist/types-cjs/form/Numberinput.d.ts +8 -1
  34. package/dist/types-cjs/form/TimeInputBase.d.ts +1 -1
  35. package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +45 -4
  36. package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +1 -0
  37. package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +24 -0
  38. package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +14 -0
  39. package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +27 -0
  40. package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +12 -3
  41. package/dist/types-cjs/helpers/statusRegion.d.ts +1 -0
  42. package/dist/types-cjs/index.d.ts +4 -0
  43. package/dist/versions/bestax-no-dark-mode.css +1 -1
  44. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  45. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  46. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  47. package/dist/versions/bestax-no-helpers.css +1 -1
  48. package/dist/versions/bestax-no-helpers.css.map +1 -1
  49. package/dist/versions/bestax-prefixed.css +1 -1
  50. package/dist/versions/bestax-prefixed.css.map +1 -1
  51. package/package.json +1 -1
  52. package/src/scss/components/_tabs.scss +44 -0
  53. package/src/scss/form/_dateinput.scss +58 -3
  54. package/src/scss/form/_daterangeinput.scss +63 -0
  55. package/src/scss/form/_file.scss +37 -0
  56. package/src/scss/form/_index.scss +2 -0
@@ -16,6 +16,19 @@ $dateinput-header-padding: 0.5rem 0 !default;
16
16
  $dateinput-day-name-color: cv.getVar('text-weak') !default;
17
17
  $dateinput-day-name-size: cv.getVar('size-7') !default;
18
18
  $dateinput-nav-button-size: 1.75rem !default;
19
+ // A range's band: the days between its ends, tinted from the selection fill
20
+ // so a `color` variant re-tints it too. A preview, while the end is still
21
+ // being picked, is fainter.
22
+ $dateinput-cell-range-bg: color-mix(
23
+ in srgb,
24
+ #{cv.getVar('dateinput-cell-selected-bg')} 18%,
25
+ transparent
26
+ ) !default;
27
+ $dateinput-cell-range-preview-bg: color-mix(
28
+ in srgb,
29
+ #{cv.getVar('dateinput-cell-selected-bg')} 9%,
30
+ transparent
31
+ ) !default;
19
32
 
20
33
  .#{iv.$class-prefix}dateinput {
21
34
  @include cv.register-vars(
@@ -35,6 +48,8 @@ $dateinput-nav-button-size: 1.75rem !default;
35
48
  'dateinput-day-name-color': #{$dateinput-day-name-color},
36
49
  'dateinput-day-name-size': #{$dateinput-day-name-size},
37
50
  'dateinput-nav-button-size': #{$dateinput-nav-button-size},
51
+ 'dateinput-cell-range-bg': #{$dateinput-cell-range-bg},
52
+ 'dateinput-cell-range-preview-bg': #{$dateinput-cell-range-preview-bg},
38
53
  )
39
54
  );
40
55
  }
@@ -50,8 +65,7 @@ $dateinput-nav-button-size: 1.75rem !default;
50
65
  // (no popover wrapper), give it a subtle frame so the grid doesn't look
51
66
  // orphaned on the page. Mirrors the popover's visual weight without the
52
67
  // drop-shadow / animation.
53
- .#{iv.$class-prefix}dateinput-container
54
- > .#{iv.$class-prefix}dateinput {
68
+ .#{iv.$class-prefix}dateinput-container > .#{iv.$class-prefix}dateinput {
55
69
  background-color: cv.getVar('scheme-main');
56
70
  border: 1px solid cv.getVar('border');
57
71
  border-radius: cv.getVar('radius');
@@ -132,13 +146,20 @@ $dateinput-nav-button-size: 1.75rem !default;
132
146
  }
133
147
  }
134
148
 
149
+ // The day names and each week of the grid lay out in seven columns. The
150
+ // grid stacks its weeks, which are rows so it can own them as a grid must.
135
151
  .#{iv.$class-prefix}dateinput-day-names,
136
- .#{iv.$class-prefix}dateinput-grid {
152
+ .#{iv.$class-prefix}dateinput-week {
137
153
  display: grid;
138
154
  grid-template-columns: repeat(7, 1fr);
139
155
  gap: 2px;
140
156
  }
141
157
 
158
+ .#{iv.$class-prefix}dateinput-grid {
159
+ display: grid;
160
+ gap: 2px;
161
+ }
162
+
142
163
  .#{iv.$class-prefix}dateinput-day-name {
143
164
  text-align: center;
144
165
  font-size: cv.getVar('dateinput-day-name-size');
@@ -216,6 +237,40 @@ $dateinput-nav-button-size: 1.75rem !default;
216
237
  cursor: not-allowed;
217
238
  opacity: 0.55;
218
239
  }
240
+ // A range: its ends take the selected fill above, and the days between
241
+ // them the band. The hover rule above replaces a cell's fill and outranks
242
+ // a bare class, so each band state repeats under `:hover`, where it ties
243
+ // that rule and comes later, and the hover overlay is painted on top of
244
+ // the band as an image rather than in its place.
245
+ &.#{iv.$class-prefix}is-in-range {
246
+ &,
247
+ &:hover:not(:disabled) {
248
+ background-color: cv.getVar('dateinput-cell-range-bg');
249
+ }
250
+ }
251
+ // A preview, while the end is still being picked: a fainter band, and an
252
+ // outline on the day it would end on, which isn't picked yet. On the
253
+ // pointer path that day is the one under the pointer.
254
+ &.#{iv.$class-prefix}is-in-range.#{iv.$class-prefix}is-preview,
255
+ &.#{iv.$class-prefix}is-range-end.#{iv.$class-prefix}is-preview {
256
+ &,
257
+ &:hover:not(:disabled) {
258
+ background-color: cv.getVar('dateinput-cell-range-preview-bg');
259
+ }
260
+ }
261
+ &.#{iv.$class-prefix}is-range-end.#{iv.$class-prefix}is-preview {
262
+ border-style: dashed;
263
+ border-color: cv.getVar('dateinput-cell-selected-bg');
264
+ }
265
+ &.#{iv.$class-prefix}is-in-range,
266
+ &.#{iv.$class-prefix}is-range-end.#{iv.$class-prefix}is-preview {
267
+ &:hover:not(:disabled) {
268
+ background-image: linear-gradient(
269
+ cv.getVar('dateinput-cell-hover-bg'),
270
+ cv.getVar('dateinput-cell-hover-bg')
271
+ );
272
+ }
273
+ }
219
274
  }
220
275
 
221
276
  .#{iv.$class-prefix}dateinput-years-grid {
@@ -0,0 +1,63 @@
1
+ @use 'bulma/sass/utilities/initial-variables' as iv;
2
+ @use 'bulma/sass/utilities/css-variables' as cv;
3
+
4
+ // DateRangeInput's field: two inputs and a separator inside one Bulma
5
+ // `.input`. The calendar's range styles live with the rest of the calendar's,
6
+ // in `_dateinput.scss`, so a calendar portaled out of the field keeps them.
7
+ $daterangeinput-gap: 0.5em !default;
8
+ $daterangeinput-separator-color: cv.getVar('text-weak') !default;
9
+
10
+ .#{iv.$class-prefix}daterangeinput {
11
+ @include cv.register-vars(
12
+ (
13
+ 'daterangeinput-gap': #{$daterangeinput-gap},
14
+ 'daterangeinput-separator-color': #{$daterangeinput-separator-color},
15
+ )
16
+ );
17
+ }
18
+
19
+ // Bulma's `.input` already lays its content out in a row and draws its focus
20
+ // ring for `:focus-within`, so the field shows focus wherever it is inside.
21
+ .#{iv.$class-prefix}daterangeinput-field {
22
+ gap: cv.getVar('daterangeinput-gap');
23
+ cursor: text;
24
+ }
25
+
26
+ // The inputs are bare: the field around them is the input the user sees.
27
+ .#{iv.$class-prefix}daterangeinput-input {
28
+ flex: 1 1 0;
29
+ min-width: 0;
30
+ width: 100%;
31
+ padding: 0;
32
+ border: 0;
33
+ background: transparent;
34
+ color: inherit;
35
+ font: inherit;
36
+ outline: none;
37
+
38
+ &::placeholder {
39
+ color: cv.getVar('input-placeholder-color');
40
+ }
41
+ &:disabled {
42
+ cursor: not-allowed;
43
+ }
44
+ }
45
+
46
+ .#{iv.$class-prefix}daterangeinput-separator {
47
+ flex: none;
48
+ color: cv.getVar('daterangeinput-separator-color');
49
+ }
50
+
51
+ // A div takes no `disabled`, so the field is marked by class and given
52
+ // Bulma's disabled input look from Bulma's own variables.
53
+ .#{iv.$class-prefix}daterangeinput-field.#{iv.$class-prefix}is-disabled {
54
+ background-color: cv.getVar('input-disabled-background-color');
55
+ border-color: cv.getVar('input-disabled-border-color');
56
+ box-shadow: none;
57
+ color: cv.getVar('input-disabled-color');
58
+ cursor: not-allowed;
59
+
60
+ .#{iv.$class-prefix}daterangeinput-input::placeholder {
61
+ color: cv.getVar('input-disabled-placeholder-color');
62
+ }
63
+ }
@@ -0,0 +1,37 @@
1
+ // File Component Styles
2
+ // Bulma already styles the file input; this adds its keyboard focus ring
3
+
4
+ @use "bulma/sass/utilities/initial-variables" as iv;
5
+ @use "bulma/sass/utilities/css-variables" as cv;
6
+
7
+ // Keyboard focus ring for File. The focusable element is the <input>, which
8
+ // Bulma lays transparent over the whole widget, so the ring goes on the CTA
9
+ // you see instead. The .file-label around them hides its overflow, which
10
+ // clips a ring drawn outside the CTA, so the ring is drawn inside it, with
11
+ // Bulma's focus colour, style and width. :focus-visible keeps it to the
12
+ // keyboard: a click shows none.
13
+ .#{iv.$class-prefix}file-input:focus-visible + .#{iv.$class-prefix}file-cta {
14
+ outline-color: hsl(cv.getVar("focus-h"), cv.getVar("focus-s"), cv.getVar("focus-l"));
15
+ outline-style: cv.getVar("focus-style");
16
+ outline-width: cv.getVar("focus-width");
17
+ outline-offset: calc(-1 * #{cv.getVar("focus-width")});
18
+ }
19
+
20
+ // A coloured File fills its CTA with that colour, which can be the focus
21
+ // colour itself (it is the link colour by default), so its ring takes the
22
+ // CTA's text colour (currentColor, which Bulma sets to read on the fill) and
23
+ // sits one ring width further in, keeping a band of the fill outside it to
24
+ // set it off from the page around the CTA. The colours are the ones File's
25
+ // `color` prop takes, and the placeholder joins them into one rule.
26
+ %file-focus-ring-on-fill {
27
+ outline-color: currentColor;
28
+ outline-offset: calc(-2 * #{cv.getVar("focus-width")});
29
+ }
30
+
31
+ @each $name in "primary", "link", "info", "success", "warning", "danger", "black", "dark", "light", "white" {
32
+ .#{iv.$class-prefix}file.#{iv.$class-prefix}is-#{$name}
33
+ .#{iv.$class-prefix}file-input:focus-visible
34
+ + .#{iv.$class-prefix}file-cta {
35
+ @extend %file-focus-ring-on-fill;
36
+ }
37
+ }
@@ -14,3 +14,5 @@
14
14
  @use 'dateinput';
15
15
  @use 'timeinput';
16
16
  @use 'datetimeinput';
17
+ @use 'daterangeinput';
18
+ @use 'file';