@diwauhris/ui 1.7.36 → 1.7.38

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/assets/ui.css CHANGED
@@ -4290,6 +4290,10 @@
4290
4290
  background-size: 20px 20px;
4291
4291
  }
4292
4292
 
4293
+ .\[overflow\:clip\] {
4294
+ overflow: clip;
4295
+ }
4296
+
4293
4297
  /* ── Scrollbar utility ───────────────────────────────────────────────────── */
4294
4298
  .hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
4295
4299
  .hide-scrollbar::-webkit-scrollbar { display: none; }
package/lib/index.cjs CHANGED
@@ -3994,14 +3994,24 @@ function Dropdown({ trigger, isOpen, onToggle, onClose, children, triggerClassNa
3994
3994
  const [panelStyle, setPanelStyle] = (0, react.useState)({});
3995
3995
  (0, react.useEffect)(() => {
3996
3996
  if (!isOpen || !triggerRef.current) return;
3997
- const rect = triggerRef.current.getBoundingClientRect();
3998
- setPanelStyle({
3999
- position: "fixed",
4000
- top: rect.bottom + 4,
4001
- left: rect.left,
4002
- zIndex: 9999,
4003
- minWidth: Math.max(rect.width, 180)
4004
- });
3997
+ const updatePosition = () => {
3998
+ if (!triggerRef.current) return;
3999
+ const rect = triggerRef.current.getBoundingClientRect();
4000
+ setPanelStyle({
4001
+ position: "fixed",
4002
+ top: rect.bottom + 4,
4003
+ left: rect.left,
4004
+ zIndex: 9999,
4005
+ minWidth: Math.max(rect.width, 180)
4006
+ });
4007
+ };
4008
+ updatePosition();
4009
+ window.addEventListener("scroll", updatePosition, true);
4010
+ window.addEventListener("resize", updatePosition);
4011
+ return () => {
4012
+ window.removeEventListener("scroll", updatePosition, true);
4013
+ window.removeEventListener("resize", updatePosition);
4014
+ };
4005
4015
  }, [isOpen]);
4006
4016
  (0, react.useEffect)(() => {
4007
4017
  if (!isOpen) return;
@@ -4418,7 +4428,7 @@ function AccordionContent({ children, className = "" }) {
4418
4428
  "aria-labelledby": triggerId,
4419
4429
  "aria-hidden": !isOpen || void 0,
4420
4430
  "data-state": isOpen ? "open" : "closed",
4421
- className: cn("grid overflow-hidden transition-[grid-template-rows] duration-200 ease-out", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
4431
+ className: cn("grid [overflow:clip] transition-[grid-template-rows] duration-200 ease-out", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
4422
4432
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4423
4433
  className: "min-h-0",
4424
4434
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
package/lib/index.mjs CHANGED
@@ -3970,14 +3970,24 @@ function Dropdown({ trigger, isOpen, onToggle, onClose, children, triggerClassNa
3970
3970
  const [panelStyle, setPanelStyle] = useState({});
3971
3971
  useEffect(() => {
3972
3972
  if (!isOpen || !triggerRef.current) return;
3973
- const rect = triggerRef.current.getBoundingClientRect();
3974
- setPanelStyle({
3975
- position: "fixed",
3976
- top: rect.bottom + 4,
3977
- left: rect.left,
3978
- zIndex: 9999,
3979
- minWidth: Math.max(rect.width, 180)
3980
- });
3973
+ const updatePosition = () => {
3974
+ if (!triggerRef.current) return;
3975
+ const rect = triggerRef.current.getBoundingClientRect();
3976
+ setPanelStyle({
3977
+ position: "fixed",
3978
+ top: rect.bottom + 4,
3979
+ left: rect.left,
3980
+ zIndex: 9999,
3981
+ minWidth: Math.max(rect.width, 180)
3982
+ });
3983
+ };
3984
+ updatePosition();
3985
+ window.addEventListener("scroll", updatePosition, true);
3986
+ window.addEventListener("resize", updatePosition);
3987
+ return () => {
3988
+ window.removeEventListener("scroll", updatePosition, true);
3989
+ window.removeEventListener("resize", updatePosition);
3990
+ };
3981
3991
  }, [isOpen]);
3982
3992
  useEffect(() => {
3983
3993
  if (!isOpen) return;
@@ -4394,7 +4404,7 @@ function AccordionContent({ children, className = "" }) {
4394
4404
  "aria-labelledby": triggerId,
4395
4405
  "aria-hidden": !isOpen || void 0,
4396
4406
  "data-state": isOpen ? "open" : "closed",
4397
- className: cn("grid overflow-hidden transition-[grid-template-rows] duration-200 ease-out", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
4407
+ className: cn("grid [overflow:clip] transition-[grid-template-rows] duration-200 ease-out", isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
4398
4408
  children: /* @__PURE__ */ jsx("div", {
4399
4409
  className: "min-h-0",
4400
4410
  children: /* @__PURE__ */ jsx("div", {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@diwauhris/ui",
3
3
  "private": false,
4
- "version": "1.7.36",
4
+ "version": "1.7.38",
5
5
  "type": "module",
6
6
  "description": "DIWA UHRIS UI component library — React + Tailwind CSS",
7
7
  "keywords": [