diff --git a/src/components/core/interfaces.ts b/src/components/core/interfaces.ts index d6d8a35523..83313ece04 100644 --- a/src/components/core/interfaces.ts +++ b/src/components/core/interfaces.ts @@ -1,2 +1,3 @@ +export * from './interfaces/dialog-close-details.js'; export * from './interfaces/types.js'; export * from './interfaces/validation-change.js'; diff --git a/src/components/core/interfaces/dialog-close-details.ts b/src/components/core/interfaces/dialog-close-details.ts new file mode 100644 index 0000000000..0281870330 --- /dev/null +++ b/src/components/core/interfaces/dialog-close-details.ts @@ -0,0 +1,4 @@ +export type SbbDialogCloseEventDetails = { + returnValue?: any; + closeTarget?: HTMLElement; +}; diff --git a/src/components/dialog/dialog/dialog-base-element.ts b/src/components/dialog/dialog/dialog-base-element.ts index 0b617bf2cc..bab670a40d 100644 --- a/src/components/dialog/dialog/dialog-base-element.ts +++ b/src/components/dialog/dialog/dialog-base-element.ts @@ -6,7 +6,7 @@ import { SbbLanguageController } from '../../core/controllers.js'; import { hostContext, SbbScrollHandler } from '../../core/dom.js'; import { EventEmitter } from '../../core/eventing.js'; import { i18nDialog } from '../../core/i18n.js'; -import type { SbbOpenedClosedState } from '../../core/interfaces.js'; +import type { SbbDialogCloseEventDetails, SbbOpenedClosedState } from '../../core/interfaces.js'; import { SbbNegativeMixin } from '../../core/mixins.js'; import { applyInertMechanism, removeInertMechanism } from '../../core/overlay.js'; import type { SbbScreenReaderOnlyElement } from '../../screen-reader-only.js'; @@ -14,11 +14,6 @@ import type { SbbScreenReaderOnlyElement } from '../../screen-reader-only.js'; // A global collection of existing dialogs export const dialogRefs: SbbDialogBaseElement[] = []; -export type SbbDialogCloseEventDetails = { - returnValue?: any; - closeTarget?: HTMLElement; -}; - export abstract class SbbDialogBaseElement extends SbbNegativeMixin(LitElement) { public static readonly events = { willOpen: 'willOpen', @@ -30,10 +25,6 @@ export abstract class SbbDialogBaseElement extends SbbNegativeMixin(LitElement) /** This will be forwarded as aria-label to the relevant nested element. */ @property({ attribute: 'accessibility-label' }) public accessibilityLabel: string | undefined; - /** Whether the animation is enabled. */ - @property({ attribute: 'disable-animation', reflect: true, type: Boolean }) - public disableAnimation = false; - /** The state of the overlay. */ protected set state(state: SbbOpenedClosedState) { this.setAttribute('data-state', state); diff --git a/src/components/overlay.ts b/src/components/overlay.ts index a4e58ef7cb..507a410c82 100644 --- a/src/components/overlay.ts +++ b/src/components/overlay.ts @@ -1,3 +1 @@ export * from './overlay/overlay.js'; -// FIXME this is needed due to the react build: it fails without the SbbDialogCloseEventDetails explicit export -export * from './dialog/dialog/dialog-base-element.js'; diff --git a/tools/vite/generate-react-wrappers.ts b/tools/vite/generate-react-wrappers.ts index c19cda9390..492c8010ed 100644 --- a/tools/vite/generate-react-wrappers.ts +++ b/tools/vite/generate-react-wrappers.ts @@ -121,7 +121,7 @@ function renderTemplate( const extensionImport = !extensions.size ? '' : ` - + import { ${Array.from(extensions.keys()).join(', ')} } from '${relativeCoreImportPath}';`; const extension = [...extensions.values()].reduce( (current, next) => (v) => current(next(v)), @@ -141,10 +141,9 @@ function renderTemplate( // If a type or interface needs to be imported, the custom elements analyzer will not // detect/extract these and therefore we need to have a manual list of required // types/interfaces. - const interfaces = new Map().set( - 'SbbValidationChangeEvent', - 'core/interfaces.js', - ); + const interfaces = new Map() + .set('SbbDialogCloseEventDetails', 'core/interfaces.js') + .set('SbbValidationChangeEvent', 'core/interfaces.js'); for (const customEventType of customEventTypes) { const exportModule = exports.find((e) => e.name === customEventType); if (exportModule) { @@ -173,7 +172,7 @@ function renderTemplate( ) .join('\n')} import react from 'react';${extensionImport} - + // eslint-disable-next-line @typescript-eslint/naming-convention export const ${declaration.name.replace(/Element$/, '')} = ${extension(`createComponent({ tagName: '${declaration.tagName}',