@lumx/core 4.5.2-alpha.3 → 4.5.2-alpha.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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
chip: HTMLElement;
|
|
8
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
element: HTMLElement;
|
|
8
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
11
|
+
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** list of generic props defined on JSX that need to be redefined for each framework */
|
|
2
|
-
export type PropsToOverride = 'ref' | 'handleClick' | 'handleChange' | 'handleKeyPress' | 'handleClose';
|
|
2
|
+
export type PropsToOverride = 'ref' | 'handleClick' | 'handleChange' | 'handleKeyPress' | 'handleClose' | 'handleBeforeClick' | 'handleAfterClick' | 'handleKeyDown';
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@floating-ui/dom": "^1.7.5",
|
|
10
|
-
"@lumx/icons": "^4.5.2-alpha.
|
|
10
|
+
"@lumx/icons": "^4.5.2-alpha.4",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.17.23",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
|
-
"version": "4.5.2-alpha.
|
|
70
|
+
"version": "4.5.2-alpha.4",
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
73
73
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"glob": "^7.1.6",
|
|
79
79
|
"jsdom": "^27.2.0",
|
|
80
80
|
"postcss": "^8.5.6",
|
|
81
|
-
"rollup": "^4.
|
|
81
|
+
"rollup": "^4.59.0",
|
|
82
82
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
83
83
|
"rollup-plugin-copy": "^3.5.0",
|
|
84
84
|
"rollup-plugin-ts-paths-resolve": "^1.7.1",
|
package/stories/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CombinationsOptions } from './utils/combinations';
|
|
2
|
+
import { ThemeVariablesOptions } from './utils/themeVariables';
|
|
2
3
|
/** Storybook decorator function */
|
|
3
4
|
type Decorator = (story: any, context: any) => any;
|
|
4
5
|
/** Framework-specific decorators (injectable by React/Vue consumers) */
|
|
@@ -20,6 +21,8 @@ interface StoryDecorators {
|
|
|
20
21
|
}) => Decorator;
|
|
21
22
|
/** Decorator forcing a minimum screen size for Chromatic snapshots */
|
|
22
23
|
withChromaticForceScreenSize?: () => Decorator;
|
|
24
|
+
/** Decorator for adding custom theming to a story */
|
|
25
|
+
withTheming?: (options: ThemeVariablesOptions) => Decorator;
|
|
23
26
|
}
|
|
24
27
|
/** A partial Storybook story object (args, argTypes, render, decorators, etc.) */
|
|
25
28
|
type StoryOverride = Record<string, any>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Property value - either a string or an object with a value property */
|
|
2
|
+
export type Property = string | {
|
|
3
|
+
value: string;
|
|
4
|
+
};
|
|
5
|
+
/** Nested tree structure of properties (matches DESIGN_TOKENS structure) */
|
|
6
|
+
export interface PropertyTree {
|
|
7
|
+
[key: string]: PropertyTree | Property;
|
|
8
|
+
}
|
|
9
|
+
/** Variable entry as [name, value] tuple */
|
|
10
|
+
export type Entry = [key: string, value: string];
|
|
11
|
+
/** Map of variable names to their values */
|
|
12
|
+
export type Variables = Record<string, string>;
|
|
13
|
+
/** Options for theming variables configuration */
|
|
14
|
+
export interface ThemeVariablesOptions<P extends PropertyTree = PropertyTree> {
|
|
15
|
+
/** Property tree from DESIGN_TOKENS */
|
|
16
|
+
properties?: P;
|
|
17
|
+
/** Initial CSS variable values (either CSS string or property tree) */
|
|
18
|
+
values?: string | Partial<P>;
|
|
19
|
+
}
|
|
20
|
+
/** Result of theme data preparation */
|
|
21
|
+
export interface ThemeData {
|
|
22
|
+
/** Initial style variables parsed from values option */
|
|
23
|
+
initialStyle: Variables;
|
|
24
|
+
/** Default style variables from properties tree */
|
|
25
|
+
defaultStyle: Variables;
|
|
26
|
+
/** Set of all variable names (union of initial and default) */
|
|
27
|
+
varNames: Set<string>;
|
|
28
|
+
/** Function that filters styles based on story args */
|
|
29
|
+
filteredStyles: (args: any) => () => Variables;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Prepare theme variable data for use in theming decorators.
|
|
33
|
+
* Converts property trees and CSS strings into filtered variable maps.
|
|
34
|
+
*
|
|
35
|
+
* @param options - Theming configuration (properties tree and initial values)
|
|
36
|
+
* @param args - Story args used for filtering (theme, emphasis, size, etc.)
|
|
37
|
+
* @returns Prepared theme data with initial/default styles and filtering function
|
|
38
|
+
*/
|
|
39
|
+
export declare function prepareThemeData(options: ThemeVariablesOptions): ThemeData;
|