mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-24 17:00:36 +01:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc1b3b2f17 | ||
|
|
5bf5a314c4 | ||
|
|
3558eb1a4f | ||
|
|
1c4d46e056 | ||
|
|
1b0ed9e732 | ||
|
|
b72037a777 | ||
|
|
a7644860b8 | ||
|
|
c90cd9c4f3 |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -2,6 +2,22 @@
|
|||||||
|
|
||||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||||
|
|
||||||
|
### [0.1.36](https://github.com/nuxtlabs/ui/compare/v0.1.35...v0.1.36) (2023-02-02)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **CommandPalette:** put back cursor on top only when query changes ([5bf5a31](https://github.com/nuxtlabs/ui/commit/5bf5a314c414b96c656190719bd56acca10676f5))
|
||||||
|
|
||||||
|
### [0.1.35](https://github.com/nuxtlabs/ui/compare/v0.1.34...v0.1.35) (2023-02-01)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **AvatarGroup:** preset size prop ([c90cd9c](https://github.com/nuxtlabs/ui/commit/c90cd9c4f37bc3ce5f6e13f3279dc2c574c76524))
|
||||||
|
* **Dropdown:** lint ([1c4d46e](https://github.com/nuxtlabs/ui/commit/1c4d46e056adf84d69462a12af8ac29f93cbf87a))
|
||||||
|
* **Dropdown:** prevent panel display when no items ([a764486](https://github.com/nuxtlabs/ui/commit/a7644860b8c22a0163e01ca2c0eab2c48b09745a))
|
||||||
|
|
||||||
### [0.1.34](https://github.com/nuxtlabs/ui/compare/v0.1.33...v0.1.34) (2023-01-27)
|
### [0.1.34](https://github.com/nuxtlabs/ui/compare/v0.1.33...v0.1.34) (2023-01-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
Popover:
|
Popover:
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UPopover mode="hover" wrapper-class="inline-block relative">
|
<UPopover wrapper-class="inline-block relative">
|
||||||
<template #default="{ open }">
|
<template #default="{ open }">
|
||||||
<UButton variant="secondary" :icon="open ? 'heroicons-solid:chevron-up' : 'heroicons-solid:chevron-down'" trailing icon-class="transition">
|
<UButton variant="secondary" :icon="open ? 'heroicons-solid:chevron-up' : 'heroicons-solid:chevron-down'" trailing icon-class="transition">
|
||||||
Open popover!
|
Open popover!
|
||||||
@@ -104,46 +104,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #panel>
|
<template #panel>
|
||||||
<div
|
<div class="p-4 u-bg-white border u-border-gray-200 rounded-md">
|
||||||
class="overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5"
|
Panel
|
||||||
>
|
|
||||||
<div class="relative grid gap-8 bg-white p-7">
|
|
||||||
<a
|
|
||||||
v-for="item in solutions"
|
|
||||||
:key="item.name"
|
|
||||||
:href="item.href"
|
|
||||||
class="flex items-center p-2 -m-3 transition duration-150 ease-in-out rounded-lg hover:bg-gray-50 focus:outline-none focus-visible:ring focus-visible:ring-orange-500 focus-visible:ring-opacity-50"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="flex items-center justify-center flex-shrink-0 w-10 h-10 text-white sm:h-12 sm:w-12"
|
|
||||||
>
|
|
||||||
<div v-html="item.icon" />
|
|
||||||
</div>
|
|
||||||
<div class="ml-4">
|
|
||||||
<p class="text-sm font-medium u-text-gray-900">
|
|
||||||
{{ item.name }}
|
|
||||||
</p>
|
|
||||||
<p class="text-sm u-text-gray-500">
|
|
||||||
{{ item.description }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="p-4 bg-gray-50">
|
|
||||||
<a
|
|
||||||
href="##"
|
|
||||||
class="flow-root px-2 py-2 transition duration-150 ease-in-out rounded-md hover:bg-gray-100 focus:outline-none focus-visible:ring focus-visible:ring-orange-500 focus-visible:ring-opacity-50"
|
|
||||||
>
|
|
||||||
<span class="flex items-center">
|
|
||||||
<span class="text-sm font-medium u-text-gray-900">
|
|
||||||
Documentation
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<span class="block text-sm u-text-gray-500">
|
|
||||||
Start integrating products and tools
|
|
||||||
</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</UPopover>
|
</UPopover>
|
||||||
@@ -378,95 +340,6 @@ const customDropdownItems = [
|
|||||||
}]
|
}]
|
||||||
]
|
]
|
||||||
|
|
||||||
const solutions = [
|
|
||||||
{
|
|
||||||
name: 'Insights',
|
|
||||||
description: 'Measure actions your users take',
|
|
||||||
href: '##',
|
|
||||||
icon: `
|
|
||||||
<svg
|
|
||||||
width="48"
|
|
||||||
height="48"
|
|
||||||
viewBox="0 0 48 48"
|
|
||||||
fill="none"
|
|
||||||
aria-hidden='true'
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<rect width="48" height="48" rx="8" fill="#FFEDD5" />
|
|
||||||
<path
|
|
||||||
d="M24 11L35.2583 17.5V30.5L24 37L12.7417 30.5V17.5L24 11Z"
|
|
||||||
stroke="#FB923C"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill-rule="evenodd"
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M16.7417 19.8094V28.1906L24 32.3812L31.2584 28.1906V19.8094L24 15.6188L16.7417 19.8094Z"
|
|
||||||
stroke="#FDBA74"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill-rule="evenodd"
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M20.7417 22.1196V25.882L24 27.7632L27.2584 25.882V22.1196L24 20.2384L20.7417 22.1196Z"
|
|
||||||
stroke="#FDBA74"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Automations',
|
|
||||||
description: 'Create your own targeted content',
|
|
||||||
href: '##',
|
|
||||||
icon: `
|
|
||||||
<svg
|
|
||||||
width="48"
|
|
||||||
height="48"
|
|
||||||
viewBox="0 0 48 48"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<rect width="48" height="48" rx="8" fill="#FFEDD5" />
|
|
||||||
<path
|
|
||||||
d="M28.0413 20L23.9998 13L19.9585 20M32.0828 27.0001L36.1242 34H28.0415M19.9585 34H11.8755L15.9171 27"
|
|
||||||
stroke="#FB923C"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
fill-rule="evenodd"
|
|
||||||
clip-rule="evenodd"
|
|
||||||
d="M18.804 30H29.1963L24.0001 21L18.804 30Z"
|
|
||||||
stroke="#FDBA74"
|
|
||||||
stroke-width="2"
|
|
||||||
/>
|
|
||||||
</svg>
|
|
||||||
`
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'Reports',
|
|
||||||
description: 'Keep track of your growth',
|
|
||||||
href: '##',
|
|
||||||
icon: `
|
|
||||||
<svg
|
|
||||||
width="48"
|
|
||||||
height="48"
|
|
||||||
viewBox="0 0 48 48"
|
|
||||||
fill="none"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<rect width="48" height="48" rx="8" fill="#FFEDD5" />
|
|
||||||
<rect x="13" y="32" width="2" height="4" fill="#FDBA74" />
|
|
||||||
<rect x="17" y="28" width="2" height="8" fill="#FDBA74" />
|
|
||||||
<rect x="21" y="24" width="2" height="12" fill="#FDBA74" />
|
|
||||||
<rect x="25" y="20" width="2" height="16" fill="#FDBA74" />
|
|
||||||
<rect x="29" y="16" width="2" height="20" fill="#FB923C" />
|
|
||||||
<rect x="33" y="12" width="2" height="24" fill="#FB923C" />
|
|
||||||
</svg>
|
|
||||||
`
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const onNotificationClick = () => {
|
const onNotificationClick = () => {
|
||||||
$toast.error({ title: 'Error', description: 'This is an error message' })
|
$toast.error({ title: 'Error', description: 'This is an error message' })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nuxthq/ui",
|
"name": "@nuxthq/ui",
|
||||||
"version": "0.1.34",
|
"version": "0.1.36",
|
||||||
"repository": "https://github.com/nuxtlabs/ui",
|
"repository": "https://github.com/nuxtlabs/ui",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ const props = defineProps({
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'md',
|
default: 'md',
|
||||||
validator (value: string) {
|
validator (value: string) {
|
||||||
return ['xxxs', 'xxs', 'xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
return Object.keys($ui.avatar.size).includes(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
max: {
|
max: {
|
||||||
|
|||||||
@@ -3,24 +3,27 @@
|
|||||||
<MenuButton
|
<MenuButton
|
||||||
ref="trigger"
|
ref="trigger"
|
||||||
as="div"
|
as="div"
|
||||||
|
:disabled="disabled"
|
||||||
class="inline-flex w-full"
|
class="inline-flex w-full"
|
||||||
role="button"
|
role="button"
|
||||||
@mouseover="onMouseOver"
|
@mouseover="onMouseOver"
|
||||||
>
|
>
|
||||||
<slot :open="open">
|
<slot :open="open">
|
||||||
<button>Open</button>
|
<button :disabled="disabled">
|
||||||
|
Open
|
||||||
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
</MenuButton>
|
</MenuButton>
|
||||||
|
|
||||||
<div v-if="open" ref="container" :class="[containerClass, widthClass]" @mouseover="onMouseOver">
|
<div v-if="open && items.length" ref="container" :class="[containerClass, widthClass]" @mouseover="onMouseOver">
|
||||||
<transition appear v-bind="transitionClass">
|
<transition appear v-bind="transitionClass">
|
||||||
<MenuItems :class="baseClass" static>
|
<MenuItems :class="baseClass" static>
|
||||||
<div v-for="(subItems, index) of items" :key="index" :class="groupClass">
|
<div v-for="(subItems, index) of items" :key="index" :class="groupClass">
|
||||||
<MenuItem v-for="(item, subIndex) of subItems" :key="subIndex" v-slot="{ active, disabled }" :disabled="item.disabled">
|
<MenuItem v-for="(item, subIndex) of subItems" :key="subIndex" v-slot="{ active, disabled: itemDisabled }" :disabled="item.disabled">
|
||||||
<Component
|
<Component
|
||||||
v-bind="omit(item, ['click'])"
|
v-bind="omit(item, ['click'])"
|
||||||
:is="(item.to && NuxtLink) || (item.click && 'button') || 'div'"
|
:is="(item.to && NuxtLink) || (item.click && 'button') || 'div'"
|
||||||
:class="resolveItemClass({ active, disabled })"
|
:class="resolveItemClass({ active, disabled: itemDisabled })"
|
||||||
@click="item.click"
|
@click="item.click"
|
||||||
>
|
>
|
||||||
<slot :name="item.slot" :item="item">
|
<slot :name="item.slot" :item="item">
|
||||||
@@ -85,6 +88,10 @@ const props = defineProps({
|
|||||||
return ['click', 'hover'].includes(value)
|
return ['click', 'hover'].includes(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
wrapperClass: {
|
wrapperClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => $ui.dropdown.wrapper
|
default: () => $ui.dropdown.wrapper
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ const groups = computed(() => map(groupBy(results.value, command => command.item
|
|||||||
} as Group
|
} as Group
|
||||||
}))
|
}))
|
||||||
|
|
||||||
watch(groups, () => {
|
watch(query, () => {
|
||||||
// Select first item on search changes
|
// Select first item on search changes
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// https://github.com/tailwindlabs/headlessui/blob/6fa6074cd5d3a96f78a2d965392aa44101f5eede/packages/%40headlessui-vue/src/components/combobox/combobox.ts#L804
|
// https://github.com/tailwindlabs/headlessui/blob/6fa6074cd5d3a96f78a2d965392aa44101f5eede/packages/%40headlessui-vue/src/components/combobox/combobox.ts#L804
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<Popover v-slot="{ open, close }" :class="wrapperClass" @mouseleave="onMouseLeave">
|
<Popover v-slot="{ open, close }" :class="wrapperClass" @mouseleave="onMouseLeave">
|
||||||
<PopoverButton ref="trigger" as="div" class="inline-flex w-full" role="button" @mouseover="onMouseOver">
|
<PopoverButton
|
||||||
|
ref="trigger"
|
||||||
|
as="div"
|
||||||
|
:disabled="disabled"
|
||||||
|
class="inline-flex w-full"
|
||||||
|
role="button"
|
||||||
|
@mouseover="onMouseOver"
|
||||||
|
>
|
||||||
<slot :open="open" :close="close">
|
<slot :open="open" :close="close">
|
||||||
<button>Open</button>
|
<button :disabled="disabled">
|
||||||
|
Open
|
||||||
|
</button>
|
||||||
</slot>
|
</slot>
|
||||||
</PopoverButton>
|
</PopoverButton>
|
||||||
|
|
||||||
@@ -33,6 +42,10 @@ const props = defineProps({
|
|||||||
return ['click', 'hover'].includes(value)
|
return ['click', 'hover'].includes(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
disabled: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
wrapperClass: {
|
wrapperClass: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => $ui.popover.wrapper
|
default: () => $ui.popover.wrapper
|
||||||
|
|||||||
Reference in New Issue
Block a user