From 3f7c457c0a80ef991cd24b2bfbc51524fedb5c2f Mon Sep 17 00:00:00 2001 From: Craig Howell Date: Thu, 5 Oct 2023 08:25:33 -0400 Subject: [PATCH] fix(Toggle): added class identifiers and fixed toggle on spacing --- src/lib/components/toggle/ContentLeft.svelte | 2 +- src/lib/components/toggle/ContentRight.svelte | 2 +- src/lib/components/toggle/Description.svelte | 2 +- src/lib/components/toggle/Label.svelte | 2 +- src/lib/components/toggle/Toggle.svelte | 40 +++++++++++++++---- 5 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/lib/components/toggle/ContentLeft.svelte b/src/lib/components/toggle/ContentLeft.svelte index 18b70b74..730aaaf8 100644 --- a/src/lib/components/toggle/ContentLeft.svelte +++ b/src/lib/components/toggle/ContentLeft.svelte @@ -10,7 +10,7 @@ const name: string = getContext('toggle-name'); const toggleOff: () => void = getContext('toggle-off'); - const defaultClass = 'mr-3 cursor-pointer'; + const defaultClass = 'mr-3 cursor-pointer stwui-toggle-content-left'; $: finalClass = twMerge(defaultClass, $$props.class); diff --git a/src/lib/components/toggle/ContentRight.svelte b/src/lib/components/toggle/ContentRight.svelte index 115e015f..78160e89 100644 --- a/src/lib/components/toggle/ContentRight.svelte +++ b/src/lib/components/toggle/ContentRight.svelte @@ -10,7 +10,7 @@ const name: string = getContext('toggle-name'); const toggleOn: () => void = getContext('toggle-on'); - const defaultClass = 'ml-3 cursor-pointer'; + const defaultClass = 'ml-3 cursor-pointer stwui-toggle-content-right'; $: finalClass = twMerge(defaultClass, $$props.class); diff --git a/src/lib/components/toggle/Description.svelte b/src/lib/components/toggle/Description.svelte index 78bcb0ea..32861bee 100644 --- a/src/lib/components/toggle/Description.svelte +++ b/src/lib/components/toggle/Description.svelte @@ -6,7 +6,7 @@ import { exclude } from '../../utils/exclude'; const forwardEvents = forwardEventsBuilder(get_current_component()); - const defaultClass = 'text-sm text-secondary-content'; + const defaultClass = 'text-sm text-secondary-content stwui-toggle-description'; $: finalClass = twMerge(defaultClass, $$props.class); diff --git a/src/lib/components/toggle/Label.svelte b/src/lib/components/toggle/Label.svelte index 38e81cab..e373ab67 100644 --- a/src/lib/components/toggle/Label.svelte +++ b/src/lib/components/toggle/Label.svelte @@ -6,7 +6,7 @@ import { exclude } from '../../utils/exclude'; const forwardEvents = forwardEventsBuilder(get_current_component()); - const defaultClass = 'text-sm font-medium text-content'; + const defaultClass = 'text-sm font-medium text-content stwui-toggle-label'; $: finalClass = twMerge(defaultClass, $$props.class); diff --git a/src/lib/components/toggle/Toggle.svelte b/src/lib/components/toggle/Toggle.svelte index 11c235d0..df64caa5 100644 --- a/src/lib/components/toggle/Toggle.svelte +++ b/src/lib/components/toggle/Toggle.svelte @@ -1,6 +1,12 @@ -
+
{#if error} -

{error}

+

+ {error} +

{/if}