Skip to content

Commit

Permalink
Merge pull request #112 from UrbanInstitute/patch-icon-library
Browse files Browse the repository at this point in the history
Icon gallery reorganization
  • Loading branch information
rachelmarconi authored Aug 28, 2024
2 parents 55eff57 + d81d2fd commit 4d366cf
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 213 deletions.
14 changes: 14 additions & 0 deletions .storybook/preview-body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<style>
.docblock-icongallery > div {
min-width: 150px;
}

.docblock-icongallery > div > div:first-child {
height: 60px;
width: 60px;
}

.docblock-icongallery .sb-story {
height: 40px;
}
</style>
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
"types": "./dist/maps/index.d.ts",
"svelte": "./dist/maps/index.js"
},
"./icons": {
"types": "./dist/icons/index.d.ts",
"svelte": "./dist/icons/index.js"
},
"./style": "./dist/style/main.css",
"./style/theme": "./dist/style/theme.css"
},
Expand Down
70 changes: 22 additions & 48 deletions src/lib/Icons/IconClose.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,50 +1,24 @@
<script context="module">
import IconClose from "./IconClose.svelte";
export const meta = {
title: "Icons/Other Icons/IconClose",
component: IconClose,
tags: ["!dev","!autodocs"],
argTypes: {
size: {
default: 40
},
fill: {
control: {
type: "color",
presetColors: ["#000", "#1696D2", "#fbdf11"]
}
}
},
parameters: {
backgrounds: {
default: "light",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#0A4C6A" }
]
},
docs: {
description: {
component:
"Any of these icons can be pulled in as standalone components. They are intended as decorations, and do not include `onClick` parameters. "
}
},
githubLink: {
url: "/Icons/IconClose.svelte"
}
import IconClose from "./IconClose.svelte";
export const meta = {
title: "Icons/Icons/IconClose",
component: IconClose,
tags: ["!dev", "!autodocs"],
parameters: {
githubLink: {
url: "/Icons/IconClose.svelte"
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconClose {...args} />
</Template>

<Story name="ClosePreview">
<IconClose size={25}/>
</Story>
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconClose {...args} />
</Template>

<Story name="Default" />
70 changes: 22 additions & 48 deletions src/lib/Icons/IconMinus.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,50 +1,24 @@
<script context="module">
import IconMinus from "./IconMinus.svelte";
export const meta = {
title: "Icons/Other Icons/IconMinus",
component: IconMinus,
tags: ["!dev","!autodocs"],
argTypes: {
size: {
default: 40
},
fill: {
control: {
type: "color",
presetColors: ["#000", "#1696D2", "#fbdf11"]
}
}
},
parameters: {
backgrounds: {
default: "light",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#0A4C6A" }
]
},
docs: {
description: {
component:
"Any of these icons can be pulled in as standalone components. They are intended as decorations, and do not include `onClick` parameters. "
}
},
githubLink: {
url: "/Icons/IconMinus.svelte"
}
import IconMinus from "./IconMinus.svelte";
export const meta = {
title: "Icons/Icons/IconMinus",
component: IconMinus,
tags: ["!dev", "!autodocs"],
parameters: {
githubLink: {
url: "/Icons/IconMinus.svelte"
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconMinus {...args} />
</Template>

<Story name="MinusPreview">
<IconMinus size={25}/>
</Story>
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconMinus {...args} />
</Template>

<Story name="Default" />
105 changes: 52 additions & 53 deletions src/lib/Icons/IconPlus.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,58 +1,57 @@
<script context="module">
import IconPlus from "./IconPlus.svelte";
export const meta = {
title: "Icons/Icon",
component: IconPlus,
//tags: ["autodocs"],
argTypes: {
size: {
default: 40
},
fill: {
control: {
type: "color",
presetColors: ["#000", "#1696D2", "#fbdf11"]
}
import IconPlus from "./IconPlus.svelte";
export const meta = {
title: "Icons/Icons/IconPlus",
component: IconPlus,
//tags: ["autodocs"],
argTypes: {
size: {
default: 40
},
fill: {
control: {
type: "color",
presetColors: ["#000", "#1696D2", "#fbdf11"]
}
}
},
parameters: {
backgrounds: {
default: "light",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#0A4C6A" }
]
},
parameters: {
backgrounds: {
default: "light",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#0A4C6A" }
]
},
docs: {
description: {
component:
"Any of these icons can be pulled in as standalone components. They are intended as decorations, and do not include `onClick` parameters. "
}
},
githubLink: {
url: "/Icons/IconPlus.svelte"
docs: {
description: {
component:
"Any of these icons can be pulled in as standalone components. They are intended as decorations, and do not include `onClick` parameters. "
}
},
githubLink: {
url: "/Icons/IconPlus.svelte"
}
};
</script>
<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
import urbanColors from "$lib/utils/urbanColors.js";
</script>
<Template let:args>
<IconPlus {...args} />
</Template>
<Story name="Default" />
<Story name="WithColor">
<IconPlus fill={urbanColors.blue} />
</Story>
<Story name="ChangingSize">
<IconPlus size={65} />
</Story>
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
import urbanColors from "$lib/utils/urbanColors.js";
</script>

<Template let:args>
<IconPlus {...args} />
</Template>

<Story name="Default" />

<Story name="WithColor">
<IconPlus fill={urbanColors.blue} />
</Story>

<Story name="ChangingSize">
<IconPlus size={65} />
</Story>
70 changes: 22 additions & 48 deletions src/lib/Icons/IconSearch.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,50 +1,24 @@
<script context="module">
import IconSearch from "./IconSearch.svelte";
export const meta = {
title: "Icons/Other Icons/IconSearch",
component: IconSearch,
tags: ["!dev","!autodocs"],
argTypes: {
size: {
default: 40
},
fill: {
control: {
type: "color",
presetColors: ["#000", "#1696D2", "#fbdf11"]
}
}
},
parameters: {
backgrounds: {
default: "light",
values: [
{ name: "light", value: "#ffffff" },
{ name: "dark", value: "#0A4C6A" }
]
},
docs: {
description: {
component:
"Any of these icons can be pulled in as standalone components. They are intended as decorations, and do not include `onClick` parameters. "
}
},
githubLink: {
url: "/Icons/IconSearch.svelte"
}
import IconSearch from "./IconSearch.svelte";
export const meta = {
title: "Icons/Icons/IconSearch",
component: IconSearch,
tags: ["!dev", "!autodocs"],
parameters: {
githubLink: {
url: "/Icons/IconSearch.svelte"
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconSearch {...args} />
</Template>

<Story name="SearchPreview">
<IconSearch size={25}/>
</Story>
}
};
</script>

<script>
import { Story, Template } from "@storybook/addon-svelte-csf";
</script>

<Template let:args>
<IconSearch {...args} />
</Template>

<Story name="Default" />
Loading

0 comments on commit 4d366cf

Please sign in to comment.