@allxsmith/bestax-bulma 5.22.0 → 5.24.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 (52) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/extras.css +1 -1
  4. package/dist/extras.css.map +1 -1
  5. package/dist/index.cjs +1769 -562
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.esm.js +1764 -564
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/types/components/Popover.d.ts +166 -0
  10. package/dist/types/form/DateInput.d.ts +1 -1
  11. package/dist/types/form/DateInputBase.d.ts +33 -3
  12. package/dist/types/form/_pickerInternals/Calendar.d.ts +11 -1
  13. package/dist/types/form/_pickerInternals/dateUtils.d.ts +36 -1
  14. package/dist/types/form/_pickerInternals/formatters.d.ts +2 -0
  15. package/dist/types/form/_pickerInternals/nativeInputSupport.d.ts +11 -0
  16. package/dist/types/form/_pickerInternals/pickerTypes.d.ts +10 -0
  17. package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +9 -1
  18. package/dist/types/helpers/portal.d.ts +62 -0
  19. package/dist/types/helpers/shadowDom.d.ts +3 -1
  20. package/dist/types/helpers/useAnchoredPosition.d.ts +59 -0
  21. package/dist/types/helpers/useClientLayoutEffect.d.ts +7 -0
  22. package/dist/types/helpers/useFocusTrap.d.ts +84 -0
  23. package/dist/types/index.d.ts +5 -0
  24. package/dist/types-cjs/components/Popover.d.ts +166 -0
  25. package/dist/types-cjs/form/DateInput.d.ts +1 -1
  26. package/dist/types-cjs/form/DateInputBase.d.ts +33 -3
  27. package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +11 -1
  28. package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +36 -1
  29. package/dist/types-cjs/form/_pickerInternals/formatters.d.ts +2 -0
  30. package/dist/types-cjs/form/_pickerInternals/nativeInputSupport.d.ts +11 -0
  31. package/dist/types-cjs/form/_pickerInternals/pickerTypes.d.ts +10 -0
  32. package/dist/types-cjs/form/_pickerInternals/useSegmentedEntry.d.ts +9 -1
  33. package/dist/types-cjs/helpers/portal.d.ts +62 -0
  34. package/dist/types-cjs/helpers/shadowDom.d.ts +3 -1
  35. package/dist/types-cjs/helpers/useAnchoredPosition.d.ts +59 -0
  36. package/dist/types-cjs/helpers/useClientLayoutEffect.d.ts +7 -0
  37. package/dist/types-cjs/helpers/useFocusTrap.d.ts +84 -0
  38. package/dist/types-cjs/index.d.ts +5 -0
  39. package/dist/versions/bestax-no-dark-mode.css +1 -1
  40. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  41. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  42. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  43. package/dist/versions/bestax-no-helpers.css +1 -1
  44. package/dist/versions/bestax-no-helpers.css.map +1 -1
  45. package/dist/versions/bestax-prefixed.css +1 -1
  46. package/dist/versions/bestax-prefixed.css.map +1 -1
  47. package/package.json +1 -1
  48. package/src/scss/components/_index.scss +1 -0
  49. package/src/scss/components/_popover.scss +144 -0
  50. package/src/scss/form/_dateinput.scss +20 -3
  51. package/dist/types/form/_pickerInternals/useFocusTrap.d.ts +0 -7
  52. package/dist/types-cjs/form/_pickerInternals/useFocusTrap.d.ts +0 -7
@@ -0,0 +1,144 @@
1
+ // Popover Component Styles
2
+ // A click-to-open panel of interactive content, anchored to its trigger
3
+
4
+ @use 'bulma/sass/utilities/initial-variables' as iv;
5
+ @use 'bulma/sass/utilities/css-variables' as cv;
6
+
7
+ // Popover-specific SCSS variables
8
+ $popover-z-index: 30 !default;
9
+ $popover-background: cv.getVar('scheme-main') !default;
10
+ $popover-color: cv.getVar('text') !default;
11
+ $popover-border-color: cv.getVar('border-weak') !default;
12
+ $popover-radius: cv.getVar('radius-large') !default;
13
+ $popover-shadow: cv.getVar('shadow') !default;
14
+ $popover-min-width: 12rem !default;
15
+ $popover-max-width: min(24rem, calc(100vw - 2rem)) !default;
16
+ $popover-offset: 0.25rem !default;
17
+ $popover-header-padding: 0.75rem 1rem !default;
18
+ $popover-header-color: cv.getVar('text-strong') !default;
19
+ $popover-header-weight: cv.getVar('weight-semibold') !default;
20
+ $popover-body-padding: 1rem !default;
21
+ $popover-footer-padding: 0.75rem 1rem !default;
22
+ $popover-footer-gap: 0.5rem !default;
23
+ $popover-animation-duration: 0.15s !default;
24
+
25
+ // Registered on the panel rather than the wrapper: a panel rendered with
26
+ // `appendToBody` sits at the end of <body>, outside the wrapper, and would
27
+ // inherit nothing from it.
28
+ .#{iv.$class-prefix}popover-content {
29
+ @include cv.register-vars(
30
+ (
31
+ 'popover-z-index': #{$popover-z-index},
32
+ 'popover-background': #{$popover-background},
33
+ 'popover-color': #{$popover-color},
34
+ 'popover-border-color': #{$popover-border-color},
35
+ 'popover-radius': #{$popover-radius},
36
+ 'popover-shadow': #{$popover-shadow},
37
+ 'popover-min-width': #{$popover-min-width},
38
+ 'popover-max-width': #{$popover-max-width},
39
+ 'popover-offset': #{$popover-offset},
40
+ 'popover-header-padding': #{$popover-header-padding},
41
+ 'popover-header-color': #{$popover-header-color},
42
+ 'popover-header-weight': #{$popover-header-weight},
43
+ 'popover-body-padding': #{$popover-body-padding},
44
+ 'popover-footer-padding': #{$popover-footer-padding},
45
+ 'popover-footer-gap': #{$popover-footer-gap},
46
+ 'popover-animation-duration': #{$popover-animation-duration},
47
+ )
48
+ );
49
+ }
50
+
51
+ // The wrapper around the trigger, which an inline panel is placed against.
52
+ .#{iv.$class-prefix}popover {
53
+ position: relative;
54
+ display: inline-flex;
55
+ vertical-align: top;
56
+ }
57
+
58
+ .#{iv.$class-prefix}popover-content {
59
+ position: absolute;
60
+ z-index: cv.getVar('popover-z-index');
61
+ // As wide as the content wants, within the bounds. An inline panel would
62
+ // otherwise shrink to the trigger's width, and a portaled one wouldn't.
63
+ width: max-content;
64
+ min-width: cv.getVar('popover-min-width');
65
+ max-width: cv.getVar('popover-max-width');
66
+ background-color: cv.getVar('popover-background');
67
+ color: cv.getVar('popover-color');
68
+ border: 1px solid cv.getVar('popover-border-color');
69
+ border-radius: cv.getVar('popover-radius');
70
+ box-shadow: cv.getVar('popover-shadow');
71
+ text-align: start;
72
+ // The panel takes focus itself only when it holds no control.
73
+ outline: none;
74
+ animation: popover-fade-in cv.getVar('popover-animation-duration') ease;
75
+
76
+ &.#{iv.$class-prefix}is-bottom-left,
77
+ &.#{iv.$class-prefix}is-bottom-right {
78
+ top: 100%;
79
+ margin-top: cv.getVar('popover-offset');
80
+ }
81
+ &.#{iv.$class-prefix}is-top-left,
82
+ &.#{iv.$class-prefix}is-top-right {
83
+ bottom: 100%;
84
+ margin-bottom: cv.getVar('popover-offset');
85
+ }
86
+ &.#{iv.$class-prefix}is-bottom-left,
87
+ &.#{iv.$class-prefix}is-top-left {
88
+ left: 0;
89
+ }
90
+ &.#{iv.$class-prefix}is-bottom-right,
91
+ &.#{iv.$class-prefix}is-top-right {
92
+ right: 0;
93
+ }
94
+
95
+ // Portaled: fixed to the viewport at the trigger's edge, which the
96
+ // component sets inline, so only the gap comes from here.
97
+ &.#{iv.$class-prefix}is-portal {
98
+ position: fixed;
99
+ right: auto;
100
+ bottom: auto;
101
+
102
+ &.#{iv.$class-prefix}is-top-left,
103
+ &.#{iv.$class-prefix}is-top-right {
104
+ margin-top: calc(-1 * #{cv.getVar('popover-offset')});
105
+ margin-bottom: 0;
106
+ }
107
+ }
108
+ }
109
+
110
+ .#{iv.$class-prefix}popover-header {
111
+ padding: cv.getVar('popover-header-padding');
112
+ color: cv.getVar('popover-header-color');
113
+ font-weight: cv.getVar('popover-header-weight');
114
+ border-bottom: 1px solid cv.getVar('popover-border-color');
115
+ }
116
+
117
+ .#{iv.$class-prefix}popover-body {
118
+ padding: cv.getVar('popover-body-padding');
119
+ }
120
+
121
+ .#{iv.$class-prefix}popover-footer {
122
+ display: flex;
123
+ justify-content: flex-end;
124
+ gap: cv.getVar('popover-footer-gap');
125
+ padding: cv.getVar('popover-footer-padding');
126
+ border-top: 1px solid cv.getVar('popover-border-color');
127
+ }
128
+
129
+ @keyframes popover-fade-in {
130
+ from {
131
+ opacity: 0;
132
+ transform: translateY(-2px);
133
+ }
134
+ to {
135
+ opacity: 1;
136
+ transform: translateY(0);
137
+ }
138
+ }
139
+
140
+ @media (prefers-reduced-motion: reduce) {
141
+ .#{iv.$class-prefix}popover-content {
142
+ animation: none;
143
+ }
144
+ }
@@ -227,7 +227,23 @@ $dateinput-nav-button-size: 1.75rem !default;
227
227
  padding: 0.25rem 0;
228
228
  }
229
229
 
230
- .#{iv.$class-prefix}dateinput-year-cell {
230
+ // The month picker's grid: the focused year's months in rows of three. Each
231
+ // row is a grid of its own so the rows can carry `role="row"`.
232
+ .#{iv.$class-prefix}dateinput-months-grid {
233
+ display: grid;
234
+ gap: 0.4rem;
235
+ padding: 0.25rem 0;
236
+ }
237
+
238
+ .#{iv.$class-prefix}dateinput-months-row {
239
+ display: grid;
240
+ grid-template-columns: repeat(3, 1fr);
241
+ gap: 0.4rem;
242
+ }
243
+
244
+ // Year and month cells share a look: one cell high, filling their column.
245
+ .#{iv.$class-prefix}dateinput-year-cell,
246
+ .#{iv.$class-prefix}dateinput-month-cell {
231
247
  display: inline-flex;
232
248
  align-items: center;
233
249
  justify-content: center;
@@ -264,11 +280,12 @@ $dateinput-nav-button-size: 1.75rem !default;
264
280
  background-color: cv.getVar('dateinput-cell-selected-bg');
265
281
  color: cv.getVar('dateinput-cell-selected-color');
266
282
  }
267
- // The focused year is always the selected one, so this is the ring a
268
- // keyboard user sees in the year view; it contrasts with the fill as above.
283
+ // On a selected cell the ring sits on the fill, so it takes the selected
284
+ // value's colour, which contrasts with that fill.
269
285
  &.#{iv.$class-prefix}is-selected:focus-visible {
270
286
  outline-color: cv.getVar('dateinput-cell-selected-color');
271
287
  }
288
+ &.#{iv.$class-prefix}is-disabled,
272
289
  &:disabled {
273
290
  color: cv.getVar('dateinput-cell-disabled-color');
274
291
  cursor: not-allowed;
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- interface UseFocusTrapOptions {
3
- initialFocusRef?: React.RefObject<HTMLElement | null>;
4
- restoreFocus?: boolean;
5
- }
6
- export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement | null>, active: boolean, options?: UseFocusTrapOptions): void;
7
- export {};
@@ -1,7 +0,0 @@
1
- import * as React from 'react';
2
- interface UseFocusTrapOptions {
3
- initialFocusRef?: React.RefObject<HTMLElement | null>;
4
- restoreFocus?: boolean;
5
- }
6
- export declare function useFocusTrap(containerRef: React.RefObject<HTMLElement | null>, active: boolean, options?: UseFocusTrapOptions): void;
7
- export {};