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
|
@@ -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
|
+
}
|
package/DS1/2-core/ds-cycle.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html,
|
|
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 =
|
|
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
|
-
"--
|
|
174
|
-
"--green",
|
|
175
|
-
"--
|
|
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(
|
|
499
|
-
if (translatedName && translatedName !==
|
|
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" ? "
|
|
460
|
+
const translatedText = translate(value === "note" ? "Note" : "Page");
|
|
516
461
|
if (
|
|
517
462
|
translatedText &&
|
|
518
|
-
translatedText !== (value === "note" ? "
|
|
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
|
|
499
|
+
// Map CSS variables to translation text keys
|
|
539
500
|
const colorMap: { [key: string]: string } = {
|
|
540
|
-
"--red": "
|
|
541
|
-
"--orange": "
|
|
542
|
-
"--yellow": "
|
|
543
|
-
"--
|
|
544
|
-
"--green": "
|
|
545
|
-
"--
|
|
546
|
-
"--blue": "
|
|
547
|
-
"--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
|
|
551
|
-
if (
|
|
552
|
-
const translatedName = translate(
|
|
553
|
-
if (translatedName && translatedName !==
|
|
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
|
|
644
|
-
|
|
645
|
-
|
|
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
|
-
|
|
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
|
-
|
|
654
|
-
default-value
|
|
655
|
-
class="cycle-label"
|
|
560
|
+
text=${this.currentValue}
|
|
561
|
+
default-value=${this.currentValue}
|
|
656
562
|
></ds-text>`
|
|
657
|
-
:
|
|
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
|
}
|
package/DS1/2-core/ds-date.ts
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
|
/**
|
|
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 =
|
|
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
|
+
}
|
package/DS1/2-core/ds-icon.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { LitElement, html,
|
|
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 =
|
|
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
|
|
63
|
-
|
|
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
|
|