@moduk/frontend 1.2.1 → 1.3.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/assets/images/govuk-crest-2x.png +0 -0
- package/assets/images/govuk-crest.png +0 -0
- package/assets/svg/moduk-header-logo.svg +7 -0
- package/client/index.d.ts +2 -0
- package/client/index.d.ts.map +1 -0
- package/client/moduk-frontend.mjs +1 -0
- package/client/moduk-frontend.umd.js +2 -0
- package/client/moduk-frontend.umd.js.map +1 -0
- package/css/index.css +1 -0
- package/dist/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +9 -9
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/utils.d.ts +25 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/utils.js +111 -0
- package/lib/utils.js.map +1 -0
- package/nunjucks/moduk/components/accordion/__examples__/default.njk +39 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-custom-text.njk +45 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-expanded-items.njk +41 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-h3-headings.njk +40 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-remember-expanded-off.njk +40 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-summary-lines.njk +122 -0
- package/nunjucks/moduk/components/accordion/__examples__/with-text-items.njk +41 -0
- package/nunjucks/moduk/components/accordion/macro.njk +5 -0
- package/nunjucks/moduk/components/back-link/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/back-link/macro.njk +5 -0
- package/nunjucks/moduk/components/breadcrumbs/__examples__/default.njk +18 -0
- package/nunjucks/moduk/components/breadcrumbs/macro.njk +5 -0
- package/nunjucks/moduk/components/button/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/button/__examples__/disabled.njk +6 -0
- package/nunjucks/moduk/components/button/__examples__/group-link.njk +9 -0
- package/nunjucks/moduk/components/button/__examples__/grouping.njk +12 -0
- package/nunjucks/moduk/components/button/__examples__/prevent-double-click.njk +30 -0
- package/nunjucks/moduk/components/button/__examples__/secondary.njk +6 -0
- package/nunjucks/moduk/components/button/__examples__/start.njk +7 -0
- package/nunjucks/moduk/components/button/__examples__/warning.njk +6 -0
- package/nunjucks/moduk/components/button/macro.njk +5 -0
- package/nunjucks/moduk/components/character-count/__examples__/default.njk +15 -0
- package/nunjucks/moduk/components/character-count/__examples__/not-as-page-heading.njk +10 -0
- package/nunjucks/moduk/components/character-count/__examples__/with-error-message.njk +19 -0
- package/nunjucks/moduk/components/character-count/__examples__/with-threshold.njk +14 -0
- package/nunjucks/moduk/components/character-count/__examples__/word-count.njk +12 -0
- package/nunjucks/moduk/components/character-count/macro.njk +5 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/default.njk +37 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/not-as-page-heading.njk +35 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/small.njk +31 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-conditional-reveal.njk +80 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-error-message.njk +40 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-item-hint.njk +32 -0
- package/nunjucks/moduk/components/checkboxes/__examples__/with-none-option.njk +45 -0
- package/nunjucks/moduk/components/checkboxes/macro.njk +5 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/accepted.njk +47 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/default.njk +34 -0
- package/nunjucks/moduk/components/cookie-banner/__examples__/rejected.njk +47 -0
- package/nunjucks/moduk/components/cookie-banner/macro.njk +5 -0
- package/nunjucks/moduk/components/date-input/__examples__/default.njk +16 -0
- package/nunjucks/moduk/components/date-input/__examples__/not-as-page-heading.njk +14 -0
- package/nunjucks/moduk/components/date-input/__examples__/with-date-part-error.njk +35 -0
- package/nunjucks/moduk/components/date-input/__examples__/with-whole-date-error.njk +36 -0
- package/nunjucks/moduk/components/date-input/macro.njk +5 -0
- package/nunjucks/moduk/components/details/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/details/__examples__/open.njk +7 -0
- package/nunjucks/moduk/components/details/macro.njk +11 -0
- package/nunjucks/moduk/components/error-message/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/error-message/macro.njk +5 -0
- package/nunjucks/moduk/components/error-summary/__examples__/default.njk +15 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-description-and-error-list.njk +16 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-checkbox.njk +54 -0
- package/nunjucks/moduk/components/error-summary/__examples__/with-error-linked-to-date-part.njk +45 -0
- package/nunjucks/moduk/components/error-summary/macro.njk +11 -0
- package/nunjucks/moduk/components/fieldset/__examples__/default.njk +45 -0
- package/nunjucks/moduk/components/fieldset/macro.njk +11 -0
- package/nunjucks/moduk/components/file-upload/__examples__/default.njk +9 -0
- package/nunjucks/moduk/components/file-upload/__examples__/with-error.njk +12 -0
- package/nunjucks/moduk/components/file-upload/macro.njk +5 -0
- package/nunjucks/moduk/components/footer/__examples__/default.njk +3 -0
- package/nunjucks/moduk/components/footer/__examples__/with-links.njk +20 -0
- package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation-and-links.njk +72 -0
- package/nunjucks/moduk/components/footer/__examples__/with-secondary-navigation.njk +55 -0
- package/nunjucks/moduk/components/footer/macro.njk +5 -0
- package/nunjucks/moduk/components/header/__examples__/default.njk +3 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name-and-navigation.njk +26 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name-and-no-service-url.njk +6 -0
- package/nunjucks/moduk/components/header/__examples__/with-service-name.njk +7 -0
- package/nunjucks/moduk/components/header/macro.njk +62 -0
- package/nunjucks/moduk/components/input/__examples__/default.njk +11 -0
- package/nunjucks/moduk/components/input/__examples__/not-as-page-heading.njk +9 -0
- package/nunjucks/moduk/components/input/__examples__/with-error.njk +17 -0
- package/nunjucks/moduk/components/input/__examples__/with-fixed-width.njk +57 -0
- package/nunjucks/moduk/components/input/__examples__/with-fluid-width.njk +57 -0
- package/nunjucks/moduk/components/input/__examples__/with-hint.njk +14 -0
- package/nunjucks/moduk/components/input/__examples__/with-numeric.njk +17 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix-error.njk +22 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix-and-suffix.njk +19 -0
- package/nunjucks/moduk/components/input/__examples__/with-prefix.njk +16 -0
- package/nunjucks/moduk/components/input/__examples__/with-suffix.njk +16 -0
- package/nunjucks/moduk/components/input/macro.njk +5 -0
- package/nunjucks/moduk/components/inset-text/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/inset-text/macro.njk +11 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/success.njk +13 -0
- package/nunjucks/moduk/components/notification-banner/__examples__/with-html.njk +12 -0
- package/nunjucks/moduk/components/notification-banner/macro.njk +11 -0
- package/nunjucks/moduk/components/pagination/__examples__/default.njk +25 -0
- package/nunjucks/moduk/components/pagination/__examples__/on-the-first-page.njk +22 -0
- package/nunjucks/moduk/components/pagination/__examples__/on-the-last-page.njk +22 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-ellipses.njk +39 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-link-labels.njk +12 -0
- package/nunjucks/moduk/components/pagination/__examples__/with-next-and-previous-only.njk +12 -0
- package/nunjucks/moduk/components/pagination/macro.njk +5 -0
- package/nunjucks/moduk/components/panel/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/panel/macro.njk +11 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/beta.njk +8 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/default.njk +12 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/with-tag-override.njk +9 -0
- package/nunjucks/moduk/components/phase-banner/__examples__/with-text.njk +8 -0
- package/nunjucks/moduk/components/phase-banner/macro.njk +5 -0
- package/nunjucks/moduk/components/radios/__examples__/default.njk +30 -0
- package/nunjucks/moduk/components/radios/__examples__/inline.njk +26 -0
- package/nunjucks/moduk/components/radios/__examples__/not-as-page-heading.njk +29 -0
- package/nunjucks/moduk/components/radios/__examples__/small.njk +31 -0
- package/nunjucks/moduk/components/radios/__examples__/with-conditional-reveal.njk +80 -0
- package/nunjucks/moduk/components/radios/__examples__/with-divider-option.njk +29 -0
- package/nunjucks/moduk/components/radios/__examples__/with-error-message.njk +33 -0
- package/nunjucks/moduk/components/radios/__examples__/with-item-hint.njk +31 -0
- package/nunjucks/moduk/components/radios/macro.njk +5 -0
- package/nunjucks/moduk/components/select/__examples__/default.njk +28 -0
- package/nunjucks/moduk/components/select/__examples__/with-hint.njk +55 -0
- package/nunjucks/moduk/components/select/macro.njk +5 -0
- package/nunjucks/moduk/components/skip-link/__examples__/default.njk +11 -0
- package/nunjucks/moduk/components/skip-link/macro.njk +5 -0
- package/nunjucks/moduk/components/summary-list/__examples__/cards-with-action.njk +83 -0
- package/nunjucks/moduk/components/summary-list/__examples__/cards.njk +221 -0
- package/nunjucks/moduk/components/summary-list/__examples__/default.njk +74 -0
- package/nunjucks/moduk/components/summary-list/__examples__/with-no-actions.njk +38 -0
- package/nunjucks/moduk/components/summary-list/__examples__/with-no-border.njk +39 -0
- package/nunjucks/moduk/components/summary-list/macro.njk +5 -0
- package/nunjucks/moduk/components/table/__examples__/default.njk +41 -0
- package/nunjucks/moduk/components/table/__examples__/with-comparative-numbers.njk +61 -0
- package/nunjucks/moduk/components/table/__examples__/with-customised-column-widths.njk +56 -0
- package/nunjucks/moduk/components/table/__examples__/with-large-caption.njk +41 -0
- package/nunjucks/moduk/components/table/macro.njk +5 -0
- package/nunjucks/moduk/components/tabs/__examples__/default.njk +243 -0
- package/nunjucks/moduk/components/tabs/macro.njk +5 -0
- package/nunjucks/moduk/components/tag/__examples__/blue.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/default.njk +5 -0
- package/nunjucks/moduk/components/tag/__examples__/green.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/grey.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/orange.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/pink.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/purple.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/red.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/turquoise.njk +6 -0
- package/nunjucks/moduk/components/tag/__examples__/yellow.njk +6 -0
- package/nunjucks/moduk/components/tag/macro.njk +5 -0
- package/nunjucks/moduk/components/textarea/__examples__/default.njk +14 -0
- package/nunjucks/moduk/components/textarea/__examples__/not-as-page-heading.njk +9 -0
- package/nunjucks/moduk/components/textarea/__examples__/with-custom-height.njk +15 -0
- package/nunjucks/moduk/components/textarea/__examples__/with-error.njk +17 -0
- package/nunjucks/moduk/components/textarea/macro.njk +5 -0
- package/nunjucks/moduk/components/warning-text/__examples__/default.njk +6 -0
- package/nunjucks/moduk/components/warning-text/macro.njk +5 -0
- package/package.json +36 -27
- package/react/MODUKBody/MODUKBody.d.ts +6 -0
- package/react/MODUKBody/MODUKBody.d.ts.map +1 -0
- package/react/accordion/Accordion.d.ts +22 -0
- package/react/accordion/Accordion.d.ts.map +1 -0
- package/react/accordion/AccordionContext.d.ts +7 -0
- package/react/accordion/AccordionContext.d.ts.map +1 -0
- package/react/accordion/AccordionHeadingTag.d.ts +2 -0
- package/react/accordion/AccordionHeadingTag.d.ts.map +1 -0
- package/react/accordion/AccordionItem.d.ts +12 -0
- package/react/accordion/AccordionItem.d.ts.map +1 -0
- package/react/accordion/AccordionItemIndexContext.d.ts +2 -0
- package/react/accordion/AccordionItemIndexContext.d.ts.map +1 -0
- package/react/accordion/index.d.ts +4 -0
- package/react/accordion/index.d.ts.map +1 -0
- package/react/back-link/BackLink.d.ts +13 -0
- package/react/back-link/BackLink.d.ts.map +1 -0
- package/react/esm/MODUKBody/MODUKBody.js +37 -0
- package/react/esm/accordion/Accordion.js +81 -0
- package/react/esm/accordion/AccordionContext.js +5 -0
- package/react/esm/accordion/AccordionHeadingTag.js +1 -0
- package/react/esm/accordion/AccordionItem.js +45 -0
- package/react/esm/accordion/AccordionItemIndexContext.js +2 -0
- package/react/esm/accordion/index.js +5 -0
- package/react/esm/back-link/BackLink.js +25 -0
- package/react/esm/header/Header.js +124 -0
- package/react/esm/header/HeaderNavigationItem.js +29 -0
- package/react/esm/header/HeaderNavigationLink.js +25 -0
- package/react/esm/header/index.js +3 -0
- package/react/esm/index.js +7 -0
- package/react/esm/internal/Link/Link.js +23 -0
- package/react/esm/internal/hooks/useMODUKComponent/index.js +1 -0
- package/react/esm/internal/hooks/useMODUKComponent/useMODUKComponent.js +39 -0
- package/react/esm/internal/hooks/usePrevious/index.js +1 -0
- package/react/esm/internal/hooks/usePrevious/usePrevious.js +8 -0
- package/react/esm/internal/test-utils/Root.js +33 -0
- package/react/esm/table/Table.js +13 -0
- package/react/esm/table/TableBody.js +24 -0
- package/react/esm/table/TableCaption.js +24 -0
- package/react/esm/table/TableCell.js +25 -0
- package/react/esm/table/TableColumnHeader.js +26 -0
- package/react/esm/table/TableHead.js +24 -0
- package/react/esm/table/TableRow.js +24 -0
- package/react/esm/table/TableRowHeader.js +25 -0
- package/react/esm/table/index.js +8 -0
- package/react/header/Header.d.ts +20 -0
- package/react/header/Header.d.ts.map +1 -0
- package/react/header/HeaderNavigationItem.d.ts +11 -0
- package/react/header/HeaderNavigationItem.d.ts.map +1 -0
- package/react/header/HeaderNavigationLink.d.ts +11 -0
- package/react/header/HeaderNavigationLink.d.ts.map +1 -0
- package/react/header/index.d.ts +4 -0
- package/react/header/index.d.ts.map +1 -0
- package/react/index.d.ts +6 -0
- package/react/index.d.ts.map +1 -0
- package/react/index.js +3 -0
- package/react/index.js.LICENSE.txt +28 -0
- package/react/index.js.map +1 -0
- package/react/internal/Link/Link.d.ts +14 -0
- package/react/internal/Link/Link.d.ts.map +1 -0
- package/react/internal/hooks/useMODUKComponent/index.d.ts +2 -0
- package/react/internal/hooks/useMODUKComponent/index.d.ts.map +1 -0
- package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts +10 -0
- package/react/internal/hooks/useMODUKComponent/useMODUKComponent.d.ts.map +1 -0
- package/react/internal/hooks/usePrevious/index.d.ts +2 -0
- package/react/internal/hooks/usePrevious/index.d.ts.map +1 -0
- package/react/internal/hooks/usePrevious/usePrevious.d.ts +2 -0
- package/react/internal/hooks/usePrevious/usePrevious.d.ts.map +1 -0
- package/react/internal/test-utils/Root.d.ts +8 -0
- package/react/internal/test-utils/Root.d.ts.map +1 -0
- package/react/table/Table.d.ts +41 -0
- package/react/table/Table.d.ts.map +1 -0
- package/react/table/TableBody.d.ts +9 -0
- package/react/table/TableBody.d.ts.map +1 -0
- package/react/table/TableCaption.d.ts +9 -0
- package/react/table/TableCaption.d.ts.map +1 -0
- package/react/table/TableCell.d.ts +11 -0
- package/react/table/TableCell.d.ts.map +1 -0
- package/react/table/TableColumnHeader.d.ts +11 -0
- package/react/table/TableColumnHeader.d.ts.map +1 -0
- package/react/table/TableHead.d.ts +9 -0
- package/react/table/TableHead.d.ts.map +1 -0
- package/react/table/TableRow.d.ts +9 -0
- package/react/table/TableRow.d.ts.map +1 -0
- package/react/table/TableRowHeader.d.ts +9 -0
- package/react/table/TableRowHeader.d.ts.map +1 -0
- package/react/table/index.d.ts +9 -0
- package/react/table/index.d.ts.map +1 -0
- package/src/react/header/__examples__/with-service-name-and-navigation.tsx +13 -5
- package/src/react/table/__examples__/default.tsx +38 -0
- package/src/react/table/__examples__/with-comparative-numbers.tsx +42 -0
- package/src/react/table/__examples__/with-customised-column-widths.tsx +42 -0
- package/src/react/table/__examples__/with-large-caption.tsx +38 -0
- package/dist/nunjucks/moduk/components/accordion/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/back-link/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/breadcrumbs/__tests__/macro.test.ts +0 -31
- package/dist/nunjucks/moduk/components/button/__tests__/macro.test.ts +0 -25
- package/dist/nunjucks/moduk/components/character-count/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/checkboxes/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/cookie-banner/__tests__/macro.test.ts +0 -10
- package/dist/nunjucks/moduk/components/date-input/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/details/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/error-message/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/error-summary/__tests__/macro.test.ts +0 -55
- package/dist/nunjucks/moduk/components/fieldset/__tests__/macro.test.ts +0 -41
- package/dist/nunjucks/moduk/components/file-upload/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/footer/__tests__/macro.test.ts +0 -15
- package/dist/nunjucks/moduk/components/header/__tests__/macro.test.ts +0 -25
- package/dist/nunjucks/moduk/components/input/__tests__/macro.test.ts +0 -22
- package/dist/nunjucks/moduk/components/inset-text/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/notification-banner/__tests__/macro.test.ts +0 -32
- package/dist/nunjucks/moduk/components/pagination/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/panel/__tests__/macro.test.ts +0 -35
- package/dist/nunjucks/moduk/components/phase-banner/__tests__/macro.test.ts +0 -24
- package/dist/nunjucks/moduk/components/radios/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/select/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/skip-link/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/summary-list/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/table/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/tabs/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/tag/__tests__/macro.test.ts +0 -32
- package/dist/nunjucks/moduk/components/textarea/__tests__/macro.test.ts +0 -9
- package/dist/nunjucks/moduk/components/warning-text/__tests__/macro.test.ts +0 -9
- package/src/css/__tests__/_colour-palette.test.scss +0 -42
- package/src/css/__tests__/index.test.ts +0 -17
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ComponentPropsWithRef, ComponentType, ElementType, JSX } from 'react';
|
|
2
|
+
type LinkProps<T extends ElementType> = {
|
|
3
|
+
component?: T;
|
|
4
|
+
} & ComponentPropsWithoutRef<T>;
|
|
5
|
+
type LinksComponentType = Extract<ElementType, 'a' | ComponentType>;
|
|
6
|
+
export interface LinkComponent<Props = object> {
|
|
7
|
+
<T extends LinksComponentType = 'a'>(props: LinkProps<T> & {
|
|
8
|
+
ref?: ComponentPropsWithRef<T>['ref'];
|
|
9
|
+
} & Props): JSX.Element | null;
|
|
10
|
+
displayName?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare const LinkBase: LinkComponent;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../../src/react/internal/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAG7G,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/internal/hooks/useMODUKComponent/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface ComponentElement {
|
|
2
|
+
Accordion: HTMLDivElement;
|
|
3
|
+
Header: HTMLElement;
|
|
4
|
+
}
|
|
5
|
+
type ComponentNameLiteral = keyof ComponentElement;
|
|
6
|
+
export declare function useMODUKComponent<ComponentName extends ComponentNameLiteral>(componentName: ComponentName): {
|
|
7
|
+
ref: import("react").RefObject<ComponentElement[ComponentName]>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=useMODUKComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMODUKComponent.d.ts","sourceRoot":"","sources":["../../../../../src/react/internal/hooks/useMODUKComponent/useMODUKComponent.ts"],"names":[],"mappings":"AAEA,UAAU,gBAAgB;IACxB,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,WAAW,CAAA;CACpB;AAED,KAAK,oBAAoB,GAAG,MAAM,gBAAgB,CAAA;AAUlD,wBAAgB,iBAAiB,CAC/B,aAAa,SAAS,oBAAoB,EAE1C,aAAa,EAAE,aAAa;;EAe7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/internal/hooks/usePrevious/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrevious.d.ts","sourceRoot":"","sources":["../../../../../src/react/internal/hooks/usePrevious/usePrevious.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,qBAM9C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
interface RootProps {
|
|
3
|
+
exampleName?: string;
|
|
4
|
+
component?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const Root: ({ exampleName, component, children }: PropsWithChildren<RootProps>) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=Root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Root.d.ts","sourceRoot":"","sources":["../../../../src/react/internal/test-utils/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAG9C,UAAU,SAAS;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AACD,eAAO,MAAM,IAAI,yCAA0C,kBAAkB,SAAS,CAAC,4CAkBtF,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from 'react';
|
|
2
|
+
export interface TableProps extends Omit<ComponentPropsWithoutRef<'table'>, 'children'> {
|
|
3
|
+
/**
|
|
4
|
+
* Instances of TableCaption, TableHead and TableBody.
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A table.
|
|
10
|
+
*
|
|
11
|
+
* @experimental React components are in alpha and subject to change.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Table>
|
|
15
|
+
* <TableCaption className='govuk-table__caption--m'>
|
|
16
|
+
* Dates and amounts
|
|
17
|
+
* </TableCaption>
|
|
18
|
+
* <TableHead>
|
|
19
|
+
* <TableRow>
|
|
20
|
+
* <TableColumnHeader>Date</TableColumnHeader>
|
|
21
|
+
* <TableColumnHeader>Amount</TableColumnHeader>
|
|
22
|
+
* </TableRow>
|
|
23
|
+
* </TableHead>
|
|
24
|
+
* <TableBody>
|
|
25
|
+
* <TableRow>
|
|
26
|
+
* <TableRowHeader>First 6 weeks</TableRowHeader>
|
|
27
|
+
* <TableCell>£109.80 per week</TableCell>
|
|
28
|
+
* </TableRow>
|
|
29
|
+
* <TableRow>
|
|
30
|
+
* <TableRowHeader>Next 33 weeks</TableRowHeader>
|
|
31
|
+
* <TableCell>£109.80 per week</TableCell>
|
|
32
|
+
* </TableRow>
|
|
33
|
+
* <TableRow>
|
|
34
|
+
* <TableRowHeader>Total estimated pay</TableRowHeader>
|
|
35
|
+
* <TableCell>£4,282.20</TableCell>
|
|
36
|
+
* </TableRow>
|
|
37
|
+
* </TableBody>
|
|
38
|
+
* </Table>
|
|
39
|
+
*/
|
|
40
|
+
export declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
41
|
+
//# sourceMappingURL=Table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/react/table/Table.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjF,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrF;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,KAAK,yGAEhB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TableBodyProps = ComponentPropsWithoutRef<'tbody'>;
|
|
3
|
+
/**
|
|
4
|
+
* A table body.
|
|
5
|
+
*
|
|
6
|
+
* @experimental React components are in alpha and subject to change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TableBody: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
9
|
+
//# sourceMappingURL=TableBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBody.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableBody.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,SAAS,sOAOpB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TableCaptionProps = ComponentPropsWithoutRef<'caption'>;
|
|
3
|
+
/**
|
|
4
|
+
* A table caption. Should be the first child of a Table.
|
|
5
|
+
*
|
|
6
|
+
* @experimental React components are in alpha and subject to change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TableCaption: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
9
|
+
//# sourceMappingURL=TableCaption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCaption.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableCaption.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,wBAAwB,CAAC,SAAS,CAAC,CAAA;AAEnE;;;;GAIG;AACH,eAAO,MAAM,YAAY,kMAOvB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface TableCellProps extends ComponentPropsWithoutRef<'td'> {
|
|
3
|
+
format?: 'numeric';
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A table cell.
|
|
7
|
+
*
|
|
8
|
+
* @experimental React components are in alpha and subject to change.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
11
|
+
//# sourceMappingURL=TableCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableCell.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,WAAW,cAAe,SAAQ,wBAAwB,CAAC,IAAI,CAAC;IACpE,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,iHAWpB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface TableColumnHeaderCellProps extends Omit<ComponentPropsWithoutRef<'th'>, 'scope'> {
|
|
3
|
+
format?: 'numeric';
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A header for a column. Should be used for cells inside a row of a TableHead.
|
|
7
|
+
*
|
|
8
|
+
* @experimental React components are in alpha and subject to change.
|
|
9
|
+
*/
|
|
10
|
+
export declare const TableColumnHeader: import("react").ForwardRefExoticComponent<TableColumnHeaderCellProps & import("react").RefAttributes<HTMLTableHeaderCellElement>>;
|
|
11
|
+
//# sourceMappingURL=TableColumnHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableColumnHeader.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableColumnHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAC/F,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,mIAY5B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TableHeadProps = ComponentPropsWithoutRef<'thead'>;
|
|
3
|
+
/**
|
|
4
|
+
* A table head.
|
|
5
|
+
*
|
|
6
|
+
* @experimental React components are in alpha and subject to change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TableHead: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableSectionElement>, HTMLTableSectionElement>, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
9
|
+
//# sourceMappingURL=TableHead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHead.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableHead.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG,wBAAwB,CAAC,OAAO,CAAC,CAAA;AAE9D;;;;GAIG;AACH,eAAO,MAAM,SAAS,sOAOpB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TableRowProps = ComponentPropsWithoutRef<'tr'>;
|
|
3
|
+
/**
|
|
4
|
+
* A table row. Should be contained within a TableHead or a TableBody.
|
|
5
|
+
*
|
|
6
|
+
* @experimental React components are in alpha and subject to change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TableRow: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLTableRowElement>, HTMLTableRowElement>, "ref"> & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
9
|
+
//# sourceMappingURL=TableRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRow.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableRow.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,QAAQ,0NAOnB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type TableRowHeaderProps = Omit<ComponentPropsWithoutRef<'th'>, 'scope'>;
|
|
3
|
+
/**
|
|
4
|
+
* A header for a row. Should be used as the first cell of a row when that cell contains a heading.
|
|
5
|
+
*
|
|
6
|
+
* @experimental React components are in alpha and subject to change.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TableRowHeader: import("react").ForwardRefExoticComponent<TableRowHeaderProps & import("react").RefAttributes<HTMLTableHeaderCellElement>>;
|
|
9
|
+
//# sourceMappingURL=TableRowHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableRowHeader.d.ts","sourceRoot":"","sources":["../../../src/react/table/TableRowHeader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAA;AAEjE,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,cAAc,4HAYzB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './Table';
|
|
2
|
+
export * from './TableBody';
|
|
3
|
+
export * from './TableCaption';
|
|
4
|
+
export * from './TableCell';
|
|
5
|
+
export * from './TableColumnHeader';
|
|
6
|
+
export * from './TableHead';
|
|
7
|
+
export * from './TableRow';
|
|
8
|
+
export * from './TableRowHeader';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/react/table/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Header, HeaderNavigationItem } from '@moduk/frontend/react'
|
|
1
|
+
import { Header, HeaderNavigationItem, HeaderNavigationLink } from '@moduk/frontend/react'
|
|
2
2
|
|
|
3
3
|
export const Example = () => (
|
|
4
4
|
<Header
|
|
@@ -6,9 +6,17 @@ export const Example = () => (
|
|
|
6
6
|
serviceName='Service name'
|
|
7
7
|
serviceUrl='#'
|
|
8
8
|
>
|
|
9
|
-
<HeaderNavigationItem active
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<HeaderNavigationItem
|
|
9
|
+
<HeaderNavigationItem active>
|
|
10
|
+
<HeaderNavigationLink href='#1'>Navigation item 1</HeaderNavigationLink>
|
|
11
|
+
</HeaderNavigationItem>
|
|
12
|
+
<HeaderNavigationItem>
|
|
13
|
+
<HeaderNavigationLink href='#2'>Navigation item 2</HeaderNavigationLink>
|
|
14
|
+
</HeaderNavigationItem>
|
|
15
|
+
<HeaderNavigationItem>
|
|
16
|
+
<HeaderNavigationLink href='#3'>Navigation item 3</HeaderNavigationLink>
|
|
17
|
+
</HeaderNavigationItem>
|
|
18
|
+
<HeaderNavigationItem>
|
|
19
|
+
<HeaderNavigationLink href='#4'>Navigation item 4</HeaderNavigationLink>
|
|
20
|
+
</HeaderNavigationItem>
|
|
13
21
|
</Header>
|
|
14
22
|
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableBody,
|
|
4
|
+
TableCaption,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableColumnHeader,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
TableRowHeader,
|
|
10
|
+
} from '@moduk/frontend/react'
|
|
11
|
+
|
|
12
|
+
export const Example = () => (
|
|
13
|
+
<Table>
|
|
14
|
+
<TableCaption className='govuk-table__caption--m'>
|
|
15
|
+
Dates and amounts
|
|
16
|
+
</TableCaption>
|
|
17
|
+
<TableHead>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableColumnHeader>Date</TableColumnHeader>
|
|
20
|
+
<TableColumnHeader>Amount</TableColumnHeader>
|
|
21
|
+
</TableRow>
|
|
22
|
+
</TableHead>
|
|
23
|
+
<TableBody>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableRowHeader>First 6 weeks</TableRowHeader>
|
|
26
|
+
<TableCell>£109.80 per week</TableCell>
|
|
27
|
+
</TableRow>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableRowHeader>Next 33 weeks</TableRowHeader>
|
|
30
|
+
<TableCell>£109.80 per week</TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
<TableRow>
|
|
33
|
+
<TableRowHeader>Total estimated pay</TableRowHeader>
|
|
34
|
+
<TableCell>£4,282.20</TableCell>
|
|
35
|
+
</TableRow>
|
|
36
|
+
</TableBody>
|
|
37
|
+
</Table>
|
|
38
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableBody,
|
|
4
|
+
TableCaption,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableColumnHeader,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
TableRowHeader,
|
|
10
|
+
} from '@moduk/frontend/react'
|
|
11
|
+
|
|
12
|
+
export const Example = () => (
|
|
13
|
+
<Table>
|
|
14
|
+
<TableCaption className='govuk-table__caption--m'>
|
|
15
|
+
Users by role
|
|
16
|
+
</TableCaption>
|
|
17
|
+
<TableHead>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableColumnHeader>Role</TableColumnHeader>
|
|
20
|
+
<TableColumnHeader format='numeric'>Application A</TableColumnHeader>
|
|
21
|
+
<TableColumnHeader format='numeric'>Application B</TableColumnHeader>
|
|
22
|
+
</TableRow>
|
|
23
|
+
</TableHead>
|
|
24
|
+
<TableBody>
|
|
25
|
+
<TableRow>
|
|
26
|
+
<TableRowHeader>Developer</TableRowHeader>
|
|
27
|
+
<TableCell format='numeric'>10</TableCell>
|
|
28
|
+
<TableCell format='numeric'>25</TableCell>
|
|
29
|
+
</TableRow>
|
|
30
|
+
<TableRow>
|
|
31
|
+
<TableRowHeader>User researcher</TableRowHeader>
|
|
32
|
+
<TableCell format='numeric'>25</TableCell>
|
|
33
|
+
<TableCell format='numeric'>10</TableCell>
|
|
34
|
+
</TableRow>
|
|
35
|
+
<TableRow>
|
|
36
|
+
<TableRowHeader>Delivery manager</TableRowHeader>
|
|
37
|
+
<TableCell format='numeric'>5</TableCell>
|
|
38
|
+
<TableCell format='numeric'>10</TableCell>
|
|
39
|
+
</TableRow>
|
|
40
|
+
</TableBody>
|
|
41
|
+
</Table>
|
|
42
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableBody,
|
|
4
|
+
TableCaption,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableColumnHeader,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
TableRowHeader,
|
|
10
|
+
} from '@moduk/frontend/react'
|
|
11
|
+
|
|
12
|
+
export const Example = () => (
|
|
13
|
+
<Table>
|
|
14
|
+
<TableCaption className='govuk-table__caption--m'>
|
|
15
|
+
Active users by role
|
|
16
|
+
</TableCaption>
|
|
17
|
+
<TableHead>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableColumnHeader className='govuk-!-width-one-half'>Role</TableColumnHeader>
|
|
20
|
+
<TableColumnHeader className='govuk-!-width-one-quarter'>Application A</TableColumnHeader>
|
|
21
|
+
<TableColumnHeader className='govuk-!-width-one-quarter'>Application B</TableColumnHeader>
|
|
22
|
+
</TableRow>
|
|
23
|
+
</TableHead>
|
|
24
|
+
<TableBody>
|
|
25
|
+
<TableRow>
|
|
26
|
+
<TableRowHeader>Developer</TableRowHeader>
|
|
27
|
+
<TableCell>10 per day</TableCell>
|
|
28
|
+
<TableCell>25 per day</TableCell>
|
|
29
|
+
</TableRow>
|
|
30
|
+
<TableRow>
|
|
31
|
+
<TableRowHeader>User researcher</TableRowHeader>
|
|
32
|
+
<TableCell>25 per day</TableCell>
|
|
33
|
+
<TableCell>10 per day</TableCell>
|
|
34
|
+
</TableRow>
|
|
35
|
+
<TableRow>
|
|
36
|
+
<TableRowHeader>Delivery manager</TableRowHeader>
|
|
37
|
+
<TableCell>5 per day</TableCell>
|
|
38
|
+
<TableCell>10 per day</TableCell>
|
|
39
|
+
</TableRow>
|
|
40
|
+
</TableBody>
|
|
41
|
+
</Table>
|
|
42
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Table,
|
|
3
|
+
TableBody,
|
|
4
|
+
TableCaption,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableColumnHeader,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow,
|
|
9
|
+
TableRowHeader,
|
|
10
|
+
} from '@moduk/frontend/react'
|
|
11
|
+
|
|
12
|
+
export const Example = () => (
|
|
13
|
+
<Table>
|
|
14
|
+
<TableCaption className='govuk-table__caption--l'>
|
|
15
|
+
Dates and amounts
|
|
16
|
+
</TableCaption>
|
|
17
|
+
<TableHead>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableColumnHeader>Date</TableColumnHeader>
|
|
20
|
+
<TableColumnHeader>Amount</TableColumnHeader>
|
|
21
|
+
</TableRow>
|
|
22
|
+
</TableHead>
|
|
23
|
+
<TableBody>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableRowHeader>First 6 weeks</TableRowHeader>
|
|
26
|
+
<TableCell>£109.80 per week</TableCell>
|
|
27
|
+
</TableRow>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableRowHeader>Next 33 weeks</TableRowHeader>
|
|
30
|
+
<TableCell>£109.80 per week</TableCell>
|
|
31
|
+
</TableRow>
|
|
32
|
+
<TableRow>
|
|
33
|
+
<TableRowHeader>Total estimated pay</TableRowHeader>
|
|
34
|
+
<TableCell>£4,282.20</TableCell>
|
|
35
|
+
</TableRow>
|
|
36
|
+
</TableBody>
|
|
37
|
+
</Table>
|
|
38
|
+
)
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Accordion', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/accordion/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Back link', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/back-link/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { render } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Breadcrumbs', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
const items = [
|
|
8
|
-
{
|
|
9
|
-
text: 'Home',
|
|
10
|
-
href: '#',
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
text: 'Components',
|
|
14
|
-
href: '#',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
text: 'Breadcrumbs',
|
|
18
|
-
href: '#',
|
|
19
|
-
},
|
|
20
|
-
]
|
|
21
|
-
expect(() =>
|
|
22
|
-
render(`
|
|
23
|
-
{%- from "moduk/components/breadcrumbs/macro.njk" import modukBreadcrumbs -%}
|
|
24
|
-
|
|
25
|
-
{{ modukBreadcrumbs({
|
|
26
|
-
items: ${JSON.stringify(items)}
|
|
27
|
-
}) }}
|
|
28
|
-
`)
|
|
29
|
-
).not.toThrowError()
|
|
30
|
-
})
|
|
31
|
-
})
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import path from 'node:path'
|
|
2
|
-
import { describe, expect, it } from 'vitest'
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
const basePath = 'moduk/components/button/__examples__'
|
|
6
|
-
|
|
7
|
-
describe('Button', async () => {
|
|
8
|
-
it('renders the content', () => {
|
|
9
|
-
expect(() => {
|
|
10
|
-
renderFile(path.join(basePath, 'default.njk'))
|
|
11
|
-
}).not.toThrowError()
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
it('add disabled attribute', () => {
|
|
15
|
-
expect(renderFile(path.join(basePath, 'disabled.njk'))).toBeDisabled()
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
it('renders the secondary button', () => {
|
|
19
|
-
expect(renderFile(path.join(basePath, 'secondary.njk'))).toHaveClass('govuk-button--secondary')
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('renders the warning button', () => {
|
|
23
|
-
expect(renderFile(path.join(basePath, 'warning.njk'))).toHaveClass('govuk-button--warning')
|
|
24
|
-
})
|
|
25
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Character count', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/character-count/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Checkboxes', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/checkboxes/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { join } from 'node:path'
|
|
2
|
-
import { describe, expect, it } from 'vitest'
|
|
3
|
-
|
|
4
|
-
import { renderFile } from '../../../../../test-utils'
|
|
5
|
-
|
|
6
|
-
describe('Cookie Banner', () => {
|
|
7
|
-
it('renders the content', () => {
|
|
8
|
-
expect(() => renderFile(join(__dirname, '../__examples__/default.njk'))).not.toThrowError()
|
|
9
|
-
})
|
|
10
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Date input', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/date-input/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { render, renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Details', async () => {
|
|
6
|
-
it('renders the content when using the text property', () => {
|
|
7
|
-
const element = renderFile('moduk/components/details/__examples__/default.njk')
|
|
8
|
-
expect(element).toHaveTextContent('We need to know the organisation')
|
|
9
|
-
})
|
|
10
|
-
|
|
11
|
-
it('renders the content when using the html property', () => {
|
|
12
|
-
const element = render(`
|
|
13
|
-
{% from "moduk/components/details/macro.njk" import modukDetails %}
|
|
14
|
-
|
|
15
|
-
{{ modukDetails({
|
|
16
|
-
summaryText: "Help with organisation",
|
|
17
|
-
html: "We need to know the organisation you work for so we can forward your request to the correct team."
|
|
18
|
-
}) }}
|
|
19
|
-
`)
|
|
20
|
-
expect(element).toHaveTextContent('We need to know the organisation')
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
it('renders the content when using a call block', () => {
|
|
24
|
-
const element = render(`
|
|
25
|
-
{% from "moduk/components/details/macro.njk" import modukDetails %}
|
|
26
|
-
|
|
27
|
-
{% call modukDetails({
|
|
28
|
-
summaryText: "Help with organisation"
|
|
29
|
-
}) %}
|
|
30
|
-
We need to know the organisation<br>you work for so we can forward your request to the correct team.
|
|
31
|
-
{% endcall %}
|
|
32
|
-
`)
|
|
33
|
-
expect(element).toContainHTML('We need to know the organisation<br>you')
|
|
34
|
-
})
|
|
35
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
|
|
3
|
-
import { renderFile } from '../../../../../test-utils'
|
|
4
|
-
|
|
5
|
-
describe('Error message', async () => {
|
|
6
|
-
it('renders the content', () => {
|
|
7
|
-
expect(() => renderFile('moduk/components/error-message/__examples__/default.njk')).not.toThrowError()
|
|
8
|
-
})
|
|
9
|
-
})
|