@mirai/ui 1.0.96 → 1.0.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/InputNumber/InputNumber.js +1 -0
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +20 -20
- package/build/components/Modal/Modal.js +1 -1
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/Modal.module.css +5 -0
- package/build/components/Modal/Modal.stories.js +0 -1
- package/build/components/Modal/Modal.stories.js.map +1 -1
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +13 -1
- package/build/primitives/Text/Text.js +2 -3
- package/build/primitives/Text/Text.js.map +1 -1
- package/package.json +1 -1
|
@@ -56,6 +56,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
56
56
|
value: _primitives.ICON.REMOVE
|
|
57
57
|
})), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
58
58
|
headline: true,
|
|
59
|
+
tag: "span",
|
|
59
60
|
className: (0, _helpers.styles)(_InputNumberModule.default.value, disabled && _InputNumberModule.default.disabled)
|
|
60
61
|
}, typeof value === 'number' ? value : min), /*#__PURE__*/_react.default.createElement(_Button.Button, {
|
|
61
62
|
disabled: disabled || value >= max,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","styles","style","inputNumber","className","texts","ICON","REMOVE","ADD","displayName","propTypes","PropTypes","bool","oneOfType","string","array","number","isRequired","func"],"sources":["../../../src/components/InputNumber/InputNumber.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, ICON, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport style from './InputNumber.module.css';\n\nconst InputNumber = ({\n disabled,\n hint,\n label,\n max,\n min = 0,\n name,\n rounded = true,\n step = 1,\n value = 0,\n onChange = () => {},\n ...others\n}) => (\n <View {...others} row className={styles(style.inputNumber, others.className)}>\n <View className={style.texts}>\n {label && (\n <Text headline level={4} className={styles(style.label, disabled && style.disabled)}>\n {label}\n </Text>\n )}\n {hint && (\n <Text small className={styles(style.hint, disabled && style.disabled)}>\n {hint}\n </Text>\n )}\n </View>\n <Button\n disabled={disabled || value <= min}\n rounded={rounded}\n secondary\n squared\n onPress={() => onChange(value - step, name)}\n >\n <Icon value={ICON.REMOVE} />\n </Button>\n <Text headline className={styles(style.value, disabled && style.disabled)}>\n {typeof value === 'number' ? value : min}\n </Text>\n <Button\n disabled={disabled || value >= max}\n rounded={rounded}\n secondary\n squared\n onPress={() => onChange(value + step, name)}\n >\n <Icon value={ICON.ADD} />\n </Button>\n </View>\n);\n\nInputNumber.displayName = 'Component:InputOption';\n\nInputNumber.propTypes = {\n disabled: PropTypes.bool,\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n label: PropTypes.string,\n max: PropTypes.number,\n min: PropTypes.number,\n name: PropTypes.string.isRequired,\n rounded: PropTypes.bool,\n step: PropTypes.number,\n value: PropTypes.number,\n onChange: PropTypes.func,\n};\n\nexport { InputNumber };\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAA6C;AAAA;AAAA;AAAA;AAAA;AAE7C,IAAMA,WAAW,GAAG,SAAdA,WAAW;EAAA,IACfC,QAAQ,QAARA,QAAQ;IACRC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,GAAG,QAAHA,GAAG;IAAA,gBACHC,GAAG;IAAHA,GAAG,yBAAG,CAAC;IACPC,IAAI,QAAJA,IAAI;IAAA,oBACJC,OAAO;IAAPA,OAAO,6BAAG,IAAI;IAAA,iBACdC,IAAI;IAAJA,IAAI,0BAAG,CAAC;IAAA,kBACRC,KAAK;IAALA,KAAK,2BAAG,CAAC;IAAA,qBACTC,QAAQ;IAARA,QAAQ,8BAAG,YAAM,CAAC,CAAC;IAChBC,MAAM;EAAA,oBAET,6BAAC,gBAAI,eAAKA,MAAM;IAAE,GAAG;IAAC,SAAS,EAAE,IAAAC,eAAM,EAACC,0BAAK,CAACC,WAAW,EAAEH,MAAM,CAACI,SAAS;EAAE,iBAC3E,6BAAC,gBAAI;IAAC,SAAS,EAAEF,0BAAK,CAACG;EAAM,GAC1Bb,KAAK,iBACJ,6BAAC,gBAAI;IAAC,QAAQ;IAAC,KAAK,EAAE,CAAE;IAAC,SAAS,EAAE,IAAAS,eAAM,EAACC,0BAAK,CAACV,KAAK,EAAEF,QAAQ,IAAIY,0BAAK,CAACZ,QAAQ;EAAE,GACjFE,KAAK,CAET,EACAD,IAAI,iBACH,6BAAC,gBAAI;IAAC,KAAK;IAAC,SAAS,EAAE,IAAAU,eAAM,EAACC,0BAAK,CAACX,IAAI,EAAED,QAAQ,IAAIY,0BAAK,CAACZ,QAAQ;EAAE,GACnEC,IAAI,CAER,CACI,eACP,6BAAC,cAAM;IACL,QAAQ,EAAED,QAAQ,IAAIQ,KAAK,IAAIJ,GAAI;IACnC,OAAO,EAAEE,OAAQ;IACjB,SAAS;IACT,OAAO;IACP,OAAO,EAAE;MAAA,OAAMG,QAAQ,CAACD,KAAK,GAAGD,IAAI,EAAEF,IAAI,CAAC;IAAA;EAAC,gBAE5C,6BAAC,gBAAI;IAAC,KAAK,EAAEW,gBAAI,CAACC;EAAO,EAAG,CACrB,eACT,6BAAC,gBAAI;IAAC,QAAQ;IAAC,SAAS,EAAE,IAAAN,eAAM,EAACC,0BAAK,CAACJ,KAAK,EAAER,QAAQ,IAAIY,0BAAK,CAACZ,QAAQ;EAAE,
|
|
1
|
+
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","styles","style","inputNumber","className","texts","ICON","REMOVE","ADD","displayName","propTypes","PropTypes","bool","oneOfType","string","array","number","isRequired","func"],"sources":["../../../src/components/InputNumber/InputNumber.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, ICON, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport style from './InputNumber.module.css';\n\nconst InputNumber = ({\n disabled,\n hint,\n label,\n max,\n min = 0,\n name,\n rounded = true,\n step = 1,\n value = 0,\n onChange = () => {},\n ...others\n}) => (\n <View {...others} row className={styles(style.inputNumber, others.className)}>\n <View className={style.texts}>\n {label && (\n <Text headline level={4} className={styles(style.label, disabled && style.disabled)}>\n {label}\n </Text>\n )}\n {hint && (\n <Text small className={styles(style.hint, disabled && style.disabled)}>\n {hint}\n </Text>\n )}\n </View>\n <Button\n disabled={disabled || value <= min}\n rounded={rounded}\n secondary\n squared\n onPress={() => onChange(value - step, name)}\n >\n <Icon value={ICON.REMOVE} />\n </Button>\n <Text headline tag=\"span\" className={styles(style.value, disabled && style.disabled)}>\n {typeof value === 'number' ? value : min}\n </Text>\n <Button\n disabled={disabled || value >= max}\n rounded={rounded}\n secondary\n squared\n onPress={() => onChange(value + step, name)}\n >\n <Icon value={ICON.ADD} />\n </Button>\n </View>\n);\n\nInputNumber.displayName = 'Component:InputOption';\n\nInputNumber.propTypes = {\n disabled: PropTypes.bool,\n hint: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n label: PropTypes.string,\n max: PropTypes.number,\n min: PropTypes.number,\n name: PropTypes.string.isRequired,\n rounded: PropTypes.bool,\n step: PropTypes.number,\n value: PropTypes.number,\n onChange: PropTypes.func,\n};\n\nexport { InputNumber };\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAA6C;AAAA;AAAA;AAAA;AAAA;AAE7C,IAAMA,WAAW,GAAG,SAAdA,WAAW;EAAA,IACfC,QAAQ,QAARA,QAAQ;IACRC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,GAAG,QAAHA,GAAG;IAAA,gBACHC,GAAG;IAAHA,GAAG,yBAAG,CAAC;IACPC,IAAI,Q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AQ;EAAE,GAClF,OAAOQ,KAAK,KAAK,QAAQ,GAAGA,KAAK,GAAGJ,GAAG,CACnC,eACP,6BAAC,cAAM;IACL,QAAQ,EAAEJ,QAAQ,IAAIQ,KAAK,IAAIL,GAAI;IACnC,OAAO,EAAEG,OAAQ;IACjB,SAAS;IACT,OAAO;IACP,OAAO,EAAE;MAAA,OAAMG,QAAQ,CAACD,KAAK,GAAGD,IAAI,EAAEF,IAAI,CAAC;IAAA;EAAC,gBAE5C,6BAAC,gBAAI;IAAC,KAAK,EAAEW,gBAAI,CAACE;EAAI,EAAG,CAClB,CACJ;AAAA,CACR;AAAC;AAEFnB,WAAW,CAACoB,WAAW,GAAG,uBAAuB;AAEjDpB,WAAW,CAACqB,SAAS,GAAG;EACtBpB,QAAQ,EAAEqB,kBAAS,CAACC,IAAI;EACxBrB,IAAI,EAAEoB,kBAAS,CAACE,SAAS,CAAC,CAACF,kBAAS,CAACG,MAAM,EAAEH,kBAAS,CAACI,KAAK,CAAC,CAAC;EAC9DvB,KAAK,EAAEmB,kBAAS,CAACG,MAAM;EACvBrB,GAAG,EAAEkB,kBAAS,CAACK,MAAM;EACrBtB,GAAG,EAAEiB,kBAAS,CAACK,MAAM;EACrBrB,IAAI,EAAEgB,kBAAS,CAACG,MAAM,CAACG,UAAU;EACjCrB,OAAO,EAAEe,kBAAS,CAACC,IAAI;EACvBf,IAAI,EAAEc,kBAAS,CAACK,MAAM;EACtBlB,KAAK,EAAEa,kBAAS,CAACK,MAAM;EACvBjB,QAAQ,EAAEY,kBAAS,CAACO;AACtB,CAAC"}
|
|
@@ -34,11 +34,11 @@ exports[`component:<InputNumber> inherit:className 1`] = `
|
|
|
34
34
|
</svg>
|
|
35
35
|
</span>
|
|
36
36
|
</button>
|
|
37
|
-
<
|
|
37
|
+
<span
|
|
38
38
|
class="text headline-3 value"
|
|
39
39
|
>
|
|
40
40
|
0
|
|
41
|
-
</
|
|
41
|
+
</span>
|
|
42
42
|
<button
|
|
43
43
|
class="pressable button rounded squared secondary"
|
|
44
44
|
>
|
|
@@ -102,11 +102,11 @@ exports[`component:<InputNumber> prop:disabled 1`] = `
|
|
|
102
102
|
</svg>
|
|
103
103
|
</span>
|
|
104
104
|
</button>
|
|
105
|
-
<
|
|
105
|
+
<span
|
|
106
106
|
class="text headline-3 value disabled"
|
|
107
107
|
>
|
|
108
108
|
0
|
|
109
|
-
</
|
|
109
|
+
</span>
|
|
110
110
|
<button
|
|
111
111
|
class="pressable disabled button rounded squared disabled"
|
|
112
112
|
disabled=""
|
|
@@ -177,11 +177,11 @@ exports[`component:<InputNumber> prop:hint 1`] = `
|
|
|
177
177
|
</svg>
|
|
178
178
|
</span>
|
|
179
179
|
</button>
|
|
180
|
-
<
|
|
180
|
+
<span
|
|
181
181
|
class="text headline-3 value"
|
|
182
182
|
>
|
|
183
183
|
0
|
|
184
|
-
</
|
|
184
|
+
</span>
|
|
185
185
|
<button
|
|
186
186
|
class="pressable button rounded squared secondary"
|
|
187
187
|
>
|
|
@@ -251,11 +251,11 @@ exports[`component:<InputNumber> prop:label 1`] = `
|
|
|
251
251
|
</svg>
|
|
252
252
|
</span>
|
|
253
253
|
</button>
|
|
254
|
-
<
|
|
254
|
+
<span
|
|
255
255
|
class="text headline-3 value"
|
|
256
256
|
>
|
|
257
257
|
0
|
|
258
|
-
</
|
|
258
|
+
</span>
|
|
259
259
|
<button
|
|
260
260
|
class="pressable button rounded squared secondary"
|
|
261
261
|
>
|
|
@@ -318,11 +318,11 @@ exports[`component:<InputNumber> prop:max 1`] = `
|
|
|
318
318
|
</svg>
|
|
319
319
|
</span>
|
|
320
320
|
</button>
|
|
321
|
-
<
|
|
321
|
+
<span
|
|
322
322
|
class="text headline-3 value"
|
|
323
323
|
>
|
|
324
324
|
10
|
|
325
|
-
</
|
|
325
|
+
</span>
|
|
326
326
|
<button
|
|
327
327
|
class="pressable disabled button rounded squared disabled"
|
|
328
328
|
disabled=""
|
|
@@ -387,11 +387,11 @@ exports[`component:<InputNumber> prop:min 1`] = `
|
|
|
387
387
|
</svg>
|
|
388
388
|
</span>
|
|
389
389
|
</button>
|
|
390
|
-
<
|
|
390
|
+
<span
|
|
391
391
|
class="text headline-3 value"
|
|
392
392
|
>
|
|
393
393
|
10
|
|
394
|
-
</
|
|
394
|
+
</span>
|
|
395
395
|
<button
|
|
396
396
|
class="pressable button rounded squared secondary"
|
|
397
397
|
>
|
|
@@ -454,11 +454,11 @@ exports[`component:<InputNumber> prop:rounded 1`] = `
|
|
|
454
454
|
</svg>
|
|
455
455
|
</span>
|
|
456
456
|
</button>
|
|
457
|
-
<
|
|
457
|
+
<span
|
|
458
458
|
class="text headline-3 value"
|
|
459
459
|
>
|
|
460
460
|
10
|
|
461
|
-
</
|
|
461
|
+
</span>
|
|
462
462
|
<button
|
|
463
463
|
class="pressable button rounded squared secondary"
|
|
464
464
|
>
|
|
@@ -521,11 +521,11 @@ exports[`component:<InputNumber> prop:value 1`] = `
|
|
|
521
521
|
</svg>
|
|
522
522
|
</span>
|
|
523
523
|
</button>
|
|
524
|
-
<
|
|
524
|
+
<span
|
|
525
525
|
class="text headline-3 value"
|
|
526
526
|
>
|
|
527
527
|
10
|
|
528
|
-
</
|
|
528
|
+
</span>
|
|
529
529
|
<button
|
|
530
530
|
class="pressable button rounded squared secondary"
|
|
531
531
|
>
|
|
@@ -589,11 +589,11 @@ exports[`component:<InputNumber> renders 1`] = `
|
|
|
589
589
|
</svg>
|
|
590
590
|
</span>
|
|
591
591
|
</button>
|
|
592
|
-
<
|
|
592
|
+
<span
|
|
593
593
|
class="text headline-3 value"
|
|
594
594
|
>
|
|
595
595
|
0
|
|
596
|
-
</
|
|
596
|
+
</span>
|
|
597
597
|
<button
|
|
598
598
|
class="pressable button rounded squared secondary"
|
|
599
599
|
>
|
|
@@ -658,11 +658,11 @@ exports[`component:<InputNumber> testID 1`] = `
|
|
|
658
658
|
</svg>
|
|
659
659
|
</span>
|
|
660
660
|
</button>
|
|
661
|
-
<
|
|
661
|
+
<span
|
|
662
662
|
class="text headline-3 value"
|
|
663
663
|
>
|
|
664
664
|
0
|
|
665
|
-
</
|
|
665
|
+
</span>
|
|
666
666
|
<button
|
|
667
667
|
class="pressable button rounded squared secondary"
|
|
668
668
|
>
|
|
@@ -64,7 +64,7 @@ var Modal = function Modal(_ref) {
|
|
|
64
64
|
} : _reactDom.default.createPortal;
|
|
65
65
|
var testId = others['data-testid'];
|
|
66
66
|
return renderer( /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
67
|
-
className: (0, _helpers.styles)(_ModalModule.default.container, overflow && _ModalModule.default.overflow, overflow && blur && _ModalModule.default.blur, visible && _ModalModule.default.visible),
|
|
67
|
+
className: (0, _helpers.styles)(_ModalModule.default.container, overflow && _ModalModule.default.overflow, overflow && blur && _ModalModule.default.blur, visible && _ModalModule.default.visible, onOverflow && _ModalModule.default.onOverflow),
|
|
68
68
|
onPress: visible && overflow ? onOverflow : undefined,
|
|
69
69
|
"data-testid": testId ? "".concat(testId, "-overflow") : undefined
|
|
70
70
|
}, /*#__PURE__*/_react.default.createElement(_primitives.View, _extends({}, others, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","names":["Modal","blur","children","fit","overflow","portal","title","visible","onBack","onClose","onOverflow","others","useDevice","isDesktop","useState","dataset","setDataset","useEffect","document","body","miraiModal","undefined","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","styles","style","container","modal","calcWidth","className","header","ICON","LEFT","icon","left","right","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({\n blur = false,\n children,\n fit = false,\n overflow = true,\n portal = false,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n\n const [dataset, setDataset] = useState();\n\n useEffect(() => {\n if (visible && !dataset) {\n setDataset(true);\n document.body.dataset.miraiModal = true;\n }\n\n return () => {\n if (visible && dataset) {\n setDataset(undefined);\n delete document.body.dataset.miraiModal;\n }\n };\n }, [dataset, visible]);\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <Pressable\n className={styles(\n style.container,\n overflow && style.overflow,\n overflow && blur && style.blur,\n visible && style.visible,\n )}\n onPress={visible && overflow ? onOverflow : undefined}\n data-testid={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable tag=\"button\" onPress={onBack} data-testid={testId ? `${testId}-button-back` : undefined}>\n <Icon value={ICON.LEFT} className={style.icon} />\n </Pressable>\n )}\n {title && (\n <Text headline className={styles(style.title, !onBack && style.left, !onClose && style.right)}>\n {title}\n </Text>\n )}\n {onClose && (\n <Pressable tag=\"button\" onPress={onClose} data-testid={testId ? `${testId}-button-close` : undefined}>\n <Icon value={isDesktop || title !== undefined ? ICON.CLOSE : ICON.EXPAND_MORE} className={style.icon} />\n </Pressable>\n )}\n </View>\n )}\n {children}\n </View>\n </Pressable>,\n document.body,\n );\n};\n\nModal.propTypes = {\n blur: PropTypes.bool,\n children: PropTypes.node,\n fit: PropTypes.bool,\n overflow: PropTypes.bool,\n portal: PropTypes.bool,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onBack: PropTypes.func,\n onClose: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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ACzB,QAAQ,EAC1BA,QAAQ,IAAIH,IAAI,IAAI4B,oBAAK,CAAC5B,IAAI,EAC9BM,OAAO,IAAIsB,oBAAK,CAACtB,OAAO,
|
|
1
|
+
{"version":3,"file":"Modal.js","names":["Modal","blur","children","fit","overflow","portal","title","visible","onBack","onClose","onOverflow","others","useDevice","isDesktop","useState","dataset","setDataset","useEffect","document","body","miraiModal","undefined","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","styles","style","container","modal","calcWidth","className","header","ICON","LEFT","icon","left","right","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({\n blur = false,\n children,\n fit = false,\n overflow = true,\n portal = false,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n\n const [dataset, setDataset] = useState();\n\n useEffect(() => {\n if (visible && !dataset) {\n setDataset(true);\n document.body.dataset.miraiModal = true;\n }\n\n return () => {\n if (visible && dataset) {\n setDataset(undefined);\n delete document.body.dataset.miraiModal;\n }\n };\n }, [dataset, visible]);\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <Pressable\n className={styles(\n style.container,\n overflow && style.overflow,\n overflow && blur && style.blur,\n visible && style.visible,\n onOverflow && style.onOverflow,\n )}\n onPress={visible && overflow ? onOverflow : undefined}\n data-testid={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable tag=\"button\" onPress={onBack} data-testid={testId ? `${testId}-button-back` : undefined}>\n <Icon value={ICON.LEFT} className={style.icon} />\n </Pressable>\n )}\n {title && (\n <Text headline className={styles(style.title, !onBack && style.left, !onClose && style.right)}>\n {title}\n </Text>\n )}\n {onClose && (\n <Pressable tag=\"button\" onPress={onClose} data-testid={testId ? `${testId}-button-close` : undefined}>\n <Icon value={isDesktop || title !== undefined ? ICON.CLOSE : ICON.EXPAND_MORE} className={style.icon} />\n </Pressable>\n )}\n </View>\n )}\n {children}\n </View>\n </Pressable>,\n document.body,\n );\n};\n\nModal.propTypes = {\n blur: PropTypes.bool,\n children: PropTypes.node,\n fit: PropTypes.bool,\n overflow: PropTypes.bool,\n portal: PropTypes.bool,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onBack: PropTypes.func,\n onClose: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,KAAK,GAAG,SAARA,KAAK,OAYL;EAAA,qBAXJC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IAAA,gBACRC,GAAG;IAAHA,GAAG,yBAAG,KAAK;IAAA,qBACXC,QAAQ;IAARA,QAAQ,8BAAG,IAAI;IAAA,mBACfC,MAAM;IAANA,MAAM,4BAAG,KAAK;IACdC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IACPC,MAAM,QAANA,MAAM;IACNC,OAAO,QAAPA,OAAO;IACPC,UAAU,QAAVA,UAAU;IACPC,MAAM;EAET,iBAAsB,IAAAC,gBAAS,GAAE;IAAzBC,SAAS,cAATA,SAAS;EAEjB,gBAA8B,IAAAC,eAAQ,GAAE;IAAA;IAAjCC,OAAO;IAAEC,UAAU;EAE1B,IAAAC,gBAAS,EAAC,YAAM;IAC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C,kBAAS,CAACC,IAAI;EACvBpC,MAAM,EAAEmC,kBAAS,CAACI,IAAI;EACtBtC,OAAO,EAAEkC,kBAAS,CAACI;AACrB,CAAC"}
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
opacity: 0;
|
|
66
66
|
transition: backdrop-filter var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing),
|
|
67
67
|
opacity var(--mirai-ui-motion-expand) var(--mirai-ui-motion-easing);
|
|
68
|
+
cursor: none;
|
|
68
69
|
}
|
|
69
70
|
|
|
70
71
|
.overflow.visible {
|
|
@@ -75,6 +76,10 @@
|
|
|
75
76
|
backdrop-filter: blur(4px);
|
|
76
77
|
}
|
|
77
78
|
|
|
79
|
+
.visible.onOverflow {
|
|
80
|
+
cursor: pointer;
|
|
81
|
+
}
|
|
82
|
+
|
|
78
83
|
/* S */
|
|
79
84
|
@media only screen and (max-width: 430px) {
|
|
80
85
|
.container {
|
|
@@ -69,7 +69,6 @@ var Story = function Story(props) {
|
|
|
69
69
|
headline: true
|
|
70
70
|
}, "Where does it come from?"), /*#__PURE__*/_react.default.createElement(_.Text, null, "Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32."), /*#__PURE__*/_react.default.createElement(_Modal.Modal, _extends({}, props, {
|
|
71
71
|
onClose: handleClose,
|
|
72
|
-
onOverflow: handleOverflow,
|
|
73
72
|
visible: visible
|
|
74
73
|
}), /*#__PURE__*/_react.default.createElement(_.View, {
|
|
75
74
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.stories.js","names":["title","Story","props","useState","visible","setVisible","visibleSecond","setVisibleSecond","handleBack","others","console","log","handleClose","handleOverflow","padding","storyName","args","blur","fit","overflow","portal","argTypes"],"sources":["../../../src/components/Modal/Modal.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button, Text, View } from '../../';\nimport { Modal } from './Modal';\n\nexport default {\n title: 'Components',\n};\n\nexport const Story = (props) => {\n const [visible, setVisible] = useState(true);\n const [visibleSecond, setVisibleSecond] = useState(false);\n\n const handleBack = (...others) => {\n console.log('<Modal>::onBack', ...others);\n setVisibleSecond(false);\n };\n\n const handleClose = (...others) => {\n console.log('<Modal>::onClose', ...others);\n setVisible(false);\n };\n\n const handleOverflow = (...others) => console.log('<Modal>::onOverflow', ...others);\n\n return (\n <>\n <Text bold headline>\n What is Lorem Ipsum?\n </Text>\n <Text>\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make\n a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,\n remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing\n Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions\n of Lorem Ipsum.\n </Text>\n\n <Button onPress={() => setVisible(true)}>Show modal</Button>\n\n <Text bold headline>\n Where does it come from?\n </Text>\n <Text>\n Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin\n literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney\n College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and\n going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum\n comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by\n Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.\n The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.\n </Text>\n\n <Modal {...props} onClose={handleClose}
|
|
1
|
+
{"version":3,"file":"Modal.stories.js","names":["title","Story","props","useState","visible","setVisible","visibleSecond","setVisibleSecond","handleBack","others","console","log","handleClose","handleOverflow","padding","storyName","args","blur","fit","overflow","portal","argTypes"],"sources":["../../../src/components/Modal/Modal.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button, Text, View } from '../../';\nimport { Modal } from './Modal';\n\nexport default {\n title: 'Components',\n};\n\nexport const Story = (props) => {\n const [visible, setVisible] = useState(true);\n const [visibleSecond, setVisibleSecond] = useState(false);\n\n const handleBack = (...others) => {\n console.log('<Modal>::onBack', ...others);\n setVisibleSecond(false);\n };\n\n const handleClose = (...others) => {\n console.log('<Modal>::onClose', ...others);\n setVisible(false);\n };\n\n const handleOverflow = (...others) => console.log('<Modal>::onOverflow', ...others);\n\n return (\n <>\n <Text bold headline>\n What is Lorem Ipsum?\n </Text>\n <Text>\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make\n a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,\n remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing\n Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions\n of Lorem Ipsum.\n </Text>\n\n <Button onPress={() => setVisible(true)}>Show modal</Button>\n\n <Text bold headline>\n Where does it come from?\n </Text>\n <Text>\n Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin\n literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney\n College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and\n going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum\n comes from sections 1.10.32 and 1.10.33 of \"de Finibus Bonorum et Malorum\" (The Extremes of Good and Evil) by\n Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance.\n The first line of Lorem Ipsum, \"Lorem ipsum dolor sit amet..\", comes from a line in section 1.10.32.\n </Text>\n\n <Modal {...props} onClose={handleClose} visible={visible}>\n <View style={{ padding: 'var(--mirai-ui-space-L)' }}>\n <Text>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi nemo adipisci consequatur et tenetur natus\n dolore, facere facilis placeat nostrum unde cumque. Voluptas enim rerum voluptatum, deserunt fugiat\n aspernatur excepturi.\n </Text>\n <Button onPress={() => setVisibleSecond(true)}>Show another Modal</Button>\n </View>\n </Modal>\n\n <Modal {...props} onBack={handleBack} onOverflow={handleOverflow} visible={visibleSecond}>\n <View style={{ padding: 'var(--mirai-ui-space-L)' }}>\n <Text>\n Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi nemo adipisci consequatur et tenetur natus\n dolore, facere facilis placeat nostrum unde cumque. Voluptas enim rerum voluptatum, deserunt fugiat\n aspernatur excepturi.\n </Text>\n </View>\n </Modal>\n </>\n );\n};\nStory.storyName = 'Modal';\n\nStory.args = {\n blur: false,\n fit: false,\n overflow: true,\n portal: false,\n title: 'title',\n // inherited properties\n ['data-testid']: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEjB;EACbA,KAAK,EAAE;AACT,CAAC;AAAA;AAEM,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK,EAAK;EAC9B,gBAA8B,IAAAC,eAAQ,EAAC,IAAI,CAAC;IAAA;IAArCC,OAAO;IAAEC,UAAU;EAC1B,iBAA0C,IAAAF,eAAQ,EAAC,KAAK,CAAC;IAAA;IAAlDG,aAAa;IAAEC,gBAAgB;EAEtC,IAAMC,UAAU,GAAG,SAAbA,UAA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AAC,KAAK,EAAE;MAAEQ,OAAO,EAAE;IAA0B;EAAE,gBAClD,6BAAC,MAAI,8OAIE,CACF,CACD,CACP;AAEP,CAAC;AAAC;AACFb,KAAK,CAACc,SAAS,GAAG,OAAO;AAEzBd,KAAK,CAACe,IAAI;EACRC,IAAI,EAAE,KAAK;EACXC,GAAG,EAAE,KAAK;EACVC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,KAAK;EACbpB,KAAK,EAAE;AAAO,gCAEb,aAAa,EAAG,YAAY,yCACtB,CAAC,CAAC,eACV;AAEDC,KAAK,CAACoB,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -190,7 +190,7 @@ exports[`component:<Modal> prop:onClose 1`] = `
|
|
|
190
190
|
exports[`component:<Modal> prop:onOverflow 1`] = `
|
|
191
191
|
<DocumentFragment>
|
|
192
192
|
<div
|
|
193
|
-
class="pressable container overflow visible"
|
|
193
|
+
class="pressable container overflow visible onOverflow"
|
|
194
194
|
data-testid="mirai-onOverflow-overflow"
|
|
195
195
|
>
|
|
196
196
|
<div
|
|
@@ -247,6 +247,18 @@ exports[`component:<Modal> prop:visible & prop:blur 1`] = `
|
|
|
247
247
|
</DocumentFragment>
|
|
248
248
|
`;
|
|
249
249
|
|
|
250
|
+
exports[`component:<Modal> prop:visible & prop:onOverflow 1`] = `
|
|
251
|
+
<DocumentFragment>
|
|
252
|
+
<div
|
|
253
|
+
class="pressable container overflow visible onOverflow"
|
|
254
|
+
>
|
|
255
|
+
<div
|
|
256
|
+
class="view fit modal calcWidth visible"
|
|
257
|
+
/>
|
|
258
|
+
</div>
|
|
259
|
+
</DocumentFragment>
|
|
260
|
+
`;
|
|
261
|
+
|
|
250
262
|
exports[`component:<Modal> prop:visible & prop:overflow (false) 1`] = `
|
|
251
263
|
<DocumentFragment>
|
|
252
264
|
<div
|
|
@@ -26,11 +26,10 @@ var Text = function Text(_ref) {
|
|
|
26
26
|
_ref$level = _ref.level,
|
|
27
27
|
level = _ref$level === void 0 ? 3 : _ref$level,
|
|
28
28
|
small = _ref.small,
|
|
29
|
-
|
|
30
|
-
tag = _ref$tag === void 0 ? 'span' : _ref$tag,
|
|
29
|
+
tag = _ref.tag,
|
|
31
30
|
upperCase = _ref.upperCase,
|
|
32
31
|
others = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
-
return /*#__PURE__*/_react.default.createElement(headline ? "h".concat(level) :
|
|
32
|
+
return /*#__PURE__*/_react.default.createElement(tag || (headline ? "h".concat(level) : 'span'), _objectSpread(_objectSpread({}, others), {}, {
|
|
34
33
|
className: (0, _helpers.styles)(_TextModule.default.text, bold && _TextModule.default.bold, headline ? _TextModule.default["headline-".concat(level)] : action ? _TextModule.default.action : small ? _TextModule.default.small : _TextModule.default.paragraph, upperCase && _TextModule.default.upperCase, others.className)
|
|
35
34
|
}), children);
|
|
36
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","names":["Text","action","bold","children","headline","level","small","tag","upperCase","others","React","createElement","className","styles","style","text","paragraph","displayName","propTypes","PropTypes","bool","oneOfType","string","number","array"],"sources":["../../../src/primitives/Text/Text.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Text.module.css';\n\nconst Text = ({ action, bold, children, headline, level = 3, small, tag
|
|
1
|
+
{"version":3,"file":"Text.js","names":["Text","action","bold","children","headline","level","small","tag","upperCase","others","React","createElement","className","styles","style","text","paragraph","displayName","propTypes","PropTypes","bool","oneOfType","string","number","array"],"sources":["../../../src/primitives/Text/Text.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport style from './Text.module.css';\n\nconst Text = ({ action, bold, children, headline, level = 3, small, tag, upperCase, ...others }) =>\n React.createElement(\n tag || (headline ? `h${level}` : 'span'),\n {\n ...others,\n className: styles(\n style.text,\n bold && style.bold,\n headline ? style[`headline-${level}`] : action ? style.action : small ? style.small : style.paragraph,\n upperCase && style.upperCase,\n others.className,\n ),\n },\n children,\n );\n\nText.displayName = 'Primitive:Text';\n\nText.propTypes = {\n action: PropTypes.bool,\n bold: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),\n headline: PropTypes.bool,\n level: PropTypes.number,\n small: PropTypes.bool,\n tag: PropTypes.string,\n upperCase: PropTypes.bool,\n};\n\nexport { Text };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AAAsC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEtC,IAAMA,IAAI,GAAG,SAAPA,IAAI;EAAA,IAAMC,MAAM,QAANA,MAAM;IAAEC,IAAI,QAAJA,IAAI;IAAEC,QAAQ,QAARA,QAAQ;IAAEC,QAAQ,QAARA,QAAQ;IAAA,kBAAEC,KAAK;IAALA,KAAK,2BAAG,CAAC;IAAEC,KAAK,QAALA,KAAK;IAAEC,GAAG,QAAHA,GAAG;IAAEC,SAAS,QAATA,SAAS;IAAKC,MAAM;EAAA,oBAC3FC,cAAK,CAACC,aAAa,CACjBJ,GAAG,KAAKH,QAAQ,cAAOC,KAAK,IAAK,MAAM,CAAC,kCAEnCI,MAAM;IACTG,SAAS,EAAE,IAAAC,eAAM,EACfC,mBAAK,CAACC,IAAI,EACVb,IAAI,IAAIY,mBAAK,CAACZ,IAAI,EAClBE,QAAQ,GAAGU,mBAAK,oBAAaT,KAAK,EAAG,GAAGJ,MAAM,GAAGa,mBAAK,CAACb,MAAM,GAAGK,KAAK,GAAGQ,mBAAK,CAACR,KAAK,GAAGQ,mBAAK,CAACE,SAAS,EACrGR,SAAS,IAAIM,mBAAK,CAACN,SAAS,EAC5BC,MAAM,CAACG,SAAS;EACjB,IAEHT,QAAQ,CACT;AAAA;AAAC;AAEJH,IAAI,CAACiB,WAAW,GAAG,gBAAgB;AAEnCjB,IAAI,CAACkB,SAAS,GAAG;EACfjB,MAAM,EAAEkB,kBAAS,CAACC,IAAI;EAC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