@blaze @props([ 'icon' => 'document', 'invalid' => false, 'actions' => null, 'heading' => null, 'inline' => false, 'image' => null, 'text' => null, 'size' => null, ]) @php $classes = Flux::classes() ->add('cursor-default') ->add('overflow-hidden') // Overflow hidden is here to prevent the button from growing when selected text is too long. ->add('flex items-start') ->add('shadow-xs') ->add('bg-white dark:bg-white/10 dark:disabled:bg-white/[7%]') // Make the placeholder match the text color of standard input placeholders... ->add('disabled:shadow-none') ->add('min-h-10 text-base sm:text-sm rounded-lg block w-full') ->add($invalid ? 'border border-red-500' : 'border border-zinc-200 border-b-zinc-300/80 dark:border-white/10' ) ; $figureWrapperClasses = Flux::classes() ->add('p-[calc(0.75rem-1px)] flex items-baseline') ->add('[&:has([data-slot=image])]:p-[calc(0.5rem-1px)]') ; $imageWrapperClasses = Flux::classes() ->add('relative mr-1 size-11 rounded-sm overflow-hidden') ->add([ 'after:absolute after:inset-0 after:inset-ring-[1px] after:inset-ring-black/7 dark:after:inset-ring-white/10', 'after:rounded-sm', ]) ; if ($size) { if ($size < 1024) { $text = round($size) . ' B'; } elseif ($size < 1024 * 1024) { $text = round($size / 1024) . ' KB'; } elseif ($size < 1024 * 1024 * 1024) { $text = round($size / 1024 / 1024) . ' MB'; } else { $text = round($size / 1024 / 1024 / 1024) . ' GB'; } } $iconVariant = $text ? 'solid' : 'micro'; @endphp