carbon-react 158.4.0 → 158.6.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 (83) hide show
  1. package/esm/components/alert/alert.component.d.ts +3 -0
  2. package/esm/components/alert/index.d.ts +5 -1
  3. package/esm/components/button-bar/button-bar.component.d.ts +6 -0
  4. package/esm/components/button-minor/button-minor.component.d.ts +6 -0
  5. package/esm/components/confirm/confirm.component.d.ts +6 -0
  6. package/esm/components/content/content.component.d.ts +6 -0
  7. package/esm/components/detail/detail.component.d.ts +6 -0
  8. package/esm/components/dismissible-box/dismissible-box.component.d.ts +6 -0
  9. package/esm/components/duelling-picklist/duelling-picklist.component.d.ts +6 -0
  10. package/esm/components/duelling-picklist/picklist/picklist.component.d.ts +6 -0
  11. package/esm/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +6 -0
  12. package/esm/components/duelling-picklist/picklist-group/picklist-group.component.d.ts +6 -0
  13. package/esm/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +6 -0
  14. package/esm/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.d.ts +6 -0
  15. package/esm/components/grid/grid-container/grid-container.component.d.ts +6 -0
  16. package/esm/components/grid/grid-item/grid-item.component.d.ts +6 -0
  17. package/esm/components/grouped-character/grouped-character.component.d.ts +9 -0
  18. package/esm/components/heading/heading.component.d.ts +9 -0
  19. package/esm/components/hr/hr.component.d.ts +6 -0
  20. package/esm/components/icon-button/icon-button.component.d.ts +6 -0
  21. package/esm/components/inline-inputs/inline-inputs.component.d.ts +6 -0
  22. package/esm/components/loader/loader.component.d.ts +6 -0
  23. package/esm/components/number/number.component.d.ts +6 -0
  24. package/esm/components/pages/page/page.component.d.ts +6 -0
  25. package/esm/components/pages/pages.component.d.ts +6 -0
  26. package/esm/components/pod/pod.component.d.ts +6 -0
  27. package/esm/components/search/search-button.style.js +1 -1
  28. package/esm/components/search/search.component.d.ts +2 -1
  29. package/esm/components/search/search.component.js +1 -1
  30. package/esm/components/search/search.style.js +1 -1
  31. package/esm/components/select/__internal__/select-list/select-list.component.js +1 -1
  32. package/esm/components/select/index.d.ts +1 -0
  33. package/esm/components/select/index.js +1 -1
  34. package/esm/components/select/setup-select-mocks.d.ts +5 -0
  35. package/esm/components/select/setup-select-mocks.js +1 -0
  36. package/esm/components/settings-row/settings-row.component.d.ts +6 -0
  37. package/esm/components/toast/toast.component.d.ts +15 -0
  38. package/esm/components/tooltip/tooltip.component.d.ts +9 -0
  39. package/esm/components/vertical-divider/vertical-divider.component.d.ts +9 -0
  40. package/esm/index.d.ts +1 -1
  41. package/esm/index.js +1 -1
  42. package/lib/components/alert/alert.component.d.ts +3 -0
  43. package/lib/components/alert/index.d.ts +5 -1
  44. package/lib/components/button-bar/button-bar.component.d.ts +6 -0
  45. package/lib/components/button-minor/button-minor.component.d.ts +6 -0
  46. package/lib/components/confirm/confirm.component.d.ts +6 -0
  47. package/lib/components/content/content.component.d.ts +6 -0
  48. package/lib/components/detail/detail.component.d.ts +6 -0
  49. package/lib/components/dismissible-box/dismissible-box.component.d.ts +6 -0
  50. package/lib/components/duelling-picklist/duelling-picklist.component.d.ts +6 -0
  51. package/lib/components/duelling-picklist/picklist/picklist.component.d.ts +6 -0
  52. package/lib/components/duelling-picklist/picklist-divider/picklist-divider.component.d.ts +6 -0
  53. package/lib/components/duelling-picklist/picklist-group/picklist-group.component.d.ts +6 -0
  54. package/lib/components/duelling-picklist/picklist-item/picklist-item.component.d.ts +6 -0
  55. package/lib/components/duelling-picklist/picklist-placeholder/picklist-placeholder.component.d.ts +6 -0
  56. package/lib/components/grid/grid-container/grid-container.component.d.ts +6 -0
  57. package/lib/components/grid/grid-item/grid-item.component.d.ts +6 -0
  58. package/lib/components/grouped-character/grouped-character.component.d.ts +9 -0
  59. package/lib/components/heading/heading.component.d.ts +9 -0
  60. package/lib/components/hr/hr.component.d.ts +6 -0
  61. package/lib/components/icon-button/icon-button.component.d.ts +6 -0
  62. package/lib/components/inline-inputs/inline-inputs.component.d.ts +6 -0
  63. package/lib/components/loader/loader.component.d.ts +6 -0
  64. package/lib/components/number/number.component.d.ts +6 -0
  65. package/lib/components/pages/page/page.component.d.ts +6 -0
  66. package/lib/components/pages/pages.component.d.ts +6 -0
  67. package/lib/components/pod/pod.component.d.ts +6 -0
  68. package/lib/components/search/search-button.style.js +1 -1
  69. package/lib/components/search/search.component.d.ts +2 -1
  70. package/lib/components/search/search.component.js +1 -1
  71. package/lib/components/search/search.style.js +1 -1
  72. package/lib/components/select/__internal__/select-list/select-list.component.js +1 -1
  73. package/lib/components/select/index.d.ts +1 -0
  74. package/lib/components/select/index.js +1 -1
  75. package/lib/components/select/setup-select-mocks.d.ts +5 -0
  76. package/lib/components/select/setup-select-mocks.js +1 -0
  77. package/lib/components/settings-row/settings-row.component.d.ts +6 -0
  78. package/lib/components/toast/toast.component.d.ts +15 -0
  79. package/lib/components/tooltip/tooltip.component.d.ts +9 -0
  80. package/lib/components/vertical-divider/vertical-divider.component.d.ts +9 -0
  81. package/lib/index.d.ts +1 -1
  82. package/lib/index.js +1 -1
  83. package/package.json +4 -2
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
2
  import { DialogProps } from "../dialog";
3
+ /**
4
+ * @deprecated Alert has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export declare const Alert: ({ children, size, topModalOverride, closeButtonDataProps, ...rest }: Omit<DialogProps, "data-component">) => React.JSX.Element;
4
7
  export default Alert;
@@ -1,2 +1,6 @@
1
1
  export { default } from "./alert.component";
2
- export type { DialogProps as AlertProps } from "../dialog";
2
+ export type {
3
+ /**
4
+ * @deprecated `Alert` has been deprecated. See the Carbon documentation for migration details.
5
+ */
6
+ DialogProps as AlertProps, } from "../dialog";
@@ -2,10 +2,16 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { ButtonBarContextProps } from "./__internal__/button-bar.context";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags";
5
+ /**
6
+ * @deprecated `ButtonBar` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface ButtonBarProps extends ButtonBarContextProps, SpaceProps, TagProps {
6
9
  /** Button or IconButton Elements, to be rendered inside the component */
7
10
  children: React.ReactNode;
8
11
  }
12
+ /**
13
+ * @deprecated `ButtonBar` has been deprecated. See the Carbon documentation for migration details.
14
+ */
9
15
  export declare const ButtonBar: {
10
16
  ({ children, size, iconPosition, fullWidth, ...rest }: ButtonBarProps): React.JSX.Element;
11
17
  displayName: string;
@@ -1,8 +1,14 @@
1
1
  import React from "react";
2
2
  import { ButtonProps } from "../button";
3
+ /**
4
+ * @deprecated `ButtonMinor` has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export interface ButtonMinorProps extends ButtonProps {
4
7
  /** @private @ignore */
5
8
  isInPassword?: boolean;
6
9
  }
10
+ /**
11
+ * @deprecated `ButtonMinor` has been deprecated. See the Carbon documentation for migration details.
12
+ */
7
13
  export declare const ButtonMinor: React.ForwardRefExoticComponent<ButtonMinorProps & React.RefAttributes<HTMLButtonElement>>;
8
14
  export default ButtonMinor;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { DialogProps } from "../dialog";
3
3
  import { IconType } from "../icon";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags";
5
+ /**
6
+ * @deprecated `Confirm` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface ConfirmProps extends Omit<DialogProps, "className" | "disableFocusTrap" | "bespokeFocusTrap" | "focusableSelectors" | "help" | "role" | "contentPadding" | "focusableContainers" | "ariaRole" | "timeout" | "enableBackgroundUI" | "disableClose" | "data-component"> {
6
9
  /** Color variants for new business themes: "primary" | "secondary" | "tertiary" | "darkBackground" */
7
10
  cancelButtonType?: "primary" | "secondary" | "tertiary" | "darkBackground";
@@ -38,5 +41,8 @@ export interface ConfirmProps extends Omit<DialogProps, "className" | "disableFo
38
41
  /** A custom event handler when a confirmation takes place */
39
42
  onConfirm: (ev: React.MouseEvent<HTMLButtonElement>) => void;
40
43
  }
44
+ /**
45
+ * @deprecated See the Carbon documentation for migration details.
46
+ */
41
47
  export declare const Confirm: ({ "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, "aria-label": ariaLabel, open, children, cancelButtonDestructive, confirmButtonDestructive, cancelButtonType, confirmButtonType, cancelButtonIconType, cancelButtonIconPosition, confirmButtonIconType, confirmButtonIconPosition, cancelButtonDataProps, confirmButtonDataProps, cancelLabel, onCancel, disableCancel, onConfirm, isLoadingConfirm, disableConfirm, confirmLabel, iconType, subtitle, title, size, showCloseIcon, topModalOverride, ...rest }: ConfirmProps) => React.JSX.Element;
42
48
  export default Confirm;
@@ -1,12 +1,18 @@
1
1
  import React from "react";
2
2
  import { StyledContentProps, StyledContentTitleProps, StyledContentBodyProps } from "./content.style";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
+ /**
5
+ * @deprecated `Content` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export interface ContentProps extends StyledContentProps, StyledContentTitleProps, StyledContentBodyProps, TagProps {
5
8
  /** The body of the content component */
6
9
  children?: React.ReactNode;
7
10
  /** The title of the content component */
8
11
  title?: React.ReactNode;
9
12
  }
13
+ /**
14
+ * @deprecated `Content` has been deprecated. See the Carbon documentation for migration details.
15
+ */
10
16
  export declare const Content: {
11
17
  ({ variant, children, title, inline, align, titleWidth, bodyFullWidth, ...rest }: ContentProps): React.JSX.Element;
12
18
  displayName: string;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { IconType } from "../icon";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
5
+ /**
6
+ * @deprecated `Detail` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface DetailProps extends MarginProps, TagProps {
6
9
  /**
7
10
  * @private
@@ -16,6 +19,9 @@ export interface DetailProps extends MarginProps, TagProps {
16
19
  /** The rendered children of the component. */
17
20
  children?: React.ReactNode;
18
21
  }
22
+ /**
23
+ * @deprecated `Detail` has been deprecated. See the Carbon documentation for migration details.
24
+ */
19
25
  export declare const Detail: {
20
26
  ({ className, icon, footnote, children, ...rest }: DetailProps): React.JSX.Element;
21
27
  displayName: string;
@@ -3,6 +3,9 @@ import { SpaceProps } from "styled-system";
3
3
  import { StyledDismissibleBoxProps } from "./dismissible-box.style";
4
4
  import { BoxProps } from "../box";
5
5
  import { TagProps } from "../../__internal__/utils/helpers/tags";
6
+ /**
7
+ * @deprecated `DimissibleBox` has been deprecated. See the Carbon documentation for migration details.
8
+ */
6
9
  export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxProps, Omit<BoxProps, "display" | "justifyContent" | "bg" | "backgroundColor">, TagProps {
7
10
  /** The content to render in the component */
8
11
  children?: React.ReactNode;
@@ -16,5 +19,8 @@ export interface DismissibleBoxProps extends SpaceProps, StyledDismissibleBoxPro
16
19
  * Please note this component has a minWidth of 600px */
17
20
  width?: number | string;
18
21
  }
22
+ /**
23
+ * @deprecated `DismissibleBox` has been deprecated. See the Carbon documentation for migration details.
24
+ */
19
25
  export declare const DismissibleBox: ({ children, closeButtonDataProps, onClose, borderRadius, ...rest }: DismissibleBoxProps) => React.JSX.Element;
20
26
  export default DismissibleBox;
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
+ /**
5
+ * @deprecated `DuellingPicklist` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export interface DuellingPicklistProps extends MarginProps, TagProps {
5
8
  /**
6
9
  * Content of the component, should contain two Picklist children
@@ -18,5 +21,8 @@ export interface DuellingPicklistProps extends MarginProps, TagProps {
18
21
  /** Right list label */
19
22
  rightLabel?: string;
20
23
  }
24
+ /**
25
+ * @deprecated `DuellingPicklist` has been deprecated. See the Carbon documentation for migration details.
26
+ */
21
27
  export declare const DuellingPicklist: ({ children, disabled, leftControls, rightControls, leftLabel, rightLabel, ...rest }: DuellingPicklistProps) => React.JSX.Element;
22
28
  export default DuellingPicklist;
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
+ /**
3
+ * @deprecated `Picklist` has been deprecated. See the Carbon documentation for migration details.
4
+ */
2
5
  export interface PicklistProps {
3
6
  /** List of PicklistItem elements */
4
7
  children?: React.ReactNode;
@@ -9,6 +12,9 @@ export interface PicklistProps {
9
12
  /** @private @ignore */
10
13
  index?: number;
11
14
  }
15
+ /**
16
+ * @deprecated `Picklist` has been deprecated. See the Carbon documentation for migration details.
17
+ */
12
18
  export declare const Picklist: {
13
19
  ({ disabled, children, placeholder, index, }: PicklistProps): React.JSX.Element;
14
20
  displayName: string;
@@ -1,5 +1,11 @@
1
1
  import React from "react";
2
2
  import { StyledComponentProps } from "styled-components";
3
+ /**
4
+ * @deprecated `PicklistDivider` has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export type PicklistDividerProps = StyledComponentProps<"div", Record<string, unknown>, Record<string, unknown>, "">;
7
+ /**
8
+ * @deprecated `PicklistDivider` has been deprecated. See the Carbon documentation for migration details.
9
+ */
4
10
  declare const PicklistDivider: (props: PicklistDividerProps) => React.JSX.Element;
5
11
  export default PicklistDivider;
@@ -1,4 +1,7 @@
1
1
  import React from "react";
2
+ /**
3
+ * @deprecated `PicklistGroup` has been deprecated. See the Carbon documentation for migration details.
4
+ */
2
5
  export interface PicklistGroupProps {
3
6
  /** Group title */
4
7
  title: React.ReactNode;
@@ -15,5 +18,8 @@ export interface PicklistGroupProps {
15
18
  /** @private @ignore */
16
19
  isLastGroup?: boolean;
17
20
  }
21
+ /**
22
+ * @deprecated `PicklistGroup` has been deprecated. See the Carbon documentation for migration details.
23
+ */
18
24
  export declare const PicklistGroup: React.ForwardRefExoticComponent<PicklistGroupProps & React.RefAttributes<HTMLButtonElement>>;
19
25
  export default PicklistGroup;
@@ -1,5 +1,8 @@
1
1
  import React from "react";
2
2
  type Item = Record<string, unknown> | string | number;
3
+ /**
4
+ * @deprecated `PicklistItem` has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export interface PicklistItemProps {
4
7
  /** Item content */
5
8
  children: React.ReactNode;
@@ -24,5 +27,8 @@ export interface PicklistItemProps {
24
27
  /** @private @ignore */
25
28
  isLastGroup?: boolean;
26
29
  }
30
+ /**
31
+ * @deprecated `PicklistItem` has been deprecated. See the Carbon documentation for migration details.
32
+ */
27
33
  export declare const PicklistItem: React.ForwardRefExoticComponent<PicklistItemProps & React.RefAttributes<HTMLButtonElement>>;
28
34
  export default PicklistItem;
@@ -1,7 +1,13 @@
1
1
  import React from "react";
2
+ /**
3
+ * @deprecated `PicklistPlaceholder` has been deprecated. See the Carbon documentation for migration details.
4
+ */
2
5
  export interface PicklistPlaceholderProps {
3
6
  /** Text to be displayed when list is empty */
4
7
  text: string;
5
8
  }
9
+ /**
10
+ * @deprecated `PicklistPlaceholder` has been deprecated. See the Carbon documentation for migration details.
11
+ */
6
12
  export declare const PicklistPlaceholder: ({ text }: PicklistPlaceholderProps) => React.JSX.Element;
7
13
  export default PicklistPlaceholder;
@@ -1,9 +1,15 @@
1
1
  import React from "react";
2
2
  import { SpaceProps, GridProps } from "styled-system";
3
3
  import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
4
+ /**
5
+ * @deprecated `GridContainer` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export interface GridContainerProps extends SpaceProps, GridProps, React.HTMLAttributes<HTMLDivElement>, TagProps {
5
8
  /** Defines the Components to be rendered within the GridContainer. Requires GridItemProps */
6
9
  children?: React.ReactNode;
7
10
  }
11
+ /**
12
+ * @deprecated `GridContainer` has been deprecated. See the Carbon documentation for migration details.
13
+ */
8
14
  export declare const GridContainer: (props: GridContainerProps) => React.JSX.Element;
9
15
  export default GridContainer;
@@ -1,10 +1,16 @@
1
1
  import React from "react";
2
2
  import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
3
3
  import { StyledGridItemProps } from "./grid-item.style";
4
+ /**
5
+ * @deprecated `GridItem` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export interface GridItemProps extends StyledGridItemProps, React.HTMLAttributes<HTMLDivElement>, TagProps {
5
8
  /** Defines the Component(s) to be rendered within the GridItem */
6
9
  children?: React.ReactNode;
7
10
  }
11
+ /**
12
+ * @deprecated `GridItem` has been deprecated. See the Carbon documentation for migration details.
13
+ */
8
14
  export declare const GridItem: {
9
15
  (props: GridItemProps): React.JSX.Element;
10
16
  displayName: string;
@@ -9,9 +9,15 @@ type CustomTarget = {
9
9
  id?: string;
10
10
  value: EventValue;
11
11
  };
12
+ /**
13
+ * @deprecated `GroupedCharacter` has been deprecated. See the Carbon documentation for migration details.
14
+ */
12
15
  export interface CustomEvent extends Omit<React.ChangeEvent<HTMLInputElement>, "target"> {
13
16
  target: CustomTarget;
14
17
  }
18
+ /**
19
+ * @deprecated `GroupedCharacter` has been deprecated. See the Carbon documentation for migration details.
20
+ */
15
21
  export interface GroupedCharacterProps extends Omit<TextboxProps, "onChange" | "onBlur" | "data-component"> {
16
22
  /** pattern by which input value should be grouped */
17
23
  groups: number[];
@@ -24,5 +30,8 @@ export interface GroupedCharacterProps extends Omit<TextboxProps, "onChange" | "
24
30
  /** Input value */
25
31
  value: string;
26
32
  }
33
+ /**
34
+ * @deprecated `GroupedCharacter` has been deprecated. See the Carbon documentation for migration details.
35
+ */
27
36
  export declare const GroupedCharacter: React.ForwardRefExoticComponent<GroupedCharacterProps & React.RefAttributes<HTMLInputElement>>;
28
37
  export default GroupedCharacter;
@@ -1,7 +1,13 @@
1
1
  import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
4
+ /**
5
+ * @deprecated `Heading` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export type HeadingType = "h1" | "h2" | "h3" | "h4" | "h5";
8
+ /**
9
+ * @deprecated `Heading` has been deprecated. See the Carbon documentation for migration details.
10
+ */
5
11
  export interface HeadingProps extends MarginProps, TagProps {
6
12
  /** Child elements */
7
13
  children?: React.ReactNode;
@@ -30,5 +36,8 @@ export interface HeadingProps extends MarginProps, TagProps {
30
36
  /** Aria label for rendered help component */
31
37
  helpAriaLabel?: string;
32
38
  }
39
+ /**
40
+ * @deprecated `Heading` has been deprecated. See the Carbon documentation for migration details.
41
+ */
33
42
  export declare const Heading: ({ children, backLink, divider, help, helpAriaLabel, helpLink, pills, separator, subheader, subtitleId, headingType, title, titleId, ...rest }: HeadingProps) => React.JSX.Element | null;
34
43
  export default Heading;
@@ -1,5 +1,8 @@
1
1
  import { MarginProps } from "styled-system";
2
2
  import { TagProps } from "../../__internal__/utils/helpers/tags";
3
+ /**
4
+ * @deprecated `Hr` has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export interface HrProps extends MarginProps, TagProps {
4
7
  /** Set whether the component should be recognised by assistive technologies */
5
8
  "aria-hidden"?: "true" | "false";
@@ -11,5 +14,8 @@ export interface HrProps extends MarginProps, TagProps {
11
14
  /** Set the color variant of the horizontal rule. Use "typical" for standard styling or "inverse" for use in darker backgrounds */
12
15
  type?: "typical" | "inverse";
13
16
  }
17
+ /**
18
+ * @deprecated `Hr` has been deprecated. See the Carbon documentation for migration details.
19
+ */
14
20
  export declare const Hr: ({ adaptiveMxBreakpoint, ml, mr, "aria-hidden": ariaHidden, type, height, ...rest }: HrProps) => JSX.Element;
15
21
  export default Hr;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  import { IconProps } from "../icon";
5
+ /**
6
+ * @deprecated `IconButton` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface IconButtonProps extends SpaceProps, TagProps {
6
9
  /** Prop to specify the aria-label of the icon-button component */
7
10
  "aria-label"?: string;
@@ -22,5 +25,8 @@ export interface IconButtonProps extends SpaceProps, TagProps {
22
25
  /** @private @internal @ignore */
23
26
  "data-component"?: string;
24
27
  }
28
+ /**
29
+ * @deprecated `IconButton` has been deprecated. See the Carbon documentation for migration details.
30
+ */
25
31
  declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLButtonElement>>;
26
32
  export default IconButton;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { StyledContentContainerProps, StyledInlineInputsProps } from "./inline-inputs.style";
4
4
  import { TagProps } from "../../__internal__/utils/helpers/tags";
5
+ /**
6
+ * @deprecated `InlineInputs` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface InlineInputsProps extends MarginProps, StyledContentContainerProps, StyledInlineInputsProps, TagProps {
6
9
  /** Breakpoint for adaptive label (inline label change to top aligned). Enables the adaptive behaviour when set */
7
10
  adaptiveLabelBreakpoint?: number;
@@ -27,6 +30,9 @@ export interface InlineInputsProps extends MarginProps, StyledContentContainerPr
27
30
  /** Flag to configure component as mandatory. */
28
31
  required?: boolean;
29
32
  }
33
+ /**
34
+ * @deprecated `InlineInputs` has been deprecated. See the Carbon documentation for migration details.
35
+ */
30
36
  declare const InlineInputs: {
31
37
  ({ adaptiveLabelBreakpoint, label, labelAlign, labelId, htmlFor, children, gutter, inputWidth, labelInline, labelWidth, required, ...rest }: InlineInputsProps): React.JSX.Element;
32
38
  displayName: string;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
4
4
  import { StyledLoaderSquareProps } from "./loader-square.style";
5
+ /**
6
+ * @deprecated `Loader` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface LoaderProps extends Omit<StyledLoaderSquareProps, "backgroundColor">, MarginProps, TagProps {
6
9
  /** Toggle between the default variant and gradient variant */
7
10
  variant?: string;
@@ -11,5 +14,8 @@ export interface LoaderProps extends Omit<StyledLoaderSquareProps, "backgroundCo
11
14
  */
12
15
  loaderLabel?: string;
13
16
  }
17
+ /**
18
+ * @deprecated `Loader` has been deprecated. See the Carbon documentation for migration details.
19
+ */
14
20
  export declare const Loader: ({ variant, size, isInsideButton, isActive, loaderLabel, ...rest }: LoaderProps) => React.JSX.Element;
15
21
  export default Loader;
@@ -1,8 +1,14 @@
1
1
  import React from "react";
2
2
  import { TextboxProps } from "../textbox";
3
+ /**
4
+ * @deprecated `Number` has been deprecated. See the Carbon documentation for migration details.
5
+ */
3
6
  export interface NumberProps extends Omit<TextboxProps, "value"> {
4
7
  /** Value passed to the input */
5
8
  value: string;
6
9
  }
10
+ /**
11
+ * @deprecated `Number` has been deprecated. See the Carbon documentation for migration details.
12
+ */
7
13
  export declare const Number: React.ForwardRefExoticComponent<NumberProps & React.RefAttributes<HTMLInputElement>>;
8
14
  export default Number;
@@ -1,6 +1,9 @@
1
1
  import React from "react";
2
2
  import { PaddingProps } from "styled-system";
3
3
  import { TagProps } from "../../../__internal__/utils/helpers/tags/tags";
4
+ /**
5
+ * @deprecated `Page` has been deprecated. See the Carbon documentation for migration details.
6
+ */
4
7
  export interface PageProps extends PaddingProps, TagProps {
5
8
  /** The title for the page, normally a Heading component. */
6
9
  title?: React.ReactNode;
@@ -11,6 +14,9 @@ export interface PageProps extends PaddingProps, TagProps {
11
14
  /** @ignore @private */
12
15
  transitionName?: () => string;
13
16
  }
17
+ /**
18
+ * @deprecated `Page` has been deprecated. See the Carbon documentation for migration details.
19
+ */
14
20
  declare const Page: {
15
21
  ({ role, title, children, ...rest }: PageProps): React.JSX.Element;
16
22
  displayName: string;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { TagProps } from "../../__internal__/utils/helpers/tags/tags";
3
3
  import Page from "./page";
4
4
  import type { ThemeObject } from "../../style/themes/theme.types";
5
+ /**
6
+ * @deprecated `Pages` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface PagesProps extends TagProps {
6
9
  /** The selected tab on page load */
7
10
  initialpageIndex?: number | string;
@@ -14,6 +17,9 @@ export interface PagesProps extends TagProps {
14
17
  /** @ignore @private */
15
18
  theme?: Partial<ThemeObject>;
16
19
  }
20
+ /**
21
+ * @deprecated `Pages` has been deprecated. See the Carbon documentation for migration details.
22
+ */
17
23
  declare const Pages: {
18
24
  ({ pageIndex: incomingPageIndex, initialpageIndex, transition, children, ...props }: PagesProps): React.JSX.Element;
19
25
  displayName: string;
@@ -2,6 +2,9 @@ import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
4
  import { PodAlignment, PodSize, PodVariant } from "./pod.config";
5
+ /**
6
+ * @deprecated `Pod` has been deprecated. See the Carbon documentation for migration details.
7
+ */
5
8
  export interface PodProps extends MarginProps, TagProps {
6
9
  /** Aligns the title to left, right or center */
7
10
  alignTitle?: PodAlignment;
@@ -38,5 +41,8 @@ export interface PodProps extends MarginProps, TagProps {
38
41
  /** Renders edit button inside the pod if it exists. */
39
42
  internalEditButton?: boolean;
40
43
  }
44
+ /**
45
+ * @deprecated `Pod` has been deprecated. See the Carbon documentation for migration details.
46
+ */
41
47
  declare const Pod: React.ForwardRefExoticComponent<PodProps & React.RefAttributes<HTMLDivElement>>;
42
48
  export default Pod;
@@ -1 +1 @@
1
- import o from"styled-components";import r from"../button/button.style.js";import t from"../icon/icon.style.js";import e from"../../style/themes/apply-base-theme.js";const a=o.div.withConfig({displayName:"search-button.style__StyledButtonIcon",componentId:"sc-e747d4c-0"})(["&&& ","{color:var(--colorsActionMajorYang100);margin-right:0px;}"],t),n=o.div.attrs(e).withConfig({displayName:"search-button.style__StyledSearchButton",componentId:"sc-e747d4c-1"})(["display:inline-flex;border-bottom:none;& ","{color:var(--colorsActionMajorYang100);border-color:var(--colorsActionMajorTransparent);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);border-bottom-right-radius:var(--borderRadius050);border-top-right-radius:var(--borderRadius050);:hover{border-color:var(--colorsActionMajorTransparent);}width:fit-content;","","{color:var(--colorsActionMajorYang100);}margin:0px 0px;padding-bottom:3px;:focus{z-index:",";}}"],r,t,t,(({theme:o})=>o.zIndex.smallOverlay));export{a as StyledButtonIcon,n as default};
1
+ import o from"styled-components";import r from"../button/button.style.js";import t from"../icon/icon.style.js";import e from"../../style/themes/apply-base-theme.js";const a=o.div.withConfig({displayName:"search-button.style__StyledButtonIcon",componentId:"sc-52ea0e19-0"})(["&&& ","{color:var(--colorsActionMajorYang100);margin-right:0px;}"],t),n=o.div.attrs(e).withConfig({displayName:"search-button.style__StyledSearchButton",componentId:"sc-52ea0e19-1"})(["display:flex;align-self:end;border-bottom:none;& ","{color:var(--colorsActionMajorYang100);border-color:var(--colorsActionMajorTransparent);border-bottom-left-radius:var(--borderRadius000);border-top-left-radius:var(--borderRadius000);border-bottom-right-radius:var(--borderRadius050);border-top-right-radius:var(--borderRadius050);:hover{border-color:var(--colorsActionMajorTransparent);}width:fit-content;","","{color:var(--colorsActionMajorYang100);}margin:0px 0px;padding-bottom:3px;:focus{z-index:",";}}"],r,t,t,(({theme:o})=>o.zIndex.smallOverlay));export{a as StyledButtonIcon,n as default};
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { MarginProps } from "styled-system";
3
3
  import { TagProps } from "../../__internal__/utils/helpers/tags";
4
+ import { CommonTextboxProps } from "../textbox";
4
5
  import { ValidationProps } from "../../__internal__/validations";
5
6
  export interface SearchEvent {
6
7
  target: {
@@ -9,7 +10,7 @@ export interface SearchEvent {
9
10
  value: string;
10
11
  };
11
12
  }
12
- export interface SearchProps extends ValidationProps, MarginProps, TagProps {
13
+ export interface SearchProps extends ValidationProps, MarginProps, TagProps, Pick<CommonTextboxProps, "label" | "inputHint"> {
13
14
  /** Prop to specify the aria-label of the search component */
14
15
  "aria-label"?: string;
15
16
  /** Prop to specify the aria-label of the search button */
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useImperativeHandle as o,useState as i}from"react";import a from"invariant";import l from"../../__internal__/utils/helpers/tags/tags.js";import"../../style/utils/filter-styled-system-padding-props.js";import s from"../../style/utils/filter-styled-system-margin-props.js";import c from"./search.style.js";import u from"./search-button.style.js";import p from"../icon/icon.component.js";import{Textbox as f}from"../textbox/textbox.component.js";import m from"../button/button.component.js";import h from"../../hooks/__internal__/useLocale/useLocale.js";import b from"../../__internal__/utils/helpers/events/events.js";function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const O=r.forwardRef(((r,y)=>{var{onChange:O,onClick:v,onFocus:j,onBlur:w,onKeyDown:P,value:x,id:_,name:C,searchWidth:k,maxWidth:B,searchButton:D,searchButtonAriaLabel:S,placeholder:I,variant:W="default","aria-label":T="search",tabIndex:E,error:F,warning:K,info:L,tooltipPosition:A,triggerOnClear:z}=r,H=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,["onChange","onClick","onFocus","onBlur","onKeyDown","value","id","name","searchWidth","maxWidth","searchButton","searchButtonAriaLabel","placeholder","variant","aria-label","tabIndex","error","warning","info","tooltipPosition","triggerOnClear"]);const M=h(),N=n(null),R=n(null);o(y,(()=>({focus(){var e;null===(e=R.current)||void 0===e||e.focus()}})),[]),a("string"==typeof x,"This component has no initial value");const[V,q]=i(!1),G=0===x.length;let J={};D&&v&&(J={onClick:()=>{v({target:{name:C,id:_,value:x}})}});const Q="string"==typeof D?D:M.search.searchButtonText(),U=!!(null==x?void 0:x.length);return e(c,g(d(g(d({ref:N,isFocused:V,searchWidth:k,maxWidth:B,searchHasValue:U,showSearchButton:!!D,variant:W},s(H)),{id:_,name:C}),H,l("search",H)),{children:[t(f,{placeholder:I,value:x,inputIcon:G?void 0:"cross",iconTabIndex:G?-1:0,iconOnClick:()=>{var e;null==O||O({target:g(d({},C&&{name:C},_&&{id:_}),{value:""})}),z&&(null==v||v({target:g(d({},C&&{name:C},_&&{id:_}),{value:""})})),null===(e=R.current)||void 0===e||e.focus()},iconOnMouseDown:e=>{e.preventDefault()},"aria-label":T,onFocus:e=>{q(!0),j&&j(e)},onBlur:e=>{q(!1),w&&w(e)},onChange:e=>{O(e)},onKeyDown:e=>{1===e.key.length&&e.stopPropagation(),b.isEscKey(e)&&!G&&(e.stopPropagation(),null==O||O({target:g(d({},C&&{name:C},_&&{id:_}),{value:""})})),P&&P(e)},ref:R,tabIndex:E,error:F,warning:K,info:L,leftChildren:D?void 0:t(p,{type:"search",ml:1}),tooltipPosition:A,my:0}),D&&t(u,{children:t(m,g(d({"aria-label":S||Q,size:"medium",px:2,buttonType:"primary",iconPosition:"before",iconType:"search",className:"search-button"},J),{children:Q}))})]}))}));export{O as Search,O as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{useRef as n,useImperativeHandle as o,useState as i}from"react";import a from"invariant";import l from"../../__internal__/utils/helpers/tags/tags.js";import"../../style/utils/filter-styled-system-padding-props.js";import s from"../../style/utils/filter-styled-system-margin-props.js";import c from"./search.style.js";import u from"./search-button.style.js";import p from"../icon/icon.component.js";import{Textbox as f}from"../textbox/textbox.component.js";import m from"../button/button.component.js";import b from"../../hooks/__internal__/useLocale/useLocale.js";import h from"../../__internal__/utils/helpers/events/events.js";function y(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){y(e,t,r[t])}))}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const O=r.forwardRef(((r,y)=>{var{onChange:O,onClick:v,onFocus:j,onBlur:w,onKeyDown:P,value:x,id:_,name:B,label:C,inputHint:k,searchWidth:D,maxWidth:S,searchButton:I,searchButtonAriaLabel:T,placeholder:W,variant:E="default","aria-label":F,tabIndex:H,error:K,warning:L,info:A,tooltipPosition:z,triggerOnClear:M}=r,N=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(r,["onChange","onClick","onFocus","onBlur","onKeyDown","value","id","name","label","inputHint","searchWidth","maxWidth","searchButton","searchButtonAriaLabel","placeholder","variant","aria-label","tabIndex","error","warning","info","tooltipPosition","triggerOnClear"]);const R=b(),V=n(null),q=n(null);o(y,(()=>({focus(){var e;null===(e=q.current)||void 0===e||e.focus()}})),[]),a("string"==typeof x,"This component has no initial value");const[G,J]=i(!1),Q=0===x.length;let U={};I&&v&&(U={onClick:()=>{v({target:{name:B,id:_,value:x}})}});const X="string"==typeof I?I:R.search.searchButtonText(),Y=!!(null==x?void 0:x.length);return e(c,g(d(g(d({ref:V,isFocused:G,searchWidth:D,maxWidth:S,searchHasValue:Y,showSearchButton:!!I,variant:E},s(N)),{id:_,name:B}),N,l("search",N)),{children:[t(f,{placeholder:W,value:x,inputIcon:Q?void 0:"cross",iconTabIndex:Q?-1:0,iconOnClick:()=>{var e;null==O||O({target:g(d({},B&&{name:B},_&&{id:_}),{value:""})}),M&&(null==v||v({target:g(d({},B&&{name:B},_&&{id:_}),{value:""})})),null===(e=q.current)||void 0===e||e.focus()},iconOnMouseDown:e=>{e.preventDefault()},"aria-label":F||(C?void 0:R.search.searchButtonText()),label:C,inputHint:k,onFocus:e=>{J(!0),j&&j(e)},onBlur:e=>{J(!1),w&&w(e)},onChange:e=>{O(e)},onKeyDown:e=>{1===e.key.length&&e.stopPropagation(),h.isEscKey(e)&&!Q&&(e.stopPropagation(),null==O||O({target:g(d({},B&&{name:B},_&&{id:_}),{value:""})})),P&&P(e)},ref:q,tabIndex:H,error:K,warning:L,info:A,leftChildren:I?void 0:t(p,{type:"search",ml:1}),tooltipPosition:z,my:0}),I&&t(u,{children:t(m,g(d({"aria-label":T||X,size:"medium",px:2,buttonType:"primary",iconPosition:"before",iconType:"search",className:"search-button"},U),{children:X}))})]}))}));export{O as Search,O as default};
@@ -1 +1 @@
1
- import{margin as o}from"styled-system";import r,{css as t}from"styled-components";import a from"../../__internal__/input-icon-toggle/input-icon-toggle.style.js";import i from"../../__internal__/input/input-presentation.style.js";import l from"../../__internal__/input/input.style.js";import e from"../icon/icon.style.js";import n from"../../style/themes/apply-base-theme.js";import s from"../../__internal__/form-field/form-field.style.js";const c=r.div.attrs(n).withConfig({displayName:"search.style__StyledSearch",componentId:"sc-f5d4c4a7-0"})(["",""],(({isFocused:r,searchWidth:n,maxWidth:c,searchHasValue:d,showSearchButton:p,theme:m,variant:v})=>{const g="dark"===v;return t(["margin-bottom:var(--fieldSpacing);"," width:",";max-width:",";padding-bottom:var(--spacing025);background-color:transparent;display:inline-flex;font-size:var(--fontSize100);font-weight:500;"," ","{::-moz-placeholder{color:var(--colorsUtilityYin055);opacity:1;}::placeholder{color:var(--colorsUtilityYin055);}"," ","}",'{[data-element="search"]{height:auto;'," ","}"," "," "," flex:1;font-size:var(--fontSize100);font-weight:500;padding-bottom:var(--spacing025);padding-top:1px;cursor:pointer;"," ","}","{flex:1;z-index:",";}",'{:not([data-element="search"]){'," ","}cursor:pointer;}","{","}"],o,n?`${n}`:"100%",c?`${c}`:"100%",!p&&t(["border-bottom:var(--spacing025) solid ",";:hover{border-bottom-color:",";cursor:pointer;}",""],g?"var(--colorsUtilityYang080)":"var(--colorsUtilityMajor300)",g?"var(--colorsUtilityYang100)":"var(--colorsUtilityMajor400)",(d||r)&&t(["border-bottom-color:transparent;:hover{border-bottom-color:transparent;cursor:default;}"])),l,g&&t(["::-moz-placeholder{color:var(--colorsUtilityYang080);opacity:1;}::placeholder{color:var(--colorsUtilityYang080);}"]),g&&d&&!p&&t(["color:var(--colorsUtilityYang100);"]),i,!g&&t(["color:var(--colorsUtilityYin065);:hover{color:var(--colorsUtilityYin100);}"]),g&&t(["color:var(--colorsUtilityYang080);:hover{color:var(--colorsUtilityYang100);}"]),g&&!p&&t(["background-color:transparent;border-color:var(--colorsUtilityYang080);"]),!g&&t(["background-color:",";"],d||r||p?"var(--colorsUtilityYang100)":"transparent"),p&&t(["border-top-right-radius:var(--borderRadius000);border-bottom-right-radius:var(--borderRadius000);"]),!r&&!d&&!p&&t(["border:1px solid transparent;"]),!r&&d&&!p&&t(["background-color:",";"],g?"transparent":"var(--colorsUtilityYang100)"),s,m.zIndex.smallOverlay,e,g&&!p&&t(["color:var(--colorsUtilityYang080);:hover{color:var(--colorsUtilityYang100);}"]),!g&&t(["color:var(--colorsActionMinor500);:hover{color:var(--colorsActionMinor600);}"]),a,d&&t(["margin-bottom:-1px;"]))}));export{c as default};
1
+ import{margin as o}from"styled-system";import r,{css as t}from"styled-components";import a from"../../__internal__/input-icon-toggle/input-icon-toggle.style.js";import i from"../../__internal__/input/input-presentation.style.js";import l from"../../__internal__/input/input.style.js";import e from"../icon/icon.style.js";import n from"../../style/themes/apply-base-theme.js";import s from"../../__internal__/form-field/form-field.style.js";const c=r.div.attrs(n).withConfig({displayName:"search.style__StyledSearch",componentId:"sc-e6eafad8-0"})(["",""],(({isFocused:r,searchWidth:n,maxWidth:c,searchHasValue:d,showSearchButton:p,theme:m,variant:v})=>{const y="dark"===v;return t(["margin-bottom:var(--fieldSpacing);"," width:",";max-width:",";padding-bottom:var(--spacing025);background-color:transparent;display:inline-flex;font-size:var(--fontSize100);"," ","{::-moz-placeholder{color:var(--colorsUtilityYin055);opacity:1;}::placeholder{color:var(--colorsUtilityYin055);}"," ","}",'{[data-element="search"]{height:auto;'," ","}"," "," "," flex:1;font-size:var(--fontSize100);font-weight:500;padding-bottom:var(--spacing025);padding-top:1px;cursor:pointer;"," ","}","{flex:1;z-index:",";}",'{:not([data-element="search"]){'," ","}cursor:pointer;}","{","}"],o,n?`${n}`:"100%",c?`${c}`:"100%",!p&&t(["border-bottom:var(--spacing025) solid ",";:hover{border-bottom-color:",";cursor:pointer;}",""],y?"var(--colorsUtilityYang080)":"var(--colorsUtilityMajor300)",y?"var(--colorsUtilityYang100)":"var(--colorsUtilityMajor400)",(d||r)&&t(["border-bottom-color:transparent;:hover{border-bottom-color:transparent;cursor:default;}"])),l,y&&t(["::-moz-placeholder{color:var(--colorsUtilityYang080);opacity:1;}::placeholder{color:var(--colorsUtilityYang080);}"]),y&&d&&!p&&t(["color:var(--colorsUtilityYang100);"]),i,!y&&t(["color:var(--colorsUtilityYin065);:hover{color:var(--colorsUtilityYin100);}"]),y&&t(["color:var(--colorsUtilityYang080);:hover{color:var(--colorsUtilityYang100);}"]),y&&!p&&t(["background-color:transparent;border-color:var(--colorsUtilityYang080);"]),!y&&t(["background-color:",";"],d||r||p?"var(--colorsUtilityYang100)":"transparent"),p&&t(["border-top-right-radius:var(--borderRadius000);border-bottom-right-radius:var(--borderRadius000);"]),!r&&!d&&!p&&t(["border:1px solid transparent;"]),!r&&d&&!p&&t(["background-color:",";"],y?"transparent":"var(--colorsUtilityYang100)"),s,m.zIndex.smallOverlay,e,y&&!p&&t(["color:var(--colorsUtilityYang080);:hover{color:var(--colorsUtilityYang100);}"]),!y&&t(["color:var(--colorsActionMinor500);:hover{color:var(--colorsActionMinor600);}"]),a,d&&t(["margin-bottom:-1px;"]))}));export{c as default};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import n,{useState as r,useRef as l,useEffect as o,useMemo as i,useCallback as s,useLayoutEffect as c}from"react";import{offset as a,size as u,flip as d}from"@floating-ui/dom";import{useVirtualizer as p,defaultRangeExtractor as m}from"@tanstack/react-virtual";import f from"lodash/findLastIndex";import v from"lodash/debounce";import b from"../../../../hooks/__internal__/useScrollBlock/useScrollBlock.js";import y from"../../../../hooks/__internal__/useModalManager/useModalManager.js";import{StyledSelectListTable as h,StyledSelectListTableHeader as g,StyledSelectListTableBody as O,StyledSelectListContainer as x,StyledScrollableContainer as j,StyledSelectList as w,StyledSelectLoaderContainer as E}from"./select-list.style.js";import S from"../../../../__internal__/popover/popover.component.js";import k from"../../option-row/option-row.component.js";import P from"../utils/get-next-child-by-text.js";import L from"../utils/get-next-index-by-key.js";import T from"../utils/is-navigation-key.js";import C from"../list-action-button/list-action-button.component.js";import{Loader as V}from"../../../loader/loader.component.js";import I from"../../option/option.component.js";import _ from"./select-list.context.js";function B(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){B(e,t,n[t])}))}return e}function A(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const M={behavior:"auto",align:"end"},D=n.forwardRef(((B,D)=>{var{listMaxHeight:W=180,listActionButton:z,id:K,labelId:R,children:$,onSelect:F,onSelectListClose:N,filterText:U,anchorElement:Y,highlightedValue:q,onListAction:G,isLoading:J,onListScrollBottom:Q,multiColumn:X,tableHeader:Z,listPlacement:ee="bottom",flipEnabled:te=!0,isOpen:ne,multiselectValues:re,enableVirtualScroll:le,virtualScrollOverscan:oe=5,listWidth:ie}=B,se=function(e,t){if(null==e)return{};var n,r,l=function(e,t){if(null==e)return{};var n,r,l={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}(B,["listMaxHeight","listActionButton","id","labelId","children","onSelect","onSelectListClose","filterText","anchorElement","highlightedValue","onListAction","isLoading","onListScrollBottom","multiColumn","tableHeader","listPlacement","flipEnabled","isOpen","multiselectValues","enableVirtualScroll","virtualScrollOverscan","listWidth"]);const[ce,ae]=r(-1),[ue,de]=r(0),pe=l(""),me=l(null),fe=l(null),ve=l(null),be=l(null),{blockScroll:ye,allowScroll:he}=b(),ge=l(0),Oe=le?oe:n.Children.count($),xe=p({count:n.Children.count($),getScrollElement:()=>ne?D.current:null,estimateSize:()=>40,overscan:Oe,paddingStart:X?48:0,scrollPaddingEnd:ge.current,rangeExtractor:e=>{const t=m(e);return-1===ce||t.includes(ce)||t.push(ce),t}});o((()=>{if(!ne)return;const e=ce>-1?ce:0;xe.scrollToIndex(e,M)}),[ce,ne,xe]);const je=xe.getVirtualItems(),we=i((()=>n.Children.toArray($)),[$]),Ee=s((e=>we.findIndex((t=>{return t.props.value&&"object"==typeof e?(r=t.props.value,l=e,Object.keys(r).every((e=>r[e]===l[e]))):n.isValidElement(t)&&t.props.value===e;var r,l}))),[we]);if(0===je.length){const e=q?Ee(q):ce;e>-1&&je.push({index:e})}const Se=xe.getTotalSize(),ke=0===Se?1:Se;o((()=>(ne&&ye(),()=>{ne&&he()})),[he,ye,ne]),c((()=>{X&&de(fe.current?fe.current.offsetWidth-fe.current.clientWidth:0)}),[X]);const Pe=i((()=>({current:Y||null})),[Y]),Le=s((e=>{var t,n,r;F({id:null!==(t=e.id)&&void 0!==t?t:"",text:null!==(n=e.text)&&void 0!==n?n:"",value:null!==(r=e.value)&&void 0!==r?r:"",selectionType:"click",selectionConfirmed:!0})}),[F]),Te=l(Array.from({length:n.Children.count($)})),Ce=i((()=>we.filter((e=>n.isValidElement(e)&&(e.type===I||e.type===k)))),[we]),{measureElement:Ve}=xe,Ie=je.filter((e=>void 0!==e)).map((({index:e,start:t})=>{const r=we[e],l=Ce.indexOf(r),o=l>-1,i={index:e,onSelect:Le,hidden:J&&1===we.length,style:{transform:`translateY(${t}px)`},"aria-setsize":o?Ce.length:void 0,"aria-posinset":o?l+1:void 0,ref:t=>{ne&&Ve(t),Te.current[e]=t},"data-index":e};return void 0!==r?n.cloneElement(r,i):null})).filter((e=>null!==e)),_e=f(we,(e=>n.isValidElement(e)&&(e.type===I||e.type===k))),Be=s(((e,t)=>{if(-1===_e)return-1;let r=L(e,t,_e,J);const l=we[r];return(n.isValidElement(l)&&l.type!==I&&l.type!==k||l.props.disabled)&&(r=Be(e,r)),r}),[we,_e,J]),He=s((e=>{var t;let n=ce;q&&(n=Ee(q));const r=Be(e,n);if(-1===r||n===r)return;const{text:l,value:o}=we[r].props;F({id:null===(t=Te.current[r])||void 0===t?void 0:t.id,text:null!=l?l:"",value:null!=o?o:"",selectionType:"navigationKey",selectionConfirmed:!1})}),[we,ce,Ee,Be,q,F]),Ae=s(((e,t)=>{var n;t?N():(e.preventDefault(),null===(n=be.current)||void 0===n||n.focus())}),[N]),Me=s((()=>{Y&&Y.getElementsByTagName("input")[0].focus()}),[Y]),De=s((e=>{if(!ne)return;const{key:t}=e,r=document.activeElement===be.current;if("Tab"===t&&z)Ae(e,r);else if("Tab"===t)N();else if("Enter"!==t||r)T(t)&&(Me(),He(t));else{var l;e.preventDefault();const t=we[ce];if(!n.isValidElement(t))return N(),void F({id:"",text:"",value:"",selectionType:"enterKey",selectionConfirmed:!1});if(t.props.disabled)return;const{text:r,value:o}=t.props;F({id:null===(l=Te.current[ce])||void 0===l?void 0:l.id,text:null!=r?r:"",value:null!=o?o:"",selectionType:"enterKey",selectionConfirmed:!0})}}),[we,z,Ae,N,ce,F,He,Me,ne]),We=s((e=>{"Escape"===e.key&&N()}),[N]);y({open:!!ne,closeModal:We,modalRef:me,triggerRefocusOnClose:!1}),o((()=>{const e=D.current,t=v((e=>{const t=e.target;ne&&t.scrollHeight-t.scrollTop===t.clientHeight&&(null==Q||Q())}),300);return null==e||e.addEventListener("scroll",t),()=>{null==e||e.removeEventListener("scroll",t)}}),[ne,D,Q]),o((()=>(window.addEventListener("keydown",De),function(){window.removeEventListener("keydown",De)})),[De,D]),o((()=>{U&&U!==pe.current?(pe.current=U,ae((e=>{const t=P(U,we,e);if(!t)return-1;const n=Ee(t.props.value);return xe.scrollToIndex(n,M),n}))):pe.current=U||""}),[we,U,Ee,xe]),o((()=>{if(!(q&&0!==Object.keys(q).length||ne))return void ae(-1);const e=Ee(q);-1!==e&&ae(e)}),[Ee,q,ne]),o((()=>{J&&ce===_e&&_e>-1&&xe.scrollToIndex(_e,A(H({},M),{align:"start"}))}),[$,ce,J,_e,D,xe]);const ze=i((()=>[a(3),u({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${null!=ie?ie:e.reference.width}px`})}}),...te?[d({fallbackStrategy:"initialPlacement"})]:[]]),[ie,te]),Ke=J?t(E,{children:t(V,{"data-role":"select-list-loader"})},"loader"):void 0;let Re=Ie;const $e={role:"listbox",id:K,"aria-labelledby":R,"aria-multiselectable":!!re||void 0};return c((()=>{var e,t;z&&ne&&(ge.current=(null===(t=be.current)||void 0===t||null===(e=t.parentElement)||void 0===e?void 0:e.offsetHeight)||0)}),[z,ne]),X&&(Re=e(h,{children:[t(g,{scrollbarWidth:ue,children:Z}),t(O,A(H({},$e),{"aria-labelledby":R,ref:fe,listHeight:ke-48,children:Ie}))]})),t(_.Provider,{value:{currentOptionsListIndex:ce,multiselectValues:re},children:t(S,{placement:ee,disablePortal:!0,reference:Pe,middleware:ze,isOpen:ne,disableBackgroundUI:!0,animationFrame:!0,children:e(x,A(H({ref:ve,"data-element":"select-list-wrapper","data-role":"select-list-wrapper",isLoading:J},se),{children:[e(j,{ref:D,maxHeight:W,"data-component":"select-list-scrollable-container","data-role":"select-list-scrollable-container",hasActionButton:!!z,children:[t(w,A(H({as:X?"div":"ul","data-element":"select-list"},X?{}:$e),{ref:me,tabIndex:-1,listHeight:X?void 0:ke,children:Re})),Ke]}),z&&t(C,{ref:be,listActionButton:z,onListAction:G})]}))})})}));export{D as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import l,{useState as n,useRef as r,useEffect as o,useMemo as i,useCallback as s,useLayoutEffect as c}from"react";import{offset as a,size as u,flip as d}from"@floating-ui/dom";import{useVirtualizer as p,defaultRangeExtractor as m}from"@tanstack/react-virtual";import f from"lodash/findLastIndex";import v from"lodash/debounce";import b from"../../../../hooks/__internal__/useScrollBlock/useScrollBlock.js";import y from"../../../../hooks/__internal__/useModalManager/useModalManager.js";import{StyledSelectListTable as h,StyledSelectListTableHeader as g,StyledSelectListTableBody as O,StyledSelectListContainer as x,StyledScrollableContainer as j,StyledSelectList as w,StyledSelectLoaderContainer as E}from"./select-list.style.js";import S from"../../../../__internal__/popover/popover.component.js";import k from"../../option-row/option-row.component.js";import P from"../utils/get-next-child-by-text.js";import L from"../utils/get-next-index-by-key.js";import T from"../utils/is-navigation-key.js";import C from"../list-action-button/list-action-button.component.js";import{Loader as V}from"../../../loader/loader.component.js";import I from"../../option/option.component.js";import _ from"./select-list.context.js";function B(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function H(e){for(var t=1;t<arguments.length;t++){var l=null!=arguments[t]?arguments[t]:{},n=Object.keys(l);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(l).filter((function(e){return Object.getOwnPropertyDescriptor(l,e).enumerable})))),n.forEach((function(t){B(e,t,l[t])}))}return e}function A(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);t.push.apply(t,l)}return t}(Object(t)).forEach((function(l){Object.defineProperty(e,l,Object.getOwnPropertyDescriptor(t,l))})),e}const M={behavior:"auto",align:"end"},D=l.forwardRef(((B,D)=>{var{listMaxHeight:W=180,listActionButton:z,id:K,labelId:R,children:$,onSelect:F,onSelectListClose:N,filterText:U,anchorElement:Y,highlightedValue:q,onListAction:G,isLoading:J,onListScrollBottom:Q,multiColumn:X,tableHeader:Z,listPlacement:ee="bottom",flipEnabled:te=!0,isOpen:le,multiselectValues:ne,enableVirtualScroll:re,virtualScrollOverscan:oe=5,listWidth:ie}=B,se=function(e,t){if(null==e)return{};var l,n,r=function(e,t){if(null==e)return{};var l,n,r={},o=Object.keys(e);for(n=0;n<o.length;n++)l=o[n],t.indexOf(l)>=0||(r[l]=e[l]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)l=o[n],t.indexOf(l)>=0||Object.prototype.propertyIsEnumerable.call(e,l)&&(r[l]=e[l])}return r}(B,["listMaxHeight","listActionButton","id","labelId","children","onSelect","onSelectListClose","filterText","anchorElement","highlightedValue","onListAction","isLoading","onListScrollBottom","multiColumn","tableHeader","listPlacement","flipEnabled","isOpen","multiselectValues","enableVirtualScroll","virtualScrollOverscan","listWidth"]);const[ce,ae]=n(-1),[ue,de]=n(0),pe=r(""),me=r(null),fe=r(null),ve=r(null),be=r(null),{blockScroll:ye,allowScroll:he}=b(),ge=r(0),Oe=re?oe:l.Children.count($),xe=p({count:l.Children.count($),getScrollElement:()=>le?D.current:null,estimateSize:()=>40,overscan:Oe,paddingStart:X?48:0,scrollPaddingEnd:ge.current,rangeExtractor:e=>{const t=m(e);return-1===ce||t.includes(ce)||t.push(ce),t}});o((()=>{if(!le)return;const e=ce>-1?ce:0;xe.scrollToIndex(e,M)}),[ce,le,xe]);const je=xe.getVirtualItems(),we=i((()=>l.Children.toArray($)),[$]),Ee=s((e=>we.findIndex((t=>{return t.props.value&&"object"==typeof e?(n=t.props.value,r=e,Object.keys(n).every((e=>n[e]===r[e]))):l.isValidElement(t)&&t.props.value===e;var n,r}))),[we]);if(0===je.length){const e=q?Ee(q):ce;e>-1&&je.push({index:e})}const Se=xe.getTotalSize(),ke=0===Se?1:Se;o((()=>(le&&ye(),()=>{le&&he()})),[he,ye,le]),c((()=>{X&&de(fe.current?fe.current.offsetWidth-fe.current.clientWidth:0)}),[X]);const Pe=i((()=>({current:Y||null})),[Y]),Le=s((e=>{var t,l,n;F({id:null!==(t=e.id)&&void 0!==t?t:"",text:null!==(l=e.text)&&void 0!==l?l:"",value:null!==(n=e.value)&&void 0!==n?n:"",selectionType:"click",selectionConfirmed:!0})}),[F]),Te=r(Array.from({length:l.Children.count($)})),Ce=i((()=>we.filter((e=>l.isValidElement(e)&&(e.type===I||e.type===k)))),[we]),{measureElement:Ve}=xe,Ie=je.filter((e=>void 0!==e)).map((({index:e,start:t})=>{const n=we[e],r=Ce.indexOf(n),o=r>-1,i={index:e,onSelect:Le,hidden:J&&1===we.length,style:{transform:`translateY(${t}px)`},"aria-setsize":o?Ce.length:void 0,"aria-posinset":o?r+1:void 0,ref:t=>{le&&Ve(t),Te.current[e]=t},"data-index":e};return void 0!==n?l.cloneElement(n,i):null})).filter((e=>null!==e)),_e=f(we,(e=>l.isValidElement(e)&&(e.type===I||e.type===k))),Be=s(((e,t)=>{if(-1===_e)return-1;let n=L(e,t,_e,J);const r=we[n];return(l.isValidElement(r)&&r.type!==I&&r.type!==k||r.props.disabled)&&(n=Be(e,n)),n}),[we,_e,J]),He=s((e=>{var t;let l=ce;q&&(l=Ee(q));const n=Be(e,l);if(-1===n||l===n)return;const{text:r,value:o}=we[n].props;F({id:null===(t=Te.current[n])||void 0===t?void 0:t.id,text:null!=r?r:"",value:null!=o?o:"",selectionType:"navigationKey",selectionConfirmed:!1})}),[we,ce,Ee,Be,q,F]),Ae=s(((e,t)=>{var l;t?N():(e.preventDefault(),null===(l=be.current)||void 0===l||l.focus())}),[N]),Me=s((()=>{Y&&Y.getElementsByTagName("input")[0].focus()}),[Y]),De=s((e=>{if(!le)return;const{key:t}=e,n=document.activeElement===be.current;if("Tab"===t&&z)Ae(e,n);else if("Tab"===t)N();else if("Enter"!==t||n)T(t)&&(Me(),He(t));else{var r;e.preventDefault();const t=we[ce];if(!l.isValidElement(t))return N(),void F({id:"",text:"",value:"",selectionType:"enterKey",selectionConfirmed:!1});if(t.props.disabled)return;const{text:n,value:o}=t.props;F({id:null===(r=Te.current[ce])||void 0===r?void 0:r.id,text:null!=n?n:"",value:null!=o?o:"",selectionType:"enterKey",selectionConfirmed:!0})}}),[we,z,Ae,N,ce,F,He,Me,le]),We=s((e=>{"Escape"===e.key&&N()}),[N]);y({open:!!le,closeModal:We,modalRef:me,triggerRefocusOnClose:!1}),o((()=>{const e=D.current,t=v((e=>{const t=e.target;le&&t.scrollHeight-t.scrollTop===t.clientHeight&&(null==Q||Q())}),300);return null==e||e.addEventListener("scroll",t),()=>{null==e||e.removeEventListener("scroll",t)}}),[le,D,Q]),o((()=>(window.addEventListener("keydown",De),function(){window.removeEventListener("keydown",De)})),[De,D]),o((()=>{U&&U!==pe.current?(pe.current=U,ae((e=>{const t=P(U,we,e);if(!t)return-1;const l=Ee(t.props.value);return xe.scrollToIndex(l,M),l}))):pe.current=U||""}),[we,U,Ee,xe]),o((()=>{if(!(q&&0!==Object.keys(q).length||le))return void ae(-1);const e=Ee(q);-1!==e&&ae(e)}),[Ee,q,le]),o((()=>{J&&ce===_e&&_e>-1&&xe.scrollToIndex(_e,A(H({},M),{align:"start"}))}),[$,ce,J,_e,D,xe]);const ze=i((()=>[a(3),u({apply({rects:e,elements:t}){Object.assign(t.floating.style,{width:`${null!=ie?ie:e.reference.width}px`})}}),...te?[d({fallbackStrategy:"initialPlacement"})]:[]]),[ie,te]),Ke=J?t(E,{children:t(V,{"data-role":"select-list-loader"})},"loader"):void 0;let Re=Ie;const $e={role:"listbox",id:K,"aria-labelledby":R,"aria-multiselectable":!!ne||void 0};return c((()=>{var e,t;z&&le&&(ge.current=(null===(t=be.current)||void 0===t||null===(e=t.parentElement)||void 0===e?void 0:e.offsetHeight)||0)}),[z,le]),X&&(Re=e(h,{children:[t(g,{scrollbarWidth:ue,children:Z}),t(O,A(H({},$e),{"aria-labelledby":R,ref:fe,listHeight:ke-48,children:Ie}))]})),t(_.Provider,{value:{currentOptionsListIndex:ce,multiselectValues:ne},children:t(S,{placement:ee,disablePortal:!0,reference:Pe,middleware:ze,isOpen:le,disableBackgroundUI:!0,animationFrame:!0,children:e(x,A(H({ref:ve,"data-element":"select-list-wrapper","data-role":"select-list-wrapper",isLoading:J},se),{children:[e(j,{ref:D,maxHeight:W,"data-component":"select-list-scrollable-container","data-element":"select-list-scrollable-container","data-role":"select-list-scrollable-container",hasActionButton:!!z,children:[t(w,A(H({as:X?"div":"ul","data-element":"select-list"},X?{}:$e),{ref:me,tabIndex:-1,listHeight:X?void 0:ke,children:Re})),Ke]}),z&&t(C,{ref:be,listActionButton:z,onListAction:G})]}))})})}));export{D as default};
@@ -10,3 +10,4 @@ export { default as FilterableSelect } from "./filterable-select";
10
10
  export type { FilterableSelectProps } from "./filterable-select";
11
11
  export { default as MultiSelect } from "./multi-select";
12
12
  export type { MultiSelectProps } from "./multi-select";
13
+ export { default as setupSelectMocks } from "./setup-select-mocks";
@@ -1 +1 @@
1
- export{default as Option}from"./option/option.component.js";export{default as OptionRow}from"./option-row/option-row.component.js";export{default as OptionGroupHeader}from"./option-group-header/option-group-header.component.js";export{SimpleSelect as Select}from"./simple-select/simple-select.component.js";export{FilterableSelect}from"./filterable-select/filterable-select.component.js";export{MultiSelect}from"./multi-select/multi-select.component.js";
1
+ export{default as Option}from"./option/option.component.js";export{default as OptionRow}from"./option-row/option-row.component.js";export{default as OptionGroupHeader}from"./option-group-header/option-group-header.component.js";export{SimpleSelect as Select}from"./simple-select/simple-select.component.js";export{FilterableSelect}from"./filterable-select/filterable-select.component.js";export{MultiSelect}from"./multi-select/multi-select.component.js";export{default as setupSelectMocks}from"./setup-select-mocks.js";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Utility function for setting up global mocks required when testing with `SimpleSelect`, `FilterableSelect` or `MultiSelect` in a non-browser environment like JSDOM.
3
+ */
4
+ declare const setupSelectMocks: () => void;
5
+ export default setupSelectMocks;