import { IconTypes } from '@db-ux/core-foundations'; export interface GlobalProps { /** * default slot */ children?: any; /** * React specific for adding className to the component. */ className?: string; /** * Workaround for TypeScript using class for all components. */ class?: string | any; /** * [ID](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id) of the component, generated automatically for some components as a fallback if unset. */ id?: string; /** * Before using please check for the [accessibility concerns](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/autofocus#accessibility_concerns) */ autofocus?: boolean | string; /** * Allows overriding specific props on nested elements or internal component structure. Currently only supports propOverrides.id */ propOverrides?: PropOverridesType; } export type StartSlotProps = { /** * Slot for start content, for example add a custom component between an icon and a label. */ startSlot?: any; }; export type EndSlotProps = { /** * Slot for end content, for example add a custom component between an icon and a label. */ endSlot?: any; }; export type PropOverridesType = Pick; export type GlobalState = { _id?: string; }; export declare const SemanticList: readonly ["adaptive", "neutral", "critical", "informational", "warning", "successful"]; export type SemanticType = (typeof SemanticList)[number]; export type SemanticProps = { /** * The semantic defines the default variants for most components. */ semantic?: SemanticType; }; export type IconProps = { /** * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content. */ icon?: IconTypes; }; export type ShowIconProps = { /** * Enables or disables the visibility of the icon. The default value depends on the component. * For many components this property is optional to reflect Figma properties. */ showIcon?: boolean | string; }; export type ShowIconLeadingProps = { /** * Enables or disables the visibility of the leading icon. * For many components this property is optional to reflect Figma properties. */ showIconLeading?: boolean | string; }; export type ShowIconTrailingProps = { /** * Enables or disables the visibility of the trailing icon. * For many components this property is optional to reflect Figma properties. */ showIconTrailing?: boolean | string; }; export type IconLeadingProps = { /** * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content. */ iconLeading?: IconTypes; }; export type IconTrailingProps = { /** * Define an icon by its identifier (like e.g. _user_, compare to [Icons](https://design-system.deutschebahn.com/core-web/review/main/foundations/icons/overview)) to get displayed in front of the elements content. */ iconTrailing?: IconTypes; }; export declare const SpacingList: readonly ["medium", "small", "large", "none"]; export type SpacingType = (typeof SpacingList)[number]; export type SpacingProps = { /** * The spacing attribute changes the padding of the component. */ spacing?: SpacingType | string; }; export declare const MarginList: readonly ["medium", "small", "large", "none"]; export type MarginType = (typeof MarginList)[number]; export type MarginProps = { /** * The margin attribute changes the margin of the component. */ margin?: MarginType; }; export declare const PlacementHorizontalList: readonly ["left", "right", "left-start", "left-end", "right-start", "right-end"]; export type PlacementHorizontalType = (typeof PlacementHorizontalList)[number]; export declare const PlacementVerticalList: readonly ["top", "bottom", "top-start", "top-end", "bottom-start", "bottom-end"]; export type PlacementVerticalType = (typeof PlacementVerticalList)[number]; export declare const PlacementList: readonly ["left", "right", "left-start", "left-end", "right-start", "right-end", "top", "bottom", "top-start", "top-end", "bottom-start", "bottom-end"]; export type PlacementType = (typeof PlacementList)[number]; export type PlacementProps = { /** * The `placement` attributes values change the position to absolute and adds a transform based on the placement. */ placement?: PlacementType; }; export type NavigationBehaviorState = { handleNavigationItemClick: (event: any) => void; }; export type GapProps = { /** * If the absolute element should have a gap between the parent element. */ gap?: boolean | string; }; export declare const GapSpacingList: readonly ["none", "3x-large", "2x-large", "x-large", "large", "medium", "small", "x-small", "2x-small", "3x-small"]; export type GapSpacingType = (typeof GapSpacingList)[number]; export type GapSpacingProps = { /** * Set the gap/spacing between elements */ gap?: GapSpacingType; }; export type OverflowProps = { /** * The overflow attribute sets a max-width and longer text will be dotted. */ overflow?: boolean | string; }; export type WrapProps = { /** * Determines whether the text should wrap when its parent container is too small, preventing overflow. */ wrap?: boolean | string; }; export declare const OrientationList: readonly ["horizontal", "vertical"]; export type OrientationType = (typeof OrientationList)[number]; export type OrientationProps = { /** * Change the orientation. Defaults to horizontal. */ orientation?: OrientationType; }; export declare const WidthList: readonly ["full", "auto"]; export type WidthType = (typeof WidthList)[number]; export type WidthProps = { /** * Width of the component. Auto width based on children size, full width based on parent elements width. */ width?: WidthType | string; }; export declare const MaxWidthList: readonly ["full", "medium", "large", "small"]; export type MaxWidthType = (typeof MaxWidthList)[number]; export type ContainerWidthProps = { /** * Set max width for the component */ width?: MaxWidthType; }; export declare const PopoverDelayList: readonly ["none", "slow", "fast"]; export type PopoverDelayType = (typeof PopoverDelayList)[number]; export declare const PopoverWidthList: readonly ["auto", "fixed"]; export type PopoverWidthType = (typeof PopoverWidthList)[number]; export type PopoverProps = { /** * Add a delay before showing the tooltip */ delay?: PopoverDelayType; /** * Disable animation */ animation?: boolean | string; /** * Use fixed with for default max-width */ width?: PopoverWidthType; }; export type NameProps = { /** * The name attribute gives the name of the element to group it. */ name?: string; }; export type NameState = { _name?: string; handleNameAttribute: () => void; }; export type ContentSlotProps = { /** * Default slot which is used to pass in additional content. */ content?: any; }; export declare const SizeList: readonly ["small", "medium"]; export type SizeType = (typeof SizeList)[number]; export type SizeProps = { /** * The size attribute changes the font-size and other related sizes of the component. */ size?: SizeType; }; export declare const EmphasisList: readonly ["weak", "strong"]; export type EmphasisType = (typeof EmphasisList)[number]; export type EmphasisProps = { /** * The emphasis attribute divides in between a weak or strong importance. */ emphasis?: EmphasisType; }; export declare const ValidationList: readonly ["invalid", "valid", "no-validation"]; export type ValidationType = (typeof ValidationList)[number]; /** * Properties to control the required state and its visual annotation for input components. */ export type RequiredProps = { /** * When the required attribute specified, the user will be required to fill the form element before submitting the form. * The form element will be marked semantically as required and by default also visually with an asterisk '*' next to the label (unless the property `showRequiredAsterisk` is also set with the value `false`). */ required?: boolean | string; /** * This attribute allows to specify whether a form field which is marked as required will show a visual indicator (an asterisk '*'). * It allows to prevent adding the visual indicator but still keep the field semantically required by setting its value to `false`. * By default, its value is `true`, so the asterisk is shown when `required` is set. */ showRequiredAsterisk?: boolean | string; }; export type ShowLabelProps = { /** * Enables/disables the visibility of the label */ showLabel?: boolean | string; }; export type ValueProps = { /** * The value property is to receive results from the native form element. */ value?: any; }; export type DisabledProps = { /** * The disabled attribute can be set to keep a user from clicking on the item. */ disabled?: boolean | string; }; export type BaseFormProps = { /** * The label attribute specifies the caption of the form element. */ label?: string; /** * The name attribute gives the name of the form control, as used in form submission and in the form element's elements object. */ name?: string; } & DisabledProps; export type CustomFormProps = { /** * Overwrites auto handling for aria-describedby. */ ariaDescribedBy?: string; /** * Associates the control with a form element */ form?: string; /** * Marks an input element as invalid (red) / valid (green) / no-validation (grey). Overwrites the :user-valid selector. */ validation?: ValidationType; }; export type FormProps = CustomFormProps & BaseFormProps & RequiredProps & ShowLabelProps & ValueProps; export declare const FieldSizingList: readonly ["fixed", "content"]; export type FieldSizingType = (typeof FieldSizingList)[number]; export type FormTextProps = { /** * Maximum length (number of characters) of value */ maxLength?: number | string; /** * Minimum length (number of characters) of value */ minLength?: number | string; /** * Maximum length (number of characters) of value */ maxlength?: number | string; /** * Minimum length (number of characters) of value */ minlength?: number | string; /** * The disabled attribute can be set to keep a user from edit on the form element */ readOnly?: boolean | string; /** * The disabled attribute can be set to keep a user from edit on the form element */ readonly?: boolean | string; /** * Adds shrinkwrap for input and textarea: https://developer.mozilla.org/en-US/docs/Web/CSS/field-sizing * Note: Only supported in Chromium browsers so far */ fieldSizing?: FieldSizingType; }; export type FormSizeProps = { /** * Size of the control */ size?: number; }; export type FormCheckProps = { /** * Define the radio or checkbox elements checked state */ checked?: boolean | string; }; export declare const LabelVariantList: readonly ["above", "floating"]; export type LabelVariantType = (typeof LabelVariantList)[number]; export declare const LabelVariantHorizontalList: readonly ["leading", "trailing"]; export type LabelVariantHorizontalType = (typeof LabelVariantHorizontalList)[number]; export declare const AutoCompleteList: readonly ["off", "on", "name", "honorific-prefix", "given-name", "additional-name", "family-name", "honorific-suffix", "nickname", "email", "username", "new-password", "current-password", "one-time-code", "organization-title", "organization", "street-address", "shipping", "billing", "address-line1", "address-line2", "address-line3", "address-level4", "address-level3", "address-level2", "address-level1", "country", "country-name", "postal-code", "cc-name", "cc-given-name", "cc-additional-name", "cc-family-name", "cc-number", "cc-exp", "cc-exp-month", "cc-exp-year", "cc-csc", "cc-type", "transaction-currency", "transaction-amount", "language", "bday", "bday-day", "bday-month", "bday-year", "sex", "tel", "tel-country-code", "tel-national", "tel-area-code", "tel-local", "tel-extension", "impp", "url", "photo", "webauthn"]; export type AutoCompleteType = (typeof AutoCompleteList)[number]; export type FormMessageProps = { /** * Change the variant of the label to float or hidden */ variant?: LabelVariantType; /** * Text that appears in the form control when it has no value set */ placeholder?: string; /** * Optional helper message for form components */ message?: string; /** * Helper message for valid form components */ validMessage?: string; /** * Helper message for invalid form components */ invalidMessage?: string; /** * Set/overwrite icon for helper message for form components */ messageIcon?: IconTypes; /** * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete */ autocomplete?: string | AutoCompleteType; /** * See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete */ autoComplete?: string | AutoCompleteType; /** * Enables or disables the visibility of the message. */ showMessage?: boolean | string; }; export type FromValidState = { hasValidState: () => boolean; handleValidation: () => void; _invalidMessage?: string; }; export type ResetIdState = { resetIds: () => void; }; export type FormState = { _messageId?: string; _validMessageId?: string; _invalidMessageId?: string; _descByIds?: string; _value?: string; _invalidMessage?: string; /** * https://www.davidmacd.com/blog/test-aria-describedby-errormessage-aria-live.html * Currently VoiceOver isn't supporting changes from aria-describedby. * This is an internal Fallback */ _voiceOverFallback?: string; /** * We use this to remove form event listener */ abortController?: AbortController; } & ResetIdState; export type InitializedState = { initialized: boolean; }; export declare const LinkTargetList: readonly ["_self", "_blank", "_parent", "_top"]; export type LinkTargetType = (typeof LinkTargetList)[number]; export declare const LinkReferrerPolicyList: readonly ["no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "same-origin", "strict-origin", "strict-origin-when-cross-origin", "unsafe-url"]; export type LinkReferrerPolicyType = (typeof LinkReferrerPolicyList)[number]; export type LinkProps = { /** * Disables the link. */ disabled?: boolean | string; /** * The [URL that the hyperlink points to](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href). */ href?: string; /** * Hints for the human [language of the linked page or document](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#hreflang). */ hreflang?: string; /** * Where to open the linked URL, as the name for a [browsing context](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target). */ target?: LinkTargetType; /** * The relationship of the linked URL as space-separated link types. */ rel?: string; /** * How much of the referrer to send when following the link. * @deprecated use `referrerPolicy` instead */ referrerpolicy?: LinkReferrerPolicyType; /** * How much of the referrer to send when following the link. */ referrerPolicy?: LinkReferrerPolicyType; }; export type RoleProps = { /** * Sets aria role based on [`aria-role`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles). */ role?: string; }; export type TextProps = { /** * Alternative for default slot/children. Do not use together with a text children/slot, as both will be rendered and result in duplicate labels. */ text?: string; }; export type GeneralEvent = Event; export type GeneralKeyboardEvent = KeyboardEvent; export type ClickEvent = MouseEvent; export type ClickEventProps = { /** * React specific onClick to pass to forward ref. */ onClick?: (event: ClickEvent) => void; click?: (event: ClickEvent) => void; }; export type ClickEventState = { handleClick: (event: ClickEvent | any) => void; }; export type ToggleEventProps = { toggle?: (open: boolean) => void; onToggle?: (open: boolean) => void; }; export type ToggleEventState = { handleToggle: (event?: ClickEvent | any) => void; }; export type CloseEventProps = { /** * Function to handle button click (close). */ onClose?: (event?: T) => void; /** * Function to handle button click (close). */ close?: (event?: T) => void; }; export type CloseEventState = { handleClose: (event?: T | void, forceClose?: boolean) => void; }; export declare const AlignmentList: readonly ["start", "center", "end"]; export type AlignmentType = (typeof AlignmentList)[number]; export type AlignmentProps = { /** * Define the content alignment */ alignment?: AlignmentType | string; }; export type ActiveProps = { /** * If the tab is checked/active. */ active?: boolean | string; }; export type InputEvent = Event; export type InputEventProps = { input?: (event: InputEvent) => void; onInput?: (event: InputEvent) => void; }; export type InputEventState = { handleInput: (event: InputEvent | any, reset?: boolean) => void; }; export type ChangeEvent = Event; export type ChangeEventProps = { change?: (event: ChangeEvent) => void; onChange?: (event: ChangeEvent) => void; }; export type ChangeEventState = { handleChange: (event: ChangeEvent | any, reset?: boolean) => void; }; export type InteractionEvent = FocusEvent; export type FocusEventProps = { blur?: (event: InteractionEvent) => void; onBlur?: (event: InteractionEvent) => void; focus?: (event: InteractionEvent) => void; onFocus?: (event: InteractionEvent) => void; }; export type FocusEventState = { handleBlur: (event: InteractionEvent | any) => void; handleFocus: (event: InteractionEvent | any) => void; }; export type InnerCloseButtonProps = { /** * The closeButtonId attribute changes the id inside the close button. */ closeButtonId?: string; /** * The closeButtonText attribute changes the text inside the close button. */ closeButtonText?: string; }; export type NavigationBackButtonProps = { /** * The backButtonId attribute changes the id inside the back button. */ backButtonId?: string; /** * The backButtonText attribute changes the text inside the back button. */ backButtonText?: string; }; export type AriaControlsProps = { /** * Pass `aria-controls` to inner element */ controls?: string; }; export type NoTextProps = { /** * Define the text next to the icon specified via the icon Property to get hidden. */ noText?: boolean | string; }; export type ValueLabelType = { value: string; label?: string; }; export type DocumentScrollState = { _documentScrollListenerCallbackId?: string; handleDocumentScroll: (event: any, parent?: HTMLElement) => void; _intersectionObserverCallbackId?: string; _resizeObserverCallbackId?: string; }; export type PopoverState = { handleEscape: (event: any) => void; handleAutoPlacement: (parent?: HTMLElement) => void; handleEnter: (parent?: HTMLElement, manualOpen?: boolean) => void; handleLeave: (event?: any, manualOpen?: boolean) => void; } & DocumentScrollState; export interface PatternhubProps { /** * Used for Patternhub */ isPatternhub?: boolean; } export type DBTableCellProps = { /** * The **`colSpan`** read-only property of the HTMLTableCellElement interface represents the number of columns this cell must span; this lets the cell occupy space across multiple columns of the table. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/colSpan) */ colSpan?: number | string; /** * Lowercase HTML attribute alternative to `colSpan`. Use this in template languages that require lowercase attributes (e.g. Angular, Vue). * If both `colSpan` and `colspan` are provided, `colSpan` takes precedence. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/colSpan) */ colspan?: number | string; /** * The **`headers`** property of the HTMLTableCellElement interface contains a list of IDs of th elements that are _headers_ for this specific cell. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/headers) */ headers?: string; /** * The **`rowSpan`** read-only property of the HTMLTableCellElement interface represents the number of rows this cell must span; this lets the cell occupy space across multiple rows of the table. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/rowSpan) */ rowSpan?: number | string; /** * Lowercase HTML attribute alternative to `rowSpan`. Use this in template languages that require lowercase attributes (e.g. Angular, Vue). * If both `rowSpan` and `rowspan` are provided, `rowSpan` takes precedence. * * [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLTableCellElement/rowSpan) */ rowspan?: number | string; /** * Set the horizontal alignment of the cell content. */ horizontalAlignment?: AlignmentType; /** * Set the vertical alignment of the cell content. */ verticalAlignment?: AlignmentType; };