@lumx/core 4.24.1-alpha.1 → 4.24.1-next.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 -6
- package/js/components/Dialog/DialogContent.d.ts +0 -7
- package/js/components/Dialog/DialogShell.d.ts +0 -5
- package/js/components/Dialog/Stories.d.ts +0 -11
- package/js/components/Dialog/index.d.ts +1 -1
- package/js/utils/focus/index.d.ts +0 -2
- package/js/utils/focus/setupFocusTrap.d.ts +14 -4
- package/lumx.css +0 -6
- package/package.json +2 -2
- package/scss/components/dialog/_index.scss +0 -10
- package/js/utils/focus/isFocusWithin.d.ts +0 -10
- package/js/utils/focus/setupInitialFocus.d.ts +0 -29
package/components-and-utils.css
CHANGED
|
@@ -5410,9 +5410,6 @@ table {
|
|
|
5410
5410
|
.lumx-dialog--is-hidden {
|
|
5411
5411
|
opacity: 0;
|
|
5412
5412
|
}
|
|
5413
|
-
.lumx-dialog--is-non-modal {
|
|
5414
|
-
pointer-events: none;
|
|
5415
|
-
}
|
|
5416
5413
|
.lumx-dialog__overlay {
|
|
5417
5414
|
position: absolute;
|
|
5418
5415
|
top: 0;
|
|
@@ -5467,9 +5464,6 @@ table {
|
|
|
5467
5464
|
flex-direction: column;
|
|
5468
5465
|
background-color: var(--lumx-color-light-N);
|
|
5469
5466
|
}
|
|
5470
|
-
.lumx-dialog--is-non-modal .lumx-dialog__wrapper {
|
|
5471
|
-
pointer-events: auto;
|
|
5472
|
-
}
|
|
5473
5467
|
@media (max-width: 61.24em) {
|
|
5474
5468
|
.lumx-dialog__wrapper {
|
|
5475
5469
|
min-height: 100%;
|
|
@@ -52,13 +52,6 @@ export interface DialogContentProps extends BaseDialogProps {
|
|
|
52
52
|
/** ClickAwayProvider component. */
|
|
53
53
|
ClickAwayProvider: any;
|
|
54
54
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Whether the dialog is modal: it is, unless `dialogProps['aria-modal']` is `false` (or `'false'`).
|
|
57
|
-
*
|
|
58
|
-
* @param dialogProps Props of the dialog container element.
|
|
59
|
-
* @return whether the dialog is modal.
|
|
60
|
-
*/
|
|
61
|
-
export declare const isDialogModal: (dialogProps?: GenericProps) => boolean;
|
|
62
55
|
/**
|
|
63
56
|
* Dialog content: the `role="dialog"` element + header/body/footer.
|
|
64
57
|
*
|
|
@@ -18,11 +18,6 @@ export interface DialogShellProps extends HasClassName {
|
|
|
18
18
|
size?: DialogSizes;
|
|
19
19
|
/** Z-axis position. */
|
|
20
20
|
zIndex?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Whether the dialog is modal. Defaults to `true`.
|
|
23
|
-
* A non-modal dialog has no overlay and renders in place (no portal), so it follows the page's focus and reading order.
|
|
24
|
-
*/
|
|
25
|
-
isModal?: boolean;
|
|
26
21
|
/** Content rendered inside the overlay + providers (typically a framework `DialogContent` reader). */
|
|
27
22
|
children?: any;
|
|
28
23
|
/** Portal component for rendering outside the DOM hierarchy. */
|
|
@@ -97,15 +97,4 @@ export declare function setup({ component: Dialog, render, decorators: { withChr
|
|
|
97
97
|
children: string;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
NonModal: {
|
|
101
|
-
args: {
|
|
102
|
-
dialogProps: {
|
|
103
|
-
'aria-modal': boolean;
|
|
104
|
-
};
|
|
105
|
-
header: string;
|
|
106
|
-
footer: string;
|
|
107
|
-
children: string;
|
|
108
|
-
};
|
|
109
|
-
play(): Promise<void>;
|
|
110
|
-
};
|
|
111
100
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { COMPONENT_NAME, CLASSNAME, block, element, DIALOG_LABEL_KEY } from './constants';
|
|
2
2
|
export { type BaseDialogProps, type DialogSizes } from './types';
|
|
3
3
|
export { DialogShell, DEFAULT_PROPS, type DialogShellProps } from './DialogShell';
|
|
4
|
-
export { DialogContent,
|
|
4
|
+
export { DialogContent, type DialogContentProps } from './DialogContent';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { getFirstAndLastFocusable } from './getFirstAndLastFocusable';
|
|
2
2
|
export { getFocusableElements } from './getFocusableElements';
|
|
3
|
-
export { isFocusWithin } from './isFocusWithin';
|
|
4
3
|
export { setupFocusTrap, type SetupFocusTrapOptions } from './setupFocusTrap';
|
|
5
|
-
export { setupInitialFocus, type SetupInitialFocusOptions } from './setupInitialFocus';
|
|
6
4
|
export { TABBABLE_ELEMENTS_SELECTOR, DISABLED_SELECTOR } from './constants';
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
|
|
1
|
+
export interface SetupFocusTrapOptions {
|
|
2
|
+
/** The element in which to trap the focus. */
|
|
3
|
+
focusZoneElement: HTMLElement;
|
|
4
|
+
/**
|
|
5
|
+
* The element to focus when the trap is activated.
|
|
6
|
+
* Falls back to the first focusable element inside the zone, then to the zone element itself.
|
|
7
|
+
*/
|
|
8
|
+
focusElement?: HTMLElement | null;
|
|
9
|
+
}
|
|
4
10
|
/**
|
|
5
11
|
* Trap 'Tab' focus switch inside the `focusZoneElement`.
|
|
6
12
|
*
|
|
7
|
-
* Setup behavior:
|
|
13
|
+
* Setup behavior:
|
|
14
|
+
* 1. Focus `focusElement` if provided and contained in the zone.
|
|
15
|
+
* 2. Otherwise focus the first focusable descendant.
|
|
16
|
+
* 3. Otherwise focus the zone element itself (falling back to setting `tabindex="-1"` if needed) so that
|
|
17
|
+
* keyboard users (especially screen reader users) land inside the trapped region (e.g. an empty dialog).
|
|
8
18
|
*
|
|
9
19
|
* Tab key behavior:
|
|
10
20
|
* - With at least one focusable descendant: focus cycles between the first and last focusable in the zone.
|
package/lumx.css
CHANGED
|
@@ -6091,9 +6091,6 @@ table {
|
|
|
6091
6091
|
.lumx-dialog--is-hidden {
|
|
6092
6092
|
opacity: 0;
|
|
6093
6093
|
}
|
|
6094
|
-
.lumx-dialog--is-non-modal {
|
|
6095
|
-
pointer-events: none;
|
|
6096
|
-
}
|
|
6097
6094
|
.lumx-dialog__overlay {
|
|
6098
6095
|
position: absolute;
|
|
6099
6096
|
top: 0;
|
|
@@ -6148,9 +6145,6 @@ table {
|
|
|
6148
6145
|
flex-direction: column;
|
|
6149
6146
|
background-color: var(--lumx-color-light-N);
|
|
6150
6147
|
}
|
|
6151
|
-
.lumx-dialog--is-non-modal .lumx-dialog__wrapper {
|
|
6152
|
-
pointer-events: auto;
|
|
6153
|
-
}
|
|
6154
6148
|
@media (max-width: 61.24em) {
|
|
6155
6149
|
.lumx-dialog__wrapper {
|
|
6156
6150
|
min-height: 100%;
|
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.24.1-
|
|
10
|
+
"@lumx/icons": "^4.24.1-next.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.24.1-
|
|
69
|
+
"version": "4.24.1-next.0",
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
72
72
|
"@testing-library/dom": "^10.4.1",
|
|
@@ -30,12 +30,6 @@
|
|
|
30
30
|
opacity: 0;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// The root and the container cover more than the visible dialog: let clicks go through to the page, only the
|
|
34
|
-
// visible dialog (the wrapper) catches them.
|
|
35
|
-
&--is-non-modal {
|
|
36
|
-
pointer-events: none;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
33
|
&__overlay {
|
|
40
34
|
position: absolute;
|
|
41
35
|
top: 0;
|
|
@@ -88,10 +82,6 @@
|
|
|
88
82
|
flex-direction: column;
|
|
89
83
|
background-color: lumx-color-variant("light", "N");
|
|
90
84
|
|
|
91
|
-
#{$self}--is-non-modal & {
|
|
92
|
-
pointer-events: auto;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
85
|
@include mq($until: desktop) {
|
|
96
86
|
min-height: 100%;
|
|
97
87
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if the focus is on the given element or inside it.
|
|
3
|
-
*
|
|
4
|
-
* Reads the active element of the element's own root node (Document or ShadowRoot), so it also works when the
|
|
5
|
-
* element lives in a shadow DOM.
|
|
6
|
-
*
|
|
7
|
-
* @param element The element to check.
|
|
8
|
-
* @return whether the active element is the element itself or one of its descendants.
|
|
9
|
-
*/
|
|
10
|
-
export declare function isFocusWithin(element: Element | null | undefined): boolean;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export interface SetupInitialFocusOptions {
|
|
2
|
-
/** The element in which to move the focus. */
|
|
3
|
-
focusZoneElement: HTMLElement;
|
|
4
|
-
/**
|
|
5
|
-
* The element to focus.
|
|
6
|
-
* Falls back to the first focusable element inside the zone, then to the zone element itself.
|
|
7
|
-
*/
|
|
8
|
-
focusElement?: HTMLElement | null;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Focus the zone element itself (last-resort fallback, e.g. an empty dialog).
|
|
12
|
-
*
|
|
13
|
-
* Adds a `tabindex="-1"` if needed to make the zone programmatically focusable, removed when the signal aborts.
|
|
14
|
-
*
|
|
15
|
-
* @param focusZoneElement The zone element.
|
|
16
|
-
* @param signal AbortSignal used to remove the added `tabindex`.
|
|
17
|
-
*/
|
|
18
|
-
export declare function focusZoneFallback(focusZoneElement: HTMLElement, signal: AbortSignal): void;
|
|
19
|
-
/**
|
|
20
|
-
* Move the focus into the `focusZoneElement`:
|
|
21
|
-
* 1. Focus `focusElement` if provided and contained in the zone.
|
|
22
|
-
* 2. Otherwise focus the first focusable descendant.
|
|
23
|
-
* 3. Otherwise focus the zone element itself (falling back to setting `tabindex="-1"` if needed) so that
|
|
24
|
-
* keyboard users (especially screen reader users) land inside the zone (e.g. an empty dialog).
|
|
25
|
-
*
|
|
26
|
-
* @param options Initial focus configuration.
|
|
27
|
-
* @param signal AbortSignal used to tear down (removes the fallback `tabindex` if it was added).
|
|
28
|
-
*/
|
|
29
|
-
export declare function setupInitialFocus(options: SetupInitialFocusOptions, signal: AbortSignal): void;
|