@lessly/ui 0.23.0 → 0.25.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/dist/index.d.ts +12 -3
- package/dist/index.js +10 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1477,6 +1477,12 @@ interface BetaGateScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivElement
|
|
|
1477
1477
|
/** Fires with the trimmed code. The screen never checks it — the caller does. */
|
|
1478
1478
|
onSubmit: (code: string) => void;
|
|
1479
1479
|
defaultCode?: string;
|
|
1480
|
+
/** Fires with the raw field value on every keystroke — the seam a caller uses to clear
|
|
1481
|
+
* its own `error` as the user starts correcting the code. */
|
|
1482
|
+
onCodeChange?: (code: string) => void;
|
|
1483
|
+
/** Focuses the access-code field on mount. On by default: the screen is one field, so
|
|
1484
|
+
* that is where the caret belongs. Pass `false` to leave the focus alone. */
|
|
1485
|
+
autoFocus?: boolean;
|
|
1480
1486
|
/** Disables the submit button and swaps its label while the caller's check is in flight. */
|
|
1481
1487
|
submitting?: boolean;
|
|
1482
1488
|
/** Rendered as an alert above the field — typically a rejected code. */
|
|
@@ -1495,6 +1501,7 @@ interface BetaGateScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivElement
|
|
|
1495
1501
|
/** Rendered top-right. Defaults to the kit's own `ThemeToggle`; pass your own node to
|
|
1496
1502
|
* replace it, or `null` to drop it. */
|
|
1497
1503
|
themeToggle?: React$1.ReactNode;
|
|
1504
|
+
/** Pass `null` to render no page heading — same meaning as on `SignupScreen`. */
|
|
1498
1505
|
title?: React$1.ReactNode;
|
|
1499
1506
|
description?: React$1.ReactNode;
|
|
1500
1507
|
/** Muted footer signature. Absent by default; pass a node to render one. */
|
|
@@ -1506,7 +1513,7 @@ interface BetaGateScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivElement
|
|
|
1506
1513
|
* validates the code, never calls an API and never navigates; the caller handles the
|
|
1507
1514
|
* outcome of `onSubmit`.
|
|
1508
1515
|
*/
|
|
1509
|
-
declare function BetaGateScreen({ onSubmit, defaultCode, submitting, error, socialAuth, waitlistHref, signInHref, onSignIn, submitLabel, logo, themeToggle, title, description, footer, ...props }: BetaGateScreenProps): React$1.JSX.Element;
|
|
1516
|
+
declare function BetaGateScreen({ onSubmit, defaultCode, onCodeChange, autoFocus, submitting, error, socialAuth, waitlistHref, signInHref, onSignIn, submitLabel, logo, themeToggle, title, description, footer, ...props }: BetaGateScreenProps): React$1.JSX.Element;
|
|
1510
1517
|
|
|
1511
1518
|
/** The submit payload — what a registration endpoint takes, minus anything the caller owns
|
|
1512
1519
|
* (the beta code, the invite, the return URL). */
|
|
@@ -1544,6 +1551,7 @@ interface SignupScreenProps extends Omit<React$1.HTMLAttributes<HTMLDivElement>,
|
|
|
1544
1551
|
/** Rendered top-right. Defaults to the kit's own `ThemeToggle`; pass your own node to
|
|
1545
1552
|
* replace it, or `null` to drop it. */
|
|
1546
1553
|
themeToggle?: React$1.ReactNode;
|
|
1554
|
+
/** Pass `null` to render no page heading — for a body (MFA steps) that brings its own. */
|
|
1547
1555
|
title?: React$1.ReactNode;
|
|
1548
1556
|
description?: React$1.ReactNode;
|
|
1549
1557
|
/** Muted footer signature. Absent by default; pass a node to render one. */
|
|
@@ -1583,8 +1591,9 @@ interface OrganizationOnboardingDefaults {
|
|
|
1583
1591
|
beneficial_owners?: BeneficialOwnerPayload[];
|
|
1584
1592
|
}
|
|
1585
1593
|
interface OrganizationOnboardingFormProps {
|
|
1586
|
-
/** Makes the country of incorporation
|
|
1587
|
-
*
|
|
1594
|
+
/** Makes the country of incorporation mandatory. Mirrors the server-side requirement the
|
|
1595
|
+
* consumer is configured for. The ownership confirmation is required whenever it is shown,
|
|
1596
|
+
* independently of this flag. */
|
|
1588
1597
|
requireSanctionsFields: boolean;
|
|
1589
1598
|
onSubmit: (payload: OrganizationOnboardingPayload) => void;
|
|
1590
1599
|
defaultValues?: OrganizationOnboardingDefaults;
|
package/dist/index.js
CHANGED
|
@@ -5266,7 +5266,7 @@ function OnboardingScreenShell({
|
|
|
5266
5266
|
},
|
|
5267
5267
|
children: [
|
|
5268
5268
|
logo && /* @__PURE__ */ jsx80("div", { className: "mb-[22px] flex items-center justify-center text-[24px] font-bold leading-none tracking-[-0.02em] text-text-primary", children: logo }),
|
|
5269
|
-
/* @__PURE__ */ jsx80(
|
|
5269
|
+
title != null && /* @__PURE__ */ jsx80(
|
|
5270
5270
|
"h1",
|
|
5271
5271
|
{
|
|
5272
5272
|
className: cn(
|
|
@@ -5295,6 +5295,8 @@ var LINK = "font-medium text-text-link hover:text-text-link-hover";
|
|
|
5295
5295
|
function BetaGateScreen({
|
|
5296
5296
|
onSubmit,
|
|
5297
5297
|
defaultCode = "",
|
|
5298
|
+
onCodeChange,
|
|
5299
|
+
autoFocus = true,
|
|
5298
5300
|
submitting,
|
|
5299
5301
|
error,
|
|
5300
5302
|
socialAuth,
|
|
@@ -5354,8 +5356,12 @@ function BetaGateScreen({
|
|
|
5354
5356
|
"data-testid": "beta-code-input",
|
|
5355
5357
|
value: code,
|
|
5356
5358
|
autoComplete: "off",
|
|
5359
|
+
autoFocus,
|
|
5357
5360
|
placeholder: "Lessly beta access code",
|
|
5358
|
-
onChange: (event) =>
|
|
5361
|
+
onChange: (event) => {
|
|
5362
|
+
setCode(event.target.value);
|
|
5363
|
+
onCodeChange?.(event.target.value);
|
|
5364
|
+
}
|
|
5359
5365
|
}
|
|
5360
5366
|
)
|
|
5361
5367
|
] }),
|
|
@@ -5606,7 +5612,7 @@ function OrganizationOnboardingForm({
|
|
|
5606
5612
|
);
|
|
5607
5613
|
const needsOwnershipConfirmation = !hasController;
|
|
5608
5614
|
const missingCountry = requireSanctionsFields && countryOfIncorporation === "";
|
|
5609
|
-
const missingConfirmation =
|
|
5615
|
+
const missingConfirmation = needsOwnershipConfirmation && !ownershipConfirmed;
|
|
5610
5616
|
const canSubmit = trimmed !== "" && ownersValid && !missingCountry && !missingConfirmation && !submitting;
|
|
5611
5617
|
const addOwner = () => {
|
|
5612
5618
|
if (owners.length >= MAX_BENEFICIAL_OWNERS) return;
|
|
@@ -5825,7 +5831,7 @@ function OrganizationOnboardingForm({
|
|
|
5825
5831
|
className: "text-xs font-normal leading-snug",
|
|
5826
5832
|
children: [
|
|
5827
5833
|
"I confirm the ownership structure above is complete and correct",
|
|
5828
|
-
|
|
5834
|
+
/* @__PURE__ */ jsx83("span", { className: "text-text-danger", children: " *" })
|
|
5829
5835
|
]
|
|
5830
5836
|
}
|
|
5831
5837
|
)
|