@geckoui/geckoui 2.0.4 → 2.0.5

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.js CHANGED
@@ -9551,9 +9551,6 @@ function Drawer({
9551
9551
  const timer = setTimeout(() => setClosing(false), OVERLAY_ANIMATION_DURATION);
9552
9552
  return () => clearTimeout(timer);
9553
9553
  }, [closing]);
9554
- (0, import_react81.useLayoutEffect)(() => {
9555
- if (drawerRef.current) drawerRef.current.inert = !open;
9556
- }, [open]);
9557
9554
  const onCloseRef = (0, import_react81.useRef)(onClose);
9558
9555
  onCloseRef.current = onClose;
9559
9556
  const handleDismiss = (0, import_react81.useCallback)(() => {
@@ -9580,19 +9577,25 @@ function Drawer({
9580
9577
  ),
9581
9578
  /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
9582
9579
  "div",
9583
- {
9580
+ __spreadProps(__spreadValues({
9584
9581
  ref: drawerRef,
9585
9582
  "data-placement": placement,
9586
9583
  "data-state": visible ? "open" : "closed",
9587
9584
  "data-instant": !ready || void 0,
9588
9585
  className: classNames("GeckoUIDrawer__drawer", className),
9589
9586
  role: "dialog",
9590
- "aria-modal": !allowClickOutside,
9587
+ "aria-modal": !allowClickOutside
9588
+ }, inertProps(!open)), {
9591
9589
  children: (open || closing || keepMounted) && children
9592
- }
9590
+ })
9593
9591
  )
9594
9592
  ] });
9595
9593
  }
9594
+ var INERT_IS_BOOLEAN = Number(import_react81.version.split(".")[0]) >= 19;
9595
+ function inertProps(inert) {
9596
+ if (INERT_IS_BOOLEAN) return { inert };
9597
+ return inert ? { inert: "" } : {};
9598
+ }
9596
9599
  Drawer.show = (node, options = {}) => {
9597
9600
  var _a;
9598
9601
  (_a = document.activeElement) == null ? void 0 : _a.blur();
package/dist/index.mjs CHANGED
@@ -9392,7 +9392,7 @@ import { useCallback as useCallback10, useEffect as useEffect23, useRef as useRe
9392
9392
  import { createPortal as createPortal2 } from "react-dom";
9393
9393
 
9394
9394
  // src/components/Drawer/Drawer.tsx
9395
- import { useCallback as useCallback9, useEffect as useEffect22, useLayoutEffect as useLayoutEffect2, useRef as useRef33, useState as useState29 } from "react";
9395
+ import { useCallback as useCallback9, useEffect as useEffect22, useRef as useRef33, useState as useState29, version } from "react";
9396
9396
  import { jsx as jsx97, jsxs as jsxs46 } from "react/jsx-runtime";
9397
9397
  function Drawer({
9398
9398
  open = false,
@@ -9426,9 +9426,6 @@ function Drawer({
9426
9426
  const timer = setTimeout(() => setClosing(false), OVERLAY_ANIMATION_DURATION);
9427
9427
  return () => clearTimeout(timer);
9428
9428
  }, [closing]);
9429
- useLayoutEffect2(() => {
9430
- if (drawerRef.current) drawerRef.current.inert = !open;
9431
- }, [open]);
9432
9429
  const onCloseRef = useRef33(onClose);
9433
9430
  onCloseRef.current = onClose;
9434
9431
  const handleDismiss = useCallback9(() => {
@@ -9455,19 +9452,25 @@ function Drawer({
9455
9452
  ),
9456
9453
  /* @__PURE__ */ jsx97(
9457
9454
  "div",
9458
- {
9455
+ __spreadProps(__spreadValues({
9459
9456
  ref: drawerRef,
9460
9457
  "data-placement": placement,
9461
9458
  "data-state": visible ? "open" : "closed",
9462
9459
  "data-instant": !ready || void 0,
9463
9460
  className: classNames("GeckoUIDrawer__drawer", className),
9464
9461
  role: "dialog",
9465
- "aria-modal": !allowClickOutside,
9462
+ "aria-modal": !allowClickOutside
9463
+ }, inertProps(!open)), {
9466
9464
  children: (open || closing || keepMounted) && children
9467
- }
9465
+ })
9468
9466
  )
9469
9467
  ] });
9470
9468
  }
9469
+ var INERT_IS_BOOLEAN = Number(version.split(".")[0]) >= 19;
9470
+ function inertProps(inert) {
9471
+ if (INERT_IS_BOOLEAN) return { inert };
9472
+ return inert ? { inert: "" } : {};
9473
+ }
9471
9474
  Drawer.show = (node, options = {}) => {
9472
9475
  var _a;
9473
9476
  (_a = document.activeElement) == null ? void 0 : _a.blur();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geckoui/geckoui",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "license": "MIT",
5
5
  "description": "The only thing our Gecko eats is bugs!",
6
6
  "keywords": [