@mirai/ui 1.0.115 → 1.0.117
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 +25 -18
- package/build/components/Calendar/Calendar.Month.js +0 -2
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +64 -64
- package/build/components/Form/Form.stories.js +1 -1
- package/build/components/Form/Form.stories.js.map +1 -1
- package/build/components/InputText/InputText.js +0 -1
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.module.css +8 -0
- package/build/components/Modal/Modal.js +0 -2
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +6 -6
- package/build/components/Notification/Notification.js +2 -2
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +4 -2
- package/build/primitives/Input/Input.module.css +13 -11
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.button {
|
|
1
|
+
button.button {
|
|
2
2
|
align-items: center;
|
|
3
3
|
background-color: var(--mirai-ui-button-background);
|
|
4
4
|
border-radius: var(--mirai-ui-button-radius);
|
|
@@ -13,76 +13,83 @@
|
|
|
13
13
|
width: fit-content;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.button
|
|
16
|
+
button.button {
|
|
17
|
+
background-color: var(--mirai-ui-button-background);
|
|
18
|
+
color: var(--mirai-ui-button-color);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
button.button:disabled:not(.busy) {
|
|
17
22
|
background-color: var(--mirai-ui-button-disabled-background);
|
|
18
23
|
color: var(--mirai-ui-button-disabled-color);
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
.button:
|
|
26
|
+
button.button:hover {
|
|
27
|
+
color: var(--mirai-ui-button-color);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button.button:not(.secondary):not(:disabled):active {
|
|
22
31
|
box-shadow: inset 0 0 var(--mirai-ui-space-XL) var(--mirai-ui-space-XL) var(--mirai-ui-button-color-active);
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
.button.secondary:not(:disabled):active {
|
|
34
|
+
button.button.secondary:not(:disabled):active {
|
|
26
35
|
background-color: var(--mirai-ui-button-color-hover);
|
|
27
36
|
box-shadow: none;
|
|
28
37
|
color: var(--mirai-ui-button-color);
|
|
29
38
|
}
|
|
30
39
|
|
|
31
|
-
.large:not(.squared) {
|
|
40
|
+
button.large:not(.squared) {
|
|
32
41
|
font-size: var(--mirai-ui-font-size-paragraph);
|
|
33
42
|
padding: var(--mirai-ui-button-padding-y)
|
|
34
43
|
calc(var(--mirai-ui-button-padding-x) + calc(var(--mirai-ui-button-padding-y) / 2));
|
|
35
44
|
}
|
|
36
45
|
|
|
37
|
-
.secondary {
|
|
46
|
+
button.secondary {
|
|
38
47
|
background-color: var(--mirai-ui-button-secondary-background);
|
|
39
48
|
box-shadow: inset 0 0 0 var(--mirai-ui-border-width) var(--mirai-ui-button-background);
|
|
40
49
|
color: var(--mirai-ui-button-background);
|
|
41
50
|
}
|
|
42
51
|
|
|
43
|
-
.secondary.disabled:not(.busy) {
|
|
52
|
+
button.secondary.disabled:not(.busy) {
|
|
44
53
|
box-shadow: none;
|
|
45
54
|
}
|
|
46
55
|
|
|
47
|
-
.rounded {
|
|
56
|
+
button.rounded {
|
|
48
57
|
border-radius: var(--mirai-ui-space-XXL);
|
|
49
58
|
}
|
|
50
59
|
|
|
51
|
-
.small:not(.squared) {
|
|
60
|
+
button.small:not(.squared) {
|
|
52
61
|
font-size: var(--mirai-ui-font-size-small);
|
|
53
62
|
padding: var(--mirai-ui-button-padding-y) calc(var(--mirai-ui-button-padding-x) / 2);
|
|
54
63
|
}
|
|
55
64
|
|
|
56
|
-
.squared {
|
|
65
|
+
button.squared {
|
|
57
66
|
height: var(--mirai-ui-button-squared);
|
|
58
67
|
padding: 0;
|
|
59
68
|
min-width: var(--mirai-ui-button-squared);
|
|
60
69
|
width: var(--mirai-ui-button-squared);
|
|
61
70
|
}
|
|
62
71
|
|
|
63
|
-
.wide {
|
|
72
|
+
button.wide {
|
|
64
73
|
width: 100%;
|
|
65
74
|
}
|
|
66
75
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
.button .children,
|
|
70
|
-
.button .spinner {
|
|
76
|
+
button.button .children,
|
|
77
|
+
button.button .spinner {
|
|
71
78
|
transition: opacity var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
72
79
|
transform var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
73
80
|
}
|
|
74
81
|
|
|
75
|
-
.button.busy .children {
|
|
82
|
+
button.button.busy .children {
|
|
76
83
|
opacity: 0;
|
|
77
84
|
transform: translateY(var(--mirai-ui-space-XL));
|
|
78
85
|
}
|
|
79
86
|
|
|
80
|
-
.button .spinner {
|
|
87
|
+
button.button .spinner {
|
|
81
88
|
opacity: 0;
|
|
82
89
|
transform: translateY(calc(var(--mirai-ui-space-XL) * -1));
|
|
83
90
|
}
|
|
84
91
|
|
|
85
|
-
.button.busy .spinner {
|
|
92
|
+
button.button.busy .spinner {
|
|
86
93
|
opacity: 1;
|
|
87
94
|
transform: translateY(0%);
|
|
88
95
|
}
|
|
@@ -54,7 +54,6 @@ var Month = function Month(_ref) {
|
|
|
54
54
|
row: true,
|
|
55
55
|
className: _CalendarModule.default.header
|
|
56
56
|
}, onPrevious && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
57
|
-
tag: "button",
|
|
58
57
|
onPress: onPrevious,
|
|
59
58
|
"data-testid": testID ? "".concat(testID, "-previous") : undefined
|
|
60
59
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
@@ -65,7 +64,6 @@ var Month = function Month(_ref) {
|
|
|
65
64
|
level: 4,
|
|
66
65
|
className: _CalendarModule.default.title
|
|
67
66
|
}, (0, _helpers2.getHeader)(instance, locale)), onNext && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
68
|
-
tag: "button",
|
|
69
67
|
onPress: onNext,
|
|
70
68
|
"data-testid": testID ? "".concat(testID, "-next") : undefined
|
|
71
69
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","timestamp","to","onChange","onFocus","onNext","onPrevious","others","useDevice","isDesktop","weekNumber","getWeekNumber","testID","styles","style","month","className","header","undefined","ICON","LEFT","title","getHeader","RIGHT","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","number","tooltips","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n timestamp,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable
|
|
1
|
+
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","timestamp","to","onChange","onFocus","onNext","onPrevious","others","useDevice","isDesktop","weekNumber","getWeekNumber","testID","styles","style","month","className","header","undefined","ICON","LEFT","title","getHeader","RIGHT","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","number","tooltips","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n timestamp,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable onPress={onPrevious} data-testid={testID ? `${testID}-previous` : undefined}>\n <Icon value={ICON.LEFT} />\n </Pressable>\n )}\n <Text bold headline level={4} className={style.title}>\n {getHeader(instance, locale)}\n </Text>\n {onNext && (\n <Pressable onPress={onNext} data-testid={testID ? `${testID}-next` : undefined}>\n <Icon value={ICON.RIGHT} />\n </Pressable>\n )}\n </View>\n\n {isDesktop && <Weekdays locale={locale} />}\n\n {VISIBLE_WEEKS.map((week) => (\n <Week\n {...{\n ...others,\n disabledPast,\n focus,\n format,\n from,\n locale,\n range,\n selected,\n timestamp,\n to,\n }}\n key={week}\n month={instance.getMonth()}\n number={weekNumber + week}\n year={instance.getFullYear()}\n onFocus={onFocus}\n onPress={onChange}\n />\n ))}\n </View>\n );\n};\n\nMonth.displayName = 'Component:Calendar:Month';\n\nMonth.propTypes = {\n captions: PropTypes.shape({}),\n focus: PropTypes.any,\n instance: PropTypes.any,\n selected: PropTypes.any,\n disabledDates: PropTypes.arrayOf(PropTypes.string),\n disabledPast: PropTypes.bool,\n format: PropTypes.string,\n from: PropTypes.instanceOf(Date),\n locale: PropTypes.string,\n range: PropTypes.bool,\n timestamp: PropTypes.number,\n to: PropTypes.instanceOf(Date),\n tooltips: PropTypes.shape({}),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onNext: PropTypes.func,\n onPrevious: PropTypes.func,\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAqD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE9C,IAAMA,KAAK,GAAG,SAARA,KAAK,OAgBZ;EAAA,IAfJC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,QAAQ,QAARA,QAAQ;IACRC,YAAY,QAAZA,YAAY;IACZC,MAAM,QAANA,MAAM;IACNC,IAAI,QAAJA,IAAI;IACJC,MAAM,QAANA,MAAM;IAAA,kBACNC,KAAK;IAALA,KAAK,2BAAG,KAAK;IACbC,SAAS,QAATA,SAAS;IACTC,EAAE,QAAFA,EAAE;IAAA,qBACFC,QAAQ;IAARA,QAAQ,8BAAG,YAAM,CAAC,CAAC;IAAA,oBACnBC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IAClBC,MAAM,QAANA,MAAM;IACNC,UAAU,QAAVA,UAAU;IACPC,MAAM;EAET,iBAAsB,IAAAC,gBAAS,GAAE;IAAzBC,SAAS,cAATA,SAAS;EACjB,IAAMC,UAAU,GAAG,IAAAC,uBAAa,EAACjB,QAAQ,CAAC;EAE1C,IAAyBkB,MAAM,GAAKL,MAAM,CAAjC,aAAa;EAEtB,oBACE,6BAAC,gBAAI;IAAC,SAAS,EAAE,IAAAM,eAA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
|
757
757
|
</h4>
|
|
758
|
-
<
|
|
758
|
+
<div
|
|
759
759
|
class="pressable"
|
|
760
760
|
>
|
|
761
761
|
<span
|
|
@@ -779,7 +779,7 @@ exports[`component:<Calendar> desktop environment prop:captions 1`] = `
|
|
|
779
779
|
/>
|
|
780
780
|
</svg>
|
|
781
781
|
</span>
|
|
782
|
-
</
|
|
782
|
+
</div>
|
|
783
783
|
</div>
|
|
784
784
|
<div
|
|
785
785
|
class="view row weekdays"
|
|
@@ -2130,7 +2130,7 @@ exports[`component:<Calendar> desktop environment prop:disabledDates 1`] = `
|
|
|
2130
2130
|
>
|
|
2131
2131
|
mayo 1980
|
|
2132
2132
|
</h4>
|
|
2133
|
-
<
|
|
2133
|
+
<div
|
|
2134
2134
|
class="pressable"
|
|
2135
2135
|
>
|
|
2136
2136
|
<span
|
|
@@ -2154,7 +2154,7 @@ exports[`component:<Calendar> desktop environment prop:disabledDates 1`] = `
|
|
|
2154
2154
|
/>
|
|
2155
2155
|
</svg>
|
|
2156
2156
|
</span>
|
|
2157
|
-
</
|
|
2157
|
+
</div>
|
|
2158
2158
|
</div>
|
|
2159
2159
|
<div
|
|
2160
2160
|
class="view row weekdays"
|
|
@@ -2759,7 +2759,7 @@ exports[`component:<Calendar> desktop environment prop:disabledPast 1`] = `
|
|
|
2759
2759
|
<div
|
|
2760
2760
|
class="view row header"
|
|
2761
2761
|
>
|
|
2762
|
-
<
|
|
2762
|
+
<div
|
|
2763
2763
|
class="pressable"
|
|
2764
2764
|
>
|
|
2765
2765
|
<span
|
|
@@ -2783,7 +2783,7 @@ exports[`component:<Calendar> desktop environment prop:disabledPast 1`] = `
|
|
|
2783
2783
|
/>
|
|
2784
2784
|
</svg>
|
|
2785
2785
|
</span>
|
|
2786
|
-
</
|
|
2786
|
+
</div>
|
|
2787
2787
|
<h4
|
|
2788
2788
|
class="text bold headline-4 title"
|
|
2789
2789
|
>
|
|
@@ -3375,7 +3375,7 @@ exports[`component:<Calendar> desktop environment prop:disabledPast 1`] = `
|
|
|
3375
3375
|
>
|
|
3376
3376
|
mayo 1980
|
|
3377
3377
|
</h4>
|
|
3378
|
-
<
|
|
3378
|
+
<div
|
|
3379
3379
|
class="pressable"
|
|
3380
3380
|
>
|
|
3381
3381
|
<span
|
|
@@ -3399,7 +3399,7 @@ exports[`component:<Calendar> desktop environment prop:disabledPast 1`] = `
|
|
|
3399
3399
|
/>
|
|
3400
3400
|
</svg>
|
|
3401
3401
|
</span>
|
|
3402
|
-
</
|
|
3402
|
+
</div>
|
|
3403
3403
|
</div>
|
|
3404
3404
|
<div
|
|
3405
3405
|
class="view row weekdays"
|
|
@@ -4595,7 +4595,7 @@ exports[`component:<Calendar> desktop environment prop:format 1`] = `
|
|
|
4595
4595
|
>
|
|
4596
4596
|
mayo 1980
|
|
4597
4597
|
</h4>
|
|
4598
|
-
<
|
|
4598
|
+
<div
|
|
4599
4599
|
class="pressable"
|
|
4600
4600
|
>
|
|
4601
4601
|
<span
|
|
@@ -4619,7 +4619,7 @@ exports[`component:<Calendar> desktop environment prop:format 1`] = `
|
|
|
4619
4619
|
/>
|
|
4620
4620
|
</svg>
|
|
4621
4621
|
</span>
|
|
4622
|
-
</
|
|
4622
|
+
</div>
|
|
4623
4623
|
</div>
|
|
4624
4624
|
<div
|
|
4625
4625
|
class="view row weekdays"
|
|
@@ -5815,7 +5815,7 @@ exports[`component:<Calendar> desktop environment prop:from 1`] = `
|
|
|
5815
5815
|
>
|
|
5816
5816
|
mayo 1980
|
|
5817
5817
|
</h4>
|
|
5818
|
-
<
|
|
5818
|
+
<div
|
|
5819
5819
|
class="pressable"
|
|
5820
5820
|
>
|
|
5821
5821
|
<span
|
|
@@ -5839,7 +5839,7 @@ exports[`component:<Calendar> desktop environment prop:from 1`] = `
|
|
|
5839
5839
|
/>
|
|
5840
5840
|
</svg>
|
|
5841
5841
|
</span>
|
|
5842
|
-
</
|
|
5842
|
+
</div>
|
|
5843
5843
|
</div>
|
|
5844
5844
|
<div
|
|
5845
5845
|
class="view row weekdays"
|
|
@@ -7035,7 +7035,7 @@ exports[`component:<Calendar> desktop environment prop:highlights 1`] = `
|
|
|
7035
7035
|
>
|
|
7036
7036
|
mayo 1980
|
|
7037
7037
|
</h4>
|
|
7038
|
-
<
|
|
7038
|
+
<div
|
|
7039
7039
|
class="pressable"
|
|
7040
7040
|
>
|
|
7041
7041
|
<span
|
|
@@ -7059,7 +7059,7 @@ exports[`component:<Calendar> desktop environment prop:highlights 1`] = `
|
|
|
7059
7059
|
/>
|
|
7060
7060
|
</svg>
|
|
7061
7061
|
</span>
|
|
7062
|
-
</
|
|
7062
|
+
</div>
|
|
7063
7063
|
</div>
|
|
7064
7064
|
<div
|
|
7065
7065
|
class="view row weekdays"
|
|
@@ -8255,7 +8255,7 @@ exports[`component:<Calendar> desktop environment prop:locale 1`] = `
|
|
|
8255
8255
|
>
|
|
8256
8256
|
mayo 1980
|
|
8257
8257
|
</h4>
|
|
8258
|
-
<
|
|
8258
|
+
<div
|
|
8259
8259
|
class="pressable"
|
|
8260
8260
|
>
|
|
8261
8261
|
<span
|
|
@@ -8279,7 +8279,7 @@ exports[`component:<Calendar> desktop environment prop:locale 1`] = `
|
|
|
8279
8279
|
/>
|
|
8280
8280
|
</svg>
|
|
8281
8281
|
</span>
|
|
8282
|
-
</
|
|
8282
|
+
</div>
|
|
8283
8283
|
</div>
|
|
8284
8284
|
<div
|
|
8285
8285
|
class="view row weekdays"
|
|
@@ -9475,7 +9475,7 @@ exports[`component:<Calendar> desktop environment prop:locale en-US 1`] = `
|
|
|
9475
9475
|
>
|
|
9476
9476
|
May 1980
|
|
9477
9477
|
</h4>
|
|
9478
|
-
<
|
|
9478
|
+
<div
|
|
9479
9479
|
class="pressable"
|
|
9480
9480
|
>
|
|
9481
9481
|
<span
|
|
@@ -9499,7 +9499,7 @@ exports[`component:<Calendar> desktop environment prop:locale en-US 1`] = `
|
|
|
9499
9499
|
/>
|
|
9500
9500
|
</svg>
|
|
9501
9501
|
</span>
|
|
9502
|
-
</
|
|
9502
|
+
</div>
|
|
9503
9503
|
</div>
|
|
9504
9504
|
<div
|
|
9505
9505
|
class="view row weekdays"
|
|
@@ -11291,7 +11291,7 @@ exports[`component:<Calendar> desktop environment prop:months 1`] = `
|
|
|
11291
11291
|
>
|
|
11292
11292
|
junio 1980
|
|
11293
11293
|
</h4>
|
|
11294
|
-
<
|
|
11294
|
+
<div
|
|
11295
11295
|
class="pressable"
|
|
11296
11296
|
>
|
|
11297
11297
|
<span
|
|
@@ -11315,7 +11315,7 @@ exports[`component:<Calendar> desktop environment prop:months 1`] = `
|
|
|
11315
11315
|
/>
|
|
11316
11316
|
</svg>
|
|
11317
11317
|
</span>
|
|
11318
|
-
</
|
|
11318
|
+
</div>
|
|
11319
11319
|
</div>
|
|
11320
11320
|
<div
|
|
11321
11321
|
class="view row weekdays"
|
|
@@ -12501,7 +12501,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:disabledDates
|
|
|
12501
12501
|
>
|
|
12502
12502
|
mayo 1980
|
|
12503
12503
|
</h4>
|
|
12504
|
-
<
|
|
12504
|
+
<div
|
|
12505
12505
|
class="pressable"
|
|
12506
12506
|
>
|
|
12507
12507
|
<span
|
|
@@ -12525,7 +12525,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:disabledDates
|
|
|
12525
12525
|
/>
|
|
12526
12526
|
</svg>
|
|
12527
12527
|
</span>
|
|
12528
|
-
</
|
|
12528
|
+
</div>
|
|
12529
12529
|
</div>
|
|
12530
12530
|
<div
|
|
12531
12531
|
class="view row weekdays"
|
|
@@ -13721,7 +13721,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:rangeMaxDays 1
|
|
|
13721
13721
|
>
|
|
13722
13722
|
mayo 1980
|
|
13723
13723
|
</h4>
|
|
13724
|
-
<
|
|
13724
|
+
<div
|
|
13725
13725
|
class="pressable"
|
|
13726
13726
|
>
|
|
13727
13727
|
<span
|
|
@@ -13745,7 +13745,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:rangeMaxDays 1
|
|
|
13745
13745
|
/>
|
|
13746
13746
|
</svg>
|
|
13747
13747
|
</span>
|
|
13748
|
-
</
|
|
13748
|
+
</div>
|
|
13749
13749
|
</div>
|
|
13750
13750
|
<div
|
|
13751
13751
|
class="view row weekdays"
|
|
@@ -14941,7 +14941,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:rangeMinDays 1
|
|
|
14941
14941
|
>
|
|
14942
14942
|
mayo 1980
|
|
14943
14943
|
</h4>
|
|
14944
|
-
<
|
|
14944
|
+
<div
|
|
14945
14945
|
class="pressable"
|
|
14946
14946
|
>
|
|
14947
14947
|
<span
|
|
@@ -14965,7 +14965,7 @@ exports[`component:<Calendar> desktop environment prop:range prop:rangeMinDays 1
|
|
|
14965
14965
|
/>
|
|
14966
14966
|
</svg>
|
|
14967
14967
|
</span>
|
|
14968
|
-
</
|
|
14968
|
+
</div>
|
|
14969
14969
|
</div>
|
|
14970
14970
|
<div
|
|
14971
14971
|
class="view row weekdays"
|
|
@@ -16161,7 +16161,7 @@ exports[`component:<Calendar> desktop environment prop:range renders 1`] = `
|
|
|
16161
16161
|
>
|
|
16162
16162
|
mayo 1980
|
|
16163
16163
|
</h4>
|
|
16164
|
-
<
|
|
16164
|
+
<div
|
|
16165
16165
|
class="pressable"
|
|
16166
16166
|
>
|
|
16167
16167
|
<span
|
|
@@ -16185,7 +16185,7 @@ exports[`component:<Calendar> desktop environment prop:range renders 1`] = `
|
|
|
16185
16185
|
/>
|
|
16186
16186
|
</svg>
|
|
16187
16187
|
</span>
|
|
16188
|
-
</
|
|
16188
|
+
</div>
|
|
16189
16189
|
</div>
|
|
16190
16190
|
<div
|
|
16191
16191
|
class="view row weekdays"
|
|
@@ -18576,7 +18576,7 @@ exports[`component:<Calendar> desktop environment renders 1`] = `
|
|
|
18576
18576
|
>
|
|
18577
18577
|
mayo 1980
|
|
18578
18578
|
</h4>
|
|
18579
|
-
<
|
|
18579
|
+
<div
|
|
18580
18580
|
class="pressable"
|
|
18581
18581
|
>
|
|
18582
18582
|
<span
|
|
@@ -18600,7 +18600,7 @@ exports[`component:<Calendar> desktop environment renders 1`] = `
|
|
|
18600
18600
|
/>
|
|
18601
18601
|
</svg>
|
|
18602
18602
|
</span>
|
|
18603
|
-
</
|
|
18603
|
+
</div>
|
|
18604
18604
|
</div>
|
|
18605
18605
|
<div
|
|
18606
18606
|
class="view row weekdays"
|
|
@@ -19796,7 +19796,7 @@ exports[`component:<Calendar> inherit:className 1`] = `
|
|
|
19796
19796
|
>
|
|
19797
19797
|
mayo 1980
|
|
19798
19798
|
</h4>
|
|
19799
|
-
<
|
|
19799
|
+
<div
|
|
19800
19800
|
class="pressable"
|
|
19801
19801
|
>
|
|
19802
19802
|
<span
|
|
@@ -19820,7 +19820,7 @@ exports[`component:<Calendar> inherit:className 1`] = `
|
|
|
19820
19820
|
/>
|
|
19821
19821
|
</svg>
|
|
19822
19822
|
</span>
|
|
19823
|
-
</
|
|
19823
|
+
</div>
|
|
19824
19824
|
</div>
|
|
19825
19825
|
<div
|
|
19826
19826
|
class="view row weekdays"
|
|
@@ -21166,7 +21166,7 @@ exports[`component:<Calendar> mobile environment prop:captions 1`] = `
|
|
|
21166
21166
|
>
|
|
21167
21167
|
mayo 1980
|
|
21168
21168
|
</h4>
|
|
21169
|
-
<
|
|
21169
|
+
<div
|
|
21170
21170
|
class="pressable"
|
|
21171
21171
|
>
|
|
21172
21172
|
<span
|
|
@@ -21190,7 +21190,7 @@ exports[`component:<Calendar> mobile environment prop:captions 1`] = `
|
|
|
21190
21190
|
/>
|
|
21191
21191
|
</svg>
|
|
21192
21192
|
</span>
|
|
21193
|
-
</
|
|
21193
|
+
</div>
|
|
21194
21194
|
</div>
|
|
21195
21195
|
<div
|
|
21196
21196
|
class="view row weekdays"
|
|
@@ -22541,7 +22541,7 @@ exports[`component:<Calendar> mobile environment prop:disabledDates 1`] = `
|
|
|
22541
22541
|
>
|
|
22542
22542
|
mayo 1980
|
|
22543
22543
|
</h4>
|
|
22544
|
-
<
|
|
22544
|
+
<div
|
|
22545
22545
|
class="pressable"
|
|
22546
22546
|
>
|
|
22547
22547
|
<span
|
|
@@ -22565,7 +22565,7 @@ exports[`component:<Calendar> mobile environment prop:disabledDates 1`] = `
|
|
|
22565
22565
|
/>
|
|
22566
22566
|
</svg>
|
|
22567
22567
|
</span>
|
|
22568
|
-
</
|
|
22568
|
+
</div>
|
|
22569
22569
|
</div>
|
|
22570
22570
|
<div
|
|
22571
22571
|
class="view row weekdays"
|
|
@@ -23170,7 +23170,7 @@ exports[`component:<Calendar> mobile environment prop:disabledPast 1`] = `
|
|
|
23170
23170
|
<div
|
|
23171
23171
|
class="view row header"
|
|
23172
23172
|
>
|
|
23173
|
-
<
|
|
23173
|
+
<div
|
|
23174
23174
|
class="pressable"
|
|
23175
23175
|
>
|
|
23176
23176
|
<span
|
|
@@ -23194,7 +23194,7 @@ exports[`component:<Calendar> mobile environment prop:disabledPast 1`] = `
|
|
|
23194
23194
|
/>
|
|
23195
23195
|
</svg>
|
|
23196
23196
|
</span>
|
|
23197
|
-
</
|
|
23197
|
+
</div>
|
|
23198
23198
|
<h4
|
|
23199
23199
|
class="text bold headline-4 title"
|
|
23200
23200
|
>
|
|
@@ -23786,7 +23786,7 @@ exports[`component:<Calendar> mobile environment prop:disabledPast 1`] = `
|
|
|
23786
23786
|
>
|
|
23787
23787
|
mayo 1980
|
|
23788
23788
|
</h4>
|
|
23789
|
-
<
|
|
23789
|
+
<div
|
|
23790
23790
|
class="pressable"
|
|
23791
23791
|
>
|
|
23792
23792
|
<span
|
|
@@ -23810,7 +23810,7 @@ exports[`component:<Calendar> mobile environment prop:disabledPast 1`] = `
|
|
|
23810
23810
|
/>
|
|
23811
23811
|
</svg>
|
|
23812
23812
|
</span>
|
|
23813
|
-
</
|
|
23813
|
+
</div>
|
|
23814
23814
|
</div>
|
|
23815
23815
|
<div
|
|
23816
23816
|
class="view row weekdays"
|
|
@@ -25006,7 +25006,7 @@ exports[`component:<Calendar> mobile environment prop:format 1`] = `
|
|
|
25006
25006
|
>
|
|
25007
25007
|
mayo 1980
|
|
25008
25008
|
</h4>
|
|
25009
|
-
<
|
|
25009
|
+
<div
|
|
25010
25010
|
class="pressable"
|
|
25011
25011
|
>
|
|
25012
25012
|
<span
|
|
@@ -25030,7 +25030,7 @@ exports[`component:<Calendar> mobile environment prop:format 1`] = `
|
|
|
25030
25030
|
/>
|
|
25031
25031
|
</svg>
|
|
25032
25032
|
</span>
|
|
25033
|
-
</
|
|
25033
|
+
</div>
|
|
25034
25034
|
</div>
|
|
25035
25035
|
<div
|
|
25036
25036
|
class="view row weekdays"
|
|
@@ -26226,7 +26226,7 @@ exports[`component:<Calendar> mobile environment prop:from 1`] = `
|
|
|
26226
26226
|
>
|
|
26227
26227
|
mayo 1980
|
|
26228
26228
|
</h4>
|
|
26229
|
-
<
|
|
26229
|
+
<div
|
|
26230
26230
|
class="pressable"
|
|
26231
26231
|
>
|
|
26232
26232
|
<span
|
|
@@ -26250,7 +26250,7 @@ exports[`component:<Calendar> mobile environment prop:from 1`] = `
|
|
|
26250
26250
|
/>
|
|
26251
26251
|
</svg>
|
|
26252
26252
|
</span>
|
|
26253
|
-
</
|
|
26253
|
+
</div>
|
|
26254
26254
|
</div>
|
|
26255
26255
|
<div
|
|
26256
26256
|
class="view row weekdays"
|
|
@@ -27446,7 +27446,7 @@ exports[`component:<Calendar> mobile environment prop:highlights 1`] = `
|
|
|
27446
27446
|
>
|
|
27447
27447
|
mayo 1980
|
|
27448
27448
|
</h4>
|
|
27449
|
-
<
|
|
27449
|
+
<div
|
|
27450
27450
|
class="pressable"
|
|
27451
27451
|
>
|
|
27452
27452
|
<span
|
|
@@ -27470,7 +27470,7 @@ exports[`component:<Calendar> mobile environment prop:highlights 1`] = `
|
|
|
27470
27470
|
/>
|
|
27471
27471
|
</svg>
|
|
27472
27472
|
</span>
|
|
27473
|
-
</
|
|
27473
|
+
</div>
|
|
27474
27474
|
</div>
|
|
27475
27475
|
<div
|
|
27476
27476
|
class="view row weekdays"
|
|
@@ -28666,7 +28666,7 @@ exports[`component:<Calendar> mobile environment prop:locale 1`] = `
|
|
|
28666
28666
|
>
|
|
28667
28667
|
mayo 1980
|
|
28668
28668
|
</h4>
|
|
28669
|
-
<
|
|
28669
|
+
<div
|
|
28670
28670
|
class="pressable"
|
|
28671
28671
|
>
|
|
28672
28672
|
<span
|
|
@@ -28690,7 +28690,7 @@ exports[`component:<Calendar> mobile environment prop:locale 1`] = `
|
|
|
28690
28690
|
/>
|
|
28691
28691
|
</svg>
|
|
28692
28692
|
</span>
|
|
28693
|
-
</
|
|
28693
|
+
</div>
|
|
28694
28694
|
</div>
|
|
28695
28695
|
<div
|
|
28696
28696
|
class="view row weekdays"
|
|
@@ -29886,7 +29886,7 @@ exports[`component:<Calendar> mobile environment prop:locale en-US 1`] = `
|
|
|
29886
29886
|
>
|
|
29887
29887
|
May 1980
|
|
29888
29888
|
</h4>
|
|
29889
|
-
<
|
|
29889
|
+
<div
|
|
29890
29890
|
class="pressable"
|
|
29891
29891
|
>
|
|
29892
29892
|
<span
|
|
@@ -29910,7 +29910,7 @@ exports[`component:<Calendar> mobile environment prop:locale en-US 1`] = `
|
|
|
29910
29910
|
/>
|
|
29911
29911
|
</svg>
|
|
29912
29912
|
</span>
|
|
29913
|
-
</
|
|
29913
|
+
</div>
|
|
29914
29914
|
</div>
|
|
29915
29915
|
<div
|
|
29916
29916
|
class="view row weekdays"
|
|
@@ -31702,7 +31702,7 @@ exports[`component:<Calendar> mobile environment prop:months 1`] = `
|
|
|
31702
31702
|
>
|
|
31703
31703
|
junio 1980
|
|
31704
31704
|
</h4>
|
|
31705
|
-
<
|
|
31705
|
+
<div
|
|
31706
31706
|
class="pressable"
|
|
31707
31707
|
>
|
|
31708
31708
|
<span
|
|
@@ -31726,7 +31726,7 @@ exports[`component:<Calendar> mobile environment prop:months 1`] = `
|
|
|
31726
31726
|
/>
|
|
31727
31727
|
</svg>
|
|
31728
31728
|
</span>
|
|
31729
|
-
</
|
|
31729
|
+
</div>
|
|
31730
31730
|
</div>
|
|
31731
31731
|
<div
|
|
31732
31732
|
class="view row weekdays"
|
|
@@ -32912,7 +32912,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:disabledDates 1
|
|
|
32912
32912
|
>
|
|
32913
32913
|
mayo 1980
|
|
32914
32914
|
</h4>
|
|
32915
|
-
<
|
|
32915
|
+
<div
|
|
32916
32916
|
class="pressable"
|
|
32917
32917
|
>
|
|
32918
32918
|
<span
|
|
@@ -32936,7 +32936,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:disabledDates 1
|
|
|
32936
32936
|
/>
|
|
32937
32937
|
</svg>
|
|
32938
32938
|
</span>
|
|
32939
|
-
</
|
|
32939
|
+
</div>
|
|
32940
32940
|
</div>
|
|
32941
32941
|
<div
|
|
32942
32942
|
class="view row weekdays"
|
|
@@ -34132,7 +34132,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:rangeMaxDays 1`
|
|
|
34132
34132
|
>
|
|
34133
34133
|
mayo 1980
|
|
34134
34134
|
</h4>
|
|
34135
|
-
<
|
|
34135
|
+
<div
|
|
34136
34136
|
class="pressable"
|
|
34137
34137
|
>
|
|
34138
34138
|
<span
|
|
@@ -34156,7 +34156,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:rangeMaxDays 1`
|
|
|
34156
34156
|
/>
|
|
34157
34157
|
</svg>
|
|
34158
34158
|
</span>
|
|
34159
|
-
</
|
|
34159
|
+
</div>
|
|
34160
34160
|
</div>
|
|
34161
34161
|
<div
|
|
34162
34162
|
class="view row weekdays"
|
|
@@ -35352,7 +35352,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:rangeMinDays 1`
|
|
|
35352
35352
|
>
|
|
35353
35353
|
mayo 1980
|
|
35354
35354
|
</h4>
|
|
35355
|
-
<
|
|
35355
|
+
<div
|
|
35356
35356
|
class="pressable"
|
|
35357
35357
|
>
|
|
35358
35358
|
<span
|
|
@@ -35376,7 +35376,7 @@ exports[`component:<Calendar> mobile environment prop:range prop:rangeMinDays 1`
|
|
|
35376
35376
|
/>
|
|
35377
35377
|
</svg>
|
|
35378
35378
|
</span>
|
|
35379
|
-
</
|
|
35379
|
+
</div>
|
|
35380
35380
|
</div>
|
|
35381
35381
|
<div
|
|
35382
35382
|
class="view row weekdays"
|
|
@@ -36572,7 +36572,7 @@ exports[`component:<Calendar> mobile environment prop:range renders 1`] = `
|
|
|
36572
36572
|
>
|
|
36573
36573
|
mayo 1980
|
|
36574
36574
|
</h4>
|
|
36575
|
-
<
|
|
36575
|
+
<div
|
|
36576
36576
|
class="pressable"
|
|
36577
36577
|
>
|
|
36578
36578
|
<span
|
|
@@ -36596,7 +36596,7 @@ exports[`component:<Calendar> mobile environment prop:range renders 1`] = `
|
|
|
36596
36596
|
/>
|
|
36597
36597
|
</svg>
|
|
36598
36598
|
</span>
|
|
36599
|
-
</
|
|
36599
|
+
</div>
|
|
36600
36600
|
</div>
|
|
36601
36601
|
<div
|
|
36602
36602
|
class="view row weekdays"
|
|
@@ -38987,7 +38987,7 @@ exports[`component:<Calendar> mobile environment renders 1`] = `
|
|
|
38987
38987
|
>
|
|
38988
38988
|
mayo 1980
|
|
38989
38989
|
</h4>
|
|
38990
|
-
<
|
|
38990
|
+
<div
|
|
38991
38991
|
class="pressable"
|
|
38992
38992
|
>
|
|
38993
38993
|
<span
|
|
@@ -39011,7 +39011,7 @@ exports[`component:<Calendar> mobile environment renders 1`] = `
|
|
|
39011
39011
|
/>
|
|
39012
39012
|
</svg>
|
|
39013
39013
|
</span>
|
|
39014
|
-
</
|
|
39014
|
+
</div>
|
|
39015
39015
|
</div>
|
|
39016
39016
|
<div
|
|
39017
39017
|
class="view row weekdays"
|
|
@@ -40208,7 +40208,7 @@ exports[`component:<Calendar> testID 1`] = `
|
|
|
40208
40208
|
>
|
|
40209
40209
|
mayo 1980
|
|
40210
40210
|
</h4>
|
|
40211
|
-
<
|
|
40211
|
+
<div
|
|
40212
40212
|
class="pressable"
|
|
40213
40213
|
data-testid="mirai-next"
|
|
40214
40214
|
>
|
|
@@ -40233,7 +40233,7 @@ exports[`component:<Calendar> testID 1`] = `
|
|
|
40233
40233
|
/>
|
|
40234
40234
|
</svg>
|
|
40235
40235
|
</span>
|
|
40236
|
-
</
|
|
40236
|
+
</div>
|
|
40237
40237
|
</div>
|
|
40238
40238
|
<div
|
|
40239
40239
|
class="view row weekdays"
|
|
@@ -176,7 +176,7 @@ var Story = function Story(props) {
|
|
|
176
176
|
return setForm({});
|
|
177
177
|
},
|
|
178
178
|
style: {
|
|
179
|
-
marginRight: 'var(--mirai-ui-space-M'
|
|
179
|
+
marginRight: 'var(--mirai-ui-space-M)'
|
|
180
180
|
}
|
|
181
181
|
}, "Reset"), /*#__PURE__*/_react.default.createElement(_.Button, {
|
|
182
182
|
small: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.js","names":["title","Story","props","useState","condition","setCondition","email","checkbox","dateOfBirth","switch","radio","form","setForm","error","setError","useEffect","handleBlur","others","console","log","handleChange","next","handleError","handleFocus","handleSubmit","value","includes","password","children","Array","from","keys","map","index","Object","length","justifyContent","marginTop","marginRight","storyName","args","debounce","schema","showErrors","validateOnMount","argTypes"],"sources":["../../../src/components/Form/Form.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputDate, InputNumber, InputOption, InputText, Text, View } from '../../';\nimport { Form } from './Form';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [condition, setCondition] = useState(false);\n const [form, setForm] = useState({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n });\n const [error, setError] = useState({});\n\n useEffect(\n () =>\n setForm({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n }),\n [],\n ); // * Simulate a state hydration\n\n const handleBlur = (...others) => console.log('<Form>::onBlur', ...others);\n\n const handleChange = (next, ...others) => {\n setForm(next);\n console.log('<Form>::onChange', next, ...others);\n };\n\n const handleError = (next, ...others) => {\n setError(next);\n console.log('<Form>::onError', next, ...others);\n };\n\n const handleFocus = (...others) => console.log('<Form>::onFocus', ...others);\n\n const handleSubmit = (...others) => console.log('<Form>::onSubmit', ...others);\n\n return (\n <>\n <Form\n {...props}\n onBlur={handleBlur}\n onChange={handleChange}\n onError={handleError}\n onFocus={handleFocus}\n onSubmit={handleSubmit}\n >\n <Text headline>Form component</Text>\n <InputText\n name=\"email\"\n error={!!error.email}\n test={(value) => value.includes('@mirai.com')}\n label=\"Email\"\n hint=\"Should contains @mirai.com\"\n required\n type=\"email\"\n value={form.email}\n />\n <InputText\n name=\"password\"\n error={!!error.password}\n hint=\"At least 10 chars.\"\n label=\"Password\"\n required\n minLength={10}\n type=\"password\"\n value={form.password}\n />\n <InputDate\n name=\"dateOfBirth\"\n error={!!error.dateOfBirth}\n label=\"Your birthdate\"\n max=\"31/12/2022\"\n min=\"10/04/1980\"\n required\n type=\"inputDate\"\n value={form.dateOfBirth}\n />\n <InputText name=\"bio\" label=\"Bio\" multiLine />\n <InputNumber name=\"children\" label=\"Children\" hint=\"Ages 0 - 17\" value={form.children} />\n <InputOption type=\"checkbox\" name=\"checkbox\" label=\"checkbox\" checked={form.checkbox} />\n <InputOption type=\"switch\" name=\"switch\" label=\"switch\" checked={form.switch} />\n {Array.from(Array(2).keys()).map((index) => (\n <InputOption\n key={index}\n type=\"radio\"\n name=\"radio\"\n value={`radio-${index}`}\n label={`radio-${index}`}\n checked={form.radio === `radio-${index}`}\n />\n ))}\n {condition && <InputText label=\"condition\" name=\"condition\" />}\n\n <Button disabled={Object.keys(error).length !== 0} type=\"submit\" wide>\n Submit\n </Button>\n </Form>\n\n <View row style={{ justifyContent: 'flex-end', marginTop: 'var(--mirai-ui-space-L)' }}>\n <Button small secondary onPress={() => setForm({})} style={{ marginRight: 'var(--mirai-ui-space-M' }}>\n Reset\n </Button>\n <Button small secondary onPress={() => setCondition(!condition)}>\n {`${condition ? 'Hide' : 'Show'} dynamic field`}\n </Button>\n </View>\n </>\n );\n};\n\nStory.storyName = 'Form';\n\nStory.args = {\n debounce: 0,\n schema: {},\n showErrors: false,\n validateOnMount: false,\n // inherited properties\n ['data-testid']: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEf;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK,EAAK;EAC9B,gBAAkC,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAA1CC,SAAS;IAAEC,YAAY;EAC9B,iBAAwB,IAAAF,eAAQ,EAAC;MAC/BG,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,YAAY;MACzBC,MAAM,EAAE,IAAI;MACZC,KAAK,EAAE;IACT,CAAC,CAAC;IAAA;IANKC,IAAI;IAAEC,OAAO;EAOpB,iBAA0B,IAAAT,eAAQ,EAAC,CAAC,CAAC,CAAC;IAAA;IAA/BU,KAAK;IAAEC,QAAQ;EAEtB,IAAAC,gBAAS,EACP;IAAA,OACEH,OAAO,CAAC;MACNN,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,YAAY;MACzBC,MAAM,EAAE,IAAI;MACZC,KAAK,EAAE;IACT,CAAC,CAAC;EAAA,GACJ,EAAE,CACH,CAAC,CAAC;;EAEH,IAAMM,UAAU,GAAG,SAAbA,UAAU;IAAA;IAAA,kCAAOC,MAAM;MAANA,MAAM;IAAA;IAAA,OAAK,YAAAC,OAAO,EAACC,GAAG,kBAAC,gBAAgB,SAAKF,MAAM,EAAC;EAAA;EAE1E,IAAMG,YAAY,GAAG,SAAfA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I,EAAC,OAAO;MACZ,KAAK,kBAAWA,KAAK,CAAG;MACxB,KAAK,kBAAWA,KAAK,CAAG;MACxB,OAAO,EAAEtB,IAAI,CAACD,KAAK,qBAAcuB,KAAK;IAAG,EACzC;EAAA,CACH,CAAC,EACD7B,SAAS,iBAAI,6BAAC,WAAS;IAAC,KAAK,EAAC,WAAW;IAAC,IAAI,EAAC;EAAW,EAAG,eAE9D,6BAAC,QAAM;IAAC,QAAQ,EAAE8B,MAAM,CAACH,IAAI,CAAClB,KAAK,CAAC,CAACsB,MAAM,KAAK,CAAE;IAAC,IAAI,EAAC,QAAQ;IAAC,IAAI;EAAA,YAE5D,CACJ,eAEP,6BAAC,MAAI;IAAC,GAAG;IAAC,KAAK,EAAE;MAAEC,cAAc,EAAE,UAAU;MAAEC,SAAS,EAAE;IAA0B;EAAE,gBACpF,6BAAC,QAAM;IAAC,KAAK;IAAC,SAAS;IAAC,OAAO,EAAE;MAAA,OAAMzB,OAAO,CAAC,CAAC,CAAC,CAAC;IAAA,CAAC;IAAC,KAAK,EAAE;MAAE0B,WAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"Form.stories.js","names":["title","Story","props","useState","condition","setCondition","email","checkbox","dateOfBirth","switch","radio","form","setForm","error","setError","useEffect","handleBlur","others","console","log","handleChange","next","handleError","handleFocus","handleSubmit","value","includes","password","children","Array","from","keys","map","index","Object","length","justifyContent","marginTop","marginRight","storyName","args","debounce","schema","showErrors","validateOnMount","argTypes"],"sources":["../../../src/components/Form/Form.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputDate, InputNumber, InputOption, InputText, Text, View } from '../../';\nimport { Form } from './Form';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [condition, setCondition] = useState(false);\n const [form, setForm] = useState({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n });\n const [error, setError] = useState({});\n\n useEffect(\n () =>\n setForm({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n }),\n [],\n ); // * Simulate a state hydration\n\n const handleBlur = (...others) => console.log('<Form>::onBlur', ...others);\n\n const handleChange = (next, ...others) => {\n setForm(next);\n console.log('<Form>::onChange', next, ...others);\n };\n\n const handleError = (next, ...others) => {\n setError(next);\n console.log('<Form>::onError', next, ...others);\n };\n\n const handleFocus = (...others) => console.log('<Form>::onFocus', ...others);\n\n const handleSubmit = (...others) => console.log('<Form>::onSubmit', ...others);\n\n return (\n <>\n <Form\n {...props}\n onBlur={handleBlur}\n onChange={handleChange}\n onError={handleError}\n onFocus={handleFocus}\n onSubmit={handleSubmit}\n >\n <Text headline>Form component</Text>\n <InputText\n name=\"email\"\n error={!!error.email}\n test={(value) => value.includes('@mirai.com')}\n label=\"Email\"\n hint=\"Should contains @mirai.com\"\n required\n type=\"email\"\n value={form.email}\n />\n <InputText\n name=\"password\"\n error={!!error.password}\n hint=\"At least 10 chars.\"\n label=\"Password\"\n required\n minLength={10}\n type=\"password\"\n value={form.password}\n />\n <InputDate\n name=\"dateOfBirth\"\n error={!!error.dateOfBirth}\n label=\"Your birthdate\"\n max=\"31/12/2022\"\n min=\"10/04/1980\"\n required\n type=\"inputDate\"\n value={form.dateOfBirth}\n />\n <InputText name=\"bio\" label=\"Bio\" multiLine />\n <InputNumber name=\"children\" label=\"Children\" hint=\"Ages 0 - 17\" value={form.children} />\n <InputOption type=\"checkbox\" name=\"checkbox\" label=\"checkbox\" checked={form.checkbox} />\n <InputOption type=\"switch\" name=\"switch\" label=\"switch\" checked={form.switch} />\n {Array.from(Array(2).keys()).map((index) => (\n <InputOption\n key={index}\n type=\"radio\"\n name=\"radio\"\n value={`radio-${index}`}\n label={`radio-${index}`}\n checked={form.radio === `radio-${index}`}\n />\n ))}\n {condition && <InputText label=\"condition\" name=\"condition\" />}\n\n <Button disabled={Object.keys(error).length !== 0} type=\"submit\" wide>\n Submit\n </Button>\n </Form>\n\n <View row style={{ justifyContent: 'flex-end', marginTop: 'var(--mirai-ui-space-L)' }}>\n <Button small secondary onPress={() => setForm({})} style={{ marginRight: 'var(--mirai-ui-space-M)' }}>\n Reset\n </Button>\n <Button small secondary onPress={() => setCondition(!condition)}>\n {`${condition ? 'Hide' : 'Show'} dynamic field`}\n </Button>\n </View>\n </>\n );\n};\n\nStory.storyName = 'Form';\n\nStory.args = {\n debounce: 0,\n schema: {},\n showErrors: false,\n validateOnMount: false,\n // inherited properties\n ['data-testid']: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEf;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK,EAAK;EAC9B,gBAAkC,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAA1CC,SAAS;IAAEC,YAAY;EAC9B,iBAAwB,IAAAF,eAAQ,EAAC;MAC/BG,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,YAAY;MACzBC,MAAM,EAAE,IAAI;MACZC,KAAK,EAAE;IACT,CAAC,CAAC;IAAA;IANKC,IAAI;IAAEC,OAAO;EAOpB,iBAA0B,IAAAT,eAAQ,EAAC,CAAC,CAAC,CAAC;IAAA;IAA/BU,KAAK;IAAEC,QAAQ;EAEtB,IAAAC,gBAAS,EACP;IAAA,OACEH,OAAO,CAAC;MACNN,KAAK,EAAE,gBAAgB;MACvBC,QAAQ,EAAE,IAAI;MACdC,WAAW,EAAE,YAAY;MACzBC,MAAM,EAAE,IAAI;MACZC,KAAK,EAAE;IACT,CAAC,CAAC;EAAA,GACJ,EAAE,CACH,CAAC,CAAC;;EAEH,IAAMM,UAAU,GAAG,SAAbA,UAAU;IAAA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Y,yCACtB,CAAC,CAAC,eACV;AAED3C,KAAK,CAAC4C,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -90,7 +90,6 @@ var InputText = function InputText(_ref) {
|
|
|
90
90
|
type: !is.password || password ? type : 'text',
|
|
91
91
|
value: others.value || '',
|
|
92
92
|
className: (0, _helpers.styles)(_InputTextModule.default.input, has.label && _InputTextModule.default.withLabel, has.icon && _InputTextModule.default.iconLeft),
|
|
93
|
-
style: undefined,
|
|
94
93
|
onChange: handleChange,
|
|
95
94
|
onEnter: handleEnter,
|
|
96
95
|
onLeave: handleLeave
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.js","names":["InputText","disabled","error","hint","icon","label","showState","success","type","warning","onChange","onEnter","onLeave","others","useState","focus","setFocus","password","setPassword","handleChange","value","event","handleEnter","handleLeave","handlePress","is","search","undefined","has","length","stateIcon","styles","style","inputContainer","className","inputBorder","text","withIcon","withValue","ICON","SEARCH","left","input","withLabel","iconLeft","icons","EYE_CLOSE","EYE_OPEN","CLOSE","pressable","getIconState","displayName","propTypes","PropTypes","bool","string","func","multiLine","name","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\n\nconst InputText = ({\n disabled,\n error,\n hint,\n icon,\n label,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = () => {\n setFocus(false);\n onLeave(event);\n };\n\n const handlePress = (event) => {\n if (is.password) setPassword(!password);\n else if (is.search) onChange(undefined, event);\n };\n\n const is = {\n password: type === 'password',\n search: type === 'search',\n };\n\n const has = {\n icon: !!icon || is.search,\n label: !!label,\n value: others.value !== undefined && others.value?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n focus && !error && style.focus,\n )}\n >\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n has.icon && style.withIcon,\n (focus || error || has.value) && style.withValue,\n )}\n >\n {label}\n </Text>\n )}\n\n {has.icon && (\n <Icon\n value={icon || ICON.SEARCH}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n\n <Input\n {...others}\n disabled={disabled}\n type={!is.password || password ? type : 'text'}\n value={others.value || ''}\n className={styles(style.input, has.label && style.withLabel, has.icon && style.iconLeft)}\n
|
|
1
|
+
{"version":3,"file":"InputText.js","names":["InputText","disabled","error","hint","icon","label","showState","success","type","warning","onChange","onEnter","onLeave","others","useState","focus","setFocus","password","setPassword","handleChange","value","event","handleEnter","handleLeave","handlePress","is","search","undefined","has","length","stateIcon","styles","style","inputContainer","className","inputBorder","text","withIcon","withValue","ICON","SEARCH","left","input","withLabel","iconLeft","icons","EYE_CLOSE","EYE_OPEN","CLOSE","pressable","getIconState","displayName","propTypes","PropTypes","bool","string","func","multiLine","name","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\n\nconst InputText = ({\n disabled,\n error,\n hint,\n icon,\n label,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = () => {\n setFocus(false);\n onLeave(event);\n };\n\n const handlePress = (event) => {\n if (is.password) setPassword(!password);\n else if (is.search) onChange(undefined, event);\n };\n\n const is = {\n password: type === 'password',\n search: type === 'search',\n };\n\n const has = {\n icon: !!icon || is.search,\n label: !!label,\n value: others.value !== undefined && others.value?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n focus && !error && style.focus,\n )}\n >\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n has.icon && style.withIcon,\n (focus || error || has.value) && style.withValue,\n )}\n >\n {label}\n </Text>\n )}\n\n {has.icon && (\n <Icon\n value={icon || ICON.SEARCH}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n\n <Input\n {...others}\n disabled={disabled}\n type={!is.password || password ? type : 'text'}\n value={others.value || ''}\n className={styles(style.input, has.label && style.withLabel, has.icon && style.iconLeft)}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n\n {(((is.password || is.search) && !disabled) || has.stateIcon) && (\n <View row className={style.icons}>\n {(is.password || is.search) && !disabled && (\n <Pressable tabIndex={-1} onPress={handlePress}>\n <Icon\n value={is.password ? (password ? ICON.EYE_CLOSE : ICON.EYE_OPEN) : ICON.CLOSE}\n className={styles(style.icon, style.pressable)}\n />\n </Pressable>\n )}\n\n {has.stateIcon && (\n <Icon\n value={getIconState({ error, success, warning })}\n className={styles(\n style.icon,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n />\n )}\n </View>\n )}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, disabled && style.disabled, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputText.displayName = 'Component:InputText';\n\nInputText.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n type: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputText };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAA2C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE3C,IAAMA,SAAS,GAAG,SAAZA,SAAS,OAcT;EAAA;EAAA,IAbJC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,IAAI,QAAJA,IAAI;IACJC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IAAA,sBACLC,SAAS;IAATA,SAAS,+BAAG,IAAI;IAChBC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;IAAA,qBACPC,QAAQ;IAARA,QAAQ,8BAAG,YAAM,CAAC,CAAC;IAAA,oBACnBC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IAAA,oBAClBC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IACfC,MAAM;EAET,gBAA0B,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAAlCC,KAAK;IAAEC,QAAQ;EACtB,iBAAgC,IAAAF,eAAQ,EAAC,IAAI,CAAC;IAAA;IAAvCG,QAAQ;IAAEC,WAAW;EAE5B,IAAMC,YAAY,GAAG,SAAfA,YAAY,CAAIC,KAAK,EAAEC,KAAK,EAAK;IACrCX,QAAQ,CAACU,KAAK,EAAEC,KAAK,CAAC;EACxB,CAAC;EAED,IAAMC,WAAW,GAAG,SAAdA,WAA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ACI;AAEX,CAAC;AAAC;AAEFH,SAAS,CAACmD,WAAW,GAAG,qBAAqB;AAE7CnD,SAAS,CAACoD,SAAS,GAAG;EACpBnD,QAAQ,EAAEoD,kBAAS,CAACC,IAAI;EACxBpD,KAAK,EAAEmD,kBAAS,CAACC,IAAI;EACrBnD,IAAI,EAAEkD,kBAAS,CAACE,MAAM;EACtBnD,IAAI,EAAEiD,kBAAS,CAACG,IAAI;EACpBnD,KAAK,EAAEgD,kBAAS,CAACE,MAAM;EACvBE,SAAS,EAAEJ,kBAAS,CAACC,IAAI;EACzBI,IAAI,EAAEL,kBAAS,CAACE,MAAM,CAACI,UAAU;EACjCrD,SAAS,EAAE+C,kBAAS,CAACC,IAAI;EACzB/C,OAAO,EAAE8C,kBAAS,CAACC,IAAI;EACvB9C,IAAI,EAAE6C,kBAAS,CAACE,MAAM;EACtB9C,OAAO,EAAE4C,kBAAS,CAACC,IAAI;EACvB5C,QAAQ,EAAE2C,kBAAS,CAACG,IAAI;EACxB7C,OAAO,EAAE0C,kBAAS,CAACG,IAAI;EACvB5C,OAAO,EAAEyC,kBAAS,CAACG;AACrB,CAAC"}
|
|
@@ -131,3 +131,11 @@
|
|
|
131
131
|
.icon.warning {
|
|
132
132
|
color: var(--mirai-ui-warning);
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
/* -- reset defaults -------------------------------------------------------- */
|
|
136
|
+
input.input,
|
|
137
|
+
textarea.input {
|
|
138
|
+
border: none;
|
|
139
|
+
margin: 0;
|
|
140
|
+
padding: var(--mirai-ui-input-text-padding-y) var(--mirai-ui-input-text-padding-x);
|
|
141
|
+
}
|
|
@@ -74,7 +74,6 @@ var Modal = function Modal(_ref) {
|
|
|
74
74
|
row: true,
|
|
75
75
|
className: _ModalModule.default.header
|
|
76
76
|
}, onBack && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
77
|
-
tag: "button",
|
|
78
77
|
onPress: onBack,
|
|
79
78
|
"data-testid": testId ? "".concat(testId, "-button-back") : undefined
|
|
80
79
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
@@ -84,7 +83,6 @@ var Modal = function Modal(_ref) {
|
|
|
84
83
|
headline: true,
|
|
85
84
|
className: (0, _helpers.styles)(_ModalModule.default.title, !onBack && _ModalModule.default.left, !onClose && _ModalModule.default.right)
|
|
86
85
|
}, title), onClose && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
87
|
-
tag: "button",
|
|
88
86
|
onPress: onClose,
|
|
89
87
|
"data-testid": testId ? "".concat(testId, "-button-close") : undefined
|
|
90
88
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","names":["Modal","blur","children","fit","overflow","portal","title","visible","onBack","onClose","onOverflow","others","useDevice","isDesktop","useState","dataset","setDataset","useEffect","document","body","miraiModal","undefined","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","styles","style","container","modal","calcWidth","className","header","ICON","LEFT","icon","left","right","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({\n blur = false,\n children,\n fit = false,\n overflow = true,\n portal = false,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n\n const [dataset, setDataset] = useState();\n\n useEffect(() => {\n if (visible && !dataset) {\n setDataset(true);\n document.body.dataset.miraiModal = true;\n }\n\n return () => {\n if (visible && dataset) {\n setDataset(undefined);\n delete document.body.dataset.miraiModal;\n }\n };\n }, [dataset, visible]);\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <Pressable\n className={styles(\n style.container,\n overflow && style.overflow,\n overflow && blur && style.blur,\n visible && style.visible,\n onOverflow && style.onOverflow,\n )}\n onPress={visible && overflow ? onOverflow : undefined}\n data-testid={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable
|
|
1
|
+
{"version":3,"file":"Modal.js","names":["Modal","blur","children","fit","overflow","portal","title","visible","onBack","onClose","onOverflow","others","useDevice","isDesktop","useState","dataset","setDataset","useEffect","document","body","miraiModal","undefined","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","styles","style","container","modal","calcWidth","className","header","ICON","LEFT","icon","left","right","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({\n blur = false,\n children,\n fit = false,\n overflow = true,\n portal = false,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n\n const [dataset, setDataset] = useState();\n\n useEffect(() => {\n if (visible && !dataset) {\n setDataset(true);\n document.body.dataset.miraiModal = true;\n }\n\n return () => {\n if (visible && dataset) {\n setDataset(undefined);\n delete document.body.dataset.miraiModal;\n }\n };\n }, [dataset, visible]);\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <Pressable\n className={styles(\n style.container,\n overflow && style.overflow,\n overflow && blur && style.blur,\n visible && style.visible,\n onOverflow && style.onOverflow,\n )}\n onPress={visible && overflow ? onOverflow : undefined}\n data-testid={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable onPress={onBack} data-testid={testId ? `${testId}-button-back` : undefined}>\n <Icon value={ICON.LEFT} className={style.icon} />\n </Pressable>\n )}\n {title && (\n <Text headline className={styles(style.title, !onBack && style.left, !onClose && style.right)}>\n {title}\n </Text>\n )}\n {onClose && (\n <Pressable onPress={onClose} data-testid={testId ? `${testId}-button-close` : undefined}>\n <Icon value={isDesktop || title !== undefined ? ICON.CLOSE : ICON.EXPAND_MORE} className={style.icon} />\n </Pressable>\n )}\n </View>\n )}\n {children}\n </View>\n </Pressable>,\n document.body,\n );\n};\n\nModal.propTypes = {\n blur: PropTypes.bool,\n children: PropTypes.node,\n fit: PropTypes.bool,\n overflow: PropTypes.bool,\n portal: PropTypes.bool,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onBack: PropTypes.func,\n onClose: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,KAAK,GAAG,SAARA,KAAK,OAYL;EAAA,qBAXJC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IAAA,gBACRC,GAAG;IAAHA,GAAG,yBAAG,KAAK;IAAA,qBACXC,QAAQ;IAARA,QAAQ,8BAAG,IAAI;IAAA,mBACfC,MAAM;IAANA,MAAM,4BAAG,KAAK;IACdC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IACPC,MAAM,QAANA,MAAM;IACNC,OAAO,QAAPA,OAAO;IACPC,UAAU,QAAVA,U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EAAEuC,kBAAS,CAACC,IAAI;EACxBvC,MAAM,EAAEsC,kBAAS,CAACC,IAAI;EACtBtC,KAAK,EAAEqC,kBAAS,CAACG,MAAM;EACvBvC,OAAO,EAAEoC,kBAAS,CAACC,IAAI;EACvBpC,MAAM,EAAEmC,kBAAS,CAACI,IAAI;EACtBtC,OAAO,EAAEkC,kBAAS,CAACI;AACrB,CAAC"}
|
|
@@ -13,7 +13,7 @@ exports[`component:<Modal> Mobile environment prop:onClose 1`] = `
|
|
|
13
13
|
<div
|
|
14
14
|
class="view row header"
|
|
15
15
|
>
|
|
16
|
-
<
|
|
16
|
+
<div
|
|
17
17
|
class="pressable"
|
|
18
18
|
data-testid="mirai-onClose-button-close"
|
|
19
19
|
>
|
|
@@ -39,7 +39,7 @@ exports[`component:<Modal> Mobile environment prop:onClose 1`] = `
|
|
|
39
39
|
/>
|
|
40
40
|
</svg>
|
|
41
41
|
</span>
|
|
42
|
-
</
|
|
42
|
+
</div>
|
|
43
43
|
</div>
|
|
44
44
|
</div>
|
|
45
45
|
</div>
|
|
@@ -111,7 +111,7 @@ exports[`component:<Modal> prop:onBack 1`] = `
|
|
|
111
111
|
<div
|
|
112
112
|
class="view row header"
|
|
113
113
|
>
|
|
114
|
-
<
|
|
114
|
+
<div
|
|
115
115
|
class="pressable"
|
|
116
116
|
data-testid="mirai-onBack-button-back"
|
|
117
117
|
>
|
|
@@ -136,7 +136,7 @@ exports[`component:<Modal> prop:onBack 1`] = `
|
|
|
136
136
|
/>
|
|
137
137
|
</svg>
|
|
138
138
|
</span>
|
|
139
|
-
</
|
|
139
|
+
</div>
|
|
140
140
|
</div>
|
|
141
141
|
</div>
|
|
142
142
|
</div>
|
|
@@ -156,7 +156,7 @@ exports[`component:<Modal> prop:onClose 1`] = `
|
|
|
156
156
|
<div
|
|
157
157
|
class="view row header"
|
|
158
158
|
>
|
|
159
|
-
<
|
|
159
|
+
<div
|
|
160
160
|
class="pressable"
|
|
161
161
|
data-testid="mirai-onClose-button-close"
|
|
162
162
|
>
|
|
@@ -182,7 +182,7 @@ exports[`component:<Modal> prop:onClose 1`] = `
|
|
|
182
182
|
/>
|
|
183
183
|
</svg>
|
|
184
184
|
</span>
|
|
185
|
-
</
|
|
185
|
+
</div>
|
|
186
186
|
</div>
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
@@ -44,9 +44,9 @@ var Notification = function Notification(_ref) {
|
|
|
44
44
|
small: small,
|
|
45
45
|
className: (0, _helpers.styles)(_NotificationModule.default.text, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : undefined)
|
|
46
46
|
}, children), !large && onClose && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
47
|
-
tag: "button",
|
|
48
47
|
onPress: onClose,
|
|
49
|
-
className: (0, _helpers.styles)(_NotificationModule.default.pressable, _NotificationModule.default.icon)
|
|
48
|
+
className: (0, _helpers.styles)(_NotificationModule.default.pressable, _NotificationModule.default.icon),
|
|
49
|
+
"data-testid": others['data-testid'] ? "".concat(others['data-testid'], "-button-close") : undefined
|
|
50
50
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
51
51
|
value: _primitives.ICON.CLOSE,
|
|
52
52
|
paragraph: small
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","names":["Notification","children","error","info","inline","large","small","success","warning","wide","onClose","others","styles","style","notification","undefined","outlined","className","getIconState","icon","text","pressable","ICON","CLOSE","displayName","propTypes","PropTypes","any","isRequired","bool","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 warning,\n wide,\n onClose,\n ...others\n}) => (\n <View\n {...others}\n row\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 inline && style.inline,\n large ? style.large : small && style.small,\n wide && style.wide,\n others.className,\n )}\n >\n <Icon\n headline={large}\n level={large ? 1 : undefined}\n paragraph={small}\n value={getIconState({ error, success, warning })}\n className={style.icon}\n />\n <Text\n small={small}\n className={styles(\n style.text,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n >\n {children}\n </Text>\n {!large && onClose && (\n <Pressable
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["Notification","children","error","info","inline","large","small","success","warning","wide","onClose","others","styles","style","notification","undefined","outlined","className","getIconState","icon","text","pressable","ICON","CLOSE","displayName","propTypes","PropTypes","any","isRequired","bool","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 warning,\n wide,\n onClose,\n ...others\n}) => (\n <View\n {...others}\n row\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 inline && style.inline,\n large ? style.large : small && style.small,\n wide && style.wide,\n others.className,\n )}\n >\n <Icon\n headline={large}\n level={large ? 1 : undefined}\n paragraph={small}\n value={getIconState({ error, success, warning })}\n className={style.icon}\n />\n <Text\n small={small}\n className={styles(\n style.text,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n >\n {children}\n </Text>\n {!large && onClose && (\n <Pressable\n onPress={onClose}\n className={styles(style.pressable, style.icon)}\n data-testid={others['data-testid'] ? `${others['data-testid']}-button-close` : undefined}\n >\n <Icon value={ICON.CLOSE} paragraph={small} />\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 warning: PropTypes.bool,\n wide: PropTypes.bool,\n onClose: PropTypes.func,\n};\n\nexport { Notification };\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAE9C,IAAMA,YAAY,GAAG,SAAfA,YAAY;EAAA,IAChBC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,IAAI,QAAJA,IAAI;IAAA,mBACJC,MAAM;IAANA,MAAM,4BAAG,KAAK;IACdC,KAAK,QAALA,KAAK;IACLC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;IACJC,MAAM;EAAA,oBAET,6BAAC,gBAAI,eACCA,MAAM;IACV,GAAG;IACH,SAAS,EAAE,IAAAC,eAAM,EACfC,2BAAK,CAACC,YAAY,EAClBZ,KAAK,GAAGW,2BAAK,CAACX,KAAK,GAAGM,OAAO,GAAGK,2BAAK,CAACL,OAAO,GAAGD,OAAO,GAAGM,2BAAK,CAACN,OAAO,GAAGJ,IAAI,GAAGU,2BAAK,CAACV,IAAI,GAAGY,SAAS,EACvGX,MAAM,GAAGS,2BAAK,CAACT,MAAM,GAAGS,2BAAK,CAACG,QAAQ,EACtCZ,MAAM,IAAIS,2BAAK,CAACT,MAAM,EACtBC,KAAK,GAAGQ,2BAAK,CAACR,KAAK,GAAGC,KAAK,IAAIO,2BAAK,CAACP,KAAK,EAC1CG,IAAI,IAAII,2BAAK,CAACJ,IAAI,EAClBE,MAAM,CAACM,SAAS;EAChB,iBAEF,6BAAC,gBAAI;IACH,QAAQ,EAAEZ,KAAM;IAChB,KAAK,EAAEA,KAAK,GAAG,CAAC,GAAGU,SAAU;IAC7B,SAAS,EAAET,KAAM;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I;EACvBpB,IAAI,EAAEiB,kBAAS,CAACG,IAAI;EACpBnB,OAAO,EAAEgB,kBAAS,CAACI;AACrB,CAAC"}
|
|
@@ -319,6 +319,7 @@ exports[`component:<Notification> prop:onClose 1`] = `
|
|
|
319
319
|
<DocumentFragment>
|
|
320
320
|
<div
|
|
321
321
|
class="view row notification outlined"
|
|
322
|
+
data-testid="mirai-onClose"
|
|
322
323
|
>
|
|
323
324
|
<span
|
|
324
325
|
class="icon headline-3 icon"
|
|
@@ -346,8 +347,9 @@ exports[`component:<Notification> prop:onClose 1`] = `
|
|
|
346
347
|
>
|
|
347
348
|
Lorem Ipsum...
|
|
348
349
|
</span>
|
|
349
|
-
<
|
|
350
|
+
<div
|
|
350
351
|
class="pressable pressable icon"
|
|
352
|
+
data-testid="mirai-onClose-button-close"
|
|
351
353
|
>
|
|
352
354
|
<span
|
|
353
355
|
class="icon headline-3"
|
|
@@ -370,7 +372,7 @@ exports[`component:<Notification> prop:onClose 1`] = `
|
|
|
370
372
|
/>
|
|
371
373
|
</svg>
|
|
372
374
|
</span>
|
|
373
|
-
</
|
|
375
|
+
</div>
|
|
374
376
|
</div>
|
|
375
377
|
</DocumentFragment>
|
|
376
378
|
`;
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
input.input,
|
|
2
|
-
textarea.input {
|
|
3
|
-
border: none;
|
|
4
|
-
margin: 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
1
|
.input {
|
|
8
2
|
background-color: var(--mirai-ui-input-background);
|
|
9
3
|
box-sizing: border-box;
|
|
@@ -28,17 +22,25 @@ textarea.input {
|
|
|
28
22
|
color: var(--mirai-ui-input-disabled);
|
|
29
23
|
}
|
|
30
24
|
|
|
31
|
-
|
|
25
|
+
/* -- reset defaults -------------------------------------------------------- */
|
|
26
|
+
input.input,
|
|
27
|
+
textarea.input {
|
|
28
|
+
border: none;
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
input.input::-webkit-search-cancel-button {
|
|
32
33
|
-webkit-appearance: none;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
.input::-ms-clear {
|
|
36
|
+
input.input::-ms-clear {
|
|
36
37
|
appearance: none;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
.input
|
|
40
|
-
.input:-webkit-autofill
|
|
41
|
-
.input:-webkit-autofill:
|
|
40
|
+
input.input:focus,
|
|
41
|
+
input.input:-webkit-autofill,
|
|
42
|
+
input.input:-webkit-autofill:hover,
|
|
43
|
+
input.input:-webkit-autofill:focus {
|
|
42
44
|
-webkit-box-shadow: 0 0 0px 1000px var(--mirai-ui-input-background) inset;
|
|
43
45
|
-webkit-text-fill-color: var(--mirai-ui-input-color);
|
|
44
46
|
transition: none;
|