@ciromaciel/auth-react 1.5.0 → 1.7.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
@@ -160,6 +160,16 @@ organization and on which plan, then one list of actions with "Sair" last.
160
160
  thing.
161
161
  - `items` are your app's own rows, passed as data (`{ id, label, icon, onClick }`), shown in their
162
162
  own group after billing. The component takes no JSX, so every app's card keeps the same shape.
163
+ A row may add `description` (one line saying what it does) and `tone: 'danger'` (red, for what
164
+ cannot be undone); `itemsLabel` titles the group:
165
+
166
+ ```jsx
167
+ itemsLabel="Seus dados"
168
+ items={[
169
+ { id: 'export', label: 'Exportar', description: 'Uma cópia de tudo, em JSON', icon: IconDownload, onClick: exportAll },
170
+ { id: 'erase', label: 'Apagar tudo', description: 'Sem volta', tone: 'danger', icon: IconTrash, onClick: eraseAll },
171
+ ]}
172
+ ```
163
173
  - `plan` and `organization` draw the context strip; leave them out and it is not drawn.
164
174
  `limit: null` hides the usage bar.
165
175
  - The strip informs; "Assinatura" is the way to billing. The strip adds a "Fazer upgrade"
@@ -170,6 +180,29 @@ organization and on which plan, then one list of actions with "Sair" last.
170
180
  cites. `termsUrl` points it elsewhere, `termsUrl={null}` drops the link, and `branded={false}`
171
181
  removes the footer.
172
182
 
183
+ ### The account screen
184
+
185
+ `<UserProfile />` is what "Conta" on the account card opens: the photo, the name and the email;
186
+ the ways in; and the devices with an open session.
187
+
188
+ ```jsx
189
+ <UserProfile opened={opened} onClose={close} />
190
+ ```
191
+
192
+ - Every text defaults to Portuguese. `labels` changes a word (`labels={{ edit: 'Editar' }}`);
193
+ a panel does not need it to translate the screen.
194
+ - Name and photo are edited in place: "Alterar" opens the field on the same row, Enter saves,
195
+ Esc cancels and leaves the screen open. The email does not change here, and says why: it is
196
+ where the sign-in code arrives.
197
+ - "Formas de entrar" lists the emailed code, which always works, and the providers the
198
+ application enabled, with "Conectar" and "Desconectar". With none enabled, the group is not
199
+ drawn. `showSignInMethods={false}` hides it.
200
+ - The sessions sit on one line ("2 sessões abertas", and which one is this device); a click
201
+ opens the list right below. The current device comes first and cannot be ended from here —
202
+ that is "Sair". "Encerrar as outras" asks before ending them.
203
+ - Failures are shown on the screen, next to what failed. `onError` still receives the error,
204
+ with `{ section, isShownOnScreen: true }`; do not show it a second time.
205
+
173
206
  ## API
174
207
 
175
208
  ### Components
@@ -177,7 +210,7 @@ organization and on which plan, then one list of actions with "Sair" last.
177
210
  | Component | Description |
178
211
  | ------------------------- | ------------------------------------------------------------ |
179
212
  | `<SignIn />` | The whole way in: asks for the email, then takes the code |
180
- | `<UserProfile />` | User profile management modal |
213
+ | `<UserProfile />` | The account screen: profile, ways in, open sessions |
181
214
  | `<UserInformation />` | The account card: who, where, which plan, then the actions |
182
215
  | `<SocialButtons />` | Sign-in buttons for the providers the application enabled |
183
216
  | `<AuthCard />` | The card shell the screens are built on |