@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
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { text } from '@storybook/addon-knobs';
|
|
3
|
-
import { action } from '@storybook/addon-actions';
|
|
4
|
-
import Button from '../../../Button';
|
|
5
|
-
import Text from '@/components/atoms/text';
|
|
6
|
-
|
|
7
|
-
// CSF format story
|
|
8
|
-
export const success = () => {
|
|
9
|
-
const disabled = false;
|
|
10
|
-
const expanded = false;
|
|
11
|
-
const loading = false;
|
|
12
|
-
|
|
13
|
-
const children = text('children', 'Submit');
|
|
14
|
-
|
|
15
|
-
const style = {
|
|
16
|
-
justifyContent: 'space-between',
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div className="d-flex w-25" style={style}>
|
|
21
|
-
<div className="mr-9">
|
|
22
|
-
<Button
|
|
23
|
-
onClick={action('button-clicked')}
|
|
24
|
-
onMouseEnter={action('mouse-enter')}
|
|
25
|
-
onMouseLeave={action('mouse-leave')}
|
|
26
|
-
appearance={'success'}
|
|
27
|
-
size={'regular'}
|
|
28
|
-
expanded={expanded}
|
|
29
|
-
disabled={disabled}
|
|
30
|
-
loading={loading}
|
|
31
|
-
aria-label="Submit form"
|
|
32
|
-
>
|
|
33
|
-
{children}
|
|
34
|
-
</Button>
|
|
35
|
-
<br />
|
|
36
|
-
<Text weight="strong">Default</Text>
|
|
37
|
-
</div>
|
|
38
|
-
<div className="mr-9">
|
|
39
|
-
<Button
|
|
40
|
-
onClick={action('button-clicked')}
|
|
41
|
-
onMouseEnter={action('mouse-enter')}
|
|
42
|
-
onMouseLeave={action('mouse-leave')}
|
|
43
|
-
appearance={'success'}
|
|
44
|
-
size={'regular'}
|
|
45
|
-
expanded={expanded}
|
|
46
|
-
disabled={true}
|
|
47
|
-
loading={loading}
|
|
48
|
-
aria-label="Submit form"
|
|
49
|
-
>
|
|
50
|
-
{children}
|
|
51
|
-
</Button>
|
|
52
|
-
<br />
|
|
53
|
-
<Text weight="strong">Disabled</Text>
|
|
54
|
-
</div>
|
|
55
|
-
<div className="mr-9">
|
|
56
|
-
<Button
|
|
57
|
-
onClick={action('button-clicked')}
|
|
58
|
-
onMouseEnter={action('mouse-enter')}
|
|
59
|
-
onMouseLeave={action('mouse-leave')}
|
|
60
|
-
appearance={'success'}
|
|
61
|
-
size={'regular'}
|
|
62
|
-
expanded={expanded}
|
|
63
|
-
disabled={disabled}
|
|
64
|
-
loading={true}
|
|
65
|
-
aria-label="Loading"
|
|
66
|
-
>
|
|
67
|
-
{''}
|
|
68
|
-
</Button>
|
|
69
|
-
<br />
|
|
70
|
-
<Text weight="strong">Loading</Text>
|
|
71
|
-
</div>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export default {
|
|
77
|
-
title: 'Components/Button/Variants/State/Success',
|
|
78
|
-
component: Button,
|
|
79
|
-
parameters: {
|
|
80
|
-
docs: {
|
|
81
|
-
docPage: {
|
|
82
|
-
title: 'Button',
|
|
83
|
-
a11yProps: `
|
|
84
|
-
**aria-label:** Add \`aria-label='Submit form'\` to describe the action of button
|
|
85
|
-
`,
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Message, Row, Column } from '@/index';
|
|
3
|
-
|
|
4
|
-
// CSF format story
|
|
5
|
-
export const defaultMessage = () => (
|
|
6
|
-
<Row>
|
|
7
|
-
<Column size="4">
|
|
8
|
-
<Message description="Message will be accessible through a password protected link." />
|
|
9
|
-
</Column>
|
|
10
|
-
</Row>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Components/Message/Default Message',
|
|
15
|
-
component: Message,
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Toast } from '@/index';
|
|
3
|
-
|
|
4
|
-
// CSF format story
|
|
5
|
-
export const defaultToast = () => (
|
|
6
|
-
<Toast
|
|
7
|
-
appearance="default"
|
|
8
|
-
title="Assessment has been archived"
|
|
9
|
-
message="You can find the assessment later under the 'Archive' tab."
|
|
10
|
-
/>
|
|
11
|
-
);
|
|
12
|
-
|
|
13
|
-
export default {
|
|
14
|
-
title: 'Components/Toast/Default Toast',
|
|
15
|
-
component: Toast,
|
|
16
|
-
};
|
package/core/components/molecules/dropzone/__stories__/variants/DropzoneWithFileList.story.tsx
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Dropzone, Link, FileList, Button } from '@/index';
|
|
3
|
-
import { DropzoneProps, FileListProps } from '@/index.type';
|
|
4
|
-
|
|
5
|
-
export const dropzoneWithFilelist = () => {
|
|
6
|
-
const [files, setFiles] = React.useState<any>([]);
|
|
7
|
-
const getSize = (size: number) => `${(size / (1024 * 1024)).toFixed(2)} MB`;
|
|
8
|
-
|
|
9
|
-
const onDelete = (id: number) => {
|
|
10
|
-
const updatedFiles = files.filter((file: any) => file.id !== id);
|
|
11
|
-
setFiles(updatedFiles);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const onDropHandler: DropzoneProps['onDrop'] = (_event, acceptedFiles, rejectedFiles) => {
|
|
15
|
-
const acceptedFileArray = acceptedFiles.map((file, id) => ({
|
|
16
|
-
file,
|
|
17
|
-
id: files.length + id,
|
|
18
|
-
fileSize: getSize(file.size),
|
|
19
|
-
networkError: false,
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
const rejectedFilesArray = rejectedFiles.map((fileObj, id) => {
|
|
23
|
-
const { file, errors } = fileObj;
|
|
24
|
-
const errorMessageArray = errors.map((error: any) => error.message);
|
|
25
|
-
return {
|
|
26
|
-
file,
|
|
27
|
-
id: files.length + id,
|
|
28
|
-
fileSize: getSize(file.size),
|
|
29
|
-
status: 'error',
|
|
30
|
-
errorMessage: errorMessageArray.join(' and '),
|
|
31
|
-
networkError: false,
|
|
32
|
-
};
|
|
33
|
-
});
|
|
34
|
-
const updatedFiles = [...files, ...acceptedFileArray, ...rejectedFilesArray];
|
|
35
|
-
setFiles(updatedFiles);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const actionRenderer: FileListProps['actionRenderer'] = (fileItem) => {
|
|
39
|
-
return (
|
|
40
|
-
<React.Fragment>
|
|
41
|
-
{fileItem.networkError && (
|
|
42
|
-
<Button appearance="transparent" icon="refresh" size="regular" className={'cursor-pointer'} />
|
|
43
|
-
)}
|
|
44
|
-
<Button
|
|
45
|
-
appearance="transparent"
|
|
46
|
-
icon="close"
|
|
47
|
-
size="regular"
|
|
48
|
-
onClick={() => onDelete(fileItem.id)}
|
|
49
|
-
className={'cursor-pointer'}
|
|
50
|
-
/>
|
|
51
|
-
</React.Fragment>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<React.Fragment>
|
|
57
|
-
<Dropzone
|
|
58
|
-
accept="image/jpeg, image/png"
|
|
59
|
-
formatLabel="Accepted formats: PDF, jpg"
|
|
60
|
-
sizeLabel="Maximum size: 25 MB"
|
|
61
|
-
multiple={true}
|
|
62
|
-
onDrop={onDropHandler}
|
|
63
|
-
className="mb-5"
|
|
64
|
-
sampleFileLink={
|
|
65
|
-
<Link
|
|
66
|
-
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
67
|
-
download="Test.pdf"
|
|
68
|
-
target="_blank"
|
|
69
|
-
>
|
|
70
|
-
Download sample file
|
|
71
|
-
</Link>
|
|
72
|
-
}
|
|
73
|
-
/>
|
|
74
|
-
<FileList fileList={files} actionRenderer={actionRenderer} />
|
|
75
|
-
</React.Fragment>
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
const customCode = `() => {
|
|
80
|
-
const [files, setFiles] = React.useState([]);
|
|
81
|
-
|
|
82
|
-
const getSize = (size) => (
|
|
83
|
-
\`\${(size / (1024 * 1024)).toFixed(2)} MB\`
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const onDelete = (fileItem) => {
|
|
87
|
-
const updatedFiles = files.filter((file) => file.id !== fileItem.id);
|
|
88
|
-
setFiles(updatedFiles);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const onDropHandler = (event, acceptedFiles, rejectedFiles) => {
|
|
92
|
-
const acceptedFileArray = acceptedFiles.map((file, id) => (
|
|
93
|
-
{
|
|
94
|
-
file,
|
|
95
|
-
id: files.length + id,
|
|
96
|
-
fileSize: getSize(file.size),
|
|
97
|
-
networkError: false,
|
|
98
|
-
}
|
|
99
|
-
));
|
|
100
|
-
|
|
101
|
-
const rejectedFilesArray = rejectedFiles.map((fileObj, id) => {
|
|
102
|
-
const { file, errors } = fileObj;
|
|
103
|
-
const errorMessageArray = errors.map((error) => error.message);
|
|
104
|
-
return {
|
|
105
|
-
file,
|
|
106
|
-
id: files.length + id,
|
|
107
|
-
fileSize: getSize(file.size),
|
|
108
|
-
status: 'error',
|
|
109
|
-
errorMessage: errorMessageArray.join(' and '),
|
|
110
|
-
networkError: false,
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
const updatedFiles = [...files, ...acceptedFileArray, ...rejectedFilesArray];
|
|
114
|
-
setFiles(updatedFiles);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const actionRenderer = (fileItem) => {
|
|
118
|
-
return (
|
|
119
|
-
<React.Fragment>
|
|
120
|
-
{fileItem.networkError && (
|
|
121
|
-
<Button
|
|
122
|
-
appearance="transparent"
|
|
123
|
-
icon="refresh"
|
|
124
|
-
size="regular"
|
|
125
|
-
className={'cursor-pointer'}
|
|
126
|
-
/>
|
|
127
|
-
)}
|
|
128
|
-
<Button
|
|
129
|
-
appearance="transparent"
|
|
130
|
-
icon="close"
|
|
131
|
-
size="regular"
|
|
132
|
-
onClick={() => onDelete(fileItem)}
|
|
133
|
-
className={'cursor-pointer'}
|
|
134
|
-
/>
|
|
135
|
-
</React.Fragment>
|
|
136
|
-
);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
return (
|
|
140
|
-
<React.Fragment>
|
|
141
|
-
<Dropzone
|
|
142
|
-
accept="image/jpeg, image/png"
|
|
143
|
-
formatLabel="Accepted formats: PDF, jpg"
|
|
144
|
-
sizeLabel="Maximum size: 25 MB"
|
|
145
|
-
multiple={true}
|
|
146
|
-
onDrop={onDropHandler}
|
|
147
|
-
className="mb-5"
|
|
148
|
-
sampleFileLink={(
|
|
149
|
-
<Link
|
|
150
|
-
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
151
|
-
download="Test.pdf"
|
|
152
|
-
target="_blank"
|
|
153
|
-
>
|
|
154
|
-
Download sample file
|
|
155
|
-
</Link>
|
|
156
|
-
)}
|
|
157
|
-
/>
|
|
158
|
-
<FileList
|
|
159
|
-
fileList={files}
|
|
160
|
-
actionRenderer={actionRenderer}
|
|
161
|
-
/>
|
|
162
|
-
</React.Fragment>
|
|
163
|
-
);
|
|
164
|
-
}`;
|
|
165
|
-
|
|
166
|
-
export default {
|
|
167
|
-
title: 'Components/Dropzone/Variants/Dropzone With Filelist',
|
|
168
|
-
component: Dropzone,
|
|
169
|
-
parameters: {
|
|
170
|
-
docs: {
|
|
171
|
-
docPage: {
|
|
172
|
-
customCode,
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
};
|
package/core/components/molecules/fileUploader/__stories__/variants/FileUploaderList.story.tsx
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { FileUploaderList } from '@/index';
|
|
3
|
-
import { fileList } from '../_common_/fileList';
|
|
4
|
-
import { action } from '@storybook/addon-actions';
|
|
5
|
-
|
|
6
|
-
export const fileUploaderList = () => {
|
|
7
|
-
const onDelete = (file: File, id: any) => {
|
|
8
|
-
return action(`File Deleted: ${file} at index ${id}`)();
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const onRetry = (file: File, id: any) => {
|
|
12
|
-
return action(`Retry ${file} at index ${id}`)();
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const onClick = (file: File, id: any) => {
|
|
16
|
-
return action(`Clicked ${file} at index ${id}`)();
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<FileUploaderList onClick={onClick} onDelete={onDelete} onRetry={onRetry} fileList={fileList} className="mt-4" />
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const customCode = `() => {
|
|
25
|
-
const expampleFile = {
|
|
26
|
-
name: "_DSC0071.JPG",
|
|
27
|
-
size: 585947,
|
|
28
|
-
type: "image/jpeg",
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const exampleFileList = [
|
|
32
|
-
{
|
|
33
|
-
file: expampleFile,
|
|
34
|
-
status: 'uploading',
|
|
35
|
-
progress: 45,
|
|
36
|
-
id: 1
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
file: expampleFile,
|
|
41
|
-
status: 'completed',
|
|
42
|
-
id: 2
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
file: expampleFile,
|
|
46
|
-
status: 'error',
|
|
47
|
-
errorMessage: 'Network failure',
|
|
48
|
-
id: 3
|
|
49
|
-
}
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
const onDelete = (file, id) => {
|
|
53
|
-
console.log(\`File Deleted: \${file} at index \${id}\`);
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const onRetry = (file, id) => {
|
|
57
|
-
console.log(\`Retry \${file} at index \${id}\`);
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
return (
|
|
61
|
-
<FileUploaderList
|
|
62
|
-
onDelete={onDelete}
|
|
63
|
-
onRetry={onRetry}
|
|
64
|
-
fileList={exampleFileList}
|
|
65
|
-
className="mt-4"
|
|
66
|
-
/>
|
|
67
|
-
);
|
|
68
|
-
}`;
|
|
69
|
-
|
|
70
|
-
export default {
|
|
71
|
-
title: 'Components/FileUploader/File Uploader List',
|
|
72
|
-
component: FileUploaderList,
|
|
73
|
-
parameters: {
|
|
74
|
-
docs: {
|
|
75
|
-
docPage: {
|
|
76
|
-
customCode,
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Type definitions for innovaccer-design-system x.x
|
|
2
|
-
// Project: https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
|
|
3
|
-
// Definitions by: SaniyaGupta <https://github.com/me>
|
|
4
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
-
|
|
6
|
-
/*~ If this module is a UMD module that exposes a global variable 'myLib' when
|
|
7
|
-
*~ loaded outside a module loader environment, declare that global here.
|
|
8
|
-
*~ Otherwise, delete this declaration.
|
|
9
|
-
*/
|
|
10
|
-
export as namespace myLib;
|
|
11
|
-
|
|
12
|
-
/*~ If this module has methods, declare them as functions like so.
|
|
13
|
-
*/
|
|
14
|
-
export function myMethod(a: string): string;
|
|
15
|
-
export function myOtherMethod(a: number): number;
|
|
16
|
-
|
|
17
|
-
/*~ You can declare types that are available via importing the module */
|
|
18
|
-
export interface someType {
|
|
19
|
-
name: string;
|
|
20
|
-
length: number;
|
|
21
|
-
extras?: string[];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/*~ You can declare properties of the module using const, let, or var */
|
|
25
|
-
export const myField: number;
|
|
26
|
-
|
|
27
|
-
/*~ If there are types, properties, or methods inside dotted names
|
|
28
|
-
*~ of the module, declare them inside a 'namespace'.
|
|
29
|
-
*/
|
|
30
|
-
export namespace subProp {
|
|
31
|
-
/*~ For example, given this definition, someone could write:
|
|
32
|
-
*~ import { subProp } from 'yourModule';
|
|
33
|
-
*~ subProp.foo();
|
|
34
|
-
*~ or
|
|
35
|
-
*~ import * as yourMod from 'yourModule';
|
|
36
|
-
*~ yourMod.subProp.foo();
|
|
37
|
-
*/
|
|
38
|
-
function foo(): void;
|
|
39
|
-
}
|
|
File without changes
|