@daoyi/nmtl-ui 2.0.1-beta.96 → 2.0.1-beta.98
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-c006ed2c.js} +39 -7
- package/lib/components/ContactModal.js +7 -5
- package/lib/components/{Drawer-41d3a91f.js → Drawer-2cbcec04.js} +1 -1
- package/lib/components/Drawer.js +7 -2
- package/lib/components/{ExtraTools-94eeda8d.js → ExtraTools-55f66039.js} +1 -1
- package/lib/components/ExtraTools.js +1 -1
- package/lib/components/Footer.js +7 -5
- package/lib/components/Header.js +4 -2
- 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/Pagination.js +3 -8
- package/lib/components/SNA.js +1 -1
- package/lib/components/{Select-ac580a1f.js → Select-e0790135.js} +17 -3
- package/lib/components/Select.js +6 -1
- package/lib/components/useTheme-d16d02d9.js +11 -0
- package/package.json +1 -1
|
@@ -3,11 +3,16 @@ 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';
|
|
10
|
-
import
|
|
10
|
+
import './defaultTheme-ed7746fe.js';
|
|
11
|
+
import 'react-is';
|
|
12
|
+
import '@material-ui/styles';
|
|
13
|
+
import { u as useTheme } from './useTheme-d16d02d9.js';
|
|
14
|
+
import './withTheme-2d778133.js';
|
|
15
|
+
import { S as Select } from './Select-e0790135.js';
|
|
11
16
|
import { getIntl } from './globalConfig';
|
|
12
17
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
13
18
|
import { r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
|
|
@@ -11540,6 +11545,8 @@ function reducer(state, action) {
|
|
|
11540
11545
|
|
|
11541
11546
|
const Upload = _ref => {
|
|
11542
11547
|
let {
|
|
11548
|
+
ariaLabelledby,
|
|
11549
|
+
buttonText,
|
|
11543
11550
|
onChange
|
|
11544
11551
|
} = _ref;
|
|
11545
11552
|
const fileRef = useRef(null);
|
|
@@ -11565,17 +11572,31 @@ const Upload = _ref => {
|
|
|
11565
11572
|
className: "container"
|
|
11566
11573
|
}, /*#__PURE__*/React__default.createElement("div", getRootProps({
|
|
11567
11574
|
className: 'dropzone'
|
|
11568
|
-
}), /*#__PURE__*/React__default.createElement("input", getInputProps(
|
|
11575
|
+
}), /*#__PURE__*/React__default.createElement("input", getInputProps({
|
|
11576
|
+
'aria-labelledby': ariaLabelledby
|
|
11577
|
+
})), /*#__PURE__*/React__default.createElement(Button, {
|
|
11569
11578
|
variant: "contained",
|
|
11570
11579
|
color: "default",
|
|
11571
|
-
startIcon: /*#__PURE__*/React__default.createElement(default_1,
|
|
11580
|
+
startIcon: /*#__PURE__*/React__default.createElement(default_1, {
|
|
11581
|
+
"aria-hidden": "true"
|
|
11582
|
+
}),
|
|
11572
11583
|
onClick: openDialog
|
|
11573
|
-
},
|
|
11584
|
+
}, buttonText || 'Upload')), /*#__PURE__*/React__default.createElement("aside", null, /*#__PURE__*/React__default.createElement("ul", {
|
|
11585
|
+
"aria-live": "polite"
|
|
11586
|
+
}, acceptedFiles.map(file => /*#__PURE__*/React__default.createElement("li", {
|
|
11574
11587
|
key: file.path
|
|
11575
11588
|
}, file.path)))));
|
|
11576
11589
|
});
|
|
11577
11590
|
};
|
|
11591
|
+
Upload.defaultProps = {
|
|
11592
|
+
ariaLabelledby: undefined,
|
|
11593
|
+
buttonText: undefined
|
|
11594
|
+
};
|
|
11578
11595
|
Upload.propTypes = {
|
|
11596
|
+
/** 欄位標題元素 id(aria-labelledby 關聯用) */
|
|
11597
|
+
ariaLabelledby: PropTypes.string,
|
|
11598
|
+
/** 觸發按鈕的可見文字(建議傳欄位標題,如「附件上傳」) */
|
|
11599
|
+
buttonText: PropTypes.string,
|
|
11579
11600
|
onChange: PropTypes.func.isRequired
|
|
11580
11601
|
};
|
|
11581
11602
|
|
|
@@ -11608,6 +11629,12 @@ const FormItem = _ref => {
|
|
|
11608
11629
|
};
|
|
11609
11630
|
/* 這些欄位型別會渲染帶 inputId 的 input,標題才能用 label htmlFor;其餘型別改以 aria-labelledby 關聯 */
|
|
11610
11631
|
const hasInputId = ['input', 'textarea', 'datePicker', 'email', 'vcode'].includes(type);
|
|
11632
|
+
/* WCAG 1.4.3 必填星號依主題深淺自動選色:formItem.scss 的 #b91c1c 只適用淺底 Modal,
|
|
11633
|
+
深色主題(如 ocean Paper #30353d)對比僅約 1.5:1(WAVE 實測被抓)→ 深色用 #ff8a80(約 5.4:1) */
|
|
11634
|
+
const theme = useTheme();
|
|
11635
|
+
const starStyle = theme && theme.palette && theme.palette.type === 'dark' ? {
|
|
11636
|
+
color: '#ff8a80'
|
|
11637
|
+
} : undefined;
|
|
11611
11638
|
const render = field => {
|
|
11612
11639
|
let component;
|
|
11613
11640
|
switch (type) {
|
|
@@ -11664,7 +11691,10 @@ const FormItem = _ref => {
|
|
|
11664
11691
|
}, option.desc)))));
|
|
11665
11692
|
break;
|
|
11666
11693
|
case 'upload':
|
|
11694
|
+
/* WCAG 1.3.1/3.3.2 附件上傳:標題 id 關聯內部 file input;按鈕以欄位標題為可見文字(WAVE: Missing form label) */
|
|
11667
11695
|
component = /*#__PURE__*/React__default.createElement(Upload, _extends$1({}, field, {
|
|
11696
|
+
ariaLabelledby: labelId,
|
|
11697
|
+
buttonText: label,
|
|
11668
11698
|
onChange: files => setFieldValue(field.name, files)
|
|
11669
11699
|
}));
|
|
11670
11700
|
break;
|
|
@@ -11702,14 +11732,16 @@ const FormItem = _ref => {
|
|
|
11702
11732
|
htmlFor: inputId
|
|
11703
11733
|
}, label, required && /*#__PURE__*/React__default.createElement("div", {
|
|
11704
11734
|
className: "formItem__title__star",
|
|
11735
|
+
style: starStyle,
|
|
11705
11736
|
"aria-hidden": "true"
|
|
11706
|
-
},
|
|
11737
|
+
}, "*")) : /*#__PURE__*/React__default.createElement("div", {
|
|
11707
11738
|
className: "formItem__title",
|
|
11708
11739
|
id: labelId
|
|
11709
11740
|
}, label, required && /*#__PURE__*/React__default.createElement("div", {
|
|
11710
11741
|
className: "formItem__title__star",
|
|
11742
|
+
style: starStyle,
|
|
11711
11743
|
"aria-hidden": "true"
|
|
11712
|
-
},
|
|
11744
|
+
}, "*"))), hint && /*#__PURE__*/React__default.createElement(Box, {
|
|
11713
11745
|
my: 1
|
|
11714
11746
|
}, /*#__PURE__*/React__default.createElement(Typography, {
|
|
11715
11747
|
variant: "body2"
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { C as default } from './ContactModal-
|
|
1
|
+
export { C as default } from './ContactModal-c006ed2c.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';
|
|
@@ -14,9 +14,11 @@ import './style-inject.es-1f59c1d0.js';
|
|
|
14
14
|
import './Spin-8dc60bfe.js';
|
|
15
15
|
import './globalConfig';
|
|
16
16
|
import './_commonjsHelpers-70de2c37.js';
|
|
17
|
-
import './Select-ac580a1f.js';
|
|
18
|
-
import './Empty-bf77164f.js';
|
|
19
|
-
import './createSvgIcon-e3803ee1.js';
|
|
20
17
|
import './defaultTheme-ed7746fe.js';
|
|
21
18
|
import '@material-ui/styles';
|
|
19
|
+
import './useTheme-d16d02d9.js';
|
|
20
|
+
import './withTheme-2d778133.js';
|
|
21
|
+
import './Select-e0790135.js';
|
|
22
|
+
import './Empty-bf77164f.js';
|
|
23
|
+
import './createSvgIcon-e3803ee1.js';
|
|
22
24
|
import 'react-dom';
|
|
@@ -3,7 +3,7 @@ import React__default, { useState } from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { List, ListItem, ListItemIcon, ListItemText, IconButton, Drawer as Drawer$1, Divider } from '@material-ui/core';
|
|
5
5
|
import { DehazeRounded } from '@material-ui/icons';
|
|
6
|
-
import { S as Select } from './Select-
|
|
6
|
+
import { S as Select } from './Select-e0790135.js';
|
|
7
7
|
import { useHistory, useRouteMatch } from 'react-router-dom';
|
|
8
8
|
import { getIntl } from './globalConfig';
|
|
9
9
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
package/lib/components/Drawer.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
export { D as default } from './Drawer-
|
|
1
|
+
export { D as default } from './Drawer-2cbcec04.js';
|
|
2
2
|
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'prop-types';
|
|
5
5
|
import '@material-ui/core';
|
|
6
6
|
import '@material-ui/icons';
|
|
7
|
-
import './Select-
|
|
7
|
+
import './Select-e0790135.js';
|
|
8
8
|
import './index-b76a85f4.js';
|
|
9
|
+
import './defaultTheme-ed7746fe.js';
|
|
10
|
+
import 'react-is';
|
|
11
|
+
import '@material-ui/styles';
|
|
12
|
+
import './useTheme-d16d02d9.js';
|
|
13
|
+
import './withTheme-2d778133.js';
|
|
9
14
|
import './Empty-bf77164f.js';
|
|
10
15
|
import './style-inject.es-1f59c1d0.js';
|
|
11
16
|
import 'react-router-dom';
|
|
@@ -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 padding-bottom: 6px;\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 .font-size-changer .font-size-changer-buttons > div {\n float: none;\n height: 32px;\n line-height: 32px !important;\n align-self: center;\n margin-top: 0;\n margin-bottom: 0;\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 */
|
package/lib/components/Footer.js
CHANGED
|
@@ -3,22 +3,24 @@ 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-c006ed2c.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';
|
|
15
15
|
import './globalConfig';
|
|
16
16
|
import './_commonjsHelpers-70de2c37.js';
|
|
17
|
-
import './Select-ac580a1f.js';
|
|
18
|
-
import './Empty-bf77164f.js';
|
|
19
|
-
import './createSvgIcon-e3803ee1.js';
|
|
20
17
|
import './defaultTheme-ed7746fe.js';
|
|
21
18
|
import '@material-ui/styles';
|
|
19
|
+
import './useTheme-d16d02d9.js';
|
|
20
|
+
import './withTheme-2d778133.js';
|
|
21
|
+
import './Select-e0790135.js';
|
|
22
|
+
import './Empty-bf77164f.js';
|
|
23
|
+
import './createSvgIcon-e3803ee1.js';
|
|
22
24
|
import 'react-dom';
|
|
23
25
|
|
|
24
26
|
/* eslint-disable max-len */
|
package/lib/components/Header.js
CHANGED
|
@@ -7,8 +7,8 @@ import { useHistory, useRouteMatch, NavLink } from 'react-router-dom';
|
|
|
7
7
|
import { Typography, IconButton } from '@material-ui/core';
|
|
8
8
|
import { SearchOutlined } from '@material-ui/icons';
|
|
9
9
|
import { K as KeywordSearch } from './KeywordSearch-33341dd3.js';
|
|
10
|
-
import { S as Select } from './Select-
|
|
11
|
-
import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-
|
|
10
|
+
import { S as Select } from './Select-e0790135.js';
|
|
11
|
+
import { c as checkLanguageSupport, D as Drawer, d as defaultSupportLanguage } from './Drawer-2cbcec04.js';
|
|
12
12
|
import { getIntl } from './globalConfig';
|
|
13
13
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
14
14
|
import './isObjectLike-e111475d.js';
|
|
@@ -23,6 +23,8 @@ import '@material-ui/styles';
|
|
|
23
23
|
import 'react-dom';
|
|
24
24
|
import './toConsumableArray-dbe8af76.js';
|
|
25
25
|
import './Empty-bf77164f.js';
|
|
26
|
+
import './useTheme-d16d02d9.js';
|
|
27
|
+
import './withTheme-2d778133.js';
|
|
26
28
|
|
|
27
29
|
var css_248z = "@charset \"UTF-8\";\n.header {\n display: flex;\n align-items: center;\n background: rgba(255, 255, 255, 0.6);\n background-color: rgba(255, 255, 255, 0.6);\n padding: 12px 36px !important;\n position: fixed;\n top: 0;\n z-index: 10;\n width: 100% !important;\n transition: top 0.3s ease-in-out;\n box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);\n}\n.header__logo {\n display: flex;\n width: -moz-fit-content !important;\n width: fit-content !important;\n margin-right: 30px !important;\n cursor: pointer;\n}\n.header__logo__img {\n display: flex;\n align-items: center;\n}\n.header__logo__title {\n white-space: nowrap;\n margin-left: 1rem !important;\n font-size: 1.5rem !important;\n font-weight: 700 !important;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links {\n display: flex;\n justify-content: flex-end;\n padding-right: 14px;\n}\n.header__links a {\n text-decoration: none;\n}\n.header__links--full {\n flex: 1;\n}\n.header__links__item {\n color: rgba(0, 0, 0, 0.85);\n font-size: 1.125rem !important;\n font-weight: 500 !important;\n white-space: nowrap;\n padding: 6px 14px;\n font-family: \"Noto Sans TC\" !important;\n}\n.header__links__item--active .header__links__item {\n font-weight: 800 !important;\n background: transparent;\n border-radius: 45px;\n}\n.header__links__item:hover {\n font-weight: 800 !important;\n}\n.header__language {\n min-width: 100px !important;\n}\n.header__searchIcon {\n display: none !important;\n}\n@media screen and (max-width: 768px) {\n .header--smallUseSearchIcon .header__searchIcon {\n display: flex !important;\n margin-right: 10px !important;\n }\n .header--smallUseSearchIcon .keywordSearch {\n visibility: hidden;\n flex: 1;\n width: 0;\n }\n}\n.header--hide {\n top: -100px;\n}\n.header--focus .header__links {\n display: none;\n}\n.header .MuiTypography-root {\n width: 100%;\n display: flex;\n align-items: center;\n}\n.header .autocomplete {\n float: right;\n}\n.header .autocomplete .MuiAutocomplete-inputRoot[class*=MuiOutlinedInput-root] {\n padding: 1px 8px !important;\n}\n.header .keywordSearch {\n margin-right: 8px;\n}\n.header .keywordSearch--focus .autocomplete {\n width: 100% !important;\n}\n.header .keywordSearch--animation .autocomplete {\n width: 240px;\n transition: width 0.3s ease-in-out;\n}\n\n/* 避免寬度460以下炸版 */\n@media screen and (max-width: 460px) {\n .header .keywordSearch--animation .autocomplete {\n width: 100%;\n }\n}\n@media screen and (max-width: 768px) {\n .header {\n padding: 12px 15px !important;\n }\n .header__logo {\n margin-right: 16px !important;\n }\n .header__logo__title {\n display: none !important;\n }\n .header__links {\n display: none;\n }\n .header__links__item {\n font-size: 1rem !important;\n }\n .header__language {\n display: none !important;\n }\n .header--focus .header__logo {\n display: none !important;\n }\n\n .autocomplete__icon {\n display: none !important;\n }\n}";
|
|
28
30
|
styleInject(css_248z);
|
|
@@ -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
|
@@ -2,12 +2,13 @@ import { c as _objectWithoutProperties$1 } from './_rollupPluginBabelHelpers-a52
|
|
|
2
2
|
import * as React$2 from 'react';
|
|
3
3
|
import React__default, { Children, isValidElement, cloneElement } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
|
-
import {
|
|
5
|
+
import { k as _objectWithoutProperties, o as _slicedToArray, _ as _extends, q as _objectWithoutPropertiesLoose, r as alpha, j as formatMuiErrorMessage } from './defaultTheme-ed7746fe.js';
|
|
6
6
|
import { u as useControlled, c as clsx, b as useEventCallback, w as withStyles, d as useIsFocusVisible, e as useForkRef, f as createSvgIcon, g as capitalize, h as debounce, r as requireCreateSvgIcon, i as interopRequireDefault, a as interopRequireWildcard } from './createSvgIcon-e3803ee1.js';
|
|
7
7
|
import 'react-is';
|
|
8
|
-
import
|
|
8
|
+
import '@material-ui/styles';
|
|
9
9
|
import './withTheme-2d778133.js';
|
|
10
10
|
import { _ as _toConsumableArray } from './toConsumableArray-dbe8af76.js';
|
|
11
|
+
import { u as useTheme } from './useTheme-d16d02d9.js';
|
|
11
12
|
import * as ReactDOM from 'react-dom';
|
|
12
13
|
import ReactDOM__default from 'react-dom';
|
|
13
14
|
import { c as classNames } from './index-b76a85f4.js';
|
|
@@ -15,12 +16,6 @@ import { IconButton } from '@material-ui/core';
|
|
|
15
16
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
16
17
|
import './_commonjsHelpers-70de2c37.js';
|
|
17
18
|
|
|
18
|
-
function useTheme() {
|
|
19
|
-
var theme = useTheme$1() || defaultTheme;
|
|
20
|
-
|
|
21
|
-
return theme;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
function usePagination() {
|
|
25
20
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26
21
|
|
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-55f66039.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';
|
|
@@ -3,6 +3,11 @@ import React__default from 'react';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { c as classNames } from './index-b76a85f4.js';
|
|
5
5
|
import { FormControl, Select as Select$1, CircularProgress, MenuItem } from '@material-ui/core';
|
|
6
|
+
import './defaultTheme-ed7746fe.js';
|
|
7
|
+
import 'react-is';
|
|
8
|
+
import '@material-ui/styles';
|
|
9
|
+
import { u as useTheme } from './useTheme-d16d02d9.js';
|
|
10
|
+
import './withTheme-2d778133.js';
|
|
6
11
|
import { E as Empty } from './Empty-bf77164f.js';
|
|
7
12
|
import { s as styleInject } from './style-inject.es-1f59c1d0.js';
|
|
8
13
|
|
|
@@ -25,6 +30,12 @@ var Select = function Select(props) {
|
|
|
25
30
|
_onChange = props.onChange,
|
|
26
31
|
ariaLabel = props.ariaLabel,
|
|
27
32
|
ariaLabelledby = props.ariaLabelledby;
|
|
33
|
+
/* WCAG 1.4.3 提示字顏色依主題深淺自動選色:select.scss 的 #6b6130 只適用淺底,
|
|
34
|
+
深色主題(palette.type=dark,如 ocean 深色 Modal)需改亮灰(WAVE 實測「請輸入 年齡」被抓) */
|
|
35
|
+
var theme = useTheme();
|
|
36
|
+
var placeholderStyle = theme && theme.palette && theme.palette.type === 'dark' ? {
|
|
37
|
+
color: '#bdbdbd'
|
|
38
|
+
} : undefined;
|
|
28
39
|
var itemFind = function itemFind(key) {
|
|
29
40
|
return (options || []).find(function (option) {
|
|
30
41
|
return _typeof(option) === 'object' ? key === option.value : key === option;
|
|
@@ -52,9 +63,12 @@ var Select = function Select(props) {
|
|
|
52
63
|
renderValue: function renderValue(id) {
|
|
53
64
|
var finder = itemFind(id);
|
|
54
65
|
var content = _typeof(finder) === 'object' ? finder.label : finder;
|
|
55
|
-
if (!id && id !== 0 || id.length === 0)
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
if (!id && id !== 0 || id.length === 0) {
|
|
67
|
+
content = /*#__PURE__*/React__default.createElement("span", {
|
|
68
|
+
className: "select__placeholder",
|
|
69
|
+
style: placeholderStyle
|
|
70
|
+
}, placeholder);
|
|
71
|
+
}
|
|
58
72
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, content, loading && /*#__PURE__*/React__default.createElement(CircularProgress, {
|
|
59
73
|
size: 16,
|
|
60
74
|
style: {
|
package/lib/components/Select.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
export { S as default } from './Select-
|
|
1
|
+
export { S as default } from './Select-e0790135.js';
|
|
2
2
|
import './_rollupPluginBabelHelpers-a52356f6.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'prop-types';
|
|
5
5
|
import './index-b76a85f4.js';
|
|
6
6
|
import '@material-ui/core';
|
|
7
|
+
import './defaultTheme-ed7746fe.js';
|
|
8
|
+
import 'react-is';
|
|
9
|
+
import '@material-ui/styles';
|
|
10
|
+
import './useTheme-d16d02d9.js';
|
|
11
|
+
import './withTheme-2d778133.js';
|
|
7
12
|
import './Empty-bf77164f.js';
|
|
8
13
|
import './style-inject.es-1f59c1d0.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useTheme as useTheme$1 } from '@material-ui/styles';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { d as defaultTheme } from './defaultTheme-ed7746fe.js';
|
|
4
|
+
|
|
5
|
+
function useTheme() {
|
|
6
|
+
var theme = useTheme$1() || defaultTheme;
|
|
7
|
+
|
|
8
|
+
return theme;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { useTheme as u };
|
package/package.json
CHANGED