@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
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as MDSComponents from '@innovaccer/design-system';
|
|
3
|
+
import PropsTable from './PropsTable';
|
|
4
|
+
import { ArgsTable } from './PropsTable/Table';
|
|
5
|
+
import axios from 'axios';
|
|
6
|
+
import Markdown from 'markdown-to-jsx';
|
|
7
|
+
import Rules from './Rules/Rules';
|
|
8
|
+
import DOs from './Rules/DOs';
|
|
9
|
+
import DONTs from './Rules/DONTs';
|
|
10
|
+
import InlineMessage from './Rules/InlineMessage';
|
|
11
|
+
import IconWrapper from './Rules/IconWrapper';
|
|
12
|
+
import MDXHeading from './MDXHeading';
|
|
13
|
+
|
|
14
|
+
const Rectangle = ({ name }) => {
|
|
15
|
+
return (
|
|
16
|
+
<div className='rectangle'>{name}</div>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const useGetStorybookData = async (name) => {
|
|
21
|
+
let componentName = name;
|
|
22
|
+
let componentPath = `/sb/${componentName}.json`;
|
|
23
|
+
|
|
24
|
+
// To handle Rich Text Editor Stories
|
|
25
|
+
if (name.startsWith('library')) {
|
|
26
|
+
componentPath = `/rte/${componentName}.json`;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const data = await axios.get(componentPath).then(({ data = {} }) => {
|
|
30
|
+
if (!Object.keys(data).length) {
|
|
31
|
+
return Promise.reject(`Could not get details for id: ${componentName}`);
|
|
32
|
+
}
|
|
33
|
+
return data;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return data;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
function getJsxCode(name) {
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
41
|
+
return useGetStorybookData(name)
|
|
42
|
+
.then(componentData => {
|
|
43
|
+
const jsxCode = componentData && componentData.parameters
|
|
44
|
+
? componentData.parameters.docs.docPage?.customCode ||
|
|
45
|
+
componentData.parameters.storySource?.source
|
|
46
|
+
: '';
|
|
47
|
+
return jsxCode;
|
|
48
|
+
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const Preview = ({ name }) => {
|
|
53
|
+
return (
|
|
54
|
+
<div>
|
|
55
|
+
<PropsTable
|
|
56
|
+
dataProvider={() => getJsxCode(name)}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
function getPropTableData(name) {
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
+
return useGetStorybookData(name)
|
|
65
|
+
.then(componentData => {
|
|
66
|
+
const jsxCode = componentData
|
|
67
|
+
? componentData.parameters.argTypes
|
|
68
|
+
: '';
|
|
69
|
+
return jsxCode;
|
|
70
|
+
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const FrameWrapper = ({ componentName }) => {
|
|
75
|
+
const onLoad = () => {
|
|
76
|
+
document.getElementById('iframe-loader').style.display = 'none';
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<>
|
|
81
|
+
<div id="iframe-loader">Loading ...</div>
|
|
82
|
+
<iframe
|
|
83
|
+
id="myFrame"
|
|
84
|
+
width="100%"
|
|
85
|
+
height="800px"
|
|
86
|
+
scrolling="no"
|
|
87
|
+
frameBorder="0"
|
|
88
|
+
onLoad={onLoad}
|
|
89
|
+
src={`https://mds.innovaccer.com/iframe.html?id=${componentName}&viewMode=docs&panel=true&nav=false&addons=1&stories=0&embed=prop-table`}
|
|
90
|
+
/>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const PreviewWithPropTable = ({ name, embed }) => {
|
|
96
|
+
const [data, setData] = React.useState({});
|
|
97
|
+
const [loading, setLoading] = React.useState(true);
|
|
98
|
+
const [error, setError] = React.useState(null);
|
|
99
|
+
|
|
100
|
+
React.useEffect(() => {
|
|
101
|
+
if (!embed) {
|
|
102
|
+
getPropTableData(name)
|
|
103
|
+
.then((data) => {
|
|
104
|
+
setData(data);
|
|
105
|
+
setLoading(false);
|
|
106
|
+
})
|
|
107
|
+
.catch((err) => {
|
|
108
|
+
setError(`Could not get details for id: ${name}`);
|
|
109
|
+
setLoading(false);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}, []);
|
|
113
|
+
|
|
114
|
+
if (loading && !embed) {
|
|
115
|
+
return <div> Loading ... </div>;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (error) {
|
|
119
|
+
return (
|
|
120
|
+
<MDSComponents.Message
|
|
121
|
+
className="my-7"
|
|
122
|
+
appearance="alert"
|
|
123
|
+
title={error}
|
|
124
|
+
description="Hold tight, we are working to get it up for you to interact with."
|
|
125
|
+
/>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<div className="overflow-x-scroll">{embed ? <FrameWrapper componentName={name} /> : <ArgsTable rows={data} />}</div>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const A11yBlock = ({ name }) => {
|
|
135
|
+
const [data, setData] = React.useState([]);
|
|
136
|
+
const [loading, setLoading] = React.useState(true);
|
|
137
|
+
const [error, setError] = React.useState(null);
|
|
138
|
+
|
|
139
|
+
React.useEffect(() => {
|
|
140
|
+
useGetStorybookData(name)
|
|
141
|
+
.then((componentData) => {
|
|
142
|
+
const a11yProps = componentData && componentData.parameters.docs.docPage?.a11yProps;
|
|
143
|
+
|
|
144
|
+
setData(a11yProps);
|
|
145
|
+
setLoading(false);
|
|
146
|
+
})
|
|
147
|
+
.catch((err) => {
|
|
148
|
+
setError(err);
|
|
149
|
+
setLoading(false);
|
|
150
|
+
});
|
|
151
|
+
}, []);
|
|
152
|
+
|
|
153
|
+
if (loading) {
|
|
154
|
+
return <div>Loading ...</div>;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (error) {
|
|
158
|
+
return (
|
|
159
|
+
<MDSComponents.Message
|
|
160
|
+
className="my-7"
|
|
161
|
+
appearance="alert"
|
|
162
|
+
title={error}
|
|
163
|
+
description="Hold tight, we are working to get it up for you to interact with."
|
|
164
|
+
/>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
return <div className="mb-8">{data && <Markdown className="A11y-markdown">{data}</Markdown>}</div>;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
const List = ({ children }) => {
|
|
171
|
+
return (
|
|
172
|
+
<div className='list'>
|
|
173
|
+
{children}
|
|
174
|
+
</div>
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const OrderedList = ({ children }) => {
|
|
179
|
+
return (
|
|
180
|
+
<ol className='ordered-list'>
|
|
181
|
+
{children}
|
|
182
|
+
</ol>
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const Caption = ({ children }) => {
|
|
187
|
+
return (
|
|
188
|
+
<MDSComponents.Text size="small" appearance="subtle" className="d-flex my-4 justify-content-center text-align--center">
|
|
189
|
+
{children}
|
|
190
|
+
</MDSComponents.Text>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export const MDXComponents = {
|
|
195
|
+
...MDSComponents,
|
|
196
|
+
Preview: Preview,
|
|
197
|
+
PreviewWithPropTable: PreviewWithPropTable,
|
|
198
|
+
A11yBlock: A11yBlock,
|
|
199
|
+
Rules,
|
|
200
|
+
DOs,
|
|
201
|
+
DONTs,
|
|
202
|
+
InlineMessage,
|
|
203
|
+
IconWrapper,
|
|
204
|
+
Caption,
|
|
205
|
+
ul: List,
|
|
206
|
+
ol: OrderedList,
|
|
207
|
+
h1: (props) => <MDXHeading size='xxl' headingInfo={props} />,
|
|
208
|
+
h2: (props) => <MDXHeading size='xl' headingInfo={props} />,
|
|
209
|
+
h3: (props) => <MDXHeading size='l' headingInfo={props} />,
|
|
210
|
+
h4: (props) => <MDXHeading size="m" headingInfo={props} />,
|
|
211
|
+
h5: (props) => <MDXHeading size="s" headingInfo={props} />,
|
|
212
|
+
Rectangle: (props) => <Rectangle {...props} />,
|
|
213
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { useState } from
|
|
2
|
-
import { Heading, Icon, Tooltip } from
|
|
3
|
-
import { copyMessage, copyMessageSuccess } from
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Heading, Icon, Tooltip } from '@innovaccer/design-system';
|
|
3
|
+
import { copyMessage, copyMessageSuccess } from '../util/constants.js';
|
|
4
4
|
|
|
5
5
|
const copyToClipboard = (str) => {
|
|
6
6
|
navigator.clipboard.writeText(str);
|
|
@@ -23,22 +23,20 @@ const MDXHeading = ({ size, headingInfo }) => {
|
|
|
23
23
|
|
|
24
24
|
if (currURL.includes(id)) {
|
|
25
25
|
copyToClipboard(currURL);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
else {
|
|
31
|
-
copyToClipboard(currURL + "#" + id);
|
|
26
|
+
} else if (currURL.includes('#')) {
|
|
27
|
+
copyToClipboard(currURL.slice(0, currURL.indexOf('#') + 1) + id);
|
|
28
|
+
} else {
|
|
29
|
+
copyToClipboard(currURL + '#' + id);
|
|
32
30
|
}
|
|
33
31
|
setTooltipActive(true);
|
|
34
32
|
setTooltipName(copyMessageSuccess);
|
|
35
33
|
};
|
|
36
34
|
|
|
37
35
|
const sizeMarginMapper = {
|
|
38
|
-
s:
|
|
39
|
-
m:
|
|
40
|
-
l:
|
|
41
|
-
}
|
|
36
|
+
s: 'mt-4',
|
|
37
|
+
m: 'mt-4',
|
|
38
|
+
l: 'mt-6',
|
|
39
|
+
};
|
|
42
40
|
|
|
43
41
|
return (
|
|
44
42
|
<div
|
|
@@ -47,11 +45,7 @@ const MDXHeading = ({ size, headingInfo }) => {
|
|
|
47
45
|
onMouseLeave={onMouseLeaveHandler}
|
|
48
46
|
className={`d-inline-flex w-100 align-items-center ${sizeMarginMapper[size]}`}
|
|
49
47
|
>
|
|
50
|
-
<Heading
|
|
51
|
-
className="mr-4"
|
|
52
|
-
size={size}
|
|
53
|
-
{...headingInfo}
|
|
54
|
-
/>
|
|
48
|
+
<Heading className="mr-4" size={size} {...headingInfo} />
|
|
55
49
|
<div className="cursor-pointer d-flex">
|
|
56
50
|
{isHovered && (
|
|
57
51
|
<Tooltip
|
|
@@ -6,7 +6,7 @@ const favicon = '/icons/favicon_io/favicon-16x16.png';
|
|
|
6
6
|
const faviconLarge = '/icons/favicon_io/favicon-32x32.png';
|
|
7
7
|
const faviconApple = '/icons/favicon_io/apple-touch-icon.png';
|
|
8
8
|
const cardImage = '/icons/card-image.png';
|
|
9
|
-
const GA_MEASUREMENT_ID =
|
|
9
|
+
const GA_MEASUREMENT_ID = 'G-HTLCYE0XZT';
|
|
10
10
|
|
|
11
11
|
const Meta = ({ docTitle, docDescription, pageKeywords, titleType, frontmatter, relativePagePath }) => {
|
|
12
12
|
const { title, description, keywords, lang } = useMetadata();
|
|
@@ -32,9 +32,11 @@ const Meta = ({ docTitle, docDescription, pageKeywords, titleType, frontmatter,
|
|
|
32
32
|
|
|
33
33
|
function embedGoogleAnalytics() {
|
|
34
34
|
// <!-- Global site tag (gtag.js) - Google Analytics -->
|
|
35
|
-
if (typeof window !==
|
|
35
|
+
if (typeof window !== 'undefined') {
|
|
36
36
|
window.dataLayer = window.dataLayer || [];
|
|
37
|
-
function gtag() {
|
|
37
|
+
function gtag() {
|
|
38
|
+
window.dataLayer && window.dataLayer.push(arguments);
|
|
39
|
+
}
|
|
38
40
|
gtag('js', new Date());
|
|
39
41
|
gtag('config', GA_MEASUREMENT_ID);
|
|
40
42
|
}
|
|
@@ -105,14 +107,12 @@ const Meta = ({ docTitle, docDescription, pageKeywords, titleType, frontmatter,
|
|
|
105
107
|
]}
|
|
106
108
|
>
|
|
107
109
|
<html lang={lang} />
|
|
108
|
-
<link rel=
|
|
109
|
-
<link rel=
|
|
110
|
-
<link rel=
|
|
110
|
+
<link rel="icon" href={favicon} />
|
|
111
|
+
<link rel="icon" href={faviconLarge} />
|
|
112
|
+
<link rel="icon" href={faviconApple} />
|
|
111
113
|
{/* <!-- Global site tag (gtag.js) - Google Analytics --> */}
|
|
112
114
|
<script async src={`https://www.googletagmanager.com/gtag/js?id=${GA_MEASUREMENT_ID}`}></script>
|
|
113
|
-
<script>
|
|
114
|
-
{embedGoogleAnalytics()}
|
|
115
|
-
</script>
|
|
115
|
+
<script>{embedGoogleAnalytics()}</script>
|
|
116
116
|
</Helmet>
|
|
117
117
|
);
|
|
118
118
|
};
|
|
@@ -63,13 +63,9 @@ export const Table = styled.table(({ theme }) => ({
|
|
|
63
63
|
}));
|
|
64
64
|
|
|
65
65
|
export const ArgJsDoc: FC<ArgJsDocArgs> = ({ tags }) => {
|
|
66
|
-
const params = (tags.params || []).filter(
|
|
67
|
-
(x) => x.description
|
|
68
|
-
);
|
|
66
|
+
const params = (tags.params || []).filter((x) => x.description);
|
|
69
67
|
const hasDisplayableParams = params.length !== 0;
|
|
70
|
-
const hasDisplayableReturns =
|
|
71
|
-
tags.returns != null &&
|
|
72
|
-
tags.returns.description != null;
|
|
68
|
+
const hasDisplayableReturns = tags.returns != null && tags.returns.description != null;
|
|
73
69
|
|
|
74
70
|
if (!hasDisplayableParams && !hasDisplayableReturns) {
|
|
75
71
|
return null;
|
|
@@ -44,15 +44,13 @@ const Description = styled.div(() => ({
|
|
|
44
44
|
},
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
|
-
const Type = styled.div<{ hasDescription: boolean }>(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
theme.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})
|
|
55
|
-
);
|
|
47
|
+
const Type = styled.div<{ hasDescription: boolean }>(({ hasDescription }) => ({
|
|
48
|
+
color:
|
|
49
|
+
theme.base === 'light'
|
|
50
|
+
? transparentize(0.1, theme.color.defaultText)
|
|
51
|
+
: transparentize(0.2, theme.color.defaultText),
|
|
52
|
+
marginTop: hasDescription ? 4 : 0,
|
|
53
|
+
}));
|
|
56
54
|
|
|
57
55
|
const TypeWithJsDoc = styled.div<{
|
|
58
56
|
hasDescription: boolean;
|
|
@@ -65,35 +63,24 @@ const TypeWithJsDoc = styled.div<{
|
|
|
65
63
|
marginBottom: 12,
|
|
66
64
|
}));
|
|
67
65
|
|
|
68
|
-
const StyledTd = styled.td<{ expandable: boolean }>(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})
|
|
72
|
-
);
|
|
66
|
+
const StyledTd = styled.td<{ expandable: boolean }>(({ expandable }) => ({
|
|
67
|
+
paddingLeft: '20px',
|
|
68
|
+
}));
|
|
73
69
|
|
|
74
70
|
export const ArgRow: FC<ArgRowProps> = (props) => {
|
|
75
|
-
const {
|
|
76
|
-
row,
|
|
77
|
-
updateArgs,
|
|
78
|
-
compact,
|
|
79
|
-
initialExpandedArgs,
|
|
80
|
-
} = props;
|
|
71
|
+
const { row, updateArgs, compact, initialExpandedArgs } = props;
|
|
81
72
|
const { name, description } = row;
|
|
82
73
|
const table = (row.table || {}) as TableAnnotation;
|
|
83
74
|
const type = table.type || row.type;
|
|
84
|
-
const defaultValue =
|
|
85
|
-
table.defaultValue || row.defaultValue;
|
|
75
|
+
const defaultValue = table.defaultValue || row.defaultValue;
|
|
86
76
|
const required = row.type?.required;
|
|
87
|
-
const hasDescription =
|
|
88
|
-
description != null && description !== '';
|
|
77
|
+
const hasDescription = description != null && description !== '';
|
|
89
78
|
|
|
90
79
|
return (
|
|
91
80
|
<tr>
|
|
92
81
|
<StyledTd expandable={true}>
|
|
93
82
|
<Name>{name}</Name>
|
|
94
|
-
{required ?
|
|
95
|
-
<Required title="Required">*</Required>
|
|
96
|
-
) : null}
|
|
83
|
+
{required ? <Required title="Required">*</Required> : null}
|
|
97
84
|
</StyledTd>
|
|
98
85
|
{compact ? null : (
|
|
99
86
|
<td>
|
|
@@ -104,39 +91,24 @@ export const ArgRow: FC<ArgRowProps> = (props) => {
|
|
|
104
91
|
)}
|
|
105
92
|
{table.jsDocTags != null ? (
|
|
106
93
|
<>
|
|
107
|
-
<TypeWithJsDoc
|
|
108
|
-
|
|
109
|
-
>
|
|
110
|
-
<ArgValue
|
|
111
|
-
value={type}
|
|
112
|
-
initialExpandedArgs={initialExpandedArgs}
|
|
113
|
-
/>
|
|
94
|
+
<TypeWithJsDoc hasDescription={hasDescription}>
|
|
95
|
+
<ArgValue value={type} initialExpandedArgs={initialExpandedArgs} />
|
|
114
96
|
</TypeWithJsDoc>
|
|
115
97
|
<ArgJsDoc tags={table.jsDocTags} />
|
|
116
98
|
</>
|
|
117
99
|
) : (
|
|
118
100
|
<Type hasDescription={hasDescription}>
|
|
119
|
-
<ArgValue
|
|
120
|
-
value={type}
|
|
121
|
-
initialExpandedArgs={initialExpandedArgs}
|
|
122
|
-
/>
|
|
101
|
+
<ArgValue value={type} initialExpandedArgs={initialExpandedArgs} />
|
|
123
102
|
</Type>
|
|
124
103
|
)}
|
|
125
104
|
</td>
|
|
126
105
|
)}
|
|
127
106
|
{compact ? null : (
|
|
128
107
|
<td>
|
|
129
|
-
<ArgValue
|
|
130
|
-
value={defaultValue}
|
|
131
|
-
initialExpandedArgs={initialExpandedArgs}
|
|
132
|
-
/>
|
|
108
|
+
<ArgValue value={defaultValue} initialExpandedArgs={initialExpandedArgs} />
|
|
133
109
|
</td>
|
|
134
110
|
)}
|
|
135
|
-
{updateArgs ? (
|
|
136
|
-
<td>
|
|
137
|
-
{/* <ArgControl {...(props as ArgControlProps)} /> */}
|
|
138
|
-
</td>
|
|
139
|
-
) : null}
|
|
111
|
+
{updateArgs ? <td>{/* <ArgControl {...(props as ArgControlProps)} /> */}</td> : null}
|
|
140
112
|
</tr>
|
|
141
113
|
);
|
|
142
114
|
};
|
|
@@ -22,39 +22,34 @@ interface ArgSummaryProps {
|
|
|
22
22
|
|
|
23
23
|
const ITEMS_BEFORE_EXPANSION = 8;
|
|
24
24
|
|
|
25
|
-
const Summary = styled.div<{ isExpanded?: boolean }>(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
border: '0 none',
|
|
54
|
-
paddingLeft: 0,
|
|
55
|
-
}),
|
|
56
|
-
})
|
|
57
|
-
);
|
|
25
|
+
const Summary = styled.div<{ isExpanded?: boolean }>(({ isExpanded }) => ({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexDirection: isExpanded ? 'column' : 'row',
|
|
28
|
+
flexWrap: 'wrap',
|
|
29
|
+
alignItems: 'flex-start',
|
|
30
|
+
marginBottom: '-4px',
|
|
31
|
+
minWidth: 100,
|
|
32
|
+
}));
|
|
33
|
+
|
|
34
|
+
const Text = styled.span<{ simple?: boolean }>(codeCommon, ({ simple = false }) => ({
|
|
35
|
+
flex: '0 0 auto',
|
|
36
|
+
fontFamily: theme.typography.fonts.mono,
|
|
37
|
+
fontSize: '12px',
|
|
38
|
+
wordBreak: 'break-word',
|
|
39
|
+
whiteSpace: 'normal',
|
|
40
|
+
maxWidth: '100%',
|
|
41
|
+
margin: 0,
|
|
42
|
+
marginRight: '4px',
|
|
43
|
+
marginBottom: '4px',
|
|
44
|
+
paddingTop: '2px',
|
|
45
|
+
paddingBottom: '2px',
|
|
46
|
+
lineHeight: '13px',
|
|
47
|
+
...(simple && {
|
|
48
|
+
background: 'transparent',
|
|
49
|
+
border: '0 none',
|
|
50
|
+
paddingLeft: 0,
|
|
51
|
+
}),
|
|
52
|
+
}));
|
|
58
53
|
|
|
59
54
|
const ExpandButton = styled.button<{}>(() => ({
|
|
60
55
|
fontFamily: theme.typography?.fonts.mono,
|
|
@@ -64,18 +59,15 @@ const ExpandButton = styled.button<{}>(() => ({
|
|
|
64
59
|
border: 'none',
|
|
65
60
|
}));
|
|
66
61
|
|
|
67
|
-
const Expandable = styled.div<{}>(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
alignItems: 'center',
|
|
77
|
-
})
|
|
78
|
-
);
|
|
62
|
+
const Expandable = styled.div<{}>(codeCommon, ({ theme }) => ({
|
|
63
|
+
fontFamily: theme.typography?.fonts.mono,
|
|
64
|
+
color: theme.color?.secondary,
|
|
65
|
+
fontSize: theme.typography?.size.s1, // overrides codeCommon
|
|
66
|
+
margin: 0,
|
|
67
|
+
whiteSpace: 'nowrap',
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
}));
|
|
79
71
|
|
|
80
72
|
const EmptyArg = () => {
|
|
81
73
|
return <span>-</span>;
|
|
@@ -88,50 +80,32 @@ const ArgText: FC<ArgTextProps> = ({ text, simple }) => {
|
|
|
88
80
|
const getSummaryItems = (summary: string) => {
|
|
89
81
|
if (!summary) return [summary];
|
|
90
82
|
const splittedItems = summary.split('|');
|
|
91
|
-
const summaryItems = splittedItems.map((value) =>
|
|
92
|
-
value.trim()
|
|
93
|
-
);
|
|
83
|
+
const summaryItems = splittedItems.map((value) => value.trim());
|
|
94
84
|
|
|
95
85
|
return uniq(summaryItems);
|
|
96
86
|
};
|
|
97
87
|
|
|
98
|
-
const renderSummaryItems = (
|
|
99
|
-
summaryItems: string[],
|
|
100
|
-
isExpanded = true
|
|
101
|
-
) => {
|
|
88
|
+
const renderSummaryItems = (summaryItems: string[], isExpanded = true) => {
|
|
102
89
|
let items = summaryItems;
|
|
103
90
|
if (!isExpanded) {
|
|
104
91
|
items = summaryItems.slice(0, ITEMS_BEFORE_EXPANSION);
|
|
105
92
|
}
|
|
106
93
|
|
|
107
|
-
return items.map((item) =>
|
|
108
|
-
<ArgText key={item} text={item === '' ? '""' : item} />
|
|
109
|
-
));
|
|
94
|
+
return items.map((item) => <ArgText key={item} text={item === '' ? '""' : item} />);
|
|
110
95
|
};
|
|
111
96
|
|
|
112
|
-
const ArgSummary: FC<ArgSummaryProps> = ({
|
|
113
|
-
value,
|
|
114
|
-
initialExpandedArgs,
|
|
115
|
-
}) => {
|
|
97
|
+
const ArgSummary: FC<ArgSummaryProps> = ({ value, initialExpandedArgs }) => {
|
|
116
98
|
const { summary, detail } = value;
|
|
117
99
|
|
|
118
|
-
const [isExpanded, setIsExpanded] = useState(
|
|
119
|
-
initialExpandedArgs || false
|
|
120
|
-
);
|
|
100
|
+
const [isExpanded, setIsExpanded] = useState(initialExpandedArgs || false);
|
|
121
101
|
|
|
122
|
-
if (summary === undefined || summary === null)
|
|
123
|
-
return null;
|
|
102
|
+
if (summary === undefined || summary === null) return null;
|
|
124
103
|
// summary is used for the default value
|
|
125
104
|
// below check fixes not displaying default values for boolean typescript vars
|
|
126
|
-
const summaryAsString =
|
|
127
|
-
typeof summary.toString === 'function'
|
|
128
|
-
? summary.toString()
|
|
129
|
-
: summary;
|
|
105
|
+
const summaryAsString = typeof summary.toString === 'function' ? summary.toString() : summary;
|
|
130
106
|
|
|
131
107
|
if (detail == null) {
|
|
132
|
-
const cannotBeSafelySplitted = /[(){}[\]<>]/.test(
|
|
133
|
-
summaryAsString
|
|
134
|
-
);
|
|
108
|
+
const cannotBeSafelySplitted = /[(){}[\]<>]/.test(summaryAsString);
|
|
135
109
|
|
|
136
110
|
if (cannotBeSafelySplitted) {
|
|
137
111
|
return <ArgText text={summaryAsString} />;
|
|
@@ -139,20 +113,13 @@ const ArgSummary: FC<ArgSummaryProps> = ({
|
|
|
139
113
|
|
|
140
114
|
const summaryItems = getSummaryItems(summaryAsString);
|
|
141
115
|
const itemsCount = summaryItems.length;
|
|
142
|
-
const hasManyItems =
|
|
143
|
-
itemsCount > ITEMS_BEFORE_EXPANSION;
|
|
116
|
+
const hasManyItems = itemsCount > ITEMS_BEFORE_EXPANSION;
|
|
144
117
|
|
|
145
118
|
return hasManyItems ? (
|
|
146
119
|
<Summary isExpanded={isExpanded}>
|
|
147
120
|
{renderSummaryItems(summaryItems, isExpanded)}
|
|
148
|
-
<ExpandButton
|
|
149
|
-
|
|
150
|
-
>
|
|
151
|
-
{isExpanded
|
|
152
|
-
? 'Show less...'
|
|
153
|
-
: `Show ${
|
|
154
|
-
itemsCount - ITEMS_BEFORE_EXPANSION
|
|
155
|
-
} more...`}
|
|
121
|
+
<ExpandButton onClick={() => setIsExpanded(!isExpanded)}>
|
|
122
|
+
{isExpanded ? 'Show less...' : `Show ${itemsCount - ITEMS_BEFORE_EXPANSION} more...`}
|
|
156
123
|
</ExpandButton>
|
|
157
124
|
</Summary>
|
|
158
125
|
) : (
|
|
@@ -167,16 +134,6 @@ const ArgSummary: FC<ArgSummaryProps> = ({
|
|
|
167
134
|
);
|
|
168
135
|
};
|
|
169
136
|
|
|
170
|
-
export const ArgValue: FC<ArgValueProps> = ({
|
|
171
|
-
value
|
|
172
|
-
initialExpandedArgs,
|
|
173
|
-
}) => {
|
|
174
|
-
return value == null ? (
|
|
175
|
-
<EmptyArg />
|
|
176
|
-
) : (
|
|
177
|
-
<ArgSummary
|
|
178
|
-
value={value}
|
|
179
|
-
initialExpandedArgs={initialExpandedArgs}
|
|
180
|
-
/>
|
|
181
|
-
);
|
|
137
|
+
export const ArgValue: FC<ArgValueProps> = ({ value, initialExpandedArgs }) => {
|
|
138
|
+
return value == null ? <EmptyArg /> : <ArgSummary value={value} initialExpandedArgs={initialExpandedArgs} />;
|
|
182
139
|
};
|
|
@@ -3,8 +3,7 @@ import { styled } from '@storybook/theming';
|
|
|
3
3
|
import { withReset } from './Shared';
|
|
4
4
|
|
|
5
5
|
const Wrapper = styled.div<{}>(withReset, ({ theme }) => ({
|
|
6
|
-
backgroundColor:
|
|
7
|
-
theme.base === 'light' ? 'rgba(0,0,0,.01)' : 'rgba(255,255,255,.01)',
|
|
6
|
+
backgroundColor: theme.base === 'light' ? 'rgba(0,0,0,.01)' : 'rgba(255,255,255,.01)',
|
|
8
7
|
borderRadius: theme.appBorderRadius,
|
|
9
8
|
border: `1px dashed ${theme.appBorderColor}`,
|
|
10
9
|
display: 'flex',
|
|
@@ -17,6 +16,4 @@ const Wrapper = styled.div<{}>(withReset, ({ theme }) => ({
|
|
|
17
16
|
// fontSize: theme.typography.size.s2,
|
|
18
17
|
}));
|
|
19
18
|
|
|
20
|
-
export const EmptyBlock = (props: any) =>
|
|
21
|
-
<Wrapper {...props} className="docblock-emptyblock" />
|
|
22
|
-
);
|
|
19
|
+
export const EmptyBlock = (props: any) => <Wrapper {...props} className="docblock-emptyblock" />;
|