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.
- package/DS1/0-face/device.ts +138 -0
- package/DS1/0-face/i18n.ts +36 -89
- package/DS1/0-face/scaling.ts +152 -0
- package/DS1/1-root/fonts/Iosevka-Regular.woff2 +0 -0
- package/DS1/1-root/one.css +124 -77
- package/DS1/2-core/ds-banner.ts +120 -1
- package/DS1/2-core/ds-button.ts +16 -96
- package/DS1/2-core/ds-card.ts +137 -0
- package/DS1/2-core/ds-cycle.ts +82 -184
- package/DS1/2-core/ds-date.ts +3 -10
- package/DS1/2-core/ds-gap.ts +38 -0
- package/DS1/2-core/ds-icon.ts +6 -35
- package/DS1/2-core/ds-input.ts +306 -1
- package/DS1/2-core/ds-pagedots.ts +52 -0
- package/DS1/2-core/ds-text.ts +55 -28
- package/DS1/2-core/ds-tooltip.ts +14 -66
- package/DS1/2-core/styles/ds-banner.css +77 -0
- package/DS1/2-core/styles/ds-button.css +67 -0
- package/DS1/2-core/styles/ds-cycle.css +21 -0
- package/DS1/2-core/styles/ds-date.css +9 -0
- package/DS1/2-core/styles/ds-gap.css +93 -0
- package/DS1/2-core/styles/ds-icon.css +30 -0
- package/DS1/2-core/styles/ds-input.css +46 -0
- package/DS1/2-core/styles/ds-pagedots.css +31 -0
- package/DS1/2-core/styles/ds-text.css +29 -0
- package/DS1/2-core/styles/ds-tooltip.css +49 -0
- package/DS1/3-unit/ds-accordion.ts +95 -0
- package/DS1/3-unit/ds-form.ts +304 -0
- package/DS1/3-unit/ds-list.ts +5 -14
- package/DS1/3-unit/ds-row.ts +3 -19
- package/DS1/3-unit/ds-table.ts +3 -86
- package/DS1/3-unit/styles/ds-accordion.css +46 -0
- package/DS1/3-unit/styles/ds-list.css +9 -0
- package/DS1/3-unit/styles/ds-row.css +19 -0
- package/DS1/3-unit/styles/ds-table.css +80 -0
- package/DS1/4-page/ds-container.ts +28 -0
- package/DS1/4-page/ds-grid.ts +37 -50
- package/DS1/4-page/ds-layout.ts +652 -163
- package/DS1/4-page/styles/ds-container.css +35 -0
- package/DS1/4-page/styles/ds-grid.css +56 -0
- package/DS1/4-page/styles/ds-layout.css +246 -0
- package/DS1/index.ts +9 -1
- package/DS1/vite-env.d.ts +13 -0
- package/DS1/x-icon/2x.svg +4 -0
- package/DS1/x-icon/2xdots.svg +18 -0
- package/DS1/x-icon/2xgrid.svg +6 -0
- package/DS1/x-icon/2xlines.svg +6 -0
- package/DS1/x-icon/4x4.svg +18 -0
- package/DS1/x-icon/apple.svg +4 -0
- package/DS1/x-icon/avatar.svg +4 -0
- package/DS1/x-icon/big.svg +4 -0
- package/DS1/x-icon/blank.svg +3 -0
- package/DS1/x-icon/check.svg +3 -0
- package/DS1/x-icon/close.svg +3 -0
- package/DS1/x-icon/collapse.svg +3 -0
- package/DS1/x-icon/color.svg +4 -0
- package/DS1/x-icon/column.svg +5 -0
- package/DS1/x-icon/default.svg +3 -0
- package/DS1/x-icon/delete.svg +5 -0
- package/DS1/x-icon/dictate.svg +6 -0
- package/DS1/x-icon/do.svg +3 -0
- package/DS1/x-icon/down.svg +3 -0
- package/DS1/x-icon/duplicate.svg +4 -0
- package/DS1/x-icon/gallery.svg +5 -0
- package/DS1/x-icon/google.svg +6 -0
- package/DS1/x-icon/head.svg +5 -0
- package/DS1/x-icon/home.svg +3 -0
- package/DS1/x-icon/icon.svg +4 -0
- package/DS1/x-icon/in.svg +4 -0
- package/DS1/x-icon/lock.svg +5 -0
- package/DS1/x-icon/loop.svg +5 -0
- package/DS1/x-icon/mic.svg +5 -0
- package/DS1/x-icon/minimize.svg +3 -0
- package/DS1/x-icon/more.svg +5 -0
- package/DS1/x-icon/neutral.svg +6 -0
- package/DS1/x-icon/note.svg +6 -0
- package/DS1/x-icon/page.svg +4 -0
- package/DS1/x-icon/plus.svg +3 -0
- package/DS1/x-icon/rewind.svg +4 -0
- package/DS1/x-icon/row.svg +5 -0
- package/DS1/x-icon/sdown.svg +3 -0
- package/DS1/x-icon/search.svg +4 -0
- package/DS1/x-icon/see.svg +4 -0
- package/DS1/x-icon/ship.svg +5 -0
- package/DS1/x-icon/star.svg +3 -0
- package/DS1/x-icon/status.svg +4 -0
- package/DS1/x-icon/sup.svg +3 -0
- package/DS1/x-icon/title.svg +3 -0
- package/DS1/x-icon/undo.svg +3 -0
- package/DS1/x-icon/ungroup.svg +4 -0
- package/DS1/x-icon/unhead.svg +3 -0
- package/DS1/x-icon/unicon.svg +3 -0
- package/DS1/x-icon/unlock.svg +5 -0
- package/DS1/x-icon/unmic.svg +6 -0
- package/DS1/x-icon/unsee.svg +5 -0
- package/DS1/x-icon/unstar.svg +3 -0
- package/DS1/x-icon/untitle.svg +3 -0
- package/DS1/x-icon/up.svg +3 -0
- package/LICENSE +1 -1
- package/README.md +4 -4
- package/dist/0-face/device.d.ts +5 -0
- package/dist/0-face/device.d.ts.map +1 -1
- package/dist/0-face/device.js +111 -0
- package/dist/0-face/i18n.d.ts +0 -2
- package/dist/0-face/i18n.d.ts.map +1 -1
- package/dist/0-face/i18n.js +36 -73
- package/dist/0-face/scaling.d.ts +48 -0
- package/dist/0-face/scaling.d.ts.map +1 -0
- package/dist/0-face/scaling.js +114 -0
- package/dist/2-core/ds-banner.d.ts +67 -0
- package/dist/2-core/ds-banner.d.ts.map +1 -1
- package/dist/2-core/ds-banner.js +97 -1
- package/dist/2-core/ds-button.d.ts +4 -20
- package/dist/2-core/ds-button.d.ts.map +1 -1
- package/dist/2-core/ds-button.js +14 -88
- package/dist/2-core/ds-card.d.ts +39 -0
- package/dist/2-core/ds-card.d.ts.map +1 -0
- package/dist/2-core/ds-card.js +119 -0
- package/dist/2-core/ds-cycle.d.ts +1 -5
- package/dist/2-core/ds-cycle.d.ts.map +1 -1
- package/dist/2-core/ds-cycle.js +79 -166
- package/dist/2-core/ds-date.d.ts.map +1 -1
- package/dist/2-core/ds-date.js +3 -9
- package/dist/2-core/ds-gap.d.ts +28 -0
- package/dist/2-core/ds-gap.d.ts.map +1 -0
- package/dist/2-core/ds-gap.js +25 -0
- package/dist/2-core/ds-icon.d.ts.map +1 -1
- package/dist/2-core/ds-icon.js +6 -35
- package/dist/2-core/ds-input.d.ts +127 -0
- package/dist/2-core/ds-input.d.ts.map +1 -1
- package/dist/2-core/ds-input.js +252 -1
- package/dist/2-core/ds-pagedots.d.ts +32 -0
- package/dist/2-core/ds-pagedots.d.ts.map +1 -0
- package/dist/2-core/ds-pagedots.js +36 -0
- package/dist/2-core/ds-text.d.ts +5 -3
- package/dist/2-core/ds-text.d.ts.map +1 -1
- package/dist/2-core/ds-text.js +49 -27
- package/dist/2-core/ds-tooltip.d.ts +3 -3
- package/dist/2-core/ds-tooltip.d.ts.map +1 -1
- package/dist/2-core/ds-tooltip.js +13 -65
- package/dist/2-core/styles/ds-banner.css +77 -0
- package/dist/2-core/styles/ds-button.css +67 -0
- package/dist/2-core/styles/ds-cycle.css +21 -0
- package/dist/2-core/styles/ds-date.css +9 -0
- package/dist/2-core/styles/ds-gap.css +93 -0
- package/dist/2-core/styles/ds-icon.css +30 -0
- package/dist/2-core/styles/ds-input.css +46 -0
- package/dist/2-core/styles/ds-pagedots.css +26 -0
- package/dist/2-core/styles/ds-text.css +29 -0
- package/dist/2-core/styles/ds-tooltip.css +49 -0
- package/dist/3-unit/ds-accordion.d.ts +47 -0
- package/dist/3-unit/ds-accordion.d.ts.map +1 -0
- package/dist/3-unit/ds-accordion.js +75 -0
- package/dist/3-unit/ds-form.d.ts +70 -0
- package/dist/3-unit/ds-form.d.ts.map +1 -0
- package/dist/3-unit/ds-form.js +232 -0
- package/dist/3-unit/ds-list.d.ts.map +1 -1
- package/dist/3-unit/ds-list.js +5 -11
- package/dist/3-unit/ds-row.d.ts.map +1 -1
- package/dist/3-unit/ds-row.js +3 -19
- package/dist/3-unit/ds-table.d.ts.map +1 -1
- package/dist/3-unit/ds-table.js +3 -86
- package/dist/3-unit/styles/ds-accordion.css +46 -0
- package/dist/3-unit/styles/ds-list.css +9 -0
- package/dist/3-unit/styles/ds-row.css +19 -0
- package/dist/3-unit/styles/ds-table.css +80 -0
- package/dist/{3-unit/row-v1.d.ts → 4-page/ds-container.d.ts} +3 -11
- package/dist/4-page/ds-container.d.ts.map +1 -0
- package/dist/4-page/ds-container.js +11 -0
- package/dist/4-page/ds-grid.d.ts +5 -0
- package/dist/4-page/ds-grid.d.ts.map +1 -1
- package/dist/4-page/ds-grid.js +38 -56
- package/dist/4-page/ds-layout.d.ts +3 -3
- package/dist/4-page/ds-layout.d.ts.map +1 -1
- package/dist/4-page/ds-layout.js +651 -162
- package/dist/4-page/styles/ds-container.css +35 -0
- package/dist/4-page/styles/ds-grid.css +56 -0
- package/dist/4-page/styles/ds-layout.css +251 -0
- package/dist/ds-one.bundle.css +700 -0
- package/dist/ds-one.bundle.css.map +7 -0
- package/dist/ds-one.bundle.js +2728 -1597
- package/dist/ds-one.bundle.js.map +1 -7
- package/dist/ds-one.bundle.min.css +2 -0
- package/dist/ds-one.bundle.min.css.map +7 -0
- package/dist/ds-one.bundle.min.js +3850 -546
- package/dist/ds-one.bundle.min.js.map +1 -7
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/package.json +4 -3
- package/dist/3-unit/doublenav-v1.d.ts +0 -51
- package/dist/3-unit/doublenav-v1.d.ts.map +0 -1
- package/dist/3-unit/doublenav-v1.js +0 -88
- package/dist/3-unit/ds-portfolio-doublenav.d.ts +0 -51
- package/dist/3-unit/ds-portfolio-doublenav.d.ts.map +0 -1
- package/dist/3-unit/ds-portfolio-doublenav.js +0 -88
- package/dist/3-unit/ds-portfolio-panel.d.ts +0 -11
- package/dist/3-unit/ds-portfolio-panel.d.ts.map +0 -1
- package/dist/3-unit/ds-portfolio-panel.js +0 -16
- package/dist/3-unit/ds-portfolio-singlenav.d.ts +0 -32
- package/dist/3-unit/ds-portfolio-singlenav.d.ts.map +0 -1
- package/dist/3-unit/ds-portfolio-singlenav.js +0 -62
- package/dist/3-unit/list-v1.d.ts +0 -11
- package/dist/3-unit/list-v1.d.ts.map +0 -1
- package/dist/3-unit/list-v1.js +0 -15
- package/dist/3-unit/panel-v1.d.ts +0 -11
- package/dist/3-unit/panel-v1.d.ts.map +0 -1
- package/dist/3-unit/panel-v1.js +0 -16
- package/dist/3-unit/row-v1.d.ts.map +0 -1
- package/dist/3-unit/row-v1.js +0 -32
- package/dist/3-unit/singlenav-v1.d.ts +0 -32
- package/dist/3-unit/singlenav-v1.d.ts.map +0 -1
- package/dist/3-unit/singlenav-v1.js +0 -62
package/dist/2-core/ds-cycle.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { LitElement, html,
|
|
1
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { translate, currentLanguage, getAvailableLanguagesSync, getLanguageDisplayName, setLanguage, } from "../0-face/i18n";
|
|
3
3
|
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
7
|
import "./ds-text";
|
|
8
|
+
import styles from "./styles/ds-cycle.css?inline";
|
|
8
9
|
// Accent color utilities
|
|
9
10
|
const saveAccentColor = (color) => {
|
|
10
11
|
localStorage.setItem("accentColor", color);
|
|
11
12
|
};
|
|
12
13
|
const getAccentColor = () => {
|
|
13
|
-
return localStorage.getItem("accentColor") || "--blue"; // Default color if none set
|
|
14
|
+
return localStorage.getItem("accentColor") || "--sharp-blue"; // Default color if none set
|
|
14
15
|
};
|
|
15
16
|
const applyAccentColor = () => {
|
|
16
17
|
const color = getAccentColor();
|
|
@@ -38,7 +39,6 @@ export class Cycle extends LitElement {
|
|
|
38
39
|
return {
|
|
39
40
|
type: { type: String },
|
|
40
41
|
values: { type: Array },
|
|
41
|
-
label: { type: String },
|
|
42
42
|
currentValue: { type: String, state: true }, // Make this a private state property
|
|
43
43
|
translationsReady: { type: Boolean, state: true }, // Track if translations are loaded
|
|
44
44
|
disabled: { type: Boolean, state: true },
|
|
@@ -50,7 +50,6 @@ export class Cycle extends LitElement {
|
|
|
50
50
|
// Initialize properties with default values
|
|
51
51
|
this.type = "";
|
|
52
52
|
this.values = [];
|
|
53
|
-
this.label = "";
|
|
54
53
|
this.currentValue = "";
|
|
55
54
|
this.translationsReady = false;
|
|
56
55
|
this.disabled = false;
|
|
@@ -82,8 +81,6 @@ export class Cycle extends LitElement {
|
|
|
82
81
|
const availableLanguages = getAvailableLanguagesSync();
|
|
83
82
|
this.values = availableLanguages;
|
|
84
83
|
this.currentValue = currentLanguage.value;
|
|
85
|
-
// Set label
|
|
86
|
-
this.label = this.getLabel();
|
|
87
84
|
}
|
|
88
85
|
else if (this.type === "theme") {
|
|
89
86
|
// Set up theme cycling
|
|
@@ -91,18 +88,16 @@ export class Cycle extends LitElement {
|
|
|
91
88
|
// Set initial value based on current theme
|
|
92
89
|
const currentThemeValue = currentTheme.get();
|
|
93
90
|
this.currentValue = currentThemeValue;
|
|
94
|
-
// Set label
|
|
95
|
-
this.label = this.getLabel();
|
|
96
91
|
}
|
|
97
92
|
else if (this.type === "accent-color") {
|
|
98
93
|
// Set up accent color cycling
|
|
99
94
|
this.values = [
|
|
100
|
-
"--
|
|
101
|
-
"--green",
|
|
102
|
-
"--
|
|
103
|
-
"--blue",
|
|
95
|
+
"--apple-green",
|
|
96
|
+
"--every-green",
|
|
97
|
+
"--zenith-blue",
|
|
98
|
+
"--sharp-blue",
|
|
104
99
|
"--pink",
|
|
105
|
-
"--red",
|
|
100
|
+
"--tuned-red",
|
|
106
101
|
"--orange",
|
|
107
102
|
"--yellow",
|
|
108
103
|
];
|
|
@@ -111,8 +106,6 @@ export class Cycle extends LitElement {
|
|
|
111
106
|
this.currentValue = currentAccentColor;
|
|
112
107
|
// Apply the accent color to ensure it's active
|
|
113
108
|
applyAccentColor();
|
|
114
|
-
// Set label
|
|
115
|
-
this.label = this.getLabel();
|
|
116
109
|
}
|
|
117
110
|
else if (this.type === "notes-style-medium") {
|
|
118
111
|
// Set up notes style medium cycling
|
|
@@ -123,8 +116,6 @@ export class Cycle extends LitElement {
|
|
|
123
116
|
// Check if this should be disabled based on note behavior
|
|
124
117
|
const currentPageStyle = getPageStyle();
|
|
125
118
|
this.disabled = currentPageStyle === "note";
|
|
126
|
-
// Set label
|
|
127
|
-
this.label = this.getLabel();
|
|
128
119
|
}
|
|
129
120
|
else if (this.type === "page-style") {
|
|
130
121
|
// Set up page style cycling
|
|
@@ -132,16 +123,12 @@ export class Cycle extends LitElement {
|
|
|
132
123
|
// Set initial value based on current page style
|
|
133
124
|
const currentPageStyle = getPageStyle();
|
|
134
125
|
this.currentValue = currentPageStyle;
|
|
135
|
-
// Set label
|
|
136
|
-
this.label = this.getLabel();
|
|
137
126
|
}
|
|
138
127
|
else if (this.type === "icon-only") {
|
|
139
128
|
// Set up icon-only cycling (no label)
|
|
140
129
|
this.values = ["note", "page"];
|
|
141
130
|
// Set initial value
|
|
142
131
|
this.currentValue = this.values[0];
|
|
143
|
-
// No label for icon-only type
|
|
144
|
-
this.label = "";
|
|
145
132
|
}
|
|
146
133
|
// Request update to re-render with new values
|
|
147
134
|
this.requestUpdate();
|
|
@@ -168,15 +155,11 @@ export class Cycle extends LitElement {
|
|
|
168
155
|
// Get current language
|
|
169
156
|
const currentLang = currentLanguage.value;
|
|
170
157
|
this.currentValue = currentLang;
|
|
171
|
-
// Update label
|
|
172
|
-
this.label = this.getLabel();
|
|
173
158
|
}
|
|
174
159
|
else if (this.type === "theme") {
|
|
175
160
|
// Get current theme
|
|
176
161
|
const currentThemeValue = currentTheme.get();
|
|
177
162
|
this.currentValue = currentThemeValue;
|
|
178
|
-
// Update label
|
|
179
|
-
this.label = this.getLabel();
|
|
180
163
|
}
|
|
181
164
|
else if (this.type === "accent-color") {
|
|
182
165
|
// Get current accent color
|
|
@@ -184,8 +167,6 @@ export class Cycle extends LitElement {
|
|
|
184
167
|
this.currentValue = currentAccentColor;
|
|
185
168
|
// Apply the accent color to ensure it's active
|
|
186
169
|
applyAccentColor();
|
|
187
|
-
// Update label
|
|
188
|
-
this.label = this.getLabel();
|
|
189
170
|
}
|
|
190
171
|
else if (this.type === "notes-style-medium") {
|
|
191
172
|
// Get current notes style medium
|
|
@@ -194,22 +175,16 @@ export class Cycle extends LitElement {
|
|
|
194
175
|
// Check if this should be disabled based on note behavior
|
|
195
176
|
const currentPageStyle = getPageStyle();
|
|
196
177
|
this.disabled = currentPageStyle === "note";
|
|
197
|
-
// Update label
|
|
198
|
-
this.label = this.getLabel();
|
|
199
178
|
}
|
|
200
179
|
else if (this.type === "page-style") {
|
|
201
180
|
// Get current page style
|
|
202
181
|
const currentPageStyle = getPageStyle();
|
|
203
182
|
this.currentValue = currentPageStyle;
|
|
204
|
-
// Update label
|
|
205
|
-
this.label = this.getLabel();
|
|
206
183
|
}
|
|
207
184
|
else if (this.type === "icon-only") {
|
|
208
185
|
// Get current page style for icon-only
|
|
209
186
|
const currentPageStyle = getPageStyle();
|
|
210
187
|
this.currentValue = currentPageStyle;
|
|
211
|
-
// Update label
|
|
212
|
-
this.label = "";
|
|
213
188
|
}
|
|
214
189
|
this.requestUpdate();
|
|
215
190
|
}
|
|
@@ -330,15 +305,11 @@ export class Cycle extends LitElement {
|
|
|
330
305
|
savePageStyle(newIconOnlyValue);
|
|
331
306
|
// Save preferences
|
|
332
307
|
savePreferences({ pageStyle: newIconOnlyValue });
|
|
333
|
-
// No label update for icon-only type
|
|
334
|
-
this.label = "";
|
|
335
308
|
// Dispatch page style change event
|
|
336
309
|
window.dispatchEvent(new CustomEvent("page-style-changed", {
|
|
337
310
|
detail: { behavior: newIconOnlyValue },
|
|
338
311
|
}));
|
|
339
312
|
}
|
|
340
|
-
// Update label
|
|
341
|
-
this.label = this.getLabel();
|
|
342
313
|
// Request update to re-render
|
|
343
314
|
this.requestUpdate();
|
|
344
315
|
}
|
|
@@ -351,8 +322,8 @@ export class Cycle extends LitElement {
|
|
|
351
322
|
else if (this.type === "theme") {
|
|
352
323
|
// Try to get translated theme name
|
|
353
324
|
if (this.translationsReady) {
|
|
354
|
-
const translatedName = translate(
|
|
355
|
-
if (translatedName && translatedName !==
|
|
325
|
+
const translatedName = translate(value);
|
|
326
|
+
if (translatedName && translatedName !== value) {
|
|
356
327
|
return translatedName;
|
|
357
328
|
}
|
|
358
329
|
}
|
|
@@ -370,9 +341,9 @@ export class Cycle extends LitElement {
|
|
|
370
341
|
else if (this.type === "page-style") {
|
|
371
342
|
// Return translated text for note behavior
|
|
372
343
|
if (this.translationsReady) {
|
|
373
|
-
const translatedText = translate(value === "note" ? "
|
|
344
|
+
const translatedText = translate(value === "note" ? "Note" : "Page");
|
|
374
345
|
if (translatedText &&
|
|
375
|
-
translatedText !== (value === "note" ? "
|
|
346
|
+
translatedText !== (value === "note" ? "Note" : "Page")) {
|
|
376
347
|
return translatedText;
|
|
377
348
|
}
|
|
378
349
|
}
|
|
@@ -390,22 +361,36 @@ export class Cycle extends LitElement {
|
|
|
390
361
|
}
|
|
391
362
|
return value;
|
|
392
363
|
}
|
|
364
|
+
getColorKey(colorVar) {
|
|
365
|
+
// Map CSS variables to translation text keys
|
|
366
|
+
const colorMap = {
|
|
367
|
+
"--tuned-red": "Red",
|
|
368
|
+
"--orange": "Orange",
|
|
369
|
+
"--yellow": "Yellow",
|
|
370
|
+
"--apple-green": "Apple green",
|
|
371
|
+
"--every-green": "Green",
|
|
372
|
+
"--zenith-blue": "Light blue",
|
|
373
|
+
"--sharp-blue": "Blue",
|
|
374
|
+
"--pink": "Pink",
|
|
375
|
+
};
|
|
376
|
+
return colorMap[colorVar] || colorVar.replace("--", "").replace("-", " ");
|
|
377
|
+
}
|
|
393
378
|
getColorName(colorVar) {
|
|
394
|
-
// Map CSS variables to
|
|
379
|
+
// Map CSS variables to translation text keys
|
|
395
380
|
const colorMap = {
|
|
396
|
-
"--red": "
|
|
397
|
-
"--orange": "
|
|
398
|
-
"--yellow": "
|
|
399
|
-
"--
|
|
400
|
-
"--green": "
|
|
401
|
-
"--
|
|
402
|
-
"--blue": "
|
|
403
|
-
"--pink": "
|
|
381
|
+
"--tuned-red": "Red",
|
|
382
|
+
"--orange": "Orange",
|
|
383
|
+
"--yellow": "Yellow",
|
|
384
|
+
"--apple-green": "Apple green",
|
|
385
|
+
"--every-green": "Green",
|
|
386
|
+
"--zenith-blue": "Light blue",
|
|
387
|
+
"--sharp-blue": "Blue",
|
|
388
|
+
"--pink": "Pink",
|
|
404
389
|
};
|
|
405
|
-
const
|
|
406
|
-
if (
|
|
407
|
-
const translatedName = translate(
|
|
408
|
-
if (translatedName && translatedName !==
|
|
390
|
+
const translationText = colorMap[colorVar];
|
|
391
|
+
if (translationText && this.translationsReady) {
|
|
392
|
+
const translatedName = translate(translationText);
|
|
393
|
+
if (translatedName && translatedName !== translationText) {
|
|
409
394
|
return translatedName;
|
|
410
395
|
}
|
|
411
396
|
}
|
|
@@ -430,115 +415,54 @@ export class Cycle extends LitElement {
|
|
|
430
415
|
}
|
|
431
416
|
return html `<span>${style}</span>`;
|
|
432
417
|
}
|
|
433
|
-
getLabel() {
|
|
434
|
-
if (this.type === "language") {
|
|
435
|
-
// Try to get translated label
|
|
436
|
-
if (this.translationsReady) {
|
|
437
|
-
const translatedLabel = translate("language");
|
|
438
|
-
if (translatedLabel && translatedLabel !== "language") {
|
|
439
|
-
return translatedLabel;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
// Fall back to English
|
|
443
|
-
return "Language";
|
|
444
|
-
}
|
|
445
|
-
else if (this.type === "theme") {
|
|
446
|
-
// Try to get translated label
|
|
447
|
-
if (this.translationsReady) {
|
|
448
|
-
const translatedLabel = translate("theme");
|
|
449
|
-
if (translatedLabel && translatedLabel !== "theme") {
|
|
450
|
-
return translatedLabel;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
// Fall back to English
|
|
454
|
-
return "Theme";
|
|
455
|
-
}
|
|
456
|
-
else if (this.type === "accent-color") {
|
|
457
|
-
// Try to get translated label
|
|
458
|
-
if (this.translationsReady) {
|
|
459
|
-
const translatedLabel = translate("accentColor");
|
|
460
|
-
if (translatedLabel && translatedLabel !== "accentColor") {
|
|
461
|
-
return translatedLabel;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
// Fall back to English
|
|
465
|
-
return "Accent Color";
|
|
466
|
-
}
|
|
467
|
-
else if (this.type === "notes-style-medium") {
|
|
468
|
-
// Try to get translated label
|
|
469
|
-
if (this.translationsReady) {
|
|
470
|
-
const translatedLabel = translate("notesStyle");
|
|
471
|
-
if (translatedLabel && translatedLabel !== "notesStyle") {
|
|
472
|
-
return translatedLabel;
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
// Fall back to English
|
|
476
|
-
return "Notes Style";
|
|
477
|
-
}
|
|
478
|
-
else if (this.type === "page-style") {
|
|
479
|
-
// Try to get translated label
|
|
480
|
-
if (this.translationsReady) {
|
|
481
|
-
const translatedLabel = translate("clickingItem");
|
|
482
|
-
if (translatedLabel && translatedLabel !== "clickingItem") {
|
|
483
|
-
return translatedLabel;
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
// Fall back to English
|
|
487
|
-
return "Clic";
|
|
488
|
-
}
|
|
489
|
-
else if (this.type === "icon-only") {
|
|
490
|
-
// No label for icon-only type
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
return this.label;
|
|
494
|
-
}
|
|
495
418
|
render() {
|
|
496
419
|
return html `
|
|
497
|
-
<div class="cycle
|
|
498
|
-
|
|
499
|
-
|
|
420
|
+
<div class="cycle">
|
|
421
|
+
<ds-button
|
|
422
|
+
variant=${this.variant ||
|
|
423
|
+
(this.type === "language" || this.type === "theme"
|
|
424
|
+
? "secondary"
|
|
425
|
+
: "primary")}
|
|
426
|
+
?disabled=${this.disabled}
|
|
427
|
+
@click=${this.handleButtonClick}
|
|
428
|
+
>
|
|
429
|
+
${this.type === "notes-style-medium" || this.type === "icon-only"
|
|
430
|
+
? html `<span
|
|
431
|
+
style="display: inline-flex; align-items: center; gap: var(--025)"
|
|
432
|
+
>${this.getValueDisplay(this.currentValue)}</span
|
|
433
|
+
>`
|
|
434
|
+
: this.type === "language"
|
|
500
435
|
? html `<ds-text
|
|
501
|
-
|
|
502
|
-
default-value="Language"
|
|
503
|
-
class="cycle-label"
|
|
436
|
+
default-value=${this.getValueDisplay(this.currentValue)}
|
|
504
437
|
></ds-text>`
|
|
505
438
|
: this.type === "theme"
|
|
506
439
|
? html `<ds-text
|
|
507
|
-
|
|
508
|
-
default-value
|
|
509
|
-
class="cycle-label"
|
|
440
|
+
text=${this.currentValue}
|
|
441
|
+
default-value=${this.currentValue}
|
|
510
442
|
></ds-text>`
|
|
511
|
-
:
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
? html `<span
|
|
528
|
-
style="display: inline-flex; align-items: center; gap: var(--025)"
|
|
529
|
-
>${this.getValueDisplay(this.currentValue)}</span
|
|
530
|
-
>`
|
|
531
|
-
: html `<span>${this.getValueDisplay(this.currentValue)}</span>`}
|
|
532
|
-
</ds-button>
|
|
533
|
-
${this.type === "accent-color"
|
|
443
|
+
: this.type === "accent-color"
|
|
444
|
+
? html `<ds-text
|
|
445
|
+
text=${this.getColorKey(this.currentValue)}
|
|
446
|
+
default-value=${this.getColorName(this.currentValue)}
|
|
447
|
+
></ds-text>`
|
|
448
|
+
: this.type === "page-style"
|
|
449
|
+
? html `<ds-text
|
|
450
|
+
text=${this.currentValue === "note" ? "Note" : "Page"}
|
|
451
|
+
default-value=${this.currentValue}
|
|
452
|
+
></ds-text>`
|
|
453
|
+
: html `<ds-text
|
|
454
|
+
default-value=${this.getValueDisplay(this.currentValue)}
|
|
455
|
+
></ds-text>`}
|
|
456
|
+
</ds-button>
|
|
457
|
+
|
|
458
|
+
${this.type === "accent-color"
|
|
534
459
|
? html `
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
460
|
+
<div
|
|
461
|
+
class="color-preview"
|
|
462
|
+
style="background-color: var(${this.currentValue})"
|
|
463
|
+
></div>
|
|
464
|
+
`
|
|
540
465
|
: ""}
|
|
541
|
-
</div>
|
|
542
466
|
</div>
|
|
543
467
|
`;
|
|
544
468
|
}
|
|
@@ -584,16 +508,5 @@ export class Cycle extends LitElement {
|
|
|
584
508
|
this.setupInitialValue();
|
|
585
509
|
}
|
|
586
510
|
}
|
|
587
|
-
Cycle.styles =
|
|
588
|
-
.cycle-container {
|
|
589
|
-
display: flex;
|
|
590
|
-
justify-content: space-between;
|
|
591
|
-
gap: var(--025);
|
|
592
|
-
width: 100%;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
.cycle-label {
|
|
596
|
-
color: var(--text-color-primary);
|
|
597
|
-
}
|
|
598
|
-
`;
|
|
511
|
+
Cycle.styles = unsafeCSS(styles);
|
|
599
512
|
customElements.define("ds-cycle", Cycle);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-date.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"ds-date.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAGlD;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,0BAAqB;IAElC,MAAM;CAIP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,aAAa,CAAC;KAC1B;CACF"}
|
package/dist/2-core/ds-date.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { LitElement, html,
|
|
1
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
+
import styles from "./styles/ds-date.css?inline";
|
|
2
3
|
/**
|
|
3
4
|
* A component for displaying the current year
|
|
4
5
|
*
|
|
@@ -10,12 +11,5 @@ export class DateComponent extends LitElement {
|
|
|
10
11
|
return html `<span>${year}</span>`;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
DateComponent.styles =
|
|
14
|
-
:host {
|
|
15
|
-
display: inline;
|
|
16
|
-
font-family: var(--typeface, var(--typeface-regular));
|
|
17
|
-
font-size: inherit;
|
|
18
|
-
color: inherit;
|
|
19
|
-
}
|
|
20
|
-
`;
|
|
14
|
+
DateComponent.styles = unsafeCSS(styles);
|
|
21
15
|
customElements.define("ds-date", DateComponent);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* Full-width vertical spacer.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* - <ds-gap unit></ds-gap>
|
|
7
|
+
* - <ds-gap double></ds-gap>
|
|
8
|
+
* - <ds-gap size="05"></ds-gap>
|
|
9
|
+
*/
|
|
10
|
+
export declare class Gap extends LitElement {
|
|
11
|
+
static properties: {
|
|
12
|
+
/** Raw scale token selector ("01", "025", "05", "08", "1", "2", "3", "4", "8", "12") */
|
|
13
|
+
size: {
|
|
14
|
+
type: StringConstructor;
|
|
15
|
+
reflect: boolean;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
size: string;
|
|
19
|
+
constructor();
|
|
20
|
+
static styles: import("lit").CSSResult;
|
|
21
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
22
|
+
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface HTMLElementTagNameMap {
|
|
25
|
+
"ds-gap": Gap;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ds-gap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-gap.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-gap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,KAAK,CAAC;AAGlD;;;;;;;GAOG;AACH,qBAAa,GAAI,SAAQ,UAAU;IACjC,MAAM,CAAC,UAAU;QACf,wFAAwF;;;;;MAExF;IAEM,IAAI,EAAE,MAAM,CAAC;;IAOrB,MAAM,CAAC,MAAM,0BAAqB;IAElC,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,GAAG,CAAC;KACf;CACF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
|
+
import styles from "./styles/ds-gap.css?inline";
|
|
3
|
+
/**
|
|
4
|
+
* Full-width vertical spacer.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* - <ds-gap unit></ds-gap>
|
|
8
|
+
* - <ds-gap double></ds-gap>
|
|
9
|
+
* - <ds-gap size="05"></ds-gap>
|
|
10
|
+
*/
|
|
11
|
+
export class Gap extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.size = "";
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html ``;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
Gap.properties = {
|
|
21
|
+
/** Raw scale token selector ("01", "025", "05", "08", "1", "2", "3", "4", "8", "12") */
|
|
22
|
+
size: { type: String, reflect: true },
|
|
23
|
+
};
|
|
24
|
+
Gap.styles = unsafeCSS(styles);
|
|
25
|
+
customElements.define("ds-gap", Gap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ds-icon.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"ds-icon.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-icon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAIvE,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,0BAAqB;IAIlC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CA0BnC;;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"}
|
package/dist/2-core/ds-icon.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement, html,
|
|
1
|
+
import { LitElement, html, unsafeCSS } from "lit";
|
|
2
2
|
import { unsafeHTML } from "lit/directives/unsafe-html.js";
|
|
3
|
+
import styles from "./styles/ds-icon.css?inline";
|
|
3
4
|
export class Icon extends LitElement {
|
|
4
5
|
get type() {
|
|
5
6
|
return this._type;
|
|
@@ -235,45 +236,15 @@ export class Icon extends LitElement {
|
|
|
235
236
|
Icon.properties = {
|
|
236
237
|
type: { type: String, reflect: true },
|
|
237
238
|
};
|
|
238
|
-
Icon.styles =
|
|
239
|
-
:host {
|
|
240
|
-
display: inline-flex;
|
|
241
|
-
justify-content: center;
|
|
242
|
-
align-items: center;
|
|
243
|
-
width: calc(16px * var(--sf));
|
|
244
|
-
height: calc(16px * var(--sf));
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
svg {
|
|
248
|
-
width: 100%;
|
|
249
|
-
height: 100%;
|
|
250
|
-
fill: var(--icon-color, currentColor);
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
path {
|
|
254
|
-
fill: var(--icon-color, currentColor);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.icon-container {
|
|
258
|
-
display: flex;
|
|
259
|
-
justify-content: center;
|
|
260
|
-
align-items: center;
|
|
261
|
-
width: calc(16px * var(--sf));
|
|
262
|
-
height: calc(16px * var(--sf));
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
/* Notes style color variable for future implementation */
|
|
266
|
-
:host {
|
|
267
|
-
--notes-style-color: #ffb6b9;
|
|
268
|
-
}
|
|
269
|
-
`;
|
|
239
|
+
Icon.styles = unsafeCSS(styles);
|
|
270
240
|
// Load all SVGs from `x Icon/` as raw strings at build time (Vite)
|
|
271
241
|
// The keys will be the file base names (without extension), lowercased.
|
|
272
242
|
Icon.iconNameToSvgMap = (() => {
|
|
273
243
|
try {
|
|
274
244
|
// Note: folder name contains a space, keep it exact.
|
|
275
|
-
const modules = import.meta.glob("../x
|
|
276
|
-
|
|
245
|
+
const modules = import.meta.glob("../x-icon/*.svg", {
|
|
246
|
+
query: "?raw",
|
|
247
|
+
import: "default",
|
|
277
248
|
eager: true,
|
|
278
249
|
});
|
|
279
250
|
const map = {};
|