Skip to content

Commit

Permalink
add githubLink to all components
Browse files Browse the repository at this point in the history
  • Loading branch information
benkates committed Jul 12, 2024
1 parent e96a39a commit 7e49c89
Show file tree
Hide file tree
Showing 31 changed files with 199 additions and 45 deletions.
5 changes: 4 additions & 1 deletion src/lib/Analytics/Analytics.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
description: {
component: "A component that provides Google Analytics functionality to your page."
}
},
githubLink: {
url: "/Analytics/Analytics.svelte"
}
}
};
Expand All @@ -27,6 +30,6 @@
name="Default"
args={{
title: "Urban Institute dataviz components storybook",
mode: "development",
mode: "development"
}}
/>
6 changes: 5 additions & 1 deletion src/lib/Block/Block.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
parameters: {
docs: {
description: {
component: "A basic content block with several width options. This helps when building a page layout if you'd like to place your own components inside a container that aligns with the body well of a typical urban.org layout, a wider block, or a full width block."
component:
"A basic content block with several width options. This helps when building a page layout if you'd like to place your own components inside a container that aligns with the body well of a typical urban.org layout, a wider block, or a full width block."
}
},
githubLink: {
url: "/Block/Block.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/Button/Button.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
description: {
component: "Basic HTML Button adhering to Urban styles."
}
},
githubLink: {
url: "/Button/Button.svelte"
}
}
};
Expand Down
13 changes: 11 additions & 2 deletions src/lib/ChartBlock/ChartBlock.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@
},
docs: {
description: {
component: "A basic wrapper for charts that includes, title, description, source, and notes. The default slot can be used to include any type of content or visualization between the provided text."
component:
"A basic wrapper for charts that includes, title, description, source, and notes. The default slot can be used to include any type of content or visualization between the provided text."
}
},
githubLink: {
url: "/ChartBlock/ChartBlock.svelte"
}
}
};
Expand Down Expand Up @@ -60,7 +64,12 @@
args={{ ...chartArgs, color: "#FFFFFF" }}
/>
<Story name="With a Datawrapper chart" args={{ ...chartArgs, color: "#FFFFFF" }}>
<ChartBlock title="Datawrapper chart" description="This is what a Datawrapper looks like inside this component." source="Chart source" notes="Chart notes">
<ChartBlock
title="Datawrapper chart"
description="This is what a Datawrapper looks like inside this component."
source="Chart source"
notes="Chart notes"
>
<DatawrapperIframe
title="Datawrapper title"
ariaLabel="This is an accessible title for the visualization"
Expand Down
3 changes: 3 additions & 0 deletions src/lib/DatawrapperIframe/DatawrapperIframe.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
component:
"Datawrapper iframe with <a href='https://developer.datawrapper.de/docs/listening-to-chart-interaction-events' target='_blank'>event dispatching</a> enabled. All interaction events are accessible via <code>on:eventname</code> (<b>no periods</b>) on the `DatawrapperIframe` Svelte component itself. The complete event list and associated descriptions can be found <a href='https://developer.datawrapper.de/docs/listening-to-chart-interaction-events#visualization-events' target='_blank'>here</a>.<br/><br/>Examples of how to setup \"switching\" between Datawrapper charts with a dropdown or button controls can be found <a href='/docs/examples-datawrapper-switching--docs'>in the Examples section here</a>.<br/><br/>In April 2024, the <code>vis.rendered</code> event was added to the Datawrapper event list (per the Urban team's request) in order to track when a visualization had been rendered/painted on the page. This is useful if there is a longer loading visualization (like a large map) and you'd like to indicate to the user that the visualization is still loading.<br><br>The `startrender` event is available via the component's `beforeUpdate()` function in order to track when the iframe starts to load. This can be combined with the `vis.rendered` event to track when the visualization has been rendered/painted on the page in combination with the <a href='/docs/components-loadingwrapper--docs' >LoadingWrapper</a> component."
}
},
githubLink: {
url: "/DatawrapperIframe/DatawrapperIframe.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/HeadingAlt/HeadingAlt.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "Alternate title heading in all caps, useful for h2 tags and lower."
}
},
githubLink: {
url: "/HeadingAlt/HeadingAlt.svelte"
}
}
};
Expand Down
30 changes: 21 additions & 9 deletions src/lib/Headline/Headline.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,19 @@
description: {
component: "A basic headline component."
}
},
githubLink: {
url: "/Headline/Headline.svelte"
}
},
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
import { Button } from "$lib";
const hed = "Urban Institute Data Visualization Project Headline"
const hed = "Urban Institute Data Visualization Project Headline";
</script>

<Template let:args>
Expand All @@ -62,7 +65,8 @@
headline: hed,
date: "January 1, 1968",
eyebrow: "Data tool",
description: "The Urban Institute is a nonprofit research organization that provides data and evidence to help advance upward mobility and equity.",
description:
"The Urban Institute is a nonprofit research organization that provides data and evidence to help advance upward mobility and equity.",
shareUrl: "https://urban.org"
}}
/>
Expand Down Expand Up @@ -101,7 +105,7 @@
args={{
headline: hed,
date: "January 1, 1968",
eyebrow: "Data tool",
eyebrow: "Data tool"
}}
/>

Expand All @@ -114,21 +118,29 @@
eyebrow: "Data tool",
shareUrl: "https://urban.org",
variant: "light"
}}/>
}}
/>

<Story name="With custom slots">
<Headline shareUrl="https://urban.org">
<Headline shareUrl="https://urban.org">
<div slot="eyebrow">
<img src="urban-logo.svg" alt="An Urban institute logo" width="120px"/>
<img src="urban-logo.svg" alt="An Urban institute logo" width="120px" />
</div>
<h1 style="color: var(--color-blue); text-transform: uppercase; font-weight: var(--font-weight-bold)" slot="headline">Custom headline slot</h1>
<h1
style="color: var(--color-blue); text-transform: uppercase; font-weight: var(--font-weight-bold)"
slot="headline"
>
Custom headline slot
</h1>
<div slot="description">
<p>This is a custom description slot</p>
</div>
<p slot="date">Custom date slot: January 1, 1968</p>
<div slot="extra">
<Button>Extra slot</Button>
<p style="font-size: var(--font-size-small); color: var(--color-gray-darker)">(Custom button)</p>
<p style="font-size: var(--font-size-small); color: var(--color-gray-darker)">
(Custom button)
</p>
</div>
</Headline>
</Story>
3 changes: 3 additions & 0 deletions src/lib/LoadingWrapper/LoadingWrapper.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
component:
'Wrapper to display a loading spinner graphic while content is loading. Exposes `setChildLoading()` and `setChildLoaded()` to be used by children as an alternative method of setting `isChildLoading` boolean. Accepts an alternative graphic for the "graphic" named slot.'
}
},
githubLink: {
url: "/LoadingWrapper/LoadingWrapper.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LogoTPCBadge/LogoTPCBadge.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "Tax Policy Center logo in square badge format."
}
},
githubLink: {
url: "/LogoTPCBadge/LogoTPCBadge.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LogoUrban/LogoUrban.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
description: {
component: "Urban Institute logo in full width format."
}
},
githubLink: {
url: "/LogoUrban/LogoUrban.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LogoUrbanAnimated/LogoUrbanAnimated.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "An animated Urban Institute logo icon"
}
},
githubLink: {
url: "/LogoUrbanAnimated/LogoUrbanAnimated.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LogoUrbanBadge/LogoUrbanBadge.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "Urban Institute logo in square badge format."
}
},
githubLink: {
url: "/LogoUrbanBadge/LogoUrbanBadge.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/LogoUrbanWide/LogoUrbanWide.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
description: {
component: "Urban Institute logo in wide format."
}
},
githubLink: {
url: "/LogoUrbanWide/LogoUrbanWide.svelte"
}
}
};
Expand Down
28 changes: 17 additions & 11 deletions src/lib/Meta/Meta.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@
parameters: {
docs: {
description: {
component: "This component uses Svelt's built-in `<svelte:head>` component to include important metadata for your HTML page."
component:
"This component uses Svelt's built-in `<svelte:head>` component to include important metadata for your HTML page."
}
},
githubLink: {
url: "/Meta/Meta.svelte"
}
}
};
Expand All @@ -35,13 +39,15 @@
<Meta />
</Template>

<Story name="Default" args={{
title: "",
description: "",
url: "",
siteName: "Urban Institute",
authors: ["Author Name", "Author Name"],
keywords: ["keyword1", "keyword2"],
socialImage: ""
}}>Nothing to see here</Story>

<Story
name="Default"
args={{
title: "",
description: "",
url: "",
siteName: "Urban Institute",
authors: ["Author Name", "Author Name"],
keywords: ["keyword1", "keyword2"],
socialImage: ""
}}>Nothing to see here</Story
>
3 changes: 3 additions & 0 deletions src/lib/Navbar/Navbar.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
component:
"Full width navigation bar for top of page. Includes <code>brand</code> and <code>sticky</code> properties for Urban/TPC logo and absolute position controls respectively."
}
},
githubLink: {
url: "/Navbar/Navbar.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/ProjectCredits/ProjectCredits.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "A block for project credits."
}
},
githubLink: {
url: "/ProjectCredits/ProjectCredits.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/Pym/PymChild.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
description: {
component: "A basic headline component."
}
},
githubLink: {
url: "/Pym/PymChild.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/ReturnTop/ReturnTop.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
description: {
component: "A button for moving the browser to a specified element ID."
}
},
githubLink: {
url: "/ReturnTop/ReturnTop.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/Scorecard/Scorecard.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
component:
"Scorecard element, which displays a value and a label, originally developed for <a href='https://www.urban.org/policy-centers/center-labor-human-services-and-population/projects/apprenticeship-support' target='_blank'>this project</a>."
}
},
githubLink: {
url: "/Scorecard/Scorecard.svelte"
}
}
};
Expand Down
5 changes: 5 additions & 0 deletions src/lib/Scrolly/Scrolly.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
options: ["center", "left", "right"],
control: { type: "select" }
}
},
parameters: {
githubLink: {
url: "/Scrolly/Scrolly.svelte"
}
}
};
</script>
Expand Down
3 changes: 3 additions & 0 deletions src/lib/SectionBreak/SectionBreak.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
component:
"Section break element that includes a number, a subhead and a horizontal rule."
}
},
githubLink: {
url: "/SectionBreak/SectionBreak.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/SocialShare/SocialShare.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
description: {
component: "Social share icons, available in light or dark mode."
}
},
githubLink: {
url: "/SocialShare/SocialShare.svelte"
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/lib/TextBlock/TextBlock.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
description: {
component: "A basic text block."
}
},
githubLink: {
url: "/TextBlock/TextBlock.svelte"
}
}
};
Expand Down
10 changes: 6 additions & 4 deletions src/lib/Theme/Theme.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
slot_default: {
control: { type: "text" }
}
},
parameters: {
backgrounds: {
Expand All @@ -27,8 +26,12 @@
},
docs: {
description: {
component: "A theme wrapper that provides styles for children components. All of the components in this library rely on CSS provided by this <Theme> component. If you are working on a project that depends on this library, you should probably wrap your entire page inside of a `<Theme></Theme>`. If you are pulling in just a component or two to a project that otherwise doesn't use this library, you'll want to wrap those components directly in a `<Theme>`.\n\n```html\n<Theme>\n <ChildComponent />\n <ChildComponent />\n</Theme>\n```"
component:
"A theme wrapper that provides styles for children components. All of the components in this library rely on CSS provided by this <Theme> component. If you are working on a project that depends on this library, you should probably wrap your entire page inside of a `<Theme></Theme>`. If you are pulling in just a component or two to a project that otherwise doesn't use this library, you'll want to wrap those components directly in a `<Theme>`.\n\n```html\n<Theme>\n <ChildComponent />\n <ChildComponent />\n</Theme>\n```"
}
},
githubLink: {
url: "/Theme/Theme.svelte"
}
}
};
Expand All @@ -39,8 +42,7 @@
</script>

<Template let:args>
<Theme/>
<Theme />
</Template>

<Story name="Default" />

3 changes: 3 additions & 0 deletions src/lib/Toggle/Toggle.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
description: {
component: "Toggle component adhering to Urban styles."
}
},
githubLink: {
url: "/Toggle/Toggle.svelte"
}
}
};
Expand Down
Loading

0 comments on commit 7e49c89

Please sign in to comment.