@carbon/react 1.113.0 → 1.114.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 (143) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +962 -962
  2. package/es/components/Card/Card.d.ts +48 -0
  3. package/es/components/Card/Card.js +148 -0
  4. package/es/components/Card/Card.types.d.ts +88 -0
  5. package/es/components/Card/CardAction.d.ts +37 -0
  6. package/es/components/Card/CardAction.js +32 -0
  7. package/es/components/Card/CardActions.d.ts +30 -0
  8. package/es/components/Card/CardActions.js +93 -0
  9. package/es/components/Card/CardBody.d.ts +11 -0
  10. package/es/components/Card/CardBody.js +34 -0
  11. package/es/components/Card/CardContext.d.ts +17 -0
  12. package/es/components/Card/CardContext.js +31 -0
  13. package/es/components/Card/CardFooter.d.ts +11 -0
  14. package/es/components/Card/CardFooter.js +34 -0
  15. package/es/components/Card/CardHeader.d.ts +11 -0
  16. package/es/components/Card/CardHeader.js +44 -0
  17. package/es/components/Card/CardHeaderMedia.d.ts +21 -0
  18. package/es/components/Card/CardHeaderMedia.js +24 -0
  19. package/es/components/Card/CardMedia.d.ts +35 -0
  20. package/es/components/Card/CardMedia.js +42 -0
  21. package/es/components/Card/CardTitle.d.ts +72 -0
  22. package/es/components/Card/CardTitle.js +86 -0
  23. package/es/components/Card/CardTitleMedia.d.ts +23 -0
  24. package/es/components/Card/CardTitleMedia.js +36 -0
  25. package/es/components/Card/_story-assets/data.d.ts +6 -0
  26. package/es/components/Card/_story-assets/options.d.ts +47 -0
  27. package/es/components/Card/index.d.ts +8 -0
  28. package/es/components/Card/index.js +33 -0
  29. package/es/components/Checkbox/Checkbox.js +1 -1
  30. package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
  31. package/es/components/ComboBox/ComboBox.js +2 -2
  32. package/es/components/ComboButton/index.js +1 -1
  33. package/es/components/ComposedModal/ComposedModal.js +1 -1
  34. package/es/components/DatePicker/DatePicker.d.ts +10 -0
  35. package/es/components/DatePicker/DatePicker.js +7 -6
  36. package/es/components/DatePicker/next/components/Calendar.d.ts +40 -0
  37. package/es/components/DatePicker/next/components/Calendar.js +181 -0
  38. package/es/components/DatePicker/next/components/DatePicker.d.ts +86 -0
  39. package/es/components/DatePicker/next/components/DatePicker.js +147 -0
  40. package/es/components/DatePicker/next/components/DatePickerInput.d.ts +143 -0
  41. package/es/components/DatePicker/next/components/DatePickerInput.js +124 -0
  42. package/es/components/DatePicker/next/components/DatePickerSkeleton.d.ts +22 -0
  43. package/es/components/DatePicker/next/components/DatePickerSkeleton.js +32 -0
  44. package/es/components/DatePicker/next/hooks/useDatePicker.d.ts +144 -0
  45. package/es/components/DatePicker/next/hooks/useDatePicker.js +286 -0
  46. package/es/components/DatePicker/next/index.d.ts +12 -0
  47. package/es/components/DatePicker/next/index.js +19 -0
  48. package/es/components/DatePickerInput/DatePickerInput.js +1 -1
  49. package/es/components/Dropdown/Dropdown.js +2 -2
  50. package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
  51. package/es/components/MenuButton/index.js +1 -1
  52. package/es/components/MultiSelect/FilterableMultiSelect.js +2 -2
  53. package/es/components/MultiSelect/MultiSelect.js +2 -2
  54. package/es/components/NumberInput/NumberInput.js +2 -2
  55. package/es/components/OverflowMenu/next/index.js +1 -1
  56. package/es/components/RadioButton/RadioButton.js +1 -1
  57. package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  58. package/es/components/Select/Select.js +1 -1
  59. package/es/components/Tag/SelectableTag.js +1 -1
  60. package/es/components/TextArea/TextArea.js +1 -1
  61. package/es/components/TextInput/TextInput.js +1 -1
  62. package/es/index.d.ts +2 -0
  63. package/es/index.js +7 -5
  64. package/es/internal/checkForOverflow.d.ts +5 -0
  65. package/es/internal/useFocus.d.ts +23 -0
  66. package/es/internal/usePrefersReducedMotion.d.ts +11 -0
  67. package/es/internal/useSidePanelPresence.d.ts +21 -0
  68. package/lib/components/Card/Card.d.ts +48 -0
  69. package/lib/components/Card/Card.js +161 -0
  70. package/lib/components/Card/Card.types.d.ts +88 -0
  71. package/lib/components/Card/CardAction.d.ts +37 -0
  72. package/lib/components/Card/CardAction.js +41 -0
  73. package/lib/components/Card/CardActions.d.ts +30 -0
  74. package/lib/components/Card/CardActions.js +96 -0
  75. package/lib/components/Card/CardBody.d.ts +11 -0
  76. package/lib/components/Card/CardBody.js +37 -0
  77. package/lib/components/Card/CardContext.d.ts +17 -0
  78. package/lib/components/Card/CardContext.js +32 -0
  79. package/lib/components/Card/CardFooter.d.ts +11 -0
  80. package/lib/components/Card/CardFooter.js +37 -0
  81. package/lib/components/Card/CardHeader.d.ts +11 -0
  82. package/lib/components/Card/CardHeader.js +47 -0
  83. package/lib/components/Card/CardHeaderMedia.d.ts +21 -0
  84. package/lib/components/Card/CardHeaderMedia.js +33 -0
  85. package/lib/components/Card/CardMedia.d.ts +35 -0
  86. package/lib/components/Card/CardMedia.js +51 -0
  87. package/lib/components/Card/CardTitle.d.ts +72 -0
  88. package/lib/components/Card/CardTitle.js +89 -0
  89. package/lib/components/Card/CardTitleMedia.d.ts +23 -0
  90. package/lib/components/Card/CardTitleMedia.js +39 -0
  91. package/lib/components/Card/_story-assets/data.d.ts +6 -0
  92. package/lib/components/Card/_story-assets/options.d.ts +47 -0
  93. package/lib/components/Card/index.d.ts +8 -0
  94. package/lib/components/Card/index.js +48 -0
  95. package/lib/components/Checkbox/Checkbox.js +1 -1
  96. package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
  97. package/lib/components/ComboBox/ComboBox.js +2 -2
  98. package/lib/components/ComboButton/index.js +1 -1
  99. package/lib/components/ComposedModal/ComposedModal.js +1 -1
  100. package/lib/components/DatePicker/DatePicker.d.ts +10 -0
  101. package/lib/components/DatePicker/DatePicker.js +7 -6
  102. package/lib/components/DatePicker/next/components/Calendar.d.ts +40 -0
  103. package/lib/components/DatePicker/next/components/Calendar.js +184 -0
  104. package/lib/components/DatePicker/next/components/DatePicker.d.ts +86 -0
  105. package/lib/components/DatePicker/next/components/DatePicker.js +150 -0
  106. package/lib/components/DatePicker/next/components/DatePickerInput.d.ts +143 -0
  107. package/lib/components/DatePicker/next/components/DatePickerInput.js +127 -0
  108. package/lib/components/DatePicker/next/components/DatePickerSkeleton.d.ts +22 -0
  109. package/lib/components/DatePicker/next/components/DatePickerSkeleton.js +41 -0
  110. package/lib/components/DatePicker/next/hooks/useDatePicker.d.ts +144 -0
  111. package/lib/components/DatePicker/next/hooks/useDatePicker.js +286 -0
  112. package/lib/components/DatePicker/next/index.d.ts +12 -0
  113. package/lib/components/DatePicker/next/index.js +27 -0
  114. package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
  115. package/lib/components/Dropdown/Dropdown.js +2 -2
  116. package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -1
  117. package/lib/components/MenuButton/index.js +1 -1
  118. package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -2
  119. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  120. package/lib/components/NumberInput/NumberInput.js +2 -2
  121. package/lib/components/OverflowMenu/next/index.js +1 -1
  122. package/lib/components/RadioButton/RadioButton.js +1 -1
  123. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
  124. package/lib/components/Select/Select.js +1 -1
  125. package/lib/components/Tag/SelectableTag.js +1 -1
  126. package/lib/components/TextArea/TextArea.js +1 -1
  127. package/lib/components/TextInput/TextInput.js +1 -1
  128. package/lib/index.d.ts +2 -0
  129. package/lib/index.js +59 -45
  130. package/lib/internal/checkForOverflow.d.ts +5 -0
  131. package/lib/internal/useFocus.d.ts +23 -0
  132. package/lib/internal/usePrefersReducedMotion.d.ts +11 -0
  133. package/lib/internal/useSidePanelPresence.d.ts +21 -0
  134. package/package.json +11 -11
  135. package/scss/components/action-set/_action-set.scss +9 -0
  136. package/scss/components/action-set/_index.scss +9 -0
  137. package/scss/components/resizer/_index.scss +9 -0
  138. package/scss/components/resizer/_resizer.scss +9 -0
  139. package/scss/components/side-panel/_index.scss +9 -0
  140. package/scss/components/side-panel/_side-panel.scss +9 -0
  141. package/scss/components/truncated-text/_index.scss +9 -0
  142. package/scss/components/truncated-text/_truncated-text.scss +9 -0
  143. package/telemetry.yml +57 -1
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
9
+ const require_usePrefix = require("../../../../internal/usePrefix.js");
10
+ const require_useDatePicker = require("../hooks/useDatePicker.js");
11
+ const require_Calendar = require("./Calendar.js");
12
+ let react = require("react");
13
+ react = require_runtime.__toESM(react);
14
+ let classnames = require("classnames");
15
+ classnames = require_runtime.__toESM(classnames);
16
+ let react_jsx_runtime = require("react/jsx-runtime");
17
+ let _carbon_utilities_date_picker = require("@carbon/utilities/date-picker");
18
+ //#region src/components/DatePicker/next/components/DatePicker.tsx
19
+ /**
20
+ * Copyright IBM Corp. 2026
21
+ *
22
+ * This source code is licensed under the Apache-2.0 license found in the
23
+ * LICENSE file in the root directory of this source tree.
24
+ */
25
+ /**
26
+ * DatePicker component
27
+ * Main wrapper component that orchestrates date picker functionality
28
+ * Maintains 100% backwards compatibility with Carbon React v11
29
+ */
30
+ function DatePicker({ datePickerType = "single", dateFormat = "m/d/Y", minDate, maxDate, locale = "en", readOnly = false, light = false, short = false, allowInput = true, closeOnSelect = true, onChange, onClose, onOpen, className, children, value }) {
31
+ const containerRef = (0, react.useRef)(null);
32
+ const prefix = require_usePrefix.usePrefix();
33
+ const { context, isOpen, selectDate, openCalendar, closeCalendar, handleInputFocus, handleInputBlur, handleInputChange, send, startInputRef, endInputRef, calendarRef, exitSentinelRef, handleExitSentinelFocus } = require_useDatePicker.useDatePicker({
34
+ datePickerType,
35
+ value,
36
+ minDate,
37
+ maxDate,
38
+ dateFormat,
39
+ allowInput,
40
+ closeOnSelect,
41
+ readOnly,
42
+ locale,
43
+ onChange,
44
+ onOpen,
45
+ onClose
46
+ });
47
+ const handleNavigate = (eventType) => {
48
+ send(eventType);
49
+ };
50
+ const handleIconClick = () => {
51
+ if (isOpen) closeCalendar();
52
+ else openCalendar();
53
+ };
54
+ const enhancedChildren = react.Children.toArray(children).map((child, index) => {
55
+ if (!(0, react.isValidElement)(child)) return child;
56
+ const isStartInput = index === 0;
57
+ const isEndInput = index === 1 && datePickerType === "range";
58
+ const inputRef = isStartInput ? startInputRef : isEndInput ? endInputRef : void 0;
59
+ let inputValue = child.props.value ?? "";
60
+ if (inputValue === "") {
61
+ if (isStartInput && context.startDate) inputValue = (0, _carbon_utilities_date_picker.formatPlainDate)(context.startDate, context.dateFormat);
62
+ else if (isEndInput && context.endDate) inputValue = (0, _carbon_utilities_date_picker.formatPlainDate)(context.endDate, context.dateFormat);
63
+ }
64
+ const enhancedProps = {
65
+ ...child.props,
66
+ value: inputValue,
67
+ disabled: child.props.disabled || context.isDisabled,
68
+ readOnly: child.props.readOnly || readOnly,
69
+ onFocus: (e) => {
70
+ child.props.onFocus?.(e);
71
+ handleInputFocus(isEndInput ? "to" : "from");
72
+ },
73
+ onBlur: (e) => {
74
+ child.props.onBlur?.(e);
75
+ handleInputBlur();
76
+ },
77
+ onChange: (e) => {
78
+ child.props.onChange?.(e);
79
+ handleInputChange(e.target.value, isEndInput ? "to" : "from");
80
+ },
81
+ onClick: (e) => {
82
+ child.props.onClick?.(e);
83
+ if (!isOpen) openCalendar();
84
+ },
85
+ onKeyDown: (e) => {
86
+ child.props.onKeyDown?.(e);
87
+ if (!e.defaultPrevented && e.key === "Tab" && !e.shiftKey && !isOpen) {
88
+ e.preventDefault();
89
+ openCalendar();
90
+ }
91
+ },
92
+ onIconClick: () => {
93
+ child.props.onIconClick?.();
94
+ handleIconClick();
95
+ },
96
+ hideIcon: datePickerType === "simple" || child.props.hideIcon
97
+ };
98
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
99
+ className: (0, classnames.default)(`${prefix}--date-picker-container`, {
100
+ [`${prefix}--date-picker-container--single`]: datePickerType === "single",
101
+ [`${prefix}--date-picker-container--from`]: isStartInput && datePickerType === "range",
102
+ [`${prefix}--date-picker-container--to`]: isEndInput && datePickerType === "range"
103
+ }),
104
+ children: react.default.createElement(child.type, {
105
+ ...child.props,
106
+ ...enhancedProps,
107
+ ref: inputRef
108
+ })
109
+ }, child.props.id);
110
+ });
111
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
112
+ ref: containerRef,
113
+ className: (0, classnames.default)(`${prefix}--date-picker`, `${prefix}--date-picker--next`, {
114
+ [`${prefix}--date-picker--simple`]: datePickerType === "simple",
115
+ [`${prefix}--date-picker--single`]: datePickerType === "single",
116
+ [`${prefix}--date-picker--range`]: datePickerType === "range",
117
+ [`${prefix}--date-picker--light`]: light,
118
+ [`${prefix}--date-picker--short`]: short,
119
+ [`${prefix}--date-picker--open`]: isOpen
120
+ }, className),
121
+ children: [
122
+ enhancedChildren,
123
+ datePickerType !== "simple" && isOpen && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
124
+ ref: calendarRef,
125
+ className: `${prefix}--date-picker__calendar-container`,
126
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Calendar.Calendar, {
127
+ context,
128
+ onDateSelect: selectDate,
129
+ onNavigate: handleNavigate,
130
+ locale
131
+ })
132
+ }),
133
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
134
+ ref: exitSentinelRef,
135
+ tabIndex: -1,
136
+ "aria-hidden": true,
137
+ onFocus: handleExitSentinelFocus,
138
+ style: {
139
+ position: "absolute",
140
+ width: 0,
141
+ height: 0,
142
+ overflow: "hidden"
143
+ }
144
+ })
145
+ ]
146
+ });
147
+ }
148
+ DatePicker.displayName = "DatePicker";
149
+ //#endregion
150
+ exports.DatePicker = DatePicker;
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ /**
9
+ * DatePickerInput component props
10
+ * Maintains 100% backwards compatibility with Carbon React v11 API
11
+ */
12
+ export interface DatePickerInputProps {
13
+ /**
14
+ * The unique identifier for the input (required)
15
+ */
16
+ id: string;
17
+ /**
18
+ * The label text
19
+ */
20
+ labelText?: React.ReactNode;
21
+ /**
22
+ * The placeholder text
23
+ */
24
+ placeholder?: string;
25
+ /**
26
+ * The input size
27
+ */
28
+ size?: 'sm' | 'md' | 'lg';
29
+ /**
30
+ * Whether the input is disabled
31
+ */
32
+ disabled?: boolean;
33
+ /**
34
+ * Whether the input is invalid
35
+ */
36
+ invalid?: boolean;
37
+ /**
38
+ * The invalid text to display
39
+ */
40
+ invalidText?: React.ReactNode;
41
+ /**
42
+ * Whether the input has a warning
43
+ */
44
+ warn?: boolean;
45
+ /**
46
+ * The warning text to display
47
+ */
48
+ warnText?: React.ReactNode;
49
+ /**
50
+ * Helper text to display below the input
51
+ */
52
+ helperText?: React.ReactNode;
53
+ /**
54
+ * Whether to hide the label visually (still accessible)
55
+ */
56
+ hideLabel?: boolean;
57
+ /**
58
+ * Additional CSS class names
59
+ */
60
+ className?: string;
61
+ /**
62
+ * The input value
63
+ */
64
+ value?: string;
65
+ /**
66
+ * Default value for uncontrolled component
67
+ */
68
+ defaultValue?: string;
69
+ /**
70
+ * Change handler
71
+ */
72
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
73
+ /**
74
+ * Focus handler
75
+ */
76
+ onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
77
+ /**
78
+ * Blur handler
79
+ */
80
+ onBlur?: (event: React.FocusEvent<HTMLInputElement>) => void;
81
+ /**
82
+ * Keydown handler
83
+ */
84
+ onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
85
+ /**
86
+ * Click handler
87
+ */
88
+ onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
89
+ /**
90
+ * Icon description for accessibility
91
+ */
92
+ iconDescription?: string;
93
+ /**
94
+ * Calendar icon click handler
95
+ */
96
+ onIconClick?: () => void;
97
+ /**
98
+ * Whether to show the calendar icon
99
+ */
100
+ hideIcon?: boolean;
101
+ /**
102
+ * Pattern for input validation
103
+ */
104
+ pattern?: string;
105
+ /**
106
+ * Type of input
107
+ */
108
+ type?: string;
109
+ /**
110
+ * Whether the input is read-only
111
+ */
112
+ readOnly?: boolean;
113
+ /**
114
+ * Autocomplete attribute
115
+ */
116
+ autoComplete?: string;
117
+ /**
118
+ * Name attribute
119
+ */
120
+ name?: string;
121
+ /**
122
+ * Whether the field is required
123
+ */
124
+ required?: boolean;
125
+ /**
126
+ * Callback when calendar opens (for internal use)
127
+ */
128
+ onOpen?: () => void;
129
+ /**
130
+ * Decorator component (e.g., AI Label)
131
+ */
132
+ decorator?: React.ReactNode;
133
+ /**
134
+ * @deprecated Use `decorator` instead. Will be removed in next major version.
135
+ */
136
+ slug?: React.ReactNode;
137
+ }
138
+ /**
139
+ * DatePickerInput component
140
+ * Input field for date picker with Carbon Design System styling
141
+ * Maintains 100% backwards compatibility with Carbon React v11
142
+ */
143
+ export declare const DatePickerInput: React.ForwardRefExoticComponent<DatePickerInputProps & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
9
+ const require_usePrefix = require("../../../../internal/usePrefix.js");
10
+ let react = require("react");
11
+ react = require_runtime.__toESM(react);
12
+ let classnames = require("classnames");
13
+ classnames = require_runtime.__toESM(classnames);
14
+ let react_jsx_runtime = require("react/jsx-runtime");
15
+ //#region src/components/DatePicker/next/components/DatePickerInput.tsx
16
+ /**
17
+ * Copyright IBM Corp. 2026
18
+ *
19
+ * This source code is licensed under the Apache-2.0 license found in the
20
+ * LICENSE file in the root directory of this source tree.
21
+ */
22
+ /**
23
+ * DatePickerInput component
24
+ * Input field for date picker with Carbon Design System styling
25
+ * Maintains 100% backwards compatibility with Carbon React v11
26
+ */
27
+ const DatePickerInput = (0, react.forwardRef)(function DatePickerInput({ id, labelText, placeholder = "mm/dd/yyyy", size = "md", disabled = false, invalid = false, invalidText, warn = false, warnText, helperText, hideLabel = false, className, value, defaultValue, onChange, onFocus, onBlur, onKeyDown, onClick, iconDescription = "Open calendar", onIconClick, hideIcon = false, pattern, type = "text", readOnly = false, autoComplete = "off", name, required = false, onOpen: _onOpen, decorator, slug, ...rest }, ref) {
28
+ const prefix = require_usePrefix.usePrefix();
29
+ const candidate = decorator || slug;
30
+ const normalizedDecorator = candidate && (0, react.isValidElement)(candidate) && candidate.type?.displayName === "AILabel" && (0, react.isValidElement)(candidate) ? (0, react.cloneElement)(candidate, { size: "mini" }) : candidate;
31
+ const wrapperClasses = (0, classnames.default)(`${prefix}--date-picker-input__wrapper`, className, {
32
+ [`${prefix}--date-picker-input__wrapper--slug`]: slug,
33
+ [`${prefix}--date-picker-input__wrapper--decorator`]: decorator
34
+ });
35
+ const inputClasses = (0, classnames.default)(`${prefix}--date-picker__input`, {
36
+ [`${prefix}--date-picker__input--sm`]: size === "sm",
37
+ [`${prefix}--date-picker__input--lg`]: size === "lg",
38
+ [`${prefix}--date-picker__input--invalid`]: invalid,
39
+ [`${prefix}--date-picker__input--warn`]: warn && !invalid
40
+ });
41
+ const labelClasses = (0, classnames.default)(`${prefix}--label`, {
42
+ [`${prefix}--visually-hidden`]: hideLabel,
43
+ [`${prefix}--label--disabled`]: disabled
44
+ });
45
+ const showInvalidText = invalid && invalidText;
46
+ const showWarnText = !invalid && warn && warnText;
47
+ const showHelperText = !invalid && !warn && helperText;
48
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
49
+ labelText && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
50
+ htmlFor: id,
51
+ className: labelClasses,
52
+ children: [labelText, required && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
53
+ className: `${prefix}--label__required`,
54
+ children: "*"
55
+ })]
56
+ }),
57
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
58
+ className: wrapperClasses,
59
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
60
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
61
+ ...rest,
62
+ ref,
63
+ id,
64
+ name,
65
+ type,
66
+ className: inputClasses,
67
+ placeholder,
68
+ value,
69
+ defaultValue,
70
+ disabled,
71
+ readOnly,
72
+ pattern,
73
+ autoComplete,
74
+ required,
75
+ onChange,
76
+ onFocus,
77
+ onBlur,
78
+ onKeyDown,
79
+ onClick,
80
+ "aria-invalid": invalid || void 0,
81
+ "aria-describedby": showInvalidText ? `${id}-error` : showWarnText ? `${id}-warn` : showHelperText ? `${id}-helper` : void 0
82
+ }),
83
+ slug ? normalizedDecorator : decorator ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
84
+ className: `${prefix}--date-picker-input-inner-wrapper--decorator`,
85
+ children: normalizedDecorator
86
+ }) : null,
87
+ !hideIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
88
+ type: "button",
89
+ className: `${prefix}--date-picker__icon`,
90
+ onClick: onIconClick,
91
+ disabled: disabled || readOnly,
92
+ "aria-label": iconDescription,
93
+ tabIndex: -1,
94
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
95
+ focusable: "false",
96
+ preserveAspectRatio: "xMidYMid meet",
97
+ xmlns: "http://www.w3.org/2000/svg",
98
+ fill: "currentColor",
99
+ width: "16",
100
+ height: "16",
101
+ viewBox: "0 0 32 32",
102
+ "aria-hidden": "true",
103
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M26,4h-4V2h-2v2h-8V2h-2v2H6C4.9,4,4,4.9,4,6v20c0,1.1,0.9,2,2,2h20c1.1,0,2-0.9,2-2V6C28,4.9,27.1,4,26,4z M26,26H6V12h20 V26z M26,10H6V6h4v2h2V6h8v2h2V6h4V10z" })
104
+ })
105
+ })
106
+ ] })
107
+ }),
108
+ showInvalidText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
109
+ id: `${id}-error`,
110
+ className: `${prefix}--form-requirement`,
111
+ children: invalidText
112
+ }),
113
+ showWarnText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
114
+ id: `${id}-warn`,
115
+ className: `${prefix}--form-requirement`,
116
+ children: warnText
117
+ }),
118
+ showHelperText && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
119
+ id: `${id}-helper`,
120
+ className: `${prefix}--form__helper-text`,
121
+ children: helperText
122
+ })
123
+ ] });
124
+ });
125
+ DatePickerInput.displayName = "DatePickerInput";
126
+ //#endregion
127
+ exports.DatePickerInput = DatePickerInput;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ export interface DatePickerSkeletonProps {
9
+ /**
10
+ * Specify whether the skeleton should be a range date picker
11
+ */
12
+ range?: boolean;
13
+ /**
14
+ * Additional CSS class names
15
+ */
16
+ className?: string;
17
+ }
18
+ /**
19
+ * DatePickerSkeleton component for loading states
20
+ */
21
+ export declare const DatePickerSkeleton: React.FC<DatePickerSkeletonProps>;
22
+ export default DatePickerSkeleton;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
9
+ const require_usePrefix = require("../../../../internal/usePrefix.js");
10
+ let react = require("react");
11
+ react = require_runtime.__toESM(react);
12
+ let react_jsx_runtime = require("react/jsx-runtime");
13
+ //#region src/components/DatePicker/next/components/DatePickerSkeleton.tsx
14
+ /**
15
+ * Copyright IBM Corp. 2026
16
+ *
17
+ * This source code is licensed under the Apache-2.0 license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
20
+ /**
21
+ * DatePickerSkeleton component for loading states
22
+ */
23
+ const DatePickerSkeleton = ({ range = false, className }) => {
24
+ const prefix = require_usePrefix.usePrefix();
25
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
26
+ className: `${prefix}--form-item`,
27
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
28
+ className: `${prefix}--date-picker ${prefix}--date-picker--next ${prefix}--date-picker--${range ? "range" : "single"} ${prefix}--skeleton ${className || ""}`,
29
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
30
+ className: `${prefix}--date-picker-container`,
31
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: `${prefix}--date-picker__input ${prefix}--skeleton` })]
32
+ }), range && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
33
+ className: `${prefix}--date-picker-container`,
34
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: `${prefix}--date-picker__input ${prefix}--skeleton` })]
35
+ })]
36
+ })
37
+ });
38
+ };
39
+ //#endregion
40
+ exports.DatePickerSkeleton = DatePickerSkeleton;
41
+ exports.default = DatePickerSkeleton;
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Copyright IBM Corp. 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type RefObject } from 'react';
8
+ import { DatePickerState, type DatePickerContext } from '@carbon/utilities/date-picker';
9
+ /**
10
+ * Configuration for the useDatePicker hook
11
+ * Maintains 100% backwards compatibility with Carbon React v11 API
12
+ */
13
+ export interface UseDatePickerConfig {
14
+ /**
15
+ * The type of date picker (Carbon API uses datePickerType, not mode)
16
+ */
17
+ datePickerType?: 'simple' | 'single' | 'range';
18
+ /**
19
+ * Initial value as ISO date string
20
+ */
21
+ value?: string;
22
+ /**
23
+ * Minimum selectable date (mm/dd/yyyy format - Carbon API)
24
+ */
25
+ minDate?: string | null;
26
+ /**
27
+ * Maximum selectable date (mm/dd/yyyy format - Carbon API)
28
+ */
29
+ maxDate?: string | null;
30
+ /**
31
+ * Date format string (Flatpickr-compatible format)
32
+ */
33
+ dateFormat?: string;
34
+ /**
35
+ * Whether to allow manual input
36
+ */
37
+ allowInput?: boolean;
38
+ /**
39
+ * Whether to close calendar on date selection
40
+ */
41
+ closeOnSelect?: boolean;
42
+ /**
43
+ * Whether the picker is disabled
44
+ */
45
+ disabled?: boolean;
46
+ /**
47
+ * Whether the picker is read-only (Carbon uses readOnly, not readonly)
48
+ */
49
+ readOnly?: boolean;
50
+ /**
51
+ * Locale for date formatting
52
+ */
53
+ locale?: string;
54
+ /**
55
+ * Change handler - receives array of Date objects (Carbon API)
56
+ */
57
+ onChange?: (dates: Date[]) => void;
58
+ /**
59
+ * Open handler
60
+ */
61
+ onOpen?: () => void;
62
+ /**
63
+ * Close handler
64
+ */
65
+ onClose?: () => void;
66
+ }
67
+ /**
68
+ * Return type for the useDatePicker hook
69
+ */
70
+ export interface UseDatePickerReturn {
71
+ /**
72
+ * Current state machine context
73
+ */
74
+ context: DatePickerContext;
75
+ /**
76
+ * Ref to attach to the exit sentinel element in the render tree.
77
+ * The sentinel is a visually-hidden, aria-hidden span placed just after the
78
+ * calendar container. It has tabindex="-1" by default and is briefly set to
79
+ * tabindex="0" when Tab is pressed from the calendar so the browser delivers
80
+ * focus there naturally — no DOM scan needed.
81
+ */
82
+ exitSentinelRef: RefObject<HTMLSpanElement | null>;
83
+ /**
84
+ * onFocus handler to attach to the exit sentinel element.
85
+ * Restores tabindex="-1" on the sentinel and closes the calendar if still open.
86
+ */
87
+ handleExitSentinelFocus: () => void;
88
+ /**
89
+ * Current state
90
+ */
91
+ state: DatePickerState;
92
+ /**
93
+ * Whether the calendar is open
94
+ */
95
+ isOpen: boolean;
96
+ /**
97
+ * Send an event to the state machine
98
+ */
99
+ send: (eventType: string, payload?: unknown) => void;
100
+ /**
101
+ * Open the calendar
102
+ */
103
+ openCalendar: () => void;
104
+ /**
105
+ * Close the calendar
106
+ */
107
+ closeCalendar: () => void;
108
+ /**
109
+ * Select a date
110
+ */
111
+ selectDate: (date: Temporal.PlainDate) => void;
112
+ /**
113
+ * Handle input focus
114
+ */
115
+ handleInputFocus: (inputType?: 'from' | 'to') => void;
116
+ /**
117
+ * Handle input blur
118
+ */
119
+ handleInputBlur: () => void;
120
+ /**
121
+ * Handle input value change
122
+ */
123
+ handleInputChange: (value: string, inputType?: 'from' | 'to') => void;
124
+ /**
125
+ * Ref for the start input
126
+ */
127
+ startInputRef: React.RefObject<HTMLInputElement | null>;
128
+ /**
129
+ * Ref for the end input (range mode)
130
+ */
131
+ endInputRef: React.RefObject<HTMLInputElement | null>;
132
+ /**
133
+ * Ref for the calendar container
134
+ */
135
+ calendarRef: React.RefObject<HTMLDivElement | null>;
136
+ }
137
+ /**
138
+ * React hook for managing date picker state using the shared state machine
139
+ * Maintains 100% backwards compatibility with Carbon React v11 API
140
+ *
141
+ * @param {UseDatePickerConfig} config - Configuration options
142
+ * @returns {UseDatePickerReturn} Hook return object with state and handlers
143
+ */
144
+ export declare function useDatePicker(config?: UseDatePickerConfig): UseDatePickerReturn;