@things-factory/auth-ui 7.0.1-alpha.9 → 7.0.1-alpha.90

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 (166) hide show
  1. package/client/auth-style-sign.ts +29 -18
  2. package/client/bootstrap.ts +6 -10
  3. package/client/components/abstract-auth-page.ts +41 -22
  4. package/client/components/abstract-password-reset.ts +11 -9
  5. package/client/components/abstract-sign.ts +138 -0
  6. package/client/components/change-password.ts +3 -3
  7. package/client/components/contact-us.ts +19 -23
  8. package/client/components/create-domain-popup.ts +11 -7
  9. package/client/components/create-role.ts +8 -20
  10. package/client/components/create-user.ts +8 -16
  11. package/client/components/credential-manager.ts +64 -0
  12. package/client/components/delete-user-popup.ts +1 -1
  13. package/client/components/domain-switch.ts +7 -4
  14. package/client/components/invite-customer.ts +7 -14
  15. package/client/components/invite-user.ts +2 -7
  16. package/client/components/ownership-transfer-popup.ts +3 -3
  17. package/client/components/partner-role-editor.ts +10 -16
  18. package/client/components/profile-component.ts +124 -7
  19. package/client/components/role-privilege-editor.ts +10 -17
  20. package/client/components/user-role-editor.ts +27 -38
  21. package/client/entries/auth/activate.ts +17 -17
  22. package/client/entries/auth/checkin.ts +15 -19
  23. package/client/entries/auth/forgot-password.ts +8 -6
  24. package/client/entries/auth/result.ts +13 -12
  25. package/client/entries/auth/signup.ts +20 -24
  26. package/client/entries/oauth2/oauth2-decision-error-page.ts +2 -2
  27. package/client/entries/oauth2/oauth2-decision-page.ts +60 -55
  28. package/client/entries/public/home.ts +40 -18
  29. package/client/index.ts +93 -66
  30. package/client/pages/app-binding/app-binding.ts +5 -9
  31. package/client/pages/app-binding/app-bindings.ts +2 -2
  32. package/client/pages/appliance/appliance.ts +6 -9
  33. package/client/pages/appliance/home.ts +3 -3
  34. package/client/pages/appliance/register.ts +1 -1
  35. package/client/pages/application/application.ts +29 -50
  36. package/client/pages/application/applications.ts +4 -12
  37. package/client/pages/application/register.ts +1 -1
  38. package/client/pages/attribute/attribute-set-item-list.ts +8 -22
  39. package/client/pages/attribute/attribute-set-management.ts +14 -20
  40. package/client/pages/auth-provider/auth-provider-management.ts +10 -16
  41. package/client/pages/domain/domain-management.ts +4 -9
  42. package/client/pages/user/user-management.ts +5 -5
  43. package/dist-client/auth-style-sign.js +29 -18
  44. package/dist-client/auth-style-sign.js.map +1 -1
  45. package/dist-client/bootstrap.d.ts +1 -1
  46. package/dist-client/bootstrap.js +5 -5
  47. package/dist-client/bootstrap.js.map +1 -1
  48. package/dist-client/components/abstract-auth-page.d.ts +4 -4
  49. package/dist-client/components/abstract-auth-page.js +40 -22
  50. package/dist-client/components/abstract-auth-page.js.map +1 -1
  51. package/dist-client/components/abstract-password-reset.d.ts +3 -2
  52. package/dist-client/components/abstract-password-reset.js +10 -9
  53. package/dist-client/components/abstract-password-reset.js.map +1 -1
  54. package/dist-client/components/abstract-sign.d.ts +3 -0
  55. package/dist-client/components/abstract-sign.js +110 -0
  56. package/dist-client/components/abstract-sign.js.map +1 -1
  57. package/dist-client/components/change-password.js +3 -3
  58. package/dist-client/components/change-password.js.map +1 -1
  59. package/dist-client/components/contact-us.d.ts +4 -4
  60. package/dist-client/components/contact-us.js +18 -23
  61. package/dist-client/components/contact-us.js.map +1 -1
  62. package/dist-client/components/create-domain-popup.d.ts +1 -1
  63. package/dist-client/components/create-domain-popup.js +11 -7
  64. package/dist-client/components/create-domain-popup.js.map +1 -1
  65. package/dist-client/components/create-role.d.ts +1 -1
  66. package/dist-client/components/create-role.js +7 -19
  67. package/dist-client/components/create-role.js.map +1 -1
  68. package/dist-client/components/create-user.js +6 -14
  69. package/dist-client/components/create-user.js.map +1 -1
  70. package/dist-client/components/credential-manager.d.ts +11 -0
  71. package/dist-client/components/credential-manager.js +64 -0
  72. package/dist-client/components/credential-manager.js.map +1 -0
  73. package/dist-client/components/delete-user-popup.js +1 -1
  74. package/dist-client/components/delete-user-popup.js.map +1 -1
  75. package/dist-client/components/domain-switch.d.ts +2 -0
  76. package/dist-client/components/domain-switch.js +9 -4
  77. package/dist-client/components/domain-switch.js.map +1 -1
  78. package/dist-client/components/invite-customer.d.ts +1 -1
  79. package/dist-client/components/invite-customer.js +5 -8
  80. package/dist-client/components/invite-customer.js.map +1 -1
  81. package/dist-client/components/invite-user.js +2 -7
  82. package/dist-client/components/invite-user.js.map +1 -1
  83. package/dist-client/components/ownership-transfer-popup.d.ts +1 -1
  84. package/dist-client/components/ownership-transfer-popup.js +3 -3
  85. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  86. package/dist-client/components/partner-role-editor.d.ts +1 -1
  87. package/dist-client/components/partner-role-editor.js +10 -16
  88. package/dist-client/components/partner-role-editor.js.map +1 -1
  89. package/dist-client/components/profile-component.d.ts +6 -0
  90. package/dist-client/components/profile-component.js +111 -7
  91. package/dist-client/components/profile-component.js.map +1 -1
  92. package/dist-client/components/role-privilege-editor.js +10 -17
  93. package/dist-client/components/role-privilege-editor.js.map +1 -1
  94. package/dist-client/components/user-role-editor.d.ts +2 -0
  95. package/dist-client/components/user-role-editor.js +26 -37
  96. package/dist-client/components/user-role-editor.js.map +1 -1
  97. package/dist-client/entries/auth/activate.d.ts +2 -1
  98. package/dist-client/entries/auth/activate.js +16 -17
  99. package/dist-client/entries/auth/activate.js.map +1 -1
  100. package/dist-client/entries/auth/checkin.d.ts +2 -2
  101. package/dist-client/entries/auth/checkin.js +13 -16
  102. package/dist-client/entries/auth/checkin.js.map +1 -1
  103. package/dist-client/entries/auth/forgot-password.d.ts +2 -1
  104. package/dist-client/entries/auth/forgot-password.js +7 -6
  105. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  106. package/dist-client/entries/auth/result.d.ts +2 -2
  107. package/dist-client/entries/auth/result.js +12 -12
  108. package/dist-client/entries/auth/result.js.map +1 -1
  109. package/dist-client/entries/auth/signup.js +19 -24
  110. package/dist-client/entries/auth/signup.js.map +1 -1
  111. package/dist-client/entries/oauth2/oauth2-decision-error-page.d.ts +1 -1
  112. package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -2
  113. package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
  114. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  115. package/dist-client/entries/oauth2/oauth2-decision-page.js +59 -54
  116. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  117. package/dist-client/entries/public/home.d.ts +3 -2
  118. package/dist-client/entries/public/home.js +40 -18
  119. package/dist-client/entries/public/home.js.map +1 -1
  120. package/dist-client/index.d.ts +11 -2
  121. package/dist-client/index.js +74 -66
  122. package/dist-client/index.js.map +1 -1
  123. package/dist-client/pages/app-binding/app-binding.d.ts +1 -1
  124. package/dist-client/pages/app-binding/app-binding.js +4 -9
  125. package/dist-client/pages/app-binding/app-binding.js.map +1 -1
  126. package/dist-client/pages/app-binding/app-bindings.js +2 -2
  127. package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
  128. package/dist-client/pages/appliance/appliance.d.ts +1 -1
  129. package/dist-client/pages/appliance/appliance.js +5 -9
  130. package/dist-client/pages/appliance/appliance.js.map +1 -1
  131. package/dist-client/pages/appliance/home.js +3 -3
  132. package/dist-client/pages/appliance/home.js.map +1 -1
  133. package/dist-client/pages/appliance/register.js +1 -1
  134. package/dist-client/pages/appliance/register.js.map +1 -1
  135. package/dist-client/pages/application/application.d.ts +1 -1
  136. package/dist-client/pages/application/application.js +28 -50
  137. package/dist-client/pages/application/application.js.map +1 -1
  138. package/dist-client/pages/application/applications.js +4 -12
  139. package/dist-client/pages/application/applications.js.map +1 -1
  140. package/dist-client/pages/application/register.js +1 -1
  141. package/dist-client/pages/application/register.js.map +1 -1
  142. package/dist-client/pages/attribute/attribute-set-item-list.d.ts +1 -1
  143. package/dist-client/pages/attribute/attribute-set-item-list.js +6 -22
  144. package/dist-client/pages/attribute/attribute-set-item-list.js.map +1 -1
  145. package/dist-client/pages/attribute/attribute-set-management.d.ts +11 -2
  146. package/dist-client/pages/attribute/attribute-set-management.js +7 -11
  147. package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
  148. package/dist-client/pages/auth-provider/auth-provider-management.d.ts +11 -2
  149. package/dist-client/pages/auth-provider/auth-provider-management.js +8 -11
  150. package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
  151. package/dist-client/pages/domain/domain-management.d.ts +1 -0
  152. package/dist-client/pages/domain/domain-management.js +3 -7
  153. package/dist-client/pages/domain/domain-management.js.map +1 -1
  154. package/dist-client/pages/user/user-management.d.ts +1 -0
  155. package/dist-client/pages/user/user-management.js +4 -5
  156. package/dist-client/pages/user/user-management.js.map +1 -1
  157. package/dist-client/tsconfig.tsbuildinfo +1 -1
  158. package/dist-server/tsconfig.tsbuildinfo +1 -1
  159. package/package.json +8 -12
  160. package/translations/en.json +1 -0
  161. package/translations/ja.json +1 -0
  162. package/translations/ko.json +1 -0
  163. package/translations/ms.json +1 -0
  164. package/translations/zh.json +1 -0
  165. package/views/auth-page.html +3 -2
  166. package/views/oauth2-page.html +3 -2
@@ -1,3 +1,6 @@
1
+ import '@material/web/icon/icon.js'
2
+ import '@material/web/button/elevated-button.js'
3
+
1
4
  import './ownership-transfer-popup'
2
5
  import './role-selector'
3
6
 
@@ -11,12 +14,13 @@ import { i18next } from '@operato/i18n'
11
14
  import { openPopup } from '@operato/layout'
12
15
  import { store } from '@operato/shell'
13
16
  import { OxPrompt } from '@operato/popup/ox-prompt.js'
14
-
17
+ import { ButtonContainerStyles } from '@operato/styles'
15
18
  import { RoleSelector } from './role-selector'
16
19
 
17
20
  @customElement('user-role-editor')
18
21
  class UserRoleEditor extends connect(store)(LitElement) {
19
22
  static styles = [
23
+ ButtonContainerStyles,
20
24
  css`
21
25
  :host {
22
26
  display: flex;
@@ -51,9 +55,9 @@ class UserRoleEditor extends connect(store)(LitElement) {
51
55
  [detail] {
52
56
  background-color: rgba(var(--primary-color-rgb), 0.05);
53
57
  }
54
- [detail] mwc-icon {
58
+ [detail] md-icon {
59
+ --md-icon-size: var(--fontsize-default);
55
60
  vertical-align: middle;
56
- --mdc-icon-size: var(--fontsize-default);
57
61
  color: var(--primary-color);
58
62
  }
59
63
  [detail] li {
@@ -63,20 +67,15 @@ class UserRoleEditor extends connect(store)(LitElement) {
63
67
  flex: 1;
64
68
  }
65
69
 
66
- [buttons] {
67
- margin: 0;
68
- padding: 5px;
69
- background-color: rgba(var(--primary-color-rgb), 0.2);
70
- }
71
-
72
- mwc-button {
70
+ md-elevated-button {
73
71
  margin: 5px;
74
72
  }
75
73
 
76
74
  [danger] {
77
- --mdc-theme-primary: var(--mdc-danger-button-primary-color);
75
+ --md-theme-primary: var(--md-danger-button-primary-color);
78
76
  }
79
- [outlined] {
77
+
78
+ md-outlined-button {
80
79
  background-color: var(--theme-white-color);
81
80
  }
82
81
 
@@ -117,7 +116,7 @@ class UserRoleEditor extends connect(store)(LitElement) {
117
116
  ? html`
118
117
  <li>
119
118
  <span>
120
- <mwc-icon>email</mwc-icon>
119
+ <md-icon>email</md-icon>
121
120
  ${user.email}
122
121
  </span>
123
122
  </li>
@@ -141,10 +140,9 @@ class UserRoleEditor extends connect(store)(LitElement) {
141
140
  `
142
141
  : ''}
143
142
 
144
- <div buttons>
143
+ <div class="button-container">
145
144
  ${this.isRoleEditable()
146
- ? html` <mwc-button
147
- raised
145
+ ? html` <md-elevated-button
148
146
  @click=${() => {
149
147
  const { availableRoles, selectedRoles } = Array.from(
150
148
  this.renderRoot.querySelectorAll('role-selector') as NodeListOf<RoleSelector>
@@ -169,46 +167,37 @@ class UserRoleEditor extends connect(store)(LitElement) {
169
167
  )
170
168
  this.onSave(user, availableRoles, selectedRoles)
171
169
  }}
172
- label=${String(i18next.t('button.save'))}
173
- ></mwc-button>`
170
+ >${String(i18next.t('button.save'))}</md-elevated-button
171
+ >`
174
172
  : ''}
175
173
  ${user.userType === 'user'
176
174
  ? html`
177
175
  ${this.isTransferable(user)
178
176
  ? html`
179
- <mwc-button
180
- raised
181
- danger
182
- @click=${() => this.onTransfer(user)}
183
- label=${String(i18next.t('button.transfer owner'))}
184
- ></mwc-button>
177
+ <md-elevated-button danger @click=${() => this.onTransfer(user)}
178
+ >${String(i18next.t('button.transfer owner'))}</md-elevated-button
179
+ >
185
180
  `
186
181
  : ''}
187
182
  ${this.isPasswordResettable(user)
188
- ? html`<mwc-button
189
- raised
190
- danger
191
- @click="${() => this.onResetPassword(user)}"
192
- label=${String(i18next.t('title.reset password'))}
193
- ></mwc-button>`
183
+ ? html`<md-elevated-button danger @click=${() => this.onResetPassword(user)}
184
+ >${String(i18next.t('title.reset password'))}</md-elevated-button
185
+ >`
194
186
  : ''}
195
187
  `
196
188
  : ''}
197
189
  ${this.isRemovable(user)
198
190
  ? html`
199
- <mwc-button
200
- raised
201
- danger
202
- label=${String(i18next.t('button.delete user'))}
203
- @click=${() => this.onDelete(user)}
204
- ></mwc-button>
191
+ <md-elevated-button danger @click=${() => this.onDelete(user)}
192
+ >${String(i18next.t('button.delete user'))}</md-elevated-button
193
+ >
205
194
  `
206
195
  : ''}
207
196
  ${this.isActivatable(user)
208
- ? html`<mwc-button raised danger @click="${() => this.onActivate(user)}" label="activate"></mwc-button>`
197
+ ? html`<md-elevated-button danger @click=${() => this.onActivate(user)}>activate</md-elevated-button>`
209
198
  : ''}
210
199
  ${this.isInactivatable(user)
211
- ? html`<mwc-button raised danger @click="${() => this.onInactivate(user)}" label="inactivate"></mwc-button>`
200
+ ? html`<md-elevated-button danger @click=${() => this.onInactivate(user)}>inactivate</md-elevated-button>`
212
201
  : ''}
213
202
  </div>
214
203
  `
@@ -1,4 +1,6 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/icon/icon.js'
2
+ import '@material/web/button/elevated-button.js'
3
+
2
4
  import '@operato/i18n/ox-i18n.js'
3
5
  import '@operato/layout/ox-snack-bar.js'
4
6
  import '@operato/lottie-player'
@@ -66,11 +68,11 @@ export class AuthActivate extends localize(i18next)(LitElement) {
66
68
  padding-top: 10px;
67
69
  }
68
70
 
69
- mwc-button {
70
- --mdc-theme-primary: var(--auth-button-background-color);
71
- --mdc-theme-on-primary: var(--primary-color);
72
- --mdc-button-horizontal-padding: var(--padding-default);
73
- --mdc-button-ink-color: var(--primary-color);
71
+ md-elevated-button {
72
+ --md-theme-primary: var(--auth-button-background-color);
73
+ --md-theme-on-primary: var(--primary-color);
74
+ --md-button-horizontal-padding: var(--padding-default);
75
+ --md-button-ink-color: var(--primary-color);
74
76
  }
75
77
 
76
78
  contact-us {
@@ -162,20 +164,18 @@ export class AuthActivate extends localize(i18next)(LitElement) {
162
164
  </form>
163
165
 
164
166
  <div id="button-area">
165
- <mwc-button
166
- raised
167
- icon="mail_outline"
168
- label=${i18next.t('label.send activation email')}
169
- @click=${e => this.requestResend(e)}
170
- ></mwc-button>
171
- <mwc-button
172
- raised
173
- icon="home"
174
- label=${i18next.t('button.go to home')}
167
+ <md-elevated-button @click=${e => this.requestResend(e)}>
168
+ <md-icon slot="icon">mail_outline</md-icon>
169
+ ${i18next.t('label.send activation email')}
170
+ </md-elevated-button>
171
+ <md-elevated-button
175
172
  @click=${e => {
176
173
  window.location.replace('/auth/signin')
177
174
  }}
178
- ></mwc-button>
175
+ >
176
+ <md-icon slot="icon">home</md-icon>
177
+ ${i18next.t('button.go to home')}
178
+ </md-elevated-button>
179
179
  </div>
180
180
  <contact-us></contact-us>
181
181
 
@@ -1,5 +1,6 @@
1
- import '@material/mwc-button'
2
- import '@material/mwc-icon'
1
+ import '@material/web/icon/icon.js'
2
+ import '@material/web/button/elevated-button.js'
3
+
3
4
  import '@operato/lottie-player'
4
5
 
5
6
  import { css, html, LitElement } from 'lit'
@@ -59,7 +60,7 @@ export class AuthCheckIn extends localize(i18next)(LitElement) {
59
60
  font: normal var(--fontsize-default) var(--theme-font);
60
61
  color: var(--secondary-text-color);
61
62
  }
62
- li mwc-icon {
63
+ li md-icon {
63
64
  float: right;
64
65
  margin: 2px 0 0 0;
65
66
  opacity: 0.5;
@@ -67,12 +68,12 @@ export class AuthCheckIn extends localize(i18next)(LitElement) {
67
68
  .button-container {
68
69
  text-align: center;
69
70
  }
70
- .button-container mwc-button {
71
+ .button-container md-elevated-button {
71
72
  margin-left: var(--margin-narrow);
72
73
  }
73
74
 
74
75
  @media (max-width: 450px) {
75
- .button-container mwc-button {
76
+ .button-container md-elevated-button {
76
77
  width: 100%;
77
78
  margin: var(--margin-default) 0 0 0;
78
79
  }
@@ -93,7 +94,7 @@ export class AuthCheckIn extends localize(i18next)(LitElement) {
93
94
  var { icon, title, description } = this.applicationMeta
94
95
 
95
96
  return html`
96
- <div class="content">
97
+ <div class="content md-typescale-display-medium">
97
98
  <div class="wrap">
98
99
  <div class="auth-brand">
99
100
  <img src=${icon || ''} />
@@ -110,11 +111,9 @@ export class AuthCheckIn extends localize(i18next)(LitElement) {
110
111
  domain => html`
111
112
  <li
112
113
  @click=${() =>
113
- (location.href = `/auth/checkin/${domain.subdomain}?redirect_to=${encodeURIComponent(
114
- this.redirectTo || '/'
115
- )}`)}
114
+ (location.href = `/auth/checkin/${domain.subdomain}?redirect_to=${encodeURIComponent(this.redirectTo || '/')}`)}
116
115
  >
117
- <mwc-icon>keyboard_arrow_right</mwc-icon>
116
+ <md-icon>keyboard_arrow_right</md-icon>
118
117
  <strong>${domain.name}</strong>
119
118
  <span>${domain.description}</span>
120
119
  </li>
@@ -125,18 +124,15 @@ export class AuthCheckIn extends localize(i18next)(LitElement) {
125
124
  : html` <h3>${i18next.t('text.no domain available')}</h3> `}
126
125
 
127
126
  <div class="button-container">
128
- <mwc-button
129
- raised
130
- label=${String(i18next.t('button.logout'))}
131
- @click="${() => (location.pathname = '/auth/signout')}"
132
- ></mwc-button>
127
+ <md-elevated-button @click=${() => (location.pathname = '/auth/signout')}
128
+ >${String(i18next.t('button.logout'))}</md-elevated-button
129
+ >
133
130
 
134
131
  ${this.domainType?.toLowerCase() === 'company'
135
- ? html`<mwc-button
136
- raised
137
- label=${String(i18next.t('button.register business domain'))}
132
+ ? html`<md-elevated-button
138
133
  @click=${e => (location.href = `/public/business-register?email=${this.user?.email}`)}
139
- ></mwc-button> `
134
+ >${String(i18next.t('button.register business domain'))}</md-elevated-button
135
+ > `
140
136
  : ''}
141
137
  </div>
142
138
 
@@ -1,4 +1,6 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/button/elevated-button.js'
2
+ import '@material/web/button/text-button.js'
3
+
2
4
  import '@operato/i18n/ox-i18n.js'
3
5
  import '../../components/profile-component'
4
6
 
@@ -28,7 +30,7 @@ export class ForgotPassword extends AbstractAuthPage {
28
30
  return html`
29
31
  <input id="email" name="email" type="hidden" required .value=${email} />
30
32
  <div class="field">
31
- <mwc-textfield
33
+ <md-filled-text-field
32
34
  name="email"
33
35
  type="email"
34
36
  label=${String(i18next.t('label.email'))}
@@ -37,18 +39,18 @@ export class ForgotPassword extends AbstractAuthPage {
37
39
  @input=${e => {
38
40
  this.emailInput.value = e.target.value
39
41
  }}
40
- ></mwc-textfield>
42
+ ></md-filled-text-field>
41
43
  </div>
42
- <mwc-button id="submit-button" class="ui button" type="submit" raised @click=${e => this._onSubmit(e)}>
44
+ <md-elevated-button id="submit-button" class="ui button" type="submit" @click=${e => this._onSubmit(e)}>
43
45
  <ox-i18n msgid="button.submit"></ox-i18n>
44
- </mwc-button>
46
+ </md-elevated-button>
45
47
  `
46
48
  }
47
49
 
48
50
  get links() {
49
51
  return html`
50
52
  <a class="link" href="/auth/signin">
51
- <mwc-button><ox-i18n msgid="field.sign in"></ox-i18n></mwc-button>
53
+ <md-text-button><ox-i18n msgid="field.sign in"></ox-i18n></md-text-button>
52
54
  </a>
53
55
  `
54
56
  }
@@ -1,6 +1,7 @@
1
- import '@material/mwc-button'
2
- import '../../components/profile-component'
1
+ import '@material/web/button/elevated-button.js'
2
+
3
3
  import '@operato/lottie-player'
4
+ import '../../components/profile-component'
4
5
 
5
6
  import { css, html, LitElement } from 'lit'
6
7
  import { customElement, property } from 'lit/decorators.js'
@@ -73,11 +74,11 @@ export class AuthResult extends localize(i18next)(LitElement) {
73
74
  border-top: 1px dashed rgba(0, 0, 0, 0.1);
74
75
  padding-top: 10px;
75
76
  }
76
- mwc-button {
77
- --mdc-theme-primary: var(--auth-button-background-color);
78
- --mdc-theme-on-primary: var(--primary-color);
79
- --mdc-button-horizontal-padding: var(--padding-default);
80
- --mdc-button-ink-color: var(--primary-color);
77
+ md-elevated-button {
78
+ --md-theme-primary: var(--auth-button-background-color);
79
+ --md-theme-on-primary: var(--primary-color);
80
+ --md-button-horizontal-padding: var(--padding-default);
81
+ --md-button-ink-color: var(--primary-color);
81
82
  }
82
83
  .lottie-container {
83
84
  width: 100%;
@@ -151,14 +152,14 @@ export class AuthResult extends localize(i18next)(LitElement) {
151
152
  <p></p>
152
153
  </div>
153
154
  <div id="button-area">
154
- <mwc-button
155
- icon="home"
156
- raised
157
- label="${i18next.t('button.go to home')}"
155
+ <md-elevated-button
158
156
  @click=${e => {
159
157
  window.location.replace('/auth/signin')
160
158
  }}
161
- ></mwc-button>
159
+ >
160
+ <md-icon slot="icon">home</md-icon>
161
+ ${i18next.t('button.go to home')}
162
+ </md-elevated-button>
162
163
  </div>
163
164
 
164
165
  ${isSafari()
@@ -26,28 +26,28 @@ export class AuthSignup extends AbstractSign {
26
26
  get formfields() {
27
27
  const { name = '', email = '' } = this.data || {}
28
28
 
29
+ // .validationMessage=${this.passwordHelp || ''}
30
+ // .validationMessage=${String(i18next.t('text.passwords do not match'))}
31
+
29
32
  return html`
30
33
  <div class="field">
31
- <mwc-textfield
32
- name="name"
33
- type="text"
34
- label=${String(i18next.t('field.name'))}
35
- .value=${name}
36
- required
37
- ></mwc-textfield>
34
+ <md-filled-text-field name="name" type="text" label=${String(i18next.t('field.name'))} .value=${name} required></md-filled-text-field>
38
35
  </div>
39
36
  <div class="field">
40
- <mwc-textfield
37
+ <md-filled-text-field
41
38
  name="email"
42
39
  type="email"
43
40
  label=${String(i18next.t('field.email'))}
44
41
  required
45
42
  .value=${email}
46
- .validationMessage=${String(i18next.t('text.invalid-email'))}
47
- ></mwc-textfield>
43
+ @input=${(e: Event) => {
44
+ const target = e.target as HTMLFormElement
45
+ target.setCustomValidity(i18next.t('text.invalid-email'))
46
+ }}
47
+ ></md-filled-text-field>
48
48
  </div>
49
49
  <div class="field">
50
- <mwc-textfield
50
+ <md-filled-text-field
51
51
  name="password"
52
52
  type="password"
53
53
  label=${String(i18next.t('field.password'))}
@@ -59,22 +59,18 @@ export class AuthSignup extends AbstractSign {
59
59
  var val = e.target.value
60
60
  this.confirmPass.setAttribute('pattern', val.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '[$&]'))
61
61
  }}
62
- .validationMessage=${this.passwordHelp || ''}
63
- ></mwc-textfield>
62
+ >
63
+ ></md-filled-text-field
64
+ >
64
65
  </div>
65
66
  <div class="field">
66
- <mwc-textfield
67
- id="confirm-password"
68
- name="confirm-password"
69
- type="password"
70
- label=${String(i18next.t('field.confirm password'))}
71
- required
72
- .validationMessage=${String(i18next.t('text.passwords do not match'))}
73
- ></mwc-textfield>
67
+ <md-filled-text-field id="confirm-password" name="confirm-password" type="password" label=${String(i18next.t('field.confirm password'))} required>
68
+ ></md-filled-text-field
69
+ >
74
70
  </div>
75
- <mwc-button class="ui button" raised @click=${e => this._onSubmit(e)}>
71
+ <md-elevated-button class="ui button" @click=${e => this._onSubmit(e)}>
76
72
  <ox-i18n msgid="field.${this.pageName}"></ox-i18n>
77
- </mwc-button>
73
+ </md-elevated-button>
78
74
  `
79
75
  }
80
76
 
@@ -86,7 +82,7 @@ export class AuthSignup extends AbstractSign {
86
82
  get links() {
87
83
  return html`
88
84
  <a class="link" href="/auth/signin">
89
- <mwc-button><ox-i18n msgid="field.sign in"></ox-i18n></mwc-button>
85
+ <md-text-button><ox-i18n msgid="field.sign in"></ox-i18n></md-text-button>
90
86
  </a>
91
87
  `
92
88
  }
@@ -1,4 +1,4 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/button/elevated-button.js'
2
2
 
3
3
  import { html, LitElement } from 'lit'
4
4
  import { customElement, property } from 'lit/decorators.js'
@@ -33,7 +33,7 @@ class OAuth2DecisionErrorPage extends LitElement {
33
33
  <input name="state" type="text" value="${this.req.state}" hidden />
34
34
  <input name="email" type="text" value="${this.user.email}" hidden />
35
35
 
36
- <mwc-button raised @click="${() => history.back()}">Move back</mwc-button>
36
+ <md-elevated-button raised @click="${() => history.back()}">Move back</md-elevated-button>
37
37
  </form>
38
38
  `
39
39
  }
@@ -1,4 +1,4 @@
1
- import '@material/mwc-button'
1
+ import '@material/web/button/elevated-button.js'
2
2
  import '../../components/role-selector'
3
3
 
4
4
  import gql from 'graphql-tag'
@@ -8,60 +8,65 @@ import { customElement, property, query } from 'lit/decorators.js'
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next } from '@operato/i18n'
10
10
  import { OxPrompt } from '@operato/popup/ox-prompt.js'
11
+ import { ButtonContainerStyles } from '@operato/styles'
11
12
 
12
13
  @customElement('oauth2-decision')
13
14
  class OAuth2DecisionPage extends LitElement {
14
- static styles = css`
15
- :host {
16
- display: flex;
17
- flex-direction: column;
18
-
19
- border: 1px solid var(--primary-color);
20
- margin: var(--margin-default);
21
- padding: var(--padding-default);
22
- font: normal 15px var(--theme-font);
23
- color: var(--secondary-color);
24
- }
25
- [field-2column] {
26
- border-radius: var(--border-radius);
27
- display: grid;
28
- grid-template-columns: 1fr 1fr;
29
- gap: 5px 15px;
30
- clear: both;
31
- max-width: var(--input-container-max-width);
32
- }
33
- [field] {
34
- display: flex;
35
- flex-direction: column;
36
- padding-bottom: var(--padding-default);
37
- }
38
- input {
39
- border: var(--border-dark-color);
40
- border-radius: var(--border-radius);
41
- margin: var(--input-margin);
42
- padding: var(--input-padding);
43
- min-width: 250px;
44
- font: var(--input-font);
45
- }
46
- label {
47
- display: flex;
48
- flex-direction: column;
49
- font: var(--label-font);
50
- color: var(--label-color);
51
- text-transform: var(--label-text-transform);
52
- }
53
- [buttons] {
54
- margin: 0;
55
- padding: var(--padding-default);
56
- background-color: rgba(var(--primary-color-rgb), 0.2);
57
- }
58
- mwc-button {
59
- margin-right: var(--padding-narrow);
60
- }
61
- [danger] {
62
- --mdc-theme-primary: var(--mdc-danger-button-primary-color);
63
- }
64
- `
15
+ static styles = [
16
+ ButtonContainerStyles,
17
+ css`
18
+ :host {
19
+ display: flex;
20
+ flex-direction: column;
21
+
22
+ border: 1px solid var(--primary-color);
23
+ margin: var(--margin-default);
24
+ padding: var(--padding-default);
25
+ font: normal 15px var(--theme-font);
26
+ color: var(--secondary-color);
27
+ }
28
+
29
+ [field-2column] {
30
+ border-radius: var(--border-radius);
31
+ display: grid;
32
+ grid-template-columns: 1fr 1fr;
33
+ gap: 5px 15px;
34
+ clear: both;
35
+ max-width: var(--input-container-max-width);
36
+ }
37
+
38
+ [field] {
39
+ display: flex;
40
+ flex-direction: column;
41
+ padding-bottom: var(--padding-default);
42
+ }
43
+
44
+ input {
45
+ border: var(--border-dark-color);
46
+ border-radius: var(--border-radius);
47
+ margin: var(--input-margin);
48
+ padding: var(--input-padding);
49
+ min-width: 250px;
50
+ font: var(--input-font);
51
+ }
52
+
53
+ label {
54
+ display: flex;
55
+ flex-direction: column;
56
+ font: var(--label-font);
57
+ color: var(--label-color);
58
+ text-transform: var(--label-text-transform);
59
+ }
60
+
61
+ md-elevated-button {
62
+ margin-right: var(--padding-narrow);
63
+ }
64
+
65
+ [danger] {
66
+ --md-theme-primary: var(--md-danger-button-primary-color);
67
+ }
68
+ `
69
+ ]
65
70
 
66
71
  @property({ type: Object }) data: any = {}
67
72
  @property({ type: Object }) user: any = {}
@@ -109,9 +114,9 @@ class OAuth2DecisionPage extends LitElement {
109
114
 
110
115
  <role-selector .roleCategory="${this.domain.name}" .roles="${this.roles}"></role-selector>
111
116
 
112
- <div buttons>
113
- <mwc-button @click="${() => this.decision(true)}" raised label="Allow"></mwc-button>
114
- <mwc-button @click="${() => this.decision(false)}" raised danger label="Deny"></mwc-button>
117
+ <div class="button-container">
118
+ <md-elevated-button @click="${() => this.decision(true)}" raised label="Allow"></md-elevated-button>
119
+ <md-elevated-button @click="${() => this.decision(false)}" raised danger label="Deny"></md-elevated-button>
115
120
  </div>
116
121
  `
117
122
  }