File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
2- import type { Placement } from ' @floating-ui/dom' ;
32 import Info from ' $lib/svg/Info.svelte' ;
43 import { typed } from ' $lib' ;
5- import {popup } from " $lib/replacements/popup.ts" ;
4+ import { popup , type Placement , type PopupSettings } from " $lib/replacements/popup.ts" ;
65
76 let {
87 id = typed <string >(' default' ),
98 placement = typed <Placement >(' top' ),
109 popupClasses = typed <string >(' ' ),
11- event = typed <' hover ' | ' click ' | ' hover-click ' | ' focus ' | ' focus-click ' >(' hover' ),
10+ event = typed <PopupSettings [ " event " ] >(' hover' ),
1211 icon = typed < import (' svelte' ).Snippet > (),
1312 children = typed < import (' svelte' ).Snippet > (),
1413 content = typed < import (' svelte' ).Snippet > ()
3130 {#if icon }
3231 {@render icon ()}
3332 {:else }
34- <Info classes = " inline-block! " />
33+ <Info />
3534 {/if }
3635</div >
3736
38- <div class ={' card p-4 shadow-x1 z-10 fixed font-normal inline-block ' + popupClasses } data-popup ={id } style =" opacity: 0; pointer-events: none;" >
37+ <div class ={' card p-4 shadow-x1 z-10 absolute font-normal inline-block ' + popupClasses } data-popup ={id } style =" opacity: 0; pointer-events: none;" >
3938 {@render children ?.()}
4039 {@render content ?.()}
4140</div >
Original file line number Diff line number Diff line change @@ -246,8 +246,8 @@ export function popup(triggerNode: HTMLElement, args: PopupSettings) {
246246// Popup Types
247247
248248/** Placement https://floating-ui.com/docs/computePosition#placement */
249- type Direction = 'top' | 'bottom' | 'left' | 'right' ;
250- type Placement = Direction | `${Direction } -start` | `${Direction } -end`;
249+ export type Direction = 'top' | 'bottom' | 'left' | 'right' ;
250+ export type Placement = Direction | `${Direction } -start` | `${Direction } -end`;
251251
252252// Options & Middleware
253253export interface Middleware {
Original file line number Diff line number Diff line change 175175 </Switch>
176176 <br>
177177 <br>
178- <label class="py-1">
178+ <label class="block py-1">
179179 <span>Date Format:</span>
180- <select class="input w-44 p-1 px-2" bind:value={dateFormat}>
180+ <select class="input w-44 p-1 px-2 inline-block bg-surface-900 " bind:value={dateFormat}>
181181 <optgroup label="Common formats">
182182 <option value="detect">auto</option>
183183 <option value="en-US">US (mm/dd/yyyy)</option>
198198 It will not effect anything else.
199199 </ToolTip>
200200 </label>
201- <label class="py-1">
201+ <label class="block py-1">
202202 <span>Time Format:</span>
203- <select class="input w-44 p-1 px-2" bind:value={timeFormat}>
203+ <select class="input w-44 p-1 px-2 inline-block bg-surface-900 " bind:value={timeFormat}>
204204 <option value="detect">auto</option>
205205 <option value="12h">12 hour (AM/PM)</option>
206206 <option value="24h">24 hour</option>
You can’t perform that action at this time.
0 commit comments