This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 63
Add pink border to VSearchButton on group hover #1286
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
53dc5a8
Add pink border to VSearchButton on group hover
obulat d51a556
Try adding visual regression tests
obulat e9c6614
Add hover
obulat f5449a9
Add snapshots
obulat c0fa198
Test visual regression tests :)
obulat d004845
Revert "Test visual regression tests :)"
obulat 70d0107
Add missing test tapes
obulat 73bf4b2
Unify SearchBar stories and TS-ify
obulat 3a18fd7
TS-ify VSearchBar
obulat 80d1a03
Reuse VInputField FIELD_SIZES constant in VSearchBar
obulat 1eafe04
Make snapshots for whole header
obulat 8a46962
Add snapshots
obulat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<template> | ||
<div | ||
class="input-field group flex flex-row items-center hover:bg-dark-charcoal-06 focus-within:bg-dark-charcoal-06 group-hover:bg-dark-charcoal-06 p-0.5px focus-within:p-0 border focus-within:border-1.5 border-dark-charcoal-20 rounded-sm overflow-hidden focus-within:border-pink" | ||
class="input-field group flex flex-row items-center focus-within:bg-dark-charcoal-06 group-hover:bg-dark-charcoal-06 p-0.5px focus-within:p-0 border focus-within:border-1.5 border-dark-charcoal-20 rounded-sm overflow-hidden focus-within:border-pink" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Background color is already applied on hover by |
||
:class="[ | ||
{ | ||
// Padding is set to 1.5px to accommodate the border that will appear later. | ||
|
@@ -26,20 +26,20 @@ | |
</div> | ||
</template> | ||
|
||
<script> | ||
import { computed } from '@nuxtjs/composition-api' | ||
<script lang="ts"> | ||
import { computed, defineComponent, PropType } from '@nuxtjs/composition-api' | ||
|
||
const FIELD_SIZES = { | ||
small: 'h-10 text-md', | ||
medium: 'h-12', | ||
large: 'h-14', | ||
standalone: 'h-14 md:h-[69px]', | ||
} | ||
} as const | ||
|
||
/** | ||
* Provides a control to enter text as input. | ||
*/ | ||
export default { | ||
export default defineComponent({ | ||
name: 'VInputField', | ||
inheritAttrs: false, | ||
model: { | ||
|
@@ -76,7 +76,8 @@ export default { | |
connectionSides: { | ||
type: Array, | ||
default: () => [], | ||
validator: (v) => v.every((item) => ['start', 'end'].includes(item)), | ||
validator: (v: string[]) => | ||
v.every((item) => ['start', 'end'].includes(item)), | ||
}, | ||
/** | ||
* Small size is for mobile header/scrolled | ||
|
@@ -85,18 +86,18 @@ export default { | |
* Standalone size is for homepage | ||
*/ | ||
size: { | ||
type: String, | ||
type: String as PropType<keyof typeof FIELD_SIZES>, | ||
required: true, | ||
validator: (v) => ['small', 'medium', 'large', 'standalone'].includes(v), | ||
validator: (v: string) => Object.keys(FIELD_SIZES).includes(v), | ||
}, | ||
}, | ||
// using non-native event name to ensure the two are not mixed | ||
emits: ['update:modelValue'], | ||
setup(props, { emit, attrs }) { | ||
const type = attrs['type'] ?? 'text' | ||
const type = typeof attrs['type'] === 'string' ? attrs['type'] : 'text' | ||
|
||
const updateModelValue = (event) => { | ||
emit('update:modelValue', event.target.value) | ||
const updateModelValue = (event: Event) => { | ||
emit('update:modelValue', (event.target as HTMLInputElement).value) | ||
} | ||
const sizeClass = computed(() => FIELD_SIZES[props.size]) | ||
|
||
|
@@ -108,7 +109,7 @@ export default { | |
updateModelValue, | ||
} | ||
}, | ||
} | ||
}) | ||
</script> | ||
|
||
<style scoped> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,8 @@ | |
"src/components/VNotificationBanner.vue", | ||
"src/components/VMigrationNotice.vue", | ||
"src/components/VVariations.vue", | ||
"src/components/VInputField/VInputField.vue", | ||
"src/components/VHeader/VSearchBar/VSearchBar.vue", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did not add |
||
"src/composables/types.js", | ||
"src/composables/use-event-listener-outside.js", | ||
"src/composables/use-active-audio.js", | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given these are passed straight through to the VInputField, could we import the array of sizes from there instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this suggestion! I have forgot that we are re-using the same array. Edited in the last commit.