@innovaccer/design-system 2.5.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 +54 -0
- package/.github/workflows/chromatic.yml +5 -0
- package/.github/workflows/main.yml +2 -2
- package/.github/workflows/pull_request.yml +2 -2
- package/.github/workflows/test.yml +1 -1
- package/.husky/commit-msg +4 -0
- package/.prettierrc +2 -2
- package/.storybook/main.js +4 -0
- package/.vscode/settings.json +11 -0
- package/CHANGELOG.md +78 -0
- package/CONTRIBUTING.md +180 -98
- package/commitlint.config.js +1 -0
- package/core/accessibility/utils/index.ts +5 -0
- package/core/accessibility/utils/isEnterKey.ts +5 -0
- package/core/accessibility/utils/isSpaceKey.ts +5 -0
- package/core/accessibility/utils/useAccessibilityProps.ts +33 -0
- package/core/common.type.tsx +22 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +17 -9
- package/core/components/atoms/_chip/index.tsx +19 -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__/Alert.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/Cancel.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconButtonGroup.story.tsx +12 -3
- package/core/components/atoms/button/__stories__/IconButtonSecondary.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/IconLeftSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconRightSecondary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/IconTransparent.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LabelButtonGroup.story.tsx +14 -3
- package/core/components/atoms/button/__stories__/LargeIconExpanded.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/LoadingPrimary.story.tsx +4 -1
- package/core/components/atoms/button/__stories__/Primary.story.tsx +5 -2
- package/core/components/atoms/button/__stories__/SplitButton.story.tsx +6 -1
- package/core/components/atoms/button/__stories__/Transparent.story.tsx +8 -1
- package/core/components/atoms/button/__stories__/index.story.tsx +12 -2
- package/core/components/atoms/button/__stories__/variants/Appearance.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/Expanded.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/Size.story.tsx +4 -0
- package/core/components/atoms/button/__stories__/variants/icon/Icon.story.tsx +15 -0
- package/core/components/atoms/button/__stories__/variants/icon/IconLeft.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/icon/IconRight.story.tsx +6 -2
- package/core/components/atoms/button/__stories__/variants/state/Alert.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Basic.story.tsx +9 -17
- package/core/components/atoms/button/__stories__/variants/state/Primary.story.tsx +7 -17
- package/core/components/atoms/button/__stories__/variants/state/Transparent.story.tsx +13 -17
- 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 +11 -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/collapsible/__tests__/__snapshots__/Collapsible.test.tsx.snap +8 -0
- package/core/components/atoms/divider/Divider.tsx +44 -0
- package/core/components/atoms/divider/__stories__/BasicDividerInCard.story.tsx +74 -0
- package/core/components/atoms/divider/__stories__/HeaderDividerInCard.story.tsx +35 -0
- package/core/components/atoms/divider/__stories__/IndentedDivider.story.tsx +49 -0
- package/core/components/atoms/divider/__stories__/Vertical.story.tsx +51 -0
- package/core/components/atoms/divider/__stories__/index.story.tsx +91 -0
- package/core/components/atoms/divider/__stories__/variants/HorizontalDivider.story.tsx +27 -0
- package/core/components/atoms/divider/__tests__/Divider.test.tsx +50 -0
- package/core/components/atoms/divider/__tests__/__snapshots__/Divider.test.tsx.snap +53 -0
- package/core/components/atoms/divider/index.tsx +2 -0
- 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 +18 -7
- 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 +28 -18
- 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/DefaultOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/IconWithMetaOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/MetaOption.tsx +3 -0
- package/core/components/atoms/dropdown/option/index.tsx +1 -1
- package/core/components/atoms/editable/Editable.tsx +3 -0
- 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 +16 -5
- package/core/components/atoms/icon/__stories__/variants/Image.story.tsx +6 -1
- package/core/components/atoms/icon/__tests__/__snapshots__/Icon.test.tsx.snap +74 -0
- package/core/components/atoms/input/Input.tsx +17 -7
- package/core/components/atoms/input/__stories__/BasicInput.story.tsx +2 -1
- package/core/components/atoms/input/__stories__/InputWithCaption.story.tsx +91 -9
- package/core/components/atoms/input/__stories__/InputWithLabel.story.tsx +11 -3
- package/core/components/atoms/input/__stories__/LabelPosition.story.tsx +46 -4
- package/core/components/atoms/input/__stories__/RequiredVsOptional.story.tsx +12 -8
- 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/input/__tests__/__snapshots__/Input.test.tsx.snap +19 -0
- package/core/components/atoms/label/Label.tsx +1 -1
- package/core/components/atoms/legend/Legend.tsx +5 -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 +17 -7
- package/core/components/atoms/metricInput/__stories__/DefaultMetric.story.tsx +8 -2
- package/core/components/atoms/metricInput/__stories__/WithPrefix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/metricInput/__stories__/variants/Controlled.story.tsx +2 -0
- package/core/components/atoms/metricInput/__stories__/variants/Size.story.tsx +2 -2
- package/core/components/atoms/metricInput/__stories__/withSuffix.story.tsx +6 -2
- package/core/components/atoms/metricInput/__tests__/__snapshots__/MetricInput.test.tsx.snap +20 -4
- package/core/components/atoms/multiSlider/Handle.tsx +3 -0
- package/core/components/atoms/multiSlider/SliderUtils.tsx +1 -4
- package/core/components/atoms/multiSlider/index.tsx +9 -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 +5 -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 +14 -9
- package/core/components/atoms/switchInput/__stories__/DefaultSwitch.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/OffState.story.tsx +4 -1
- package/core/components/atoms/switchInput/__stories__/index.story.tsx +26 -3
- package/core/components/atoms/switchInput/__stories__/variants/Size.story.tsx +10 -1
- package/core/components/atoms/switchInput/__stories__/variants/State.story.tsx +9 -2
- 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/textarea/__stories__/TextareaWithCaption.story.tsx +9 -3
- package/core/components/atoms/textarea/__stories__/defaultTextarea.story.tsx +10 -2
- package/core/components/atoms/textarea/__stories__/index.story.tsx +1 -0
- package/core/components/atoms/textarea/__stories__/variants/Disable.story.tsx +1 -0
- 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 +24 -125
- package/core/components/css-utilities/Schema.tsx +1 -1
- package/core/components/css-utilities/Spacing/Schema.tsx +1 -1
- package/core/components/molecules/chatMessage/Box.tsx +3 -0
- package/core/components/molecules/chipInput/ChipInput.tsx +3 -0
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +14 -2
- package/core/components/molecules/dropzone/Dropzone.tsx +6 -3
- package/core/components/molecules/dropzone/DropzoneBase.tsx +22 -38
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +1 -1
- 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/EditableChipInput.tsx +9 -5
- package/core/components/molecules/editableChipInput/__stories__/Uncontrolled.story.tsx +1 -1
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +12 -4
- package/core/components/molecules/editableDropdown/EditableDropdown.tsx +2 -2
- package/core/components/molecules/editableInput/EditableInput.tsx +13 -4
- package/core/components/molecules/emptyState/EmptyState.tsx +9 -5
- package/core/components/molecules/emptyState/__stories__/pageNotLoadedWithSVG.story.tsx +26 -26
- package/core/components/molecules/fileList/FileListItem.tsx +3 -2
- package/core/components/molecules/fileUploader/FileUploaderItem.tsx +3 -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/inputMask/__tests__/__snapshots__/InputMask.test.tsx.snap +1 -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/pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +5 -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/stepper/Step.tsx +2 -0
- package/core/components/molecules/tabs/Tabs.tsx +2 -0
- package/core/components/molecules/tabs/TabsWrapper.tsx +2 -0
- package/core/components/molecules/tabs/__stories__/CustomLabels.story.tsx +1 -1
- package/core/components/molecules/tooltip/Tooltip.tsx +4 -4
- package/core/components/molecules/verificationCodeInput/VerificationCodeInput.tsx +8 -4
- package/core/components/molecules/verificationCodeInput/__stories__/index.story.tsx +3 -1
- package/core/components/molecules/verificationCodeInput/__tests__/__snapshots__/VerificationCodeInput.test.tsx.snap +1 -0
- package/core/components/organisms/calendar/Calendar.tsx +130 -8
- package/core/components/organisms/calendar/__stories__/variants/firstDayOfWeek.story.tsx +2 -2
- package/core/components/organisms/calendar/__tests__/Calendar.test.tsx +27 -0
- package/core/components/organisms/calendar/utility.ts +3 -3
- package/core/components/organisms/choiceList/ChoiceList.tsx +12 -12
- package/core/components/organisms/datePicker/DatePicker.tsx +31 -16
- package/core/components/organisms/datePicker/Trigger.tsx +1 -5
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +4518 -4479
- 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 +112 -40
- package/core/components/organisms/grid/Cell.tsx +23 -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/GridRow.tsx +4 -0
- package/core/components/organisms/grid/__stories__/_common_/editableSchema.tsx +1 -3
- package/core/components/organisms/grid/__stories__/_common_/fetchData.ts +3 -3
- 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/horizontalNav/HorizontalNav.tsx +2 -0
- package/core/components/organisms/inlineMessage/InlineMessage.tsx +5 -7
- package/core/components/organisms/inlineMessage/__tests__/InlineMessage.test.tsx +3 -2
- package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap +30 -40
- 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/navigation/VerticalNavigation.tsx +4 -0
- package/core/components/organisms/table/Table.tsx +3 -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 +4 -3
- package/core/components/organisms/table/__stories__/Selection.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/StandardTable.story.tsx +1 -1
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.tsx +2 -2
- package/core/components/organisms/table/__stories__/TableAsOptionList.story.tsx +2 -2
- 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__/syncTable.story.tsx +14 -6
- 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/withHeader.story.tsx +0 -2
- package/core/components/organisms/table/__stories__/variants/withPagination.story.tsx +2 -2
- package/core/components/organisms/timePicker/TimePicker.tsx +4 -8
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePicker.test.tsx.snap +14 -2
- package/core/components/organisms/verticalNav/MenuItem.tsx +2 -0
- package/core/components/organisms/verticalNav/__stories__/schema.tsx +0 -2
- package/core/components/organisms/verticalNav/__tests__/VerticalNav.test.tsx +1 -2
- package/core/components/patterns/datePicker/datePickerWithPresets.story.tsx +126 -0
- package/core/components/patterns/dateRangePicker/withCustomPopover.story.tsx +8 -8
- package/core/components/patterns/forms/CreatePassword.story.tsx +1 -1
- package/core/components/patterns/forms/VerificationCodeInput.story.tsx +2 -2
- package/core/components/patterns/table/Table with Header/tableWithHeader.story.jsx +7 -7
- package/core/global.d.ts +9 -0
- package/core/index.tsx +2 -1
- package/core/index.type.tsx +1 -0
- package/core/utils/Keys.ts +4 -0
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +562 -541
- package/core/utils/docPage/generateImports.tsx +2 -3
- package/core/utils/docPage/index.tsx +52 -37
- package/core/utils/docPage/sandbox.tsx +14 -7
- package/core/utils/overlayHelper.ts +7 -3
- package/core/utils/testHelper.ts +2 -2
- package/core/utils/types.tsx +1 -1
- package/core/utils/validators.ts +37 -34
- package/css/dist/index.css +1550 -1415
- package/css/dist/index.css.map +1 -1
- package/css/src/components/Legend.css +7 -7
- package/css/src/components/ProgressBar.css +1 -1
- package/css/src/components/avatarGroup.css +1 -1
- package/css/src/components/backdrop.css +12 -6
- package/css/src/components/badge.css +52 -52
- package/css/src/components/button.css +95 -94
- package/css/src/components/calendar.css +137 -126
- package/css/src/components/card.css +0 -1
- package/css/src/components/cardSubdued.css +3 -5
- package/css/src/components/chat.css +1 -1
- package/css/src/components/checkbox.css +71 -70
- package/css/src/components/chip.css +20 -17
- package/css/src/components/chipGroup.css +5 -5
- package/css/src/components/chipInput.css +1 -1
- package/css/src/components/choiceList.css +4 -4
- package/css/src/components/dateRangePicker.css +13 -13
- package/css/src/components/divider.css +20 -0
- package/css/src/components/dropdown.css +61 -61
- package/css/src/components/dropdownButton.css +36 -36
- package/css/src/components/dropzone.css +16 -20
- package/css/src/components/editableChipInput.css +10 -9
- package/css/src/components/editableDropdown.css +1 -1
- package/css/src/components/editableInput.css +1 -1
- package/css/src/components/emptyState.css +15 -15
- package/css/src/components/fileList.css +44 -45
- package/css/src/components/fullscreenModal.css +4 -3
- package/css/src/components/grid.css +217 -199
- package/css/src/components/horizontalNav.css +0 -1
- package/css/src/components/icon.css +1 -7
- package/css/src/components/inlineMessage.css +2 -1
- package/css/src/components/input.css +62 -62
- package/css/src/components/link.css +1 -1
- package/css/src/components/list.css +10 -10
- package/css/src/components/message.css +64 -70
- package/css/src/components/metaList.css +26 -26
- package/css/src/components/metricInput.css +3 -4
- package/css/src/components/modal.css +1 -1
- package/css/src/components/navigation.css +3 -3
- package/css/src/components/pageHeader.css +1 -2
- package/css/src/components/pagination.css +36 -36
- package/css/src/components/pills.css +19 -19
- package/css/src/components/placeholder.css +10 -5
- package/css/src/components/popover.css +2 -2
- package/css/src/components/progressRing.css +1 -1
- package/css/src/components/radio.css +74 -74
- package/css/src/components/slider.css +5 -5
- package/css/src/components/statusHints.css +15 -15
- package/css/src/components/switch.css +66 -41
- package/css/src/components/table.css +15 -15
- package/css/src/components/tabs.css +53 -53
- package/css/src/components/textarea.css +1 -1
- package/css/src/components/toast.css +51 -56
- package/css/src/components/verificationCodeInput.css +5 -6
- package/css/src/components/verticalNav.css +1 -2
- package/css/src/core/base.css +3 -0
- package/css/src/core/typography.css +1 -1
- package/css/src/core/utilities.css +1 -1
- package/css/src/tokens/index.css +63 -63
- package/css/src/utils/align.css +1 -1
- package/css/src/utils/background.css +1 -1
- package/css/src/utils/cursor.css +1 -1
- package/css/src/utils/display.css +1 -1
- package/css/src/utils/flex.css +1 -1
- package/css/src/utils/grid.css +1 -1
- package/css/src/utils/overflow.css +1 -1
- package/css/src/utils/position.css +1 -1
- package/css/src/utils/spacing.css +1 -1
- package/css/src/utils/utility.css +13 -13
- package/css/src/variables/index.css +6 -3
- package/dist/core/accessibility/utils/index.d.ts +4 -0
- package/dist/core/accessibility/utils/isEnterKey.d.ts +3 -0
- package/dist/core/accessibility/utils/isSpaceKey.d.ts +3 -0
- package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +18 -0
- 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/divider/Divider.d.ts +15 -0
- package/dist/core/components/atoms/divider/index.d.ts +2 -0
- 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 +5 -3
- package/dist/core/components/atoms/input/Input.d.ts +4 -4
- 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 +51 -51
- 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 +7 -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/calendar/Calendar.d.ts +31 -0
- package/dist/core/components/organisms/choiceList/ChoiceList.d.ts +5 -6
- package/dist/core/components/organisms/datePicker/DatePicker.d.ts +2 -0
- 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/datePicker/datePickerWithPresets.story.d.ts +15 -0
- package/dist/core/components/patterns/dateRangePicker/withCustomPopover.story.d.ts +5 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.type.d.ts +1 -0
- 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 +1039 -729
- package/dist/index.js +532 -371
- 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 +32 -27
- 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/.husky/prepare-commit-msg +0 -6
- package/core/components/atoms/button/__stories__/variants/state/Success.story.tsx +0 -99
- 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/tslint.json +0 -30
- package/types/innovaccer-design-system/index.d.ts +0 -39
- package/types/innovaccer-design-system/innovaccer-design-system-tests.ts +0 -0
|
@@ -1,57 +1,167 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Dropzone, Link } from '@/index';
|
|
3
|
-
import {
|
|
4
|
-
import { action } from '@storybook/addon-actions';
|
|
5
|
-
import { DropzoneProps } from '@/index.type';
|
|
2
|
+
import { Dropzone, Link, FileList, Button } from '@/index';
|
|
3
|
+
import { DropzoneProps, FileListProps } from '@/index.type';
|
|
6
4
|
|
|
7
5
|
export const all = () => {
|
|
8
|
-
const
|
|
6
|
+
const [files, setFiles] = React.useState<FileListProps['fileList']>([]);
|
|
7
|
+
const getSize = (size: number) => `${(size / (1024 * 1024)).toFixed(2)} MB`;
|
|
9
8
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const onDelete = (id: number) => {
|
|
10
|
+
const updatedFiles = files.filter((file) => file.id !== id);
|
|
11
|
+
setFiles(updatedFiles);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const onDropHandler: DropzoneProps['onDrop'] = (_event, acceptedFiles, rejectedFiles) => {
|
|
15
|
+
const acceptedFileDetailList: FileListProps['fileList'] = acceptedFiles.map((file, id) => ({
|
|
16
|
+
file,
|
|
17
|
+
id: files.length + id,
|
|
18
|
+
fileSize: getSize(file.size),
|
|
19
|
+
networkError: false,
|
|
20
|
+
status: 'completed',
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
const rejectedFilesDetailList: FileListProps['fileList'] = rejectedFiles.map((rejectedFile, id) => {
|
|
24
|
+
const { file, errors } = rejectedFile;
|
|
25
|
+
const errorMessageArray = errors.map((error) => error.message);
|
|
26
|
+
return {
|
|
27
|
+
file,
|
|
28
|
+
id: files.length + id,
|
|
29
|
+
fileSize: getSize(file.size),
|
|
30
|
+
status: 'error',
|
|
31
|
+
errorMessage: errorMessageArray.join(' and '),
|
|
32
|
+
networkError: false,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const updatedFiles = [...files, ...acceptedFileDetailList, ...rejectedFilesDetailList];
|
|
37
|
+
setFiles(updatedFiles);
|
|
38
|
+
};
|
|
13
39
|
|
|
14
|
-
const
|
|
15
|
-
return
|
|
40
|
+
const actionRenderer: FileListProps['actionRenderer'] = (fileItem) => {
|
|
41
|
+
return (
|
|
42
|
+
<React.Fragment>
|
|
43
|
+
{fileItem.networkError && (
|
|
44
|
+
<Button appearance="transparent" icon="refresh" size="regular" className={'cursor-pointer'} />
|
|
45
|
+
)}
|
|
46
|
+
<Button
|
|
47
|
+
appearance="transparent"
|
|
48
|
+
icon="close"
|
|
49
|
+
size="regular"
|
|
50
|
+
onClick={() => onDelete(fileItem.id)}
|
|
51
|
+
className={'cursor-pointer'}
|
|
52
|
+
/>
|
|
53
|
+
</React.Fragment>
|
|
54
|
+
);
|
|
16
55
|
};
|
|
17
56
|
|
|
18
57
|
return (
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
58
|
+
<React.Fragment>
|
|
59
|
+
<Dropzone
|
|
60
|
+
accept="image/jpeg, image/png"
|
|
61
|
+
formatLabel="Accepted formats: PDF, jpg"
|
|
62
|
+
sizeLabel="Maximum size: 25 MB"
|
|
63
|
+
multiple={true}
|
|
64
|
+
onDrop={onDropHandler}
|
|
65
|
+
className="mb-5"
|
|
66
|
+
sampleFileLink={
|
|
67
|
+
<Link
|
|
68
|
+
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
69
|
+
download="Test.pdf"
|
|
70
|
+
target="_blank"
|
|
71
|
+
>
|
|
72
|
+
Download sample file
|
|
73
|
+
</Link>
|
|
74
|
+
}
|
|
75
|
+
/>
|
|
76
|
+
<FileList fileList={files.map(({ file, metadata }) => ({ file, ...metadata }))} actionRenderer={actionRenderer} />
|
|
77
|
+
</React.Fragment>
|
|
35
78
|
);
|
|
36
79
|
};
|
|
37
80
|
|
|
38
81
|
const customCode = `() => {
|
|
82
|
+
const [files, setFiles] = React.useState([]);
|
|
83
|
+
|
|
84
|
+
const getSize = (size) => (
|
|
85
|
+
\`\${(size / (1024 * 1024)).toFixed(2)} MB\`
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const onDelete = (fileItem) => {
|
|
89
|
+
const updatedFiles = files.filter((file) => file.id !== fileItem.id);
|
|
90
|
+
setFiles(updatedFiles);
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
const onDropHandler = (event, acceptedFiles, rejectedFiles) => {
|
|
94
|
+
const acceptedFileDetailList = acceptedFiles.map((file, id) => (
|
|
95
|
+
{
|
|
96
|
+
file,
|
|
97
|
+
id: files.length + id,
|
|
98
|
+
fileSize: getSize(file.size),
|
|
99
|
+
networkError: false,
|
|
100
|
+
}
|
|
101
|
+
));
|
|
102
|
+
|
|
103
|
+
const rejectedFilesDetailList = rejectedFiles.map((rejectedFile, id) => {
|
|
104
|
+
const { file, errors } = rejectedFile;
|
|
105
|
+
const errorMessageArray = errors.map((error) => error.message);
|
|
106
|
+
return {
|
|
107
|
+
file,
|
|
108
|
+
id: files.length + id,
|
|
109
|
+
fileSize: getSize(file.size),
|
|
110
|
+
status: 'error',
|
|
111
|
+
errorMessage: errorMessageArray.join(' and '),
|
|
112
|
+
networkError: false,
|
|
113
|
+
};
|
|
114
|
+
});
|
|
115
|
+
const updatedFiles = [...files, ...acceptedFileDetailList, ...rejectedFilesDetailList];
|
|
116
|
+
setFiles(updatedFiles);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const actionRenderer = (fileItem) => {
|
|
120
|
+
return (
|
|
121
|
+
<React.Fragment>
|
|
122
|
+
{fileItem.networkError && (
|
|
123
|
+
<Button
|
|
124
|
+
appearance="transparent"
|
|
125
|
+
icon="refresh"
|
|
126
|
+
size="regular"
|
|
127
|
+
className={'cursor-pointer'}
|
|
128
|
+
/>
|
|
129
|
+
)}
|
|
130
|
+
<Button
|
|
131
|
+
appearance="transparent"
|
|
132
|
+
icon="close"
|
|
133
|
+
size="regular"
|
|
134
|
+
onClick={() => onDelete(fileItem)}
|
|
135
|
+
className={'cursor-pointer'}
|
|
136
|
+
/>
|
|
137
|
+
</React.Fragment>
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
39
141
|
return (
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
142
|
+
<React.Fragment>
|
|
143
|
+
<Dropzone
|
|
144
|
+
accept="image/jpeg, image/png"
|
|
145
|
+
formatLabel="Accepted formats: PDF, jpg"
|
|
146
|
+
sizeLabel="Maximum size: 25 MB"
|
|
147
|
+
multiple={true}
|
|
148
|
+
onDrop={onDropHandler}
|
|
149
|
+
className="mb-5"
|
|
150
|
+
sampleFileLink={(
|
|
151
|
+
<Link
|
|
152
|
+
href="http://www.adobe.com/content/dam/Adobe/en/accessibility/pdfs/accessing-pdf-sr.pdf"
|
|
153
|
+
download="Test.pdf"
|
|
154
|
+
target="_blank"
|
|
155
|
+
>
|
|
156
|
+
Download sample file
|
|
157
|
+
</Link>
|
|
158
|
+
)}
|
|
159
|
+
/>
|
|
160
|
+
<FileList
|
|
161
|
+
fileList={files}
|
|
162
|
+
actionRenderer={actionRenderer}
|
|
163
|
+
/>
|
|
164
|
+
</React.Fragment>
|
|
55
165
|
);
|
|
56
166
|
}`;
|
|
57
167
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { render, fireEvent } from '@testing-library/react';
|
|
3
3
|
import { testHelper, filterUndefined, valueHelper, testMessageHelper } from '@/utils/testHelper';
|
|
4
|
-
import Dropzone, { DropzoneProps as Props,
|
|
4
|
+
import Dropzone, { DropzoneProps as Props, DropZoneType } from '../Dropzone';
|
|
5
5
|
import Link from '@/components/atoms/link';
|
|
6
6
|
import DropzoneError from '../DropzoneError';
|
|
7
7
|
import { fromEvent } from '../FileSelectorUtils';
|
|
@@ -29,7 +29,7 @@ const multipleFileData = {
|
|
|
29
29
|
|
|
30
30
|
const minSize = 50;
|
|
31
31
|
const maxSize = 300;
|
|
32
|
-
const types:
|
|
32
|
+
const types: DropZoneType[] = ['standard', 'compressed', 'tight'];
|
|
33
33
|
|
|
34
34
|
describe('Dropzone component snapshot', () => {
|
|
35
35
|
const mapper: Record<string, any> = {
|
|
@@ -48,11 +48,11 @@ export const isEvtWithFiles = (event: any) => {
|
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export const isKindFile = (item:
|
|
51
|
+
export const isKindFile = (item: null | Record<string, unknown>) => {
|
|
52
52
|
return typeof item === 'object' && item !== null && item.kind === 'file';
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
export const onDocumentDragOver = (event:
|
|
55
|
+
export const onDocumentDragOver = (event: DragEvent) => {
|
|
56
56
|
event.preventDefault();
|
|
57
57
|
};
|
|
58
58
|
|
|
@@ -60,8 +60,10 @@ export const isIeOrEdge = (userAgent = window.navigator.userAgent) => {
|
|
|
60
60
|
return isIe(userAgent) || isEdge(userAgent);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
type functype = (event: Event, ...args: unknown[]) => void;
|
|
64
|
+
|
|
65
|
+
export const composeEventHandlers = (...fns: functype[]) => {
|
|
66
|
+
return (event: Event, ...args: unknown[]) =>
|
|
65
67
|
fns.some((fn) => {
|
|
66
68
|
if (!isPropagationStopped(event) && fn) {
|
|
67
69
|
fn(event, ...args);
|
|
@@ -87,13 +87,17 @@ export const EditableChipInput = (props: EditableChipInputProps) => {
|
|
|
87
87
|
|
|
88
88
|
const onChangeHandler = (eventType: string) => {
|
|
89
89
|
switch (eventType) {
|
|
90
|
-
case 'edit':
|
|
90
|
+
case 'edit': {
|
|
91
91
|
setShowComponent(true);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
case '
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
case 'hover': {
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
case 'default': {
|
|
95
98
|
setShowComponent(false);
|
|
96
|
-
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
97
101
|
}
|
|
98
102
|
};
|
|
99
103
|
|
|
@@ -26,7 +26,7 @@ export const uncontrolled = () => {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const customCode = `() => {
|
|
29
|
-
const onClick = (item) => console.log(
|
|
29
|
+
const onClick = (item) => console.log(\`onClick: \${item}\`);
|
|
30
30
|
const chipOptions = { onClick, clearButton: true };
|
|
31
31
|
const chipInputOptions = {
|
|
32
32
|
chipOptions,
|
|
@@ -30,9 +30,11 @@ exports[`EditableChipInput component
|
|
|
30
30
|
Chip1
|
|
31
31
|
</span>
|
|
32
32
|
<i
|
|
33
|
-
class="material-icons material-icons-round Icon
|
|
33
|
+
class="material-icons material-icons-round Icon Chip-icon Chip-icon--right cursor-pointer"
|
|
34
34
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
35
|
+
role="button"
|
|
35
36
|
style="font-size: 16px; width: 16px;"
|
|
37
|
+
tabindex="0"
|
|
36
38
|
>
|
|
37
39
|
clear_round
|
|
38
40
|
</i>
|
|
@@ -48,9 +50,11 @@ exports[`EditableChipInput component
|
|
|
48
50
|
Chip2
|
|
49
51
|
</span>
|
|
50
52
|
<i
|
|
51
|
-
class="material-icons material-icons-round Icon
|
|
53
|
+
class="material-icons material-icons-round Icon Chip-icon Chip-icon--right cursor-pointer"
|
|
52
54
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
55
|
+
role="button"
|
|
53
56
|
style="font-size: 16px; width: 16px;"
|
|
57
|
+
tabindex="0"
|
|
54
58
|
>
|
|
55
59
|
clear_round
|
|
56
60
|
</i>
|
|
@@ -92,9 +96,11 @@ exports[`EditableChipInput component
|
|
|
92
96
|
Chip1
|
|
93
97
|
</span>
|
|
94
98
|
<i
|
|
95
|
-
class="material-icons material-icons-round Icon
|
|
99
|
+
class="material-icons material-icons-round Icon Chip-icon Chip-icon--right cursor-pointer"
|
|
96
100
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
101
|
+
role="button"
|
|
97
102
|
style="font-size: 16px; width: 16px;"
|
|
103
|
+
tabindex="0"
|
|
98
104
|
>
|
|
99
105
|
clear_round
|
|
100
106
|
</i>
|
|
@@ -110,9 +116,11 @@ exports[`EditableChipInput component
|
|
|
110
116
|
Chip2
|
|
111
117
|
</span>
|
|
112
118
|
<i
|
|
113
|
-
class="material-icons material-icons-round Icon
|
|
119
|
+
class="material-icons material-icons-round Icon Chip-icon Chip-icon--right cursor-pointer"
|
|
114
120
|
data-test="DesignSystem-GenericChip--clearButton"
|
|
121
|
+
role="button"
|
|
115
122
|
style="font-size: 16px; width: 16px;"
|
|
123
|
+
tabindex="0"
|
|
116
124
|
>
|
|
117
125
|
clear_round
|
|
118
126
|
</i>
|
|
@@ -57,12 +57,12 @@ export const EditableDropdown = (props: EditableDropdownProps) => {
|
|
|
57
57
|
switch (eventType) {
|
|
58
58
|
case 'edit':
|
|
59
59
|
setEditing(true);
|
|
60
|
+
break;
|
|
60
61
|
case 'hover':
|
|
61
62
|
setShowComponent(true);
|
|
62
|
-
|
|
63
|
+
break;
|
|
63
64
|
case 'default':
|
|
64
65
|
setShowComponent(false);
|
|
65
|
-
return;
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
@@ -98,14 +98,19 @@ export const EditableInput = (props: EditableInputProps) => {
|
|
|
98
98
|
|
|
99
99
|
const onChangeHandler = (eventType: string) => {
|
|
100
100
|
switch (eventType) {
|
|
101
|
-
case 'edit':
|
|
101
|
+
case 'edit': {
|
|
102
102
|
inputRef.current?.focus();
|
|
103
103
|
setEditing(true);
|
|
104
|
-
case 'hover':
|
|
105
104
|
setShowComponent(true);
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
case 'hover': {
|
|
108
|
+
setShowComponent(true);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case 'default': {
|
|
108
112
|
setShowComponent(false);
|
|
113
|
+
}
|
|
109
114
|
}
|
|
110
115
|
};
|
|
111
116
|
|
|
@@ -114,6 +119,8 @@ export const EditableInput = (props: EditableInputProps) => {
|
|
|
114
119
|
defaultValue={inputValue}
|
|
115
120
|
placeholder={placeholder}
|
|
116
121
|
className={InputClass}
|
|
122
|
+
// TODO(a11y)
|
|
123
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
117
124
|
autoFocus={editing}
|
|
118
125
|
size={size}
|
|
119
126
|
onChange={onInputChangeHandler}
|
|
@@ -159,6 +166,8 @@ export const EditableInput = (props: EditableInputProps) => {
|
|
|
159
166
|
};
|
|
160
167
|
|
|
161
168
|
return (
|
|
169
|
+
// TODO(a11y)
|
|
170
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
162
171
|
<div data-test="DesignSystem-EditableInput" {...baseProps} className={EditableInputClass} onKeyDown={onKeyDown}>
|
|
163
172
|
<Editable onChange={onChangeHandler} editing={editing}>
|
|
164
173
|
{renderChildren()}
|
|
@@ -4,7 +4,7 @@ import { HeadingProps, TextProps } from '@/index.type';
|
|
|
4
4
|
import { Heading, Text } from '@/index';
|
|
5
5
|
import { BaseProps, extractBaseProps } from '@/utils/types';
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
type EmptyStateSize = 'large' | 'small';
|
|
8
8
|
|
|
9
9
|
export interface EmptyStateProps extends BaseProps {
|
|
10
10
|
/**
|
|
@@ -24,7 +24,7 @@ export interface EmptyStateProps extends BaseProps {
|
|
|
24
24
|
*
|
|
25
25
|
* Size: 'large' | 'small'
|
|
26
26
|
*/
|
|
27
|
-
size:
|
|
27
|
+
size: EmptyStateSize;
|
|
28
28
|
/**
|
|
29
29
|
* Button / ButtonGroups to be added inside `EmptyState`
|
|
30
30
|
*/
|
|
@@ -40,12 +40,12 @@ export const imageHeight = {
|
|
|
40
40
|
small: '128px',
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const HeadingSize: Record<
|
|
43
|
+
export const HeadingSize: Record<EmptyStateSize, HeadingProps['size']> = {
|
|
44
44
|
large: 'l',
|
|
45
45
|
small: 'm',
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
export const textSize: Record<
|
|
48
|
+
export const textSize: Record<EmptyStateSize, TextProps['size']> = {
|
|
49
49
|
large: 'large',
|
|
50
50
|
small: 'regular',
|
|
51
51
|
};
|
|
@@ -75,7 +75,11 @@ export const EmptyState = (props: EmptyStateProps) => {
|
|
|
75
75
|
return (
|
|
76
76
|
<div data-test="DesignSystem-EmptyState" {...baseProps} className={WrapperClass}>
|
|
77
77
|
{image && <div style={{ height: imageHeight[size] }}>{image}</div>}
|
|
78
|
-
{imageSrc && !image &&
|
|
78
|
+
{imageSrc && !image && (
|
|
79
|
+
//TODO(a11y)
|
|
80
|
+
//eslint-disable-next-line
|
|
81
|
+
<img src={imageSrc} height={imageHeight[size]} data-test="DesignSystem-EmptyState--Img" />
|
|
82
|
+
)}
|
|
79
83
|
<Heading data-test="DesignSystem-EmptyState--Heading" size={HeadingSize[size]} className={HeadingClass}>
|
|
80
84
|
{title}
|
|
81
85
|
</Heading>
|
|
@@ -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>
|