@mirai/ui 1.0.200 → 1.0.202
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/Action/Action.js +6 -5
- package/build/components/Action/Action.js.map +1 -1
- package/build/components/Action/Action.stories.js +4 -2
- package/build/components/Action/Action.stories.js.map +1 -1
- package/build/components/Action/index.js.map +1 -1
- package/build/components/Button/Button.js +6 -5
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/Button.stories.js +9 -8
- package/build/components/Button/Button.stories.js.map +1 -1
- package/build/components/Button/index.js.map +1 -1
- package/build/components/Calendar/Calendar.Month.js +13 -12
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.Week.js +16 -15
- package/build/components/Calendar/Calendar.Week.js.map +1 -1
- package/build/components/Calendar/Calendar.Weekdays.js +8 -7
- package/build/components/Calendar/Calendar.Weekdays.js.map +1 -1
- package/build/components/Calendar/Calendar.constants.js +4 -2
- package/build/components/Calendar/Calendar.constants.js.map +1 -1
- package/build/components/Calendar/Calendar.js +21 -20
- package/build/components/Calendar/Calendar.js.map +1 -1
- package/build/components/Calendar/Calendar.stories.js +7 -5
- package/build/components/Calendar/Calendar.stories.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfMonth.js +2 -1
- package/build/components/Calendar/helpers/getFirstDateOfMonth.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDateOfWeek.js +2 -1
- package/build/components/Calendar/helpers/getFirstDateOfWeek.js.map +1 -1
- package/build/components/Calendar/helpers/getFirstDayOfWeek.js +2 -1
- package/build/components/Calendar/helpers/getFirstDayOfWeek.js.map +1 -1
- package/build/components/Calendar/helpers/getHeader.js +2 -1
- package/build/components/Calendar/helpers/getHeader.js.map +1 -1
- package/build/components/Calendar/helpers/getScrollTo.js +4 -3
- package/build/components/Calendar/helpers/getScrollTo.js.map +1 -1
- package/build/components/Calendar/helpers/getToday.js +2 -1
- package/build/components/Calendar/helpers/getToday.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekDays.js +2 -1
- package/build/components/Calendar/helpers/getWeekDays.js.map +1 -1
- package/build/components/Calendar/helpers/getWeekNumber.js +2 -1
- package/build/components/Calendar/helpers/getWeekNumber.js.map +1 -1
- package/build/components/Calendar/helpers/index.js.map +1 -1
- package/build/components/Calendar/index.js.map +1 -1
- package/build/components/Form/Form.constants.js +8 -4
- package/build/components/Form/Form.constants.js.map +1 -1
- package/build/components/Form/Form.js +11 -10
- package/build/components/Form/Form.js.map +1 -1
- package/build/components/Form/Form.stories.js +9 -7
- package/build/components/Form/Form.stories.js.map +1 -1
- package/build/components/Form/helpers/getChildrenErrors.js +6 -5
- package/build/components/Form/helpers/getChildrenErrors.js.map +1 -1
- package/build/components/Form/helpers/getChildrenValues.js +3 -2
- package/build/components/Form/helpers/getChildrenValues.js.map +1 -1
- package/build/components/Form/helpers/getField.js +2 -1
- package/build/components/Form/helpers/getField.js.map +1 -1
- package/build/components/Form/helpers/groupState.js +2 -1
- package/build/components/Form/helpers/groupState.js.map +1 -1
- package/build/components/Form/helpers/index.js.map +1 -1
- package/build/components/Form/index.js.map +1 -1
- package/build/components/InputDate/InputDate.js +9 -8
- package/build/components/InputDate/InputDate.js.map +1 -1
- package/build/components/InputDate/InputDate.stories.js +7 -5
- package/build/components/InputDate/InputDate.stories.js.map +1 -1
- package/build/components/InputDate/helpers/formatValue.js +2 -1
- package/build/components/InputDate/helpers/formatValue.js.map +1 -1
- package/build/components/InputDate/helpers/index.js.map +1 -1
- package/build/components/InputDate/index.js.map +1 -1
- package/build/components/InputNumber/InputNumber.js +3 -2
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/InputNumber.stories.js +7 -5
- package/build/components/InputNumber/InputNumber.stories.js.map +1 -1
- package/build/components/InputNumber/index.js.map +1 -1
- package/build/components/InputOption/InputOption.constants.js +6 -3
- package/build/components/InputOption/InputOption.constants.js.map +1 -1
- package/build/components/InputOption/InputOption.js +4 -3
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/InputOption.stories.js +7 -5
- package/build/components/InputOption/InputOption.stories.js.map +1 -1
- package/build/components/InputOption/index.js.map +1 -1
- package/build/components/InputPhone/InputPhone.js +17 -16
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/InputPhone.stories.js +7 -5
- package/build/components/InputPhone/InputPhone.stories.js.map +1 -1
- package/build/components/InputPhone/helpers/index.js.map +1 -1
- package/build/components/InputPhone/helpers/parseValue.js +4 -3
- package/build/components/InputPhone/helpers/parseValue.js.map +1 -1
- package/build/components/InputPhone/index.js.map +1 -1
- package/build/components/InputSelect/InputSelect.js +5 -4
- package/build/components/InputSelect/InputSelect.js.map +1 -1
- package/build/components/InputSelect/InputSelect.stories.js +7 -5
- package/build/components/InputSelect/InputSelect.stories.js.map +1 -1
- package/build/components/InputSelect/index.js.map +1 -1
- package/build/components/InputText/InputText.js +9 -8
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.stories.js +7 -6
- package/build/components/InputText/InputText.stories.js.map +1 -1
- package/build/components/InputText/index.js.map +1 -1
- package/build/components/InputText/partials/InputText.Hint.js +2 -1
- package/build/components/InputText/partials/InputText.Hint.js.map +1 -1
- package/build/components/InputText/partials/InputText.IconState.js +2 -1
- package/build/components/InputText/partials/InputText.IconState.js.map +1 -1
- package/build/components/InputText/partials/InputText.Label.js +2 -1
- package/build/components/InputText/partials/InputText.Label.js.map +1 -1
- package/build/components/InputText/partials/index.js.map +1 -1
- package/build/components/Menu/Menu.Option.js +3 -2
- package/build/components/Menu/Menu.Option.js.map +1 -1
- package/build/components/Menu/Menu.js +4 -3
- package/build/components/Menu/Menu.js.map +1 -1
- package/build/components/Menu/Menu.stories.js +7 -5
- package/build/components/Menu/Menu.stories.js.map +1 -1
- package/build/components/Menu/index.js.map +1 -1
- package/build/components/Modal/Modal.js +6 -5
- package/build/components/Modal/Modal.js.map +1 -1
- package/build/components/Modal/Modal.module.css +1 -0
- package/build/components/Modal/Modal.stories.js +7 -5
- package/build/components/Modal/Modal.stories.js.map +1 -1
- package/build/components/Modal/index.js.map +1 -1
- package/build/components/Notification/Notification.js +3 -2
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.stories.js +4 -2
- package/build/components/Notification/Notification.stories.js.map +1 -1
- package/build/components/Notification/index.js.map +1 -1
- package/build/components/Progress/Progress.js +3 -2
- package/build/components/Progress/Progress.js.map +1 -1
- package/build/components/Progress/Progress.stories.js +4 -2
- package/build/components/Progress/Progress.stories.js.map +1 -1
- package/build/components/Progress/index.js.map +1 -1
- package/build/components/Slider/Slider.constants.js +2 -1
- package/build/components/Slider/Slider.constants.js.map +1 -1
- package/build/components/Slider/Slider.js +16 -15
- package/build/components/Slider/Slider.js.map +1 -1
- package/build/components/Slider/Slider.stories.js +4 -2
- package/build/components/Slider/Slider.stories.js.map +1 -1
- package/build/components/Slider/helpers/getMotionExpand.js +2 -1
- package/build/components/Slider/helpers/getMotionExpand.js.map +1 -1
- package/build/components/Slider/helpers/index.js.map +1 -1
- package/build/components/Slider/index.js.map +1 -1
- package/build/components/Table/Table.ColumnFilter.js +19 -18
- package/build/components/Table/Table.ColumnFilter.js.map +1 -1
- package/build/components/Table/Table.Filter.js +3 -2
- package/build/components/Table/Table.Filter.js.map +1 -1
- package/build/components/Table/Table.Row.js +11 -10
- package/build/components/Table/Table.Row.js.map +1 -1
- package/build/components/Table/Table.constants.js +4 -2
- package/build/components/Table/Table.constants.js.map +1 -1
- package/build/components/Table/Table.js +18 -17
- package/build/components/Table/Table.js.map +1 -1
- package/build/components/Table/Table.stories.js +7 -5
- package/build/components/Table/Table.stories.js.map +1 -1
- package/build/components/Table/helpers/exists.js +5 -4
- package/build/components/Table/helpers/exists.js.map +1 -1
- package/build/components/Table/helpers/index.js.map +1 -1
- package/build/components/Table/helpers/select.js +6 -5
- package/build/components/Table/helpers/select.js.map +1 -1
- package/build/components/Table/helpers/storage.js +2 -1
- package/build/components/Table/helpers/storage.js.map +1 -1
- package/build/components/Table/index.js.map +1 -1
- package/build/components/Tooltip/Tooltip.js +14 -13
- package/build/components/Tooltip/Tooltip.js.map +1 -1
- package/build/components/Tooltip/Tooltip.stories.js +4 -2
- package/build/components/Tooltip/Tooltip.stories.js.map +1 -1
- package/build/components/Tooltip/helpers/index.js.map +1 -1
- package/build/components/Tooltip/helpers/isPressableInstance.js +5 -4
- package/build/components/Tooltip/helpers/isPressableInstance.js.map +1 -1
- package/build/components/Tooltip/index.js.map +1 -1
- package/build/components/index.js.map +1 -1
- package/build/helpers/getIconState.js +2 -1
- package/build/helpers/getIconState.js.map +1 -1
- package/build/helpers/getInputDateErrors.js +2 -1
- package/build/helpers/getInputDateErrors.js.map +1 -1
- package/build/helpers/getInputErrors.js +5 -4
- package/build/helpers/getInputErrors.js.map +1 -1
- package/build/helpers/getInputPhoneErrors.js +2 -1
- package/build/helpers/getInputPhoneErrors.js.map +1 -1
- package/build/helpers/index.js.map +1 -1
- package/build/helpers/isJest.js +2 -1
- package/build/helpers/isJest.js.map +1 -1
- package/build/helpers/isValidDate.js +4 -3
- package/build/helpers/isValidDate.js.map +1 -1
- package/build/helpers/isValidEmail.js +2 -1
- package/build/helpers/isValidEmail.js.map +1 -1
- package/build/helpers/isValidPhone.js +2 -1
- package/build/helpers/isValidPhone.js.map +1 -1
- package/build/helpers/styles.js +2 -1
- package/build/helpers/styles.js.map +1 -1
- package/build/hooks/helpers/getNavigator.js +2 -1
- package/build/hooks/helpers/getNavigator.js.map +1 -1
- package/build/hooks/helpers/getResolution.js +2 -1
- package/build/hooks/helpers/getResolution.js.map +1 -1
- package/build/hooks/helpers/index.js.map +1 -1
- package/build/hooks/helpers/sanitizePx.js +2 -1
- package/build/hooks/helpers/sanitizePx.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/useDevice.js +8 -7
- package/build/hooks/useDevice.js.map +1 -1
- package/build/hooks/useDevice.stories.js +6 -4
- package/build/hooks/useDevice.stories.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.js +3 -2
- package/build/primitives/Checkbox/Checkbox.js.map +1 -1
- package/build/primitives/Checkbox/Checkbox.stories.js +7 -5
- package/build/primitives/Checkbox/Checkbox.stories.js.map +1 -1
- package/build/primitives/Checkbox/index.js.map +1 -1
- package/build/primitives/Icon/Icon.constants.js +2 -1
- package/build/primitives/Icon/Icon.constants.js.map +1 -1
- package/build/primitives/Icon/Icon.js +6 -5
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/Icon.stories.js +4 -3
- package/build/primitives/Icon/Icon.stories.js.map +1 -1
- package/build/primitives/Icon/index.js.map +1 -1
- package/build/primitives/Input/Input.js +12 -11
- package/build/primitives/Input/Input.js.map +1 -1
- package/build/primitives/Input/Input.stories.js +7 -5
- package/build/primitives/Input/Input.stories.js.map +1 -1
- package/build/primitives/Input/helpers/index.js.map +1 -1
- package/build/primitives/Input/helpers/parseValue.js +2 -1
- package/build/primitives/Input/helpers/parseValue.js.map +1 -1
- package/build/primitives/Input/index.js.map +1 -1
- package/build/primitives/Layer/Layer.js +19 -18
- package/build/primitives/Layer/Layer.js.map +1 -1
- package/build/primitives/Layer/Layer.stories.js +4 -2
- package/build/primitives/Layer/Layer.stories.js.map +1 -1
- package/build/primitives/Layer/LayerContent.js +2 -1
- package/build/primitives/Layer/LayerContent.js.map +1 -1
- package/build/primitives/Layer/helpers/getElementLayout.js +2 -1
- package/build/primitives/Layer/helpers/getElementLayout.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js +5 -4
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/build/primitives/Layer/helpers/getScrollParent.js +2 -1
- package/build/primitives/Layer/helpers/getScrollParent.js.map +1 -1
- package/build/primitives/Layer/helpers/index.js.map +1 -1
- package/build/primitives/Layer/index.js.map +1 -1
- package/build/primitives/Pressable/Pressable.constants.js +2 -1
- package/build/primitives/Pressable/Pressable.constants.js.map +1 -1
- package/build/primitives/Pressable/Pressable.js +7 -6
- package/build/primitives/Pressable/Pressable.js.map +1 -1
- package/build/primitives/Pressable/Pressable.stories.js +4 -2
- package/build/primitives/Pressable/Pressable.stories.js.map +1 -1
- package/build/primitives/Pressable/index.js.map +1 -1
- package/build/primitives/Primitive/Primitive.constants.js +4 -2
- package/build/primitives/Primitive/Primitive.constants.js.map +1 -1
- package/build/primitives/Primitive/Primitive.js +5 -4
- package/build/primitives/Primitive/Primitive.js.map +1 -1
- package/build/primitives/Primitive/Primitive.stories.js +4 -2
- package/build/primitives/Primitive/Primitive.stories.js.map +1 -1
- package/build/primitives/Primitive/helpers/getProps.js +4 -3
- package/build/primitives/Primitive/helpers/getProps.js.map +1 -1
- package/build/primitives/Primitive/helpers/index.js.map +1 -1
- package/build/primitives/Primitive/index.js.map +1 -1
- package/build/primitives/Radio/Radio.js +3 -2
- package/build/primitives/Radio/Radio.js.map +1 -1
- package/build/primitives/Radio/Radio.stories.js +7 -5
- package/build/primitives/Radio/Radio.stories.js.map +1 -1
- package/build/primitives/Radio/index.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.js +14 -13
- package/build/primitives/ScrollView/ScrollView.js.map +1 -1
- package/build/primitives/ScrollView/ScrollView.stories.js +8 -6
- package/build/primitives/ScrollView/ScrollView.stories.js.map +1 -1
- package/build/primitives/ScrollView/index.js.map +1 -1
- package/build/primitives/Select/Select.js +6 -5
- package/build/primitives/Select/Select.js.map +1 -1
- package/build/primitives/Select/Select.stories.js +7 -5
- package/build/primitives/Select/Select.stories.js.map +1 -1
- package/build/primitives/Select/index.js.map +1 -1
- package/build/primitives/Switch/Switch.js +3 -2
- package/build/primitives/Switch/Switch.js.map +1 -1
- package/build/primitives/Switch/Switch.stories.js +7 -5
- package/build/primitives/Switch/Switch.stories.js.map +1 -1
- package/build/primitives/Switch/index.js.map +1 -1
- package/build/primitives/Text/Text.js +10 -9
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.stories.js +4 -2
- package/build/primitives/Text/Text.stories.js.map +1 -1
- package/build/primitives/Text/helpers/index.js.map +1 -1
- package/build/primitives/Text/helpers/parseMarkdown.js +7 -6
- package/build/primitives/Text/helpers/parseMarkdown.js.map +1 -1
- package/build/primitives/Text/index.js.map +1 -1
- package/build/primitives/View/View.js +6 -5
- package/build/primitives/View/View.js.map +1 -1
- package/build/primitives/View/View.stories.js +4 -2
- package/build/primitives/View/View.stories.js.map +1 -1
- package/build/primitives/View/index.js.map +1 -1
- package/build/primitives/index.js.map +1 -1
- package/build/theme/helpers/camelcase.js +2 -1
- package/build/theme/helpers/camelcase.js.map +1 -1
- package/build/theme/helpers/colorShade.js +2 -1
- package/build/theme/helpers/colorShade.js.map +1 -1
- package/build/theme/helpers/index.js.map +1 -1
- package/build/theme/index.js.map +1 -1
- package/build/theme/theme.constants.js +11 -6
- package/build/theme/theme.constants.js.map +1 -1
- package/build/theme/theme.js +4 -3
- package/build/theme/theme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.stories.js","names":["
|
|
1
|
+
{"version":3,"file":"Menu.stories.js","names":["title","Story","props","useState","visible","setVisible","handlePress","value","others","console","log","storyName","args","options","children","divider","undefined","label","icon","ICON","ADD","testId","disabled","style","argTypes"],"sources":["../../../src/components/Menu/Menu.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { Button } from '../';\nimport { Action, ICON, Text } from '../..';\nimport { Menu } from './Menu';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [visible, setVisible] = useState(false);\n\n const handlePress = (value, ...others) => {\n console.log('<Menu>::onPress', value, ...others);\n if (!value) setVisible(false);\n };\n\n return (\n <Menu {...props} visible={visible} onPress={handlePress}>\n <Action onPress={() => setVisible(!visible)}>\n <span className=\"children\">children</span>\n </Action>\n </Menu>\n );\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 undefined,\n { label: 'Lorem Ipsum is simply dummy text...', divider: true },\n undefined,\n undefined,\n { icon: ICON.ADD, label: 'Item 1', value: 'one', testId: 'custom-test' },\n { icon: ICON.ADD, label: 'Item 2', disabled: true, value: 'two' },\n { label: 'Item 3', divider: true, value: 'three' },\n { label: 'Item 4', children: <Button small>Add</Button>, value: 'four' },\n {\n children: (\n <Button secondary wide>\n Logout\n </Button>\n ),\n },\n ],\n title: 'title',\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AACA;AAA8B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAEf;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK,EAAK;EAC9B,gBAA8B,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAAtCC,OAAO;IAAEC,UAAU;EAE1B,IAAMC,WAAW,GAAG,SAAdA,WAAW,CAAIC,KAAK,EAAgB;IAAA;IAAA,kCAAXC,MAAM;MAANA,MAAM;IAAA;IACnC,YAAAC,OAAO,EAACC,GAAG,kBAAC,iBAAiB,EAAEH,KAAK,SAAKC,MAAM,EAAC;IAChD,IAAI,CAACD,KAAK,EAAEF,UAAU,CAAC,KAAK,CAAC;EAC/B,CAAC;EAED,oBACE,6BAAC,UAAI,eAAKH,KAAK;IAAE,OAAO,EAAEE,OAAQ;IAAC,OAAO,EAAEE;EAAY,iBACtD,6BAAC,SAAM;IAAC,OAAO,EAAE;MAAA,OAAMD,UAAU,CAAC,CAACD,OAAO,CAAC;IAAA;EAAC,gBAC1C;IAAM,SAAS,EAAC;EAAU,cAAgB,CACnC,CACJ;AAEX,CAAC;AAAC;AAEFH,KAAK,CAACU,SAAS,GAAG,MAAM;AAExBV,KAAK,CAACW,IAAI,GAAG;EACXC,OAAO,EAAE,CACP;IACEC,QAAQ,eACN,yEACE,6BAAC,OAAI;MAAC,IAAI;IAAA,WAAa,eACvB,6BAAC,OAAI,wCAAqC,CAE7C;IACDC,OAAO,EAAE;EACX,CAAC,EACDC,SAAS,EACT;IAAEC,KAAK,EAAE,qCAAqC;IAAEF,OAAO,EAAE;EAAK,CAAC,EAC/DC,SAAS,EACTA,SAAS,EACT;IAAEE,IAAI,EAAEC,OAAI,CAACC,GAAG;IAAEH,KAAK,EAAE,QAAQ;IAAEV,KAAK,EAAE,KAAK;IAAEc,MAAM,EAAE;EAAc,CAAC,EACxE;IAAEH,IAAI,EAAEC,OAAI,CAACC,GAAG;IAAEH,KAAK,EAAE,QAAQ;IAAEK,QAAQ,EAAE,IAAI;IAAEf,KAAK,EAAE;EAAM,CAAC,EACjE;IAAEU,KAAK,EAAE,QAAQ;IAAEF,OAAO,EAAE,IAAI;IAAER,KAAK,EAAE;EAAQ,CAAC,EAClD;IAAEU,KAAK,EAAE,QAAQ;IAAEH,QAAQ,eAAE,6BAAC,QAAM;MAAC,KAAK;IAAA,SAAa;IAAEP,KAAK,EAAE;EAAO,CAAC,EACxE;IACEO,QAAQ,eACN,6BAAC,QAAM;MAAC,SAAS;MAAC,IAAI;IAAA;EAI1B,CAAC,CACF;EACDd,KAAK,EAAE,OAAO;EACd;EACAqB,MAAM,EAAE,YAAY;EACpBE,KAAK,EAAE,CAAC;AACV,CAAC;AAEDtB,KAAK,CAACuB,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Menu/index.js"],"sourcesContent":["export * from './Menu';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -8,11 +8,11 @@ exports.Modal = void 0;
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
11
|
-
var _ModalModule = _interopRequireDefault(require("./Modal.module.css"));
|
|
12
11
|
var _components = require("../../components");
|
|
13
12
|
var _helpers = require("../../helpers");
|
|
14
13
|
var _hooks = require("../../hooks");
|
|
15
14
|
var _primitives = require("../../primitives");
|
|
15
|
+
var _ModalModule = _interopRequireDefault(require("./Modal.module.css"));
|
|
16
16
|
var _excluded = ["blur", "children", "fit", "overflow", "portal", "preventDefault", "title", "visible", "onBack", "onClose", "onOverflow"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -21,12 +21,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
21
21
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
22
22
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
23
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
24
|
-
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; }
|
|
25
|
-
function _iterableToArrayLimit(
|
|
24
|
+
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; }
|
|
25
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
27
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
28
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
var Modal =
|
|
29
|
+
var Modal = function Modal(_ref) {
|
|
30
30
|
var _ref$blur = _ref.blur,
|
|
31
31
|
blur = _ref$blur === void 0 ? false : _ref$blur,
|
|
32
32
|
children = _ref.children,
|
|
@@ -114,6 +114,7 @@ var Modal = exports.Modal = function Modal(_ref) {
|
|
|
114
114
|
className: _ModalModule.default.icon
|
|
115
115
|
}))), children)), document.body);
|
|
116
116
|
};
|
|
117
|
+
exports.Modal = Modal;
|
|
117
118
|
Modal.propTypes = {
|
|
118
119
|
blur: _propTypes.default.bool,
|
|
119
120
|
children: _propTypes.default.node,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.js","names":["_propTypes","_interopRequireDefault","require","_react","_interopRequireWildcard","_reactDom","_ModalModule","_components","_helpers","_hooks","_primitives","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","r","l","t","Symbol","iterator","e","u","a","f","next","done","push","value","return","isArray","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","sourceKeys","keys","Modal","exports","_ref","_ref$blur","blur","children","_ref$fit","fit","_ref$overflow","overflow","_ref$portal","portal","_ref$preventDefault","preventDefault","title","visible","onBack","onClose","onOverflow","others","_useDevice","useDevice","isDesktop","height","ref","useRef","_useState","useState","_useState2","dataset","setDataset","useEffect","document","body","miraiModal","undefined","handleOverflow","event","_ref$current","current","contains","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","createElement","Pressable","role","concat","onPress","className","styles","style","container","View","modal","calcWidth","forceRow","header","Button","transparent","small","squared","Icon","ICON","LEFT","icon","Text","headline","left","right","button","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport style from './Modal.module.css';\nimport { Button } from '../../components';\nimport { IS_JEST, styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, ICON, Pressable, Text, View } from '../../primitives';\n\nconst Modal = ({\n blur = false,\n children,\n fit = false,\n overflow = true,\n portal = false,\n preventDefault = true,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop, height } = useDevice();\n const ref = useRef();\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 handleOverflow = (event) => {\n const { target } = event;\n onOverflow && !ref.current?.contains(target) && onOverflow(event);\n };\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { testId } = others;\n\n return renderer(\n <Pressable\n preventDefault={preventDefault}\n role={others.role ? `${others.role}-overflow` : 'modal-overflow'}\n onPress={visible && overflow ? handleOverflow : undefined}\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 style={{ height }}\n testId={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n ref={ref}\n role={others.role || 'modal'}\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View forceRow className={style.header}>\n {onBack && (\n <Button transparent small squared onPress={onBack} testId={testId ? `${testId}-button-back` : undefined}>\n <Icon value={ICON.LEFT} className={style.icon} />\n </Button>\n )}\n {title && (\n <Text headline className={styles(style.title, !onBack && style.left, !onClose && style.right)}>\n {title}\n </Text>\n )}\n {onClose && (\n <Button\n transparent\n small\n squared\n onPress={onClose}\n testId={testId ? `${testId}-button-close` : undefined}\n className={style.button}\n >\n <Icon value={isDesktop || title !== undefined ? ICON.CLOSE : ICON.EXPAND_MORE} className={style.icon} />\n </Button>\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 preventDefault: PropTypes.bool,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onBack: PropTypes.func,\n onClose: PropTypes.func,\n onOverflow: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,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,MAAA,CAAAiB,OAAA,CAAAmH,aAAA,CAAChI,WAAA,CAAA8I,MAAM;IACLC,WAAW;IACXC,KAAK;IACLC,OAAO;IACPb,OAAO,EAAElC,OAAQ;IACjB6B,MAAM,EAAEA,MAAM,MAAAI,MAAA,CAAMJ,MAAM,qBAAkBX,SAAU;IACtDiB,SAAS,EAAEE,oBAAK,CAACmB;EAAO,gBAExB9J,MAAA,CAAAiB,OAAA,CAAAmH,aAAA,CAAC7H,WAAA,CAAA+I,IAAI;IAAC7E,KAAK,EAAEkC,SAAS,IAAIR,KAAK,KAAKqB,SAAS,GAAG+B,gBAAI,CAACQ,KAAK,GAAGR,gBAAI,CAACS,WAAY;IAACvB,SAAS,EAAEE,oBAAK,CAACc;EAAK,CAAE,CACjG,CAEN,CACP,EACA/D,QACG,CACG,CAAC,EACZ2B,QAAQ,CAACC,IACX,CAAC;AACH,CAAC;AAEDjC,KAAK,CAAC4E,SAAS,GAAG;EAChBxE,IAAI,EAAEyE,kBAAS,CAACC,IAAI;EACpBzE,QAAQ,EAAEwE,kBAAS,CAACE,IAAI;EACxBxE,GAAG,EAAEsE,kBAAS,CAACC,IAAI;EACnBrE,QAAQ,EAAEoE,kBAAS,CAACC,IAAI;EACxBnE,MAAM,EAAEkE,kBAAS,CAACC,IAAI;EACtBjE,cAAc,EAAEgE,kBAAS,CAACC,IAAI;EAC9BhE,KAAK,EAAE+D,kBAAS,CAACG,MAAM;EACvBjE,OAAO,EAAE8D,kBAAS,CAACC,IAAI;EACvB9D,MAAM,EAAE6D,kBAAS,CAACI,IAAI;EACtBhE,OAAO,EAAE4D,kBAAS,CAACI,IAAI;EACvB/D,UAAU,EAAE2D,kBAAS,CAACI;AACxB,CAAC"}
|
|
1
|
+
{"version":3,"file":"Modal.js","names":["Modal","blur","children","fit","overflow","portal","preventDefault","title","visible","onBack","onClose","onOverflow","others","useDevice","isDesktop","height","ref","useRef","useState","dataset","setDataset","useEffect","document","body","miraiModal","undefined","handleOverflow","event","target","current","contains","renderer","IS_JEST","jsx","ReactDOM","createPortal","testId","role","styles","style","container","modal","calcWidth","className","header","ICON","LEFT","icon","left","right","button","CLOSE","EXPAND_MORE","propTypes","PropTypes","bool","node","string","func"],"sources":["../../../src/components/Modal/Modal.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport { Button } from '../../components';\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 preventDefault = true,\n title,\n visible,\n onBack,\n onClose,\n onOverflow,\n ...others\n}) => {\n const { isDesktop, height } = useDevice();\n const ref = useRef();\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 handleOverflow = (event) => {\n const { target } = event;\n onOverflow && !ref.current?.contains(target) && onOverflow(event);\n };\n\n const renderer = IS_JEST || !portal ? (jsx) => jsx : ReactDOM.createPortal;\n\n const { testId } = others;\n\n return renderer(\n <Pressable\n preventDefault={preventDefault}\n role={others.role ? `${others.role}-overflow` : 'modal-overflow'}\n onPress={visible && overflow ? handleOverflow : undefined}\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 style={{ height }}\n testId={testId ? `${testId}-overflow` : undefined}\n >\n <View\n {...others}\n fit\n ref={ref}\n role={others.role || 'modal'}\n className={styles(style.modal, !fit && style.calcWidth, visible && style.visible, others.className)}\n >\n {(title || onBack || onClose) && (\n <View forceRow className={style.header}>\n {onBack && (\n <Button transparent small squared onPress={onBack} testId={testId ? `${testId}-button-back` : undefined}>\n <Icon value={ICON.LEFT} className={style.icon} />\n </Button>\n )}\n {title && (\n <Text headline className={styles(style.title, !onBack && style.left, !onClose && style.right)}>\n {title}\n </Text>\n )}\n {onClose && (\n <Button\n transparent\n small\n squared\n onPress={onClose}\n testId={testId ? `${testId}-button-close` : undefined}\n className={style.button}\n >\n <Icon value={isDesktop || title !== undefined ? ICON.CLOSE : ICON.EXPAND_MORE} className={style.icon} />\n </Button>\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 preventDefault: PropTypes.bool,\n title: PropTypes.string,\n visible: PropTypes.bool,\n onBack: PropTypes.func,\n onClose: PropTypes.func,\n onOverflow: PropTypes.func,\n};\n\nexport { Modal };\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAAuC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,KAAK,GAAG,SAARA,KAAK,OAaL;EAAA,qBAZJC,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;IAAA,2BACdC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IACrBC,KAAK,QAALA,KAAK;IACLC,OAAO,QAAPA,OAAO;IACPC,MAAM,QAANA,MAAM;IACNC,OAAO,QAAPA,OAAO;IACPC,UAAU,QAAVA,UAAU;IACPC,MAAM;EAET,iBAA8B,IAAAC,gBAAS,GAAE;IAAjCC,SAAS,cAATA,SAAS;IAAEC,MAAM,cAANA,MAAM;EACzB,IAAMC,GAAG,GAAG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P,OAAO,EAAEA,OAAQ;IACjB,MAAM,EAAE0B,MAAM,aAAMA,MAAM,qBAAkBX,SAAU;IACtD,SAAS,EAAEc,oBAAK,CAACW;EAAO,gBAExB,6BAAC,gBAAI;IAAC,KAAK,EAAEpC,SAAS,IAAIP,KAAK,KAAKkB,SAAS,GAAGoB,gBAAI,CAACM,KAAK,GAAGN,gBAAI,CAACO,WAAY;IAAC,SAAS,EAAEb,oBAAK,CAACQ;EAAK,EAAG,CAE3G,CAEJ,EACA7C,QAAQ,CACJ,CACG,EACZoB,QAAQ,CAACC,IAAI,CACd;AACH,CAAC;AAAC;AAEFvB,KAAK,CAACqD,SAAS,GAAG;EAChBpD,IAAI,EAAEqD,kBAAS,CAACC,IAAI;EACpBrD,QAAQ,EAAEoD,kBAAS,CAACE,IAAI;EACxBrD,GAAG,EAAEmD,kBAAS,CAACC,IAAI;EACnBnD,QAAQ,EAAEkD,kBAAS,CAACC,IAAI;EACxBlD,MAAM,EAAEiD,kBAAS,CAACC,IAAI;EACtBjD,cAAc,EAAEgD,kBAAS,CAACC,IAAI;EAC9BhD,KAAK,EAAE+C,kBAAS,CAACG,MAAM;EACvBjD,OAAO,EAAE8C,kBAAS,CAACC,IAAI;EACvB9C,MAAM,EAAE6C,kBAAS,CAACI,IAAI;EACtBhD,OAAO,EAAE4C,kBAAS,CAACI,IAAI;EACvB/C,UAAU,EAAE2C,kBAAS,CAACI;AACxB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -14,13 +14,14 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
14
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
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; }
|
|
18
|
-
function _iterableToArrayLimit(
|
|
17
|
+
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; }
|
|
18
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
var _default =
|
|
20
|
+
var _default = {
|
|
21
21
|
title: 'Components'
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
exports.default = _default;
|
|
24
|
+
var Story = function Story(props) {
|
|
24
25
|
var _useState = (0, _react.useState)(true),
|
|
25
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
27
|
visible = _useState2[0],
|
|
@@ -85,6 +86,7 @@ var Story = exports.Story = function Story(props) {
|
|
|
85
86
|
}
|
|
86
87
|
}, /*#__PURE__*/_react.default.createElement(_.Text, null, "Lorem ipsum dolor sit amet consectetur adipisicing elit. Animi nemo adipisci consequatur et tenetur natus dolore, facere facilis placeat nostrum unde cumque. Voluptas enim rerum voluptatum, deserunt fugiat aspernatur excepturi."))));
|
|
87
88
|
};
|
|
89
|
+
exports.Story = Story;
|
|
88
90
|
Story.storyName = 'Modal';
|
|
89
91
|
Story.args = {
|
|
90
92
|
blur: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Modal.stories.js","names":["_react","_interopRequireWildcard","require","_","_Modal","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","n","toString","slice","constructor","name","Array","from","test","len","arr2","r","l","t","Symbol","iterator","e","u","a","f","next","done","push","value","return","isArray","_default","exports","title","Story","props","_useState","useState","_useState2","visible","setVisible","_useState3","_useState4","visibleSecond","setVisibleSecond","handleBack","_console","_len","others","_key","console","log","concat","handleClose","_console2","_len2","_key2","handleOverflow","_console3","_len3","_key3","createElement","Fragment","Text","bold","headline","Button","onPress","Modal","onClose","onOverflow","View","style","padding","onBack","storyName","args","blur","fit","overflow","portal","testId","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) => {\n console.log('<Modal>::onOverflow', ...others);\n handleClose(others);\n };\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} onOverflow={handleOverflow} 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 testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAAgC,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,4BAAAG,OAAA,EAAAH,GAAA,UAAAI,KAAA,GAAAT,wBAAA,CAAAC,WAAA,OAAAQ,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAL,GAAA,YAAAI,KAAA,CAAAE,GAAA,CAAAN,GAAA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OAAA,CAAAyF,aAAA,CAACnG,CAAA,CAAA6G,IAAI;IAACC,KAAK,EAAE;MAAEC,OAAO,EAAE;IAA0B;EAAE,gBAClDlH,MAAA,CAAAa,OAAA,CAAAyF,aAAA,CAACnG,CAAA,CAAAqG,IAAI,QAAC,qOAIA,CACF,CACD,CACP,CAAC;AAEP,CAAC;AACD7B,KAAK,CAACyC,SAAS,GAAG,OAAO;AAEzBzC,KAAK,CAAC0C,IAAI,GAAG;EACXC,IAAI,EAAE,KAAK;EACXC,GAAG,EAAE,KAAK;EACVC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,KAAK;EACb/C,KAAK,EAAE,OAAO;EACd;EACAgD,MAAM,EAAE,YAAY;EACpBT,KAAK,EAAE,CAAC;AACV,CAAC;AAEDtC,KAAK,CAACgD,QAAQ,GAAG,CAAC,CAAC"}
|
|
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","testId","style","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) => {\n console.log('<Modal>::onOverflow', ...others);\n handleClose(others);\n };\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} onOverflow={handleOverflow} 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 proper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,IAAI;IAAC,QAAQ;EAAA,8BAEZ,eACP,6BAAC,MAAI,0wBAQE,eAEP,6BAAC,YAAK,eAAKH,KAAK;IAAE,OAAO,EAAEU,WAAY;IAAC,UAAU,EAAEC,cAAe;IAAC,OAAO,EAAET;EAAQ,iBACnF,6BAAC,MAAI;IAAC,KAAK,EAAE;MAAEU,OAAO,EAAE;IAA0B;EAAE,gBAClD,6BAAC,MAAI,8OAIE,eACP,6BAAC,QAAM;IAAC,OAAO,EAAE;MAAA,OAAMP,gBAAgB,CAAC,IAAI,CAAC;IAAA;EAAC,wBAA4B,CACrE,CACD,eAER,6BAAC,YAAK,eAAKL,KAAK;IAAE,MAAM,EAAEM,UAAW;IAAC,UAAU,EAAEK,cAAe;IAAC,OAAO,EAAEP;EAAc,iBACvF,6BAAC,MAAI;IAAC,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,GAAG;EACXC,IAAI,EAAE,KAAK;EACXC,GAAG,EAAE,KAAK;EACVC,QAAQ,EAAE,IAAI;EACdC,MAAM,EAAE,KAAK;EACbpB,KAAK,EAAE,OAAO;EACd;EACAqB,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC;AAEDrB,KAAK,CAACsB,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Modal/index.js"],"sourcesContent":["export * from './Modal';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Notification = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _NotificationModule = _interopRequireDefault(require("./Notification.module.css"));
|
|
10
9
|
var _helpers = require("../../helpers");
|
|
11
10
|
var _primitives = require("../../primitives");
|
|
11
|
+
var _NotificationModule = _interopRequireDefault(require("./Notification.module.css"));
|
|
12
12
|
var _excluded = ["children", "error", "info", "inline", "large", "small", "success", "warning", "wide", "onClose"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
15
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
-
var Notification =
|
|
17
|
+
var Notification = function Notification(_ref) {
|
|
18
18
|
var children = _ref.children,
|
|
19
19
|
error = _ref.error,
|
|
20
20
|
info = _ref.info,
|
|
@@ -53,6 +53,7 @@ var Notification = exports.Notification = function Notification(_ref) {
|
|
|
53
53
|
paragraph: small
|
|
54
54
|
})));
|
|
55
55
|
};
|
|
56
|
+
exports.Notification = Notification;
|
|
56
57
|
Notification.displayName = 'Component:Notification';
|
|
57
58
|
Notification.propTypes = {
|
|
58
59
|
children: _propTypes.default.any.isRequired,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","names":["
|
|
1
|
+
{"version":3,"file":"Notification.js","names":["Notification","children","error","info","inline","large","small","success","warning","wide","onClose","others","role","styles","style","notification","undefined","outlined","className","getIconState","icon","text","pressable","testId","ICON","CLOSE","displayName","propTypes","PropTypes","any","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 = ({\n children,\n error,\n info,\n inline = false,\n large,\n small,\n success,\n warning,\n wide,\n onClose,\n ...others\n}) => (\n <View\n {...others}\n row\n role={others.role || 'notification'}\n className={styles(\n style.notification,\n error ? style.error : warning ? style.warning : success ? style.success : info ? style.info : undefined,\n inline ? style.inline : style.outlined,\n inline && style.inline,\n large ? style.large : small && style.small,\n wide && style.wide,\n others.className,\n )}\n >\n <Icon\n headline={large}\n level={large ? 1 : undefined}\n paragraph={small}\n value={getIconState({ error, success, warning })}\n className={style.icon}\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 {!large && onClose && (\n <Pressable\n onPress={onClose}\n className={styles(style.pressable, style.icon)}\n testId={others.testId ? `${others.testId}-button-close` : undefined}\n >\n <Icon value={ICON.CLOSE} paragraph={small} />\n </Pressable>\n )}\n </View>\n);\n\nNotification.displayName = 'Component:Notification';\n\nNotification.propTypes = {\n children: PropTypes.any.isRequired,\n error: PropTypes.bool,\n info: PropTypes.bool,\n inline: PropTypes.bool,\n large: PropTypes.bool,\n small: PropTypes.bool,\n success: PropTypes.bool,\n warning: PropTypes.bool,\n wide: PropTypes.bool,\n onClose: PropTypes.func,\n};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-7,12 +7,14 @@ exports.default = exports.Story = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _Notification = require("./Notification");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
var _default =
|
|
10
|
+
var _default = {
|
|
11
11
|
title: 'Components'
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
exports.default = _default;
|
|
14
|
+
var Story = function Story(props) {
|
|
14
15
|
return /*#__PURE__*/_react.default.createElement(_Notification.Notification, props);
|
|
15
16
|
};
|
|
17
|
+
exports.Story = Story;
|
|
16
18
|
Story.storyName = 'Notification';
|
|
17
19
|
Story.args = {
|
|
18
20
|
children: 'children',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.stories.js","names":["
|
|
1
|
+
{"version":3,"file":"Notification.stories.js","names":["title","Story","props","storyName","args","children","error","info","inline","large","small","success","warning","wide","testId","style","argTypes","onClose","action"],"sources":["../../../src/components/Notification/Notification.stories.jsx"],"sourcesContent":["import React from 'react';\n\nimport { Notification } from './Notification';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <Notification {...props} />;\n\nStory.storyName = 'Notification';\n\nStory.args = {\n children: 'children',\n error: false,\n info: false,\n inline: false,\n large: false,\n small: false,\n success: false,\n warning: false,\n wide: false,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n onClose: { action: 'onClose' },\n};\n"],"mappings":";;;;;;AAAA;AAEA;AAA8C;AAAA,eAE/B;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK;EAAA,oBAAK,6BAAC,0BAAY,EAAKA,KAAK,CAAI;AAAA;AAAC;AAE5DD,KAAK,CAACE,SAAS,GAAG,cAAc;AAEhCF,KAAK,CAACG,IAAI,GAAG;EACXC,QAAQ,EAAE,UAAU;EACpBC,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE,KAAK;EACXC,MAAM,EAAE,KAAK;EACbC,KAAK,EAAE,KAAK;EACZC,KAAK,EAAE,KAAK;EACZC,OAAO,EAAE,KAAK;EACdC,OAAO,EAAE,KAAK;EACdC,IAAI,EAAE,KAAK;EACX;EACAC,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC;AAEDd,KAAK,CAACe,QAAQ,GAAG;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAU;AAC/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Notification/index.js"],"sourcesContent":["export * from './Notification';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -6,15 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.Progress = void 0;
|
|
7
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _ProgressModule = _interopRequireDefault(require("./Progress.module.css"));
|
|
10
9
|
var _helpers = require("../../helpers");
|
|
11
10
|
var _primitives = require("../../primitives");
|
|
11
|
+
var _ProgressModule = _interopRequireDefault(require("./Progress.module.css"));
|
|
12
12
|
var _excluded = ["indeterminate", "value", "visible"];
|
|
13
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
14
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
15
15
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
16
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
|
-
var Progress =
|
|
17
|
+
var Progress = function Progress(_ref) {
|
|
18
18
|
var _ref$indeterminate = _ref.indeterminate,
|
|
19
19
|
indeterminate = _ref$indeterminate === void 0 ? false : _ref$indeterminate,
|
|
20
20
|
_ref$value = _ref.value,
|
|
@@ -32,6 +32,7 @@ var Progress = exports.Progress = function Progress(_ref) {
|
|
|
32
32
|
} : undefined
|
|
33
33
|
}));
|
|
34
34
|
};
|
|
35
|
+
exports.Progress = Progress;
|
|
35
36
|
Progress.propTypes = {
|
|
36
37
|
indeterminate: _propTypes.default.bool,
|
|
37
38
|
value: _propTypes.default.number,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.js","names":["
|
|
1
|
+
{"version":3,"file":"Progress.js","names":["Progress","indeterminate","value","visible","others","role","styles","style","progress","className","width","undefined","propTypes","PropTypes","bool","number"],"sources":["../../../src/components/Progress/Progress.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { View } from '../../primitives';\nimport style from './Progress.module.css';\n\nconst Progress = ({ indeterminate = false, value = 0, visible = false, ...others }) => (\n <View\n {...others}\n role={others.role || 'progress'}\n className={styles(style.progress, visible && style.visible, others.className)}\n >\n <View\n className={styles(style.value, indeterminate && style.indeterminate)}\n style={!indeterminate ? { width: `${value}%` } : undefined}\n />\n </View>\n);\n\nProgress.propTypes = {\n indeterminate: PropTypes.bool,\n value: PropTypes.number,\n visible: PropTypes.bool,\n};\n\nexport { Progress };\n"],"mappings":";;;;;;AAAA;AACA;AAEA;AACA;AACA;AAA0C;AAAA;AAAA;AAAA;AAAA;AAE1C,IAAMA,QAAQ,GAAG,SAAXA,QAAQ;EAAA,8BAAMC,aAAa;IAAbA,aAAa,mCAAG,KAAK;IAAA,kBAAEC,KAAK;IAALA,KAAK,2BAAG,CAAC;IAAA,oBAAEC,OAAO;IAAPA,OAAO,6BAAG,KAAK;IAAKC,MAAM;EAAA,oBAC9E,6BAAC,gBAAI,eACCA,MAAM;IACV,IAAI,EAAEA,MAAM,CAACC,IAAI,IAAI,UAAW;IAChC,SAAS,EAAE,IAAAC,eAAM,EAACC,uBAAK,CAACC,QAAQ,EAAEL,OAAO,IAAII,uBAAK,CAACJ,OAAO,EAAEC,MAAM,CAACK,SAAS;EAAE,iBAE9E,6BAAC,gBAAI;IACH,SAAS,EAAE,IAAAH,eAAM,EAACC,uBAAK,CAACL,KAAK,EAAED,aAAa,IAAIM,uBAAK,CAACN,aAAa,CAAE;IACrE,KAAK,EAAE,CAACA,aAAa,GAAG;MAAES,KAAK,YAAKR,KAAK;IAAI,CAAC,GAAGS;EAAU,EAC3D,CACG;AAAA,CACR;AAAC;AAEFX,QAAQ,CAACY,SAAS,GAAG;EACnBX,aAAa,EAAEY,kBAAS,CAACC,IAAI;EAC7BZ,KAAK,EAAEW,kBAAS,CAACE,MAAM;EACvBZ,OAAO,EAAEU,kBAAS,CAACC;AACrB,CAAC"}
|
|
@@ -8,13 +8,15 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _ = require("../..");
|
|
9
9
|
var _Progress = require("./Progress");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var _default =
|
|
11
|
+
var _default = {
|
|
12
12
|
title: 'Components'
|
|
13
13
|
};
|
|
14
|
+
exports.default = _default;
|
|
14
15
|
var INSTANCES = Array.from(Array(3).keys());
|
|
15
|
-
var Story =
|
|
16
|
+
var Story = function Story(props) {
|
|
16
17
|
return /*#__PURE__*/_react.default.createElement(_Progress.Progress, props);
|
|
17
18
|
};
|
|
19
|
+
exports.Story = Story;
|
|
18
20
|
Story.storyName = 'Progress';
|
|
19
21
|
Story.args = {
|
|
20
22
|
indeterminate: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Progress.stories.js","names":["
|
|
1
|
+
{"version":3,"file":"Progress.stories.js","names":["title","INSTANCES","Array","from","keys","Story","props","storyName","args","indeterminate","value","visible","testId","style","argTypes"],"sources":["../../../src/components/Progress/Progress.stories.jsx"],"sourcesContent":["import React from 'react';\n\nimport { Text, View } from '../..';\nimport { Progress } from './Progress';\n\nexport default { title: 'Components' };\n\nconst INSTANCES = Array.from(Array(3).keys());\n\nexport const Story = (props) => <Progress {...props} />;\n\nStory.storyName = 'Progress';\n\nStory.args = {\n indeterminate: false,\n value: 25,\n visible: true,\n // inherited properties\n testId: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;AAAA;AAEA;AACA;AAAsC;AAAA,eAEvB;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAEtC,IAAMC,SAAS,GAAGC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAC,CAAC,CAAC,CAACE,IAAI,EAAE,CAAC;AAEtC,IAAMC,KAAK,GAAG,SAARA,KAAK,CAAIC,KAAK;EAAA,oBAAK,6BAAC,kBAAQ,EAAKA,KAAK,CAAI;AAAA;AAAC;AAExDD,KAAK,CAACE,SAAS,GAAG,UAAU;AAE5BF,KAAK,CAACG,IAAI,GAAG;EACXC,aAAa,EAAE,KAAK;EACpBC,KAAK,EAAE,EAAE;EACTC,OAAO,EAAE,IAAI;EACb;EACAC,MAAM,EAAE,YAAY;EACpBC,KAAK,EAAE,CAAC;AACV,CAAC;AAEDR,KAAK,CAACS,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/Progress/index.js"],"sourcesContent":["export * from './Progress';\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slider.constants.js","names":["PRELOAD_IMAGES"
|
|
1
|
+
{"version":3,"file":"Slider.constants.js","names":["PRELOAD_IMAGES"],"sources":["../../../src/components/Slider/Slider.constants.js"],"sourcesContent":["const PRELOAD_IMAGES = 2;\n\nexport { PRELOAD_IMAGES };\n"],"mappings":";;;;;;AAAA,IAAMA,cAAc,GAAG,CAAC;AAAC"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.Slider = void 0;
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _helpers = require("
|
|
11
|
-
var _Slider = require("./Slider.constants");
|
|
12
|
-
var _SliderModule = _interopRequireDefault(require("./Slider.module.css"));
|
|
13
|
-
var _helpers2 = require("../../helpers");
|
|
10
|
+
var _helpers = require("../../helpers");
|
|
14
11
|
var _hooks = require("../../hooks");
|
|
15
12
|
var _primitives = require("../../primitives");
|
|
13
|
+
var _helpers2 = require("./helpers");
|
|
14
|
+
var _Slider = require("./Slider.constants");
|
|
15
|
+
var _SliderModule = _interopRequireDefault(require("./Slider.module.css"));
|
|
16
16
|
var _excluded = ["auto", "captions", "fullScreen", "height", "images", "index", "thumbnails", "width", "onChange", "onFullScreen"];
|
|
17
17
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
20
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
21
|
-
function ownKeys(
|
|
22
|
-
function _objectSpread(
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
23
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24
24
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
25
25
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
26
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
27
27
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
28
28
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
29
|
-
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; }
|
|
30
|
-
function _iterableToArrayLimit(
|
|
29
|
+
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; }
|
|
30
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
31
31
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
32
32
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
33
33
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
34
34
|
var interval;
|
|
35
35
|
var timeout;
|
|
36
|
-
var Slider =
|
|
36
|
+
var Slider = function Slider(_ref) {
|
|
37
37
|
var _ref$auto = _ref.auto,
|
|
38
38
|
auto = _ref$auto === void 0 ? false : _ref$auto,
|
|
39
39
|
_ref$captions = _ref.captions,
|
|
@@ -99,7 +99,7 @@ var Slider = exports.Slider = function Slider(_ref) {
|
|
|
99
99
|
clearTimeout(timeout);
|
|
100
100
|
timeout = setTimeout(function () {
|
|
101
101
|
setIndex(x < width ? 0 : Math.round(x / width));
|
|
102
|
-
}, (0,
|
|
102
|
+
}, (0, _helpers2.getMotionExpand)());
|
|
103
103
|
};
|
|
104
104
|
return /*#__PURE__*/_react.default.createElement(_primitives.View, _extends({}, others, {
|
|
105
105
|
role: "slider",
|
|
@@ -109,7 +109,7 @@ var Slider = exports.Slider = function Slider(_ref) {
|
|
|
109
109
|
onMouseLeave: isDesktop ? function () {
|
|
110
110
|
return setFocus(false);
|
|
111
111
|
} : undefined,
|
|
112
|
-
className: (0,
|
|
112
|
+
className: (0, _helpers.styles)(_SliderModule.default.container, fullScreen && _SliderModule.default.fullScreen, others.className),
|
|
113
113
|
style: _objectSpread(_objectSpread({}, !fullScreen ? others.style : undefined), {}, {
|
|
114
114
|
width: fullScreen ? screenWidth : width
|
|
115
115
|
})
|
|
@@ -117,7 +117,7 @@ var Slider = exports.Slider = function Slider(_ref) {
|
|
|
117
117
|
onPress: function onPress() {
|
|
118
118
|
return setIndex(index - 1);
|
|
119
119
|
},
|
|
120
|
-
className: (0,
|
|
120
|
+
className: (0, _helpers.styles)(_SliderModule.default.button, (index <= 0 || isDesktop && !focus) && _SliderModule.default.hide, _SliderModule.default.back)
|
|
121
121
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
122
122
|
value: _primitives.ICON.LEFT
|
|
123
123
|
})), /*#__PURE__*/_react.default.createElement(_primitives.ScrollView, {
|
|
@@ -153,7 +153,7 @@ var Slider = exports.Slider = function Slider(_ref) {
|
|
|
153
153
|
onPress: function onPress() {
|
|
154
154
|
return setIndex(index + 1);
|
|
155
155
|
},
|
|
156
|
-
className: (0,
|
|
156
|
+
className: (0, _helpers.styles)(_SliderModule.default.button, (index >= images.length - 1 || isDesktop && !focus) && _SliderModule.default.hide && _SliderModule.default.hide, _SliderModule.default.forward)
|
|
157
157
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
158
158
|
value: _primitives.ICON.RIGHT
|
|
159
159
|
})), fullScreen && /*#__PURE__*/_react.default.createElement(_primitives.ScrollView, {
|
|
@@ -166,13 +166,14 @@ var Slider = exports.Slider = function Slider(_ref) {
|
|
|
166
166
|
onPress: function onPress() {
|
|
167
167
|
return setIndex(imageIndex);
|
|
168
168
|
},
|
|
169
|
-
className: (0,
|
|
169
|
+
className: (0, _helpers.styles)(_SliderModule.default.thumbnail, index === imageIndex && _SliderModule.default.active),
|
|
170
170
|
style: {
|
|
171
171
|
backgroundImage: "url(".concat(thumbnails[imageIndex] || image, ")")
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
174
|
})));
|
|
175
175
|
};
|
|
176
|
+
exports.Slider = Slider;
|
|
176
177
|
Slider.displayName = 'Component:Slider';
|
|
177
178
|
Slider.propTypes = {
|
|
178
179
|
auto: _propTypes.default.bool,
|