diff --git a/packages/components/src/components/drawer/test/snapshot.spec.tsx b/packages/components/src/components/drawer/test/snapshot.spec.tsx
index 8b1a9f712a..1f4aec4b54 100644
--- a/packages/components/src/components/drawer/test/snapshot.spec.tsx
+++ b/packages/components/src/components/drawer/test/snapshot.spec.tsx
@@ -4,25 +4,16 @@ import { executeSnapshotTests } from '../../../utils/testing';
import { KolDrawer } from '../shadow';
-function getVariantsByModalMode(modal: boolean) {
- return ['top', 'right', 'bottom', 'left'].map((variant) => ({
+const variants = ['top', 'right', 'bottom', 'left'];
+
+const testCases: DrawerProps[] = [
+ ...variants.map((variant) => ({
_label: 'Label',
- _modal: modal,
_open: true,
_variant: variant,
- }));
-}
-
-executeSnapshotTests
(
- KolDrawerTag,
- [KolDrawer],
- [
- { _label: 'Label' },
- { _label: 'Label', _open: false },
- { _label: 'Label', _modal: false, _open: false },
- { _label: 'Label', _modal: true, _open: false },
+ })),
+ { _label: 'Label' },
+ { _label: 'Label', _open: false },
+];
- ...getVariantsByModalMode(false),
- ...getVariantsByModalMode(true),
- ],
-);
+executeSnapshotTests(KolDrawerTag, [KolDrawer], testCases);
diff --git a/packages/components/src/schema/components/drawer.ts b/packages/components/src/schema/components/drawer.ts
index d8b03286e8..92ce0a04a3 100644
--- a/packages/components/src/schema/components/drawer.ts
+++ b/packages/components/src/schema/components/drawer.ts
@@ -1,16 +1,15 @@
import type { Generic } from 'adopted-style-sheets';
-import type { PropLabel, PropOpen, PropAlign, PropModal } from '../props';
+import type { PropLabel, PropOpen, PropAlign } from '../props';
import type { KoliBriModalEventCallbacks } from '../types';
type RequiredProps = PropLabel;
type OptionalProps = PropAlign &
- PropOpen &
- PropModal & {
+ PropOpen & {
on: KoliBriModalEventCallbacks;
};
type RequiredStates = PropAlign & PropOpen & PropLabel;
-type OptionalStates = PropModal & {
+type OptionalStates = {
on: KoliBriModalEventCallbacks;
};
diff --git a/packages/samples/react/src/components/drawer/basic.tsx b/packages/samples/react/src/components/drawer/basic.tsx
index 47e9c92914..69b9c1ff67 100644
--- a/packages/samples/react/src/components/drawer/basic.tsx
+++ b/packages/samples/react/src/components/drawer/basic.tsx
@@ -14,21 +14,17 @@ export const DrawerBasic: FC = () => {
const defaultAlign = searchParams.get('align') as AlignPropType;
const hideMenus = useContext(HideMenusContext);
const drawerElement = useRef(null);
- const drawerModalElement = useRef(null);
const [align, setAlign] = useState(defaultAlign || 'left');
useEffect(() => {
if (defaultAlign) {
- drawerModalElement.current?.open();
+ drawerElement.current?.open();
}
}, [defaultAlign]);
return (
<>
{!hideMenus && }
-
- KolDrawer shows a dialog attached to one of the sides of the viewport, when opened. This sample illustrates the four alignments and the modal- and
- non-modal modes.
-
+ KolDrawer shows a dialog attached to one of the sides of the viewport, when opened. This sample illustrates the four alignments.
setAlign(value as AlignPropType)} />
@@ -41,20 +37,6 @@ export const DrawerBasic: FC = () => {
drawerElement.current?.close() }} />
drawerElement.current?.open() }} />
- console.log('Drawer Modal onClose triggered!') }}
- >
-
- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
- voluptua.
-
- drawerModalElement.current?.close() }} />
-
- drawerModalElement.current?.open() }} />
>
);
diff --git a/packages/samples/react/src/components/drawer/controlled.tsx b/packages/samples/react/src/components/drawer/controlled.tsx
index 23d3aa990f..56b6c814f7 100644
--- a/packages/samples/react/src/components/drawer/controlled.tsx
+++ b/packages/samples/react/src/components/drawer/controlled.tsx
@@ -14,7 +14,6 @@ export const DrawerControlled: FC = () => {
const defaultAlign = searchParams.get('align') as AlignPropType;
const hideMenus = useContext(HideMenusContext);
const [open, setOpen] = useState(false);
- const [modalOpen, setModalOpen] = useState(false);
const [align, setAlign] = useState