@i-dot-ai-npm/component-library-react 0.0.1 → 0.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/package.json +17 -6
- package/src/accordion/Accordion.tsx +3 -3
- package/src/accordion/AccordionSection.tsx +2 -2
- package/src/accordion/AccordionSectionContent.tsx +2 -2
- package/src/accordion/AccordionSectionHeader.tsx +2 -2
- package/src/accordion/AccordionSectionHeading.tsx +2 -2
- package/src/accordion/AccordionSectionSummary.tsx +2 -2
- package/src/back-link/BackLink.tsx +2 -2
- package/src/breadcrumbs/BreadcrumbItem.tsx +2 -2
- package/src/breadcrumbs/Breadcrumbs.tsx +2 -2
- package/src/button/Button.tsx +30 -9
- package/src/button-group/ButtonGroup.tsx +2 -2
- package/src/card/Card.tsx +2 -2
- package/src/card/CardContent.tsx +2 -2
- package/src/card/CardGroup.tsx +2 -2
- package/src/card/CardHeading.tsx +2 -2
- package/src/card/CardIcon.tsx +2 -2
- package/src/card/CardLink.tsx +2 -2
- package/src/character-count/CharacterCount.tsx +0 -2
- package/src/character-count/CharacterCountMessage.tsx +2 -2
- package/src/checkboxes/CheckboxConditional.tsx +24 -0
- package/src/checkboxes/CheckboxDivider.tsx +2 -2
- package/src/checkboxes/CheckboxInput.tsx +0 -2
- package/src/checkboxes/CheckboxItem.tsx +2 -2
- package/src/checkboxes/CheckboxLabel.tsx +2 -2
- package/src/checkboxes/Checkboxes.tsx +2 -2
- package/src/cookie-banner/CookieBanner.tsx +2 -2
- package/src/cookie-banner/CookieBannerActions.tsx +2 -2
- package/src/cookie-banner/CookieBannerContent.tsx +2 -2
- package/src/cookie-banner/CookieBannerHeading.tsx +2 -2
- package/src/cookie-banner/CookieBannerMessage.tsx +2 -2
- package/src/date-input/DateInput.tsx +2 -2
- package/src/date-input/DateInputField.tsx +1 -3
- package/src/date-input/DateInputItem.tsx +2 -2
- package/src/details/Details.tsx +2 -2
- package/src/details/DetailsSummary.tsx +2 -2
- package/src/details/DetailsText.tsx +2 -2
- package/src/error-message/ErrorMessage.tsx +7 -6
- package/src/error-summary/ErrorSummary.tsx +2 -2
- package/src/error-summary/ErrorSummaryBody.tsx +2 -2
- package/src/error-summary/ErrorSummaryItem.tsx +2 -2
- package/src/error-summary/ErrorSummaryList.tsx +2 -2
- package/src/error-summary/ErrorSummaryTitle.tsx +2 -2
- package/src/fieldset/Fieldset.tsx +2 -2
- package/src/fieldset/FieldsetLegend.tsx +2 -2
- package/src/file-upload/FileUpload.tsx +0 -2
- package/src/form-group/FormGroup.tsx +2 -2
- package/src/govuk-frontend.d.ts +13 -0
- package/src/header/Header.tsx +2 -2
- package/src/hint/Hint.tsx +2 -2
- package/src/index.ts +3 -1
- package/src/input/Input.tsx +0 -2
- package/src/input-label/InputLabel.tsx +2 -2
- package/src/inset-text/InsetText.tsx +2 -2
- package/src/link/Link.tsx +2 -2
- package/src/list/List.tsx +8 -8
- package/src/list/ListItem.tsx +2 -2
- package/src/notification-banner/NotificationBanner.tsx +8 -8
- package/src/notification-banner/NotificationBannerContent.tsx +2 -2
- package/src/notification-banner/NotificationBannerHeader.tsx +2 -2
- package/src/notification-banner/NotificationBannerHeading.tsx +2 -2
- package/src/notification-banner/NotificationBannerTitle.tsx +2 -2
- package/src/pagination/Pagination.tsx +2 -2
- package/src/pagination/PaginationItem.tsx +10 -10
- package/src/pagination/PaginationList.tsx +2 -2
- package/src/pagination/PaginationNext.tsx +2 -2
- package/src/pagination/PaginationPrev.tsx +2 -2
- package/src/password-input/PasswordInput.tsx +4 -4
- package/src/phase-banner/PhaseBanner.tsx +2 -2
- package/src/radios/RadioConditional.tsx +24 -0
- package/src/radios/RadioDivider.tsx +2 -2
- package/src/radios/RadioInput.tsx +0 -2
- package/src/radios/RadioItem.tsx +2 -2
- package/src/radios/RadioLabel.tsx +17 -0
- package/src/radios/Radios.tsx +2 -2
- package/src/select/Select.tsx +2 -2
- package/src/select/SelectOption.tsx +2 -2
- package/src/service-navigation/ServiceNavigation.tsx +2 -2
- package/src/service-navigation/ServiceNavigationItem.tsx +2 -2
- package/src/side-nav/SideNav.tsx +2 -2
- package/src/side-nav/SideNavItem.tsx +2 -2
- package/src/side-nav/SideNavList.tsx +2 -2
- package/src/side-nav/SideNavSubnavHeading.tsx +2 -2
- package/src/side-nav/SideNavSubnavList.tsx +2 -2
- package/src/side-nav/SideNavTitle.tsx +2 -2
- package/src/skip-link/SkipLink.tsx +2 -2
- package/src/summary-list/SummaryList.tsx +2 -2
- package/src/summary-list/SummaryListActions.tsx +2 -2
- package/src/summary-list/SummaryListKey.tsx +2 -2
- package/src/summary-list/SummaryListRow.tsx +2 -2
- package/src/summary-list/SummaryListValue.tsx +2 -2
- package/src/table/Table.tsx +6 -3
- package/src/table/TableBody.tsx +4 -2
- package/src/table/TableCaption.tsx +4 -2
- package/src/table/TableCell.tsx +11 -3
- package/src/table/TableHead.tsx +4 -2
- package/src/table/TableHeader.tsx +4 -2
- package/src/table/TableRow.tsx +4 -2
- package/src/tabs/Tab.tsx +2 -2
- package/src/tabs/TabPanel.tsx +2 -2
- package/src/tabs/Tabs.tsx +3 -3
- package/src/tabs/TabsList.tsx +2 -2
- package/src/tabs/TabsTitle.tsx +2 -2
- package/src/tag/Tag.tsx +4 -4
- package/src/task-list/TaskList.tsx +2 -2
- package/src/task-list/TaskListHint.tsx +2 -2
- package/src/task-list/TaskListItem.tsx +2 -2
- package/src/task-list/TaskListLink.tsx +2 -2
- package/src/task-list/TaskListNameAndHint.tsx +2 -2
- package/src/task-list/TaskListStatus.tsx +2 -2
- package/src/textarea/Textarea.tsx +3 -4
- package/src/toggle/Toggle.tsx +0 -2
- package/src/toggle/ToggleItem.tsx +2 -2
- package/src/toggle/ToggleLabel.tsx +2 -2
- package/src/warning-text/WarningText.tsx +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type FieldsetLegendProps = {
|
|
4
4
|
size?: "small" | "medium" | "large" | "xl";
|
|
5
5
|
class?: string;
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// govuk-frontend ships no type declarations and there is no @types package.
|
|
2
|
+
// Minimal ambient declaration covering the components initialised by this library.
|
|
3
|
+
declare module "govuk-frontend" {
|
|
4
|
+
interface GOVUKComponent {
|
|
5
|
+
moduleName: string;
|
|
6
|
+
new (element: Element): unknown;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Accordion: GOVUKComponent;
|
|
10
|
+
export const Tabs: GOVUKComponent;
|
|
11
|
+
|
|
12
|
+
export function initAll(): void;
|
|
13
|
+
}
|
package/src/header/Header.tsx
CHANGED
package/src/hint/Hint.tsx
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// AUTO-GENERATED barrel. Do not edit by hand.
|
|
2
1
|
export { default as AccordionSectionContent } from "./accordion/AccordionSectionContent";
|
|
3
2
|
export { default as AccordionSectionHeader } from "./accordion/AccordionSectionHeader";
|
|
4
3
|
export { default as AccordionSectionHeading } from "./accordion/AccordionSectionHeading";
|
|
@@ -18,6 +17,7 @@ export { default as CardLink } from "./card/CardLink";
|
|
|
18
17
|
export { default as Card } from "./card/Card";
|
|
19
18
|
export { default as CharacterCountMessage } from "./character-count/CharacterCountMessage";
|
|
20
19
|
export { default as CharacterCount } from "./character-count/CharacterCount";
|
|
20
|
+
export { default as CheckboxConditional } from "./checkboxes/CheckboxConditional";
|
|
21
21
|
export { default as CheckboxDivider } from "./checkboxes/CheckboxDivider";
|
|
22
22
|
export { default as CheckboxInput } from "./checkboxes/CheckboxInput";
|
|
23
23
|
export { default as CheckboxItem } from "./checkboxes/CheckboxItem";
|
|
@@ -64,9 +64,11 @@ export { default as PaginationPrev } from "./pagination/PaginationPrev";
|
|
|
64
64
|
export { default as Pagination } from "./pagination/Pagination";
|
|
65
65
|
export { default as PasswordInput } from "./password-input/PasswordInput";
|
|
66
66
|
export { default as PhaseBanner } from "./phase-banner/PhaseBanner";
|
|
67
|
+
export { default as RadioConditional } from "./radios/RadioConditional";
|
|
67
68
|
export { default as RadioDivider } from "./radios/RadioDivider";
|
|
68
69
|
export { default as RadioInput } from "./radios/RadioInput";
|
|
69
70
|
export { default as RadioItem } from "./radios/RadioItem";
|
|
71
|
+
export { default as RadioLabel } from "./radios/RadioLabel";
|
|
70
72
|
export { default as Radios } from "./radios/Radios";
|
|
71
73
|
export { default as SelectOption } from "./select/SelectOption";
|
|
72
74
|
export { default as Select } from "./select/Select";
|
package/src/input/Input.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type InputLabelProps = {
|
|
4
4
|
size?: "small" | "medium" | "large" | "xl";
|
|
5
5
|
class?: string;
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
|
package/src/link/Link.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type LinkProps = {
|
|
4
4
|
noUnderline?: boolean;
|
|
5
5
|
noVisitedState?: boolean;
|
|
6
6
|
variant?: "warning" | "inverse";
|
|
7
7
|
class?: string;
|
|
8
|
-
children?:
|
|
8
|
+
children?: ReactNode;
|
|
9
9
|
[key: string]: unknown;
|
|
10
10
|
};
|
|
11
11
|
|
package/src/list/List.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type ListProps = {
|
|
4
4
|
spaced?: boolean;
|
|
5
5
|
numbered?: string;
|
|
6
6
|
class?: string;
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -12,13 +12,13 @@ export default function List({ spaced, numbered, class: className, children, ...
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
numbered ? (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<ol className={["govuk-list govuk-list--number", spaced ? "govuk-list--spaced" : "", className ?? ""].filter(Boolean).join(" ")} {...rest}>
|
|
16
|
+
{children ?? ""}
|
|
17
|
+
</ol>
|
|
18
18
|
) : (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
<ul className={["govuk-list", spaced ? "govuk-list--spaced" : "", className ?? ""].filter(Boolean).join(" ")} {...rest}>
|
|
20
|
+
{children ?? ""}
|
|
21
|
+
</ul>
|
|
22
22
|
)
|
|
23
23
|
);
|
|
24
24
|
}
|
package/src/list/ListItem.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type NotificationBannerProps = {
|
|
4
4
|
success?: string;
|
|
5
5
|
class?: string;
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -11,13 +11,13 @@ export default function NotificationBanner({ success, class: className, children
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
success ? (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<div className={["govuk-notification-banner govuk-notification-banner--success", className ?? ""].filter(Boolean).join(" ")} role="alert" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner" {...rest}>
|
|
15
|
+
{children ?? ""}
|
|
16
|
+
</div>
|
|
17
17
|
) : (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
<div className={["govuk-notification-banner", className ?? ""].filter(Boolean).join(" ")} role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner" {...rest}>
|
|
19
|
+
{children ?? ""}
|
|
20
|
+
</div>
|
|
21
21
|
)
|
|
22
22
|
);
|
|
23
23
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type PaginationItemProps = {
|
|
4
4
|
current?: boolean;
|
|
5
5
|
ellipsis?: string;
|
|
6
6
|
class?: string;
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -12,15 +12,15 @@ export default function PaginationItem({ current, ellipsis, class: className, ch
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
ellipsis ? (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<li className="govuk-pagination__item govuk-pagination__item--ellipsis">
|
|
16
|
+
{children ?? "⋯"}
|
|
17
|
+
</li>
|
|
18
18
|
) : (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
<li className={["govuk-pagination__item", current ? "govuk-pagination__item--current" : ""].filter(Boolean).join(" ")}>
|
|
20
|
+
<a className={["govuk-link govuk-pagination__link", className ?? ""].filter(Boolean).join(" ")} {...rest}>
|
|
21
|
+
{children ?? ""}
|
|
22
|
+
</a>
|
|
23
|
+
</li>
|
|
24
24
|
)
|
|
25
25
|
);
|
|
26
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type PasswordInputProps = {
|
|
4
4
|
class?: string;
|
|
5
|
-
children?:
|
|
5
|
+
children?: ReactNode;
|
|
6
6
|
[key: string]: unknown;
|
|
7
7
|
};
|
|
8
8
|
|
|
@@ -11,8 +11,8 @@ export default function PasswordInput({ class: className, children, ...rest }: P
|
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<div className="govuk-input__wrapper govuk-password-input__wrapper">
|
|
14
|
-
<input className={classes} type="password"
|
|
15
|
-
<button className="govuk-button govuk-button--secondary govuk-password-input__toggle govuk-js-password-input-toggle" type="button" data-module="govuk-button" aria-label="Show password" hidden
|
|
14
|
+
<input className={classes} type="password" spellCheck="false" autoComplete="current-password" autoCapitalize="none" {...rest} />
|
|
15
|
+
<button className="govuk-button govuk-button--secondary govuk-password-input__toggle govuk-js-password-input-toggle" type="button" data-module="govuk-button" aria-label="Show password" hidden>
|
|
16
16
|
{children ?? "Show"}
|
|
17
17
|
</button>
|
|
18
18
|
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type RadioConditionalProps = {
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
class?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default function RadioConditional({ hidden = true, class: className, children, ...rest }: RadioConditionalProps) {
|
|
11
|
+
const classes = [
|
|
12
|
+
"govuk-radios__conditional",
|
|
13
|
+
hidden ? "govuk-radios__conditional--hidden" : "",
|
|
14
|
+
className ?? "",
|
|
15
|
+
]
|
|
16
|
+
.filter(Boolean)
|
|
17
|
+
.join(" ");
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className={classes} {...rest}>
|
|
21
|
+
{children ?? ""}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
package/src/radios/RadioItem.tsx
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type RadioLabelProps = {
|
|
4
|
+
class?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default function RadioLabel({ class: className, children, ...rest }: RadioLabelProps) {
|
|
10
|
+
const classes = ["govuk-label govuk-radios__label", className ?? ""].filter(Boolean).join(" ");
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<label className={classes} {...rest}>
|
|
14
|
+
{children ?? ""}
|
|
15
|
+
</label>
|
|
16
|
+
);
|
|
17
|
+
}
|
package/src/radios/Radios.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type RadiosProps = {
|
|
4
4
|
inline?: boolean;
|
|
5
5
|
small?: boolean;
|
|
6
6
|
class?: string;
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
|
package/src/select/Select.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type SelectProps = {
|
|
4
4
|
subtle?: boolean;
|
|
5
5
|
error?: boolean;
|
|
6
6
|
class?: string;
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type ServiceNavigationProps = {
|
|
4
4
|
sideNav?: boolean;
|
|
5
5
|
inverse?: boolean;
|
|
6
6
|
class?: string;
|
|
7
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
8
8
|
[key: string]: unknown;
|
|
9
9
|
};
|
|
10
10
|
|
package/src/side-nav/SideNav.tsx
CHANGED