Skip to content

Commit

Permalink
feat: switch to floating-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Jan 14, 2022
1 parent 3cf5444 commit e28f594
Show file tree
Hide file tree
Showing 36 changed files with 1,002 additions and 411 deletions.
6 changes: 3 additions & 3 deletions packages/demo/src/PageHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
theme: 'info-tooltip',
// Inline override
placement,
offset: [0, 100],
distance: 100,
ariaId: 'test-id',
}"
class="tooltip-target b2"
Expand Down Expand Up @@ -293,7 +293,7 @@
</div>

<VDropdown
:offset="[0, offset]"
:distance="offset"
:placement="placement"
:auto-hide="isAutoHiding"
:disabled="!isEnabled"
Expand Down Expand Up @@ -461,7 +461,7 @@
<VDropdown
:triggers="[]"
:shown="isOpen"
:offset="[0, 16]"
:distance="16"
:auto-hide="false"
>
<button class="tooltip-target b1 popover-btn">
Expand Down
4 changes: 2 additions & 2 deletions packages/demo/src/PageHoverDropdown.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="box">
<VMenu
:offset="[0, 16]"
:distance="16"
placement="right"
>
<button class="tooltip-target b1 popover-btn">Target</button>
Expand All @@ -13,7 +13,7 @@

<VDropdown
:triggers="['hover']"
:offset="[0, 16]"
:distance="16"
:auto-hide="false"
placement="right"
>
Expand Down
13 changes: 6 additions & 7 deletions packages/docs/src/.vuepress/components/ArrowPadding.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
:triggers="[]"
:shown="true"
placement="right"
:offset="offset"
:modifiers="[
{ name: 'preventOverflow', enabled: false },
{ name: 'arrow', options: { padding: tempPadding } },
]"
:distance="offset[1]"
:skidding="offset[0]"
:prevent-overflow="false"
:arrow-padding="tempPadding"
>
<button class="px-4 py-6 bg-gray-500 text-white rounded-lg !md:text-sm">
Reference
Expand All @@ -24,8 +23,8 @@
<input
v-model.number="offset[0]"
type="range"
min="-32"
max="32"
min="-64"
max="64"
class="w-full"
>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
</button>

<template #popper>
This is awesome!
<div class="p-6">
This is awesome!
</div>
</template>
</VDropdown>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<template #popper>
<button
class="border border-gray-300 rounded px-4 py-2"
class="border border-gray-300 rounded px-4 py-2 m-4"
@click="count++"
>
+{{ count }}
Expand Down
8 changes: 4 additions & 4 deletions packages/docs/src/.vuepress/components/OffsetExample.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
:shown="true"
:auto-hide="false"
placement="right"
:offset="tempOffset"
:modifiers="[
{ name: 'preventOverflow', enabled: false }
]"
:distance="tempOffset[1]"
:skidding="tempOffset[0]"
:prevent-overflow="false"
:arrow-padding="6"
>
<button class="px-4 py-12 md:p-16 bg-gray-500 text-white rounded-lg !md:text-sm">
Reference
Expand Down
4 changes: 1 addition & 3 deletions packages/docs/src/.vuepress/components/TooltipHtml.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
placement: 'right',
triggers: [],
shown: true,
modifiers: [
{ name: 'preventOverflow', enabled: false },
],
preventOverflow: false,
}"
class="border border-gray-300 rounded px-4 py-2"
>
Expand Down
6 changes: 2 additions & 4 deletions packages/docs/src/.vuepress/components/TooltipPlacement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@
placement,
triggers: [],
shown: true,
modifiers: [
{ name: 'preventOverflow', enabled: false },
{ name: 'arrow', options: { padding: 8 } },
],
preventOverflow: false,
arrowPadding: 8,
}"
class="border border-gray-300 rounded px-4 py-3 text-xl"
>
Expand Down
21 changes: 19 additions & 2 deletions packages/docs/src/.vuepress/components/theme-editor/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,33 @@ export default {
default: false,
},
},
created () {
this.colors = {
green: {
normal: 'bg-green-300 text-green-900',
hover: 'hover:bg-green-200 hover:text-green-900',
},
red: {
normal: 'bg-red-300 text-red-900',
hover: 'hover:bg-red-200 hover:text-red-900',
},
gray: {
normal: 'bg-gray-300 text-gray-900',
hover: 'hover:bg-gray-200 hover:text-gray-900',
},
}
},
}
</script>

<template>
<button
class="flex items-center justify-center rounded text-center"
:class="[
`hover:bg-${color}-200 hover:text-${color}-900`,
colors[color].hover,
{
[`bg-${color}-300 text-${color}-900`]: !flat,
[colors[color].normal]: !flat,
},
]"
@click="$emit('click', $event)"
Expand Down
Loading

0 comments on commit e28f594

Please sign in to comment.