@allxsmith/bestax-bulma 5.57.1 → 5.57.3

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 (63) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Toast.js +21 -7
  4. package/dist/esm/components/Toast.js.map +1 -1
  5. package/dist/esm/elements/Tr.js.map +1 -1
  6. package/dist/esm/form/Checkbox.js +21 -14
  7. package/dist/esm/form/Checkbox.js.map +1 -1
  8. package/dist/esm/form/CheckboxCard.js +17 -11
  9. package/dist/esm/form/CheckboxCard.js.map +1 -1
  10. package/dist/esm/form/Checkboxes.js +30 -3
  11. package/dist/esm/form/Checkboxes.js.map +1 -1
  12. package/dist/esm/form/FormContext.js +31 -1
  13. package/dist/esm/form/FormContext.js.map +1 -1
  14. package/dist/esm/form/Radio.js +13 -10
  15. package/dist/esm/form/Radio.js.map +1 -1
  16. package/dist/esm/form/RadioCard.js +10 -8
  17. package/dist/esm/form/RadioCard.js.map +1 -1
  18. package/dist/esm/form/Radios.js +15 -3
  19. package/dist/esm/form/Radios.js.map +1 -1
  20. package/dist/esm/form/Rate.js +2 -2
  21. package/dist/esm/form/Rate.js.map +1 -1
  22. package/dist/extras.css +1 -1
  23. package/dist/extras.css.map +1 -1
  24. package/dist/index.cjs +152 -52
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/types/components/Toast.d.ts +14 -3
  27. package/dist/types/elements/Tr.d.ts +3 -3
  28. package/dist/types/form/CheckboxCard.d.ts +1 -1
  29. package/dist/types/form/Checkboxes.d.ts +7 -1
  30. package/dist/types/form/FormContext.d.ts +34 -1
  31. package/dist/types/form/RadioCard.d.ts +1 -1
  32. package/dist/types/form/Radios.d.ts +5 -1
  33. package/dist/types/form/Rate.d.ts +5 -1
  34. package/dist/types-cjs/components/Toast.d.ts +14 -3
  35. package/dist/types-cjs/elements/Tr.d.ts +3 -3
  36. package/dist/types-cjs/form/CheckboxCard.d.ts +1 -1
  37. package/dist/types-cjs/form/Checkboxes.d.ts +7 -1
  38. package/dist/types-cjs/form/FormContext.d.ts +34 -1
  39. package/dist/types-cjs/form/RadioCard.d.ts +1 -1
  40. package/dist/types-cjs/form/Radios.d.ts +5 -1
  41. package/dist/types-cjs/form/Rate.d.ts +5 -1
  42. package/dist/versions/bestax-no-dark-mode.css +1 -1
  43. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  44. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  45. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  46. package/dist/versions/bestax-no-helpers.css +1 -1
  47. package/dist/versions/bestax-no-helpers.css.map +1 -1
  48. package/dist/versions/bestax-prefixed.css +1 -1
  49. package/dist/versions/bestax-prefixed.css.map +1 -1
  50. package/package.json +1 -1
  51. package/src/scss/CLAUDE.md +4 -1
  52. package/src/scss/_selected-row.scss +43 -0
  53. package/src/scss/components/_index.scss +1 -0
  54. package/src/scss/components/_pagination.scss +25 -0
  55. package/src/scss/components/_toast.scss +2 -1
  56. package/src/scss/elements/_delete.scss +63 -0
  57. package/src/scss/elements/_index.scss +1 -0
  58. package/src/scss/form/_checkbox.scss +18 -42
  59. package/src/scss/form/_combobox.scss +11 -0
  60. package/src/scss/form/_dropzone.scss +0 -34
  61. package/src/scss/form/_radio.scss +28 -2
  62. package/src/scss/form/_switch.scss +9 -5
  63. package/src/scss/form/_taginput.scss +6 -2
@@ -0,0 +1,43 @@
1
+ // Bestax Extras - the cells of a selected table row
2
+ // A mixin Checkbox and Radio share, so the cells their selected-row rules
3
+ // name can't drift apart. It reads Bulma's `$colors`, so it lives here rather
4
+ // than in `_mixins.scss`, which compiles with no Bulma to load.
5
+
6
+ @use 'sass:list';
7
+ @use 'bulma/sass/utilities/initial-variables' as iv;
8
+ @use 'bulma/sass/utilities/derived-variables' as dv;
9
+
10
+ // The cells of a table that sit on Bulma's selected-row fill (`Tr
11
+ // isSelected`, or a cell with `is-selected`), for a control drawn in the
12
+ // primary color, which the fill is too. Name the step from the cell down to
13
+ // the control in the content with a child combinator (`> .styled-checkbox`):
14
+ // one inside a menu, a card or a table nested in the cell sits on that
15
+ // surface's own background instead.
16
+ //
17
+ // A cell with a color of its own (`Td color="white"`) paints its own
18
+ // background over the row's, and so does every cell of a row with a color
19
+ // (`Tr color="white" isSelected`), which hands its color to its cells. Both
20
+ // are left out. Bulma colors those cells with custom properties alone, which
21
+ // a selector can't read, so the cells are named by class, one for each color
22
+ // Bulma makes them from: its `$colors` map, which its table's `$table-colors`
23
+ // is built from, custom colors included. A selected cell is the row's fill
24
+ // whatever its color, as Bulma paints it.
25
+ @mixin extras-selected-table-cell {
26
+ $colored: ();
27
+ @each $name, $color in dv.$colors {
28
+ $colored: list.append(
29
+ $colored,
30
+ '.#{iv.$class-prefix}is-#{$name}',
31
+ $separator: comma
32
+ );
33
+ }
34
+
35
+ .#{iv.$class-prefix}table {
36
+ tr.#{iv.$class-prefix}is-selected:not(#{$colored}) > td:not(#{$colored}),
37
+ tr.#{iv.$class-prefix}is-selected:not(#{$colored}) > th:not(#{$colored}),
38
+ td.#{iv.$class-prefix}is-selected,
39
+ th.#{iv.$class-prefix}is-selected {
40
+ @content;
41
+ }
42
+ }
43
+ }
@@ -25,3 +25,4 @@
25
25
  @use 'scrollarea';
26
26
  @use 'command';
27
27
  @use 'datatable';
28
+ @use 'pagination';
@@ -0,0 +1,25 @@
1
+ // Bestax Extras - Pagination Styles
2
+ // Bulma marks the current page link with a fill, a border color and a text
3
+ // color, and nothing else, and forced colors (Windows' contrast themes)
4
+ // replaces all three with the system's, so the current page looks like every
5
+ // other page there. This draws it in Highlight and HighlightText, the pair the
6
+ // system keeps for a selection, the way the themed Checkbox marks a checked
7
+ // box. `forced-color-adjust: none` keeps them. Outside forced colors it
8
+ // changes nothing.
9
+ //
10
+ // It reads the classes Bulma highlights, `is-current` and its other name
11
+ // `is-selected`, so a hand-written current link gets it too, and so does
12
+ // `DataTable`'s pager, which is a `Pagination`. Two classes outrank Bulma's
13
+ // colors for a link, wherever the two stylesheets load.
14
+
15
+ @use 'bulma/sass/utilities/initial-variables' as iv;
16
+
17
+ @media (forced-colors: active) {
18
+ .#{iv.$class-prefix}pagination-link.#{iv.$class-prefix}is-current,
19
+ .#{iv.$class-prefix}pagination-link.#{iv.$class-prefix}is-selected {
20
+ forced-color-adjust: none;
21
+ background-color: Highlight;
22
+ border-color: Highlight;
23
+ color: HighlightText;
24
+ }
25
+ }
@@ -76,7 +76,8 @@ $toast-action-hover-opacity: 0.1 !default;
76
76
  align-items: center;
77
77
  }
78
78
 
79
- // Bottom positions — column-reverse so newer toasts appear nearest the edge
79
+ // Bottom positions: column-reverse, so a stack grows up from the bottom
80
+ // edge as a top one grows down from the top, the first toast nearest it
80
81
  &.#{iv.$class-prefix}is-bottom-right {
81
82
  bottom: 0;
82
83
  right: 0;
@@ -0,0 +1,63 @@
1
+ // Bestax Extras - Delete Styles
2
+ // Bulma draws a delete button's circle and its cross as background colors,
3
+ // on the button and on its `::before` and `::after`, and draws the Modal's
4
+ // floating close and a delete tag's cross the same way. Forced colors
5
+ // (Windows' contrast themes) replaces background colors with the system's, so
6
+ // the buttons vanish, or their cross does, while they still work and still
7
+ // take focus. This keeps them drawn there, in the system's button colors: the
8
+ // circle in ButtonFace with a ButtonText edge, and the cross in ButtonText.
9
+ // The floating close has no circle, so it gets only the cross. Outside forced
10
+ // colors it changes nothing.
11
+ //
12
+ // `.delete` is `Delete`, which every other close button bestax renders is
13
+ // too, apart from the Modal's floating close (`.modal-close`) and `Tag
14
+ // isDelete` (`.tag.is-delete`).
15
+ //
16
+ // `forced-color-adjust: none` keeps these colors, and the focus ring's too,
17
+ // which would then be Bulma's focus color rather than the user's, so the ring
18
+ // takes the system's Highlight. It would also keep a disabled one looking
19
+ // like the rest, so that one's edge and cross take GrayText, the system's
20
+ // color for a disabled control: a `Delete` with `disabled`, which writes
21
+ // Bulma's `is-disabled` too, and any of them inside a disabled `<fieldset>`.
22
+ //
23
+ // Bulma's CSS can land on either side of this partial, as it can for
24
+ // `_loader.scss`, which says why, so each selector names its last class twice
25
+ // to outrank Bulma's rule for the same element, wherever the two load.
26
+
27
+ @use 'bulma/sass/utilities/initial-variables' as iv;
28
+
29
+ @media (forced-colors: active) {
30
+ .#{iv.$class-prefix}delete.#{iv.$class-prefix}delete,
31
+ .#{iv.$class-prefix}tag.#{iv.$class-prefix}is-delete.#{iv.$class-prefix}is-delete {
32
+ background-color: ButtonFace;
33
+ border: 1px solid ButtonText;
34
+
35
+ &:disabled,
36
+ &.#{iv.$class-prefix}is-disabled {
37
+ border-color: GrayText;
38
+ }
39
+ }
40
+
41
+ .#{iv.$class-prefix}delete.#{iv.$class-prefix}delete,
42
+ .#{iv.$class-prefix}modal-close.#{iv.$class-prefix}modal-close,
43
+ .#{iv.$class-prefix}tag.#{iv.$class-prefix}is-delete.#{iv.$class-prefix}is-delete {
44
+ forced-color-adjust: none;
45
+
46
+ &::before,
47
+ &::after {
48
+ background-color: ButtonText;
49
+ }
50
+
51
+ &:disabled,
52
+ &.#{iv.$class-prefix}is-disabled {
53
+ &::before,
54
+ &::after {
55
+ background-color: GrayText;
56
+ }
57
+ }
58
+
59
+ &:focus-visible {
60
+ outline-color: Highlight;
61
+ }
62
+ }
63
+ }
@@ -3,6 +3,7 @@
3
3
 
4
4
  // Element Components
5
5
  @use 'colorswatch';
6
+ @use 'delete';
6
7
  @use 'descriptionlist';
7
8
  @use 'kbd';
8
9
  @use 'linkbutton';
@@ -2,11 +2,10 @@
2
2
  // Custom-styled checkbox with colors, sizes, and visual states
3
3
  // Follows Bulma v1 CSS variable convention (see _dialog.scss)
4
4
 
5
- @use "sass:list";
6
5
  @use "bulma/sass/utilities/initial-variables" as iv;
7
6
  @use "bulma/sass/utilities/css-variables" as cv;
8
- @use "bulma/sass/utilities/derived-variables" as dv;
9
7
  @use "bulma/sass/utilities/mixins" as mx;
8
+ @use "../selected-row" as *;
10
9
 
11
10
  // Bulma's horizontal field: `.field-label` takes one part of the row and
12
11
  // `.field-body` five, after the label's `margin-inline-end`. Private, since
@@ -165,9 +164,11 @@ $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
165
164
  }
166
165
  }
167
166
 
168
- // Label text
167
+ // Label text. The gap is on the text's inline start, the side the box is
168
+ // on: the row mirrors on a right-to-left page, and a physical
169
+ // `margin-left` would stay on the far side and leave the text on the box.
169
170
  .#{iv.$class-prefix}control-label {
170
- margin-left: cv.getVar("checkbox-label-gap");
171
+ margin-inline-start: cv.getVar("checkbox-label-gap");
171
172
  line-height: 1.5;
172
173
  }
173
174
  }
@@ -194,44 +195,19 @@ $-check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
194
195
  // read.
195
196
  //
196
197
  // Only a Checkbox placed straight in one of those cells sits on the row's
197
- // fill, so the rule names each step down to it rather than any checkbox
198
- // below the row. One inside a menu, a card or a table nested in the cell sits
199
- // on that surface's own background, and keeps its own colors there.
200
- //
201
- // A cell with a color of its own (`Td color="white"`) paints its own
202
- // background over the row's, and so does every cell of a row with a color
203
- // (`Tr color="white" isSelected`), which hands its color to its cells. Both
204
- // are left out, and a box there keeps its usual look. Bulma colors those cells with custom properties alone, which a
205
- // selector can't read, so the cells are named by class, one for each color
206
- // Bulma makes them from: its `$colors` map, which its table's
207
- // `$table-colors` is built from, custom colors included. A selected cell is
208
- // the row's fill whatever its color, as Bulma paints it.
209
- $-colored-cells: ();
210
- @each $name, $color in dv.$colors {
211
- $-colored-cells: list.append(
212
- $-colored-cells,
213
- ".#{iv.$class-prefix}is-#{$name}",
214
- $separator: comma
215
- );
216
- }
217
-
218
- .#{iv.$class-prefix}table {
219
- tr.#{iv.$class-prefix}is-selected:not(#{$-colored-cells})
220
- > td:not(#{$-colored-cells}),
221
- tr.#{iv.$class-prefix}is-selected:not(#{$-colored-cells})
222
- > th:not(#{$-colored-cells}),
223
- td.#{iv.$class-prefix}is-selected,
224
- th.#{iv.$class-prefix}is-selected {
225
- > .#{iv.$class-prefix}styled-checkbox {
226
- @include cv.register-vars(
227
- (
228
- "checkbox-border-color": #{cv.getVar("table-row-active-color")},
229
- "checkbox-active-color": #{cv.getVar("table-row-active-color")},
230
- "checkbox-indeterminate-color": #{cv.getVar("table-row-active-color")},
231
- "checkbox-check-color": #{cv.getVar("table-row-active-background-color")},
232
- )
233
- );
234
- }
198
+ // fill, and cells with a color of their own are left out, so a box in a
199
+ // menu, a nested table or a colored cell keeps its usual look. The mixin
200
+ // names the cells, and Radio's rule reads the same list.
201
+ @include extras-selected-table-cell {
202
+ > .#{iv.$class-prefix}styled-checkbox {
203
+ @include cv.register-vars(
204
+ (
205
+ "checkbox-border-color": #{cv.getVar("table-row-active-color")},
206
+ "checkbox-active-color": #{cv.getVar("table-row-active-color")},
207
+ "checkbox-indeterminate-color": #{cv.getVar("table-row-active-color")},
208
+ "checkbox-check-color": #{cv.getVar("table-row-active-background-color")},
209
+ )
210
+ );
235
211
  }
236
212
  }
237
213
 
@@ -284,11 +284,22 @@ $combobox-sizes: (
284
284
  }
285
285
  }
286
286
 
287
+ // A line between a group and whatever comes before it, and between a group
288
+ // and items with no group after it, which would otherwise read as the group's
289
+ // last items. It's a border, which forced colors keeps.
287
290
  .#{iv.$class-prefix}combobox-group:not(:first-child) {
288
291
  border-top: 1px solid cv.getVar('combobox-divider-color');
289
292
  margin-top: cv.getVar('combobox-item-padding-y');
290
293
  }
291
294
 
295
+ .#{iv.$class-prefix}combobox-group:has(
296
+ + :not(.#{iv.$class-prefix}combobox-group)
297
+ ) {
298
+ border-bottom: 1px solid cv.getVar('combobox-divider-color');
299
+ margin-bottom: cv.getVar('combobox-item-padding-y');
300
+ padding-bottom: cv.getVar('combobox-item-padding-y');
301
+ }
302
+
292
303
  .#{iv.$class-prefix}combobox-group-label {
293
304
  padding: cv.getVar('combobox-item-padding-y')
294
305
  cv.getVar('combobox-item-padding-x') 0.125rem;
@@ -197,37 +197,3 @@ $dropzone-size-font-size: cv.getVar('size-small') !default;
197
197
  flex: none;
198
198
  font-size: cv.getVar('dropzone-size-font-size');
199
199
  }
200
-
201
- // Bulma shows a delete button's focus only as a slightly darker circle, so a
202
- // row's remove button takes a ring from the keyboard, in Bulma's focus
203
- // colour, style and width.
204
- .#{iv.$class-prefix}dropzone-item .#{iv.$class-prefix}delete:focus-visible {
205
- outline-color: hsl(
206
- cv.getVar('focus-h'),
207
- cv.getVar('focus-s'),
208
- cv.getVar('focus-l')
209
- );
210
- outline-offset: cv.getVar('focus-offset');
211
- outline-style: cv.getVar('focus-style');
212
- outline-width: cv.getVar('focus-width');
213
- }
214
-
215
- // Bulma draws a delete button's circle and cross as backgrounds, which forced
216
- // colours paints over, so the remove buttons would vanish. They keep their
217
- // own colours there, in the system's button colours.
218
- @media (forced-colors: active) {
219
- .#{iv.$class-prefix}dropzone-item .#{iv.$class-prefix}delete {
220
- background-color: ButtonFace;
221
- border: 1px solid ButtonText;
222
- forced-color-adjust: none;
223
-
224
- &::before,
225
- &::after {
226
- background-color: ButtonText;
227
- }
228
-
229
- &:focus-visible {
230
- outline-color: Highlight;
231
- }
232
- }
233
- }
@@ -5,6 +5,7 @@
5
5
  @use "bulma/sass/utilities/initial-variables" as iv;
6
6
  @use "bulma/sass/utilities/css-variables" as cv;
7
7
  @use "bulma/sass/utilities/mixins" as mx;
8
+ @use "../selected-row" as *;
8
9
 
9
10
  // Bulma's horizontal field: `.field-label` takes one part of the row and
10
11
  // `.field-body` five, after the label's `margin-inline-end`. Private, since
@@ -124,9 +125,12 @@ $radio-transition-duration: cv.getVar("duration") !default;
124
125
  }
125
126
  }
126
127
 
127
- // Label text
128
+ // Label text. The gap is on the text's inline start, the side the circle
129
+ // is on: the row mirrors on a right-to-left page, and a physical
130
+ // `margin-left` would stay on the far side and leave the text on the
131
+ // circle.
128
132
  .#{iv.$class-prefix}control-label {
129
- margin-left: cv.getVar("radio-label-gap");
133
+ margin-inline-start: cv.getVar("radio-label-gap");
130
134
  line-height: 1.5;
131
135
  }
132
136
  }
@@ -142,6 +146,28 @@ $radio-transition-duration: cv.getVar("duration") !default;
142
146
  }
143
147
  }
144
148
 
149
+ // On Bulma's selected table row (`Tr isSelected`, or a cell with
150
+ // `is-selected`), the row's fill is the same color a checked radio draws its
151
+ // ring and its dot in, so the radio would vanish into it. There the ring and
152
+ // the dot take the row's text color, as Checkbox's box does, and so does an
153
+ // unchecked ring. This outranks the color variants on purpose: the row's own
154
+ // pair is the one Bulma made to read on that fill.
155
+ //
156
+ // Only a Radio placed straight in one of those cells sits on the row's fill,
157
+ // and cells with a color of their own are left out, so a radio in a menu, a
158
+ // nested table or a colored cell keeps its usual look. The mixin names the
159
+ // cells, and Checkbox's rule reads the same list.
160
+ @include extras-selected-table-cell {
161
+ > .#{iv.$class-prefix}styled-radio {
162
+ @include cv.register-vars(
163
+ (
164
+ "radio-border-color": #{cv.getVar("table-row-active-color")},
165
+ "radio-active-color": #{cv.getVar("table-row-active-color")},
166
+ )
167
+ );
168
+ }
169
+ }
170
+
145
171
  // Size variants
146
172
  .#{iv.$class-prefix}styled-radio.#{iv.$class-prefix}is-small {
147
173
  font-size: cv.getVar("size-small");
@@ -131,19 +131,23 @@ $switch-thin-circle-size: 1.25em !default;
131
131
  }
132
132
  }
133
133
 
134
- // Label text
134
+ // Label text. The gap is on the text's inline start, the side the track
135
+ // is on: the row mirrors on a right-to-left page, and a physical
136
+ // `margin-left` would stay on the far side and leave the text on the
137
+ // track.
135
138
  .#{iv.$class-prefix}control-label {
136
- margin-left: cv.getVar("switch-label-gap");
139
+ margin-inline-start: cv.getVar("switch-label-gap");
137
140
  line-height: cv.getVar("switch-height");
138
141
  }
139
142
 
140
- // RTL support
143
+ // Label first: the reversed row puts the track on the text's inline end,
144
+ // in either page direction, so the gap moves there.
141
145
  &.#{iv.$class-prefix}is-rtl {
142
146
  flex-direction: row-reverse;
143
147
 
144
148
  .#{iv.$class-prefix}control-label {
145
- margin-left: 0;
146
- margin-right: cv.getVar("switch-label-gap");
149
+ margin-inline-start: 0;
150
+ margin-inline-end: cv.getVar("switch-label-gap");
147
151
  }
148
152
  }
149
153
  }
@@ -128,9 +128,13 @@ $taginput-transition-duration: cv.getVar("duration") !default;
128
128
  align-items: center;
129
129
  gap: cv.getVar("taginput-tag-gap");
130
130
 
131
+ // The remove button comes after the text, so its gap is on its inline
132
+ // start and it reaches into the tag's padding on its inline end, as
133
+ // Bulma's own tag does it. Physical margins put the gap on the far
134
+ // side on a right-to-left page, and the button on the text.
131
135
  .#{iv.$class-prefix}delete {
132
- margin-left: 0.25rem;
133
- margin-right: -0.25rem;
136
+ margin-inline-start: 0.25rem;
137
+ margin-inline-end: -0.25rem;
134
138
  }
135
139
  }
136
140
  }