@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.
Files changed (271) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +155 -2
  3. package/THIRD_PARTY_NOTICES +167 -0
  4. package/assets/logo-full-dark.svg +4 -0
  5. package/assets/logo-full.svg +4 -0
  6. package/assets/logo-mark.svg +3 -0
  7. package/custom-elements.json +4696 -0
  8. package/dist/common/Base/Base.d.ts +22 -0
  9. package/dist/common/controllers/AuroraMeshController.d.ts +68 -0
  10. package/dist/common/controllers/AutoRotateController.d.ts +38 -0
  11. package/dist/common/controllers/BreakpointController.d.ts +30 -0
  12. package/dist/common/controllers/LayoutChangeController.d.ts +28 -0
  13. package/dist/common/controllers/WordCycleController.d.ts +36 -0
  14. package/dist/common/helpers/aurora-mesh.d.ts +11 -0
  15. package/dist/common/helpers/define-element.d.ts +14 -0
  16. package/dist/common/helpers/enum-creator.d.ts +2 -0
  17. package/dist/common/helpers/enum-validator.d.ts +1 -0
  18. package/dist/common/helpers/layout-change.d.ts +39 -0
  19. package/dist/common/helpers/layout-change.testing.d.ts +15 -0
  20. package/dist/common/helpers/logo.string.d.ts +23 -0
  21. package/dist/common/helpers/logo.string.js +43 -0
  22. package/dist/common/helpers/logo.utils.d.ts +8 -0
  23. package/dist/common/helpers/motion.d.ts +9 -0
  24. package/dist/common/helpers/story.utils.d.ts +32 -0
  25. package/dist/common/props/surface/surface.props.d.ts +6 -0
  26. package/dist/components/Background/src/Background.d.ts +44 -0
  27. package/dist/components/Background/src/Background.js +576 -0
  28. package/dist/components/Background/src/Background.props.d.ts +20 -0
  29. package/dist/components/Background/src/Background.props.js +47 -0
  30. package/dist/components/Background/src/Background.styles.d.ts +3 -0
  31. package/dist/components/Badge/src/Badge.d.ts +28 -0
  32. package/dist/components/Badge/src/Badge.js +429 -0
  33. package/dist/components/Badge/src/Badge.playground.d.ts +2 -0
  34. package/dist/components/Badge/src/Badge.props.d.ts +16 -0
  35. package/dist/components/Badge/src/Badge.props.js +44 -0
  36. package/dist/components/Badge/src/Badge.styles.d.ts +2 -0
  37. package/dist/components/Button/src/Button.d.ts +138 -0
  38. package/dist/components/Button/src/Button.js +1102 -0
  39. package/dist/components/Button/src/Button.playground.d.ts +2 -0
  40. package/dist/components/Button/src/Button.props.d.ts +47 -0
  41. package/dist/components/Button/src/Button.props.js +79 -0
  42. package/dist/components/Button/src/Button.styles.d.ts +11 -0
  43. package/dist/components/Card/src/Card.d.ts +39 -0
  44. package/dist/components/Card/src/Card.js +564 -0
  45. package/dist/components/Card/src/Card.playground.d.ts +2 -0
  46. package/dist/components/Card/src/Card.props.d.ts +22 -0
  47. package/dist/components/Card/src/Card.props.js +42 -0
  48. package/dist/components/Card/src/Card.styles.d.ts +11 -0
  49. package/dist/components/CodeBlock/src/CodeBlock.d.ts +18 -0
  50. package/dist/components/CodeBlock/src/CodeBlock.js +372 -0
  51. package/dist/components/CodeBlock/src/CodeBlock.props.d.ts +1 -0
  52. package/dist/components/CodeBlock/src/CodeBlock.props.js +5 -0
  53. package/dist/components/CodeBlock/src/CodeBlock.styles.d.ts +9 -0
  54. package/dist/components/Container/src/Container.d.ts +26 -0
  55. package/dist/components/Container/src/Container.js +354 -0
  56. package/dist/components/Container/src/Container.props.d.ts +20 -0
  57. package/dist/components/Container/src/Container.props.js +49 -0
  58. package/dist/components/Container/src/Container.styles.d.ts +2 -0
  59. package/dist/components/Divider/src/Divider.d.ts +23 -0
  60. package/dist/components/Divider/src/Divider.js +250 -0
  61. package/dist/components/Divider/src/Divider.props.d.ts +7 -0
  62. package/dist/components/Divider/src/Divider.props.js +34 -0
  63. package/dist/components/Divider/src/Divider.styles.d.ts +2 -0
  64. package/dist/components/FeatureItem/src/FeatureItem.d.ts +30 -0
  65. package/dist/components/FeatureItem/src/FeatureItem.js +368 -0
  66. package/dist/components/FeatureItem/src/FeatureItem.props.d.ts +10 -0
  67. package/dist/components/FeatureItem/src/FeatureItem.props.js +37 -0
  68. package/dist/components/FeatureItem/src/FeatureItem.styles.d.ts +3 -0
  69. package/dist/components/FeatureTabs/src/FeatureTabs.d.ts +48 -0
  70. package/dist/components/FeatureTabs/src/FeatureTabs.js +1333 -0
  71. package/dist/components/FeatureTabs/src/FeatureTabs.props.d.ts +27 -0
  72. package/dist/components/FeatureTabs/src/FeatureTabs.props.js +80 -0
  73. package/dist/components/FeatureTabs/src/FeatureTabs.styles.d.ts +35 -0
  74. package/dist/components/Footer/src/Footer.d.ts +39 -0
  75. package/dist/components/Footer/src/Footer.js +361 -0
  76. package/dist/components/Footer/src/Footer.styles.d.ts +6 -0
  77. package/dist/components/FormBlock/src/FormBlock.d.ts +40 -0
  78. package/dist/components/FormBlock/src/FormBlock.js +476 -0
  79. package/dist/components/FormBlock/src/FormBlock.props.d.ts +5 -0
  80. package/dist/components/FormBlock/src/FormBlock.props.js +8 -0
  81. package/dist/components/FormBlock/src/FormBlock.styles.d.ts +6 -0
  82. package/dist/components/Grid/src/Grid.d.ts +35 -0
  83. package/dist/components/Grid/src/Grid.js +381 -0
  84. package/dist/components/Grid/src/Grid.props.d.ts +28 -0
  85. package/dist/components/Grid/src/Grid.props.js +57 -0
  86. package/dist/components/Grid/src/Grid.styles.d.ts +3 -0
  87. package/dist/components/Heading/src/Heading.d.ts +26 -0
  88. package/dist/components/Heading/src/Heading.js +755 -0
  89. package/dist/components/Heading/src/Heading.playground.d.ts +2 -0
  90. package/dist/components/Heading/src/Heading.props.d.ts +19 -0
  91. package/dist/components/Heading/src/Heading.props.js +47 -0
  92. package/dist/components/Heading/src/Heading.styles.d.ts +4 -0
  93. package/dist/components/HeadingBlock/src/HeadingBlock.d.ts +28 -0
  94. package/dist/components/HeadingBlock/src/HeadingBlock.js +288 -0
  95. package/dist/components/HeadingBlock/src/HeadingBlock.playground.d.ts +2 -0
  96. package/dist/components/HeadingBlock/src/HeadingBlock.props.d.ts +6 -0
  97. package/dist/components/HeadingBlock/src/HeadingBlock.props.js +33 -0
  98. package/dist/components/HeadingBlock/src/HeadingBlock.styles.d.ts +2 -0
  99. package/dist/components/Hero/src/Hero.d.ts +42 -0
  100. package/dist/components/Hero/src/Hero.js +506 -0
  101. package/dist/components/Hero/src/Hero.props.d.ts +22 -0
  102. package/dist/components/Hero/src/Hero.props.js +51 -0
  103. package/dist/components/Hero/src/Hero.styles.d.ts +10 -0
  104. package/dist/components/Icon/src/Icon.d.ts +67 -0
  105. package/dist/components/Icon/src/Icon.js +303 -0
  106. package/dist/components/Icon/src/Icon.props.d.ts +8 -0
  107. package/dist/components/Icon/src/Icon.props.js +35 -0
  108. package/dist/components/Icon/src/Icon.styles.d.ts +3 -0
  109. package/dist/components/Icon/src/icons/arrow-left.d.ts +1 -0
  110. package/dist/components/Icon/src/icons/arrow-left.js +6 -0
  111. package/dist/components/Icon/src/icons/arrow-right.d.ts +1 -0
  112. package/dist/components/Icon/src/icons/arrow-right.js +6 -0
  113. package/dist/components/Icon/src/icons/calendar.d.ts +1 -0
  114. package/dist/components/Icon/src/icons/calendar.js +6 -0
  115. package/dist/components/Icon/src/icons/check.d.ts +1 -0
  116. package/dist/components/Icon/src/icons/check.js +6 -0
  117. package/dist/components/Icon/src/icons/chevron-down.d.ts +1 -0
  118. package/dist/components/Icon/src/icons/chevron-down.js +6 -0
  119. package/dist/components/Icon/src/icons/chevron-left.d.ts +1 -0
  120. package/dist/components/Icon/src/icons/chevron-left.js +6 -0
  121. package/dist/components/Icon/src/icons/chevron-right.d.ts +1 -0
  122. package/dist/components/Icon/src/icons/chevron-right.js +6 -0
  123. package/dist/components/Icon/src/icons/chevron-up.d.ts +1 -0
  124. package/dist/components/Icon/src/icons/chevron-up.js +6 -0
  125. package/dist/components/Icon/src/icons/circle-alert.d.ts +1 -0
  126. package/dist/components/Icon/src/icons/circle-alert.js +6 -0
  127. package/dist/components/Icon/src/icons/circle-check.d.ts +1 -0
  128. package/dist/components/Icon/src/icons/circle-check.js +6 -0
  129. package/dist/components/Icon/src/icons/circle-x.d.ts +1 -0
  130. package/dist/components/Icon/src/icons/circle-x.js +6 -0
  131. package/dist/components/Icon/src/icons/copy.d.ts +1 -0
  132. package/dist/components/Icon/src/icons/copy.js +6 -0
  133. package/dist/components/Icon/src/icons/download.d.ts +1 -0
  134. package/dist/components/Icon/src/icons/download.js +6 -0
  135. package/dist/components/Icon/src/icons/ellipsis-vertical.d.ts +1 -0
  136. package/dist/components/Icon/src/icons/ellipsis-vertical.js +6 -0
  137. package/dist/components/Icon/src/icons/ellipsis.d.ts +1 -0
  138. package/dist/components/Icon/src/icons/ellipsis.js +6 -0
  139. package/dist/components/Icon/src/icons/external-link.d.ts +1 -0
  140. package/dist/components/Icon/src/icons/external-link.js +6 -0
  141. package/dist/components/Icon/src/icons/eye-off.d.ts +1 -0
  142. package/dist/components/Icon/src/icons/eye-off.js +6 -0
  143. package/dist/components/Icon/src/icons/eye.d.ts +1 -0
  144. package/dist/components/Icon/src/icons/eye.js +6 -0
  145. package/dist/components/Icon/src/icons/icon-names.d.ts +2 -0
  146. package/dist/components/Icon/src/icons/icon-names.js +36 -0
  147. package/dist/components/Icon/src/icons/index.d.ts +34 -0
  148. package/dist/components/Icon/src/icons/index.js +35 -0
  149. package/dist/components/Icon/src/icons/info.d.ts +1 -0
  150. package/dist/components/Icon/src/icons/info.js +6 -0
  151. package/dist/components/Icon/src/icons/loader.d.ts +1 -0
  152. package/dist/components/Icon/src/icons/loader.js +6 -0
  153. package/dist/components/Icon/src/icons/mail.d.ts +1 -0
  154. package/dist/components/Icon/src/icons/mail.js +6 -0
  155. package/dist/components/Icon/src/icons/menu.d.ts +1 -0
  156. package/dist/components/Icon/src/icons/menu.js +6 -0
  157. package/dist/components/Icon/src/icons/minus.d.ts +1 -0
  158. package/dist/components/Icon/src/icons/minus.js +6 -0
  159. package/dist/components/Icon/src/icons/pencil.d.ts +1 -0
  160. package/dist/components/Icon/src/icons/pencil.js +6 -0
  161. package/dist/components/Icon/src/icons/plus.d.ts +1 -0
  162. package/dist/components/Icon/src/icons/plus.js +6 -0
  163. package/dist/components/Icon/src/icons/search.d.ts +1 -0
  164. package/dist/components/Icon/src/icons/search.js +6 -0
  165. package/dist/components/Icon/src/icons/settings.d.ts +1 -0
  166. package/dist/components/Icon/src/icons/settings.js +6 -0
  167. package/dist/components/Icon/src/icons/trash-2.d.ts +1 -0
  168. package/dist/components/Icon/src/icons/trash-2.js +6 -0
  169. package/dist/components/Icon/src/icons/triangle-alert.d.ts +1 -0
  170. package/dist/components/Icon/src/icons/triangle-alert.js +6 -0
  171. package/dist/components/Icon/src/icons/upload.d.ts +1 -0
  172. package/dist/components/Icon/src/icons/upload.js +6 -0
  173. package/dist/components/Icon/src/icons/user.d.ts +1 -0
  174. package/dist/components/Icon/src/icons/user.js +6 -0
  175. package/dist/components/Icon/src/icons/x.d.ts +1 -0
  176. package/dist/components/Icon/src/icons/x.js +6 -0
  177. package/dist/components/Image/src/Image.d.ts +76 -0
  178. package/dist/components/Image/src/Image.js +456 -0
  179. package/dist/components/Image/src/Image.props.d.ts +35 -0
  180. package/dist/components/Image/src/Image.props.js +65 -0
  181. package/dist/components/Image/src/Image.styles.d.ts +4 -0
  182. package/dist/components/Input/src/Input.d.ts +60 -0
  183. package/dist/components/Input/src/Input.js +648 -0
  184. package/dist/components/Input/src/Input.playground.d.ts +2 -0
  185. package/dist/components/Input/src/Input.props.d.ts +13 -0
  186. package/dist/components/Input/src/Input.props.js +41 -0
  187. package/dist/components/Input/src/Input.styles.d.ts +6 -0
  188. package/dist/components/Modal/src/Modal.d.ts +166 -0
  189. package/dist/components/Modal/src/Modal.js +1434 -0
  190. package/dist/components/Modal/src/Modal.playground.d.ts +2 -0
  191. package/dist/components/Modal/src/Modal.props.d.ts +66 -0
  192. package/dist/components/Modal/src/Modal.props.js +65 -0
  193. package/dist/components/Modal/src/Modal.styles.d.ts +29 -0
  194. package/dist/components/Nav/src/Nav.d.ts +66 -0
  195. package/dist/components/Nav/src/Nav.js +750 -0
  196. package/dist/components/Nav/src/Nav.props.d.ts +8 -0
  197. package/dist/components/Nav/src/Nav.props.js +13 -0
  198. package/dist/components/Nav/src/Nav.styles.d.ts +10 -0
  199. package/dist/components/NavDropdownColumn/src/NavDropdownColumn.d.ts +17 -0
  200. package/dist/components/NavDropdownColumn/src/NavDropdownColumn.js +170 -0
  201. package/dist/components/NavDropdownColumn/src/NavDropdownColumn.styles.d.ts +1 -0
  202. package/dist/components/NavLink/src/NavLink.d.ts +191 -0
  203. package/dist/components/NavLink/src/NavLink.js +1916 -0
  204. package/dist/components/NavLink/src/NavLink.props.d.ts +38 -0
  205. package/dist/components/NavLink/src/NavLink.props.js +58 -0
  206. package/dist/components/NavLink/src/NavLink.styles.d.ts +22 -0
  207. package/dist/components/Stack/src/Stack.d.ts +30 -0
  208. package/dist/components/Stack/src/Stack.js +300 -0
  209. package/dist/components/Stack/src/Stack.props.d.ts +24 -0
  210. package/dist/components/Stack/src/Stack.props.js +53 -0
  211. package/dist/components/Stack/src/Stack.styles.d.ts +2 -0
  212. package/dist/components/Text/src/Text.d.ts +32 -0
  213. package/dist/components/Text/src/Text.js +327 -0
  214. package/dist/components/Text/src/Text.props.d.ts +23 -0
  215. package/dist/components/Text/src/Text.props.js +52 -0
  216. package/dist/components/Text/src/Text.styles.d.ts +2 -0
  217. package/dist/playground/types.d.ts +29 -0
  218. package/dist/playground-manifest.d.ts +6 -0
  219. package/dist/playground-manifest.js +556 -0
  220. package/dist/react/Background.d.ts +6 -0
  221. package/dist/react/Background.js +13 -0
  222. package/dist/react/Badge.d.ts +6 -0
  223. package/dist/react/Badge.js +13 -0
  224. package/dist/react/Button.d.ts +6 -0
  225. package/dist/react/Button.js +13 -0
  226. package/dist/react/Card.d.ts +6 -0
  227. package/dist/react/Card.js +13 -0
  228. package/dist/react/CodeBlock.d.ts +6 -0
  229. package/dist/react/CodeBlock.js +13 -0
  230. package/dist/react/Container.d.ts +6 -0
  231. package/dist/react/Container.js +13 -0
  232. package/dist/react/Divider.d.ts +6 -0
  233. package/dist/react/Divider.js +13 -0
  234. package/dist/react/FeatureItem.d.ts +6 -0
  235. package/dist/react/FeatureItem.js +13 -0
  236. package/dist/react/FeatureTabs.d.ts +6 -0
  237. package/dist/react/FeatureTabs.js +13 -0
  238. package/dist/react/Footer.d.ts +6 -0
  239. package/dist/react/Footer.js +13 -0
  240. package/dist/react/FormBlock.d.ts +6 -0
  241. package/dist/react/FormBlock.js +13 -0
  242. package/dist/react/Grid.d.ts +6 -0
  243. package/dist/react/Grid.js +13 -0
  244. package/dist/react/Heading.d.ts +6 -0
  245. package/dist/react/Heading.js +13 -0
  246. package/dist/react/HeadingBlock.d.ts +6 -0
  247. package/dist/react/HeadingBlock.js +13 -0
  248. package/dist/react/Hero.d.ts +6 -0
  249. package/dist/react/Hero.js +13 -0
  250. package/dist/react/Icon.d.ts +6 -0
  251. package/dist/react/Icon.js +13 -0
  252. package/dist/react/Image.d.ts +8 -0
  253. package/dist/react/Image.js +13 -0
  254. package/dist/react/Input.d.ts +8 -0
  255. package/dist/react/Input.js +13 -0
  256. package/dist/react/Modal.d.ts +10 -0
  257. package/dist/react/Modal.js +17 -0
  258. package/dist/react/Nav.d.ts +6 -0
  259. package/dist/react/Nav.js +13 -0
  260. package/dist/react/NavDropdownColumn.d.ts +6 -0
  261. package/dist/react/NavDropdownColumn.js +13 -0
  262. package/dist/react/NavLink.d.ts +8 -0
  263. package/dist/react/NavLink.js +13 -0
  264. package/dist/react/Stack.d.ts +6 -0
  265. package/dist/react/Stack.js +13 -0
  266. package/dist/react/Text.d.ts +6 -0
  267. package/dist/react/Text.js +13 -0
  268. package/dist/react/index.d.ts +24 -0
  269. package/dist/react/index.js +25 -0
  270. package/dist/surface/surface.props.js +33 -0
  271. package/package.json +352 -4
@@ -0,0 +1,648 @@
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/Input/src/Input.ts
13
+ import { html as html2, nothing } from "lit";
14
+ import { property, state } 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/Input/src/Input.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
+ --spacing: 0.25rem;
133
+ --text-sm: 0.875rem;
134
+ --text-sm--line-height: calc(1.25 / 0.875);
135
+ --text-base: 1rem;
136
+ --text-base--line-height: calc(1.5 / 1);
137
+ --text-lg: 1.125rem;
138
+ --text-lg--line-height: calc(1.75 / 1.125);
139
+ --font-weight-medium: 500;
140
+ --ease-out: cubic-bezier(0, 0, 0.2, 1);
141
+ --default-transition-duration: 150ms;
142
+ --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
143
+ --color-error: inherit;
144
+ --color-input-bg: inherit;
145
+ --color-input-border: inherit;
146
+ --color-input-error-text: inherit;
147
+ --color-input-focus: inherit;
148
+ --color-input-placeholder: inherit;
149
+ --color-input-text: inherit;
150
+ --color-text-primary: inherit;
151
+ }
152
+ }
153
+ @layer utilities {
154
+ .static {
155
+ position: static;
156
+ }
157
+ .mb-1\\.5 {
158
+ margin-bottom: calc(var(--spacing) * 1.5);
159
+ }
160
+ .block {
161
+ display: block;
162
+ }
163
+ .flex {
164
+ display: flex;
165
+ }
166
+ .h-10 {
167
+ height: calc(var(--spacing) * 10);
168
+ }
169
+ .max-h-0 {
170
+ max-height: calc(var(--spacing) * 0);
171
+ }
172
+ .max-h-12 {
173
+ max-height: calc(var(--spacing) * 12);
174
+ }
175
+ .w-full {
176
+ width: 100%;
177
+ }
178
+ .-translate-y-full {
179
+ --tw-translate-y: -100%;
180
+ translate: var(--tw-translate-x) var(--tw-translate-y);
181
+ }
182
+ .translate-y-0 {
183
+ --tw-translate-y: calc(var(--spacing) * 0);
184
+ translate: var(--tw-translate-x) var(--tw-translate-y);
185
+ }
186
+ .cursor-not-allowed {
187
+ cursor: not-allowed;
188
+ }
189
+ .flex-col {
190
+ flex-direction: column;
191
+ }
192
+ .overflow-hidden {
193
+ overflow: hidden;
194
+ }
195
+ .rounded-full {
196
+ border-radius: calc(infinity * 1px);
197
+ }
198
+ .border {
199
+ border-style: var(--tw-border-style);
200
+ border-width: 1px;
201
+ }
202
+ .border-error {
203
+ border-color: var(--color-error);
204
+ }
205
+ .border-input-border {
206
+ border-color: var(--color-input-border);
207
+ }
208
+ .bg-input-bg {
209
+ background-color: var(--color-input-bg);
210
+ }
211
+ .px-3 {
212
+ padding-inline: calc(var(--spacing) * 3);
213
+ }
214
+ .px-4 {
215
+ padding-inline: calc(var(--spacing) * 4);
216
+ }
217
+ .py-1\\.5 {
218
+ padding-block: calc(var(--spacing) * 1.5);
219
+ }
220
+ .py-3 {
221
+ padding-block: calc(var(--spacing) * 3);
222
+ }
223
+ .pt-1\\.5 {
224
+ padding-top: calc(var(--spacing) * 1.5);
225
+ }
226
+ .text-left {
227
+ text-align: left;
228
+ }
229
+ .font-sans {
230
+ font-family: var(--font-sans);
231
+ }
232
+ .text-base {
233
+ font-size: var(--text-base);
234
+ line-height: var(--tw-leading, var(--text-base--line-height));
235
+ }
236
+ .text-lg {
237
+ font-size: var(--text-lg);
238
+ line-height: var(--tw-leading, var(--text-lg--line-height));
239
+ }
240
+ .text-sm {
241
+ font-size: var(--text-sm);
242
+ line-height: var(--tw-leading, var(--text-sm--line-height));
243
+ }
244
+ .font-medium {
245
+ --tw-font-weight: var(--font-weight-medium);
246
+ font-weight: var(--font-weight-medium);
247
+ }
248
+ .text-input-error-text {
249
+ color: var(--color-input-error-text);
250
+ }
251
+ .text-input-text {
252
+ color: var(--color-input-text);
253
+ }
254
+ .text-text-primary {
255
+ color: var(--color-text-primary);
256
+ }
257
+ .placeholder-input-placeholder {
258
+ &::placeholder {
259
+ color: var(--color-input-placeholder);
260
+ }
261
+ }
262
+ .opacity-50 {
263
+ opacity: 50%;
264
+ }
265
+ .transition-\\[max-height\\] {
266
+ transition-property: max-height;
267
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
268
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
269
+ }
270
+ .transition-colors {
271
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
272
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
273
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
274
+ }
275
+ .transition-transform {
276
+ transition-property: transform, translate, scale, rotate;
277
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
278
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
279
+ }
280
+ .duration-200 {
281
+ --tw-duration: 200ms;
282
+ transition-duration: 200ms;
283
+ }
284
+ .duration-\\[250ms\\] {
285
+ --tw-duration: 250ms;
286
+ transition-duration: 250ms;
287
+ }
288
+ .ease-out {
289
+ --tw-ease: var(--ease-out);
290
+ transition-timing-function: var(--ease-out);
291
+ }
292
+ .focus\\:border-error {
293
+ &:focus {
294
+ border-color: var(--color-error);
295
+ }
296
+ }
297
+ .focus\\:border-input-focus {
298
+ &:focus {
299
+ border-color: var(--color-input-focus);
300
+ }
301
+ }
302
+ .focus\\:ring-2 {
303
+ &:focus {
304
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
305
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
306
+ }
307
+ }
308
+ .focus\\:ring-error {
309
+ &:focus {
310
+ --tw-ring-color: var(--color-error);
311
+ }
312
+ }
313
+ .focus\\:ring-input-focus {
314
+ &:focus {
315
+ --tw-ring-color: var(--color-input-focus);
316
+ }
317
+ }
318
+ .focus\\:outline-none {
319
+ &:focus {
320
+ --tw-outline-style: none;
321
+ outline-style: none;
322
+ }
323
+ }
324
+ }
325
+ @property --dsgn-border-sweep-angle {
326
+ syntax: '<angle>';
327
+ inherits: false;
328
+ initial-value: 0deg;
329
+ }
330
+ @property --tw-translate-x {
331
+ syntax: "*";
332
+ inherits: false;
333
+ initial-value: 0;
334
+ }
335
+ @property --tw-translate-y {
336
+ syntax: "*";
337
+ inherits: false;
338
+ initial-value: 0;
339
+ }
340
+ @property --tw-translate-z {
341
+ syntax: "*";
342
+ inherits: false;
343
+ initial-value: 0;
344
+ }
345
+ @property --tw-border-style {
346
+ syntax: "*";
347
+ inherits: false;
348
+ initial-value: solid;
349
+ }
350
+ @property --tw-font-weight {
351
+ syntax: "*";
352
+ inherits: false;
353
+ }
354
+ @property --tw-duration {
355
+ syntax: "*";
356
+ inherits: false;
357
+ }
358
+ @property --tw-ease {
359
+ syntax: "*";
360
+ inherits: false;
361
+ }
362
+ @property --tw-shadow {
363
+ syntax: "*";
364
+ inherits: false;
365
+ initial-value: 0 0 #0000;
366
+ }
367
+ @property --tw-shadow-color {
368
+ syntax: "*";
369
+ inherits: false;
370
+ }
371
+ @property --tw-shadow-alpha {
372
+ syntax: "<percentage>";
373
+ inherits: false;
374
+ initial-value: 100%;
375
+ }
376
+ @property --tw-inset-shadow {
377
+ syntax: "*";
378
+ inherits: false;
379
+ initial-value: 0 0 #0000;
380
+ }
381
+ @property --tw-inset-shadow-color {
382
+ syntax: "*";
383
+ inherits: false;
384
+ }
385
+ @property --tw-inset-shadow-alpha {
386
+ syntax: "<percentage>";
387
+ inherits: false;
388
+ initial-value: 100%;
389
+ }
390
+ @property --tw-ring-color {
391
+ syntax: "*";
392
+ inherits: false;
393
+ }
394
+ @property --tw-ring-shadow {
395
+ syntax: "*";
396
+ inherits: false;
397
+ initial-value: 0 0 #0000;
398
+ }
399
+ @property --tw-inset-ring-color {
400
+ syntax: "*";
401
+ inherits: false;
402
+ }
403
+ @property --tw-inset-ring-shadow {
404
+ syntax: "*";
405
+ inherits: false;
406
+ initial-value: 0 0 #0000;
407
+ }
408
+ @property --tw-ring-inset {
409
+ syntax: "*";
410
+ inherits: false;
411
+ }
412
+ @property --tw-ring-offset-width {
413
+ syntax: "<length>";
414
+ inherits: false;
415
+ initial-value: 0px;
416
+ }
417
+ @property --tw-ring-offset-color {
418
+ syntax: "*";
419
+ inherits: false;
420
+ initial-value: #fff;
421
+ }
422
+ @property --tw-ring-offset-shadow {
423
+ syntax: "*";
424
+ inherits: false;
425
+ initial-value: 0 0 #0000;
426
+ }
427
+ @layer properties {
428
+ @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
429
+ *, ::before, ::after, ::backdrop {
430
+ --tw-translate-x: 0;
431
+ --tw-translate-y: 0;
432
+ --tw-translate-z: 0;
433
+ --tw-border-style: solid;
434
+ --tw-font-weight: initial;
435
+ --tw-duration: initial;
436
+ --tw-ease: initial;
437
+ --tw-shadow: 0 0 #0000;
438
+ --tw-shadow-color: initial;
439
+ --tw-shadow-alpha: 100%;
440
+ --tw-inset-shadow: 0 0 #0000;
441
+ --tw-inset-shadow-color: initial;
442
+ --tw-inset-shadow-alpha: 100%;
443
+ --tw-ring-color: initial;
444
+ --tw-ring-shadow: 0 0 #0000;
445
+ --tw-inset-ring-color: initial;
446
+ --tw-inset-ring-shadow: 0 0 #0000;
447
+ --tw-ring-inset: initial;
448
+ --tw-ring-offset-width: 0px;
449
+ --tw-ring-offset-color: #fff;
450
+ --tw-ring-offset-shadow: 0 0 #0000;
451
+ --dsgn-border-sweep-angle: 0deg;
452
+ }
453
+ }
454
+ }
455
+ `;
456
+ var Input_default = styles2;
457
+
458
+ // components/Input/src/Input.props.ts
459
+ var inputTypeValues = {
460
+ TEXT: "text",
461
+ EMAIL: "email"
462
+ };
463
+ var inputTypeProps = enumCreator(Object.values(inputTypeValues), "type", String, { reflect: true });
464
+ var inputSizeValues = {
465
+ SM: "sm",
466
+ MD: "md",
467
+ LG: "lg"
468
+ };
469
+ var inputSizeProps = enumCreator(Object.values(inputSizeValues), "size", String, { reflect: true });
470
+
471
+ // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
472
+ function r(e) {
473
+ var t, f, n = "";
474
+ if (typeof e == "string" || typeof e == "number")
475
+ n += e;
476
+ else if (typeof e == "object")
477
+ if (Array.isArray(e)) {
478
+ var o = e.length;
479
+ for (t = 0;t < o; t++)
480
+ e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
481
+ } else
482
+ for (f in e)
483
+ e[f] && (n && (n += " "), n += f);
484
+ return n;
485
+ }
486
+ function clsx() {
487
+ for (var e, t, f = 0, n = "", o = arguments.length;f < o; f++)
488
+ (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
489
+ return n;
490
+ }
491
+ var clsx_default = clsx;
492
+
493
+ // components/Input/src/Input.styles.ts
494
+ var baseClasses = [
495
+ "w-full",
496
+ "bg-input-bg",
497
+ "border",
498
+ "border-input-border",
499
+ "text-input-text",
500
+ "placeholder-input-placeholder",
501
+ "rounded-full",
502
+ "font-sans",
503
+ "transition-colors",
504
+ "duration-200",
505
+ "focus:outline-none",
506
+ "focus:ring-2",
507
+ "focus:ring-input-focus",
508
+ "focus:border-input-focus"
509
+ ];
510
+ var errorClasses = ["border-error", "focus:ring-error", "focus:border-error"];
511
+ var disabledClasses = ["opacity-50", "cursor-not-allowed"];
512
+ var sizeClasses = {
513
+ [inputSizeValues.SM]: ["px-3", "py-1.5", "text-sm"],
514
+ [inputSizeValues.MD]: ["px-4", "h-10", "text-base"],
515
+ [inputSizeValues.LG]: ["px-4", "py-3", "text-lg"]
516
+ };
517
+ var classNames = (size, hasError, disabled) => clsx_default(baseClasses, sizeClasses[size], hasError && errorClasses, disabled && disabledClasses);
518
+ var wrapperClasses = () => clsx_default("flex", "flex-col");
519
+ var labelClasses = () => clsx_default("block", "text-sm", "font-medium", "text-text-primary", "mb-1.5");
520
+ var errorWrapClasses = (hasError) => clsx_default("overflow-hidden", "transition-[max-height]", "duration-[250ms]", "ease-out", hasError ? "max-h-12" : "max-h-0");
521
+ var errorMessageClasses = (hasError) => clsx_default("block", "text-sm", "text-left", "text-input-error-text", "pt-1.5", "transition-transform", "duration-[250ms]", "ease-out", hasError ? "translate-y-0" : "-translate-y-full");
522
+
523
+ // components/Input/src/Input.ts
524
+ class Input extends Base {
525
+ static styles = [Base.styles, Input_default];
526
+ static formAssociated = true;
527
+ #internals;
528
+ constructor() {
529
+ super();
530
+ this.surface = surfaceValues.LIGHT;
531
+ this.type = inputTypeValues.TEXT;
532
+ this.placeholder = "";
533
+ this.label = "";
534
+ this.ariaLabel = "";
535
+ this.error = "";
536
+ this.size = inputSizeValues.MD;
537
+ this.value = "";
538
+ this.name = "";
539
+ this.disabled = false;
540
+ this.required = false;
541
+ this._formDisabled = false;
542
+ this.#internals = this.attachInternals();
543
+ }
544
+ get isDisabled() {
545
+ return this.disabled || this._formDisabled;
546
+ }
547
+ _syncValidity() {
548
+ const input = this.shadowRoot?.querySelector("input");
549
+ if (!input)
550
+ return;
551
+ if (input.validity.valid) {
552
+ this.#internals.setValidity({});
553
+ } else {
554
+ this.#internals.setValidity(input.validity, input.validationMessage, input);
555
+ }
556
+ }
557
+ _handleInput(e) {
558
+ const target = e.target;
559
+ this.value = target.value;
560
+ this.#internals.setFormValue(this.value);
561
+ this._syncValidity();
562
+ this.emit("dsgn-input", { value: this.value, name: this.name });
563
+ }
564
+ formResetCallback() {
565
+ this.value = "";
566
+ this.error = "";
567
+ this.#internals.setFormValue("");
568
+ this.#internals.setValidity({});
569
+ }
570
+ formDisabledCallback(disabled) {
571
+ this._formDisabled = disabled;
572
+ }
573
+ updated(changedProperties) {
574
+ super.updated(changedProperties);
575
+ this.updateTheme(changedProperties, this.surface);
576
+ if (changedProperties.has("value")) {
577
+ this.#internals.setFormValue(this.value);
578
+ }
579
+ if (changedProperties.has("value") || changedProperties.has("disabled") || changedProperties.has("_formDisabled")) {
580
+ this._syncValidity();
581
+ }
582
+ }
583
+ render() {
584
+ return html2`
585
+ <div class="${wrapperClasses()}">
586
+ ${this.label ? html2`<label class="${labelClasses()}" for="input"
587
+ >${this.label}</label
588
+ >` : nothing}
589
+ <input
590
+ id="input"
591
+ type="${this.type}"
592
+ class="${classNames(this.size, !!this.error, this.isDisabled)}"
593
+ placeholder="${this.placeholder || nothing}"
594
+ aria-label="${this.ariaLabel || nothing}"
595
+ .value="${this.value}"
596
+ ?disabled="${this.isDisabled}"
597
+ ?required="${this.required}"
598
+ @input="${this._handleInput}"
599
+ />
600
+ <div class="${errorWrapClasses(!!this.error)}">
601
+ <span class="${errorMessageClasses(!!this.error)}">
602
+ ${this.error}
603
+ </span>
604
+ </div>
605
+ </div>
606
+ `;
607
+ }
608
+ }
609
+ __legacyDecorateClassTS([
610
+ property({ ...surfaceProps })
611
+ ], Input.prototype, "surface", undefined);
612
+ __legacyDecorateClassTS([
613
+ property({ ...inputTypeProps })
614
+ ], Input.prototype, "type", undefined);
615
+ __legacyDecorateClassTS([
616
+ property({ type: String })
617
+ ], Input.prototype, "placeholder", undefined);
618
+ __legacyDecorateClassTS([
619
+ property({ type: String })
620
+ ], Input.prototype, "label", undefined);
621
+ __legacyDecorateClassTS([
622
+ property({ type: String, attribute: "aria-label" })
623
+ ], Input.prototype, "ariaLabel", undefined);
624
+ __legacyDecorateClassTS([
625
+ property({ type: String })
626
+ ], Input.prototype, "error", undefined);
627
+ __legacyDecorateClassTS([
628
+ property({ ...inputSizeProps })
629
+ ], Input.prototype, "size", undefined);
630
+ __legacyDecorateClassTS([
631
+ property({ type: String })
632
+ ], Input.prototype, "value", undefined);
633
+ __legacyDecorateClassTS([
634
+ property({ type: String, reflect: true })
635
+ ], Input.prototype, "name", undefined);
636
+ __legacyDecorateClassTS([
637
+ property({ type: Boolean, reflect: true })
638
+ ], Input.prototype, "disabled", undefined);
639
+ __legacyDecorateClassTS([
640
+ property({ type: Boolean, reflect: true })
641
+ ], Input.prototype, "required", undefined);
642
+ __legacyDecorateClassTS([
643
+ state()
644
+ ], Input.prototype, "_formDisabled", undefined);
645
+ defineElement("dsgn-input", Input);
646
+ export {
647
+ Input
648
+ };
@@ -0,0 +1,2 @@
1
+ import type { PlaygroundDefinition } from '../../../playground/types.js';
2
+ export declare const playground: PlaygroundDefinition;
@@ -0,0 +1,13 @@
1
+ export declare const inputTypeValues: {
2
+ readonly TEXT: "text";
3
+ readonly EMAIL: "email";
4
+ };
5
+ export type InputTypeType = (typeof inputTypeValues)[keyof typeof inputTypeValues];
6
+ export declare const inputTypeProps: import("lit").PropertyDeclaration<unknown, unknown>;
7
+ export declare const inputSizeValues: {
8
+ readonly SM: "sm";
9
+ readonly MD: "md";
10
+ readonly LG: "lg";
11
+ };
12
+ export type InputSizeType = (typeof inputSizeValues)[keyof typeof inputSizeValues];
13
+ export declare const inputSizeProps: import("lit").PropertyDeclaration<unknown, unknown>;
@@ -0,0 +1,41 @@
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/Input/src/Input.props.ts
25
+ var inputTypeValues = {
26
+ TEXT: "text",
27
+ EMAIL: "email"
28
+ };
29
+ var inputTypeProps = enumCreator(Object.values(inputTypeValues), "type", String, { reflect: true });
30
+ var inputSizeValues = {
31
+ SM: "sm",
32
+ MD: "md",
33
+ LG: "lg"
34
+ };
35
+ var inputSizeProps = enumCreator(Object.values(inputSizeValues), "size", String, { reflect: true });
36
+ export {
37
+ inputSizeProps,
38
+ inputSizeValues,
39
+ inputTypeProps,
40
+ inputTypeValues
41
+ };
@@ -0,0 +1,6 @@
1
+ import { type InputSizeType } from './Input.props.js';
2
+ export declare const classNames: (size: InputSizeType, hasError: boolean, disabled: boolean) => string;
3
+ export declare const wrapperClasses: () => string;
4
+ export declare const labelClasses: () => string;
5
+ export declare const errorWrapClasses: (hasError: boolean) => string;
6
+ export declare const errorMessageClasses: (hasError: boolean) => string;