@allxsmith/bestax-bulma 5.51.0 → 5.53.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.
- package/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/Command.js +637 -0
- package/dist/esm/components/Command.js.map +1 -0
- package/dist/esm/components/Modal.js +2 -1
- package/dist/esm/components/Modal.js.map +1 -1
- package/dist/esm/components/Sidebar.js +3 -1
- package/dist/esm/components/Sidebar.js.map +1 -1
- package/dist/esm/components/Toast.js +8 -5
- package/dist/esm/components/Toast.js.map +1 -1
- package/dist/esm/elements/Notification.js +4 -2
- package/dist/esm/elements/Notification.js.map +1 -1
- package/dist/esm/form/Autocomplete.js +5 -4
- package/dist/esm/form/Autocomplete.js.map +1 -1
- package/dist/esm/form/Checkbox.js +3 -2
- package/dist/esm/form/Checkbox.js.map +1 -1
- package/dist/esm/form/CheckboxCard.js +119 -0
- package/dist/esm/form/CheckboxCard.js.map +1 -0
- package/dist/esm/form/Checkboxes.js +14 -3
- package/dist/esm/form/Checkboxes.js.map +1 -1
- package/dist/esm/form/Combobox.js +3 -2
- package/dist/esm/form/Combobox.js.map +1 -1
- package/dist/esm/form/DateInputBase.js +15 -6
- package/dist/esm/form/DateInputBase.js.map +1 -1
- package/dist/esm/form/DateRangeInputBase.js +15 -5
- package/dist/esm/form/DateRangeInputBase.js.map +1 -1
- package/dist/esm/form/DateTimeInputBase.js +15 -6
- package/dist/esm/form/DateTimeInputBase.js.map +1 -1
- package/dist/esm/form/Fieldset.js +64 -0
- package/dist/esm/form/Fieldset.js.map +1 -0
- package/dist/esm/form/FormContext.js +17 -1
- package/dist/esm/form/FormContext.js.map +1 -1
- package/dist/esm/form/InputBase.js +3 -2
- package/dist/esm/form/InputBase.js.map +1 -1
- package/dist/esm/form/Numberinput.js +3 -2
- package/dist/esm/form/Numberinput.js.map +1 -1
- package/dist/esm/form/PinInput.js +3 -2
- package/dist/esm/form/PinInput.js.map +1 -1
- package/dist/esm/form/Radio.js +3 -2
- package/dist/esm/form/Radio.js.map +1 -1
- package/dist/esm/form/RadioCard.js +86 -0
- package/dist/esm/form/RadioCard.js.map +1 -0
- package/dist/esm/form/Radios.js +14 -3
- package/dist/esm/form/Radios.js.map +1 -1
- package/dist/esm/form/Rate.js +3 -2
- package/dist/esm/form/Rate.js.map +1 -1
- package/dist/esm/form/SelectBase.js +3 -2
- package/dist/esm/form/SelectBase.js.map +1 -1
- package/dist/esm/form/Slider.js +3 -2
- package/dist/esm/form/Slider.js.map +1 -1
- package/dist/esm/form/Switch.js +3 -1
- package/dist/esm/form/Switch.js.map +1 -1
- package/dist/esm/form/Taginput.js +3 -2
- package/dist/esm/form/Taginput.js.map +1 -1
- package/dist/esm/form/TextAreaBase.js +3 -2
- package/dist/esm/form/TextAreaBase.js.map +1 -1
- package/dist/esm/form/TimeInputBase.js +13 -6
- package/dist/esm/form/TimeInputBase.js.map +1 -1
- package/dist/esm/form/_pickerInternals/PickerPopover.js +4 -2
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
- package/dist/esm/form/_pickerInternals/useLocaleDefaults.js +80 -0
- package/dist/esm/form/_pickerInternals/useLocaleDefaults.js.map +1 -0
- package/dist/esm/form/groupFieldset.js +38 -0
- package/dist/esm/form/groupFieldset.js.map +1 -0
- package/dist/esm/form/useAutoLabelId.js +1 -1
- package/dist/esm/helpers/LocaleProvider.js +153 -0
- package/dist/esm/helpers/LocaleProvider.js.map +1 -0
- package/dist/esm/helpers/localeInfo.js +109 -0
- package/dist/esm/helpers/localeInfo.js.map +1 -0
- package/dist/esm/helpers/portal.js +14 -1
- package/dist/esm/helpers/portal.js.map +1 -1
- package/dist/esm/helpers/useComboboxEngine.js +3 -3
- package/dist/esm/helpers/useFocusTrap.js +2 -2
- package/dist/esm/helpers/useFocusTrap.js.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +4905 -3584
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +5 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Command.d.ts +318 -0
- package/dist/types/form/CheckboxCard.d.ts +94 -0
- package/dist/types/form/Checkboxes.d.ts +13 -0
- package/dist/types/form/DateInputBase.d.ts +25 -3
- package/dist/types/form/DateRangeInputBase.d.ts +25 -3
- package/dist/types/form/DateTimeInputBase.d.ts +25 -3
- package/dist/types/form/Fieldset.d.ts +86 -0
- package/dist/types/form/FormContext.d.ts +12 -0
- package/dist/types/form/RadioCard.d.ts +81 -0
- package/dist/types/form/Radios.d.ts +13 -0
- package/dist/types/form/TimeInputBase.d.ts +5 -1
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +6 -0
- package/dist/types/form/_pickerInternals/useLocaleDefaults.d.ts +49 -0
- package/dist/types/form/groupFieldset.d.ts +32 -0
- package/dist/types/helpers/LocaleProvider.d.ts +128 -0
- package/dist/types/helpers/localeInfo.d.ts +23 -0
- package/dist/types/helpers/portal.d.ts +11 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types-cjs/components/Command.d.ts +318 -0
- package/dist/types-cjs/form/CheckboxCard.d.ts +94 -0
- package/dist/types-cjs/form/Checkboxes.d.ts +13 -0
- package/dist/types-cjs/form/DateInputBase.d.ts +25 -3
- package/dist/types-cjs/form/DateRangeInputBase.d.ts +25 -3
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +25 -3
- package/dist/types-cjs/form/Fieldset.d.ts +86 -0
- package/dist/types-cjs/form/FormContext.d.ts +12 -0
- package/dist/types-cjs/form/RadioCard.d.ts +81 -0
- package/dist/types-cjs/form/Radios.d.ts +13 -0
- package/dist/types-cjs/form/TimeInputBase.d.ts +5 -1
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +6 -0
- package/dist/types-cjs/form/_pickerInternals/useLocaleDefaults.d.ts +49 -0
- package/dist/types-cjs/form/groupFieldset.d.ts +32 -0
- package/dist/types-cjs/helpers/LocaleProvider.d.ts +128 -0
- package/dist/types-cjs/helpers/localeInfo.d.ts +23 -0
- package/dist/types-cjs/helpers/portal.d.ts +11 -0
- package/dist/types-cjs/index.d.ts +6 -0
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/components/_command.scss +259 -0
- package/src/scss/components/_index.scss +1 -0
- package/src/scss/form/_checkbox.scss +44 -0
- package/src/scss/form/_checkboxcard.scss +355 -0
- package/src/scss/form/_fieldset.scss +108 -0
- package/src/scss/form/_index.scss +3 -0
- package/src/scss/form/_radio.scss +44 -0
- package/src/scss/form/_radiocard.scss +291 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// Fieldset Component Styles
|
|
2
|
+
// A native <fieldset> and <legend>: bordered, filled, or unstyled
|
|
3
|
+
// Follows Bulma v1 CSS variable convention (see _dialog.scss)
|
|
4
|
+
|
|
5
|
+
@use "bulma/sass/utilities/initial-variables" as iv;
|
|
6
|
+
@use "bulma/sass/utilities/css-variables" as cv;
|
|
7
|
+
|
|
8
|
+
// Fieldset-specific SCSS variables. The surfaces and the border come from
|
|
9
|
+
// Bulma's scheme tokens, so dark mode follows them.
|
|
10
|
+
$fieldset-background: cv.getVar("scheme-main") !default;
|
|
11
|
+
$fieldset-filled-background: cv.getVar("background") !default;
|
|
12
|
+
$fieldset-border-color: cv.getVar("border") !default;
|
|
13
|
+
$fieldset-border-width: 1px !default;
|
|
14
|
+
$fieldset-radius: cv.getVar("radius-large") !default;
|
|
15
|
+
$fieldset-padding: 1.25rem !default;
|
|
16
|
+
// Below the legend, which already takes room above the content.
|
|
17
|
+
$fieldset-padding-top: 0.75rem !default;
|
|
18
|
+
$fieldset-spacing: cv.getVar("block-spacing") !default;
|
|
19
|
+
// The legend takes Bulma's label look.
|
|
20
|
+
$fieldset-legend-color: cv.getVar("label-color") !default;
|
|
21
|
+
$fieldset-legend-size: cv.getVar("size-normal") !default;
|
|
22
|
+
$fieldset-legend-weight: cv.getVar("label-weight") !default;
|
|
23
|
+
// Room either side of the legend where it breaks the border.
|
|
24
|
+
$fieldset-legend-padding: 0.5em !default;
|
|
25
|
+
// Below an unstyled Fieldset's legend, as below a label.
|
|
26
|
+
$fieldset-legend-spacing: cv.getVar("label-spacing") !default;
|
|
27
|
+
|
|
28
|
+
// Register CSS custom properties
|
|
29
|
+
.#{iv.$class-prefix}fieldset {
|
|
30
|
+
@include cv.register-vars(
|
|
31
|
+
(
|
|
32
|
+
"fieldset-background": #{$fieldset-background},
|
|
33
|
+
"fieldset-filled-background": #{$fieldset-filled-background},
|
|
34
|
+
"fieldset-border-color": #{$fieldset-border-color},
|
|
35
|
+
"fieldset-border-width": #{$fieldset-border-width},
|
|
36
|
+
"fieldset-radius": #{$fieldset-radius},
|
|
37
|
+
"fieldset-padding": #{$fieldset-padding},
|
|
38
|
+
"fieldset-padding-top": #{$fieldset-padding-top},
|
|
39
|
+
"fieldset-spacing": #{$fieldset-spacing},
|
|
40
|
+
"fieldset-legend-color": #{$fieldset-legend-color},
|
|
41
|
+
"fieldset-legend-size": #{$fieldset-legend-size},
|
|
42
|
+
"fieldset-legend-weight": #{$fieldset-legend-weight},
|
|
43
|
+
"fieldset-legend-padding": #{$fieldset-legend-padding},
|
|
44
|
+
"fieldset-legend-spacing": #{$fieldset-legend-spacing},
|
|
45
|
+
)
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.#{iv.$class-prefix}fieldset {
|
|
50
|
+
background-color: cv.getVar("fieldset-background");
|
|
51
|
+
border: cv.getVar("fieldset-border-width") solid
|
|
52
|
+
cv.getVar("fieldset-border-color");
|
|
53
|
+
border-radius: cv.getVar("fieldset-radius");
|
|
54
|
+
// Bulma resets a fieldset's margin, border and padding but keeps the
|
|
55
|
+
// browser's `min-inline-size: min-content`, which lets a wide child push
|
|
56
|
+
// the fieldset out of its column.
|
|
57
|
+
min-inline-size: 0;
|
|
58
|
+
padding: cv.getVar("fieldset-padding");
|
|
59
|
+
padding-block-start: cv.getVar("fieldset-padding-top");
|
|
60
|
+
|
|
61
|
+
&:not(:last-child) {
|
|
62
|
+
margin-block-end: cv.getVar("fieldset-spacing");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&.#{iv.$class-prefix}is-filled {
|
|
66
|
+
background-color: cv.getVar("fieldset-filled-background");
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.#{iv.$class-prefix}is-unstyled {
|
|
70
|
+
background-color: transparent;
|
|
71
|
+
border: 0;
|
|
72
|
+
border-radius: 0;
|
|
73
|
+
padding: 0;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Forced colors replaces the backgrounds, so the border is all that draws the
|
|
78
|
+
// box. It takes the text color, since a browser may otherwise draw a
|
|
79
|
+
// fieldset's border there in a faint system grey.
|
|
80
|
+
@media (forced-colors: active) {
|
|
81
|
+
.#{iv.$class-prefix}fieldset {
|
|
82
|
+
border-color: CanvasText;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The default and filled legends sit on the border, where the browser draws
|
|
87
|
+
// a fieldset's legend, so the border breaks around them.
|
|
88
|
+
.#{iv.$class-prefix}fieldset-legend {
|
|
89
|
+
color: cv.getVar("fieldset-legend-color");
|
|
90
|
+
font-size: cv.getVar("fieldset-legend-size");
|
|
91
|
+
font-weight: cv.getVar("fieldset-legend-weight");
|
|
92
|
+
padding-inline: cv.getVar("fieldset-legend-padding");
|
|
93
|
+
|
|
94
|
+
.#{iv.$class-prefix}fieldset.#{iv.$class-prefix}is-unstyled > & {
|
|
95
|
+
margin-block-end: cv.getVar("fieldset-legend-spacing");
|
|
96
|
+
padding-inline: 0;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Bulma dims a `.checkbox` or `.radio` anywhere in a disabled fieldset,
|
|
100
|
+
// but the browser leaves the controls in its legend enabled, so one there
|
|
101
|
+
// keeps its usual look for as long as its input is enabled. Inside a
|
|
102
|
+
// disabled outer fieldset the input is disabled too, and the dimming stays.
|
|
103
|
+
.#{iv.$class-prefix}checkbox:has(input:enabled),
|
|
104
|
+
.#{iv.$class-prefix}radio:has(input:enabled) {
|
|
105
|
+
color: inherit;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
// Form Components
|
|
5
5
|
@use 'checkbox';
|
|
6
|
+
@use 'checkboxcard';
|
|
6
7
|
@use 'radio';
|
|
8
|
+
@use 'radiocard';
|
|
7
9
|
@use 'switch';
|
|
8
10
|
@use 'slider';
|
|
9
11
|
@use 'numberinput';
|
|
@@ -18,3 +20,4 @@
|
|
|
18
20
|
@use 'datetimeinput';
|
|
19
21
|
@use 'daterangeinput';
|
|
20
22
|
@use 'file';
|
|
23
|
+
@use 'fieldset';
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
@use "bulma/sass/utilities/initial-variables" as iv;
|
|
6
6
|
@use "bulma/sass/utilities/css-variables" as cv;
|
|
7
|
+
@use "bulma/sass/utilities/mixins" as mx;
|
|
8
|
+
|
|
9
|
+
// Bulma's horizontal field: `.field-label` takes one part of the row and
|
|
10
|
+
// `.field-body` five, after the label's `margin-inline-end`. Private, since
|
|
11
|
+
// they restate Bulma's layout rather than set a look of their own.
|
|
12
|
+
$-field-label-gap: 1.5rem;
|
|
13
|
+
$-field-label-parts: 6;
|
|
7
14
|
|
|
8
15
|
// Radio-specific SCSS variables
|
|
9
16
|
$radio-size: 1.25em !default;
|
|
@@ -197,3 +204,40 @@ $radio-transition-duration: cv.getVar("duration") !default;
|
|
|
197
204
|
}
|
|
198
205
|
}
|
|
199
206
|
}
|
|
207
|
+
|
|
208
|
+
// `<Radios as="fieldset">` renders a native fieldset: the group's own
|
|
209
|
+
// `.field`, with its label as the legend, or the `.radios` box itself inside
|
|
210
|
+
// an outer `Field`. Bulma resets a fieldset's margin, border and padding but
|
|
211
|
+
// keeps the browser's `min-inline-size: min-content`, which lets a long row
|
|
212
|
+
// of choices push it out of its column.
|
|
213
|
+
fieldset.#{iv.$class-prefix}radios,
|
|
214
|
+
fieldset.#{iv.$class-prefix}field:has(.#{iv.$class-prefix}radios) {
|
|
215
|
+
min-inline-size: 0;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Horizontal, the legend is the label column. The browser draws a
|
|
219
|
+
// fieldset's legend above the content rather than beside it. A floated
|
|
220
|
+
// legend escapes that, though not in a flex fieldset in every engine, so the
|
|
221
|
+
// fieldset is a block here and the legend floats, taking the share of the
|
|
222
|
+
// row Bulma's `.field-label` takes beside `.field-body` (one part in six of
|
|
223
|
+
// what's left after its margin), and growing as that does for a word too
|
|
224
|
+
// long to wrap. `.field-body`, a flex box, sits beside it. Below tablet the
|
|
225
|
+
// row stacks, and the legend sits on top as it is. It applies only where the
|
|
226
|
+
// fieldset's own legend is the label column and the body after it holds the
|
|
227
|
+
// group, so a fieldset you lay out with a `div.field-label` keeps Bulma's
|
|
228
|
+
// flex row whatever its body holds.
|
|
229
|
+
@include mx.tablet {
|
|
230
|
+
fieldset.#{iv.$class-prefix}field.#{iv.$class-prefix}is-horizontal:has(
|
|
231
|
+
> legend.#{iv.$class-prefix}field-label
|
|
232
|
+
+ .#{iv.$class-prefix}field-body
|
|
233
|
+
.#{iv.$class-prefix}radios
|
|
234
|
+
) {
|
|
235
|
+
display: flow-root;
|
|
236
|
+
|
|
237
|
+
> legend.#{iv.$class-prefix}field-label {
|
|
238
|
+
float: inline-start;
|
|
239
|
+
inline-size: calc((100% - #{$-field-label-gap}) / #{$-field-label-parts});
|
|
240
|
+
min-inline-size: min-content;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// RadioCard styles
|
|
2
|
+
// A radio button drawn as a card: a <label class="radio-card card"> holding
|
|
3
|
+
// the native input, then a .card-content span with the indicator and the
|
|
4
|
+
// text. Bulma's .card draws the surface. This partial adds the card's edge,
|
|
5
|
+
// which carries the picked state, the focus outline and the indicator.
|
|
6
|
+
//
|
|
7
|
+
// The edge is a pseudo-element of the content span, laid over the whole card,
|
|
8
|
+
// rather than a border on the label. The input comes before the content span,
|
|
9
|
+
// so `input:checked + …` reaches it without :has(), and a thicker edge when
|
|
10
|
+
// picked moves nothing inside the card. It's a real border, since Bulma's
|
|
11
|
+
// card draws its own edge with a box-shadow, which forced colors drops.
|
|
12
|
+
|
|
13
|
+
@use 'bulma/sass/utilities/initial-variables' as iv;
|
|
14
|
+
@use 'bulma/sass/utilities/css-variables' as cv;
|
|
15
|
+
|
|
16
|
+
$radio-card-border-width: 1px !default;
|
|
17
|
+
$radio-card-border-color: cv.getVar('border') !default;
|
|
18
|
+
$radio-card-hover-border-color: cv.getVar('border-hover') !default;
|
|
19
|
+
// Twice the edge, so a picked card differs from the others by more than its
|
|
20
|
+
// color (WCAG 1.4.1), with or without the indicator.
|
|
21
|
+
$radio-card-checked-border-width: 2px !default;
|
|
22
|
+
$radio-card-active-color: cv.getVar('primary') !default;
|
|
23
|
+
// Bulma's focus color and width, which every color of card shares, since
|
|
24
|
+
// some of the six fall short of 3:1 on a light page.
|
|
25
|
+
$radio-card-focus-color: hsl(
|
|
26
|
+
cv.getVar('focus-h'),
|
|
27
|
+
cv.getVar('focus-s'),
|
|
28
|
+
cv.getVar('focus-l')
|
|
29
|
+
) !default;
|
|
30
|
+
$radio-card-focus-width: cv.getVar('focus-width') !default;
|
|
31
|
+
$radio-card-focus-offset: 2px !default;
|
|
32
|
+
$radio-card-gap: 0.75em !default;
|
|
33
|
+
$radio-card-min-width: 12rem !default;
|
|
34
|
+
$radio-card-title-weight: cv.getVar('weight-semibold') !default;
|
|
35
|
+
$radio-card-description-color: cv.getVar('text-weak') !default;
|
|
36
|
+
$radio-card-indicator-size: 1.25em !default;
|
|
37
|
+
$radio-card-indicator-border-width: 2px !default;
|
|
38
|
+
// The ring is all that shows of an unpicked radio, so it takes `text-weak`,
|
|
39
|
+
// as Radio's does, which holds 3:1 on the card's surface.
|
|
40
|
+
$radio-card-indicator-border-color: cv.getVar('text-weak') !default;
|
|
41
|
+
$radio-card-disabled-opacity: 0.5 !default;
|
|
42
|
+
$radio-card-transition-duration: cv.getVar('duration') !default;
|
|
43
|
+
|
|
44
|
+
// The text's line height, which also places the indicator: it's centred on
|
|
45
|
+
// the title's first line while it's shorter than that line.
|
|
46
|
+
$-line-height: 1.5;
|
|
47
|
+
|
|
48
|
+
.#{iv.$class-prefix}radio-card {
|
|
49
|
+
@include cv.register-vars(
|
|
50
|
+
(
|
|
51
|
+
'radio-card-border-width': #{$radio-card-border-width},
|
|
52
|
+
'radio-card-border-color': #{$radio-card-border-color},
|
|
53
|
+
'radio-card-hover-border-color': #{$radio-card-hover-border-color},
|
|
54
|
+
'radio-card-checked-border-width': #{$radio-card-checked-border-width},
|
|
55
|
+
'radio-card-active-color': #{$radio-card-active-color},
|
|
56
|
+
'radio-card-focus-color': #{$radio-card-focus-color},
|
|
57
|
+
'radio-card-focus-width': #{$radio-card-focus-width},
|
|
58
|
+
'radio-card-focus-offset': #{$radio-card-focus-offset},
|
|
59
|
+
'radio-card-gap': #{$radio-card-gap},
|
|
60
|
+
'radio-card-min-width': #{$radio-card-min-width},
|
|
61
|
+
'radio-card-title-weight': #{$radio-card-title-weight},
|
|
62
|
+
'radio-card-description-color': #{$radio-card-description-color},
|
|
63
|
+
'radio-card-indicator-size': #{$radio-card-indicator-size},
|
|
64
|
+
'radio-card-indicator-border-width': #{$radio-card-indicator-border-width},
|
|
65
|
+
'radio-card-indicator-border-color': #{$radio-card-indicator-border-color},
|
|
66
|
+
'radio-card-disabled-opacity': #{$radio-card-disabled-opacity},
|
|
67
|
+
'radio-card-transition-duration': #{$radio-card-transition-duration},
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.#{iv.$class-prefix}radio-card {
|
|
73
|
+
display: block;
|
|
74
|
+
position: relative;
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
|
|
77
|
+
// The native input, hidden the way Radio hides it. It still takes focus,
|
|
78
|
+
// clicks through the label and the arrow keys.
|
|
79
|
+
> input[type='radio'] {
|
|
80
|
+
position: absolute;
|
|
81
|
+
opacity: 0;
|
|
82
|
+
width: 0;
|
|
83
|
+
height: 0;
|
|
84
|
+
margin: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// The edge, laid over the whole card.
|
|
88
|
+
> .#{iv.$class-prefix}radio-card-content::before {
|
|
89
|
+
content: '';
|
|
90
|
+
position: absolute;
|
|
91
|
+
inset: 0;
|
|
92
|
+
border: cv.getVar('radio-card-border-width') solid
|
|
93
|
+
cv.getVar('radio-card-border-color');
|
|
94
|
+
border-radius: cv.getVar('card-radius');
|
|
95
|
+
pointer-events: none;
|
|
96
|
+
transition-property: border-color, border-width;
|
|
97
|
+
transition-duration: cv.getVar('radio-card-transition-duration');
|
|
98
|
+
transition-timing-function: ease;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&:hover
|
|
102
|
+
> input[type='radio']:enabled:not(:checked)
|
|
103
|
+
+ .#{iv.$class-prefix}radio-card-content::before {
|
|
104
|
+
border-color: cv.getVar('radio-card-hover-border-color');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
> input[type='radio']:checked
|
|
108
|
+
+ .#{iv.$class-prefix}radio-card-content::before {
|
|
109
|
+
border-color: cv.getVar('radio-card-active-color');
|
|
110
|
+
border-width: cv.getVar('radio-card-checked-border-width');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Keyboard focus: an outline around the whole card.
|
|
114
|
+
> input[type='radio']:focus-visible
|
|
115
|
+
+ .#{iv.$class-prefix}radio-card-content::before {
|
|
116
|
+
outline: cv.getVar('radio-card-focus-width') solid
|
|
117
|
+
cv.getVar('radio-card-focus-color');
|
|
118
|
+
outline-offset: cv.getVar('radio-card-focus-offset');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
> input[type='radio']:disabled + .#{iv.$class-prefix}radio-card-content {
|
|
122
|
+
opacity: cv.getVar('radio-card-disabled-opacity');
|
|
123
|
+
cursor: not-allowed;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// The indicator follows the input's state, as Radio's ring does.
|
|
127
|
+
> input[type='radio']:checked
|
|
128
|
+
+ .#{iv.$class-prefix}radio-card-content
|
|
129
|
+
> .#{iv.$class-prefix}radio-card-check {
|
|
130
|
+
border-color: cv.getVar('radio-card-active-color');
|
|
131
|
+
|
|
132
|
+
&::before {
|
|
133
|
+
opacity: 1;
|
|
134
|
+
transform: translate(-50%, -50%) scale(1);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// The content fills the card, the indicator beside the text. Bulma rounds a
|
|
140
|
+
// `.card-content` only as the card's first or last child, and the input comes
|
|
141
|
+
// first here, so the content takes the card's corners itself, or a themed
|
|
142
|
+
// `--bulma-card-content-background-color` would show square ones.
|
|
143
|
+
.#{iv.$class-prefix}radio-card-content {
|
|
144
|
+
display: flex;
|
|
145
|
+
align-items: flex-start;
|
|
146
|
+
gap: cv.getVar('radio-card-gap');
|
|
147
|
+
border-radius: inherit;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.#{iv.$class-prefix}radio-card-check {
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
flex-shrink: 0;
|
|
153
|
+
position: relative;
|
|
154
|
+
// Checkbox and Radio hold their box to 24px, the minimum target size. Here
|
|
155
|
+
// the whole card is the target, so the indicator has no floor and follows
|
|
156
|
+
// its size variable and the card's text size.
|
|
157
|
+
width: cv.getVar('radio-card-indicator-size');
|
|
158
|
+
height: cv.getVar('radio-card-indicator-size');
|
|
159
|
+
margin-top: max(
|
|
160
|
+
0px,
|
|
161
|
+
calc((#{$-line-height}em - #{cv.getVar('radio-card-indicator-size')}) / 2)
|
|
162
|
+
);
|
|
163
|
+
border: cv.getVar('radio-card-indicator-border-width') solid
|
|
164
|
+
cv.getVar('radio-card-indicator-border-color');
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
transition-property: border-color;
|
|
167
|
+
transition-duration: cv.getVar('radio-card-transition-duration');
|
|
168
|
+
transition-timing-function: ease;
|
|
169
|
+
|
|
170
|
+
// The dot.
|
|
171
|
+
&::before {
|
|
172
|
+
content: '';
|
|
173
|
+
position: absolute;
|
|
174
|
+
top: 50%;
|
|
175
|
+
left: 50%;
|
|
176
|
+
width: 50%;
|
|
177
|
+
height: 50%;
|
|
178
|
+
border-radius: 50%;
|
|
179
|
+
background-color: cv.getVar('radio-card-active-color');
|
|
180
|
+
opacity: 0;
|
|
181
|
+
transform: translate(-50%, -50%) scale(0.5);
|
|
182
|
+
transition-property: opacity, transform;
|
|
183
|
+
transition-duration: cv.getVar('radio-card-transition-duration');
|
|
184
|
+
transition-timing-function: ease;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Block spans, since a label holds phrasing content only.
|
|
189
|
+
.#{iv.$class-prefix}radio-card-body {
|
|
190
|
+
display: block;
|
|
191
|
+
flex: 1 1 auto;
|
|
192
|
+
min-width: 0;
|
|
193
|
+
line-height: $-line-height;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// The title takes the card's own text color, so `textColor` reaches it too.
|
|
197
|
+
.#{iv.$class-prefix}radio-card-title {
|
|
198
|
+
display: block;
|
|
199
|
+
font-weight: cv.getVar('radio-card-title-weight');
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.#{iv.$class-prefix}radio-card-description {
|
|
203
|
+
display: block;
|
|
204
|
+
color: cv.getVar('radio-card-description-color');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Color variants
|
|
208
|
+
@each $name in 'primary', 'link', 'info', 'success', 'warning', 'danger' {
|
|
209
|
+
.#{iv.$class-prefix}radio-card.#{iv.$class-prefix}is-#{$name} {
|
|
210
|
+
@include cv.register-vars(
|
|
211
|
+
(
|
|
212
|
+
'radio-card-active-color': #{cv.getVar($name)},
|
|
213
|
+
)
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// In a Radios group, a wrapping row: the cards share it equally and wrap
|
|
219
|
+
// before they get narrower than the minimum width.
|
|
220
|
+
.#{iv.$class-prefix}radios
|
|
221
|
+
> .#{iv.$class-prefix}radio-card.#{iv.$class-prefix}card {
|
|
222
|
+
flex: 1 1 0;
|
|
223
|
+
min-width: min(100%, #{cv.getVar('radio-card-min-width')});
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// The group's gap, or a Bulma grid's, spaces the cards, so Bulma's margin
|
|
227
|
+
// under a card goes, or the last card would stand taller than the rest.
|
|
228
|
+
.#{iv.$class-prefix}radios,
|
|
229
|
+
.#{iv.$class-prefix}grid {
|
|
230
|
+
> .#{iv.$class-prefix}radio-card.#{iv.$class-prefix}card {
|
|
231
|
+
margin-bottom: 0;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// Forced colors repaints the edge in the text color and drops Bulma's
|
|
236
|
+
// shadow, so a picked card names Highlight on an edge that stays thicker.
|
|
237
|
+
@media (forced-colors: active) {
|
|
238
|
+
.#{iv.$class-prefix}radio-card {
|
|
239
|
+
> .#{iv.$class-prefix}radio-card-content::before {
|
|
240
|
+
border-color: CanvasText;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
> input[type='radio']:checked
|
|
244
|
+
+ .#{iv.$class-prefix}radio-card-content::before {
|
|
245
|
+
border-color: Highlight;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
> input[type='radio']:focus-visible
|
|
249
|
+
+ .#{iv.$class-prefix}radio-card-content::before {
|
|
250
|
+
outline-color: Highlight;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
> input[type='radio']:disabled + .#{iv.$class-prefix}radio-card-content {
|
|
254
|
+
color: GrayText;
|
|
255
|
+
|
|
256
|
+
&::before {
|
|
257
|
+
border-color: GrayText;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.#{iv.$class-prefix}radio-card-check {
|
|
262
|
+
border-color: ButtonText;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
> input[type='radio']:checked
|
|
266
|
+
+ .#{iv.$class-prefix}radio-card-content
|
|
267
|
+
> .#{iv.$class-prefix}radio-card-check {
|
|
268
|
+
border-color: Highlight;
|
|
269
|
+
|
|
270
|
+
&::before {
|
|
271
|
+
background-color: Highlight;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
> input[type='radio']:disabled
|
|
276
|
+
+ .#{iv.$class-prefix}radio-card-content
|
|
277
|
+
> .#{iv.$class-prefix}radio-card-check {
|
|
278
|
+
border-color: GrayText;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@media (prefers-reduced-motion: reduce) {
|
|
284
|
+
.#{iv.$class-prefix}radio-card {
|
|
285
|
+
> .#{iv.$class-prefix}radio-card-content::before,
|
|
286
|
+
.#{iv.$class-prefix}radio-card-check,
|
|
287
|
+
.#{iv.$class-prefix}radio-card-check::before {
|
|
288
|
+
transition: none;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|