Skip to content

Commit c7e3f6e

Browse files
committed
feat: replace popover
1 parent a212e93 commit c7e3f6e

12 files changed

Lines changed: 43 additions & 32 deletions

File tree

resources/css/cedar-theme.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145

146146
/* Ring */
147147
--color-r-disabled: var(--color-neutral-700) /* neutral-700 #404040 */;
148-
--color-r-button: var(--color-neutral-800); /* neutral-600 #525252 */
148+
--color-r-button: color-mix(in oklab, var(--color-neutral-800) 100%, transparent); /* neutral-600 #525252 */
149149
--color-r-input: transparent /* to transparent */;
150150
--color-r-default: var(--color-gray-900) /* gray-900 #101828 */;
151151
--color-r-inverse: color-mix(in oklab, var(--color-neutral-800) 50%, transparent); /* neutral-800/50 */

resources/js/components/cards/data/LibraryCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<script setup lang="ts">
2-
import { type CategoryResource, type FolderResource } from '@/types/resources';
2+
import type { CategoryResource, FolderResource } from '@/types/resources';
33
44
import { formatFileSize, handleStorageURL, toFormattedDate } from '@/service/util';
55
import { startScanFilesTask, startVerifyFilesTask, toggleCategoryPrivacy } from '@/service/siteAPI';
66
import { computed, ref, useTemplateRef, watch } from 'vue';
77
import { useQueryClient } from '@tanstack/vue-query';
88
import { updateCategory } from '@/service/mediaAPI.ts';
9+
import { BasePopover } from '@/components/cedar-ui/popover';
910
import { toast } from '@aminnausin/cedar-ui';
1011
1112
import LibraryCardMenu from '@/components/menus/LibraryCardMenu.vue';
12-
import BasePopover from '@/components/pinesUI/BasePopover.vue';
1313
1414
import ProiconsMoreVertical from '~icons/proicons/more-vertical';
1515

resources/js/components/cards/data/LibraryFolderCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { type FolderResource } from '@/types/resources';
33
44
import { formatFileSize, handleStorageURL, toFormattedDate } from '@/service/util';
55
import { useTemplateRef } from 'vue';
6+
import { BasePopover } from '@/components/cedar-ui/popover';
67
import { ButtonIcon } from '@/components/cedar-ui/button';
78
89
import LibraryFolderCardMenu from '@/components/menus/LibraryFolderCardMenu.vue';
9-
import BasePopover from '@/components/pinesUI/BasePopover.vue';
1010
1111
import ProiconsMoreVertical from '~icons/proicons/more-vertical';
1212
import CircumShare1 from '~icons/circum/share-1';

resources/js/components/cards/data/TaskCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import type { SubTaskResource, TaskResource } from '@/types/resources';
44
import { toFormattedDate, toFormattedDuration, toTimeSpan, within24Hrs } from '@/service/util';
55
import { computed, ref, useTemplateRef, watch } from 'vue';
66
import { ButtonIcon, ButtonText } from '@/components/cedar-ui/button';
7+
import { BasePopover } from '@/components/cedar-ui/popover';
78
import { getSubTasks } from '@/service/siteAPI';
89
import { HoverCard } from '@/components/cedar-ui/hover-card';
910
import { TableBase } from '@/components/cedar-ui/table';
1011
import { BadgeTag } from '@/components/cedar-ui/badge';
1112
import { cn } from '@aminnausin/cedar-ui';
1213
1314
import PulseDoughnutChart from '@/components/charts/PulseDoughnutChart.vue';
14-
import BasePopover from '@/components/pinesUI/BasePopover.vue';
1515
import SubTaskCard from '@/components/cards/data/SubTaskCard.vue';
1616
1717
import ProiconsMoreVertical from '~icons/proicons/more-vertical';

resources/js/components/cards/data/UserCard.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import type { UserResource } from '@/types/resources';
33
44
import { toFormattedDate, toTimeSpan } from '@/service/util';
55
import { ButtonCorner, ButtonText } from '@/components/cedar-ui/button';
6-
7-
import BasePopover from '@/components/pinesUI/BasePopover.vue';
6+
import { BasePopover } from '@/components/cedar-ui/popover';
87
98
import ProiconsMoreVertical from '~icons/proicons/more-vertical';
109
import ProiconsPersonCircle from '~icons/proicons/person-circle';

resources/js/components/cedar-ui/input/InputShell.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const props = withDefaults(defineProps<InputShellProps>(), { clampText: true });
1212
:class="
1313
cn(
1414
'h-(--input-height)',
15-
'scrollable-input scrollbar-thin',
15+
'scrollable-input scrollbar-minimal',
1616
'transition-input ease-in-out focus:outline-hidden',
1717
'bg-surface-2 placeholder:text-foreground-3 dark:placeholder:text-foreground-2 dark:bg-neutral-700',
1818
'hocus:ring-2 hover:ring-primary-muted focus-visible:ring-primary',

resources/js/components/pinesUI/BasePopover.vue renamed to resources/js/components/cedar-ui/popover/BasePopover.vue

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<script setup lang="ts">
2-
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watch, type Component, type ComponentPublicInstance } from 'vue';
2+
import type { Component, ComponentPublicInstance } from 'vue';
3+
4+
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watch } from 'vue';
35
import { OnClickOutside } from '@vueuse/components';
46
import { UseFocusTrap } from '@vueuse/integrations/useFocusTrap/component';
5-
import { ButtonText } from '@/components/cedar-ui/button';
7+
import { CedarOptions } from '../icons';
8+
import { ButtonText } from '../button';
69
710
const props = withDefaults(
811
defineProps<{
@@ -120,17 +123,12 @@ onUnmounted(() => {
120123
<template>
121124
<div class="relative flex">
122125
<component :is="buttonComponent" ref="popoverButton" :class="buttonClass" @click="popoverOpen = true" v-bind="mergedButtonAttributes" :disabled="disabled">
123-
<slot name="buttonText"> </slot>
126+
<template #text>
127+
<slot name="buttonText"> </slot>
128+
</template>
124129
<template #icon>
125130
<slot name="buttonIcon">
126-
<svg class="h-4 w-4" viewBox="0 0 15 15" fill="none" xmlns="http://www.w3.org/2000/svg" v-if="!hideDefaultIcon">
127-
<path
128-
d="M5.5 3C4.67157 3 4 3.67157 4 4.5C4 5.32843 4.67157 6 5.5 6C6.32843 6 7 5.32843 7 4.5C7 3.67157 6.32843 3 5.5 3ZM3 5C3.01671 5 3.03323 4.99918 3.04952 4.99758C3.28022 6.1399 4.28967 7 5.5 7C6.71033 7 7.71978 6.1399 7.95048 4.99758C7.96677 4.99918 7.98329 5 8 5H13.5C13.7761 5 14 4.77614 14 4.5C14 4.22386 13.7761 4 13.5 4H8C7.98329 4 7.96677 4.00082 7.95048 4.00242C7.71978 2.86009 6.71033 2 5.5 2C4.28967 2 3.28022 2.86009 3.04952 4.00242C3.03323 4.00082 3.01671 4 3 4H1.5C1.22386 4 1 4.22386 1 4.5C1 4.77614 1.22386 5 1.5 5H3ZM11.9505 10.9976C11.7198 12.1399 10.7103 13 9.5 13C8.28967 13 7.28022 12.1399 7.04952 10.9976C7.03323 10.9992 7.01671 11 7 11H1.5C1.22386 11 1 10.7761 1 10.5C1 10.2239 1.22386 10 1.5 10H7C7.01671 10 7.03323 10.0008 7.04952 10.0024C7.28022 8.8601 8.28967 8 9.5 8C10.7103 8 11.7198 8.8601 11.9505 10.0024C11.9668 10.0008 11.9833 10 12 10H13.5C13.7761 10 14 10.2239 14 10.5C14 10.7761 13.7761 11 13.5 11H12C11.9833 11 11.9668 10.9992 11.9505 10.9976ZM8 10.5C8 9.67157 8.67157 9 9.5 9C10.3284 9 11 9.67157 11 10.5C11 11.3284 10.3284 12 9.5 12C8.67157 12 8 11.3284 8 10.5Z"
129-
fill="currentColor"
130-
fill-rule="evenodd"
131-
clip-rule="evenodd"
132-
></path>
133-
</svg>
131+
<CedarOptions class="size-4" v-if="!hideDefaultIcon" />
134132
</slot>
135133
</template>
136134
</component>
@@ -144,13 +142,19 @@ onUnmounted(() => {
144142
>
145143
<UseFocusTrap
146144
v-if="popoverOpen"
147-
:class="`absolute z-50 w-[300px] max-w-lg rounded-md border border-neutral-200/70 bg-white p-4 shadow-xs backdrop-blur-xs dark:border-neutral-700/10 dark:bg-neutral-800/90 ${popoverClass} -translate-x-1/2 ${popoverAdjustment ? '' : 'left-1/2'} ${popoverPosition === 'bottom' ? 'top-0' : 'bottom-0'}`"
145+
:class="[
146+
'ring-r-button bg-overlay-2-t absolute z-50 w-[300px] max-w-lg rounded-md p-4 shadow-xs ring-1 backdrop-blur-xs',
147+
popoverClass,
148+
'-translate-x-1/2',
149+
{ 'left-1/2': !popoverAdjustment },
150+
popoverPosition === 'bottom' ? 'top-0' : 'bottom-0',
151+
]"
148152
ref="popover"
149153
:options="{ allowOutsideClick: true }"
150154
>
151155
<OnClickOutside
152156
@trigger.stop="
153-
(e: any) => {
157+
(_: any) => {
154158
popoverOpen = false;
155159
}
156160
"
@@ -163,48 +167,55 @@ onUnmounted(() => {
163167
<div
164168
v-show="popoverArrow && popoverPosition == 'bottom'"
165169
ref="popoverArrowRef"
166-
:class="`absolute left-1/2 inline-block w-5 -translate-x-2 overflow-hidden ${popoverPosition === 'bottom' ? 'top-0 mt-px -translate-y-2.5' : 'bottom-0 mb-px translate-y-2.5'}`"
170+
:class="[
171+
'absolute left-1/2 inline-block w-5 -translate-x-2 overflow-hidden',
172+
popoverPosition === 'bottom' ? 'top-0 -translate-y-2.5' : 'bottom-0 mb-px translate-y-2.5',
173+
]"
167174
>
168175
<div
169-
:class="`h-2.5 w-2.5 transform rounded-xs border-l border-neutral-200/70 bg-white dark:border-neutral-700/10 dark:bg-neutral-800/90 ${popoverPosition === 'bottom' ? 'origin-bottom-left rotate-45 border-t' : 'origin-top-left -rotate-45 border-b'} `"
176+
:class="[
177+
'border-r-button bg-overlay-2 h-2.5 w-2.5 transform rounded-xs border-l',
178+
popoverPosition === 'bottom' ? 'origin-bottom-left rotate-45 border-t' : 'origin-top-left -rotate-45 border-b',
179+
]"
170180
></div>
171181
</div>
172182
<slot name="content">
183+
<!-- Example -->
173184
<div class="grid gap-4">
174185
<div class="space-y-2">
175186
{{ popoverAdjustment }}
176187
<h4 class="leading-none font-medium">Dimensions</h4>
177-
<p class="text-foreground-1 text-sm">Set the dimensions for the layer.</p>
188+
<p class="text-muted-foreground text-sm">Set the dimensions for the layer.</p>
178189
</div>
179190
<div class="grid gap-2">
180191
<div class="grid grid-cols-3 items-center gap-4">
181192
<label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="width">Width</label
182193
><input
183-
class="border-input ring-offset-background placeholder:text-foreground-1 col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
194+
class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
184195
id="width"
185196
value="100%"
186197
/>
187198
</div>
188199
<div class="grid grid-cols-3 items-center gap-4">
189200
<label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxWidth">Max. width</label
190201
><input
191-
class="border-input ring-offset-background placeholder:text-foreground-1 col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
202+
class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
192203
id="maxWidth"
193204
value="300px"
194205
/>
195206
</div>
196207
<div class="grid grid-cols-3 items-center gap-4">
197208
<label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="height">Height</label
198209
><input
199-
class="border-input ring-offset-background placeholder:text-foreground-1 col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
210+
class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
200211
id="height"
201212
value="25px"
202213
/>
203214
</div>
204215
<div class="grid grid-cols-3 items-center gap-4">
205216
<label class="text-sm leading-none font-medium peer-disabled:cursor-not-allowed peer-disabled:opacity-70" for="maxHeight">Max. height</label
206217
><input
207-
class="border-input ring-offset-background placeholder:text-foreground-1 col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
218+
class="border-input ring-offset-background placeholder:text-muted-foreground col-span-2 flex h-8 w-full rounded-md border bg-transparent px-3 py-2 text-sm file:border-0 file:bg-transparent file:text-sm file:font-medium focus-visible:ring-2 focus-visible:ring-neutral-400 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50"
208219
id="maxHeight"
209220
value="none"
210221
/>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as BasePopover } from './BasePopover.vue';

resources/js/components/cedar-ui/select/InputSelect.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ watch(
192192
"
193193
@keydown.stop="select.selectKeydown($event)"
194194
>
195-
<ul ref="selectableItemsList" class="scrollbar-thin max-h-56 w-full overflow-auto focus:outline-hidden" role="listbox">
195+
<ul ref="selectableItemsList" class="scrollbar-minimal max-h-56 w-full overflow-auto focus:outline-hidden" role="listbox">
196196
<template v-for="item in select.selectableItems" :key="item.value">
197197
<li
198198
@click="handleItemClick(item)"

resources/js/components/dashboard/DashboardAnalytics.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { computed, ref, useTemplateRef, watch } from 'vue';
66
import { useGetPulse, useGetSiteAnalytics } from '@/service/queries';
77
import { handleStartTask } from '@/service/taskService';
88
import { periodForHumans } from '@/service/pulseUtil';
9+
import { BasePopover } from '@/components/cedar-ui/popover';
910
import { ButtonText } from '@/components/cedar-ui/button';
1011
1112
import PulseSlowOutgoingRequests from '@/components/cards/pulse/PulseSlowOutgoingRequests.vue';
@@ -20,7 +21,6 @@ import DashboardCard from '@/components/cards/layout/DashboardCard.vue';
2021
import PulseServers from '@/components/cards/pulse/PulseServers.vue';
2122
import PulseQueues from '@/components/cards/pulse/PulseQueues.vue';
2223
import BreadCrumbs from '@/components/pinesUI/BreadCrumbs.vue';
23-
import BasePopover from '@/components/pinesUI/BasePopover.vue';
2424
import PulseUsage from '@/components/cards/pulse/PulseUsage.vue';
2525
import PulseCache from '@/components/cards/pulse/PulseCache.vue';
2626

0 commit comments

Comments
 (0)