@bloomreach/react-banana-ui 1.38.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.
Files changed (54) hide show
  1. package/dist/bloomreach-react-banana-ui.es.js +5071 -5032
  2. package/dist/bloomreach-react-banana-ui.es.js.map +1 -1
  3. package/dist/bloomreach-react-banana-ui.umd.js +13 -13
  4. package/dist/bloomreach-react-banana-ui.umd.js.map +1 -1
  5. package/dist/components/navigation/pagination/index.d.ts +2 -2
  6. package/dist/components/navigation/pagination/pagination/index.d.ts +2 -0
  7. package/dist/components/navigation/pagination/{pagination.types.d.ts → pagination/pagination.types.d.ts} +5 -4
  8. package/dist/components/navigation/pagination/pagination-config.d.ts +3 -1
  9. package/dist/components/navigation/pagination/pagination-context.d.ts +7 -3
  10. package/dist/components/navigation/pagination/pagination-items-per-page-selector/index.d.ts +1 -0
  11. package/dist/components/navigation/pagination/pagination-items-per-page-selector/pagination-items-per-page-selector.d.ts +6 -0
  12. package/dist/components/navigation/pagination/pagination-navigation/index.d.ts +1 -0
  13. package/dist/components/navigation/pagination/pagination-navigation/pagination-navigation-helpers.d.ts +17 -0
  14. package/dist/components/navigation/pagination/pagination-navigation/pagination-navigation.d.ts +6 -0
  15. package/dist/components/navigation/pagination/pagination-navigation-item/index.d.ts +2 -0
  16. package/dist/components/navigation/pagination/pagination-navigation-item/pagination-navigation-item.d.ts +7 -0
  17. package/dist/components/navigation/pagination/pagination-navigation-item/pagination-navigation-item.types.d.ts +10 -0
  18. package/dist/components/navigation/pagination/pagination-summary/index.d.ts +1 -0
  19. package/dist/components/navigation/pagination/pagination-summary/pagination-summary.d.ts +6 -0
  20. package/dist/components/navigation/pagination/pagination.qa.stories.d.ts +1 -1
  21. package/dist/components/navigation/pagination/pagination.stories.d.ts +1 -1
  22. package/dist/components/popovers/modal/index.d.ts +14 -8
  23. package/dist/components/popovers/modal/modal/index.d.ts +2 -0
  24. package/dist/components/popovers/modal/{modal.types.d.ts → modal/modal.types.d.ts} +0 -25
  25. package/dist/components/popovers/modal/modal-body/index.d.ts +2 -0
  26. package/dist/components/popovers/modal/{modal-body.d.ts → modal-body/modal-body.d.ts} +1 -1
  27. package/dist/components/popovers/modal/modal-body/modal-body.types.d.ts +16 -0
  28. package/dist/components/popovers/modal/modal-close-button/index.d.ts +2 -0
  29. package/dist/components/popovers/modal/{modal-close-button.d.ts → modal-close-button/modal-close-button.d.ts} +1 -6
  30. package/dist/components/popovers/modal/modal-close-button/modal-close-button.types.d.ts +2 -0
  31. package/dist/components/popovers/modal/modal-context.d.ts +5 -3
  32. package/dist/components/popovers/modal/modal-footer/index.d.ts +2 -0
  33. package/dist/components/popovers/modal/{modal-footer.d.ts → modal-footer/modal-footer.d.ts} +2 -2
  34. package/dist/components/popovers/modal/modal-footer/modal-footer.types.d.ts +11 -0
  35. package/dist/components/popovers/modal/modal-footer-actions/index.d.ts +2 -0
  36. package/dist/components/popovers/modal/{modal-footer-actions.d.ts → modal-footer-actions/modal-footer-actions.d.ts} +2 -2
  37. package/dist/components/popovers/modal/modal-footer-actions/modal-footer-actions.types.d.ts +11 -0
  38. package/dist/components/popovers/modal/modal-header/index.d.ts +2 -0
  39. package/dist/components/popovers/modal/{modal-header.d.ts → modal-header/modal-header.d.ts} +2 -2
  40. package/dist/components/popovers/modal/modal-header/modal-header.types.d.ts +11 -0
  41. package/dist/components/popovers/modal/modal-header-title/index.d.ts +2 -0
  42. package/dist/components/popovers/modal/{modal-header-title.d.ts → modal-header-title/modal-header-title.d.ts} +2 -2
  43. package/dist/components/popovers/modal/modal-header-title/modal-header-title.types.d.ts +11 -0
  44. package/dist/components/popovers/modal/modal.qa.stories.d.ts +1 -1
  45. package/dist/components/popovers/modal/modal.stories.d.ts +1 -1
  46. package/dist/react-banana-ui.css +1 -1
  47. package/package.json +1 -1
  48. package/dist/components/navigation/pagination/pagination-items-per-page-selector.d.ts +0 -1
  49. package/dist/components/navigation/pagination/pagination-navigation-helpers.d.ts +0 -11
  50. package/dist/components/navigation/pagination/pagination-navigation-item.d.ts +0 -5
  51. package/dist/components/navigation/pagination/pagination-navigation.d.ts +0 -1
  52. package/dist/components/navigation/pagination/pagination-summary.d.ts +0 -1
  53. /package/dist/components/navigation/pagination/{pagination.d.ts → pagination/pagination.d.ts} +0 -0
  54. /package/dist/components/popovers/modal/{modal.d.ts → modal/modal.d.ts} +0 -0
@@ -1,2 +1,2 @@
1
- export { default as Pagination } from './pagination';
2
- export type { PaginationProps } from './pagination.types';
1
+ export { Pagination } from './pagination';
2
+ export type { PaginationProps } from './pagination';
@@ -0,0 +1,2 @@
1
+ export { default as Pagination } from './pagination';
2
+ export type { ItemsPerPageOptionsType, PageNavigationItemsListType, PageNavigationItemType, PaginationProps, } from './pagination.types';
@@ -1,10 +1,11 @@
1
1
  import { HTMLAttributes } from 'react';
2
- export type ItemsPerPageOptionsType = Array<number | {
2
+ import { SEPARATOR } from '../pagination-config';
3
+ export type ItemsPerPageOptionsType = (number | {
3
4
  label: string;
4
5
  value: number;
5
- }>;
6
- export type PageNavigationItemsListType = Array<PageNavigationItemType>;
7
- export type PageNavigationItemType = '...' | number;
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
- declare const PaginationContext: import('react').Context<PaginationProps | null>;
3
- export declare function usePaginationContext(): null | PaginationProps;
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,6 @@
1
+ import { ReactElement } from 'react';
2
+ declare const PaginationItemsPerPageSelector: {
3
+ (): null | ReactElement;
4
+ displayName: string;
5
+ };
6
+ export { PaginationItemsPerPageSelector };
@@ -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,6 @@
1
+ import { ReactElement } from 'react';
2
+ declare const PaginationNavigation: {
3
+ (): null | ReactElement;
4
+ displayName: string;
5
+ };
6
+ export { PaginationNavigation };
@@ -0,0 +1,2 @@
1
+ export { PaginationNavigationItem } from './pagination-navigation-item';
2
+ export type { PaginationNavigationItemProps } from './pagination-navigation-item.types';
@@ -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';
@@ -0,0 +1,6 @@
1
+ import { ReactElement } from 'react';
2
+ declare const PaginationSummary: {
3
+ (): ReactElement;
4
+ displayName: string;
5
+ };
6
+ export { PaginationSummary };
@@ -1,4 +1,4 @@
1
- import { default as Pagination } from './pagination';
1
+ import { Pagination } from './pagination';
2
2
  import { Meta } from '@storybook/react-vite';
3
3
  import { Story } from './pagination.stories';
4
4
  declare const meta: Meta<typeof Pagination>;
@@ -1,4 +1,4 @@
1
- import { default as Pagination } from './pagination';
1
+ import { Pagination } from './pagination';
2
2
  import { Meta, StoryObj } from '@storybook/react-vite';
3
3
  declare const meta: Meta<typeof Pagination>;
4
4
  export default meta;
@@ -1,8 +1,14 @@
1
- export { default as Modal } from './modal';
2
- export { default as ModalBody } from './modal-body';
3
- export { default as ModalCloseButton } from './modal-close-button';
4
- export { default as ModalFooter } from './modal-footer';
5
- export { default as ModalFooterActions } from './modal-footer-actions';
6
- export { default as ModalHeader } from './modal-header';
7
- export { default as ModalHeaderTitle } from './modal-header-title';
8
- export type { ModalBodyProps, ModalChildProps, ModalProps } from './modal.types';
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';
@@ -0,0 +1,2 @@
1
+ export { default as Modal } from './modal';
2
+ export type { ModalProps, ModalWidth } from './modal.types';
@@ -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
@@ -0,0 +1,2 @@
1
+ export { default as ModalBody } from './modal-body';
2
+ export type { ModalBodyProps } from './modal-body.types';
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ModalCloseButton } from './modal-close-button';
2
+ export type { ModalCloseButtonProps } from './modal-close-button.types';
@@ -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 function ModalCloseButton(props: ButtonProps): ReactElement;
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;
@@ -0,0 +1,2 @@
1
+ import { ButtonProps } from '../../../buttons';
2
+ export type ModalCloseButtonProps = ButtonProps;
@@ -1,4 +1,6 @@
1
- import { ModalProps } from './modal.types';
2
- declare const ModalContext: import('react').Context<ModalProps | null>;
3
- export declare function useModalContext(): ModalProps | null;
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;
@@ -0,0 +1,2 @@
1
+ export { default as ModalFooter } from './modal-footer';
2
+ export type { ModalFooterProps } from './modal-footer.types';
@@ -1,9 +1,9 @@
1
- import { ModalChildProps } from './modal.types';
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<ModalChildProps & import('react').RefAttributes<HTMLDivElement>>;
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
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ModalFooterActions } from './modal-footer-actions';
2
+ export type { ModalFooterActionsProps } from './modal-footer-actions.types';
@@ -1,7 +1,7 @@
1
- import { ModalChildProps } from './modal.types';
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<ModalChildProps & import('react').RefAttributes<HTMLDivElement>>;
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
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ModalHeader } from './modal-header';
2
+ export type { ModalHeaderProps } from './modal-header.types';
@@ -1,8 +1,8 @@
1
- import { ModalChildProps } from './modal.types';
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<ModalChildProps & import('react').RefAttributes<HTMLDivElement>>;
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
+ }
@@ -0,0 +1,2 @@
1
+ export { default as ModalHeaderTitle } from './modal-header-title';
2
+ export type { ModalHeaderTitleProps } from './modal-header-title.types';
@@ -1,6 +1,6 @@
1
- import { ModalChildProps } from './modal.types';
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<ModalChildProps & import('react').RefAttributes<HTMLDivElement>>;
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;
@@ -1,5 +1,5 @@
1
1
  import { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ModalProps } from './modal.types';
2
+ import { ModalProps } from './modal';
3
3
  declare const meta: Meta<ModalProps>;
4
4
  export default meta;
5
5
  export type Story = StoryObj<ModalProps>;