diff --git a/src/components/Icons/index.ts b/src/components/Icons/index.ts index eef2faf..17f8889 100644 --- a/src/components/Icons/index.ts +++ b/src/components/Icons/index.ts @@ -1,3 +1,4 @@ -export { default as Arrow2 } from './Arrow2/Arrow2.astro'; -export { default as Profile } from './profile/profile.astro'; -export { default as Share } from './share/share.astro'; \ No newline at end of file +export { default as Arrow2Icon } from './Arrow2/Arrow2.astro'; +export { default as ProfileIcon } from './profile/profile.astro'; +export { default as ShareIcon } from './share/share.astro'; +export { default as SearchIcon } from './search/search.astro'; \ No newline at end of file diff --git a/src/components/Icons/search/search.astro b/src/components/Icons/search/search.astro new file mode 100644 index 0000000..436bf6c --- /dev/null +++ b/src/components/Icons/search/search.astro @@ -0,0 +1,27 @@ +--- +import search16 from './svgs/search-16.svg?raw'; +import search24 from './svgs/search-24.svg?raw'; +import search32 from './svgs/search-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 = search16; +else if (size === 24 ) raw = search24; +else if (size === 32 ) raw = search32; +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-search', 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/search/svgs/search-16.svg b/src/components/Icons/search/svgs/search-16.svg new file mode 100644 index 0000000..6d404ba --- /dev/null +++ b/src/components/Icons/search/svgs/search-16.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Icons/search/svgs/search-24.svg b/src/components/Icons/search/svgs/search-24.svg new file mode 100644 index 0000000..d8d6ece --- /dev/null +++ b/src/components/Icons/search/svgs/search-24.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Icons/search/svgs/search-32.svg b/src/components/Icons/search/svgs/search-32.svg new file mode 100644 index 0000000..b3380e6 --- /dev/null +++ b/src/components/Icons/search/svgs/search-32.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index 57300c8..bef18b6 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,6 +1,6 @@ --- import Layout from '../layouts/Layout.astro'; -import { Arrow2, Profile, Share } from '../components/Icons/index.ts'; +import { Arrow2Icon, ProfileIcon, ShareIcon, SearchIcon } from '../components/Icons/index.ts'; --- @@ -10,112 +10,38 @@ import { Arrow2, Profile, Share } from '../components/Icons/index.ts';

Icon — 16 / 24 / 32

- - - - + + + +
- - - - + + + +
- - - - + + + +
- - - + + +
- - - -
- - - - - - -
-
- - - - -
-
- - - - -
+ + + + +
+ + + +