@daoyi/nmtl-ui 2.0.1-beta.121 → 2.0.1-beta.123

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,3 +1,4 @@
1
+ import { c as _objectWithoutProperties, _ as _extends } from './_rollupPluginBabelHelpers-a52356f6.js';
1
2
  import React__default from 'react';
2
3
  import PropTypes from 'prop-types';
3
4
  import { c as classNames } from './index-b76a85f4.js';
@@ -7,6 +8,7 @@ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
7
8
  var css_248z = ".button {\n border: 1px solid #ffffff99;\n border-radius: 45px;\n padding: 8px 16px;\n background: #007bff;\n color: white;\n cursor: pointer;\n}\n.button:hover {\n opacity: 0.9;\n}";
8
9
  styleInject(css_248z);
9
10
 
11
+ var _excluded = ["style", "className", "tabIndex", "alt", "text", "size", "variant", "type", "color", "loading", "disabled", "icon", "endIcon", "children", "onClick"];
10
12
  var Button = function Button(props) {
11
13
  var style = props.style,
12
14
  className = props.className,
@@ -23,7 +25,27 @@ var Button = function Button(props) {
23
25
  endIcon = props.endIcon,
24
26
  children = props.children,
25
27
  onClick = props.onClick;
26
- return /*#__PURE__*/React__default.createElement(Button$1, {
28
+ /* 本元件原本逐一挑選 props,呼叫端傳入的 aria-*/title/role 會被靜默丟掉——
29
+ nmtl-web 有三處為了補可及名稱而傳 aria-label,其中 areaMap 那處自 80db4537
30
+ 起就一直沒有生效(WCAG 4.1.2,Freego HM1410200C)。
31
+ 把宣告過的 props 取出後,其餘一律往下傳。 */
32
+ props.style;
33
+ props.className;
34
+ props.tabIndex;
35
+ props.alt;
36
+ props.text;
37
+ props.size;
38
+ props.variant;
39
+ props.type;
40
+ props.color;
41
+ props.loading;
42
+ props.disabled;
43
+ props.icon;
44
+ props.endIcon;
45
+ props.children;
46
+ props.onClick;
47
+ var rest = _objectWithoutProperties(props, _excluded);
48
+ return /*#__PURE__*/React__default.createElement(Button$1, _extends({}, rest, {
27
49
  style: style,
28
50
  className: classNames('button', className),
29
51
  tabIndex: tabIndex,
@@ -37,7 +59,7 @@ var Button = function Button(props) {
37
59
  endIcon: loading ? /*#__PURE__*/React__default.createElement(CircularProgress, {
38
60
  size: 16
39
61
  }) : endIcon
40
- }, text, children);
62
+ }), text, children);
41
63
  };
42
64
  Button.defaultProps = {
43
65
  style: undefined,
@@ -1,4 +1,5 @@
1
- export { B as default } from './Button-305b69a0.js';
1
+ export { B as default } from './Button-7bd5aa09.js';
2
+ import './_rollupPluginBabelHelpers-a52356f6.js';
2
3
  import 'react';
3
4
  import 'prop-types';
4
5
  import './index-b76a85f4.js';
@@ -3,7 +3,7 @@ import React__default, { createContext, forwardRef, createElement, useContext, u
3
3
  import PropTypes from 'prop-types';
4
4
  import { h as hoistNonReactStatics_cjs } from './hoist-non-react-statics.cjs-3f408ad2.js';
5
5
  import axios from 'axios';
6
- import { M as Modal } from './Modal-76fef34f.js';
6
+ import { M as Modal } from './Modal-b62ff592.js';
7
7
  import { c as commonjsGlobal, a as getDefaultExportFromCjs } from './_commonjsHelpers-70de2c37.js';
8
8
  import { c as classNames } from './index-b76a85f4.js';
9
9
  import { Input, IconButton, Button, Box, Typography, FormControl, RadioGroup, FormControlLabel, Radio, TextField, TextareaAutosize } from '@material-ui/core';
@@ -1,15 +1,15 @@
1
- export { C as default } from './ContactModal-763fc7cb.js';
1
+ export { C as default } from './ContactModal-ac82e7a6.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
5
5
  import './hoist-non-react-statics.cjs-3f408ad2.js';
6
6
  import 'react-is';
7
7
  import 'axios';
8
- import './Modal-76fef34f.js';
8
+ import './Modal-b62ff592.js';
9
9
  import './index-b76a85f4.js';
10
10
  import '@material-ui/core';
11
11
  import '@material-ui/icons';
12
- import './Button-305b69a0.js';
12
+ import './Button-7bd5aa09.js';
13
13
  import './style-inject.es-1f59c1d0.js';
14
14
  import './Spin-8f87eadc.js';
15
15
  import './globalConfig';
@@ -3,16 +3,16 @@ import React__default, { useState, useEffect } from 'react';
3
3
  import { c as classNames } from './index-b76a85f4.js';
4
4
  import PropTypes from 'prop-types';
5
5
  import axios from 'axios';
6
- import { C as ContactModal } from './ContactModal-763fc7cb.js';
6
+ import { C as ContactModal } from './ContactModal-ac82e7a6.js';
7
7
  import { S as Spin } from './Spin-8f87eadc.js';
8
8
  import { getIntl } from './globalConfig';
9
9
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
10
10
  import './hoist-non-react-statics.cjs-3f408ad2.js';
11
11
  import 'react-is';
12
- import './Modal-76fef34f.js';
12
+ import './Modal-b62ff592.js';
13
13
  import '@material-ui/core';
14
14
  import '@material-ui/icons';
15
- import './Button-305b69a0.js';
15
+ import './Button-7bd5aa09.js';
16
16
  import './_commonjsHelpers-70de2c37.js';
17
17
  import './defaultTheme-ed7746fe.js';
18
18
  import '@material-ui/styles';
@@ -28,10 +28,10 @@ var ForwardLink = function ForwardLink(_ref) {
28
28
  var _useMemo = useMemo(function () {
29
29
  var _rest$pathname;
30
30
  if (disabled) return {};
31
- /*
32
- * 若將 search 寫在 pathname 中,意即 pathname=/asd?zxc=qwe
33
- * 會導致換頁時 React route dom 無法匹配 => 空白畫面
34
- * 若真有此情況發生 需把 search 提領出來
31
+ /*
32
+ * 若將 search 寫在 pathname 中,意即 pathname=/asd?zxc=qwe
33
+ * 會導致換頁時 React route dom 無法匹配 => 空白畫面
34
+ * 若真有此情況發生 需把 search 提領出來
35
35
  */
36
36
  var foundIndex = (_rest$pathname = rest.pathname) === null || _rest$pathname === void 0 ? void 0 : _rest$pathname.indexOf('?');
37
37
  if (foundIndex > -1) return {
@@ -54,20 +54,26 @@ var ForwardLink = function ForwardLink(_ref) {
54
54
  var newWindowLabel = target === '_blank' && (typeof children === 'string' || title) ? "".concat(typeof children === 'string' ? children : title).concat(getIntl().formatMessage({
55
55
  id: 'aria.newWindow'
56
56
  })) : undefined;
57
- /* R24:aria-label 已含 title 全文時不再輸出 title 屬性——NVDA 會把 title 屬性當
57
+ /* R24:aria-label 已含 title 全文時不再輸出 title 屬性——NVDA 會把 title 屬性當
58
58
  description 接在 aria-label 之後再唸一次,造成「書名 ×2」(abo 首頁推薦卡實測) */
59
59
  var linkTitle = newWindowLabel ? undefined : domTitle;
60
+
61
+ /* 沒有可及名稱的連結對所有使用者都無用,且會被判 Freego HM1240401C
62
+ (實測 ocean books?id=ART469770:某筆資料人名為空 → <a> 內容全空)。
63
+ children 為空字串/空值且無 title 時,改以非互動元素呈現。 */
64
+ var namelessChildren = children === undefined || children === null || children === false || typeof children === 'string' && !children.trim();
65
+ var nameless = namelessChildren && !title;
60
66
  var linkComponent = /*#__PURE__*/React__default.createElement("div", {
61
67
  className: className
62
68
  }, /*#__PURE__*/React__default.createElement("div", {
63
69
  className: "forwardLink"
64
- }, disabled ? /*#__PURE__*/React__default.createElement("div", {
70
+ }, disabled || nameless ? /*#__PURE__*/React__default.createElement("div", {
65
71
  title: domTitle,
66
72
  className: classNames('forwardLink__link--disabled', linkClassName)
67
73
  }, children) :
68
74
  /*#__PURE__*/
69
- /* linkClassName 直接掛在可聚焦的 <a> 上:消費端的 ellipsis/overflow 樣式若掛在
70
- 外層 className(包裹 div),會裁掉 <a> 的焦點框(WCAG 2.4.7 走查實測)——
75
+ /* linkClassName 直接掛在可聚焦的 <a> 上:消費端的 ellipsis/overflow 樣式若掛在
76
+ 外層 className(包裹 div),會裁掉 <a> 的焦點框(WCAG 2.4.7 走查實測)——
71
77
  此類樣式應改傳 linkClassName */
72
78
  React__default.createElement(Link, {
73
79
  className: classNames('forwardLink__link', linkClassName),
@@ -1,4 +1,4 @@
1
- export { F as default } from './ForwardLink-e86c1080.js';
1
+ export { F as default } from './ForwardLink-9f22205c.js';
2
2
  import './_rollupPluginBabelHelpers-a52356f6.js';
3
3
  import 'react';
4
4
  import 'prop-types';
@@ -2,7 +2,7 @@ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState, useRef, useEffect } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classNames } from './index-b76a85f4.js';
5
- import { F as ForwardLink } from './ForwardLink-e86c1080.js';
5
+ import { F as ForwardLink } from './ForwardLink-9f22205c.js';
6
6
  import { getIntl } from './globalConfig';
7
7
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
8
8
  import './index-b47819f3.js';
@@ -2,13 +2,13 @@ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
2
2
  import React__default, { useState, useEffect, useRef } from 'react';
3
3
  import PropTypes from 'prop-types';
4
4
  import { c as classNames } from './index-b76a85f4.js';
5
- import { M as Modal } from './Modal-76fef34f.js';
5
+ import { M as Modal } from './Modal-b62ff592.js';
6
6
  import { Typography } from '@material-ui/core';
7
7
  import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
8
8
  import { getIntl } from './globalConfig';
9
9
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
10
10
  import '@material-ui/icons';
11
- import './Button-305b69a0.js';
11
+ import './Button-7bd5aa09.js';
12
12
  import './Spin-8f87eadc.js';
13
13
  import './_commonjsHelpers-70de2c37.js';
14
14
  import './defaultTheme-ed7746fe.js';
@@ -3,7 +3,7 @@ import { c as classNames } from './index-b76a85f4.js';
3
3
  import PropTypes from 'prop-types';
4
4
  import { Dialog, DialogTitle, IconButton, DialogContent, DialogActions, CircularProgress } from '@material-ui/core';
5
5
  import { CloseSharp } from '@material-ui/icons';
6
- import { B as Button } from './Button-305b69a0.js';
6
+ import { B as Button } from './Button-7bd5aa09.js';
7
7
  import { S as Spin } from './Spin-8f87eadc.js';
8
8
  import { getIntl } from './globalConfig';
9
9
  import { s as styleInject } from './style-inject.es-1f59c1d0.js';
@@ -1,10 +1,11 @@
1
- export { M as default } from './Modal-76fef34f.js';
1
+ export { M as default } from './Modal-b62ff592.js';
2
2
  import 'react';
3
3
  import './index-b76a85f4.js';
4
4
  import 'prop-types';
5
5
  import '@material-ui/core';
6
6
  import '@material-ui/icons';
7
- import './Button-305b69a0.js';
7
+ import './Button-7bd5aa09.js';
8
+ import './_rollupPluginBabelHelpers-a52356f6.js';
8
9
  import './style-inject.es-1f59c1d0.js';
9
10
  import './Spin-8f87eadc.js';
10
11
  import './globalConfig';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@daoyi/nmtl-ui",
3
- "version": "2.0.1-beta.121",
3
+ "version": "2.0.1-beta.123",
4
4
  "description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
5
5
  "author": "daoyi",
6
6
  "main": "lib/index.js",