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,137 @@
1
+ // ds-card.ts
2
+ // Card component for displaying content in a contained box
3
+
4
+ import { LitElement, html, css } from "lit";
5
+
6
+ export class Card extends LitElement {
7
+ static properties = {
8
+ variant: { type: String, reflect: true },
9
+ elevation: { type: Number, reflect: true },
10
+ interactive: { type: Boolean, reflect: true },
11
+ disabled: { type: Boolean, reflect: true },
12
+ padding: { type: String, reflect: true },
13
+ };
14
+
15
+ declare variant: "default" | "outlined" | "elevated" | "filled";
16
+ declare elevation: number;
17
+ declare interactive: boolean;
18
+ declare disabled: boolean;
19
+ declare padding: "none" | "small" | "medium" | "large";
20
+
21
+ constructor() {
22
+ super();
23
+ this.variant = "default";
24
+ this.elevation = 1;
25
+ this.interactive = false;
26
+ this.disabled = false;
27
+ this.padding = "medium";
28
+ }
29
+
30
+ static styles = css`
31
+ :host {
32
+ display: block;
33
+ box-sizing: border-box;
34
+ border-radius: calc(var(--025) * var(--sf, 1));
35
+ background-color: var(--card-background, var(--surface-color, #fff));
36
+ color: var(--text-color-primary);
37
+ transition:
38
+ box-shadow 0.2s ease,
39
+ transform 0.2s ease;
40
+ }
41
+
42
+ :host([variant="default"]) {
43
+ background-color: var(--card-background, var(--surface-color, #fff));
44
+ border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
45
+ }
46
+
47
+ :host([variant="outlined"]) {
48
+ background-color: transparent;
49
+ border: 1px solid var(--border-color, rgba(0, 0, 0, 0.2));
50
+ }
51
+
52
+ :host([variant="elevated"]) {
53
+ background-color: var(--card-background, var(--surface-color, #fff));
54
+ border: none;
55
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
56
+ }
57
+
58
+ :host([variant="filled"]) {
59
+ background-color: var(
60
+ --card-background-filled,
61
+ var(--surface-color-secondary, #f5f5f5)
62
+ );
63
+ border: none;
64
+ }
65
+
66
+ :host([elevation="0"]) {
67
+ box-shadow: none;
68
+ }
69
+
70
+ :host([elevation="1"]) {
71
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
72
+ }
73
+
74
+ :host([elevation="2"]) {
75
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
76
+ }
77
+
78
+ :host([elevation="3"]) {
79
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
80
+ }
81
+
82
+ :host([interactive]) {
83
+ cursor: pointer;
84
+ }
85
+
86
+ :host([interactive]:hover:not([disabled])) {
87
+ transform: translateY(-2px);
88
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
89
+ }
90
+
91
+ :host([interactive]:active:not([disabled])) {
92
+ transform: translateY(0);
93
+ }
94
+
95
+ :host([disabled]) {
96
+ opacity: 0.5;
97
+ pointer-events: none;
98
+ }
99
+
100
+ :host([padding="none"]) {
101
+ padding: 0;
102
+ }
103
+
104
+ :host([padding="small"]) {
105
+ padding: calc(var(--025) * var(--sf, 1));
106
+ }
107
+
108
+ :host([padding="medium"]) {
109
+ padding: calc(var(--05) * var(--sf, 1));
110
+ }
111
+
112
+ :host([padding="large"]) {
113
+ padding: calc(var(--1) * var(--sf, 1));
114
+ }
115
+
116
+ .card-content {
117
+ width: 100%;
118
+ height: 100%;
119
+ }
120
+ `;
121
+
122
+ render() {
123
+ return html`
124
+ <div class="card-content" part="content">
125
+ <slot></slot>
126
+ </div>
127
+ `;
128
+ }
129
+ }
130
+
131
+ customElements.define("ds-card", Card);
132
+
133
+ declare global {
134
+ interface HTMLElementTagNameMap {
135
+ "ds-card": Card;
136
+ }
137
+ }
@@ -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
  ];
@@ -186,9 +167,6 @@ export class Cycle extends LitElement {
186
167
 
187
168
  // Apply the accent color to ensure it's active
188
169
  applyAccentColor();
189
-
190
- // Set label
191
- this.label = this.getLabel();
192
170
  } else if (this.type === "notes-style-medium") {
193
171
  // Set up notes style medium cycling
194
172
  this.values = ["default", "big", "gallery"];
@@ -200,9 +178,6 @@ export class Cycle extends LitElement {
200
178
  // Check if this should be disabled based on note behavior
201
179
  const currentPageStyle = getPageStyle();
202
180
  this.disabled = currentPageStyle === "note";
203
-
204
- // Set label
205
- this.label = this.getLabel();
206
181
  } else if (this.type === "page-style") {
207
182
  // Set up page style cycling
208
183
  this.values = ["note", "page"];
@@ -210,18 +185,12 @@ export class Cycle extends LitElement {
210
185
  // Set initial value based on current page style
211
186
  const currentPageStyle = getPageStyle();
212
187
  this.currentValue = currentPageStyle;
213
-
214
- // Set label
215
- this.label = this.getLabel();
216
188
  } else if (this.type === "icon-only") {
217
189
  // Set up icon-only cycling (no label)
218
190
  this.values = ["note", "page"];
219
191
 
220
192
  // Set initial value
221
193
  this.currentValue = this.values[0];
222
-
223
- // No label for icon-only type
224
- this.label = "";
225
194
  }
226
195
 
227
196
  // Request update to re-render with new values
@@ -255,16 +224,10 @@ export class Cycle extends LitElement {
255
224
  // Get current language
256
225
  const currentLang = currentLanguage.value;
257
226
  this.currentValue = currentLang;
258
-
259
- // Update label
260
- this.label = this.getLabel();
261
227
  } else if (this.type === "theme") {
262
228
  // Get current theme
263
229
  const currentThemeValue = currentTheme.get();
264
230
  this.currentValue = currentThemeValue;
265
-
266
- // Update label
267
- this.label = this.getLabel();
268
231
  } else if (this.type === "accent-color") {
269
232
  // Get current accent color
270
233
  const currentAccentColor = getAccentColor();
@@ -272,9 +235,6 @@ export class Cycle extends LitElement {
272
235
 
273
236
  // Apply the accent color to ensure it's active
274
237
  applyAccentColor();
275
-
276
- // Update label
277
- this.label = this.getLabel();
278
238
  } else if (this.type === "notes-style-medium") {
279
239
  // Get current notes style medium
280
240
  const currentNotesStyle = getNotesStyleMedium();
@@ -283,23 +243,14 @@ export class Cycle extends LitElement {
283
243
  // Check if this should be disabled based on note behavior
284
244
  const currentPageStyle = getPageStyle();
285
245
  this.disabled = currentPageStyle === "note";
286
-
287
- // Update label
288
- this.label = this.getLabel();
289
246
  } else if (this.type === "page-style") {
290
247
  // Get current page style
291
248
  const currentPageStyle = getPageStyle();
292
249
  this.currentValue = currentPageStyle;
293
-
294
- // Update label
295
- this.label = this.getLabel();
296
250
  } else if (this.type === "icon-only") {
297
251
  // Get current page style for icon-only
298
252
  const currentPageStyle = getPageStyle();
299
253
  this.currentValue = currentPageStyle;
300
-
301
- // Update label
302
- this.label = "";
303
254
  }
304
255
 
305
256
  this.requestUpdate();
@@ -469,9 +420,6 @@ export class Cycle extends LitElement {
469
420
  // Save preferences
470
421
  savePreferences({ pageStyle: newIconOnlyValue });
471
422
 
472
- // No label update for icon-only type
473
- this.label = "";
474
-
475
423
  // Dispatch page style change event
476
424
  window.dispatchEvent(
477
425
  new CustomEvent("page-style-changed", {
@@ -480,9 +428,6 @@ export class Cycle extends LitElement {
480
428
  );
481
429
  }
482
430
 
483
- // Update label
484
- this.label = this.getLabel();
485
-
486
431
  // Request update to re-render
487
432
  this.requestUpdate();
488
433
  }
@@ -495,8 +440,8 @@ export class Cycle extends LitElement {
495
440
  } else if (this.type === "theme") {
496
441
  // Try to get translated theme name
497
442
  if (this.translationsReady) {
498
- const translatedName = translate(`themes.${value}`);
499
- if (translatedName && translatedName !== `themes.${value}`) {
443
+ const translatedName = translate(value);
444
+ if (translatedName && translatedName !== value) {
500
445
  return translatedName;
501
446
  }
502
447
  }
@@ -512,10 +457,10 @@ export class Cycle extends LitElement {
512
457
  } else if (this.type === "page-style") {
513
458
  // Return translated text for note behavior
514
459
  if (this.translationsReady) {
515
- const translatedText = translate(value === "note" ? "note" : "page");
460
+ const translatedText = translate(value === "note" ? "Note" : "Page");
516
461
  if (
517
462
  translatedText &&
518
- translatedText !== (value === "note" ? "note" : "page")
463
+ translatedText !== (value === "note" ? "Note" : "Page")
519
464
  ) {
520
465
  return translatedText;
521
466
  }
@@ -534,23 +479,39 @@ export class Cycle extends LitElement {
534
479
  return value;
535
480
  }
536
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
+
537
498
  getColorName(colorVar: string): string {
538
- // Map CSS variables to language keys
499
+ // Map CSS variables to translation text keys
539
500
  const colorMap: { [key: string]: string } = {
540
- "--red": "red",
541
- "--orange": "orange",
542
- "--yellow": "yellow",
543
- "--light-green": "lightGreen",
544
- "--green": "green",
545
- "--light-blue": "lightBlue",
546
- "--blue": "blue",
547
- "--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",
548
509
  };
549
510
 
550
- const languageKey = colorMap[colorVar];
551
- if (languageKey && this.translationsReady) {
552
- const translatedName = translate(languageKey);
553
- if (translatedName && translatedName !== languageKey) {
511
+ const translationText = colorMap[colorVar];
512
+ if (translationText && this.translationsReady) {
513
+ const translatedName = translate(translationText);
514
+ if (translatedName && translatedName !== translationText) {
554
515
  return translatedName;
555
516
  }
556
517
  }
@@ -574,117 +535,54 @@ export class Cycle extends LitElement {
574
535
  return html`<span>${style}</span>`;
575
536
  }
576
537
 
577
- getLabel(): string {
578
- if (this.type === "language") {
579
- // Try to get translated label
580
- if (this.translationsReady) {
581
- const translatedLabel = translate("language");
582
- if (translatedLabel && translatedLabel !== "language") {
583
- return translatedLabel;
584
- }
585
- }
586
-
587
- // Fall back to English
588
- return "Language";
589
- } else if (this.type === "theme") {
590
- // Try to get translated label
591
- if (this.translationsReady) {
592
- const translatedLabel = translate("theme");
593
- if (translatedLabel && translatedLabel !== "theme") {
594
- return translatedLabel;
595
- }
596
- }
597
-
598
- // Fall back to English
599
- return "Theme";
600
- } else if (this.type === "accent-color") {
601
- // Try to get translated label
602
- if (this.translationsReady) {
603
- const translatedLabel = translate("accentColor");
604
- if (translatedLabel && translatedLabel !== "accentColor") {
605
- return translatedLabel;
606
- }
607
- }
608
-
609
- // Fall back to English
610
- return "Accent Color";
611
- } else if (this.type === "notes-style-medium") {
612
- // Try to get translated label
613
- if (this.translationsReady) {
614
- const translatedLabel = translate("notesStyle");
615
- if (translatedLabel && translatedLabel !== "notesStyle") {
616
- return translatedLabel;
617
- }
618
- }
619
-
620
- // Fall back to English
621
- return "Notes Style";
622
- } else if (this.type === "page-style") {
623
- // Try to get translated label
624
- if (this.translationsReady) {
625
- const translatedLabel = translate("clickingItem");
626
- if (translatedLabel && translatedLabel !== "clickingItem") {
627
- return translatedLabel;
628
- }
629
- }
630
-
631
- // Fall back to English
632
- return "Clic";
633
- } else if (this.type === "icon-only") {
634
- // No label for icon-only type
635
- return "";
636
- }
637
-
638
- return this.label;
639
- }
640
-
641
538
  render() {
642
539
  return html`
643
- <div class="cycle-container">
644
- ${this.type !== "icon-only"
645
- ? 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"
646
555
  ? html`<ds-text
647
- key="language"
648
- default-value="Language"
649
- class="cycle-label"
556
+ default-value=${this.getValueDisplay(this.currentValue)}
650
557
  ></ds-text>`
651
558
  : this.type === "theme"
652
559
  ? html`<ds-text
653
- key="theme"
654
- default-value="Theme"
655
- class="cycle-label"
560
+ text=${this.currentValue}
561
+ default-value=${this.currentValue}
656
562
  ></ds-text>`
657
- : html`<span class="cycle-label">${this.label}</span>`}`
563
+ : this.type === "accent-color"
564
+ ? html`<ds-text
565
+ text=${this.getColorKey(this.currentValue)}
566
+ default-value=${this.getColorName(this.currentValue)}
567
+ ></ds-text>`
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