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,8 +1,8 @@
1
- export type SwitchPosition = 'center' | 'start' | 'end';
1
+ export type SwitchPosition = "center" | "start" | "end";
2
2
  /**
3
3
  * Switch label position types
4
4
  */
5
- export type SwitchLabelPosition = 'start' | 'end';
5
+ export type SwitchLabelPosition = "start" | "end";
6
6
  /**
7
7
  * Switch label positions
8
8
  */
@@ -40,6 +40,8 @@ export interface SwitchConfig {
40
40
  componentName?: string;
41
41
  /** Icon HTML content */
42
42
  icon?: string;
43
+ /** Index signature for additional properties */
44
+ [key: string]: unknown;
43
45
  }
44
46
  /**
45
47
  * Switch component interface
@@ -87,16 +89,16 @@ export interface SwitchComponent {
87
89
  */
88
90
  export interface ApiOptions {
89
91
  disabled: {
90
- enable: () => any;
91
- disable: () => any;
92
+ enable: () => void;
93
+ disable: () => void;
92
94
  };
93
95
  lifecycle: {
94
96
  destroy: () => void;
95
97
  };
96
98
  checkable: {
97
- check: () => any;
98
- uncheck: () => any;
99
- toggle: () => any;
99
+ check: () => void;
100
+ uncheck: () => void;
101
+ toggle: () => void;
100
102
  isChecked: () => boolean;
101
103
  };
102
104
  }
@@ -107,25 +109,28 @@ export interface BaseComponent {
107
109
  element: HTMLElement;
108
110
  input?: HTMLInputElement;
109
111
  getValue?: () => string;
110
- setValue?: (value: string) => any;
112
+ setValue?: (value: string) => void;
111
113
  text?: {
112
- setText: (content: string) => any;
114
+ setText: (content: string) => void;
113
115
  getText: () => string;
114
116
  };
115
- on?: (event: string, handler: Function) => any;
116
- off?: (event: string, handler: Function) => any;
117
+ on?: (event: string, handler: Function) => void;
118
+ off?: (event: string, handler: Function) => void;
117
119
  disabled?: {
118
- enable: () => any;
119
- disable: () => any;
120
+ enable: () => void;
121
+ disable: () => void;
120
122
  };
121
123
  lifecycle?: {
122
124
  destroy: () => void;
123
125
  };
124
126
  checkable?: {
125
- check: () => any;
126
- uncheck: () => any;
127
- toggle: () => any;
127
+ check: () => void;
128
+ uncheck: () => void;
129
+ toggle: () => void;
128
130
  isChecked: () => boolean;
129
131
  };
130
- [key: string]: any;
132
+ supportingTextElement?: HTMLElement | null;
133
+ setSupportingText?: (text: string, isError?: boolean) => void;
134
+ removeSupportingText?: () => void;
135
+ [key: string]: unknown;
131
136
  }
@@ -1,5 +1,4 @@
1
- import { BaseComponentConfig } from '../../core/config/component';
2
- import { TabConfig } from './types';
1
+ import { TabConfig } from "./types";
3
2
  /**
4
3
  * Default configuration for a Tab
5
4
  */
@@ -13,7 +12,7 @@ export declare const defaultTabsConfig: {
13
12
  showDivider: true;
14
13
  componentName: string;
15
14
  };
16
- export declare const createTabsConfig: (config?: {}) => BaseComponentConfig;
15
+ export declare const createTabsConfig: (config?: {}) => import("../../core/config/component").BaseComponentConfig;
17
16
  /**
18
17
  * Creates the base configuration for a Tab
19
18
  * @param {TabConfig} config - User provided configuration
@@ -1,5 +1,5 @@
1
- import { TabConfig, TabComponent } from './types';
2
- import { TabIndicator } from './indicator';
1
+ import { TabConfig, TabComponent } from "./types";
2
+ import { TabIndicator } from "./indicator";
3
3
  interface ComponentBase {
4
4
  element: HTMLElement;
5
5
  getClass: (name: string) => string;
@@ -88,7 +88,7 @@ export interface IndicatorFeatureConfig {
88
88
  /** Component prefix */
89
89
  prefix?: string;
90
90
  /** Width strategy for the indicator */
91
- widthStrategy?: 'fixed' | 'dynamic' | 'content';
91
+ widthStrategy?: "fixed" | "dynamic" | "content";
92
92
  /** Height of the indicator in pixels */
93
93
  height?: number;
94
94
  /** Fixed width in pixels (when using fixed strategy) */
@@ -102,10 +102,10 @@ export interface IndicatorFeatureConfig {
102
102
  /** Legacy height property */
103
103
  indicatorHeight?: number;
104
104
  /** Legacy width strategy property */
105
- indicatorWidthStrategy?: 'fixed' | 'dynamic' | 'content';
105
+ indicatorWidthStrategy?: "fixed" | "dynamic" | "content";
106
106
  /** Indicator configuration object */
107
107
  indicator?: {
108
- widthStrategy?: 'fixed' | 'dynamic' | 'content';
108
+ widthStrategy?: "fixed" | "dynamic" | "content";
109
109
  height?: number;
110
110
  fixedWidth?: number;
111
111
  animationDuration?: number;
@@ -1,11 +1,11 @@
1
- import createTabs from './tabs';
2
- import { addScrollIndicators } from './scroll-indicators';
3
- import { setupResponsiveBehavior } from './responsive';
4
- import { createTabsState } from './state';
5
- import { createTabIndicator } from './indicator';
6
- import { updateTabPanels, setupKeyboardNavigation } from './utils';
7
- export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES } from './constants';
8
- export { TabsConfig, TabsComponent, TabComponent, TabConfig, TabChangeEventData, IndicatorConfig } from './types';
9
- export { addScrollIndicators, setupResponsiveBehavior, createTabsState, createTabIndicator, updateTabPanels, setupKeyboardNavigation };
10
- export { withTabsManagement, withScrollable, withDivider, withIndicator, TabsManagementConfig, TabsManagementComponent, ScrollableConfig, ScrollableComponent, DividerConfig, IndicatorFeatureConfig, IndicatorComponent } from './features';
1
+ import createTabs from "./tabs";
2
+ import { addScrollIndicators } from "./scroll-indicators";
3
+ import { setupResponsiveBehavior } from "./responsive";
4
+ import { createTabsState } from "./state";
5
+ import { createTabIndicator } from "./indicator";
6
+ import { updateTabPanels, setupKeyboardNavigation } from "./utils";
7
+ export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES, } from "./constants";
8
+ export { TabsConfig, TabsComponent, TabComponent, TabConfig, TabChangeEventData, IndicatorConfig, } from "./types";
9
+ export { addScrollIndicators, setupResponsiveBehavior, createTabsState, createTabIndicator, updateTabPanels, setupKeyboardNavigation, };
10
+ export { withTabsManagement, withScrollable, withDivider, withIndicator, TabsManagementConfig, TabsManagementComponent, ScrollableConfig, ScrollableComponent, DividerConfig, IndicatorFeatureConfig, IndicatorComponent, } from "./features";
11
11
  export default createTabs;
@@ -1,4 +1,4 @@
1
- import { TabConfig, TabComponent } from './types';
1
+ import { TabConfig, TabComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Tab component following MD3 guidelines
4
4
  * @param {TabConfig} config - Tab configuration object
@@ -1,4 +1,4 @@
1
- import { TabComponent } from './types';
1
+ import { TabComponent } from "./types";
2
2
  /**
3
3
  * Gets the active tab from a component
4
4
  * @param component - Component with tabs
@@ -1,8 +1,18 @@
1
- import { BaseComponent, TextfieldComponent, ApiOptions } from './types';
2
- import { PlacementComponent } from './features/placement';
1
+ import { BaseComponent, TextfieldComponent, ApiOptions } from "./types";
2
+ /**
3
+ * Component interface with density feature
4
+ */
5
+ type ComponentWithDensity = BaseComponent & {
6
+ density?: {
7
+ current: string;
8
+ set: (density: string) => void;
9
+ };
10
+ updateElementPositions?: () => void;
11
+ };
3
12
  /**
4
13
  * Enhances textfield component with API methods
5
14
  * @param {ApiOptions} options - API configuration
6
15
  * @returns {Function} Higher-order function that adds API methods to component
7
16
  */
8
- export declare const withAPI: ({ disabled, lifecycle }: ApiOptions) => (component: BaseComponent & Partial<PlacementComponent>) => TextfieldComponent;
17
+ export declare const withAPI: ({ disabled, lifecycle }: ApiOptions) => (component: ComponentWithDensity) => TextfieldComponent;
18
+ export {};
@@ -1,4 +1,4 @@
1
- import { TextfieldConfig, BaseComponent, ApiOptions } from './types';
1
+ import { TextfieldConfig, BaseComponent, ApiOptions } from "./types";
2
2
  /**
3
3
  * Default configuration for the Textfield component
4
4
  */
@@ -8,18 +8,6 @@ export declare const TEXTFIELD_VARIANTS: {
8
8
  /** Outlined variant with border and animated label */
9
9
  readonly OUTLINED: "outlined";
10
10
  };
11
- /**
12
- * Textfield size constants
13
- * @category Components
14
- */
15
- export declare const TEXTFIELD_SIZES: {
16
- /** Small textfield */
17
- readonly SMALL: "small";
18
- /** Medium textfield (default) */
19
- readonly MEDIUM: "medium";
20
- /** Large textfield */
21
- readonly LARGE: "large";
22
- };
23
11
  /**
24
12
  * Textfield state constants
25
13
  * @category Components
@@ -74,6 +62,16 @@ export declare const TEXTFIELD_EVENTS: {
74
62
  /** Fired when a key is released */
75
63
  readonly KEYUP: "keyup";
76
64
  };
65
+ /**
66
+ * Textfield density constants
67
+ * @category Components
68
+ */
69
+ export declare const TEXTFIELD_DENSITY: {
70
+ /** Default density (56px height) */
71
+ readonly DEFAULT: "default";
72
+ /** Compact density (40px height) */
73
+ readonly COMPACT: "compact";
74
+ };
77
75
  /**
78
76
  * Default textfield configuration values
79
77
  * @category Components
@@ -83,8 +81,8 @@ export declare const TEXTFIELD_DEFAULTS: {
83
81
  readonly TYPE: "text";
84
82
  /** Default visual variant */
85
83
  readonly VARIANT: "filled";
86
- /** Default textfield size */
87
- readonly SIZE: "medium";
84
+ /** Default density level */
85
+ readonly DENSITY: "default";
88
86
  /** Default disabled state */
89
87
  readonly DISABLED: false;
90
88
  /** Default required state */
@@ -113,12 +111,6 @@ export declare const TEXTFIELD_CLASSES: {
113
111
  readonly FILLED: "textfield--filled";
114
112
  /** Outlined variant class */
115
113
  readonly OUTLINED: "textfield--outlined";
116
- /** Small size class */
117
- readonly SMALL: "textfield--small";
118
- /** Medium size class */
119
- readonly MEDIUM: "textfield--medium";
120
- /** Large size class */
121
- readonly LARGE: "textfield--large";
122
114
  /** Focused state class */
123
115
  readonly FOCUSED: "textfield--focused";
124
116
  /** Disabled state class */
@@ -0,0 +1,28 @@
1
+ import { TextfieldConfig, TextfieldDensity } from "../types";
2
+ /**
3
+ * Configuration for density feature
4
+ */
5
+ interface DensityConfig extends TextfieldConfig {
6
+ density?: TextfieldDensity | string;
7
+ prefix?: string;
8
+ componentName?: string;
9
+ }
10
+ /**
11
+ * Component with density feature
12
+ */
13
+ interface DensityComponent {
14
+ element: HTMLElement;
15
+ input?: HTMLInputElement | HTMLTextAreaElement;
16
+ density?: {
17
+ current: string;
18
+ set: (density: string) => void;
19
+ };
20
+ updateElementPositions?: () => void;
21
+ }
22
+ /**
23
+ * Adds density support to textfield component
24
+ * @param {DensityConfig} config - Configuration with density option
25
+ * @returns {Function} Higher-order function that adds density capabilities
26
+ */
27
+ export declare const withDensity: (config: DensityConfig) => (component: DensityComponent) => DensityComponent;
28
+ export {};
@@ -1,12 +1,13 @@
1
- export { withLeadingIcon } from './leading-icon';
2
- export { withTrailingIcon } from './trailing-icon';
3
- export { withPrefixText } from './prefix-text';
4
- export { withSuffixText } from './suffix-text';
5
- export { withSupportingText } from './supporting-text';
6
- export { withPlacement } from './placement';
7
- export type { LeadingIconComponent, LeadingIconConfig } from './leading-icon';
8
- export type { TrailingIconComponent, TrailingIconConfig } from './trailing-icon';
9
- export type { PrefixTextComponent, PrefixTextConfig } from './prefix-text';
10
- export type { SuffixTextComponent, SuffixTextConfig } from './suffix-text';
11
- export type { SupportingTextComponent, SupportingTextConfig } from './supporting-text';
12
- export type { PlacementComponent } from './placement';
1
+ export { withLeadingIcon } from "./leading-icon";
2
+ export { withTrailingIcon } from "./trailing-icon";
3
+ export { withPrefixText } from "./prefix-text";
4
+ export { withSuffixText } from "./suffix-text";
5
+ export { withSupportingText } from "./supporting-text";
6
+ export { withPlacement } from "./placement";
7
+ export { withDensity } from "./density";
8
+ export type { LeadingIconComponent, LeadingIconConfig } from "./leading-icon";
9
+ export type { TrailingIconComponent, TrailingIconConfig, } from "./trailing-icon";
10
+ export type { PrefixTextComponent, PrefixTextConfig } from "./prefix-text";
11
+ export type { SuffixTextComponent, SuffixTextConfig } from "./suffix-text";
12
+ export type { SupportingTextComponent, SupportingTextConfig, } from "./supporting-text";
13
+ export type { PlacementComponent } from "./placement";
@@ -1,3 +1,3 @@
1
- export { default } from './textfield';
2
- export { TEXTFIELD_VARIANTS, TEXTFIELD_SIZES, TEXTFIELD_STATES, TEXTFIELD_TYPES, TEXTFIELD_EVENTS, TEXTFIELD_DEFAULTS, TEXTFIELD_CLASSES } from './constants';
3
- export { TextfieldConfig, TextfieldComponent } from './types';
1
+ export { default } from "./textfield";
2
+ export { TEXTFIELD_VARIANTS, TEXTFIELD_STATES, TEXTFIELD_TYPES, TEXTFIELD_EVENTS, TEXTFIELD_DEFAULTS, TEXTFIELD_CLASSES, TEXTFIELD_DENSITY, } from "./constants";
3
+ export { TextfieldConfig, TextfieldComponent, TextfieldDensity } from "./types";
@@ -1,4 +1,4 @@
1
- import { TextfieldConfig, TextfieldComponent } from './types';
1
+ import { TextfieldConfig, TextfieldComponent } from "./types";
2
2
  /**
3
3
  * Creates a new Textfield component
4
4
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Available Textfield variants
3
3
  */
4
- export type TextfieldVariant = 'filled' | 'outlined';
4
+ export type TextfieldVariant = "filled" | "outlined";
5
5
  /**
6
6
  * Textfield variant constants
7
7
  */
@@ -10,25 +10,24 @@ export declare const TEXTFIELD_VARIANTS: {
10
10
  readonly OUTLINED: "outlined";
11
11
  };
12
12
  /**
13
- * Available Textfield sizes
13
+ * Available Textfield states
14
14
  */
15
- export type TextfieldSize = 'small' | 'medium' | 'large';
15
+ export type TextfieldStates = "active" | "inactive" | "disabled";
16
16
  /**
17
- * Textfield size constants
17
+ * Available Textfield density levels
18
18
  */
19
- export declare const TEXTFIELD_SIZES: {
20
- readonly SMALL: "small";
21
- readonly MEDIUM: "medium";
22
- readonly LARGE: "large";
23
- };
19
+ export type TextfieldDensity = "default" | "compact";
24
20
  /**
25
- * Available Textfield states
21
+ * Textfield density constants
26
22
  */
27
- export type TextfieldStates = 'active' | 'inactive' | 'disabled';
23
+ export declare const TEXTFIELD_DENSITY: {
24
+ readonly DEFAULT: "default";
25
+ readonly COMPACT: "compact";
26
+ };
28
27
  /**
29
28
  * Available Textfield types
30
29
  */
31
- export type TextfieldTypes = 'text' | 'password' | 'email' | 'number' | 'tel' | 'url' | 'search' | 'multiline';
30
+ export type TextfieldTypes = "text" | "password" | "email" | "number" | "tel" | "url" | "search" | "multiline";
32
31
  /**
33
32
  * Textfield type constants
34
33
  */
@@ -50,12 +49,16 @@ export interface TextfieldConfig {
50
49
  type?: TextfieldTypes | string;
51
50
  /** Visual variant (filled, outlined) */
52
51
  variant?: TextfieldVariant | string;
52
+ /** Density level (default, compact) */
53
+ density?: TextfieldDensity | string;
53
54
  /** Input name attribute */
54
55
  name?: string;
55
56
  /** Label text */
56
57
  label?: string;
57
58
  /** Initial value */
58
59
  value?: string;
60
+ /** Placeholder text */
61
+ placeholder?: string;
59
62
  /** Whether input is required */
60
63
  required?: boolean;
61
64
  /** Whether textfield is disabled */
@@ -145,6 +148,10 @@ export interface TextfieldComponent {
145
148
  removeSuffixText: () => TextfieldComponent;
146
149
  /** Manually update element positions (useful after DOM changes) */
147
150
  updatePositions: () => TextfieldComponent;
151
+ /** Sets the density of the textfield */
152
+ setDensity: (density: TextfieldDensity | string) => TextfieldComponent;
153
+ /** Gets the current density setting */
154
+ getDensity: () => string;
148
155
  /** Adds event listener */
149
156
  on: (event: string, handler: Function) => TextfieldComponent;
150
157
  /** Removes event listener */
@@ -161,8 +168,8 @@ export interface TextfieldComponent {
161
168
  */
162
169
  export interface ApiOptions {
163
170
  disabled: {
164
- enable: () => any;
165
- disable: () => any;
171
+ enable: () => void;
172
+ disable: () => void;
166
173
  };
167
174
  lifecycle: {
168
175
  destroy: () => void;
@@ -177,41 +184,41 @@ export interface BaseComponent {
177
184
  config?: {
178
185
  prefix?: string;
179
186
  componentName?: string;
180
- [key: string]: any;
187
+ [key: string]: string | number | boolean | undefined;
181
188
  };
182
189
  getValue?: () => string;
183
- setValue?: (value: string) => any;
184
- setAttribute?: (name: string, value: string) => any;
190
+ setValue?: (value: string) => void;
191
+ setAttribute?: (name: string, value: string) => void;
185
192
  getAttribute?: (name: string) => string | null;
186
- removeAttribute?: (name: string) => any;
193
+ removeAttribute?: (name: string) => void;
187
194
  label?: {
188
- setText: (content: string) => any;
195
+ setText: (content: string) => void;
189
196
  getText: () => string;
190
197
  };
191
198
  leadingIcon?: HTMLElement | null;
192
- setLeadingIcon?: (html: string) => any;
193
- removeLeadingIcon?: () => any;
199
+ setLeadingIcon?: (html: string) => void;
200
+ removeLeadingIcon?: () => void;
194
201
  trailingIcon?: HTMLElement | null;
195
- setTrailingIcon?: (html: string) => any;
196
- removeTrailingIcon?: () => any;
202
+ setTrailingIcon?: (html: string) => void;
203
+ removeTrailingIcon?: () => void;
197
204
  supportingTextElement?: HTMLElement | null;
198
- setSupportingText?: (text: string, isError?: boolean) => any;
199
- removeSupportingText?: () => any;
205
+ setSupportingText?: (text: string, isError?: boolean) => void;
206
+ removeSupportingText?: () => void;
200
207
  prefixTextElement?: HTMLElement | null;
201
- setPrefixText?: (text: string) => any;
202
- removePrefixText?: () => any;
208
+ setPrefixText?: (text: string) => void;
209
+ removePrefixText?: () => void;
203
210
  suffixTextElement?: HTMLElement | null;
204
- setSuffixText?: (text: string) => any;
205
- removeSuffixText?: () => any;
206
- updateElementPositions?: () => any;
207
- on?: (event: string, handler: Function) => any;
208
- off?: (event: string, handler: Function) => any;
211
+ setSuffixText?: (text: string) => void;
212
+ removeSuffixText?: () => void;
213
+ updateElementPositions?: () => void;
214
+ on?: (event: string, handler: Function) => void;
215
+ off?: (event: string, handler: Function) => void;
209
216
  disabled?: {
210
- enable: () => any;
211
- disable: () => any;
217
+ enable: () => void;
218
+ disable: () => void;
212
219
  };
213
220
  lifecycle?: {
214
221
  destroy: () => void;
215
222
  };
216
- [key: string]: any;
223
+ [key: string]: unknown;
217
224
  }
@@ -1,4 +1,4 @@
1
- import { TimeValue, TIME_FORMAT, TIME_PICKER_TYPE } from './types';
1
+ import { TimeValue, TIME_FORMAT, TIME_PICKER_TYPE } from "./types";
2
2
  /**
3
3
  * Interface for Clock Dial rendering options
4
4
  */
@@ -7,7 +7,7 @@ export interface ClockDialOptions {
7
7
  format: TIME_FORMAT;
8
8
  showSeconds: boolean;
9
9
  prefix: string;
10
- activeSelector: 'hour' | 'minute' | 'second';
10
+ activeSelector: "hour" | "minute" | "second";
11
11
  }
12
12
  /**
13
13
  * Renders a clock dial on canvas with improved visual design
@@ -1,4 +1,4 @@
1
- import { TimePickerConfig } from './types';
1
+ import { TimePickerConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the TimePicker component
4
4
  */
@@ -1,4 +1,4 @@
1
- import { TimePickerConfig, TimeValue } from './types';
1
+ import { TimePickerConfig, TimeValue } from "./types";
2
2
  /**
3
3
  * Renders the time picker dialog
4
4
  * @param {HTMLElement} container - Dialog container element
@@ -1,4 +1,4 @@
1
- import { TimePickerConfig, TimePickerComponent } from './types';
1
+ import { TimePickerConfig, TimePickerComponent } from "./types";
2
2
  /**
3
3
  * Creates a new TimePicker component
4
4
  * @param {TimePickerConfig} config - TimePicker configuration object
@@ -1,4 +1,4 @@
1
- import { TimeValue, TIME_PERIOD, TIME_FORMAT } from './types';
1
+ import { TimeValue, TIME_PERIOD, TIME_FORMAT } from "./types";
2
2
  /**
3
3
  * Pads a number with leading zeros to ensure two-digit format
4
4
  * @param {number} num - Number to pad
@@ -11,7 +11,7 @@ export declare const padZero: (num: number) => string;
11
11
  * @param {TIME_FORMAT} format - Time format (12h or 24h)
12
12
  * @returns {TimeValue} Parsed time value
13
13
  */
14
- export declare const parseTime: (timeString: string, format: TIME_FORMAT) => TimeValue;
14
+ export declare const parseTime: (timeString: string, _format: TIME_FORMAT) => TimeValue;
15
15
  /**
16
16
  * Formats a TimeValue object as a time string
17
17
  * @param {TimeValue} timeValue - Time value to format
@@ -1,4 +1,4 @@
1
- import { TooltipComponent } from './types';
1
+ import { TooltipComponent } from "./types";
2
2
  interface ApiOptions {
3
3
  lifecycle: {
4
4
  destroy: () => void;
@@ -1,4 +1,4 @@
1
- import { TooltipConfig } from './types';
1
+ import { TooltipConfig } from "./types";
2
2
  /**
3
3
  * Default configuration for the Tooltip component
4
4
  */
@@ -2,8 +2,8 @@
2
2
  * @module components/top-app-bar
3
3
  * @description Top app bar implementation
4
4
  */
5
- import { ElementComponent } from '../../core/compose';
6
- import { TopAppBarConfig, TopAppBarType } from './types';
5
+ import { ElementComponent } from "../../core/compose";
6
+ import { TopAppBarConfig, TopAppBarType } from "./types";
7
7
  /**
8
8
  * Top app bar component interface
9
9
  */