@mirai/ui 1.0.9 → 1.0.12

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.
Files changed (201) hide show
  1. package/README.md +106 -16
  2. package/package.json +1 -1
  3. package/build/components/Button/Button.js +0 -45
  4. package/build/components/Button/Button.js.map +0 -1
  5. package/build/components/Button/Button.module.css +0 -83
  6. package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +0 -113
  7. package/build/components/Button/index.js +0 -19
  8. package/build/components/Button/index.js.map +0 -1
  9. package/build/components/Calendar/Calendar.Month.js +0 -100
  10. package/build/components/Calendar/Calendar.Month.js.map +0 -1
  11. package/build/components/Calendar/Calendar.Week.js +0 -143
  12. package/build/components/Calendar/Calendar.Week.js.map +0 -1
  13. package/build/components/Calendar/Calendar.Weekdays.js +0 -40
  14. package/build/components/Calendar/Calendar.Weekdays.js.map +0 -1
  15. package/build/components/Calendar/Calendar.constants.js +0 -11
  16. package/build/components/Calendar/Calendar.constants.js.map +0 -1
  17. package/build/components/Calendar/Calendar.js +0 -151
  18. package/build/components/Calendar/Calendar.js.map +0 -1
  19. package/build/components/Calendar/Calendar.module.css +0 -110
  20. package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +0 -20357
  21. package/build/components/Calendar/helpers/getFirstDateOfMonth.js +0 -16
  22. package/build/components/Calendar/helpers/getFirstDateOfMonth.js.map +0 -1
  23. package/build/components/Calendar/helpers/getFirstDateOfWeek.js +0 -20
  24. package/build/components/Calendar/helpers/getFirstDateOfWeek.js.map +0 -1
  25. package/build/components/Calendar/helpers/getHeader.js +0 -23
  26. package/build/components/Calendar/helpers/getHeader.js.map +0 -1
  27. package/build/components/Calendar/helpers/getToday.js +0 -15
  28. package/build/components/Calendar/helpers/getToday.js.map +0 -1
  29. package/build/components/Calendar/helpers/getWeekNumber.js +0 -17
  30. package/build/components/Calendar/helpers/getWeekNumber.js.map +0 -1
  31. package/build/components/Calendar/helpers/getWeekdays.js +0 -27
  32. package/build/components/Calendar/helpers/getWeekdays.js.map +0 -1
  33. package/build/components/Calendar/helpers/index.js +0 -97
  34. package/build/components/Calendar/helpers/index.js.map +0 -1
  35. package/build/components/Calendar/helpers/isJest.js +0 -9
  36. package/build/components/Calendar/helpers/isJest.js.map +0 -1
  37. package/build/components/Calendar/index.js +0 -19
  38. package/build/components/Calendar/index.js.map +0 -1
  39. package/build/components/Form/Form.js +0 -184
  40. package/build/components/Form/Form.js.map +0 -1
  41. package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +0 -47
  42. package/build/components/Form/helpers/getChildrenErrors.js +0 -47
  43. package/build/components/Form/helpers/getChildrenErrors.js.map +0 -1
  44. package/build/components/Form/helpers/getChildrenValues.js +0 -46
  45. package/build/components/Form/helpers/getChildrenValues.js.map +0 -1
  46. package/build/components/Form/helpers/getField.js +0 -17
  47. package/build/components/Form/helpers/getField.js.map +0 -1
  48. package/build/components/Form/helpers/groupState.js +0 -29
  49. package/build/components/Form/helpers/groupState.js.map +0 -1
  50. package/build/components/Form/helpers/index.js +0 -58
  51. package/build/components/Form/helpers/index.js.map +0 -1
  52. package/build/components/Form/index.js +0 -19
  53. package/build/components/Form/index.js.map +0 -1
  54. package/build/components/InputNumber/InputNumber.js +0 -71
  55. package/build/components/InputNumber/InputNumber.js.map +0 -1
  56. package/build/components/InputNumber/InputNumber.module.css +0 -13
  57. package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +0 -621
  58. package/build/components/InputNumber/index.js +0 -19
  59. package/build/components/InputNumber/index.js.map +0 -1
  60. package/build/components/InputOption/InputOption.constants.js +0 -13
  61. package/build/components/InputOption/InputOption.constants.js.map +0 -1
  62. package/build/components/InputOption/InputOption.js +0 -63
  63. package/build/components/InputOption/InputOption.js.map +0 -1
  64. package/build/components/InputOption/InputOption.module.css +0 -38
  65. package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +0 -232
  66. package/build/components/InputOption/index.js +0 -19
  67. package/build/components/InputOption/index.js.map +0 -1
  68. package/build/components/InputSelect/InputSelect.js +0 -93
  69. package/build/components/InputSelect/InputSelect.js.map +0 -1
  70. package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +0 -490
  71. package/build/components/InputSelect/index.js +0 -19
  72. package/build/components/InputSelect/index.js.map +0 -1
  73. package/build/components/InputText/InputText.js +0 -108
  74. package/build/components/InputText/InputText.js.map +0 -1
  75. package/build/components/InputText/InputText.module.css +0 -89
  76. package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +0 -255
  77. package/build/components/InputText/index.js +0 -19
  78. package/build/components/InputText/index.js.map +0 -1
  79. package/build/components/Modal/Modal.js +0 -50
  80. package/build/components/Modal/Modal.js.map +0 -1
  81. package/build/components/Modal/Modal.module.css +0 -70
  82. package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +0 -150
  83. package/build/components/Modal/index.js +0 -19
  84. package/build/components/Modal/index.js.map +0 -1
  85. package/build/components/Table/Table.Row.js +0 -76
  86. package/build/components/Table/Table.Row.js.map +0 -1
  87. package/build/components/Table/Table.js +0 -92
  88. package/build/components/Table/Table.js.map +0 -1
  89. package/build/components/Table/Table.module.css +0 -76
  90. package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +0 -2285
  91. package/build/components/Table/helpers/index.js +0 -19
  92. package/build/components/Table/helpers/index.js.map +0 -1
  93. package/build/components/Table/helpers/select.js +0 -29
  94. package/build/components/Table/helpers/select.js.map +0 -1
  95. package/build/components/Table/index.js +0 -19
  96. package/build/components/Table/index.js.map +0 -1
  97. package/build/components/index.js +0 -123
  98. package/build/components/index.js.map +0 -1
  99. package/build/helpers/getInputErrors.js +0 -45
  100. package/build/helpers/getInputErrors.js.map +0 -1
  101. package/build/helpers/index.js +0 -32
  102. package/build/helpers/index.js.map +0 -1
  103. package/build/helpers/isValidDate.js +0 -58
  104. package/build/helpers/isValidDate.js.map +0 -1
  105. package/build/helpers/isValidEmail.js +0 -15
  106. package/build/helpers/isValidEmail.js.map +0 -1
  107. package/build/helpers/isValidPhone.js +0 -25
  108. package/build/helpers/isValidPhone.js.map +0 -1
  109. package/build/helpers/styles.js +0 -21
  110. package/build/helpers/styles.js.map +0 -1
  111. package/build/hooks/helpers/getNavigator.js +0 -33
  112. package/build/hooks/helpers/getNavigator.js.map +0 -1
  113. package/build/hooks/helpers/getResolution.js +0 -22
  114. package/build/hooks/helpers/getResolution.js.map +0 -1
  115. package/build/hooks/helpers/index.js +0 -32
  116. package/build/hooks/helpers/index.js.map +0 -1
  117. package/build/hooks/index.js +0 -19
  118. package/build/hooks/index.js.map +0 -1
  119. package/build/hooks/useDevice.js +0 -48
  120. package/build/hooks/useDevice.js.map +0 -1
  121. package/build/index.js +0 -71
  122. package/build/index.js.map +0 -1
  123. package/build/primitives/Checkbox/Checkbox.js +0 -52
  124. package/build/primitives/Checkbox/Checkbox.js.map +0 -1
  125. package/build/primitives/Checkbox/Checkbox.module.css +0 -45
  126. package/build/primitives/Checkbox/__tests__/__snapshots__/Checkbox.test.js.snap +0 -127
  127. package/build/primitives/Checkbox/index.js +0 -19
  128. package/build/primitives/Checkbox/index.js.map +0 -1
  129. package/build/primitives/Icon/Icon.constants.js +0 -29
  130. package/build/primitives/Icon/Icon.constants.js.map +0 -1
  131. package/build/primitives/Icon/Icon.js +0 -34
  132. package/build/primitives/Icon/Icon.js.map +0 -1
  133. package/build/primitives/Icon/Icon.module.css +0 -11
  134. package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +0 -133
  135. package/build/primitives/Icon/index.js +0 -31
  136. package/build/primitives/Icon/index.js.map +0 -1
  137. package/build/primitives/Input/Input.js +0 -66
  138. package/build/primitives/Input/Input.js.map +0 -1
  139. package/build/primitives/Input/Input.module.css +0 -24
  140. package/build/primitives/Input/__tests__/__snapshots__/Input.test.js.snap +0 -74
  141. package/build/primitives/Input/helpers/index.js +0 -19
  142. package/build/primitives/Input/helpers/index.js.map +0 -1
  143. package/build/primitives/Input/helpers/parseValue.js +0 -17
  144. package/build/primitives/Input/helpers/parseValue.js.map +0 -1
  145. package/build/primitives/Input/index.js +0 -19
  146. package/build/primitives/Input/index.js.map +0 -1
  147. package/build/primitives/Pressable/Pressable.constants.js +0 -9
  148. package/build/primitives/Pressable/Pressable.constants.js.map +0 -1
  149. package/build/primitives/Pressable/Pressable.js +0 -50
  150. package/build/primitives/Pressable/Pressable.js.map +0 -1
  151. package/build/primitives/Pressable/Pressable.module.css +0 -18
  152. package/build/primitives/Pressable/__tests__/__snapshots__/Pressable.test.js.snap +0 -53
  153. package/build/primitives/Pressable/index.js +0 -19
  154. package/build/primitives/Pressable/index.js.map +0 -1
  155. package/build/primitives/Radio/Radio.js +0 -49
  156. package/build/primitives/Radio/Radio.js.map +0 -1
  157. package/build/primitives/Radio/Radio.module.css +0 -59
  158. package/build/primitives/Radio/__tests__/__snapshots__/Radio.test.js.snap +0 -126
  159. package/build/primitives/Radio/index.js +0 -19
  160. package/build/primitives/Radio/index.js.map +0 -1
  161. package/build/primitives/ScrollView/ScrollView.js +0 -89
  162. package/build/primitives/ScrollView/ScrollView.js.map +0 -1
  163. package/build/primitives/ScrollView/ScrollView.module.css +0 -35
  164. package/build/primitives/ScrollView/__tests__/__snapshots__/ScrollView.test.js.snap +0 -535
  165. package/build/primitives/ScrollView/index.js +0 -19
  166. package/build/primitives/ScrollView/index.js.map +0 -1
  167. package/build/primitives/Select/Select.js +0 -70
  168. package/build/primitives/Select/Select.js.map +0 -1
  169. package/build/primitives/Select/Select.module.css +0 -25
  170. package/build/primitives/Select/__tests__/__snapshots__/Select.test.js.snap +0 -178
  171. package/build/primitives/Select/index.js +0 -19
  172. package/build/primitives/Select/index.js.map +0 -1
  173. package/build/primitives/Switch/Switch.js +0 -50
  174. package/build/primitives/Switch/Switch.js.map +0 -1
  175. package/build/primitives/Switch/Switch.module.css +0 -57
  176. package/build/primitives/Switch/__tests__/__snapshots__/Switch.test.js.snap +0 -109
  177. package/build/primitives/Switch/index.js +0 -19
  178. package/build/primitives/Switch/index.js.map +0 -1
  179. package/build/primitives/Text/Text.js +0 -40
  180. package/build/primitives/Text/Text.js.map +0 -1
  181. package/build/primitives/Text/Text.module.css +0 -36
  182. package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +0 -102
  183. package/build/primitives/Text/index.js +0 -19
  184. package/build/primitives/Text/index.js.map +0 -1
  185. package/build/primitives/View/View.js +0 -36
  186. package/build/primitives/View/View.js.map +0 -1
  187. package/build/primitives/View/View.module.css +0 -17
  188. package/build/primitives/View/__tests__/__snapshots__/View.test.js.snap +0 -62
  189. package/build/primitives/View/index.js +0 -19
  190. package/build/primitives/View/index.js.map +0 -1
  191. package/build/primitives/index.js +0 -136
  192. package/build/primitives/index.js.map +0 -1
  193. package/build/theme/default.theme.css +0 -39
  194. package/build/theme/helpers/camelcase.js +0 -16
  195. package/build/theme/helpers/camelcase.js.map +0 -1
  196. package/build/theme/helpers/index.js +0 -19
  197. package/build/theme/helpers/index.js.map +0 -1
  198. package/build/theme/index.js +0 -19
  199. package/build/theme/index.js.map +0 -1
  200. package/build/theme/theme.js +0 -43
  201. package/build/theme/theme.js.map +0 -1
package/build/index.js DELETED
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _components = require("./components");
8
-
9
- Object.keys(_components).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _components[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _components[key];
16
- }
17
- });
18
- });
19
-
20
- var _helpers = require("./helpers");
21
-
22
- Object.keys(_helpers).forEach(function (key) {
23
- if (key === "default" || key === "__esModule") return;
24
- if (key in exports && exports[key] === _helpers[key]) return;
25
- Object.defineProperty(exports, key, {
26
- enumerable: true,
27
- get: function get() {
28
- return _helpers[key];
29
- }
30
- });
31
- });
32
-
33
- var _hooks = require("./hooks");
34
-
35
- Object.keys(_hooks).forEach(function (key) {
36
- if (key === "default" || key === "__esModule") return;
37
- if (key in exports && exports[key] === _hooks[key]) return;
38
- Object.defineProperty(exports, key, {
39
- enumerable: true,
40
- get: function get() {
41
- return _hooks[key];
42
- }
43
- });
44
- });
45
-
46
- var _primitives = require("./primitives");
47
-
48
- Object.keys(_primitives).forEach(function (key) {
49
- if (key === "default" || key === "__esModule") return;
50
- if (key in exports && exports[key] === _primitives[key]) return;
51
- Object.defineProperty(exports, key, {
52
- enumerable: true,
53
- get: function get() {
54
- return _primitives[key];
55
- }
56
- });
57
- });
58
-
59
- var _theme = require("./theme");
60
-
61
- Object.keys(_theme).forEach(function (key) {
62
- if (key === "default" || key === "__esModule") return;
63
- if (key in exports && exports[key] === _theme[key]) return;
64
- Object.defineProperty(exports, key, {
65
- enumerable: true,
66
- get: function get() {
67
- return _theme[key];
68
- }
69
- });
70
- });
71
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.js"],"sourcesContent":["export * from './components';\nexport * from './helpers';\nexport * from './hooks';\nexport * from './primitives';\nexport * from './theme';\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"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Checkbox = void 0;
9
-
10
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
11
-
12
- var _react = _interopRequireDefault(require("react"));
13
-
14
- var _helpers = require("../../helpers");
15
-
16
- var _CheckboxModule = _interopRequireDefault(require("./Checkbox.module.css"));
17
-
18
- var _excluded = ["checked", "children", "disabled", "name", "value", "onChange"];
19
-
20
- var Checkbox = function Checkbox(_ref) {
21
- var checked = _ref.checked,
22
- children = _ref.children,
23
- disabled = _ref.disabled,
24
- name = _ref.name,
25
- _ref$value = _ref.value,
26
- value = _ref$value === void 0 ? '' : _ref$value,
27
- onChange = _ref.onChange,
28
- others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
-
30
- var handleChange = function handleChange(event) {
31
- var _event$target = event.target,
32
- value = _event$target.value,
33
- checked = _event$target.checked;
34
- onChange && onChange(value, checked, event);
35
- };
36
-
37
- return /*#__PURE__*/_react.default.createElement("div", {
38
- className: (0, _helpers.styles)(_CheckboxModule.default.checkbox, others.className)
39
- }, /*#__PURE__*/_react.default.createElement("input", Object.assign({}, others, {
40
- checked: checked,
41
- disabled: disabled,
42
- name: name,
43
- type: "checkbox",
44
- value: value,
45
- className: (0, _helpers.styles)(checked && _CheckboxModule.default.checked),
46
- onChange: !disabled ? handleChange : undefined
47
- })), children);
48
- };
49
-
50
- exports.Checkbox = Checkbox;
51
- Checkbox.displayName = 'Primitive:Checkbox';
52
- //# sourceMappingURL=Checkbox.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Checkbox.js","names":["Checkbox","checked","children","disabled","name","value","onChange","others","handleChange","event","target","style","checkbox","className","undefined","displayName"],"sources":["../../../src/primitives/Checkbox/Checkbox.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Checkbox.module.css';\n\nconst Checkbox = ({ checked, children, disabled, name, value = '', onChange, ...others }) => {\n const handleChange = (event) => {\n const {\n target: { value, checked },\n } = event;\n\n onChange && onChange(value, checked, event);\n };\n\n return (\n <div className={styles(style.checkbox, others.className)}>\n <input\n {...others}\n checked={checked}\n disabled={disabled}\n name={name}\n type=\"checkbox\"\n value={value}\n className={styles(checked && style.checked)}\n onChange={!disabled ? handleChange : undefined}\n />\n {children}\n </div>\n );\n};\n\nCheckbox.displayName = 'Primitive:Checkbox';\n\nCheckbox.propTypes = {\n checked: PropTypes.bool,\n children: PropTypes.node,\n disabled: PropTypes.bool,\n name: PropTypes.string.isRequired,\n value: PropTypes.string,\n onChange: PropTypes.func,\n};\n\nexport { Checkbox };\n"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;;;AAEA,IAAMA,QAAQ,GAAG,SAAXA,QAAW,OAA4E;EAAA,IAAzEC,OAAyE,QAAzEA,OAAyE;EAAA,IAAhEC,QAAgE,QAAhEA,QAAgE;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;;EAC3F,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAW;IAC9B,oBAEIA,KAFJ,CACEC,MADF;IAAA,IACYL,KADZ,iBACYA,KADZ;IAAA,IACmBJ,OADnB,iBACmBA,OADnB;IAIAK,QAAQ,IAAIA,QAAQ,CAACD,KAAD,EAAQJ,OAAR,EAAiBQ,KAAjB,CAApB;EACD,CAND;;EAQA,oBACE;IAAK,SAAS,EAAE,qBAAOE,wBAAMC,QAAb,EAAuBL,MAAM,CAACM,SAA9B;EAAhB,gBACE,wDACMN,MADN;IAEE,OAAO,EAAEN,OAFX;IAGE,QAAQ,EAAEE,QAHZ;IAIE,IAAI,EAAEC,IAJR;IAKE,IAAI,EAAC,UALP;IAME,KAAK,EAAEC,KANT;IAOE,SAAS,EAAE,qBAAOJ,OAAO,IAAIU,wBAAMV,OAAxB,CAPb;IAQE,QAAQ,EAAE,CAACE,QAAD,GAAYK,YAAZ,GAA2BM;EARvC,GADF,EAWGZ,QAXH,CADF;AAeD,CAxBD;;;AA0BAF,QAAQ,CAACe,WAAT,GAAuB,oBAAvB"}
@@ -1,45 +0,0 @@
1
- :root {
2
- --mirai-ui-checkbox-base: var(--mirai-ui-base);
3
- --mirai-ui-checkbox-border-color: var(--mirai-ui-lighten);
4
- --mirai-ui-checkbox-border-radius: var(--mirai-ui-border-radius);
5
- --mirai-ui-checkbox-checked-color: var(--mirai-ui-accent);
6
- --mirai-ui-checkbox-disabled: var(--mirai-ui-disabled);
7
- --mirai-ui-checkbox-size: var(--mirai-ui-space-L);
8
- }
9
-
10
- .checkbox {
11
- cursor: pointer;
12
- height: var(--mirai-ui-checkbox-size);
13
- width: var(--mirai-ui-checkbox-size);
14
- }
15
-
16
- .checkbox input {
17
- background-color: var(--mirai-ui-checkbox-base);
18
- border: 2px solid var(--mirai-ui-checkbox-border-color);
19
- border-radius: var(--mirai-ui-checkbox-border-radius);
20
- box-sizing: border-box;
21
- height: var(--mirai-ui-checkbox-size);
22
- margin: 0;
23
- outline: none;
24
- transition: background-color var(--mirai-ui-motion-collapse) var(--mirai-ui-motion-easing),
25
- border-color var(--mirai-ui-motion-collapse) var(--mirai-ui-motion-easing);
26
- user-select: none;
27
- width: var(--mirai-ui-checkbox-size);
28
-
29
- appearance: none;
30
- -webkit-appearance: none;
31
- -moz-appearance: none;
32
- }
33
-
34
- .checkbox input:disabled {
35
- border-color: var(--mirai-ui-checkbox-disabled);
36
- }
37
-
38
- .checkbox input:disabled.checked {
39
- background-color: var(--mirai-ui-checkbox-disabled);
40
- }
41
-
42
- .checkbox input:not(:disabled).checked {
43
- background-color: var(--mirai-ui-checkbox-checked-color);
44
- border-color: var(--mirai-ui-checkbox-checked-color);
45
- }
@@ -1,127 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`primitive:<Checkbox> inherit:className 1`] = `
4
- <DocumentFragment>
5
- <div
6
- class="checkbox mirai"
7
- >
8
- <input
9
- class=""
10
- name="name"
11
- type="checkbox"
12
- value=""
13
- />
14
- </div>
15
- </DocumentFragment>
16
- `;
17
-
18
- exports[`primitive:<Checkbox> prop:checked && disabled 1`] = `
19
- <DocumentFragment>
20
- <div
21
- class="checkbox"
22
- >
23
- <input
24
- checked=""
25
- class="checked"
26
- disabled=""
27
- name="name"
28
- type="checkbox"
29
- value=""
30
- />
31
- </div>
32
- </DocumentFragment>
33
- `;
34
-
35
- exports[`primitive:<Checkbox> prop:checked 1`] = `
36
- <DocumentFragment>
37
- <div
38
- class="checkbox"
39
- >
40
- <input
41
- checked=""
42
- class="checked"
43
- name="name"
44
- type="checkbox"
45
- value=""
46
- />
47
- </div>
48
- </DocumentFragment>
49
- `;
50
-
51
- exports[`primitive:<Checkbox> prop:children 1`] = `
52
- <DocumentFragment>
53
- <div
54
- class="checkbox"
55
- >
56
- <input
57
- class=""
58
- name="name"
59
- type="checkbox"
60
- value=""
61
- />
62
- <div />
63
- </div>
64
- </DocumentFragment>
65
- `;
66
-
67
- exports[`primitive:<Checkbox> prop:disabled 1`] = `
68
- <DocumentFragment>
69
- <div
70
- class="checkbox"
71
- >
72
- <input
73
- class=""
74
- disabled=""
75
- name="name"
76
- type="checkbox"
77
- value=""
78
- />
79
- </div>
80
- </DocumentFragment>
81
- `;
82
-
83
- exports[`primitive:<Checkbox> prop:value 1`] = `
84
- <DocumentFragment>
85
- <div
86
- class="checkbox"
87
- >
88
- <input
89
- class=""
90
- name="name"
91
- type="checkbox"
92
- value="value"
93
- />
94
- </div>
95
- </DocumentFragment>
96
- `;
97
-
98
- exports[`primitive:<Checkbox> render 1`] = `
99
- <DocumentFragment>
100
- <div
101
- class="checkbox"
102
- >
103
- <input
104
- class=""
105
- name="name"
106
- type="checkbox"
107
- value=""
108
- />
109
- </div>
110
- </DocumentFragment>
111
- `;
112
-
113
- exports[`primitive:<Checkbox> testID 1`] = `
114
- <DocumentFragment>
115
- <div
116
- class="checkbox"
117
- >
118
- <input
119
- class=""
120
- data-testid="mirai"
121
- name="name"
122
- type="checkbox"
123
- value=""
124
- />
125
- </div>
126
- </DocumentFragment>
127
- `;
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _Checkbox = require("./Checkbox");
8
-
9
- Object.keys(_Checkbox).forEach(function (key) {
10
- if (key === "default" || key === "__esModule") return;
11
- if (key in exports && exports[key] === _Checkbox[key]) return;
12
- Object.defineProperty(exports, key, {
13
- enumerable: true,
14
- get: function get() {
15
- return _Checkbox[key];
16
- }
17
- });
18
- });
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Checkbox/index.js"],"sourcesContent":["export * from './Checkbox';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ICONS = void 0;
7
-
8
- var _fi = require("react-icons/fi");
9
-
10
- var ICONS = {
11
- // directions
12
- Left: _fi.FiArrowLeft,
13
- Right: _fi.FiArrowRight,
14
- Up: _fi.FiArrowUp,
15
- Down: _fi.FiArrowDown,
16
- // Close
17
- Close: _fi.FiX,
18
- CloseArrow: _fi.FiChevronDown,
19
- // Calc
20
- Plus: _fi.FiPlus,
21
- Minus: _fi.FiMinus,
22
- // Eye
23
- EyeOpen: _fi.FiEye,
24
- EyeClose: _fi.FiEyeOff,
25
- // Check
26
- Check: _fi.FiCheck
27
- };
28
- exports.ICONS = ICONS;
29
- //# sourceMappingURL=Icon.constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.constants.js","names":["ICONS","Left","Right","Up","Down","Close","CloseArrow","Plus","Minus","EyeOpen","EyeClose","Check"],"sources":["../../../src/primitives/Icon/Icon.constants.js"],"sourcesContent":["import {\n FiArrowUp as Up,\n FiArrowDown as Down,\n FiArrowLeft as Left,\n FiArrowRight as Right,\n FiChevronDown as CloseArrow,\n FiX as Close,\n FiEye as EyeOpen,\n FiEyeOff as EyeClose,\n FiPlus as Plus,\n FiMinus as Minus,\n FiCheck as Check,\n} from 'react-icons/fi';\n\nconst ICONS = {\n // directions\n Left,\n Right,\n Up,\n Down,\n // Close\n Close,\n CloseArrow,\n // Calc\n Plus,\n Minus,\n // Eye\n EyeOpen,\n EyeClose,\n // Check\n Check,\n};\n\nexport { ICONS };\n"],"mappings":";;;;;;;AAAA;;AAcA,IAAMA,KAAK,GAAG;EACZ;EACAC,IAAI,EAAJA,eAFY;EAGZC,KAAK,EAALA,gBAHY;EAIZC,EAAE,EAAFA,aAJY;EAKZC,IAAI,EAAJA,eALY;EAMZ;EACAC,KAAK,EAALA,OAPY;EAQZC,UAAU,EAAVA,iBARY;EASZ;EACAC,IAAI,EAAJA,UAVY;EAWZC,KAAK,EAALA,WAXY;EAYZ;EACAC,OAAO,EAAPA,SAbY;EAcZC,QAAQ,EAARA,YAdY;EAeZ;EACAC,KAAK,EAALA;AAhBY,CAAd"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Icon = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _helpers = require("../../helpers");
17
-
18
- var _Icon = require("./Icon.constants");
19
-
20
- var _IconModule = _interopRequireDefault(require("./Icon.module.css"));
21
-
22
- var _excluded = ["name"];
23
-
24
- var Icon = function Icon(_ref) {
25
- var name = _ref.name,
26
- others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
27
- return /*#__PURE__*/_react.default.createElement('span', (0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
28
- className: (0, _helpers.styles)(_IconModule.default.icon, others.className)
29
- }), _Icon.ICONS[name] ? /*#__PURE__*/_react.default.createElement(_Icon.ICONS[name]) : undefined);
30
- };
31
-
32
- exports.Icon = Icon;
33
- Icon.displayName = 'Primitive:Icon';
34
- //# sourceMappingURL=Icon.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Icon.js","names":["Icon","name","others","React","createElement","className","style","icon","ICONS","undefined","displayName"],"sources":["../../../src/primitives/Icon/Icon.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { ICONS } from './Icon.constants';\nimport style from './Icon.module.css';\n\nconst Icon = ({ name, ...others }) =>\n React.createElement(\n 'span',\n {\n ...others,\n className: styles(style.icon, others.className),\n },\n ICONS[name] ? React.createElement(ICONS[name]) : undefined,\n );\n\nIcon.displayName = 'Primitive:Icon';\n\nIcon.propTypes = {\n name: PropTypes.oneOf(Object.keys(ICONS)).isRequired,\n};\n\nexport { Icon };\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO;EAAA,IAAGC,IAAH,QAAGA,IAAH;EAAA,IAAYC,MAAZ;EAAA,oBACXC,eAAMC,aAAN,CACE,MADF,8DAGOF,MAHP;IAIIG,SAAS,EAAE,qBAAOC,oBAAMC,IAAb,EAAmBL,MAAM,CAACG,SAA1B;EAJf,IAMEG,YAAMP,IAAN,iBAAcE,eAAMC,aAAN,CAAoBI,YAAMP,IAAN,CAApB,CAAd,GAAiDQ,SANnD,CADW;AAAA,CAAb;;;AAUAT,IAAI,CAACU,WAAL,GAAmB,gBAAnB"}
@@ -1,11 +0,0 @@
1
- :root {
2
- --mirai-ui-icon: var(--mirai-ui-font-size-paragraph);
3
- }
4
-
5
- .icon {
6
- display: block;
7
- line-height: var(--mirai-ui-icon);
8
- height: var(--mirai-ui-icon);
9
- width: var(--mirai-ui-icon);
10
- font-size: var(--mirai-ui-icon);
11
- }
@@ -1,133 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`primitive:<Icon> inherit:className 1`] = `
4
- <DocumentFragment>
5
- <span
6
- class="icon mirai"
7
- >
8
- <svg
9
- fill="none"
10
- height="1em"
11
- stroke="currentColor"
12
- stroke-linecap="round"
13
- stroke-linejoin="round"
14
- stroke-width="2"
15
- viewBox="0 0 24 24"
16
- width="1em"
17
- xmlns="http://www.w3.org/2000/svg"
18
- >
19
- <line
20
- x1="19"
21
- x2="5"
22
- y1="12"
23
- y2="12"
24
- />
25
- <polyline
26
- points="12 19 5 12 12 5"
27
- />
28
- </svg>
29
- </span>
30
- </DocumentFragment>
31
- `;
32
-
33
- exports[`primitive:<Icon> prop:name (invalid) 1`] = `
34
- <DocumentFragment>
35
- <span
36
- class="icon"
37
- />
38
- </DocumentFragment>
39
- `;
40
-
41
- exports[`primitive:<Icon> prop:name 1`] = `
42
- <DocumentFragment>
43
- <span
44
- class="icon"
45
- >
46
- <svg
47
- fill="none"
48
- height="1em"
49
- stroke="currentColor"
50
- stroke-linecap="round"
51
- stroke-linejoin="round"
52
- stroke-width="2"
53
- viewBox="0 0 24 24"
54
- width="1em"
55
- xmlns="http://www.w3.org/2000/svg"
56
- >
57
- <line
58
- x1="18"
59
- x2="6"
60
- y1="6"
61
- y2="18"
62
- />
63
- <line
64
- x1="6"
65
- x2="18"
66
- y1="6"
67
- y2="18"
68
- />
69
- </svg>
70
- </span>
71
- </DocumentFragment>
72
- `;
73
-
74
- exports[`primitive:<Icon> renders 1`] = `
75
- <DocumentFragment>
76
- <span
77
- class="icon"
78
- >
79
- <svg
80
- fill="none"
81
- height="1em"
82
- stroke="currentColor"
83
- stroke-linecap="round"
84
- stroke-linejoin="round"
85
- stroke-width="2"
86
- viewBox="0 0 24 24"
87
- width="1em"
88
- xmlns="http://www.w3.org/2000/svg"
89
- >
90
- <line
91
- x1="19"
92
- x2="5"
93
- y1="12"
94
- y2="12"
95
- />
96
- <polyline
97
- points="12 19 5 12 12 5"
98
- />
99
- </svg>
100
- </span>
101
- </DocumentFragment>
102
- `;
103
-
104
- exports[`primitive:<Icon> testID 1`] = `
105
- <DocumentFragment>
106
- <span
107
- class="icon"
108
- data-testid="mirai"
109
- >
110
- <svg
111
- fill="none"
112
- height="1em"
113
- stroke="currentColor"
114
- stroke-linecap="round"
115
- stroke-linejoin="round"
116
- stroke-width="2"
117
- viewBox="0 0 24 24"
118
- width="1em"
119
- xmlns="http://www.w3.org/2000/svg"
120
- >
121
- <line
122
- x1="19"
123
- x2="5"
124
- y1="12"
125
- y2="12"
126
- />
127
- <polyline
128
- points="12 19 5 12 12 5"
129
- />
130
- </svg>
131
- </span>
132
- </DocumentFragment>
133
- `;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- ICONS: true
8
- };
9
- Object.defineProperty(exports, "ICONS", {
10
- enumerable: true,
11
- get: function get() {
12
- return _Icon2.ICONS;
13
- }
14
- });
15
-
16
- var _Icon = require("./Icon");
17
-
18
- Object.keys(_Icon).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
21
- if (key in exports && exports[key] === _Icon[key]) return;
22
- Object.defineProperty(exports, key, {
23
- enumerable: true,
24
- get: function get() {
25
- return _Icon[key];
26
- }
27
- });
28
- });
29
-
30
- var _Icon2 = require("./Icon.constants");
31
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../src/primitives/Icon/index.js"],"sourcesContent":["export * from './Icon';\nexport { ICONS } from './Icon.constants';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.Input = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
13
-
14
- var _react = _interopRequireDefault(require("react"));
15
-
16
- var _helpers = require("../../helpers");
17
-
18
- var _helpers2 = require("./helpers");
19
-
20
- var _InputModule = _interopRequireDefault(require("./Input.module.css"));
21
-
22
- var _excluded = ["disabled", "multiLine", "type", "onChange", "onEnter", "onError", "onLeave"];
23
-
24
- var Input = function Input(_ref) {
25
- var disabled = _ref.disabled,
26
- multiLine = _ref.multiLine,
27
- _ref$type = _ref.type,
28
- type = _ref$type === void 0 ? 'text' : _ref$type,
29
- onChange = _ref.onChange,
30
- onEnter = _ref.onEnter,
31
- onError = _ref.onError,
32
- onLeave = _ref.onLeave,
33
- others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
34
- var errors = (0, _helpers.getInputErrors)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
35
- type: type
36
- }));
37
- if (errors && onError) onError(errors);
38
-
39
- var handleChange = function handleChange() {
40
- var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
41
- var event = arguments.length > 1 ? arguments[1] : undefined;
42
- if (type === 'number' && isNaN(next)) return;
43
- var value = (0, _helpers2.parseValue)(next, type, others);
44
- onError && onError((0, _helpers.getInputErrors)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
45
- type: type,
46
- value: value
47
- })));
48
- onChange && onChange(value || '', event);
49
- };
50
-
51
- return /*#__PURE__*/_react.default.createElement(multiLine ? 'textarea' : 'input', (0, _objectSpread2.default)((0, _objectSpread2.default)({}, others), {}, {
52
- disabled: disabled,
53
- className: (0, _helpers.styles)(_InputModule.default.input, others.className),
54
- type: type
55
- }, !disabled ? {
56
- onChange: function onChange(event) {
57
- return handleChange(event.target.value, event);
58
- },
59
- onFocus: onEnter,
60
- onBlur: onLeave
61
- } : {}));
62
- };
63
-
64
- exports.Input = Input;
65
- Input.displayName = 'Primitive:Input';
66
- //# sourceMappingURL=Input.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Input.js","names":["Input","disabled","multiLine","type","onChange","onEnter","onError","onLeave","others","errors","handleChange","next","event","isNaN","value","React","createElement","className","style","input","target","onFocus","onBlur","displayName"],"sources":["../../../src/primitives/Input/Input.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getInputErrors, styles } from '../../helpers';\nimport { parseValue } from './helpers';\nimport style from './Input.module.css';\n\nconst Input = ({ disabled, multiLine, type = 'text', onChange, onEnter, onError, onLeave, ...others }) => {\n const errors = getInputErrors({ ...others, type });\n if (errors && onError) onError(errors);\n\n const handleChange = (next = '', event) => {\n if (type === 'number' && isNaN(next)) return;\n const value = parseValue(next, type, others);\n\n onError && onError(getInputErrors({ ...others, type, value }));\n onChange && onChange(value || '', event);\n };\n\n return React.createElement(multiLine ? 'textarea' : 'input', {\n ...others,\n disabled,\n className: styles(style.input, others.className),\n type,\n ...(!disabled\n ? {\n onChange: (event) => handleChange(event.target.value, event),\n onFocus: onEnter,\n onBlur: onLeave,\n }\n : {}),\n });\n};\nInput.displayName = 'Primitive:Input';\n\nInput.propTypes = {\n disabled: PropTypes.bool,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n type: PropTypes.string,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { Input };\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAA4F;EAAA,IAAzFC,QAAyF,QAAzFA,QAAyF;EAAA,IAA/EC,SAA+E,QAA/EA,SAA+E;EAAA,qBAApEC,IAAoE;EAAA,IAApEA,IAAoE,0BAA7D,MAA6D;EAAA,IAArDC,QAAqD,QAArDA,QAAqD;EAAA,IAA3CC,OAA2C,QAA3CA,OAA2C;EAAA,IAAlCC,OAAkC,QAAlCA,OAAkC;EAAA,IAAzBC,OAAyB,QAAzBA,OAAyB;EAAA,IAAbC,MAAa;EACxG,IAAMC,MAAM,GAAG,yFAAoBD,MAApB;IAA4BL,IAAI,EAAJA;EAA5B,GAAf;EACA,IAAIM,MAAM,IAAIH,OAAd,EAAuBA,OAAO,CAACG,MAAD,CAAP;;EAEvB,IAAMC,YAAY,GAAG,SAAfA,YAAe,GAAsB;IAAA,IAArBC,IAAqB,uEAAd,EAAc;IAAA,IAAVC,KAAU;IACzC,IAAIT,IAAI,KAAK,QAAT,IAAqBU,KAAK,CAACF,IAAD,CAA9B,EAAsC;IACtC,IAAMG,KAAK,GAAG,0BAAWH,IAAX,EAAiBR,IAAjB,EAAuBK,MAAvB,CAAd;IAEAF,OAAO,IAAIA,OAAO,CAAC,yFAAoBE,MAApB;MAA4BL,IAAI,EAAJA,IAA5B;MAAkCW,KAAK,EAALA;IAAlC,GAAD,CAAlB;IACAV,QAAQ,IAAIA,QAAQ,CAACU,KAAK,IAAI,EAAV,EAAcF,KAAd,CAApB;EACD,CAND;;EAQA,oBAAOG,eAAMC,aAAN,CAAoBd,SAAS,GAAG,UAAH,GAAgB,OAA7C,8DACFM,MADE;IAELP,QAAQ,EAARA,QAFK;IAGLgB,SAAS,EAAE,qBAAOC,qBAAMC,KAAb,EAAoBX,MAAM,CAACS,SAA3B,CAHN;IAILd,IAAI,EAAJA;EAJK,GAKD,CAACF,QAAD,GACA;IACEG,QAAQ,EAAE,kBAACQ,KAAD;MAAA,OAAWF,YAAY,CAACE,KAAK,CAACQ,MAAN,CAAaN,KAAd,EAAqBF,KAArB,CAAvB;IAAA,CADZ;IAEES,OAAO,EAAEhB,OAFX;IAGEiB,MAAM,EAAEf;EAHV,CADA,GAMA,EAXC,EAAP;AAaD,CAzBD;;;AA0BAP,KAAK,CAACuB,WAAN,GAAoB,iBAApB"}