impr: merge mono-ui with photon (#455)

This commit is contained in:
Xylight authored and GitHub committed 2024-09-24 19:33:52 -07:00
1 parent 16075f72f2
commit 180d6fcc0d
40 files changed
+2024 -1

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
<script lang="ts">
import { generateID } from '../forms/helper.js'
type T = $$Generic
export let value: T
export let group: T
export let inlineDescription: boolean = false
export let id: string = generateID()
export let disabled: boolean = false
</script>
<div
class="font-normal cursor-pointer text-sm flex flex-row items-baseline gap-2"
>
<input
{...$$restProps}
{id}
type="radio"
bind:group
{value}
on:blur
on:change
{disabled}
class="cursor-pointer disabled:cursor-not-allowed peer disabled:opacity-50"
/>
<label
for={id}
class="inline-flex {inlineDescription
? 'flex-row'
: 'flex-col'} cursor-pointer peer-disabled:cursor-not-allowed font-medium gap-1 peer-disabled:opacity-50"
>
<slot />
{#if $$slots.description}
<span class="font-normal text-slate-600 dark:text-zinc-400">
<slot name="description" />
</span>
{/if}
</label>
</div>