ds-one 0.2.5-alpha.11 → 0.2.5-alpha.13

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.
@@ -1,5 +1,5 @@
1
1
  // ds-layout.ts
2
- // Simple grid layout component with debug mode
2
+ // Simple grid layout component with view mode
3
3
 
4
4
  import { LitElement, html, css } from "lit";
5
5
 
@@ -14,12 +14,12 @@ export class Layout extends LitElement {
14
14
  static properties = {
15
15
  mode: { type: String },
16
16
  align: { type: String },
17
- debug: { type: Boolean },
17
+ view: { type: Boolean },
18
18
  };
19
19
 
20
20
  mode: string = "portfolio";
21
21
  align?: string;
22
- debug?: boolean;
22
+ view?: boolean;
23
23
 
24
24
  static styles = css`
25
25
  :host {
@@ -29,79 +29,103 @@ export class Layout extends LitElement {
29
29
  }
30
30
 
31
31
  :host([mode="portfolio"]) {
32
- grid-template-columns: 120px 480px 40px;
33
- grid-template-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
34
- grid-template-areas:
35
- "square . ."
36
- ". title ."
37
- ". header ."
38
- ". projects ."
39
- ". . ."
40
- ". bio ."
41
- ". . ."
42
- ". nav ."
43
- ". . ."
44
- ". footer ."
45
- ". . .";
32
+ --portfolio-cols: 120px 480px 40px;
33
+ --portfolio-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
34
+ --portfolio-areas: "square . ." ". title ." ". header ." ". projects ."
35
+ ". . ." ". bio ." ". . ." ". nav ." ". . ." ". footer ." ". . .";
36
+ --portfolio-overlay-cols: 120px 480px;
37
+ --portfolio-overlay-areas: "square ." ". title" ". header" ". projects"
38
+ ". ." ". bio" ". ." ". nav" ". ." ". footer" ". .";
39
+ grid-template-columns: var(--portfolio-cols);
40
+ grid-template-rows: var(--portfolio-rows);
41
+ grid-template-areas: var(--portfolio-areas);
46
42
  min-height: 600px;
47
43
  background-color: rgba(165, 165, 165, 0.03);
48
44
  max-width: 640px;
49
- margin: 0 auto;
45
+ margin: 0;
46
+ }
47
+
48
+ :host([mode="portfolio"]) .view-overlay {
49
+ grid-template-columns: var(--portfolio-overlay-cols);
50
+ grid-template-rows: var(--portfolio-rows);
51
+ grid-template-areas: var(--portfolio-overlay-areas);
50
52
  }
51
53
 
52
54
  :host([mode="company"]) {
53
- grid-template-columns: auto 400px auto;
54
- grid-template-rows: 80px 20px 20px 120px 20px 120px;
55
- grid-template-areas:
56
- ". . ."
57
- ". header ."
58
- ". . ."
59
- ". content ."
60
- ". . ."
55
+ --company-cols: auto 400px auto;
56
+ --company-rows: 80px 20px 20px 120px 20px 120px;
57
+ --company-areas: ". . ." ". header ." ". . ." ". content ." ". . ."
61
58
  ". footer .";
59
+ grid-template-columns: var(--company-cols);
60
+ grid-template-rows: var(--company-rows);
61
+ grid-template-areas: var(--company-areas);
62
62
  gap: 0;
63
63
  max-width: 100%;
64
64
  }
65
65
 
66
- :host([align="left"]) {
66
+ :host([mode="company"]) .view-overlay {
67
+ grid-template-columns: var(--company-cols);
68
+ grid-template-rows: var(--company-rows);
69
+ grid-template-areas: var(--company-areas);
70
+ gap: 0;
71
+ }
72
+
73
+ :host([align="left"]),
74
+ :host([mode="portfolio"][align="left"]),
75
+ :host([mode="company"][align="left"]),
76
+ :host([mode="app"][align="left"]) {
67
77
  margin: 0;
68
78
  justify-self: start;
69
79
  }
70
80
 
71
- :host([align="center"]) {
81
+ :host([align="center"]),
82
+ :host([mode="portfolio"][align="center"]),
83
+ :host([mode="company"][align="center"]),
84
+ :host([mode="app"][align="center"]) {
72
85
  margin: 0 auto;
73
86
  justify-self: center;
74
87
  }
75
88
 
76
- :host([align="right"]) {
89
+ :host([align="right"]),
90
+ :host([mode="portfolio"][align="right"]),
91
+ :host([mode="company"][align="right"]),
92
+ :host([mode="app"][align="right"]) {
77
93
  margin: 0 0 0 auto;
78
94
  justify-self: end;
79
95
  }
80
96
 
81
97
  /* App mode - Base */
82
98
  :host([mode="app"]) {
83
- grid-template-columns: 1fr;
84
- grid-template-rows: calc(var(--1) * var(--sf)) 20px 1fr auto;
85
- grid-template-areas:
86
- "banner"
87
- "main"
88
- "footer";
99
+ --app-cols: calc(var(--double) * var(--sf));
100
+ --app-rows: calc(var(--unit) * var(--sf)) calc(var(--2) * var(--sf))
101
+ calc(var(--unit) * var(--sf)) calc(var(--unit) * var(--sf))
102
+ calc(var(--unit) * var(--sf));
103
+ --app-areas: "1" "." "2" "." "3";
104
+ --app-overlay-cols: calc(var(--oct) * var(--sf));
105
+ --app-overlay-rows: calc(var(--unit) * var(--sf))
106
+ calc(var(--double) * var(--sf)) calc(var(--unit) * var(--sf))
107
+ calc(var(--unit) * var(--sf));
108
+ --app-overlay-areas: "banner" "." "header" "." "main" "." "footer";
109
+ grid-template-columns: var(--app-cols);
110
+ grid-template-rows: var(--app-rows);
111
+ grid-template-areas: var(--app-areas);
89
112
  min-height: 100vh;
90
113
  background-color: transparent;
91
114
  width: 100%;
92
- margin: 0 auto;
93
115
  gap: 0;
94
- }
95
-
96
- /* App mode - with scaling factor */
97
- :host([mode="app"]) {
98
116
  max-width: calc(400px * var(--sf, 1));
99
117
  padding: calc(60px * var(--sf, 1)) calc(28px * var(--sf, 1))
100
118
  calc(9.751px * var(--sf, 1));
101
119
  gap: calc(28px * var(--sf, 1));
102
120
  }
103
121
 
104
- .debug-overlay {
122
+ :host([mode="app"]) .view-overlay {
123
+ grid-template-columns: var(--app-overlay-cols);
124
+ grid-template-rows: var(--app-overlay-rows);
125
+ grid-template-areas: var(--app-overlay-areas);
126
+ }
127
+
128
+ .view-overlay {
105
129
  position: absolute;
106
130
  margin-left: -1px;
107
131
  top: 0;
@@ -115,37 +139,7 @@ export class Layout extends LitElement {
115
139
  font-weight: bold;
116
140
  }
117
141
 
118
- :host([mode="portfolio"]) .debug-overlay {
119
- grid-template-columns: 120px 480px;
120
- grid-template-rows: 120px 120px 60px 180px 60px 120px 60px 20px 120px 120px;
121
- grid-template-areas:
122
- "square ."
123
- ". title"
124
- ". header"
125
- ". projects"
126
- ". ."
127
- ". bio"
128
- ". ."
129
- ". nav"
130
- ". ."
131
- ". footer"
132
- ". .";
133
- }
134
-
135
- :host([mode="company"]) .debug-overlay {
136
- grid-template-columns: auto 400px auto;
137
- grid-template-rows: 80px 20px 20px 120px 20px 120px;
138
- grid-template-areas:
139
- ". . ."
140
- ". header ."
141
- ". . ."
142
- ". content ."
143
- ". . ."
144
- ". footer .";
145
- gap: 0;
146
- }
147
-
148
- .debug-area {
142
+ .view-area {
149
143
  display: flex;
150
144
  align-items: center;
151
145
  justify-content: center;
@@ -153,145 +147,156 @@ export class Layout extends LitElement {
153
147
  font-weight: var(--type-weight-default);
154
148
  font-family: var(--typeface-regular);
155
149
  color: var(--black);
156
- border: 1px solid red;
150
+ border: 1px solid;
157
151
  opacity: 1;
158
152
  }
159
153
 
160
- .debug-square {
154
+ :host([mode="portfolio"]) .view-area:nth-of-type(1) {
155
+ border-color: var(--tuned-red);
156
+ }
157
+ :host([mode="portfolio"]) .view-area:nth-of-type(2) {
158
+ border-color: var(--sharp-blue);
159
+ }
160
+ :host([mode="portfolio"]) .view-area:nth-of-type(3) {
161
+ border-color: var(--yellow);
162
+ }
163
+ :host([mode="portfolio"]) .view-area:nth-of-type(4) {
164
+ border-color: var(--apple-green);
165
+ }
166
+ :host([mode="portfolio"]) .view-area:nth-of-type(5) {
167
+ border-color: var(--pink);
168
+ }
169
+ :host([mode="portfolio"]) .view-area:nth-of-type(6) {
170
+ border-color: var(--orange);
171
+ }
172
+ :host([mode="portfolio"]) .view-area:nth-of-type(7) {
173
+ border-color: var(--zenith-blue);
174
+ }
175
+
176
+ :host([mode="company"]) .view-area:nth-of-type(1) {
177
+ border-color: var(--tuned-red);
178
+ }
179
+ :host([mode="company"]) .view-area:nth-of-type(2) {
180
+ border-color: var(--sharp-blue);
181
+ }
182
+ :host([mode="company"]) .view-area:nth-of-type(3) {
183
+ border-color: var(--yellow);
184
+ }
185
+
186
+ :host([mode="app"]) .view-area:nth-of-type(1) {
187
+ border-color: var(--tuned-red);
188
+ }
189
+ :host([mode="app"]) .view-area:nth-of-type(2) {
190
+ border-color: var(--sharp-blue);
191
+ }
192
+ :host([mode="app"]) .view-area:nth-of-type(3) {
193
+ border-color: var(--yellow);
194
+ }
195
+ :host([mode="app"]) .view-area:nth-of-type(4) {
196
+ border-color: var(--apple-green);
197
+ }
198
+
199
+ .view-square {
161
200
  grid-area: square;
162
201
  }
163
202
 
164
- .debug-title {
203
+ .view-title {
165
204
  grid-area: title;
166
205
  }
167
206
 
168
- .debug-header {
207
+ .view-header {
169
208
  grid-area: header;
170
- border-color: #0000ff;
171
209
  }
172
210
 
173
- .debug-projects {
211
+ .view-projects {
174
212
  grid-area: projects;
175
- border-color: #ffff00;
176
213
  }
177
214
 
178
- .debug-bio {
215
+ .view-bio {
179
216
  grid-area: bio;
180
- border-color: #ff00ff;
181
217
  }
182
218
 
183
- .debug-nav {
219
+ .view-nav {
184
220
  grid-area: nav;
185
- border-color: #00ffff;
186
221
  }
187
222
 
188
- .debug-footer {
223
+ .view-footer {
189
224
  grid-area: footer;
190
- border-color: rgb(24, 147, 73);
191
- background-color: rgba(127, 123, 11, 0.1);
192
225
  }
193
226
 
194
- .debug-content {
227
+ .view-content {
195
228
  grid-area: content;
196
- border-color: rgba(71, 231, 71, 0.63);
197
229
  }
198
230
 
199
- :host([mode="app"]) .debug-overlay {
200
- grid-template-columns: 1fr;
201
- grid-template-rows:
202
- calc(var(--1) * var(--sf))
203
- calc(var(--2) * var(--sf))
204
- calc(var(--4) * var(--sf))
205
- calc(var(--1) * var(--sf));
206
- grid-template-areas:
207
- "banner"
208
- "header"
209
- "main"
210
- "footer";
211
- }
212
-
213
- .debug-banner {
231
+ .view-banner {
214
232
  grid-area: banner;
215
- border-color: #daed09;
216
- }
217
-
218
- .debug-header {
219
- grid-area: header;
220
- border-color: #0000ff;
221
- background-color: rgba(127, 123, 11, 0.5);
222
233
  }
223
234
 
224
- .debug-main {
235
+ .view-main {
225
236
  grid-area: main;
226
- border-color: #0000ff;
227
- }
228
-
229
- .debug-footer-app {
230
- grid-area: footer;
231
- border-color: #ffa500;
232
237
  }
233
238
  `;
234
239
 
235
240
  render() {
236
- const isDebug = this.debug || this.mode === "debug";
241
+ const isView = this.view || this.mode === "view";
237
242
  const isPortfolio = this.mode === "portfolio";
238
243
  const isCompany = this.mode === "company";
239
244
  const isApp = this.mode === "app";
240
245
 
241
246
  return html`
242
247
  <slot></slot>
243
- ${isDebug
248
+ ${isView
244
249
  ? html`
245
- <div class="debug-overlay">
250
+ <div class="view-overlay">
246
251
  ${isApp
247
252
  ? html`
248
- <div class="debug-area debug-banner">
253
+ <div class="view-area view-banner">
249
254
  <ds-text key="banner">banner</ds-text>
250
255
  </div>
251
- <div class="debug-area debug-header">
256
+ <div class="view-area view-header">
252
257
  <ds-text key="header">header</ds-text>
253
258
  </div>
254
259
 
255
- <div class="debug-area debug-main">
260
+ <div class="view-area view-main">
256
261
  <ds-text key="main">main</ds-text>
257
262
  </div>
258
- <div class="debug-area debug-footer-app">
263
+ <div class="view-area view-footer">
259
264
  <ds-text key="footer">footer</ds-text>
260
265
  </div>
261
266
  `
262
267
  : isCompany
263
268
  ? html`
264
- <div class="debug-area debug-header">
269
+ <div class="view-area view-header">
265
270
  <ds-text key="header">header</ds-text>
266
271
  </div>
267
- <div class="debug-area debug-content">
272
+ <div class="view-area view-content">
268
273
  <ds-text key="content">content</ds-text>
269
274
  </div>
270
- <div class="debug-area debug-footer">
275
+ <div class="view-area view-footer">
271
276
  <ds-text key="footer">footer</ds-text>
272
277
  </div>
273
278
  `
274
279
  : isPortfolio
275
280
  ? html`
276
- <div class="debug-area debug-square">
281
+ <div class="view-area view-square">
277
282
  <ds-text key="square">square</ds-text>
278
283
  </div>
279
- <div class="debug-area debug-title">
284
+ <div class="view-area view-title">
280
285
  <ds-text key="title">title</ds-text>
281
286
  </div>
282
- <div class="debug-area debug-header">
287
+ <div class="view-area view-header">
283
288
  <ds-text key="header">header</ds-text>
284
289
  </div>
285
- <div class="debug-area debug-projects">
290
+ <div class="view-area view-projects">
286
291
  <ds-text key="projects">projects</ds-text>
287
292
  </div>
288
- <div class="debug-area debug-bio">
293
+ <div class="view-area view-bio">
289
294
  <ds-text key="bio">bio</ds-text>
290
295
  </div>
291
- <div class="debug-area debug-nav">
296
+ <div class="view-area view-nav">
292
297
  <ds-text key="nav">nav</ds-text>
293
298
  </div>
294
- <div class="debug-area debug-footer">
299
+ <div class="view-area view-footer">
295
300
  <ds-text key="footer">footer</ds-text>
296
301
  </div>
297
302
  `
package/DS1/index.ts CHANGED
@@ -48,5 +48,6 @@ export * from "./3-unit/ds-table";
48
48
  // 4-page: Layout Components
49
49
  // ============================================================================
50
50
 
51
+ export * from "./4-page/ds-container";
51
52
  export * from "./4-page/ds-grid";
52
53
  export * from "./4-page/ds-layout";
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # DS one (0.2.5-alpha.11)
1
+ # DS one (0.2.5-alpha.13)
2
2
 
3
3
  A plug and play design system
4
4
 
@@ -20,7 +20,7 @@ yarn add ds-one@alpha
20
20
 
21
21
  ```
22
22
 
23
- **Note**: Currently published as alpha version `0.2.5-alpha.11`
23
+ **Note**: Currently published as alpha version `0.2.5-alpha.13`
24
24
 
25
25
  ## Quick Start
26
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../DS1/0-face/device.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA0B5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CA6B1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CAkDhD"}
1
+ {"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../DS1/0-face/device.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CA0B5C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,UAAU,CA6B1C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,UAAU,CA0DhD"}
@@ -65,6 +65,9 @@ export function initDeviceDetection() {
65
65
  document.documentElement.style.setProperty("--sf", scalingFactor.toFixed(3));
66
66
  // Also set --sf for backwards compatibility
67
67
  document.documentElement.style.setProperty("--sf", scalingFactor.toFixed(3));
68
+ // Add .mobile class to html element for CSS targeting
69
+ document.documentElement.classList.add("mobile");
70
+ document.documentElement.classList.remove("desktop");
68
71
  console.log(`[DS one] Mobile device detected - ${deviceInfo.deviceType} (${deviceInfo.screenWidth}x${deviceInfo.screenHeight}), scaling factor: ${scalingFactor.toFixed(2)}`);
69
72
  }
70
73
  else {
@@ -73,6 +76,9 @@ export function initDeviceDetection() {
73
76
  document.documentElement.style.setProperty("--sf", "1");
74
77
  // Also set --sf for backwards compatibility
75
78
  document.documentElement.style.setProperty("--sf", "1");
79
+ // Add .desktop class and remove .mobile class
80
+ document.documentElement.classList.add("desktop");
81
+ document.documentElement.classList.remove("mobile");
76
82
  }
77
83
  console.log(`[DS one] Desktop device detected (${deviceInfo.screenWidth}x${deviceInfo.screenHeight})`);
78
84
  }
@@ -1,4 +1,5 @@
1
- import { LitElement, type PropertyValues } from "lit";
1
+ import { LitElement } from "lit";
2
+ import "./ds-text";
2
3
  export declare class Button extends LitElement {
3
4
  static properties: {
4
5
  variant: {
@@ -42,10 +43,6 @@ export declare class Button extends LitElement {
42
43
  type: BooleanConstructor;
43
44
  state: boolean;
44
45
  };
45
- _text: {
46
- type: StringConstructor;
47
- state: boolean;
48
- };
49
46
  };
50
47
  variant: string;
51
48
  disabled: boolean;
@@ -58,17 +55,9 @@ export declare class Button extends LitElement {
58
55
  defaultText: string;
59
56
  href: string;
60
57
  _loading: boolean;
61
- _text: string | null;
62
58
  constructor();
63
59
  static styles: import("lit").CSSResult;
64
60
  connectedCallback(): void;
65
- disconnectedCallback(): void;
66
- _handleLanguageChange: () => void;
67
- updated(changedProps: PropertyValues): void;
68
- /**
69
- * Update text from translations (synchronous like Portfolio)
70
- */
71
- private _updateText;
72
61
  render(): import("lit-html").TemplateResult<1>;
73
62
  private _handleClick;
74
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ds-button.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-button.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAa,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAGjE,qBAAa,MAAO,SAAQ,UAAU;IACpC,MAAM,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBf;IAGM,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAA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,WAAW,EAAE,MAAM,CAAC;KACrB;CACF"}
@@ -1,13 +1,10 @@
1
1
  // ds-button.ts
2
2
  // Core button component
3
3
  import { LitElement, html, css } from "lit";
4
- import { getText } from "../0-face/i18n";
4
+ import "./ds-text";
5
5
  export class Button extends LitElement {
6
6
  constructor() {
7
7
  super();
8
- this._handleLanguageChange = () => {
9
- this._updateText();
10
- };
11
8
  this.variant = "title";
12
9
  this.disabled = false;
13
10
  this.bold = false;
@@ -19,37 +16,12 @@ export class Button extends LitElement {
19
16
  this.defaultText = "";
20
17
  this.href = "";
21
18
  this._loading = false;
22
- this._text = null;
23
19
  }
24
20
  connectedCallback() {
25
21
  super.connectedCallback();
26
- this._updateText();
27
- // Listen for language changes
28
- window.addEventListener("language-changed", this._handleLanguageChange);
29
- }
30
- disconnectedCallback() {
31
- super.disconnectedCallback();
32
- window.removeEventListener("language-changed", this._handleLanguageChange);
33
- }
34
- updated(changedProps) {
35
- super.updated(changedProps);
36
- if (changedProps.has("key") || changedProps.has("defaultText")) {
37
- this._updateText();
38
- }
39
- }
40
- /**
41
- * Update text from translations (synchronous like Portfolio)
42
- */
43
- _updateText() {
44
- if (this.key) {
45
- this._text = getText(this.key);
46
- }
47
- else {
48
- this._text = this.defaultText || this.fallback || null;
49
- }
50
- this.requestUpdate();
51
22
  }
52
23
  render() {
24
+ const hasTextProps = this.key || this.defaultText || this.fallback;
53
25
  return html `
54
26
  <button
55
27
  class=${this.variant}
@@ -58,7 +30,13 @@ export class Button extends LitElement {
58
30
  ?no-background=${this["no-background"]}
59
31
  @click=${this._handleClick}
60
32
  >
61
- ${this._text ? this._text : html `<slot></slot>`}
33
+ ${hasTextProps
34
+ ? html `<ds-text
35
+ .key=${this.key}
36
+ .defaultValue=${this.defaultText}
37
+ .fallback=${this.fallback}
38
+ ></ds-text>`
39
+ : html `<slot></slot>`}
62
40
  </button>
63
41
  `;
64
42
  }
@@ -102,15 +80,13 @@ Button.properties = {
102
80
  defaultText: { type: String, attribute: "default-text" },
103
81
  href: { type: String },
104
82
  _loading: { type: Boolean, state: true },
105
- _text: { type: String, state: true },
106
83
  };
107
84
  Button.styles = css `
108
85
  button {
109
86
  max-height: calc(var(--08) * var(--sf));
110
87
  border: none;
111
88
  cursor: pointer;
112
- font-size: calc(var(--type-size-default) * var(--sf));
113
- padding: 0 calc(1px * var(--sf));
89
+ padding: 0 calc(2px * var(--sf));
114
90
  color: var(--button-text-color);
115
91
  font-family: var(--typeface-regular);
116
92
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ds-cycle.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAY5C,OAAO,aAAa,CAAC;AACrB,OAAO,WAAW,CAAC;AACnB,OAAO,WAAW,CAAC;AAqCnB,qBAAa,KAAM,SAAQ,UAAU;IAEnC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;MAUpB;IAED,MAAM,CAAC,MAAM,0BAWX;IAIM,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAGxB,OAAO,CAAC,aAAa,CAOnB;;IAyBF,iBAAiB;IA6BX,gBAAgB;IA6EtB,sBAAsB;IAatB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IASnE,iBAAiB;IAoDvB,qBAAqB;IAKrB,oBAAoB;IA0BpB,iBAAiB,CAAC,CAAC,EAAE,KAAK;IAuJ1B,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,GAAG;IA+C5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,M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EAAE,MAAM,GAAG,MAAM,GAAG,GAAG;IA+C5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAgBrC,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAyBtC,iBAAiB,CAAC,KAAK,EAAE,MAAM;IAe/B,QAAQ,IAAI,MAAM;IAgElB,MAAM;YAgFQ,mBAAmB;IAwBjC,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,qBAAqB;IAI7B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,wBAAwB;IAIhC,OAAO,CAAC,yBAAyB;CAGlC;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,KAAK,CAAC;KACnB;CACF"}
@@ -544,24 +544,28 @@ export class Cycle extends LitElement {
544
544
  style="display: inline-flex; align-items: center; gap: var(--025)"
545
545
  >${this.getValueDisplay(this.currentValue)}</span
546
546
  >`
547
- : this.type === "theme"
547
+ : this.type === "language"
548
548
  ? html `<ds-text
549
- key=${this.currentValue}
550
- default-value=${this.currentValue}
549
+ default-value=${this.getValueDisplay(this.currentValue)}
551
550
  ></ds-text>`
552
- : this.type === "accent-color"
551
+ : this.type === "theme"
553
552
  ? html `<ds-text
554
- key=${this.getColorKey(this.currentValue)}
555
- default-value=${this.getColorName(this.currentValue)}
553
+ key=${this.currentValue}
554
+ default-value=${this.currentValue}
556
555
  ></ds-text>`
557
- : this.type === "page-style"
556
+ : this.type === "accent-color"
558
557
  ? html `<ds-text
559
- key=${this.currentValue}
560
- default-value=${this.currentValue}
558
+ key=${this.getColorKey(this.currentValue)}
559
+ default-value=${this.getColorName(this.currentValue)}
561
560
  ></ds-text>`
562
- : html `<ds-text
563
- default-value=${this.getValueDisplay(this.currentValue)}
564
- ></ds-text>`}
561
+ : this.type === "page-style"
562
+ ? html `<ds-text
563
+ key=${this.currentValue}
564
+ default-value=${this.currentValue}
565
+ ></ds-text>`
566
+ : html `<ds-text
567
+ default-value=${this.getValueDisplay(this.currentValue)}
568
+ ></ds-text>`}
565
569
  </ds-button>
566
570
  ${this.type === "accent-color"
567
571
  ? html `
@@ -1 +1 @@
1
- {"version":3,"file":"ds-text.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;GAOG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;MAOpB;IAEO,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACjC,OAAO,CAAC,aAAa,CAAqC;;IAqB1D,MAAM,CAAC,MAAM,0BAgBX;IAEF,iBAAiB;IAsBjB,oBAAoB;IAYpB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAQ/C,wBAAwB;IASxB,SAAS;IAiBT,MAAM;CAGP;AAID,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,IAAI,CAAC;KACjB;CACF"}
1
+ {"version":3,"file":"ds-text.d.ts","sourceRoot":"","sources":["../../DS1/2-core/ds-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C;;;;;;;GAOG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,MAAM,KAAK,UAAU;;;;;;;;;;;;;;;;;;MAOpB;IAEO,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACjC,OAAO,CAAC,aAAa,CAAqC;;IAsB1D,MAAM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