-
-
Notifications
You must be signed in to change notification settings - Fork 271
feat: add input component #1173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
aad32c3
feat: add and use input component
alexdln 6e6bb7d
test: cover input-base
alexdln 2a1d466
Merge branch 'main' into feat/add-input-component
danielroe 8bd5845
feat: resolve input-related comments
alexdln 29e8bc2
Merge branch 'feat/add-input-component' of https://github.com/alexdln…
alexdln bfaec20
feat: remove comment
alexdln 9f206fe
feat: update input-base disabled behavior
alexdln 87efb1b
Merge branch 'main' into feat/add-input-component
alexdln efa1d8e
feat: improve downloads filters ui
alexdln e6758cc
Merge branch 'main' into feat/add-input-component
alexdln 62def3e
feat: fix base-input sizes for scaling
alexdln 014383b
feat/add-input-component resolve conflicts
alexdln b3c164a
test: get rid of search icon in package-selector
alexdln 8f2ec8d
Merge branch 'main' into feat/add-input-component
alexdln ff5429f
Merge branch 'main' into feat/add-input-component
alexdln 549026a
feat: use kebab-case and define-model in input
alexdln 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <script setup lang="ts"> | ||
| import { noCorrect } from '~/utils/input' | ||
|
|
||
| const model = defineModel<string>({ default: '' }) | ||
|
|
||
| const props = withDefaults( | ||
| defineProps<{ | ||
| disabled?: boolean | ||
| size?: 'small' | 'medium' | 'large' | ||
| noCorrect?: boolean | ||
| }>(), | ||
| { | ||
| size: 'medium', | ||
| noCorrect: true, | ||
| }, | ||
| ) | ||
|
|
||
| const emit = defineEmits<{ | ||
| focus: [event: FocusEvent] | ||
| blur: [event: FocusEvent] | ||
| }>() | ||
|
|
||
| const el = useTemplateRef('el') | ||
|
|
||
| defineExpose({ | ||
| focus: () => el.value?.focus(), | ||
| blur: () => el.value?.blur(), | ||
| }) | ||
| </script> | ||
|
|
||
| <template> | ||
| <input | ||
| ref="el" | ||
| v-model="model" | ||
| v-bind="props.noCorrect ? noCorrect : undefined" | ||
| @focus="emit('focus', $event)" | ||
| @blur="emit('blur', $event)" | ||
| class="bg-bg-subtle border border-border font-mono text-fg placeholder:text-fg-subtle transition-[border-color,outline-color] duration-300 hover:border-fg-subtle outline-2 outline-transparent outline-offset-2 focus:border-accent focus-visible:outline-accent/70 disabled:(opacity-50 cursor-not-allowed)" | ||
| :class="{ | ||
| 'text-xs leading-[1.2] px-2 py-2 rounded-md': size === 'small', | ||
| 'text-sm leading-none px-3 py-2.5 rounded-lg': size === 'medium', | ||
| 'text-base leading-none px-6 py-3.5 h-14 rounded-xl': size === 'large', | ||
| }" | ||
| :disabled=" | ||
| /** Catching Vue render-bug of invalid `disabled=false` attribute in the final HTML */ | ||
| disabled ? true : undefined | ||
| " | ||
| /> | ||
| </template> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.