godown 3.2.0 → 3.4.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 (262) 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 -3
  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 +5 -4
  17. package/components/avatar.d.ts.map +1 -1
  18. package/components/avatar.js +1 -1
  19. package/components/avatar.js.map +1 -1
  20. package/components/badge.d.ts +10 -2
  21. package/components/badge.d.ts.map +1 -1
  22. package/components/badge.js.map +1 -1
  23. package/components/breath.d.ts +2 -3
  24. package/components/breath.d.ts.map +1 -1
  25. package/components/breath.js +1 -1
  26. package/components/breath.js.map +1 -1
  27. package/components/button.d.ts +8 -3
  28. package/components/button.d.ts.map +1 -1
  29. package/components/button.js +1 -1
  30. package/components/button.js.map +1 -1
  31. package/components/card.d.ts +6 -0
  32. package/components/card.d.ts.map +1 -1
  33. package/components/card.js +1 -1
  34. package/components/card.js.map +1 -1
  35. package/components/carousel.d.ts +7 -13
  36. package/components/carousel.d.ts.map +1 -1
  37. package/components/carousel.js +1 -1
  38. package/components/carousel.js.map +1 -1
  39. package/components/details.d.ts +3 -3
  40. package/components/details.d.ts.map +1 -1
  41. package/components/dialog.d.ts +9 -6
  42. package/components/dialog.d.ts.map +1 -1
  43. package/components/dialog.js +1 -1
  44. package/components/dialog.js.map +1 -1
  45. package/components/divider.d.ts +1 -1
  46. package/components/heading.d.ts +2 -0
  47. package/components/heading.d.ts.map +1 -1
  48. package/components/heading.js.map +1 -1
  49. package/components/input.d.ts +2 -2
  50. package/components/input.d.ts.map +1 -1
  51. package/components/input.js +1 -1
  52. package/components/input.js.map +1 -1
  53. package/components/link.d.ts +1 -1
  54. package/components/link.d.ts.map +1 -1
  55. package/components/link.js +1 -1
  56. package/components/link.js.map +1 -1
  57. package/components/progress.d.ts +0 -7
  58. package/components/progress.d.ts.map +1 -1
  59. package/components/progress.js +1 -1
  60. package/components/progress.js.map +1 -1
  61. package/components/range.d.ts +48 -19
  62. package/components/range.d.ts.map +1 -1
  63. package/components/range.js +1 -1
  64. package/components/range.js.map +1 -1
  65. package/components/rotate.d.ts +6 -4
  66. package/components/rotate.d.ts.map +1 -1
  67. package/components/rotate.js.map +1 -1
  68. package/components/router.d.ts.map +1 -1
  69. package/components/router.js +1 -1
  70. package/components/router.js.map +1 -1
  71. package/components/select.d.ts +4 -2
  72. package/components/select.d.ts.map +1 -1
  73. package/components/select.js +1 -1
  74. package/components/select.js.map +1 -1
  75. package/components/split.d.ts +2 -1
  76. package/components/split.d.ts.map +1 -1
  77. package/components/split.js +1 -1
  78. package/components/split.js.map +1 -1
  79. package/components/switch.d.ts +5 -7
  80. package/components/switch.d.ts.map +1 -1
  81. package/components/switch.js +1 -1
  82. package/components/switch.js.map +1 -1
  83. package/components/text.js +1 -1
  84. package/components/text.js.map +1 -1
  85. package/components/time.d.ts +2 -5
  86. package/components/time.d.ts.map +1 -1
  87. package/components/time.js +1 -1
  88. package/components/time.js.map +1 -1
  89. package/components/tooltip.d.ts +3 -2
  90. package/components/tooltip.d.ts.map +1 -1
  91. package/components/tooltip.js +1 -1
  92. package/components/tooltip.js.map +1 -1
  93. package/components/typewriter.d.ts.map +1 -1
  94. package/components/typewriter.js +1 -1
  95. package/components/typewriter.js.map +1 -1
  96. package/core/direction.d.ts +27 -0
  97. package/core/direction.d.ts.map +1 -0
  98. package/core/direction.js +2 -0
  99. package/core/direction.js.map +1 -0
  100. package/core/global-style.d.ts +1 -2
  101. package/core/global-style.d.ts.map +1 -1
  102. package/core/global-style.js +1 -1
  103. package/core/global-style.js.map +1 -1
  104. package/core/outline.d.ts +20 -0
  105. package/core/outline.d.ts.map +1 -0
  106. package/core/outline.js +2 -0
  107. package/core/outline.js.map +1 -0
  108. package/core/super-anchor.d.ts +2 -2
  109. package/core/super-anchor.d.ts.map +1 -1
  110. package/core/super-anchor.js +1 -1
  111. package/core/super-anchor.js.map +1 -1
  112. package/core/super-input.d.ts +2 -0
  113. package/core/super-input.d.ts.map +1 -1
  114. package/core/super-input.js +1 -1
  115. package/core/super-input.js.map +1 -1
  116. package/core/super-openable.d.ts +0 -4
  117. package/core/super-openable.d.ts.map +1 -1
  118. package/custom-elements.json +1 -1
  119. package/dev/components/alert.d.ts +1 -3
  120. package/dev/components/alert.d.ts.map +1 -1
  121. package/dev/components/alert.js +33 -57
  122. package/dev/components/alert.js.map +1 -1
  123. package/dev/components/avatar.d.ts +5 -4
  124. package/dev/components/avatar.d.ts.map +1 -1
  125. package/dev/components/avatar.js +5 -4
  126. package/dev/components/avatar.js.map +1 -1
  127. package/dev/components/badge.d.ts +10 -2
  128. package/dev/components/badge.d.ts.map +1 -1
  129. package/dev/components/badge.js +8 -0
  130. package/dev/components/badge.js.map +1 -1
  131. package/dev/components/breath.d.ts +2 -3
  132. package/dev/components/breath.d.ts.map +1 -1
  133. package/dev/components/breath.js +3 -14
  134. package/dev/components/breath.js.map +1 -1
  135. package/dev/components/button.d.ts +8 -3
  136. package/dev/components/button.d.ts.map +1 -1
  137. package/dev/components/button.js +19 -5
  138. package/dev/components/button.js.map +1 -1
  139. package/dev/components/card.d.ts +6 -0
  140. package/dev/components/card.d.ts.map +1 -1
  141. package/dev/components/card.js +11 -11
  142. package/dev/components/card.js.map +1 -1
  143. package/dev/components/carousel.d.ts +7 -13
  144. package/dev/components/carousel.d.ts.map +1 -1
  145. package/dev/components/carousel.js +40 -39
  146. package/dev/components/carousel.js.map +1 -1
  147. package/dev/components/details.d.ts +3 -3
  148. package/dev/components/details.d.ts.map +1 -1
  149. package/dev/components/details.js +3 -3
  150. package/dev/components/details.js.map +1 -1
  151. package/dev/components/dialog.d.ts +9 -6
  152. package/dev/components/dialog.d.ts.map +1 -1
  153. package/dev/components/dialog.js +58 -62
  154. package/dev/components/dialog.js.map +1 -1
  155. package/dev/components/divider.d.ts +1 -1
  156. package/dev/components/divider.js +1 -1
  157. package/dev/components/heading.d.ts +2 -0
  158. package/dev/components/heading.d.ts.map +1 -1
  159. package/dev/components/heading.js +2 -0
  160. package/dev/components/heading.js.map +1 -1
  161. package/dev/components/input.d.ts +2 -2
  162. package/dev/components/input.d.ts.map +1 -1
  163. package/dev/components/input.js +30 -9
  164. package/dev/components/input.js.map +1 -1
  165. package/dev/components/link.d.ts +1 -1
  166. package/dev/components/link.d.ts.map +1 -1
  167. package/dev/components/link.js +2 -2
  168. package/dev/components/link.js.map +1 -1
  169. package/dev/components/progress.d.ts +0 -7
  170. package/dev/components/progress.d.ts.map +1 -1
  171. package/dev/components/progress.js +4 -25
  172. package/dev/components/progress.js.map +1 -1
  173. package/dev/components/range.d.ts +48 -19
  174. package/dev/components/range.d.ts.map +1 -1
  175. package/dev/components/range.js +83 -61
  176. package/dev/components/range.js.map +1 -1
  177. package/dev/components/rotate.d.ts +6 -4
  178. package/dev/components/rotate.d.ts.map +1 -1
  179. package/dev/components/rotate.js +6 -4
  180. package/dev/components/rotate.js.map +1 -1
  181. package/dev/components/router.d.ts.map +1 -1
  182. package/dev/components/router.js +2 -3
  183. package/dev/components/router.js.map +1 -1
  184. package/dev/components/select.d.ts +4 -2
  185. package/dev/components/select.d.ts.map +1 -1
  186. package/dev/components/select.js +27 -24
  187. package/dev/components/select.js.map +1 -1
  188. package/dev/components/split.d.ts +2 -1
  189. package/dev/components/split.d.ts.map +1 -1
  190. package/dev/components/split.js +11 -7
  191. package/dev/components/split.js.map +1 -1
  192. package/dev/components/switch.d.ts +5 -7
  193. package/dev/components/switch.d.ts.map +1 -1
  194. package/dev/components/switch.js +23 -45
  195. package/dev/components/switch.js.map +1 -1
  196. package/dev/components/text.js +2 -2
  197. package/dev/components/time.d.ts +2 -5
  198. package/dev/components/time.d.ts.map +1 -1
  199. package/dev/components/time.js +6 -20
  200. package/dev/components/time.js.map +1 -1
  201. package/dev/components/tooltip.d.ts +3 -2
  202. package/dev/components/tooltip.d.ts.map +1 -1
  203. package/dev/components/tooltip.js +7 -19
  204. package/dev/components/tooltip.js.map +1 -1
  205. package/dev/components/typewriter.d.ts.map +1 -1
  206. package/dev/components/typewriter.js +2 -2
  207. package/dev/components/typewriter.js.map +1 -1
  208. package/dev/core/direction.d.ts +27 -0
  209. package/dev/core/direction.d.ts.map +1 -0
  210. package/dev/core/direction.js +56 -0
  211. package/dev/core/direction.js.map +1 -0
  212. package/dev/core/global-style.d.ts +1 -2
  213. package/dev/core/global-style.d.ts.map +1 -1
  214. package/dev/core/global-style.js +11 -11
  215. package/dev/core/global-style.js.map +1 -1
  216. package/dev/core/outline.d.ts +20 -0
  217. package/dev/core/outline.d.ts.map +1 -0
  218. package/dev/core/outline.js +44 -0
  219. package/dev/core/outline.js.map +1 -0
  220. package/dev/core/super-anchor.d.ts +2 -2
  221. package/dev/core/super-anchor.d.ts.map +1 -1
  222. package/dev/core/super-anchor.js +0 -1
  223. package/dev/core/super-anchor.js.map +1 -1
  224. package/dev/core/super-input.d.ts +2 -0
  225. package/dev/core/super-input.d.ts.map +1 -1
  226. package/dev/core/super-input.js +19 -30
  227. package/dev/core/super-input.js.map +1 -1
  228. package/dev/core/super-openable.d.ts +0 -4
  229. package/dev/core/super-openable.d.ts.map +1 -1
  230. package/package.json +3 -3
  231. package/src/components/alert.ts +34 -65
  232. package/src/components/avatar.ts +7 -5
  233. package/src/components/badge.ts +10 -3
  234. package/src/components/breath.ts +5 -17
  235. package/src/components/button.ts +19 -6
  236. package/src/components/card.ts +11 -11
  237. package/src/components/carousel.ts +45 -44
  238. package/src/components/details.ts +3 -3
  239. package/src/components/dialog.ts +66 -65
  240. package/src/components/divider.ts +1 -1
  241. package/src/components/heading.ts +2 -0
  242. package/src/components/input.ts +30 -9
  243. package/src/components/link.ts +2 -2
  244. package/src/components/progress.ts +4 -25
  245. package/src/components/range.ts +92 -70
  246. package/src/components/rotate.ts +6 -4
  247. package/src/components/router.ts +2 -3
  248. package/src/components/select.ts +33 -26
  249. package/src/components/split.ts +12 -7
  250. package/src/components/switch.ts +26 -41
  251. package/src/components/text.ts +2 -2
  252. package/src/components/time.ts +10 -25
  253. package/src/components/tooltip.ts +8 -20
  254. package/src/components/typewriter.ts +9 -7
  255. package/src/core/direction.ts +65 -0
  256. package/src/core/global-style.ts +12 -14
  257. package/src/core/outline.ts +54 -0
  258. package/src/core/super-anchor.ts +3 -2
  259. package/src/core/super-input.ts +22 -30
  260. package/src/core/super-openable.ts +0 -8
  261. package/vscode.html-custom-data.json +1 -1
  262. package/web-types.json +1 -1
@@ -1,9 +1,10 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr, classList, godown, part, styles } from "@godown/element";
2
+ import { attr, tokenList, godown, part, styles, htmlSlot } from "@godown/element";
3
+ import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
3
4
  import { css, html, nothing } from "lit";
4
5
  import { property } from "lit/decorators.js";
5
6
  import { cssGlobalVars } from "../core/global-style.js";
6
- import SuperInput from "../core/super-input.js";
7
+ import { SuperInput } from "../core/super-input.js";
7
8
  const protoName = "input";
8
9
  /**
9
10
  * {@linkcode Input} renders a text input.
@@ -26,7 +27,7 @@ let Input = class Input extends SuperInput {
26
27
  <div
27
28
  part="root"
28
29
  ${attr(this.observedRecord)}
29
- class="${classList("input-field", this.variant)}"
30
+ class="${tokenList("input-field", this.variant)}"
30
31
  >
31
32
  ${[
32
33
  this._renderPrefix(),
@@ -49,9 +50,27 @@ let Input = class Input extends SuperInput {
49
50
  </div>
50
51
  `;
51
52
  }
52
- reset() {
53
- this._input.value = this.default;
54
- this.value = this.default;
53
+ _renderSuffix() {
54
+ const PASSWORD = "password";
55
+ return html `
56
+ <label
57
+ for=${this.makeId}
58
+ part="suffix"
59
+ >
60
+ ${this.type === PASSWORD
61
+ ? html `
62
+ <i
63
+ part="icon"
64
+ @mousedown="${() => this._changeInputType("text")}"
65
+ @mouseup="${() => this._changeInputType(PASSWORD)}"
66
+ @mouseleave="${() => this._changeInputType(PASSWORD)}"
67
+ >
68
+ ${iconEyeSlashFill()}
69
+ </i>
70
+ `
71
+ : htmlSlot("suffix")}
72
+ </label>
73
+ `;
55
74
  }
56
75
  };
57
76
  __decorate([
@@ -66,11 +85,13 @@ Input = __decorate([
66
85
  :host {
67
86
  width: var(${cssGlobalVars.input}-width);
68
87
  height: var(${cssGlobalVars.input}-height);
69
- color: var(${cssGlobalVars.foreground});
70
- background: var(${cssGlobalVars.input}-background);
71
- border-radius: var(${cssGlobalVars.input}-radius);
72
88
  display: block;
73
89
  }
90
+
91
+ :host(:focus-within),
92
+ .outline {
93
+ ${cssGlobalVars.input}-outline-color: var(${cssGlobalVars.active});
94
+ }
74
95
  `)
75
96
  ], Input);
76
97
  export default Input;
@@ -1 +1 @@
1
- {"version":3,"file":"input.js","sourceRoot":"","sources":["../../src/components/input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAEhD,MAAM,SAAS,GAAG,OAAO,CAAC;AAE1B;;;;;;GAMG;AAYH,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,UAAU;IAA9B;;QACE,SAAI,GAA6D,MAAM,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BAGc,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC;4BACrC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;+BAClC,GAAG,EAAE,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;;kBAElD,gBAAgB,EAAE;;aAEvB;YACH,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;;KAEzB,CAAC;IACJ,CAAC;CACF,CAAA;AAxDC;IADC,QAAQ,EAAE;sCACgC;AAGjC;IADT,IAAI,CAAC,OAAO,CAAC;qCACqB;AAZ/B,KAAK;IAbV,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;iBAEM,aAAa,CAAC,KAAK;kBAClB,aAAa,CAAC,KAAK;;;;;;MAM/B,aAAa,CAAC,KAAK,uBAAuB,aAAa,CAAC,MAAM;;CAEnE,CAAC;GACI,KAAK,CAiEV;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import SuperAnchor from "../core/super-anchor.js";
1
+ import { SuperAnchor } from "../core/super-anchor.js";
2
2
  declare const linkTypes: {
3
3
  readonly push: "push";
4
4
  readonly replace: "replace";
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.ts"],"names":[],"mappings":"AAGA,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAKlD,QAAA,MAAM,SAAS;;;;;CAKL,CAAC;AAEX,KAAK,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,cACM,IAAK,SAAQ,WAAW;IAC5B;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,CAAkB;IAEhC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IACH,KAAK,KAAM;IAEX,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA0B3C,WAAW,EAAE,MAAM,IAAI,CAcrB;CACH;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAKtD,QAAA,MAAM,SAAS;;;;;CAKL,CAAC;AAEX,KAAK,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,cACM,IAAK,SAAQ,WAAW;IAC5B;;;;;;OAMG;IAEH,IAAI,EAAE,QAAQ,CAAkB;IAEhC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,OAAO,UAAS;IAEhB;;OAEG;IACH,KAAK,KAAM;IAEX,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IA0B3C,WAAW,EAAE,MAAM,IAAI,CAcrB;CACH;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { godown } from "@godown/element";
3
3
  import { property } from "lit/decorators.js";
4
- import SuperAnchor from "../core/super-anchor.js";
4
+ import { SuperAnchor } from "../core/super-anchor.js";
5
5
  import Router from "./router.js";
6
6
  const protoName = "link";
7
7
  const linkTypes = {
@@ -55,13 +55,13 @@ let Link = class Link extends SuperAnchor {
55
55
  this.handleState = () => {
56
56
  switch (this.type) {
57
57
  case linkTypes.auto:
58
- // biome-ignore lint: if replace is true, fallthrough to replace case
59
58
  case linkTypes.push:
60
59
  if (!this.replace) {
61
60
  // type is auto or push and replace is false
62
61
  history.pushState(this.state, "", this.href);
63
62
  break;
64
63
  }
64
+ // fallthrough to replace
65
65
  case linkTypes.replace:
66
66
  history.replaceState(this.state, "", this.href);
67
67
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["../../src/components/link.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,WAAW,MAAM,yBAAyB,CAAC;AAClD,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEzB,MAAM,SAAS,GAAG;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;CACJ,CAAC;AAIX;;;;;;;;;;;;;;;;;;GAkBG;AAEH,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,WAAW;IAA9B;;QACE;;;;;;WAMG;QAEH,SAAI,GAAa,SAAS,CAAC,IAAI,CAAC;QAEhC;;WAEG;QAEH,aAAQ,GAAG,KAAK,CAAC;QAEjB;;WAEG;QAEH,YAAO,GAAG,KAAK,CAAC;QAEhB;;WAEG;QACH,UAAK,GAAG,EAAE,CAAC;QA4BX,gBAAW,GAAe,GAAG,EAAE;YAC7B,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClB,KAAK,SAAS,CAAC,IAAI,CAAC;gBACpB,qEAAqE;gBACrE,KAAK,SAAS,CAAC,IAAI;oBACjB,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;wBAClB,4CAA4C;wBAC5C,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;wBAC7C,MAAM;oBACR,CAAC;gBACH,KAAK,SAAS,CAAC,OAAO;oBACpB,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;oBAChD,MAAM;YAC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value: number;
12
12
  protected render(): TemplateResult<1>;
13
- /**
14
- * Convert s to a percentage without a percent sign.
15
- *
16
- * @param s String or number to convert.
17
- * @returns Percentage without a percent sign.
18
- */
19
- parsePercent(s?: string | number): number;
20
13
  }
21
14
  export default Progress;
22
15
  export { Progress };
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAIrE;;;;GAIG;AACH,cA+CM,QAAS,SAAQ,WAAW;IAEhC,GAAG,SAAK;IAGR,GAAG,SAAK;IAGR,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IA0BrC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,GAAE,MAAM,GAAG,MAAY,GAAG,MAAM;CAW/C;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../src/components/progress.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAIrE;;;;GAIG;AACH,cAgDM,QAAS,SAAQ,WAAW;IAEhC,GAAG,SAAK;IAGR,GAAG,SAAK;IAGR,KAAK,EAAE,MAAM,CAAC;IAEd,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;CAqBtC;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr, godown, isNil, styles } from "@godown/element";
2
+ import { attr, godown, isNil, Ranger, styles } from "@godown/element";
3
3
  import { css, html } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
  import { GlobalStyle, cssGlobalVars } from "../core/global-style.js";
@@ -19,13 +19,8 @@ let Progress = class Progress extends GlobalStyle {
19
19
  let width = 20;
20
20
  let className;
21
21
  if (!isNil(this.value)) {
22
- width = this.parsePercent(this.value);
23
- if (width > 100) {
24
- width = 100;
25
- }
26
- else if (width < 0) {
27
- width = 0;
28
- }
22
+ const ranger = new Ranger(this.min, this.max);
23
+ width = ranger.restrict(this.value / ranger.diff) * 100;
29
24
  className = "static";
30
25
  }
31
26
  return html `
@@ -41,23 +36,6 @@ let Progress = class Progress extends GlobalStyle {
41
36
  </div>
42
37
  `;
43
38
  }
44
- /**
45
- * Convert s to a percentage without a percent sign.
46
- *
47
- * @param s String or number to convert.
48
- * @returns Percentage without a percent sign.
49
- */
50
- parsePercent(s = "0") {
51
- s = String(s);
52
- if (s.includes("%")) {
53
- return parseFloat(s);
54
- }
55
- const diff = this.max - this.min;
56
- if (diff === 0) {
57
- return 100;
58
- }
59
- return (parseFloat(s) / diff) * 100;
60
- }
61
39
  };
62
40
  __decorate([
63
41
  property({ type: Number })
@@ -89,6 +67,7 @@ Progress = __decorate([
89
67
  z-index: 1;
90
68
  position: relative;
91
69
  border-radius: inherit;
70
+ overflow: hidden;
92
71
  }
93
72
 
94
73
  [part="value"] {
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","sourceRoot":"","sources":["../../src/components/progress.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,SAAS,GAAG,UAAU,CAAC;AAE7B;;;;GAIG;AAgDH,I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,GAAG,CAAC;YACxD,SAAS,GAAG,QAAQ,CAAC;QACvB,CAAC;QACD,OAAO,IAAI,CAAA;;;UAGL,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC;iBAClB,SAAS;;;;yBAID,KAAK;;;KAGzB,CAAC;IACJ,CAAC;CACF,CAAA;AA7BC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACnB;AAGR;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;qCACnB;AAGR;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCACb;AARV,QAAQ;IAhDb,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CAAC,GAAG,CAAA;;;;;sBAKW,aAAa,CAAC,OAAO;iBAC1B,aAAa,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCpC,CAAC;GACI,QAAQ,CA+Bb;AAED,eAAe,QAAQ,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -1,11 +1,12 @@
1
+ import { Ranger } from "@godown/element";
1
2
  import { type TemplateResult } from "lit";
2
- import SuperInput from "../core/super-input.js";
3
+ import { SuperInput } from "../core/super-input.js";
3
4
  /**
4
5
  * {@linkcode Range} is similar to `<input type="range">`.
5
6
  *
6
7
  * Value accepts number, or array.
7
8
  *
8
- * Number has 1 handle, the array has the number of its elements and the minimum is 2.
9
+ * Number has 1 handle, the array has the number of its elements.
9
10
  *
10
11
  * @fires input - Fires when the input value changes.
11
12
  * @fires change - Fires when the input value changes.
@@ -28,7 +29,7 @@ declare class Range extends SuperInput {
28
29
  */
29
30
  step: number;
30
31
  /**
31
- * Display vertically.
32
+ * Whether to display the range vertically.
32
33
  */
33
34
  vertical: boolean;
34
35
  /**
@@ -44,44 +45,72 @@ declare class Range extends SuperInput {
44
45
  protected _root: HTMLElement;
45
46
  protected _handles: NodeListOf<HTMLElement>;
46
47
  lastFocus?: number;
48
+ protected _ranger: Ranger;
47
49
  private __focusStack;
48
- /**
49
- * Returns true when the second number is greater than the first number.
50
- */
51
- get reverse(): boolean;
52
- /**
53
- * If value is array.
54
- */
55
50
  get range(): boolean;
56
51
  /**
57
52
  * Return values in the form of an array.
58
53
  */
59
54
  get rangeValue(): number[];
60
55
  /**
61
- * @param len Minimum result length.
62
- * @param value Fill value.
63
- * @returns Array with length of len.
56
+ * Pad the value to the specified length.
64
57
  */
65
58
  padValue(len: number, value?: number): number[];
59
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void;
60
+ get observedRecord(): Record<string, any>;
66
61
  protected render(): TemplateResult<1>;
67
62
  protected _renderHandle(index: number): TemplateResult<1>;
68
63
  private __keydownEvent;
64
+ /**
65
+ * Focuses the handle at the given index, updates the focus stack, and dispatches a "focus" event.
66
+ * @param index - The index of the handle to focus.
67
+ */
69
68
  focusHandle(index: number): void;
69
+ /**
70
+ * Removes the focus from the currently focused handle and dispatches a "blur" event.
71
+ */
70
72
  blurHandle(): void;
73
+ /**
74
+ * Creates a keydown event handler that updates the value of the range based on arrow key presses.
75
+ * @param index - The index of the handle to update.
76
+ * @returns A function that handles the keydown event and updates the range value.
77
+ */
71
78
  protected createKeydownEvent(index: number): (e: KeyboardEvent) => void;
72
- createMouseDown(index: number): (e: MouseEvent) => void;
73
- createSetValue(index: number): (numberOrModifier: number | ((value: number) => number)) => void;
79
+ /**
80
+ * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
81
+ * @param index - The index of the handle to focus.
82
+ * @returns A function that handles the mouse down event and updates the range value.
83
+ */
84
+ protected createMouseDown(index: number): (e: MouseEvent) => void;
85
+ /**
86
+ * Creates a function that sets the value of the range at the given index.
87
+ * @param index - The index of the value to set.
88
+ * @returns A function that sets the value of the range.
89
+ */
90
+ protected createSetValue(index: number): (value: number) => void;
74
91
  /**
75
92
  * Compute value from event.
93
+ * @returns The value closest to the event client position.
76
94
  */
77
- protected _computeValue(e: MouseEvent): number;
95
+ protected _computeValue({ clientX, clientY }: MouseEvent): number;
78
96
  /**
79
- * Ensure that the values do not exceed the range of max and min.
97
+ * Handles the mouse down event on the root element of the range component.
98
+ * Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.
99
+ * @param e - The mouse down event object.
80
100
  */
81
- normalizeValue(value: number): number;
82
101
  protected _handleMousedownRoot(e: MouseEvent): void;
102
+ /**
103
+ * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
104
+ * @param index - The index of the handle to focus.
105
+ * @returns A function that handles the mouse down event and updates the range value.
106
+ */
83
107
  protected createMousedownListener(mouseMoveCallback: (arg0: number) => void): (e: MouseEvent) => void;
84
- protected createMousemoveListener(callback: (arg0: number) => void): (e: MouseEvent) => void;
108
+ /**
109
+ * Creates a mouse move event handler that updates the range value based on the mouse position.
110
+ * @param callback - A function to call with the new value when the mouse is moved.
111
+ * @returns A function that handles the mouse move event and updates the range value.
112
+ */
113
+ protected createMousemoveListener(callback: (newValue: number) => void): (e: MouseEvent) => void;
85
114
  protected _connectedInit(): void;
86
115
  reset(): void;
87
116
  sort(): number | number[];
@@ -1 +1 @@
1
- {"version":3,"file":"range.d.ts","sourceRoot":"","sources":["../../src/components/range.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAIrD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAKhD;;;;;;;;;;;;;GAaG;AACH,cA8FM,KAAM,SAAQ,UAAU;IAC5B;;OAEG;IAEH,GAAG,SAAK;IAER;;OAEG;IAEH,GAAG,SAAO;IAEV;;OAEG;IAEH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;;;OAIG;IAEH,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEzB;;OAEG;IAEH,OAAO,EAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAG3B,SAAS,CAAC,KAAK,EAAE,WAAW,CA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AAE;IAIzB,QAAQ,IAAI,MAAM,GAAG,MAAM,EAAE;CAM9B;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr, classList, godown, isNil, joinProperties, loop, part, styles } from "@godown/element";
2
+ import { attr, tokenList, godown, isNil, joinProperties, loop, part, styles, Ranger, omit } from "@godown/element";
3
3
  import { css, html } from "lit";
4
4
  import { property, queryAll, state } from "lit/decorators.js";
5
5
  import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
6
- import SuperInput from "../core/super-input.js";
6
+ import { SuperInput } from "../core/super-input.js";
7
7
  const protoName = "range";
8
8
  const cssScope = scopePrefix(protoName);
9
9
  /**
@@ -11,7 +11,7 @@ const cssScope = scopePrefix(protoName);
11
11
  *
12
12
  * Value accepts number, or array.
13
13
  *
14
- * Number has 1 handle, the array has the number of its elements and the minimum is 2.
14
+ * Number has 1 handle, the array has the number of its elements.
15
15
  *
16
16
  * @fires input - Fires when the input value changes.
17
17
  * @fires change - Fires when the input value changes.
@@ -32,20 +32,11 @@ let Range = class Range extends SuperInput {
32
32
  */
33
33
  this.max = 100;
34
34
  /**
35
- * Display vertically.
35
+ * Whether to display the range vertically.
36
36
  */
37
37
  this.vertical = false;
38
38
  this.__focusStack = [];
39
39
  }
40
- /**
41
- * Returns true when the second number is greater than the first number.
42
- */
43
- get reverse() {
44
- return this.range ? this.value[0] > this.value[1] : false;
45
- }
46
- /**
47
- * If value is array.
48
- */
49
40
  get range() {
50
41
  return Array.isArray(this.value);
51
42
  }
@@ -56,9 +47,7 @@ let Range = class Range extends SuperInput {
56
47
  return (this.range ? this.value : [this.value]);
57
48
  }
58
49
  /**
59
- * @param len Minimum result length.
60
- * @param value Fill value.
61
- * @returns Array with length of len.
50
+ * Pad the value to the specified length.
62
51
  */
63
52
  padValue(len, value = 0) {
64
53
  const { rangeValue } = this;
@@ -68,23 +57,30 @@ let Range = class Range extends SuperInput {
68
57
  }
69
58
  return rangeValue;
70
59
  }
60
+ attributeChangedCallback(name, _old, value) {
61
+ super.attributeChangedCallback(name, _old, value);
62
+ if (name === "max" || name === "min" || name === "step") {
63
+ this._ranger = new Ranger(this.min, this.max, this.step);
64
+ }
65
+ }
66
+ get observedRecord() {
67
+ return omit(super.observedRecord, "outline-type");
68
+ }
71
69
  render() {
72
70
  const rangeValue = this.padValue(2);
73
71
  const from = Math.min(...rangeValue);
74
72
  const to = Math.max(...rangeValue);
75
- const gap = this.max - this.min;
73
+ const gap = this._ranger.diff;
76
74
  return html `
77
75
  <div
78
76
  part="root"
79
77
  ${attr(this.observedRecord)}
80
78
  @mousedown="${this.disabled ? null : this._handleMousedownRoot}"
81
- style="${joinProperties({
82
- "--from": `${((from - this.min) / gap) * 100}%`,
83
- "--to": `${((to - this.min) / gap) * 100}%`,
84
- ...(this.range
85
- ? Object.fromEntries(rangeValue.map((value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`]))
86
- : {}),
87
- })}"
79
+ style="${joinProperties([
80
+ ["--from", `${((from - this.min) / gap) * 100}%`],
81
+ ["--to", `${((to - this.min) / gap) * 100}%`],
82
+ ...rangeValue.map((value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`]),
83
+ ])}"
88
84
  >
89
85
  <div part="track"></div>
90
86
  ${loop(this.rangeValue.length, (index) => this._renderHandle(index))}
@@ -92,22 +88,28 @@ let Range = class Range extends SuperInput {
92
88
  `;
93
89
  }
94
90
  _renderHandle(index) {
95
- const { range } = this;
96
- const end = !range || index === this.value.length - 1;
91
+ const { disabled, range, rangeValue } = this;
92
+ // in single-handle mod (value is a number or an array with length 1),
93
+ const end = !range || (range && index === rangeValue.length - 1 && rangeValue.length === 1);
97
94
  return html `
98
95
  <i
99
96
  tabindex="0"
100
97
  part="handle"
101
- class="${classList({ "last-focus": this.lastFocus === index })}"
102
- @mousedown="${this.disabled ? null : this.createMouseDown(index)}"
103
- @focus="${this.disabled ? null : () => this.focusHandle(index)}"
104
- @blur="${this.disabled ? null : this.blurHandle}"
105
- style="z-index:${this.__focusStack.indexOf(index) + 1};--handle:var(--${
106
- /* In single-handle mod or end, it is max value */
107
- !range && end ? "to" : `handle-${index}`})"
98
+ class="${tokenList({ "last-focus": this.lastFocus === index })}"
99
+ @mousedown="${disabled ? null : this.createMouseDown(index)}"
100
+ @focus="${disabled ? null : () => this.focusHandle(index)}"
101
+ @blur="${disabled ? null : this.blurHandle}"
102
+ style="${joinProperties({
103
+ "z-index": this.__focusStack.indexOf(index) + 1,
104
+ "--handle": `var(--${end ? "to" : `handle-${index}`})`,
105
+ })}"
108
106
  ></i>
109
107
  `;
110
108
  }
109
+ /**
110
+ * Focuses the handle at the given index, updates the focus stack, and dispatches a "focus" event.
111
+ * @param index - The index of the handle to focus.
112
+ */
111
113
  focusHandle(index) {
112
114
  this.lastFocus = index;
113
115
  const indexOfFocusStack = this.__focusStack.indexOf(index);
@@ -122,41 +124,59 @@ let Range = class Range extends SuperInput {
122
124
  }
123
125
  this.dispatchEvent(new CustomEvent("focus", { detail: index }));
124
126
  }
127
+ /**
128
+ * Removes the focus from the currently focused handle and dispatches a "blur" event.
129
+ */
125
130
  blurHandle() {
126
131
  this.lastFocus = undefined;
127
132
  this.__keydownEvent = this.events.remove(document, "keydown", this.__keydownEvent);
128
133
  this.dispatchEvent(new CustomEvent("blur"));
129
134
  }
135
+ /**
136
+ * Creates a keydown event handler that updates the value of the range based on arrow key presses.
137
+ * @param index - The index of the handle to update.
138
+ * @returns A function that handles the keydown event and updates the range value.
139
+ */
130
140
  createKeydownEvent(index) {
131
- if (!this.range) {
141
+ const { rangeValue, step } = this;
142
+ if (rangeValue.length < 2) {
132
143
  index = 0;
133
144
  }
134
145
  return (e) => {
146
+ const old = rangeValue[index];
135
147
  if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
136
148
  e.preventDefault();
137
- this.createSetValue(index)((old) => old - this.step);
149
+ this.createSetValue(index)(old - step);
138
150
  }
139
151
  else if (e.key === "ArrowRight" || e.key === "ArrowUp") {
140
152
  e.preventDefault();
141
- this.createSetValue(index)((old) => old + this.step);
153
+ this.createSetValue(index)(old + step);
142
154
  }
143
155
  };
144
156
  }
157
+ /**
158
+ * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
159
+ * @param index - The index of the handle to focus.
160
+ * @returns A function that handles the mouse down event and updates the range value.
161
+ */
145
162
  createMouseDown(index) {
146
163
  return (e) => {
147
164
  this.focusHandle(index);
148
165
  this.createMousedownListener(this.createSetValue(index))(e);
149
166
  };
150
167
  }
168
+ /**
169
+ * Creates a function that sets the value of the range at the given index.
170
+ * @param index - The index of the value to set.
171
+ * @returns A function that sets the value of the range.
172
+ */
151
173
  createSetValue(index) {
152
- return (numberOrModifier) => {
153
- const number = typeof numberOrModifier === "number"
154
- ? this.normalizeValue(numberOrModifier)
155
- : numberOrModifier(this.rangeValue[index]);
156
- let newValue = number;
174
+ return (value) => {
175
+ const normalizeValue = this._ranger.normalize(value);
176
+ let newValue = normalizeValue;
157
177
  if (this.range) {
158
- newValue = [...this.rangeValue];
159
- newValue[index] = number;
178
+ newValue = [...this.value];
179
+ newValue[index] = normalizeValue;
160
180
  }
161
181
  this.value = newValue;
162
182
  this.dispatchEvent(new CustomEvent("range", { detail: this.value }));
@@ -164,25 +184,17 @@ let Range = class Range extends SuperInput {
164
184
  }
165
185
  /**
166
186
  * Compute value from event.
187
+ * @returns The value closest to the event client position.
167
188
  */
168
- _computeValue(e) {
169
- const rect = this._root.getBoundingClientRect();
170
- const div = this.vertical ? (e.clientY - rect.top) / rect.height : (e.clientX - rect.left) / rect.width;
171
- const value = Math.round((div * (this.max - this.min)) / this.step) * this.step;
172
- return this.normalizeValue(value);
189
+ _computeValue({ clientX, clientY }) {
190
+ const { top, left, height, width } = this._root.getBoundingClientRect();
191
+ return this._ranger.present(this.vertical ? (clientY - top) / height : (clientX - left) / width);
173
192
  }
174
193
  /**
175
- * Ensure that the values do not exceed the range of max and min.
194
+ * Handles the mouse down event on the root element of the range component.
195
+ * Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.
196
+ * @param e - The mouse down event object.
176
197
  */
177
- normalizeValue(value) {
178
- if (value > this.max) {
179
- value -= this.step;
180
- }
181
- else if (value < this.min) {
182
- value += this.step;
183
- }
184
- return value;
185
- }
186
198
  _handleMousedownRoot(e) {
187
199
  const value = this._computeValue(e);
188
200
  const index = this.range
@@ -197,6 +209,11 @@ let Range = class Range extends SuperInput {
197
209
  this.createMousedownListener(set)(e);
198
210
  this.focusHandle(index);
199
211
  }
212
+ /**
213
+ * Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
214
+ * @param index - The index of the handle to focus.
215
+ * @returns A function that handles the mouse down event and updates the range value.
216
+ */
200
217
  createMousedownListener(mouseMoveCallback) {
201
218
  return (e) => {
202
219
  e.preventDefault();
@@ -210,17 +227,22 @@ let Range = class Range extends SuperInput {
210
227
  this.events.add(document, "mouseup", stop);
211
228
  };
212
229
  }
230
+ /**
231
+ * Creates a mouse move event handler that updates the range value based on the mouse position.
232
+ * @param callback - A function to call with the new value when the mouse is moved.
233
+ * @returns A function that handles the mouse move event and updates the range value.
234
+ */
213
235
  createMousemoveListener(callback) {
214
236
  return (e) => {
215
237
  const value = this._computeValue(e);
216
- if (value > this.max || value < this.min) {
238
+ if (value !== this._ranger.restrict(value)) {
217
239
  return;
218
240
  }
219
241
  callback?.call(this, value);
220
242
  };
221
243
  }
222
244
  _connectedInit() {
223
- const gap = this.max - this.min;
245
+ const gap = this._ranger.diff;
224
246
  this.step ||= gap / 100;
225
247
  if (isNil(this.value)) {
226
248
  if (!isNil(this.default)) {
@@ -279,7 +301,7 @@ Range = __decorate([
279
301
  ${cssScope}--handle-active: var(${cssGlobalVars.active});
280
302
  ${cssScope}--track-width: .5em;
281
303
  ${cssScope}--length: var(${cssGlobalVars.input}-width);
282
- background: var(${cssGlobalVars.input}-background);
304
+ background: var(${cssGlobalVars.passive});
283
305
  width: var(${cssScope}--length);
284
306
  display: block;
285
307
  }