@mirai/ui 1.0.218 → 1.1.0-beta
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/build/components/Action/Action.js +5 -3
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.module.css +49 -50
- package/build/components/Action/Action.stories.js +8 -5
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/__tests__/__snapshots__/Action.test.js.snap +55 -41
- package/build/components/Button/Button.js +7 -5
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/Button.module.css +10 -16
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +45 -34
- package/build/components/Calendar/Calendar.Month.js +6 -4
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +6 -6
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +6 -3
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.js +3 -3
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/Calendar.module.css +6 -7
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +17618 -17586
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +10 -10
- package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +49 -49
- package/build/components/InputNumber/InputNumber.js +9 -7
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +153 -138
- package/build/components/InputOption/InputOption.js +7 -4
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +84 -71
- package/build/components/InputPhone/InputPhone.js +11 -11
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +371 -371
- package/build/components/InputSelect/InputSelect.js +7 -7
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +112 -112
- package/build/components/InputText/InputText.js +10 -10
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.module.css +3 -7
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +147 -146
- package/build/components/InputText/partials/InputText.Hint.js +5 -2
- package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
- package/build/components/InputText/partials/InputText.IconState.js +5 -2
- package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +6 -3
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +8 -5
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +6 -3
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/Menu.module.css +3 -3
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +80 -67
- package/build/components/Modal/Modal.js +9 -9
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +91 -72
- package/build/components/Notification/Notification.js +8 -5
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.module.css +7 -10
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +149 -148
- package/build/components/Progress/Progress.js +6 -3
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/__tests__/__snapshots__/Progress.test.jsx.snap +18 -18
- package/build/components/Slider/Slider.js +11 -11
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/__tests__/__snapshots__/Slider.test.js.snap +248 -230
- package/build/components/Table/Table.ColumnFilter.js +9 -9
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.Filter.js +7 -4
- package/build/components/Table/Table.Filter.js.map +1 -1
- package/build/components/Table/Table.Row.js +7 -8
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.js +3 -3
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.module.css +2 -6
- package/build/components/Table/Table.stories.js +4 -5
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/__tests__/__snapshots__/Table.ColumnFilter.test.js.snap +258 -228
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +1010 -1090
- package/build/components/Tooltip/Tooltip.js +4 -4
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/Tooltip.module.css +5 -5
- package/build/components/Tooltip/__tests__/__snapshots__/Tooltip.test.jsx.snap +46 -36
- package/build/primitives/Checkbox/Checkbox.js +7 -3
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.module.css +1 -2
- package/build/primitives/Checkbox/__tests__/__snapshots__/Checkbox.test.js.snap +16 -16
- package/build/primitives/Icon/Icon.js +5 -3
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +60 -60
- package/build/primitives/Input/Input.js +2 -2
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Layer/Layer.js +4 -3
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/Layer.module.css +4 -1
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +48 -42
- package/build/primitives/Pressable/Pressable.constants.js +1 -1
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js +11 -5
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/__tests__/__snapshots__/Pressable.test.js.snap +14 -10
- package/build/primitives/Primitive/Primitive.js +2 -2
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/Primitive.module.css +241 -0
- package/build/primitives/Primitive/__tests__/__snapshots__/Primitive.test.js.snap +7 -7
- package/build/primitives/Primitive/helpers/getTag.js +32 -0
- package/build/primitives/Primitive/helpers/getTag.js.map +1 -0
- package/build/primitives/Primitive/helpers/index.js +11 -0
- package/build/primitives/Primitive/helpers/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +8 -5
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/Radio.module.css +2 -2
- package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +21 -21
- package/build/primitives/ScrollView/ScrollView.js +3 -3
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.stories.js +6 -5
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/__tests__/__snapshots__/ScrollView.test.js.snap +20 -20
- package/build/primitives/Select/Select.js +2 -2
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Select/Select.module.css +1 -5
- package/build/primitives/Switch/Switch.js +8 -5
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/Switch.module.css +1 -5
- package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +25 -25
- package/build/primitives/Text/Text.js +7 -4
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +4 -8
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +38 -38
- package/build/primitives/View/View.js +5 -3
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/__tests__/__snapshots__/View.test.js.snap +10 -10
- package/package.json +5 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -8,7 +9,9 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _helpers = require("../../../helpers");
|
|
10
11
|
var _primitives = require("../../../primitives");
|
|
11
|
-
var
|
|
12
|
+
var style = _interopRequireWildcard(require("../InputText.module.css"));
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
16
|
var IconState = function IconState(_ref) {
|
|
14
17
|
var error = _ref.error,
|
|
@@ -20,7 +23,7 @@ var IconState = function IconState(_ref) {
|
|
|
20
23
|
success: success,
|
|
21
24
|
warning: warning
|
|
22
25
|
}),
|
|
23
|
-
className: (0, _helpers.styles)(
|
|
26
|
+
className: (0, _helpers.styles)(style.icon, error ? style.error : warning ? style.warning : success ? style.success : undefined)
|
|
24
27
|
});
|
|
25
28
|
};
|
|
26
29
|
exports.IconState = IconState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.IconState.js","names":["IconState","error","success","warning","getIconState","styles","style","icon","undefined","displayName","propTypes","PropTypes","bool"],"sources":["../../../../src/components/InputText/partials/InputText.IconState.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getIconState, styles } from '../../../helpers';\nimport { Icon } from '../../../primitives';\nimport style from '../InputText.module.css';\n\nconst IconState = ({ error, success, warning }) => (\n <Icon\n value={getIconState({ error, success, warning })}\n className={styles(style.icon, error ? style.error : warning ? style.warning : success ? style.success : undefined)}\n />\n);\n\nIconState.displayName = 'Component:InputText.IconState';\n\nIconState.propTypes = {\n error: PropTypes.bool,\n success: PropTypes.bool,\n warning: PropTypes.bool,\n};\n\nexport { IconState };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputText.IconState.js","names":["IconState","error","success","warning","getIconState","styles","style","icon","undefined","displayName","propTypes","PropTypes","bool"],"sources":["../../../../src/components/InputText/partials/InputText.IconState.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getIconState, styles } from '../../../helpers';\nimport { Icon } from '../../../primitives';\nimport * as style from '../InputText.module.css';\n\nconst IconState = ({ error, success, warning }) => (\n <Icon\n value={getIconState({ error, success, warning })}\n className={styles(style.icon, error ? style.error : warning ? style.warning : success ? style.success : undefined)}\n />\n);\n\nIconState.displayName = 'Component:InputText.IconState';\n\nIconState.propTypes = {\n error: PropTypes.bool,\n success: PropTypes.bool,\n warning: PropTypes.bool,\n};\n\nexport { IconState };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAAiD;AAAA;AAAA;AAEjD,IAAMA,SAAS,GAAG,SAAZA,SAAS;EAAA,IAAMC,KAAK,QAALA,KAAK;IAAEC,OAAO,QAAPA,OAAO;IAAEC,OAAO,QAAPA,OAAO;EAAA,oBAC1C,6BAAC,gBAAI;IACH,KAAK,EAAE,IAAAC,qBAAY,EAAC;MAAEH,KAAK,EAALA,KAAK;MAAEC,OAAO,EAAPA,OAAO;MAAEC,OAAO,EAAPA;IAAQ,CAAC,CAAE;IACjD,SAAS,EAAE,IAAAE,eAAM,EAACC,KAAK,CAACC,IAAI,EAAEN,KAAK,GAAGK,KAAK,CAACL,KAAK,GAAGE,OAAO,GAAGG,KAAK,CAACH,OAAO,GAAGD,OAAO,GAAGI,KAAK,CAACJ,OAAO,GAAGM,SAAS;EAAE,EACnH;AAAA,CACH;AAAC;AAEFR,SAAS,CAACS,WAAW,GAAG,+BAA+B;AAEvDT,SAAS,CAACU,SAAS,GAAG;EACpBT,KAAK,EAAEU,kBAAS,CAACC,IAAI;EACrBV,OAAO,EAAES,kBAAS,CAACC,IAAI;EACvBT,OAAO,EAAEQ,kBAAS,CAACC;AACrB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -8,8 +9,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _helpers = require("../../../helpers");
|
|
10
11
|
var _primitives = require("../../../primitives");
|
|
11
|
-
var
|
|
12
|
+
var style = _interopRequireWildcard(require("../InputText.module.css"));
|
|
12
13
|
var _excluded = ["disabled", "error", "focus", "label", "required", "value"];
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -24,9 +27,9 @@ var Label = function Label(_ref) {
|
|
|
24
27
|
value = _ref.value,
|
|
25
28
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
26
29
|
return /*#__PURE__*/_react.default.createElement(_primitives.Text, _extends({}, others, {
|
|
27
|
-
className: (0, _helpers.styles)(
|
|
30
|
+
className: (0, _helpers.styles)(style.text, others.className || style.label, disabled && style.disabled, focus && style.focus, error && style.error, (focus || error || value !== undefined && ((value === null || value === void 0 ? void 0 : value.length) > 0 || typeof value === 'number')) && style.withValue)
|
|
28
31
|
}), label, required && !disabled && /*#__PURE__*/_react.default.createElement("span", {
|
|
29
|
-
className:
|
|
32
|
+
className: style.required
|
|
30
33
|
}, " *"));
|
|
31
34
|
};
|
|
32
35
|
exports.Label = Label;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.Label.js","names":["Label","disabled","error","focus","label","required","value","others","styles","style","text","className","undefined","length","withValue","displayName","propTypes","PropTypes","bool","string"],"sources":["../../../../src/components/InputText/partials/InputText.Label.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../../helpers';\nimport { Text } from '../../../primitives';\nimport style from '../InputText.module.css';\n\nconst Label = ({ disabled, error, focus, label, required = false, value, ...others }) => (\n <Text\n {...others}\n className={styles(\n style.text,\n others.className || style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n (focus || error || (value !== undefined && (value?.length > 0 || typeof value === 'number'))) && style.withValue,\n )}\n >\n {label}\n {required && !disabled && <span className={style.required}> *</span>}\n </Text>\n);\n\nLabel.displayName = 'Component:InputText.Label';\n\nLabel.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n focus: PropTypes.bool,\n label: PropTypes.string,\n required: PropTypes.bool,\n value: PropTypes.string,\n};\n\nexport { Label };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputText.Label.js","names":["Label","disabled","error","focus","label","required","value","others","styles","style","text","className","undefined","length","withValue","displayName","propTypes","PropTypes","bool","string"],"sources":["../../../../src/components/InputText/partials/InputText.Label.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../../helpers';\nimport { Text } from '../../../primitives';\nimport * as style from '../InputText.module.css';\n\nconst Label = ({ disabled, error, focus, label, required = false, value, ...others }) => (\n <Text\n {...others}\n className={styles(\n style.text,\n others.className || style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n (focus || error || (value !== undefined && (value?.length > 0 || typeof value === 'number'))) && style.withValue,\n )}\n >\n {label}\n {required && !disabled && <span className={style.required}> *</span>}\n </Text>\n);\n\nLabel.displayName = 'Component:InputText.Label';\n\nLabel.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n focus: PropTypes.bool,\n label: PropTypes.string,\n required: PropTypes.bool,\n value: PropTypes.string,\n};\n\nexport { Label };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAAiD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEjD,IAAMA,KAAK,GAAG,SAARA,KAAK;EAAA,IAAMC,QAAQ,QAARA,QAAQ;IAAEC,KAAK,QAALA,KAAK;IAAEC,KAAK,QAALA,KAAK;IAAEC,KAAK,QAALA,KAAK;IAAA,qBAAEC,QAAQ;IAARA,QAAQ,8BAAG,KAAK;IAAEC,KAAK,QAALA,KAAK;IAAKC,MAAM;EAAA,oBAChF,6BAAC,gBAAI,eACCA,MAAM;IACV,SAAS,EAAE,IAAAC,eAAM,EACfC,KAAK,CAACC,IAAI,EACVH,MAAM,CAACI,SAAS,IAAIF,KAAK,CAACL,KAAK,EAC/BH,QAAQ,IAAIQ,KAAK,CAACR,QAAQ,EAC1BE,KAAK,IAAIM,KAAK,CAACN,KAAK,EACpBD,KAAK,IAAIO,KAAK,CAACP,KAAK,EACpB,CAACC,KAAK,IAAID,KAAK,IAAKI,KAAK,KAAKM,SAAS,KAAK,CAAAN,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,MAAM,IAAG,CAAC,IAAI,OAAOP,KAAK,KAAK,QAAQ,CAAE,KAAKG,KAAK,CAACK,SAAS;EAChH,IAEDV,KAAK,EACLC,QAAQ,IAAI,CAACJ,QAAQ,iBAAI;IAAM,SAAS,EAAEQ,KAAK,CAACJ;EAAS,QAAU,CAC/D;AAAA,CACR;AAAC;AAEFL,KAAK,CAACe,WAAW,GAAG,2BAA2B;AAE/Cf,KAAK,CAACgB,SAAS,GAAG;EAChBf,QAAQ,EAAEgB,kBAAS,CAACC,IAAI;EACxBhB,KAAK,EAAEe,kBAAS,CAACC,IAAI;EACrBf,KAAK,EAAEc,kBAAS,CAACC,IAAI;EACrBd,KAAK,EAAEa,kBAAS,CAACE,MAAM;EACvBd,QAAQ,EAAEY,kBAAS,CAACC,IAAI;EACxBZ,KAAK,EAAEW,kBAAS,CAACE;AACnB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -8,8 +9,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _helpers = require("../../helpers");
|
|
10
11
|
var _primitives = require("../../primitives");
|
|
11
|
-
var
|
|
12
|
+
var style = _interopRequireWildcard(require("./Menu.module.css"));
|
|
12
13
|
var _excluded = ["children", "disabled", "divider", "icon", "label", "value", "onPress"];
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
17
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
18
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -24,17 +27,17 @@ var Option = function Option(_ref) {
|
|
|
24
27
|
onPress = _ref.onPress,
|
|
25
28
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
26
29
|
return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, _extends({}, others, {
|
|
27
|
-
className: (0, _helpers.styles)(
|
|
30
|
+
className: (0, _helpers.styles)(style.option, value && style.value, divider && style.divider, disabled && style.disabled),
|
|
28
31
|
onPress: !disabled && value ? onPress : undefined
|
|
29
32
|
}), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
30
33
|
row: true,
|
|
31
34
|
wide: true,
|
|
32
|
-
className:
|
|
35
|
+
className: style.content
|
|
33
36
|
}, icon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
34
37
|
value: icon,
|
|
35
|
-
className:
|
|
38
|
+
className: style.icon
|
|
36
39
|
}), label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
37
|
-
className:
|
|
40
|
+
className: style.label
|
|
38
41
|
}, label), children));
|
|
39
42
|
};
|
|
40
43
|
exports.Option = Option;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.Option.js","names":["Option","children","disabled","divider","icon","label","value","onPress","others","styles","style","option","
|
|
1
|
+
{"version":3,"file":"Menu.Option.js","names":["Option","children","disabled","divider","icon","label","value","onPress","others","styles","style","option","undefined","content","displayName","propTypes","PropTypes","node","bool","func","string","oneOfType","number"],"sources":["../../../src/components/Menu/Menu.Option.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport * as style from './Menu.module.css';\n\nconst Option = ({ children, disabled, divider, icon, label, value, onPress, ...others }) => (\n <Pressable\n {...others}\n className={styles(style.option, value && style.value, divider && style.divider, disabled && style.disabled)}\n onPress={!disabled && value ? onPress : undefined}\n >\n <View row wide className={style.content}>\n {icon && <Icon value={icon} className={style.icon} />}\n {label && <Text className={style.label}>{label}</Text>}\n {children}\n </View>\n </Pressable>\n);\n\nOption.displayName = 'Component:Menu:Option';\n\nOption.propTypes = {\n children: PropTypes.node,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n icon: PropTypes.func,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onPress: PropTypes.func,\n};\n\nexport { Option };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAA2C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE3C,IAAMA,MAAM,GAAG,SAATA,MAAM;EAAA,IAAMC,QAAQ,QAARA,QAAQ;IAAEC,QAAQ,QAARA,QAAQ;IAAEC,OAAO,QAAPA,OAAO;IAAEC,IAAI,QAAJA,IAAI;IAAEC,KAAK,QAALA,KAAK;IAAEC,KAAK,QAALA,KAAK;IAAEC,OAAO,QAAPA,OAAO;IAAKC,MAAM;EAAA,oBACnF,6BAAC,qBAAS,eACJA,MAAM;IACV,SAAS,EAAE,IAAAC,eAAM,EAACC,KAAK,CAACC,MAAM,EAAEL,KAAK,IAAII,KAAK,CAACJ,KAAK,EAAEH,OAAO,IAAIO,KAAK,CAACP,OAAO,EAAED,QAAQ,IAAIQ,KAAK,CAACR,QAAQ,CAAE;IAC5G,OAAO,EAAE,CAACA,QAAQ,IAAII,KAAK,GAAGC,OAAO,GAAGK;EAAU,iBAElD,6BAAC,gBAAI;IAAC,GAAG;IAAC,IAAI;IAAC,SAAS,EAAEF,KAAK,CAACG;EAAQ,GACrCT,IAAI,iBAAI,6BAAC,gBAAI;IAAC,KAAK,EAAEA,IAAK;IAAC,SAAS,EAAEM,KAAK,CAACN;EAAK,EAAG,EACpDC,KAAK,iBAAI,6BAAC,gBAAI;IAAC,SAAS,EAAEK,KAAK,CAACL;EAAM,GAAEA,KAAK,CAAQ,EACrDJ,QAAQ,CACJ,CACG;AAAA,CACb;AAAC;AAEFD,MAAM,CAACc,WAAW,GAAG,uBAAuB;AAE5Cd,MAAM,CAACe,SAAS,GAAG;EACjBd,QAAQ,EAAEe,kBAAS,CAACC,IAAI;EACxBf,QAAQ,EAAEc,kBAAS,CAACE,IAAI;EACxBf,OAAO,EAAEa,kBAAS,CAACE,IAAI;EACvBd,IAAI,EAAEY,kBAAS,CAACG,IAAI;EACpBd,KAAK,EAAEW,kBAAS,CAACI,MAAM;EACvBd,KAAK,EAAEU,kBAAS,CAACK,SAAS,CAAC,CAACL,kBAAS,CAACI,MAAM,EAAEJ,kBAAS,CAACM,MAAM,CAAC,CAAC;EAChEf,OAAO,EAAES,kBAAS,CAACG;AACrB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -10,9 +11,11 @@ var _helpers = require("../../helpers");
|
|
|
10
11
|
var _hooks = require("../../hooks");
|
|
11
12
|
var _primitives = require("../../primitives");
|
|
12
13
|
var _Modal = require("../Modal");
|
|
13
|
-
var
|
|
14
|
+
var style = _interopRequireWildcard(require("./Menu.module.css"));
|
|
14
15
|
var _Menu = require("./Menu.Option");
|
|
15
16
|
var _excluded = ["children", "options", "Template", "title", "visible", "onPress"];
|
|
17
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
18
21
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -51,7 +54,7 @@ var Menu = function Menu(_ref) {
|
|
|
51
54
|
}, others, {
|
|
52
55
|
visible: visible,
|
|
53
56
|
role: others.role || 'menu',
|
|
54
|
-
className: (0, _helpers.styles)(
|
|
57
|
+
className: (0, _helpers.styles)(style.menu, visible && style.visible, others.className)
|
|
55
58
|
}), children, /*#__PURE__*/_react.default.createElement(_primitives.LayerContent, null, renderOptions())) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
|
|
56
59
|
title: title,
|
|
57
60
|
visible: visible,
|
|
@@ -61,7 +64,7 @@ var Menu = function Menu(_ref) {
|
|
|
61
64
|
onOverflow: function onOverflow(event) {
|
|
62
65
|
return _onPress(undefined, event);
|
|
63
66
|
},
|
|
64
|
-
className: (0, _helpers.styles)(
|
|
67
|
+
className: (0, _helpers.styles)(style.menu, others.className)
|
|
65
68
|
}, renderOptions()));
|
|
66
69
|
};
|
|
67
70
|
exports.Menu = Menu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","names":["Menu","children","options","Template","Option","title","visible","onPress","others","useDevice","isMobile","renderOptions","filter","option","map","index","testId","undefined","event","value","role","styles","style","menu","className","displayName","propTypes","PropTypes","node","arrayOf","shape","disabled","bool","divider","icon","func","label","string","oneOfType","number","any"],"sources":["../../../src/components/Menu/Menu.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Layer, LayerContent } from '../../primitives';\nimport { Modal } from '../Modal';\nimport style from './Menu.module.css';\nimport { Option } from './Menu.Option';\n\nconst Menu = ({ children, options = [], Template = Option, title, visible, onPress = () => {}, ...others }) => {\n const { isMobile } = useDevice();\n\n const renderOptions = () =>\n options\n .filter((option) => !!option)\n .map((option = {}, index) => (\n <Template\n testId={others.testId ? `${others.testId}-${index}` : undefined}\n {...option}\n key={index}\n onPress={(event) => onPress(option.value, event)}\n />\n ));\n\n return !isMobile ? (\n <Layer\n forceRender={false}\n {...others}\n visible={visible}\n role={others.role || 'menu'}\n className={styles(style.menu, visible && style.visible, others.className)}\n >\n {children}\n <LayerContent>{renderOptions()}</LayerContent>\n </Layer>\n ) : (\n <>\n {children}\n <Modal\n title={title}\n visible={visible}\n onClose={(event) => onPress(undefined, event)}\n onOverflow={(event) => onPress(undefined, event)}\n className={styles(style.menu, others.className)}\n >\n {renderOptions()}\n </Modal>\n </>\n );\n};\n\nMenu.displayName = 'Component:Menu';\n\nMenu.propTypes = {\n children: PropTypes.node,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.node,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n icon: PropTypes.func,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ),\n Template: PropTypes.any,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onPress: PropTypes.func,\n};\n\nexport { Menu };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Menu.js","names":["Menu","children","options","Template","Option","title","visible","onPress","others","useDevice","isMobile","renderOptions","filter","option","map","index","testId","undefined","event","value","role","styles","style","menu","className","displayName","propTypes","PropTypes","node","arrayOf","shape","disabled","bool","divider","icon","func","label","string","oneOfType","number","any"],"sources":["../../../src/components/Menu/Menu.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Layer, LayerContent } from '../../primitives';\nimport { Modal } from '../Modal';\nimport * as style from './Menu.module.css';\nimport { Option } from './Menu.Option';\n\nconst Menu = ({ children, options = [], Template = Option, title, visible, onPress = () => {}, ...others }) => {\n const { isMobile } = useDevice();\n\n const renderOptions = () =>\n options\n .filter((option) => !!option)\n .map((option = {}, index) => (\n <Template\n testId={others.testId ? `${others.testId}-${index}` : undefined}\n {...option}\n key={index}\n onPress={(event) => onPress(option.value, event)}\n />\n ));\n\n return !isMobile ? (\n <Layer\n forceRender={false}\n {...others}\n visible={visible}\n role={others.role || 'menu'}\n className={styles(style.menu, visible && style.visible, others.className)}\n >\n {children}\n <LayerContent>{renderOptions()}</LayerContent>\n </Layer>\n ) : (\n <>\n {children}\n <Modal\n title={title}\n visible={visible}\n onClose={(event) => onPress(undefined, event)}\n onOverflow={(event) => onPress(undefined, event)}\n className={styles(style.menu, others.className)}\n >\n {renderOptions()}\n </Modal>\n </>\n );\n};\n\nMenu.displayName = 'Component:Menu';\n\nMenu.propTypes = {\n children: PropTypes.node,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.node,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n icon: PropTypes.func,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ),\n Template: PropTypes.any,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onPress: PropTypes.func,\n};\n\nexport { Menu };\n"],"mappings":"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"}
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
width: 100%;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.menu .option.value
|
|
23
|
+
.menu .option.value:hover:not(.disabled) {
|
|
24
24
|
background-color: var(--mirai-ui-menu-option-hover-background);
|
|
25
25
|
cursor: pointer;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.menu .option.value
|
|
29
|
-
.menu .option.value
|
|
28
|
+
.menu .option.value:hover:not(.disabled) .icon,
|
|
29
|
+
.menu .option.value:hover:not(.disabled) .label {
|
|
30
30
|
color: var(--mirai-ui-menu-option-hover-color);
|
|
31
31
|
cursor: pointer;
|
|
32
32
|
}
|
|
@@ -2,70 +2,75 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`component:<Menu> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<ui_layer />
|
|
6
6
|
</DocumentFragment>
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
exports[`component:<Menu> prop:Template 1`] = `
|
|
10
10
|
<DocumentFragment>
|
|
11
|
-
<
|
|
11
|
+
<ui_layer>
|
|
12
12
|
<button
|
|
13
|
-
class="pressable button
|
|
13
|
+
class="pressable button"
|
|
14
|
+
tabindex="0"
|
|
14
15
|
>
|
|
15
16
|
Action
|
|
16
17
|
</button>
|
|
17
|
-
</
|
|
18
|
+
</ui_layer>
|
|
18
19
|
</DocumentFragment>
|
|
19
20
|
`;
|
|
20
21
|
|
|
21
22
|
exports[`component:<Menu> prop:children 1`] = `
|
|
22
23
|
<DocumentFragment>
|
|
23
|
-
<
|
|
24
|
+
<ui_layer>
|
|
24
25
|
<button
|
|
25
|
-
class="pressable button
|
|
26
|
+
class="pressable button"
|
|
27
|
+
tabindex="0"
|
|
26
28
|
>
|
|
27
29
|
Action
|
|
28
30
|
</button>
|
|
29
|
-
</
|
|
31
|
+
</ui_layer>
|
|
30
32
|
</DocumentFragment>
|
|
31
33
|
`;
|
|
32
34
|
|
|
33
35
|
exports[`component:<Menu> prop:options & visible 1`] = `
|
|
34
36
|
<DocumentFragment>
|
|
35
|
-
<
|
|
37
|
+
<ui_layer>
|
|
36
38
|
<button
|
|
37
|
-
class="pressable button
|
|
39
|
+
class="pressable button"
|
|
40
|
+
tabindex="0"
|
|
38
41
|
>
|
|
39
42
|
Action
|
|
40
43
|
</button>
|
|
41
|
-
</
|
|
42
|
-
<
|
|
44
|
+
</ui_layer>
|
|
45
|
+
<ui_layer_content
|
|
43
46
|
class="layer"
|
|
44
47
|
style="left: 0px; top: 0px;"
|
|
45
48
|
>
|
|
46
49
|
<div
|
|
47
50
|
class="menu visible"
|
|
48
51
|
>
|
|
49
|
-
<
|
|
50
|
-
class="pressable option divider
|
|
52
|
+
<ui_pressable
|
|
53
|
+
class="pressable option divider"
|
|
54
|
+
tabindex="0"
|
|
51
55
|
>
|
|
52
|
-
<
|
|
56
|
+
<ui_view
|
|
53
57
|
class="view row wide content"
|
|
54
58
|
>
|
|
55
|
-
<
|
|
59
|
+
<ui_text
|
|
56
60
|
class="text paragraph label"
|
|
57
61
|
>
|
|
58
62
|
Lorem Ipsum...
|
|
59
|
-
</
|
|
60
|
-
</
|
|
61
|
-
</
|
|
62
|
-
<
|
|
63
|
-
class="pressable option value
|
|
63
|
+
</ui_text>
|
|
64
|
+
</ui_view>
|
|
65
|
+
</ui_pressable>
|
|
66
|
+
<ui_pressable
|
|
67
|
+
class="pressable option value"
|
|
68
|
+
tabindex="0"
|
|
64
69
|
>
|
|
65
|
-
<
|
|
70
|
+
<ui_view
|
|
66
71
|
class="view row wide content"
|
|
67
72
|
>
|
|
68
|
-
<
|
|
73
|
+
<ui_icon
|
|
69
74
|
class="icon headline-3 icon"
|
|
70
75
|
>
|
|
71
76
|
<svg
|
|
@@ -85,22 +90,23 @@ exports[`component:<Menu> prop:options & visible 1`] = `
|
|
|
85
90
|
d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
86
91
|
/>
|
|
87
92
|
</svg>
|
|
88
|
-
</
|
|
89
|
-
<
|
|
93
|
+
</ui_icon>
|
|
94
|
+
<ui_text
|
|
90
95
|
class="text paragraph label"
|
|
91
96
|
>
|
|
92
97
|
Item 1
|
|
93
|
-
</
|
|
94
|
-
</
|
|
95
|
-
</
|
|
96
|
-
<
|
|
98
|
+
</ui_text>
|
|
99
|
+
</ui_view>
|
|
100
|
+
</ui_pressable>
|
|
101
|
+
<ui_pressable
|
|
97
102
|
class="pressable option value disabled"
|
|
98
103
|
data-testid="two"
|
|
104
|
+
tabindex="0"
|
|
99
105
|
>
|
|
100
|
-
<
|
|
106
|
+
<ui_view
|
|
101
107
|
class="view row wide content"
|
|
102
108
|
>
|
|
103
|
-
<
|
|
109
|
+
<ui_icon
|
|
104
110
|
class="icon headline-3 icon"
|
|
105
111
|
>
|
|
106
112
|
<svg
|
|
@@ -120,104 +126,111 @@ exports[`component:<Menu> prop:options & visible 1`] = `
|
|
|
120
126
|
d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
121
127
|
/>
|
|
122
128
|
</svg>
|
|
123
|
-
</
|
|
124
|
-
<
|
|
129
|
+
</ui_icon>
|
|
130
|
+
<ui_text
|
|
125
131
|
class="text paragraph label"
|
|
126
132
|
>
|
|
127
133
|
Item 2
|
|
128
|
-
</
|
|
129
|
-
</
|
|
130
|
-
</
|
|
131
|
-
<
|
|
132
|
-
class="pressable option value divider
|
|
134
|
+
</ui_text>
|
|
135
|
+
</ui_view>
|
|
136
|
+
</ui_pressable>
|
|
137
|
+
<ui_pressable
|
|
138
|
+
class="pressable option value divider"
|
|
139
|
+
tabindex="0"
|
|
133
140
|
>
|
|
134
|
-
<
|
|
141
|
+
<ui_view
|
|
135
142
|
class="view row wide content"
|
|
136
143
|
>
|
|
137
|
-
<
|
|
144
|
+
<ui_text
|
|
138
145
|
class="text paragraph label"
|
|
139
146
|
>
|
|
140
147
|
Item 3
|
|
141
|
-
</
|
|
142
|
-
</
|
|
143
|
-
</
|
|
144
|
-
<
|
|
145
|
-
class="pressable option value
|
|
148
|
+
</ui_text>
|
|
149
|
+
</ui_view>
|
|
150
|
+
</ui_pressable>
|
|
151
|
+
<ui_pressable
|
|
152
|
+
class="pressable option value"
|
|
153
|
+
tabindex="0"
|
|
146
154
|
>
|
|
147
|
-
<
|
|
155
|
+
<ui_view
|
|
148
156
|
class="view row wide content"
|
|
149
157
|
>
|
|
150
|
-
<
|
|
158
|
+
<ui_text
|
|
151
159
|
class="text paragraph label"
|
|
152
160
|
>
|
|
153
161
|
Item 4
|
|
154
|
-
</
|
|
162
|
+
</ui_text>
|
|
155
163
|
<button
|
|
156
|
-
class="pressable button
|
|
164
|
+
class="pressable button small"
|
|
165
|
+
tabindex="0"
|
|
157
166
|
>
|
|
158
167
|
Add
|
|
159
168
|
</button>
|
|
160
|
-
</
|
|
161
|
-
</
|
|
162
|
-
<
|
|
163
|
-
class="pressable option
|
|
169
|
+
</ui_view>
|
|
170
|
+
</ui_pressable>
|
|
171
|
+
<ui_pressable
|
|
172
|
+
class="pressable option"
|
|
173
|
+
tabindex="0"
|
|
164
174
|
>
|
|
165
|
-
<
|
|
175
|
+
<ui_view
|
|
166
176
|
class="view row wide content"
|
|
167
177
|
>
|
|
168
178
|
<button
|
|
169
|
-
class="pressable button
|
|
179
|
+
class="pressable button"
|
|
180
|
+
tabindex="0"
|
|
170
181
|
>
|
|
171
182
|
Add
|
|
172
183
|
</button>
|
|
173
|
-
</
|
|
174
|
-
</
|
|
184
|
+
</ui_view>
|
|
185
|
+
</ui_pressable>
|
|
175
186
|
</div>
|
|
176
|
-
</
|
|
187
|
+
</ui_layer_content>
|
|
177
188
|
</DocumentFragment>
|
|
178
189
|
`;
|
|
179
190
|
|
|
180
191
|
exports[`component:<Menu> prop:options 1`] = `
|
|
181
192
|
<DocumentFragment>
|
|
182
|
-
<
|
|
193
|
+
<ui_layer>
|
|
183
194
|
<button
|
|
184
|
-
class="pressable button
|
|
195
|
+
class="pressable button"
|
|
196
|
+
tabindex="0"
|
|
185
197
|
>
|
|
186
198
|
Action
|
|
187
199
|
</button>
|
|
188
|
-
</
|
|
200
|
+
</ui_layer>
|
|
189
201
|
</DocumentFragment>
|
|
190
202
|
`;
|
|
191
203
|
|
|
192
204
|
exports[`component:<Menu> prop:title 1`] = `
|
|
193
205
|
<DocumentFragment>
|
|
194
|
-
<
|
|
206
|
+
<ui_layer>
|
|
195
207
|
<button
|
|
196
|
-
class="pressable button
|
|
208
|
+
class="pressable button"
|
|
209
|
+
tabindex="0"
|
|
197
210
|
>
|
|
198
211
|
Action
|
|
199
212
|
</button>
|
|
200
|
-
</
|
|
201
|
-
<
|
|
213
|
+
</ui_layer>
|
|
214
|
+
<ui_layer_content
|
|
202
215
|
class="layer"
|
|
203
216
|
style="left: 0px; top: 0px;"
|
|
204
217
|
>
|
|
205
218
|
<div
|
|
206
219
|
class="menu visible"
|
|
207
220
|
/>
|
|
208
|
-
</
|
|
221
|
+
</ui_layer_content>
|
|
209
222
|
</DocumentFragment>
|
|
210
223
|
`;
|
|
211
224
|
|
|
212
225
|
exports[`component:<Menu> renders 1`] = `
|
|
213
226
|
<DocumentFragment>
|
|
214
|
-
<
|
|
227
|
+
<ui_layer />
|
|
215
228
|
</DocumentFragment>
|
|
216
229
|
`;
|
|
217
230
|
|
|
218
231
|
exports[`component:<Menu> testId 1`] = `
|
|
219
232
|
<DocumentFragment>
|
|
220
|
-
<
|
|
233
|
+
<ui_layer
|
|
221
234
|
data-testid="mirai"
|
|
222
235
|
/>
|
|
223
236
|
</DocumentFragment>
|
|
@@ -12,7 +12,7 @@ var _components = require("../../components");
|
|
|
12
12
|
var _helpers = require("../../helpers");
|
|
13
13
|
var _hooks = require("../../hooks");
|
|
14
14
|
var _primitives = require("../../primitives");
|
|
15
|
-
var
|
|
15
|
+
var style = _interopRequireWildcard(require("./Modal.module.css"));
|
|
16
16
|
var _excluded = ["blur", "children", "fit", "overflow", "portal", "preventDefault", "title", "visible", "onBack", "onClose", "onOverflow"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -92,7 +92,7 @@ var Modal = function Modal(_ref) {
|
|
|
92
92
|
preventDefault: preventDefault,
|
|
93
93
|
role: others.role ? "".concat(others.role, "-overflow") : 'modal-overflow',
|
|
94
94
|
onPress: visible && overflow ? handleOverflow : undefined,
|
|
95
|
-
className: (0, _helpers.styles)(
|
|
95
|
+
className: (0, _helpers.styles)(style.container, overflow && style.overflow, overflow && blur && style.blur, visible && style.visible, onOverflow && style.onOverflow),
|
|
96
96
|
style: {
|
|
97
97
|
height: height
|
|
98
98
|
},
|
|
@@ -101,10 +101,10 @@ var Modal = function Modal(_ref) {
|
|
|
101
101
|
fit: true,
|
|
102
102
|
ref: ref,
|
|
103
103
|
role: others.role || 'modal',
|
|
104
|
-
className: (0, _helpers.styles)(
|
|
104
|
+
className: (0, _helpers.styles)(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)
|
|
105
105
|
}), (title || onBack || onClose) && /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
106
106
|
forceRow: true,
|
|
107
|
-
className:
|
|
107
|
+
className: style.header
|
|
108
108
|
}, onBack && /*#__PURE__*/_react.default.createElement(_components.Button, {
|
|
109
109
|
transparent: true,
|
|
110
110
|
small: true,
|
|
@@ -113,23 +113,23 @@ var Modal = function Modal(_ref) {
|
|
|
113
113
|
testId: testId ? "".concat(testId, "-button-back") : undefined
|
|
114
114
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
115
115
|
value: _primitives.ICON.LEFT,
|
|
116
|
-
className:
|
|
116
|
+
className: style.icon
|
|
117
117
|
})), title && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
118
118
|
headline: true,
|
|
119
|
-
className: (0, _helpers.styles)(
|
|
119
|
+
className: (0, _helpers.styles)(style.title, !onBack && style.left, !onClose && style.right)
|
|
120
120
|
}, title), onClose && /*#__PURE__*/_react.default.createElement(_components.Button, {
|
|
121
121
|
transparent: true,
|
|
122
122
|
small: true,
|
|
123
123
|
squared: true,
|
|
124
124
|
onPress: onClose,
|
|
125
125
|
testId: testId ? "".concat(testId, "-button-close") : undefined,
|
|
126
|
-
className:
|
|
126
|
+
className: style.button
|
|
127
127
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
128
128
|
value: isDesktop || title !== undefined ? _primitives.ICON.CLOSE : _primitives.ICON.EXPAND_MORE,
|
|
129
|
-
className:
|
|
129
|
+
className: style.icon
|
|
130
130
|
}))), _react.default.Children.map(children, function (child, index) {
|
|
131
131
|
return !child || child === null ? null : /*#__PURE__*/_react.default.cloneElement(child, _objectSpread(_objectSpread({
|
|
132
|
-
key: index
|
|
132
|
+
key: child.key || index
|
|
133
133
|
}, child.props), {}, {
|
|
134
134
|
role: 'modal-content'
|
|
135
135
|
}));
|