@biggive/components 0.0.5 → 0.0.8

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.
@@ -318,82 +318,89 @@ class CampaignGroupsService {
318
318
  }
319
319
  }
320
320
 
321
- const biggiveCampaignCardCss = ":host{display:block;margin-bottom:30px}:host([column='1-5']){width:100%}:host([column='1-2']){width:calc(50% - (30px / 2))}:host([column='1-3']){width:calc(33.3% - (60px / 3))}:host([column='1-4']){width:calc(25% - (90px / 4))}:host([column='1-5']){width:calc(20% - (120px / 5))}.container{font-family:'Euclid Triangle', sans-serif;filter:drop-shadow(-1px 6px 3px rgba(0,0,0,0.25))}.sleeve{clip-path:polygon(\n 0% 0%, \n 0% 0%, \n 100% 0%, \n 100% 0%, \n 100% 100%, \n 100% 100%, \n 10% 100%, \n 0 90% \n )}.content{padding:15px;background-color:#FFFFFF}.campaign-type{margin-left:15px;width:0;height:0;border-style:inset;border-width:86.6px 50px 0 50px;border-color:#2AF135 transparent transparent transparent;float:left;transform:rotate(360deg)}.campaign-type span{display:block;text-align:center;top:-75px;left:-25px;position:relative;width:46.5px;height:46.5px;margin:0;color:#2C089B;font-size:12px}.banner{padding-bottom:30%;background-repeat:no-repeat;background-position:center center;background-size:cover}.banner img{display:none}.meta-wrap.style-1{display:flex;font-size:16px;line-height:20px;margin-bottom:20px}.meta-wrap.style-1 .meta-item{width:50%}.meta-wrap.style-1 .meta-item .label{font-weight:bold}.meta-wrap.style-1 .meta-item .text{color:#2C089B}header{margin-bottom:20px}header .slug{text-transform:uppercase;font-size:12px;line-height:14px}header h3{margin:0;padding:0;font-size:24px;line-height:28px}.meta-wrap.style-2{display:flex;font-size:12px;line-height:14px;margin-bottom:40px}.meta-wrap.style-2 .meta-item{width:50%}.meta-wrap.style-2 .meta-item .label{font-weight:bold;display:block;margin-bottom:10px}.meta-wrap.style-2 .meta-item .text{display:block;font-size:16px;line-height:18px}.meta-wrap.style-2 .meta-item .text i{margin-right:10px}.meta-wrap.style-3{display:flex;font-size:16px;line-height:20px;margin-bottom:20px}.meta-wrap.style-3 .meta-item{margin-right:60px}.meta-wrap.style-3 .meta-item .label{font-weight:bold;display:block;font-size:12px;line-height:14px;margin-bottom:10px}.meta-wrap.style-3 .meta-item .text{display:block;font-size:36px;line-height:40px;font-weight:bold}.meta-wrap.style-3 .meta-item:last-child .text{color:#2C089B}.button-wrap{text-align:right}.button-wrap a{display:inline-block;padding:15px 30px;color:#FFFFFF;background-color:#2C089B;cursor:pointer;text-transform:uppercase;font-size:12px;text-decoration:none}.icon{height:1rem;width:2rem;vertical-align:-.125rem}";
321
+ const biggiveCampaignCardCss = ":host{display:block;margin-bottom:30px}.container{font-family:\"Euclid Triangle\", sans-serif;filter:drop-shadow(-1px 6px 3px rgba(0, 0, 0, 0.25))}.sleeve{clip-path:polygon(0% 0%, 0% 0%, 100% 0%, 100% 0%, 100% 100%, 100% 100%, 10% 100%, 0 90%)}.content{padding:15px;background-color:#FFFFFF}.campaign-type{margin-left:15px;width:0;height:0;border-style:inset;border-width:85px 45px 0 45px;border-color:#2AF135 transparent transparent transparent;float:left;transform:rotate(360deg)}.campaign-type span{display:block;text-align:center;top:-85px;left:-25px;position:relative;width:45px;height:45px;margin:0;color:#2C089B;font-size:0.9rem}.banner{padding-bottom:30%;background-repeat:no-repeat;background-position:center center;background-size:cover}.banner img{display:none}.meta-wrap.style-1{display:flex;font-size:16px;line-height:20px;margin-bottom:20px}.meta-wrap.style-1 .meta-item{width:50%}.meta-wrap.style-1 .meta-item .label{font-weight:bold}.meta-wrap.style-1 .meta-item .text{color:#2C089B}header{margin-bottom:20px}header .slug{text-transform:uppercase;font-size:12px;line-height:14px}header h3{margin:0;padding:0;font-size:24px;line-height:28px}.meta-wrap.style-2{display:flex;font-size:12px;line-height:14px;margin-bottom:40px}.meta-wrap.style-2 .meta-item{width:50%}.meta-wrap.style-2 .meta-item .label{font-weight:bold;display:block;margin-bottom:10px}.meta-wrap.style-2 .meta-item .text{display:block;font-size:16px;line-height:18px}.meta-wrap.style-2 .meta-item .text i{margin-right:10px}.meta-wrap.style-3{display:flex;font-size:16px;line-height:20px;margin-bottom:20px}.meta-wrap.style-3 .meta-item{margin-right:60px}.meta-wrap.style-3 .meta-item .label{font-weight:bold;display:block;font-size:12px;line-height:14px;margin-bottom:10px}.meta-wrap.style-3 .meta-item .text{display:block;font-size:36px;line-height:40px;font-weight:bold}.meta-wrap.style-3 .meta-item:last-child .text{color:#2C089B}.button-wrap{text-align:right}.button-wrap a{display:inline-block;padding:15px 30px;color:#FFFFFF;background-color:#2C089B;cursor:pointer;text-transform:uppercase;font-size:12px;text-decoration:none}.icon{height:1rem;width:2rem;vertical-align:-0.125rem}";
322
322
 
323
323
  const BiggiveCampaignCard = class {
324
324
  constructor(hostRef) {
325
325
  registerInstance(this, hostRef);
326
326
  /**
327
- * @param {string} banner Full URL of a banner image.
327
+ * Full URL of a banner image.
328
328
  */
329
329
  this.banner = '';
330
330
  /**
331
- * @param {string} number (Ceiling of) whole number of days until campaign end.
331
+ * (Ceiling of) whole number of days until campaign end.
332
332
  */
333
333
  this.daysRemaining = null;
334
334
  /**
335
- * @param {number} totalFundsRaised Target for the campaign including matching but excluding any
336
- * tax relief, in major unit of currency e.g. pounds GBP.
335
+ * Target for the campaign including matching but excluding any
336
+ * tax relief, in major unit of currency e.g. pounds GBP.
337
337
  */
338
338
  this.target = null;
339
339
  /**
340
- * @param {string} organisationName Display name of the charity or non-profit.
340
+ * Display name of the charity or non-profit.
341
341
  */
342
342
  this.organisationName = null;
343
343
  /**
344
- * @param {string} organisationName Display name of the charity's specific time-bound fundraising campaign.
344
+ * Display name of the charity's specific time-bound fundraising campaign.
345
345
  */
346
346
  this.campaignTitle = null;
347
347
  /**
348
- * @param {string} campaignType e.g. "Match Funded".
348
+ * e.g. "Match Funded".
349
349
  */
350
350
  this.campaignType = null;
351
351
  /**
352
- * @param {string} beneficiaries Pipe (|) -separated list of full category labels.
352
+ * Array of full beneficiary labels.
353
353
  */
354
- this.beneficiaries = '';
354
+ this.beneficiaries = [];
355
355
  /**
356
- * @param {string} categories Pipe (|) -separated list of full category labels.
356
+ * Array of full category labels.
357
357
  */
358
- this.categories = '';
358
+ this.categories = [];
359
359
  /**
360
- * @param {number} totalFundsRaised Match funds not yet used or reserved, in major unit of currency
361
- * e.g. pounds GBP.
360
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
362
361
  */
363
362
  this.matchFundsRemaining = null;
364
363
  /**
365
- * @param {number} totalFundsRaised Total the campaign has raised so far including matching but excluding any
366
- * tax relief, in major unit of currency e.g. pounds GBP.
364
+ * Total the campaign has raised so far including matching but excluding any
365
+ * tax relief, in major unit of currency e.g. pounds GBP.
367
366
  */
368
367
  this.totalFundsRaised = null;
369
368
  /**
370
- * @param {string} callToActionUrl Full URL of a call to action.
369
+ * Full URL of a call to action.
371
370
  */
372
371
  this.callToActionUrl = null;
373
372
  /**
374
- * @param {string} callToActionLabel Text for the link to `callToActionUrl`.
373
+ * Text for the link to `callToActionUrl`.
375
374
  */
376
375
  this.callToActionLabel = null;
377
376
  }
378
377
  getBeneficiaryIcons() {
379
- return this.beneficiaries.length > 0 ? this.beneficiaries.split('|').map(beneficiary => CampaignGroupsService.getBeneficiaryIcon(beneficiary)) : [];
378
+ return this.beneficiaries.map(beneficiary => CampaignGroupsService.getBeneficiaryIcon(beneficiary));
380
379
  }
381
380
  getCategoryIcons() {
382
- return this.categories.length > 0 ? this.categories.split('|').map(category => CampaignGroupsService.getCategoryIcon(category)) : [];
381
+ return this.categories.map(category => CampaignGroupsService.getCategoryIcon(category));
383
382
  }
384
- formatCurrency(num) {
385
- if (!isNaN(num)) {
386
- return parseInt(num).toLocaleString();
383
+ /**
384
+ * @returns Whole large currency units (e.g. pounds) formatted with symbol.
385
+ */
386
+ formatCurrency(currencyCode, amount) {
387
+ if (amount === null || isNaN(amount)) {
388
+ return '–';
387
389
  }
388
- return num;
390
+ return Intl.NumberFormat('en-GB', {
391
+ style: 'currency',
392
+ currency: currencyCode,
393
+ currencyDisplay: 'symbol',
394
+ maximumFractionDigits: 0,
395
+ }).format(amount);
389
396
  }
390
397
  render() {
391
- return (h("div", { class: "container" }, h("div", { class: "sleeve" }, h("div", { class: "campaign-type" }, h("span", null, this.campaignType)), this.banner.length > 0 ? (h("div", { class: "image-wrap banner", style: { 'background-image': 'url(' + this.banner + ')' } }, h("img", { src: this.banner, class: "banner" }))) : null, h("div", { class: "content" }, h("div", { class: "meta-wrap style-1" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Days Remaining:"), " ", h("span", { class: "text" }, this.daysRemaining)), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Target:"), " ", h("span", { class: "text" }, "\u00A3", this.formatCurrency(this.target)))), h("header", null, h("div", { class: "slug" }, this.organisationName), h("h3", null, this.campaignTitle)), h("div", { class: "meta-wrap style-2" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Categories"), h("span", { class: "text" }, this.getCategoryIcons().map((iconDefinition) => (h("svg", { width: "512", height: "512", xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, h("path", { d: iconDefinition.icon[4].toString() })))))), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Helping"), h("span", { class: "text" }, this.getBeneficiaryIcons().map(iconDefinition => (h("svg", { width: "512", height: "512", xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, h("path", { d: iconDefinition.icon[4].toString() }))))))), h("div", { class: "meta-wrap style-3" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Match", h("br", null), "Funds Remaining"), h("span", { class: "text" }, "\u00A3", this.formatCurrency(this.matchFundsRemaining))), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Total", h("br", null), "Funds Received"), h("span", { class: "text" }, "\u00A3", this.formatCurrency(this.totalFundsRaised)))), h("div", { class: "button-wrap" }, h("a", { href: this.callToActionUrl, class: "call-to-action" }, this.callToActionLabel))))));
398
+ return (h("div", { class: "container" }, h("div", { class: "sleeve" }, h("div", { class: "campaign-type" }, h("span", null, this.campaignType)), this.banner.length > 0 ? (h("div", { class: "image-wrap banner", style: { 'background-image': 'url(' + this.banner + ')' } }, h("img", { src: this.banner, class: "banner" }))) : null, h("div", { class: "content" }, h("div", { class: "meta-wrap style-1" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Days Remaining:"), " ", h("span", { class: "text" }, this.daysRemaining)), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Target:"), " ", h("span", { class: "text" }, this.formatCurrency(this.currencyCode, this.target)))), h("header", null, h("div", { class: "slug" }, this.organisationName), h("h3", null, this.campaignTitle)), h("div", { class: "meta-wrap style-2" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Categories"), h("span", { class: "text" }, this.getCategoryIcons().map((iconDefinition) => (h("svg", { width: "512", height: "512", xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, h("path", { d: iconDefinition.icon[4].toString() })))))), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Helping"), h("span", { class: "text" }, this.getBeneficiaryIcons().map(iconDefinition => (h("svg", { width: "512", height: "512", xmlns: "http://www.w3.org/2000/svg", class: "icon", viewBox: "0 0 512 512" }, h("path", { d: iconDefinition.icon[4].toString() }))))))), h("div", { class: "meta-wrap style-3" }, h("div", { class: "meta-item" }, h("span", { class: "label" }, "Match", h("br", null), "Funds Remaining"), h("span", { class: "text" }, this.formatCurrency(this.currencyCode, this.matchFundsRemaining))), h("div", { class: "meta-item" }, h("span", { class: "label" }, "Total", h("br", null), "Funds Received"), h("span", { class: "text" }, this.formatCurrency(this.currencyCode, this.totalFundsRaised)))), h("div", { class: "button-wrap" }, h("a", { href: this.callToActionUrl, class: "call-to-action" }, this.callToActionLabel))))));
392
399
  }
393
400
  };
394
401
  BiggiveCampaignCard.style = biggiveCampaignCardCss;
395
402
 
396
- const biggiveGridCss = ":host{display:block}.grid{display:-webkit-box;display:-moz-box;display:-webkit-flex;display:flex;-webkit-flex-flow:row wrap;flex-flow:row wrap;-webkit-justify-content:space-between;justify-content:space-between}";
403
+ const biggiveGridCss = ":host{display:block}.grid{display:flex;flex-flow:row wrap;justify-content:space-between}";
397
404
 
398
405
  const BiggiveGrid = class {
399
406
  constructor(hostRef) {
@@ -412,7 +419,7 @@ const DemoCampaignCards = class {
412
419
  registerInstance(this, hostRef);
413
420
  }
414
421
  render() {
415
- return (h("biggive-grid", null, [...Array(12)].map(() => (h("biggive-campaign-card", { banner: getAssetPath('/assets/images/banner.png'), "days-remaining": 50, target: 50000, "organisation-name": "Ardent Theatre Company", "campaign-type": "Match Funded", "campaign-title": "Strike! A play by Tracy Ryan", categories: "Arts/Culture/Heritage|Environment/Conservation|Health/Wellbeing", beneficiaries: "General Public/Humankind", "match-funds-remaining": 17424, "total-funds-raised": 15424, "call-to-action-url": "#", "call-to-action-label": "Donate" })))));
422
+ return (h("biggive-grid", null, [...Array(12)].map(() => (h("biggive-campaign-card", { banner: getAssetPath('/assets/images/banner.png'), daysRemaining: 50, currencyCode: "GBP", target: 50000, organisationName: "Ardent Theatre Company", campaignType: "Match Funded", campaignTitle: "Strike! A play by Tracy Ryan", categories: ['Arts/Culture/Heritage', 'Environment/Conservation', 'Health/Wellbeing'], beneficiaries: ['General Public/Humankind'], matchFundsRemaining: 17424, totalFundsRaised: 15424, callToActionUrl: "#", callToActionLabel: "Donate" })))));
416
423
  }
417
424
  };
418
425
  DemoCampaignCards.style = demoCampaignCardsCss;
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["biggive-campaign-card_3",[[1,"demo-campaign-cards"],[1,"biggive-campaign-card",{"banner":[1],"daysRemaining":[2,"days-remaining"],"target":[2],"organisationName":[1,"organisation-name"],"campaignTitle":[1,"campaign-title"],"campaignType":[1,"campaign-type"],"beneficiaries":[1],"categories":[1],"matchFundsRemaining":[2,"match-funds-remaining"],"totalFundsRaised":[2,"total-funds-raised"],"callToActionUrl":[1,"call-to-action-url"],"callToActionLabel":[1,"call-to-action-label"]}],[1,"biggive-grid"]]]], options);
16
+ return bootstrapLazy([["biggive-campaign-card_3",[[1,"demo-campaign-cards"],[1,"biggive-campaign-card",{"banner":[1],"daysRemaining":[2,"days-remaining"],"currencyCode":[1,"currency-code"],"target":[2],"organisationName":[1,"organisation-name"],"campaignTitle":[1,"campaign-title"],"campaignType":[1,"campaign-type"],"beneficiaries":[16],"categories":[16],"matchFundsRemaining":[2,"match-funds-remaining"],"totalFundsRaised":[2,"total-funds-raised"],"callToActionUrl":[1,"call-to-action-url"],"callToActionLabel":[1,"call-to-action-label"]}],[1,"biggive-grid"]]]], options);
17
17
  });
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["biggive-campaign-card_3",[[1,"demo-campaign-cards"],[1,"biggive-campaign-card",{"banner":[1],"daysRemaining":[2,"days-remaining"],"target":[2],"organisationName":[1,"organisation-name"],"campaignTitle":[1,"campaign-title"],"campaignType":[1,"campaign-type"],"beneficiaries":[1],"categories":[1],"matchFundsRemaining":[2,"match-funds-remaining"],"totalFundsRaised":[2,"total-funds-raised"],"callToActionUrl":[1,"call-to-action-url"],"callToActionLabel":[1,"call-to-action-label"]}],[1,"biggive-grid"]]]], options);
13
+ return bootstrapLazy([["biggive-campaign-card_3",[[1,"demo-campaign-cards"],[1,"biggive-campaign-card",{"banner":[1],"daysRemaining":[2,"days-remaining"],"currencyCode":[1,"currency-code"],"target":[2],"organisationName":[1,"organisation-name"],"campaignTitle":[1,"campaign-title"],"campaignType":[1,"campaign-type"],"beneficiaries":[16],"categories":[16],"matchFundsRemaining":[2,"match-funds-remaining"],"totalFundsRaised":[2,"total-funds-raised"],"callToActionUrl":[1,"call-to-action-url"],"callToActionLabel":[1,"call-to-action-label"]}],[1,"biggive-grid"]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -3,58 +3,64 @@
3
3
  */
4
4
  export declare class BiggiveCampaignCard {
5
5
  /**
6
- * @param {string} banner Full URL of a banner image.
6
+ * Full URL of a banner image.
7
7
  */
8
8
  banner: string;
9
9
  /**
10
- * @param {string} number (Ceiling of) whole number of days until campaign end.
10
+ * (Ceiling of) whole number of days until campaign end.
11
11
  */
12
12
  daysRemaining: number;
13
13
  /**
14
- * @param {number} totalFundsRaised Target for the campaign including matching but excluding any
15
- * tax relief, in major unit of currency e.g. pounds GBP.
14
+ * e.g. 'GBP'.
15
+ */
16
+ currencyCode: string;
17
+ /**
18
+ * Target for the campaign including matching but excluding any
19
+ * tax relief, in major unit of currency e.g. pounds GBP.
16
20
  */
17
21
  target: number;
18
22
  /**
19
- * @param {string} organisationName Display name of the charity or non-profit.
23
+ * Display name of the charity or non-profit.
20
24
  */
21
25
  organisationName: string;
22
26
  /**
23
- * @param {string} organisationName Display name of the charity's specific time-bound fundraising campaign.
27
+ * Display name of the charity's specific time-bound fundraising campaign.
24
28
  */
25
29
  campaignTitle: string;
26
30
  /**
27
- * @param {string} campaignType e.g. "Match Funded".
31
+ * e.g. "Match Funded".
28
32
  */
29
33
  campaignType: string;
30
34
  /**
31
- * @param {string} beneficiaries Pipe (|) -separated list of full category labels.
35
+ * Array of full beneficiary labels.
32
36
  */
33
- beneficiaries: string;
37
+ beneficiaries: string[];
34
38
  /**
35
- * @param {string} categories Pipe (|) -separated list of full category labels.
39
+ * Array of full category labels.
36
40
  */
37
- categories: string;
41
+ categories: string[];
38
42
  /**
39
- * @param {number} totalFundsRaised Match funds not yet used or reserved, in major unit of currency
40
- * e.g. pounds GBP.
43
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
41
44
  */
42
45
  matchFundsRemaining: number;
43
46
  /**
44
- * @param {number} totalFundsRaised Total the campaign has raised so far including matching but excluding any
45
- * tax relief, in major unit of currency e.g. pounds GBP.
47
+ * Total the campaign has raised so far including matching but excluding any
48
+ * tax relief, in major unit of currency e.g. pounds GBP.
46
49
  */
47
50
  totalFundsRaised: number;
48
51
  /**
49
- * @param {string} callToActionUrl Full URL of a call to action.
52
+ * Full URL of a call to action.
50
53
  */
51
54
  callToActionUrl: string;
52
55
  /**
53
- * @param {string} callToActionLabel Text for the link to `callToActionUrl`.
56
+ * Text for the link to `callToActionUrl`.
54
57
  */
55
58
  callToActionLabel: string;
56
59
  private getBeneficiaryIcons;
57
60
  private getCategoryIcons;
61
+ /**
62
+ * @returns Whole large currency units (e.g. pounds) formatted with symbol.
63
+ */
58
64
  private formatCurrency;
59
65
  render(): any;
60
66
  }
@@ -8,51 +8,55 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  export namespace Components {
9
9
  interface BiggiveCampaignCard {
10
10
  /**
11
- * @param banner Full URL of a banner image.
11
+ * Full URL of a banner image.
12
12
  */
13
13
  "banner": string;
14
14
  /**
15
- * @param beneficiaries Pipe (|) -separated list of full category labels.
15
+ * Array of full beneficiary labels.
16
16
  */
17
- "beneficiaries": string;
17
+ "beneficiaries": string[];
18
18
  /**
19
- * @param callToActionLabel Text for the link to `callToActionUrl`.
19
+ * Text for the link to `callToActionUrl`.
20
20
  */
21
21
  "callToActionLabel": string;
22
22
  /**
23
- * @param callToActionUrl Full URL of a call to action.
23
+ * Full URL of a call to action.
24
24
  */
25
25
  "callToActionUrl": string;
26
26
  /**
27
- * @param organisationName Display name of the charity's specific time-bound fundraising campaign.
27
+ * Display name of the charity's specific time-bound fundraising campaign.
28
28
  */
29
29
  "campaignTitle": string;
30
30
  /**
31
- * @param campaignType e.g. "Match Funded".
31
+ * e.g. "Match Funded".
32
32
  */
33
33
  "campaignType": string;
34
34
  /**
35
- * @param categories Pipe (|) -separated list of full category labels.
35
+ * Array of full category labels.
36
36
  */
37
- "categories": string;
37
+ "categories": string[];
38
38
  /**
39
- * @param number (Ceiling of) whole number of days until campaign end.
39
+ * e.g. 'GBP'.
40
+ */
41
+ "currencyCode": string;
42
+ /**
43
+ * (Ceiling of) whole number of days until campaign end.
40
44
  */
41
45
  "daysRemaining": number;
42
46
  /**
43
- * @param totalFundsRaised Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
47
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
44
48
  */
45
49
  "matchFundsRemaining": number;
46
50
  /**
47
- * @param organisationName Display name of the charity or non-profit.
51
+ * Display name of the charity or non-profit.
48
52
  */
49
53
  "organisationName": string;
50
54
  /**
51
- * @param totalFundsRaised Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
55
+ * Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
52
56
  */
53
57
  "target": number;
54
58
  /**
55
- * @param totalFundsRaised Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
59
+ * Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
56
60
  */
57
61
  "totalFundsRaised": number;
58
62
  }
@@ -89,51 +93,55 @@ declare global {
89
93
  declare namespace LocalJSX {
90
94
  interface BiggiveCampaignCard {
91
95
  /**
92
- * @param banner Full URL of a banner image.
96
+ * Full URL of a banner image.
93
97
  */
94
98
  "banner"?: string;
95
99
  /**
96
- * @param beneficiaries Pipe (|) -separated list of full category labels.
100
+ * Array of full beneficiary labels.
97
101
  */
98
- "beneficiaries"?: string;
102
+ "beneficiaries"?: string[];
99
103
  /**
100
- * @param callToActionLabel Text for the link to `callToActionUrl`.
104
+ * Text for the link to `callToActionUrl`.
101
105
  */
102
106
  "callToActionLabel"?: string;
103
107
  /**
104
- * @param callToActionUrl Full URL of a call to action.
108
+ * Full URL of a call to action.
105
109
  */
106
110
  "callToActionUrl"?: string;
107
111
  /**
108
- * @param organisationName Display name of the charity's specific time-bound fundraising campaign.
112
+ * Display name of the charity's specific time-bound fundraising campaign.
109
113
  */
110
114
  "campaignTitle"?: string;
111
115
  /**
112
- * @param campaignType e.g. "Match Funded".
116
+ * e.g. "Match Funded".
113
117
  */
114
118
  "campaignType"?: string;
115
119
  /**
116
- * @param categories Pipe (|) -separated list of full category labels.
120
+ * Array of full category labels.
121
+ */
122
+ "categories"?: string[];
123
+ /**
124
+ * e.g. 'GBP'.
117
125
  */
118
- "categories"?: string;
126
+ "currencyCode"?: string;
119
127
  /**
120
- * @param number (Ceiling of) whole number of days until campaign end.
128
+ * (Ceiling of) whole number of days until campaign end.
121
129
  */
122
130
  "daysRemaining"?: number;
123
131
  /**
124
- * @param totalFundsRaised Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
132
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
125
133
  */
126
134
  "matchFundsRemaining"?: number;
127
135
  /**
128
- * @param organisationName Display name of the charity or non-profit.
136
+ * Display name of the charity or non-profit.
129
137
  */
130
138
  "organisationName"?: string;
131
139
  /**
132
- * @param totalFundsRaised Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
140
+ * Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
133
141
  */
134
142
  "target"?: number;
135
143
  /**
136
- * @param totalFundsRaised Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
144
+ * Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
137
145
  */
138
146
  "totalFundsRaised"?: number;
139
147
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biggive/components",
3
- "version": "0.0.5",
3
+ "version": "0.0.8",
4
4
  "description": "Big Give Components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -20,11 +20,11 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "build": "stencil build --docs",
23
- "start": "stencil build --dev --watch --serve --port 3939",
23
+ "start": "stencil build --dev --watch --serve",
24
24
  "lint": "eslint src/**/*{.ts,.tsx}",
25
25
  "lint:fix": "eslint --fix src/**/*{.ts,.tsx}",
26
- "test": "stencil test --spec --e2e --port 3939",
27
- "test.watch": "stencil test --spec --e2e --watchAll --port 3939",
26
+ "test": "stencil test --spec --e2e",
27
+ "test.watch": "stencil test --spec --e2e --watchAll",
28
28
  "generate": "stencil generate",
29
29
  "prepare": "husky install",
30
30
  "pre-commit": "lint-staged"
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@stencil/eslint-plugin": "^0.4.0",
42
+ "@stencil/sass": "^1.5.2",
42
43
  "@types/jest": "^27.0.3",
43
44
  "eslint-config-prettier": "^8.5.0",
44
45
  "eslint-plugin-prettier": "^4.2.1",
package/readme.md CHANGED
@@ -66,7 +66,9 @@ For now:
66
66
  folder as the app's own images. This is the approach taken on [this proof of concept branch](https://github.com/thebiggive/donate-frontend/tree/COM-5-proof-of-concept).
67
67
  Should we find managing image assets messy in apps generally, an alternative approach we might
68
68
  try is importing images to component style and adding [`@rollup/plugin-image`](https://github.com/rollup/plugins/tree/master/packages/image/#readme)
69
- to Stencil's build config.
69
+ to Stencil's build config. Or if there are only a few, we could also investigate
70
+ whether `assetsDirs` on a `@Component` folds in what's needed in a way that works
71
+ in Angular et al.
70
72
 
71
73
  ### Make any required changes to the sample web components
72
74