@allxsmith/bestax-bulma 5.55.0 → 5.56.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 (48) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/components/DataTable.js.map +1 -1
  4. package/dist/esm/components/useDataTable.js +27 -0
  5. package/dist/esm/components/useDataTable.js.map +1 -1
  6. package/dist/esm/form/ColorInput.js +68 -0
  7. package/dist/esm/form/ColorInput.js.map +1 -0
  8. package/dist/esm/form/ColorInputBase.js +198 -0
  9. package/dist/esm/form/ColorInputBase.js.map +1 -0
  10. package/dist/esm/form/ColorPicker.js +4 -20
  11. package/dist/esm/form/ColorPicker.js.map +1 -1
  12. package/dist/esm/form/_colorInternals/EyeDropperButton.js +40 -0
  13. package/dist/esm/form/_colorInternals/EyeDropperButton.js.map +1 -0
  14. package/dist/esm/form/_colorInternals/pickerState.js +4 -4
  15. package/dist/esm/form/_colorInternals/pickerState.js.map +1 -1
  16. package/dist/extras.css +1 -1
  17. package/dist/extras.css.map +1 -1
  18. package/dist/index.cjs +300 -22
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.esm.js +2 -0
  21. package/dist/index.esm.js.map +1 -1
  22. package/dist/types/components/DataTable.d.ts +1 -1
  23. package/dist/types/components/useDataTable.d.ts +36 -0
  24. package/dist/types/form/ColorInput.d.ts +76 -0
  25. package/dist/types/form/ColorInputBase.d.ts +108 -0
  26. package/dist/types/form/ColorPicker.d.ts +5 -0
  27. package/dist/types/form/_colorInternals/EyeDropperButton.d.ts +8 -0
  28. package/dist/types/form/_colorInternals/pickerState.d.ts +7 -1
  29. package/dist/types/index.d.ts +4 -0
  30. package/dist/types-cjs/components/DataTable.d.ts +1 -1
  31. package/dist/types-cjs/components/useDataTable.d.ts +36 -0
  32. package/dist/types-cjs/form/ColorInput.d.ts +76 -0
  33. package/dist/types-cjs/form/ColorInputBase.d.ts +108 -0
  34. package/dist/types-cjs/form/ColorPicker.d.ts +5 -0
  35. package/dist/types-cjs/form/_colorInternals/EyeDropperButton.d.ts +8 -0
  36. package/dist/types-cjs/form/_colorInternals/pickerState.d.ts +7 -1
  37. package/dist/types-cjs/index.d.ts +4 -0
  38. package/dist/versions/bestax-no-dark-mode.css +1 -1
  39. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  40. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  41. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  42. package/dist/versions/bestax-no-helpers.css +1 -1
  43. package/dist/versions/bestax-no-helpers.css.map +1 -1
  44. package/dist/versions/bestax-prefixed.css +1 -1
  45. package/dist/versions/bestax-prefixed.css.map +1 -1
  46. package/package.json +1 -1
  47. package/src/scss/form/_colorinput.scss +109 -0
  48. package/src/scss/form/_index.scss +1 -0
@@ -0,0 +1,109 @@
1
+ // Bestax Extras - ColorInput Styles
2
+ // A text field for a color, with its swatch at the start and a launcher at
3
+ // the end, which opens a color picker in the pickers' popover. Bulma has no
4
+ // color field.
5
+ //
6
+ // The swatch and the launcher are real buttons laid over the input, the way
7
+ // the date pickers' launcher is, since Bulma's Control icons take no clicks.
8
+ // Both sit on the logical sides, so they swap places right to left. The panel
9
+ // is a `.color-picker`, styled by `_colorpicker.scss`, in a
10
+ // `.picker-popover`.
11
+
12
+ @use 'bulma/sass/utilities/initial-variables' as iv;
13
+ @use 'bulma/sass/utilities/css-variables' as cv;
14
+ @use '../mixins' as *;
15
+
16
+ // Each side's room, in em so it tracks the input's size, as Bulma's icon
17
+ // slots do.
18
+ $colorinput-side-width: 2.5em !default;
19
+ $colorinput-swatch-size: 1.25em !default;
20
+ $colorinput-trigger-color: cv.getVar('text') !default;
21
+ $colorinput-trigger-hover-color: cv.getVar('text-strong') !default;
22
+ $colorinput-disabled-opacity: 0.5 !default;
23
+
24
+ .#{iv.$class-prefix}colorinput {
25
+ @include cv.register-vars(
26
+ (
27
+ 'colorinput-side-width': #{$colorinput-side-width},
28
+ 'colorinput-swatch-size': #{$colorinput-swatch-size},
29
+ 'colorinput-trigger-color': #{$colorinput-trigger-color},
30
+ 'colorinput-trigger-hover-color': #{$colorinput-trigger-hover-color},
31
+ 'colorinput-disabled-opacity': #{$colorinput-disabled-opacity},
32
+ )
33
+ );
34
+ }
35
+
36
+ .#{iv.$class-prefix}colorinput {
37
+ position: relative;
38
+
39
+ // Room for the swatch, and for the launcher when it shows, so typed text
40
+ // doesn't slide under either. Bulma gives a rounded input its own side
41
+ // padding at two classes, so each rule here reaches it at three, which
42
+ // wins in whichever order the stylesheets load.
43
+ > .#{iv.$class-prefix}input,
44
+ > .#{iv.$class-prefix}input.#{iv.$class-prefix}is-rounded {
45
+ padding-inline-start: cv.getVar('colorinput-side-width');
46
+ }
47
+
48
+ &.#{iv.$class-prefix}has-trigger > .#{iv.$class-prefix}input {
49
+ padding-inline-end: cv.getVar('colorinput-side-width');
50
+ }
51
+
52
+ > .#{iv.$class-prefix}colorinput-swatch,
53
+ > .#{iv.$class-prefix}colorinput-trigger {
54
+ @include extras-button-reset;
55
+ position: absolute;
56
+ inset-block: 0;
57
+ z-index: 4;
58
+ display: inline-flex;
59
+ align-items: center;
60
+ justify-content: center;
61
+ inline-size: cv.getVar('colorinput-side-width');
62
+
63
+ &:disabled {
64
+ cursor: not-allowed;
65
+ opacity: cv.getVar('colorinput-disabled-opacity');
66
+ }
67
+ }
68
+
69
+ > .#{iv.$class-prefix}colorinput-swatch {
70
+ inset-inline-start: 0;
71
+
72
+ .#{iv.$class-prefix}color-swatch {
73
+ inline-size: cv.getVar('colorinput-swatch-size');
74
+ block-size: cv.getVar('colorinput-swatch-size');
75
+ }
76
+ }
77
+
78
+ > .#{iv.$class-prefix}colorinput-trigger {
79
+ inset-inline-end: 0;
80
+ color: cv.getVar('colorinput-trigger-color');
81
+
82
+ &:hover:not(:disabled) {
83
+ color: cv.getVar('colorinput-trigger-hover-color');
84
+ }
85
+
86
+ &:focus-visible {
87
+ @include extras-focus-outline;
88
+ }
89
+
90
+ .#{iv.$class-prefix}icon {
91
+ pointer-events: none;
92
+ }
93
+ }
94
+
95
+ // The sides track the input's size, as Bulma's icons do.
96
+ @each $size in 'small', 'medium', 'large' {
97
+ > .#{iv.$class-prefix}input.#{iv.$class-prefix}is-#{$size}
98
+ ~ .#{iv.$class-prefix}colorinput-swatch,
99
+ > .#{iv.$class-prefix}input.#{iv.$class-prefix}is-#{$size}
100
+ ~ .#{iv.$class-prefix}colorinput-trigger {
101
+ font-size: cv.getVar('size-#{$size}');
102
+ }
103
+ }
104
+ }
105
+
106
+ // The eye dropper sits at the end of the panel.
107
+ .#{iv.$class-prefix}colorinput-eyedropper {
108
+ align-self: flex-end;
109
+ }
@@ -22,4 +22,5 @@
22
22
  @use 'file';
23
23
  @use 'dropzone';
24
24
  @use 'colorpicker';
25
+ @use 'colorinput';
25
26
  @use 'fieldset';