diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts index c083b12..eef2faf 100644 --- a/src/components/Icons/index.ts +++ b/src/components/Icons/index.ts @@ -1,2 +1,3 @@ export { default as Arrow2 } from './Arrow2/Arrow2.astro'; -export { default as Profile } from './profile/profile.astro'; \ No newline at end of file +export { default as Profile } from './profile/profile.astro'; +export { default as Share } from './share/share.astro'; \ No newline at end of file diff --git a/src/components/Icons/share/share.astro b/src/components/Icons/share/share.astro new file mode 100644 index 0000000..974a5da --- /dev/null +++ b/src/components/Icons/share/share.astro @@ -0,0 +1,27 @@ +--- +import share16 from './svgs/share-16.svg?raw'; +import share24 from './svgs/share-24.svg?raw'; +import share32 from './svgs/share-32.svg?raw'; + +export interface Props { + size: 16 | 24 | 32; + label?: string; + class?: string; +} + +const { size = 24, label, class: className } = Astro.props; + +let raw: string; +if (size === 16 ) raw = share16; +else if (size === 24 ) raw = share24; +else if (size === 32 ) raw = share32; +else raw = ''; // Fallback to a blank string if no match is found, though this should not happen due to the type constraints on size. + + +const classes = ['nds-icon-share', className].filter(Boolean).join(' '); +const svg = raw + .replace(/fill="#[A-Fa-f0-9]{3,8}"/g, 'fill="currentColor"') + .replace(' diff --git a/src/components/Icons/share/svgs/share-16.svg b/src/components/Icons/share/svgs/share-16.svg new file mode 100644 index 0000000..e93d682 --- /dev/null +++ b/src/components/Icons/share/svgs/share-16.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Icons/share/svgs/share-24.svg b/src/components/Icons/share/svgs/share-24.svg new file mode 100644 index 0000000..f4c945d --- /dev/null +++ b/src/components/Icons/share/svgs/share-24.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Icons/share/svgs/share-32.svg b/src/components/Icons/share/svgs/share-32.svg new file mode 100644 index 0000000..f5b0c31 --- /dev/null +++ b/src/components/Icons/share/svgs/share-32.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index bc31e58..57300c8 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,6 @@ --- import Layout from '../layouts/Layout.astro'; -import { Arrow2, Profile } from '../components/Icons/index.ts'; +import { Arrow2, Profile, Share } from '../components/Icons/index.ts'; --- @@ -32,6 +32,10 @@ import { Arrow2, Profile } from '../components/Icons/index.ts'; +
+ + +