Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"prettier": "npx prettier . --write"
},
"dependencies": {
"@abgov/react-components": "6.3.0",
"@abgov/ui-components-common": "1.3.0",
"@abgov/web-components": "1.33.0",
"@abgov/react-components": "6.4.1",
"@abgov/ui-components-common": "1.4.0",
"@abgov/web-components": "1.34.0",
"@faker-js/faker": "^8.3.1",
"highlight.js": "^11.8.0",
"js-cookie": "^3.0.5",
Expand Down
Binary file added public/images/governance-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import ReportBugPage from "@routes/get-started/ReportBug";
import RoadmapPage from "@routes/get-started/Roadmap";
import SupportedBrowsersPage from "@routes/get-started/developers/SupportedBrowsers";
import UxDesignerPage from "@routes/get-started/designers/UxDesigner";
import { LtsPolicyPage } from "@routes/get-started/LtsPolicyPage.tsx";

// Content Pages

Expand All @@ -62,6 +63,7 @@ import ComponentNotFound from "@routes/not-found/NotFound.tsx";
import { LanguageVersionProvider } from "@contexts/LanguageVersionContext.tsx";
import DevelopersUpgradePage from "@routes/get-started/developers/upgrade-guide/DevelopersUpgrade.tsx";


const router = createBrowserRouter(
createRoutesFromElements(
<Route path="/" element={<Root />}>
Expand Down Expand Up @@ -96,6 +98,9 @@ const router = createBrowserRouter(
<Route path="qa-testing">
<Route index element={<QATestingOverviewPage />} />
</Route>
<Route path="lts-policy">
<Route index element={<LtsPolicyPage />} />
</Route>
<Route path="contribute">
<Route index element={<ContributePage />} />
</Route>
Expand Down
30 changes: 16 additions & 14 deletions src/components/card-lite/CardLite.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
.card-lite .title {
font: var(--goa-typography-heading-l);
margin-bottom: var(--goa-space-m);
.card-lite {
text-decoration: none;
}

.card-lite .description {
font-size: var(--goa-font-size-4);
margin-bottom: var(--goa-space-xs);
.card-heading {
color: black;
display: inline-block;
}

.card-content a {
font-size: var(--goa-font-size-5);
.card-description {
color: black;
display: block;
}

.card-lite .link {
font-size: var(--goa-font-size-5);
a:hover .card-heading {
color: var(--goa-color-interactive-hover);
text-decoration: underline;
}

@media screen and (min-width: 1231px) {
.card-lite {
max-width: 300px;
}
.card-lite:focus-visible {
outline: 3px solid var(--goa-color-interactive-focus);
outline-offset: 4px;
border-radius: 4px;
}

20 changes: 12 additions & 8 deletions src/components/card-lite/CardLite.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ReactNode } from "react";
import { Link } from "react-router-dom";
import "./CardLite.css";
import { ReactNode } from "react";
import { GoabLink, GoabText } from "@abgov/react-components";

export interface Props {
title: string;
Expand All @@ -11,13 +11,17 @@ export interface Props {

export function CardLite(props: Props) {
return (
<div className="card-lite">
<div className="title">{props.title}</div>
<div className="description">{props.description}</div>
<div className="link">
<Link to={props.linkTo}>{props.linkDisplay}</Link>
<a href={props.linkTo} className="card-lite">
<div>
<GoabText size="heading-m" mt="none" mb="m">
<b className="card-heading">{props.title}</b>
</GoabText>
<GoabText size="body-m" mt="none" mb="xs">
<div className="card-description">{props.description}</div>
</GoabText>
<GoabLink>{props.linkDisplay}</GoabLink>
</div>
</div>
</a>
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/components/sandbox/Sandbox.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.sandbox-note {
color: #666;
margin-top: var(--goa-space-m);
margin-bottom: var(--goa-space-2xl);
font: var(--goa-typography-body-s);
}

.sandbox-render {
Expand Down
20 changes: 18 additions & 2 deletions src/components/sandbox/Sandbox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ReactElement, ReactNode, useContext, useEffect, useState } from "react";
import { GoabCallout } from "@abgov/react-components";
import { GoabCalloutType } from "@abgov/ui-components-common";

import SandboxProperties from "./SandboxProperties";
import { CodeSnippet } from "@components/code-snippet/CodeSnippet";
Expand All @@ -22,7 +24,7 @@ type Serializer = (el: any, properties: ComponentBinding[]) => string;
interface SandboxProps {
properties?: ComponentBinding[];
formItemProperties?: ComponentBinding[];
note?: string;
note?: string | { type?: GoabCalloutType; heading?: string; content: string };
fullWidth?: boolean;
onChange?: (bindings: ComponentBinding[], props: Record<string, unknown>) => void;
onChangeFormItemBindings?: (bindings: ComponentBinding[], props: Record<string, unknown>) => void;
Expand Down Expand Up @@ -140,7 +142,21 @@ export const Sandbox = (props: SandboxProps) => {
</GoabAccordion>
)}
<SandboxCode props={props} formatLang={formatLang} lang={lang} serializers={serializers} version={version} />
{props.note && (<div className="sandbox-note">{props.note}</div>)}
{props.note &&
(typeof props.note === "string" ? (
<p className="sandbox-note">{props.note}</p>
) : (
<GoabCallout
type={props.note.type || "important"}
size="medium"
heading={props.note.heading}
maxWidth="596px"
mt="m"
mb="2xl"
>
{props.note.content}
</GoabCallout>
))}
</>
);
};
Expand Down
96 changes: 96 additions & 0 deletions src/examples/checkbox/CheckboxDescriptionExample.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import { GoabCheckbox, GoabFormItem } from "@abgov/react-components";
import { Sandbox } from "@components/sandbox";
import { CodeSnippet } from "@components/code-snippet/CodeSnippet.tsx";
import { useContext } from "react";
import { LanguageVersionContext } from "@contexts/LanguageVersionContext.tsx";

export default function CheckboxDescriptionExample () {
const {version} = useContext(LanguageVersionContext);
return (
<>
<Sandbox fullWidth skipRender>
{/*Angular*/}

{version === "old" && <CodeSnippet
lang="typescript"
tags="angular"
allowCopy={true}
code={`
<goa-form-item label="How would you like to be contacted?">
<goa-checkbox checked="true" name="optionOne" text="Email">
<span slot="description">Help text with a <a href="#">link</a>.</span>
</goa-checkbox>
<goa-checkbox checked="false" name="optionTwo" text="Phone" />
<goa-checkbox checked="false" name="optionThree" text="Text message" />
</goa-form-item>
`}
/>}

{version === "new" && <CodeSnippet
lang="typescript"
tags="angular"
allowCopy={true}
code={`
<goab-form-item label="How would you like to be contacted?">
<goab-checkbox [checked]="true" name="optionOne" text="Email" [description]="descriptionTemplate">
<ng-template #descriptionTemplate>
<span>Help text with a <a href="#">link</a>.</span>
</ng-template>
</goab-checkbox>
<goab-checkbox [checked]="false" name="optionTwo" text="Phone" />
<goab-checkbox [checked]="false" name="optionThree" text="Text message" />
</goab-form-item>
`}
/>}

{/*React*/}
{version === "old" && <CodeSnippet
lang="typescript"
tags="react"
allowCopy={true}
code={`
<GoAFormItem label="How would you like to be contacted?">
<GoACheckbox
checked={true}
name="optionOne"
text="Email"
description={<span>Help text with a <a href="#">link</a>.</span>}
/>
<GoACheckbox checked={false} name="optionTwo" text="Phone" />
<GoACheckbox checked={false} name="optionThree" text="Text message" />
</GoAFormItem>
`}
/>}

{version === "new" && <CodeSnippet
lang="typescript"
tags="react"
allowCopy={true}
code={`
<GoabFormItem label="How would you like to be contacted?">
<GoabCheckbox
checked={true}
name="optionOne"
text="Email"
description={<span>Help text with a <a href="#">link</a>.</span>}
/>
<GoabCheckbox checked={false} name="optionTwo" text="Phone" />
<GoabCheckbox checked={false} name="optionThree" text="Text message" />
</GoabFormItem>
`}
/>}

<GoabFormItem label="How would you like to be contacted?">
<GoabCheckbox
checked={true}
name="optionOne"
text="Email"
description={<span>Help text with a <a href="#">link</a>.</span>}
/>
<GoabCheckbox checked={false} name="optionTwo" text="Phone" />
<GoabCheckbox checked={false} name="optionThree" text="Text message" />
</GoabFormItem>
</Sandbox>
</>
);
}
Loading