@webority/ui-react 0.44.0 → 0.46.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.
@@ -1 +1 @@
1
- import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useEffect as r,useRef as i}from"react";import{Modal as a}from"react-bootstrap";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`default`,`danger`,`success`,`warning`],l=[`center`,`top`],u=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,d={sm:380,md:440,lg:640,xl:880},f=`wui-modal-fullscreen`,p=!1;function m(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}!e||p||(p=!0,console.warn("[@webority/ui-react] <AppModal hideHeader> has no accessible name — pass `ariaLabel` (or a string `title`)."))}function h({open:p,eyebrow:h,title:g,subtitle:_,headerIcon:v,tone:y=`default`,dismissible:b=!0,onClose:x,footer:S,size:C=`md`,placement:w=`center`,hideHeader:T=!1,staticBackdrop:E=!1,ariaLabel:D,className:O=``,children:k,...A}){t(`AppModal`,A),e(`AppModal`,`tone`,y,c),e(`AppModal`,`placement`,w,l),e(`AppModal`,`size`,typeof C==`string`?C:null,[...Object.keys(d),`fullscreen`]);let{style:j,...M}=A;T&&!D&&typeof g!=`string`&&m();let N=i(null);r(()=>{if(!p)return;let e=N.current?.closest(`.modal-content`);if(!e)return;let t=()=>Array.from(e.querySelectorAll(u));(e.querySelector(`[data-autofocus]`)||t().find(e=>!e.classList.contains(`wui-modal-close`))||t()[0]||e).focus?.()},[p]);let P=C===`fullscreen`,F=typeof C==`number`?C:d[C]??d.md,I=[`wui-modal`,y==="default"?``:`tone-${y}`,O].filter(Boolean).join(` `);return s(a,{...M,show:p,onHide:x,backdrop:!E||`static`,keyboard:!E,autoFocus:!1,enforceFocus:!0,restoreFocus:!0,centered:w!==`top`,className:P?`wui-modal-shell ${f}`:`wui-modal-shell`,style:P?j:{"--wui-modal-max-width":`${F}px`,...j},dialogClassName:`wui-rb-dialog`,contentClassName:I,backdropClassName:`wui-modal-dim`,"aria-label":D||(typeof g==`string`?g:void 0),children:[!T&&s(`div`,{className:`wui-modal-header`,children:[s(`div`,{className:`wui-modal-heading`,children:[v&&o(`span`,{className:`wui-modal-headicon`,children:o(n,{name:v,size:18})}),s(`div`,{className:`wui-modal-headtext`,children:[h&&o(`div`,{className:`wui-modal-eyebrow`,children:h}),o(`div`,{className:`wui-modal-title`,children:g}),_&&o(`div`,{className:`wui-modal-subtitle`,children:_})]})]}),b&&o(`button`,{type:`button`,className:`wui-modal-close`,onClick:x,"aria-label":`Close`,children:o(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:o(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),o(`div`,{className:`wui-modal-body`,ref:N,children:k}),S&&o(`div`,{className:`wui-modal-footer`,children:S})]})}export{h as default};
1
+ import e from"./warnInvalidValue.js";import t from"./warnUnknownProps.js";import n from"./AppIcon.js";import{useEffect as r,useRef as i}from"react";import{Modal as a}from"react-bootstrap";import{jsx as o,jsxs as s}from"react/jsx-runtime";var c=[`default`,`danger`,`success`,`warning`],l=[`center`,`top`],u=`a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])`,d={sm:380,md:440,lg:640,xl:880},f=`wui-modal-fullscreen`,p=!1;function m(){let e=!0;try{e=process.env.NODE_ENV!==`production`}catch{e=!0}!e||p||(p=!0,console.warn("[@webority/ui-react] <AppModal hideHeader> has no accessible name — pass `ariaLabel` (or a string `title`)."))}function h({open:p,eyebrow:h,title:g,subtitle:_,headerIcon:v,tone:y=`default`,dismissible:b=!0,onClose:x,footer:S,size:C=`md`,placement:w=`center`,hideHeader:T=!1,staticBackdrop:E=!1,ariaLabel:D,className:O=``,children:k,...A}){t(`AppModal`,A),e(`AppModal`,`tone`,y,c),e(`AppModal`,`placement`,w,l),e(`AppModal`,`size`,typeof C==`string`?C:null,[...Object.keys(d),`fullscreen`]);let{style:j,...M}=A;T&&!D&&typeof g!=`string`&&m();let N=i(null);r(()=>{if(!p)return;let e=N.current?.closest(`.modal-content`);if(!e)return;let t=()=>Array.from(e.querySelectorAll(u));(e.querySelector(`[data-autofocus]`)||t().find(e=>!e.classList.contains(`wui-modal-close`))||t()[0]||e).focus?.();let n=e.closest(`.modal`);return()=>{n&&setTimeout(()=>{n.isConnected&&!n.classList.contains(`show`)&&n.dispatchEvent(new Event(`transitionend`,{bubbles:!0}))},500)}},[p]);let P=C===`fullscreen`,F=typeof C==`number`?C:d[C]??d.md,I=[`wui-modal`,y==="default"?``:`tone-${y}`,O].filter(Boolean).join(` `);return s(a,{...M,show:p,onHide:x,backdrop:!E||`static`,keyboard:!E,autoFocus:!1,enforceFocus:!0,restoreFocus:!0,centered:w!==`top`,className:P?`wui-modal-shell ${f}`:`wui-modal-shell`,style:P?j:{"--wui-modal-max-width":`${F}px`,...j},dialogClassName:`wui-rb-dialog`,contentClassName:I,backdropClassName:`wui-modal-dim`,"aria-label":D||(typeof g==`string`?g:void 0),children:[!T&&s(`div`,{className:`wui-modal-header`,children:[s(`div`,{className:`wui-modal-heading`,children:[v&&o(`span`,{className:`wui-modal-headicon`,children:o(n,{name:v,size:18})}),s(`div`,{className:`wui-modal-headtext`,children:[h&&o(`div`,{className:`wui-modal-eyebrow`,children:h}),o(`div`,{className:`wui-modal-title`,children:g}),_&&o(`div`,{className:`wui-modal-subtitle`,children:_})]})]}),b&&o(`button`,{type:`button`,className:`wui-modal-close`,onClick:x,"aria-label":`Close`,children:o(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:o(`path`,{d:`M18 6 6 18M6 6l12 12`})})})]}),o(`div`,{className:`wui-modal-body`,ref:N,children:k}),S&&o(`div`,{className:`wui-modal-footer`,children:S})]})}export{h as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/ui-react",
3
- "version": "0.44.0",
3
+ "version": "0.46.0",
4
4
  "description": "Webority shared React component library — App* primitives on react-bootstrap + the @webority/theme design system.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -27,11 +27,11 @@
27
27
  },
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@webority/theme": "0.44.0",
31
- "@webority/ui-elements": "0.44.0"
30
+ "@webority/theme": "0.46.0",
31
+ "@webority/ui-elements": "0.46.0"
32
32
  },
33
33
  "peerDependencies": {
34
- "@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0",
34
+ "@webority/analytics": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^0.14.0 || ^0.15.0 || ^0.16.0 || ^0.17.0 || ^0.18.0 || ^0.19.0",
35
35
  "bootstrap": "5.3.3",
36
36
  "react": "^19.0.0",
37
37
  "react-bootstrap": "^2.10.0",
@@ -45,7 +45,7 @@
45
45
  "@types/react": "^19.2.17",
46
46
  "@vitejs/plugin-react": "^6.0.1",
47
47
  "@vitest/coverage-v8": "5.0.1",
48
- "@webority/analytics": "0.17.0",
48
+ "@webority/analytics": "0.19.0",
49
49
  "bootstrap": "5.3.3",
50
50
  "jsdom": "30.1.1",
51
51
  "react": "^19.2.6",