@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
package/src/table/Table.tsx
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
type TableProps = {
|
|
4
5
|
smallTextUntilTablet?: boolean;
|
|
5
6
|
subtle?: boolean;
|
|
7
|
+
summary?: boolean;
|
|
6
8
|
class?: string;
|
|
7
|
-
children?:
|
|
9
|
+
children?: ReactNode;
|
|
8
10
|
[key: string]: unknown;
|
|
9
11
|
};
|
|
10
12
|
|
|
11
|
-
export default function Table({ smallTextUntilTablet, subtle, class: className, children, ...rest }: TableProps) {
|
|
13
|
+
export default function Table({ smallTextUntilTablet, subtle, summary, class: className, children, ...rest }: TableProps) {
|
|
12
14
|
const classes = [
|
|
13
15
|
"govuk-table",
|
|
14
16
|
smallTextUntilTablet ? "govuk-table--small-text-until-tablet" : "",
|
|
15
17
|
subtle ? "govuk-table--subtle" : "",
|
|
18
|
+
summary ? "govuk-table--summary" : "",
|
|
16
19
|
className ?? "",
|
|
17
20
|
]
|
|
18
21
|
.filter(Boolean)
|
package/src/table/TableBody.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableBodyProps = {
|
|
4
6
|
class?: string;
|
|
5
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
6
8
|
[key: string]: unknown;
|
|
7
9
|
};
|
|
8
10
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableCaptionProps = {
|
|
4
6
|
size?: "small" | "medium" | "large" | "xl";
|
|
5
7
|
class?: string;
|
|
6
|
-
children?:
|
|
8
|
+
children?: ReactNode;
|
|
7
9
|
[key: string]: unknown;
|
|
8
10
|
};
|
|
9
11
|
|
package/src/table/TableCell.tsx
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableCellProps = {
|
|
4
6
|
numeric?: boolean;
|
|
7
|
+
stretch?: boolean;
|
|
8
|
+
noWrap?: boolean;
|
|
9
|
+
small?: boolean;
|
|
5
10
|
class?: string;
|
|
6
|
-
children?:
|
|
11
|
+
children?: ReactNode;
|
|
7
12
|
[key: string]: unknown;
|
|
8
13
|
};
|
|
9
14
|
|
|
10
|
-
export default function TableCell({ numeric, class: className, children, ...rest }: TableCellProps) {
|
|
15
|
+
export default function TableCell({ numeric, stretch, noWrap, small, class: className, children, ...rest }: TableCellProps) {
|
|
11
16
|
const classes = [
|
|
12
17
|
"govuk-table__cell",
|
|
13
18
|
numeric ? "govuk-table__cell--numeric" : "",
|
|
19
|
+
stretch ? "govuk-table__cell--stretch" : "",
|
|
20
|
+
noWrap ? "govuk-table__cell--no-wrap" : "",
|
|
21
|
+
small ? "govuk-table__cell--small" : "",
|
|
14
22
|
className ?? "",
|
|
15
23
|
]
|
|
16
24
|
.filter(Boolean)
|
package/src/table/TableHead.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableHeadProps = {
|
|
4
6
|
class?: string;
|
|
5
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
6
8
|
[key: string]: unknown;
|
|
7
9
|
};
|
|
8
10
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableHeaderProps = {
|
|
4
6
|
numeric?: boolean;
|
|
5
7
|
class?: string;
|
|
6
|
-
children?:
|
|
8
|
+
children?: ReactNode;
|
|
7
9
|
[key: string]: unknown;
|
|
8
10
|
};
|
|
9
11
|
|
package/src/table/TableRow.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsxImportSource react */
|
|
2
|
+
|
|
3
|
+
import { ReactNode } from 'react';
|
|
2
4
|
|
|
3
5
|
type TableRowProps = {
|
|
4
6
|
class?: string;
|
|
5
|
-
children?:
|
|
7
|
+
children?: ReactNode;
|
|
6
8
|
[key: string]: unknown;
|
|
7
9
|
};
|
|
8
10
|
|
package/src/tabs/Tab.tsx
CHANGED
package/src/tabs/TabPanel.tsx
CHANGED
package/src/tabs/Tabs.tsx
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
|
|
4
4
|
type TabsProps = {
|
|
5
5
|
class?: string;
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export default function Tabs({ class: className, children, ...rest }: TabsProps) {
|
|
11
|
-
const ref = useRef<
|
|
11
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
12
12
|
const classes = ["govuk-tabs", className ?? ""].filter(Boolean).join(" ");
|
|
13
13
|
useEffect(() => {
|
|
14
14
|
const el = ref.current;
|
package/src/tabs/TabsList.tsx
CHANGED
package/src/tabs/TabsTitle.tsx
CHANGED
package/src/tag/Tag.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
type TagProps = {
|
|
4
|
-
colour?: "grey" | "green" | "turquoise" | "blue" | "light-blue" | "purple" | "pink" | "red" | "orange" | "yellow";
|
|
4
|
+
colour?: "grey" | "green" | "teal" | "turquoise" | "blue" | "light-blue" | "purple" | "magenta" | "pink" | "red" | "orange" | "yellow";
|
|
5
5
|
class?: string;
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
[key: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export default function Tag({ colour, class: className, children, ...rest }: TagProps) {
|
|
11
11
|
const classes = [
|
|
12
12
|
"govuk-tag",
|
|
13
|
-
({ "grey": "govuk-tag--grey", "green": "govuk-tag--green", "turquoise": "govuk-tag--turquoise", "blue": "govuk-tag--blue", "light-blue": "govuk-tag--light-blue", "purple": "govuk-tag--purple", "pink": "govuk-tag--pink", "red": "govuk-tag--red", "orange": "govuk-tag--orange", "yellow": "govuk-tag--yellow" }[colour] ?? ""),
|
|
13
|
+
({ "grey": "govuk-tag--grey", "green": "govuk-tag--green", "teal": "govuk-tag--teal", "turquoise": "govuk-tag--turquoise", "blue": "govuk-tag--blue", "light-blue": "govuk-tag--light-blue", "purple": "govuk-tag--purple", "magenta": "govuk-tag--magenta", "pink": "govuk-tag--pink", "red": "govuk-tag--red", "orange": "govuk-tag--orange", "yellow": "govuk-tag--yellow" }[colour] ?? ""),
|
|
14
14
|
className ?? "",
|
|
15
15
|
]
|
|
16
16
|
.filter(Boolean)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// AUTO-GENERATED from HTML spec. Do not edit by hand.
|
|
2
|
-
|
|
3
1
|
type TextareaProps = {
|
|
4
2
|
error?: boolean;
|
|
5
3
|
subtle?: boolean;
|
|
4
|
+
value?: string;
|
|
6
5
|
class?: string;
|
|
7
6
|
[key: string]: unknown;
|
|
8
7
|
};
|
|
9
8
|
|
|
10
|
-
export default function Textarea({ error, subtle, class: className, ...rest }: TextareaProps) {
|
|
9
|
+
export default function Textarea({ error, subtle, value, class: className, ...rest }: TextareaProps) {
|
|
11
10
|
const classes = [
|
|
12
11
|
"govuk-textarea",
|
|
13
12
|
error ? "govuk-textarea--error" : "",
|
|
@@ -18,6 +17,6 @@ export default function Textarea({ error, subtle, class: className, ...rest }: T
|
|
|
18
17
|
.join(" ");
|
|
19
18
|
|
|
20
19
|
return (
|
|
21
|
-
<textarea className={classes} {...rest}></textarea>
|
|
20
|
+
<textarea className={classes} defaultValue={value} {...rest}></textarea>
|
|
22
21
|
);
|
|
23
22
|
}
|
package/src/toggle/Toggle.tsx
CHANGED