@ciromaciel/auth-react 1.4.1 → 1.6.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.
package/README.md CHANGED
@@ -151,7 +151,7 @@ organization and on which plan, then one list of actions with "Sair" last.
151
151
  onAccountClick={openAccount}
152
152
  onBillingClick={openBilling}
153
153
  items={[{ id: 'docs', label: 'Documentação', icon: IconFileText, onClick: openDocs }]}
154
- plan={{ name: 'Pro', used: 3, limit: 9, unit: 'projetos', onClick: openPlans }}
154
+ plan={{ name: 'Pro', used: 8, limit: 9, unit: 'projetos', canUpgrade: true, onClick: openPlans }}
155
155
  organization={{ name: 'Acme', role: 'owner' }}
156
156
  />
157
157
  ```
@@ -162,10 +162,37 @@ organization and on which plan, then one list of actions with "Sair" last.
162
162
  own group after billing. The component takes no JSX, so every app's card keeps the same shape.
163
163
  - `plan` and `organization` draw the context strip; leave them out and it is not drawn.
164
164
  `limit: null` hides the usage bar.
165
+ - The strip informs; "Assinatura" is the way to billing. The strip adds a "Fazer upgrade"
166
+ invite only when `canUpgrade` is `true` (there is a plan above this one) and usage is at 80%
167
+ of the limit or more. At the limit, the bar and the count turn red and "Limite atingido" appears on the badge's line.
168
+ `plan.onClick` is what the invite opens; `actionLabel` renames it.
165
169
  - The footer reads "Protegido por Auth" with a "Termos" link to the same terms the sign-in
166
170
  cites. `termsUrl` points it elsewhere, `termsUrl={null}` drops the link, and `branded={false}`
167
171
  removes the footer.
168
172
 
173
+ ### The account screen
174
+
175
+ `<UserProfile />` is what "Conta" on the account card opens: the photo, the name and the email;
176
+ the ways in; and the devices with an open session.
177
+
178
+ ```jsx
179
+ <UserProfile opened={opened} onClose={close} />
180
+ ```
181
+
182
+ - Every text defaults to Portuguese. `labels` changes a word (`labels={{ edit: 'Editar' }}`);
183
+ a panel does not need it to translate the screen.
184
+ - Name and photo are edited in place: "Alterar" opens the field on the same row, Enter saves,
185
+ Esc cancels and leaves the screen open. The email does not change here, and says why: it is
186
+ where the sign-in code arrives.
187
+ - "Formas de entrar" lists the emailed code, which always works, and the providers the
188
+ application enabled, with "Conectar" and "Desconectar". With none enabled, the group is not
189
+ drawn. `showSignInMethods={false}` hides it.
190
+ - The sessions sit on one line ("2 sessões abertas", and which one is this device); a click
191
+ opens the list right below. The current device comes first and cannot be ended from here —
192
+ that is "Sair". "Encerrar as outras" asks before ending them.
193
+ - Failures are shown on the screen, next to what failed. `onError` still receives the error,
194
+ with `{ section, isShownOnScreen: true }`; do not show it a second time.
195
+
169
196
  ## API
170
197
 
171
198
  ### Components
@@ -173,7 +200,7 @@ organization and on which plan, then one list of actions with "Sair" last.
173
200
  | Component | Description |
174
201
  | ------------------------- | ------------------------------------------------------------ |
175
202
  | `<SignIn />` | The whole way in: asks for the email, then takes the code |
176
- | `<UserProfile />` | User profile management modal |
203
+ | `<UserProfile />` | The account screen: profile, ways in, open sessions |
177
204
  | `<UserInformation />` | The account card: who, where, which plan, then the actions |
178
205
  | `<SocialButtons />` | Sign-in buttons for the providers the application enabled |
179
206
  | `<AuthCard />` | The card shell the screens are built on |