@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,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the dialog sits in the viewport. `center` is a classic modal; the four
|
|
3
|
+
* edges are sheets/drawers that span that edge.
|
|
4
|
+
*/
|
|
5
|
+
export declare const modalPlacementValues: {
|
|
6
|
+
readonly CENTER: "center";
|
|
7
|
+
readonly LEFT: "left";
|
|
8
|
+
readonly RIGHT: "right";
|
|
9
|
+
readonly TOP: "top";
|
|
10
|
+
readonly BOTTOM: "bottom";
|
|
11
|
+
};
|
|
12
|
+
export type ModalPlacementType = (typeof modalPlacementValues)[keyof typeof modalPlacementValues];
|
|
13
|
+
export declare const modalPlacementProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Direction the dialog animates from, independent of where it comes to rest.
|
|
16
|
+
* `inherit` (the default) follows `placement`, which is what a sheet or a
|
|
17
|
+
* centered modal wants. Set it explicitly when the two need to differ — e.g. a
|
|
18
|
+
* bottom sheet on mobile that should fade rather than slide — and use `none`
|
|
19
|
+
* for an opacity-only transition with no spatial motion.
|
|
20
|
+
*/
|
|
21
|
+
export declare const modalMotionValues: {
|
|
22
|
+
readonly INHERIT: "inherit";
|
|
23
|
+
readonly NONE: "none";
|
|
24
|
+
readonly CENTER: "center";
|
|
25
|
+
readonly LEFT: "left";
|
|
26
|
+
readonly RIGHT: "right";
|
|
27
|
+
readonly TOP: "top";
|
|
28
|
+
readonly BOTTOM: "bottom";
|
|
29
|
+
};
|
|
30
|
+
export type ModalMotionType = (typeof modalMotionValues)[keyof typeof modalMotionValues];
|
|
31
|
+
export declare const modalMotionProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Size along the axis the placement grows on: width for `center`/`left`/`right`,
|
|
34
|
+
* height for `top`/`bottom`. `full` fills the viewport on both axes.
|
|
35
|
+
*/
|
|
36
|
+
export declare const modalSizeValues: {
|
|
37
|
+
readonly SM: "sm";
|
|
38
|
+
readonly MD: "md";
|
|
39
|
+
readonly LG: "lg";
|
|
40
|
+
readonly XL: "xl";
|
|
41
|
+
readonly FULL: "full";
|
|
42
|
+
};
|
|
43
|
+
export type ModalSizeType = (typeof modalSizeValues)[keyof typeof modalSizeValues];
|
|
44
|
+
export declare const modalSizeProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
45
|
+
/**
|
|
46
|
+
* What asked the modal to close. Carried on `dsgn-modal-request-close` (where it
|
|
47
|
+
* can be vetoed) and on `dsgn-modal-close`.
|
|
48
|
+
*/
|
|
49
|
+
export declare const modalCloseReasonValues: {
|
|
50
|
+
/** `close()`/`requestClose()` called, or `open` set to false. */
|
|
51
|
+
readonly API: "api";
|
|
52
|
+
/** The Escape key / a platform close request. */
|
|
53
|
+
readonly ESCAPE: "escape";
|
|
54
|
+
/** A click that both started and ended on the backdrop. */
|
|
55
|
+
readonly BACKDROP: "backdrop";
|
|
56
|
+
/** A control slotted into `close`. */
|
|
57
|
+
readonly CLOSE_CONTROL: "close-control";
|
|
58
|
+
};
|
|
59
|
+
export type ModalCloseReasonType = (typeof modalCloseReasonValues)[keyof typeof modalCloseReasonValues];
|
|
60
|
+
export interface ModalRequestCloseDetail {
|
|
61
|
+
reason: ModalCloseReasonType;
|
|
62
|
+
}
|
|
63
|
+
export interface ModalCloseDetail {
|
|
64
|
+
reason: ModalCloseReasonType;
|
|
65
|
+
returnValue: string;
|
|
66
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// common/helpers/enum-validator.ts
|
|
2
|
+
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
3
|
+
if (!enumSet.has(candidateValue)) {
|
|
4
|
+
throw new Error(`Invalid prop ${propName} of value ${candidateValue}. Expected one of: ${Array.from(enumSet).join(", ")}`);
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// common/helpers/enum-creator.ts
|
|
9
|
+
var enumCreator = (acceptableValues, propName, type, other = {}) => {
|
|
10
|
+
const acceptableValuesSet = new Set(acceptableValues);
|
|
11
|
+
return {
|
|
12
|
+
type,
|
|
13
|
+
hasChanged(newValue, oldValue) {
|
|
14
|
+
if (newValue !== oldValue) {
|
|
15
|
+
enumValidator(propName, acceptableValuesSet, newValue);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
20
|
+
...other
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// components/Modal/src/Modal.props.ts
|
|
25
|
+
var modalPlacementValues = {
|
|
26
|
+
CENTER: "center",
|
|
27
|
+
LEFT: "left",
|
|
28
|
+
RIGHT: "right",
|
|
29
|
+
TOP: "top",
|
|
30
|
+
BOTTOM: "bottom"
|
|
31
|
+
};
|
|
32
|
+
var modalPlacementProps = enumCreator(Object.values(modalPlacementValues), "placement", String, { reflect: true });
|
|
33
|
+
var modalMotionValues = {
|
|
34
|
+
INHERIT: "inherit",
|
|
35
|
+
NONE: "none",
|
|
36
|
+
CENTER: "center",
|
|
37
|
+
LEFT: "left",
|
|
38
|
+
RIGHT: "right",
|
|
39
|
+
TOP: "top",
|
|
40
|
+
BOTTOM: "bottom"
|
|
41
|
+
};
|
|
42
|
+
var modalMotionProps = enumCreator(Object.values(modalMotionValues), "motion", String, { reflect: true });
|
|
43
|
+
var modalSizeValues = {
|
|
44
|
+
SM: "sm",
|
|
45
|
+
MD: "md",
|
|
46
|
+
LG: "lg",
|
|
47
|
+
XL: "xl",
|
|
48
|
+
FULL: "full"
|
|
49
|
+
};
|
|
50
|
+
var modalSizeProps = enumCreator(Object.values(modalSizeValues), "size", String, { reflect: true });
|
|
51
|
+
var modalCloseReasonValues = {
|
|
52
|
+
API: "api",
|
|
53
|
+
ESCAPE: "escape",
|
|
54
|
+
BACKDROP: "backdrop",
|
|
55
|
+
CLOSE_CONTROL: "close-control"
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
modalCloseReasonValues,
|
|
59
|
+
modalMotionProps,
|
|
60
|
+
modalMotionValues,
|
|
61
|
+
modalPlacementProps,
|
|
62
|
+
modalPlacementValues,
|
|
63
|
+
modalSizeProps,
|
|
64
|
+
modalSizeValues
|
|
65
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `:host` is the only rule with no utility equivalent — the host is the
|
|
3
|
+
* consumer's own `<dsgn-modal>` element, so there is no class we can put on it.
|
|
4
|
+
* Everything else, including `::backdrop`, the `[data-*]` state selectors and
|
|
5
|
+
* the enter/exit motion, is expressed as Tailwind utilities in
|
|
6
|
+
* `dialogClasses()` below.
|
|
7
|
+
*/
|
|
8
|
+
export declare const hostStyles: import("lit").CSSResult;
|
|
9
|
+
/**
|
|
10
|
+
* Every style the `<dialog>` needs, as one static utility list.
|
|
11
|
+
*
|
|
12
|
+
* Nothing here is conditional: the dialog carries `data-placement`,
|
|
13
|
+
* `data-size`, `data-motion` and `data-state`, and the `data-[…]:` variants
|
|
14
|
+
* select which rules apply at runtime. That is also a requirement rather than a
|
|
15
|
+
* preference — Tailwind only generates classes it finds as *literal* strings in
|
|
16
|
+
* the source, so these cannot be composed or interpolated.
|
|
17
|
+
*
|
|
18
|
+
* Ordering note: `motion-reduce:` is emitted after the `data-motion` rules and
|
|
19
|
+
* matches their specificity, so it wins — the reduced-motion cross-fade
|
|
20
|
+
* overrides whichever spatial animation the placement selected.
|
|
21
|
+
*/
|
|
22
|
+
export declare const dialogClasses: () => string;
|
|
23
|
+
export declare const panelClasses: () => string;
|
|
24
|
+
export declare const headerClasses: (visible: boolean) => string;
|
|
25
|
+
export declare const headingClasses: () => string;
|
|
26
|
+
export declare const closeSlotClasses: () => string;
|
|
27
|
+
export declare const descriptionClasses: (visible: boolean) => string;
|
|
28
|
+
export declare const bodyClasses: () => string;
|
|
29
|
+
export declare const footerClasses: (visible: boolean) => string;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import '../../Container/src/Container.js';
|
|
3
|
+
import '../../Icon/src/Icon.js';
|
|
4
|
+
import '../../NavLink/src/NavLink.js';
|
|
5
|
+
import { type CSSResultGroup } from 'lit';
|
|
6
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
7
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
8
|
+
/**
|
|
9
|
+
* @slot logo - Brand or logo content.
|
|
10
|
+
* @slot links - Primary navigation links.
|
|
11
|
+
* @slot actions - Navigation actions.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Nav extends Base {
|
|
14
|
+
static styles: CSSResultGroup;
|
|
15
|
+
/**
|
|
16
|
+
* Surface theme variant (light or dark)
|
|
17
|
+
*/
|
|
18
|
+
surface: SurfaceType;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the nav sticks to the top of the viewport
|
|
21
|
+
*/
|
|
22
|
+
sticky: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the nav has a transparent background (for hero overlays)
|
|
25
|
+
*/
|
|
26
|
+
transparent: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Accessible label for the mobile menu button when the menu is closed.
|
|
29
|
+
* Supplied by the CMS via the marketing template; the default is a
|
|
30
|
+
* Storybook/dev fallback only.
|
|
31
|
+
*/
|
|
32
|
+
menuOpenLabel: string;
|
|
33
|
+
/**
|
|
34
|
+
* Accessible label for the mobile menu button when the menu is open.
|
|
35
|
+
* Supplied by the CMS via the marketing template; the default is a
|
|
36
|
+
* Storybook/dev fallback only.
|
|
37
|
+
*/
|
|
38
|
+
menuCloseLabel: string;
|
|
39
|
+
private menuOpen;
|
|
40
|
+
private hasNavigationItems;
|
|
41
|
+
connectedCallback(): void;
|
|
42
|
+
disconnectedCallback(): void;
|
|
43
|
+
firstUpdated(): void;
|
|
44
|
+
private getNavigationLinks;
|
|
45
|
+
/**
|
|
46
|
+
* Any element assigned to the links/actions slots — regardless of tag. The
|
|
47
|
+
* mobile menu (toggle + panel) must appear for plain `<a slot="links">`
|
|
48
|
+
* consumers too, or their links would vanish below `sm`. Dropdown management
|
|
49
|
+
* is separately scoped to `dsgn-nav-link` via getNavigationLinks().
|
|
50
|
+
*/
|
|
51
|
+
private hasSlottedNavigationItems;
|
|
52
|
+
private updateNavigationItems;
|
|
53
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
54
|
+
private toggleMenu;
|
|
55
|
+
private closeMenu;
|
|
56
|
+
private closeDropdowns;
|
|
57
|
+
private handleDropdownToggle;
|
|
58
|
+
private handleKeydown;
|
|
59
|
+
private handleMenuClick;
|
|
60
|
+
render(): import("lit").TemplateResult<1>;
|
|
61
|
+
}
|
|
62
|
+
declare global {
|
|
63
|
+
interface HTMLElementTagNameMap {
|
|
64
|
+
'dsgn-nav': Nav;
|
|
65
|
+
}
|
|
66
|
+
}
|