@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,750 @@
|
|
|
1
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// components/Nav/src/Nav.ts
|
|
13
|
+
import"../../Container/src/Container.js";
|
|
14
|
+
import"../../Icon/src/Icon.js";
|
|
15
|
+
import"../../NavLink/src/NavLink.js";
|
|
16
|
+
import { html as html2, nothing } from "lit";
|
|
17
|
+
import { property, state } from "lit/decorators.js";
|
|
18
|
+
|
|
19
|
+
// common/Base/Base.ts
|
|
20
|
+
import { html, LitElement } from "lit";
|
|
21
|
+
|
|
22
|
+
// common/helpers/define-element.ts
|
|
23
|
+
var defineElement = (tag, ctor) => {
|
|
24
|
+
if (typeof customElements === "undefined")
|
|
25
|
+
return;
|
|
26
|
+
if (!customElements.get(tag))
|
|
27
|
+
customElements.define(tag, ctor);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// common/Base/Base.css
|
|
31
|
+
import { css } from "lit";
|
|
32
|
+
var styles = css`/* Base reset in @layer base ensures it comes before utilities in Tailwind v4 cascade
|
|
33
|
+
This prevents the reset from overriding component utility classes */
|
|
34
|
+
@layer base {
|
|
35
|
+
:host {
|
|
36
|
+
display: block;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
line-height: 1.5;
|
|
39
|
+
-webkit-text-size-adjust: 100%;
|
|
40
|
+
tab-size: 4;
|
|
41
|
+
font-family: var(
|
|
42
|
+
--default-font-family,
|
|
43
|
+
var(--font-sans, ui-sans-serif, system-ui, sans-serif)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
*,
|
|
48
|
+
*::before,
|
|
49
|
+
*::after {
|
|
50
|
+
box-sizing: inherit;
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
border: 0 solid;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
:host h1,
|
|
57
|
+
:host h2,
|
|
58
|
+
:host h3,
|
|
59
|
+
:host h4,
|
|
60
|
+
:host h5,
|
|
61
|
+
:host h6 {
|
|
62
|
+
font-size: inherit;
|
|
63
|
+
font-weight: inherit;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;
|
|
69
|
+
var Base_default = styles;
|
|
70
|
+
|
|
71
|
+
// common/Base/Base.ts
|
|
72
|
+
class Base extends LitElement {
|
|
73
|
+
static styles = Base_default;
|
|
74
|
+
updateTheme(changedProperties, surface) {
|
|
75
|
+
if (changedProperties.has("surface")) {
|
|
76
|
+
if (surface) {
|
|
77
|
+
this.setAttribute("data-theme", surface);
|
|
78
|
+
} else {
|
|
79
|
+
this.removeAttribute("data-theme");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
emit(name, detail, options = {}) {
|
|
84
|
+
return this.dispatchEvent(new CustomEvent(name, {
|
|
85
|
+
detail,
|
|
86
|
+
bubbles: true,
|
|
87
|
+
composed: true,
|
|
88
|
+
cancelable: options.cancelable ?? false
|
|
89
|
+
}));
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return html`<slot></slot>`;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
defineElement("dsgn-base", Base);
|
|
96
|
+
|
|
97
|
+
// common/helpers/enum-validator.ts
|
|
98
|
+
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
99
|
+
if (!enumSet.has(candidateValue)) {
|
|
100
|
+
throw new Error(`Invalid prop ${propName} of value ${candidateValue}. Expected one of: ${Array.from(enumSet).join(", ")}`);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// common/helpers/enum-creator.ts
|
|
105
|
+
var enumCreator = (acceptableValues, propName, type, other = {}) => {
|
|
106
|
+
const acceptableValuesSet = new Set(acceptableValues);
|
|
107
|
+
return {
|
|
108
|
+
type,
|
|
109
|
+
hasChanged(newValue, oldValue) {
|
|
110
|
+
if (newValue !== oldValue) {
|
|
111
|
+
enumValidator(propName, acceptableValuesSet, newValue);
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
return false;
|
|
115
|
+
},
|
|
116
|
+
...other
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
// common/props/surface/surface.props.ts
|
|
121
|
+
var surfaceValues = {
|
|
122
|
+
LIGHT: "light",
|
|
123
|
+
DARK: "dark"
|
|
124
|
+
};
|
|
125
|
+
var surfaceProps = enumCreator(Object.values(surfaceValues), "surface", String, { reflect: true });
|
|
126
|
+
|
|
127
|
+
// components/Nav/src/Nav.ts
|
|
128
|
+
import {
|
|
129
|
+
containerPaddingValues,
|
|
130
|
+
containerSizeValues
|
|
131
|
+
} from "../../Container/src/Container.props.js";
|
|
132
|
+
|
|
133
|
+
// components/Icon/src/icons/menu.ts
|
|
134
|
+
import { svg } from "lit";
|
|
135
|
+
var menu = svg`<line x1="4" x2="20" y1="12" y2="12" /><line x1="4" x2="20" y1="6" y2="6" /><line x1="4" x2="20" y1="18" y2="18" />`;
|
|
136
|
+
// components/Icon/src/icons/x.ts
|
|
137
|
+
import { svg as svg2 } from "lit";
|
|
138
|
+
var x = svg2`<path d="M18 6 6 18" /><path d="m6 6 12 12" />`;
|
|
139
|
+
// components/Nav/src/Nav.css
|
|
140
|
+
import { css as css2 } from "lit";
|
|
141
|
+
var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
142
|
+
@layer properties;
|
|
143
|
+
@layer theme {
|
|
144
|
+
:root, :host {
|
|
145
|
+
--font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
146
|
+
'Noto Color Emoji';
|
|
147
|
+
--spacing: 0.25rem;
|
|
148
|
+
--ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
149
|
+
--default-transition-duration: 150ms;
|
|
150
|
+
--default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
151
|
+
--radius-input: var(--dsgn-src-radius-input, 0.5rem);
|
|
152
|
+
--color-accent: inherit;
|
|
153
|
+
--color-outline: inherit;
|
|
154
|
+
--color-page: inherit;
|
|
155
|
+
--color-text-primary: inherit;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
@layer utilities {
|
|
159
|
+
.static {
|
|
160
|
+
position: static;
|
|
161
|
+
}
|
|
162
|
+
.sticky {
|
|
163
|
+
position: sticky;
|
|
164
|
+
}
|
|
165
|
+
.block {
|
|
166
|
+
display: block;
|
|
167
|
+
}
|
|
168
|
+
.flex {
|
|
169
|
+
display: flex;
|
|
170
|
+
}
|
|
171
|
+
.hidden {
|
|
172
|
+
display: none;
|
|
173
|
+
}
|
|
174
|
+
.h-16 {
|
|
175
|
+
height: calc(var(--spacing) * 16);
|
|
176
|
+
}
|
|
177
|
+
.w-full {
|
|
178
|
+
width: 100%;
|
|
179
|
+
}
|
|
180
|
+
.flex-shrink-0 {
|
|
181
|
+
flex-shrink: 0;
|
|
182
|
+
}
|
|
183
|
+
.cursor-pointer {
|
|
184
|
+
cursor: pointer;
|
|
185
|
+
}
|
|
186
|
+
.items-center {
|
|
187
|
+
align-items: center;
|
|
188
|
+
}
|
|
189
|
+
.justify-between {
|
|
190
|
+
justify-content: space-between;
|
|
191
|
+
}
|
|
192
|
+
.gap-3 {
|
|
193
|
+
gap: calc(var(--spacing) * 3);
|
|
194
|
+
}
|
|
195
|
+
.gap-4 {
|
|
196
|
+
gap: calc(var(--spacing) * 4);
|
|
197
|
+
}
|
|
198
|
+
.gap-6 {
|
|
199
|
+
gap: calc(var(--spacing) * 6);
|
|
200
|
+
}
|
|
201
|
+
.border-b {
|
|
202
|
+
border-bottom-style: var(--tw-border-style);
|
|
203
|
+
border-bottom-width: 1px;
|
|
204
|
+
}
|
|
205
|
+
.border-outline {
|
|
206
|
+
border-color: var(--color-outline);
|
|
207
|
+
}
|
|
208
|
+
.bg-page {
|
|
209
|
+
background-color: var(--color-page);
|
|
210
|
+
}
|
|
211
|
+
.bg-transparent {
|
|
212
|
+
background-color: transparent;
|
|
213
|
+
}
|
|
214
|
+
.font-sans {
|
|
215
|
+
font-family: var(--font-sans);
|
|
216
|
+
}
|
|
217
|
+
.text-text-primary {
|
|
218
|
+
color: var(--color-text-primary);
|
|
219
|
+
}
|
|
220
|
+
.max-sm\\:pointer-events-auto {
|
|
221
|
+
@media (width < 40rem) {
|
|
222
|
+
pointer-events: auto;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
.max-sm\\:pointer-events-none {
|
|
226
|
+
@media (width < 40rem) {
|
|
227
|
+
pointer-events: none;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
.max-sm\\:invisible {
|
|
231
|
+
@media (width < 40rem) {
|
|
232
|
+
visibility: hidden;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
.max-sm\\:visible {
|
|
236
|
+
@media (width < 40rem) {
|
|
237
|
+
visibility: visible;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
.max-sm\\:fixed {
|
|
241
|
+
@media (width < 40rem) {
|
|
242
|
+
position: fixed;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
.max-sm\\:inset-x-0 {
|
|
246
|
+
@media (width < 40rem) {
|
|
247
|
+
inset-inline: calc(var(--spacing) * 0);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
.max-sm\\:top-16 {
|
|
251
|
+
@media (width < 40rem) {
|
|
252
|
+
top: calc(var(--spacing) * 16);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
.max-sm\\:bottom-0 {
|
|
256
|
+
@media (width < 40rem) {
|
|
257
|
+
bottom: calc(var(--spacing) * 0);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
.max-sm\\:grid {
|
|
261
|
+
@media (width < 40rem) {
|
|
262
|
+
display: grid;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
.max-sm\\:size-12 {
|
|
266
|
+
@media (width < 40rem) {
|
|
267
|
+
width: calc(var(--spacing) * 12);
|
|
268
|
+
height: calc(var(--spacing) * 12);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
.max-sm\\:translate-x-0 {
|
|
272
|
+
@media (width < 40rem) {
|
|
273
|
+
--tw-translate-x: calc(var(--spacing) * 0);
|
|
274
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
.max-sm\\:translate-x-full {
|
|
278
|
+
@media (width < 40rem) {
|
|
279
|
+
--tw-translate-x: 100%;
|
|
280
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
.max-sm\\:flex-col {
|
|
284
|
+
@media (width < 40rem) {
|
|
285
|
+
flex-direction: column;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
.max-sm\\:place-items-center {
|
|
289
|
+
@media (width < 40rem) {
|
|
290
|
+
place-items: center;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
.max-sm\\:items-stretch {
|
|
294
|
+
@media (width < 40rem) {
|
|
295
|
+
align-items: stretch;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
.max-sm\\:gap-0 {
|
|
299
|
+
@media (width < 40rem) {
|
|
300
|
+
gap: calc(var(--spacing) * 0);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
.max-sm\\:gap-7 {
|
|
304
|
+
@media (width < 40rem) {
|
|
305
|
+
gap: calc(var(--spacing) * 7);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
.max-sm\\:overflow-y-auto {
|
|
309
|
+
@media (width < 40rem) {
|
|
310
|
+
overflow-y: auto;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
.max-sm\\:rounded-input {
|
|
314
|
+
@media (width < 40rem) {
|
|
315
|
+
border-radius: var(--radius-input);
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
.max-sm\\:border-t {
|
|
319
|
+
@media (width < 40rem) {
|
|
320
|
+
border-top-style: var(--tw-border-style);
|
|
321
|
+
border-top-width: 1px;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
.max-sm\\:border-outline {
|
|
325
|
+
@media (width < 40rem) {
|
|
326
|
+
border-color: var(--color-outline);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
.max-sm\\:bg-\\[color-mix\\(in_oklab\\,var\\(--color-outline\\)_20\\%\\,transparent\\)\\] {
|
|
330
|
+
@media (width < 40rem) {
|
|
331
|
+
background-color: color-mix(in srgb,inherit 20%,transparent);
|
|
332
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
333
|
+
background-color: color-mix(in oklab,var(--color-outline) 20%,transparent);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
.max-sm\\:bg-page {
|
|
338
|
+
@media (width < 40rem) {
|
|
339
|
+
background-color: var(--color-page);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
.max-sm\\:p-10 {
|
|
343
|
+
@media (width < 40rem) {
|
|
344
|
+
padding: calc(var(--spacing) * 10);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
.max-sm\\:text-text-primary {
|
|
348
|
+
@media (width < 40rem) {
|
|
349
|
+
color: var(--color-text-primary);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
.max-sm\\:opacity-0 {
|
|
353
|
+
@media (width < 40rem) {
|
|
354
|
+
opacity: 0%;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
.max-sm\\:opacity-100 {
|
|
358
|
+
@media (width < 40rem) {
|
|
359
|
+
opacity: 100%;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
.max-sm\\:transition-\\[opacity\\,transform\\,visibility\\] {
|
|
363
|
+
@media (width < 40rem) {
|
|
364
|
+
transition-property: opacity,transform,visibility;
|
|
365
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
366
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
.max-sm\\:duration-150 {
|
|
370
|
+
@media (width < 40rem) {
|
|
371
|
+
--tw-duration: 150ms;
|
|
372
|
+
transition-duration: 150ms;
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
.max-sm\\:ease-in-out {
|
|
376
|
+
@media (width < 40rem) {
|
|
377
|
+
--tw-ease: var(--ease-in-out);
|
|
378
|
+
transition-timing-function: var(--ease-in-out);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
.max-sm\\:focus-visible\\:outline-2 {
|
|
382
|
+
@media (width < 40rem) {
|
|
383
|
+
&:focus-visible {
|
|
384
|
+
outline-style: var(--tw-outline-style);
|
|
385
|
+
outline-width: 2px;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
.max-sm\\:focus-visible\\:outline-offset-2 {
|
|
390
|
+
@media (width < 40rem) {
|
|
391
|
+
&:focus-visible {
|
|
392
|
+
outline-offset: 2px;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
.max-sm\\:focus-visible\\:outline-accent {
|
|
397
|
+
@media (width < 40rem) {
|
|
398
|
+
&:focus-visible {
|
|
399
|
+
outline-color: var(--color-accent);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:block {
|
|
404
|
+
@media (width < 40rem) {
|
|
405
|
+
&::slotted(*) {
|
|
406
|
+
display: block;
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:flex {
|
|
411
|
+
@media (width < 40rem) {
|
|
412
|
+
&::slotted(*) {
|
|
413
|
+
display: flex;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:flex-1 {
|
|
418
|
+
@media (width < 40rem) {
|
|
419
|
+
&::slotted(*) {
|
|
420
|
+
flex: 1;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:items-center {
|
|
425
|
+
@media (width < 40rem) {
|
|
426
|
+
&::slotted(*) {
|
|
427
|
+
align-items: center;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:justify-center {
|
|
432
|
+
@media (width < 40rem) {
|
|
433
|
+
&::slotted(*) {
|
|
434
|
+
justify-content: center;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:border-b {
|
|
439
|
+
@media (width < 40rem) {
|
|
440
|
+
&::slotted(*) {
|
|
441
|
+
border-bottom-style: var(--tw-border-style);
|
|
442
|
+
border-bottom-width: 1px;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:border-outline {
|
|
447
|
+
@media (width < 40rem) {
|
|
448
|
+
&::slotted(*) {
|
|
449
|
+
border-color: var(--color-outline);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:px-6 {
|
|
454
|
+
@media (width < 40rem) {
|
|
455
|
+
&::slotted(*) {
|
|
456
|
+
padding-inline: calc(var(--spacing) * 6);
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
.max-sm\\:\\[\\&\\:\\:slotted\\(\\*\\)\\]\\:py-5 {
|
|
461
|
+
@media (width < 40rem) {
|
|
462
|
+
&::slotted(*) {
|
|
463
|
+
padding-block: calc(var(--spacing) * 5);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
.\\[\\:host\\(\\&\\)\\]\\:sticky {
|
|
468
|
+
:host(&) {
|
|
469
|
+
position: sticky;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
.\\[\\:host\\(\\&\\)\\]\\:top-0 {
|
|
473
|
+
:host(&) {
|
|
474
|
+
top: calc(var(--spacing) * 0);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
.\\[\\:host\\(\\&\\)\\]\\:z-50 {
|
|
478
|
+
:host(&) {
|
|
479
|
+
z-index: 50;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
@property --dsgn-border-sweep-angle {
|
|
484
|
+
syntax: '<angle>';
|
|
485
|
+
inherits: false;
|
|
486
|
+
initial-value: 0deg;
|
|
487
|
+
}
|
|
488
|
+
@property --tw-border-style {
|
|
489
|
+
syntax: "*";
|
|
490
|
+
inherits: false;
|
|
491
|
+
initial-value: solid;
|
|
492
|
+
}
|
|
493
|
+
@property --tw-translate-x {
|
|
494
|
+
syntax: "*";
|
|
495
|
+
inherits: false;
|
|
496
|
+
initial-value: 0;
|
|
497
|
+
}
|
|
498
|
+
@property --tw-translate-y {
|
|
499
|
+
syntax: "*";
|
|
500
|
+
inherits: false;
|
|
501
|
+
initial-value: 0;
|
|
502
|
+
}
|
|
503
|
+
@property --tw-translate-z {
|
|
504
|
+
syntax: "*";
|
|
505
|
+
inherits: false;
|
|
506
|
+
initial-value: 0;
|
|
507
|
+
}
|
|
508
|
+
@property --tw-duration {
|
|
509
|
+
syntax: "*";
|
|
510
|
+
inherits: false;
|
|
511
|
+
}
|
|
512
|
+
@property --tw-ease {
|
|
513
|
+
syntax: "*";
|
|
514
|
+
inherits: false;
|
|
515
|
+
}
|
|
516
|
+
@property --tw-outline-style {
|
|
517
|
+
syntax: "*";
|
|
518
|
+
inherits: false;
|
|
519
|
+
initial-value: solid;
|
|
520
|
+
}
|
|
521
|
+
@layer properties {
|
|
522
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
523
|
+
*, ::before, ::after, ::backdrop {
|
|
524
|
+
--tw-border-style: solid;
|
|
525
|
+
--tw-translate-x: 0;
|
|
526
|
+
--tw-translate-y: 0;
|
|
527
|
+
--tw-translate-z: 0;
|
|
528
|
+
--tw-duration: initial;
|
|
529
|
+
--tw-ease: initial;
|
|
530
|
+
--tw-outline-style: solid;
|
|
531
|
+
--dsgn-border-sweep-angle: 0deg;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
`;
|
|
536
|
+
var Nav_default = styles2;
|
|
537
|
+
|
|
538
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
539
|
+
function r(e) {
|
|
540
|
+
var t, f, n = "";
|
|
541
|
+
if (typeof e == "string" || typeof e == "number")
|
|
542
|
+
n += e;
|
|
543
|
+
else if (typeof e == "object")
|
|
544
|
+
if (Array.isArray(e)) {
|
|
545
|
+
var o = e.length;
|
|
546
|
+
for (t = 0;t < o; t++)
|
|
547
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
548
|
+
} else
|
|
549
|
+
for (f in e)
|
|
550
|
+
e[f] && (n && (n += " "), n += f);
|
|
551
|
+
return n;
|
|
552
|
+
}
|
|
553
|
+
function clsx() {
|
|
554
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
555
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
556
|
+
return n;
|
|
557
|
+
}
|
|
558
|
+
var clsx_default = clsx;
|
|
559
|
+
|
|
560
|
+
// components/Nav/src/Nav.styles.ts
|
|
561
|
+
var baseClasses = ["w-full", "font-sans", "text-text-primary"];
|
|
562
|
+
var opaqueClasses = ["bg-page", "border-b", "border-outline"];
|
|
563
|
+
var transparentClasses = ["bg-transparent"];
|
|
564
|
+
var classNames = (transparent) => clsx_default(baseClasses, transparent ? transparentClasses : opaqueClasses);
|
|
565
|
+
var stickyHostClasses = [
|
|
566
|
+
"[:host(&)]:sticky",
|
|
567
|
+
"[:host(&)]:top-0",
|
|
568
|
+
"[:host(&)]:z-50"
|
|
569
|
+
];
|
|
570
|
+
var innerClasses = () => clsx_default("flex", "items-center", "justify-between", "h-16");
|
|
571
|
+
var logoClasses = () => clsx_default("flex-shrink-0");
|
|
572
|
+
var rightClasses = (menuOpen) => clsx_default("flex", "items-center", "gap-6", "max-sm:fixed", "max-sm:inset-x-0", "max-sm:top-16", "max-sm:bottom-0", "max-sm:flex-col", "max-sm:items-stretch", "max-sm:gap-7", "max-sm:p-10", "max-sm:overflow-y-auto", "max-sm:bg-page", "max-sm:border-t", "max-sm:border-outline", "max-sm:transition-[opacity,transform,visibility]", "max-sm:duration-150", "max-sm:ease-in-out", menuOpen ? [
|
|
573
|
+
"max-sm:visible",
|
|
574
|
+
"max-sm:opacity-100",
|
|
575
|
+
"max-sm:pointer-events-auto",
|
|
576
|
+
"max-sm:translate-x-0"
|
|
577
|
+
] : [
|
|
578
|
+
"max-sm:invisible",
|
|
579
|
+
"max-sm:opacity-0",
|
|
580
|
+
"max-sm:pointer-events-none",
|
|
581
|
+
"max-sm:translate-x-full"
|
|
582
|
+
]);
|
|
583
|
+
var linksClasses = () => clsx_default("flex", "items-center", "gap-4", "max-sm:flex-col", "max-sm:items-stretch", "max-sm:gap-0");
|
|
584
|
+
var actionsClasses = () => clsx_default("flex", "items-center", "gap-3", "max-sm:flex-col", "max-sm:items-stretch");
|
|
585
|
+
var menuButtonClasses = () => clsx_default("hidden", "max-sm:grid", "max-sm:size-12", "max-sm:place-items-center", "max-sm:text-text-primary", "max-sm:bg-[color-mix(in_oklab,var(--color-outline)_20%,transparent)]", "max-sm:rounded-input", "cursor-pointer", "max-sm:focus-visible:outline-2", "max-sm:focus-visible:outline-accent", "max-sm:focus-visible:outline-offset-2");
|
|
586
|
+
var linksSlotClasses = () => clsx_default("max-sm:[&::slotted(*)]:block", "max-sm:[&::slotted(*)]:px-6", "max-sm:[&::slotted(*)]:py-5", "max-sm:[&::slotted(*)]:border-b", "max-sm:[&::slotted(*)]:border-outline");
|
|
587
|
+
var actionsSlotClasses = () => clsx_default("max-sm:[&::slotted(*)]:flex", "max-sm:[&::slotted(*)]:flex-1", "max-sm:[&::slotted(*)]:items-center", "max-sm:[&::slotted(*)]:justify-center");
|
|
588
|
+
|
|
589
|
+
// components/Nav/src/Nav.ts
|
|
590
|
+
var DEFAULT_MENU_OPEN_LABEL = "Open navigation menu";
|
|
591
|
+
var DEFAULT_MENU_CLOSE_LABEL = "Close navigation menu";
|
|
592
|
+
|
|
593
|
+
class Nav extends Base {
|
|
594
|
+
constructor() {
|
|
595
|
+
super(...arguments);
|
|
596
|
+
this.surface = surfaceValues.LIGHT;
|
|
597
|
+
this.sticky = false;
|
|
598
|
+
this.transparent = false;
|
|
599
|
+
this.menuOpenLabel = DEFAULT_MENU_OPEN_LABEL;
|
|
600
|
+
this.menuCloseLabel = DEFAULT_MENU_CLOSE_LABEL;
|
|
601
|
+
this.menuOpen = false;
|
|
602
|
+
this.hasNavigationItems = false;
|
|
603
|
+
this.updateNavigationItems = () => {
|
|
604
|
+
this.hasNavigationItems = this.hasSlottedNavigationItems();
|
|
605
|
+
if (!this.hasNavigationItems) {
|
|
606
|
+
this.menuOpen = false;
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
this.handleDropdownToggle = (event) => {
|
|
610
|
+
const dropdownEvent = event;
|
|
611
|
+
if (!dropdownEvent.detail.open) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
const openedLink = dropdownEvent.composedPath().find((target) => target instanceof HTMLElement && target.tagName === "DSGN-NAV-LINK");
|
|
615
|
+
this.closeDropdowns(openedLink);
|
|
616
|
+
};
|
|
617
|
+
this.handleKeydown = (event) => {
|
|
618
|
+
if (event.key === "Escape" && this.menuOpen) {
|
|
619
|
+
this.closeMenu();
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
this.handleMenuClick = (event) => {
|
|
623
|
+
if (event.composedPath().some((target) => target instanceof HTMLAnchorElement)) {
|
|
624
|
+
queueMicrotask(() => this.closeMenu());
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
static styles = [Base.styles, Nav_default];
|
|
629
|
+
connectedCallback() {
|
|
630
|
+
super.connectedCallback();
|
|
631
|
+
this.updateNavigationItems();
|
|
632
|
+
this.addEventListener("keydown", this.handleKeydown);
|
|
633
|
+
this.addEventListener("dsgn-nav-link-toggle", this.handleDropdownToggle);
|
|
634
|
+
}
|
|
635
|
+
disconnectedCallback() {
|
|
636
|
+
this.removeEventListener("keydown", this.handleKeydown);
|
|
637
|
+
this.removeEventListener("dsgn-nav-link-toggle", this.handleDropdownToggle);
|
|
638
|
+
super.disconnectedCallback();
|
|
639
|
+
}
|
|
640
|
+
firstUpdated() {
|
|
641
|
+
this.updateNavigationItems();
|
|
642
|
+
}
|
|
643
|
+
getNavigationLinks() {
|
|
644
|
+
return Array.from(this.children).filter((element) => element.tagName === "DSGN-NAV-LINK" && (element.slot === "links" || element.slot === "actions"));
|
|
645
|
+
}
|
|
646
|
+
hasSlottedNavigationItems() {
|
|
647
|
+
return Array.from(this.children).some((element) => element.slot === "links" || element.slot === "actions");
|
|
648
|
+
}
|
|
649
|
+
updated(changedProperties) {
|
|
650
|
+
super.updated(changedProperties);
|
|
651
|
+
this.updateTheme(changedProperties, this.surface);
|
|
652
|
+
for (const className of stickyHostClasses) {
|
|
653
|
+
this.classList.toggle(className, this.sticky);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
toggleMenu() {
|
|
657
|
+
this.menuOpen = !this.menuOpen;
|
|
658
|
+
if (!this.menuOpen) {
|
|
659
|
+
this.closeDropdowns();
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
closeMenu() {
|
|
663
|
+
this.menuOpen = false;
|
|
664
|
+
this.closeDropdowns();
|
|
665
|
+
}
|
|
666
|
+
closeDropdowns(except) {
|
|
667
|
+
for (const link of this.getNavigationLinks()) {
|
|
668
|
+
if (link !== except) {
|
|
669
|
+
link.closeDropdown();
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
render() {
|
|
674
|
+
return html2`
|
|
675
|
+
<nav class="${classNames(this.transparent)}">
|
|
676
|
+
<dsgn-container
|
|
677
|
+
size="${containerSizeValues.XXL}"
|
|
678
|
+
padding-x="${containerPaddingValues.SM}"
|
|
679
|
+
padding-y="${containerPaddingValues.NONE}"
|
|
680
|
+
>
|
|
681
|
+
<div class="${innerClasses()}">
|
|
682
|
+
<div class="${logoClasses()}">
|
|
683
|
+
<slot name="logo"></slot>
|
|
684
|
+
</div>
|
|
685
|
+
${this.hasNavigationItems ? html2`
|
|
686
|
+
<button
|
|
687
|
+
class="${menuButtonClasses()}"
|
|
688
|
+
type="button"
|
|
689
|
+
aria-controls="mobile-nav-menu"
|
|
690
|
+
aria-expanded=${this.menuOpen ? "true" : "false"}
|
|
691
|
+
aria-label=${this.menuOpen ? this.menuCloseLabel : this.menuOpenLabel}
|
|
692
|
+
@click=${this.toggleMenu}
|
|
693
|
+
>
|
|
694
|
+
<dsgn-icon
|
|
695
|
+
.icon=${this.menuOpen ? x : menu}
|
|
696
|
+
size="xl"
|
|
697
|
+
></dsgn-icon>
|
|
698
|
+
</button>
|
|
699
|
+
` : nothing}
|
|
700
|
+
<div
|
|
701
|
+
id="mobile-nav-menu"
|
|
702
|
+
class="${rightClasses(this.menuOpen)}"
|
|
703
|
+
@click=${this.handleMenuClick}
|
|
704
|
+
>
|
|
705
|
+
<div class="${linksClasses()}">
|
|
706
|
+
<slot
|
|
707
|
+
class="${linksSlotClasses()}"
|
|
708
|
+
name="links"
|
|
709
|
+
@slotchange=${this.updateNavigationItems}
|
|
710
|
+
></slot>
|
|
711
|
+
</div>
|
|
712
|
+
<div class="${actionsClasses()}">
|
|
713
|
+
<slot
|
|
714
|
+
class="${actionsSlotClasses()}"
|
|
715
|
+
name="actions"
|
|
716
|
+
@slotchange=${this.updateNavigationItems}
|
|
717
|
+
></slot>
|
|
718
|
+
</div>
|
|
719
|
+
</div>
|
|
720
|
+
</div>
|
|
721
|
+
</dsgn-container>
|
|
722
|
+
</nav>
|
|
723
|
+
`;
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
__legacyDecorateClassTS([
|
|
727
|
+
property({ ...surfaceProps })
|
|
728
|
+
], Nav.prototype, "surface", undefined);
|
|
729
|
+
__legacyDecorateClassTS([
|
|
730
|
+
property({ type: Boolean, reflect: true })
|
|
731
|
+
], Nav.prototype, "sticky", undefined);
|
|
732
|
+
__legacyDecorateClassTS([
|
|
733
|
+
property({ type: Boolean, reflect: true })
|
|
734
|
+
], Nav.prototype, "transparent", undefined);
|
|
735
|
+
__legacyDecorateClassTS([
|
|
736
|
+
property({ type: String, attribute: "menu-open-label" })
|
|
737
|
+
], Nav.prototype, "menuOpenLabel", undefined);
|
|
738
|
+
__legacyDecorateClassTS([
|
|
739
|
+
property({ type: String, attribute: "menu-close-label" })
|
|
740
|
+
], Nav.prototype, "menuCloseLabel", undefined);
|
|
741
|
+
__legacyDecorateClassTS([
|
|
742
|
+
state()
|
|
743
|
+
], Nav.prototype, "menuOpen", undefined);
|
|
744
|
+
__legacyDecorateClassTS([
|
|
745
|
+
state()
|
|
746
|
+
], Nav.prototype, "hasNavigationItems", undefined);
|
|
747
|
+
defineElement("dsgn-nav", Nav);
|
|
748
|
+
export {
|
|
749
|
+
Nav
|
|
750
|
+
};
|