mtrl 0.3.9 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/badge/api.d.ts +5 -5
- package/dist/components/badge/config.d.ts +18 -8
- package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +1 -1
- package/dist/components/bottom-app-bar/config.d.ts +1 -1
- package/dist/components/button/api.d.ts +19 -3
- package/dist/components/button/button.d.ts +41 -1
- package/dist/components/button/config.d.ts +18 -7
- package/dist/components/button/constants.d.ts +36 -0
- package/dist/components/button/features/progress.d.ts +26 -0
- package/dist/components/button/types.d.ts +108 -1
- package/dist/components/card/config.d.ts +2 -2
- package/dist/components/card/features.d.ts +14 -1
- package/dist/components/card/index.d.ts +6 -6
- package/dist/components/carousel/api.d.ts +15 -11
- package/dist/components/carousel/carousel.d.ts +1 -1
- package/dist/components/carousel/config.d.ts +2 -2
- package/dist/components/carousel/features/drag.d.ts +1 -1
- package/dist/components/carousel/features/slides.d.ts +1 -1
- package/dist/components/checkbox/config.d.ts +2 -2
- package/dist/components/checkbox/types.d.ts +2 -2
- package/dist/components/chips/chip/chip.d.ts +1 -1
- package/dist/components/chips/chip/config.d.ts +2 -2
- package/dist/components/chips/chips.d.ts +1 -1
- package/dist/components/chips/config.d.ts +1 -1
- package/dist/components/chips/features/chip-items.d.ts +1 -1
- package/dist/components/chips/schema.d.ts +1 -2
- package/dist/components/datepicker/api.d.ts +1 -1
- package/dist/components/datepicker/config.d.ts +4 -4
- package/dist/components/datepicker/datepicker.d.ts +1 -1
- package/dist/components/datepicker/render.d.ts +5 -5
- package/dist/components/dialog/config.d.ts +2 -2
- package/dist/components/dialog/features.d.ts +1 -1
- package/dist/components/dialog/types.d.ts +1 -1
- package/dist/components/divider/divider.d.ts +2 -2
- package/dist/components/extended-fab/config.d.ts +2 -2
- package/dist/components/fab/config.d.ts +2 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/list/config.d.ts +1 -1
- package/dist/components/menu/api.d.ts +14 -14
- package/dist/components/menu/config.d.ts +2 -2
- package/dist/components/menu/features/controller.d.ts +1 -1
- package/dist/components/menu/features/keyboard.d.ts +2 -2
- package/dist/components/menu/features/submenu.d.ts +1 -1
- package/dist/components/menu/menu.d.ts +1 -1
- package/dist/components/navigation/config.d.ts +2 -2
- package/dist/components/navigation/features/controller.d.ts +1 -1
- package/dist/components/navigation/features/items.d.ts +2 -1
- package/dist/components/navigation/navigation.d.ts +1 -1
- package/dist/components/navigation/system/core.d.ts +1 -1
- package/dist/components/navigation/system/events.d.ts +1 -1
- package/dist/components/navigation/system/index.d.ts +2 -2
- package/dist/components/progress/api.d.ts +49 -18
- package/dist/components/progress/config.d.ts +20 -11
- package/dist/components/progress/constants.d.ts +86 -1
- package/dist/components/progress/features/canvas.d.ts +61 -0
- package/dist/components/progress/features/circular.d.ts +9 -0
- package/dist/components/progress/features/index.d.ts +8 -0
- package/dist/components/progress/features/linear.d.ts +9 -0
- package/dist/components/progress/features/resize-observer.d.ts +5 -0
- package/dist/components/progress/features/state.d.ts +46 -0
- package/dist/components/progress/index.d.ts +2 -2
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/types.d.ts +102 -17
- package/dist/components/radios/api.d.ts +11 -11
- package/dist/components/radios/config.d.ts +2 -2
- package/dist/components/radios/radios.d.ts +1 -1
- package/dist/components/search/api.d.ts +15 -11
- package/dist/components/search/config.d.ts +1 -1
- package/dist/components/search/features/search.d.ts +1 -1
- package/dist/components/segmented-button/config.d.ts +8 -8
- package/dist/components/select/api.d.ts +1 -1
- package/dist/components/select/config.d.ts +1 -1
- package/dist/components/select/features.d.ts +1 -1
- package/dist/components/select/types.d.ts +20 -5
- package/dist/components/sheet/config.d.ts +2 -2
- package/dist/components/sheet/sheet.d.ts +1 -1
- package/dist/components/slider/api.d.ts +3 -2
- package/dist/components/slider/config.d.ts +2 -2
- package/dist/components/slider/constants.d.ts +50 -21
- package/dist/components/slider/features/canvas.d.ts +47 -0
- package/dist/components/slider/features/controller.d.ts +1 -1
- package/dist/components/slider/features/handlers.d.ts +1 -1
- package/dist/components/slider/features/index.d.ts +1 -0
- package/dist/components/slider/features/states.d.ts +1 -1
- package/dist/components/slider/schema.d.ts +7 -50
- package/dist/components/slider/slider.d.ts +5 -4
- package/dist/components/slider/types.d.ts +10 -37
- package/dist/components/snackbar/api.d.ts +1 -1
- package/dist/components/snackbar/config.d.ts +3 -3
- package/dist/components/switch/api.d.ts +1 -1
- package/dist/components/switch/config.d.ts +2 -2
- package/dist/components/switch/features.d.ts +4 -4
- package/dist/components/switch/switch.d.ts +1 -1
- package/dist/components/switch/types.d.ts +22 -17
- package/dist/components/tabs/config.d.ts +2 -3
- package/dist/components/tabs/features.d.ts +5 -5
- package/dist/components/tabs/index.d.ts +10 -10
- package/dist/components/tabs/tab.d.ts +1 -1
- package/dist/components/tabs/utils.d.ts +1 -1
- package/dist/components/textfield/api.d.ts +13 -3
- package/dist/components/textfield/config.d.ts +2 -2
- package/dist/components/textfield/constants.d.ts +12 -20
- package/dist/components/textfield/features/density.d.ts +28 -0
- package/dist/components/textfield/features/index.d.ts +13 -12
- package/dist/components/textfield/index.d.ts +3 -3
- package/dist/components/textfield/textfield.d.ts +1 -1
- package/dist/components/textfield/types.d.ts +42 -35
- package/dist/components/timepicker/clockdial.d.ts +2 -2
- package/dist/components/timepicker/config.d.ts +4 -4
- package/dist/components/timepicker/render.d.ts +1 -1
- package/dist/components/timepicker/timepicker.d.ts +1 -1
- package/dist/components/timepicker/utils.d.ts +2 -2
- package/dist/components/tooltip/api.d.ts +1 -1
- package/dist/components/tooltip/config.d.ts +2 -2
- package/dist/components/top-app-bar/top-app-bar.d.ts +2 -2
- package/dist/constants.d.ts +30 -30
- package/dist/core/canvas/animation.d.ts +27 -0
- package/dist/core/canvas/drawing.d.ts +57 -0
- package/dist/core/canvas/index.d.ts +8 -0
- package/dist/core/canvas/resize.d.ts +14 -0
- package/dist/core/canvas/utils.d.ts +84 -0
- package/dist/core/collection/collection.d.ts +7 -7
- package/dist/core/collection/list-manager/index.d.ts +2 -2
- package/dist/core/collection/list-manager/renderer.d.ts +3 -3
- package/dist/core/collection/list-manager/scroll-tracker.d.ts +1 -1
- package/dist/core/compose/component.d.ts +2 -1
- package/dist/core/compose/features/checkable.d.ts +2 -2
- package/dist/core/compose/features/gestures/longpress.d.ts +2 -2
- package/dist/core/compose/features/gestures/pan.d.ts +2 -2
- package/dist/core/compose/features/gestures/pinch.d.ts +2 -2
- package/dist/core/compose/features/gestures/rotate.d.ts +2 -2
- package/dist/core/compose/features/gestures/swipe.d.ts +2 -2
- package/dist/core/compose/features/gestures/tap.d.ts +2 -2
- package/dist/core/compose/features/gestures.d.ts +2 -2
- package/dist/core/compose/features/input.d.ts +1 -1
- package/dist/core/compose/features/ripple.d.ts +2 -2
- package/dist/core/compose/features/size.d.ts +1 -1
- package/dist/core/compose/features/textinput.d.ts +1 -1
- package/dist/core/compose/features/throttle.d.ts +1 -1
- package/dist/core/compose/features/variant.d.ts +1 -1
- package/dist/core/compose/features/withEvents.d.ts +1 -1
- package/dist/core/composition/features/label.d.ts +1 -1
- package/dist/core/config/component.d.ts +4 -2
- package/dist/core/config/global.d.ts +65 -0
- package/dist/core/dom/attributes.d.ts +13 -15
- package/dist/core/dom/classes.d.ts +10 -0
- package/dist/core/dom/create.d.ts +36 -6
- package/dist/core/dom/index.d.ts +2 -2
- package/dist/core/gestures/pan.d.ts +1 -1
- package/dist/core/gestures/pinch.d.ts +1 -1
- package/dist/core/gestures/rotate.d.ts +1 -1
- package/dist/core/index.d.ts +3 -1
- package/dist/core/layout/array.d.ts +7 -2
- package/dist/core/layout/object.d.ts +2 -2
- package/dist/core/layout/processor.d.ts +2 -2
- package/dist/core/layout/utils.d.ts +1 -1
- package/dist/core/utils/color.d.ts +14 -0
- package/dist/core/utils/index.d.ts +2 -6
- package/dist/core/utils/theme.d.ts +38 -0
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +158 -143
- package/dist/index.d.ts +7 -7
- package/dist/index.js +15 -15
- package/dist/index.js.map +158 -143
- package/dist/package.json +1 -1
- package/dist/styles.css +2 -2
- package/package.json +9 -13
|
@@ -17,12 +17,53 @@ export declare const SLIDER_COLORS: {
|
|
|
17
17
|
* @category Components
|
|
18
18
|
*/
|
|
19
19
|
export declare const SLIDER_SIZES: {
|
|
20
|
-
/**
|
|
21
|
-
readonly
|
|
22
|
-
/**
|
|
23
|
-
readonly
|
|
24
|
-
/**
|
|
25
|
-
readonly
|
|
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: "
|
|
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,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
|
|
@@ -10,7 +11,7 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
|
|
|
10
11
|
element: {
|
|
11
12
|
options: {
|
|
12
13
|
className: any[];
|
|
13
|
-
|
|
14
|
+
attributes: {
|
|
14
15
|
tabindex: string;
|
|
15
16
|
role: string;
|
|
16
17
|
'aria-disabled': string;
|
|
@@ -20,59 +21,15 @@ 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;
|
|
75
|
-
|
|
32
|
+
attributes: {
|
|
76
33
|
role: string;
|
|
77
34
|
'aria-valuemin': string;
|
|
78
35
|
'aria-valuemax': string;
|
|
@@ -91,7 +48,7 @@ export declare function createSliderSchema(component: any, config: SliderConfig)
|
|
|
91
48
|
valueBubble: {
|
|
92
49
|
options: {
|
|
93
50
|
className: any;
|
|
94
|
-
|
|
51
|
+
attributes: {
|
|
95
52
|
'aria-hidden': string;
|
|
96
53
|
'data-handle-index': string;
|
|
97
54
|
};
|
|
@@ -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.
|
|
10
|
-
* 5.
|
|
11
|
-
* 6.
|
|
12
|
-
* 7.
|
|
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
|
|
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 =
|
|
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?:
|
|
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?:
|
|
54
|
+
iconPosition?: "start" | "end";
|
|
82
55
|
/** Additional CSS classes */
|
|
83
56
|
class?: string;
|
|
84
57
|
/** Event handlers for slider events */
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SnackbarConfig, BaseComponent, ApiOptions } from
|
|
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
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config: SnackbarConfig) => SnackbarConfi
|
|
|
17
17
|
export declare const getElementConfig: (config: SnackbarConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SwitchConfig, BaseComponent, ApiOptions } from
|
|
1
|
+
import { SwitchConfig, BaseComponent, ApiOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration for the Switch component
|
|
4
4
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: SwitchConfig) => SwitchConfig;
|
|
|
17
17
|
export declare const getElementConfig: (config: SwitchConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BaseComponent, ElementComponent } from
|
|
2
|
-
import { TrackComponent } from
|
|
3
|
-
import { SwitchConfig } from
|
|
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]:
|
|
24
|
+
[key: string]: unknown;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
27
|
* Component with supporting text capabilities
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type SwitchPosition =
|
|
1
|
+
export type SwitchPosition = "center" | "start" | "end";
|
|
2
2
|
/**
|
|
3
3
|
* Switch label position types
|
|
4
4
|
*/
|
|
5
|
-
export type SwitchLabelPosition =
|
|
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: () =>
|
|
91
|
-
disable: () =>
|
|
92
|
+
enable: () => void;
|
|
93
|
+
disable: () => void;
|
|
92
94
|
};
|
|
93
95
|
lifecycle: {
|
|
94
96
|
destroy: () => void;
|
|
95
97
|
};
|
|
96
98
|
checkable: {
|
|
97
|
-
check: () =>
|
|
98
|
-
uncheck: () =>
|
|
99
|
-
toggle: () =>
|
|
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) =>
|
|
112
|
+
setValue?: (value: string) => void;
|
|
111
113
|
text?: {
|
|
112
|
-
setText: (content: string) =>
|
|
114
|
+
setText: (content: string) => void;
|
|
113
115
|
getText: () => string;
|
|
114
116
|
};
|
|
115
|
-
on?: (event: string, handler: Function) =>
|
|
116
|
-
off?: (event: string, handler: Function) =>
|
|
117
|
+
on?: (event: string, handler: Function) => void;
|
|
118
|
+
off?: (event: string, handler: Function) => void;
|
|
117
119
|
disabled?: {
|
|
118
|
-
enable: () =>
|
|
119
|
-
disable: () =>
|
|
120
|
+
enable: () => void;
|
|
121
|
+
disable: () => void;
|
|
120
122
|
};
|
|
121
123
|
lifecycle?: {
|
|
122
124
|
destroy: () => void;
|
|
123
125
|
};
|
|
124
126
|
checkable?: {
|
|
125
|
-
check: () =>
|
|
126
|
-
uncheck: () =>
|
|
127
|
-
toggle: () =>
|
|
127
|
+
check: () => void;
|
|
128
|
+
uncheck: () => void;
|
|
129
|
+
toggle: () => void;
|
|
128
130
|
isChecked: () => boolean;
|
|
129
131
|
};
|
|
130
|
-
|
|
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 {
|
|
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
|
|
2
|
-
import { TabIndicator } from
|
|
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?:
|
|
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?:
|
|
105
|
+
indicatorWidthStrategy?: "fixed" | "dynamic" | "content";
|
|
106
106
|
/** Indicator configuration object */
|
|
107
107
|
indicator?: {
|
|
108
|
-
widthStrategy?:
|
|
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
|
|
2
|
-
import { addScrollIndicators } from
|
|
3
|
-
import { setupResponsiveBehavior } from
|
|
4
|
-
import { createTabsState } from
|
|
5
|
-
import { createTabIndicator } from
|
|
6
|
-
import { updateTabPanels, setupKeyboardNavigation } from
|
|
7
|
-
export { TAB_VARIANTS, TAB_STATES, TAB_INDICATOR_WIDTH_STRATEGIES, TAB_EVENTS, TABS_EVENTS, TABS_DEFAULTS, TABS_CLASSES, TAB_CLASSES } from
|
|
8
|
-
export { TabsConfig, TabsComponent, TabComponent, TabConfig, TabChangeEventData, IndicatorConfig } from
|
|
9
|
-
export { addScrollIndicators, setupResponsiveBehavior, createTabsState, createTabIndicator, updateTabPanels, setupKeyboardNavigation };
|
|
10
|
-
export { withTabsManagement, withScrollable, withDivider, withIndicator, TabsManagementConfig, TabsManagementComponent, ScrollableConfig, ScrollableComponent, DividerConfig, IndicatorFeatureConfig, IndicatorComponent } from
|
|
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,8 +1,18 @@
|
|
|
1
|
-
import { BaseComponent, TextfieldComponent, ApiOptions } from
|
|
2
|
-
|
|
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:
|
|
17
|
+
export declare const withAPI: ({ disabled, lifecycle }: ApiOptions) => (component: ComponentWithDensity) => TextfieldComponent;
|
|
18
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TextfieldConfig, BaseComponent, ApiOptions } from
|
|
1
|
+
import { TextfieldConfig, BaseComponent, ApiOptions } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Default configuration for the Textfield component
|
|
4
4
|
*/
|
|
@@ -17,7 +17,7 @@ export declare const createBaseConfig: (config?: TextfieldConfig) => TextfieldCo
|
|
|
17
17
|
export declare const getElementConfig: (config: TextfieldConfig) => {
|
|
18
18
|
tag: string;
|
|
19
19
|
componentName: string;
|
|
20
|
-
|
|
20
|
+
attributes: Record<string, any>;
|
|
21
21
|
className: string[];
|
|
22
22
|
rawClass: string | string[];
|
|
23
23
|
html: string;
|