@lumx/core 4.3.2-alpha.9 → 4.4.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/js/components/Badge/BadgeWrapperTests.d.ts +9 -0
- package/js/components/Badge/Tests.d.ts +12 -0
- package/js/components/Button/Button.d.ts +48 -0
- package/js/components/Button/ButtonRoot.d.ts +55 -0
- package/js/components/Button/ButtonRootTests.d.ts +12 -0
- package/js/components/Button/IconButton.d.ts +45 -0
- package/js/components/Button/IconButtonTests.d.ts +15 -0
- package/js/components/Button/Tests.d.ts +15 -0
- package/js/components/Checkbox/Tests.d.ts +15 -0
- package/js/components/Checkbox/index.d.ts +49 -0
- package/js/components/Divider/Tests.d.ts +12 -0
- package/js/components/Divider/index.d.ts +27 -0
- package/js/components/Flag/Tests.d.ts +14 -0
- package/js/components/Flag/index.d.ts +34 -0
- package/js/components/FlexBox/Tests.d.ts +13 -0
- package/js/components/FlexBox/constants.d.ts +4 -0
- package/js/components/FlexBox/index.d.ts +50 -0
- package/js/components/FlexBox/types.d.ts +7 -0
- package/js/components/GridColumn/GridColumn.d.ts +48 -0
- package/js/components/GridColumn/GridColumnTests.d.ts +12 -0
- package/js/components/Heading/Tests.d.ts +11 -0
- package/js/components/Heading/constants.d.ts +21 -0
- package/js/components/Heading/index.d.ts +44 -0
- package/js/components/Heading/utils.d.ts +8 -0
- package/js/components/Icon/Tests.d.ts +14 -0
- package/js/components/Icon/constants.d.ts +1 -0
- package/js/components/Icon/index.d.ts +41 -0
- package/js/components/InputHelper/Tests.d.ts +12 -0
- package/js/components/InputHelper/constants.d.ts +3 -0
- package/js/components/InputHelper/index.d.ts +26 -0
- package/js/components/InputLabel/Tests.d.ts +12 -0
- package/js/components/InputLabel/index.d.ts +25 -0
- package/js/components/Link/Tests.d.ts +8 -0
- package/js/components/Message/Tests.d.ts +14 -0
- package/js/components/Message/index.d.ts +75 -0
- package/js/components/ProgressCircular/Stories.d.ts +30 -0
- package/js/components/ProgressCircular/Tests.d.ts +11 -0
- package/js/components/ProgressCircular/index.d.ts +52 -0
- package/js/components/ProgressLinear/Stories.d.ts +11 -0
- package/js/components/ProgressLinear/Tests.d.ts +11 -0
- package/js/components/ProgressLinear/index.d.ts +27 -0
- package/js/components/RadioButton/Tests.d.ts +15 -0
- package/js/components/RadioButton/index.d.ts +45 -0
- package/js/components/RawClickable/Tests.d.ts +14 -0
- package/js/components/RawClickable/index.d.ts +14 -0
- package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
- package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
- package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
- package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
- package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
- package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
- package/js/components/Skeleton/index.d.ts +3 -0
- package/js/components/Switch/Tests.d.ts +15 -0
- package/js/components/Switch/index.d.ts +47 -0
- package/js/components/Table/TableCell.d.ts +55 -0
- package/js/components/Table/TableCellTests.d.ts +11 -0
- package/js/components/Table/Tests.d.ts +11 -0
- package/js/components/Table/constants.d.ts +9 -0
- package/js/components/Text/Tests.d.ts +10 -0
- package/js/components/Text/index.d.ts +935 -0
- package/js/components/Thumbnail/Tests.d.ts +11 -0
- package/js/components/Thumbnail/index.d.ts +84 -0
- package/js/components/Thumbnail/types.d.ts +45 -0
- package/js/components/Thumbnail/utils.d.ts +79 -0
- package/js/components/Toolbar/Tests.d.ts +12 -0
- package/js/types/AriaAttributes.d.ts +29 -2
- package/js/types/index.d.ts +1 -0
- package/js/types/jsx/PropsToOverride.d.ts +2 -0
- package/lumx.css +0 -94
- package/package.json +32 -4
- package/scss/_components.scss +0 -1
- package/scss/lumx.scss +0 -1
- package/stories/controls/color.d.ts +15 -0
- package/stories/controls/element.d.ts +16 -0
- package/stories/controls/focusPoint.d.ts +8 -0
- package/stories/controls/icons.d.ts +66 -0
- package/stories/controls/image.d.ts +96 -0
- package/stories/controls/selectArgType.d.ts +7 -0
- package/stories/controls/theme.d.ts +7 -0
- package/stories/controls/typography.d.ts +8 -0
- package/stories/controls/withUndefined.d.ts +1 -0
- package/stories/types.d.ts +48 -0
- package/stories/utils/combinations.d.ts +100 -0
- package/stories/utils/concatPath.d.ts +10 -0
- package/stories/utils/disableArgTypes.d.ts +7 -0
- package/stories/utils/initDemoShadowDOMPortal.d.ts +5 -0
- package/stories/utils/lorem.d.ts +7 -0
- package/stories/utils/toFlattenProps.d.ts +12 -0
- package/stories/utils/withCategory.d.ts +4 -0
- package/testing/commonTestsSuiteTL.d.ts +87 -0
- package/testing/index.d.ts +1 -0
- package/testing/queries.d.ts +4 -0
- package/js/utils/events/index.js +0 -2
- package/scss/components/combobox/_index.scss +0 -86
- package/scss/components/combobox/_mixins.scss +0 -63
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
thumbnail: HTMLElement;
|
|
8
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { ImgHTMLAttributes } from 'react';
|
|
2
|
+
import { AspectRatio, HorizontalAlignment } from '@lumx/core/js/constants';
|
|
3
|
+
import type { GenericProps, HasTheme, CommonRef, JSXElement, LumxClassName, HasClassName } from '@lumx/core/js/types';
|
|
4
|
+
import { ThumbnailSize, ThumbnailVariant, ThumbnailObjectFit } from './types';
|
|
5
|
+
type ImgHTMLProps = ImgHTMLAttributes<HTMLImageElement>;
|
|
6
|
+
/**
|
|
7
|
+
* Defines the props of the component.
|
|
8
|
+
*/
|
|
9
|
+
export interface ThumbnailProps extends HasTheme, HasClassName {
|
|
10
|
+
/** Alignment of the thumbnail in it's parent (requires flex parent). */
|
|
11
|
+
align?: HorizontalAlignment;
|
|
12
|
+
/** Image alternative text. */
|
|
13
|
+
alt: string;
|
|
14
|
+
/** Image aspect ratio. */
|
|
15
|
+
aspectRatio?: AspectRatio;
|
|
16
|
+
/** Badge. */
|
|
17
|
+
badge?: JSXElement;
|
|
18
|
+
/** Image cross origin resource policy. */
|
|
19
|
+
crossOrigin?: ImgHTMLProps['crossOrigin'];
|
|
20
|
+
/** Fallback icon (SVG path) or react node when image fails to load. */
|
|
21
|
+
fallback?: string | JSXElement;
|
|
22
|
+
/** Whether the thumbnail should fill it's parent size (requires flex parent) or not. */
|
|
23
|
+
fillHeight?: boolean;
|
|
24
|
+
/** Image URL. */
|
|
25
|
+
image: string;
|
|
26
|
+
loadingState: string;
|
|
27
|
+
/** Props to inject into the native <img> element. */
|
|
28
|
+
imgProps?: ImgHTMLProps;
|
|
29
|
+
/** Reference to the native <img> element. */
|
|
30
|
+
imgRef?: CommonRef;
|
|
31
|
+
ref?: CommonRef;
|
|
32
|
+
/** Set to true to force the display of the loading skeleton. */
|
|
33
|
+
isLoading?: boolean;
|
|
34
|
+
/** Set how the image should fit when its aspect ratio is constrained */
|
|
35
|
+
objectFit?: ThumbnailObjectFit;
|
|
36
|
+
/** Size variant of the component. */
|
|
37
|
+
size?: ThumbnailSize;
|
|
38
|
+
/** Image loading mode. */
|
|
39
|
+
loading?: 'eager' | 'lazy';
|
|
40
|
+
/** Ref of an existing placeholder image to display while loading. */
|
|
41
|
+
loadingPlaceholderImageRef?: React.RefObject<HTMLImageElement>;
|
|
42
|
+
/** On click callback. */
|
|
43
|
+
handleClick?: (event: any) => void;
|
|
44
|
+
/** On key press callback. */
|
|
45
|
+
handleKeyPress?: (event: any) => void;
|
|
46
|
+
/** Variant of the component. */
|
|
47
|
+
variant?: ThumbnailVariant;
|
|
48
|
+
/** Props to pass to the link wrapping the thumbnail. */
|
|
49
|
+
linkProps?: GenericProps;
|
|
50
|
+
focusPointStyle?: GenericProps;
|
|
51
|
+
disabledStateProps?: GenericProps;
|
|
52
|
+
isAnyDisabled?: boolean;
|
|
53
|
+
/** Custom react component for the link (can be used to inject react router Link). */
|
|
54
|
+
linkAs?: 'a' | any;
|
|
55
|
+
'aria-label'?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Component display name.
|
|
59
|
+
*/
|
|
60
|
+
export declare const COMPONENT_NAME = "Thumbnail";
|
|
61
|
+
/**
|
|
62
|
+
* Component default class name and class prefix.
|
|
63
|
+
*/
|
|
64
|
+
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
65
|
+
export declare const block: {
|
|
66
|
+
(additionalClasses: import("classnames/types").ClassValue[]): string;
|
|
67
|
+
(modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
|
|
68
|
+
}, element: {
|
|
69
|
+
(elem: string, additionalClasses: import("classnames/types").ClassValue[]): string;
|
|
70
|
+
(elem: string, modifiers?: import("../../utils/classNames/bem/modifier").Modifier, additionalClasses?: import("classnames/types").ClassValue[]): string;
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Component default props.
|
|
74
|
+
*/
|
|
75
|
+
export declare const DEFAULT_PROPS: Partial<ThumbnailProps>;
|
|
76
|
+
/**
|
|
77
|
+
* Thumbnail component.
|
|
78
|
+
*
|
|
79
|
+
* @param props Component props.
|
|
80
|
+
* @param ref Component ref.
|
|
81
|
+
* @return React element.
|
|
82
|
+
*/
|
|
83
|
+
export declare const Thumbnail: (props: ThumbnailProps) => import("react").JSX.Element;
|
|
84
|
+
export * from './utils';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AspectRatio, Size } from '../../constants';
|
|
2
|
+
import { ValueOf } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Focal point using vertical alignment, horizontal alignment or coordinates (from -1 to 1).
|
|
5
|
+
*/
|
|
6
|
+
export type FocusPoint = {
|
|
7
|
+
x?: number;
|
|
8
|
+
y?: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Loading attribute is not yet supported in typescript, so we need
|
|
12
|
+
* to add it in order to avoid a ts error.
|
|
13
|
+
* https://github.com/typescript-cheatsheets/react-typescript-cheatsheet/blob/master/ADVANCED.md#adding-non-standard-attributes
|
|
14
|
+
*/
|
|
15
|
+
declare module 'react' {
|
|
16
|
+
interface ImgHTMLAttributes<T> extends React.HTMLAttributes<T> {
|
|
17
|
+
loading?: 'eager' | 'lazy';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* All available aspect ratios.
|
|
22
|
+
* @deprecated
|
|
23
|
+
*/
|
|
24
|
+
export declare const ThumbnailAspectRatio: Record<string, AspectRatio>;
|
|
25
|
+
/**
|
|
26
|
+
* Thumbnail sizes.
|
|
27
|
+
*/
|
|
28
|
+
export type ThumbnailSize = Extract<Size, 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl'>;
|
|
29
|
+
/**
|
|
30
|
+
* Thumbnail variants.
|
|
31
|
+
*/
|
|
32
|
+
export declare const ThumbnailVariant: {
|
|
33
|
+
readonly squared: "squared";
|
|
34
|
+
readonly rounded: "rounded";
|
|
35
|
+
};
|
|
36
|
+
export type ThumbnailVariant = ValueOf<typeof ThumbnailVariant>;
|
|
37
|
+
/**
|
|
38
|
+
* Thumbnail object fit.
|
|
39
|
+
*/
|
|
40
|
+
export declare const ThumbnailObjectFit: {
|
|
41
|
+
readonly cover: "cover";
|
|
42
|
+
readonly contain: "contain";
|
|
43
|
+
};
|
|
44
|
+
export type ThumbnailObjectFit = ValueOf<typeof ThumbnailObjectFit>;
|
|
45
|
+
export type LoadingState = 'isLoading' | 'isLoaded' | 'hasError';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { RectSize } from '../../types';
|
|
3
|
+
import { AspectRatio } from '../../constants';
|
|
4
|
+
import type { FocusPoint, LoadingState } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Determines the loading state of an HTML image element.
|
|
7
|
+
*
|
|
8
|
+
* @param img - The HTML image element to check
|
|
9
|
+
* @param event - Optional event (load or error) that triggered the state check
|
|
10
|
+
* @returns The current loading state: 'hasError', 'isLoading', or 'isLoaded'
|
|
11
|
+
*/
|
|
12
|
+
export declare function getImageLoadingState(img: HTMLImageElement | null | undefined, event?: Event): LoadingState;
|
|
13
|
+
/**
|
|
14
|
+
* Parameters for getting image size.
|
|
15
|
+
*/
|
|
16
|
+
export interface GetImageSizeParams {
|
|
17
|
+
/** Image URL (used for validation) */
|
|
18
|
+
image?: string;
|
|
19
|
+
/** Aspect ratio setting */
|
|
20
|
+
aspectRatio?: AspectRatio;
|
|
21
|
+
/** Focus point (if not set, size calculation is skipped) */
|
|
22
|
+
focusPoint?: FocusPoint;
|
|
23
|
+
/** Width from imgProps */
|
|
24
|
+
width?: number;
|
|
25
|
+
/** Height from imgProps */
|
|
26
|
+
height?: number;
|
|
27
|
+
/** Image element (for getting natural dimensions) */
|
|
28
|
+
element?: HTMLImageElement;
|
|
29
|
+
/** Whether image is loaded */
|
|
30
|
+
isLoaded: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Gets the natural image size from props or element.
|
|
34
|
+
* Returns undefined if focus point is not applicable or size cannot be determined.
|
|
35
|
+
*
|
|
36
|
+
* @param params - Image size parameters
|
|
37
|
+
* @returns Image size or undefined
|
|
38
|
+
*/
|
|
39
|
+
export declare function getImageSize({ image, aspectRatio, focusPoint, width, height, element, isLoaded, }: GetImageSizeParams): RectSize | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Calculate shift position to center the focus point in the container.
|
|
42
|
+
*
|
|
43
|
+
* This function computes the percentage offset needed to position an image
|
|
44
|
+
* such that a specific focus point on the image aligns with the center of
|
|
45
|
+
* the container, taking into account the image's scale.
|
|
46
|
+
*
|
|
47
|
+
* @param params - Focus point shift calculation parameters
|
|
48
|
+
* @returns Percentage shift (0-100) for CSS positioning
|
|
49
|
+
*/
|
|
50
|
+
export declare function shiftPosition({ scale, focusPoint, imageSize, containerSize, }: {
|
|
51
|
+
scale: number;
|
|
52
|
+
focusPoint: number;
|
|
53
|
+
imageSize: number;
|
|
54
|
+
containerSize: number;
|
|
55
|
+
}): number;
|
|
56
|
+
/**
|
|
57
|
+
* Parameters for calculating focus point style.
|
|
58
|
+
*/
|
|
59
|
+
export interface CalculateFocusPointStyleParams {
|
|
60
|
+
/** Image URL */
|
|
61
|
+
image?: string;
|
|
62
|
+
/** Aspect ratio */
|
|
63
|
+
aspectRatio?: AspectRatio;
|
|
64
|
+
/** Focus point */
|
|
65
|
+
focusPoint?: FocusPoint;
|
|
66
|
+
/** Image element (for validation) */
|
|
67
|
+
element?: HTMLImageElement;
|
|
68
|
+
/** Natural image size */
|
|
69
|
+
imageSize?: RectSize;
|
|
70
|
+
/** Container size */
|
|
71
|
+
containerSize?: RectSize;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Calculates CSS style for applying focus point positioning.
|
|
75
|
+
*
|
|
76
|
+
* @param params - Focus point style parameters
|
|
77
|
+
* @returns CSS properties to apply to the image
|
|
78
|
+
*/
|
|
79
|
+
export declare function calculateFocusPointStyle({ image, aspectRatio, focusPoint, element, imageSize, containerSize, }: CalculateFocusPointStyleParams): CSSProperties;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SetupOptions } from '../../../testing';
|
|
2
|
+
/**
|
|
3
|
+
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
4
|
+
*/
|
|
5
|
+
export declare const setup: (propsOverride: any | undefined, { render, ...options }: SetupOptions<any>) => {
|
|
6
|
+
props: any;
|
|
7
|
+
toolbar: HTMLElement;
|
|
8
|
+
div: HTMLElement;
|
|
9
|
+
wrapper: Partial<import("../../../testing").SetupResult>;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: (renderOptions: SetupOptions<any>) => void;
|
|
12
|
+
export default _default;
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* ARIA attributes type for components.
|
|
3
|
+
* All attributes are optional.
|
|
4
|
+
*
|
|
5
|
+
* This is a custom interface containing only the ARIA attributes
|
|
6
|
+
* actually used in the @lumx/core components, avoiding dependency on React types.
|
|
7
|
+
*/
|
|
8
|
+
export interface AriaAttributes {
|
|
9
|
+
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
|
|
10
|
+
'aria-expanded'?: boolean | 'true' | 'false';
|
|
11
|
+
/** Indicates the availability and type of interactive popup element that can be triggered by the element. */
|
|
12
|
+
'aria-haspopup'?: boolean | 'false' | 'true' | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog';
|
|
13
|
+
/** Indicates the current "pressed" state of toggle buttons. */
|
|
14
|
+
'aria-pressed'?: boolean | 'false' | 'mixed' | 'true';
|
|
15
|
+
/** Defines a string value that labels the current element. */
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
/** Identifies the element (or elements) that labels the current element. */
|
|
18
|
+
'aria-labelledby'?: string;
|
|
19
|
+
/** Identifies the element (or elements) that describes the object. */
|
|
20
|
+
'aria-describedby'?: string;
|
|
21
|
+
/** Indicates whether the element is exposed to an accessibility API. */
|
|
22
|
+
'aria-hidden'?: boolean | 'true' | 'false';
|
|
23
|
+
/** Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable. */
|
|
24
|
+
'aria-disabled'?: boolean | 'true' | 'false';
|
|
25
|
+
/** Indicates the current "checked" state of checkboxes, radio buttons, and other widgets. */
|
|
26
|
+
'aria-checked'?: boolean | 'false' | 'mixed' | 'true';
|
|
27
|
+
/** Indicates whether items in a table or grid are sorted in ascending or descending order. */
|
|
28
|
+
'aria-sort'?: 'none' | 'ascending' | 'descending' | 'other';
|
|
29
|
+
}
|
package/js/types/index.d.ts
CHANGED
|
@@ -25,4 +25,5 @@ export type { HasChecked } from './HasChecked';
|
|
|
25
25
|
export type { HasDisabled } from './HasDisabled';
|
|
26
26
|
export type { AriaAttributes } from './AriaAttributes';
|
|
27
27
|
export type { Selector } from './Selector';
|
|
28
|
+
export type { PropsToOverride } from './jsx/PropsToOverride';
|
|
28
29
|
export type { PartialBy, PartialExcept } from './PartialBy';
|
package/lumx.css
CHANGED
|
@@ -685,18 +685,6 @@
|
|
|
685
685
|
* List of deprecated v2 variables that have been removed or renamed.
|
|
686
686
|
* Warning: These will be removed in the next major version.
|
|
687
687
|
*/
|
|
688
|
-
/**
|
|
689
|
-
* Add styles before & after an element while avoiding having a "before" section display if an "after" section was
|
|
690
|
-
displayed.
|
|
691
|
-
*/
|
|
692
|
-
/**
|
|
693
|
-
* Automatic divider between elements of a list using border before and after the element
|
|
694
|
-
*
|
|
695
|
-
* @param $orientation Required 'vertical'/'horizontal' orientation
|
|
696
|
-
* @param $selector Optional element selector to apply to (default to parent '&' selector)
|
|
697
|
-
* @param $theme Optional 'theme-light'/'theme-dark' (defaults to 'theme-light')
|
|
698
|
-
* @param $spacing Optional spacing around dividers (defaults to $lumx-spacing-unit-regular)
|
|
699
|
-
*/
|
|
700
688
|
/* stylelint-disable custom-property-pattern */
|
|
701
689
|
/** @deprecated: replaced with $lumx-progress-circular-size-map */
|
|
702
690
|
/**
|
|
@@ -5069,88 +5057,6 @@ table {
|
|
|
5069
5057
|
width: 100%;
|
|
5070
5058
|
}
|
|
5071
5059
|
|
|
5072
|
-
/* ==========================================================================
|
|
5073
|
-
Combobox Divider
|
|
5074
|
-
========================================================================== */
|
|
5075
|
-
.lumx-combobox-divider:last-child, .lumx-combobox-divider:first-child {
|
|
5076
|
-
display: none;
|
|
5077
|
-
}
|
|
5078
|
-
|
|
5079
|
-
/* ==========================================================================
|
|
5080
|
-
Combobox Option
|
|
5081
|
-
========================================================================== */
|
|
5082
|
-
.lumx-combobox-option {
|
|
5083
|
-
position: relative;
|
|
5084
|
-
}
|
|
5085
|
-
.lumx-combobox-option__content {
|
|
5086
|
-
gap: 0;
|
|
5087
|
-
}
|
|
5088
|
-
.lumx-combobox-option__content--is-disabled {
|
|
5089
|
-
opacity: 0.5;
|
|
5090
|
-
}
|
|
5091
|
-
.lumx-combobox-option__trigger {
|
|
5092
|
-
color: rgba(0, 0, 0, 0.87);
|
|
5093
|
-
text-decoration: none;
|
|
5094
|
-
overflow: hidden;
|
|
5095
|
-
overflow-wrap: break-word;
|
|
5096
|
-
}
|
|
5097
|
-
.lumx-combobox-option__trigger::before {
|
|
5098
|
-
content: "";
|
|
5099
|
-
cursor: pointer;
|
|
5100
|
-
position: absolute;
|
|
5101
|
-
left: 0;
|
|
5102
|
-
bottom: 0;
|
|
5103
|
-
right: 0;
|
|
5104
|
-
top: 0;
|
|
5105
|
-
z-index: 2;
|
|
5106
|
-
}
|
|
5107
|
-
.lumx-combobox-option__after {
|
|
5108
|
-
z-index: 3;
|
|
5109
|
-
}
|
|
5110
|
-
|
|
5111
|
-
/* ==========================================================================
|
|
5112
|
-
Combobox Listbox
|
|
5113
|
-
========================================================================== */
|
|
5114
|
-
.lumx-combobox-listbox:empty {
|
|
5115
|
-
padding: 0;
|
|
5116
|
-
}
|
|
5117
|
-
.lumx-combobox-listbox__state {
|
|
5118
|
-
text-align: center;
|
|
5119
|
-
margin: 8px;
|
|
5120
|
-
}
|
|
5121
|
-
|
|
5122
|
-
/* ==========================================================================
|
|
5123
|
-
Combobox Option more Info
|
|
5124
|
-
========================================================================== */
|
|
5125
|
-
.lumx-combobox-option-more-info__popover {
|
|
5126
|
-
padding: 16px;
|
|
5127
|
-
max-width: 256px;
|
|
5128
|
-
}
|
|
5129
|
-
|
|
5130
|
-
/* ==========================================================================
|
|
5131
|
-
Combobox Section
|
|
5132
|
-
========================================================================== */
|
|
5133
|
-
.lumx-combobox-section:not(:first-child):not(.lumx-combobox-section + .lumx-combobox-section):not(.visually-hidden + .lumx-combobox-section)::before {
|
|
5134
|
-
content: "";
|
|
5135
|
-
display: block;
|
|
5136
|
-
height: 1px;
|
|
5137
|
-
margin: 0;
|
|
5138
|
-
border: none;
|
|
5139
|
-
background-color: var(--lumx-color-dark-L5);
|
|
5140
|
-
margin-top: 8px;
|
|
5141
|
-
margin-bottom: 8px;
|
|
5142
|
-
}
|
|
5143
|
-
.lumx-combobox-section:not(:last-child):not(:has(+ .visually-hidden)):not(:has(+ [aria-hidden=true]))::after {
|
|
5144
|
-
content: "";
|
|
5145
|
-
display: block;
|
|
5146
|
-
height: 1px;
|
|
5147
|
-
margin: 0;
|
|
5148
|
-
border: none;
|
|
5149
|
-
background-color: var(--lumx-color-dark-L5);
|
|
5150
|
-
margin-top: 8px;
|
|
5151
|
-
margin-bottom: 8px;
|
|
5152
|
-
}
|
|
5153
|
-
|
|
5154
5060
|
/* ==========================================================================
|
|
5155
5061
|
Checkbox
|
|
5156
5062
|
========================================================================== */
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/lumapps/design-system/issues"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@lumx/icons": "^4.
|
|
9
|
+
"@lumx/icons": "^4.4.0",
|
|
10
10
|
"classnames": "^2.3.2",
|
|
11
11
|
"focus-visible": "^5.0.2",
|
|
12
12
|
"lodash": "4.17.23",
|
|
@@ -22,6 +22,35 @@
|
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"type": "module",
|
|
24
24
|
"name": "@lumx/core",
|
|
25
|
+
"exports": {
|
|
26
|
+
"./js/constants": {
|
|
27
|
+
"types": "./js/constants/index.d.ts",
|
|
28
|
+
"default": "./js/constants/index.js"
|
|
29
|
+
},
|
|
30
|
+
"./js/types": {
|
|
31
|
+
"types": "./js/types/index.d.ts",
|
|
32
|
+
"default": "./js/types/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./js/utils/classNames": {
|
|
35
|
+
"types": "./js/utils/classNames/index.d.ts",
|
|
36
|
+
"default": "./js/utils/classNames/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./js/utils/disabledState": {
|
|
39
|
+
"types": "./js/utils/disabledState/index.d.ts",
|
|
40
|
+
"default": "./js/utils/disabledState/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./js/utils/selectors": {
|
|
43
|
+
"types": "./js/utils/selectors/index.d.ts",
|
|
44
|
+
"default": "./js/utils/selectors/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./js/utils": {
|
|
47
|
+
"types": "./js/utils/index.d.ts",
|
|
48
|
+
"default": "./js/utils/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./lumx.css": "./lumx.css",
|
|
51
|
+
"./css/*": "./css/*",
|
|
52
|
+
"./scss/*": "./scss/*"
|
|
53
|
+
},
|
|
25
54
|
"publishConfig": {
|
|
26
55
|
"directory": "dist"
|
|
27
56
|
},
|
|
@@ -37,7 +66,7 @@
|
|
|
37
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
38
67
|
},
|
|
39
68
|
"sideEffects": false,
|
|
40
|
-
"version": "4.
|
|
69
|
+
"version": "4.4.0",
|
|
41
70
|
"devDependencies": {
|
|
42
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
43
72
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -60,6 +89,5 @@
|
|
|
60
89
|
"vite": "^7.3.1",
|
|
61
90
|
"vite-tsconfig-paths": "^5.1.4",
|
|
62
91
|
"vitest": "^4.0.18"
|
|
63
|
-
}
|
|
64
|
-
"stableVersion": "4.3.1"
|
|
92
|
+
}
|
|
65
93
|
}
|
package/scss/_components.scss
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
@import "./components/checkbox/mixins";
|
|
4
4
|
@import "./components/chip/variables";
|
|
5
5
|
@import "./components/chip/mixins";
|
|
6
|
-
@import "./components/combobox/mixins";
|
|
7
6
|
@import "./components/dialog/variables";
|
|
8
7
|
@import "./components/divider/variables";
|
|
9
8
|
@import "./components/divider/mixins";
|
package/scss/lumx.scss
CHANGED
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
@import "./components/avatar/index";
|
|
21
21
|
@import "./components/badge/index";
|
|
22
22
|
@import "./components/button/index";
|
|
23
|
-
@import "./components/combobox/index";
|
|
24
23
|
@import "./components/checkbox/index";
|
|
25
24
|
@import "./components/chip/index";
|
|
26
25
|
@import "./components/comment-block/index";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ALL_COLORS: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey")[];
|
|
2
|
+
export declare const colorArgType: {
|
|
3
|
+
control: {
|
|
4
|
+
type: "select" | "inline-radio";
|
|
5
|
+
};
|
|
6
|
+
options: ("light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined)[];
|
|
7
|
+
mapping: Record<string, "light" | "dark" | "primary" | "secondary" | "blue" | "green" | "yellow" | "red" | "grey" | undefined> | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const colorVariantArgType: {
|
|
10
|
+
control: {
|
|
11
|
+
type: "select" | "inline-radio";
|
|
12
|
+
};
|
|
13
|
+
options: ("D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N")[];
|
|
14
|
+
mapping: Record<string, "D1" | "D2" | "L1" | "L2" | "L3" | "L4" | "L5" | "L6" | "N"> | undefined;
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HeadingElement, TextElement } from '../../js/types';
|
|
2
|
+
export declare const HEADING_ELEMENTS: HeadingElement[];
|
|
3
|
+
export declare const headingElementArgType: {
|
|
4
|
+
control: {
|
|
5
|
+
type: "select" | "inline-radio";
|
|
6
|
+
};
|
|
7
|
+
options: HeadingElement[];
|
|
8
|
+
mapping: Record<string, HeadingElement> | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare const textElementArgType: {
|
|
11
|
+
control: {
|
|
12
|
+
type: "select" | "inline-radio";
|
|
13
|
+
};
|
|
14
|
+
options: TextElement[];
|
|
15
|
+
mapping: Record<string, TextElement> | undefined;
|
|
16
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const iconArgType: {
|
|
2
|
+
control: {
|
|
3
|
+
type: string;
|
|
4
|
+
};
|
|
5
|
+
options: {
|
|
6
|
+
undefined: undefined;
|
|
7
|
+
mdiAbTesting: string;
|
|
8
|
+
mdiAbjadArabic: string;
|
|
9
|
+
mdiAccount: string;
|
|
10
|
+
mdiAccountBox: string;
|
|
11
|
+
mdiAlert: string;
|
|
12
|
+
mdiAlertCircle: string;
|
|
13
|
+
mdiArrowDown: string;
|
|
14
|
+
mdiArrowUp: string;
|
|
15
|
+
mdiAtom: string;
|
|
16
|
+
mdiBee: string;
|
|
17
|
+
mdiBell: string;
|
|
18
|
+
mdiBullhornOutline: string;
|
|
19
|
+
mdiCheck: string;
|
|
20
|
+
mdiCheckCircle: string;
|
|
21
|
+
mdiChevronDown: string;
|
|
22
|
+
mdiChevronLeft: string;
|
|
23
|
+
mdiChevronRight: string;
|
|
24
|
+
mdiChevronUp: string;
|
|
25
|
+
mdiClose: string;
|
|
26
|
+
mdiCloseCircle: string;
|
|
27
|
+
mdiDelete: string;
|
|
28
|
+
mdiDotsHorizontal: string;
|
|
29
|
+
mdiDragVertical: string;
|
|
30
|
+
mdiEarth: string;
|
|
31
|
+
mdiEmail: string;
|
|
32
|
+
mdiEye: string;
|
|
33
|
+
mdiFileEdit: string;
|
|
34
|
+
mdiFlag: string;
|
|
35
|
+
mdiFolder: string;
|
|
36
|
+
mdiFolderGoogleDrive: string;
|
|
37
|
+
mdiFoodApple: string;
|
|
38
|
+
mdiGoogleCirclesExtended: string;
|
|
39
|
+
mdiHeart: string;
|
|
40
|
+
mdiHome: string;
|
|
41
|
+
mdiImageBroken: string;
|
|
42
|
+
mdiInformation: string;
|
|
43
|
+
mdiLink: string;
|
|
44
|
+
mdiMagnifyMinusOutline: string;
|
|
45
|
+
mdiMagnifyPlusOutline: string;
|
|
46
|
+
mdiMenuDown: string;
|
|
47
|
+
mdiMessageTextOutline: string;
|
|
48
|
+
mdiMinus: string;
|
|
49
|
+
mdiOpenInNew: string;
|
|
50
|
+
mdiPauseCircleOutline: string;
|
|
51
|
+
mdiPencil: string;
|
|
52
|
+
mdiPlay: string;
|
|
53
|
+
mdiPlayCircleOutline: string;
|
|
54
|
+
mdiPlus: string;
|
|
55
|
+
mdiRadioboxBlank: string;
|
|
56
|
+
mdiRadioboxMarked: string;
|
|
57
|
+
mdiReply: string;
|
|
58
|
+
mdiSend: string;
|
|
59
|
+
mdiStar: string;
|
|
60
|
+
mdiTextBox: string;
|
|
61
|
+
mdiTextBoxPlus: string;
|
|
62
|
+
mdiTram: string;
|
|
63
|
+
mdiTranslate: string;
|
|
64
|
+
mdiViewList: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const AVATAR_IMAGES: {
|
|
2
|
+
avatar1: string;
|
|
3
|
+
avatar2: string;
|
|
4
|
+
avatar3: string;
|
|
5
|
+
avatar4: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const SQUARE_IMAGES: {
|
|
8
|
+
square1: string;
|
|
9
|
+
square2: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const SVG_IMAGES: {
|
|
12
|
+
defaultSvg: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const EMPTY_IMAGES: {
|
|
15
|
+
emptyImage: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const LANDSCAPE_IMAGES: {
|
|
18
|
+
landscape1: string;
|
|
19
|
+
landscape1s200: string;
|
|
20
|
+
landscape2: string;
|
|
21
|
+
landscape3: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const LANDSCAPE_IMAGES_ALT: {
|
|
24
|
+
[key in keyof typeof LANDSCAPE_IMAGES]: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const PORTRAIT_IMAGES: {
|
|
27
|
+
portrait1: string;
|
|
28
|
+
portrait1s200: string;
|
|
29
|
+
portrait2: string;
|
|
30
|
+
portrait3: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const IMAGES: {
|
|
33
|
+
emptyImage: string;
|
|
34
|
+
defaultSvg: string;
|
|
35
|
+
avatar1: string;
|
|
36
|
+
avatar2: string;
|
|
37
|
+
avatar3: string;
|
|
38
|
+
avatar4: string;
|
|
39
|
+
square1: string;
|
|
40
|
+
square2: string;
|
|
41
|
+
portrait1: string;
|
|
42
|
+
portrait1s200: string;
|
|
43
|
+
portrait2: string;
|
|
44
|
+
portrait3: string;
|
|
45
|
+
landscape1: string;
|
|
46
|
+
landscape1s200: string;
|
|
47
|
+
landscape2: string;
|
|
48
|
+
landscape3: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const avatarImageArgType: {
|
|
51
|
+
control: {
|
|
52
|
+
type: "select" | "inline-radio";
|
|
53
|
+
};
|
|
54
|
+
options: string[];
|
|
55
|
+
mapping: Record<string, string> | undefined;
|
|
56
|
+
};
|
|
57
|
+
export declare const squareImageArgType: {
|
|
58
|
+
control: {
|
|
59
|
+
type: "select" | "inline-radio";
|
|
60
|
+
};
|
|
61
|
+
options: string[];
|
|
62
|
+
mapping: Record<string, string> | undefined;
|
|
63
|
+
};
|
|
64
|
+
export declare const landscapeImageArgType: {
|
|
65
|
+
control: {
|
|
66
|
+
type: "select" | "inline-radio";
|
|
67
|
+
};
|
|
68
|
+
options: string[];
|
|
69
|
+
mapping: Record<string, string> | undefined;
|
|
70
|
+
};
|
|
71
|
+
export declare const portraitImageArgType: {
|
|
72
|
+
control: {
|
|
73
|
+
type: "select" | "inline-radio";
|
|
74
|
+
};
|
|
75
|
+
options: string[];
|
|
76
|
+
mapping: Record<string, string> | undefined;
|
|
77
|
+
};
|
|
78
|
+
export declare const imageArgType: {
|
|
79
|
+
control: {
|
|
80
|
+
type: "select" | "inline-radio";
|
|
81
|
+
};
|
|
82
|
+
options: string[];
|
|
83
|
+
mapping: Record<string, string> | undefined;
|
|
84
|
+
};
|
|
85
|
+
type Size = {
|
|
86
|
+
width: number;
|
|
87
|
+
height: number;
|
|
88
|
+
};
|
|
89
|
+
export declare const AVATAR_IMAGE_SIZES: Record<keyof typeof AVATAR_IMAGES, Size>;
|
|
90
|
+
export declare const SQUARE_IMAGE_SIZES: Record<keyof typeof SQUARE_IMAGES, Size>;
|
|
91
|
+
export declare const LANDSCAPE_IMAGE_SIZES: Record<keyof typeof LANDSCAPE_IMAGES, Size>;
|
|
92
|
+
export declare const PORTRAIT_IMAGE_SIZES: Record<keyof typeof PORTRAIT_IMAGES, Size>;
|
|
93
|
+
export declare const SVG_IMAGE_SIZES: Record<keyof typeof SVG_IMAGES, Size>;
|
|
94
|
+
export declare const EMPTY_IMAGES_SIZES: Record<keyof typeof EMPTY_IMAGES, Size>;
|
|
95
|
+
export declare const IMAGE_SIZES: Record<keyof typeof IMAGES, Size>;
|
|
96
|
+
export {};
|