@bloomreach/react-banana-ui 1.3.0 → 1.5.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 (67) hide show
  1. package/dist/bloomreach-react-banana-ui.es.js +5927 -4407
  2. package/dist/bloomreach-react-banana-ui.es.js.map +1 -1
  3. package/dist/bloomreach-react-banana-ui.umd.js +17 -14
  4. package/dist/bloomreach-react-banana-ui.umd.js.map +1 -1
  5. package/dist/components/buttons/button/button.d.ts +3 -2
  6. package/dist/components/buttons/button/button.stories.d.ts +1 -0
  7. package/dist/components/buttons/button-group/button-group.d.ts +1 -0
  8. package/dist/components/buttons/toggle-button/toggle-button.d.ts +1 -0
  9. package/dist/components/containers/dropdown/dropdown.d.ts +1 -0
  10. package/dist/components/containers/scroll-region/scroll-region.d.ts +1 -0
  11. package/dist/components/containers/scroll-view/scroll-view.d.ts +1 -0
  12. package/dist/components/dropdowns/index.d.ts +1 -0
  13. package/dist/components/dropdowns/menu/index.d.ts +13 -0
  14. package/dist/components/dropdowns/menu/menu/index.d.ts +2 -0
  15. package/dist/components/dropdowns/menu/menu/menu.d.ts +7 -0
  16. package/dist/components/dropdowns/menu/menu/menu.stories.d.ts +6 -0
  17. package/dist/components/dropdowns/menu/menu/menu.types.d.ts +11 -0
  18. package/dist/components/dropdowns/menu/menu-button/index.d.ts +2 -0
  19. package/dist/components/dropdowns/menu/menu-button/menu-button.d.ts +4 -0
  20. package/dist/components/dropdowns/menu/menu-button/menu-button.stories.d.ts +6 -0
  21. package/dist/components/dropdowns/menu/menu-button/menu-button.types.d.ts +3 -0
  22. package/dist/components/dropdowns/menu/menu-content/index.d.ts +2 -0
  23. package/dist/components/dropdowns/menu/menu-content/menu-content.d.ts +7 -0
  24. package/dist/components/dropdowns/menu/menu-content/menu-content.stories.d.ts +10 -0
  25. package/dist/components/dropdowns/menu/menu-content/menu-content.types.d.ts +12 -0
  26. package/dist/components/dropdowns/menu/menu-group/index.d.ts +2 -0
  27. package/dist/components/dropdowns/menu/menu-group/menu-group.d.ts +8 -0
  28. package/dist/components/dropdowns/menu/menu-group/menu-group.stories.d.ts +6 -0
  29. package/dist/components/dropdowns/menu/menu-group/menu-group.types.d.ts +6 -0
  30. package/dist/components/dropdowns/menu/menu-group-label/index.d.ts +2 -0
  31. package/dist/components/dropdowns/menu/menu-group-label/menu-group-label.d.ts +8 -0
  32. package/dist/components/dropdowns/menu/menu-group-label/menu-group-label.stories.d.ts +6 -0
  33. package/dist/components/dropdowns/menu/menu-group-label/menu-group-label.types.d.ts +6 -0
  34. package/dist/components/dropdowns/menu/menu-item/index.d.ts +2 -0
  35. package/dist/components/dropdowns/menu/menu-item/menu-item.d.ts +7 -0
  36. package/dist/components/dropdowns/menu/menu-item/menu-item.stories.d.ts +6 -0
  37. package/dist/components/dropdowns/menu/menu-item/menu-item.types.d.ts +20 -0
  38. package/dist/components/dropdowns/menu/menu-separator/index.d.ts +1 -0
  39. package/dist/components/dropdowns/menu/menu-separator/menu-separator.d.ts +7 -0
  40. package/dist/components/dropdowns/menu/menu-separator/menu-separator.stories.d.ts +6 -0
  41. package/dist/components/dropdowns/menu/menu.stories.d.ts +6 -0
  42. package/dist/components/feedback/alert/alert-title.d.ts +1 -0
  43. package/dist/components/feedback/alert/alert.d.ts +1 -0
  44. package/dist/components/index.d.ts +1 -0
  45. package/dist/components/inputs/base-field/base-field.d.ts +7 -4
  46. package/dist/components/inputs/base-input/base-input.d.ts +1 -0
  47. package/dist/components/inputs/field-label/field-label.d.ts +46 -0
  48. package/dist/components/inputs/field-label/index.d.ts +2 -0
  49. package/dist/components/inputs/index.d.ts +1 -0
  50. package/dist/components/inputs/internal.d.ts +2 -0
  51. package/dist/components/inputs/selection/selection.d.ts +1 -0
  52. package/dist/components/inputs/text-field/text-field.d.ts +1 -0
  53. package/dist/components/inputs/toggle/index.d.ts +2 -0
  54. package/dist/components/inputs/toggle/toggle.d.ts +57 -0
  55. package/dist/components/inputs/toggle-field/index.d.ts +2 -0
  56. package/dist/components/inputs/toggle-field/toggle-field.d.ts +43 -0
  57. package/dist/components/inputs/toggle-field/toggle-field.qa.stories.d.ts +5 -0
  58. package/dist/components/inputs/toggle-field/toggle-field.stories.d.ts +11 -0
  59. package/dist/components/lists/list-view/list-view.d.ts +1 -0
  60. package/dist/components/loaders/loader/loader.d.ts +1 -0
  61. package/dist/components/navigation/pagination/pagination.d.ts +1 -0
  62. package/dist/components/popovers/modal/modal-body.d.ts +1 -0
  63. package/dist/components/popovers/modal/modal.d.ts +1 -0
  64. package/dist/components/popovers/tooltip/tooltip.d.ts +1 -0
  65. package/dist/setupTests.d.ts +0 -0
  66. package/dist/style.css +1 -1
  67. package/package.json +37 -36
@@ -1,4 +1,5 @@
1
- import { ButtonHTMLAttributes, ReactNode, SyntheticEvent } from 'react';
1
+ import { ButtonHTMLAttributes, MouseEventHandler, ReactNode } from 'react';
2
+ import './button.scss';
2
3
  export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {
3
4
  /**
4
5
  * The content of the component.
@@ -40,7 +41,7 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
40
41
  /**
41
42
  * Callback fired when the component is clicked.
42
43
  */
43
- onClick?: (event: SyntheticEvent<HTMLButtonElement>) => void;
44
+ onClick?: MouseEventHandler<HTMLButtonElement>;
44
45
  /**
45
46
  * Icon displayed before the children.
46
47
  */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { Meta, StoryObj } from '@storybook/react';
2
3
  import { Button } from '..';
3
4
  declare const meta: Meta<typeof Button>;
@@ -1,5 +1,6 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { ButtonProps } from '../button/button';
3
+ import './button-group.scss';
3
4
  export interface ButtonGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
4
5
  /**
5
6
  * The content of the component.
@@ -1,5 +1,6 @@
1
1
  import { ReactElement, ForwardedRef, ReactNode, SyntheticEvent } from 'react';
2
2
  import { ButtonProps } from '../button/button';
3
+ import './toggle-button.scss';
3
4
  export interface ToggleButtonProps<T extends string | number = string> extends Omit<ButtonProps, 'onClick'> {
4
5
  /**
5
6
  * The content of the component.
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DOMRectBounds } from '../../../utils';
3
+ import './dropdown.scss';
3
4
  export interface IDropdown {
4
5
  /** Allows children */
5
6
  children?: React.ReactNode;
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DOMRectBounds, INestedChildren } from '../../../utils';
3
+ import './scroll-region.scss';
3
4
  export declare const ScrollRegionMode: {
4
5
  readonly LIGHT: "ScrollRegion--light";
5
6
  readonly DARK: "ScrollRegion--dark";
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DOMRectBounds, INestedChildren } from '../../../utils';
3
+ import './scroll-view.scss';
3
4
  export declare enum ScrollBarSide {
4
5
  RIGHT = 0,
5
6
  LEFT = 1
@@ -0,0 +1 @@
1
+ export * from './menu';
@@ -0,0 +1,13 @@
1
+ export { Menu } from './menu';
2
+ export { MenuButton } from './menu-button';
3
+ export { MenuContent } from './menu-content';
4
+ export { MenuGroup } from './menu-group';
5
+ export { MenuGroupLabel } from './menu-group-label';
6
+ export { MenuItem } from './menu-item';
7
+ export { MenuSeparator } from './menu-separator';
8
+ export type { MenuProps } from './menu';
9
+ export type { MenuButtonProps } from './menu-button';
10
+ export type { MenuContentProps } from './menu-content';
11
+ export type { MenuGroupProps } from './menu-group';
12
+ export type { MenuGroupLabelProps } from './menu-group-label';
13
+ export type { MenuItemProps } from './menu-item';
@@ -0,0 +1,2 @@
1
+ export { default as Menu } from './menu';
2
+ export type { MenuProps } from './menu.types';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { MenuProps } from './menu.types';
3
+ declare function Menu(props: React.PropsWithChildren<MenuProps>): JSX.Element;
4
+ declare namespace Menu {
5
+ var displayName: string;
6
+ }
7
+ export default Menu;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { Menu } from '..';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof Menu>;
6
+ export declare const MenuStory: Story;
@@ -0,0 +1,11 @@
1
+ import { SyntheticEvent } from 'react';
2
+ export interface MenuProps {
3
+ /**
4
+ * Allows to control whether the dropdown is open.
5
+ */
6
+ open?: boolean;
7
+ /**
8
+ * Callback fired when the component requests to be opened or closed.
9
+ */
10
+ onOpenChange?: (event: SyntheticEvent | null, open: boolean) => void;
11
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MenuButton } from './menu-button';
2
+ export type { MenuButtonProps } from './menu-button.types';
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import type { MenuButtonProps } from './menu-button.types';
3
+ declare const MenuButton: import("react").ForwardRefExoticComponent<MenuButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
4
+ export default MenuButton;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuButton from './menu-button';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuButton>;
6
+ export declare const MenuButtonStory: Story;
@@ -0,0 +1,3 @@
1
+ import type { ButtonProps } from '../../../buttons';
2
+ export interface MenuButtonProps extends ButtonProps {
3
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MenuContent } from './menu-content';
2
+ export type { MenuContentProps } from './menu-content.types';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { MenuContentProps } from './menu-content.types';
3
+ import './menu-content.scss';
4
+ declare const MenuContent: import("react").ForwardRefExoticComponent<MenuContentProps & {
5
+ children?: import("react").ReactNode;
6
+ } & import("react").RefAttributes<HTMLDivElement>>;
7
+ export default MenuContent;
@@ -0,0 +1,10 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuContent from './menu-content';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuContent>;
6
+ export declare const MenuContentStory: Story;
7
+ export declare const MenuContentTopPlacement: Story;
8
+ export declare const MenuContentRightPlacement: Story;
9
+ export declare const MenuContentBottomPlacement: Story;
10
+ export declare const MenuContentLeftPlacement: Story;
@@ -0,0 +1,12 @@
1
+ import { Placement } from '@floating-ui/react';
2
+ export interface MenuContentProps {
3
+ /**
4
+ * Custom class for the component
5
+ */
6
+ className?: string;
7
+ /**
8
+ * Placement position of the menu dropdownn wrt to trigger.
9
+ * @default 'bottom-end'
10
+ */
11
+ placement?: Placement;
12
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MenuGroup } from './menu-group';
2
+ export type { MenuGroupProps } from './menu-group.types';
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import type { MenuGroupProps } from './menu-group.types';
3
+ import './menu-group.scss';
4
+ declare function MenuGroup(props: PropsWithChildren<MenuGroupProps>): JSX.Element;
5
+ declare namespace MenuGroup {
6
+ var displayName: string;
7
+ }
8
+ export default MenuGroup;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuGroup from './menu-group';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuGroup>;
6
+ export declare const MenuGroupStory: Story;
@@ -0,0 +1,6 @@
1
+ export interface MenuGroupProps {
2
+ /**
3
+ * Custom class for the component
4
+ */
5
+ className?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MenuGroupLabel } from './menu-group-label';
2
+ export type { MenuGroupLabelProps } from './menu-group-label.types';
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import type { MenuGroupLabelProps } from './menu-group-label.types';
3
+ import './menu-group-label.scss';
4
+ declare function MenuGroupLabel(props: PropsWithChildren<MenuGroupLabelProps>): JSX.Element;
5
+ declare namespace MenuGroupLabel {
6
+ var displayName: string;
7
+ }
8
+ export default MenuGroupLabel;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuGroupLabel from './menu-group-label';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuGroupLabel>;
6
+ export declare const MenuGroupLabelStory: Story;
@@ -0,0 +1,6 @@
1
+ export interface MenuGroupLabelProps {
2
+ /**
3
+ * Custom class for the component
4
+ */
5
+ className?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { default as MenuItem } from './menu-item';
2
+ export type { MenuItemProps } from './menu-item.types';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import type { MenuItemProps } from './menu-item.types';
3
+ import './menu-item.scss';
4
+ declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & {
5
+ children?: import("react").ReactNode;
6
+ } & import("react").RefAttributes<HTMLUListElement>>;
7
+ export default MenuItem;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuItem from './menu-item';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuItem>;
6
+ export declare const MenuItemStory: Story;
@@ -0,0 +1,20 @@
1
+ import { MouseEventHandler, ReactNode } from 'react';
2
+ export interface MenuItemProps {
3
+ /**
4
+ * Custom class for the component
5
+ */
6
+ className?: string;
7
+ /**
8
+ * Event fired on click or selection of an item
9
+ */
10
+ onClick?: MouseEventHandler<HTMLElement>;
11
+ /**
12
+ * If `true`, the menu item will be disabled.
13
+ * @default false
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Icon displayed before the content
18
+ */
19
+ startIcon?: ReactNode;
20
+ }
@@ -0,0 +1 @@
1
+ export { default as MenuSeparator } from './menu-separator';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import './menu-separator.scss';
3
+ declare function MenuSeparator(): JSX.Element;
4
+ declare namespace MenuSeparator {
5
+ var displayName: string;
6
+ }
7
+ export default MenuSeparator;
@@ -0,0 +1,6 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import MenuSeparator from './menu-separator';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof MenuSeparator>;
6
+ export declare const MenuSeparatorStory: Story;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { Meta } from '@storybook/react';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare function SplitButton(): JSX.Element;
6
+ export declare function GlobalRankingRule(): JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import './alert-title.scss';
2
3
  export interface AlertTitleProps {
3
4
  /**
4
5
  * The content of the component.
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import './alert.scss';
2
3
  export type AlertType = 'error' | 'info' | 'success' | 'warning';
3
4
  export interface AlertProps {
4
5
  /**
@@ -1,4 +1,5 @@
1
1
  export * from './buttons';
2
+ export * from './dropdowns';
2
3
  export * from './feedback';
3
4
  export * from './foundations';
4
5
  export * from './inputs';
@@ -1,4 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
+ import './base-field.scss';
2
3
  export interface BaseFieldProps {
3
4
  /**
4
5
  * Custom class name for the container of this component.
@@ -8,10 +9,6 @@ export interface BaseFieldProps {
8
9
  * The control element to render as the main content of the field.
9
10
  */
10
11
  control: ReactNode;
11
- /**
12
- * The `id` of the `control` element to connect it with `label` in the field.
13
- */
14
- controlId: string;
15
12
  /**
16
13
  * If `true`, the field will indicate an error.
17
14
  */
@@ -28,6 +25,11 @@ export interface BaseFieldProps {
28
25
  * The label content.
29
26
  */
30
27
  label?: ReactNode;
28
+ /**
29
+ * The position of the label.
30
+ * @default 'block-start'
31
+ */
32
+ labelPosition?: 'block-start' | 'inline-start' | 'inline-end';
31
33
  /**
32
34
  * The metadata content.
33
35
  */
@@ -37,6 +39,7 @@ export interface BaseFieldProps {
37
39
  */
38
40
  tooltip?: ReactNode;
39
41
  }
42
+ export declare const getZeroSpace: () => JSX.Element;
40
43
  /**
41
44
  * @internal
42
45
  * Base component provides the layout for the field which includes:
@@ -1,4 +1,5 @@
1
1
  import React, { ChangeEventHandler, FocusEventHandler, InputHTMLAttributes, ReactNode } from 'react';
2
+ import './base-input.scss';
2
3
  export interface BaseInputProps {
3
4
  /**
4
5
  * Automatically adjusts textarea height to match the length of the content within.
@@ -0,0 +1,46 @@
1
+ import { ReactNode } from 'react';
2
+ import './field-label.scss';
3
+ export interface FieldLabelProps {
4
+ /**
5
+ * Custom class name for the container of the component.
6
+ */
7
+ className?: string;
8
+ /**
9
+ * The content of the component.
10
+ */
11
+ children: ReactNode;
12
+ /**
13
+ * The `id` of the element the label is associated with.
14
+ */
15
+ htmlFor?: string;
16
+ /**
17
+ * The size of the label.
18
+ * @default 'bold'
19
+ */
20
+ view?: 'normal' | 'bold';
21
+ }
22
+ /**
23
+ * @internal
24
+ * The `FieldLabel` component renders a label for a form field like `input`, `select`, `textarea`, etc.
25
+ * It has a default bold view and can be changed to a normal view for checkbox, radio or toggle fields.
26
+ * Internally used with the `BaseField` component to render a label for a field.
27
+ * Might be used as a standalone component for custom form fields, check the usage example.
28
+ *
29
+ * ### Usage
30
+ *
31
+ * ```tsx
32
+ * import { FieldLabel } from '@bloomreach/react-banana-ui';
33
+ * import { FieldInput } from '@bloomreach/react-banana-ui';
34
+ *
35
+ * export default function MyCustomLabel() {
36
+ * return (
37
+ * <>
38
+ * <FieldInput id="input" />
39
+ * <FieldLabel htmlFor="input">Write an example of component usage</FieldLabel>
40
+ * </>
41
+ * );
42
+ * }
43
+ * ```
44
+ */
45
+ declare const FieldLabel: import("react").ForwardRefExoticComponent<FieldLabelProps & import("react").RefAttributes<HTMLLabelElement>>;
46
+ export default FieldLabel;
@@ -0,0 +1,2 @@
1
+ export { default as FieldLabel } from './field-label';
2
+ export type { FieldLabelProps } from './field-label';
@@ -1,2 +1,3 @@
1
1
  export * from './input-field';
2
2
  export * from './text-field';
3
+ export * from './toggle-field';
@@ -1,2 +1,4 @@
1
1
  export * from './base-field';
2
2
  export * from './base-input';
3
+ export * from './field-label';
4
+ export * from './toggle';
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { DOMRectBounds, DOMRectPadding } from '../../../utils';
3
+ import './selection.scss';
3
4
  /**
4
5
  * Builds a selection's options from an object style enum.
5
6
  */
@@ -1,4 +1,5 @@
1
1
  import { ChangeEventHandler, FocusEventHandler, ReactNode, TextareaHTMLAttributes } from 'react';
2
+ import './text-field.scss';
2
3
  export interface TextFieldProps {
3
4
  /**
4
5
  * Automatically adjusts `textarea` height to match the length of the content within.
@@ -0,0 +1,2 @@
1
+ export { default as Toggle } from './toggle';
2
+ export type { ToggleProps } from './toggle';
@@ -0,0 +1,57 @@
1
+ /// <reference types="react" />
2
+ import './toggle.scss';
3
+ export interface ToggleProps {
4
+ /**
5
+ * If `true`, the toggle is checked.
6
+ */
7
+ checked?: boolean;
8
+ /**
9
+ * Custom class name for the container of the component.
10
+ */
11
+ className?: string;
12
+ /**
13
+ * The state of the toggle when it is initially rendered. Use when you do not need to control its state.
14
+ */
15
+ defaultChecked?: boolean;
16
+ /**
17
+ * When `true`, prevents the user from interacting with the switch.
18
+ */
19
+ disabled?: boolean;
20
+ /**
21
+ * The props applied to the input element.
22
+ */
23
+ inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
24
+ /**
25
+ * The `name` of the `input` element.
26
+ */
27
+ name?: string;
28
+ /**
29
+ * Callback fired when the state is changed.
30
+ */
31
+ onChange?: React.ChangeEventHandler<HTMLInputElement>;
32
+ /**
33
+ * If `true`, the component is read only and prevent user to change value.
34
+ */
35
+ readOnly?: boolean;
36
+ /**
37
+ * If `true`, the `input` element is required.
38
+ */
39
+ required?: boolean;
40
+ }
41
+ /**
42
+ * Toggle represents an action that changes a state by clicking on it.
43
+ * They are usually used for actions or options that have an immediate effect on the UI.
44
+ * They usually do not need to be confirmed or reviewed.
45
+ *
46
+ * ### Usage
47
+ *
48
+ * ```tsx
49
+ * import { Toggle } from '@bloomreach/react-banana-ui';
50
+ *
51
+ * export default function MyCustomToggle() {
52
+ * return <Toggle name="fieldName" />;
53
+ * }
54
+ * ```
55
+ */
56
+ declare const Toggle: import("react").ForwardRefExoticComponent<ToggleProps & import("react").RefAttributes<HTMLInputElement>>;
57
+ export default Toggle;
@@ -0,0 +1,2 @@
1
+ export { default as ToggleField } from './toggle-field';
2
+ export type { ToggleFieldProps } from './toggle-field';
@@ -0,0 +1,43 @@
1
+ import { ReactNode } from 'react';
2
+ import { ToggleProps } from '../../internal';
3
+ import './toggle-field.scss';
4
+ export interface ToggleFieldProps extends ToggleProps {
5
+ /**
6
+ * Custom class name for the container of the component.
7
+ */
8
+ className?: string;
9
+ /**
10
+ * The label content.
11
+ */
12
+ label?: ReactNode;
13
+ /**
14
+ * Tooltip to display when the field has label.
15
+ */
16
+ tooltip?: ReactNode;
17
+ }
18
+ /**
19
+ * The toggle field represents an action that changes a state by clicking on it.
20
+ * Usually used for actions or options that have an immediate effect on the UI and
21
+ * do not need to be confirmed or reviewed.
22
+ *
23
+ * ### Usage
24
+ *
25
+ * ```tsx
26
+ * import { ToggleField } from '@bloomreach/react-banana-ui';
27
+ * import { useState } from 'react';
28
+ *
29
+ * export default function AppTheme() {
30
+ * const [isDark, setIsDark] = useState(false);
31
+ *
32
+ * return (
33
+ * <ToggleField
34
+ * label="Dark mode"
35
+ * checked={isDark}
36
+ * onChange={() => setIsDark(!isDark)}
37
+ * />
38
+ * );
39
+ * }
40
+ * ```
41
+ */
42
+ declare const ToggleField: import("react").ForwardRefExoticComponent<ToggleFieldProps & import("react").RefAttributes<HTMLInputElement>>;
43
+ export default ToggleField;
@@ -0,0 +1,5 @@
1
+ import { Meta } from '@storybook/react';
2
+ import { type Story } from './toggle-field.stories';
3
+ declare const meta: Meta;
4
+ export default meta;
5
+ export declare const Basic: Story;
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import ToggleField from './toggle-field';
3
+ declare const meta: Meta<typeof ToggleField>;
4
+ export default meta;
5
+ export type Story = StoryObj<typeof ToggleField>;
6
+ export declare const Basic: Story;
7
+ export declare const WithTooltip: Story;
8
+ export declare const WithoutLabel: Story;
9
+ export declare const Controlled: Story;
10
+ export declare const Disabled: Story;
11
+ export declare const ReadOnly: Story;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import { DOMRectBounds, INestedChildren } from '../../../utils';
3
3
  import { ScrollRegion } from '../../containers/scroll-region/scroll-region';
4
4
  import { ScrollView } from '../../containers/scroll-view/scroll-view';
5
+ import './list-view.scss';
5
6
  export interface IRowProps {
6
7
  /** The index of the row to be rendered. */
7
8
  index: number;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import './loader.scss';
2
3
  export declare const LoaderSize: {
3
4
  readonly NORMAL: "Loader--medium";
4
5
  readonly SMALL: "Loader--small";
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { PaginationProps } from './pagination-types';
3
+ import './pagination.scss';
3
4
  /**
4
5
  * Pagination component to display pagination links and manage the number of items per page
5
6
  *
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ModalBodyProps } from './modal-types';
3
+ import './modal.scss';
3
4
  /**
4
5
  * Modal body component is used to render the body section of the modal dialog.
5
6
  * Use the `padding` prop to control the padding of the body section, the default is `narrow`.
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ModalProps } from './modal-types';
3
+ import './modal.scss';
3
4
  /**
4
5
  * Modal component lets you create dialogs that force the user to take action before continuing
5
6
  *
@@ -1,5 +1,6 @@
1
1
  import { Placement } from '@floating-ui/react';
2
2
  import React, { ReactNode, ReactElement, HTMLAttributes } from 'react';
3
+ import './tooltip.scss';
3
4
  export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
4
5
  /**
5
6
  * Custom class name for the tooltip container
File without changes