@waggylabs/yumekit 0.5.1 → 0.5.3

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 (38) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +54 -63
  3. package/dist/ai/llm.txt +14 -11
  4. package/dist/ai/skill/examples/nav-layout.html +5 -5
  5. package/dist/ai/skill/examples/themed-app.html +6 -6
  6. package/dist/ai/skill/patterns.md +7 -7
  7. package/dist/ai/skill/reference.md +21 -18
  8. package/dist/components/y-appbar.js +45 -16
  9. package/dist/components/y-banner.js +44 -15
  10. package/dist/components/y-button/y-button.d.ts +11 -4
  11. package/dist/components/y-button.d.ts +11 -4
  12. package/dist/components/y-button.js +43 -14
  13. package/dist/components/y-checkbox.js +7 -1
  14. package/dist/components/y-code.js +9 -2
  15. package/dist/components/y-color.js +12 -2
  16. package/dist/components/y-colorpicker.js +12 -2
  17. package/dist/components/y-data-grid.js +83 -35
  18. package/dist/components/y-date.js +72 -30
  19. package/dist/components/y-datepicker.js +72 -30
  20. package/dist/components/y-dialog.js +1 -1
  21. package/dist/components/y-help.js +46 -17
  22. package/dist/components/y-input.js +11 -1
  23. package/dist/components/y-paginator.js +46 -17
  24. package/dist/components/y-select.js +1 -1
  25. package/dist/components/y-sidebar.js +45 -16
  26. package/dist/components/y-tabs/y-tabs.d.ts +17 -0
  27. package/dist/components/y-tabs.d.ts +17 -0
  28. package/dist/components/y-tabs.js +193 -8
  29. package/dist/components/y-tag/y-tag.d.ts +9 -2
  30. package/dist/components/y-tag.d.ts +9 -2
  31. package/dist/components/y-tag.js +36 -8
  32. package/dist/components/y-textarea.js +11 -1
  33. package/dist/index.js +341 -63
  34. package/dist/react.d.ts +5 -0
  35. package/dist/yumekit.min.js +1 -1
  36. package/llm.txt +14 -11
  37. package/package.json +1 -1
  38. package/scripts/install-ai-docs.js +93 -72
@@ -7,6 +7,7 @@ class YumeButton extends HTMLElement {
7
7
  "right-icon",
8
8
  "color",
9
9
  "size",
10
+ "variant",
10
11
  "style-type",
11
12
  "type",
12
13
  "padding-mode",
@@ -59,9 +60,13 @@ class YumeButton extends HTMLElement {
59
60
  }
60
61
  }
61
62
 
63
+ if (name === "style-type" && newValue !== null) {
64
+ this._warnStyleTypeDeprecated();
65
+ }
66
+
62
67
  this._init();
63
68
 
64
- if (["color", "size", "style-type", "disabled"].includes(name)) {
69
+ if (["color", "size", "variant", "style-type", "disabled"].includes(name)) {
65
70
  this._updateStyles();
66
71
  }
67
72
  }
@@ -143,9 +148,12 @@ class YumeButton extends HTMLElement {
143
148
  this.setAttribute("size", val);
144
149
  }
145
150
 
146
- /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
151
+ /**
152
+ * Deprecated alias for `variant`. Use `variant` instead; retained for
153
+ * backward compatibility and removed in a future major version.
154
+ */
147
155
  get styleType() {
148
- return this.getAttribute("style-type") || "outlined";
156
+ return this.variant;
149
157
  }
150
158
  set styleType(val) {
151
159
  this.setAttribute("style-type", val);
@@ -188,6 +196,18 @@ class YumeButton extends HTMLElement {
188
196
  this.setAttribute("value", newVal);
189
197
  }
190
198
 
199
+ /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
200
+ get variant() {
201
+ return (
202
+ this.getAttribute("variant") ||
203
+ this.getAttribute("style-type") ||
204
+ "outlined"
205
+ );
206
+ }
207
+ set variant(val) {
208
+ this.setAttribute("variant", val);
209
+ }
210
+
191
211
  // -------------------------------------------------------------------------
192
212
  // Public
193
213
  // -------------------------------------------------------------------------
@@ -242,7 +262,7 @@ class YumeButton extends HTMLElement {
242
262
  });
243
263
  }
244
264
 
245
- _applyCustomColorStyles(color, styleType, size) {
265
+ _applyCustomColorStyles(color, variant, size) {
246
266
  const text = contrastTextColor(color);
247
267
  const hover = `color-mix(in srgb, ${color} 85%, black)`;
248
268
  const active = `color-mix(in srgb, ${color} 70%, black)`;
@@ -298,7 +318,7 @@ class YumeButton extends HTMLElement {
298
318
  },
299
319
  };
300
320
 
301
- Object.entries(styles[styleType] || styles.outlined).forEach(
321
+ Object.entries(styles[variant] || styles.outlined).forEach(
302
322
  ([key, val]) => this.button.style.setProperty(key, val),
303
323
  );
304
324
 
@@ -344,11 +364,11 @@ class YumeButton extends HTMLElement {
344
364
  );
345
365
  }
346
366
 
347
- _applyInteractionStyles(vars, styleType) {
348
- if (styleType === "filled") {
367
+ _applyInteractionStyles(vars, variant) {
368
+ if (variant === "filled") {
349
369
  this._applyFilledInteractionStyles(vars);
350
370
  } else {
351
- this._applyUnfilledInteractionStyles(vars, styleType);
371
+ this._applyUnfilledInteractionStyles(vars, variant);
352
372
  }
353
373
  }
354
374
 
@@ -473,7 +493,7 @@ class YumeButton extends HTMLElement {
473
493
  this.shadowRoot.appendChild(style);
474
494
  }
475
495
 
476
- _applyUnfilledInteractionStyles(vars, styleType) {
496
+ _applyUnfilledInteractionStyles(vars, variant) {
477
497
  const borderColor = this._outlineBorderColor(
478
498
  `var(${vars[7]}, var(${vars[0]}, #f7f7fa))`,
479
499
  );
@@ -503,7 +523,7 @@ class YumeButton extends HTMLElement {
503
523
  `var(${vars[6]}, #0c0c0d)`,
504
524
  );
505
525
 
506
- if (styleType === "outlined") {
526
+ if (variant === "outlined") {
507
527
  // Outlined buttons keep their border color across all states
508
528
  this.button.style.setProperty("--hover-border-color", borderColor);
509
529
  this.button.style.setProperty("--focus-border-color", borderColor);
@@ -791,11 +811,11 @@ class YumeButton extends HTMLElement {
791
811
  }
792
812
 
793
813
  _updateStyles() {
794
- const { color, size, styleType } = this;
814
+ const { color, size, variant } = this;
795
815
  const colorVars = this._getColorVarsMap();
796
816
 
797
817
  if (!colorVars[color] && isSafeCssColor(color)) {
798
- this._applyCustomColorStyles(color, styleType, size);
818
+ this._applyCustomColorStyles(color, variant, size);
799
819
  return;
800
820
  }
801
821
 
@@ -824,14 +844,23 @@ class YumeButton extends HTMLElement {
824
844
  },
825
845
  };
826
846
 
827
- const currentStyle = styleVars[styleType] || styleVars.outlined;
847
+ const currentStyle = styleVars[variant] || styleVars.outlined;
828
848
  Object.entries(currentStyle).forEach(([key, value]) => {
829
849
  this.button.style.setProperty(key, value);
830
850
  });
831
851
 
832
- this._applyInteractionStyles(vars, styleType);
852
+ this._applyInteractionStyles(vars, variant);
833
853
  this._applySizeStyles(size);
834
854
  }
855
+
856
+ _warnStyleTypeDeprecated() {
857
+ if (YumeButton._styleTypeDeprecationWarned) return;
858
+
859
+ YumeButton._styleTypeDeprecationWarned = true;
860
+ console.warn(
861
+ 'y-button: the "style-type" attribute is deprecated and will be removed in a future major version. Use "variant" instead.',
862
+ );
863
+ }
835
864
  }
836
865
 
837
866
  if (!customElements.get("y-button")) {
@@ -2168,7 +2197,7 @@ class YumeAppbar extends HTMLElement {
2168
2197
  {
2169
2198
  id,
2170
2199
  color: "base",
2171
- "style-type": "flat",
2200
+ "variant": "flat",
2172
2201
  size: cfg.buttonSize,
2173
2202
  "aria-label": "Open menu",
2174
2203
  "aria-controls": panelId,
@@ -2320,7 +2349,7 @@ class YumeAppbar extends HTMLElement {
2320
2349
  const btn = createElement("y-button", {
2321
2350
  id: btnId,
2322
2351
  color: isActive ? "primary" : "base",
2323
- "style-type": "flat",
2352
+ "variant": "flat",
2324
2353
  size: cfg.buttonSize,
2325
2354
  "aria-current": isActive ? "page" : false,
2326
2355
  });
@@ -7,6 +7,7 @@ class YumeButton extends HTMLElement {
7
7
  "right-icon",
8
8
  "color",
9
9
  "size",
10
+ "variant",
10
11
  "style-type",
11
12
  "type",
12
13
  "padding-mode",
@@ -59,9 +60,13 @@ class YumeButton extends HTMLElement {
59
60
  }
60
61
  }
61
62
 
63
+ if (name === "style-type" && newValue !== null) {
64
+ this._warnStyleTypeDeprecated();
65
+ }
66
+
62
67
  this._init();
63
68
 
64
- if (["color", "size", "style-type", "disabled"].includes(name)) {
69
+ if (["color", "size", "variant", "style-type", "disabled"].includes(name)) {
65
70
  this._updateStyles();
66
71
  }
67
72
  }
@@ -143,9 +148,12 @@ class YumeButton extends HTMLElement {
143
148
  this.setAttribute("size", val);
144
149
  }
145
150
 
146
- /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
151
+ /**
152
+ * Deprecated alias for `variant`. Use `variant` instead; retained for
153
+ * backward compatibility and removed in a future major version.
154
+ */
147
155
  get styleType() {
148
- return this.getAttribute("style-type") || "outlined";
156
+ return this.variant;
149
157
  }
150
158
  set styleType(val) {
151
159
  this.setAttribute("style-type", val);
@@ -188,6 +196,18 @@ class YumeButton extends HTMLElement {
188
196
  this.setAttribute("value", newVal);
189
197
  }
190
198
 
199
+ /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
200
+ get variant() {
201
+ return (
202
+ this.getAttribute("variant") ||
203
+ this.getAttribute("style-type") ||
204
+ "outlined"
205
+ );
206
+ }
207
+ set variant(val) {
208
+ this.setAttribute("variant", val);
209
+ }
210
+
191
211
  // -------------------------------------------------------------------------
192
212
  // Public
193
213
  // -------------------------------------------------------------------------
@@ -242,7 +262,7 @@ class YumeButton extends HTMLElement {
242
262
  });
243
263
  }
244
264
 
245
- _applyCustomColorStyles(color, styleType, size) {
265
+ _applyCustomColorStyles(color, variant, size) {
246
266
  const text = contrastTextColor(color);
247
267
  const hover = `color-mix(in srgb, ${color} 85%, black)`;
248
268
  const active = `color-mix(in srgb, ${color} 70%, black)`;
@@ -298,7 +318,7 @@ class YumeButton extends HTMLElement {
298
318
  },
299
319
  };
300
320
 
301
- Object.entries(styles[styleType] || styles.outlined).forEach(
321
+ Object.entries(styles[variant] || styles.outlined).forEach(
302
322
  ([key, val]) => this.button.style.setProperty(key, val),
303
323
  );
304
324
 
@@ -344,11 +364,11 @@ class YumeButton extends HTMLElement {
344
364
  );
345
365
  }
346
366
 
347
- _applyInteractionStyles(vars, styleType) {
348
- if (styleType === "filled") {
367
+ _applyInteractionStyles(vars, variant) {
368
+ if (variant === "filled") {
349
369
  this._applyFilledInteractionStyles(vars);
350
370
  } else {
351
- this._applyUnfilledInteractionStyles(vars, styleType);
371
+ this._applyUnfilledInteractionStyles(vars, variant);
352
372
  }
353
373
  }
354
374
 
@@ -473,7 +493,7 @@ class YumeButton extends HTMLElement {
473
493
  this.shadowRoot.appendChild(style);
474
494
  }
475
495
 
476
- _applyUnfilledInteractionStyles(vars, styleType) {
496
+ _applyUnfilledInteractionStyles(vars, variant) {
477
497
  const borderColor = this._outlineBorderColor(
478
498
  `var(${vars[7]}, var(${vars[0]}, #f7f7fa))`,
479
499
  );
@@ -503,7 +523,7 @@ class YumeButton extends HTMLElement {
503
523
  `var(${vars[6]}, #0c0c0d)`,
504
524
  );
505
525
 
506
- if (styleType === "outlined") {
526
+ if (variant === "outlined") {
507
527
  // Outlined buttons keep their border color across all states
508
528
  this.button.style.setProperty("--hover-border-color", borderColor);
509
529
  this.button.style.setProperty("--focus-border-color", borderColor);
@@ -791,11 +811,11 @@ class YumeButton extends HTMLElement {
791
811
  }
792
812
 
793
813
  _updateStyles() {
794
- const { color, size, styleType } = this;
814
+ const { color, size, variant } = this;
795
815
  const colorVars = this._getColorVarsMap();
796
816
 
797
817
  if (!colorVars[color] && isSafeCssColor(color)) {
798
- this._applyCustomColorStyles(color, styleType, size);
818
+ this._applyCustomColorStyles(color, variant, size);
799
819
  return;
800
820
  }
801
821
 
@@ -824,14 +844,23 @@ class YumeButton extends HTMLElement {
824
844
  },
825
845
  };
826
846
 
827
- const currentStyle = styleVars[styleType] || styleVars.outlined;
847
+ const currentStyle = styleVars[variant] || styleVars.outlined;
828
848
  Object.entries(currentStyle).forEach(([key, value]) => {
829
849
  this.button.style.setProperty(key, value);
830
850
  });
831
851
 
832
- this._applyInteractionStyles(vars, styleType);
852
+ this._applyInteractionStyles(vars, variant);
833
853
  this._applySizeStyles(size);
834
854
  }
855
+
856
+ _warnStyleTypeDeprecated() {
857
+ if (YumeButton._styleTypeDeprecationWarned) return;
858
+
859
+ YumeButton._styleTypeDeprecationWarned = true;
860
+ console.warn(
861
+ 'y-button: the "style-type" attribute is deprecated and will be removed in a future major version. Use "variant" instead.',
862
+ );
863
+ }
835
864
  }
836
865
 
837
866
  if (!customElements.get("y-button")) {
@@ -1395,7 +1424,7 @@ class YumeBanner extends HTMLElement {
1395
1424
  part: "close-btn",
1396
1425
  "aria-label": "Dismiss banner",
1397
1426
  color,
1398
- "style-type": "filled",
1427
+ "variant": "filled",
1399
1428
  size,
1400
1429
  },
1401
1430
  [createElement("y-icon", { name: "x", size: iconSize })],
@@ -32,7 +32,10 @@ export class YumeButton extends HTMLElement {
32
32
  /** Size: "small" | "medium" | "large" (default "medium"). */
33
33
  get size(): string;
34
34
  set styleType(val: string);
35
- /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
35
+ /**
36
+ * Deprecated alias for `variant`. Use `variant` instead; retained for
37
+ * backward compatibility and removed in a future major version.
38
+ */
36
39
  get styleType(): string;
37
40
  set type(val: string);
38
41
  /** Button type: "button" | "submit" | "reset" (default "button"). */
@@ -40,13 +43,16 @@ export class YumeButton extends HTMLElement {
40
43
  set value(newVal: any);
41
44
  /** The current selected value(s), comma-separated when 'multiple' is set. */
42
45
  get value(): any;
46
+ set variant(val: string);
47
+ /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
48
+ get variant(): string;
43
49
  _addEventListeners(): void;
44
- _applyCustomColorStyles(color: any, styleType: any, size: any): void;
50
+ _applyCustomColorStyles(color: any, variant: any, size: any): void;
45
51
  _applyFilledInteractionStyles(vars: any): void;
46
- _applyInteractionStyles(vars: any, styleType: any): void;
52
+ _applyInteractionStyles(vars: any, variant: any): void;
47
53
  _applySizeStyles(size: any): void;
48
54
  _applyStyles(): void;
49
- _applyUnfilledInteractionStyles(vars: any, styleType: any): void;
55
+ _applyUnfilledInteractionStyles(vars: any, variant: any): void;
50
56
  _getColorVarsMap(): {
51
57
  primary: string[];
52
58
  secondary: string[];
@@ -71,4 +77,5 @@ export class YumeButton extends HTMLElement {
71
77
  _outlineBorder(defaultColor: any): string;
72
78
  _outlineBorderColor(defaultColor: any): string;
73
79
  _updateStyles(): void;
80
+ _warnStyleTypeDeprecated(): void;
74
81
  }
@@ -32,7 +32,10 @@ export class YumeButton extends HTMLElement {
32
32
  /** Size: "small" | "medium" | "large" (default "medium"). */
33
33
  get size(): string;
34
34
  set styleType(val: string);
35
- /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
35
+ /**
36
+ * Deprecated alias for `variant`. Use `variant` instead; retained for
37
+ * backward compatibility and removed in a future major version.
38
+ */
36
39
  get styleType(): string;
37
40
  set type(val: string);
38
41
  /** Button type: "button" | "submit" | "reset" (default "button"). */
@@ -40,13 +43,16 @@ export class YumeButton extends HTMLElement {
40
43
  set value(newVal: any);
41
44
  /** The current selected value(s), comma-separated when 'multiple' is set. */
42
45
  get value(): any;
46
+ set variant(val: string);
47
+ /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
48
+ get variant(): string;
43
49
  _addEventListeners(): void;
44
- _applyCustomColorStyles(color: any, styleType: any, size: any): void;
50
+ _applyCustomColorStyles(color: any, variant: any, size: any): void;
45
51
  _applyFilledInteractionStyles(vars: any): void;
46
- _applyInteractionStyles(vars: any, styleType: any): void;
52
+ _applyInteractionStyles(vars: any, variant: any): void;
47
53
  _applySizeStyles(size: any): void;
48
54
  _applyStyles(): void;
49
- _applyUnfilledInteractionStyles(vars: any, styleType: any): void;
55
+ _applyUnfilledInteractionStyles(vars: any, variant: any): void;
50
56
  _getColorVarsMap(): {
51
57
  primary: string[];
52
58
  secondary: string[];
@@ -71,4 +77,5 @@ export class YumeButton extends HTMLElement {
71
77
  _outlineBorder(defaultColor: any): string;
72
78
  _outlineBorderColor(defaultColor: any): string;
73
79
  _updateStyles(): void;
80
+ _warnStyleTypeDeprecated(): void;
74
81
  }
@@ -7,6 +7,7 @@ class YumeButton extends HTMLElement {
7
7
  "right-icon",
8
8
  "color",
9
9
  "size",
10
+ "variant",
10
11
  "style-type",
11
12
  "type",
12
13
  "padding-mode",
@@ -59,9 +60,13 @@ class YumeButton extends HTMLElement {
59
60
  }
60
61
  }
61
62
 
63
+ if (name === "style-type" && newValue !== null) {
64
+ this._warnStyleTypeDeprecated();
65
+ }
66
+
62
67
  this._init();
63
68
 
64
- if (["color", "size", "style-type", "disabled"].includes(name)) {
69
+ if (["color", "size", "variant", "style-type", "disabled"].includes(name)) {
65
70
  this._updateStyles();
66
71
  }
67
72
  }
@@ -143,9 +148,12 @@ class YumeButton extends HTMLElement {
143
148
  this.setAttribute("size", val);
144
149
  }
145
150
 
146
- /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
151
+ /**
152
+ * Deprecated alias for `variant`. Use `variant` instead; retained for
153
+ * backward compatibility and removed in a future major version.
154
+ */
147
155
  get styleType() {
148
- return this.getAttribute("style-type") || "outlined";
156
+ return this.variant;
149
157
  }
150
158
  set styleType(val) {
151
159
  this.setAttribute("style-type", val);
@@ -188,6 +196,18 @@ class YumeButton extends HTMLElement {
188
196
  this.setAttribute("value", newVal);
189
197
  }
190
198
 
199
+ /** Visual style: "filled" | "outlined" | "flat" (default "outlined"). */
200
+ get variant() {
201
+ return (
202
+ this.getAttribute("variant") ||
203
+ this.getAttribute("style-type") ||
204
+ "outlined"
205
+ );
206
+ }
207
+ set variant(val) {
208
+ this.setAttribute("variant", val);
209
+ }
210
+
191
211
  // -------------------------------------------------------------------------
192
212
  // Public
193
213
  // -------------------------------------------------------------------------
@@ -242,7 +262,7 @@ class YumeButton extends HTMLElement {
242
262
  });
243
263
  }
244
264
 
245
- _applyCustomColorStyles(color, styleType, size) {
265
+ _applyCustomColorStyles(color, variant, size) {
246
266
  const text = contrastTextColor(color);
247
267
  const hover = `color-mix(in srgb, ${color} 85%, black)`;
248
268
  const active = `color-mix(in srgb, ${color} 70%, black)`;
@@ -298,7 +318,7 @@ class YumeButton extends HTMLElement {
298
318
  },
299
319
  };
300
320
 
301
- Object.entries(styles[styleType] || styles.outlined).forEach(
321
+ Object.entries(styles[variant] || styles.outlined).forEach(
302
322
  ([key, val]) => this.button.style.setProperty(key, val),
303
323
  );
304
324
 
@@ -344,11 +364,11 @@ class YumeButton extends HTMLElement {
344
364
  );
345
365
  }
346
366
 
347
- _applyInteractionStyles(vars, styleType) {
348
- if (styleType === "filled") {
367
+ _applyInteractionStyles(vars, variant) {
368
+ if (variant === "filled") {
349
369
  this._applyFilledInteractionStyles(vars);
350
370
  } else {
351
- this._applyUnfilledInteractionStyles(vars, styleType);
371
+ this._applyUnfilledInteractionStyles(vars, variant);
352
372
  }
353
373
  }
354
374
 
@@ -473,7 +493,7 @@ class YumeButton extends HTMLElement {
473
493
  this.shadowRoot.appendChild(style);
474
494
  }
475
495
 
476
- _applyUnfilledInteractionStyles(vars, styleType) {
496
+ _applyUnfilledInteractionStyles(vars, variant) {
477
497
  const borderColor = this._outlineBorderColor(
478
498
  `var(${vars[7]}, var(${vars[0]}, #f7f7fa))`,
479
499
  );
@@ -503,7 +523,7 @@ class YumeButton extends HTMLElement {
503
523
  `var(${vars[6]}, #0c0c0d)`,
504
524
  );
505
525
 
506
- if (styleType === "outlined") {
526
+ if (variant === "outlined") {
507
527
  // Outlined buttons keep their border color across all states
508
528
  this.button.style.setProperty("--hover-border-color", borderColor);
509
529
  this.button.style.setProperty("--focus-border-color", borderColor);
@@ -791,11 +811,11 @@ class YumeButton extends HTMLElement {
791
811
  }
792
812
 
793
813
  _updateStyles() {
794
- const { color, size, styleType } = this;
814
+ const { color, size, variant } = this;
795
815
  const colorVars = this._getColorVarsMap();
796
816
 
797
817
  if (!colorVars[color] && isSafeCssColor(color)) {
798
- this._applyCustomColorStyles(color, styleType, size);
818
+ this._applyCustomColorStyles(color, variant, size);
799
819
  return;
800
820
  }
801
821
 
@@ -824,14 +844,23 @@ class YumeButton extends HTMLElement {
824
844
  },
825
845
  };
826
846
 
827
- const currentStyle = styleVars[styleType] || styleVars.outlined;
847
+ const currentStyle = styleVars[variant] || styleVars.outlined;
828
848
  Object.entries(currentStyle).forEach(([key, value]) => {
829
849
  this.button.style.setProperty(key, value);
830
850
  });
831
851
 
832
- this._applyInteractionStyles(vars, styleType);
852
+ this._applyInteractionStyles(vars, variant);
833
853
  this._applySizeStyles(size);
834
854
  }
855
+
856
+ _warnStyleTypeDeprecated() {
857
+ if (YumeButton._styleTypeDeprecationWarned) return;
858
+
859
+ YumeButton._styleTypeDeprecationWarned = true;
860
+ console.warn(
861
+ 'y-button: the "style-type" attribute is deprecated and will be removed in a future major version. Use "variant" instead.',
862
+ );
863
+ }
835
864
  }
836
865
 
837
866
  if (!customElements.get("y-button")) {
@@ -505,8 +505,14 @@ class YumeCheckbox extends HTMLElement {
505
505
  // -------------------------------------------------------------------------
506
506
 
507
507
  _bindCheckboxListeners() {
508
+ const wrapper = this.shadowRoot.querySelector(".wrapper");
508
509
  const box = this.shadowRoot.querySelector(".checkbox");
509
- box.addEventListener("click", () => this.toggle());
510
+
511
+ wrapper.addEventListener("click", () => {
512
+ if (this.disabled) return;
513
+ box.focus();
514
+ this.toggle();
515
+ });
510
516
  box.addEventListener("keydown", (e) => {
511
517
  if (e.key === " " || e.key === "Enter") {
512
518
  e.preventDefault();
@@ -1947,7 +1947,8 @@ class YumeCode extends HTMLElement {
1947
1947
  _buildStyles() {
1948
1948
  return `
1949
1949
  :host {
1950
- display: block;
1950
+ display: flex;
1951
+ flex-direction: column;
1951
1952
  font-family: var(--component-code-font-family, var(--font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace));
1952
1953
  color: var(--component-code-text-color, var(--base-content--, #1a1a1a));
1953
1954
  background: var(--component-code-bg-color, var(--base-background-component, #f6f8fa));
@@ -1997,13 +1998,19 @@ class YumeCode extends HTMLElement {
1997
1998
  .pre-wrap {
1998
1999
  position: relative;
1999
2000
  overflow: hidden;
2001
+ display: flex;
2002
+ flex-direction: column;
2003
+ flex: 1 1 auto;
2004
+ min-height: 0;
2000
2005
  }
2001
2006
 
2002
2007
  pre.code {
2003
2008
  margin: 0;
2004
2009
  padding: var(--spacing-small, 8px) 0;
2010
+ flex: 1 1 auto;
2011
+ min-height: 0;
2005
2012
  overflow-x: ${this.wrap ? "hidden" : "auto"};
2006
- overflow-y: ${this.maxLines ? "auto" : "visible"};
2013
+ overflow-y: auto;
2007
2014
  font-size: var(--component-code-font-size, 0.9em);
2008
2015
  line-height: var(--component-code-line-height, 1.55);
2009
2016
  tab-size: 4;
@@ -132,7 +132,10 @@ class YumeInput extends HTMLElement {
132
132
  : "default";
133
133
  }
134
134
  set variant(val) {
135
- this.setAttribute("variant", val === "underline" ? "underline" : "default");
135
+ this.setAttribute(
136
+ "variant",
137
+ val === "underline" ? "underline" : "default",
138
+ );
136
139
  }
137
140
 
138
141
  /** @type {string} Input type (default "text"). */
@@ -200,6 +203,13 @@ class YumeInput extends HTMLElement {
200
203
  // -------------------------------------------------------------------------
201
204
 
202
205
  _bindInputListeners() {
206
+ this.inputContainer.addEventListener("mousedown", (e) => {
207
+ if (e.target !== this.input) {
208
+ e.preventDefault();
209
+ this.input.focus();
210
+ }
211
+ });
212
+
203
213
  this.input.addEventListener("input", (e) => {
204
214
  this.setAttribute("value", e.target.value);
205
215
  this.dispatchEvent(
@@ -1750,7 +1760,7 @@ class YumeSelect extends HTMLElement {
1750
1760
  tag.setAttribute("removable", "");
1751
1761
  tag.setAttribute("size", "small");
1752
1762
  tag.setAttribute("color", opt.color || "primary");
1753
- tag.setAttribute("style-type", "filled");
1763
+ tag.setAttribute("variant", "filled");
1754
1764
  tag.textContent = opt.label;
1755
1765
  tag.dataset.value = opt.value;
1756
1766
 
@@ -132,7 +132,10 @@ class YumeInput extends HTMLElement {
132
132
  : "default";
133
133
  }
134
134
  set variant(val) {
135
- this.setAttribute("variant", val === "underline" ? "underline" : "default");
135
+ this.setAttribute(
136
+ "variant",
137
+ val === "underline" ? "underline" : "default",
138
+ );
136
139
  }
137
140
 
138
141
  /** @type {string} Input type (default "text"). */
@@ -200,6 +203,13 @@ class YumeInput extends HTMLElement {
200
203
  // -------------------------------------------------------------------------
201
204
 
202
205
  _bindInputListeners() {
206
+ this.inputContainer.addEventListener("mousedown", (e) => {
207
+ if (e.target !== this.input) {
208
+ e.preventDefault();
209
+ this.input.focus();
210
+ }
211
+ });
212
+
203
213
  this.input.addEventListener("input", (e) => {
204
214
  this.setAttribute("value", e.target.value);
205
215
  this.dispatchEvent(
@@ -1750,7 +1760,7 @@ class YumeSelect extends HTMLElement {
1750
1760
  tag.setAttribute("removable", "");
1751
1761
  tag.setAttribute("size", "small");
1752
1762
  tag.setAttribute("color", opt.color || "primary");
1753
- tag.setAttribute("style-type", "filled");
1763
+ tag.setAttribute("variant", "filled");
1754
1764
  tag.textContent = opt.label;
1755
1765
  tag.dataset.value = opt.value;
1756
1766