@moduk/frontend
Advanced tools
Comparing version 1.3.1 to 1.4.0
{ | ||
"name": "@moduk/frontend", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "The MOD.UK Frontend contains the code you need to start building a user interface for Ministry of Defence platforms and services.", | ||
@@ -114,2 +114,3 @@ "main": "lib/index.js", | ||
"@testing-library/react": "^14.0.0", | ||
"@testing-library/user-event": "^14.4.3", | ||
"@types/lodash": "^4.14.195", | ||
@@ -116,0 +117,0 @@ "@types/node": "^18.16.19", |
@@ -1,7 +0,7 @@ | ||
import type { ComponentPropsWithoutRef, ReactElement } from 'react'; | ||
import type { ComponentPropsWithoutRef } from 'react'; | ||
import { type PermissiveChild } from '../internal/PermissiveChild'; | ||
import type { AccordionHeadingTag } from './AccordionHeadingTag'; | ||
import type { AccordionItemProps } from './AccordionItem'; | ||
type AccordionChild = ReactElement<AccordionItemProps> | boolean | null | Iterable<AccordionChild>; | ||
export interface AccordionProps extends ComponentPropsWithoutRef<'div'> { | ||
children: AccordionChild; | ||
children: PermissiveChild<AccordionItemProps>; | ||
headingTag?: AccordionHeadingTag; | ||
@@ -21,3 +21,2 @@ hideAllSectionsText?: string; | ||
export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<HTMLDivElement>>; | ||
export {}; | ||
//# sourceMappingURL=Accordion.d.ts.map |
@@ -1,6 +0,5 @@ | ||
import type { ReactElement } from 'react'; | ||
import { type LinkComponent } from '../internal/Link/Link'; | ||
type BackLinkChild = ReactElement | boolean | null | Iterable<BackLinkChild>; | ||
import type { PermissiveChild } from '../internal/PermissiveChild'; | ||
interface BackLinkProps { | ||
children: BackLinkChild; | ||
children: PermissiveChild; | ||
className?: string; | ||
@@ -7,0 +6,0 @@ } |
@@ -14,3 +14,3 @@ 'use client'; | ||
import { isEqual, pick } from 'lodash'; | ||
import { Children, forwardRef, isValidElement, useRef } from 'react'; | ||
import { Children, forwardRef, isValidElement, useMemo, useRef } from 'react'; | ||
import flattenChildren from 'react-keyed-flatten-children'; | ||
@@ -52,2 +52,8 @@ import { mergeRefs } from 'react-merge-refs'; | ||
rest = _objectWithoutProperties(props, _excluded); | ||
var contextValue = useMemo(function () { | ||
return { | ||
headingTag: headingTag, | ||
id: id | ||
}; | ||
}, [headingTag, id]); | ||
var i18nAttributes = { | ||
@@ -62,6 +68,3 @@ 'data-i18n.hide-all-sections': hideAllSectionsText, | ||
return _jsx(AccordionContext.Provider, { | ||
value: { | ||
headingTag: headingTag, | ||
id: id | ||
}, | ||
value: contextValue, | ||
children: _jsx("div", _objectSpread(_objectSpread(_objectSpread({ | ||
@@ -68,0 +71,0 @@ ref: mergeRefs([ref, forwardedRef]) |
@@ -5,4 +5,13 @@ 'use client'; | ||
export * from './back-link/BackLink'; | ||
export * from './error-message'; | ||
export * from './footer'; | ||
export * from './header'; | ||
export * from './hint'; | ||
export * from './input'; | ||
export * from './label'; | ||
export * from './MODUKBody/MODUKBody'; | ||
export * from './table'; | ||
export * from './phase-banner'; | ||
export * from './summary-list'; | ||
export * from './table'; | ||
export * from './tag'; | ||
export * from './VisuallyHiddenText'; |
export * from './accordion'; | ||
export * from './back-link/BackLink'; | ||
export * from './error-message'; | ||
export * from './footer'; | ||
export * from './header'; | ||
export * from './hint'; | ||
export * from './input'; | ||
export * from './label'; | ||
export * from './MODUKBody/MODUKBody'; | ||
export * from './phase-banner'; | ||
export * from './summary-list'; | ||
export * from './table'; | ||
export * from './tag'; | ||
export * from './VisuallyHiddenText'; | ||
//# sourceMappingURL=index.d.ts.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2315992
589
5879
55