@mirai/ui 1.0.18 → 1.0.21
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/Button/Button.module.css +17 -24
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +2 -22
- package/build/components/Calendar/Calendar.module.css +6 -6
- package/build/components/InputNumber/InputNumber.js +3 -1
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/InputNumber.module.css +2 -2
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +29 -29
- package/build/components/InputOption/InputOption.module.css +1 -1
- package/build/components/InputText/InputText.module.css +4 -4
- package/build/components/Notification/Notification.js +69 -0
- package/build/components/Notification/Notification.js.map +1 -0
- package/build/components/Notification/Notification.module.css +73 -0
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +351 -0
- package/build/components/Notification/index.js +19 -0
- package/build/components/Notification/index.js.map +1 -0
- package/build/components/Table/Table.module.css +4 -4
- package/build/components/index.js +13 -0
- package/build/components/index.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.module.css +2 -2
- package/build/primitives/Icon/Icon.constants.js +8 -1
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Input/Input.module.css +1 -1
- package/build/primitives/Radio/Radio.module.css +2 -2
- package/build/primitives/Switch/Switch.module.css +2 -2
- package/build/primitives/Text/Text.js +6 -4
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +8 -0
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +10 -0
- package/build/theme/default.theme.css +39 -15
- package/build/theme/theme.js +1 -2
- package/build/theme/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
--mirai-ui-button-color: var(--mirai-ui-base);
|
|
4
4
|
--mirai-ui-button-color-active: rgba(255, 255, 255, 0.2);
|
|
5
5
|
--mirai-ui-button-color-focus: var(--mirai-ui-content);
|
|
6
|
-
--mirai-ui-button-disabled-background: var(--mirai-ui-content-
|
|
7
|
-
--mirai-ui-button-disabled-color: var(--mirai-ui-content-
|
|
6
|
+
--mirai-ui-button-disabled-background: var(--mirai-ui-content-border);
|
|
7
|
+
--mirai-ui-button-disabled-color: var(--mirai-ui-content-light);
|
|
8
|
+
--mirai-ui-button-font: var(--mirai-ui-font);
|
|
9
|
+
--mirai-ui-button-font-weight: var(--mirai-ui-font-weight);
|
|
8
10
|
--mirai-ui-button-outlined-background: var(--mirai-ui-base);
|
|
9
|
-
--mirai-ui-button-padding-
|
|
10
|
-
--mirai-ui-button-padding-
|
|
11
|
+
--mirai-ui-button-padding-y: var(--mirai-ui-space-S);
|
|
12
|
+
--mirai-ui-button-padding-x: var(--mirai-ui-space-L);
|
|
11
13
|
--mirai-ui-button-radius: var(--mirai-ui-border-radius);
|
|
14
|
+
--mirai-ui-button-squared: calc(var(--mirai-ui-space-M) * 2);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
.button {
|
|
@@ -17,11 +20,11 @@
|
|
|
17
20
|
border-radius: var(--mirai-ui-button-radius);
|
|
18
21
|
color: var(--mirai-ui-button-color);
|
|
19
22
|
display: flex;
|
|
20
|
-
font-family: var(--mirai-ui-font);
|
|
23
|
+
font-family: var(--mirai-ui-button-font);
|
|
21
24
|
font-size: var(--mirai-ui-font-size-action);
|
|
22
|
-
font-weight: var(--mirai-ui-font-
|
|
25
|
+
font-weight: var(--mirai-ui-button-font-weight);
|
|
23
26
|
justify-content: center;
|
|
24
|
-
padding: var(--mirai-ui-button-padding-
|
|
27
|
+
padding: var(--mirai-ui-button-padding-y) var(--mirai-ui-button-padding-x);
|
|
25
28
|
transition: background-color var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
26
29
|
box-shadow var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
27
30
|
color var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
@@ -34,8 +37,8 @@
|
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
.outlined {
|
|
37
|
-
border: solid 1px var(--mirai-ui-button-background);
|
|
38
40
|
background-color: var(--mirai-ui-button-outlined-background);
|
|
41
|
+
border: solid 1px var(--mirai-ui-button-background);
|
|
39
42
|
color: var(--mirai-ui-button-background);
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -45,11 +48,13 @@
|
|
|
45
48
|
|
|
46
49
|
.large:not(.squared) {
|
|
47
50
|
font-size: var(--mirai-ui-font-size-headline);
|
|
51
|
+
padding: var(--mirai-ui-button-padding-y)
|
|
52
|
+
calc(var(--mirai-ui-button-padding-x) + calc(var(--mirai-ui-button-padding-y) / 2));
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
.small:not(.squared) {
|
|
51
56
|
font-size: var(--mirai-ui-font-size-small);
|
|
52
|
-
padding:
|
|
57
|
+
padding: var(--mirai-ui-button-padding-y) calc(var(--mirai-ui-button-padding-x) / 2);
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
.rounded {
|
|
@@ -57,22 +62,10 @@
|
|
|
57
62
|
}
|
|
58
63
|
|
|
59
64
|
.squared {
|
|
65
|
+
height: var(--mirai-ui-button-squared);
|
|
60
66
|
padding: 0;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
width: var(--mirai-ui-space-XL);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.squared.small {
|
|
67
|
-
height: var(--mirai-ui-space-L);
|
|
68
|
-
min-width: var(--mirai-ui-space-L);
|
|
69
|
-
width: var(--mirai-ui-space-L);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.squared.large {
|
|
73
|
-
height: var(--mirai-ui-space-XXL);
|
|
74
|
-
min-width: var(--mirai-ui-space-XXL);
|
|
75
|
-
width: var(--mirai-ui-space-XXL);
|
|
67
|
+
min-width: var(--mirai-ui-button-squared);
|
|
68
|
+
width: var(--mirai-ui-button-squared);
|
|
76
69
|
}
|
|
77
70
|
|
|
78
71
|
@media only screen and (max-width: 600px) {
|
|
@@ -1,15 +1,5 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[` 1`] = `
|
|
4
|
-
<DocumentFragment>
|
|
5
|
-
<button
|
|
6
|
-
class="pressable button squared"
|
|
7
|
-
>
|
|
8
|
-
children
|
|
9
|
-
</button>
|
|
10
|
-
</DocumentFragment>
|
|
11
|
-
`;
|
|
12
|
-
|
|
13
3
|
exports[`component:<Button> inherit:className 1`] = `
|
|
14
4
|
<DocumentFragment>
|
|
15
5
|
<button
|
|
@@ -61,20 +51,10 @@ exports[`component:<Button> prop:small 1`] = `
|
|
|
61
51
|
</DocumentFragment>
|
|
62
52
|
`;
|
|
63
53
|
|
|
64
|
-
exports[`component:<Button> prop:squared
|
|
54
|
+
exports[`component:<Button> prop:squared 1`] = `
|
|
65
55
|
<DocumentFragment>
|
|
66
56
|
<button
|
|
67
|
-
class="pressable button
|
|
68
|
-
>
|
|
69
|
-
children
|
|
70
|
-
</button>
|
|
71
|
-
</DocumentFragment>
|
|
72
|
-
`;
|
|
73
|
-
|
|
74
|
-
exports[`component:<Button> prop:squared & small 1`] = `
|
|
75
|
-
<DocumentFragment>
|
|
76
|
-
<button
|
|
77
|
-
class="pressable button small squared"
|
|
57
|
+
class="pressable button squared"
|
|
78
58
|
>
|
|
79
59
|
children
|
|
80
60
|
</button>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-calendar-cell:
|
|
2
|
+
--mirai-ui-calendar-cell: var(--mirai-ui-space-XL);
|
|
3
3
|
--mirai-ui-calendar-highlight-color: var(--mirai-ui-accent);
|
|
4
4
|
--mirai-ui-calendar-week-margin: 2px;
|
|
5
|
-
--mirai-ui-calendar-hover-background: var(--mirai-ui-accent-
|
|
5
|
+
--mirai-ui-calendar-hover-background: var(--mirai-ui-accent-background);
|
|
6
6
|
--mirai-ui-calendar-selected-background: var(--mirai-ui-accent);
|
|
7
7
|
--mirai-ui-calendar-selected-color: var(--mirai-ui-base);
|
|
8
|
-
--mirai-ui-calendar-weekday-color: var(--mirai-ui-content-
|
|
8
|
+
--mirai-ui-calendar-weekday-color: var(--mirai-ui-content-light);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.scrollview {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
.textDisabled {
|
|
69
|
-
color: var(--mirai-ui-content-
|
|
69
|
+
color: var(--mirai-ui-content-border);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
.textHighlight {
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
.caption.empty {
|
|
89
|
-
color: var(--mirai-ui-content-
|
|
89
|
+
color: var(--mirai-ui-content-border);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
@media only screen and (max-width: 600px) {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
.weekdays {
|
|
107
|
-
border-bottom: solid 1px var(--mirai-ui-content-
|
|
107
|
+
border-bottom: solid 1px var(--mirai-ui-content-border);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -36,7 +36,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
36
36
|
min = _ref$min === void 0 ? 0 : _ref$min,
|
|
37
37
|
name = _ref.name,
|
|
38
38
|
_ref$rounded = _ref.rounded,
|
|
39
|
-
rounded = _ref$rounded === void 0 ?
|
|
39
|
+
rounded = _ref$rounded === void 0 ? true : _ref$rounded,
|
|
40
40
|
_ref$step = _ref.step,
|
|
41
41
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
42
42
|
_ref$value = _ref.value,
|
|
@@ -51,6 +51,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
51
51
|
}), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
52
52
|
className: _InputNumberModule.default.texts
|
|
53
53
|
}, label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
54
|
+
subheadline: true,
|
|
54
55
|
className: disabled && _InputNumberModule.default.disabled
|
|
55
56
|
}, label), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
56
57
|
small: true,
|
|
@@ -67,6 +68,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
67
68
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
68
69
|
name: "Minus"
|
|
69
70
|
})), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
71
|
+
headline: true,
|
|
70
72
|
className: _InputNumberModule.default.value
|
|
71
73
|
}, typeof value === 'number' ? value : min), /*#__PURE__*/_react.default.createElement(_Button.Button, {
|
|
72
74
|
disabled: disabled || value >= max,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","style","inputNumber","className","texts","propTypes","PropTypes","bool","oneOfType","string","array","number","isRequired","func"],"sources":["../../../src/components/InputNumber/InputNumber.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport style from './InputNumber.module.css';\n\nexport const InputNumber = ({\n disabled,\n hint,\n label,\n max,\n min = 0,\n name,\n rounded =
|
|
1
|
+
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","style","inputNumber","className","texts","propTypes","PropTypes","bool","oneOfType","string","array","number","isRequired","func"],"sources":["../../../src/components/InputNumber/InputNumber.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport style from './InputNumber.module.css';\n\nexport const InputNumber = ({\n disabled,\n hint,\n label,\n max,\n min = 0,\n name,\n rounded = true,\n step = 1,\n value = 0,\n onChange = () => {},\n ...others\n}) => (\n <View {...others} row className={styles(style.inputNumber, others.className)}>\n <View className={style.texts}>\n {label && (\n <Text subheadline className={disabled && style.disabled}>\n {label}\n </Text>\n )}\n {hint && (\n <Text small className={styles(style.hint, disabled && style.disabled)}>\n {hint}\n </Text>\n )}\n </View>\n <Button\n disabled={disabled || value <= min}\n outlined\n preventDefault\n rounded={rounded}\n squared\n onPress={() => onChange(value - step, name)}\n >\n <Icon name=\"Minus\" />\n </Button>\n <Text headline className={style.value}>\n {typeof value === 'number' ? value : min}\n </Text>\n <Button\n disabled={disabled || value >= max}\n outlined\n preventDefault\n rounded={rounded}\n squared\n onPress={() => onChange(value + step, name)}\n >\n <Icon name=\"Plus\" />\n </Button>\n </View>\n);\n\nInputNumber.propTypes = {\n disabled: PropTypes.bool,\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n label: PropTypes.string,\n max: PropTypes.number,\n min: PropTypes.number,\n name: PropTypes.string.isRequired,\n rounded: PropTypes.bool,\n step: PropTypes.number,\n value: PropTypes.number,\n onChange: PropTypes.func,\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc;EAAA,IACzBC,QADyB,QACzBA,QADyB;EAAA,IAEzBC,IAFyB,QAEzBA,IAFyB;EAAA,IAGzBC,KAHyB,QAGzBA,KAHyB;EAAA,IAIzBC,GAJyB,QAIzBA,GAJyB;EAAA,oBAKzBC,GALyB;EAAA,IAKzBA,GALyB,yBAKnB,CALmB;EAAA,IAMzBC,IANyB,QAMzBA,IANyB;EAAA,wBAOzBC,OAPyB;EAAA,IAOzBA,OAPyB,6BAOf,IAPe;EAAA,qBAQzBC,IARyB;EAAA,IAQzBA,IARyB,0BAQlB,CARkB;EAAA,sBASzBC,KATyB;EAAA,IASzBA,KATyB,2BASjB,C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GD,IAAT,EAAeF,IAAf,CAAd;IAAA;EANX,gBAQE,6BAAC,gBAAD;IAAM,IAAI,EAAC;EAAX,EARF,CA1BF,CAbyB;AAAA,CAApB;;;AAoDPN,WAAW,CAACgB,SAAZ,GAAwB;EACtBf,QAAQ,EAAEgB,mBAAUC,IADE;EAEtBhB,IAAI,EAAEe,mBAAUE,SAAV,CAAoB,CAACF,mBAAUG,MAAX,EAAmBH,mBAAUI,KAA7B,CAApB,CAFgB;EAGtBlB,KAAK,EAAEc,mBAAUG,MAHK;EAItBhB,GAAG,EAAEa,mBAAUK,MAJO;EAKtBjB,GAAG,EAAEY,mBAAUK,MALO;EAMtBhB,IAAI,EAAEW,mBAAUG,MAAV,CAAiBG,UAND;EAOtBhB,OAAO,EAAEU,mBAAUC,IAPG;EAQtBV,IAAI,EAAES,mBAAUK,MARM;EAStBb,KAAK,EAAEQ,mBAAUK,MATK;EAUtBZ,QAAQ,EAAEO,mBAAUO;AAVE,CAAxB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-input-number-value-width: var(--mirai-ui-space-
|
|
2
|
+
--mirai-ui-input-number-value-width: var(--mirai-ui-space-XL);
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.inputNumber {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.hint {
|
|
20
|
-
color: var(--mirai-ui-
|
|
20
|
+
color: var(--mirai-ui-content-light);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.disabled {
|
|
@@ -9,7 +9,7 @@ exports[`component:<InputNumber> inherit:className 1`] = `
|
|
|
9
9
|
class="view texts"
|
|
10
10
|
/>
|
|
11
11
|
<button
|
|
12
|
-
class="pressable button squared"
|
|
12
|
+
class="pressable button rounded squared"
|
|
13
13
|
disabled=""
|
|
14
14
|
>
|
|
15
15
|
<span
|
|
@@ -36,12 +36,12 @@ exports[`component:<InputNumber> inherit:className 1`] = `
|
|
|
36
36
|
</span>
|
|
37
37
|
</button>
|
|
38
38
|
<span
|
|
39
|
-
class="text
|
|
39
|
+
class="text headline value"
|
|
40
40
|
>
|
|
41
41
|
0
|
|
42
42
|
</span>
|
|
43
43
|
<button
|
|
44
|
-
class="pressable button squared outlined"
|
|
44
|
+
class="pressable button rounded squared outlined"
|
|
45
45
|
>
|
|
46
46
|
<span
|
|
47
47
|
class="icon"
|
|
@@ -85,7 +85,7 @@ exports[`component:<InputNumber> prop:disabled 1`] = `
|
|
|
85
85
|
class="view texts"
|
|
86
86
|
/>
|
|
87
87
|
<button
|
|
88
|
-
class="pressable button squared"
|
|
88
|
+
class="pressable button rounded squared"
|
|
89
89
|
disabled=""
|
|
90
90
|
>
|
|
91
91
|
<span
|
|
@@ -112,12 +112,12 @@ exports[`component:<InputNumber> prop:disabled 1`] = `
|
|
|
112
112
|
</span>
|
|
113
113
|
</button>
|
|
114
114
|
<span
|
|
115
|
-
class="text
|
|
115
|
+
class="text headline value"
|
|
116
116
|
>
|
|
117
117
|
0
|
|
118
118
|
</span>
|
|
119
119
|
<button
|
|
120
|
-
class="pressable button squared"
|
|
120
|
+
class="pressable button rounded squared"
|
|
121
121
|
disabled=""
|
|
122
122
|
>
|
|
123
123
|
<span
|
|
@@ -168,7 +168,7 @@ exports[`component:<InputNumber> prop:hint 1`] = `
|
|
|
168
168
|
</span>
|
|
169
169
|
</div>
|
|
170
170
|
<button
|
|
171
|
-
class="pressable button squared"
|
|
171
|
+
class="pressable button rounded squared"
|
|
172
172
|
disabled=""
|
|
173
173
|
>
|
|
174
174
|
<span
|
|
@@ -195,12 +195,12 @@ exports[`component:<InputNumber> prop:hint 1`] = `
|
|
|
195
195
|
</span>
|
|
196
196
|
</button>
|
|
197
197
|
<span
|
|
198
|
-
class="text
|
|
198
|
+
class="text headline value"
|
|
199
199
|
>
|
|
200
200
|
0
|
|
201
201
|
</span>
|
|
202
202
|
<button
|
|
203
|
-
class="pressable button squared outlined"
|
|
203
|
+
class="pressable button rounded squared outlined"
|
|
204
204
|
>
|
|
205
205
|
<span
|
|
206
206
|
class="icon"
|
|
@@ -244,13 +244,13 @@ exports[`component:<InputNumber> prop:label 1`] = `
|
|
|
244
244
|
class="view texts"
|
|
245
245
|
>
|
|
246
246
|
<span
|
|
247
|
-
class="text
|
|
247
|
+
class="text subheadline"
|
|
248
248
|
>
|
|
249
249
|
label
|
|
250
250
|
</span>
|
|
251
251
|
</div>
|
|
252
252
|
<button
|
|
253
|
-
class="pressable button squared"
|
|
253
|
+
class="pressable button rounded squared"
|
|
254
254
|
disabled=""
|
|
255
255
|
>
|
|
256
256
|
<span
|
|
@@ -277,12 +277,12 @@ exports[`component:<InputNumber> prop:label 1`] = `
|
|
|
277
277
|
</span>
|
|
278
278
|
</button>
|
|
279
279
|
<span
|
|
280
|
-
class="text
|
|
280
|
+
class="text headline value"
|
|
281
281
|
>
|
|
282
282
|
0
|
|
283
283
|
</span>
|
|
284
284
|
<button
|
|
285
|
-
class="pressable button squared outlined"
|
|
285
|
+
class="pressable button rounded squared outlined"
|
|
286
286
|
>
|
|
287
287
|
<span
|
|
288
288
|
class="icon"
|
|
@@ -326,7 +326,7 @@ exports[`component:<InputNumber> prop:max 1`] = `
|
|
|
326
326
|
class="view texts"
|
|
327
327
|
/>
|
|
328
328
|
<button
|
|
329
|
-
class="pressable button squared outlined"
|
|
329
|
+
class="pressable button rounded squared outlined"
|
|
330
330
|
>
|
|
331
331
|
<span
|
|
332
332
|
class="icon"
|
|
@@ -352,12 +352,12 @@ exports[`component:<InputNumber> prop:max 1`] = `
|
|
|
352
352
|
</span>
|
|
353
353
|
</button>
|
|
354
354
|
<span
|
|
355
|
-
class="text
|
|
355
|
+
class="text headline value"
|
|
356
356
|
>
|
|
357
357
|
10
|
|
358
358
|
</span>
|
|
359
359
|
<button
|
|
360
|
-
class="pressable button squared"
|
|
360
|
+
class="pressable button rounded squared"
|
|
361
361
|
disabled=""
|
|
362
362
|
>
|
|
363
363
|
<span
|
|
@@ -402,7 +402,7 @@ exports[`component:<InputNumber> prop:min 1`] = `
|
|
|
402
402
|
class="view texts"
|
|
403
403
|
/>
|
|
404
404
|
<button
|
|
405
|
-
class="pressable button squared"
|
|
405
|
+
class="pressable button rounded squared"
|
|
406
406
|
disabled=""
|
|
407
407
|
>
|
|
408
408
|
<span
|
|
@@ -429,12 +429,12 @@ exports[`component:<InputNumber> prop:min 1`] = `
|
|
|
429
429
|
</span>
|
|
430
430
|
</button>
|
|
431
431
|
<span
|
|
432
|
-
class="text
|
|
432
|
+
class="text headline value"
|
|
433
433
|
>
|
|
434
434
|
10
|
|
435
435
|
</span>
|
|
436
436
|
<button
|
|
437
|
-
class="pressable button squared outlined"
|
|
437
|
+
class="pressable button rounded squared outlined"
|
|
438
438
|
>
|
|
439
439
|
<span
|
|
440
440
|
class="icon"
|
|
@@ -504,7 +504,7 @@ exports[`component:<InputNumber> prop:rounded 1`] = `
|
|
|
504
504
|
</span>
|
|
505
505
|
</button>
|
|
506
506
|
<span
|
|
507
|
-
class="text
|
|
507
|
+
class="text headline value"
|
|
508
508
|
>
|
|
509
509
|
10
|
|
510
510
|
</span>
|
|
@@ -553,7 +553,7 @@ exports[`component:<InputNumber> prop:value 1`] = `
|
|
|
553
553
|
class="view texts"
|
|
554
554
|
/>
|
|
555
555
|
<button
|
|
556
|
-
class="pressable button squared outlined"
|
|
556
|
+
class="pressable button rounded squared outlined"
|
|
557
557
|
>
|
|
558
558
|
<span
|
|
559
559
|
class="icon"
|
|
@@ -579,12 +579,12 @@ exports[`component:<InputNumber> prop:value 1`] = `
|
|
|
579
579
|
</span>
|
|
580
580
|
</button>
|
|
581
581
|
<span
|
|
582
|
-
class="text
|
|
582
|
+
class="text headline value"
|
|
583
583
|
>
|
|
584
584
|
10
|
|
585
585
|
</span>
|
|
586
586
|
<button
|
|
587
|
-
class="pressable button squared outlined"
|
|
587
|
+
class="pressable button rounded squared outlined"
|
|
588
588
|
>
|
|
589
589
|
<span
|
|
590
590
|
class="icon"
|
|
@@ -628,7 +628,7 @@ exports[`component:<InputNumber> renders 1`] = `
|
|
|
628
628
|
class="view texts"
|
|
629
629
|
/>
|
|
630
630
|
<button
|
|
631
|
-
class="pressable button squared"
|
|
631
|
+
class="pressable button rounded squared"
|
|
632
632
|
disabled=""
|
|
633
633
|
>
|
|
634
634
|
<span
|
|
@@ -655,12 +655,12 @@ exports[`component:<InputNumber> renders 1`] = `
|
|
|
655
655
|
</span>
|
|
656
656
|
</button>
|
|
657
657
|
<span
|
|
658
|
-
class="text
|
|
658
|
+
class="text headline value"
|
|
659
659
|
>
|
|
660
660
|
0
|
|
661
661
|
</span>
|
|
662
662
|
<button
|
|
663
|
-
class="pressable button squared outlined"
|
|
663
|
+
class="pressable button rounded squared outlined"
|
|
664
664
|
>
|
|
665
665
|
<span
|
|
666
666
|
class="icon"
|
|
@@ -705,7 +705,7 @@ exports[`component:<InputNumber> testID 1`] = `
|
|
|
705
705
|
class="view texts"
|
|
706
706
|
/>
|
|
707
707
|
<button
|
|
708
|
-
class="pressable button squared"
|
|
708
|
+
class="pressable button rounded squared"
|
|
709
709
|
disabled=""
|
|
710
710
|
>
|
|
711
711
|
<span
|
|
@@ -732,12 +732,12 @@ exports[`component:<InputNumber> testID 1`] = `
|
|
|
732
732
|
</span>
|
|
733
733
|
</button>
|
|
734
734
|
<span
|
|
735
|
-
class="text
|
|
735
|
+
class="text headline value"
|
|
736
736
|
>
|
|
737
737
|
0
|
|
738
738
|
</span>
|
|
739
739
|
<button
|
|
740
|
-
class="pressable button squared outlined"
|
|
740
|
+
class="pressable button rounded squared outlined"
|
|
741
741
|
>
|
|
742
742
|
<span
|
|
743
743
|
class="icon"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-input-option-disabled: var(--mirai-ui-content-
|
|
2
|
+
--mirai-ui-input-option-disabled: var(--mirai-ui-content-light);
|
|
3
3
|
--mirai-ui-input-option-label-margin: var(--mirai-ui-space-S);
|
|
4
4
|
--mirai-ui-input-option-padding-y: var(--mirai-ui-space-S);
|
|
5
5
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-input-text-border: solid 1px var(--mirai-ui-content-
|
|
2
|
+
--mirai-ui-input-text-border: solid 1px var(--mirai-ui-content-border);
|
|
3
3
|
--mirai-ui-input-text-focus: var(--mirai-ui-accent);
|
|
4
4
|
--mirai-ui-input-text-padding-x: var(--mirai-ui-space-S);
|
|
5
5
|
--mirai-ui-input-text-padding-y: var(--mirai-ui-space-S);
|
|
6
6
|
--mirai-ui-input-text-radius: var(--mirai-ui-border-radius);
|
|
7
|
-
--mirai-ui-input-text-disabled: var(--mirai-ui-content-
|
|
7
|
+
--mirai-ui-input-text-disabled: var(--mirai-ui-content-border);
|
|
8
8
|
--mirai-ui-input-text-error: var(--mirai-ui-error);
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
padding: 0 calc(var(--mirai-ui-input-text-padding-x) / 2);
|
|
80
80
|
pointer-events: none;
|
|
81
81
|
position: absolute;
|
|
82
|
-
top: var(--mirai-ui-input-text-padding-y);
|
|
82
|
+
top: calc(var(--mirai-ui-input-text-padding-y) / 1.3);
|
|
83
83
|
transition: font-size var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
84
84
|
top var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
85
85
|
z-index: 1;
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
|
|
88
88
|
.label.value {
|
|
89
89
|
font-size: var(--mirai-ui-font-size-small);
|
|
90
|
-
top: calc(
|
|
90
|
+
top: calc(var(--mirai-ui-input-text-padding-y) * -1);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
.text {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Notification = void 0;
|
|
7
|
+
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _helpers = require("../../helpers");
|
|
13
|
+
|
|
14
|
+
var _primitives = require("../../primitives");
|
|
15
|
+
|
|
16
|
+
var _NotificationModule = _interopRequireDefault(require("./Notification.module.css"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["children", "error", "success", "title", "warning", "onClose"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function _extends() { _extends = Object.assign || 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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
27
|
+
|
|
28
|
+
var Notification = function Notification(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
error = _ref.error,
|
|
31
|
+
success = _ref.success,
|
|
32
|
+
title = _ref.title,
|
|
33
|
+
warning = _ref.warning,
|
|
34
|
+
onClose = _ref.onClose,
|
|
35
|
+
others = _objectWithoutProperties(_ref, _excluded);
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_primitives.View, _extends({}, others, {
|
|
38
|
+
row: true,
|
|
39
|
+
className: (0, _helpers.styles)(_NotificationModule.default.notification, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : undefined, others.className)
|
|
40
|
+
}), /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
41
|
+
name: error ? 'Error' : warning ? 'Warning' : success ? 'Success' : 'Info',
|
|
42
|
+
className: _NotificationModule.default.icon
|
|
43
|
+
}), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
44
|
+
className: (0, _helpers.styles)(_NotificationModule.default.text, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : undefined)
|
|
45
|
+
}, title && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
46
|
+
bold: true,
|
|
47
|
+
action: true
|
|
48
|
+
}, "Title"), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
49
|
+
action: true
|
|
50
|
+
}, children)), onClose && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
51
|
+
className: _NotificationModule.default.pressable,
|
|
52
|
+
onPress: onClose
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
54
|
+
name: "Close",
|
|
55
|
+
className: _NotificationModule.default.icon
|
|
56
|
+
})));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.Notification = Notification;
|
|
60
|
+
Notification.displayName = 'Component:Notification';
|
|
61
|
+
Notification.propTypes = {
|
|
62
|
+
children: _propTypes.default.string.isRequired,
|
|
63
|
+
error: _propTypes.default.bool,
|
|
64
|
+
success: _propTypes.default.bool,
|
|
65
|
+
title: _propTypes.default.string,
|
|
66
|
+
warning: _propTypes.default.bool,
|
|
67
|
+
onClose: _propTypes.default.func
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=Notification.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["Notification","children","error","success","title","warning","onClose","others","style","notification","undefined","className","icon","text","pressable","displayName","propTypes","PropTypes","string","isRequired","bool","func"],"sources":["../../../src/components/Notification/Notification.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport style from './Notification.module.css';\n\nconst Notification = ({ children, error, success, title, warning, onClose, ...others }) => (\n <View\n {...others}\n row\n className={styles(\n style.notification,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n others.className,\n )}\n >\n <Icon name={error ? 'Error' : warning ? 'Warning' : success ? 'Success' : 'Info'} className={style.icon} />\n <View\n className={styles(\n style.text,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n >\n {title && (\n <Text bold action>\n Title\n </Text>\n )}\n <Text action>{children}</Text>\n </View>\n {onClose && (\n <Pressable className={style.pressable} onPress={onClose}>\n <Icon name=\"Close\" className={style.icon} />\n </Pressable>\n )}\n </View>\n);\n\nNotification.displayName = 'Component:Notification';\n\nNotification.propTypes = {\n children: PropTypes.string.isRequired,\n error: PropTypes.bool,\n success: PropTypes.bool,\n title: PropTypes.string,\n warning: PropTypes.bool,\n onClose: PropTypes.func,\n};\n\nexport { Notification };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,YAAY,GAAG,SAAfA,YAAe;EAAA,IAAGC,QAAH,QAAGA,QAAH;EAAA,IAAaC,KAAb,QAAaA,KAAb;EAAA,IAAoBC,OAApB,QAAoBA,OAApB;EAAA,IAA6BC,KAA7B,QAA6BA,KAA7B;EAAA,IAAoCC,OAApC,QAAoCA,OAApC;EAAA,IAA6CC,OAA7C,QAA6CA,OAA7C;EAAA,IAAyDC,MAAzD;;EAAA,oBACnB,6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AUI;AANI,CAAzB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--mirai-ui-notification-border-radius: var(--mirai-ui-border-radius);
|
|
3
|
+
--mirai-ui-notification-padding: var(--mirai-ui-space-S);
|
|
4
|
+
--mirai-ui-notification-icon: var(--mirai-ui-font-size-headline);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.notification {
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
background-color: var(--mirai-ui-accent-background);
|
|
10
|
+
border-radius: var(--mirai-ui-notification-border-radius);
|
|
11
|
+
padding: var(--mirai-ui-notification-padding);
|
|
12
|
+
border: solid 1px var(--mirai-ui-accent-border);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.notification * {
|
|
16
|
+
color: var(--mirai-ui-accent);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.notification.success {
|
|
20
|
+
background-color: var(--mirai-ui-success-background);
|
|
21
|
+
border-color: var(--mirai-ui-success-border);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.notification.success * {
|
|
25
|
+
color: var(--mirai-ui-success);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.notification.error {
|
|
29
|
+
background-color: var(--mirai-ui-error-background);
|
|
30
|
+
border-color: var(--mirai-ui-error-border);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.notification.error * {
|
|
34
|
+
color: var(--mirai-ui-error);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.notification.warning {
|
|
38
|
+
background-color: var(--mirai-ui-warning-background);
|
|
39
|
+
border-color: var(--mirai-ui-warning-border);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.notification.warning * {
|
|
43
|
+
color: var(--mirai-ui-warning);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.icon {
|
|
47
|
+
line-height: var(--mirai-ui-notification-icon);
|
|
48
|
+
height: var(--mirai-ui-notification-icon);
|
|
49
|
+
width: var(--mirai-ui-notification-icon);
|
|
50
|
+
font-size: var(--mirai-ui-notification-icon);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.text {
|
|
54
|
+
flex: 1;
|
|
55
|
+
padding-left: var(--mirai-ui-notification-padding);
|
|
56
|
+
padding-right: var(--mirai-ui-notification-padding);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.text * {
|
|
60
|
+
color: var(--mirai-ui-accent-dark);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.text.error * {
|
|
64
|
+
color: var(--mirai-ui-error-dark);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.text.success * {
|
|
68
|
+
color: var(--mirai-ui-success-dark);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.text.warning * {
|
|
72
|
+
color: var(--mirai-ui-warning-dark);
|
|
73
|
+
}
|