@proyecto-viviana/solidaria-components 0.3.0 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,KAAK,GAAG,EACR,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,aAAa,EAMd,MAAM,UAAU,CAAC;AAGlB;;GAEG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,MAAM,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,GAAG,CAAC,aAAa,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,GAAG,CAAC,aAAa,CAAC,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IAC7B,yGAAyG;IACzG,KAAK,CAAC,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC;IAC/B,wGAAwG;IACxG,KAAK,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,gDAAgD;IAChD,KAAK,EAAE,QAAQ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;AAEF;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,EAAE,GAAG,SAAS,CAEnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,EACzF,MAAM,EAAE,CAAC,GACR,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAYpC;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAUnF;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvE,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,CAAC,CAqCH;AAED,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;IACtB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,eAAe,CAmBrD,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,IAAI,QAAQ,CAAC,OAAO,CAAC,CAqBjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proyecto-viviana/solidaria-components",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Pre-wired headless components for SolidJS - port of react-aria-components",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@internationalized/date": "^3.8.0",
41
- "@proyecto-viviana/solidaria": "0.3.0",
42
- "@proyecto-viviana/solid-stately": "0.3.0"
41
+ "@proyecto-viviana/solid-stately": "0.3.0",
42
+ "@proyecto-viviana/solidaria": "0.3.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "solid-js": "^1.9.11"
package/src/Modal.tsx CHANGED
@@ -479,7 +479,14 @@ function ModalContent(
479
479
 
480
480
  const renderProps = useRenderProps(
481
481
  {
482
- children: props.children,
482
+ // Lazy: the modal content is gated behind `<Show when={isHydrated() && …}>`
483
+ // (Portal) below, so it must not be instantiated during the component body.
484
+ // An eager `children: props.children` would build the content template (and
485
+ // walk getNextElement) before the gate — content the server never emitted →
486
+ // hydration mismatch. See Popover for the full rationale.
487
+ get children() {
488
+ return props.children;
489
+ },
483
490
  class: local.class,
484
491
  style: local.style,
485
492
  defaultClassName: "solidaria-Modal",
package/src/Popover.tsx CHANGED
@@ -407,7 +407,16 @@ export function Popover(props: PopoverProps): JSX.Element {
407
407
 
408
408
  const renderProps = useRenderProps(
409
409
  {
410
- children: props.children,
410
+ // Read children lazily. The popover content is gated behind
411
+ // `<Show when={isHydrated() && …}>` below, so it must NOT be instantiated
412
+ // during the component body. An eager `children: props.children` reads the
413
+ // child getter at object-construction time, building the content template
414
+ // (and walking `getNextElement`) before the gate — which the server, with
415
+ // the gate closed, never emitted → hydration mismatch. The getter defers
416
+ // the read until `renderChildren()` runs inside the gated overlay.
417
+ get children() {
418
+ return props.children;
419
+ },
411
420
  class: local.class,
412
421
  style: local.style,
413
422
  defaultClassName: "solidaria-Popover",
package/src/Toast.tsx CHANGED
@@ -252,7 +252,13 @@ export function ToastRegion(props: ToastRegionProps): JSX.Element {
252
252
 
253
253
  const renderProps = useRenderProps(
254
254
  {
255
- children: props.children,
255
+ // Lazy: the region content is gated behind `<Show when={isHydrated() && …}>`
256
+ // (Portal) below, so reading children must not instantiate templates during
257
+ // the component body (would walk getNextElement before the gate the server
258
+ // kept closed → hydration mismatch). See Popover for the full rationale.
259
+ get children() {
260
+ return props.children;
261
+ },
256
262
  class: local.class,
257
263
  style: local.style,
258
264
  defaultClassName: "solidaria-ToastRegion",
package/src/utils.tsx CHANGED
@@ -334,13 +334,17 @@ export function useIsHydrated(): Accessor<boolean> {
334
334
  return () => false;
335
335
  }
336
336
 
337
- // On client, start false and switch to true after animation frame
338
- // This ensures we're past the hydration phase
337
+ // On client, start false (so the first render matches the server, which
338
+ // emitted nothing for hydrated-gated content) and flip to true after mount.
339
339
  const [isHydrated, setIsHydrated] = createSignal(false);
340
340
 
341
- // Use requestAnimationFrame to ensure we're past hydration
342
- // onMount may not fire during hydration for matching DOM
343
- requestAnimationFrame(() => {
341
+ // onMount runs in the effect phase — *after* the synchronous hydration pass
342
+ // has finished walking the server DOM so flipping here renders the gated
343
+ // content as a fresh client-side update (Portal: no getNextElement walk, no
344
+ // mismatch), yet fires synchronously under `render()` (unit tests / pure CSR)
345
+ // where requestAnimationFrame would never run. This mirrors the component
346
+ // gate above and is strictly earlier than a rAF tick.
347
+ onMount(() => {
344
348
  setIsHydrated(true);
345
349
  });
346
350