ds-one 0.2.0-alpha.2 → 0.2.5-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 (247) hide show
  1. package/DS1/{utils/language.ts → 0-face/i18n.ts} +197 -2
  2. package/DS1/0-face/preferences.ts +23 -0
  3. package/DS1/0-face/pricing.ts +57 -0
  4. package/DS1/1-root/one.css +1 -1
  5. package/DS1/2-core/ds-button.ts +1 -1
  6. package/DS1/2-core/ds-cycle.ts +17 -18
  7. package/DS1/2-core/{ds-year.ts → ds-date.ts} +4 -4
  8. package/DS1/2-core/ds-input.ts +1 -0
  9. package/DS1/2-core/ds-text.ts +1 -1
  10. package/DS1/2-core/ds-tooltip.ts +4 -3
  11. package/DS1/3-unit/doublenav-v1.ts +105 -0
  12. package/DS1/3-unit/{ds-doublenav.ts → ds-portfolio-doublenav.ts} +4 -5
  13. package/DS1/3-unit/ds-portfolio-panel.ts +27 -0
  14. package/DS1/3-unit/ds-portfolio-singlenav.ts +79 -0
  15. package/DS1/3-unit/list-v1.ts +24 -0
  16. package/DS1/3-unit/{ds-panel.ts → panel-v1.ts} +2 -3
  17. package/DS1/3-unit/row-v1.ts +52 -0
  18. package/DS1/3-unit/{ds-singlenav.ts → singlenav-v1.ts} +4 -5
  19. package/DS1/4-page/ds-grid.ts +1 -1
  20. package/DS1/index.ts +39 -37
  21. package/README.md +3 -3
  22. package/dist/0-face/{2025-04-23-device.d.ts → device.d.ts} +1 -1
  23. package/dist/0-face/device.d.ts.map +1 -0
  24. package/dist/{utils/language.d.ts → 0-face/i18n.d.ts} +1 -1
  25. package/dist/0-face/i18n.d.ts.map +1 -0
  26. package/dist/{utils/language.js → 0-face/i18n.js} +141 -2
  27. package/dist/0-face/preferences.d.ts +9 -0
  28. package/dist/0-face/preferences.d.ts.map +1 -0
  29. package/dist/0-face/preferences.js +14 -0
  30. package/dist/0-face/pricing.d.ts +15 -0
  31. package/dist/0-face/pricing.d.ts.map +1 -0
  32. package/dist/0-face/pricing.js +46 -0
  33. package/dist/0-face/theme.d.ts.map +1 -0
  34. package/dist/2-core/ds-button.js +1 -1
  35. package/dist/2-core/ds-cycle.js +15 -15
  36. package/dist/2-core/{ds-year.d.ts → ds-date.d.ts} +4 -4
  37. package/dist/2-core/ds-date.d.ts.map +1 -0
  38. package/dist/2-core/{ds-year.js → ds-date.js} +4 -4
  39. package/dist/2-core/ds-input.d.ts +1 -0
  40. package/dist/2-core/ds-input.d.ts.map +1 -0
  41. package/dist/2-core/ds-input.js +1 -0
  42. package/dist/2-core/ds-text.js +1 -1
  43. package/dist/2-core/ds-tooltip.d.ts.map +1 -1
  44. package/dist/2-core/ds-tooltip.js +4 -2
  45. package/dist/3-unit/{ds-doublenav.d.ts → ds-portfolio-doublenav.d.ts} +4 -4
  46. package/dist/3-unit/ds-portfolio-doublenav.d.ts.map +1 -0
  47. package/dist/3-unit/{ds-doublenav.js → ds-portfolio-doublenav.js} +4 -4
  48. package/dist/3-unit/{ds-panel.d.ts → ds-portfolio-panel.d.ts} +3 -3
  49. package/dist/3-unit/ds-portfolio-panel.d.ts.map +1 -0
  50. package/dist/3-unit/{ds-panel.js → ds-portfolio-panel.js} +3 -3
  51. package/dist/3-unit/{ds-singlenav.d.ts → ds-portfolio-singlenav.d.ts} +4 -4
  52. package/dist/3-unit/ds-portfolio-singlenav.d.ts.map +1 -0
  53. package/dist/3-unit/{ds-singlenav.js → ds-portfolio-singlenav.js} +4 -4
  54. package/dist/4-page/ds-grid.js +1 -1
  55. package/dist/ds-one.bundle.js +2087 -3806
  56. package/dist/ds-one.bundle.js.map +4 -4
  57. package/dist/ds-one.bundle.min.js +74 -740
  58. package/dist/ds-one.bundle.min.js.map +4 -4
  59. package/dist/index.d.ts +16 -26
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +32 -34
  62. package/package.json +2 -2
  63. package/DS1/0-face/2025-04-23-language.ts +0 -4
  64. package/DS1/2-core/ds-article.ts +0 -454
  65. package/DS1/2-core/ds-attributes.ts +0 -155
  66. package/DS1/2-core/ds-downloadcv.ts +0 -146
  67. package/DS1/2-core/ds-header.ts +0 -82
  68. package/DS1/2-core/ds-home.ts +0 -168
  69. package/DS1/2-core/ds-link.ts +0 -121
  70. package/DS1/2-core/ds-markdown.ts +0 -252
  71. package/DS1/2-core/ds-price.ts +0 -108
  72. package/DS1/2-core/ds-squarecircle.ts +0 -155
  73. package/DS1/2-core/ds-title.ts +0 -139
  74. package/DS1/2-core/ds-viewtoggle.ts +0 -83
  75. package/DS1/utils/cdn-loader.ts +0 -232
  76. package/DS1/utils/keys.json +0 -41
  77. package/DS1/utils/pricing.ts +0 -24
  78. package/DS1/utils/scroll.ts +0 -184
  79. package/DS1/utils/settings.ts +0 -23
  80. package/DS1/utils/viewMode.ts +0 -55
  81. package/dist/0-face/2025-04-23-device.d.ts.map +0 -1
  82. package/dist/0-face/2025-04-23-language.d.ts +0 -1
  83. package/dist/0-face/2025-04-23-language.d.ts.map +0 -1
  84. package/dist/0-face/2025-04-23-language.js +0 -3
  85. package/dist/2-core/article-v1.d.ts +0 -129
  86. package/dist/2-core/article-v1.d.ts.map +0 -1
  87. package/dist/2-core/article-v1.js +0 -361
  88. package/dist/2-core/attributes-v1.d.ts +0 -47
  89. package/dist/2-core/attributes-v1.d.ts.map +0 -1
  90. package/dist/2-core/attributes-v1.js +0 -128
  91. package/dist/2-core/cycle-v1.d.ts +0 -66
  92. package/dist/2-core/cycle-v1.d.ts.map +0 -1
  93. package/dist/2-core/cycle-v1.js +0 -586
  94. package/dist/2-core/downloadcv-v1.d.ts +0 -58
  95. package/dist/2-core/downloadcv-v1.d.ts.map +0 -1
  96. package/dist/2-core/downloadcv-v1.js +0 -119
  97. package/dist/2-core/ds-article.d.ts +0 -129
  98. package/dist/2-core/ds-article.d.ts.map +0 -1
  99. package/dist/2-core/ds-article.js +0 -361
  100. package/dist/2-core/ds-attributes.d.ts +0 -47
  101. package/dist/2-core/ds-attributes.d.ts.map +0 -1
  102. package/dist/2-core/ds-attributes.js +0 -128
  103. package/dist/2-core/ds-button.figma.d.ts +0 -2
  104. package/dist/2-core/ds-button.figma.d.ts.map +0 -1
  105. package/dist/2-core/ds-button.figma.js +0 -6
  106. package/dist/2-core/ds-downloadcv.d.ts +0 -58
  107. package/dist/2-core/ds-downloadcv.d.ts.map +0 -1
  108. package/dist/2-core/ds-downloadcv.js +0 -119
  109. package/dist/2-core/ds-header.d.ts +0 -28
  110. package/dist/2-core/ds-header.d.ts.map +0 -1
  111. package/dist/2-core/ds-header.js +0 -66
  112. package/dist/2-core/ds-home.d.ts +0 -26
  113. package/dist/2-core/ds-home.d.ts.map +0 -1
  114. package/dist/2-core/ds-home.js +0 -148
  115. package/dist/2-core/ds-link.d.ts +0 -35
  116. package/dist/2-core/ds-link.d.ts.map +0 -1
  117. package/dist/2-core/ds-link.js +0 -85
  118. package/dist/2-core/ds-markdown.d.ts +0 -7
  119. package/dist/2-core/ds-markdown.d.ts.map +0 -1
  120. package/dist/2-core/ds-markdown.js +0 -240
  121. package/dist/2-core/ds-price.d.ts +0 -46
  122. package/dist/2-core/ds-price.d.ts.map +0 -1
  123. package/dist/2-core/ds-price.js +0 -72
  124. package/dist/2-core/ds-squarecircle.d.ts +0 -50
  125. package/dist/2-core/ds-squarecircle.d.ts.map +0 -1
  126. package/dist/2-core/ds-squarecircle.js +0 -133
  127. package/dist/2-core/ds-title.d.ts +0 -50
  128. package/dist/2-core/ds-title.d.ts.map +0 -1
  129. package/dist/2-core/ds-title.js +0 -103
  130. package/dist/2-core/ds-viewtoggle.d.ts +0 -27
  131. package/dist/2-core/ds-viewtoggle.d.ts.map +0 -1
  132. package/dist/2-core/ds-viewtoggle.js +0 -49
  133. package/dist/2-core/ds-year.d.ts.map +0 -1
  134. package/dist/2-core/header-v1.d.ts +0 -28
  135. package/dist/2-core/header-v1.d.ts.map +0 -1
  136. package/dist/2-core/header-v1.js +0 -66
  137. package/dist/2-core/home-v1.d.ts +0 -26
  138. package/dist/2-core/home-v1.d.ts.map +0 -1
  139. package/dist/2-core/home-v1.js +0 -148
  140. package/dist/2-core/icon-v1.d.ts +0 -28
  141. package/dist/2-core/icon-v1.d.ts.map +0 -1
  142. package/dist/2-core/icon-v1.js +0 -297
  143. package/dist/2-core/link-v1.d.ts +0 -35
  144. package/dist/2-core/link-v1.d.ts.map +0 -1
  145. package/dist/2-core/link-v1.js +0 -85
  146. package/dist/2-core/markdown-v1.d.ts +0 -7
  147. package/dist/2-core/markdown-v1.d.ts.map +0 -1
  148. package/dist/2-core/markdown-v1.js +0 -240
  149. package/dist/2-core/price-v1.d.ts +0 -46
  150. package/dist/2-core/price-v1.d.ts.map +0 -1
  151. package/dist/2-core/price-v1.js +0 -72
  152. package/dist/2-core/squarecircle-v1.d.ts +0 -50
  153. package/dist/2-core/squarecircle-v1.d.ts.map +0 -1
  154. package/dist/2-core/squarecircle-v1.js +0 -133
  155. package/dist/2-core/text-v1.d.ts +0 -48
  156. package/dist/2-core/text-v1.d.ts.map +0 -1
  157. package/dist/2-core/text-v1.js +0 -83
  158. package/dist/2-core/title-v1.d.ts +0 -50
  159. package/dist/2-core/title-v1.d.ts.map +0 -1
  160. package/dist/2-core/title-v1.js +0 -103
  161. package/dist/2-core/tooltip-v1.d.ts +0 -39
  162. package/dist/2-core/tooltip-v1.d.ts.map +0 -1
  163. package/dist/2-core/tooltip-v1.js +0 -145
  164. package/dist/2-core/viewtoggle-v1.d.ts +0 -27
  165. package/dist/2-core/viewtoggle-v1.d.ts.map +0 -1
  166. package/dist/2-core/viewtoggle-v1.js +0 -49
  167. package/dist/2-core/year-v1.d.ts +0 -16
  168. package/dist/2-core/year-v1.d.ts.map +0 -1
  169. package/dist/2-core/year-v1.js +0 -21
  170. package/dist/3-unit/ds-doublenav.d.ts.map +0 -1
  171. package/dist/3-unit/ds-panel.d.ts.map +0 -1
  172. package/dist/3-unit/ds-singlenav.d.ts.map +0 -1
  173. package/dist/utils/cdn-loader.d.ts +0 -19
  174. package/dist/utils/cdn-loader.d.ts.map +0 -1
  175. package/dist/utils/cdn-loader.js +0 -160
  176. package/dist/utils/keys.json +0 -41
  177. package/dist/utils/language.d.ts.map +0 -1
  178. package/dist/utils/pricing.d.ts +0 -8
  179. package/dist/utils/pricing.d.ts.map +0 -1
  180. package/dist/utils/pricing.js +0 -14
  181. package/dist/utils/scroll.d.ts +0 -34
  182. package/dist/utils/scroll.d.ts.map +0 -1
  183. package/dist/utils/scroll.js +0 -140
  184. package/dist/utils/settings.d.ts +0 -9
  185. package/dist/utils/settings.d.ts.map +0 -1
  186. package/dist/utils/settings.js +0 -14
  187. package/dist/utils/theme.d.ts.map +0 -1
  188. package/dist/utils/viewMode.d.ts +0 -14
  189. package/dist/utils/viewMode.d.ts.map +0 -1
  190. package/dist/utils/viewMode.js +0 -46
  191. /package/DS1/0-face/{2025-04-23-device.ts → device.ts} +0 -0
  192. /package/DS1/{utils → 0-face}/theme.ts +0 -0
  193. /package/DS1/{x Icon → x-icon}/1x.svg +0 -0
  194. /package/DS1/{x Icon → x-icon}/1xdots.svg +0 -0
  195. /package/DS1/{x Icon → x-icon}/1xgrid.svg +0 -0
  196. /package/DS1/{x Icon → x-icon}/1xlines.svg +0 -0
  197. /package/DS1/{x Icon → x-icon}/2x.svg +0 -0
  198. /package/DS1/{x Icon → x-icon}/2xdots.svg +0 -0
  199. /package/DS1/{x Icon → x-icon}/2xgrid.svg +0 -0
  200. /package/DS1/{x Icon → x-icon}/2xlines.svg +0 -0
  201. /package/DS1/{x Icon → x-icon}/big.svg +0 -0
  202. /package/DS1/{x Icon → x-icon}/blank.svg +0 -0
  203. /package/DS1/{x Icon → x-icon}/check.svg +0 -0
  204. /package/DS1/{x Icon → x-icon}/close.svg +0 -0
  205. /package/DS1/{x Icon → x-icon}/collapse.svg +0 -0
  206. /package/DS1/{x Icon → x-icon}/color.svg +0 -0
  207. /package/DS1/{x Icon → x-icon}/column.svg +0 -0
  208. /package/DS1/{x Icon → x-icon}/default.svg +0 -0
  209. /package/DS1/{x Icon → x-icon}/delete.svg +0 -0
  210. /package/DS1/{x Icon → x-icon}/do.svg +0 -0
  211. /package/DS1/{x Icon → x-icon}/down.svg +0 -0
  212. /package/DS1/{x Icon → x-icon}/duplicate.svg +0 -0
  213. /package/DS1/{x Icon → x-icon}/email.svg +0 -0
  214. /package/DS1/{x Icon → x-icon}/expand.svg +0 -0
  215. /package/DS1/{x Icon → x-icon}/gallery.svg +0 -0
  216. /package/DS1/{x Icon → x-icon}/group.svg +0 -0
  217. /package/DS1/{x Icon → x-icon}/head.svg +0 -0
  218. /package/DS1/{x Icon → x-icon}/icon.svg +0 -0
  219. /package/DS1/{x Icon → x-icon}/left.svg +0 -0
  220. /package/DS1/{x Icon → x-icon}/lock.svg +0 -0
  221. /package/DS1/{x Icon → x-icon}/mic.svg +0 -0
  222. /package/DS1/{x Icon → x-icon}/minimize.svg +0 -0
  223. /package/DS1/{x Icon → x-icon}/more.svg +0 -0
  224. /package/DS1/{x Icon → x-icon}/note.svg +0 -0
  225. /package/DS1/{x Icon → x-icon}/open.svg +0 -0
  226. /package/DS1/{x Icon → x-icon}/page.svg +0 -0
  227. /package/DS1/{x Icon → x-icon}/plus.svg +0 -0
  228. /package/DS1/{x Icon → x-icon}/rewind.svg +0 -0
  229. /package/DS1/{x Icon → x-icon}/right.svg +0 -0
  230. /package/DS1/{x Icon → x-icon}/row..svg +0 -0
  231. /package/DS1/{x Icon → x-icon}/search.svg +0 -0
  232. /package/DS1/{x Icon → x-icon}/see.svg +0 -0
  233. /package/DS1/{x Icon → x-icon}/star.svg +0 -0
  234. /package/DS1/{x Icon → x-icon}/title.svg +0 -0
  235. /package/DS1/{x Icon → x-icon}/undo.svg +0 -0
  236. /package/DS1/{x Icon → x-icon}/ungroup.svg +0 -0
  237. /package/DS1/{x Icon → x-icon}/unhead.svg +0 -0
  238. /package/DS1/{x Icon → x-icon}/unicon.svg +0 -0
  239. /package/DS1/{x Icon → x-icon}/unlock.svg +0 -0
  240. /package/DS1/{x Icon → x-icon}/unmic.svg +0 -0
  241. /package/DS1/{x Icon → x-icon}/unsee.svg +0 -0
  242. /package/DS1/{x Icon → x-icon}/unstar.svg +0 -0
  243. /package/DS1/{x Icon → x-icon}/untitle.svg +0 -0
  244. /package/DS1/{x Icon → x-icon}/up.svg +0 -0
  245. /package/dist/0-face/{2025-04-23-device.js → device.js} +0 -0
  246. /package/dist/{utils → 0-face}/theme.d.ts +0 -0
  247. /package/dist/{utils → 0-face}/theme.js +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"ds-title.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-title.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;GAMG;AACH,qBAAa,KAAM,SAAQ,UAAU;IACnC,OAAO,CAAC,SAAS,CAAM;IAEvB,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;MAOpB;IAEO,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,aAAa,CAAqC;IAE1D,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAKzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,0BAwBX;;IAeF,iBAAiB;IASjB,oBAAoB;IAQpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAM/C,SAAS;IAkBT,YAAY;IAMZ,MAAM;CAKP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,KAAK,CAAC;KACnB;CACF"}
@@ -1,103 +0,0 @@
1
- import { LitElement, html, css } from "lit";
2
- import { getText } from "../utils/language";
3
- /**
4
- * A component for displaying page titles with localization support
5
- *
6
- * @element ds-title
7
- * @prop {string} key - The translation key to use
8
- * @prop {string} defaultValue - Default value if translation is not found
9
- */
10
- export class Title extends LitElement {
11
- static get properties() {
12
- return {
13
- gridarea: { type: String, reflect: true },
14
- key: { type: String, reflect: true },
15
- defaultValue: { type: String, reflect: true, attribute: "default-value" },
16
- _text: { type: String, state: true },
17
- };
18
- }
19
- set gridarea(value) {
20
- const oldValue = this._gridArea;
21
- this._gridArea = value;
22
- this.style.gridArea = value;
23
- this.requestUpdate("gridarea", oldValue);
24
- }
25
- get gridarea() {
26
- return this._gridArea;
27
- }
28
- constructor() {
29
- super();
30
- this._gridArea = "";
31
- this.key = "";
32
- this.defaultValue = "";
33
- this._text = "";
34
- this.boundHandlers = {
35
- languageChanged: (() => {
36
- this._loadText();
37
- }),
38
- };
39
- }
40
- connectedCallback() {
41
- super.connectedCallback();
42
- this._loadText();
43
- window.addEventListener("language-changed", this.boundHandlers.languageChanged);
44
- }
45
- disconnectedCallback() {
46
- super.disconnectedCallback();
47
- window.removeEventListener("language-changed", this.boundHandlers.languageChanged);
48
- }
49
- updated(changedProperties) {
50
- if (changedProperties.has("key") || changedProperties.has("defaultValue")) {
51
- this._loadText();
52
- }
53
- }
54
- _loadText() {
55
- if (!this.key) {
56
- this._text = this.defaultValue || "";
57
- return;
58
- }
59
- try {
60
- const text = getText(this.key);
61
- this._text = text || this.defaultValue || this.key;
62
- }
63
- catch (error) {
64
- console.error(`[ds-title] Error loading text for key "${this.key}":`, error);
65
- this._text = this.defaultValue || this.key;
66
- }
67
- }
68
- firstUpdated() {
69
- if (this.hasAttribute("gridarea")) {
70
- this.style.gridArea = this.getAttribute("gridarea") || "";
71
- }
72
- }
73
- render() {
74
- const hasKey = this.key && this._text;
75
- return html ` <h1>${hasKey ? this._text : html `<slot></slot>`}</h1> `;
76
- }
77
- }
78
- Title.styles = css `
79
- :host {
80
- display: flex;
81
- padding: calc(2px * var(--scaling-factor));
82
- align-items: flex-start;
83
- }
84
-
85
- h1 {
86
- display: block;
87
- place-content: center;
88
- font-family: var(--typeface);
89
- color: light-dark(var(--black), var(--white));
90
- font-size: calc(36px * var(--scaling-factor));
91
- font-weight: 500;
92
- align-items: center;
93
- letter-spacing: -0.72px;
94
- margin: 0;
95
- height: 45px;
96
- }
97
-
98
- ::slotted(*) {
99
- margin: 0;
100
- width: 100%;
101
- }
102
- `;
103
- customElements.define("ds-title", Title);
@@ -1,27 +0,0 @@
1
- import { LitElement } from "lit";
2
- /**
3
- * A component for toggling between text and image view modes
4
- *
5
- * @element ds-viewtoggle
6
- */
7
- export declare class ViewToggle extends LitElement {
8
- static properties: {
9
- _mode: {
10
- type: StringConstructor;
11
- state: boolean;
12
- };
13
- };
14
- _mode: "text" | "image";
15
- private boundHandlers;
16
- constructor();
17
- connectedCallback(): void;
18
- disconnectedCallback(): void;
19
- private _toggle;
20
- render(): import("lit-html").TemplateResult<1>;
21
- }
22
- declare global {
23
- interface HTMLElementTagNameMap {
24
- "ds-viewtoggle": ViewToggle;
25
- }
26
- }
27
- //# sourceMappingURL=ds-viewtoggle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ds-viewtoggle.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-viewtoggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAIvC;;;;GAIG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,UAAU;;;;;MAEf;IAEM,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAEhC,OAAO,CAAC,aAAa,CAGnB;;IAkBF,iBAAiB;IAYjB,oBAAoB;IAYpB,OAAO,CAAC,OAAO,CAGb;IAEF,MAAM;CAOP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,UAAU,CAAC;KAC7B;CACF"}
@@ -1,49 +0,0 @@
1
- import { LitElement, html } from "lit";
2
- import { getText } from "../utils/language";
3
- import { getViewMode, setViewMode } from "../utils/viewMode";
4
- /**
5
- * A component for toggling between text and image view modes
6
- *
7
- * @element ds-viewtoggle
8
- */
9
- export class ViewToggle extends LitElement {
10
- constructor() {
11
- super();
12
- this._toggle = () => {
13
- const next = this._mode === "image" ? "text" : "image";
14
- setViewMode(next);
15
- };
16
- this._mode = getViewMode();
17
- this.boundHandlers = {
18
- viewModeChanged: ((e) => {
19
- const mode = e.detail === "image" ? "image" : "text";
20
- if (this._mode !== mode) {
21
- this._mode = mode;
22
- }
23
- }),
24
- languageChanged: (() => {
25
- this.requestUpdate();
26
- }),
27
- };
28
- }
29
- connectedCallback() {
30
- super.connectedCallback();
31
- window.addEventListener("view-mode-changed", this.boundHandlers.viewModeChanged);
32
- window.addEventListener("language-changed", this.boundHandlers.languageChanged);
33
- }
34
- disconnectedCallback() {
35
- super.disconnectedCallback();
36
- window.removeEventListener("view-mode-changed", this.boundHandlers.viewModeChanged);
37
- window.removeEventListener("language-changed", this.boundHandlers.languageChanged);
38
- }
39
- render() {
40
- const label = this._mode === "image" ? getText("hideImage") : getText("viewImage");
41
- return html `
42
- <ds-button variant="primary" @click=${this._toggle}>${label}</ds-button>
43
- `;
44
- }
45
- }
46
- ViewToggle.properties = {
47
- _mode: { type: String, state: true },
48
- };
49
- customElements.define("ds-viewtoggle", ViewToggle);
@@ -1 +0,0 @@
1
- {"version":3,"file":"ds-year.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-year.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C;;;;GAIG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,MAAM,0BAOX;IAEF,MAAM;CAIP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
@@ -1,28 +0,0 @@
1
- import { LitElement } from "lit";
2
- /**
3
- * A component for displaying page headers
4
- *
5
- * @element header-v1
6
- * @prop {string} gridarea - Grid area placement
7
- */
8
- export declare class Header extends LitElement {
9
- private _gridArea;
10
- static get properties(): {
11
- gridarea: {
12
- type: StringConstructor;
13
- reflect: boolean;
14
- };
15
- };
16
- set gridarea(value: string);
17
- get gridarea(): string;
18
- static styles: import("lit").CSSResult;
19
- constructor();
20
- firstUpdated(): void;
21
- render(): import("lit-html").TemplateResult<1>;
22
- }
23
- declare global {
24
- interface HTMLElementTagNameMap {
25
- "header-v1": Header;
26
- }
27
- }
28
- //# sourceMappingURL=header-v1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"header-v1.d.ts","sourceRoot":"","sources":["../../DS1/2-core/header-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC,OAAO,CAAC,SAAS,CAAM;IAEvB,MAAM,KAAK,UAAU;;;;;MAIpB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAKzB;IAED,IAAI,QAAQ,IAAI,MAAM,CAErB;IAED,MAAM,CAAC,MAAM,0BAuBX;;IAMF,YAAY;IAMZ,MAAM;CASP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
@@ -1,66 +0,0 @@
1
- import { LitElement, html, css } from "lit";
2
- /**
3
- * A component for displaying page headers
4
- *
5
- * @element header-v1
6
- * @prop {string} gridarea - Grid area placement
7
- */
8
- export class Header extends LitElement {
9
- static get properties() {
10
- return {
11
- gridarea: { type: String, reflect: true },
12
- };
13
- }
14
- set gridarea(value) {
15
- const oldValue = this._gridArea;
16
- this._gridArea = value;
17
- this.style.gridArea = value;
18
- this.requestUpdate("gridarea", oldValue);
19
- }
20
- get gridarea() {
21
- return this._gridArea;
22
- }
23
- constructor() {
24
- super();
25
- this._gridArea = "";
26
- }
27
- firstUpdated() {
28
- if (this.hasAttribute("gridarea")) {
29
- this.style.gridArea = this.getAttribute("gridarea") || "";
30
- }
31
- }
32
- render() {
33
- return html `
34
- <h2
35
- style="display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; width: 100%;"
36
- >
37
- <slot></slot>
38
- </h2>
39
- `;
40
- }
41
- }
42
- Header.styles = css `
43
- :host {
44
- display: flex;
45
- padding: calc(2px * var(--scaling-factor));
46
- align-items: flex-start;
47
- width: 100%;
48
- }
49
-
50
- h2 {
51
- display: flex;
52
- place-content: center;
53
- font-family: var(--typeface);
54
- color: light-dark(var(--black), var(--white));
55
- align-items: center;
56
- font-weight: 500;
57
- font-size: calc(14px * var(--scaling-factor));
58
- margin: 0;
59
- width: 100%;
60
- }
61
-
62
- ::slotted(*) {
63
- margin: 0;
64
- }
65
- `;
66
- customElements.define("header-v1", Header);
@@ -1,26 +0,0 @@
1
- import { LitElement } from "lit";
2
- export declare class Home extends LitElement {
3
- static properties: any;
4
- state: "active" | "disabled";
5
- /**
6
- * Ensure Home is always disabled on mobile devices.
7
- * Runs once when the element is connected to the DOM.
8
- */
9
- connectedCallback(): void;
10
- /**
11
- * Lightweight mobile detection. Mirrors the app's utility without importing it
12
- * to keep the design system component self-contained.
13
- */
14
- private _isMobileDevice;
15
- protected updated(): void;
16
- static styles: import("lit").CSSResult;
17
- private _navigateHome;
18
- private _onKeyDown;
19
- render(): import("lit-html").TemplateResult<1>;
20
- }
21
- declare global {
22
- interface HTMLElementTagNameMap {
23
- "home-v1": Home;
24
- }
25
- }
26
- //# sourceMappingURL=home-v1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"home-v1.d.ts","sourceRoot":"","sources":["../../DS1/2-core/home-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU,EAEZ,GAAG,CAAC;IAET,KAAK,EAAE,QAAQ,GAAG,UAAU,CAAY;IAExC;;;OAGG;IACH,iBAAiB;IAOjB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAoBvB,SAAS,CAAC,OAAO,IAAI,IAAI;IAOzB,MAAM,CAAC,MAAM,0BAyEX;IAIF,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,UAAU;IAQlB,MAAM;CAgBP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
@@ -1,148 +0,0 @@
1
- import { LitElement, html, css } from "lit";
2
- // Home tab button that reveals on hover (active) or stays visible and non-interactive (disabled)
3
- export class Home extends LitElement {
4
- constructor() {
5
- super(...arguments);
6
- this.state = "active";
7
- }
8
- /**
9
- * Ensure Home is always disabled on mobile devices.
10
- * Runs once when the element is connected to the DOM.
11
- */
12
- connectedCallback() {
13
- super.connectedCallback();
14
- if (this._isMobileDevice()) {
15
- this.state = "disabled";
16
- }
17
- }
18
- /**
19
- * Lightweight mobile detection. Mirrors the app's utility without importing it
20
- * to keep the design system component self-contained.
21
- */
22
- _isMobileDevice() {
23
- const nav = globalThis.navigator;
24
- const win = globalThis.window;
25
- const ua = (nav && (nav.userAgent || nav.vendor)) || (win && win.opera) || "";
26
- const uaMatchesMobile = /Mobile|Android|iP(ad|hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)|Windows Phone|Phone|Tablet/i.test(ua);
27
- const touchPoints = (nav && nav.maxTouchPoints) || 0;
28
- const isTouchCapable = touchPoints > 1;
29
- const narrowViewport = win
30
- ? Math.min(win.innerWidth || 0, win.innerHeight || 0) <= 820
31
- : false;
32
- return uaMatchesMobile || (isTouchCapable && narrowViewport);
33
- }
34
- updated() {
35
- // Enforce disabled on mobile even if someone flips the state later
36
- if (this._isMobileDevice() && this.state !== "disabled") {
37
- this.state = "disabled";
38
- }
39
- }
40
- // No setup needed; `state` defaults to "active" and reflects if provided
41
- _navigateHome() {
42
- if (this.state === "disabled")
43
- return;
44
- window.location.href = "./home.html";
45
- }
46
- _onKeyDown(e) {
47
- if (this.state === "disabled")
48
- return;
49
- if (e?.key === "Enter" || e?.key === " ") {
50
- e.preventDefault();
51
- this._navigateHome();
52
- }
53
- }
54
- render() {
55
- const isDisabled = this.state === "disabled";
56
- return html `
57
- <div class="hover-fill"></div>
58
- <div
59
- class="home ${isDisabled ? "is-disabled" : "is-active"}"
60
- role="button"
61
- aria-disabled="${String(isDisabled)}"
62
- tabindex="${isDisabled ? -1 : 0}"
63
- @click="${this._navigateHome}"
64
- @keydown="${this._onKeyDown}"
65
- >
66
- <ds-text key="home"></ds-text>
67
- </div>
68
- `;
69
- }
70
- }
71
- Home.properties = {
72
- state: { type: String, reflect: true }, // "active" | "disabled"
73
- };
74
- Home.styles = css `
75
- :host {
76
- /* local sizing vars, derived from one.css */
77
- --home-visible: calc(var(--1) * 0.1); /* 2px */
78
-
79
- position: relative;
80
- display: flex; /* expand hover zone horizontally */
81
- width: 100%; /* take the whole row width of the app container */
82
- height: calc(
83
- var(--1) * var(--scaling-factor)
84
- ); /* provide hover zone under the tab */
85
- font-family: var(--typeface);
86
- overflow: hidden; /* hide the part above the host */
87
- }
88
-
89
- /* Disabled: preserve full hover area space but keep inactive */
90
- :host([state="disabled"]) {
91
- height: var(--1); /* keep same layout height as active */
92
- overflow: hidden;
93
- }
94
-
95
- .home {
96
- position: absolute;
97
- left: 0;
98
- width: calc(var(--4) * var(--scaling-factor));
99
- height: calc(var(--1) * var(--scaling-factor));
100
- margin: 0 calc(var(--1) * var(--scaling-factor));
101
- display: flex;
102
- align-items: center;
103
- background: var(--accent-color);
104
- color: light-dark(var(--black), var(--black));
105
- user-select: none;
106
- transition: top 120ms ease;
107
- }
108
-
109
- /* Inner text spacing without affecting the 80px outer width */
110
- .home > ds-text {
111
- padding: 0 calc(var(--1) * 0.15 * var(--scaling-factor));
112
- box-sizing: border-box;
113
- height: 100%;
114
- display: inline-flex;
115
- align-items: center;
116
- }
117
-
118
- /* invisible flex filler to extend hover area to the right */
119
- .hover-fill {
120
- flex: 1 1 auto;
121
- }
122
-
123
- /* Active: hidden until hover */
124
- .home.is-active {
125
- cursor: pointer;
126
- /* Hide above, leave a 2px strip visible */
127
- top: calc(var(--home-visible) - var(--1));
128
- }
129
-
130
- /* Reveal the tab when hovering anywhere in the host area
131
- (the host is 80x20, while the tab starts hidden above) */
132
- :host(:hover) .home.is-active {
133
- top: 0;
134
- }
135
-
136
- /* Disabled: stays hidden and not interactive */
137
- .home.is-disabled {
138
- top: calc(var(--home-visible) - var(--1));
139
- cursor: default;
140
- pointer-events: none;
141
- color: var(--accent-color);
142
- }
143
-
144
- .label {
145
- font-size: var(--type-size-default);
146
- }
147
- `;
148
- customElements.define("home-v1", Home);
@@ -1,28 +0,0 @@
1
- import { LitElement, type PropertyValues } from "lit";
2
- export declare class Icon extends LitElement {
3
- static properties: {
4
- type: {
5
- type: StringConstructor;
6
- reflect: boolean;
7
- };
8
- };
9
- private _type;
10
- size: string;
11
- color: string;
12
- background: string;
13
- get type(): string;
14
- set type(val: string);
15
- static styles: import("lit").CSSResult;
16
- private static readonly iconNameToSvgMap;
17
- constructor();
18
- connectedCallback(): void;
19
- renderIcon(): import("lit-html").TemplateResult<1>;
20
- updated(changedProperties: PropertyValues): void;
21
- render(): import("lit-html").TemplateResult<1>;
22
- }
23
- declare global {
24
- interface HTMLElementTagNameMap {
25
- "icon-v1": Icon;
26
- }
27
- }
28
- //# sourceMappingURL=icon-v1.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icon-v1.d.ts","sourceRoot":"","sources":["../../DS1/2-core/icon-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,CAAC,UAAU;;;;;MAEf;IAEF,OAAO,CAAC,KAAK,CAAM;IAEnB,IAAI,SAAS;IACb,KAAK,SAAkB;IACvB,UAAU,SAAiB;IAE3B,IAAI,IAAI,WAEP;IACD,IAAI,IAAI,CAAC,GAAG,QAAA,EAIX;IAED,MAAM,CAAC,MAAM,0BA+BX;IAIF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAyBnC;;IAOL,iBAAiB;IAKjB,UAAU;IA4MV,OAAO,CAAC,iBAAiB,EAAE,cAAc;IAQzC,MAAM;CAIP;AAOD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}