Skip to content

Commit

Permalink
fix(VaTooltip): restyle (epicmaxco#517)
Browse files Browse the repository at this point in the history
* feat(va-input): first version of component

* feat(va-input): add icons support

* feat(va-input): add input wrapper demo

* feat(va-input): add focus functionality

* feat(va-input): use color plugin for input

* feat(va-input): add inputs in presentation

* feat(va-input): minor changes

* fix: serve:book

* minor

* chore: add design to demo

* fix(VaTooltip): restyle

* feat(Tooltips)

* fix(Tooltips): add inputs and selects

* fix(VaTooltip): style + refatcoring

* fix(Tooltips): styles

* fix(VaTooltip): add box-shadow

* fix(VaTooltip): bug with box-shadow

* fix(VaTooltip): bug with box-shadow

* fix(VaTooltip): presentation + styles

* wip: tooltip component

* fix: rename tooltip to popover

* feat: add popover demo

* fix: tooltip width

* minor

* fix: remove popovers from notifications demo

* feat: add popover doc

* minor
  • Loading branch information
vlad-shusterman authored and asvae committed Apr 8, 2019
1 parent f047442 commit 757eb77
Show file tree
Hide file tree
Showing 14 changed files with 471 additions and 194 deletions.
21 changes: 12 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/components/admin/app-sidebar/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@
<span>{{ $t('menu.sliders') }}</span>
</span>
</sidebar-link>
<sidebar-link
:to="{ name: 'popovers'}">
<span slot="title">
<span>{{ $t('menu.popovers') }}</span>
</span>
</sidebar-link>
</sidebar-link-group>
<sidebar-link
:to="{ name: 'extra' }">
Expand Down
111 changes: 0 additions & 111 deletions src/components/ui/notifications/Notifications.vue
Original file line number Diff line number Diff line change
@@ -1,93 +1,5 @@
<template>
<div class="notifications">
<div class="va-row">
<div class="flex md12">
<va-card
:title=" $t('notificationsPage.popovers.title') ">
<div class="va-row">
<div class="flex md6">
<fieldset>
<div class="form-group">
<div class="input-group">
<input
id="popover-title"
v-model="popoverTitle"
@input="checkPopoverContents"
required
/>
<label class="control-label" for="popover-title">
{{ $t('notificationsPage.popovers.popoverTitleLabel')
}}</label>
<va-icon icon="bar"/>
</div>
</div>
<div class="form-group">
<div class="input-group">
<input id="popover-text" v-model="popoverText"
@input="checkPopoverContents" required/>
<label class="control-label" for="popover-text">
{{ $t('notificationsPage.popovers.popoverTextLabel')
}}</label>
<va-icon icon="bar"/>
</div>
</div>
<div class="form-group">
<div class="input-group">
<input
id="popover-icon"
v-model="popoverIcon"
@input="checkPopoverContents"
required
/>
<label class="control-label" for="popover-icon">
{{ $t('notificationsPage.popovers.popoverIconLabel')
}}</label>
<va-icon icon="bar"/>
</div>
</div>
<va-popover
popover-class="va-tooltip"
placement="right"
:disabled="isPopoverDisabled"
>
<va-button slot="trigger">
{{ $t('notificationsPage.popovers.showPopover') }}
</va-button>
<va-icon slot="icon" :icon="[ 'fa', popoverIcon ]"/>
<span slot="header">{{popoverTitle}}</span>
<span slot="body">{{popoverText}}</span>
</va-popover>
</fieldset>
</div>
<div class="flex md6">
<p>
Any text can be used for
<va-tooltip :options="topTooltipOptions">
<a href="#">
{{'notificationsPage.popovers.topTooltip'}}
</a>
</va-tooltip>
showcase. Just anything you can possibly imagine to test
<va-tooltip :options="rightTooltipOptions"><a href="#">
{{ $t('notificationsPage.popovers.rightTooltip') }}
</a></va-tooltip>
.
But it can appear on the
<va-tooltip :options="leftTooltipOptions"><a href="#">
{{$t('notificationsPage.popovers.leftTooltip')}}</a></va-tooltip>
.
Or just
<va-tooltip :options="bottomTooltipOptions"><a href="#">
{{ $t('notificationsPage.popovers.bottomTooltip') }}
</a></va-tooltip>
the item.
</p>
</div>
</div>
</va-card>
</div>
</div>

<div class="va-row">
<div class="flex md12">
<va-card :title="$t('notificationsPage.notifications.title')">
Expand Down Expand Up @@ -223,26 +135,6 @@ export default {
components: { ToastPositionPicker },
data () {
return {
popoverTitle: 'Hey!',
popoverText: 'This popover is amazing',
popoverIcon: 'fa-image',
isPopoverDisabled: false,
topTooltipOptions: {
content: 'Top tooltip text',
placement: 'top',
},
leftTooltipOptions: {
content: 'Left tooltip text',
placement: 'left',
},
rightTooltipOptions: {
content: 'Right tooltip text',
placement: 'right',
},
bottomTooltipOptions: {
content: 'Bottom tooltip text',
placement: 'bottom',
},
toastText: 'This toast is awesome!',
toastDuration: 2500,
toastIcon: 'fa-star-o',
Expand All @@ -256,9 +148,6 @@ export default {
},
},
methods: {
checkPopoverContents () {
this.isPopoverDisabled = !(this.popoverTitle || this.popoverText || this.popoverIcon)
},
launchToast () {
this.showToast(
this.toastText,
Expand Down
126 changes: 126 additions & 0 deletions src/components/ui/popovers/Popovers.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<template>
<div class="tooltips">
<div class="va-row">
<div class="flex xs12 md6">
<va-card :title="$t('popovers.popoverStyle')">
<va-simple-select
class="mt-4"
label="color scheme"
v-model="popover.color"
:options="colors"
/>
<va-simple-select
class="mt-4"
label="icon (font-awesome)"
v-model="popover.icon"
:options="icons"
/>
<va-input
v-model="popover.title"
label="Title"
/>
<va-input
class="pt-4"
v-model="popover.message"
label="Message"
/>
<div class="va-row popover-example mt-5">
<va-popover
:icon="popover.icon"
:color="popover.color"
:title="popover.title"
:message="popover.message"
placement="right"
open
>
<va-button>
{{ $t('notificationsPage.popovers.showPopover') }}
</va-button>
</va-popover>
</div>
</va-card>
</div>

<div class="flex xs12 md6">
<va-card :title="$t('popovers.popoverPlacement')">
<p>
Any text can be used for
<va-popover
placement="top"
message="Top tooltip text"
>
<a href="#">
{{ $t('notificationsPage.popovers.topTooltip') }}
</a>
</va-popover>
showcase. Just anything you can possibly imagine to test
<va-popover
placement="right"
message="Right tooltip text"
>
<a href="#">
{{ $t('notificationsPage.popovers.rightTooltip') }}
</a>
</va-popover>
.
But it can appear on the
<va-popover
placement="left"
message="Left tooltip text"
>
<a href="#">
{{$t('notificationsPage.popovers.leftTooltip')}}
</a>
</va-popover>
.
Or just
<va-popover
placement="bottom"
message="Bottom tooltip text"
>
<a href="#">
{{ $t('notificationsPage.popovers.bottomTooltip') }}
</a>
</va-popover>
the item.
</p>
</va-card>
</div>
</div>
</div>
</template>

<script>
import VaInput from '../../../vuestic-theme/vuestic-components/va-input/VaInput'
export default {
components: { VaInput },
data () {
return {
icons: [
'fa fa-print', 'fa fa-star',
],
colors: [
'success', 'info', 'danger', 'warning', 'gray', 'dark',
],
popover: {
title: 'Hey folks!',
message: 'This tooltip is amazing:D',
icon: 'fa fa-print',
color: 'warning',
},
}
},
}
</script>

<style lang="scss">
.tooltips {
&__content {
@include va-flex-center();
}
}
.popover-example {
min-height: 100px;
}
</style>
10 changes: 9 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@
"slider": "Sliders",
"range": "Ranges"
},
"popovers": {
"popover": "Popover",
"popoverStyle": "Popover Style",
"popoverPlacement": "Popover Placement",
"minimalTooltip": "Minimal Tooltip",
"anotherOneTooltip": "Another One Tooltip"
},
"dashboard": {
"dataVisualization": "Data Visualization",
"success": "SUCCESS",
Expand Down Expand Up @@ -234,7 +241,8 @@
"fileUpload": "File Upload",
"dropdowns": "Dropdowns",
"spacing": "Spacing",
"sliders": "Sliders"
"sliders": "Sliders",
"popovers": "Popovers"
},
"messages": {
"all": "See all messages",
Expand Down
5 changes: 5 additions & 0 deletions src/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,11 @@ export default new Router({
wikiLink: 'https://github.com/epicmaxco/vuestic-admin/wiki/Sliders',
},
},
{
name: 'popovers',
path: 'popovers',
component: () => import('../components/ui/popovers/Popovers'),
},
],
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<template>
<div class="va-color-presentation">
<va-tooltip :options="tooltipOptions">
<div class="va-color-presentation__color" :style="computedStyle" @click="colorCopy"></div>
<va-tooltip
:placement="tooltipOptions.placement"
:message="tooltipOptions.content"
>
<div
class="va-color-presentation__color"
:style="computedStyle"
@click="colorCopy">
</div>
</va-tooltip>
<div class="va-color-presentation__description" v-if="name || description">
<div class="va-color-presentation__name">{{name}}</div>
Expand Down
Loading

0 comments on commit 757eb77

Please sign in to comment.