diff --git a/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/TypographyControls.svelte b/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/TypographyControls.svelte index 606402c..2cd3c35 100644 --- a/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/TypographyControls.svelte +++ b/src/widgets/ComparisonSlider/ui/ComparisonSlider/components/TypographyControls.svelte @@ -13,6 +13,7 @@ import { } from '$shared/ui'; import { comparisonStore } from '$widgets/ComparisonSlider/model'; import AArrowUP from '@lucide/svelte/icons/a-arrow-up'; +import { type Orientation } from 'bits-ui'; import { Spring } from 'svelte/motion'; import { fade } from 'svelte/transition'; @@ -106,6 +107,26 @@ $effect(() => { }); +{#snippet InputComponent(className: string)} + +{/snippet} + +{#snippet Controls(className: string, orientation: Orientation)} + {#if typography.weightControl && typography.sizeControl && typography.heightControl} +
+ + + +
+ {/if} +{/snippet} +
- - {#if typography.weightControl && typography.sizeControl && typography.heightControl} -
- - - -
- {/if} + {@render InputComponent?.('p-6')} + {@render Controls?.('flex flex-col justify-between items-center-safe gap-6', 'horizontal')}
{:else} { {/snippet} {#snippet visibleContent()} -
- - -
+ {@render InputComponent(cn( + 'pl-1 sm:pl-3 pr-1 sm:pr-3', + 'h-6 sm:h-8 md:h-10', + 'rounded-lg', + isActive + ? 'h-7 sm:h-8 text-[0.825rem]' + : 'bg-transparent shadow-none border-none p-0 h-auto text-sm sm:text-base font-medium focus-visible:ring-0 text-slate-900/50', +))} {/snippet} {#snippet hiddenContent()} - {#if typography.weightControl && typography.sizeControl && typography.heightControl} -
- - - -
- {/if} + {@render Controls?.('flex flex-row justify-between items-center-safe gap-2 sm:gap-0 h-64', 'vertical')} {/snippet}
{/if}