From cb9965643afbfe8e654ca850eee3dc977655e030 Mon Sep 17 00:00:00 2001 From: Craig Howell Date: Wed, 19 Oct 2022 16:29:54 -0400 Subject: [PATCH] fix(Currency): aligned leading and trailing with the rest of the library docs(currency): updated examples --- src/lib/components/currency/Currency.svelte | 20 +++++++--- src/lib/components/currency/Leading.svelte | 37 ------------------ src/lib/components/currency/Trailing.svelte | 37 ------------------ src/lib/components/currency/index.ts | 22 ++--------- src/routes/currency/+page.svelte | 36 ++++-------------- src/routes/currency/examples.ts | 42 +++------------------ 6 files changed, 30 insertions(+), 164 deletions(-) delete mode 100644 src/lib/components/currency/Leading.svelte delete mode 100644 src/lib/components/currency/Trailing.svelte diff --git a/src/lib/components/currency/Currency.svelte b/src/lib/components/currency/Currency.svelte index 03db8b89..2d43437f 100644 --- a/src/lib/components/currency/Currency.svelte +++ b/src/lib/components/currency/Currency.svelte @@ -44,7 +44,10 @@
-
+
- + + {#if $$slots.leading} + + + + {/if} {#if $$slots.trailing && !error} - + + + {:else if error} - + {/if} diff --git a/src/lib/components/currency/Leading.svelte b/src/lib/components/currency/Leading.svelte deleted file mode 100644 index 8728555b..00000000 --- a/src/lib/components/currency/Leading.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - diff --git a/src/lib/components/currency/Trailing.svelte b/src/lib/components/currency/Trailing.svelte deleted file mode 100644 index eebeb469..00000000 --- a/src/lib/components/currency/Trailing.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - diff --git a/src/lib/components/currency/index.ts b/src/lib/components/currency/index.ts index 66209fab..e5e48c79 100644 --- a/src/lib/components/currency/index.ts +++ b/src/lib/components/currency/index.ts @@ -1,31 +1,17 @@ import OriginalCurrency from './Currency.svelte'; import Label from './Label.svelte'; -import OriginalLeading from './Leading.svelte'; -import OriginalTrailing from './Trailing.svelte'; import Icon from '../icon/Icon.svelte'; const Currency = OriginalCurrency as CurrencyStatic; Currency.Label = Label; -Currency.Leading = OriginalLeading as LeadingStatic; -Currency.Trailing = OriginalTrailing as TrailingStatic; -Currency.Leading.Icon = Icon; -Currency.Trailing.Icon = Icon; +Currency.Leading = Icon; +Currency.Trailing = Icon; export default Currency; export interface CurrencyStatic { new (...args: ConstructorParameters): OriginalCurrency; Label: typeof Label; - Leading: LeadingStatic; - Trailing: TrailingStatic; -} - -export interface LeadingStatic { - new (...args: ConstructorParameters): OriginalLeading; - Icon: typeof Icon; -} - -export interface TrailingStatic { - new (...args: ConstructorParameters): OriginalTrailing; - Icon: typeof Icon; + Leading: typeof Icon; + Trailing: typeof Icon; } diff --git a/src/routes/currency/+page.svelte b/src/routes/currency/+page.svelte index 7e97b042..608773f9 100644 --- a/src/routes/currency/+page.svelte +++ b/src/routes/currency/+page.svelte @@ -1,14 +1,6 @@ -
+ Label - - - - - - + + -
+ Label - - - + `;