-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Button Component #228
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
Open
Firat92
wants to merge
22
commits into
we-dance:main
Choose a base branch
from
Firat92:button-component
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
b9b743a
first commit
Firat92 345c33a
add fortawesome/fontawesome icons
Firat92 b6a099c
add tertiary option for buttons
Firat92 02f19c7
add plus icon and define types
Firat92 122bc71
delete fontawesome icon sources from components
Firat92 46f921d
install vue heroicons
Firat92 89aab46
Binding Hero icons
Firat92 78fcf7d
add iconRight property
Firat92 979bd8c
delete MainButton.vue
Firat92 9cf6ef0
Delete <MainButton/> tag in app.vue
Firat92 88d94f7
remove iconRight
Firat92 e7015c2
merge components from main
Firat92 dd7f465
add nuxtjs/tailwindcss "^6.1.3" and "@intlify/nuxt3" "^0.2.4"
Firat92 7581263
change classes of TButton Component
Firat92 ceb744a
install histoire for documentation
Firat92 be791e6
add docus
razbakov aa3f794
fix config
razbakov 2554c38
add nuxtjs/tailwindcss "^6.1.3" and "@intlify/nuxt3" "^0.2.4"
Firat92 2ad9a96
change classes of TButton Component
Firat92 f2ac69c
install histoire for documentation
Firat92 4ada365
Merge branch 'button-component' of https://github.com/Firat92/platfor…
Firat92 e265bb6
delete histoire files
Firat92 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| <template> | ||
| <button type="button" :class="classes" :title="title"> | ||
| <slot> | ||
| <TIcon v-if="icon" :size="iconSize" :name="icon" /> | ||
| <span v-if="label !== false"> {{ label }}</span> | ||
| </slot> | ||
| </button> | ||
| </template> | ||
|
|
||
| <script> | ||
| import TIcon from '~/components/TIcon' | ||
|
|
||
| export default { | ||
| components: { | ||
| TIcon, | ||
| }, | ||
|
|
||
| props: { | ||
| title: { | ||
| type: String, | ||
| default: 'continue', | ||
| }, | ||
| type: { | ||
| type: String, | ||
| default: 'simple', | ||
| }, | ||
| label: { | ||
| type: [String, Number, Boolean], | ||
| default: false, | ||
| }, | ||
| icon: { | ||
| type: String, | ||
| default: '', | ||
| }, | ||
| iconSize: { | ||
| type: String, | ||
| default: '', | ||
| }, | ||
| }, | ||
|
|
||
| computed: { | ||
| classes() { | ||
| const xbase = | ||
| 'flex whitespace-nowrap justify-start items-center py-2 px-4 font-medium space-x-2 cursor-pointer outline-none focus:outline-none focus:ring-2 focus:ring-offset-2'; | ||
| const xrounded = xbase + ' text-sm leading-4 shadow rounded-full'; | ||
| const primaryColor = | ||
| ' bg-black text-white border-gray-900 hover:bg-gray-800'; | ||
| const destructiveColor = | ||
| ' bg-red-500 text-white border-red-500 hover:bg-red-800'; | ||
| const baseColor = | ||
| ' bg-white text-gray-700 border-gray-300 hover:bg-gray-100'; | ||
|
|
||
| const map = { | ||
| simple: xrounded + baseColor, | ||
| primary: xrounded + primaryColor, | ||
| secondary: xrounded + baseColor, | ||
| tertiary: xrounded + ' underline shadow-none', | ||
| destructive: xrounded + destructiveColor, | ||
| icon: 'rounded-full hover:text-primary', | ||
| }; | ||
| return map[this.type]; | ||
| }, | ||
| }, | ||
| } | ||
| </script> |
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,29 @@ | ||
| <template> | ||
| <component :class="classes" :is="heroIcons[name]" /> | ||
| </template> | ||
|
|
||
| <script> | ||
| import * as heroIcons from '@heroicons/vue/24/solid' | ||
|
|
||
| export default { | ||
| data() { | ||
| return { | ||
| heroIcons, | ||
| } | ||
| }, | ||
| props: { | ||
| name: { | ||
| type: String, | ||
| required: true, | ||
| }, | ||
| size: { | ||
| type: String, | ||
| }, | ||
| }, | ||
| computed: { | ||
| classes() { | ||
| return !this.size ? 'w-6 h-6' : `w-${this.size} h-${this.size}` | ||
| }, | ||
| }, | ||
| } | ||
| </script> | ||
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.
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.