@things-factory/auth-ui 7.0.1-alpha.88 → 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 (143) hide show
  1. package/client/auth-style-sign.ts +29 -18
  2. package/client/components/abstract-auth-page.ts +41 -22
  3. package/client/components/abstract-password-reset.ts +11 -9
  4. package/client/components/abstract-sign.ts +138 -0
  5. package/client/components/change-password.ts +2 -2
  6. package/client/components/contact-us.ts +18 -16
  7. package/client/components/create-domain-popup.ts +11 -7
  8. package/client/components/create-role.ts +8 -20
  9. package/client/components/create-user.ts +8 -16
  10. package/client/components/credential-manager.ts +64 -0
  11. package/client/components/invite-customer.ts +7 -12
  12. package/client/components/invite-user.ts +2 -7
  13. package/client/components/ownership-transfer-popup.ts +3 -3
  14. package/client/components/partner-role-editor.ts +9 -15
  15. package/client/components/profile-component.ts +124 -7
  16. package/client/components/role-privilege-editor.ts +10 -17
  17. package/client/components/user-role-editor.ts +27 -38
  18. package/client/entries/auth/activate.ts +17 -17
  19. package/client/entries/auth/checkin.ts +15 -19
  20. package/client/entries/auth/forgot-password.ts +8 -6
  21. package/client/entries/auth/result.ts +13 -12
  22. package/client/entries/auth/signup.ts +20 -24
  23. package/client/entries/oauth2/oauth2-decision-error-page.ts +2 -2
  24. package/client/entries/oauth2/oauth2-decision-page.ts +60 -55
  25. package/client/entries/public/home.ts +40 -18
  26. package/client/pages/app-binding/app-binding.ts +5 -9
  27. package/client/pages/app-binding/app-bindings.ts +2 -2
  28. package/client/pages/appliance/appliance.ts +6 -9
  29. package/client/pages/appliance/home.ts +3 -3
  30. package/client/pages/appliance/register.ts +1 -1
  31. package/client/pages/application/application.ts +30 -14
  32. package/client/pages/application/applications.ts +4 -12
  33. package/client/pages/application/register.ts +1 -1
  34. package/client/pages/attribute/attribute-set-management.ts +2 -0
  35. package/client/pages/auth-provider/auth-provider-management.ts +2 -0
  36. package/client/pages/domain/domain-management.ts +2 -0
  37. package/client/pages/user/user-management.ts +5 -5
  38. package/dist-client/auth-style-sign.js +29 -18
  39. package/dist-client/auth-style-sign.js.map +1 -1
  40. package/dist-client/components/abstract-auth-page.d.ts +4 -4
  41. package/dist-client/components/abstract-auth-page.js +40 -22
  42. package/dist-client/components/abstract-auth-page.js.map +1 -1
  43. package/dist-client/components/abstract-password-reset.d.ts +3 -2
  44. package/dist-client/components/abstract-password-reset.js +10 -9
  45. package/dist-client/components/abstract-password-reset.js.map +1 -1
  46. package/dist-client/components/abstract-sign.d.ts +3 -0
  47. package/dist-client/components/abstract-sign.js +110 -0
  48. package/dist-client/components/abstract-sign.js.map +1 -1
  49. package/dist-client/components/change-password.js +2 -2
  50. package/dist-client/components/change-password.js.map +1 -1
  51. package/dist-client/components/contact-us.d.ts +4 -4
  52. package/dist-client/components/contact-us.js +17 -16
  53. package/dist-client/components/contact-us.js.map +1 -1
  54. package/dist-client/components/create-domain-popup.d.ts +1 -1
  55. package/dist-client/components/create-domain-popup.js +11 -7
  56. package/dist-client/components/create-domain-popup.js.map +1 -1
  57. package/dist-client/components/create-role.d.ts +1 -1
  58. package/dist-client/components/create-role.js +7 -19
  59. package/dist-client/components/create-role.js.map +1 -1
  60. package/dist-client/components/create-user.js +6 -14
  61. package/dist-client/components/create-user.js.map +1 -1
  62. package/dist-client/components/credential-manager.d.ts +11 -0
  63. package/dist-client/components/credential-manager.js +64 -0
  64. package/dist-client/components/credential-manager.js.map +1 -0
  65. package/dist-client/components/invite-customer.js +5 -7
  66. package/dist-client/components/invite-customer.js.map +1 -1
  67. package/dist-client/components/invite-user.js +2 -7
  68. package/dist-client/components/invite-user.js.map +1 -1
  69. package/dist-client/components/ownership-transfer-popup.d.ts +1 -1
  70. package/dist-client/components/ownership-transfer-popup.js +3 -3
  71. package/dist-client/components/ownership-transfer-popup.js.map +1 -1
  72. package/dist-client/components/partner-role-editor.js +9 -15
  73. package/dist-client/components/partner-role-editor.js.map +1 -1
  74. package/dist-client/components/profile-component.d.ts +6 -0
  75. package/dist-client/components/profile-component.js +111 -7
  76. package/dist-client/components/profile-component.js.map +1 -1
  77. package/dist-client/components/role-privilege-editor.js +10 -17
  78. package/dist-client/components/role-privilege-editor.js.map +1 -1
  79. package/dist-client/components/user-role-editor.d.ts +2 -0
  80. package/dist-client/components/user-role-editor.js +26 -37
  81. package/dist-client/components/user-role-editor.js.map +1 -1
  82. package/dist-client/entries/auth/activate.d.ts +2 -1
  83. package/dist-client/entries/auth/activate.js +16 -17
  84. package/dist-client/entries/auth/activate.js.map +1 -1
  85. package/dist-client/entries/auth/checkin.d.ts +2 -2
  86. package/dist-client/entries/auth/checkin.js +13 -16
  87. package/dist-client/entries/auth/checkin.js.map +1 -1
  88. package/dist-client/entries/auth/forgot-password.d.ts +2 -1
  89. package/dist-client/entries/auth/forgot-password.js +7 -6
  90. package/dist-client/entries/auth/forgot-password.js.map +1 -1
  91. package/dist-client/entries/auth/result.d.ts +2 -2
  92. package/dist-client/entries/auth/result.js +12 -12
  93. package/dist-client/entries/auth/result.js.map +1 -1
  94. package/dist-client/entries/auth/signup.js +19 -24
  95. package/dist-client/entries/auth/signup.js.map +1 -1
  96. package/dist-client/entries/oauth2/oauth2-decision-error-page.d.ts +1 -1
  97. package/dist-client/entries/oauth2/oauth2-decision-error-page.js +2 -2
  98. package/dist-client/entries/oauth2/oauth2-decision-error-page.js.map +1 -1
  99. package/dist-client/entries/oauth2/oauth2-decision-page.d.ts +1 -1
  100. package/dist-client/entries/oauth2/oauth2-decision-page.js +59 -54
  101. package/dist-client/entries/oauth2/oauth2-decision-page.js.map +1 -1
  102. package/dist-client/entries/public/home.d.ts +3 -2
  103. package/dist-client/entries/public/home.js +40 -18
  104. package/dist-client/entries/public/home.js.map +1 -1
  105. package/dist-client/pages/app-binding/app-binding.d.ts +1 -1
  106. package/dist-client/pages/app-binding/app-binding.js +4 -9
  107. package/dist-client/pages/app-binding/app-binding.js.map +1 -1
  108. package/dist-client/pages/app-binding/app-bindings.js +2 -2
  109. package/dist-client/pages/app-binding/app-bindings.js.map +1 -1
  110. package/dist-client/pages/appliance/appliance.d.ts +1 -1
  111. package/dist-client/pages/appliance/appliance.js +5 -9
  112. package/dist-client/pages/appliance/appliance.js.map +1 -1
  113. package/dist-client/pages/appliance/home.js +3 -3
  114. package/dist-client/pages/appliance/home.js.map +1 -1
  115. package/dist-client/pages/appliance/register.js +1 -1
  116. package/dist-client/pages/appliance/register.js.map +1 -1
  117. package/dist-client/pages/application/application.js +26 -13
  118. package/dist-client/pages/application/application.js.map +1 -1
  119. package/dist-client/pages/application/applications.js +4 -12
  120. package/dist-client/pages/application/applications.js.map +1 -1
  121. package/dist-client/pages/application/register.js +1 -1
  122. package/dist-client/pages/application/register.js.map +1 -1
  123. package/dist-client/pages/attribute/attribute-set-management.d.ts +1 -0
  124. package/dist-client/pages/attribute/attribute-set-management.js +1 -0
  125. package/dist-client/pages/attribute/attribute-set-management.js.map +1 -1
  126. package/dist-client/pages/auth-provider/auth-provider-management.d.ts +1 -0
  127. package/dist-client/pages/auth-provider/auth-provider-management.js +1 -0
  128. package/dist-client/pages/auth-provider/auth-provider-management.js.map +1 -1
  129. package/dist-client/pages/domain/domain-management.d.ts +1 -0
  130. package/dist-client/pages/domain/domain-management.js +1 -0
  131. package/dist-client/pages/domain/domain-management.js.map +1 -1
  132. package/dist-client/pages/user/user-management.d.ts +1 -0
  133. package/dist-client/pages/user/user-management.js +4 -5
  134. package/dist-client/pages/user/user-management.js.map +1 -1
  135. package/dist-client/tsconfig.tsbuildinfo +1 -1
  136. package/package.json +5 -10
  137. package/translations/en.json +1 -0
  138. package/translations/ja.json +1 -0
  139. package/translations/ko.json +1 -0
  140. package/translations/ms.json +1 -0
  141. package/translations/zh.json +1 -0
  142. package/views/auth-page.html +2 -2
  143. package/views/oauth2-page.html +3 -3
@@ -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
  }
@@ -1,8 +1,10 @@
1
- import '@material/mwc-icon-button'
2
- import '@material/mwc-button'
1
+ import '@material/web/icon/icon.js'
2
+ import '@material/web/button/text-button.js'
3
+ import '@material/web/button/elevated-button.js'
3
4
 
4
5
  import { css, html, LitElement } from 'lit'
5
6
  import { customElement, property, query } from 'lit/decorators.js'
7
+ import { ifDefined } from 'lit/directives/if-defined.js'
6
8
 
7
9
  import { i18next, localize } from '@operato/i18n'
8
10
 
@@ -15,19 +17,33 @@ export class HomePage extends localize(i18next)(LitElement) {
15
17
  position: relative;
16
18
  }
17
19
 
18
- [home] {
20
+ .signin {
19
21
  position: absolute;
20
- left: 20px;
22
+ right: 20px;
21
23
  top: 10px;
22
- font-size: 2em;
23
- color: var(--primary-color);
24
+ display: inline-block;
25
+ padding: 12px 24px;
26
+ font-size: 16px;
27
+ font-weight: bold;
28
+ color: var(--md-sys-color-on-primary);
29
+ background-color: var(--md-sys-color-primary-container);
30
+ border: none;
31
+ border-radius: 4px;
32
+ text-align: center;
33
+ text-decoration: none;
34
+ transition:
35
+ background-color 0.3s,
36
+ transform 0.3s;
24
37
  }
25
38
 
26
- [signin] {
27
- position: absolute;
28
- right: 20px;
29
- top: 20px;
30
- font-size: 2em;
39
+ .signin:hover {
40
+ background-color: var(--md-sys-color-on-primary-container);
41
+ transform: translateY(-2px);
42
+ }
43
+
44
+ .signin:active {
45
+ background-color: var(--md-sys-color-primary-container);
46
+ transform: translateY(0);
31
47
  }
32
48
 
33
49
  [message] {
@@ -96,7 +112,7 @@ export class HomePage extends localize(i18next)(LitElement) {
96
112
  input {
97
113
  border: var(--border-dark-color);
98
114
  border-radius: var(--border-radius);
99
- padding: var(--input-padding);
115
+ padding: var(--padding-default);
100
116
  font: var(--input-font);
101
117
  }
102
118
 
@@ -150,7 +166,7 @@ export class HomePage extends localize(i18next)(LitElement) {
150
166
  margin: var(--margin-narrow) 0 var(--margin-default) 0;
151
167
  text-align: center;
152
168
  }
153
- fieldset mwc-button {
169
+ fieldset md-text-button {
154
170
  width: 100%;
155
171
  }
156
172
  }
@@ -171,8 +187,15 @@ export class HomePage extends localize(i18next)(LitElement) {
171
187
  const explanation2 = this.explanation2 || 'Everything you need to go from where you are, to where you want to be.'
172
188
 
173
189
  return html`
174
- <mwc-icon-button home icon="home" @click=${e => (window.location.href = '/')}></mwc-icon-button>
175
- <mwc-button signin dense @click=${e => (window.location.href = '/auth/signin')}>sign in</mwc-button>
190
+ <a
191
+ class="signin"
192
+ @click=${e => {
193
+ e.preventDefault()
194
+ window.location.href = '/auth/signin'
195
+ }}
196
+ >
197
+ ${i18next.t('button.sign_in')}</a
198
+ >
176
199
 
177
200
  <div message>
178
201
  <strong>${tagline}</strong> ${explanation1} <br />
@@ -181,14 +204,13 @@ export class HomePage extends localize(i18next)(LitElement) {
181
204
  </div>
182
205
 
183
206
  <div ticket>
184
- <div brand><img src=${icon} /></div>
207
+ <div brand><img src=${ifDefined(icon)} /></div>
185
208
  <div content>
186
- <form action="/auth/join" accept-charset="utf-8" name="join" method="POST">
209
+ <form action="/auth/join" accept-charset="utf-8" name="join" method="post">
187
210
  <fieldset>
188
211
  <legend>${title} invitation ticket</legend>
189
212
  <input type="text" name="email" placeholder="Enter your email address" />
190
213
  <input type="submit" value="join now" />
191
- <!-- help this button, pls <mwc-button raised label="join now"></mwc-button> -->
192
214
  </fieldset>
193
215
  </form>
194
216
  </div>
@@ -1,3 +1,5 @@
1
+ import '@material/web/icon/icon.js'
2
+
1
3
  import Clipboard from 'clipboard'
2
4
  import gql from 'graphql-tag'
3
5
  import { css, html } from 'lit'
@@ -164,7 +166,7 @@ class AppBinding extends connect(store)(PageView) {
164
166
 
165
167
  return html`
166
168
  <div>
167
- <h2><mwc-icon>link</mwc-icon>&nbsp;${app.name}</h2>
169
+ <h2><md-icon>link</md-icon>&nbsp;${app.name}</h2>
168
170
  <p page-description>${app.description}</p>
169
171
  </div>
170
172
 
@@ -235,10 +237,7 @@ class AppBinding extends connect(store)(PageView) {
235
237
  <input id="access-token" type="text" .value=${this.accessToken || ''} readonly />
236
238
  <button button-in-field clipboard-copy @click=${e => e.preventDefault()}>copy</button>
237
239
  ${accessTokenExp
238
- ? html`<div input-hint>
239
- expired in ${new Date(accessTokenExp).toLocaleString()} :
240
- ${asyncReplace(this.expTimer(accessTokenExp))}
241
- </div>`
240
+ ? html`<div input-hint>expired in ${new Date(accessTokenExp).toLocaleString()} : ${asyncReplace(this.expTimer(accessTokenExp))}</div>`
242
241
  : html``}
243
242
  </div>
244
243
 
@@ -247,10 +246,7 @@ class AppBinding extends connect(store)(PageView) {
247
246
  <input id="refresh-token" type="text" .value=${binding.refreshToken || ''} readonly />
248
247
  <button button-in-field clipboard-copy @click=${e => e.preventDefault()}>copy</button>
249
248
  ${refreshTokenExp
250
- ? html`<div input-hint>
251
- expired in ${new Date(refreshTokenExp).toLocaleString()} :
252
- ${asyncReplace(this.expTimer(refreshTokenExp))}
253
- </div>`
249
+ ? html`<div input-hint>expired in ${new Date(refreshTokenExp).toLocaleString()} : ${asyncReplace(this.expTimer(refreshTokenExp))}</div>`
254
250
  : html``}
255
251
  </div>
256
252
  </div>
@@ -16,7 +16,7 @@ class AppBindings extends connect(store)(PageView) {
16
16
 
17
17
  overflow: auto;
18
18
  }
19
- mwc-button {
19
+ md-elevated-button {
20
20
  margin-right: 0;
21
21
  float: right;
22
22
  }
@@ -114,7 +114,7 @@ class AppBindings extends connect(store)(PageView) {
114
114
  `
115
115
  )}
116
116
  </table>
117
- <mwc-button raised @click=${e => navigate('applications')} label="registered applications .."></mwc-button>
117
+ <md-elevated-button @click=${e => navigate('applications')}>registered applications ..</md-elevated-button>
118
118
  `
119
119
  }
120
120
 
@@ -1,3 +1,5 @@
1
+ import '@material/web/icon/icon.js'
2
+
1
3
  import Clipboard from 'clipboard'
2
4
  import gql from 'graphql-tag'
3
5
  import { css, html } from 'lit'
@@ -150,7 +152,7 @@ class Appliance extends connect(store)(PageView) {
150
152
 
151
153
  return html`
152
154
  <div>
153
- <h2><mwc-icon>devices</mwc-icon>&nbsp;${appliance.name}</h2>
155
+ <h2><md-icon>devices</md-icon>&nbsp;${appliance.name}</h2>
154
156
  <p page-description>${appliance.description}</p>
155
157
  </div>
156
158
 
@@ -199,13 +201,10 @@ class Appliance extends connect(store)(PageView) {
199
201
  <div field grid-span>
200
202
  <label for="access-token">${i18next.t('label.access token')}</label>
201
203
  <input id="access-token" type="text" .value=${appliance.accessToken} readonly />
202
- <button button-in-field clipboard-copy @click=${e => e.preventDefault()}>
203
- ${i18next.t('button.copy')}
204
- </button>
204
+ <button button-in-field clipboard-copy @click=${e => e.preventDefault()}>${i18next.t('button.copy')}</button>
205
205
  ${accessTokenExp
206
206
  ? html`<div input-hint>
207
- ${i18next.t('text.token expiry time')} ${new Date(accessTokenExp * 1000).toLocaleString()} :
208
- ${asyncReplace(this.expTimer(accessTokenExp))}
207
+ ${i18next.t('text.token expiry time')} ${new Date(accessTokenExp * 1000).toLocaleString()} : ${asyncReplace(this.expTimer(accessTokenExp))}
209
208
  </div>`
210
209
  : html``}
211
210
  </div>
@@ -214,9 +213,7 @@ class Appliance extends connect(store)(PageView) {
214
213
  </div>
215
214
 
216
215
  <button @click=${this.deleteAppliance.bind(this)}>${i18next.t('button.delete this appliance')}</button>
217
- <button @click=${this.generateApplianceSecret.bind(this)}>
218
- ${i18next.t('button.generate new access token')}
219
- </button>
216
+ <button @click=${this.generateApplianceSecret.bind(this)}>${i18next.t('button.generate new access token')}</button>
220
217
  <button @click=${this.updateAppliance.bind(this)}>${i18next.t('button.update')}</button>
221
218
  </form>
222
219
  `
@@ -96,10 +96,10 @@ class Appliances extends connect(store)(PageView) {
96
96
  <div>
97
97
  <h2>Registered Appliances</h2>
98
98
  <p page-description>
99
- What type of appliance are you building?<br />Choose the app type that best suits the audience you’re building
100
- for. The appliance type can’t be changed after it’s created.
99
+ What type of appliance are you building?<br />Choose the app type that best suits the audience you’re building for. The appliance type can’t be changed after
100
+ it’s created.
101
101
  </p>
102
- <mwc-button raised @click=${e => navigate('appliance-register')} label="register new appliance"></mwc-button>
102
+ <md-elevated-button @click=${e => navigate('appliance-register')}>register new appliance</md-elevated-button>
103
103
  </div>
104
104
 
105
105
  <table>
@@ -136,7 +136,7 @@ class ApplianceRegister extends connect(store)(PageView) {
136
136
  <input id="netmask" type="text" name="netmask" />
137
137
  </div>
138
138
 
139
- <mwc-button grid-span @click=${this.createAppliance.bind(this)} raised label="register"></mwc-button>
139
+ <md-elevated-button grid-span @click=${this.createAppliance.bind(this)}>register</md-elevated-button>
140
140
  </div>
141
141
  </form>
142
142
  </div>