rename: Change 'origin' to 'alignment'

This commit is contained in:
Xyphyn committed 2023-07-16 13:27:08 -07:00
1 parent eb006ed982
commit 6eeada8c58
4 files changed
+13 -8

No files matched your search

+2 -2
View File
@@ -51,7 +51,7 @@
<Icon src={GlobeAlt} width={16} />
<span class="hidden sm:inline ml-1">Explore</span>
</Link>
<Menu let:toggleOpen origin="bottom-right">
<Menu let:toggleOpen alignment="bottom-right">
<Button
color={Color.accent}
slot="button"
@@ -68,7 +68,7 @@
</MenuButton>
</Menu>
</div>
<Menu let:toggleOpen origin="bottom-right">
<Menu let:toggleOpen alignment="bottom-right">
<button
class="w-8 h-8 rounded-full ring-1 ring-slate-300 bg-slate-100
dark:bg-zinc-800 relative"
+4 -4
View File
@@ -11,7 +11,7 @@
export let absolute = false
type Origin =
type Alignment =
| 'top-right'
| 'top-left'
| 'bottom-right'
@@ -19,13 +19,13 @@
| 'bottom-center'
| 'top-center'
export let origin: Origin = 'bottom-left'
export let alignment: Alignment = 'bottom-left'
let element: any
export const toggleOpen = () => (open = !open)
function getOriginClass(origin: Origin) {
function getOriginClass(origin: Alignment) {
switch (origin) {
case 'top-right':
return 'bottom-[100%] right-0 origin-bottom-right'
@@ -71,7 +71,7 @@
easing: expoOut,
}}
class="list-none absolute max-h-72 z-30 overflow-auto {getOriginClass(
origin
alignment
)}
rounded-md py-2 min-w-[16rem] my-2 flex flex-col shadow-md
bg-white dark:bg-zinc-900 border border-slate-200 dark:border-zinc-800