@lessly/ui 0.23.0 → 0.24.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 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. */
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) => setCode(event.target.value)
5361
+ onChange: (event) => {
5362
+ setCode(event.target.value);
5363
+ onCodeChange?.(event.target.value);
5364
+ }
5359
5365
  }
5360
5366
  )
5361
5367
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lessly/ui",
3
- "version": "0.23.0",
3
+ "version": "0.24.0",
4
4
  "description": "Lessly design system — shared UI primitives, tokens, and theme",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.30.3",