@lumx/core 4.14.0-next.0 → 4.14.0-next.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,79 @@
|
|
|
1
|
+
import { AspectRatio, Size } from '../../constants';
|
|
2
|
+
import type { HasClassName, HasDisabled, LumxClassName, HasTheme, ValueOf, HasAriaDisabled, CommonRef } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Uploader variants.
|
|
5
|
+
*/
|
|
6
|
+
export declare const UploaderVariant: {
|
|
7
|
+
readonly square: "square";
|
|
8
|
+
readonly rounded: "rounded";
|
|
9
|
+
readonly circle: "circle";
|
|
10
|
+
};
|
|
11
|
+
export type UploaderVariant = ValueOf<typeof UploaderVariant>;
|
|
12
|
+
/**
|
|
13
|
+
* Uploader sizes.
|
|
14
|
+
*/
|
|
15
|
+
export type UploaderSize = Extract<Size, 'xl' | 'xxl'>;
|
|
16
|
+
/**
|
|
17
|
+
* Native input file props (framework-agnostic subset).
|
|
18
|
+
*/
|
|
19
|
+
type FileInputProps = Record<string, any>;
|
|
20
|
+
/**
|
|
21
|
+
* Defines the props of the component.
|
|
22
|
+
*/
|
|
23
|
+
export interface UploaderProps extends HasClassName, HasDisabled, HasTheme, HasAriaDisabled {
|
|
24
|
+
/** Image aspect ratio. */
|
|
25
|
+
aspectRatio?: AspectRatio;
|
|
26
|
+
/** Icon (SVG path). */
|
|
27
|
+
icon?: string;
|
|
28
|
+
/** Label text. */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Size variant. */
|
|
31
|
+
size?: UploaderSize;
|
|
32
|
+
/** Variant. */
|
|
33
|
+
variant?: UploaderVariant;
|
|
34
|
+
/** On click callback. */
|
|
35
|
+
handleClick?: (event: any) => void;
|
|
36
|
+
/** Handle file selection with a native input file. */
|
|
37
|
+
fileInputProps?: FileInputProps;
|
|
38
|
+
/** Forwarded ref to the root element. */
|
|
39
|
+
ref?: CommonRef;
|
|
40
|
+
/** Whether the component is disabled (computed from `isDisabled` and `aria-disabled`). */
|
|
41
|
+
isAnyDisabled?: boolean;
|
|
42
|
+
/** Id of the hidden file input (used to link the label `for` attribute). */
|
|
43
|
+
inputId: string;
|
|
44
|
+
/** Whether a file is currently being dragged over the input. */
|
|
45
|
+
isDragHovering?: boolean;
|
|
46
|
+
/** Callback fired when the file input value changes. */
|
|
47
|
+
handleChange?: (event: any) => void;
|
|
48
|
+
/** Root element tag or component (e.g. `'button'` or `'label'`). */
|
|
49
|
+
Component: 'button' | 'label';
|
|
50
|
+
}
|
|
51
|
+
export type UploaderPropsToOverride = 'isAnyDisabled' | 'inputId' | 'isDragHovering' | 'fileInputProps' | 'Component';
|
|
52
|
+
/**
|
|
53
|
+
* Component display name.
|
|
54
|
+
*/
|
|
55
|
+
export declare const COMPONENT_NAME = "Uploader";
|
|
56
|
+
/**
|
|
57
|
+
* Component default class name and class prefix.
|
|
58
|
+
*/
|
|
59
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
60
|
+
export declare const block: {
|
|
61
|
+
(additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
62
|
+
(modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
63
|
+
}, element: {
|
|
64
|
+
(elem: string, additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
65
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Component default props.
|
|
69
|
+
*/
|
|
70
|
+
export declare const DEFAULT_PROPS: Partial<UploaderProps>;
|
|
71
|
+
/**
|
|
72
|
+
* Uploader component.
|
|
73
|
+
*
|
|
74
|
+
* @param props Component props.
|
|
75
|
+
* @param ref Component ref.
|
|
76
|
+
* @return React element.
|
|
77
|
+
*/
|
|
78
|
+
export declare const Uploader: (props: UploaderProps) => import("react").JSX.Element;
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup UserBlock stories for a specific framework (React or Vue).
|
|
4
|
+
* Framework-specific components are injected via `components`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setup({ component: UserBlock, components: { Text, Icon, IconButton, Badge, Link }, decorators: { withCombinations }, render, }: SetupStoriesOptions<{
|
|
7
|
+
decorators: 'withCombinations';
|
|
8
|
+
components: {
|
|
9
|
+
Text: any;
|
|
10
|
+
Icon: any;
|
|
11
|
+
IconButton: any;
|
|
12
|
+
Badge: any;
|
|
13
|
+
Link: any;
|
|
14
|
+
};
|
|
15
|
+
}>): {
|
|
16
|
+
meta: {
|
|
17
|
+
component: any;
|
|
18
|
+
render: any;
|
|
19
|
+
argTypes: {
|
|
20
|
+
size: {
|
|
21
|
+
control: {
|
|
22
|
+
type: "select" | "inline-radio";
|
|
23
|
+
};
|
|
24
|
+
options: ("s" | "xs" | "m" | "l")[];
|
|
25
|
+
mapping: Record<string, "s" | "xs" | "m" | "l"> | undefined;
|
|
26
|
+
};
|
|
27
|
+
orientation: {
|
|
28
|
+
control: {
|
|
29
|
+
type: "select" | "inline-radio";
|
|
30
|
+
};
|
|
31
|
+
options: ("vertical" | "horizontal")[];
|
|
32
|
+
mapping: Record<string, "vertical" | "horizontal"> | undefined;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
args: Partial<import(".").UserBlockProps>;
|
|
36
|
+
};
|
|
37
|
+
AvatarOnly: {
|
|
38
|
+
args: {
|
|
39
|
+
avatarProps: {
|
|
40
|
+
image: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
AvatarAndName: {
|
|
45
|
+
args: {
|
|
46
|
+
name: string;
|
|
47
|
+
avatarProps: {
|
|
48
|
+
image: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
AvatarAndCustomName: {
|
|
53
|
+
args: {
|
|
54
|
+
avatarProps: {
|
|
55
|
+
image: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
render: (args: any) => import("react").JSX.Element;
|
|
59
|
+
};
|
|
60
|
+
AvatarAndNameAndSecondaryFields: {
|
|
61
|
+
args: {
|
|
62
|
+
fields: string[];
|
|
63
|
+
name: string;
|
|
64
|
+
avatarProps: {
|
|
65
|
+
image: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
WithAfter: {
|
|
70
|
+
args: {
|
|
71
|
+
fields: string[];
|
|
72
|
+
name: string;
|
|
73
|
+
avatarProps: {
|
|
74
|
+
image: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
render: (args: any) => import("react").JSX.Element;
|
|
78
|
+
};
|
|
79
|
+
WithAdditionalFields: {
|
|
80
|
+
args: {
|
|
81
|
+
name: string;
|
|
82
|
+
avatarProps: {
|
|
83
|
+
image: string;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
render: (args: any) => import("react").JSX.Element;
|
|
87
|
+
parameters: {
|
|
88
|
+
wrapperProps: {
|
|
89
|
+
style: {
|
|
90
|
+
width: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
SizesAndOrientations: {
|
|
96
|
+
args: {
|
|
97
|
+
fields: string[];
|
|
98
|
+
name: string;
|
|
99
|
+
avatarProps: {
|
|
100
|
+
image: string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
decorators: ((story: any, context: any) => any)[];
|
|
104
|
+
};
|
|
105
|
+
WithConstrainedSize: {
|
|
106
|
+
args: {
|
|
107
|
+
fields: string[];
|
|
108
|
+
name: string;
|
|
109
|
+
avatarProps: {
|
|
110
|
+
image: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
parameters: {
|
|
114
|
+
wrapperProps: {
|
|
115
|
+
style: {
|
|
116
|
+
width: string;
|
|
117
|
+
resize: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
AsButton: {
|
|
123
|
+
args: {
|
|
124
|
+
fields: string[];
|
|
125
|
+
name: string;
|
|
126
|
+
avatarProps: {
|
|
127
|
+
image: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
AsLink: {
|
|
132
|
+
args: {
|
|
133
|
+
linkProps: {
|
|
134
|
+
href: string;
|
|
135
|
+
};
|
|
136
|
+
fields: string[];
|
|
137
|
+
name: string;
|
|
138
|
+
avatarProps: {
|
|
139
|
+
image: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
WithBadge: {
|
|
144
|
+
args: {
|
|
145
|
+
fields: string[];
|
|
146
|
+
name: string;
|
|
147
|
+
avatarProps: {
|
|
148
|
+
image: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
render: (args: any) => import("react").JSX.Element;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { HasClassName, LumxClassName, HasTheme, GenericProps, JSXElement, CommonRef } from '../../types';
|
|
2
|
+
import { Orientation, Size } from '../../constants';
|
|
3
|
+
/**
|
|
4
|
+
* User block sizes.
|
|
5
|
+
*/
|
|
6
|
+
export type UserBlockSize = Extract<Size, 'xs' | 's' | 'm' | 'l'>;
|
|
7
|
+
/**
|
|
8
|
+
* Props for the UserBlock component.
|
|
9
|
+
*
|
|
10
|
+
* UserBlock displays user information with an avatar, name, and optional fields.
|
|
11
|
+
* Supports both horizontal and vertical orientations with customizable actions.
|
|
12
|
+
*/
|
|
13
|
+
export interface UserBlockProps extends HasClassName, HasTheme {
|
|
14
|
+
/**
|
|
15
|
+
* Props to pass to the Avatar component.
|
|
16
|
+
* Configure the user's avatar appearance and behavior.
|
|
17
|
+
*/
|
|
18
|
+
avatarProps?: GenericProps;
|
|
19
|
+
/**
|
|
20
|
+
* Additional fields to display below the user's name.
|
|
21
|
+
* Typically used for role, department, or other user metadata.
|
|
22
|
+
*/
|
|
23
|
+
fields?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Props to pass to the Link component wrapping the avatar and/or name.
|
|
26
|
+
* Used to make the user block clickable with navigation.
|
|
27
|
+
*/
|
|
28
|
+
linkProps?: GenericProps;
|
|
29
|
+
/**
|
|
30
|
+
* Custom component to use for the link element.
|
|
31
|
+
* Use this to inject a framework-specific router Link component (e.g., react-router Link).
|
|
32
|
+
* @default 'a'
|
|
33
|
+
*/
|
|
34
|
+
linkAs?: 'a' | any;
|
|
35
|
+
/**
|
|
36
|
+
* Content for multiple actions displayed in the action toolbar.
|
|
37
|
+
* Only visible when orientation is vertical.
|
|
38
|
+
*/
|
|
39
|
+
multipleActions?: JSXElement;
|
|
40
|
+
/**
|
|
41
|
+
* The user's display name.
|
|
42
|
+
* Can be a string or custom JSX element.
|
|
43
|
+
*/
|
|
44
|
+
name?: JSXElement;
|
|
45
|
+
/**
|
|
46
|
+
* Props to pass to the name wrapper element.
|
|
47
|
+
* Used to customize the name block's appearance and behavior.
|
|
48
|
+
*/
|
|
49
|
+
nameProps?: GenericProps;
|
|
50
|
+
/**
|
|
51
|
+
* Layout orientation of the user block.
|
|
52
|
+
* - horizontal: Avatar and info side by side (default)
|
|
53
|
+
* - vertical: Avatar and info stacked, forces size to 'l'
|
|
54
|
+
* @default Orientation.horizontal
|
|
55
|
+
*/
|
|
56
|
+
orientation?: Orientation;
|
|
57
|
+
/**
|
|
58
|
+
* Content for a single action displayed in the action toolbar.
|
|
59
|
+
* Only visible when orientation is vertical.
|
|
60
|
+
*/
|
|
61
|
+
simpleAction?: JSXElement;
|
|
62
|
+
/**
|
|
63
|
+
* Size variant of the component.
|
|
64
|
+
* Note: When orientation is vertical, size is automatically forced to 'l'.
|
|
65
|
+
* @default Size.m
|
|
66
|
+
*/
|
|
67
|
+
size?: UserBlockSize;
|
|
68
|
+
/**
|
|
69
|
+
* Click event handler.
|
|
70
|
+
* Called when the user clicks on the clickable area (name/avatar).
|
|
71
|
+
*/
|
|
72
|
+
handleClick?(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Mouse enter event handler.
|
|
75
|
+
* Called when the mouse enters the component.
|
|
76
|
+
*/
|
|
77
|
+
handleMouseEnter?(): void;
|
|
78
|
+
mouseEnterProp?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Mouse leave event handler.
|
|
81
|
+
* Called when the mouse leaves the component.
|
|
82
|
+
*/
|
|
83
|
+
handleMouseLeave?(): void;
|
|
84
|
+
mouseLeaveProp?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Additional custom fields to display below the standard fields.
|
|
87
|
+
* Only visible when size is not 'xs' or 's'.
|
|
88
|
+
*/
|
|
89
|
+
additionalFields?: JSXElement;
|
|
90
|
+
/**
|
|
91
|
+
* Content to display after the entire component.
|
|
92
|
+
* Position depends on orientation:
|
|
93
|
+
* - horizontal: displayed to the right
|
|
94
|
+
* - vertical: displayed at the bottom
|
|
95
|
+
*/
|
|
96
|
+
after?: JSXElement;
|
|
97
|
+
/**
|
|
98
|
+
* Custom content to replace the default name block.
|
|
99
|
+
* When provided, replaces the default name rendering.
|
|
100
|
+
*/
|
|
101
|
+
children?: JSXElement;
|
|
102
|
+
/**
|
|
103
|
+
* Ref to attach to the root element.
|
|
104
|
+
*/
|
|
105
|
+
ref?: CommonRef;
|
|
106
|
+
/**
|
|
107
|
+
* Text component for rendering text content.
|
|
108
|
+
* Injected by the framework wrapper (React/Vue).
|
|
109
|
+
*/
|
|
110
|
+
Text: (props: any) => any;
|
|
111
|
+
/**
|
|
112
|
+
* Avatar component for rendering the user avatar.
|
|
113
|
+
* Injected by the framework wrapper (React/Vue).
|
|
114
|
+
*/
|
|
115
|
+
Avatar: (props: any) => any;
|
|
116
|
+
}
|
|
117
|
+
export type UserBlockPropsToOverride = 'Avatar' | 'Text' | 'linkProps' | 'avatarProps' | 'mouseLeaveProp' | 'mouseEnterProp';
|
|
118
|
+
/**
|
|
119
|
+
* Component display name.
|
|
120
|
+
*/
|
|
121
|
+
export declare const COMPONENT_NAME = "UserBlock";
|
|
122
|
+
/**
|
|
123
|
+
* Component default class name and class prefix.
|
|
124
|
+
*/
|
|
125
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
126
|
+
export declare const block: {
|
|
127
|
+
(additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
128
|
+
(modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
129
|
+
}, element: {
|
|
130
|
+
(elem: string, additionalClasses: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
131
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/types").Modifier, additionalClasses?: import("../../utils/classNames/bem/types").AdditionalClasses): string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Component default props.
|
|
135
|
+
*/
|
|
136
|
+
export declare const DEFAULT_PROPS: Partial<UserBlockProps>;
|
|
137
|
+
export declare const isUserBlockClickeable: ({ linkAs, linkProps, handleClick, }: Pick<UserBlockProps, "linkAs" | "linkProps" | "handleClick">) => boolean;
|
|
138
|
+
/**
|
|
139
|
+
* UserBlock component.
|
|
140
|
+
*
|
|
141
|
+
* @param props Component props.
|
|
142
|
+
* @param ref Component ref.
|
|
143
|
+
* @return React element.
|
|
144
|
+
*/
|
|
145
|
+
export declare const UserBlock: (props: UserBlockProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup ClickAwayProvider stories for a specific framework (React or Vue).
|
|
4
|
+
* Framework-specific components are injected via `components`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setup({ component: ClickAwayProvider, components: { PortalProvider, ButtonWithCard }, }: SetupStoriesOptions<{
|
|
7
|
+
components: {
|
|
8
|
+
PortalProvider: any;
|
|
9
|
+
/** A button that toggles a Card. Accepts: level, parentRef. */
|
|
10
|
+
ButtonWithCard: any;
|
|
11
|
+
};
|
|
12
|
+
}>): {
|
|
13
|
+
meta: {
|
|
14
|
+
component: any;
|
|
15
|
+
parameters: {
|
|
16
|
+
chromatic: {
|
|
17
|
+
disable: boolean;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
tags: string[];
|
|
21
|
+
};
|
|
22
|
+
NestedClickAway: {
|
|
23
|
+
render: () => import("react").JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
InShadowDOM: {
|
|
26
|
+
render: () => import("react").JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
TestClickAwayCloses: {
|
|
29
|
+
render: () => import("react").JSX.Element;
|
|
30
|
+
play(): Promise<void>;
|
|
31
|
+
};
|
|
32
|
+
TestNestedClickAway: {
|
|
33
|
+
render: () => import("react").JSX.Element;
|
|
34
|
+
play(): Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup InfiniteScroll test stories for a specific framework (React or Vue).
|
|
4
|
+
*
|
|
5
|
+
* @param component The framework InfiniteScroll component.
|
|
6
|
+
* @param components Framework-specific components:
|
|
7
|
+
* - ScrollZone: a pre-wired component rendering a fixed-height scrollable container
|
|
8
|
+
* with tall fake content and InfiniteScroll at the bottom. Accepts:
|
|
9
|
+
* - `onLoad` callback (called when the sentinel intersects)
|
|
10
|
+
* - `data-testid` forwarded to the scroll container div
|
|
11
|
+
*/
|
|
12
|
+
export declare function setup({ component: InfiniteScroll }: SetupStoriesOptions): {
|
|
13
|
+
meta: {
|
|
14
|
+
component: any;
|
|
15
|
+
tags: string[];
|
|
16
|
+
parameters: {
|
|
17
|
+
chromatic: {
|
|
18
|
+
disableSnapshot: boolean;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
args: {
|
|
22
|
+
callback: () => void;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
TestRendersSentinelDiv: {
|
|
26
|
+
render: (args: any) => import("react").JSX.Element;
|
|
27
|
+
play({ canvasElement }: any): Promise<void>;
|
|
28
|
+
};
|
|
29
|
+
TestDetectsScrollEnd: {
|
|
30
|
+
render: ({ callback }: any) => import("react").JSX.Element;
|
|
31
|
+
args: {
|
|
32
|
+
callback: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
33
|
+
};
|
|
34
|
+
play({ canvas, args }: any): Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
TestNoCallbackWithoutScroll: {
|
|
37
|
+
render: ({ callback }: any) => import("react").JSX.Element;
|
|
38
|
+
args: {
|
|
39
|
+
callback: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
40
|
+
};
|
|
41
|
+
play({ canvas, args }: any): Promise<void>;
|
|
42
|
+
};
|
|
43
|
+
TestRetriggersOnSubsequentScrolls: {
|
|
44
|
+
render: ({ callback }: any) => import("react").JSX.Element;
|
|
45
|
+
args: {
|
|
46
|
+
callback: import("storybook/test").Mock<(...args: any[]) => any>;
|
|
47
|
+
};
|
|
48
|
+
play({ canvas, args }: any): Promise<void>;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CommonRef } from '../../types';
|
|
2
|
+
export { setupInfiniteScrollObserver } from './setupInfiniteScrollObserver';
|
|
3
|
+
export declare const INFINITE_SCROLL_CLASSNAME = "lumx-infinite-scroll-anchor";
|
|
4
|
+
export interface InfiniteScrollProps {
|
|
5
|
+
/** Callback when infinite scroll component is in view */
|
|
6
|
+
callback: (evt?: Event) => void;
|
|
7
|
+
/** Customize intersection observer option */
|
|
8
|
+
options?: IntersectionObserverInit;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Framework-agnostic InfiniteScroll sentinel component.
|
|
12
|
+
*
|
|
13
|
+
* Renders a tiny invisible div that triggers a callback when it enters the viewport
|
|
14
|
+
* (or intersects its root element) via IntersectionObserver.
|
|
15
|
+
*
|
|
16
|
+
* The div has a small height (4px) to avoid issues when a browser zoom is applied,
|
|
17
|
+
* where a zero-height element might not trigger IntersectionObserver reliably.
|
|
18
|
+
*/
|
|
19
|
+
export declare const InfiniteScroll: ({ ref }: {
|
|
20
|
+
ref?: CommonRef;
|
|
21
|
+
}) => import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
/**
|
|
3
|
+
* Setup PortalProvider stories for a specific framework (React or Vue).
|
|
4
|
+
* Framework-specific components (Portal, Button) are injected via `components`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function setup({ component: PortalProvider, components: { Portal, Button }, }: SetupStoriesOptions<{
|
|
7
|
+
components: {
|
|
8
|
+
Portal: any;
|
|
9
|
+
Button: any;
|
|
10
|
+
};
|
|
11
|
+
}>): {
|
|
12
|
+
meta: {
|
|
13
|
+
component: any;
|
|
14
|
+
args: {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
};
|
|
17
|
+
parameters: {
|
|
18
|
+
chromatic: {
|
|
19
|
+
disable: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
tags: string[];
|
|
23
|
+
};
|
|
24
|
+
RenderInShadowDOM: {
|
|
25
|
+
render: ({ enabled }: {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
}) => import("react").JSX.Element;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
+
export declare function setup({ classProp, components: { FlexBox, Heading, Link, Text, Button, IconButton }, decorators: { withCombinations, withThemedBackground }, }: SetupStoriesOptions<{
|
|
3
|
+
components: {
|
|
4
|
+
FlexBox: any;
|
|
5
|
+
Heading: any;
|
|
6
|
+
Link: any;
|
|
7
|
+
Text: any;
|
|
8
|
+
Button: any;
|
|
9
|
+
IconButton: any;
|
|
10
|
+
};
|
|
11
|
+
decorators: 'withCombinations' | 'withThemedBackground';
|
|
12
|
+
}>): {
|
|
13
|
+
meta: {};
|
|
14
|
+
CardExample: {
|
|
15
|
+
render: ({ "data-lumx-hover": hover, "data-lumx-active": active, "data-focus-visible-added": focused, focusStyle, theme, hasOverlay, }: any) => import("react").JSX.Element;
|
|
16
|
+
argTypes: {
|
|
17
|
+
onClick: {
|
|
18
|
+
action: boolean;
|
|
19
|
+
};
|
|
20
|
+
hasOverlay: {
|
|
21
|
+
control: string;
|
|
22
|
+
};
|
|
23
|
+
focusStyle: {
|
|
24
|
+
control: {
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
options: (string | undefined)[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
OverlayStates: {
|
|
32
|
+
render: ({ "data-lumx-hover": hover, "data-lumx-active": active, "data-focus-visible-added": focused, focusStyle, theme, hasOverlay, }: any) => import("react").JSX.Element;
|
|
33
|
+
args: {
|
|
34
|
+
hasOverlay: boolean;
|
|
35
|
+
};
|
|
36
|
+
decorators: ((story: any, context: any) => any)[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JSXElement } from '../../types';
|
|
2
|
+
import type { BaseSelectComponents, RenderSelectOptionsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Render options as ComboboxOption elements.
|
|
5
|
+
* Framework-specific components are passed as a second argument.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renderSelectOptions<O>(props: RenderSelectOptionsProps<O>, components: BaseSelectComponents): JSXElement;
|
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.14.0-next.
|
|
10
|
+
"@lumx/icons": "^4.14.0-next.1",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
|
-
"version": "4.14.0-next.
|
|
72
|
+
"version": "4.14.0-next.1",
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
75
75
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CombinationsOptions } from './combinations';
|
|
2
|
+
/** Nested components injected by framework-specific wrappers */
|
|
3
|
+
type NestedComponents = {
|
|
4
|
+
/** Provider that tracks heading nesting level */
|
|
5
|
+
HeadingLevelProvider: any;
|
|
6
|
+
/** Heading component that renders at the current level */
|
|
7
|
+
Heading: any;
|
|
8
|
+
/** Story component that renders a story with given args */
|
|
9
|
+
Story: any;
|
|
10
|
+
};
|
|
11
|
+
/** Parameters for the CombinationsTable function */
|
|
12
|
+
type CombinationsTableParams = {
|
|
13
|
+
/** Storybook context */
|
|
14
|
+
ctx: any;
|
|
15
|
+
/** Combination options (layout, styles, combinations config) */
|
|
16
|
+
options: CombinationsOptions;
|
|
17
|
+
/** Framework-specific components */
|
|
18
|
+
nestedComponents: NestedComponents;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Generic JSX template that renders a matrix/table of story combinations.
|
|
22
|
+
* Framework-agnostic: works with both React and Vue JSX by receiving
|
|
23
|
+
* framework-specific components (HeadingLevelProvider, Heading, Story) as params.
|
|
24
|
+
*/
|
|
25
|
+
export declare function CombinationsTable({ ctx, options, nestedComponents }: CombinationsTableParams): import("react").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Entry, Variables } from './themeVariables';
|
|
2
|
+
/** Framework-specific components injected by React/Vue decorators */
|
|
3
|
+
type NestedComponents = {
|
|
4
|
+
/** FlexBox component for horizontal layout */
|
|
5
|
+
FlexBox: any;
|
|
6
|
+
/** Wrapper for details/summary disclosure widget */
|
|
7
|
+
DetailsContainer: any;
|
|
8
|
+
};
|
|
9
|
+
/** Parameters for the ThemingVariablesTable component */
|
|
10
|
+
type ThemingVariablesTableParams = {
|
|
11
|
+
/** Current CSS variable values */
|
|
12
|
+
style: Variables;
|
|
13
|
+
/** Default CSS variable values (for placeholder display) */
|
|
14
|
+
defaultStyle: Variables;
|
|
15
|
+
/** Callback when a variable is changed */
|
|
16
|
+
onVariableChange: (entry: Entry) => void;
|
|
17
|
+
/** Framework-specific components */
|
|
18
|
+
nestedComponents: NestedComponents;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Framework-agnostic JSX component for rendering CSS variable editors.
|
|
22
|
+
* Similar to CombinationsTable, but renders a simpler disclosure widget
|
|
23
|
+
* with input fields for editing CSS custom properties.
|
|
24
|
+
*
|
|
25
|
+
* This component receives framework-specific components (FlexBox, DetailsContainer)
|
|
26
|
+
* as dependencies, allowing it to work with both React and Vue.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ThemingVariablesTable({ style, defaultStyle, onVariableChange, nestedComponents, }: ThemingVariablesTableParams): import("react").JSX.Element;
|
|
29
|
+
export {};
|