@bloomreach/react-banana-ui 1.37.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bloomreach-react-banana-ui.es.js +7626 -7507
- package/dist/bloomreach-react-banana-ui.es.js.map +1 -1
- package/dist/bloomreach-react-banana-ui.umd.js +17 -17
- package/dist/bloomreach-react-banana-ui.umd.js.map +1 -1
- package/dist/components/inputs/autocomplete/autocomplete.stories.d.ts +10 -0
- package/dist/components/inputs/autocomplete/autocomplete.types.d.ts +36 -0
- package/dist/components/navigation/pagination/index.d.ts +2 -2
- package/dist/components/navigation/pagination/pagination/index.d.ts +2 -0
- package/dist/components/navigation/pagination/{pagination.types.d.ts → pagination/pagination.types.d.ts} +5 -4
- package/dist/components/navigation/pagination/pagination-config.d.ts +3 -1
- package/dist/components/navigation/pagination/pagination-context.d.ts +7 -3
- package/dist/components/navigation/pagination/pagination-items-per-page-selector/index.d.ts +1 -0
- package/dist/components/navigation/pagination/pagination-items-per-page-selector/pagination-items-per-page-selector.d.ts +6 -0
- package/dist/components/navigation/pagination/pagination-navigation/index.d.ts +1 -0
- package/dist/components/navigation/pagination/pagination-navigation/pagination-navigation-helpers.d.ts +17 -0
- package/dist/components/navigation/pagination/pagination-navigation/pagination-navigation.d.ts +6 -0
- package/dist/components/navigation/pagination/pagination-navigation-item/index.d.ts +2 -0
- package/dist/components/navigation/pagination/pagination-navigation-item/pagination-navigation-item.d.ts +7 -0
- package/dist/components/navigation/pagination/pagination-navigation-item/pagination-navigation-item.types.d.ts +10 -0
- package/dist/components/navigation/pagination/pagination-summary/index.d.ts +1 -0
- package/dist/components/navigation/pagination/pagination-summary/pagination-summary.d.ts +6 -0
- package/dist/components/navigation/pagination/pagination.qa.stories.d.ts +1 -1
- package/dist/components/navigation/pagination/pagination.stories.d.ts +1 -1
- package/dist/components/popovers/modal/index.d.ts +14 -8
- package/dist/components/popovers/modal/modal/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal.types.d.ts → modal/modal.types.d.ts} +0 -25
- package/dist/components/popovers/modal/modal-body/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-body.d.ts → modal-body/modal-body.d.ts} +1 -1
- package/dist/components/popovers/modal/modal-body/modal-body.types.d.ts +16 -0
- package/dist/components/popovers/modal/modal-close-button/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-close-button.d.ts → modal-close-button/modal-close-button.d.ts} +1 -6
- package/dist/components/popovers/modal/modal-close-button/modal-close-button.types.d.ts +2 -0
- package/dist/components/popovers/modal/modal-context.d.ts +5 -3
- package/dist/components/popovers/modal/modal-footer/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-footer.d.ts → modal-footer/modal-footer.d.ts} +2 -2
- package/dist/components/popovers/modal/modal-footer/modal-footer.types.d.ts +11 -0
- package/dist/components/popovers/modal/modal-footer-actions/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-footer-actions.d.ts → modal-footer-actions/modal-footer-actions.d.ts} +2 -2
- package/dist/components/popovers/modal/modal-footer-actions/modal-footer-actions.types.d.ts +11 -0
- package/dist/components/popovers/modal/modal-header/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-header.d.ts → modal-header/modal-header.d.ts} +2 -2
- package/dist/components/popovers/modal/modal-header/modal-header.types.d.ts +11 -0
- package/dist/components/popovers/modal/modal-header-title/index.d.ts +2 -0
- package/dist/components/popovers/modal/{modal-header-title.d.ts → modal-header-title/modal-header-title.d.ts} +2 -2
- package/dist/components/popovers/modal/modal-header-title/modal-header-title.types.d.ts +11 -0
- package/dist/components/popovers/modal/modal.qa.stories.d.ts +1 -1
- package/dist/components/popovers/modal/modal.stories.d.ts +1 -1
- package/dist/react-banana-ui.css +1 -1
- package/package.json +1 -1
- package/dist/components/navigation/pagination/pagination-items-per-page-selector.d.ts +0 -1
- package/dist/components/navigation/pagination/pagination-navigation-helpers.d.ts +0 -11
- package/dist/components/navigation/pagination/pagination-navigation-item.d.ts +0 -5
- package/dist/components/navigation/pagination/pagination-navigation.d.ts +0 -1
- package/dist/components/navigation/pagination/pagination-summary.d.ts +0 -1
- /package/dist/components/navigation/pagination/{pagination.d.ts → pagination/pagination.d.ts} +0 -0
- /package/dist/components/popovers/modal/{modal.d.ts → modal/modal.d.ts} +0 -0
|
@@ -6,12 +6,22 @@ export default meta;
|
|
|
6
6
|
export type Story<Value extends NonNullable<unknown> = string, Multiple extends boolean = false, FreeSolo extends boolean = false> = StoryObj<typeof Autocomplete<Value, Multiple, FreeSolo>>;
|
|
7
7
|
declare const fruits: string[];
|
|
8
8
|
export declare const Basic: Story;
|
|
9
|
+
export declare const CustomWidth: Story;
|
|
9
10
|
export declare const AutoSelect: Story;
|
|
10
11
|
export declare const AutoSelectFreeSoloMultiple: Story<string, true, true>;
|
|
11
12
|
export declare const DefaultValue: Story;
|
|
12
13
|
export declare const ControlledSingleValue: Story;
|
|
13
14
|
export declare const Multiple: Story<(typeof fruits)[0], true>;
|
|
15
|
+
export declare const SelectAll: Story<(typeof fruits)[0], true>;
|
|
16
|
+
export declare const SelectAllWithDisabledOptions: Story<{
|
|
17
|
+
id: number;
|
|
18
|
+
label: string;
|
|
19
|
+
}, true>;
|
|
14
20
|
export declare const DefaultValueMultiple: Story<(typeof fruits)[0], true>;
|
|
21
|
+
export declare const LimitTags: Story<(typeof fruits)[0], true>;
|
|
22
|
+
export declare const LimitTagsCustomText: Story<(typeof fruits)[0], true>;
|
|
23
|
+
export declare const MaxRows: Story<(typeof fruits)[0], true>;
|
|
24
|
+
export declare const LimitTagsWithMaxRows: Story<(typeof fruits)[0], true>;
|
|
15
25
|
export declare const ControlledMultipleValue: Story<(typeof fruits)[0], true>;
|
|
16
26
|
export declare const Disabled: Story;
|
|
17
27
|
export declare const DisabledMultiple: Story<(typeof fruits)[0], true>;
|
|
@@ -49,6 +49,13 @@ export interface AutocompleteProps<AutocompleteOption extends NonNullable<unknow
|
|
|
49
49
|
* If `true`, the Autocomplete is free solo, meaning that the user input is not bound to provided options.
|
|
50
50
|
*/
|
|
51
51
|
freeSolo?: FreeSolo;
|
|
52
|
+
/**
|
|
53
|
+
* Customize the overflow text shown when tags are truncated by `limitTags`.
|
|
54
|
+
* @param more The number of hidden tags
|
|
55
|
+
* @returns Content to render as the overflow indicator
|
|
56
|
+
* @default (more) => `+${more}`
|
|
57
|
+
*/
|
|
58
|
+
getLimitTagsText?: (more: number) => ReactNode;
|
|
52
59
|
/**
|
|
53
60
|
* Used to determine if an option is disabled.
|
|
54
61
|
*/
|
|
@@ -81,6 +88,12 @@ export interface AutocompleteProps<AutocompleteOption extends NonNullable<unknow
|
|
|
81
88
|
* Icon or any element displayed at the start of the input.
|
|
82
89
|
*/
|
|
83
90
|
leftElement?: ReactNode;
|
|
91
|
+
/**
|
|
92
|
+
* The maximum number of tags visible when the popup is closed.
|
|
93
|
+
* Set to `-1` to show all tags. Only works when `multiple` is `true`.
|
|
94
|
+
* @default -1
|
|
95
|
+
*/
|
|
96
|
+
limitTags?: number;
|
|
84
97
|
/**
|
|
85
98
|
* If `true`, the component is in a loading state.
|
|
86
99
|
* @default false
|
|
@@ -91,6 +104,11 @@ export interface AutocompleteProps<AutocompleteOption extends NonNullable<unknow
|
|
|
91
104
|
* @default "Loading..."
|
|
92
105
|
*/
|
|
93
106
|
loadingText?: string;
|
|
107
|
+
/**
|
|
108
|
+
* The maximum number of visible tag rows before the tag area becomes scrollable while the popup is closed.
|
|
109
|
+
* Only works when `multiple` is `true`.
|
|
110
|
+
*/
|
|
111
|
+
maxRows?: number;
|
|
94
112
|
/**
|
|
95
113
|
* If `true`, the component allows multiple selections.
|
|
96
114
|
* @default false
|
|
@@ -179,12 +197,30 @@ export interface AutocompleteProps<AutocompleteOption extends NonNullable<unknow
|
|
|
179
197
|
* Icon or any element displayed at the end of the input, before the clear button and chevron.
|
|
180
198
|
*/
|
|
181
199
|
rightElement?: ReactNode;
|
|
200
|
+
/**
|
|
201
|
+
* If `true`, a "Select all" checkbox is shown at the top of the listbox
|
|
202
|
+
* that toggles all currently visible (filtered) enabled options.
|
|
203
|
+
* Only works when `multiple` is `true`.
|
|
204
|
+
* @default false
|
|
205
|
+
*/
|
|
206
|
+
selectAll?: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* The label for the select all checkbox.
|
|
209
|
+
* Only applicable when both `selectAll` and `multiple` are `true`.
|
|
210
|
+
* @default "Select all"
|
|
211
|
+
*/
|
|
212
|
+
selectAllLabel?: string;
|
|
182
213
|
/**
|
|
183
214
|
* The selected value.
|
|
184
215
|
* Set to `null` in case of single select and `[]` in case of multiple select to clear the selection.
|
|
185
216
|
* If the value is an object it must have reference equality with the option in order to be selected.
|
|
186
217
|
*/
|
|
187
218
|
value?: AutocompleteValue<AutocompleteOption, Multiple, FreeSolo>;
|
|
219
|
+
/**
|
|
220
|
+
* The width of the autocomplete input. Accepts any valid CSS width value.
|
|
221
|
+
* @example '100%', '400px', 'auto'
|
|
222
|
+
*/
|
|
223
|
+
width?: number | string;
|
|
188
224
|
}
|
|
189
225
|
export interface AutocompleteRenderGroupParams extends AutocompleteGroupedOption<object> {
|
|
190
226
|
children: ReactNode;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export type { PaginationProps } from './pagination
|
|
1
|
+
export { Pagination } from './pagination';
|
|
2
|
+
export type { PaginationProps } from './pagination';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
2
|
+
import { SEPARATOR } from '../pagination-config';
|
|
3
|
+
export type ItemsPerPageOptionsType = (number | {
|
|
3
4
|
label: string;
|
|
4
5
|
value: number;
|
|
5
|
-
}
|
|
6
|
-
export type PageNavigationItemsListType =
|
|
7
|
-
export type PageNavigationItemType =
|
|
6
|
+
})[];
|
|
7
|
+
export type PageNavigationItemsListType = PageNavigationItemType[];
|
|
8
|
+
export type PageNavigationItemType = number | typeof SEPARATOR;
|
|
8
9
|
export interface PaginationProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
10
|
/**
|
|
10
11
|
* Custom class name for the container of this component
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { ItemsPerPageOptionsType } from './pagination.types';
|
|
1
|
+
import { ItemsPerPageOptionsType } from './pagination/pagination.types';
|
|
2
2
|
export declare const DEFAULT_ITEMS_PER_PAGE_OPTIONS: ItemsPerPageOptionsType;
|
|
3
3
|
export declare const PAGINATION_PAGES_LIMIT = 9;
|
|
4
4
|
export declare const PAGINATION_PAGES_BUFFER = 2;
|
|
5
|
+
/** Separator string displayed between page numbers when truncating */
|
|
6
|
+
export declare const SEPARATOR = "...";
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { PaginationProps } from './pagination.types';
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PaginationProps } from './pagination/pagination.types';
|
|
2
|
+
/**
|
|
3
|
+
* Context value for Pagination components to share state
|
|
4
|
+
*/
|
|
5
|
+
export type PaginationContextValue = Pick<PaginationProps, 'count' | 'itemsPerPage' | 'itemsPerPageOptions' | 'onItemsPerPageChange' | 'onPageChange' | 'page'>;
|
|
6
|
+
declare const PaginationContext: import('react').Context<PaginationContextValue | null>;
|
|
7
|
+
export declare const usePaginationContext: () => null | PaginationContextValue;
|
|
4
8
|
export default PaginationContext;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PaginationItemsPerPageSelector } from './pagination-items-per-page-selector';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PaginationNavigation } from './pagination-navigation';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PageNavigationItemsListType } from '../pagination/pagination.types';
|
|
2
|
+
/**
|
|
3
|
+
* Generates an array of consecutive numbers starting from a given value
|
|
4
|
+
* @param from - The starting number
|
|
5
|
+
* @param count - How many numbers to generate
|
|
6
|
+
* @returns Array of numbers from `from` to `from + count - 1`
|
|
7
|
+
* @example range(5, 3) => [5, 6, 7]
|
|
8
|
+
*/
|
|
9
|
+
export declare const range: (from: number, count: number) => number[];
|
|
10
|
+
/**
|
|
11
|
+
* This function generates the pagination navigation links and separators.
|
|
12
|
+
* The output is an array of numbers and separators
|
|
13
|
+
* Eg., [1, 2, 3, 4, 5, 6, 7, '...', 10]
|
|
14
|
+
* @param currentPageIndex index of the current page
|
|
15
|
+
* @param totalPages total number of pages
|
|
16
|
+
*/
|
|
17
|
+
export declare const getNavItems: (currentPageIndex: number, totalPages: number) => PageNavigationItemsListType;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { PaginationNavigationItemProps } from './pagination-navigation-item.types';
|
|
3
|
+
declare const PaginationNavigationItem: {
|
|
4
|
+
(props: PaginationNavigationItemProps): ReactElement;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export { PaginationNavigationItem };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PageNavigationItemType } from '../pagination/pagination.types';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the PaginationNavigationItem component
|
|
4
|
+
*/
|
|
5
|
+
export interface PaginationNavigationItemProps {
|
|
6
|
+
/**
|
|
7
|
+
* The value to display - either a page number (0-based index) or separator string ('...')
|
|
8
|
+
*/
|
|
9
|
+
value: PageNavigationItemType;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PaginationSummary } from './pagination-summary';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export type {
|
|
1
|
+
export { Modal } from './modal';
|
|
2
|
+
export type { ModalProps, ModalWidth } from './modal';
|
|
3
|
+
export { ModalBody } from './modal-body';
|
|
4
|
+
export type { ModalBodyProps } from './modal-body';
|
|
5
|
+
export { ModalCloseButton } from './modal-close-button';
|
|
6
|
+
export type { ModalCloseButtonProps } from './modal-close-button';
|
|
7
|
+
export { ModalFooter } from './modal-footer';
|
|
8
|
+
export type { ModalFooterProps } from './modal-footer';
|
|
9
|
+
export { ModalFooterActions } from './modal-footer-actions';
|
|
10
|
+
export type { ModalFooterActionsProps } from './modal-footer-actions';
|
|
11
|
+
export { ModalHeader } from './modal-header';
|
|
12
|
+
export type { ModalHeaderProps } from './modal-header';
|
|
13
|
+
export { ModalHeaderTitle } from './modal-header-title';
|
|
14
|
+
export type { ModalHeaderTitleProps } from './modal-header-title';
|
|
@@ -1,29 +1,4 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
export interface ModalBodyProps {
|
|
3
|
-
/**
|
|
4
|
-
* The content to be rendered in the body section of the modal.
|
|
5
|
-
*/
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Custom css class name.
|
|
9
|
-
*/
|
|
10
|
-
className?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Padding around the content in the body of the modal.
|
|
13
|
-
* @default 'narrow'
|
|
14
|
-
*/
|
|
15
|
-
padding?: 'narrow' | 'none' | 'wide';
|
|
16
|
-
}
|
|
17
|
-
export interface ModalChildProps {
|
|
18
|
-
/**
|
|
19
|
-
* Children to be rendered inside the component
|
|
20
|
-
*/
|
|
21
|
-
children: ReactNode;
|
|
22
|
-
/**
|
|
23
|
-
* Custom css class name.
|
|
24
|
-
*/
|
|
25
|
-
className?: string;
|
|
26
|
-
}
|
|
27
2
|
export interface ModalProps {
|
|
28
3
|
/**
|
|
29
4
|
* The content inside the modal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModalBodyProps } from './modal.types';
|
|
1
|
+
import { ModalBodyProps } from './modal-body.types';
|
|
2
2
|
/**
|
|
3
3
|
* Modal body component is used to render the body section of the modal dialog.
|
|
4
4
|
* Use the `padding` prop to control the padding of the body section, the default is `narrow`.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* The content to be rendered in the body section of the modal.
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Custom css class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Padding around the content in the body of the modal.
|
|
13
|
+
* @default 'narrow'
|
|
14
|
+
*/
|
|
15
|
+
padding?: 'narrow' | 'none' | 'wide';
|
|
16
|
+
}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ButtonProps } from '../../buttons';
|
|
3
1
|
/**
|
|
4
2
|
* This button is a convenience component that applies the recommended styling for the Cancel button in the
|
|
5
3
|
* modal footer. It wraps the BrButton and sets the type to tertiary and attaches the Modal's onClose handler
|
|
6
4
|
* to the button's onClick event handler, so the developer does not have to manually attach the modal dialog close
|
|
7
5
|
* handler to the onClose handler of the Modal and again to the BrButton for the cancel button in the footer.
|
|
8
6
|
*/
|
|
9
|
-
declare
|
|
10
|
-
declare namespace ModalCloseButton {
|
|
11
|
-
var displayName: string;
|
|
12
|
-
}
|
|
7
|
+
declare const ModalCloseButton: import('react').ForwardRefExoticComponent<import('../../..').ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
13
8
|
export default ModalCloseButton;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
interface ModalContextValue {
|
|
2
|
+
onClose?: () => void;
|
|
3
|
+
}
|
|
4
|
+
declare const ModalContext: import('react').Context<ModalContextValue | null>;
|
|
5
|
+
export declare const useModalContext: () => ModalContextValue | null;
|
|
4
6
|
export default ModalContext;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalFooterProps } from './modal-footer.types';
|
|
2
2
|
/**
|
|
3
3
|
* Modal footer component is used to render the footer section of the modal dialog and it is recommended to use
|
|
4
4
|
* the `ModalFooterActions` component to render the actions in the footer section.
|
|
5
5
|
* All content inside the `ModalFooter` component is justified to the left. The `ModalFooterActions`
|
|
6
6
|
* component is justified to the right.
|
|
7
7
|
*/
|
|
8
|
-
declare const ModalFooter: import('react').ForwardRefExoticComponent<
|
|
8
|
+
declare const ModalFooter: import('react').ForwardRefExoticComponent<ModalFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
9
9
|
export default ModalFooter;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Children to be rendered inside the component
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Custom css class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalFooterActionsProps } from './modal-footer-actions.types';
|
|
2
2
|
/**
|
|
3
3
|
* Modal footer actions component is used to render the actions section of the modal dialog footer.
|
|
4
4
|
* You can use `ModalCloseButton` component to render the cancel button which is call `onClose` by default.
|
|
5
5
|
*/
|
|
6
|
-
declare const ModalFooterActions: import('react').ForwardRefExoticComponent<
|
|
6
|
+
declare const ModalFooterActions: import('react').ForwardRefExoticComponent<ModalFooterActionsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
7
|
export default ModalFooterActions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalFooterActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Children to be rendered inside the component
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Custom css class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalHeaderProps } from './modal-header.types';
|
|
2
2
|
/**
|
|
3
3
|
* Modal header component is used to render the header section of the modal dialog.
|
|
4
4
|
* If `onClose` is provided to the `Modal` component, then a close button is rendered in the header section.
|
|
5
5
|
* Use `ModalHeaderTitle` component to render the title in the header section.
|
|
6
6
|
*/
|
|
7
|
-
declare const ModalHeader: import('react').ForwardRefExoticComponent<
|
|
7
|
+
declare const ModalHeader: import('react').ForwardRefExoticComponent<ModalHeaderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
8
|
export default ModalHeader;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Children to be rendered inside the component
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Custom css class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalHeaderTitleProps } from './modal-header-title.types';
|
|
2
2
|
/**
|
|
3
3
|
* Modal header title is used to render the title in the header section of the modal dialog.
|
|
4
4
|
*/
|
|
5
|
-
declare const ModalHeaderTitle: import('react').ForwardRefExoticComponent<
|
|
5
|
+
declare const ModalHeaderTitle: import('react').ForwardRefExoticComponent<ModalHeaderTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export default ModalHeaderTitle;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ModalHeaderTitleProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/**
|
|
4
|
+
* Children to be rendered inside the component
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Custom css class name.
|
|
9
|
+
*/
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-vite';
|
|
2
|
+
import { ModalProps } from './modal';
|
|
2
3
|
import { Story } from './modal.stories';
|
|
3
|
-
import { ModalProps } from './modal.types';
|
|
4
4
|
declare const meta: Meta<ModalProps>;
|
|
5
5
|
export default meta;
|
|
6
6
|
export declare const Basic: Story;
|