carbon-react 111.4.0 → 111.4.2

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 (49) hide show
  1. package/esm/__internal__/radio-button-mapper/radio-button-mapper.component.js +1 -0
  2. package/esm/__internal__/radio-button-mapper/radio-button-mapper.d.ts +0 -1
  3. package/esm/components/date/__internal__/date-formats/index.d.ts +3 -1
  4. package/esm/components/date/date.d.ts +1 -2
  5. package/esm/components/decimal/decimal.component.d.ts +44 -0
  6. package/esm/components/decimal/decimal.component.js +535 -93
  7. package/esm/components/decimal/index.d.ts +2 -1
  8. package/esm/components/heading/heading.style.d.ts +9 -2
  9. package/esm/components/menu/menu.d.ts +4 -1
  10. package/esm/components/multi-action-button/multi-action-button.style.js +2 -1
  11. package/esm/components/search/search.d.ts +1 -0
  12. package/esm/components/select/filterable-select/filterable-select.d.ts +2 -2
  13. package/esm/components/select/multi-select/multi-select.d.ts +2 -2
  14. package/esm/components/select/select-textbox/select-textbox.d.ts +1 -1
  15. package/esm/components/select/simple-select/simple-select.d.ts +1 -1
  16. package/esm/components/tabs/tabs.d.ts +1 -1
  17. package/esm/components/typography/index.d.ts +4 -2
  18. package/esm/components/typography/list.component.d.ts +11 -0
  19. package/esm/components/typography/list.component.js +915 -4
  20. package/esm/components/typography/typography.component.d.ts +42 -0
  21. package/esm/components/typography/typography.component.js +13 -50
  22. package/lib/__internal__/radio-button-mapper/radio-button-mapper.component.js +1 -0
  23. package/lib/__internal__/radio-button-mapper/radio-button-mapper.d.ts +0 -1
  24. package/lib/components/date/__internal__/date-formats/index.d.ts +3 -1
  25. package/lib/components/date/date.d.ts +1 -2
  26. package/lib/components/decimal/decimal.component.d.ts +44 -0
  27. package/lib/components/decimal/decimal.component.js +536 -97
  28. package/lib/components/decimal/index.d.ts +2 -1
  29. package/lib/components/heading/heading.style.d.ts +9 -2
  30. package/lib/components/menu/menu.d.ts +4 -1
  31. package/lib/components/multi-action-button/multi-action-button.style.js +2 -1
  32. package/lib/components/search/search.d.ts +1 -0
  33. package/lib/components/select/filterable-select/filterable-select.d.ts +2 -2
  34. package/lib/components/select/multi-select/multi-select.d.ts +2 -2
  35. package/lib/components/select/select-textbox/select-textbox.d.ts +1 -1
  36. package/lib/components/select/simple-select/simple-select.d.ts +1 -1
  37. package/lib/components/tabs/tabs.d.ts +1 -1
  38. package/lib/components/typography/index.d.ts +4 -2
  39. package/lib/components/typography/list.component.d.ts +11 -0
  40. package/lib/components/typography/list.component.js +914 -3
  41. package/lib/components/typography/typography.component.d.ts +42 -0
  42. package/lib/components/typography/typography.component.js +14 -52
  43. package/package.json +2 -1
  44. package/esm/components/decimal/decimal.d.ts +0 -37
  45. package/esm/components/typography/list.d.ts +0 -11
  46. package/esm/components/typography/typography.d.ts +0 -60
  47. package/lib/components/decimal/decimal.d.ts +0 -37
  48. package/lib/components/typography/list.d.ts +0 -11
  49. package/lib/components/typography/typography.d.ts +0 -60
@@ -1 +1,2 @@
1
- export { default } from "./decimal";
1
+ export { default } from "./decimal.component";
2
+ export type { DecimalProps, CustomEvent } from "./decimal.component";
@@ -1,5 +1,4 @@
1
1
  /// <reference types="react" />
2
- import Typography from "../typography";
3
2
  declare const StyledHeading: import("styled-components").StyledComponent<"div", any, {}, never>;
4
3
  declare const StyledHeaderContent: import("styled-components").StyledComponent<"div", any, {}, never>;
5
4
  declare type StyledHeaderProps = {
@@ -12,7 +11,15 @@ declare const StyledHeadingBackButton: import("styled-components").StyledCompone
12
11
  declare type StyledHeadingTitleProps = {
13
12
  withMargin?: boolean;
14
13
  };
15
- declare const StyledHeadingTitle: import("styled-components").StyledComponent<typeof Typography, any, StyledHeadingTitleProps, never>;
14
+ declare const StyledHeadingTitle: import("styled-components").StyledComponent<"span", any, {
15
+ as: import("react").ElementType<any> | undefined;
16
+ size: string;
17
+ weight: string;
18
+ textTransform: string;
19
+ textDecoration: string;
20
+ lineHeight: string;
21
+ defaultMargin: string;
22
+ } & import("../typography").TypographyProps & StyledHeadingTitleProps, "as" | "textDecoration" | "size" | "lineHeight" | "textTransform" | "weight" | "defaultMargin">;
16
23
  declare const StyledHeadingPills: import("styled-components").StyledComponent<"span", any, {}, never>;
17
24
  declare type StyledSubHeaderProps = {
18
25
  hasBackLink?: boolean;
@@ -5,7 +5,10 @@ type menuType = "light" | "dark" | "white" | "black";
5
5
  interface MenuContextProps {
6
6
  menuType: menuType;
7
7
  isFirstElement: boolean;
8
- handleKeyDown: (ev, submenuOpen) => void;
8
+ handleKeyDown: (
9
+ ev: React.KeyboardEvent<HTMLAnchorElement | HTMLButtonElement>,
10
+ submenuOpen?: boolean
11
+ ) => void;
9
12
  isFocused: boolean;
10
13
  openSubmenu: boolean;
11
14
  inMenu: boolean;
@@ -74,10 +74,11 @@ const StyledButtonChildrenContainer = styled.div`
74
74
  text-align: ${align};
75
75
  z-index: ${theme.zIndex.overlay};
76
76
 
77
- /* Styling for Safari. Display flex is not supported on buttons in Safari. */
77
+ /* Styling for Safari. */
78
78
  @media not all and (min-resolution: 0.001dpcm) {
79
79
  @supports (-webkit-appearance: none) and (stroke-color: transparent) {
80
80
  display: -webkit-box;
81
+ justify-content: ${align === "right" ? `flex-end` : `flex-start`};
81
82
  }
82
83
  }
83
84
 
@@ -1,5 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { MarginProps } from "styled-system";
3
+ import { ValidationProps } from "../../__internal__/validations";
3
4
 
4
5
  export interface SearchProps extends ValidationProps, MarginProps {
5
6
  /** Prop to specify the aria-label of the search component */
@@ -4,7 +4,7 @@ import Button from "../../button";
4
4
  import { FormInputPropTypes } from "../select-textbox/select-textbox";
5
5
 
6
6
  export interface FilterableSelectProps
7
- extends Omit<FormInputPropTypes, "defaultValue"> {
7
+ extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
8
8
  /** Identifier used for testing purposes, applied to the root element of the component. */
9
9
  "data-component"?: string;
10
10
  /** Identifier used for testing purposes, applied to the root element of the component. */
@@ -50,7 +50,7 @@ export interface FilterableSelectProps
50
50
  /** Placement of the select list in relation to the input element */
51
51
  listPlacement?: Side;
52
52
  /** Use the opposite list placement if the set placement does not fit */
53
- flipEnabled?: bool;
53
+ flipEnabled?: boolean;
54
54
  }
55
55
 
56
56
  declare function FilterableSelect(
@@ -3,7 +3,7 @@ import { Side } from "@floating-ui/dom";
3
3
  import { FormInputPropTypes } from "../select-textbox/select-textbox";
4
4
 
5
5
  export interface MultiSelectProps
6
- extends Omit<FormInputPropTypes, "defaultValue"> {
6
+ extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
7
7
  /** Identifier used for testing purposes, applied to the root element of the component. */
8
8
  "data-component"?: string;
9
9
  /** Identifier used for testing purposes, applied to the root element of the component. */
@@ -45,7 +45,7 @@ export interface MultiSelectProps
45
45
  /** Placement of the select list in relation to the input element */
46
46
  listPlacement?: Side;
47
47
  /** Use the opposite list placement if the set placement does not fit */
48
- flipEnabled?: bool;
48
+ flipEnabled?: boolean;
49
49
  /** Wraps the pill text when it would overflow the input width */
50
50
  wrapPillText?: boolean;
51
51
  }
@@ -5,7 +5,7 @@ import { ValidationProps } from "../../../__internal__/validations";
5
5
 
6
6
  export interface FormInputPropTypes
7
7
  extends ValidationProps,
8
- CommonTextboxProps {
8
+ Omit<CommonTextboxProps, "onClick"> {
9
9
  /** Breakpoint for adaptive label (inline labels change to top aligned). Enables the adaptive behaviour when set */
10
10
  adaptiveLabelBreakpoint?: number;
11
11
  /** If true the Component will be focused when rendered */
@@ -3,7 +3,7 @@ import { Side } from "@floating-ui/dom";
3
3
  import { FormInputPropTypes } from "../select-textbox/select-textbox";
4
4
 
5
5
  export interface SimpleSelectProps
6
- extends Omit<FormInputPropTypes, "defaultValue"> {
6
+ extends Omit<FormInputPropTypes, "defaultValue" | "value"> {
7
7
  /** Identifier used for testing purposes, applied to the root element of the component. */
8
8
  "data-component"?: string;
9
9
  /** Identifier used for testing purposes, applied to the root element of the component. */
@@ -34,7 +34,7 @@ export interface TabsProps extends MarginProps {
34
34
  * The `id` property should match the `tabId`s for the rendered Tabs.
35
35
  */
36
36
  validationStatusOverride?: {
37
- [id?: string]: {
37
+ [id: string]: {
38
38
  error?: boolean;
39
39
  warning?: boolean;
40
40
  info?: boolean;
@@ -1,2 +1,4 @@
1
- export { default } from "./typography";
2
- export { List, ListItem } from "./list";
1
+ export { default } from "./typography.component";
2
+ export { List, ListItem } from "./list.component";
3
+ export type { TypographyProps } from "./typography.component";
4
+ export type { ListProps, ListItemProps } from "./list.component";
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { TypographyProps } from "./typography.component";
3
+ export interface ListProps extends TypographyProps {
4
+ children?: React.ReactNode;
5
+ }
6
+ export interface ListItemProps extends TypographyProps {
7
+ children?: React.ReactNode;
8
+ }
9
+ declare const List: ({ children, as, ...props }: ListProps) => JSX.Element;
10
+ declare const ListItem: ({ children, ...props }: ListItemProps) => JSX.Element;
11
+ export { List, ListItem };