efficient-storefront-blocks 0.131.0 → 0.131.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.
@@ -1174,6 +1174,23 @@ body .sf-site-header[data-header-ink="dark"] {
1174
1174
  }
1175
1175
  }
1176
1176
 
1177
+ /* ─── A PAGE MENU'S LETTERS ─────────────────────────────────────────────
1178
+ The page Menu's `Letters` Capitalised (lib/document/footer-page-blocks
1179
+ MENU_CASE_ATTR): its links read as they are written, with no letter space,
1180
+ in the row, the tab strip and the side panel alike. A removed transform,
1181
+ never `capitalize`. Unlayered, so it beats the cells' Tailwind capitals. */
1182
+ [data-menu-case="capitalised"] :is(ul, li) {
1183
+ text-transform: none;
1184
+ letter-spacing: normal;
1185
+ }
1186
+
1187
+ /* Form → Letters: Capitalised. The form's labels, button and consent line
1188
+ are drawn as typed (components/FormBlock `data-form-case`). */
1189
+ [data-form-case="capitalised"] .uppercase {
1190
+ text-transform: none;
1191
+ letter-spacing: normal;
1192
+ }
1193
+
1177
1194
  /* ─── THE BOX HEADER'S LETTERS ────────────────────────────────────────
1178
1195
  The Site Header's `Letters` (the old header's `nav_text_case`,
1179
1196
  lib/content/header-bar): ONE value for the menu's links AND the tool words,
@@ -15,12 +15,29 @@ export interface FormBlockProps {
15
15
  buttonCorners?: unknown;
16
16
  buttonCornerSides?: unknown;
17
17
  buttonCornersUnit?: unknown;
18
+ widthFit?: unknown;
19
+ headingHidden?: boolean;
20
+ buttonColor?: unknown;
21
+ buttonTextColor?: unknown;
22
+ textCase?: unknown;
18
23
  }
19
- export default function FormBlock({ formSlug, heading, intro, submitText, finePrint, form: injected, editing, nodeId, thanks, showSent, buttonCorners, buttonCornerSides, buttonCornersUnit, }?: FormBlockProps): import("react").JSX.Element;
24
+ export declare const FORM_BUTTON_WIDTH_FIT = "content";
25
+ export declare const FORM_BUTTON_WIDTH_FILL = "fill";
26
+ export declare const FORM_BUTTON_WIDTHS: readonly [{
27
+ readonly label: "Fit content";
28
+ readonly value: "content";
29
+ }, {
30
+ readonly label: "Fill";
31
+ readonly value: "fill";
32
+ }];
33
+ export default function FormBlock({ formSlug, heading, intro, submitText, finePrint, form: injected, editing, nodeId, thanks, showSent, buttonCorners, buttonCornerSides, buttonCornersUnit, widthFit, headingHidden, buttonColor, buttonTextColor, textCase, }?: FormBlockProps): import("react").JSX.Element;
20
34
  export declare function AccountOutcome({ account }: {
21
35
  account: FormAck["account"];
22
36
  }): import("react").JSX.Element | null;
23
- export declare function FormBody({ form, formSlug, submitText, finePrint, editing, onSent, corners, nodeId, thanks, showSent, }: {
37
+ export declare function FormBody({ form, formSlug, submitText, finePrint, editing, onSent, corners, nodeId, thanks, showSent, fullWidthButton, buttonPaint, capitalised, }: {
38
+ capitalised?: boolean;
39
+ buttonPaint?: CSSProperties | null;
40
+ fullWidthButton?: boolean;
24
41
  form: Form;
25
42
  formSlug?: string;
26
43
  submitText?: string;
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import O from"next/link";import{useEffect as L}from"react";import{FormFieldInput as S,FormHoneypot as j,successMessageFor as I,useBoundForm as P,useFormSubmission as B}from"./formSubmission.js";import k from"./SectionNotice.js";import{ThanksCard as M}from"./ThanksCard.js";import{showsSentOnCanvas as _}from"../lib/content/thanks-slot.js";import{say as w}from"efficient-web-builder/format/lib/editor-words";import q from"./WebFormField.js";import{usePopupScope as W}from"./PopupHost.js";import{FIELD_INPUT_CLASS as F}from"../lib/field-input.js";import{cornerSidesShorthand as A,normalizeCornerSides as E}from"efficient-web-builder/format/lib/content/section-corners";import{cssLengthOf as H}from"efficient-web-builder/format/lib/content/css-length";import{withSideOnce as D}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as R}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as U}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as $}from"./SectionPadScope.js";function G({field:e,value:r,onChange:s,cornersClass:o=""}){const n={field:e,value:r,onChange:s};return e.type==="checkbox"?c("label",{className:"flex items-start gap-3",children:[t(S,{...n,className:"mt-1 size-4 accent-accent"}),c("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-fg",children:[e.label,e.required?t("span",{className:"text-accent",children:" *"}):null]})]}):t(q,{label:e.label,required:e.required,children:t(S,{...n,className:(e.type==="textarea"?F+" resize-y":F)+o})})}function J(e,r,s){if(typeof e!="number"||!Number.isFinite(e))return null;const o=H(Math.max(0,e),s),n=E(r);return{style:{"--form-control-radius":n===null?o:A(o,n)},className:" [border-radius:var(--form-control-radius)]"}}function K({formSlug:e,heading:r,intro:s,submitText:o,finePrint:n,form:u,editing:i=!1,nodeId:d="",thanks:x,showSent:f,buttonCorners:h,buttonCornerSides:g,buttonCornersUnit:b}={}){const y=R(),p=$(),a=P(e,u),N=W();if(a===void 0)return t(k,{size:"short",children:w("Loading form…")});if(a===null)return t(k,{size:"short",children:i?w("Choose a form in the inspector, under Form."):"This form is unavailable."});const l=(r??"").trim()||a.title;return t("section",{className:"relative z-[2] border-t border-line bg-surface",children:c("div",{...U(D("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",y),p),children:[l&&t("h2",{className:"mb-4 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:l}),(s??"").trim()&&t("p",{className:"mb-12 max-w-[640px] font-display text-[16px] leading-[1.6] text-fg-dim",children:s}),t(V,{form:a,formSlug:e,submitText:o,finePrint:n,editing:i,onSent:N?.markSent,nodeId:d,thanks:x,showSent:f,corners:J(h,g,b)})]})})}function Q({account:e}){const r="font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim";switch(e?.status){case"approved":return c("p",{className:r,children:["Check your email to set your password, then"," ",t(O,{href:"/login",className:"underline",children:"Sign in"})]});case"pending":return t("p",{className:r,children:"We're reviewing your application and will email you once it's approved."});case"rejected":return t("p",{className:r,children:"We couldn't open an account from this application. Please contact the shop."});default:return null}}function V({form:e,formSlug:r,submitText:s,finePrint:o,editing:n=!1,onSent:u,corners:i=null,nodeId:d="",thanks:x,showSent:f}){const{valueOf:h,set:g,honeypot:b,setHoneypot:y,submitting:p,done:a,account:N,error:l,handleSubmit:C}=B({form:e,formSlug:r,editing:n});L(()=>{a&&u?.()},[a]);const T=(s??"").trim()||e.submitButtonText?.trim()||"Submit",v=m=>c("div",{role:"status",className:"flex max-w-[560px] flex-col gap-3",children:[t("p",{className:"font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:I(e)}),m,t(Q,{account:N})]});return a||_(f,n)?t(M,{ownerId:d,ownerType:"Form",Template:x,message:v(null),children:v}):c("form",{className:"flex max-w-[720px] flex-col gap-5",style:i?.style,onSubmit:C,children:[e.fields.map(m=>t(G,{field:m,value:h(m.key),onChange:z=>g(m.key,z),cornersClass:i?.className},m.key)),t(j,{value:b,onChange:y}),l&&t("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:l}),t("button",{type:n?"button":"submit",disabled:p,className:`cursor-pointer self-start bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60${i?.className??""}`,children:p?"Sending…":T}),e.consentText?.trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:e.consentText}),(o??"").trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:o})]})}export{Q as AccountOutcome,V as FormBody,K as default};
1
+ "use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import M from"next/link";import{useEffect as P}from"react";import{FormFieldInput as O,FormHoneypot as W,successMessageFor as j,useBoundForm as H,useFormSubmission as R}from"./formSubmission.js";import C from"./SectionNotice.js";import{ThanksCard as D}from"./ThanksCard.js";import{showsSentOnCanvas as U}from"../lib/content/thanks-slot.js";import{say as _}from"efficient-web-builder/format/lib/editor-words";import q from"./WebFormField.js";import{usePopupScope as A}from"./PopupHost.js";import{FIELD_INPUT_CLASS as I}from"../lib/field-input.js";import{cornerSidesShorthand as E,normalizeCornerSides as $}from"efficient-web-builder/format/lib/content/section-corners";import{cssLengthOf as G}from"efficient-web-builder/format/lib/content/css-length";import{withSideOnce as J}from"efficient-web-builder/format/lib/content/page-width";import{useSideSpaceOnce as K}from"efficient-web-builder/render/components/SideSpaceOnce";import{withRootPad as Q}from"efficient-web-builder/render/lib/content/section-own-pads";import{useSectionPad as V}from"./SectionPadScope.js";import{hexToRgb as X,parseHexColor as Y}from"efficient-shell/format";import{resolveNavTextCase as Z}from"../lib/content/header-bar.js";function ee({field:e,value:r,onChange:o,cornersClass:s=""}){const n={field:e,value:r,onChange:o};return e.type==="checkbox"?c("label",{className:"flex items-start gap-3",children:[t(O,{...n,className:"mt-1 size-4 accent-accent"}),c("span",{className:"font-mono text-[12px] font-semibold uppercase tracking-[0.16em] text-fg",children:[e.label,e.required?t("span",{className:"text-accent",children:" *"}):null]})]}):t(q,{label:e.label,required:e.required,children:t(O,{...n,className:(e.type==="textarea"?I+" resize-y":I)+s})})}const te="content",B="fill",we=[{label:"Fit content",value:te},{label:"Fill",value:B}];function z(e){return typeof e=="string"&&X(e.trim())!==null?Y(e.trim()):null}function ne(e,r){const o={},s=z(e),n=z(r);return s&&(o["--btn"]=s),n&&(o["--btn-ink"]=n),Object.keys(o).length?o:null}function re(e,r,o){if(typeof e!="number"||!Number.isFinite(e))return null;const s=G(Math.max(0,e),o),n=$(r);return{style:{"--form-control-radius":n===null?s:E(s,n)},className:" [border-radius:var(--form-control-radius)]"}}function oe({formSlug:e,heading:r,intro:o,submitText:s,finePrint:n,form:d,editing:i=!1,nodeId:f="",thanks:x,showSent:h,buttonCorners:g,buttonCornerSides:b,buttonCornersUnit:y,widthFit:N,headingHidden:v=!1,buttonColor:F,buttonTextColor:S,textCase:p}={}){const m=K(),T=V(),a=H(e,d),k=A();if(a===void 0)return t(C,{size:"short",children:_("Loading form…")});if(a===null)return t(C,{size:"short",children:i?_("Choose a form in the inspector, under Form."):"This form is unavailable."});const u=v?"":(r??"").trim()||a.title;return t("section",{className:"relative z-[2] border-t border-line bg-surface",children:c("div",{...Q(J("mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] py-[84px] max-[960px]:px-[min(24px,var(--sf-site-gutter,40px))]",m),T),children:[u&&t("h2",{className:"mb-4 font-heading2 text-[length:min(var(--size-headingMedium,44px),var(--sf-heading-max,9999px))] font-medium uppercase leading-none tracking-[-0.02em] text-fg max-view-wide:text-[length:min(var(--size-headingMedium,32px),var(--sf-heading-max,9999px))]",children:u}),(o??"").trim()&&t("p",{className:"mb-12 max-w-[640px] font-display text-[16px] leading-[1.6] text-fg-dim",children:o}),t(ae,{form:a,formSlug:e,submitText:s,finePrint:n,editing:i,onSent:k?.markSent,nodeId:f,thanks:x,showSent:h,corners:re(g,b,y),fullWidthButton:N===B,buttonPaint:ne(F,S),capitalised:Z(p)==="capitalised"})]})})}function se({account:e}){const r="font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim";switch(e?.status){case"approved":return c("p",{className:r,children:["Check your email to set your password, then"," ",t(M,{href:"/login",className:"underline",children:"Sign in"})]});case"pending":return t("p",{className:r,children:"We're reviewing your application and will email you once it's approved."});case"rejected":return t("p",{className:r,children:"We couldn't open an account from this application. Please contact the shop."});default:return null}}function ae({form:e,formSlug:r,submitText:o,finePrint:s,editing:n=!1,onSent:d,corners:i=null,nodeId:f="",thanks:x,showSent:h,fullWidthButton:g=!1,buttonPaint:b=null,capitalised:y=!1}){const{valueOf:N,set:v,honeypot:F,setHoneypot:S,submitting:p,done:m,account:T,error:a,handleSubmit:k}=R({form:e,formSlug:r,editing:n});P(()=>{m&&d?.()},[m]);const u=(o??"").trim()||e.submitButtonText?.trim()||"Submit",w=l=>c("div",{role:"status",className:"flex max-w-[560px] flex-col gap-3",children:[t("p",{className:"font-serif text-[19px] italic leading-[1.6] text-fg-dim",children:j(e)}),l,t(se,{account:T})]});return m||U(h,n)?t(D,{ownerId:f,ownerType:"Form",Template:x,message:w(null),children:w}):c("form",{className:"flex max-w-[720px] flex-col gap-5",style:i?.style,onSubmit:k,"data-form-case":y?"capitalised":void 0,children:[e.fields.map(l=>t(ee,{field:l,value:N(l.key),onChange:L=>v(l.key,L),cornersClass:i?.className},l.key)),t(W,{value:F,onChange:S}),a&&t("p",{role:"alert",className:"font-mono text-[12px] uppercase tracking-[0.18em] text-alert",children:a}),t("button",{type:n?"button":"submit",disabled:p,style:b??void 0,className:`cursor-pointer ${g?"self-stretch":"self-start"} bg-btn px-8 py-4 font-mono text-[14px] uppercase tracking-[0.32em] text-btn-ink transition-colors hover:bg-fg hover:text-bg disabled:cursor-wait disabled:opacity-60${i?.className??""}`,children:p?"Sending…":u}),e.consentText?.trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:e.consentText}),(s??"").trim()&&t("span",{className:"font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim/70",children:s})]})}export{se as AccountOutcome,we as FORM_BUTTON_WIDTHS,B as FORM_BUTTON_WIDTH_FILL,te as FORM_BUTTON_WIDTH_FIT,ae as FormBody,oe as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import r from"../../../../../components/FormBlock.js";import{hidableText as i}from"efficient-easel/screen/lib/document/hidable";import{BUTTON_STYLE_KEYS as n}from"efficient-easel/screen/lib/content/style-keys";import{BUTTON_CORNERS_UNIT_KEY as o}from"efficient-easel/screen/lib/content/length-units";import{SHOW_SENT_KEY as m,THANKS_SLOT as d}from"../../../../content/thanks-slot.js";import{FormMeta as f}from"./meta.js";import{padsItself as u}from"../../../pads-itself.js";const N=u("Form",{...f,render:e=>t(r,{formSlug:i(e.formSlug)||void 0,heading:i(e.heading)||void 0,intro:i(e.intro)||void 0,submitText:i(e.submitText)||void 0,finePrint:i(e.finePrint)||void 0,form:e.form,editing:e.editor?.isEditing,nodeId:typeof e.id=="string"?e.id:"",thanks:e[d],showSent:e[m],buttonCorners:e[n.corners],buttonCornerSides:e[n.cornerSides],buttonCornersUnit:e[o]})});export{N as FormRender};
1
+ import{jsx as n}from"react/jsx-runtime";import d from"../../../../../components/FormBlock.js";import{hidableText as e,readHidable as o}from"efficient-easel/screen/lib/document/hidable";import{BUTTON_STYLE_KEYS as i}from"efficient-easel/screen/lib/content/style-keys";import{BUTTON_CORNERS_UNIT_KEY as r}from"efficient-easel/screen/lib/content/length-units";import{SHOW_SENT_KEY as m,THANKS_SLOT as f}from"../../../../content/thanks-slot.js";import{FormMeta as u}from"./meta.js";import{padsItself as a}from"../../../pads-itself.js";const C=a("Form",{...u,render:t=>n(d,{formSlug:e(t.formSlug)||void 0,heading:e(t.heading)||void 0,headingHidden:o(t.heading).hidden,intro:e(t.intro)||void 0,submitText:e(t.submitText)||void 0,finePrint:e(t.finePrint)||void 0,form:t.form,editing:t.editor?.isEditing,nodeId:typeof t.id=="string"?t.id:"",thanks:t[f],showSent:t[m],buttonCorners:t[i.corners],buttonCornerSides:t[i.cornerSides],buttonCornersUnit:t[r],widthFit:t.widthFit,buttonColor:t[i.fill],buttonTextColor:t[i.text],textCase:t.textCase})});export{C as FormRender};
@@ -1307,7 +1307,7 @@
1307
1307
  "heading": {
1308
1308
  "type": "custom",
1309
1309
  "__text": {
1310
- "control": "plainText",
1310
+ "control": "text",
1311
1311
  "label": "Heading override"
1312
1312
  }
1313
1313
  },
@@ -4,5 +4,6 @@ export declare const PAGE_BLOCKS_FROM_FOOTER: {
4
4
  readonly SocialLogosBlock: "FooterSocial";
5
5
  readonly PaymentLogosBlock: "FooterPayment";
6
6
  };
7
+ export declare const MENU_CASE_ATTR = "data-menu-case";
7
8
  export declare const PAGE_MENU_DIRECTION_DEFAULT = "column";
8
9
  export declare function addPageBlocksFromFooter(components: Record<string, object>): void;
@@ -1 +1 @@
1
- import{jsx as B}from"react/jsx-runtime";import{declaredBlockSource as O,sourcedRows as k}from"efficient-web-builder/format/lib/content/block-sources";import _ from"../../components/FooterMenu.js";import{addressQueryOf as M}from"../wheels/selected-ranges.js";import{menuLayoutOf as S}from"../content/tab-strip.js";import{MENU_BLOCK_TYPE as i}from"./document-nodes.js";const L={[i]:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},T="column";function w({id:e,template:o,menu:r,dataSource:n,dataRows:l,heading:u,accordionMobile:a,showDividers:m,direction:d,linkAlign:c,linkRange:s,menuStyle:f,currentPage:g,menuStylePhone:p,menuPanelWidth:P,menuPanelTintColor:y,menuPanelTintOpacity:E,editor:t,...F}){return B(_,{owner:{id:String(e??""),type:i,template:o},menu:r,served:O({dataSource:n})?k({dataSource:n,dataRows:l},!!t?.isEditing).rows:void 0,heading:u||void 0,accordionMobile:a,showDividers:m,layout:S(d),linkAlign:c,linkRange:s,menuStyle:f,currentPage:g,pageQuery:M(F)||void 0,menuStylePhone:p,menuPanelWidth:P,menuPanelTintColor:y,menuPanelTintOpacity:E,editing:t?.isEditing})}function j(e){for(const[r,n]of Object.entries(L))e[r]={...e[n]};const o=e.MenuBlock;o.defaultProps={...o.defaultProps,direction:T},o.render=w}export{L as PAGE_BLOCKS_FROM_FOOTER,T as PAGE_MENU_DIRECTION_DEFAULT,j as addPageBlocksFromFooter};
1
+ import{jsx as a}from"react/jsx-runtime";import{declaredBlockSource as k,sourcedRows as M}from"efficient-web-builder/format/lib/content/block-sources";import T from"../../components/FooterMenu.js";import{addressQueryOf as S}from"../wheels/selected-ranges.js";import{menuLayoutOf as x}from"../content/tab-strip.js";import{MENU_BLOCK_TYPE as l}from"./document-nodes.js";import{resolveNavTextCase as w}from"../content/header-bar.js";const A={[l]:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment"},C="data-menu-case",L="column";function N({id:e,template:o,menu:r,dataSource:n,dataRows:d,heading:s,accordionMobile:c,showDividers:m,direction:u,linkAlign:f,linkRange:p,menuStyle:g,currentPage:E,menuStylePhone:P,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,textCase:B,editor:t,...O}){const i=a(T,{owner:{id:String(e??""),type:l,template:o},menu:r,served:k({dataSource:n})?M({dataSource:n,dataRows:d},!!t?.isEditing).rows:void 0,heading:s||void 0,accordionMobile:c,showDividers:m,layout:x(u),linkAlign:f,linkRange:p,menuStyle:g,currentPage:E,pageQuery:S(O)||void 0,menuStylePhone:P,menuPanelWidth:y,menuPanelTintColor:F,menuPanelTintOpacity:_,editing:t?.isEditing});return w(B)!=="capitalised"?i:a("div",{className:"contents",[C]:"capitalised",children:i})}function b(e){for(const[r,n]of Object.entries(A))e[r]={...e[n]};const o=e.MenuBlock;o.defaultProps={...o.defaultProps,direction:L},o.render=N}export{C as MENU_CASE_ATTR,A as PAGE_BLOCKS_FROM_FOOTER,L as PAGE_MENU_DIRECTION_DEFAULT,b as addPageBlocksFromFooter};