@moduk/frontend 1.6.0 → 1.7.1

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.
Files changed (86) hide show
  1. package/dist/nunjucks/moduk/components/character-count/__examples__/with-custom-messages.njk +25 -0
  2. package/dist/nunjucks/moduk/components/character-count/__examples__/with-word-count-custom-messages.njk +25 -0
  3. package/dist/nunjucks/moduk/components/fieldset/__examples__/not-as-page-heading.njk +44 -0
  4. package/dist/nunjucks/moduk/components/notification-banner/__examples__/with-custom-title.njk +6 -0
  5. package/dist/nunjucks/moduk/components/notification-banner/__examples__/with-disable-auto-focus.njk +6 -0
  6. package/nunjucks/moduk/components/character-count/__examples__/with-custom-messages.njk +25 -0
  7. package/nunjucks/moduk/components/character-count/__examples__/with-word-count-custom-messages.njk +25 -0
  8. package/nunjucks/moduk/components/fieldset/__examples__/not-as-page-heading.njk +44 -0
  9. package/nunjucks/moduk/components/notification-banner/__examples__/with-custom-title.njk +6 -0
  10. package/nunjucks/moduk/components/notification-banner/__examples__/with-disable-auto-focus.njk +6 -0
  11. package/package.json +7 -7
  12. package/react/MODUKBody/MODUKBody.d.ts +7 -0
  13. package/react/MODUKBody/MODUKBody.d.ts.map +1 -1
  14. package/react/accordion/Accordion.d.ts +65 -0
  15. package/react/accordion/Accordion.d.ts.map +1 -1
  16. package/react/accordion/AccordionItem.d.ts +14 -0
  17. package/react/accordion/AccordionItem.d.ts.map +1 -1
  18. package/react/back-link/BackLink.d.ts +8 -0
  19. package/react/back-link/BackLink.d.ts.map +1 -1
  20. package/react/character-count/CharacterCount.d.ts +115 -0
  21. package/react/character-count/CharacterCount.d.ts.map +1 -0
  22. package/react/character-count/index.d.ts +3 -0
  23. package/react/character-count/index.d.ts.map +1 -0
  24. package/react/character-count/useThrottledValue.d.ts +6 -0
  25. package/react/character-count/useThrottledValue.d.ts.map +1 -0
  26. package/react/details/Details.d.ts +23 -0
  27. package/react/details/Details.d.ts.map +1 -0
  28. package/react/details/index.d.ts +2 -0
  29. package/react/details/index.d.ts.map +1 -0
  30. package/react/esm/accordion/Accordion.js +4 -3
  31. package/react/esm/character-count/CharacterCount.js +158 -0
  32. package/react/esm/character-count/index.js +2 -0
  33. package/react/esm/character-count/useThrottledValue.js +28 -0
  34. package/react/esm/details/Details.js +35 -0
  35. package/react/esm/details/index.js +1 -0
  36. package/react/esm/fieldset/Fieldset.js +24 -0
  37. package/react/esm/fieldset/FieldsetLegend.js +29 -0
  38. package/react/esm/fieldset/index.js +2 -0
  39. package/react/esm/index.js +3 -0
  40. package/react/esm/notification-banner/NotificationBanner.js +87 -0
  41. package/react/esm/notification-banner/index.js +1 -0
  42. package/react/esm/textarea/Textarea.js +3 -2
  43. package/react/fieldset/Fieldset.d.ts +46 -0
  44. package/react/fieldset/Fieldset.d.ts.map +1 -0
  45. package/react/fieldset/FieldsetLegend.d.ts +18 -0
  46. package/react/fieldset/FieldsetLegend.d.ts.map +1 -0
  47. package/react/fieldset/index.d.ts +3 -0
  48. package/react/fieldset/index.d.ts.map +1 -0
  49. package/react/header/Header.d.ts +53 -0
  50. package/react/header/Header.d.ts.map +1 -1
  51. package/react/header/HeaderNavigationItem.d.ts +8 -0
  52. package/react/header/HeaderNavigationItem.d.ts.map +1 -1
  53. package/react/header/HeaderNavigationLink.d.ts +2 -0
  54. package/react/header/HeaderNavigationLink.d.ts.map +1 -1
  55. package/react/index.d.ts +3 -0
  56. package/react/index.d.ts.map +1 -1
  57. package/react/index.js +1 -1
  58. package/react/index.js.map +1 -1
  59. package/react/internal/Link/Link.d.ts +6 -0
  60. package/react/internal/Link/Link.d.ts.map +1 -1
  61. package/react/notification-banner/NotificationBanner.d.ts +71 -0
  62. package/react/notification-banner/NotificationBanner.d.ts.map +1 -0
  63. package/react/notification-banner/index.d.ts +2 -0
  64. package/react/notification-banner/index.d.ts.map +1 -0
  65. package/react/textarea/Textarea.d.ts +6 -1
  66. package/react/textarea/Textarea.d.ts.map +1 -1
  67. package/src/react/character-count/__examples__/default.tsx +14 -0
  68. package/src/react/character-count/__examples__/not-as-page-heading.tsx +13 -0
  69. package/src/react/character-count/__examples__/with-custom-messages.tsx +24 -0
  70. package/src/react/character-count/__examples__/with-error-message.tsx +16 -0
  71. package/src/react/character-count/__examples__/with-threshold.tsx +15 -0
  72. package/src/react/character-count/__examples__/with-word-count-custom-messages.tsx +18 -0
  73. package/src/react/character-count/__examples__/word-count.tsx +13 -0
  74. package/src/react/details/__examples__/default.tsx +7 -0
  75. package/src/react/details/__examples__/open.tsx +7 -0
  76. package/src/react/fieldset/__examples__/default.tsx +31 -0
  77. package/src/react/fieldset/__examples__/not-as-page-heading.tsx +31 -0
  78. package/src/react/notification-banner/__examples__/default.tsx +7 -0
  79. package/src/react/notification-banner/__examples__/success.tsx +13 -0
  80. package/src/react/notification-banner/__examples__/with-custom-title.tsx +7 -0
  81. package/src/react/notification-banner/__examples__/with-disable-auto-focus.tsx +7 -0
  82. package/src/react/notification-banner/__examples__/with-html.tsx +10 -0
  83. package/client/index.d.ts +0 -2
  84. package/client/index.d.ts.map +0 -1
  85. package/dist/client/index.d.ts +0 -2
  86. package/dist/client/index.d.ts.map +0 -1
@@ -1,5 +1,11 @@
1
1
  import { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ComponentType, type ElementType, type JSX } from 'react';
2
2
  type LinkProps<T extends ElementType> = {
3
+ /**
4
+ * The component to use for links (for example, a Link component
5
+ * from a routing library).
6
+ *
7
+ * Defaults to an anchor tag.
8
+ */
3
9
  component?: T;
4
10
  } & ComponentPropsWithoutRef<T>;
5
11
  type LinksComponentType = Extract<ElementType, 'a' | ComponentType>;
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/react/internal/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,GAAG,EACT,MAAM,OAAO,CAAA;AAEd,KAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI;IACtC,SAAS,CAAC,EAAE,CAAC,CAAA;CACd,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAA;AAE/B,KAAK,kBAAkB,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,GAAG,aAAa,CAAC,CAAA;AAEnE,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,MAAM;IAC3C,CAAC,CAAC,SAAS,kBAAkB,GAAG,GAAG,EACjC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;KAAE,GAAG,KAAK,GACtE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC;AAED,eAAO,MAAM,QAAQ,EAAE,aAOrB,CAAA"}
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/react/internal/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,KAAK,WAAW,EAEhB,KAAK,GAAG,EACT,MAAM,OAAO,CAAA;AAEd,KAAK,SAAS,CAAC,CAAC,SAAS,WAAW,IAAI;IACtC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,CAAC,CAAA;CACd,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAA;AAE/B,KAAK,kBAAkB,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,GAAG,aAAa,CAAC,CAAA;AAEnE,MAAM,WAAW,aAAa,CAAC,KAAK,GAAG,MAAM;IAC3C,CAAC,CAAC,SAAS,kBAAkB,GAAG,GAAG,EACjC,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG;QAAE,GAAG,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;KAAE,GAAG,KAAK,GACtE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC;AAED,eAAO,MAAM,QAAQ,EAAE,aAOrB,CAAA"}
@@ -0,0 +1,71 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
2
+ export interface NotificationBannerProps extends Omit<ComponentPropsWithoutRef<'div'>, 'title'> {
3
+ /**
4
+ * The content for the notification banner.
5
+ *
6
+ * If `children` is a string, the text is automatically wrapped
7
+ * in a `<p className='govuk-notification-banner__heading'>`
8
+ * element.
9
+ *
10
+ * If `children` contains React elements, you should use
11
+ * the `govuk-notification-banner__heading` class with <p> or
12
+ * heading tags such as <h3>. Some examples of this are provided.
13
+ */
14
+ children: ReactNode;
15
+ /**
16
+ * Whether to disable automatic focusing of the notification
17
+ * banner when type is `success` or role is otherwise `alert`.
18
+ */
19
+ disableAutoFocus?: boolean;
20
+ /**
21
+ * Overrides the value of the role attribute for the
22
+ * notification banner. Defaults to `region`. If you set
23
+ * type to `success`, role defaults to `alert`.
24
+ */
25
+ role?: ComponentPropsWithoutRef<'div'>['role'];
26
+ /**
27
+ * The title for the banner. By default, this is "Important"
28
+ * when type is unset, and "Success" when type is `success`.
29
+ */
30
+ title?: ReactNode;
31
+ /**
32
+ * HTML heading tag to use for the title.
33
+ */
34
+ titleHeadingTag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
35
+ /**
36
+ * A custom ID for the title.
37
+ */
38
+ titleId?: string;
39
+ /**
40
+ * The type of notification to render. You can use only the
41
+ * success or null values with this option. If you set type
42
+ * to success, the notification banner sets role to alert.
43
+ * JavaScript then moves the keyboard focus to the notification
44
+ * banner when the page loads. If you do not set type, the
45
+ * notification banner sets role to region.
46
+ */
47
+ type?: 'success';
48
+ }
49
+ /**
50
+ * Notification banner.
51
+ *
52
+ * @experimental React components are in alpha and subject to change.
53
+ *
54
+ * @example
55
+ * <NotificationBanner>
56
+ * There may be a delay in processing your application because of the coronavirus outbreak.
57
+ * </NotificationBanner>
58
+ *
59
+ * @example
60
+ * <NotificationBanner type='success'>
61
+ * <h3 className='govuk-notification-banner__heading'>
62
+ * Training outcome recorded and trainee withdrawn
63
+ * </h3>
64
+ * <p className='govuk-body'>
65
+ * Contact <a className='govuk-notification-banner__link' href='#'>example@department.gov.uk</a>
66
+ * {' if you think there’s a problem.'}
67
+ * </p>
68
+ * </NotificationBanner>
69
+ */
70
+ export declare const NotificationBanner: import("react").ForwardRefExoticComponent<NotificationBannerProps & import("react").RefAttributes<HTMLDivElement>>;
71
+ //# sourceMappingURL=NotificationBanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationBanner.d.ts","sourceRoot":"","sources":["../../../src/react/notification-banner/NotificationBanner.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,wBAAwB,EAI7B,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAad,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAC7F;;;;;;;;;;OAUG;IACH,QAAQ,EAAE,SAAS,CAAA;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAA;IAC9C;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACzD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,kBAAkB,oHA6D7B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './NotificationBanner';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/notification-banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
@@ -1,8 +1,13 @@
1
- import { type ComponentPropsWithoutRef, type ReactElement } from 'react';
1
+ import { type ComponentPropsWithoutRef, type ReactElement, type ReactNode } from 'react';
2
2
  import type { ErrorMessageProps } from '../error-message';
3
3
  import type { HintProps } from '../hint';
4
4
  import type { LabelProps } from '../label';
5
5
  export interface TextareaProps extends Omit<ComponentPropsWithoutRef<'textarea'>, 'children'> {
6
+ /**
7
+ * Additional content to be displayed below the <textarea>,
8
+ * within the form group.
9
+ */
10
+ children?: ReactNode;
6
11
  /**
7
12
  * Optional error message. This should be an instance of ErrorMessage.
8
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/react/textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,YAAY,EAAS,MAAM,OAAO,CAAA;AAC3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAC3F;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAA;IAC9C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;IAC9B;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;CACpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,+GAqCnB,CAAA"}
1
+ {"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/react/textarea/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,YAAY,EAAE,KAAK,SAAS,EAAS,MAAM,OAAO,CAAA;AAC3G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,MAAM,WAAW,aAAc,SAAQ,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IAC3F;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,iBAAiB,CAAC,CAAA;IAC9C;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B;;OAEG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;IAC9B;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,wBAAwB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;CACpD;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,+GAuCnB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { CharacterCount, Hint, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ label={
6
+ <Label className='govuk-label--l' isPageHeading>
7
+ Can you provide more detail?
8
+ </Label>
9
+ }
10
+ hint={<Hint>Do not include personal information like your service number.</Hint>}
11
+ maxLength={200}
12
+ name='with-hint'
13
+ />
14
+ )
@@ -0,0 +1,13 @@
1
+ import { CharacterCount, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ label={
6
+ <Label>
7
+ Describe the nature of your event
8
+ </Label>
9
+ }
10
+ maxLength={200}
11
+ name='not-as-page-heading'
12
+ />
13
+ )
@@ -0,0 +1,24 @@
1
+ import { CharacterCount, Hint, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ label={
6
+ <Label className='govuk-label--l' isPageHeading>
7
+ Can you provide more detail?
8
+ </Label>
9
+ }
10
+ hint={<Hint>Do not include personal information like your service number.</Hint>}
11
+ charactersAtLimitText='characters at limit'
12
+ charactersOverLimitText={{
13
+ one: 'characters over limit, one, %{count}',
14
+ other: 'characters over limit, other, %{count}',
15
+ }}
16
+ charactersUnderLimitText={{
17
+ one: 'characters under limit, one, %{count}',
18
+ other: 'characters under limit, other, %{count}',
19
+ }}
20
+ textareaDescriptionText='description text, %{count}'
21
+ maxLength={200}
22
+ name='with-custom-messages'
23
+ />
24
+ )
@@ -0,0 +1,16 @@
1
+ import { CharacterCount, ErrorMessage, Hint, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ defaultValue='I would like to request my service record and have a question about what proof of address is acceptable. The guidance doesn’t say if a digital bank statement will be accepted. Can someone please confirm if'
6
+ errorMessage={<ErrorMessage>Detail must be 200 characters or less</ErrorMessage>}
7
+ label={
8
+ <Label className='govuk-label--l' isPageHeading>
9
+ Can you provide more detail?
10
+ </Label>
11
+ }
12
+ hint={<Hint>Do not include personal information like your service number.</Hint>}
13
+ maxLength={200}
14
+ name='exceeding'
15
+ />
16
+ )
@@ -0,0 +1,15 @@
1
+ import { CharacterCount, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ defaultValue='Type another letter into this field after this message to see the threshold feature'
6
+ label={
7
+ <Label className='govuk-label--l' isPageHeading>
8
+ Can you provide more detail?
9
+ </Label>
10
+ }
11
+ maxLength={112}
12
+ name='with-hint'
13
+ threshold={0.75}
14
+ />
15
+ )
@@ -0,0 +1,18 @@
1
+ import { CharacterCount, Hint, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ label={
6
+ <Label className='govuk-label--l' isPageHeading>
7
+ Can you provide more detail?
8
+ </Label>
9
+ }
10
+ hint={<Hint>Do not include personal information like your service number.</Hint>}
11
+ wordsAtLimitText='words at limit'
12
+ wordsOverLimitText={{ one: 'words over limit, one, %{count}', other: 'words over limit, other, %{count}' }}
13
+ wordsUnderLimitText={{ one: 'words under limit, one, %{count}', other: 'words under limit, other, %{count}' }}
14
+ textareaDescriptionText='description text, %{count}'
15
+ maxWords={5}
16
+ name='with-custom-messages-word-count'
17
+ />
18
+ )
@@ -0,0 +1,13 @@
1
+ import { CharacterCount, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <CharacterCount
5
+ label={
6
+ <Label className='govuk-label--l' isPageHeading>
7
+ Enter a job description
8
+ </Label>
9
+ }
10
+ maxWords={150}
11
+ name='word-count'
12
+ />
13
+ )
@@ -0,0 +1,7 @@
1
+ import { Details } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <Details summary='Help with organisation'>
5
+ We need to know the organisation you work for so we can forward your request to the correct team.
6
+ </Details>
7
+ )
@@ -0,0 +1,7 @@
1
+ import { Details } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <Details summary='Help with organisation' open>
5
+ We need to know the organisation you work for so we can forward your request to the correct team.
6
+ </Details>
7
+ )
@@ -0,0 +1,31 @@
1
+ import { Fieldset, FieldsetLegend, Input, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <Fieldset>
5
+ <FieldsetLegend className='govuk-fieldset__legend--l' isPageHeading>
6
+ What is your address?
7
+ </FieldsetLegend>
8
+ <Input
9
+ autoComplete='address-line1'
10
+ label={<Label>Address line 1</Label>}
11
+ name='address-line-1'
12
+ />
13
+ <Input
14
+ autoComplete='address-line2'
15
+ label={<Label>Address line 2 (optional)</Label>}
16
+ name='address-line-2'
17
+ />
18
+ <Input
19
+ autoComplete='address-level2'
20
+ className='govuk-!-width-two-thirds'
21
+ label={<Label>Town or city</Label>}
22
+ name='address-town'
23
+ />
24
+ <Input
25
+ autoComplete='postal-code'
26
+ className='govuk-input--width-10'
27
+ label={<Label>Postcode</Label>}
28
+ name='address-postcode'
29
+ />
30
+ </Fieldset>
31
+ )
@@ -0,0 +1,31 @@
1
+ import { Fieldset, FieldsetLegend, Input, Label } from '@moduk/frontend/react'
2
+
3
+ export const Example = () => (
4
+ <Fieldset>
5
+ <FieldsetLegend className='govuk-fieldset__legend--s'>
6
+ What is your address?
7
+ </FieldsetLegend>
8
+ <Input
9
+ autoComplete='address-line1'
10
+ label={<Label>Address line 1</Label>}
11
+ name='address-line-1'
12
+ />
13
+ <Input
14
+ autoComplete='address-line2'
15
+ label={<Label>Address line 2 (optional)</Label>}
16
+ name='address-line-2'
17
+ />
18
+ <Input
19
+ autoComplete='address-level2'
20
+ className='govuk-!-width-two-thirds'
21
+ label={<Label>Town or city</Label>}
22
+ name='address-town'
23
+ />
24
+ <Input
25
+ autoComplete='postal-code'
26
+ className='govuk-input--width-10'
27
+ label={<Label>Postcode</Label>}
28
+ name='address-postcode'
29
+ />
30
+ </Fieldset>
31
+ )
@@ -0,0 +1,7 @@
1
+ import { NotificationBanner } from '../NotificationBanner'
2
+
3
+ export const Example = () => (
4
+ <NotificationBanner>
5
+ There may be a delay in processing your application because of the coronavirus outbreak.
6
+ </NotificationBanner>
7
+ )
@@ -0,0 +1,13 @@
1
+ import { NotificationBanner } from '../NotificationBanner'
2
+
3
+ export const Example = () => (
4
+ <NotificationBanner type='success'>
5
+ <h3 className='govuk-notification-banner__heading'>
6
+ Training outcome recorded and trainee withdrawn
7
+ </h3>
8
+ <p className='govuk-body'>
9
+ Contact <a className='govuk-notification-banner__link' href='#'>example@department.gov.uk</a>
10
+ {' if you think there’s a problem.'}
11
+ </p>
12
+ </NotificationBanner>
13
+ )
@@ -0,0 +1,7 @@
1
+ import { NotificationBanner } from '../NotificationBanner'
2
+
3
+ export const Example = () => (
4
+ <NotificationBanner title='Custom title'>
5
+ There may be a delay in processing your application because of the coronavirus outbreak.
6
+ </NotificationBanner>
7
+ )
@@ -0,0 +1,7 @@
1
+ import { NotificationBanner } from '../NotificationBanner'
2
+
3
+ export const Example = () => (
4
+ <NotificationBanner disableAutoFocus>
5
+ There may be a delay in processing your application because of the coronavirus outbreak.
6
+ </NotificationBanner>
7
+ )
@@ -0,0 +1,10 @@
1
+ import { NotificationBanner } from '../NotificationBanner'
2
+
3
+ export const Example = () => (
4
+ <NotificationBanner>
5
+ <p className='govuk-notification-banner__heading'>
6
+ {'You have 7 days left to send your application. '}
7
+ <a className='govuk-notification-banner__link' href='#'>View application</a>.
8
+ </p>
9
+ </NotificationBanner>
10
+ )
package/client/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from 'govuk-frontend';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -1,2 +0,0 @@
1
- export * from 'govuk-frontend';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}