@wistia/vhs 2.66.3 → 2.66.4

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.
@@ -39,6 +39,11 @@ export type ModalProps = ComponentPropsWithoutRef<'div'> & {
39
39
  * @default true
40
40
  */
41
41
  shouldCloseOnClickOutside?: boolean;
42
+ /**
43
+ * Whether or not the modal should trap focus within itself
44
+ *
45
+ */
46
+ shouldTrapFocus?: boolean;
42
47
  /** The base width to apply to the Modal */
43
48
  width?: string;
44
49
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAcjF,MAAM,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAErD;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuGF,eAAO,MAAM,KAAK;YAAW,UAAU,GAAG,GAAG,CAAC,OAAO;;CAqCpD,CAAC"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,wBAAwB,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAcjF,MAAM,MAAM,UAAU,GAAG,wBAAwB,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzD;;OAEG;IACH,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;IAErD;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAuGF,eAAO,MAAM,KAAK;YAAW,UAAU,GAAG,GAAG,CAAC,OAAO;;CAqCpD,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /*
3
- * @license @wistia/vhs v2.66.3
3
+ * @license @wistia/vhs v2.66.4
4
4
  *
5
5
  * Copyright (c) 2021-2024, Wistia, Inc. and its affiliates.
6
6
  *
@@ -2441,7 +2441,7 @@
2441
2441
  display: flex;
2442
2442
  flex-direction: column;
2443
2443
  width: 100%;
2444
- `,Tne=e=>(0,So.isNotNil)(e)&&(0,So.hasKey)(e,"current")&&(0,So.isNotNil)(e.current),Ane=e=>{(0,Ii.useEffect)(()=>{let t=document.activeElement;if(Tne(e)){let r=e.current;(0,So.isNotNil)(r)&&r.focus()}return()=>{t!==null&&setTimeout(()=>{t.focus()},0)}},[e])},qM=(0,Ii.forwardRef)(({alignHorizontal:e="center",alignVertical:t="center",children:r,className:n,fullHeight:o=!1,initialFocusRef:a,onRequestClose:s,shouldCloseOnClickOutside:u=!0,width:l,...c},p)=>{Ane(p);let d=(0,Ii.useRef)(null),h=sd(!0,{focusSelector:a?.current});return Ws(d,()=>{s&&u&&s()}),Xd(c.isOpen),qd("Escape",g=>{s&&s(),g.preventDefault()}),(0,Va.jsx)(WM,{value:s,children:(0,Va.jsx)(Ene,{alignHorizontal:e,alignVertical:t,children:(0,Va.jsx)(GM,{ref:h,"aria-modal":"true",fullHeight:o,role:"dialog",tabIndex:-1,width:l,...c,children:(0,Va.jsx)(Pne,{ref:d,children:r})})})})}),i7=e=>{let{id:t,...r}=e,n=document.createElement("div");n.classList.add("Modal"),(0,So.isNotUndefined)(e.className)&&n.classList.add(e.className),(0,So.isNotUndefined)(t)&&(n.id=t);let o=(0,Ii.useRef)(n);return(0,Ii.useEffect)(()=>{let a=o.current;return document.body.appendChild(a),()=>a.remove()},[]),(0,KM.createPortal)((0,Va.jsx)(jl,{children:e.isOpen?(0,Va.jsx)(qM,{ref:o,...r}):null}),o.current)};i7.displayName="Modal_VHS";qM.displayName="ModalContent";i();var tf=A(require("styled-components"));var a7=require("react/jsx-runtime"),XM=tf.default.div`
2444
+ `,Tne=e=>(0,So.isNotNil)(e)&&(0,So.hasKey)(e,"current")&&(0,So.isNotNil)(e.current),Ane=e=>{(0,Ii.useEffect)(()=>{let t=document.activeElement;if(Tne(e)){let r=e.current;(0,So.isNotNil)(r)&&r.focus()}return()=>{t!==null&&setTimeout(()=>{t.focus()},0)}},[e])},qM=(0,Ii.forwardRef)(({alignHorizontal:e="center",alignVertical:t="center",children:r,className:n,fullHeight:o=!1,initialFocusRef:a,shouldTrapFocus:s=!0,onRequestClose:u,shouldCloseOnClickOutside:l=!0,width:c,...p},d)=>{Ane(d);let h=(0,Ii.useRef)(null),g=sd(s,{focusSelector:a?.current});return Ws(h,()=>{u&&l&&u()}),Xd(p.isOpen),qd("Escape",v=>{u&&u(),v.preventDefault()}),(0,Va.jsx)(WM,{value:u,children:(0,Va.jsx)(Ene,{alignHorizontal:e,alignVertical:t,children:(0,Va.jsx)(GM,{ref:g,"aria-modal":"true",fullHeight:o,role:"dialog",tabIndex:-1,width:c,...p,children:(0,Va.jsx)(Pne,{ref:h,children:r})})})})}),i7=e=>{let{id:t,...r}=e,n=document.createElement("div");n.classList.add("Modal"),(0,So.isNotUndefined)(e.className)&&n.classList.add(e.className),(0,So.isNotUndefined)(t)&&(n.id=t);let o=(0,Ii.useRef)(n);return(0,Ii.useEffect)(()=>{let a=o.current;return document.body.appendChild(a),()=>a.remove()},[]),(0,KM.createPortal)((0,Va.jsx)(jl,{children:e.isOpen?(0,Va.jsx)(qM,{ref:o,...r}):null}),o.current)};i7.displayName="Modal_VHS";qM.displayName="ModalContent";i();var tf=A(require("styled-components"));var a7=require("react/jsx-runtime"),XM=tf.default.div`
2445
2445
  align-items: center;
2446
2446
  display: flex;
2447
2447
  padding: ${({theme:e})=>e.spacing.space04} ${({theme:e})=>e.spacing.space04};