material 3.10.0 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/NOTICE +3 -1
  2. package/README.md +2 -2
  3. package/dist/components/badge/index.d.ts +6 -6
  4. package/dist/components/card/index.d.ts +13 -13
  5. package/dist/components/checkbox/index.d.ts +3 -3
  6. package/dist/components/chips/index.d.ts +10 -10
  7. package/dist/components/datepicker/index.d.ts +12 -12
  8. package/dist/components/datepicker/render.js +3 -3
  9. package/dist/components/datepicker/utils.js +1 -1
  10. package/dist/components/dialog/index.d.ts +9 -9
  11. package/dist/components/divider/index.d.ts +2 -5
  12. package/dist/components/list/index.d.ts +4 -4
  13. package/dist/components/loading-indicator/index.d.ts +11 -14
  14. package/dist/components/menu/inner.d.ts +2 -2
  15. package/dist/components/menu/on-demand.d.ts +5 -9
  16. package/dist/components/menu/types.d.ts +7 -7
  17. package/dist/components/progress/types.d.ts +5 -5
  18. package/dist/components/search/features/states.js +17 -36
  19. package/dist/components/search/index.d.ts +22 -22
  20. package/dist/components/select/index.d.ts +4 -4
  21. package/dist/components/slider/index.d.ts +10 -10
  22. package/dist/components/snackbar/index.d.ts +10 -10
  23. package/dist/components/split-button/types.d.ts +3 -3
  24. package/dist/components/switch/index.d.ts +3 -3
  25. package/dist/components/tabs/index.d.ts +32 -54
  26. package/dist/components/text-field/index.d.ts +22 -29
  27. package/dist/components/timepicker/dial.js +30 -3
  28. package/dist/components/timepicker/index.d.ts +2 -2
  29. package/dist/components/timepicker/render.js +11 -8
  30. package/dist/components/tooltip/index.d.ts +2 -2
  31. package/dist/core/canvas/utils.js +3 -13
  32. package/dist/core/compose/cleanup.d.ts +1 -1
  33. package/dist/core/compose/index.d.ts +10 -13
  34. package/dist/core/config/component.d.ts +1 -4
  35. package/dist/core/dom/create.d.ts +1 -4
  36. package/dist/core/dom/index.d.ts +10 -22
  37. package/dist/core/navigation/destinations.d.ts +6 -6
  38. package/dist/core/shapes/index.d.ts +3 -3
  39. package/dist/core/utils/index.d.ts +1 -4
  40. package/dist/core/utils/mobile.d.ts +2 -2
  41. package/dist/elements/adapter.d.ts +3 -3
  42. package/dist/elements/css/datepicker.css +1 -1
  43. package/dist/elements/css/timepicker.css +1 -1
  44. package/dist/elements/define.d.ts +3 -3
  45. package/dist/elements/index.d.ts +3 -3
  46. package/dist/elements/preupgrade/badge.css +1 -1
  47. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  48. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  49. package/dist/elements/preupgrade/button-group.css +1 -1
  50. package/dist/elements/preupgrade/button.css +1 -1
  51. package/dist/elements/preupgrade/card.css +1 -1
  52. package/dist/elements/preupgrade/carousel.css +1 -1
  53. package/dist/elements/preupgrade/checkbox.css +1 -1
  54. package/dist/elements/preupgrade/chips.css +1 -1
  55. package/dist/elements/preupgrade/datepicker.css +1 -1
  56. package/dist/elements/preupgrade/dialog.css +1 -1
  57. package/dist/elements/preupgrade/divider.css +1 -1
  58. package/dist/elements/preupgrade/drawer.css +1 -1
  59. package/dist/elements/preupgrade/extended-fab.css +1 -1
  60. package/dist/elements/preupgrade/fab-menu.css +1 -1
  61. package/dist/elements/preupgrade/fab.css +1 -1
  62. package/dist/elements/preupgrade/icon-button.css +1 -1
  63. package/dist/elements/preupgrade/list.css +1 -1
  64. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  65. package/dist/elements/preupgrade/menu.css +1 -1
  66. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  67. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  68. package/dist/elements/preupgrade/progress.css +1 -1
  69. package/dist/elements/preupgrade/radios.css +1 -1
  70. package/dist/elements/preupgrade/search.css +1 -1
  71. package/dist/elements/preupgrade/select.css +1 -1
  72. package/dist/elements/preupgrade/side-sheet.css +1 -1
  73. package/dist/elements/preupgrade/slider.css +1 -1
  74. package/dist/elements/preupgrade/snackbar.css +1 -1
  75. package/dist/elements/preupgrade/split-button.css +1 -1
  76. package/dist/elements/preupgrade/switch.css +1 -1
  77. package/dist/elements/preupgrade/tabs.css +1 -1
  78. package/dist/elements/preupgrade/text-field.css +1 -1
  79. package/dist/elements/preupgrade/timepicker.css +1 -1
  80. package/dist/elements/preupgrade/toolbar.css +1 -1
  81. package/dist/elements/preupgrade/tooltip.css +1 -1
  82. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  83. package/dist/elements/preupgrade.css +1 -1
  84. package/dist/elements/styles.d.ts +7 -7
  85. package/dist/elements/styles.js +2 -2
  86. package/dist/react/create.d.ts +2 -6
  87. package/dist/solid/create.d.ts +2 -7
  88. package/dist/styles/badge.css +1 -1
  89. package/dist/styles/base-lite.css +1 -1
  90. package/dist/styles/base.css +1 -1
  91. package/dist/styles/bottom-app-bar.css +1 -1
  92. package/dist/styles/bottom-sheet.css +1 -1
  93. package/dist/styles/button-group.css +1 -1
  94. package/dist/styles/button.css +1 -1
  95. package/dist/styles/card.css +1 -1
  96. package/dist/styles/carousel.css +1 -1
  97. package/dist/styles/checkbox.css +1 -1
  98. package/dist/styles/chips.css +1 -1
  99. package/dist/styles/contrast.css +1 -1
  100. package/dist/styles/datepicker.css +2 -2
  101. package/dist/styles/dialog.css +1 -1
  102. package/dist/styles/divider.css +1 -1
  103. package/dist/styles/drawer.css +1 -1
  104. package/dist/styles/extended-fab.css +1 -1
  105. package/dist/styles/fab-menu.css +1 -1
  106. package/dist/styles/fab.css +1 -1
  107. package/dist/styles/icon-button.css +1 -1
  108. package/dist/styles/list.css +1 -1
  109. package/dist/styles/loading-indicator.css +1 -1
  110. package/dist/styles/menu.css +1 -1
  111. package/dist/styles/navigation-bar.css +1 -1
  112. package/dist/styles/navigation-rail.css +1 -1
  113. package/dist/styles/progress.css +1 -1
  114. package/dist/styles/radios.css +1 -1
  115. package/dist/styles/search.css +1 -1
  116. package/dist/styles/select.css +1 -1
  117. package/dist/styles/side-sheet.css +1 -1
  118. package/dist/styles/slider.css +1 -1
  119. package/dist/styles/snackbar.css +1 -1
  120. package/dist/styles/split-button.css +1 -1
  121. package/dist/styles/switch.css +1 -1
  122. package/dist/styles/tabs.css +1 -1
  123. package/dist/styles/text-field.css +1 -1
  124. package/dist/styles/timepicker.css +2 -2
  125. package/dist/styles/toolbar.css +1 -1
  126. package/dist/styles/tooltip.css +1 -1
  127. package/dist/styles/top-app-bar.css +1 -1
  128. package/dist/styles/typography.css +1 -1
  129. package/dist/styles/utilities.css +1 -1
  130. package/dist/styles.css +2 -2
  131. package/dist/svelte/runtime.d.ts +6 -10
  132. package/dist/theme/vendor/contrast/contrast.js +1 -16
  133. package/dist/theme/vendor/dislike/dislike_analyzer.js +1 -16
  134. package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +1 -16
  135. package/dist/theme/vendor/dynamiccolor/color_spec_2025.js +1 -16
  136. package/dist/theme/vendor/dynamiccolor/contrast_curve.js +1 -16
  137. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +2 -2
  138. package/dist/theme/vendor/dynamiccolor/dynamic_color.js +1 -16
  139. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +2 -2
  140. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +1 -16
  141. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +1 -16
  142. package/dist/theme/vendor/dynamiccolor/spec_2025.js +1 -16
  143. package/dist/theme/vendor/dynamiccolor/spec_extensions.js +1 -16
  144. package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +1 -16
  145. package/dist/theme/vendor/dynamiccolor/variant.js +1 -16
  146. package/dist/theme/vendor/hct/cam16.js +1 -16
  147. package/dist/theme/vendor/hct/hct.js +1 -16
  148. package/dist/theme/vendor/hct/hct_solver.js +1 -16
  149. package/dist/theme/vendor/hct/viewing_conditions.js +1 -16
  150. package/dist/theme/vendor/palettes/tonal_palette.d.ts +6 -9
  151. package/dist/theme/vendor/palettes/tonal_palette.js +1 -16
  152. package/dist/theme/vendor/quantize/lab_point_provider.js +1 -16
  153. package/dist/theme/vendor/quantize/quantizer_celebi.js +1 -16
  154. package/dist/theme/vendor/quantize/quantizer_map.js +1 -16
  155. package/dist/theme/vendor/quantize/quantizer_wsmeans.js +1 -16
  156. package/dist/theme/vendor/quantize/quantizer_wu.js +1 -16
  157. package/dist/theme/vendor/score/score.js +1 -16
  158. package/dist/theme/vendor/temperature/temperature_cache.js +1 -16
  159. package/dist/theme/vendor/utils/color_utils.js +1 -16
  160. package/dist/theme/vendor/utils/image_utils.js +1 -16
  161. package/dist/theme/vendor/utils/math_utils.js +1 -16
  162. package/dist/theme/vendor/utils/string_utils.js +1 -16
  163. package/dist/themes/autumn-contrast.css +1 -1
  164. package/dist/themes/autumn.css +1 -1
  165. package/dist/themes/baseline-contrast.css +1 -1
  166. package/dist/themes/baseline.css +1 -1
  167. package/dist/themes/brownbeige-contrast.css +1 -1
  168. package/dist/themes/brownbeige.css +1 -1
  169. package/dist/themes/content-contrast.css +1 -1
  170. package/dist/themes/content.css +1 -1
  171. package/dist/themes/desert-contrast.css +1 -1
  172. package/dist/themes/desert.css +1 -1
  173. package/dist/themes/expressive-contrast.css +1 -1
  174. package/dist/themes/expressive.css +1 -1
  175. package/dist/themes/fidelity-contrast.css +1 -1
  176. package/dist/themes/fidelity.css +1 -1
  177. package/dist/themes/forest-contrast.css +1 -1
  178. package/dist/themes/forest.css +1 -1
  179. package/dist/themes/fruit-salad-contrast.css +1 -1
  180. package/dist/themes/fruit-salad.css +1 -1
  181. package/dist/themes/highcontrast-contrast.css +1 -1
  182. package/dist/themes/highcontrast.css +1 -1
  183. package/dist/themes/monochrome-contrast.css +1 -1
  184. package/dist/themes/monochrome.css +1 -1
  185. package/dist/themes/neutral-contrast.css +1 -1
  186. package/dist/themes/neutral.css +1 -1
  187. package/dist/themes/ocean-contrast.css +1 -1
  188. package/dist/themes/ocean.css +1 -1
  189. package/dist/themes/rainbow-contrast.css +1 -1
  190. package/dist/themes/rainbow.css +1 -1
  191. package/dist/themes/sageivory-contrast.css +1 -1
  192. package/dist/themes/sageivory.css +1 -1
  193. package/dist/themes/spring-contrast.css +1 -1
  194. package/dist/themes/spring.css +1 -1
  195. package/dist/themes/summer-contrast.css +1 -1
  196. package/dist/themes/summer.css +1 -1
  197. package/dist/themes/sunset-contrast.css +1 -1
  198. package/dist/themes/sunset.css +1 -1
  199. package/dist/themes/tealcaramel-contrast.css +1 -1
  200. package/dist/themes/tealcaramel.css +1 -1
  201. package/dist/themes/vibrant-contrast.css +1 -1
  202. package/dist/themes/vibrant.css +1 -1
  203. package/dist/vue/index.d.ts +2 -6
  204. package/package.json +1 -1
  205. package/src/styles/components/_datepicker.scss +1 -1
  206. package/src/styles/components/_timepicker.scss +17 -4
package/NOTICE CHANGED
@@ -25,7 +25,9 @@ Runtime colour (material/theme)
25
25
  The files under src/theme/vendor are a copy of material-color-utilities
26
26
  (https://github.com/material-foundation/material-color-utilities),
27
27
  Copyright 2021 Google LLC, licensed under the Apache License, Version 2.0.
28
- Each copied file keeps its original copyright and licence header.
28
+ Each copied file in src/theme/vendor keeps its original copyright and licence
29
+ header; each shipped file under dist/theme/vendor carries a one-line
30
+ Copyright Google LLC and Apache-2.0 notice pointing to this NOTICE file.
29
31
 
30
32
  The full licence text follows.
31
33
 
package/README.md CHANGED
@@ -94,11 +94,11 @@ What a bundler keeps, minified and gzipped (kB is 1,000 bytes), measured from th
94
94
  | `createButton` from `material`, with code splitting: the initial chunks (the progress indicator loads on demand) | 7.6 kB |
95
95
  | `createButton`, without code splitting (the progress indicator included) | 13.9 kB |
96
96
  | `createButton`, `createTextField` and `createCheckbox`, without code splitting | 20.4 kB |
97
- | Everything the root exports (`export * from 'material'`), without code splitting | 130.5 kB |
97
+ | Everything the root exports (`export * from 'material'`), without code splitting | 130.8 kB |
98
98
  | `material/styles/base` | 3.1 kB |
99
99
  | `material/styles/base-lite` | 1.7 kB |
100
100
  | `material/styles/base` and `material/styles/button` | 5.4 kB |
101
- | `material/styles`, the full stylesheet | 59.4 kB |
101
+ | `material/styles`, the full stylesheet | 59.6 kB |
102
102
  <!-- /sizes -->
103
103
 
104
104
  `material` publishes ESM only, so bundlers drop what you do not import. Each component's page on [md3.io/components](https://md3.io/components/) gives its size.
@@ -51,19 +51,19 @@ interface BadgeConfig {
51
51
  componentName?: string;
52
52
  }
53
53
 
54
- /** The visibility control withVisibility installs on a badge. */
54
+
55
55
  interface BadgeVisibility {
56
- /** Shows the badge */
56
+
57
57
  show: () => void;
58
- /** Hides the badge */
58
+
59
59
  hide: () => void;
60
- /** Toggles badge visibility, or forces it when given a flag */
60
+
61
61
  toggle: (visible?: boolean) => void;
62
- /** Whether the badge is currently visible */
62
+
63
63
  isVisible: () => boolean;
64
64
  }
65
65
 
66
- /** What a badge feature enhancer needs from the component it is handed. */
66
+
67
67
  interface BadgeFeatureHost extends ElementComponent {
68
68
  config: BadgeConfig & Record<string, unknown>;
69
69
  wrapper?: HTMLElement;
@@ -275,38 +275,38 @@ interface CardComponent extends BaseComponent {
275
275
  destroy: () => void;
276
276
  }
277
277
 
278
- /** Loading feature interface. */
278
+
279
279
  interface LoadingFeature {
280
- /** Check if loading state is active */
280
+
281
281
  isLoading: () => boolean;
282
- /** Set loading state */
282
+
283
283
  setLoading: (loading: boolean) => void;
284
284
  }
285
285
 
286
- /** Expandable feature interface. */
286
+
287
287
  interface ExpandableFeature {
288
- /** Check if expanded state is active */
288
+
289
289
  isExpanded: () => boolean;
290
- /** Set expanded state */
290
+
291
291
  setExpanded: (expanded: boolean) => void;
292
- /** Toggle expanded state */
292
+
293
293
  toggleExpanded: () => void;
294
294
  }
295
295
 
296
- /** Swipeable feature interface. */
296
+
297
297
  interface SwipeableFeature {
298
- /** Reset swipe position */
298
+
299
299
  reset: () => void;
300
300
  }
301
301
 
302
- /** API options interface. */
302
+
303
303
  interface ApiOptions {
304
- /** Lifecycle methods */
304
+
305
305
  lifecycle: {
306
- /** Destroy callback */
306
+
307
307
  destroy: () => void;
308
308
  };
309
- /** The resolved configuration the card was created from */
309
+
310
310
  config: CardComponentConfig;
311
311
  }
312
312
 
@@ -149,7 +149,7 @@ interface CheckboxComponent {
149
149
  destroy: () => void;
150
150
  }
151
151
 
152
- /** API options interface for internal use */
152
+
153
153
  interface ApiOptions {
154
154
  disabled: {
155
155
  enable: () => void;
@@ -167,7 +167,7 @@ interface ApiOptions {
167
167
  };
168
168
  }
169
169
 
170
- /** Base component interface for internal composition */
170
+
171
171
  interface BaseComponent {
172
172
  element: HTMLElement;
173
173
  input?: HTMLInputElement;
@@ -197,7 +197,7 @@ interface BaseComponent {
197
197
  };
198
198
  }
199
199
 
200
- /** Component as it reaches the API step of the pipeline. */
200
+
201
201
  type ApiComponent = BaseComponent & Required<Pick<BaseComponent, "checkable" | "disabled" | "lifecycle">>;
202
202
 
203
203
  /** Registers CheckboxConfig with the global defaults map, so `setComponentDefaults("checkbox", ...)` is typed without core importing anything from this component. */
@@ -45,13 +45,13 @@ interface ChipConfig {
45
45
  }
46
46
 
47
47
  interface ChipOptions extends ChipConfig {
48
- /** Selection belongs to the chips container. */
48
+
49
49
  managedSelection?: boolean;
50
- /** Notify the owning set when a chip becomes selected. */
50
+
51
51
  onSelected?: (chip: ChipComponent) => void;
52
- /** The owning set removes the chip, once its `remove` listeners have run. */
52
+
53
53
  onRemoved?: (chip: ChipComponent) => void;
54
- /** The chip is a cell of a chip set's grid: the root is a `gridcell`, and a one-action chip's cell is its focus target. */
54
+
55
55
  cell?: boolean;
56
56
  }
57
57
 
@@ -169,17 +169,17 @@ interface ChipsConfig {
169
169
  on?: Partial<ChipsEvents>;
170
170
  }
171
171
 
172
- /** Chips component interface */
173
- /** What a chips feature needs from the component it is handed. */
172
+
173
+
174
174
  interface ChipsFeatureComponent {
175
175
  element: HTMLElement;
176
176
  getClass: (name: string) => string;
177
177
  emit?: (event: string, data: unknown) => unknown;
178
- /** withDom builds this; the controller appends chips to it */
178
+
179
179
  chipContainer?: HTMLElement;
180
- /** withChipItems keeps the live chips here. */
180
+
181
181
  chipInstances: ChipComponent[];
182
- /** withContainer installs this whole, so the members are not optional in it */
182
+
183
183
  layout?: {
184
184
  isVertical: () => boolean;
185
185
  isScrollable: () => boolean;
@@ -190,7 +190,7 @@ interface ChipsFeatureComponent {
190
190
  };
191
191
  }
192
192
 
193
- /** The handlers the chips controller keeps per event name. */
193
+
194
194
  type ChipsEventListeners = Record<string, EventCallback[]>;
195
195
 
196
196
  /** The payload of the chips set's `change`. */
@@ -146,25 +146,25 @@ interface DatePickerConfig {
146
146
  }>;
147
147
  }
148
148
 
149
- /** Date object with additional properties for rendering */
149
+
150
150
  interface CalendarDate {
151
- /** JavaScript Date object */
151
+
152
152
  date: Date;
153
- /** Day of the month (1-31) */
153
+
154
154
  day: number;
155
- /** Whether the date is in the current month being displayed */
155
+
156
156
  isCurrentMonth: boolean;
157
- /** Whether the date is today */
157
+
158
158
  isToday: boolean;
159
- /** Whether the date is selected */
159
+
160
160
  isSelected: boolean;
161
- /** Whether the date is disabled */
161
+
162
162
  isDisabled: boolean;
163
- /** Whether the date is the first date in a range */
163
+
164
164
  isRangeStart?: boolean;
165
- /** Whether the date is the last date in a range */
165
+
166
166
  isRangeEnd?: boolean;
167
- /** Whether the date is between start and end in a range */
167
+
168
168
  isRangeMiddle?: boolean;
169
169
  }
170
170
 
@@ -278,7 +278,7 @@ interface DatePickerComponent<V = DatePickerValue> {
278
278
  off: <K extends keyof DatePickerEvents<V>>(event: K, handler: DatePickerEvents<V>[K]) => DatePickerComponent<V>;
279
279
  }
280
280
 
281
- /** Internal calendar view model. */
281
+
282
282
  interface DatePickerState {
283
283
  selectedDate: Date | null;
284
284
  rangeEndDate: Date | null;
@@ -299,7 +299,7 @@ interface DatePickerState {
299
299
  label: string;
300
300
  specialDates: NonNullable<DatePickerConfig["specialDates"]>;
301
301
  isAllowed(date: Date): boolean;
302
- /** Full screen: the first month of the rendered list, and how many follow. */
302
+
303
303
  listStart?: Date;
304
304
  listLength?: number;
305
305
  }
@@ -28,7 +28,7 @@ for (let week = 0; week < 6; week++) {
28
28
  const row = make("div", "week", undefined, { role: "row" });
29
29
  for (const item of dates.slice(week * 7, week * 7 + 7)) {
30
30
  const selected = !!state.selectedDate && (isSameDay(item.date, state.selectedDate) || !!state.rangeEndDate && isSameDay(item.date, state.rangeEndDate));
31
- const inRange = item.isCurrentMonth && !!state.selectedDate && !!state.rangeEndDate && item.date >= state.selectedDate && item.date <= state.rangeEndDate;
31
+ const inRange = !!state.selectedDate && !!state.rangeEndDate && item.date >= state.selectedDate && item.date <= state.rangeEndDate;
32
32
  if (list && !item.isCurrentMonth) {
33
33
  row.append(make("div", "cell", undefined, { role: "gridcell" }));
34
34
  continue;
@@ -36,9 +36,9 @@ continue;
36
36
  const cell = make("div", "cell");
37
37
  if (inRange)
38
38
  cell.classList.add(cls("cell--range"));
39
- if (item.isCurrentMonth && state.selectedDate && isSameDay(item.date, state.selectedDate))
39
+ if ((item.isCurrentMonth || inRange) && state.selectedDate && isSameDay(item.date, state.selectedDate))
40
40
  cell.classList.add(cls("cell--range-start"));
41
- if (item.isCurrentMonth && state.rangeEndDate && isSameDay(item.date, state.rangeEndDate))
41
+ if ((item.isCurrentMonth || inRange) && state.rangeEndDate && isSameDay(item.date, state.rangeEndDate))
42
42
  cell.classList.add(cls("cell--range-end"));
43
43
  const special = state.specialDates.find(special => { const date = parseDate(special.date); return date && isSameDay(date, item.date); });
44
44
  const day = make("button", "day", String(item.day), {
@@ -109,7 +109,7 @@ isToday: isSameDay(date, today),
109
109
  isSelected: selectedDate ? isSameDay(date, selectedDate) : false,
110
110
  isDisabled: Boolean((minDate && date < minDate) || (maxDate && date > maxDate)),
111
111
  };
112
- if (isCurrentMonth && selectedDate && rangeEndDate) {
112
+ if (selectedDate && rangeEndDate) {
113
113
  calendarDate.isRangeStart = isSameDay(date, selectedDate);
114
114
  calendarDate.isRangeEnd = isSameDay(date, rangeEndDate);
115
115
  calendarDate.isRangeMiddle = date >= selectedDate && date <= rangeEndDate && !calendarDate.isRangeStart && !calendarDate.isRangeEnd;
@@ -150,28 +150,28 @@ interface DialogEvent {
150
150
  defaultPrevented: boolean;
151
151
  }
152
152
 
153
- /** Dialog component interface */
154
- /** The elements withStructure builds and hangs off the component. */
153
+
154
+
155
155
  interface DialogStructure {
156
- /** Always built by withStructure, whatever the config */
156
+
157
157
  header: HTMLElement;
158
- /** Always built by withStructure, whatever the config */
158
+
159
159
  content: HTMLElement;
160
- /** Only when the dialog has buttons, and set back to null when the last goes */
160
+
161
161
  footer: HTMLElement | null;
162
- /** The <hr> elements between the sections, only while shown */
162
+
163
163
  headerDivider: HTMLElement | null;
164
164
  footerDivider: HTMLElement | null;
165
165
  container: HTMLElement;
166
166
  }
167
167
 
168
- /** A footer button as the dialog keeps it: the live button component and the config it was built from. */
168
+
169
169
  interface DialogButtonRecord {
170
170
  instance: ButtonComponent;
171
171
  config: DialogButton;
172
172
  }
173
173
 
174
- /** What a dialog feature needs from the component it is handed. */
174
+
175
175
  interface DialogFeatureComponent {
176
176
  element: HTMLElement;
177
177
  config: DialogConfig & Record<string, unknown>;
@@ -182,7 +182,7 @@ interface DialogFeatureComponent {
182
182
  _buttons?: DialogButtonRecord[];
183
183
  }
184
184
 
185
- /** A dialog that has been through withStructure. */
185
+
186
186
  interface DialogStructured extends DialogFeatureComponent {
187
187
  overlay: HTMLElement;
188
188
  structure: DialogStructure;
@@ -88,13 +88,10 @@ interface DividerConfig {
88
88
  componentName?: string;
89
89
  }
90
90
 
91
- /** Default configuration for dividers */
91
+
92
92
  declare const defaultConfig: Partial<DividerConfig>;
93
93
 
94
- /**
95
- * Creates a base configuration object for divider Merges user-provided configuration with default values and ensures all required properties have values.
96
- * @param config
97
- */
94
+
98
95
  declare const createBaseConfig: (config?: DividerConfig) => DividerConfig;
99
96
  export type { DividerComponent, DividerConfig };
100
97
  export { createDivider, createDivider as default };
@@ -85,7 +85,7 @@ interface ListItem {
85
85
  selected?: boolean;
86
86
  }
87
87
 
88
- /** What withRenderer installs at `component.list`. */
88
+
89
89
  interface ListRenderer<T = ListItem> {
90
90
  getRows: () => ListRow<T>[];
91
91
  onRender: (handler: () => void) => () => void;
@@ -134,10 +134,10 @@ interface ListRow<T = ListItem> {
134
134
  action?: HTMLButtonElement;
135
135
  }
136
136
 
137
- /** Where a scrolled-to item lands in the viewport */
137
+
138
138
  type ScrollPosition = "start" | "center" | "end";
139
139
 
140
- /** What withSelection installs. */
140
+
141
141
  interface ListSelection<T = ListItem> {
142
142
  getSelectedItems: () => T[];
143
143
  getSelectedItemIds: () => string[];
@@ -148,7 +148,7 @@ interface ListSelection<T = ListItem> {
148
148
  setSelection(itemIds: (string | number)[]): this;
149
149
  }
150
150
 
151
- /** What a list feature needs from the component it is handed. */
151
+
152
152
  interface ListFeatureHost {
153
153
  element: HTMLElement;
154
154
  getClass: (name: string) => string;
@@ -44,7 +44,7 @@ interface LoadingIndicatorComponent {
44
44
  destroy: () => void;
45
45
  }
46
46
 
47
- /** The component as it passes through the enhancers */
47
+
48
48
  interface BaseComponent {
49
49
  element: HTMLElement;
50
50
  getClass?: (name: string) => string;
@@ -61,33 +61,30 @@ interface BaseComponent {
61
61
  */
62
62
  declare const createLoadingIndicator: (config?: LoadingIndicatorConfig) => LoadingIndicatorComponent;
63
63
 
64
- /** A frame: which morph, how far along it, and the rotation in degrees */
64
+
65
65
  interface Frame {
66
- /** Index of the shape the morph starts from */
66
+
67
67
  index: number;
68
- /** 0 at the shape, 1 at the next; may overshoot */
68
+
69
69
  progress: number;
70
- /** Clockwise rotation in degrees */
70
+
71
71
  rotation: number;
72
72
  }
73
73
 
74
74
  interface Renderer {
75
- /** Draws one frame with the given shape sequence */
75
+
76
76
  draw: (shapes: readonly RadialProfile[], frame: Frame) => void;
77
- /** Resizes the canvas to the element's size */
77
+
78
78
  resize: (size: number) => void;
79
- /** Re-reads the indicator colour from the element's computed style */
79
+
80
80
  refreshColor: () => void;
81
- /** The last frame drawn, redrawn on resize and theme change */
81
+
82
82
  redraw: () => void;
83
- /** Profiles for a shape sequence, cached per name */
83
+
84
84
  profiles: (names: readonly MaterialShapeName[]) => RadialProfile[];
85
85
  }
86
86
 
87
- /**
88
- * Adds the canvas and the drawing routine
89
- * @param config
90
- */
87
+
91
88
  declare const withRenderer: (config: LoadingIndicatorConfig) => (component: BaseComponent) => BaseComponent;
92
89
  export type { LoadingIndicatorComponent, LoadingIndicatorConfig };
93
90
  export { createLoadingIndicator, createLoadingIndicator as default };
@@ -1,8 +1,8 @@
1
1
  import type { OnDemandMenu } from "./on-demand.js";
2
2
  export declare const MENU: unique symbol;
3
- /** What an owner of an inner menu carries. */
3
+
4
4
  export interface MenuOwner {
5
5
  [MENU]?: OnDemandMenu;
6
6
  }
7
- /** The menu inside a select or a split button, if it has one. */
7
+
8
8
  export declare const innerMenu: (owner: object) => OnDemandMenu | undefined;
@@ -1,13 +1,13 @@
1
1
  import type { EventCallback } from "../../core/state/emitter.js";
2
2
  import type { MenuConfig, MenuContent, MenuEvents, MenuPosition } from "./types.js";
3
- /** createMenu's configuration, except the items, which setItems may replace. */
3
+
4
4
  type MenuSettings = Omit<MenuConfig, "items">;
5
- /** The menu a select or a split button holds before the chunk arrives: the operations the two components reach on their own inner menu. */
5
+
6
6
  export interface OnDemandMenu {
7
7
  readonly element: HTMLElement;
8
- /** Starts the load without opening the menu, from the intent to open it. */
8
+
9
9
  preload(): void;
10
- /** Runs once the real menu exists, after an open that waited for it. */
10
+
11
11
  whenReady(callback: () => void): void;
12
12
  open(event?: Event, interactionType?: "mouse" | "keyboard"): OnDemandMenu;
13
13
  close(event?: Event, restoreFocus?: boolean, skipAnimation?: boolean): OnDemandMenu;
@@ -21,10 +21,6 @@ export interface OnDemandMenu {
21
21
  on(event: string, handler: EventCallback): OnDemandMenu;
22
22
  destroy(): void;
23
23
  }
24
- /**
25
- * A stand-in for the menu, replaced by it when the chunk lands
26
- * @param settings
27
- * @param items
28
- */
24
+
29
25
  export declare const createOnDemandMenu: (settings: MenuSettings, items: MenuContent[]) => OnDemandMenu;
30
26
  export {};
@@ -290,13 +290,13 @@ export interface MenuEvents {
290
290
  close: (event: MenuEvent) => void;
291
291
  select: (event: MenuSelectEvent) => void;
292
292
  }
293
- /** The menu as its own features see it, part-way through the pipe. */
294
- /** What withController installs at `component.menu`. */
295
- /** Menu state the keyboard handlers read. */
293
+
294
+
295
+
296
296
  export interface KeyboardMenuState {
297
297
  items: MenuContent[];
298
298
  }
299
- /** Menu actions the keyboard handlers call. */
299
+
300
300
  export interface KeyboardActions {
301
301
  closeMenu: (event: Event, restoreFocus?: boolean) => void;
302
302
  findItemById: (id: string) => MenuItem | null;
@@ -316,7 +316,7 @@ export interface MenuControllerApi {
316
316
  getPosition: () => MenuPosition;
317
317
  setPosition: (position: MenuPosition) => void;
318
318
  }
319
- /** A component that can act as a menu's opener: anything that exposes an element through `element`, `getElement()` or `input`, and follows the menu's open state when it can. */
319
+
320
320
  export interface OpenerComponent {
321
321
  element?: HTMLElement;
322
322
  getElement?: () => HTMLElement;
@@ -326,9 +326,9 @@ export interface OpenerComponent {
326
326
  focus?: () => void;
327
327
  blur?: () => void;
328
328
  }
329
- /** What a menu opener can be given as: a selector, an element or a component */
329
+
330
330
  export type OpenerTarget = string | HTMLElement | OpenerComponent;
331
- /** What withOpener installs at `component.opener`. */
331
+
332
332
  export interface MenuOpenerApi {
333
333
  setOpener: (opener: OpenerTarget) => void;
334
334
  getOpener: () => HTMLElement | null;
@@ -4,7 +4,7 @@ export type ProgressVariant = "linear" | "circular";
4
4
  export type ProgressThickness = "thin" | "thick" | number;
5
5
  /** Progress shape options (linear only) */
6
6
  export type ProgressShape = "flat" | "wavy";
7
- /** Progress component event types */
7
+
8
8
  export type ProgressEvent = "change" | "complete";
9
9
  /** Configuration interface for the Progress component */
10
10
  export interface ProgressConfig {
@@ -98,13 +98,13 @@ export interface ProgressEvents {
98
98
  /** The value reached the maximum */
99
99
  complete: (event: ProgressEventPayload) => void;
100
100
  }
101
- /** What the progress draws with. */
101
+
102
102
  export interface ProgressInternals {
103
- /** The canvas the indicator is drawn on */
103
+
104
104
  canvas: HTMLCanvasElement;
105
- /** Re-measures the canvas and redraws; the component does this on resize */
105
+
106
106
  resize: () => void;
107
- /** The canvas again: these three named the parts of the SVG this replaced */
107
+
108
108
  track: SVGElement;
109
109
  indicator: SVGElement;
110
110
  buffer: SVGElement;
@@ -169,57 +169,38 @@ return;
169
169
  component.element.classList.replace(getClass(currentVariant === "divided" ? SEARCH_CLASSES.VARIANT_DIVIDED : SEARCH_CLASSES.VARIANT_CONTAINED), getClass(variant === "divided" ? SEARCH_CLASSES.VARIANT_DIVIDED : SEARCH_CLASSES.VARIANT_CONTAINED));
170
170
  currentVariant = variant;
171
171
  };
172
- const disableComponent = () => {
173
- isDisabled = true;
172
+ const applyDisabled = (disabled) => {
173
+ isDisabled = disabled;
174
174
  const element = component.element;
175
175
  const structure = component.structure;
176
+ const aria = disabled ? "true" : "false";
177
+ if (disabled)
176
178
  element.classList.add(getClass(SEARCH_CLASSES.DISABLED));
177
- element.setAttribute("aria-disabled", "true");
178
- if (structure?.input) {
179
- structure.input.disabled = true;
180
- }
181
- const interactiveElements = [
182
- structure?.leadingIcon,
183
- structure?.clearButton,
184
- ].filter(Boolean);
185
- if (structure?.trailingContainer) {
186
- const trailingButtons = structure.trailingContainer.querySelectorAll("button");
187
- trailingButtons.forEach((btn) => interactiveElements.push(btn));
188
- }
189
- interactiveElements.forEach((el) => {
190
- if (el) {
191
- el.tabIndex = -1;
192
- el.setAttribute("aria-disabled", "true");
193
- }
194
- });
195
- };
196
- const enableComponent = () => {
197
- isDisabled = false;
198
- const element = component.element;
199
- const structure = component.structure;
179
+ else
200
180
  element.classList.remove(getClass(SEARCH_CLASSES.DISABLED));
201
- element.setAttribute("aria-disabled", "false");
202
- if (structure?.input) {
203
- structure.input.disabled = false;
204
- }
181
+ element.setAttribute("aria-disabled", aria);
182
+ if (structure?.input)
183
+ structure.input.disabled = disabled;
205
184
  const interactiveElements = [
206
185
  structure?.leadingIcon,
207
186
  structure?.clearButton,
208
187
  ].filter(Boolean);
209
188
  if (structure?.trailingContainer) {
210
- const trailingButtons = structure.trailingContainer.querySelectorAll("button");
211
- trailingButtons.forEach((btn) => interactiveElements.push(btn));
189
+ structure.trailingContainer.querySelectorAll("button")
190
+ .forEach((button) => interactiveElements.push(button));
212
191
  }
213
- interactiveElements.forEach((el) => {
214
- if (el) {
215
- el.tabIndex = 0;
216
- el.setAttribute("aria-disabled", "false");
192
+ interactiveElements.forEach((element) => {
193
+ if (element) {
194
+ element.tabIndex = disabled ? -1 : 0;
195
+ element.setAttribute("aria-disabled", aria);
217
196
  }
218
197
  });
219
- if (structure?.clearButton && structure.input && !structure.input.value) {
198
+ if (!disabled && structure?.clearButton && structure.input && !structure.input.value) {
220
199
  structure.clearButton.tabIndex = -1;
221
200
  }
222
201
  };
202
+ const disableComponent = () => applyDisabled(true);
203
+ const enableComponent = () => applyDisabled(false);
223
204
  const updatePopulatedState = (hasValue) => {
224
205
  const element = component.element;
225
206
  if (hasValue) {