@pradip1995/layout-checkout 0.2.9 → 0.2.11

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/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@pradip1995/layout-checkout",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
- "sideEffects": false,
8
+ "sideEffects": [
9
+ "./src/jewelry-checkout-page.css"
10
+ ],
9
11
  "files": [
10
12
  "src"
11
13
  ],
@@ -18,9 +20,9 @@
18
20
  "react": ">=19"
19
21
  },
20
22
  "dependencies": {
21
- "@pradip1995/layout-default": "^0.2.9",
22
- "@pradip1995/segment-primitives": "^0.3.0",
23
- "@pradip1995/segment-tokens": "^0.3.2"
23
+ "@pradip1995/layout-default": "^0.2.12",
24
+ "@pradip1995/segment-primitives": "^0.4.0",
25
+ "@pradip1995/segment-tokens": "^0.3.7"
24
26
  },
25
27
  "devDependencies": {
26
28
  "@pradip1995/plugin-sdk": "^0.2.0",
@@ -0,0 +1,22 @@
1
+ .jewelry-checkout-page {
2
+ padding: 1.75rem 0 3.5rem;
3
+ }
4
+
5
+ .jewelry-checkout-page__grid {
6
+ display: grid;
7
+ grid-template-columns: 1fr;
8
+ gap: 1.25rem;
9
+ align-items: start;
10
+ }
11
+
12
+ @media (min-width: 1024px) {
13
+ .jewelry-checkout-page__grid {
14
+ grid-template-columns: minmax(0, 1.85fr) minmax(20rem, 22.5rem);
15
+ gap: 1.75rem;
16
+ }
17
+
18
+ .jewelry-checkout-page__summary {
19
+ position: sticky;
20
+ top: calc(var(--header-height) + var(--promo-bar-height) + 1.25rem);
21
+ }
22
+ }
package/src/layout.tsx CHANGED
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from "react"
2
+ import { Children } from "react"
2
3
  import { StorefrontShell } from "@pradip1995/layout-default/shell"
4
+ import "./jewelry-checkout-page.css"
3
5
 
4
6
  export default function LayoutCheckout({
5
7
  data,
@@ -8,11 +10,16 @@ export default function LayoutCheckout({
8
10
  data: Record<string, unknown>
9
11
  children: ReactNode
10
12
  }) {
13
+ const all = Children.toArray(children)
14
+ const [form, summary] = all.length >= 2 ? all.slice(-2) : all
15
+
11
16
  return (
12
17
  <StorefrontShell data={data} hideFooter contained>
13
- <div className="py-10 lg:py-14">
14
- <h1 className="section-heading mb-8">Checkout</h1>
15
- <div className="grid grid-cols-1 lg:grid-cols-2 gap-10">{children}</div>
18
+ <div className="jewelry-checkout-page">
19
+ <div className="jewelry-checkout-page__grid">
20
+ <div className="jewelry-checkout-page__form">{form}</div>
21
+ <div className="jewelry-checkout-page__summary">{summary}</div>
22
+ </div>
16
23
  </div>
17
24
  </StorefrontShell>
18
25
  )