material 3.13.1 → 3.14.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 (173) hide show
  1. package/README.md +28 -1
  2. package/dist/components/badge/index.d.ts +6 -6
  3. package/dist/components/bottom-app-bar-toolbar/index.d.ts +8 -0
  4. package/dist/components/bottom-app-bar-toolbar/index.js +66 -0
  5. package/dist/components/bottom-app-bar-toolbar/structure.js +18 -0
  6. package/dist/components/bottom-sheet/index.d.ts +6 -6
  7. package/dist/components/button/features/progress.js +6 -9
  8. package/dist/components/button-group/index.d.ts +6 -6
  9. package/dist/components/card/index.d.ts +29 -29
  10. package/dist/components/checkbox/index.d.ts +6 -6
  11. package/dist/components/chips/chip/chip.js +6 -4
  12. package/dist/components/chips/index.d.ts +18 -18
  13. package/dist/components/datepicker/index.d.ts +6 -6
  14. package/dist/components/dialog/features.js +9 -24
  15. package/dist/components/dialog/index.d.ts +6 -6
  16. package/dist/components/divider/index.d.ts +42 -42
  17. package/dist/components/fab/index.d.ts +6 -6
  18. package/dist/components/fab-menu/fab-menu.js +5 -6
  19. package/dist/components/fab-menu/index.d.ts +7 -0
  20. package/dist/components/list/index.d.ts +16 -16
  21. package/dist/components/listbox/index.d.ts +100 -0
  22. package/dist/components/listbox/index.js +1 -0
  23. package/dist/components/listbox/listbox.js +633 -0
  24. package/dist/components/loading-indicator/index.d.ts +32 -32
  25. package/dist/components/navigation-bar/index.d.ts +3 -3
  26. package/dist/components/navigation-rail/index.d.ts +3 -3
  27. package/dist/components/progress/features/canvas.js +7 -13
  28. package/dist/components/radios/index.d.ts +6 -6
  29. package/dist/components/switch/index.d.ts +6 -6
  30. package/dist/components/tabs/index.d.ts +97 -97
  31. package/dist/components/text-field/index.d.ts +51 -51
  32. package/dist/components/tooltip/index.d.ts +6 -6
  33. package/dist/core/canvas/index.d.ts +77 -77
  34. package/dist/core/compose/index.d.ts +365 -365
  35. package/dist/core/dom/index.d.ts +117 -117
  36. package/dist/core/icons/index.d.ts +5 -5
  37. package/dist/core/shapes/index.d.ts +51 -51
  38. package/dist/core/state/index.d.ts +26 -26
  39. package/dist/core/utils/index.d.ts +8 -8
  40. package/dist/elements/index.d.ts +2109 -2109
  41. package/dist/elements/preupgrade/badge.css +1 -1
  42. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  43. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  44. package/dist/elements/preupgrade/button-group.css +1 -1
  45. package/dist/elements/preupgrade/button.css +1 -1
  46. package/dist/elements/preupgrade/card.css +1 -1
  47. package/dist/elements/preupgrade/carousel.css +1 -1
  48. package/dist/elements/preupgrade/checkbox.css +1 -1
  49. package/dist/elements/preupgrade/chips.css +1 -1
  50. package/dist/elements/preupgrade/datepicker.css +1 -1
  51. package/dist/elements/preupgrade/dialog.css +1 -1
  52. package/dist/elements/preupgrade/divider.css +1 -1
  53. package/dist/elements/preupgrade/drawer.css +1 -1
  54. package/dist/elements/preupgrade/extended-fab.css +1 -1
  55. package/dist/elements/preupgrade/fab-menu.css +1 -1
  56. package/dist/elements/preupgrade/fab.css +1 -1
  57. package/dist/elements/preupgrade/icon-button.css +1 -1
  58. package/dist/elements/preupgrade/list.css +1 -1
  59. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  60. package/dist/elements/preupgrade/menu.css +1 -1
  61. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  62. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  63. package/dist/elements/preupgrade/progress.css +1 -1
  64. package/dist/elements/preupgrade/radios.css +1 -1
  65. package/dist/elements/preupgrade/search.css +1 -1
  66. package/dist/elements/preupgrade/select.css +1 -1
  67. package/dist/elements/preupgrade/side-sheet.css +1 -1
  68. package/dist/elements/preupgrade/slider.css +1 -1
  69. package/dist/elements/preupgrade/snackbar.css +1 -1
  70. package/dist/elements/preupgrade/split-button.css +1 -1
  71. package/dist/elements/preupgrade/switch.css +1 -1
  72. package/dist/elements/preupgrade/tabs.css +1 -1
  73. package/dist/elements/preupgrade/text-field.css +1 -1
  74. package/dist/elements/preupgrade/timepicker.css +1 -1
  75. package/dist/elements/preupgrade/toolbar.css +1 -1
  76. package/dist/elements/preupgrade/tooltip.css +1 -1
  77. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  78. package/dist/elements/preupgrade.css +1 -1
  79. package/dist/react/index.d.ts +47 -47
  80. package/dist/solid/index.d.ts +47 -47
  81. package/dist/styles/badge.css +1 -1
  82. package/dist/styles/base-elements.css +1 -1
  83. package/dist/styles/base-lite.css +1 -1
  84. package/dist/styles/base.css +1 -1
  85. package/dist/styles/bottom-app-bar-toolbar.css +2 -0
  86. package/dist/styles/bottom-app-bar-toolbar.js +2 -0
  87. package/dist/styles/bottom-app-bar.css +1 -1
  88. package/dist/styles/bottom-sheet.css +1 -1
  89. package/dist/styles/button-filled-small-round.css +1 -1
  90. package/dist/styles/button-group.css +1 -1
  91. package/dist/styles/button.css +1 -1
  92. package/dist/styles/card.css +1 -1
  93. package/dist/styles/carousel.css +1 -1
  94. package/dist/styles/checkbox.css +1 -1
  95. package/dist/styles/chips.css +1 -1
  96. package/dist/styles/contrast.css +1 -1
  97. package/dist/styles/datepicker.css +1 -1
  98. package/dist/styles/dialog.css +1 -1
  99. package/dist/styles/divider.css +1 -1
  100. package/dist/styles/drawer.css +1 -1
  101. package/dist/styles/extended-fab.css +1 -1
  102. package/dist/styles/fab-menu.css +1 -1
  103. package/dist/styles/fab.css +1 -1
  104. package/dist/styles/icon-button.css +1 -1
  105. package/dist/styles/list.css +1 -1
  106. package/dist/styles/listbox.css +2 -0
  107. package/dist/styles/listbox.js +2 -0
  108. package/dist/styles/loading-indicator.css +1 -1
  109. package/dist/styles/menu.css +1 -1
  110. package/dist/styles/navigation-bar.css +1 -1
  111. package/dist/styles/navigation-rail.css +1 -1
  112. package/dist/styles/progress.css +1 -1
  113. package/dist/styles/radios.css +1 -1
  114. package/dist/styles/search.css +1 -1
  115. package/dist/styles/select.css +1 -1
  116. package/dist/styles/side-sheet.css +1 -1
  117. package/dist/styles/slider.css +1 -1
  118. package/dist/styles/snackbar.css +1 -1
  119. package/dist/styles/split-button.css +1 -1
  120. package/dist/styles/switch.css +1 -1
  121. package/dist/styles/tabs.css +1 -1
  122. package/dist/styles/text-field.css +1 -1
  123. package/dist/styles/timepicker.css +1 -1
  124. package/dist/styles/toolbar.css +1 -1
  125. package/dist/styles/tooltip.css +1 -1
  126. package/dist/styles/top-app-bar.css +1 -1
  127. package/dist/styles/typography.css +1 -1
  128. package/dist/styles/utilities.css +1 -1
  129. package/dist/styles.css +1 -1
  130. package/dist/themes/autumn-contrast.css +1 -1
  131. package/dist/themes/autumn.css +1 -1
  132. package/dist/themes/baseline-contrast.css +1 -1
  133. package/dist/themes/baseline.css +1 -1
  134. package/dist/themes/brownbeige-contrast.css +1 -1
  135. package/dist/themes/brownbeige.css +1 -1
  136. package/dist/themes/content-contrast.css +1 -1
  137. package/dist/themes/content.css +1 -1
  138. package/dist/themes/desert-contrast.css +1 -1
  139. package/dist/themes/desert.css +1 -1
  140. package/dist/themes/expressive-contrast.css +1 -1
  141. package/dist/themes/expressive.css +1 -1
  142. package/dist/themes/fidelity-contrast.css +1 -1
  143. package/dist/themes/fidelity.css +1 -1
  144. package/dist/themes/forest-contrast.css +1 -1
  145. package/dist/themes/forest.css +1 -1
  146. package/dist/themes/fruit-salad-contrast.css +1 -1
  147. package/dist/themes/fruit-salad.css +1 -1
  148. package/dist/themes/highcontrast-contrast.css +1 -1
  149. package/dist/themes/highcontrast.css +1 -1
  150. package/dist/themes/monochrome-contrast.css +1 -1
  151. package/dist/themes/monochrome.css +1 -1
  152. package/dist/themes/neutral-contrast.css +1 -1
  153. package/dist/themes/neutral.css +1 -1
  154. package/dist/themes/ocean-contrast.css +1 -1
  155. package/dist/themes/ocean.css +1 -1
  156. package/dist/themes/rainbow-contrast.css +1 -1
  157. package/dist/themes/rainbow.css +1 -1
  158. package/dist/themes/sageivory-contrast.css +1 -1
  159. package/dist/themes/sageivory.css +1 -1
  160. package/dist/themes/spring-contrast.css +1 -1
  161. package/dist/themes/spring.css +1 -1
  162. package/dist/themes/summer-contrast.css +1 -1
  163. package/dist/themes/summer.css +1 -1
  164. package/dist/themes/sunset-contrast.css +1 -1
  165. package/dist/themes/sunset.css +1 -1
  166. package/dist/themes/tealcaramel-contrast.css +1 -1
  167. package/dist/themes/tealcaramel.css +1 -1
  168. package/dist/themes/vibrant-contrast.css +1 -1
  169. package/dist/themes/vibrant.css +1 -1
  170. package/dist/tokens/catalogue.json +3 -3
  171. package/dist/vue/index.d.ts +74 -74
  172. package/package.json +19 -1
  173. package/src/styles/components/_listbox.scss +95 -0
@@ -1,3 +1,106 @@
1
+ /**
2
+ * Set attributes on an element with performance optimizations
3
+ * @param element
4
+ * @param attributes
5
+ */
6
+ declare const setAttributes: <E extends HTMLElement | SVGElement>(element: E, attributes?: object) => E;
7
+
8
+ /**
9
+ * Remove attributes from an element
10
+ * @param element
11
+ * @param attributes
12
+ */
13
+ declare const removeAttributes: (element: HTMLElement, attributes?: string[]) => HTMLElement;
14
+
15
+ /**
16
+ * Batch attribute operations for better performance when setting many attributes
17
+ * @param element
18
+ */
19
+ declare const batchAttributes: (element: HTMLElement, operations: Array<{
20
+ action: "set" | "remove";
21
+ key: string;
22
+ value?: unknown;
23
+ }>) => HTMLElement;
24
+
25
+ /**
26
+ * Check if element has attribute
27
+ * @param element
28
+ * @param attribute
29
+ */
30
+ declare const hasAttribute: (element: HTMLElement, attribute: string) => boolean;
31
+
32
+ /**
33
+ * Get attribute value with default
34
+ * @param element
35
+ * @param attribute
36
+ * @param defaultValue
37
+ */
38
+ declare const getAttribute: (element: HTMLElement, attribute: string, defaultValue?: string) => string;
39
+ /** Event manager interface for handling DOM events */
40
+ interface EventManager {
41
+ /**
42
+ * Add an event listener with options
43
+ * @param event
44
+ * @param handler
45
+ * @param options
46
+ */
47
+ on: <T extends Event>(event: string, handler: (e: T) => void, options?: AddEventListenerOptions) => EventManager;
48
+ /**
49
+ * Remove an event listener
50
+ * @param event
51
+ * @param handler
52
+ */
53
+ off: <T extends Event>(event: string, handler: (e: T) => void) => EventManager;
54
+ /** Temporarily disable all event listeners */
55
+ pause: () => EventManager;
56
+ /** Re-enable all event listeners */
57
+ resume: () => EventManager;
58
+ /** Remove all event listeners and clean up */
59
+ destroy: () => void;
60
+ /** Get all active handlers */
61
+ getHandlers: () => Map<string, HandlerInfo>;
62
+ /**
63
+ * Check if a specific handler exists
64
+ * @param event
65
+ * @param handler
66
+ */
67
+ hasHandler: <T extends Event>(event: string, handler: (e: T) => void) => boolean;
68
+ }
69
+
70
+ /** Handler information */
71
+ interface HandlerInfo {
72
+ original: EventListener;
73
+ enhanced: EventListener;
74
+ event: string;
75
+ options: AddEventListenerOptions;
76
+ }
77
+
78
+ /**
79
+ * Creates an event manager to handle DOM events with enhanced functionality.
80
+ * @param element
81
+ */
82
+ declare const createEventManager: (element: HTMLElement) => EventManager;
83
+ /** A value the browser's Trusted Types API accepts for innerHTML. */
84
+ interface TrustedHTMLLike {
85
+ toString(): string;
86
+ }
87
+
88
+ /** Markup a component accepts: a string, or a TrustedHTML from a policy. */
89
+ type HTMLInput = string | TrustedHTMLLike;
90
+
91
+ interface HTMLPolicy {
92
+ /** Called with every markup string before it is written. */
93
+ sanitize: (html: string) => HTMLInput;
94
+ }
95
+
96
+ /** Sets the policy every component's markup goes through, or clears it with null. */
97
+ declare const configureHTML: (next: HTMLPolicy | null) => void;
98
+
99
+ /** The policy in force, if any. */
100
+ declare const getHTMLPolicy: () => HTMLPolicy | null;
101
+
102
+ /** Writes markup into an element, through the policy when one is set. */
103
+ declare const setHTML: (element: Element, html: HTMLInput | null | undefined) => void;
1
104
  /** How an element is promoted to the browser's top layer: */
2
105
  type TopLayerKind = "popover-auto" | "popover-manual" | "modal";
3
106
 
@@ -57,6 +160,20 @@ interface ModalEscape {
57
160
 
58
161
 
59
162
  declare const onModalEscape: (element: HTMLElement, escape: () => void, d?: (() => unknown) | false) => ModalEscape;
163
+ /**
164
+ * The focused element as seen from a node's own root: the shadow root it lives in, or the document.
165
+ * @param node
166
+ */
167
+ declare const activeElementOf: (node: Node) => Element | null;
168
+
169
+ /** The element that really has focus, looked for through open shadow roots: where focus goes back to after an overlay closes, when the overlay may sit in another root than whatever opened it. */
170
+ declare const deepActiveElement: () => Element | null;
171
+
172
+
173
+ declare const tabStops: (container: Element) => HTMLElement[];
174
+
175
+
176
+ declare const wrapTab: (container: HTMLElement, event: KeyboardEvent) => void;
60
177
  /**
61
178
  * Normalize classes to array of unique strings with optimization and caching
62
179
  * @param classes
@@ -90,44 +207,6 @@ declare const toggleClass: (element: HTMLElement, ...classes: (string | string[]
90
207
  * @param classes
91
208
  */
92
209
  declare const hasClass: (element: HTMLElement, ...classes: (string | string[])[]) => boolean;
93
- /**
94
- * Set attributes on an element with performance optimizations
95
- * @param element
96
- * @param attributes
97
- */
98
- declare const setAttributes: <E extends HTMLElement | SVGElement>(element: E, attributes?: object) => E;
99
-
100
- /**
101
- * Remove attributes from an element
102
- * @param element
103
- * @param attributes
104
- */
105
- declare const removeAttributes: (element: HTMLElement, attributes?: string[]) => HTMLElement;
106
-
107
- /**
108
- * Batch attribute operations for better performance when setting many attributes
109
- * @param element
110
- */
111
- declare const batchAttributes: (element: HTMLElement, operations: Array<{
112
- action: "set" | "remove";
113
- key: string;
114
- value?: unknown;
115
- }>) => HTMLElement;
116
-
117
- /**
118
- * Check if element has attribute
119
- * @param element
120
- * @param attribute
121
- */
122
- declare const hasAttribute: (element: HTMLElement, attribute: string) => boolean;
123
-
124
- /**
125
- * Get attribute value with default
126
- * @param element
127
- * @param attribute
128
- * @param defaultValue
129
- */
130
- declare const getAttribute: (element: HTMLElement, attribute: string, defaultValue?: string) => string;
131
210
  /** Whether the arrow keys, Home and End belong to an element: a text input, a textarea or editable content, where they move the caret. */
132
211
  declare const isTextEditable: (element: EventTarget | null | undefined) => boolean;
133
212
 
@@ -149,85 +228,6 @@ interface Roving {
149
228
 
150
229
  /** A roving tab index over a composite's focus targets (the WAI-ARIA toolbar pattern): one tab stop, kept on the target focused last; the arrow keys along the layout, Left and Right following the reading direction; Home and End to the ends. */
151
230
  declare const createRoving: ({ container, targets, vertical }: RovingOptions) => Roving;
152
- /** A value the browser's Trusted Types API accepts for innerHTML. */
153
- interface TrustedHTMLLike {
154
- toString(): string;
155
- }
156
-
157
- /** Markup a component accepts: a string, or a TrustedHTML from a policy. */
158
- type HTMLInput = string | TrustedHTMLLike;
159
-
160
- interface HTMLPolicy {
161
- /** Called with every markup string before it is written. */
162
- sanitize: (html: string) => HTMLInput;
163
- }
164
-
165
- /** Sets the policy every component's markup goes through, or clears it with null. */
166
- declare const configureHTML: (next: HTMLPolicy | null) => void;
167
-
168
- /** The policy in force, if any. */
169
- declare const getHTMLPolicy: () => HTMLPolicy | null;
170
-
171
- /** Writes markup into an element, through the policy when one is set. */
172
- declare const setHTML: (element: Element, html: HTMLInput | null | undefined) => void;
173
- /** Event manager interface for handling DOM events */
174
- interface EventManager {
175
- /**
176
- * Add an event listener with options
177
- * @param event
178
- * @param handler
179
- * @param options
180
- */
181
- on: <T extends Event>(event: string, handler: (e: T) => void, options?: AddEventListenerOptions) => EventManager;
182
- /**
183
- * Remove an event listener
184
- * @param event
185
- * @param handler
186
- */
187
- off: <T extends Event>(event: string, handler: (e: T) => void) => EventManager;
188
- /** Temporarily disable all event listeners */
189
- pause: () => EventManager;
190
- /** Re-enable all event listeners */
191
- resume: () => EventManager;
192
- /** Remove all event listeners and clean up */
193
- destroy: () => void;
194
- /** Get all active handlers */
195
- getHandlers: () => Map<string, HandlerInfo>;
196
- /**
197
- * Check if a specific handler exists
198
- * @param event
199
- * @param handler
200
- */
201
- hasHandler: <T extends Event>(event: string, handler: (e: T) => void) => boolean;
202
- }
203
-
204
- /** Handler information */
205
- interface HandlerInfo {
206
- original: EventListener;
207
- enhanced: EventListener;
208
- event: string;
209
- options: AddEventListenerOptions;
210
- }
211
-
212
- /**
213
- * Creates an event manager to handle DOM events with enhanced functionality.
214
- * @param element
215
- */
216
- declare const createEventManager: (element: HTMLElement) => EventManager;
217
- /**
218
- * The focused element as seen from a node's own root: the shadow root it lives in, or the document.
219
- * @param node
220
- */
221
- declare const activeElementOf: (node: Node) => Element | null;
222
-
223
- /** The element that really has focus, looked for through open shadow roots: where focus goes back to after an overlay closes, when the overlay may sit in another root than whatever opened it. */
224
- declare const deepActiveElement: () => Element | null;
225
-
226
-
227
- declare const tabStops: (container: Element) => HTMLElement[];
228
-
229
-
230
- declare const wrapTab: (container: HTMLElement, event: KeyboardEvent) => void;
231
231
  export type { EventManager, HTMLInput, HTMLPolicy, Roving, RovingOptions, TopLayerKind, TopLayerOptions, TrustedHTMLLike };
232
232
  export { activeElementOf, addClass, batchAttributes, configureHTML, createEventManager, createRoving, deepActiveElement, getAttribute, getHTMLPolicy, hasAttribute, hasClass, hideFromTopLayer, inertOutside, isTextEditable, normalizeClasses, onTopLayerClose, removeAttributes, removeClass, setAttributes, setHTML, showInTopLayer, supportsTopLayer, toggleClass };
233
233
  export type { CreateElementOptions, ForwardedEventPayload } from "./create.js";
@@ -1,13 +1,13 @@
1
- /** The semantic names a component renders through the icon registry. */
2
- type IconName = "menu" | "menu-open" | "close";
3
-
4
- /** Overrides by semantic name; `null` or `""` restores the built-in. */
5
- type IconOverrides = Partial<Record<IconName, string | null | undefined>>;
6
1
 
7
2
  /** Override icons by semantic name. */
8
3
  declare const setIcons: (icons: IconOverrides) => void;
9
4
 
10
5
  /** The application's override for a name, or the component's own built-in. */
11
6
  declare const getIcon: (name: IconName, fallback: string) => string;
7
+ /** The semantic names a component renders through the icon registry. */
8
+ type IconName = "menu" | "menu-open" | "close";
9
+
10
+ /** Overrides by semantic name; `null` or `""` restores the built-in. */
11
+ type IconOverrides = Partial<Record<IconName, string | null | undefined>>;
12
12
  export type { IconName, IconOverrides };
13
13
  export { getIcon, setIcons };
@@ -1,55 +1,4 @@
1
1
 
2
- /** How a vertex is rounded: the radius, and how much the curve is smoothed into the sides (0–1) */
3
- interface CornerRounding {
4
- radius: number;
5
- smoothing?: number;
6
- }
7
-
8
- declare const UNROUNDED: CornerRounding;
9
-
10
- /** A closed shape made of contiguous cubics */
11
- interface RoundedPolygon {
12
- cubics: Cubic[];
13
- centerX: number;
14
- centerY: number;
15
- }
16
-
17
- /** Builds a rounded polygon from a flat list of vertex coordinates [x0, y0, x1, y1, ...], a rounding for every vertex or one per vertex, and an optional centre (the vertices' centroid by default). */
18
- declare const roundedPolygon: (vertices: number[], rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
19
-
20
- /** A regular polygon, first vertex at angle 0 */
21
- declare const regularPolygon: (numVertices: number, radius?: number, centerX?: number, centerY?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[]) => RoundedPolygon;
22
-
23
- /** A circle approximated by a fully rounded polygon */
24
- declare const circle: (numVertices?: number, radius?: number, centerX?: number, centerY?: number) => RoundedPolygon;
25
-
26
- /** A star with `numVerticesPerRadius` outer and inner vertices, outer first at angle 0 */
27
- declare const star: (numVerticesPerRadius: number, radius?: number, innerRadius?: number, rounding?: CornerRounding, innerRounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
28
-
29
- /** A rectangle centred on (centerX, centerY), its first vertex at the bottom right (graphics-shapes rectangle) */
30
- declare const rectangle: (width?: number, height?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
31
-
32
- declare const transformPolygon: (polygon: RoundedPolygon, f: PointTransformer) => RoundedPolygon;
33
-
34
- /** Rotation about the origin, in degrees, positive clockwise on a y-down canvas */
35
- declare const rotatePolygon: (polygon: RoundedPolygon, degrees: number) => RoundedPolygon;
36
-
37
- declare const scalePolygon: (polygon: RoundedPolygon, sx: number, sy?: number) => RoundedPolygon;
38
-
39
- /** Bounding box [left, top, right, bottom] from the hull of anchors and controls */
40
- declare const polygonBounds: (polygon: RoundedPolygon) => [
41
- number,
42
- number,
43
- number,
44
- number
45
- ];
46
-
47
- /** The farthest any anchor or curve midpoint gets from the centre */
48
- declare const polygonMaxRadius: (polygon: RoundedPolygon) => number;
49
-
50
- /** Fits the shape into the unit square, centred, keeping its aspect ratio */
51
- declare const normalizePolygon: (polygon: RoundedPolygon) => RoundedPolygon;
52
-
53
2
  /** Circle */
54
3
  declare const shapeCircle: () => RoundedPolygon;
55
4
 
@@ -282,5 +231,56 @@ declare const cubicBounds: (c: Cubic) => [
282
231
  number,
283
232
  number
284
233
  ];
234
+
235
+ /** How a vertex is rounded: the radius, and how much the curve is smoothed into the sides (0–1) */
236
+ interface CornerRounding {
237
+ radius: number;
238
+ smoothing?: number;
239
+ }
240
+
241
+ declare const UNROUNDED: CornerRounding;
242
+
243
+ /** A closed shape made of contiguous cubics */
244
+ interface RoundedPolygon {
245
+ cubics: Cubic[];
246
+ centerX: number;
247
+ centerY: number;
248
+ }
249
+
250
+ /** Builds a rounded polygon from a flat list of vertex coordinates [x0, y0, x1, y1, ...], a rounding for every vertex or one per vertex, and an optional centre (the vertices' centroid by default). */
251
+ declare const roundedPolygon: (vertices: number[], rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
252
+
253
+ /** A regular polygon, first vertex at angle 0 */
254
+ declare const regularPolygon: (numVertices: number, radius?: number, centerX?: number, centerY?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[]) => RoundedPolygon;
255
+
256
+ /** A circle approximated by a fully rounded polygon */
257
+ declare const circle: (numVertices?: number, radius?: number, centerX?: number, centerY?: number) => RoundedPolygon;
258
+
259
+ /** A star with `numVerticesPerRadius` outer and inner vertices, outer first at angle 0 */
260
+ declare const star: (numVerticesPerRadius: number, radius?: number, innerRadius?: number, rounding?: CornerRounding, innerRounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
261
+
262
+ /** A rectangle centred on (centerX, centerY), its first vertex at the bottom right (graphics-shapes rectangle) */
263
+ declare const rectangle: (width?: number, height?: number, rounding?: CornerRounding, perVertexRounding?: CornerRounding[], centerX?: number, centerY?: number) => RoundedPolygon;
264
+
265
+ declare const transformPolygon: (polygon: RoundedPolygon, f: PointTransformer) => RoundedPolygon;
266
+
267
+ /** Rotation about the origin, in degrees, positive clockwise on a y-down canvas */
268
+ declare const rotatePolygon: (polygon: RoundedPolygon, degrees: number) => RoundedPolygon;
269
+
270
+ declare const scalePolygon: (polygon: RoundedPolygon, sx: number, sy?: number) => RoundedPolygon;
271
+
272
+ /** Bounding box [left, top, right, bottom] from the hull of anchors and controls */
273
+ declare const polygonBounds: (polygon: RoundedPolygon) => [
274
+ number,
275
+ number,
276
+ number,
277
+ number
278
+ ];
279
+
280
+ /** The farthest any anchor or curve midpoint gets from the centre */
281
+ declare const polygonMaxRadius: (polygon: RoundedPolygon) => number;
282
+
283
+ /** Fits the shape into the unit square, centred, keeping its aspect ratio */
284
+ declare const normalizePolygon: (polygon: RoundedPolygon) => RoundedPolygon;
285
285
  export type { CornerRounding, Cubic, MaterialShapeName, Point, PointTransformer, RadialProfile, RoundedPolygon };
286
286
  export { UNROUNDED, circle, circularArc, cubicBounds, materialShape, materialShapePath, normalizePolygon, pointOnCurve, polygonBounds, polygonMaxRadius, polygonPath, radialProfile, rectangle, regularPolygon, rotatePolygon, roundedPolygon, scalePolygon, shapeArch, shapeArrow, shapeBoom, shapeBun, shapeBurst, shapeCircle, shapeClamShell, shapeClover4Leaf, shapeClover8Leaf, shapeCookie12Sided, shapeCookie4Sided, shapeCookie6Sided, shapeCookie7Sided, shapeCookie9Sided, shapeDiamond, shapeFan, shapeFlower, shapeGem, shapeGhostish, shapeHeart, shapeOval, shapePentagon, shapePill, shapePixelCircle, shapePixelTriangle, shapePuffy, shapePuffyDiamond, shapeSemiCircle, shapeSlanted, shapeSoftBoom, shapeSoftBurst, shapeSquare, shapeSunny, shapeTriangle, shapeVerySunny, splitCubic, star, straightLine, transformPolygon };
@@ -1,4 +1,30 @@
1
1
  import type { EventCallback } from "./emitter.js";
2
+
3
+ /** Event manager interface for handling component events */
4
+ interface EventManagerState {
5
+ /**
6
+ * Adds an event listener
7
+ * @param event
8
+ * @param handler
9
+ */
10
+ on: (event: string, handler: EventCallback) => EventManagerState;
11
+ /**
12
+ * Removes an event listener
13
+ * @param event
14
+ * @param handler
15
+ */
16
+ off: (event: string, handler: EventCallback) => EventManagerState;
17
+ /** Removes all event listeners and cleans up */
18
+ destroy: () => void;
19
+ /** Gets all active handlers */
20
+ getHandlers: () => Map<EventCallback, string>;
21
+ }
22
+
23
+ /**
24
+ * Creates an event manager for a component
25
+ * @param element
26
+ */
27
+ declare const createEventManager: (element: HTMLElement) => EventManagerState;
2
28
  /** State store options */
3
29
  interface StoreOptions<T> {
4
30
  /** Middleware functions that process state changes */
@@ -67,32 +93,6 @@ declare const loggingMiddleware: <T extends object>(newState: T, oldState: T) =>
67
93
  * @param predicate
68
94
  */
69
95
  declare const deriveFiltered: <T>(predicate: (value: T, key: string) => boolean) => (state: Record<string, T>) => Record<string, T>;
70
-
71
- /** Event manager interface for handling component events */
72
- interface EventManagerState {
73
- /**
74
- * Adds an event listener
75
- * @param event
76
- * @param handler
77
- */
78
- on: (event: string, handler: EventCallback) => EventManagerState;
79
- /**
80
- * Removes an event listener
81
- * @param event
82
- * @param handler
83
- */
84
- off: (event: string, handler: EventCallback) => EventManagerState;
85
- /** Removes all event listeners and cleans up */
86
- destroy: () => void;
87
- /** Gets all active handlers */
88
- getHandlers: () => Map<EventCallback, string>;
89
- }
90
-
91
- /**
92
- * Creates an event manager for a component
93
- * @param element
94
- */
95
- declare const createEventManager: (element: HTMLElement) => EventManagerState;
96
96
  export type { Computation, DerivedState, EventManagerState, Selector, Store, StoreOptions, Updater };
97
97
  export { createEventManager, createStore, deriveFiltered, loggingMiddleware };
98
98
  export type { Emitter, EventCallback } from "./emitter.js";
@@ -11,6 +11,14 @@ declare const when: <T, C>(predicate: (obj: T, context: C) => boolean, transform
11
11
  * @param classes
12
12
  */
13
13
  declare const classNames: (...classes: (string | undefined | null | false)[]) => string;
14
+ /** Attributes whose value is a URL, and so must be checked before assignment. */
15
+ declare const URL_ATTRIBUTES: Set<string>;
16
+
17
+ /** Whether a URL is safe to assign to a navigable attribute. */
18
+ declare const isSafeUrl: (url: string) => boolean;
19
+
20
+ /** Returns the URL if its scheme is allowed, otherwise an empty string. */
21
+ declare const safeUrl: (url: string) => string;
14
22
  /** Result interface for background color lookup */
15
23
  interface BackgroundResult {
16
24
  /** The computed background color value */
@@ -57,14 +65,6 @@ declare const byString: <T extends object, R = unknown>(obj: T, path: string) =>
57
65
  * @param opacity
58
66
  */
59
67
  declare const colorToRGBA: (color: string, opacity: number) => string;
60
- /** Attributes whose value is a URL, and so must be checked before assignment. */
61
- declare const URL_ATTRIBUTES: Set<string>;
62
-
63
- /** Whether a URL is safe to assign to a navigable attribute. */
64
- declare const isSafeUrl: (url: string) => boolean;
65
-
66
- /** Returns the URL if its scheme is allowed, otherwise an empty string. */
67
- declare const safeUrl: (url: string) => string;
68
68
  type Cancellable<F> = F & {
69
69
  cancel(): void;
70
70
  };