@innovaccer/design-system 2.13.3 → 2.13.4-2
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/core/components/atoms/button/__stories__/SplitButton.story.jsx +1 -2
- package/core/components/atoms/checkbox/__stories__/Alignment.story.jsx +28 -26
- package/core/components/atoms/checkbox/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Action.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Input.story.jsx +2 -2
- package/core/components/atoms/chip/__stories__/variants/Selection.story.jsx +6 -6
- package/core/components/atoms/chip/__stories__/variants/Type.story.jsx +2 -2
- package/core/components/atoms/chipGroup/_stories_/index.story.jsx +1 -1
- package/core/components/atoms/collapsible/__stories__/CustomTrigger.story.jsx +5 -71
- package/core/components/atoms/dropdown/Dropdown.tsx +18 -2
- package/core/components/atoms/dropdown/DropdownList.tsx +47 -57
- package/core/components/atoms/dropdown/__stories__/CustomSearchPlaceholder.story.jsx +4 -4
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithCheckbox.story.jsx +1 -3
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithIcon.story.jsx +2 -4
- package/core/components/atoms/dropdown/__stories__/DropdownItemsWithInfo.story.jsx +2 -5
- package/core/components/atoms/dropdown/__stories__/DropdownWIthIcon.story.jsx +3 -4
- package/core/components/atoms/dropdown/__stories__/DropdownWithActionButtons.story.jsx +9 -9
- package/core/components/atoms/dropdown/__stories__/DropdownWithCaption.story.jsx +7 -7
- package/core/components/atoms/dropdown/__stories__/Gender.story.jsx +6 -6
- package/core/components/atoms/dropdown/__stories__/LabelInline.story.jsx +58 -0
- package/core/components/atoms/dropdown/__stories__/{LabelPositionInDropdown.story.jsx → LabelOnTop.story.jsx} +8 -9
- package/core/components/atoms/dropdown/__stories__/Languages.story.jsx +6 -6
- package/core/components/atoms/dropdown/__stories__/Menu.story.jsx +5 -6
- package/core/components/atoms/dropdown/__stories__/OptionsLessThan50.story.jsx +3 -7
- package/core/components/atoms/dropdown/__stories__/OptionsMoreThan50.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/SearchInDropdown.story.jsx +3 -5
- package/core/components/atoms/dropdown/__stories__/StandardDropdown.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/StatusWithoutLabel.story.jsx +3 -3
- package/core/components/atoms/dropdown/__stories__/WithCheckboxAndSubInfo.story.jsx +2 -4
- package/core/components/atoms/dropdown/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/LoadingType.story.jsx +0 -1
- package/core/components/atoms/dropdown/__stories__/variants/PreSelection.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/StaticLimit.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/BulkMultiSelectWithApply.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/MultiSelect.story.jsx +2 -2
- package/core/components/atoms/dropdown/__stories__/variants/controlledDropdown/SingleSelect.story.jsx +4 -4
- package/core/components/atoms/dropdown/option/DefaultOption.tsx +1 -1
- package/core/components/atoms/dropdown/utility.tsx +6 -0
- package/core/components/atoms/icon/__stories__/variants/Image.story.jsx +1 -6
- package/core/components/atoms/input/__stories__/variants/Size.story.jsx +9 -9
- package/core/components/atoms/input/__stories__/variants/controlledInput.story.jsx +3 -3
- package/core/components/atoms/metaList/_stories_/index.story.jsx +0 -1
- package/core/components/atoms/rangeSlider/__stories__/index.story.jsx +2 -2
- package/core/components/atoms/rangeSlider/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/atoms/slider/__stories__/variants/Controlled.story.jsx +2 -2
- package/core/components/css-utilities/Miscellaneous/Miscellaneous.story.tsx +4 -0
- package/core/components/molecules/dropzone/FileSelectorUtils.tsx +3 -0
- package/core/components/molecules/editableDropdown/__stories__/index.story.jsx +2 -2
- package/core/components/molecules/fullscreenModal/__stories__/DefaultWidth.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/LargeWidth.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/Layering.story.jsx +3 -1
- package/core/components/molecules/fullscreenModal/__stories__/Scrolling.story.jsx +4 -2
- package/core/components/molecules/fullscreenModal/__stories__/TwoStepWorkflow.story.jsx +1 -2
- package/core/components/molecules/fullscreenModal/__stories__/twoSteps.story.jsx +0 -1
- package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Large.story.jsx +0 -1
- package/core/components/molecules/fullscreenModal/__stories__/variants/dimension/Medium.story.jsx +0 -1
- package/core/components/molecules/modal/__stories__/Alert.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Confirmation.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Dialog.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Input.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Layering.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/NoFooter.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/Scrolling.story.jsx +4 -2
- package/core/components/molecules/modal/__stories__/index.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/old.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Large.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Medium.story.jsx +3 -1
- package/core/components/molecules/modal/__stories__/variants/dimension/Small.story.jsx +3 -1
- package/core/components/molecules/popover/__stories__/Actions.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/Inputs.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/Light.story.jsx +1 -6
- package/core/components/molecules/popover/__stories__/variants/boundaryElement.story.jsx +1 -1
- package/core/components/molecules/sidesheet/__stories__/index.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/CustomHeader.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/Layering.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/LayeringWithModal.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/dimension/Large.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/dimension/Regular.story.jsx +4 -2
- package/core/components/molecules/sidesheet/__stories__/variants/stickyFooter.story.jsx +3 -1
- package/core/components/molecules/sidesheet/__stories__/variants/twoSteps.story.jsx +6 -4
- package/core/components/molecules/tabs/__stories__/DismissibleTab.story.jsx +1 -0
- package/core/components/molecules/tooltip/__stories__/variants/Position.story.jsx +2 -13
- package/core/components/organisms/calendar/__stories__/index.story.jsx +40 -7
- package/core/components/organisms/calendar/__stories__/variants/size.story.jsx +2 -3
- package/core/components/organisms/datePicker/DatePicker.tsx +1 -1
- package/core/components/organisms/dateRangePicker/__stories__/variants/withSingleInput.story.jsx +3 -0
- package/core/components/organisms/horizontalNav/__stories__/leftAlign.story.jsx +35 -19
- package/core/components/organisms/inlineMessage/__stories__/variants/Default.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Error.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Info.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Success.story.jsx +1 -3
- package/core/components/organisms/inlineMessage/__stories__/variants/Warning.story.jsx +1 -3
- package/core/components/organisms/pageHeader/__stories__/Responsiveness.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withNavigationL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepper.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withStepperL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabs.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/variants/withTabsL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilter.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withFilterL1.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigation.story.jsx +2 -2
- package/core/components/organisms/pageHeader/__stories__/withNavigationL1.story.jsx +9 -3
- package/core/components/organisms/pageHeader/__stories__/withStepperL1.story.jsx +4 -4
- package/core/components/organisms/table/__stories__/TableAsDescriptionList.story.jsx +4 -4
- package/core/components/organisms/timePicker/TimePicker.tsx +6 -113
- package/core/components/organisms/timePicker/TimePickerWithInput.tsx +124 -0
- package/core/components/organisms/timePicker/TimePickerWithSearch.tsx +198 -0
- package/core/components/organisms/timePicker/__stories__/TimeIntervals.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/disabledOption.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/fromTo.story.jsx +72 -0
- package/core/components/organisms/timePicker/__stories__/showDuration.story.jsx +52 -0
- package/core/components/organisms/timePicker/__stories__/withDatePicker.story.jsx +88 -0
- package/core/components/organisms/timePicker/__stories__/{index.story.jsx → withInput.story.jsx} +6 -3
- package/core/components/organisms/timePicker/__stories__/withSearch.story.jsx +89 -0
- package/core/components/organisms/timePicker/__tests__/TimePickerWithSearch.test.tsx +464 -0
- package/core/components/organisms/timePicker/__tests__/__snapshots__/TimePickerWithSearch.test.tsx.snap +169 -0
- package/core/components/organisms/timePicker/index.tsx +2 -0
- package/core/components/organisms/timePicker/utility/searchUtils.tsx +295 -0
- package/core/components/organisms/timePicker/utility/timePickerUtility.tsx +219 -0
- package/core/components/organisms/timePicker/utils.tsx +1 -1
- package/core/components/organisms/verticalNav/MenuItem.tsx +11 -6
- package/core/components/organisms/verticalNav/__stories__/CustomOptionsRenderer.story.jsx +10 -9
- package/core/components/organisms/verticalNav/__stories__/CustomTrigger.story.jsx +14 -12
- package/core/components/organisms/verticalNav/__stories__/FlatEdgedVerticalNav.story.jsx +5 -5
- package/core/components/organisms/verticalNav/__stories__/LabelOverflowBehaviour.story.jsx +9 -15
- package/core/components/organisms/verticalNav/__tests__/__snapshots__/VerticalNav.test.tsx.snap +26 -24
- package/core/index.tsx +1 -0
- package/css/dist/index.css +9 -8
- package/css/dist/index.css.map +1 -1
- package/css/src/components/dropdown.css +6 -6
- package/css/src/components/metricInput.css +1 -0
- package/css/src/components/verticalNav.css +2 -0
- package/dist/core/components/atoms/dropdown/Dropdown.d.ts +2 -0
- package/dist/core/components/atoms/dropdown/DropdownList.d.ts +1 -0
- package/dist/core/components/atoms/dropdown/utility.d.ts +1 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +22 -22
- package/dist/core/components/organisms/datePicker/DatePicker.d.ts +1 -1
- package/dist/core/components/organisms/timePicker/TimePicker.d.ts +5 -13
- package/dist/core/components/organisms/timePicker/TimePickerWithInput.d.ts +24 -0
- package/dist/core/components/organisms/timePicker/TimePickerWithSearch.d.ts +32 -0
- package/dist/core/components/organisms/timePicker/index.d.ts +2 -0
- package/dist/core/components/organisms/timePicker/utility/searchUtils.d.ts +7 -0
- package/dist/core/components/organisms/timePicker/utility/timePickerUtility.d.ts +19 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/index.esm.js +719 -52
- package/dist/index.js +648 -74
- 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/docs/.eslintrc.json +32 -1
- package/docs/.prettierrc +6 -0
- package/docs/README.md +14 -0
- package/docs/cypress/e2e/main.cy.js +35 -0
- package/docs/cypress/fixtures/example.json +5 -0
- package/docs/cypress/support/commands.ts +37 -0
- package/docs/cypress/support/e2e.ts +20 -0
- package/docs/cypress.config.js +9 -0
- package/docs/package.json +16 -3
- package/docs/src/components/Colors/Colors.css +4 -0
- package/docs/src/components/Colors/Colors.js +56 -61
- package/docs/src/components/Container/ComponentsContainer.js +10 -30
- package/docs/src/components/Container/Container.js +10 -41
- package/docs/src/components/ErrorBoundary.js +9 -3
- package/docs/src/components/Footer/Footer.js +11 -10
- package/docs/src/components/GlobalSearch/index.js +47 -44
- package/docs/src/components/Header/Header.css +4 -0
- package/docs/src/components/Header/Header.js +25 -19
- package/docs/src/components/Layout.js +59 -303
- package/docs/src/components/LeftNav/LeftNav.js +12 -28
- package/docs/src/components/Logos/Logos.js +12 -26
- package/docs/src/components/MDXComponents.js +213 -0
- package/docs/src/components/MDXHeading.js +12 -18
- package/docs/src/components/Meta.js +9 -9
- package/docs/src/components/PropsTable/ArgJsDoc.tsx +2 -6
- package/docs/src/components/PropsTable/ArgRow.tsx +19 -47
- package/docs/src/components/PropsTable/ArgValue.tsx +50 -93
- package/docs/src/components/PropsTable/EmptyBlock.tsx +2 -5
- package/docs/src/components/PropsTable/SectionRow.tsx +7 -18
- package/docs/src/components/PropsTable/Table.tsx +43 -130
- package/docs/src/components/PropsTable/generateImports.tsx +1 -3
- package/docs/src/components/PropsTable/index.js +94 -140
- package/docs/src/components/PropsTable/prism.css +19 -20
- package/docs/src/components/Rules/DONTs.js +1 -6
- package/docs/src/components/Rules/DOs.js +1 -6
- package/docs/src/components/Rules/IconWrapper.js +6 -7
- package/docs/src/components/Rules/InlineMessage.js +1 -5
- package/docs/src/components/Rules/Rules.js +18 -28
- package/docs/src/components/TableOfContent/TableOfContent.css +8 -1
- package/docs/src/components/TableOfContent/TableOfContent.js +67 -58
- package/docs/src/components/css/global.css +1 -1
- package/docs/src/components/css/prism.css +1 -1
- package/docs/src/components/css/style.css +13 -5
- package/docs/src/components/templates/Default.js +1 -1
- package/docs/src/components/templates/Homepage.js +4 -6
- package/docs/src/data/components/Overview.js +49 -56
- package/docs/src/data/components/images/Calendar.png +0 -0
- package/docs/src/data/components/images/MetaList.png +0 -0
- package/docs/src/data/components/images/PageHeader.png +0 -0
- package/docs/src/data/components/images/TimePicker.png +0 -0
- package/docs/src/data/components/images/mobile/Badge.png +0 -0
- package/docs/src/data/components/images/mobile/Dropdown.png +0 -0
- package/docs/src/data/components/images/mobile/Message.png +0 -0
- package/docs/src/data/components/images/mobile/MetaList.png +0 -0
- package/docs/src/data/components/images/mobile/Slider.png +0 -0
- package/docs/src/data/components/images/mobile/StatusHint.png +0 -0
- package/docs/src/data/components/images/mobile/Stepper.png +0 -0
- package/docs/src/data/components/index.js +168 -321
- package/docs/src/data/components/mobile.js +85 -125
- package/docs/src/data/components/overview.css +4 -2
- package/docs/src/data/components/patterns.js +25 -59
- package/docs/src/data/header-items.yaml +1 -0
- package/docs/src/data/nav/components.yaml +2 -8
- package/docs/src/pages/404.js +7 -17
- package/docs/src/pages/components/avatar/usage.mdx +23 -19
- package/docs/src/pages/components/calendar/usage.mdx +3 -3
- package/docs/src/pages/components/checkbox/usage.mdx +1 -1
- package/docs/src/pages/components/chips/images/actionchip-state.png +0 -0
- package/docs/src/pages/components/chips/images/inputchips-state.png +0 -0
- package/docs/src/pages/components/chips/images/selectionchip-state.png +0 -0
- package/docs/src/pages/components/chips/usage.mdx +24 -2
- package/docs/src/pages/components/datePicker/images/datePicker-3.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-6.png +0 -0
- package/docs/src/pages/components/datePicker/usage.mdx +9 -2
- package/docs/src/pages/components/dropdowns/usage.mdx +1 -1
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableField-3.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-1.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-4.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/usage.mdx +4 -4
- package/docs/src/pages/components/inputs/usage.mdx +7 -7
- package/docs/src/pages/components/tabs/images/tabs-1.png +0 -0
- package/docs/src/pages/content/button-guidelines/tabs/button-glossary.mdx +1776 -1
- package/docs/src/pages/content/button-guidelines/tabs/confusing-buttons.mdx +479 -8
- package/docs/src/pages/content/email-guidelines.mdx +3 -3
- package/docs/src/pages/content/house-rules/tabs/date,-time-&-numbers.mdx +24 -0
- package/docs/src/pages/content/house-rules/tabs/grammer.mdx +42 -2
- package/docs/src/pages/content/house-rules/tabs/punctuations.mdx +32 -0
- package/docs/src/pages/foundations/colors.mdx +338 -24
- package/docs/src/pages/foundations/layout/index.mdx +57 -82
- package/docs/src/pages/foundations/response-time.mdx +32 -77
- package/docs/src/pages/foundations/typography.mdx +166 -0
- package/docs/src/pages/index.js +92 -121
- package/docs/src/pages/introduction/get-started/designers.mdx +28 -188
- package/docs/src/pages/introduction/get-started/images/designers-1.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-2.png +0 -0
- package/docs/src/pages/introduction/what's-new.mdx +322 -15
- package/docs/src/pages/mobile/components/badges/images/badge-1.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-2.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-3.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-4.png +0 -0
- package/docs/src/pages/mobile/components/badges/images/badge-5.png +0 -0
- package/docs/src/pages/mobile/components/badges/usage.mdx +100 -0
- package/docs/src/pages/mobile/components/card/images/mcard-1.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-2.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-3.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-4.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-5.png +0 -0
- package/docs/src/pages/mobile/components/card/images/mcard-6.png +0 -0
- package/docs/src/pages/mobile/components/card/usage.mdx +54 -67
- package/docs/src/pages/mobile/components/checkbox/images/checkbox-1.png +0 -0
- package/docs/src/pages/mobile/components/checkbox/usage.mdx +26 -2
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-1.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-10.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-11.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-2.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-3.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-4.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-5.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-6.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-7.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-8.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/images/dropdown-9.png +0 -0
- package/docs/src/pages/mobile/components/dropdowns/usage.mdx +88 -0
- package/docs/src/pages/mobile/components/message/images/messages-1.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-10.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-11.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-12.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-2.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-3.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-4.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-5.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-6.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-7.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-8.png +0 -0
- package/docs/src/pages/mobile/components/message/images/messages-9.png +0 -0
- package/docs/src/pages/mobile/components/message/usage.mdx +170 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-1.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-2.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-3.png +0 -0
- package/docs/src/pages/mobile/components/metaList/images/metaList-4.png +0 -0
- package/docs/src/pages/mobile/components/metaList/usage.mdx +71 -0
- package/docs/src/pages/mobile/components/slider/images/slider-1.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-2.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-3.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-4.png +0 -0
- package/docs/src/pages/mobile/components/slider/images/slider-5.png +0 -0
- package/docs/src/pages/mobile/components/slider/usage.mdx +83 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-1.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-2.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-3.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-4.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-5.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-6.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/images/statushint-7.png +0 -0
- package/docs/src/pages/mobile/components/statusHint/usage.mdx +108 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-1.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-2.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-3.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-4.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-5.png +0 -0
- package/docs/src/pages/mobile/components/steppers/images/stepper-6.png +0 -0
- package/docs/src/pages/mobile/components/steppers/usage.mdx +111 -0
- package/docs/src/pages/mobile/foundations/layout/images/layout-2.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/index.mdx +3 -1
- package/docs/src/pages/mobile/foundations/page-types/index.mdx +0 -214
- package/docs/src/pages/mobile/foundations/spacing/index.mdx +5 -0
- package/docs/src/pages/mobile/foundations/typography.mdx +1 -1
- package/docs/src/pages/patterns/uiStates/usage.mdx +92 -0
- package/docs/src/util/Frontmatter.js +4 -4
- package/docs/src/util/HeaderItems.js +2 -1
- package/docs/src/util/Helpers.js +3 -3
- package/docs/src/util/HomeIcons.js +91 -53
- package/docs/src/util/InPageNavItems.js +2 -6
- package/docs/src/util/Logos.js +2 -2
- package/docs/src/util/MdsChangelog.js +5 -10
- package/docs/src/util/MediumBlogs.js +13 -13
- package/docs/src/util/NavItems.js +14 -17
- package/docs/src/util/Search.js +2 -2
- package/docs/src/util/StorybookData.js +2 -4
- package/docs/src/util/constants.js +1 -5
- package/docs/src/util/context/NavContext.js +1 -4
- package/docs/src/util/hooks/useMetadata.js +1 -1
- package/docs/tools/build.sh +1 -0
- package/docs/tools/changelog.sh +1 -1
- package/package.json +3 -3
- package/docs/src/pages/components/index.mdx +0 -11
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-2.png +0 -0
- package/docs/src/pages/components/inlineEditableFields/images/inlineEditableFields-3.png +0 -0
- package/docs/src/pages/content/button-guidelines/index.mdx +0 -7
- package/docs/src/pages/content/voice-and-tone-guidelines/index.mdx +0 -7
- package/docs/src/pages/introduction/get-started/images/designers-3.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-4.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-5.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-6.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-7.png +0 -0
- package/docs/src/pages/introduction/get-started/images/designers-8.png +0 -0
|
@@ -80,28 +80,21 @@ export const SectionRow: FC<SectionRowProps> = ({
|
|
|
80
80
|
colSpan = 3,
|
|
81
81
|
}) => {
|
|
82
82
|
const [expanded, setExpanded] = useState(initialExpanded);
|
|
83
|
-
const Level =
|
|
84
|
-
level === 'subsection' ? Subsection : Section;
|
|
83
|
+
const Level = level === 'subsection' ? Subsection : Section;
|
|
85
84
|
// @ts-ignore
|
|
86
85
|
const itemCount = children?.length || 0;
|
|
87
|
-
const caption =
|
|
88
|
-
level === 'subsection'
|
|
89
|
-
? `${itemCount} item${itemCount !== 1 ? 's' : ''}`
|
|
90
|
-
: '';
|
|
86
|
+
const caption = level === 'subsection' ? `${itemCount} item${itemCount !== 1 ? 's' : ''}` : '';
|
|
91
87
|
const icon = expanded ? 'arrowdown' : 'arrowright';
|
|
92
88
|
|
|
93
|
-
const helperText = `${expanded ? 'Hide' : 'Side'} ${
|
|
94
|
-
|
|
95
|
-
}
|
|
89
|
+
const helperText = `${expanded ? 'Hide' : 'Side'} ${level === 'subsection' ? itemCount : label} item${
|
|
90
|
+
itemCount !== 1 ? 's' : ''
|
|
91
|
+
}`;
|
|
96
92
|
|
|
97
93
|
return (
|
|
98
94
|
<>
|
|
99
95
|
<StyledTr title={helperText}>
|
|
100
96
|
<Level colSpan={1}>
|
|
101
|
-
<ClickIntercept
|
|
102
|
-
onClick={(e) => setExpanded(!expanded)}
|
|
103
|
-
tabIndex={0}
|
|
104
|
-
>
|
|
97
|
+
<ClickIntercept onClick={(e) => setExpanded(!expanded)} tabIndex={0}>
|
|
105
98
|
{helperText}
|
|
106
99
|
</ClickIntercept>
|
|
107
100
|
<FlexWrapper>
|
|
@@ -110,11 +103,7 @@ export const SectionRow: FC<SectionRowProps> = ({
|
|
|
110
103
|
</FlexWrapper>
|
|
111
104
|
</Level>
|
|
112
105
|
<StyledTd colSpan={colSpan - 1}>
|
|
113
|
-
<ClickIntercept
|
|
114
|
-
onClick={(e) => setExpanded(!expanded)}
|
|
115
|
-
tabIndex={-1}
|
|
116
|
-
style={{ outline: 'none' }}
|
|
117
|
-
>
|
|
106
|
+
<ClickIntercept onClick={(e) => setExpanded(!expanded)} tabIndex={-1} style={{ outline: 'none' }}>
|
|
118
107
|
{helperText}
|
|
119
108
|
</ClickIntercept>
|
|
120
109
|
{expanded ? null : caption}
|
|
@@ -112,10 +112,7 @@ export const TableWrapper = styled.table<{
|
|
|
112
112
|
...(!inAddonPanel && {
|
|
113
113
|
borderColor:
|
|
114
114
|
theme.base === 'light'
|
|
115
|
-
? transparentize(
|
|
116
|
-
0.035,
|
|
117
|
-
theme.appBorderColor
|
|
118
|
-
)
|
|
115
|
+
? transparentize(0.035, theme.appBorderColor)
|
|
119
116
|
: opacify(0.05, theme.appBorderColor),
|
|
120
117
|
}),
|
|
121
118
|
},
|
|
@@ -146,19 +143,13 @@ const ResetButton = styled.button(({ theme }) => ({
|
|
|
146
143
|
userSelect: 'none',
|
|
147
144
|
margin: 0,
|
|
148
145
|
|
|
149
|
-
backgroundColor:
|
|
150
|
-
theme.base === 'light' ? '#EAF3FC' : theme.color.border,
|
|
146
|
+
backgroundColor: theme.base === 'light' ? '#EAF3FC' : theme.color.border,
|
|
151
147
|
boxShadow:
|
|
152
|
-
theme.base === 'light'
|
|
153
|
-
? `${theme.color.border} 0 0 0 1px inset`
|
|
154
|
-
: `${theme.color.darker} 0 0 0 1px inset`,
|
|
148
|
+
theme.base === 'light' ? `${theme.color.border} 0 0 0 1px inset` : `${theme.color.darker} 0 0 0 1px inset`,
|
|
155
149
|
color: theme.color.secondary,
|
|
156
150
|
|
|
157
151
|
'&:hover': {
|
|
158
|
-
background:
|
|
159
|
-
theme.base === 'light'
|
|
160
|
-
? darken(0.03, '#EAF3FC')
|
|
161
|
-
: opacify(0.1, theme.color.border),
|
|
152
|
+
background: theme.base === 'light' ? darken(0.03, '#EAF3FC') : opacify(0.1, theme.color.border),
|
|
162
153
|
},
|
|
163
154
|
|
|
164
155
|
'&:focus': {
|
|
@@ -187,12 +178,9 @@ export type SortType = 'alpha' | 'requiredFirst' | 'none';
|
|
|
187
178
|
type SortFn = (a: ArgType, b: ArgType) => number;
|
|
188
179
|
|
|
189
180
|
const sortFns: Record<SortType, SortFn | null> = {
|
|
190
|
-
alpha: (a: ArgType, b: ArgType) =>
|
|
191
|
-
a.name.localeCompare(b.name),
|
|
181
|
+
alpha: (a: ArgType, b: ArgType) => a.name.localeCompare(b.name),
|
|
192
182
|
requiredFirst: (a: ArgType, b: ArgType) =>
|
|
193
|
-
Number(!!b.type?.required) -
|
|
194
|
-
Number(!!a.type?.required) ||
|
|
195
|
-
a.name.localeCompare(b.name),
|
|
183
|
+
Number(!!b.type?.required) - Number(!!a.type?.required) || a.name.localeCompare(b.name),
|
|
196
184
|
none: undefined,
|
|
197
185
|
};
|
|
198
186
|
export interface ArgsTableRowProps {
|
|
@@ -210,9 +198,7 @@ export interface ArgsTableErrorProps {
|
|
|
210
198
|
error: ArgsTableError;
|
|
211
199
|
}
|
|
212
200
|
|
|
213
|
-
export type ArgsTableProps =
|
|
214
|
-
| ArgsTableRowProps
|
|
215
|
-
| ArgsTableErrorProps;
|
|
201
|
+
export type ArgsTableProps = ArgsTableRowProps | ArgsTableErrorProps;
|
|
216
202
|
|
|
217
203
|
type Rows = ArgType[];
|
|
218
204
|
type Subsection = Rows;
|
|
@@ -244,19 +230,15 @@ const groupRows = (rows: ArgType, sort: SortType) => {
|
|
|
244
230
|
if (!subcategory) {
|
|
245
231
|
section.ungrouped.push({ key, ...row });
|
|
246
232
|
} else {
|
|
247
|
-
const subsection =
|
|
248
|
-
section.subsections[subcategory] || [];
|
|
233
|
+
const subsection = section.subsections[subcategory] || [];
|
|
249
234
|
subsection.push({ key, ...row });
|
|
250
235
|
section.subsections[subcategory] = subsection;
|
|
251
236
|
}
|
|
252
237
|
sections.sections[category] = section;
|
|
253
238
|
} else if (subcategory) {
|
|
254
|
-
const subsection =
|
|
255
|
-
sections.ungroupedSubsections[subcategory] || [];
|
|
239
|
+
const subsection = sections.ungroupedSubsections[subcategory] || [];
|
|
256
240
|
subsection.push({ key, ...row });
|
|
257
|
-
sections.ungroupedSubsections[
|
|
258
|
-
subcategory
|
|
259
|
-
] = subsection;
|
|
241
|
+
sections.ungroupedSubsections[subcategory] = subsection;
|
|
260
242
|
} else {
|
|
261
243
|
sections.ungrouped.push({ key, ...row });
|
|
262
244
|
}
|
|
@@ -265,13 +247,9 @@ const groupRows = (rows: ArgType, sort: SortType) => {
|
|
|
265
247
|
// apply sort
|
|
266
248
|
const sortFn = sortFns[sort];
|
|
267
249
|
|
|
268
|
-
const sortSubsection = (
|
|
269
|
-
record: Record<string, Subsection>
|
|
270
|
-
) => {
|
|
250
|
+
const sortSubsection = (record: Record<string, Subsection>) => {
|
|
271
251
|
if (!sortFn) return record;
|
|
272
|
-
return Object.keys(record).reduce<
|
|
273
|
-
Record<string, Subsection>
|
|
274
|
-
>(
|
|
252
|
+
return Object.keys(record).reduce<Record<string, Subsection>>(
|
|
275
253
|
(acc, cur) => ({
|
|
276
254
|
...acc,
|
|
277
255
|
[cur]: record[cur].sort(sortFn),
|
|
@@ -282,21 +260,13 @@ const groupRows = (rows: ArgType, sort: SortType) => {
|
|
|
282
260
|
|
|
283
261
|
const sorted = {
|
|
284
262
|
ungrouped: sections.ungrouped.sort(sortFn),
|
|
285
|
-
ungroupedSubsections: sortSubsection(
|
|
286
|
-
|
|
287
|
-
),
|
|
288
|
-
sections: Object.keys(sections.sections).reduce<
|
|
289
|
-
Record<string, Section>
|
|
290
|
-
>(
|
|
263
|
+
ungroupedSubsections: sortSubsection(sections.ungroupedSubsections),
|
|
264
|
+
sections: Object.keys(sections.sections).reduce<Record<string, Section>>(
|
|
291
265
|
(acc, cur) => ({
|
|
292
266
|
...acc,
|
|
293
267
|
[cur]: {
|
|
294
|
-
ungrouped: sections.sections[cur].ungrouped.sort(
|
|
295
|
-
|
|
296
|
-
),
|
|
297
|
-
subsections: sortSubsection(
|
|
298
|
-
sections.sections[cur].subsections
|
|
299
|
-
),
|
|
268
|
+
ungrouped: sections.sections[cur].ungrouped.sort(sortFn),
|
|
269
|
+
subsections: sortSubsection(sections.sections[cur].subsections),
|
|
300
270
|
},
|
|
301
271
|
}),
|
|
302
272
|
{}
|
|
@@ -343,18 +313,13 @@ export const ArgsTable: FC<ArgsTableProps> = (props) => {
|
|
|
343
313
|
Object.entries(groups.sections).length === 0 &&
|
|
344
314
|
Object.entries(groups.ungroupedSubsections).length === 0
|
|
345
315
|
) {
|
|
346
|
-
return
|
|
347
|
-
<EmptyBlock>
|
|
348
|
-
No inputs found for this component.
|
|
349
|
-
</EmptyBlock>
|
|
350
|
-
);
|
|
316
|
+
return <EmptyBlock>No inputs found for this component. </EmptyBlock>;
|
|
351
317
|
}
|
|
352
318
|
|
|
353
319
|
let colSpan = 1;
|
|
354
320
|
if (updateArgs) colSpan += 1;
|
|
355
321
|
if (!compact) colSpan += 2;
|
|
356
|
-
const expandable =
|
|
357
|
-
Object.keys(groups.sections).length > 0;
|
|
322
|
+
const expandable = Object.keys(groups.sections).length > 0;
|
|
358
323
|
|
|
359
324
|
const common = {
|
|
360
325
|
updateArgs,
|
|
@@ -363,10 +328,7 @@ export const ArgsTable: FC<ArgsTableProps> = (props) => {
|
|
|
363
328
|
initialExpandedArgs,
|
|
364
329
|
};
|
|
365
330
|
return (
|
|
366
|
-
<TableWrapper
|
|
367
|
-
{...{ compact, inAddonPanel }}
|
|
368
|
-
className="docblock-argstable"
|
|
369
|
-
>
|
|
331
|
+
<TableWrapper {...{ compact, inAddonPanel }} className="docblock-argstable">
|
|
370
332
|
<thead className="docblock-argstable-head">
|
|
371
333
|
<tr>
|
|
372
334
|
<th>Name</th>
|
|
@@ -375,13 +337,7 @@ export const ArgsTable: FC<ArgsTableProps> = (props) => {
|
|
|
375
337
|
{updateArgs ? (
|
|
376
338
|
<th>
|
|
377
339
|
<ControlHeadingWrapper>
|
|
378
|
-
Control{
|
|
379
|
-
{resetArgs && (
|
|
380
|
-
<ResetButton
|
|
381
|
-
onClick={() => resetArgs()}
|
|
382
|
-
title="Reset controls"
|
|
383
|
-
></ResetButton>
|
|
384
|
-
)}
|
|
340
|
+
Control {resetArgs && <ResetButton onClick={() => resetArgs()} title="Reset controls"></ResetButton>}
|
|
385
341
|
</ControlHeadingWrapper>
|
|
386
342
|
</th>
|
|
387
343
|
) : null}
|
|
@@ -389,74 +345,31 @@ export const ArgsTable: FC<ArgsTableProps> = (props) => {
|
|
|
389
345
|
</thead>
|
|
390
346
|
<tbody className="docblock-argstable-body">
|
|
391
347
|
{groups.ungrouped.map((row) => (
|
|
392
|
-
<ArgRow
|
|
393
|
-
key={row.key}
|
|
394
|
-
row={row}
|
|
395
|
-
arg={args && args[row.key]}
|
|
396
|
-
{...common}
|
|
397
|
-
/>
|
|
348
|
+
<ArgRow key={row.key} row={row} arg={args && args[row.key]} {...common} />
|
|
398
349
|
))}
|
|
399
350
|
|
|
400
|
-
{Object.entries(groups.ungroupedSubsections).map(
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
key={
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
([category, section]) => (
|
|
423
|
-
<SectionRow
|
|
424
|
-
key={category}
|
|
425
|
-
label={category}
|
|
426
|
-
level="section"
|
|
427
|
-
colSpan={colSpan}
|
|
428
|
-
>
|
|
429
|
-
{section.ungrouped.map((row) => (
|
|
430
|
-
<ArgRow
|
|
431
|
-
key={row.key}
|
|
432
|
-
row={row}
|
|
433
|
-
arg={args && args[row.key]}
|
|
434
|
-
{...common}
|
|
435
|
-
/>
|
|
436
|
-
))}
|
|
437
|
-
{Object.entries(section.subsections).map(
|
|
438
|
-
([subcategory, subsection]) => (
|
|
439
|
-
<SectionRow
|
|
440
|
-
key={subcategory}
|
|
441
|
-
label={subcategory}
|
|
442
|
-
level="subsection"
|
|
443
|
-
colSpan={colSpan}
|
|
444
|
-
>
|
|
445
|
-
{subsection.map((row) => (
|
|
446
|
-
<ArgRow
|
|
447
|
-
key={row.key}
|
|
448
|
-
row={row}
|
|
449
|
-
arg={args && args[row.key]}
|
|
450
|
-
expandable={expandable}
|
|
451
|
-
{...common}
|
|
452
|
-
/>
|
|
453
|
-
))}
|
|
454
|
-
</SectionRow>
|
|
455
|
-
)
|
|
456
|
-
)}
|
|
457
|
-
</SectionRow>
|
|
458
|
-
)
|
|
459
|
-
)}
|
|
351
|
+
{Object.entries(groups.ungroupedSubsections).map(([subcategory, subsection]) => (
|
|
352
|
+
<SectionRow key={subcategory} label={subcategory} level="subsection" colSpan={colSpan}>
|
|
353
|
+
{subsection.map((row) => (
|
|
354
|
+
<ArgRow key={row.key} row={row} arg={args && args[row.key]} expandable={expandable} {...common} />
|
|
355
|
+
))}
|
|
356
|
+
</SectionRow>
|
|
357
|
+
))}
|
|
358
|
+
|
|
359
|
+
{Object.entries(groups.sections).map(([category, section]) => (
|
|
360
|
+
<SectionRow key={category} label={category} level="section" colSpan={colSpan}>
|
|
361
|
+
{section.ungrouped.map((row) => (
|
|
362
|
+
<ArgRow key={row.key} row={row} arg={args && args[row.key]} {...common} />
|
|
363
|
+
))}
|
|
364
|
+
{Object.entries(section.subsections).map(([subcategory, subsection]) => (
|
|
365
|
+
<SectionRow key={subcategory} label={subcategory} level="subsection" colSpan={colSpan}>
|
|
366
|
+
{subsection.map((row) => (
|
|
367
|
+
<ArgRow key={row.key} row={row} arg={args && args[row.key]} expandable={expandable} {...common} />
|
|
368
|
+
))}
|
|
369
|
+
</SectionRow>
|
|
370
|
+
))}
|
|
371
|
+
</SectionRow>
|
|
372
|
+
))}
|
|
460
373
|
</tbody>
|
|
461
374
|
</TableWrapper>
|
|
462
375
|
);
|
|
@@ -12,9 +12,7 @@ const generateImports = (str = '', lib = {}, libName: string) => {
|
|
|
12
12
|
return finalMap;
|
|
13
13
|
}, {});
|
|
14
14
|
|
|
15
|
-
return `// import { ${Object.keys(componentsMap).join(
|
|
16
|
-
', '
|
|
17
|
-
)} } from '${libName}';`;
|
|
15
|
+
return `// import { ${Object.keys(componentsMap).join(', ')} } from '${libName}';`;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export default generateImports;
|
|
@@ -9,21 +9,8 @@ import generateImports from './generateImports';
|
|
|
9
9
|
import * as DS from '@innovaccer/design-system';
|
|
10
10
|
import './card.css';
|
|
11
11
|
import { vs2015 } from 'react-syntax-highlighter/dist/esm/styles/hljs';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
CardHeader,
|
|
15
|
-
CardBody,
|
|
16
|
-
Button,
|
|
17
|
-
Icon,
|
|
18
|
-
Tooltip
|
|
19
|
-
} from '@innovaccer/design-system';
|
|
20
|
-
import {
|
|
21
|
-
LiveProvider,
|
|
22
|
-
LiveEditor,
|
|
23
|
-
LiveError,
|
|
24
|
-
LivePreview,
|
|
25
|
-
withLive
|
|
26
|
-
} from 'react-live';
|
|
12
|
+
import { Card, CardHeader, CardBody, Button, Icon, Tooltip } from '@innovaccer/design-system';
|
|
13
|
+
import { LiveProvider, LiveEditor, LiveError, LivePreview, withLive } from 'react-live';
|
|
27
14
|
import './prism.css';
|
|
28
15
|
import { copyMessage, copyMessageSuccess } from '../../util/constants';
|
|
29
16
|
import { useEffect } from 'react';
|
|
@@ -43,15 +30,11 @@ const beautifyHTMLOptions = {
|
|
|
43
30
|
};
|
|
44
31
|
|
|
45
32
|
const getRawPreviewCode = (customCode, dataProvider) => {
|
|
46
|
-
if(dataProvider) {
|
|
47
|
-
return `() => <div><Spinner /></div
|
|
33
|
+
if (dataProvider) {
|
|
34
|
+
return `() => <div><Spinner /></div>`;
|
|
48
35
|
}
|
|
49
36
|
if (customCode) {
|
|
50
|
-
return `${generateImports(
|
|
51
|
-
customCode,
|
|
52
|
-
DS,
|
|
53
|
-
'@innovaccer/design-system'
|
|
54
|
-
)}
|
|
37
|
+
return `${generateImports(customCode, DS, '@innovaccer/design-system')}
|
|
55
38
|
|
|
56
39
|
${customCode}
|
|
57
40
|
`;
|
|
@@ -61,11 +44,11 @@ ${customCode}
|
|
|
61
44
|
const TabsWrap = withLive(({ live, onUpdate }) => {
|
|
62
45
|
useEffect(() => {
|
|
63
46
|
const { element: Element } = live;
|
|
64
|
-
if(
|
|
47
|
+
if (live.element) {
|
|
65
48
|
try {
|
|
66
49
|
const htmlValue = beautifyHTML(renderToStaticMarkup(<Element />), beautifyHTMLOptions);
|
|
67
50
|
onUpdate(htmlValue);
|
|
68
|
-
} catch (e) {
|
|
51
|
+
} catch (e) {
|
|
69
52
|
console.log(e);
|
|
70
53
|
}
|
|
71
54
|
}
|
|
@@ -73,10 +56,7 @@ const TabsWrap = withLive(({ live, onUpdate }) => {
|
|
|
73
56
|
return null;
|
|
74
57
|
});
|
|
75
58
|
|
|
76
|
-
const StoryComp = ({
|
|
77
|
-
componentData,
|
|
78
|
-
dataProvider,
|
|
79
|
-
}) => {
|
|
59
|
+
const StoryComp = ({ componentData, dataProvider }) => {
|
|
80
60
|
const testRef = useRef(null);
|
|
81
61
|
const [zoom, setZoom] = useState(1);
|
|
82
62
|
const [htmlCode, setHtmlCode] = useState('');
|
|
@@ -87,21 +67,23 @@ const StoryComp = ({
|
|
|
87
67
|
const [tooltipName, setTooltipName] = useState(copyMessage);
|
|
88
68
|
|
|
89
69
|
React.useEffect(() => {
|
|
90
|
-
if(dataProvider) {
|
|
70
|
+
if (dataProvider) {
|
|
91
71
|
dataProvider()
|
|
92
72
|
.then((data) => {
|
|
93
73
|
setJsxCode(getRawPreviewCode(data));
|
|
94
74
|
})
|
|
95
75
|
.catch((err) => {
|
|
96
|
-
|
|
76
|
+
setJsxCode(
|
|
77
|
+
`<Message className="my-7" appearance="alert" title="${err}" description="We are working to get it up for you to interact with." />`
|
|
78
|
+
);
|
|
97
79
|
});
|
|
98
80
|
}
|
|
99
81
|
}, []);
|
|
100
82
|
|
|
101
83
|
const updateHtml = (htmlValue) => {
|
|
102
84
|
setHtmlCode(htmlValue);
|
|
103
|
-
}
|
|
104
|
-
|
|
85
|
+
};
|
|
86
|
+
|
|
105
87
|
const renderCodeBlock = (val) => (
|
|
106
88
|
<div>
|
|
107
89
|
<style>
|
|
@@ -111,11 +93,7 @@ const StoryComp = ({
|
|
|
111
93
|
|
|
112
94
|
}`}
|
|
113
95
|
</style>
|
|
114
|
-
<SyntaxHighlighter
|
|
115
|
-
language='javascript'
|
|
116
|
-
style={vs2015}
|
|
117
|
-
showLineNumbers={true}
|
|
118
|
-
>
|
|
96
|
+
<SyntaxHighlighter language="javascript" style={vs2015} showLineNumbers={true}>
|
|
119
97
|
{val}
|
|
120
98
|
</SyntaxHighlighter>
|
|
121
99
|
</div>
|
|
@@ -128,44 +106,39 @@ const StoryComp = ({
|
|
|
128
106
|
navigator.clipboard.writeText(htmlCode);
|
|
129
107
|
}
|
|
130
108
|
setTooltipName(copyMessageSuccess);
|
|
131
|
-
setTooltipActive(true)
|
|
132
|
-
}
|
|
109
|
+
setTooltipActive(true);
|
|
110
|
+
};
|
|
133
111
|
|
|
134
112
|
const CopyCode = (props) => {
|
|
135
113
|
const { onClick } = props;
|
|
136
114
|
return (
|
|
137
|
-
<div className=
|
|
138
|
-
{activeButton === 'React' &&
|
|
139
|
-
<Tooltip
|
|
140
|
-
tooltip="Open in CodeSandbox"
|
|
141
|
-
position="bottom"
|
|
142
|
-
on="hover"
|
|
143
|
-
>
|
|
115
|
+
<div className="ml-auto d-flex">
|
|
116
|
+
{activeButton === 'React' && (
|
|
117
|
+
<Tooltip tooltip="Open in CodeSandbox" position="bottom" on="hover">
|
|
144
118
|
<img
|
|
145
119
|
src="/icons/4691539_codesandbox_icon.svg"
|
|
146
|
-
className=
|
|
120
|
+
className="codesandBox-icon cursor-pointer mr-6 align-self-center"
|
|
147
121
|
onClick={(e) => {
|
|
148
122
|
e.preventDefault();
|
|
149
123
|
openSandbox(jsxCode);
|
|
150
124
|
}}
|
|
151
125
|
/>
|
|
152
126
|
</Tooltip>
|
|
153
|
-
}
|
|
127
|
+
)}
|
|
154
128
|
<div
|
|
155
|
-
className=
|
|
156
|
-
onMouseLeave={() => {
|
|
129
|
+
className="align-self-end"
|
|
130
|
+
onMouseLeave={() => {
|
|
131
|
+
setTooltipActive(false);
|
|
132
|
+
setTooltipName(copyMessage);
|
|
133
|
+
}}
|
|
157
134
|
>
|
|
158
|
-
<Tooltip
|
|
159
|
-
open={isTooltipActive}
|
|
160
|
-
tooltip={tooltipName}
|
|
161
|
-
position="bottom"
|
|
162
|
-
>
|
|
135
|
+
<Tooltip open={isTooltipActive} tooltip={tooltipName} position="bottom">
|
|
163
136
|
<Icon
|
|
164
|
-
name=
|
|
137
|
+
name="content_copy"
|
|
165
138
|
size={20}
|
|
166
|
-
appearance=
|
|
139
|
+
appearance="white"
|
|
167
140
|
onClick={onClick}
|
|
168
|
-
className=
|
|
141
|
+
className="align-self-center cursor-pointer"
|
|
169
142
|
/>
|
|
170
143
|
</Tooltip>
|
|
171
144
|
</div>
|
|
@@ -197,89 +170,70 @@ const StoryComp = ({
|
|
|
197
170
|
|
|
198
171
|
return (
|
|
199
172
|
<>
|
|
200
|
-
<div className=
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
<
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
</
|
|
233
|
-
<div className='d-flex justify-content-end w-100 mb-6'>
|
|
234
|
-
<Button
|
|
235
|
-
appearance='basic'
|
|
236
|
-
onClick={() => setIsExpanded(!isExpanded)}
|
|
237
|
-
size="tiny"
|
|
238
|
-
>
|
|
239
|
-
{isExpanded ? 'Hide code' : 'Show code'}
|
|
240
|
-
</Button>
|
|
241
|
-
</div>
|
|
242
|
-
</CardBody>
|
|
243
|
-
</Card>
|
|
244
|
-
<TabsWrap onUpdate={updateHtml} />
|
|
245
|
-
{isExpanded && (
|
|
246
|
-
<Card
|
|
247
|
-
shadow='none'
|
|
248
|
-
className='w-100 overflow-hidden mt-4 live-editor-card'
|
|
249
|
-
>
|
|
250
|
-
<div className='d-flex px-5 pt-5 pb-4'>
|
|
251
|
-
<Button
|
|
252
|
-
appearance='basic'
|
|
253
|
-
onClick={() => setActiveButton('React')}
|
|
254
|
-
selected={
|
|
255
|
-
activeButton === 'React'
|
|
256
|
-
? true
|
|
257
|
-
: false
|
|
258
|
-
}
|
|
259
|
-
className='mr-3'
|
|
260
|
-
>
|
|
261
|
-
React
|
|
262
|
-
</Button>
|
|
263
|
-
<Button
|
|
264
|
-
appearance='basic'
|
|
265
|
-
onClick={() => setActiveButton('HTML')}
|
|
266
|
-
selected={
|
|
267
|
-
activeButton === 'HTML' ? true : false
|
|
268
|
-
}
|
|
269
|
-
>
|
|
270
|
-
HTML
|
|
271
|
-
</Button>
|
|
272
|
-
<CopyCode
|
|
273
|
-
onClick={() => {
|
|
274
|
-
copyToClipboard(jsxCode, htmlCode);
|
|
275
|
-
}}
|
|
276
|
-
/>
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
{showLiveEditorContent()}
|
|
173
|
+
<div className="pb-8 pt-4 d-flex w-100 m-auto flex-column align-items-center">
|
|
174
|
+
<ErrorBoundary>
|
|
175
|
+
<LiveProvider code={jsxCode ? jsxCode.replaceAll('action(', '() => console.log(') : ''} scope={imports}>
|
|
176
|
+
<Card shadow="none" className="w-100 overflow-hidden">
|
|
177
|
+
<CardHeader>
|
|
178
|
+
<div className="d-flex justify-content-end">
|
|
179
|
+
<Button
|
|
180
|
+
appearance="transparent"
|
|
181
|
+
aria-label="Zoom In"
|
|
182
|
+
onClick={() => handleZoomIn()}
|
|
183
|
+
icon="zoom_in"
|
|
184
|
+
largeIcon
|
|
185
|
+
/>
|
|
186
|
+
<Button
|
|
187
|
+
onClick={() => handleZoomOut()}
|
|
188
|
+
icon="zoom_out"
|
|
189
|
+
appearance="transparent"
|
|
190
|
+
aria-label="Zoom Out"
|
|
191
|
+
largeIcon
|
|
192
|
+
></Button>
|
|
193
|
+
</div>
|
|
194
|
+
</CardHeader>
|
|
195
|
+
<CardBody className="d-flex flex-column align-items-center">
|
|
196
|
+
<div className="w-100" ref={testRef}>
|
|
197
|
+
<LivePreview className="p-8 mw-100 mh-100 d-block live-provider mb-3" style={{ zoom: zoom }} />
|
|
198
|
+
<LiveError />
|
|
199
|
+
</div>
|
|
200
|
+
<div className="d-flex justify-content-end w-100 mb-6">
|
|
201
|
+
<Button appearance="basic" onClick={() => setIsExpanded(!isExpanded)} size="tiny">
|
|
202
|
+
{isExpanded ? 'Hide code' : 'Show code'}
|
|
203
|
+
</Button>
|
|
204
|
+
</div>
|
|
205
|
+
</CardBody>
|
|
280
206
|
</Card>
|
|
281
|
-
|
|
282
|
-
|
|
207
|
+
<TabsWrap onUpdate={updateHtml} />
|
|
208
|
+
{isExpanded && (
|
|
209
|
+
<Card shadow="none" className="w-100 overflow-hidden mt-4 live-editor-card">
|
|
210
|
+
<div className="d-flex px-5 pt-5 pb-4">
|
|
211
|
+
<Button
|
|
212
|
+
appearance="basic"
|
|
213
|
+
onClick={() => setActiveButton('React')}
|
|
214
|
+
selected={activeButton === 'React' ? true : false}
|
|
215
|
+
className="mr-3"
|
|
216
|
+
>
|
|
217
|
+
React
|
|
218
|
+
</Button>
|
|
219
|
+
<Button
|
|
220
|
+
appearance="basic"
|
|
221
|
+
onClick={() => setActiveButton('HTML')}
|
|
222
|
+
selected={activeButton === 'HTML' ? true : false}
|
|
223
|
+
>
|
|
224
|
+
HTML
|
|
225
|
+
</Button>
|
|
226
|
+
<CopyCode
|
|
227
|
+
onClick={() => {
|
|
228
|
+
copyToClipboard(jsxCode, htmlCode);
|
|
229
|
+
}}
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
|
|
233
|
+
{showLiveEditorContent()}
|
|
234
|
+
</Card>
|
|
235
|
+
)}
|
|
236
|
+
</LiveProvider>
|
|
283
237
|
</ErrorBoundary>
|
|
284
238
|
</div>
|
|
285
239
|
</>
|