@drawbridge/components 0.1.42 → 0.1.44

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.
@@ -88,7 +88,7 @@ const FormSubdomainHeader = ({
88
88
  reverse: true,
89
89
  variant: "link"
90
90
  },
91
- children: BACK
91
+ children: back.text || BACK
92
92
  }
93
93
  ),
94
94
  heading
@@ -54,7 +54,7 @@ const FormSubdomainHeader = ({
54
54
  reverse: true,
55
55
  variant: "link"
56
56
  },
57
- children: BACK
57
+ children: back.text || BACK
58
58
  }
59
59
  ),
60
60
  heading
@@ -1047,15 +1047,19 @@ const FormSubdomainSection = ({
1047
1047
  {
1048
1048
  ...{
1049
1049
  // Back keeps what this step holds so far, answered or not.
1050
+ // @story public-entry/order-step
1051
+ // The order step's arrow reads the step's title in place of "Back" ( Simon, 2026-11-23 ).
1050
1052
  ...back && {
1051
1053
  back: {
1052
- onClick: () => back(getValues())
1054
+ onClick: () => back(getValues()),
1055
+ ...(section == null ? void 0 : section.type) === "order" && { text: section == null ? void 0 : section.title }
1053
1056
  }
1054
1057
  },
1055
1058
  button,
1056
1059
  description: section == null ? void 0 : section.description,
1057
1060
  style,
1058
- title: section == null ? void 0 : section.title
1061
+ // The arrow already reads the order step's title; with no arrow the step keeps its heading.
1062
+ title: back && (section == null ? void 0 : section.type) === "order" ? void 0 : section == null ? void 0 : section.title
1059
1063
  }
1060
1064
  }
1061
1065
  )
@@ -1010,15 +1010,19 @@ const FormSubdomainSection = ({
1010
1010
  {
1011
1011
  ...{
1012
1012
  // Back keeps what this step holds so far, answered or not.
1013
+ // @story public-entry/order-step
1014
+ // The order step's arrow reads the step's title in place of "Back" ( Simon, 2026-11-23 ).
1013
1015
  ...back && {
1014
1016
  back: {
1015
- onClick: () => back(getValues())
1017
+ onClick: () => back(getValues()),
1018
+ ...(section == null ? void 0 : section.type) === "order" && { text: section == null ? void 0 : section.title }
1016
1019
  }
1017
1020
  },
1018
1021
  button,
1019
1022
  description: section == null ? void 0 : section.description,
1020
1023
  style,
1021
- title: section == null ? void 0 : section.title
1024
+ // The arrow already reads the order step's title; with no arrow the step keeps its heading.
1025
+ title: back && (section == null ? void 0 : section.type) === "order" ? void 0 : section == null ? void 0 : section.title
1022
1026
  }
1023
1027
  }
1024
1028
  )
@@ -20,6 +20,7 @@ __export(entry_exports, {
20
20
  AFTER: () => AFTER,
21
21
  afterOrder: () => afterOrder,
22
22
  agreementContent: () => agreementContent,
23
+ agreementName: () => agreementName,
23
24
  agreementPhrase: () => agreementPhrase,
24
25
  agreementShown: () => agreementShown,
25
26
  agreementTitles: () => agreementTitles,
@@ -73,6 +74,7 @@ const agreementTitles = {
73
74
  marketing: "Marketing terms",
74
75
  sms: "SMS terms"
75
76
  };
77
+ const agreementName = (id, agreement) => id === "privacy" ? (agreement == null ? void 0 : agreement.label) || "Privacy policy" : agreementTitles[id];
76
78
  const agreementContent = (agreement) => {
77
79
  if ((agreement == null ? void 0 : agreement.confirmed) === false) return null;
78
80
  const type = (agreement == null ? void 0 : agreement.type) || ((agreement == null ? void 0 : agreement.link) ? "link" : "document");
@@ -106,6 +108,7 @@ const termsOptOut = ({ giveaway, sms } = {}) => giveaway === false ? null : "If
106
108
  AFTER,
107
109
  afterOrder,
108
110
  agreementContent,
111
+ agreementName,
109
112
  agreementPhrase,
110
113
  agreementShown,
111
114
  agreementTitles,
@@ -34,6 +34,7 @@ const agreementTitles = {
34
34
  marketing: "Marketing terms",
35
35
  sms: "SMS terms"
36
36
  };
37
+ const agreementName = (id, agreement) => id === "privacy" ? (agreement == null ? void 0 : agreement.label) || "Privacy policy" : agreementTitles[id];
37
38
  const agreementContent = (agreement) => {
38
39
  if ((agreement == null ? void 0 : agreement.confirmed) === false) return null;
39
40
  const type = (agreement == null ? void 0 : agreement.type) || ((agreement == null ? void 0 : agreement.link) ? "link" : "document");
@@ -66,6 +67,7 @@ export {
66
67
  AFTER,
67
68
  afterOrder,
68
69
  agreementContent,
70
+ agreementName,
69
71
  agreementPhrase,
70
72
  agreementShown,
71
73
  agreementTitles,
@@ -244,7 +244,7 @@ const TemplateModal = ({
244
244
  rel: "noopener noreferrer",
245
245
  svg: import_arrow_right.default,
246
246
  target: "_blank",
247
- text: import_entry.agreementTitles[id]
247
+ text: (0, import_entry.agreementName)(id, agreements[id])
248
248
  }
249
249
  },
250
250
  id
@@ -265,7 +265,7 @@ const TemplateModal = ({
265
265
  });
266
266
  },
267
267
  svg: import_arrow_right.default,
268
- text: import_entry.agreementTitles[id]
268
+ text: (0, import_entry.agreementName)(id, agreements[id])
269
269
  }
270
270
  },
271
271
  id
@@ -17,7 +17,7 @@ import CardPrize from "../shared/card-prize.mjs";
17
17
  import ArrowRight from "../icons/arrow-right.mjs";
18
18
  import Flag from "../icons/flag.mjs";
19
19
  import Warning from "../icons/warning.mjs";
20
- import { afterOrder, agreementTitles, copy, formOn, giveawayOn, menuAgreements } from "./lib/entry.mjs";
20
+ import { afterOrder, agreementName, agreementTitles, copy, formOn, giveawayOn, menuAgreements } from "./lib/entry.mjs";
21
21
  import { motion } from "../shared/lib/motion.mjs";
22
22
  const TemplateModal = ({
23
23
  buttons,
@@ -212,7 +212,7 @@ const TemplateModal = ({
212
212
  rel: "noopener noreferrer",
213
213
  svg: ArrowRight,
214
214
  target: "_blank",
215
- text: agreementTitles[id]
215
+ text: agreementName(id, agreements[id])
216
216
  }
217
217
  },
218
218
  id
@@ -233,7 +233,7 @@ const TemplateModal = ({
233
233
  });
234
234
  },
235
235
  svg: ArrowRight,
236
- text: agreementTitles[id]
236
+ text: agreementName(id, agreements[id])
237
237
  }
238
238
  },
239
239
  id
@@ -111,11 +111,11 @@ const footerAgreements = ({ agreements = {}, phone, texts }) => {
111
111
  };
112
112
  const footerRows = (agreements = {}, texts) => Object.keys(agreements || {}).filter((key) => texts || key !== "sms");
113
113
  const agreementRows = (agreements = {}, texts) => footerRows(agreements, texts).map((id) => {
114
- var _a, _b, _c, _d;
114
+ var _a, _b, _c, _d, _e;
115
115
  return {
116
116
  id,
117
117
  on: Boolean((_b = (_a = agreements == null ? void 0 : agreements[id]) == null ? void 0 : _a.values) == null ? void 0 : _b.enabled),
118
- title: ((_c = agreements[id]) == null ? void 0 : _c.title) || ((_d = import_entry.agreementTitles) == null ? void 0 : _d[id]) || id
118
+ title: id === "privacy" ? (0, import_entry.agreementName)(id, (_c = agreements[id]) == null ? void 0 : _c.values) : ((_d = agreements[id]) == null ? void 0 : _d.title) || ((_e = import_entry.agreementTitles) == null ? void 0 : _e[id]) || id
119
119
  };
120
120
  });
121
121
  const readableDocuments = (agreements = {}, texts) => footerRows(agreements, texts).filter((id) => {
@@ -1,4 +1,4 @@
1
- import { agreementContent, agreementPhrase, agreementTitles, agreementWording } from "../../bridge/lib/entry.mjs";
1
+ import { agreementContent, agreementName, agreementPhrase, agreementTitles, agreementWording } from "../../bridge/lib/entry.mjs";
2
2
  const MAX_SECTIONS = 3;
3
3
  const MAX_ADS = 5;
4
4
  const adsLimit = (count) => count >= MAX_ADS ? "A campaign can have up to " + MAX_ADS + " advertisements." : null;
@@ -64,11 +64,11 @@ const footerAgreements = ({ agreements = {}, phone, texts }) => {
64
64
  };
65
65
  const footerRows = (agreements = {}, texts) => Object.keys(agreements || {}).filter((key) => texts || key !== "sms");
66
66
  const agreementRows = (agreements = {}, texts) => footerRows(agreements, texts).map((id) => {
67
- var _a, _b, _c, _d;
67
+ var _a, _b, _c, _d, _e;
68
68
  return {
69
69
  id,
70
70
  on: Boolean((_b = (_a = agreements == null ? void 0 : agreements[id]) == null ? void 0 : _a.values) == null ? void 0 : _b.enabled),
71
- title: ((_c = agreements[id]) == null ? void 0 : _c.title) || ((_d = agreementTitles) == null ? void 0 : _d[id]) || id
71
+ title: id === "privacy" ? agreementName(id, (_c = agreements[id]) == null ? void 0 : _c.values) : ((_d = agreements[id]) == null ? void 0 : _d.title) || ((_e = agreementTitles) == null ? void 0 : _e[id]) || id
72
72
  };
73
73
  });
74
74
  const readableDocuments = (agreements = {}, texts) => footerRows(agreements, texts).filter((id) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drawbridge/components",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "exports": {
5
5
  "./advertisement": {
6
6
  "types": "./types/advertisement.d.ts",
@@ -47,6 +47,9 @@ export declare const agreementPhrase: ( key: string, label?: string | null ) =>
47
47
  // The menu's short names for the agreements, in the menu's order.
48
48
  export declare const agreementTitles: { terms: string; privacy: string; marketing: string; sms: string };
49
49
 
50
+ // The name a menu row reads: Privacy's label ( "Privacy policy" while blank ), the others' short names.
51
+ export declare const agreementName: ( id: string, agreement?: { label?: string | null } ) => string;
52
+
50
53
  // What an agreement opens, or null while nothing is confirmed.
51
54
  export declare const agreementContent: ( agreement?: { confirmed?: boolean; document?: string; link?: string; type?: string } ) => 'document' | 'link' | null;
52
55