Skip to content

Commit

Permalink
docs: optimize CPagination and CImage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackman99 committed Aug 15, 2023
1 parent ea206e6 commit 5c28787
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eleven-rockets-allow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@casual-ui/svelte': minor
---

docs: optimize CPagination and CImage docs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ componentName: CPagination
<div class="i-ion-ellipsis-horizontal-circle"></div>
</CButton>
<button slot="page-button" let:p let:active on:click={() => (current = p)}>
<span class:c-text-primary={active} class:c-font-xl={active}>
{p}
</span>
</button>
<CButton slot="right-ellipsis" let:set flat theme="warning" on:click={set}>
<div class="i-octicon-ellipsis-16"></div>
</CButton>
Expand Down
17 changes: 17 additions & 0 deletions packages/ui/src/components/CBadge.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<script>
/**
* The label text content
* @type {string}
*/
export let label = undefined
</script>

<div class="c-badge">
{#if label}
<div class="c-badge--label">
{label}
</div>
{/if}
<!-- The content that holds the badge -->
<slot />
</div>
7 changes: 6 additions & 1 deletion packages/ui/src/components/CImage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
export let src
/**
* The default image src
* The default image src used before real src image loaded
* @type
*/
export let placeholderSrc =
Expand Down Expand Up @@ -85,13 +85,18 @@
{#if imagePromise}
{#await imagePromise}
<div class="c-image--loading">
<!-- Customize loading content -->
<slot name="loading">
<CLoading />
</slot>
</div>
{:then src}
<img {src} {alt} {width} class="{imgClass}" {...$$restProps} />
{:catch err}
<!--
Customize the error status
@param {any} err The error object
-->
<slot name="err" {err}>
<div>
{err}
Expand Down

0 comments on commit 5c28787

Please sign in to comment.