@exmg/exm-snackbar 1.0.0 → 1.0.2
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/README.md +2 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/src/exm-snackbar.d.ts +4 -3
- package/src/exm-snackbar.js +10 -9
- package/src/styles/exm-snackbar-css.d.ts +1 -0
- package/src/styles/exm-snackbar-css.js +31 -0
- package/src/styles/exm-snackbar-styles-css.d.ts +0 -1
- package/src/styles/exm-snackbar-styles-css.js +29 -2
- package/src/styles/exm-snackbar-styles.scss +0 -31
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ npm install @exmg/exm-snackbar
|
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
18
|
<exm-button unelevated @click=${() =>
|
|
19
|
-
this.shadowRoot?.querySelector<
|
|
19
|
+
this.shadowRoot?.querySelector<ExmSnackbar>('#default-snackbar')?.show()}>
|
|
20
20
|
Open default
|
|
21
21
|
</exm-button>
|
|
22
22
|
<exm-snackbar id="default-snackbar" labelText="Default auto close"></exm-snackbar>
|
|
@@ -70,6 +70,6 @@ npm install @exmg/exm-snackbar
|
|
|
70
70
|
|
|
71
71
|
## Additional references
|
|
72
72
|
|
|
73
|
-
- [Additional Documentation](https://exmg.github.io/exmachina-web-components/
|
|
73
|
+
- [Additional Documentation](https://exmg.github.io/exmachina-web-components/ExmSnackbar.html)
|
|
74
74
|
|
|
75
75
|
- [Demo](https://exmg.github.io/exmachina-web-components/demo/?el=exm-snackbar)
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ExmSnackbar } from './src/exm-snackbar.js';
|
|
2
2
|
export { SnackBarPayload } from './src/types.js';
|
|
3
|
-
export { style as snackbarStyles } from './src/styles/exm-snackbar-
|
|
3
|
+
export { style as snackbarStyles } from './src/styles/exm-snackbar-css.js';
|
package/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { style as snackbarStyles } from './src/styles/exm-snackbar-
|
|
1
|
+
export { ExmSnackbar } from './src/exm-snackbar.js';
|
|
2
|
+
export { style as snackbarStyles } from './src/styles/exm-snackbar-css.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exmg/exm-snackbar",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "e7086831faea0bdfe8628b0de9b7ddcc45174558"
|
|
43
43
|
}
|
package/src/exm-snackbar.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { CSSResult } from 'lit';
|
|
1
2
|
import { SnackbarBase } from '@material/mwc-snackbar/mwc-snackbar-base.js';
|
|
2
|
-
export declare class
|
|
3
|
+
export declare class ExmSnackbar extends SnackbarBase {
|
|
3
4
|
/**
|
|
4
5
|
* Sets the Snackbar variant, options from MWC
|
|
5
6
|
* @type {String}
|
|
@@ -7,11 +8,11 @@ export declare class ExmgSnackbar extends SnackbarBase {
|
|
|
7
8
|
variant: 'positive' | 'negative' | 'info' | null;
|
|
8
9
|
xOffset: number;
|
|
9
10
|
yOffset: number;
|
|
10
|
-
static styles:
|
|
11
|
+
static styles: CSSResult[];
|
|
11
12
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
12
13
|
}
|
|
13
14
|
declare global {
|
|
14
15
|
interface HTMLElementTagNameMap {
|
|
15
|
-
'exm-snackbar':
|
|
16
|
+
'exm-snackbar': ExmSnackbar;
|
|
16
17
|
}
|
|
17
18
|
}
|
package/src/exm-snackbar.js
CHANGED
|
@@ -4,9 +4,9 @@ import { customElement, property } from 'lit/decorators.js';
|
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
5
5
|
import { SnackbarBase } from '@material/mwc-snackbar/mwc-snackbar-base.js';
|
|
6
6
|
import { accessibleSnackbarLabel } from '@material/mwc-snackbar/accessible-snackbar-label-directive.js';
|
|
7
|
-
import { style as newStyles } from './styles/exm-snackbar-
|
|
7
|
+
import { style as newStyles } from './styles/exm-snackbar-css.js';
|
|
8
8
|
import { styles } from '@material/mwc-snackbar/mwc-snackbar.css.js';
|
|
9
|
-
let
|
|
9
|
+
let ExmSnackbar = class ExmSnackbar extends SnackbarBase {
|
|
10
10
|
constructor() {
|
|
11
11
|
super(...arguments);
|
|
12
12
|
/**
|
|
@@ -41,18 +41,19 @@ let ExmgSnackbar = class ExmgSnackbar extends SnackbarBase {
|
|
|
41
41
|
</div>`;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
ExmSnackbar.styles = [styles, newStyles];
|
|
45
45
|
__decorate([
|
|
46
46
|
property({ type: String })
|
|
47
|
-
],
|
|
47
|
+
], ExmSnackbar.prototype, "variant", void 0);
|
|
48
48
|
__decorate([
|
|
49
49
|
property({ type: Number })
|
|
50
|
-
],
|
|
50
|
+
], ExmSnackbar.prototype, "xOffset", void 0);
|
|
51
51
|
__decorate([
|
|
52
52
|
property({ type: Number })
|
|
53
|
-
],
|
|
54
|
-
|
|
53
|
+
], ExmSnackbar.prototype, "yOffset", void 0);
|
|
54
|
+
ExmSnackbar = __decorate([
|
|
55
55
|
customElement('exm-snackbar')
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
// @ts-ignore this due to a version conflict between the currently used lit and the version used bu mcw
|
|
57
|
+
], ExmSnackbar);
|
|
58
|
+
export { ExmSnackbar };
|
|
58
59
|
//# sourceMappingURL=exm-snackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const style: import("lit").CSSResult;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
--exm-snackbar-positive-background-color: #12805c;
|
|
5
|
+
--exm-snackbar-negative-background-color: #c9252d;
|
|
6
|
+
--exm-snackbar-info-background-color: #0d66d0;
|
|
7
|
+
--exm-snackbar-text-color: #fff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mdc-snackbar--positive .mdc-snackbar__surface {
|
|
11
|
+
background-color: var(--exm-snackbar-positive-background-color) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mdc-snackbar--negative .mdc-snackbar__surface {
|
|
15
|
+
background-color: var(--exm-snackbar-negative-background-color) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.mdc-snackbar--info .mdc-snackbar__surface {
|
|
19
|
+
background-color: var(--exm-snackbar-info-background-color) !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mdc-snackbar__surface {
|
|
23
|
+
color: var(--exm-snackbar-text-color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
slot[name='icon']::slotted(*) {
|
|
27
|
+
margin-left: 12px;
|
|
28
|
+
min-width: 24px;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
//# sourceMappingURL=exm-snackbar-css.js.map
|
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const style = css
|
|
3
|
-
|
|
2
|
+
export const style = css `
|
|
3
|
+
:host {
|
|
4
|
+
--exm-snackbar-positive-background-color: #12805c;
|
|
5
|
+
--exm-snackbar-negative-background-color: #c9252d;
|
|
6
|
+
--exm-snackbar-info-background-color: #0d66d0;
|
|
7
|
+
--exm-snackbar-text-color: #fff;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.mdc-snackbar--positive .mdc-snackbar__surface {
|
|
11
|
+
background-color: var(--exm-snackbar-positive-background-color) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.mdc-snackbar--negative .mdc-snackbar__surface {
|
|
15
|
+
background-color: var(--exm-snackbar-negative-background-color) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.mdc-snackbar--info .mdc-snackbar__surface {
|
|
19
|
+
background-color: var(--exm-snackbar-info-background-color) !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mdc-snackbar__surface {
|
|
23
|
+
color: var(--exm-snackbar-text-color);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
slot[name='icon']::slotted(*) {
|
|
27
|
+
margin-left: 12px;
|
|
28
|
+
min-width: 24px;
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
4
31
|
//# sourceMappingURL=exm-snackbar-styles-css.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
--exm-snackbar-positive-background-color: #12805c;
|
|
3
|
-
--exm-snackbar-negative-background-color: #c9252d;
|
|
4
|
-
--exm-snackbar-info-background-color: #0d66d0;
|
|
5
|
-
--exm-snackbar-text-color: #fff;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.mdc-snackbar--positive {
|
|
9
|
-
.mdc-snackbar__surface {
|
|
10
|
-
background-color: var(--exm-snackbar-positive-background-color) !important;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
.mdc-snackbar--negative {
|
|
14
|
-
.mdc-snackbar__surface {
|
|
15
|
-
background-color: var(--exm-snackbar-negative-background-color) !important;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
.mdc-snackbar--info {
|
|
19
|
-
.mdc-snackbar__surface {
|
|
20
|
-
background-color: var(--exm-snackbar-info-background-color) !important;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.mdc-snackbar__surface {
|
|
25
|
-
color: var(--exm-snackbar-text-color);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
slot[name='icon']::slotted(*) {
|
|
29
|
-
margin-left: 12px;
|
|
30
|
-
min-width: 24px;
|
|
31
|
-
}
|