godown 3.3.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.
- package/build/godown+lit.iife.js +4 -4
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +4 -4
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +4 -4
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +3 -3
- package/build/godown.js +4 -4
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +3 -3
- package/build/godown.umd.js.map +1 -1
- package/components/alert.js +1 -1
- package/components/alert.js.map +1 -1
- package/components/avatar.d.ts +5 -4
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.d.ts +10 -2
- package/components/badge.d.ts.map +1 -1
- package/components/badge.js.map +1 -1
- package/components/breath.d.ts +2 -3
- package/components/breath.d.ts.map +1 -1
- package/components/breath.js +1 -1
- package/components/breath.js.map +1 -1
- package/components/button.d.ts +7 -2
- package/components/button.d.ts.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.d.ts +6 -0
- package/components/card.d.ts.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/carousel.d.ts +2 -2
- package/components/details.d.ts +3 -3
- package/components/details.d.ts.map +1 -1
- package/components/dialog.d.ts +9 -6
- package/components/dialog.d.ts.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts +1 -1
- package/components/heading.d.ts +2 -0
- package/components/heading.d.ts.map +1 -1
- package/components/heading.js.map +1 -1
- package/components/input.d.ts +2 -2
- package/components/input.d.ts.map +1 -1
- package/components/input.js +1 -1
- package/components/input.js.map +1 -1
- package/components/link.d.ts +1 -1
- package/components/link.d.ts.map +1 -1
- package/components/link.js +1 -1
- package/components/link.js.map +1 -1
- package/components/progress.d.ts +0 -7
- package/components/progress.d.ts.map +1 -1
- package/components/progress.js +1 -1
- package/components/progress.js.map +1 -1
- package/components/range.d.ts +43 -9
- package/components/range.d.ts.map +1 -1
- package/components/range.js +1 -1
- package/components/range.js.map +1 -1
- package/components/rotate.d.ts +6 -4
- package/components/rotate.d.ts.map +1 -1
- package/components/rotate.js.map +1 -1
- package/components/select.d.ts +4 -2
- package/components/select.d.ts.map +1 -1
- package/components/select.js +1 -1
- package/components/select.js.map +1 -1
- package/components/split.d.ts +2 -1
- package/components/split.d.ts.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -7
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/components/time.d.ts +2 -2
- package/components/time.d.ts.map +1 -1
- package/components/time.js.map +1 -1
- package/components/tooltip.d.ts +3 -2
- package/components/tooltip.d.ts.map +1 -1
- package/components/tooltip.js +1 -1
- package/components/tooltip.js.map +1 -1
- package/core/direction.d.ts +27 -0
- package/core/direction.d.ts.map +1 -0
- package/core/direction.js +2 -0
- package/core/direction.js.map +1 -0
- package/core/global-style.d.ts +0 -2
- package/core/global-style.d.ts.map +1 -1
- package/core/global-style.js +1 -1
- package/core/global-style.js.map +1 -1
- package/core/outline.d.ts +20 -0
- package/core/outline.d.ts.map +1 -0
- package/core/outline.js +2 -0
- package/core/outline.js.map +1 -0
- package/core/super-anchor.d.ts +2 -2
- package/core/super-anchor.d.ts.map +1 -1
- package/core/super-anchor.js +1 -1
- package/core/super-anchor.js.map +1 -1
- package/core/super-input.d.ts +2 -0
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -4
- package/core/super-openable.d.ts.map +1 -1
- package/custom-elements.json +1 -1
- package/dev/components/alert.js +1 -1
- package/dev/components/avatar.d.ts +5 -4
- package/dev/components/avatar.d.ts.map +1 -1
- package/dev/components/avatar.js +5 -4
- package/dev/components/avatar.js.map +1 -1
- package/dev/components/badge.d.ts +10 -2
- package/dev/components/badge.d.ts.map +1 -1
- package/dev/components/badge.js +8 -0
- package/dev/components/badge.js.map +1 -1
- package/dev/components/breath.d.ts +2 -3
- package/dev/components/breath.d.ts.map +1 -1
- package/dev/components/breath.js +3 -14
- package/dev/components/breath.js.map +1 -1
- package/dev/components/button.d.ts +7 -2
- package/dev/components/button.d.ts.map +1 -1
- package/dev/components/button.js +19 -5
- package/dev/components/button.js.map +1 -1
- package/dev/components/card.d.ts +6 -0
- package/dev/components/card.d.ts.map +1 -1
- package/dev/components/card.js +11 -11
- package/dev/components/card.js.map +1 -1
- package/dev/components/carousel.d.ts +2 -2
- package/dev/components/carousel.js +2 -2
- package/dev/components/details.d.ts +3 -3
- package/dev/components/details.d.ts.map +1 -1
- package/dev/components/details.js +3 -3
- package/dev/components/details.js.map +1 -1
- package/dev/components/dialog.d.ts +9 -6
- package/dev/components/dialog.d.ts.map +1 -1
- package/dev/components/dialog.js +58 -62
- package/dev/components/dialog.js.map +1 -1
- package/dev/components/divider.d.ts +1 -1
- package/dev/components/divider.js +1 -1
- package/dev/components/heading.d.ts +2 -0
- package/dev/components/heading.d.ts.map +1 -1
- package/dev/components/heading.js +2 -0
- package/dev/components/heading.js.map +1 -1
- package/dev/components/input.d.ts +2 -2
- package/dev/components/input.d.ts.map +1 -1
- package/dev/components/input.js +29 -8
- package/dev/components/input.js.map +1 -1
- package/dev/components/link.d.ts +1 -1
- package/dev/components/link.d.ts.map +1 -1
- package/dev/components/link.js +2 -2
- package/dev/components/link.js.map +1 -1
- package/dev/components/progress.d.ts +0 -7
- package/dev/components/progress.d.ts.map +1 -1
- package/dev/components/progress.js +4 -25
- package/dev/components/progress.js.map +1 -1
- package/dev/components/range.d.ts +43 -9
- package/dev/components/range.d.ts.map +1 -1
- package/dev/components/range.js +50 -14
- package/dev/components/range.js.map +1 -1
- package/dev/components/rotate.d.ts +6 -4
- package/dev/components/rotate.d.ts.map +1 -1
- package/dev/components/rotate.js +6 -4
- package/dev/components/rotate.js.map +1 -1
- package/dev/components/select.d.ts +4 -2
- package/dev/components/select.d.ts.map +1 -1
- package/dev/components/select.js +27 -24
- package/dev/components/select.js.map +1 -1
- package/dev/components/split.d.ts +2 -1
- package/dev/components/split.d.ts.map +1 -1
- package/dev/components/split.js +10 -6
- package/dev/components/split.js.map +1 -1
- package/dev/components/switch.d.ts +5 -7
- package/dev/components/switch.d.ts.map +1 -1
- package/dev/components/switch.js +23 -45
- package/dev/components/switch.js.map +1 -1
- package/dev/components/time.d.ts +2 -2
- package/dev/components/time.d.ts.map +1 -1
- package/dev/components/time.js.map +1 -1
- package/dev/components/tooltip.d.ts +3 -2
- package/dev/components/tooltip.d.ts.map +1 -1
- package/dev/components/tooltip.js +7 -19
- package/dev/components/tooltip.js.map +1 -1
- package/dev/core/direction.d.ts +27 -0
- package/dev/core/direction.d.ts.map +1 -0
- package/dev/core/direction.js +56 -0
- package/dev/core/direction.js.map +1 -0
- package/dev/core/global-style.d.ts +0 -2
- package/dev/core/global-style.d.ts.map +1 -1
- package/dev/core/global-style.js +1 -5
- package/dev/core/global-style.js.map +1 -1
- package/dev/core/outline.d.ts +20 -0
- package/dev/core/outline.d.ts.map +1 -0
- package/dev/core/outline.js +44 -0
- package/dev/core/outline.js.map +1 -0
- package/dev/core/super-anchor.d.ts +2 -2
- package/dev/core/super-anchor.d.ts.map +1 -1
- package/dev/core/super-anchor.js +0 -1
- package/dev/core/super-anchor.js.map +1 -1
- package/dev/core/super-input.d.ts +2 -0
- package/dev/core/super-input.d.ts.map +1 -1
- package/dev/core/super-input.js +19 -30
- package/dev/core/super-input.js.map +1 -1
- package/dev/core/super-openable.d.ts +0 -4
- package/dev/core/super-openable.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/alert.ts +1 -1
- package/src/components/avatar.ts +7 -5
- package/src/components/badge.ts +10 -3
- package/src/components/breath.ts +5 -17
- package/src/components/button.ts +18 -5
- package/src/components/card.ts +11 -11
- package/src/components/carousel.ts +2 -2
- package/src/components/details.ts +3 -3
- package/src/components/dialog.ts +66 -65
- package/src/components/divider.ts +1 -1
- package/src/components/heading.ts +2 -0
- package/src/components/input.ts +29 -8
- package/src/components/link.ts +2 -2
- package/src/components/progress.ts +4 -25
- package/src/components/range.ts +51 -15
- package/src/components/rotate.ts +6 -4
- package/src/components/select.ts +33 -26
- package/src/components/split.ts +11 -6
- package/src/components/switch.ts +26 -41
- package/src/components/time.ts +2 -2
- package/src/components/tooltip.ts +8 -20
- package/src/core/direction.ts +65 -0
- package/src/core/global-style.ts +1 -7
- package/src/core/outline.ts +54 -0
- package/src/core/super-anchor.ts +3 -2
- package/src/core/super-input.ts +22 -30
- package/src/core/super-openable.ts +0 -8
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
package/dev/core/super-input.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
import { __decorate } from "tslib";
|
2
2
|
import { htmlSlot, omit, part, styles } from "@godown/element";
|
3
|
-
import iconEyeSlashFill from "@godown/f7-icon/icons/eye-slash-fill.js";
|
4
3
|
import { css, html } from "lit";
|
5
4
|
import { property } from "lit/decorators.js";
|
6
5
|
import { GlobalStyle, cssGlobalVars } from "./global-style.js";
|
6
|
+
import { OutlineBuilder } from "./outline.js";
|
7
7
|
const fieldStyle = css `
|
8
8
|
.input-field {
|
9
|
+
--space: var(${cssGlobalVars.input}-space);
|
9
10
|
display: flex;
|
10
11
|
position: relative;
|
11
12
|
align-items: center;
|
@@ -14,16 +15,11 @@ const fieldStyle = css `
|
|
14
15
|
}
|
15
16
|
|
16
17
|
.input-field [part="input"] {
|
17
|
-
background:
|
18
|
+
background: none;
|
18
19
|
height: 100%;
|
19
20
|
width: 100%;
|
20
21
|
color: inherit;
|
21
|
-
padding: 0 var(
|
22
|
-
}
|
23
|
-
|
24
|
-
.input-field:focus-within,
|
25
|
-
.input-field.outline {
|
26
|
-
box-shadow: var(${cssGlobalVars.input}-box-shadow);
|
22
|
+
padding: 0 var(--space);
|
27
23
|
}
|
28
24
|
|
29
25
|
.input-field [part="icon"] {
|
@@ -39,11 +35,11 @@ const fieldStyle = css `
|
|
39
35
|
}
|
40
36
|
|
41
37
|
.input-field [part="suffix"] [part="icon"] {
|
42
|
-
padding-inline-end: var(
|
38
|
+
padding-inline-end: var(--space);
|
43
39
|
}
|
44
40
|
|
45
41
|
.input-field [part="prefix"] [part="icon"] {
|
46
|
-
padding-inline-start: var(
|
42
|
+
padding-inline-start: var(--space);
|
47
43
|
}
|
48
44
|
`;
|
49
45
|
const inputStyle = css `
|
@@ -51,12 +47,10 @@ const inputStyle = css `
|
|
51
47
|
${cssGlobalVars.input}-width: 10em;
|
52
48
|
${cssGlobalVars.input}-height: 1.6em;
|
53
49
|
${cssGlobalVars.input}-space: 0.2em;
|
54
|
-
${cssGlobalVars.input}-
|
55
|
-
${cssGlobalVars.input}-
|
56
|
-
${cssGlobalVars.input}-
|
57
|
-
|
58
|
-
${cssGlobalVars.input}-box-shadow: 0px 0px 0px .1em var(${cssGlobalVars.active});
|
59
|
-
border-radius: var(${cssGlobalVars.input}-radius);
|
50
|
+
${cssGlobalVars.input}-control: currentColor;
|
51
|
+
${cssGlobalVars.input}-outline-width: .075em;
|
52
|
+
${cssGlobalVars.input}-outline-color: var(${cssGlobalVars.passive});
|
53
|
+
border-radius: 0.2em;
|
60
54
|
}
|
61
55
|
|
62
56
|
:host([disabled]) {
|
@@ -77,6 +71,7 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
77
71
|
constructor() {
|
78
72
|
super(...arguments);
|
79
73
|
this.autofocus = false;
|
74
|
+
this.outlineType = "border";
|
80
75
|
this.disabled = false;
|
81
76
|
/**
|
82
77
|
* Returns true when the input is compositing.
|
@@ -154,24 +149,12 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
154
149
|
`;
|
155
150
|
}
|
156
151
|
_renderSuffix() {
|
157
|
-
const PASSWORD = "password";
|
158
152
|
return html `
|
159
153
|
<label
|
160
154
|
for=${this.makeId}
|
161
155
|
part="suffix"
|
162
156
|
>
|
163
|
-
${
|
164
|
-
? html `
|
165
|
-
<i
|
166
|
-
part="icon"
|
167
|
-
@mousedown="${() => this._changeInputType("text")}"
|
168
|
-
@mouseup="${() => this._changeInputType(PASSWORD)}"
|
169
|
-
@mouseleave="${() => this._changeInputType(PASSWORD)}"
|
170
|
-
>
|
171
|
-
${iconEyeSlashFill()}
|
172
|
-
</i>
|
173
|
-
`
|
174
|
-
: htmlSlot("suffix")}
|
157
|
+
${htmlSlot("suffix")}
|
175
158
|
</label>
|
176
159
|
`;
|
177
160
|
}
|
@@ -179,6 +162,9 @@ let SuperInput = class SuperInput extends GlobalStyle {
|
|
179
162
|
__decorate([
|
180
163
|
property()
|
181
164
|
], SuperInput.prototype, "autocomplete", void 0);
|
165
|
+
__decorate([
|
166
|
+
property({ attribute: "outline-type" })
|
167
|
+
], SuperInput.prototype, "outlineType", void 0);
|
182
168
|
__decorate([
|
183
169
|
property({ type: Boolean, reflect: true })
|
184
170
|
], SuperInput.prototype, "disabled", void 0);
|
@@ -201,7 +187,10 @@ __decorate([
|
|
201
187
|
part("input")
|
202
188
|
], SuperInput.prototype, "_input", void 0);
|
203
189
|
SuperInput = __decorate([
|
204
|
-
styles(fieldStyle,
|
190
|
+
styles(fieldStyle, new OutlineBuilder({
|
191
|
+
width: `${cssGlobalVars.input}-outline-width`,
|
192
|
+
color: `${cssGlobalVars.input}-outline-color`,
|
193
|
+
}).styleSheet, inputStyle)
|
205
194
|
], SuperInput);
|
206
195
|
export default SuperInput;
|
207
196
|
export { SuperInput };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-input.ts"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,
|
1
|
+
{"version":3,"file":"super-input.js","sourceRoot":"","sources":["../../src/core/super-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EAAE,CAAC;4CAC1B;AAGjB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACZ;AAGhB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;+CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCACf;AAGb;IADC,QAAQ,EAAE;yCACA;AAUX;IADC,QAAQ,EAAE;2CACE;AAGH;IADT,IAAI,CAAC,OAAO,CAAC;0CACqB;AAlC/B,UAAU;IARf,MAAM,CACL,UAAU,EACV,IAAI,cAAc,CAAC;QACjB,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,gBAAgB;QAC7C,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,gBAAgB;KAC9C,CAAC,CAAC,UAAU,EACb,UAAU,CACX;GACK,UAAU,CAsIf;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
@@ -13,8 +13,4 @@ declare class SuperOpenable extends GlobalStyle {
|
|
13
13
|
}
|
14
14
|
export default SuperOpenable;
|
15
15
|
export { SuperOpenable };
|
16
|
-
export type Direction4 = "left" | "right" | "top" | "bottom";
|
17
|
-
export type Direction5 = Direction4 | "center";
|
18
|
-
export type Direction8 = Direction4 | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
19
|
-
export type Direction9 = Direction8 | Direction5;
|
20
16
|
//# sourceMappingURL=super-openable.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAG5C;AAED,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC
|
1
|
+
{"version":3,"file":"super-openable.d.ts","sourceRoot":"","sources":["../../src/core/super-openable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAG5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,cAAM,aAAc,SAAQ,WAAW;IACrC;;OAEG;IAEH,IAAI,UAAS;IAEb,MAAM,CAAC,EAAE,GAAE,OAAsC,GAAG,IAAI;IAIxD,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,SAAS,CAAC,OAAO,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;IAOlE,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;CAG5C;AAED,eAAe,aAAa,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "godown",
|
3
|
-
"version": "3.
|
3
|
+
"version": "3.4.0",
|
4
4
|
"description": "Non Composite Web Components Library",
|
5
5
|
"type": "module",
|
6
6
|
"main": "index.js",
|
@@ -33,8 +33,8 @@
|
|
33
33
|
"lit": "^3.0.0",
|
34
34
|
"tslib": "^2.7.0",
|
35
35
|
"@godown/colors": "^1.0.0",
|
36
|
-
"@godown/element": "^1.
|
37
|
-
"@godown/f7-icon": "^1.0.
|
36
|
+
"@godown/element": "^1.3.0",
|
37
|
+
"@godown/f7-icon": "^1.0.3"
|
38
38
|
},
|
39
39
|
"publishConfig": {
|
40
40
|
"access": "public"
|
package/src/components/alert.ts
CHANGED
@@ -90,7 +90,7 @@ const calls = {
|
|
90
90
|
@styles(css`
|
91
91
|
:host,
|
92
92
|
:where(:host([contents]) [part="root"]) {
|
93
|
-
${cssScope}--border-radius: .
|
93
|
+
${cssScope}--border-radius: .2em;
|
94
94
|
${cssScope}--border-width: .075em;
|
95
95
|
${cssScope}--blockquote-width: .2em;
|
96
96
|
${cssScope}--blockquote-background: transparent;
|
package/src/components/avatar.ts
CHANGED
@@ -23,6 +23,7 @@ const cssScope = scopePrefix(protoName);
|
|
23
23
|
width: var(${cssScope}--size);
|
24
24
|
height: var(${cssScope}--size);
|
25
25
|
vertical-align: bottom;
|
26
|
+
border-radius: 0.2em;
|
26
27
|
}
|
27
28
|
|
28
29
|
:host,
|
@@ -58,19 +59,20 @@ const cssScope = scopePrefix(protoName);
|
|
58
59
|
`)
|
59
60
|
class Avatar extends GlobalStyle {
|
60
61
|
/**
|
61
|
-
*
|
62
|
+
* The `src` property specifies the URL of the avatar image.
|
63
|
+
* If `src` is not provided, the component will display the `name` property instead.
|
62
64
|
*/
|
63
65
|
@property()
|
64
66
|
src: string | undefined | null;
|
65
67
|
|
66
68
|
/**
|
67
|
-
*
|
69
|
+
* Specifies the name or initials to display if no `src` is provided
|
68
70
|
*/
|
69
71
|
@property()
|
70
72
|
name = "";
|
71
73
|
|
72
74
|
/**
|
73
|
-
*
|
75
|
+
* If `true`, will make the avatar display as a circle.
|
74
76
|
*/
|
75
77
|
@property({ type: Boolean })
|
76
78
|
round = false;
|
@@ -99,13 +101,13 @@ class Avatar extends GlobalStyle {
|
|
99
101
|
}
|
100
102
|
if (this.name) {
|
101
103
|
return html`
|
102
|
-
<span part="name">${this.
|
104
|
+
<span part="name">${this.formatName()}</span>
|
103
105
|
`;
|
104
106
|
}
|
105
107
|
return htmlSlot();
|
106
108
|
}
|
107
109
|
|
108
|
-
|
110
|
+
formatName(): string {
|
109
111
|
return this.name;
|
110
112
|
}
|
111
113
|
|
package/src/components/badge.ts
CHANGED
@@ -3,8 +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
|
-
|
7
|
-
type Position = "top-right" | "top-left" | "bottom-right" | "bottom-left";
|
6
|
+
import { DirectionCorner } from "../core/direction.js";
|
8
7
|
|
9
8
|
const protoName = "badge";
|
10
9
|
const cssScope = scopePrefix(protoName);
|
@@ -70,8 +69,12 @@ const cssScope = scopePrefix(protoName);
|
|
70
69
|
}
|
71
70
|
`)
|
72
71
|
class Badge extends GlobalStyle {
|
72
|
+
/**
|
73
|
+
* The position of the badge relative to its parent element.
|
74
|
+
* Possible values are `"top-left"`, `"top-right"`, `"bottom-left"`, and `"bottom-right"`.
|
75
|
+
*/
|
73
76
|
@property()
|
74
|
-
position:
|
77
|
+
position: DirectionCorner = "top-right";
|
75
78
|
|
76
79
|
@property({ type: Number })
|
77
80
|
value = 0;
|
@@ -82,6 +85,10 @@ class Badge extends GlobalStyle {
|
|
82
85
|
@property({ type: Boolean })
|
83
86
|
dot = false;
|
84
87
|
|
88
|
+
/**
|
89
|
+
* The maximum value that can be displayed in the badge
|
90
|
+
* Values greater than this will be displayed as `max+` by default.
|
91
|
+
*/
|
85
92
|
@property({ type: Number })
|
86
93
|
max = 99;
|
87
94
|
|
package/src/components/breath.ts
CHANGED
@@ -101,10 +101,10 @@ class Breath extends GlobalStyle {
|
|
101
101
|
content: string | string[];
|
102
102
|
|
103
103
|
/**
|
104
|
-
* Effect duration
|
104
|
+
* Effect duration.
|
105
105
|
*/
|
106
|
-
@property()
|
107
|
-
duration:
|
106
|
+
@property({ type: Number })
|
107
|
+
duration: number;
|
108
108
|
|
109
109
|
protected render(): TemplateResult<1> {
|
110
110
|
const texts = this.getTexts();
|
@@ -135,29 +135,17 @@ class Breath extends GlobalStyle {
|
|
135
135
|
|
136
136
|
protected _computeStyle(len: number): string {
|
137
137
|
const gap = 100 / 2 / len;
|
138
|
-
const duration = this.
|
138
|
+
const duration = this.duration || (len * 2 + 2) * 1000;
|
139
139
|
let style1 = "";
|
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
143
|
style1 += `.rel:nth-child(${number}) .colorful{animation-delay:${delay}s;background:var(${cssScope}--${number},var(${cssScope}--${defaultNumber}));}`;
|
144
144
|
}
|
145
|
-
return `.colorful{animation-duration:${duration}
|
145
|
+
return `.colorful{animation-duration:${duration}ms;}@keyframes colorfulN{0%,${gap * 3}%{opacity:0;}${gap}%,${
|
146
146
|
gap * 2
|
147
147
|
}%{opacity:1;}}${style1}`;
|
148
148
|
}
|
149
|
-
|
150
|
-
parseDuration(): number | undefined {
|
151
|
-
const { duration } = this;
|
152
|
-
if (duration) {
|
153
|
-
if (duration.endsWith("s")) {
|
154
|
-
return Number.parseFloat(duration.slice(0, -1));
|
155
|
-
}
|
156
|
-
if (duration.endsWith("ms")) {
|
157
|
-
return Number.parseFloat(duration.slice(0, -2)) / 1000;
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}
|
161
149
|
}
|
162
150
|
|
163
151
|
export default Breath;
|
package/src/components/button.ts
CHANGED
@@ -110,6 +110,11 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
110
110
|
color: var(${cssScope}--ghost-color);
|
111
111
|
background: transparent;
|
112
112
|
}
|
113
|
+
|
114
|
+
:host([plain]) {
|
115
|
+
${cssScope}--gradients: unset;
|
116
|
+
${cssScope}--focus-scale: unset;
|
117
|
+
}
|
113
118
|
`,
|
114
119
|
css`
|
115
120
|
:host {
|
@@ -127,9 +132,8 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
127
132
|
var(${cssScope}--background),
|
128
133
|
var(${cssScope}--gradients, var(${cssScope}--background))
|
129
134
|
);
|
130
|
-
border-radius: 0.
|
135
|
+
border-radius: 0.2em;
|
131
136
|
width: fit-content;
|
132
|
-
transition: 0.1s;
|
133
137
|
display: block;
|
134
138
|
overflow: hidden;
|
135
139
|
text-align: center;
|
@@ -183,13 +187,20 @@ const colors: Record<Colors, string> = constructCSSObject(
|
|
183
187
|
)
|
184
188
|
class Button extends GlobalStyle {
|
185
189
|
/**
|
186
|
-
*
|
190
|
+
* If true, remove gradient, modal animation, focus scale.
|
191
|
+
*/
|
192
|
+
@property({ type: Boolean, reflect: true })
|
193
|
+
plain = false;
|
194
|
+
|
195
|
+
/**
|
196
|
+
* Whether this element is disabled or not.
|
187
197
|
*/
|
188
198
|
@property({ type: Boolean, reflect: true })
|
189
199
|
disabled = false;
|
190
200
|
|
191
201
|
/**
|
192
|
-
*
|
202
|
+
* Whether this element should be rendered as a "ghost" button.
|
203
|
+
* A ghost button is a button with a transparent background and a border.
|
193
204
|
*/
|
194
205
|
@property({ type: Boolean, reflect: true })
|
195
206
|
ghost = false;
|
@@ -259,7 +270,9 @@ class Button extends GlobalStyle {
|
|
259
270
|
e.preventDefault();
|
260
271
|
return;
|
261
272
|
}
|
262
|
-
this.
|
273
|
+
if (!this.plain) {
|
274
|
+
this._handleModal(e);
|
275
|
+
}
|
263
276
|
}
|
264
277
|
|
265
278
|
protected _handleModal(e: MouseEvent): void {
|
package/src/components/card.ts
CHANGED
@@ -22,19 +22,13 @@ const cssScope = scopePrefix(protoName);
|
|
22
22
|
@godown(protoName)
|
23
23
|
@styles(css`
|
24
24
|
:host {
|
25
|
-
${cssScope}--
|
26
|
-
${cssScope}--border-
|
27
|
-
${cssScope}--
|
28
|
-
${cssScope}--border-background: var(${cssGlobalVars.passive});
|
29
|
-
${cssScope}--padding: .75em;
|
30
|
-
color: var(${cssGlobalVars.foreground});
|
31
|
-
background: var(${cssScope}--background);
|
25
|
+
${cssScope}--border-width: .075em;
|
26
|
+
${cssScope}--border-color: var(${cssGlobalVars.passive});
|
27
|
+
${cssScope}--padding: .5em;
|
32
28
|
border-width: var(${cssScope}--border-width);
|
33
29
|
display: block;
|
34
30
|
flex-shrink: 0;
|
35
|
-
|
36
|
-
overflow: hidden;
|
37
|
-
box-sizing: border-box;
|
31
|
+
border-radius: 0.2em;
|
38
32
|
}
|
39
33
|
|
40
34
|
slot {
|
@@ -44,7 +38,7 @@ const cssScope = scopePrefix(protoName);
|
|
44
38
|
|
45
39
|
:host,
|
46
40
|
slot {
|
47
|
-
border-color: var(${cssScope}--border-
|
41
|
+
border-color: var(${cssScope}--border-color);
|
48
42
|
border-style: solid;
|
49
43
|
}
|
50
44
|
|
@@ -57,9 +51,15 @@ const cssScope = scopePrefix(protoName);
|
|
57
51
|
}
|
58
52
|
`)
|
59
53
|
class Card extends GlobalStyle {
|
54
|
+
/**
|
55
|
+
* Whether to display the header.
|
56
|
+
*/
|
60
57
|
@property({ type: Boolean })
|
61
58
|
footer = false;
|
62
59
|
|
60
|
+
/**
|
61
|
+
* Whether to display the footer.
|
62
|
+
*/
|
63
63
|
@property({ type: Boolean })
|
64
64
|
header = false;
|
65
65
|
|
@@ -69,13 +69,13 @@ function getWidth(e) {
|
|
69
69
|
`)
|
70
70
|
class Carousel extends GlobalStyle {
|
71
71
|
/**
|
72
|
-
* The index of the
|
72
|
+
* The index of the current item.
|
73
73
|
*/
|
74
74
|
@property({ type: Number })
|
75
75
|
index = 0;
|
76
76
|
|
77
77
|
/**
|
78
|
-
*
|
78
|
+
* The duration of the transition.
|
79
79
|
*/
|
80
80
|
@property({ type: Number })
|
81
81
|
autoChange = 0;
|
@@ -4,7 +4,7 @@ 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";
|
7
|
-
import SuperOpenable from "../core/super-openable.js";
|
7
|
+
import { SuperOpenable } from "../core/super-openable.js";
|
8
8
|
|
9
9
|
const protoName = "details";
|
10
10
|
|
@@ -79,13 +79,13 @@ const cssScope = scopePrefix(protoName);
|
|
79
79
|
`)
|
80
80
|
class Details extends SuperOpenable {
|
81
81
|
/**
|
82
|
-
*
|
82
|
+
* Determines whether the details component should fill the available space.
|
83
83
|
*/
|
84
84
|
@property({ type: Boolean })
|
85
85
|
fill = false;
|
86
86
|
|
87
87
|
/**
|
88
|
-
*
|
88
|
+
* The summary text to display in the details component.
|
89
89
|
*/
|
90
90
|
@property()
|
91
91
|
summary = "";
|
package/src/components/dialog.ts
CHANGED
@@ -2,8 +2,14 @@ import { type HandlerEvent, attr, godown, htmlSlot, styles } from "@godown/eleme
|
|
2
2
|
import { type PropertyValues, type TemplateResult, css, html } from "lit";
|
3
3
|
import { property } from "lit/decorators.js";
|
4
4
|
|
5
|
-
import {
|
6
|
-
import SuperOpenable from "../core/super-openable.js";
|
5
|
+
import { scopePrefix } from "../core/global-style.js";
|
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";
|
7
13
|
|
8
14
|
const protoName = "dialog";
|
9
15
|
const cssScope = scopePrefix(protoName);
|
@@ -19,87 +25,77 @@ const cssScope = scopePrefix(protoName);
|
|
19
25
|
* @category feedback
|
20
26
|
*/
|
21
27
|
@godown(protoName)
|
22
|
-
@styles(
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
visibility: visible;
|
37
|
-
}
|
38
|
-
|
39
|
-
:host([open][modal]) [part="modal"] {
|
40
|
-
pointer-events: all;
|
41
|
-
visibility: visible;
|
42
|
-
opacity: var(${cssScope}--opacity-modal);
|
43
|
-
}
|
44
|
-
|
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
|
-
}
|
53
|
-
|
54
|
-
[part="root"] {
|
55
|
-
width: 100%;
|
56
|
-
height: 100%;
|
57
|
-
display: flex;
|
58
|
-
position: relative;
|
59
|
-
align-items: center;
|
60
|
-
justify-content: center;
|
61
|
-
}
|
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
|
+
visibility: hidden;
|
38
|
+
position: fixed;
|
39
|
+
z-index: 1;
|
40
|
+
inset: 0;
|
41
|
+
}
|
62
42
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
43
|
+
:host([open]) {
|
44
|
+
visibility: visible;
|
45
|
+
}
|
67
46
|
|
68
|
-
|
69
|
-
|
70
|
-
|
47
|
+
:host([open][modal]) [part="modal"] {
|
48
|
+
pointer-events: all;
|
49
|
+
visibility: visible;
|
50
|
+
opacity: var(${cssScope}--opacity-modal);
|
51
|
+
}
|
71
52
|
|
72
|
-
|
73
|
-
|
74
|
-
|
53
|
+
[part="modal"] {
|
54
|
+
visibility: hidden;
|
55
|
+
opacity: 0;
|
56
|
+
width: 100%;
|
57
|
+
height: 100%;
|
58
|
+
position: absolute;
|
59
|
+
background: var(${cssScope}--background-modal);
|
60
|
+
}
|
75
61
|
|
76
|
-
|
77
|
-
|
78
|
-
|
62
|
+
[part="root"] {
|
63
|
+
width: 100%;
|
64
|
+
height: 100%;
|
65
|
+
display: flex;
|
66
|
+
position: relative;
|
67
|
+
align-items: center;
|
68
|
+
justify-content: center;
|
69
|
+
}
|
79
70
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
71
|
+
[part="container"] {
|
72
|
+
pointer-events: all;
|
73
|
+
position: absolute;
|
74
|
+
}
|
75
|
+
`,
|
76
|
+
)
|
84
77
|
class Dialog extends SuperOpenable {
|
85
78
|
/**
|
86
|
-
*
|
87
|
-
* @deprecated
|
79
|
+
* The direction of the dialog container.
|
88
80
|
*/
|
89
|
-
|
81
|
+
@property()
|
82
|
+
direction: DirectionCardinal | DirectionCorner | DirectionCenter;
|
90
83
|
|
91
84
|
/**
|
92
|
-
*
|
85
|
+
* Indicates whether the dialog should be displayed as a modal.
|
93
86
|
*/
|
94
87
|
@property({ type: Boolean, reflect: true })
|
95
88
|
modal = false;
|
96
89
|
|
97
90
|
/**
|
98
|
-
*
|
91
|
+
* The keys will close the dialog when pressed.
|
99
92
|
*/
|
100
93
|
@property()
|
101
94
|
key = "Escape";
|
102
95
|
|
96
|
+
/**
|
97
|
+
* Indicates whether the modal has been invoked.
|
98
|
+
*/
|
103
99
|
private __modalInvoke = false;
|
104
100
|
|
105
101
|
protected render(): TemplateResult<1> {
|
@@ -109,7 +105,12 @@ class Dialog extends SuperOpenable {
|
|
109
105
|
${attr(this.observedRecord)}
|
110
106
|
>
|
111
107
|
<div part="modal"></div>
|
112
|
-
<div
|
108
|
+
<div
|
109
|
+
part="container"
|
110
|
+
direction-inset-align
|
111
|
+
>
|
112
|
+
${htmlSlot()}
|
113
|
+
</div>
|
113
114
|
</div>
|
114
115
|
`;
|
115
116
|
}
|