@allxsmith/bestax-bulma 5.54.0 → 5.55.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 (78) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/Command.js +22 -22
  4. package/dist/esm/components/Command.js.map +1 -1
  5. package/dist/esm/components/DataTable.js +215 -0
  6. package/dist/esm/components/DataTable.js.map +1 -0
  7. package/dist/esm/components/useDataTable.js +482 -0
  8. package/dist/esm/components/useDataTable.js.map +1 -0
  9. package/dist/esm/elements/ColorSwatch.js +49 -0
  10. package/dist/esm/elements/ColorSwatch.js.map +1 -0
  11. package/dist/esm/elements/RingProgress.js +3 -3
  12. package/dist/esm/elements/Td.js +4 -2
  13. package/dist/esm/elements/Td.js.map +1 -1
  14. package/dist/esm/elements/Th.js +13 -5
  15. package/dist/esm/elements/Th.js.map +1 -1
  16. package/dist/esm/elements/Tr.js.map +1 -1
  17. package/dist/esm/form/ColorPicker.js +540 -0
  18. package/dist/esm/form/ColorPicker.js.map +1 -0
  19. package/dist/esm/form/Combobox.js +18 -18
  20. package/dist/esm/form/Combobox.js.map +1 -1
  21. package/dist/esm/form/Dropzone.js +524 -0
  22. package/dist/esm/form/Dropzone.js.map +1 -0
  23. package/dist/esm/form/File.js.map +1 -1
  24. package/dist/esm/form/_colorInternals/colorMath.js +292 -0
  25. package/dist/esm/form/_colorInternals/colorMath.js.map +1 -0
  26. package/dist/esm/form/_colorInternals/pickerState.js +160 -0
  27. package/dist/esm/form/_colorInternals/pickerState.js.map +1 -0
  28. package/dist/esm/helpers/statusRegion.js +3 -3
  29. package/dist/esm/helpers/statusRegion.js.map +1 -1
  30. package/dist/esm/helpers/useFocusTrap.js +2 -2
  31. package/dist/extras.css +1 -1
  32. package/dist/extras.css.map +1 -1
  33. package/dist/index.cjs +2986 -796
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.esm.js +5 -0
  36. package/dist/index.esm.js.map +1 -1
  37. package/dist/types/components/DataTable.d.ts +120 -0
  38. package/dist/types/components/useDataTable.d.ts +445 -0
  39. package/dist/types/elements/ColorSwatch.d.ts +54 -0
  40. package/dist/types/elements/Td.d.ts +9 -1
  41. package/dist/types/elements/Th.d.ts +14 -2
  42. package/dist/types/elements/Tr.d.ts +10 -1
  43. package/dist/types/form/ColorPicker.d.ts +266 -0
  44. package/dist/types/form/Dropzone.d.ts +138 -0
  45. package/dist/types/form/File.d.ts +2 -0
  46. package/dist/types/form/_colorInternals/colorMath.d.ts +63 -0
  47. package/dist/types/form/_colorInternals/pickerState.d.ts +62 -0
  48. package/dist/types/index.d.ts +4 -0
  49. package/dist/types-cjs/components/DataTable.d.ts +120 -0
  50. package/dist/types-cjs/components/useDataTable.d.ts +445 -0
  51. package/dist/types-cjs/elements/ColorSwatch.d.ts +54 -0
  52. package/dist/types-cjs/elements/Td.d.ts +9 -1
  53. package/dist/types-cjs/elements/Th.d.ts +14 -2
  54. package/dist/types-cjs/elements/Tr.d.ts +10 -1
  55. package/dist/types-cjs/form/ColorPicker.d.ts +266 -0
  56. package/dist/types-cjs/form/Dropzone.d.ts +138 -0
  57. package/dist/types-cjs/form/File.d.ts +2 -0
  58. package/dist/types-cjs/form/_colorInternals/colorMath.d.ts +63 -0
  59. package/dist/types-cjs/form/_colorInternals/pickerState.d.ts +62 -0
  60. package/dist/types-cjs/index.d.ts +4 -0
  61. package/dist/versions/bestax-no-dark-mode.css +1 -1
  62. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  63. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  64. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  65. package/dist/versions/bestax-no-helpers.css +1 -1
  66. package/dist/versions/bestax-no-helpers.css.map +1 -1
  67. package/dist/versions/bestax-prefixed.css +1 -1
  68. package/dist/versions/bestax-prefixed.css.map +1 -1
  69. package/package.json +1 -1
  70. package/src/scss/components/_datatable.scss +152 -0
  71. package/src/scss/components/_index.scss +1 -0
  72. package/src/scss/elements/_colorswatch.scss +100 -0
  73. package/src/scss/elements/_index.scss +1 -0
  74. package/src/scss/form/_checkbox.scss +53 -0
  75. package/src/scss/form/_colorpicker.scss +354 -0
  76. package/src/scss/form/_dropzone.scss +233 -0
  77. package/src/scss/form/_file.scss +29 -1
  78. package/src/scss/form/_index.scss +2 -0
@@ -0,0 +1,233 @@
1
+ // Dropzone Component Styles
2
+ // Bulma's boxed, full-width File widget as a drop zone, its drag states, and
3
+ // the list of chosen files under it
4
+ // Follows Bulma v1 CSS variable convention (see _dialog.scss)
5
+
6
+ @use 'bulma/sass/utilities/initial-variables' as iv;
7
+ @use 'bulma/sass/utilities/css-variables' as cv;
8
+
9
+ // Dropzone-specific SCSS variables. The zone keeps Bulma's File tokens for
10
+ // its colours and sizes, and the list takes Bulma's scheme tokens, so dark
11
+ // mode follows them.
12
+ $dropzone-border-style: dashed !default;
13
+ $dropzone-border-width: 2px !default;
14
+ $dropzone-min-height: 8rem !default;
15
+ // The zone's border while files are dragged over it, and while every file
16
+ // dragged would be refused.
17
+ $dropzone-dragover-border-color: cv.getVar('primary') !default;
18
+ $dropzone-reject-border-color: cv.getVar('danger') !default;
19
+ $dropzone-disabled-opacity: 0.5 !default;
20
+ // Between the zone and the list or the refusals under it.
21
+ $dropzone-spacing: 0.5rem !default;
22
+ $dropzone-item-background: cv.getVar('scheme-main') !default;
23
+ $dropzone-item-border-color: cv.getVar('border') !default;
24
+ $dropzone-item-border-width: cv.getVar('control-border-width') !default;
25
+ $dropzone-item-radius: cv.getVar('radius') !default;
26
+ $dropzone-item-padding: 0.5em 0.75em !default;
27
+ $dropzone-item-gap: 0.75em !default;
28
+ // Between one row and the next.
29
+ $dropzone-item-spacing: 0.25rem !default;
30
+ $dropzone-name-color: cv.getVar('text-strong') !default;
31
+ $dropzone-size-color: cv.getVar('text-weak') !default;
32
+ $dropzone-size-font-size: cv.getVar('size-small') !default;
33
+
34
+ // Register CSS custom properties
35
+ .#{iv.$class-prefix}dropzone {
36
+ @include cv.register-vars(
37
+ (
38
+ 'dropzone-border-style': #{$dropzone-border-style},
39
+ 'dropzone-border-width': #{$dropzone-border-width},
40
+ 'dropzone-min-height': #{$dropzone-min-height},
41
+ 'dropzone-dragover-border-color': #{$dropzone-dragover-border-color},
42
+ 'dropzone-reject-border-color': #{$dropzone-reject-border-color},
43
+ 'dropzone-disabled-opacity': #{$dropzone-disabled-opacity},
44
+ 'dropzone-spacing': #{$dropzone-spacing},
45
+ 'dropzone-item-background': #{$dropzone-item-background},
46
+ 'dropzone-item-border-color': #{$dropzone-item-border-color},
47
+ 'dropzone-item-border-width': #{$dropzone-item-border-width},
48
+ 'dropzone-item-radius': #{$dropzone-item-radius},
49
+ 'dropzone-item-padding': #{$dropzone-item-padding},
50
+ 'dropzone-item-gap': #{$dropzone-item-gap},
51
+ 'dropzone-item-spacing': #{$dropzone-item-spacing},
52
+ 'dropzone-name-color': #{$dropzone-name-color},
53
+ 'dropzone-size-color': #{$dropzone-size-color},
54
+ 'dropzone-size-font-size': #{$dropzone-size-font-size},
55
+ )
56
+ );
57
+ }
58
+
59
+ .#{iv.$class-prefix}dropzone {
60
+ // The zone is the widget's first part, so Bulma's block spacing under a
61
+ // File gives way to the spacing of the parts below it.
62
+ .#{iv.$class-prefix}file.#{iv.$class-prefix}is-boxed {
63
+ margin-block-end: 0;
64
+ }
65
+
66
+ // Bulma lays the transparent input over the widget but paints the CTA over
67
+ // it, and a browser hands a dropped file only to a file input under the
68
+ // pointer. Lifting the input puts it on top, where it takes the drop, the
69
+ // click and the pointer cursor Bulma gives the label. The label isolates
70
+ // the lift, so the input never rises above anything else on the page.
71
+ .#{iv.$class-prefix}file-label {
72
+ isolation: isolate;
73
+ }
74
+
75
+ .#{iv.$class-prefix}file-input {
76
+ cursor: pointer;
77
+ z-index: 1;
78
+
79
+ &::file-selector-button {
80
+ cursor: pointer;
81
+ }
82
+
83
+ &:disabled,
84
+ &:disabled::file-selector-button {
85
+ cursor: not-allowed;
86
+ }
87
+ }
88
+
89
+ // A dashed box, tall enough to aim a drop at, with its text centred and
90
+ // free to wrap.
91
+ .#{iv.$class-prefix}file-cta {
92
+ border-style: cv.getVar('dropzone-border-style');
93
+ border-width: cv.getVar('dropzone-border-width');
94
+ justify-content: center;
95
+ min-height: cv.getVar('dropzone-min-height');
96
+ text-align: center;
97
+ white-space: normal;
98
+ }
99
+
100
+ // While files are dragged over it the zone takes File's hover look, which
101
+ // a drag doesn't trigger, and a solid border, which shows the state in
102
+ // forced colours too.
103
+ &.#{iv.$class-prefix}is-dragover,
104
+ &.#{iv.$class-prefix}is-drag-reject {
105
+ .#{iv.$class-prefix}file-label {
106
+ @include cv.register-vars(
107
+ (
108
+ 'file-background-l-delta': #{cv.getVar(
109
+ 'file-hover-background-l-delta'
110
+ )},
111
+ 'file-border-l-delta': #{cv.getVar('file-hover-border-l-delta')},
112
+ 'file-color-l-delta': #{cv.getVar('file-hover-color-l-delta')},
113
+ )
114
+ );
115
+ }
116
+
117
+ .#{iv.$class-prefix}file-cta {
118
+ border-style: solid;
119
+ }
120
+ }
121
+
122
+ &.#{iv.$class-prefix}is-dragover .#{iv.$class-prefix}file-cta {
123
+ border-color: cv.getVar('dropzone-dragover-border-color');
124
+ }
125
+
126
+ &.#{iv.$class-prefix}is-drag-reject .#{iv.$class-prefix}file-cta {
127
+ border-color: cv.getVar('dropzone-reject-border-color');
128
+ }
129
+
130
+ // Disabled: dimmed, as Bulma dims a disabled button, with no hover look.
131
+ &.#{iv.$class-prefix}is-disabled {
132
+ .#{iv.$class-prefix}file {
133
+ opacity: cv.getVar('dropzone-disabled-opacity');
134
+ }
135
+
136
+ .#{iv.$class-prefix}file-label {
137
+ @include cv.register-vars(
138
+ (
139
+ 'file-background-l-delta': 0%,
140
+ 'file-border-l-delta': 0%,
141
+ 'file-color-l-delta': 0%,
142
+ )
143
+ );
144
+ }
145
+ }
146
+ }
147
+
148
+ // Forced colours replaces the border colours, so the drop target takes the
149
+ // system's highlight colour, and a zone that would refuse the files the
150
+ // text colour.
151
+ @media (forced-colors: active) {
152
+ .#{iv.$class-prefix}dropzone.#{iv.$class-prefix}is-dragover
153
+ .#{iv.$class-prefix}file-cta {
154
+ border-color: Highlight;
155
+ }
156
+
157
+ .#{iv.$class-prefix}dropzone.#{iv.$class-prefix}is-drag-reject
158
+ .#{iv.$class-prefix}file-cta {
159
+ border-color: CanvasText;
160
+ }
161
+ }
162
+
163
+ // The chosen files, a bordered row each, and the refusals.
164
+ .#{iv.$class-prefix}dropzone-list,
165
+ .#{iv.$class-prefix}dropzone-rejections {
166
+ margin-block-start: cv.getVar('dropzone-spacing');
167
+ }
168
+
169
+ .#{iv.$class-prefix}dropzone-item {
170
+ align-items: center;
171
+ background-color: cv.getVar('dropzone-item-background');
172
+ border: cv.getVar('dropzone-item-border-width') solid
173
+ cv.getVar('dropzone-item-border-color');
174
+ border-radius: cv.getVar('dropzone-item-radius');
175
+ display: flex;
176
+ gap: cv.getVar('dropzone-item-gap');
177
+ padding: cv.getVar('dropzone-item-padding');
178
+
179
+ & + & {
180
+ margin-block-start: cv.getVar('dropzone-item-spacing');
181
+ }
182
+ }
183
+
184
+ // A long name is cut short with an ellipsis, so the size and the remove
185
+ // button stay on the row.
186
+ .#{iv.$class-prefix}dropzone-name {
187
+ color: cv.getVar('dropzone-name-color');
188
+ flex: 1 1 auto;
189
+ min-width: 0;
190
+ overflow: hidden;
191
+ text-overflow: ellipsis;
192
+ white-space: nowrap;
193
+ }
194
+
195
+ .#{iv.$class-prefix}dropzone-size {
196
+ color: cv.getVar('dropzone-size-color');
197
+ flex: none;
198
+ font-size: cv.getVar('dropzone-size-font-size');
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
+ }
@@ -1,9 +1,37 @@
1
1
  // File Component Styles
2
- // Bulma already styles the file input; this adds its keyboard focus ring
2
+ // Bulma already styles the file input; this lets a dropped file reach it and
3
+ // adds its keyboard focus ring
3
4
 
4
5
  @use "bulma/sass/utilities/initial-variables" as iv;
5
6
  @use "bulma/sass/utilities/css-variables" as cv;
6
7
 
8
+ // Bulma lays the transparent <input> over the whole widget, but its CTA and
9
+ // name are positioned too and come after it, so they paint over it. A
10
+ // browser hands a dropped file only to a file input under the pointer, so a
11
+ // drop on them did nothing. Lifting the input puts it on top, where it takes
12
+ // the drop the way a plain file input does. The label isolates the lift, so
13
+ // the input rises above the CTA and name only, never above something else on
14
+ // the page that overlaps the widget. The input then also takes the pointer,
15
+ // so it carries the pointer cursor Bulma gives the label, and so does the
16
+ // button inside it, which browsers give a cursor of its own. That button is
17
+ // stretched over the whole input too: in a shadow root, Chromium hands a
18
+ // file input a drop only over its button, not over the "No file chosen"
19
+ // beside it. The input is transparent, so none of this shows.
20
+ .#{iv.$class-prefix}file-label {
21
+ isolation: isolate;
22
+ }
23
+
24
+ .#{iv.$class-prefix}file-input {
25
+ cursor: pointer;
26
+ z-index: 1;
27
+
28
+ &::file-selector-button {
29
+ cursor: pointer;
30
+ height: 100%;
31
+ width: 100%;
32
+ }
33
+ }
34
+
7
35
  // Keyboard focus ring for File. The focusable element is the <input>, which
8
36
  // Bulma lays transparent over the whole widget, so the ring goes on the CTA
9
37
  // you see instead. The .file-label around them hides its overflow, which
@@ -20,4 +20,6 @@
20
20
  @use 'datetimeinput';
21
21
  @use 'daterangeinput';
22
22
  @use 'file';
23
+ @use 'dropzone';
24
+ @use 'colorpicker';
23
25
  @use 'fieldset';