@lumx/vue 4.2.1-alpha.9 → 4.3.1-alpha.0
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/components/button/Button.d.ts +1 -1
- package/components/button/ButtonGroup.d.ts +1 -1
- package/components/button/IconButton.d.ts +1 -1
- package/components/checkbox/Checkbox.d.ts +21 -0
- package/components/checkbox/index.d.ts +3 -0
- package/components/flag/Flag.d.ts +1 -1
- package/components/flex-box/FlexBox.d.ts +1 -1
- package/components/flex-box/index.d.ts +2 -2
- package/components/heading/Heading.d.ts +1 -1
- package/components/icon/Icon.d.ts +1 -1
- package/components/input-helper/InputHelper.d.ts +1 -1
- package/components/input-label/InputLabel.d.ts +1 -1
- package/components/message/Message.d.ts +1 -1
- package/components/radio-button/RadioButton.d.ts +21 -0
- package/components/radio-button/RadioGroup.d.ts +14 -0
- package/components/radio-button/index.d.ts +4 -0
- package/components/switch/Switch.d.ts +21 -0
- package/components/switch/index.d.ts +3 -0
- package/components/text/Text.d.ts +3 -3
- package/components/text/index.d.ts +1 -2
- package/composables/useDisableStateProps.d.ts +3 -3
- package/composables/useId.d.ts +7 -0
- package/index.d.ts +9 -6
- package/index.js +1388 -1028
- package/index.js.map +1 -1
- package/package.json +4 -4
- package/stories/decorators/withCombinations.d.ts +6 -0
- package/stories/decorators/withThemedBackground.d.ts +12 -0
- package/utils/VueToJSX.d.ts +9 -43
- package/utils/VueToJSXProps.d.ts +0 -11
package/package.json
CHANGED
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"types": "index.d.ts",
|
|
22
22
|
"sideEffects": false,
|
|
23
|
-
"version": "4.
|
|
23
|
+
"version": "4.3.1-alpha.0",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@lumx/core": "^4.
|
|
26
|
-
"@lumx/icons": "^4.
|
|
25
|
+
"@lumx/core": "^4.3.1-alpha.0",
|
|
26
|
+
"@lumx/icons": "^4.3.1-alpha.0",
|
|
27
27
|
"@vueuse/core": "^14.1.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"vitest": "^4.0.18",
|
|
55
55
|
"vue": "^3.5.27"
|
|
56
56
|
},
|
|
57
|
-
"stableVersion": "4.
|
|
57
|
+
"stableVersion": "4.3.0"
|
|
58
58
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CombinationsOptions } from '@lumx/core/stories/utils/combinations';
|
|
2
|
+
export type { CombinationsOptions, Combination, PropEntry } from '@lumx/core/stories/utils/combinations';
|
|
3
|
+
/**
|
|
4
|
+
* SB decorator generating a tables of combination of props (max 3 levels of props)
|
|
5
|
+
*/
|
|
6
|
+
export declare const withCombinations: (options: CombinationsOptions) => (story: any, ctx: any) => () => import("vue/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SB decorator adding a background adapted to the current theme.
|
|
3
|
+
*/
|
|
4
|
+
export declare const withThemedBackground: () => (story: any, { args }: any) => {
|
|
5
|
+
setup(): {
|
|
6
|
+
wrapperStyle: {
|
|
7
|
+
backgroundColor: string;
|
|
8
|
+
padding: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
template: string;
|
|
12
|
+
};
|
package/utils/VueToJSX.d.ts
CHANGED
|
@@ -1,46 +1,12 @@
|
|
|
1
|
-
import { VNode, SetupContext, EmitsOptions, FunctionalComponent } from 'vue';
|
|
2
|
-
import { NestedComponents } from '@lumx/core/js/types';
|
|
3
|
-
import { VueToJSXProps } from './VueToJSXProps';
|
|
4
1
|
/**
|
|
5
|
-
* Props
|
|
6
|
-
|
|
7
|
-
type GenericPropsWithChildren = Record<string, any>;
|
|
8
|
-
export type { VueToJSXProps } from './VueToJSXProps';
|
|
9
|
-
type VueEmits = EmitsOptions | Record<string, any[]>;
|
|
10
|
-
/**
|
|
11
|
-
* Options for configuring VueToJSX wrapper behavior.
|
|
12
|
-
*/
|
|
13
|
-
export interface VueToJSXOptions<Emits extends VueEmits = Record<string, never>> {
|
|
14
|
-
/** Vue emit function to handle events */
|
|
15
|
-
emit?: SetupContext<Emits>['emit'];
|
|
16
|
-
/** List of event names to bind (e.g., ['click', 'focus']) */
|
|
17
|
-
events?: string[];
|
|
18
|
-
nestedComponents?: NestedComponents;
|
|
19
|
-
}
|
|
20
|
-
export declare const keysOf: <T>() => <K extends readonly (keyof T)[]>(...keys: [keyof T] extends [K[number]] ? K : [Error: "\u274C Missing keys in your list:", Exclude<keyof T, K[number]>]) => K;
|
|
21
|
-
/**
|
|
22
|
-
* Higher-order component that wraps a LumX Core component (which uses JSX patterns)
|
|
23
|
-
* to be used as a Vue functional component.
|
|
2
|
+
* Props interface for components wrapped with VueToJSX.
|
|
3
|
+
* It omits JSX-specific props like `children` and `className` and adds Vue's `class`.
|
|
24
4
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* - Mapping Vue's default slot to LumX Core's `children` prop.
|
|
28
|
-
* - Optionally binding Vue events to JSX event handlers.
|
|
29
|
-
*
|
|
30
|
-
* @param Component The LumX Core component to wrap.
|
|
31
|
-
* @param options Optional configuration for event handling.
|
|
32
|
-
* @returns A Vue functional component.
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Simple usage (no events)
|
|
36
|
-
* const ui = VueToJSX(IconUI);
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* // With event handling
|
|
40
|
-
* const emit = defineEmits(emitSchema);
|
|
41
|
-
* const ui = VueToJSX<ButtonProps, typeof emitSchema>(ButtonUI, {
|
|
42
|
-
* emit,
|
|
43
|
-
* events: Object.keys(emitSchema)
|
|
44
|
-
* });
|
|
5
|
+
* @template Props - The base props type
|
|
6
|
+
* @template OmitProps - Additional props to omit beyond the defaults (children, className, ref)
|
|
45
7
|
*/
|
|
46
|
-
export
|
|
8
|
+
export type VueToJSXProps<Props, OmitProps extends keyof Props = never> = Omit<Props, 'children' | 'className' | 'ref' | 'onClick' | 'onChange' | OmitProps> & {
|
|
9
|
+
/** Class name forwarded to the root element of the component. */
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const keysOf: <T>() => <K extends readonly (keyof T)[]>(...keys: [keyof T] extends [K[number]] ? K : [Error: "\u274C Missing keys in your list:", Exclude<keyof T, K[number]>]) => K;
|
package/utils/VueToJSXProps.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Props interface for components wrapped with VueToJSX.
|
|
3
|
-
* It omits JSX-specific props like `children` and `className` and adds Vue's `class`.
|
|
4
|
-
*
|
|
5
|
-
* @template Props - The base props type
|
|
6
|
-
* @template OmitProps - Additional props to omit beyond the defaults (children, className, ref)
|
|
7
|
-
*/
|
|
8
|
-
export type VueToJSXProps<Props, OmitProps extends keyof Props = never> = Omit<Props, 'children' | 'className' | 'ref' | 'onClick' | 'onChange' | OmitProps> & {
|
|
9
|
-
/** Class name forwarded to the root element of the component. */
|
|
10
|
-
class?: string;
|
|
11
|
-
};
|