Skip to content

Commit

Permalink
fix(Drawer): added class identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
N00nDay committed Oct 4, 2023
1 parent dc31f4a commit 30a35cc
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/components/drawer/Backdrop.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { getContext } from 'svelte';
const defaultClass =
'fixed inset-0 bg-background bg-opacity-10 backdrop-blur-sm transition-opacity pointer-events-auto';
'fixed inset-0 bg-background bg-opacity-10 backdrop-blur-sm transition-opacity pointer-events-auto stwui-drawer-backdrop';
$: finalClass = twMerge(defaultClass, $$props.class);
const handleClose: () => void = getContext('drawer-handleClose');
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/drawer/Content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { exclude } from '../../utils/exclude';
const forwardEvents = forwardEventsBuilder(get_current_component());
const defaultClass = 'relative flex-grow text-content p-4';
const defaultClass = 'relative flex-grow text-content p-4 stwui-drawer-content';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
8 changes: 5 additions & 3 deletions src/lib/components/drawer/Drawer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,12 @@
}
}
const defaultClass = 'flex inner-panel flex-col bg-surface overflow-hidden';
const defaultClass =
'flex inner-panel flex-col bg-surface overflow-hidden stwui-drawer-inner-panel';
$: finalClass = twMerge(defaultClass, $$props.class);
const defaultPanelClass = 'pointer-events-auto panel transition-transform duration-200';
const defaultPanelClass =
'pointer-events-auto panel transition-transform duration-200 stwui-drawer-panel';
$: finalPanelClass = twMerge(defaultPanelClass, panelClass);
setContext('drawer-handleClose', onClose);
Expand All @@ -106,7 +108,7 @@

<svelte:window on:keydown={captureEscapeEvent} />

<div class="relative z-10" role="dialog">
<div class="relative z-10 stwui-drawer-wrapper" role="dialog">
{#if $$slots.backdrop}
<slot name="backdrop" />
{:else}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/drawer/Footer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const forwardEvents = forwardEventsBuilder(get_current_component());
const defaultClass =
'px-4 sm:px-6 py-4 text-content shadow-negative-md flex-shrink border-t border-border';
'px-4 sm:px-6 py-4 text-content shadow-negative-md flex-shrink border-t border-border stwui-drawer-footer';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/drawer/Header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
const handleClose: () => void = getContext('drawer-handleClose');
const defaultClass =
'px-4 sm:px-6 py-4 shadow-md flex-shrink text-lg font-medium text-content border-b border-border';
'px-4 sm:px-6 py-4 shadow-md flex-shrink text-lg font-medium text-content border-b border-border stwui-drawer-header';
$: finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down

0 comments on commit 30a35cc

Please sign in to comment.