mtrl 0.4.0 → 0.4.4

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 (155) hide show
  1. package/dist/components/badge/api.d.ts +5 -5
  2. package/dist/components/badge/config.d.ts +17 -7
  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 +17 -6
  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 +1 -1
  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 +1 -1
  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 +1 -1
  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 +1 -1
  23. package/dist/components/chips/chips.d.ts +1 -1
  24. package/dist/components/chips/features/chip-items.d.ts +1 -1
  25. package/dist/components/chips/schema.d.ts +0 -1
  26. package/dist/components/datepicker/api.d.ts +1 -1
  27. package/dist/components/datepicker/config.d.ts +1 -1
  28. package/dist/components/datepicker/datepicker.d.ts +1 -1
  29. package/dist/components/datepicker/render.d.ts +5 -5
  30. package/dist/components/dialog/features.d.ts +1 -1
  31. package/dist/components/divider/divider.d.ts +2 -2
  32. package/dist/components/extended-fab/config.d.ts +1 -1
  33. package/dist/components/fab/config.d.ts +1 -1
  34. package/dist/components/index.d.ts +2 -1
  35. package/dist/components/menu/api.d.ts +14 -14
  36. package/dist/components/menu/config.d.ts +1 -1
  37. package/dist/components/menu/features/controller.d.ts +1 -1
  38. package/dist/components/menu/features/keyboard.d.ts +2 -2
  39. package/dist/components/menu/features/submenu.d.ts +1 -1
  40. package/dist/components/menu/menu.d.ts +1 -1
  41. package/dist/components/navigation/config.d.ts +1 -1
  42. package/dist/components/navigation/features/controller.d.ts +1 -1
  43. package/dist/components/navigation/features/items.d.ts +2 -1
  44. package/dist/components/navigation/navigation.d.ts +1 -1
  45. package/dist/components/navigation/system/core.d.ts +1 -1
  46. package/dist/components/navigation/system/events.d.ts +1 -1
  47. package/dist/components/navigation/system/index.d.ts +2 -2
  48. package/dist/components/progress/api.d.ts +33 -2
  49. package/dist/components/progress/config.d.ts +2 -2
  50. package/dist/components/progress/constants.d.ts +25 -21
  51. package/dist/components/progress/features/canvas.d.ts +34 -5
  52. package/dist/components/progress/features/circular.d.ts +2 -2
  53. package/dist/components/progress/features/linear.d.ts +2 -2
  54. package/dist/components/progress/features/state.d.ts +9 -1
  55. package/dist/components/progress/progress.d.ts +1 -1
  56. package/dist/components/progress/types.d.ts +18 -6
  57. package/dist/components/radios/api.d.ts +11 -11
  58. package/dist/components/radios/config.d.ts +1 -1
  59. package/dist/components/radios/radios.d.ts +1 -1
  60. package/dist/components/search/api.d.ts +15 -11
  61. package/dist/components/search/features/search.d.ts +1 -1
  62. package/dist/components/segmented-button/config.d.ts +6 -6
  63. package/dist/components/select/api.d.ts +1 -1
  64. package/dist/components/select/config.d.ts +1 -1
  65. package/dist/components/select/features.d.ts +1 -1
  66. package/dist/components/select/types.d.ts +20 -5
  67. package/dist/components/sheet/config.d.ts +1 -1
  68. package/dist/components/sheet/sheet.d.ts +1 -1
  69. package/dist/components/slider/api.d.ts +3 -2
  70. package/dist/components/slider/config.d.ts +1 -1
  71. package/dist/components/slider/constants.d.ts +50 -21
  72. package/dist/components/slider/features/canvas.d.ts +47 -0
  73. package/dist/components/slider/features/controller.d.ts +1 -1
  74. package/dist/components/slider/features/handlers.d.ts +1 -1
  75. package/dist/components/slider/features/index.d.ts +1 -0
  76. package/dist/components/slider/features/states.d.ts +1 -1
  77. package/dist/components/slider/schema.d.ts +4 -47
  78. package/dist/components/slider/slider.d.ts +5 -4
  79. package/dist/components/slider/types.d.ts +10 -37
  80. package/dist/components/snackbar/api.d.ts +1 -1
  81. package/dist/components/snackbar/config.d.ts +2 -2
  82. package/dist/components/switch/api.d.ts +1 -1
  83. package/dist/components/switch/config.d.ts +1 -1
  84. package/dist/components/switch/features.d.ts +4 -4
  85. package/dist/components/switch/switch.d.ts +1 -1
  86. package/dist/components/switch/types.d.ts +22 -17
  87. package/dist/components/tabs/config.d.ts +2 -3
  88. package/dist/components/tabs/features.d.ts +5 -5
  89. package/dist/components/tabs/index.d.ts +10 -10
  90. package/dist/components/tabs/tab.d.ts +1 -1
  91. package/dist/components/tabs/utils.d.ts +1 -1
  92. package/dist/components/textfield/api.d.ts +13 -3
  93. package/dist/components/textfield/config.d.ts +1 -1
  94. package/dist/components/textfield/constants.d.ts +12 -20
  95. package/dist/components/textfield/features/density.d.ts +28 -0
  96. package/dist/components/textfield/features/index.d.ts +13 -12
  97. package/dist/components/textfield/index.d.ts +3 -3
  98. package/dist/components/textfield/textfield.d.ts +1 -1
  99. package/dist/components/textfield/types.d.ts +42 -35
  100. package/dist/components/timepicker/clockdial.d.ts +2 -2
  101. package/dist/components/timepicker/config.d.ts +1 -1
  102. package/dist/components/timepicker/render.d.ts +1 -1
  103. package/dist/components/timepicker/timepicker.d.ts +1 -1
  104. package/dist/components/timepicker/utils.d.ts +2 -2
  105. package/dist/components/tooltip/api.d.ts +1 -1
  106. package/dist/components/tooltip/config.d.ts +1 -1
  107. package/dist/components/top-app-bar/top-app-bar.d.ts +2 -2
  108. package/dist/constants.d.ts +30 -30
  109. package/dist/core/canvas/animation.d.ts +27 -0
  110. package/dist/core/canvas/drawing.d.ts +57 -0
  111. package/dist/core/canvas/index.d.ts +6 -3
  112. package/dist/core/canvas/utils.d.ts +84 -0
  113. package/dist/core/collection/collection.d.ts +7 -7
  114. package/dist/core/collection/list-manager/index.d.ts +2 -2
  115. package/dist/core/collection/list-manager/renderer.d.ts +3 -3
  116. package/dist/core/collection/list-manager/scroll-tracker.d.ts +1 -1
  117. package/dist/core/compose/component.d.ts +1 -0
  118. package/dist/core/compose/features/checkable.d.ts +2 -2
  119. package/dist/core/compose/features/gestures/longpress.d.ts +2 -2
  120. package/dist/core/compose/features/gestures/pan.d.ts +2 -2
  121. package/dist/core/compose/features/gestures/pinch.d.ts +2 -2
  122. package/dist/core/compose/features/gestures/rotate.d.ts +2 -2
  123. package/dist/core/compose/features/gestures/swipe.d.ts +2 -2
  124. package/dist/core/compose/features/gestures/tap.d.ts +2 -2
  125. package/dist/core/compose/features/gestures.d.ts +2 -2
  126. package/dist/core/compose/features/input.d.ts +1 -1
  127. package/dist/core/compose/features/ripple.d.ts +2 -2
  128. package/dist/core/compose/features/size.d.ts +1 -1
  129. package/dist/core/compose/features/textinput.d.ts +1 -1
  130. package/dist/core/compose/features/throttle.d.ts +1 -1
  131. package/dist/core/compose/features/variant.d.ts +1 -1
  132. package/dist/core/compose/features/withEvents.d.ts +1 -1
  133. package/dist/core/composition/features/label.d.ts +1 -1
  134. package/dist/core/config/component.d.ts +2 -0
  135. package/dist/core/config/global.d.ts +65 -0
  136. package/dist/core/dom/create.d.ts +1 -1
  137. package/dist/core/gestures/pan.d.ts +1 -1
  138. package/dist/core/gestures/pinch.d.ts +1 -1
  139. package/dist/core/gestures/rotate.d.ts +1 -1
  140. package/dist/core/index.d.ts +2 -0
  141. package/dist/core/layout/array.d.ts +7 -2
  142. package/dist/core/layout/object.d.ts +1 -1
  143. package/dist/core/layout/processor.d.ts +2 -2
  144. package/dist/core/layout/utils.d.ts +1 -1
  145. package/dist/core/utils/color.d.ts +14 -0
  146. package/dist/core/utils/index.d.ts +1 -0
  147. package/dist/index.cjs +15 -15
  148. package/dist/index.cjs.map +149 -140
  149. package/dist/index.d.ts +7 -7
  150. package/dist/index.js +15 -15
  151. package/dist/index.js.map +149 -140
  152. package/dist/package.json +1 -1
  153. package/dist/styles.css +2 -2
  154. package/package.json +8 -2
  155. package/dist/components/progress/features.d.ts +0 -40
@@ -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;
@@ -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
@@ -26,9 +26,9 @@ export declare const getContainerConfig: (config: SegmentedButtonConfig) => {
26
26
  componentName: string;
27
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;
@@ -54,12 +54,12 @@ export declare const getSegmentConfig: (segment: any, prefix: any, groupDisabled
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
  */
@@ -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,12 +17,53 @@ export declare const SLIDER_COLORS: {
17
17
  * @category Components
18
18
  */
19
19
  export declare const SLIDER_SIZES: {
20
- /** Small size slider */
21
- readonly SMALL: "small";
22
- /** Medium size slider */
23
- readonly MEDIUM: "medium";
24
- /** Large size slider */
25
- readonly LARGE: "large";
20
+ /** Extra small size (default) - 16px track height */
21
+ readonly XS: 16;
22
+ /** Small size - 24px track height */
23
+ readonly S: 24;
24
+ /** Medium size - 40px track height */
25
+ readonly M: 40;
26
+ /** Large size - 56px track height */
27
+ readonly L: 56;
28
+ /** Extra large size - 96px track height */
29
+ readonly XL: 80;
30
+ };
31
+ /**
32
+ * Slider component size type
33
+ * @category Components
34
+ */
35
+ export type SliderSize = keyof typeof SLIDER_SIZES | number;
36
+ /**
37
+ * Slider component measurements
38
+ * @category Components
39
+ */
40
+ export declare const SLIDER_MEASUREMENTS: {
41
+ /** Handle size in pixels */
42
+ readonly HANDLE_SIZE: 16;
43
+ /** Handle height for XS and S sizes in pixels */
44
+ readonly SMALL_HANDLE_HEIGHT: 48;
45
+ /** Handle height offset for M, L, XL sizes (added to track height) */
46
+ readonly HANDLE_HEIGHT_OFFSET: 16;
47
+ /** Minimum container height in pixels */
48
+ readonly MIN_HEIGHT: 40;
49
+ /** Track border radius in pixels */
50
+ readonly TRACK_RADIUS: 3;
51
+ /** External track radius for XS and S sizes in pixels */
52
+ readonly SMALL_TRACK_EXTERNAL_RADIUS: 10;
53
+ /** External track radius ratio for M, L, XL sizes (multiplied by track height) */
54
+ readonly LARGE_TRACK_RADIUS_RATIO: 0.35;
55
+ /** Tick size in pixels */
56
+ readonly TICK_SIZE: 4;
57
+ /** Dot size in pixels */
58
+ readonly DOT_SIZE: 4;
59
+ /** Handle gap pixels */
60
+ readonly HANDLE_GAP: 8;
61
+ /** Handle gap reduction when pressed in pixels */
62
+ readonly HANDLE_GAP_PRESSED_REDUCTION: 2;
63
+ /** Center gap pixels for centered sliders */
64
+ readonly CENTER_GAP: 4;
65
+ /** Edge padding in pixels */
66
+ readonly EDGE_PADDING: 7;
26
67
  };
27
68
  /**
28
69
  * Available slider events
@@ -70,7 +111,7 @@ export declare const SLIDER_DEFAULTS: {
70
111
  /** Default color variant */
71
112
  readonly COLOR: "primary";
72
113
  /** Default size variant */
73
- readonly SIZE: "medium";
114
+ readonly SIZE: "XS";
74
115
  /** Whether to show tick marks */
75
116
  readonly TICKS: false;
76
117
  /** Whether to show value while dragging */
@@ -79,6 +120,8 @@ export declare const SLIDER_DEFAULTS: {
79
120
  readonly SNAP_TO_STEPS: true;
80
121
  /** Whether slider is a range slider (two handles) */
81
122
  readonly RANGE: false;
123
+ /** Whether slider is a centered slider (active track from center) */
124
+ readonly CENTERED: false;
82
125
  /** Default icon position */
83
126
  readonly ICON_POSITION: "start";
84
127
  /** Default label position */
@@ -93,8 +136,6 @@ export declare const SLIDER_CLASSES: {
93
136
  readonly ROOT: "slider";
94
137
  /** Container for slider track and handles */
95
138
  readonly CONTAINER: "slider__container";
96
- /** Track element class */
97
- readonly TRACK: "slider__track";
98
139
  /** Filled track portion class */
99
140
  readonly FILL: "slider__fill";
100
141
  /** Handle element class */
@@ -102,12 +143,6 @@ export declare const SLIDER_CLASSES: {
102
143
  /** Second handle element class (for range slider) */
103
144
  readonly HANDLE_SECOND: "slider__handle--second";
104
145
  /** Tick marks container class */
105
- readonly TICKS: "slider__ticks";
106
- /** Individual tick mark class */
107
- readonly TICK: "slider__tick";
108
- /** Active/selected tick mark class */
109
- readonly TICK_ACTIVE: "slider__tick--active";
110
- /** Label element class */
111
146
  readonly LABEL: "slider__label";
112
147
  /** Value display class */
113
148
  readonly VALUE: "slider__value";
@@ -121,12 +156,6 @@ export declare const SLIDER_CLASSES: {
121
156
  readonly DRAGGING: "slider--dragging";
122
157
  /** Range slider variant class */
123
158
  readonly RANGE: "slider--range";
124
- /** Small size variant class */
125
- readonly SMALL: "slider--small";
126
- /** Medium size variant class */
127
- readonly MEDIUM: "slider--medium";
128
- /** Large size variant class */
129
- readonly LARGE: "slider--large";
130
159
  /** Primary color variant class */
131
160
  readonly PRIMARY: "slider--primary";
132
161
  /** Secondary color variant class */
@@ -0,0 +1,47 @@
1
+ import { SliderConfig } from '../types';
2
+ import { SliderSize } from '../constants';
3
+ /**
4
+ * Animation state for smooth transitions
5
+ */
6
+ interface AnimationState {
7
+ animatedValue: number;
8
+ animatedSecondValue: number | null;
9
+ targetValue: number;
10
+ targetSecondValue: number | null;
11
+ startValue: number;
12
+ startSecondValue: number | null;
13
+ startTime: number;
14
+ duration: number;
15
+ animationFrame: number | null;
16
+ }
17
+ /**
18
+ * Component with canvas capabilities
19
+ */
20
+ interface CanvasSliderComponent {
21
+ element: HTMLElement;
22
+ canvas: HTMLCanvasElement;
23
+ ctx: CanvasRenderingContext2D;
24
+ getClass: (name: string) => string;
25
+ drawCanvas: (state?: any) => void;
26
+ resize: () => void;
27
+ animationState?: AnimationState;
28
+ [key: string]: any;
29
+ }
30
+ /**
31
+ * Gets the track height value from the size config
32
+ */
33
+ export declare const getTrackHeight: (size?: SliderSize) => number;
34
+ /**
35
+ * Gets the handle height based on the slider size
36
+ */
37
+ export declare const getHandleHeight: (size?: SliderSize) => number;
38
+ /**
39
+ * Gets the external track radius based on the slider size
40
+ */
41
+ export declare const getExternalTrackRadius: (size?: SliderSize) => number;
42
+ /**
43
+ * Adds canvas functionality for slider visuals
44
+ * Keeps handle and value bubble as DOM elements for accessibility
45
+ */
46
+ export declare const withCanvas: (config: SliderConfig) => (component: any) => CanvasSliderComponent;
47
+ export {};
@@ -1,4 +1,4 @@
1
- import { SliderConfig } from '../types';
1
+ import { SliderConfig } from "../types";
2
2
  /**
3
3
  * Add controller functionality to slider component
4
4
  * Manages state, events, user interactions, and UI rendering
@@ -1,4 +1,4 @@
1
- import { SliderConfig } from '../types';
1
+ import { SliderConfig } from "../types";
2
2
  /**
3
3
  * Create consolidated event handlers for slider component (mouse, touch, keyboard)
4
4
  *
@@ -1,3 +1,4 @@
1
1
  export { withRange } from './range';
2
2
  export { withStates } from './states';
3
3
  export { withController } from './controller';
4
+ export { withCanvas } from './canvas';
@@ -1,4 +1,4 @@
1
- import { SliderConfig } from '../types';
1
+ import { SliderConfig } from "../types";
2
2
  /**
3
3
  * Add state management features to slider component
4
4
  * Combines appearance and disabled functionality into a single feature
@@ -1,6 +1,7 @@
1
1
  import { SliderConfig } from './types';
2
2
  /**
3
3
  * Creates the base slider structure definition
4
+ * When using canvas mode, only handle and value bubble are DOM elements
4
5
  *
5
6
  * @param component Component for class name generation
6
7
  * @param config Slider configuration
@@ -20,55 +21,11 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
20
21
  container: {
21
22
  options: {
22
23
  className: any;
24
+ style: {
25
+ position: string;
26
+ };
23
27
  };
24
28
  children: {
25
- track: {
26
- options: {
27
- className: any;
28
- };
29
- children: {
30
- activeTrack: {
31
- options: {
32
- className: any;
33
- style: {
34
- width: string;
35
- };
36
- };
37
- };
38
- startTrack: {
39
- options: {
40
- className: any;
41
- style: {
42
- display: string;
43
- width: string;
44
- };
45
- };
46
- };
47
- remainingTrack: {
48
- options: {
49
- className: any;
50
- style: {
51
- width: string;
52
- };
53
- };
54
- };
55
- };
56
- };
57
- ticksContainer: {
58
- options: {
59
- className: any;
60
- };
61
- };
62
- startDot: {
63
- options: {
64
- className: any[];
65
- };
66
- };
67
- endDot: {
68
- options: {
69
- className: any[];
70
- };
71
- };
72
29
  handle: {
73
30
  options: {
74
31
  className: any;
@@ -6,10 +6,11 @@ import { SliderConfig, SliderComponent } from './types';
6
6
  * 1. Structure definition - Describes the DOM structure declaratively
7
7
  * 2. Feature enhancement - Adds specific capabilities (range, icons, labels)
8
8
  * 3. DOM creation - Turns the structure into actual DOM elements
9
- * 4. State management - Handles visual states and appearance
10
- * 5. Controller - Manages behavior, events, and UI rendering
11
- * 6. Lifecycle - Handles component lifecycle events
12
- * 7. Public API - Exposes a clean, consistent API
9
+ * 4. Canvas rendering - Uses canvas for visual elements, keeping handles as DOM
10
+ * 5. State management - Handles visual states and appearance
11
+ * 6. Controller - Manages behavior, events, and UI rendering
12
+ * 7. Lifecycle - Handles component lifecycle events
13
+ * 8. Public API - Exposes a clean, consistent API
13
14
  *
14
15
  * @param {SliderConfig} config - Slider configuration object
15
16
  * @returns {SliderComponent} Slider component instance
@@ -1,48 +1,19 @@
1
+ import { SliderSize, SLIDER_COLORS, SLIDER_EVENTS, SLIDER_SIZES } from "./constants";
2
+ import { BaseComponentConfig } from "../../core/config/component";
3
+ export { SLIDER_COLORS, SLIDER_EVENTS, SLIDER_SIZES };
1
4
  /**
2
5
  * Available slider color variants
3
6
  */
4
- export declare const SLIDER_COLORS: {
5
- readonly PRIMARY: "primary";
6
- readonly SECONDARY: "secondary";
7
- readonly TERTIARY: "tertiary";
8
- readonly ERROR: "error";
9
- };
10
- /**
11
- * Available slider size variants
12
- */
13
- export declare const SLIDER_SIZES: {
14
- readonly SMALL: "small";
15
- readonly MEDIUM: "medium";
16
- readonly LARGE: "large";
17
- };
18
- /**
19
- * Available slider events
20
- */
21
- export declare const SLIDER_EVENTS: {
22
- readonly CHANGE: "change";
23
- readonly INPUT: "input";
24
- readonly FOCUS: "focus";
25
- readonly BLUR: "blur";
26
- readonly START: "start";
27
- readonly END: "end";
28
- };
29
- /**
30
- * Available slider color variants
31
- */
32
- export type SliderColor = 'primary' | 'secondary' | 'tertiary' | 'error';
33
- /**
34
- * Available slider size variants
35
- */
36
- export type SliderSize = 'small' | 'medium' | 'large';
7
+ export type SliderColor = "primary" | "secondary" | "tertiary" | "error";
37
8
  /**
38
9
  * Available slider event types
39
10
  */
40
- export type SliderEventType = 'change' | 'input' | 'focus' | 'blur' | 'start' | 'end';
11
+ export type SliderEventType = "change" | "input" | "focus" | "blur" | "start" | "end";
41
12
  /**
42
13
  * Configuration options for the slider component
43
14
  * @interface SliderConfig
44
15
  */
45
- export interface SliderConfig {
16
+ export interface SliderConfig extends BaseComponentConfig {
46
17
  /** Minimum value of the slider */
47
18
  min?: number;
48
19
  /** Maximum value of the slider */
@@ -71,14 +42,16 @@ export interface SliderConfig {
71
42
  snapToSteps?: boolean;
72
43
  /** Whether the slider is a range slider (two handles) */
73
44
  range?: boolean;
45
+ /** Whether the slider is a centered slider (with active track from center) */
46
+ centered?: boolean;
74
47
  /** Label text for the slider */
75
48
  label?: string;
76
49
  /** Position of the label (start or end) - defaults to 'start' */
77
- labelPosition?: 'start' | 'end';
50
+ labelPosition?: "start" | "end";
78
51
  /** Icon to display with the slider */
79
52
  icon?: string;
80
53
  /** Position of the icon (start or end) */
81
- iconPosition?: 'start' | 'end';
54
+ iconPosition?: "start" | "end";
82
55
  /** Additional CSS classes */
83
56
  class?: string;
84
57
  /** Event handlers for slider events */
@@ -1,4 +1,4 @@
1
- import { BaseComponent, SnackbarComponent, ApiOptions } from './types';
1
+ import { BaseComponent, SnackbarComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Enhances snackbar component with API methods
4
4
  * @param {ApiOptions} options - API configuration
@@ -1,8 +1,8 @@
1
- import { SnackbarConfig, BaseComponent, ApiOptions } from './types';
1
+ import { SnackbarConfig, BaseComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Default configuration for the Snackbar component
4
4
  */
5
- export declare const defaultConfig: SnackbarConfig;
5
+ export declare const defaultConfig: Partial<SnackbarConfig>;
6
6
  /**
7
7
  * Creates the base configuration for Snackbar component
8
8
  * @param {SnackbarConfig} config - User provided configuration
@@ -1,4 +1,4 @@
1
- import { BaseComponent, SwitchComponent, ApiOptions } from './types';
1
+ import { BaseComponent, SwitchComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Enhances switch component with API methods
4
4
  * @param {ApiOptions} options - API configuration
@@ -1,4 +1,4 @@
1
- import { SwitchConfig, BaseComponent, ApiOptions } from './types';
1
+ import { SwitchConfig, BaseComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Default configuration for the Switch component
4
4
  */
@@ -1,6 +1,6 @@
1
- import { BaseComponent, ElementComponent } from '../../core/compose/component';
2
- import { TrackComponent } from '../../core/compose/features';
3
- import { SwitchConfig } from './types';
1
+ import { BaseComponent, ElementComponent } from "../../core/compose/component";
2
+ import { TrackComponent } from "../../core/compose/features";
3
+ import { SwitchConfig } from "./types";
4
4
  /**
5
5
  * Configuration for supporting text feature
6
6
  */
@@ -21,7 +21,7 @@ export interface SupportingTextConfig {
21
21
  * Component name
22
22
  */
23
23
  componentName?: string;
24
- [key: string]: any;
24
+ [key: string]: unknown;
25
25
  }
26
26
  /**
27
27
  * Component with supporting text capabilities
@@ -1,4 +1,4 @@
1
- import { SwitchConfig, SwitchComponent } from './types';
1
+ import { SwitchConfig, SwitchComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Switch component
4
4
  * @param {SwitchConfig} config - Switch configuration