-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1215 from daniel-ac-martin/search-box
Add SearchBox component and allow form-actions to be configured
- Loading branch information
Showing
39 changed files
with
948 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
@import "@not-govuk/sass-base"; | ||
@import "govuk-frontend/dist/govuk/components/error-message/index"; | ||
@import "govuk-frontend/dist/govuk/utilities/_visually-hidden"; | ||
|
||
.govuk-error-message { | ||
&--hidden { | ||
@extend .govuk-visually-hidden; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
@import "@not-govuk/sass-base"; | ||
@import "govuk-frontend/dist/govuk/objects/_form-group"; | ||
|
||
.govuk-form-group { | ||
&--standalone { | ||
&.govuk-form-group--error { | ||
padding-left: 0; | ||
border-left-width: 0; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist/ | ||
node_modules/ | ||
package-lock.json | ||
pnpm-lock.yaml | ||
tsconfig.tsbuildinfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
NotGovUK - Search Box | ||
===================== | ||
|
||
A single-line, form field for searching, with submit button. | ||
|
||
(Heavily inspired by the [Search component] in the [GOV.UK Component Guide].) | ||
|
||
Using this package | ||
------------------ | ||
|
||
First install the package into your project: | ||
|
||
```shell | ||
npm install -S @not-govuk/search-box | ||
``` | ||
|
||
Then use it in your code as follows: | ||
|
||
```js | ||
import React, { createElement as h } from 'react'; | ||
import SearchBox from '@not-govuk/search-box'; | ||
|
||
export const MyComponent = props => ( | ||
<form method="get" action="https://www.google.co.uk/search"> | ||
<SearchBox name="q" label="Search Google" width={15} /> | ||
</form> | ||
); | ||
|
||
export default MyComponent; | ||
``` | ||
|
||
|
||
Working on this package | ||
----------------------- | ||
|
||
Before working on this package you must install its dependencies using | ||
the following command: | ||
|
||
```shell | ||
pnpm install | ||
``` | ||
|
||
|
||
### Testing | ||
|
||
Run the unit tests. | ||
|
||
```shell | ||
npm test | ||
``` | ||
|
||
|
||
### Building | ||
|
||
Build the package by compiling the TypeScript source code. | ||
|
||
```shell | ||
npm run build | ||
``` | ||
|
||
|
||
### Clean-up | ||
|
||
Remove any previously built files. | ||
|
||
```shell | ||
npm run clean | ||
``` | ||
|
||
[Search component]: https://components.publishing.service.gov.uk/component-guide/search | ||
[GOV.UK Component Guide]: https://components.publishing.service.gov.uk/component-guide |
Oops, something went wrong.
5f633b7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://not-gov.uk as production
🚀 Deployed on https://6758b154afa27477535c5e67--notgovuk.netlify.app