diff --git a/docs/.vitepress/components/FakeInput.vue b/docs/.vitepress/components/FakeInput.vue index 187f876bf..078cdd21e 100644 --- a/docs/.vitepress/components/FakeInput.vue +++ b/docs/.vitepress/components/FakeInput.vue @@ -1,8 +1,14 @@ + @@ -19,6 +25,8 @@ text-align: left; border: 1px solid transparent; cursor: text; + display: flex; + gap: 12px; } .fake-input:hover, .fake-input:focus { diff --git a/docs/.vitepress/components/HomeHeroIconsCard.vue b/docs/.vitepress/components/HomeHeroIconsCard.vue index 40b9c2b5a..88592de4e 100644 --- a/docs/.vitepress/components/HomeHeroIconsCard.vue +++ b/docs/.vitepress/components/HomeHeroIconsCard.vue @@ -63,9 +63,9 @@ onBeforeUnmount(() => { - - Search 964 icons... - + + Search 964 icons... + @@ -76,6 +76,7 @@ onBeforeUnmount(() => { /* padding: 0 24px; */ margin-left: auto; margin-bottom: auto; + margin-top: 48px;; } .icons-card { background: var(--vp-c-bg-alt); @@ -128,9 +129,20 @@ onBeforeUnmount(() => { .search-box { position: absolute; - bottom:-24px; width: 100%; - left: -24px; + left: 0; + top: -48px; +} + +@media (min-width: 960px) { + .search-box { + top: unset; + bottom: -24px; + left: -24px; + } + .card-wrapper { + margin-top: 0; + } } /* .search-box :deep(.input) { diff --git a/docs/.vitepress/components/IconsCategoryOverview.vue b/docs/.vitepress/components/IconsCategoryOverview.vue index 187bddeea..971bdbe10 100644 --- a/docs/.vitepress/components/IconsCategoryOverview.vue +++ b/docs/.vitepress/components/IconsCategoryOverview.vue @@ -7,24 +7,16 @@ import useSearch from '../composables/useSearch' import Input from './Input.vue' import EndOfPage from './EndOfPage.vue' import { useCategoryView } from '../composables/useCategoryView' +import useSearchInput from '../composables/useSearchInput' const props = defineProps<{ icons: IconEntity[] categories: Category[] }>() -const { selectedCategory } = useCategoryView() const activeIconName = ref('') -const searchQuery = ref( - typeof window === 'undefined' - ? '' - : ( - new URLSearchParams(window.location.search).get('search') - || '' - ) -) +const { searchInput, searchQuery, searchQueryThrottled } = useSearchInput() -const searchInput = ref() const isSearching = computed(() => !!searchQuery.value) function setActiveIconName(name: string) { @@ -57,23 +49,6 @@ const categories = computed(() => { .filter(({ icons }) => icons.length) }) -watch(searchQuery, (searchString) => { - const newUrl = new URL(window.location.href); - - newUrl.searchParams.set('search', searchString); - - nextTick(() => { - window.history.replaceState({}, '', newUrl) - }) -}) - -onMounted(() => { - const searchParams = new URLSearchParams(window.location.search); - if(searchParams.has('search')) { - searchInput.value.focus() - } -}) - const activeIcon = computed(() => props.icons?.find((icon) => icon.name === activeIconName.value) ) diff --git a/docs/.vitepress/components/IconsOverview.vue b/docs/.vitepress/components/IconsOverview.vue index 4de8da1bf..e12a15cb3 100644 --- a/docs/.vitepress/components/IconsOverview.vue +++ b/docs/.vitepress/components/IconsOverview.vue @@ -1,34 +1,26 @@ - + diff --git a/docs/.vitepress/components/Input.vue b/docs/.vitepress/components/Input.vue index e878ca9d1..d624b265a 100644 --- a/docs/.vitepress/components/Input.vue +++ b/docs/.vitepress/components/Input.vue @@ -2,23 +2,23 @@ export default { inheritAttrs: false, } + +export interface InputProps { + type: string + modelValue: string +} + + + + + + + + + + + + diff --git a/docs/.vitepress/composables/useSearchInput.ts b/docs/.vitepress/composables/useSearchInput.ts new file mode 100644 index 000000000..2687dee87 --- /dev/null +++ b/docs/.vitepress/composables/useSearchInput.ts @@ -0,0 +1,40 @@ +import { refThrottled } from '@vueuse/core'; +import { nextTick, onMounted, ref, watch } from 'vue'; + +const useSearchInput = () => { + const searchInput = ref() + const searchQuery = ref( + typeof window === 'undefined' + ? '' + : ( + new URLSearchParams(window.location.search).get('search') + || '' + ) + ) + const searchQueryThrottled = refThrottled(searchQuery, 200) + + watch(searchQueryThrottled, (searchString) => { + const newUrl = new URL(window.location.href); + + newUrl.searchParams.set('search', searchString); + + nextTick(() => { + window.history.replaceState({}, '', newUrl) + }) + }) + + onMounted(() => { + const searchParams = new URLSearchParams(window.location.search); + if(searchParams.has('focus')) { + searchInput.value.focus() + } + }) + + return { + searchInput, + searchQuery, + searchQueryThrottled + }; +}; + +export default useSearchInput; diff --git a/docs/.vitepress/theme/style.css b/docs/.vitepress/theme/style.css index 373f92f7c..0e24a67ca 100644 --- a/docs/.vitepress/theme/style.css +++ b/docs/.vitepress/theme/style.css @@ -36,13 +36,13 @@ flex-direction: column-reverse; } */ .VPHomeHero .container .main { - flex:1; + /* flex:1; */ flex-shirk: 0; } .VPHomeHero .container .image { margin: 0; order: 2; - flex: 1; + /* flex: 1; */ margin-top: 32px; } @@ -65,14 +65,6 @@ padding-right: 0; padding-left: 0; } -@media (min-width: 720px) { - .vp-doc[class^="_icons_"], .vp-doc[class*=" _icons_"] { - display: grid; - grid-template-columns: 240px minmax(0, 1fr); - gap: 24px; - align-items: flex-start; - } -} @media (min-width: 960px) { @@ -82,6 +74,20 @@ margin-top: 0; position: relative; } + + .VPHomeHero .container .main { + /* flex: 1; */ + width: 50%; + } + + .VPHomeHero .container .image { + /* flex: 1; */ + width: 50%; + } + + .VPHomeHero .container .image-container { + display: block; + } } /* html:has(* .outline-link:target) { diff --git a/docs/icons/[name].md b/docs/icons/[name].md index 21d057d84..a5a545d45 100644 --- a/docs/icons/[name].md +++ b/docs/icons/[name].md @@ -26,15 +26,20 @@ const codeExample = computed(() => params.value.codeExamples?.map( ) - - - - {{$params.name}} - + + + + + + + {{$params.name}} + + + params.value.codeExamples?.map(