@daoyi/nmtl-ui 2.0.1-beta.95 → 2.0.1-beta.97
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/lib/components/{ContactModal-560b9bdd.js → ContactModal-7427edd0.js} +25 -6
- package/lib/components/ContactModal.js +2 -2
- package/lib/components/{ExtraTools-5954ee3a.js → ExtraTools-8d2ef84d.js} +26 -2
- package/lib/components/ExtraTools.js +1 -1
- package/lib/components/Footer.js +22 -2
- package/lib/components/{ForwardLink-aa950a50.js → ForwardLink-83a7eea9.js} +15 -5
- package/lib/components/ForwardLink.js +2 -1
- package/lib/components/KeywordTicker.js +1 -1
- package/lib/components/Keywords.js +1 -1
- package/lib/components/MUITheme.js +16 -1
- package/lib/components/{Modal-5a27951f.js → Modal-777fe87d.js} +1 -1
- package/lib/components/Modal.js +1 -1
- package/lib/components/SNA.js +1 -1
- package/package.json +125 -125
|
@@ -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-
|
|
6
|
+
import { M as Modal } from './Modal-777fe87d.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, Button, Box, Typography, FormControl, RadioGroup, FormControlLabel, Radio, TextField, TextareaAutosize } from '@material-ui/core';
|
|
@@ -11540,6 +11540,8 @@ function reducer(state, action) {
|
|
|
11540
11540
|
|
|
11541
11541
|
const Upload = _ref => {
|
|
11542
11542
|
let {
|
|
11543
|
+
ariaLabelledby,
|
|
11544
|
+
buttonText,
|
|
11543
11545
|
onChange
|
|
11544
11546
|
} = _ref;
|
|
11545
11547
|
const fileRef = useRef(null);
|
|
@@ -11565,17 +11567,31 @@ const Upload = _ref => {
|
|
|
11565
11567
|
className: "container"
|
|
11566
11568
|
}, /*#__PURE__*/React__default.createElement("div", getRootProps({
|
|
11567
11569
|
className: 'dropzone'
|
|
11568
|
-
}), /*#__PURE__*/React__default.createElement("input", getInputProps(
|
|
11570
|
+
}), /*#__PURE__*/React__default.createElement("input", getInputProps({
|
|
11571
|
+
'aria-labelledby': ariaLabelledby
|
|
11572
|
+
})), /*#__PURE__*/React__default.createElement(Button, {
|
|
11569
11573
|
variant: "contained",
|
|
11570
11574
|
color: "default",
|
|
11571
|
-
startIcon: /*#__PURE__*/React__default.createElement(default_1,
|
|
11575
|
+
startIcon: /*#__PURE__*/React__default.createElement(default_1, {
|
|
11576
|
+
"aria-hidden": "true"
|
|
11577
|
+
}),
|
|
11572
11578
|
onClick: openDialog
|
|
11573
|
-
},
|
|
11579
|
+
}, buttonText || 'Upload')), /*#__PURE__*/React__default.createElement("aside", null, /*#__PURE__*/React__default.createElement("ul", {
|
|
11580
|
+
"aria-live": "polite"
|
|
11581
|
+
}, acceptedFiles.map(file => /*#__PURE__*/React__default.createElement("li", {
|
|
11574
11582
|
key: file.path
|
|
11575
11583
|
}, file.path)))));
|
|
11576
11584
|
});
|
|
11577
11585
|
};
|
|
11586
|
+
Upload.defaultProps = {
|
|
11587
|
+
ariaLabelledby: undefined,
|
|
11588
|
+
buttonText: undefined
|
|
11589
|
+
};
|
|
11578
11590
|
Upload.propTypes = {
|
|
11591
|
+
/** 欄位標題元素 id(aria-labelledby 關聯用) */
|
|
11592
|
+
ariaLabelledby: PropTypes.string,
|
|
11593
|
+
/** 觸發按鈕的可見文字(建議傳欄位標題,如「附件上傳」) */
|
|
11594
|
+
buttonText: PropTypes.string,
|
|
11579
11595
|
onChange: PropTypes.func.isRequired
|
|
11580
11596
|
};
|
|
11581
11597
|
|
|
@@ -11664,7 +11680,10 @@ const FormItem = _ref => {
|
|
|
11664
11680
|
}, option.desc)))));
|
|
11665
11681
|
break;
|
|
11666
11682
|
case 'upload':
|
|
11683
|
+
/* WCAG 1.3.1/3.3.2 附件上傳:標題 id 關聯內部 file input;按鈕以欄位標題為可見文字(WAVE: Missing form label) */
|
|
11667
11684
|
component = /*#__PURE__*/React__default.createElement(Upload, _extends$1({}, field, {
|
|
11685
|
+
ariaLabelledby: labelId,
|
|
11686
|
+
buttonText: label,
|
|
11668
11687
|
onChange: files => setFieldValue(field.name, files)
|
|
11669
11688
|
}));
|
|
11670
11689
|
break;
|
|
@@ -11703,13 +11722,13 @@ const FormItem = _ref => {
|
|
|
11703
11722
|
}, label, required && /*#__PURE__*/React__default.createElement("div", {
|
|
11704
11723
|
className: "formItem__title__star",
|
|
11705
11724
|
"aria-hidden": "true"
|
|
11706
|
-
},
|
|
11725
|
+
}, "*")) : /*#__PURE__*/React__default.createElement("div", {
|
|
11707
11726
|
className: "formItem__title",
|
|
11708
11727
|
id: labelId
|
|
11709
11728
|
}, label, required && /*#__PURE__*/React__default.createElement("div", {
|
|
11710
11729
|
className: "formItem__title__star",
|
|
11711
11730
|
"aria-hidden": "true"
|
|
11712
|
-
},
|
|
11731
|
+
}, "*"))), hint && /*#__PURE__*/React__default.createElement(Box, {
|
|
11713
11732
|
my: 1
|
|
11714
11733
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
11715
11734
|
variant: "body2"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { C as default } from './ContactModal-
|
|
1
|
+
export { C as default } from './ContactModal-7427edd0.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-
|
|
8
|
+
import './Modal-777fe87d.js';
|
|
9
9
|
import './index-b76a85f4.js';
|
|
10
10
|
import '@material-ui/core';
|
|
11
11
|
import '@material-ui/icons';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _extends } from './_rollupPluginBabelHelpers-a52356f6.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import React__default, { Component, forwardRef, useState } from 'react';
|
|
3
|
+
import React__default, { Component, forwardRef, useState, useRef, useEffect } from 'react';
|
|
4
4
|
import { c as classNames } from './index-b76a85f4.js';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { a as getDefaultExportFromCjs } from './_commonjsHelpers-70de2c37.js';
|
|
@@ -3143,7 +3143,7 @@ const ResetMobileIcon = _ref => {
|
|
|
3143
3143
|
})));
|
|
3144
3144
|
};
|
|
3145
3145
|
|
|
3146
|
-
var css_248z = ".extraTools {\n width: 100%;\n display: inline-flex;\n justify-content: flex-end;\n align-items: center;\n gap: 1rem;\n padding: 0px 20px;\n padding-top: 12px;\n}\n.extraTools__share button {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__download {\n cursor: pointer;\n}\n.extraTools__download-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__fullscreenBtn {\n cursor: pointer;\n padding-top: 0;\n}\n.extraTools__fullscreenBtn-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__fontsize {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools .font-size-changer,\n.extraTools .font-size-changer-buttons,\n.extraTools .font-size-up,\n.extraTools .font-size-down,\n.extraTools .tooltip {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools .font-size-up {\n width: 32px !important;\n cursor: pointer;\n margin-right: 16px !important;\n}\n.extraTools .font-size-down {\n cursor: pointer;\n width: 32px !important;\n}\n.extraTools .fullscreenExit {\n text-align: right;\n cursor: pointer;\n border: 0;\n}\n.extraTools #download-menu .MuiMenuItem-root {\n color: #4e3a16;\n width: auto;\n overflow: hidden;\n font-size: 1rem;\n box-sizing: border-box;\n min-height: 48px;\n font-weight: 400;\n line-height: 1;\n padding-top: 1rem;\n white-space: initial;\n border-bottom: 0;\n letter-spacing: 0.00938em;\n padding-bottom: 1rem;\n}";
|
|
3146
|
+
var css_248z = ".extraTools {\n width: 100%;\n display: inline-flex;\n justify-content: flex-end;\n align-items: center;\n gap: 1rem;\n padding: 0px 20px;\n padding-top: 12px;\n}\n.extraTools__share button {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__download {\n cursor: pointer;\n}\n.extraTools__download-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__fullscreenBtn {\n cursor: pointer;\n padding-top: 0;\n}\n.extraTools__fullscreenBtn-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools__fontsize {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools .font-size-changer,\n.extraTools .font-size-changer-buttons,\n.extraTools .font-size-up,\n.extraTools .font-size-down,\n.extraTools .tooltip {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.extraTools .font-size-up {\n width: 32px !important;\n cursor: pointer;\n margin-right: 16px !important;\n}\n.extraTools .font-size-down {\n cursor: pointer;\n width: 32px !important;\n}\n.extraTools .font-size-up,\n.extraTools .font-size-down {\n height: 32px;\n line-height: 32px !important;\n}\n.extraTools .fullscreenExit {\n text-align: right;\n cursor: pointer;\n border: 0;\n}\n.extraTools #download-menu .MuiMenuItem-root {\n color: #4e3a16;\n width: auto;\n overflow: hidden;\n font-size: 1rem;\n box-sizing: border-box;\n min-height: 48px;\n font-weight: 400;\n line-height: 1;\n padding-top: 1rem;\n white-space: initial;\n border-bottom: 0;\n letter-spacing: 0.00938em;\n padding-bottom: 1rem;\n}";
|
|
3147
3147
|
styleInject(css_248z);
|
|
3148
3148
|
|
|
3149
3149
|
/* eslint-disable prefer-destructuring */
|
|
@@ -3362,7 +3362,31 @@ const FontSizeChanger = _ref5 => {
|
|
|
3362
3362
|
FontSizeTargets,
|
|
3363
3363
|
FontSizeOptions
|
|
3364
3364
|
} = _ref5;
|
|
3365
|
+
/* WCAG 2.1.1/4.1.2 react-font-size-changer 渲染的 A+/A− 為純 div onClick、
|
|
3366
|
+
無法聚焦也無鍵盤操作(第三方庫不提供 prop):掛載後補 tabindex/role/aria-label/Enter+Space */
|
|
3367
|
+
const rootRef = useRef(null);
|
|
3368
|
+
useEffect(() => {
|
|
3369
|
+
if (!rootRef.current) return;
|
|
3370
|
+
rootRef.current.querySelectorAll('.font-size-up, .font-size-down').forEach(el => {
|
|
3371
|
+
if (el.getAttribute('tabindex') === '0') return;
|
|
3372
|
+
const isUp = el.classList.contains('font-size-up');
|
|
3373
|
+
const labelId = isUp ? 'knowledge.writersAndWorksSNA.big' : 'knowledge.writersAndWorksSNA.small';
|
|
3374
|
+
const fallback = isUp ? '字級放大' : '字級縮小';
|
|
3375
|
+
el.setAttribute('tabindex', '0');
|
|
3376
|
+
el.setAttribute('role', 'button');
|
|
3377
|
+
el.setAttribute('aria-label', intl ? intl.formatMessage({
|
|
3378
|
+
id: labelId
|
|
3379
|
+
}) : fallback);
|
|
3380
|
+
el.addEventListener('keydown', event => {
|
|
3381
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
3382
|
+
event.preventDefault();
|
|
3383
|
+
el.click();
|
|
3384
|
+
}
|
|
3385
|
+
});
|
|
3386
|
+
});
|
|
3387
|
+
});
|
|
3365
3388
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
3389
|
+
ref: rootRef,
|
|
3366
3390
|
className: classNames('extraTools__fontsize', className)
|
|
3367
3391
|
}, /*#__PURE__*/React__default.createElement(FontSize, {
|
|
3368
3392
|
targets: FontSizeTargets,
|
package/lib/components/Footer.js
CHANGED
|
@@ -3,12 +3,12 @@ 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-
|
|
6
|
+
import { C as ContactModal } from './ContactModal-7427edd0.js';
|
|
7
7
|
import { S as Spin } from './Spin-8dc60bfe.js';
|
|
8
8
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
9
9
|
import './hoist-non-react-statics.cjs-3f408ad2.js';
|
|
10
10
|
import 'react-is';
|
|
11
|
-
import './Modal-
|
|
11
|
+
import './Modal-777fe87d.js';
|
|
12
12
|
import '@material-ui/core';
|
|
13
13
|
import '@material-ui/icons';
|
|
14
14
|
import './Button-305b69a0.js';
|
|
@@ -187,6 +187,17 @@ var Footer = function Footer(props) {
|
|
|
187
187
|
}).map(function (_ref5, i) {
|
|
188
188
|
var name = _ref5.name,
|
|
189
189
|
url = _ref5.url;
|
|
190
|
+
/* 站內連結('/' 開頭,如網站導覽)同分頁開啟;外部連結維持另開新視窗 */
|
|
191
|
+
if (url && url.startsWith('/')) {
|
|
192
|
+
return /*#__PURE__*/React__default.createElement("a", {
|
|
193
|
+
className: "footer__content__item__link",
|
|
194
|
+
style: {
|
|
195
|
+
color: primaryColor
|
|
196
|
+
},
|
|
197
|
+
href: url,
|
|
198
|
+
key: i.toString()
|
|
199
|
+
}, name.toUpperCase());
|
|
200
|
+
}
|
|
190
201
|
return /*#__PURE__*/React__default.createElement("a", {
|
|
191
202
|
className: "footer__content__item__link",
|
|
192
203
|
style: {
|
|
@@ -202,8 +213,17 @@ var Footer = function Footer(props) {
|
|
|
202
213
|
style: {
|
|
203
214
|
color: primaryColor
|
|
204
215
|
},
|
|
216
|
+
role: "button",
|
|
217
|
+
tabIndex: 0,
|
|
218
|
+
"aria-haspopup": "dialog",
|
|
205
219
|
onClick: function onClick() {
|
|
206
220
|
return setContactModalOpen(true);
|
|
221
|
+
},
|
|
222
|
+
onKeyDown: function onKeyDown(event) {
|
|
223
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
224
|
+
event.preventDefault();
|
|
225
|
+
setContactModalOpen(true);
|
|
226
|
+
}
|
|
207
227
|
}
|
|
208
228
|
}, formatMessage({
|
|
209
229
|
id: 'common.has.problem'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { c as _objectWithoutProperties } from './_rollupPluginBabelHelpers-a52356f6.js';
|
|
2
2
|
import React__default, { useMemo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
|
+
import { c as classNames } from './index-b76a85f4.js';
|
|
4
5
|
import { q as queryString } from './index-b47819f3.js';
|
|
5
6
|
import { useHistory, Link } from 'react-router-dom';
|
|
6
7
|
import { Tooltip } from '@material-ui/core';
|
|
@@ -10,11 +11,12 @@ import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
|
10
11
|
var css_248z = ".forwardLink {\n width: -moz-fit-content;\n width: fit-content;\n max-width: 100%;\n display: flex;\n}\n.forwardLink__link {\n color: unset;\n text-decoration: none;\n text-overflow: ellipsis;\n overflow: hidden;\n cursor: pointer;\n display: block;\n width: 100%;\n}\n.forwardLink__link--disabled {\n cursor: not-allowed;\n}";
|
|
11
12
|
styleInject(css_248z);
|
|
12
13
|
|
|
13
|
-
var _excluded = ["className", "title", "target", "disabled", "children", "tip", "onClick"];
|
|
14
|
+
var _excluded = ["className", "linkClassName", "title", "target", "disabled", "children", "tip", "onClick"];
|
|
14
15
|
var locale = '/zh-tw'; // 20230318 暫時寫死,若套件納入語系控制,可將其置換
|
|
15
16
|
|
|
16
17
|
var ForwardLink = function ForwardLink(_ref) {
|
|
17
18
|
var className = _ref.className,
|
|
19
|
+
linkClassName = _ref.linkClassName,
|
|
18
20
|
title = _ref.title,
|
|
19
21
|
target = _ref.target,
|
|
20
22
|
disabled = _ref.disabled,
|
|
@@ -58,9 +60,14 @@ var ForwardLink = function ForwardLink(_ref) {
|
|
|
58
60
|
className: "forwardLink"
|
|
59
61
|
}, disabled ? /*#__PURE__*/React__default.createElement("div", {
|
|
60
62
|
title: domTitle,
|
|
61
|
-
className:
|
|
62
|
-
}, children) :
|
|
63
|
-
|
|
63
|
+
className: classNames('forwardLink__link--disabled', linkClassName)
|
|
64
|
+
}, children) :
|
|
65
|
+
/*#__PURE__*/
|
|
66
|
+
/* linkClassName 直接掛在可聚焦的 <a> 上:消費端的 ellipsis/overflow 樣式若掛在
|
|
67
|
+
外層 className(包裹 div),會裁掉 <a> 的焦點框(WCAG 2.4.7 走查實測)——
|
|
68
|
+
此類樣式應改傳 linkClassName */
|
|
69
|
+
React__default.createElement(Link, {
|
|
70
|
+
className: classNames('forwardLink__link', linkClassName),
|
|
64
71
|
target: target,
|
|
65
72
|
title: domTitle,
|
|
66
73
|
"aria-label": newWindowLabel,
|
|
@@ -79,6 +86,7 @@ var ForwardLink = function ForwardLink(_ref) {
|
|
|
79
86
|
};
|
|
80
87
|
ForwardLink.defaultProps = {
|
|
81
88
|
className: undefined,
|
|
89
|
+
linkClassName: undefined,
|
|
82
90
|
title: undefined,
|
|
83
91
|
target: '_blank',
|
|
84
92
|
disabled: undefined,
|
|
@@ -92,8 +100,10 @@ ForwardLink.defaultProps = {
|
|
|
92
100
|
|
|
93
101
|
/* Write props detail information and 'npm run updateStory' will help you generate stories's argTypes */
|
|
94
102
|
ForwardLink.propTypes = {
|
|
95
|
-
/** Css Name */
|
|
103
|
+
/** Css Name(掛在外層包裹 div;帶 overflow/ellipsis 的樣式請改用 linkClassName,否則會裁掉焦點框) */
|
|
96
104
|
className: PropTypes.string,
|
|
105
|
+
/** 直接掛在可聚焦 <a> 上的 Css Name */
|
|
106
|
+
linkClassName: PropTypes.string,
|
|
97
107
|
/** DOM title */
|
|
98
108
|
title: PropTypes.string,
|
|
99
109
|
/** DOM title */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { F as default } from './ForwardLink-
|
|
1
|
+
export { F as default } from './ForwardLink-83a7eea9.js';
|
|
2
2
|
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'prop-types';
|
|
5
|
+
import './index-b76a85f4.js';
|
|
5
6
|
import './index-b47819f3.js';
|
|
6
7
|
import 'react-router-dom';
|
|
7
8
|
import '@material-ui/core';
|
|
@@ -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-
|
|
5
|
+
import { F as ForwardLink } from './ForwardLink-83a7eea9.js';
|
|
6
6
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
7
7
|
import './index-b47819f3.js';
|
|
8
8
|
import 'react-router-dom';
|
|
@@ -2,7 +2,7 @@ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-a52356f6.js';
|
|
|
2
2
|
import React__default, { useState, useEffect } 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-
|
|
5
|
+
import { M as Modal } from './Modal-777fe87d.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 { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
@@ -2386,6 +2386,21 @@ const defaultColors = {
|
|
|
2386
2386
|
secondaryColor: '#ffc400'
|
|
2387
2387
|
};
|
|
2388
2388
|
|
|
2389
|
+
/* WCAG 1.4.3:依背景色相對亮度自動選深/白前景(Dialog 標題列底色為各站 primaryColor,
|
|
2390
|
+
淺色品牌(如 #9dc9da、#ECC651)配固定白字對比不足——WAVE 實測「聯繫我們」標題被抓) */
|
|
2391
|
+
const contrastText = hex => {
|
|
2392
|
+
const h = (hex || '').replace('#', '');
|
|
2393
|
+
if (h.length !== 6 && h.length !== 3) return 'white';
|
|
2394
|
+
const f = h.length === 3 ? h.split('').map(c => c + c).join('') : h;
|
|
2395
|
+
const [r, g, b] = [0, 2, 4].map(i => {
|
|
2396
|
+
const s = parseInt(f.slice(i, i + 2), 16) / 255;
|
|
2397
|
+
return s <= 0.03928 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
2398
|
+
});
|
|
2399
|
+
const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
2400
|
+
/* 白字需底色亮度 ≤ 0.1833 才達 4.5:1;否則配深字 */
|
|
2401
|
+
return luminance <= 0.1833 ? 'white' : '#0f1315';
|
|
2402
|
+
};
|
|
2403
|
+
|
|
2389
2404
|
// export const commonThemeProps = ({ darkMode, colors }) => {
|
|
2390
2405
|
const commonTheme = _ref => {
|
|
2391
2406
|
let {
|
|
@@ -2557,7 +2572,7 @@ const commonTheme = _ref => {
|
|
|
2557
2572
|
root: {
|
|
2558
2573
|
padding: '0 4px 0 12px',
|
|
2559
2574
|
background: primaryColor,
|
|
2560
|
-
color:
|
|
2575
|
+
color: contrastText(primaryColor)
|
|
2561
2576
|
}
|
|
2562
2577
|
},
|
|
2563
2578
|
MuiDialogContent: {
|
|
@@ -8,7 +8,7 @@ import { S as Spin } from './Spin-8dc60bfe.js';
|
|
|
8
8
|
import { getIntl } from './globalConfig';
|
|
9
9
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
10
10
|
|
|
11
|
-
var css_248z = ".modal__title h2 {\n display: flex;\n align-items: center;\n}\n.modal__title__text {\n flex: 1;\n font-size: 16px;\n padding: 8px 0;\n color:
|
|
11
|
+
var css_248z = ".modal__title h2 {\n display: flex;\n align-items: center;\n}\n.modal__title__text {\n flex: 1;\n font-size: 16px;\n padding: 8px 0;\n color: inherit;\n}\n.modal__title__close {\n cursor: pointer;\n color: inherit;\n}\n.modal--transparent .MuiPaper-root {\n background: transparent !important;\n box-shadow: none;\n}\n.modal--transparent .modal__title {\n background: transparent !important;\n}";
|
|
12
12
|
styleInject(css_248z);
|
|
13
13
|
|
|
14
14
|
var Modal = function Modal(props) {
|
package/lib/components/Modal.js
CHANGED
package/lib/components/SNA.js
CHANGED
|
@@ -2,7 +2,7 @@ import React__default, { useMemo, useEffect } from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { c as classNames } from './index-b76a85f4.js';
|
|
4
4
|
import { e as event, d as d3Select, a as dispatch, c as customEvent, D as DragEvent, q as quadtree, m as map, t as timer, T as Transform, i as identity, b as interrupt, o as ordinal, f as category10 } from './transform-3a04288b.js';
|
|
5
|
-
import { E as ExtraTools } from './ExtraTools-
|
|
5
|
+
import { E as ExtraTools } from './ExtraTools-8d2ef84d.js';
|
|
6
6
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
7
7
|
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
8
8
|
import './_commonjsHelpers-70de2c37.js';
|
package/package.json
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@daoyi/nmtl-ui",
|
|
3
|
-
"version": "2.0.1-beta.
|
|
4
|
-
"description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
|
|
5
|
-
"author": "daoyi",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"typings": "lib/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"lib"
|
|
10
|
-
],
|
|
11
|
-
"repository": {
|
|
12
|
-
"type": "git",
|
|
13
|
-
"url": "https://github.com/HsunTsai/react-storybook-jsx-starter"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@geometricpanda/storybook-addon-badges": "0.2.2",
|
|
17
|
-
"@material-ui/core": "4.12.3",
|
|
18
|
-
"@material-ui/icons": "4.11.2",
|
|
19
|
-
"@material-ui/lab": "4.0.0-alpha.60",
|
|
20
|
-
"@material-ui/styles": "4.11.4",
|
|
21
|
-
"axios": "0.21.1",
|
|
22
|
-
"babel-eslint": "10.1.0",
|
|
23
|
-
"classnames": "2.3.1",
|
|
24
|
-
"d3": "5.16.0",
|
|
25
|
-
"d3-selection": "1.4.2",
|
|
26
|
-
"d3-transition": "1.3.2",
|
|
27
|
-
"dom-to-image": "2.6.0",
|
|
28
|
-
"formik": "2.2.9",
|
|
29
|
-
"html-to-react": "1.4.5",
|
|
30
|
-
"jquery": "3.6.0",
|
|
31
|
-
"js-file-download": "0.4.12",
|
|
32
|
-
"jszip": "3.7.1",
|
|
33
|
-
"lodash": "4.17.21",
|
|
34
|
-
"markdown-it": "12.0.6",
|
|
35
|
-
"moment": "^2.29.4",
|
|
36
|
-
"notistack": "1.0.10",
|
|
37
|
-
"prop-types": "15.7.2",
|
|
38
|
-
"query-string": "6.12.1",
|
|
39
|
-
"react": "16.14.0",
|
|
40
|
-
"react-awesome-lightbox": "^1.8.1",
|
|
41
|
-
"react-data-export": "0.6.0",
|
|
42
|
-
"react-dom": "16.14.0",
|
|
43
|
-
"react-dropzone": "11.3.2",
|
|
44
|
-
"react-facebook-login": "4.1.1",
|
|
45
|
-
"react-file-download": "0.3.5",
|
|
46
|
-
"react-font-size-changer": "0.2.0",
|
|
47
|
-
"react-google-login": "5.2.2",
|
|
48
|
-
"react-intl": "5.8.0",
|
|
49
|
-
"react-redux": "7.2.5",
|
|
50
|
-
"react-router-dom": "5.2.0",
|
|
51
|
-
"react-share": "4.4.0",
|
|
52
|
-
"react-slick": "^0.28.1",
|
|
53
|
-
"redux": "4.1.0",
|
|
54
|
-
"sass": "1.41.1",
|
|
55
|
-
"screenfull": "5.2.0",
|
|
56
|
-
"slick-carousel": "^1.8.1",
|
|
57
|
-
"styled-components": "5.3.5",
|
|
58
|
-
"xlsx": "0.18.5"
|
|
59
|
-
},
|
|
60
|
-
"devDependencies": {
|
|
61
|
-
"@babel/core": "7.14.8",
|
|
62
|
-
"@babel/preset-env": "7.14.8",
|
|
63
|
-
"@babel/preset-react": "7.14.5",
|
|
64
|
-
"@rollup/plugin-babel": "5.3.1",
|
|
65
|
-
"@rollup/plugin-commonjs": "22.0.0",
|
|
66
|
-
"@rollup/plugin-node-resolve": "13.2.1",
|
|
67
|
-
"@rollup/plugin-replace": "4.0.0",
|
|
68
|
-
"@rollup/plugin-image": "2.1.1",
|
|
69
|
-
"@rollup/plugin-json": "4.1.0",
|
|
70
|
-
"@storybook/addon-essentials": "6.5.13",
|
|
71
|
-
"@storybook/addon-links": "6.5.13",
|
|
72
|
-
"@storybook/addon-notes": "6.0.0-alpha.6",
|
|
73
|
-
"@storybook/addons": "6.5.13",
|
|
74
|
-
"@storybook/preset-scss": "1.0.3",
|
|
75
|
-
"@storybook/react": "6.5.13",
|
|
76
|
-
"autoprefixer": "9.8.6",
|
|
77
|
-
"babel-loader": "8.2.2",
|
|
78
|
-
"babel-plugin-transform-imports": "2.0.0",
|
|
79
|
-
"css-loader": "1.0.1",
|
|
80
|
-
"eslint": "7.2.0",
|
|
81
|
-
"eslint-config-airbnb": "18.2.1",
|
|
82
|
-
"eslint-config-node": "4.1.0",
|
|
83
|
-
"eslint-config-prettier": "8.3.0",
|
|
84
|
-
"eslint-loader": "4.0.2",
|
|
85
|
-
"eslint-plugin-import": "2.22.1",
|
|
86
|
-
"eslint-plugin-jsx-a11y": "6.4.1",
|
|
87
|
-
"eslint-plugin-node": "11.1.0",
|
|
88
|
-
"eslint-plugin-prettier": "3.4.1",
|
|
89
|
-
"eslint-plugin-react": "7.21.5",
|
|
90
|
-
"eslint-plugin-react-hooks": "1.7.0",
|
|
91
|
-
"http-proxy-middleware": "1.3.1",
|
|
92
|
-
"prettier": "2.4.1",
|
|
93
|
-
"rollup": "2.70.2",
|
|
94
|
-
"rollup-plugin-cleaner": "1.0.0",
|
|
95
|
-
"rollup-plugin-postcss": "4.0.1",
|
|
96
|
-
"rollup-plugin-terser": "7.0.2",
|
|
97
|
-
"sass-loader": "7.1.0",
|
|
98
|
-
"style-loader": "0.22.1"
|
|
99
|
-
},
|
|
100
|
-
"browserslist": {
|
|
101
|
-
"production": [
|
|
102
|
-
">0.2%",
|
|
103
|
-
"not dead",
|
|
104
|
-
"not op_mini all"
|
|
105
|
-
],
|
|
106
|
-
"development": [
|
|
107
|
-
"last 1 chrome version",
|
|
108
|
-
"last 1 firefox version",
|
|
109
|
-
"last 1 safari version"
|
|
110
|
-
]
|
|
111
|
-
},
|
|
112
|
-
"scripts": {
|
|
113
|
-
"start": "set NODE_OPTIONS=--max_old_space_size=16384 && yarn storybook",
|
|
114
|
-
"lint": "eslint ./src/**/*.{js,jsx}",
|
|
115
|
-
"format": "prettier --write --tab-width 4 --use-tabs true \"{,src/**/}*.{js,jsx}\"",
|
|
116
|
-
"storybook": "start-storybook -p 6006 --no-open",
|
|
117
|
-
"build": "rollup -c && npm run build-index",
|
|
118
|
-
"build-index": "node ./rollup.index.js",
|
|
119
|
-
"build-storybook": "build-storybook -c .storybook -o public",
|
|
120
|
-
"create": "node ./buildUtils/create.js",
|
|
121
|
-
"pub": "npm version patch -m Publish && npm publish",
|
|
122
|
-
"pub-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
123
|
-
"pub-beta": "npm version prerelease --preid=beta && npm publish --tag beta"
|
|
124
|
-
}
|
|
125
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@daoyi/nmtl-ui",
|
|
3
|
+
"version": "2.0.1-beta.97",
|
|
4
|
+
"description": "This project is to be used as a starter kit for building React component using Storybook and Rollup",
|
|
5
|
+
"author": "daoyi",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"typings": "lib/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/HsunTsai/react-storybook-jsx-starter"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@geometricpanda/storybook-addon-badges": "0.2.2",
|
|
17
|
+
"@material-ui/core": "4.12.3",
|
|
18
|
+
"@material-ui/icons": "4.11.2",
|
|
19
|
+
"@material-ui/lab": "4.0.0-alpha.60",
|
|
20
|
+
"@material-ui/styles": "4.11.4",
|
|
21
|
+
"axios": "0.21.1",
|
|
22
|
+
"babel-eslint": "10.1.0",
|
|
23
|
+
"classnames": "2.3.1",
|
|
24
|
+
"d3": "5.16.0",
|
|
25
|
+
"d3-selection": "1.4.2",
|
|
26
|
+
"d3-transition": "1.3.2",
|
|
27
|
+
"dom-to-image": "2.6.0",
|
|
28
|
+
"formik": "2.2.9",
|
|
29
|
+
"html-to-react": "1.4.5",
|
|
30
|
+
"jquery": "3.6.0",
|
|
31
|
+
"js-file-download": "0.4.12",
|
|
32
|
+
"jszip": "3.7.1",
|
|
33
|
+
"lodash": "4.17.21",
|
|
34
|
+
"markdown-it": "12.0.6",
|
|
35
|
+
"moment": "^2.29.4",
|
|
36
|
+
"notistack": "1.0.10",
|
|
37
|
+
"prop-types": "15.7.2",
|
|
38
|
+
"query-string": "6.12.1",
|
|
39
|
+
"react": "16.14.0",
|
|
40
|
+
"react-awesome-lightbox": "^1.8.1",
|
|
41
|
+
"react-data-export": "0.6.0",
|
|
42
|
+
"react-dom": "16.14.0",
|
|
43
|
+
"react-dropzone": "11.3.2",
|
|
44
|
+
"react-facebook-login": "4.1.1",
|
|
45
|
+
"react-file-download": "0.3.5",
|
|
46
|
+
"react-font-size-changer": "0.2.0",
|
|
47
|
+
"react-google-login": "5.2.2",
|
|
48
|
+
"react-intl": "5.8.0",
|
|
49
|
+
"react-redux": "7.2.5",
|
|
50
|
+
"react-router-dom": "5.2.0",
|
|
51
|
+
"react-share": "4.4.0",
|
|
52
|
+
"react-slick": "^0.28.1",
|
|
53
|
+
"redux": "4.1.0",
|
|
54
|
+
"sass": "1.41.1",
|
|
55
|
+
"screenfull": "5.2.0",
|
|
56
|
+
"slick-carousel": "^1.8.1",
|
|
57
|
+
"styled-components": "5.3.5",
|
|
58
|
+
"xlsx": "0.18.5"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@babel/core": "7.14.8",
|
|
62
|
+
"@babel/preset-env": "7.14.8",
|
|
63
|
+
"@babel/preset-react": "7.14.5",
|
|
64
|
+
"@rollup/plugin-babel": "5.3.1",
|
|
65
|
+
"@rollup/plugin-commonjs": "22.0.0",
|
|
66
|
+
"@rollup/plugin-node-resolve": "13.2.1",
|
|
67
|
+
"@rollup/plugin-replace": "4.0.0",
|
|
68
|
+
"@rollup/plugin-image": "2.1.1",
|
|
69
|
+
"@rollup/plugin-json": "4.1.0",
|
|
70
|
+
"@storybook/addon-essentials": "6.5.13",
|
|
71
|
+
"@storybook/addon-links": "6.5.13",
|
|
72
|
+
"@storybook/addon-notes": "6.0.0-alpha.6",
|
|
73
|
+
"@storybook/addons": "6.5.13",
|
|
74
|
+
"@storybook/preset-scss": "1.0.3",
|
|
75
|
+
"@storybook/react": "6.5.13",
|
|
76
|
+
"autoprefixer": "9.8.6",
|
|
77
|
+
"babel-loader": "8.2.2",
|
|
78
|
+
"babel-plugin-transform-imports": "2.0.0",
|
|
79
|
+
"css-loader": "1.0.1",
|
|
80
|
+
"eslint": "7.2.0",
|
|
81
|
+
"eslint-config-airbnb": "18.2.1",
|
|
82
|
+
"eslint-config-node": "4.1.0",
|
|
83
|
+
"eslint-config-prettier": "8.3.0",
|
|
84
|
+
"eslint-loader": "4.0.2",
|
|
85
|
+
"eslint-plugin-import": "2.22.1",
|
|
86
|
+
"eslint-plugin-jsx-a11y": "6.4.1",
|
|
87
|
+
"eslint-plugin-node": "11.1.0",
|
|
88
|
+
"eslint-plugin-prettier": "3.4.1",
|
|
89
|
+
"eslint-plugin-react": "7.21.5",
|
|
90
|
+
"eslint-plugin-react-hooks": "1.7.0",
|
|
91
|
+
"http-proxy-middleware": "1.3.1",
|
|
92
|
+
"prettier": "2.4.1",
|
|
93
|
+
"rollup": "2.70.2",
|
|
94
|
+
"rollup-plugin-cleaner": "1.0.0",
|
|
95
|
+
"rollup-plugin-postcss": "4.0.1",
|
|
96
|
+
"rollup-plugin-terser": "7.0.2",
|
|
97
|
+
"sass-loader": "7.1.0",
|
|
98
|
+
"style-loader": "0.22.1"
|
|
99
|
+
},
|
|
100
|
+
"browserslist": {
|
|
101
|
+
"production": [
|
|
102
|
+
">0.2%",
|
|
103
|
+
"not dead",
|
|
104
|
+
"not op_mini all"
|
|
105
|
+
],
|
|
106
|
+
"development": [
|
|
107
|
+
"last 1 chrome version",
|
|
108
|
+
"last 1 firefox version",
|
|
109
|
+
"last 1 safari version"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"scripts": {
|
|
113
|
+
"start": "set NODE_OPTIONS=--max_old_space_size=16384 && yarn storybook",
|
|
114
|
+
"lint": "eslint ./src/**/*.{js,jsx}",
|
|
115
|
+
"format": "prettier --write --tab-width 4 --use-tabs true \"{,src/**/}*.{js,jsx}\"",
|
|
116
|
+
"storybook": "start-storybook -p 6006 --no-open",
|
|
117
|
+
"build": "rollup -c && npm run build-index",
|
|
118
|
+
"build-index": "node ./rollup.index.js",
|
|
119
|
+
"build-storybook": "build-storybook -c .storybook -o public",
|
|
120
|
+
"create": "node ./buildUtils/create.js",
|
|
121
|
+
"pub": "npm version patch -m Publish && npm publish",
|
|
122
|
+
"pub-alpha": "npm version prerelease --preid=alpha && npm publish --tag alpha",
|
|
123
|
+
"pub-beta": "npm version prerelease --preid=beta && npm publish --tag beta"
|
|
124
|
+
}
|
|
125
|
+
}
|