diff --git a/site/src/layouts/header/SearchBox.vue b/site/src/layouts/header/SearchBox.vue index c26e10020..ad0456bed 100644 --- a/site/src/layouts/header/SearchBox.vue +++ b/site/src/layouts/header/SearchBox.vue @@ -5,7 +5,7 @@ ref="inputRef" :placeholder="searchPlaceholder" @focus="triggerFocus(true)" - @blue="triggerFocus(false)" + @blur="triggerFocus(false)" > diff --git a/site/src/theme/static/common.less b/site/src/theme/static/common.less index 8bdd553cf..d0be99440 100644 --- a/site/src/theme/static/common.less +++ b/site/src/theme/static/common.less @@ -46,11 +46,6 @@ a { &:hover &-inner { overflow-y: auto; } - - > div, - > div > div { - height: 100%; - } } .aside-container { diff --git a/site/src/theme/static/icons.less b/site/src/theme/static/icons.less index 0440d22d5..91f463e39 100644 --- a/site/src/theme/static/icons.less +++ b/site/src/theme/static/icons.less @@ -86,3 +86,17 @@ ul.anticons-list { background: #f5f5f5; border-radius: 2px; } + +.icons-affix { + display: flex; + justify-content: space-between; + transition: all 0.25s; +} + +.icons-affixed { + padding: 12px; + margin: -8px; + border-radius: 6px; + border: 1px solid var(--border-color-base); + background-color: var(--body-background); +} diff --git a/site/src/theme/template/IconDisplay/CopyableIcon.vue b/site/src/theme/template/IconDisplay/CopyableIcon.vue index ee63dcf8a..a6124ae25 100644 --- a/site/src/theme/template/IconDisplay/CopyableIcon.vue +++ b/site/src/theme/template/IconDisplay/CopyableIcon.vue @@ -22,8 +22,8 @@ const allIcons = AntdIcons; const kebabCase = function kebabCase(str) { return str .split(/(?=[A-Z])/) - .join('-') - .toLowerCase(); + .map(s => s.replace(s[0], s[0].toUpperCase())) + .join(''); }; export default defineComponent({ diff --git a/site/src/theme/template/IconDisplay/index.jsx b/site/src/theme/template/IconDisplay/index.jsx index 216590f0f..66c5dc380 100644 --- a/site/src/theme/template/IconDisplay/index.jsx +++ b/site/src/theme/template/IconDisplay/index.jsx @@ -24,13 +24,17 @@ const IconDisplay = defineComponent({ data() { return { theme: ThemeType.Outlined, + searchVal: '', + searchBarAffixed: false, }; }, methods: { handleChangeTheme(e) { this.theme = e.target.value; }, - + handleAffixChange(affixed) { + this.searchBarAffixed = affixed; + }, renderCategories() { const { theme } = this; @@ -42,7 +46,10 @@ const IconDisplay = defineComponent({ category: key, icons: iconList .map(iconName => iconName + theme) - .filter(iconName => allIcons[iconName]), + .filter(iconName => { + if (iconName.toLowerCase().includes(this.searchVal.trim().toLowerCase())) + return allIcons[iconName]; + }), }; }) .filter(({ icons }) => !!icons.length) @@ -62,18 +69,31 @@ const IconDisplay = defineComponent({ return (