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
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* @module core/layout
|
|
3
3
|
* @description Processor for array-based layout schemas
|
|
4
4
|
*/
|
|
5
|
-
import { LayoutResult, LayoutOptions } from
|
|
5
|
+
import { LayoutResult, LayoutOptions } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Type for schema items
|
|
8
|
+
*/
|
|
9
|
+
type SchemaItem = Function | string | Record<string, unknown> | SchemaItem[];
|
|
6
10
|
/**
|
|
7
11
|
* Processes an array-based layout definition
|
|
8
12
|
*
|
|
@@ -12,4 +16,5 @@ import { LayoutResult, LayoutOptions } from './types';
|
|
|
12
16
|
* @param options - Layout creation options
|
|
13
17
|
* @returns Layout result object
|
|
14
18
|
*/
|
|
15
|
-
export declare function processArraySchema(schema:
|
|
19
|
+
export declare function processArraySchema(schema: SchemaItem[], parentElement?: HTMLElement | null, level?: number, options?: LayoutOptions): LayoutResult;
|
|
20
|
+
export {};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module core/layout
|
|
3
3
|
* @description Processor for object-based layout schemas
|
|
4
4
|
*/
|
|
5
|
-
import { Schema, LayoutResult, LayoutOptions } from
|
|
5
|
+
import { Schema, LayoutResult, LayoutOptions } from "./types";
|
|
6
6
|
/**
|
|
7
7
|
* Processes an object-based layout definition
|
|
8
8
|
*
|
|
@@ -11,4 +11,4 @@ import { Schema, LayoutResult, LayoutOptions } from './types';
|
|
|
11
11
|
* @param options - Layout creation options
|
|
12
12
|
* @returns Layout result object
|
|
13
13
|
*/
|
|
14
|
-
export declare function processObjectSchema(schema: Schema, parentElement?: HTMLElement | DocumentFragment | null, options?: LayoutOptions): LayoutResult;
|
|
14
|
+
export declare function processObjectSchema(schema: Schema, parentElement?: HTMLElement | SVGElement | DocumentFragment | null, options?: LayoutOptions): LayoutResult;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module core/layout
|
|
3
3
|
* @description Processor for layout creation
|
|
4
4
|
*/
|
|
5
|
-
import { LayoutResult, LayoutOptions } from
|
|
5
|
+
import { LayoutResult, LayoutOptions } from "./types";
|
|
6
6
|
/**
|
|
7
7
|
* Creates a component from a constructor or factory function
|
|
8
8
|
*
|
|
@@ -11,7 +11,7 @@ import { LayoutResult, LayoutOptions } from './types';
|
|
|
11
11
|
* @param layoutOptions - Global layout options
|
|
12
12
|
* @returns Created component instance
|
|
13
13
|
*/
|
|
14
|
-
export declare function createComponentInstance(Component: any, options?: Record<string, any
|
|
14
|
+
export declare function createComponentInstance(Component: any, options?: Record<string, any>): any;
|
|
15
15
|
/**
|
|
16
16
|
* Determines if a schema is in JSX format (transformed by h function)
|
|
17
17
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a color to RGBA format with specified opacity
|
|
3
|
+
* Handles hex, rgb, rgba, and named colors
|
|
4
|
+
*
|
|
5
|
+
* @param color - The color string to convert (hex, rgb, rgba, or named color)
|
|
6
|
+
* @param opacity - The opacity value (0-1)
|
|
7
|
+
* @returns RGBA color string
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* colorToRGBA('#ff0000', 0.5) // 'rgba(255, 0, 0, 0.5)'
|
|
11
|
+
* colorToRGBA('rgb(255, 0, 0)', 0.5) // 'rgba(255, 0, 0, 0.5)'
|
|
12
|
+
* colorToRGBA('red', 0.5) // 'rgba(255, 0, 0, 0.5)'
|
|
13
|
+
*/
|
|
14
|
+
export declare const colorToRGBA: (color: string, opacity: number) => string;
|
|
@@ -2,12 +2,8 @@ export { isObject, byString } from './object';
|
|
|
2
2
|
export { normalizeEvent, hasTouchSupport, TOUCH_CONFIG, PASSIVE_EVENTS } from './mobile';
|
|
3
3
|
export { getInheritedBackground } from './background';
|
|
4
4
|
export { throttle, debounce, once } from './performance';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* @param {...(string|string[])} classes - Classes to normalize
|
|
8
|
-
* @returns {string[]} Array of unique, non-empty class names
|
|
9
|
-
*/
|
|
10
|
-
export declare const normalizeClasses: (...classes: (string | string[])[]) => string[];
|
|
5
|
+
export { getThemeColor } from './theme';
|
|
6
|
+
export { colorToRGBA } from './color';
|
|
11
7
|
/**
|
|
12
8
|
* Creates a transformer that only runs if a condition is met
|
|
13
9
|
* @param {Function} predicate - Condition to check
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
type ThemeChangeCallback = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Register a callback to be notified of theme changes
|
|
4
|
+
* @param callback Function to call when theme changes
|
|
5
|
+
* @returns Function to unregister the callback
|
|
6
|
+
*/
|
|
7
|
+
export declare const onThemeChange: (callback: ThemeChangeCallback) => (() => void);
|
|
8
|
+
/**
|
|
9
|
+
* Gets a theme color from CSS variables, with optional alpha/opacity support.
|
|
10
|
+
* The prefix is automatically added to the variable name.
|
|
11
|
+
* Colors are retrieved from the active theme (defined on body element) if available,
|
|
12
|
+
* falling back to the default theme (defined on :root) if not found.
|
|
13
|
+
*
|
|
14
|
+
* @param {string} varName - The CSS variable name without prefix (e.g. 'sys-color-primary' or 'sys-color-primary-rgb')
|
|
15
|
+
* @param {object} [options] - Options for color retrieval
|
|
16
|
+
* @param {number} [options.alpha] - Alpha value (0-1) for rgba output (only works with --*-rgb variables)
|
|
17
|
+
* @param {string} [options.fallback] - Fallback color if variable is not found
|
|
18
|
+
* @param {ThemeChangeCallback} [options.onThemeChange] - Optional callback for theme changes
|
|
19
|
+
* @returns {string} The color value (hex, rgb, or rgba)
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Basic usage
|
|
23
|
+
* getThemeColor('sys-color-primary') // '#006493' (from active theme)
|
|
24
|
+
*
|
|
25
|
+
* // With theme change notification
|
|
26
|
+
* getThemeColor('sys-color-primary', {
|
|
27
|
+
* onThemeChange: () => {
|
|
28
|
+
* // Re-render or update component
|
|
29
|
+
* component.update();
|
|
30
|
+
* }
|
|
31
|
+
* });
|
|
32
|
+
*/
|
|
33
|
+
export declare function getThemeColor(varName: string, options?: {
|
|
34
|
+
alpha?: number;
|
|
35
|
+
fallback?: string;
|
|
36
|
+
onThemeChange?: ThemeChangeCallback;
|
|
37
|
+
}): string;
|
|
38
|
+
export {};
|