ds-one 0.2.5-alpha.8 → 0.3.0-alpha.1

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 (213) hide show
  1. package/DS1/0-face/device.ts +138 -0
  2. package/DS1/0-face/i18n.ts +36 -89
  3. package/DS1/0-face/scaling.ts +152 -0
  4. package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
  5. package/DS1/1-root/one.css +124 -77
  6. package/DS1/2-core/ds-banner.ts +120 -1
  7. package/DS1/2-core/ds-button.ts +16 -96
  8. package/DS1/2-core/ds-card.ts +137 -0
  9. package/DS1/2-core/ds-cycle.ts +82 -184
  10. package/DS1/2-core/ds-date.ts +3 -10
  11. package/DS1/2-core/ds-gap.ts +38 -0
  12. package/DS1/2-core/ds-icon.ts +6 -35
  13. package/DS1/2-core/ds-input.ts +306 -1
  14. package/DS1/2-core/ds-pagedots.ts +52 -0
  15. package/DS1/2-core/ds-text.ts +55 -28
  16. package/DS1/2-core/ds-tooltip.ts +14 -66
  17. package/DS1/2-core/styles/ds-banner.css +77 -0
  18. package/DS1/2-core/styles/ds-button.css +67 -0
  19. package/DS1/2-core/styles/ds-cycle.css +21 -0
  20. package/DS1/2-core/styles/ds-date.css +9 -0
  21. package/DS1/2-core/styles/ds-gap.css +93 -0
  22. package/DS1/2-core/styles/ds-icon.css +30 -0
  23. package/DS1/2-core/styles/ds-input.css +46 -0
  24. package/DS1/2-core/styles/ds-pagedots.css +31 -0
  25. package/DS1/2-core/styles/ds-text.css +29 -0
  26. package/DS1/2-core/styles/ds-tooltip.css +49 -0
  27. package/DS1/3-unit/ds-accordion.ts +95 -0
  28. package/DS1/3-unit/ds-form.ts +304 -0
  29. package/DS1/3-unit/ds-list.ts +5 -14
  30. package/DS1/3-unit/ds-row.ts +3 -19
  31. package/DS1/3-unit/ds-table.ts +3 -86
  32. package/DS1/3-unit/styles/ds-accordion.css +46 -0
  33. package/DS1/3-unit/styles/ds-list.css +9 -0
  34. package/DS1/3-unit/styles/ds-row.css +19 -0
  35. package/DS1/3-unit/styles/ds-table.css +80 -0
  36. package/DS1/4-page/ds-container.ts +28 -0
  37. package/DS1/4-page/ds-grid.ts +37 -50
  38. package/DS1/4-page/ds-layout.ts +652 -163
  39. package/DS1/4-page/styles/ds-container.css +35 -0
  40. package/DS1/4-page/styles/ds-grid.css +56 -0
  41. package/DS1/4-page/styles/ds-layout.css +246 -0
  42. package/DS1/index.ts +9 -1
  43. package/DS1/vite-env.d.ts +13 -0
  44. package/DS1/x-icon/2x.svg +4 -0
  45. package/DS1/x-icon/2xdots.svg +18 -0
  46. package/DS1/x-icon/2xgrid.svg +6 -0
  47. package/DS1/x-icon/2xlines.svg +6 -0
  48. package/DS1/x-icon/4x4.svg +18 -0
  49. package/DS1/x-icon/apple.svg +4 -0
  50. package/DS1/x-icon/avatar.svg +4 -0
  51. package/DS1/x-icon/big.svg +4 -0
  52. package/DS1/x-icon/blank.svg +3 -0
  53. package/DS1/x-icon/check.svg +3 -0
  54. package/DS1/x-icon/close.svg +3 -0
  55. package/DS1/x-icon/collapse.svg +3 -0
  56. package/DS1/x-icon/color.svg +4 -0
  57. package/DS1/x-icon/column.svg +5 -0
  58. package/DS1/x-icon/default.svg +3 -0
  59. package/DS1/x-icon/delete.svg +5 -0
  60. package/DS1/x-icon/dictate.svg +6 -0
  61. package/DS1/x-icon/do.svg +3 -0
  62. package/DS1/x-icon/down.svg +3 -0
  63. package/DS1/x-icon/duplicate.svg +4 -0
  64. package/DS1/x-icon/gallery.svg +5 -0
  65. package/DS1/x-icon/google.svg +6 -0
  66. package/DS1/x-icon/head.svg +5 -0
  67. package/DS1/x-icon/home.svg +3 -0
  68. package/DS1/x-icon/icon.svg +4 -0
  69. package/DS1/x-icon/in.svg +4 -0
  70. package/DS1/x-icon/lock.svg +5 -0
  71. package/DS1/x-icon/loop.svg +5 -0
  72. package/DS1/x-icon/mic.svg +5 -0
  73. package/DS1/x-icon/minimize.svg +3 -0
  74. package/DS1/x-icon/more.svg +5 -0
  75. package/DS1/x-icon/neutral.svg +6 -0
  76. package/DS1/x-icon/note.svg +6 -0
  77. package/DS1/x-icon/page.svg +4 -0
  78. package/DS1/x-icon/plus.svg +3 -0
  79. package/DS1/x-icon/rewind.svg +4 -0
  80. package/DS1/x-icon/row.svg +5 -0
  81. package/DS1/x-icon/sdown.svg +3 -0
  82. package/DS1/x-icon/search.svg +4 -0
  83. package/DS1/x-icon/see.svg +4 -0
  84. package/DS1/x-icon/ship.svg +5 -0
  85. package/DS1/x-icon/star.svg +3 -0
  86. package/DS1/x-icon/status.svg +4 -0
  87. package/DS1/x-icon/sup.svg +3 -0
  88. package/DS1/x-icon/title.svg +3 -0
  89. package/DS1/x-icon/undo.svg +3 -0
  90. package/DS1/x-icon/ungroup.svg +4 -0
  91. package/DS1/x-icon/unhead.svg +3 -0
  92. package/DS1/x-icon/unicon.svg +3 -0
  93. package/DS1/x-icon/unlock.svg +5 -0
  94. package/DS1/x-icon/unmic.svg +6 -0
  95. package/DS1/x-icon/unsee.svg +5 -0
  96. package/DS1/x-icon/unstar.svg +3 -0
  97. package/DS1/x-icon/untitle.svg +3 -0
  98. package/DS1/x-icon/up.svg +3 -0
  99. package/LICENSE +1 -1
  100. package/README.md +4 -4
  101. package/dist/0-face/device.d.ts +5 -0
  102. package/dist/0-face/device.d.ts.map +1 -1
  103. package/dist/0-face/device.js +111 -0
  104. package/dist/0-face/i18n.d.ts +0 -2
  105. package/dist/0-face/i18n.d.ts.map +1 -1
  106. package/dist/0-face/i18n.js +36 -73
  107. package/dist/0-face/scaling.d.ts +48 -0
  108. package/dist/0-face/scaling.d.ts.map +1 -0
  109. package/dist/0-face/scaling.js +114 -0
  110. package/dist/2-core/ds-banner.d.ts +67 -0
  111. package/dist/2-core/ds-banner.d.ts.map +1 -1
  112. package/dist/2-core/ds-banner.js +97 -1
  113. package/dist/2-core/ds-button.d.ts +4 -20
  114. package/dist/2-core/ds-button.d.ts.map +1 -1
  115. package/dist/2-core/ds-button.js +14 -88
  116. package/dist/2-core/ds-card.d.ts +39 -0
  117. package/dist/2-core/ds-card.d.ts.map +1 -0
  118. package/dist/2-core/ds-card.js +119 -0
  119. package/dist/2-core/ds-cycle.d.ts +1 -5
  120. package/dist/2-core/ds-cycle.d.ts.map +1 -1
  121. package/dist/2-core/ds-cycle.js +79 -166
  122. package/dist/2-core/ds-date.d.ts.map +1 -1
  123. package/dist/2-core/ds-date.js +3 -9
  124. package/dist/2-core/ds-gap.d.ts +28 -0
  125. package/dist/2-core/ds-gap.d.ts.map +1 -0
  126. package/dist/2-core/ds-gap.js +25 -0
  127. package/dist/2-core/ds-icon.d.ts.map +1 -1
  128. package/dist/2-core/ds-icon.js +6 -35
  129. package/dist/2-core/ds-input.d.ts +127 -0
  130. package/dist/2-core/ds-input.d.ts.map +1 -1
  131. package/dist/2-core/ds-input.js +252 -1
  132. package/dist/2-core/ds-pagedots.d.ts +32 -0
  133. package/dist/2-core/ds-pagedots.d.ts.map +1 -0
  134. package/dist/2-core/ds-pagedots.js +36 -0
  135. package/dist/2-core/ds-text.d.ts +5 -3
  136. package/dist/2-core/ds-text.d.ts.map +1 -1
  137. package/dist/2-core/ds-text.js +49 -27
  138. package/dist/2-core/ds-tooltip.d.ts +3 -3
  139. package/dist/2-core/ds-tooltip.d.ts.map +1 -1
  140. package/dist/2-core/ds-tooltip.js +13 -65
  141. package/dist/2-core/styles/ds-banner.css +77 -0
  142. package/dist/2-core/styles/ds-button.css +67 -0
  143. package/dist/2-core/styles/ds-cycle.css +21 -0
  144. package/dist/2-core/styles/ds-date.css +9 -0
  145. package/dist/2-core/styles/ds-gap.css +93 -0
  146. package/dist/2-core/styles/ds-icon.css +30 -0
  147. package/dist/2-core/styles/ds-input.css +46 -0
  148. package/dist/2-core/styles/ds-pagedots.css +26 -0
  149. package/dist/2-core/styles/ds-text.css +29 -0
  150. package/dist/2-core/styles/ds-tooltip.css +49 -0
  151. package/dist/3-unit/ds-accordion.d.ts +47 -0
  152. package/dist/3-unit/ds-accordion.d.ts.map +1 -0
  153. package/dist/3-unit/ds-accordion.js +75 -0
  154. package/dist/3-unit/ds-form.d.ts +70 -0
  155. package/dist/3-unit/ds-form.d.ts.map +1 -0
  156. package/dist/3-unit/ds-form.js +232 -0
  157. package/dist/3-unit/ds-list.d.ts.map +1 -1
  158. package/dist/3-unit/ds-list.js +5 -11
  159. package/dist/3-unit/ds-row.d.ts.map +1 -1
  160. package/dist/3-unit/ds-row.js +3 -19
  161. package/dist/3-unit/ds-table.d.ts.map +1 -1
  162. package/dist/3-unit/ds-table.js +3 -86
  163. package/dist/3-unit/styles/ds-accordion.css +46 -0
  164. package/dist/3-unit/styles/ds-list.css +9 -0
  165. package/dist/3-unit/styles/ds-row.css +19 -0
  166. package/dist/3-unit/styles/ds-table.css +80 -0
  167. package/dist/{3-unit/row-v1.d.ts → 4-page/ds-container.d.ts} +3 -11
  168. package/dist/4-page/ds-container.d.ts.map +1 -0
  169. package/dist/4-page/ds-container.js +11 -0
  170. package/dist/4-page/ds-grid.d.ts +5 -0
  171. package/dist/4-page/ds-grid.d.ts.map +1 -1
  172. package/dist/4-page/ds-grid.js +38 -56
  173. package/dist/4-page/ds-layout.d.ts +3 -3
  174. package/dist/4-page/ds-layout.d.ts.map +1 -1
  175. package/dist/4-page/ds-layout.js +651 -162
  176. package/dist/4-page/styles/ds-container.css +35 -0
  177. package/dist/4-page/styles/ds-grid.css +56 -0
  178. package/dist/4-page/styles/ds-layout.css +251 -0
  179. package/dist/ds-one.bundle.css +700 -0
  180. package/dist/ds-one.bundle.css.map +7 -0
  181. package/dist/ds-one.bundle.js +2728 -1597
  182. package/dist/ds-one.bundle.js.map +1 -7
  183. package/dist/ds-one.bundle.min.css +2 -0
  184. package/dist/ds-one.bundle.min.css.map +7 -0
  185. package/dist/ds-one.bundle.min.js +3850 -546
  186. package/dist/ds-one.bundle.min.js.map +1 -7
  187. package/dist/index.d.ts +9 -1
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +9 -1
  190. package/package.json +4 -3
  191. package/dist/3-unit/doublenav-v1.d.ts +0 -51
  192. package/dist/3-unit/doublenav-v1.d.ts.map +0 -1
  193. package/dist/3-unit/doublenav-v1.js +0 -88
  194. package/dist/3-unit/ds-portfolio-doublenav.d.ts +0 -51
  195. package/dist/3-unit/ds-portfolio-doublenav.d.ts.map +0 -1
  196. package/dist/3-unit/ds-portfolio-doublenav.js +0 -88
  197. package/dist/3-unit/ds-portfolio-panel.d.ts +0 -11
  198. package/dist/3-unit/ds-portfolio-panel.d.ts.map +0 -1
  199. package/dist/3-unit/ds-portfolio-panel.js +0 -16
  200. package/dist/3-unit/ds-portfolio-singlenav.d.ts +0 -32
  201. package/dist/3-unit/ds-portfolio-singlenav.d.ts.map +0 -1
  202. package/dist/3-unit/ds-portfolio-singlenav.js +0 -62
  203. package/dist/3-unit/list-v1.d.ts +0 -11
  204. package/dist/3-unit/list-v1.d.ts.map +0 -1
  205. package/dist/3-unit/list-v1.js +0 -15
  206. package/dist/3-unit/panel-v1.d.ts +0 -11
  207. package/dist/3-unit/panel-v1.d.ts.map +0 -1
  208. package/dist/3-unit/panel-v1.js +0 -16
  209. package/dist/3-unit/row-v1.d.ts.map +0 -1
  210. package/dist/3-unit/row-v1.js +0 -32
  211. package/dist/3-unit/singlenav-v1.d.ts +0 -32
  212. package/dist/3-unit/singlenav-v1.d.ts.map +0 -1
  213. package/dist/3-unit/singlenav-v1.js +0 -62
@@ -0,0 +1,114 @@
1
+ // scaling.ts
2
+ // Responsive scaling utilities for the design system
3
+ import { signal } from "@lit-labs/signals";
4
+ const defaultConfig = {
5
+ mode: "auto",
6
+ baseWidth: 280,
7
+ minScale: 0.75,
8
+ maxScale: 2.0,
9
+ };
10
+ // Reactive scaling factor signal
11
+ export const scalingFactor = signal(1);
12
+ // Current scaling configuration
13
+ export const scalingConfig = signal(defaultConfig);
14
+ /**
15
+ * Calculate the scaling factor based on viewport width
16
+ * @param viewportWidth - Current viewport width in pixels
17
+ * @param config - Scaling configuration
18
+ * @returns The calculated scaling factor
19
+ */
20
+ export function calculateScalingFactor(viewportWidth, config = scalingConfig.get()) {
21
+ if (config.mode === "fixed") {
22
+ return 1;
23
+ }
24
+ const rawScale = viewportWidth / config.baseWidth;
25
+ const clampedScale = Math.max(config.minScale, Math.min(config.maxScale, rawScale));
26
+ return Number(clampedScale.toFixed(3));
27
+ }
28
+ /**
29
+ * Set the scaling configuration
30
+ * @param config - Partial scaling configuration to apply
31
+ */
32
+ export function setScalingConfig(config) {
33
+ const currentConfig = scalingConfig.get();
34
+ const newConfig = { ...currentConfig, ...config };
35
+ scalingConfig.set(newConfig);
36
+ // Recalculate scaling factor if in browser
37
+ if (typeof window !== "undefined") {
38
+ updateScalingFactor();
39
+ }
40
+ }
41
+ /**
42
+ * Update the scaling factor based on current viewport
43
+ */
44
+ export function updateScalingFactor() {
45
+ if (typeof window === "undefined" || typeof document === "undefined") {
46
+ return;
47
+ }
48
+ const viewportWidth = document.documentElement.clientWidth;
49
+ const config = scalingConfig.get();
50
+ const newFactor = calculateScalingFactor(viewportWidth, config);
51
+ scalingFactor.set(newFactor);
52
+ // Update CSS custom property
53
+ document.documentElement.style.setProperty("--sf", newFactor.toString());
54
+ // Dispatch event for components that need to react
55
+ window.dispatchEvent(new CustomEvent("scaling-changed", {
56
+ detail: { scalingFactor: newFactor, config },
57
+ }));
58
+ }
59
+ /**
60
+ * Get the current scaling factor
61
+ * @returns The current scaling factor
62
+ */
63
+ export function getScalingFactor() {
64
+ return scalingFactor.get();
65
+ }
66
+ /**
67
+ * Convert a design pixel value to scaled pixels
68
+ * @param designPx - The design pixel value (based on 280px width)
69
+ * @returns The scaled pixel value
70
+ */
71
+ export function scale(designPx) {
72
+ return designPx * scalingFactor.get();
73
+ }
74
+ /**
75
+ * Convert a scaled pixel value back to design pixels
76
+ * @param scaledPx - The scaled pixel value
77
+ * @returns The design pixel value
78
+ */
79
+ export function unscale(scaledPx) {
80
+ const factor = scalingFactor.get();
81
+ return factor === 0 ? scaledPx : scaledPx / factor;
82
+ }
83
+ /**
84
+ * Initialize scaling system
85
+ * This is typically called automatically when the module loads
86
+ */
87
+ export function initScaling() {
88
+ if (typeof window === "undefined") {
89
+ return;
90
+ }
91
+ // Initial calculation
92
+ updateScalingFactor();
93
+ // Update on resize (debounced)
94
+ let resizeTimeout;
95
+ window.addEventListener("resize", () => {
96
+ clearTimeout(resizeTimeout);
97
+ resizeTimeout = setTimeout(() => {
98
+ updateScalingFactor();
99
+ }, 100);
100
+ });
101
+ // Update on orientation change
102
+ window.addEventListener("orientationchange", () => {
103
+ setTimeout(updateScalingFactor, 100);
104
+ });
105
+ }
106
+ // Auto-initialize when module loads in browser
107
+ if (typeof window !== "undefined") {
108
+ if (document.readyState === "loading") {
109
+ document.addEventListener("DOMContentLoaded", initScaling);
110
+ }
111
+ else {
112
+ initScaling();
113
+ }
114
+ }
@@ -1 +1,68 @@
1
+ import { LitElement } from "lit";
2
+ import "./ds-text.js";
3
+ import "./ds-button.js";
4
+ declare global {
5
+ interface CustomElementRegistry {
6
+ define(name: string, constructor: typeof LitElement): void;
7
+ }
8
+ var customElements: CustomElementRegistry;
9
+ }
10
+ export declare class Banner extends LitElement {
11
+ static properties: {
12
+ text: {
13
+ type: StringConstructor;
14
+ };
15
+ action: {
16
+ type: StringConstructor;
17
+ };
18
+ href: {
19
+ type: StringConstructor;
20
+ };
21
+ mailto: {
22
+ type: StringConstructor;
23
+ };
24
+ subject: {
25
+ type: StringConstructor;
26
+ };
27
+ describe: {
28
+ type: StringConstructor;
29
+ };
30
+ appVersion: {
31
+ type: StringConstructor;
32
+ attribute: string;
33
+ };
34
+ variant: {
35
+ type: StringConstructor;
36
+ };
37
+ version: {
38
+ type: StringConstructor;
39
+ };
40
+ _showVersion: {
41
+ type: BooleanConstructor;
42
+ state: boolean;
43
+ };
44
+ };
45
+ text: string;
46
+ action: string;
47
+ href: string;
48
+ mailto: string;
49
+ subject: string;
50
+ describe: string;
51
+ appVersion: string;
52
+ variant: string;
53
+ version: string;
54
+ _showVersion: boolean;
55
+ private _boundUpdate;
56
+ connectedCallback(): void;
57
+ disconnectedCallback(): void;
58
+ static styles: import("lit").CSSResult;
59
+ private _toggleVersion;
60
+ private _getMailtoHref;
61
+ render(): import("lit-html").TemplateResult<1>;
62
+ }
63
+ declare global {
64
+ interface HTMLElementTagNameMap {
65
+ "ds-banner": Banner;
66
+ }
67
+ }
1
68
  //# sourceMappingURL=ds-banner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ds-banner.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-banner.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"ds-banner.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-banner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAElD,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AAGxB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,UAAU,GAAG,IAAI,CAAC;KAC5D;IACD,IAAI,cAAc,EAAE,qBAAqB,CAAC;CAC3C;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAWf;IAEF,IAAI,EAAE,MAAM,CAAM;IAClB,MAAM,EAAE,MAAM,CAAM;IACpB,IAAI,EAAE,MAAM,CAAM;IAClB,MAAM,EAAE,MAAM,CAAM;IACpB,OAAO,EAAE,MAAM,CAAM;IACrB,QAAQ,EAAE,MAAM,CAAM;IACtB,UAAU,EAAE,MAAM,CAAM;IACxB,OAAO,EAAE,MAAM,CAAa;IAC5B,OAAO,EAAE,MAAM,CAAM;IACrB,YAAY,EAAE,OAAO,CAAS;IAE9B,OAAO,CAAC,YAAY,CAA8B;IAElD,iBAAiB;IAOjB,oBAAoB;IAMpB,MAAM,CAAC,MAAM,0BAAqB;IAElC,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,cAAc;IA6BtB,MAAM;CAoBP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
@@ -1,2 +1,98 @@
1
1
  // ds-banner.ts
2
- // Core component
2
+ // Fixed banner component for notifications/alerts
3
+ import { LitElement, html, unsafeCSS } from "lit";
4
+ import { getText } from "../0-face/i18n.js";
5
+ import "./ds-text.js";
6
+ import "./ds-button.js";
7
+ import styles from "./styles/ds-banner.css?inline";
8
+ export class Banner extends LitElement {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.text = "";
12
+ this.action = "";
13
+ this.href = "";
14
+ this.mailto = "";
15
+ this.subject = "";
16
+ this.describe = "";
17
+ this.appVersion = "";
18
+ this.variant = "warning"; // warning, info, success, error
19
+ this.version = "";
20
+ this._showVersion = false;
21
+ this._boundUpdate = () => this.requestUpdate();
22
+ }
23
+ connectedCallback() {
24
+ super.connectedCallback();
25
+ // Listen for translations and language changes to rebuild mailto URL
26
+ window.addEventListener("translations-loaded", this._boundUpdate);
27
+ window.addEventListener("language-changed", this._boundUpdate);
28
+ }
29
+ disconnectedCallback() {
30
+ super.disconnectedCallback();
31
+ window.removeEventListener("translations-loaded", this._boundUpdate);
32
+ window.removeEventListener("language-changed", this._boundUpdate);
33
+ }
34
+ _toggleVersion() {
35
+ if (this.version) {
36
+ this._showVersion = !this._showVersion;
37
+ }
38
+ }
39
+ _getMailtoHref() {
40
+ // If a direct href is provided, use it
41
+ if (this.href && this.href !== "#")
42
+ return this.href;
43
+ // If mailto is provided, build internationalized URL
44
+ if (this.mailto) {
45
+ try {
46
+ const subject = this.subject
47
+ ? getText(this.subject) || this.subject
48
+ : "Issue report";
49
+ const describe = this.describe
50
+ ? getText(this.describe) || this.describe
51
+ : "Describe the issue:";
52
+ const appVersionLabel = this.appVersion
53
+ ? getText(this.appVersion) || this.appVersion
54
+ : "App version:";
55
+ const body = `${describe}\n\n\n${appVersionLabel} ${this.version || ""}`;
56
+ return `mailto:${this.mailto}?subject=${encodeURIComponent(subject)}&body=${encodeURIComponent(body)}`;
57
+ }
58
+ catch (error) {
59
+ // Fallback if translations fail
60
+ return `mailto:${this.mailto}?subject=Issue%20report&body=Describe%20the%20issue%3A%0A%0A%0AApp%20version%3A%20${this.version || ""}`;
61
+ }
62
+ }
63
+ return "#";
64
+ }
65
+ render() {
66
+ const mailtoHref = this._getMailtoHref();
67
+ return html `
68
+ <div class="text-wrapper" @click=${this._toggleVersion}>
69
+ ${this._showVersion && this.version
70
+ ? html `<ds-text default-value=${this.version}></ds-text>`
71
+ : html `<ds-text text=${this.text}><slot></slot></ds-text>`}
72
+ </div>
73
+ ${this.action
74
+ ? html `
75
+ <div class="action-wrapper">
76
+ <a href=${mailtoHref}>
77
+ <ds-text text=${this.action}></ds-text>
78
+ </a>
79
+ </div>
80
+ `
81
+ : ""}
82
+ `;
83
+ }
84
+ }
85
+ Banner.properties = {
86
+ text: { type: String },
87
+ action: { type: String },
88
+ href: { type: String },
89
+ mailto: { type: String },
90
+ subject: { type: String },
91
+ describe: { type: String },
92
+ appVersion: { type: String, attribute: "app-version" },
93
+ variant: { type: String },
94
+ version: { type: String },
95
+ _showVersion: { type: Boolean, state: true },
96
+ };
97
+ Banner.styles = unsafeCSS(styles);
98
+ customElements.define("ds-banner", Banner);
@@ -1,4 +1,5 @@
1
- import { LitElement, type PropertyValues } from "lit";
1
+ import { LitElement } from "lit";
2
+ import "./ds-text";
2
3
  export declare class Button extends LitElement {
3
4
  static properties: {
4
5
  variant: {
@@ -22,11 +23,7 @@ export declare class Button extends LitElement {
22
23
  type: BooleanConstructor;
23
24
  reflect: boolean;
24
25
  };
25
- notionKey: {
26
- type: StringConstructor;
27
- attribute: string;
28
- };
29
- key: {
26
+ text: {
30
27
  type: StringConstructor;
31
28
  };
32
29
  fallback: {
@@ -46,34 +43,21 @@ export declare class Button extends LitElement {
46
43
  type: BooleanConstructor;
47
44
  state: boolean;
48
45
  };
49
- _notionText: {
50
- type: StringConstructor;
51
- state: boolean;
52
- };
53
46
  };
54
47
  variant: string;
55
48
  disabled: boolean;
56
49
  bold: boolean;
57
50
  "no-background": boolean;
58
51
  blank: boolean;
59
- notionKey: string | null;
60
- key: string;
52
+ text: string;
61
53
  fallback: string;
62
54
  language: string;
63
55
  defaultText: string;
64
56
  href: string;
65
57
  _loading: boolean;
66
- _notionText: string | null;
67
58
  constructor();
68
59
  static styles: import("lit").CSSResult;
69
60
  connectedCallback(): void;
70
- disconnectedCallback(): void;
71
- _handleLanguageChange: () => void;
72
- updated(changedProps: PropertyValues): void;
73
- /**
74
- * Update text from translations (synchronous like Portfolio)
75
- */
76
- private _updateText;
77
61
  render(): import("lit-html").TemplateResult<1>;
78
62
  private _handleClick;
79
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ds-button.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-button.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkBf;IAGM,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;;IAmBnC,MAAM,CAAC,MAAM,0BAkDX;IAEF,iBAAiB;IAQjB,oBAAoB;IAKpB,qBAAqB,aAEnB;IAEF,OAAO,CAAC,YAAY,EAAE,cAAc;IAQpC;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB,MAAM;IAcN,OAAO,CAAC,YAAY;CAwBrB;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
1
+ {"version":3,"file":"ds-button.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-button.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAClD,OAAO,WAAW,CAAC;AAGnB,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBf;IAGM,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IAGb,QAAQ,EAAE,OAAO,CAAC;;IAiB1B,MAAM,CAAC,MAAM,0BAAqB;IAElC,iBAAiB;IAIjB,MAAM;IAsBN,OAAO,CAAC,YAAY;CAwBrB;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
@@ -1,56 +1,28 @@
1
1
  // ds-button.ts
2
2
  // Core button component
3
- import { LitElement, html, css } from "lit";
4
- import { getText } from "../0-face/i18n";
3
+ import { LitElement, html, unsafeCSS } from "lit";
4
+ import "./ds-text";
5
+ import styles from "./styles/ds-button.css?inline";
5
6
  export class Button extends LitElement {
6
7
  constructor() {
7
8
  super();
8
- this._handleLanguageChange = () => {
9
- this._updateText();
10
- };
11
9
  this.variant = "title";
12
10
  this.disabled = false;
13
11
  this.bold = false;
14
12
  this["no-background"] = false;
15
13
  this.blank = false;
16
- this.notionKey = null;
17
- this.key = "";
14
+ this.text = "";
18
15
  this.fallback = "";
19
16
  this.language = "en-US";
20
17
  this.defaultText = "";
21
18
  this.href = "";
22
19
  this._loading = false;
23
- this._notionText = null;
24
20
  }
25
21
  connectedCallback() {
26
22
  super.connectedCallback();
27
- this._updateText();
28
- // Listen for language changes
29
- window.addEventListener("language-changed", this._handleLanguageChange);
30
- }
31
- disconnectedCallback() {
32
- super.disconnectedCallback();
33
- window.removeEventListener("language-changed", this._handleLanguageChange);
34
- }
35
- updated(changedProps) {
36
- super.updated(changedProps);
37
- if (changedProps.has("key") || changedProps.has("defaultText")) {
38
- this._updateText();
39
- }
40
- }
41
- /**
42
- * Update text from translations (synchronous like Portfolio)
43
- */
44
- _updateText() {
45
- if (this.key) {
46
- this._notionText = getText(this.key);
47
- }
48
- else {
49
- this._notionText = this.defaultText || this.fallback || null;
50
- }
51
- this.requestUpdate();
52
23
  }
53
24
  render() {
25
+ const hasTextProps = this.text || this.defaultText || this.fallback;
54
26
  return html `
55
27
  <button
56
28
  class=${this.variant}
@@ -59,7 +31,13 @@ export class Button extends LitElement {
59
31
  ?no-background=${this["no-background"]}
60
32
  @click=${this._handleClick}
61
33
  >
62
- ${this._notionText ? this._notionText : html `<slot></slot>`}
34
+ ${hasTextProps
35
+ ? html `<ds-text
36
+ .text=${this.text}
37
+ .defaultValue=${this.defaultText}
38
+ .fallback=${this.fallback}
39
+ ></ds-text>`
40
+ : html `<slot></slot>`}
63
41
  </button>
64
42
  `;
65
43
  }
@@ -97,64 +75,12 @@ Button.properties = {
97
75
  attribute: "no-background",
98
76
  },
99
77
  blank: { type: Boolean, reflect: true },
100
- notionKey: { type: String, attribute: "notion-key" },
101
- key: { type: String },
78
+ text: { type: String },
102
79
  fallback: { type: String },
103
80
  language: { type: String },
104
81
  defaultText: { type: String, attribute: "default-text" },
105
82
  href: { type: String },
106
83
  _loading: { type: Boolean, state: true },
107
- _notionText: { type: String, state: true },
108
84
  };
109
- Button.styles = css `
110
- button {
111
- max-height: calc(var(--08) * var(--scaling-factor));
112
- border: none;
113
- cursor: pointer;
114
- font-size: calc(var(--type-size-default) * var(--scaling-factor));
115
- padding: 0 calc(1px * var(--scaling-factor));
116
- color: var(--button-text-color);
117
- font-family: var(--typeface);
118
- }
119
-
120
- button.title {
121
- background-color: var(--button-background-color-secondary);
122
- color: var(--button-text-color);
123
- }
124
-
125
- button.primary {
126
- background-color: var(--accent-color);
127
- color: var(--button-text-color);
128
- text-decoration-line: none;
129
- font-family: var(--typeface);
130
- }
131
-
132
- button.secondary {
133
- background-color: var(--button-background-color-secondary);
134
- color: var(--button-text-color);
135
- font-family: var(--typeface);
136
- }
137
-
138
- button[bold] {
139
- font-weight: var(--type-weight-bold);
140
- font-family: var(--typeface-medium);
141
- }
142
-
143
- button[no-background] {
144
- background-color: transparent;
145
- max-height: var(--1);
146
- padding: 0;
147
- color: var(--button-color, var(--button-text-color-secondary));
148
- }
149
-
150
- button[no-background][bold] {
151
- font-weight: var(--type-weight-bold);
152
- font-family: var(--typeface-medium);
153
- color: var(--button-color, var(--button-text-color-secondary));
154
- }
155
-
156
- .loading {
157
- opacity: 0.7;
158
- }
159
- `;
85
+ Button.styles = unsafeCSS(styles);
160
86
  customElements.define("ds-button", Button);
@@ -0,0 +1,39 @@
1
+ import { LitElement } from "lit";
2
+ export declare class Card extends LitElement {
3
+ static properties: {
4
+ variant: {
5
+ type: StringConstructor;
6
+ reflect: boolean;
7
+ };
8
+ elevation: {
9
+ type: NumberConstructor;
10
+ reflect: boolean;
11
+ };
12
+ interactive: {
13
+ type: BooleanConstructor;
14
+ reflect: boolean;
15
+ };
16
+ disabled: {
17
+ type: BooleanConstructor;
18
+ reflect: boolean;
19
+ };
20
+ padding: {
21
+ type: StringConstructor;
22
+ reflect: boolean;
23
+ };
24
+ };
25
+ variant: "default" | "outlined" | "elevated" | "filled";
26
+ elevation: number;
27
+ interactive: boolean;
28
+ disabled: boolean;
29
+ padding: "none" | "small" | "medium" | "large";
30
+ constructor();
31
+ static styles: import("lit").CSSResult;
32
+ render(): import("lit-html").TemplateResult<1>;
33
+ }
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ "ds-card": Card;
37
+ }
38
+ }
39
+ //# sourceMappingURL=ds-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ds-card.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-card.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;MAMf;IAEM,OAAO,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;IACxD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;;IAWvD,MAAM,CAAC,MAAM,0BA0FX;IAEF,MAAM;CAOP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
@@ -0,0 +1,119 @@
1
+ // ds-card.ts
2
+ // Card component for displaying content in a contained box
3
+ import { LitElement, html, css } from "lit";
4
+ export class Card extends LitElement {
5
+ constructor() {
6
+ super();
7
+ this.variant = "default";
8
+ this.elevation = 1;
9
+ this.interactive = false;
10
+ this.disabled = false;
11
+ this.padding = "medium";
12
+ }
13
+ render() {
14
+ return html `
15
+ <div class="card-content" part="content">
16
+ <slot></slot>
17
+ </div>
18
+ `;
19
+ }
20
+ }
21
+ Card.properties = {
22
+ variant: { type: String, reflect: true },
23
+ elevation: { type: Number, reflect: true },
24
+ interactive: { type: Boolean, reflect: true },
25
+ disabled: { type: Boolean, reflect: true },
26
+ padding: { type: String, reflect: true },
27
+ };
28
+ Card.styles = css `
29
+ :host {
30
+ display: block;
31
+ box-sizing: border-box;
32
+ border-radius: calc(var(--025) * var(--sf, 1));
33
+ background-color: var(--card-background, var(--surface-color, #fff));
34
+ color: var(--text-color-primary);
35
+ transition:
36
+ box-shadow 0.2s ease,
37
+ transform 0.2s ease;
38
+ }
39
+
40
+ :host([variant="default"]) {
41
+ background-color: var(--card-background, var(--surface-color, #fff));
42
+ border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
43
+ }
44
+
45
+ :host([variant="outlined"]) {
46
+ background-color: transparent;
47
+ border: 1px solid var(--border-color, rgba(0, 0, 0, 0.2));
48
+ }
49
+
50
+ :host([variant="elevated"]) {
51
+ background-color: var(--card-background, var(--surface-color, #fff));
52
+ border: none;
53
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
54
+ }
55
+
56
+ :host([variant="filled"]) {
57
+ background-color: var(
58
+ --card-background-filled,
59
+ var(--surface-color-secondary, #f5f5f5)
60
+ );
61
+ border: none;
62
+ }
63
+
64
+ :host([elevation="0"]) {
65
+ box-shadow: none;
66
+ }
67
+
68
+ :host([elevation="1"]) {
69
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
70
+ }
71
+
72
+ :host([elevation="2"]) {
73
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
74
+ }
75
+
76
+ :host([elevation="3"]) {
77
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
78
+ }
79
+
80
+ :host([interactive]) {
81
+ cursor: pointer;
82
+ }
83
+
84
+ :host([interactive]:hover:not([disabled])) {
85
+ transform: translateY(-2px);
86
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
87
+ }
88
+
89
+ :host([interactive]:active:not([disabled])) {
90
+ transform: translateY(0);
91
+ }
92
+
93
+ :host([disabled]) {
94
+ opacity: 0.5;
95
+ pointer-events: none;
96
+ }
97
+
98
+ :host([padding="none"]) {
99
+ padding: 0;
100
+ }
101
+
102
+ :host([padding="small"]) {
103
+ padding: calc(var(--025) * var(--sf, 1));
104
+ }
105
+
106
+ :host([padding="medium"]) {
107
+ padding: calc(var(--05) * var(--sf, 1));
108
+ }
109
+
110
+ :host([padding="large"]) {
111
+ padding: calc(var(--1) * var(--sf, 1));
112
+ }
113
+
114
+ .card-content {
115
+ width: 100%;
116
+ height: 100%;
117
+ }
118
+ `;
119
+ customElements.define("ds-card", Card);
@@ -10,9 +10,6 @@ export declare class Cycle extends LitElement {
10
10
  values: {
11
11
  type: ArrayConstructor;
12
12
  };
13
- label: {
14
- type: StringConstructor;
15
- };
16
13
  currentValue: {
17
14
  type: StringConstructor;
18
15
  state: boolean;
@@ -32,7 +29,6 @@ export declare class Cycle extends LitElement {
32
29
  static styles: import("lit").CSSResult;
33
30
  type: string;
34
31
  values: string[];
35
- label: string;
36
32
  currentValue: string;
37
33
  translationsReady: boolean;
38
34
  disabled: boolean;
@@ -48,9 +44,9 @@ export declare class Cycle extends LitElement {
48
44
  disconnectedCallback(): void;
49
45
  handleButtonClick(e: Event): void;
50
46
  getValueDisplay(value: string): string | any;
47
+ getColorKey(colorVar: string): string;
51
48
  getColorName(colorVar: string): string;
52
49
  getNotesStyleIcon(style: string): import("lit-html").TemplateResult<1>;
53
- getLabel(): string;
54
50
  render(): import("lit-html").TemplateResult<1>;
55
51
  private waitForTranslations;
56
52
  private handleTranslationsLoaded;
@@ -1 +1 @@
1
- {"version":3,"file":"ds-cycle.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAY5C,OAAO,aAAa,CAAC;AACrB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AAqCnB,qBAAa,KAAM,SAAQ,UAAU;IAEnC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;MAUpB;IAED,MAAM,CAAC,MAAM,0BAWX;IAIM,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAGxB,OAAO,CAAC,aAAa,CAOnB;;IAyBF,iBAAiB;IA6BX,gBAAgB;IAgFtB,sBAAsB;IAatB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IASnE,iBAAiB;IAuDvB,qBAAqB;IAKrB,oBAAoB;IA0BpB,iBAAiB,CAAC,CAAC,EAAE,KAAK;IAuJ1B,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG;IA+C5C,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAyBtC,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAe/B,QAAQ,IAAI,MAAM;IAgElB,MAAM;YAmDQ,mBAAmB;IAwBjC,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,yBAAyB;CAGlC;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,KAAK,CAAC;KACnB;CACF"}
1
+ {"version":3,"file":"ds-cycle.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAYlD,OAAO,aAAa,CAAC;AACrB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AAsCnB,qBAAa,KAAM,SAAQ,UAAU;IAEnC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;;;;;MASpB;IAED,MAAM,CAAC,MAAM,0BAAqB;IAI1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAGxB,OAAO,CAAC,aAAa,CAOnB;;IAwBF,iBAAiB;IA6BX,gBAAgB;IA8DtB,sBAAsB;IAatB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IASnE,iBAAiB;IAqCvB,qBAAqB;IAKrB,oBAAoB;IA0BpB,iBAAiB,CAAC,CAAC,EAAE,KAAK;IAiJ1B,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG;IA+C5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAgBrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAyBtC,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAe/B,MAAM;YAoDQ,mBAAmB;IAwBjC,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,yBAAyB;CAGlC;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,KAAK,CAAC;KACnB;CACF"}