@biggive/components 0.0.4 → 0.0.7

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.
@@ -3,54 +3,53 @@
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
+ * Target for the campaign including matching but excluding any
15
+ * tax relief, in major unit of currency e.g. pounds GBP.
16
16
  */
17
17
  target: number;
18
18
  /**
19
- * @param {string} organisationName Display name of the charity or non-profit.
19
+ * Display name of the charity or non-profit.
20
20
  */
21
21
  organisationName: string;
22
22
  /**
23
- * @param {string} organisationName Display name of the charity's specific time-bound fundraising campaign.
23
+ * Display name of the charity's specific time-bound fundraising campaign.
24
24
  */
25
25
  campaignTitle: string;
26
26
  /**
27
- * @param {string} campaignType e.g. "Match Funded".
27
+ * e.g. "Match Funded".
28
28
  */
29
29
  campaignType: string;
30
30
  /**
31
- * @param {string} beneficiaries Pipe (|) -separated list of full category labels.
31
+ * Array of full beneficiary labels.
32
32
  */
33
- beneficiaries: string;
33
+ beneficiaries: string[];
34
34
  /**
35
- * @param {string} 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} totalFundsRaised Match funds not yet used or reserved, in major unit of currency
40
- * e.g. pounds GBP.
39
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
41
40
  */
42
41
  matchFundsRemaining: number;
43
42
  /**
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.
43
+ * Total the campaign has raised so far including matching but excluding any
44
+ * tax relief, in major unit of currency e.g. pounds GBP.
46
45
  */
47
46
  totalFundsRaised: number;
48
47
  /**
49
- * @param {string} callToActionUrl Full URL of a call to action.
48
+ * Full URL of a call to action.
50
49
  */
51
50
  callToActionUrl: string;
52
51
  /**
53
- * @param {string} callToActionLabel Text for the link to `callToActionUrl`.
52
+ * Text for the link to `callToActionUrl`.
54
53
  */
55
54
  callToActionLabel: string;
56
55
  private getBeneficiaryIcons;
@@ -8,51 +8,51 @@ 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
+ * (Ceiling of) whole number of days until campaign end.
40
40
  */
41
41
  "daysRemaining": number;
42
42
  /**
43
- * @param totalFundsRaised Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
43
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
44
44
  */
45
45
  "matchFundsRemaining": number;
46
46
  /**
47
- * @param organisationName Display name of the charity or non-profit.
47
+ * Display name of the charity or non-profit.
48
48
  */
49
49
  "organisationName": string;
50
50
  /**
51
- * @param totalFundsRaised Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
51
+ * Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
52
52
  */
53
53
  "target": number;
54
54
  /**
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.
55
+ * Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
56
56
  */
57
57
  "totalFundsRaised": number;
58
58
  }
@@ -89,51 +89,51 @@ declare global {
89
89
  declare namespace LocalJSX {
90
90
  interface BiggiveCampaignCard {
91
91
  /**
92
- * @param banner Full URL of a banner image.
92
+ * Full URL of a banner image.
93
93
  */
94
94
  "banner"?: string;
95
95
  /**
96
- * @param beneficiaries Pipe (|) -separated list of full category labels.
96
+ * Array of full beneficiary labels.
97
97
  */
98
- "beneficiaries"?: string;
98
+ "beneficiaries"?: string[];
99
99
  /**
100
- * @param callToActionLabel Text for the link to `callToActionUrl`.
100
+ * Text for the link to `callToActionUrl`.
101
101
  */
102
102
  "callToActionLabel"?: string;
103
103
  /**
104
- * @param callToActionUrl Full URL of a call to action.
104
+ * Full URL of a call to action.
105
105
  */
106
106
  "callToActionUrl"?: string;
107
107
  /**
108
- * @param organisationName Display name of the charity's specific time-bound fundraising campaign.
108
+ * Display name of the charity's specific time-bound fundraising campaign.
109
109
  */
110
110
  "campaignTitle"?: string;
111
111
  /**
112
- * @param campaignType e.g. "Match Funded".
112
+ * e.g. "Match Funded".
113
113
  */
114
114
  "campaignType"?: string;
115
115
  /**
116
- * @param categories Pipe (|) -separated list of full category labels.
116
+ * Array of full category labels.
117
117
  */
118
- "categories"?: string;
118
+ "categories"?: string[];
119
119
  /**
120
- * @param number (Ceiling of) whole number of days until campaign end.
120
+ * (Ceiling of) whole number of days until campaign end.
121
121
  */
122
122
  "daysRemaining"?: number;
123
123
  /**
124
- * @param totalFundsRaised Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
124
+ * Match funds not yet used or reserved, in major unit of currency e.g. pounds GBP.
125
125
  */
126
126
  "matchFundsRemaining"?: number;
127
127
  /**
128
- * @param organisationName Display name of the charity or non-profit.
128
+ * Display name of the charity or non-profit.
129
129
  */
130
130
  "organisationName"?: string;
131
131
  /**
132
- * @param totalFundsRaised Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
132
+ * Target for the campaign including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
133
133
  */
134
134
  "target"?: number;
135
135
  /**
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.
136
+ * Total the campaign has raised so far including matching but excluding any tax relief, in major unit of currency e.g. pounds GBP.
137
137
  */
138
138
  "totalFundsRaised"?: number;
139
139
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@biggive/components",
3
- "version": "0.0.4",
3
+ "version": "0.0.7",
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
@@ -22,6 +22,8 @@ npm install
22
22
  npm start
23
23
  ```
24
24
 
25
+ ## Development
26
+
25
27
  ### Follow Stencil + repository conventions
26
28
 
27
29
  CI runs lint checks, but there are tools to help you follow the expected code style so you don't have
@@ -37,6 +39,37 @@ Husky should also set you up a pre-commit hook that fixes anything it can automa
37
39
  about anything else. If you don't appear to have this and had already installed packages before this
38
40
  feature was set up, run `npm install` again.
39
41
 
42
+ ### Dependencies and build output
43
+
44
+ Anything externally managed should be loaded with npm and no copies checked into this codebase. We can use Stencil `copy` tasks and target app build strategies to get things in the right place.
45
+
46
+ Generated build outputs should similarly be `.gitignore`d.
47
+
48
+ ### Asset dependencies
49
+
50
+ So far our strategy has been to avoid separate file assets where this is an out-the-box option, but
51
+ to choose copying over more complex build time changes (e.g. base-64-inlining images) otherwise.
52
+ This is to get the simplest working proof of concept up quickly and we may revisit it soon.
53
+
54
+ For now:
55
+
56
+ * FontAwesome uses pure SVGs and not fonts. This seems to work well and I suspect is the best option
57
+ for performance, component interoperability, simplicity and licence compliance.
58
+ * The Euclid font is copied with a Stencil `copy` task and available in the dist output's
59
+ `assets/fonts`. An Angular app's build, for example, can then use the style with the following
60
+ addition to an `angular.json` `"styles"` key:
61
+ `"node_modules/@biggive/components/dist/biggive/assets/fonts/EuclidTriangle/stylesheet.css"`
62
+ * Images are also copied with a Stencil `copy` task, and fixed references use getAssetPath() plus
63
+ an absolute path, e.g. `getAssetPath('/assets/images/banner.png')`. See the
64
+ [Stencil asset docs](https://stenciljs.com/docs/assets) for more on this. Angular seems to be
65
+ able to use this without `setAssetPath()` if we config its `"assets"` key to put files in the same
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
+ Should we find managing image assets messy in apps generally, an alternative approach we might
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. 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.
72
+
40
73
  ### Make any required changes to the sample web components
41
74
 
42
75
  The web components are configured in /src/components
@@ -105,7 +138,7 @@ These can be added to an HTML page with the following code:
105
138
  <biggive-grid>
106
139
 
107
140
  <biggive-campaign-card
108
- banner="./assets/img/banner.png"
141
+ banner="/assets/images/banner.png"
109
142
  days-remaining={50}
110
143
  target={50000}
111
144
  organisation-name="Ardent Theatre Company"