@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,456 @@
|
|
|
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
|
+
// common/Base/Base.ts
|
|
13
|
+
import { html, LitElement } from "lit";
|
|
14
|
+
|
|
15
|
+
// common/helpers/define-element.ts
|
|
16
|
+
var defineElement = (tag, ctor) => {
|
|
17
|
+
if (typeof customElements === "undefined")
|
|
18
|
+
return;
|
|
19
|
+
if (!customElements.get(tag))
|
|
20
|
+
customElements.define(tag, ctor);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// common/Base/Base.css
|
|
24
|
+
import { css } from "lit";
|
|
25
|
+
var styles = css`/* Base reset in @layer base ensures it comes before utilities in Tailwind v4 cascade
|
|
26
|
+
This prevents the reset from overriding component utility classes */
|
|
27
|
+
@layer base {
|
|
28
|
+
:host {
|
|
29
|
+
display: block;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
line-height: 1.5;
|
|
32
|
+
-webkit-text-size-adjust: 100%;
|
|
33
|
+
tab-size: 4;
|
|
34
|
+
font-family: var(
|
|
35
|
+
--default-font-family,
|
|
36
|
+
var(--font-sans, ui-sans-serif, system-ui, sans-serif)
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
*,
|
|
41
|
+
*::before,
|
|
42
|
+
*::after {
|
|
43
|
+
box-sizing: inherit;
|
|
44
|
+
margin: 0;
|
|
45
|
+
padding: 0;
|
|
46
|
+
border: 0 solid;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
:host h1,
|
|
50
|
+
:host h2,
|
|
51
|
+
:host h3,
|
|
52
|
+
:host h4,
|
|
53
|
+
:host h5,
|
|
54
|
+
:host h6 {
|
|
55
|
+
font-size: inherit;
|
|
56
|
+
font-weight: inherit;
|
|
57
|
+
margin: 0;
|
|
58
|
+
padding: 0;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
var Base_default = styles;
|
|
63
|
+
|
|
64
|
+
// common/Base/Base.ts
|
|
65
|
+
class Base extends LitElement {
|
|
66
|
+
static styles = Base_default;
|
|
67
|
+
updateTheme(changedProperties, surface) {
|
|
68
|
+
if (changedProperties.has("surface")) {
|
|
69
|
+
if (surface) {
|
|
70
|
+
this.setAttribute("data-theme", surface);
|
|
71
|
+
} else {
|
|
72
|
+
this.removeAttribute("data-theme");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
emit(name, detail, options = {}) {
|
|
77
|
+
return this.dispatchEvent(new CustomEvent(name, {
|
|
78
|
+
detail,
|
|
79
|
+
bubbles: true,
|
|
80
|
+
composed: true,
|
|
81
|
+
cancelable: options.cancelable ?? false
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
return html`<slot></slot>`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
defineElement("dsgn-base", Base);
|
|
89
|
+
|
|
90
|
+
// common/helpers/enum-validator.ts
|
|
91
|
+
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
92
|
+
if (!enumSet.has(candidateValue)) {
|
|
93
|
+
throw new Error(`Invalid prop ${propName} of value ${candidateValue}. Expected one of: ${Array.from(enumSet).join(", ")}`);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// common/helpers/enum-creator.ts
|
|
98
|
+
var enumCreator = (acceptableValues, propName, type, other = {}) => {
|
|
99
|
+
const acceptableValuesSet = new Set(acceptableValues);
|
|
100
|
+
return {
|
|
101
|
+
type,
|
|
102
|
+
hasChanged(newValue, oldValue) {
|
|
103
|
+
if (newValue !== oldValue) {
|
|
104
|
+
enumValidator(propName, acceptableValuesSet, newValue);
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
return false;
|
|
108
|
+
},
|
|
109
|
+
...other
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
// common/props/surface/surface.props.ts
|
|
114
|
+
var surfaceValues = {
|
|
115
|
+
LIGHT: "light",
|
|
116
|
+
DARK: "dark"
|
|
117
|
+
};
|
|
118
|
+
var surfaceProps = enumCreator(Object.values(surfaceValues), "surface", String, { reflect: true });
|
|
119
|
+
|
|
120
|
+
// components/Image/src/Image.ts
|
|
121
|
+
import { html as html2, nothing, svg } from "lit";
|
|
122
|
+
import { property } from "lit/decorators.js";
|
|
123
|
+
import { state } from "lit/decorators.js";
|
|
124
|
+
|
|
125
|
+
// components/Image/src/Image.css
|
|
126
|
+
import { css as css2 } from "lit";
|
|
127
|
+
var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
128
|
+
@layer properties;
|
|
129
|
+
@layer theme {
|
|
130
|
+
:root, :host {
|
|
131
|
+
--spacing: 0.25rem;
|
|
132
|
+
--radius-sm: 0.25rem;
|
|
133
|
+
--radius-md: 0.375rem;
|
|
134
|
+
--radius-lg: 0.5rem;
|
|
135
|
+
--radius-xl: 0.75rem;
|
|
136
|
+
--aspect-video: 16 / 9;
|
|
137
|
+
--color-surface-elevated: inherit;
|
|
138
|
+
--color-text-tertiary: inherit;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
@layer utilities {
|
|
142
|
+
.static {
|
|
143
|
+
position: static;
|
|
144
|
+
}
|
|
145
|
+
.block {
|
|
146
|
+
display: block;
|
|
147
|
+
}
|
|
148
|
+
.flex {
|
|
149
|
+
display: flex;
|
|
150
|
+
}
|
|
151
|
+
.aspect-\\[3\\/4\\] {
|
|
152
|
+
aspect-ratio: 3/4;
|
|
153
|
+
}
|
|
154
|
+
.aspect-\\[4\\/3\\] {
|
|
155
|
+
aspect-ratio: 4/3;
|
|
156
|
+
}
|
|
157
|
+
.aspect-\\[21\\/9\\] {
|
|
158
|
+
aspect-ratio: 21/9;
|
|
159
|
+
}
|
|
160
|
+
.aspect-square {
|
|
161
|
+
aspect-ratio: 1 / 1;
|
|
162
|
+
}
|
|
163
|
+
.aspect-video {
|
|
164
|
+
aspect-ratio: var(--aspect-video);
|
|
165
|
+
}
|
|
166
|
+
.h-8 {
|
|
167
|
+
height: calc(var(--spacing) * 8);
|
|
168
|
+
}
|
|
169
|
+
.h-full {
|
|
170
|
+
height: 100%;
|
|
171
|
+
}
|
|
172
|
+
.w-8 {
|
|
173
|
+
width: calc(var(--spacing) * 8);
|
|
174
|
+
}
|
|
175
|
+
.w-full {
|
|
176
|
+
width: 100%;
|
|
177
|
+
}
|
|
178
|
+
.items-center {
|
|
179
|
+
align-items: center;
|
|
180
|
+
}
|
|
181
|
+
.justify-center {
|
|
182
|
+
justify-content: center;
|
|
183
|
+
}
|
|
184
|
+
.overflow-hidden {
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
}
|
|
187
|
+
.rounded-full {
|
|
188
|
+
border-radius: calc(infinity * 1px);
|
|
189
|
+
}
|
|
190
|
+
.rounded-lg {
|
|
191
|
+
border-radius: var(--radius-lg);
|
|
192
|
+
}
|
|
193
|
+
.rounded-md {
|
|
194
|
+
border-radius: var(--radius-md);
|
|
195
|
+
}
|
|
196
|
+
.rounded-none {
|
|
197
|
+
border-radius: 0;
|
|
198
|
+
}
|
|
199
|
+
.rounded-sm {
|
|
200
|
+
border-radius: var(--radius-sm);
|
|
201
|
+
}
|
|
202
|
+
.rounded-xl {
|
|
203
|
+
border-radius: var(--radius-xl);
|
|
204
|
+
}
|
|
205
|
+
.bg-surface-elevated {
|
|
206
|
+
background-color: var(--color-surface-elevated);
|
|
207
|
+
}
|
|
208
|
+
.object-contain {
|
|
209
|
+
object-fit: contain;
|
|
210
|
+
}
|
|
211
|
+
.object-cover {
|
|
212
|
+
object-fit: cover;
|
|
213
|
+
}
|
|
214
|
+
.object-fill {
|
|
215
|
+
object-fit: fill;
|
|
216
|
+
}
|
|
217
|
+
.object-none {
|
|
218
|
+
object-fit: none;
|
|
219
|
+
}
|
|
220
|
+
.object-scale-down {
|
|
221
|
+
object-fit: scale-down;
|
|
222
|
+
}
|
|
223
|
+
.text-text-tertiary {
|
|
224
|
+
color: var(--color-text-tertiary);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
@property --dsgn-border-sweep-angle {
|
|
228
|
+
syntax: '<angle>';
|
|
229
|
+
inherits: false;
|
|
230
|
+
initial-value: 0deg;
|
|
231
|
+
}
|
|
232
|
+
@layer properties {
|
|
233
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
234
|
+
*, ::before, ::after, ::backdrop {
|
|
235
|
+
--dsgn-border-sweep-angle: 0deg;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
`;
|
|
240
|
+
var Image_default = styles2;
|
|
241
|
+
|
|
242
|
+
// components/Image/src/Image.props.ts
|
|
243
|
+
var imageFitValues = {
|
|
244
|
+
COVER: "cover",
|
|
245
|
+
CONTAIN: "contain",
|
|
246
|
+
FILL: "fill",
|
|
247
|
+
NONE: "none",
|
|
248
|
+
SCALE_DOWN: "scale-down"
|
|
249
|
+
};
|
|
250
|
+
var imageFitProps = enumCreator(Object.values(imageFitValues), "fit", String, { reflect: true });
|
|
251
|
+
var imageAspectValues = {
|
|
252
|
+
AUTO: "auto",
|
|
253
|
+
SQUARE: "square",
|
|
254
|
+
VIDEO: "video",
|
|
255
|
+
PHOTO: "photo",
|
|
256
|
+
PORTRAIT: "portrait",
|
|
257
|
+
WIDE: "wide"
|
|
258
|
+
};
|
|
259
|
+
var imageAspectProps = enumCreator(Object.values(imageAspectValues), "aspect", String, { reflect: true });
|
|
260
|
+
var imageRadiusValues = {
|
|
261
|
+
NONE: "none",
|
|
262
|
+
SM: "sm",
|
|
263
|
+
MD: "md",
|
|
264
|
+
LG: "lg",
|
|
265
|
+
XL: "xl",
|
|
266
|
+
FULL: "full"
|
|
267
|
+
};
|
|
268
|
+
var imageRadiusProps = enumCreator(Object.values(imageRadiusValues), "radius", String, { reflect: true });
|
|
269
|
+
var imageLoadingValues = {
|
|
270
|
+
LAZY: "lazy",
|
|
271
|
+
EAGER: "eager"
|
|
272
|
+
};
|
|
273
|
+
var imageLoadingProps = enumCreator(Object.values(imageLoadingValues), "loading", String, { reflect: true });
|
|
274
|
+
|
|
275
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
276
|
+
function r(e) {
|
|
277
|
+
var t, f, n = "";
|
|
278
|
+
if (typeof e == "string" || typeof e == "number")
|
|
279
|
+
n += e;
|
|
280
|
+
else if (typeof e == "object")
|
|
281
|
+
if (Array.isArray(e)) {
|
|
282
|
+
var o = e.length;
|
|
283
|
+
for (t = 0;t < o; t++)
|
|
284
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
285
|
+
} else
|
|
286
|
+
for (f in e)
|
|
287
|
+
e[f] && (n && (n += " "), n += f);
|
|
288
|
+
return n;
|
|
289
|
+
}
|
|
290
|
+
function clsx() {
|
|
291
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
292
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
293
|
+
return n;
|
|
294
|
+
}
|
|
295
|
+
var clsx_default = clsx;
|
|
296
|
+
|
|
297
|
+
// components/Image/src/Image.styles.ts
|
|
298
|
+
var fitClasses = {
|
|
299
|
+
[imageFitValues.COVER]: ["object-cover"],
|
|
300
|
+
[imageFitValues.CONTAIN]: ["object-contain"],
|
|
301
|
+
[imageFitValues.FILL]: ["object-fill"],
|
|
302
|
+
[imageFitValues.NONE]: ["object-none"],
|
|
303
|
+
[imageFitValues.SCALE_DOWN]: ["object-scale-down"]
|
|
304
|
+
};
|
|
305
|
+
var aspectClasses = {
|
|
306
|
+
[imageAspectValues.AUTO]: [],
|
|
307
|
+
[imageAspectValues.SQUARE]: ["aspect-square"],
|
|
308
|
+
[imageAspectValues.VIDEO]: ["aspect-video"],
|
|
309
|
+
[imageAspectValues.PHOTO]: ["aspect-[4/3]"],
|
|
310
|
+
[imageAspectValues.PORTRAIT]: ["aspect-[3/4]"],
|
|
311
|
+
[imageAspectValues.WIDE]: ["aspect-[21/9]"]
|
|
312
|
+
};
|
|
313
|
+
var radiusClasses = {
|
|
314
|
+
[imageRadiusValues.NONE]: ["rounded-none"],
|
|
315
|
+
[imageRadiusValues.SM]: ["rounded-sm"],
|
|
316
|
+
[imageRadiusValues.MD]: ["rounded-md"],
|
|
317
|
+
[imageRadiusValues.LG]: ["rounded-lg"],
|
|
318
|
+
[imageRadiusValues.XL]: ["rounded-xl"],
|
|
319
|
+
[imageRadiusValues.FULL]: ["rounded-full"]
|
|
320
|
+
};
|
|
321
|
+
var classNames = (fit, aspect, radius) => clsx_default("block", "w-full", "h-full", fitClasses[fit], aspectClasses[aspect], radiusClasses[radius]);
|
|
322
|
+
var wrapperClasses = (aspect, radius) => clsx_default("block", "overflow-hidden", aspectClasses[aspect], radiusClasses[radius]);
|
|
323
|
+
var errorContainerClasses = (aspect, radius) => clsx_default("flex", "items-center", "justify-center", "w-full", "bg-surface-elevated", "text-text-tertiary", aspectClasses[aspect], radiusClasses[radius]);
|
|
324
|
+
|
|
325
|
+
// components/Image/src/Image.ts
|
|
326
|
+
var errorIcon = svg`<circle cx="12" cy="12" r="10" /><line x1="12" x2="12" y1="8" y2="12" /><line x1="12" x2="12.01" y1="16" y2="16" />`;
|
|
327
|
+
|
|
328
|
+
class Image extends Base {
|
|
329
|
+
constructor() {
|
|
330
|
+
super(...arguments);
|
|
331
|
+
this.surface = surfaceValues.LIGHT;
|
|
332
|
+
this.fit = imageFitValues.COVER;
|
|
333
|
+
this.aspect = imageAspectValues.AUTO;
|
|
334
|
+
this.radius = imageRadiusValues.NONE;
|
|
335
|
+
this.loading = imageLoadingValues.LAZY;
|
|
336
|
+
this.src = "";
|
|
337
|
+
this.alt = "";
|
|
338
|
+
this.srcset = "";
|
|
339
|
+
this.sizes = "";
|
|
340
|
+
this.fetchpriority = "";
|
|
341
|
+
this.fallbackSrc = "";
|
|
342
|
+
this._hasError = false;
|
|
343
|
+
}
|
|
344
|
+
static styles = [Base.styles, Image_default];
|
|
345
|
+
_handleError() {
|
|
346
|
+
this._hasError = true;
|
|
347
|
+
this.emit("dsgn-image-error", { src: this.src });
|
|
348
|
+
}
|
|
349
|
+
willUpdate(changedProperties) {
|
|
350
|
+
super.willUpdate(changedProperties);
|
|
351
|
+
if (changedProperties.has("src") && changedProperties.get("src") !== undefined) {
|
|
352
|
+
this._hasError = false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
updated(changedProperties) {
|
|
356
|
+
super.updated(changedProperties);
|
|
357
|
+
this.updateTheme(changedProperties, this.surface);
|
|
358
|
+
}
|
|
359
|
+
#renderError() {
|
|
360
|
+
return html2`<div
|
|
361
|
+
class="${errorContainerClasses(this.aspect, this.radius)}"
|
|
362
|
+
role=${this.alt ? "img" : "presentation"}
|
|
363
|
+
aria-label=${this.alt || nothing}
|
|
364
|
+
>
|
|
365
|
+
<slot name="error">
|
|
366
|
+
<svg
|
|
367
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
368
|
+
viewBox="0 0 24 24"
|
|
369
|
+
fill="none"
|
|
370
|
+
stroke="currentColor"
|
|
371
|
+
stroke-width="2"
|
|
372
|
+
stroke-linecap="round"
|
|
373
|
+
stroke-linejoin="round"
|
|
374
|
+
class="w-8 h-8"
|
|
375
|
+
aria-hidden="true"
|
|
376
|
+
>
|
|
377
|
+
${errorIcon}
|
|
378
|
+
</svg>
|
|
379
|
+
</slot>
|
|
380
|
+
</div>`;
|
|
381
|
+
}
|
|
382
|
+
#renderFallback() {
|
|
383
|
+
return html2`<div class="${wrapperClasses(this.aspect, this.radius)}">
|
|
384
|
+
<img
|
|
385
|
+
src=${this.fallbackSrc || nothing}
|
|
386
|
+
alt=${this.alt}
|
|
387
|
+
class="${classNames(this.fit, this.aspect, this.radius)}"
|
|
388
|
+
/>
|
|
389
|
+
</div>`;
|
|
390
|
+
}
|
|
391
|
+
render() {
|
|
392
|
+
if (this._hasError || !this.src) {
|
|
393
|
+
return this.fallbackSrc ? this.#renderFallback() : this.#renderError();
|
|
394
|
+
}
|
|
395
|
+
return html2`<div class="${wrapperClasses(this.aspect, this.radius)}">
|
|
396
|
+
<img
|
|
397
|
+
src=${this.src || nothing}
|
|
398
|
+
alt=${this.alt}
|
|
399
|
+
loading=${this.loading}
|
|
400
|
+
fetchpriority=${this.fetchpriority || nothing}
|
|
401
|
+
srcset=${this.srcset || nothing}
|
|
402
|
+
sizes=${this.sizes || nothing}
|
|
403
|
+
width=${this.width ?? nothing}
|
|
404
|
+
height=${this.height ?? nothing}
|
|
405
|
+
class="${classNames(this.fit, this.aspect, this.radius)}"
|
|
406
|
+
@error=${this._handleError}
|
|
407
|
+
/>
|
|
408
|
+
</div>`;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
__legacyDecorateClassTS([
|
|
412
|
+
property({ ...surfaceProps })
|
|
413
|
+
], Image.prototype, "surface", undefined);
|
|
414
|
+
__legacyDecorateClassTS([
|
|
415
|
+
property({ ...imageFitProps })
|
|
416
|
+
], Image.prototype, "fit", undefined);
|
|
417
|
+
__legacyDecorateClassTS([
|
|
418
|
+
property({ ...imageAspectProps })
|
|
419
|
+
], Image.prototype, "aspect", undefined);
|
|
420
|
+
__legacyDecorateClassTS([
|
|
421
|
+
property({ ...imageRadiusProps })
|
|
422
|
+
], Image.prototype, "radius", undefined);
|
|
423
|
+
__legacyDecorateClassTS([
|
|
424
|
+
property({ ...imageLoadingProps })
|
|
425
|
+
], Image.prototype, "loading", undefined);
|
|
426
|
+
__legacyDecorateClassTS([
|
|
427
|
+
property({ type: String })
|
|
428
|
+
], Image.prototype, "src", undefined);
|
|
429
|
+
__legacyDecorateClassTS([
|
|
430
|
+
property({ type: String })
|
|
431
|
+
], Image.prototype, "alt", undefined);
|
|
432
|
+
__legacyDecorateClassTS([
|
|
433
|
+
property({ type: String })
|
|
434
|
+
], Image.prototype, "srcset", undefined);
|
|
435
|
+
__legacyDecorateClassTS([
|
|
436
|
+
property({ type: String })
|
|
437
|
+
], Image.prototype, "sizes", undefined);
|
|
438
|
+
__legacyDecorateClassTS([
|
|
439
|
+
property({ type: Number })
|
|
440
|
+
], Image.prototype, "width", undefined);
|
|
441
|
+
__legacyDecorateClassTS([
|
|
442
|
+
property({ type: Number })
|
|
443
|
+
], Image.prototype, "height", undefined);
|
|
444
|
+
__legacyDecorateClassTS([
|
|
445
|
+
property({ type: String, attribute: "fetchpriority" })
|
|
446
|
+
], Image.prototype, "fetchpriority", undefined);
|
|
447
|
+
__legacyDecorateClassTS([
|
|
448
|
+
property({ type: String, attribute: "fallback-src" })
|
|
449
|
+
], Image.prototype, "fallbackSrc", undefined);
|
|
450
|
+
__legacyDecorateClassTS([
|
|
451
|
+
state()
|
|
452
|
+
], Image.prototype, "_hasError", undefined);
|
|
453
|
+
defineElement("dsgn-image", Image);
|
|
454
|
+
export {
|
|
455
|
+
Image
|
|
456
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const imageFitValues: {
|
|
2
|
+
readonly COVER: "cover";
|
|
3
|
+
readonly CONTAIN: "contain";
|
|
4
|
+
readonly FILL: "fill";
|
|
5
|
+
readonly NONE: "none";
|
|
6
|
+
readonly SCALE_DOWN: "scale-down";
|
|
7
|
+
};
|
|
8
|
+
export type ImageFitType = (typeof imageFitValues)[keyof typeof imageFitValues];
|
|
9
|
+
export declare const imageFitProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
10
|
+
export declare const imageAspectValues: {
|
|
11
|
+
readonly AUTO: "auto";
|
|
12
|
+
readonly SQUARE: "square";
|
|
13
|
+
readonly VIDEO: "video";
|
|
14
|
+
readonly PHOTO: "photo";
|
|
15
|
+
readonly PORTRAIT: "portrait";
|
|
16
|
+
readonly WIDE: "wide";
|
|
17
|
+
};
|
|
18
|
+
export type ImageAspectType = (typeof imageAspectValues)[keyof typeof imageAspectValues];
|
|
19
|
+
export declare const imageAspectProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
20
|
+
export declare const imageRadiusValues: {
|
|
21
|
+
readonly NONE: "none";
|
|
22
|
+
readonly SM: "sm";
|
|
23
|
+
readonly MD: "md";
|
|
24
|
+
readonly LG: "lg";
|
|
25
|
+
readonly XL: "xl";
|
|
26
|
+
readonly FULL: "full";
|
|
27
|
+
};
|
|
28
|
+
export type ImageRadiusType = (typeof imageRadiusValues)[keyof typeof imageRadiusValues];
|
|
29
|
+
export declare const imageRadiusProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
30
|
+
export declare const imageLoadingValues: {
|
|
31
|
+
readonly LAZY: "lazy";
|
|
32
|
+
readonly EAGER: "eager";
|
|
33
|
+
};
|
|
34
|
+
export type ImageLoadingType = (typeof imageLoadingValues)[keyof typeof imageLoadingValues];
|
|
35
|
+
export declare const imageLoadingProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
@@ -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/Image/src/Image.props.ts
|
|
25
|
+
var imageFitValues = {
|
|
26
|
+
COVER: "cover",
|
|
27
|
+
CONTAIN: "contain",
|
|
28
|
+
FILL: "fill",
|
|
29
|
+
NONE: "none",
|
|
30
|
+
SCALE_DOWN: "scale-down"
|
|
31
|
+
};
|
|
32
|
+
var imageFitProps = enumCreator(Object.values(imageFitValues), "fit", String, { reflect: true });
|
|
33
|
+
var imageAspectValues = {
|
|
34
|
+
AUTO: "auto",
|
|
35
|
+
SQUARE: "square",
|
|
36
|
+
VIDEO: "video",
|
|
37
|
+
PHOTO: "photo",
|
|
38
|
+
PORTRAIT: "portrait",
|
|
39
|
+
WIDE: "wide"
|
|
40
|
+
};
|
|
41
|
+
var imageAspectProps = enumCreator(Object.values(imageAspectValues), "aspect", String, { reflect: true });
|
|
42
|
+
var imageRadiusValues = {
|
|
43
|
+
NONE: "none",
|
|
44
|
+
SM: "sm",
|
|
45
|
+
MD: "md",
|
|
46
|
+
LG: "lg",
|
|
47
|
+
XL: "xl",
|
|
48
|
+
FULL: "full"
|
|
49
|
+
};
|
|
50
|
+
var imageRadiusProps = enumCreator(Object.values(imageRadiusValues), "radius", String, { reflect: true });
|
|
51
|
+
var imageLoadingValues = {
|
|
52
|
+
LAZY: "lazy",
|
|
53
|
+
EAGER: "eager"
|
|
54
|
+
};
|
|
55
|
+
var imageLoadingProps = enumCreator(Object.values(imageLoadingValues), "loading", String, { reflect: true });
|
|
56
|
+
export {
|
|
57
|
+
imageAspectProps,
|
|
58
|
+
imageAspectValues,
|
|
59
|
+
imageFitProps,
|
|
60
|
+
imageFitValues,
|
|
61
|
+
imageLoadingProps,
|
|
62
|
+
imageLoadingValues,
|
|
63
|
+
imageRadiusProps,
|
|
64
|
+
imageRadiusValues
|
|
65
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ImageAspectType, type ImageFitType, type ImageRadiusType } from './Image.props.js';
|
|
2
|
+
export declare const classNames: (fit: ImageFitType, aspect: ImageAspectType, radius: ImageRadiusType) => string;
|
|
3
|
+
export declare const wrapperClasses: (aspect: ImageAspectType, radius: ImageRadiusType) => string;
|
|
4
|
+
export declare const errorContainerClasses: (aspect: ImageAspectType, radius: ImageRadiusType) => string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import { type CSSResultGroup } from 'lit';
|
|
3
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
4
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
5
|
+
import { type InputSizeType, type InputTypeType } from './Input.props.js';
|
|
6
|
+
/**
|
|
7
|
+
* @fires dsgn-input - Fired when the value changes; `detail` is `{ value, name }`.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Input extends Base {
|
|
10
|
+
#private;
|
|
11
|
+
static styles: CSSResultGroup;
|
|
12
|
+
static formAssociated: boolean;
|
|
13
|
+
constructor();
|
|
14
|
+
surface: SurfaceType;
|
|
15
|
+
type: InputTypeType;
|
|
16
|
+
placeholder: string;
|
|
17
|
+
label: string;
|
|
18
|
+
ariaLabel: string;
|
|
19
|
+
error: string;
|
|
20
|
+
size: InputSizeType;
|
|
21
|
+
/**
|
|
22
|
+
* Current value. Deliberately not reflected: a native `<input>`'s `value`
|
|
23
|
+
* content attribute is the *default* value, not the live one, so reflecting
|
|
24
|
+
* would overwrite the author's `value=""` default on every keystroke.
|
|
25
|
+
*/
|
|
26
|
+
value: string;
|
|
27
|
+
/**
|
|
28
|
+
* Field name under which the value is submitted. Reflected because the browser
|
|
29
|
+
* builds a form's entry list from the `name` **content attribute**, not the
|
|
30
|
+
* IDL property — so a name set only as a property (e.g. via the React wrapper)
|
|
31
|
+
* would leave the host without the attribute and the value would be silently
|
|
32
|
+
* dropped from `FormData`.
|
|
33
|
+
*/
|
|
34
|
+
name: string;
|
|
35
|
+
disabled: boolean;
|
|
36
|
+
required: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Disabled state inherited from an ancestor `<fieldset>`/form owner, kept
|
|
39
|
+
* separate from the authored `disabled` property. Writing the inherited state
|
|
40
|
+
* back into `disabled` would reflect a `disabled` attribute the author never
|
|
41
|
+
* set — and because the element's own attribute keeps its effective state
|
|
42
|
+
* disabled, re-enabling the fieldset would not change that state, so no
|
|
43
|
+
* `formDisabledCallback(false)` would arrive to undo it and the control would
|
|
44
|
+
* be stuck disabled forever.
|
|
45
|
+
*/
|
|
46
|
+
private _formDisabled;
|
|
47
|
+
/** Authored `disabled` combined with any state inherited from the form. */
|
|
48
|
+
private get isDisabled();
|
|
49
|
+
private _syncValidity;
|
|
50
|
+
private _handleInput;
|
|
51
|
+
formResetCallback(): void;
|
|
52
|
+
formDisabledCallback(disabled: boolean): void;
|
|
53
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
54
|
+
render(): import("lit").TemplateResult<1>;
|
|
55
|
+
}
|
|
56
|
+
declare global {
|
|
57
|
+
interface HTMLElementTagNameMap {
|
|
58
|
+
'dsgn-input': Input;
|
|
59
|
+
}
|
|
60
|
+
}
|