mtrl 0.3.9 → 0.4.3

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 (167) hide show
  1. package/dist/components/badge/api.d.ts +5 -5
  2. package/dist/components/badge/config.d.ts +18 -8
  3. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +1 -1
  4. package/dist/components/bottom-app-bar/config.d.ts +1 -1
  5. package/dist/components/button/api.d.ts +19 -3
  6. package/dist/components/button/button.d.ts +41 -1
  7. package/dist/components/button/config.d.ts +18 -7
  8. package/dist/components/button/constants.d.ts +36 -0
  9. package/dist/components/button/features/progress.d.ts +26 -0
  10. package/dist/components/button/types.d.ts +108 -1
  11. package/dist/components/card/config.d.ts +2 -2
  12. package/dist/components/card/features.d.ts +14 -1
  13. package/dist/components/card/index.d.ts +6 -6
  14. package/dist/components/carousel/api.d.ts +15 -11
  15. package/dist/components/carousel/carousel.d.ts +1 -1
  16. package/dist/components/carousel/config.d.ts +2 -2
  17. package/dist/components/carousel/features/drag.d.ts +1 -1
  18. package/dist/components/carousel/features/slides.d.ts +1 -1
  19. package/dist/components/checkbox/config.d.ts +2 -2
  20. package/dist/components/checkbox/types.d.ts +2 -2
  21. package/dist/components/chips/chip/chip.d.ts +1 -1
  22. package/dist/components/chips/chip/config.d.ts +2 -2
  23. package/dist/components/chips/chips.d.ts +1 -1
  24. package/dist/components/chips/config.d.ts +1 -1
  25. package/dist/components/chips/features/chip-items.d.ts +1 -1
  26. package/dist/components/chips/schema.d.ts +1 -2
  27. package/dist/components/datepicker/api.d.ts +1 -1
  28. package/dist/components/datepicker/config.d.ts +4 -4
  29. package/dist/components/datepicker/datepicker.d.ts +1 -1
  30. package/dist/components/datepicker/render.d.ts +5 -5
  31. package/dist/components/dialog/config.d.ts +2 -2
  32. package/dist/components/dialog/features.d.ts +1 -1
  33. package/dist/components/dialog/types.d.ts +1 -1
  34. package/dist/components/divider/divider.d.ts +2 -2
  35. package/dist/components/extended-fab/config.d.ts +2 -2
  36. package/dist/components/fab/config.d.ts +2 -2
  37. package/dist/components/index.d.ts +2 -1
  38. package/dist/components/list/config.d.ts +1 -1
  39. package/dist/components/menu/api.d.ts +14 -14
  40. package/dist/components/menu/config.d.ts +2 -2
  41. package/dist/components/menu/features/controller.d.ts +1 -1
  42. package/dist/components/menu/features/keyboard.d.ts +2 -2
  43. package/dist/components/menu/features/submenu.d.ts +1 -1
  44. package/dist/components/menu/menu.d.ts +1 -1
  45. package/dist/components/navigation/config.d.ts +2 -2
  46. package/dist/components/navigation/features/controller.d.ts +1 -1
  47. package/dist/components/navigation/features/items.d.ts +2 -1
  48. package/dist/components/navigation/navigation.d.ts +1 -1
  49. package/dist/components/navigation/system/core.d.ts +1 -1
  50. package/dist/components/navigation/system/events.d.ts +1 -1
  51. package/dist/components/navigation/system/index.d.ts +2 -2
  52. package/dist/components/progress/api.d.ts +49 -18
  53. package/dist/components/progress/config.d.ts +20 -11
  54. package/dist/components/progress/constants.d.ts +86 -1
  55. package/dist/components/progress/features/canvas.d.ts +61 -0
  56. package/dist/components/progress/features/circular.d.ts +9 -0
  57. package/dist/components/progress/features/index.d.ts +8 -0
  58. package/dist/components/progress/features/linear.d.ts +9 -0
  59. package/dist/components/progress/features/resize-observer.d.ts +5 -0
  60. package/dist/components/progress/features/state.d.ts +46 -0
  61. package/dist/components/progress/index.d.ts +2 -2
  62. package/dist/components/progress/progress.d.ts +2 -2
  63. package/dist/components/progress/types.d.ts +102 -17
  64. package/dist/components/radios/api.d.ts +11 -11
  65. package/dist/components/radios/config.d.ts +2 -2
  66. package/dist/components/radios/radios.d.ts +1 -1
  67. package/dist/components/search/api.d.ts +15 -11
  68. package/dist/components/search/config.d.ts +1 -1
  69. package/dist/components/search/features/search.d.ts +1 -1
  70. package/dist/components/segmented-button/config.d.ts +8 -8
  71. package/dist/components/select/api.d.ts +1 -1
  72. package/dist/components/select/config.d.ts +1 -1
  73. package/dist/components/select/features.d.ts +1 -1
  74. package/dist/components/select/types.d.ts +20 -5
  75. package/dist/components/sheet/config.d.ts +2 -2
  76. package/dist/components/sheet/sheet.d.ts +1 -1
  77. package/dist/components/slider/api.d.ts +3 -2
  78. package/dist/components/slider/config.d.ts +2 -2
  79. package/dist/components/slider/constants.d.ts +50 -21
  80. package/dist/components/slider/features/canvas.d.ts +47 -0
  81. package/dist/components/slider/features/controller.d.ts +1 -1
  82. package/dist/components/slider/features/handlers.d.ts +1 -1
  83. package/dist/components/slider/features/index.d.ts +1 -0
  84. package/dist/components/slider/features/states.d.ts +1 -1
  85. package/dist/components/slider/schema.d.ts +7 -50
  86. package/dist/components/slider/slider.d.ts +5 -4
  87. package/dist/components/slider/types.d.ts +10 -37
  88. package/dist/components/snackbar/api.d.ts +1 -1
  89. package/dist/components/snackbar/config.d.ts +3 -3
  90. package/dist/components/switch/api.d.ts +1 -1
  91. package/dist/components/switch/config.d.ts +2 -2
  92. package/dist/components/switch/features.d.ts +4 -4
  93. package/dist/components/switch/switch.d.ts +1 -1
  94. package/dist/components/switch/types.d.ts +22 -17
  95. package/dist/components/tabs/config.d.ts +2 -3
  96. package/dist/components/tabs/features.d.ts +5 -5
  97. package/dist/components/tabs/index.d.ts +10 -10
  98. package/dist/components/tabs/tab.d.ts +1 -1
  99. package/dist/components/tabs/utils.d.ts +1 -1
  100. package/dist/components/textfield/api.d.ts +13 -3
  101. package/dist/components/textfield/config.d.ts +2 -2
  102. package/dist/components/textfield/constants.d.ts +12 -20
  103. package/dist/components/textfield/features/density.d.ts +28 -0
  104. package/dist/components/textfield/features/index.d.ts +13 -12
  105. package/dist/components/textfield/index.d.ts +3 -3
  106. package/dist/components/textfield/textfield.d.ts +1 -1
  107. package/dist/components/textfield/types.d.ts +42 -35
  108. package/dist/components/timepicker/clockdial.d.ts +2 -2
  109. package/dist/components/timepicker/config.d.ts +4 -4
  110. package/dist/components/timepicker/render.d.ts +1 -1
  111. package/dist/components/timepicker/timepicker.d.ts +1 -1
  112. package/dist/components/timepicker/utils.d.ts +2 -2
  113. package/dist/components/tooltip/api.d.ts +1 -1
  114. package/dist/components/tooltip/config.d.ts +2 -2
  115. package/dist/components/top-app-bar/top-app-bar.d.ts +2 -2
  116. package/dist/constants.d.ts +30 -30
  117. package/dist/core/canvas/animation.d.ts +27 -0
  118. package/dist/core/canvas/drawing.d.ts +57 -0
  119. package/dist/core/canvas/index.d.ts +8 -0
  120. package/dist/core/canvas/resize.d.ts +14 -0
  121. package/dist/core/canvas/utils.d.ts +84 -0
  122. package/dist/core/collection/collection.d.ts +7 -7
  123. package/dist/core/collection/list-manager/index.d.ts +2 -2
  124. package/dist/core/collection/list-manager/renderer.d.ts +3 -3
  125. package/dist/core/collection/list-manager/scroll-tracker.d.ts +1 -1
  126. package/dist/core/compose/component.d.ts +2 -1
  127. package/dist/core/compose/features/checkable.d.ts +2 -2
  128. package/dist/core/compose/features/gestures/longpress.d.ts +2 -2
  129. package/dist/core/compose/features/gestures/pan.d.ts +2 -2
  130. package/dist/core/compose/features/gestures/pinch.d.ts +2 -2
  131. package/dist/core/compose/features/gestures/rotate.d.ts +2 -2
  132. package/dist/core/compose/features/gestures/swipe.d.ts +2 -2
  133. package/dist/core/compose/features/gestures/tap.d.ts +2 -2
  134. package/dist/core/compose/features/gestures.d.ts +2 -2
  135. package/dist/core/compose/features/input.d.ts +1 -1
  136. package/dist/core/compose/features/ripple.d.ts +2 -2
  137. package/dist/core/compose/features/size.d.ts +1 -1
  138. package/dist/core/compose/features/textinput.d.ts +1 -1
  139. package/dist/core/compose/features/throttle.d.ts +1 -1
  140. package/dist/core/compose/features/variant.d.ts +1 -1
  141. package/dist/core/compose/features/withEvents.d.ts +1 -1
  142. package/dist/core/composition/features/label.d.ts +1 -1
  143. package/dist/core/config/component.d.ts +4 -2
  144. package/dist/core/config/global.d.ts +65 -0
  145. package/dist/core/dom/attributes.d.ts +13 -15
  146. package/dist/core/dom/classes.d.ts +10 -0
  147. package/dist/core/dom/create.d.ts +36 -6
  148. package/dist/core/dom/index.d.ts +2 -2
  149. package/dist/core/gestures/pan.d.ts +1 -1
  150. package/dist/core/gestures/pinch.d.ts +1 -1
  151. package/dist/core/gestures/rotate.d.ts +1 -1
  152. package/dist/core/index.d.ts +3 -1
  153. package/dist/core/layout/array.d.ts +7 -2
  154. package/dist/core/layout/object.d.ts +2 -2
  155. package/dist/core/layout/processor.d.ts +2 -2
  156. package/dist/core/layout/utils.d.ts +1 -1
  157. package/dist/core/utils/color.d.ts +14 -0
  158. package/dist/core/utils/index.d.ts +2 -6
  159. package/dist/core/utils/theme.d.ts +38 -0
  160. package/dist/index.cjs +15 -15
  161. package/dist/index.cjs.map +158 -143
  162. package/dist/index.d.ts +7 -7
  163. package/dist/index.js +15 -15
  164. package/dist/index.js.map +158 -143
  165. package/dist/package.json +1 -1
  166. package/dist/styles.css +2 -2
  167. package/package.json +9 -13
@@ -0,0 +1,61 @@
1
+ import { ProgressConfig, ProgressThickness } from "../types";
2
+ /**
3
+ * Canvas dimensions and drawing context
4
+ */
5
+ export interface CanvasContext {
6
+ canvas: HTMLCanvasElement;
7
+ ctx: CanvasRenderingContext2D;
8
+ width: number;
9
+ height: number;
10
+ pixelRatio: number;
11
+ }
12
+ /**
13
+ * Component with canvas capabilities
14
+ */
15
+ interface CanvasComponent {
16
+ element: HTMLElement;
17
+ canvas: HTMLCanvasElement;
18
+ ctx: CanvasRenderingContext2D;
19
+ getClass: (name: string) => string;
20
+ draw: () => void;
21
+ resize: () => void;
22
+ [key: string]: unknown;
23
+ }
24
+ /**
25
+ * Base component interface for withCanvas
26
+ */
27
+ interface BaseComponent {
28
+ element: HTMLElement;
29
+ getClass: (name: string) => string;
30
+ lifecycle?: {
31
+ init?: () => void;
32
+ destroy?: () => void;
33
+ };
34
+ state?: {
35
+ value?: number;
36
+ max?: number;
37
+ buffer?: number;
38
+ indeterminate?: boolean;
39
+ [key: string]: unknown;
40
+ };
41
+ animationId?: number | null;
42
+ wavyAnimationId?: number | null;
43
+ valueAnimationId?: number | null;
44
+ animationTime?: number;
45
+ setIndeterminate?: (indeterminate: boolean) => void;
46
+ [key: string]: unknown;
47
+ }
48
+ /**
49
+ * Gets the stroke width for a given thickness preset or custom value
50
+ */
51
+ export declare const getStrokeWidth: (thickness?: ProgressThickness) => number;
52
+ /**
53
+ * Calculates wave amplitude based on stroke width
54
+ * Uses thickness 4 as the baseline (where amplitude is perfect)
55
+ */
56
+ export declare const getWaveAmplitude: (strokeWidth: number, baseAmplitude: number, maxAmplitude?: number) => number;
57
+ /**
58
+ * Adds canvas functionality to replace complex DOM structure
59
+ */
60
+ export declare const withCanvas: (config: ProgressConfig) => (component: BaseComponent) => CanvasComponent;
61
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Circular progress drawing functionality
3
+ */
4
+ import { ProgressConfig, ProgressShape } from "../types";
5
+ import { CanvasContext } from "./canvas";
6
+ /**
7
+ * Draws circular progress on canvas
8
+ */
9
+ export declare const drawCircularProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, isIndeterminate: boolean, animationTime?: number, currentShape?: ProgressShape) => void;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Progress component features
3
+ * Exports all features used by the progress component
4
+ */
5
+ export { withCanvas } from './canvas';
6
+ export { withState } from './state';
7
+ export { drawCircularProgress } from './circular';
8
+ export { drawLinearProgress } from './linear';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Linear progress drawing functionality
3
+ */
4
+ import { ProgressConfig, ProgressShape } from "../types";
5
+ import { CanvasContext } from "./canvas";
6
+ /**
7
+ * Draws linear progress on canvas with shape support
8
+ */
9
+ export declare const drawLinearProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, buffer: number, isIndeterminate: boolean, animationTime?: number, showStopIndicator?: boolean, currentShape?: ProgressShape) => void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Creates a ResizeObserver to handle canvas dimension changes
3
+ * This ensures the canvas always matches its container size
4
+ */
5
+ export declare const createCanvasResizeObserver: (element: HTMLElement, canvas: HTMLCanvasElement, onResize: () => void) => (() => void);
@@ -0,0 +1,46 @@
1
+ import { ProgressConfig, ProgressShape } from "../types";
2
+ /**
3
+ * Progress component state
4
+ */
5
+ interface ProgressState {
6
+ value: number;
7
+ max: number;
8
+ buffer: number;
9
+ indeterminate: boolean;
10
+ thickness: number | string;
11
+ shape: ProgressShape;
12
+ labelFormatter: (value: number, max: number) => string;
13
+ label?: HTMLElement;
14
+ showLabel?: boolean;
15
+ }
16
+ /**
17
+ * Component with lifecycle methods and canvas drawing
18
+ */
19
+ interface ComponentWithLifecycle {
20
+ element: HTMLElement;
21
+ canvas?: HTMLCanvasElement;
22
+ draw?: () => void;
23
+ lifecycle?: {
24
+ init?: () => void;
25
+ destroy?: () => void;
26
+ };
27
+ getClass?: (name: string) => string;
28
+ setIndeterminate?: (indeterminate: boolean) => unknown;
29
+ setValue?: (value: number) => unknown;
30
+ setBuffer?: (buffer: number) => unknown;
31
+ setShape?: (shape: ProgressShape) => unknown;
32
+ showLabel?: () => unknown;
33
+ setThickness?: (thickness: number | string) => unknown;
34
+ state?: ProgressState;
35
+ [key: string]: any;
36
+ }
37
+ /**
38
+ * Adds state management for canvas-based progress component
39
+ *
40
+ * @param config Progress configuration
41
+ * @returns Component enhancer with state management
42
+ */
43
+ export declare const withState: (config: ProgressConfig) => (component: ComponentWithLifecycle) => ComponentWithLifecycle & {
44
+ state: ProgressState;
45
+ };
46
+ export {};
@@ -1,3 +1,3 @@
1
1
  export { default } from './progress';
2
- export { ProgressConfig, ProgressComponent } from './types';
3
- export { PROGRESS_VARIANTS, PROGRESS_EVENTS, PROGRESS_DEFAULTS, PROGRESS_CLASSES } from './constants';
2
+ export { ProgressConfig, ProgressComponent, ProgressShape } from './types';
3
+ export { PROGRESS_VARIANTS, PROGRESS_SHAPES, PROGRESS_EVENTS, PROGRESS_DEFAULTS, PROGRESS_CLASSES, PROGRESS_MEASUREMENTS, PROGRESS_THICKNESS } from './constants';
@@ -1,6 +1,6 @@
1
- import { ProgressConfig, ProgressComponent } from './types';
1
+ import { ProgressConfig, ProgressComponent } from "./types";
2
2
  /**
3
- * Creates a new Progress component
3
+ * Creates a new Progress component using canvas rendering
4
4
  * @param {ProgressConfig} config - Progress configuration object
5
5
  * @returns {ProgressComponent} Progress component instance
6
6
  *
@@ -2,12 +2,22 @@
2
2
  * Progress variant types
3
3
  * @category Components
4
4
  */
5
- export type ProgressVariant = 'linear' | 'circular';
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 = "flat" | "wavy";
6
16
  /**
7
17
  * Progress component event types
8
18
  * @category Components
9
19
  */
10
- export type ProgressEvent = 'change' | 'complete';
20
+ export type ProgressEvent = "change" | "complete";
11
21
  /**
12
22
  * Configuration interface for the Progress component
13
23
  * @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 'flat'
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 ('flat' 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
@@ -154,6 +227,18 @@ export interface ProgressComponent {
154
227
  * @returns Whether the component is indeterminate
155
228
  */
156
229
  isIndeterminate: () => boolean;
230
+ /**
231
+ * Sets the size of the circular progress indicator
232
+ * Only applies to circular variant
233
+ * @param size - Size in pixels (clamped between 24 and 240)
234
+ * @returns The progress component for chaining
235
+ */
236
+ setSize: (size: number) => ProgressComponent;
237
+ /**
238
+ * Gets the current size of the circular progress indicator
239
+ * @returns Current size in pixels, or undefined for linear variant
240
+ */
241
+ getSize: () => number | undefined;
157
242
  /**
158
243
  * Adds an event listener to the progress
159
244
  * @param event - Event name ('change', 'complete')
@@ -1,4 +1,4 @@
1
- import { RadiosComponent } from './types';
1
+ import { RadiosComponent, RadioItem, RadioOptionConfig } from "./types";
2
2
  interface ApiOptions {
3
3
  disabled: {
4
4
  enable: () => void;
@@ -10,21 +10,21 @@ interface ApiOptions {
10
10
  }
11
11
  interface ComponentWithRadio {
12
12
  element: HTMLElement;
13
- radios: any[];
13
+ radios: RadioItem[];
14
14
  getValue: () => string;
15
- setValue: (value: string) => any;
16
- getSelected: () => any;
17
- addOption: (option: any) => any;
18
- removeOption: (value: string) => any;
19
- enable: () => any;
20
- disable: () => any;
21
- enableOption: (value: string) => any;
22
- disableOption: (value: string) => any;
15
+ setValue: (value: string) => void;
16
+ getSelected: () => RadioOptionConfig | null;
17
+ addOption: (option: RadioOptionConfig) => void;
18
+ removeOption: (value: string) => void;
19
+ enable: () => void;
20
+ disable: () => void;
21
+ enableOption: (value: string) => void;
22
+ disableOption: (value: string) => void;
23
23
  getClass: (name: string) => string;
24
24
  events: {
25
25
  on: (event: string, handler: Function) => void;
26
26
  off: (event: string, handler: Function) => void;
27
- emit?: (event: string, data: any) => void;
27
+ emit?: (event: string, data: unknown) => void;
28
28
  };
29
29
  }
30
30
  /**
@@ -1,4 +1,4 @@
1
- import { RadiosConfig } from './types';
1
+ import { RadiosConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Radios component
4
4
  */
@@ -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;
@@ -1,4 +1,4 @@
1
- import { RadiosConfig, RadiosComponent } from './types';
1
+ import { RadiosConfig, RadiosComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Radios component
4
4
  * @param {RadiosConfig} config - Radios configuration object
@@ -1,21 +1,25 @@
1
- import { SearchComponent } from './types';
1
+ import { SearchComponent } from "./types";
2
2
  /**
3
3
  * API options interface - structured by feature area
4
4
  */
5
5
  interface ApiOptions {
6
6
  search: {
7
- setValue: (value: string, triggerEvent?: boolean) => any;
7
+ setValue: (value: string, triggerEvent?: boolean) => void;
8
8
  getValue: () => string;
9
- setPlaceholder: (text: string) => any;
9
+ setPlaceholder: (text: string) => void;
10
10
  getPlaceholder: () => string;
11
- focus: () => any;
12
- blur: () => any;
13
- expand: () => any;
14
- collapse: () => any;
15
- clear: () => any;
16
- submit: () => any;
17
- setSuggestions: (suggestions: any[]) => any;
18
- showSuggestions: (show: boolean) => any;
11
+ focus: () => void;
12
+ blur: () => void;
13
+ expand: () => void;
14
+ collapse: () => void;
15
+ clear: () => void;
16
+ submit: () => void;
17
+ setSuggestions: (suggestions: string[] | Array<{
18
+ text: string;
19
+ value?: string;
20
+ icon?: string;
21
+ }>) => void;
22
+ showSuggestions: (show: boolean) => void;
19
23
  };
20
24
  disabled: {
21
25
  enable: () => void;
@@ -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;
@@ -1,4 +1,4 @@
1
- import { SearchConfig } from '../types';
1
+ import { SearchConfig } from "../types";
2
2
  /**
3
3
  * Add main search functionality to component
4
4
  * @param config Search configuration
@@ -1,4 +1,4 @@
1
- import { SegmentedButtonConfig, SelectionMode } from './types';
1
+ import { SegmentedButtonConfig, SelectionMode } from "./types";
2
2
  /**
3
3
  * Default configuration values for segmented buttons
4
4
  * @internal
@@ -24,11 +24,11 @@ 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
- 'aria-label': string;
30
- 'data-mode': SelectionMode;
31
- 'data-density': string;
29
+ "aria-label": string;
30
+ "data-mode": SelectionMode;
31
+ "data-density": string;
32
32
  };
33
33
  className: string[];
34
34
  interactive: boolean;
@@ -50,16 +50,16 @@ 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;
57
- 'aria-pressed': string;
57
+ "aria-pressed": string;
58
58
  value: any;
59
59
  };
60
60
  className: any[];
61
61
  forwardEvents: {
62
- click: (component: any) => boolean;
62
+ click: () => boolean;
63
63
  };
64
64
  interactive: boolean;
65
65
  };
@@ -1,4 +1,4 @@
1
- import { SelectComponent, ApiOptions } from './types';
1
+ import { SelectComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Enhances a select component with API methods
4
4
  * @param options - API configuration options
@@ -1,4 +1,4 @@
1
- import { SelectConfig, BaseComponent, ApiOptions } from './types';
1
+ import { SelectConfig, BaseComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Default configuration for the Select component
4
4
  */
@@ -1,4 +1,4 @@
1
- import { SelectConfig, BaseComponent } from './types';
1
+ import { SelectConfig, BaseComponent } from "./types";
2
2
  /**
3
3
  * Creates a textfield for the select component
4
4
  * @param config - Select configuration
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Available Select variants
3
3
  */
4
- export type SelectVariant = 'filled' | 'outlined';
4
+ export type SelectVariant = "filled" | "outlined";
5
5
  /**
6
6
  * Select variant constants
7
7
  */
@@ -59,6 +59,10 @@ export interface SelectConfig {
59
59
  * Visual variant (filled, outlined)
60
60
  */
61
61
  variant?: SelectVariant | string;
62
+ /**
63
+ * Density level (default, compact)
64
+ */
65
+ density?: "default" | "compact" | string;
62
66
  /**
63
67
  * Label text
64
68
  */
@@ -166,7 +170,7 @@ export interface SelectComponent {
166
170
  * @param interactionType - The type of interaction ('mouse' or 'keyboard')
167
171
  * @returns Select component for chaining
168
172
  */
169
- open: (interactionType?: 'mouse' | 'keyboard') => SelectComponent;
173
+ open: (interactionType?: "mouse" | "keyboard") => SelectComponent;
170
174
  /**
171
175
  * Closes the select menu
172
176
  * @returns Select component for chaining
@@ -176,6 +180,17 @@ export interface SelectComponent {
176
180
  * Checks if the menu is open
177
181
  */
178
182
  isOpen: () => boolean;
183
+ /**
184
+ * Sets the density of the select
185
+ * @param density - The density level to set
186
+ * @returns Select component for chaining
187
+ */
188
+ setDensity: (density: "default" | "compact" | string) => SelectComponent;
189
+ /**
190
+ * Gets the current density setting
191
+ * @returns The current density
192
+ */
193
+ getDensity: () => string;
179
194
  /**
180
195
  * Adds an event listener
181
196
  * @param event - Event name
@@ -248,9 +263,9 @@ export interface SelectChangeEvent extends SelectEvent {
248
263
  * @internal
249
264
  */
250
265
  export interface SelectEvents {
251
- 'change': (event: SelectChangeEvent) => void;
252
- 'open': (event: SelectEvent) => void;
253
- 'close': (event: SelectEvent) => void;
266
+ change: (event: SelectChangeEvent) => void;
267
+ open: (event: SelectEvent) => void;
268
+ close: (event: SelectEvent) => void;
254
269
  }
255
270
  /**
256
271
  * API options interface
@@ -1,4 +1,4 @@
1
- import { SheetConfig } from './types';
1
+ import { SheetConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Sheet component
4
4
  */
@@ -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;
@@ -1,4 +1,4 @@
1
- import { SheetConfig } from './types';
1
+ import { SheetConfig } from "./types";
2
2
  /**
3
3
  * Creates a new Sheet component
4
4
  * @param {SheetConfig} config - Sheet configuration object
@@ -1,4 +1,5 @@
1
- import { SliderComponent } from './types';
1
+ import { SliderComponent } from "./types";
2
+ import { SliderSize } from "./constants";
2
3
  /**
3
4
  * API options interface - structured by feature area
4
5
  */
@@ -24,7 +25,7 @@ interface ApiOptions {
24
25
  appearance: {
25
26
  setColor: (color: string) => void;
26
27
  getColor: () => string;
27
- setSize: (size: string) => void;
28
+ setSize: (size: SliderSize) => void;
28
29
  getSize: () => string;
29
30
  showTicks: (show: boolean) => void;
30
31
  showCurrentValue: (show: boolean) => void;
@@ -1,4 +1,4 @@
1
- import { SliderConfig } from './types';
1
+ import { SliderConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Slider component
4
4
  */
@@ -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;