@lumx/core 4.21.0 → 4.21.1-alpha.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/components-and-utils.css +0 -24
- package/js/components/Popover/types.d.ts +4 -1
- package/js/types/index.d.ts +0 -1
- package/js/utils/ClickAway/TestStories.d.ts +3 -0
- package/js/utils/ClickAway/index.d.ts +4 -3
- package/js/utils/ClickAway/isScrollbarPress.d.ts +13 -0
- package/lumx.css +0 -24
- package/package.json +5 -4
- package/scss/_components_classes.scss +0 -1
- package/js/components/Card/Stories.d.ts +0 -41
- package/js/components/Card/Tests.d.ts +0 -12
- package/js/components/Card/index.d.ts +0 -37
- package/js/types/Elevation.d.ts +0 -4
- package/scss/components/card/_index.scss +0 -15
package/components-and-utils.css
CHANGED
|
@@ -4436,30 +4436,6 @@ table {
|
|
|
4436
4436
|
width: 100%;
|
|
4437
4437
|
}
|
|
4438
4438
|
|
|
4439
|
-
/* ==========================================================================
|
|
4440
|
-
Card
|
|
4441
|
-
========================================================================== */
|
|
4442
|
-
.lumx-card {
|
|
4443
|
-
background-color: rgb(255, 255, 255);
|
|
4444
|
-
border-radius: var(--lumx-border-radius);
|
|
4445
|
-
padding: 24px;
|
|
4446
|
-
}
|
|
4447
|
-
.lumx-card--elevation-1 {
|
|
4448
|
-
box-shadow: 0 0 2px 0 var(--lumx-color-dark-L4);
|
|
4449
|
-
}
|
|
4450
|
-
.lumx-card--elevation-2 {
|
|
4451
|
-
box-shadow: 0 1px 4px 0 var(--lumx-color-dark-L4);
|
|
4452
|
-
}
|
|
4453
|
-
.lumx-card--elevation-3 {
|
|
4454
|
-
box-shadow: 0 2px 8px 0 var(--lumx-color-dark-L4);
|
|
4455
|
-
}
|
|
4456
|
-
.lumx-card--elevation-4 {
|
|
4457
|
-
box-shadow: 0 4px 16px 0 var(--lumx-color-dark-L4);
|
|
4458
|
-
}
|
|
4459
|
-
.lumx-card--elevation-5 {
|
|
4460
|
-
box-shadow: 0 8px 32px 0 var(--lumx-color-dark-L4);
|
|
4461
|
-
}
|
|
4462
|
-
|
|
4463
4439
|
/* ==========================================================================
|
|
4464
4440
|
Checkbox
|
|
4465
4441
|
========================================================================== */
|
|
@@ -9,7 +9,10 @@ export interface Offset {
|
|
|
9
9
|
/** Offset size away from the reference. */
|
|
10
10
|
away?: number;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Popover elevation index.
|
|
14
|
+
*/
|
|
15
|
+
export type Elevation = 1 | 2 | 3 | 4 | 5;
|
|
13
16
|
/** Popover size value — pixel value, or "t-shirt" size token. */
|
|
14
17
|
export type PopoverSize = PXSize | (typeof POPOVER_SIZES)[number];
|
|
15
18
|
/** Popover height value — extends PopoverSize with viewport-relative unit. */
|
package/js/types/index.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export type { TextElement } from './TextElement';
|
|
|
14
14
|
export type { ValueOf } from './ValueOf';
|
|
15
15
|
export type { LumxClassName } from './LumxClassName';
|
|
16
16
|
export type { Direction } from './Direction';
|
|
17
|
-
export type { Elevation } from './Elevation';
|
|
18
17
|
export type { Spacing } from './Spacing';
|
|
19
18
|
export type { NestedComponents, ComponentLike } from './NestedComponents';
|
|
20
19
|
export type { ObjectValues } from './ObjectValues';
|
|
@@ -25,6 +25,9 @@ export declare function setup({ component: ClickAwayProvider, components: { Port
|
|
|
25
25
|
InShadowDOM: {
|
|
26
26
|
render: () => import("react").JSX.Element;
|
|
27
27
|
};
|
|
28
|
+
ScrollableClickAway: {
|
|
29
|
+
render: () => import("react").JSX.Element;
|
|
30
|
+
};
|
|
28
31
|
TestClickAwayCloses: {
|
|
29
32
|
render: () => import("react").JSX.Element;
|
|
30
33
|
play(): Promise<void>;
|
|
@@ -12,13 +12,14 @@ export declare const CLICK_AWAY_EVENT_TYPES: readonly ["mousedown", "touchstart"
|
|
|
12
12
|
/** Callback triggered when a click away is detected. */
|
|
13
13
|
export type ClickAwayCallback = EventListener | Falsy;
|
|
14
14
|
/**
|
|
15
|
-
* Check if
|
|
15
|
+
* Check if a press event is a click away from all the given elements.
|
|
16
16
|
*
|
|
17
|
+
* @param event - The press event.
|
|
17
18
|
* @param targets - The event target elements (from `event.target` and `event.composedPath()`).
|
|
18
19
|
* @param elements - The elements considered "inside" the click away context.
|
|
19
|
-
* @returns `true` if the
|
|
20
|
+
* @returns `true` if the press is a click away.
|
|
20
21
|
*/
|
|
21
|
-
export declare function isClickAway(targets: HTMLElement[], elements: HTMLElement[]): boolean;
|
|
22
|
+
export declare function isClickAway(event: Event, targets: HTMLElement[], elements: HTMLElement[]): boolean;
|
|
22
23
|
/**
|
|
23
24
|
* Imperative setup for click away detection.
|
|
24
25
|
* Adds mousedown/touchstart listeners on `document` and calls the callback when a click
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a mouse press landed in the scrollbar gutter of the element it targets.
|
|
3
|
+
*
|
|
4
|
+
* A browser dispatches a `mousedown` on the scrolling element when you press its scrollbar, and that
|
|
5
|
+
* element is an ancestor of any popover it holds, so click away detection has to ignore the press.
|
|
6
|
+
*
|
|
7
|
+
* Touch is out of scope: a touch has no scrollbar to hit, and `TouchEvent` carries no coordinates.
|
|
8
|
+
*
|
|
9
|
+
* @param event - The press event.
|
|
10
|
+
* @param target - The element the press landed on.
|
|
11
|
+
* @returns `true` if the press landed on a scrollbar of `target`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isScrollbarPress(event: Event, target: EventTarget | null): boolean;
|
package/lumx.css
CHANGED
|
@@ -5117,30 +5117,6 @@ table {
|
|
|
5117
5117
|
width: 100%;
|
|
5118
5118
|
}
|
|
5119
5119
|
|
|
5120
|
-
/* ==========================================================================
|
|
5121
|
-
Card
|
|
5122
|
-
========================================================================== */
|
|
5123
|
-
.lumx-card {
|
|
5124
|
-
background-color: rgb(255, 255, 255);
|
|
5125
|
-
border-radius: var(--lumx-border-radius);
|
|
5126
|
-
padding: 24px;
|
|
5127
|
-
}
|
|
5128
|
-
.lumx-card--elevation-1 {
|
|
5129
|
-
box-shadow: 0 0 2px 0 var(--lumx-color-dark-L4);
|
|
5130
|
-
}
|
|
5131
|
-
.lumx-card--elevation-2 {
|
|
5132
|
-
box-shadow: 0 1px 4px 0 var(--lumx-color-dark-L4);
|
|
5133
|
-
}
|
|
5134
|
-
.lumx-card--elevation-3 {
|
|
5135
|
-
box-shadow: 0 2px 8px 0 var(--lumx-color-dark-L4);
|
|
5136
|
-
}
|
|
5137
|
-
.lumx-card--elevation-4 {
|
|
5138
|
-
box-shadow: 0 4px 16px 0 var(--lumx-color-dark-L4);
|
|
5139
|
-
}
|
|
5140
|
-
.lumx-card--elevation-5 {
|
|
5141
|
-
box-shadow: 0 8px 32px 0 var(--lumx-color-dark-L4);
|
|
5142
|
-
}
|
|
5143
|
-
|
|
5144
5120
|
/* ==========================================================================
|
|
5145
5121
|
Checkbox
|
|
5146
5122
|
========================================================================== */
|
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.21.0",
|
|
10
|
+
"@lumx/icons": "^4.21.1-alpha.0",
|
|
11
11
|
"classnames": "^2.3.2",
|
|
12
12
|
"focus-visible": "^5.0.2",
|
|
13
13
|
"lodash": "4.18.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"update-version-changelog": "yarn version-changelog ../../CHANGELOG.md"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
|
-
"version": "4.21.0",
|
|
69
|
+
"version": "4.21.1-alpha.0",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"autoprefixer": "^9.7.4",
|
|
77
77
|
"glob": "^7.1.6",
|
|
78
78
|
"jsdom": "^27.2.0",
|
|
79
|
-
"postcss": "^8.5.
|
|
79
|
+
"postcss": "^8.5.11",
|
|
80
80
|
"rollup": "^4.59.0",
|
|
81
81
|
"rollup-plugin-cleaner": "^1.0.0",
|
|
82
82
|
"rollup-plugin-copy": "^3.5.0",
|
|
@@ -89,5 +89,6 @@
|
|
|
89
89
|
"vite": "^7.3.5",
|
|
90
90
|
"vite-tsconfig-paths": "^5.1.4",
|
|
91
91
|
"vitest": "^4.1.10"
|
|
92
|
-
}
|
|
92
|
+
},
|
|
93
|
+
"stableVersion": "4.20.0"
|
|
93
94
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@import "./components/avatar/index";
|
|
2
2
|
@import "./components/badge/index";
|
|
3
3
|
@import "./components/button/index";
|
|
4
|
-
@import "./components/card/index";
|
|
5
4
|
@import "./components/checkbox/index";
|
|
6
5
|
@import "./components/chip/index";
|
|
7
6
|
@import "./components/combobox/index";
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { SetupStoriesOptions } from '@lumx/core/stories/types';
|
|
2
|
-
import { Elevation } from '../../types';
|
|
3
|
-
/**
|
|
4
|
-
* Setup Card stories for a specific framework (React or Vue).
|
|
5
|
-
* This function creates all the stories with the appropriate decorators.
|
|
6
|
-
* Framework-specific render functions or args can be injected via `overrides`.
|
|
7
|
-
*/
|
|
8
|
-
export declare function setup({ component: Card, }: SetupStoriesOptions<{
|
|
9
|
-
decorators?: never;
|
|
10
|
-
}>): {
|
|
11
|
-
meta: {
|
|
12
|
-
component: any;
|
|
13
|
-
render: (args: any) => import("react").JSX.Element;
|
|
14
|
-
args: {
|
|
15
|
-
readonly as: "div";
|
|
16
|
-
};
|
|
17
|
-
argTypes: {
|
|
18
|
-
elevation: {
|
|
19
|
-
control: {
|
|
20
|
-
type: "select" | "inline-radio";
|
|
21
|
-
};
|
|
22
|
-
options: Elevation[];
|
|
23
|
-
mapping: Record<string, Elevation> | undefined;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
/** Default card */
|
|
28
|
-
Default: {};
|
|
29
|
-
/** Elevated card */
|
|
30
|
-
Elevation: {
|
|
31
|
-
args: {
|
|
32
|
-
elevation: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
/** Card rendered as a custom element */
|
|
36
|
-
AsElement: {
|
|
37
|
-
args: {
|
|
38
|
-
as: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { SetupOptions } from '../../../testing';
|
|
2
|
-
import { CardProps } from '.';
|
|
3
|
-
type SetupProps = Partial<CardProps>;
|
|
4
|
-
/**
|
|
5
|
-
* Mounts the component and returns common DOM elements / data needed in multiple tests further down.
|
|
6
|
-
*/
|
|
7
|
-
export declare const setup: (propsOverride: SetupProps | undefined, { render, ...options }: SetupOptions<CardProps>) => {
|
|
8
|
-
card: HTMLElement;
|
|
9
|
-
props: CardProps;
|
|
10
|
-
};
|
|
11
|
-
declare const _default: (renderOptions: SetupOptions<CardProps>) => void;
|
|
12
|
-
export default _default;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { LumxClassName, HasClassName, CommonRef, JSXElement, Elevation } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* Defines the props of the component.
|
|
4
|
-
*/
|
|
5
|
-
export interface CardProps extends HasClassName {
|
|
6
|
-
/** Customize the rendered root element (e.g. `div`, `article`, `section`, `li`, `aside`), defaults to `div`. */
|
|
7
|
-
as?: any;
|
|
8
|
-
/** Content of the card. */
|
|
9
|
-
children?: JSXElement;
|
|
10
|
-
/** Elevation depth of the card, defaults to no elevation. */
|
|
11
|
-
elevation?: Elevation;
|
|
12
|
-
/** reference to the root element */
|
|
13
|
-
ref?: CommonRef;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Component display name.
|
|
17
|
-
*/
|
|
18
|
-
export declare const COMPONENT_NAME = "Card";
|
|
19
|
-
/**
|
|
20
|
-
* Component default class name and class prefix.
|
|
21
|
-
*/
|
|
22
|
-
export declare const CLASSNAME: LumxClassName<typeof COMPONENT_NAME>;
|
|
23
|
-
/**
|
|
24
|
-
* Component default props.
|
|
25
|
-
*/
|
|
26
|
-
export declare const DEFAULT_PROPS: {
|
|
27
|
-
readonly as: "div";
|
|
28
|
-
};
|
|
29
|
-
/** Root element rendered when no `as` prop is provided. */
|
|
30
|
-
export type DefaultCardTag = typeof DEFAULT_PROPS.as;
|
|
31
|
-
/**
|
|
32
|
-
* Card component.
|
|
33
|
-
*
|
|
34
|
-
* @param props Component props.
|
|
35
|
-
* @return JSX element.
|
|
36
|
-
*/
|
|
37
|
-
export declare const Card: (props: CardProps) => import("react").JSX.Element;
|
package/js/types/Elevation.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* ==========================================================================
|
|
2
|
-
Card
|
|
3
|
-
========================================================================== */
|
|
4
|
-
|
|
5
|
-
.#{$lumx-base-prefix}-card {
|
|
6
|
-
background-color: $lumx-color-light-N;
|
|
7
|
-
border-radius: var(--lumx-border-radius);
|
|
8
|
-
padding: $lumx-spacing-unit-huge;
|
|
9
|
-
|
|
10
|
-
@each $depth, $shadow in $lumx-elevation-shadows {
|
|
11
|
-
&--elevation-#{$depth} {
|
|
12
|
-
@include lumx-elevation($depth);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|