mtrl 0.2.6 → 0.2.8

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 (226) hide show
  1. package/demo/build.ts +349 -0
  2. package/demo/index.html +110 -0
  3. package/demo/main.js +448 -0
  4. package/demo/styles.css +239 -0
  5. package/index.ts +18 -0
  6. package/package.json +14 -3
  7. package/server.ts +86 -0
  8. package/src/components/badge/api.ts +70 -63
  9. package/src/components/badge/badge.ts +16 -2
  10. package/src/components/badge/config.ts +66 -13
  11. package/src/components/badge/features.ts +51 -42
  12. package/src/components/badge/index.ts +27 -2
  13. package/src/components/badge/types.ts +62 -30
  14. package/src/components/bottom-app-bar/bottom-app-bar.ts +154 -0
  15. package/src/components/bottom-app-bar/config.ts +29 -0
  16. package/src/components/bottom-app-bar/index.ts +17 -0
  17. package/src/components/bottom-app-bar/types.ts +114 -0
  18. package/src/components/button/api.ts +5 -0
  19. package/src/components/button/button.ts +0 -1
  20. package/src/components/button/config.ts +6 -2
  21. package/src/components/button/index.ts +10 -2
  22. package/src/components/button/types.ts +20 -2
  23. package/src/components/card/card.ts +13 -25
  24. package/src/components/card/config.ts +83 -30
  25. package/src/components/card/content.ts +8 -10
  26. package/src/components/card/features.ts +4 -3
  27. package/src/components/card/index.ts +29 -2
  28. package/src/components/card/types.ts +33 -22
  29. package/src/components/checkbox/config.ts +3 -4
  30. package/src/components/checkbox/index.ts +1 -2
  31. package/src/components/checkbox/types.ts +12 -3
  32. package/src/components/chip/api.ts +170 -221
  33. package/src/components/chip/chip.ts +34 -302
  34. package/src/components/chip/config.ts +1 -2
  35. package/src/components/chip/index.ts +10 -2
  36. package/src/components/chip/types.ts +224 -35
  37. package/src/components/datepicker/api.ts +265 -0
  38. package/src/components/datepicker/config.ts +141 -0
  39. package/src/components/datepicker/datepicker.ts +341 -0
  40. package/src/components/datepicker/index.ts +12 -0
  41. package/src/components/datepicker/render.ts +450 -0
  42. package/src/components/datepicker/types.ts +397 -0
  43. package/src/components/datepicker/utils.ts +289 -0
  44. package/src/components/dialog/api.ts +55 -21
  45. package/src/components/dialog/config.ts +12 -9
  46. package/src/components/dialog/dialog.ts +6 -3
  47. package/src/components/dialog/features.ts +345 -151
  48. package/src/components/dialog/index.ts +38 -8
  49. package/src/components/dialog/types.ts +40 -14
  50. package/src/components/divider/config.ts +81 -0
  51. package/src/components/divider/divider.ts +37 -0
  52. package/src/components/divider/features.ts +207 -0
  53. package/src/components/divider/index.ts +9 -0
  54. package/src/components/divider/types.ts +55 -0
  55. package/src/components/extended-fab/api.ts +141 -0
  56. package/src/components/extended-fab/config.ts +112 -0
  57. package/src/components/extended-fab/extended-fab.ts +125 -0
  58. package/src/components/extended-fab/index.ts +9 -0
  59. package/src/components/extended-fab/types.ts +304 -0
  60. package/src/components/fab/api.ts +97 -0
  61. package/src/components/fab/config.ts +93 -0
  62. package/src/components/fab/fab.ts +67 -0
  63. package/src/components/fab/index.ts +9 -0
  64. package/src/components/fab/types.ts +251 -0
  65. package/src/components/list/config.ts +4 -5
  66. package/src/components/list/features.ts +6 -7
  67. package/src/components/list/index.ts +7 -9
  68. package/src/components/list/list-item.ts +12 -13
  69. package/src/components/list/types.ts +50 -5
  70. package/src/components/list/utils.ts +30 -3
  71. package/src/components/menu/features/items-manager.ts +9 -9
  72. package/src/components/menu/features/positioning.ts +7 -7
  73. package/src/components/menu/features/visibility.ts +7 -7
  74. package/src/components/menu/index.ts +7 -9
  75. package/src/components/menu/menu-item.ts +6 -6
  76. package/src/components/menu/menu.ts +22 -0
  77. package/src/components/menu/types.ts +29 -10
  78. package/src/components/menu/utils.ts +67 -0
  79. package/src/components/navigation/api.ts +78 -50
  80. package/src/components/navigation/config.ts +22 -10
  81. package/src/components/navigation/features/items.ts +284 -0
  82. package/src/components/navigation/index.ts +0 -6
  83. package/src/components/navigation/nav-item.ts +70 -33
  84. package/src/components/navigation/navigation.ts +53 -3
  85. package/src/components/navigation/types.ts +117 -70
  86. package/src/components/progress/api.ts +2 -3
  87. package/src/components/progress/config.ts +2 -3
  88. package/src/components/progress/index.ts +0 -1
  89. package/src/components/progress/progress.ts +1 -2
  90. package/src/components/progress/types.ts +186 -33
  91. package/src/components/radios/config.ts +1 -1
  92. package/src/components/radios/index.ts +0 -1
  93. package/src/components/radios/types.ts +0 -7
  94. package/src/components/search/api.ts +203 -0
  95. package/src/components/search/config.ts +86 -0
  96. package/src/components/search/features/index.ts +4 -0
  97. package/src/components/search/features/search.ts +717 -0
  98. package/src/components/search/features/states.ts +169 -0
  99. package/src/components/search/features/structure.ts +197 -0
  100. package/src/components/search/index.ts +7 -0
  101. package/src/components/search/search.ts +52 -0
  102. package/src/components/search/types.ts +175 -0
  103. package/src/components/segmented-button/config.ts +80 -0
  104. package/src/components/segmented-button/index.ts +4 -0
  105. package/src/components/segmented-button/segment.ts +154 -0
  106. package/src/components/segmented-button/segmented-button.ts +249 -0
  107. package/src/components/segmented-button/types.ts +254 -0
  108. package/src/components/slider/accessibility.md +5 -5
  109. package/src/components/slider/api.ts +41 -120
  110. package/src/components/slider/config.ts +51 -47
  111. package/src/components/slider/features/handlers.ts +495 -0
  112. package/src/components/slider/features/index.ts +1 -2
  113. package/src/components/slider/features/slider.ts +66 -84
  114. package/src/components/slider/features/states.ts +195 -0
  115. package/src/components/slider/features/structure.ts +136 -206
  116. package/src/components/slider/features/ui.ts +145 -206
  117. package/src/components/slider/index.ts +2 -11
  118. package/src/components/slider/slider.ts +9 -12
  119. package/src/components/slider/types.ts +67 -26
  120. package/src/components/snackbar/config.ts +2 -3
  121. package/src/components/snackbar/constants.ts +0 -32
  122. package/src/components/snackbar/index.ts +0 -1
  123. package/src/components/snackbar/position.ts +9 -1
  124. package/src/components/snackbar/types.ts +122 -46
  125. package/src/components/switch/config.ts +2 -3
  126. package/src/components/switch/index.ts +0 -1
  127. package/src/components/switch/types.ts +3 -2
  128. package/src/components/tabs/config.ts +3 -4
  129. package/src/components/tabs/features.ts +4 -2
  130. package/src/components/tabs/index.ts +0 -15
  131. package/src/components/tabs/indicator.ts +73 -13
  132. package/src/components/tabs/tab-api.ts +12 -4
  133. package/src/components/tabs/tab.ts +18 -6
  134. package/src/components/tabs/types.ts +23 -5
  135. package/src/components/textfield/config.ts +2 -3
  136. package/src/components/textfield/index.ts +0 -1
  137. package/src/components/textfield/types.ts +17 -3
  138. package/src/components/timepicker/README.md +277 -0
  139. package/src/components/timepicker/api.ts +632 -0
  140. package/src/components/timepicker/clockdial.ts +482 -0
  141. package/src/components/timepicker/config.ts +228 -0
  142. package/src/components/timepicker/index.ts +3 -0
  143. package/src/components/timepicker/render.ts +613 -0
  144. package/src/components/timepicker/timepicker.ts +117 -0
  145. package/src/components/timepicker/types.ts +336 -0
  146. package/src/components/timepicker/utils.ts +241 -0
  147. package/src/components/tooltip/api.ts +1 -1
  148. package/src/components/tooltip/config.ts +27 -6
  149. package/src/components/tooltip/index.ts +0 -1
  150. package/src/components/tooltip/types.ts +13 -3
  151. package/src/components/top-app-bar/config.ts +83 -0
  152. package/src/components/top-app-bar/index.ts +11 -0
  153. package/src/components/top-app-bar/top-app-bar.ts +316 -0
  154. package/src/components/top-app-bar/types.ts +140 -0
  155. package/src/core/build/_ripple.scss +6 -6
  156. package/src/core/build/ripple.ts +72 -95
  157. package/src/core/compose/features/icon.ts +3 -1
  158. package/src/core/compose/features/ripple.ts +4 -1
  159. package/src/core/compose/features/textlabel.ts +23 -2
  160. package/src/core/dom/create.ts +5 -0
  161. package/src/index.ts +9 -0
  162. package/src/styles/abstract/_theme.scss +9 -1
  163. package/src/styles/components/_badge.scss +182 -0
  164. package/src/styles/components/_bottom-app-bar.scss +103 -0
  165. package/src/{components/button/_styles.scss → styles/components/_button.scss} +0 -10
  166. package/src/{components/checkbox/_styles.scss → styles/components/_checkbox.scss} +0 -2
  167. package/src/styles/components/_datepicker.scss +358 -0
  168. package/src/styles/components/_dialog.scss +259 -0
  169. package/src/styles/components/_divider.scss +57 -0
  170. package/src/styles/components/_extended-fab.scss +267 -0
  171. package/src/styles/components/_fab.scss +225 -0
  172. package/src/{components/navigation/_styles.scss → styles/components/_navigation.scss} +1 -0
  173. package/src/styles/components/_search.scss +306 -0
  174. package/src/styles/components/_segmented-button.scss +117 -0
  175. package/src/{components/slider/_styles.scss → styles/components/_slider.scss} +83 -24
  176. package/src/{components/switch/_styles.scss → styles/components/_switch.scss} +0 -2
  177. package/src/{components/tabs/_styles.scss → styles/components/_tabs.scss} +95 -33
  178. package/src/{components/textfield/_styles.scss → styles/components/_textfield.scss} +70 -67
  179. package/src/styles/components/_timepicker.scss +451 -0
  180. package/src/styles/components/_top-app-bar.scss +225 -0
  181. package/src/styles/main.scss +98 -49
  182. package/src/styles/themes/_autumn.scss +21 -0
  183. package/src/styles/themes/_base-theme.scss +61 -0
  184. package/src/styles/themes/_baseline.scss +58 -0
  185. package/src/styles/themes/_bluekhaki.scss +125 -0
  186. package/src/styles/themes/_brownbeige.scss +125 -0
  187. package/src/styles/themes/_browngreen.scss +125 -0
  188. package/src/styles/themes/_forest.scss +6 -0
  189. package/src/styles/themes/_greenbeige.scss +125 -0
  190. package/src/styles/themes/_material.scss +125 -0
  191. package/src/styles/themes/_ocean.scss +6 -0
  192. package/src/styles/themes/_sageivory.scss +125 -0
  193. package/src/styles/themes/_spring.scss +6 -0
  194. package/src/styles/themes/_summer.scss +5 -0
  195. package/src/styles/themes/_sunset.scss +5 -0
  196. package/src/styles/themes/_tealcaramel.scss +125 -0
  197. package/src/styles/themes/_winter.scss +6 -0
  198. package/src/components/badge/_styles.scss +0 -174
  199. package/src/components/badge/constants.ts +0 -30
  200. package/src/components/button/constants.ts +0 -11
  201. package/src/components/card/constants.ts +0 -84
  202. package/src/components/dialog/_styles.scss +0 -213
  203. package/src/components/dialog/constants.ts +0 -32
  204. package/src/components/menu/constants.ts +0 -154
  205. package/src/components/navigation/constants.ts +0 -200
  206. package/src/components/navigation/features/items.js +0 -192
  207. package/src/components/progress/constants.ts +0 -29
  208. package/src/components/slider/features/appearance.ts +0 -94
  209. package/src/components/slider/features/disabled.ts +0 -68
  210. package/src/components/slider/features/events.ts +0 -164
  211. package/src/components/slider/features/interactions.ts +0 -396
  212. package/src/components/slider/features/keyboard.ts +0 -233
  213. package/src/components/switch/constants.ts +0 -80
  214. package/src/components/tabs/constants.ts +0 -89
  215. package/src/core/collection/adapters/mongodb.js +0 -232
  216. /package/src/{components/card/_styles.scss → styles/components/_card.scss} +0 -0
  217. /package/src/{components/carousel/_styles.scss → styles/components/_carousel.scss} +0 -0
  218. /package/src/{components/chip/_styles.scss → styles/components/_chip.scss} +0 -0
  219. /package/src/{components/list/_styles.scss → styles/components/_list.scss} +0 -0
  220. /package/src/{components/menu/_styles.scss → styles/components/_menu.scss} +0 -0
  221. /package/src/{components/progress/_styles.scss → styles/components/_progress.scss} +0 -0
  222. /package/src/{components/radios/_styles.scss → styles/components/_radios.scss} +0 -0
  223. /package/src/{components/sheet/_styles.scss → styles/components/_sheet.scss} +0 -0
  224. /package/src/{components/snackbar/_styles.scss → styles/components/_snackbar.scss} +0 -0
  225. /package/src/{components/tooltip/_styles.scss → styles/components/_tooltip.scss} +0 -0
  226. /package/src/styles/utilities/{_color.scss → _colors.scss} +0 -0
@@ -0,0 +1,451 @@
1
+ // src/components/timepicker/_styles.scss
2
+ @use 'sass:map';
3
+ @use '../../styles/abstract/base' as base;
4
+ @use '../../styles/abstract/variables' as v;
5
+ @use '../../styles/abstract/functions' as f;
6
+ @use '../../styles/abstract/mixins' as m;
7
+ @use '../../styles/abstract/theme' as t;
8
+
9
+ $component: '#{base.$prefix}-time-picker';
10
+
11
+ .#{$component} {
12
+ // Base styles
13
+ position: relative;
14
+ display: inline-block;
15
+
16
+ &-modal {
17
+ position: fixed;
18
+ top: 0;
19
+ left: 0;
20
+ width: 100%;
21
+ height: 100%;
22
+ background-color: rgba(0, 0, 0, 0.4);
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ z-index: map.get(v.$z-index, 'modal');
27
+ opacity: 0;
28
+ transition: opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
29
+
30
+ &.active {
31
+ opacity: 1;
32
+ }
33
+ }
34
+
35
+ &-dialog {
36
+ position: relative;
37
+ display: flex;
38
+ flex-direction: column;
39
+ min-width: 280px;
40
+ max-width: 328px;
41
+ max-height: 520px;
42
+ background-color: t.color('surface-container-high');
43
+ color: t.color('on-surface');
44
+ border-radius: f.get-shape('extra-large');
45
+ @include m.elevation(3);
46
+ transform: translateY(20px) scale(0.9);
47
+ opacity: 0;
48
+ transition: transform 0.25s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
49
+
50
+ &.active {
51
+ transform: translateY(0) scale(1);
52
+ opacity: 1;
53
+ }
54
+
55
+ // State layer for elevations
56
+ &::before {
57
+ content: '';
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ width: 100%;
62
+ height: 100%;
63
+ border-radius: inherit;
64
+ background-color: t.color('surface-tint');
65
+ opacity: 0.05;
66
+ pointer-events: none;
67
+ }
68
+
69
+ // Orientations
70
+ &--vertical {
71
+ // min-height: 460px;
72
+
73
+ .#{$component}-input-container {
74
+ flex-direction: row;
75
+ }
76
+
77
+ .#{$component}-period {
78
+ flex-direction: column;
79
+ width: 52px;
80
+ height: 80px;
81
+ margin-left: 12px;
82
+ }
83
+ }
84
+
85
+ &--horizontal {
86
+ min-width: 520px;
87
+ min-height: 360px;
88
+
89
+ .#{$component}-content {
90
+ flex-direction: row;
91
+ align-items: center;
92
+ }
93
+
94
+ .#{$component}-input-container {
95
+ flex-direction: row;
96
+ }
97
+
98
+ .#{$component}-period {
99
+ flex-direction: column;
100
+ width: 52px;
101
+ height: 80px;
102
+ margin-left: 12px;
103
+ }
104
+
105
+ .#{$component}-dial {
106
+ margin-left: 24px;
107
+ }
108
+ }
109
+
110
+ // Time formats
111
+ &--24h {
112
+ .#{$component}-period {
113
+ display: none;
114
+ }
115
+ }
116
+ }
117
+
118
+ // Title
119
+ &-title {
120
+ padding: 24px 24px 16px;
121
+ @include m.typography('title-small');
122
+ color: t.color('on-surface-variant');
123
+ }
124
+
125
+ // Content container
126
+ &-content {
127
+ flex: 1;
128
+ padding: 0 24px;
129
+ overflow: hidden;
130
+ display: flex;
131
+ flex-direction: column;
132
+ align-items: center;
133
+ }
134
+
135
+ // Input container for both modes
136
+ &-input-container {
137
+ display: flex;
138
+ align-items: center;
139
+ justify-content: center;
140
+ margin: 0 0 24px 0;
141
+ }
142
+
143
+ // Input field containers
144
+ &-time-input-field {
145
+ position: relative;
146
+ display: flex;
147
+ flex-direction: column;
148
+ }
149
+
150
+ // Time input styles - shared for both modes
151
+ &-hours,
152
+ &-minutes,
153
+ &-seconds {
154
+ display: flex;
155
+ align-items: center;
156
+ justify-content: center;
157
+ width: 96px;
158
+ height: 80px;
159
+ font-size: 3.5rem;
160
+ font-weight: 400;
161
+ border: none;
162
+ background: transparent;
163
+ cursor: pointer;
164
+
165
+ &[data-active="true"] {
166
+ color: t.color('primary');
167
+ }
168
+
169
+ // Style for HTML input elements
170
+ &[type="number"] {
171
+ font-size: 3.5rem;
172
+ font-weight: 400;
173
+ width: 96px;
174
+ height: 76px;
175
+ text-align: center;
176
+ border: none;
177
+ background-color: t.color('surface-container-highest');
178
+ border-radius: f.get-shape('small');
179
+ padding: 0;
180
+ margin: 0;
181
+ color: t.color('on-surface');
182
+
183
+ &:focus {
184
+ outline: none;
185
+ box-shadow: 0 0 0 2px t.color('primary');
186
+ }
187
+
188
+ // Remove spinner arrows
189
+ -moz-appearance: textfield;
190
+ &::-webkit-outer-spin-button,
191
+ &::-webkit-inner-spin-button {
192
+ -webkit-appearance: none;
193
+ margin: 0;
194
+ }
195
+ }
196
+
197
+ // When in dial mode, add highlighting for active element
198
+ &:not([type="number"]) {
199
+ &[data-active="true"] {
200
+ color: t.color('primary');
201
+ background-color: t.alpha('primary', 0.1);
202
+ border-radius: f.get-shape('small');
203
+ }
204
+
205
+ &:hover {
206
+ background-color: t.alpha('on-surface', 0.04);
207
+ border-radius: f.get-shape('small');
208
+ }
209
+ }
210
+ }
211
+
212
+ // Separator between hours, minutes, seconds
213
+ &-separator {
214
+ font-size: 3.5rem;
215
+ font-weight: 400;
216
+ margin: 0 4px;
217
+ color: t.color('on-surface-variant');
218
+ }
219
+
220
+ // Period selector (AM/PM)
221
+ &-period {
222
+ display: flex;
223
+ flex-direction: column;
224
+ justify-content: space-between;
225
+ background-color: t.color('surface-container-highest');
226
+ border-radius: f.get-shape('small');
227
+ overflow: hidden;
228
+ border: 1px solid t.color('outline-variant');
229
+ margin-left: 16px;
230
+
231
+ &-am,
232
+ &-pm {
233
+ display: flex;
234
+ align-items: center;
235
+ justify-content: center;
236
+ width: 100%;
237
+ height: 50%;
238
+ padding: 8px;
239
+ cursor: pointer;
240
+ @include m.typography('title-medium');
241
+
242
+ // Improve touch target sizes on mobile
243
+ @media (max-width: 599px) {
244
+ min-height: 48px;
245
+ }
246
+
247
+ // Improve focus styles for keyboard navigation
248
+ &:focus-visible {
249
+ outline: 2px solid t.color('primary');
250
+ outline-offset: 2px;
251
+ }
252
+
253
+ &:hover {
254
+ background-color: t.alpha('on-surface', 0.08);
255
+ }
256
+
257
+ &:active {
258
+ background-color: t.alpha('on-surface', 0.12);
259
+ }
260
+ }
261
+
262
+ &--selected {
263
+ background-color: t.color('primary-container');
264
+ color: t.color('on-primary-container');
265
+
266
+ &:hover {
267
+ background-color: t.color('primary-container');
268
+ }
269
+ }
270
+ }
271
+
272
+ // Clock dial
273
+ &-dial {
274
+ display: flex;
275
+ align-items: center;
276
+ justify-content: center;
277
+ position: relative;
278
+ margin: 0 auto 24px;
279
+ width: 256px;
280
+ height: 256px;
281
+
282
+ &-canvas {
283
+ display: block;
284
+ width: 100%;
285
+ height: 100%;
286
+ border-radius: 50%;
287
+ cursor: pointer;
288
+ touch-action: none; // Prevent scrolling when touching the canvas
289
+ -webkit-tap-highlight-color: transparent; // Remove highlight on tap (mobile)
290
+
291
+ // Add transition for smooth animations
292
+ transition: transform 0.2s ease;
293
+
294
+ &:focus {
295
+ outline: none;
296
+ box-shadow: 0 0 0 2px t.color('primary');
297
+ }
298
+ }
299
+ }
300
+
301
+ // Actions footer
302
+ &-actions {
303
+ display: flex;
304
+ align-items: center;
305
+ justify-content: space-between;
306
+ padding: 16px 24px 24px;
307
+ }
308
+
309
+ &-toggle-type {
310
+ background: transparent;
311
+ border: none;
312
+ padding: 8px;
313
+ border-radius: 50%;
314
+ cursor: pointer;
315
+ color: t.color('on-surface-variant');
316
+
317
+ // Improve touch target sizes on mobile
318
+ @media (max-width: 599px) {
319
+ min-height: 48px;
320
+ min-width: 48px;
321
+ }
322
+
323
+ // Improve focus styles for keyboard navigation
324
+ &:focus-visible {
325
+ outline: 2px solid t.color('primary');
326
+ outline-offset: 2px;
327
+ }
328
+
329
+ &:hover {
330
+ background-color: t.alpha('on-surface', 0.08);
331
+ }
332
+
333
+ &:active {
334
+ background-color: t.alpha('on-surface', 0.12);
335
+ }
336
+
337
+ svg {
338
+ width: 24px;
339
+ height: 24px;
340
+ display: block;
341
+ }
342
+ }
343
+
344
+ &-action-buttons {
345
+ display: flex;
346
+ gap: 8px;
347
+ }
348
+
349
+ &-cancel,
350
+ &-confirm {
351
+ padding: 10px 12px;
352
+ border: none;
353
+ background: transparent;
354
+ border-radius: f.get-shape('small');
355
+ cursor: pointer;
356
+ @include m.typography('label-large');
357
+ color: t.color('primary');
358
+
359
+ // Improve touch target sizes on mobile
360
+ @media (max-width: 599px) {
361
+ min-height: 48px;
362
+ padding: 12px 16px;
363
+ }
364
+
365
+ // Improve focus styles for keyboard navigation
366
+ &:focus-visible {
367
+ outline: 2px solid t.color('primary');
368
+ outline-offset: 2px;
369
+ }
370
+
371
+ &:hover {
372
+ background-color: t.alpha('primary', 0.08);
373
+ }
374
+
375
+ &:active {
376
+ background-color: t.alpha('primary', 0.12);
377
+ }
378
+ }
379
+
380
+ // Responsive adjustments
381
+ @media (max-width: 599px) {
382
+ &-dialog {
383
+ width: 100%;
384
+ max-width: 100%;
385
+ min-height: 460px;
386
+ border-radius: 0;
387
+ margin: 0;
388
+
389
+ &--horizontal {
390
+ flex-direction: column;
391
+
392
+ .#{$component}-content {
393
+ flex-direction: column;
394
+ }
395
+
396
+ .#{$component}-dial {
397
+ margin-left: 0;
398
+ }
399
+ }
400
+ }
401
+
402
+ &-input-container {
403
+ margin: 16px 0;
404
+ }
405
+
406
+ // Smaller inputs on mobile
407
+ &-hours,
408
+ &-minutes,
409
+ &-seconds {
410
+ width: 80px;
411
+ height: 76px;
412
+ font-size: 3rem;
413
+
414
+ &[type="number"] {
415
+ width: 80px;
416
+ height: 76px;
417
+ font-size: 3rem;
418
+ }
419
+ }
420
+ }
421
+
422
+ // Dark mode adjustments
423
+ @media (prefers-color-scheme: dark) {
424
+ &-dialog {
425
+ &::before {
426
+ opacity: 0.08;
427
+ }
428
+ }
429
+
430
+ &-hours,
431
+ &-minutes,
432
+ &-seconds {
433
+ &[type="number"] {
434
+ background-color: t.alpha('on-surface', 0.05);
435
+ }
436
+ }
437
+ }
438
+
439
+ // Accessibility
440
+ &-sr-only {
441
+ position: absolute;
442
+ width: 1px;
443
+ height: 1px;
444
+ padding: 0;
445
+ margin: -1px;
446
+ overflow: hidden;
447
+ clip: rect(0, 0, 0, 0);
448
+ white-space: nowrap;
449
+ border: 0;
450
+ }
451
+ }
@@ -0,0 +1,225 @@
1
+ // src/components/top-app-bar/_styles.scss
2
+ @use 'sass:map';
3
+ @use '../../styles/abstract/base' as base;
4
+ @use '../../styles/abstract/variables' as v;
5
+ @use '../../styles/abstract/functions' as f;
6
+ @use '../../styles/abstract/mixins' as m;
7
+ @use '../../styles/abstract/theme' as t;
8
+
9
+ $component: '#{base.$prefix}-top-app-bar';
10
+
11
+ .#{$component} {
12
+ // Core Properties
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ right: 0;
17
+ z-index: f.get-z-index('fixed');
18
+ display: flex;
19
+ align-items: center;
20
+ width: 100%;
21
+ background-color: t.color('surface');
22
+
23
+ // Default type (small) - 64dp height as per specs
24
+ height: 64px;
25
+ padding: 0 16px;
26
+
27
+ // Apply transition for scroll behavior
28
+ transition:
29
+ box-shadow 0.3s ease-in-out,
30
+ background-color 0.3s ease-in-out,
31
+ height 0.3s ease-in-out;
32
+
33
+ // Container for the headline
34
+ &-headline {
35
+ flex: 1;
36
+ display: flex;
37
+ align-items: center;
38
+ @include m.typography('title-large');
39
+ color: t.color('on-surface');
40
+ margin: 0;
41
+ padding: 0;
42
+ white-space: nowrap;
43
+ overflow: hidden;
44
+ text-overflow: ellipsis;
45
+ transition:
46
+ font-size 0.3s ease-in-out,
47
+ margin 0.3s ease-in-out,
48
+ padding 0.3s ease-in-out;
49
+ }
50
+
51
+ // Leading section (usually navigation icon)
52
+ &-leading {
53
+ display: flex;
54
+ align-items: center;
55
+ margin-right: 24px;
56
+ }
57
+
58
+ // Trailing section (usually action icons)
59
+ &-trailing {
60
+ display: flex;
61
+ align-items: center;
62
+ gap: 8px;
63
+ margin-left: auto;
64
+ }
65
+
66
+ // Center-aligned top app bar
67
+ &--center {
68
+ .#{$component}-headline {
69
+ position: absolute;
70
+ left: 50%;
71
+ transform: translateX(-50%);
72
+ text-align: center;
73
+ flex: 0;
74
+ }
75
+ }
76
+
77
+ // Medium top app bar - 112dp height
78
+ &--medium {
79
+ height: 112px;
80
+ flex-direction: column;
81
+ align-items: flex-start;
82
+ justify-content: space-between;
83
+ padding: 0;
84
+
85
+ .#{$component}-row {
86
+ display: flex;
87
+ align-items: center;
88
+ width: 100%;
89
+ padding: 0 16px;
90
+
91
+ &:first-child {
92
+ margin-top: 20px;
93
+ }
94
+ }
95
+
96
+ .#{$component}-headline {
97
+ margin-bottom: 24px;
98
+ margin-left: 16px;
99
+ @include m.typography('headline-small');
100
+ }
101
+ }
102
+
103
+ // Large top app bar - 152dp height
104
+ &--large {
105
+ height: 152px;
106
+ flex-direction: column;
107
+ align-items: flex-start;
108
+ justify-content: space-between;
109
+ padding: 0;
110
+
111
+ .#{$component}-row {
112
+ display: flex;
113
+ align-items: center;
114
+ width: 100%;
115
+ padding: 0 16px;
116
+
117
+ &:first-child {
118
+ margin-top: 20px;
119
+ }
120
+ }
121
+
122
+ .#{$component}-headline {
123
+ margin-bottom: 28px;
124
+ margin-left: 16px;
125
+ @include m.typography('headline-medium');
126
+ }
127
+ }
128
+
129
+ // States for on-scroll behavior
130
+ &--scrolled {
131
+ background-color: t.color('surface-container');
132
+ @include m.elevation(1);
133
+
134
+ // Compress medium and large variants to small on scroll if compressible
135
+ &.#{$component}--medium.#{$component}--compressible,
136
+ &.#{$component}--large.#{$component}--compressible {
137
+ height: 64px;
138
+ flex-direction: row;
139
+ align-items: center;
140
+ padding: 0 16px;
141
+
142
+ .#{$component}-row {
143
+ display: none;
144
+ }
145
+
146
+ .#{$component}-headline {
147
+ margin: 0;
148
+ @include m.typography('title-large');
149
+ }
150
+
151
+ // Fix for headline that is inside row in medium/large
152
+ .#{$component}-row:nth-child(2) {
153
+ display: flex;
154
+ flex: 1;
155
+ margin: 0;
156
+ padding: 0;
157
+ }
158
+ }
159
+ }
160
+
161
+ // RTL Support
162
+ [dir="rtl"] & {
163
+ .#{$component}-leading {
164
+ margin-right: 0;
165
+ margin-left: 24px;
166
+ }
167
+
168
+ .#{$component}-trailing {
169
+ margin-left: 0;
170
+ margin-right: auto;
171
+ }
172
+
173
+ &--medium,
174
+ &--large {
175
+ .#{$component}-headline {
176
+ margin-left: 0;
177
+ margin-right: 16px;
178
+ }
179
+ }
180
+
181
+ &--center {
182
+ .#{$component}-headline {
183
+ left: auto;
184
+ right: 50%;
185
+ transform: translateX(50%);
186
+ }
187
+ }
188
+ }
189
+
190
+ // Mobile screen adjustments
191
+ @media (max-width: map.get(v.$breakpoints, 'sm')) {
192
+ // Reduce side padding slightly on small screens
193
+ padding: 0 12px;
194
+
195
+ .#{$component}-leading {
196
+ margin-right: 16px;
197
+ }
198
+
199
+ .#{$component}-trailing {
200
+ gap: 4px;
201
+ }
202
+
203
+ // Make icon buttons slightly smaller
204
+ .#{$component}-leading,
205
+ .#{$component}-trailing {
206
+ button {
207
+ padding: 8px;
208
+ }
209
+ }
210
+ }
211
+
212
+ // Reduced motion support
213
+ @include m.reduced-motion {
214
+ transition-duration: 0.01ms;
215
+
216
+ .#{$component}-headline {
217
+ transition-duration: 0.01ms;
218
+ }
219
+ }
220
+
221
+ // High contrast mode support
222
+ @include m.high-contrast {
223
+ border-bottom: 1px solid currentColor;
224
+ }
225
+ }