@thorprovider/blocks 0.1.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 (184) hide show
  1. package/.turbo/turbo-build.log +24 -0
  2. package/.turbo/turbo-test.log +10 -0
  3. package/.turbo/turbo-type-check.log +0 -0
  4. package/AGENTS.md +1 -0
  5. package/README.md +161 -0
  6. package/components.json +33 -0
  7. package/dist/.tsbuildinfo +1 -0
  8. package/dist/contracts.d.mts +563 -0
  9. package/dist/contracts.d.ts +563 -0
  10. package/dist/contracts.js +207 -0
  11. package/dist/contracts.js.map +1 -0
  12. package/dist/contracts.mjs +168 -0
  13. package/dist/contracts.mjs.map +1 -0
  14. package/dist/index.d.mts +2408 -0
  15. package/dist/index.d.ts +2408 -0
  16. package/dist/index.js +16422 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/index.mjs +16352 -0
  19. package/dist/index.mjs.map +1 -0
  20. package/docs/standards/data-contracts.md +70 -0
  21. package/docs/standards/theming.md +85 -0
  22. package/package.json +62 -0
  23. package/src/blocks/application/app-shells/app-shell-1-sidebar.tsx +198 -0
  24. package/src/blocks/application/app-shells/app-shell-1.tsx +196 -0
  25. package/src/blocks/application/login-forms/login-page-1.tsx +246 -0
  26. package/src/blocks/application/login-forms/login-page-2.tsx +207 -0
  27. package/src/blocks/application/password-recovery/forgot-password-page-1-brand-mark.tsx +38 -0
  28. package/src/blocks/application/password-recovery/forgot-password-page-1.tsx +320 -0
  29. package/src/blocks/application/signup-forms/signup-page-1.tsx +231 -0
  30. package/src/blocks/application/verification/verify-1.tsx +307 -0
  31. package/src/blocks/application/verification/verify-confetti.tsx +192 -0
  32. package/src/blocks/e-commerce/category-filters/category-filter-1.tsx +260 -0
  33. package/src/blocks/e-commerce/category-filters/category-filter-2-filter-panel.tsx +179 -0
  34. package/src/blocks/e-commerce/category-filters/category-filter-2.tsx +341 -0
  35. package/src/blocks/e-commerce/category-filters/category-filter-4-chip-rail.tsx +57 -0
  36. package/src/blocks/e-commerce/category-filters/category-filter-4-drawer.tsx +124 -0
  37. package/src/blocks/e-commerce/category-filters/category-filter-4-fields.tsx +170 -0
  38. package/src/blocks/e-commerce/category-filters/category-filter-4-sidebar.tsx +52 -0
  39. package/src/blocks/e-commerce/category-filters/category-filter-4-sort-sheet.tsx +57 -0
  40. package/src/blocks/e-commerce/category-filters/category-filter-4-state.ts +68 -0
  41. package/src/blocks/e-commerce/category-filters/category-filter-4.tsx +298 -0
  42. package/src/blocks/e-commerce/checkout-forms/card-formatting.test.ts +47 -0
  43. package/src/blocks/e-commerce/checkout-forms/card-formatting.ts +9 -0
  44. package/src/blocks/e-commerce/checkout-forms/checkbox-check.tsx +74 -0
  45. package/src/blocks/e-commerce/checkout-forms/checkout-confirmation-fulfilment-progress.tsx +189 -0
  46. package/src/blocks/e-commerce/checkout-forms/checkout-confirmation.tsx +283 -0
  47. package/src/blocks/e-commerce/checkout-forms/checkout-field-feedback.tsx +29 -0
  48. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-contact-step.tsx +96 -0
  49. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-country-field.tsx +51 -0
  50. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-order-summary.tsx +139 -0
  51. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-payment-step.tsx +184 -0
  52. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-progress.tsx +36 -0
  53. package/src/blocks/e-commerce/checkout-forms/checkout-form-1-shipping-step.tsx +107 -0
  54. package/src/blocks/e-commerce/checkout-forms/checkout-form-1.tsx +235 -0
  55. package/src/blocks/e-commerce/checkout-forms/checkout-form-2-order-summary.tsx +130 -0
  56. package/src/blocks/e-commerce/checkout-forms/checkout-form-2-payment-card.tsx +175 -0
  57. package/src/blocks/e-commerce/checkout-forms/checkout-form-2-shipping-card.tsx +190 -0
  58. package/src/blocks/e-commerce/checkout-forms/checkout-form-2.tsx +312 -0
  59. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-information-step.tsx +91 -0
  60. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-order-summary.tsx +110 -0
  61. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-payment-step.tsx +137 -0
  62. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-progress.tsx +68 -0
  63. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-review-step.tsx +79 -0
  64. package/src/blocks/e-commerce/checkout-forms/checkout-form-3-shipping-step.tsx +172 -0
  65. package/src/blocks/e-commerce/checkout-forms/checkout-form-3.tsx +392 -0
  66. package/src/blocks/e-commerce/checkout-forms/checkout-form-types.ts +7 -0
  67. package/src/blocks/e-commerce/navigation/category-icon.test.tsx +54 -0
  68. package/src/blocks/e-commerce/navigation/category-icon.tsx +94 -0
  69. package/src/blocks/e-commerce/navigation/mega-menu.test.tsx +139 -0
  70. package/src/blocks/e-commerce/navigation/mega-menu.tsx +271 -0
  71. package/src/blocks/e-commerce/navigation/mobile-category-drawer.test.tsx +152 -0
  72. package/src/blocks/e-commerce/navigation/mobile-category-drawer.tsx +276 -0
  73. package/src/blocks/e-commerce/order-history/order-history-1.tsx +159 -0
  74. package/src/blocks/e-commerce/order-history/order-history-2.tsx +222 -0
  75. package/src/blocks/e-commerce/product-categories/avatar-group.tsx +86 -0
  76. package/src/blocks/e-commerce/product-categories/product-category-1.tsx +126 -0
  77. package/src/blocks/e-commerce/product-categories/product-category-2.tsx +100 -0
  78. package/src/blocks/e-commerce/product-categories/product-category-4.tsx +129 -0
  79. package/src/blocks/e-commerce/product-categories/product-category-5.tsx +218 -0
  80. package/src/blocks/e-commerce/product-list/product-card-1.tsx +131 -0
  81. package/src/blocks/e-commerce/product-list/product-card-2.tsx +71 -0
  82. package/src/blocks/e-commerce/product-list/product-card-3-reaction-toggle.tsx +166 -0
  83. package/src/blocks/e-commerce/product-list/product-card-3.tsx +215 -0
  84. package/src/blocks/e-commerce/product-list/product-card-5-checkbox-check.tsx +98 -0
  85. package/src/blocks/e-commerce/product-list/product-card-5-reaction-toggle.tsx +171 -0
  86. package/src/blocks/e-commerce/product-list/product-card-5.tsx +367 -0
  87. package/src/blocks/e-commerce/product-overview/product-overview-1.tsx +201 -0
  88. package/src/blocks/e-commerce/product-overview/product-overview-2.tsx +272 -0
  89. package/src/blocks/e-commerce/product-overview/product-overview-5-gallery.tsx +59 -0
  90. package/src/blocks/e-commerce/product-overview/product-overview-5-lightbox-tab.tsx +104 -0
  91. package/src/blocks/e-commerce/product-overview/product-overview-5-reviews-tab.tsx +82 -0
  92. package/src/blocks/e-commerce/product-overview/product-overview-5-tabs.tsx +69 -0
  93. package/src/blocks/e-commerce/product-overview/product-overview-5.tsx +274 -0
  94. package/src/blocks/e-commerce/product-overview/product-quick-view-card.tsx +135 -0
  95. package/src/blocks/e-commerce/product-overview/product-quick-view-dialog.tsx +393 -0
  96. package/src/blocks/e-commerce/product-overview/product-quick-view.tsx +136 -0
  97. package/src/blocks/e-commerce/reviews/review-rating-1-review-form.tsx +133 -0
  98. package/src/blocks/e-commerce/reviews/review-rating-1.tsx +178 -0
  99. package/src/blocks/e-commerce/reviews/review-rating-2.tsx +246 -0
  100. package/src/blocks/e-commerce/shopping-carts/shopping-cart-1-spinning-counter.tsx +142 -0
  101. package/src/blocks/e-commerce/shopping-carts/shopping-cart-1.tsx +291 -0
  102. package/src/blocks/e-commerce/shopping-carts/shopping-cart-2-item-row.tsx +110 -0
  103. package/src/blocks/e-commerce/shopping-carts/shopping-cart-2-recommendations.tsx +51 -0
  104. package/src/blocks/e-commerce/shopping-carts/shopping-cart-2-spinning-counter.tsx +146 -0
  105. package/src/blocks/e-commerce/shopping-carts/shopping-cart-2.tsx +295 -0
  106. package/src/blocks/e-commerce/shopping-carts/shopping-cart-3-spinning-counter.tsx +142 -0
  107. package/src/blocks/e-commerce/shopping-carts/shopping-cart-3.tsx +342 -0
  108. package/src/blocks/e-commerce/shopping-carts/shopping-cart-4-spinning-counter.tsx +146 -0
  109. package/src/blocks/e-commerce/shopping-carts/shopping-cart-4.tsx +391 -0
  110. package/src/blocks/e-commerce/store-containers/store-container-1.tsx +29 -0
  111. package/src/blocks/e-commerce/storefront-hero/storefront-hero-1.tsx +244 -0
  112. package/src/blocks/e-commerce/storefront-hero/storefront-hero-2.tsx +283 -0
  113. package/src/blocks/e-commerce/storefront-hero/storefront-hero-5.tsx +318 -0
  114. package/src/blocks/e-commerce/storefront-hero/storefront-hero-6.tsx +205 -0
  115. package/src/blocks/marketing/banners/avatar-group.tsx +69 -0
  116. package/src/blocks/marketing/banners/banner-1.tsx +188 -0
  117. package/src/blocks/marketing/cta/cta-section-1.tsx +112 -0
  118. package/src/blocks/marketing/faq/faq-block-1.tsx +45 -0
  119. package/src/blocks/marketing/features/feature-1.tsx +97 -0
  120. package/src/blocks/marketing/features/feature-2.tsx +82 -0
  121. package/src/blocks/marketing/footers/footer-section-1.tsx +141 -0
  122. package/src/blocks/marketing/footers/footer-section-3.tsx +192 -0
  123. package/src/blocks/marketing/footers/footer-section-4.tsx +355 -0
  124. package/src/blocks/marketing/hero-sections/avatar-group.tsx +86 -0
  125. package/src/blocks/marketing/hero-sections/hero-section-1.tsx +135 -0
  126. package/src/blocks/marketing/logo-clouds/logo-cloud-1-logo-icon.tsx +52 -0
  127. package/src/blocks/marketing/logo-clouds/logo-cloud-1.tsx +56 -0
  128. package/src/blocks/marketing/navbars/navbar-1.tsx +267 -0
  129. package/src/blocks/marketing/navbars/navbar-2.tsx +351 -0
  130. package/src/blocks/marketing/navbars/navbar-3.tsx +303 -0
  131. package/src/blocks/marketing/navbars/navbar-4-account-menu.tsx +118 -0
  132. package/src/blocks/marketing/navbars/navbar-4-cart-sheet.tsx +248 -0
  133. package/src/blocks/marketing/navbars/navbar-4-like-button.tsx +177 -0
  134. package/src/blocks/marketing/navbars/navbar-4-mobile-nav.tsx +104 -0
  135. package/src/blocks/marketing/navbars/navbar-4-product-grid.tsx +219 -0
  136. package/src/blocks/marketing/navbars/navbar-4-search-bar.tsx +52 -0
  137. package/src/blocks/marketing/navbars/navbar-4.tsx +411 -0
  138. package/src/blocks/marketing/pricing/pricing-section-1.tsx +94 -0
  139. package/src/blocks/marketing/statistics/statistic-1.tsx +93 -0
  140. package/src/blocks/marketing/testimonials/testimonial-1.tsx +141 -0
  141. package/src/blocks/marketing/testimonials/testimonial-2.tsx +108 -0
  142. package/src/blocks/shared/reaction-toggle.tsx +145 -0
  143. package/src/hooks/use-mobile.ts +19 -0
  144. package/src/index.ts +200 -0
  145. package/src/lib/contracts.test.ts +32 -0
  146. package/src/lib/contracts.ts +235 -0
  147. package/src/lib/types/menu.ts +43 -0
  148. package/src/lib/types.ts +4 -0
  149. package/src/lib/utils.ts +10 -0
  150. package/src/ui/accordion.tsx +65 -0
  151. package/src/ui/avatar.tsx +108 -0
  152. package/src/ui/badge.tsx +47 -0
  153. package/src/ui/breadcrumb.tsx +108 -0
  154. package/src/ui/button-group.tsx +83 -0
  155. package/src/ui/button.tsx +63 -0
  156. package/src/ui/card.tsx +91 -0
  157. package/src/ui/carousel.tsx +241 -0
  158. package/src/ui/dialog.tsx +158 -0
  159. package/src/ui/drawer.tsx +134 -0
  160. package/src/ui/dropdown-menu.tsx +256 -0
  161. package/src/ui/empty.tsx +103 -0
  162. package/src/ui/field.tsx +248 -0
  163. package/src/ui/input-group.tsx +170 -0
  164. package/src/ui/input-otp.tsx +76 -0
  165. package/src/ui/input.tsx +20 -0
  166. package/src/ui/label.tsx +23 -0
  167. package/src/ui/navigation-menu.tsx +167 -0
  168. package/src/ui/pagination.tsx +127 -0
  169. package/src/ui/progress.tsx +30 -0
  170. package/src/ui/radio-group.tsx +44 -0
  171. package/src/ui/select.tsx +189 -0
  172. package/src/ui/separator.tsx +27 -0
  173. package/src/ui/sheet.tsx +142 -0
  174. package/src/ui/sidebar.tsx +726 -0
  175. package/src/ui/skeleton.tsx +13 -0
  176. package/src/ui/table.tsx +115 -0
  177. package/src/ui/tabs.tsx +90 -0
  178. package/src/ui/textarea.tsx +17 -0
  179. package/src/ui/toggle-group.tsx +83 -0
  180. package/src/ui/toggle.tsx +46 -0
  181. package/src/ui/tooltip.tsx +56 -0
  182. package/tsconfig.json +20 -0
  183. package/tsup.config.ts +16 -0
  184. package/vitest.config.ts +9 -0
@@ -0,0 +1,24 @@
1
+ CLI Building entry: {"index":"src/index.ts","contracts":"src/lib/contracts.ts"}
2
+ CLI Using tsconfig: tsconfig.json
3
+ CLI tsup v8.5.1
4
+ CLI Using tsup config: /home/nelson/dev/active/thorprovider/repos/thorcommerce/packages/blocks/tsup.config.ts
5
+ CLI Target: esnext
6
+ CLI Cleaning output folder
7
+ CJS Build start
8
+ ESM Build start
9
+ CJS dist/contracts.js 8.15 KB
10
+ CJS dist/index.js 801.34 KB
11
+ CJS dist/contracts.js.map 12.65 KB
12
+ CJS dist/index.js.map 1.13 MB
13
+ CJS ⚡️ Build success in 801ms
14
+ ESM dist/contracts.mjs 5.12 KB
15
+ ESM dist/index.mjs 708.79 KB
16
+ ESM dist/contracts.mjs.map 12.54 KB
17
+ ESM dist/index.mjs.map 1.14 MB
18
+ ESM ⚡️ Build success in 815ms
19
+ DTS Build start
20
+ DTS ⚡️ Build success in 17297ms
21
+ DTS dist/index.d.ts 86.38 KB
22
+ DTS dist/contracts.d.ts 17.94 KB
23
+ DTS dist/index.d.mts 86.38 KB
24
+ DTS dist/contracts.d.mts 17.94 KB
@@ -0,0 +1,10 @@
1
+
2
+ RUN v3.2.4 /home/nelson/dev/active/thorprovider/repos/thorcommerce/packages/blocks
3
+
4
+ ✓ src/blocks/e-commerce/checkout-forms/card-formatting.test.ts (10 tests) 14ms
5
+
6
+ Test Files 1 passed (1)
7
+ Tests 10 passed (10)
8
+ Start at 16:54:02
9
+ Duration 1.03s (transform 162ms, setup 0ms, collect 93ms, tests 14ms, environment 0ms, prepare 252ms)
10
+
File without changes
package/AGENTS.md ADDED
@@ -0,0 +1 @@
1
+ <!-- BLOCKS-AGENTS-MD-START -->[@thorprovider/blocks Docs]|root: ./blocks|Documentation for @thorprovider/blocks. Always read package docs before making changes.|To regenerate: yarn workspace @thorprovider/blocks generate:agent-index|.:{README.md}|docs/standards:{data-contracts.md,theming.md}<!-- BLOCKS-AGENTS-MD-END -->
package/README.md ADDED
@@ -0,0 +1,161 @@
1
+ ---
2
+ title: "@thorprovider/blocks"
3
+ purpose: "Reusable, framework-agnostic storefront blocks built from ShadcnStore UI, decoupled from data and backend"
4
+ lastReviewed: "2026-09-23"
5
+ ---
6
+
7
+ # @thorprovider/blocks
8
+
9
+ Reusable storefront UI blocks for Thor Commerce, built from [ShadcnStore](https://shadcnstore.com) blocks and transformed into prop-driven, framework-agnostic components.
10
+
11
+ ## Principles
12
+
13
+ - **Framework-agnostic.** No `next/*`, `react-router`, or `@thorprovider/*` imports. Components render anywhere React runs (Next.js, Vite, json-render).
14
+ - **No data baked in.** Demo content, images, and branding live in the consuming app. Blocks receive data via props.
15
+ - **Single source of primitives.** The vendored shadcn primitives under `src/ui/` are the only copy; consumers import them from this package instead of installing their own.
16
+ - **No over-abstraction.** Values are split into props vs internal detail with judgment. A prop is added only when the value is genuinely content or configuration; layout and decoration stay internal.
17
+ - **Shared contracts only when reused.** A type like `CTA` is promoted to `src/lib/types.ts` only once two blocks share it.
18
+
19
+ ## Structure
20
+
21
+ ```
22
+ src/
23
+ ├── index.ts # Public API: blocks, primitives, types
24
+ ├── lib/
25
+ │ ├── utils.ts # cn() helper (clsx + tailwind-merge)
26
+ │ └── types.ts # Shared prop contracts (e.g. CTA)
27
+ ├── ui/ # Vendored shadcn primitives (CLI-managed, single source)
28
+ └── blocks/
29
+ ├── marketing/
30
+ │ └── hero-sections/hero-section-1.tsx
31
+ └── e-commerce/
32
+ ├── product-list/product-card-1.tsx
33
+ └── storefront-hero/storefront-hero-1.tsx
34
+ ```
35
+
36
+ Blocks follow `src/blocks/<category>/<section>/<block>.tsx`. Each block co-locates its own prop types unless a contract is shared by two or more blocks.
37
+
38
+ ## Blocks
39
+
40
+ | Export | Category | Description |
41
+ | --- | --- | --- |
42
+ | `Navbar1` | Marketing | Simple navbar with logo, links, sign-in, CTA and cart count |
43
+ | `Navbar2` | Marketing | Mega-menu navbar with grouped flyouts and featured card |
44
+ | `Navbar3` | Marketing | Floating navbar that condenses into a rounded pill on scroll |
45
+ | `Navbar4` | Marketing | Storefront navbar: utility bar, category links, search, account menu, cart sheet |
46
+ | `Banner1` | Marketing | Announcement banner (bar or pill) with dismiss |
47
+ | `HeroSection1` | Marketing | Hero with badge, headline, CTA, reviewer avatars, rating and image |
48
+ | `CtaSection1` | Marketing | Full-width call-to-action with badge, headline and two CTAs |
49
+ | `Feature1` | Marketing | Icon feature grid |
50
+ | `Feature2` | Marketing | Split features with image |
51
+ | `Testimonial1` | Marketing | Testimonial carousel with rating stars |
52
+ | `Testimonial2` | Marketing | Bento testimonials grid |
53
+ | `FaqBlock1` | Marketing | FAQ accordion (single or multiple open) |
54
+ | `PricingSection1` | Marketing | Pricing tiers with popular badge |
55
+ | `Statistic1` | Marketing | Metrics grid with progress bars |
56
+ | `LogoCloud1` | Marketing | Logo cloud with skeleton fallback |
57
+ | `FooterSection1` | Marketing | Footer with brand, link columns and newsletter |
58
+ | `FooterSection3` | Marketing | Newsletter + six-column footer with social links |
59
+ | `ProductCard1` | E-commerce | Deals grid of product cards with add-to-cart |
60
+ | `ProductCard2` | E-commerce | Clean three-up grid with ratings |
61
+ | `ProductCard3` | E-commerce | Deals grid with badges, low-stock and wishlist |
62
+ | `ProductCard5` | E-commerce | Table-style comparison with sorting and filtering |
63
+ | `ProductOverview1` | E-commerce | Product detail with gallery, variants and add-to-cart |
64
+ | `ProductQuickView` | E-commerce | Quick-view dialog with gallery, variants and quantity |
65
+ | `ReviewRating1` | E-commerce | Review list with rating summary |
66
+ | `ReviewRating2` | E-commerce | Rating summary with distribution and review carousel |
67
+ | `ProductCategory1` | E-commerce | Category grid with view-all |
68
+ | `ProductCategory2` | E-commerce | Image-based category cards |
69
+ | `ProductCategory4` | E-commerce | Icon grid with customer/product counts |
70
+ | `ProductCategory5` | E-commerce | Category list with search and subcategories |
71
+ | `CategoryFilter1` | E-commerce | Category filter bar |
72
+ | `CategoryFilter2` | E-commerce | Filter sidebar with mobile sheet |
73
+ | `ShoppingCart1` | E-commerce | Detailed cart summary |
74
+ | `ShoppingCart2` | E-commerce | Cart with promo code and shipping |
75
+ | `ShoppingCart4` | E-commerce | Collapsible cart drawer with promotion progress |
76
+ | `CheckoutForm1` | E-commerce | Essential checkout fields |
77
+ | `CheckoutForm2` | E-commerce | Single-page checkout with order summary beside |
78
+ | `CheckoutConfirmation` | E-commerce | Order confirmation with fulfilment timeline |
79
+ | `OrderHistory1` | E-commerce | Orders list |
80
+ | `OrderHistory2` | E-commerce | Order cards with carousel items |
81
+ | `StorefrontHero1` | E-commerce | Storefront hero with gradient headline, CTAs and a product grid |
82
+ | `StorefrontHero2` | E-commerce | Search field above a trending product carousel |
83
+ | `StorefrontHero5` | E-commerce | Departments grid with featured deals |
84
+ | `StorefrontHero6` | E-commerce | Rotating deals bar beside category cards |
85
+ | `AppShell1` | Application | Application shell with navigation slots |
86
+ | `LoginPage1` | Application | Login card with remember-me and social buttons |
87
+ | `LoginPage2` | Application | Login with prominent social options |
88
+ | `SignUpPage1` | Application | Registration card with social options |
89
+ | `ForgotPasswordPage1` | Application | Four-step password recovery wizard |
90
+ | `Verify1` | Application | Two-factor verification (OTP or backup code) |
91
+
92
+ Interactions are exposed as callbacks (e.g. `onAddToCart`, `onBuyNow`, `onSelectColor`). Elements stay in the DOM with no-op behavior when a callback is absent.
93
+
94
+ ## Checkout blocks (controlled)
95
+
96
+ `CheckoutForm1` (3-step wizard) and `CheckoutForm2` (single page) are **controlled components**: they receive the current form values through a `values` prop and report every edit through `onChange`. They hold no internal form state, so a renderer's validation context can read field values from its own state model. `CheckoutForm3` (4-step wizard) keeps the same contract with internal step state.
97
+
98
+ - `paymentMethods?: PaymentMethod[]` — available payment methods as data (canonical `@thorprovider/types` `PaymentMethod`). The blocks render a radio list from this prop, show the selected method's name + `description`, and only render the card fields (`cardNumber`, `expiryDate`, `cvv`, `cardName`) when the selected method's `type === 'card'`. No payment method is hardcoded; pass an empty list to trigger the empty state.
99
+ - `values: CheckoutForm1FormData` / `CheckoutForm2Data` — current field values (including `cardNumber`, `expiryDate`, `cvv`, `cardName`, and `paymentMethod` for `CheckoutForm1`/`CheckoutForm3`).
100
+ - `onChange: (field, value) => void` — reported per edit; card grouping and MM/YY masking are applied by the block before the value reaches `onChange` (presentation only, no validation logic in the block).
101
+ - `fieldErrors?: Partial<Record<FieldKey, Array<{ message?: string }>>>` — per-field error messages rendered via `FieldError` (`role="alert"`, `aria-invalid`/`aria-describedby` wiring). The same channel carries async/server errors (e.g. payment decline, invalid promo).
102
+ - `fieldDescriptions?: Partial<Record<FieldKey, string>>` — helper text rendered via `FieldDescription`.
103
+ - `validateStep?: (step: number) => boolean` (wizard only) — the block calls it on "Next"; advance only happens when it returns `true`, and the final submit only fires when every step validates.
104
+
105
+ Validation itself is **not** implemented in the blocks. Declare checks in your store spec's validation configuration (built-in `required`/`email`/`pattern`/`minLength`/`maxLength`/cross-field `requiredIf`/`equalTo`/`lessThan`/`greaterThan`, plus catalog-registered custom functions like `luhn`/`cvv`/`expiryDate`) and evaluate them with the renderer; the messages live in the spec so they are per-store and per-language. Without a validation provider the blocks render with no inline errors.
106
+
107
+ ## Usage
108
+
109
+ ```tsx
110
+ import { HeroSection1 } from '@thorprovider/blocks'
111
+
112
+ <HeroSection1
113
+ title="Welcome to ShadcnStore"
114
+ description="Discover our premium collection of handcrafted UI blocks"
115
+ badge="Premium UI Components"
116
+ cta={{ label: 'Explore Collection' }}
117
+ reviewers={[{ id: 1, avatarUrl: '...', fallback: 'U1' }]}
118
+ rating={{ value: 5, count: 15 }}
119
+ trustedBy="Trusted by 1000+ developers"
120
+ image={{ src: '/hero.png', alt: 'Hero preview' }}
121
+ />
122
+ ```
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ yarn workspace @thorprovider/blocks dev # tsup watch
128
+ yarn workspace @thorprovider/blocks type-check
129
+ yarn workspace @thorprovider/blocks build # dist/ with .d.ts
130
+ ```
131
+
132
+ The `'use client'` banner is injected at build time (tsup `banner`) so the bundled library is consumed correctly by Next.js.
133
+
134
+ ## Adding a new block
135
+
136
+ 1. Install the raw block as a seed: `npx shadcn@latest add @shadcnstore/<block> --cwd packages/blocks`
137
+ 2. Transform it into `src/blocks/<category>/<section>/<block>.tsx`: rewrite `@/...` imports to relative, split hardcoded values into props vs internal detail, expose interactions as callbacks.
138
+ 3. Remove the seed file and add the block export to `src/index.ts`.
139
+ 4. Add a registry entry + demo data file in `projects/blocks-showcase` (see its README).
140
+
141
+ See `openspec/changes/add-thorprovider-blocks/design.md` for the full design decisions (D1–D8).
142
+
143
+ ## Block data contracts
144
+
145
+ Blocks render props blindly, so the **boundary** (mappers/transforms/store
146
+ specs) must follow two hygiene rules: optional fields are never `""` (emit
147
+ `undefined` or a fallback such as `PRODUCT_IMAGE_FALLBACK`), and React keys are
148
+ unique by contract, not by convention. See
149
+ [`docs/standards/data-contracts.md`](docs/standards/data-contracts.md) for the
150
+ rules and the review checklist.
151
+
152
+ ## Block interaction contracts
153
+
154
+ State and events between a block, its host registry, and the store must follow
155
+ the state-sync hygiene rules: blocks report changes from event handlers, never
156
+ from effects (`isInitialMount` is not a loop breaker); hosts pass identity-stable
157
+ callbacks (`useCallback`); a fresh object literal always notifies a reference-only
158
+ store guard; and every registered action completes its round-trip (handler → set +
159
+ emit → spec `on` → recompute → bind). See
160
+ [`docs/standards/interaction-contracts.md`](docs/standards/interaction-contracts.md)
161
+ for the rules and the review checklist.
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": true,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "",
9
+ "baseColor": "neutral",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "aliases": {
14
+ "components": "@/_seed",
15
+ "utils": "@/lib/utils",
16
+ "ui": "@/ui",
17
+ "lib": "@/lib",
18
+ "hooks": "@/hooks"
19
+ },
20
+ "iconLibrary": "lucide",
21
+ "registries": {
22
+ "@shadcnstore": "https://shadcnstore.com/r/{name}.json",
23
+ "@shadcnstore-pro": {
24
+ "url": "https://shadcnstore.com/r/{name}.json",
25
+ "params": {
26
+ "token": "${SHADCNSTORE_TOKEN}"
27
+ },
28
+ "headers": {
29
+ "Authorization": "Bearer ${SHADCNSTORE_TOKEN}"
30
+ }
31
+ }
32
+ }
33
+ }