kmaterialize 2.0.0 → 2.3.3-1.0.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 (150) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +55 -91
  3. package/components/appbar/_navbar.old.scss +223 -0
  4. package/components/appbar/appbar.css +235 -0
  5. package/components/appbar/appbar.mjs +54 -0
  6. package/components/appbar/appbar.test.mjs +9 -0
  7. package/components/atomic/atomic.mjs +19 -0
  8. package/components/atomic/component.mjs +67 -0
  9. package/components/badge/_badges.scss +75 -0
  10. package/components/badge/badge.mjs +11 -0
  11. package/components/breadcrumb/_breadcrumb.scss +27 -0
  12. package/components/button/_buttons.scss +352 -0
  13. package/components/button/button.mjs +11 -0
  14. package/components/button/buttons.stories.ts +150 -0
  15. package/components/button/buttons.ts +282 -0
  16. package/components/button/examples.iso.js +18 -0
  17. package/components/button/fabSpec.js +65 -0
  18. package/components/button/test-button.mjs +16 -0
  19. package/components/card/_cards.scss +229 -0
  20. package/components/card/card.mjs +10 -0
  21. package/components/card/cards.ts +185 -0
  22. package/components/card/cardsSpec.js +269 -0
  23. package/components/carousel/_carousel.scss +93 -0
  24. package/components/carousel/_slider.scss +119 -0
  25. package/components/carousel/carousel.ts +693 -0
  26. package/components/carousel/carouselSpec.js +61 -0
  27. package/components/carousel/slider.ts +431 -0
  28. package/components/carousel/sliderSpec.js +99 -0
  29. package/components/checkbox/_checkboxes.scss +281 -0
  30. package/components/checkbox/checkbox.mdx +24 -0
  31. package/components/checkbox/checkbox.stories.ts +120 -0
  32. package/components/chip/chip.mjs +37 -0
  33. package/components/chip/chip.test.mjs +10 -0
  34. package/components/chip/chips.css +126 -0
  35. package/components/chip/chips.mdx +33 -0
  36. package/components/chip/chips.ts +440 -0
  37. package/components/chip/chipsSpec.js +165 -0
  38. package/components/chip/readme.md +323 -0
  39. package/components/collapsible/_collapsible.scss +82 -0
  40. package/components/collapsible/collapsible.ts +230 -0
  41. package/components/collapsible/collapsibleSpec.js +240 -0
  42. package/components/datepicker/_datepicker.scss +268 -0
  43. package/components/datepicker/datepicker.ts +1450 -0
  44. package/components/datepicker/datepickerSpec.js +162 -0
  45. package/components/dialog/_materialbox.scss +42 -0
  46. package/components/dialog/_modal.scss +79 -0
  47. package/components/dialog/materialbox.ts +446 -0
  48. package/components/dialog/materialboxSpec.js +37 -0
  49. package/components/dialog/modal.ts +111 -0
  50. package/components/dialog/modalSpec.js +83 -0
  51. package/components/dialog/readme.md +5 -0
  52. package/components/divider/readme.md +15 -0
  53. package/components/dropdown/_dropdown.scss +83 -0
  54. package/components/dropdown/dropdown.ts +653 -0
  55. package/components/dropdown/dropdownSpec.js +108 -0
  56. package/components/list/_collection.scss +114 -0
  57. package/components/list/_list.scss +6 -0
  58. package/components/list/list.mjs +58 -0
  59. package/components/list/list.test.mjs +16 -0
  60. package/components/loading/loading.mjs +26 -0
  61. package/components/loading/loading.test.mjs +10 -0
  62. package/components/navigation-bar/_old +582 -0
  63. package/components/navigation-bar/navigation-bar.mdx +20 -0
  64. package/components/navigation-bar/navigation-bar.stories.ts +39 -0
  65. package/components/navigation-drawer/_sidenav.scss +247 -0
  66. package/components/navigation-drawer/sidenav.ts +546 -0
  67. package/components/navigation-drawer/sidenavSpec.js +124 -0
  68. package/components/pagination/_pagination.scss +47 -0
  69. package/components/progress/_preloader.scss +416 -0
  70. package/components/radio-button/_radio-buttons.scss +112 -0
  71. package/components/radio-button/radio-buttons.mdx +28 -0
  72. package/components/radio-button/radio-buttons.stories.ts +51 -0
  73. package/components/search/autocomplete.ts +620 -0
  74. package/components/search/autocompleteSpec.js +321 -0
  75. package/components/slider/_range.scss +157 -0
  76. package/components/slider/range.ts +216 -0
  77. package/components/snackbar/_toast.scss +68 -0
  78. package/components/snackbar/toastSpec.js +132 -0
  79. package/components/snackbar/toasts.ts +312 -0
  80. package/components/switch/_switches.scss +121 -0
  81. package/components/tabs/_tabs.scss +171 -0
  82. package/components/tabs/tabs.mjs +31 -0
  83. package/components/tabs/tabs.ts +358 -0
  84. package/components/tabs/tabsSpec.js +180 -0
  85. package/components/textfield/_file-input.scss +41 -0
  86. package/components/textfield/_input-fields.scss +368 -0
  87. package/components/textfield/_select.scss +104 -0
  88. package/components/textfield/formfields.css +311 -0
  89. package/components/textfield/forms.ts +182 -0
  90. package/components/textfield/formsSpec.js +142 -0
  91. package/components/textfield/select.ts +472 -0
  92. package/components/textfield/selectSpec.js +390 -0
  93. package/components/textfield/textfield.mjs +29 -0
  94. package/components/textfield/textfield.test.mjs +10 -0
  95. package/components/timepicker/_timepicker.scss +362 -0
  96. package/components/timepicker/timepicker.ts +905 -0
  97. package/components/tooltip/_tooltip.scss +40 -0
  98. package/components/tooltip/tooltip.ts +380 -0
  99. package/components/tooltip/tooltipSpec.js +145 -0
  100. package/dist/css/materialize.colors.min.css +6 -0
  101. package/dist/css/materialize.css +7578 -6326
  102. package/dist/css/materialize.min.css +6 -13
  103. package/dist/css/materialize.min.css.map +1 -0
  104. package/dist/js/materialize.cjs.js +8410 -0
  105. package/dist/js/materialize.d.ts +2625 -0
  106. package/dist/js/materialize.js +8415 -12374
  107. package/dist/js/materialize.min.js +6 -6
  108. package/dist/js/materialize.mjs +8382 -0
  109. package/package.json +82 -47
  110. package/sass/_colors.scss +417 -0
  111. package/sass/_global.scss +490 -0
  112. package/sass/_grid.scss +172 -0
  113. package/sass/_table_of_contents.scss +28 -0
  114. package/sass/_tapTarget.scss +102 -0
  115. package/sass/_typography.scss +58 -0
  116. package/sass/_variables.scss +56 -0
  117. package/sass/materialize.scss +51 -0
  118. package/sass/mixins.module.scss +168 -0
  119. package/extras/noUiSlider/nouislider.css +0 -406
  120. package/extras/noUiSlider/nouislider.js +0 -2147
  121. package/extras/noUiSlider/nouislider.min.js +0 -1
  122. package/js/anime.min.js +0 -34
  123. package/js/autocomplete.js +0 -448
  124. package/js/buttons.js +0 -354
  125. package/js/cards.js +0 -40
  126. package/js/carousel.js +0 -717
  127. package/js/cash.js +0 -960
  128. package/js/characterCounter.js +0 -136
  129. package/js/chips.js +0 -481
  130. package/js/collapsible.js +0 -275
  131. package/js/component.js +0 -44
  132. package/js/datepicker.js +0 -975
  133. package/js/dropdown.js +0 -635
  134. package/js/forms.js +0 -275
  135. package/js/global.js +0 -444
  136. package/js/materialbox.js +0 -453
  137. package/js/modal.js +0 -382
  138. package/js/parallax.js +0 -138
  139. package/js/pushpin.js +0 -148
  140. package/js/range.js +0 -263
  141. package/js/scrollspy.js +0 -295
  142. package/js/select.js +0 -450
  143. package/js/sidenav.js +0 -580
  144. package/js/slider.js +0 -359
  145. package/js/tabs.js +0 -402
  146. package/js/tapTarget.js +0 -314
  147. package/js/timepicker.js +0 -647
  148. package/js/toasts.js +0 -310
  149. package/js/tooltip.js +0 -303
  150. package/js/waves.js +0 -335
@@ -0,0 +1,47 @@
1
+ @use '../../sass/variables' as *;
2
+ @use '../../sass/mixins.module.scss' as *;
3
+
4
+ .pagination {
5
+ li {
6
+ display: inline-block;
7
+ vertical-align: top;
8
+
9
+ a {
10
+ @include btn($height: 2rem, $padding-left: .66rem, $padding-right: .66rem, $font-size: 1.2rem);
11
+ }
12
+
13
+ &.active a {
14
+ @include btn-filled;
15
+ }
16
+
17
+ &.disabled a {
18
+ @include btn-disabled;
19
+ }
20
+
21
+ i {
22
+ font-size: 2rem;
23
+ }
24
+ }
25
+
26
+ li.pages ul li {
27
+ display: inline-block;
28
+ float: none;
29
+ }
30
+ }
31
+
32
+ @media #{$medium-and-down} {
33
+ .pagination {
34
+ width: 100%;
35
+
36
+ li.prev,
37
+ li.next {
38
+ width: 10%;
39
+ }
40
+
41
+ li.pages {
42
+ width: 80%;
43
+ overflow: hidden;
44
+ white-space: nowrap;
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,416 @@
1
+ @use '../../sass/variables' as *;
2
+
3
+ .progress {
4
+ position: relative;
5
+ height: 4px;
6
+ display: block;
7
+ width: 100%;
8
+ background-color: var(--md-sys-color-surface-variant);
9
+ border-radius: 4px;
10
+ margin: $element-top-margin 0 $element-bottom-margin 0;
11
+ overflow: hidden;
12
+ background-color: var(--md-sys-color-secondary-container);
13
+
14
+ .determinate {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ bottom: 0;
19
+ background-color: var(--md-sys-color-primary);
20
+ transition: width .3s linear;
21
+ }
22
+
23
+ .indeterminate {
24
+ background-color: var(--md-sys-color-primary);
25
+
26
+ &:before {
27
+ content: '';
28
+ position: absolute;
29
+ background-color: inherit;
30
+ top: 0;
31
+ left: 0;
32
+ bottom: 0;
33
+ will-change: left, right;
34
+ // Custom bezier
35
+ animation: indeterminate 2.1s cubic-bezier(0.650, 0.815, 0.735, 0.395) infinite;
36
+
37
+ }
38
+
39
+ &:after {
40
+ content: '';
41
+ position: absolute;
42
+ background-color: inherit;
43
+ top: 0;
44
+ left: 0;
45
+ bottom: 0;
46
+ will-change: left, right;
47
+ // Custom bezier
48
+ animation: indeterminate-short 2.1s cubic-bezier(0.165, 0.840, 0.440, 1.000) infinite;
49
+ animation-delay: 1.15s;
50
+ }
51
+ }
52
+ }
53
+
54
+ @keyframes indeterminate {
55
+ 0% {
56
+ left: -35%;
57
+ right: 100%;
58
+ }
59
+ 60% {
60
+ left: 100%;
61
+ right: -90%;
62
+ }
63
+ 100% {
64
+ left: 100%;
65
+ right: -90%;
66
+ }
67
+ }
68
+
69
+ @keyframes indeterminate-short {
70
+ 0% {
71
+ left: -200%;
72
+ right: 100%;
73
+ }
74
+ 60% {
75
+ left: 107%;
76
+ right: -8%;
77
+ }
78
+ 100% {
79
+ left: 107%;
80
+ right: -8%;
81
+ }
82
+ }
83
+
84
+ /*
85
+ @license
86
+ Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
87
+ This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
88
+ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
89
+ The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
90
+ Code distributed by Google as part of the polymer project is also
91
+ subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
92
+ */
93
+
94
+ /**************************/
95
+ /* STYLES FOR THE SPINNER */
96
+ /**************************/
97
+
98
+ /*
99
+ * Constants:
100
+ * STROKEWIDTH = 3px
101
+ * ARCSIZE = 270 degrees (amount of circle the arc takes up)
102
+ * ARCTIME = 1333ms (time it takes to expand and contract arc)
103
+ * ARCSTARTROT = 216 degrees (how much the start location of the arc
104
+ * should rotate each time, 216 gives us a
105
+ * 5 pointed star shape (it's 360/5 * 3).
106
+ * For a 7 pointed star, we might do
107
+ * 360/7 * 3 = 154.286)
108
+ * CONTAINERWIDTH = 28px
109
+ * SHRINK_TIME = 400ms
110
+ */
111
+
112
+ .preloader-wrapper {
113
+ display: inline-block;
114
+ position: relative;
115
+ width: 50px;
116
+ height: 50px;
117
+
118
+ &.small {
119
+ width: 36px;
120
+ height: 36px;
121
+ }
122
+
123
+ &.big {
124
+ width: 64px;
125
+ height: 64px;
126
+ }
127
+
128
+ &.active {
129
+ /* duration: 360 * ARCTIME / (ARCSTARTROT + (360-ARCSIZE)) */
130
+ -webkit-animation: container-rotate 1568ms linear infinite;
131
+ animation: container-rotate 1568ms linear infinite;
132
+ }
133
+ }
134
+
135
+ @-webkit-keyframes container-rotate {
136
+ to { -webkit-transform: rotate(360deg) }
137
+ }
138
+
139
+ @keyframes container-rotate {
140
+ to { transform: rotate(360deg) }
141
+ }
142
+
143
+ .spinner-layer {
144
+ position: absolute;
145
+ width: 100%;
146
+ height: 100%;
147
+ opacity: 0;
148
+ border-color: var(--md-sys-color-primary);
149
+ }
150
+
151
+ .spinner-blue,
152
+ .spinner-blue-only {
153
+ border-color: #4285f4;
154
+ }
155
+
156
+ .spinner-red,
157
+ .spinner-red-only {
158
+ border-color: #db4437;
159
+ }
160
+
161
+ .spinner-yellow,
162
+ .spinner-yellow-only {
163
+ border-color: #f4b400;
164
+ }
165
+
166
+ .spinner-green,
167
+ .spinner-green-only {
168
+ border-color: #0f9d58;
169
+ }
170
+
171
+ /**
172
+ * IMPORTANT NOTE ABOUT CSS ANIMATION PROPERTIES (keanulee):
173
+ *
174
+ * iOS Safari (tested on iOS 8.1) does not handle animation-delay very well - it doesn't
175
+ * guarantee that the animation will start _exactly_ after that value. So we avoid using
176
+ * animation-delay and instead set custom keyframes for each color (as redundant as it
177
+ * seems).
178
+ *
179
+ * We write out each animation in full (instead of separating animation-name,
180
+ * animation-duration, etc.) because under the polyfill, Safari does not recognize those
181
+ * specific properties properly, treats them as -webkit-animation, and overrides the
182
+ * other animation rules. See https://github.com/Polymer/platform/issues/53.
183
+ */
184
+ .active .spinner-layer.spinner-blue {
185
+ /* durations: 4 * ARCTIME */
186
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
187
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, blue-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
188
+ }
189
+
190
+ .active .spinner-layer.spinner-red {
191
+ /* durations: 4 * ARCTIME */
192
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
193
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, red-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
194
+ }
195
+
196
+ .active .spinner-layer.spinner-yellow {
197
+ /* durations: 4 * ARCTIME */
198
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
199
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, yellow-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
200
+ }
201
+
202
+ .active .spinner-layer.spinner-green {
203
+ /* durations: 4 * ARCTIME */
204
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
205
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both, green-fade-in-out 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
206
+ }
207
+
208
+ .active .spinner-layer,
209
+ .active .spinner-layer.spinner-blue-only,
210
+ .active .spinner-layer.spinner-red-only,
211
+ .active .spinner-layer.spinner-yellow-only,
212
+ .active .spinner-layer.spinner-green-only {
213
+ /* durations: 4 * ARCTIME */
214
+ opacity: 1;
215
+ -webkit-animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
216
+ animation: fill-unfill-rotate 5332ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
217
+ }
218
+
219
+ @-webkit-keyframes fill-unfill-rotate {
220
+ 12.5% { -webkit-transform: rotate(135deg); } /* 0.5 * ARCSIZE */
221
+ 25% { -webkit-transform: rotate(270deg); } /* 1 * ARCSIZE */
222
+ 37.5% { -webkit-transform: rotate(405deg); } /* 1.5 * ARCSIZE */
223
+ 50% { -webkit-transform: rotate(540deg); } /* 2 * ARCSIZE */
224
+ 62.5% { -webkit-transform: rotate(675deg); } /* 2.5 * ARCSIZE */
225
+ 75% { -webkit-transform: rotate(810deg); } /* 3 * ARCSIZE */
226
+ 87.5% { -webkit-transform: rotate(945deg); } /* 3.5 * ARCSIZE */
227
+ to { -webkit-transform: rotate(1080deg); } /* 4 * ARCSIZE */
228
+ }
229
+
230
+ @keyframes fill-unfill-rotate {
231
+ 12.5% { transform: rotate(135deg); } /* 0.5 * ARCSIZE */
232
+ 25% { transform: rotate(270deg); } /* 1 * ARCSIZE */
233
+ 37.5% { transform: rotate(405deg); } /* 1.5 * ARCSIZE */
234
+ 50% { transform: rotate(540deg); } /* 2 * ARCSIZE */
235
+ 62.5% { transform: rotate(675deg); } /* 2.5 * ARCSIZE */
236
+ 75% { transform: rotate(810deg); } /* 3 * ARCSIZE */
237
+ 87.5% { transform: rotate(945deg); } /* 3.5 * ARCSIZE */
238
+ to { transform: rotate(1080deg); } /* 4 * ARCSIZE */
239
+ }
240
+
241
+ @-webkit-keyframes blue-fade-in-out {
242
+ from { opacity: 1; }
243
+ 25% { opacity: 1; }
244
+ 26% { opacity: 0; }
245
+ 89% { opacity: 0; }
246
+ 90% { opacity: 1; }
247
+ 100% { opacity: 1; }
248
+ }
249
+
250
+ @keyframes blue-fade-in-out {
251
+ from { opacity: 1; }
252
+ 25% { opacity: 1; }
253
+ 26% { opacity: 0; }
254
+ 89% { opacity: 0; }
255
+ 90% { opacity: 1; }
256
+ 100% { opacity: 1; }
257
+ }
258
+
259
+ @-webkit-keyframes red-fade-in-out {
260
+ from { opacity: 0; }
261
+ 15% { opacity: 0; }
262
+ 25% { opacity: 1; }
263
+ 50% { opacity: 1; }
264
+ 51% { opacity: 0; }
265
+ }
266
+
267
+ @keyframes red-fade-in-out {
268
+ from { opacity: 0; }
269
+ 15% { opacity: 0; }
270
+ 25% { opacity: 1; }
271
+ 50% { opacity: 1; }
272
+ 51% { opacity: 0; }
273
+ }
274
+
275
+ @-webkit-keyframes yellow-fade-in-out {
276
+ from { opacity: 0; }
277
+ 40% { opacity: 0; }
278
+ 50% { opacity: 1; }
279
+ 75% { opacity: 1; }
280
+ 76% { opacity: 0; }
281
+ }
282
+
283
+ @keyframes yellow-fade-in-out {
284
+ from { opacity: 0; }
285
+ 40% { opacity: 0; }
286
+ 50% { opacity: 1; }
287
+ 75% { opacity: 1; }
288
+ 76% { opacity: 0; }
289
+ }
290
+
291
+ @-webkit-keyframes green-fade-in-out {
292
+ from { opacity: 0; }
293
+ 65% { opacity: 0; }
294
+ 75% { opacity: 1; }
295
+ 90% { opacity: 1; }
296
+ 100% { opacity: 0; }
297
+ }
298
+
299
+ @keyframes green-fade-in-out {
300
+ from { opacity: 0; }
301
+ 65% { opacity: 0; }
302
+ 75% { opacity: 1; }
303
+ 90% { opacity: 1; }
304
+ 100% { opacity: 0; }
305
+ }
306
+
307
+ /**
308
+ * Patch the gap that appear between the two adjacent div.circle-clipper while the
309
+ * spinner is rotating (appears on Chrome 38, Safari 7.1, and IE 11).
310
+ */
311
+ .gap-patch {
312
+ position: absolute;
313
+ top: 0;
314
+ left: 45%;
315
+ width: 10%;
316
+ height: 100%;
317
+ overflow: hidden;
318
+ border-color: inherit;
319
+ }
320
+
321
+ .gap-patch .circle {
322
+ width: 1000%;
323
+ left: -450%;
324
+ }
325
+
326
+ .circle-clipper {
327
+ display: inline-block;
328
+ position: relative;
329
+ width: 50%;
330
+ height: 100%;
331
+ overflow: hidden;
332
+ border-color: inherit;
333
+
334
+ .circle {
335
+ width: 200%;
336
+ height: 100%;
337
+ border-width: 3px; /* STROKEWIDTH */
338
+ border-style: solid;
339
+ border-color: inherit;
340
+ border-bottom-color: transparent !important;
341
+ border-radius: 50%;
342
+ -webkit-animation: none;
343
+ animation: none;
344
+ position: absolute;
345
+ top: 0;
346
+ right: 0;
347
+ bottom: 0;
348
+ }
349
+
350
+ &.left .circle {
351
+ left: 0;
352
+ border-right-color: transparent !important;
353
+ -webkit-transform: rotate(129deg);
354
+ transform: rotate(129deg);
355
+ }
356
+ &.right .circle {
357
+ left: -100%;
358
+ border-left-color: transparent !important;
359
+ -webkit-transform: rotate(-129deg);
360
+ transform: rotate(-129deg);
361
+ }
362
+ }
363
+
364
+
365
+
366
+ .active .circle-clipper.left .circle {
367
+ /* duration: ARCTIME */
368
+ -webkit-animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
369
+ animation: left-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
370
+ }
371
+
372
+ .active .circle-clipper.right .circle {
373
+ /* duration: ARCTIME */
374
+ -webkit-animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
375
+ animation: right-spin 1333ms cubic-bezier(0.4, 0.0, 0.2, 1) infinite both;
376
+ }
377
+
378
+ @-webkit-keyframes left-spin {
379
+ from { -webkit-transform: rotate(130deg); }
380
+ 50% { -webkit-transform: rotate(-5deg); }
381
+ to { -webkit-transform: rotate(130deg); }
382
+ }
383
+
384
+ @keyframes left-spin {
385
+ from { transform: rotate(130deg); }
386
+ 50% { transform: rotate(-5deg); }
387
+ to { transform: rotate(130deg); }
388
+ }
389
+
390
+ @-webkit-keyframes right-spin {
391
+ from { -webkit-transform: rotate(-130deg); }
392
+ 50% { -webkit-transform: rotate(5deg); }
393
+ to { -webkit-transform: rotate(-130deg); }
394
+ }
395
+
396
+ @keyframes right-spin {
397
+ from { transform: rotate(-130deg); }
398
+ 50% { transform: rotate(5deg); }
399
+ to { transform: rotate(-130deg); }
400
+ }
401
+
402
+ #spinnerContainer.cooldown {
403
+ /* duration: SHRINK_TIME */
404
+ -webkit-animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
405
+ animation: container-rotate 1568ms linear infinite, fade-out 400ms cubic-bezier(0.4, 0.0, 0.2, 1);
406
+ }
407
+
408
+ @-webkit-keyframes fade-out {
409
+ from { opacity: 1; }
410
+ to { opacity: 0; }
411
+ }
412
+
413
+ @keyframes fade-out {
414
+ from { opacity: 1; }
415
+ to { opacity: 0; }
416
+ }
@@ -0,0 +1,112 @@
1
+ // Remove default Radio Buttons
2
+ [type="radio"]:not(:checked),
3
+ [type="radio"]:checked {
4
+ position: absolute;
5
+ opacity: 0;
6
+ pointer-events: none;
7
+ }
8
+
9
+ [type="radio"]:not(:checked) + span,
10
+ [type="radio"]:checked + span {
11
+ position: relative;
12
+ padding-left: 35px;
13
+ cursor: pointer;
14
+ display: inline-block;
15
+ height: 25px;
16
+ line-height: 25px;
17
+ font-size: 1rem;
18
+ transition: .28s ease;
19
+ user-select: none;
20
+ }
21
+
22
+ [type="radio"] + span:before,
23
+ [type="radio"] + span:after {
24
+ content: '';
25
+ position: absolute;
26
+ left: 0;
27
+ top: 0;
28
+ margin: 4px;
29
+ width: 16px;
30
+ height: 16px;
31
+ z-index: 0;
32
+ transition: .28s ease;
33
+ }
34
+
35
+ /* Unchecked styles */
36
+ [type="radio"]:not(:checked) + span:before,
37
+ [type="radio"]:not(:checked) + span:after,
38
+ [type="radio"]:checked + span:before,
39
+ [type="radio"]:checked + span:after,
40
+ [type="radio"].with-gap:checked + span:before,
41
+ [type="radio"].with-gap:checked + span:after {
42
+ border-radius: 50%;
43
+ }
44
+
45
+ [type="radio"]:not(:checked) + span:before,
46
+ [type="radio"]:not(:checked) + span:after {
47
+ border: 2px solid var(--md-sys-color-on-surface-variant);
48
+ }
49
+
50
+ [type="radio"]:not(:checked) + span:after {
51
+ transform: scale(0);
52
+ }
53
+
54
+ /* Checked styles */
55
+ [type="radio"]:checked + span:before {
56
+ border: 2px solid transparent;
57
+ }
58
+
59
+ [type="radio"]:checked + span:after,
60
+ [type="radio"].with-gap:checked + span:before,
61
+ [type="radio"].with-gap:checked + span:after {
62
+ border: 2px solid var(--md-sys-color-primary);
63
+ }
64
+
65
+ [type="radio"]:checked + span:after,
66
+ [type="radio"].with-gap:checked + span:after {
67
+ background-color: var(--md-sys-color-primary);
68
+ }
69
+
70
+ [type="radio"]:checked + span:after {
71
+ transform: scale(1.02);
72
+ }
73
+
74
+ /* Radio With gap */
75
+ [type="radio"].with-gap:checked + span:after {
76
+ transform: scale(.5);
77
+ }
78
+
79
+ /* Focused styles */
80
+ [type="radio"].tabbed:focus + span:before {
81
+ box-shadow: 0 0 0 10px color-mix(in srgb, transparent, var(--md-sys-color-primary) 18%);
82
+ }
83
+
84
+ /* Disabled Radio With gap */
85
+ [type="radio"].with-gap:disabled:checked + span:before {
86
+ border: 2px solid color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
87
+ }
88
+
89
+ [type="radio"].with-gap:disabled:checked + span:after {
90
+ border: none;
91
+ background-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
92
+ }
93
+
94
+ /* Disabled style */
95
+ [type="radio"]:disabled:not(:checked) + span:before,
96
+ [type="radio"]:disabled:checked + span:before {
97
+ background-color: transparent;
98
+ border-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
99
+ }
100
+
101
+ [type="radio"]:disabled + span {
102
+ color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
103
+ }
104
+
105
+ [type="radio"]:disabled:not(:checked) + span:before {
106
+ border-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
107
+ }
108
+
109
+ [type="radio"]:disabled:checked + span:after {
110
+ background-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
111
+ border-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 38%);
112
+ }
@@ -0,0 +1,28 @@
1
+ import {Story, Meta, Source, Controls, Markdown, Primary} from '@storybook/addon-docs/blocks';
2
+
3
+ import * as stories from './radio-buttons.stories';
4
+
5
+ <Meta of={stories}/>
6
+
7
+ # Radio Buttons
8
+
9
+ Radio Buttons are used when the user must make only one selection out of a group of items.
10
+ The `for` attribute is necessary to bind our custom radio button with the input.
11
+ Add the input's `id` as the value of the `for` attribute of the label.
12
+
13
+
14
+ Add radio buttons to a group by adding the name attribute along with the same corresponding value
15
+ for each of the radio buttons in the group. Create disabled radio buttons by adding the disabled attribute as shown below.
16
+
17
+ ## Default
18
+
19
+ <Story of={stories.Default} />
20
+ <Source of={stories.Default} />
21
+
22
+ ## With Gap
23
+
24
+ To create a radio button with a gap, add `class="with-gap"` to your input. See the example below.
25
+
26
+ <Story of={stories.WithGap} />
27
+ <Source of={stories.WithGap} />
28
+
@@ -0,0 +1,51 @@
1
+ import type { Meta, StoryObj } from '@storybook/html-vite';
2
+
3
+ export default {
4
+ title: 'Components/RadioButtons'
5
+ } satisfies Meta;
6
+
7
+ export const Default: StoryObj = {
8
+ render() {
9
+ return `
10
+ <form action="#">
11
+ <p>
12
+ <label>
13
+ <input name="group1" type="radio" checked />
14
+ <span>Red</span>
15
+ </label>
16
+ </p>
17
+ <p>
18
+ <label>
19
+ <input name="group1" type="radio" />
20
+ <span>Yellow</span>
21
+ </label>
22
+ </p>
23
+ <p>
24
+ <label>
25
+ <input class="with-gap" name="group1" type="radio" />
26
+ <span>Green</span>
27
+ </label>
28
+ </p>
29
+ <p>
30
+ <label>
31
+ <input name="group1" type="radio" disabled="disabled" />
32
+ <span>Brown</span>
33
+ </label>
34
+ </p>
35
+ </form>
36
+ `;
37
+ }
38
+ };
39
+
40
+ export const WithGap: StoryObj = {
41
+ render() {
42
+ return `
43
+ <p>
44
+ <label>
45
+ <input class="with-gap" name="group3" type="radio" checked />
46
+ <span>Red</span>
47
+ </label>
48
+ </p>
49
+ `;
50
+ }
51
+ };