@operato/contact 2.0.0-alpha.8 → 2.0.0-alpha.80

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@operato/contact",
3
3
  "description": "Webcomponent ox-contact following open-wc recommendations",
4
4
  "author": "heartyoh",
5
- "version": "2.0.0-alpha.8",
5
+ "version": "2.0.0-alpha.80",
6
6
  "main": "dist/src/index.js",
7
7
  "module": "dist/src/index.js",
8
8
  "license": "MIT",
@@ -55,28 +55,27 @@
55
55
  "storybook:build": "tsc && npm run analyze -- --exclude dist && build-storybook"
56
56
  },
57
57
  "dependencies": {
58
- "@material/mwc-icon": "^0.27.0",
59
- "@material/mwc-icon-button": "^0.27.0",
60
- "@operato/styles": "^2.0.0-alpha.0",
61
- "@operato/utils": "^2.0.0-alpha.8",
62
- "lit": "^2.5.0"
58
+ "@material/web": "^1.4.0",
59
+ "@operato/styles": "^2.0.0-alpha.80",
60
+ "@operato/utils": "^2.0.0-alpha.68",
61
+ "lit": "^3.1.2"
63
62
  },
64
63
  "devDependencies": {
65
- "@custom-elements-manifest/analyzer": "^0.8.1",
64
+ "@custom-elements-manifest/analyzer": "^0.9.2",
66
65
  "@hatiolab/prettier-config": "^1.0.0",
67
- "@open-wc/eslint-config": "^10.0.0",
66
+ "@open-wc/eslint-config": "^12.0.3",
68
67
  "@open-wc/testing": "^3.1.6",
69
- "@typescript-eslint/eslint-plugin": "^5.59.1",
70
- "@typescript-eslint/parser": "^5.59.1",
68
+ "@typescript-eslint/eslint-plugin": "^7.0.1",
69
+ "@typescript-eslint/parser": "^7.0.1",
71
70
  "@web/dev-server": "^0.3.0",
72
- "@web/dev-server-storybook": "^0.7.4",
73
- "@web/test-runner": "^0.17.0",
71
+ "@web/dev-server-storybook": "^2.0.1",
72
+ "@web/test-runner": "^0.18.0",
74
73
  "concurrently": "^8.0.1",
75
74
  "eslint": "^8.39.0",
76
- "eslint-config-prettier": "^8.3.0",
77
- "husky": "^8.0.1",
78
- "lint-staged": "^13.2.2",
79
- "prettier": "^2.4.1",
75
+ "eslint-config-prettier": "^9.1.0",
76
+ "husky": "^9.0.11",
77
+ "lint-staged": "^15.2.2",
78
+ "prettier": "^3.2.5",
80
79
  "tslib": "^2.3.1",
81
80
  "typescript": "^5.0.4"
82
81
  },
@@ -93,5 +92,5 @@
93
92
  "prettier --write"
94
93
  ]
95
94
  },
96
- "gitHead": "9b76564615d73b9da50d13d30d43cdaa0d4a6fa6"
95
+ "gitHead": "9405ad5252a157db9c9680256a6cb65f764a890b"
97
96
  }
@@ -1,4 +1,4 @@
1
- import '@material/mwc-icon-button'
1
+ import '@material/web/icon/icon.js'
2
2
  import './ox-pfp.js'
3
3
 
4
4
  import { html, css, LitElement, PropertyValues } from 'lit'
@@ -16,8 +16,7 @@ export class OxContactEdit extends LitElement {
16
16
  display: block;
17
17
  padding: 25px;
18
18
 
19
- --mdc-icon-button-size: 16px;
20
- --mdc-icon-size: 16px;
19
+ --md-icon-size: 16px;
21
20
  }
22
21
 
23
22
  :host > div {
@@ -33,6 +32,7 @@ export class OxContactEdit extends LitElement {
33
32
  display: flex;
34
33
  flex-direction: row;
35
34
  gap: 10px;
35
+ align-items: center;
36
36
  }
37
37
 
38
38
  :host > div > div:hover {
@@ -139,14 +139,14 @@ export class OxContactEdit extends LitElement {
139
139
  item =>
140
140
  html`<div @change=${(e: Event) => this.onChangeItem(e, item)} .item=${item} item-field>
141
141
  ${item.value
142
- ? html`<mwc-icon-button
143
- icon="cancel"
142
+ ? html`<md-icon
144
143
  @click=${() => {
145
144
  item.value = ''
146
145
  this.buildStageContact()
147
146
  }}
148
- ></mwc-icon-button>`
149
- : html`<mwc-icon-button></mwc-icon-button>`}
147
+ >cancel</md-icon
148
+ >`
149
+ : html`<md-icon></md-icon>`}
150
150
  <select .value=${item.label} data-item="label">
151
151
  ${['home', 'work', 'other', 'mobile'].map(
152
152
  option => html` <option value=${option} ?selected=${option === item.label}>${option}</option>`
@@ -9,7 +9,7 @@ export class OxContactView extends LitElement {
9
9
  static styles = css`
10
10
  :host {
11
11
  display: block;
12
- --mdc-icon-size: 16px;
12
+ --md-icon-size: 16px;
13
13
  }
14
14
 
15
15
  :host > div {
@@ -78,28 +78,28 @@ export class OxContactView extends LitElement {
78
78
  display: flex;
79
79
  flex-direction: column;
80
80
  }
81
- div[data-type='email'] mwc-icon::before {
81
+ div[data-type='email'] md-icon::before {
82
82
  content: 'mail_outline';
83
83
  }
84
- div[data-type='phone'] mwc-icon::before {
84
+ div[data-type='phone'] md-icon::before {
85
85
  content: 'phone';
86
86
  }
87
- div[data-type='address'] mwc-icon::before {
87
+ div[data-type='address'] md-icon::before {
88
88
  content: 'place';
89
89
  }
90
- div[data-type='company'] mwc-icon::before {
90
+ div[data-type='company'] md-icon::before {
91
91
  content: 'business';
92
92
  }
93
- div[data-type='etc'] mwc-icon::before {
93
+ div[data-type='etc'] md-icon::before {
94
94
  content: 'feed';
95
95
  }
96
- div[note] mwc-icon::before {
96
+ div[note] md-icon::before {
97
97
  content: 'subject';
98
98
  }
99
99
  :host > div > [name-content] {
100
100
  gap: 3px;
101
101
  }
102
- div mwc-icon {
102
+ div md-icon {
103
103
  position: relative;
104
104
  top: 3px;
105
105
  margin-right: 3px;
@@ -149,20 +149,21 @@ export class OxContactView extends LitElement {
149
149
  .map(type => sorted[type])
150
150
  .filter(items => items && items.length > 0)
151
151
  .map(
152
- items => html`<div data-type=${items[0].type}>
153
- <mwc-icon></mwc-icon>
154
- ${items[0].type}
155
- ${items.map(
156
- item =>
157
- html`<div>
158
- <label data-item="label"> ${item.label}</label>
159
- <span data-item="value">${item.value}</span>
160
- </div>`
161
- )}
162
- </div>`
152
+ items =>
153
+ html`<div data-type=${items[0].type}>
154
+ <md-icon></md-icon>
155
+ ${items[0].type}
156
+ ${items.map(
157
+ item =>
158
+ html`<div>
159
+ <label data-item="label"> ${item.label}</label>
160
+ <span data-item="value">${item.value}</span>
161
+ </div>`
162
+ )}
163
+ </div>`
163
164
  )}
164
165
  <div note>
165
- <mwc-icon></mwc-icon>
166
+ <md-icon></md-icon>
166
167
  note
167
168
  <div>${note || ''}</div>
168
169
  </div>
@@ -118,11 +118,11 @@ export class OxPfpEdit extends LitElement {
118
118
  align-content: center;
119
119
  }
120
120
 
121
- mwc-icon {
121
+ md-icon {
122
122
  align-self: center;
123
123
 
124
124
  color: var(--file-uploader-icon-color, black);
125
- --mdc-icon-size: var(--file-uploader-icon-size, 20px);
125
+ --md-icon-size: var(--file-uploader-icon-size, 20px);
126
126
  }
127
127
  `
128
128
 
@@ -193,7 +193,7 @@ export class OxPfpEdit extends LitElement {
193
193
  capture="environment"
194
194
  @change=${(e: Event) => this.onChangeFile(e)}
195
195
  />
196
- <mwc-icon title="select image">image_search</mwc-icon>
196
+ <md-icon title="select image">image_search</md-icon>
197
197
  </label>
198
198
  </div>
199
199
 
package/src/ox-pfp.ts CHANGED
@@ -1,8 +1,8 @@
1
+ import '@material/web/icon/icon.js'
2
+
1
3
  import './ox-pfp-edit.js'
2
4
  import './ox-pfp-view.js'
3
5
 
4
- import '@material/mwc-icon-button'
5
-
6
6
  import { html, css, LitElement } from 'lit'
7
7
  import { customElement, property, query, state } from 'lit/decorators.js'
8
8
  import { Profile } from './ox-pfp-view.js'
@@ -14,9 +14,6 @@ export class OxPfp extends LitElement {
14
14
  :host {
15
15
  display: block;
16
16
  aspect-ratio: 1 / 1;
17
-
18
- --mdc-icon-button-size: 20px;
19
- --mdc-icon-size: 20px;
20
17
  }
21
18
 
22
19
  ox-pfp-edit,
@@ -33,32 +30,31 @@ export class OxPfp extends LitElement {
33
30
  display: flex;
34
31
  }
35
32
 
36
- mwc-icon-button {
33
+ md-icon {
37
34
  position: absolute;
38
- font-size: smaller;
39
35
  }
40
36
 
41
- mwc-icon-button[icon='fit_screen'] {
37
+ md-icon[icon='fit_screen'] {
42
38
  bottom: 0;
43
39
  left: 0;
44
40
  }
45
41
 
46
- mwc-icon-button[icon='save'] {
42
+ md-icon[icon='save'] {
47
43
  bottom: 0;
48
44
  right: 0;
49
45
  }
50
46
 
51
- mwc-icon-button[icon='edit'] {
47
+ md-icon[icon='edit'] {
52
48
  bottom: 0;
53
49
  right: 0;
54
50
  }
55
51
 
56
- mwc-icon-button[icon='cancel'] {
52
+ md-icon[icon='cancel'] {
57
53
  top: 0;
58
54
  right: 0;
59
55
  }
60
56
 
61
- mwc-icon-button[icon='clear'] {
57
+ md-icon[icon='clear'] {
62
58
  top: 0;
63
59
  right: 16px;
64
60
  }
@@ -74,9 +70,9 @@ export class OxPfp extends LitElement {
74
70
  render() {
75
71
  return this.editMode
76
72
  ? html`<ox-pfp-edit .profile=${this.profile} name=${this.name || ''}>
77
- <mwc-icon-button title="fit size" icon="fit_screen" @click=${() => this.edit.fit()}></mwc-icon-button>
78
- <mwc-icon-button title="clear" icon="clear" @click=${() => this.edit.clear()}></mwc-icon-button>
79
- <mwc-icon-button
73
+ <md-icon title="fit size" icon="fit_screen" @click=${() => this.edit.fit()}>fit_screen</md-icon>
74
+ <md-icon title="clear" icon="clear" @click=${() => this.edit.clear()}>clear</md-icon>
75
+ <md-icon
80
76
  title="save"
81
77
  icon="save"
82
78
  @click=${() => {
@@ -88,12 +84,13 @@ export class OxPfp extends LitElement {
88
84
  })
89
85
  )
90
86
  }}
91
- ></mwc-icon-button>
92
- <mwc-icon-button title="cancel" icon="cancel" @click=${() => (this.editMode = false)}></mwc-icon-button>
87
+ >save</md-icon
88
+ >
89
+ <md-icon title="cancel" icon="cancel" @click=${() => (this.editMode = false)}>cancel</md-icon>
93
90
  </ox-pfp-edit> `
94
91
  : html`
95
92
  <ox-pfp-view .profile=${this.profile} name=${this.name || ''}>
96
- <mwc-icon-button title="edit" icon="edit" @click=${() => (this.editMode = true)}></mwc-icon-button>
93
+ <md-icon title="edit" icon="edit" @click=${() => (this.editMode = true)}>edit</md-icon>
97
94
  </ox-pfp-view>
98
95
  `
99
96
  }
@@ -1,6 +1,5 @@
1
1
  import { html, TemplateResult } from 'lit'
2
- import '@material/mwc-icon'
3
- import '@material/mwc-icon-button'
2
+ import '@material/web/icon/icon.js'
4
3
  import '../src/ox-contact.js'
5
4
 
6
5
  import { Contact, ContactField } from '../src/ox-contact.js'
@@ -25,7 +24,19 @@ interface ArgTypes {
25
24
 
26
25
  const Template: Story<ArgTypes> = ({ contact }: ArgTypes) => html`
27
26
  <link href="/themes/app-theme.css" rel="stylesheet" />
28
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
27
+ <link
28
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
29
+ rel="stylesheet"
30
+ />
31
+ <link
32
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
33
+ rel="stylesheet"
34
+ />
35
+ <link
36
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
37
+ rel="stylesheet"
38
+ />
39
+
29
40
  <style>
30
41
  body {
31
42
  }
@@ -1,6 +1,5 @@
1
1
  import { html, TemplateResult } from 'lit'
2
- import '@material/mwc-icon'
3
- import '@material/mwc-icon-button'
2
+ import '@material/web/icon/icon.js'
4
3
  import '../src/ox-pfp.js'
5
4
 
6
5
  import { Profile } from '../src/ox-pfp-view.js'
@@ -27,7 +26,20 @@ interface ArgTypes {
27
26
 
28
27
  const Template: Story<ArgTypes> = ({ profile, name }: ArgTypes) => html`
29
28
  <link href="/themes/app-theme.css" rel="stylesheet" />
30
- <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
29
+
30
+ <link
31
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL@20..48,100..700,0..1"
32
+ rel="stylesheet"
33
+ />
34
+ <link
35
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL@20..48,100..700,0..1"
36
+ rel="stylesheet"
37
+ />
38
+ <link
39
+ href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL@20..48,100..700,0..1"
40
+ rel="stylesheet"
41
+ />
42
+
31
43
  <style>
32
44
  body {
33
45
  }