@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,327 @@
|
|
|
1
|
+
var __legacyDecorateClassTS = function(decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
|
|
4
|
+
r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else
|
|
6
|
+
for (var i = decorators.length - 1;i >= 0; i--)
|
|
7
|
+
if (d = decorators[i])
|
|
8
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
9
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// components/Text/src/Text.ts
|
|
13
|
+
import { html as html2 } from "lit";
|
|
14
|
+
import { property } from "lit/decorators.js";
|
|
15
|
+
|
|
16
|
+
// common/Base/Base.ts
|
|
17
|
+
import { html, LitElement } from "lit";
|
|
18
|
+
|
|
19
|
+
// common/helpers/define-element.ts
|
|
20
|
+
var defineElement = (tag, ctor) => {
|
|
21
|
+
if (typeof customElements === "undefined")
|
|
22
|
+
return;
|
|
23
|
+
if (!customElements.get(tag))
|
|
24
|
+
customElements.define(tag, ctor);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// common/Base/Base.css
|
|
28
|
+
import { css } from "lit";
|
|
29
|
+
var styles = css`/* Base reset in @layer base ensures it comes before utilities in Tailwind v4 cascade
|
|
30
|
+
This prevents the reset from overriding component utility classes */
|
|
31
|
+
@layer base {
|
|
32
|
+
:host {
|
|
33
|
+
display: block;
|
|
34
|
+
box-sizing: border-box;
|
|
35
|
+
line-height: 1.5;
|
|
36
|
+
-webkit-text-size-adjust: 100%;
|
|
37
|
+
tab-size: 4;
|
|
38
|
+
font-family: var(
|
|
39
|
+
--default-font-family,
|
|
40
|
+
var(--font-sans, ui-sans-serif, system-ui, sans-serif)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
*,
|
|
45
|
+
*::before,
|
|
46
|
+
*::after {
|
|
47
|
+
box-sizing: inherit;
|
|
48
|
+
margin: 0;
|
|
49
|
+
padding: 0;
|
|
50
|
+
border: 0 solid;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host h1,
|
|
54
|
+
:host h2,
|
|
55
|
+
:host h3,
|
|
56
|
+
:host h4,
|
|
57
|
+
:host h5,
|
|
58
|
+
:host h6 {
|
|
59
|
+
font-size: inherit;
|
|
60
|
+
font-weight: inherit;
|
|
61
|
+
margin: 0;
|
|
62
|
+
padding: 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
var Base_default = styles;
|
|
67
|
+
|
|
68
|
+
// common/Base/Base.ts
|
|
69
|
+
class Base extends LitElement {
|
|
70
|
+
static styles = Base_default;
|
|
71
|
+
updateTheme(changedProperties, surface) {
|
|
72
|
+
if (changedProperties.has("surface")) {
|
|
73
|
+
if (surface) {
|
|
74
|
+
this.setAttribute("data-theme", surface);
|
|
75
|
+
} else {
|
|
76
|
+
this.removeAttribute("data-theme");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
emit(name, detail, options = {}) {
|
|
81
|
+
return this.dispatchEvent(new CustomEvent(name, {
|
|
82
|
+
detail,
|
|
83
|
+
bubbles: true,
|
|
84
|
+
composed: true,
|
|
85
|
+
cancelable: options.cancelable ?? false
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
render() {
|
|
89
|
+
return html`<slot></slot>`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
defineElement("dsgn-base", Base);
|
|
93
|
+
|
|
94
|
+
// common/helpers/enum-validator.ts
|
|
95
|
+
var enumValidator = (propName, enumSet, candidateValue) => {
|
|
96
|
+
if (!enumSet.has(candidateValue)) {
|
|
97
|
+
throw new Error(`Invalid prop ${propName} of value ${candidateValue}. Expected one of: ${Array.from(enumSet).join(", ")}`);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// common/helpers/enum-creator.ts
|
|
102
|
+
var enumCreator = (acceptableValues, propName, type, other = {}) => {
|
|
103
|
+
const acceptableValuesSet = new Set(acceptableValues);
|
|
104
|
+
return {
|
|
105
|
+
type,
|
|
106
|
+
hasChanged(newValue, oldValue) {
|
|
107
|
+
if (newValue !== oldValue) {
|
|
108
|
+
enumValidator(propName, acceptableValuesSet, newValue);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
return false;
|
|
112
|
+
},
|
|
113
|
+
...other
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// common/props/surface/surface.props.ts
|
|
118
|
+
var surfaceValues = {
|
|
119
|
+
LIGHT: "light",
|
|
120
|
+
DARK: "dark"
|
|
121
|
+
};
|
|
122
|
+
var surfaceProps = enumCreator(Object.values(surfaceValues), "surface", String, { reflect: true });
|
|
123
|
+
|
|
124
|
+
// components/Text/src/Text.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
|
+
--font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
131
|
+
'Noto Color Emoji';
|
|
132
|
+
--text-sm: 0.875rem;
|
|
133
|
+
--text-sm--line-height: calc(1.25 / 0.875);
|
|
134
|
+
--text-base: 1rem;
|
|
135
|
+
--text-base--line-height: calc(1.5 / 1);
|
|
136
|
+
--text-lg: 1.125rem;
|
|
137
|
+
--text-lg--line-height: calc(1.75 / 1.125);
|
|
138
|
+
--text-xl: 1.25rem;
|
|
139
|
+
--text-xl--line-height: calc(1.75 / 1.25);
|
|
140
|
+
--font-weight-normal: 400;
|
|
141
|
+
--font-weight-medium: 500;
|
|
142
|
+
--font-weight-semibold: 600;
|
|
143
|
+
--font-weight-bold: 700;
|
|
144
|
+
--leading-relaxed: 1.625;
|
|
145
|
+
--color-text-primary: inherit;
|
|
146
|
+
--color-text-secondary: inherit;
|
|
147
|
+
--color-text-tertiary: inherit;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
@layer utilities {
|
|
151
|
+
.static {
|
|
152
|
+
position: static;
|
|
153
|
+
}
|
|
154
|
+
.font-sans {
|
|
155
|
+
font-family: var(--font-sans);
|
|
156
|
+
}
|
|
157
|
+
.text-base {
|
|
158
|
+
font-size: var(--text-base);
|
|
159
|
+
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
160
|
+
}
|
|
161
|
+
.text-lg {
|
|
162
|
+
font-size: var(--text-lg);
|
|
163
|
+
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
164
|
+
}
|
|
165
|
+
.text-sm {
|
|
166
|
+
font-size: var(--text-sm);
|
|
167
|
+
line-height: var(--tw-leading, var(--text-sm--line-height));
|
|
168
|
+
}
|
|
169
|
+
.text-xl {
|
|
170
|
+
font-size: var(--text-xl);
|
|
171
|
+
line-height: var(--tw-leading, var(--text-xl--line-height));
|
|
172
|
+
}
|
|
173
|
+
.leading-relaxed {
|
|
174
|
+
--tw-leading: var(--leading-relaxed);
|
|
175
|
+
line-height: var(--leading-relaxed);
|
|
176
|
+
}
|
|
177
|
+
.font-bold {
|
|
178
|
+
--tw-font-weight: var(--font-weight-bold);
|
|
179
|
+
font-weight: var(--font-weight-bold);
|
|
180
|
+
}
|
|
181
|
+
.font-medium {
|
|
182
|
+
--tw-font-weight: var(--font-weight-medium);
|
|
183
|
+
font-weight: var(--font-weight-medium);
|
|
184
|
+
}
|
|
185
|
+
.font-normal {
|
|
186
|
+
--tw-font-weight: var(--font-weight-normal);
|
|
187
|
+
font-weight: var(--font-weight-normal);
|
|
188
|
+
}
|
|
189
|
+
.font-semibold {
|
|
190
|
+
--tw-font-weight: var(--font-weight-semibold);
|
|
191
|
+
font-weight: var(--font-weight-semibold);
|
|
192
|
+
}
|
|
193
|
+
.text-text-primary {
|
|
194
|
+
color: var(--color-text-primary);
|
|
195
|
+
}
|
|
196
|
+
.text-text-secondary {
|
|
197
|
+
color: var(--color-text-secondary);
|
|
198
|
+
}
|
|
199
|
+
.text-text-tertiary {
|
|
200
|
+
color: var(--color-text-tertiary);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
@property --dsgn-border-sweep-angle {
|
|
204
|
+
syntax: '<angle>';
|
|
205
|
+
inherits: false;
|
|
206
|
+
initial-value: 0deg;
|
|
207
|
+
}
|
|
208
|
+
@property --tw-leading {
|
|
209
|
+
syntax: "*";
|
|
210
|
+
inherits: false;
|
|
211
|
+
}
|
|
212
|
+
@property --tw-font-weight {
|
|
213
|
+
syntax: "*";
|
|
214
|
+
inherits: false;
|
|
215
|
+
}
|
|
216
|
+
@layer properties {
|
|
217
|
+
@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
|
|
218
|
+
*, ::before, ::after, ::backdrop {
|
|
219
|
+
--tw-leading: initial;
|
|
220
|
+
--tw-font-weight: initial;
|
|
221
|
+
--dsgn-border-sweep-angle: 0deg;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
`;
|
|
226
|
+
var Text_default = styles2;
|
|
227
|
+
|
|
228
|
+
// components/Text/src/Text.props.ts
|
|
229
|
+
var textSizeValues = {
|
|
230
|
+
SM: "sm",
|
|
231
|
+
BASE: "base",
|
|
232
|
+
LG: "lg",
|
|
233
|
+
XL: "xl"
|
|
234
|
+
};
|
|
235
|
+
var textSizeProps = enumCreator(Object.values(textSizeValues), "size", String, { reflect: true });
|
|
236
|
+
var textWeightValues = {
|
|
237
|
+
NORMAL: "normal",
|
|
238
|
+
MEDIUM: "medium",
|
|
239
|
+
SEMIBOLD: "semibold",
|
|
240
|
+
BOLD: "bold"
|
|
241
|
+
};
|
|
242
|
+
var textWeightProps = enumCreator(Object.values(textWeightValues), "weight", String, { reflect: true });
|
|
243
|
+
var textColorValues = {
|
|
244
|
+
PRIMARY: "primary",
|
|
245
|
+
SECONDARY: "secondary",
|
|
246
|
+
TERTIARY: "tertiary"
|
|
247
|
+
};
|
|
248
|
+
var textColorProps = enumCreator(Object.values(textColorValues), "color", String, { reflect: true });
|
|
249
|
+
|
|
250
|
+
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
251
|
+
function r(e) {
|
|
252
|
+
var t, f, n = "";
|
|
253
|
+
if (typeof e == "string" || typeof e == "number")
|
|
254
|
+
n += e;
|
|
255
|
+
else if (typeof e == "object")
|
|
256
|
+
if (Array.isArray(e)) {
|
|
257
|
+
var o = e.length;
|
|
258
|
+
for (t = 0;t < o; t++)
|
|
259
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
260
|
+
} else
|
|
261
|
+
for (f in e)
|
|
262
|
+
e[f] && (n && (n += " "), n += f);
|
|
263
|
+
return n;
|
|
264
|
+
}
|
|
265
|
+
function clsx() {
|
|
266
|
+
for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
|
|
267
|
+
(e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
268
|
+
return n;
|
|
269
|
+
}
|
|
270
|
+
var clsx_default = clsx;
|
|
271
|
+
|
|
272
|
+
// components/Text/src/Text.styles.ts
|
|
273
|
+
var sizeClasses = {
|
|
274
|
+
[textSizeValues.SM]: "text-sm",
|
|
275
|
+
[textSizeValues.BASE]: "text-base",
|
|
276
|
+
[textSizeValues.LG]: "text-lg",
|
|
277
|
+
[textSizeValues.XL]: "text-xl"
|
|
278
|
+
};
|
|
279
|
+
var weightClasses = {
|
|
280
|
+
[textWeightValues.NORMAL]: "font-normal",
|
|
281
|
+
[textWeightValues.MEDIUM]: "font-medium",
|
|
282
|
+
[textWeightValues.SEMIBOLD]: "font-semibold",
|
|
283
|
+
[textWeightValues.BOLD]: "font-bold"
|
|
284
|
+
};
|
|
285
|
+
var colorClasses = {
|
|
286
|
+
[textColorValues.PRIMARY]: "text-text-primary",
|
|
287
|
+
[textColorValues.SECONDARY]: "text-text-secondary",
|
|
288
|
+
[textColorValues.TERTIARY]: "text-text-tertiary"
|
|
289
|
+
};
|
|
290
|
+
var classNames = (size, weight, color) => clsx_default("font-sans", "leading-relaxed", sizeClasses[size], weightClasses[weight], colorClasses[color]);
|
|
291
|
+
|
|
292
|
+
// components/Text/src/Text.ts
|
|
293
|
+
class Text extends Base {
|
|
294
|
+
constructor() {
|
|
295
|
+
super(...arguments);
|
|
296
|
+
this.surface = surfaceValues.LIGHT;
|
|
297
|
+
this.size = textSizeValues.BASE;
|
|
298
|
+
this.weight = textWeightValues.NORMAL;
|
|
299
|
+
this.color = textColorValues.PRIMARY;
|
|
300
|
+
}
|
|
301
|
+
static styles = [Base.styles, Text_default];
|
|
302
|
+
updated(changedProperties) {
|
|
303
|
+
super.updated(changedProperties);
|
|
304
|
+
this.updateTheme(changedProperties, this.surface);
|
|
305
|
+
}
|
|
306
|
+
render() {
|
|
307
|
+
return html2`<p class="${classNames(this.size, this.weight, this.color)}">
|
|
308
|
+
<slot></slot>
|
|
309
|
+
</p>`;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
__legacyDecorateClassTS([
|
|
313
|
+
property({ ...surfaceProps })
|
|
314
|
+
], Text.prototype, "surface", undefined);
|
|
315
|
+
__legacyDecorateClassTS([
|
|
316
|
+
property({ ...textSizeProps })
|
|
317
|
+
], Text.prototype, "size", undefined);
|
|
318
|
+
__legacyDecorateClassTS([
|
|
319
|
+
property({ ...textWeightProps })
|
|
320
|
+
], Text.prototype, "weight", undefined);
|
|
321
|
+
__legacyDecorateClassTS([
|
|
322
|
+
property({ ...textColorProps })
|
|
323
|
+
], Text.prototype, "color", undefined);
|
|
324
|
+
defineElement("dsgn-text", Text);
|
|
325
|
+
export {
|
|
326
|
+
Text
|
|
327
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const textSizeValues: {
|
|
2
|
+
readonly SM: "sm";
|
|
3
|
+
readonly BASE: "base";
|
|
4
|
+
readonly LG: "lg";
|
|
5
|
+
readonly XL: "xl";
|
|
6
|
+
};
|
|
7
|
+
export type TextSizeType = (typeof textSizeValues)[keyof typeof textSizeValues];
|
|
8
|
+
export declare const textSizeProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
9
|
+
export declare const textWeightValues: {
|
|
10
|
+
readonly NORMAL: "normal";
|
|
11
|
+
readonly MEDIUM: "medium";
|
|
12
|
+
readonly SEMIBOLD: "semibold";
|
|
13
|
+
readonly BOLD: "bold";
|
|
14
|
+
};
|
|
15
|
+
export type TextWeightType = (typeof textWeightValues)[keyof typeof textWeightValues];
|
|
16
|
+
export declare const textWeightProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
17
|
+
export declare const textColorValues: {
|
|
18
|
+
readonly PRIMARY: "primary";
|
|
19
|
+
readonly SECONDARY: "secondary";
|
|
20
|
+
readonly TERTIARY: "tertiary";
|
|
21
|
+
};
|
|
22
|
+
export type TextColorType = (typeof textColorValues)[keyof typeof textColorValues];
|
|
23
|
+
export declare const textColorProps: import("lit").PropertyDeclaration<unknown, unknown>;
|
|
@@ -0,0 +1,52 @@
|
|
|
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/Text/src/Text.props.ts
|
|
25
|
+
var textSizeValues = {
|
|
26
|
+
SM: "sm",
|
|
27
|
+
BASE: "base",
|
|
28
|
+
LG: "lg",
|
|
29
|
+
XL: "xl"
|
|
30
|
+
};
|
|
31
|
+
var textSizeProps = enumCreator(Object.values(textSizeValues), "size", String, { reflect: true });
|
|
32
|
+
var textWeightValues = {
|
|
33
|
+
NORMAL: "normal",
|
|
34
|
+
MEDIUM: "medium",
|
|
35
|
+
SEMIBOLD: "semibold",
|
|
36
|
+
BOLD: "bold"
|
|
37
|
+
};
|
|
38
|
+
var textWeightProps = enumCreator(Object.values(textWeightValues), "weight", String, { reflect: true });
|
|
39
|
+
var textColorValues = {
|
|
40
|
+
PRIMARY: "primary",
|
|
41
|
+
SECONDARY: "secondary",
|
|
42
|
+
TERTIARY: "tertiary"
|
|
43
|
+
};
|
|
44
|
+
var textColorProps = enumCreator(Object.values(textColorValues), "color", String, { reflect: true });
|
|
45
|
+
export {
|
|
46
|
+
textColorProps,
|
|
47
|
+
textColorValues,
|
|
48
|
+
textSizeProps,
|
|
49
|
+
textSizeValues,
|
|
50
|
+
textWeightProps,
|
|
51
|
+
textWeightValues
|
|
52
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Public metadata used by documentation renderers to build live component controls. */
|
|
2
|
+
export type PlaygroundControl = 'boolean' | 'select' | 'text';
|
|
3
|
+
export interface PlaygroundProp {
|
|
4
|
+
name: string;
|
|
5
|
+
attribute: string;
|
|
6
|
+
control: PlaygroundControl;
|
|
7
|
+
default: boolean | string;
|
|
8
|
+
label: string;
|
|
9
|
+
options?: readonly string[];
|
|
10
|
+
includeDefault?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PlaygroundSlot {
|
|
13
|
+
name?: string;
|
|
14
|
+
default: string;
|
|
15
|
+
label: string;
|
|
16
|
+
}
|
|
17
|
+
/** A real component composed into a parent playground slot. */
|
|
18
|
+
export interface PlaygroundNestedComponent {
|
|
19
|
+
tag: string;
|
|
20
|
+
slot: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PlaygroundDefinition {
|
|
24
|
+
tag: string;
|
|
25
|
+
module: string;
|
|
26
|
+
props: readonly PlaygroundProp[];
|
|
27
|
+
slots: readonly PlaygroundSlot[];
|
|
28
|
+
nested?: readonly PlaygroundNestedComponent[];
|
|
29
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface PlaygroundProp { name: string; attribute: string; control: 'boolean' | 'select' | 'text'; default: boolean | string; label: string; options?: readonly string[]; includeDefault?: boolean; }
|
|
2
|
+
export interface PlaygroundSlot { name?: string; default: string; label: string; }
|
|
3
|
+
export interface PlaygroundNestedComponent { tag: string; slot: string; label: string; }
|
|
4
|
+
export interface PlaygroundDefinition { tag: string; module: string; props: readonly PlaygroundProp[]; slots: readonly PlaygroundSlot[]; nested?: readonly PlaygroundNestedComponent[]; }
|
|
5
|
+
export declare const playgroundManifest: PlaygroundDefinition[];
|
|
6
|
+
export default playgroundManifest;
|