@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.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +962 -962
- package/es/components/Card/Card.d.ts +48 -0
- package/es/components/Card/Card.js +148 -0
- package/es/components/Card/Card.types.d.ts +88 -0
- package/es/components/Card/CardAction.d.ts +37 -0
- package/es/components/Card/CardAction.js +32 -0
- package/es/components/Card/CardActions.d.ts +30 -0
- package/es/components/Card/CardActions.js +93 -0
- package/es/components/Card/CardBody.d.ts +11 -0
- package/es/components/Card/CardBody.js +34 -0
- package/es/components/Card/CardContext.d.ts +17 -0
- package/es/components/Card/CardContext.js +31 -0
- package/es/components/Card/CardFooter.d.ts +11 -0
- package/es/components/Card/CardFooter.js +34 -0
- package/es/components/Card/CardHeader.d.ts +11 -0
- package/es/components/Card/CardHeader.js +44 -0
- package/es/components/Card/CardHeaderMedia.d.ts +21 -0
- package/es/components/Card/CardHeaderMedia.js +24 -0
- package/es/components/Card/CardMedia.d.ts +35 -0
- package/es/components/Card/CardMedia.js +42 -0
- package/es/components/Card/CardTitle.d.ts +72 -0
- package/es/components/Card/CardTitle.js +86 -0
- package/es/components/Card/CardTitleMedia.d.ts +23 -0
- package/es/components/Card/CardTitleMedia.js +36 -0
- package/es/components/Card/_story-assets/data.d.ts +6 -0
- package/es/components/Card/_story-assets/options.d.ts +47 -0
- package/es/components/Card/index.d.ts +8 -0
- package/es/components/Card/index.js +33 -0
- package/es/components/Checkbox/Checkbox.js +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.js +2 -2
- package/es/components/ComboButton/index.js +1 -1
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/DatePicker/DatePicker.d.ts +10 -0
- package/es/components/DatePicker/DatePicker.js +7 -6
- package/es/components/DatePicker/next/components/Calendar.d.ts +40 -0
- package/es/components/DatePicker/next/components/Calendar.js +181 -0
- package/es/components/DatePicker/next/components/DatePicker.d.ts +86 -0
- package/es/components/DatePicker/next/components/DatePicker.js +147 -0
- package/es/components/DatePicker/next/components/DatePickerInput.d.ts +143 -0
- package/es/components/DatePicker/next/components/DatePickerInput.js +124 -0
- package/es/components/DatePicker/next/components/DatePickerSkeleton.d.ts +22 -0
- package/es/components/DatePicker/next/components/DatePickerSkeleton.js +32 -0
- package/es/components/DatePicker/next/hooks/useDatePicker.d.ts +144 -0
- package/es/components/DatePicker/next/hooks/useDatePicker.js +286 -0
- package/es/components/DatePicker/next/index.d.ts +12 -0
- package/es/components/DatePicker/next/index.js +19 -0
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.js +2 -2
- package/es/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/es/components/MenuButton/index.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +2 -2
- package/es/components/MultiSelect/MultiSelect.js +2 -2
- package/es/components/NumberInput/NumberInput.js +2 -2
- package/es/components/OverflowMenu/next/index.js +1 -1
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/Select/Select.js +1 -1
- package/es/components/Tag/SelectableTag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +7 -5
- package/es/internal/checkForOverflow.d.ts +5 -0
- package/es/internal/useFocus.d.ts +23 -0
- package/es/internal/usePrefersReducedMotion.d.ts +11 -0
- package/es/internal/useSidePanelPresence.d.ts +21 -0
- package/lib/components/Card/Card.d.ts +48 -0
- package/lib/components/Card/Card.js +161 -0
- package/lib/components/Card/Card.types.d.ts +88 -0
- package/lib/components/Card/CardAction.d.ts +37 -0
- package/lib/components/Card/CardAction.js +41 -0
- package/lib/components/Card/CardActions.d.ts +30 -0
- package/lib/components/Card/CardActions.js +96 -0
- package/lib/components/Card/CardBody.d.ts +11 -0
- package/lib/components/Card/CardBody.js +37 -0
- package/lib/components/Card/CardContext.d.ts +17 -0
- package/lib/components/Card/CardContext.js +32 -0
- package/lib/components/Card/CardFooter.d.ts +11 -0
- package/lib/components/Card/CardFooter.js +37 -0
- package/lib/components/Card/CardHeader.d.ts +11 -0
- package/lib/components/Card/CardHeader.js +47 -0
- package/lib/components/Card/CardHeaderMedia.d.ts +21 -0
- package/lib/components/Card/CardHeaderMedia.js +33 -0
- package/lib/components/Card/CardMedia.d.ts +35 -0
- package/lib/components/Card/CardMedia.js +51 -0
- package/lib/components/Card/CardTitle.d.ts +72 -0
- package/lib/components/Card/CardTitle.js +89 -0
- package/lib/components/Card/CardTitleMedia.d.ts +23 -0
- package/lib/components/Card/CardTitleMedia.js +39 -0
- package/lib/components/Card/_story-assets/data.d.ts +6 -0
- package/lib/components/Card/_story-assets/options.d.ts +47 -0
- package/lib/components/Card/index.d.ts +8 -0
- package/lib/components/Card/index.js +48 -0
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +2 -2
- package/lib/components/ComboButton/index.js +1 -1
- package/lib/components/ComposedModal/ComposedModal.js +1 -1
- package/lib/components/DatePicker/DatePicker.d.ts +10 -0
- package/lib/components/DatePicker/DatePicker.js +7 -6
- package/lib/components/DatePicker/next/components/Calendar.d.ts +40 -0
- package/lib/components/DatePicker/next/components/Calendar.js +184 -0
- package/lib/components/DatePicker/next/components/DatePicker.d.ts +86 -0
- package/lib/components/DatePicker/next/components/DatePicker.js +150 -0
- package/lib/components/DatePicker/next/components/DatePickerInput.d.ts +143 -0
- package/lib/components/DatePicker/next/components/DatePickerInput.js +127 -0
- package/lib/components/DatePicker/next/components/DatePickerSkeleton.d.ts +22 -0
- package/lib/components/DatePicker/next/components/DatePickerSkeleton.js +41 -0
- package/lib/components/DatePicker/next/hooks/useDatePicker.d.ts +144 -0
- package/lib/components/DatePicker/next/hooks/useDatePicker.js +286 -0
- package/lib/components/DatePicker/next/index.d.ts +12 -0
- package/lib/components/DatePicker/next/index.js +27 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +2 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -2
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/NumberInput/NumberInput.js +2 -2
- package/lib/components/OverflowMenu/next/index.js +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/Tag/SelectableTag.js +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +59 -45
- package/lib/internal/checkForOverflow.d.ts +5 -0
- package/lib/internal/useFocus.d.ts +23 -0
- package/lib/internal/usePrefersReducedMotion.d.ts +11 -0
- package/lib/internal/useSidePanelPresence.d.ts +21 -0
- package/package.json +11 -11
- package/scss/components/action-set/_action-set.scss +9 -0
- package/scss/components/action-set/_index.scss +9 -0
- package/scss/components/resizer/_index.scss +9 -0
- package/scss/components/resizer/_resizer.scss +9 -0
- package/scss/components/side-panel/_index.scss +9 -0
- package/scss/components/side-panel/_side-panel.scss +9 -0
- package/scss/components/truncated-text/_index.scss +9 -0
- package/scss/components/truncated-text/_truncated-text.scss +9 -0
- package/telemetry.yml +57 -1
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import { usePrefix } from "../../../../internal/usePrefix.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/DatePicker/next/components/DatePickerSkeleton.tsx
|
|
12
|
+
/**
|
|
13
|
+
* DatePickerSkeleton component for loading states
|
|
14
|
+
*/
|
|
15
|
+
const DatePickerSkeleton = ({ range = false, className }) => {
|
|
16
|
+
const prefix = usePrefix();
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: `${prefix}--form-item`,
|
|
19
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
20
|
+
className: `${prefix}--date-picker ${prefix}--date-picker--next ${prefix}--date-picker--${range ? "range" : "single"} ${prefix}--skeleton ${className || ""}`,
|
|
21
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
22
|
+
className: `${prefix}--date-picker-container`,
|
|
23
|
+
children: [/* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsx("div", { className: `${prefix}--date-picker__input ${prefix}--skeleton` })]
|
|
24
|
+
}), range && /* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: `${prefix}--date-picker-container`,
|
|
26
|
+
children: [/* @__PURE__ */ jsx("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ jsx("div", { className: `${prefix}--date-picker__input ${prefix}--skeleton` })]
|
|
27
|
+
})]
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { DatePickerSkeleton, DatePickerSkeleton as default };
|
|
@@ -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;
|
|
@@ -0,0 +1,286 @@
|
|
|
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
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
9
|
+
import { ClickOutsideHandler, DatePickerEvent, DatePickerState, DatePickerStateMachine, mapKeyboardToStateMachineEvent, parseDateToPlainDate, plainDateToDate } from "@carbon/utilities/date-picker";
|
|
10
|
+
//#region src/components/DatePicker/next/hooks/useDatePicker.ts
|
|
11
|
+
/**
|
|
12
|
+
* Copyright IBM Corp. 2026
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* React hook for managing date picker state using the shared state machine
|
|
19
|
+
* Maintains 100% backwards compatibility with Carbon React v11 API
|
|
20
|
+
*
|
|
21
|
+
* @param {UseDatePickerConfig} config - Configuration options
|
|
22
|
+
* @returns {UseDatePickerReturn} Hook return object with state and handlers
|
|
23
|
+
*/
|
|
24
|
+
function useDatePicker(config = {}) {
|
|
25
|
+
const { datePickerType = "single", value = "", minDate = null, maxDate = null, dateFormat = "m/d/Y", closeOnSelect = true, disabled = false, readOnly = false, onChange, onOpen, onClose } = config;
|
|
26
|
+
const startInputRef = useRef(null);
|
|
27
|
+
const endInputRef = useRef(null);
|
|
28
|
+
const calendarRef = useRef(null);
|
|
29
|
+
const exitSentinelRef = useRef(null);
|
|
30
|
+
const machineRef = useRef(null);
|
|
31
|
+
const suppressOpenOnFocusRef = useRef(false);
|
|
32
|
+
const [context, setContext] = useState(() => {
|
|
33
|
+
const machine = new DatePickerStateMachine({
|
|
34
|
+
mode: datePickerType,
|
|
35
|
+
value,
|
|
36
|
+
minDate: parseDateToPlainDate(minDate),
|
|
37
|
+
maxDate: parseDateToPlainDate(maxDate),
|
|
38
|
+
dateFormat,
|
|
39
|
+
isDisabled: disabled,
|
|
40
|
+
isReadonly: readOnly
|
|
41
|
+
});
|
|
42
|
+
machineRef.current = machine;
|
|
43
|
+
return machine.getContext();
|
|
44
|
+
});
|
|
45
|
+
const [state, setState] = useState(() => {
|
|
46
|
+
return machineRef.current?.getState() || DatePickerState.IDLE;
|
|
47
|
+
});
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const machine = machineRef.current;
|
|
50
|
+
if (!machine) return;
|
|
51
|
+
let wasCalendarOpen = machine.getContext().isOpen;
|
|
52
|
+
return machine.subscribe((transition) => {
|
|
53
|
+
setContext(transition.context);
|
|
54
|
+
setState(transition.to);
|
|
55
|
+
if (transition.to === DatePickerState.CALENDAR_OPEN && onOpen) onOpen();
|
|
56
|
+
if (wasCalendarOpen && !transition.context.isOpen && onClose) onClose();
|
|
57
|
+
wasCalendarOpen = transition.context.isOpen;
|
|
58
|
+
});
|
|
59
|
+
}, [onOpen, onClose]);
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!context.shouldRestoreFocus) return;
|
|
62
|
+
const targetRef = context.restoreFocusTo === "to" ? endInputRef : startInputRef;
|
|
63
|
+
const timeoutId = window.setTimeout(() => {
|
|
64
|
+
suppressOpenOnFocusRef.current = true;
|
|
65
|
+
targetRef.current?.focus();
|
|
66
|
+
machineRef.current?.updateContext({
|
|
67
|
+
shouldRestoreFocus: false,
|
|
68
|
+
restoreFocusTo: null
|
|
69
|
+
});
|
|
70
|
+
setContext(machineRef.current.getContext());
|
|
71
|
+
queueMicrotask(() => {
|
|
72
|
+
suppressOpenOnFocusRef.current = false;
|
|
73
|
+
});
|
|
74
|
+
}, 0);
|
|
75
|
+
return () => {
|
|
76
|
+
window.clearTimeout(timeoutId);
|
|
77
|
+
};
|
|
78
|
+
}, [context.shouldRestoreFocus, context.restoreFocusTo]);
|
|
79
|
+
const prevDatesRef = useRef("");
|
|
80
|
+
useEffect(() => {
|
|
81
|
+
if (!onChange) return;
|
|
82
|
+
const dates = [];
|
|
83
|
+
if (context.startDate) {
|
|
84
|
+
const date = plainDateToDate(context.startDate);
|
|
85
|
+
if (date) dates.push(date);
|
|
86
|
+
}
|
|
87
|
+
if (context.endDate) {
|
|
88
|
+
const date = plainDateToDate(context.endDate);
|
|
89
|
+
if (date) dates.push(date);
|
|
90
|
+
}
|
|
91
|
+
const datesKey = dates.map((d) => d.toISOString()).join(",");
|
|
92
|
+
if (dates.length > 0 && datesKey !== prevDatesRef.current) {
|
|
93
|
+
prevDatesRef.current = datesKey;
|
|
94
|
+
onChange(dates);
|
|
95
|
+
}
|
|
96
|
+
}, [
|
|
97
|
+
context.startDate,
|
|
98
|
+
context.endDate,
|
|
99
|
+
onChange
|
|
100
|
+
]);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
const machine = machineRef.current;
|
|
103
|
+
if (!machine) return;
|
|
104
|
+
if (disabled !== context.isDisabled) machine.send(disabled ? DatePickerEvent.DISABLE : DatePickerEvent.ENABLE);
|
|
105
|
+
if (readOnly !== context.isReadonly) machine.send(readOnly ? DatePickerEvent.SET_READONLY : DatePickerEvent.UNSET_READONLY);
|
|
106
|
+
const newMinDate = parseDateToPlainDate(minDate);
|
|
107
|
+
const newMaxDate = parseDateToPlainDate(maxDate);
|
|
108
|
+
if (newMinDate) machine.send(DatePickerEvent.SET_MIN_DATE, { date: newMinDate });
|
|
109
|
+
if (newMaxDate) machine.send(DatePickerEvent.SET_MAX_DATE, { date: newMaxDate });
|
|
110
|
+
}, [
|
|
111
|
+
disabled,
|
|
112
|
+
readOnly,
|
|
113
|
+
minDate,
|
|
114
|
+
maxDate,
|
|
115
|
+
context.isDisabled,
|
|
116
|
+
context.isReadonly
|
|
117
|
+
]);
|
|
118
|
+
const send = useCallback((eventType, payload) => {
|
|
119
|
+
machineRef.current?.send(eventType, payload);
|
|
120
|
+
}, []);
|
|
121
|
+
const openCalendar = useCallback(() => {
|
|
122
|
+
send(DatePickerEvent.CALENDAR_ICON_CLICK);
|
|
123
|
+
}, [send]);
|
|
124
|
+
const closeCalendar = useCallback(() => {
|
|
125
|
+
send(DatePickerEvent.CALENDAR_CLOSE);
|
|
126
|
+
}, [send]);
|
|
127
|
+
const selectDate = useCallback((date) => {
|
|
128
|
+
if (datePickerType === "range") if (!context.startDate || context.endDate) send(DatePickerEvent.RANGE_START_SELECT, { date });
|
|
129
|
+
else {
|
|
130
|
+
send(DatePickerEvent.RANGE_END_SELECT, { date });
|
|
131
|
+
if (closeOnSelect) send(DatePickerEvent.CALENDAR_CLOSE);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
send(DatePickerEvent.DATE_SELECT, { date });
|
|
135
|
+
if (closeOnSelect) send(DatePickerEvent.CALENDAR_CLOSE);
|
|
136
|
+
}
|
|
137
|
+
}, [
|
|
138
|
+
closeOnSelect,
|
|
139
|
+
datePickerType,
|
|
140
|
+
context.startDate,
|
|
141
|
+
context.endDate,
|
|
142
|
+
send
|
|
143
|
+
]);
|
|
144
|
+
const handleInputFocus = useCallback((inputType = "from") => {
|
|
145
|
+
send(DatePickerEvent.INPUT_FOCUS, { inputType });
|
|
146
|
+
if (suppressOpenOnFocusRef.current) return;
|
|
147
|
+
send(DatePickerEvent.CALENDAR_OPEN);
|
|
148
|
+
}, [send]);
|
|
149
|
+
const handleInputBlur = useCallback(() => {
|
|
150
|
+
send(DatePickerEvent.INPUT_BLUR);
|
|
151
|
+
}, [send]);
|
|
152
|
+
const handleInputChange = useCallback((value, inputType = "from") => {
|
|
153
|
+
send(DatePickerEvent.VALUE_CHANGE, {
|
|
154
|
+
value,
|
|
155
|
+
inputType
|
|
156
|
+
});
|
|
157
|
+
}, [send]);
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
if (!context.isOpen) return;
|
|
160
|
+
const handler = new ClickOutsideHandler({
|
|
161
|
+
isOpen: context.isOpen,
|
|
162
|
+
/**
|
|
163
|
+
* Check if a node is contained within the date picker elements
|
|
164
|
+
* @param {Node} node - The node to check
|
|
165
|
+
* @returns {boolean} True if the node is within the date picker
|
|
166
|
+
*/
|
|
167
|
+
containsNode: (node) => {
|
|
168
|
+
const calendarEl = calendarRef.current;
|
|
169
|
+
const startInputEl = startInputRef.current;
|
|
170
|
+
const endInputEl = endInputRef.current;
|
|
171
|
+
return (calendarEl?.contains(node) ?? false) || (startInputEl?.contains(node) ?? false) || (endInputEl?.contains(node) ?? false);
|
|
172
|
+
},
|
|
173
|
+
/**
|
|
174
|
+
* Handle clicks outside the date picker
|
|
175
|
+
*/
|
|
176
|
+
onOutsideClick: () => send(DatePickerEvent.OUTSIDE_CLICK),
|
|
177
|
+
useCapture: true,
|
|
178
|
+
attachDelay: 0
|
|
179
|
+
});
|
|
180
|
+
handler.attach();
|
|
181
|
+
return () => {
|
|
182
|
+
handler.detach();
|
|
183
|
+
};
|
|
184
|
+
}, [context.isOpen, send]);
|
|
185
|
+
useEffect(() => {
|
|
186
|
+
/**
|
|
187
|
+
* Handle keyboard events for calendar navigation
|
|
188
|
+
*
|
|
189
|
+
* @param {KeyboardEvent} event - Keyboard event
|
|
190
|
+
*/
|
|
191
|
+
const handleKeyDown = (event) => {
|
|
192
|
+
const { key } = event;
|
|
193
|
+
const target = event.target;
|
|
194
|
+
const calendarEl = calendarRef.current;
|
|
195
|
+
const startInputEl = startInputRef.current;
|
|
196
|
+
const endInputEl = endInputRef.current;
|
|
197
|
+
const isFocusInCalendar = calendarEl && (calendarEl.contains(target) || target === calendarEl || target.classList?.contains("cds--date-picker__calendar"));
|
|
198
|
+
const isFocusInInput = target === startInputEl || target === endInputEl || startInputEl && startInputEl.contains(target) || endInputEl && endInputEl.contains(target);
|
|
199
|
+
if (key === "Escape" && context.isOpen) {
|
|
200
|
+
event.preventDefault();
|
|
201
|
+
send(DatePickerEvent.ESCAPE_KEY);
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (key === "Tab") {
|
|
205
|
+
if (isFocusInInput && !event.shiftKey) {
|
|
206
|
+
event.preventDefault();
|
|
207
|
+
if (calendarEl) calendarEl.querySelector(".cds--date-picker__calendar")?.focus();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (isFocusInCalendar && event.shiftKey) {
|
|
211
|
+
event.preventDefault();
|
|
212
|
+
if (datePickerType === "range" && context.lastFocusedInput === "to" && endInputEl) endInputEl.focus();
|
|
213
|
+
else if (startInputEl) startInputEl.focus();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (isFocusInCalendar && !event.shiftKey) {
|
|
217
|
+
send(DatePickerEvent.TAB_KEY);
|
|
218
|
+
if (exitSentinelRef.current) exitSentinelRef.current.tabIndex = 0;
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
if (!context.isOpen) return;
|
|
224
|
+
if (!isFocusInCalendar || isFocusInInput) return;
|
|
225
|
+
const mappedEvent = mapKeyboardToStateMachineEvent({
|
|
226
|
+
key,
|
|
227
|
+
shiftKey: event.shiftKey,
|
|
228
|
+
mode: datePickerType,
|
|
229
|
+
state,
|
|
230
|
+
focusedDate: context.focusedDate
|
|
231
|
+
});
|
|
232
|
+
if (mappedEvent) {
|
|
233
|
+
if (mappedEvent.preventDefault) event.preventDefault();
|
|
234
|
+
if (mappedEvent.eventType) send(mappedEvent.eventType, mappedEvent.payload);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
239
|
+
return () => {
|
|
240
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
241
|
+
};
|
|
242
|
+
}, [
|
|
243
|
+
context.isOpen,
|
|
244
|
+
context.focusedDate,
|
|
245
|
+
context.lastFocusedInput,
|
|
246
|
+
state,
|
|
247
|
+
datePickerType,
|
|
248
|
+
send
|
|
249
|
+
]);
|
|
250
|
+
/**
|
|
251
|
+
* Called when the browser delivers focus to the exit sentinel.
|
|
252
|
+
* Closes the calendar (state machine already received TAB_KEY in _handleKeyDown)
|
|
253
|
+
* and immediately restores tabindex="-1" so future Tab presses skip the sentinel.
|
|
254
|
+
*
|
|
255
|
+
* TODO (carbon monorepo migration): replace this hand-rolled sentinel with the
|
|
256
|
+
* upstream Carbon wrapFocus utility, which implements the same start/end sentinel
|
|
257
|
+
* pattern for focus trapping and exit.
|
|
258
|
+
* Upstream location: packages/react/src/internal/wrapFocus.ts (wrapFocus /
|
|
259
|
+
* wrapFocusWithoutSentinels exports). Note that wrapFocus is designed to trap
|
|
260
|
+
* focus inside a container (modal pattern) rather than release it; the exit-only
|
|
261
|
+
* direction we need maps to the endTrapNode path in that utility.
|
|
262
|
+
*/
|
|
263
|
+
const handleExitSentinelFocus = useCallback(() => {
|
|
264
|
+
if (exitSentinelRef.current) exitSentinelRef.current.tabIndex = -1;
|
|
265
|
+
if (context.isOpen) send(DatePickerEvent.TAB_KEY);
|
|
266
|
+
}, [context.isOpen, send]);
|
|
267
|
+
return {
|
|
268
|
+
context,
|
|
269
|
+
state,
|
|
270
|
+
isOpen: context.isOpen,
|
|
271
|
+
send,
|
|
272
|
+
openCalendar,
|
|
273
|
+
closeCalendar,
|
|
274
|
+
selectDate,
|
|
275
|
+
handleInputFocus,
|
|
276
|
+
handleInputBlur,
|
|
277
|
+
handleInputChange,
|
|
278
|
+
startInputRef,
|
|
279
|
+
endInputRef,
|
|
280
|
+
calendarRef,
|
|
281
|
+
exitSentinelRef,
|
|
282
|
+
handleExitSentinelFocus
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
export { useDatePicker };
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
export { DatePicker } from './components/DatePicker';
|
|
8
|
+
export { DatePickerInput } from './components/DatePickerInput';
|
|
9
|
+
export { DatePickerSkeleton } from './components/DatePickerSkeleton';
|
|
10
|
+
export type { DatePickerProps } from './components/DatePicker';
|
|
11
|
+
export type { DatePickerInputProps } from './components/DatePickerInput';
|
|
12
|
+
export type { DatePickerSkeletonProps } from './components/DatePickerSkeleton';
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
9
|
+
import { DatePicker } from "./components/DatePicker.js";
|
|
10
|
+
import { DatePickerInput } from "./components/DatePickerInput.js";
|
|
11
|
+
import { DatePickerSkeleton } from "./components/DatePickerSkeleton.js";
|
|
12
|
+
//#region src/components/DatePicker/next/index.tsx
|
|
13
|
+
var next_exports = /* @__PURE__ */ __exportAll({
|
|
14
|
+
DatePicker: () => DatePicker,
|
|
15
|
+
DatePickerInput: () => DatePickerInput,
|
|
16
|
+
DatePickerSkeleton: () => DatePickerSkeleton
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DatePicker, DatePickerInput, DatePickerSkeleton, next_exports };
|
|
@@ -11,8 +11,8 @@ import { Text } from "../Text/Text.js";
|
|
|
11
11
|
import { useId } from "../../internal/useId.js";
|
|
12
12
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
13
13
|
import { isComponentElement } from "../../internal/utils.js";
|
|
14
|
-
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
15
14
|
import { AILabel } from "../AILabel/index.js";
|
|
15
|
+
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
16
16
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
17
17
|
import { cloneElement, forwardRef, useContext } from "react";
|
|
18
18
|
import cx from "classnames";
|
|
@@ -11,12 +11,12 @@ import { defaultItemToString } from "../../internal/defaultItemToString.js";
|
|
|
11
11
|
import { isItemDisabled } from "../../internal/isItemDisabled.js";
|
|
12
12
|
import { isComponentElement } from "../../internal/utils.js";
|
|
13
13
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
14
|
-
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
15
14
|
import { AILabel } from "../AILabel/index.js";
|
|
15
|
+
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
16
|
+
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
16
17
|
import { ListBoxSizePropType, ListBoxTypePropType } from "../ListBox/ListBoxPropTypes.js";
|
|
17
18
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
18
19
|
import ListBox from "../ListBox/index.js";
|
|
19
|
-
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
20
20
|
import React, { cloneElement, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
21
21
|
import cx from "classnames";
|
|
22
22
|
import PropTypes from "prop-types";
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { usePrefix } from "../../internal/usePrefix.js";
|
|
9
9
|
import { Escape } from "../../internal/keyboard/keys.js";
|
|
10
10
|
import { match } from "../../internal/keyboard/match.js";
|
|
11
|
-
import { composeEventHandlers } from "../../tools/events.js";
|
|
12
11
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
12
|
+
import { composeEventHandlers } from "../../tools/events.js";
|
|
13
13
|
import { isSearchValuePresent } from "../Search/utils.js";
|
|
14
14
|
import Search_default from "../Search/index.js";
|
|
15
15
|
import { forwardRef, useEffect, useRef, useState } from "react";
|
|
@@ -10,8 +10,8 @@ import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
|
10
10
|
import { useId } from "../../internal/useId.js";
|
|
11
11
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
12
12
|
import Button_default from "../Button/index.js";
|
|
13
|
-
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
14
13
|
import { Menu as Menu$1 } from "../Menu/Menu.js";
|
|
14
|
+
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
15
15
|
import { useAttachedMenu } from "../../internal/useAttachedMenu.js";
|
|
16
16
|
import { forwardRef, useRef } from "react";
|
|
17
17
|
import cx from "classnames";
|
|
@@ -14,16 +14,16 @@ import { deprecate } from "../../prop-types/deprecate.js";
|
|
|
14
14
|
import { defaultItemToString } from "../../internal/defaultItemToString.js";
|
|
15
15
|
import { isItemDisabled } from "../../internal/isItemDisabled.js";
|
|
16
16
|
import { isComponentElement } from "../../internal/utils.js";
|
|
17
|
+
import { AILabel } from "../AILabel/index.js";
|
|
18
|
+
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
17
19
|
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
18
20
|
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
19
|
-
import { AILabel } from "../AILabel/index.js";
|
|
20
21
|
import Checkbox_default from "../Checkbox/index.js";
|
|
21
22
|
import { ListBoxSizePropType, ListBoxTypePropType } from "../ListBox/ListBoxPropTypes.js";
|
|
22
23
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
23
24
|
import ListBox from "../ListBox/index.js";
|
|
24
25
|
import ListBoxSelection from "../ListBox/next/ListBoxSelection.js";
|
|
25
26
|
import ListBoxTrigger from "../ListBox/next/ListBoxTrigger.js";
|
|
26
|
-
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
27
27
|
import { defaultFilterItems } from "./filter.js";
|
|
28
28
|
import { sortingPropTypes } from "./MultiSelectPropTypes.js";
|
|
29
29
|
import { isSelectAllItem } from "./tools/isSelectAllItem.js";
|
|
@@ -16,13 +16,13 @@ import { defaultItemToString } from "../../internal/defaultItemToString.js";
|
|
|
16
16
|
import { isItemDisabled } from "../../internal/isItemDisabled.js";
|
|
17
17
|
import { isComponentElement } from "../../internal/utils.js";
|
|
18
18
|
import { useFeatureFlag } from "../FeatureFlags/index.js";
|
|
19
|
-
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
20
19
|
import { AILabel } from "../AILabel/index.js";
|
|
20
|
+
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
21
|
+
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
21
22
|
import Checkbox_default from "../Checkbox/index.js";
|
|
22
23
|
import { ListBoxSizePropType, ListBoxTypePropType } from "../ListBox/ListBoxPropTypes.js";
|
|
23
24
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
24
25
|
import ListBox from "../ListBox/index.js";
|
|
25
|
-
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
26
26
|
import { sortingPropTypes } from "./MultiSelectPropTypes.js";
|
|
27
27
|
import { isSelectAllItem } from "./tools/isSelectAllItem.js";
|
|
28
28
|
import { defaultCompareItems, defaultSortItems } from "./tools/sorting.js";
|
|
@@ -12,10 +12,10 @@ import { match } from "../../internal/keyboard/match.js";
|
|
|
12
12
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
13
13
|
import { isComponentElement } from "../../internal/utils.js";
|
|
14
14
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
15
|
-
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
16
15
|
import { AILabel } from "../AILabel/index.js";
|
|
17
|
-
import { FormContext } from "../FluidForm/FormContext.js";
|
|
18
16
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
17
|
+
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
18
|
+
import { FormContext } from "../FluidForm/FormContext.js";
|
|
19
19
|
import { clamp } from "../../internal/clamp.js";
|
|
20
20
|
import { NumberFormatOptionsPropType } from "./NumberFormatPropTypes.js";
|
|
21
21
|
import React, { cloneElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -11,8 +11,8 @@ import { deprecateValuesWithin } from "../../../prop-types/deprecateValuesWithin
|
|
|
11
11
|
import { mapPopoverAlign } from "../../../tools/mapPopoverAlign.js";
|
|
12
12
|
import { useFeatureFlag } from "../../FeatureFlags/index.js";
|
|
13
13
|
import { IconButton } from "../../IconButton/index.js";
|
|
14
|
-
import { mergeRefs } from "../../../tools/mergeRefs.js";
|
|
15
14
|
import { Menu as Menu$1 } from "../../Menu/Menu.js";
|
|
15
|
+
import { mergeRefs } from "../../../tools/mergeRefs.js";
|
|
16
16
|
import { useAttachedMenu } from "../../../internal/useAttachedMenu.js";
|
|
17
17
|
import React, { useEffect, useRef } from "react";
|
|
18
18
|
import cx from "classnames";
|
|
@@ -10,9 +10,9 @@ import { Text } from "../Text/Text.js";
|
|
|
10
10
|
import { useId } from "../../internal/useId.js";
|
|
11
11
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
12
12
|
import { isComponentElement } from "../../internal/utils.js";
|
|
13
|
-
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
14
13
|
import { AILabel } from "../AILabel/index.js";
|
|
15
14
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
15
|
+
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
16
16
|
import React, { cloneElement, useRef } from "react";
|
|
17
17
|
import cx from "classnames";
|
|
18
18
|
import PropTypes from "prop-types";
|
|
@@ -9,9 +9,9 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { useId } from "../../internal/useId.js";
|
|
10
10
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
11
11
|
import { isComponentElement } from "../../internal/utils.js";
|
|
12
|
-
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
13
12
|
import { AILabel } from "../AILabel/index.js";
|
|
14
13
|
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
14
|
+
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
15
15
|
import RadioButton_default from "../RadioButton/index.js";
|
|
16
16
|
import { Legend } from "../Text/createTextComponent.js";
|
|
17
17
|
import React, { Children, cloneElement, createContext, useEffect, useRef, useState } from "react";
|
|
@@ -9,9 +9,9 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { Text } from "../Text/Text.js";
|
|
10
10
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
11
11
|
import { isComponentElement } from "../../internal/utils.js";
|
|
12
|
+
import { AILabel } from "../AILabel/index.js";
|
|
12
13
|
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
13
14
|
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
14
|
-
import { AILabel } from "../AILabel/index.js";
|
|
15
15
|
import { composeEventHandlers } from "../../tools/events.js";
|
|
16
16
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
17
17
|
import React, { cloneElement, forwardRef, useContext, useState } from "react";
|
|
@@ -10,8 +10,8 @@ import { Text } from "../Text/Text.js";
|
|
|
10
10
|
import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
|
|
11
11
|
import { useId } from "../../internal/useId.js";
|
|
12
12
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
13
|
-
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
14
13
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
14
|
+
import { mergeRefs } from "../../tools/mergeRefs.js";
|
|
15
15
|
import { isEllipsisActive } from "./isEllipsisActive.js";
|
|
16
16
|
import Tag, { SIZES } from "./Tag.js";
|
|
17
17
|
import { forwardRef, useRef, useState } from "react";
|
|
@@ -13,8 +13,8 @@ import { useId } from "../../internal/useId.js";
|
|
|
13
13
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
14
14
|
import { isComponentElement } from "../../internal/utils.js";
|
|
15
15
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
16
|
-
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
17
16
|
import { AILabel } from "../AILabel/index.js";
|
|
17
|
+
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
18
18
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
19
19
|
import { getAnnouncement } from "../../internal/getAnnouncement.js";
|
|
20
20
|
import { cloneElement, forwardRef, useContext, useEffect, useRef, useState } from "react";
|