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
@@ -3,7 +3,7 @@
3
3
  * @param {Object} params - Rendering parameters
4
4
  * @returns {HTMLElement} Calendar header element
5
5
  */
6
- export declare const renderHeader: ({ currentMonth, currentYear, currentView, prefix, emit }: any) => HTMLElement;
6
+ export declare const renderHeader: ({ currentMonth, currentYear, currentView, prefix, emit, }: any) => HTMLElement;
7
7
  /**
8
8
  * Renders the days of the week (S, M, T, etc.)
9
9
  * @param {string} prefix - CSS class prefix
@@ -15,25 +15,25 @@ export declare const renderWeekdays: (prefix: string) => HTMLElement;
15
15
  * @param {Object} params - Rendering parameters
16
16
  * @returns {HTMLElement} Calendar days element
17
17
  */
18
- export declare const renderDays: ({ currentYear, currentMonth, selectedDate, rangeEndDate, minDate, maxDate, prefix, emit }: any) => HTMLElement;
18
+ export declare const renderDays: ({ currentYear, currentMonth, selectedDate, rangeEndDate, minDate, maxDate, prefix, emit, }: any) => HTMLElement;
19
19
  /**
20
20
  * Renders the month selection view
21
21
  * @param {Object} params - Rendering parameters
22
22
  * @returns {HTMLElement} Month selection element
23
23
  */
24
- export declare const renderMonthSelection: ({ currentYear, currentMonth, prefix, emit }: any) => HTMLElement;
24
+ export declare const renderMonthSelection: ({ currentMonth, prefix, emit, }: any) => HTMLElement;
25
25
  /**
26
26
  * Renders the year selection view
27
27
  * @param {Object} params - Rendering parameters
28
28
  * @returns {HTMLElement} Year selection element
29
29
  */
30
- export declare const renderYearSelection: ({ currentYear, prefix, emit }: any) => HTMLElement;
30
+ export declare const renderYearSelection: ({ currentYear, prefix, emit, }: any) => HTMLElement;
31
31
  /**
32
32
  * Renders the footer with action buttons
33
33
  * @param {Object} params - Rendering parameters
34
34
  * @returns {HTMLElement} Footer element
35
35
  */
36
- export declare const renderFooter: ({ variant, prefix, emit }: any) => HTMLElement;
36
+ export declare const renderFooter: ({ prefix, emit }: any) => HTMLElement;
37
37
  /**
38
38
  * Renders a complete calendar view
39
39
  * @param {Object} state - Current datepicker state
@@ -1,4 +1,4 @@
1
- import { DialogConfig } from './types';
1
+ import { DialogConfig } from "./types";
2
2
  /**
3
3
  * Creates the dialog DOM structure with proper divider handling
4
4
  * @param config Dialog configuration
@@ -1,5 +1,5 @@
1
- import { DividerConfig } from './config';
2
- import { DividerComponent } from './types';
1
+ import { DividerConfig } from "./config";
2
+ import { DividerComponent } from "./types";
3
3
  /**
4
4
  * Creates a new Divider component with the specified configuration.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { ExtendedFabConfig } from './types';
1
+ import { ExtendedFabConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Extended FAB component
4
4
  *
@@ -1,4 +1,4 @@
1
- import { FabConfig } from './types';
1
+ import { FabConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the FAB component
4
4
  *
@@ -27,7 +27,8 @@ export * from './fab';
27
27
  export * from './extended-fab';
28
28
  export * from './menu';
29
29
  export * from './navigation';
30
- export * from './progress';
30
+ export { PROGRESS_VARIANTS, PROGRESS_SHAPES, PROGRESS_EVENTS, PROGRESS_DEFAULTS, PROGRESS_CLASSES, PROGRESS_MEASUREMENTS, PROGRESS_THICKNESS } from './progress/constants';
31
+ export type { ProgressConfig, ProgressComponent, ProgressShape } from './progress/types';
31
32
  export * from './radios';
32
33
  export * from './search';
33
34
  export * from './segmented-button';
@@ -1,4 +1,4 @@
1
- import { MenuComponent, MenuContent, MenuPosition } from './types';
1
+ import { MenuComponent, MenuContent, MenuPosition, MenuEvents } from "./types";
2
2
  /**
3
3
  * API configuration options for menu component
4
4
  * @category Components
@@ -6,19 +6,19 @@ import { MenuComponent, MenuContent, MenuPosition } from './types';
6
6
  */
7
7
  interface ApiOptions {
8
8
  menu: {
9
- open: (event?: Event, interactionType?: 'mouse' | 'keyboard') => any;
10
- close: (event?: Event, restoreFocus?: boolean, skipAnimation?: boolean) => any;
11
- toggle: (event?: Event, interactionType?: 'mouse' | 'keyboard') => any;
9
+ open: (event?: Event, interactionType?: "mouse" | "keyboard") => void;
10
+ close: (event?: Event, restoreFocus?: boolean, skipAnimation?: boolean) => void;
11
+ toggle: (event?: Event, interactionType?: "mouse" | "keyboard") => void;
12
12
  isOpen: () => boolean;
13
- setItems: (items: MenuContent[]) => any;
13
+ setItems: (items: MenuContent[]) => void;
14
14
  getItems: () => MenuContent[];
15
- setPosition: (position: MenuPosition) => any;
15
+ setPosition: (position: MenuPosition) => void;
16
16
  getPosition: () => MenuPosition;
17
- setSelected: (itemId: string) => any;
17
+ setSelected: (itemId: string) => void;
18
18
  getSelected: () => string | null;
19
19
  };
20
20
  opener: {
21
- setOpener: (opener: HTMLElement | string) => any;
21
+ setOpener: (opener: HTMLElement | string) => void;
22
22
  getOpener: () => HTMLElement;
23
23
  };
24
24
  submenu?: {
@@ -26,8 +26,8 @@ interface ApiOptions {
26
26
  closeAllSubmenus: () => void;
27
27
  };
28
28
  events?: {
29
- on: <T extends string>(event: T, handler: (event: any) => void) => any;
30
- off: <T extends string>(event: T, handler: (event: any) => void) => any;
29
+ on: <T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]) => void;
30
+ off: <T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]) => void;
31
31
  };
32
32
  lifecycle: {
33
33
  destroy: () => void;
@@ -40,9 +40,9 @@ interface ApiOptions {
40
40
  */
41
41
  interface ComponentWithElements {
42
42
  element: HTMLElement;
43
- on?: <T extends string>(event: T, handler: (event: any) => void) => any;
44
- off?: <T extends string>(event: T, handler: (event: any) => void) => any;
45
- emit?: (event: string, data: any) => void;
43
+ on?: <T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]) => void;
44
+ off?: <T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]) => void;
45
+ emit?: (event: string, data: unknown) => void;
46
46
  }
47
47
  /**
48
48
  * Enhances a menu component with API methods.
@@ -54,5 +54,5 @@ interface ComponentWithElements {
54
54
  * @category Components
55
55
  * @internal This is an internal utility for the Menu component
56
56
  */
57
- declare const withAPI: ({ menu, opener, events, lifecycle, submenu }: ApiOptions) => (component: ComponentWithElements) => MenuComponent;
57
+ declare const withAPI: ({ menu, opener, events, lifecycle }: ApiOptions) => (component: ComponentWithElements) => MenuComponent;
58
58
  export { withAPI };
@@ -1,4 +1,4 @@
1
- import { MenuConfig } from './types';
1
+ import { MenuConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Menu component
4
4
  * These values will be used when not explicitly specified by the user.
@@ -1,4 +1,4 @@
1
- import { MenuConfig } from '../types';
1
+ import { MenuConfig } from "../types";
2
2
  /**
3
3
  * Adds controller functionality to the menu component
4
4
  * Manages state, rendering, positioning, and event handling
@@ -1,4 +1,4 @@
1
- import { MenuItem } from '../types';
1
+ import { MenuItem } from "../types";
2
2
  /**
3
3
  * Keyboard navigation handler for menus
4
4
  * Manages focus management and keyboard interactions for accessibility
@@ -22,5 +22,5 @@ export declare const createKeyboardNavigation: (component: any) => {
22
22
  * @param config - Menu configuration
23
23
  * @returns Component enhancer with keyboard navigation functionality
24
24
  */
25
- declare const withKeyboard: (config: any) => (component: any) => any;
25
+ declare const withKeyboard: () => (component: any) => any;
26
26
  export default withKeyboard;
@@ -1,4 +1,4 @@
1
- import { MenuConfig } from '../types';
1
+ import { MenuConfig } from "../types";
2
2
  /**
3
3
  * Adds submenu functionality to the menu component
4
4
  * Manages creation, positioning, and interaction with nested submenus
@@ -1,4 +1,4 @@
1
- import { MenuConfig, MenuComponent } from './types';
1
+ import { MenuConfig, MenuComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Menu component with the specified configuration.
4
4
  *
@@ -1,4 +1,4 @@
1
- import { NavigationConfig, BaseComponent, ApiOptions } from './types';
1
+ import { NavigationConfig, BaseComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Default configuration for the Navigation component
4
4
  */
@@ -1,4 +1,4 @@
1
- import { BaseComponent } from '../types';
1
+ import { BaseComponent } from "../types";
2
2
  /**
3
3
  * Configuration interface for controller feature
4
4
  */
@@ -1,4 +1,5 @@
1
- import { NavItemConfig, NavItemData, BaseComponent } from '../types';
1
+ import { NavItemConfig, BaseComponent } from "../types";
2
+ import type { NavItemData } from "../types";
2
3
  /**
3
4
  * Interface for a component with items management capabilities
4
5
  * @internal
@@ -1,4 +1,4 @@
1
- import { NavigationConfig, NavigationComponent } from './types';
1
+ import { NavigationConfig, NavigationComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Navigation component
4
4
  * @param {NavigationConfig} config - Navigation configuration
@@ -1,4 +1,4 @@
1
- import { NavigationSystemState } from './types';
1
+ import { NavigationSystemState } from "./types";
2
2
  /**
3
3
  * Update drawer content for a specific section WITHOUT changing visibility
4
4
  *
@@ -1,4 +1,4 @@
1
- import { NavigationSystemState } from './types';
1
+ import { NavigationSystemState } from "./types";
2
2
  /**
3
3
  * Registers rail navigation event handlers
4
4
  *
@@ -1,4 +1,4 @@
1
- import { NavigationSystemConfig, NavigationSystem } from './types';
1
+ import { NavigationSystemConfig, NavigationSystem } from "./types";
2
2
  /**
3
3
  * Creates a complete navigation system with synchronized rail and drawer components
4
4
  *
@@ -7,4 +7,4 @@ import { NavigationSystemConfig, NavigationSystem } from './types';
7
7
  */
8
8
  export declare const createNavigationSystem: (options?: NavigationSystemConfig) => NavigationSystem;
9
9
  export default createNavigationSystem;
10
- export * from './types';
10
+ export * from "./types";
@@ -1,4 +1,35 @@
1
- import { ProgressComponent, ProgressThickness, ProgressShape } from './types';
1
+ import { ProgressComponent, ProgressThickness, ProgressShape } from "./types";
2
+ /**
3
+ * Canvas component interface for API
4
+ */
5
+ interface CanvasComponent {
6
+ element: HTMLElement;
7
+ canvas: HTMLCanvasElement;
8
+ getClass: (name: string) => string;
9
+ label?: HTMLElement;
10
+ state?: {
11
+ label?: HTMLElement;
12
+ showLabel?: boolean;
13
+ value?: number;
14
+ max?: number;
15
+ buffer?: number;
16
+ indeterminate?: boolean;
17
+ thickness?: number | string;
18
+ shape?: ProgressShape;
19
+ labelFormatter?: (value: number, max: number) => string;
20
+ };
21
+ draw?: () => void;
22
+ setThickness?: (thickness: ProgressThickness) => void;
23
+ setShape?: (shape: ProgressShape) => void;
24
+ setValue?: (value: number, animate: boolean) => void;
25
+ setSize?: (size: number) => void;
26
+ getSize?: () => number | undefined;
27
+ hide?: () => void;
28
+ show?: () => void;
29
+ isVisible?: () => boolean;
30
+ startIndeterminateAnimation?: () => void;
31
+ stopIndeterminateAnimation?: () => void;
32
+ }
2
33
  /**
3
34
  * API configuration options for canvas-based progress component
4
35
  */
@@ -42,5 +73,5 @@ interface ApiOptions {
42
73
  /**
43
74
  * Enhances a canvas-based progress component with a streamlined API
44
75
  */
45
- export declare const withAPI: (options: ApiOptions) => (comp: any) => ProgressComponent;
76
+ export declare const withAPI: (options: ApiOptions) => (comp: CanvasComponent) => ProgressComponent;
46
77
  export {};
@@ -1,4 +1,4 @@
1
- import { ProgressConfig, ProgressThickness, ProgressShape } from './types';
1
+ import { ProgressConfig, ProgressThickness, ProgressShape } from "./types";
2
2
  /**
3
3
  * Default configuration for the Progress component
4
4
  */
@@ -32,7 +32,7 @@ export declare const getElementConfig: (config: ProgressConfig) => {
32
32
  /**
33
33
  * Creates API configuration for the Progress component
34
34
  */
35
- export declare const getApiConfig: (comp: any, state: any) => {
35
+ export declare const getApiConfig: (comp: any) => {
36
36
  value: {
37
37
  getValue: () => any;
38
38
  setValue: (value: number) => void;
@@ -11,8 +11,8 @@ export declare const PROGRESS_VARIANTS: {
11
11
  * Progress component shapes (linear only)
12
12
  */
13
13
  export declare const PROGRESS_SHAPES: {
14
- /** Standard straight line progress */
15
- readonly LINE: "line";
14
+ /** Standard flat progress */
15
+ readonly FLAT: "flat";
16
16
  /** Wavy animated progress */
17
17
  readonly WAVY: "wavy";
18
18
  };
@@ -38,7 +38,7 @@ export declare const PROGRESS_DEFAULTS: {
38
38
  /** Buffer value for linear progress with buffer */
39
39
  readonly BUFFER: 0;
40
40
  /** Default shape for linear indeterminate progress */
41
- readonly SHAPE: "line";
41
+ readonly SHAPE: "flat";
42
42
  /** Whether to show percentage label */
43
43
  readonly SHOW_LABEL: false;
44
44
  /** Whether progress is indeterminate */
@@ -106,34 +106,38 @@ export declare const PROGRESS_WAVE: {
106
106
  readonly LINEAR: {
107
107
  /** Base amplitude of the wave in pixels */
108
108
  readonly AMPLITUDE: 3;
109
- /** Speed of the wave animation */
110
- readonly SPEED: 0.008;
111
- /** Frequency of the wave (affects wavelength) */
112
- readonly FREQUENCY: 0.15;
113
- /** Frequency for indeterminate animation */
114
- readonly INDETERMINATE_FREQUENCY: 0.35;
109
+ /** Speed of wave animation in waves per second (Hz) */
110
+ readonly SPEED: 0.88;
111
+ /** Number of complete waves per 100 pixels */
112
+ readonly FREQUENCY: 2;
113
+ /** Number of complete waves per 100 pixels for indeterminate */
114
+ readonly INDETERMINATE_FREQUENCY: 4;
115
115
  /** Amplitude for indeterminate animation */
116
116
  readonly INDETERMINATE_AMPLITUDE: 2;
117
117
  /** Wave shape power (lower = rounder peaks, higher = sharper) */
118
118
  readonly POWER: 0.8;
119
+ /** Percentage at which wave amplitude reaches full strength from start */
120
+ readonly START_TRANSITION_END: 0;
121
+ /** Percentage at which wave amplitude begins to decrease near end */
122
+ readonly END_TRANSITION_START: 0.92;
119
123
  };
120
124
  /** Circular progress wave parameters */
121
125
  readonly CIRCULAR: {
122
- /** Amplitude as percentage of stroke width */
123
- readonly AMPLITUDE_RATIO: 1;
124
- /** Maximum amplitude in pixels */
125
- readonly AMPLITUDE_MAX: 5;
126
- /** Speed of the wave rotation */
127
- readonly SPEED: 0.008;
126
+ /** Amplitude as percentage of radius (7 = 7%) */
127
+ readonly AMPLITUDE: 6;
128
+ /** Amplitude as percentage of radius for indeterminate (4 = 4%) */
129
+ readonly INDETERMINATE_AMPLITUDE: 4;
130
+ /** Speed of wave rotation in rotations per second (Hz), negative value means clockwise */
131
+ readonly SPEED: 1.1;
128
132
  /** Number of complete waves around the circle */
129
- readonly FREQUENCY: 12;
133
+ readonly FREQUENCY: 10;
130
134
  /** Number of complete waves for indeterminate animation */
131
- readonly INDETERMINATE_FREQUENCY: 32;
132
- /** Amplitude ratio for indeterminate animation */
133
- readonly INDETERMINATE_AMPLITUDE_RATIO: 0.7;
134
- /** Maximum amplitude for indeterminate animation */
135
- readonly INDETERMINATE_AMPLITUDE_MAX: 3;
135
+ readonly INDETERMINATE_FREQUENCY: 16;
136
136
  /** Wave shape power (lower = rounder peaks, higher = sharper) */
137
137
  readonly POWER: 0.8;
138
+ /** Percentage at which wave amplitude reaches full strength from start */
139
+ readonly START_TRANSITION_END: 0;
140
+ /** Percentage at which wave amplitude begins to decrease near end */
141
+ readonly END_TRANSITION_START: 0.92;
138
142
  };
139
143
  };
@@ -1,4 +1,4 @@
1
- import { ProgressConfig } from '../types';
1
+ import { ProgressConfig, ProgressThickness } from "../types";
2
2
  /**
3
3
  * Canvas dimensions and drawing context
4
4
  */
@@ -19,14 +19,43 @@ interface CanvasComponent {
19
19
  getClass: (name: string) => string;
20
20
  draw: () => void;
21
21
  resize: () => void;
22
- [key: string]: any;
22
+ [key: string]: unknown;
23
23
  }
24
24
  /**
25
- * Gets the stroke width value from the thickness config
25
+ * Base component interface for withCanvas
26
26
  */
27
- export declare const getStrokeWidth: (thickness?: string | number) => number;
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;
28
57
  /**
29
58
  * Adds canvas functionality to replace complex DOM structure
30
59
  */
31
- export declare const withCanvas: (config: ProgressConfig) => (component: any) => CanvasComponent;
60
+ export declare const withCanvas: (config: ProgressConfig) => (component: BaseComponent) => CanvasComponent;
32
61
  export {};
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Circular progress drawing functionality
3
3
  */
4
- import { ProgressConfig, ProgressShape } from '../types';
5
- import { CanvasContext } from './canvas';
4
+ import { ProgressConfig, ProgressShape } from "../types";
5
+ import { CanvasContext } from "./canvas";
6
6
  /**
7
7
  * Draws circular progress on canvas
8
8
  */
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Linear progress drawing functionality
3
3
  */
4
- import { ProgressConfig, ProgressShape } from '../types';
5
- import { CanvasContext } from './canvas';
4
+ import { ProgressConfig, ProgressShape } from "../types";
5
+ import { CanvasContext } from "./canvas";
6
6
  /**
7
7
  * Draws linear progress on canvas with shape support
8
8
  */
@@ -1,4 +1,4 @@
1
- import { ProgressConfig, ProgressShape } from '../types';
1
+ import { ProgressConfig, ProgressShape } from "../types";
2
2
  /**
3
3
  * Progress component state
4
4
  */
@@ -11,6 +11,7 @@ interface ProgressState {
11
11
  shape: ProgressShape;
12
12
  labelFormatter: (value: number, max: number) => string;
13
13
  label?: HTMLElement;
14
+ showLabel?: boolean;
14
15
  }
15
16
  /**
16
17
  * Component with lifecycle methods and canvas drawing
@@ -24,6 +25,13 @@ interface ComponentWithLifecycle {
24
25
  destroy?: () => void;
25
26
  };
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;
27
35
  [key: string]: any;
28
36
  }
29
37
  /**
@@ -1,4 +1,4 @@
1
- import { ProgressConfig, ProgressComponent } from './types';
1
+ import { ProgressConfig, ProgressComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Progress component using canvas rendering
4
4
  * @param {ProgressConfig} config - Progress configuration object
@@ -2,22 +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
6
  /**
7
7
  * Progress thickness options
8
8
  * @category Components
9
9
  */
10
- export type ProgressThickness = 'thin' | 'thick' | number;
10
+ export type ProgressThickness = "thin" | "thick" | number;
11
11
  /**
12
12
  * Progress shape options (linear only)
13
13
  * @category Components
14
14
  */
15
- export type ProgressShape = 'line' | 'wavy';
15
+ export type ProgressShape = "flat" | "wavy";
16
16
  /**
17
17
  * Progress component event types
18
18
  * @category Components
19
19
  */
20
- export type ProgressEvent = 'change' | 'complete';
20
+ export type ProgressEvent = "change" | "complete";
21
21
  /**
22
22
  * Configuration interface for the Progress component
23
23
  * @category Components
@@ -61,7 +61,7 @@ export interface ProgressConfig {
61
61
  /**
62
62
  * Shape of the linear indeterminate progress animation
63
63
  * Only affects linear variant in indeterminate state
64
- * @default 'line'
64
+ * @default 'flat'
65
65
  */
66
66
  shape?: ProgressShape;
67
67
  /**
@@ -207,7 +207,7 @@ export interface ProgressComponent {
207
207
  /**
208
208
  * Sets the shape of the linear indeterminate progress animation
209
209
  * Only affects linear variant in indeterminate state
210
- * @param shape - Shape value ('line' or 'wavy')
210
+ * @param shape - Shape value ('flat' or 'wavy')
211
211
  * @returns The progress component for chaining
212
212
  */
213
213
  setShape: (shape: ProgressShape) => ProgressComponent;
@@ -227,6 +227,18 @@ export interface ProgressComponent {
227
227
  * @returns Whether the component is indeterminate
228
228
  */
229
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;
230
242
  /**
231
243
  * Adds an event listener to the progress
232
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
  */
@@ -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