@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,576 @@
|
|
|
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
|
+
// ../../node_modules/.bun/lit-html@3.3.3/node_modules/lit-html/development/is-server.js
|
|
13
|
+
var NODE_MODE = false;
|
|
14
|
+
var isServer = NODE_MODE;
|
|
15
|
+
|
|
16
|
+
// ../../node_modules/.bun/@lit-labs+observers@2.1.0/node_modules/@lit-labs/observers/development/intersection-controller.js
|
|
17
|
+
class IntersectionController {
|
|
18
|
+
constructor(host, { target, config, callback, skipInitial }) {
|
|
19
|
+
this._targets = new Set;
|
|
20
|
+
this._skipInitial = false;
|
|
21
|
+
this._unobservedUpdate = false;
|
|
22
|
+
this._host = host;
|
|
23
|
+
if (target !== null) {
|
|
24
|
+
this._targets.add(target ?? host);
|
|
25
|
+
}
|
|
26
|
+
this._skipInitial = skipInitial ?? this._skipInitial;
|
|
27
|
+
this.callback = callback;
|
|
28
|
+
if (isServer) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (!window.IntersectionObserver) {
|
|
32
|
+
console.warn(`IntersectionController error: browser does not support IntersectionObserver.`);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this._observer = new IntersectionObserver((entries) => {
|
|
36
|
+
const unobservedUpdate = this._unobservedUpdate;
|
|
37
|
+
this._unobservedUpdate = false;
|
|
38
|
+
if (this._skipInitial && unobservedUpdate) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this.handleChanges(entries);
|
|
42
|
+
this._host.requestUpdate();
|
|
43
|
+
}, config);
|
|
44
|
+
host.addController(this);
|
|
45
|
+
}
|
|
46
|
+
handleChanges(entries) {
|
|
47
|
+
this.value = this.callback?.(entries, this._observer);
|
|
48
|
+
}
|
|
49
|
+
hostConnected() {
|
|
50
|
+
for (const target of this._targets) {
|
|
51
|
+
this.observe(target);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
hostDisconnected() {
|
|
55
|
+
this.disconnect();
|
|
56
|
+
}
|
|
57
|
+
async hostUpdated() {
|
|
58
|
+
const pendingRecords = this._observer.takeRecords();
|
|
59
|
+
if (pendingRecords.length) {
|
|
60
|
+
this.handleChanges(pendingRecords);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
observe(target) {
|
|
64
|
+
this._targets.add(target);
|
|
65
|
+
this._observer.observe(target);
|
|
66
|
+
this._unobservedUpdate = true;
|
|
67
|
+
}
|
|
68
|
+
unobserve(target) {
|
|
69
|
+
this._targets.delete(target);
|
|
70
|
+
this._observer.unobserve(target);
|
|
71
|
+
}
|
|
72
|
+
disconnect() {
|
|
73
|
+
this._observer.disconnect();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// components/Background/src/Background.ts
|
|
78
|
+
import { html as html3, nothing } from "lit";
|
|
79
|
+
import { property } from "lit/decorators.js";
|
|
80
|
+
|
|
81
|
+
// common/Base/Base.ts
|
|
82
|
+
import { html, LitElement } from "lit";
|
|
83
|
+
|
|
84
|
+
// common/helpers/define-element.ts
|
|
85
|
+
var defineElement = (tag, ctor) => {
|
|
86
|
+
if (typeof customElements === "undefined")
|
|
87
|
+
return;
|
|
88
|
+
if (!customElements.get(tag))
|
|
89
|
+
customElements.define(tag, ctor);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// common/Base/Base.css
|
|
93
|
+
import { css } from "lit";
|
|
94
|
+
var styles = css`/* Base reset in @layer base ensures it comes before utilities in Tailwind v4 cascade
|
|
95
|
+
This prevents the reset from overriding component utility classes */
|
|
96
|
+
@layer base {
|
|
97
|
+
:host {
|
|
98
|
+
display: block;
|
|
99
|
+
box-sizing: border-box;
|
|
100
|
+
line-height: 1.5;
|
|
101
|
+
-webkit-text-size-adjust: 100%;
|
|
102
|
+
tab-size: 4;
|
|
103
|
+
font-family: var(
|
|
104
|
+
--default-font-family,
|
|
105
|
+
var(--font-sans, ui-sans-serif, system-ui, sans-serif)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
*,
|
|
110
|
+
*::before,
|
|
111
|
+
*::after {
|
|
112
|
+
box-sizing: inherit;
|
|
113
|
+
margin: 0;
|
|
114
|
+
padding: 0;
|
|
115
|
+
border: 0 solid;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:host h1,
|
|
119
|
+
:host h2,
|
|
120
|
+
:host h3,
|
|
121
|
+
:host h4,
|
|
122
|
+
:host h5,
|
|
123
|
+
:host h6 {
|
|
124
|
+
font-size: inherit;
|
|
125
|
+
font-weight: inherit;
|
|
126
|
+
margin: 0;
|
|
127
|
+
padding: 0;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
var Base_default = styles;
|
|
132
|
+
|
|
133
|
+
// common/Base/Base.ts
|
|
134
|
+
class Base extends LitElement {
|
|
135
|
+
static styles = Base_default;
|
|
136
|
+
updateTheme(changedProperties, surface) {
|
|
137
|
+
if (changedProperties.has("surface")) {
|
|
138
|
+
if (surface) {
|
|
139
|
+
this.setAttribute("data-theme", surface);
|
|
140
|
+
} else {
|
|
141
|
+
this.removeAttribute("data-theme");
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
emit(name, detail, options = {}) {
|
|
146
|
+
return this.dispatchEvent(new CustomEvent(name, {
|
|
147
|
+
detail,
|
|
148
|
+
bubbles: true,
|
|
149
|
+
composed: true,
|
|
150
|
+
cancelable: options.cancelable ?? false
|
|
151
|
+
}));
|
|
152
|
+
}
|
|
153
|
+
render() {
|
|
154
|
+
return html`<slot></slot>`;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
defineElement("dsgn-base", Base);
|
|
158
|
+
|
|
159
|
+
// common/helpers/motion.ts
|
|
160
|
+
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
161
|
+
var cachedMatchMedia;
|
|
162
|
+
var cachedQuery = null;
|
|
163
|
+
function prefersReducedMotion() {
|
|
164
|
+
const mm = typeof matchMedia === "function" ? matchMedia : undefined;
|
|
165
|
+
if (mm !== cachedMatchMedia) {
|
|
166
|
+
cachedMatchMedia = mm;
|
|
167
|
+
cachedQuery = mm ? mm(REDUCED_MOTION_QUERY) : null;
|
|
168
|
+
}
|
|
169
|
+
return cachedQuery?.matches ?? false;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// common/controllers/AuroraMeshController.ts
|
|
173
|
+
var X_MIN = -15;
|
|
174
|
+
var X_MAX = 70;
|
|
175
|
+
var Y_MIN = -20;
|
|
176
|
+
var Y_MAX = 60;
|
|
177
|
+
var TRANSITION_RATIO = 0.85;
|
|
178
|
+
var rand = (min, max) => Math.random() * (max - min) + min;
|
|
179
|
+
var DEFAULT_AURORA_BLOBS = [
|
|
180
|
+
{
|
|
181
|
+
minSize: 500,
|
|
182
|
+
maxSize: 900,
|
|
183
|
+
minOpacity: 0.1,
|
|
184
|
+
maxOpacity: 0.24,
|
|
185
|
+
interval: 5500
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
minSize: 300,
|
|
189
|
+
maxSize: 600,
|
|
190
|
+
minOpacity: 0.06,
|
|
191
|
+
maxOpacity: 0.16,
|
|
192
|
+
interval: 4200
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
minSize: 200,
|
|
196
|
+
maxSize: 450,
|
|
197
|
+
minOpacity: 0.04,
|
|
198
|
+
maxOpacity: 0.12,
|
|
199
|
+
interval: 3500
|
|
200
|
+
}
|
|
201
|
+
];
|
|
202
|
+
|
|
203
|
+
class AuroraMeshController {
|
|
204
|
+
get blobs() {
|
|
205
|
+
return this._states;
|
|
206
|
+
}
|
|
207
|
+
get running() {
|
|
208
|
+
return this._timers.some((id) => id !== null);
|
|
209
|
+
}
|
|
210
|
+
constructor(host, options = {}, canRun = () => true) {
|
|
211
|
+
this.paused = false;
|
|
212
|
+
this.host = host;
|
|
213
|
+
this._configs = options.blobs ?? DEFAULT_AURORA_BLOBS;
|
|
214
|
+
this._opacityScale = options.opacityScale ?? 1;
|
|
215
|
+
this._canRun = canRun;
|
|
216
|
+
this._timers = this._configs.map(() => null);
|
|
217
|
+
this._states = this._configs.map((config) => this._randomState(config));
|
|
218
|
+
host.addController(this);
|
|
219
|
+
}
|
|
220
|
+
hostDisconnected() {
|
|
221
|
+
this._stopAll();
|
|
222
|
+
}
|
|
223
|
+
hostUpdated() {
|
|
224
|
+
this._reconcile();
|
|
225
|
+
}
|
|
226
|
+
setOpacityScale(scale) {
|
|
227
|
+
const prev = this._opacityScale || 1;
|
|
228
|
+
this._opacityScale = scale;
|
|
229
|
+
this._states = this._states.map((state) => ({
|
|
230
|
+
...state,
|
|
231
|
+
opacity: state.opacity / prev * scale
|
|
232
|
+
}));
|
|
233
|
+
this.host.requestUpdate();
|
|
234
|
+
}
|
|
235
|
+
pause() {
|
|
236
|
+
this.paused = true;
|
|
237
|
+
this._stopAll();
|
|
238
|
+
this.host.requestUpdate();
|
|
239
|
+
}
|
|
240
|
+
resume() {
|
|
241
|
+
this.paused = false;
|
|
242
|
+
this.host.requestUpdate();
|
|
243
|
+
}
|
|
244
|
+
get _allowed() {
|
|
245
|
+
return !this.paused && !prefersReducedMotion() && this._canRun();
|
|
246
|
+
}
|
|
247
|
+
_reconcile() {
|
|
248
|
+
if (this._allowed && !this.running) {
|
|
249
|
+
this._startAll();
|
|
250
|
+
} else if (!this._allowed && this.running) {
|
|
251
|
+
this._stopAll();
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
_randomState(config) {
|
|
255
|
+
return {
|
|
256
|
+
x: rand(X_MIN, X_MAX),
|
|
257
|
+
y: rand(Y_MIN, Y_MAX),
|
|
258
|
+
size: rand(config.minSize, config.maxSize),
|
|
259
|
+
opacity: rand(config.minOpacity, config.maxOpacity) * this._opacityScale,
|
|
260
|
+
transitionMs: config.transitionMs ?? config.interval * TRANSITION_RATIO
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
_startAll() {
|
|
264
|
+
this._configs.forEach((config, i) => {
|
|
265
|
+
if (this._timers[i] !== null)
|
|
266
|
+
return;
|
|
267
|
+
this._timers[i] = setInterval(() => {
|
|
268
|
+
this._states[i] = this._randomState(config);
|
|
269
|
+
this.host.requestUpdate();
|
|
270
|
+
}, config.interval);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
_stopAll() {
|
|
274
|
+
this._timers.forEach((id, i) => {
|
|
275
|
+
if (id !== null) {
|
|
276
|
+
clearInterval(id);
|
|
277
|
+
this._timers[i] = null;
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// common/helpers/aurora-mesh.ts
|
|
284
|
+
import { html as html2 } from "lit";
|
|
285
|
+
import { styleMap } from "lit/directives/style-map.js";
|
|
286
|
+
var HEIGHT_RATIO = 0.75;
|
|
287
|
+
var BLUR_PX = 80;
|
|
288
|
+
var BASE_SIZE = 600;
|
|
289
|
+
var EASE = "cubic-bezier(0.4, 0, 0.2, 1)";
|
|
290
|
+
var DEFAULT_GRADIENT = "radial-gradient(circle, " + "var(--dsgn-aurora-color-1, var(--color-orange-500)) 0%, " + "var(--dsgn-aurora-color-2, var(--color-orange-600)) 35%, " + "var(--dsgn-aurora-color-3, var(--color-orange-900)) 65%, " + "transparent 80%)";
|
|
291
|
+
var CONTAINER_STYLE = {
|
|
292
|
+
position: "absolute",
|
|
293
|
+
inset: "0",
|
|
294
|
+
overflow: "hidden",
|
|
295
|
+
pointerEvents: "none",
|
|
296
|
+
zIndex: "0"
|
|
297
|
+
};
|
|
298
|
+
var blobStyle = (b) => ({
|
|
299
|
+
position: "absolute",
|
|
300
|
+
width: `${BASE_SIZE}px`,
|
|
301
|
+
height: `${BASE_SIZE * HEIGHT_RATIO}px`,
|
|
302
|
+
left: "0",
|
|
303
|
+
top: "0",
|
|
304
|
+
transform: `translate(-50%, -50%) scale(${b.size / BASE_SIZE})`,
|
|
305
|
+
borderRadius: "50%",
|
|
306
|
+
background: `var(--dsgn-aurora-gradient, ${DEFAULT_GRADIENT})`,
|
|
307
|
+
filter: `blur(${BLUR_PX}px)`,
|
|
308
|
+
opacity: `${b.opacity}`,
|
|
309
|
+
transition: `transform ${b.transitionMs}ms ease, ` + `opacity ${b.transitionMs}ms ease`,
|
|
310
|
+
pointerEvents: "none"
|
|
311
|
+
});
|
|
312
|
+
var driftStyle = (b) => ({
|
|
313
|
+
position: "absolute",
|
|
314
|
+
inset: "0",
|
|
315
|
+
transform: `translate(${b.x}%, ${b.y}%)`,
|
|
316
|
+
transition: `transform ${b.transitionMs}ms ${EASE}`,
|
|
317
|
+
pointerEvents: "none"
|
|
318
|
+
});
|
|
319
|
+
var renderAuroraMesh = (controller) => html2`
|
|
320
|
+
<div
|
|
321
|
+
class="aurora-mesh"
|
|
322
|
+
aria-hidden="true"
|
|
323
|
+
style=${styleMap(CONTAINER_STYLE)}
|
|
324
|
+
>
|
|
325
|
+
${controller.blobs.map((b) => html2`
|
|
326
|
+
<div style=${styleMap(driftStyle(b))}>
|
|
327
|
+
<div style=${styleMap(blobStyle(b))}></div>
|
|
328
|
+
</div>
|
|
329
|
+
`)}
|
|
330
|
+
</div>
|
|
331
|
+
`;
|
|
332
|
+
|
|
333
|
+
// common/helpers/enum-validator.ts
|
|
334
|
+
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
335
|
+
if (!enumSet.has(candidateValue)) {
|
|
336
|
+
throw new Error(`Invalid prop ${propName} of value ${candidateValue}. Expected one of: ${Array.from(enumSet).join(", ")}`);
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// common/helpers/enum-creator.ts
|
|
341
|
+
var enumCreator = (acceptableValues, propName, type, other = {}) => {
|
|
342
|
+
const acceptableValuesSet = new Set(acceptableValues);
|
|
343
|
+
return {
|
|
344
|
+
type,
|
|
345
|
+
hasChanged(newValue, oldValue) {
|
|
346
|
+
if (newValue !== oldValue) {
|
|
347
|
+
enumValidator(propName, acceptableValuesSet, newValue);
|
|
348
|
+
return true;
|
|
349
|
+
}
|
|
350
|
+
return false;
|
|
351
|
+
},
|
|
352
|
+
...other
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
// common/props/surface/surface.props.ts
|
|
357
|
+
var surfaceValues = {
|
|
358
|
+
LIGHT: "light",
|
|
359
|
+
DARK: "dark"
|
|
360
|
+
};
|
|
361
|
+
var surfaceProps = enumCreator(Object.values(surfaceValues), "surface", String, { reflect: true });
|
|
362
|
+
|
|
363
|
+
// components/Background/src/Background.css
|
|
364
|
+
import { css as css2 } from "lit";
|
|
365
|
+
var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
366
|
+
@layer properties;
|
|
367
|
+
@layer theme {
|
|
368
|
+
:root, :host {
|
|
369
|
+
--color-brand-subtle: inherit;
|
|
370
|
+
--color-page: inherit;
|
|
371
|
+
--color-text-primary: inherit;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
@layer utilities {
|
|
375
|
+
.relative {
|
|
376
|
+
position: relative;
|
|
377
|
+
}
|
|
378
|
+
.static {
|
|
379
|
+
position: static;
|
|
380
|
+
}
|
|
381
|
+
.z-10 {
|
|
382
|
+
z-index: 10;
|
|
383
|
+
}
|
|
384
|
+
.w-full {
|
|
385
|
+
width: 100%;
|
|
386
|
+
}
|
|
387
|
+
.overflow-hidden {
|
|
388
|
+
overflow: hidden;
|
|
389
|
+
}
|
|
390
|
+
.bg-page {
|
|
391
|
+
background-color: var(--color-page);
|
|
392
|
+
}
|
|
393
|
+
.bg-linear-to-b {
|
|
394
|
+
--tw-gradient-position: to bottom;
|
|
395
|
+
@supports (background-image: linear-gradient(in lab, red, red)) {
|
|
396
|
+
--tw-gradient-position: to bottom in oklab;
|
|
397
|
+
}
|
|
398
|
+
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
399
|
+
}
|
|
400
|
+
.from-brand-subtle {
|
|
401
|
+
--tw-gradient-from: var(--color-brand-subtle);
|
|
402
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
403
|
+
}
|
|
404
|
+
.to-page {
|
|
405
|
+
--tw-gradient-to: var(--color-page);
|
|
406
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
407
|
+
}
|
|
408
|
+
.text-text-primary {
|
|
409
|
+
color: var(--color-text-primary);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
@property --dsgn-border-sweep-angle {
|
|
413
|
+
syntax: '<angle>';
|
|
414
|
+
inherits: false;
|
|
415
|
+
initial-value: 0deg;
|
|
416
|
+
}
|
|
417
|
+
@property --tw-gradient-position {
|
|
418
|
+
syntax: "*";
|
|
419
|
+
inherits: false;
|
|
420
|
+
}
|
|
421
|
+
@property --tw-gradient-from {
|
|
422
|
+
syntax: "<color>";
|
|
423
|
+
inherits: false;
|
|
424
|
+
initial-value: #0000;
|
|
425
|
+
}
|
|
426
|
+
@property --tw-gradient-via {
|
|
427
|
+
syntax: "<color>";
|
|
428
|
+
inherits: false;
|
|
429
|
+
initial-value: #0000;
|
|
430
|
+
}
|
|
431
|
+
@property --tw-gradient-to {
|
|
432
|
+
syntax: "<color>";
|
|
433
|
+
inherits: false;
|
|
434
|
+
initial-value: #0000;
|
|
435
|
+
}
|
|
436
|
+
@property --tw-gradient-stops {
|
|
437
|
+
syntax: "*";
|
|
438
|
+
inherits: false;
|
|
439
|
+
}
|
|
440
|
+
@property --tw-gradient-via-stops {
|
|
441
|
+
syntax: "*";
|
|
442
|
+
inherits: false;
|
|
443
|
+
}
|
|
444
|
+
@property --tw-gradient-from-position {
|
|
445
|
+
syntax: "<length-percentage>";
|
|
446
|
+
inherits: false;
|
|
447
|
+
initial-value: 0%;
|
|
448
|
+
}
|
|
449
|
+
@property --tw-gradient-via-position {
|
|
450
|
+
syntax: "<length-percentage>";
|
|
451
|
+
inherits: false;
|
|
452
|
+
initial-value: 50%;
|
|
453
|
+
}
|
|
454
|
+
@property --tw-gradient-to-position {
|
|
455
|
+
syntax: "<length-percentage>";
|
|
456
|
+
inherits: false;
|
|
457
|
+
initial-value: 100%;
|
|
458
|
+
}
|
|
459
|
+
@layer properties {
|
|
460
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
461
|
+
*, ::before, ::after, ::backdrop {
|
|
462
|
+
--tw-gradient-position: initial;
|
|
463
|
+
--tw-gradient-from: #0000;
|
|
464
|
+
--tw-gradient-via: #0000;
|
|
465
|
+
--tw-gradient-to: #0000;
|
|
466
|
+
--tw-gradient-stops: initial;
|
|
467
|
+
--tw-gradient-via-stops: initial;
|
|
468
|
+
--tw-gradient-from-position: 0%;
|
|
469
|
+
--tw-gradient-via-position: 50%;
|
|
470
|
+
--tw-gradient-to-position: 100%;
|
|
471
|
+
--dsgn-border-sweep-angle: 0deg;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
`;
|
|
476
|
+
var Background_default = styles2;
|
|
477
|
+
|
|
478
|
+
// components/Background/src/Background.props.ts
|
|
479
|
+
var backgroundVariantValues = {
|
|
480
|
+
SOLID: "solid",
|
|
481
|
+
GRADIENT: "gradient"
|
|
482
|
+
};
|
|
483
|
+
var backgroundVariantProps = enumCreator(Object.values(backgroundVariantValues), "variant", String, { reflect: true });
|
|
484
|
+
var auroraIntensityValues = {
|
|
485
|
+
SUBTLE: "subtle",
|
|
486
|
+
NORMAL: "normal",
|
|
487
|
+
VIVID: "vivid"
|
|
488
|
+
};
|
|
489
|
+
var INTENSITY_SCALE = {
|
|
490
|
+
subtle: 0.6,
|
|
491
|
+
normal: 1,
|
|
492
|
+
vivid: 1.5
|
|
493
|
+
};
|
|
494
|
+
var backgroundIntensityProps = enumCreator(Object.values(auroraIntensityValues), "intensity", String, { reflect: true });
|
|
495
|
+
|
|
496
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
497
|
+
function r(e) {
|
|
498
|
+
var t, f, n = "";
|
|
499
|
+
if (typeof e == "string" || typeof e == "number")
|
|
500
|
+
n += e;
|
|
501
|
+
else if (typeof e == "object")
|
|
502
|
+
if (Array.isArray(e)) {
|
|
503
|
+
var o = e.length;
|
|
504
|
+
for (t = 0;t < o; t++)
|
|
505
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
506
|
+
} else
|
|
507
|
+
for (f in e)
|
|
508
|
+
e[f] && (n && (n += " "), n += f);
|
|
509
|
+
return n;
|
|
510
|
+
}
|
|
511
|
+
function clsx() {
|
|
512
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
513
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
514
|
+
return n;
|
|
515
|
+
}
|
|
516
|
+
var clsx_default = clsx;
|
|
517
|
+
|
|
518
|
+
// components/Background/src/Background.styles.ts
|
|
519
|
+
var variantClasses = {
|
|
520
|
+
solid: "bg-page",
|
|
521
|
+
gradient: ["bg-linear-to-b", "from-brand-subtle", "to-page"]
|
|
522
|
+
};
|
|
523
|
+
var wrapperClassNames = (variant) => {
|
|
524
|
+
return clsx_default("relative", "w-full", "overflow-hidden", "text-text-primary", variantClasses[variant]);
|
|
525
|
+
};
|
|
526
|
+
var contentClassNames = () => {
|
|
527
|
+
return clsx_default("relative", "z-10");
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
// components/Background/src/Background.ts
|
|
531
|
+
class Background extends Base {
|
|
532
|
+
static styles = [Base.styles, Background_default];
|
|
533
|
+
constructor() {
|
|
534
|
+
super();
|
|
535
|
+
this._inView = new IntersectionController(this, {
|
|
536
|
+
config: { threshold: 0 },
|
|
537
|
+
callback: (entries) => entries[entries.length - 1]?.isIntersecting ?? false
|
|
538
|
+
});
|
|
539
|
+
this.variant = backgroundVariantValues.SOLID;
|
|
540
|
+
this.aurora = false;
|
|
541
|
+
this.intensity = auroraIntensityValues.NORMAL;
|
|
542
|
+
this.surface = surfaceValues.DARK;
|
|
543
|
+
this._mesh = new AuroraMeshController(this, { opacityScale: INTENSITY_SCALE[this.intensity] }, () => this.aurora && this._inView.value === true);
|
|
544
|
+
}
|
|
545
|
+
updated(changedProperties) {
|
|
546
|
+
super.updated(changedProperties);
|
|
547
|
+
this.updateTheme(changedProperties, this.surface);
|
|
548
|
+
if (changedProperties.has("intensity")) {
|
|
549
|
+
this._mesh.setOpacityScale(INTENSITY_SCALE[this.intensity]);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
render() {
|
|
553
|
+
return html3`<div class="${wrapperClassNames(this.variant)}">
|
|
554
|
+
${this.aurora ? renderAuroraMesh(this._mesh) : nothing}
|
|
555
|
+
<div class="${contentClassNames()}">
|
|
556
|
+
<slot></slot>
|
|
557
|
+
</div>
|
|
558
|
+
</div>`;
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
__legacyDecorateClassTS([
|
|
562
|
+
property({ ...backgroundVariantProps })
|
|
563
|
+
], Background.prototype, "variant", undefined);
|
|
564
|
+
__legacyDecorateClassTS([
|
|
565
|
+
property({ type: Boolean, reflect: true })
|
|
566
|
+
], Background.prototype, "aurora", undefined);
|
|
567
|
+
__legacyDecorateClassTS([
|
|
568
|
+
property({ ...backgroundIntensityProps })
|
|
569
|
+
], Background.prototype, "intensity", undefined);
|
|
570
|
+
__legacyDecorateClassTS([
|
|
571
|
+
property({ ...surfaceProps })
|
|
572
|
+
], Background.prototype, "surface", undefined);
|
|
573
|
+
defineElement("dsgn-background", Background);
|
|
574
|
+
export {
|
|
575
|
+
Background
|
|
576
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const backgroundVariantValues: {
|
|
2
|
+
readonly SOLID: "solid";
|
|
3
|
+
readonly GRADIENT: "gradient";
|
|
4
|
+
};
|
|
5
|
+
export type BackgroundVariantType = (typeof backgroundVariantValues)[keyof typeof backgroundVariantValues];
|
|
6
|
+
export declare const backgroundVariantProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Brightness steps for the aurora overlay. Defined here (a Lit-free module) so
|
|
9
|
+
* `@ds-gn/ui/background/props` stays safe to import in non-DOM contexts
|
|
10
|
+
* (e.g. the Sanity seed scripts). Background is the sole aurora-mesh consumer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const auroraIntensityValues: {
|
|
13
|
+
readonly SUBTLE: "subtle";
|
|
14
|
+
readonly NORMAL: "normal";
|
|
15
|
+
readonly VIVID: "vivid";
|
|
16
|
+
};
|
|
17
|
+
export type AuroraIntensityType = (typeof auroraIntensityValues)[keyof typeof auroraIntensityValues];
|
|
18
|
+
/** Opacity multipliers applied to every blob, keyed by intensity step. */
|
|
19
|
+
export declare const INTENSITY_SCALE: Record<AuroraIntensityType, number>;
|
|
20
|
+
export declare const backgroundIntensityProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
@@ -0,0 +1,47 @@
|
|
|
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/Background/src/Background.props.ts
|
|
25
|
+
var backgroundVariantValues = {
|
|
26
|
+
SOLID: "solid",
|
|
27
|
+
GRADIENT: "gradient"
|
|
28
|
+
};
|
|
29
|
+
var backgroundVariantProps = enumCreator(Object.values(backgroundVariantValues), "variant", String, { reflect: true });
|
|
30
|
+
var auroraIntensityValues = {
|
|
31
|
+
SUBTLE: "subtle",
|
|
32
|
+
NORMAL: "normal",
|
|
33
|
+
VIVID: "vivid"
|
|
34
|
+
};
|
|
35
|
+
var INTENSITY_SCALE = {
|
|
36
|
+
subtle: 0.6,
|
|
37
|
+
normal: 1,
|
|
38
|
+
vivid: 1.5
|
|
39
|
+
};
|
|
40
|
+
var backgroundIntensityProps = enumCreator(Object.values(auroraIntensityValues), "intensity", String, { reflect: true });
|
|
41
|
+
export {
|
|
42
|
+
INTENSITY_SCALE,
|
|
43
|
+
auroraIntensityValues,
|
|
44
|
+
backgroundIntensityProps,
|
|
45
|
+
backgroundVariantProps,
|
|
46
|
+
backgroundVariantValues
|
|
47
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
3
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
4
|
+
import { type CSSResultGroup } from 'lit';
|
|
5
|
+
import { type BadgeSizeType, type BadgeVariantType } from './Badge.props.js';
|
|
6
|
+
/** @slot - Badge label. */
|
|
7
|
+
export declare class Badge extends Base {
|
|
8
|
+
static styles: CSSResultGroup;
|
|
9
|
+
/**
|
|
10
|
+
* Surface theme variant (light or dark)
|
|
11
|
+
*/
|
|
12
|
+
surface: SurfaceType;
|
|
13
|
+
/**
|
|
14
|
+
* Visual variant
|
|
15
|
+
*/
|
|
16
|
+
variant: BadgeVariantType;
|
|
17
|
+
/**
|
|
18
|
+
* Size variant
|
|
19
|
+
*/
|
|
20
|
+
size: BadgeSizeType;
|
|
21
|
+
render(): import("lit").TemplateResult<1>;
|
|
22
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
23
|
+
}
|
|
24
|
+
declare global {
|
|
25
|
+
interface HTMLElementTagNameMap {
|
|
26
|
+
'dsgn-badge': Badge;
|
|
27
|
+
}
|
|
28
|
+
}
|