@ciromaciel/auth-react 1.4.0 → 1.4.1

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
@@ -162,7 +162,9 @@ 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
- - `branded={false}` removes the "Protegido por Auth" line.
165
+ - The footer reads "Protegido por Auth" with a "Termos" link to the same terms the sign-in
166
+ cites. `termsUrl` points it elsewhere, `termsUrl={null}` drops the link, and `branded={false}`
167
+ removes the footer.
166
168
 
167
169
  ## API
168
170
 
package/dist/index.esm.js CHANGED
@@ -2533,17 +2533,13 @@ function Wordmark({
2533
2533
  });
2534
2534
  }
2535
2535
 
2536
+ // Where the terms live. Hardcoded on purpose, like `API_BASE` in authSdk.js:
2537
+ // this ships inside the published bundle, and every screen of the seven panels
2538
+ // that links to the terms — the sign-in notice and the account card's footer —
2539
+ // must point at the same document. `termsUrl` overrides it for whoever hosts
2540
+ // their own.
2536
2541
  const TERMS_URL = 'https://myinfrastructure.click/legal/terms';
2537
2542
 
2538
- /**
2539
- * The terms notice under the first step.
2540
- *
2541
- * It sits on step ONE and nowhere else: the account is born on the first
2542
- * `verify` and there is no separate sign-up screen to put it on — this form IS
2543
- * the sign-up for whoever has never entered. On step two the person already
2544
- * agreed by asking for the code; repeating it there would only push the code
2545
- * field down.
2546
- */
2547
2543
  function TermsNotice({
2548
2544
  url,
2549
2545
  text,
@@ -4017,7 +4013,9 @@ const ROLE_LABELS = {
4017
4013
  * @param {UserInformationItem[]} [props.items] - The panel's own rows, shown in their own group
4018
4014
  * @param {UserInformationPlan} [props.plan] - The plan strip; omitted, the strip is not drawn
4019
4015
  * @param {UserInformationOrganization} [props.organization] - Where the person is acting
4020
- * @param {boolean} [props.branded=true] - The "Protegido por Auth" line
4016
+ * @param {boolean} [props.branded=true] - The footer: "Protegido por Auth" and the terms link
4017
+ * @param {string|null} [props.termsUrl] - Where "Termos" points; `null` removes the link
4018
+ * @param {string} [props.termsLabel='Termos']
4021
4019
  * @param {string} [props.accountLabel='Conta']
4022
4020
  * @param {string} [props.billingLabel='Assinatura']
4023
4021
  * @param {string} [props.signOutLabel='Sair']
@@ -4031,6 +4029,8 @@ function UserInformation({
4031
4029
  plan,
4032
4030
  organization,
4033
4031
  branded = true,
4032
+ termsUrl = TERMS_URL,
4033
+ termsLabel = 'Termos',
4034
4034
  accountLabel = 'Conta',
4035
4035
  billingLabel = 'Assinatura',
4036
4036
  signOutLabel = 'Sair',
@@ -4138,23 +4138,39 @@ function UserInformation({
4138
4138
  hasDivider: true
4139
4139
  })]
4140
4140
  }), branded && /*#__PURE__*/jsxs(Group, {
4141
- justify: "center",
4142
- gap: 4,
4143
- py: 8,
4141
+ justify: termsUrl ? 'space-between' : 'center',
4142
+ gap: 8,
4143
+ px: 16,
4144
+ py: 10,
4144
4145
  bg: "gray.1",
4145
4146
  style: {
4146
4147
  borderTop: '1px solid var(--mantine-color-gray-2)'
4147
4148
  },
4148
- children: [/*#__PURE__*/jsx(Text, {
4149
+ children: [/*#__PURE__*/jsxs(Text, {
4149
4150
  fz: 11,
4150
4151
  fw: 500,
4151
4152
  c: "gray.5",
4152
- children: "Protegido por"
4153
- }), /*#__PURE__*/jsx(Text, {
4153
+ children: ["Protegido por", ' ', /*#__PURE__*/jsx(Text, {
4154
+ span: true,
4155
+ inherit: true,
4156
+ fw: 800,
4157
+ c: "gray.7",
4158
+ children: "Auth"
4159
+ })]
4160
+ }), termsUrl && /*#__PURE__*/jsx(Anchor, {
4161
+ href: termsUrl
4162
+ /*
4163
+ * A new tab, like the sign-in's notice: the card sits
4164
+ * over a working panel, and reading the terms must
4165
+ * not navigate away from it.
4166
+ */,
4167
+ target: "_blank",
4168
+ rel: "noopener noreferrer",
4154
4169
  fz: 11,
4155
- fw: 800,
4156
- c: "gray.7",
4157
- children: "Auth"
4170
+ fw: 500,
4171
+ c: "gray.5",
4172
+ underline: "always",
4173
+ children: termsLabel
4158
4174
  })]
4159
4175
  })]
4160
4176
  });