@indico-data/design-system 3.6.4 → 3.8.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/lib/index.js CHANGED
@@ -13674,7 +13674,26 @@ const DatePicker = (props) => {
13674
13674
  onTimeChange === null || onTimeChange === void 0 ? void 0 : onTimeChange(time);
13675
13675
  };
13676
13676
  const finalProps = Object.assign(Object.assign(Object.assign({}, commonProps), rest), modeProps);
13677
- return (jsxRuntime.jsxs("div", { className: "date-picker-wrapper", children: [hasTimePicker && (jsxRuntime.jsx("div", { className: "time-picker-wrapper", children: jsxRuntime.jsxs(Row, { align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("p", { className: "ma-0", children: "Select Time" }) }), jsxRuntime.jsx(Col, { children: jsxRuntime.jsx(TimePicker, { ref: ref, timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange, readonly: isReadOnly, tabIndex: timeTabIndex }) })] }) })), jsxRuntime.jsx(DayPicker, Object.assign({}, finalProps))] }));
13677
+ const wrapperRef = React.useRef(null);
13678
+ // Disable tab focus on all date picker elements
13679
+ React.useEffect(() => {
13680
+ const disableTabFocus = () => {
13681
+ if (wrapperRef.current) {
13682
+ const focusableElements = wrapperRef.current.querySelectorAll('button, input, select, textarea, a, [tabindex]:not([tabindex="-1"])');
13683
+ focusableElements.forEach((element) => {
13684
+ element.tabIndex = -1;
13685
+ });
13686
+ }
13687
+ };
13688
+ // Run immediately and set up observer for dynamic elements
13689
+ disableTabFocus();
13690
+ const observer = new MutationObserver(disableTabFocus);
13691
+ if (wrapperRef.current) {
13692
+ observer.observe(wrapperRef.current, { childList: true, subtree: true });
13693
+ }
13694
+ return () => observer.disconnect();
13695
+ }, []);
13696
+ return (jsxRuntime.jsxs("div", { className: "date-picker-wrapper", tabIndex: -1, ref: wrapperRef, children: [hasTimePicker && (jsxRuntime.jsx("div", { className: "time-picker-wrapper", children: jsxRuntime.jsxs(Row, { align: "center", children: [jsxRuntime.jsx(Col, { xs: "content", children: jsxRuntime.jsx("p", { className: "ma-0", children: "Select Time" }) }), jsxRuntime.jsx(Col, { children: jsxRuntime.jsx(TimePicker, { ref: ref, timeValue: timeValue !== null && timeValue !== void 0 ? timeValue : '', onTimeChange: handleTimeChange, readonly: isReadOnly, tabIndex: timeTabIndex }) })] }) })), jsxRuntime.jsx(DayPicker, Object.assign({}, finalProps))] }));
13678
13697
  };
13679
13698
 
13680
13699
  const IconTriggerDatePicker = (props) => {