feat(fonts): implement Phase 1 - Create Proxy API Client
- Created src/entities/Font/api/proxy/proxyFonts.ts - Implemented fetchProxyFonts function with full pagination support - Implemented fetchProxyFontById convenience function - Added TypeScript interfaces: ProxyFontsParams, ProxyFontsResponse - Added comprehensive JSDoc documentation - Updated src/entities/Font/api/index.ts to export proxy API Phase 1/7: Proxy API Integration for GlyphDiff
This commit is contained in:
@@ -17,30 +17,46 @@ import { useId } from 'bits-ui';
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
interface Props {
|
||||
/** Unique identifier for the input element */
|
||||
/**
|
||||
* Unique identifier for the input element
|
||||
*/
|
||||
id?: string;
|
||||
/** Current search value (bindable) */
|
||||
/**
|
||||
* Current search value (bindable)
|
||||
*/
|
||||
value: string;
|
||||
/** Additional CSS classes for the container */
|
||||
/**
|
||||
* Whether popover is open (bindable)
|
||||
*/
|
||||
isOpen?: boolean;
|
||||
/**
|
||||
* Additional CSS classes for the container
|
||||
*/
|
||||
class?: string;
|
||||
/** Placeholder text for the input */
|
||||
/**
|
||||
* Placeholder text for the input
|
||||
*/
|
||||
placeholder?: string;
|
||||
/** Optional label displayed above the input */
|
||||
/**
|
||||
* Optional label displayed above the input
|
||||
*/
|
||||
label?: string;
|
||||
/** Content to render inside the popover (receives unique content ID) */
|
||||
/**
|
||||
* Content to render inside the popover (receives unique content ID)
|
||||
*/
|
||||
children: Snippet<[{ id: string }]> | undefined;
|
||||
}
|
||||
|
||||
let {
|
||||
id = 'search-bar',
|
||||
value = $bindable(),
|
||||
value = $bindable(''),
|
||||
isOpen = $bindable(false),
|
||||
class: className,
|
||||
placeholder,
|
||||
label,
|
||||
children,
|
||||
}: Props = $props();
|
||||
|
||||
let open = $state(false);
|
||||
let triggerRef = $state<HTMLInputElement>(null!);
|
||||
// svelte-ignore state_referenced_locally
|
||||
const contentId = useId(id);
|
||||
@@ -52,11 +68,11 @@ function handleKeyDown(event: KeyboardEvent) {
|
||||
}
|
||||
|
||||
function handleInputClick() {
|
||||
open = true;
|
||||
isOpen = true;
|
||||
}
|
||||
</script>
|
||||
|
||||
<PopoverRoot bind:open>
|
||||
<PopoverRoot bind:open={isOpen}>
|
||||
<PopoverTrigger bind:ref={triggerRef}>
|
||||
{#snippet child({ props })}
|
||||
{@const { onclick, ...rest } = props}
|
||||
|
||||
Reference in New Issue
Block a user