mtrl 0.3.9 → 0.4.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 (59) hide show
  1. package/dist/components/badge/config.d.ts +1 -1
  2. package/dist/components/button/config.d.ts +1 -1
  3. package/dist/components/card/config.d.ts +1 -1
  4. package/dist/components/carousel/config.d.ts +1 -1
  5. package/dist/components/checkbox/config.d.ts +1 -1
  6. package/dist/components/chips/chip/config.d.ts +1 -1
  7. package/dist/components/chips/config.d.ts +1 -1
  8. package/dist/components/chips/schema.d.ts +1 -1
  9. package/dist/components/datepicker/config.d.ts +3 -3
  10. package/dist/components/dialog/config.d.ts +2 -2
  11. package/dist/components/dialog/types.d.ts +1 -1
  12. package/dist/components/extended-fab/config.d.ts +1 -1
  13. package/dist/components/fab/config.d.ts +1 -1
  14. package/dist/components/list/config.d.ts +1 -1
  15. package/dist/components/menu/config.d.ts +1 -1
  16. package/dist/components/navigation/config.d.ts +1 -1
  17. package/dist/components/progress/api.d.ts +18 -18
  18. package/dist/components/progress/config.d.ts +19 -10
  19. package/dist/components/progress/constants.d.ts +82 -1
  20. package/dist/components/progress/features/canvas.d.ts +32 -0
  21. package/dist/components/progress/features/circular.d.ts +9 -0
  22. package/dist/components/progress/features/index.d.ts +8 -0
  23. package/dist/components/progress/features/linear.d.ts +9 -0
  24. package/dist/components/progress/features/resize-observer.d.ts +5 -0
  25. package/dist/components/progress/features/state.d.ts +38 -0
  26. package/dist/components/progress/features.d.ts +40 -0
  27. package/dist/components/progress/index.d.ts +2 -2
  28. package/dist/components/progress/progress.d.ts +1 -1
  29. package/dist/components/progress/types.d.ts +88 -15
  30. package/dist/components/radios/config.d.ts +1 -1
  31. package/dist/components/search/config.d.ts +1 -1
  32. package/dist/components/segmented-button/config.d.ts +2 -2
  33. package/dist/components/sheet/config.d.ts +1 -1
  34. package/dist/components/slider/config.d.ts +1 -1
  35. package/dist/components/slider/schema.d.ts +3 -3
  36. package/dist/components/snackbar/config.d.ts +1 -1
  37. package/dist/components/switch/config.d.ts +1 -1
  38. package/dist/components/textfield/config.d.ts +1 -1
  39. package/dist/components/timepicker/config.d.ts +3 -3
  40. package/dist/components/tooltip/config.d.ts +1 -1
  41. package/dist/core/canvas/index.d.ts +5 -0
  42. package/dist/core/canvas/resize.d.ts +14 -0
  43. package/dist/core/compose/component.d.ts +1 -1
  44. package/dist/core/config/component.d.ts +2 -2
  45. package/dist/core/dom/attributes.d.ts +13 -15
  46. package/dist/core/dom/classes.d.ts +10 -0
  47. package/dist/core/dom/create.d.ts +36 -6
  48. package/dist/core/dom/index.d.ts +2 -2
  49. package/dist/core/index.d.ts +1 -1
  50. package/dist/core/layout/object.d.ts +1 -1
  51. package/dist/core/utils/index.d.ts +1 -6
  52. package/dist/core/utils/theme.d.ts +38 -0
  53. package/dist/index.cjs +15 -15
  54. package/dist/index.cjs.map +64 -58
  55. package/dist/index.js +15 -15
  56. package/dist/index.js.map +64 -58
  57. package/dist/package.json +1 -1
  58. package/dist/styles.css +2 -2
  59. package/package.json +1 -1
@@ -3,6 +3,16 @@
3
3
  * @category Components
4
4
  */
5
5
  export type ProgressVariant = 'linear' | 'circular';
6
+ /**
7
+ * Progress thickness options
8
+ * @category Components
9
+ */
10
+ export type ProgressThickness = 'thin' | 'thick' | number;
11
+ /**
12
+ * Progress shape options (linear only)
13
+ * @category Components
14
+ */
15
+ export type ProgressShape = 'line' | 'wavy';
6
16
  /**
7
17
  * Progress component event types
8
18
  * @category Components
@@ -17,7 +27,7 @@ export interface ProgressConfig {
17
27
  * Progress variant that determines visual style
18
28
  * @default 'linear'
19
29
  */
20
- variant?: ProgressVariant | string;
30
+ variant?: ProgressVariant;
21
31
  /**
22
32
  * Initial progress value (0-100)
23
33
  * @default 0
@@ -40,9 +50,20 @@ export interface ProgressConfig {
40
50
  buffer?: number;
41
51
  /**
42
52
  * Additional CSS classes to add to the progress component
43
- * @example 'page-loader main-progress'
44
53
  */
45
54
  class?: string;
55
+ /**
56
+ * Thickness of the progress track and indicator
57
+ * Can be a named preset ('thin', 'default', 'thick') or a specific number in pixels
58
+ * @default 'default'
59
+ */
60
+ thickness?: ProgressThickness;
61
+ /**
62
+ * Shape of the linear indeterminate progress animation
63
+ * Only affects linear variant in indeterminate state
64
+ * @default 'line'
65
+ */
66
+ shape?: ProgressShape;
46
67
  /**
47
68
  * Whether to show text label with percentage
48
69
  * @default false
@@ -55,7 +76,6 @@ export interface ProgressConfig {
55
76
  indeterminate?: boolean;
56
77
  /**
57
78
  * Custom label formatter function
58
- * @example (value, max) => `${Math.round((value/max) * 100)}%`
59
79
  */
60
80
  labelFormatter?: (value: number, max: number) => string;
61
81
  /**
@@ -68,6 +88,17 @@ export interface ProgressConfig {
68
88
  * @default 'progress'
69
89
  */
70
90
  componentName?: string;
91
+ /**
92
+ * DOM structure schema
93
+ * @internal
94
+ */
95
+ schema?: any;
96
+ /**
97
+ * Size of the circular progress indicator in dp (only for circular variant)
98
+ * Clamped between 24 and 240
99
+ * @default 50
100
+ */
101
+ size?: number;
71
102
  }
72
103
  /**
73
104
  * Progress component interface
@@ -76,14 +107,12 @@ export interface ProgressConfig {
76
107
  export interface ProgressComponent {
77
108
  /** The component's root DOM element */
78
109
  element: HTMLElement;
79
- /** The track element (background) */
80
- trackElement: HTMLElement;
81
- /** The indicator element (filled part) */
82
- indicatorElement: HTMLElement;
83
- /** The buffer element for linear variant (pre-loaded state) */
84
- bufferElement?: HTMLElement;
85
- /** The label element if showLabel is enabled */
86
- labelElement?: HTMLElement;
110
+ /** The track element (unfilled part) - always an SVG element */
111
+ track: SVGElement;
112
+ /** The indicator element (filled part) - always an SVG element */
113
+ indicator: SVGElement;
114
+ /** The buffer element for linear variant (pre-loaded state) - always an SVG element */
115
+ buffer?: SVGElement;
87
116
  /**
88
117
  * Gets a class name with the component's prefix
89
118
  * @param name - Base class name
@@ -91,16 +120,22 @@ export interface ProgressComponent {
91
120
  */
92
121
  getClass: (name: string) => string;
93
122
  /**
94
- * Sets the current progress value
95
- * @param value - Progress value (between 0 and max)
96
- * @returns The progress component for chaining
123
+ * Sets the progress value
124
+ * @param value - Progress value between 0 and max
125
+ * @param animate - Whether to animate the value change (default: true)
126
+ * @returns The component instance for chaining
97
127
  */
98
- setValue: (value: number) => ProgressComponent;
128
+ setValue: (value: number, animate?: boolean) => ProgressComponent;
99
129
  /**
100
130
  * Gets the current progress value
101
131
  * @returns Current progress value
102
132
  */
103
133
  getValue: () => number;
134
+ /**
135
+ * Gets the maximum progress value
136
+ * @returns Maximum progress value
137
+ */
138
+ getMax: () => number;
104
139
  /**
105
140
  * Sets the buffer value (for linear variant with buffer indicators)
106
141
  * @param value - Buffer value (between 0 and max)
@@ -127,6 +162,21 @@ export interface ProgressComponent {
127
162
  * @returns Whether the component is disabled
128
163
  */
129
164
  isDisabled: () => boolean;
165
+ /**
166
+ * Hides the progress component
167
+ * @returns The progress component for chaining
168
+ */
169
+ hide: () => ProgressComponent;
170
+ /**
171
+ * Shows the progress component
172
+ * @returns The progress component for chaining
173
+ */
174
+ show: () => ProgressComponent;
175
+ /**
176
+ * Checks if the progress component is visible
177
+ * @returns Whether the component is visible
178
+ */
179
+ isVisible: () => boolean;
130
180
  /**
131
181
  * Shows the label element
132
182
  * @returns The progress component for chaining
@@ -143,6 +193,29 @@ export interface ProgressComponent {
143
193
  * @returns The progress component for chaining
144
194
  */
145
195
  setLabelFormatter: (formatter: (value: number, max: number) => string) => ProgressComponent;
196
+ /**
197
+ * Sets the thickness of the progress track and indicator
198
+ * @param thickness - Thickness value ('thin', 'default', 'thick' or number in pixels)
199
+ * @returns The progress component for chaining
200
+ */
201
+ setThickness: (thickness: ProgressThickness) => ProgressComponent;
202
+ /**
203
+ * Gets the current thickness value in pixels
204
+ * @returns Current thickness in pixels
205
+ */
206
+ getThickness: () => number;
207
+ /**
208
+ * Sets the shape of the linear indeterminate progress animation
209
+ * Only affects linear variant in indeterminate state
210
+ * @param shape - Shape value ('line' or 'wavy')
211
+ * @returns The progress component for chaining
212
+ */
213
+ setShape: (shape: ProgressShape) => ProgressComponent;
214
+ /**
215
+ * Gets the current shape value
216
+ * @returns Current shape
217
+ */
218
+ getShape: () => ProgressShape;
146
219
  /**
147
220
  * Sets the indeterminate state
148
221
  * @param indeterminate - Whether progress is indeterminate
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config: RadiosConfig) => RadiosConfig;
17
17
  export declare const getElementConfig: (config: RadiosConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SearchConfig) => SearchConfig;
17
17
  export declare const getElementConfig: (config: SearchConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -24,7 +24,7 @@ export declare const createBaseConfig: (config?: SegmentedButtonConfig) => Segme
24
24
  export declare const getContainerConfig: (config: SegmentedButtonConfig) => {
25
25
  tag: string;
26
26
  componentName: string;
27
- attrs: {
27
+ attributes: {
28
28
  role: string;
29
29
  'aria-label': string;
30
30
  'data-mode': SelectionMode;
@@ -50,7 +50,7 @@ export declare const getDensityStyles: (density: string) => Record<string, strin
50
50
  */
51
51
  export declare const getSegmentConfig: (segment: any, prefix: any, groupDisabled?: boolean) => {
52
52
  tag: string;
53
- attrs: {
53
+ attributes: {
54
54
  type: string;
55
55
  role: string;
56
56
  disabled: boolean;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SheetConfig) => SheetConfig;
17
17
  export declare const getElementConfig: (config: SheetConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SliderConfig) => SliderConfig;
17
17
  export declare const getElementConfig: (config: SliderConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -10,7 +10,7 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
10
10
  element: {
11
11
  options: {
12
12
  className: any[];
13
- attrs: {
13
+ attributes: {
14
14
  tabindex: string;
15
15
  role: string;
16
16
  'aria-disabled': string;
@@ -72,7 +72,7 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
72
72
  handle: {
73
73
  options: {
74
74
  className: any;
75
- attrs: {
75
+ attributes: {
76
76
  role: string;
77
77
  'aria-valuemin': string;
78
78
  'aria-valuemax': string;
@@ -91,7 +91,7 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
91
91
  valueBubble: {
92
92
  options: {
93
93
  className: any;
94
- attrs: {
94
+ attributes: {
95
95
  'aria-hidden': string;
96
96
  'data-handle-index': string;
97
97
  };
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config: SnackbarConfig) => SnackbarConfi
17
17
  export declare const getElementConfig: (config: SnackbarConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SwitchConfig) => SwitchConfig;
17
17
  export declare const getElementConfig: (config: SwitchConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TextfieldConfig) => TextfieldCo
17
17
  export declare const getElementConfig: (config: TextfieldConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TimePickerConfig) => TimePicker
17
17
  export declare const getContainerConfig: (config: TimePickerConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -33,7 +33,7 @@ export declare const getContainerConfig: (config: TimePickerConfig) => {
33
33
  export declare const getModalConfig: (config: TimePickerConfig) => {
34
34
  tag: string;
35
35
  componentName: string;
36
- attrs: Record<string, any>;
36
+ attributes: Record<string, any>;
37
37
  className: string[];
38
38
  rawClass: string | string[];
39
39
  html: string;
@@ -49,7 +49,7 @@ export declare const getModalConfig: (config: TimePickerConfig) => {
49
49
  export declare const getDialogConfig: (config: TimePickerConfig) => {
50
50
  tag: string;
51
51
  componentName: string;
52
- attrs: Record<string, any>;
52
+ attributes: Record<string, any>;
53
53
  className: string[];
54
54
  rawClass: string | string[];
55
55
  html: string;
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TooltipConfig) => TooltipConfig
17
17
  export declare const getElementConfig: (config: TooltipConfig) => {
18
18
  tag: string;
19
19
  componentName: string;
20
- attrs: Record<string, any>;
20
+ attributes: Record<string, any>;
21
21
  className: string[];
22
22
  rawClass: string | string[];
23
23
  html: string;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Canvas utilities module
3
+ * Provides common utilities for working with HTML Canvas elements
4
+ */
5
+ export { observeCanvasResize } from './resize';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Canvas resize utilities
3
+ * Provides utilities for observing and handling canvas resize events
4
+ */
5
+ /**
6
+ * Observes resize events on an element and triggers a callback
7
+ * Watches the specified element and debounces resize events
8
+ *
9
+ * @param element - The element to observe for size changes
10
+ * @param canvas - The canvas element (for context)
11
+ * @param onResize - Callback to execute when the element resizes
12
+ * @returns Cleanup function to stop observing
13
+ */
14
+ export declare const observeCanvasResize: (element: HTMLElement, canvas: HTMLCanvasElement, onResize: () => void) => (() => void);
@@ -40,7 +40,7 @@ export interface ElementComponent extends BaseComponent {
40
40
  export interface WithElementOptions {
41
41
  tag?: string;
42
42
  componentName?: string;
43
- attrs?: Record<string, any>;
43
+ attributes?: Record<string, any>;
44
44
  className?: string | string[];
45
45
  forwardEvents?: Record<string, boolean | ((component: any, event: Event) => boolean)>;
46
46
  interactive?: boolean;
@@ -69,7 +69,7 @@ export declare const processClassNames: (classNames: string | string[] | null) =
69
69
  */
70
70
  export declare const createElementConfig: (config: BaseComponentConfig, options: {
71
71
  tag: string;
72
- attrs?: Record<string, any>;
72
+ attributes?: Record<string, any>;
73
73
  className?: string | string[] | null;
74
74
  html?: string;
75
75
  text?: string;
@@ -78,7 +78,7 @@ export declare const createElementConfig: (config: BaseComponentConfig, options:
78
78
  }) => {
79
79
  tag: string;
80
80
  componentName: string;
81
- attrs: Record<string, any>;
81
+ attributes: Record<string, any>;
82
82
  className: string[];
83
83
  rawClass: string | string[];
84
84
  html: string;
@@ -1,22 +1,20 @@
1
1
  /**
2
2
  * @module core/dom
3
- * @description DOM manipulation utilities
3
+ * @description DOM attribute helpers
4
4
  */
5
5
  /**
6
- * Sets multiple attributes on an element
7
- * @memberof module:core/dom
8
- * @function setAttributes
9
- * @param {HTMLElement} element - Target element
10
- * @param {Record<string, any>} attrs - Attributes to set
11
- * @returns {HTMLElement} Modified element
6
+ * Sets attributes on an HTML element
7
+ *
8
+ * @param {HTMLElement} element - Element to set attributes on
9
+ * @param {Record<string, any>} attributes - Attributes to set
10
+ * @returns {HTMLElement} The element for chaining
12
11
  */
13
- export declare const setAttributes: (element: HTMLElement, attrs?: Record<string, any>) => HTMLElement;
12
+ export declare const setAttributes: (element: HTMLElement, attributes?: Record<string, any>) => HTMLElement;
14
13
  /**
15
- * Removes multiple attributes from an element
16
- * @memberof module:core/dom
17
- * @function removeAttributes
18
- * @param {HTMLElement} element - Target element
19
- * @param {string[]} attrs - Attributes to remove
20
- * @returns {HTMLElement} Modified element
14
+ * Removes attributes from an HTML element
15
+ *
16
+ * @param {HTMLElement} element - Element to remove attributes from
17
+ * @param {string[]} attributes - Attributes to remove
18
+ * @returns {HTMLElement} The element for chaining
21
19
  */
22
- export declare const removeAttributes: (element: HTMLElement, attrs?: string[]) => HTMLElement;
20
+ export declare const removeAttributes: (element: HTMLElement, attributes?: string[]) => HTMLElement;
@@ -2,6 +2,16 @@
2
2
  * @module core/dom
3
3
  * @description DOM manipulation utilities optimized for performance
4
4
  */
5
+ /**
6
+ * Normalizes class names input by handling various formats:
7
+ * - String with space-separated classes
8
+ * - Array of strings
9
+ * - Mixed array of strings and space-separated classes
10
+ *
11
+ * @param classes - Classes to normalize
12
+ * @returns Array of unique, non-empty class names
13
+ */
14
+ export declare const normalizeClasses: (...classes: (string | string[])[]) => string[];
5
15
  /**
6
16
  * Adds multiple classes to an element
7
17
  * Automatically adds prefix to classes that don't already have it
@@ -10,6 +10,10 @@ export type EventHandler = (event: Event) => void;
10
10
  * Event condition type - either a boolean or a function that returns a boolean
11
11
  */
12
12
  export type EventCondition = boolean | ((context: any, event: Event) => boolean);
13
+ /**
14
+ * Element type that can be either HTMLElement or SVGElement
15
+ */
16
+ export type DOMElement = HTMLElement | SVGElement;
13
17
  /**
14
18
  * Options for element creation
15
19
  */
@@ -60,7 +64,7 @@ export interface CreateElementOptions {
60
64
  /**
61
65
  * HTML attributes
62
66
  */
63
- attrs?: Record<string, any>;
67
+ attributes?: Record<string, any>;
64
68
  /**
65
69
  * Events to forward when component has emit method
66
70
  */
@@ -78,6 +82,19 @@ export interface CreateElementOptions {
78
82
  */
79
83
  [key: string]: any;
80
84
  }
85
+ /**
86
+ * Options for SVG element creation, extends regular element options
87
+ */
88
+ export interface CreateSVGElementOptions extends Omit<CreateElementOptions, 'container' | 'onCreate'> {
89
+ /**
90
+ * Container to append element to
91
+ */
92
+ container?: DOMElement | null;
93
+ /**
94
+ * Callback after element creation
95
+ */
96
+ onCreate?: (element: SVGElement, context?: any) => void;
97
+ }
81
98
  /**
82
99
  * Event handler storage to facilitate cleanup
83
100
  */
@@ -85,23 +102,30 @@ export interface EventHandlerStorage {
85
102
  [eventName: string]: EventHandler;
86
103
  }
87
104
  /**
88
- * Creates a DOM element with the specified options
105
+ * Creates an HTML element with the specified options
89
106
  *
90
107
  * @param {CreateElementOptions} options - Element creation options
91
- * @returns {HTMLElement} Created element
108
+ * @returns {HTMLElement} Created HTML element
92
109
  */
93
110
  export declare const createElement: (options?: CreateElementOptions) => HTMLElement;
111
+ /**
112
+ * Creates an SVG element with the specified options
113
+ *
114
+ * @param {CreateSVGElementOptions} options - SVG element creation options
115
+ * @returns {SVGElement} Created SVG element
116
+ */
117
+ export declare const createSVGElement: (options?: CreateSVGElementOptions) => SVGElement;
94
118
  /**
95
119
  * Removes event handlers from an element
96
120
  * @param element - Element to cleanup
97
121
  */
98
- export declare const removeEventHandlers: (element: HTMLElement) => void;
122
+ export declare const removeEventHandlers: (element: HTMLElement | SVGElement) => void;
99
123
  /**
100
124
  * Higher-order function to add attributes to an element
101
- * @param {Record<string, any>} attrs - Attributes to add
125
+ * @param {Record<string, any>} attributes - Attributes to add
102
126
  * @returns {(element: HTMLElement) => HTMLElement} Element transformer
103
127
  */
104
- export declare const withAttributes: (attrs: Record<string, any>) => (element: HTMLElement) => HTMLElement;
128
+ export declare const withAttributes: (attributes: Record<string, any>) => (element: HTMLElement) => HTMLElement;
105
129
  /**
106
130
  * Higher-order function to add classes to an element
107
131
  * @param {...(string | string[])} classes - Classes to add
@@ -121,4 +145,10 @@ declare global {
121
145
  */
122
146
  __eventHandlers?: EventHandlerStorage;
123
147
  }
148
+ interface SVGElement {
149
+ /**
150
+ * Storage for event handlers to enable cleanup
151
+ */
152
+ __eventHandlers?: EventHandlerStorage;
153
+ }
124
154
  }
@@ -1,6 +1,6 @@
1
- export { createElement, withAttributes, withClasses, withContent } from './create';
1
+ export { createElement, createSVGElement } from './create';
2
2
  export type { CreateElementOptions } from './create';
3
3
  export { setAttributes, removeAttributes } from './attributes';
4
- export { addClass, removeClass, toggleClass, hasClass } from './classes';
4
+ export { addClass, removeClass, toggleClass, hasClass, normalizeClasses } from './classes';
5
5
  export { createEventManager } from './events';
6
6
  export type { EventManager } from './events';
@@ -22,7 +22,7 @@ export type { EventManagerState } from './state/events';
22
22
  export * from './layout';
23
23
  export * from './collection';
24
24
  export { PREFIX, COMPONENTS, STATES, classNames, getComponentClass, getModifierClass, getElementClass } from './config';
25
- export { normalizeClasses, when, classNames as joinClasses, isObject, byString, hasTouchSupport, normalizeEvent, throttle, debounce, once, getInheritedBackground } from './utils';
25
+ export { when, classNames as joinClasses, isObject, byString, hasTouchSupport, normalizeEvent, throttle, debounce, once, getInheritedBackground } from './utils';
26
26
  export { createGestureManager } from './gestures';
27
27
  export type { GestureManager, GestureConfig, GestureEvent, TapEvent, SwipeEvent, LongPressEvent, PinchEvent, RotateEvent, PanEvent, AnyGestureEvent, GestureHandler } from './gestures';
28
28
  export type { ThemeConfig, ComponentConfig, ThemedComponentConfig, VariantComponentConfig, StateComponentConfig } from './config';
@@ -11,4 +11,4 @@ import { Schema, LayoutResult, LayoutOptions } from './types';
11
11
  * @param options - Layout creation options
12
12
  * @returns Layout result object
13
13
  */
14
- export declare function processObjectSchema(schema: Schema, parentElement?: HTMLElement | DocumentFragment | null, options?: LayoutOptions): LayoutResult;
14
+ export declare function processObjectSchema(schema: Schema, parentElement?: HTMLElement | SVGElement | DocumentFragment | null, options?: LayoutOptions): LayoutResult;
@@ -2,12 +2,7 @@ export { isObject, byString } from './object';
2
2
  export { normalizeEvent, hasTouchSupport, TOUCH_CONFIG, PASSIVE_EVENTS } from './mobile';
3
3
  export { getInheritedBackground } from './background';
4
4
  export { throttle, debounce, once } from './performance';
5
- /**
6
- * Normalizes class names by handling various input formats
7
- * @param {...(string|string[])} classes - Classes to normalize
8
- * @returns {string[]} Array of unique, non-empty class names
9
- */
10
- export declare const normalizeClasses: (...classes: (string | string[])[]) => string[];
5
+ export { getThemeColor } from './theme';
11
6
  /**
12
7
  * Creates a transformer that only runs if a condition is met
13
8
  * @param {Function} predicate - Condition to check
@@ -0,0 +1,38 @@
1
+ type ThemeChangeCallback = () => void;
2
+ /**
3
+ * Register a callback to be notified of theme changes
4
+ * @param callback Function to call when theme changes
5
+ * @returns Function to unregister the callback
6
+ */
7
+ export declare const onThemeChange: (callback: ThemeChangeCallback) => (() => void);
8
+ /**
9
+ * Gets a theme color from CSS variables, with optional alpha/opacity support.
10
+ * The prefix is automatically added to the variable name.
11
+ * Colors are retrieved from the active theme (defined on body element) if available,
12
+ * falling back to the default theme (defined on :root) if not found.
13
+ *
14
+ * @param {string} varName - The CSS variable name without prefix (e.g. 'sys-color-primary' or 'sys-color-primary-rgb')
15
+ * @param {object} [options] - Options for color retrieval
16
+ * @param {number} [options.alpha] - Alpha value (0-1) for rgba output (only works with --*-rgb variables)
17
+ * @param {string} [options.fallback] - Fallback color if variable is not found
18
+ * @param {ThemeChangeCallback} [options.onThemeChange] - Optional callback for theme changes
19
+ * @returns {string} The color value (hex, rgb, or rgba)
20
+ *
21
+ * @example
22
+ * // Basic usage
23
+ * getThemeColor('sys-color-primary') // '#006493' (from active theme)
24
+ *
25
+ * // With theme change notification
26
+ * getThemeColor('sys-color-primary', {
27
+ * onThemeChange: () => {
28
+ * // Re-render or update component
29
+ * component.update();
30
+ * }
31
+ * });
32
+ */
33
+ export declare function getThemeColor(varName: string, options?: {
34
+ alpha?: number;
35
+ fallback?: string;
36
+ onThemeChange?: ThemeChangeCallback;
37
+ }): string;
38
+ export {};