-
Notifications
You must be signed in to change notification settings - Fork 11
task(#2898): move components examples #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/examples/display-numbers-in-a-table-so-they-can-be-scanned-easily.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| import { GoabTable } from "@abgov/react-components"; | ||
| import { Sandbox } from "@components/sandbox"; | ||
|
|
||
| export const DisplayNumbersInATableSoTheyCanBeScannedEasily = () => { | ||
| return ( | ||
| <> | ||
| <Sandbox fullWidth> | ||
| <GoabTable width="100%"> | ||
| <thead> | ||
| <tr> | ||
| <th>Col 1</th> | ||
| <th>Col 2</th> | ||
| <th className="goa-table-number-header">Number Column</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td>Item 1</td> | ||
| <td>Item 2</td> | ||
| <td className="goa-table-number-column">54</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Item 1</td> | ||
| <td>Item 2</td> | ||
| <td className="goa-table-number-column">4567</td> | ||
| </tr> | ||
| </tbody> | ||
| </GoabTable> | ||
| </Sandbox> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default DisplayNumbersInATableSoTheyCanBeScannedEasily; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import { GoabButton, GoabHeroBanner, GoabHeroBannerActions } from "@abgov/react-components"; | ||
| import { useContext } from "react"; | ||
| import { LanguageVersionContext } from "@contexts/LanguageVersionContext.tsx"; | ||
| import { CodeSnippet } from "@components/code-snippet/CodeSnippet.tsx"; | ||
| import { Sandbox } from "@components/sandbox"; | ||
|
|
||
| export const HeroBannerWithActions = () => { | ||
| const { version } = useContext(LanguageVersionContext); | ||
|
|
||
| function noop() {} | ||
|
|
||
| return ( | ||
| <> | ||
| <Sandbox skipRender fullWidth> | ||
| {version === "old" && ( | ||
| <CodeSnippet | ||
| lang="html" | ||
| tags="angular" | ||
| allowCopy={true} | ||
| code={` | ||
| <goa-hero-banner heading="Supporting public citizens"> | ||
| Digital services help to support Albertan citizens receive government services. | ||
| <div slot="actions"> | ||
| <goa-button type="start" (_click)="onClick($event)">Call to action</goa-button> | ||
| </div> | ||
| </goa-hero-banner> | ||
| `} | ||
| /> | ||
| )} | ||
|
|
||
| {version === "new" && ( | ||
| <CodeSnippet | ||
| lang="html" | ||
| tags="angular" | ||
| allowCopy={true} | ||
| code={` | ||
| <goab-hero-banner heading="Supporting Businesses" [actions]="heroBannerActionTemplate"> | ||
| Resources are available to help Alberta entrepreneurs and small businesses start, grow and succeed. | ||
| <ng-template #heroBannerActionTemplate> | ||
| <goab-button type="start">Call to action</goab-button> | ||
| </ng-template> | ||
| </goab-hero-banner> | ||
| `} | ||
| /> | ||
| )} | ||
|
|
||
| {/*React code*/} | ||
| {version === "old" && ( | ||
| <CodeSnippet | ||
| lang="html" | ||
| tags="react" | ||
| allowCopy={true} | ||
| code={` | ||
| <GoAHeroBanner heading="Supporting Businesses"> | ||
| Resources are available to help Alberta entrepreneurs and small businesses start, grow and succeed. | ||
| <GoAHeroBannerActions> | ||
| <GoAButton type="start" onClick={noop}>Call to action</GoAButton> | ||
| </GoAHeroBannerActions> | ||
| </GoAHeroBanner> | ||
| `} | ||
| /> | ||
| )} | ||
| {version === "new" && ( | ||
| <CodeSnippet | ||
| lang="html" | ||
| tags="react" | ||
| allowCopy={true} | ||
| code={` | ||
| <GoabHeroBanner heading="Supporting Businesses"> | ||
| Resources are available to help Alberta entrepreneurs and small businesses start, grow and succeed. | ||
| <GoabHeroBannerActions> | ||
| <GoabButton type="start">Call to action</GoabButton> | ||
| </GoabHeroBannerActions> | ||
| </GoabHeroBanner> | ||
| `} | ||
| /> | ||
| )} | ||
|
|
||
| <GoabHeroBanner heading="Supporting Businesses"> | ||
| Resources are available to help Alberta entrepreneurs and small businesses start, grow and | ||
| succeed. | ||
| <GoabHeroBannerActions> | ||
| <GoabButton type="start" onClick={noop}> | ||
| Call to action | ||
| </GoabButton> | ||
| </GoabHeroBannerActions> | ||
| </GoabHeroBanner> | ||
| </Sandbox> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default HeroBannerWithActions; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { HeroBannerWithActions } from "@examples/hero-banner-with-actions.tsx"; | ||
| import { SandboxHeader } from "@components/sandbox/sandbox-header/sandboxHeader.tsx"; | ||
|
|
||
| export const HeroBannerExamples = () => { | ||
| return ( | ||
| <> | ||
| <SandboxHeader | ||
| exampleTitle="Hero Banner with actions" | ||
| figmaExample="https://www.figma.com/design/aIRjvBzpIUH0GbkffjbL04/%E2%9D%96-Patterns-library-%7C-DDD?node-id=6309-93120&t=X0IQW5flDDaj8Vyg-4"> | ||
| </SandboxHeader> | ||
| <HeroBannerWithActions /> | ||
| </> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import { ShowMultipleActionsInACompactTable } from "@examples/show-multiple-actions-in-a-compact-table.tsx"; | ||
| import { SandboxHeader } from "@components/sandbox/sandbox-header/sandboxHeader.tsx"; | ||
|
|
||
| export const IconButtonExamples = () => { | ||
| return ( | ||
| <> | ||
| <SandboxHeader | ||
| exampleTitle="Show multiple actions in a compact table" | ||
| figmaExample="https://www.figma.com/design/aIRjvBzpIUH0GbkffjbL04/%E2%9D%96-Patterns-library-%7C-DDD?node-id=6309-127620&t=X0IQW5flDDaj8Vyg-4"> | ||
| </SandboxHeader> | ||
| <ShowMultipleActionsInACompactTable /> | ||
| </> | ||
| ); | ||
| }; |
115 changes: 115 additions & 0 deletions
115
src/examples/show-multiple-actions-in-a-compact-table.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| import { GoabBadge, GoabBlock, GoabIconButton, GoabTable } from "@abgov/react-components"; | ||
| import { Sandbox } from "@components/sandbox"; | ||
|
|
||
| export const ShowMultipleActionsInACompactTable = () => { | ||
| return ( | ||
| <> | ||
| <Sandbox fullWidth> | ||
| <GoabTable width="100%"> | ||
| <thead> | ||
| <tr> | ||
| <th>Status</th> | ||
| <th>Name</th> | ||
| <th style={{ textAlign: "right" }}>Id Number</th> | ||
| <th>Edit | Flag | Send</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="information" content="In progress"></GoabBadge> | ||
| </td> | ||
| <td>Darlene Robertson</td> | ||
| <td className="goa-table-number-column">45904</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="dark" content="Inactive"></GoabBadge> | ||
| </td> | ||
| <td>Floyd Miles</td> | ||
| <td className="goa-table-number-column">47838</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="success" content="Active"></GoabBadge> | ||
| </td> | ||
| <td>Kathryn Murphy</td> | ||
| <td className="goa-table-number-column">34343</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="important" content="Recent"></GoabBadge> | ||
| </td> | ||
| <td>Annette Black</td> | ||
| <td className="goa-table-number-column">89897</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="success" content="Active"></GoabBadge> | ||
| </td> | ||
| <td>Esther Howard</td> | ||
| <td className="goa-table-number-column">12323</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| <tr> | ||
| <td> | ||
| <GoabBadge type="success" content="Active"></GoabBadge> | ||
| </td> | ||
| <td>Jane Cooper</td> | ||
| <td className="goa-table-number-column">56565</td> | ||
| <td> | ||
| <GoabBlock> | ||
| <GoabIconButton size="small" icon="pencil" ariaLabel="Edit"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="flag" ariaLabel="Flag"></GoabIconButton> | ||
| <GoabIconButton size="small" icon="mail" ariaLabel="Send"></GoabIconButton> | ||
| </GoabBlock> | ||
| </td> | ||
| <td></td> | ||
| </tr> | ||
| </tbody> | ||
| </GoabTable> | ||
| </Sandbox> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default ShowMultipleActionsInACompactTable; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import { GoabBadge, GoabBlock } from "@abgov/react-components"; | ||
| import { Sandbox } from "@components/sandbox"; | ||
|
|
||
| export const ShowMultipleTagsTogether = () => { | ||
| return ( | ||
| <> | ||
| <Sandbox> | ||
| <GoabBlock gap="xs"> | ||
| <GoabBadge type="information" content="In progress" /> | ||
| <GoabBadge type="important" content="Priority" /> | ||
| <GoabBadge type="emergency" content="Past deadline" /> | ||
| </GoabBlock> | ||
| </Sandbox> | ||
| </> | ||
| ); | ||
| }; | ||
|
|
||
| export default ShowMultipleTagsTogether; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.