@mirai/ui 1.0.66 → 1.0.68

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 (37) hide show
  1. package/README.md +37 -1
  2. package/build/components/Action/Action.js +52 -0
  3. package/build/components/Action/Action.js.map +1 -0
  4. package/build/components/Action/Action.module.css +35 -0
  5. package/build/components/Action/Action.stories.js +43 -0
  6. package/build/components/Action/Action.stories.js.map +1 -0
  7. package/build/components/Action/__tests__/__snapshots__/Action.test.js.snap +83 -0
  8. package/build/components/Action/index.js +17 -0
  9. package/build/components/Action/index.js.map +1 -0
  10. package/build/components/Button/Button.module.css +1 -1
  11. package/build/components/InputDate/InputDate.js +13 -2
  12. package/build/components/InputDate/InputDate.js.map +1 -1
  13. package/build/components/InputDate/InputDate.module.css +4 -0
  14. package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +187 -25
  15. package/build/components/InputNumber/InputNumber.js +2 -2
  16. package/build/components/InputNumber/InputNumber.js.map +1 -1
  17. package/build/components/InputNumber/InputNumber.module.css +11 -6
  18. package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +2 -2
  19. package/build/components/InputOption/InputOption.module.css +1 -0
  20. package/build/components/InputText/InputText.js +17 -14
  21. package/build/components/InputText/InputText.js.map +1 -1
  22. package/build/components/InputText/InputText.module.css +4 -0
  23. package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +1 -1
  24. package/build/components/Table/Table.Row.js +25 -24
  25. package/build/components/Table/Table.Row.js.map +1 -1
  26. package/build/components/Table/Table.module.css +27 -9
  27. package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +55 -102
  28. package/build/components/index.js +11 -0
  29. package/build/components/index.js.map +1 -1
  30. package/build/primitives/Checkbox/Checkbox.module.css +1 -1
  31. package/build/primitives/Icon/Icon.constants.js +1 -0
  32. package/build/primitives/Icon/Icon.constants.js.map +1 -1
  33. package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +27 -0
  34. package/build/primitives/Input/Input.module.css +8 -1
  35. package/build/primitives/Radio/Radio.module.css +1 -1
  36. package/build/theme/default.theme.css +9 -3
  37. package/package.json +1 -1
package/README.md CHANGED
@@ -316,6 +316,43 @@ const MyComponent = ({ headerText }) => (
316
316
 
317
317
  React components assembled with primitives.
318
318
 
319
+ ### Action
320
+
321
+ A hyperlink component that receives the following props:
322
+
323
+ - `children:node|string`
324
+ - `disabled:boolean` applying 'disabled' attribute
325
+ - `large:boolean` modifying the button size
326
+ - `small:boolean` modifying the button size
327
+ - `tag:string` html tag of resulting element ('button' by default)
328
+ - `wide:bool` modifying the button to full-width
329
+ - `onEnter:function` executed when the user hovers over
330
+ - `onLeave:function` executed when the user hovers away
331
+ - `onPress:function` executed on mouse click on the element
332
+
333
+ ```jsx
334
+ import { Action } from '@mirai/ui';
335
+
336
+ const MyComponent = (props) => {
337
+ const handleActionClick = () => console.log('click');
338
+
339
+ return (
340
+ <>
341
+ <Action large onPress={handleActionClick} />
342
+ </>
343
+ );
344
+ };
345
+ ```
346
+
347
+ **Theming variables**
348
+
349
+ ```css
350
+ --mirai-ui-action-color: var(--mirai-ui-accent);
351
+ --mirai-ui-action-color-active: var(--mirai-ui-content);
352
+ --mirai-ui-action-color-disabled: var(--mirai-ui-content-light);
353
+ --mirai-ui-action-font-weight: var(--mirai-ui-font-weight);
354
+ ```
355
+
319
356
  ### Button
320
357
 
321
358
  A button component that receives the following props:
@@ -359,7 +396,6 @@ const MyComponent = (props) => {
359
396
  --mirai-ui-button-color-hover: var(--mirai-ui-content);
360
397
  --mirai-ui-button-disabled-background: var(--mirai-ui-content-border);
361
398
  --mirai-ui-button-disabled-color: var(--mirai-ui-content-light);
362
- --mirai-ui-button-font: var(--mirai-ui-font);
363
399
  --mirai-ui-button-font-weight: var(--mirai-ui-font-weight);
364
400
  --mirai-ui-button-secondary-background: var(--mirai-ui-base);
365
401
  --mirai-ui-button-padding-y: var(--mirai-ui-space-S);
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.Action = void 0;
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _helpers = require("../../helpers");
11
+ var _primitives = require("../../primitives");
12
+ var _ActionModule = _interopRequireDefault(require("./Action.module.css"));
13
+ var _excluded = ["children", "disabled", "large", "small", "tag", "wide", "onPress"];
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ 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; }
16
+ 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; }
17
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
18
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
19
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
20
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
21
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
22
+ var Action = function Action(_ref) {
23
+ var children = _ref.children,
24
+ disabled = _ref.disabled,
25
+ large = _ref.large,
26
+ small = _ref.small,
27
+ _ref$tag = _ref.tag,
28
+ tag = _ref$tag === void 0 ? 'button' : _ref$tag,
29
+ wide = _ref.wide,
30
+ onPress = _ref.onPress,
31
+ others = _objectWithoutProperties(_ref, _excluded);
32
+ return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, _objectSpread(_objectSpread({}, others), {}, {
33
+ disabled: disabled,
34
+ tag: tag,
35
+ className: (0, _helpers.styles)(_ActionModule.default.action, large && _ActionModule.default.large, small && _ActionModule.default.small, wide && _ActionModule.default.wide, others.className),
36
+ onPress: !disabled ? onPress : undefined
37
+ }), children);
38
+ };
39
+ exports.Action = Action;
40
+ Action.displayName = 'Component:Action';
41
+ Action.propTypes = {
42
+ children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
43
+ disabled: _propTypes.default.bool,
44
+ large: _propTypes.default.bool,
45
+ small: _propTypes.default.bool,
46
+ tag: _propTypes.default.string,
47
+ wide: _propTypes.default.bool,
48
+ onEnter: _propTypes.default.func,
49
+ onLeave: _propTypes.default.func,
50
+ onPress: _propTypes.default.func
51
+ };
52
+ //# sourceMappingURL=Action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.js","names":["Action","children","disabled","large","small","tag","wide","onPress","others","React","createElement","Pressable","className","styles","style","action","undefined","displayName","propTypes","PropTypes","oneOfType","string","node","bool","onEnter","func","onLeave"],"sources":["../../../src/components/Action/Action.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Pressable } from '../../primitives';\nimport style from './Action.module.css';\n\nconst Action = ({ children, disabled, large, small, tag = 'button', wide, onPress, ...others }) =>\n React.createElement(\n Pressable,\n {\n ...others,\n disabled,\n tag,\n className: styles(style.action, large && style.large, small && style.small, wide && style.wide, others.className),\n onPress: !disabled ? onPress : undefined,\n },\n children,\n );\n\nAction.displayName = 'Component:Action';\n\nAction.propTypes = {\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n disabled: PropTypes.bool,\n large: PropTypes.bool,\n small: PropTypes.bool,\n tag: PropTypes.string,\n wide: PropTypes.bool,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n onPress: PropTypes.func,\n};\n\nexport { Action };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AAAwC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAExC,IAAMA,MAAM,GAAG,SAATA,MAAM;EAAA,IAAMC,QAAQ,QAARA,QAAQ;IAAEC,QAAQ,QAARA,QAAQ;IAAEC,KAAK,QAALA,KAAK;IAAEC,KAAK,QAALA,KAAK;IAAA,gBAAEC,GAAG;IAAHA,GAAG,yBAAG,QAAQ;IAAEC,IAAI,QAAJA,IAAI;IAAEC,OAAO,QAAPA,OAAO;IAAKC,MAAM;EAAA,oBAC1FC,cAAK,CAACC,aAAa,CACjBC,qBAAS,kCAEJH,MAAM;IACTN,QAAQ,EAARA,QAAQ;IACRG,GAAG,EAAHA,GAAG;IACHO,SAAS,EAAE,IAAAC,eAAM,EAACC,qBAAK,CAACC,MAAM,EAAEZ,KAAK,IAAIW,qBAAK,CAACX,KAAK,EAAEC,KAAK,IAAIU,qBAAK,CAACV,KAAK,EAAEE,IAAI,IAAIQ,qBAAK,CAACR,IAAI,EAAEE,MAAM,CAACI,SAAS,CAAC;IACjHL,OAAO,EAAE,CAACL,QAAQ,GAAGK,OAAO,GAAGS;EAAS,IAE1Cf,QAAQ,CACT;AAAA;AAAC;AAEJD,MAAM,CAACiB,WAAW,GAAG,kBAAkB;AAEvCjB,MAAM,CAACkB,SAAS,GAAG;EACjBjB,QAAQ,EAAEkB,kBAAS,CAACC,SAAS,CAAC,CAACD,kBAAS,CAACE,MAAM,EAAEF,kBAAS,CAACG,IAAI,CAAC,CAAC;EACjEpB,QAAQ,EAAEiB,kBAAS,CAACI,IAAI;EACxBpB,KAAK,EAAEgB,kBAAS,CAACI,IAAI;EACrBnB,KAAK,EAAEe,kBAAS,CAACI,IAAI;EACrBlB,GAAG,EAAEc,kBAAS,CAACE,MAAM;EACrBf,IAAI,EAAEa,kBAAS,CAACI,IAAI;EACpBC,OAAO,EAAEL,kBAAS,CAACM,IAAI;EACvBC,OAAO,EAAEP,kBAAS,CAACM,IAAI;EACvBlB,OAAO,EAAEY,kBAAS,CAACM;AACrB,CAAC"}
@@ -0,0 +1,35 @@
1
+ .action {
2
+ align-items: center;
3
+ color: var(--mirai-ui-action-color);
4
+ display: flex;
5
+ font-family: var(--mirai-ui-font);
6
+ font-size: var(--mirai-ui-font-size-action);
7
+ font-weight: var(--mirai-ui-action-font-weight);
8
+ justify-content: center;
9
+ padding: var(--mirai-ui-button-padding-y) 0;
10
+ position: relative;
11
+ transition: color var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
12
+ width: fit-content;
13
+ }
14
+
15
+ .action:disabled {
16
+ color: var(--mirai-ui-action-color-disabled);
17
+ }
18
+
19
+ .action:not(:disabled):active {
20
+ color: var(--mirai-ui-action-color-active);
21
+ }
22
+
23
+ .large {
24
+ font-size: var(--mirai-ui-font-size-paragraph);
25
+ padding: var(--mirai-ui-button-padding-y) 0;
26
+ }
27
+
28
+ .small {
29
+ font-size: var(--mirai-ui-font-size-small);
30
+ padding: var(--mirai-ui-button-padding-y) 0;
31
+ }
32
+
33
+ .wide {
34
+ width: 100%;
35
+ }
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Story = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _Action = require("./Action");
9
+ 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); }
10
+ 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; }
11
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ var _default = {
16
+ title: 'Components'
17
+ };
18
+ exports.default = _default;
19
+ var Story = function Story(props) {
20
+ return /*#__PURE__*/React.createElement(_Action.Action, props);
21
+ };
22
+ exports.Story = Story;
23
+ Story.storyName = 'Action';
24
+ Story.args = _defineProperty({
25
+ children: 'children',
26
+ disabled: false,
27
+ large: false,
28
+ small: false,
29
+ tag: 'Button',
30
+ wide: false
31
+ }, 'data-testid', 'test-story');
32
+ Story.argTypes = {
33
+ onEnter: {
34
+ action: 'onEnter'
35
+ },
36
+ onLeave: {
37
+ action: 'onLeave'
38
+ },
39
+ onPress: {
40
+ action: 'onPress'
41
+ }
42
+ };
43
+ //# sourceMappingURL=Action.stories.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Action.stories.js","names":["title","Story","props","storyName","args","children","disabled","large","small","tag","wide","argTypes","onEnter","action","onLeave","onPress"],"sources":["../../../src/components/Action/Action.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Action } from './Action';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <Action {...props} />;\n\nStory.storyName = 'Action';\n\nStory.args = {\n children: 'children',\n disabled: false,\n large: false,\n small: false,\n tag: 'Button',\n wide: false,\n ['data-testid']: 'test-story',\n};\n\nStory.argTypes = {\n onEnter: { action: 'onEnter' },\n onLeave: { action: 'onLeave' },\n onPress: { action: 'onPress' },\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAAkC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEnB;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK;EAAA,oBAAK,oBAAC,cAAM,EAAKA,KAAK,CAAI;AAAA;AAAC;AAEtDD,KAAK,CAACE,SAAS,GAAG,QAAQ;AAE1BF,KAAK,CAACG,IAAI;EACRC,QAAQ,EAAE,UAAU;EACpBC,QAAQ,EAAE,KAAK;EACfC,KAAK,EAAE,KAAK;EACZC,KAAK,EAAE,KAAK;EACZC,GAAG,EAAE,QAAQ;EACbC,IAAI,EAAE;AAAK,GACV,aAAa,EAAG,YAAY,CAC9B;AAEDT,KAAK,CAACU,QAAQ,GAAG;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAU,CAAC;EAC9BC,OAAO,EAAE;IAAED,MAAM,EAAE;EAAU,CAAC;EAC9BE,OAAO,EAAE;IAAEF,MAAM,EAAE;EAAU;AAC/B,CAAC"}
@@ -0,0 +1,83 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`component:<Action> inherit:className 1`] = `
4
+ <DocumentFragment>
5
+ <button
6
+ class="pressable action mirai"
7
+ >
8
+ children
9
+ </button>
10
+ </DocumentFragment>
11
+ `;
12
+
13
+ exports[`component:<Action> prop:disabled 1`] = `
14
+ <DocumentFragment>
15
+ <button
16
+ class="pressable action"
17
+ disabled=""
18
+ >
19
+ children
20
+ </button>
21
+ </DocumentFragment>
22
+ `;
23
+
24
+ exports[`component:<Action> prop:large 1`] = `
25
+ <DocumentFragment>
26
+ <button
27
+ class="pressable action large"
28
+ >
29
+ children
30
+ </button>
31
+ </DocumentFragment>
32
+ `;
33
+
34
+ exports[`component:<Action> prop:small 1`] = `
35
+ <DocumentFragment>
36
+ <button
37
+ class="pressable action small"
38
+ >
39
+ children
40
+ </button>
41
+ </DocumentFragment>
42
+ `;
43
+
44
+ exports[`component:<Action> prop:tag 1`] = `
45
+ <DocumentFragment>
46
+ <a
47
+ class="pressable action"
48
+ >
49
+ children
50
+ </a>
51
+ </DocumentFragment>
52
+ `;
53
+
54
+ exports[`component:<Action> prop:wide 1`] = `
55
+ <DocumentFragment>
56
+ <button
57
+ class="pressable action wide"
58
+ >
59
+ children
60
+ </button>
61
+ </DocumentFragment>
62
+ `;
63
+
64
+ exports[`component:<Action> renders 1`] = `
65
+ <DocumentFragment>
66
+ <button
67
+ class="pressable action"
68
+ >
69
+ children
70
+ </button>
71
+ </DocumentFragment>
72
+ `;
73
+
74
+ exports[`component:<Action> testID 1`] = `
75
+ <DocumentFragment>
76
+ <button
77
+ class="pressable action"
78
+ data-testid="mirai"
79
+ >
80
+ children
81
+ </button>
82
+ </DocumentFragment>
83
+ `;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _Action = require("./Action");
7
+ Object.keys(_Action).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Action[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _Action[key];
14
+ }
15
+ });
16
+ });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Action/index.js"],"sourcesContent":["export * from './Action';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -4,7 +4,7 @@
4
4
  border-radius: var(--mirai-ui-button-radius);
5
5
  color: var(--mirai-ui-button-color);
6
6
  display: flex;
7
- font-family: var(--mirai-ui-button-font);
7
+ font-family: var(--mirai-ui-font);
8
8
  font-size: var(--mirai-ui-font-size-action);
9
9
  font-weight: var(--mirai-ui-button-font-weight);
10
10
  justify-content: center;
@@ -12,7 +12,7 @@ var _primitives = require("../../primitives");
12
12
  var _InputText = require("../InputText");
13
13
  var _InputTextModule = _interopRequireDefault(require("../InputText/InputText.module.css"));
14
14
  var _InputDateModule = _interopRequireDefault(require("./InputDate.module.css"));
15
- var _excluded = ["disabled", "error", "format", "hint", "label", "labels", "max", "min", "name", "placeholder", "required", "value", "onChange", "onError", "onEnter", "onLeave"],
15
+ var _excluded = ["disabled", "error", "format", "hint", "label", "labels", "max", "min", "name", "placeholder", "required", "success", "value", "warning", "onChange", "onError", "onEnter", "onLeave"],
16
16
  _excluded2 = ["className", "data-testid"];
17
17
  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); }
18
18
  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; }
@@ -41,8 +41,10 @@ var InputDate = function InputDate(_ref) {
41
41
  _ref$placeholder = _ref.placeholder,
42
42
  placeholder = _ref$placeholder === void 0 ? true : _ref$placeholder,
43
43
  required = _ref.required,
44
+ success = _ref.success,
44
45
  _ref$value = _ref.value,
45
46
  value = _ref$value === void 0 ? '' : _ref$value,
47
+ warning = _ref.warning,
46
48
  _ref$onChange = _ref.onChange,
47
49
  onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
48
50
  _ref$onError = _ref.onError,
@@ -103,7 +105,7 @@ var InputDate = function InputDate(_ref) {
103
105
  maxLength: part.length,
104
106
  name: "".concat(name, ":").concat(part),
105
107
  placeholder: placeholder ? labels[index] || part : undefined,
106
- showState: index === parts.length - 1,
108
+ showState: false,
107
109
  value: values[index],
108
110
  onChange: function onChange(value) {
109
111
  for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -116,6 +118,13 @@ var InputDate = function InputDate(_ref) {
116
118
  className: (0, _helpers.styles)(_InputDateModule.default.input, _InputDateModule.default[part.substring(0, 1)], index === parts.length - 1 && _InputDateModule.default.state),
117
119
  "data-testid": testId ? "".concat(testId, "-").concat(part) : undefined
118
120
  }));
121
+ }), (error || success || warning) && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
122
+ value: (0, _helpers.getIconState)({
123
+ error: error,
124
+ success: success,
125
+ warning: warning
126
+ }),
127
+ className: (0, _helpers.styles)(_InputTextModule.default.icon, error ? _InputTextModule.default.error : warning ? _InputTextModule.default.warning : success ? _InputTextModule.default.success : undefined, !placeholder && _InputDateModule.default.withHint)
119
128
  })), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
120
129
  small: true,
121
130
  className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
@@ -135,7 +144,9 @@ InputDate.propTypes = {
135
144
  name: _propTypes.default.string.isRequired,
136
145
  placeholder: _propTypes.default.bool,
137
146
  required: _propTypes.default.bool,
147
+ success: _propTypes.default.bool,
138
148
  value: _propTypes.default.string,
149
+ warning: _propTypes.default.bool,
139
150
  onChange: _propTypes.default.func,
140
151
  onError: _propTypes.default.func,
141
152
  onEnter: _propTypes.default.func,
@@ -1 +1 @@
1
- {"version":3,"file":"InputDate.js","names":["InputDate","disabled","error","format","hint","label","labels","max","min","name","placeholder","required","value","onChange","onError","onEnter","onLeave","others","useState","focus","setFocus","parts","splitDate","values","handleChange","partValue","partKey","event","nextValue","map","part","index","join","errors","getInputDateErrors","Object","keys","length","handleEnter","handleLeave","className","testId","rest","styles","style","inputContainer","styleDate","text","undefined","input","substring","state","displayName","propTypes","PropTypes","bool","string","arrayOf","isRequired","func"],"sources":["../../../src/components/InputDate/InputDate.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getInputDateErrors, splitDate, styles } from '../../helpers';\nimport { Text, View } from '../../primitives';\nimport { InputText } from '../InputText';\nimport style from '../InputText/InputText.module.css';\nimport styleDate from './InputDate.module.css';\n\nconst InputDate = ({\n disabled,\n error,\n format = 'DD/MM/YYYY',\n hint,\n label,\n labels = [],\n max,\n min,\n name,\n placeholder = true,\n required,\n value = '',\n onChange = () => {},\n onError = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n\n const parts = splitDate(format);\n const values = splitDate(value);\n\n const handleChange = (partValue = '', partKey, event) => {\n const nextValue = parts.map((part, index) => (part !== partKey ? values[index] || '' : partValue)).join('/');\n onChange(nextValue, event);\n\n const errors = getInputDateErrors({ format, max, min, value, required });\n if (Object.keys(errors || {}).length > 0) onError(errors);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const { className, ['data-testid']: testId, ...rest } = others;\n\n return (\n <View className={styles(style.inputContainer, className)} data-testid={testId}>\n <Text\n small\n className={styles(\n styleDate.label,\n style.text,\n style.hint,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n )}\n >\n {label}\n </Text>\n\n <View row>\n {parts.map((part, index) => (\n <InputText\n {...rest}\n disabled={disabled}\n error={error}\n hint={!placeholder ? labels[index] || part : undefined}\n key={index}\n maxLength={part.length}\n name={`${name}:${part}`}\n placeholder={placeholder ? labels[index] || part : undefined}\n showState={index === parts.length - 1}\n value={values[index]}\n onChange={(value, ...rest) => handleChange(value, part, ...rest)}\n onEnter={handleEnter}\n onLeave={handleLeave}\n className={styles(\n styleDate.input,\n styleDate[part.substring(0, 1)],\n index === parts.length - 1 && styleDate.state,\n )}\n data-testid={testId ? `${testId}-${part}` : undefined}\n />\n ))}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, disabled && style.disabled, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputDate.displayName = 'Component:InputDate';\n\nInputDate.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n format: PropTypes.string,\n hint: PropTypes.string,\n label: PropTypes.string,\n labels: PropTypes.arrayOf(PropTypes.string),\n max: PropTypes.string,\n min: PropTypes.string,\n name: PropTypes.string.isRequired,\n placeholder: PropTypes.bool,\n required: PropTypes.bool,\n value: PropTypes.string,\n onChange: PropTypes.func,\n onError: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputDate };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AAA+C;EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAE/C,IAAMA,SAAS,GAAG,SAAZA,SAAS,OAkBT;EAAA,IAjBJC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IAAA,mBACLC,MAAM;IAANA,MAAM,4BAAG,YAAY;IACrBC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IAAA,mBACLC,MAAM;IAANA,MAAM,4BAAG,EAAE;IACXC,GAAG,QAAHA,GAAG;IACHC,GAAG,QAAHA,GAAG;IACHC,IAAI,QAAJA,IAAI;IAAA,wBACJC,WAAW;IAAXA,WAAW,iCAAG,IAAI;IAClBC,QAAQ,QAARA,QAAQ;IAAA,kBACRC,KAAK;IAALA,KAAK,2BAAG,EAAE;IAAA,qBACVC,QAAQ;IAARA,QAAQ,8BAA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AACE,MAAM;EACrBhD,GAAG,EAAE8C,kBAAS,CAACE,MAAM;EACrB/C,IAAI,EAAE6C,kBAAS,CAACE,MAAM,CAACE,UAAU;EACjChD,WAAW,EAAE4C,kBAAS,CAACC,IAAI;EAC3B5C,QAAQ,EAAE2C,kBAAS,CAACC,IAAI;EACxB3C,KAAK,EAAE0C,kBAAS,CAACE,MAAM;EACvB3C,QAAQ,EAAEyC,kBAAS,CAACK,IAAI;EACxB7C,OAAO,EAAEwC,kBAAS,CAACK,IAAI;EACvB5C,OAAO,EAAEuC,kBAAS,CAACK,IAAI;EACvB3C,OAAO,EAAEsC,kBAAS,CAACK;AACrB,CAAC"}
1
+ {"version":3,"file":"InputDate.js","names":["InputDate","disabled","error","format","hint","label","labels","max","min","name","placeholder","required","success","value","warning","onChange","onError","onEnter","onLeave","others","useState","focus","setFocus","parts","splitDate","values","handleChange","partValue","partKey","event","nextValue","map","part","index","join","errors","getInputDateErrors","Object","keys","length","handleEnter","handleLeave","className","testId","rest","styles","style","inputContainer","styleDate","text","undefined","input","substring","state","getIconState","icon","withHint","displayName","propTypes","PropTypes","bool","string","arrayOf","isRequired","func"],"sources":["../../../src/components/InputDate/InputDate.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, getInputDateErrors, splitDate, styles } from '../../helpers';\nimport { Icon, Text, View } from '../../primitives';\nimport { InputText } from '../InputText';\nimport style from '../InputText/InputText.module.css';\nimport styleDate from './InputDate.module.css';\n\nconst InputDate = ({\n disabled,\n error,\n format = 'DD/MM/YYYY',\n hint,\n label,\n labels = [],\n max,\n min,\n name,\n placeholder = true,\n required,\n success,\n value = '',\n warning,\n onChange = () => {},\n onError = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n\n const parts = splitDate(format);\n const values = splitDate(value);\n\n const handleChange = (partValue = '', partKey, event) => {\n const nextValue = parts.map((part, index) => (part !== partKey ? values[index] || '' : partValue)).join('/');\n onChange(nextValue, event);\n\n const errors = getInputDateErrors({ format, max, min, value, required });\n if (Object.keys(errors || {}).length > 0) onError(errors);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const { className, ['data-testid']: testId, ...rest } = others;\n\n return (\n <View className={styles(style.inputContainer, className)} data-testid={testId}>\n <Text\n small\n className={styles(\n styleDate.label,\n style.text,\n style.hint,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n )}\n >\n {label}\n </Text>\n\n <View row>\n {parts.map((part, index) => (\n <InputText\n {...rest}\n disabled={disabled}\n error={error}\n hint={!placeholder ? labels[index] || part : undefined}\n key={index}\n maxLength={part.length}\n name={`${name}:${part}`}\n placeholder={placeholder ? labels[index] || part : undefined}\n showState={false}\n value={values[index]}\n onChange={(value, ...rest) => handleChange(value, part, ...rest)}\n onEnter={handleEnter}\n onLeave={handleLeave}\n className={styles(\n styleDate.input,\n styleDate[part.substring(0, 1)],\n index === parts.length - 1 && styleDate.state,\n )}\n data-testid={testId ? `${testId}-${part}` : undefined}\n />\n ))}\n\n {(error || success || warning) && (\n <Icon\n value={getIconState({ error, success, warning })}\n className={styles(\n style.icon,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n !placeholder && styleDate.withHint,\n )}\n />\n )}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, disabled && style.disabled, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputDate.displayName = 'Component:InputDate';\n\nInputDate.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n format: PropTypes.string,\n hint: PropTypes.string,\n label: PropTypes.string,\n labels: PropTypes.arrayOf(PropTypes.string),\n max: PropTypes.string,\n min: PropTypes.string,\n name: PropTypes.string.isRequired,\n placeholder: PropTypes.bool,\n required: PropTypes.bool,\n success: PropTypes.bool,\n value: PropTypes.string,\n warning: PropTypes.bool,\n on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ACrBpD,IAAI,EAAEkD,kBAAS,CAACE,MAAM,CAACE,UAAU;EACjCrD,WAAW,EAAEiD,kBAAS,CAACC,IAAI;EAC3BjD,QAAQ,EAAEgD,kBAAS,CAACC,IAAI;EACxBhD,OAAO,EAAE+C,kBAAS,CAACC,IAAI;EACvB/C,KAAK,EAAE8C,kBAAS,CAACE,MAAM;EACvB/C,OAAO,EAAE6C,kBAAS,CAACC,IAAI;EACvB7C,QAAQ,EAAE4C,kBAAS,CAACK,IAAI;EACxBhD,OAAO,EAAE2C,kBAAS,CAACK,IAAI;EACvB/C,OAAO,EAAE0C,kBAAS,CAACK,IAAI;EACvB9C,OAAO,EAAEyC,kBAAS,CAACK;AACrB,CAAC"}
@@ -20,3 +20,7 @@
20
20
  .label {
21
21
  margin-top: calc(var(--mirai-ui-font-size-small) * -0.5);
22
22
  }
23
+
24
+ .withHint {
25
+ margin-bottom: calc(var(--mirai-ui-input-text-padding-y) * 2);
26
+ }
@@ -188,33 +188,29 @@ exports[`component:<InputDate> prop:error 1`] = `
188
188
  type="text"
189
189
  value=""
190
190
  />
191
- <div
192
- class="view row icons"
193
- >
194
- <span
195
- class="icon headline-3 icon error"
196
- >
197
- <svg
198
- fill="currentColor"
199
- height="1em"
200
- stroke="currentColor"
201
- stroke-width="0"
202
- viewBox="0 0 24 24"
203
- width="1em"
204
- xmlns="http://www.w3.org/2000/svg"
205
- >
206
- <path
207
- d="M0 0h24v24H0V0z"
208
- fill="none"
209
- />
210
- <path
211
- d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
212
- />
213
- </svg>
214
- </span>
215
- </div>
216
191
  </div>
217
192
  </div>
193
+ <span
194
+ class="icon headline-3 icon error"
195
+ >
196
+ <svg
197
+ fill="currentColor"
198
+ height="1em"
199
+ stroke="currentColor"
200
+ stroke-width="0"
201
+ viewBox="0 0 24 24"
202
+ width="1em"
203
+ xmlns="http://www.w3.org/2000/svg"
204
+ >
205
+ <path
206
+ d="M0 0h24v24H0V0z"
207
+ fill="none"
208
+ />
209
+ <path
210
+ d="M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"
211
+ />
212
+ </svg>
213
+ </span>
218
214
  </div>
219
215
  </div>
220
216
  </DocumentFragment>
@@ -492,6 +488,91 @@ exports[`component:<InputDate> prop:placeholder (false) 1`] = `
492
488
  </DocumentFragment>
493
489
  `;
494
490
 
491
+ exports[`component:<InputDate> prop:success 1`] = `
492
+ <DocumentFragment>
493
+ <div
494
+ class="view inputContainer"
495
+ >
496
+ <span
497
+ class="text small label text hint"
498
+ />
499
+ <div
500
+ class="view row"
501
+ >
502
+ <div
503
+ class="view inputContainer input D"
504
+ >
505
+ <div
506
+ class="view row inputBorder"
507
+ >
508
+ <input
509
+ class="input input"
510
+ maxlength="2"
511
+ name="name:DD"
512
+ placeholder="DD"
513
+ type="text"
514
+ value=""
515
+ />
516
+ </div>
517
+ </div>
518
+ <div
519
+ class="view inputContainer input M"
520
+ >
521
+ <div
522
+ class="view row inputBorder"
523
+ >
524
+ <input
525
+ class="input input"
526
+ maxlength="2"
527
+ name="name:MM"
528
+ placeholder="MM"
529
+ type="text"
530
+ value=""
531
+ />
532
+ </div>
533
+ </div>
534
+ <div
535
+ class="view inputContainer input Y state"
536
+ >
537
+ <div
538
+ class="view row inputBorder"
539
+ >
540
+ <input
541
+ class="input input"
542
+ maxlength="4"
543
+ name="name:YYYY"
544
+ placeholder="YYYY"
545
+ type="text"
546
+ value=""
547
+ />
548
+ </div>
549
+ </div>
550
+ <span
551
+ class="icon headline-3 icon success"
552
+ >
553
+ <svg
554
+ fill="currentColor"
555
+ height="1em"
556
+ stroke="currentColor"
557
+ stroke-width="0"
558
+ viewBox="0 0 24 24"
559
+ width="1em"
560
+ xmlns="http://www.w3.org/2000/svg"
561
+ >
562
+ <path
563
+ d="M0 0h24v24H0V0z"
564
+ fill="none"
565
+ />
566
+ <path
567
+ d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm4.59-12.42L10 14.17l-2.59-2.58L6 13l4 4 8-8z"
568
+ />
569
+ </svg>
570
+ </span>
571
+ </div>
572
+ </div>
573
+ </DocumentFragment>
574
+ `;
575
+
495
576
  exports[`component:<InputDate> prop:value & prop:format 1`] = `
496
577
  <DocumentFragment>
497
578
  <div
@@ -620,6 +701,87 @@ exports[`component:<InputDate> prop:value 1`] = `
620
701
  </DocumentFragment>
621
702
  `;
622
703
 
704
+ exports[`component:<InputDate> prop:warning 1`] = `
705
+ <DocumentFragment>
706
+ <div
707
+ class="view inputContainer"
708
+ >
709
+ <span
710
+ class="text small label text hint"
711
+ />
712
+ <div
713
+ class="view row"
714
+ >
715
+ <div
716
+ class="view inputContainer input D"
717
+ >
718
+ <div
719
+ class="view row inputBorder"
720
+ >
721
+ <input
722
+ class="input input"
723
+ maxlength="2"
724
+ name="name:DD"
725
+ placeholder="DD"
726
+ type="text"
727
+ value=""
728
+ />
729
+ </div>
730
+ </div>
731
+ <div
732
+ class="view inputContainer input M"
733
+ >
734
+ <div
735
+ class="view row inputBorder"
736
+ >
737
+ <input
738
+ class="input input"
739
+ maxlength="2"
740
+ name="name:MM"
741
+ placeholder="MM"
742
+ type="text"
743
+ value=""
744
+ />
745
+ </div>
746
+ </div>
747
+ <div
748
+ class="view inputContainer input Y state"
749
+ >
750
+ <div
751
+ class="view row inputBorder"
752
+ >
753
+ <input
754
+ class="input input"
755
+ maxlength="4"
756
+ name="name:YYYY"
757
+ placeholder="YYYY"
758
+ type="text"
759
+ value=""
760
+ />
761
+ </div>
762
+ </div>
763
+ <span
764
+ class="icon headline-3 icon warning"
765
+ >
766
+ <svg
767
+ fill="currentColor"
768
+ height="1em"
769
+ stroke="currentColor"
770
+ stroke-width="0"
771
+ viewBox="0 0 24 24"
772
+ width="1em"
773
+ xmlns="http://www.w3.org/2000/svg"
774
+ >
775
+ <path
776
+ d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
777
+ />
778
+ </svg>
779
+ </span>
780
+ </div>
781
+ </div>
782
+ </DocumentFragment>
783
+ `;
784
+
623
785
  exports[`component:<InputDate> renders 1`] = `
624
786
  <DocumentFragment>
625
787
  <div