@apteva/apteva-kit 0.1.121 → 0.1.123

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.mjs CHANGED
@@ -1450,6 +1450,16 @@ function PortalDropdown({
1450
1450
  }) {
1451
1451
  const dropdownRef = useRef3(null);
1452
1452
  const [pos, setPos] = useState3(null);
1453
+ const [themeClass, setThemeClass] = useState3("");
1454
+ useEffect3(() => {
1455
+ if (!open || !anchorRef.current) return;
1456
+ const chat = anchorRef.current.closest(".apteva-chat");
1457
+ if (chat) {
1458
+ if (chat.classList.contains("apteva-force-light")) setThemeClass("apteva-force-light");
1459
+ else if (chat.classList.contains("apteva-force-dark")) setThemeClass("apteva-force-dark");
1460
+ else setThemeClass("");
1461
+ }
1462
+ }, [open, anchorRef]);
1453
1463
  useEffect3(() => {
1454
1464
  if (!open || !anchorRef.current) {
1455
1465
  setPos(null);
@@ -1496,7 +1506,7 @@ function PortalDropdown({
1496
1506
  "div",
1497
1507
  {
1498
1508
  ref: dropdownRef,
1499
- className: "apteva-widget",
1509
+ className: `apteva-widget ${themeClass}`,
1500
1510
  style: {
1501
1511
  position: "absolute",
1502
1512
  top: pos.top,