@mirai/ui 1.0.63 → 1.0.65

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 (41) hide show
  1. package/README.md +8 -1
  2. package/build/components/InputDate/InputDate.js +28 -12
  3. package/build/components/InputDate/InputDate.js.map +1 -1
  4. package/build/components/InputDate/InputDate.module.css +9 -16
  5. package/build/components/InputDate/InputDate.stories.js +11 -1
  6. package/build/components/InputDate/InputDate.stories.js.map +1 -1
  7. package/build/components/InputDate/__tests__/__snapshots__/InputDate.test.js.snap +148 -167
  8. package/build/components/InputNumber/InputNumber.module.css +6 -2
  9. package/build/components/InputOption/InputOption.js +1 -0
  10. package/build/components/InputOption/InputOption.js.map +1 -1
  11. package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +3 -3
  12. package/build/components/InputSelect/InputSelect.js +17 -7
  13. package/build/components/InputSelect/InputSelect.js.map +1 -1
  14. package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +217 -163
  15. package/build/components/InputText/InputText.js +13 -10
  16. package/build/components/InputText/InputText.js.map +1 -1
  17. package/build/components/InputText/InputText.module.css +11 -11
  18. package/build/components/InputText/InputText.stories.js +1 -0
  19. package/build/components/InputText/InputText.stories.js.map +1 -1
  20. package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +116 -88
  21. package/build/components/Menu/Menu.js +37 -16
  22. package/build/components/Menu/Menu.js.map +1 -1
  23. package/build/components/Menu/Menu.module.css +3 -0
  24. package/build/components/Menu/Menu.stories.js +1 -0
  25. package/build/components/Menu/Menu.stories.js.map +1 -1
  26. package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +35 -19
  27. package/build/components/Modal/Modal.js +5 -2
  28. package/build/components/Modal/Modal.js.map +1 -1
  29. package/build/components/Modal/Modal.module.css +9 -20
  30. package/build/components/Modal/Modal.stories.js +1 -0
  31. package/build/components/Modal/Modal.stories.js.map +1 -1
  32. package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +24 -12
  33. package/build/components/Notification/Notification.module.css +0 -13
  34. package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +6 -2
  35. package/build/hooks/useDevice.js +1 -1
  36. package/build/hooks/useDevice.js.map +1 -1
  37. package/build/primitives/Icon/Icon.constants.js +2 -2
  38. package/build/primitives/Icon/Icon.constants.js.map +1 -1
  39. package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +6 -2
  40. package/build/theme/default.theme.css +20 -20
  41. package/package.json +1 -1
@@ -115,22 +115,25 @@ var InputText = function InputText(_ref) {
115
115
  onChange: handleChange,
116
116
  onEnter: handleEnter,
117
117
  onLeave: handleLeave
118
- })), has.stateIcon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
119
- value: (0, _helpers.getIconState)({
120
- error: error,
121
- success: success,
122
- warning: warning
123
- }),
124
- className: (0, _helpers.styles)(_InputTextModule.default.icon, _InputTextModule.default.right, error ? _InputTextModule.default.error : warning ? _InputTextModule.default.warning : success ? _InputTextModule.default.success : undefined)
125
- }), is.password && !disabled && !has.stateIcon && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
118
+ })), (is.password && !disabled || has.stateIcon) && /*#__PURE__*/_react.default.createElement(_primitives.View, {
119
+ row: true,
120
+ className: _InputTextModule.default.icons
121
+ }, is.password && !disabled && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
126
122
  tabIndex: -1,
127
123
  type: "button",
128
- className: _InputTextModule.default.pressable,
129
124
  onPress: function onPress() {
130
125
  return setPassword(!password);
131
126
  }
132
127
  }, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
133
- value: password ? _primitives.ICON.EYE_CLOSE : _primitives.ICON.EYE_OPEN
128
+ value: password ? _primitives.ICON.EYE_CLOSE : _primitives.ICON.EYE_OPEN,
129
+ className: _InputTextModule.default.icon
130
+ })), has.stateIcon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
131
+ value: (0, _helpers.getIconState)({
132
+ error: error,
133
+ success: success,
134
+ warning: warning
135
+ }),
136
+ className: (0, _helpers.styles)(_InputTextModule.default.icon, error ? _InputTextModule.default.error : warning ? _InputTextModule.default.warning : success ? _InputTextModule.default.success : undefined)
134
137
  }))), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
135
138
  small: true,
136
139
  className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
@@ -1 +1 @@
1
- {"version":3,"file":"InputText.js","names":["InputText","disabled","error","hint","icon","label","showState","success","type","warning","onChange","onEnter","onLeave","others","focus","setFocus","password","setPassword","handleChange","value","event","handleEnter","handleLeave","has","undefined","length","stateIcon","is","style","inputContainer","className","text","withIcon","inputBorder","left","input","iconLeft","right","pressable","ICON","EYE_CLOSE","EYE_OPEN","displayName","propTypes","PropTypes","bool","string","func","multiLine","name","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\n\nconst InputText = ({\n disabled,\n error,\n hint,\n icon,\n label,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = () => {\n setFocus(false);\n onLeave(event);\n };\n\n const has = {\n value: others.value !== undefined && others.value?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n const is = { password: type === 'password' };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n icon && style.withIcon,\n (focus || error || has.value) && style.value,\n )}\n >\n {label}\n </Text>\n )}\n\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n focus && !error && style.focus,\n )}\n >\n {icon && (\n <Icon\n value={icon}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n <Input\n {...others}\n disabled={disabled}\n type={!is.password || password ? type : 'text'}\n value={others.value || ''}\n className={styles(style.input, icon && style.iconLeft)}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n\n {has.stateIcon && (\n <Icon\n value={getIconState({ error, success, warning })}\n className={styles(\n style.icon,\n style.right,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n />\n )}\n {is.password && !disabled && !has.stateIcon && (\n <Pressable tabIndex={-1} type=\"button\" className={style.pressable} onPress={() => setPassword(!password)}>\n <Icon value={password ? ICON.EYE_CLOSE : ICON.EYE_OPEN} />\n </Pressable>\n )}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, disabled && style.disabled, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputText.displayName = 'Component:InputText';\n\nInputText.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n type: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputText };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,SAAS,GAAG,SAAZA,SAAY,OAcZ;EAAA;;EAAA,IAbJC,QAaI,QAbJA,QAaI;EAAA,IAZJC,KAYI,QAZJA,KAYI;EAAA,IAXJC,IAWI,QAXJA,IAWI;E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AAUC,IADA;EAEpB3C,KAAK,EAAE0C,mBAAUC,IAFG;EAGpB1C,IAAI,EAAEyC,mBAAUE,MAHI;EAIpB1C,IAAI,EAAEwC,mBAAUG,IAJI;EAKpB1C,KAAK,EAAEuC,mBAAUE,MALG;EAMpBE,SAAS,EAAEJ,mBAAUC,IAND;EAOpBI,IAAI,EAAEL,mBAAUE,MAAV,CAAiBI,UAPH;EAQpB5C,SAAS,EAAEsC,mBAAUC,IARD;EASpBtC,OAAO,EAAEqC,mBAAUC,IATC;EAUpBrC,IAAI,EAAEoC,mBAAUE,MAVI;EAWpBrC,OAAO,EAAEmC,mBAAUC,IAXC;EAYpBnC,QAAQ,EAAEkC,mBAAUG,IAZA;EAapBpC,OAAO,EAAEiC,mBAAUG,IAbC;EAcpBnC,OAAO,EAAEgC,mBAAUG;AAdC,CAAtB"}
1
+ {"version":3,"file":"InputText.js","names":["InputText","disabled","error","hint","icon","label","showState","success","type","warning","onChange","onEnter","onLeave","others","focus","setFocus","password","setPassword","handleChange","value","event","handleEnter","handleLeave","has","undefined","length","stateIcon","is","style","inputContainer","className","text","withIcon","inputBorder","left","input","iconLeft","icons","ICON","EYE_CLOSE","EYE_OPEN","displayName","propTypes","PropTypes","bool","string","func","multiLine","name","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\n\nconst InputText = ({\n disabled,\n error,\n hint,\n icon,\n label,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = () => {\n setFocus(false);\n onLeave(event);\n };\n\n const has = {\n value: others.value !== undefined && others.value?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n const is = { password: type === 'password' };\n\n return (\n <View className={styles(style.inputContainer, others.className)} style={others.style}>\n {label && (\n <Text\n className={styles(\n style.text,\n style.label,\n disabled && style.disabled,\n focus && style.focus,\n error && style.error,\n icon && style.withIcon,\n (focus || error || has.value) && style.value,\n )}\n >\n {label}\n </Text>\n )}\n\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n focus && !error && style.focus,\n )}\n >\n {icon && (\n <Icon\n value={icon}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n <Input\n {...others}\n disabled={disabled}\n type={!is.password || password ? type : 'text'}\n value={others.value || ''}\n className={styles(style.input, icon && style.iconLeft)}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n\n {((is.password && !disabled) || has.stateIcon) && (\n <View row className={style.icons}>\n {is.password && !disabled && (\n <Pressable tabIndex={-1} type=\"button\" onPress={() => setPassword(!password)}>\n <Icon value={password ? ICON.EYE_CLOSE : ICON.EYE_OPEN} className={style.icon} />\n </Pressable>\n )}\n\n {has.stateIcon && (\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 )}\n />\n )}\n </View>\n )}\n </View>\n\n {hint && (\n <Text small className={styles(style.text, style.hint, disabled && style.disabled, error && style.error)}>\n {hint}\n </Text>\n )}\n </View>\n );\n};\n\nInputText.displayName = 'Component:InputText';\n\nInputText.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n type: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n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B,IAAI,iBACH,6BAAC,gBAAD;IAAM,KAAK,MAAX;IAAY,SAAS,EAAE,qBAAOyB,yBAAMG,IAAb,EAAmBH,yBAAMzB,IAAzB,EAA+BF,QAAQ,IAAI2B,yBAAM3B,QAAjD,EAA2DC,KAAK,IAAI0B,yBAAM1B,KAA1E;EAAvB,GACGC,IADH,CAlEJ,CADF;AAyED,CA/GD;;;AAiHAH,SAAS,CAACyC,WAAV,GAAwB,qBAAxB;AAEAzC,SAAS,CAAC0C,SAAV,GAAsB;EACpBzC,QAAQ,EAAE0C,mBAAUC,IADA;EAEpB1C,KAAK,EAAEyC,mBAAUC,IAFG;EAGpBzC,IAAI,EAAEwC,mBAAUE,MAHI;EAIpBzC,IAAI,EAAEuC,mBAAUG,IAJI;EAKpBzC,KAAK,EAAEsC,mBAAUE,MALG;EAMpBE,SAAS,EAAEJ,mBAAUC,IAND;EAOpBI,IAAI,EAAEL,mBAAUE,MAAV,CAAiBI,UAPH;EAQpB3C,SAAS,EAAEqC,mBAAUC,IARD;EASpBrC,OAAO,EAAEoC,mBAAUC,IATC;EAUpBpC,IAAI,EAAEmC,mBAAUE,MAVI;EAWpBpC,OAAO,EAAEkC,mBAAUC,IAXC;EAYpBlC,QAAQ,EAAEiC,mBAAUG,IAZA;EAapBnC,OAAO,EAAEgC,mBAAUG,IAbC;EAcpBlC,OAAO,EAAE+B,mBAAUG;AAdC,CAAtB"}
@@ -23,21 +23,17 @@
23
23
  }
24
24
 
25
25
  .icon {
26
- color: var(--mirai-ui-input-disabled);
27
26
  font-size: var(--mirai-ui-input-text-icon);
28
27
  height: var(--mirai-ui-input-text-icon);
29
28
  line-height: var(--mirai-ui-input-text-icon);
30
- pointer-events: none;
31
- position: absolute;
32
29
  width: var(--mirai-ui-input-text-icon);
33
30
  }
34
31
 
35
32
  .icon.left {
33
+ color: var(--mirai-ui-input-disabled);
36
34
  left: var(--mirai-ui-input-text-padding-x);
37
- }
38
-
39
- .icon.right {
40
- right: var(--mirai-ui-input-text-padding-x);
35
+ pointer-events: none;
36
+ position: absolute;
41
37
  }
42
38
 
43
39
  .input {
@@ -54,20 +50,24 @@
54
50
  padding-right: calc(var(--mirai-ui-input-text-padding-x) * 3);
55
51
  }
56
52
 
57
- .input.empty:not(:focus),
58
- .input::placeholder {
53
+ .input.empty:not(:focus) {
59
54
  color: var(--mirai-ui-base);
60
55
  }
61
56
 
62
57
  .hint {
63
- margin: calc(var(--mirai-ui-input-text-padding-x) / 4) var(--mirai-ui-input-text-padding-x);
58
+ margin: calc(var(--mirai-ui-input-text-padding-y) / 4) var(--mirai-ui-input-text-padding-x);
64
59
  }
65
60
 
66
- .pressable {
61
+ .icons {
67
62
  position: absolute;
68
63
  right: var(--mirai-ui-input-text-padding-x);
69
64
  }
70
65
 
66
+ .icons > .icon {
67
+ margin-left: calc(var(--mirai-ui-input-text-icon) / 2);
68
+ position: relative;
69
+ }
70
+
71
71
  .label {
72
72
  background-color: var(--mirai-ui-input-background);
73
73
  font-size: var(--mirai-ui-input-font-size);
@@ -54,6 +54,7 @@ Story.args = _defineProperty({
54
54
  label: 'label',
55
55
  multiLine: false,
56
56
  name: 'name',
57
+ placeholder: '',
57
58
  showState: true,
58
59
  success: false,
59
60
  type: 'text',
@@ -1 +1 @@
1
- {"version":3,"file":"InputText.stories.js","names":["title","Story","props","ICON","icon","storyName","args","disabled","error","hint","undefined","label","multiLine","name","showState","success","type","value","warning","onChange","console","log","onEnter","onLeave","argTypes","options","Object","keys","control","defaultValue"],"sources":["../../../src/components/InputText/InputText.stories.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport * as React from 'react';\n\nimport { ICON } from '../../primitives';\nimport { InputText } from './InputText';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <InputText {...props} icon={ICON[props.icon]} />;\n\nStory.storyName = 'InputText';\n\nStory.args = {\n disabled: false,\n error: false,\n hint: 'hint',\n icon: undefined,\n label: 'label',\n multiLine: false,\n name: 'name',\n showState: true,\n success: false,\n type: 'text',\n value: 'value',\n warning: false,\n onChange: (...props) => console.log('<InputText>::onChange', ...props),\n onEnter: (...props) => console.log('<InputText>::onEnter', ...props),\n onLeave: (...props) => console.log('<InputText>::onLeave', ...props),\n ['data-testid']: 'test-story',\n};\n\nStory.argTypes = {\n icon: {\n options: [undefined, ...Object.keys(ICON)],\n control: { type: 'select' },\n defaultValue: undefined,\n },\n type: {\n options: ['text', 'password', 'number', 'email', 'date'],\n control: { type: 'select' },\n defaultValue: 'text',\n },\n};\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;eAEe;EAAEA,KAAK,EAAE;AAAT,C;;;AAER,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;EAAA,oBAAW,oBAAC,oBAAD,eAAeA,KAAf;IAAsB,IAAI,EAAEC,iBAAKD,KAAK,CAACE,IAAX;EAA5B,GAAX;AAAA,CAAd;;;AAEPH,KAAK,CAACI,SAAN,GAAkB,WAAlB;AAEAJ,KAAK,CAACK,IAAN;EACEC,QAAQ,EAAE,KADZ;EAEEC,KAAK,EAAE,KAFT;EAGEC,IAAI,EAAE,MAHR;EAIEL,IAAI,EAAEM,SAJR;EAKEC,KAAK,EAAE,OALT;EAMEC,SAAS,EAAE,KANb;EAOEC,IAAI,EAAE,MAPR;EAQEC,SAAS,EAAE,IARb;EASEC,OAAO,EAAE,KATX;EAUEC,IAAI,EAAE,MAVR;EAWEC,KAAK,EAAE,OAXT;EAYEC,OAAO,EAAE,KAZX;EAaEC,QAAQ,EAAE;IAAA;;IAAA,kCAAIjB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,YAAAkB,OAAO,EAACC,GAAR,kBAAY,uBAAZ,SAAwCnB,KAAxC,EAAd;EAAA,CAbZ;EAcEoB,OAAO,EAAE;IAAA;;IAAA,mCAAIpB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,aAAAkB,OAAO,EAACC,GAAR,mBAAY,sBAAZ,SAAuCnB,KAAvC,EAAd;EAAA,CAdX;EAeEqB,OAAO,EAAE;IAAA;;IAAA,mCAAIrB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,aAAAkB,OAAO,EAACC,GAAR,mBAAY,sBAAZ,SAAuCnB,KAAvC,EAAd;EAAA;AAfX,GAgBG,aAhBH,EAgBmB,YAhBnB;AAmBAD,KAAK,CAACuB,QAAN,GAAiB;EACfpB,IAAI,EAAE;IACJqB,OAAO,GAAGf,SAAH,4BAAiBgB,MAAM,CAACC,IAAP,CAAYxB,gBAAZ,CAAjB,EADH;IAEJyB,OAAO,EAAE;MAAEZ,IAAI,EAAE;IAAR,CAFL;IAGJa,YAAY,EAAEnB;EAHV,CADS;EAMfM,IAAI,EAAE;IACJS,OAAO,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,QAArB,EAA+B,OAA/B,EAAwC,MAAxC,CADL;IAEJG,OAAO,EAAE;MAAEZ,IAAI,EAAE;IAAR,CAFL;IAGJa,YAAY,EAAE;EAHV;AANS,CAAjB"}
1
+ {"version":3,"file":"InputText.stories.js","names":["title","Story","props","ICON","icon","storyName","args","disabled","error","hint","undefined","label","multiLine","name","placeholder","showState","success","type","value","warning","onChange","console","log","onEnter","onLeave","argTypes","options","Object","keys","control","defaultValue"],"sources":["../../../src/components/InputText/InputText.stories.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport * as React from 'react';\n\nimport { ICON } from '../../primitives';\nimport { InputText } from './InputText';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <InputText {...props} icon={ICON[props.icon]} />;\n\nStory.storyName = 'InputText';\n\nStory.args = {\n disabled: false,\n error: false,\n hint: 'hint',\n icon: undefined,\n label: 'label',\n multiLine: false,\n name: 'name',\n placeholder: '',\n showState: true,\n success: false,\n type: 'text',\n value: 'value',\n warning: false,\n onChange: (...props) => console.log('<InputText>::onChange', ...props),\n onEnter: (...props) => console.log('<InputText>::onEnter', ...props),\n onLeave: (...props) => console.log('<InputText>::onLeave', ...props),\n ['data-testid']: 'test-story',\n};\n\nStory.argTypes = {\n icon: {\n options: [undefined, ...Object.keys(ICON)],\n control: { type: 'select' },\n defaultValue: undefined,\n },\n type: {\n options: ['text', 'password', 'number', 'email', 'date'],\n control: { type: 'select' },\n defaultValue: 'text',\n },\n};\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AACA;;;;;;;;;;;;;;;;;;;;;;eAEe;EAAEA,KAAK,EAAE;AAAT,C;;;AAER,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;EAAA,oBAAW,oBAAC,oBAAD,eAAeA,KAAf;IAAsB,IAAI,EAAEC,iBAAKD,KAAK,CAACE,IAAX;EAA5B,GAAX;AAAA,CAAd;;;AAEPH,KAAK,CAACI,SAAN,GAAkB,WAAlB;AAEAJ,KAAK,CAACK,IAAN;EACEC,QAAQ,EAAE,KADZ;EAEEC,KAAK,EAAE,KAFT;EAGEC,IAAI,EAAE,MAHR;EAIEL,IAAI,EAAEM,SAJR;EAKEC,KAAK,EAAE,OALT;EAMEC,SAAS,EAAE,KANb;EAOEC,IAAI,EAAE,MAPR;EAQEC,WAAW,EAAE,EARf;EASEC,SAAS,EAAE,IATb;EAUEC,OAAO,EAAE,KAVX;EAWEC,IAAI,EAAE,MAXR;EAYEC,KAAK,EAAE,OAZT;EAaEC,OAAO,EAAE,KAbX;EAcEC,QAAQ,EAAE;IAAA;;IAAA,kCAAIlB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,YAAAmB,OAAO,EAACC,GAAR,kBAAY,uBAAZ,SAAwCpB,KAAxC,EAAd;EAAA,CAdZ;EAeEqB,OAAO,EAAE;IAAA;;IAAA,mCAAIrB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,aAAAmB,OAAO,EAACC,GAAR,mBAAY,sBAAZ,SAAuCpB,KAAvC,EAAd;EAAA,CAfX;EAgBEsB,OAAO,EAAE;IAAA;;IAAA,mCAAItB,KAAJ;MAAIA,KAAJ;IAAA;;IAAA,OAAc,aAAAmB,OAAO,EAACC,GAAR,mBAAY,sBAAZ,SAAuCpB,KAAvC,EAAd;EAAA;AAhBX,GAiBG,aAjBH,EAiBmB,YAjBnB;AAoBAD,KAAK,CAACwB,QAAN,GAAiB;EACfrB,IAAI,EAAE;IACJsB,OAAO,GAAGhB,SAAH,4BAAiBiB,MAAM,CAACC,IAAP,CAAYzB,gBAAZ,CAAjB,EADH;IAEJ0B,OAAO,EAAE;MAAEZ,IAAI,EAAE;IAAR,CAFL;IAGJa,YAAY,EAAEpB;EAHV,CADS;EAMfO,IAAI,EAAE;IACJS,OAAO,EAAE,CAAC,MAAD,EAAS,UAAT,EAAqB,QAArB,EAA+B,OAA/B,EAAwC,MAAxC,CADL;IAEJG,OAAO,EAAE;MAAEZ,IAAI,EAAE;IAAR,CAFL;IAGJa,YAAY,EAAE;EAHV;AANS,CAAjB"}
@@ -53,23 +53,31 @@ exports[`component:<InputText> prop:error 1`] = `
53
53
  type="text"
54
54
  value=""
55
55
  />
56
- <span
57
- class="icon headline-3 icon right error"
56
+ <div
57
+ class="view row icons"
58
58
  >
59
- <svg
60
- fill="currentColor"
61
- height="1em"
62
- stroke="currentColor"
63
- stroke-width="0"
64
- viewBox="0 0 24 24"
65
- width="1em"
66
- xmlns="http://www.w3.org/2000/svg"
59
+ <span
60
+ class="icon headline-3 icon error"
67
61
  >
68
- <path
69
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
70
- />
71
- </svg>
72
- </span>
62
+ <svg
63
+ fill="currentColor"
64
+ height="1em"
65
+ stroke="currentColor"
66
+ stroke-width="0"
67
+ viewBox="0 0 24 24"
68
+ width="1em"
69
+ xmlns="http://www.w3.org/2000/svg"
70
+ >
71
+ <path
72
+ d="M0 0h24v24H0V0z"
73
+ fill="none"
74
+ />
75
+ <path
76
+ 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"
77
+ />
78
+ </svg>
79
+ </span>
80
+ </div>
73
81
  </div>
74
82
  </div>
75
83
  </DocumentFragment>
@@ -195,23 +203,31 @@ exports[`component:<InputText> prop:showState (false) 1`] = `
195
203
  type="text"
196
204
  value=""
197
205
  />
198
- <span
199
- class="icon headline-3 icon right error"
206
+ <div
207
+ class="view row icons"
200
208
  >
201
- <svg
202
- fill="currentColor"
203
- height="1em"
204
- stroke="currentColor"
205
- stroke-width="0"
206
- viewBox="0 0 24 24"
207
- width="1em"
208
- xmlns="http://www.w3.org/2000/svg"
209
+ <span
210
+ class="icon headline-3 icon error"
209
211
  >
210
- <path
211
- d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
212
- />
213
- </svg>
214
- </span>
212
+ <svg
213
+ fill="currentColor"
214
+ height="1em"
215
+ stroke="currentColor"
216
+ stroke-width="0"
217
+ viewBox="0 0 24 24"
218
+ width="1em"
219
+ xmlns="http://www.w3.org/2000/svg"
220
+ >
221
+ <path
222
+ d="M0 0h24v24H0V0z"
223
+ fill="none"
224
+ />
225
+ <path
226
+ 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"
227
+ />
228
+ </svg>
229
+ </span>
230
+ </div>
215
231
  </div>
216
232
  </div>
217
233
  </DocumentFragment>
@@ -231,27 +247,31 @@ exports[`component:<InputText> prop:success 1`] = `
231
247
  type="text"
232
248
  value=""
233
249
  />
234
- <span
235
- class="icon headline-3 icon right success"
250
+ <div
251
+ class="view row icons"
236
252
  >
237
- <svg
238
- fill="currentColor"
239
- height="1em"
240
- stroke="currentColor"
241
- stroke-width="0"
242
- viewBox="0 0 24 24"
243
- width="1em"
244
- xmlns="http://www.w3.org/2000/svg"
253
+ <span
254
+ class="icon headline-3 icon success"
245
255
  >
246
- <path
247
- d="M0 0h24v24H0V0z"
248
- fill="none"
249
- />
250
- <path
251
- 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"
252
- />
253
- </svg>
254
- </span>
256
+ <svg
257
+ fill="currentColor"
258
+ height="1em"
259
+ stroke="currentColor"
260
+ stroke-width="0"
261
+ viewBox="0 0 24 24"
262
+ width="1em"
263
+ xmlns="http://www.w3.org/2000/svg"
264
+ >
265
+ <path
266
+ d="M0 0h24v24H0V0z"
267
+ fill="none"
268
+ />
269
+ <path
270
+ 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"
271
+ />
272
+ </svg>
273
+ </span>
274
+ </div>
255
275
  </div>
256
276
  </div>
257
277
  </DocumentFragment>
@@ -271,33 +291,37 @@ exports[`component:<InputText> prop:type 1`] = `
271
291
  type="password"
272
292
  value=""
273
293
  />
274
- <button
275
- class="pressable pressable"
276
- tabindex="-1"
277
- type="button"
294
+ <div
295
+ class="view row icons"
278
296
  >
279
- <span
280
- class="icon headline-3"
297
+ <button
298
+ class="pressable"
299
+ tabindex="-1"
300
+ type="button"
281
301
  >
282
- <svg
283
- fill="currentColor"
284
- height="1em"
285
- stroke="currentColor"
286
- stroke-width="0"
287
- viewBox="0 0 24 24"
288
- width="1em"
289
- xmlns="http://www.w3.org/2000/svg"
302
+ <span
303
+ class="icon headline-3 icon"
290
304
  >
291
- <path
292
- d="M0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0z"
293
- fill="none"
294
- />
295
- <path
296
- d="M12 6a9.77 9.77 0 018.82 5.5 9.647 9.647 0 01-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68A11.738 11.738 0 001 11.5C2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02a2.5 2.5 0 01-2.5-2.5c0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75a4.6 4.6 0 00-.36 1.78 4.507 4.507 0 006.27 4.14l.98.98c-.88.24-1.8.38-2.75.38a9.77 9.77 0 01-8.82-5.5c.7-1.43 1.72-2.61 2.93-3.53z"
297
- />
298
- </svg>
299
- </span>
300
- </button>
305
+ <svg
306
+ fill="currentColor"
307
+ height="1em"
308
+ stroke="currentColor"
309
+ stroke-width="0"
310
+ viewBox="0 0 24 24"
311
+ width="1em"
312
+ xmlns="http://www.w3.org/2000/svg"
313
+ >
314
+ <path
315
+ d="M0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0zm0 0h24v24H0V0z"
316
+ fill="none"
317
+ />
318
+ <path
319
+ d="M12 6a9.77 9.77 0 018.82 5.5 9.647 9.647 0 01-2.41 3.12l1.41 1.41c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l1.65 1.65C10.66 6.09 11.32 6 12 6zm-1.07 1.14L13 9.21c.57.25 1.03.71 1.28 1.28l2.07 2.07c.08-.34.14-.7.14-1.07C16.5 9.01 14.48 7 12 7c-.37 0-.72.05-1.07.14zM2.01 3.87l2.68 2.68A11.738 11.738 0 001 11.5C2.73 15.89 7 19 12 19c1.52 0 2.98-.29 4.32-.82l3.42 3.42 1.41-1.41L3.42 2.45 2.01 3.87zm7.5 7.5l2.61 2.61c-.04.01-.08.02-.12.02a2.5 2.5 0 01-2.5-2.5c0-.05.01-.08.01-.13zm-3.4-3.4l1.75 1.75a4.6 4.6 0 00-.36 1.78 4.507 4.507 0 006.27 4.14l.98.98c-.88.24-1.8.38-2.75.38a9.77 9.77 0 01-8.82-5.5c.7-1.43 1.72-2.61 2.93-3.53z"
320
+ />
321
+ </svg>
322
+ </span>
323
+ </button>
324
+ </div>
301
325
  </div>
302
326
  </div>
303
327
  </DocumentFragment>
@@ -317,23 +341,27 @@ exports[`component:<InputText> prop:warning 1`] = `
317
341
  type="text"
318
342
  value=""
319
343
  />
320
- <span
321
- class="icon headline-3 icon right warning"
344
+ <div
345
+ class="view row icons"
322
346
  >
323
- <svg
324
- fill="currentColor"
325
- height="1em"
326
- stroke="currentColor"
327
- stroke-width="0"
328
- viewBox="0 0 24 24"
329
- width="1em"
330
- xmlns="http://www.w3.org/2000/svg"
347
+ <span
348
+ class="icon headline-3 icon warning"
331
349
  >
332
- <path
333
- d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"
334
- />
335
- </svg>
336
- </span>
350
+ <svg
351
+ fill="currentColor"
352
+ height="1em"
353
+ stroke="currentColor"
354
+ stroke-width="0"
355
+ viewBox="0 0 24 24"
356
+ width="1em"
357
+ xmlns="http://www.w3.org/2000/svg"
358
+ >
359
+ <path
360
+ d="M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"
361
+ />
362
+ </svg>
363
+ </span>
364
+ </div>
337
365
  </div>
338
366
  </div>
339
367
  </DocumentFragment>
@@ -11,13 +11,17 @@ var _react = _interopRequireDefault(require("react"));
11
11
 
12
12
  var _helpers = require("../../helpers");
13
13
 
14
+ var _hooks = require("../../hooks");
15
+
14
16
  var _primitives = require("../../primitives");
15
17
 
18
+ var _Modal = require("../Modal");
19
+
16
20
  var _MenuModule = _interopRequireDefault(require("./Menu.module.css"));
17
21
 
18
22
  var _Menu = require("./Menu.Option");
19
23
 
20
- var _excluded = ["children", "options", "Template", "visible", "onPress"];
24
+ var _excluded = ["children", "options", "Template", "title", "visible", "onPress"];
21
25
 
22
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
27
 
@@ -33,28 +37,43 @@ var Menu = function Menu(_ref) {
33
37
  options = _ref$options === void 0 ? [] : _ref$options,
34
38
  _ref$Template = _ref.Template,
35
39
  Template = _ref$Template === void 0 ? _Menu.Option : _ref$Template,
40
+ title = _ref.title,
36
41
  visible = _ref.visible,
37
42
  _ref$onPress = _ref.onPress,
38
43
  _onPress = _ref$onPress === void 0 ? function () {} : _ref$onPress,
39
44
  others = _objectWithoutProperties(_ref, _excluded);
40
45
 
41
- return /*#__PURE__*/_react.default.createElement(_primitives.Layer, _extends({
46
+ var _useDevice = (0, _hooks.useDevice)(),
47
+ isDesktop = _useDevice.isDesktop;
48
+
49
+ var renderOptions = function renderOptions() {
50
+ return options.map(function () {
51
+ var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
52
+ var index = arguments.length > 1 ? arguments[1] : undefined;
53
+ return /*#__PURE__*/_react.default.createElement(Template, _extends({
54
+ "data-testid": others['data-testid'] ? "".concat(others['data-testid'], "-").concat(index) : undefined
55
+ }, option, {
56
+ key: index,
57
+ onPress: function onPress(event) {
58
+ return _onPress(option.value, event);
59
+ }
60
+ }));
61
+ });
62
+ };
63
+
64
+ return isDesktop ? /*#__PURE__*/_react.default.createElement(_primitives.Layer, _extends({
42
65
  forceRender: false
43
66
  }, others, {
44
- className: (0, _helpers.styles)(_MenuModule.default.menu, visible && _MenuModule.default.visible, others.className),
67
+ className: (0, _helpers.styles)(_MenuModule.default.menu, _MenuModule.default.desktop, visible && _MenuModule.default.visible, others.className),
45
68
  visible: visible
46
- }), children, /*#__PURE__*/_react.default.createElement(_primitives.LayerContent, null, options.map(function () {
47
- var option = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
48
- var index = arguments.length > 1 ? arguments[1] : undefined;
49
- return /*#__PURE__*/_react.default.createElement(Template, _extends({
50
- "data-testid": others['data-testid'] ? "".concat(others['data-testid'], "-").concat(index) : undefined
51
- }, option, {
52
- key: index,
53
- onPress: function onPress(event) {
54
- return _onPress(option.value, event);
55
- }
56
- }));
57
- })));
69
+ }), children, /*#__PURE__*/_react.default.createElement(_primitives.LayerContent, null, renderOptions())) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, /*#__PURE__*/_react.default.createElement(_Modal.Modal, {
70
+ title: title,
71
+ visible: visible,
72
+ onClose: function onClose(event) {
73
+ return _onPress(undefined, event);
74
+ },
75
+ className: (0, _helpers.styles)(_MenuModule.default.menu, others.className)
76
+ }, renderOptions()));
58
77
  };
59
78
 
60
79
  exports.Menu = Menu;
@@ -70,7 +89,9 @@ Menu.propTypes = {
70
89
  value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
71
90
  })),
72
91
  Template: _propTypes.default.node,
92
+ title: _propTypes.default.string,
73
93
  visible: _propTypes.default.bool,
74
- onPress: _propTypes.default.func
94
+ onPress: _propTypes.default.func,
95
+ onClose: _propTypes.default.func
75
96
  };
76
97
  //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","names":["Menu","children","options","Template","Option","visible","onPress","others","style","menu","className","map","option","index","undefined","event","value","displayName","propTypes","PropTypes","node","arrayOf","shape","disabled","bool","divider","icon","func","label","string","oneOfType","number"],"sources":["../../../src/components/Menu/Menu.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Layer, LayerContent } from '../../primitives';\nimport style from './Menu.module.css';\nimport { Option } from './Menu.Option';\n\nconst Menu = ({ children, options = [], Template = Option, visible, onPress = () => {}, ...others }) => {\n return (\n <Layer\n forceRender={false}\n {...others}\n className={styles(style.menu, visible && style.visible, others.className)}\n visible={visible}\n >\n {children}\n <LayerContent>\n {options.map((option = {}, index) => (\n <Template\n data-testid={others['data-testid'] ? `${others['data-testid']}-${index}` : undefined}\n {...option}\n key={index}\n onPress={(event) => onPress(option.value, event)}\n />\n ))}\n </LayerContent>\n </Layer>\n );\n};\n\nMenu.displayName = 'Component:Menu';\n\nMenu.propTypes = {\n children: PropTypes.node,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.node,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n icon: PropTypes.func,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ),\n Template: PropTypes.node,\n visible: PropTypes.bool,\n onPress: PropTypes.func,\n};\n\nexport { Menu };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO,OAA2F;EAAA,IAAxFC,QAAwF,QAAxFA,QAAwF;EAAA,wBAA9EC,OAA8E;EAAA,IAA9EA,OAA8E,6BAApE,EAAoE;EAAA,yBAAhEC,QAAgE;EAAA,IAAhEA,QAAgE,8BAArDC,YAAqD;EAAA,IAA7CC,OAA6C,QAA7CA,OAA6C;EAAA,wBAApCC,OAAoC;EAAA,IAApCA,QAAoC,6BAA1B,YAAM,CAAE,CAAkB;EAAA,IAAbC,MAAa;;EACtG,oBACE,6BAAC,iBAAD;IACE,WAAW,EAAE;EADf,GAEMA,MAFN;IAGE,SAAS,EAAE,qBAAOC,oBAAMC,IAAb,EAAmBJ,OAAO,IAAIG,oBAAMH,OAApC,EAA6CE,MAAM,CAACG,SAApD,CAHb;IAIE,OAAO,EAAEL;EAJX,IAMGJ,QANH,eAOE,6BAAC,wBAAD,QACGC,OAAO,CAACS,GAAR,CAAY;IAAA,IAACC,MAAD,uEAAU,EAAV;IAAA,IAAcC,KAAd;IAAA,oBACX,6BAAC,QAAD;MACE,eAAaN,MAAM,CAAC,aAAD,CAAN,aAA2BA,MAAM,CAAC,aAAD,CAAjC,cAAoDM,KAApD,IAA8DC;IAD7E,GAEMF,MAFN;MAGE,GAAG,EAAEC,KAHP;MAIE,OAAO,EAAE,iBAACE,KAAD;QAAA,OAAWT,QAAO,CAACM,MAAM,CAACI,KAAR,EAAeD,KAAf,CAAlB;MAAA;IAJX,GADW;EAAA,CAAZ,CADH,CAPF,CADF;AAoBD,CArBD;;;AAuBAf,IAAI,CAACiB,WAAL,GAAmB,gBAAnB;AAEAjB,IAAI,CAACkB,SAAL,GAAiB;EACfjB,QAAQ,EAAEkB,mBAAUC,IADL;EAEflB,OAAO,EAAEiB,mBAAUE,OAAV,CACPF,mBAAUG,KAAV,CAAgB;IACdrB,QAAQ,EAAEkB,mBAAUC,IADN;IAEdG,QAAQ,EAAEJ,mBAAUK,IAFN;IAGdC,OAAO,EAAEN,mBAAUK,IAHL;IAIdE,IAAI,EAAEP,mBAAUQ,IAJF;IAKdC,KAAK,EAAET,mBAAUU,MALH;IAMdb,KAAK,EAAEG,mBAAUW,SAAV,CAAoB,CAACX,mBAAUU,MAAX,EAAmBV,mBAAUY,MAA7B,CAApB;EANO,CAAhB,CADO,CAFM;EAYf5B,QAAQ,EAAEgB,mBAAUC,IAZL;EAaff,OAAO,EAAEc,mBAAUK,IAbJ;EAcflB,OAAO,EAAEa,mBAAUQ;AAdJ,CAAjB"}
1
+ {"version":3,"file":"Menu.js","names":["Menu","children","options","Template","Option","title","visible","onPress","others","isDesktop","renderOptions","map","option","index","undefined","event","value","style","menu","desktop","className","displayName","propTypes","PropTypes","node","arrayOf","shape","disabled","bool","divider","icon","func","label","string","oneOfType","number","onClose"],"sources":["../../../src/components/Menu/Menu.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Layer, LayerContent } from '../../primitives';\nimport { Modal } from '../Modal';\nimport style from './Menu.module.css';\nimport { Option } from './Menu.Option';\n\nconst Menu = ({ children, options = [], Template = Option, title, visible, onPress = () => {}, ...others }) => {\n const { isDesktop } = useDevice();\n\n const renderOptions = () =>\n options.map((option = {}, index) => (\n <Template\n data-testid={others['data-testid'] ? `${others['data-testid']}-${index}` : undefined}\n {...option}\n key={index}\n onPress={(event) => onPress(option.value, event)}\n />\n ));\n\n return isDesktop ? (\n <Layer\n forceRender={false}\n {...others}\n className={styles(style.menu, style.desktop, visible && style.visible, others.className)}\n visible={visible}\n >\n {children}\n <LayerContent>{renderOptions()}</LayerContent>\n </Layer>\n ) : (\n <>\n {children}\n <Modal\n title={title}\n visible={visible}\n onClose={(event) => onPress(undefined, event)}\n className={styles(style.menu, others.className)}\n >\n {renderOptions()}\n </Modal>\n </>\n );\n};\n\nMenu.displayName = 'Component:Menu';\n\nMenu.propTypes = {\n children: PropTypes.node,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n children: PropTypes.node,\n disabled: PropTypes.bool,\n divider: PropTypes.bool,\n icon: PropTypes.func,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n }),\n ),\n Template: PropTypes.node,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onPress: PropTypes.func,\n onClose: PropTypes.func,\n};\n\nexport { Menu };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO,OAAkG;EAAA,IAA/FC,QAA+F,QAA/FA,QAA+F;EAAA,wBAArFC,OAAqF;EAAA,IAArFA,OAAqF,6BAA3E,EAA2E;EAAA,yBAAvEC,QAA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AM,CAACY,SAA1B;EAJb,GAMGV,aAAa,EANhB,CAFF,CAXF;AAuBD,CApCD;;;AAsCAV,IAAI,CAACqB,WAAL,GAAmB,gBAAnB;AAEArB,IAAI,CAACsB,SAAL,GAAiB;EACfrB,QAAQ,EAAEsB,mBAAUC,IADL;EAEftB,OAAO,EAAEqB,mBAAUE,OAAV,CACPF,mBAAUG,KAAV,CAAgB;IACdzB,QAAQ,EAAEsB,mBAAUC,IADN;IAEdG,QAAQ,EAAEJ,mBAAUK,IAFN;IAGdC,OAAO,EAAEN,mBAAUK,IAHL;IAIdE,IAAI,EAAEP,mBAAUQ,IAJF;IAKdC,KAAK,EAAET,mBAAUU,MALH;IAMdjB,KAAK,EAAEO,mBAAUW,SAAV,CAAoB,CAACX,mBAAUU,MAAX,EAAmBV,mBAAUY,MAA7B,CAApB;EANO,CAAhB,CADO,CAFM;EAYfhC,QAAQ,EAAEoB,mBAAUC,IAZL;EAafnB,KAAK,EAAEkB,mBAAUU,MAbF;EAcf3B,OAAO,EAAEiB,mBAAUK,IAdJ;EAefrB,OAAO,EAAEgB,mBAAUQ,IAfJ;EAgBfK,OAAO,EAAEb,mBAAUQ;AAhBJ,CAAjB"}
@@ -1,4 +1,7 @@
1
1
  .menu {
2
+ }
3
+
4
+ .menu.desktop {
2
5
  background-color: var(--mirai-ui-menu-base);
3
6
  border-radius: var(--mirai-ui-menu-border-radius);
4
7
  box-shadow: var(--mirai-ui-menu-shadow);
@@ -68,6 +68,7 @@ Story.args = _defineProperty({
68
68
  wide: true
69
69
  }, "Logout")
70
70
  }],
71
+ title: 'title',
71
72
  visible: true
72
73
  }, 'data-testid', 'test-story');
73
74
  Story.argTypes = {
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.stories.js","names":["title","Story","props","storyName","args","options","children","divider","label","icon","ICON","ADD","value","disabled","visible","argTypes","onPress","action"],"sources":["../../../src/components/Menu/Menu.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '../';\nimport { ICON, Text } from '../../primitives';\nimport { Menu } from './Menu';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => (\n <Menu {...props}>\n <span className=\"children\">children</span>\n </Menu>\n);\n\nStory.storyName = 'Menu';\n\nStory.args = {\n options: [\n {\n children: (\n <>\n <Text bold>Lorem</Text>\n <Text>Ipsum is simply dummy text...</Text>\n </>\n ),\n divider: true,\n },\n { label: 'Lorem Ipsum is simply dummy text...', divider: true },\n { icon: ICON.ADD, label: 'Item 1', value: 'one', ['data-testid']: 'custom-test' },\n { icon: ICON.ADD, label: 'Item 2', disabled: true, value: 'two' },\n { label: 'Item 3', divider: true, value: 'three' },\n { label: 'Item 4', children: <Button small>Add</Button>, value: 'four' },\n {\n children: (\n <Button secondary wide>\n Logout\n </Button>\n ),\n },\n ],\n visible: true,\n ['data-testid']: 'test-story',\n};\n\nStory.argTypes = {\n onPress: { action: 'onPress' },\n};\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AACA;;AACA;;;;;;;;eAEe;EAAEA,KAAK,EAAE;AAAT,C;;;AAER,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;EAAA,oBACnB,oBAAC,UAAD,EAAUA,KAAV,eACE;IAAM,SAAS,EAAC;EAAhB,cADF,CADmB;AAAA,CAAd;;;AAMPD,KAAK,CAACE,SAAN,GAAkB,MAAlB;AAEAF,KAAK,CAACG,IAAN;EACEC,OAAO,EAAE,CACP;IACEC,QAAQ,eACN,uDACE,oBAAC,gBAAD;MAAM,IAAI;IAAV,WADF,eAEE,oBAAC,gBAAD,wCAFF,CAFJ;IAOEC,OAAO,EAAE;EAPX,CADO,EAUP;IAAEC,KAAK,EAAE,qCAAT;IAAgDD,OAAO,EAAE;EAAzD,CAVO;IAWLE,IAAI,EAAEC,iBAAKC,GAXN;IAWWH,KAAK,EAAE,QAXlB;IAW4BI,KAAK,EAAE;EAXnC,GAW2C,aAX3C,EAW2D,aAX3D,GAYP;IAAEH,IAAI,EAAEC,iBAAKC,GAAb;IAAkBH,KAAK,EAAE,QAAzB;IAAmCK,QAAQ,EAAE,IAA7C;IAAmDD,KAAK,EAAE;EAA1D,CAZO,EAaP;IAAEJ,KAAK,EAAE,QAAT;IAAmBD,OAAO,EAAE,IAA5B;IAAkCK,KAAK,EAAE;EAAzC,CAbO,EAcP;IAAEJ,KAAK,EAAE,QAAT;IAAmBF,QAAQ,eAAE,oBAAC,QAAD;MAAQ,KAAK;IAAb,SAA7B;IAAyDM,KAAK,EAAE;EAAhE,CAdO,EAeP;IACEN,QAAQ,eACN,oBAAC,QAAD;MAAQ,SAAS,MAAjB;MAAkB,IAAI;IAAtB;EAFJ,CAfO,CADX;EAwBEQ,OAAO,EAAE;AAxBX,GAyBG,aAzBH,EAyBmB,YAzBnB;AA4BAb,KAAK,CAACc,QAAN,GAAiB;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAV;AADM,CAAjB"}
1
+ {"version":3,"file":"Menu.stories.js","names":["title","Story","props","storyName","args","options","children","divider","label","icon","ICON","ADD","value","disabled","visible","argTypes","onPress","action"],"sources":["../../../src/components/Menu/Menu.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '../';\nimport { ICON, Text } from '../../primitives';\nimport { Menu } from './Menu';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => (\n <Menu {...props}>\n <span className=\"children\">children</span>\n </Menu>\n);\n\nStory.storyName = 'Menu';\n\nStory.args = {\n options: [\n {\n children: (\n <>\n <Text bold>Lorem</Text>\n <Text>Ipsum is simply dummy text...</Text>\n </>\n ),\n divider: true,\n },\n { label: 'Lorem Ipsum is simply dummy text...', divider: true },\n { icon: ICON.ADD, label: 'Item 1', value: 'one', ['data-testid']: 'custom-test' },\n { icon: ICON.ADD, label: 'Item 2', disabled: true, value: 'two' },\n { label: 'Item 3', divider: true, value: 'three' },\n { label: 'Item 4', children: <Button small>Add</Button>, value: 'four' },\n {\n children: (\n <Button secondary wide>\n Logout\n </Button>\n ),\n },\n ],\n title: 'title',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