carbon-react 111.4.0 → 111.4.1

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 (47) 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/search/search.d.ts +1 -0
  11. package/esm/components/select/filterable-select/filterable-select.d.ts +2 -2
  12. package/esm/components/select/multi-select/multi-select.d.ts +2 -2
  13. package/esm/components/select/select-textbox/select-textbox.d.ts +1 -1
  14. package/esm/components/select/simple-select/simple-select.d.ts +1 -1
  15. package/esm/components/tabs/tabs.d.ts +1 -1
  16. package/esm/components/typography/index.d.ts +4 -2
  17. package/esm/components/typography/list.component.d.ts +11 -0
  18. package/esm/components/typography/list.component.js +915 -4
  19. package/esm/components/typography/typography.component.d.ts +42 -0
  20. package/esm/components/typography/typography.component.js +13 -50
  21. package/lib/__internal__/radio-button-mapper/radio-button-mapper.component.js +1 -0
  22. package/lib/__internal__/radio-button-mapper/radio-button-mapper.d.ts +0 -1
  23. package/lib/components/date/__internal__/date-formats/index.d.ts +3 -1
  24. package/lib/components/date/date.d.ts +1 -2
  25. package/lib/components/decimal/decimal.component.d.ts +44 -0
  26. package/lib/components/decimal/decimal.component.js +536 -97
  27. package/lib/components/decimal/index.d.ts +2 -1
  28. package/lib/components/heading/heading.style.d.ts +9 -2
  29. package/lib/components/menu/menu.d.ts +4 -1
  30. package/lib/components/search/search.d.ts +1 -0
  31. package/lib/components/select/filterable-select/filterable-select.d.ts +2 -2
  32. package/lib/components/select/multi-select/multi-select.d.ts +2 -2
  33. package/lib/components/select/select-textbox/select-textbox.d.ts +1 -1
  34. package/lib/components/select/simple-select/simple-select.d.ts +1 -1
  35. package/lib/components/tabs/tabs.d.ts +1 -1
  36. package/lib/components/typography/index.d.ts +4 -2
  37. package/lib/components/typography/list.component.d.ts +11 -0
  38. package/lib/components/typography/list.component.js +914 -3
  39. package/lib/components/typography/typography.component.d.ts +42 -0
  40. package/lib/components/typography/typography.component.js +14 -52
  41. package/package.json +2 -1
  42. package/esm/components/decimal/decimal.d.ts +0 -37
  43. package/esm/components/typography/list.d.ts +0 -11
  44. package/esm/components/typography/typography.d.ts +0 -60
  45. package/lib/components/decimal/decimal.d.ts +0 -37
  46. package/lib/components/typography/list.d.ts +0 -11
  47. package/lib/components/typography/typography.d.ts +0 -60
@@ -77,4 +77,5 @@ RadioButtonMapper.propTypes = {
77
77
  /** Value of the selected RadioButton */
78
78
  value: PropTypes.string
79
79
  };
80
+ RadioButtonMapper.displayName = "RadioButtonMapper";
80
81
  export default RadioButtonMapper;
@@ -16,6 +16,5 @@ export interface RadioButtonMapperProps {
16
16
  }
17
17
 
18
18
  declare function RadioButtonMapper(props?: RadioButtonMapperProps): JSX.Element;
19
- RadioButtonMapper.displayName = "RadioButtonMapper";
20
19
 
21
20
  export default RadioButtonMapper;
@@ -1,8 +1,10 @@
1
+ import { Locale as DateFnsLocale } from "date-fns";
2
+
1
3
  interface LocaleFormats {
2
4
  formats: string[];
3
5
  format: string;
4
6
  }
5
7
 
6
- declare function getFormatData({ code: string }): LocaleFormats;
8
+ declare function getFormatData(locale: DateFnsLocale): LocaleFormats;
7
9
 
8
10
  export default getFormatData;
@@ -1,6 +1,5 @@
1
- import * as React from "react";
2
1
  import { DayPickerProps } from "react-day-picker";
3
- import { TextboxProps } from "../textbox/textbox";
2
+ import { TextboxProps } from "../textbox";
4
3
 
5
4
  export interface DateChangeEvent {
6
5
  target: {
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { CommonTextboxProps } from "../textbox";
3
+ export interface CustomEvent {
4
+ target: {
5
+ name?: string;
6
+ id?: string;
7
+ value: {
8
+ formattedValue: string;
9
+ rawValue: string;
10
+ };
11
+ };
12
+ }
13
+ export interface DecimalProps extends Omit<CommonTextboxProps, "onChange" | "onBlur"> {
14
+ /** Text alignment of the label */
15
+ align?: "left" | "right";
16
+ /** Allow an empty value instead of defaulting to 0.00 */
17
+ allowEmptyValue?: boolean;
18
+ /** The default value of the input if it's meant to be used as an uncontrolled component */
19
+ defaultValue?: string;
20
+ /** The input id */
21
+ id?: string;
22
+ /** The width of the input as a percentage */
23
+ inputWidth?: number;
24
+ /** Handler for change event if input is meant to be used as a controlled component */
25
+ onChange?: (ev: CustomEvent) => void;
26
+ /** Handler for blur event */
27
+ onBlur?: (ev: CustomEvent) => void;
28
+ /** Handler for key press event */
29
+ onKeyPress?: (ev: React.KeyboardEvent<HTMLInputElement>) => void;
30
+ /** The input name */
31
+ name?: string;
32
+ /** The decimal precision of the value in the input */
33
+ precision?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
34
+ /** If true, the component will be read-only */
35
+ readOnly?: boolean;
36
+ /** Flag to configure component as mandatory */
37
+ required?: boolean;
38
+ /** The value of the input if it's used as a controlled component */
39
+ value?: string;
40
+ /** The locale string - default en */
41
+ locale?: string;
42
+ }
43
+ export declare const Decimal: ({ align, defaultValue, precision, inputWidth, readOnly, onChange, onBlur, onKeyPress, id, name, allowEmptyValue, required, locale, value, ...rest }: DecimalProps) => JSX.Element;
44
+ export default Decimal;