godown 3.5.2 → 3.6.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 (75) hide show
  1. package/build/godown+lit.iife.js +3 -3
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +3 -3
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +3 -3
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +4 -4
  8. package/build/godown.js +6 -6
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +4 -4
  11. package/build/godown.umd.js.map +1 -1
  12. package/components/alert.js +1 -1
  13. package/components/alert.js.map +1 -1
  14. package/components/avatar.js +1 -1
  15. package/components/avatar.js.map +1 -1
  16. package/components/badge.d.ts +1 -1
  17. package/components/badge.d.ts.map +1 -1
  18. package/components/badge.js +1 -1
  19. package/components/badge.js.map +1 -1
  20. package/components/breath.js +1 -1
  21. package/components/breath.js.map +1 -1
  22. package/components/button.d.ts +1 -1
  23. package/components/button.d.ts.map +1 -1
  24. package/components/button.js +1 -1
  25. package/components/button.js.map +1 -1
  26. package/components/card.js +1 -1
  27. package/components/card.js.map +1 -1
  28. package/components/carousel.d.ts +1 -0
  29. package/components/carousel.d.ts.map +1 -1
  30. package/components/carousel.js +1 -1
  31. package/components/carousel.js.map +1 -1
  32. package/components/details.d.ts +4 -0
  33. package/components/details.d.ts.map +1 -1
  34. package/components/details.js +1 -1
  35. package/components/details.js.map +1 -1
  36. package/components/dialog.d.ts +4 -6
  37. package/components/dialog.d.ts.map +1 -1
  38. package/components/dialog.js +1 -1
  39. package/components/dialog.js.map +1 -1
  40. package/components/divider.js +1 -1
  41. package/components/divider.js.map +1 -1
  42. package/components/layout.d.ts +10 -4
  43. package/components/layout.d.ts.map +1 -1
  44. package/components/layout.js +1 -1
  45. package/components/layout.js.map +1 -1
  46. package/components/range.d.ts.map +1 -1
  47. package/components/range.js +1 -1
  48. package/components/range.js.map +1 -1
  49. package/components/split.js +1 -1
  50. package/components/split.js.map +1 -1
  51. package/core/global-style.d.ts +1 -0
  52. package/core/global-style.d.ts.map +1 -1
  53. package/core/global-style.js +1 -1
  54. package/core/global-style.js.map +1 -1
  55. package/core/super-input.js +1 -1
  56. package/core/super-input.js.map +1 -1
  57. package/custom-elements.json +1 -1
  58. package/package.json +1 -1
  59. package/src/components/alert.ts +0 -2
  60. package/src/components/avatar.ts +3 -5
  61. package/src/components/badge.ts +9 -11
  62. package/src/components/breath.ts +1 -1
  63. package/src/components/button.ts +8 -10
  64. package/src/components/card.ts +0 -1
  65. package/src/components/carousel.ts +15 -6
  66. package/src/components/details.ts +24 -21
  67. package/src/components/dialog.ts +59 -70
  68. package/src/components/divider.ts +1 -2
  69. package/src/components/layout.ts +31 -32
  70. package/src/components/range.ts +1 -0
  71. package/src/components/split.ts +1 -1
  72. package/src/core/global-style.ts +8 -0
  73. package/src/core/super-input.ts +0 -1
  74. package/vscode.html-custom-data.json +1 -1
  75. package/web-types.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.5.2",
3
+ "version": "3.6.0",
4
4
  "description": "Non Composite Web Components Library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -90,12 +90,10 @@ const calls = {
90
90
  @styles(css`
91
91
  :host,
92
92
  :where(:host([contents]) [part="root"]) {
93
- ${cssScope}--border-radius: .2em;
94
93
  ${cssScope}--border-width: .075em;
95
94
  ${cssScope}--blockquote-width: .2em;
96
95
  ${cssScope}--blockquote-background: transparent;
97
96
  ${cssScope}--gap: .5em;
98
- border-radius: var(${cssScope}--border-radius);
99
97
  display: block;
100
98
  width: 100%;
101
99
  }
@@ -19,12 +19,11 @@ const cssScope = scopePrefix(protoName);
19
19
  @godown(protoName)
20
20
  @styles(css`
21
21
  :host {
22
- ${cssScope}--size: 2em;
23
- width: var(${cssScope}--size);
24
- height: var(${cssScope}--size);
25
22
  background: var(${cssGlobalVars.passive});
26
23
  vertical-align: bottom;
27
- border-radius: 0.2em;
24
+ overflow: hidden;
25
+ width: 2em;
26
+ height: 2em;
28
27
  }
29
28
 
30
29
  :host,
@@ -49,7 +48,6 @@ const cssScope = scopePrefix(protoName);
49
48
  }
50
49
 
51
50
  [part="root"] {
52
- overflow: hidden;
53
51
  position: relative;
54
52
  border-radius: inherit;
55
53
  width: 100%;
@@ -3,7 +3,7 @@ import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
5
  import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
6
- import { DirectionCorner } from "../core/direction.js";
6
+ import type { DirectionCorner } from "../core/direction.js";
7
7
 
8
8
  const protoName = "badge";
9
9
  const cssScope = scopePrefix(protoName);
@@ -39,8 +39,6 @@ const cssScope = scopePrefix(protoName);
39
39
  user-select: none;
40
40
  border-radius: calc(infinity * 1px);
41
41
  transform: translate(-50%, -50%);
42
- left: var(--left);
43
- top: var(--top);
44
42
  background: var(${cssScope}--background);
45
43
  }
46
44
 
@@ -52,20 +50,20 @@ const cssScope = scopePrefix(protoName);
52
50
  border-radius: 50%;
53
51
  }
54
52
 
55
- [position^="top"] {
56
- --top: calc(0% + var(${cssScope}--offset-y));
53
+ [position^="top"] [part="badge"] {
54
+ top: calc(0% + var(${cssScope}--offset-y));
57
55
  }
58
56
 
59
- [position$="right"] {
60
- --left: calc(100% - var(${cssScope}--offset-x));
57
+ [position$="right"] [part="badge"] {
58
+ left: calc(100% - var(${cssScope}--offset-x));
61
59
  }
62
60
 
63
- [position^="bottom"] {
64
- --top: calc(100% - var(${cssScope}--offset-y));
61
+ [position^="bottom"] [part="badge"] {
62
+ top: calc(100% - var(${cssScope}--offset-y));
65
63
  }
66
64
 
67
- [position$="left"] {
68
- --left: calc(0% + var(${cssScope}--offset-x));
65
+ [position$="left"] [part="badge"] {
66
+ left: calc(0% + var(${cssScope}--offset-x));
69
67
  }
70
68
  `)
71
69
  class Badge extends GlobalStyle {
@@ -140,7 +140,7 @@ class Breath extends GlobalStyle {
140
140
  for (let number = 1; number <= len; number++) {
141
141
  const delay = (-duration / len) * (len - number + 1);
142
142
  const defaultNumber = ((number - 1) % 3) + 1;
143
- style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}s;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
143
+ style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}ms;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
144
144
  }
145
145
  return `.colorful{animation-duration:${duration}ms;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${
146
146
  gap * 2
@@ -131,12 +131,11 @@ const colors: Record<Colors, string> = constructCSSObject(
131
131
  var(${cssScope}--background),
132
132
  var(${cssScope}--gradients, var(${cssScope}--background))
133
133
  );
134
- border-radius: 0.2em;
134
+ padding: var(${cssScope}--padding);
135
135
  width: fit-content;
136
136
  display: block;
137
137
  overflow: hidden;
138
138
  text-align: center;
139
- padding: 0 !important;
140
139
  cursor: pointer;
141
140
  }
142
141
 
@@ -147,13 +146,11 @@ const colors: Record<Colors, string> = constructCSSObject(
147
146
  [part="root"] {
148
147
  width: 100%;
149
148
  height: 100%;
150
- overflow: hidden;
151
149
  position: relative;
152
150
  transition: none;
153
151
  user-select: none;
154
152
  border-radius: inherit;
155
153
  transition-duration: inherit;
156
- padding: var(${cssScope}--padding);
157
154
  }
158
155
 
159
156
  i {
@@ -259,7 +256,8 @@ class Button extends GlobalStyle {
259
256
  super.blur();
260
257
  }
261
258
 
262
- protected firstUpdated(): void {
259
+ connectedCallback(): void {
260
+ super.connectedCallback();
263
261
  this.events.add(this, "click", this._handelClick, true);
264
262
  }
265
263
 
@@ -276,13 +274,13 @@ class Button extends GlobalStyle {
276
274
 
277
275
  protected _handleModal(e: MouseEvent): void {
278
276
  const modal = document.createElement("i");
279
- const rect = this._root.getBoundingClientRect();
280
- const { height, width } = rect;
281
- const size = `${Math.sqrt(height * height + width * width) * 2}px`;
277
+ const { width, height } = this.getBoundingClientRect();
278
+ const { x, y } = this._root.getBoundingClientRect();
279
+ const size = `${Math.sqrt(height ** 2 + width ** 2) * 2}px`;
282
280
  modal.style.height = size;
283
281
  modal.style.width = size;
284
- modal.style.left = `${e.clientX - rect.left}px`;
285
- modal.style.top = `${e.clientY - rect.y}px`;
282
+ modal.style.left = `${e.x - x}px`;
283
+ modal.style.top = `${e.y - y}px`;
286
284
  modal.style.animationName = "kf";
287
285
  this._modalRoot.appendChild(modal);
288
286
  modal.addEventListener("animationend", () => modal.remove(), { once: true });
@@ -28,7 +28,6 @@ const cssScope = scopePrefix(protoName);
28
28
  border-width: var(${cssScope}--border-width);
29
29
  display: block;
30
30
  flex-shrink: 0;
31
- border-radius: 0.2em;
32
31
  }
33
32
 
34
33
  slot {
@@ -124,6 +124,10 @@ class Carousel extends GlobalStyle {
124
124
  this.appendChild(this.__cloneLast);
125
125
  this.insertBefore(this.__cloneFirst, this.firstElementChild);
126
126
  }
127
+ this.observers.add(this, ResizeObserver, () => {
128
+ this._offset = this._computeOffset();
129
+ this._doTranslateX(`${this._offset}px`, true);
130
+ });
127
131
  }
128
132
 
129
133
  protected async firstUpdated(): Promise<void> {
@@ -141,13 +145,9 @@ class Carousel extends GlobalStyle {
141
145
  show(i: number, n?: boolean): void {
142
146
  i = this.normalizeIndex(i);
143
147
  this.index = i;
144
- this._offset = 0;
145
- for (let childIndex = 0; childIndex <= i; childIndex++) {
146
- this._offset -= getWidth(this.children[childIndex]);
147
- }
148
- this._offset += (getWidth(this) - getWidth(this.children[i + 1])) / 2;
149
- this.dispatchEvent(new CustomEvent("change", { detail: i, composed: true }));
148
+ this._offset = this._computeOffset();
150
149
  this._doTranslateX(`${this._offset}px`, n);
150
+ this.dispatchCustomEvent("change", i);
151
151
  this.timeouts.remove(this.intervalID);
152
152
  if (this.autoChange > 0) {
153
153
  this.intervalID = this.timeouts.add(
@@ -181,6 +181,15 @@ class Carousel extends GlobalStyle {
181
181
  this._moveRoot.style.transition = noTransition ? "none" : "";
182
182
  }
183
183
 
184
+ protected _computeOffset(): number {
185
+ let offset = 0;
186
+ for (let childIndex = 0; childIndex <= this.index; childIndex++) {
187
+ offset -= getWidth(this.children[childIndex]);
188
+ }
189
+ offset += (getWidth(this) - getWidth(this.children[this.index + 1])) / 2;
190
+ return offset;
191
+ }
192
+
184
193
  normalizeIndex(i: number): number {
185
194
  if (i < 0) {
186
195
  return 0;
@@ -23,54 +23,53 @@ const cssScope = scopePrefix(protoName);
23
23
  :host {
24
24
  ${cssScope}--icon-deg-open: 0deg;
25
25
  ${cssScope}--icon-deg-close: 90deg;
26
- ${cssScope}--icon-space: 0.3em;
27
- ${cssScope}--summary-direction: row;
28
- ${cssScope}--transition: .3s;
29
- height: fit-content;
26
+ ${cssScope}--icon-space: .22em;
30
27
  display: block;
31
- transition: var(${cssScope}--transition);
28
+ transition: 0.3s;
32
29
  }
33
30
 
34
31
  [part="root"] {
35
32
  height: 100%;
36
33
  position: relative;
37
- overflow: hidden;
38
34
  }
39
35
 
40
36
  [part="title"] {
41
37
  direction: ltr;
42
38
  height: 100%;
43
- display: flex;
44
- flex-wrap: nowrap;
45
- justify-content: space-between;
46
- background: inherit;
39
+ display: grid;
47
40
  align-items: center;
48
- flex-direction: var(${cssScope}--summary-direction);
41
+ justify-content: space-between;
42
+ grid-template-columns: auto auto;
43
+ transition: inherit;
49
44
  }
50
45
 
51
46
  [part="details"] {
52
- display: grid;
53
47
  overflow: hidden;
48
+ display: grid;
54
49
  grid-template-rows: 0fr;
55
- transition: var(${cssScope}--transition);
56
- transition-property: grid-template-rows;
50
+ transition: inherit;
57
51
  }
58
52
 
59
53
  :host([open]) [part="details"] {
60
54
  grid-template-rows: 1fr;
61
55
  }
62
56
 
63
- :host([float]) [part="details"] {
64
- top: 100%;
57
+ [float] [part="details"] {
65
58
  position: absolute;
59
+ top: 100%;
60
+ width: 100%;
61
+ }
62
+
63
+ [part] {
64
+ transition: inherit;
65
+ transition-property: transform, grid-template-rows;
66
66
  }
67
67
 
68
68
  [part="icon"] {
69
69
  display: flex;
70
70
  backface-visibility: hidden;
71
- padding: var(${cssScope}--icon-space);
72
- transition: var(${cssScope}--transition);
73
71
  transform: rotate(var(${cssScope}--icon-deg-close));
72
+ padding: var(${cssScope}--icon-space);
74
73
  }
75
74
 
76
75
  :host([open]) [part="icon"] {
@@ -78,6 +77,12 @@ const cssScope = scopePrefix(protoName);
78
77
  }
79
78
  `)
80
79
  class Details extends SuperOpenable {
80
+ /**
81
+ * Determines whether the details component should float.
82
+ */
83
+ @property({ type: Boolean })
84
+ float = false;
85
+
81
86
  /**
82
87
  * Determines whether the details component should fill the available space.
83
88
  */
@@ -101,9 +106,7 @@ class Details extends SuperOpenable {
101
106
  @click="${() => this.toggle()}"
102
107
  >
103
108
  <span part="summary">${this.summary || htmlSlot("summary")}</span>
104
- <span>
105
- <i part="icon">${svgCaretDown()}</i>
106
- </span>
109
+ <span part="icon">${svgCaretDown()}</span>
107
110
  </dt>
108
111
  <dd
109
112
  part="details"
@@ -1,15 +1,9 @@
1
1
  import { type HandlerEvent, attr, godown, htmlSlot, styles } from "@godown/element";
2
2
  import { type PropertyValues, type TemplateResult, css, html } from "lit";
3
- import { property } from "lit/decorators.js";
3
+ import { property, query } from "lit/decorators.js";
4
4
 
5
5
  import { scopePrefix } from "../core/global-style.js";
6
6
  import { SuperOpenable } from "../core/super-openable.js";
7
- import {
8
- type DirectionCardinal,
9
- type DirectionCenter,
10
- type DirectionCorner,
11
- directionInsetAlign,
12
- } from "../core/direction.js";
13
7
 
14
8
  const protoName = "dialog";
15
9
  const cssScope = scopePrefix(protoName);
@@ -25,65 +19,50 @@ const cssScope = scopePrefix(protoName);
25
19
  * @category feedback
26
20
  */
27
21
  @godown(protoName)
28
- @styles(
29
- directionInsetAlign,
30
- css`
31
- :host {
32
- ${cssScope}--background: none;
33
- ${cssScope}--background-modal: black;
34
- ${cssScope}--opacity-modal: 0.2;
35
- background: var(${cssScope}--background);
36
- pointer-events: none;
37
- position: fixed;
38
- z-index: 1;
39
- inset: 0;
40
- }
41
-
42
- :host(:not([open])) {
43
- visibility: hidden;
44
- }
22
+ @styles(css`
23
+ :host {
24
+ ${cssScope}--background-modal: black;
25
+ ${cssScope}--opacity-modal: 0.2;
26
+ width: fit-content;
27
+ display: block;
28
+ margin: auto;
29
+ background: none;
30
+ left: 50%;
31
+ top: 50%;
32
+ position: fixed;
33
+ transform: translate(-50%, -50%);
34
+ }
45
35
 
46
- :host([modal]) [part="modal"] {
47
- pointer-events: all;
48
- opacity: var(${cssScope}--opacity-modal);
49
- }
36
+ :host(:not([open])) {
37
+ visibility: hidden;
38
+ }
50
39
 
51
- [part="modal"] {
52
- visibility: inherit;
53
- opacity: 0;
54
- width: 100%;
55
- height: 100%;
56
- position: absolute;
57
- background: var(${cssScope}--background-modal);
58
- }
40
+ :host([contents]) dialog {
41
+ position: fixed;
42
+ }
59
43
 
60
- [part="root"] {
61
- width: 100%;
62
- height: 100%;
63
- display: flex;
64
- position: relative;
65
- align-items: center;
66
- justify-content: center;
67
- }
44
+ dialog {
45
+ position: relative;
46
+ background: inherit;
47
+ }
68
48
 
69
- [part="container"] {
70
- pointer-events: all;
71
- position: absolute;
72
- }
73
- `,
74
- )
49
+ ::backdrop {
50
+ background: var(${cssScope}--background-modal);
51
+ opacity: var(${cssScope}--opacity-modal);
52
+ }
53
+ `)
75
54
  class Dialog extends SuperOpenable {
76
- /**
77
- * The direction of the dialog container.
78
- */
79
- @property()
80
- direction: DirectionCardinal | DirectionCorner | DirectionCenter;
81
-
82
55
  /**
83
56
  * Indicates whether the dialog should be displayed as a modal.
84
57
  */
85
58
  @property({ type: Boolean, reflect: true })
86
- modal = false;
59
+ set modal(value: boolean) {
60
+ this.contents = value;
61
+ }
62
+
63
+ get modal(): boolean {
64
+ return this.contents;
65
+ }
87
66
 
88
67
  /**
89
68
  * The keys will close the dialog when pressed.
@@ -96,31 +75,41 @@ class Dialog extends SuperOpenable {
96
75
  */
97
76
  private __modalInvoke = false;
98
77
 
78
+ @query("dialog")
79
+ protected _dialog: HTMLDialogElement;
80
+
99
81
  protected render(): TemplateResult<1> {
100
82
  return html`
101
- <div
83
+ <dialog
102
84
  part="root"
103
85
  ${attr(this.observedRecord)}
104
86
  >
105
- <div part="modal"></div>
106
- <div
107
- part="container"
108
- direction-inset-align
109
- >
110
- ${htmlSlot()}
111
- </div>
112
- </div>
87
+ ${htmlSlot()}
88
+ </dialog>
113
89
  `;
114
90
  }
115
91
 
116
92
  showModal(): void {
117
- if (!this.modal) {
118
- this.modal = true;
119
- this.__modalInvoke = true;
120
- }
93
+ this.modal = true;
94
+ this.__modalInvoke = true;
121
95
  this.show();
122
96
  }
123
97
 
98
+ attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
99
+ super.attributeChangedCallback(name, _old, value);
100
+ if (name === "open") {
101
+ if (this.open) {
102
+ if (this.modal) {
103
+ this._dialog.showModal();
104
+ } else {
105
+ this._dialog.show();
106
+ }
107
+ } else {
108
+ this._dialog.close();
109
+ }
110
+ }
111
+ }
112
+
124
113
  private __submitEvent: EventListenerOrEventListenerObject;
125
114
  private __keydownEvent: EventListenerOrEventListenerObject;
126
115
 
@@ -16,7 +16,6 @@ const protoName = "divider";
16
16
  :host {
17
17
  width: 100%;
18
18
  height: 0.05em;
19
- margin: auto;
20
19
  display: block;
21
20
  background: currentColor;
22
21
  color: var(${cssGlobalVars.passive});
@@ -24,7 +23,7 @@ const protoName = "divider";
24
23
 
25
24
  :host([vertical]) {
26
25
  width: 0.05em;
27
- height: max(1em, 100%);
26
+ height: 100%;
28
27
  }
29
28
 
30
29
  :host([contents]) [part="root"] {
@@ -7,7 +7,13 @@ import { GlobalStyle } from "../core/global-style.js";
7
7
  const protoName = "layout";
8
8
 
9
9
  /**
10
- * {@linkcode Layout} renders slot and optional top header, bottom footer.
10
+ * {@linkcode Layout} renders main content, top header, bottom footer.
11
+ *
12
+ * If `sticky` is set to `true`, the header will be sticky.
13
+ *
14
+ * Main content will take up the remaining space.
15
+ *
16
+ * Element display should be `(inline-)flex` or `(inline-)grid`.
11
17
  *
12
18
  * @slot - The main content of the layout.
13
19
  * @slot header - The header of the layout.
@@ -16,50 +22,51 @@ const protoName = "layout";
16
22
  */
17
23
  @godown(protoName)
18
24
  @styles(css`
19
- :host,
20
- :host([contents]) [part="root"] {
25
+ :host {
26
+ width: 100%;
21
27
  min-height: 100%;
22
- display: flex;
23
28
  flex-direction: column;
29
+ grid-template-rows: auto 1fr auto;
24
30
  }
25
31
 
26
- [part="root"] {
27
- display: contents;
32
+ :host,
33
+ :host([contents]) [part="root"] {
34
+ display: grid;
28
35
  }
29
36
 
30
- [sticky] header {
31
- position: sticky;
32
- top: 0;
33
- z-index: 1;
37
+ [part="root"] {
38
+ display: contents;
34
39
  }
35
40
 
36
41
  [part="main"] {
37
- position: relative;
38
- flex: 1;
39
42
  width: 100%;
43
+ flex: 1;
40
44
  }
41
45
 
42
- header,
43
- main,
44
- footer {
46
+ [part="header"],
47
+ [part="footer"] {
48
+ flex-shrink: 0;
45
49
  width: 100%;
46
50
  }
51
+
52
+ [sticky] header {
53
+ position: sticky;
54
+ top: 0;
55
+ }
47
56
  `)
48
57
  class Layout extends GlobalStyle {
49
58
  /**
50
- * If true, remove the header slot.
59
+ * @deprecated Omit header slot instead.
51
60
  */
52
- @property({ type: Boolean })
53
- noHeader = false;
61
+ noHeader: boolean;
54
62
 
55
63
  /**
56
- * If true, remove the footer slot.
64
+ * @deprecated Omit footer slot instead.
57
65
  */
58
- @property({ type: Boolean })
59
- noFooter = false;
66
+ noFooter: boolean;
60
67
 
61
68
  /**
62
- * If true, header will sticky.
69
+ * If `true`, header will sticky.
63
70
  */
64
71
  @property({ type: Boolean })
65
72
  sticky = false;
@@ -70,17 +77,9 @@ class Layout extends GlobalStyle {
70
77
  part="root"
71
78
  ${attr(this.observedRecord)}
72
79
  >
73
- ${!this.noHeader
74
- ? html`
75
- <header part="header">${htmlSlot("header")}</header>
76
- `
77
- : ""}
80
+ <header part="header">${htmlSlot("header")}</header>
78
81
  <main part="main">${htmlSlot()}</main>
79
- ${!this.noFooter
80
- ? html`
81
- <footer part="footer">${htmlSlot("footer")}</footer>
82
- `
83
- : ""}
82
+ <footer part="footer">${htmlSlot("footer")}</footer>
84
83
  </div>
85
84
  `;
86
85
  }
@@ -395,6 +395,7 @@ class Range<V extends RangeValue = RangeValue> extends SuperInput<RangeValue> {
395
395
  }
396
396
 
397
397
  protected _connectedInit(): void {
398
+ this._ranger = new Ranger(this.min, this.max, this.step);
398
399
  const gap = this._ranger.diff;
399
400
  this.step ||= gap / 100;
400
401
  if (isNil(this.value)) {
@@ -25,7 +25,7 @@ const cssScope = scopePrefix(protoName);
25
25
  @styles(css`
26
26
  :host {
27
27
  display: block;
28
- border-radius: 1px;
28
+ border-radius: 0.1em;
29
29
  width: fit-content;
30
30
  ${cssScope}--size: 1.45em;
31
31
  ${cssScope}--gap: .25em;
@@ -25,6 +25,7 @@ export const cssGlobalVars: {
25
25
  white: CSSResult;
26
26
  black: CSSResult;
27
27
  color: CSSResult;
28
+ borderRadius: CSSResult;
28
29
  } = {
29
30
  clipBackground: scopePrefix("clip-background", 2),
30
31
  active: scopePrefix("active", 2),
@@ -34,6 +35,7 @@ export const cssGlobalVars: {
34
35
  white: scopePrefix("color-white", 2),
35
36
  black: scopePrefix("color-black", 2),
36
37
  color: scopePrefix("color", 2),
38
+ borderRadius: scopePrefix("border-radius", 2),
37
39
  };
38
40
 
39
41
  type PresetsGradientsCSSResult = Record<keyof typeof presetsRGB, Gradients<CSSResult>>;
@@ -95,4 +97,10 @@ GlobalStyle.styles = [
95
97
  display: revert;
96
98
  }
97
99
  `,
100
+ css`
101
+ :host {
102
+ ${cssGlobalVars.borderRadius}: 0.2em;
103
+ border-radius: var(${cssGlobalVars.borderRadius});
104
+ }
105
+ `,
98
106
  ];
@@ -53,7 +53,6 @@ const inputStyle = css`
53
53
  ${cssGlobalVars.input}-outline-width: .075em;
54
54
  ${cssGlobalVars.input}-outline-color: var(${cssGlobalVars._colors.darkgray[4]});
55
55
  ${cssGlobalVars.input}-icon-color: var(${cssGlobalVars._colors.darkgray[4]});
56
- border-radius: 0.2em;
57
56
  }
58
57
 
59
58
  :host([disabled]) {