@authhero/widget 0.38.9 → 0.38.10

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.
@@ -11,9 +11,8 @@ import { darkModeCssVarRules } from "./colors";
11
11
  import { buildThemePageBackground } from "./html";
12
12
  /**
13
13
  * Resolve the page-body layout (centering, background, font) from the theme
14
- * and branding. Keeps the inline `<body>` style (fragment path) and the
15
- * `auth0:head` stylesheet rule (full-document path) in sync so an Auth0-style
16
- * template centers on the page background just like the default chrome does.
14
+ * and branding, so an Auth0-style template centers on the page background just
15
+ * like the default chrome does.
17
16
  *
18
17
  * The "left"/"right" offsets below are the wide-viewport values; the mobile
19
18
  * block in `buildPageCss` collapses them back to centered under 768px.
@@ -202,6 +201,11 @@ export function buildPageCss(opts) {
202
201
  .widget-container {
203
202
  position: relative;
204
203
  z-index: 1;
204
+ /* Static for every tenant and every request, so it belongs here rather
205
+ than in the container's inline style — that inline style carries only
206
+ the per-tenant CSS variables, which leaves the media queries below
207
+ free to override the width by plain cascade. */
208
+ width: clamp(320px, 100%, 400px);
205
209
  /* Names this box as its own view-transition group so its size morphs
206
210
  smoothly across step navigations (see STEP TRANSITIONS above). */
207
211
  view-transition-name: ah-widget;
@@ -459,10 +463,11 @@ export function buildPageCss(opts) {
459
463
  background image or fills the viewport when there isn't one — the
460
464
  two variants are emitted conditionally at the end of this block.
461
465
 
462
- The !important flags are load-bearing: the body-fragment path sets
463
- the body layout inline (see buildBodyLayout) and the widget
464
- container's width inline (see buildWidgetContainerStyle), and an
465
- inline declaration outranks a normal rule from this stylesheet.
466
+ Everything below overrides the base rules by plain cascade — same
467
+ specificity, later in the sheet. That only holds because the body
468
+ layout and the container width are emitted into this stylesheet on
469
+ both render paths; an inline declaration would outrank them and each
470
+ rule here would need !important to be heard.
466
471
 
467
472
  Below this width a page_layout of "left"/"right" collapses to
468
473
  centered: the 80px offset only reads as a deliberate composition when
@@ -470,14 +475,22 @@ export function buildPageCss(opts) {
470
475
  narrow window the offset just pushes a 400px card off-centre (and, at
471
476
  the low end, off-screen). */
472
477
  @media (max-width: 767px) {
473
- body { justify-content: center !important; padding: 20px !important; }
478
+ body { justify-content: center; padding: 20px; }
474
479
  }
475
480
  @media (max-width: 480px) {
476
- /* Full width in both variants: overrides the inline
481
+ /* Column, so stretch runs horizontally and every in-flow wrapper
482
+ inherits the body's width. The widths below are percentages, which
483
+ need a definite containing block: body is otherwise a row flex box
484
+ whose item is content-sized, so a custom template that wraps the
485
+ widget in its own element makes the percentage cyclic and the card
486
+ shrink-to-fits to min-content (243px on a 375px phone). Vertical
487
+ centering carries over from the <=767px rule's justify-content. */
488
+ body { flex-direction: column; align-items: stretch; }
489
+ /* Full width in both variants: overrides the base
477
490
  clamp(320px, 100%, 400px), which would otherwise hold the card at
478
491
  400px with stray gutters on a 400-480px phone. */
479
- .widget-container { width: 100% !important; }
480
- .ah-widget-stack { width: 100% !important; }
492
+ .widget-container { width: 100%; }
493
+ .ah-widget-stack { width: 100%; }
481
494
  /* Every corner chip gives way to the footer bar, which carries the
482
495
  same content in a strip that can't overlap the form. */
483
496
  .ah-chip, .ah-chip-legal { display: none; }
@@ -495,7 +508,7 @@ ${hasBgImage
495
508
  attribute (see renderWidgetSSR). */
496
509
  @media (max-width: 480px) {
497
510
  /* Extra bottom padding keeps the floating card clear of the footer. */
498
- body { padding: 20px 20px 76px !important; }
511
+ body { padding: 20px 20px 76px; }
499
512
  .ah-bg-tint { display: block; }
500
513
  }`
501
514
  : `
@@ -506,8 +519,8 @@ ${hasBgImage
506
519
  the widget's own colour. Matches the widget stylesheet's default
507
520
  (non-\`floating\`) mobile layout. */
508
521
  @media (max-width: 480px) {
509
- body { background: ${widgetBackground} !important; padding: 0 !important; }
510
- html.ah-dark-mode body { background: #111827 !important; }
522
+ body { background: ${widgetBackground}; padding: 0; }
523
+ html.ah-dark-mode body { background: #111827; }
511
524
  .ah-bg-tint { display: none; }
512
525
  /* The full-bleed widget is exactly 100vh, so pad its bottom (a
513
526
  light-DOM rule on the host beats the :host rule in its shadow tree)
@@ -1,6 +1,6 @@
1
1
  import type { BrandingPageBackground, ThemePageBackground } from "./html";
2
- /** Layout values for the page `<body>` — shared by the body-fragment path
3
- * (applied inline) and the full-document path (emitted into the stylesheet). */
2
+ /** Layout values for the page `<body>` — emitted into the stylesheet by
3
+ * `buildPageCss` on both render paths. */
4
4
  export type BodyLayout = {
5
5
  background: string;
6
6
  fontFamily: string;
@@ -9,9 +9,8 @@ export type BodyLayout = {
9
9
  };
10
10
  /**
11
11
  * Resolve the page-body layout (centering, background, font) from the theme
12
- * and branding. Keeps the inline `<body>` style (fragment path) and the
13
- * `auth0:head` stylesheet rule (full-document path) in sync so an Auth0-style
14
- * template centers on the page background just like the default chrome does.
12
+ * and branding, so an Auth0-style template centers on the page background just
13
+ * like the default chrome does.
15
14
  *
16
15
  * The "left"/"right" offsets below are the wide-viewport values; the mobile
17
16
  * block in `buildPageCss` collapses them back to centered under 768px.
@@ -32,11 +31,10 @@ export declare function buildPageCss(opts: {
32
31
  */
33
32
  hasBgImage?: boolean;
34
33
  /**
35
- * Page-body layout (centering, background, font). Only the full-document
36
- * (Auth0-style) path passes this — there the tenant owns `<body>`, so the
37
- * centering/background that the body-fragment path applies inline must come
38
- * from the stylesheet instead. The fragment path omits it: its inline
39
- * `<body>` style already covers layout and wins over a stylesheet rule.
34
+ * Page-body layout (centering, background, font). Both render paths pass it:
35
+ * expressing the layout one way, in this stylesheet, is what lets the phone
36
+ * breakpoints below override it by plain cascade. Omit it only when the
37
+ * caller styles `<body>` itself.
40
38
  */
41
39
  bodyLayout?: BodyLayout;
42
40
  }): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authhero/widget",
3
- "version": "0.38.9",
3
+ "version": "0.38.10",
4
4
  "description": "Server-Driven UI widget for AuthHero authentication flows",
5
5
  "repository": {
6
6
  "type": "git",