northants-design-system 0.4.10 → 1.0.0-alpha.0
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/README.md +16 -39
- package/build/index.js +8473 -7894
- package/build/index.js.map +1 -1
- package/build/index.mjs.js +20 -11
- package/build/index.mjs.js.map +1 -1
- package/build/src/library/components/Autocomplete/Autocomplete.test.d.ts +1 -0
- package/build/src/library/components/BackToTop/BackToTop.test.d.ts +1 -0
- package/build/src/library/components/Card/Card.test.d.ts +1 -0
- package/build/src/library/components/CheckboxListFilter/CheckboxListFilter.test.d.ts +1 -0
- package/build/src/library/components/Column/Column.test.d.ts +1 -0
- package/build/src/library/components/CustomSearch/CustomSearch.test.d.ts +1 -0
- package/build/src/library/components/DynamicIcon/DynamicIcon.test.d.ts +1 -0
- package/build/src/library/components/FileDownload/FileDownload.test.d.ts +1 -0
- package/build/src/library/components/HeadingWithIcon/HeadingWithIcon.test.d.ts +1 -0
- package/build/src/library/components/HeadingWithIconLink/HeadingWithIconLink.test.d.ts +1 -0
- package/build/src/library/components/Pagination/Pagination.test.d.ts +1 -0
- package/build/src/library/components/PostCodeSearch/PostCodeSearch.test.d.ts +1 -0
- package/build/src/library/components/PromotedLinks/PromotedLinks.test.d.ts +1 -0
- package/build/src/library/components/RadioCheckboxInput/RadioCheckboxInput.test.d.ts +1 -0
- package/build/src/library/components/Row/Row.test.d.ts +1 -0
- package/build/src/library/components/StaticMap/StaticMap.test.d.ts +1 -0
- package/build/src/library/components/SummaryList/SummaryList.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryAddToShortList/DirectoryAddToShortList.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryDocumentList/DirectoryDocumentList.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryService/DirectoryService.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryService/DirectoryServiceTransform.d.ts +1 -1
- package/build/src/library/directory/DirectoryService/DirectoryServiceTransform.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryServiceList/DirectoryServiceList.test.d.ts +1 -0
- package/build/src/library/directory/DirectoryShortList/DirectoryShortList.test.d.ts +1 -0
- package/build/src/library/directory/ServiceContact/ServiceContact.test.d.ts +1 -0
- package/build/src/library/directory/ServiceSocialLinks/ServiceSocialLinks.test.d.ts +1 -0
- package/build/src/library/slices/Accordion/Accordion.test.d.ts +1 -0
- package/build/src/library/slices/Cards/Cards.test.d.ts +1 -0
- package/build/src/library/slices/CouncilTaxAlphabeticalDirectory/CouncilTaxAlphabeticalDirectory.test.d.ts +1 -0
- package/build/src/library/slices/GoogleMap/GoogleMap.test.d.ts +1 -0
- package/build/src/library/slices/Image/Image.test.d.ts +1 -0
- package/build/src/library/slices/ImageAndText/ImageAndText.test.d.ts +1 -0
- package/build/src/library/slices/InquestSchedule/InquestSchedule.test.d.ts +1 -0
- package/build/src/library/slices/SearchBox/SearchBox.test.d.ts +1 -0
- package/build/src/library/slices/Video/Video.test.d.ts +1 -0
- package/build/src/library/slices/WarningText/WarningText.test.d.ts +1 -0
- package/build/src/library/structure/AlertBanner/AlertBanner.test.d.ts +1 -0
- package/build/src/library/structure/AlertBannerService/AlertBannerService.test.d.ts +1 -0
- package/build/src/library/structure/BackLink/BackLink.test.d.ts +1 -0
- package/build/src/library/structure/Breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/build/src/library/structure/Contents/Contents.test.d.ts +1 -0
- package/build/src/library/structure/ContentsNavigation/ContentsNavigation.test.d.ts +1 -0
- package/build/src/library/structure/Footer/Footer.test.d.ts +1 -0
- package/build/src/library/structure/FullWidthContainer/FullWidthContainer.test.d.ts +1 -0
- package/build/src/library/structure/Header/Header.test.d.ts +1 -0
- package/build/src/library/structure/HeroImage/HeroImage.test.d.ts +1 -0
- package/build/src/library/structure/HomeHero/HomeHero.test.d.ts +1 -0
- package/build/src/library/structure/NewsArticleFeaturedBlock/NewsArticleFeaturedBlock.test.d.ts +1 -0
- package/build/src/library/structure/NewsArticleList/NewsArticleList.test.d.ts +1 -0
- package/build/src/library/structure/PageMain/PageMain.test.d.ts +1 -0
- package/build/src/library/structure/PromoBanner/PromoBanner.test.d.ts +1 -0
- package/build/src/library/structure/PromoBlock/PromoBlock.test.d.ts +1 -0
- package/build/src/library/structure/SearchResultsList/SearchResultsList.test.d.ts +1 -0
- package/build/src/library/structure/Searchbar/Searchbar.test.d.ts +1 -0
- package/build/src/library/structure/SectionLinks/SectionLinks.test.d.ts +1 -0
- package/build/src/library/structure/SectionLinksSidebar/SectionLinksSidebar.test.d.ts +1 -0
- package/build/src/library/structure/ServicesLinksBoxed/ServicesLinksBoxed.test.d.ts +1 -0
- package/build/src/library/structure/ServicesLinksList/ServicesLinksList.test.d.ts +1 -0
- package/build/src/library/structure/SkipToMainContent/SkipToMainContent.test.d.ts +1 -0
- package/build/src/library/structure/Summary/Summary.test.d.ts +1 -0
- package/package.json +30 -29
package/README.md
CHANGED
|
@@ -6,17 +6,19 @@
|
|
|
6
6
|
|
|
7
7
|
The design system for North Northamptonshire & West Northamptonshire, two brand new unitary councils encompassing Wellingborough, Corby, Daventry, East Northants, Kettering, Northampton, Northamptonshire County and South Northants.
|
|
8
8
|
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
Requires node v18 for Storybook v7. If you have nvm installed then you can run `nvm use` and it will autodetect the correct version of node to use.
|
|
9
12
|
|
|
10
13
|
## Installation
|
|
11
14
|
|
|
12
|
-
### Installation and development of the Design System
|
|
15
|
+
### Installation and development of the Design System
|
|
13
16
|
|
|
14
17
|
You need `node` and `npm` installed.
|
|
15
18
|
|
|
16
19
|
1. Clone the repo and `npm i`
|
|
17
20
|
2. `npm run dev` will start up the Storybook playground and start `rollup` watching for changes.
|
|
18
21
|
|
|
19
|
-
|
|
20
22
|
### Installation using docker
|
|
21
23
|
|
|
22
24
|
This option is recommended if your using a windows machine
|
|
@@ -38,10 +40,8 @@ docker ps
|
|
|
38
40
|
docker-compose stop
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
|
|
42
43
|
## Documentation
|
|
43
44
|
|
|
44
|
-
|
|
45
45
|
This design system is made up from a combination of these libraries:
|
|
46
46
|
|
|
47
47
|
- [Rollup](https://github.com/rollup/rollup)
|
|
@@ -49,22 +49,14 @@ This design system is made up from a combination of these libraries:
|
|
|
49
49
|
- [TypeScript](https://www.typescriptlang.org/)
|
|
50
50
|
- [Jest](https://jestjs.io/) and [React Testing Library](https://github.com/testing-library/react-testing-library) enabling testing of the components
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
52
|
## Examples
|
|
56
53
|
|
|
57
|
-
|
|
58
54
|
👉 **[You can view the design system here](https://northants-design-system.netlify.app)**
|
|
59
55
|
|
|
60
56
|
This is a living documentation powered by [Storybook](https://storybook.js.org/), where you can see all the available components, their variations and documentation.
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
|
|
64
58
|
### Using the design system in your project
|
|
65
59
|
|
|
66
|
-
|
|
67
|
-
|
|
68
60
|
You can find the design system [here on NPM](https://www.npmjs.com/package/northants-design-system).
|
|
69
61
|
|
|
70
62
|
```
|
|
@@ -74,7 +66,7 @@ npm install northants-design-system
|
|
|
74
66
|
npm install react react-dom styled-components @reach/router
|
|
75
67
|
```
|
|
76
68
|
|
|
77
|
-
This design system uses theming - **it will not work without a theme wrapped around the components** - to use a theme you will need to include a `ThemeProvider` from styled components, [you can find out more about how this works here](https://styled-components.com/docs/advanced#theming). Then you will need to import one of the three themes from the design system, or create your own. The three avaliable are `GDS_theme` (a basic style based on the [GDS design system](https://design-system.service.gov.uk/)), `west_theme` and `north_theme` (themes for North and West Northamptonshire styled components).
|
|
69
|
+
This design system uses theming - **it will not work without a theme wrapped around the components** - to use a theme you will need to include a `ThemeProvider` from styled components, [you can find out more about how this works here](https://styled-components.com/docs/advanced#theming). Then you will need to import one of the three themes from the design system, or create your own. The three avaliable are `GDS_theme` (a basic style based on the [GDS design system](https://design-system.service.gov.uk/)), `west_theme` and `north_theme` (themes for North and West Northamptonshire styled components).
|
|
78
70
|
|
|
79
71
|
This `ThemeProvider` can be wrapped around the entire app, or around a single component
|
|
80
72
|
|
|
@@ -112,10 +104,8 @@ const MyComponent = () =>
|
|
|
112
104
|
</ThemeProvider>
|
|
113
105
|
```
|
|
114
106
|
|
|
115
|
-
|
|
116
107
|
## Documentation
|
|
117
108
|
|
|
118
|
-
|
|
119
109
|
### Creating and generating new components
|
|
120
110
|
|
|
121
111
|
There is a util file under `util` called `create-component.js`. Instead of copy pasting components to create a new component, you can just run this command to generate all the files you need to start building out a new component. To use it:
|
|
@@ -140,34 +130,28 @@ The default templates for each file can be modified under `util/templates`.
|
|
|
140
130
|
|
|
141
131
|
Don't forget to add the component to your `index.ts` exports if you want the library to export the component.
|
|
142
132
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
133
|
### How to publish a new version to NPM
|
|
134
|
+
|
|
147
135
|
First, make sure you have an NPM account and are [logged into NPM using the `npm login` command.](https://docs.npmjs.com/creating-a-new-npm-user-account)
|
|
148
136
|
|
|
149
137
|
1. **information about testing needed here**
|
|
150
138
|
2. If tests pass...
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
139
|
+
3. Increment the next version number in the `package.json` file.
|
|
140
|
+
4. `npm publish`. This will:
|
|
141
|
+
- Run the tests
|
|
142
|
+
- Bundle and transpile the code
|
|
143
|
+
- Create and publish a tarball to NPM
|
|
144
|
+
5. If you are wanting to utilise the updated design system you will then need to update the version number of the design system in the `package.json` file within that repo.
|
|
160
145
|
|
|
161
146
|
### Installing component library locally for IE11 (or other uses) but this is easier and less buggy
|
|
162
147
|
|
|
163
148
|
https://www.viget.com/articles/how-to-use-local-unpublished-node-packages-as-project-dependencies/
|
|
164
149
|
|
|
165
|
-
|
|
166
150
|
Good article on this can be found [here](https://www.viget.com/articles/how-to-use-local-unpublished-node-packages-as-project-dependencies/)
|
|
167
151
|
|
|
168
|
-
Install yalc **globally**
|
|
152
|
+
Install yalc **globally**
|
|
169
153
|
Using NPM: `npm i yalc -g`
|
|
170
|
-
Using Yarn: `yarn global add yalc`
|
|
154
|
+
Using Yarn: `yarn global add yalc`
|
|
171
155
|
|
|
172
156
|
In the **northants-design-system**
|
|
173
157
|
You will need node v14.17.3 > to build on windows
|
|
@@ -179,11 +163,9 @@ run `yalc add northants-design-system` then run `npm install` or `yarn`
|
|
|
179
163
|
|
|
180
164
|
Then run `npm run start` to run the application.
|
|
181
165
|
|
|
182
|
-
|
|
183
|
-
|
|
184
166
|
You will need node v14.17.3 > to build on windows
|
|
185
167
|
|
|
186
|
-
Install yalc
|
|
168
|
+
Install yalc
|
|
187
169
|
Using NPM:
|
|
188
170
|
|
|
189
171
|
`npm i yalc -g`
|
|
@@ -192,23 +174,18 @@ Using Yarn:
|
|
|
192
174
|
|
|
193
175
|
`yarn global add yalc`
|
|
194
176
|
|
|
195
|
-
|
|
196
177
|
run `yalc publish` in the design system folder
|
|
197
178
|
|
|
198
179
|
run `yalc add northants-design-system` in ie11-test-folder
|
|
199
180
|
|
|
200
|
-
|
|
201
181
|
`npm install`
|
|
202
182
|
|
|
203
|
-
to make changes and update them
|
|
183
|
+
to make changes and update them
|
|
204
184
|
|
|
205
185
|
in design system `yalc push` (this automatically updates all dependencies on all yalc files)
|
|
206
186
|
|
|
207
187
|
or `yalc publish` in design system and `yalc update` in your projects repo
|
|
208
188
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
189
|
### Installing Component Library Locally
|
|
213
190
|
|
|
214
191
|
Let's say you have another project (`test-app`) on your machine that you want to try installing the component library into without having to first publish the component library. In the `test-app` directory, you can run:
|