-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: description list component
- Loading branch information
1 parent
d035664
commit 41afe8f
Showing
12 changed files
with
170 additions
and
119 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"> | ||
let props = $props(); | ||
</script> | ||
|
||
<dd class="grow text-balance break-all text-right tabular-nums">{@render props.children()}</dd> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
<script lang="ts"> | ||
import type { Snippet } from 'svelte'; | ||
import DT from './dt.svelte'; | ||
import DD from './dd.svelte'; | ||
interface Props { | ||
title: string; | ||
children: Snippet; | ||
description?: string; | ||
children?: Snippet; | ||
} | ||
let { title, children }: Props = $props(); | ||
let { title = '', description, children }: Props = $props(); | ||
</script> | ||
|
||
<div | ||
class="flex flex-wrap items-center justify-between gap-x-4 border-b border-mineShaft-900 py-3 last:border-none @xs:flex-nowrap" | ||
> | ||
<dt class="caption self-start text-nowrap">{title}</dt> | ||
<dd class="grow text-balance break-all text-right tabular-nums">{@render children()}</dd> | ||
<DT>{title}</DT> | ||
<div | ||
class="grow bg-red-500 before:content-['ERROR_Missing_DD_element_'] has-[dd]:bg-transparent has-[dd]:before:hidden" | ||
> | ||
{#if description} | ||
<DD>{description}</DD> | ||
{/if} | ||
{#if children} | ||
{@render children()} | ||
{/if} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script lang="ts"> | ||
let props = $props(); | ||
</script> | ||
|
||
<dt class="caption self-start text-nowrap">{@render props.children()}</dt> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { default as DL } from './dl.svelte'; | ||
export { default as DLRow } from './dlrow.svelte'; | ||
export { default as DD } from './dd.svelte'; | ||
export { default as DT } from './dt.svelte'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.