@innovaccer/design-system 2.6.0 → 2.7.0-0
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/.eslintrc.json +10 -9
- package/.github/workflows/chromatic.yml +5 -0
- package/.github/workflows/pull_request.yml +1 -1
- package/.storybook/main.js +4 -0
- package/.vscode/settings.json +11 -0
- package/CHANGELOG.md +36 -0
- package/CONTRIBUTING.md +7 -1
- package/core/accessibility/utils/useAccessibilityProps.ts +4 -2
- package/core/common.type.tsx +22 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +9 -9
- package/core/components/atoms/_chip/index.tsx +17 -3
- package/core/components/atoms/avatar/Avatar.tsx +4 -14
- package/core/components/atoms/avatar/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/avatar/__tests__/Avatar.test.tsx +14 -9
- package/core/components/atoms/avatarGroup/AvatarGroup.tsx +3 -5
- package/core/components/atoms/badge/Badge.tsx +2 -12
- package/core/components/atoms/badge/__tests__/Badge.test.tsx +22 -7
- package/core/components/atoms/badge/_stories_/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/badge/_stories_/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/button/Button.tsx +10 -7
- package/core/components/atoms/button/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +2 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +2 -2
- package/core/components/atoms/button/__tests__/Button.test.tsx +1 -1
- package/core/components/atoms/button/__tests__/__snapshots__/Button.test.tsx.snap +0 -137
- package/core/components/atoms/card/__stories__/empty.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/nested.story.tsx +1 -1
- package/core/components/atoms/card/__stories__/scroll.story.tsx +1 -1
- package/core/components/atoms/checkbox/Checkbox.tsx +8 -9
- package/core/components/atoms/checkbox/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/chip/Chip.tsx +3 -2
- package/core/components/atoms/chip/__stories__/variants/Selection.story.tsx +17 -0
- package/core/components/atoms/chip/__stories__/variants/Type.story.tsx +2 -2
- package/core/components/atoms/chip/__tests__/Chip.test.tsx +7 -0
- package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +5 -5
- package/core/components/atoms/chipGroup/__tests__/chipGroup.test.tsx +2 -2
- package/core/components/atoms/chipGroup/_stories_/index.story.tsx +2 -2
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -17
- package/core/components/atoms/dropdown/DropdownButton.tsx +2 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +10 -5
- package/core/components/atoms/dropdown/Loading.tsx +1 -1
- package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.tsx +45 -0
- package/core/components/atoms/dropdown/__stories__/_common_/types.tsx +3 -0
- package/core/components/atoms/dropdown/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.tsx +1 -1
- package/core/components/atoms/dropdown/__tests__/Dropdown.test.tsx +12 -1
- package/core/components/atoms/dropdown/__tests__/Loading.test.tsx +0 -1
- package/core/components/atoms/dropdown/option/index.tsx +1 -1
- package/core/components/atoms/heading/Heading.tsx +4 -4
- package/core/components/atoms/heading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/heading/__tests__/Heading.test.tsx +4 -3
- package/core/components/atoms/icon/Icon.tsx +3 -3
- package/core/components/atoms/input/Input.tsx +3 -3
- package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +62 -0
- package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +38 -0
- package/core/components/atoms/input/__stories__/variants/controlledInput.story.tsx +46 -0
- package/core/components/atoms/input/__stories__/variants/types/BasicInput.story.tsx +2 -2
- package/core/components/atoms/input/__stories__/variants/types/IconLeft.story.tsx +2 -10
- package/core/components/atoms/input/__stories__/variants/types/WithLabel.story.tsx +1 -9
- package/core/components/atoms/label/Label.tsx +1 -1
- package/core/components/atoms/legend/Legend.tsx +2 -2
- package/core/components/atoms/legend/__stories__/variants/labelAppearance.story.tsx +2 -2
- package/core/components/atoms/link/Link.tsx +4 -4
- package/core/components/atoms/message/Message.tsx +12 -12
- package/core/components/atoms/message/__stories__/index.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/Appearance.story.tsx +1 -1
- package/core/components/atoms/message/__stories__/variants/AppearanceTitle.story.tsx +1 -1
- package/core/components/atoms/message/__tests__/Message.test.tsx +1 -6
- package/core/components/atoms/message/__tests__/__snapshots__/Message.test.tsx.snap +0 -45
- package/core/components/atoms/metaList/__tests__/MetaList.test.tsx +2 -2
- package/core/components/atoms/metricInput/MetricInput.tsx +5 -5
- package/core/components/atoms/multiSlider/SliderUtils.tsx +1 -4
- package/core/components/atoms/multiSlider/index.tsx +3 -4
- package/core/components/atoms/outsideClick/OutsideClick.tsx +1 -2
- package/core/components/atoms/paragraph/Paragraph.tsx +2 -2
- package/core/components/atoms/paragraph/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/paragraph/__tests__/Paragraph.test.tsx +2 -2
- package/core/components/atoms/pills/Pills.tsx +2 -12
- package/core/components/atoms/pills/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/pills/__stories__/variants/Subtle.story.tsx +3 -2
- package/core/components/atoms/pills/__tests__/Pills.test.tsx +3 -2
- package/core/components/atoms/placeholderImage/PlaceholderImage.tsx +2 -2
- package/core/components/atoms/placeholderImage/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/PlaceholderParagraph.tsx +2 -2
- package/core/components/atoms/placeholderParagraph/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/popperWrapper/PopperWrapper.tsx +2 -6
- package/core/components/atoms/progressRing/ProgressRing.tsx +2 -2
- package/core/components/atoms/progressRing/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/radio/Radio.tsx +4 -5
- package/core/components/atoms/rangeSlider/RangeSlider.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/index.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.tsx +1 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/CustomLabels.story.tsx +1 -2
- package/core/components/atoms/spinner/Spinner.tsx +4 -4
- package/core/components/atoms/spinner/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/spinner/__stories__/variants/Size.story.tsx +1 -1
- package/core/components/atoms/statusHint/StatusHint.tsx +2 -3
- package/core/components/atoms/statusHint/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/statusHint/__tests__/StatusHint.test.tsx +3 -2
- package/core/components/atoms/subheading/Subheading.tsx +2 -2
- package/core/components/atoms/subheading/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/subheading/__tests__/Subheading.test.tsx +3 -2
- package/core/components/atoms/switchInput/Switch.tsx +7 -8
- package/core/components/atoms/text/Text.tsx +4 -4
- package/core/components/atoms/text/__stories__/variants/Appearance.story.tsx +2 -2
- package/core/components/atoms/text/__tests__/Text.test.tsx +2 -3
- package/core/components/atoms/toast/ActionButton.tsx +2 -2
- package/core/components/atoms/toast/Toast.tsx +11 -6
- package/core/components/atoms/toast/__stories__/index.story.tsx +2 -6
- package/core/components/atoms/toast/__stories__/variants/Appearance.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastMessage.story.tsx +3 -2
- package/core/components/atoms/toast/__stories__/variants/ToastWithAction.story.tsx +3 -2
- package/core/components/atoms/toast/__tests__/Toast.test.tsx +1 -1
- package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +0 -131
- package/core/components/css-utilities/Schema.tsx +1 -1
- package/core/components/css-utilities/Spacing/Schema.tsx +1 -1
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +2 -2
- package/core/components/molecules/dropzone/Dropzone.tsx +3 -3
- package/core/components/molecules/dropzone/DropzoneBase.tsx +22 -38
- package/core/components/molecules/dropzone/__stories__/index.story.tsx +151 -41
- package/core/components/molecules/dropzone/__tests__/Dropzone.test.tsx +2 -2
- package/core/components/molecules/dropzone/utils.tsx +6 -4
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +4 -4
- package/core/components/molecules/emptyState/EmptyState.tsx +4 -4
- package/core/components/molecules/emptyState/__stories__/pageNotLoadedWithSVG.story.tsx +26 -26
- package/core/components/molecules/fileList/FileListItem.tsx +1 -2
- package/core/components/molecules/fileUploader/FileUploaderItem.tsx +1 -2
- package/core/components/molecules/fileUploader/FileUploaderStatus.tsx +1 -1
- package/core/components/molecules/fileUploader/__stories__/_common_/types.tsx +3 -0
- package/core/components/molecules/fileUploader/__stories__/index.story.tsx +3 -222
- package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +5 -7
- package/core/components/molecules/inputMask/InputMask.tsx +212 -146
- package/core/components/molecules/inputMask/__stories__/index.story.tsx +24 -0
- package/core/components/molecules/modal/Modal.tsx +4 -6
- package/core/components/molecules/modal/__stories__/Confirmation.story.tsx +1 -1
- package/core/components/molecules/placeholder/Placeholder.tsx +2 -2
- package/core/components/molecules/popover/Popover.tsx +2 -9
- package/core/components/molecules/sidesheet/Sidesheet.tsx +5 -7
- package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.tsx +172 -0
- package/core/components/molecules/tooltip/Tooltip.tsx +4 -4
- package/core/components/organisms/calendar/__stories__/variants/firstDayOfWeek.story.tsx +2 -2
- package/core/components/organisms/calendar/utility.ts +3 -3
- package/core/components/organisms/choiceList/ChoiceList.tsx +11 -11
- package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
- package/core/components/organisms/datePicker/Trigger.tsx +1 -5
- package/core/components/organisms/dateRangePicker/DateRangePicker.tsx +9 -10
- package/core/components/organisms/dateRangePicker/SingleInputTrigger.tsx +0 -1
- package/core/components/organisms/dateRangePicker/Trigger.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__stories__/variants/monthsInView.story.tsx +2 -2
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +16 -16
- package/core/components/organisms/grid/Cell.tsx +19 -19
- package/core/components/organisms/grid/Grid.tsx +3 -4
- package/core/components/organisms/grid/GridBody.tsx +0 -1
- package/core/components/organisms/grid/GridContext.ts +1 -1
- package/core/components/organisms/grid/__stories__/_common_/editableSchema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +1 -1
- package/core/components/organisms/grid/__stories__/_common_/loaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/schema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/simpleLoaderSchema.ts +0 -2
- package/core/components/organisms/grid/__stories__/_common_/statusSchema.ts +0 -2
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +2 -2
- package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +3 -2
- package/core/components/organisms/list/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/list/__stories__/index.story.tsx +0 -16
- package/core/components/organisms/table/Table.tsx +2 -2
- package/core/components/organisms/table/__stories__/CompressedTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/DataTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/PinnedColumn.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/ResourceTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/StandardTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TightStory.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/_common_/types.tsx +3 -0
- package/core/components/organisms/table/__stories__/variants/showHead.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/showMenu.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/size.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/type.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withCheckbox.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/variants/withPagination.story.tsx +2 -2
- package/core/components/organisms/timePicker/TimePicker.tsx +3 -7
- package/core/components/organisms/verticalNav/__stories__/schema.tsx +0 -2
- package/core/components/organisms/verticalNav/__tests__/VerticalNav.test.tsx +1 -2
- package/core/global.d.ts +9 -0
- package/core/index.tsx +1 -1
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +18 -5
- package/core/utils/docPage/generateImports.tsx +2 -3
- package/core/utils/docPage/index.tsx +30 -20
- package/core/utils/docPage/sandbox.tsx +14 -7
- package/core/utils/overlayHelper.ts +7 -3
- package/core/utils/testHelper.ts +1 -1
- package/core/utils/types.tsx +1 -1
- package/css/dist/index.css +48 -30
- package/css/dist/index.css.map +1 -1
- package/css/src/components/button.css +5 -5
- package/css/src/components/calendar.css +1 -1
- package/css/src/components/chip.css +6 -4
- package/css/src/components/fullscreenModal.css +4 -3
- package/css/src/components/message.css +0 -5
- package/css/src/components/switch.css +23 -2
- package/css/src/components/toast.css +0 -5
- package/css/src/variables/index.css +5 -2
- package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +4 -1
- package/dist/core/common.type.d.ts +12 -0
- package/dist/core/components/atoms/avatar/Avatar.d.ts +4 -4
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -3
- package/dist/core/components/atoms/badge/Badge.d.ts +2 -2
- package/dist/core/components/atoms/button/Button.d.ts +6 -6
- package/dist/core/components/atoms/checkbox/Checkbox.d.ts +3 -3
- package/dist/core/components/atoms/chip/Chip.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +18 -17
- package/dist/core/components/atoms/dropdown/DropdownButton.d.ts +2 -2
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +4 -3
- package/dist/core/components/atoms/dropdown/option/index.d.ts +1 -1
- package/dist/core/components/atoms/heading/Heading.d.ts +4 -4
- package/dist/core/components/atoms/icon/Icon.d.ts +2 -2
- package/dist/core/components/atoms/input/Input.d.ts +3 -3
- package/dist/core/components/atoms/legend/Legend.d.ts +2 -2
- package/dist/core/components/atoms/link/Link.d.ts +4 -4
- package/dist/core/components/atoms/message/Message.d.ts +2 -2
- package/dist/core/components/atoms/metricInput/MetricInput.d.ts +3 -3
- package/dist/core/components/atoms/multiSlider/SliderUtils.d.ts +1 -1
- package/dist/core/components/atoms/multiSlider/index.d.ts +3 -3
- package/dist/core/components/atoms/paragraph/Paragraph.d.ts +2 -2
- package/dist/core/components/atoms/pills/Pills.d.ts +2 -2
- package/dist/core/components/atoms/placeholderImage/PlaceholderImage.d.ts +2 -2
- package/dist/core/components/atoms/placeholderParagraph/PlaceholderParagraph.d.ts +2 -2
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +1 -2
- package/dist/core/components/atoms/progressRing/ProgressRing.d.ts +2 -2
- package/dist/core/components/atoms/radio/Radio.d.ts +4 -4
- package/dist/core/components/atoms/rangeSlider/RangeSlider.d.ts +1 -1
- package/dist/core/components/atoms/spinner/Spinner.d.ts +4 -4
- package/dist/core/components/atoms/statusHint/StatusHint.d.ts +2 -2
- package/dist/core/components/atoms/subheading/Subheading.d.ts +2 -2
- package/dist/core/components/atoms/switchInput/Switch.d.ts +6 -6
- package/dist/core/components/atoms/text/Text.d.ts +4 -4
- package/dist/core/components/atoms/toast/ActionButton.d.ts +2 -2
- package/dist/core/components/atoms/toast/Toast.d.ts +2 -2
- package/dist/core/components/molecules/dropzone/Dropzone.d.ts +3 -3
- package/dist/core/components/molecules/dropzone/DropzoneBase.d.ts +1 -1
- package/dist/core/components/molecules/dropzone/utils.d.ts +5 -3
- package/dist/core/components/molecules/emptyState/EmptyState.d.ts +4 -4
- package/dist/core/components/molecules/fileList/FileListItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderItem.d.ts +1 -1
- package/dist/core/components/molecules/fileUploader/FileUploaderStatus.d.ts +1 -1
- package/dist/core/components/molecules/fullscreenModal/FullscreenModal.d.ts +4 -7
- package/dist/core/components/molecules/inputMask/InputMask.d.ts +10 -2
- package/dist/core/components/molecules/modal/Modal.d.ts +3 -6
- package/dist/core/components/molecules/placeholder/Placeholder.d.ts +2 -2
- package/dist/core/components/molecules/popover/Popover.d.ts +0 -1
- package/dist/core/components/molecules/sidesheet/Sidesheet.d.ts +3 -6
- package/dist/core/components/molecules/tooltip/Tooltip.d.ts +3 -3
- package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +5 -6
- package/dist/core/components/organisms/dateRangePicker/DateRangePicker.d.ts +24 -0
- package/dist/core/components/organisms/grid/Cell.d.ts +1 -1
- package/dist/core/components/organisms/grid/Grid.d.ts +3 -3
- package/dist/core/components/organisms/grid/GridContext.d.ts +1 -1
- package/dist/core/components/organisms/inlineMessage/InlineMessage.d.ts +2 -2
- package/dist/core/components/organisms/table/Table.d.ts +2 -2
- package/dist/core/components/patterns/dateRangePicker/withCustomPopover.story.d.ts +5 -1
- package/dist/core/utils/docPage/generateImports.d.ts +1 -1
- package/dist/core/utils/overlayHelper.d.ts +1 -1
- package/dist/core/utils/types.d.ts +1 -1
- package/dist/index.esm.js +221 -245
- package/dist/index.js +225 -233
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.br +0 -0
- package/dist/index.umd.js.gz +0 -0
- package/dts.config.js +11 -2
- package/package.json +20 -18
- package/tsconfig.json +3 -16
- package/tsconfig.type.json +2 -1
- package/types/index.d.ts +2217 -0
- package/types/{innovaccer-design-system/tsconfig.json → tsconfig.json} +1 -1
- package/types/{innovaccer-design-system/tslint.json → tslint.json} +0 -0
- package/types/types-tests.tsx +936 -0
- package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +0 -89
- package/core/components/atoms/message/__stories__/default.story.tsx +0 -16
- package/core/components/atoms/toast/__stories__/DefaultToast.story.tsx +0 -16
- package/core/components/molecules/dropzone/__stories__/variants/DropzoneWithFileList.story.tsx +0 -176
- package/core/components/molecules/fileUploader/__stories__/variants/FileUploaderList.story.tsx +0 -80
- package/types/innovaccer-design-system/index.d.ts +0 -39
- package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
|
@@ -17,11 +17,11 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
17
17
|
xmlnsXlink="http://www.w3.org/1999/xlink"
|
|
18
18
|
>
|
|
19
19
|
<title>Group 17</title>
|
|
20
|
-
<g id="Error-States" stroke="none"
|
|
20
|
+
<g id="Error-States" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
21
21
|
<g id="Artboard-Copy-31" transform="translate(-289.000000, -119.000000)">
|
|
22
22
|
<g id="Group-17" transform="translate(290.000000, 119.000000)">
|
|
23
23
|
<g id="Group-14">
|
|
24
|
-
<g id="Group-25" transform="translate(0.000000, 366.044314)"
|
|
24
|
+
<g id="Group-25" transform="translate(0.000000, 366.044314)" strokeLinecap="round">
|
|
25
25
|
<line
|
|
26
26
|
x1="10"
|
|
27
27
|
y1="1.5"
|
|
@@ -29,7 +29,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
29
29
|
y2="1.5"
|
|
30
30
|
id="Line-8"
|
|
31
31
|
stroke="#D4D4D4"
|
|
32
|
-
|
|
32
|
+
strokeLinejoin="round"
|
|
33
33
|
/>
|
|
34
34
|
<line
|
|
35
35
|
x1="71"
|
|
@@ -38,7 +38,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
38
38
|
y2="1.5"
|
|
39
39
|
id="Line-8-Copy-7"
|
|
40
40
|
stroke="#D4D4D4"
|
|
41
|
-
|
|
41
|
+
strokeLinejoin="round"
|
|
42
42
|
/>
|
|
43
43
|
<line
|
|
44
44
|
x1="169"
|
|
@@ -47,8 +47,8 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
47
47
|
y2="1.5"
|
|
48
48
|
id="Line-8-Copy-8"
|
|
49
49
|
stroke="#D4D4D4"
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
strokeWidth="3"
|
|
51
|
+
strokeLinejoin="round"
|
|
52
52
|
/>
|
|
53
53
|
<line x1="0" y1="1.5" x2="2" y2="1.5" id="Line-8-Copy-3" stroke="#A8A7A7" />
|
|
54
54
|
<line
|
|
@@ -58,7 +58,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
58
58
|
y2="1.5"
|
|
59
59
|
id="Line-8-Copy-5"
|
|
60
60
|
stroke="#D4D4D4"
|
|
61
|
-
|
|
61
|
+
strokeLinejoin="round"
|
|
62
62
|
/>
|
|
63
63
|
<line
|
|
64
64
|
x1="560"
|
|
@@ -67,7 +67,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
67
67
|
y2="1.5"
|
|
68
68
|
id="Line-8-Copy-2"
|
|
69
69
|
stroke="#D4D4D4"
|
|
70
|
-
|
|
70
|
+
strokeLinejoin="round"
|
|
71
71
|
/>
|
|
72
72
|
<line
|
|
73
73
|
x1="707"
|
|
@@ -76,7 +76,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
76
76
|
y2="1.5"
|
|
77
77
|
id="Line-8-Copy-9"
|
|
78
78
|
stroke="#D4D4D4"
|
|
79
|
-
|
|
79
|
+
strokeLinejoin="round"
|
|
80
80
|
/>
|
|
81
81
|
<line
|
|
82
82
|
x1="851"
|
|
@@ -85,7 +85,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
85
85
|
y2="1.5"
|
|
86
86
|
id="Line-8-Copy-12"
|
|
87
87
|
stroke="#D4D4D4"
|
|
88
|
-
|
|
88
|
+
strokeLinejoin="round"
|
|
89
89
|
/>
|
|
90
90
|
<line
|
|
91
91
|
x1="550"
|
|
@@ -94,7 +94,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
94
94
|
y2="1.5"
|
|
95
95
|
id="Line-8-Copy-13"
|
|
96
96
|
stroke="#D4D4D4"
|
|
97
|
-
|
|
97
|
+
strokeLinejoin="round"
|
|
98
98
|
/>
|
|
99
99
|
<line
|
|
100
100
|
x1="245"
|
|
@@ -103,8 +103,8 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
103
103
|
y2="1.5"
|
|
104
104
|
id="Line-8-Copy-11"
|
|
105
105
|
stroke="#D4D4D4"
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
strokeWidth="3"
|
|
107
|
+
strokeLinejoin="round"
|
|
108
108
|
/>
|
|
109
109
|
<line x1="560" y1="1.5" x2="572" y2="1.5" id="Line-8-Copy-6" stroke="#A8A7A7" />
|
|
110
110
|
</g>
|
|
@@ -112,7 +112,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
112
112
|
<g id="Group-7" transform="translate(0.000000, 139.000000)" stroke="#2D2B2B">
|
|
113
113
|
<g id="Group-2" transform="translate(110.000000, 64.799664)">
|
|
114
114
|
<circle id="Oval" fill="#2D2B2B" cx="41.5" cy="53.5" r="3.5" />
|
|
115
|
-
<g id="Group"
|
|
115
|
+
<g id="Group" strokeLinecap="round">
|
|
116
116
|
<g id="Group-3" transform="translate(0.479185, 0.479185)">
|
|
117
117
|
<line
|
|
118
118
|
x1="-1.14563404"
|
|
@@ -151,7 +151,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
151
151
|
</g>
|
|
152
152
|
</g>
|
|
153
153
|
</g>
|
|
154
|
-
<g id="Group-15"
|
|
154
|
+
<g id="Group-15" strokeLinecap="round">
|
|
155
155
|
<path
|
|
156
156
|
d="M12,4.26325641e-14 L288.023484,4.26325641e-14 C294.650901,3.96387706e-14 300.023484,5.372583 300.023484,12 L300.023484,153.220226 L300.023484,153.220226 L-3.97903932e-13,153.220226 L-3.97903932e-13,12 C-4.00491913e-13,5.372583 5.372583,4.20736441e-14 12,4.26325641e-14 Z"
|
|
157
157
|
id="Rectangle"
|
|
@@ -161,7 +161,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
161
161
|
id="Rectangle-Copy-3"
|
|
162
162
|
/>
|
|
163
163
|
</g>
|
|
164
|
-
<g id="Group-23" transform="translate(110.090476, 179.195289)"
|
|
164
|
+
<g id="Group-23" transform="translate(110.090476, 179.195289)" strokeLinecap="round">
|
|
165
165
|
<g id="Group-22">
|
|
166
166
|
<rect id="Rectangle" x="24" y="0.339622642" width="32" height="42" />
|
|
167
167
|
<rect
|
|
@@ -205,7 +205,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
205
205
|
x2="298.768563"
|
|
206
206
|
y2="20.2493691"
|
|
207
207
|
id="Line-Copy-2"
|
|
208
|
-
|
|
208
|
+
strokeLinecap="round"
|
|
209
209
|
/>
|
|
210
210
|
</g>
|
|
211
211
|
<g id="Group-12-Copy" transform="translate(446.119654, 224.237839)">
|
|
@@ -251,13 +251,13 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
251
251
|
d="M57.880346,67.5369449 C38.9408126,74.1814305 0.159841768,74.5285405 0.159841768,37.3246409 C1.35555104,22.0427524 33.6341456,26.192421 40.1414615,26.192421 C46.6487775,26.192421 62.6014465,30.7058259 70.535254,30.7058259 C78.4690614,30.7058259 62.6014465,18.8373312 70.535254,3.95074746 C73.3002735,-2.24633295 76.4153041,-0.444383806 79.880346,9.35659488"
|
|
252
252
|
id="Path-42"
|
|
253
253
|
stroke="#2D2B2B"
|
|
254
|
-
|
|
254
|
+
strokeLinecap="round"
|
|
255
255
|
/>
|
|
256
256
|
<path
|
|
257
257
|
d="M83.3843933,28.0967511 C78.6990518,18.3415279 80.5259955,9.09259547 88.8652243,0.349953887 C97.6219004,-3.69874926 101.730766,28.0967511 101.730766,58.7621614 C104.19468,74.3896189 115.391837,80.1938166 132.042878,97.891113 C154.421962,124.198633 153.21582,157.738198 136.445274,171.921811 C128.177642,178.359007 83.3843933,173.389881 72.5010672,174.806475 C61.6177411,176.22307 63.880346,167.490305 69.9178111,163.241646 C75.9552761,158.992986 83.615842,163.43591 86.3761751,157.157207 C89.1365081,150.878504 79.880346,125.084895 101.730766,105.449223"
|
|
258
258
|
id="Path-43"
|
|
259
259
|
stroke="#2D2B2B"
|
|
260
|
-
|
|
260
|
+
strokeLinecap="round"
|
|
261
261
|
/>
|
|
262
262
|
<path
|
|
263
263
|
d="M0.159841768,40.0319085 C1.45898037,34.5592927 3.28782305,31.3102396 5.64636981,30.2847495 C6.49004216,29.9179229 11.2404186,28.2135424 12.131247,28.0967511 C14.4649583,37.2514914 7.09664695,40.6483281 2.81130343,40.9621489 C0.490203836,41.8714293 -0.393616719,41.5613492 0.159841768,40.0319085 Z"
|
|
@@ -271,7 +271,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
271
271
|
id="Path-47"
|
|
272
272
|
stroke="#2D2B2B"
|
|
273
273
|
fill="#F5F5F5"
|
|
274
|
-
|
|
274
|
+
strokeLinecap="round"
|
|
275
275
|
/>
|
|
276
276
|
<path
|
|
277
277
|
d="M145.943375,153.047021 C146.721054,153.205985 147.315607,153.289058 147.727034,153.29624 C148.138461,153.303421 148.640232,153.303421 149.232346,153.29624 L147.623459,159.230069 C146.767427,159.452105 145.998949,159.55718 145.318026,159.545295 C144.637102,159.533409 144.051269,159.458028 143.560527,159.319151 L145.943375,153.047021 Z"
|
|
@@ -284,14 +284,14 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
284
284
|
d="M190,368.487294 L234.238468,368.487294 C239.314319,369.290012 245.614592,367.654648 253.139286,363.581201 C264.426327,357.471032 267.858415,368.487294 277.858415,368.487294 C284.525082,368.487294 290.564169,368.487294 295.975677,368.487294 C308.105846,367.752847 318.818393,364.898703 328.113318,359.924862 C337.408243,354.951021 346.885938,356.1698 356.546405,363.581201 C363.362552,366.85193 373.370179,368.487294 386.569285,368.487294 C399.768392,368.487294 405.050452,368.487294 402.415465,368.487294 C421.922996,370.753312 431.676762,356.969067 431.676762,327.13456 C435.09453,283.738068 431.354405,251.489375 454.391603,251 C465.05827,251 469.927735,262.333333 469,285"
|
|
285
285
|
id="Path-40"
|
|
286
286
|
stroke="#2D2B2B"
|
|
287
|
-
|
|
287
|
+
strokeLinecap="round"
|
|
288
288
|
/>
|
|
289
289
|
<g id="Group-11" transform="translate(335.000000, 248.000000)" stroke="#2D2B2B">
|
|
290
|
-
<rect id="Rectangle"
|
|
290
|
+
<rect id="Rectangle" strokeLinecap="round" x="0" y="0" width="53" height="55" rx="11" />
|
|
291
291
|
<rect
|
|
292
292
|
id="Rectangle-Copy"
|
|
293
293
|
fill="#D8D8D8"
|
|
294
|
-
|
|
294
|
+
strokeLinecap="round"
|
|
295
295
|
x="9"
|
|
296
296
|
y="10"
|
|
297
297
|
width="35"
|
|
@@ -309,7 +309,7 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
309
309
|
opacity="0.292457217"
|
|
310
310
|
transform="translate(666.000000, 175.000000)"
|
|
311
311
|
stroke="#2D2B2B"
|
|
312
|
-
|
|
312
|
+
strokeLinecap="round"
|
|
313
313
|
>
|
|
314
314
|
<g id="Group-10" transform="translate(0.210927, 0.216768)">
|
|
315
315
|
<path
|
|
@@ -375,13 +375,13 @@ export const pageNotLoadedWithSVG = () => {
|
|
|
375
375
|
</g>
|
|
376
376
|
</g>
|
|
377
377
|
</g>
|
|
378
|
-
<g id="Group-4" transform="translate(510.000000, 285.000000)" stroke="#2D2B2B"
|
|
378
|
+
<g id="Group-4" transform="translate(510.000000, 285.000000)" stroke="#2D2B2B" strokeLinecap="round">
|
|
379
379
|
<path
|
|
380
380
|
d="M0.140579809,20 L15.7942732,20 C16.7811299,6.66666667 14.217576,0 8.10361158,0 C1.98964714,0 -0.664696781,6.66666667 0.140579809,20 Z"
|
|
381
381
|
id="Path-41"
|
|
382
382
|
fill="#D8D8D8"
|
|
383
383
|
/>
|
|
384
|
-
<g id="Group-5" transform="translate(4.000000, 19.000000)"
|
|
384
|
+
<g id="Group-5" transform="translate(4.000000, 19.000000)" strokeWidth="2">
|
|
385
385
|
<line x1="1" y1="1.997831" x2="1" y2="8.875" id="Line-2" />
|
|
386
386
|
<line x1="8" y1="1.997831" x2="8" y2="8.875" id="Line-2-Copy" />
|
|
387
387
|
</g>
|
|
@@ -3,8 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Text, Caption } from '@/index';
|
|
4
4
|
import { BaseProps, extractBaseProps } from '@/utils/types';
|
|
5
5
|
import FileIcon from './FileIcon';
|
|
6
|
-
|
|
7
|
-
export type FileStatus = 'uploading' | 'completed' | 'error';
|
|
6
|
+
import { FileStatus } from '@/common.type';
|
|
8
7
|
|
|
9
8
|
export interface FileObject extends BaseProps, Record<string, any> {
|
|
10
9
|
/**
|
|
@@ -3,8 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Text, Caption, Button } from '@/index';
|
|
4
4
|
import { BaseProps, extractBaseProps } from '@/utils/types';
|
|
5
5
|
import FileUploaderStatus from './FileUploaderStatus';
|
|
6
|
-
|
|
7
|
-
export type FileStatus = 'uploading' | 'completed' | 'error';
|
|
6
|
+
import { FileStatus } from '@/common.type';
|
|
8
7
|
|
|
9
8
|
export interface FileItem {
|
|
10
9
|
/**
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { FileUploaderProps, FileUploaderListProps } from '@/index.type';
|
|
2
2
|
|
|
3
|
+
// TODO(eslint): Fix this
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3
5
|
export const FileUploaderComponent = (_props: FileUploaderProps) => {};
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
4
7
|
export const FileUploaderListComponent = (_props: FileUploaderListProps) => {};
|
|
@@ -1,233 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { text, boolean } from '@storybook/addon-knobs';
|
|
3
|
-
import { FileUploader, FileUploaderList, Link } from '@/index';
|
|
4
|
-
import { FileUploaderComponent, FileUploaderListComponent } from './_common_/types';
|
|
5
|
-
import { FileItem } from '../FileUploaderItem';
|
|
6
2
|
|
|
7
|
-
export const all = () =>
|
|
8
|
-
const [fileNames, setFileNames] = React.useState<FileItem[]>([]);
|
|
9
|
-
const [errorOccured, setErrorOccured] = React.useState(false);
|
|
10
|
-
|
|
11
|
-
const title = text('title', 'Upload files');
|
|
12
|
-
const formatLabel = text('formatLabel', 'Accepted formats: pdf, jpg, jpeg, png');
|
|
13
|
-
const sizeLabel = text('sizeLabel', 'Maximum size: 25 MB');
|
|
14
|
-
const multiple = boolean('multiple', true);
|
|
15
|
-
|
|
16
|
-
const randomBetween = (value: number) => Math.round(Math.random() * value);
|
|
17
|
-
|
|
18
|
-
const imitateUploading = (fileItem: FileItem) => {
|
|
19
|
-
const randomProgressChunks = [5, 8, 13];
|
|
20
|
-
const randomChunkIndex = randomBetween(randomProgressChunks.length - 1);
|
|
21
|
-
const progressChunk = randomProgressChunks[randomChunkIndex];
|
|
22
|
-
let baseProgress = fileItem.progress || 0;
|
|
23
|
-
|
|
24
|
-
const increment = () => {
|
|
25
|
-
baseProgress += progressChunk;
|
|
26
|
-
setProgressFileName(fileItem, baseProgress);
|
|
27
|
-
|
|
28
|
-
if (baseProgress < 100) {
|
|
29
|
-
setTimeout(() => increment(), 100);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
increment();
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const setProgressFileName = (fileName: FileItem, progress = 0) => {
|
|
37
|
-
setFileNames((previousFileNames) => {
|
|
38
|
-
const fileNameIndex = previousFileNames.findIndex((fn) => fn.file === fileName.file);
|
|
39
|
-
|
|
40
|
-
if (fileNameIndex === -1) {
|
|
41
|
-
return [...previousFileNames, fileName];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return previousFileNames.map((previousFileName, index) => {
|
|
45
|
-
if (fileNameIndex !== index) return previousFileName;
|
|
46
|
-
|
|
47
|
-
return {
|
|
48
|
-
...previousFileName,
|
|
49
|
-
progress,
|
|
50
|
-
status: progress >= 100 ? 'completed' : 'uploading',
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const uploadFiles = (fileList: File[]) => {
|
|
57
|
-
if (!errorOccured && (fileList.length > 1 || fileNames.length > 0)) {
|
|
58
|
-
const randomErrorIndex = randomBetween(fileList.length - 1);
|
|
59
|
-
setFileNames((previousFileNames) => [
|
|
60
|
-
...previousFileNames,
|
|
61
|
-
{ file: fileList[randomErrorIndex], status: 'error' },
|
|
62
|
-
]);
|
|
63
|
-
setErrorOccured(true);
|
|
64
|
-
|
|
65
|
-
if (fileList.length <= 1) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
fileList.splice(randomErrorIndex, 1);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
fileList.forEach((file) => {
|
|
73
|
-
const fileItem: FileItem = {
|
|
74
|
-
file,
|
|
75
|
-
status: 'uploading',
|
|
76
|
-
progress: 0,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
imitateUploading(fileItem);
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const retryUploadFile = (file: File) => {
|
|
84
|
-
uploadFiles([file]);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const deleteUploadedFile = (file: File) => {
|
|
88
|
-
setFileNames((previousFileNames) => previousFileNames.filter((fileName) => fileName.file !== file));
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
return (
|
|
92
|
-
<div>
|
|
93
|
-
<FileUploader
|
|
94
|
-
onChange={uploadFiles}
|
|
95
|
-
multiple={multiple}
|
|
96
|
-
title={title}
|
|
97
|
-
formatLabel={formatLabel}
|
|
98
|
-
sizeLabel={sizeLabel}
|
|
99
|
-
accept={['image/png', 'application/pdf', 'image/jpeg']}
|
|
100
|
-
sampleFileLink={
|
|
101
|
-
<Link
|
|
102
|
-
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
103
|
-
download="Test.pdf"
|
|
104
|
-
target="_blank"
|
|
105
|
-
>
|
|
106
|
-
Download sample file
|
|
107
|
-
</Link>
|
|
108
|
-
}
|
|
109
|
-
/>
|
|
110
|
-
<FileUploaderList onDelete={deleteUploadedFile} onRetry={retryUploadFile} fileList={fileNames} className="mt-4" />
|
|
111
|
-
</div>
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const customCode = `() => {
|
|
116
|
-
const [fileNames, setFileNames] = React.useState([]);
|
|
117
|
-
const [errorOccured, setErrorOccured] = React.useState(false);
|
|
118
|
-
|
|
119
|
-
const randomBetween = (value) => Math.round(Math.random() * value);
|
|
120
|
-
|
|
121
|
-
const imitateUploading = (fileItem) => {
|
|
122
|
-
const randomProgressChunks = [5, 8, 13];
|
|
123
|
-
const randomChunkIndex = randomBetween(randomProgressChunks.length - 1);
|
|
124
|
-
const progressChunk = randomProgressChunks[randomChunkIndex];
|
|
125
|
-
let baseProgress = fileItem.progress || 0;
|
|
126
|
-
|
|
127
|
-
const increment = () => {
|
|
128
|
-
baseProgress += progressChunk;
|
|
129
|
-
setProgressFileName(fileItem, baseProgress);
|
|
130
|
-
|
|
131
|
-
if (baseProgress < 100) {
|
|
132
|
-
setTimeout(() => increment(), 100);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
increment();
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const setProgressFileName = (fileName, progress = 0) => {
|
|
140
|
-
setFileNames((previousFileNames) => {
|
|
141
|
-
const fileNameIndex = previousFileNames.findIndex((fn) => fn.file === fileName.file);
|
|
142
|
-
|
|
143
|
-
if (fileNameIndex === -1) {
|
|
144
|
-
return [...previousFileNames, fileName];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return previousFileNames.map((previousFileName, index) => {
|
|
148
|
-
if (fileNameIndex !== index) return previousFileName;
|
|
149
|
-
|
|
150
|
-
return {
|
|
151
|
-
...previousFileName,
|
|
152
|
-
status: progress >= 100 ? 'completed' : 'uploading',
|
|
153
|
-
progress,
|
|
154
|
-
};
|
|
155
|
-
});
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
const uploadFiles = (fileList) => {
|
|
160
|
-
if ((!errorOccured && (fileList.length > 1 || fileNames.length > 0))) {
|
|
161
|
-
const randomErrorIndex = randomBetween(fileList.length - 1);
|
|
162
|
-
setFileNames((previousFileNames) => [
|
|
163
|
-
...previousFileNames,
|
|
164
|
-
{ file: fileList[randomErrorIndex], status: 'error' },
|
|
165
|
-
]);
|
|
166
|
-
setErrorOccured(true);
|
|
167
|
-
|
|
168
|
-
if (fileList.length <= 1) {
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
fileList.splice(randomErrorIndex, 1);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
fileList.forEach((file) => {
|
|
176
|
-
const fileItem = {
|
|
177
|
-
file,
|
|
178
|
-
status: 'uploading',
|
|
179
|
-
progress: 0,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
imitateUploading(fileItem);
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
const retryUploadFile = (file) => {
|
|
187
|
-
uploadFiles([file]);
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
const deleteUploadedFile = (file) => {
|
|
191
|
-
setFileNames((previousFileNames) => previousFileNames.filter(fileName => fileName.file !== file));
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
return (
|
|
195
|
-
<div>
|
|
196
|
-
<FileUploader
|
|
197
|
-
onChange={uploadFiles}
|
|
198
|
-
multiple
|
|
199
|
-
title="Upload files"
|
|
200
|
-
accept={['image/png', 'application/pdf', 'image/jpeg']}
|
|
201
|
-
formatLabel="Accepted formats: pdf, jpg, jpeg, png"
|
|
202
|
-
sizeLabel="Maximum size: 25 MB"
|
|
203
|
-
sampleFileLink={
|
|
204
|
-
<Link
|
|
205
|
-
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
206
|
-
download="Test.pdf"
|
|
207
|
-
target="_blank"
|
|
208
|
-
>
|
|
209
|
-
Download sample file
|
|
210
|
-
</Link>
|
|
211
|
-
}
|
|
212
|
-
/>
|
|
213
|
-
<FileUploaderList onDelete={deleteUploadedFile} onRetry={retryUploadFile} fileList={fileNames} className="mt-4" />
|
|
214
|
-
</div>
|
|
215
|
-
);
|
|
216
|
-
}`;
|
|
3
|
+
export const all = () => <></>;
|
|
217
4
|
|
|
218
5
|
export default {
|
|
219
6
|
title: 'Components/FileUploader/All',
|
|
220
|
-
component: FileUploader,
|
|
221
7
|
parameters: {
|
|
222
8
|
docs: {
|
|
223
9
|
docPage: {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
components: {
|
|
227
|
-
FileUploader: FileUploaderComponent,
|
|
228
|
-
FileUploaderList: FileUploaderListComponent,
|
|
229
|
-
},
|
|
230
|
-
},
|
|
10
|
+
title: 'FileUploader',
|
|
11
|
+
description: 'FileUploader Component has been Deprecated, please use Dropzone Component instead.',
|
|
231
12
|
},
|
|
232
13
|
},
|
|
233
14
|
},
|
|
@@ -2,24 +2,22 @@ import * as React from 'react';
|
|
|
2
2
|
import * as ReactDOM from 'react-dom';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { BaseProps, extractBaseProps } from '@/utils/types';
|
|
5
|
-
import { OverlayFooter
|
|
5
|
+
import { OverlayFooter } from '@/components/molecules/overlayFooter';
|
|
6
6
|
import { OverlayHeader, OverlayHeaderProps } from '@/components/molecules/overlayHeader';
|
|
7
7
|
import { OverlayBody } from '@/components/molecules/overlayBody';
|
|
8
8
|
import { Row, Column, Button } from '@/index';
|
|
9
9
|
import { ColumnProps } from '@/index.type';
|
|
10
10
|
import { getWrapperElement, getUpdatedZIndex, closeOnEscapeKeypress } from '@/utils/overlayHelper';
|
|
11
11
|
import OverlayManager from '@/utils/OverlayManager';
|
|
12
|
+
import { FooterOptions } from '@/common.type';
|
|
12
13
|
|
|
13
|
-
export type
|
|
14
|
-
type FooterOptions = {
|
|
15
|
-
actions: OverlayFooterProps['actions'];
|
|
16
|
-
};
|
|
14
|
+
export type FullScreenDimension = 'medium' | 'large';
|
|
17
15
|
|
|
18
16
|
export interface FullscreenModalProps extends BaseProps {
|
|
19
17
|
/**
|
|
20
18
|
* Dimension of `Fullscreen Modal`
|
|
21
19
|
*/
|
|
22
|
-
dimension:
|
|
20
|
+
dimension: FullScreenDimension;
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* Handles open/close state
|
|
@@ -121,7 +119,7 @@ class FullscreenModal extends React.Component<FullscreenModalProps, ModalState>
|
|
|
121
119
|
};
|
|
122
120
|
}
|
|
123
121
|
|
|
124
|
-
onOutsideClickHandler = (event:
|
|
122
|
+
onOutsideClickHandler = (event: Event) => {
|
|
125
123
|
OverlayManager.remove(this.modalRef.current);
|
|
126
124
|
|
|
127
125
|
if (this.props.onClose) {
|