@akinon/pz-theme 2.0.95-beta.1 → 2.0.95-rc.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +33 -15
  2. package/package.json +4 -4
  3. package/src/__tests__/auth-commerce-events.test.tsx +1 -5
  4. package/src/__tests__/auth-form-error-block.test.tsx +0 -2
  5. package/src/__tests__/auth-form-validation.test.tsx +0 -2
  6. package/src/__tests__/auth-slot-coverage.test.ts +1 -9
  7. package/src/__tests__/auth-step-title.test.tsx +0 -2
  8. package/src/__tests__/detached-submit-state.test.tsx +2 -80
  9. package/src/__tests__/forgot-password-composed.test.tsx +0 -2
  10. package/src/__tests__/otp-form-composed.test.tsx +0 -2
  11. package/src/__tests__/password-reset-step.test.tsx +0 -2
  12. package/src/__tests__/register-form-composed.test.tsx +4 -253
  13. package/src/__tests__/registry-parity.test.ts +0 -12
  14. package/src/auth/auth-field-errors.tsx +0 -31
  15. package/src/blocks/account-button-block.tsx +0 -25
  16. package/src/blocks/add-to-cart-block.tsx +0 -15
  17. package/src/blocks/auth-field-block.tsx +3 -13
  18. package/src/blocks/auth-flow-block.tsx +3 -45
  19. package/src/blocks/auth-form-block.tsx +54 -337
  20. package/src/blocks/block-renderer-registry.tsx +0 -8
  21. package/src/blocks/button-block.tsx +13 -43
  22. package/src/blocks/change-password-form-block.tsx +0 -15
  23. package/src/blocks/forgot-password-block.tsx +9 -132
  24. package/src/blocks/newsletter-form-block.tsx +0 -16
  25. package/src/blocks/otp-form-block.tsx +67 -161
  26. package/src/blocks/profile-form-block.tsx +0 -13
  27. package/src/blocks/register-form-block.tsx +110 -362
  28. package/src/chrome/__tests__/theme-config-source.test.ts +1 -2
  29. package/src/chrome/placeholder-slugs.ts +0 -3
  30. package/src/chrome/route-slug.ts +0 -11
  31. package/src/index.ts +0 -10
  32. package/src/overlays/__tests__/modal-registry.test.ts +1 -5
  33. package/src/overlays/modal-chrome-css.ts +1 -8
  34. package/src/overlays/modal-preview-host.tsx +2 -7
  35. package/src/overlays/modal-registry.ts +1 -38
  36. package/src/overlays/overlay-surface.tsx +0 -23
  37. package/src/overlays/overlay-tokens.ts +0 -12
  38. package/src/overlays/theme-modal-mount.tsx +6 -85
  39. package/src/utils/visibility-rules.ts +0 -114
  40. package/src/__tests__/auth-captcha.test.tsx +0 -261
  41. package/src/__tests__/auth-destination.test.tsx +0 -348
  42. package/src/__tests__/auth-error-reading.test.ts +0 -232
  43. package/src/__tests__/auth-flow-scope.test.tsx +0 -162
  44. package/src/__tests__/auth-form-success-block.test.tsx +0 -429
  45. package/src/__tests__/block-action-audience.test.ts +0 -154
  46. package/src/__tests__/form-state-composition.test.tsx +0 -484
  47. package/src/__tests__/modal-login-close.test.tsx +0 -366
  48. package/src/__tests__/reset-password-composed.test.tsx +0 -385
  49. package/src/auth/auth-captcha.tsx +0 -125
  50. package/src/auth/auth-destination.ts +0 -168
  51. package/src/auth/form-state-context.tsx +0 -170
  52. package/src/auth/form-success-context.tsx +0 -56
  53. package/src/auth/read-auth-error.ts +0 -332
  54. package/src/blocks/auth-success-block.tsx +0 -85
  55. package/src/blocks/captcha-block.tsx +0 -61
  56. package/src/blocks/form-state-block.tsx +0 -84
  57. package/src/blocks/reset-password-block.tsx +0 -717
  58. package/src/overlays/__tests__/modal-loading.test.tsx +0 -235
  59. package/src/overlays/modal-host-context.tsx +0 -66
  60. package/src/overlays/overlay-loading.tsx +0 -144
@@ -1,84 +0,0 @@
1
- 'use client';
2
-
3
- import React from 'react';
4
-
5
- import { readFormStateKey } from '../auth/form-state-context';
6
- import { partAttrs } from '../utils';
7
- import { renderComposedChildren } from './render-composed-children';
8
- import { BlockRendererProps } from './block-renderer-registry';
9
- import { DesignerPlaceholder } from './product-block-utils';
10
-
11
- /**
12
- * One SCREEN of a composed form, as a named wrapper whose contents are
13
- * ordinary child blocks.
14
- *
15
- * This is what makes "the confirmation can be a line of text, or a whole
16
- * component" true: the confirmation is whatever the designer puts in here — a
17
- * Text block, or an icon and a heading and a Button, or the Form Success block
18
- * that carries the form's own sentence. Same for the refusal, the busy moment,
19
- * and the dead-link screen a password reset can land on. Before this, every
20
- * state except the form itself was the form's own markup with one authored
21
- * string in it.
22
- *
23
- * Deliberately shaped like `otp-phase` and `auth-step`, and for the same
24
- * reason: the container decides NOTHING about its own visibility. The form it
25
- * stands in draws the containers whose state matches — see
26
- * `auth/form-state-context.tsx` — so dropped anywhere else this is just a
27
- * labelled column whose children always show, which is what keeps it dressable
28
- * on its own.
29
- *
30
- * Properties: formState.
31
- * Parts: state.
32
- */
33
- const FormStateBlock = ({
34
- block,
35
- placeholderId,
36
- sectionId,
37
- isDesigner = false,
38
- selectedBlockId,
39
- currentBreakpoint = 'desktop'
40
- }: BlockRendererProps) => {
41
- const formState = readFormStateKey(block, currentBreakpoint);
42
-
43
- const childBlocks = (block.blocks || [])
44
- .filter((childBlock) => (isDesigner ? true : !childBlock.hidden))
45
- .sort((a, b) => (a.order || 0) - (b.order || 0));
46
-
47
- // An empty container draws nothing a shopper could see; in the canvas it has
48
- // to say what it is waiting for, or adding one looks like nothing happened.
49
- if (childBlocks.length === 0 && !isDesigner) return null;
50
-
51
- return (
52
- <div
53
- data-form-state=""
54
- // Fills its block wrapper; see the note in auth-step-block.tsx.
55
- className="w-full"
56
- data-form-state-key={formState || undefined}
57
- {...partAttrs('state')}
58
- style={{
59
- display: 'flex',
60
- flexDirection: 'column',
61
- gap: 'var(--form-state-gap, 12px)'
62
- }}
63
- >
64
- {childBlocks.length === 0 ? (
65
- <DesignerPlaceholder
66
- label={`Form state${
67
- formState ? ` · ${formState}` : ''
68
- } (drop its content here)`}
69
- />
70
- ) : (
71
- renderComposedChildren({
72
- blocks: childBlocks,
73
- placeholderId,
74
- sectionId,
75
- isDesigner,
76
- selectedBlockId,
77
- currentBreakpoint
78
- })
79
- )}
80
- </div>
81
- );
82
- };
83
-
84
- export default FormStateBlock;