@orion-ds/react 5.7.0 → 5.7.1

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),o=require("./Modal.module.css.cjs"),r=({open:e,onClose:a,size:t="md",closeOnBackdrop:m=!0,closeOnEscape:s=!0,showCloseButton:f=!0,children:y,className:v})=>{if(n.useEffect(()=>{if(!e||!s)return;const d=b=>{b.key==="Escape"&&a()};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[e,s,a]),n.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const N=[o.default.modal,o.default[t],v].filter(Boolean).join(" "),j=d=>{m&&d.target===d.currentTarget&&a()};return l.jsx("div",{className:o.default.backdrop,onClick:j,role:"dialog","aria-modal":"true",children:l.jsxs("div",{className:N,children:[f&&l.jsx("button",{type:"button",className:o.default.closeButton,onClick:a,"aria-label":"Close modal",style:{position:"absolute",top:"var(--spacing-4)",right:"var(--spacing-4)"},children:"×"}),y]})})},i=({className:e,children:a})=>{const t=[o.default.header,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})},c=({className:e,children:a})=>{const t=[o.default.body,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})},u=({className:e,children:a})=>{const t=[o.default.footer,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})};r.Header=i;r.Body=c;r.Footer=u;r.displayName="Modal";i.displayName="Modal.Header";c.displayName="Modal.Body";u.displayName="Modal.Footer";exports.Modal=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("react"),o=require("./Modal.module.css.cjs"),d=({open:e,onClose:a,size:t="md",closeOnBackdrop:m=!0,closeOnEscape:s=!0,showCloseButton:f=!0,children:y,className:v,"aria-label":b})=>{if(n.useEffect(()=>{if(!e||!s)return;const r=M=>{M.key==="Escape"&&a()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,s,a]),n.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),!e)return null;const N=[o.default.modal,o.default[t],v].filter(Boolean).join(" "),j=r=>{m&&r.target===r.currentTarget&&a()};return l.jsx("div",{className:o.default.backdrop,onClick:j,role:"dialog","aria-modal":"true","aria-label":b,children:l.jsxs("div",{className:N,children:[f&&l.jsx("button",{type:"button",className:o.default.closeButton,onClick:a,"aria-label":"Close modal",style:{position:"absolute",top:"var(--spacing-4)",right:"var(--spacing-4)"},children:"×"}),y]})})},i=({className:e,children:a})=>{const t=[o.default.header,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})},c=({className:e,children:a})=>{const t=[o.default.body,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})},u=({className:e,children:a})=>{const t=[o.default.footer,e].filter(Boolean).join(" ");return l.jsx("div",{className:t,children:a})};d.Header=i;d.Body=c;d.Footer=u;d.displayName="Modal";i.displayName="Modal.Header";c.displayName="Modal.Body";u.displayName="Modal.Footer";exports.Modal=d;
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG;IACzC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACnC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;CA+EpC,CAAC"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,GAAG;IACzC,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;IACnC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC;IAC/B,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC;CAiFpC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as l, jsxs as B } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as h } from "react/jsx-runtime";
2
2
  import { useEffect as n } from "react";
3
3
  import t from "./Modal.module.css.mjs";
4
4
  const s = ({
@@ -9,28 +9,30 @@ const s = ({
9
9
  closeOnEscape: d = !0,
10
10
  showCloseButton: y = !0,
11
11
  children: f,
12
- className: v
12
+ className: v,
13
+ "aria-label": N
13
14
  }) => {
14
15
  if (n(() => {
15
16
  if (!e || !d) return;
16
- const r = (b) => {
17
- b.key === "Escape" && o();
17
+ const r = (B) => {
18
+ B.key === "Escape" && o();
18
19
  };
19
20
  return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
20
21
  }, [e, d, o]), n(() => (e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "", () => {
21
22
  document.body.style.overflow = "";
22
23
  }), [e]), !e) return null;
23
- const N = [t.modal, t[a], v].filter(Boolean).join(" "), p = (r) => {
24
+ const p = [t.modal, t[a], v].filter(Boolean).join(" "), b = (r) => {
24
25
  u && r.target === r.currentTarget && o();
25
26
  };
26
27
  return /* @__PURE__ */ l(
27
28
  "div",
28
29
  {
29
30
  className: t.backdrop,
30
- onClick: p,
31
+ onClick: b,
31
32
  role: "dialog",
32
33
  "aria-modal": "true",
33
- children: /* @__PURE__ */ B("div", { className: N, children: [
34
+ "aria-label": N,
35
+ children: /* @__PURE__ */ h("div", { className: p, children: [
34
36
  y && /* @__PURE__ */ l(
35
37
  "button",
36
38
  {
@@ -55,6 +55,10 @@ export interface ModalProps {
55
55
  * Additional class name
56
56
  */
57
57
  className?: string;
58
+ /**
59
+ * ARIA label for accessibility
60
+ */
61
+ "aria-label"?: string;
58
62
  }
59
63
  /**
60
64
  * Modal Header props
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/Modal.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;AAE3D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CA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SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
@@ -2,7 +2,7 @@ import { RenderResult } from '@testing-library/react';
2
2
 
3
3
  /**
4
4
  * Run axe accessibility checks on a rendered component.
5
- * Usage: await expectNoA11yViolations(renderResult);
5
+ * Usage: await expectNoA11yViolations(container); or await expectNoA11yViolations(renderResult);
6
6
  */
7
- export declare function expectNoA11yViolations({ container, }: Pick<RenderResult, "container">): Promise<void>;
7
+ export declare function expectNoA11yViolations(containerOrRenderResult: Element | Pick<RenderResult, "container">): Promise<void>;
8
8
  //# sourceMappingURL=a11y.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/test/a11y.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,EAC3C,SAAS,GACV,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,iBAcjC"}
1
+ {"version":3,"file":"a11y.d.ts","sourceRoot":"","sources":["../../src/test/a11y.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,uBAAuB,EAAE,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,iBAqBnE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-ds/react",
3
- "version": "5.7.0",
3
+ "version": "5.7.1",
4
4
  "type": "module",
5
5
  "description": "Orion Design System - React component library with 40+ AI-ready components and 9 templates",
6
6
  "author": "Orion Design System Team",