ds-one 0.2.5-alpha.1 → 0.2.5-alpha.10

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 (67) hide show
  1. package/DS1/0-face/device.ts +10 -6
  2. package/DS1/0-face/i18n.ts +39 -90
  3. package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
  4. package/DS1/1-root/one.css +76 -107
  5. package/DS1/2-core/ds-banner.ts +3 -0
  6. package/DS1/2-core/ds-button.ts +12 -15
  7. package/DS1/2-core/ds-cycle.ts +67 -21
  8. package/DS1/2-core/ds-date.ts +1 -2
  9. package/DS1/2-core/ds-icon.ts +4 -4
  10. package/DS1/2-core/ds-text.ts +27 -3
  11. package/DS1/2-core/ds-tooltip.ts +6 -12
  12. package/DS1/3-unit/ds-list.ts +7 -0
  13. package/DS1/3-unit/ds-row.ts +4 -5
  14. package/DS1/3-unit/ds-table.ts +5 -6
  15. package/DS1/4-page/ds-grid.ts +9 -59
  16. package/DS1/4-page/ds-layout.ts +123 -18
  17. package/LICENSE +1 -1
  18. package/README.md +43 -133
  19. package/dist/0-face/device.d.ts.map +1 -1
  20. package/dist/0-face/device.js +7 -3
  21. package/dist/0-face/i18n.d.ts +0 -2
  22. package/dist/0-face/i18n.d.ts.map +1 -1
  23. package/dist/0-face/i18n.js +37 -74
  24. package/dist/2-core/ds-banner.d.ts +1 -0
  25. package/dist/2-core/ds-banner.d.ts.map +1 -0
  26. package/dist/2-core/ds-banner.js +2 -0
  27. package/dist/2-core/ds-button.d.ts +2 -7
  28. package/dist/2-core/ds-button.d.ts.map +1 -1
  29. package/dist/2-core/ds-button.js +11 -13
  30. package/dist/2-core/ds-cycle.d.ts +2 -0
  31. package/dist/2-core/ds-cycle.d.ts.map +1 -1
  32. package/dist/2-core/ds-cycle.js +65 -19
  33. package/dist/2-core/ds-date.js +1 -1
  34. package/dist/2-core/ds-icon.js +4 -4
  35. package/dist/2-core/ds-text.d.ts +2 -0
  36. package/dist/2-core/ds-text.d.ts.map +1 -1
  37. package/dist/2-core/ds-text.js +26 -3
  38. package/dist/2-core/ds-tooltip.d.ts +1 -1
  39. package/dist/2-core/ds-tooltip.d.ts.map +1 -1
  40. package/dist/2-core/ds-tooltip.js +6 -12
  41. package/dist/3-unit/ds-list.d.ts.map +1 -1
  42. package/dist/3-unit/ds-list.js +3 -0
  43. package/dist/3-unit/ds-portfolio-panel.d.ts.map +1 -1
  44. package/dist/3-unit/ds-portfolio-singlenav.js +3 -3
  45. package/dist/3-unit/ds-row.js +4 -4
  46. package/dist/3-unit/ds-table.d.ts.map +1 -1
  47. package/dist/3-unit/ds-table.js +5 -6
  48. package/dist/4-page/ds-grid.d.ts +0 -7
  49. package/dist/4-page/ds-grid.d.ts.map +1 -1
  50. package/dist/4-page/ds-grid.js +9 -54
  51. package/dist/4-page/ds-layout.d.ts +1 -1
  52. package/dist/4-page/ds-layout.d.ts.map +1 -1
  53. package/dist/4-page/ds-layout.js +126 -17
  54. package/dist/ds-one.bundle.js +347 -265
  55. package/dist/ds-one.bundle.js.map +4 -4
  56. package/dist/ds-one.bundle.min.js +204 -80
  57. package/dist/ds-one.bundle.min.js.map +4 -4
  58. package/package.json +7 -8
  59. package/DS1/3-unit/doublenav-v1.ts +0 -105
  60. package/DS1/3-unit/ds-portfolio-doublenav.ts +0 -105
  61. package/DS1/3-unit/ds-portfolio-panel.ts +0 -27
  62. package/DS1/3-unit/ds-portfolio-singlenav.ts +0 -79
  63. package/DS1/3-unit/list-v1.ts +0 -24
  64. package/DS1/3-unit/panel-v1.ts +0 -26
  65. package/DS1/3-unit/row-v1.ts +0 -52
  66. package/DS1/3-unit/singlenav-v1.ts +0 -78
  67. /package/DS1/x-icon/{row..svg → row.svg} +0 -0
@@ -4,42 +4,42 @@ let translationKeys = {};
4
4
  // Primary language list – prioritise the 10 requested languages when cycling
5
5
  const LANGUAGE_PRIORITY_ORDER = [
6
6
  "da",
7
- "nb",
8
- "sv",
9
- "pt",
7
+ "de",
8
+ "en",
10
9
  "es",
11
- "zh",
12
- "ko",
10
+ "fr",
11
+ "it",
13
12
  "ja",
14
- "en",
15
- "de",
13
+ "pt",
14
+ "sv",
15
+ "zh",
16
16
  ];
17
17
  const LANGUAGE_PRIORITY_LOOKUP = new Map(LANGUAGE_PRIORITY_ORDER.map((code, index) => [code, index]));
18
18
  // Fallback language names if Intl.DisplayNames is not available
19
19
  const FALLBACK_LANGUAGE_NAMES = {
20
20
  da: "Danish",
21
21
  "da-dk": "Danish",
22
- nb: "Norwegian",
23
- "nb-no": "Norwegian",
24
- sv: "Swedish",
25
- "sv-se": "Swedish",
26
22
  de: "German",
27
23
  "de-de": "German",
28
24
  en: "English",
29
25
  "en-us": "English",
30
- pt: "Portuguese",
31
- "pt-pt": "Portuguese",
32
- "pt-br": "Portuguese (Brazil)",
33
26
  es: "Spanish",
34
27
  "es-es": "Spanish",
35
- "es-mx": "Spanish (Mexico)",
36
- zh: "Chinese",
37
- "zh-hans": "Chinese (Simplified)",
38
- "zh-hant": "Chinese (Traditional)",
28
+ fr: "French",
29
+ "fr-fr": "French",
30
+ it: "Italian",
31
+ "it-it": "Italian",
39
32
  ja: "Japanese",
40
33
  "ja-jp": "Japanese",
41
- ko: "Korean",
42
- "ko-kr": "Korean",
34
+ pt: "Portuguese",
35
+ "pt-pt": "Portuguese",
36
+ sv: "Swedish",
37
+ "sv-se": "Swedish",
38
+ zh: "Chinese",
39
+ "zh-cn": "Chinese",
40
+ "zh-tw": "Chinese",
41
+ "zh-hans": "Chinese",
42
+ "zh-hant": "Chinese",
43
43
  };
44
44
  const DISPLAY_NAME_CACHE = new Map();
45
45
  let displayNameFallbackWarningShown = false;
@@ -179,7 +179,6 @@ function getTranslationData() {
179
179
  }
180
180
  // Cached translation data - use getter to always get fresh data
181
181
  let translationData = getTranslationData();
182
- const notionStore = new Map();
183
182
  const defaultLanguage = "en";
184
183
  function extractPrimarySubtag(code) {
185
184
  if (!code) {
@@ -288,33 +287,30 @@ export function getLanguageDisplayName(code, options = {}) {
288
287
  const BROWSER_LANGUAGE_PREFERENCES = {
289
288
  da: "da",
290
289
  "da-dk": "da",
291
- no: "nb",
292
- nb: "nb",
293
- "nb-no": "nb",
294
- nn: "nn",
295
- "nn-no": "nn",
296
- sv: "sv",
297
- "sv-se": "sv",
298
- pt: "pt",
299
- "pt-pt": "pt",
300
- "pt-br": "pt",
290
+ de: "de",
291
+ "de-de": "de",
292
+ en: "en",
293
+ "en-us": "en",
294
+ "en-gb": "en",
301
295
  es: "es",
302
296
  "es-es": "es",
303
297
  "es-mx": "es",
298
+ fr: "fr",
299
+ "fr-fr": "fr",
300
+ it: "it",
301
+ "it-it": "it",
302
+ ja: "ja",
303
+ "ja-jp": "ja",
304
+ pt: "pt",
305
+ "pt-pt": "pt",
306
+ "pt-br": "pt",
307
+ sv: "sv",
308
+ "sv-se": "sv",
304
309
  zh: "zh",
305
310
  "zh-cn": "zh",
306
311
  "zh-hans": "zh",
307
312
  "zh-tw": "zh",
308
313
  "zh-hant": "zh",
309
- ko: "ko",
310
- "ko-kr": "ko",
311
- ja: "ja",
312
- "ja-jp": "ja",
313
- en: "en",
314
- "en-us": "en",
315
- "en-gb": "en",
316
- de: "de",
317
- "de-de": "de",
318
314
  };
319
315
  function resolvePreferredLanguage(languageTag) {
320
316
  if (!languageTag) {
@@ -391,7 +387,6 @@ if (typeof window !== "undefined") {
391
387
  translationData = getTranslationData();
392
388
  // Dispatch that translations are loaded
393
389
  window.dispatchEvent(new CustomEvent("translations-loaded"));
394
- window.notionDataLoaded = true;
395
390
  // Dispatch language-changed to update all components
396
391
  const currentLang = currentLanguage.value;
397
392
  window.dispatchEvent(new CustomEvent("language-changed", {
@@ -406,7 +401,6 @@ if (typeof window !== "undefined") {
406
401
  setTimeout(() => {
407
402
  // Since we directly imported the data, just dispatch the events
408
403
  window.dispatchEvent(new CustomEvent("translations-loaded"));
409
- window.notionDataLoaded = true;
410
404
  // Also dispatch language-changed with the current language
411
405
  const currentLang = currentLanguage.value;
412
406
  window.dispatchEvent(new CustomEvent("language-changed", {
@@ -426,7 +420,7 @@ export function translate(key) {
426
420
  if (lang !== defaultLanguage && translationData?.[defaultLanguage]?.[key]) {
427
421
  return translationData[defaultLanguage][key];
428
422
  }
429
- console.warn(`[translate] No translation found for key "${key}"`);
423
+ console.warn(`[DS one (Internationalization)] No translation found for key "${key}"`);
430
424
  return key;
431
425
  }
432
426
  export function hasTranslation(key, language = currentLanguage.value) {
@@ -448,37 +442,6 @@ export function hasTranslation(key, language = currentLanguage.value) {
448
442
  export function getText(key) {
449
443
  return translate(key);
450
444
  }
451
- // Get text from translation data (async for compatibility)
452
- export async function getNotionText(key, language = currentLanguage.value) {
453
- if (!key) {
454
- return null;
455
- }
456
- if (!translationData || !translationData[language]) {
457
- return null;
458
- }
459
- const text = translationData[language][key];
460
- if (text) {
461
- return text;
462
- }
463
- // Fallback to English
464
- if (language !== defaultLanguage && translationData[defaultLanguage]?.[key]) {
465
- return translationData[defaultLanguage][key];
466
- }
467
- return null;
468
- }
469
- // Store Notion text (for dynamic updates)
470
- export function setNotionText(key, value, language = currentLanguage.value) {
471
- if (!key)
472
- return;
473
- const bucket = getLanguageBucket(language);
474
- bucket.set(key, value);
475
- }
476
- function getLanguageBucket(language) {
477
- if (!notionStore.has(language)) {
478
- notionStore.set(language, new Map());
479
- }
480
- return notionStore.get(language);
481
- }
482
445
  // Get available languages - dynamically detect from loaded data
483
446
  export function getAvailableLanguages() {
484
447
  // Always get fresh translation data
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=ds-banner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ds-banner.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-banner.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ // ds-banner.ts
2
+ // Core component
@@ -22,10 +22,6 @@ export declare class Button extends LitElement {
22
22
  type: BooleanConstructor;
23
23
  reflect: boolean;
24
24
  };
25
- notionKey: {
26
- type: StringConstructor;
27
- attribute: string;
28
- };
29
25
  key: {
30
26
  type: StringConstructor;
31
27
  };
@@ -46,7 +42,7 @@ export declare class Button extends LitElement {
46
42
  type: BooleanConstructor;
47
43
  state: boolean;
48
44
  };
49
- _notionText: {
45
+ _text: {
50
46
  type: StringConstructor;
51
47
  state: boolean;
52
48
  };
@@ -56,14 +52,13 @@ export declare class Button extends LitElement {
56
52
  bold: boolean;
57
53
  "no-background": boolean;
58
54
  blank: boolean;
59
- notionKey: string | null;
60
55
  key: string;
61
56
  fallback: string;
62
57
  language: string;
63
58
  defaultText: string;
64
59
  href: string;
65
60
  _loading: boolean;
66
- _notionText: string | null;
61
+ _text: string | null;
67
62
  constructor();
68
63
  static styles: import("lit").CSSResult;
69
64
  connectedCallback(): void;
@@ -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,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBf;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,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,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;;IAkB7B,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"}
@@ -13,14 +13,13 @@ export class Button extends LitElement {
13
13
  this.bold = false;
14
14
  this["no-background"] = false;
15
15
  this.blank = false;
16
- this.notionKey = null;
17
16
  this.key = "";
18
17
  this.fallback = "";
19
18
  this.language = "en-US";
20
19
  this.defaultText = "";
21
20
  this.href = "";
22
21
  this._loading = false;
23
- this._notionText = null;
22
+ this._text = null;
24
23
  }
25
24
  connectedCallback() {
26
25
  super.connectedCallback();
@@ -43,10 +42,10 @@ export class Button extends LitElement {
43
42
  */
44
43
  _updateText() {
45
44
  if (this.key) {
46
- this._notionText = getText(this.key);
45
+ this._text = getText(this.key);
47
46
  }
48
47
  else {
49
- this._notionText = this.defaultText || this.fallback || null;
48
+ this._text = this.defaultText || this.fallback || null;
50
49
  }
51
50
  this.requestUpdate();
52
51
  }
@@ -59,7 +58,7 @@ export class Button extends LitElement {
59
58
  ?no-background=${this["no-background"]}
60
59
  @click=${this._handleClick}
61
60
  >
62
- ${this._notionText ? this._notionText : html `<slot></slot>`}
61
+ ${this._text ? this._text : html `<slot></slot>`}
63
62
  </button>
64
63
  `;
65
64
  }
@@ -97,24 +96,23 @@ Button.properties = {
97
96
  attribute: "no-background",
98
97
  },
99
98
  blank: { type: Boolean, reflect: true },
100
- notionKey: { type: String, attribute: "notion-key" },
101
99
  key: { type: String },
102
100
  fallback: { type: String },
103
101
  language: { type: String },
104
102
  defaultText: { type: String, attribute: "default-text" },
105
103
  href: { type: String },
106
104
  _loading: { type: Boolean, state: true },
107
- _notionText: { type: String, state: true },
105
+ _text: { type: String, state: true },
108
106
  };
109
107
  Button.styles = css `
110
108
  button {
111
- max-height: calc(var(--08) * var(--scaling-factor));
109
+ max-height: calc(var(--08) * var(--sf));
112
110
  border: none;
113
111
  cursor: pointer;
114
- font-size: calc(var(--type-size-default) * var(--scaling-factor));
115
- padding: 0 calc(1px * var(--scaling-factor));
112
+ font-size: calc(var(--type-size-default) * var(--sf));
113
+ padding: 0 calc(1px * var(--sf));
116
114
  color: var(--button-text-color);
117
- font-family: var(--typeface);
115
+ font-family: var(--typeface-regular);
118
116
  }
119
117
 
120
118
  button.title {
@@ -126,13 +124,13 @@ Button.styles = css `
126
124
  background-color: var(--accent-color);
127
125
  color: var(--button-text-color);
128
126
  text-decoration-line: none;
129
- font-family: var(--typeface);
127
+ font-family: var(--typeface-regular);
130
128
  }
131
129
 
132
130
  button.secondary {
133
131
  background-color: var(--button-background-color-secondary);
134
132
  color: var(--button-text-color);
135
- font-family: var(--typeface);
133
+ font-family: var(--typeface-regular);
136
134
  }
137
135
 
138
136
  button[bold] {
@@ -1,6 +1,7 @@
1
1
  import { LitElement } from "lit";
2
2
  import "./ds-button";
3
3
  import "./ds-icon";
4
+ import "./ds-text";
4
5
  export declare class Cycle extends LitElement {
5
6
  static get properties(): {
6
7
  type: {
@@ -47,6 +48,7 @@ export declare class Cycle extends LitElement {
47
48
  disconnectedCallback(): void;
48
49
  handleButtonClick(e: Event): void;
49
50
  getValueDisplay(value: string): string | any;
51
+ getColorKey(colorVar: string): string;
50
52
  getColorName(colorVar: string): string;
51
53
  getNotesStyleIcon(style: string): import("lit-html").TemplateResult<1>;
52
54
  getLabel(): string;
@@ -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;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;YAuCQ,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,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;IA6EtB,sBAAsB;IAatB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IASnE,iBAAiB;IAoDvB,qBAAqB;IAKrB,oBAAoB;IA0BpB,iBAAiB,CAAC,CAAC,EAAE,KAAK;IAuJ1B,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,QAAQ,IAAI,MAAM;IAgElB,MAAM;YA0EQ,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"}
@@ -4,12 +4,13 @@ import { currentTheme, setTheme } from "../0-face/theme";
4
4
  import { savePreferences } from "../0-face/preferences";
5
5
  import "./ds-button";
6
6
  import "./ds-icon";
7
+ import "./ds-text";
7
8
  // Accent color utilities
8
9
  const saveAccentColor = (color) => {
9
10
  localStorage.setItem("accentColor", color);
10
11
  };
11
12
  const getAccentColor = () => {
12
- return localStorage.getItem("accentColor") || "--blue"; // Default color if none set
13
+ return localStorage.getItem("accentColor") || "--sharp-blue"; // Default color if none set
13
14
  };
14
15
  const applyAccentColor = () => {
15
16
  const color = getAccentColor();
@@ -96,12 +97,12 @@ export class Cycle extends LitElement {
96
97
  else if (this.type === "accent-color") {
97
98
  // Set up accent color cycling
98
99
  this.values = [
99
- "--light-green",
100
- "--green",
101
- "--light-blue",
102
- "--blue",
100
+ "--apple-green",
101
+ "--every-green",
102
+ "--zenith-blue",
103
+ "--sharp-blue",
103
104
  "--pink",
104
- "--red",
105
+ "--tuned-red",
105
106
  "--orange",
106
107
  "--yellow",
107
108
  ];
@@ -110,8 +111,6 @@ export class Cycle extends LitElement {
110
111
  this.currentValue = currentAccentColor;
111
112
  // Apply the accent color to ensure it's active
112
113
  applyAccentColor();
113
- // Set label
114
- this.label = this.getLabel();
115
114
  }
116
115
  else if (this.type === "notes-style-medium") {
117
116
  // Set up notes style medium cycling
@@ -183,8 +182,6 @@ export class Cycle extends LitElement {
183
182
  this.currentValue = currentAccentColor;
184
183
  // Apply the accent color to ensure it's active
185
184
  applyAccentColor();
186
- // Update label
187
- this.label = this.getLabel();
188
185
  }
189
186
  else if (this.type === "notes-style-medium") {
190
187
  // Get current notes style medium
@@ -350,8 +347,8 @@ export class Cycle extends LitElement {
350
347
  else if (this.type === "theme") {
351
348
  // Try to get translated theme name
352
349
  if (this.translationsReady) {
353
- const translatedName = translate(`themes.${value}`);
354
- if (translatedName && translatedName !== `themes.${value}`) {
350
+ const translatedName = translate(value);
351
+ if (translatedName && translatedName !== value) {
355
352
  return translatedName;
356
353
  }
357
354
  }
@@ -389,16 +386,30 @@ export class Cycle extends LitElement {
389
386
  }
390
387
  return value;
391
388
  }
389
+ getColorKey(colorVar) {
390
+ // Map CSS variables to language keys
391
+ const colorMap = {
392
+ "--tuned-red": "red",
393
+ "--orange": "orange",
394
+ "--yellow": "yellow",
395
+ "--apple-green": "appleGreen",
396
+ "--every-green": "green",
397
+ "--zenith-blue": "lightBlue",
398
+ "--sharp-blue": "blue",
399
+ "--pink": "pink",
400
+ };
401
+ return colorMap[colorVar] || colorVar.replace("--", "").replace("-", " ");
402
+ }
392
403
  getColorName(colorVar) {
393
404
  // Map CSS variables to language keys
394
405
  const colorMap = {
395
- "--red": "red",
406
+ "--tuned-red": "red",
396
407
  "--orange": "orange",
397
408
  "--yellow": "yellow",
398
- "--light-green": "lightGreen",
399
- "--green": "green",
400
- "--light-blue": "lightBlue",
401
- "--blue": "blue",
409
+ "--apple-green": "appleGreen",
410
+ "--every-green": "green",
411
+ "--zenith-blue": "lightBlue",
412
+ "--sharp-blue": "blue",
402
413
  "--pink": "pink",
403
414
  };
404
415
  const languageKey = colorMap[colorVar];
@@ -495,7 +506,25 @@ export class Cycle extends LitElement {
495
506
  return html `
496
507
  <div class="cycle-container">
497
508
  ${this.type !== "icon-only"
498
- ? html `<span class="cycle-label">${this.label}</span>`
509
+ ? html `${this.type === "language"
510
+ ? html `<ds-text
511
+ key="language"
512
+ default-value="Language"
513
+ class="cycle-label"
514
+ ></ds-text>`
515
+ : this.type === "theme"
516
+ ? html `<ds-text
517
+ key="theme"
518
+ default-value="Theme"
519
+ class="cycle-label"
520
+ ></ds-text>`
521
+ : this.type === "accent-color"
522
+ ? html `<ds-text
523
+ key="accentColor"
524
+ default-value="Accent color"
525
+ class="cycle-label"
526
+ ></ds-text>`
527
+ : html `<span class="cycle-label">${this.label}</span>`}`
499
528
  : ""}
500
529
  <div
501
530
  style="display: flex; align-items: center; ${this.type === "icon-only"
@@ -515,7 +544,24 @@ export class Cycle extends LitElement {
515
544
  style="display: inline-flex; align-items: center; gap: var(--025)"
516
545
  >${this.getValueDisplay(this.currentValue)}</span
517
546
  >`
518
- : html `<span>${this.getValueDisplay(this.currentValue)}</span>`}
547
+ : this.type === "theme"
548
+ ? html `<ds-text
549
+ key=${this.currentValue}
550
+ default-value=${this.currentValue}
551
+ ></ds-text>`
552
+ : this.type === "accent-color"
553
+ ? html `<ds-text
554
+ key=${this.getColorKey(this.currentValue)}
555
+ default-value=${this.getColorName(this.currentValue)}
556
+ ></ds-text>`
557
+ : this.type === "page-style"
558
+ ? html `<ds-text
559
+ key=${this.currentValue}
560
+ default-value=${this.currentValue}
561
+ ></ds-text>`
562
+ : html `<ds-text
563
+ default-value=${this.getValueDisplay(this.currentValue)}
564
+ ></ds-text>`}
519
565
  </ds-button>
520
566
  ${this.type === "accent-color"
521
567
  ? html `
@@ -13,7 +13,7 @@ export class DateComponent extends LitElement {
13
13
  DateComponent.styles = css `
14
14
  :host {
15
15
  display: inline;
16
- font-family: var(--typeface, var(--typeface-regular));
16
+ font-family: var(--typeface-regular, var(--typeface-regular-regular));
17
17
  font-size: inherit;
18
18
  color: inherit;
19
19
  }
@@ -240,8 +240,8 @@ Icon.styles = css `
240
240
  display: inline-flex;
241
241
  justify-content: center;
242
242
  align-items: center;
243
- width: calc(16px * var(--scaling-factor));
244
- height: calc(16px * var(--scaling-factor));
243
+ width: calc(16px * var(--sf));
244
+ height: calc(16px * var(--sf));
245
245
  }
246
246
 
247
247
  svg {
@@ -258,8 +258,8 @@ Icon.styles = css `
258
258
  display: flex;
259
259
  justify-content: center;
260
260
  align-items: center;
261
- width: calc(16px * var(--scaling-factor));
262
- height: calc(16px * var(--scaling-factor));
261
+ width: calc(16px * var(--sf));
262
+ height: calc(16px * var(--sf));
263
263
  }
264
264
 
265
265
  /* Notes style color variable for future implementation */
@@ -31,12 +31,14 @@ export declare class Text extends LitElement {
31
31
  defaultValue: string;
32
32
  fallback: string;
33
33
  _text: string;
34
+ _currentLanguage: string;
34
35
  private boundHandlers;
35
36
  constructor();
36
37
  static styles: import("lit").CSSResult;
37
38
  connectedCallback(): void;
38
39
  disconnectedCallback(): void;
39
40
  updated(changedProperties: Map<string, unknown>): void;
41
+ _updateLanguageAttribute(): void;
40
42
  _loadText(): void;
41
43
  render(): import("lit-html").TemplateResult<1>;
42
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ds-text.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;GAOG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;MAOpB;IAEO,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,aAAa,CAAqC;;IAkB1D,MAAM,CAAC,MAAM,0BAQX;IAEF,iBAAiB;IAoBjB,oBAAoB;IAYpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAQ/C,SAAS;IAgBT,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
1
+ {"version":3,"file":"ds-text.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;GAOG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;MAOpB;IAEO,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACjC,OAAO,CAAC,aAAa,CAAqC;;IAqB1D,MAAM,CAAC,MAAM,0BAgBX;IAEF,iBAAiB;IAsBjB,oBAAoB;IAYpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAQ/C,wBAAwB;IASxB,SAAS;IAiBT,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { LitElement, html, css } from "lit";
2
- import { getText } from "../0-face/i18n";
2
+ import { getText, currentLanguage } from "../0-face/i18n";
3
3
  /**
4
4
  * A component for displaying text from translations
5
5
  *
@@ -23,16 +23,21 @@ export class Text extends LitElement {
23
23
  this.defaultValue = "";
24
24
  this.fallback = "";
25
25
  this._text = "";
26
+ this._currentLanguage = currentLanguage.value;
26
27
  // Create bound event handlers for proper cleanup
27
28
  this.boundHandlers = {
28
29
  languageChanged: (() => {
29
30
  console.log("Language changed event received in ds-text");
31
+ this._currentLanguage = currentLanguage.value;
30
32
  this._loadText();
33
+ this.requestUpdate();
31
34
  }),
32
35
  };
33
36
  }
34
37
  connectedCallback() {
35
38
  super.connectedCallback();
39
+ this._currentLanguage = currentLanguage.value;
40
+ this._updateLanguageAttribute();
36
41
  this._loadText();
37
42
  // Listen for language changes
38
43
  window.addEventListener("language-changed", this.boundHandlers.languageChanged);
@@ -52,6 +57,15 @@ export class Text extends LitElement {
52
57
  this._loadText();
53
58
  }
54
59
  }
60
+ _updateLanguageAttribute() {
61
+ const lang = this._currentLanguage || currentLanguage.value;
62
+ if (lang === "ja") {
63
+ this.setAttribute("data-language", "ja");
64
+ }
65
+ else {
66
+ this.removeAttribute("data-language");
67
+ }
68
+ }
55
69
  _loadText() {
56
70
  if (!this.key) {
57
71
  this._text = this.defaultValue || this.fallback || "";
@@ -65,6 +79,7 @@ export class Text extends LitElement {
65
79
  console.error("Error loading text for key:", this.key, error);
66
80
  this._text = this.defaultValue || this.fallback || this.key;
67
81
  }
82
+ this._updateLanguageAttribute();
68
83
  this.requestUpdate();
69
84
  }
70
85
  render() {
@@ -74,10 +89,18 @@ export class Text extends LitElement {
74
89
  Text.styles = css `
75
90
  :host {
76
91
  display: inline;
92
+ font-family: var(--typeface-regular);
93
+ font-size: calc(var(--type-size-default) * var(--sf));
94
+ font-weight: var(--type-weight-default);
95
+ line-height: calc(var(--type-lineheight-default) * var(--sf));
96
+ letter-spacing: calc(var(--type-letterspacing-default) * var(--sf));
97
+ text-align: var(--text-align-default);
98
+ text-transform: var(--text-transform-default);
99
+ text-decoration: var(--text-decoration-default);
77
100
  }
78
101
 
79
- .loading {
80
- opacity: 0.6;
102
+ :host([data-language="ja"]) {
103
+ font-family: var(--typeface-regular-jp);
81
104
  }
82
105
  `;
83
106
  customElements.define("ds-text", Text);
@@ -28,7 +28,7 @@ export declare class Tooltip extends LitElement {
28
28
  connectedCallback(): void;
29
29
  disconnectedCallback(): void;
30
30
  updated(changed: Map<string, unknown>): void;
31
- _loadText(): Promise<void>;
31
+ _loadText(): void;
32
32
  render(): import("lit-html").TemplateResult<1>;
33
33
  }
34
34
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"ds-tooltip.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;MAKf;IAEM,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,mBAAmB,CAGzB;IACF,OAAO,CAAC,iBAAiB,CAKvB;;IAsCF,MAAM,CAAC,MAAM,0BA+CX;IAEF,iBAAiB,IAAI,IAAI;IAmBzB,oBAAoB,IAAI,IAAI;IAiB5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAMtC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBhC,MAAM;CAUP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,OAAO,CAAC;KACvB;CACF"}
1
+ {"version":3,"file":"ds-tooltip.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;MAKf;IAEM,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAU;IAE1B,OAAO,CAAC,mBAAmB,CAGzB;IACF,OAAO,CAAC,iBAAiB,CAKvB;;IAsCF,MAAM,CAAC,MAAM,0BA+CX;IAEF,iBAAiB,IAAI,IAAI;IAmBzB,oBAAoB,IAAI,IAAI;IAiB5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAM5C,SAAS,IAAI,IAAI;IAiBjB,MAAM;CAUP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,OAAO,CAAC;KACvB;CACF"}