godown 3.8.2 → 3.9.0

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 (70) hide show
  1. package/build/godown+lit.iife.js +12 -12
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +12 -12
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +12 -12
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +10 -10
  8. package/build/godown.js +10 -10
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +10 -10
  11. package/build/godown.umd.js.map +1 -1
  12. package/components/alert.d.ts +1 -0
  13. package/components/alert.d.ts.map +1 -1
  14. package/components/alert.js +1 -1
  15. package/components/alert.js.map +1 -1
  16. package/components/avatar.d.ts.map +1 -1
  17. package/components/avatar.js +1 -1
  18. package/components/avatar.js.map +1 -1
  19. package/components/button.d.ts +4 -4
  20. package/components/button.d.ts.map +1 -1
  21. package/components/button.js +1 -1
  22. package/components/button.js.map +1 -1
  23. package/components/carousel.d.ts.map +1 -1
  24. package/components/carousel.js.map +1 -1
  25. package/components/input.d.ts +1 -0
  26. package/components/input.d.ts.map +1 -1
  27. package/components/input.js +1 -1
  28. package/components/input.js.map +1 -1
  29. package/components/range.d.ts.map +1 -1
  30. package/components/range.js +1 -1
  31. package/components/range.js.map +1 -1
  32. package/components/select.d.ts.map +1 -1
  33. package/components/select.js +1 -1
  34. package/components/select.js.map +1 -1
  35. package/components/split.d.ts +1 -0
  36. package/components/split.d.ts.map +1 -1
  37. package/components/split.js +1 -1
  38. package/components/split.js.map +1 -1
  39. package/components/tabs.d.ts +1 -0
  40. package/components/tabs.d.ts.map +1 -1
  41. package/components/tabs.js +1 -1
  42. package/components/tabs.js.map +1 -1
  43. package/core/global-style.d.ts +3 -1
  44. package/core/global-style.d.ts.map +1 -1
  45. package/core/global-style.js +1 -1
  46. package/core/global-style.js.map +1 -1
  47. package/core/outline.d.ts +7 -9
  48. package/core/outline.d.ts.map +1 -1
  49. package/core/outline.js +1 -1
  50. package/core/outline.js.map +1 -1
  51. package/core/super-input.d.ts +1 -1
  52. package/core/super-input.d.ts.map +1 -1
  53. package/core/super-input.js +1 -1
  54. package/core/super-input.js.map +1 -1
  55. package/custom-elements.json +1 -1
  56. package/package.json +4 -5
  57. package/src/components/alert.ts +33 -25
  58. package/src/components/avatar.ts +1 -2
  59. package/src/components/button.ts +89 -68
  60. package/src/components/carousel.ts +2 -1
  61. package/src/components/input.ts +12 -5
  62. package/src/components/range.ts +14 -3
  63. package/src/components/select.ts +1 -0
  64. package/src/components/split.ts +12 -2
  65. package/src/components/tabs.ts +58 -64
  66. package/src/core/global-style.ts +20 -7
  67. package/src/core/outline.ts +35 -40
  68. package/src/core/super-input.ts +2 -11
  69. package/vscode.html-custom-data.json +1 -1
  70. package/web-types.json +1 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.8.2",
4
- "description": "Non Composite Web Components Library",
3
+ "version": "3.9.0",
4
+ "description": "Web Components Library",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "homepage": "https://godown.js.org",
@@ -20,9 +20,9 @@
20
20
  "fmtime": "^0.0.3",
21
21
  "lit": "^3.0.0",
22
22
  "tslib": "^2.7.0",
23
+ "@godown/element": "^1.7.0",
23
24
  "@godown/colors": "^1.0.0",
24
- "@godown/element": "^1.6.0",
25
- "@godown/f7-icon": "^1.0.7"
25
+ "@godown/f7-icon": "^1.0.9"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"
@@ -45,7 +45,6 @@
45
45
  "build": "tsx build.ts",
46
46
  "build:ts": "tsc",
47
47
  "fmt": "prettier src/**/* --write",
48
- "lint": "biome lint",
49
48
  "manifest": "tsx manifest.ts"
50
49
  }
51
50
  }
@@ -1,4 +1,4 @@
1
- import { attr, constructCSSObject, godown, htmlSlot, htmlStyle, styles, toVar } from "@godown/element";
1
+ import { attr, godown, htmlSlot, joinRules, StyleController, styles } from "@godown/element";
2
2
  import iconCheckAltCircle from "@godown/f7-icon/icons/checkmark-alt-circle.js";
3
3
  import iconExclamationCircle from "@godown/f7-icon/icons/exclamationmark-circle.js";
4
4
  import iconInfoCircle from "@godown/f7-icon/icons/info-circle.js";
@@ -15,30 +15,23 @@ import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js
15
15
  const protoName = "alert";
16
16
  const cssScope = scopePrefix(protoName);
17
17
 
18
- const vars = ["color", "background"].map((v) => `${cssScope}--${v}`);
19
-
20
18
  const genDark = (key: string) => {
21
19
  return [cssGlobalVars._colors[key][5], cssGlobalVars._colors[key][9]];
22
20
  };
23
21
 
24
- const darkStyles = constructCSSObject(
25
- vars,
26
- {
27
- green: genDark("green"),
28
- blue: genDark("blue"),
29
- orange: genDark("orange"),
30
- red: genDark("red"),
31
- yellow: genDark("yellow"),
32
- purple: genDark("purple"),
33
- teal: genDark("teal"),
34
- pink: genDark("pink"),
35
- gray: [cssGlobalVars._colors.lightgray[5], cssGlobalVars._colors.darkgray[5]],
36
- white: [cssGlobalVars._colors.lightgray[2], cssGlobalVars._colors.darkgray[7]],
37
- black: [cssGlobalVars._colors.darkgray[8], cssGlobalVars._colors.lightgray[5]],
38
- },
39
- () => ":host",
40
- (prop) => toVar(prop),
41
- );
22
+ const colorDetails = {
23
+ green: genDark("green"),
24
+ blue: genDark("blue"),
25
+ orange: genDark("orange"),
26
+ red: genDark("red"),
27
+ yellow: genDark("yellow"),
28
+ purple: genDark("purple"),
29
+ teal: genDark("teal"),
30
+ pink: genDark("pink"),
31
+ gray: [cssGlobalVars._colors.lightgray[5], cssGlobalVars._colors.darkgray[5]],
32
+ white: [cssGlobalVars._colors.lightgray[2], cssGlobalVars._colors.darkgray[7]],
33
+ black: [cssGlobalVars._colors.darkgray[8], cssGlobalVars._colors.lightgray[5]],
34
+ };
42
35
 
43
36
  const calls = {
44
37
  tip: {
@@ -88,12 +81,15 @@ const calls = {
88
81
  */
89
82
  @godown(protoName)
90
83
  @styles(css`
91
- :host,
92
- :where(:host([contents]) [part="root"]) {
84
+ :host {
93
85
  ${cssScope}--border-width: .075em;
94
86
  ${cssScope}--blockquote-width: .2em;
95
87
  ${cssScope}--blockquote-background: transparent;
96
88
  ${cssScope}--gap: .5em;
89
+ }
90
+
91
+ :host,
92
+ :where(:host([contents]) [part="root"]) {
97
93
  display: block;
98
94
  }
99
95
 
@@ -142,6 +138,20 @@ const calls = {
142
138
  }
143
139
  `)
144
140
  class Alert extends GlobalStyle {
141
+ private __colorSC = new StyleController(this, () => {
142
+ const color = calls[this.call]?.color || this.color;
143
+ if (color in colorDetails) {
144
+ const [fg, bg] = colorDetails[color];
145
+ return joinRules({
146
+ ":host": [
147
+ [`${cssScope}--color`, `var(${fg})`],
148
+ [`${cssScope}--background`, `var(${bg})`],
149
+ ],
150
+ });
151
+ }
152
+ return null;
153
+ });
154
+
145
155
  /**
146
156
  * If it is a legal value, the icon and preset color will be rendered.
147
157
  */
@@ -202,7 +212,6 @@ class Alert extends GlobalStyle {
202
212
  variant: "blockquote" | "dark" = "dark";
203
213
 
204
214
  protected render(): TemplateResult<1> {
205
- const color = calls[this.call]?.color || this.color;
206
215
  const icon = this.call ? calls[this.call].icon() : htmlSlot("icon");
207
216
  return html`
208
217
  <div
@@ -231,7 +240,6 @@ class Alert extends GlobalStyle {
231
240
  ${iconXmark()}
232
241
  </div>
233
242
  `}
234
- ${htmlStyle(darkStyles[color])}
235
243
  </div>
236
244
  `;
237
245
  }
@@ -2,10 +2,9 @@ import { attr, godown, htmlSlot, omit, styles } from "@godown/element";
2
2
  import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
- import { GlobalStyle, scopePrefix, cssGlobalVars } from "../core/global-style.js";
5
+ import { GlobalStyle, cssGlobalVars } from "../core/global-style.js";
6
6
 
7
7
  const protoName = "avatar";
8
- const cssScope = scopePrefix(protoName);
9
8
 
10
9
  /**
11
10
  * {@linkcode Avatar} renders a avatar.
@@ -1,4 +1,4 @@
1
- import { attr, constructCSSObject, godown, htmlSlot, htmlStyle, part, styles, toVar } from "@godown/element";
1
+ import { attr, godown, htmlSlot, joinRules, part, StyleController, styles } from "@godown/element";
2
2
  import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
@@ -10,69 +10,77 @@ const cssScope = scopePrefix(protoName);
10
10
  const whiteFont = cssGlobalVars.white;
11
11
  const blackFont = cssGlobalVars.black;
12
12
 
13
- type Colors = "teal" | "blue" | "green" | "red" | "purple" | "orange" | "yellow" | "pink" | "gray" | "white" | "black";
14
- const colors: Record<Colors, string> = constructCSSObject(
15
- ["color", "background", "gradients"].map((k) => `${cssScope}--${k}`),
16
- {
17
- black: [
18
- whiteFont, // color
19
- cssGlobalVars._colors.darkgray[7], // background
20
- cssGlobalVars._colors.darkgray[5], // gradients
21
- ],
22
- gray: [
23
- whiteFont, // color
24
- cssGlobalVars._colors.darkgray[1], // background
25
- cssGlobalVars._colors.lightgray[8], // gradients
26
- ],
27
- white: [
28
- blackFont, // color
29
- cssGlobalVars._colors.lightgray[3], // background
30
- cssGlobalVars._colors.lightgray[0], // gradients
31
- ],
32
- blue: [
33
- whiteFont, // color
34
- cssGlobalVars._colors.blue[6], // background
35
- cssGlobalVars._colors.blue[4], // gradients
36
- ],
37
- green: [
38
- whiteFont, // color
39
- cssGlobalVars._colors.green[6], // background
40
- cssGlobalVars._colors.green[4], // gradients
41
- ],
42
- red: [
43
- whiteFont, // color
44
- cssGlobalVars._colors.red[6], // background
45
- cssGlobalVars._colors.red[4], // gradients
46
- ],
47
- orange: [
48
- whiteFont, // color
49
- cssGlobalVars._colors.orange[6], // background
50
- cssGlobalVars._colors.orange[4], // gradients
51
- ],
52
- pink: [
53
- whiteFont, // color
54
- cssGlobalVars._colors.pink[6], // background
55
- cssGlobalVars._colors.pink[4], // gradients
56
- ],
57
- purple: [
58
- whiteFont, // color
59
- cssGlobalVars._colors.purple[6], // background
60
- cssGlobalVars._colors.purple[4], // gradients
61
- ],
62
- yellow: [
63
- blackFont, // color
64
- cssGlobalVars._colors.yellow[6], // background
65
- cssGlobalVars._colors.yellow[4], // gradients
66
- ],
67
- teal: [
68
- whiteFont, // color
69
- cssGlobalVars._colors.teal[6], // background
70
- cssGlobalVars._colors.teal[4], // gradients
71
- ],
72
- },
73
- () => ":host",
74
- (prop) => toVar(prop),
75
- );
13
+ type Colors =
14
+ | "none"
15
+ | "teal"
16
+ | "blue"
17
+ | "green"
18
+ | "red"
19
+ | "purple"
20
+ | "orange"
21
+ | "yellow"
22
+ | "pink"
23
+ | "gray"
24
+ | "white"
25
+ | "black";
26
+
27
+ const colorDetails = {
28
+ black: [
29
+ whiteFont, // color
30
+ cssGlobalVars._colors.darkgray[7], // background
31
+ cssGlobalVars._colors.darkgray[5], // gradients
32
+ ],
33
+ gray: [
34
+ whiteFont, // color
35
+ cssGlobalVars._colors.darkgray[1], // background
36
+ cssGlobalVars._colors.lightgray[8], // gradients
37
+ ],
38
+ white: [
39
+ blackFont, // color
40
+ cssGlobalVars._colors.lightgray[3], // background
41
+ cssGlobalVars._colors.lightgray[0], // gradients
42
+ ],
43
+ blue: [
44
+ whiteFont, // color
45
+ cssGlobalVars._colors.blue[6], // background
46
+ cssGlobalVars._colors.blue[4], // gradients
47
+ ],
48
+ green: [
49
+ whiteFont, // color
50
+ cssGlobalVars._colors.green[6], // background
51
+ cssGlobalVars._colors.green[4], // gradients
52
+ ],
53
+ red: [
54
+ whiteFont, // color
55
+ cssGlobalVars._colors.red[6], // background
56
+ cssGlobalVars._colors.red[4], // gradients
57
+ ],
58
+ orange: [
59
+ whiteFont, // color
60
+ cssGlobalVars._colors.orange[6], // background
61
+ cssGlobalVars._colors.orange[4], // gradients
62
+ ],
63
+ pink: [
64
+ whiteFont, // color
65
+ cssGlobalVars._colors.pink[6], // background
66
+ cssGlobalVars._colors.pink[4], // gradients
67
+ ],
68
+ purple: [
69
+ whiteFont, // color
70
+ cssGlobalVars._colors.purple[6], // background
71
+ cssGlobalVars._colors.purple[4], // gradients
72
+ ],
73
+ yellow: [
74
+ blackFont, // color
75
+ cssGlobalVars._colors.yellow[6], // background
76
+ cssGlobalVars._colors.yellow[4], // gradients
77
+ ],
78
+ teal: [
79
+ whiteFont, // color
80
+ cssGlobalVars._colors.teal[6], // background
81
+ cssGlobalVars._colors.teal[4], // gradients
82
+ ],
83
+ };
76
84
 
77
85
  /**
78
86
  * {@linkcode Button} renders a button.
@@ -182,6 +190,21 @@ const colors: Record<Colors, string> = constructCSSObject(
182
190
  `,
183
191
  )
184
192
  class Button extends GlobalStyle {
193
+ private __colorSC = new StyleController(this, () => {
194
+ const color = this.nextColor();
195
+ if (color in colorDetails) {
196
+ const [fg, bg, gd] = colorDetails[color];
197
+ return joinRules({
198
+ ":host": [
199
+ [`${cssScope}--color`, `var(${fg})`],
200
+ [`${cssScope}--background`, `var(${bg})`],
201
+ [`${cssScope}--gradients`, `var(${gd})`],
202
+ ],
203
+ });
204
+ }
205
+ return null;
206
+ });
207
+
185
208
  /**
186
209
  * If true, remove gradient, modal animation, focus scale.
187
210
  */
@@ -217,7 +240,7 @@ class Button extends GlobalStyle {
217
240
  * The primary color.
218
241
  */
219
242
  @property({ reflect: true })
220
- color: "none" | keyof typeof colors = "black";
243
+ color: Colors = "black";
221
244
 
222
245
  /**
223
246
  * Content text.
@@ -231,7 +254,6 @@ class Button extends GlobalStyle {
231
254
  protected _root: HTMLElement;
232
255
 
233
256
  protected render(): TemplateResult<1> {
234
- const color = this.nextColor();
235
257
  return html`
236
258
  <div
237
259
  part="root"
@@ -239,7 +261,6 @@ class Button extends GlobalStyle {
239
261
  >
240
262
  ${this.content || htmlSlot()}
241
263
  <span part="modal-root"></span>
242
- ${htmlStyle(colors[color])}
243
264
  </div>
244
265
  `;
245
266
  }
@@ -287,7 +308,7 @@ class Button extends GlobalStyle {
287
308
  modal.addEventListener("animationend", () => modal.remove(), { once: true });
288
309
  }
289
310
 
290
- nextColor(): Colors | "none" {
311
+ nextColor(): Colors {
291
312
  return this.color;
292
313
  }
293
314
  }
@@ -193,7 +193,8 @@ class Carousel extends GlobalStyle {
193
193
  normalizeIndex(i: number): number {
194
194
  if (i < 0) {
195
195
  return 0;
196
- } else if (i > this.children.length - 3) {
196
+ }
197
+ if (i > this.children.length - 3) {
197
198
  return this.children.length - 3;
198
199
  }
199
200
  return i;
@@ -1,10 +1,11 @@
1
- import { attr, tokenList, godown, part, styles, htmlSlot } from "@godown/element";
1
+ import { attr, godown, part, styles, htmlSlot, StyleController } from "@godown/element";
2
2
  import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
3
3
  import { type TemplateResult, css, html, nothing } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
 
6
6
  import { cssGlobalVars } from "../core/global-style.js";
7
7
  import { SuperInput } from "../core/super-input.js";
8
+ import { OutlineBuilder } from "../core/outline.js";
8
9
 
9
10
  const protoName = "input";
10
11
 
@@ -23,9 +24,8 @@ const protoName = "input";
23
24
  display: block;
24
25
  }
25
26
 
26
- :host(:focus-within),
27
- .outline {
28
- ${cssGlobalVars.input}-outline-color: var(${cssGlobalVars.active});
27
+ :host(:focus-within) {
28
+ ${cssGlobalVars.outlineColor}: var(${cssGlobalVars.active});
29
29
  }
30
30
  `)
31
31
  class Input extends SuperInput {
@@ -42,12 +42,19 @@ class Input extends SuperInput {
42
42
  @part("input")
43
43
  protected _input: HTMLInputElement;
44
44
 
45
+ private __outlineSC = new StyleController(
46
+ this,
47
+ () =>
48
+ new OutlineBuilder({ outlineType: this.outlineType }).css +
49
+ (this.variant === "outline" ? `:host{${cssGlobalVars.outlineColor}: var(${cssGlobalVars.active})}` : ""),
50
+ );
51
+
45
52
  protected render(): TemplateResult<1> {
46
53
  return html`
47
54
  <div
48
55
  part="root"
49
56
  ${attr(this.observedRecord)}
50
- class="${tokenList("input-field", this.variant)}"
57
+ class="input-field"
51
58
  >
52
59
  ${[
53
60
  this._renderPrefix(),
@@ -1,4 +1,15 @@
1
- import { attr, tokenList, godown, isNullable, joinProperties, loop, part, styles, Ranger, omit } from "@godown/element";
1
+ import {
2
+ attr,
3
+ tokenList,
4
+ godown,
5
+ isNullable,
6
+ joinDeclarations,
7
+ loop,
8
+ part,
9
+ styles,
10
+ Ranger,
11
+ omit,
12
+ } from "@godown/element";
2
13
  import { type TemplateResult, css, html } from "lit";
3
14
  import { property, queryAll, state } from "lit/decorators.js";
4
15
 
@@ -209,7 +220,7 @@ class Range<V extends RangeValue = RangeValue> extends SuperInput<RangeValue> {
209
220
  part="root"
210
221
  ${attr(this.observedRecord)}
211
222
  @mousedown="${this.disabled ? null : this._handleMousedownRoot}"
212
- style="${joinProperties([
223
+ style="${joinDeclarations([
213
224
  ["--from", `${((from - this.min) / gap) * 100}%`],
214
225
  ["--to", `${((to - this.min) / gap) * 100}%`],
215
226
  ...rangeValue.map(
@@ -236,7 +247,7 @@ class Range<V extends RangeValue = RangeValue> extends SuperInput<RangeValue> {
236
247
  @mousedown="${disabled ? null : this.createMouseDown(index)}"
237
248
  @focus="${disabled ? null : () => this.focusHandle(index)}"
238
249
  @blur="${disabled ? null : this.blurHandle}"
239
- style="${joinProperties({
250
+ style="${joinDeclarations({
240
251
  "z-index": this.__focusStack.indexOf(index) + 1,
241
252
  "--handle": `var(--${end ? "to" : `handle-${index}`})`,
242
253
  })}"
@@ -220,6 +220,7 @@ class Select extends Input {
220
220
 
221
221
  select(value: string, text?: string): 0 | 1 {
222
222
  text ||= value;
223
+ text = text.trim();
223
224
  let operation: 0 | 1 = 0;
224
225
  if (this.multiple) {
225
226
  const i = this.__store.findIndex((s) => s.value === value);
@@ -1,9 +1,10 @@
1
- import { type HandlerEvent, attr, tokenList, godown, styles, loop, omit } from "@godown/element";
1
+ import { type HandlerEvent, attr, tokenList, godown, styles, loop, omit, StyleController } from "@godown/element";
2
2
  import { type TemplateResult, css, html } from "lit";
3
3
  import { property, state } from "lit/decorators.js";
4
4
 
5
5
  import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
6
6
  import { SuperInput } from "../core/super-input.js";
7
+ import { OutlineBuilder } from "../core/outline.js";
7
8
 
8
9
  const protoName = "split";
9
10
  const cssScope = scopePrefix(protoName);
@@ -61,7 +62,7 @@ const cssScope = scopePrefix(protoName);
61
62
 
62
63
  .focus,
63
64
  [part="input-box"]:active {
64
- ${cssGlobalVars.input}-outline-color: var(${cssGlobalVars.active});
65
+ ${cssGlobalVars.outlineColor}: var(${cssGlobalVars.active});
65
66
  }
66
67
  `)
67
68
  class Split extends SuperInput {
@@ -83,6 +84,15 @@ class Split extends SuperInput {
83
84
  @state()
84
85
  currentValue: (string | void)[] = [];
85
86
 
87
+ private __outlineSC = new StyleController(
88
+ this,
89
+ () =>
90
+ new OutlineBuilder({
91
+ selector: "[part=input-box]",
92
+ outlineType: this.outlineType,
93
+ }).css,
94
+ );
95
+
86
96
  get observedRecord(): Record<string, any> {
87
97
  return omit(super.observedRecord, "outline-type");
88
98
  }
@@ -1,4 +1,4 @@
1
- import { attr, godown, htmlSlot, styles, tokenList } from "@godown/element";
1
+ import { attr, godown, htmlSlot, StyleController, styles, tokenList } from "@godown/element";
2
2
  import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
3
3
  import { css, html, type TemplateResult } from "lit";
4
4
  import { property, queryAll } from "lit/decorators.js";
@@ -35,75 +35,67 @@ const mouseEnterAddedToken = "hover";
35
35
  * @category display
36
36
  */
37
37
  @godown(protoName)
38
- @styles(
39
- new OutlineBuilder({
40
- width: `${cssScope}--outline-width`,
41
- color: `${cssScope}--outline-color`,
42
- }).css,
43
- css`
44
- :host {
45
- ${cssScope}--indicator-background: var(${cssGlobalVars._colors.darkgray[7]});
46
- ${cssScope}--outline-color: var(${cssGlobalVars.passive});
47
- ${cssScope}--outline-width: 0.075em;
48
- ${cssScope}--space: 0.25em;
49
- border-radius: var(${cssGlobalVars.borderRadius});
50
- transition: 0.2s ease-in-out;
51
- width: fit-content;
52
- display: flex;
53
- cursor: default;
54
- }
38
+ @styles(css`
39
+ :host {
40
+ ${cssScope}--indicator-background: var(${cssGlobalVars._colors.darkgray[7]});
41
+ ${cssScope}--space: 0.25em;
42
+ border-radius: var(${cssGlobalVars.radius});
43
+ transition: 0.2s ease-in-out;
44
+ width: fit-content;
45
+ display: flex;
46
+ cursor: default;
47
+ }
55
48
 
56
- [part="root"] {
57
- position: relative;
58
- z-index: 1;
59
- display: flex;
60
- flex-direction: inherit;
61
- overflow-x: clip;
62
- border-radius: inherit;
63
- transition: inherit;
64
- transition-property: width, transform, opacity;
65
- padding: var(${cssScope}--space);
66
- gap: var(${cssScope}--space);
67
- }
49
+ [part="root"] {
50
+ position: relative;
51
+ z-index: 1;
52
+ display: flex;
53
+ flex-direction: inherit;
54
+ overflow-x: clip;
55
+ border-radius: inherit;
56
+ transition: inherit;
57
+ transition-property: width, transform, opacity;
58
+ padding: var(${cssScope}--space);
59
+ gap: var(${cssScope}--space);
60
+ }
68
61
 
69
- [useslot] [part~="item"] {
70
- padding: 0;
71
- }
62
+ [useslot] [part~="item"] {
63
+ padding: 0;
64
+ }
72
65
 
73
- [part~="item"] {
74
- width: 100%;
75
- display: block;
76
- padding: 0 0.4em;
77
- position: relative;
78
- white-space: nowrap;
79
- transition: inherit;
80
- border-radius: inherit;
81
- transition-property: inherit;
82
- }
66
+ [part~="item"] {
67
+ width: 100%;
68
+ display: block;
69
+ padding: 0 0.4em;
70
+ position: relative;
71
+ white-space: nowrap;
72
+ transition: inherit;
73
+ border-radius: inherit;
74
+ transition-property: inherit;
75
+ }
83
76
 
84
- [part="indicator"] {
85
- width: 100%;
86
- height: 100%;
87
- inset: 0;
88
- opacity: 0;
89
- z-index: -1;
90
- position: absolute;
91
- transition: inherit;
92
- border-radius: inherit;
93
- transition-property: inherit;
94
- background: var(${cssScope}--indicator-background);
95
- }
77
+ [part="indicator"] {
78
+ width: 100%;
79
+ height: 100%;
80
+ inset: 0;
81
+ opacity: 0;
82
+ z-index: -1;
83
+ position: absolute;
84
+ transition: inherit;
85
+ border-radius: inherit;
86
+ transition-property: inherit;
87
+ background: var(${cssScope}--indicator-background);
88
+ }
96
89
 
97
- [part~="selected"] {
98
- background: var(${cssScope}--indicator-background);
99
- }
90
+ [part~="selected"] {
91
+ background: var(${cssScope}--indicator-background);
92
+ }
100
93
 
101
- [part~="selected"] [part="indicator"],
102
- [part~="hover"] [part="indicator"] {
103
- opacity: 1;
104
- }
105
- `,
106
- )
94
+ [part~="selected"] [part="indicator"],
95
+ [part~="hover"] [part="indicator"] {
96
+ opacity: 1;
97
+ }
98
+ `)
107
99
  class Tabs extends GlobalStyle {
108
100
  @property({ attribute: "outline-type" })
109
101
  outlineType: OutlineType = "border";
@@ -134,6 +126,8 @@ class Tabs extends GlobalStyle {
134
126
  @queryAll("[part=indicator]")
135
127
  protected _indicators: HTMLCollectionOf<HTMLDivElement>;
136
128
 
129
+ private __outlineSC = new StyleController(this, () => new OutlineBuilder({ outlineType: this.outlineType }).css);
130
+
137
131
  render(): TemplateResult<1> {
138
132
  return html`
139
133
  <ul