carbon-react 119.6.0 → 119.6.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 (87) hide show
  1. package/esm/__internal__/focus-trap/focus-trap.component.js +5 -5
  2. package/esm/__internal__/input/input-presentation.component.d.ts +3 -1
  3. package/esm/__internal__/input/input-presentation.component.js +3 -0
  4. package/esm/__internal__/input/input-presentation.style.d.ts +1 -1
  5. package/esm/__internal__/input/input-presentation.style.js +4 -2
  6. package/esm/__internal__/popover/popover.component.d.ts +4 -1
  7. package/esm/components/date/__internal__/date-formats/index.d.ts +3 -6
  8. package/esm/components/date/__internal__/date-formats/index.js +3 -3
  9. package/esm/components/date/__internal__/date-picker/date-picker.component.d.ts +38 -0
  10. package/esm/components/date/__internal__/date-picker/date-picker.component.js +243 -34
  11. package/esm/components/date/__internal__/date-picker/day-picker.style.d.ts +2 -0
  12. package/esm/components/date/__internal__/date-picker/index.d.ts +2 -0
  13. package/esm/components/date/__internal__/navbar/button.style.d.ts +4 -0
  14. package/esm/components/date/__internal__/navbar/index.d.ts +2 -0
  15. package/esm/components/date/__internal__/navbar/navbar.component.d.ts +8 -0
  16. package/esm/components/date/__internal__/navbar/navbar.component.js +7 -9
  17. package/esm/components/date/__internal__/navbar/navbar.style.d.ts +2 -0
  18. package/esm/components/date/__internal__/utils.d.ts +14 -0
  19. package/esm/components/date/__internal__/utils.js +22 -18
  20. package/esm/components/date/__internal__/weekday/abbr.style.d.ts +2 -0
  21. package/esm/components/date/__internal__/weekday/index.d.ts +2 -0
  22. package/esm/components/date/__internal__/weekday/weekday.component.d.ts +8 -0
  23. package/esm/components/date/__internal__/weekday/weekday.component.js +1 -6
  24. package/esm/components/date/__internal__/weekday/weekday.style.d.ts +2 -0
  25. package/esm/components/date/date.component.d.ts +43 -0
  26. package/esm/components/date/date.component.js +781 -60
  27. package/esm/components/date/date.style.d.ts +6 -0
  28. package/esm/components/date/date.style.js +3 -8
  29. package/esm/components/date/index.d.ts +2 -2
  30. package/esm/components/date-range/date-range.component.d.ts +88 -0
  31. package/esm/components/date-range/date-range.component.js +22 -102
  32. package/esm/components/date-range/date-range.context.d.ts +22 -0
  33. package/esm/components/date-range/date-range.style.d.ts +6 -0
  34. package/esm/components/date-range/date-range.style.js +1 -1
  35. package/esm/components/date-range/index.d.ts +3 -3
  36. package/esm/components/textbox/textbox.component.js +1 -0
  37. package/esm/hooks/__internal__/useFloating/useFloating.d.ts +4 -1
  38. package/lib/__internal__/focus-trap/focus-trap.component.js +5 -5
  39. package/lib/__internal__/input/input-presentation.component.d.ts +3 -1
  40. package/lib/__internal__/input/input-presentation.component.js +3 -0
  41. package/lib/__internal__/input/input-presentation.style.d.ts +1 -1
  42. package/lib/__internal__/input/input-presentation.style.js +4 -2
  43. package/lib/__internal__/popover/popover.component.d.ts +4 -1
  44. package/lib/components/date/__internal__/date-formats/index.d.ts +3 -6
  45. package/lib/components/date/__internal__/date-formats/index.js +3 -3
  46. package/lib/components/date/__internal__/date-picker/date-picker.component.d.ts +38 -0
  47. package/lib/components/date/__internal__/date-picker/date-picker.component.js +243 -35
  48. package/lib/components/date/__internal__/date-picker/day-picker.style.d.ts +2 -0
  49. package/lib/components/date/__internal__/date-picker/index.d.ts +2 -0
  50. package/lib/components/date/__internal__/navbar/button.style.d.ts +4 -0
  51. package/lib/components/date/__internal__/navbar/index.d.ts +2 -0
  52. package/lib/components/date/__internal__/navbar/navbar.component.d.ts +8 -0
  53. package/lib/components/date/__internal__/navbar/navbar.component.js +8 -9
  54. package/lib/components/date/__internal__/navbar/navbar.style.d.ts +2 -0
  55. package/lib/components/date/__internal__/utils.d.ts +14 -0
  56. package/lib/components/date/__internal__/utils.js +22 -18
  57. package/lib/components/date/__internal__/weekday/abbr.style.d.ts +2 -0
  58. package/lib/components/date/__internal__/weekday/index.d.ts +2 -0
  59. package/lib/components/date/__internal__/weekday/weekday.component.d.ts +8 -0
  60. package/lib/components/date/__internal__/weekday/weekday.component.js +2 -6
  61. package/lib/components/date/__internal__/weekday/weekday.style.d.ts +2 -0
  62. package/lib/components/date/date.component.d.ts +43 -0
  63. package/lib/components/date/date.component.js +781 -60
  64. package/lib/components/date/date.style.d.ts +6 -0
  65. package/lib/components/date/date.style.js +3 -8
  66. package/lib/components/date/index.d.ts +2 -2
  67. package/lib/components/date-range/date-range.component.d.ts +88 -0
  68. package/lib/components/date-range/date-range.component.js +23 -102
  69. package/lib/components/date-range/date-range.context.d.ts +22 -0
  70. package/lib/components/date-range/date-range.style.d.ts +6 -0
  71. package/lib/components/date-range/date-range.style.js +1 -1
  72. package/lib/components/date-range/index.d.ts +3 -3
  73. package/lib/components/textbox/textbox.component.js +1 -0
  74. package/lib/hooks/__internal__/useFloating/useFloating.d.ts +4 -1
  75. package/package.json +1 -1
  76. package/esm/components/date/__internal__/date-picker/date-picker.d.ts +0 -27
  77. package/esm/components/date/__internal__/navbar/navbar.d.ts +0 -8
  78. package/esm/components/date/__internal__/weekday/weekday.d.ts +0 -13
  79. package/esm/components/date/date.d.ts +0 -52
  80. package/esm/components/date-range/date-range-context.d.ts +0 -17
  81. package/esm/components/date-range/date-range.d.ts +0 -92
  82. package/lib/components/date/__internal__/date-picker/date-picker.d.ts +0 -27
  83. package/lib/components/date/__internal__/navbar/navbar.d.ts +0 -8
  84. package/lib/components/date/__internal__/weekday/weekday.d.ts +0 -13
  85. package/lib/components/date/date.d.ts +0 -52
  86. package/lib/components/date-range/date-range-context.d.ts +0 -17
  87. package/lib/components/date-range/date-range.d.ts +0 -92
@@ -1,8 +0,0 @@
1
- export interface NavbarProps {
2
- onPreviousClick?: () => void;
3
- onNextClick?: () => void;
4
- }
5
-
6
- declare function Navbar(props: NavbarProps): JSX.Element;
7
-
8
- export default Navbar;
@@ -1,13 +0,0 @@
1
- import * as React from "react";
2
-
3
- export interface WeekdayProps {
4
- className?: string;
5
- title?: string;
6
- children?: React.ReactNode;
7
- }
8
-
9
- declare function Weekday(
10
- props: WeekdayProps & React.RefAttributes<HTMLElement>
11
- ): JSX.Element;
12
-
13
- export default Weekday;
@@ -1,52 +0,0 @@
1
- import { DayPickerProps } from "react-day-picker";
2
- import { TextboxProps } from "../textbox";
3
-
4
- export interface DateChangeEvent {
5
- target: {
6
- value: {
7
- formattedValue: string;
8
- rawValue: string;
9
- };
10
- };
11
- }
12
-
13
- export interface DateInputProps
14
- extends Omit<
15
- TextboxProps,
16
- | "value"
17
- | "formattedValue"
18
- | "rawValue"
19
- | "onChange"
20
- | "onMouseDown"
21
- | "onChangeDeferred"
22
- | "deferTimeout"
23
- | "children"
24
- | "leftChildren"
25
- | "placeholder"
26
- | "iconOnClick"
27
- | "iconOnMouseDown"
28
- | "enforceCharacterLimit"
29
- | "characterLimit"
30
- | "iconTabIndex"
31
- > {
32
- /** Boolean to allow the input to have an empty value */
33
- allowEmptyValue?: boolean;
34
- /** Boolean to toggle where DatePicker is rendered in relation to the Date Input */
35
- disablePortal?: boolean;
36
- /** Minimum possible date YYYY-MM-DD */
37
- minDate?: string;
38
- /** Maximum possible date YYYY-MM-DD */
39
- maxDate?: string;
40
- /** Specify a callback triggered on change */
41
- onChange: (ev: DateChangeEvent) => void;
42
- /** The current date string */
43
- value: string;
44
- /** Pass any props that match the DayPickerProps interface to override default behaviors */
45
- pickerProps?: DayPickerProps;
46
- }
47
-
48
- declare function DateInput(
49
- props: SimpleSelectProps & React.RefAttributes<HTMLInputElement>
50
- ): JSX.Element;
51
-
52
- export default DateInput;
@@ -1,17 +0,0 @@
1
- import * as React from "react";
2
-
3
- interface DateInputRefMap {
4
- isBlurBlocked: { current: boolean };
5
- setOpen: null | ((open: boolean) => void);
6
- }
7
-
8
- export interface DateRangeContextProps {
9
- inputRefMap: {
10
- start: DateInputRefMap;
11
- end: DateInputRefMap;
12
- };
13
- setInputRefMap: (newState: DateInputRefMap) => void;
14
- }
15
-
16
- declare const DateRangeContext: React.Context<DateRangeContextProps>;
17
- export default DateRangeContext;
@@ -1,92 +0,0 @@
1
- import * as React from "react";
2
- import { MarginProps } from "styled-system";
3
- import { DateInputProps } from "../date/date";
4
-
5
- export interface DateRangeChangeEvent {
6
- target: {
7
- value: [
8
- {
9
- formattedValue: string;
10
- rawValue: string;
11
- },
12
- {
13
- formattedValue: string;
14
- rawValue: string;
15
- }
16
- ];
17
- };
18
- }
19
-
20
- export interface DateRangeProps extends MarginProps {
21
- /** Props for the child end Date component */
22
- endDateProps?: Partial<DateInputProps>;
23
- /** Optional label for endDate field */
24
- endLabel?: string;
25
- /**
26
- * Indicate that error has occurred on end date
27
- * Pass string to display icon, tooltip and red border
28
- * Pass true boolean to only display red border
29
- */
30
- endError?: boolean | string;
31
- /**
32
- * Indicate additional information for end date
33
- * Pass string to display icon, tooltip and blue border
34
- * Pass true boolean to only display blue border
35
- */
36
- endInfo?: boolean | string;
37
- /**
38
- * Indicate that warning has occurred on end date
39
- * Pass string to display icon, tooltip and orange border
40
- * Pass true boolean to only display orange border
41
- */
42
- endWarning?: boolean | string;
43
- /**
44
- * A React ref to pass to the second of the two Date Input fields
45
- */
46
- endRef?: React.ForwardedRef<HTMLInputElement>;
47
- /** An optional string prop to provide an id to the component */
48
- id?: string;
49
- /** Display labels inline */
50
- labelsInline?: boolean;
51
- /** An optional string prop to provide a name to the component */
52
- name?: string;
53
- /** Specify a callback triggered on change */
54
- onChange: (ev: DateRangeChangeEvent) => void;
55
- /** Specify a callback triggered on blur */
56
- onBlur?: (ev: DateRangeChangeEvent) => void;
57
- /** Props for the child start Date component */
58
- startDateProps?: Partial<DateInputProps>;
59
- /** Optional label for startDate field */
60
- startLabel?: string;
61
- /**
62
- * Indicate that error has occurred on start date
63
- * Pass string to display icon, tooltip and red border
64
- * Pass true boolean to only display red border
65
- */
66
- startError?: boolean | string;
67
- /**
68
- * Indicate that warning has occurred on start date
69
- * Pass string to display icon, tooltip and orange border
70
- * Pass true boolean to only display orange border
71
- */
72
- startWarning?: boolean | string;
73
- /** Indicate additional information for start date
74
- * Pass string to display icon, tooltip and blue border
75
- * Pass true boolean to only display blue border
76
- */
77
- startInfo?: boolean | string;
78
- /**
79
- * A React ref to pass to the first of the two Date Input fields
80
- */
81
- startRef?: React.ForwardedRef<HTMLInputElement>;
82
- /** An array containing the value of startDate and endDate */
83
- value: string[];
84
- /** When true, validation icons will be placed on labels instead of being placed on the inputs */
85
- validationOnLabel?: boolean;
86
- /** Overrides the default tooltip position */
87
- tooltipPosition?: "top" | "bottom" | "left" | "right";
88
- }
89
-
90
- declare function DateRange(props: DateRangeProps): JSX.Element;
91
-
92
- export default DateRange;