@vector-business-services/cristal-ds-web 0.5.0 → 0.6.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/dist/index.cjs CHANGED
@@ -321,6 +321,7 @@ function Drawer({
321
321
  subtitle,
322
322
  side = "right",
323
323
  behavior = "full",
324
+ modal = true,
324
325
  onBack,
325
326
  backLabel = "Voltar",
326
327
  closeLabel = "Fechar",
@@ -354,7 +355,7 @@ function Drawer({
354
355
  return () => observer.disconnect();
355
356
  }, [rolagem, children]);
356
357
  const prenderFoco = (event) => {
357
- if (event.key !== "Tab" || !panelRef.current) return;
358
+ if (!modal || event.key !== "Tab" || !panelRef.current) return;
358
359
  const focaveis = [...panelRef.current.querySelectorAll(FOCAVEIS)];
359
360
  const primeiro = focaveis[0];
360
361
  const ultimo = focaveis[focaveis.length - 1];
@@ -376,16 +377,29 @@ function Drawer({
376
377
  visible,
377
378
  onHide,
378
379
  position: side,
379
- blockScroll: true,
380
+ modal,
381
+ blockScroll: modal,
382
+ dismissable: modal,
380
383
  pt: {
381
- mask: { className: `cr-drawer__mask cr-drawer__mask--${side}` },
384
+ mask: {
385
+ className: `cr-drawer__mask cr-drawer__mask--${side}${modal ? "" : " cr-drawer__mask--sem-overlay"}`
386
+ },
382
387
  root: {
383
388
  className: classes,
384
389
  role: "dialog",
385
- "aria-modal": true,
390
+ "aria-modal": modal || void 0,
386
391
  "aria-labelledby": titleId,
387
392
  "aria-describedby": subtitle ? subtitleId : void 0,
388
393
  onKeyDown: prenderFoco
394
+ },
395
+ // No unstyled o Prime não põe classes na transição: o Cristal dá as dele (Drawer.css).
396
+ // O tipo do Prime exige o addEndListener do react-transition-group, que aqui não se usa.
397
+ transition: {
398
+ classNames: {
399
+ enter: "cr-drawer--enter",
400
+ enterActive: "cr-drawer--enter-active",
401
+ exitActive: "cr-drawer--exit-active"
402
+ }
389
403
  }
390
404
  },
391
405
  content: ({ closeIconRef, hide }) => /* @__PURE__ */ jsxRuntime.jsxs(