@mirai/ui 1.0.60 → 1.0.62
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/README.md +10 -3
- package/build/components/Calendar/Calendar.Month.js +2 -2
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/InputNumber/InputNumber.js +2 -2
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputOption/InputOption.js +1 -1
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputSelect/InputSelect.js +2 -2
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputText/InputText.js +4 -4
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.stories.js +6 -2
- package/build/components/InputText/InputText.stories.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +2 -2
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +2 -2
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/Menu.stories.js +2 -3
- package/build/components/Menu/Menu.stories.js.map +1 -1
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +0 -3
- package/build/components/Modal/Modal.js +2 -2
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Notification/Notification.js +5 -4
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.module.css +9 -0
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +11 -11
- package/build/components/Table/Table.Row.js +1 -1
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/helpers/getIconState.js +20 -0
- package/build/helpers/getIconState.js.map +1 -0
- package/build/helpers/index.js +4 -4
- package/build/helpers/index.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js +19 -27
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/Icon.js +5 -7
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/Icon.stories.js +31 -19
- package/build/primitives/Icon/Icon.stories.js.map +1 -1
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +348 -8
- package/build/primitives/Icon/index.js +3 -3
- package/build/primitives/Icon/index.js.map +1 -1
- package/build/theme/default.theme.css +23 -23
- package/package.json +1 -1
- package/build/helpers/getIconName.js +0 -18
- package/build/helpers/getIconName.js.map +0 -1
package/README.md
CHANGED
|
@@ -42,17 +42,24 @@ const MyComponent = () => (
|
|
|
42
42
|
|
|
43
43
|
This primitive returns a span with an icon based on a mandatory string prop `name`.
|
|
44
44
|
|
|
45
|
+
- `action:boolean` modifying font-size
|
|
46
|
+
- `headline:boolean` modifying font-size (default headline:3)
|
|
47
|
+
- `level:number` assign the level of heading (1, 2, 3 or 4)
|
|
48
|
+
- `paragraph:boolean` modifying font-size
|
|
49
|
+
- `small:boolean` modifying font-size
|
|
50
|
+
- `value:func` Enum value
|
|
51
|
+
|
|
45
52
|
```jsx
|
|
46
|
-
import { Icon, View } from '@mirai/ui';
|
|
53
|
+
import { Icon, ICON, View } from '@mirai/ui';
|
|
47
54
|
|
|
48
55
|
const MyComponent = () => (
|
|
49
56
|
<View>
|
|
50
|
-
<Icon
|
|
57
|
+
<Icon value={ICON.LEFT} />
|
|
51
58
|
</View>
|
|
52
59
|
);
|
|
53
60
|
```
|
|
54
61
|
|
|
55
|
-
> ℹ️ Current available
|
|
62
|
+
> ℹ️ Current available values: Left, Right, Up, Down, Check, Add, Remove, ExpandLess, ExpandMore, EyeOpen, EyeClose, Close, Error, Info, Success, Warning, List, Lock, Bed, Calendar, Person, Account.
|
|
56
63
|
|
|
57
64
|
### Input
|
|
58
65
|
|
|
@@ -74,7 +74,7 @@ var Month = function Month(_ref) {
|
|
|
74
74
|
onPress: onPrevious,
|
|
75
75
|
"data-testid": testID ? "".concat(testID, "-previous") : undefined
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
77
|
-
|
|
77
|
+
value: _primitives.ICON.LEFT
|
|
78
78
|
})), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
79
79
|
headline: true,
|
|
80
80
|
level: 4,
|
|
@@ -84,7 +84,7 @@ var Month = function Month(_ref) {
|
|
|
84
84
|
className: _CalendarModule.default.pressable,
|
|
85
85
|
"data-testid": testID ? "".concat(testID, "-next") : undefined
|
|
86
86
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
87
|
-
|
|
87
|
+
value: _primitives.ICON.RIGHT
|
|
88
88
|
}))), isDesktop && /*#__PURE__*/_react.default.createElement(_Calendar3.Weekdays, {
|
|
89
89
|
locale: locale
|
|
90
90
|
}), _Calendar.VISIBLE_WEEKS.map(function (week) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","to","onChange","onFocus","onNext","onPrevious","others","isDesktop","weekNumber","testID","style","month","className","header","undefined","title","pressable","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable onPress={onPrevious} data-testid={testID ? `${testID}-previous` : undefined}>\n <Icon
|
|
1
|
+
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","to","onChange","onFocus","onNext","onPrevious","others","isDesktop","weekNumber","testID","style","month","className","header","undefined","ICON","LEFT","title","pressable","RIGHT","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable onPress={onPrevious} data-testid={testID ? `${testID}-previous` : undefined}>\n <Icon value={ICON.LEFT} />\n </Pressable>\n )}\n <Text headline level={4} className={style.title}>\n {getHeader(instance, locale)}\n </Text>\n {onNext && (\n <Pressable onPress={onNext} className={style.pressable} data-testid={testID ? `${testID}-next` : undefined}>\n <Icon value={ICON.RIGHT} />\n </Pressable>\n )}\n </View>\n\n {isDesktop && <Weekdays locale={locale} />}\n\n {VISIBLE_WEEKS.map((week) => (\n <Week\n {...{\n ...others,\n disabledPast,\n focus,\n format,\n from,\n locale,\n to,\n range,\n selected,\n }}\n key={week}\n month={instance.getMonth()}\n number={weekNumber + week}\n year={instance.getFullYear()}\n onFocus={onFocus}\n onPress={onChange}\n />\n ))}\n </View>\n );\n};\n\nMonth.displayName = 'Component:Calendar:Month';\n\nMonth.propTypes = {\n captions: PropTypes.shape({}),\n focus: PropTypes.any,\n instance: PropTypes.any,\n selected: PropTypes.any,\n disabledDates: PropTypes.arrayOf(PropTypes.string),\n disabledPast: PropTypes.bool,\n format: PropTypes.string,\n from: PropTypes.instanceOf(Date),\n locale: PropTypes.string,\n range: PropTypes.bool,\n to: PropTypes.instanceOf(Date),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onNext: PropTypes.func,\n onPrevious: PropTypes.func,\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;AAEO,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAef;EAAA,IAdJC,KAcI,QAdJA,KAcI;EAAA,IAbJC,QAaI,QAbJA,QAaI;EAAA,IAZJC,QAYI,QAZJA,QAYI;EAAA,IAXJC,YAWI,QAXJA,YAWI;EAAA,IAVJC,MAUI,QAVJA,MAUI;EAAA,IATJC,IASI,QATJA,IASI;EAAA,IARJC,MAQI,QARJA,MAQI;EAAA,sBAPJC,KAOI;EAAA,IAPJA,KAOI,2BAPI,KAOJ;EAAA,IANJC,EAMI,QANJA,EAMI;EAAA,yBALJC,QAKI;EAAA,IALJA,QAKI,8BALO,YAAM,CAAE,CAKf;EAAA,wBAJJC,OAII;EAAA,IAJJA,OAII,6BAJM,YAAM,CAAE,CAId;EAAA,IAHJC,MAGI,QAHJA,MAGI;EAAA,IAFJC,UAEI,QAFJA,UAEI;EAAA,IADDC,MACC;;EACJ,iBAAsB,uBAAtB;EAAA,IAAQC,SAAR,cAAQA,SAAR;;EACA,IAAMC,UAAU,GAAG,6BAAcd,QA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AU,GAAGc,IAdvB;MAeE,IAAI,EAAE5B,QAAQ,CAAC8B,WAAT,EAfR;MAgBE,OAAO,EAAErB,OAhBX;MAiBE,OAAO,EAAED;IAjBX,GADiB;EAAA,CAAlB,CAnBH,CADF;AA2CD,CAhEM;;;AAkEPV,KAAK,CAACiC,WAAN,GAAoB,0BAApB;AAEAjC,KAAK,CAACkC,SAAN,GAAkB;EAChBC,QAAQ,EAAEC,mBAAUC,KAAV,CAAgB,EAAhB,CADM;EAEhBpC,KAAK,EAAEmC,mBAAUE,GAFD;EAGhBpC,QAAQ,EAAEkC,mBAAUE,GAHJ;EAIhBnC,QAAQ,EAAEiC,mBAAUE,GAJJ;EAKhBC,aAAa,EAAEH,mBAAUI,OAAV,CAAkBJ,mBAAUK,MAA5B,CALC;EAMhBrC,YAAY,EAAEgC,mBAAUM,IANR;EAOhBrC,MAAM,EAAE+B,mBAAUK,MAPF;EAQhBnC,IAAI,EAAE8B,mBAAUO,UAAV,CAAqBC,IAArB,CARU;EAShBrC,MAAM,EAAE6B,mBAAUK,MATF;EAUhBjC,KAAK,EAAE4B,mBAAUM,IAVD;EAWhBjC,EAAE,EAAE2B,mBAAUO,UAAV,CAAqBC,IAArB,CAXY;EAYhBC,KAAK,EAAET,mBAAUU,SAAV,CAAoB,CAACV,mBAAUK,MAAX,EAAmBL,mBAAUI,OAAV,CAAkBJ,mBAAUK,MAA5B,CAAnB,CAApB,CAZS;EAahB/B,QAAQ,EAAE0B,mBAAUW,IAbJ;EAchBpC,OAAO,EAAEyB,mBAAUW,IAdH;EAehBnC,MAAM,EAAEwB,mBAAUW,IAfF;EAgBhBlC,UAAU,EAAEuB,mBAAUW;AAhBN,CAAlB"}
|
|
@@ -67,7 +67,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
67
67
|
return onChange(value - step, name);
|
|
68
68
|
}
|
|
69
69
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
70
|
-
|
|
70
|
+
value: _primitives.ICON.REMOVE
|
|
71
71
|
})), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
72
72
|
headline: true,
|
|
73
73
|
className: _InputNumberModule.default.value
|
|
@@ -81,7 +81,7 @@ var InputNumber = function InputNumber(_ref) {
|
|
|
81
81
|
return onChange(value + step, name);
|
|
82
82
|
}
|
|
83
83
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
84
|
-
|
|
84
|
+
value: _primitives.ICON.ADD
|
|
85
85
|
})));
|
|
86
86
|
};
|
|
87
87
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","style","inputNumber","className","texts","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, Text, View } from '../../primitives';\nimport { Button } from '../Button';\nimport style from './InputNumber.module.css';\n\nexport const 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={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 preventDefault\n rounded={rounded}\n secondary\n squared\n onPress={() => onChange(value - step, name)}\n >\n <Icon
|
|
1
|
+
{"version":3,"file":"InputNumber.js","names":["InputNumber","disabled","hint","label","max","min","name","rounded","step","value","onChange","others","style","inputNumber","className","texts","ICON","REMOVE","ADD","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\nexport const 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={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 preventDefault\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={style.value}>\n {typeof value === 'number' ? value : min}\n </Text>\n <Button\n disabled={disabled || value >= max}\n preventDefault\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.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"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEO,IAAMA,WAAW,GAAG,SAAdA,WAAc;EAAA,IACzBC,QADyB,QACzBA,QADyB;EAAA,IAEzBC,IAFyB,QAEzBA,IAFyB;EAAA,IAGzBC,KAHyB,QAGzBA,KAHyB;EAAA,IAIzBC,GAJyB,QAIzBA,GAJyB;EAAA,oBAKzBC,GALyB;EAAA,IAKzBA,GALyB,yBAKnB,CALmB;EAAA,IAMzBC,IANyB,QAMzBA,IANyB;EAAA,wBAOzBC,OAPyB;EAAA,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QAAQ,IAAIQ,KAAK,IAAIL,GADjC;IAEE,cAAc,MAFhB;IAGE,OAAO,EAAEG,OAHX;IAIE,SAAS,MAJX;IAKE,OAAO,MALT;IAME,OAAO,EAAE;MAAA,OAAMG,QAAQ,CAACD,KAAK,GAAGD,IAAT,EAAeF,IAAf,CAAd;IAAA;EANX,gBAQE,6BAAC,gBAAD;IAAM,KAAK,EAAEU,iBAAKE;EAAlB,EARF,CA1BF,CAbyB;AAAA,CAApB;;;AAoDPlB,WAAW,CAACmB,SAAZ,GAAwB;EACtBlB,QAAQ,EAAEmB,mBAAUC,IADE;EAEtBnB,IAAI,EAAEkB,mBAAUE,SAAV,CAAoB,CAACF,mBAAUG,MAAX,EAAmBH,mBAAUI,KAA7B,CAApB,CAFgB;EAGtBrB,KAAK,EAAEiB,mBAAUG,MAHK;EAItBnB,GAAG,EAAEgB,mBAAUK,MAJO;EAKtBpB,GAAG,EAAEe,mBAAUK,MALO;EAMtBnB,IAAI,EAAEc,mBAAUG,MAAV,CAAiBG,UAND;EAOtBnB,OAAO,EAAEa,mBAAUC,IAPG;EAQtBb,IAAI,EAAEY,mBAAUK,MARM;EAStBhB,KAAK,EAAEW,mBAAUK,MATK;EAUtBf,QAAQ,EAAEU,mBAAUO;AAVE,CAAxB"}
|
|
@@ -59,7 +59,7 @@ var InputOption = function InputOption(_ref) {
|
|
|
59
59
|
type: type,
|
|
60
60
|
value: value
|
|
61
61
|
}, type === _InputOption.CHECKBOX && (checked || indeterminate) ? /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
62
|
-
|
|
62
|
+
value: checked ? _primitives.ICON.CHECK : _primitives.ICON.REMOVE,
|
|
63
63
|
className: _InputOptionModule.default.icon
|
|
64
64
|
}) : undefined), label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
65
65
|
className: (0, _helpers.styles)(_InputOptionModule.default.label, disabled && _InputOptionModule.default.disabled)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputOption.js","names":["InputOption","checked","disabled","indeterminate","label","name","reverse","type","CHECKBOX","value","onChange","others","Primitive","Checkbox","RADIO","Radio","Switch","handleChange","event","SWITCH","includes","style","inputOption","className","icon","undefined","displayName","propTypes","PropTypes","bool","string","isRequired","oneOf","func"],"sources":["../../../src/components/InputOption/InputOption.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Checkbox, Icon, Pressable, Radio, Switch, Text } from '../../primitives';\nimport { CHECKBOX, RADIO, SWITCH } from './InputOption.constants';\nimport style from './InputOption.module.css';\n\nconst InputOption = ({\n checked,\n disabled,\n indeterminate,\n label,\n name,\n reverse,\n type = CHECKBOX,\n value = '',\n onChange = () => {},\n ...others\n}) => {\n const Primitive = type === CHECKBOX ? Checkbox : type === RADIO ? Radio : Switch;\n\n const handleChange = (event) => {\n onChange([CHECKBOX, SWITCH].includes(type) ? !checked : value, event);\n };\n\n return (\n <Pressable\n {...others}\n type=\"button\"\n className={styles(style.inputOption, reverse && style.reverse, others.className)}\n onPress={handleChange}\n >\n <Primitive\n checked={checked || (type === CHECKBOX && indeterminate)}\n disabled={disabled}\n name={name}\n type={type}\n value={value}\n >\n {type === CHECKBOX && (checked || indeterminate) ? (\n <Icon
|
|
1
|
+
{"version":3,"file":"InputOption.js","names":["InputOption","checked","disabled","indeterminate","label","name","reverse","type","CHECKBOX","value","onChange","others","Primitive","Checkbox","RADIO","Radio","Switch","handleChange","event","SWITCH","includes","style","inputOption","className","ICON","CHECK","REMOVE","icon","undefined","displayName","propTypes","PropTypes","bool","string","isRequired","oneOf","func"],"sources":["../../../src/components/InputOption/InputOption.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Checkbox, Icon, ICON, Pressable, Radio, Switch, Text } from '../../primitives';\nimport { CHECKBOX, RADIO, SWITCH } from './InputOption.constants';\nimport style from './InputOption.module.css';\n\nconst InputOption = ({\n checked,\n disabled,\n indeterminate,\n label,\n name,\n reverse,\n type = CHECKBOX,\n value = '',\n onChange = () => {},\n ...others\n}) => {\n const Primitive = type === CHECKBOX ? Checkbox : type === RADIO ? Radio : Switch;\n\n const handleChange = (event) => {\n onChange([CHECKBOX, SWITCH].includes(type) ? !checked : value, event);\n };\n\n return (\n <Pressable\n {...others}\n type=\"button\"\n className={styles(style.inputOption, reverse && style.reverse, others.className)}\n onPress={handleChange}\n >\n <Primitive\n checked={checked || (type === CHECKBOX && indeterminate)}\n disabled={disabled}\n name={name}\n type={type}\n value={value}\n >\n {type === CHECKBOX && (checked || indeterminate) ? (\n <Icon value={checked ? ICON.CHECK : ICON.REMOVE} className={style.icon} />\n ) : undefined}\n </Primitive>\n {label && <Text className={styles(style.label, disabled && style.disabled)}>{label}</Text>}\n </Pressable>\n );\n};\n\nInputOption.displayName = 'Component:InputOption';\n\nInputOption.propTypes = {\n checked: PropTypes.bool,\n disabled: PropTypes.bool,\n indeterminate: PropTypes.bool,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n reverse: PropTypes.bool,\n type: PropTypes.oneOf([CHECKBOX, RADIO, SWITCH]),\n value: PropTypes.string,\n onChange: PropTypes.func,\n};\n\nexport { InputOption };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,OAWd;EAAA,IAVJC,OAUI,QAVJA,OAUI;EAAA,IATJC,QASI,QATJA,QASI;EAAA,IARJC,aAQI,QARJA,aAQI;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,IANJC,IAMI,QANJA,IAMI;EAAA,IALJC,OAKI,QALJA,OAKI;EAAA,qBAJJC,IAII;EAAA,IAJJA,IAII,0BAJGC,qBAIH;EAAA,sBAHJC,KAGI;EAAA,IAHJA,KAGI,2BAHI,EAGJ;EAAA,yBAFJC,QAEI;EAAA,IAFJA,QAEI,8BAFO,YAAM,CAAE,CAEf;EAA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,IADG;EAEtB9B,QAAQ,EAAE6B,mBAAUC,IAFE;EAGtB7B,aAAa,EAAE4B,mBAAUC,IAHH;EAItB5B,KAAK,EAAE2B,mBAAUE,MAJK;EAKtB5B,IAAI,EAAE0B,mBAAUE,MAAV,CAAiBC,UALD;EAMtB5B,OAAO,EAAEyB,mBAAUC,IANG;EAOtBzB,IAAI,EAAEwB,mBAAUI,KAAV,CAAgB,CAAC3B,qBAAD,EAAWM,kBAAX,EAAkBK,mBAAlB,CAAhB,CAPgB;EAQtBV,KAAK,EAAEsB,mBAAUE,MARK;EAStBvB,QAAQ,EAAEqB,mBAAUK;AATE,CAAxB"}
|
|
@@ -102,11 +102,11 @@ var InputSelect = function InputSelect(_ref) {
|
|
|
102
102
|
onEnter: handleEnter,
|
|
103
103
|
onLeave: handleLeave
|
|
104
104
|
})), !disabled && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
105
|
-
|
|
105
|
+
value: !focus && (error || success || warning) ? (0, _helpers.getIconState)({
|
|
106
106
|
error: error,
|
|
107
107
|
success: success,
|
|
108
108
|
warning: warning
|
|
109
|
-
}) :
|
|
109
|
+
}) : _primitives.ICON.EXPAND_MORE,
|
|
110
110
|
className: (0, _helpers.styles)(_InputTextModule.default.icon, _InputTextModule.default.right, error ? _InputTextModule.default.error : warning ? _InputTextModule.default.warning : success ? _InputTextModule.default.success : undefined)
|
|
111
111
|
})), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
112
112
|
small: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputSelect.js","names":["InputSelect","disabled","error","hint","label","success","warning","onChange","onEnter","onLeave","others","focus","setFocus","handleChange","value","event","target","blur","handleEnter","handleLeave","has","undefined","length","style","inputContainer","className","text","inputBorder","input","iconRight","empty","icon","right","displayName","propTypes","PropTypes","bool","string","name","isRequired","func"],"sources":["../../../src/components/InputSelect/InputSelect.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"InputSelect.js","names":["InputSelect","disabled","error","hint","label","success","warning","onChange","onEnter","onLeave","others","focus","setFocus","handleChange","value","event","target","blur","handleEnter","handleLeave","has","undefined","length","style","inputContainer","className","text","inputBorder","input","iconRight","empty","ICON","EXPAND_MORE","icon","right","displayName","propTypes","PropTypes","bool","string","name","isRequired","func"],"sources":["../../../src/components/InputSelect/InputSelect.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { Icon, ICON, Select, Text, View } from '../../primitives';\nimport style from '../InputText/InputText.module.css';\n\nconst InputSelect = ({\n disabled,\n error,\n hint,\n label,\n success,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n event.target?.blur();\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 has = {\n value: others.value !== undefined && others.value?.length > 0,\n };\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 error && style.error,\n focus && style.focus,\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 focus && !error && style.focus,\n error && style.error,\n )}\n >\n <Select\n {...others}\n disabled={disabled}\n value={others.value || ''}\n className={styles(style.input, style.iconRight, !!label && !(focus || error || has.value) && style.empty)}\n style={undefined}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n />\n {!disabled && (\n <Icon\n value={\n !focus && (error || success || warning) ? getIconState({ error, success, warning }) : ICON.EXPAND_MORE\n }\n className={styles(\n style.icon,\n style.right,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\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\nInputSelect.displayName = 'Component:InputSelect';\n\nInputSelect.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n label: PropTypes.string,\n name: PropTypes.string.isRequired,\n success: PropTypes.bool,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputSelect };\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAMA,WAAW,GAAG,SAAdA,WAAc,OAWd;EAAA;;EAAA,IAVJC,QAUI,QAVJA,QAUI;EAAA,IATJC,KASI,QATJA,KASI;EAAA,IARJC,IAQI,QARJA,IAQI;EAAA,IAPJC,KAOI,QAPJA,KAOI;EAAA,IANJC,OAMI,QANJA,OAMI;EAAA,IALJC,OAKI,QALJA,OAKI;EAAA,yBAJJC,QAII;EAAA,IAJJA,QAII,8BAJO,YAAM,CAAE,CAIf;EAAA,wBAHJC,OAGI;EAAA,IAHJA,OAGI,6BAHM,YAAM,CAAE,CAGd;EAAA,wBAFJC,OAEI;EAAA,IAFJA,OAEI,6BAFM,YAAM,CAAE,CAEd;EAAA,IADDC,MACC;;EACJ,gBAA0B,qBAAS,KAAT,CAA1B;EAAA;EAAA,IAAOC,KAAP;EAAA,IAAcC,QAAd;;EAEA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CAACC,KAAD,EAAQC,KAAR,EAAkB;IAAA;;IACrCR,QAAQ,CAACO,KAAD,EAAQC,KAAR,CAAR;IACA,iBAAAA,KAAK,CAACC,MAAN,gEAAcC,IAAd;EACD,CAHD;;EAKA,IAAMC,WAAW,GAAG,SAAdA,WAAc,CAACH,KAAD,EAAW;IAC7BH,QAAQ,CAAC,IAAD,CAAR;I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/B,QAAQ,EAAE8B,mBAAUK,IARE;EAStBlC,OAAO,EAAE6B,mBAAUK,IATG;EAUtBjC,OAAO,EAAE4B,mBAAUK;AAVG,CAAxB"}
|
|
@@ -104,7 +104,7 @@ var InputText = function InputText(_ref) {
|
|
|
104
104
|
row: true,
|
|
105
105
|
className: (0, _helpers.styles)(_InputTextModule.default.inputBorder, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error, focus && !error && _InputTextModule.default.focus)
|
|
106
106
|
}, icon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
107
|
-
|
|
107
|
+
value: icon,
|
|
108
108
|
className: (0, _helpers.styles)(_InputTextModule.default.icon, _InputTextModule.default.left, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
|
|
109
109
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Input, _extends({}, others, {
|
|
110
110
|
disabled: disabled,
|
|
@@ -116,7 +116,7 @@ var InputText = function InputText(_ref) {
|
|
|
116
116
|
onEnter: handleEnter,
|
|
117
117
|
onLeave: handleLeave
|
|
118
118
|
})), has.stateIcon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
119
|
-
|
|
119
|
+
value: (0, _helpers.getIconState)({
|
|
120
120
|
error: error,
|
|
121
121
|
success: success,
|
|
122
122
|
warning: warning
|
|
@@ -130,7 +130,7 @@ var InputText = function InputText(_ref) {
|
|
|
130
130
|
return setPassword(!password);
|
|
131
131
|
}
|
|
132
132
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
133
|
-
|
|
133
|
+
value: password ? _primitives.ICON.EYE_CLOSE : _primitives.ICON.EYE_OPEN
|
|
134
134
|
}))), hint && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
135
135
|
small: true,
|
|
136
136
|
className: (0, _helpers.styles)(_InputTextModule.default.text, _InputTextModule.default.hint, disabled && _InputTextModule.default.disabled, error && _InputTextModule.default.error)
|
|
@@ -143,7 +143,7 @@ InputText.propTypes = {
|
|
|
143
143
|
disabled: _propTypes.default.bool,
|
|
144
144
|
error: _propTypes.default.bool,
|
|
145
145
|
hint: _propTypes.default.string,
|
|
146
|
-
icon: _propTypes.default.
|
|
146
|
+
icon: _propTypes.default.func,
|
|
147
147
|
label: _propTypes.default.string,
|
|
148
148
|
multiLine: _propTypes.default.bool,
|
|
149
149
|
name: _propTypes.default.string.isRequired,
|
|
@@ -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","displayName","propTypes","PropTypes","bool","string","multiLine","name","isRequired"
|
|
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;;A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EAA2DC,KAAK,IAAI0B,yBAAM1B,KAA1E;EAAvB,GACGC,IADH,CA9DJ,CADF;AAqED,CA3GD;;;AA6GAH,SAAS,CAAC0C,WAAV,GAAwB,qBAAxB;AAEA1C,SAAS,CAAC2C,SAAV,GAAsB;EACpB1C,QAAQ,EAAE2C,mBAAUC,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"}
|
|
@@ -29,13 +29,17 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
29
29
|
|
|
30
30
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
31
31
|
|
|
32
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
|
+
|
|
32
34
|
var _default = {
|
|
33
35
|
title: 'Components'
|
|
34
36
|
};
|
|
35
37
|
exports.default = _default;
|
|
36
38
|
|
|
37
39
|
var Story = function Story(props) {
|
|
38
|
-
return /*#__PURE__*/React.createElement(_InputText.InputText, props
|
|
40
|
+
return /*#__PURE__*/React.createElement(_InputText.InputText, _extends({}, props, {
|
|
41
|
+
icon: _primitives.ICON[props.icon]
|
|
42
|
+
}));
|
|
39
43
|
};
|
|
40
44
|
|
|
41
45
|
exports.Story = Story;
|
|
@@ -83,7 +87,7 @@ Story.args = {
|
|
|
83
87
|
};
|
|
84
88
|
Story.argTypes = {
|
|
85
89
|
icon: {
|
|
86
|
-
options: [undefined].concat(_toConsumableArray(Object.keys(_primitives.
|
|
90
|
+
options: [undefined].concat(_toConsumableArray(Object.keys(_primitives.ICON))),
|
|
87
91
|
control: {
|
|
88
92
|
type: 'select'
|
|
89
93
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.stories.js","names":["title","Story","props","storyName","args","disabled","error","hint","
|
|
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};\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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Gf,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"}
|
|
@@ -41,7 +41,7 @@ var Option = function Option(_ref) {
|
|
|
41
41
|
className: (0, _helpers.styles)(_MenuModule.default.option, value && _MenuModule.default.value, divider && _MenuModule.default.divider, disabled && _MenuModule.default.disabled),
|
|
42
42
|
onPress: !disabled && value ? onPress : undefined
|
|
43
43
|
}), icon && /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
44
|
-
|
|
44
|
+
value: icon,
|
|
45
45
|
className: _MenuModule.default.icon
|
|
46
46
|
}), label && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
47
47
|
className: _MenuModule.default.label
|
|
@@ -54,7 +54,7 @@ Option.propTypes = {
|
|
|
54
54
|
children: _propTypes.default.node,
|
|
55
55
|
disabled: _propTypes.default.bool,
|
|
56
56
|
divider: _propTypes.default.bool,
|
|
57
|
-
icon: _propTypes.default.
|
|
57
|
+
icon: _propTypes.default.func,
|
|
58
58
|
label: _propTypes.default.string,
|
|
59
59
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
60
60
|
onPress: _propTypes.default.func
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.Option.js","names":["Option","children","disabled","divider","icon","label","value","onPress","others","style","option","undefined","displayName","propTypes","PropTypes","node","bool","string","oneOfType","number"
|
|
1
|
+
{"version":3,"file":"Menu.Option.js","names":["Option","children","disabled","divider","icon","label","value","onPress","others","style","option","undefined","displayName","propTypes","PropTypes","node","bool","func","string","oneOfType","number"],"sources":["../../../src/components/Menu/Menu.Option.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Icon, Pressable, Text } from '../../primitives';\nimport style from './Menu.module.css';\n\nconst Option = ({ children, disabled, divider, icon, label, value, onPress, ...others }) => (\n <Pressable\n {...others}\n preventDefault={false}\n tag=\"div\"\n className={styles(style.option, value && style.value, divider && style.divider, disabled && style.disabled)}\n onPress={!disabled && value ? onPress : undefined}\n >\n {icon && <Icon value={icon} className={style.icon} />}\n {label && <Text className={style.label}>{label}</Text>}\n {children}\n </Pressable>\n);\n\nOption.displayName = 'Component:Menu:Option';\n\nOption.propTypes = {\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 onPress: PropTypes.func,\n};\n\nexport { Option };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,IAAGC,QAAH,QAAGA,QAAH;EAAA,IAAaC,QAAb,QAAaA,QAAb;EAAA,IAAuBC,OAAvB,QAAuBA,OAAvB;EAAA,IAAgCC,IAAhC,QAAgCA,IAAhC;EAAA,IAAsCC,KAAtC,QAAsCA,KAAtC;EAAA,IAA6CC,KAA7C,QAA6CA,KAA7C;EAAA,IAAoDC,OAApD,QAAoDA,OAApD;EAAA,IAAgEC,MAAhE;;EAAA,oBACb,6BAAC,qBAAD,eACMA,MADN;IAEE,cAAc,EAAE,KAFlB;IAGE,GAAG,EAAC,KAHN;IAIE,SAAS,EAAE,qBAAOC,oBAAMC,MAAb,EAAqBJ,KAAK,IAAIG,oBAAMH,KAApC,EAA2CH,OAAO,IAAIM,oBAAMN,OAA5D,EAAqED,QAAQ,IAAIO,oBAAMP,QAAvF,CAJb;IAKE,OAAO,EAAE,CAACA,QAAD,IAAaI,KAAb,GAAqBC,OAArB,GAA+BI;EAL1C,IAOGP,IAAI,iBAAI,6BAAC,gBAAD;IAAM,KAAK,EAAEA,IAAb;IAAmB,SAAS,EAAEK,oBAAML;EAApC,EAPX,EAQGC,KAAK,iBAAI,6BAAC,gBAAD;IAAM,SAAS,EAAEI,oBAAMJ;EAAvB,GAA+BA,KAA/B,CARZ,EASGJ,QATH,CADa;AAAA,CAAf;;;AAcAD,MAAM,CAACY,WAAP,GAAqB,uBAArB;AAEAZ,MAAM,CAACa,SAAP,GAAmB;EACjBZ,QAAQ,EAAEa,mBAAUC,IADH;EAEjBb,QAAQ,EAAEY,mBAAUE,IAFH;EAGjBb,OAAO,EAAEW,mBAAUE,IAHF;EAIjBZ,IAAI,EAAEU,mBAAUG,IAJC;EAKjBZ,KAAK,EAAES,mBAAUI,MALA;EAMjBZ,KAAK,EAAEQ,mBAAUK,SAAV,CAAoB,CAACL,mBAAUI,MAAX,EAAmBJ,mBAAUM,MAA7B,CAApB,CANU;EAOjBb,OAAO,EAAEO,mBAAUG;AAPF,CAAnB"}
|
|
@@ -64,9 +64,9 @@ Menu.propTypes = {
|
|
|
64
64
|
children: _propTypes.default.node,
|
|
65
65
|
disabled: _propTypes.default.bool,
|
|
66
66
|
divider: _propTypes.default.bool,
|
|
67
|
-
icon: _propTypes.default.
|
|
67
|
+
icon: _propTypes.default.func,
|
|
68
68
|
label: _propTypes.default.string,
|
|
69
|
-
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
69
|
+
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number])
|
|
70
70
|
})),
|
|
71
71
|
Template: _propTypes.default.node,
|
|
72
72
|
visible: _propTypes.default.bool,
|
|
@@ -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","
|
|
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 {...option}\n data-testid={others['data-testid'] ? `${others['data-testid']}-${index}` : undefined}\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,wBAAp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AEc,mBAAUK,IAbJ;EAcflB,OAAO,EAAEa,mBAAUQ;AAdJ,CAAjB"}
|
|
@@ -42,16 +42,15 @@ Story.args = {
|
|
|
42
42
|
label: 'Lorem Ipsum is simply dummy text...',
|
|
43
43
|
divider: true
|
|
44
44
|
}, {
|
|
45
|
-
icon:
|
|
45
|
+
icon: _primitives.ICON.ADD,
|
|
46
46
|
label: 'Item 1',
|
|
47
47
|
value: 'one'
|
|
48
48
|
}, {
|
|
49
|
-
icon:
|
|
49
|
+
icon: _primitives.ICON.ADD,
|
|
50
50
|
label: 'Item 2',
|
|
51
51
|
disabled: true,
|
|
52
52
|
value: 'two'
|
|
53
53
|
}, {
|
|
54
|
-
icon: 'Empty',
|
|
55
54
|
label: 'Item 3',
|
|
56
55
|
divider: true,
|
|
57
56
|
value: 'three'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.stories.js","names":["title","Story","props","storyName","args","options","children","divider","label","icon","value","disabled","visible","argTypes","onPress","action"],"sources":["../../../src/components/Menu/Menu.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from '../';\nimport { 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:
|
|
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' },\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};\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,GAAa;EACXC,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,EAWP;IAAEE,IAAI,EAAEC,iBAAKC,GAAb;IAAkBH,KAAK,EAAE,QAAzB;IAAmCI,KAAK,EAAE;EAA1C,CAXO,EAYP;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,CADE;EAwBXQ,OAAO,EAAE;AAxBE,CAAb;AA2BAb,KAAK,CAACc,QAAN,GAAiB;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAV;AADM,CAAjB"}
|
|
@@ -61,7 +61,7 @@ var Modal = function Modal(_ref) {
|
|
|
61
61
|
onPress: onBack,
|
|
62
62
|
"data-testid": testId ? "".concat(testId, "-button-back") : undefined
|
|
63
63
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
64
|
-
|
|
64
|
+
value: _primitives.ICON.LEFT,
|
|
65
65
|
className: _ModalModule.default.icon
|
|
66
66
|
})), title && /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
67
67
|
headline: true,
|
|
@@ -70,7 +70,7 @@ var Modal = function Modal(_ref) {
|
|
|
70
70
|
onPress: onClose,
|
|
71
71
|
"data-testid": testId ? "".concat(testId, "-button-close") : undefined
|
|
72
72
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
73
|
-
|
|
73
|
+
value: isDesktop || title !== undefined ? _primitives.ICON.CLOSE : _primitives.ICON.EXPAND_MORE,
|
|
74
74
|
className: _ModalModule.default.icon
|
|
75
75
|
}))), children)), document.body);
|
|
76
76
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","names":["Modal","children","overflow","portal","title","visible","onBack","onClose","others","isDesktop","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","style","container","modal","className","header","undefined","icon","left","right","document","body","propTypes","PropTypes","node","bool","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport style from './Modal.module.css';\n\nconst Modal = ({ children, overflow = true, portal = false, title, visible, onBack, onClose, ...others }) => {\n const { isDesktop } = useDevice();\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <View row className={styles(style.container, overflow && style.overflow, visible && style.visible)}>\n <View {...others} fit className={styles(style.modal, visible && style.visible, others.className)}>\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable onPress={onBack} data-testid={testId ? `${testId}-button-back` : undefined}>\n <Icon
|
|
1
|
+
{"version":3,"file":"Modal.js","names":["Modal","children","overflow","portal","title","visible","onBack","onClose","others","isDesktop","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","style","container","modal","className","header","undefined","ICON","LEFT","icon","left","right","CLOSE","EXPAND_MORE","document","body","propTypes","PropTypes","node","bool","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React 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 = ({ children, overflow = true, portal = false, title, visible, onBack, onClose, ...others }) => {\n const { isDesktop } = useDevice();\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { ['data-testid']: testId } = others;\n\n return renderer(\n <View row className={styles(style.container, overflow && style.overflow, visible && style.visible)}>\n <View {...others} fit className={styles(style.modal, visible && style.visible, others.className)}>\n {(title || onBack || onClose) && (\n <View row className={style.header}>\n {onBack && (\n <Pressable 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 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 </View>,\n document.body,\n );\n};\n\nModal.propTypes = {\n children: PropTypes.node,\n portal: PropTypes.bool,\n overflow: 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;;;;;;;;;;;;AAEA,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAA+F;EAAA,IAA5FC,QAA4F,QAA5FA,QAA4F;EAAA,yBAAlFC,QAAkF;EAAA,IAAlFA,QAAkF,8BAAvE,IAAuE;EAAA,uBAAjEC,MAAiE;EAAA,IAAjEA,MAAiE,4BAAxD,KAAwD;EAAA,IAAjDC,KAAiD,QAAjDA,KAAiD;EAAA,IAA1CC,OAA0C,QAA1CA,OAA0C;EAAA,IAAjCC,MAAiC,QAAjCA,MAAiC;EAAA,IAAzBC,OAAyB,QAAzBA,OAAyB;EAAA,IAAbC,MAAa;;EAC3G,iBAAsB,uBAAtB;EAAA,IAAQC,SAAR,cAAQA,SAAR;;EAEA,IAAMC,QAAQ,GAAGC,oBAAW,CAACR,MAAZ,GAAqB,UAACS,GAAD;IAAA,OAASA,GAAT;EAAA,CAArB,GAAoCC,kBAASC,YAA9D;EAEA,IAAyBC,MAAzB,GAAoCP,MAApC,CAAS,aAAT;EAEA,OAAOE,QAAQ,eACb,6BAAC,gBAAD;IAAM,GAAG,MAAT;IAAU,SAAS,EAAE,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AE+B,mBAAUC,IADJ;EAEhB9B,MAAM,EAAE6B,mBAAUE,IAFF;EAGhBhC,QAAQ,EAAE8B,mBAAUE,IAHJ;EAIhB9B,KAAK,EAAE4B,mBAAUG,MAJD;EAKhB9B,OAAO,EAAE2B,mBAAUE,IALH;EAMhB5B,MAAM,EAAE0B,mBAAUI,IANF;EAOhB7B,OAAO,EAAEyB,mBAAUI;AAPH,CAAlB"}
|
|
@@ -40,20 +40,21 @@ var Notification = function Notification(_ref) {
|
|
|
40
40
|
row: true,
|
|
41
41
|
className: (0, _helpers.styles)(_NotificationModule.default.notification, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : undefined, inline ? _NotificationModule.default.inline : _NotificationModule.default.outlined, inline && _NotificationModule.default.inline, small && _NotificationModule.default.small, others.className)
|
|
42
42
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
43
|
-
|
|
43
|
+
value: (0, _helpers.getIconState)({
|
|
44
44
|
error: error,
|
|
45
45
|
success: success,
|
|
46
46
|
warning: warning
|
|
47
47
|
}),
|
|
48
|
-
paragraph: small
|
|
48
|
+
paragraph: small,
|
|
49
|
+
className: (0, _helpers.styles)(_NotificationModule.default.icon, small && _NotificationModule.default.small)
|
|
49
50
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
50
51
|
small: small,
|
|
51
52
|
className: (0, _helpers.styles)(_NotificationModule.default.text, error ? _NotificationModule.default.error : warning ? _NotificationModule.default.warning : success ? _NotificationModule.default.success : undefined)
|
|
52
53
|
}, children), onClose && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
53
|
-
className: _NotificationModule.default.pressable,
|
|
54
|
+
className: (0, _helpers.styles)(_NotificationModule.default.pressable, _NotificationModule.default.icon, small && _NotificationModule.default.small),
|
|
54
55
|
onPress: onClose
|
|
55
56
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
56
|
-
|
|
57
|
+
value: _primitives.ICON.CLOSE,
|
|
57
58
|
paragraph: small
|
|
58
59
|
})));
|
|
59
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","names":["Notification","children","error","inline","small","success","warning","onClose","others","style","notification","undefined","outlined","className","text","pressable","displayName","propTypes","PropTypes","string","isRequired","bool","func"],"sources":["../../../src/components/Notification/Notification.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport {
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["Notification","children","error","inline","small","success","warning","onClose","others","style","notification","undefined","outlined","className","icon","text","pressable","ICON","CLOSE","displayName","propTypes","PropTypes","string","isRequired","bool","func"],"sources":["../../../src/components/Notification/Notification.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { getIconState, styles } from '../../helpers';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\nimport style from './Notification.module.css';\n\nconst Notification = ({ children, error, inline = false, small, success, warning, onClose, ...others }) => (\n <View\n {...others}\n row\n className={styles(\n style.notification,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n inline ? style.inline : style.outlined,\n inline && style.inline,\n small && style.small,\n others.className,\n )}\n >\n <Icon\n value={getIconState({ error, success, warning })}\n paragraph={small}\n className={styles(style.icon, small && style.small)}\n />\n <Text\n small={small}\n className={styles(\n style.text,\n error ? style.error : warning ? style.warning : success ? style.success : undefined,\n )}\n >\n {children}\n </Text>\n {onClose && (\n <Pressable className={styles(style.pressable, style.icon, small && style.small)} onPress={onClose}>\n <Icon value={ICON.CLOSE} paragraph={small} />\n </Pressable>\n )}\n </View>\n);\n\nNotification.displayName = 'Component:Notification';\n\nNotification.propTypes = {\n children: PropTypes.string.isRequired,\n error: PropTypes.bool,\n inline: PropTypes.bool,\n small: PropTypes.bool,\n success: PropTypes.bool,\n warning: PropTypes.bool,\n onClose: PropTypes.func,\n};\n\nexport { Notification };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AAC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,qBAAD;IAAW,SAAS,EAAE,qBAAOE,4BAAMO,SAAb,EAAwBP,4BAAMK,IAA9B,EAAoCV,KAAK,IAAIK,4BAAML,KAAnD,CAAtB;IAAiF,OAAO,EAAEG;EAA1F,gBACE,6BAAC,gBAAD;IAAM,KAAK,EAAEU,iBAAKC,KAAlB;IAAyB,SAAS,EAAEd;EAApC,EADF,CA3BJ,CADmB;AAAA,CAArB;;;AAmCAJ,YAAY,CAACmB,WAAb,GAA2B,wBAA3B;AAEAnB,YAAY,CAACoB,SAAb,GAAyB;EACvBnB,QAAQ,EAAEoB,mBAAUC,MAAV,CAAiBC,UADJ;EAEvBrB,KAAK,EAAEmB,mBAAUG,IAFM;EAGvBrB,MAAM,EAAEkB,mBAAUG,IAHK;EAIvBpB,KAAK,EAAEiB,mBAAUG,IAJM;EAKvBnB,OAAO,EAAEgB,mBAAUG,IALI;EAMvBlB,OAAO,EAAEe,mBAAUG,IANI;EAOvBjB,OAAO,EAAEc,mBAAUI;AAPI,CAAzB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.notification {
|
|
2
2
|
width: fit-content;
|
|
3
|
+
align-items: flex-start;
|
|
3
4
|
}
|
|
4
5
|
|
|
5
6
|
.notification.outlined {
|
|
@@ -71,3 +72,11 @@
|
|
|
71
72
|
.outlined .text.warning {
|
|
72
73
|
color: var(--mirai-ui-warning-dark);
|
|
73
74
|
}
|
|
75
|
+
|
|
76
|
+
.notification .icon {
|
|
77
|
+
margin-top: calc(calc(var(--mirai-ui-line-height-headline-3) - var(--mirai-ui-font-size-headline-3)) / 2);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.notification .icon.small {
|
|
81
|
+
margin-top: calc(calc(var(--mirai-ui-line-height-small) - var(--mirai-ui-font-size-paragraph)) / 2);
|
|
82
|
+
}
|