@lumx/core 4.3.2-alpha.8 → 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.
Files changed (97) hide show
  1. package/js/components/Badge/BadgeWrapperTests.d.ts +9 -0
  2. package/js/components/Badge/Tests.d.ts +12 -0
  3. package/js/components/Button/Button.d.ts +48 -0
  4. package/js/components/Button/ButtonRoot.d.ts +55 -0
  5. package/js/components/Button/ButtonRootTests.d.ts +12 -0
  6. package/js/components/Button/IconButton.d.ts +45 -0
  7. package/js/components/Button/IconButtonTests.d.ts +15 -0
  8. package/js/components/Button/Tests.d.ts +15 -0
  9. package/js/components/Checkbox/Tests.d.ts +15 -0
  10. package/js/components/Checkbox/index.d.ts +49 -0
  11. package/js/components/Divider/Tests.d.ts +12 -0
  12. package/js/components/Divider/index.d.ts +27 -0
  13. package/js/components/Flag/Tests.d.ts +14 -0
  14. package/js/components/Flag/index.d.ts +34 -0
  15. package/js/components/FlexBox/Tests.d.ts +13 -0
  16. package/js/components/FlexBox/constants.d.ts +4 -0
  17. package/js/components/FlexBox/index.d.ts +50 -0
  18. package/js/components/FlexBox/types.d.ts +7 -0
  19. package/js/components/GridColumn/GridColumn.d.ts +48 -0
  20. package/js/components/GridColumn/GridColumnTests.d.ts +12 -0
  21. package/js/components/Heading/Tests.d.ts +11 -0
  22. package/js/components/Heading/constants.d.ts +21 -0
  23. package/js/components/Heading/index.d.ts +44 -0
  24. package/js/components/Heading/utils.d.ts +8 -0
  25. package/js/components/Icon/Tests.d.ts +14 -0
  26. package/js/components/Icon/constants.d.ts +1 -0
  27. package/js/components/Icon/index.d.ts +41 -0
  28. package/js/components/InputHelper/Tests.d.ts +12 -0
  29. package/js/components/InputHelper/constants.d.ts +3 -0
  30. package/js/components/InputHelper/index.d.ts +26 -0
  31. package/js/components/InputLabel/Tests.d.ts +12 -0
  32. package/js/components/InputLabel/index.d.ts +25 -0
  33. package/js/components/Link/Tests.d.ts +8 -0
  34. package/js/components/Message/Tests.d.ts +14 -0
  35. package/js/components/Message/index.d.ts +75 -0
  36. package/js/components/ProgressCircular/Stories.d.ts +30 -0
  37. package/js/components/ProgressCircular/Tests.d.ts +11 -0
  38. package/js/components/ProgressCircular/index.d.ts +52 -0
  39. package/js/components/ProgressLinear/Stories.d.ts +11 -0
  40. package/js/components/ProgressLinear/Tests.d.ts +11 -0
  41. package/js/components/ProgressLinear/index.d.ts +27 -0
  42. package/js/components/RadioButton/Tests.d.ts +15 -0
  43. package/js/components/RadioButton/index.d.ts +45 -0
  44. package/js/components/RawClickable/Tests.d.ts +14 -0
  45. package/js/components/RawClickable/index.d.ts +14 -0
  46. package/js/components/Skeleton/SkeletonCircle.d.ts +32 -0
  47. package/js/components/Skeleton/SkeletonCircleTests.d.ts +12 -0
  48. package/js/components/Skeleton/SkeletonRectangle.d.ts +47 -0
  49. package/js/components/Skeleton/SkeletonRectangleTests.d.ts +13 -0
  50. package/js/components/Skeleton/SkeletonTypography.d.ts +37 -0
  51. package/js/components/Skeleton/SkeletonTypographyTests.d.ts +13 -0
  52. package/js/components/Skeleton/index.d.ts +3 -0
  53. package/js/components/Switch/Tests.d.ts +15 -0
  54. package/js/components/Switch/index.d.ts +47 -0
  55. package/js/components/Table/TableCell.d.ts +55 -0
  56. package/js/components/Table/TableCellTests.d.ts +11 -0
  57. package/js/components/Table/Tests.d.ts +11 -0
  58. package/js/components/Table/constants.d.ts +9 -0
  59. package/js/components/Text/Tests.d.ts +10 -0
  60. package/js/components/Text/index.d.ts +935 -0
  61. package/js/components/Thumbnail/Tests.d.ts +11 -0
  62. package/js/components/Thumbnail/index.d.ts +84 -0
  63. package/js/components/Thumbnail/types.d.ts +45 -0
  64. package/js/components/Thumbnail/utils.d.ts +79 -0
  65. package/js/components/Toolbar/Tests.d.ts +12 -0
  66. package/js/constants/enums/index.d.ts +9 -0
  67. package/js/constants/enums/index.js +10 -1
  68. package/js/constants/index.js +1 -1
  69. package/js/types/AriaAttributes.d.ts +29 -2
  70. package/js/types/PartialBy.d.ts +12 -0
  71. package/js/types/index.d.ts +2 -0
  72. package/js/types/jsx/PropsToOverride.d.ts +2 -0
  73. package/js/utils/classNames/bem/block.d.ts +3 -2
  74. package/js/utils/classNames/bem/element.d.ts +3 -2
  75. package/js/utils/classNames/bem/index.d.ts +5 -4
  76. package/package.json +32 -9
  77. package/stories/controls/color.d.ts +15 -0
  78. package/stories/controls/element.d.ts +16 -0
  79. package/stories/controls/focusPoint.d.ts +8 -0
  80. package/stories/controls/icons.d.ts +66 -0
  81. package/stories/controls/image.d.ts +96 -0
  82. package/stories/controls/selectArgType.d.ts +7 -0
  83. package/stories/controls/theme.d.ts +7 -0
  84. package/stories/controls/typography.d.ts +8 -0
  85. package/stories/controls/withUndefined.d.ts +1 -0
  86. package/stories/types.d.ts +48 -0
  87. package/stories/utils/combinations.d.ts +100 -0
  88. package/stories/utils/concatPath.d.ts +10 -0
  89. package/stories/utils/disableArgTypes.d.ts +7 -0
  90. package/stories/utils/initDemoShadowDOMPortal.d.ts +5 -0
  91. package/stories/utils/lorem.d.ts +7 -0
  92. package/stories/utils/toFlattenProps.d.ts +12 -0
  93. package/stories/utils/withCategory.d.ts +4 -0
  94. package/testing/commonTestsSuiteTL.d.ts +87 -0
  95. package/testing/index.d.ts +1 -0
  96. package/testing/queries.d.ts +4 -0
  97. package/js/utils/events/index.js +0 -2
@@ -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;
@@ -198,3 +198,12 @@ export declare const ColorVariant: {
198
198
  export type ColorVariant = ValueOf<typeof ColorVariant>;
199
199
  /** ColorPalette with all possible color variant combination */
200
200
  export type ColorWithVariants = ColorPalette | Exclude<`${ColorPalette}-${ColorVariant}`, `light-D${number}` | `dark-D${number}`>;
201
+ export declare const REAL_SIZE_FOR_LUMX_SIZE: {
202
+ xxs: number;
203
+ xs: number;
204
+ s: number;
205
+ m: number;
206
+ l: number;
207
+ xl: number;
208
+ xxl: number;
209
+ };
@@ -151,5 +151,14 @@ const ColorVariant = {
151
151
  L6: 'L6',
152
152
  N: 'N',
153
153
  };
154
+ const REAL_SIZE_FOR_LUMX_SIZE = {
155
+ [Size.xxs]: 14,
156
+ [Size.xs]: 20,
157
+ [Size.s]: 24,
158
+ [Size.m]: 36,
159
+ [Size.l]: 64,
160
+ [Size.xl]: 128,
161
+ [Size.xxl]: 256,
162
+ };
154
163
 
155
- export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
164
+ export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace };
@@ -1,4 +1,4 @@
1
1
  export { BACKSPACE_KEY_CODE, DOWN_KEY_CODE, ENTER_KEY_CODE, ESCAPE_KEY_CODE, LEFT_KEY_CODE, RIGHT_KEY_CODE, SPACE_KEY_CODE, TAB_KEY_CODE, UP_KEY_CODE } from './keycodes/index.js';
2
2
  export { DIALOG_TRANSITION_DURATION, EXPANSION_PANEL_TRANSITION_DURATION, NOTIFICATION_TRANSITION_DURATION, SLIDESHOW_TRANSITION_DURATION, TOOLTIP_HOVER_DELAY, TOOLTIP_LONG_PRESS_DELAY } from './components/index.js';
3
- export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
3
+ export { Alignment, AspectRatio, ColorPalette, ColorVariant, Emphasis, Kind, Orientation, REAL_SIZE_FOR_LUMX_SIZE, Size, Theme, Typography, TypographyCustom, TypographyInterface, TypographyTitleCustom, WhiteSpace } from './enums/index.js';
4
4
  export { VISUALLY_HIDDEN } from './className/index.js';
@@ -1,2 +1,29 @@
1
- import type { AriaAttributes } from 'react';
2
- export type { AriaAttributes };
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
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Same as `Partial` but for one property only.
3
+ *
4
+ * @example PartialBy<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as optional.
5
+ */
6
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
7
+ /**
8
+ * Same as `Partial` but for all except some properties only.
9
+ *
10
+ * @example PartialExcept<Foo, 'bar'> => produces a type almost identical to `Foo` but with the `bar` property as it is on the original type.
11
+ */
12
+ export type PartialExcept<T, K extends keyof T> = Pick<T, K> & Partial<Omit<T, K>>;
@@ -25,3 +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';
29
+ export type { PartialBy, PartialExcept } from './PartialBy';
@@ -0,0 +1,2 @@
1
+ /** list of generic props defined on JSX that need to be redefined for each framework */
2
+ export type PropsToOverride = 'ref' | 'handleClick' | 'handleChange' | 'handleKeyPress';
@@ -1,3 +1,4 @@
1
+ import { ClassValue } from 'classnames/types';
1
2
  import { type Modifier } from './modifier';
2
3
  /**
3
4
  * Generates a BEM block + modifier class name string.
@@ -11,5 +12,5 @@ import { type Modifier } from './modifier';
11
12
  * block('button'); // 'button'
12
13
  * block('button', { active: true, disabled: false }); // 'button button--active'
13
14
  */
14
- export declare function block(baseName: string, additionalClasses: string[]): string;
15
- export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: string[]): string;
15
+ export declare function block(baseName: string, additionalClasses: ClassValue[]): string;
16
+ export declare function block(baseName: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
@@ -1,3 +1,4 @@
1
+ import { ClassValue } from 'classnames/types';
1
2
  import type { Modifier } from './modifier';
2
3
  /**
3
4
  * Creates a BEM element class generator function for the given base class.
@@ -12,5 +13,5 @@ import type { Modifier } from './modifier';
12
13
  * element('my-button', 'icon'); // 'my-button__icon'
13
14
  * element('my-button', 'icon', { active: true }); // 'my-button__icon my-button__icon--active'
14
15
  */
15
- export declare function element(baseClass: string, elem: string, additionalClasses: string[]): string;
16
- export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?: string[]): string;
16
+ export declare function element(baseClass: string, elem: string, additionalClasses: ClassValue[]): string;
17
+ export declare function element(baseClass: string, elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
@@ -1,3 +1,4 @@
1
+ import { ClassValue } from 'classnames/types';
1
2
  import { block } from './block';
2
3
  import { element } from './element';
3
4
  import { type Modifier } from './modifier';
@@ -6,12 +7,12 @@ import { type Modifier } from './modifier';
6
7
  */
7
8
  export declare function bem(baseName: string): {
8
9
  block: {
9
- (additionalClasses: string[]): string;
10
- (modifiers?: Modifier, additionalClasses?: string[]): string;
10
+ (additionalClasses: ClassValue[]): string;
11
+ (modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
11
12
  };
12
13
  element: {
13
- (elem: string, additionalClasses: string[]): string;
14
- (elem: string, modifiers?: Modifier, additionalClasses?: string[]): string;
14
+ (elem: string, additionalClasses: ClassValue[]): string;
15
+ (elem: string, modifiers?: Modifier, additionalClasses?: ClassValue[]): string;
15
16
  };
16
17
  modifier: (modifiers: Modifier) => string;
17
18
  };
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.3.2-alpha.8",
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,11 +22,35 @@
22
22
  "license": "MIT",
23
23
  "type": "module",
24
24
  "name": "@lumx/core",
25
- "exports": [
26
- "./js/constants/*",
27
- "./js/types/*",
28
- "./js/utils/*"
29
- ],
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
+ },
30
54
  "publishConfig": {
31
55
  "directory": "dist"
32
56
  },
@@ -42,7 +66,7 @@
42
66
  "update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
43
67
  },
44
68
  "sideEffects": false,
45
- "version": "4.3.2-alpha.8",
69
+ "version": "4.4.0",
46
70
  "devDependencies": {
47
71
  "@rollup/plugin-typescript": "^12.3.0",
48
72
  "@testing-library/dom": "^10.4.1",
@@ -65,6 +89,5 @@
65
89
  "vite": "^7.3.1",
66
90
  "vite-tsconfig-paths": "^5.1.4",
67
91
  "vitest": "^4.0.18"
68
- },
69
- "stableVersion": "4.3.1"
92
+ }
70
93
  }
@@ -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,8 @@
1
+ export declare const focusPoint: {
2
+ control: {
3
+ type: string;
4
+ min: number;
5
+ max: number;
6
+ step: number;
7
+ };
8
+ };
@@ -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 {};
@@ -0,0 +1,7 @@
1
+ export declare const getSelectArgType: <E>(options: Array<E> | Record<string, E>, type?: "select" | "inline-radio") => {
2
+ control: {
3
+ type: "select" | "inline-radio";
4
+ };
5
+ options: E[];
6
+ mapping: Record<string, E> | undefined;
7
+ };