@allxsmith/bestax-bulma 5.58.0 → 5.59.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 (68) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/elements/Buttons.js +2 -0
  4. package/dist/esm/elements/Buttons.js.map +1 -1
  5. package/dist/esm/elements/IconButton.js +114 -0
  6. package/dist/esm/elements/IconButton.js.map +1 -0
  7. package/dist/esm/helpers/containerBreakpoints.js +14 -0
  8. package/dist/esm/helpers/containerBreakpoints.js.map +1 -0
  9. package/dist/esm/helpers/polymorphic.js.map +1 -1
  10. package/dist/esm/helpers/stackLayout.js +30 -0
  11. package/dist/esm/helpers/stackLayout.js.map +1 -0
  12. package/dist/esm/helpers/useBulmaClasses.js +8 -2
  13. package/dist/esm/helpers/useBulmaClasses.js.map +1 -1
  14. package/dist/esm/helpers/useFlexboxClasses.js +17 -4
  15. package/dist/esm/helpers/useFlexboxClasses.js.map +1 -1
  16. package/dist/esm/layout/Center.js +33 -0
  17. package/dist/esm/layout/Center.js.map +1 -0
  18. package/dist/esm/layout/Container.js +2 -6
  19. package/dist/esm/layout/Container.js.map +1 -1
  20. package/dist/esm/layout/Flex.js +34 -0
  21. package/dist/esm/layout/Flex.js.map +1 -0
  22. package/dist/esm/layout/Group.js +43 -0
  23. package/dist/esm/layout/Group.js.map +1 -0
  24. package/dist/esm/layout/Stack.js +34 -0
  25. package/dist/esm/layout/Stack.js.map +1 -0
  26. package/dist/extras.css +1 -1
  27. package/dist/extras.css.map +1 -1
  28. package/dist/index.cjs +400 -136
  29. package/dist/index.cjs.map +1 -1
  30. package/dist/index.esm.js +5 -0
  31. package/dist/index.esm.js.map +1 -1
  32. package/dist/types/elements/Buttons.d.ts +1 -0
  33. package/dist/types/elements/IconButton.d.ts +110 -0
  34. package/dist/types/helpers/containerBreakpoints.d.ts +2 -0
  35. package/dist/types/helpers/polymorphic.d.ts +19 -0
  36. package/dist/types/helpers/stackLayout.d.ts +62 -0
  37. package/dist/types/helpers/useBulmaClasses.d.ts +8 -2
  38. package/dist/types/helpers/useFlexboxClasses.d.ts +26 -3
  39. package/dist/types/index.d.ts +7 -1
  40. package/dist/types/layout/Center.d.ts +54 -0
  41. package/dist/types/layout/Flex.d.ts +92 -0
  42. package/dist/types/layout/Group.d.ts +86 -0
  43. package/dist/types/layout/Stack.d.ts +63 -0
  44. package/dist/types-cjs/elements/Buttons.d.ts +1 -0
  45. package/dist/types-cjs/elements/IconButton.d.ts +110 -0
  46. package/dist/types-cjs/helpers/containerBreakpoints.d.ts +2 -0
  47. package/dist/types-cjs/helpers/polymorphic.d.ts +19 -0
  48. package/dist/types-cjs/helpers/stackLayout.d.ts +62 -0
  49. package/dist/types-cjs/helpers/useBulmaClasses.d.ts +8 -2
  50. package/dist/types-cjs/helpers/useFlexboxClasses.d.ts +26 -3
  51. package/dist/types-cjs/index.d.ts +7 -1
  52. package/dist/types-cjs/layout/Center.d.ts +54 -0
  53. package/dist/types-cjs/layout/Flex.d.ts +92 -0
  54. package/dist/types-cjs/layout/Group.d.ts +86 -0
  55. package/dist/types-cjs/layout/Stack.d.ts +63 -0
  56. package/dist/versions/bestax-no-dark-mode.css +1 -1
  57. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  58. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  59. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  60. package/dist/versions/bestax-no-helpers.css +1 -1
  61. package/dist/versions/bestax-no-helpers.css.map +1 -1
  62. package/dist/versions/bestax-prefixed.css +1 -1
  63. package/dist/versions/bestax-prefixed.css.map +1 -1
  64. package/package.json +1 -1
  65. package/src/scss/elements/_iconbutton.scss +36 -0
  66. package/src/scss/elements/_index.scss +1 -0
  67. package/src/scss/layout/_index.scss +1 -0
  68. package/src/scss/layout/_stack.scss +145 -0
@@ -0,0 +1,36 @@
1
+ // Bestax Extras - IconButton Styles
2
+ // Bulma keeps a button whose only child is an `.icon` square at every size,
3
+ // so IconButton needs no CSS for that. Bulma's `is-rounded` adds horizontal
4
+ // padding to a rounded button, though, which around one icon makes a pill a
5
+ // little wider than it is tall. The first rule takes that padding back, so a
6
+ // rounded IconButton is a circle the size of its square. A rounded `Button`
7
+ // keeps Bulma's pill, since the rule needs IconButton's own class.
8
+ //
9
+ // The second takes away the underline Bulma gives a `text` button, and a
10
+ // `ghost` one on hover, which would run under a font icon's glyph.
11
+ //
12
+ // The circle reads Bulma's button variables, so a theme that changes them
13
+ // changes it too, and neither rule registers variables of its own. Bulma's
14
+ // CSS can land on either side of this partial, as `_loader.scss` says, so
15
+ // each selector outranks the Bulma rule it overrides by its classes: the
16
+ // first has three to Bulma's two in `.button.is-rounded`, and the second
17
+ // names its last class twice, as `_delete.scss` does, to outrank
18
+ // `.button.is-ghost:hover` too.
19
+
20
+ @use 'bulma/sass/utilities/initial-variables' as iv;
21
+ @use 'bulma/sass/utilities/css-variables' as cv;
22
+
23
+ .#{iv.$class-prefix}button.#{iv.$class-prefix}icon-button.#{iv.$class-prefix}is-rounded {
24
+ padding-inline: calc(
25
+ #{cv.getVar('button-padding-horizontal')} -
26
+ #{cv.getVar('button-border-width')}
27
+ );
28
+ }
29
+
30
+ .#{iv.$class-prefix}button.#{iv.$class-prefix}icon-button.#{iv.$class-prefix}icon-button {
31
+ &,
32
+ &:hover,
33
+ &.#{iv.$class-prefix}is-hovered {
34
+ text-decoration: none;
35
+ }
36
+ }
@@ -5,6 +5,7 @@
5
5
  @use 'colorswatch';
6
6
  @use 'delete';
7
7
  @use 'descriptionlist';
8
+ @use 'iconbutton';
8
9
  @use 'kbd';
9
10
  @use 'linkbutton';
10
11
  @use 'loader';
@@ -3,3 +3,4 @@
3
3
  // own layout does
4
4
 
5
5
  @use 'splitter';
6
+ @use 'stack';
@@ -0,0 +1,145 @@
1
+ // Bestax Extras - Stack Styles
2
+ // Stack, Group, Center and Flex. Bulma has no stack or group, so each is a
3
+ // `.stack`, which this makes a flex container, with a modifier for its own
4
+ // layout: Stack `is-vertical`, Group `is-horizontal`, Center `is-centered`,
5
+ // and Flex the bare `.stack`. The layout lives here rather than in helper
6
+ // classes, so it holds in a build without Bulma's helpers, and the helper
7
+ // props (`gap`, `alignItems` and the rest) still replace these defaults,
8
+ // since Bulma's helper classes are `!important`.
9
+ //
10
+ // Bulma gives its blocks (Box, Notification, Card, Title, Field and the
11
+ // rest) a bottom margin when they aren't last, and some a top one beside a
12
+ // sibling (Media after Media, a Divider's `<hr>`), which in a flex container
13
+ // add to the gap, since nothing collapses there. So the children's top and
14
+ // bottom margins are zeroed in all four, and the gap is the only space.
15
+ // Bulma sets those margins with `:not(:last-child)` or `+`, two classes'
16
+ // weight, so the reset carries an id's weight through `:not(#\#)`, which
17
+ // matches any element. A helper margin on a child (`mt="2"`, `mb="2"`) is
18
+ // `!important` and still wins. Only the direct children: what's inside them
19
+ // keeps its spacing. A Columns or Pagination child is the exception, since
20
+ // its margins are negative on purpose (below).
21
+
22
+ @use "bulma/sass/utilities/initial-variables" as iv;
23
+ @use "bulma/sass/utilities/css-variables" as cv;
24
+ @use "bulma/sass/utilities/mixins" as mx;
25
+
26
+ // Stack's gap: Bulma's block spacing, so a Stack of Boxes looks like Bulma's
27
+ // own stacked blocks.
28
+ $stack-gap: cv.getVar("block-spacing") !default;
29
+ // Group's gap: half of it, Level's spacing between its items.
30
+ $stack-horizontal-gap: calc(#{cv.getVar("block-spacing")} * 0.5) !default;
31
+
32
+ .#{iv.$class-prefix}stack {
33
+ @include cv.register-vars(
34
+ (
35
+ "stack-gap": #{$stack-gap},
36
+ "stack-horizontal-gap": #{$stack-horizontal-gap},
37
+ )
38
+ );
39
+ }
40
+
41
+ // ---- Flex: a flex container with CSS's own defaults ------------------------------
42
+
43
+ // Not on a `hidden` one: a `display` here outranks the browser's own
44
+ // `[hidden] { display: none }`, so a hidden Stack, such as a closed panel,
45
+ // would show.
46
+ .#{iv.$class-prefix}stack:not([hidden]) {
47
+ display: flex;
48
+ }
49
+
50
+ .#{iv.$class-prefix}stack
51
+ > :not(#\#):not(.#{iv.$class-prefix}columns):not(
52
+ .#{iv.$class-prefix}pagination
53
+ ) {
54
+ margin-block: 0;
55
+ }
56
+
57
+ // ---- Stack: a column --------------------------------------------------------------
58
+
59
+ .#{iv.$class-prefix}stack.#{iv.$class-prefix}is-vertical {
60
+ flex-direction: column;
61
+ gap: cv.getVar("stack-gap");
62
+ }
63
+
64
+ // ---- A Columns child, in any of the four -------------------------------------------
65
+
66
+ // Bulma's Columns pull themselves out by the column gap on every side, so
67
+ // their columns' padding lines the content up with the blocks around them.
68
+ // Zeroing those margins would leave that padding showing, so a Columns child
69
+ // keeps its own top and side margins, and at the bottom takes the one Bulma
70
+ // gives the last Columns in a container: the gap pulled back in, or nothing
71
+ // when gapless. Its content then sits the gap from its neighbours, and
72
+ // centered in a row.
73
+ .#{iv.$class-prefix}stack > .#{iv.$class-prefix}columns:not(#\#) {
74
+ margin-block-end: calc(-1 * #{cv.getVar("column-gap")});
75
+ }
76
+
77
+ .#{iv.$class-prefix}stack
78
+ > .#{iv.$class-prefix}columns.#{iv.$class-prefix}is-gapless:not(#\#) {
79
+ margin-block-end: 0;
80
+ }
81
+
82
+ // ---- A Pagination child, in any of the four ----------------------------------------
83
+
84
+ // Bulma's Pagination pulls itself out by the margin its items keep around
85
+ // them, so the items line up with the blocks around it, and from tablet up,
86
+ // where the items keep none at the top and bottom, it takes none there
87
+ // either. It does the same here, over the block margin Bulma gives it when
88
+ // it isn't last, which would otherwise add to the gap.
89
+ .#{iv.$class-prefix}stack > .#{iv.$class-prefix}pagination:not(#\#) {
90
+ margin-block: cv.getVar("pagination-margin");
91
+ }
92
+
93
+ @include mx.tablet {
94
+ .#{iv.$class-prefix}stack > .#{iv.$class-prefix}pagination:not(#\#) {
95
+ margin-block: 0;
96
+ }
97
+ }
98
+
99
+ // ---- Group: a row that wraps -------------------------------------------------------
100
+
101
+ .#{iv.$class-prefix}stack.#{iv.$class-prefix}is-horizontal {
102
+ flex-wrap: wrap;
103
+ align-items: center;
104
+ gap: cv.getVar("stack-horizontal-gap");
105
+
106
+ // Every child an equal share of the row.
107
+ &.#{iv.$class-prefix}is-fullwidth > * {
108
+ flex: 1 1 0;
109
+ }
110
+ }
111
+
112
+ // Below its breakpoint, a Group is a column, in the same order. Full width,
113
+ // each child takes the column's width rather than a share of its height.
114
+ @mixin -stacked($selector) {
115
+ .#{iv.$class-prefix}stack.#{iv.$class-prefix}is-horizontal#{$selector} {
116
+ flex-direction: column;
117
+
118
+ &.#{iv.$class-prefix}is-fullwidth {
119
+ align-items: stretch;
120
+
121
+ > * {
122
+ flex: none;
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ @include mx.mobile {
129
+ @include -stacked(".#{iv.$class-prefix}is-tablet");
130
+ }
131
+
132
+ @include mx.touch {
133
+ @include -stacked(".#{iv.$class-prefix}is-desktop");
134
+ }
135
+
136
+ @include mx.until-widescreen {
137
+ @include -stacked(".#{iv.$class-prefix}is-widescreen");
138
+ }
139
+
140
+ // ---- Center: both axes ---------------------------------------------------------------
141
+
142
+ .#{iv.$class-prefix}stack.#{iv.$class-prefix}is-centered {
143
+ align-items: center;
144
+ justify-content: center;
145
+ }