From 9eb0691f8e85a5181e80db782084a81ce22a5962 Mon Sep 17 00:00:00 2001 From: Craig Howell Date: Tue, 18 Oct 2022 13:36:35 -0400 Subject: [PATCH] fix(ButtonGroup): removed material icons dependency docs(button-group): updated examples --- src/lib/components/button-group/Icon.svelte | 45 +++++++++++++ src/lib/components/button-group/index.ts | 28 ++------ src/lib/components/button/Icon.svelte | 1 - src/routes/button-group/+page.svelte | 33 +++++++--- src/routes/button-group/examples.ts | 73 ++++++++++++++++----- 5 files changed, 133 insertions(+), 47 deletions(-) create mode 100644 src/lib/components/button-group/Icon.svelte diff --git a/src/lib/components/button-group/Icon.svelte b/src/lib/components/button-group/Icon.svelte new file mode 100644 index 00000000..07223a89 --- /dev/null +++ b/src/lib/components/button-group/Icon.svelte @@ -0,0 +1,45 @@ + + + + {@html elements} + diff --git a/src/lib/components/button-group/index.ts b/src/lib/components/button-group/index.ts index b6635eea..04773995 100644 --- a/src/lib/components/button-group/index.ts +++ b/src/lib/components/button-group/index.ts @@ -1,18 +1,14 @@ import OriginalButtonGroup from './ButtonGroup.svelte'; import OriginalButton from './Button.svelte'; import Loader from './Loader.svelte'; -// import OriginalLeading from './Leading.svelte'; -// import OriginalTrailing from './Trailing.svelte'; -// import Icon from './Icon.svelte'; +import Icon from './Icon.svelte'; const ButtonGroup = OriginalButtonGroup as ButtonGroupStatic; ButtonGroup.Button = OriginalButton as ButtonStatic; ButtonGroup.Button.Loader = Loader; -// ButtonGroup.Button.Leading = OriginalLeading as LeadingStatic; -// ButtonGroup.Button.Trailing = OriginalTrailing as TrailingStatic; -// ButtonGroup.Button.Icon = Icon; -// ButtonGroup.Button.Leading.Icon = Icon; -// ButtonGroup.Button.Trailing.Icon = Icon; +ButtonGroup.Button.Icon = Icon; +ButtonGroup.Button.Leading = Icon; +ButtonGroup.Button.Trailing = Icon; export default ButtonGroup; @@ -25,17 +21,7 @@ export interface ButtonStatic { new (...args: ConstructorParameters): OriginalButton; Button: ButtonStatic; Loader: typeof Loader; - // Icon: typeof Icon; - // Leading: LeadingStatic; - // Trailing: TrailingStatic; + Icon: typeof Icon; + Leading: typeof Icon; + Trailing: typeof Icon; } - -// export interface LeadingStatic { -// new (...args: ConstructorParameters): OriginalLeading; -// Icon: typeof Icon; -// } - -// export interface TrailingStatic { -// new (...args: ConstructorParameters): OriginalTrailing; -// Icon: typeof Icon; -// } diff --git a/src/lib/components/button/Icon.svelte b/src/lib/components/button/Icon.svelte index a23c58b5..2ad804d4 100644 --- a/src/lib/components/button/Icon.svelte +++ b/src/lib/components/button/Icon.svelte @@ -1,6 +1,5 @@