@shortfuse/materialdesignweb 0.7.1-0 → 0.7.1-2

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 (138) hide show
  1. package/bin/generate-css.js +1 -2
  2. package/components/Badge.js +40 -3
  3. package/components/Body.js +16 -2
  4. package/components/BottomAppBar.js +25 -2
  5. package/components/Box.js +33 -3
  6. package/components/Button.js +146 -9
  7. package/components/Card.js +111 -3
  8. package/components/Checkbox.js +91 -3
  9. package/components/CheckboxIcon.js +92 -4
  10. package/components/Chip.js +38 -2
  11. package/components/Dialog.js +237 -3
  12. package/components/DialogActions.js +3 -2
  13. package/components/Divider.js +44 -3
  14. package/components/ExtendedFab.js +27 -2
  15. package/components/Fab.js +26 -2
  16. package/components/FilterChip.js +83 -2
  17. package/components/Headline.js +16 -2
  18. package/components/Icon.js +80 -4
  19. package/components/IconButton.js +153 -2
  20. package/components/Label.js +16 -2
  21. package/components/Layout.js +21 -3
  22. package/components/List.js +15 -2
  23. package/components/ListItem.js +229 -3
  24. package/components/ListOption.js +37 -3
  25. package/components/ListSelect.js +12 -2
  26. package/components/Menu.js +173 -3
  27. package/components/MenuItem.js +55 -2
  28. package/components/Nav.js +19 -2
  29. package/components/NavBar.js +37 -2
  30. package/components/NavBarItem.js +44 -2
  31. package/components/NavDrawer.js +34 -2
  32. package/components/NavDrawerItem.js +44 -2
  33. package/components/NavItem.js +183 -3
  34. package/components/NavRail.js +50 -2
  35. package/components/NavRailItem.js +25 -2
  36. package/components/Pane.js +263 -3
  37. package/components/Progress.js +469 -10
  38. package/components/Radio.js +97 -3
  39. package/components/RadioIcon.js +77 -5
  40. package/components/Ripple.js +76 -3
  41. package/components/SegmentedButton.js +97 -2
  42. package/components/SegmentedButtonGroup.js +15 -2
  43. package/components/Select.js +54 -2
  44. package/components/Shape.js +55 -18
  45. package/components/Slider.js +309 -3
  46. package/components/Snackbar.js +82 -2
  47. package/components/Surface.js +13 -4
  48. package/components/Switch.js +67 -4
  49. package/components/SwitchIcon.js +272 -5
  50. package/components/Tab.js +87 -3
  51. package/components/TabContent.js +21 -21
  52. package/components/TabList.js +131 -2
  53. package/components/TextArea.js +97 -3
  54. package/components/Title.js +16 -2
  55. package/components/Tooltip.js +42 -2
  56. package/components/TopAppBar.js +212 -3
  57. package/core/template.js +36 -9
  58. package/mixins/ControlMixin.js +65 -2
  59. package/mixins/DensityMixin.js +17 -3
  60. package/mixins/FlexableMixin.js +81 -3
  61. package/mixins/RippleMixin.js +15 -4
  62. package/mixins/ShapeMixin.js +279 -8
  63. package/mixins/StateMixin.js +87 -5
  64. package/mixins/SurfaceMixin.js +152 -3
  65. package/mixins/TextFieldMixin.js +661 -3
  66. package/mixins/ThemableMixin.js +206 -3
  67. package/mixins/TooltipTriggerMixin.js +30 -4
  68. package/mixins/TouchTargetMixin.js +29 -4
  69. package/package.json +2 -1
  70. package/theming/loader.js +0 -2
  71. package/components/Badge.css +0 -38
  72. package/components/Body.css +0 -14
  73. package/components/BottomAppBar.css +0 -23
  74. package/components/Box.css +0 -31
  75. package/components/Button.css +0 -147
  76. package/components/Card.css +0 -109
  77. package/components/Checkbox.css +0 -89
  78. package/components/CheckboxIcon.css +0 -90
  79. package/components/Chip.css +0 -35
  80. package/components/Dialog.css +0 -235
  81. package/components/Divider.css +0 -41
  82. package/components/ExtendedFab.css +0 -24
  83. package/components/Fab.css +0 -23
  84. package/components/FilterChip.css +0 -80
  85. package/components/Headline.css +0 -14
  86. package/components/Icon.css +0 -76
  87. package/components/IconButton.css +0 -150
  88. package/components/Label.css +0 -14
  89. package/components/Layout.css +0 -19
  90. package/components/List.css +0 -12
  91. package/components/ListItem.css +0 -224
  92. package/components/ListOption.css +0 -34
  93. package/components/ListSelect.css +0 -9
  94. package/components/Menu.css +0 -171
  95. package/components/MenuItem.css +0 -53
  96. package/components/Nav.css +0 -17
  97. package/components/NavBar.css +0 -34
  98. package/components/NavBarItem.css +0 -41
  99. package/components/NavDrawer.css +0 -31
  100. package/components/NavDrawerItem.css +0 -42
  101. package/components/NavItem.css +0 -181
  102. package/components/NavRail.css +0 -47
  103. package/components/NavRailItem.css +0 -25
  104. package/components/Outline.css +0 -138
  105. package/components/Pane.css +0 -261
  106. package/components/Progress.css +0 -75
  107. package/components/ProgressCircle.css +0 -226
  108. package/components/ProgressLine.css +0 -155
  109. package/components/Radio.css +0 -95
  110. package/components/RadioIcon.css +0 -73
  111. package/components/Ripple.css +0 -74
  112. package/components/SegmentedButton.css +0 -94
  113. package/components/SegmentedButtonGroup.css +0 -12
  114. package/components/Select.css +0 -52
  115. package/components/Shape.css +0 -132
  116. package/components/Slider.css +0 -307
  117. package/components/Snackbar.css +0 -80
  118. package/components/Surface.css +0 -10
  119. package/components/Switch.css +0 -64
  120. package/components/SwitchIcon.css +0 -178
  121. package/components/SwitchIconAnimations.css +0 -89
  122. package/components/Tab.css +0 -85
  123. package/components/TabList.css +0 -129
  124. package/components/TextArea.css +0 -93
  125. package/components/Title.css +0 -14
  126. package/components/Tooltip.css +0 -40
  127. package/components/TopAppBar.css +0 -209
  128. package/mixins/ControlMixin.css +0 -57
  129. package/mixins/DensityMixin.css +0 -40
  130. package/mixins/FlexableMixin.css +0 -79
  131. package/mixins/RippleMixin.css +0 -12
  132. package/mixins/ShapeMixin.css +0 -135
  133. package/mixins/StateMixin.css +0 -82
  134. package/mixins/SurfaceMixin.css +0 -150
  135. package/mixins/TextFieldMixin.css +0 -657
  136. package/mixins/ThemableMixin.css +0 -204
  137. package/mixins/TooltipTriggerMixin.css +0 -27
  138. package/mixins/TouchTargetMixin.css +0 -26
@@ -1,261 +0,0 @@
1
- /* https://m2.material.io/design/layout/responsive-layout-grid.html#columns-gutters-and-margins */
2
-
3
- /*
4
- * Window breakpoints
5
- * Compact (0 <= width < 600px):
6
- * * Single: 100vw - padding
7
- * * Padding: 16px
8
- * * Spacer: 0 (none)
9
- * Medium (600px <= width < 840px)
10
- * * Single: 100vw - padding - (?navrail)
11
- * * [Fixed]: 360px
12
- * * [Flexable]: 100vw - 360px - spacer - padding
13
- * * [Split] 50vw - ((padding + spacer) / 2)
14
- * * Padding: 24px
15
- * * Spacer: 24px
16
- * Expanded (840px <= width)
17
- * * Single: 100vw - padding - (?navrail | ?navdrawer)
18
- * * [Fixed] 360px
19
- * * [Flexable] 100vw - 360px - spacer - padding - (?navrail | ?navdrawer)
20
- * * [Split] 50vw - ((padding + spacer + (?navrail | ?navdrawer)) / 2)
21
- * * Padding: 24px
22
- * * Spacer: 24px
23
- *
24
- * | Screen size | Margin | Body | Layout columns |
25
- * |---------------------|---------|---------|----------------|
26
- * | Extra-small (phone) | | | |
27
- * | 0-631dp | 16dp | Scaling | 4 |
28
- * | 632 - 647 | Scaling | 600dp | 8 |
29
- * | Small (tablet) | | | |
30
- * | 648-887 | 24dp | Scaling | 8 |
31
- * | 888-1239 | Scaling | 840dp | 12 |
32
- * | Medium (laptop) | | | |
33
- * | 1240-1439 | 200dp | Scaling | 12 |
34
- * | Large (desktop) | | | |
35
- * | 1440+ | Scaling | 1040 | 12 |
36
- *
37
- *
38
- * Column count is pane-based, not window based requiring newly computed values.
39
- * Gutters are irrelevant to pane sizing.
40
- * Nav Rail is ~80px.
41
- * Nav Drawer is ~360px.
42
- * Padding and spacers are set by pane's parent.
43
- * Avoid using CSS Variables because panes are at top of document tree. https://bugs.chromium.org/p/chromium/issues/detail?id=1056209
44
- * Container queries would reduce code considerably.
45
- */
46
-
47
- /* Compact */
48
- :host {
49
- display: grid;
50
- align-content: flex-start;
51
- gap: 16px;
52
- grid-auto-flow: row;
53
- grid-template-columns: repeat(4, 1fr);
54
-
55
- max-inline-size: 600px;
56
-
57
- flex: 1;
58
-
59
- transition-duration: 200ms;
60
- /* stylelint-disable-next-line liberty/use-logical-spec */
61
- transition-property: visibility, width, max-inline-size;
62
- }
63
-
64
- /* Will set 8col when window is 600px + padding (2x16) */
65
- /* Will set 12col when window is 840px + padding (2x24) */
66
- @media screen and (min-width: 632px) { :host { grid-template-columns: repeat(8, 1fr); } }
67
- @media screen and (min-width: 888px) { :host { grid-template-columns: repeat(12, 1fr); } }
68
-
69
- /* Will cap to 840px when window is 600px + padding (2x24px) */
70
- /* Will cap to 1040px when window is 840px + padding (2x200px) */
71
- @media screen and (min-width: 648px) { :host { max-inline-size: 840px } }
72
- @media screen and (min-width: 1240px) { :host { max-inline-size: 1040px; } }
73
-
74
- /* NAVRAIL */
75
-
76
- :host([nav-rail]) {
77
- grid-template-columns: repeat(4, 1fr);
78
-
79
- max-inline-size: 600px;
80
- }
81
-
82
- /* Will set 8col when window is 600px + padding (2x24) + navrail (80) */
83
- /* Will set 12col when window is 840px + padding (2x24) + navrail (80) */
84
- @media screen and (min-width: 728px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }
85
- @media screen and (min-width: 968px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }
86
-
87
- /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (80) */
88
- /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (80) */
89
- @media screen and (min-width: 728px) { :host([nav-rail]) { max-inline-size: 840px } }
90
- @media screen and (min-width: 1320px) { :host([nav-rail]) { max-inline-size: 1040px; } }
91
-
92
- /* NAVDRAWER */
93
-
94
- :host([nav-drawer]) {
95
- grid-template-columns: repeat(4, 1fr);
96
-
97
- max-inline-size: 600px;
98
- }
99
-
100
- /* Will set 8col when window is 600px + padding (2x24) + navdrawer (360) */
101
- /* Will set 12col when window is 840px + padding (2x24) + navdrawer (360) */
102
- @media screen and (min-width: 1008px) { :host([nav-rail]) { grid-template-columns: repeat(8, 1fr); } }
103
- @media screen and (min-width: 1248px) { :host([nav-rail]) { grid-template-columns: repeat(12, 1fr); } }
104
-
105
- /* Will cap to 840px when window is 600px + padding (2x24px) + navrail (360) */
106
- /* Will cap to 1040px when window is 840px + padding (2x200px) + navrail (360) */
107
- @media screen and (min-width: 1008px) { :host([nav-rail]) { max-inline-size: 840px } }
108
- @media screen and (min-width: 1600px) { :host([nav-rail]) { max-inline-size: 1040px; } }
109
-
110
- /* FLEXIBLE */
111
-
112
- :host([flexible]) {
113
- grid-template-columns: repeat(4, 1fr);
114
-
115
- max-inline-size: 600px;
116
- }
117
-
118
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) */
119
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) */
120
- @media screen and (min-width: 1032px) { :host([flexible]) { grid-template-columns: repeat(8, 1fr); } }
121
- @media screen and (min-width: 1272px) { :host([flexible]) { grid-template-columns: repeat(12, 1fr); } }
122
-
123
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) */
124
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) */
125
- @media screen and (min-width: 1032px) { :host([flexible]) { max-inline-size: 840px } }
126
- @media screen and (min-width: 1624px) { :host([flexible]) { max-inline-size: 1040px; } }
127
-
128
- /* FLEXIBLE + NAV RAIL */
129
-
130
- :host([flexible]:where([nav-rail])) {
131
- grid-template-columns: repeat(4, 1fr);
132
-
133
- max-inline-size: 600px;
134
- }
135
-
136
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */
137
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navrail (80) */
138
- @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }
139
- @media screen and (min-width: 1352px) { :host([flexible]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }
140
-
141
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navrail (80) */
142
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navrail (80) */
143
- @media screen and (min-width: 1112px) { :host([flexible]:where([nav-rail])) { max-inline-size: 840px } }
144
- @media screen and (min-width: 1704px) { :host([flexible]:where([nav-rail])) { max-inline-size: 1040px; } }
145
-
146
- /* FLEXIBLE + NAV DRAWER */
147
-
148
- :host([flexible]:where([nav-drawer])) {
149
- grid-template-columns: repeat(4, 1fr);
150
-
151
- max-inline-size: 600px;
152
- }
153
-
154
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */
155
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + fixed (360) + navdrawer (360) */
156
- @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }
157
- @media screen and (min-width: 1632px) { :host([flexible]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }
158
-
159
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + fixed (360) + navdrawer (360) */
160
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + fixed (360) + navdrawer (360) */
161
- @media screen and (min-width: 1392px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 840px } }
162
- @media screen and (min-width: 1984px) { :host([flexible]:where([nav-drawer])) { max-inline-size: 1040px; } }
163
-
164
- /* SPLIT */
165
-
166
- :host([split]) {
167
- grid-template-columns: repeat(4, 1fr);
168
-
169
- max-inline-size: 600px;
170
- }
171
-
172
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) */
173
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) */
174
- @media screen and (min-width: 1272px) { :host([split]) { grid-template-columns: repeat(8, 1fr); } }
175
- @media screen and (min-width: 1752px) { :host([split]) { grid-template-columns: repeat(12, 1fr); } }
176
-
177
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) */
178
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) */
179
- @media screen and (min-width: 1272px) { :host([split]) { max-inline-size: 840px } }
180
- @media screen and (min-width: 2104px) { :host([split]) { max-inline-size: 1040px; } }
181
-
182
- /* SPLIT + NAVRAIL */
183
-
184
- :host([split]:where([nav-rail])) {
185
- grid-template-columns: repeat(4, 1fr);
186
-
187
- max-inline-size: 600px;
188
- }
189
-
190
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navrail (80) */
191
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navrail (80) */
192
- @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(8, 1fr); } }
193
- @media screen and (min-width: 1832px) { :host([split]:where([nav-rail])) { grid-template-columns: repeat(12, 1fr); } }
194
-
195
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navrail (80) */
196
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navrail (80) */
197
- @media screen and (min-width: 1352px) { :host([split]:where([nav-rail])) { max-inline-size: 840px } }
198
- @media screen and (min-width: 2184px) { :host([split]:where([nav-rail])) { max-inline-size: 1040px; } }
199
-
200
- /* SPLIT + NAVDRAWER */
201
-
202
- :host([split]:where([nav-drawer])) {
203
- grid-template-columns: repeat(4, 1fr);
204
-
205
- max-inline-size: 600px;
206
- }
207
-
208
- /* Will set 8col when window is 600px + padding (2x24) + spacer (24) + split (600) + navdrawer (360) */
209
- /* Will set 12col when window is 840px + padding (2x24) + spacer (24) + split (840) + navdrawer (360) */
210
- @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(8, 1fr); } }
211
- @media screen and (min-width: 2112px) { :host([split]:where([nav-drawer])) { grid-template-columns: repeat(12, 1fr); } }
212
-
213
- /* Will cap to 840px when window is 600px + padding (2x24px) + spacer (24) + split (600) + navdrawer (360) */
214
- /* Will cap to 1040px when window is 840px + padding (2x200px) + spacer (24) + split (840) + navdrawer (360) */
215
- @media screen and (min-width: 1632px) { :host([split]:where([nav-drawer])) { max-inline-size: 840px } }
216
- @media screen and (min-width: 2464px) { :host([split]:where([nav-drawer])) { max-inline-size: 1040px; } }
217
-
218
- :host([full-width]) {
219
- max-inline-size: none;
220
- }
221
-
222
- /** FIXED **/
223
-
224
- :host([fixed]) {
225
- grid-template-columns: repeat(4, 1fr);
226
-
227
- inline-size:360px;
228
- }
229
-
230
- @media screen and (max-width: 600px) {
231
- :host(:nth-of-type(2)) {
232
- display: none;
233
- }
234
- }
235
- /* Will cap to 360px when window is 360px + padding (2x24px) + spacer (24) + 360px */
236
- @media screen and (min-width: 792px) {
237
- :host([fixed]) {
238
- max-inline-size: 360px
239
- }
240
- }
241
-
242
- #scrim {
243
- position: absolute;
244
- inset: 0;
245
-
246
- grid-area: auto;
247
- }
248
-
249
- #slot::slotted(*) { grid-column: 1 / none }
250
- #slot::slotted([colspan="1"]) { grid-column-end: span 1; }
251
- #slot::slotted([colspan="2"]) { grid-column-end: span 2; }
252
- #slot::slotted([colspan="3"]) { grid-column-end: span 3; }
253
- #slot::slotted([colspan="4"]) { grid-column-end: span 4; }
254
- #slot::slotted([colspan="5"]) { grid-column-end: span 5; }
255
- #slot::slotted([colspan="6"]) { grid-column-end: span 6; }
256
- #slot::slotted([colspan="7"]) { grid-column-end: span 7; }
257
- #slot::slotted([colspan="8"]) { grid-column-end: span 8; }
258
- #slot::slotted([colspan="9"]) { grid-column-end: span 9; }
259
- #slot::slotted([colspan="10"]) { grid-column-end: span 10; }
260
- #slot::slotted([colspan="11"]) { grid-column-end: span 11; }
261
- #slot::slotted([colspan="12"]) { grid-column-end: span 12; }
@@ -1,75 +0,0 @@
1
- /* https://m3.material.io/components/progress-indicators/specs */
2
-
3
- :host {
4
- --mdw-bg: var(--mdw-color__surface-variant);
5
- --mdw-ink: var(--mdw-color__primary);
6
- --mdw-progress__opacity__duration: 500ms;
7
- position: relative;
8
-
9
- display: inline-block;
10
- overflow: hidden;
11
- vertical-align: middle;
12
-
13
- min-block-size: 4px;
14
- inline-size: 100%;
15
-
16
- opacity: 1;
17
-
18
- background-color: rgb(var(--mdw-bg));
19
- color: rgb(var(--mdw-ink));
20
-
21
- transition: opacity 500ms 275ms;
22
- }
23
-
24
- :host([auto-hide]) {
25
- will-change: opacity;
26
- }
27
-
28
- :host([auto-hide][value="100"]) {
29
- opacity:0;
30
-
31
- transition: opacity 1s 1s;
32
- }
33
-
34
- #determinate {
35
- --previous: 0;
36
- --value: 0;
37
- }
38
-
39
- #progress {
40
- position: absolute;
41
- inset: 0;
42
-
43
- box-sizing: border-box;
44
- block-size: 100%;
45
- inline-size: 100%;
46
- border: none; /* FireFox */
47
-
48
- -moz-appearance: none;
49
- appearance: none;
50
-
51
- opacity:0;
52
- transform: scaleX(var(--value, 0));
53
- transform-origin: 0 0;
54
-
55
- background-color: currentColor;
56
- color: inherit;
57
-
58
- transition: transform 275ms, opacity var(--mdw-progress__opacity__duration);
59
- will-change: transform, opacity;
60
- }
61
-
62
- #progress::-webkit-progress-bar {
63
- display: none;
64
- }
65
-
66
- #progress::-moz-progress-bar {
67
- display: none; /* Doesn't always work */
68
-
69
- block-size: 0;
70
- }
71
-
72
- #progress[value] {
73
- opacity:1;
74
- transform: scaleX(var(--value, 0));
75
- }
@@ -1,226 +0,0 @@
1
- /** https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/CircularIndeterminateAnimatorDelegate.java */
2
-
3
- :host {
4
- --mdw-progress__circle__timing: cubic-bezier(0.4, 0.0, 0.2, 1);
5
- --mdw-progress__circle__margin: 4px;
6
- --mdw-progress__circle__duration: 5400ms;
7
- --mdw-progress__circle__duration__expand: 667ms;
8
- --mdw-progress__circle__duration__collapse: 667ms;
9
- --mdw-progress__circle__duration__fade-in: 333ms;
10
- --mdw-progress__circle__duration__complete-end: 333ms;
11
- }
12
-
13
- @media (prefers-reduced-motion) {
14
- :host {
15
- --mdw-progress__circle__duration: 54000ms;
16
- }
17
- }
18
-
19
- #circle {
20
- --startA: min(0.5, var(--previous));
21
- --endA: min(0.5, var(--value));
22
- --travelA: max(
23
- calc(var(--startA) - var(--endA)),
24
- calc(var(--endA) - var(--startA))
25
- );
26
- --delayA: max(0, calc(var(--previous) - 0.5));
27
- --startB: max(0, calc(var(--previous) - 0.5));
28
- --endB: max(0, calc(var(--value) - 0.5));
29
- --travelB: max(
30
- calc(var(--startB) - var(--endB)),
31
- calc(var(--endB) - var(--startB))
32
- );
33
- --delayB: max(0, 0.5 - calc(var(--previous)));
34
-
35
- position: absolute;
36
- inset: 0;
37
- }
38
-
39
- :host([circle]) {
40
- block-size: 48px;
41
- inline-size: 48px;
42
- }
43
-
44
- :host([circle]:not([color])) {
45
- background-color: transparent;
46
- }
47
-
48
- #progress[circle] {
49
- visibility: hidden;
50
- }
51
-
52
- .semi {
53
- position: absolute;
54
- inset: var(--mdw-progress__circle__margin);
55
-
56
- overflow: hidden;
57
-
58
- box-sizing: border-box;
59
- }
60
-
61
- #semi1 {
62
- inset-inline-start: 50%;
63
- }
64
-
65
- #semi2 {
66
- inset-inline-end: 50%;
67
- }
68
-
69
- .semi::after {
70
- content: "";
71
-
72
- position: absolute;
73
- inset: 0;
74
-
75
- box-sizing: border-box;
76
- border: solid currentcolor 4px;
77
-
78
- transform: rotate(var(--rotation));
79
-
80
- background-color: transparent;
81
- border-radius: 50%;
82
-
83
- transition: transform 400ms;
84
- transition-timing-function: linear;
85
- }
86
-
87
- #semi1::after {
88
- --rotation: min(180deg, calc(var(--value) * 360deg));
89
- inset-inline-start: -100%;
90
-
91
- clip-path: inset(0 50% 0 0);
92
-
93
- transition-delay: calc(var(--delayA) * var(--mdw-progress__circle__duration__expand));
94
- transition-duration: calc(var(--travelA) * var(--mdw-progress__circle__duration__expand));
95
- }
96
-
97
- #semi2::after {
98
- --rotation: max(0deg, calc(var(--value) * 360deg - 180deg));
99
- inset-inline-end: -100%;
100
-
101
- clip-path: inset(0 0 0 50%);
102
-
103
- transition-delay: calc(var(--delayB) * var(--mdw-progress__circle__duration__expand));
104
- transition-duration: calc(var(--travelB) * var(--mdw-progress__circle__duration__expand));
105
- }
106
-
107
- #indeterminate-circle {
108
- position: absolute;
109
- inset: 0;
110
-
111
- display: block;
112
-
113
- animation: rotate-cw calc(var(--mdw-progress__circle__duration) / 4) linear infinite;
114
- }
115
-
116
- .arc {
117
- position: absolute;
118
- inset: var(--mdw-progress__circle__margin);
119
-
120
- overflow: hidden;
121
-
122
- box-sizing: border-box;
123
-
124
- animation: rotate-jump var(--mdw-progress__circle__duration) steps(1,end) infinite;
125
- }
126
-
127
- .arc::after {
128
- content: "";
129
-
130
- position: absolute;
131
- inset: 0;
132
-
133
- box-sizing: border-box;
134
- border: solid currentcolor 4px;
135
-
136
- background-color: transparent;
137
- border-radius: 50%;
138
-
139
- animation: grow-shrink calc(var(--mdw-progress__circle__duration) / 4) var(--mdw-progress__circle__timing) infinite;
140
- }
141
-
142
- #arc2 {
143
- inset-block-end: 50%;
144
- inset-inline-start: 50%;
145
-
146
- transform-origin: 0 100%;
147
- }
148
-
149
- #arc3 {
150
- inset-block-start: 50%;
151
- inset-inline-end: 50%;
152
-
153
- transform-origin: 100% 0;
154
- }
155
-
156
- #arc4 {
157
- inset-block-start: 50%;
158
- inset-inline-start: 50%;
159
-
160
- transform-origin: 0 0;
161
- }
162
-
163
- #arc2:after {
164
- inset-block-end: -100%;
165
- inset-inline-start: -100%;
166
-
167
- clip-path: polygon(0% 0%, 50% 0%, 50% 50%, 100% 50%, 100% 100%, 0% 100%);
168
- }
169
-
170
- #arc3:after {
171
- inset-block-start: -100%;
172
- inset-inline-end: -100%;
173
-
174
- clip-path: inset(0 50% 50% 0);
175
- }
176
-
177
- #arc4:after {
178
- inset-block-start: -100%;
179
- inset-inline-start: -100%;
180
-
181
- clip-path: inset(0 50% 0 0);
182
- }
183
-
184
- @keyframes rotate-cw {
185
- from {
186
- transform: rotate(0deg);
187
- }
188
-
189
- to {
190
- transform: rotate(360deg);
191
- }
192
- }
193
-
194
- @keyframes rotate-jump {
195
- 0% { transform: scaleX(1) rotate(0deg); }
196
-
197
- 12.5% { transform: scaleX(-1) rotate(-270deg); }
198
-
199
- 25% { transform: scaleX(1) rotate(270deg); }
200
-
201
- 37.5% {transform: scaleX(-1) rotate(-180deg);}
202
-
203
- 50% { transform: scaleX(1) rotate(180deg); }
204
-
205
- 62.5% { transform: scaleX(-1) rotate(-90deg); }
206
-
207
- 75% { transform: scaleX(1) rotate(90deg); }
208
-
209
- 87.5% { transform: scaleX(-1) rotate(0deg); }
210
-
211
- to { transform: scaleX(1) rotate(0deg); }
212
- }
213
-
214
- @keyframes grow-shrink {
215
- from {
216
- transform: rotate(calc(0.01 * 360deg));
217
- }
218
-
219
- 50% {
220
- transform: rotate(calc(0.73 * 360deg));
221
- }
222
-
223
- to {
224
- transform: rotate(calc(0.01 * 360deg));
225
- }
226
- }
@@ -1,155 +0,0 @@
1
- /* https://github.com/material-components/material-components-android/blob/ed77ab36ccac98df24e55060d58406c5981a9062/lib/java/com/google/android/material/progressindicator/ */
2
-
3
- :host {
4
- --mdw-progress__line1-head__timing: cubic-bezier(0.2, 0.8, 0, 1.0);
5
- --mdw-progress__line1-tail__timing: cubic-bezier(0.4, 0.0, 1.0, 1.0);
6
- --mdw-progress__line2-head__timing: cubic-bezier(0.0, 0.65, 0, 1.0);
7
- --mdw-progress__line2-tail__timing: cubic-bezier(0.1, 0.45, 0, 1.0);
8
- --mdw-progress__line__duration: 1800ms;
9
- }
10
-
11
- @media (prefers-reduced-motion) {
12
- :host {
13
- --mdw-progress__line__duration: 18000ms
14
- }
15
- }
16
-
17
- .line {
18
- opacity: 1;
19
-
20
- transition: opacity var(--mdw-progress__opacity__duration);
21
- will-change: opacity;
22
- }
23
-
24
- .line,
25
- .line::after {
26
- position: absolute;
27
- inset: 0;
28
-
29
- overflow: hidden;
30
-
31
- animation-duration: var(--mdw-progress__line__duration);
32
- animation-timing-function: linear;
33
- animation-iteration-count: infinite;
34
- animation-fill-mode: forwards;
35
- }
36
-
37
- .line::after {
38
- content: '';
39
-
40
- background-color: currentColor;
41
-
42
- animation: inherit;
43
- will-change: transform;
44
- }
45
-
46
- #line1 {
47
- animation-name: l1h;
48
- }
49
-
50
- #line2 {
51
- animation-name: l2h;
52
- }
53
-
54
- #line1::after {
55
- animation-name: l1t;
56
- }
57
-
58
- #line2::after {
59
- animation-name: l2t;
60
- }
61
-
62
- .line[value] {
63
- opacity: 0;
64
- visibility: hidden;
65
-
66
- transition: opacity var(--mdw-progress__opacity__duration), visibility 1ms var(--mdw-progress__opacity__duration);
67
- }
68
-
69
- /**
70
- * L1H = 1267 / +533 = 70.39% - 100%
71
- * L1T = 1000 / +567 = 55.56% - 87.05%
72
- * L2H = 0333 / +850 = 18.50% - 65.72%
73
- * L2T = 0000 / +750 = 0% - 41.67%
74
- * Total = 1800ms
75
- *
76
- * t l1h l1t l2h l2t
77
- * --------------------------------------
78
- * 0.0000 0.0000 0.0000 0.0000 0.0000
79
- * 0.1850 0.0000 0.0000 0.0000 0.5899
80
- * 0.4167 0.0000 0.0000 0.7374 1.0000
81
- * 0.5556 0.0000 0.0000 0.9072 1.0000
82
- * 0.6572 0.0000 0.1544 1.0000 1.0000
83
- * 0.7039 0.0000 0.2939 1.0000 1.0000
84
- * 0.8706 0.7918 1.0000 1.0000 1.0000
85
- * 1.0000 1.0000 1.0000 1.0000 1.0000
86
- */
87
-
88
- @keyframes l1h {
89
- 0% {
90
- transform: translateX(0%);
91
- }
92
-
93
- 70.4% {
94
- transform: translateX(0%);
95
-
96
- animation-timing-function: var(--mdw-progress__line1-head__timing);
97
- }
98
-
99
- 100% {
100
- transform: translateX(100%);
101
- }
102
- }
103
- @keyframes l1t {
104
- 0% {
105
- transform: translateX(-100%);
106
- }
107
-
108
- 55.6% {
109
- transform: translateX(-100%);
110
-
111
- animation-timing-function: var(--mdw-progress__line1-tail__timing);
112
- }
113
-
114
- 87.1% {
115
- transform: translateX(0%);
116
- }
117
-
118
- 100% {
119
- transform: translateX(0%);
120
- }
121
- }
122
- @keyframes l2h {
123
- 0% {
124
- transform: translateX(0%);
125
- }
126
-
127
- 18.5% {
128
- transform: translateX(0%);
129
-
130
- animation-timing-function: var(--mdw-progress__line2-head__timing);
131
- }
132
-
133
- 65.72% {
134
- transform: translateX(100%);
135
- }
136
-
137
- to {
138
- transform: translateX(100%);
139
- }
140
- }
141
- @keyframes l2t {
142
- 0% {
143
- transform: translateX(-100%);
144
-
145
- animation-timing-function: var(--mdw-progress__line2-tail__timing);
146
- }
147
-
148
- 41.67% {
149
- transform: translateX(0%);
150
- }
151
-
152
- to {
153
- transform: translateX(0%);
154
- }
155
- }