@ds-gn/ui 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +155 -2
- package/THIRD_PARTY_NOTICES +167 -0
- package/assets/logo-full-dark.svg +4 -0
- package/assets/logo-full.svg +4 -0
- package/assets/logo-mark.svg +3 -0
- package/custom-elements.json +4696 -0
- package/dist/common/Base/Base.d.ts +22 -0
- package/dist/common/controllers/AuroraMeshController.d.ts +68 -0
- package/dist/common/controllers/AutoRotateController.d.ts +38 -0
- package/dist/common/controllers/BreakpointController.d.ts +30 -0
- package/dist/common/controllers/LayoutChangeController.d.ts +28 -0
- package/dist/common/controllers/WordCycleController.d.ts +36 -0
- package/dist/common/helpers/aurora-mesh.d.ts +11 -0
- package/dist/common/helpers/define-element.d.ts +14 -0
- package/dist/common/helpers/enum-creator.d.ts +2 -0
- package/dist/common/helpers/enum-validator.d.ts +1 -0
- package/dist/common/helpers/layout-change.d.ts +39 -0
- package/dist/common/helpers/layout-change.testing.d.ts +15 -0
- package/dist/common/helpers/logo.string.d.ts +23 -0
- package/dist/common/helpers/logo.string.js +43 -0
- package/dist/common/helpers/logo.utils.d.ts +8 -0
- package/dist/common/helpers/motion.d.ts +9 -0
- package/dist/common/helpers/story.utils.d.ts +32 -0
- package/dist/common/props/surface/surface.props.d.ts +6 -0
- package/dist/components/Background/src/Background.d.ts +44 -0
- package/dist/components/Background/src/Background.js +576 -0
- package/dist/components/Background/src/Background.props.d.ts +20 -0
- package/dist/components/Background/src/Background.props.js +47 -0
- package/dist/components/Background/src/Background.styles.d.ts +3 -0
- package/dist/components/Badge/src/Badge.d.ts +28 -0
- package/dist/components/Badge/src/Badge.js +429 -0
- package/dist/components/Badge/src/Badge.playground.d.ts +2 -0
- package/dist/components/Badge/src/Badge.props.d.ts +16 -0
- package/dist/components/Badge/src/Badge.props.js +44 -0
- package/dist/components/Badge/src/Badge.styles.d.ts +2 -0
- package/dist/components/Button/src/Button.d.ts +138 -0
- package/dist/components/Button/src/Button.js +1102 -0
- package/dist/components/Button/src/Button.playground.d.ts +2 -0
- package/dist/components/Button/src/Button.props.d.ts +47 -0
- package/dist/components/Button/src/Button.props.js +79 -0
- package/dist/components/Button/src/Button.styles.d.ts +11 -0
- package/dist/components/Card/src/Card.d.ts +39 -0
- package/dist/components/Card/src/Card.js +564 -0
- package/dist/components/Card/src/Card.playground.d.ts +2 -0
- package/dist/components/Card/src/Card.props.d.ts +22 -0
- package/dist/components/Card/src/Card.props.js +42 -0
- package/dist/components/Card/src/Card.styles.d.ts +11 -0
- package/dist/components/CodeBlock/src/CodeBlock.d.ts +18 -0
- package/dist/components/CodeBlock/src/CodeBlock.js +372 -0
- package/dist/components/CodeBlock/src/CodeBlock.props.d.ts +1 -0
- package/dist/components/CodeBlock/src/CodeBlock.props.js +5 -0
- package/dist/components/CodeBlock/src/CodeBlock.styles.d.ts +9 -0
- package/dist/components/Container/src/Container.d.ts +26 -0
- package/dist/components/Container/src/Container.js +354 -0
- package/dist/components/Container/src/Container.props.d.ts +20 -0
- package/dist/components/Container/src/Container.props.js +49 -0
- package/dist/components/Container/src/Container.styles.d.ts +2 -0
- package/dist/components/Divider/src/Divider.d.ts +23 -0
- package/dist/components/Divider/src/Divider.js +250 -0
- package/dist/components/Divider/src/Divider.props.d.ts +7 -0
- package/dist/components/Divider/src/Divider.props.js +34 -0
- package/dist/components/Divider/src/Divider.styles.d.ts +2 -0
- package/dist/components/FeatureItem/src/FeatureItem.d.ts +30 -0
- package/dist/components/FeatureItem/src/FeatureItem.js +368 -0
- package/dist/components/FeatureItem/src/FeatureItem.props.d.ts +10 -0
- package/dist/components/FeatureItem/src/FeatureItem.props.js +37 -0
- package/dist/components/FeatureItem/src/FeatureItem.styles.d.ts +3 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.d.ts +48 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.js +1333 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.props.d.ts +27 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.props.js +80 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.styles.d.ts +35 -0
- package/dist/components/Footer/src/Footer.d.ts +39 -0
- package/dist/components/Footer/src/Footer.js +361 -0
- package/dist/components/Footer/src/Footer.styles.d.ts +6 -0
- package/dist/components/FormBlock/src/FormBlock.d.ts +40 -0
- package/dist/components/FormBlock/src/FormBlock.js +476 -0
- package/dist/components/FormBlock/src/FormBlock.props.d.ts +5 -0
- package/dist/components/FormBlock/src/FormBlock.props.js +8 -0
- package/dist/components/FormBlock/src/FormBlock.styles.d.ts +6 -0
- package/dist/components/Grid/src/Grid.d.ts +35 -0
- package/dist/components/Grid/src/Grid.js +381 -0
- package/dist/components/Grid/src/Grid.props.d.ts +28 -0
- package/dist/components/Grid/src/Grid.props.js +57 -0
- package/dist/components/Grid/src/Grid.styles.d.ts +3 -0
- package/dist/components/Heading/src/Heading.d.ts +26 -0
- package/dist/components/Heading/src/Heading.js +755 -0
- package/dist/components/Heading/src/Heading.playground.d.ts +2 -0
- package/dist/components/Heading/src/Heading.props.d.ts +19 -0
- package/dist/components/Heading/src/Heading.props.js +47 -0
- package/dist/components/Heading/src/Heading.styles.d.ts +4 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.d.ts +28 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.js +288 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.playground.d.ts +2 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.props.d.ts +6 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.props.js +33 -0
- package/dist/components/HeadingBlock/src/HeadingBlock.styles.d.ts +2 -0
- package/dist/components/Hero/src/Hero.d.ts +42 -0
- package/dist/components/Hero/src/Hero.js +506 -0
- package/dist/components/Hero/src/Hero.props.d.ts +22 -0
- package/dist/components/Hero/src/Hero.props.js +51 -0
- package/dist/components/Hero/src/Hero.styles.d.ts +10 -0
- package/dist/components/Icon/src/Icon.d.ts +67 -0
- package/dist/components/Icon/src/Icon.js +303 -0
- package/dist/components/Icon/src/Icon.props.d.ts +8 -0
- package/dist/components/Icon/src/Icon.props.js +35 -0
- package/dist/components/Icon/src/Icon.styles.d.ts +3 -0
- package/dist/components/Icon/src/icons/arrow-left.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-left.js +6 -0
- package/dist/components/Icon/src/icons/arrow-right.d.ts +1 -0
- package/dist/components/Icon/src/icons/arrow-right.js +6 -0
- package/dist/components/Icon/src/icons/calendar.d.ts +1 -0
- package/dist/components/Icon/src/icons/calendar.js +6 -0
- package/dist/components/Icon/src/icons/check.d.ts +1 -0
- package/dist/components/Icon/src/icons/check.js +6 -0
- package/dist/components/Icon/src/icons/chevron-down.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-down.js +6 -0
- package/dist/components/Icon/src/icons/chevron-left.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-left.js +6 -0
- package/dist/components/Icon/src/icons/chevron-right.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-right.js +6 -0
- package/dist/components/Icon/src/icons/chevron-up.d.ts +1 -0
- package/dist/components/Icon/src/icons/chevron-up.js +6 -0
- package/dist/components/Icon/src/icons/circle-alert.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-alert.js +6 -0
- package/dist/components/Icon/src/icons/circle-check.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-check.js +6 -0
- package/dist/components/Icon/src/icons/circle-x.d.ts +1 -0
- package/dist/components/Icon/src/icons/circle-x.js +6 -0
- package/dist/components/Icon/src/icons/copy.d.ts +1 -0
- package/dist/components/Icon/src/icons/copy.js +6 -0
- package/dist/components/Icon/src/icons/download.d.ts +1 -0
- package/dist/components/Icon/src/icons/download.js +6 -0
- package/dist/components/Icon/src/icons/ellipsis-vertical.d.ts +1 -0
- package/dist/components/Icon/src/icons/ellipsis-vertical.js +6 -0
- package/dist/components/Icon/src/icons/ellipsis.d.ts +1 -0
- package/dist/components/Icon/src/icons/ellipsis.js +6 -0
- package/dist/components/Icon/src/icons/external-link.d.ts +1 -0
- package/dist/components/Icon/src/icons/external-link.js +6 -0
- package/dist/components/Icon/src/icons/eye-off.d.ts +1 -0
- package/dist/components/Icon/src/icons/eye-off.js +6 -0
- package/dist/components/Icon/src/icons/eye.d.ts +1 -0
- package/dist/components/Icon/src/icons/eye.js +6 -0
- package/dist/components/Icon/src/icons/icon-names.d.ts +2 -0
- package/dist/components/Icon/src/icons/icon-names.js +36 -0
- package/dist/components/Icon/src/icons/index.d.ts +34 -0
- package/dist/components/Icon/src/icons/index.js +35 -0
- package/dist/components/Icon/src/icons/info.d.ts +1 -0
- package/dist/components/Icon/src/icons/info.js +6 -0
- package/dist/components/Icon/src/icons/loader.d.ts +1 -0
- package/dist/components/Icon/src/icons/loader.js +6 -0
- package/dist/components/Icon/src/icons/mail.d.ts +1 -0
- package/dist/components/Icon/src/icons/mail.js +6 -0
- package/dist/components/Icon/src/icons/menu.d.ts +1 -0
- package/dist/components/Icon/src/icons/menu.js +6 -0
- package/dist/components/Icon/src/icons/minus.d.ts +1 -0
- package/dist/components/Icon/src/icons/minus.js +6 -0
- package/dist/components/Icon/src/icons/pencil.d.ts +1 -0
- package/dist/components/Icon/src/icons/pencil.js +6 -0
- package/dist/components/Icon/src/icons/plus.d.ts +1 -0
- package/dist/components/Icon/src/icons/plus.js +6 -0
- package/dist/components/Icon/src/icons/search.d.ts +1 -0
- package/dist/components/Icon/src/icons/search.js +6 -0
- package/dist/components/Icon/src/icons/settings.d.ts +1 -0
- package/dist/components/Icon/src/icons/settings.js +6 -0
- package/dist/components/Icon/src/icons/trash-2.d.ts +1 -0
- package/dist/components/Icon/src/icons/trash-2.js +6 -0
- package/dist/components/Icon/src/icons/triangle-alert.d.ts +1 -0
- package/dist/components/Icon/src/icons/triangle-alert.js +6 -0
- package/dist/components/Icon/src/icons/upload.d.ts +1 -0
- package/dist/components/Icon/src/icons/upload.js +6 -0
- package/dist/components/Icon/src/icons/user.d.ts +1 -0
- package/dist/components/Icon/src/icons/user.js +6 -0
- package/dist/components/Icon/src/icons/x.d.ts +1 -0
- package/dist/components/Icon/src/icons/x.js +6 -0
- package/dist/components/Image/src/Image.d.ts +76 -0
- package/dist/components/Image/src/Image.js +456 -0
- package/dist/components/Image/src/Image.props.d.ts +35 -0
- package/dist/components/Image/src/Image.props.js +65 -0
- package/dist/components/Image/src/Image.styles.d.ts +4 -0
- package/dist/components/Input/src/Input.d.ts +60 -0
- package/dist/components/Input/src/Input.js +648 -0
- package/dist/components/Input/src/Input.playground.d.ts +2 -0
- package/dist/components/Input/src/Input.props.d.ts +13 -0
- package/dist/components/Input/src/Input.props.js +41 -0
- package/dist/components/Input/src/Input.styles.d.ts +6 -0
- package/dist/components/Modal/src/Modal.d.ts +166 -0
- package/dist/components/Modal/src/Modal.js +1434 -0
- package/dist/components/Modal/src/Modal.playground.d.ts +2 -0
- package/dist/components/Modal/src/Modal.props.d.ts +66 -0
- package/dist/components/Modal/src/Modal.props.js +65 -0
- package/dist/components/Modal/src/Modal.styles.d.ts +29 -0
- package/dist/components/Nav/src/Nav.d.ts +66 -0
- package/dist/components/Nav/src/Nav.js +750 -0
- package/dist/components/Nav/src/Nav.props.d.ts +8 -0
- package/dist/components/Nav/src/Nav.props.js +13 -0
- package/dist/components/Nav/src/Nav.styles.d.ts +10 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.d.ts +17 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.js +170 -0
- package/dist/components/NavDropdownColumn/src/NavDropdownColumn.styles.d.ts +1 -0
- package/dist/components/NavLink/src/NavLink.d.ts +191 -0
- package/dist/components/NavLink/src/NavLink.js +1916 -0
- package/dist/components/NavLink/src/NavLink.props.d.ts +38 -0
- package/dist/components/NavLink/src/NavLink.props.js +58 -0
- package/dist/components/NavLink/src/NavLink.styles.d.ts +22 -0
- package/dist/components/Stack/src/Stack.d.ts +30 -0
- package/dist/components/Stack/src/Stack.js +300 -0
- package/dist/components/Stack/src/Stack.props.d.ts +24 -0
- package/dist/components/Stack/src/Stack.props.js +53 -0
- package/dist/components/Stack/src/Stack.styles.d.ts +2 -0
- package/dist/components/Text/src/Text.d.ts +32 -0
- package/dist/components/Text/src/Text.js +327 -0
- package/dist/components/Text/src/Text.props.d.ts +23 -0
- package/dist/components/Text/src/Text.props.js +52 -0
- package/dist/components/Text/src/Text.styles.d.ts +2 -0
- package/dist/playground/types.d.ts +29 -0
- package/dist/playground-manifest.d.ts +6 -0
- package/dist/playground-manifest.js +556 -0
- package/dist/react/Background.d.ts +6 -0
- package/dist/react/Background.js +13 -0
- package/dist/react/Badge.d.ts +6 -0
- package/dist/react/Badge.js +13 -0
- package/dist/react/Button.d.ts +6 -0
- package/dist/react/Button.js +13 -0
- package/dist/react/Card.d.ts +6 -0
- package/dist/react/Card.js +13 -0
- package/dist/react/CodeBlock.d.ts +6 -0
- package/dist/react/CodeBlock.js +13 -0
- package/dist/react/Container.d.ts +6 -0
- package/dist/react/Container.js +13 -0
- package/dist/react/Divider.d.ts +6 -0
- package/dist/react/Divider.js +13 -0
- package/dist/react/FeatureItem.d.ts +6 -0
- package/dist/react/FeatureItem.js +13 -0
- package/dist/react/FeatureTabs.d.ts +6 -0
- package/dist/react/FeatureTabs.js +13 -0
- package/dist/react/Footer.d.ts +6 -0
- package/dist/react/Footer.js +13 -0
- package/dist/react/FormBlock.d.ts +6 -0
- package/dist/react/FormBlock.js +13 -0
- package/dist/react/Grid.d.ts +6 -0
- package/dist/react/Grid.js +13 -0
- package/dist/react/Heading.d.ts +6 -0
- package/dist/react/Heading.js +13 -0
- package/dist/react/HeadingBlock.d.ts +6 -0
- package/dist/react/HeadingBlock.js +13 -0
- package/dist/react/Hero.d.ts +6 -0
- package/dist/react/Hero.js +13 -0
- package/dist/react/Icon.d.ts +6 -0
- package/dist/react/Icon.js +13 -0
- package/dist/react/Image.d.ts +8 -0
- package/dist/react/Image.js +13 -0
- package/dist/react/Input.d.ts +8 -0
- package/dist/react/Input.js +13 -0
- package/dist/react/Modal.d.ts +10 -0
- package/dist/react/Modal.js +17 -0
- package/dist/react/Nav.d.ts +6 -0
- package/dist/react/Nav.js +13 -0
- package/dist/react/NavDropdownColumn.d.ts +6 -0
- package/dist/react/NavDropdownColumn.js +13 -0
- package/dist/react/NavLink.d.ts +8 -0
- package/dist/react/NavLink.js +13 -0
- package/dist/react/Stack.d.ts +6 -0
- package/dist/react/Stack.js +13 -0
- package/dist/react/Text.d.ts +6 -0
- package/dist/react/Text.js +13 -0
- package/dist/react/index.d.ts +24 -0
- package/dist/react/index.js +25 -0
- package/dist/surface/surface.props.js +33 -0
- package/package.json +352 -4
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import '../../Button/src/Button.js';
|
|
3
|
+
import { type CSSResultGroup } from 'lit';
|
|
4
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
5
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
6
|
+
import { type ModalCloseReasonType, type ModalMotionType, type ModalPlacementType, type ModalSizeType } from './Modal.props.js';
|
|
7
|
+
/**
|
|
8
|
+
* Accessible modal dialog built on the native `<dialog>` element and
|
|
9
|
+
* `showModal()`, so the top layer, background inertness, and focus containment
|
|
10
|
+
* come from the platform rather than a hand-rolled focus trap.
|
|
11
|
+
*
|
|
12
|
+
* All copy is supplied by the consumer through slots — `heading`, `description`,
|
|
13
|
+
* the default content slot, `footer`, and an optional `close` control whose
|
|
14
|
+
* activation is picked up automatically.
|
|
15
|
+
*
|
|
16
|
+
* @fires dsgn-modal-open - Fired after the dialog enters the top layer.
|
|
17
|
+
* @fires dsgn-modal-request-close - Fired before closing; cancelable, `detail` is `{ reason }`. Call `preventDefault()` to keep the modal open.
|
|
18
|
+
* @fires dsgn-modal-close - Fired once the exit animation has finished and the dialog has left the top layer; `detail` is `{ reason, returnValue }`.
|
|
19
|
+
*
|
|
20
|
+
* @slot - Modal body content.
|
|
21
|
+
* @slot heading - Title content; supplies the dialog's accessible name.
|
|
22
|
+
* @slot description - Supporting text referenced by `aria-describedby`.
|
|
23
|
+
* @slot footer - Actions, typically buttons.
|
|
24
|
+
* @slot close - A close control; clicking anything slotted here requests a close.
|
|
25
|
+
*
|
|
26
|
+
* @csspart dialog - Native dialog element.
|
|
27
|
+
* @csspart close-button - Built-in close button.
|
|
28
|
+
*/
|
|
29
|
+
export declare class Modal extends Base {
|
|
30
|
+
static styles: CSSResultGroup;
|
|
31
|
+
private _dialog;
|
|
32
|
+
surface: SurfaceType;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the modal is shown. This is the single source of truth: the
|
|
35
|
+
* component drives `showModal()`/`close()` from it, and sets it back to
|
|
36
|
+
* `false` itself whenever the dialog closes (Escape, backdrop, close control).
|
|
37
|
+
* A consumer holding `open` in its own state should therefore listen for
|
|
38
|
+
* `dsgn-modal-close` and mirror the change back, otherwise the two will drift
|
|
39
|
+
* on the next open.
|
|
40
|
+
*/
|
|
41
|
+
open: boolean;
|
|
42
|
+
placement: ModalPlacementType;
|
|
43
|
+
/** Motion origin. `inherit` follows `placement`; `none` is fade-only. */
|
|
44
|
+
motion: ModalMotionType;
|
|
45
|
+
size: ModalSizeType;
|
|
46
|
+
/**
|
|
47
|
+
* Accessible name for the dialog, for the case where there is no visible
|
|
48
|
+
* heading. A filled `heading` slot takes precedence.
|
|
49
|
+
*/
|
|
50
|
+
ariaLabel: string;
|
|
51
|
+
/**
|
|
52
|
+
* Accessible name for the built-in close control. Supplied by the CMS via the
|
|
53
|
+
* consuming template; the default is a Storybook/dev fallback only. Ignored
|
|
54
|
+
* when the consumer slots their own control into `close`.
|
|
55
|
+
*/
|
|
56
|
+
closeLabel: string;
|
|
57
|
+
/**
|
|
58
|
+
* Drops the built-in close control. Every modal gets one by default so there
|
|
59
|
+
* is always a visible way out; opt out only when the flow supplies its own
|
|
60
|
+
* dismissal (a footer "Cancel", say) — and never together with
|
|
61
|
+
* `no-escape-dismiss`, which would leave keyboard users stuck.
|
|
62
|
+
*
|
|
63
|
+
* A control slotted into `close` replaces the built-in one whatever this is
|
|
64
|
+
* set to, since it is the slot's fallback content.
|
|
65
|
+
*/
|
|
66
|
+
noCloseControl: boolean;
|
|
67
|
+
/** Blocks dismissal by clicking the backdrop. */
|
|
68
|
+
noBackdropDismiss: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Blocks dismissal by Escape. Reserve it for flows that would lose data —
|
|
71
|
+
* always leave a visible way out (a close control or a footer action), or
|
|
72
|
+
* keyboard users are stuck.
|
|
73
|
+
*/
|
|
74
|
+
noEscapeDismiss: boolean;
|
|
75
|
+
/** Drives `data-state`, which the stylesheet keys the exit animation on. */
|
|
76
|
+
private _closing;
|
|
77
|
+
private _hasHeading;
|
|
78
|
+
private _hasDescription;
|
|
79
|
+
private _hasFooter;
|
|
80
|
+
private _hasCloseControl;
|
|
81
|
+
private _closeReason;
|
|
82
|
+
private _returnValue;
|
|
83
|
+
private _previouslyFocused;
|
|
84
|
+
private _pointerDownOnBackdrop;
|
|
85
|
+
private _holdsScrollLock;
|
|
86
|
+
/**
|
|
87
|
+
* Whether the header will show a close control — either one the consumer
|
|
88
|
+
* slotted, or the built-in default that has not been opted out of.
|
|
89
|
+
*/
|
|
90
|
+
private get _hasCloseAffordance();
|
|
91
|
+
/** The resolved animation origin, with `inherit` folded into `placement`. */
|
|
92
|
+
private get _motionOrigin();
|
|
93
|
+
/** Show the modal. No-op if it is already open. */
|
|
94
|
+
show(): void;
|
|
95
|
+
/**
|
|
96
|
+
* Close the modal immediately, without firing the cancelable
|
|
97
|
+
* `dsgn-modal-request-close` — this is the imperative "I have decided" path.
|
|
98
|
+
* The optional `returnValue` lands on the native dialog and on the
|
|
99
|
+
* `dsgn-modal-close` detail.
|
|
100
|
+
*/
|
|
101
|
+
close(returnValue?: string): void;
|
|
102
|
+
/**
|
|
103
|
+
* Ask to close. Fires the cancelable `dsgn-modal-request-close`; the modal
|
|
104
|
+
* stays open if a listener calls `preventDefault()`. This is the path Escape,
|
|
105
|
+
* the backdrop, and the slotted close control take, so a consumer can guard
|
|
106
|
+
* all of them (e.g. "discard unsaved changes?") in one listener.
|
|
107
|
+
*/
|
|
108
|
+
requestClose(reason?: ModalCloseReasonType): boolean;
|
|
109
|
+
connectedCallback(): void;
|
|
110
|
+
disconnectedCallback(): void;
|
|
111
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
112
|
+
private _syncDialogState;
|
|
113
|
+
private _openDialog;
|
|
114
|
+
/**
|
|
115
|
+
* Play the exit animation, then leave the top layer. The dialog stays in the
|
|
116
|
+
* top layer for the whole animation because `dialog.close()` is what removes
|
|
117
|
+
* it, and that is deliberately the last step — no timers involved, the wait is
|
|
118
|
+
* on the animations' own `finished` promises.
|
|
119
|
+
*/
|
|
120
|
+
private _runCloseSequence;
|
|
121
|
+
/**
|
|
122
|
+
* Deliberate initial focus: an author-marked `[autofocus]` (light DOM first,
|
|
123
|
+
* since that is where the modal's content lives), otherwise the dialog itself.
|
|
124
|
+
* The native autofocus algorithm is not relied on — it is inconsistent for
|
|
125
|
+
* content that reaches the dialog through a slot.
|
|
126
|
+
*/
|
|
127
|
+
private _focusInitialElement;
|
|
128
|
+
private _restoreFocus;
|
|
129
|
+
private _acquireScrollLock;
|
|
130
|
+
private _releaseScrollLock;
|
|
131
|
+
/**
|
|
132
|
+
* The native `close` event is the single point where "the dialog is now
|
|
133
|
+
* shut" is handled, so a consumer calling `close()` on the inner dialog
|
|
134
|
+
* directly still gets the scroll unlock, focus restore, and public event.
|
|
135
|
+
*/
|
|
136
|
+
private _handleNativeClose;
|
|
137
|
+
/**
|
|
138
|
+
* Escape (and any other platform close request) is always prevented, because
|
|
139
|
+
* the default behavior would yank the dialog out of the top layer before the
|
|
140
|
+
* exit animation could run. The dismissal is then re-issued through
|
|
141
|
+
* `requestClose()` so it is cancelable and animated like every other path.
|
|
142
|
+
*/
|
|
143
|
+
private _handleCancel;
|
|
144
|
+
/**
|
|
145
|
+
* Clicks on the backdrop are reported with the dialog itself as the target
|
|
146
|
+
* (the panel is the dialog's only child and covers it). Requiring the press
|
|
147
|
+
* *and* the release to land there stops a text selection that started inside
|
|
148
|
+
* the modal and ended on the backdrop from dismissing it.
|
|
149
|
+
*/
|
|
150
|
+
private _handlePointerDown;
|
|
151
|
+
private _handleDialogClick;
|
|
152
|
+
private _handleCloseControlClick;
|
|
153
|
+
/**
|
|
154
|
+
* Empty regions collapse rather than leaving stray padding, and an empty
|
|
155
|
+
* `heading`/`description` must not be referenced by `aria-labelledby` /
|
|
156
|
+
* `aria-describedby` — a dangling reference produces no accessible name at
|
|
157
|
+
* all, which is worse than falling back to `aria-label`.
|
|
158
|
+
*/
|
|
159
|
+
private _handleSlotChange;
|
|
160
|
+
render(): import("lit").TemplateResult<1>;
|
|
161
|
+
}
|
|
162
|
+
declare global {
|
|
163
|
+
interface HTMLElementTagNameMap {
|
|
164
|
+
'dsgn-modal': Modal;
|
|
165
|
+
}
|
|
166
|
+
}
|