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