@allxsmith/bestax-bulma 5.27.6 → 5.27.8

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 (62) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/elements/Notification.js +1 -0
  4. package/dist/esm/elements/Notification.js.map +1 -1
  5. package/dist/esm/form/DateInputBase.js +2 -3
  6. package/dist/esm/form/DateInputBase.js.map +1 -1
  7. package/dist/esm/form/DateRangeInputBase.js +18 -3
  8. package/dist/esm/form/DateRangeInputBase.js.map +1 -1
  9. package/dist/esm/form/DateTimeInputBase.js +2 -3
  10. package/dist/esm/form/DateTimeInputBase.js.map +1 -1
  11. package/dist/esm/form/Field.js +39 -7
  12. package/dist/esm/form/Field.js.map +1 -1
  13. package/dist/esm/form/FormContext.js +56 -11
  14. package/dist/esm/form/FormContext.js.map +1 -1
  15. package/dist/esm/form/InputBase.js +6 -5
  16. package/dist/esm/form/InputBase.js.map +1 -1
  17. package/dist/esm/form/SelectBase.js +7 -5
  18. package/dist/esm/form/SelectBase.js.map +1 -1
  19. package/dist/esm/form/TextAreaBase.js +6 -5
  20. package/dist/esm/form/TextAreaBase.js.map +1 -1
  21. package/dist/esm/form/TimeInputBase.js +2 -3
  22. package/dist/esm/form/TimeInputBase.js.map +1 -1
  23. package/dist/esm/form/useAutoLabelId.js +8 -3
  24. package/dist/esm/form/useAutoLabelId.js.map +1 -1
  25. package/dist/esm/helpers/Theme.js +87 -17
  26. package/dist/esm/helpers/Theme.js.map +1 -1
  27. package/dist/esm/helpers/devWarnings.js +8 -3
  28. package/dist/esm/helpers/devWarnings.js.map +1 -1
  29. package/dist/esm/helpers/useFlexboxClasses.js +1 -1
  30. package/dist/esm/helpers/useOtherClasses.js +1 -1
  31. package/dist/esm/helpers/useSpacingClasses.js +1 -1
  32. package/dist/esm/helpers/useTypographyClasses.js +1 -1
  33. package/dist/esm/helpers/useVisibilityClasses.js +1 -1
  34. package/dist/extras.css +1 -1
  35. package/dist/extras.css.map +1 -1
  36. package/dist/index.cjs +226 -55
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/types/elements/Notification.d.ts +5 -0
  39. package/dist/types/form/DateRangeInputBase.d.ts +5 -0
  40. package/dist/types/form/Field.d.ts +2 -2
  41. package/dist/types/form/FormContext.d.ts +50 -10
  42. package/dist/types/form/useAutoLabelId.d.ts +4 -2
  43. package/dist/types/helpers/Theme.d.ts +15 -1
  44. package/dist/types/helpers/devWarnings.d.ts +8 -0
  45. package/dist/types-cjs/elements/Notification.d.ts +5 -0
  46. package/dist/types-cjs/form/DateRangeInputBase.d.ts +5 -0
  47. package/dist/types-cjs/form/Field.d.ts +2 -2
  48. package/dist/types-cjs/form/FormContext.d.ts +50 -10
  49. package/dist/types-cjs/form/useAutoLabelId.d.ts +4 -2
  50. package/dist/types-cjs/helpers/Theme.d.ts +15 -1
  51. package/dist/types-cjs/helpers/devWarnings.d.ts +8 -0
  52. package/dist/versions/bestax-no-dark-mode.css +1 -1
  53. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  54. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  55. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  56. package/dist/versions/bestax-no-helpers.css +1 -1
  57. package/dist/versions/bestax-no-helpers.css.map +1 -1
  58. package/dist/versions/bestax-prefixed.css +1 -1
  59. package/dist/versions/bestax-prefixed.css.map +1 -1
  60. package/package.json +18 -18
  61. package/src/scss/elements/_index.scss +1 -0
  62. package/src/scss/elements/_notification.scss +69 -0
@@ -0,0 +1,69 @@
1
+ // Notification Styles
2
+ // Bulma already styles the notification; this keeps its text clear of the
3
+ // close button
4
+
5
+ @use "bulma/sass/utilities/initial-variables" as iv;
6
+ @use "bulma/sass/utilities/css-variables" as cv;
7
+
8
+ // Bulma pads a notification 1.5em at each end and puts its close button 1rem
9
+ // in from the end, 1.25rem square, so the button reaches further in than the
10
+ // padding does and on a narrow column the end of the first line runs under
11
+ // it. A notification with a close button pads its end enough to clear it:
12
+ // Bulma's inset for the button, plus its size, plus the 0.75rem gap Bulma 0.9
13
+ // left between the text and the button. The button is sized in rem, so the
14
+ // padding is too.
15
+ //
16
+ // Bulma writes the inset as a literal and declares the size on the button
17
+ // itself, through --bulma-delete-dimensions. Custom properties only inherit
18
+ // downward, so the notification can't read the button's size, and the
19
+ // default restates Bulma's numbers. Notification.styles.test.tsx holds them
20
+ // to Bulma's CSS.
21
+ $notification-delete-padding-inline-end: calc(1rem + 1.25rem + 0.75rem) !default;
22
+
23
+ // Bulma's sizes for the close button: the one above, and the ones its size
24
+ // modifiers set. A notification whose close button has a modifier pads by
25
+ // the difference, so the gap stays the same.
26
+ $-delete-dimensions: 1.25rem;
27
+ $-delete-sizes: (
28
+ "small": 1rem,
29
+ "medium": 1.5rem,
30
+ "large": 2rem,
31
+ );
32
+
33
+ .#{iv.$class-prefix}notification {
34
+ @include cv.register-vars(
35
+ (
36
+ "notification-delete-padding-inline-end": #{$notification-delete-padding-inline-end},
37
+ )
38
+ );
39
+ }
40
+
41
+ // has-delete is the class Notification adds with hasDelete. The :has() rule
42
+ // covers a close button bestax didn't render, such as a Delete passed in as
43
+ // a child, in browsers that support :has(). They are separate rules, not one
44
+ // selector list, so a browser without :has() still applies the first.
45
+ //
46
+ // Each outranks Bulma's `.notification` padding, so the order Bulma's CSS and
47
+ // this partial land in doesn't matter, and neither uses !important, so a
48
+ // spacing helper on the notification still wins.
49
+ .#{iv.$class-prefix}notification.#{iv.$class-prefix}has-delete {
50
+ padding-inline-end: cv.getVar("notification-delete-padding-inline-end");
51
+ }
52
+
53
+ .#{iv.$class-prefix}notification:has(> .#{iv.$class-prefix}delete) {
54
+ padding-inline-end: cv.getVar("notification-delete-padding-inline-end");
55
+ }
56
+
57
+ // A close button with a size modifier, which only a Delete passed in can
58
+ // have, so these need :has() too. Each outranks the two rules above, and
59
+ // builds on the variable, so overriding it moves these as well.
60
+ @each $size, $dimensions in $-delete-sizes {
61
+ .#{iv.$class-prefix}notification:has(
62
+ > .#{iv.$class-prefix}delete.#{iv.$class-prefix}is-#{$size}
63
+ ) {
64
+ padding-inline-end: calc(
65
+ cv.getVar("notification-delete-padding-inline-end") +
66
+ ($dimensions - $-delete-dimensions)
67
+ );
68
+ }
69
+ }