@mirai/ui 1.0.255 → 1.0.257
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/README.md +13 -19
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +12 -4
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +5 -1
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +6 -2
- package/build/components/Notification/Notification.js +18 -13
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.module.css +42 -58
- package/build/components/Notification/Notification.stories.js +15 -2
- package/build/components/Notification/Notification.stories.js.map +1 -1
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +254 -180
- package/build/components/Table/Table.ColumnFilter.js +15 -12
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.stories.js +19 -17
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/Table.stories.module.css +3 -4
- package/build/components/Table/helpers/select.js +2 -2
- package/build/components/Table/helpers/select.js.map +1 -1
- package/build/helpers/getIconState.js +1 -1
- package/build/helpers/getIconState.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js +1 -2
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +1 -1
- package/build/theme/default.theme.css +5 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1304,32 +1304,26 @@ Theme.setDirection(DIRECTION_TYPE.RIGHT);
|
|
|
1304
1304
|
--mirai-ui-content: #484848;
|
|
1305
1305
|
--mirai-ui-content-background: #f6f6f6;
|
|
1306
1306
|
--mirai-ui-content-border: #e4e4e4;
|
|
1307
|
-
--mirai-ui-content-dark: #202020;
|
|
1308
1307
|
--mirai-ui-content-light: #999999;
|
|
1308
|
+
--mirai-ui-content-dark: #202020;
|
|
1309
1309
|
|
|
1310
1310
|
--mirai-ui-accent: #3978c5;
|
|
1311
1311
|
--mirai-ui-accent-background: #e9f1fc;
|
|
1312
1312
|
--mirai-ui-accent-border: #b0c9e8;
|
|
1313
|
-
--mirai-ui-accent-dark: #224876;
|
|
1314
1313
|
--mirai-ui-accent-light: #88aedc;
|
|
1314
|
+
--mirai-ui-accent-dark: #224876;
|
|
1315
|
+
|
|
1316
|
+
--mirai-ui-error: #cc003a;
|
|
1317
|
+
--mirai-ui-error-background: #ffece5;
|
|
1318
|
+
|
|
1319
|
+
--mirai-ui-warning: #ffad00;
|
|
1320
|
+
--mirai-ui-warning-background: #fff3cc;
|
|
1321
|
+
|
|
1322
|
+
--mirai-ui-success: #067949;
|
|
1323
|
+
--mirai-ui-success-background: #e7fde7;
|
|
1315
1324
|
|
|
1316
|
-
--mirai-ui-
|
|
1317
|
-
--mirai-ui-
|
|
1318
|
-
--mirai-ui-error-border: #f4b6b6;
|
|
1319
|
-
--mirai-ui-error-dark: #7d2828;
|
|
1320
|
-
--mirai-ui-error-light: #ee9191;
|
|
1321
|
-
|
|
1322
|
-
--mirai-ui-success: #52bd94;
|
|
1323
|
-
--mirai-ui-success-background: #f5fbf8;
|
|
1324
|
-
--mirai-ui-success-border: #dcf2ea;
|
|
1325
|
-
--mirai-ui-success-dark: #317159;
|
|
1326
|
-
--mirai-ui-success-light: #a3e6cd;
|
|
1327
|
-
|
|
1328
|
-
--mirai-ui-warning: #ffb020;
|
|
1329
|
-
--mirai-ui-warning-background: #fffaf1;
|
|
1330
|
-
--mirai-ui-warning-border: #ffdfa6;
|
|
1331
|
-
--mirai-ui-warning-dark: #66460d;
|
|
1332
|
-
--mirai-ui-warning-light: #ffd079;
|
|
1325
|
+
--mirai-ui-info: #005cb2;
|
|
1326
|
+
--mirai-ui-info-background: #e6f8ff;
|
|
1333
1327
|
|
|
1334
1328
|
/* spacing */
|
|
1335
1329
|
--mirai-ui-space-XS: 8px;
|
|
@@ -1195,7 +1195,7 @@ exports[`component:<InputPhone> prop:showState (false) & success 1`] = `
|
|
|
1195
1195
|
fill="none"
|
|
1196
1196
|
/>
|
|
1197
1197
|
<path
|
|
1198
|
-
d="
|
|
1198
|
+
d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
|
|
1199
1199
|
/>
|
|
1200
1200
|
</svg>
|
|
1201
1201
|
</span>
|
|
@@ -1293,7 +1293,11 @@ exports[`component:<InputPhone> prop:showState (false) & warning 1`] = `
|
|
|
1293
1293
|
xmlns="http://www.w3.org/2000/svg"
|
|
1294
1294
|
>
|
|
1295
1295
|
<path
|
|
1296
|
-
d="
|
|
1296
|
+
d="M0 0h24v24H0V0z"
|
|
1297
|
+
fill="none"
|
|
1298
|
+
/>
|
|
1299
|
+
<path
|
|
1300
|
+
d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
1297
1301
|
/>
|
|
1298
1302
|
</svg>
|
|
1299
1303
|
</span>
|
|
@@ -1395,7 +1399,7 @@ exports[`component:<InputPhone> prop:success 1`] = `
|
|
|
1395
1399
|
fill="none"
|
|
1396
1400
|
/>
|
|
1397
1401
|
<path
|
|
1398
|
-
d="
|
|
1402
|
+
d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
|
|
1399
1403
|
/>
|
|
1400
1404
|
</svg>
|
|
1401
1405
|
</span>
|
|
@@ -1607,7 +1611,11 @@ exports[`component:<InputPhone> prop:warning 1`] = `
|
|
|
1607
1611
|
xmlns="http://www.w3.org/2000/svg"
|
|
1608
1612
|
>
|
|
1609
1613
|
<path
|
|
1610
|
-
d="
|
|
1614
|
+
d="M0 0h24v24H0V0z"
|
|
1615
|
+
fill="none"
|
|
1616
|
+
/>
|
|
1617
|
+
<path
|
|
1618
|
+
d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
1611
1619
|
/>
|
|
1612
1620
|
</svg>
|
|
1613
1621
|
</span>
|
|
@@ -757,7 +757,11 @@ exports[`component:<InputSelect> prop:warning 1`] = `
|
|
|
757
757
|
xmlns="http://www.w3.org/2000/svg"
|
|
758
758
|
>
|
|
759
759
|
<path
|
|
760
|
-
d="
|
|
760
|
+
d="M0 0h24v24H0V0z"
|
|
761
|
+
fill="none"
|
|
762
|
+
/>
|
|
763
|
+
<path
|
|
764
|
+
d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
761
765
|
/>
|
|
762
766
|
</svg>
|
|
763
767
|
</span>
|
|
@@ -426,7 +426,7 @@ exports[`component:<InputText> prop:success 1`] = `
|
|
|
426
426
|
fill="none"
|
|
427
427
|
/>
|
|
428
428
|
<path
|
|
429
|
-
d="
|
|
429
|
+
d="M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"
|
|
430
430
|
/>
|
|
431
431
|
</svg>
|
|
432
432
|
</span>
|
|
@@ -515,7 +515,11 @@ exports[`component:<InputText> prop:warning 1`] = `
|
|
|
515
515
|
xmlns="http://www.w3.org/2000/svg"
|
|
516
516
|
>
|
|
517
517
|
<path
|
|
518
|
-
d="
|
|
518
|
+
d="M0 0h24v24H0V0z"
|
|
519
|
+
fill="none"
|
|
520
|
+
/>
|
|
521
|
+
<path
|
|
522
|
+
d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
|
|
519
523
|
/>
|
|
520
524
|
</svg>
|
|
521
525
|
</span>
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _helpers = require("../../helpers");
|
|
10
10
|
var _primitives = require("../../primitives");
|
|
11
11
|
var _NotificationModule = _interopRequireDefault(require("./Notification.module.css"));
|
|
12
|
-
var _excluded = ["children", "error", "info", "inline", "large", "small", "success", "warning", "wide", "onClose"];
|
|
12
|
+
var _excluded = ["children", "error", "info", "inline", "large", "small", "success", "title", "warning", "wide", "onClose"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
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
15
|
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; }
|
|
@@ -23,6 +23,7 @@ var Notification = function Notification(_ref) {
|
|
|
23
23
|
large = _ref.large,
|
|
24
24
|
small = _ref.small,
|
|
25
25
|
success = _ref.success,
|
|
26
|
+
title = _ref.title,
|
|
26
27
|
warning = _ref.warning,
|
|
27
28
|
wide = _ref.wide,
|
|
28
29
|
onClose = _ref.onClose,
|
|
@@ -30,27 +31,30 @@ var Notification = function Notification(_ref) {
|
|
|
30
31
|
return /*#__PURE__*/_react.default.createElement(_primitives.View, _extends({}, others, {
|
|
31
32
|
row: true,
|
|
32
33
|
role: others.role || 'notification',
|
|
33
|
-
className: (0, _helpers.styles)(_NotificationModule.default.notification, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : info ? _NotificationModule.default.info : undefined, inline ? _NotificationModule.default.inline : _NotificationModule.default.outlined,
|
|
34
|
+
className: (0, _helpers.styles)(_NotificationModule.default.notification, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : info ? _NotificationModule.default.info : undefined, inline ? _NotificationModule.default.inline : _NotificationModule.default.outlined, large ? _NotificationModule.default.large : small ? _NotificationModule.default.small : undefined, wide && _NotificationModule.default.wide, others.className)
|
|
34
35
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
35
|
-
headline:
|
|
36
|
-
level: large ? 1 :
|
|
37
|
-
paragraph: small,
|
|
36
|
+
headline: true,
|
|
37
|
+
level: large ? 1 : small || !title ? 3 : 2,
|
|
38
38
|
value: (0, _helpers.getIconState)({
|
|
39
39
|
error: error,
|
|
40
40
|
success: success,
|
|
41
41
|
warning: warning
|
|
42
42
|
}),
|
|
43
|
-
className: _NotificationModule.default.icon
|
|
44
|
-
}), /*#__PURE__*/_react.default.createElement(_primitives.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
43
|
+
className: (0, _helpers.styles)(_NotificationModule.default.icon, (small || !title) && !large && _NotificationModule.default.small)
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
45
|
+
className: _NotificationModule.default.texts
|
|
46
|
+
}, title && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
47
|
+
action: small,
|
|
48
|
+
bold: true,
|
|
49
|
+
headline: large
|
|
50
|
+
}, title), children && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
51
|
+
action: !small,
|
|
52
|
+
small: small
|
|
53
|
+
}, children)), !inline && !large && onClose && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
48
54
|
onPress: onClose,
|
|
49
|
-
className: (0, _helpers.styles)(_NotificationModule.default.pressable, _NotificationModule.default.icon),
|
|
50
55
|
testId: others.testId ? "".concat(others.testId, "-button-close") : undefined
|
|
51
56
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
52
|
-
value: _primitives.ICON.CLOSE
|
|
53
|
-
paragraph: small
|
|
57
|
+
value: _primitives.ICON.CLOSE
|
|
54
58
|
})));
|
|
55
59
|
};
|
|
56
60
|
exports.Notification = Notification;
|
|
@@ -63,6 +67,7 @@ Notification.propTypes = {
|
|
|
63
67
|
large: _propTypes.default.bool,
|
|
64
68
|
small: _propTypes.default.bool,
|
|
65
69
|
success: _propTypes.default.bool,
|
|
70
|
+
title: _propTypes.default.string,
|
|
66
71
|
warning: _propTypes.default.bool,
|
|
67
72
|
wide: _propTypes.default.bool,
|
|
68
73
|
onClose: _propTypes.default.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","names":["Notification","children","error","info","inline","large","small","success","warning","wide","onClose","others","role","styles","style","notification","undefined","outlined","className","getIconState","icon","
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["Notification","children","error","info","inline","large","small","success","title","warning","wide","onClose","others","role","styles","style","notification","undefined","outlined","className","getIconState","icon","texts","testId","ICON","CLOSE","displayName","propTypes","PropTypes","any","isRequired","bool","string","func"],"sources":["../../../src/components/Notification/Notification.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Notification.module.css';\n\nconst Notification = ({\n children,\n error,\n info,\n inline = false,\n large,\n small,\n success,\n title,\n warning,\n wide,\n onClose,\n ...others\n}) => (\n <View\n {...others}\n row\n role={others.role || 'notification'}\n className={styles(\n style.notification,\n error ? style.error : warning ? style.warning : success ? style.success : info ? style.info : undefined,\n inline ? style.inline : style.outlined,\n large ? style.large : small ? style.small : undefined,\n wide && style.wide,\n others.className,\n )}\n >\n <Icon\n headline\n level={large ? 1 : small || !title ? 3 : 2}\n value={getIconState({ error, success, warning })}\n className={styles(style.icon, (small || !title) && !large && style.small)}\n />\n\n <View className={style.texts}>\n {title && (\n <Text action={small} bold headline={large}>\n {title}\n </Text>\n )}\n {children && (\n <Text action={!small} small={small}>\n {children}\n </Text>\n )}\n </View>\n\n {!inline && !large && onClose && (\n <Pressable onPress={onClose} testId={others.testId ? `${others.testId}-button-close` : undefined}>\n <Icon value={ICON.CLOSE} />\n </Pressable>\n )}\n </View>\n);\n\nNotification.displayName = 'Component:Notification';\n\nNotification.propTypes = {\n children: PropTypes.any.isRequired,\n error: PropTypes.bool,\n info: PropTypes.bool,\n inline: PropTypes.bool,\n large: PropTypes.bool,\n small: PropTypes.bool,\n success: PropTypes.bool,\n title: PropTypes.string,\n warning: PropTypes.bool,\n wide: PropTypes.bool,\n onClose: PropTypes.func,\n};\n\nexport { Notification };\n"],"mappings":"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"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
.notification {
|
|
2
|
+
align-items: center;
|
|
2
3
|
width: fit-content;
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.notification.outlined {
|
|
7
|
-
background-color: var(--mirai-ui-content-background);
|
|
8
|
-
border: solid var(--mirai-ui-border-width) var(--mirai-ui-content-border);
|
|
9
|
-
border-radius: var(--mirai-ui-notification-border-radius);
|
|
10
|
-
padding: var(--mirai-ui-notification-padding);
|
|
4
|
+
gap: var(--mirai-ui-space-S);
|
|
11
5
|
}
|
|
12
6
|
|
|
13
7
|
.notification.large {
|
|
@@ -19,91 +13,81 @@
|
|
|
19
13
|
width: 100%;
|
|
20
14
|
}
|
|
21
15
|
|
|
22
|
-
.notification.
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.notification.outlined.small {
|
|
27
|
-
padding: var(--mirai-ui-notification-padding-small);
|
|
16
|
+
.notification .info {
|
|
17
|
+
color: var(--mirai-ui-info);
|
|
28
18
|
}
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
/* -- outlined ------------------------------------------------------------------------------------------------------ */
|
|
21
|
+
.notification.outlined {
|
|
22
|
+
background-color: var(--mirai-ui-content-background);
|
|
23
|
+
border-radius: var(--mirai-ui-notification-border-radius);
|
|
24
|
+
padding: var(--mirai-ui-notification-padding);
|
|
32
25
|
}
|
|
33
26
|
|
|
34
|
-
.notification.
|
|
35
|
-
|
|
36
|
-
border-color: var(--mirai-ui-success-border);
|
|
27
|
+
.notification.outlined.large {
|
|
28
|
+
padding: var(--mirai-ui-notification-padding-large);
|
|
37
29
|
}
|
|
38
30
|
|
|
39
|
-
.notification.
|
|
40
|
-
|
|
31
|
+
.notification.outlined.small {
|
|
32
|
+
padding: var(--mirai-ui-notification-padding-small);
|
|
41
33
|
}
|
|
42
34
|
|
|
43
|
-
.notification.error
|
|
35
|
+
.notification.outlined.error {
|
|
44
36
|
background-color: var(--mirai-ui-error-background);
|
|
45
|
-
border-color: var(--mirai-ui-error-border);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.notification.error * {
|
|
49
|
-
color: var(--mirai-ui-error);
|
|
50
37
|
}
|
|
51
38
|
|
|
52
|
-
.notification.warning
|
|
39
|
+
.notification.outlined.warning {
|
|
53
40
|
background-color: var(--mirai-ui-warning-background);
|
|
54
|
-
border-color: var(--mirai-ui-warning-border);
|
|
55
41
|
}
|
|
56
42
|
|
|
57
|
-
.notification.
|
|
58
|
-
color: var(--mirai-ui-
|
|
43
|
+
.notification.outlined.success {
|
|
44
|
+
background-color: var(--mirai-ui-success-background);
|
|
59
45
|
}
|
|
60
46
|
|
|
61
|
-
.notification.info
|
|
47
|
+
.notification.outlined.info {
|
|
62
48
|
background-color: var(--mirai-ui-info-background);
|
|
63
|
-
border-color: var(--mirai-ui-info-border);
|
|
64
49
|
}
|
|
65
50
|
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
/* -- <Icon> ---------------------------------------------------------------------------------------------------------*/
|
|
52
|
+
.notification .icon {
|
|
53
|
+
background-color: var(--mirai-ui-content);
|
|
54
|
+
border-radius: 50%;
|
|
68
55
|
}
|
|
69
56
|
|
|
70
|
-
.notification
|
|
71
|
-
|
|
72
|
-
margin-right: var(--mirai-ui-notification-padding);
|
|
57
|
+
.notification .icon:not(.small) {
|
|
58
|
+
padding: calc(var(--mirai-ui-space-XS) / 2);
|
|
73
59
|
}
|
|
74
60
|
|
|
75
|
-
.notification
|
|
76
|
-
|
|
77
|
-
text-align: center;
|
|
61
|
+
.notification .icon.small {
|
|
62
|
+
padding: calc(var(--mirai-ui-space-XS) / 4);
|
|
78
63
|
}
|
|
79
64
|
|
|
80
|
-
.notification.
|
|
81
|
-
|
|
82
|
-
margin-right: var(--mirai-ui-notification-padding-small);
|
|
65
|
+
.notification:not(.warning) .icon {
|
|
66
|
+
color: var(--mirai-ui-base);
|
|
83
67
|
}
|
|
84
68
|
|
|
85
|
-
.notification.
|
|
86
|
-
|
|
69
|
+
.notification.error .icon {
|
|
70
|
+
background-color: var(--mirai-ui-error);
|
|
87
71
|
}
|
|
88
72
|
|
|
89
|
-
.notification.
|
|
90
|
-
color: var(--mirai-ui-
|
|
73
|
+
.notification.warning .icon {
|
|
74
|
+
background-color: var(--mirai-ui-warning);
|
|
91
75
|
}
|
|
92
76
|
|
|
93
|
-
.notification
|
|
94
|
-
|
|
77
|
+
.notification.success .icon {
|
|
78
|
+
background-color: var(--mirai-ui-success);
|
|
95
79
|
}
|
|
96
80
|
|
|
97
|
-
.notification.
|
|
98
|
-
|
|
99
|
-
line-height: var(--mirai-ui-space-XL);
|
|
100
|
-
height: var(--mirai-ui-space-XL);
|
|
101
|
-
width: var(--mirai-ui-space-XL);
|
|
81
|
+
.notification.info .icon {
|
|
82
|
+
background-color: var(--mirai-ui-info);
|
|
102
83
|
}
|
|
103
84
|
|
|
104
|
-
|
|
105
|
-
|
|
85
|
+
/* -- <Text>s ------------------------------------------------------------------------------------------------------- */
|
|
86
|
+
.notification .texts {
|
|
87
|
+
flex: 1;
|
|
106
88
|
}
|
|
107
89
|
|
|
108
|
-
.notification .
|
|
90
|
+
.notification.large .texts {
|
|
91
|
+
align-items: center;
|
|
92
|
+
gap: var(--mirai-ui-space-XS);
|
|
109
93
|
}
|
|
@@ -5,19 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.Story = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _primitives = require("../../primitives");
|
|
8
9
|
var _Notification = require("./Notification");
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
10
12
|
var _default = {
|
|
11
13
|
title: 'Components'
|
|
12
14
|
};
|
|
13
15
|
exports.default = _default;
|
|
14
16
|
var Story = function Story(props) {
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
17
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
18
|
+
style: {
|
|
19
|
+
gap: 'var(--mirai-ui-space-M)'
|
|
20
|
+
}
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement(_Notification.Notification, props), /*#__PURE__*/_react.default.createElement(_Notification.Notification, _extends({}, props, {
|
|
22
|
+
small: true
|
|
23
|
+
})), /*#__PURE__*/_react.default.createElement(_Notification.Notification, _extends({}, props, {
|
|
24
|
+
large: true
|
|
25
|
+
})), /*#__PURE__*/_react.default.createElement(_Notification.Notification, _extends({}, props, {
|
|
26
|
+
inline: true
|
|
27
|
+
})));
|
|
16
28
|
};
|
|
17
29
|
exports.Story = Story;
|
|
18
30
|
Story.storyName = 'Notification';
|
|
19
31
|
Story.args = {
|
|
20
|
-
children: '
|
|
32
|
+
children: 'We hold your booking until _Feb 14, 12:00 AM_. If your reserve change, we will get back to you.',
|
|
33
|
+
title: 'Your booking is on Hold',
|
|
21
34
|
error: false,
|
|
22
35
|
info: false,
|
|
23
36
|
inline: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.stories.js","names":["title","Story","props","storyName","args","children","error","info","inline","large","small","success","warning","wide","testId","style","argTypes","onClose","action"],"sources":["../../../src/components/Notification/Notification.stories.jsx"],"sourcesContent":["import React from 'react';\n\nimport { Notification } from './Notification';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <Notification {...props}
|
|
1
|
+
{"version":3,"file":"Notification.stories.js","names":["title","Story","props","gap","storyName","args","children","error","info","inline","large","small","success","warning","wide","testId","style","argTypes","onClose","action"],"sources":["../../../src/components/Notification/Notification.stories.jsx"],"sourcesContent":["import React from 'react';\nimport { View } from '../../primitives';\n\nimport { Notification } from './Notification';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => (\n <View style={{ gap: 'var(--mirai-ui-space-M)' }}>\n <Notification {...props} />\n <Notification {...props} small />\n <Notification {...props} large />\n <Notification {...props} inline />\n </View>\n);\n\nStory.storyName = 'Notification';\n\nStory.args = {\n children: 'We hold your booking until _Feb 14, 12:00 AM_. If your reserve change, we will get back to you.',\n title: 'Your booking is on Hold',\n error: false,\n info: false,\n inline: false,\n large: false,\n small: false,\n success: false,\n warning: false,\n wide: false,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n onClose: { action: 'onClose' },\n};\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AAA8C;AAAA;AAAA,eAE/B;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK;EAAA,oBACzB,6BAAC,gBAAI;IAAC,KAAK,EAAE;MAAEC,GAAG,EAAE;IAA0B;EAAE,gBAC9C,6BAAC,0BAAY,EAAKD,KAAK,CAAI,eAC3B,6BAAC,0BAAY,eAAKA,KAAK;IAAE,KAAK;EAAA,GAAG,eACjC,6BAAC,0BAAY,eAAKA,KAAK;IAAE,KAAK;EAAA,GAAG,eACjC,6BAAC,0BAAY,eAAKA,KAAK;IAAE,MAAM;EAAA,GAAG,CAC7B;AAAA,CACR;AAAC;AAEFD,KAAK,CAACG,SAAS,GAAG,cAAc;AAEhCH,KAAK,CAACI,IAAI,GAAG;EACXC,QAAQ,EAAE,iGAAiG;EAC3GN,KAAK,EAAE,yBAAyB;EAChCO,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,KAAK;EACXC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE,KAAK;EACZC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,IAAI,EAAE,KAAK;EACX;EACAC,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC;AAEDf,KAAK,CAACgB,QAAQ,GAAG;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAU;AAC/B,CAAC"}
|