@things-factory/auth-ui 7.0.0-alpha.9 → 7.0.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 (202) hide show
  1. package/client/auth-style-sign.ts +45 -33
  2. package/client/bootstrap.ts +6 -10
  3. package/client/components/abstract-auth-page.ts +48 -24
  4. package/client/components/abstract-password-reset.ts +13 -9
  5. package/client/components/abstract-sign.ts +105 -0
  6. package/client/components/change-password.ts +4 -4
  7. package/client/components/contact-us.ts +20 -26
  8. package/client/components/create-domain-popup.ts +16 -12
  9. package/client/components/create-role.ts +14 -16
  10. package/client/components/create-user.ts +15 -14
  11. package/client/components/credential-manager.ts +64 -0
  12. package/client/components/delete-user-popup.ts +4 -3
  13. package/client/components/domain-switch.ts +18 -15
  14. package/client/components/invite-customer.ts +6 -10
  15. package/client/components/invite-user.ts +5 -8
  16. package/client/components/my-login-history.ts +2 -2
  17. package/client/components/ownership-transfer-popup.ts +7 -7
  18. package/client/components/partner-info-card.ts +6 -6
  19. package/client/components/partner-role-editor.ts +15 -23
  20. package/client/components/profile-component.ts +71 -15
  21. package/client/components/role-edit-form.ts +3 -3
  22. package/client/components/role-privilege-editor.ts +19 -29
  23. package/client/components/role-selector.ts +7 -7
  24. package/client/components/user-role-editor.ts +43 -50
  25. package/client/entries/auth/activate.ts +20 -21
  26. package/client/entries/auth/checkin.ts +29 -31
  27. package/client/entries/auth/forgot-password.ts +15 -9
  28. package/client/entries/auth/result.ts +21 -18
  29. package/client/entries/auth/signin.ts +4 -0
  30. package/client/entries/auth/signup.ts +31 -14
  31. package/client/entries/oauth2/oauth2-decision-error-page.ts +2 -2
  32. package/client/entries/oauth2/oauth2-decision-page.ts +56 -55
  33. package/client/entries/public/home.ts +52 -28
  34. package/client/index.ts +93 -66
  35. package/client/pages/app-binding/app-binding.ts +48 -30
  36. package/client/pages/app-binding/app-bindings.ts +26 -7
  37. package/client/pages/appliance/appliance.ts +85 -26
  38. package/client/pages/appliance/home.ts +28 -6
  39. package/client/pages/appliance/register.ts +7 -7
  40. package/client/pages/application/application.ts +108 -76
  41. package/client/pages/application/applications.ts +29 -15
  42. package/client/pages/application/register.ts +8 -8
  43. package/client/pages/attribute/attribute-set-item-list.ts +13 -19
  44. package/client/pages/attribute/attribute-set-management.ts +14 -20
  45. package/client/pages/auth-provider/auth-provider-management.ts +10 -16
  46. package/client/pages/domain/domain-management.ts +4 -9
  47. package/client/pages/partner/partner-management.ts +2 -2
  48. package/client/pages/profile.ts +1 -1
  49. package/client/pages/role/role-management.ts +14 -12
  50. package/client/pages/user/user-management.ts +7 -5
  51. package/client/themes/auth-theme.css +7 -10
  52. package/dist-client/auth-style-sign.js +45 -33
  53. package/dist-client/auth-style-sign.js.map +1 -1
  54. package/dist-client/bootstrap.d.ts +1 -1
  55. package/dist-client/bootstrap.js +5 -5
  56. package/dist-client/bootstrap.js.map +1 -1
  57. package/dist-client/components/abstract-auth-page.d.ts +5 -4
  58. package/dist-client/components/abstract-auth-page.js +46 -24
  59. package/dist-client/components/abstract-auth-page.js.map +1 -1
  60. package/dist-client/components/abstract-password-reset.d.ts +3 -2
  61. package/dist-client/components/abstract-password-reset.js +12 -9
  62. package/dist-client/components/abstract-password-reset.js.map +1 -1
  63. package/dist-client/components/abstract-sign.d.ts +3 -0
  64. package/dist-client/components/abstract-sign.js +86 -0
  65. package/dist-client/components/abstract-sign.js.map +1 -1
  66. package/dist-client/components/change-password.js +4 -4
  67. package/dist-client/components/change-password.js.map +1 -1
  68. package/dist-client/components/contact-us.d.ts +4 -4
  69. package/dist-client/components/contact-us.js +19 -26
  70. package/dist-client/components/contact-us.js.map +1 -1
  71. package/dist-client/components/create-domain-popup.d.ts +1 -1
  72. package/dist-client/components/create-domain-popup.js +16 -12
  73. package/dist-client/components/create-domain-popup.js.map +1 -1
  74. package/dist-client/components/create-role.d.ts +1 -1
  75. package/dist-client/components/create-role.js +14 -16
  76. package/dist-client/components/create-role.js.map +1 -1
  77. package/dist-client/components/create-user.d.ts +2 -1
  78. package/dist-client/components/create-user.js +14 -14
  79. package/dist-client/components/create-user.js.map +1 -1
  80. package/dist-client/components/credential-manager.d.ts +11 -0
  81. package/dist-client/components/credential-manager.js +64 -0
  82. package/dist-client/components/credential-manager.js.map +1 -0
  83. package/dist-client/components/delete-user-popup.js +4 -3
  84. package/dist-client/components/delete-user-popup.js.map +1 -1
  85. package/dist-client/components/domain-switch.d.ts +2 -0
  86. package/dist-client/components/domain-switch.js +20 -15
  87. package/dist-client/components/domain-switch.js.map +1 -1
  88. package/dist-client/components/invite-customer.d.ts +1 -1
  89. package/dist-client/components/invite-customer.js +6 -9
  90. package/dist-client/components/invite-customer.js.map +1 -1
  91. package/dist-client/components/invite-user.js +5 -8
  92. package/dist-client/components/invite-user.js.map +1 -1
  93. package/dist-client/components/my-login-history.js +2 -2
  94. package/dist-client/components/my-login-history.js.map +1 -1
  95. package/dist-client/components/ownership-transfer-popup.d.ts +1 -1
  96. package/dist-client/components/ownership-transfer-popup.js +7 -7
  97. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  98. package/dist-client/components/partner-info-card.js +6 -6
  99. package/dist-client/components/partner-info-card.js.map +1 -1
  100. package/dist-client/components/partner-role-editor.d.ts +2 -2
  101. package/dist-client/components/partner-role-editor.js +15 -23
  102. package/dist-client/components/partner-role-editor.js.map +1 -1
  103. package/dist-client/components/profile-component.d.ts +7 -0
  104. package/dist-client/components/profile-component.js +70 -15
  105. package/dist-client/components/profile-component.js.map +1 -1
  106. package/dist-client/components/role-edit-form.js +3 -3
  107. package/dist-client/components/role-edit-form.js.map +1 -1
  108. package/dist-client/components/role-privilege-editor.js +19 -29
  109. package/dist-client/components/role-privilege-editor.js.map +1 -1
  110. package/dist-client/components/role-selector.js +7 -7
  111. package/dist-client/components/role-selector.js.map +1 -1
  112. package/dist-client/components/user-role-editor.d.ts +2 -0
  113. package/dist-client/components/user-role-editor.js +42 -49
  114. package/dist-client/components/user-role-editor.js.map +1 -1
  115. package/dist-client/entries/auth/activate.d.ts +5 -4
  116. package/dist-client/entries/auth/activate.js +19 -21
  117. package/dist-client/entries/auth/activate.js.map +1 -1
  118. package/dist-client/entries/auth/checkin.d.ts +5 -5
  119. package/dist-client/entries/auth/checkin.js +27 -28
  120. package/dist-client/entries/auth/checkin.js.map +1 -1
  121. package/dist-client/entries/auth/forgot-password.d.ts +2 -1
  122. package/dist-client/entries/auth/forgot-password.js +15 -9
  123. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  124. package/dist-client/entries/auth/reset-password.js.map +1 -1
  125. package/dist-client/entries/auth/result.d.ts +5 -5
  126. package/dist-client/entries/auth/result.js +20 -18
  127. package/dist-client/entries/auth/result.js.map +1 -1
  128. package/dist-client/entries/auth/signin.d.ts +1 -0
  129. package/dist-client/entries/auth/signin.js +3 -0
  130. package/dist-client/entries/auth/signin.js.map +1 -1
  131. package/dist-client/entries/auth/signup.js +31 -14
  132. package/dist-client/entries/auth/signup.js.map +1 -1
  133. package/dist-client/entries/auth/unlock-user.js.map +1 -1
  134. package/dist-client/entries/oauth2/oauth2-decision-error-page.d.ts +1 -1
  135. package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -2
  136. package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
  137. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  138. package/dist-client/entries/oauth2/oauth2-decision-page.js +55 -54
  139. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  140. package/dist-client/entries/public/home.d.ts +6 -5
  141. package/dist-client/entries/public/home.js +52 -28
  142. package/dist-client/entries/public/home.js.map +1 -1
  143. package/dist-client/index.d.ts +11 -2
  144. package/dist-client/index.js +74 -66
  145. package/dist-client/index.js.map +1 -1
  146. package/dist-client/pages/app-binding/app-binding.d.ts +1 -1
  147. package/dist-client/pages/app-binding/app-binding.js +47 -30
  148. package/dist-client/pages/app-binding/app-binding.js.map +1 -1
  149. package/dist-client/pages/app-binding/app-bindings.d.ts +2 -1
  150. package/dist-client/pages/app-binding/app-bindings.js +25 -7
  151. package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
  152. package/dist-client/pages/appliance/appliance.d.ts +1 -1
  153. package/dist-client/pages/appliance/appliance.js +84 -26
  154. package/dist-client/pages/appliance/appliance.js.map +1 -1
  155. package/dist-client/pages/appliance/home.d.ts +2 -1
  156. package/dist-client/pages/appliance/home.js +27 -6
  157. package/dist-client/pages/appliance/home.js.map +1 -1
  158. package/dist-client/pages/appliance/register.js +7 -7
  159. package/dist-client/pages/appliance/register.js.map +1 -1
  160. package/dist-client/pages/application/application.d.ts +1 -1
  161. package/dist-client/pages/application/application.js +107 -76
  162. package/dist-client/pages/application/application.js.map +1 -1
  163. package/dist-client/pages/application/applications.d.ts +2 -1
  164. package/dist-client/pages/application/applications.js +28 -15
  165. package/dist-client/pages/application/applications.js.map +1 -1
  166. package/dist-client/pages/application/register.js +8 -8
  167. package/dist-client/pages/application/register.js.map +1 -1
  168. package/dist-client/pages/attribute/attribute-set-item-list.d.ts +1 -1
  169. package/dist-client/pages/attribute/attribute-set-item-list.js +11 -18
  170. package/dist-client/pages/attribute/attribute-set-item-list.js.map +1 -1
  171. package/dist-client/pages/attribute/attribute-set-management.d.ts +11 -2
  172. package/dist-client/pages/attribute/attribute-set-management.js +7 -11
  173. package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
  174. package/dist-client/pages/auth-provider/auth-provider-management.d.ts +11 -2
  175. package/dist-client/pages/auth-provider/auth-provider-management.js +8 -11
  176. package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
  177. package/dist-client/pages/domain/domain-management.d.ts +1 -0
  178. package/dist-client/pages/domain/domain-management.js +3 -7
  179. package/dist-client/pages/domain/domain-management.js.map +1 -1
  180. package/dist-client/pages/partner/partner-management.js +2 -2
  181. package/dist-client/pages/partner/partner-management.js.map +1 -1
  182. package/dist-client/pages/profile.js +1 -1
  183. package/dist-client/pages/profile.js.map +1 -1
  184. package/dist-client/pages/role/role-management.js +13 -10
  185. package/dist-client/pages/role/role-management.js.map +1 -1
  186. package/dist-client/pages/user/user-management.d.ts +1 -0
  187. package/dist-client/pages/user/user-management.js +6 -5
  188. package/dist-client/pages/user/user-management.js.map +1 -1
  189. package/dist-client/route.js.map +1 -1
  190. package/dist-client/themes/auth-theme.css +7 -10
  191. package/dist-client/tsconfig.tsbuildinfo +1 -1
  192. package/dist-client/utils/password-rule.js.map +1 -1
  193. package/dist-server/index.d.ts +0 -0
  194. package/dist-server/tsconfig.tsbuildinfo +1 -1
  195. package/package.json +14 -18
  196. package/translations/en.json +2 -0
  197. package/translations/ja.json +2 -0
  198. package/translations/ko.json +2 -1
  199. package/translations/ms.json +2 -0
  200. package/translations/zh.json +2 -0
  201. package/views/auth-page.html +5 -3
  202. package/views/oauth2-page.html +3 -2
@@ -1,4 +1,4 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/button/elevated-button.js'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html, LitElement } from 'lit'
@@ -7,49 +7,53 @@ import { customElement, query } from 'lit/decorators.js'
7
7
  import { client } from '@operato/graphql'
8
8
  import { i18next, localize } from '@operato/i18n'
9
9
  import { OxPrompt } from '@operato/popup/ox-prompt.js'
10
+ import { ButtonContainerStyles } from '@operato/styles'
10
11
 
11
12
  @customElement('create-domain-popup')
12
13
  class CreateDomainPopup extends localize(i18next)(LitElement) {
13
14
  static styles = [
15
+ ButtonContainerStyles,
14
16
  css`
15
17
  :host {
16
18
  display: flex;
17
19
  flex-direction: column;
18
- background-color: var(--main-section-background-color);
19
- padding: var(--padding-wide);
20
+ background-color: var(--md-sys-color-background);
21
+ padding: var(--spacing-large);
20
22
  overflow: auto;
21
23
  }
24
+
22
25
  input.checkValidName {
23
26
  background-color: #fce6e6;
24
27
  }
25
- mwc-button {
28
+
29
+ md-elevated-button {
26
30
  display: flex;
27
31
  justify-content: center;
28
32
  }
33
+
29
34
  label {
30
35
  display: flex;
31
36
  flex-direction: column;
32
37
 
33
38
  font: var(--label-font);
34
- color: var(--label-color);
39
+ color: var(--label-color, var(--md-sys-color-on-surface));
35
40
  text-transform: var(--label-text-transform);
36
41
  }
42
+
37
43
  input {
38
- border: var(--border-dark-color);
44
+ border: var(--border-dim-color);
39
45
  border-radius: var(--border-radius);
40
46
  margin: var(--input-margin);
41
47
  padding: var(--input-padding);
42
- background-color: var(--theme-white-color);
48
+ background-color: var(--md-sys-color-surface);
43
49
  font: var(--input-font);
44
50
 
45
51
  flex: 1;
46
52
  }
53
+
47
54
  [field] {
48
55
  grid-column: span 2;
49
56
  }
50
- [buttons] {
51
- margin-top: auto;
52
- }
53
57
  `
54
58
  ]
55
59
 
@@ -71,8 +75,8 @@ class CreateDomainPopup extends localize(i18next)(LitElement) {
71
75
  <label>${i18next.t('label.description')}<input type="text" name="description" /></label>
72
76
  </div>
73
77
 
74
- <div buttons>
75
- <mwc-button raised @click=${e => this.onCreateDomain()}>${i18next.t('button.create')}</mwc-button>
78
+ <div class="button-container">
79
+ <md-elevated-button @click=${e => this.onCreateDomain()}>${i18next.t('button.create')}</md-elevated-button>
76
80
  </div>
77
81
  `
78
82
  }
@@ -1,4 +1,4 @@
1
- import '@material/mwc-textfield'
1
+ import '@material/web/textfield/filled-text-field.js'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html, LitElement } from 'lit'
@@ -12,10 +12,10 @@ import { OxPrompt } from '@operato/popup/ox-prompt.js'
12
12
  class CreateRole extends localize(i18next)(LitElement) {
13
13
  static styles = css`
14
14
  :host {
15
- --mdc-text-field-fill-color: var(--theme-white-color);
16
- background-color: var(--theme-white-color);
17
- margin: var(--margin-wide) 0;
18
- padding: var(--padding-wide);
15
+ --md-text-field-fill-color: var(--md-sys-color-on-primary);
16
+ background-color: var(--md-sys-color-surface);
17
+ margin: var(--spacing-large) 0;
18
+ padding: var(--spacing-large);
19
19
  border-radius: var(--border-radius);
20
20
  box-shadow: var(--box-shadow);
21
21
 
@@ -28,7 +28,7 @@ class CreateRole extends localize(i18next)(LitElement) {
28
28
  align-items: center;
29
29
  }
30
30
 
31
- mwc-button {
31
+ md-outlined-button {
32
32
  margin: var(--input-margin);
33
33
  }
34
34
 
@@ -37,7 +37,7 @@ class CreateRole extends localize(i18next)(LitElement) {
37
37
  grid-template-columns: 1fr 1fr;
38
38
  }
39
39
 
40
- mwc-button {
40
+ md-outlined-button {
41
41
  grid-column: span 2;
42
42
 
43
43
  margin: var(--input-margin);
@@ -50,22 +50,20 @@ class CreateRole extends localize(i18next)(LitElement) {
50
50
 
51
51
  render() {
52
52
  return html`
53
- <mwc-textfield
53
+ <md-filled-text-field
54
54
  type="text"
55
55
  name="name"
56
56
  label=${String(i18next.t('label.x name', { x: i18next.t('label.role') }))}
57
- ></mwc-textfield>
58
- <mwc-textfield
57
+ ></md-filled-text-field>
58
+ <md-filled-text-field
59
59
  type="text"
60
60
  name="description"
61
61
  label=${String(i18next.t('label.x description', { x: i18next.t('label.role') }))}
62
- ></mwc-textfield>
62
+ ></md-filled-text-field>
63
63
 
64
- <mwc-button
65
- @click=${this.onCreateRole.bind(this)}
66
- outlined
67
- label=${String(i18next.t('button.create'))}
68
- ></mwc-button>
64
+ <md-outlined-button @click=${this.onCreateRole.bind(this)}
65
+ >${String(i18next.t('button.create'))}</md-outlined-button
66
+ >
69
67
  `
70
68
  }
71
69
 
@@ -1,3 +1,6 @@
1
+ import '@material/web/button/outlined-button.js'
2
+ import '@material/web/textfield/filled-text-field.js'
3
+
1
4
  import { css, html, LitElement } from 'lit'
2
5
  import { customElement, query } from 'lit/decorators.js'
3
6
 
@@ -7,10 +10,10 @@ import { i18next } from '@operato/i18n'
7
10
  class CreateUser extends LitElement {
8
11
  static styles = css`
9
12
  :host {
10
- --mdc-text-field-fill-color: var(--theme-white-color);
11
- background-color: var(--theme-white-color);
12
- margin: var(--margin-wide) 0;
13
- padding: var(--padding-wide);
13
+ --md-text-field-fill-color: var(--md-sys-color-on-primary);
14
+ background-color: var(--md-sys-color-surface);
15
+ margin: var(--spacing-large) 0;
16
+ padding: var(--spacing-large);
14
17
  border-radius: var(--border-radius);
15
18
  box-shadow: var(--box-shadow);
16
19
 
@@ -23,7 +26,7 @@ class CreateUser extends LitElement {
23
26
  align-items: center;
24
27
  }
25
28
 
26
- mwc-button {
29
+ md-outlined-button {
27
30
  margin: var(--input-margin);
28
31
  }
29
32
 
@@ -32,7 +35,7 @@ class CreateUser extends LitElement {
32
35
  grid-template-columns: 1fr 1fr;
33
36
  }
34
37
 
35
- mwc-button {
38
+ md-outlined-button {
36
39
  grid-column: span 2;
37
40
 
38
41
  margin: var(--input-margin);
@@ -45,19 +48,17 @@ class CreateUser extends LitElement {
45
48
 
46
49
  render() {
47
50
  return html`
48
- <mwc-textfield
51
+ <md-filled-text-field
49
52
  type="text"
50
53
  name="name"
51
54
  label=${String(i18next.t('label.x name', { x: i18next.t('label.user') }))}
52
- ></mwc-textfield>
55
+ ></md-filled-text-field>
53
56
 
54
- <mwc-textfield type="email" name="email" label=${String(i18next.t('field.email'))}></mwc-textfield>
57
+ <md-filled-text-field type="email" name="email" label=${String(i18next.t('field.email'))}></md-filled-text-field>
55
58
 
56
- <mwc-button
57
- @click=${this.onCreateUser.bind(this)}
58
- outlined
59
- label=${String(i18next.t('button.create'))}
60
- ></mwc-button>
59
+ <md-outlined-button @click=${this.onCreateUser.bind(this)}
60
+ >${String(i18next.t('button.create'))}</md-outlined-button
61
+ >
61
62
  `
62
63
  }
63
64
 
@@ -0,0 +1,64 @@
1
+ import gql from 'graphql-tag'
2
+ import { LitElement, html, css } from 'lit'
3
+ import { customElement, property } from 'lit/decorators.js'
4
+
5
+ import { client } from '@operato/graphql'
6
+
7
+ @customElement('credential-manager')
8
+ export class CredentialManager extends LitElement {
9
+ @property({ type: Array }) credentials: {
10
+ credentialId: string
11
+ }[] = []
12
+
13
+ static styles = css`
14
+ div {
15
+ margin: 20px;
16
+ }
17
+ button {
18
+ margin: 5px;
19
+ }
20
+ `
21
+
22
+ connectedCallback() {
23
+ super.connectedCallback()
24
+ this.fetchCredentials()
25
+ }
26
+
27
+ async fetchCredentials() {
28
+ const response = await fetch('/auth/credentials', {
29
+ method: 'GET',
30
+ credentials: 'include'
31
+ })
32
+ this.credentials = await response.json()
33
+ }
34
+
35
+ async deleteCredential(credentialId: string) {
36
+ const response = await fetch(`/credentials/${credentialId}`, {
37
+ method: 'DELETE',
38
+ credentials: 'include'
39
+ })
40
+ if (response.ok) {
41
+ this.fetchCredentials()
42
+ } else {
43
+ console.error('Failed to delete credential')
44
+ }
45
+ }
46
+
47
+ render() {
48
+ return html`
49
+ <div>
50
+ <h2>Manage Your WebAuthn Credentials</h2>
51
+ <ul>
52
+ ${this.credentials.map(
53
+ credential => html`
54
+ <li>
55
+ ${credential.credentialId}
56
+ <button @click=${() => this.deleteCredential(credential.credentialId)}>Delete</button>
57
+ </li>
58
+ `
59
+ )}
60
+ </ul>
61
+ </div>
62
+ `
63
+ }
64
+ }
@@ -5,7 +5,7 @@ import { customElement } from 'lit/decorators.js'
5
5
 
6
6
  import { i18next, localize } from '@operato/i18n'
7
7
  import { notify } from '@operato/layout'
8
- import { auth } from '@things-factory/auth-base/dist-client'
8
+ import { auth } from '@things-factory/auth-base/dist-client/auth.js'
9
9
 
10
10
  @customElement('delete-user-popup')
11
11
  export class DeleteUserPopup extends localize(i18next)(LitElement) {
@@ -14,6 +14,7 @@ export class DeleteUserPopup extends localize(i18next)(LitElement) {
14
14
  :host {
15
15
  display: flex;
16
16
  flex-direction: column;
17
+ color: var(--popup-content-color);
17
18
  background-color: var(--popup-content-background-color);
18
19
  padding: var(--popup-content-padding);
19
20
  }
@@ -27,7 +28,7 @@ export class DeleteUserPopup extends localize(i18next)(LitElement) {
27
28
 
28
29
  label {
29
30
  font: bold 14px var(--theme-font);
30
- color: var(--primary-color);
31
+ color: var(--md-sys-color-primary);
31
32
  }
32
33
 
33
34
  input {
@@ -52,7 +53,7 @@ export class DeleteUserPopup extends localize(i18next)(LitElement) {
52
53
  }
53
54
 
54
55
  button {
55
- background-color: var(--status-danger-color, red);
56
+ background-color: var(--status-danger-color, #d14946);
56
57
  margin: 2px 2px 10px 2px;
57
58
  height: var(--button-height, 28px);
58
59
  color: var(--button-color, #fff);
@@ -1,4 +1,6 @@
1
- import { css, html, LitElement } from 'lit'
1
+ import '@material/web/icon/icon.js'
2
+
3
+ import { css, html, LitElement, nothing } from 'lit'
2
4
  import { customElement, property } from 'lit/decorators.js'
3
5
  import { connect } from 'pwa-helpers/connect-mixin'
4
6
 
@@ -13,8 +15,8 @@ export class DomainSwitch extends connect(store)(LitElement) {
13
15
  :host {
14
16
  display: flex;
15
17
  max-width: 100%;
16
- background-color: rgba(var(--primary-color-rgb), 0.1);
17
- border-bottom: var(--border-dark-color);
18
+ background-color: var(--md-sys-color-primary-container, rgb(215 231 241));
19
+ border-bottom: var(--border-dim-color);
18
20
  }
19
21
 
20
22
  :host * {
@@ -25,21 +27,21 @@ export class DomainSwitch extends connect(store)(LitElement) {
25
27
  flex: 1;
26
28
  display: flex;
27
29
  flex-direction: row;
28
- padding: var(--padding-default);
30
+ padding: var(--spacing-small);
29
31
  }
30
32
 
31
- mwc-icon {
32
- background-color: rgba(var(--primary-color-rgb), 0.8);
33
- margin-right: var(--margin-narrow);
33
+ md-icon {
34
+ background-color: var(--md-sys-color-primary, rgb(46 121 190));
35
+ margin-right: var(--spacing-small);
34
36
  padding: 2px;
35
37
  border-radius: 50%;
36
38
  font-size: var(--fontsize-large);
37
- color: var(--theme-white-color);
39
+ color: var(--md-sys-color-on-primary, rgba(255,255,255,.9));
38
40
  }
39
41
  span,
40
42
  select {
41
43
  flex: 1;
42
- color: var(--secondary-color);
44
+ color: var(--md-sys-color-on-primary-container, rgb(50 66 82));
43
45
  font: bold 14px/20px var(--theme-font);
44
46
  }
45
47
 
@@ -56,7 +58,7 @@ export class DomainSwitch extends connect(store)(LitElement) {
56
58
  padding: 0 !important;
57
59
  border-bottom: none;
58
60
  }
59
- :host([dark]) mwc-icon {
61
+ :host([dark]) md-icon {
60
62
  background-color: var(--secondary-text-color);
61
63
  margin: 1px 4px 0px 0px;
62
64
  padding: 1px 2px;
@@ -65,12 +67,12 @@ export class DomainSwitch extends connect(store)(LitElement) {
65
67
  }
66
68
  :host([dark]) span,
67
69
  :host([dark]) select {
68
- color: var(--theme-white-color);
70
+ color: var(--md-sys-color-on-primary);
69
71
  font: bold 13px/13px var(--theme-font);
70
72
  }
71
73
  :host([dark]) option {
72
74
  background-color: var(--primary-color, #585858);
73
- color: var(--theme-white-color, #fff);
75
+ color: var(--md-sys-color-on-primary, #fff);
74
76
  }
75
77
  :host([dark]) span {
76
78
  line-height: 23px;
@@ -79,10 +81,10 @@ export class DomainSwitch extends connect(store)(LitElement) {
79
81
  :host([rounded-corner]) {
80
82
  height: 30px;
81
83
  border-radius: 20px;
82
- border: var(--border-dark-color);
84
+ border: var(--border-dim-color);
83
85
  }
84
86
  :host([rounded-corner]) div {
85
- padding: var(--padding-narrow) var(--padding-default);
87
+ padding: var(--spacing-small) var(--spacing-medium);
86
88
  }
87
89
  `
88
90
  ]
@@ -90,6 +92,7 @@ export class DomainSwitch extends connect(store)(LitElement) {
90
92
  @property({ type: Array }) domains: any[] = []
91
93
  @property({ type: Object }) domain: any
92
94
  @property({ type: String, attribute: true }) attrname: string = 'name'
95
+ @property({ type: String, attribute: true }) icon?: string
93
96
 
94
97
  render() {
95
98
  const domains = this.domains || []
@@ -98,7 +101,7 @@ export class DomainSwitch extends connect(store)(LitElement) {
98
101
 
99
102
  return html`
100
103
  <div>
101
- <mwc-icon>outlined_flag</mwc-icon>
104
+ ${this.icon ? html`<md-icon>${this.icon}</md-icon>` : nothing}
102
105
  ${domains.length <= 1
103
106
  ? html` <span>${domains[0]?.[attrname] || domain.name}</span> `
104
107
  : html`
@@ -1,5 +1,3 @@
1
- import '@things-factory/auth-ui'
2
-
3
1
  import gql from 'graphql-tag'
4
2
  import { css, html, LitElement } from 'lit'
5
3
  import { customElement, property, query } from 'lit/decorators.js'
@@ -13,14 +11,14 @@ class InviteCustomer extends localize(i18next)(LitElement) {
13
11
  static styles = [
14
12
  css`
15
13
  input {
16
- border: var(--border-dark-color);
14
+ border: var(--border-dim-color);
17
15
  border-radius: var(--border-radius);
18
16
  margin: var(--input-margin);
19
17
  padding: var(--input-padding);
20
18
  min-width: 250px;
21
19
  font: var(--input-font);
22
20
  }
23
- mwc-button {
21
+ md-outlined-button {
24
22
  margin: var(--input-margin);
25
23
  }
26
24
  @media screen and (max-width: 480px) {
@@ -39,12 +37,10 @@ class InviteCustomer extends localize(i18next)(LitElement) {
39
37
  return html`
40
38
  <div>
41
39
  <input id="customer-name" required />
42
- <mwc-button
43
- @click=${this.invite.bind(this)}
44
- outlined
45
- icon="group_add"
46
- label=${String(i18next.t('label.invite customer'))}
47
- ></mwc-button>
40
+ <md-outlined-button @click=${this.invite.bind(this)}>
41
+ <md-icon slot="icon">group_add</md-icon>
42
+ ${String(i18next.t('label.invite customer'))}
43
+ </md-outlined-button>
48
44
  </div>
49
45
  `
50
46
  }
@@ -18,7 +18,7 @@ class InviteUser extends localize(i18next)(LitElement) {
18
18
  input {
19
19
  flex: 1;
20
20
 
21
- border: var(--border-dark-color);
21
+ border: var(--border-dim-color);
22
22
  border-radius: var(--border-radius);
23
23
  margin: var(--input-margin);
24
24
  padding: var(--input-padding);
@@ -26,7 +26,7 @@ class InviteUser extends localize(i18next)(LitElement) {
26
26
  font: var(--input-font);
27
27
  }
28
28
 
29
- mwc-button {
29
+ md-outlined-button {
30
30
  margin: var(--input-margin);
31
31
  }
32
32
  `
@@ -36,12 +36,9 @@ class InviteUser extends localize(i18next)(LitElement) {
36
36
  render() {
37
37
  return html`
38
38
  <input name="email" type="email" required name="invite-email" autocapitalize="off" />
39
- <mwc-button
40
- @click=${this.invite.bind(this)}
41
- outlined
42
- icon="group_add"
43
- label=${String(i18next.t('label.invite user'))}
44
- ></mwc-button>
39
+ <md-outlined-button @click=${this.invite.bind(this)}>
40
+ <md-icon slot="icon">group_add</md-icon>${String(i18next.t('label.invite user'))}
41
+ </md-outlined-button>
45
42
  `
46
43
  }
47
44
 
@@ -14,8 +14,8 @@ class MyLoginHistory extends LitElement {
14
14
  :host {
15
15
  display: flex;
16
16
  flex-direction: column;
17
- background-color: var(--main-section-background-color);
18
- padding: var(--padding-wide);
17
+ background-color: var(--md-sys-color-background);
18
+ padding: var(--spacing-large);
19
19
  overflow: auto;
20
20
  }
21
21
  ox-grist {
@@ -1,4 +1,4 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/button/elevated-button.js'
2
2
 
3
3
  import gql from 'graphql-tag'
4
4
  import { css, html, LitElement } from 'lit'
@@ -15,8 +15,8 @@ class OwnershipTransferPopup extends localize(i18next)(LitElement) {
15
15
  :host {
16
16
  display: flex;
17
17
  flex-direction: column;
18
- background-color: var(--main-section-background-color);
19
- padding: var(--padding-wide);
18
+ background-color: var(--md-sys-color-background);
19
+ padding: var(--spacing-large);
20
20
  overflow: auto;
21
21
  }
22
22
  .container {
@@ -25,7 +25,7 @@ class OwnershipTransferPopup extends localize(i18next)(LitElement) {
25
25
  flex: 1;
26
26
  }
27
27
  input {
28
- border: var(--border-dark-color);
28
+ border: var(--border-dim-color);
29
29
  border-radius: var(--border-radius);
30
30
  margin: var(--input-margin);
31
31
  padding: var(--input-padding);
@@ -36,8 +36,8 @@ class OwnershipTransferPopup extends localize(i18next)(LitElement) {
36
36
  margin: auto;
37
37
  display: flex;
38
38
  }
39
- .input-container mwc-button {
40
- margin: auto 0px auto var(--padding-wide);
39
+ .input-container md-elevated-button {
40
+ margin: auto 0px auto var(--spacing-large);
41
41
  }
42
42
  `
43
43
  ]
@@ -52,7 +52,7 @@ class OwnershipTransferPopup extends localize(i18next)(LitElement) {
52
52
  <div>${i18next.t('text.please enter the email of the user you want to transfer owner')}</div>
53
53
  <div class="input-container">
54
54
  <input name="email" />
55
- <mwc-button raised @click=${this.transferOwnership}>${i18next.t('button.confirm')}</mwc-button>
55
+ <md-elevated-button @click=${this.transferOwnership}>${i18next.t('button.confirm')}</md-elevated-button>
56
56
  </div>
57
57
  </div>
58
58
  `
@@ -8,7 +8,7 @@ export class PartnerInfoCard extends LitElement {
8
8
  static styles = [
9
9
  css`
10
10
  input {
11
- border: var(--border-dark-color);
11
+ border: var(--border-dim-color);
12
12
  border-radius: var(--border-radius);
13
13
  margin: var(--input-margin);
14
14
  padding: var(--input-padding);
@@ -21,7 +21,7 @@ export class PartnerInfoCard extends LitElement {
21
21
  display: flex;
22
22
  max-height: 45vh;
23
23
  flex-direction: row;
24
- background-color: var(--theme-white-color);
24
+ background-color: var(--md-sys-color-surface-variant);
25
25
  margin: 0;
26
26
  padding: 0;
27
27
  border-radius: var(--border-radius);
@@ -31,8 +31,8 @@ export class PartnerInfoCard extends LitElement {
31
31
  [field-2column] {
32
32
  overflow: auto;
33
33
  flex: 1;
34
- background-color: var(--theme-white-color);
35
- padding: var(--padding-default);
34
+ background-color: var(--md-sys-color-surface-variant);
35
+ padding: var(--spacing-medium);
36
36
  border-radius: var(--border-radius);
37
37
  display: grid;
38
38
  grid-template-columns: 1fr 1fr;
@@ -43,14 +43,14 @@ export class PartnerInfoCard extends LitElement {
43
43
  [field] {
44
44
  display: flex;
45
45
  flex-direction: column;
46
- padding-bottom: var(--padding-default);
46
+ padding-bottom: var(--spacing-medium);
47
47
  }
48
48
  label {
49
49
  display: flex;
50
50
  flex-direction: column;
51
51
 
52
52
  font: var(--label-font);
53
- color: var(--label-color);
53
+ color: var(--label-color, var(--md-sys-color-on-surface));
54
54
  text-transform: var(--label-text-transform);
55
55
  }
56
56
  @media screen and (max-width: 480px) {
@@ -1,5 +1,5 @@
1
- import '@material/mwc-icon'
2
- import '@things-factory/auth-ui'
1
+ import '@material/web/button/elevated-button.js'
2
+ import './role-selector.js'
3
3
 
4
4
  import gql from 'graphql-tag'
5
5
  import { css, html, LitElement } from 'lit'
@@ -8,32 +8,27 @@ import { customElement, property, query } from 'lit/decorators.js'
8
8
  import { client, gqlContext } from '@operato/graphql'
9
9
  import { i18next, localize } from '@operato/i18n'
10
10
  import { OxPrompt } from '@operato/popup/ox-prompt.js'
11
+ import { ButtonContainerStyles } from '@operato/styles'
11
12
 
12
13
  import { RoleSelector } from './role-selector'
13
14
 
14
15
  @customElement('partner-role-editor')
15
16
  class PartnerRoleEditor extends localize(i18next)(LitElement) {
16
17
  static styles = [
18
+ ButtonContainerStyles,
17
19
  css`
18
20
  :host {
19
21
  display: flex;
20
22
  flex-direction: column;
21
23
 
22
- border: 1px solid var(--primary-color);
23
- padding: var(--padding-default);
24
+ border: 1px solid var(--md-sys-color-primary);
25
+ padding: var(--spacing-medium);
24
26
  font: normal 15px var(--theme-font);
25
- color: var(--secondary-color);
27
+ color: var(--md-sys-color-secondary);
26
28
  }
27
- [buttons] {
28
- margin: 0;
29
- padding: var(--padding-default);
30
- background-color: rgba(var(--primary-color-rgb), 0.2);
31
- }
32
- mwc-button {
33
- margin-right: var(--padding-narrow);
34
- }
35
- [danger] {
36
- --mdc-theme-primary: var(--mdc-danger-button-primary-color);
29
+
30
+ md-elevated-button {
31
+ margin-right: var(--spacing-small);
37
32
  }
38
33
  `
39
34
  ]
@@ -51,14 +46,11 @@ class PartnerRoleEditor extends localize(i18next)(LitElement) {
51
46
  return html`
52
47
  <role-selector .roles="${roles}" .userRoles="${grantingRoles}"></role-selector>
53
48
 
54
- <div buttons>
55
- <mwc-button @click=${this.onSave} raised label="${i18next.t('button.save')}"></mwc-button>
56
- <mwc-button
57
- @click=${this.onTerminateContract}
58
- raised
59
- danger
60
- label="${i18next.t('button.terminate contract')}"
61
- ></mwc-button>
49
+ <div class="button-container">
50
+ <md-elevated-button @click=${this.onSave}>${i18next.t('button.save')}</md-elevated-button>
51
+ <md-elevated-button @click=${this.onTerminateContract} danger
52
+ >${i18next.t('button.terminate contract')}</md-elevated-button
53
+ >
62
54
  </div>
63
55
  `
64
56
  }