@mirai/ui 1.0.9 → 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 +28 -1
- package/build/components/Button/Button.module.css +20 -13
- 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/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/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/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/Modal/Modal.module.css +5 -3
- package/build/components/Table/Table.module.css +27 -25
- 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/Input/Input.module.css +13 -5
- package/build/primitives/Layer/Layer.js +89 -0
- package/build/primitives/Layer/Layer.js.map +1 -0
- package/build/primitives/Layer/Layer.module.css +10 -0
- package/build/primitives/Layer/LayerContent.js +22 -0
- package/build/primitives/Layer/LayerContent.js.map +1 -0
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +55 -0
- package/build/primitives/Layer/helpers/getElementLayout.js +23 -0
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -0
- package/build/primitives/Layer/helpers/getLayerPosition.js +43 -0
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -0
- package/build/primitives/Layer/helpers/index.js +32 -0
- package/build/primitives/Layer/helpers/index.js.map +1 -0
- package/build/primitives/Layer/index.js +32 -0
- package/build/primitives/Layer/index.js.map +1 -0
- 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/ScrollView/ScrollView.module.css +1 -1
- package/build/primitives/Select/Select.module.css +9 -7
- 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/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/View/View.js +12 -3
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/index.js +33 -20
- package/build/primitives/index.js.map +1 -1
- package/build/theme/default.theme.css +23 -7
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _getElementLayout = require("./getElementLayout");
|
|
8
|
+
|
|
9
|
+
Object.keys(_getElementLayout).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _getElementLayout[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _getElementLayout[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _getLayerPosition = require("./getLayerPosition");
|
|
21
|
+
|
|
22
|
+
Object.keys(_getLayerPosition).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _getLayerPosition[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _getLayerPosition[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../../src/primitives/Layer/helpers/index.js"],"sourcesContent":["export * from './getElementLayout';\nexport * from './getLayerPosition';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _Layer = require("./Layer");
|
|
8
|
+
|
|
9
|
+
Object.keys(_Layer).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _Layer[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _Layer[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _LayerContent = require("./LayerContent");
|
|
21
|
+
|
|
22
|
+
Object.keys(_LayerContent).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _LayerContent[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _LayerContent[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Layer/index.js"],"sourcesContent":["export * from './Layer';\nexport * from './LayerContent';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -31,15 +31,17 @@ var Radio = function Radio(_ref) {
|
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
-
className: (0, _helpers.styles)(_RadioModule.default.radio, others.className)
|
|
35
|
-
|
|
34
|
+
className: (0, _helpers.styles)(_RadioModule.default.radio, others.className),
|
|
35
|
+
style: others.style
|
|
36
|
+
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
36
37
|
checked: checked,
|
|
38
|
+
"data-testid": others['data-testid'],
|
|
37
39
|
disabled: disabled,
|
|
38
40
|
name: name,
|
|
39
41
|
type: "radio",
|
|
40
42
|
value: value,
|
|
41
43
|
onChange: !disabled ? handleChange : undefined
|
|
42
|
-
})
|
|
44
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
43
45
|
className: _RadioModule.default.checkmark
|
|
44
46
|
}));
|
|
45
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","names":["Radio","checked","disabled","name","value","onChange","others","handleChange","event","style","radio","className","undefined","checkmark","displayName"],"sources":["../../../src/primitives/Radio/Radio.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Radio.module.css';\n\nconst Radio = ({ checked, disabled, name, value = '', onChange, ...others }) => {\n const handleChange = (event) => {\n onChange && onChange(value, event);\n };\n\n return (\n <div className={styles(style.radio, others.className)}>\n <input\n {
|
|
1
|
+
{"version":3,"file":"Radio.js","names":["Radio","checked","disabled","name","value","onChange","others","handleChange","event","style","radio","className","undefined","checkmark","displayName"],"sources":["../../../src/primitives/Radio/Radio.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Radio.module.css';\n\nconst Radio = ({ checked, disabled, name, value = '', onChange, ...others }) => {\n const handleChange = (event) => {\n onChange && onChange(value, event);\n };\n\n return (\n <div className={styles(style.radio, others.className)} style={others.style}>\n <input\n checked={checked}\n data-testid={others['data-testid']}\n disabled={disabled}\n name={name}\n type=\"radio\"\n value={value}\n onChange={!disabled ? handleChange : undefined}\n />\n <span className={style.checkmark} />\n </div>\n );\n};\n\nRadio.displayName = 'Primitive:Radio';\n\nRadio.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n name: PropTypes.string.isRequired,\n value: PropTypes.string,\n onChange: PropTypes.func,\n};\n\nexport { Radio };\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAAkE;EAAA,IAA/DC,OAA+D,QAA/DA,OAA+D;EAAA,IAAtDC,QAAsD,QAAtDA,QAAsD;EAAA,IAA5CC,IAA4C,QAA5CA,IAA4C;EAAA,sBAAtCC,KAAsC;EAAA,IAAtCA,KAAsC,2BAA9B,EAA8B;EAAA,IAA1BC,QAA0B,QAA1BA,QAA0B;EAAA,IAAbC,MAAa;;EAC9E,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;IAC9BH,QAAQ,IAAIA,QAAQ,CAACD,KAAD,EAAQI,KAAR,CAApB;EACD,CAFD;;EAIA,oBACE;IAAK,SAAS,EAAE,qBAAOC,qBAAMC,KAAb,EAAoBJ,MAAM,CAACK,SAA3B,CAAhB;IAAuD,KAAK,EAAEL,MAAM,CAACG;EAArE,gBACE;IACE,OAAO,EAAER,OADX;IAEE,eAAaK,MAAM,CAAC,aAAD,CAFrB;IAGE,QAAQ,EAAEJ,QAHZ;IAIE,IAAI,EAAEC,IAJR;IAKE,IAAI,EAAC,OALP;IAME,KAAK,EAAEC,KANT;IAOE,QAAQ,EAAE,CAACF,QAAD,GAAYK,YAAZ,GAA2BK;EAPvC,EADF,eAUE;IAAM,SAAS,EAAEH,qBAAMI;EAAvB,EAVF,CADF;AAcD,CAnBD;;;AAqBAb,KAAK,CAACc,WAAN,GAAoB,iBAApB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-
|
|
3
|
-
--mirai-ui-radio-border
|
|
4
|
-
--mirai-ui-radio-checked
|
|
5
|
-
--mirai-ui-radio-disabled: var(--mirai-ui-
|
|
2
|
+
--mirai-ui-radio-base: var(--mirai-ui-base);
|
|
3
|
+
--mirai-ui-radio-border: var(--mirai-ui-content-400);
|
|
4
|
+
--mirai-ui-radio-checked: var(--mirai-ui-accent);
|
|
5
|
+
--mirai-ui-radio-disabled: var(--mirai-ui-content-300);
|
|
6
6
|
--mirai-ui-radio-size: var(--mirai-ui-space-L);
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
.radio input {
|
|
17
17
|
background-color: var(--mirai-ui-radio-base);
|
|
18
|
-
border:
|
|
18
|
+
border: 1px solid var(--mirai-ui-radio-border);
|
|
19
19
|
border-radius: 50%;
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
height: var(--mirai-ui-radio-size);
|
|
@@ -43,17 +43,18 @@
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
.radio input:disabled {
|
|
46
|
-
border-color: var(--mirai-ui-
|
|
46
|
+
border-color: var(--mirai-ui-radio-disabled);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
.radio input:checked:not(:disabled) {
|
|
50
|
-
|
|
50
|
+
background-color: var(--mirai-ui-radio-checked);
|
|
51
|
+
border-color: var(--mirai-ui-radio-checked);
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
.radio input:checked:disabled ~ .checkmark {
|
|
54
|
-
background-color: var(--mirai-ui-
|
|
55
|
+
background-color: var(--mirai-ui-radio-disabled);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
.radio input:checked:not(:disabled) ~ .checkmark {
|
|
58
|
-
background-color: var(--mirai-ui-radio-
|
|
59
|
+
background-color: var(--mirai-ui-radio-base);
|
|
59
60
|
}
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
.select {
|
|
2
|
-
background-color: var(--mirai-ui-
|
|
2
|
+
background-color: var(--mirai-ui-input-background);
|
|
3
3
|
border: none;
|
|
4
4
|
box-sizing: border-box;
|
|
5
|
-
color: var(--mirai-ui-
|
|
5
|
+
color: var(--mirai-ui-input-color);
|
|
6
|
+
direction: var(--mirai-ui-text-direction);
|
|
6
7
|
font-family: var(--mirai-ui-input-font);
|
|
7
8
|
font-size: var(--mirai-ui-input-font-size);
|
|
8
|
-
width: 100%;
|
|
9
9
|
margin: 0;
|
|
10
10
|
outline: none;
|
|
11
|
+
text-align: var(--mirai-ui-text-align);
|
|
11
12
|
user-select: none;
|
|
13
|
+
width: 100%;
|
|
12
14
|
|
|
13
15
|
appearance: none;
|
|
14
16
|
-webkit-appearance: none;
|
|
15
17
|
-moz-appearance: none;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
.select.empty {
|
|
19
|
-
color: var(--mirai-ui-
|
|
20
|
+
.select.empty:not(:focus) {
|
|
21
|
+
color: var(--mirai-ui-input-disabled);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.select:disabled {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
color: var(--mirai-ui-input-disabled);
|
|
26
|
+
opacity: 1;
|
|
25
27
|
}
|
|
@@ -18,8 +18,7 @@ var _SwitchModule = _interopRequireDefault(require("./Switch.module.css"));
|
|
|
18
18
|
var _excluded = ["checked", "disabled", "name", "onChange"];
|
|
19
19
|
|
|
20
20
|
var Switch = function Switch(_ref) {
|
|
21
|
-
var
|
|
22
|
-
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
21
|
+
var checked = _ref.checked,
|
|
23
22
|
disabled = _ref.disabled,
|
|
24
23
|
name = _ref.name,
|
|
25
24
|
onChange = _ref.onChange,
|
|
@@ -36,8 +35,7 @@ var Switch = function Switch(_ref) {
|
|
|
36
35
|
checked: checked,
|
|
37
36
|
disabled: disabled,
|
|
38
37
|
name: name,
|
|
39
|
-
type: "checkbox"
|
|
40
|
-
className: _SwitchModule.default.input
|
|
38
|
+
type: "checkbox"
|
|
41
39
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
42
40
|
className: _SwitchModule.default.area
|
|
43
41
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Switch.js","names":["Switch","checked","disabled","name","onChange","others","handleChange","event","style","switch","className","undefined","
|
|
1
|
+
{"version":3,"file":"Switch.js","names":["Switch","checked","disabled","name","onChange","others","handleChange","event","style","switch","className","undefined","area","toggle","displayName"],"sources":["../../../src/primitives/Switch/Switch.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Switch.module.css';\n\nconst Switch = ({ checked, disabled, name, onChange, ...others }) => {\n const handleChange = (event) => {\n onChange && onChange(!checked, event);\n };\n\n return (\n <div {...others} className={styles(style.switch, others.className)} onClick={!disabled ? handleChange : undefined}>\n <input checked={checked} disabled={disabled} name={name} type=\"checkbox\" />\n <div className={style.area}>\n <span className={style.toggle}></span>\n </div>\n </div>\n );\n};\n\nSwitch.displayName = 'Primitive:Switch';\n\nSwitch.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n name: PropTypes.string.isRequired,\n onChange: PropTypes.func,\n};\n\nexport { Switch };\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS,OAAsD;EAAA,IAAnDC,OAAmD,QAAnDA,OAAmD;EAAA,IAA1CC,QAA0C,QAA1CA,QAA0C;EAAA,IAAhCC,IAAgC,QAAhCA,IAAgC;EAAA,IAA1BC,QAA0B,QAA1BA,QAA0B;EAAA,IAAbC,MAAa;;EACnE,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;IAC9BH,QAAQ,IAAIA,QAAQ,CAAC,CAACH,OAAF,EAAWM,KAAX,CAApB;EACD,CAFD;;EAIA,oBACE,sDAASF,MAAT;IAAiB,SAAS,EAAE,qBAAOG,sBAAMC,MAAb,EAAqBJ,MAAM,CAACK,SAA5B,CAA5B;IAAoE,OAAO,EAAE,CAACR,QAAD,GAAYI,YAAZ,GAA2BK;EAAxG,iBACE;IAAO,OAAO,EAAEV,OAAhB;IAAyB,QAAQ,EAAEC,QAAnC;IAA6C,IAAI,EAAEC,IAAnD;IAAyD,IAAI,EAAC;EAA9D,EADF,eAEE;IAAK,SAAS,EAAEK,sBAAMI;EAAtB,gBACE;IAAM,SAAS,EAAEJ,sBAAMK;EAAvB,EADF,CAFF,CADF;AAQD,CAbD;;;AAeAb,MAAM,CAACc,WAAP,GAAqB,kBAArB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--mirai-ui-switch-
|
|
3
|
-
--mirai-ui-switch-
|
|
2
|
+
--mirai-ui-switch-base: var(--mirai-ui-base);
|
|
3
|
+
--mirai-ui-switch-border-color: var(--mirai-ui-content-400);
|
|
4
|
+
--mirai-ui-switch-border-size: calc(var(--mirai-ui-space-XS) / 4);
|
|
5
|
+
--mirai-ui-switch-border-radius: var(--mirai-ui-space-L);
|
|
6
|
+
--mirai-ui-switch-checked: var(--mirai-ui-accent);
|
|
7
|
+
--mirai-ui-switch-disabled: var(--mirai-ui-content-300);
|
|
4
8
|
--mirai-ui-switch-size: var(--mirai-ui-space-L);
|
|
5
9
|
}
|
|
6
10
|
|
|
@@ -9,49 +13,53 @@
|
|
|
9
13
|
box-sizing: border-box;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
.switch
|
|
16
|
+
.switch input {
|
|
13
17
|
height: 0;
|
|
18
|
+
outline: none;
|
|
14
19
|
pointer-events: none;
|
|
15
|
-
visibility: hidden;
|
|
16
|
-
width: 0;
|
|
17
20
|
position: absolute;
|
|
18
|
-
outline: none;
|
|
19
21
|
user-select: none;
|
|
22
|
+
visibility: hidden;
|
|
23
|
+
width: 0;
|
|
24
|
+
|
|
25
|
+
appearance: none;
|
|
26
|
+
-webkit-appearance: none;
|
|
27
|
+
-moz-appearance: none;
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
.switch .area {
|
|
23
31
|
align-items: center;
|
|
24
32
|
justify-content: center;
|
|
25
|
-
background-color: var(--mirai-ui-
|
|
26
|
-
border-radius: var(--mirai-ui-switch-radius);
|
|
33
|
+
background-color: var(--mirai-ui-switch-border-color);
|
|
34
|
+
border-radius: var(--mirai-ui-switch-border-radius);
|
|
27
35
|
cursor: pointer;
|
|
28
36
|
display: flex;
|
|
29
|
-
height: calc(var(--mirai-ui-switch-size) + calc(var(--mirai-ui-switch-border) * 2));
|
|
37
|
+
height: calc(var(--mirai-ui-switch-size) + calc(var(--mirai-ui-switch-border-size) * 2));
|
|
30
38
|
position: relative;
|
|
31
39
|
transition: background-color var(--mirai-ui-motion-collapse) var(--mirai-ui-motion-easing);
|
|
32
40
|
width: calc(var(--mirai-ui-switch-size) * 2);
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
.switch .toggle {
|
|
36
|
-
background-color: var(--mirai-ui-base);
|
|
37
|
-
border-radius: calc(var(--mirai-ui-switch-radius) - var(--mirai-ui-switch-border));
|
|
44
|
+
background-color: var(--mirai-ui-switch-base);
|
|
45
|
+
border-radius: calc(var(--mirai-ui-switch-border-radius) - var(--mirai-ui-switch-border-size));
|
|
38
46
|
height: var(--mirai-ui-switch-size);
|
|
39
|
-
left: var(--mirai-ui-switch-border);
|
|
47
|
+
left: var(--mirai-ui-switch-border-size);
|
|
40
48
|
position: absolute;
|
|
41
|
-
top: var(--mirai-ui-switch-border);
|
|
49
|
+
top: var(--mirai-ui-switch-border-size);
|
|
42
50
|
transition: var(--mirai-ui-motion-collapse) var(--mirai-ui-motion-easing);
|
|
43
51
|
width: var(--mirai-ui-switch-size);
|
|
44
52
|
}
|
|
45
53
|
|
|
46
|
-
.switch
|
|
47
|
-
background-color: var(--mirai-ui-
|
|
54
|
+
.switch input:checked + .area {
|
|
55
|
+
background-color: var(--mirai-ui-switch-checked);
|
|
48
56
|
}
|
|
49
57
|
|
|
50
|
-
.switch
|
|
51
|
-
background-color: var(--mirai-ui-
|
|
58
|
+
.switch input:disabled + .area {
|
|
59
|
+
background-color: var(--mirai-ui-switch-disabled);
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
.switch
|
|
55
|
-
left: calc(100% - var(--mirai-ui-switch-border));
|
|
62
|
+
.switch input:checked + .area .toggle {
|
|
63
|
+
left: calc(100% - var(--mirai-ui-switch-border-size));
|
|
56
64
|
transform: translateX(-100%);
|
|
57
65
|
}
|
|
@@ -6,7 +6,6 @@ exports[`primitive:<Switch> inherit:className 1`] = `
|
|
|
6
6
|
class="switch mirai"
|
|
7
7
|
>
|
|
8
8
|
<input
|
|
9
|
-
class="input"
|
|
10
9
|
name="name"
|
|
11
10
|
type="checkbox"
|
|
12
11
|
/>
|
|
@@ -28,7 +27,6 @@ exports[`primitive:<Switch> prop:checked 1`] = `
|
|
|
28
27
|
>
|
|
29
28
|
<input
|
|
30
29
|
checked=""
|
|
31
|
-
class="input"
|
|
32
30
|
name="name"
|
|
33
31
|
type="checkbox"
|
|
34
32
|
/>
|
|
@@ -49,7 +47,6 @@ exports[`primitive:<Switch> prop:disabled 1`] = `
|
|
|
49
47
|
class="switch"
|
|
50
48
|
>
|
|
51
49
|
<input
|
|
52
|
-
class="input"
|
|
53
50
|
disabled=""
|
|
54
51
|
name="name"
|
|
55
52
|
type="checkbox"
|
|
@@ -71,7 +68,6 @@ exports[`primitive:<Switch> render 1`] = `
|
|
|
71
68
|
class="switch"
|
|
72
69
|
>
|
|
73
70
|
<input
|
|
74
|
-
class="input"
|
|
75
71
|
name="name"
|
|
76
72
|
type="checkbox"
|
|
77
73
|
/>
|
|
@@ -93,7 +89,6 @@ exports[`primitive:<Switch> testID 1`] = `
|
|
|
93
89
|
data-testid="mirai"
|
|
94
90
|
>
|
|
95
91
|
<input
|
|
96
|
-
class="input"
|
|
97
92
|
name="name"
|
|
98
93
|
type="checkbox"
|
|
99
94
|
/>
|
|
@@ -17,21 +17,20 @@ var _helpers = require("../../helpers");
|
|
|
17
17
|
|
|
18
18
|
var _TextModule = _interopRequireDefault(require("./Text.module.css"));
|
|
19
19
|
|
|
20
|
-
var _excluded = ["action", "bold", "children", "headline", "
|
|
20
|
+
var _excluded = ["action", "bold", "children", "headline", "small", "tag", "upperCase"];
|
|
21
21
|
|
|
22
22
|
var Text = function Text(_ref) {
|
|
23
23
|
var action = _ref.action,
|
|
24
24
|
bold = _ref.bold,
|
|
25
25
|
children = _ref.children,
|
|
26
26
|
headline = _ref.headline,
|
|
27
|
-
lighten = _ref.lighten,
|
|
28
27
|
small = _ref.small,
|
|
29
28
|
_ref$tag = _ref.tag,
|
|
30
29
|
tag = _ref$tag === void 0 ? 'span' : _ref$tag,
|
|
31
30
|
upperCase = _ref.upperCase,
|
|
32
31
|
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
33
32
|
return /*#__PURE__*/_react.default.createElement(tag, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
|
|
34
|
-
className: (0, _helpers.styles)(_TextModule.default.text, bold && _TextModule.default.bold,
|
|
33
|
+
className: (0, _helpers.styles)(_TextModule.default.text, bold && _TextModule.default.bold, headline ? _TextModule.default.headline : action ? _TextModule.default.action : small ? _TextModule.default.small : _TextModule.default.paragraph, upperCase && _TextModule.default.upperCase, others.className)
|
|
35
34
|
}), children);
|
|
36
35
|
};
|
|
37
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["Text","action","bold","children","headline","
|
|
1
|
+
{"version":3,"file":"Text.js","names":["Text","action","bold","children","headline","small","tag","upperCase","others","React","createElement","className","style","text","paragraph","displayName"],"sources":["../../../src/primitives/Text/Text.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Text.module.css';\n\nconst Text = ({ action, bold, children, headline, small, tag = 'span', upperCase, ...others }) =>\n React.createElement(\n tag,\n {\n ...others,\n className: styles(\n style.text,\n bold && style.bold,\n headline ? style.headline : action ? style.action : small ? style.small : style.paragraph,\n upperCase && style.upperCase,\n others.className,\n ),\n },\n children,\n );\n\nText.displayName = 'Primitive:Text';\n\nText.propTypes = {\n action: PropTypes.bool,\n bold: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n headline: PropTypes.bool,\n upperCase: PropTypes.bool,\n small: PropTypes.bool,\n tag: PropTypes.string,\n};\n\nexport { Text };\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO;EAAA,IAAGC,MAAH,QAAGA,MAAH;EAAA,IAAWC,IAAX,QAAWA,IAAX;EAAA,IAAiBC,QAAjB,QAAiBA,QAAjB;EAAA,IAA2BC,QAA3B,QAA2BA,QAA3B;EAAA,IAAqCC,KAArC,QAAqCA,KAArC;EAAA,oBAA4CC,GAA5C;EAAA,IAA4CA,GAA5C,yBAAkD,MAAlD;EAAA,IAA0DC,SAA1D,QAA0DA,SAA1D;EAAA,IAAwEC,MAAxE;EAAA,oBACXC,eAAMC,aAAN,CACEJ,GADF,8DAGOE,MAHP;IAIIG,SAAS,EAAE,qBACTC,oBAAMC,IADG,EAETX,IAAI,IAAIU,oBAAMV,IAFL,EAGTE,QAAQ,GAAGQ,oBAAMR,QAAT,GAAoBH,MAAM,GAAGW,oBAAMX,MAAT,GAAkBI,KAAK,GAAGO,oBAAMP,KAAT,GAAiBO,oBAAME,SAHvE,EAITP,SAAS,IAAIK,oBAAML,SAJV,EAKTC,MAAM,CAACG,SALE;EAJf,IAYER,QAZF,CADW;AAAA,CAAb;;;AAgBAH,IAAI,CAACe,WAAL,GAAmB,gBAAnB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
display: inline-block;
|
|
5
5
|
font-family: var(--mirai-ui-font);
|
|
6
6
|
font-weight: var(--mirai-ui-font-weight);
|
|
7
|
+
text-align: var(--mirai-ui-text-align);
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
.bold {
|
|
@@ -11,10 +12,6 @@
|
|
|
11
12
|
font-weight: var(--mirai-ui-font-bold-weight);
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
.lighten {
|
|
15
|
-
color: var(--mirai-ui-lighten);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
15
|
.headline {
|
|
19
16
|
font-size: var(--mirai-ui-font-size-headline);
|
|
20
17
|
}
|
|
@@ -50,16 +50,6 @@ exports[`primitive:<Text> prop:headline 1`] = `
|
|
|
50
50
|
</DocumentFragment>
|
|
51
51
|
`;
|
|
52
52
|
|
|
53
|
-
exports[`primitive:<Text> prop:lighten 1`] = `
|
|
54
|
-
<DocumentFragment>
|
|
55
|
-
<span
|
|
56
|
-
class="text lighten paragraph"
|
|
57
|
-
>
|
|
58
|
-
Lorem Ipsum
|
|
59
|
-
</span>
|
|
60
|
-
</DocumentFragment>
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
53
|
exports[`primitive:<Text> prop:small 1`] = `
|
|
64
54
|
<DocumentFragment>
|
|
65
55
|
<span
|
|
@@ -11,6 +11,8 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/
|
|
|
11
11
|
|
|
12
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
13
13
|
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
14
16
|
var _react = _interopRequireDefault(require("react"));
|
|
15
17
|
|
|
16
18
|
var _helpers = require("../../helpers");
|
|
@@ -19,7 +21,7 @@ var _ViewModule = _interopRequireDefault(require("./View.module.css"));
|
|
|
19
21
|
|
|
20
22
|
var _excluded = ["children", "fit", "row", "tag"];
|
|
21
23
|
|
|
22
|
-
var View = function
|
|
24
|
+
var View = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
23
25
|
var children = _ref.children,
|
|
24
26
|
fit = _ref.fit,
|
|
25
27
|
row = _ref.row,
|
|
@@ -27,10 +29,17 @@ var View = function View(_ref) {
|
|
|
27
29
|
tag = _ref$tag === void 0 ? 'div' : _ref$tag,
|
|
28
30
|
others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
31
|
return /*#__PURE__*/_react.default.createElement(tag, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
|
|
30
|
-
className: (0, _helpers.styles)(_ViewModule.default.view, fit && _ViewModule.default.fit, row && _ViewModule.default.row, others.className)
|
|
32
|
+
className: (0, _helpers.styles)(_ViewModule.default.view, fit && _ViewModule.default.fit, row && _ViewModule.default.row, others.className),
|
|
33
|
+
ref: ref
|
|
31
34
|
}), children);
|
|
32
|
-
};
|
|
35
|
+
});
|
|
33
36
|
|
|
34
37
|
exports.View = View;
|
|
35
38
|
View.displayName = 'Primitive:View';
|
|
39
|
+
View.propTypes = {
|
|
40
|
+
children: _propTypes.default.node,
|
|
41
|
+
fit: _propTypes.default.bool,
|
|
42
|
+
row: _propTypes.default.bool,
|
|
43
|
+
tag: _propTypes.default.string
|
|
44
|
+
};
|
|
36
45
|
//# sourceMappingURL=View.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"View.js","names":["View","children","fit","row","tag","others","
|
|
1
|
+
{"version":3,"file":"View.js","names":["View","React","forwardRef","ref","children","fit","row","tag","others","createElement","className","style","view","displayName","propTypes","PropTypes","node","bool","string"],"sources":["../../../src/primitives/View/View.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './View.module.css';\n\nconst View = React.forwardRef(({ children, fit, row, tag = 'div', ...others }, ref) =>\n React.createElement(\n tag,\n {\n ...others,\n className: styles(style.view, fit && style.fit, row && style.row, others.className),\n ref: ref,\n },\n children,\n ),\n);\n\nView.displayName = 'Primitive:View';\n\nView.propTypes = {\n children: PropTypes.node,\n fit: PropTypes.bool,\n row: PropTypes.bool,\n tag: PropTypes.string,\n};\n\nexport { View };\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,IAAI,gBAAGC,eAAMC,UAAN,CAAiB,gBAAiDC,GAAjD;EAAA,IAAGC,QAAH,QAAGA,QAAH;EAAA,IAAaC,GAAb,QAAaA,GAAb;EAAA,IAAkBC,GAAlB,QAAkBA,GAAlB;EAAA,oBAAuBC,GAAvB;EAAA,IAAuBA,GAAvB,yBAA6B,KAA7B;EAAA,IAAuCC,MAAvC;EAAA,oBAC5BP,eAAMQ,aAAN,CACEF,GADF,8DAGOC,MAHP;IAIIE,SAAS,EAAE,qBAAOC,oBAAMC,IAAb,EAAmBP,GAAG,IAAIM,oBAAMN,GAAhC,EAAqCC,GAAG,IAAIK,oBAAML,GAAlD,EAAuDE,MAAM,CAACE,SAA9D,CAJf;IAKIP,GAAG,EAAEA;EALT,IAOEC,QAPF,CAD4B;AAAA,CAAjB,CAAb;;;AAYAJ,IAAI,CAACa,WAAL,GAAmB,gBAAnB;AAEAb,IAAI,CAACc,SAAL,GAAiB;EACfV,QAAQ,EAAEW,mBAAUC,IADL;EAEfX,GAAG,EAAEU,mBAAUE,IAFA;EAGfX,GAAG,EAAES,mBAAUE,IAHA;EAIfV,GAAG,EAAEQ,mBAAUG;AAJA,CAAjB"}
|
|
@@ -43,67 +43,67 @@ Object.keys(_Input).forEach(function (key) {
|
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _Layer = require("./Layer");
|
|
47
47
|
|
|
48
|
-
Object.keys(
|
|
48
|
+
Object.keys(_Layer).forEach(function (key) {
|
|
49
49
|
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (key in exports && exports[key] ===
|
|
50
|
+
if (key in exports && exports[key] === _Layer[key]) return;
|
|
51
51
|
Object.defineProperty(exports, key, {
|
|
52
52
|
enumerable: true,
|
|
53
53
|
get: function get() {
|
|
54
|
-
return
|
|
54
|
+
return _Layer[key];
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var _Pressable = require("./Pressable");
|
|
60
60
|
|
|
61
|
-
Object.keys(
|
|
61
|
+
Object.keys(_Pressable).forEach(function (key) {
|
|
62
62
|
if (key === "default" || key === "__esModule") return;
|
|
63
|
-
if (key in exports && exports[key] ===
|
|
63
|
+
if (key in exports && exports[key] === _Pressable[key]) return;
|
|
64
64
|
Object.defineProperty(exports, key, {
|
|
65
65
|
enumerable: true,
|
|
66
66
|
get: function get() {
|
|
67
|
-
return
|
|
67
|
+
return _Pressable[key];
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
var
|
|
72
|
+
var _Radio = require("./Radio");
|
|
73
73
|
|
|
74
|
-
Object.keys(
|
|
74
|
+
Object.keys(_Radio).forEach(function (key) {
|
|
75
75
|
if (key === "default" || key === "__esModule") return;
|
|
76
|
-
if (key in exports && exports[key] ===
|
|
76
|
+
if (key in exports && exports[key] === _Radio[key]) return;
|
|
77
77
|
Object.defineProperty(exports, key, {
|
|
78
78
|
enumerable: true,
|
|
79
79
|
get: function get() {
|
|
80
|
-
return
|
|
80
|
+
return _Radio[key];
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
});
|
|
84
84
|
|
|
85
|
-
var
|
|
85
|
+
var _ScrollView = require("./ScrollView");
|
|
86
86
|
|
|
87
|
-
Object.keys(
|
|
87
|
+
Object.keys(_ScrollView).forEach(function (key) {
|
|
88
88
|
if (key === "default" || key === "__esModule") return;
|
|
89
|
-
if (key in exports && exports[key] ===
|
|
89
|
+
if (key in exports && exports[key] === _ScrollView[key]) return;
|
|
90
90
|
Object.defineProperty(exports, key, {
|
|
91
91
|
enumerable: true,
|
|
92
92
|
get: function get() {
|
|
93
|
-
return
|
|
93
|
+
return _ScrollView[key];
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
97
|
|
|
98
|
-
var
|
|
98
|
+
var _Select = require("./Select");
|
|
99
99
|
|
|
100
|
-
Object.keys(
|
|
100
|
+
Object.keys(_Select).forEach(function (key) {
|
|
101
101
|
if (key === "default" || key === "__esModule") return;
|
|
102
|
-
if (key in exports && exports[key] ===
|
|
102
|
+
if (key in exports && exports[key] === _Select[key]) return;
|
|
103
103
|
Object.defineProperty(exports, key, {
|
|
104
104
|
enumerable: true,
|
|
105
105
|
get: function get() {
|
|
106
|
-
return
|
|
106
|
+
return _Select[key];
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
});
|
|
@@ -133,4 +133,17 @@ Object.keys(_Text).forEach(function (key) {
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
});
|
|
136
|
+
|
|
137
|
+
var _View = require("./View");
|
|
138
|
+
|
|
139
|
+
Object.keys(_View).forEach(function (key) {
|
|
140
|
+
if (key === "default" || key === "__esModule") return;
|
|
141
|
+
if (key in exports && exports[key] === _View[key]) return;
|
|
142
|
+
Object.defineProperty(exports, key, {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function get() {
|
|
145
|
+
return _View[key];
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
});
|
|
136
149
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/primitives/index.js"],"sourcesContent":["export * from './Checkbox';\nexport * from './Icon';\nexport * from './Input';\nexport * from './
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/primitives/index.js"],"sourcesContent":["export * from './Checkbox';\nexport * from './Icon';\nexport * from './Input';\nexport * from './Layer';\nexport * from './Pressable';\nexport * from './Radio';\nexport * from './ScrollView';\nexport * from './Select';\nexport * from './Switch';\nexport * from './Text';\nexport * from './View';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|