@francofantomius/material-components 1.0.1 → 1.1.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 (163) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +41 -9
  3. package/custom-elements.json +19060 -9017
  4. package/dist/chunks/account-menu-Dau0UHTl.js +1290 -0
  5. package/dist/chunks/account-menu-Dau0UHTl.js.map +1 -0
  6. package/dist/chunks/app-drawer-Du1ePzxZ.js +903 -0
  7. package/dist/chunks/app-drawer-Du1ePzxZ.js.map +1 -0
  8. package/dist/chunks/bottom-sheet-q79BBYAj.js +402 -0
  9. package/dist/chunks/bottom-sheet-q79BBYAj.js.map +1 -0
  10. package/dist/chunks/{button-B4TSZ7Sl.js → button-D2vn7kJ8.js} +9 -8
  11. package/dist/chunks/button-D2vn7kJ8.js.map +1 -0
  12. package/dist/chunks/button-group-CNqvJx1n.js +143 -0
  13. package/dist/chunks/button-group-CNqvJx1n.js.map +1 -0
  14. package/dist/chunks/carousel-item-BG6kjjjk.js +371 -0
  15. package/dist/chunks/carousel-item-BG6kjjjk.js.map +1 -0
  16. package/dist/chunks/date-picker-DJeHi4w-.js +777 -0
  17. package/dist/chunks/date-picker-DJeHi4w-.js.map +1 -0
  18. package/dist/chunks/fab-menu.css-3pu930sZ.js +320 -0
  19. package/dist/chunks/fab-menu.css-3pu930sZ.js.map +1 -0
  20. package/dist/chunks/{icon-button-BdSc7eot.js → icon-button-BQz73GLa.js} +2 -2
  21. package/dist/chunks/icon-button-BQz73GLa.js.map +1 -0
  22. package/dist/chunks/loading-indicator-CvWnZr9o.js +193 -0
  23. package/dist/chunks/loading-indicator-CvWnZr9o.js.map +1 -0
  24. package/dist/chunks/menu-item-BBSp5Cqc.js +390 -0
  25. package/dist/chunks/menu-item-BBSp5Cqc.js.map +1 -0
  26. package/dist/chunks/navigation-bar-item-C9DfOEzg.js +397 -0
  27. package/dist/chunks/navigation-bar-item-C9DfOEzg.js.map +1 -0
  28. package/dist/chunks/navigation-rail-item-6pdhNHJK.js +357 -0
  29. package/dist/chunks/navigation-rail-item-6pdhNHJK.js.map +1 -0
  30. package/dist/chunks/segmented-button-B0BvGSQ7.js +265 -0
  31. package/dist/chunks/segmented-button-B0BvGSQ7.js.map +1 -0
  32. package/dist/chunks/side-sheet-S2w081AK.js +360 -0
  33. package/dist/chunks/side-sheet-S2w081AK.js.map +1 -0
  34. package/dist/chunks/slider-D-mnO8yQ.js +450 -0
  35. package/dist/chunks/slider-D-mnO8yQ.js.map +1 -0
  36. package/dist/chunks/split-button-DUfjukQY.js +450 -0
  37. package/dist/chunks/split-button-DUfjukQY.js.map +1 -0
  38. package/dist/chunks/{table-aRTYzDyE.js → table-CqHnneAj.js} +2 -2
  39. package/dist/chunks/{table-aRTYzDyE.js.map → table-CqHnneAj.js.map} +1 -1
  40. package/dist/chunks/time-picker-CZnb2sWz.js +785 -0
  41. package/dist/chunks/time-picker-CZnb2sWz.js.map +1 -0
  42. package/dist/chunks/toolbar-DXVQbQKJ.js +271 -0
  43. package/dist/chunks/toolbar-DXVQbQKJ.js.map +1 -0
  44. package/dist/chunks/tooltip-CE7JMHMu.js +398 -0
  45. package/dist/chunks/tooltip-CE7JMHMu.js.map +1 -0
  46. package/dist/components/account-menu/account-menu.js +8 -0
  47. package/dist/components/app-drawer/app-drawer.js +9 -0
  48. package/dist/components/bottom-sheet/bottom-sheet.css.d.ts +2 -0
  49. package/dist/components/bottom-sheet/bottom-sheet.css.d.ts.map +1 -0
  50. package/dist/components/bottom-sheet/bottom-sheet.d.ts +69 -0
  51. package/dist/components/bottom-sheet/bottom-sheet.d.ts.map +1 -0
  52. package/dist/components/bottom-sheet/bottom-sheet.js +4 -0
  53. package/dist/components/button/button.css.d.ts.map +1 -1
  54. package/dist/components/button/button.js +1 -1
  55. package/dist/components/button-group/button-group.css.d.ts +2 -0
  56. package/dist/components/button-group/button-group.css.d.ts.map +1 -0
  57. package/dist/components/button-group/button-group.d.ts +28 -0
  58. package/dist/components/button-group/button-group.d.ts.map +1 -0
  59. package/dist/components/button-group/button-group.js +4 -0
  60. package/dist/components/carousel/carousel-item.d.ts +33 -0
  61. package/dist/components/carousel/carousel-item.d.ts.map +1 -0
  62. package/dist/components/carousel/carousel-item.js +4 -0
  63. package/dist/components/carousel/carousel.css.d.ts +3 -0
  64. package/dist/components/carousel/carousel.css.d.ts.map +1 -0
  65. package/dist/components/carousel/carousel.d.ts +81 -0
  66. package/dist/components/carousel/carousel.d.ts.map +1 -0
  67. package/dist/components/carousel/carousel.js +284 -0
  68. package/dist/components/carousel/carousel.js.map +1 -0
  69. package/dist/components/date-picker/date-picker.css.d.ts +2 -0
  70. package/dist/components/date-picker/date-picker.css.d.ts.map +1 -0
  71. package/dist/components/date-picker/date-picker.d.ts +59 -0
  72. package/dist/components/date-picker/date-picker.d.ts.map +1 -0
  73. package/dist/components/date-picker/date-picker.js +4 -0
  74. package/dist/components/fab-menu/fab-menu-item.d.ts +35 -0
  75. package/dist/components/fab-menu/fab-menu-item.d.ts.map +1 -0
  76. package/dist/components/fab-menu/fab-menu-item.js +93 -0
  77. package/dist/components/fab-menu/fab-menu-item.js.map +1 -0
  78. package/dist/components/fab-menu/fab-menu.css.d.ts +3 -0
  79. package/dist/components/fab-menu/fab-menu.css.d.ts.map +1 -0
  80. package/dist/components/fab-menu/fab-menu.d.ts +72 -0
  81. package/dist/components/fab-menu/fab-menu.d.ts.map +1 -0
  82. package/dist/components/fab-menu/fab-menu.js +148 -0
  83. package/dist/components/fab-menu/fab-menu.js.map +1 -0
  84. package/dist/components/icon-button/icon-button.js +1 -1
  85. package/dist/components/loading-indicator/loading-indicator.css.d.ts +2 -0
  86. package/dist/components/loading-indicator/loading-indicator.css.d.ts.map +1 -0
  87. package/dist/components/loading-indicator/loading-indicator.d.ts +48 -0
  88. package/dist/components/loading-indicator/loading-indicator.d.ts.map +1 -0
  89. package/dist/components/loading-indicator/loading-indicator.js +4 -0
  90. package/dist/components/menu/menu-item.d.ts +41 -0
  91. package/dist/components/menu/menu-item.d.ts.map +1 -0
  92. package/dist/components/menu/menu-item.js +4 -0
  93. package/dist/components/menu/menu.css.d.ts +3 -0
  94. package/dist/components/menu/menu.css.d.ts.map +1 -0
  95. package/dist/components/menu/menu.d.ts +91 -0
  96. package/dist/components/menu/menu.d.ts.map +1 -0
  97. package/dist/components/menu/menu.js +205 -0
  98. package/dist/components/menu/menu.js.map +1 -0
  99. package/dist/components/navigation-bar/navigation-bar-item.d.ts +49 -0
  100. package/dist/components/navigation-bar/navigation-bar-item.d.ts.map +1 -0
  101. package/dist/components/navigation-bar/navigation-bar-item.js +5 -0
  102. package/dist/components/navigation-bar/navigation-bar.css.d.ts +3 -0
  103. package/dist/components/navigation-bar/navigation-bar.css.d.ts.map +1 -0
  104. package/dist/components/navigation-bar/navigation-bar.d.ts +50 -0
  105. package/dist/components/navigation-bar/navigation-bar.d.ts.map +1 -0
  106. package/dist/components/navigation-bar/navigation-bar.js +150 -0
  107. package/dist/components/navigation-bar/navigation-bar.js.map +1 -0
  108. package/dist/components/navigation-rail/navigation-rail-item.d.ts +36 -0
  109. package/dist/components/navigation-rail/navigation-rail-item.d.ts.map +1 -0
  110. package/dist/components/navigation-rail/navigation-rail-item.js +5 -0
  111. package/dist/components/navigation-rail/navigation-rail.css.d.ts +3 -0
  112. package/dist/components/navigation-rail/navigation-rail.css.d.ts.map +1 -0
  113. package/dist/components/navigation-rail/navigation-rail.d.ts +43 -0
  114. package/dist/components/navigation-rail/navigation-rail.d.ts.map +1 -0
  115. package/dist/components/navigation-rail/navigation-rail.js +121 -0
  116. package/dist/components/navigation-rail/navigation-rail.js.map +1 -0
  117. package/dist/components/segmented-button/segmented-button.css.d.ts +3 -0
  118. package/dist/components/segmented-button/segmented-button.css.d.ts.map +1 -0
  119. package/dist/components/segmented-button/segmented-button.d.ts +40 -0
  120. package/dist/components/segmented-button/segmented-button.d.ts.map +1 -0
  121. package/dist/components/segmented-button/segmented-button.js +5 -0
  122. package/dist/components/side-sheet/side-sheet.css.d.ts +2 -0
  123. package/dist/components/side-sheet/side-sheet.css.d.ts.map +1 -0
  124. package/dist/components/side-sheet/side-sheet.d.ts +57 -0
  125. package/dist/components/side-sheet/side-sheet.d.ts.map +1 -0
  126. package/dist/components/side-sheet/side-sheet.js +4 -0
  127. package/dist/components/slider/slider.css.d.ts +2 -0
  128. package/dist/components/slider/slider.css.d.ts.map +1 -0
  129. package/dist/components/slider/slider.d.ts +51 -0
  130. package/dist/components/slider/slider.d.ts.map +1 -0
  131. package/dist/components/slider/slider.js +4 -0
  132. package/dist/components/split-button/split-button.css.d.ts +2 -0
  133. package/dist/components/split-button/split-button.css.d.ts.map +1 -0
  134. package/dist/components/split-button/split-button.d.ts +89 -0
  135. package/dist/components/split-button/split-button.d.ts.map +1 -0
  136. package/dist/components/split-button/split-button.js +4 -0
  137. package/dist/components/table/table.js +1 -1
  138. package/dist/components/time-picker/time-picker.css.d.ts +2 -0
  139. package/dist/components/time-picker/time-picker.css.d.ts.map +1 -0
  140. package/dist/components/time-picker/time-picker.d.ts +87 -0
  141. package/dist/components/time-picker/time-picker.d.ts.map +1 -0
  142. package/dist/components/time-picker/time-picker.js +4 -0
  143. package/dist/components/toolbar/toolbar.css.d.ts +2 -0
  144. package/dist/components/toolbar/toolbar.css.d.ts.map +1 -0
  145. package/dist/components/toolbar/toolbar.d.ts +53 -0
  146. package/dist/components/toolbar/toolbar.d.ts.map +1 -0
  147. package/dist/components/toolbar/toolbar.js +4 -0
  148. package/dist/components/tooltip/tooltip.css.d.ts +2 -0
  149. package/dist/components/tooltip/tooltip.css.d.ts.map +1 -0
  150. package/dist/components/tooltip/tooltip.d.ts +89 -0
  151. package/dist/components/tooltip/tooltip.d.ts.map +1 -0
  152. package/dist/components/tooltip/tooltip.js +4 -0
  153. package/dist/index.d.ts +21 -0
  154. package/dist/index.d.ts.map +1 -1
  155. package/dist/index.js +148 -2263
  156. package/dist/tokens/index.js +4 -2
  157. package/dist/tokens/index.js.map +1 -1
  158. package/dist/tokens/theme.css.d.ts.map +1 -1
  159. package/llms.txt +2326 -0
  160. package/package.json +99 -2
  161. package/dist/chunks/button-B4TSZ7Sl.js.map +0 -1
  162. package/dist/chunks/icon-button-BdSc7eot.js.map +0 -1
  163. package/dist/index.js.map +0 -1
@@ -0,0 +1,785 @@
1
+ import { t as a } from "./decorate-DXuynaiA.js";
2
+ import { t as x } from "./form-associated-Cty_ZaS9.js";
3
+ import "./icon-DrNqcNEL.js";
4
+ import "./button-D2vn7kJ8.js";
5
+ import "./icon-button-BQz73GLa.js";
6
+ import { css as M, html as d, nothing as m } from "lit";
7
+ import { customElement as $, property as p, query as y, state as f } from "lit/decorators.js";
8
+ var w = M`
9
+ :host {
10
+ display: inline-block;
11
+ color: var(--md-sys-color-on-surface, #1d1b20);
12
+ font-family: var(--md-sys-typescale-font-family, 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif);
13
+ user-select: none;
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ :host([hidden]) {
18
+ display: none !important;
19
+ }
20
+
21
+ :host([modal]) {
22
+ position: fixed;
23
+ top: 0;
24
+ left: 0;
25
+ width: 100vw;
26
+ height: 100vh;
27
+ z-index: 1000;
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ pointer-events: none;
32
+ }
33
+
34
+ :host([modal][open]) {
35
+ pointer-events: auto;
36
+ }
37
+
38
+ :host([modal]:not([open])) {
39
+ display: none;
40
+ }
41
+
42
+ /* Scrim Backdrop for Modal */
43
+ .scrim {
44
+ position: fixed;
45
+ top: 0;
46
+ left: 0;
47
+ width: 100%;
48
+ height: 100%;
49
+ background-color: rgba(0, 0, 0, 0.32);
50
+ z-index: -1;
51
+ opacity: 0;
52
+ transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
53
+ }
54
+
55
+ :host([modal][open]) .scrim {
56
+ opacity: 1;
57
+ }
58
+
59
+ /* Picker Container / Surface */
60
+ .picker-surface {
61
+ background-color: var(--md-sys-color-surface-container-high, #ece6f0);
62
+ color: var(--md-sys-color-on-surface, #1d1b20);
63
+ border-radius: var(--md-sys-shape-corner-extra-large, 28px);
64
+ padding: 24px;
65
+ display: flex;
66
+ flex-direction: column;
67
+ align-items: center;
68
+ box-shadow: var(--md-sys-elevation-3, 0 4px 8px 3px rgba(0, 0, 0, 0.15), 0 1px 3px 0 rgba(0, 0, 0, 0.3));
69
+ max-width: 360px;
70
+ width: 100%;
71
+ box-sizing: border-box;
72
+ position: relative;
73
+ }
74
+
75
+ :host(:not([modal])) .picker-surface {
76
+ box-shadow: var(--md-sys-elevation-1, 0 1px 3px 1px rgba(0, 0, 0, 0.15), 0 1px 2px 0 rgba(0, 0, 0, 0.3));
77
+ border: 1px solid var(--md-sys-color-outline-variant, #cac4d0);
78
+ background-color: var(--md-sys-color-surface, #fef7ff);
79
+ }
80
+
81
+ /* Headline / Header */
82
+ .header {
83
+ width: 100%;
84
+ margin-bottom: 20px;
85
+ display: flex;
86
+ align-items: center;
87
+ justify-content: space-between;
88
+ }
89
+
90
+ .headline {
91
+ font-size: 14px;
92
+ font-weight: 500;
93
+ letter-spacing: 0.1px;
94
+ line-height: 20px;
95
+ color: var(--md-sys-color-on-surface-variant, #49454f);
96
+ margin: 0;
97
+ }
98
+
99
+ /* Time Display Input / Cards Row */
100
+ .time-display-row {
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: center;
104
+ gap: 8px;
105
+ margin-bottom: 24px;
106
+ width: 100%;
107
+ }
108
+
109
+ .time-card-wrapper {
110
+ display: flex;
111
+ flex-direction: column;
112
+ align-items: center;
113
+ gap: 4px;
114
+ }
115
+
116
+ .time-card {
117
+ width: 96px;
118
+ height: 72px;
119
+ background-color: var(--md-sys-color-surface-container-highest, #e6e0e9);
120
+ color: var(--md-sys-color-on-surface, #1d1b20);
121
+ border-radius: var(--md-sys-shape-corner-medium, 8px);
122
+ display: flex;
123
+ align-items: center;
124
+ justify-content: center;
125
+ font-size: 45px;
126
+ font-weight: 400;
127
+ line-height: 52px;
128
+ cursor: pointer;
129
+ border: 2px solid transparent;
130
+ transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
131
+ box-sizing: border-box;
132
+ position: relative;
133
+ outline: none;
134
+ }
135
+
136
+ .time-card:focus-visible {
137
+ border-color: var(--md-sys-color-primary, #6750a4);
138
+ }
139
+
140
+ .time-card.active {
141
+ background-color: var(--md-sys-color-primary-container, #eaddff);
142
+ color: var(--md-sys-color-on-primary-container, #21005d);
143
+ border-color: var(--md-sys-color-primary, #6750a4);
144
+ }
145
+
146
+ .time-input {
147
+ width: 100%;
148
+ height: 100%;
149
+ background: transparent;
150
+ border: none;
151
+ outline: none;
152
+ text-align: center;
153
+ font-size: 45px;
154
+ font-weight: 400;
155
+ line-height: 52px;
156
+ color: inherit;
157
+ font-family: inherit;
158
+ padding: 0;
159
+ box-sizing: border-box;
160
+ }
161
+
162
+ .time-card-label {
163
+ font-size: 12px;
164
+ font-weight: 400;
165
+ color: var(--md-sys-color-on-surface-variant, #49454f);
166
+ text-transform: capitalize;
167
+ }
168
+
169
+ .time-separator {
170
+ font-size: 45px;
171
+ font-weight: 400;
172
+ line-height: 52px;
173
+ color: var(--md-sys-color-on-surface, #1d1b20);
174
+ margin: 0 2px;
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: center;
178
+ padding-bottom: 20px;
179
+ }
180
+
181
+ /* Period Toggle (AM / PM) */
182
+ .period-toggle {
183
+ display: flex;
184
+ flex-direction: column;
185
+ border: 1px solid var(--md-sys-color-outline, #79747e);
186
+ border-radius: var(--md-sys-shape-corner-medium, 8px);
187
+ overflow: hidden;
188
+ height: 72px;
189
+ width: 48px;
190
+ margin-left: 4px;
191
+ box-sizing: border-box;
192
+ }
193
+
194
+ .period-button {
195
+ flex: 1;
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ background: transparent;
200
+ border: none;
201
+ font-size: 14px;
202
+ font-weight: 500;
203
+ color: var(--md-sys-color-on-surface-variant, #49454f);
204
+ cursor: pointer;
205
+ outline: none;
206
+ transition: background-color 0.15s, color 0.15s;
207
+ user-select: none;
208
+ }
209
+
210
+ .period-button:first-child {
211
+ border-bottom: 1px solid var(--md-sys-color-outline, #79747e);
212
+ }
213
+
214
+ .period-button.selected {
215
+ background-color: var(--md-sys-color-tertiary-container, #ffd8e4);
216
+ color: var(--md-sys-color-on-tertiary-container, #31111d);
217
+ }
218
+
219
+ .period-button:focus-visible {
220
+ background-color: var(--md-sys-color-surface-container-highest, #e6e0e9);
221
+ }
222
+
223
+ /* Clock Dial Surface */
224
+ .dial-container {
225
+ width: 256px;
226
+ height: 256px;
227
+ border-radius: 50%;
228
+ background-color: var(--md-sys-color-surface-container-highest, #e6e0e9);
229
+ position: relative;
230
+ display: flex;
231
+ align-items: center;
232
+ justify-content: center;
233
+ touch-action: none;
234
+ cursor: pointer;
235
+ margin: 8px 0;
236
+ }
237
+
238
+ .dial-center-pin {
239
+ width: 8px;
240
+ height: 8px;
241
+ border-radius: 50%;
242
+ background-color: var(--md-sys-color-primary, #6750a4);
243
+ position: absolute;
244
+ top: 50%;
245
+ left: 50%;
246
+ transform: translate(-50%, -50%);
247
+ z-index: 3;
248
+ pointer-events: none;
249
+ }
250
+
251
+ .dial-hand {
252
+ position: absolute;
253
+ bottom: 50%;
254
+ left: 50%;
255
+ width: 2px;
256
+ background-color: var(--md-sys-color-primary, #6750a4);
257
+ transform-origin: bottom center;
258
+ z-index: 2;
259
+ pointer-events: none;
260
+ transition: height 0.15s cubic-bezier(0.2, 0, 0, 1);
261
+ }
262
+
263
+ .dial-selector-head {
264
+ position: absolute;
265
+ top: -24px;
266
+ left: -23px;
267
+ width: 48px;
268
+ height: 48px;
269
+ border-radius: 50%;
270
+ background-color: var(--md-sys-color-primary, #6750a4);
271
+ display: flex;
272
+ align-items: center;
273
+ justify-content: center;
274
+ box-sizing: border-box;
275
+ }
276
+
277
+ .dial-inner-dot {
278
+ width: 6px;
279
+ height: 6px;
280
+ border-radius: 50%;
281
+ background-color: var(--md-sys-color-on-primary, #ffffff);
282
+ }
283
+
284
+ .dial-number {
285
+ position: absolute;
286
+ width: 40px;
287
+ height: 40px;
288
+ border-radius: 50%;
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ font-size: 16px;
293
+ font-weight: 500;
294
+ color: var(--md-sys-color-on-surface, #1d1b20);
295
+ transform: translate(-50%, -50%);
296
+ z-index: 4;
297
+ pointer-events: none;
298
+ transition: color 0.15s ease;
299
+ }
300
+
301
+ .dial-number.small {
302
+ font-size: 13px;
303
+ color: var(--md-sys-color-on-surface-variant, #49454f);
304
+ }
305
+
306
+ .dial-number.selected {
307
+ color: var(--md-sys-color-on-primary, #ffffff);
308
+ }
309
+
310
+ /* Actions Row */
311
+ .actions-row {
312
+ width: 100%;
313
+ display: flex;
314
+ align-items: center;
315
+ justify-content: space-between;
316
+ margin-top: 16px;
317
+ }
318
+
319
+ .mode-switch-btn {
320
+ background: transparent;
321
+ border: none;
322
+ color: var(--md-sys-color-on-surface-variant, #49454f);
323
+ cursor: pointer;
324
+ padding: 8px;
325
+ border-radius: 50%;
326
+ display: flex;
327
+ align-items: center;
328
+ justify-content: center;
329
+ outline: none;
330
+ transition: background-color 0.15s;
331
+ }
332
+
333
+ .mode-switch-btn:hover {
334
+ background-color: rgba(0, 0, 0, 0.06);
335
+ }
336
+
337
+ .mode-switch-btn:focus-visible {
338
+ background-color: rgba(0, 0, 0, 0.12);
339
+ }
340
+
341
+ .dialog-buttons {
342
+ display: flex;
343
+ align-items: center;
344
+ gap: 8px;
345
+ }
346
+
347
+ /* Disabled state */
348
+ :host([disabled]) {
349
+ pointer-events: none;
350
+ opacity: 0.38;
351
+ }
352
+ `, r = class extends x {
353
+ constructor(...e) {
354
+ super(...e), this.value = "", this.format = "12h", this.view = "dial", this.modal = !1, this.open = !1, this.headline = "Select time", this.returnValue = "", this.autoSwitchToMinute = !0, this.cancelLabel = "Cancel", this.confirmLabel = "OK", this.activeField = "hour", this.selectedHour = 12, this.selectedMinute = 0, this.selectedPeriod = "AM", this.isDragging = !1, this.handleDialPointerDown = (t) => {
355
+ this.disabled || (this.isDragging = !0, t.currentTarget.setPointerCapture(t.pointerId), this.updateDialFromPointer(t));
356
+ }, this.handleDialPointerMove = (t) => {
357
+ !this.isDragging || this.disabled || this.updateDialFromPointer(t);
358
+ }, this.handleDialPointerUp = (t) => {
359
+ !this.isDragging || this.disabled || (this.isDragging = !1, this.updateDialFromPointer(t), this.syncFormValue(), this.emitEvent("change", {
360
+ value: this.value,
361
+ hour: this.selectedHour,
362
+ minute: this.selectedMinute,
363
+ period: this.selectedPeriod,
364
+ formatted24: this.getFormatted24(),
365
+ formatted12: this.getFormatted12()
366
+ }), this.activeField === "hour" && this.autoSwitchToMinute && (this.activeField = "minute"));
367
+ }, this.handleHourInput = (t) => {
368
+ const n = t.target;
369
+ let s = parseInt(n.value, 10);
370
+ isNaN(s) || (this.format === "24h" ? s = Math.min(23, Math.max(0, s)) : s = Math.min(12, Math.max(1, s)), this.selectedHour = s, this.syncFormValue(), this.notifyInput(), n.value.length >= 2 && this.minuteInputElement && (this.minuteInputElement.focus(), this.minuteInputElement.select()));
371
+ }, this.handleMinuteInput = (t) => {
372
+ const n = t.target;
373
+ let s = parseInt(n.value, 10);
374
+ isNaN(s) || (s = Math.min(59, Math.max(0, s)), this.selectedMinute = s, this.syncFormValue(), this.notifyInput());
375
+ }, this.handleHourBlur = () => {
376
+ this.hourInputElement && (this.hourInputElement.value = this.selectedHour.toString().padStart(2, "0")), this.syncFormValue(), this.emitEvent("change", {
377
+ value: this.value,
378
+ hour: this.selectedHour,
379
+ minute: this.selectedMinute,
380
+ period: this.selectedPeriod
381
+ });
382
+ }, this.handleMinuteBlur = () => {
383
+ this.minuteInputElement && (this.minuteInputElement.value = this.selectedMinute.toString().padStart(2, "0")), this.syncFormValue(), this.emitEvent("change", {
384
+ value: this.value,
385
+ hour: this.selectedHour,
386
+ minute: this.selectedMinute,
387
+ period: this.selectedPeriod
388
+ });
389
+ };
390
+ }
391
+ static {
392
+ this.styles = [x.styles, w];
393
+ }
394
+ connectedCallback() {
395
+ super.connectedCallback(), this.parseValue(this.value), this.syncFormValue();
396
+ }
397
+ willUpdate(e) {
398
+ super.willUpdate(e), e.has("value") && (this.parseValue(this.value), this.syncFormValue());
399
+ }
400
+ parseValue(e) {
401
+ if (!e || typeof e != "string") {
402
+ const i = /* @__PURE__ */ new Date();
403
+ let l = i.getHours();
404
+ const o = i.getMinutes();
405
+ let u = "AM";
406
+ this.format === "12h" && (u = l >= 12 ? "PM" : "AM", l = l % 12 || 12), this.selectedHour = l, this.selectedMinute = o, this.selectedPeriod = u;
407
+ return;
408
+ }
409
+ const t = e.trim(), n = t.match(/^(\d{1,2}):(\d{2})\s*(AM|PM)$/i), s = t.match(/^(\d{1,2}):(\d{2})$/);
410
+ if (n) {
411
+ let i = parseInt(n[1], 10);
412
+ const l = Math.min(59, Math.max(0, parseInt(n[2], 10))), o = n[3].toUpperCase();
413
+ this.format === "24h" ? (o === "PM" && i < 12 && (i += 12), o === "AM" && i === 12 && (i = 0)) : i = Math.min(12, Math.max(1, i)), this.selectedHour = i, this.selectedMinute = l, this.selectedPeriod = o;
414
+ } else if (s) {
415
+ let i = parseInt(s[1], 10);
416
+ const l = Math.min(59, Math.max(0, parseInt(s[2], 10)));
417
+ if (this.format === "12h") {
418
+ const o = i >= 12 ? "PM" : "AM";
419
+ i = i % 12 || 12, this.selectedPeriod = o;
420
+ } else i = Math.min(23, Math.max(0, i));
421
+ this.selectedHour = i, this.selectedMinute = l;
422
+ }
423
+ }
424
+ getFormattedTime() {
425
+ const e = this.selectedMinute.toString().padStart(2, "0");
426
+ return this.format === "24h" ? `${this.selectedHour.toString().padStart(2, "0")}:${e}` : `${this.selectedHour.toString().padStart(2, "0")}:${e} ${this.selectedPeriod}`;
427
+ }
428
+ getFormatted24() {
429
+ const e = this.selectedMinute.toString().padStart(2, "0");
430
+ let t = this.selectedHour;
431
+ return this.format === "12h" && (this.selectedPeriod === "PM" && t < 12 && (t += 12), this.selectedPeriod === "AM" && t === 12 && (t = 0)), `${t.toString().padStart(2, "0")}:${e}`;
432
+ }
433
+ getFormatted12() {
434
+ const e = this.selectedMinute.toString().padStart(2, "0");
435
+ let t = this.selectedHour, n = this.selectedPeriod;
436
+ return this.format === "24h" && (n = t >= 12 ? "PM" : "AM", t = t % 12 || 12), `${t.toString().padStart(2, "0")}:${e} ${n}`;
437
+ }
438
+ syncFormValue() {
439
+ const e = this.getFormattedTime();
440
+ this.value = e, this.setFormValue(e);
441
+ }
442
+ formResetCallback() {
443
+ this.parseValue(""), this.syncFormValue(), this.activeField = "hour";
444
+ }
445
+ showModal() {
446
+ this.modal = !0, this.open = !0, this.emitEvent("open");
447
+ }
448
+ show() {
449
+ this.open = !0, this.emitEvent("open");
450
+ }
451
+ close(e) {
452
+ e !== void 0 && (this.returnValue = e), this.open = !1, this.emitEvent("close", { returnValue: this.returnValue });
453
+ }
454
+ confirm() {
455
+ this.syncFormValue();
456
+ const e = {
457
+ value: this.value,
458
+ hour: this.selectedHour,
459
+ minute: this.selectedMinute,
460
+ period: this.selectedPeriod,
461
+ formatted24: this.getFormatted24(),
462
+ formatted12: this.getFormatted12()
463
+ };
464
+ this.emitEvent("change", e), this.emitEvent("confirm", e), this.modal && this.close("confirm");
465
+ }
466
+ cancel() {
467
+ this.emitEvent("cancel"), this.modal && this.close("cancel");
468
+ }
469
+ toggleView() {
470
+ this.view = this.view === "dial" ? "input" : "dial";
471
+ }
472
+ setField(e) {
473
+ this.activeField = e;
474
+ }
475
+ setPeriod(e) {
476
+ this.selectedPeriod !== e && (this.selectedPeriod = e, this.syncFormValue(), this.notifyInput());
477
+ }
478
+ notifyInput() {
479
+ this.emitEvent("input", {
480
+ value: this.getFormattedTime(),
481
+ hour: this.selectedHour,
482
+ minute: this.selectedMinute,
483
+ period: this.selectedPeriod,
484
+ formatted24: this.getFormatted24(),
485
+ formatted12: this.getFormatted12()
486
+ });
487
+ }
488
+ updateDialFromPointer(e) {
489
+ if (!this.dialContainer) return;
490
+ const t = this.dialContainer.getBoundingClientRect(), n = t.left + t.width / 2, s = t.top + t.height / 2, i = e.clientX - n, l = e.clientY - s;
491
+ let o = Math.atan2(l, i) * (180 / Math.PI) + 90;
492
+ o < 0 && (o += 360);
493
+ const u = Math.hypot(i, l);
494
+ if (this.activeField === "hour")
495
+ if (this.format === "24h") {
496
+ const c = u < 80;
497
+ let h = Math.round(o / 30) % 12;
498
+ h === 0 && (h = 12), c ? this.selectedHour = h : this.selectedHour = h === 12 ? 0 : h + 12;
499
+ } else {
500
+ let c = Math.round(o / 30) % 12;
501
+ c === 0 && (c = 12), this.selectedHour = c;
502
+ }
503
+ else {
504
+ const c = Math.round(o / 6) % 60;
505
+ this.selectedMinute = c;
506
+ }
507
+ this.notifyInput();
508
+ }
509
+ renderDialHand() {
510
+ let e = 0, t = 96;
511
+ this.activeField === "hour" ? this.format === "24h" ? this.selectedHour >= 1 && this.selectedHour <= 12 ? (e = this.selectedHour % 12 * 30, t = 64) : (e = (this.selectedHour === 0 ? 12 : this.selectedHour - 12) % 12 * 30, t = 98) : (e = this.selectedHour % 12 * 30, t = 96) : (e = this.selectedMinute * 6, t = 96);
512
+ const n = this.activeField === "minute" && this.selectedMinute % 5 !== 0;
513
+ return d`
514
+ <div
515
+ class="dial-hand"
516
+ style="transform: rotate(${e}deg); height: ${t}px;"
517
+ >
518
+ <div class="dial-selector-head">
519
+ ${n ? d`<div class="dial-inner-dot"></div>` : m}
520
+ </div>
521
+ </div>
522
+ `;
523
+ }
524
+ renderDialNumbers() {
525
+ const t = [];
526
+ if (this.activeField === "hour")
527
+ if (this.format === "24h") {
528
+ const s = [
529
+ 12,
530
+ 1,
531
+ 2,
532
+ 3,
533
+ 4,
534
+ 5,
535
+ 6,
536
+ 7,
537
+ 8,
538
+ 9,
539
+ 10,
540
+ 11
541
+ ];
542
+ for (let o = 0; o < 12; o++) {
543
+ const u = s[o] === 12 ? 0 : s[o] + 12, c = u.toString().padStart(2, "0"), h = (o * 30 - 90) * (Math.PI / 180), v = 128 + 98 * Math.cos(h), g = 128 + 98 * Math.sin(h), b = this.selectedHour === u;
544
+ t.push(d`
545
+ <span
546
+ class="dial-number small ${b ? "selected" : ""}"
547
+ style="left: ${v}px; top: ${g}px;"
548
+ >
549
+ ${c}
550
+ </span>
551
+ `);
552
+ }
553
+ const i = 64, l = [
554
+ 12,
555
+ 1,
556
+ 2,
557
+ 3,
558
+ 4,
559
+ 5,
560
+ 6,
561
+ 7,
562
+ 8,
563
+ 9,
564
+ 10,
565
+ 11
566
+ ];
567
+ for (let o = 0; o < 12; o++) {
568
+ const u = l[o], c = u.toString(), h = (o * 30 - 90) * (Math.PI / 180), v = 128 + i * Math.cos(h), g = 128 + i * Math.sin(h), b = this.selectedHour === u;
569
+ t.push(d`
570
+ <span
571
+ class="dial-number ${b ? "selected" : ""}"
572
+ style="left: ${v}px; top: ${g}px;"
573
+ >
574
+ ${c}
575
+ </span>
576
+ `);
577
+ }
578
+ } else {
579
+ const s = [
580
+ 12,
581
+ 1,
582
+ 2,
583
+ 3,
584
+ 4,
585
+ 5,
586
+ 6,
587
+ 7,
588
+ 8,
589
+ 9,
590
+ 10,
591
+ 11
592
+ ];
593
+ for (let i = 0; i < 12; i++) {
594
+ const l = s[i], o = (i * 30 - 90) * (Math.PI / 180), u = 128 + 96 * Math.cos(o), c = 128 + 96 * Math.sin(o), h = this.selectedHour === l;
595
+ t.push(d`
596
+ <span
597
+ class="dial-number ${h ? "selected" : ""}"
598
+ style="left: ${u}px; top: ${c}px;"
599
+ >
600
+ ${l}
601
+ </span>
602
+ `);
603
+ }
604
+ }
605
+ else
606
+ for (let s = 0; s < 12; s++) {
607
+ const i = s * 5, l = i.toString().padStart(2, "0"), o = (s * 30 - 90) * (Math.PI / 180), u = 128 + 96 * Math.cos(o), c = 128 + 96 * Math.sin(o), h = this.selectedMinute === i;
608
+ t.push(d`
609
+ <span
610
+ class="dial-number ${h ? "selected" : ""}"
611
+ style="left: ${u}px; top: ${c}px;"
612
+ >
613
+ ${l}
614
+ </span>
615
+ `);
616
+ }
617
+ return t;
618
+ }
619
+ render() {
620
+ const e = this.selectedHour.toString().padStart(2, "0"), t = this.selectedMinute.toString().padStart(2, "0");
621
+ return d`
622
+ ${this.modal ? d`<div class="scrim" @click=${this.cancel}></div>` : m}
623
+
624
+ <div class="picker-surface" role="dialog" aria-modal=${this.modal ? "true" : "false"}>
625
+ <div class="header">
626
+ <h2 class="headline">${this.headline}</h2>
627
+ </div>
628
+
629
+ <div class="time-display-row">
630
+ <div class="time-card-wrapper">
631
+ ${this.view === "input" ? d`
632
+ <div class="time-card ${this.activeField === "hour" ? "active" : ""}">
633
+ <input
634
+ id="hour-input"
635
+ class="time-input"
636
+ type="text"
637
+ inputmode="numeric"
638
+ maxlength="2"
639
+ .value=${e}
640
+ @input=${this.handleHourInput}
641
+ @blur=${this.handleHourBlur}
642
+ @focus=${() => this.setField("hour")}
643
+ aria-label="Hour"
644
+ />
645
+ </div>
646
+ ` : d`
647
+ <button
648
+ type="button"
649
+ class="time-card ${this.activeField === "hour" ? "active" : ""}"
650
+ @click=${() => this.setField("hour")}
651
+ aria-label="Select hour"
652
+ >
653
+ ${e}
654
+ </button>
655
+ `}
656
+ ${this.view === "input" ? d`<span class="time-card-label">Hour</span>` : m}
657
+ </div>
658
+
659
+ <span class="time-separator" aria-hidden="true">:</span>
660
+
661
+ <div class="time-card-wrapper">
662
+ ${this.view === "input" ? d`
663
+ <div class="time-card ${this.activeField === "minute" ? "active" : ""}">
664
+ <input
665
+ id="minute-input"
666
+ class="time-input"
667
+ type="text"
668
+ inputmode="numeric"
669
+ maxlength="2"
670
+ .value=${t}
671
+ @input=${this.handleMinuteInput}
672
+ @blur=${this.handleMinuteBlur}
673
+ @focus=${() => this.setField("minute")}
674
+ aria-label="Minute"
675
+ />
676
+ </div>
677
+ ` : d`
678
+ <button
679
+ type="button"
680
+ class="time-card ${this.activeField === "minute" ? "active" : ""}"
681
+ @click=${() => this.setField("minute")}
682
+ aria-label="Select minute"
683
+ >
684
+ ${t}
685
+ </button>
686
+ `}
687
+ ${this.view === "input" ? d`<span class="time-card-label">Minute</span>` : m}
688
+ </div>
689
+
690
+ ${this.format === "12h" ? d`
691
+ <div class="period-toggle" role="group" aria-label="Period selector">
692
+ <button
693
+ type="button"
694
+ class="period-button ${this.selectedPeriod === "AM" ? "selected" : ""}"
695
+ @click=${() => this.setPeriod("AM")}
696
+ aria-pressed=${this.selectedPeriod === "AM"}
697
+ >
698
+ AM
699
+ </button>
700
+ <button
701
+ type="button"
702
+ class="period-button ${this.selectedPeriod === "PM" ? "selected" : ""}"
703
+ @click=${() => this.setPeriod("PM")}
704
+ aria-pressed=${this.selectedPeriod === "PM"}
705
+ >
706
+ PM
707
+ </button>
708
+ </div>
709
+ ` : m}
710
+ </div>
711
+
712
+ ${this.view === "dial" ? d`
713
+ <div
714
+ class="dial-container"
715
+ @pointerdown=${this.handleDialPointerDown}
716
+ @pointermove=${this.handleDialPointerMove}
717
+ @pointerup=${this.handleDialPointerUp}
718
+ >
719
+ <div class="dial-center-pin"></div>
720
+ ${this.renderDialHand()}
721
+ ${this.renderDialNumbers()}
722
+ </div>
723
+ ` : m}
724
+
725
+ <div class="actions-row">
726
+ <button
727
+ type="button"
728
+ class="mode-switch-btn"
729
+ aria-label=${this.view === "dial" ? "Switch to text input" : "Switch to clock dial"}
730
+ @click=${this.toggleView}
731
+ >
732
+ <md-icon name=${this.view === "dial" ? "keyboard" : "schedule"}></md-icon>
733
+ </button>
734
+
735
+ <div class="dialog-buttons">
736
+ <md-button variant="text" @click=${this.cancel}>${this.cancelLabel}</md-button>
737
+ <md-button variant="text" @click=${this.confirm}>${this.confirmLabel}</md-button>
738
+ </div>
739
+ </div>
740
+ </div>
741
+ `;
742
+ }
743
+ };
744
+ a([p({ type: String })], r.prototype, "value", void 0);
745
+ a([p({ type: String })], r.prototype, "format", void 0);
746
+ a([p({ type: String })], r.prototype, "view", void 0);
747
+ a([p({
748
+ type: Boolean,
749
+ reflect: !0
750
+ })], r.prototype, "modal", void 0);
751
+ a([p({
752
+ type: Boolean,
753
+ reflect: !0
754
+ })], r.prototype, "open", void 0);
755
+ a([p({ type: String })], r.prototype, "headline", void 0);
756
+ a([p({
757
+ type: String,
758
+ attribute: "return-value"
759
+ })], r.prototype, "returnValue", void 0);
760
+ a([p({
761
+ type: Boolean,
762
+ attribute: "auto-switch-to-minute"
763
+ })], r.prototype, "autoSwitchToMinute", void 0);
764
+ a([p({
765
+ type: String,
766
+ attribute: "cancel-label"
767
+ })], r.prototype, "cancelLabel", void 0);
768
+ a([p({
769
+ type: String,
770
+ attribute: "confirm-label"
771
+ })], r.prototype, "confirmLabel", void 0);
772
+ a([f()], r.prototype, "activeField", void 0);
773
+ a([f()], r.prototype, "selectedHour", void 0);
774
+ a([f()], r.prototype, "selectedMinute", void 0);
775
+ a([f()], r.prototype, "selectedPeriod", void 0);
776
+ a([f()], r.prototype, "isDragging", void 0);
777
+ a([y(".dial-container")], r.prototype, "dialContainer", void 0);
778
+ a([y("#hour-input")], r.prototype, "hourInputElement", void 0);
779
+ a([y("#minute-input")], r.prototype, "minuteInputElement", void 0);
780
+ r = a([$("md-time-picker")], r);
781
+ export {
782
+ r as t
783
+ };
784
+
785
+ //# sourceMappingURL=time-picker-CZnb2sWz.js.map