@lowentry/mui 1.2.13 → 1.2.15

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/Dialog/index.js CHANGED
@@ -2,14 +2,22 @@ import _extends from '@babel/runtime/helpers/extends';
2
2
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
3
  import React from 'react';
4
4
  import { LeRed } from '@lowentry/react-redux';
5
- import { STRING } from '@lowentry/utils';
5
+ import { LeUtils, STRING } from '@lowentry/utils';
6
6
  import { Dialog as Dialog$1 } from '@mui/material';
7
+ import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
7
8
 
8
- var _excluded = ["onClose", "children"];
9
+ var css_248z = ".lowentry-mui--dialog .lowentry-mui--dialog--arialabel{display:none!important}";
10
+ styleInject(css_248z);
11
+
12
+ var _excluded = ["onClose", "children", "aria-label"];
9
13
  var Dialog = LeRed.memo(function (_ref) {
10
14
  var onClose = _ref.onClose,
11
15
  children = _ref.children,
16
+ ariaLabel = _ref['aria-label'],
12
17
  props = _objectWithoutProperties(_ref, _excluded);
18
+ var ariaLabelId = LeRed.useMemo(function () {
19
+ return 'lowentrymui_dialog_arialabel_' + LeUtils.uniqueId();
20
+ }, []);
13
21
  var onClosed = LeRed.useCallback(function (event, reason) {
14
22
  if (!STRING(reason).toLowerCase().includes('escape')) {
15
23
  // prevent closing when clicking on the backdrop, only allow escape-key closing
@@ -20,8 +28,16 @@ var Dialog = LeRed.memo(function (_ref) {
20
28
  }
21
29
  }, [onClose]);
22
30
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Dialog$1, _extends({
23
- onClose: onClosed
24
- }, props), children));
31
+ className: "lowentry-mui--dialog",
32
+ onClose: onClosed,
33
+ "aria-labelledby": ariaLabelId
34
+ }, props), /*#__PURE__*/React.createElement("span", {
35
+ className: "lowentry-mui--dialog--arialabel",
36
+ id: ariaLabelId,
37
+ style: {
38
+ display: 'none'
39
+ }
40
+ }, ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : ''), children));
25
41
  });
26
42
 
27
43
  export { Dialog as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/Dialog.jsx"],"sourcesContent":["import React from 'react';\nimport {LeRed} from '@lowentry/react-redux';\nimport {STRING} from '@lowentry/utils';\nimport {Dialog as MuiDialog} from '@mui/material';\n\n\nconst Dialog = LeRed.memo(({onClose, children, ...props}) =>\n{\n\tconst onClosed = LeRed.useCallback((event, reason) =>\n\t{\n\t\tif(!STRING(reason).toLowerCase().includes('escape'))\n\t\t{\n\t\t\t// prevent closing when clicking on the backdrop, only allow escape-key closing\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(onClose)\n\t\t{\n\t\t\tonClose(event, reason);\n\t\t}\n\t}, [onClose]);\n\t\n\t\n\treturn (<>\n\t\t<MuiDialog onClose={onClosed} {...props}>\n\t\t\t{children}\n\t\t</MuiDialog>\n\t</>);\n});\nexport default Dialog;\n"],"names":["Dialog","LeRed","memo","_ref","onClose","children","props","_objectWithoutProperties","_excluded","onClosed","useCallback","event","reason","STRING","toLowerCase","includes","React","createElement","Fragment","MuiDialog","_extends"],"mappings":";;;;;;;;AAMMA,IAAAA,MAAM,GAAGC,KAAK,CAACC,IAAI,CAAC,UAAAC,IAAA,EAC1B;AAAA,EAAA,IAD4BC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;AAAKC,IAAAA,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;EAEtD,IAAMC,QAAQ,GAAGR,KAAK,CAACS,WAAW,CAAC,UAACC,KAAK,EAAEC,MAAM,EACjD;AACC,IAAA,IAAG,CAACC,MAAM,CAACD,MAAM,CAAC,CAACE,WAAW,EAAE,CAACC,QAAQ,CAAC,QAAQ,CAAC,EACnD;AACC;AACA,MAAA,OAAA;AACD,KAAA;AAEA,IAAA,IAAGX,OAAO,EACV;AACCA,MAAAA,OAAO,CAACO,KAAK,EAAEC,MAAM,CAAC,CAAA;AACvB,KAAA;AACD,GAAC,EAAE,CAACR,OAAO,CAAC,CAAC,CAAA;AAGb,EAAA,oBAAQY,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACPF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACE,QAAS,EAAAC,QAAA,CAAA;AAAChB,IAAAA,OAAO,EAAEK,QAAAA;AAAS,GAAA,EAAKH,KAAK,CAAA,EACrCD,QACS,CACV,CAAC,CAAA;AACJ,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/components/Dialog.jsx"],"sourcesContent":["import React from 'react';\nimport {LeRed} from '@lowentry/react-redux';\nimport {LeUtils, STRING} from '@lowentry/utils';\nimport {Dialog as MuiDialog} from '@mui/material';\nimport './Dialog.less';\n\n\nconst Dialog = LeRed.memo(({onClose, children, 'aria-label':ariaLabel, ...props}) =>\n{\n\tconst ariaLabelId = LeRed.useMemo(() => 'lowentrymui_dialog_arialabel_' + LeUtils.uniqueId(), []);\n\t\n\t\n\tconst onClosed = LeRed.useCallback((event, reason) =>\n\t{\n\t\tif(!STRING(reason).toLowerCase().includes('escape'))\n\t\t{\n\t\t\t// prevent closing when clicking on the backdrop, only allow escape-key closing\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif(onClose)\n\t\t{\n\t\t\tonClose(event, reason);\n\t\t}\n\t}, [onClose]);\n\t\n\t\n\treturn (<>\n\t\t<MuiDialog className=\"lowentry-mui--dialog\" onClose={onClosed} aria-labelledby={ariaLabelId} {...props}>\n\t\t\t<span className=\"lowentry-mui--dialog--arialabel\" id={ariaLabelId} style={{display:'none'}}>{ariaLabel ?? ''}</span>\n\t\t\t{children}\n\t\t</MuiDialog>\n\t</>);\n});\nexport default Dialog;\n"],"names":["Dialog","LeRed","memo","_ref","onClose","children","ariaLabel","props","_objectWithoutProperties","_excluded","ariaLabelId","useMemo","LeUtils","uniqueId","onClosed","useCallback","event","reason","STRING","toLowerCase","includes","React","createElement","Fragment","MuiDialog","_extends","className","id","style","display"],"mappings":";;;;;;;;;;;;AAOMA,IAAAA,MAAM,GAAGC,KAAK,CAACC,IAAI,CAAC,UAAAC,IAAA,EAC1B;AAAA,EAAA,IAD4BC,OAAO,GAAAD,IAAA,CAAPC,OAAO;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAeC,SAAS,GAAAH,IAAA,CAAtB,YAAY,CAAA;AAAeI,IAAAA,KAAK,GAAAC,wBAAA,CAAAL,IAAA,EAAAM,SAAA,CAAA,CAAA;AAE9E,EAAA,IAAMC,WAAW,GAAGT,KAAK,CAACU,OAAO,CAAC,YAAA;AAAA,IAAA,OAAM,+BAA+B,GAAGC,OAAO,CAACC,QAAQ,EAAE,CAAA;AAAA,GAAA,EAAE,EAAE,CAAC,CAAA;EAGjG,IAAMC,QAAQ,GAAGb,KAAK,CAACc,WAAW,CAAC,UAACC,KAAK,EAAEC,MAAM,EACjD;AACC,IAAA,IAAG,CAACC,MAAM,CAACD,MAAM,CAAC,CAACE,WAAW,EAAE,CAACC,QAAQ,CAAC,QAAQ,CAAC,EACnD;AACC;AACA,MAAA,OAAA;AACD,KAAA;AAEA,IAAA,IAAGhB,OAAO,EACV;AACCA,MAAAA,OAAO,CAACY,KAAK,EAAEC,MAAM,CAAC,CAAA;AACvB,KAAA;AACD,GAAC,EAAE,CAACb,OAAO,CAAC,CAAC,CAAA;AAGb,EAAA,oBAAQiB,KAAA,CAAAC,aAAA,CAAAD,KAAA,CAAAE,QAAA,EACPF,IAAAA,eAAAA,KAAA,CAAAC,aAAA,CAACE,QAAS,EAAAC,QAAA,CAAA;AAACC,IAAAA,SAAS,EAAC,sBAAsB;AAACtB,IAAAA,OAAO,EAAEU,QAAS;IAAC,iBAAiBJ,EAAAA,WAAAA;AAAY,GAAA,EAAKH,KAAK,CAAA,eACrGc,KAAA,CAAAC,aAAA,CAAA,MAAA,EAAA;AAAMI,IAAAA,SAAS,EAAC,iCAAiC;AAACC,IAAAA,EAAE,EAAEjB,WAAY;AAACkB,IAAAA,KAAK,EAAE;AAACC,MAAAA,OAAO,EAAC,MAAA;AAAM,KAAA;GAAIvB,EAAAA,SAAS,KAATA,IAAAA,IAAAA,SAAS,KAATA,KAAAA,CAAAA,GAAAA,SAAS,GAAI,EAAS,CAAC,EACnHD,QACS,CACV,CAAC,CAAA;AACJ,CAAC;;;;"}
package/MuiRoot/index.js CHANGED
@@ -7,7 +7,7 @@ import { LocalizationProvider } from '@mui/x-date-pickers';
7
7
  import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
8
8
  import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
9
9
 
10
- var css_248z = ".lowentry-mui--mui-root{height:100%;width:100%}@media not (hover:hover),not (pointer:fine){.lowentry-mui--mui-root .MuiButtonBase-root:not(.allow-mobile-hover):hover{background-color:hsla(0,0%,100%,0)!important}}";
10
+ var css_248z = ".lowentry-mui--mui-root{height:100%;width:100%}@media not (hover:hover),not (pointer:fine){.lowentry-mui--mui-root .MuiButtonBase-root:not(.allow-mobile-hover):hover .MuiTouchRipple-root{background-color:hsla(0,0%,100%,0)!important}}";
11
11
  styleInject(css_248z);
12
12
 
13
13
  var _excluded = ["theme", "className", "children"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lowentry/mui",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "private": false,
5
5
  "main": "./index.js",
6
6
  "description": "Provides utilities for Material UI.",
@@ -1,11 +1,15 @@
1
1
  import React from 'react';
2
2
  import {LeRed} from '@lowentry/react-redux';
3
- import {STRING} from '@lowentry/utils';
3
+ import {LeUtils, STRING} from '@lowentry/utils';
4
4
  import {Dialog as MuiDialog} from '@mui/material';
5
+ import './Dialog.less';
5
6
 
6
7
 
7
- const Dialog = LeRed.memo(({onClose, children, ...props}) =>
8
+ const Dialog = LeRed.memo(({onClose, children, 'aria-label':ariaLabel, ...props}) =>
8
9
  {
10
+ const ariaLabelId = LeRed.useMemo(() => 'lowentrymui_dialog_arialabel_' + LeUtils.uniqueId(), []);
11
+
12
+
9
13
  const onClosed = LeRed.useCallback((event, reason) =>
10
14
  {
11
15
  if(!STRING(reason).toLowerCase().includes('escape'))
@@ -22,7 +26,8 @@ const Dialog = LeRed.memo(({onClose, children, ...props}) =>
22
26
 
23
27
 
24
28
  return (<>
25
- <MuiDialog onClose={onClosed} {...props}>
29
+ <MuiDialog className="lowentry-mui--dialog" onClose={onClosed} aria-labelledby={ariaLabelId} {...props}>
30
+ <span className="lowentry-mui--dialog--arialabel" id={ariaLabelId} style={{display:'none'}}>{ariaLabel ?? ''}</span>
26
31
  {children}
27
32
  </MuiDialog>
28
33
  </>);
@@ -0,0 +1,7 @@
1
+ .lowentry-mui--dialog
2
+ {
3
+ .lowentry-mui--dialog--arialabel
4
+ {
5
+ display: none !important;
6
+ }
7
+ }
@@ -5,7 +5,7 @@
5
5
 
6
6
  @media not (hover: hover), not (pointer: fine) // mobile devices
7
7
  {
8
- .MuiButtonBase-root:not(.allow-mobile-hover):hover
8
+ .MuiButtonBase-root:not(.allow-mobile-hover):hover .MuiTouchRipple-root
9
9
  {
10
10
  background-color: rgba(255, 255, 255, 0) !important;
11
11
  }