Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a1f821b
fix(#2397): popover close
BumbleB2na Mar 26, 2025
f8892d1
Merge pull request #330 from GovAlta/BB-2397-popover-open
ArakTaiRoth Apr 4, 2025
ecc2ed6
feat(#2505): inform user on lts support length
vanessatran-ddi Apr 8, 2025
ef66bab
fix(#2577): Change all references to Simple Form to Public Form
ArakTaiRoth Apr 8, 2025
9fab01a
feat: list view of all components
twjeffery Apr 4, 2025
09b44dc
chore: added new design tokens to tokens documentation
twjeffery Apr 4, 2025
dc77680
feat: split component documentation into tabs
twjeffery Apr 7, 2025
579283f
feat: add sandbox header component to all examples
twjeffery Apr 7, 2025
f54a3af
Merge pull request #339 from GovAlta/dustin/2577-public-form-side-menu
chrisolsen Apr 14, 2025
210a61b
Merge pull request #338 from vanessatran-ddi/vanessa/2505
chrisolsen Apr 17, 2025
ee58212
chore: cleanup
BumbleB2na Apr 10, 2025
1b321d6
update from review comments
twjeffery Apr 16, 2025
f0f4c0d
feat(#1979): filter chips examples
BumbleB2na Apr 10, 2025
9e5e441
Merge pull request #340 from GovAlta/brendan/1979-table-with-global-f…
chrisolsen Apr 24, 2025
1d430ea
fix(#2512): rename "as" attribute as "tag" for text
vanessatran-ddi Apr 25, 2025
3b5b361
Merge branch 'alpha' into TJ-71-component-statuses
twjeffery Apr 25, 2025
355498e
Merge pull request #337 from GovAlta/TJ-71-component-statuses
chrisolsen Apr 25, 2025
6480d05
fix(#2470): Updated Contribution documentation
ArakTaiRoth Apr 23, 2025
d1ff351
feat(#2500): Added Stackblitz links to Bug Report form
ArakTaiRoth Apr 16, 2025
4d08cbe
Merge pull request #343 from GovAlta/dustin/2470
chrisolsen Apr 28, 2025
c92342c
Merge pull request #346 from GovAlta/vanessa/goab-text-2512
chrisolsen Apr 29, 2025
e987f31
Merge pull request #342 from GovAlta/dustin/2500
chrisolsen Apr 29, 2025
3cf52fd
feat(#2278): add modal drawer doc
vanessatran-ddi Apr 1, 2025
0b93223
Merge pull request #331 from GovAlta/feature/2278-modal-drawer
chrisolsen Apr 29, 2025
5e8efdb
fix(#2433): make copy link & toc items to handle tab position
vanessatran-ddi Apr 30, 2025
daaa4b9
feat(#2594): document link component
bdfranck Apr 29, 2025
5c1b848
Merge pull request #349 from GovAlta/vanessa/tabs-urls-2443
chrisolsen May 1, 2025
94fb7ce
Merge pull request #348 from GovAlta/benjifranck/feat-2594
chrisolsen May 1, 2025
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
30 changes: 15 additions & 15 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.2.1",
"@abgov/ui-components-common": "1.2.1",
"@abgov/web-components": "1.32.1",
"@abgov/react-components": "6.3.0-alpha.6",
"@abgov/ui-components-common": "1.3.0-alpha.2",
"@abgov/web-components": "1.33.0-alpha.17",
"@faker-js/faker": "^8.3.1",
"highlight.js": "^11.8.0",
"js-cookie": "^3.0.5",
Expand Down
Binary file modified public/images/accordion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/block.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/callout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/chip.png
Binary file not shown.
Binary file modified public/images/date-picker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/details.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/drawer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/dropdown.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/filter-chip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/footer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/footerb.png
Binary file not shown.
Binary file modified public/images/form-stepper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/icons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/microsite-header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/not-yet-available.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/notification-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/radio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/side-menu.png
Binary file added public/images/skeleton-loader.png
Binary file removed public/images/skeleton-loading.png
Diff not rendered.
Binary file modified public/images/spacer.png
Binary file modified public/images/table.png
Binary file modified public/images/tabs.png
Binary file modified public/images/text-area.png
7 changes: 5 additions & 2 deletions src/components/code-snippet/CodeSnippet.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
border-radius: 4px;
margin-top: var(--goa-space-m);
overflow: hidden;
max-height: 25rem;
max-height: 20rem;
position: relative;
font: var(--goa-typography-number-s);
}

.goa-code-snippet pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
padding-right: var(--goa-space-2xl); /** to not overlap with copy button **/
background-color: var(--goa-color-greyscale-100);
}

.goa-code-snippet.overflow pre {
padding-bottom: var(--goa-space-xl); /** to not overlap with show more/less button **/
padding-right: var(--goa-space-2xl); /** to not overlap with copy button **/
padding-right: var(--goa-space-3xl); /** to not overlap with copy button **/
background-color: var(--goa-color-greyscale-100);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/code-snippet/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export const CodeSnippet: FC<Props> = ({ lang, allowCopy, code, children, tags }

{allowCopy && (
<div className="goa-code-snippet-actions--copy">
<GoabTooltip content={isCopied ? `Copied` : `Copy?`} position="left">
<GoabTooltip content={isCopied ? "Copied" : "Copy"} key={isCopied ? "copied" : "copy"} position="left">
<GoabIconButton icon="copy" onClick={copyCode} />
</GoabTooltip>
</div>
Expand Down
22 changes: 19 additions & 3 deletions src/components/component-card/ComponentCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
.card-image {
width: 100%;
height: 200px;
background-size: contain;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
border-bottom: 1px solid var(--goa-color-greyscale-200);
Expand All @@ -20,6 +20,22 @@

.card-content a {
font-size: var(--goa-font-size-7);
display: block;
margin-bottom: 1rem;
display: flex;
}

.card-content a.github-link {
font: var(--goa-typography-body-s);
margin-top: 1rem;
margin-bottom: 0;
}

.card-content a:focus {
outline: none;
box-shadow: none;
background: none;
}

.card:focus-within {
outline: 3px solid var(--goa-color-interactive-focus);
border-radius: 4px;
}
102 changes: 92 additions & 10 deletions src/components/component-card/ComponentCard.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,112 @@
import { Link } from "react-router-dom";
import "./ComponentCard.css";
import { toKebabCase } from '../../utils/index';
import { toKebabCase } from "../../utils";
import { GoabBadge, GoabText } from "@abgov/react-components";
import { useState, useEffect } from "react";

export type ComponentStatus = "Published" | "Not Published" | "In Progress";

// Define allowed group options as a union type
type Group =
| "Content layout"
| "Feedback and alerts"
| "Inputs and actions"
| "Structure and navigation"
| "Utilities";
import { useContext } from "react";
import { LanguageVersionContext } from "@contexts/LanguageVersionContext.tsx";
import { ANGULAR_VERSIONS, REACT_VERSIONS } from "@components/version-language-switcher/version-language-constants.ts";

export interface Props {
name: string;
description: string;
groups: string[];
groups: Group[]; // Use the Group type here
tags?: string[];
status: ComponentStatus;
githubLink?: string;
openIssues?: number;
isNew?: boolean; // if true, show a badge on the component card to let users know the component is available in the latest version
}

function dasherize(value: string): string {
return value.split(" ").join("-");
}

export function ComponentCard(props: Props) {
const [imageUrl, setImageUrl] = useState(`/images/${dasherize(props.name)}.png`);

useEffect(() => {
const testImage = new Image();
testImage.src = imageUrl;
testImage.onerror = () => setImageUrl("/images/not-yet-available.png");
}, [imageUrl]);

const getBadgeType = (status: ComponentStatus) => {
switch (status) {
case "Published":
return null; // No badge for "Published"
case "Not Published":
return "information";
case "In Progress":
return "important";
default:
return "information"; // Fallback for unknown status
}
};

const badgeType = getBadgeType(props.status);

const {language} = useContext(LanguageVersionContext);
return (
<div className="card">
<div
className="card-image"
style={{ backgroundImage: `url(/images/${dasherize(props.name)}.png)` }}
/>
<div className="card-content">
<Link to={toKebabCase(props.name)}>
{`${props.name.substring(0, 1).toUpperCase()}${props.name.substring(1)}`}
{props.status === "Published" ? (
<Link to={toKebabCase(props.name)} tabIndex={-1}>
<div
className="card-image"
style={{ backgroundImage: `url(${imageUrl})` }}
/>
</Link>
{props.description}
) : (
<div
className="card-image"
tabIndex={-1}
style={{ backgroundImage: `url(${imageUrl})` }}
/>
)}
<div className="card-content">
<div className="card-title-with-badge">
{badgeType && <GoabBadge mt="none" mb="m" type={badgeType} content={props.status} />}

{props.status === "Published" ? (

<Link to={toKebabCase(props.name)}>
{`${props.name.substring(0, 1).toUpperCase()}${props.name.substring(1)}`}
</Link>

) : (

<GoabText size="body-l" mt="none" mb="none">
{`${props.name.substring(0, 1).toUpperCase()}${props.name.substring(1)}`}
</GoabText>

)}
</div>
<GoabText size="body-m" mt="m" mb="none">
{props.description}
</GoabText>
{props.status !== "Published" && props.githubLink && (
<GoabText size="body-s">
<a
href={props.githubLink}
target="_blank"
rel="noopener noreferrer"
className="github-link"
>
View issues{typeof props.openIssues === 'number' && ` (${props.openIssues})`}
</a>
</GoabText>
)}
{props.isNew && <GoabBadge type="important" mt="l" content={"Available in " + (language === "angular" ? ANGULAR_VERSIONS.NEW.label.substring(0,2).toUpperCase() : REACT_VERSIONS.NEW.label.substring(0,2).toUpperCase())}/>}
</div>
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/components/component-content/ComponentContent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import TOC from "@components/table-of-contents/TOC";
import "./component-content.css";
import { GoabDivider } from "@abgov/react-components";

type Props = {
children: React.ReactNode;
Expand All @@ -11,8 +12,10 @@ export function ComponentContent({tocCssQuery, contentClassName, children}: Prop

return <>
<div className="component-content--container">
<div style={{ maxWidth: tocCssQuery ? "auto" : "54rem" }} className={`component-content--content ${contentClassName ? contentClassName: ""}`}>
<div style={{ maxWidth: tocCssQuery ? "auto" : "54rem" }}
className={`component-content--content ${contentClassName ? contentClassName : ""}`}>
{children}
<GoabDivider mt="3xl"></GoabDivider>
</div>
{tocCssQuery && <TOC cssQuery={tocCssQuery} />}
</div>
Expand Down
31 changes: 27 additions & 4 deletions src/components/component-header/ComponentHeader.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,34 @@
.component-header {
margin-bottom: 3rem;
margin-top: 2rem;
margin-bottom: var(--goa-space-l);
margin-top: var(--goa-space-xl);
}

.component-header h1 {
margin-bottom: 1rem;
margin-top: 1.5rem;
margin-bottom: var(--goa-space-m);
margin-top: var(--goa-space-l);
}

.component-header h3 {
margin-bottom: var(--goa-space-xs);
}

.component-header span.small,
.component-header a.small {
font: var(--goa-typography-body-s);
margin-bottom: var(--goa-space-xs);
}

.component-header span.x-small,
.component-header a.x-small {
font: var(--goa-typography-body-xs);
}

.related-links {
color: var(--goa-color-text-secondary);
}

.grey {
color: var(--goa-color-text-secondary);
}

@media screen and (max-width: 623px) {
Expand Down
Loading