@lumx/core 4.14.0-alpha.0 → 4.14.0-alpha.1
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/js/components/AlertDialog/Stories.d.ts +115 -0
- package/js/components/AlertDialog/index.d.ts +91 -0
- package/js/components/Avatar/Stories.d.ts +52 -0
- package/js/components/Avatar/index.d.ts +50 -0
- package/js/components/Badge/BadgeWrapper.d.ts +13 -0
- package/js/components/Badge/BadgeWrapperStories.d.ts +29 -0
- package/js/components/Badge/Stories.d.ts +46 -0
- package/js/components/Badge/index.d.ts +37 -0
- package/js/components/Button/ButtonGroup.d.ts +36 -0
- package/js/components/Button/ButtonGroupStories.d.ts +33 -0
- package/js/components/Button/IconButtonStories.d.ts +210 -0
- package/js/components/Button/Stories.d.ts +302 -0
- package/js/components/Checkbox/Stories.d.ts +89 -0
- package/js/components/Chip/ChipGroupStories.d.ts +17 -0
- package/js/components/Chip/SelectionChipGroupStories.d.ts +54 -0
- package/js/components/Chip/Stories.d.ts +127 -0
- package/js/components/Combobox/ComboboxOptionTests.d.ts +24 -0
- package/js/components/Combobox/Stories.d.ts +167 -0
- package/js/components/Combobox/TestStories.d.ts +143 -0
- package/js/components/Combobox/Tests.d.ts +168 -0
- package/js/components/Dialog/Stories.d.ts +97 -0
- package/js/components/Dialog/index.d.ts +99 -0
- package/js/components/Divider/Stories.d.ts +21 -0
- package/js/components/DragHandle/Stories.d.ts +18 -0
- package/js/components/ExpansionPanel/Stories.d.ts +67 -0
- package/js/components/Flag/Stories.d.ts +120 -0
- package/js/components/FlexBox/Stories.d.ts +116 -0
- package/js/components/FlexBox/constants.d.ts +3 -3
- package/js/components/GenericBlock/Stories.d.ts +74 -0
- package/js/components/GenericBlock/constants.d.ts +1 -1
- package/js/components/GenericBlock/index.d.ts +85 -0
- package/js/components/GridColumn/GridColumnStories.d.ts +45 -0
- package/js/components/GridColumn/index.d.ts +2 -0
- package/js/components/Heading/Stories.d.ts +90 -0
- package/js/components/Icon/Stories.d.ts +156 -0
- package/js/components/ImageBlock/Stories.d.ts +187 -0
- package/js/components/InlineList/Stories.d.ts +64 -0
- package/js/components/InlineList/index.d.ts +53 -0
- package/js/components/InputHelper/Stories.d.ts +35 -0
- package/js/components/InputLabel/Stories.d.ts +34 -0
- package/js/components/Lightbox/Stories.d.ts +40 -0
- package/js/components/Lightbox/index.d.ts +68 -0
- package/js/components/Link/Stories.d.ts +282 -0
- package/js/components/Link/index.d.ts +47 -0
- package/js/components/LinkPreview/Stories.d.ts +61 -0
- package/js/components/LinkPreview/index.d.ts +53 -0
- package/js/components/List/ListDivider.d.ts +33 -0
- package/js/components/List/ListDividerStories.d.ts +17 -0
- package/js/components/List/ListItemStories.d.ts +53 -0
- package/js/components/List/ListSection.d.ts +45 -0
- package/js/components/List/ListSectionStories.d.ts +125 -0
- package/js/components/List/ListStories.d.ts +34 -0
- package/js/components/Message/Stories.d.ts +119 -0
- package/js/components/Mosaic/Stories.d.ts +102 -0
- package/js/components/Mosaic/index.d.ts +40 -0
- package/js/components/Popover/Stories.d.ts +139 -0
- package/js/components/Popover/index.d.ts +119 -0
- package/js/components/PopoverDialog/Stories.d.ts +44 -0
- package/js/components/PopoverDialog/index.d.ts +22 -0
- package/js/components/RadioButton/Stories.d.ts +78 -0
- package/js/components/RadioGroup/index.d.ts +34 -0
- package/js/components/SelectButton/Stories.d.ts +135 -0
- package/js/components/SelectButton/TestStories.d.ts +37 -0
- package/js/components/SelectButton/Tests.d.ts +34 -0
- package/js/components/SelectButton/index.d.ts +85 -0
- package/js/components/SelectTextField/Stories.d.ts +192 -0
- package/js/components/SelectTextField/TestStories.d.ts +39 -0
- package/js/components/SelectTextField/Tests.d.ts +38 -0
- package/js/components/SelectTextField/index.d.ts +87 -0
- package/js/components/Skeleton/SkeletonCircleStories.d.ts +43 -0
- package/js/components/Skeleton/SkeletonRectangleStories.d.ts +83 -0
- package/js/components/Skeleton/SkeletonTypographyStories.d.ts +53 -0
- package/js/components/Switch/Stories.d.ts +94 -0
- package/js/components/Table/Stories.d.ts +30 -0
- package/js/components/Table/TableBody.d.ts +25 -0
- package/js/components/Table/TableCellStories.d.ts +47 -0
- package/js/components/Table/TableHeader.d.ts +29 -0
- package/js/components/Table/TableRow.d.ts +35 -0
- package/js/components/Table/TableRowStories.d.ts +23 -0
- package/js/components/Table/index.d.ts +27 -0
- package/js/components/Tabs/Tab.d.ts +70 -0
- package/js/components/Tabs/TabPanel.d.ts +43 -0
- package/js/components/Text/Stories.d.ts +164 -0
- package/js/components/TextField/RawInputText.d.ts +22 -0
- package/js/components/TextField/RawInputTextStories.d.ts +16 -0
- package/js/components/TextField/RawInputTextareaStories.d.ts +21 -0
- package/js/components/TextField/Stories.d.ts +101 -0
- package/js/components/TextField/TextField.d.ts +84 -0
- package/js/components/Thumbnail/Stories.d.ts +178 -0
- package/js/components/Toolbar/Stories.d.ts +29 -0
- package/js/components/Toolbar/index.d.ts +33 -0
- package/js/components/Tooltip/Stories.d.ts +61 -0
- package/js/components/Tooltip/TestStories.d.ts +72 -0
- package/js/components/Tooltip/index.d.ts +65 -0
- package/js/components/Uploader/Stories.d.ts +116 -0
- package/js/components/Uploader/index.d.ts +79 -0
- package/js/components/UserBlock/Stories.d.ts +153 -0
- package/js/components/UserBlock/index.d.ts +145 -0
- package/js/utils/ClickAway/TestStories.d.ts +36 -0
- package/js/utils/InfiniteScroll/TestStories.d.ts +50 -0
- package/js/utils/InfiniteScroll/index.d.ts +21 -0
- package/js/utils/Portal/Stories.d.ts +29 -0
- package/js/utils/action-area/Stories.d.ts +38 -0
- package/js/utils/select/renderSelectOptions.d.ts +7 -0
- package/package.json +2 -2
- package/stories/utils/CombinationsTable.d.ts +26 -0
- package/stories/utils/ThemingVariablesTable.d.ts +29 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
export declare function setup({ component: Chip, components: { Icon }, decorators: { withCombinations, withThemedBackground, withTheming }, }: SetupStoriesOptions<{
|
|
3
|
+
decorators: 'withCombinations' | 'withThemedBackground' | 'withTheming';
|
|
4
|
+
components: {
|
|
5
|
+
Icon: any;
|
|
6
|
+
};
|
|
7
|
+
}>): {
|
|
8
|
+
meta: {
|
|
9
|
+
component: any;
|
|
10
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
11
|
+
args: import("lodash").Omit<Partial<import(".").ChipProps>, "theme">;
|
|
12
|
+
argTypes: {
|
|
13
|
+
size: {
|
|
14
|
+
control: {
|
|
15
|
+
type: "select" | "inline-radio";
|
|
16
|
+
};
|
|
17
|
+
options: ("s" | "m")[];
|
|
18
|
+
mapping: Record<string, "s" | "m"> | undefined;
|
|
19
|
+
};
|
|
20
|
+
before: {
|
|
21
|
+
control: boolean;
|
|
22
|
+
};
|
|
23
|
+
after: {
|
|
24
|
+
control: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
Default: {
|
|
29
|
+
args: {
|
|
30
|
+
children: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
ChipButton: {
|
|
34
|
+
args: {
|
|
35
|
+
children: string;
|
|
36
|
+
};
|
|
37
|
+
argTypes: {
|
|
38
|
+
onClick: {
|
|
39
|
+
action: boolean;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
ChipLink: {
|
|
44
|
+
args: {
|
|
45
|
+
children: string;
|
|
46
|
+
href: string;
|
|
47
|
+
target: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
WithAfterAndBefore: {
|
|
51
|
+
argTypes: {
|
|
52
|
+
onBeforeClick: {
|
|
53
|
+
action: boolean;
|
|
54
|
+
};
|
|
55
|
+
onClick: {
|
|
56
|
+
action: boolean;
|
|
57
|
+
};
|
|
58
|
+
onAfterClick: {
|
|
59
|
+
action: boolean;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
63
|
+
args: {
|
|
64
|
+
children: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
ColorVariants: {
|
|
68
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
69
|
+
argTypes: {
|
|
70
|
+
onBeforeClick: {
|
|
71
|
+
action: boolean;
|
|
72
|
+
};
|
|
73
|
+
onClick: {
|
|
74
|
+
action: boolean;
|
|
75
|
+
};
|
|
76
|
+
onAfterClick: {
|
|
77
|
+
action: boolean;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
args: {
|
|
81
|
+
children: string;
|
|
82
|
+
};
|
|
83
|
+
decorators: ((story: any, context: any) => any)[];
|
|
84
|
+
};
|
|
85
|
+
SelectedVariants: {
|
|
86
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
87
|
+
argTypes: {
|
|
88
|
+
onBeforeClick: {
|
|
89
|
+
action: boolean;
|
|
90
|
+
};
|
|
91
|
+
onClick: {
|
|
92
|
+
action: boolean;
|
|
93
|
+
};
|
|
94
|
+
onAfterClick: {
|
|
95
|
+
action: boolean;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
args: {
|
|
99
|
+
children: string;
|
|
100
|
+
};
|
|
101
|
+
decorators: ((story: any, context: any) => any)[];
|
|
102
|
+
};
|
|
103
|
+
Disabled: {
|
|
104
|
+
args: {
|
|
105
|
+
children: string;
|
|
106
|
+
};
|
|
107
|
+
decorators: ((story: any, context: any) => any)[];
|
|
108
|
+
};
|
|
109
|
+
Theming: {
|
|
110
|
+
decorators: ((story: any, context: any) => any)[];
|
|
111
|
+
render: ({ children, ...args }: any) => import("react").JSX.Element;
|
|
112
|
+
argTypes: {
|
|
113
|
+
onBeforeClick: {
|
|
114
|
+
action: boolean;
|
|
115
|
+
};
|
|
116
|
+
onClick: {
|
|
117
|
+
action: boolean;
|
|
118
|
+
};
|
|
119
|
+
onAfterClick: {
|
|
120
|
+
action: boolean;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
args: {
|
|
124
|
+
children: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComboboxNamespace } from './Tests';
|
|
2
|
+
type RenderResult = {
|
|
3
|
+
unmount: () => void;
|
|
4
|
+
container: HTMLElement;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Options to set up the ComboboxOption test suite.
|
|
8
|
+
* Injected by the framework-specific test file (React or Vue).
|
|
9
|
+
*/
|
|
10
|
+
export interface ComboboxOptionTestSetup {
|
|
11
|
+
/** Combobox compound component namespace */
|
|
12
|
+
Combobox: Pick<ComboboxNamespace, 'Provider' | 'List' | 'Option'>;
|
|
13
|
+
/**
|
|
14
|
+
* Render a JSX template and return a result with a container.
|
|
15
|
+
* The template is a zero-argument function returning a JSX element.
|
|
16
|
+
*/
|
|
17
|
+
render: (template: () => any) => RenderResult;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Shared Combobox.Option test suite — covers DOM shape and ARIA correctness.
|
|
21
|
+
* Runs the same assertions against both React and Vue wrappers.
|
|
22
|
+
*/
|
|
23
|
+
export default function comboboxOptionTests({ Combobox, render }: ComboboxOptionTestSetup): void;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
import type { ComboboxNamespace } from './Tests';
|
|
3
|
+
/**
|
|
4
|
+
* Setup Combobox demo stories for a specific framework (React or Vue).
|
|
5
|
+
* Framework-specific components and hooks are injected via options.
|
|
6
|
+
*/
|
|
7
|
+
export declare function setup({ components: { Combobox, IconButton, Avatar, SkeletonCircle }, decorators: { withValueOnChange }, }: SetupStoriesOptions<{
|
|
8
|
+
components: {
|
|
9
|
+
Combobox: ComboboxNamespace;
|
|
10
|
+
IconButton: any;
|
|
11
|
+
Avatar: any;
|
|
12
|
+
SkeletonCircle: any;
|
|
13
|
+
};
|
|
14
|
+
decorators: 'withValueOnChange';
|
|
15
|
+
}>): {
|
|
16
|
+
meta: {
|
|
17
|
+
component: any;
|
|
18
|
+
play(): Promise<void>;
|
|
19
|
+
};
|
|
20
|
+
ComboboxWithSubcomponents: {
|
|
21
|
+
args: {
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
|
+
decorators: ((story: any, context: any) => any)[];
|
|
25
|
+
render: ({ value, onChange }: {
|
|
26
|
+
value: string;
|
|
27
|
+
onChange: (v: string) => void;
|
|
28
|
+
}) => import("react").JSX.Element;
|
|
29
|
+
};
|
|
30
|
+
ComboboxWithSection: {
|
|
31
|
+
args: {
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
34
|
+
decorators: ((story: any, context: any) => any)[];
|
|
35
|
+
render: ({ value, onChange }: {
|
|
36
|
+
value: string;
|
|
37
|
+
onChange: (v: string) => void;
|
|
38
|
+
}) => import("react").JSX.Element;
|
|
39
|
+
};
|
|
40
|
+
ComboboxWithFilteredSections: {
|
|
41
|
+
args: {
|
|
42
|
+
value: string;
|
|
43
|
+
};
|
|
44
|
+
decorators: ((story: any, context: any) => any)[];
|
|
45
|
+
render: ({ value, onChange }: {
|
|
46
|
+
value: string;
|
|
47
|
+
onChange: (v: string) => void;
|
|
48
|
+
}) => import("react").JSX.Element;
|
|
49
|
+
};
|
|
50
|
+
ComboboxWithButton: {
|
|
51
|
+
args: {
|
|
52
|
+
value: string;
|
|
53
|
+
};
|
|
54
|
+
decorators: ((story: any, context: any) => any)[];
|
|
55
|
+
render: ({ value, onSelect }: {
|
|
56
|
+
value: string;
|
|
57
|
+
onSelect: (option: {
|
|
58
|
+
value: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
}) => import("react").JSX.Element;
|
|
61
|
+
};
|
|
62
|
+
ComboboxWithLinkOptions: {
|
|
63
|
+
args: {
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
decorators: ((story: any, context: any) => any)[];
|
|
67
|
+
render: ({ value, onChange }: {
|
|
68
|
+
value: string;
|
|
69
|
+
onChange: (v: string) => void;
|
|
70
|
+
}) => import("react").JSX.Element;
|
|
71
|
+
};
|
|
72
|
+
ComboboxWithOptionMoreInfo: {
|
|
73
|
+
args: {
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
decorators: ((story: any, context: any) => any)[];
|
|
77
|
+
render: ({ value, onChange }: {
|
|
78
|
+
value: string;
|
|
79
|
+
onChange: (v: string) => void;
|
|
80
|
+
}) => import("react").JSX.Element;
|
|
81
|
+
};
|
|
82
|
+
GridComboboxWithInput: {
|
|
83
|
+
args: {
|
|
84
|
+
value: string;
|
|
85
|
+
};
|
|
86
|
+
argTypes: {
|
|
87
|
+
onEdit: {
|
|
88
|
+
action: string;
|
|
89
|
+
};
|
|
90
|
+
onDelete: {
|
|
91
|
+
action: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
decorators: ((story: any, context: any) => any)[];
|
|
95
|
+
render: ({ value, onChange, onEdit, onDelete, }: {
|
|
96
|
+
value: string;
|
|
97
|
+
onChange: (v: string) => void;
|
|
98
|
+
onEdit: (fruit: string) => void;
|
|
99
|
+
onDelete: (fruit: string) => void;
|
|
100
|
+
}) => import("react").JSX.Element;
|
|
101
|
+
};
|
|
102
|
+
GridComboboxWithButton: {
|
|
103
|
+
args: {
|
|
104
|
+
value: string;
|
|
105
|
+
};
|
|
106
|
+
argTypes: {
|
|
107
|
+
onDelete: {
|
|
108
|
+
action: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
decorators: ((story: any, context: any) => any)[];
|
|
112
|
+
render: ({ value, onSelect, onDelete, }: {
|
|
113
|
+
value: string;
|
|
114
|
+
onSelect: (option: {
|
|
115
|
+
value: string;
|
|
116
|
+
}) => void;
|
|
117
|
+
onDelete: (fruit: string) => void;
|
|
118
|
+
}) => import("react").JSX.Element;
|
|
119
|
+
};
|
|
120
|
+
ComboboxWithEmptyState: {
|
|
121
|
+
args: {
|
|
122
|
+
value: string;
|
|
123
|
+
};
|
|
124
|
+
decorators: ((story: any, context: any) => any)[];
|
|
125
|
+
play({ canvas }: any): Promise<void>;
|
|
126
|
+
render: ({ value, onChange }: {
|
|
127
|
+
value: string;
|
|
128
|
+
onChange: (v: string) => void;
|
|
129
|
+
}) => import("react").JSX.Element;
|
|
130
|
+
};
|
|
131
|
+
ComboboxWithErrorState: {
|
|
132
|
+
render: () => import("react").JSX.Element;
|
|
133
|
+
};
|
|
134
|
+
ComboboxWithLoading: {
|
|
135
|
+
render: () => import("react").JSX.Element;
|
|
136
|
+
};
|
|
137
|
+
ComboboxWithLoadMore: {
|
|
138
|
+
args: {
|
|
139
|
+
value: string;
|
|
140
|
+
};
|
|
141
|
+
decorators: ((story: any, context: any) => any)[];
|
|
142
|
+
render: ({ value, onChange }: {
|
|
143
|
+
value: string;
|
|
144
|
+
onChange: (v: string) => void;
|
|
145
|
+
}) => import("react").JSX.Element;
|
|
146
|
+
};
|
|
147
|
+
ComboboxWithSectionLoading: {
|
|
148
|
+
args: {
|
|
149
|
+
value: string;
|
|
150
|
+
};
|
|
151
|
+
decorators: ((story: any, context: any) => any)[];
|
|
152
|
+
render: ({ value, onChange }: {
|
|
153
|
+
value: string;
|
|
154
|
+
onChange: (v: string) => void;
|
|
155
|
+
}) => import("react").JSX.Element;
|
|
156
|
+
};
|
|
157
|
+
ComboboxWithAvatarLoading: {
|
|
158
|
+
args: {
|
|
159
|
+
value: string;
|
|
160
|
+
};
|
|
161
|
+
decorators: ((story: any, context: any) => any)[];
|
|
162
|
+
render: ({ value, onChange }: {
|
|
163
|
+
value: string;
|
|
164
|
+
onChange: (v: string) => void;
|
|
165
|
+
}) => import("react").JSX.Element;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
import { type ComboboxNamespace } from './Tests';
|
|
3
|
+
export declare function setup({ components: { Combobox, IconButton, Button }, decorators: { withValueOnChange }, }: SetupStoriesOptions<{
|
|
4
|
+
components: {
|
|
5
|
+
Combobox: ComboboxNamespace;
|
|
6
|
+
IconButton: any;
|
|
7
|
+
Button: any;
|
|
8
|
+
};
|
|
9
|
+
decorators: 'withValueOnChange';
|
|
10
|
+
}>): {
|
|
11
|
+
meta: {
|
|
12
|
+
component: any;
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {
|
|
15
|
+
chromatic: {
|
|
16
|
+
disable: boolean;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
AutoFilterOptions: {
|
|
21
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
22
|
+
args: {
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
25
|
+
decorators: ((story: any, context: any) => any)[];
|
|
26
|
+
render: ({ value, onChange, onSelect, }: {
|
|
27
|
+
value: string;
|
|
28
|
+
onChange: (v: string) => void;
|
|
29
|
+
onSelect?: (option: {
|
|
30
|
+
value: string;
|
|
31
|
+
}) => void;
|
|
32
|
+
}) => import("react").JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
FilterOffOpenOnFocus: {
|
|
35
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
36
|
+
args: {
|
|
37
|
+
value: string;
|
|
38
|
+
};
|
|
39
|
+
decorators: ((story: any, context: any) => any)[];
|
|
40
|
+
render: ({ value, onChange, onSelect }: any) => import("react").JSX.Element;
|
|
41
|
+
};
|
|
42
|
+
SelectOptionUpdatesInput: {
|
|
43
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
44
|
+
args: {
|
|
45
|
+
value: string;
|
|
46
|
+
};
|
|
47
|
+
decorators: ((story: any, context: any) => any)[];
|
|
48
|
+
render: ({ value, onChange, onSelect, }: {
|
|
49
|
+
value: string;
|
|
50
|
+
onChange: (v: string) => void;
|
|
51
|
+
onSelect?: (option: {
|
|
52
|
+
value: string;
|
|
53
|
+
}) => void;
|
|
54
|
+
}) => import("react").JSX.Element;
|
|
55
|
+
};
|
|
56
|
+
MouseHoverDoesNotActivateOption: {
|
|
57
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
58
|
+
args: {
|
|
59
|
+
value: string;
|
|
60
|
+
};
|
|
61
|
+
decorators: ((story: any, context: any) => any)[];
|
|
62
|
+
render: ({ value, onChange, onSelect, }: {
|
|
63
|
+
value: string;
|
|
64
|
+
onChange: (v: string) => void;
|
|
65
|
+
onSelect?: (option: {
|
|
66
|
+
value: string;
|
|
67
|
+
}) => void;
|
|
68
|
+
}) => import("react").JSX.Element;
|
|
69
|
+
};
|
|
70
|
+
ClickAwayClosesPopup: {
|
|
71
|
+
render: (args: any) => import("react").JSX.Element;
|
|
72
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
73
|
+
args: {
|
|
74
|
+
value: string;
|
|
75
|
+
};
|
|
76
|
+
decorators: ((story: any, context: any) => any)[];
|
|
77
|
+
};
|
|
78
|
+
MouseHoverThenKeyboardNav: {
|
|
79
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
80
|
+
args: {
|
|
81
|
+
value: string;
|
|
82
|
+
};
|
|
83
|
+
decorators: ((story: any, context: any) => any)[];
|
|
84
|
+
render: ({ value, onChange, onSelect, }: {
|
|
85
|
+
value: string;
|
|
86
|
+
onChange: (v: string) => void;
|
|
87
|
+
onSelect?: (option: {
|
|
88
|
+
value: string;
|
|
89
|
+
}) => void;
|
|
90
|
+
}) => import("react").JSX.Element;
|
|
91
|
+
};
|
|
92
|
+
OptionMoreInfoKeyboardHighlight: {
|
|
93
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
94
|
+
args: {
|
|
95
|
+
value: string;
|
|
96
|
+
};
|
|
97
|
+
argTypes: {
|
|
98
|
+
onToggle: {
|
|
99
|
+
action: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
decorators: ((story: any, context: any) => any)[];
|
|
103
|
+
render: ({ value, onChange, onToggle, }: {
|
|
104
|
+
value: string;
|
|
105
|
+
onChange: (v: string) => void;
|
|
106
|
+
onToggle?: (isOpen: boolean) => void;
|
|
107
|
+
}) => import("react").JSX.Element;
|
|
108
|
+
};
|
|
109
|
+
OptionMoreInfoMouseHover: {
|
|
110
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
111
|
+
args: {
|
|
112
|
+
value: string;
|
|
113
|
+
};
|
|
114
|
+
argTypes: {
|
|
115
|
+
onToggle: {
|
|
116
|
+
action: string;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
decorators: ((story: any, context: any) => any)[];
|
|
120
|
+
render: ({ value, onChange, onToggle, }: {
|
|
121
|
+
value: string;
|
|
122
|
+
onChange: (v: string) => void;
|
|
123
|
+
onToggle?: (isOpen: boolean) => void;
|
|
124
|
+
}) => import("react").JSX.Element;
|
|
125
|
+
};
|
|
126
|
+
OptionMoreInfoAriaDescribedBy: {
|
|
127
|
+
play: ({ canvasElement }: any) => Promise<void>;
|
|
128
|
+
args: {
|
|
129
|
+
value: string;
|
|
130
|
+
};
|
|
131
|
+
argTypes: {
|
|
132
|
+
onToggle: {
|
|
133
|
+
action: string;
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
decorators: ((story: any, context: any) => any)[];
|
|
137
|
+
render: ({ value, onChange, onToggle, }: {
|
|
138
|
+
value: string;
|
|
139
|
+
onChange: (v: string) => void;
|
|
140
|
+
onToggle?: (isOpen: boolean) => void;
|
|
141
|
+
}) => import("react").JSX.Element;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/** Combobox compound component namespace type. */
|
|
2
|
+
export interface ComboboxNamespace {
|
|
3
|
+
Provider: any;
|
|
4
|
+
Input: any;
|
|
5
|
+
Button: any;
|
|
6
|
+
List: any;
|
|
7
|
+
Option: any;
|
|
8
|
+
OptionAction: any;
|
|
9
|
+
OptionMoreInfo: any;
|
|
10
|
+
OptionSkeleton: any;
|
|
11
|
+
Popover: any;
|
|
12
|
+
Section: any;
|
|
13
|
+
State: any;
|
|
14
|
+
}
|
|
15
|
+
type RenderResult = {
|
|
16
|
+
unmount: () => void;
|
|
17
|
+
container: HTMLElement;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Options to set up the combobox test suite.
|
|
21
|
+
* Injected by the framework-specific test file (React or Vue).
|
|
22
|
+
*/
|
|
23
|
+
export interface ComboboxTestSetup {
|
|
24
|
+
components: {
|
|
25
|
+
Combobox: ComboboxNamespace;
|
|
26
|
+
IconButton: any;
|
|
27
|
+
Button: any;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Render a template with controlled state management.
|
|
31
|
+
* Mirrors the withValueOnChange Storybook decorator.
|
|
32
|
+
*
|
|
33
|
+
* @param template JSX render function receiving `{ value, onChange/onSelect, ... }`.
|
|
34
|
+
* @param initialArgs Initial props (value, spies, etc.).
|
|
35
|
+
* @param options State wiring config (which prop manages state, how to extract value).
|
|
36
|
+
*/
|
|
37
|
+
renderWithState: (template: (props: any) => any, initialArgs?: Record<string, any>, options?: {
|
|
38
|
+
onChangeProp?: string;
|
|
39
|
+
valueExtract?: (v: any) => any;
|
|
40
|
+
}) => RenderResult;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Create framework-agnostic JSX templates for combobox test fixtures.
|
|
44
|
+
* Exported so TestStories.tsx can reuse the same templates for browser-only tests.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createTemplates(Combobox: ComboboxNamespace, IconButton: any): {
|
|
47
|
+
inputTemplate: ({ value, onChange, onSelect, }: {
|
|
48
|
+
value: string;
|
|
49
|
+
onChange: (v: string) => void;
|
|
50
|
+
onSelect?: (option: {
|
|
51
|
+
value: string;
|
|
52
|
+
}) => void;
|
|
53
|
+
}) => import("react").JSX.Element;
|
|
54
|
+
manualFilterTemplate: ({ value, onChange, onSelect, }: {
|
|
55
|
+
value: string;
|
|
56
|
+
onChange: (v: string) => void;
|
|
57
|
+
onSelect?: (option: {
|
|
58
|
+
value: string;
|
|
59
|
+
}) => void;
|
|
60
|
+
}) => import("react").JSX.Element;
|
|
61
|
+
filterOffTemplate: ({ value, onChange, onSelect, }: {
|
|
62
|
+
value: string;
|
|
63
|
+
onChange: (v: string) => void;
|
|
64
|
+
onSelect?: (option: {
|
|
65
|
+
value: string;
|
|
66
|
+
}) => void;
|
|
67
|
+
}) => import("react").JSX.Element;
|
|
68
|
+
openOnFocusTemplate: ({ value, onChange, onSelect, }: {
|
|
69
|
+
value: string;
|
|
70
|
+
onChange: (v: string) => void;
|
|
71
|
+
onSelect?: (option: {
|
|
72
|
+
value: string;
|
|
73
|
+
}) => void;
|
|
74
|
+
}) => import("react").JSX.Element;
|
|
75
|
+
noOpenOnFocusTemplate: ({ value, onChange, onSelect, }: {
|
|
76
|
+
value: string;
|
|
77
|
+
onChange: (v: string) => void;
|
|
78
|
+
onSelect?: (option: {
|
|
79
|
+
value: string;
|
|
80
|
+
}) => void;
|
|
81
|
+
}) => import("react").JSX.Element;
|
|
82
|
+
buttonTemplate: ({ value, onSelect }: {
|
|
83
|
+
value: string;
|
|
84
|
+
onSelect: (option: {
|
|
85
|
+
value: string;
|
|
86
|
+
}) => void;
|
|
87
|
+
}) => import("react").JSX.Element;
|
|
88
|
+
showLabelButtonTemplate: ({ value, onSelect, }: {
|
|
89
|
+
value: string;
|
|
90
|
+
onSelect: (option: {
|
|
91
|
+
value: string;
|
|
92
|
+
}) => void;
|
|
93
|
+
}) => import("react").JSX.Element;
|
|
94
|
+
showTooltipButtonTemplate: ({ value, onSelect, }: {
|
|
95
|
+
value: string;
|
|
96
|
+
onSelect: (option: {
|
|
97
|
+
value: string;
|
|
98
|
+
}) => void;
|
|
99
|
+
}) => import("react").JSX.Element;
|
|
100
|
+
noValueButtonTemplate: ({ value, onSelect, }: {
|
|
101
|
+
value: string;
|
|
102
|
+
onSelect: (option: {
|
|
103
|
+
value: string;
|
|
104
|
+
}) => void;
|
|
105
|
+
}) => import("react").JSX.Element;
|
|
106
|
+
selectedButtonTemplate: ({ value, onSelect, }: {
|
|
107
|
+
value: string;
|
|
108
|
+
onSelect: (option: {
|
|
109
|
+
value: string;
|
|
110
|
+
}) => void;
|
|
111
|
+
}) => import("react").JSX.Element;
|
|
112
|
+
disabledInputTemplate: ({ value, onChange }: {
|
|
113
|
+
value: string;
|
|
114
|
+
onChange: (v: string) => void;
|
|
115
|
+
}) => import("react").JSX.Element;
|
|
116
|
+
disabledButtonTemplate: ({ value, onSelect, }: {
|
|
117
|
+
value: string;
|
|
118
|
+
onSelect: (option: {
|
|
119
|
+
value: string;
|
|
120
|
+
}) => void;
|
|
121
|
+
}) => import("react").JSX.Element;
|
|
122
|
+
gridInputTemplate: ({ value, onChange, onSelect, onDelete, onEdit, }: {
|
|
123
|
+
value: string;
|
|
124
|
+
onChange: (v: string) => void;
|
|
125
|
+
onSelect?: (option: {
|
|
126
|
+
value: string;
|
|
127
|
+
}) => void;
|
|
128
|
+
onDelete?: (...args: unknown[]) => void;
|
|
129
|
+
onEdit?: (...args: unknown[]) => void;
|
|
130
|
+
}) => import("react").JSX.Element;
|
|
131
|
+
gridButtonTemplate: ({ value, onSelect, onDelete, }: {
|
|
132
|
+
value: string;
|
|
133
|
+
onSelect: (option: {
|
|
134
|
+
value: string;
|
|
135
|
+
}) => void;
|
|
136
|
+
onDelete?: (...args: unknown[]) => void;
|
|
137
|
+
}) => import("react").JSX.Element;
|
|
138
|
+
emptyStateTemplate: ({ value, onChange }: {
|
|
139
|
+
value: string;
|
|
140
|
+
onChange: (v: string) => void;
|
|
141
|
+
}) => import("react").JSX.Element;
|
|
142
|
+
nbOptionMessageTemplate: ({ value, onChange }: {
|
|
143
|
+
value: string;
|
|
144
|
+
onChange: (v: string) => void;
|
|
145
|
+
}) => import("react").JSX.Element;
|
|
146
|
+
errorStateTemplate: ({ value, onChange }: {
|
|
147
|
+
value: string;
|
|
148
|
+
onChange: (v: string) => void;
|
|
149
|
+
}) => import("react").JSX.Element;
|
|
150
|
+
loadingTemplate: ({ value, onChange }: {
|
|
151
|
+
value: string;
|
|
152
|
+
onChange: (v: string) => void;
|
|
153
|
+
}) => import("react").JSX.Element;
|
|
154
|
+
loadMoreTemplate: ({ value, onChange }: {
|
|
155
|
+
value: string;
|
|
156
|
+
onChange: (v: string) => void;
|
|
157
|
+
}) => import("react").JSX.Element;
|
|
158
|
+
sectionLoadingTemplate: ({ value, onChange }: {
|
|
159
|
+
value: string;
|
|
160
|
+
onChange: (v: string) => void;
|
|
161
|
+
}) => import("react").JSX.Element;
|
|
162
|
+
descriptionTemplate: ({ value, onChange }: {
|
|
163
|
+
value: string;
|
|
164
|
+
onChange: (v: string) => void;
|
|
165
|
+
}) => import("react").JSX.Element;
|
|
166
|
+
};
|
|
167
|
+
export default function comboboxTests({ components: { Combobox, IconButton }, renderWithState }: ComboboxTestSetup): void;
|
|
168
|
+
export {};
|