@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,429 @@
|
|
|
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/Badge/src/Badge.ts
|
|
121
|
+
import { html as html2 } from "lit";
|
|
122
|
+
import { property } from "lit/decorators.js";
|
|
123
|
+
|
|
124
|
+
// components/Badge/src/Badge.css
|
|
125
|
+
import { css as css2 } from "lit";
|
|
126
|
+
var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
127
|
+
@layer properties;
|
|
128
|
+
@layer theme {
|
|
129
|
+
:root, :host {
|
|
130
|
+
--spacing: 0.25rem;
|
|
131
|
+
--text-xs: 0.75rem;
|
|
132
|
+
--text-xs--line-height: calc(1 / 0.75);
|
|
133
|
+
--text-sm: 0.875rem;
|
|
134
|
+
--text-sm--line-height: calc(1.25 / 0.875);
|
|
135
|
+
--font-weight-medium: 500;
|
|
136
|
+
--color-accent: inherit;
|
|
137
|
+
--color-accent-text: inherit;
|
|
138
|
+
--color-badge-bg: inherit;
|
|
139
|
+
--color-badge-border: inherit;
|
|
140
|
+
--color-badge-brand-text: inherit;
|
|
141
|
+
--color-badge-error-text: inherit;
|
|
142
|
+
--color-badge-text: inherit;
|
|
143
|
+
--color-badge-warning-text: inherit;
|
|
144
|
+
--color-brand: inherit;
|
|
145
|
+
--color-brand-subtle: inherit;
|
|
146
|
+
--color-error: inherit;
|
|
147
|
+
--color-error-subtle: inherit;
|
|
148
|
+
--color-success: inherit;
|
|
149
|
+
--color-success-subtle: inherit;
|
|
150
|
+
--color-warning: inherit;
|
|
151
|
+
--color-warning-subtle: inherit;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
@layer utilities {
|
|
155
|
+
.static {
|
|
156
|
+
position: static;
|
|
157
|
+
}
|
|
158
|
+
.inline-flex {
|
|
159
|
+
display: inline-flex;
|
|
160
|
+
}
|
|
161
|
+
.items-center {
|
|
162
|
+
align-items: center;
|
|
163
|
+
}
|
|
164
|
+
.justify-center {
|
|
165
|
+
justify-content: center;
|
|
166
|
+
}
|
|
167
|
+
.rounded-full {
|
|
168
|
+
border-radius: calc(infinity * 1px);
|
|
169
|
+
}
|
|
170
|
+
.border {
|
|
171
|
+
border-style: var(--tw-border-style);
|
|
172
|
+
border-width: 1px;
|
|
173
|
+
}
|
|
174
|
+
.border-accent\\/30 {
|
|
175
|
+
border-color: color-mix(in srgb, inherit 30%, transparent);
|
|
176
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
177
|
+
border-color: color-mix(in oklab, var(--color-accent) 30%, transparent);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.border-badge-border {
|
|
181
|
+
border-color: var(--color-badge-border);
|
|
182
|
+
}
|
|
183
|
+
.border-brand\\/30 {
|
|
184
|
+
border-color: color-mix(in srgb, inherit 30%, transparent);
|
|
185
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
186
|
+
border-color: color-mix(in oklab, var(--color-brand) 30%, transparent);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
.border-error\\/30 {
|
|
190
|
+
border-color: color-mix(in srgb, inherit 30%, transparent);
|
|
191
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
192
|
+
border-color: color-mix(in oklab, var(--color-error) 30%, transparent);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
.border-success\\/30 {
|
|
196
|
+
border-color: color-mix(in srgb, inherit 30%, transparent);
|
|
197
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
198
|
+
border-color: color-mix(in oklab, var(--color-success) 30%, transparent);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
.border-warning\\/30 {
|
|
202
|
+
border-color: color-mix(in srgb, inherit 30%, transparent);
|
|
203
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
204
|
+
border-color: color-mix(in oklab, var(--color-warning) 30%, transparent);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
.bg-accent\\/5 {
|
|
208
|
+
background-color: color-mix(in srgb, inherit 5%, transparent);
|
|
209
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
210
|
+
background-color: color-mix(in oklab, var(--color-accent) 5%, transparent);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
.bg-badge-bg {
|
|
214
|
+
background-color: var(--color-badge-bg);
|
|
215
|
+
}
|
|
216
|
+
.bg-brand-subtle {
|
|
217
|
+
background-color: var(--color-brand-subtle);
|
|
218
|
+
}
|
|
219
|
+
.bg-error-subtle {
|
|
220
|
+
background-color: var(--color-error-subtle);
|
|
221
|
+
}
|
|
222
|
+
.bg-success-subtle {
|
|
223
|
+
background-color: var(--color-success-subtle);
|
|
224
|
+
}
|
|
225
|
+
.bg-warning-subtle {
|
|
226
|
+
background-color: var(--color-warning-subtle);
|
|
227
|
+
}
|
|
228
|
+
.px-2 {
|
|
229
|
+
padding-inline: calc(var(--spacing) * 2);
|
|
230
|
+
}
|
|
231
|
+
.px-2\\.5 {
|
|
232
|
+
padding-inline: calc(var(--spacing) * 2.5);
|
|
233
|
+
}
|
|
234
|
+
.py-1 {
|
|
235
|
+
padding-block: calc(var(--spacing) * 1);
|
|
236
|
+
}
|
|
237
|
+
.py-1\\.5 {
|
|
238
|
+
padding-block: calc(var(--spacing) * 1.5);
|
|
239
|
+
}
|
|
240
|
+
.text-sm {
|
|
241
|
+
font-size: var(--text-sm);
|
|
242
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
243
|
+
}
|
|
244
|
+
.text-xs {
|
|
245
|
+
font-size: var(--text-xs);
|
|
246
|
+
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
247
|
+
}
|
|
248
|
+
.leading-none {
|
|
249
|
+
--tw-leading: 1;
|
|
250
|
+
line-height: 1;
|
|
251
|
+
}
|
|
252
|
+
.font-medium {
|
|
253
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
254
|
+
font-weight: var(--font-weight-medium);
|
|
255
|
+
}
|
|
256
|
+
.whitespace-nowrap {
|
|
257
|
+
white-space: nowrap;
|
|
258
|
+
}
|
|
259
|
+
.text-accent-text {
|
|
260
|
+
color: var(--color-accent-text);
|
|
261
|
+
}
|
|
262
|
+
.text-badge-brand-text {
|
|
263
|
+
color: var(--color-badge-brand-text);
|
|
264
|
+
}
|
|
265
|
+
.text-badge-error-text {
|
|
266
|
+
color: var(--color-badge-error-text);
|
|
267
|
+
}
|
|
268
|
+
.text-badge-text {
|
|
269
|
+
color: var(--color-badge-text);
|
|
270
|
+
}
|
|
271
|
+
.text-badge-warning-text {
|
|
272
|
+
color: var(--color-badge-warning-text);
|
|
273
|
+
}
|
|
274
|
+
.text-success {
|
|
275
|
+
color: var(--color-success);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
@property --dsgn-border-sweep-angle {
|
|
279
|
+
syntax: '<angle>';
|
|
280
|
+
inherits: false;
|
|
281
|
+
initial-value: 0deg;
|
|
282
|
+
}
|
|
283
|
+
@property --tw-border-style {
|
|
284
|
+
syntax: "*";
|
|
285
|
+
inherits: false;
|
|
286
|
+
initial-value: solid;
|
|
287
|
+
}
|
|
288
|
+
@property --tw-leading {
|
|
289
|
+
syntax: "*";
|
|
290
|
+
inherits: false;
|
|
291
|
+
}
|
|
292
|
+
@property --tw-font-weight {
|
|
293
|
+
syntax: "*";
|
|
294
|
+
inherits: false;
|
|
295
|
+
}
|
|
296
|
+
@layer properties {
|
|
297
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
298
|
+
*, ::before, ::after, ::backdrop {
|
|
299
|
+
--tw-border-style: solid;
|
|
300
|
+
--tw-leading: initial;
|
|
301
|
+
--tw-font-weight: initial;
|
|
302
|
+
--dsgn-border-sweep-angle: 0deg;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
`;
|
|
307
|
+
var Badge_default = styles2;
|
|
308
|
+
|
|
309
|
+
// components/Badge/src/Badge.props.ts
|
|
310
|
+
var badgeVariantValues = {
|
|
311
|
+
DEFAULT: "default",
|
|
312
|
+
BRAND: "brand",
|
|
313
|
+
ACCENT: "accent",
|
|
314
|
+
SUCCESS: "success",
|
|
315
|
+
WARNING: "warning",
|
|
316
|
+
ERROR: "error"
|
|
317
|
+
};
|
|
318
|
+
var badgeVariantProps = enumCreator(Object.values(badgeVariantValues), "variant", String, { reflect: true });
|
|
319
|
+
var badgeSizeValues = {
|
|
320
|
+
SM: "sm",
|
|
321
|
+
MD: "md"
|
|
322
|
+
};
|
|
323
|
+
var badgeSizeProps = enumCreator(Object.values(badgeSizeValues), "size", String, { reflect: true });
|
|
324
|
+
|
|
325
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
326
|
+
function r(e) {
|
|
327
|
+
var t, f, n = "";
|
|
328
|
+
if (typeof e == "string" || typeof e == "number")
|
|
329
|
+
n += e;
|
|
330
|
+
else if (typeof e == "object")
|
|
331
|
+
if (Array.isArray(e)) {
|
|
332
|
+
var o = e.length;
|
|
333
|
+
for (t = 0;t < o; t++)
|
|
334
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
335
|
+
} else
|
|
336
|
+
for (f in e)
|
|
337
|
+
e[f] && (n && (n += " "), n += f);
|
|
338
|
+
return n;
|
|
339
|
+
}
|
|
340
|
+
function clsx() {
|
|
341
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
342
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
343
|
+
return n;
|
|
344
|
+
}
|
|
345
|
+
var clsx_default = clsx;
|
|
346
|
+
|
|
347
|
+
// components/Badge/src/Badge.styles.ts
|
|
348
|
+
var baseClasses = [
|
|
349
|
+
"inline-flex",
|
|
350
|
+
"items-center",
|
|
351
|
+
"justify-center",
|
|
352
|
+
"rounded-full",
|
|
353
|
+
"border",
|
|
354
|
+
"font-medium",
|
|
355
|
+
"leading-none",
|
|
356
|
+
"whitespace-nowrap"
|
|
357
|
+
];
|
|
358
|
+
var sizeClasses = {
|
|
359
|
+
[badgeSizeValues.SM]: ["px-2", "py-1", "text-xs"],
|
|
360
|
+
[badgeSizeValues.MD]: ["px-2.5", "py-1.5", "text-sm"]
|
|
361
|
+
};
|
|
362
|
+
var variantClasses = {
|
|
363
|
+
[badgeVariantValues.DEFAULT]: [
|
|
364
|
+
"bg-badge-bg",
|
|
365
|
+
"text-badge-text",
|
|
366
|
+
"border-badge-border"
|
|
367
|
+
],
|
|
368
|
+
[badgeVariantValues.BRAND]: [
|
|
369
|
+
"bg-brand-subtle",
|
|
370
|
+
"text-badge-brand-text",
|
|
371
|
+
"border-brand/30"
|
|
372
|
+
],
|
|
373
|
+
[badgeVariantValues.ACCENT]: [
|
|
374
|
+
"bg-accent/5",
|
|
375
|
+
"text-accent-text",
|
|
376
|
+
"border-accent/30"
|
|
377
|
+
],
|
|
378
|
+
[badgeVariantValues.SUCCESS]: [
|
|
379
|
+
"bg-success-subtle",
|
|
380
|
+
"text-success",
|
|
381
|
+
"border-success/30"
|
|
382
|
+
],
|
|
383
|
+
[badgeVariantValues.WARNING]: [
|
|
384
|
+
"bg-warning-subtle",
|
|
385
|
+
"text-badge-warning-text",
|
|
386
|
+
"border-warning/30"
|
|
387
|
+
],
|
|
388
|
+
[badgeVariantValues.ERROR]: [
|
|
389
|
+
"bg-error-subtle",
|
|
390
|
+
"text-badge-error-text",
|
|
391
|
+
"border-error/30"
|
|
392
|
+
]
|
|
393
|
+
};
|
|
394
|
+
var classNames = (variant, size) => {
|
|
395
|
+
return clsx_default(baseClasses, sizeClasses[size], variantClasses[variant]);
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
// components/Badge/src/Badge.ts
|
|
399
|
+
class Badge extends Base {
|
|
400
|
+
constructor() {
|
|
401
|
+
super(...arguments);
|
|
402
|
+
this.surface = surfaceValues.LIGHT;
|
|
403
|
+
this.variant = badgeVariantValues.DEFAULT;
|
|
404
|
+
this.size = badgeSizeValues.MD;
|
|
405
|
+
}
|
|
406
|
+
static styles = [Base.styles, Badge_default];
|
|
407
|
+
render() {
|
|
408
|
+
return html2`<span class="${classNames(this.variant, this.size)}"
|
|
409
|
+
><slot></slot
|
|
410
|
+
></span>`;
|
|
411
|
+
}
|
|
412
|
+
updated(changedProperties) {
|
|
413
|
+
super.updated(changedProperties);
|
|
414
|
+
this.updateTheme(changedProperties, this.surface);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
__legacyDecorateClassTS([
|
|
418
|
+
property({ ...surfaceProps })
|
|
419
|
+
], Badge.prototype, "surface", undefined);
|
|
420
|
+
__legacyDecorateClassTS([
|
|
421
|
+
property({ ...badgeVariantProps })
|
|
422
|
+
], Badge.prototype, "variant", undefined);
|
|
423
|
+
__legacyDecorateClassTS([
|
|
424
|
+
property({ ...badgeSizeProps })
|
|
425
|
+
], Badge.prototype, "size", undefined);
|
|
426
|
+
defineElement("dsgn-badge", Badge);
|
|
427
|
+
export {
|
|
428
|
+
Badge
|
|
429
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const badgeVariantValues: {
|
|
2
|
+
readonly DEFAULT: "default";
|
|
3
|
+
readonly BRAND: "brand";
|
|
4
|
+
readonly ACCENT: "accent";
|
|
5
|
+
readonly SUCCESS: "success";
|
|
6
|
+
readonly WARNING: "warning";
|
|
7
|
+
readonly ERROR: "error";
|
|
8
|
+
};
|
|
9
|
+
export type BadgeVariantType = (typeof badgeVariantValues)[keyof typeof badgeVariantValues];
|
|
10
|
+
export declare const badgeVariantProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
11
|
+
export declare const badgeSizeValues: {
|
|
12
|
+
readonly SM: "sm";
|
|
13
|
+
readonly MD: "md";
|
|
14
|
+
};
|
|
15
|
+
export type BadgeSizeType = (typeof badgeSizeValues)[keyof typeof badgeSizeValues];
|
|
16
|
+
export declare const badgeSizeProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
@@ -0,0 +1,44 @@
|
|
|
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/Badge/src/Badge.props.ts
|
|
25
|
+
var badgeVariantValues = {
|
|
26
|
+
DEFAULT: "default",
|
|
27
|
+
BRAND: "brand",
|
|
28
|
+
ACCENT: "accent",
|
|
29
|
+
SUCCESS: "success",
|
|
30
|
+
WARNING: "warning",
|
|
31
|
+
ERROR: "error"
|
|
32
|
+
};
|
|
33
|
+
var badgeVariantProps = enumCreator(Object.values(badgeVariantValues), "variant", String, { reflect: true });
|
|
34
|
+
var badgeSizeValues = {
|
|
35
|
+
SM: "sm",
|
|
36
|
+
MD: "md"
|
|
37
|
+
};
|
|
38
|
+
var badgeSizeProps = enumCreator(Object.values(badgeSizeValues), "size", String, { reflect: true });
|
|
39
|
+
export {
|
|
40
|
+
badgeSizeProps,
|
|
41
|
+
badgeSizeValues,
|
|
42
|
+
badgeVariantProps,
|
|
43
|
+
badgeVariantValues
|
|
44
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import '../../../types/global.d.ts';
|
|
2
|
+
import '../../Icon/src/Icon.js';
|
|
3
|
+
import { Base } from '../../../common/Base/Base.js';
|
|
4
|
+
import { type SurfaceType } from '../../../common/props/surface/surface.props.js';
|
|
5
|
+
import { type CSSResultGroup, type SVGTemplateResult } from 'lit';
|
|
6
|
+
import type { IconName } from '../../Icon/src/icons/icon-names.js';
|
|
7
|
+
import type { ButtonAppearanceType, ButtonTargetType } from './Button.props.js';
|
|
8
|
+
import { type ButtonIconPositionType, type ButtonSizeType, type ButtonTypeType, type ButtonWeightType } from './Button.props.js';
|
|
9
|
+
/** @slot - Button or link label. */
|
|
10
|
+
export declare class Button extends Base {
|
|
11
|
+
#private;
|
|
12
|
+
static styles: CSSResultGroup;
|
|
13
|
+
/**
|
|
14
|
+
* Form association lets `type="submit"`/`type="reset"` reach an enclosing
|
|
15
|
+
* `<form>` across the shadow boundary, and lets `name`/`value` participate in
|
|
16
|
+
* submission the way a native submit button does.
|
|
17
|
+
*/
|
|
18
|
+
static formAssociated: boolean;
|
|
19
|
+
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Surface theme variant (light or dark)
|
|
22
|
+
*/
|
|
23
|
+
surface: SurfaceType;
|
|
24
|
+
/**
|
|
25
|
+
* Button style appearance
|
|
26
|
+
*/
|
|
27
|
+
appearance: ButtonAppearanceType;
|
|
28
|
+
/**
|
|
29
|
+
* Font weight of the button label. Default `semibold` for CTA energy; use
|
|
30
|
+
* `medium` or lighter when the button sits in dense chrome (e.g. nav) and
|
|
31
|
+
* needs to visually settle with surrounding text.
|
|
32
|
+
*/
|
|
33
|
+
buttonWeight: ButtonWeightType;
|
|
34
|
+
/**
|
|
35
|
+
* Target for the button when used as a link
|
|
36
|
+
*/
|
|
37
|
+
target: ButtonTargetType;
|
|
38
|
+
/**
|
|
39
|
+
* Optional URL that turns the button into a link
|
|
40
|
+
*/
|
|
41
|
+
href: string;
|
|
42
|
+
/**
|
|
43
|
+
* SVG template content for the icon. Tree-shakeable and needs no registry,
|
|
44
|
+
* but only settable from JS — use `icon-name` for declarative/CMS usage.
|
|
45
|
+
*/
|
|
46
|
+
icon?: SVGTemplateResult;
|
|
47
|
+
/**
|
|
48
|
+
* Icon name, resolved by the `<dsgn-icon>` this button already renders. Lets
|
|
49
|
+
* an icon be authored as data (markup, CMS, the docs playground) rather than
|
|
50
|
+
* as a Lit template. Requires the icons to be registered at app entry:
|
|
51
|
+
*
|
|
52
|
+
* import { Icon } from '@ds-gn/ui/icon';
|
|
53
|
+
* import * as icons from '@ds-gn/ui/icon/icons';
|
|
54
|
+
* Icon.registerIcons(icons);
|
|
55
|
+
*
|
|
56
|
+
* `icon` wins when both are set — that precedence lives in `<dsgn-icon>`.
|
|
57
|
+
*/
|
|
58
|
+
iconName: IconName | '';
|
|
59
|
+
/**
|
|
60
|
+
* Icon position relative to the label
|
|
61
|
+
*/
|
|
62
|
+
iconPosition: ButtonIconPositionType;
|
|
63
|
+
/**
|
|
64
|
+
* Relationship between the current page and the linked page.
|
|
65
|
+
* Defaults to a safe value for links opened in a new tab.
|
|
66
|
+
*/
|
|
67
|
+
rel: string;
|
|
68
|
+
/**
|
|
69
|
+
* Control size. `md` matches the historical (only) size, so existing markup
|
|
70
|
+
* renders unchanged.
|
|
71
|
+
*/
|
|
72
|
+
size: ButtonSizeType;
|
|
73
|
+
/**
|
|
74
|
+
* Behavior when the button is activated inside a form. Ignored in link mode
|
|
75
|
+
* (`href`), where the element is an `<a>`.
|
|
76
|
+
*/
|
|
77
|
+
type: ButtonTypeType;
|
|
78
|
+
/**
|
|
79
|
+
* Blocks activation and marks the control inert. In link mode the `href` is
|
|
80
|
+
* dropped and `aria-disabled` is set, since `<a>` has no native `disabled`.
|
|
81
|
+
*/
|
|
82
|
+
disabled: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Busy state for async actions: swaps the icon for a spinner, marks the
|
|
85
|
+
* control `aria-busy`, and blocks activation. Unlike `disabled` the control
|
|
86
|
+
* stays focusable, so focus is not lost mid-action — in link mode the `href`
|
|
87
|
+
* still has to go (a `click` guard alone would not stop a middle-click's
|
|
88
|
+
* `auxclick` from opening the target), so focusability is restored with an
|
|
89
|
+
* explicit `tabindex`.
|
|
90
|
+
*/
|
|
91
|
+
loading: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Submitted with the form when this button is the activating submitter,
|
|
94
|
+
* mirroring a native submit button's `name`/`value` pair. Both reflect, as
|
|
95
|
+
* they do on a native `<button>`, so the authored state is visible in the DOM
|
|
96
|
+
* and to attribute selectors.
|
|
97
|
+
*/
|
|
98
|
+
name: string;
|
|
99
|
+
value: string;
|
|
100
|
+
/**
|
|
101
|
+
* Disabled state inherited from an ancestor `<fieldset>`/form owner, kept
|
|
102
|
+
* separate from the authored `disabled` property. Writing the inherited state
|
|
103
|
+
* back into `disabled` would reflect a `disabled` attribute the author never
|
|
104
|
+
* set — and because the element's own attribute keeps its effective state
|
|
105
|
+
* disabled, re-enabling the fieldset would not change that state, so no
|
|
106
|
+
* `formDisabledCallback(false)` would arrive to undo it and the control would
|
|
107
|
+
* be stuck disabled forever.
|
|
108
|
+
*/
|
|
109
|
+
private _formDisabled;
|
|
110
|
+
/** Authored `disabled` combined with any state inherited from the form. */
|
|
111
|
+
private get isDisabled();
|
|
112
|
+
/** True when activation should be suppressed. */
|
|
113
|
+
private get isInert();
|
|
114
|
+
private get computedRel();
|
|
115
|
+
/**
|
|
116
|
+
* The inner `<button>` is always `type="button"`: it lives in the shadow root,
|
|
117
|
+
* so a native submit would never find the light-DOM form. Submission and reset
|
|
118
|
+
* are driven here through `ElementInternals.form` instead.
|
|
119
|
+
*/
|
|
120
|
+
private _handleClick;
|
|
121
|
+
private _submitOrReset;
|
|
122
|
+
formDisabledCallback(disabled: boolean): void;
|
|
123
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
124
|
+
/**
|
|
125
|
+
* The spinner takes the icon's place while loading; on a button with no icon
|
|
126
|
+
* it leads the label, so the only layout shift is the gap.
|
|
127
|
+
*/
|
|
128
|
+
private _renderContent;
|
|
129
|
+
/**
|
|
130
|
+
* Render the button or link based on properties
|
|
131
|
+
*/
|
|
132
|
+
render(): import("lit").TemplateResult<1>;
|
|
133
|
+
}
|
|
134
|
+
declare global {
|
|
135
|
+
interface HTMLElementTagNameMap {
|
|
136
|
+
'dsgn-button': Button;
|
|
137
|
+
}
|
|
138
|
+
}
|