@idds/react 1.5.31 → 1.5.34
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/dist/index.cjs.js +2 -2
- package/dist/index.css +1 -1
- package/dist/index.es.js +207 -230
- package/dist/index.umd.js +2 -2
- package/dist/types/components/ActionDropdown.d.ts +26 -17
- package/dist/types/components/ActionDropdown.d.ts.map +1 -1
- package/dist/types/components/BasicDropdown.d.ts +25 -0
- package/dist/types/components/BasicDropdown.d.ts.map +1 -0
- package/dist/types/components/DatePicker.d.ts +4 -1
- package/dist/types/components/DatePicker.d.ts.map +1 -1
- package/dist/types/components/SelectDropdown.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/types/components/Dropdown.d.ts +0 -24
- package/dist/types/components/Dropdown.d.ts.map +0 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React, { createContext, useRef, useState, useCallback, useMemo, useContext, useId, useEffect, forwardRef, createElement, Fragment as Fragment$1
|
|
2
|
+
import React, { createContext, useRef, useState, useCallback, useMemo, useContext, useId, useEffect, forwardRef, createElement, useImperativeHandle, Fragment as Fragment$1 } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
const iddsColorTokens = {
|
|
5
5
|
// Neutral Colors
|
|
@@ -824,136 +824,128 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
824
824
|
* This source code is licensed under the MIT license.
|
|
825
825
|
* See the LICENSE file in the root directory of this source tree.
|
|
826
826
|
*/
|
|
827
|
-
const __iconNode$
|
|
828
|
-
const IconAlertCircle = createReactComponent("outline", "alert-circle", "AlertCircle", __iconNode$
|
|
827
|
+
const __iconNode$u = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 8v4", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]];
|
|
828
|
+
const IconAlertCircle = createReactComponent("outline", "alert-circle", "AlertCircle", __iconNode$u);
|
|
829
829
|
/**
|
|
830
830
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
831
831
|
*
|
|
832
832
|
* This source code is licensed under the MIT license.
|
|
833
833
|
* See the LICENSE file in the root directory of this source tree.
|
|
834
834
|
*/
|
|
835
|
-
const __iconNode$
|
|
836
|
-
const IconAlertTriangle = createReactComponent("outline", "alert-triangle", "AlertTriangle", __iconNode$
|
|
835
|
+
const __iconNode$t = [["path", { "d": "M12 9v4", "key": "svg-0" }], ["path", { "d": "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", "key": "svg-1" }], ["path", { "d": "M12 16h.01", "key": "svg-2" }]];
|
|
836
|
+
const IconAlertTriangle = createReactComponent("outline", "alert-triangle", "AlertTriangle", __iconNode$t);
|
|
837
837
|
/**
|
|
838
838
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
839
839
|
*
|
|
840
840
|
* This source code is licensed under the MIT license.
|
|
841
841
|
* See the LICENSE file in the root directory of this source tree.
|
|
842
842
|
*/
|
|
843
|
-
const __iconNode$
|
|
844
|
-
const IconArrowNarrowDown = createReactComponent("outline", "arrow-narrow-down", "ArrowNarrowDown", __iconNode$
|
|
843
|
+
const __iconNode$s = [["path", { "d": "M12 5l0 14", "key": "svg-0" }], ["path", { "d": "M16 15l-4 4", "key": "svg-1" }], ["path", { "d": "M8 15l4 4", "key": "svg-2" }]];
|
|
844
|
+
const IconArrowNarrowDown = createReactComponent("outline", "arrow-narrow-down", "ArrowNarrowDown", __iconNode$s);
|
|
845
845
|
/**
|
|
846
846
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
847
847
|
*
|
|
848
848
|
* This source code is licensed under the MIT license.
|
|
849
849
|
* See the LICENSE file in the root directory of this source tree.
|
|
850
850
|
*/
|
|
851
|
-
const __iconNode$
|
|
852
|
-
const IconArrowNarrowUp = createReactComponent("outline", "arrow-narrow-up", "ArrowNarrowUp", __iconNode$
|
|
851
|
+
const __iconNode$r = [["path", { "d": "M12 5l0 14", "key": "svg-0" }], ["path", { "d": "M16 9l-4 -4", "key": "svg-1" }], ["path", { "d": "M8 9l4 -4", "key": "svg-2" }]];
|
|
852
|
+
const IconArrowNarrowUp = createReactComponent("outline", "arrow-narrow-up", "ArrowNarrowUp", __iconNode$r);
|
|
853
853
|
/**
|
|
854
854
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
855
855
|
*
|
|
856
856
|
* This source code is licensed under the MIT license.
|
|
857
857
|
* See the LICENSE file in the root directory of this source tree.
|
|
858
858
|
*/
|
|
859
|
-
const __iconNode$
|
|
860
|
-
const IconCalendar = createReactComponent("outline", "calendar", "Calendar", __iconNode$
|
|
859
|
+
const __iconNode$q = [["path", { "d": "M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z", "key": "svg-0" }], ["path", { "d": "M16 3v4", "key": "svg-1" }], ["path", { "d": "M8 3v4", "key": "svg-2" }], ["path", { "d": "M4 11h16", "key": "svg-3" }], ["path", { "d": "M11 15h1", "key": "svg-4" }], ["path", { "d": "M12 15v3", "key": "svg-5" }]];
|
|
860
|
+
const IconCalendar = createReactComponent("outline", "calendar", "Calendar", __iconNode$q);
|
|
861
861
|
/**
|
|
862
862
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
863
863
|
*
|
|
864
864
|
* This source code is licensed under the MIT license.
|
|
865
865
|
* See the LICENSE file in the root directory of this source tree.
|
|
866
866
|
*/
|
|
867
|
-
const __iconNode$
|
|
868
|
-
const IconCheck = createReactComponent("outline", "check", "Check", __iconNode$
|
|
867
|
+
const __iconNode$p = [["path", { "d": "M5 12l5 5l10 -10", "key": "svg-0" }]];
|
|
868
|
+
const IconCheck = createReactComponent("outline", "check", "Check", __iconNode$p);
|
|
869
869
|
/**
|
|
870
870
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
871
871
|
*
|
|
872
872
|
* This source code is licensed under the MIT license.
|
|
873
873
|
* See the LICENSE file in the root directory of this source tree.
|
|
874
874
|
*/
|
|
875
|
-
const __iconNode$
|
|
876
|
-
const IconChevronDown = createReactComponent("outline", "chevron-down", "ChevronDown", __iconNode$
|
|
875
|
+
const __iconNode$o = [["path", { "d": "M6 9l6 6l6 -6", "key": "svg-0" }]];
|
|
876
|
+
const IconChevronDown = createReactComponent("outline", "chevron-down", "ChevronDown", __iconNode$o);
|
|
877
877
|
/**
|
|
878
878
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
879
879
|
*
|
|
880
880
|
* This source code is licensed under the MIT license.
|
|
881
881
|
* See the LICENSE file in the root directory of this source tree.
|
|
882
882
|
*/
|
|
883
|
-
const __iconNode$
|
|
884
|
-
const IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode$
|
|
883
|
+
const __iconNode$n = [["path", { "d": "M15 6l-6 6l6 6", "key": "svg-0" }]];
|
|
884
|
+
const IconChevronLeft = createReactComponent("outline", "chevron-left", "ChevronLeft", __iconNode$n);
|
|
885
885
|
/**
|
|
886
886
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
887
887
|
*
|
|
888
888
|
* This source code is licensed under the MIT license.
|
|
889
889
|
* See the LICENSE file in the root directory of this source tree.
|
|
890
890
|
*/
|
|
891
|
-
const __iconNode$
|
|
892
|
-
const IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode$
|
|
891
|
+
const __iconNode$m = [["path", { "d": "M9 6l6 6l-6 6", "key": "svg-0" }]];
|
|
892
|
+
const IconChevronRight = createReactComponent("outline", "chevron-right", "ChevronRight", __iconNode$m);
|
|
893
893
|
/**
|
|
894
894
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
895
895
|
*
|
|
896
896
|
* This source code is licensed under the MIT license.
|
|
897
897
|
* See the LICENSE file in the root directory of this source tree.
|
|
898
898
|
*/
|
|
899
|
-
const __iconNode$
|
|
900
|
-
const IconChevronUp = createReactComponent("outline", "chevron-up", "ChevronUp", __iconNode$
|
|
899
|
+
const __iconNode$l = [["path", { "d": "M6 15l6 -6l6 6", "key": "svg-0" }]];
|
|
900
|
+
const IconChevronUp = createReactComponent("outline", "chevron-up", "ChevronUp", __iconNode$l);
|
|
901
901
|
/**
|
|
902
902
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
903
903
|
*
|
|
904
904
|
* This source code is licensed under the MIT license.
|
|
905
905
|
* See the LICENSE file in the root directory of this source tree.
|
|
906
906
|
*/
|
|
907
|
-
const __iconNode$
|
|
908
|
-
const IconChevronsLeft = createReactComponent("outline", "chevrons-left", "ChevronsLeft", __iconNode$
|
|
907
|
+
const __iconNode$k = [["path", { "d": "M11 7l-5 5l5 5", "key": "svg-0" }], ["path", { "d": "M17 7l-5 5l5 5", "key": "svg-1" }]];
|
|
908
|
+
const IconChevronsLeft = createReactComponent("outline", "chevrons-left", "ChevronsLeft", __iconNode$k);
|
|
909
909
|
/**
|
|
910
910
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
911
911
|
*
|
|
912
912
|
* This source code is licensed under the MIT license.
|
|
913
913
|
* See the LICENSE file in the root directory of this source tree.
|
|
914
914
|
*/
|
|
915
|
-
const __iconNode$
|
|
916
|
-
const IconChevronsRight = createReactComponent("outline", "chevrons-right", "ChevronsRight", __iconNode$
|
|
915
|
+
const __iconNode$j = [["path", { "d": "M7 7l5 5l-5 5", "key": "svg-0" }], ["path", { "d": "M13 7l5 5l-5 5", "key": "svg-1" }]];
|
|
916
|
+
const IconChevronsRight = createReactComponent("outline", "chevrons-right", "ChevronsRight", __iconNode$j);
|
|
917
917
|
/**
|
|
918
918
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
919
919
|
*
|
|
920
920
|
* This source code is licensed under the MIT license.
|
|
921
921
|
* See the LICENSE file in the root directory of this source tree.
|
|
922
922
|
*/
|
|
923
|
-
const __iconNode$
|
|
924
|
-
const IconCircleCheck = createReactComponent("outline", "circle-check", "CircleCheck", __iconNode$
|
|
923
|
+
const __iconNode$i = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M9 12l2 2l4 -4", "key": "svg-1" }]];
|
|
924
|
+
const IconCircleCheck = createReactComponent("outline", "circle-check", "CircleCheck", __iconNode$i);
|
|
925
925
|
/**
|
|
926
926
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
927
927
|
*
|
|
928
928
|
* This source code is licensed under the MIT license.
|
|
929
929
|
* See the LICENSE file in the root directory of this source tree.
|
|
930
930
|
*/
|
|
931
|
-
const __iconNode$
|
|
932
|
-
const IconCircleX = createReactComponent("outline", "circle-x", "CircleX", __iconNode$
|
|
931
|
+
const __iconNode$h = [["path", { "d": "M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "key": "svg-0" }], ["path", { "d": "M10 10l4 4m0 -4l-4 4", "key": "svg-1" }]];
|
|
932
|
+
const IconCircleX = createReactComponent("outline", "circle-x", "CircleX", __iconNode$h);
|
|
933
933
|
/**
|
|
934
934
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
935
935
|
*
|
|
936
936
|
* This source code is licensed under the MIT license.
|
|
937
937
|
* See the LICENSE file in the root directory of this source tree.
|
|
938
938
|
*/
|
|
939
|
-
const __iconNode$
|
|
940
|
-
const IconClock = createReactComponent("outline", "clock", "Clock", __iconNode$
|
|
939
|
+
const __iconNode$g = [["path", { "d": "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "key": "svg-0" }], ["path", { "d": "M12 7v5l3 3", "key": "svg-1" }]];
|
|
940
|
+
const IconClock = createReactComponent("outline", "clock", "Clock", __iconNode$g);
|
|
941
941
|
/**
|
|
942
942
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
943
943
|
*
|
|
944
944
|
* This source code is licensed under the MIT license.
|
|
945
945
|
* See the LICENSE file in the root directory of this source tree.
|
|
946
946
|
*/
|
|
947
|
-
const __iconNode$
|
|
948
|
-
const IconCube3dSphere = createReactComponent("outline", "cube-3d-sphere", "Cube3dSphere", __iconNode$
|
|
949
|
-
/**
|
|
950
|
-
* @license @tabler/icons-react v3.35.0 - MIT
|
|
951
|
-
*
|
|
952
|
-
* This source code is licensed under the MIT license.
|
|
953
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
954
|
-
*/
|
|
955
|
-
const __iconNode$f = [["path", { "d": "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-0" }], ["path", { "d": "M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-1" }], ["path", { "d": "M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "key": "svg-2" }]];
|
|
956
|
-
const IconDotsVertical = createReactComponent("outline", "dots-vertical", "DotsVertical", __iconNode$f);
|
|
947
|
+
const __iconNode$f = [["path", { "d": "M6 17.6l-2 -1.1v-2.5", "key": "svg-0" }], ["path", { "d": "M4 10v-2.5l2 -1.1", "key": "svg-1" }], ["path", { "d": "M10 4.1l2 -1.1l2 1.1", "key": "svg-2" }], ["path", { "d": "M18 6.4l2 1.1v2.5", "key": "svg-3" }], ["path", { "d": "M20 14v2.5l-2 1.12", "key": "svg-4" }], ["path", { "d": "M14 19.9l-2 1.1l-2 -1.1", "key": "svg-5" }], ["path", { "d": "M12 12l2 -1.1", "key": "svg-6" }], ["path", { "d": "M18 8.6l2 -1.1", "key": "svg-7" }], ["path", { "d": "M12 12l0 2.5", "key": "svg-8" }], ["path", { "d": "M12 18.5l0 2.5", "key": "svg-9" }], ["path", { "d": "M12 12l-2 -1.12", "key": "svg-10" }], ["path", { "d": "M6 8.6l-2 -1.1", "key": "svg-11" }]];
|
|
948
|
+
const IconCube3dSphere = createReactComponent("outline", "cube-3d-sphere", "Cube3dSphere", __iconNode$f);
|
|
957
949
|
/**
|
|
958
950
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
959
951
|
*
|
|
@@ -1138,94 +1130,102 @@ function AccordionCard({
|
|
|
1138
1130
|
)
|
|
1139
1131
|
] });
|
|
1140
1132
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
if (containerRef.current) {
|
|
1166
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
1167
|
-
const dropdownHeight = items.length * 40 + 16;
|
|
1168
|
-
const dropdownWidth = 160;
|
|
1169
|
-
const fitsBelow = rect.bottom + dropdownHeight <= window.innerHeight;
|
|
1170
|
-
const vertical = fitsBelow ? "bottom" : "top";
|
|
1171
|
-
const fitsRight = rect.right + dropdownWidth <= window.innerWidth;
|
|
1172
|
-
const horizontal = fitsRight ? "right" : "left";
|
|
1173
|
-
setDropdownPosition({ vertical, horizontal });
|
|
1174
|
-
}
|
|
1175
|
-
setOpen((o) => !o);
|
|
1176
|
-
};
|
|
1177
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: clsx("ina-action-dropdown", className), children: [
|
|
1178
|
-
React.isValidElement(trigger) && trigger.props && trigger.props.type === "button" ? React.cloneElement(trigger, {
|
|
1179
|
-
onClick: (e) => {
|
|
1180
|
-
if (typeof trigger.props.onClick === "function") {
|
|
1181
|
-
trigger.props.onClick(e);
|
|
1133
|
+
const ActionDropdown = forwardRef(
|
|
1134
|
+
({
|
|
1135
|
+
label,
|
|
1136
|
+
items,
|
|
1137
|
+
placement = "bottom-start",
|
|
1138
|
+
icon,
|
|
1139
|
+
className,
|
|
1140
|
+
menuClassName,
|
|
1141
|
+
triggerClassName,
|
|
1142
|
+
width = "auto",
|
|
1143
|
+
disabled = false
|
|
1144
|
+
}, ref) => {
|
|
1145
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
1146
|
+
const triggerRef = useRef(null);
|
|
1147
|
+
const menuRef = useRef(null);
|
|
1148
|
+
useImperativeHandle(ref, () => ({
|
|
1149
|
+
open: () => setIsOpen(true),
|
|
1150
|
+
close: () => setIsOpen(false),
|
|
1151
|
+
toggle: () => setIsOpen((prev) => !prev)
|
|
1152
|
+
}));
|
|
1153
|
+
useEffect(() => {
|
|
1154
|
+
const handleClickOutside = (event) => {
|
|
1155
|
+
if (triggerRef.current && !triggerRef.current.contains(event.target) && menuRef.current && !menuRef.current.contains(event.target)) {
|
|
1156
|
+
setIsOpen(false);
|
|
1182
1157
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1158
|
+
};
|
|
1159
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
1160
|
+
return () => {
|
|
1161
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1162
|
+
};
|
|
1163
|
+
}, []);
|
|
1164
|
+
const containerClasses = clsx(
|
|
1165
|
+
"ina-action-dropdown",
|
|
1166
|
+
width === "full" && "w-full",
|
|
1167
|
+
className
|
|
1168
|
+
);
|
|
1169
|
+
const triggerClasses = clsx(
|
|
1170
|
+
"ina-action-dropdown__trigger",
|
|
1171
|
+
triggerClassName
|
|
1172
|
+
);
|
|
1173
|
+
const menuClasses = clsx(
|
|
1174
|
+
"ina-action-dropdown__menu",
|
|
1175
|
+
`ina-action-dropdown__menu--${placement}`,
|
|
1176
|
+
`ina-action-dropdown__menu--width-${width}`,
|
|
1177
|
+
isOpen && "ina-action-dropdown__menu--visible",
|
|
1178
|
+
menuClassName
|
|
1179
|
+
);
|
|
1180
|
+
const handleItemClick = (item) => {
|
|
1181
|
+
var _a;
|
|
1182
|
+
if (item.disabled) return;
|
|
1183
|
+
(_a = item.onClick) == null ? void 0 : _a.call(item);
|
|
1184
|
+
setIsOpen(false);
|
|
1185
|
+
};
|
|
1186
|
+
return /* @__PURE__ */ jsxs(
|
|
1198
1187
|
"div",
|
|
1199
1188
|
{
|
|
1200
|
-
className:
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1189
|
+
className: containerClasses,
|
|
1190
|
+
ref: menuRef,
|
|
1191
|
+
children: [
|
|
1192
|
+
/* @__PURE__ */ jsxs(
|
|
1193
|
+
"button",
|
|
1194
|
+
{
|
|
1195
|
+
ref: triggerRef,
|
|
1196
|
+
type: "button",
|
|
1197
|
+
className: triggerClasses,
|
|
1198
|
+
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
1199
|
+
disabled,
|
|
1200
|
+
children: [
|
|
1201
|
+
icon && /* @__PURE__ */ jsx("span", { className: "ina-action-dropdown__icon", children: icon }),
|
|
1202
|
+
label && /* @__PURE__ */ jsx("span", { className: "ina-action-dropdown__label", children: label })
|
|
1203
|
+
]
|
|
1204
|
+
}
|
|
1205
|
+
),
|
|
1206
|
+
/* @__PURE__ */ jsx("div", { className: menuClasses, children: /* @__PURE__ */ jsx("ul", { className: "ina-action-dropdown__list", children: items.map((item, index) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
|
|
1207
|
+
"button",
|
|
1208
|
+
{
|
|
1209
|
+
type: "button",
|
|
1210
|
+
className: clsx(
|
|
1211
|
+
"ina-action-dropdown__item",
|
|
1212
|
+
item.type && `ina-action-dropdown__item--${item.type}`,
|
|
1213
|
+
item.disabled && "ina-action-dropdown__item--disabled"
|
|
1214
|
+
),
|
|
1215
|
+
onClick: () => handleItemClick(item),
|
|
1216
|
+
disabled: item.disabled,
|
|
1217
|
+
children: [
|
|
1218
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "ina-action-dropdown__item-icon", children: item.icon }),
|
|
1219
|
+
item.label
|
|
1220
|
+
]
|
|
1221
|
+
}
|
|
1222
|
+
) }, index)) }) })
|
|
1223
|
+
]
|
|
1225
1224
|
}
|
|
1226
|
-
)
|
|
1227
|
-
|
|
1228
|
-
|
|
1225
|
+
);
|
|
1226
|
+
}
|
|
1227
|
+
);
|
|
1228
|
+
ActionDropdown.displayName = "ActionDropdown";
|
|
1229
1229
|
function Alert(props) {
|
|
1230
1230
|
const {
|
|
1231
1231
|
variant = "info",
|
|
@@ -2311,120 +2311,92 @@ function Divider({
|
|
|
2311
2311
|
);
|
|
2312
2312
|
return /* @__PURE__ */ jsx("hr", { className: dividerClasses });
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2314
|
+
function BasicDropdown({
|
|
2315
2315
|
trigger,
|
|
2316
|
-
|
|
2316
|
+
content,
|
|
2317
|
+
open: controlledOpen,
|
|
2318
|
+
defaultOpen = false,
|
|
2319
|
+
onOpenChange,
|
|
2320
|
+
placement = "bottom-start",
|
|
2317
2321
|
className = "",
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
disabled = false
|
|
2321
|
-
dropdownWidth
|
|
2322
|
+
panelClassName = "",
|
|
2323
|
+
triggerClassName = "",
|
|
2324
|
+
disabled = false
|
|
2322
2325
|
}) {
|
|
2323
|
-
const [
|
|
2324
|
-
const
|
|
2325
|
-
const
|
|
2326
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);
|
|
2327
|
+
const isControlled = controlledOpen !== void 0;
|
|
2328
|
+
const isOpen = isControlled ? controlledOpen : uncontrolledOpen;
|
|
2326
2329
|
const containerRef = useRef(null);
|
|
2327
|
-
const
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2330
|
+
const triggerRef = useRef(null);
|
|
2331
|
+
const panelRef = useRef(null);
|
|
2332
|
+
const handleOpenChange = (newOpen) => {
|
|
2333
|
+
if (!isControlled) {
|
|
2334
|
+
setUncontrolledOpen(newOpen);
|
|
2335
|
+
}
|
|
2336
|
+
onOpenChange == null ? void 0 : onOpenChange(newOpen);
|
|
2337
|
+
};
|
|
2338
|
+
const toggle = (e) => {
|
|
2339
|
+
e.stopPropagation();
|
|
2340
|
+
if (disabled) return;
|
|
2341
|
+
handleOpenChange(!isOpen);
|
|
2342
|
+
};
|
|
2331
2343
|
useEffect(() => {
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2344
|
+
const handleClickOutside = (event) => {
|
|
2345
|
+
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
2346
|
+
if (isOpen) {
|
|
2347
|
+
handleOpenChange(false);
|
|
2348
|
+
}
|
|
2336
2349
|
}
|
|
2337
2350
|
};
|
|
2338
2351
|
document.addEventListener("mousedown", handleClickOutside);
|
|
2352
|
+
document.addEventListener("touchstart", handleClickOutside);
|
|
2339
2353
|
return () => {
|
|
2340
2354
|
document.removeEventListener("mousedown", handleClickOutside);
|
|
2355
|
+
document.removeEventListener("touchstart", handleClickOutside);
|
|
2341
2356
|
};
|
|
2342
|
-
}, [
|
|
2343
|
-
const
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
if (containerRef.current) {
|
|
2347
|
-
const rect = containerRef.current.getBoundingClientRect();
|
|
2348
|
-
setTriggerWidth(rect.width);
|
|
2349
|
-
const dropdownHeight = 200;
|
|
2350
|
-
const fitsBelow = rect.bottom + dropdownHeight <= window.innerHeight;
|
|
2351
|
-
const vertical = fitsBelow ? "bottom" : "top";
|
|
2352
|
-
const fitsRight = rect.left + (dropdownWidth ?? 160) <= window.innerWidth;
|
|
2353
|
-
const horizontal = fitsRight ? "left" : "right";
|
|
2354
|
-
setDropdownPosition({ vertical, horizontal });
|
|
2355
|
-
}
|
|
2356
|
-
setOpen((o) => !o);
|
|
2357
|
-
};
|
|
2358
|
-
const dropdownContainerClasses = clsx("ina-dropdown", className);
|
|
2359
|
-
const triggerClasses = clsx(
|
|
2360
|
-
"ina-dropdown__trigger",
|
|
2361
|
-
disabled && "ina-dropdown__trigger--disabled"
|
|
2362
|
-
);
|
|
2363
|
-
const menuClasses = clsx(
|
|
2364
|
-
"ina-dropdown__menu",
|
|
2365
|
-
open && "ina-dropdown__menu--visible",
|
|
2366
|
-
`ina-dropdown__menu--position-${dropdownPosition.vertical}`,
|
|
2367
|
-
`ina-dropdown__menu--align-${dropdownPosition.horizontal}`,
|
|
2368
|
-
dropdownClassName
|
|
2369
|
-
);
|
|
2370
|
-
const effectiveWidth = dropdownWidth ?? triggerWidth;
|
|
2371
|
-
const isStandardTrigger = typeof trigger === "string" || typeof trigger === "number";
|
|
2372
|
-
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: dropdownContainerClasses, children: [
|
|
2373
|
-
/* @__PURE__ */ jsx("div", { onClick: handleTriggerClick, className: triggerClasses, children: isStandardTrigger ? /* @__PURE__ */ jsxs(
|
|
2357
|
+
}, [isOpen, onOpenChange]);
|
|
2358
|
+
const isPrimitiveTrigger = typeof trigger === "string" || typeof trigger === "number";
|
|
2359
|
+
return /* @__PURE__ */ jsxs("div", { ref: containerRef, className: clsx("ina-basic-dropdown", className), children: [
|
|
2360
|
+
/* @__PURE__ */ jsx(
|
|
2374
2361
|
"div",
|
|
2375
2362
|
{
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
"path",
|
|
2363
|
+
ref: triggerRef,
|
|
2364
|
+
className: clsx("ina-basic-dropdown__trigger", triggerClassName),
|
|
2365
|
+
onClick: toggle,
|
|
2366
|
+
children: isPrimitiveTrigger ? /* @__PURE__ */ jsxs(
|
|
2367
|
+
"button",
|
|
2368
|
+
{
|
|
2369
|
+
type: "button",
|
|
2370
|
+
disabled,
|
|
2371
|
+
className: clsx(
|
|
2372
|
+
"ina-basic-dropdown__trigger-button",
|
|
2373
|
+
isOpen && "ina-basic-dropdown__trigger-button--open"
|
|
2374
|
+
),
|
|
2375
|
+
children: [
|
|
2376
|
+
/* @__PURE__ */ jsx("span", { className: "ina-basic-dropdown__trigger-content", children: trigger }),
|
|
2377
|
+
/* @__PURE__ */ jsx(
|
|
2378
|
+
IconChevronDown,
|
|
2393
2379
|
{
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
strokeWidth: "1.5",
|
|
2397
|
-
strokeLinecap: "round",
|
|
2398
|
-
strokeLinejoin: "round"
|
|
2380
|
+
size: 16,
|
|
2381
|
+
className: "ina-basic-dropdown__trigger-icon"
|
|
2399
2382
|
}
|
|
2400
2383
|
)
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2384
|
+
]
|
|
2385
|
+
}
|
|
2386
|
+
) : trigger
|
|
2404
2387
|
}
|
|
2405
|
-
)
|
|
2406
|
-
|
|
2388
|
+
),
|
|
2389
|
+
isOpen && !disabled && /* @__PURE__ */ jsx(
|
|
2407
2390
|
"div",
|
|
2408
2391
|
{
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
children: /* @__PURE__ */ jsx("ul", { className: "ina-dropdown__list", children: items.map((item, idx) => {
|
|
2418
|
-
if (item && typeof item === "object" && "props" in item && item.props.className) {
|
|
2419
|
-
return /* @__PURE__ */ jsx("li", { role: "none", children: React.cloneElement(item, {
|
|
2420
|
-
className: clsx(
|
|
2421
|
-
"ina-dropdown__item",
|
|
2422
|
-
item.props.className
|
|
2423
|
-
)
|
|
2424
|
-
}) }, idx);
|
|
2425
|
-
}
|
|
2426
|
-
return /* @__PURE__ */ jsx("li", { role: "none", children: /* @__PURE__ */ jsx("div", { className: "ina-dropdown__item", children: item }) }, idx);
|
|
2427
|
-
}) })
|
|
2392
|
+
ref: panelRef,
|
|
2393
|
+
className: clsx(
|
|
2394
|
+
"ina-basic-dropdown__panel",
|
|
2395
|
+
`ina-basic-dropdown__panel--${placement}`,
|
|
2396
|
+
panelClassName
|
|
2397
|
+
),
|
|
2398
|
+
onClick: (e) => e.stopPropagation(),
|
|
2399
|
+
children: content
|
|
2428
2400
|
}
|
|
2429
2401
|
)
|
|
2430
2402
|
] });
|
|
@@ -5554,7 +5526,10 @@ const SelectDropdown = ({
|
|
|
5554
5526
|
"input",
|
|
5555
5527
|
{
|
|
5556
5528
|
type: "text",
|
|
5557
|
-
className:
|
|
5529
|
+
className: clsx(
|
|
5530
|
+
"ina-select-dropdown__trigger-input",
|
|
5531
|
+
triggerLabel !== placeholder && "ina-select-dropdown__trigger-input--selected"
|
|
5532
|
+
),
|
|
5558
5533
|
placeholder: triggerLabel,
|
|
5559
5534
|
value: getInputValue(),
|
|
5560
5535
|
onChange: onInputChange,
|
|
@@ -10028,7 +10003,8 @@ function DatePicker({
|
|
|
10028
10003
|
readonly = false,
|
|
10029
10004
|
size = "md",
|
|
10030
10005
|
label,
|
|
10031
|
-
required
|
|
10006
|
+
required,
|
|
10007
|
+
panelOnly = false
|
|
10032
10008
|
}) {
|
|
10033
10009
|
const [isOpen, setIsOpen] = useState(false);
|
|
10034
10010
|
const [currentMonth, setCurrentMonth] = useState(/* @__PURE__ */ new Date());
|
|
@@ -10089,11 +10065,11 @@ function DatePicker({
|
|
|
10089
10065
|
setTempStartDate(null);
|
|
10090
10066
|
setTempStartDate(null);
|
|
10091
10067
|
};
|
|
10092
|
-
if (isOpen) {
|
|
10068
|
+
if (isOpen && !panelOnly) {
|
|
10093
10069
|
document.addEventListener("mousedown", handleClickOutside, true);
|
|
10094
10070
|
return () => document.removeEventListener("mousedown", handleClickOutside, true);
|
|
10095
10071
|
}
|
|
10096
|
-
}, [isOpen]);
|
|
10072
|
+
}, [isOpen, panelOnly]);
|
|
10097
10073
|
useEffect(() => {
|
|
10098
10074
|
if (isOpen) {
|
|
10099
10075
|
const allDatePickers = document.querySelectorAll(".ina-date-picker");
|
|
@@ -10194,7 +10170,7 @@ function DatePicker({
|
|
|
10194
10170
|
]);
|
|
10195
10171
|
const hasInitialized = useRef(false);
|
|
10196
10172
|
useEffect(() => {
|
|
10197
|
-
if (isOpen && !hasInitialized.current) {
|
|
10173
|
+
if ((isOpen || panelOnly) && !hasInitialized.current) {
|
|
10198
10174
|
const parsedDates = parseSelectedDates();
|
|
10199
10175
|
let targetMonth = null;
|
|
10200
10176
|
let targetNextMonth = null;
|
|
@@ -10273,7 +10249,7 @@ function DatePicker({
|
|
|
10273
10249
|
}
|
|
10274
10250
|
}, [isOpen, mode, getFirstEnabledMonth]);
|
|
10275
10251
|
useEffect(() => {
|
|
10276
|
-
if (isOpen && triggerRef.current) {
|
|
10252
|
+
if (isOpen && triggerRef.current && !panelOnly) {
|
|
10277
10253
|
const calculatePosition = () => {
|
|
10278
10254
|
if (!triggerRef.current) return;
|
|
10279
10255
|
const triggerRect = triggerRef.current.getBoundingClientRect();
|
|
@@ -10700,15 +10676,16 @@ function DatePicker({
|
|
|
10700
10676
|
className: clsx(
|
|
10701
10677
|
"ina-date-picker",
|
|
10702
10678
|
disabled && "ina-date-picker--disabled",
|
|
10679
|
+
panelOnly && "ina-date-picker--panel-only",
|
|
10703
10680
|
className
|
|
10704
10681
|
),
|
|
10705
10682
|
style: { width: validatedTriggerWidth },
|
|
10706
10683
|
children: [
|
|
10707
|
-
label && /* @__PURE__ */ jsxs("label", { className: "ina-date-picker__label", children: [
|
|
10684
|
+
!panelOnly && label && /* @__PURE__ */ jsxs("label", { className: "ina-date-picker__label", children: [
|
|
10708
10685
|
label,
|
|
10709
10686
|
required && /* @__PURE__ */ jsx("span", { className: "ina-date-picker__required", children: "*" })
|
|
10710
10687
|
] }),
|
|
10711
|
-
/* @__PURE__ */ jsxs(
|
|
10688
|
+
!panelOnly && /* @__PURE__ */ jsxs(
|
|
10712
10689
|
"button",
|
|
10713
10690
|
{
|
|
10714
10691
|
ref: triggerRef,
|
|
@@ -10764,7 +10741,7 @@ function DatePicker({
|
|
|
10764
10741
|
]
|
|
10765
10742
|
}
|
|
10766
10743
|
),
|
|
10767
|
-
isOpen && !disabled && !readonly && /* @__PURE__ */ jsx(
|
|
10744
|
+
(isOpen || panelOnly) && !disabled && !readonly && /* @__PURE__ */ jsx(
|
|
10768
10745
|
"div",
|
|
10769
10746
|
{
|
|
10770
10747
|
ref: panelRef,
|
|
@@ -11390,6 +11367,7 @@ export {
|
|
|
11390
11367
|
Alert,
|
|
11391
11368
|
Avatar,
|
|
11392
11369
|
Badge,
|
|
11370
|
+
BasicDropdown,
|
|
11393
11371
|
BottomSheet,
|
|
11394
11372
|
Breadcrumb,
|
|
11395
11373
|
Button,
|
|
@@ -11405,7 +11383,6 @@ export {
|
|
|
11405
11383
|
DatePicker,
|
|
11406
11384
|
Divider,
|
|
11407
11385
|
Drawer,
|
|
11408
|
-
Dropdown,
|
|
11409
11386
|
FieldInputTable,
|
|
11410
11387
|
FileUpload,
|
|
11411
11388
|
FormField,
|