ds-one 0.2.5-alpha.9 → 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 (209) hide show
  1. package/DS1/0-face/device.ts +138 -0
  2. package/DS1/0-face/scaling.ts +152 -0
  3. package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
  4. package/DS1/1-root/one.css +124 -77
  5. package/DS1/2-core/ds-banner.ts +120 -1
  6. package/DS1/2-core/ds-button.ts +16 -93
  7. package/DS1/2-core/ds-card.ts +137 -0
  8. package/DS1/2-core/ds-cycle.ts +77 -179
  9. package/DS1/2-core/ds-date.ts +3 -10
  10. package/DS1/2-core/ds-gap.ts +38 -0
  11. package/DS1/2-core/ds-icon.ts +6 -35
  12. package/DS1/2-core/ds-input.ts +306 -1
  13. package/DS1/2-core/ds-pagedots.ts +52 -0
  14. package/DS1/2-core/ds-text.ts +55 -28
  15. package/DS1/2-core/ds-tooltip.ts +12 -58
  16. package/DS1/2-core/styles/ds-banner.css +77 -0
  17. package/DS1/2-core/styles/ds-button.css +67 -0
  18. package/DS1/2-core/styles/ds-cycle.css +21 -0
  19. package/DS1/2-core/styles/ds-date.css +9 -0
  20. package/DS1/2-core/styles/ds-gap.css +93 -0
  21. package/DS1/2-core/styles/ds-icon.css +30 -0
  22. package/DS1/2-core/styles/ds-input.css +46 -0
  23. package/DS1/2-core/styles/ds-pagedots.css +31 -0
  24. package/DS1/2-core/styles/ds-text.css +29 -0
  25. package/DS1/2-core/styles/ds-tooltip.css +49 -0
  26. package/DS1/3-unit/ds-accordion.ts +95 -0
  27. package/DS1/3-unit/ds-form.ts +304 -0
  28. package/DS1/3-unit/ds-list.ts +5 -14
  29. package/DS1/3-unit/ds-row.ts +3 -19
  30. package/DS1/3-unit/ds-table.ts +3 -86
  31. package/DS1/3-unit/styles/ds-accordion.css +46 -0
  32. package/DS1/3-unit/styles/ds-list.css +9 -0
  33. package/DS1/3-unit/styles/ds-row.css +19 -0
  34. package/DS1/3-unit/styles/ds-table.css +80 -0
  35. package/DS1/4-page/ds-container.ts +28 -0
  36. package/DS1/4-page/ds-grid.ts +37 -50
  37. package/DS1/4-page/ds-layout.ts +652 -163
  38. package/DS1/4-page/styles/ds-container.css +35 -0
  39. package/DS1/4-page/styles/ds-grid.css +56 -0
  40. package/DS1/4-page/styles/ds-layout.css +246 -0
  41. package/DS1/index.ts +9 -1
  42. package/DS1/vite-env.d.ts +13 -0
  43. package/DS1/x-icon/2x.svg +4 -0
  44. package/DS1/x-icon/2xdots.svg +18 -0
  45. package/DS1/x-icon/2xgrid.svg +6 -0
  46. package/DS1/x-icon/2xlines.svg +6 -0
  47. package/DS1/x-icon/4x4.svg +18 -0
  48. package/DS1/x-icon/apple.svg +4 -0
  49. package/DS1/x-icon/avatar.svg +4 -0
  50. package/DS1/x-icon/big.svg +4 -0
  51. package/DS1/x-icon/blank.svg +3 -0
  52. package/DS1/x-icon/check.svg +3 -0
  53. package/DS1/x-icon/close.svg +3 -0
  54. package/DS1/x-icon/collapse.svg +3 -0
  55. package/DS1/x-icon/color.svg +4 -0
  56. package/DS1/x-icon/column.svg +5 -0
  57. package/DS1/x-icon/default.svg +3 -0
  58. package/DS1/x-icon/delete.svg +5 -0
  59. package/DS1/x-icon/dictate.svg +6 -0
  60. package/DS1/x-icon/do.svg +3 -0
  61. package/DS1/x-icon/down.svg +3 -0
  62. package/DS1/x-icon/duplicate.svg +4 -0
  63. package/DS1/x-icon/gallery.svg +5 -0
  64. package/DS1/x-icon/google.svg +6 -0
  65. package/DS1/x-icon/head.svg +5 -0
  66. package/DS1/x-icon/home.svg +3 -0
  67. package/DS1/x-icon/icon.svg +4 -0
  68. package/DS1/x-icon/in.svg +4 -0
  69. package/DS1/x-icon/lock.svg +5 -0
  70. package/DS1/x-icon/loop.svg +5 -0
  71. package/DS1/x-icon/mic.svg +5 -0
  72. package/DS1/x-icon/minimize.svg +3 -0
  73. package/DS1/x-icon/more.svg +5 -0
  74. package/DS1/x-icon/neutral.svg +6 -0
  75. package/DS1/x-icon/note.svg +6 -0
  76. package/DS1/x-icon/page.svg +4 -0
  77. package/DS1/x-icon/plus.svg +3 -0
  78. package/DS1/x-icon/rewind.svg +4 -0
  79. package/DS1/x-icon/row.svg +5 -0
  80. package/DS1/x-icon/sdown.svg +3 -0
  81. package/DS1/x-icon/search.svg +4 -0
  82. package/DS1/x-icon/see.svg +4 -0
  83. package/DS1/x-icon/ship.svg +5 -0
  84. package/DS1/x-icon/star.svg +3 -0
  85. package/DS1/x-icon/status.svg +4 -0
  86. package/DS1/x-icon/sup.svg +3 -0
  87. package/DS1/x-icon/title.svg +3 -0
  88. package/DS1/x-icon/undo.svg +3 -0
  89. package/DS1/x-icon/ungroup.svg +4 -0
  90. package/DS1/x-icon/unhead.svg +3 -0
  91. package/DS1/x-icon/unicon.svg +3 -0
  92. package/DS1/x-icon/unlock.svg +5 -0
  93. package/DS1/x-icon/unmic.svg +6 -0
  94. package/DS1/x-icon/unsee.svg +5 -0
  95. package/DS1/x-icon/unstar.svg +3 -0
  96. package/DS1/x-icon/untitle.svg +3 -0
  97. package/DS1/x-icon/up.svg +3 -0
  98. package/LICENSE +1 -1
  99. package/README.md +4 -4
  100. package/dist/0-face/device.d.ts +5 -0
  101. package/dist/0-face/device.d.ts.map +1 -1
  102. package/dist/0-face/device.js +111 -0
  103. package/dist/0-face/scaling.d.ts +48 -0
  104. package/dist/0-face/scaling.d.ts.map +1 -0
  105. package/dist/0-face/scaling.js +114 -0
  106. package/dist/2-core/ds-banner.d.ts +67 -0
  107. package/dist/2-core/ds-banner.d.ts.map +1 -1
  108. package/dist/2-core/ds-banner.js +97 -1
  109. package/dist/2-core/ds-button.d.ts +4 -15
  110. package/dist/2-core/ds-button.d.ts.map +1 -1
  111. package/dist/2-core/ds-button.js +14 -86
  112. package/dist/2-core/ds-card.d.ts +39 -0
  113. package/dist/2-core/ds-card.d.ts.map +1 -0
  114. package/dist/2-core/ds-card.js +119 -0
  115. package/dist/2-core/ds-cycle.d.ts +1 -5
  116. package/dist/2-core/ds-cycle.d.ts.map +1 -1
  117. package/dist/2-core/ds-cycle.js +74 -163
  118. package/dist/2-core/ds-date.d.ts.map +1 -1
  119. package/dist/2-core/ds-date.js +3 -9
  120. package/dist/2-core/ds-gap.d.ts +28 -0
  121. package/dist/2-core/ds-gap.d.ts.map +1 -0
  122. package/dist/2-core/ds-gap.js +25 -0
  123. package/dist/2-core/ds-icon.d.ts.map +1 -1
  124. package/dist/2-core/ds-icon.js +6 -35
  125. package/dist/2-core/ds-input.d.ts +127 -0
  126. package/dist/2-core/ds-input.d.ts.map +1 -1
  127. package/dist/2-core/ds-input.js +252 -1
  128. package/dist/2-core/ds-pagedots.d.ts +32 -0
  129. package/dist/2-core/ds-pagedots.d.ts.map +1 -0
  130. package/dist/2-core/ds-pagedots.js +36 -0
  131. package/dist/2-core/ds-text.d.ts +5 -3
  132. package/dist/2-core/ds-text.d.ts.map +1 -1
  133. package/dist/2-core/ds-text.js +49 -27
  134. package/dist/2-core/ds-tooltip.d.ts +2 -2
  135. package/dist/2-core/ds-tooltip.d.ts.map +1 -1
  136. package/dist/2-core/ds-tooltip.js +11 -57
  137. package/dist/2-core/styles/ds-banner.css +77 -0
  138. package/dist/2-core/styles/ds-button.css +67 -0
  139. package/dist/2-core/styles/ds-cycle.css +21 -0
  140. package/dist/2-core/styles/ds-date.css +9 -0
  141. package/dist/2-core/styles/ds-gap.css +93 -0
  142. package/dist/2-core/styles/ds-icon.css +30 -0
  143. package/dist/2-core/styles/ds-input.css +46 -0
  144. package/dist/2-core/styles/ds-pagedots.css +26 -0
  145. package/dist/2-core/styles/ds-text.css +29 -0
  146. package/dist/2-core/styles/ds-tooltip.css +49 -0
  147. package/dist/3-unit/ds-accordion.d.ts +47 -0
  148. package/dist/3-unit/ds-accordion.d.ts.map +1 -0
  149. package/dist/3-unit/ds-accordion.js +75 -0
  150. package/dist/3-unit/ds-form.d.ts +70 -0
  151. package/dist/3-unit/ds-form.d.ts.map +1 -0
  152. package/dist/3-unit/ds-form.js +232 -0
  153. package/dist/3-unit/ds-list.d.ts.map +1 -1
  154. package/dist/3-unit/ds-list.js +5 -11
  155. package/dist/3-unit/ds-row.d.ts.map +1 -1
  156. package/dist/3-unit/ds-row.js +3 -19
  157. package/dist/3-unit/ds-table.d.ts.map +1 -1
  158. package/dist/3-unit/ds-table.js +3 -86
  159. package/dist/3-unit/styles/ds-accordion.css +46 -0
  160. package/dist/3-unit/styles/ds-list.css +9 -0
  161. package/dist/3-unit/styles/ds-row.css +19 -0
  162. package/dist/3-unit/styles/ds-table.css +80 -0
  163. package/dist/{3-unit/row-v1.d.ts → 4-page/ds-container.d.ts} +3 -11
  164. package/dist/4-page/ds-container.d.ts.map +1 -0
  165. package/dist/4-page/ds-container.js +11 -0
  166. package/dist/4-page/ds-grid.d.ts +5 -0
  167. package/dist/4-page/ds-grid.d.ts.map +1 -1
  168. package/dist/4-page/ds-grid.js +38 -56
  169. package/dist/4-page/ds-layout.d.ts +3 -3
  170. package/dist/4-page/ds-layout.d.ts.map +1 -1
  171. package/dist/4-page/ds-layout.js +651 -162
  172. package/dist/4-page/styles/ds-container.css +35 -0
  173. package/dist/4-page/styles/ds-grid.css +56 -0
  174. package/dist/4-page/styles/ds-layout.css +251 -0
  175. package/dist/ds-one.bundle.css +700 -0
  176. package/dist/ds-one.bundle.css.map +7 -0
  177. package/dist/ds-one.bundle.js +2642 -1469
  178. package/dist/ds-one.bundle.js.map +1 -7
  179. package/dist/ds-one.bundle.min.css +2 -0
  180. package/dist/ds-one.bundle.min.css.map +7 -0
  181. package/dist/ds-one.bundle.min.js +3850 -550
  182. package/dist/ds-one.bundle.min.js.map +1 -7
  183. package/dist/index.d.ts +9 -1
  184. package/dist/index.d.ts.map +1 -1
  185. package/dist/index.js +9 -1
  186. package/package.json +4 -2
  187. package/dist/3-unit/doublenav-v1.d.ts +0 -51
  188. package/dist/3-unit/doublenav-v1.d.ts.map +0 -1
  189. package/dist/3-unit/doublenav-v1.js +0 -88
  190. package/dist/3-unit/ds-portfolio-doublenav.d.ts +0 -51
  191. package/dist/3-unit/ds-portfolio-doublenav.d.ts.map +0 -1
  192. package/dist/3-unit/ds-portfolio-doublenav.js +0 -88
  193. package/dist/3-unit/ds-portfolio-panel.d.ts +0 -11
  194. package/dist/3-unit/ds-portfolio-panel.d.ts.map +0 -1
  195. package/dist/3-unit/ds-portfolio-panel.js +0 -16
  196. package/dist/3-unit/ds-portfolio-singlenav.d.ts +0 -32
  197. package/dist/3-unit/ds-portfolio-singlenav.d.ts.map +0 -1
  198. package/dist/3-unit/ds-portfolio-singlenav.js +0 -62
  199. package/dist/3-unit/list-v1.d.ts +0 -11
  200. package/dist/3-unit/list-v1.d.ts.map +0 -1
  201. package/dist/3-unit/list-v1.js +0 -15
  202. package/dist/3-unit/panel-v1.d.ts +0 -11
  203. package/dist/3-unit/panel-v1.d.ts.map +0 -1
  204. package/dist/3-unit/panel-v1.js +0 -16
  205. package/dist/3-unit/row-v1.d.ts.map +0 -1
  206. package/dist/3-unit/row-v1.js +0 -32
  207. package/dist/3-unit/singlenav-v1.d.ts +0 -32
  208. package/dist/3-unit/singlenav-v1.d.ts.map +0 -1
  209. package/dist/3-unit/singlenav-v1.js +0 -62
@@ -1,4 +1,4 @@
1
- import { LitElement, html, css } from "lit";
1
+ import { LitElement, html, unsafeCSS } from "lit";
2
2
  import {
3
3
  translate,
4
4
  currentLanguage,
@@ -13,6 +13,7 @@ import { savePreferences } from "../0-face/preferences";
13
13
  import "./ds-button";
14
14
  import "./ds-icon";
15
15
  import "./ds-text";
16
+ import styles from "./styles/ds-cycle.css?inline";
16
17
 
17
18
  // Accent color utilities
18
19
  const saveAccentColor = (color: string) => {
@@ -20,7 +21,7 @@ const saveAccentColor = (color: string) => {
20
21
  };
21
22
 
22
23
  const getAccentColor = (): string => {
23
- return localStorage.getItem("accentColor") || "--blue"; // Default color if none set
24
+ return localStorage.getItem("accentColor") || "--sharp-blue"; // Default color if none set
24
25
  };
25
26
 
26
27
  const applyAccentColor = () => {
@@ -55,7 +56,6 @@ export class Cycle extends LitElement {
55
56
  return {
56
57
  type: { type: String },
57
58
  values: { type: Array },
58
- label: { type: String },
59
59
  currentValue: { type: String, state: true }, // Make this a private state property
60
60
  translationsReady: { type: Boolean, state: true }, // Track if translations are loaded
61
61
  disabled: { type: Boolean, state: true },
@@ -63,24 +63,12 @@ export class Cycle extends LitElement {
63
63
  };
64
64
  }
65
65
 
66
- static styles = css`
67
- .cycle-container {
68
- display: flex;
69
- justify-content: space-between;
70
- gap: var(--025);
71
- width: 100%;
72
- }
73
-
74
- .cycle-label {
75
- color: var(--text-color-primary);
76
- }
77
- `;
66
+ static styles = unsafeCSS(styles);
78
67
 
79
68
  // Add runtime properties using the any type
80
69
  // These are just for TypeScript and don't create shadowing fields
81
70
  declare type: string;
82
71
  declare values: string[];
83
- declare label: string;
84
72
  declare currentValue: string;
85
73
  declare translationsReady: boolean;
86
74
  declare disabled: boolean;
@@ -102,7 +90,6 @@ export class Cycle extends LitElement {
102
90
  // Initialize properties with default values
103
91
  this.type = "";
104
92
  this.values = [];
105
- this.label = "";
106
93
  this.currentValue = "";
107
94
  this.translationsReady = false;
108
95
  this.disabled = false;
@@ -154,9 +141,6 @@ export class Cycle extends LitElement {
154
141
  const availableLanguages = getAvailableLanguagesSync();
155
142
  this.values = availableLanguages;
156
143
  this.currentValue = currentLanguage.value;
157
-
158
- // Set label
159
- this.label = this.getLabel();
160
144
  } else if (this.type === "theme") {
161
145
  // Set up theme cycling
162
146
  this.values = ["light", "dark"];
@@ -164,18 +148,15 @@ export class Cycle extends LitElement {
164
148
  // Set initial value based on current theme
165
149
  const currentThemeValue = currentTheme.get();
166
150
  this.currentValue = currentThemeValue;
167
-
168
- // Set label
169
- this.label = this.getLabel();
170
151
  } else if (this.type === "accent-color") {
171
152
  // Set up accent color cycling
172
153
  this.values = [
173
- "--light-green",
174
- "--green",
175
- "--light-blue",
176
- "--blue",
154
+ "--apple-green",
155
+ "--every-green",
156
+ "--zenith-blue",
157
+ "--sharp-blue",
177
158
  "--pink",
178
- "--red",
159
+ "--tuned-red",
179
160
  "--orange",
180
161
  "--yellow",
181
162
  ];
@@ -197,9 +178,6 @@ export class Cycle extends LitElement {
197
178
  // Check if this should be disabled based on note behavior
198
179
  const currentPageStyle = getPageStyle();
199
180
  this.disabled = currentPageStyle === "note";
200
-
201
- // Set label
202
- this.label = this.getLabel();
203
181
  } else if (this.type === "page-style") {
204
182
  // Set up page style cycling
205
183
  this.values = ["note", "page"];
@@ -207,18 +185,12 @@ export class Cycle extends LitElement {
207
185
  // Set initial value based on current page style
208
186
  const currentPageStyle = getPageStyle();
209
187
  this.currentValue = currentPageStyle;
210
-
211
- // Set label
212
- this.label = this.getLabel();
213
188
  } else if (this.type === "icon-only") {
214
189
  // Set up icon-only cycling (no label)
215
190
  this.values = ["note", "page"];
216
191
 
217
192
  // Set initial value
218
193
  this.currentValue = this.values[0];
219
-
220
- // No label for icon-only type
221
- this.label = "";
222
194
  }
223
195
 
224
196
  // Request update to re-render with new values
@@ -252,16 +224,10 @@ export class Cycle extends LitElement {
252
224
  // Get current language
253
225
  const currentLang = currentLanguage.value;
254
226
  this.currentValue = currentLang;
255
-
256
- // Update label
257
- this.label = this.getLabel();
258
227
  } else if (this.type === "theme") {
259
228
  // Get current theme
260
229
  const currentThemeValue = currentTheme.get();
261
230
  this.currentValue = currentThemeValue;
262
-
263
- // Update label
264
- this.label = this.getLabel();
265
231
  } else if (this.type === "accent-color") {
266
232
  // Get current accent color
267
233
  const currentAccentColor = getAccentColor();
@@ -277,23 +243,14 @@ export class Cycle extends LitElement {
277
243
  // Check if this should be disabled based on note behavior
278
244
  const currentPageStyle = getPageStyle();
279
245
  this.disabled = currentPageStyle === "note";
280
-
281
- // Update label
282
- this.label = this.getLabel();
283
246
  } else if (this.type === "page-style") {
284
247
  // Get current page style
285
248
  const currentPageStyle = getPageStyle();
286
249
  this.currentValue = currentPageStyle;
287
-
288
- // Update label
289
- this.label = this.getLabel();
290
250
  } else if (this.type === "icon-only") {
291
251
  // Get current page style for icon-only
292
252
  const currentPageStyle = getPageStyle();
293
253
  this.currentValue = currentPageStyle;
294
-
295
- // Update label
296
- this.label = "";
297
254
  }
298
255
 
299
256
  this.requestUpdate();
@@ -463,9 +420,6 @@ export class Cycle extends LitElement {
463
420
  // Save preferences
464
421
  savePreferences({ pageStyle: newIconOnlyValue });
465
422
 
466
- // No label update for icon-only type
467
- this.label = "";
468
-
469
423
  // Dispatch page style change event
470
424
  window.dispatchEvent(
471
425
  new CustomEvent("page-style-changed", {
@@ -474,9 +428,6 @@ export class Cycle extends LitElement {
474
428
  );
475
429
  }
476
430
 
477
- // Update label
478
- this.label = this.getLabel();
479
-
480
431
  // Request update to re-render
481
432
  this.requestUpdate();
482
433
  }
@@ -506,10 +457,10 @@ export class Cycle extends LitElement {
506
457
  } else if (this.type === "page-style") {
507
458
  // Return translated text for note behavior
508
459
  if (this.translationsReady) {
509
- const translatedText = translate(value === "note" ? "note" : "page");
460
+ const translatedText = translate(value === "note" ? "Note" : "Page");
510
461
  if (
511
462
  translatedText &&
512
- translatedText !== (value === "note" ? "note" : "page")
463
+ translatedText !== (value === "note" ? "Note" : "Page")
513
464
  ) {
514
465
  return translatedText;
515
466
  }
@@ -528,23 +479,39 @@ export class Cycle extends LitElement {
528
479
  return value;
529
480
  }
530
481
 
482
+ getColorKey(colorVar: string): string {
483
+ // Map CSS variables to translation text keys
484
+ const colorMap: { [key: string]: string } = {
485
+ "--tuned-red": "Red",
486
+ "--orange": "Orange",
487
+ "--yellow": "Yellow",
488
+ "--apple-green": "Apple green",
489
+ "--every-green": "Green",
490
+ "--zenith-blue": "Light blue",
491
+ "--sharp-blue": "Blue",
492
+ "--pink": "Pink",
493
+ };
494
+
495
+ return colorMap[colorVar] || colorVar.replace("--", "").replace("-", " ");
496
+ }
497
+
531
498
  getColorName(colorVar: string): string {
532
- // Map CSS variables to language keys
499
+ // Map CSS variables to translation text keys
533
500
  const colorMap: { [key: string]: string } = {
534
- "--red": "red",
535
- "--orange": "orange",
536
- "--yellow": "yellow",
537
- "--light-green": "lightGreen",
538
- "--green": "green",
539
- "--light-blue": "lightBlue",
540
- "--blue": "blue",
541
- "--pink": "pink",
501
+ "--tuned-red": "Red",
502
+ "--orange": "Orange",
503
+ "--yellow": "Yellow",
504
+ "--apple-green": "Apple green",
505
+ "--every-green": "Green",
506
+ "--zenith-blue": "Light blue",
507
+ "--sharp-blue": "Blue",
508
+ "--pink": "Pink",
542
509
  };
543
510
 
544
- const languageKey = colorMap[colorVar];
545
- if (languageKey && this.translationsReady) {
546
- const translatedName = translate(languageKey);
547
- if (translatedName && translatedName !== languageKey) {
511
+ const translationText = colorMap[colorVar];
512
+ if (translationText && this.translationsReady) {
513
+ const translatedName = translate(translationText);
514
+ if (translatedName && translatedName !== translationText) {
548
515
  return translatedName;
549
516
  }
550
517
  }
@@ -568,123 +535,54 @@ export class Cycle extends LitElement {
568
535
  return html`<span>${style}</span>`;
569
536
  }
570
537
 
571
- getLabel(): string {
572
- if (this.type === "language") {
573
- // Try to get translated label
574
- if (this.translationsReady) {
575
- const translatedLabel = translate("language");
576
- if (translatedLabel && translatedLabel !== "language") {
577
- return translatedLabel;
578
- }
579
- }
580
-
581
- // Fall back to English
582
- return "Language";
583
- } else if (this.type === "theme") {
584
- // Try to get translated label
585
- if (this.translationsReady) {
586
- const translatedLabel = translate("theme");
587
- if (translatedLabel && translatedLabel !== "theme") {
588
- return translatedLabel;
589
- }
590
- }
591
-
592
- // Fall back to English
593
- return "Theme";
594
- } else if (this.type === "accent-color") {
595
- // Try to get translated label
596
- if (this.translationsReady) {
597
- const translatedLabel = translate("accentColor");
598
- if (translatedLabel && translatedLabel !== "accentColor") {
599
- return translatedLabel;
600
- }
601
- }
602
-
603
- // Fall back to English
604
- return "Accent Color";
605
- } else if (this.type === "notes-style-medium") {
606
- // Try to get translated label
607
- if (this.translationsReady) {
608
- const translatedLabel = translate("notesStyle");
609
- if (translatedLabel && translatedLabel !== "notesStyle") {
610
- return translatedLabel;
611
- }
612
- }
613
-
614
- // Fall back to English
615
- return "Notes Style";
616
- } else if (this.type === "page-style") {
617
- // Try to get translated label
618
- if (this.translationsReady) {
619
- const translatedLabel = translate("clickingItem");
620
- if (translatedLabel && translatedLabel !== "clickingItem") {
621
- return translatedLabel;
622
- }
623
- }
624
-
625
- // Fall back to English
626
- return "Clic";
627
- } else if (this.type === "icon-only") {
628
- // No label for icon-only type
629
- return "";
630
- }
631
-
632
- return this.label;
633
- }
634
-
635
538
  render() {
636
539
  return html`
637
- <div class="cycle-container">
638
- ${this.type !== "icon-only"
639
- ? html`${this.type === "language"
540
+ <div class="cycle">
541
+ <ds-button
542
+ variant=${this.variant ||
543
+ (this.type === "language" || this.type === "theme"
544
+ ? "secondary"
545
+ : "primary")}
546
+ ?disabled=${this.disabled}
547
+ @click=${this.handleButtonClick}
548
+ >
549
+ ${this.type === "notes-style-medium" || this.type === "icon-only"
550
+ ? html`<span
551
+ style="display: inline-flex; align-items: center; gap: var(--025)"
552
+ >${this.getValueDisplay(this.currentValue)}</span
553
+ >`
554
+ : this.type === "language"
640
555
  ? html`<ds-text
641
- key="language"
642
- default-value="Language"
643
- class="cycle-label"
556
+ default-value=${this.getValueDisplay(this.currentValue)}
644
557
  ></ds-text>`
645
558
  : this.type === "theme"
646
559
  ? html`<ds-text
647
- key="theme"
648
- default-value="Theme"
649
- class="cycle-label"
560
+ text=${this.currentValue}
561
+ default-value=${this.currentValue}
650
562
  ></ds-text>`
651
563
  : this.type === "accent-color"
652
564
  ? html`<ds-text
653
- key="accentColor"
654
- default-value="Accent color"
655
- class="cycle-label"
565
+ text=${this.getColorKey(this.currentValue)}
566
+ default-value=${this.getColorName(this.currentValue)}
656
567
  ></ds-text>`
657
- : html`<span class="cycle-label">${this.label}</span>`}`
568
+ : this.type === "page-style"
569
+ ? html`<ds-text
570
+ text=${this.currentValue === "note" ? "Note" : "Page"}
571
+ default-value=${this.currentValue}
572
+ ></ds-text>`
573
+ : html`<ds-text
574
+ default-value=${this.getValueDisplay(this.currentValue)}
575
+ ></ds-text>`}
576
+ </ds-button>
577
+
578
+ ${this.type === "accent-color"
579
+ ? html`
580
+ <div
581
+ class="color-preview"
582
+ style="background-color: var(${this.currentValue})"
583
+ ></div>
584
+ `
658
585
  : ""}
659
- <div
660
- style="display: flex; align-items: center; ${this.type === "icon-only"
661
- ? "justify-content: center;"
662
- : ""}"
663
- >
664
- <ds-button
665
- variant=${this.variant ||
666
- (this.type === "language" || this.type === "theme"
667
- ? "secondary"
668
- : "primary")}
669
- ?disabled=${this.disabled}
670
- @click=${this.handleButtonClick}
671
- >
672
- ${this.type === "notes-style-medium" || this.type === "icon-only"
673
- ? html`<span
674
- style="display: inline-flex; align-items: center; gap: var(--025)"
675
- >${this.getValueDisplay(this.currentValue)}</span
676
- >`
677
- : html`<span>${this.getValueDisplay(this.currentValue)}</span>`}
678
- </ds-button>
679
- ${this.type === "accent-color"
680
- ? html`
681
- <div
682
- class="color-preview"
683
- style="background-color: var(${this.currentValue})"
684
- ></div>
685
- `
686
- : ""}
687
- </div>
688
586
  </div>
689
587
  `;
690
588
  }
@@ -1,4 +1,5 @@
1
- import { LitElement, html, css } from "lit";
1
+ import { LitElement, html, unsafeCSS } from "lit";
2
+ import styles from "./styles/ds-date.css?inline";
2
3
 
3
4
  /**
4
5
  * A component for displaying the current year
@@ -6,14 +7,7 @@ import { LitElement, html, css } from "lit";
6
7
  * @element ds-date
7
8
  */
8
9
  export class DateComponent extends LitElement {
9
- static styles = css`
10
- :host {
11
- display: inline;
12
- font-family: var(--typeface, var(--typeface-regular));
13
- font-size: inherit;
14
- color: inherit;
15
- }
16
- `;
10
+ static styles = unsafeCSS(styles);
17
11
 
18
12
  render() {
19
13
  const year = new Date().getFullYear();
@@ -28,4 +22,3 @@ declare global {
28
22
  "ds-date": DateComponent;
29
23
  }
30
24
  }
31
-
@@ -0,0 +1,38 @@
1
+ import { LitElement, html, unsafeCSS } from "lit";
2
+ import styles from "./styles/ds-gap.css?inline";
3
+
4
+ /**
5
+ * Full-width vertical spacer.
6
+ *
7
+ * Usage:
8
+ * - <ds-gap unit></ds-gap>
9
+ * - <ds-gap double></ds-gap>
10
+ * - <ds-gap size="05"></ds-gap>
11
+ */
12
+ export class Gap extends LitElement {
13
+ static properties = {
14
+ /** Raw scale token selector ("01", "025", "05", "08", "1", "2", "3", "4", "8", "12") */
15
+ size: { type: String, reflect: true },
16
+ };
17
+
18
+ declare size: string;
19
+
20
+ constructor() {
21
+ super();
22
+ this.size = "";
23
+ }
24
+
25
+ static styles = unsafeCSS(styles);
26
+
27
+ render() {
28
+ return html``;
29
+ }
30
+ }
31
+
32
+ customElements.define("ds-gap", Gap);
33
+
34
+ declare global {
35
+ interface HTMLElementTagNameMap {
36
+ "ds-gap": Gap;
37
+ }
38
+ }
@@ -1,5 +1,6 @@
1
- import { LitElement, html, css, type PropertyValues } from "lit";
1
+ import { LitElement, html, unsafeCSS, type PropertyValues } from "lit";
2
2
  import { unsafeHTML } from "lit/directives/unsafe-html.js";
3
+ import styles from "./styles/ds-icon.css?inline";
3
4
 
4
5
  export class Icon extends LitElement {
5
6
  static properties = {
@@ -21,46 +22,16 @@ export class Icon extends LitElement {
21
22
  this.requestUpdate("type", oldVal);
22
23
  }
23
24
 
24
- static styles = css`
25
- :host {
26
- display: inline-flex;
27
- justify-content: center;
28
- align-items: center;
29
- width: calc(16px * var(--sf));
30
- height: calc(16px * var(--sf));
31
- }
32
-
33
- svg {
34
- width: 100%;
35
- height: 100%;
36
- fill: var(--icon-color, currentColor);
37
- }
38
-
39
- path {
40
- fill: var(--icon-color, currentColor);
41
- }
42
-
43
- .icon-container {
44
- display: flex;
45
- justify-content: center;
46
- align-items: center;
47
- width: calc(16px * var(--sf));
48
- height: calc(16px * var(--sf));
49
- }
50
-
51
- /* Notes style color variable for future implementation */
52
- :host {
53
- --notes-style-color: #ffb6b9;
54
- }
55
- `;
25
+ static styles = unsafeCSS(styles);
56
26
 
57
27
  // Load all SVGs from `x Icon/` as raw strings at build time (Vite)
58
28
  // The keys will be the file base names (without extension), lowercased.
59
29
  private static readonly iconNameToSvgMap: Record<string, string> = (() => {
60
30
  try {
61
31
  // Note: folder name contains a space, keep it exact.
62
- const modules = (import.meta as any).glob("../x Icon/*.svg", {
63
- as: "raw",
32
+ const modules = (import.meta as any).glob("../x-icon/*.svg", {
33
+ query: "?raw",
34
+ import: "default",
64
35
  eager: true,
65
36
  }) as Record<string, string>;
66
37