@lumx/vue 4.5.2-alpha.3 → 4.5.2-alpha.5
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/chip/Chip.d.ts +30 -0
- package/components/chip/Chip.stories.d.ts +121 -0
- package/components/chip/index.d.ts +1 -0
- package/components/popover-dialog/PopoverDialog.d.ts +27 -0
- package/components/popover-dialog/PopoverDialog.stories.d.ts +25 -0
- package/components/popover-dialog/PopoverDialog.test.stories.d.ts +75 -0
- package/components/popover-dialog/index.d.ts +1 -0
- package/composables/useRestoreFocusOnClose.d.ts +7 -3
- package/index.d.ts +2 -0
- package/index.js +1780 -1606
- package/index.js.map +1 -1
- package/package.json +6 -6
- package/stories/decorators/withTheming.d.ts +26 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChipProps as UIProps, ChipPropsToOverride, CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS } from '@lumx/core/js/components/Chip';
|
|
2
|
+
import { VueToJSXProps } from '../../utils/VueToJSX';
|
|
3
|
+
export type ChipProps = VueToJSXProps<UIProps, ChipPropsToOverride>;
|
|
4
|
+
export declare const emitSchema: {
|
|
5
|
+
click: (event: MouseEvent) => boolean;
|
|
6
|
+
afterClick: (event: MouseEvent) => boolean;
|
|
7
|
+
beforeClick: (event: MouseEvent) => boolean;
|
|
8
|
+
keydown: (event: KeyboardEvent) => boolean;
|
|
9
|
+
};
|
|
10
|
+
export { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
|
|
11
|
+
/**
|
|
12
|
+
* Chip component.
|
|
13
|
+
*
|
|
14
|
+
* @param props Component props.
|
|
15
|
+
* @return Vue element.
|
|
16
|
+
*/
|
|
17
|
+
declare const Chip: import('vue').DefineSetupFnComponent<ChipProps, {
|
|
18
|
+
click: (event: MouseEvent) => boolean;
|
|
19
|
+
afterClick: (event: MouseEvent) => boolean;
|
|
20
|
+
beforeClick: (event: MouseEvent) => boolean;
|
|
21
|
+
keydown: (event: KeyboardEvent) => boolean;
|
|
22
|
+
}, {}, Omit<UIProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | ChipPropsToOverride> & {
|
|
23
|
+
class?: string;
|
|
24
|
+
} & {
|
|
25
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
26
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
27
|
+
onAfterClick?: ((event: MouseEvent) => any) | undefined;
|
|
28
|
+
onBeforeClick?: ((event: MouseEvent) => any) | undefined;
|
|
29
|
+
}, import('vue').PublicProps>;
|
|
30
|
+
export default Chip;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
render: ({ children, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
4
|
+
args: import('lodash').Omit<Partial<import('@lumx/core/js/components/Chip').ChipProps>, "theme">;
|
|
5
|
+
argTypes: {
|
|
6
|
+
size: {
|
|
7
|
+
control: {
|
|
8
|
+
type: "select" | "inline-radio";
|
|
9
|
+
};
|
|
10
|
+
options: ("s" | "m")[];
|
|
11
|
+
mapping: Record<string, "s" | "m"> | undefined;
|
|
12
|
+
};
|
|
13
|
+
before: {
|
|
14
|
+
control: boolean;
|
|
15
|
+
};
|
|
16
|
+
after: {
|
|
17
|
+
control: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
title: string;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
23
|
+
export declare const Default: {
|
|
24
|
+
args: {
|
|
25
|
+
children: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare const ChipButton: {
|
|
29
|
+
args: {
|
|
30
|
+
children: string;
|
|
31
|
+
};
|
|
32
|
+
argTypes: {
|
|
33
|
+
onClick: {
|
|
34
|
+
action: boolean;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const ChipLink: {
|
|
39
|
+
args: {
|
|
40
|
+
children: string;
|
|
41
|
+
href: string;
|
|
42
|
+
target: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const WithAfterAndBefore: {
|
|
46
|
+
render: ({ children, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
47
|
+
argTypes: {
|
|
48
|
+
onBeforeClick: {
|
|
49
|
+
action: boolean;
|
|
50
|
+
};
|
|
51
|
+
onClick: {
|
|
52
|
+
action: boolean;
|
|
53
|
+
};
|
|
54
|
+
onAfterClick: {
|
|
55
|
+
action: boolean;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
args: {
|
|
59
|
+
children: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const ColorVariants: {
|
|
63
|
+
render: ({ children, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
64
|
+
argTypes: {
|
|
65
|
+
onBeforeClick: {
|
|
66
|
+
action: boolean;
|
|
67
|
+
};
|
|
68
|
+
onClick: {
|
|
69
|
+
action: boolean;
|
|
70
|
+
};
|
|
71
|
+
onAfterClick: {
|
|
72
|
+
action: boolean;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
args: {
|
|
76
|
+
children: string;
|
|
77
|
+
};
|
|
78
|
+
decorators: ((story: any, context: any) => any)[];
|
|
79
|
+
};
|
|
80
|
+
export declare const SelectedVariants: {
|
|
81
|
+
render: ({ children, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
82
|
+
argTypes: {
|
|
83
|
+
onBeforeClick: {
|
|
84
|
+
action: boolean;
|
|
85
|
+
};
|
|
86
|
+
onClick: {
|
|
87
|
+
action: boolean;
|
|
88
|
+
};
|
|
89
|
+
onAfterClick: {
|
|
90
|
+
action: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
args: {
|
|
94
|
+
children: string;
|
|
95
|
+
};
|
|
96
|
+
decorators: ((story: any, context: any) => any)[];
|
|
97
|
+
};
|
|
98
|
+
export declare const Disabled: {
|
|
99
|
+
args: {
|
|
100
|
+
children: string;
|
|
101
|
+
};
|
|
102
|
+
decorators: ((story: any, context: any) => any)[];
|
|
103
|
+
};
|
|
104
|
+
export declare const Theming: {
|
|
105
|
+
render: ({ children, ...args }: any) => import("vue/jsx-runtime").JSX.Element;
|
|
106
|
+
decorators: ((story: any, context: any) => any)[];
|
|
107
|
+
argTypes: {
|
|
108
|
+
onBeforeClick: {
|
|
109
|
+
action: boolean;
|
|
110
|
+
};
|
|
111
|
+
onClick: {
|
|
112
|
+
action: boolean;
|
|
113
|
+
};
|
|
114
|
+
onAfterClick: {
|
|
115
|
+
action: boolean;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
args: {
|
|
119
|
+
children: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Chip, type ChipProps } from './Chip';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS, PopoverDialogProps as CorePopoverDialogProps } from '@lumx/core/js/components/PopoverDialog';
|
|
2
|
+
import { PopoverProps as CorePopoverProps } from '@lumx/core/js/components/Popover';
|
|
3
|
+
import { PopoverProps } from '../popover/Popover';
|
|
4
|
+
/**
|
|
5
|
+
* Vue PopoverDialog props.
|
|
6
|
+
* Extends the Vue Popover props with dialog-specific accessible label props from core.
|
|
7
|
+
*/
|
|
8
|
+
export type PopoverDialogProps = PopoverProps & Omit<CorePopoverDialogProps, keyof CorePopoverProps>;
|
|
9
|
+
export declare const emitSchema: {
|
|
10
|
+
close: () => boolean;
|
|
11
|
+
};
|
|
12
|
+
declare const PopoverDialog: import('vue').DefineSetupFnComponent<PopoverDialogProps, {
|
|
13
|
+
close: () => boolean;
|
|
14
|
+
}, {}, Omit<CorePopoverProps, "className" | import('@lumx/core/js/types').PropsToOverride | "children" | "isOpen" | "anchorRef" | "boundaryRef" | "focusElement" | "parentElement" | "focusTrapZoneElement"> & {
|
|
15
|
+
class?: string;
|
|
16
|
+
} & {
|
|
17
|
+
anchorRef?: import('vue').Ref<HTMLElement | undefined> | HTMLElement;
|
|
18
|
+
boundaryRef?: import('vue').Ref<HTMLElement | undefined> | HTMLElement;
|
|
19
|
+
focusElement?: HTMLElement;
|
|
20
|
+
isOpen?: boolean;
|
|
21
|
+
parentElement?: HTMLElement;
|
|
22
|
+
focusTrapZoneElement?: HTMLElement;
|
|
23
|
+
} & Omit<CorePopoverDialogProps, keyof CorePopoverProps> & {
|
|
24
|
+
onClose?: (() => any) | undefined;
|
|
25
|
+
}, import('vue').PublicProps>;
|
|
26
|
+
export default PopoverDialog;
|
|
27
|
+
export { CLASSNAME, COMPONENT_NAME, DEFAULT_PROPS };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: any;
|
|
3
|
+
render: any;
|
|
4
|
+
parameters: {
|
|
5
|
+
chromatic: {
|
|
6
|
+
disableSnapshot: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
tags: string[];
|
|
10
|
+
argTypes: {
|
|
11
|
+
anchorRef: {
|
|
12
|
+
control: boolean;
|
|
13
|
+
};
|
|
14
|
+
children: {
|
|
15
|
+
control: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
title: string;
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const WithIconButtonTrigger: {
|
|
22
|
+
args: {
|
|
23
|
+
label: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: import('vue').DefineSetupFnComponent<import('../..').PopoverDialogProps, {
|
|
4
|
+
close: () => boolean;
|
|
5
|
+
}, {}, Omit<import('@lumx/core/js/components/Popover').PopoverProps, "className" | import('../..').PropsToOverride | "children" | "isOpen" | "anchorRef" | "boundaryRef" | "focusElement" | "parentElement" | "focusTrapZoneElement"> & {
|
|
6
|
+
class?: string;
|
|
7
|
+
} & {
|
|
8
|
+
anchorRef?: import('vue').Ref<HTMLElement | undefined> | HTMLElement;
|
|
9
|
+
boundaryRef?: import('vue').Ref<HTMLElement | undefined> | HTMLElement;
|
|
10
|
+
focusElement?: HTMLElement;
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
parentElement?: HTMLElement;
|
|
13
|
+
focusTrapZoneElement?: HTMLElement;
|
|
14
|
+
} & Omit<import('@lumx/core/js/components/PopoverDialog').PopoverDialogProps, keyof import('@lumx/core/js/components/Popover').PopoverProps> & {
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
16
|
+
}, import('vue').PublicProps>;
|
|
17
|
+
tags: string[];
|
|
18
|
+
parameters: {
|
|
19
|
+
chromatic: {
|
|
20
|
+
disable: boolean;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
render: (args: any) => () => import("vue/jsx-runtime").JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
export default _default;
|
|
26
|
+
/** Test: popover dialog opens and focuses the first button */
|
|
27
|
+
export declare const TestOpenAndInitFocus: {
|
|
28
|
+
args: {
|
|
29
|
+
label: string;
|
|
30
|
+
};
|
|
31
|
+
play({ userEvent }: any): Promise<void>;
|
|
32
|
+
};
|
|
33
|
+
/** Test: popover dialog works with aria-label */
|
|
34
|
+
export declare const TestAriaLabel: {
|
|
35
|
+
args: {
|
|
36
|
+
'aria-label': string;
|
|
37
|
+
};
|
|
38
|
+
play({ userEvent }: any): Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
/** Test: focus is trapped within the popover dialog */
|
|
41
|
+
export declare const TestTrapFocus: {
|
|
42
|
+
args: {
|
|
43
|
+
label: string;
|
|
44
|
+
};
|
|
45
|
+
play({ userEvent }: any): Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
/** Test: escape closes the dialog and restores focus to trigger */
|
|
48
|
+
export declare const TestCloseOnEscape: {
|
|
49
|
+
args: {
|
|
50
|
+
label: string;
|
|
51
|
+
};
|
|
52
|
+
play({ userEvent }: any): Promise<void>;
|
|
53
|
+
};
|
|
54
|
+
/** Test: closing via the Close button restores focus to trigger */
|
|
55
|
+
export declare const TestCloseExternally: {
|
|
56
|
+
args: {
|
|
57
|
+
label: string;
|
|
58
|
+
};
|
|
59
|
+
play({ userEvent }: any): Promise<void>;
|
|
60
|
+
};
|
|
61
|
+
/** Test: escape closes dialog with icon button trigger and restores focus */
|
|
62
|
+
export declare const TestCloseEscapeWithTooltip: {
|
|
63
|
+
args: {
|
|
64
|
+
label: string;
|
|
65
|
+
};
|
|
66
|
+
play({ userEvent }: any): Promise<void>;
|
|
67
|
+
};
|
|
68
|
+
/** Test: heading level context is reset inside the popover dialog */
|
|
69
|
+
export declare const TestHeadingLevelReset: {
|
|
70
|
+
render({ children, ...args }: any): () => import("vue/jsx-runtime").JSX.Element;
|
|
71
|
+
args: {
|
|
72
|
+
children: import("vue/jsx-runtime").JSX.Element;
|
|
73
|
+
};
|
|
74
|
+
play({ userEvent }: any): Promise<void>;
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PopoverDialog, type PopoverDialogProps } from './PopoverDialog';
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
/**
|
|
3
|
-
* Restores focus to the anchor or parent element when the popover
|
|
4
|
-
* if focus was within the popover at the time
|
|
3
|
+
* Restores focus to the anchor or parent element when the popover closes,
|
|
4
|
+
* if focus was within the popover at the time it closed.
|
|
5
|
+
*
|
|
6
|
+
* Works both when `isOpen` toggles to false (before Vue re-renders)
|
|
7
|
+
* and when the component unmounts entirely.
|
|
5
8
|
*
|
|
6
9
|
* @param focusAnchorOnClose Whether to restore focus on close.
|
|
7
10
|
* @param anchorRef Reference to the anchor element.
|
|
8
11
|
* @param parentElementRef Reference to the parent element (optional override for focus target).
|
|
9
12
|
* @param popoverElementRef Reference to the popover element.
|
|
13
|
+
* @param isOpenRef Whether the popover is open (used to detect close before DOM update).
|
|
10
14
|
*/
|
|
11
|
-
export declare function useRestoreFocusOnClose(focusAnchorOnClose: Ref<boolean | undefined>, anchorRef: Ref<HTMLElement | undefined>, parentElementRef: Ref<HTMLElement | undefined> | undefined, popoverElementRef: Ref<HTMLElement | undefined>): void;
|
|
15
|
+
export declare function useRestoreFocusOnClose(focusAnchorOnClose: Ref<boolean | undefined>, anchorRef: Ref<HTMLElement | undefined>, parentElementRef: Ref<HTMLElement | undefined> | undefined, popoverElementRef: Ref<HTMLElement | undefined>, isOpenRef?: Ref<boolean>): void;
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './components/avatar';
|
|
|
4
4
|
export * from './components/badge';
|
|
5
5
|
export * from './components/button';
|
|
6
6
|
export * from './components/checkbox';
|
|
7
|
+
export * from './components/chip';
|
|
7
8
|
export * from './components/divider';
|
|
8
9
|
export * from './components/flag';
|
|
9
10
|
export * from './components/flex-box';
|
|
@@ -15,6 +16,7 @@ export * from './components/input-label';
|
|
|
15
16
|
export * from './components/link';
|
|
16
17
|
export * from './components/message';
|
|
17
18
|
export * from './components/popover';
|
|
19
|
+
export * from './components/popover-dialog';
|
|
18
20
|
export * from './components/progress';
|
|
19
21
|
export * from './components/radio-button';
|
|
20
22
|
export * from './components/skeleton';
|