@allxsmith/bestax-bulma 2.6.1 → 3.0.1
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/README.md +2 -2
- package/dist/bestax.css +3 -0
- package/dist/bestax.css.map +1 -0
- package/dist/bestax.js +1 -0
- package/dist/extras.css +3 -0
- package/dist/extras.css.map +1 -0
- package/dist/extras.js +1 -0
- package/dist/index.cjs.js +6214 -647
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +6154 -649
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Carousel.d.ts +34 -0
- package/dist/types/components/Collapse.d.ts +17 -0
- package/dist/types/components/Dialog.d.ts +47 -0
- package/dist/types/components/Loading.d.ts +18 -0
- package/dist/types/components/Navbar.d.ts +10 -0
- package/dist/types/components/Panel.d.ts +2 -4
- package/dist/types/components/Sidebar.d.ts +37 -0
- package/dist/types/components/Steps.d.ts +45 -0
- package/dist/types/components/Tabs.d.ts +42 -6
- package/dist/types/components/Toast.d.ts +46 -0
- package/dist/types/components/Tooltip.d.ts +22 -0
- package/dist/types/elements/Button.d.ts +1 -1
- package/dist/types/elements/Code.d.ts +9 -0
- package/dist/types/elements/Divider.d.ts +7 -0
- package/dist/types/elements/Emphasis.d.ts +9 -0
- package/dist/types/elements/Figure.d.ts +17 -0
- package/dist/types/elements/Icon.d.ts +1 -0
- package/dist/types/elements/Link.d.ts +10 -0
- package/dist/types/elements/LinkButton.d.ts +8 -0
- package/dist/types/elements/ListItem.d.ts +9 -0
- package/dist/types/elements/Notification.d.ts +31 -0
- package/dist/types/elements/OrderedList.d.ts +9 -0
- package/dist/types/elements/Paragraph.d.ts +9 -0
- package/dist/types/elements/Pre.d.ts +9 -0
- package/dist/types/elements/Span.d.ts +9 -0
- package/dist/types/elements/Strong.d.ts +9 -0
- package/dist/types/elements/UnorderedList.d.ts +9 -0
- package/dist/types/form/Autocomplete.d.ts +42 -0
- package/dist/types/form/Checkbox.d.ts +7 -2
- package/dist/types/form/Checkboxes.d.ts +6 -1
- package/dist/types/form/DateInput.d.ts +26 -0
- package/dist/types/form/DateInputBase.d.ts +42 -0
- package/dist/types/form/DateTimeInput.d.ts +26 -0
- package/dist/types/form/DateTimeInputBase.d.ts +50 -0
- package/dist/types/form/Field.d.ts +2 -1
- package/dist/types/form/File.d.ts +3 -2
- package/dist/types/form/FormContext.d.ts +22 -0
- package/dist/types/form/Input.d.ts +22 -11
- package/dist/types/form/InputBase.d.ts +16 -0
- package/dist/types/form/Numberinput.d.ts +30 -0
- package/dist/types/form/Radio.d.ts +7 -2
- package/dist/types/form/Radios.d.ts +6 -1
- package/dist/types/form/Rate.d.ts +38 -0
- package/dist/types/form/Select.d.ts +18 -11
- package/dist/types/form/SelectBase.d.ts +19 -0
- package/dist/types/form/Slider.d.ts +49 -0
- package/dist/types/form/Switch.d.ts +17 -0
- package/dist/types/form/Taginput.d.ts +54 -0
- package/dist/types/form/TextArea.d.ts +13 -14
- package/dist/types/form/TextAreaBase.d.ts +19 -0
- package/dist/types/form/TimeInput.d.ts +26 -0
- package/dist/types/form/TimeInputBase.d.ts +44 -0
- package/dist/types/form/_pickerInternals/Calendar.d.ts +26 -0
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +20 -0
- package/dist/types/form/_pickerInternals/TimeWheels.d.ts +29 -0
- package/dist/types/form/_pickerInternals/audioTick.d.ts +3 -0
- package/dist/types/form/_pickerInternals/dateUtils.d.ts +39 -0
- package/dist/types/form/_pickerInternals/formatters.d.ts +13 -0
- package/dist/types/form/_pickerInternals/haptics.d.ts +1 -0
- package/dist/types/form/_pickerInternals/pickerTypes.d.ts +31 -0
- package/dist/types/form/_pickerInternals/segmentMap.d.ts +20 -0
- package/dist/types/form/_pickerInternals/useFocusTrap.d.ts +7 -0
- package/dist/types/form/_pickerInternals/useNativeMobilePicker.d.ts +10 -0
- package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +45 -0
- package/dist/types/form/fieldProps.d.ts +12 -0
- package/dist/types/helpers/bulmaClassHelpers.d.ts +35 -0
- package/dist/types/helpers/useBulmaClasses.d.ts +16 -83
- package/dist/types/helpers/useColorClasses.d.ts +8 -0
- package/dist/types/helpers/useFlexboxClasses.d.ts +12 -0
- package/dist/types/helpers/useOtherClasses.d.ts +15 -0
- package/dist/types/helpers/useSpacingClasses.d.ts +18 -0
- package/dist/types/helpers/useTypographyClasses.d.ts +19 -0
- package/dist/types/helpers/useVisibilityClasses.d.ts +10 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/versions/bestax-bulma-prefixed.css +3 -0
- package/dist/versions/bestax-bulma-prefixed.css.map +1 -0
- package/dist/versions/bestax-bulma-prefixed.js +1 -0
- package/dist/versions/bestax-no-dark-mode.css +3 -0
- package/dist/versions/bestax-no-dark-mode.css.map +1 -0
- package/dist/versions/bestax-no-dark-mode.js +1 -0
- package/dist/versions/bestax-no-helpers-prefixed.css +3 -0
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -0
- package/dist/versions/bestax-no-helpers-prefixed.js +1 -0
- package/dist/versions/bestax-no-helpers.css +3 -0
- package/dist/versions/bestax-no-helpers.css.map +1 -0
- package/dist/versions/bestax-no-helpers.js +1 -0
- package/dist/versions/bestax-prefixed.css +3 -0
- package/dist/versions/bestax-prefixed.css.map +1 -0
- package/dist/versions/bestax-prefixed.js +1 -0
- package/package.json +100 -21
- package/src/scss/_mixins.scss +215 -0
- package/src/scss/_variables.scss +94 -0
- package/src/scss/bestax.scss +18 -0
- package/src/scss/components/_carousel.scss +580 -0
- package/src/scss/components/_collapse.scss +126 -0
- package/src/scss/components/_dialog.scss +134 -0
- package/src/scss/components/_index.scss +13 -0
- package/src/scss/components/_loading.scss +231 -0
- package/src/scss/components/_sidebar.scss +347 -0
- package/src/scss/components/_steps.scss +459 -0
- package/src/scss/components/_tabs.scss +147 -0
- package/src/scss/components/_toast.scss +244 -0
- package/src/scss/components/_tooltip.scss +250 -0
- package/src/scss/elements/_index.scss +5 -0
- package/src/scss/elements/_linkbutton.scss +77 -0
- package/src/scss/extras.scss +24 -0
- package/src/scss/form/_autocomplete.scss +261 -0
- package/src/scss/form/_checkbox.scss +217 -0
- package/src/scss/form/_dateinput.scss +292 -0
- package/src/scss/form/_datetimeinput.scss +191 -0
- package/src/scss/form/_index.scss +16 -0
- package/src/scss/form/_numberinput.scss +176 -0
- package/src/scss/form/_picker-popover.scss +185 -0
- package/src/scss/form/_radio.scss +196 -0
- package/src/scss/form/_rate.scss +307 -0
- package/src/scss/form/_slider.scss +630 -0
- package/src/scss/form/_switch.scss +314 -0
- package/src/scss/form/_taginput.scss +356 -0
- package/src/scss/form/_timeinput.scss +374 -0
- package/src/scss/helpers/_cursor.scss +5 -0
- package/src/scss/helpers/_index.scss +2 -0
- package/src/scss/helpers/_sizing.scss +5 -0
- package/src/scss/versions/bestax-bulma-prefixed.scss +15 -0
- package/src/scss/versions/bestax-no-dark-mode.scss +32 -0
- package/src/scss/versions/bestax-no-helpers-prefixed.scss +22 -0
- package/src/scss/versions/bestax-no-helpers.scss +23 -0
- package/src/scss/versions/bestax-prefixed.scss +15 -0
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
// Autocomplete component styles
|
|
2
|
+
// Custom-styled autocomplete with dropdown suggestions
|
|
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
|
+
// Autocomplete-specific SCSS variables
|
|
9
|
+
$autocomplete-dropdown-z-index: 20 !default;
|
|
10
|
+
$autocomplete-dropdown-offset: 4px !default;
|
|
11
|
+
$autocomplete-dropdown-background: cv.getVar("scheme-main") !default;
|
|
12
|
+
$autocomplete-dropdown-radius: cv.getVar("radius") !default;
|
|
13
|
+
$autocomplete-dropdown-shadow: cv.getVar("shadow") !default;
|
|
14
|
+
$autocomplete-dropdown-padding-y: 0.5rem !default;
|
|
15
|
+
$autocomplete-item-padding: 0.375rem 1rem !default;
|
|
16
|
+
$autocomplete-item-color: cv.getVar("text") !default;
|
|
17
|
+
$autocomplete-item-hover-background: hsla(0, 0%, 50%, 0.13) !default;
|
|
18
|
+
$autocomplete-item-hover-color: cv.getVar("text-strong") !default;
|
|
19
|
+
$autocomplete-item-disabled-color: cv.getVar("text-weak") !default;
|
|
20
|
+
$autocomplete-item-disabled-opacity: 0.5 !default;
|
|
21
|
+
$autocomplete-header-footer-padding: 0.5rem 1rem !default;
|
|
22
|
+
$autocomplete-header-footer-color: cv.getVar("text-weak") !default;
|
|
23
|
+
$autocomplete-header-footer-size: cv.getVar("size-small") !default;
|
|
24
|
+
$autocomplete-border-color: cv.getVar("border") !default;
|
|
25
|
+
$autocomplete-border-hover-color: cv.getVar("border-hover") !default;
|
|
26
|
+
$autocomplete-icon-hover-color: cv.getVar("text-strong") !default;
|
|
27
|
+
$autocomplete-loader-border-color: cv.getVar("border") !default;
|
|
28
|
+
$autocomplete-loader-active-color: cv.getVar("primary") !default;
|
|
29
|
+
$autocomplete-loader-duration: 0.6s !default;
|
|
30
|
+
$autocomplete-empty-color: cv.getVar("text-weak") !default;
|
|
31
|
+
$autocomplete-scrollbar-width: 8px !default;
|
|
32
|
+
$autocomplete-scrollbar-track: cv.getVar("scheme-main-bis") !default;
|
|
33
|
+
$autocomplete-scrollbar-thumb: cv.getVar("border") !default;
|
|
34
|
+
$autocomplete-scrollbar-thumb-hover: cv.getVar("border-hover") !default;
|
|
35
|
+
$autocomplete-item-small-padding: 0.25rem 0.75rem !default;
|
|
36
|
+
$autocomplete-item-medium-padding: 0.5rem 1.25rem !default;
|
|
37
|
+
$autocomplete-item-large-padding: 0.625rem 1.5rem !default;
|
|
38
|
+
|
|
39
|
+
// Register CSS custom properties
|
|
40
|
+
.#{iv.$class-prefix}autocomplete {
|
|
41
|
+
@include cv.register-vars(
|
|
42
|
+
(
|
|
43
|
+
"autocomplete-dropdown-z-index": #{$autocomplete-dropdown-z-index},
|
|
44
|
+
"autocomplete-dropdown-offset": #{$autocomplete-dropdown-offset},
|
|
45
|
+
"autocomplete-dropdown-background": #{$autocomplete-dropdown-background},
|
|
46
|
+
"autocomplete-dropdown-radius": #{$autocomplete-dropdown-radius},
|
|
47
|
+
"autocomplete-dropdown-shadow": #{$autocomplete-dropdown-shadow},
|
|
48
|
+
"autocomplete-dropdown-padding-y": #{$autocomplete-dropdown-padding-y},
|
|
49
|
+
"autocomplete-item-padding": #{$autocomplete-item-padding},
|
|
50
|
+
"autocomplete-item-color": #{$autocomplete-item-color},
|
|
51
|
+
"autocomplete-item-hover-background": #{$autocomplete-item-hover-background},
|
|
52
|
+
"autocomplete-item-hover-color": #{$autocomplete-item-hover-color},
|
|
53
|
+
"autocomplete-item-disabled-color": #{$autocomplete-item-disabled-color},
|
|
54
|
+
"autocomplete-item-disabled-opacity": #{$autocomplete-item-disabled-opacity},
|
|
55
|
+
"autocomplete-header-footer-padding": #{$autocomplete-header-footer-padding},
|
|
56
|
+
"autocomplete-header-footer-color": #{$autocomplete-header-footer-color},
|
|
57
|
+
"autocomplete-header-footer-size": #{$autocomplete-header-footer-size},
|
|
58
|
+
"autocomplete-border-color": #{$autocomplete-border-color},
|
|
59
|
+
"autocomplete-border-hover-color": #{$autocomplete-border-hover-color},
|
|
60
|
+
"autocomplete-icon-hover-color": #{$autocomplete-icon-hover-color},
|
|
61
|
+
"autocomplete-loader-border-color": #{$autocomplete-loader-border-color},
|
|
62
|
+
"autocomplete-loader-active-color": #{$autocomplete-loader-active-color},
|
|
63
|
+
"autocomplete-loader-duration": #{$autocomplete-loader-duration},
|
|
64
|
+
"autocomplete-empty-color": #{$autocomplete-empty-color},
|
|
65
|
+
"autocomplete-scrollbar-width": #{$autocomplete-scrollbar-width},
|
|
66
|
+
"autocomplete-scrollbar-track": #{$autocomplete-scrollbar-track},
|
|
67
|
+
"autocomplete-scrollbar-thumb": #{$autocomplete-scrollbar-thumb},
|
|
68
|
+
"autocomplete-scrollbar-thumb-hover": #{$autocomplete-scrollbar-thumb-hover},
|
|
69
|
+
"autocomplete-item-small-padding": #{$autocomplete-item-small-padding},
|
|
70
|
+
"autocomplete-item-medium-padding": #{$autocomplete-item-medium-padding},
|
|
71
|
+
"autocomplete-item-large-padding": #{$autocomplete-item-large-padding},
|
|
72
|
+
)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Main autocomplete component
|
|
77
|
+
.#{iv.$class-prefix}autocomplete {
|
|
78
|
+
position: relative;
|
|
79
|
+
display: inline-flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
width: 100%;
|
|
82
|
+
|
|
83
|
+
// Control wrapper
|
|
84
|
+
.#{iv.$class-prefix}control {
|
|
85
|
+
width: 100%;
|
|
86
|
+
|
|
87
|
+
&.#{iv.$class-prefix}is-expanded {
|
|
88
|
+
flex-grow: 1;
|
|
89
|
+
flex-shrink: 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.#{iv.$class-prefix}has-icons-right {
|
|
93
|
+
.#{iv.$class-prefix}icon.#{iv.$class-prefix}is-right {
|
|
94
|
+
pointer-events: auto;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
|
|
97
|
+
&.#{iv.$class-prefix}is-clickable:hover {
|
|
98
|
+
color: cv.getVar("autocomplete-icon-hover-color");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
svg {
|
|
102
|
+
width: 1em;
|
|
103
|
+
height: 1em;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Input styling
|
|
110
|
+
.#{iv.$class-prefix}input {
|
|
111
|
+
width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Dropdown menu
|
|
115
|
+
.#{iv.$class-prefix}dropdown-menu {
|
|
116
|
+
position: absolute;
|
|
117
|
+
top: 100%;
|
|
118
|
+
left: 0;
|
|
119
|
+
right: 0;
|
|
120
|
+
z-index: cv.getVar("autocomplete-dropdown-z-index");
|
|
121
|
+
display: none;
|
|
122
|
+
padding-top: cv.getVar("autocomplete-dropdown-offset");
|
|
123
|
+
|
|
124
|
+
&.#{iv.$class-prefix}is-active {
|
|
125
|
+
display: block;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Dropdown content
|
|
130
|
+
.#{iv.$class-prefix}dropdown-content {
|
|
131
|
+
background-color: cv.getVar("autocomplete-dropdown-background");
|
|
132
|
+
border-radius: cv.getVar("autocomplete-dropdown-radius");
|
|
133
|
+
box-shadow: cv.getVar("autocomplete-dropdown-shadow");
|
|
134
|
+
padding-bottom: cv.getVar("autocomplete-dropdown-padding-y");
|
|
135
|
+
padding-top: cv.getVar("autocomplete-dropdown-padding-y");
|
|
136
|
+
overflow-y: auto;
|
|
137
|
+
|
|
138
|
+
// Scrollbar styling
|
|
139
|
+
&::-webkit-scrollbar {
|
|
140
|
+
width: cv.getVar("autocomplete-scrollbar-width");
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
&::-webkit-scrollbar-track {
|
|
144
|
+
background: cv.getVar("autocomplete-scrollbar-track");
|
|
145
|
+
border-radius: cv.getVar("autocomplete-dropdown-radius");
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&::-webkit-scrollbar-thumb {
|
|
149
|
+
background: cv.getVar("autocomplete-scrollbar-thumb");
|
|
150
|
+
border-radius: cv.getVar("autocomplete-dropdown-radius");
|
|
151
|
+
|
|
152
|
+
&:hover {
|
|
153
|
+
background: cv.getVar("autocomplete-scrollbar-thumb-hover");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Dropdown items
|
|
159
|
+
.#{iv.$class-prefix}dropdown-item {
|
|
160
|
+
display: block;
|
|
161
|
+
padding: cv.getVar("autocomplete-item-padding");
|
|
162
|
+
color: cv.getVar("autocomplete-item-color");
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
white-space: nowrap;
|
|
165
|
+
overflow: hidden;
|
|
166
|
+
text-overflow: ellipsis;
|
|
167
|
+
text-decoration: none;
|
|
168
|
+
|
|
169
|
+
&:hover,
|
|
170
|
+
&.#{iv.$class-prefix}is-active {
|
|
171
|
+
background-color: cv.getVar("autocomplete-item-hover-background");
|
|
172
|
+
color: cv.getVar("autocomplete-item-hover-color");
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&.#{iv.$class-prefix}is-disabled {
|
|
176
|
+
color: cv.getVar("autocomplete-item-disabled-color");
|
|
177
|
+
cursor: not-allowed;
|
|
178
|
+
opacity: cv.getVar("autocomplete-item-disabled-opacity");
|
|
179
|
+
|
|
180
|
+
&:hover {
|
|
181
|
+
background-color: transparent;
|
|
182
|
+
color: cv.getVar("autocomplete-item-disabled-color");
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Header and footer
|
|
188
|
+
.#{iv.$class-prefix}dropdown-header,
|
|
189
|
+
.#{iv.$class-prefix}dropdown-footer {
|
|
190
|
+
padding: cv.getVar("autocomplete-header-footer-padding");
|
|
191
|
+
font-size: cv.getVar("autocomplete-header-footer-size");
|
|
192
|
+
color: cv.getVar("autocomplete-header-footer-color");
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.#{iv.$class-prefix}dropdown-header {
|
|
196
|
+
border-bottom: 1px solid cv.getVar("autocomplete-border-color");
|
|
197
|
+
margin-bottom: 0.25rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.#{iv.$class-prefix}dropdown-footer {
|
|
201
|
+
border-top: 1px solid cv.getVar("autocomplete-border-color");
|
|
202
|
+
margin-top: 0.25rem;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// Size modifiers
|
|
206
|
+
&.#{iv.$class-prefix}is-small {
|
|
207
|
+
.#{iv.$class-prefix}input {
|
|
208
|
+
font-size: cv.getVar("size-small");
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.#{iv.$class-prefix}dropdown-item {
|
|
212
|
+
font-size: cv.getVar("size-small");
|
|
213
|
+
padding: cv.getVar("autocomplete-item-small-padding");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
&.#{iv.$class-prefix}is-medium {
|
|
218
|
+
.#{iv.$class-prefix}input {
|
|
219
|
+
font-size: cv.getVar("size-medium");
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.#{iv.$class-prefix}dropdown-item {
|
|
223
|
+
font-size: cv.getVar("size-medium");
|
|
224
|
+
padding: cv.getVar("autocomplete-item-medium-padding");
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&.#{iv.$class-prefix}is-large {
|
|
229
|
+
.#{iv.$class-prefix}input {
|
|
230
|
+
font-size: cv.getVar("size-large");
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.#{iv.$class-prefix}dropdown-item {
|
|
234
|
+
font-size: cv.getVar("size-large");
|
|
235
|
+
padding: cv.getVar("autocomplete-item-large-padding");
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Loading state
|
|
240
|
+
.#{iv.$class-prefix}loader {
|
|
241
|
+
display: inline-block;
|
|
242
|
+
width: 1em;
|
|
243
|
+
height: 1em;
|
|
244
|
+
border: 2px solid cv.getVar("autocomplete-loader-border-color");
|
|
245
|
+
border-radius: 50%;
|
|
246
|
+
border-top-color: cv.getVar("autocomplete-loader-active-color");
|
|
247
|
+
animation: autocomplete-spin cv.getVar("autocomplete-loader-duration") linear infinite;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@keyframes autocomplete-spin {
|
|
251
|
+
to {
|
|
252
|
+
transform: rotate(360deg);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Empty state
|
|
257
|
+
.#{iv.$class-prefix}has-text-grey {
|
|
258
|
+
color: cv.getVar("autocomplete-empty-color");
|
|
259
|
+
font-style: italic;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
// Themed Checkbox styles
|
|
2
|
+
// Custom-styled checkbox with colors, sizes, and visual states
|
|
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
|
+
// Checkbox-specific SCSS variables
|
|
9
|
+
$checkbox-size: 1.25em !default;
|
|
10
|
+
$checkbox-border-width: 2px !default;
|
|
11
|
+
$checkbox-radius: cv.getVar("radius-small") !default;
|
|
12
|
+
$checkbox-border-color: cv.getVar("border") !default;
|
|
13
|
+
$checkbox-background: transparent !default;
|
|
14
|
+
$checkbox-check-color: cv.getVar("scheme-invert") !default;
|
|
15
|
+
$checkbox-active-color: cv.getVar("primary") !default;
|
|
16
|
+
$checkbox-label-gap: 0.5em !default;
|
|
17
|
+
$checkbox-focus-shadow-size: 0 0 0 0.125em !default;
|
|
18
|
+
$checkbox-transition-duration: cv.getVar("duration") !default;
|
|
19
|
+
$checkbox-indeterminate-color: cv.getVar("primary") !default;
|
|
20
|
+
|
|
21
|
+
// Register CSS custom properties
|
|
22
|
+
.#{iv.$class-prefix}styled-checkbox {
|
|
23
|
+
@include cv.register-vars(
|
|
24
|
+
(
|
|
25
|
+
"checkbox-size": #{$checkbox-size},
|
|
26
|
+
"checkbox-border-width": #{$checkbox-border-width},
|
|
27
|
+
"checkbox-radius": #{$checkbox-radius},
|
|
28
|
+
"checkbox-border-color": #{$checkbox-border-color},
|
|
29
|
+
"checkbox-background": #{$checkbox-background},
|
|
30
|
+
"checkbox-check-color": #{$checkbox-check-color},
|
|
31
|
+
"checkbox-active-color": #{$checkbox-active-color},
|
|
32
|
+
"checkbox-label-gap": #{$checkbox-label-gap},
|
|
33
|
+
"checkbox-focus-shadow-size": #{$checkbox-focus-shadow-size},
|
|
34
|
+
"checkbox-transition-duration": #{$checkbox-transition-duration},
|
|
35
|
+
"checkbox-indeterminate-color": #{$checkbox-indeterminate-color},
|
|
36
|
+
)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Main checkbox label
|
|
41
|
+
.#{iv.$class-prefix}styled-checkbox {
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
position: relative;
|
|
46
|
+
user-select: none;
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
|
|
49
|
+
// Hidden native input
|
|
50
|
+
input[type="checkbox"] {
|
|
51
|
+
position: absolute;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
width: 0;
|
|
54
|
+
height: 0;
|
|
55
|
+
|
|
56
|
+
// Checked state
|
|
57
|
+
&:checked + .check {
|
|
58
|
+
background-color: cv.getVar("checkbox-active-color");
|
|
59
|
+
border-color: cv.getVar("checkbox-active-color");
|
|
60
|
+
|
|
61
|
+
// SVG checkmark
|
|
62
|
+
&::after {
|
|
63
|
+
opacity: 1;
|
|
64
|
+
transform: scale(1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Indeterminate state
|
|
69
|
+
&:indeterminate + .check {
|
|
70
|
+
background-color: cv.getVar("checkbox-indeterminate-color");
|
|
71
|
+
border-color: cv.getVar("checkbox-indeterminate-color");
|
|
72
|
+
|
|
73
|
+
&::after {
|
|
74
|
+
opacity: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&::before {
|
|
78
|
+
content: "";
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 50%;
|
|
81
|
+
left: 50%;
|
|
82
|
+
transform: translate(-50%, -50%);
|
|
83
|
+
width: 60%;
|
|
84
|
+
height: cv.getVar("checkbox-border-width");
|
|
85
|
+
background-color: cv.getVar("checkbox-check-color");
|
|
86
|
+
border-radius: 1px;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Focus-visible state (keyboard only)
|
|
91
|
+
&:focus-visible + .check {
|
|
92
|
+
outline: 2px solid cv.getVar("checkbox-active-color");
|
|
93
|
+
outline-offset: 2px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Disabled state
|
|
97
|
+
&:disabled + .check {
|
|
98
|
+
opacity: 0.5;
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:disabled ~ .control-label {
|
|
103
|
+
opacity: 0.5;
|
|
104
|
+
cursor: not-allowed;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Custom check indicator
|
|
109
|
+
.check {
|
|
110
|
+
display: inline-flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
justify-content: center;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
position: relative;
|
|
115
|
+
width: cv.getVar("checkbox-size");
|
|
116
|
+
height: cv.getVar("checkbox-size");
|
|
117
|
+
min-width: 24px;
|
|
118
|
+
min-height: 24px;
|
|
119
|
+
background-color: cv.getVar("checkbox-background");
|
|
120
|
+
border: cv.getVar("checkbox-border-width") solid cv.getVar("checkbox-border-color");
|
|
121
|
+
border-radius: cv.getVar("checkbox-radius");
|
|
122
|
+
transition-property: background-color, border-color;
|
|
123
|
+
transition-duration: cv.getVar("checkbox-transition-duration");
|
|
124
|
+
transition-timing-function: ease;
|
|
125
|
+
|
|
126
|
+
// Checkmark via SVG background-image
|
|
127
|
+
&::after {
|
|
128
|
+
content: "";
|
|
129
|
+
position: absolute;
|
|
130
|
+
width: 85%;
|
|
131
|
+
height: 85%;
|
|
132
|
+
opacity: 0;
|
|
133
|
+
transform: scale(0.5);
|
|
134
|
+
transition-property: opacity, transform;
|
|
135
|
+
transition-duration: cv.getVar("checkbox-transition-duration");
|
|
136
|
+
transition-timing-function: ease;
|
|
137
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
|
|
138
|
+
background-size: contain;
|
|
139
|
+
background-repeat: no-repeat;
|
|
140
|
+
background-position: center;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Label text
|
|
145
|
+
.control-label {
|
|
146
|
+
margin-left: cv.getVar("checkbox-label-gap");
|
|
147
|
+
line-height: 1.5;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Color variants
|
|
152
|
+
@each $name in "primary", "link", "info", "success", "warning", "danger" {
|
|
153
|
+
.#{iv.$class-prefix}styled-checkbox.#{iv.$class-prefix}is-#{$name} {
|
|
154
|
+
@include cv.register-vars(
|
|
155
|
+
(
|
|
156
|
+
"checkbox-active-color": #{cv.getVar($name)},
|
|
157
|
+
"checkbox-indeterminate-color": #{cv.getVar($name)},
|
|
158
|
+
)
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Size variants
|
|
164
|
+
.#{iv.$class-prefix}styled-checkbox.#{iv.$class-prefix}is-small {
|
|
165
|
+
font-size: cv.getVar("size-small");
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.#{iv.$class-prefix}styled-checkbox.#{iv.$class-prefix}is-medium {
|
|
169
|
+
font-size: cv.getVar("size-medium");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.#{iv.$class-prefix}styled-checkbox.#{iv.$class-prefix}is-large {
|
|
173
|
+
font-size: cv.getVar("size-large");
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// High Contrast Mode support
|
|
177
|
+
@media (forced-colors: active) {
|
|
178
|
+
.#{iv.$class-prefix}styled-checkbox {
|
|
179
|
+
.check {
|
|
180
|
+
border-color: ButtonText;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
input[type="checkbox"]:checked + .check {
|
|
184
|
+
background-color: Highlight;
|
|
185
|
+
border-color: Highlight;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
input[type="checkbox"]:focus-visible + .check {
|
|
189
|
+
outline-color: Highlight;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
input[type="checkbox"]:disabled + .check {
|
|
193
|
+
border-color: GrayText;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Reduced motion
|
|
199
|
+
@media (prefers-reduced-motion: reduce) {
|
|
200
|
+
.#{iv.$class-prefix}styled-checkbox {
|
|
201
|
+
.check,
|
|
202
|
+
.check::after {
|
|
203
|
+
transition: none;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// Vertical alignment for horizontal-field layouts.
|
|
209
|
+
// Match `.field-label.is-normal`'s `padding-top: 0.375em` so the checkbox
|
|
210
|
+
// group baseline lines up with the field-label text.
|
|
211
|
+
.#{iv.$class-prefix}field.#{iv.$class-prefix}is-horizontal {
|
|
212
|
+
.#{iv.$class-prefix}field-body {
|
|
213
|
+
.#{iv.$class-prefix}checkboxes {
|
|
214
|
+
padding-top: 0.375em;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|