godown 3.0.0 → 3.0.1

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 (246) 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 +11 -11
  8. package/build/godown.js +11 -11
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +11 -11
  11. package/build/godown.umd.js.map +1 -1
  12. package/components/alert.d.ts.map +1 -1
  13. package/components/alert.js +1 -1
  14. package/components/alert.js.map +1 -1
  15. package/components/avatar.d.ts.map +1 -1
  16. package/components/avatar.js +1 -1
  17. package/components/avatar.js.map +1 -1
  18. package/components/badge.d.ts.map +1 -1
  19. package/components/badge.js +1 -1
  20. package/components/badge.js.map +1 -1
  21. package/components/breath.d.ts.map +1 -1
  22. package/components/breath.js +1 -1
  23. package/components/breath.js.map +1 -1
  24. package/components/button.d.ts.map +1 -1
  25. package/components/button.js +1 -1
  26. package/components/button.js.map +1 -1
  27. package/components/card.d.ts.map +1 -1
  28. package/components/card.js +1 -1
  29. package/components/card.js.map +1 -1
  30. package/components/carousel.d.ts.map +1 -1
  31. package/components/carousel.js +1 -1
  32. package/components/carousel.js.map +1 -1
  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.map +1 -1
  37. package/components/dialog.js +1 -1
  38. package/components/dialog.js.map +1 -1
  39. package/components/divider.d.ts.map +1 -1
  40. package/components/divider.js +1 -1
  41. package/components/divider.js.map +1 -1
  42. package/components/dragbox.d.ts.map +1 -1
  43. package/components/dragbox.js +1 -1
  44. package/components/dragbox.js.map +1 -1
  45. package/components/flex.d.ts.map +1 -1
  46. package/components/flex.js.map +1 -1
  47. package/components/form.d.ts.map +1 -1
  48. package/components/form.js.map +1 -1
  49. package/components/grid.d.ts.map +1 -1
  50. package/components/grid.js.map +1 -1
  51. package/components/heading.d.ts.map +1 -1
  52. package/components/heading.js +1 -1
  53. package/components/heading.js.map +1 -1
  54. package/components/input.d.ts.map +1 -1
  55. package/components/input.js +1 -1
  56. package/components/input.js.map +1 -1
  57. package/components/layout.d.ts.map +1 -1
  58. package/components/layout.js +1 -1
  59. package/components/layout.js.map +1 -1
  60. package/components/link.js.map +1 -1
  61. package/components/progress.d.ts.map +1 -1
  62. package/components/progress.js +1 -1
  63. package/components/progress.js.map +1 -1
  64. package/components/range.d.ts.map +1 -1
  65. package/components/range.js +1 -1
  66. package/components/range.js.map +1 -1
  67. package/components/rotate.d.ts.map +1 -1
  68. package/components/rotate.js +1 -1
  69. package/components/rotate.js.map +1 -1
  70. package/components/router.d.ts +20 -25
  71. package/components/router.d.ts.map +1 -1
  72. package/components/router.js +1 -1
  73. package/components/router.js.map +1 -1
  74. package/components/select.d.ts.map +1 -1
  75. package/components/select.js +1 -1
  76. package/components/select.js.map +1 -1
  77. package/components/skeleton.d.ts.map +1 -1
  78. package/components/skeleton.js +1 -1
  79. package/components/skeleton.js.map +1 -1
  80. package/components/split.d.ts.map +1 -1
  81. package/components/split.js +1 -1
  82. package/components/split.js.map +1 -1
  83. package/components/switch.d.ts.map +1 -1
  84. package/components/switch.js +1 -1
  85. package/components/switch.js.map +1 -1
  86. package/components/text.d.ts.map +1 -1
  87. package/components/text.js +1 -1
  88. package/components/text.js.map +1 -1
  89. package/components/time.d.ts.map +1 -1
  90. package/components/time.js.map +1 -1
  91. package/components/tooltip.d.ts.map +1 -1
  92. package/components/tooltip.js +1 -1
  93. package/components/tooltip.js.map +1 -1
  94. package/components/typewriter.d.ts.map +1 -1
  95. package/components/typewriter.js +1 -1
  96. package/components/typewriter.js.map +1 -1
  97. package/core/global-style.d.ts.map +1 -1
  98. package/core/global-style.js +1 -1
  99. package/core/global-style.js.map +1 -1
  100. package/core/super-anchor.d.ts.map +1 -1
  101. package/core/super-anchor.js +1 -1
  102. package/core/super-anchor.js.map +1 -1
  103. package/core/super-input.d.ts.map +1 -1
  104. package/core/super-input.js +1 -1
  105. package/core/super-input.js.map +1 -1
  106. package/core/super-openable.d.ts.map +1 -1
  107. package/core/super-openable.js.map +1 -1
  108. package/custom-elements.json +1 -1
  109. package/dev/components/alert.d.ts.map +1 -1
  110. package/dev/components/alert.js +82 -69
  111. package/dev/components/alert.js.map +1 -1
  112. package/dev/components/avatar.d.ts.map +1 -1
  113. package/dev/components/avatar.js +52 -36
  114. package/dev/components/avatar.js.map +1 -1
  115. package/dev/components/badge.d.ts.map +1 -1
  116. package/dev/components/badge.js +57 -50
  117. package/dev/components/badge.js.map +1 -1
  118. package/dev/components/breath.d.ts.map +1 -1
  119. package/dev/components/breath.js +20 -14
  120. package/dev/components/breath.js.map +1 -1
  121. package/dev/components/button.d.ts.map +1 -1
  122. package/dev/components/button.js +13 -10
  123. package/dev/components/button.js.map +1 -1
  124. package/dev/components/card.d.ts.map +1 -1
  125. package/dev/components/card.js +40 -35
  126. package/dev/components/card.js.map +1 -1
  127. package/dev/components/carousel.d.ts.map +1 -1
  128. package/dev/components/carousel.js +63 -43
  129. package/dev/components/carousel.js.map +1 -1
  130. package/dev/components/details.d.ts.map +1 -1
  131. package/dev/components/details.js +72 -61
  132. package/dev/components/details.js.map +1 -1
  133. package/dev/components/dialog.d.ts.map +1 -1
  134. package/dev/components/dialog.js +61 -57
  135. package/dev/components/dialog.js.map +1 -1
  136. package/dev/components/divider.d.ts.map +1 -1
  137. package/dev/components/divider.js +28 -23
  138. package/dev/components/divider.js.map +1 -1
  139. package/dev/components/dragbox.d.ts.map +1 -1
  140. package/dev/components/dragbox.js +19 -17
  141. package/dev/components/dragbox.js.map +1 -1
  142. package/dev/components/flex.d.ts.map +1 -1
  143. package/dev/components/flex.js +16 -11
  144. package/dev/components/flex.js.map +1 -1
  145. package/dev/components/form.d.ts.map +1 -1
  146. package/dev/components/form.js +4 -4
  147. package/dev/components/form.js.map +1 -1
  148. package/dev/components/grid.d.ts.map +1 -1
  149. package/dev/components/grid.js +16 -11
  150. package/dev/components/grid.js.map +1 -1
  151. package/dev/components/heading.d.ts.map +1 -1
  152. package/dev/components/heading.js +62 -40
  153. package/dev/components/heading.js.map +1 -1
  154. package/dev/components/input.d.ts.map +1 -1
  155. package/dev/components/input.js +32 -24
  156. package/dev/components/input.js.map +1 -1
  157. package/dev/components/layout.d.ts.map +1 -1
  158. package/dev/components/layout.js +43 -30
  159. package/dev/components/layout.js.map +1 -1
  160. package/dev/components/link.js +1 -1
  161. package/dev/components/link.js.map +1 -1
  162. package/dev/components/progress.d.ts.map +1 -1
  163. package/dev/components/progress.js +51 -42
  164. package/dev/components/progress.js.map +1 -1
  165. package/dev/components/range.d.ts.map +1 -1
  166. package/dev/components/range.js +33 -30
  167. package/dev/components/range.js.map +1 -1
  168. package/dev/components/rotate.d.ts.map +1 -1
  169. package/dev/components/rotate.js +12 -5
  170. package/dev/components/rotate.js.map +1 -1
  171. package/dev/components/router.d.ts +20 -25
  172. package/dev/components/router.d.ts.map +1 -1
  173. package/dev/components/router.js +17 -17
  174. package/dev/components/router.js.map +1 -1
  175. package/dev/components/select.d.ts.map +1 -1
  176. package/dev/components/select.js +65 -57
  177. package/dev/components/select.js.map +1 -1
  178. package/dev/components/skeleton.d.ts.map +1 -1
  179. package/dev/components/skeleton.js +65 -61
  180. package/dev/components/skeleton.js.map +1 -1
  181. package/dev/components/split.d.ts.map +1 -1
  182. package/dev/components/split.js +66 -58
  183. package/dev/components/split.js.map +1 -1
  184. package/dev/components/switch.d.ts.map +1 -1
  185. package/dev/components/switch.js +88 -79
  186. package/dev/components/switch.js.map +1 -1
  187. package/dev/components/text.d.ts.map +1 -1
  188. package/dev/components/text.js +51 -45
  189. package/dev/components/text.js.map +1 -1
  190. package/dev/components/time.d.ts.map +1 -1
  191. package/dev/components/time.js +13 -2
  192. package/dev/components/time.js.map +1 -1
  193. package/dev/components/tooltip.d.ts.map +1 -1
  194. package/dev/components/tooltip.js +31 -23
  195. package/dev/components/tooltip.js.map +1 -1
  196. package/dev/components/typewriter.d.ts.map +1 -1
  197. package/dev/components/typewriter.js +35 -27
  198. package/dev/components/typewriter.js.map +1 -1
  199. package/dev/core/global-style.d.ts.map +1 -1
  200. package/dev/core/global-style.js +9 -9
  201. package/dev/core/global-style.js.map +1 -1
  202. package/dev/core/super-anchor.d.ts.map +1 -1
  203. package/dev/core/super-anchor.js +27 -26
  204. package/dev/core/super-anchor.js.map +1 -1
  205. package/dev/core/super-input.d.ts.map +1 -1
  206. package/dev/core/super-input.js +83 -68
  207. package/dev/core/super-input.js.map +1 -1
  208. package/dev/core/super-openable.d.ts.map +1 -1
  209. package/dev/core/super-openable.js +1 -2
  210. package/dev/core/super-openable.js.map +1 -1
  211. package/package.json +5 -5
  212. package/src/components/alert.ts +84 -75
  213. package/src/components/avatar.ts +54 -40
  214. package/src/components/badge.ts +68 -65
  215. package/src/components/breath.ts +23 -19
  216. package/src/components/button.ts +14 -11
  217. package/src/components/card.ts +42 -40
  218. package/src/components/carousel.ts +65 -47
  219. package/src/components/details.ts +74 -65
  220. package/src/components/dialog.ts +64 -62
  221. package/src/components/divider.ts +33 -30
  222. package/src/components/dragbox.ts +22 -22
  223. package/src/components/flex.ts +31 -28
  224. package/src/components/form.ts +7 -9
  225. package/src/components/grid.ts +31 -28
  226. package/src/components/heading.ts +67 -49
  227. package/src/components/input.ts +37 -31
  228. package/src/components/layout.ts +45 -34
  229. package/src/components/link.ts +1 -1
  230. package/src/components/progress.ts +53 -46
  231. package/src/components/range.ts +58 -52
  232. package/src/components/rotate.ts +15 -10
  233. package/src/components/router.ts +40 -45
  234. package/src/components/select.ts +74 -70
  235. package/src/components/skeleton.ts +67 -65
  236. package/src/components/split.ts +73 -69
  237. package/src/components/switch.ts +90 -83
  238. package/src/components/text.ts +53 -49
  239. package/src/components/time.ts +14 -3
  240. package/src/components/tooltip.ts +32 -24
  241. package/src/components/typewriter.ts +37 -31
  242. package/src/core/global-style.ts +11 -12
  243. package/src/core/super-anchor.ts +29 -30
  244. package/src/core/super-input.ts +86 -73
  245. package/src/core/super-openable.ts +2 -8
  246. package/web-types.json +1 -1
@@ -1,9 +1,8 @@
1
1
  import { attr, godown, htmlSlot, styles } from "@godown/element";
2
- import { css, html, type TemplateResult } from "lit";
2
+ import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
- import { cssGlobalVars, GlobalStyle, scopePrefix } from "../core/global-style.js";
6
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5
+ import { GlobalStyle, cssGlobalVars, scopePrefix } from "../core/global-style.js";
7
6
  import type Layout from "../layout.js";
8
7
 
9
8
  const protoName = "card";
@@ -21,44 +20,42 @@ const cssScope = scopePrefix(protoName);
21
20
  * @category display
22
21
  */
23
22
  @godown(protoName)
24
- @styles(
25
- css`
26
- :host {
27
- ${cssScope}--background: var(${cssGlobalVars.background});
28
- ${cssScope}--border-width: .0375em;
29
- ${cssScope}--border-color: transparent;
30
- ${cssScope}--border-background: var(${cssGlobalVars.passive});
31
- ${cssScope}--padding: .75em;
32
- color: var(${cssGlobalVars.foreground});
33
- background: var(${cssScope}--background);
34
- border-width: var(${cssScope}--border-width);
35
- display: block;
36
- flex-shrink: 0;
37
- position: relative;
38
- overflow: hidden;
39
- box-sizing: border-box;
40
- }
23
+ @styles(css`
24
+ :host {
25
+ ${cssScope}--background: var(${cssGlobalVars.background});
26
+ ${cssScope}--border-width: .0375em;
27
+ ${cssScope}--border-color: transparent;
28
+ ${cssScope}--border-background: var(${cssGlobalVars.passive});
29
+ ${cssScope}--padding: .75em;
30
+ color: var(${cssGlobalVars.foreground});
31
+ background: var(${cssScope}--background);
32
+ border-width: var(${cssScope}--border-width);
33
+ display: block;
34
+ flex-shrink: 0;
35
+ position: relative;
36
+ overflow: hidden;
37
+ box-sizing: border-box;
38
+ }
41
39
 
42
- slot {
43
- display: block;
44
- padding: var(${cssScope}--padding);
45
- }
40
+ slot {
41
+ display: block;
42
+ padding: var(${cssScope}--padding);
43
+ }
46
44
 
47
- :host,
48
- slot {
49
- border-color: var(${cssScope}--border-background);
50
- border-style: solid;
51
- }
45
+ :host,
46
+ slot {
47
+ border-color: var(${cssScope}--border-background);
48
+ border-style: solid;
49
+ }
52
50
 
53
- [name=footer] {
54
- border-top-width: var(${cssScope}--border-width);
55
- }
51
+ [name="footer"] {
52
+ border-top-width: var(${cssScope}--border-width);
53
+ }
56
54
 
57
- [name=header] {
58
- border-bottom-width: var(${cssScope}--border-width);
59
- }
60
- `,
61
- )
55
+ [name="header"] {
56
+ border-bottom-width: var(${cssScope}--border-width);
57
+ }
58
+ `)
62
59
  class Card extends GlobalStyle {
63
60
  @property({ type: Boolean })
64
61
  footer = false;
@@ -67,9 +64,14 @@ class Card extends GlobalStyle {
67
64
  header = false;
68
65
 
69
66
  protected render(): TemplateResult<1> {
70
- return html`<div part="root" ${attr(this.observedRecord)}>
71
- ${[this.header ? htmlSlot("header") : "", htmlSlot(), this.footer ? htmlSlot("footer") : ""]}
72
- </div>`;
67
+ return html`
68
+ <div
69
+ part="root"
70
+ ${attr(this.observedRecord)}
71
+ >
72
+ ${[this.header ? htmlSlot("header") : "", htmlSlot(), this.footer ? htmlSlot("footer") : ""]}
73
+ </div>
74
+ `;
73
75
  }
74
76
  }
75
77
 
@@ -1,7 +1,7 @@
1
1
  import { attr, godown, htmlSlot, htmlStyle, part, styles } from "@godown/element";
2
2
  import iconChevronLeft from "@godown/f7-icon/icons/chevron-left.js";
3
3
  import iconChevronRight from "@godown/f7-icon/icons/chevron-right.js";
4
- import { css, html, type TemplateResult } from "lit";
4
+ import { type TemplateResult, css, html } from "lit";
5
5
  import { property } from "lit/decorators.js";
6
6
 
7
7
  import { GlobalStyle } from "../core/global-style.js";
@@ -23,52 +23,50 @@ const protoName = "carousel";
23
23
  * @category display
24
24
  */
25
25
  @godown(protoName)
26
- @styles(
27
- css`
28
- :host {
29
- display: block;
30
- transition: .3s;
31
- }
26
+ @styles(css`
27
+ :host {
28
+ display: block;
29
+ transition: 0.3s;
30
+ }
32
31
 
33
- [part=root] {
34
- direction: ltr;
35
- overflow: hidden;
36
- }
32
+ [part="root"] {
33
+ direction: ltr;
34
+ overflow: hidden;
35
+ }
37
36
 
38
- [part=root],
39
- [part=move-root] {
40
- height: 100%;
41
- width: 100%;
42
- display: flex;
43
- position: relative;
44
- transition: inherit;
45
- }
37
+ [part="root"],
38
+ [part="move-root"] {
39
+ height: 100%;
40
+ width: 100%;
41
+ display: flex;
42
+ position: relative;
43
+ transition: inherit;
44
+ }
46
45
 
47
- [part=prev],
48
- [part=next] {
49
- height: 100%;
50
- width: 1.5em;
51
- z-index: 1;
52
- position: absolute;
53
- display: flex;
54
- align-items: center;
55
- justify-content: center;
56
- user-select: none;
57
- }
46
+ [part="prev"],
47
+ [part="next"] {
48
+ height: 100%;
49
+ width: 1.5em;
50
+ z-index: 1;
51
+ position: absolute;
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: center;
55
+ user-select: none;
56
+ }
58
57
 
59
- [part=prev] {
60
- left: 0;
61
- }
58
+ [part="prev"] {
59
+ left: 0;
60
+ }
62
61
 
63
- [part=next] {
64
- right: 0;
65
- }
62
+ [part="next"] {
63
+ right: 0;
64
+ }
66
65
 
67
- slot::slotted(*) {
68
- flex-shrink: 0 !important;
69
- }
70
- `,
71
- )
66
+ slot::slotted(*) {
67
+ flex-shrink: 0 !important;
68
+ }
69
+ `)
72
70
  class Carousel extends GlobalStyle {
73
71
  /**
74
72
  * The index of the element is displayed for the first time.
@@ -98,12 +96,32 @@ class Carousel extends GlobalStyle {
98
96
  private _cloneLast: HTMLElement | undefined;
99
97
 
100
98
  protected render(): TemplateResult<1> {
101
- return html`<div part="root" ${attr(this.observedRecord)}>
102
- <i part="prev" @click="${this.prev}"> ${iconChevronLeft()} </i>
103
- <div part="move-root" style="transform:${`translateX(-${this.index + 1}00%)`}">${htmlSlot()}</div>
104
- <i part="next" @click="${this.next}"> ${iconChevronRight()} </i>
105
- ${htmlStyle(`:host,:host([contents]) [part=root]{width:${this.width};}`)}
106
- </div>`;
99
+ return html`
100
+ <div
101
+ part="root"
102
+ ${attr(this.observedRecord)}
103
+ >
104
+ <i
105
+ part="prev"
106
+ @click="${this.prev}"
107
+ >
108
+ ${iconChevronLeft()}
109
+ </i>
110
+ <div
111
+ part="move-root"
112
+ style="transform:${`translateX(-${this.index + 1}00%)`}"
113
+ >
114
+ ${htmlSlot()}
115
+ </div>
116
+ <i
117
+ part="next"
118
+ @click="${this.next}"
119
+ >
120
+ ${iconChevronRight()}
121
+ </i>
122
+ ${htmlStyle(`:host,:host([contents]) [part=root]{width:${this.width};}`)}
123
+ </div>
124
+ `;
107
125
  }
108
126
 
109
127
  protected async firstUpdated(): Promise<void> {
@@ -1,6 +1,6 @@
1
1
  import { attr, godown, htmlSlot, styles } from "@godown/element";
2
2
  import svgCaretDown from "@godown/f7-icon/icons/chevron-down.js";
3
- import { css, html, type TemplateResult } from "lit";
3
+ import { type TemplateResult, css, html } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
 
6
6
  import { scopePrefix } from "../core/global-style.js";
@@ -19,66 +19,64 @@ const cssScope = scopePrefix(protoName);
19
19
  * @category display
20
20
  */
21
21
  @godown(protoName)
22
- @styles(
23
- css`
24
- :host {
25
- ${cssScope}--icon-deg-open: 0deg;
26
- ${cssScope}--icon-deg-close: 90deg;
27
- ${cssScope}--icon-space: 0.3em;
28
- ${cssScope}--summary-direction: row;
29
- ${cssScope}--transition: .3s;
30
- height: fit-content;
31
- display: block;
32
- transition: var(${cssScope}--transition);
33
- }
22
+ @styles(css`
23
+ :host {
24
+ ${cssScope}--icon-deg-open: 0deg;
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;
30
+ display: block;
31
+ transition: var(${cssScope}--transition);
32
+ }
34
33
 
35
- [part=root] {
36
- height: 100%;
37
- position: relative;
38
- overflow: hidden;
39
- }
34
+ [part="root"] {
35
+ height: 100%;
36
+ position: relative;
37
+ overflow: hidden;
38
+ }
40
39
 
41
- [part=title] {
42
- direction: ltr;
43
- height: 100%;
44
- display: flex;
45
- flex-wrap: nowrap;
46
- justify-content: space-between;
47
- background: inherit;
48
- align-items: center;
49
- flex-direction: var(${cssScope}--summary-direction);
50
- }
40
+ [part="title"] {
41
+ direction: ltr;
42
+ height: 100%;
43
+ display: flex;
44
+ flex-wrap: nowrap;
45
+ justify-content: space-between;
46
+ background: inherit;
47
+ align-items: center;
48
+ flex-direction: var(${cssScope}--summary-direction);
49
+ }
51
50
 
52
- [part=details] {
53
- display: grid;
54
- overflow: hidden;
55
- grid-template-rows: 0fr;
56
- transition: var(${cssScope}--transition);
57
- transition-property: grid-template-rows;
58
- }
51
+ [part="details"] {
52
+ display: grid;
53
+ overflow: hidden;
54
+ grid-template-rows: 0fr;
55
+ transition: var(${cssScope}--transition);
56
+ transition-property: grid-template-rows;
57
+ }
59
58
 
60
- :host([open]) [part=details] {
61
- grid-template-rows: 1fr;
62
- }
59
+ :host([open]) [part="details"] {
60
+ grid-template-rows: 1fr;
61
+ }
63
62
 
64
- :host([float]) [part=details] {
65
- top: 100%;
66
- position: absolute;
67
- }
63
+ :host([float]) [part="details"] {
64
+ top: 100%;
65
+ position: absolute;
66
+ }
68
67
 
69
- [part=icon] {
70
- display: flex;
71
- backface-visibility: hidden;
72
- padding: var(${cssScope}--icon-space);
73
- transition: var(${cssScope}--transition);
74
- transform: rotate(var(${cssScope}--icon-deg-close));
75
- }
68
+ [part="icon"] {
69
+ display: flex;
70
+ backface-visibility: hidden;
71
+ padding: var(${cssScope}--icon-space);
72
+ transition: var(${cssScope}--transition);
73
+ transform: rotate(var(${cssScope}--icon-deg-close));
74
+ }
76
75
 
77
- :host([open]) [part=icon] {
78
- transform: rotate(var(${cssScope}--icon-deg-open));
79
- }
80
- `,
81
- )
76
+ :host([open]) [part="icon"] {
77
+ transform: rotate(var(${cssScope}--icon-deg-open));
78
+ }
79
+ `)
82
80
  class Details extends SuperOpenable {
83
81
  /**
84
82
  * If it is true, the summary event scope will fill the element.
@@ -93,17 +91,28 @@ class Details extends SuperOpenable {
93
91
  summary = "";
94
92
 
95
93
  protected render(): TemplateResult<1> {
96
- return html`<dl part="root" ${attr(this.observedRecord)}>
97
- <dt part="title" @click="${this._handelClick}">
98
- <span part="summary">${this.summary || htmlSlot("summary")}</span>
99
- <span>
100
- <i part="icon">${svgCaretDown()}</i>
101
- </span>
102
- </dt>
103
- <dd part="details" @click=${this.fill ? () => this.toggle() : null}>
104
- <div style="min-height: 0;">${htmlSlot()}</div>
105
- </dd>
106
- </dl>`;
94
+ return html`
95
+ <dl
96
+ part="root"
97
+ ${attr(this.observedRecord)}
98
+ >
99
+ <dt
100
+ part="title"
101
+ @click="${this._handelClick}"
102
+ >
103
+ <span part="summary">${this.summary || htmlSlot("summary")}</span>
104
+ <span>
105
+ <i part="icon">${svgCaretDown()}</i>
106
+ </span>
107
+ </dt>
108
+ <dd
109
+ part="details"
110
+ @click=${this.fill ? () => this.toggle() : null}
111
+ >
112
+ <div style="min-height: 0;">${htmlSlot()}</div>
113
+ </dd>
114
+ </dl>
115
+ `;
107
116
  }
108
117
  }
109
118
 
@@ -1,5 +1,5 @@
1
- import { attr, godown, type HandlerEvent, htmlSlot, styles } from "@godown/element";
2
- import { css, html, type PropertyValues, type TemplateResult } from "lit";
1
+ import { type HandlerEvent, attr, godown, htmlSlot, styles } from "@godown/element";
2
+ import { type PropertyValues, type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
5
  import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
@@ -19,71 +19,68 @@ const cssScope = scopePrefix(protoName);
19
19
  * @category feedback
20
20
  */
21
21
  @godown(protoName)
22
- @styles(
23
- css`
24
- :host {
25
- ${cssScope}--background: none;
26
- ${cssScope}--background-modal: var(${cssGlobalVars.background});
27
- ${cssScope}--opacity-modal: 0.2;
28
- background: var(${cssScope}--background);
29
- pointer-events: none;
30
- visibility: hidden;
31
- position: fixed;
32
- z-index: 1;
33
- inset: 0;
34
- }
35
-
36
- :host([open]) {
37
- visibility: visible;
38
- }
22
+ @styles(css`
23
+ :host {
24
+ ${cssScope}--background: none;
25
+ ${cssScope}--background-modal: var(${cssGlobalVars.background});
26
+ ${cssScope}--opacity-modal: 0.2;
27
+ background: var(${cssScope}--background);
28
+ pointer-events: none;
29
+ visibility: hidden;
30
+ position: fixed;
31
+ z-index: 1;
32
+ inset: 0;
33
+ }
39
34
 
40
- :host([open][modal]) [part=modal] {
41
- pointer-events: all;
42
- visibility: visible;
43
- opacity: var(${cssScope}--opacity-modal);
35
+ :host([open]) {
36
+ visibility: visible;
37
+ }
44
38
 
45
- }
39
+ :host([open][modal]) [part="modal"] {
40
+ pointer-events: all;
41
+ visibility: visible;
42
+ opacity: var(${cssScope}--opacity-modal);
43
+ }
46
44
 
47
- [part=modal] {
48
- visibility: hidden;
49
- opacity: 0;
50
- width: 100%;
51
- height: 100%;
52
- position: absolute;
53
- background: var(${cssScope}--background-modal);
54
- }
45
+ [part="modal"] {
46
+ visibility: hidden;
47
+ opacity: 0;
48
+ width: 100%;
49
+ height: 100%;
50
+ position: absolute;
51
+ background: var(${cssScope}--background-modal);
52
+ }
55
53
 
56
- [part=root] {
57
- width: 100%;
58
- height: 100%;
59
- display: flex;
60
- position: relative;
61
- align-items: center;
62
- justify-content: center;
63
- }
54
+ [part="root"] {
55
+ width: 100%;
56
+ height: 100%;
57
+ display: flex;
58
+ position: relative;
59
+ align-items: center;
60
+ justify-content: center;
61
+ }
64
62
 
65
- [part=container] {
66
- pointer-events: all;
67
- position: absolute;
68
- }
63
+ [part="container"] {
64
+ pointer-events: all;
65
+ position: absolute;
66
+ }
69
67
 
70
- [direction^=top] [part=container] {
71
- top: 0;
72
- }
68
+ [direction^="top"] [part="container"] {
69
+ top: 0;
70
+ }
73
71
 
74
- [direction^=bottom] [part=container] {
75
- bottom: 0;
76
- }
72
+ [direction^="bottom"] [part="container"] {
73
+ bottom: 0;
74
+ }
77
75
 
78
- [direction$=right] [part=container] {
79
- right: 0;
80
- }
76
+ [direction$="right"] [part="container"] {
77
+ right: 0;
78
+ }
81
79
 
82
- [direction$=left] [part=container] {
83
- left: 0;
84
- }
85
- `,
86
- )
80
+ [direction$="left"] [part="container"] {
81
+ left: 0;
82
+ }
83
+ `)
87
84
  class Dialog extends SuperOpenable {
88
85
  /**
89
86
  * Direction of the opening animation.
@@ -106,10 +103,15 @@ class Dialog extends SuperOpenable {
106
103
  private _modalInvoke = false;
107
104
 
108
105
  protected render(): TemplateResult<1> {
109
- return html`<div part="root" ${attr(this.observedRecord)}>
110
- <div part="modal"></div>
111
- <div part="container">${htmlSlot()}</div>
112
- </div>`;
106
+ return html`
107
+ <div
108
+ part="root"
109
+ ${attr(this.observedRecord)}
110
+ >
111
+ <div part="modal"></div>
112
+ <div part="container">${htmlSlot()}</div>
113
+ </div>
114
+ `;
113
115
  }
114
116
 
115
117
  showModal(): void {
@@ -1,5 +1,5 @@
1
1
  import { attr, godown, styles } from "@godown/element";
2
- import { css, html, type TemplateResult } from "lit";
2
+ import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
5
  import { GlobalStyle } from "../core/global-style.js";
@@ -12,34 +12,32 @@ const protoName = "divider";
12
12
  * @category layout
13
13
  */
14
14
  @godown(protoName)
15
- @styles(
16
- css`
17
- :host {
18
- width: 100%;
19
- height: .05em;
20
- margin: auto;
21
- display: block;
22
- background: currentColor;
23
- }
24
-
25
- :host([vertical]) {
26
- width: .05em;
27
- height: max(1em, 100%);
28
- }
29
-
30
- :host([contents]) [part=root] {
31
- width: 100%;
32
- height: .05em;
33
- margin: auto;
34
- display: block;
35
- background: currentColor;
36
- }
37
-
38
- [part=root] {
39
- display: contents;
40
- }
41
- `,
42
- )
15
+ @styles(css`
16
+ :host {
17
+ width: 100%;
18
+ height: 0.05em;
19
+ margin: auto;
20
+ display: block;
21
+ background: currentColor;
22
+ }
23
+
24
+ :host([vertical]) {
25
+ width: 0.05em;
26
+ height: max(1em, 100%);
27
+ }
28
+
29
+ :host([contents]) [part="root"] {
30
+ width: 100%;
31
+ height: 0.05em;
32
+ margin: auto;
33
+ display: block;
34
+ background: currentColor;
35
+ }
36
+
37
+ [part="root"] {
38
+ display: contents;
39
+ }
40
+ `)
43
41
  class Divider extends GlobalStyle {
44
42
  /**
45
43
  * Vertical display.
@@ -48,7 +46,12 @@ class Divider extends GlobalStyle {
48
46
  vertical = false;
49
47
 
50
48
  protected render(): TemplateResult<1> {
51
- return html`<div part="root" ${attr(this.observedRecord)}></div>`;
49
+ return html`
50
+ <div
51
+ part="root"
52
+ ${attr(this.observedRecord)}
53
+ ></div>
54
+ `;
52
55
  }
53
56
  }
54
57