@lumx/vue 4.2.1-alpha.8 → 4.3.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/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.2.1-alpha.8",
23
+ "version": "4.3.0",
24
24
  "dependencies": {
25
- "@lumx/core": "^4.2.1-alpha.8",
26
- "@lumx/icons": "^4.2.1-alpha.8",
25
+ "@lumx/core": "^4.3.0",
26
+ "@lumx/icons": "^4.3.0",
27
27
  "@vueuse/core": "^14.1.0"
28
28
  },
29
29
  "peerDependencies": {
@@ -53,6 +53,5 @@
53
53
  "vite-tsconfig-paths": "^5.1.4",
54
54
  "vitest": "^4.0.18",
55
55
  "vue": "^3.5.27"
56
- },
57
- "stableVersion": "4.2.0"
56
+ }
58
57
  }
@@ -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
+ };
@@ -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 type that includes optional children for JSX compatibility.
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
- * It specifically handles:
26
- * - Mapping Vue's `class` prop to LumX Core's `className` prop.
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 declare const VueToJSX: <Props extends GenericPropsWithChildren, Emits extends VueEmits = Record<string, never>>(Component: (props: Props, nestedComponents?: NestedComponents) => VNode, options?: VueToJSXOptions<Emits>) => FunctionalComponent<VueToJSXProps<Props>, Emits>;
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;
@@ -1,18 +0,0 @@
1
- import { HeadingProps } from '@lumx/core/js/components/Heading';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: {
5
- default?(_: {}): any;
6
- };
7
- refs: {};
8
- rootEl: any;
9
- };
10
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
11
- declare const __VLS_component: import('vue').DefineComponent<HeadingProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<HeadingProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
12
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
13
- export default _default;
14
- type __VLS_WithTemplateSlots<T, S> = T & {
15
- new (): {
16
- $slots: S;
17
- };
18
- };
@@ -1,21 +0,0 @@
1
- type __VLS_Props = {
2
- /** The heading level to start at. If left undefined, the parent context will be used, if any. */
3
- level?: number;
4
- };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: {
8
- default?(_: {}): any;
9
- };
10
- refs: {};
11
- rootEl: any;
12
- };
13
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
16
- export default _default;
17
- type __VLS_WithTemplateSlots<T, S> = T & {
18
- new (): {
19
- $slots: S;
20
- };
21
- };
@@ -1,5 +0,0 @@
1
- import { TextProps } from '@lumx/core/js/components/Text';
2
- declare const _default: import('vue').DefineComponent<TextProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<TextProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
3
- 'tooltip-label': unknown;
4
- }, any>;
5
- export default _default;
@@ -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' | OmitProps> & {
9
- /** Class name forwarded to the root element of the component. */
10
- class?: string;
11
- };