@hmlr/govuk-react-components-library 1.0.1 → 1.0.3

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/.gitattributes ADDED
@@ -0,0 +1,5 @@
1
+ /.storybook/public/pdfjs-4.4.168-dist/** linguist-vendored
2
+ .storybook/public/pdfjs-4.4.168-dist/** linguist-vendored
3
+ bundle-analysis-main.html linguist-generated
4
+ bundle-analysis-pdfvc.html linguist-generated
5
+ .storybook/public/pdfjs-4.4.168-dist/web/** linguist-vendored
package/README.md CHANGED
@@ -22,25 +22,27 @@ npm install @hmlr/govuk-react-components-library
22
22
 
23
23
  ## Components
24
24
 
25
- Note that any component with a `- ***` below means that - This component may javascript to be enabled because of the transitions present in the components using `createAll` or `initAll` recommended by [`govuk-frontend` documentation](https://frontend.design-system.service.gov.uk/configure-components/)
25
+ You can explore the [components in chromatic](https://67da9f53fd479dc895c4293f-davohxhxay.chromatic.com/).
26
+
27
+ Note that any component with a `👈🏽` below means that - This component will need javascript to be enabled because of the transitions present in the components using `createAll` or `initAll` recommended by [`govuk-frontend` documentation](https://frontend.design-system.service.gov.uk/configure-components/)
26
28
 
27
29
  The Components includes:
28
30
 
29
- - [Accordion](./src/components/Accordion/Accordion.tsx) `- ***`
31
+ - [Accordion](./src/components/Accordion/Accordion.tsx) `👈🏽`
30
32
  - [Boolean](./src/components/Boolean/Boolean.tsx)
31
33
  - [Breadcrumbs](./src/components/Breadcrumbs/Breadcrumbs.tsx)
32
- - [Button](./src/components/Button/Button.tsx) `- ***`
34
+ - [Button](./src/components/Button/Button.tsx) `👈🏽`
33
35
  - [CharacterCount](./src/components/CharacterCount/CharacterCount.tsx)
34
- - [CheckBoxes](./src/components/Checkboxes/Checkboxes.tsx) `- ***`
36
+ - [CheckBoxes](./src/components/Checkboxes/Checkboxes.tsx) `👈🏽`
35
37
  - [CookieBanner](./src/components/CookieBanner/CookieBanner.tsx)
36
38
  - [DateInput](./src/components/DateInput/DateInput.tsx)
37
39
  - [Details](./src/components/Details/Details.tsx)
38
40
  - [ErrorMessage](./src/components/ErrorMessage/ErrorMessage.tsx)
39
- - [ErrorSummary](./src/components/ErrorSummary/ErrorSummary.tsx) `- ***`
41
+ - [ErrorSummary](./src/components/ErrorSummary/ErrorSummary.tsx) `👈🏽`
40
42
  - [Fieldset](./src/components/Fieldset/Fieldset.tsx)
41
43
  - [FileUpload](./src/components/FileUpload/FileUpload.tsx)
42
44
  - [Footer](./src/components/Footer/Footer.tsx)
43
- - [Header](./src/components/Header/Header.tsx) `- ***`
45
+ - [Header](./src/components/Header/Header.tsx) `👈🏽`
44
46
  - [Hint](./src/components/Hint/Hint.tsx)
45
47
  - [Input](./src/components/Input/Input.tsx)
46
48
  - [InsetText](./src/components/InsetText/InsetText.tsx)
@@ -49,20 +51,20 @@ The Components includes:
49
51
  - [Pagination](./src/components/Pagination/Pagination.tsx)
50
52
  - [Panel](./src/components/Panel/Panel.tsx)
51
53
  - [PhaseBanner](./src/components/PhaseBanner/PhaseBanner.tsx)
52
- - [Radios](./src/components/Radios/Radios.tsx) `- ***`
54
+ - [Radios](./src/components/Radios/Radios.tsx) `👈🏽`
53
55
  - [Select](./src/components/Select/Select.tsx)
54
56
  - [ServiceNavigation](./src/components/ServiceNavigation/ServiceNavigation.tsx)
55
- - [SkipLink](./src/components/SkipLink/SkipLink.tsx) `- ***`
57
+ - [SkipLink](./src/components/SkipLink/SkipLink.tsx) `👈🏽`
56
58
  - [SummaryList](./src/components/SummaryList/SummaryList.tsx)
57
59
  - [Table](./src/components/Table/Table.tsx)
58
- - [Tabs](./src/components/Tabs/Tabs.tsx) `- ***`
60
+ - [Tabs](./src/components/Tabs/Tabs.tsx) `👈🏽`
59
61
  - [Tag](./src/components/Tag/Tag.tsx)
60
62
  - [TaskList](./src/components/TaskList/TaskList.tsx)
61
63
  - [Textarea](./src/components/Textarea/Textarea.tsx)
62
64
  - [WarningText](./src/components/WarningText/WarningText.tsx)
63
65
 
64
66
  There are Also Several components that can be used for error processing and other functionality like dashboard display:
65
- Note that some of the components below with `- ***` - Means like the above components, javascript needs to be enabled.
67
+ Note that some of the components below with `👈🏽` - Means like the above components, javascript needs to be enabled.
66
68
 
67
69
  - [CardColumn](./src/components/CardColumn/CardColumn.tsx)
68
70
  - [CardLayout](./src/components/CardLayout/CardLayout.tsx)
@@ -75,7 +77,7 @@ Note that some of the components below with `- ***` - Means like the above compo
75
77
  - [NotFoundPage](./src/components/NotFoundPage/NotFoundPage.tsx)
76
78
  - [PDFViewer](./src/components/PDFViewer/PDFViewer.tsx)
77
79
  - [PDFViewerCanvas](./src/components/PDFViewerCanvas/PDFViewerCanvas.tsx) - Read [Documentation](./src/components/PDFViewerCanvas/README.md) to see usage
78
- - [ProblemWithService](./src/components/ProblemWithService/ProblemWithService.tsx) `- ***` - `createAll(ErrorSummary..)` or `ConfigureOverallErrorSummary()`
80
+ - [ProblemWithService](./src/components/ProblemWithService/ProblemWithService.tsx) `👈🏽` - `createAll(ErrorSummary..)` or `ConfigureOverallErrorSummary()`
79
81
  - [WarningInfo](./src/components/WarningInfo//WarningInfo.tsx)
80
82
 
81
83
  There are also some useful components :
@@ -86,7 +88,7 @@ There are also some useful components :
86
88
  - [Loading](./src/components/Loading/Loading.tsx)
87
89
  - [Main](./src/components/Main/Main.tsx)
88
90
 
89
- There are some convenience functions that can be used to configure components with `- ***` mentioned above.
91
+ There are some convenience functions that can be used to configure components with `👈🏽` mentioned above.
90
92
 
91
93
  - [ExtractAccordionConfigFromAttributes](./src/components/Accordion/Accordion.config.tsx) - Extracts Accordion configurations from fixtures attributes e.g. `showAllSectionsText` translates to `showAllSections` in `AccordionConfig`.
92
94
  - [ConfigureOverallAccordion](./src/components/Accordion/Accordion.config.tsx) - Sets overall behavior and configurations for all accordions or in a scope (document or specified element) as per [govuk-frontend accordion api reference](https://frontend.design-system.service.gov.uk/javascript-api-reference/#accordion).
@@ -411,6 +413,22 @@ export default function SuccessPanel() {
411
413
  }
412
414
  ```
413
415
 
416
+ **Customizing components**
417
+
418
+ You can customize the appearance and behavior of components by passing props:
419
+
420
+ ```jsx
421
+ import { Button } from "@hmlr/govuk-react-component-library";
422
+
423
+ export default function CustomButton() {
424
+ return (
425
+ <Button variant="warning" onClick={() => alert("Button clicked!")}>
426
+ Custom Button
427
+ </Button>
428
+ );
429
+ }
430
+ ```
431
+
414
432
  Note: For the `PDFViewer` above you must provide a [PDFJS Distribution version](https://mozilla.github.io/pdf.js/) to be used along with the `PDFViewer` component. follow the steps to use `PDFViewer` component:
415
433
 
416
434
  - Download any version of the [PDFJS Distribution version](https://mozilla.github.io/pdf.js/) suitable for your application