@invopop/popui 0.1.76 → 0.1.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
let items = $derived(
|
|
16
16
|
actions.map((a) => ({
|
|
17
17
|
label: a.label,
|
|
18
|
-
value: a,
|
|
18
|
+
value: a.slug || a.label,
|
|
19
19
|
icon: a.icon,
|
|
20
20
|
separator: a.separator,
|
|
21
21
|
destructive: a.destructive,
|
|
@@ -42,9 +42,11 @@
|
|
|
42
42
|
|
|
43
43
|
<BaseDropdown bind:isOpen bind:this={actionDropdown} {trigger}>
|
|
44
44
|
<DrawerContext
|
|
45
|
+
autofocus
|
|
45
46
|
{items}
|
|
46
47
|
onclick={(e) => {
|
|
47
|
-
|
|
48
|
+
const action = actions.find((a) => (a.slug || a.label) === e)
|
|
49
|
+
onclick?.(action)
|
|
48
50
|
actionDropdown?.toggle()
|
|
49
51
|
}}
|
|
50
52
|
/>
|
|
@@ -137,6 +137,16 @@
|
|
|
137
137
|
</span>
|
|
138
138
|
{/snippet}
|
|
139
139
|
|
|
140
|
+
{#snippet triggerIcon()}
|
|
141
|
+
{#if typeof selectedIcon === 'string'}
|
|
142
|
+
<img src={selectedIcon} alt="" class="size-4 flex-shrink-0 text-icon" />
|
|
143
|
+
{:else if selectedIcon}
|
|
144
|
+
<Icon src={selectedIcon} {iconTheme} class="{selectedIconColor} size-4 flex-shrink-0" />
|
|
145
|
+
{:else if resolvedIcon}
|
|
146
|
+
<Icon src={resolvedIcon} {iconTheme} class="text-icon size-4 flex-shrink-0" />
|
|
147
|
+
{/if}
|
|
148
|
+
{/snippet}
|
|
149
|
+
|
|
140
150
|
<BaseDropdown
|
|
141
151
|
data-dropdown-select
|
|
142
152
|
bind:isOpen
|
|
@@ -149,8 +159,8 @@
|
|
|
149
159
|
>
|
|
150
160
|
{#snippet trigger()}
|
|
151
161
|
<div data-dropdown-select-trigger class={styles}>
|
|
152
|
-
|
|
153
|
-
|
|
162
|
+
<div class="flex items-center gap-1 flex-1 min-w-0 whitespace-nowrap">
|
|
163
|
+
{#if hasMultipleColors}
|
|
154
164
|
<div class="flex items-center -space-x-0.5">
|
|
155
165
|
{#each selectedColors.slice(0, 3) as color}
|
|
156
166
|
<span class="border-l border-background rounded-xs flex first:border-l-0">
|
|
@@ -159,35 +169,22 @@
|
|
|
159
169
|
{/each}
|
|
160
170
|
</div>
|
|
161
171
|
{@render label()}
|
|
162
|
-
|
|
163
|
-
{:else if selectedColor}
|
|
164
|
-
<div class="flex items-center gap-1 flex-1 min-w-0">
|
|
172
|
+
{:else if selectedColor}
|
|
165
173
|
<TagStatus dot status={selectedColor} />
|
|
166
174
|
{@render label()}
|
|
167
|
-
|
|
168
|
-
{:else if !multiple && selectedItem?.country}
|
|
169
|
-
<div class="flex items-center gap-1 flex-1 min-w-0">
|
|
175
|
+
{:else if !multiple && selectedItem?.country}
|
|
170
176
|
<BaseFlag country={selectedItem.country} />
|
|
171
177
|
{@render label()}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<div class="flex items-center gap-1 flex-1 min-w-0">
|
|
178
|
+
{:else if !multiple && selectedItem?.content}
|
|
179
|
+
{@render triggerIcon()}
|
|
175
180
|
{@render selectedItem.content(selectedItem)}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<img src={selectedIcon} alt="" class="size-4 flex-shrink-0 text-icon" />
|
|
181
|
-
{:else if selectedIcon}
|
|
182
|
-
<Icon src={selectedIcon} {iconTheme} class="{selectedIconColor} size-4 flex-shrink-0" />
|
|
183
|
-
{:else if resolvedIcon}
|
|
184
|
-
<Icon src={resolvedIcon} {iconTheme} class="text-icon size-4 flex-shrink-0" />
|
|
185
|
-
{/if}
|
|
181
|
+
{:else if selectedIcon || resolvedIcon}
|
|
182
|
+
{@render triggerIcon()}
|
|
183
|
+
{@render label()}
|
|
184
|
+
{:else}
|
|
186
185
|
{@render label()}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
{@render label()}
|
|
190
|
-
{/if}
|
|
186
|
+
{/if}
|
|
187
|
+
</div>
|
|
191
188
|
</div>
|
|
192
189
|
{/snippet}
|
|
193
190
|
<DrawerContext
|
package/dist/MenuItem.svelte
CHANGED
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
<div class={wrapperStyles}>
|
|
106
106
|
{#if isFolderItem && (highlight || active)}
|
|
107
|
-
<div class="border-l border-white h-3 w-px absolute top-
|
|
107
|
+
<div class="border-l border-white h-3 w-px absolute top-3.5 left-0 -m-px"></div>
|
|
108
108
|
{/if}
|
|
109
109
|
<button
|
|
110
110
|
use:floatingRef
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
onmouseleave={handleBlur}
|
|
148
148
|
class="pt-4 z-30"
|
|
149
149
|
>
|
|
150
|
-
<DrawerContext onclick={handleClickChild} {items} />
|
|
150
|
+
<DrawerContext autofocus onclick={handleClickChild} {items} />
|
|
151
151
|
</div>
|
|
152
152
|
{/if}
|
|
153
153
|
{:else if open || !collapsable}
|
package/dist/tooltip/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Tooltip as TooltipPrimitive } from 'bits-ui';
|
|
|
2
2
|
import Trigger from './tooltip-trigger.svelte';
|
|
3
3
|
import Content from './tooltip-content.svelte';
|
|
4
4
|
import AutoHide from './tooltip-auto-hide.svelte';
|
|
5
|
-
declare const Root:
|
|
6
|
-
declare const Provider:
|
|
7
|
-
declare const Portal:
|
|
5
|
+
declare const Root: typeof TooltipPrimitive.Root;
|
|
6
|
+
declare const Provider: typeof TooltipPrimitive.Provider;
|
|
7
|
+
declare const Portal: typeof TooltipPrimitive.Portal;
|
|
8
8
|
export { Root, Trigger, Content, Provider, Portal, AutoHide, Root as Tooltip, Content as TooltipContent, Trigger as TooltipTrigger, Provider as TooltipProvider, Portal as TooltipPortal, AutoHide as TooltipAutoHide };
|