@mirai/ui 1.0.221 → 1.1.0-beta
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/Action/Action.js +5 -3
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.module.css +49 -50
- package/build/components/Action/Action.stories.js +8 -5
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/__tests__/__snapshots__/Action.test.js.snap +40 -26
- package/build/components/Button/Button.js +7 -5
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +30 -19
- package/build/components/Calendar/Calendar.Month.js +6 -4
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +6 -6
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +6 -3
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.js +3 -3
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +15608 -15576
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +9 -9
- package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +42 -42
- package/build/components/InputNumber/InputNumber.js +9 -7
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +129 -114
- package/build/components/InputOption/InputOption.js +7 -4
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +84 -71
- package/build/components/InputPhone/InputPhone.js +11 -11
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +331 -331
- package/build/components/InputSelect/InputSelect.js +7 -7
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +112 -112
- package/build/components/InputText/InputText.js +10 -10
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +131 -130
- package/build/components/InputText/partials/InputText.Hint.js +5 -2
- package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
- package/build/components/InputText/partials/InputText.IconState.js +5 -2
- package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +6 -3
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +8 -5
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +6 -3
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +68 -55
- package/build/components/Modal/Modal.js +8 -8
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +88 -69
- package/build/components/Notification/Notification.js +8 -5
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +143 -142
- package/build/components/Progress/Progress.js +6 -3
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/__tests__/__snapshots__/Progress.test.jsx.snap +18 -18
- package/build/components/Slider/Slider.js +11 -11
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/__tests__/__snapshots__/Slider.test.js.snap +248 -230
- package/build/components/Table/Table.ColumnFilter.js +9 -9
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.Filter.js +7 -4
- package/build/components/Table/Table.Filter.js.map +1 -1
- package/build/components/Table/Table.Row.js +7 -8
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.js +3 -3
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.stories.js +4 -5
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/__tests__/__snapshots__/Table.ColumnFilter.test.js.snap +222 -192
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +971 -949
- package/build/components/Tooltip/Tooltip.js +4 -4
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/__tests__/__snapshots__/Tooltip.test.jsx.snap +34 -24
- package/build/primitives/Checkbox/Checkbox.js +7 -3
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/__tests__/__snapshots__/Checkbox.test.js.snap +16 -16
- package/build/primitives/Icon/Icon.js +5 -3
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +60 -60
- package/build/primitives/Input/Input.js +2 -2
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Layer/Layer.js +4 -3
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/__tests__/__snapshots__/Layer.test.js.snap +42 -36
- package/build/primitives/Pressable/Pressable.constants.js +1 -1
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js +11 -5
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/__tests__/__snapshots__/Pressable.test.js.snap +14 -10
- package/build/primitives/Primitive/Primitive.js +2 -2
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/Primitive.module.css +241 -0
- package/build/primitives/Primitive/__tests__/__snapshots__/Primitive.test.js.snap +7 -7
- package/build/primitives/Primitive/helpers/getTag.js +32 -0
- package/build/primitives/Primitive/helpers/getTag.js.map +1 -0
- package/build/primitives/Primitive/helpers/index.js +11 -0
- package/build/primitives/Primitive/helpers/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +8 -5
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +21 -21
- package/build/primitives/ScrollView/ScrollView.js +3 -3
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.stories.js +6 -5
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/__tests__/__snapshots__/ScrollView.test.js.snap +20 -20
- package/build/primitives/Select/Select.js +2 -2
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Switch/Switch.js +8 -5
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +25 -25
- package/build/primitives/Text/Text.js +7 -4
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +4 -4
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +38 -38
- package/build/primitives/View/View.js +5 -3
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/__tests__/__snapshots__/View.test.js.snap +10 -10
- package/package.json +5 -1
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`primitive:<Layer> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
<
|
|
5
|
+
<ui_layer />
|
|
6
|
+
<ui_layer_content
|
|
7
7
|
class="layer hidden"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
10
|
class="mirai"
|
|
11
11
|
/>
|
|
12
|
-
</
|
|
12
|
+
</ui_layer_content>
|
|
13
13
|
</DocumentFragment>
|
|
14
14
|
`;
|
|
15
15
|
|
|
16
16
|
exports[`primitive:<Layer> renders 1`] = `
|
|
17
17
|
<DocumentFragment>
|
|
18
|
-
<
|
|
19
|
-
<
|
|
18
|
+
<ui_layer />
|
|
19
|
+
<ui_layer_content
|
|
20
20
|
class="layer hidden"
|
|
21
21
|
/>
|
|
22
22
|
</DocumentFragment>
|
|
@@ -24,10 +24,10 @@ exports[`primitive:<Layer> renders 1`] = `
|
|
|
24
24
|
|
|
25
25
|
exports[`primitive:<Layer> testId 1`] = `
|
|
26
26
|
<DocumentFragment>
|
|
27
|
-
<
|
|
27
|
+
<ui_layer
|
|
28
28
|
data-testid="mirai"
|
|
29
29
|
/>
|
|
30
|
-
<
|
|
30
|
+
<ui_layer_content
|
|
31
31
|
class="layer hidden"
|
|
32
32
|
/>
|
|
33
33
|
</DocumentFragment>
|
|
@@ -35,58 +35,61 @@ exports[`primitive:<Layer> testId 1`] = `
|
|
|
35
35
|
|
|
36
36
|
exports[`primitive:<Layer> w/ centered && visible 1`] = `
|
|
37
37
|
<DocumentFragment>
|
|
38
|
-
<
|
|
38
|
+
<ui_layer>
|
|
39
39
|
<button
|
|
40
40
|
class="pressable button"
|
|
41
|
+
tabindex="0"
|
|
41
42
|
>
|
|
42
43
|
Action
|
|
43
44
|
</button>
|
|
44
|
-
</
|
|
45
|
-
<
|
|
45
|
+
</ui_layer>
|
|
46
|
+
<ui_layer_content
|
|
46
47
|
class="layer"
|
|
47
48
|
style="left: 0px; top: 0px;"
|
|
48
49
|
>
|
|
49
|
-
<
|
|
50
|
+
<ui_text
|
|
50
51
|
class="text paragraph"
|
|
51
52
|
>
|
|
52
53
|
Mirai
|
|
53
|
-
</
|
|
54
|
-
</
|
|
54
|
+
</ui_text>
|
|
55
|
+
</ui_layer_content>
|
|
55
56
|
</DocumentFragment>
|
|
56
57
|
`;
|
|
57
58
|
|
|
58
59
|
exports[`primitive:<Layer> w/ component & <LayerContent> 1`] = `
|
|
59
60
|
<DocumentFragment>
|
|
60
|
-
<
|
|
61
|
+
<ui_layer>
|
|
61
62
|
<button
|
|
62
63
|
class="pressable button"
|
|
64
|
+
tabindex="0"
|
|
63
65
|
>
|
|
64
66
|
Action
|
|
65
67
|
</button>
|
|
66
|
-
</
|
|
67
|
-
<
|
|
68
|
+
</ui_layer>
|
|
69
|
+
<ui_layer_content
|
|
68
70
|
class="layer hidden"
|
|
69
71
|
style="left: 0px; top: 0px;"
|
|
70
72
|
>
|
|
71
|
-
<
|
|
73
|
+
<ui_text
|
|
72
74
|
class="text paragraph"
|
|
73
75
|
>
|
|
74
76
|
Mirai
|
|
75
|
-
</
|
|
76
|
-
</
|
|
77
|
+
</ui_text>
|
|
78
|
+
</ui_layer_content>
|
|
77
79
|
</DocumentFragment>
|
|
78
80
|
`;
|
|
79
81
|
|
|
80
82
|
exports[`primitive:<Layer> w/ component 1`] = `
|
|
81
83
|
<DocumentFragment>
|
|
82
|
-
<
|
|
84
|
+
<ui_layer>
|
|
83
85
|
<button
|
|
84
86
|
class="pressable button"
|
|
87
|
+
tabindex="0"
|
|
85
88
|
>
|
|
86
89
|
Action
|
|
87
90
|
</button>
|
|
88
|
-
</
|
|
89
|
-
<
|
|
91
|
+
</ui_layer>
|
|
92
|
+
<ui_layer_content
|
|
90
93
|
class="layer hidden"
|
|
91
94
|
style="left: 0px; top: 0px;"
|
|
92
95
|
/>
|
|
@@ -95,56 +98,59 @@ exports[`primitive:<Layer> w/ component 1`] = `
|
|
|
95
98
|
|
|
96
99
|
exports[`primitive:<Layer> w/ fixed 1`] = `
|
|
97
100
|
<DocumentFragment>
|
|
98
|
-
<
|
|
101
|
+
<ui_layer>
|
|
99
102
|
<button
|
|
100
103
|
class="pressable button"
|
|
104
|
+
tabindex="0"
|
|
101
105
|
>
|
|
102
106
|
Action
|
|
103
107
|
</button>
|
|
104
|
-
</
|
|
105
|
-
<
|
|
108
|
+
</ui_layer>
|
|
109
|
+
<ui_layer_content
|
|
106
110
|
class="layer fixed hidden"
|
|
107
111
|
style="left: 0px; top: 0px;"
|
|
108
112
|
>
|
|
109
|
-
<
|
|
113
|
+
<ui_text
|
|
110
114
|
class="text paragraph"
|
|
111
115
|
>
|
|
112
116
|
Mirai
|
|
113
|
-
</
|
|
114
|
-
</
|
|
117
|
+
</ui_text>
|
|
118
|
+
</ui_layer_content>
|
|
115
119
|
</DocumentFragment>
|
|
116
120
|
`;
|
|
117
121
|
|
|
118
122
|
exports[`primitive:<Layer> w/ forceRender={false} & <LayerContent> 1`] = `
|
|
119
123
|
<DocumentFragment>
|
|
120
|
-
<
|
|
124
|
+
<ui_layer>
|
|
121
125
|
<button
|
|
122
126
|
class="pressable button"
|
|
127
|
+
tabindex="0"
|
|
123
128
|
>
|
|
124
129
|
Action
|
|
125
130
|
</button>
|
|
126
|
-
</
|
|
131
|
+
</ui_layer>
|
|
127
132
|
</DocumentFragment>
|
|
128
133
|
`;
|
|
129
134
|
|
|
130
135
|
exports[`primitive:<Layer> w/ visible 1`] = `
|
|
131
136
|
<DocumentFragment>
|
|
132
|
-
<
|
|
137
|
+
<ui_layer>
|
|
133
138
|
<button
|
|
134
139
|
class="pressable button"
|
|
140
|
+
tabindex="0"
|
|
135
141
|
>
|
|
136
142
|
Action
|
|
137
143
|
</button>
|
|
138
|
-
</
|
|
139
|
-
<
|
|
144
|
+
</ui_layer>
|
|
145
|
+
<ui_layer_content
|
|
140
146
|
class="layer"
|
|
141
147
|
style="left: 0px; top: 0px;"
|
|
142
148
|
>
|
|
143
|
-
<
|
|
149
|
+
<ui_text
|
|
144
150
|
class="text paragraph"
|
|
145
151
|
>
|
|
146
152
|
Mirai
|
|
147
|
-
</
|
|
148
|
-
</
|
|
153
|
+
</ui_text>
|
|
154
|
+
</ui_layer_content>
|
|
149
155
|
</DocumentFragment>
|
|
150
156
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.constants.js","names":["KEY_ENTER"],"sources":["../../../src/primitives/Pressable/Pressable.constants.js"],"sourcesContent":["const KEY_ENTER =
|
|
1
|
+
{"version":3,"file":"Pressable.constants.js","names":["KEY_ENTER"],"sources":["../../../src/primitives/Pressable/Pressable.constants.js"],"sourcesContent":["const KEY_ENTER = 'Enter';\n\nexport { KEY_ENTER };\n"],"mappings":";;;;;;AAAA,IAAMA,SAAS,GAAG,OAAO;AAAC"}
|
|
@@ -10,8 +10,10 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _helpers = require("../../helpers");
|
|
11
11
|
var _Primitive = require("../Primitive");
|
|
12
12
|
var _Pressable = require("./Pressable.constants");
|
|
13
|
-
var
|
|
14
|
-
var _excluded = ["children", "disabled", "preventDefault", "tag", "onEnter", "onLeave", "onPress"];
|
|
13
|
+
var style = _interopRequireWildcard(require("./Pressable.module.css"));
|
|
14
|
+
var _excluded = ["children", "disabled", "preventDefault", "tabIndex", "tag", "onEnter", "onLeave", "onPress"];
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -25,8 +27,10 @@ var Pressable = function Pressable(_ref) {
|
|
|
25
27
|
disabled = _ref.disabled,
|
|
26
28
|
_ref$preventDefault = _ref.preventDefault,
|
|
27
29
|
preventDefault = _ref$preventDefault === void 0 ? true : _ref$preventDefault,
|
|
30
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
31
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
|
|
28
32
|
_ref$tag = _ref.tag,
|
|
29
|
-
tag = _ref$tag === void 0 ? '
|
|
33
|
+
tag = _ref$tag === void 0 ? 'pressable' : _ref$tag,
|
|
30
34
|
onEnter = _ref.onEnter,
|
|
31
35
|
onLeave = _ref.onLeave,
|
|
32
36
|
_ref$onPress = _ref.onPress,
|
|
@@ -37,6 +41,7 @@ var Pressable = function Pressable(_ref) {
|
|
|
37
41
|
role: others.role || 'pressable',
|
|
38
42
|
tag: tag
|
|
39
43
|
}, !disabled ? {
|
|
44
|
+
tabIndex: tabIndex,
|
|
40
45
|
onClick: function onClick(event) {
|
|
41
46
|
if (preventDefault) {
|
|
42
47
|
event.preventDefault();
|
|
@@ -45,7 +50,7 @@ var Pressable = function Pressable(_ref) {
|
|
|
45
50
|
onPress(event);
|
|
46
51
|
},
|
|
47
52
|
onKeyPress: function onKeyPress(event) {
|
|
48
|
-
if (event.
|
|
53
|
+
if (event.key === _Pressable.KEY_ENTER) {
|
|
49
54
|
if (preventDefault) {
|
|
50
55
|
event.preventDefault();
|
|
51
56
|
event.stopPropagation();
|
|
@@ -56,7 +61,7 @@ var Pressable = function Pressable(_ref) {
|
|
|
56
61
|
onMouseEnter: onEnter,
|
|
57
62
|
onMouseLeave: onLeave
|
|
58
63
|
} : {}), {}, {
|
|
59
|
-
className: (0, _helpers.styles)(
|
|
64
|
+
className: (0, _helpers.styles)(style.pressable, disabled && style.disabled, others.className)
|
|
60
65
|
}), children);
|
|
61
66
|
};
|
|
62
67
|
exports.Pressable = Pressable;
|
|
@@ -65,6 +70,7 @@ Pressable.propTypes = {
|
|
|
65
70
|
children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
66
71
|
disabled: _propTypes.default.bool,
|
|
67
72
|
preventDefault: _propTypes.default.bool,
|
|
73
|
+
tabIndex: _propTypes.default.number,
|
|
68
74
|
tag: _propTypes.default.string,
|
|
69
75
|
onEnter: _propTypes.default.func,
|
|
70
76
|
onLeave: _propTypes.default.func,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pressable.js","names":["Pressable","children","disabled","preventDefault","tag","onEnter","onLeave","onPress","others","React","createElement","Primitive","role","onClick","event","stopPropagation","onKeyPress","
|
|
1
|
+
{"version":3,"file":"Pressable.js","names":["Pressable","children","disabled","preventDefault","tabIndex","tag","onEnter","onLeave","onPress","others","React","createElement","Primitive","role","onClick","event","stopPropagation","onKeyPress","key","KEY_ENTER","onMouseEnter","onMouseLeave","className","styles","style","pressable","displayName","propTypes","PropTypes","oneOfType","string","node","bool","number","func"],"sources":["../../../src/primitives/Pressable/Pressable.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Primitive } from '../Primitive';\nimport { KEY_ENTER } from './Pressable.constants';\nimport * as style from './Pressable.module.css';\n\nconst Pressable = ({\n children,\n disabled,\n preventDefault = true,\n tabIndex = 0,\n tag = 'pressable',\n onEnter,\n onLeave,\n onPress = () => {},\n ...others\n}) =>\n React.createElement(\n Primitive,\n {\n ...others,\n disabled,\n role: others.role || 'pressable',\n tag,\n ...(!disabled\n ? {\n tabIndex,\n onClick: (event) => {\n if (preventDefault) {\n event.preventDefault();\n event.stopPropagation();\n }\n onPress(event);\n },\n onKeyPress: (event) => {\n if (event.key === KEY_ENTER) {\n if (preventDefault) {\n event.preventDefault();\n event.stopPropagation();\n }\n onPress(event);\n }\n },\n onMouseEnter: onEnter,\n onMouseLeave: onLeave,\n }\n : {}),\n className: styles(style.pressable, disabled && style.disabled, others.className),\n },\n children,\n );\n\nPressable.displayName = 'Primitive:Pressable';\n\nPressable.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n disabled: PropTypes.bool,\n preventDefault: PropTypes.bool,\n tabIndex: PropTypes.number,\n tag: PropTypes.string,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n onPress: PropTypes.func,\n};\n\nexport { Pressable };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAgD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEhD,IAAMA,SAAS,GAAG,SAAZA,SAAS;EAAA,IACbC,QAAQ,QAARA,QAAQ;IACRC,QAAQ,QAARA,QAAQ;IAAA,2BACRC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IAAA,qBACrBC,QAAQ;IAARA,QAAQ,8BAAG,CAAC;IAAA,gBACZC,GAAG;IAAHA,GAAG,yBAAG,WAAW;IACjBC,OAAO,QAAPA,OAAO;IACPC,OAAO,QAAPA,OAAO;IAAA,oBACPC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IACfC,MAAM;EAAA,oBAETC,cAAK,CAACC,aAAa,CACjBC,oBAAS,gDAEJH,MAAM;IACTP,QAAQ,EAARA,QAAQ;IACRW,IAAI,EAAEJ,MAAM,CAACI,IAAI,IAAI,WAAW;IAChCR,GAAG,EAAHA;EAAG,GACC,CAACH,QAAQ,GACT;IACEE,QAAQ,EAARA,QAAQ;IACRU,OAAO,EAAE,iBAACC,KAAK,EAAK;MAClB,IAAIZ,cAAc,EAAE;QAClBY,KAAK,CAACZ,cAAc,EAAE;QACtBY,KAAK,CAACC,eAAe,EAAE;MACzB;MACAR,OAAO,CAACO,KAAK,CAAC;IAChB,CAAC;IACDE,UAAU,EAAE,oBAACF,KAAK,EAAK;MACrB,IAAIA,KAAK,CAACG,GAAG,KAAKC,oBAAS,EAAE;QAC3B,IAAIhB,cAAc,EAAE;UAClBY,KAAK,CAACZ,cAAc,EAAE;UACtBY,KAAK,CAACC,eAAe,EAAE;QACzB;QACAR,OAAO,CAACO,KAAK,CAAC;MAChB;IACF,CAAC;IACDK,YAAY,EAAEd,OAAO;IACrBe,YAAY,EAAEd;EAChB,CAAC,GACD,CAAC,CAAC;IACNe,SAAS,EAAE,IAAAC,eAAM,EAACC,KAAK,CAACC,SAAS,EAAEvB,QAAQ,IAAIsB,KAAK,CAACtB,QAAQ,EAAEO,MAAM,CAACa,SAAS;EAAC,IAElFrB,QAAQ,CACT;AAAA;AAAC;AAEJD,SAAS,CAAC0B,WAAW,GAAG,qBAAqB;AAE7C1B,SAAS,CAAC2B,SAAS,GAAG;EACpB1B,QAAQ,EAAE2B,kBAAS,CAACC,SAAS,CAAC,CAACD,kBAAS,CAACE,MAAM,EAAEF,kBAAS,CAACG,IAAI,CAAC,CAAC;EACjE7B,QAAQ,EAAE0B,kBAAS,CAACI,IAAI;EACxB7B,cAAc,EAAEyB,kBAAS,CAACI,IAAI;EAC9B5B,QAAQ,EAAEwB,kBAAS,CAACK,MAAM;EAC1B5B,GAAG,EAAEuB,kBAAS,CAACE,MAAM;EACrBxB,OAAO,EAAEsB,kBAAS,CAACM,IAAI;EACvB3B,OAAO,EAAEqB,kBAAS,CAACM,IAAI;EACvB1B,OAAO,EAAEoB,kBAAS,CAACM;AACrB,CAAC"}
|
|
@@ -2,52 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`primitive:<Pressable> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<ui_pressable
|
|
6
6
|
class="pressable mirai"
|
|
7
|
+
tabindex="0"
|
|
7
8
|
>
|
|
8
9
|
children
|
|
9
|
-
</
|
|
10
|
+
</ui_pressable>
|
|
10
11
|
</DocumentFragment>
|
|
11
12
|
`;
|
|
12
13
|
|
|
13
14
|
exports[`primitive:<Pressable> prop:disabled 1`] = `
|
|
14
15
|
<DocumentFragment>
|
|
15
|
-
<
|
|
16
|
+
<ui_pressable
|
|
16
17
|
class="pressable disabled"
|
|
17
18
|
disabled=""
|
|
18
19
|
>
|
|
19
20
|
children
|
|
20
|
-
</
|
|
21
|
+
</ui_pressable>
|
|
21
22
|
</DocumentFragment>
|
|
22
23
|
`;
|
|
23
24
|
|
|
24
25
|
exports[`primitive:<Pressable> prop:tag 1`] = `
|
|
25
26
|
<DocumentFragment>
|
|
26
|
-
<
|
|
27
|
+
<ui_tag
|
|
27
28
|
class="pressable"
|
|
29
|
+
tabindex="0"
|
|
28
30
|
>
|
|
29
31
|
children
|
|
30
|
-
</
|
|
32
|
+
</ui_tag>
|
|
31
33
|
</DocumentFragment>
|
|
32
34
|
`;
|
|
33
35
|
|
|
34
36
|
exports[`primitive:<Pressable> renders 1`] = `
|
|
35
37
|
<DocumentFragment>
|
|
36
|
-
<
|
|
38
|
+
<ui_pressable
|
|
37
39
|
class="pressable"
|
|
40
|
+
tabindex="0"
|
|
38
41
|
>
|
|
39
42
|
children
|
|
40
|
-
</
|
|
43
|
+
</ui_pressable>
|
|
41
44
|
</DocumentFragment>
|
|
42
45
|
`;
|
|
43
46
|
|
|
44
47
|
exports[`primitive:<Pressable> testId 1`] = `
|
|
45
48
|
<DocumentFragment>
|
|
46
|
-
<
|
|
49
|
+
<ui_pressable
|
|
47
50
|
class="pressable"
|
|
48
51
|
data-testid="mirai"
|
|
52
|
+
tabindex="0"
|
|
49
53
|
>
|
|
50
54
|
children
|
|
51
|
-
</
|
|
55
|
+
</ui_pressable>
|
|
52
56
|
</DocumentFragment>
|
|
53
57
|
`;
|
|
@@ -20,9 +20,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
20
20
|
var Primitive = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
21
21
|
var children = _ref.children,
|
|
22
22
|
_ref$tag = _ref.tag,
|
|
23
|
-
tag = _ref$tag === void 0 ? '
|
|
23
|
+
tag = _ref$tag === void 0 ? 'primitive' : _ref$tag,
|
|
24
24
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(tag, _objectSpread(_objectSpread({}, (0, _helpers.getProps)(others)), {}, {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement((0, _helpers.getTag)(tag, others), _objectSpread(_objectSpread({}, (0, _helpers.getProps)(others)), {}, {
|
|
26
26
|
ref: ref
|
|
27
27
|
}), children);
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Primitive.js","names":["Primitive","React","forwardRef","ref","children","tag","others","createElement","getProps","displayName","propTypes","PropTypes","any","role","string","testId"],"sources":["../../../src/primitives/Primitive/Primitive.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getProps } from './helpers';\n\nconst Primitive = React.forwardRef(({ children, tag = '
|
|
1
|
+
{"version":3,"file":"Primitive.js","names":["Primitive","React","forwardRef","ref","children","tag","others","createElement","getTag","getProps","displayName","propTypes","PropTypes","any","role","string","testId"],"sources":["../../../src/primitives/Primitive/Primitive.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getProps, getTag } from './helpers';\n\nconst Primitive = React.forwardRef(({ children, tag = 'primitive', ...others }, ref) =>\n React.createElement(getTag(tag, others), { ...getProps(others), ref }, children),\n);\n\nPrimitive.displayName = 'Primitive';\n\nPrimitive.propTypes = {\n children: PropTypes.any,\n role: PropTypes.string,\n tag: PropTypes.string,\n testId: PropTypes.string,\n};\n\nexport { Primitive };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AAA6C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE7C,IAAMA,SAAS,gBAAGC,cAAK,CAACC,UAAU,CAAC,gBAA6CC,GAAG;EAAA,IAA7CC,QAAQ,QAARA,QAAQ;IAAA,gBAAEC,GAAG;IAAHA,GAAG,yBAAG,WAAW;IAAKC,MAAM;EAAA,oBAC1EL,cAAK,CAACM,aAAa,CAAC,IAAAC,eAAM,EAACH,GAAG,EAAEC,MAAM,CAAC,kCAAO,IAAAG,iBAAQ,EAACH,MAAM,CAAC;IAAEH,GAAG,EAAHA;EAAG,IAAIC,QAAQ,CAAC;AAAA,EACjF;AAAC;AAEFJ,SAAS,CAACU,WAAW,GAAG,WAAW;AAEnCV,SAAS,CAACW,SAAS,GAAG;EACpBP,QAAQ,EAAEQ,kBAAS,CAACC,GAAG;EACvBC,IAAI,EAAEF,kBAAS,CAACG,MAAM;EACtBV,GAAG,EAAEO,kBAAS,CAACG,MAAM;EACrBC,MAAM,EAAEJ,kBAAS,CAACG;AACpB,CAAC"}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/* -- MARGIN ---------------------------------------------------------------- */
|
|
2
|
+
.marginXS {
|
|
3
|
+
margin: var(--mirai-ui-space-XS);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.marginS {
|
|
7
|
+
margin: var(--mirai-ui-space-S);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.marginM {
|
|
11
|
+
margin: var(--mirai-ui-space-M);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.marginL {
|
|
15
|
+
margin: var(--mirai-ui-space-L);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.marginXL {
|
|
19
|
+
margin: var(--mirai-ui-space-XL);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.marginXXL {
|
|
23
|
+
margin: var(--mirai-ui-space-XXL);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.marginTopXS {
|
|
27
|
+
margin-top: var(--mirai-ui-space-XS);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.marginTopS {
|
|
31
|
+
margin-top: var(--mirai-ui-space-S);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.marginTopM {
|
|
35
|
+
margin-top: var(--mirai-ui-space-M);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.marginTopL {
|
|
39
|
+
margin-top: var(--mirai-ui-space-L);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.marginTopXL {
|
|
43
|
+
margin-top: var(--mirai-ui-space-XL);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.marginTopXXL {
|
|
47
|
+
margin-top: var(--mirai-ui-space-XXL);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.marginRightXS {
|
|
51
|
+
margin-right: var(--mirai-ui-space-XS);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.marginRightS {
|
|
55
|
+
margin-right: var(--mirai-ui-space-S);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.marginRightM {
|
|
59
|
+
margin-right: var(--mirai-ui-space-M);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.marginRightL {
|
|
63
|
+
margin-right: var(--mirai-ui-space-L);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.marginRightXL {
|
|
67
|
+
margin-right: var(--mirai-ui-space-XL);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.marginRightXXL {
|
|
71
|
+
margin-right: var(--mirai-ui-space-XXL);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.marginBottomXS {
|
|
75
|
+
margin-bottom: var(--mirai-ui-space-XS);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.marginBottomS {
|
|
79
|
+
margin-bottom: var(--mirai-ui-space-S);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.marginBottomM {
|
|
83
|
+
margin-bottom: var(--mirai-ui-space-M);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.marginBottomL {
|
|
87
|
+
margin-bottom: var(--mirai-ui-space-L);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.marginBottomXL {
|
|
91
|
+
margin-bottom: var(--mirai-ui-space-XL);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.marginBottomXXL {
|
|
95
|
+
margin-bottom: var(--mirai-ui-space-XXL);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.marginLeftXS {
|
|
99
|
+
margin-left: var(--mirai-ui-space-XS);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.marginLeftS {
|
|
103
|
+
margin-left: var(--mirai-ui-space-S);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.marginLeftM {
|
|
107
|
+
margin-left: var(--mirai-ui-space-M);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.marginLeftL {
|
|
111
|
+
margin-left: var(--mirai-ui-space-L);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.marginLeftXL {
|
|
115
|
+
margin-left: var(--mirai-ui-space-XL);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.marginLeftXXL {
|
|
119
|
+
margin-left: var(--mirai-ui-space-XXL);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* -- PADDING --------------------------------------------------------------- */
|
|
123
|
+
.paddingXS {
|
|
124
|
+
padding: var(--mirai-ui-space-XS);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.paddingS {
|
|
128
|
+
padding: var(--mirai-ui-space-S);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.paddingM {
|
|
132
|
+
padding: var(--mirai-ui-space-M);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.paddingL {
|
|
136
|
+
padding: var(--mirai-ui-space-L);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.paddingXL {
|
|
140
|
+
padding: var(--mirai-ui-space-XL);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.paddingXXL {
|
|
144
|
+
padding: var(--mirai-ui-space-XXL);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.paddingTopXS {
|
|
148
|
+
padding-top: var(--mirai-ui-space-XS);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.paddingTopS {
|
|
152
|
+
padding-top: var(--mirai-ui-space-S);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.paddingTopM {
|
|
156
|
+
padding-top: var(--mirai-ui-space-M);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.paddingTopL {
|
|
160
|
+
padding-top: var(--mirai-ui-space-L);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.paddingTopXL {
|
|
164
|
+
padding-top: var(--mirai-ui-space-XL);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.paddingTopXXL {
|
|
168
|
+
padding-top: var(--mirai-ui-space-XXL);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.paddingRightXS {
|
|
172
|
+
padding-right: var(--mirai-ui-space-XS);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.paddingRightS {
|
|
176
|
+
padding-right: var(--mirai-ui-space-S);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.paddingRightM {
|
|
180
|
+
padding-right: var(--mirai-ui-space-M);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.paddingRightL {
|
|
184
|
+
padding-right: var(--mirai-ui-space-L);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.paddingRightXL {
|
|
188
|
+
padding-right: var(--mirai-ui-space-XL);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.paddingRightXXL {
|
|
192
|
+
padding-right: var(--mirai-ui-space-XXL);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.paddingBottomXS {
|
|
196
|
+
padding-bottom: var(--mirai-ui-space-XS);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.paddingBottomS {
|
|
200
|
+
padding-bottom: var(--mirai-ui-space-S);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.paddingBottomM {
|
|
204
|
+
padding-bottom: var(--mirai-ui-space-M);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.paddingBottomL {
|
|
208
|
+
padding-bottom: var(--mirai-ui-space-L);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.paddingBottomXL {
|
|
212
|
+
padding-bottom: var(--mirai-ui-space-XL);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.paddingBottomXXL {
|
|
216
|
+
padding-bottom: var(--mirai-ui-space-XXL);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.paddingLeftXS {
|
|
220
|
+
padding-left: var(--mirai-ui-space-XS);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.paddingLeftS {
|
|
224
|
+
padding-left: var(--mirai-ui-space-S);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.paddingLeftM {
|
|
228
|
+
padding-left: var(--mirai-ui-space-M);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.paddingLeftL {
|
|
232
|
+
padding-left: var(--mirai-ui-space-L);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.paddingLeftXL {
|
|
236
|
+
padding-left: var(--mirai-ui-space-XL);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.paddingLeftXXL {
|
|
240
|
+
padding-left: var(--mirai-ui-space-XXL);
|
|
241
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`<Primitive> inherit:className 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
5
|
+
<ui_primitive
|
|
6
6
|
class="mirai"
|
|
7
7
|
/>
|
|
8
8
|
</DocumentFragment>
|
|
@@ -10,29 +10,29 @@ exports[`<Primitive> inherit:className 1`] = `
|
|
|
10
10
|
|
|
11
11
|
exports[`<Primitive> prop:children 1`] = `
|
|
12
12
|
<DocumentFragment>
|
|
13
|
-
<
|
|
13
|
+
<ui_primitive>
|
|
14
14
|
<span>
|
|
15
15
|
mirai
|
|
16
16
|
</span>
|
|
17
|
-
</
|
|
17
|
+
</ui_primitive>
|
|
18
18
|
</DocumentFragment>
|
|
19
19
|
`;
|
|
20
20
|
|
|
21
21
|
exports[`<Primitive> prop:role 1`] = `
|
|
22
22
|
<DocumentFragment>
|
|
23
|
-
<
|
|
23
|
+
<ui_primitive />
|
|
24
24
|
</DocumentFragment>
|
|
25
25
|
`;
|
|
26
26
|
|
|
27
27
|
exports[`<Primitive> prop:tag 1`] = `
|
|
28
28
|
<DocumentFragment>
|
|
29
|
-
<
|
|
29
|
+
<ui_tag />
|
|
30
30
|
</DocumentFragment>
|
|
31
31
|
`;
|
|
32
32
|
|
|
33
33
|
exports[`<Primitive> prop:testId 1`] = `
|
|
34
34
|
<DocumentFragment>
|
|
35
|
-
<
|
|
35
|
+
<ui_primitive
|
|
36
36
|
data-testid="mirai"
|
|
37
37
|
/>
|
|
38
38
|
</DocumentFragment>
|
|
@@ -40,6 +40,6 @@ exports[`<Primitive> prop:testId 1`] = `
|
|
|
40
40
|
|
|
41
41
|
exports[`<Primitive> renders 1`] = `
|
|
42
42
|
<DocumentFragment>
|
|
43
|
-
<
|
|
43
|
+
<ui_primitive />
|
|
44
44
|
</DocumentFragment>
|
|
45
45
|
`;
|