@mirai/ui 1.0.6 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/Button.module.css +20 -13
- package/build/components/Button/index.js.map +1 -1
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.constants.js.map +1 -1
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfMonth.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfWeek.js.map +1 -1
- package/build/components/Calendar/helpers/getHeader.js.map +1 -1
- package/build/components/Calendar/helpers/getToday.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekNumber.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekdays.js.map +1 -1
- package/build/components/Calendar/helpers/index.js.map +1 -1
- package/build/components/Calendar/helpers/isJest.js.map +1 -1
- package/build/components/Calendar/index.js.map +1 -1
- package/build/components/Form/Form.js.map +1 -1
- package/build/components/Form/helpers/getChildrenErrors.js.map +1 -1
- package/build/components/Form/helpers/getChildrenValues.js.map +1 -1
- package/build/components/Form/helpers/getField.js.map +1 -1
- package/build/components/Form/helpers/groupState.js.map +1 -1
- package/build/components/Form/helpers/index.js.map +1 -1
- package/build/components/Form/index.js.map +1 -1
- package/build/components/InputNumber/InputNumber.js +10 -8
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/InputNumber.module.css +14 -2
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +78 -1
- package/build/components/InputNumber/index.js.map +1 -1
- package/build/components/InputOption/InputOption.constants.js.map +1 -1
- package/build/components/InputOption/InputOption.js +1 -1
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/InputOption.module.css +6 -1
- package/build/components/InputOption/index.js.map +1 -1
- package/build/components/InputSelect/InputSelect.js +4 -4
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +9 -9
- package/build/components/InputSelect/index.js.map +1 -1
- package/build/components/InputText/InputText.js +3 -3
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.module.css +41 -24
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +1 -1
- package/build/components/InputText/index.js.map +1 -1
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/Modal.module.css +3 -2
- package/build/components/Modal/index.js.map +1 -1
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.module.css +27 -25
- package/build/components/Table/helpers/index.js.map +1 -1
- package/build/components/Table/helpers/select.js.map +1 -1
- package/build/components/Table/index.js.map +1 -1
- package/build/components/index.js.map +1 -1
- package/build/helpers/getInputErrors.js.map +1 -1
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/isValidDate.js.map +1 -1
- package/build/helpers/isValidEmail.js.map +1 -1
- package/build/helpers/isValidPhone.js.map +1 -1
- package/build/helpers/styles.js.map +1 -1
- package/build/hooks/helpers/getNavigator.js.map +1 -1
- package/build/hooks/helpers/getResolution.js.map +1 -1
- package/build/hooks/helpers/index.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useDevice.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.js +5 -3
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.module.css +6 -6
- package/build/primitives/Checkbox/index.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/index.js.map +1 -1
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Input/Input.module.css +13 -5
- package/build/primitives/Input/helpers/index.js.map +1 -1
- package/build/primitives/Input/helpers/parseValue.js.map +1 -1
- package/build/primitives/Input/index.js.map +1 -1
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/LayerContent.js.map +1 -1
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/build/primitives/Layer/helpers/index.js.map +1 -1
- package/build/primitives/Layer/index.js.map +1 -1
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +5 -3
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/Radio.module.css +10 -9
- package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +0 -1
- package/build/primitives/Radio/index.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.module.css +1 -1
- package/build/primitives/ScrollView/index.js.map +1 -1
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Select/Select.module.css +9 -7
- package/build/primitives/Select/index.js.map +1 -1
- package/build/primitives/Switch/Switch.js +2 -4
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/Switch.module.css +27 -19
- package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +0 -5
- package/build/primitives/Switch/index.js +1 -1
- package/build/primitives/Switch/index.js.map +1 -1
- package/build/primitives/Text/Text.js +2 -3
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +1 -4
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +0 -10
- package/build/primitives/Text/index.js.map +1 -1
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/index.js.map +1 -1
- package/build/primitives/index.js.map +1 -1
- package/build/theme/default.theme.css +17 -7
- package/build/theme/helpers/camelcase.js.map +1 -1
- package/build/theme/helpers/index.js.map +1 -1
- package/build/theme/index.js.map +1 -1
- package/build/theme/theme.js.map +1 -1
- package/package.json +12 -5
|
@@ -76,6 +76,83 @@ exports[`component:<InputNumber> inherit:className 1`] = `
|
|
|
76
76
|
</DocumentFragment>
|
|
77
77
|
`;
|
|
78
78
|
|
|
79
|
+
exports[`component:<InputNumber> prop:disabled 1`] = `
|
|
80
|
+
<DocumentFragment>
|
|
81
|
+
<div
|
|
82
|
+
class="view row inputNumber"
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="view texts"
|
|
86
|
+
/>
|
|
87
|
+
<button
|
|
88
|
+
class="pressable button squared"
|
|
89
|
+
disabled=""
|
|
90
|
+
>
|
|
91
|
+
<span
|
|
92
|
+
class="icon"
|
|
93
|
+
>
|
|
94
|
+
<svg
|
|
95
|
+
fill="none"
|
|
96
|
+
height="1em"
|
|
97
|
+
stroke="currentColor"
|
|
98
|
+
stroke-linecap="round"
|
|
99
|
+
stroke-linejoin="round"
|
|
100
|
+
stroke-width="2"
|
|
101
|
+
viewBox="0 0 24 24"
|
|
102
|
+
width="1em"
|
|
103
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
104
|
+
>
|
|
105
|
+
<line
|
|
106
|
+
x1="5"
|
|
107
|
+
x2="19"
|
|
108
|
+
y1="12"
|
|
109
|
+
y2="12"
|
|
110
|
+
/>
|
|
111
|
+
</svg>
|
|
112
|
+
</span>
|
|
113
|
+
</button>
|
|
114
|
+
<span
|
|
115
|
+
class="text paragraph value"
|
|
116
|
+
>
|
|
117
|
+
0
|
|
118
|
+
</span>
|
|
119
|
+
<button
|
|
120
|
+
class="pressable button squared"
|
|
121
|
+
disabled=""
|
|
122
|
+
>
|
|
123
|
+
<span
|
|
124
|
+
class="icon"
|
|
125
|
+
>
|
|
126
|
+
<svg
|
|
127
|
+
fill="none"
|
|
128
|
+
height="1em"
|
|
129
|
+
stroke="currentColor"
|
|
130
|
+
stroke-linecap="round"
|
|
131
|
+
stroke-linejoin="round"
|
|
132
|
+
stroke-width="2"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
width="1em"
|
|
135
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
136
|
+
>
|
|
137
|
+
<line
|
|
138
|
+
x1="12"
|
|
139
|
+
x2="12"
|
|
140
|
+
y1="5"
|
|
141
|
+
y2="19"
|
|
142
|
+
/>
|
|
143
|
+
<line
|
|
144
|
+
x1="5"
|
|
145
|
+
x2="19"
|
|
146
|
+
y1="12"
|
|
147
|
+
y2="12"
|
|
148
|
+
/>
|
|
149
|
+
</svg>
|
|
150
|
+
</span>
|
|
151
|
+
</button>
|
|
152
|
+
</div>
|
|
153
|
+
</DocumentFragment>
|
|
154
|
+
`;
|
|
155
|
+
|
|
79
156
|
exports[`component:<InputNumber> prop:hint 1`] = `
|
|
80
157
|
<DocumentFragment>
|
|
81
158
|
<div
|
|
@@ -85,7 +162,7 @@ exports[`component:<InputNumber> prop:hint 1`] = `
|
|
|
85
162
|
class="view texts"
|
|
86
163
|
>
|
|
87
164
|
<span
|
|
88
|
-
class="text
|
|
165
|
+
class="text small hint"
|
|
89
166
|
>
|
|
90
167
|
hint
|
|
91
168
|
</span>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/InputNumber/index.js"],"sourcesContent":["export * from './InputNumber';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputOption.constants.js","names":["CHECKBOX","RADIO","SWITCH"],"sources":["../../../src/components/InputOption/InputOption.constants.js"],"sourcesContent":["const CHECKBOX = 'checkbox';\nconst RADIO = 'radio';\nconst SWITCH = 'switch';\n\nexport { CHECKBOX, RADIO, SWITCH };\n"],"mappings":";;;;;;AAAA,IAAMA,QAAQ,GAAG,UAAjB;;AACA,IAAMC,KAAK,GAAG,OAAd;;AACA,IAAMC,MAAM,GAAG,QAAf"}
|
|
@@ -34,7 +34,7 @@ var InputOption = function InputOption(_ref) {
|
|
|
34
34
|
_ref$onChange = _ref.onChange,
|
|
35
35
|
onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
|
|
36
36
|
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
37
|
-
var Primitive = type === _InputOption.CHECKBOX ? _primitives.Checkbox : _primitives.Radio;
|
|
37
|
+
var Primitive = type === _InputOption.CHECKBOX ? _primitives.Checkbox : type === _InputOption.RADIO ? _primitives.Radio : _primitives.Switch;
|
|
38
38
|
|
|
39
39
|
var handleChange = function handleChange(event) {
|
|
40
40
|
onChange(type === _InputOption.CHECKBOX ? !checked : value, event);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputOption.js","names":["InputOption","checked","disabled","label","name","reverse","type","CHECKBOX","value","onChange","others","Primitive","Checkbox","RADIO","Radio","Switch","handleChange","event","style","inputOption","className","icon","undefined","displayName"],"sources":["../../../src/components/InputOption/InputOption.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Checkbox, Icon, Pressable, Radio, Switch, Text } from '../../primitives';\nimport { CHECKBOX, RADIO, SWITCH } from './InputOption.constants';\nimport style from './InputOption.module.css';\n\nconst InputOption = ({\n checked,\n disabled,\n label,\n name,\n reverse,\n type = CHECKBOX,\n value = '',\n onChange = () => {},\n ...others\n}) => {\n const Primitive = type === CHECKBOX ? Checkbox : type === RADIO ? Radio : Switch;\n\n const handleChange = (event) => {\n onChange(type === CHECKBOX ? !checked : value, event);\n };\n\n return (\n <Pressable\n {...others}\n style={others.style}\n className={styles(style.inputOption, reverse && style.reverse, others.className)}\n onPress={handleChange}\n >\n <Primitive checked={checked} disabled={disabled} name={name} type={type} value={value}>\n {type === CHECKBOX && checked ? <Icon name=\"Check\" className={styles(style.icon)} /> : undefined}\n </Primitive>\n {label && <Text className={styles(style.label, disabled && style.disabled)}>{label}</Text>}\n </Pressable>\n );\n};\n\nInputOption.displayName = 'Component:InputOption';\n\nInputOption.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n reverse: PropTypes.bool,\n type: PropTypes.oneOf([CHECKBOX, RADIO, SWITCH]),\n value: PropTypes.string,\n onChange: PropTypes.func,\n};\n\nexport { InputOption };\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,OAUd;EAAA,IATJC,OASI,QATJA,OASI;EAAA,IARJC,QAQI,QARJA,QAQI;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,IANJC,IAMI,QANJA,IAMI;EAAA,IALJC,OAKI,QALJA,OAKI;EAAA,qBAJJC,IAII;EAAA,IAJJA,IAII,0BAJGC,qBAIH;EAAA,sBAHJC,KAGI;EAAA,IAHJA,KAGI,2BAHI,EAGJ;EAAA,yBAFJC,QAEI;EAAA,IAFJA,QAEI,8BAFO,YAAM,CAAE,CAEf;EAAA,IADDC,MACC;EACJ,IAAMC,SAAS,GAAGL,IAAI,KAAKC,qBAAT,GAAoBK,oBAApB,GAA+BN,IAAI,KAAKO,kBAAT,GAAiBC,iBAAjB,GAAyBC,kBAA1E;;EAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;IAC9BR,QAAQ,CAACH,IAAI,KAAKC,qBAAT,GAAoB,CAACN,OAArB,GAA+BO,KAAhC,EAAuCS,KAAvC,CAAR;EACD,CAFD;;EAIA,oBACE,6BAAC,qBAAD,oBACMP,MADN;IAEE,KAAK,EAAEA,MAAM,CAACQ,KAFhB;IAGE,SAAS,EAAE,qBAAOA,2BAAMC,WAAb,EAA0Bd,OAAO,IAAIa,2BAAMb,OAA3C,EAAoDK,MAAM,CAACU,SAA3D,CAHb;IAIE,OAAO,EAAEJ;EAJX,iBAME,6BAAC,SAAD;IAAW,OAAO,EAAEf,OAApB;IAA6B,QAAQ,EAAEC,QAAvC;IAAiD,IAAI,EAAEE,IAAvD;IAA6D,IAAI,EAAEE,IAAnE;IAAyE,KAAK,EAAEE;EAAhF,GACGF,IAAI,KAAKC,qBAAT,IAAqBN,OAArB,gBAA+B,6BAAC,gBAAD;IAAM,IAAI,EAAC,OAAX;IAAmB,SAAS,EAAE,qBAAOiB,2BAAMG,IAAb;EAA9B,EAA/B,GAAsFC,SADzF,CANF,EASGnB,KAAK,iBAAI,6BAAC,gBAAD;IAAM,SAAS,EAAE,qBAAOe,2BAAMf,KAAb,EAAoBD,QAAQ,IAAIgB,2BAAMhB,QAAtC;EAAjB,GAAmEC,KAAnE,CATZ,CADF;AAaD,CA9BD;;;AAgCAH,WAAW,CAACuB,WAAZ,GAA0B,uBAA1B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-input-option-disabled: var(--mirai-ui-
|
|
2
|
+
--mirai-ui-input-option-disabled: var(--mirai-ui-content-300);
|
|
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
|
}
|
|
@@ -32,6 +32,11 @@
|
|
|
32
32
|
flex-direction: row-reverse;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
+
.reverse .icon {
|
|
36
|
+
left: auto;
|
|
37
|
+
right: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
.reverse .label {
|
|
36
41
|
margin-left: 0;
|
|
37
42
|
margin-right: var(--mirai-ui-input-option-label-margin);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/InputOption/index.js"],"sourcesContent":["export * from './InputOption';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -67,14 +67,14 @@ var InputSelect = function InputSelect(_ref) {
|
|
|
67
67
|
className: (0, _helpers.styles)(_InputTextModule.default.inputContainer, others.className),
|
|
68
68
|
style: others.style
|
|
69
69
|
}, label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
70
|
-
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label,
|
|
70
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error, focus && _InputTextModule.default.focus, (focus || error || has.value) && _InputTextModule.default.value)
|
|
71
71
|
}, label), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
72
72
|
row: true,
|
|
73
|
-
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, focus && !error && _InputTextModule.default.focus, error && _InputTextModule.default.error)
|
|
73
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, disabled && _InputTextModule.default.disabled, focus && !error && _InputTextModule.default.focus, error && _InputTextModule.default.error)
|
|
74
74
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Select, Object.assign({}, others, {
|
|
75
75
|
disabled: disabled,
|
|
76
76
|
value: others.value || '',
|
|
77
|
-
className: _InputTextModule.default.input,
|
|
77
|
+
className: (0, _helpers.styles)(_InputTextModule.default.input, _InputTextModule.default.iconRight, !(focus || error || has.value) && _InputTextModule.default.empty),
|
|
78
78
|
style: undefined,
|
|
79
79
|
onChange: handleChange,
|
|
80
80
|
onEnter: handleEnter,
|
|
@@ -84,7 +84,7 @@ var InputSelect = function InputSelect(_ref) {
|
|
|
84
84
|
className: [_InputTextModule.default.icon, _InputTextModule.default.right]
|
|
85
85
|
})), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
86
86
|
small: true,
|
|
87
|
-
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, error && _InputTextModule.default.error)
|
|
87
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
|
|
88
88
|
}, hint));
|
|
89
89
|
};
|
|
90
90
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputSelect.js","names":["InputSelect","disabled","error","hint","label","onChange","onEnter","onLeave","others","focus","setFocus","handleChange","value","event","target","blur","handleEnter","handleLeave","has","undefined","length","style","inputContainer","className","text","inputBorder","input","iconRight","empty","icon","right","displayName"],"sources":["../../../src/components/InputSelect/InputSelect.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Select, Text, View } from '../../primitives';\nimport style from '../InputText/InputText.module.css';\n\nconst InputSelect = ({\n disabled,\n error,\n hint,\n label,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n event.target?.blur();\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const has = {\n value: others.value !== undefined && others.value?.length > 0,\n };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n disabled && style.disabled,\n error && style.error,\n focus && style.focus,\n (focus || error || has.value) && style.value,\n )}\n >\n {label}\n </Text>\n )}\n\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n focus && !error && style.focus,\n error && style.error,\n )}\n >\n <Select\n {...others}\n disabled={disabled}\n value={others.value || ''}\n className={styles(style.input, style.iconRight, !(focus || error || has.value) && style.empty)}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n {!disabled && <Icon name=\"CloseArrow\" className={[style.icon, style.right]} />}\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\nInputSelect.displayName = 'Component:InputSelect';\n\nInputSelect.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputSelect };\n"],"mappings":";;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,OASd;EAAA;;EAAA,IARJC,QAQI,QARJA,QAQI;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,IANJC,IAMI,QANJA,IAMI;EAAA,IALJC,KAKI,QALJA,KAKI;EAAA,yBAJJC,QAII;EAAA,IAJJA,QAII,8BAJO,YAAM,CAAE,CAIf;EAAA,wBAHJC,OAGI;EAAA,IAHJA,OAGI,6BAHM,YAAM,CAAE,CAGd;EAAA,wBAFJC,OAEI;EAAA,IAFJA,OAEI,6BAFM,YAAM,CAAE,CAEd;EAAA,IADDC,MACC;;EACJ,gBAA0B,qBAAS,KAAT,CAA1B;EAAA;EAAA,IAAOC,KAAP;EAAA,IAAcC,QAAd;;EAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAQC,KAAR,EAAkB;IAAA;;IACrCR,QAAQ,CAACO,KAAD,EAAQC,KAAR,CAAR;IACA,iBAAAA,KAAK,CAACC,MAAN,gEAAcC,IAAd;EACD,CAHD;;EAKA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACH,KAAD,EAAW;IAC7BH,QAAQ,CAAC,IAAD,CAAR;IACAJ,OAAO,CAACO,KAAD,CAAP;EACD,CAHD;;EAKA,IAAMI,WAAW,GAAG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,EAAER,YANZ;IAOE,OAAO,EAAEK,WAPX;IAQE,OAAO,EAAEC;EARX,GATF,EAmBG,CAAChB,QAAD,iBAAa,6BAAC,gBAAD;IAAM,IAAI,EAAC,YAAX;IAAwB,SAAS,EAAE,CAACoB,yBAAMQ,IAAP,EAAaR,yBAAMS,KAAnB;EAAnC,EAnBhB,CAhBF,EAsCG3B,IAAI,iBACH,6BAAC,gBAAD;IAAM,KAAK,MAAX;IAAY,SAAS,EAAE,qBAAOkB,yBAAMG,IAAb,EAAmBH,yBAAMlB,IAAzB,EAA+BF,QAAQ,IAAIoB,yBAAMpB,QAAjD,EAA2DC,KAAK,IAAImB,yBAAMnB,KAA1E;EAAvB,GACGC,IADH,CAvCJ,CADF;AA8CD,CA7ED;;;AA+EAH,WAAW,CAAC+B,WAAZ,GAA0B,uBAA1B"}
|
|
@@ -9,7 +9,7 @@ exports[`component:<InputSelect> inherit:className 1`] = `
|
|
|
9
9
|
class="view row inputBorder"
|
|
10
10
|
>
|
|
11
11
|
<select
|
|
12
|
-
class="select empty input"
|
|
12
|
+
class="select empty input iconRight empty"
|
|
13
13
|
name="name"
|
|
14
14
|
>
|
|
15
15
|
<option
|
|
@@ -68,10 +68,10 @@ exports[`component:<InputSelect> prop:disabled 1`] = `
|
|
|
68
68
|
class="view inputContainer"
|
|
69
69
|
>
|
|
70
70
|
<div
|
|
71
|
-
class="view row inputBorder"
|
|
71
|
+
class="view row inputBorder disabled"
|
|
72
72
|
>
|
|
73
73
|
<select
|
|
74
|
-
class="select empty input"
|
|
74
|
+
class="select empty input iconRight empty"
|
|
75
75
|
disabled=""
|
|
76
76
|
name="name"
|
|
77
77
|
>
|
|
@@ -115,7 +115,7 @@ exports[`component:<InputSelect> prop:error 1`] = `
|
|
|
115
115
|
class="view row inputBorder"
|
|
116
116
|
>
|
|
117
117
|
<select
|
|
118
|
-
class="select empty input"
|
|
118
|
+
class="select empty input iconRight empty"
|
|
119
119
|
name="name"
|
|
120
120
|
>
|
|
121
121
|
<option
|
|
@@ -177,7 +177,7 @@ exports[`component:<InputSelect> prop:hint 1`] = `
|
|
|
177
177
|
class="view row inputBorder"
|
|
178
178
|
>
|
|
179
179
|
<select
|
|
180
|
-
class="select empty input"
|
|
180
|
+
class="select empty input iconRight empty"
|
|
181
181
|
name="name"
|
|
182
182
|
>
|
|
183
183
|
<option
|
|
@@ -249,7 +249,7 @@ exports[`component:<InputSelect> prop:label 1`] = `
|
|
|
249
249
|
class="view row inputBorder"
|
|
250
250
|
>
|
|
251
251
|
<select
|
|
252
|
-
class="select empty input"
|
|
252
|
+
class="select empty input iconRight empty"
|
|
253
253
|
name="name"
|
|
254
254
|
>
|
|
255
255
|
<option
|
|
@@ -311,7 +311,7 @@ exports[`component:<InputSelect> prop:label 2`] = `
|
|
|
311
311
|
class="view row inputBorder"
|
|
312
312
|
>
|
|
313
313
|
<select
|
|
314
|
-
class="select input"
|
|
314
|
+
class="select input iconRight"
|
|
315
315
|
name="name"
|
|
316
316
|
>
|
|
317
317
|
<option
|
|
@@ -373,7 +373,7 @@ exports[`component:<InputSelect> renders 1`] = `
|
|
|
373
373
|
class="view row inputBorder"
|
|
374
374
|
>
|
|
375
375
|
<select
|
|
376
|
-
class="select empty input"
|
|
376
|
+
class="select empty input iconRight empty"
|
|
377
377
|
name="name"
|
|
378
378
|
>
|
|
379
379
|
<option
|
|
@@ -435,7 +435,7 @@ exports[`component:<InputSelect> testID 1`] = `
|
|
|
435
435
|
class="view row inputBorder"
|
|
436
436
|
>
|
|
437
437
|
<select
|
|
438
|
-
class="select empty input"
|
|
438
|
+
class="select empty input iconRight empty"
|
|
439
439
|
data-testid="mirai"
|
|
440
440
|
name="name"
|
|
441
441
|
>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/InputSelect/index.js"],"sourcesContent":["export * from './InputSelect';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -74,10 +74,10 @@ var InputText = function InputText(_ref) {
|
|
|
74
74
|
className: (0, _helpers.styles)(_InputTextModule.default.inputContainer, others.className),
|
|
75
75
|
style: others.style
|
|
76
76
|
}, label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
77
|
-
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label, focus && _InputTextModule.default.focus, error && _InputTextModule.default.error, (focus || error || has.value) && _InputTextModule.default.value)
|
|
77
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.label, disabled && _InputTextModule.default.disabled, focus && _InputTextModule.default.focus, error && _InputTextModule.default.error, (focus || error || has.value) && _InputTextModule.default.value)
|
|
78
78
|
}, label), /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
79
79
|
row: true,
|
|
80
|
-
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder,
|
|
80
|
+
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error, focus && !error && _InputTextModule.default.focus)
|
|
81
81
|
}, icon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
82
82
|
name: icon,
|
|
83
83
|
className: [_InputTextModule.default.icon, _InputTextModule.default.left]
|
|
@@ -99,7 +99,7 @@ var InputText = function InputText(_ref) {
|
|
|
99
99
|
name: password ? 'EyeClose' : 'EyeOpen'
|
|
100
100
|
}))), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
101
101
|
small: true,
|
|
102
|
-
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, error && _InputTextModule.default.error)
|
|
102
|
+
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
|
|
103
103
|
}, hint));
|
|
104
104
|
};
|
|
105
105
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"InputText.js","names":["InputText","disabled","error","hint","icon","label","type","onChange","onEnter","onLeave","others","focus","setFocus","password","setPassword","handleChange","value","event","handleEnter","handleLeave","has","undefined","length","is","style","inputContainer","className","text","inputBorder","left","input","iconLeft","pressable","displayName"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { 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 type,\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 has = {\n value: others.value !== undefined && others.value?.length > 0,\n };\n const is = { password: type === 'password' };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\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 (focus || error || has.value) && style.value,\n )}\n >\n {label}\n </Text>\n )}\n\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 {icon && <Icon name={icon} className={[style.icon, style.left]} />}\n <Input\n {...others}\n disabled={disabled}\n type={!is.password || password ? type : 'text'}\n value={others.value || ''}\n className={styles(style.input, icon && style.iconLeft)}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n {is.password && !disabled && (\n <Pressable className={style.pressable} onPress={() => setPassword(!password)}>\n <Icon name={password ? 'EyeClose' : 'EyeOpen'} />\n </Pressable>\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.string,\n label: PropTypes.string,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n type: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputText };\n"],"mappings":";;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY,OAWZ;EAAA;;EAAA,IAVJC,QAUI,QAVJA,QAUI;EAAA,IATJC,KASI,QATJA,KASI;EAAA,IARJC,IAQI,QARJA,IAQI;EAAA,IAPJC,IAOI,QAPJA,IAOI;EAAA,IANJC,KAMI,QANJA,KAMI;EAAA,IALJC,IAKI,QALJA,IAKI;EAAA,yBAJJC,QAII;EAAA,IAJJA,QAII,8BAJO,YAAM,CAAE,CAIf;EAAA,wBAHJC,OAGI;EAAA,IAHJA,OAGI,6BAHM,YAAM,CAAE,CAGd;EAAA,wBAFJC,OAEI;EAAA,IAFJA,OAEI,6BAFM,YAAM,CAAE,CAEd;EAAA,IADDC,MACC;;EACJ,gBAA0B,qBAAS,KAAT,CAA1B;EAAA;EAAA,IAAOC,KAAP;EAAA,IAAcC,QAAd;;EACA,iBAAgC,qBAAS,IAAT,CAAhC;EAAA;EAAA,IAAOC,QAAP;EAAA,IAAiBC,WAAjB;;EAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAQC,KAAR,EAAkB;IACrCV,QAAQ,CAACS,KAAD,EAAQC,KAAR,CAAR;EACD,CAFD;;EAIA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACD,KAAD,EAAW;IAC7BL,QAAQ,CAAC,IAAD,CAAR;IACAJ,OAAO,CAACS,KAAD,CAAP;EACD,CAHD;;EAK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B,EAAE,CAACV,QAAJ,IAAgBA,QAAhB,GAA2BP,IAA3B,GAAkC,MAH1C;IAIE,KAAK,EAAEI,MAAM,CAACM,KAAP,IAAgB,EAJzB;IAKE,SAAS,EAAE,qBAAOQ,yBAAMM,KAAb,EAAoB1B,IAAI,IAAIoB,yBAAMO,QAAlC,CALb;IAME,KAAK,EAAEV,SANT;IAOE,QAAQ,EAAEN,YAPZ;IAQE,OAAO,EAAEG,WARX;IASE,OAAO,EAAEC;EATX,GAVF,EAqBGI,EAAE,CAACV,QAAH,IAAe,CAACZ,QAAhB,iBACC,6BAAC,qBAAD;IAAW,SAAS,EAAEuB,yBAAMQ,SAA5B;IAAuC,OAAO,EAAE;MAAA,OAAMlB,WAAW,CAAC,CAACD,QAAF,CAAjB;IAAA;EAAhD,gBACE,6BAAC,gBAAD;IAAM,IAAI,EAAEA,QAAQ,GAAG,UAAH,GAAgB;EAApC,EADF,CAtBJ,CAhBF,EA4CGV,IAAI,iBACH,6BAAC,gBAAD;IAAM,KAAK,MAAX;IAAY,SAAS,EAAE,qBAAOqB,yBAAMG,IAAb,EAAmBH,yBAAMrB,IAAzB,EAA+BF,QAAQ,IAAIuB,yBAAMvB,QAAjD,EAA2DC,KAAK,IAAIsB,yBAAMtB,KAA1E;EAAvB,GACGC,IADH,CA7CJ,CADF;AAoDD,CAtFD;;;AAwFAH,SAAS,CAACiC,WAAV,GAAwB,qBAAxB"}
|
|
@@ -1,87 +1,104 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-input-
|
|
3
|
-
--mirai-ui-input-
|
|
4
|
-
--mirai-ui-input-
|
|
5
|
-
--mirai-ui-input-
|
|
6
|
-
--mirai-ui-input-
|
|
2
|
+
--mirai-ui-input-text-border: solid 1px var(--mirai-ui-content-400);
|
|
3
|
+
--mirai-ui-input-text-focus: var(--mirai-ui-accent);
|
|
4
|
+
--mirai-ui-input-text-padding-x: var(--mirai-ui-space-S);
|
|
5
|
+
--mirai-ui-input-text-padding-y: var(--mirai-ui-space-S);
|
|
6
|
+
--mirai-ui-input-text-radius: var(--mirai-ui-border-radius);
|
|
7
|
+
--mirai-ui-input-text-disabled: var(--mirai-ui-content-300);
|
|
8
|
+
--mirai-ui-input-text-error: var(--mirai-ui-error);
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
.inputContainer {
|
|
12
|
+
flex: 1;
|
|
13
|
+
margin-bottom: var(--mirai-ui-input-text-padding-y);
|
|
10
14
|
position: relative;
|
|
11
|
-
margin-bottom: var(--mirai-ui-input-field-padding-y);
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
.inputBorder {
|
|
15
|
-
border: var(--mirai-ui-input-
|
|
16
|
-
border-radius: var(--mirai-ui-input-
|
|
18
|
+
border: var(--mirai-ui-input-text-border);
|
|
19
|
+
border-radius: var(--mirai-ui-input-text-radius);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.inputBorder.disabled {
|
|
23
|
+
border-color: var(--mirai-ui-input-text-disabled);
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
.inputBorder.error {
|
|
20
|
-
border-color: var(--mirai-ui-error);
|
|
27
|
+
border-color: var(--mirai-ui-input-text-error);
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
.inputBorder.focus {
|
|
24
|
-
border-color: var(--mirai-ui-input-
|
|
31
|
+
border-color: var(--mirai-ui-input-text-focus);
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
.input {
|
|
28
|
-
|
|
35
|
+
border-radius: var(--mirai-ui-input-text-radius);
|
|
36
|
+
padding: var(--mirai-ui-input-text-padding-y) var(--mirai-ui-input-text-padding-x);
|
|
29
37
|
}
|
|
30
38
|
|
|
31
39
|
.input.iconLeft {
|
|
32
|
-
padding-left: calc(var(--mirai-ui-input-
|
|
40
|
+
padding-left: calc(var(--mirai-ui-input-text-padding-x) * 3);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.input.iconRight {
|
|
44
|
+
padding-right: calc(var(--mirai-ui-input-text-padding-x) * 3);
|
|
33
45
|
}
|
|
34
46
|
|
|
47
|
+
.input.empty:not(:focus),
|
|
35
48
|
.input::placeholder {
|
|
36
49
|
color: var(--mirai-ui-base);
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
.hint {
|
|
40
|
-
margin: calc(var(--mirai-ui-input-
|
|
53
|
+
margin: calc(var(--mirai-ui-input-text-padding-x) / 4) var(--mirai-ui-input-text-padding-x);
|
|
41
54
|
}
|
|
42
55
|
|
|
43
56
|
.icon {
|
|
44
|
-
color: var(--mirai-ui-
|
|
57
|
+
color: var(--mirai-ui-input-disabled);
|
|
45
58
|
pointer-events: none;
|
|
46
59
|
position: absolute;
|
|
47
60
|
}
|
|
48
61
|
|
|
49
62
|
.pressable {
|
|
50
63
|
position: absolute;
|
|
51
|
-
right: var(--mirai-ui-input-
|
|
64
|
+
right: var(--mirai-ui-input-text-padding-x);
|
|
52
65
|
}
|
|
53
66
|
|
|
54
67
|
.icon.left {
|
|
55
|
-
left: var(--mirai-ui-input-
|
|
68
|
+
left: var(--mirai-ui-input-text-padding-x);
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
.icon.right {
|
|
59
|
-
right: var(--mirai-ui-input-
|
|
72
|
+
right: var(--mirai-ui-input-text-padding-x);
|
|
60
73
|
}
|
|
61
74
|
|
|
62
75
|
.label {
|
|
63
|
-
background-color: var(--mirai-ui-
|
|
76
|
+
background-color: var(--mirai-ui-input-background);
|
|
64
77
|
font-size: var(--mirai-ui-input-font-size);
|
|
65
|
-
margin: 0 calc(var(--mirai-ui-input-
|
|
66
|
-
padding: 0 calc(var(--mirai-ui-input-
|
|
78
|
+
margin: 0 calc(var(--mirai-ui-input-text-padding-x) / 2);
|
|
79
|
+
padding: 0 calc(var(--mirai-ui-input-text-padding-x) / 2);
|
|
67
80
|
pointer-events: none;
|
|
68
81
|
position: absolute;
|
|
69
|
-
top: var(--mirai-ui-input-
|
|
82
|
+
top: var(--mirai-ui-input-text-padding-y);
|
|
70
83
|
transition: all var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
71
84
|
z-index: 1;
|
|
72
85
|
}
|
|
73
86
|
|
|
74
87
|
.label.value {
|
|
75
88
|
font-size: var(--mirai-ui-font-size-small);
|
|
76
|
-
top: calc(calc(var(--mirai-ui-input-
|
|
89
|
+
top: calc(calc(var(--mirai-ui-input-text-padding-y) * -1) + calc(var(--mirai-ui-input-text-padding-y) / 2));
|
|
77
90
|
}
|
|
78
91
|
|
|
79
92
|
.text {
|
|
80
|
-
color: var(--mirai-ui-
|
|
93
|
+
color: var(--mirai-ui-input-disabled);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.text.disabled {
|
|
97
|
+
color: var(--mirai-ui-input-text-disabled);
|
|
81
98
|
}
|
|
82
99
|
|
|
83
100
|
.text.focus {
|
|
84
|
-
color: var(--mirai-ui-input-
|
|
101
|
+
color: var(--mirai-ui-input-text-focus);
|
|
85
102
|
}
|
|
86
103
|
|
|
87
104
|
.text.error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/InputText/index.js"],"sourcesContent":["export * from './InputText';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Modal.js","names":["Modal","children","visible","onClose","others","isDesktop","style","overflow","modal","className","pressable","icon","displayName"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, Pressable, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({ children, visible, onClose, ...others }) => {\n const { isDesktop } = useDevice();\n\n return (\n <View row className={styles(style.overflow, visible && style.visible)}>\n <View {...others} fit className={styles(style.modal, visible && style.visible, others.className)}>\n <>\n {onClose && (\n <Pressable className={style.pressable} onPress={onClose}>\n <Icon name={isDesktop ? 'Close' : 'CloseArrow'} className={style.icon} />\n </Pressable>\n )}\n {children}\n </>\n </View>\n </View>\n );\n};\n\nModal.displayName = 'Component:Modal';\n\nModal.propTypes = {\n children: PropTypes.node,\n visible: PropTypes.bool,\n onClose: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAA+C;EAAA,IAA5CC,QAA4C,QAA5CA,QAA4C;EAAA,IAAlCC,OAAkC,QAAlCA,OAAkC;EAAA,IAAzBC,OAAyB,QAAzBA,OAAyB;EAAA,IAAbC,MAAa;;EAC3D,iBAAsB,uBAAtB;EAAA,IAAQC,SAAR,cAAQA,SAAR;;EAEA,oBACE,6BAAC,gBAAD;IAAM,GAAG,MAAT;IAAU,SAAS,EAAE,qBAAOC,qBAAMC,QAAb,EAAuBL,OAAO,IAAII,qBAAMJ,OAAxC;EAArB,gBACE,6BAAC,gBAAD,oBAAUE,MAAV;IAAkB,GAAG,MAArB;IAAsB,SAAS,EAAE,qBAAOE,qBAAME,KAAb,EAAoBN,OAAO,IAAII,qBAAMJ,OAArC,EAA8CE,MAAM,CAACK,SAArD;EAAjC,iBACE,4DACGN,OAAO,iBACN,6BAAC,qBAAD;IAAW,SAAS,EAAEG,qBAAMI,SAA5B;IAAuC,OAAO,EAAEP;EAAhD,gBACE,6BAAC,gBAAD;IAAM,IAAI,EAAEE,SAAS,GAAG,OAAH,GAAa,YAAlC;IAAgD,SAAS,EAAEC,qBAAMK;EAAjE,EADF,CAFJ,EAMGV,QANH,CADF,CADF,CADF;AAcD,CAjBD;;;AAmBAD,KAAK,CAACY,WAAN,GAAoB,iBAApB"}
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
background-color: var(--mirai-ui-modal-background);
|
|
10
10
|
opacity: 0;
|
|
11
11
|
pointer-events: none;
|
|
12
|
-
transform: scale(
|
|
13
|
-
transition:
|
|
12
|
+
transform: scale(1.1);
|
|
13
|
+
transition: opacity var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
14
|
+
transform var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
.modal.visible {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Modal/index.js"],"sourcesContent":["export * from './Modal';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Table.Row.js","names":["TableRow","dataSource","schema","selected","sort","onPress","onSelect","onSort","others","isHead","undefined","fields","Object","keys","tag","testId","style","className","React","createElement","select","checkbox","map","field","head","label","hideIcon","displayName"],"sources":["../../../src/components/Table/Table.Row.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, View } from '../../primitives';\nimport { InputOption } from '../InputOption';\nimport style from './Table.module.css';\n\nconst TableRow = ({ dataSource, schema, selected, sort = {}, onPress, onSelect, onSort, ...others }) => {\n const isHead = dataSource === undefined;\n const fields = Object.keys(schema);\n const tag = isHead ? 'th' : 'td';\n const { ['data-testid']: testId } = others;\n\n return (\n <tr\n {...others}\n role=\"tr\"\n className={styles(selected && style.selected, onPress && style.onPress, others.className)}\n >\n {onSelect &&\n React.createElement(\n tag,\n { className: style.select },\n <View row>\n {!isHead && (\n <InputOption\n checked={selected}\n data-testid={testId ? `${testId}-checkbox` : undefined}\n name=\"checkbox\"\n className={style.checkbox}\n onChange={() => onSelect(dataSource)}\n />\n )}\n </View>,\n )}\n {fields.map((field) =>\n React.createElement(\n tag,\n {\n ['data-testid']: testId ? `${testId}-${field}` : undefined,\n key: field,\n onClick: !isHead && onPress ? () => onPress(dataSource) : undefined,\n },\n <View row tag=\"span\" className={isHead && style.head} onClick={isHead ? () => onSort(field) : undefined}>\n <>\n {isHead ? schema[field].label : dataSource[field]}\n {isHead && onSort && (\n <Icon name={sort[field] ? 'Down' : 'Up'} className={sort[field] === undefined && style.hideIcon} />\n )}\n </>\n </View>,\n ),\n )}\n </tr>\n );\n};\n\nTableRow.displayName = 'Table:Row';\n\nTableRow.propTypes = {\n dataSource: PropTypes.shape({}),\n schema: PropTypes.shape({}).isRequired,\n selected: PropTypes.bool,\n sort: PropTypes.shape({}),\n onPress: PropTypes.func,\n onSelect: PropTypes.func,\n onSort: PropTypes.func,\n};\n\nexport { TableRow };\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,OAAuF;EAAA,IAApFC,UAAoF,QAApFA,UAAoF;EAAA,IAAxEC,MAAwE,QAAxEA,MAAwE;EAAA,IAAhEC,QAAgE,QAAhEA,QAAgE;EAAA,qBAAtDC,IAAsD;EAAA,IAAtDA,IAAsD,0BAA/C,EAA+C;EAAA,IAA3CC,OAA2C,QAA3CA,OAA2C;EAAA,IAAlCC,QAAkC,QAAlCA,QAAkC;EAAA,IAAxBC,MAAwB,QAAxBA,MAAwB;EAAA,IAAbC,MAAa;EACtG,IAAMC,MAAM,GAAGR,UAAU,KAAKS,SAA9B;EACA,IAAMC,MAAM,GAAGC,MAAM,CAACC,IAAP,CAAYX,MAAZ,CAAf;EACA,IAAMY,GAAG,GAAGL,MAAM,GAAG,IAAH,GAAU,IAA5B;EACA,IAAyBM,MAAzB,GAAoCP,MAApC,CAAS,aAAT;EAEA,oBACE,qDACMA,MADN;IAEE,IAAI,EAAC,IAFP;IAGE,SAAS,EAAE,qBAAOL,QAAQ,IAAIa,qBAAMb,QAAzB,E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AAhB,IAA6BM,qBAAMU;IAAvF,EAHJ,CADF,CAPF,CADU;EAAA,CAAX,CArBH,CADF;AA0CD,CAhDD;;;AAkDA1B,QAAQ,CAAC2B,WAAT,GAAuB,WAAvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Table.js","names":["Table","dataSource","schema","search","onPress","onSelect","others","selected","setSelected","sort","setSort","handleSelect","row","exists","includes","next","filter","item","push","handleSort","field","undefined","testId","style","table","className","map","index"],"sources":["../../../src/components/Table/Table.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useMemo, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { select } from './helpers';\nimport style from './Table.module.css';\nimport { TableRow } from './Table.Row';\n\nexport const Table = ({ dataSource = [], schema, search, onPress, onSelect, ...others }) => {\n const [selected, setSelected] = useState([]);\n const [sort, setSort] = useState({});\n\n const handleSelect = (row) => {\n setSelected(() => {\n const exists = selected.includes(row);\n const next = selected.filter((item) => item !== row);\n if (!exists) next.push(row);\n\n onSelect(next);\n\n return next;\n });\n };\n\n const handleSort = (field) => {\n setSort(sort[field] === undefined ? { [field]: true } : sort[field] ? { [field]: false } : {});\n };\n\n const { ['data-testid']: testId } = others;\n\n return (\n <table {...others} className={styles(style.table, others.className)}>\n <thead>\n <TableRow schema={schema} sort={sort} onSelect={onSelect ? () => {} : undefined} onSort={handleSort} />\n </thead>\n <tbody>\n {useMemo(() => select(dataSource, { search, sort }), [dataSource, search, sort]).map((row, index) => (\n <TableRow\n data-testid={testId ? `${testId}-${index}` : undefined}\n dataSource={row}\n key={index}\n schema={schema}\n selected={selected.includes(row)}\n onPress={onPress}\n onSelect={onSelect ? handleSelect : undefined}\n />\n ))}\n </tbody>\n </table>\n );\n};\n\nTable.propTypes = {\n dataSource: PropTypes.arrayOf(PropTypes.shape({})),\n schema: PropTypes.shape({}).isRequired,\n search: PropTypes.string,\n onPress: PropTypes.func,\n onSelect: PropTypes.func,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