@innovaccer/design-system 2.7.0 → 2.9.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/chromatic.yml +3 -1
- package/.github/workflows/docs_pull_request.yml +20 -0
- package/.github/workflows/main.yml +1 -1
- package/.github/workflows/manual.yml +1 -1
- package/.github/workflows/pull_request.yml +1 -1
- package/.github/workflows/test.yml +1 -1
- package/CHANGELOG.md +68 -0
- package/README.md +6 -0
- package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +8 -8
- package/core/components/atoms/_chip/index.tsx +1 -1
- package/core/components/atoms/avatar/__tests__/__snapshots__/Avatar.test.tsx.snap +20 -0
- package/core/components/atoms/avatarGroup/AvatarCount.tsx +29 -0
- package/core/components/atoms/avatarGroup/AvatarGroup.tsx +16 -62
- package/core/components/atoms/avatarGroup/AvatarPopperBody.tsx +37 -0
- package/core/components/atoms/avatarGroup/Avatars.tsx +23 -0
- package/core/components/atoms/avatarGroup/__stories__/index.story.tsx +41 -0
- package/core/components/atoms/avatarGroup/__tests__/AvatarGroup.test.tsx +1 -1
- package/core/components/atoms/avatarGroup/__tests__/__snapshots__/AvatarGroup.test.tsx.snap +8 -4
- package/core/components/atoms/button/Button.tsx +1 -2
- package/core/components/atoms/checkbox/__stories__/Group.story.tsx +1 -1
- package/core/components/atoms/checkbox/__stories__/Nested.story.tsx +2 -0
- package/core/components/atoms/chip/__tests__/__snapshots__/Chip.test.tsx.snap +11 -11
- package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +4 -4
- package/core/components/atoms/dropdown/DropdownButton.tsx +1 -1
- package/core/components/atoms/dropdown/DropdownList.tsx +56 -29
- package/core/components/atoms/dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +29 -2
- package/core/components/atoms/popperWrapper/PopperWrapper.tsx +104 -12
- package/core/components/atoms/toast/__stories__/WithDescription.story.tsx +3 -1
- package/core/components/css-utilities/designTokens/Data.tsx +18 -0
- package/core/components/css-utilities/designTokens/Transitions.story.tsx +37 -0
- package/core/components/molecules/chipInput/__tests__/__snapshots__/ChipInput.test.tsx.snap +4 -4
- package/core/components/molecules/dialog/__tests__/__snapshots__/Dialog.test.tsx.snap +260 -195
- package/core/components/molecules/editableChipInput/__tests__/__snapshots__/EditableChipInput.test.tsx.snap +4 -4
- package/core/components/molecules/editableDropdown/__tests__/__snapshots__/EditableDropdown.test.tsx.snap +1 -0
- package/core/components/molecules/fullscreenModal/FullscreenModal.tsx +13 -12
- package/core/components/molecules/fullscreenModal/__tests__/Fullscreen.test.tsx +2 -5
- package/core/components/molecules/fullscreenModal/__tests__/__snapshots__/Fullscreen.test.tsx.snap +126 -96
- package/core/components/molecules/modal/Modal.tsx +11 -9
- package/core/components/molecules/modal/__tests__/__snapshots__/Modal.test.tsx.snap +240 -180
- package/core/components/molecules/popover/Popover.tsx +9 -0
- package/core/components/molecules/popover/__tests__/__snapshots__/Popover.test.tsx.snap +16 -8
- package/core/components/molecules/sidesheet/Sidesheet.tsx +23 -22
- package/core/components/molecules/sidesheet/__tests__/__snapshots__/Sidesheet.test.tsx.snap +40 -30
- package/core/components/molecules/tooltip/Tooltip.tsx +20 -1
- package/core/components/molecules/tooltip/__tests__/__snapshots__/Tooltip.test.tsx.snap +8 -0
- package/core/components/organisms/calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +8 -8
- package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +14 -13
- package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +42 -30
- package/core/components/organisms/grid/GridBody.tsx +1 -2
- package/core/components/organisms/table/Table.tsx +0 -1
- package/core/components/organisms/table/__stories__/NestedTableWithNestedCard.story.tsx +2 -2
- package/core/components/organisms/table/__tests__/__snapshots__/Table.test.tsx.snap +1544 -0
- package/core/components/organisms/verticalNav/MenuItem.tsx +6 -2
- package/core/components/organisms/verticalNav/VerticalNav.tsx +8 -2
- package/core/components/organisms/verticalNav/__stories__/CustomItemsRenderer.story.tsx +238 -0
- package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +168 -3
- package/css/dist/index.css +300 -62
- package/css/dist/index.css.map +1 -1
- package/css/src/components/ProgressBar.css +1 -1
- package/css/src/components/avatarGroup.css +0 -9
- package/css/src/components/button.css +4 -4
- package/css/src/components/chip.css +4 -0
- package/css/src/components/dropdown.css +5 -9
- package/css/src/components/dropdownButton.css +2 -0
- package/css/src/components/fullscreenModal.css +0 -5
- package/css/src/components/grid.css +0 -11
- package/css/src/components/overlay.css +0 -11
- package/css/src/components/popover.css +12 -0
- package/css/src/components/slider.css +1 -0
- package/css/src/components/tabs.css +1 -1
- package/css/src/components/textarea.css +0 -11
- package/css/src/components/tooltip.css +115 -0
- package/css/src/components/verticalNav.css +2 -0
- package/css/src/core/animation.css +8 -0
- package/css/src/core/utilities.css +11 -0
- package/css/src/utils/utility.css +4 -0
- package/css/src/variables/index.css +19 -0
- package/dist/core/components/atoms/avatarGroup/AvatarCount.d.ts +2 -0
- package/dist/core/components/atoms/avatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/core/components/atoms/avatarGroup/AvatarPopperBody.d.ts +2 -0
- package/dist/core/components/atoms/avatarGroup/Avatars.d.ts +2 -0
- package/dist/core/components/atoms/popperWrapper/PopperWrapper.d.ts +61 -54
- package/dist/core/components/css-utilities/designTokens/Data.d.ts +8 -0
- package/dist/core/components/css-utilities/designTokens/Transitions.story.d.ts +12 -0
- package/dist/core/components/molecules/popover/Popover.d.ts +4 -0
- package/dist/core/components/molecules/sidesheet/Sidesheet.d.ts +1 -0
- package/dist/core/components/organisms/verticalNav/MenuItem.d.ts +1 -0
- package/dist/core/components/organisms/verticalNav/VerticalNav.d.ts +2 -0
- package/dist/index.esm.js +278 -142
- package/dist/index.js +282 -149
- 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 +1 -0
- package/docs/.unotes/templates/title_date.hbs +4 -0
- package/docs/.unotes/unotes_meta.json +302 -0
- package/docs/LICENSE +21 -0
- package/docs/README.md +31 -0
- package/docs/gatsby-browser.js +6 -0
- package/docs/gatsby-config.js +171 -0
- package/docs/gatsby-node.js +75 -0
- package/docs/index.js +1 -0
- package/docs/package.json +54 -0
- package/docs/src/components/Colors/Colors.css +19 -0
- package/docs/src/components/Colors/Colors.js +82 -0
- package/docs/src/components/Container/ComponentsContainer.js +75 -0
- package/docs/src/components/Container/Container.js +114 -0
- package/docs/src/components/Container/index.js +3 -0
- package/docs/src/components/Footer/Footer.css +7 -0
- package/docs/src/components/Footer/Footer.js +40 -0
- package/docs/src/components/Header/Header.css +32 -0
- package/docs/src/components/Header/Header.js +60 -0
- package/docs/src/components/Header/index.js +3 -0
- package/docs/src/components/LastModifiedDate/LastModifiedDate.js +24 -0
- package/docs/src/components/LastModifiedDate/index.js +3 -0
- package/docs/src/components/Layout.js +291 -0
- package/docs/src/components/LeftNav/LeftNav.js +101 -0
- package/docs/src/components/LeftNav/index.js +3 -0
- package/docs/src/components/Logos/Logos.css +29 -0
- package/docs/src/components/Logos/Logos.js +64 -0
- package/docs/src/components/Meta.js +101 -0
- package/docs/src/components/PropsTable/ArgJsDoc.tsx +102 -0
- package/docs/src/components/PropsTable/ArgRow.tsx +142 -0
- package/docs/src/components/PropsTable/ArgValue.tsx +182 -0
- package/docs/src/components/PropsTable/EmptyBlock.tsx +22 -0
- package/docs/src/components/PropsTable/SectionRow.tsx +126 -0
- package/docs/src/components/PropsTable/Shared.tsx +53 -0
- package/docs/src/components/PropsTable/Table.tsx +463 -0
- package/docs/src/components/PropsTable/card.css +7 -0
- package/docs/src/components/PropsTable/generateImports.tsx +20 -0
- package/docs/src/components/PropsTable/index.js +248 -0
- package/docs/src/components/PropsTable/prism.css +146 -0
- package/docs/src/components/PropsTable/sandbox.tsx +81 -0
- package/docs/src/components/PropsTable/theme.js +53 -0
- package/docs/src/components/PropsTable/types.tsx +44 -0
- package/docs/src/components/Rules/DONTs.js +13 -0
- package/docs/src/components/Rules/DOs.js +13 -0
- package/docs/src/components/Rules/IconWrapper.js +18 -0
- package/docs/src/components/Rules/InlineMessage.js +11 -0
- package/docs/src/components/Rules/Rules.css +17 -0
- package/docs/src/components/Rules/Rules.js +39 -0
- package/docs/src/components/TableOfContent/TableOfContent.css +37 -0
- package/docs/src/components/TableOfContent/TableOfContent.js +126 -0
- package/docs/src/components/css/global.css +15 -0
- package/docs/src/components/css/prism.css +38 -0
- package/docs/src/components/css/style.css +97 -0
- package/docs/src/components/templates/Default.js +24 -0
- package/docs/src/components/templates/Homepage.js +13 -0
- package/docs/src/data/components/images/Avatars.png +0 -0
- package/docs/src/data/components/images/Datepicker.png +0 -0
- package/docs/src/data/components/images/EditableChipInput.png +0 -0
- package/docs/src/data/components/images/Modal.png +0 -0
- package/docs/src/data/components/images/Sidesheet.png +0 -0
- package/docs/src/data/components/images/Table.png +0 -0
- package/docs/src/data/components/index.js +285 -0
- package/docs/src/data/footer-items.yaml +16 -0
- package/docs/src/data/header-items.yaml +20 -0
- package/docs/src/data/home-menu.yaml +23 -0
- package/docs/src/data/home-resources.yaml +14 -0
- package/docs/src/data/nav/components.yaml +45 -0
- package/docs/src/data/nav/content.yaml +25 -0
- package/docs/src/data/nav/default.yaml +11 -0
- package/docs/src/data/nav/foundations.yaml +22 -0
- package/docs/src/data/nav/guide-items.yaml +6 -0
- package/docs/src/data/nav/introduction.yaml +11 -0
- package/docs/src/data/storybook.json +345189 -0
- package/docs/src/pages/404.js +31 -0
- package/docs/src/pages/components/avatar/code.mdx +14 -0
- package/docs/src/pages/components/avatar/images/avatar-1.png +0 -0
- package/docs/src/pages/components/avatar/images/avatar-2.png +0 -0
- package/docs/src/pages/components/avatar/images/avatar-3.png +0 -0
- package/docs/src/pages/components/avatar/images/avatar-4.png +0 -0
- package/docs/src/pages/components/avatar/images/avatar-5.png +0 -0
- package/docs/src/pages/components/avatar/usage.mdx +53 -0
- package/docs/src/pages/components/badges/code.mdx +15 -0
- package/docs/src/pages/components/badges/images/badges-1.png +0 -0
- package/docs/src/pages/components/badges/images/badges-2.png +0 -0
- package/docs/src/pages/components/badges/usage.mdx +43 -0
- package/docs/src/pages/components/breadcrumbs/code.mdx +15 -0
- package/docs/src/pages/components/breadcrumbs/usage.mdx +30 -0
- package/docs/src/pages/components/button/code.mdx +18 -0
- package/docs/src/pages/components/button/content.mdx +652 -0
- package/docs/src/pages/components/button/images/buttons-1.png +0 -0
- package/docs/src/pages/components/button/images/buttons-2.png +0 -0
- package/docs/src/pages/components/button/usage.mdx +100 -0
- package/docs/src/pages/components/calendar/code.mdx +15 -0
- package/docs/src/pages/components/calendar/usage.mdx +9 -0
- package/docs/src/pages/components/card/code.mdx +15 -0
- package/docs/src/pages/components/card/usage.mdx +54 -0
- package/docs/src/pages/components/checkbox/code.mdx +16 -0
- package/docs/src/pages/components/checkbox/usage.mdx +49 -0
- package/docs/src/pages/components/chips/code.mdx +15 -0
- package/docs/src/pages/components/chips/usage.mdx +34 -0
- package/docs/src/pages/components/datePicker/code.mdx +7 -0
- package/docs/src/pages/components/datePicker/images/datePicker-1.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-2.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-3.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-4.png +0 -0
- package/docs/src/pages/components/datePicker/images/datePicker-5.png +0 -0
- package/docs/src/pages/components/datePicker/usage.mdx +58 -0
- package/docs/src/pages/components/index.mdx +7 -0
- package/docs/src/pages/components/message/code.mdx +16 -0
- package/docs/src/pages/components/message/usage.mdx +26 -0
- package/docs/src/pages/components/overview/index.mdx +6 -0
- package/docs/src/pages/components/overview/tabs/Overview.js +72 -0
- package/docs/src/pages/components/overview/tabs/all-components.mdx +10 -0
- package/docs/src/pages/components/overview/tabs/overview.css +30 -0
- package/docs/src/pages/components/overview/tabs/status.mdx +22 -0
- package/docs/src/pages/components/radio/code.mdx +17 -0
- package/docs/src/pages/components/radio/usage.mdx +126 -0
- package/docs/src/pages/components/sidesheet/code.mdx +8 -0
- package/docs/src/pages/components/sidesheet/interactions.mdx +8 -0
- package/docs/src/pages/components/sidesheet/usage.mdx +25 -0
- package/docs/src/pages/components/slider/code.mdx +15 -0
- package/docs/src/pages/components/slider/usage.mdx +49 -0
- package/docs/src/pages/components/statushint/code.mdx +15 -0
- package/docs/src/pages/components/statushint/usage.mdx +19 -0
- package/docs/src/pages/components/steppers/code.mdx +16 -0
- package/docs/src/pages/components/steppers/images/stepper-1.gif +0 -0
- package/docs/src/pages/components/steppers/images/stepper-2.png +0 -0
- package/docs/src/pages/components/steppers/images/stepper-3.png +0 -0
- package/docs/src/pages/components/steppers/images/stepper-4.png +0 -0
- package/docs/src/pages/components/steppers/images/stepper-5.png +0 -0
- package/docs/src/pages/components/steppers/images/stepper-6.png +0 -0
- package/docs/src/pages/components/steppers/interactions.mdx +28 -0
- package/docs/src/pages/components/steppers/usage.mdx +201 -0
- package/docs/src/pages/components/switch/code.mdx +16 -0
- package/docs/src/pages/components/switch/images/switch-1.gif +0 -0
- package/docs/src/pages/components/switch/images/switch-2.gif +0 -0
- package/docs/src/pages/components/switch/images/switch-3.png +0 -0
- package/docs/src/pages/components/switch/interactions.mdx +392 -0
- package/docs/src/pages/components/switch/usage.mdx +114 -0
- package/docs/src/pages/components/table/code.mdx +14 -0
- package/docs/src/pages/components/table/images/table-1.png +0 -0
- package/docs/src/pages/components/table/images/table-10.png +0 -0
- package/docs/src/pages/components/table/images/table-11.gif +0 -0
- package/docs/src/pages/components/table/images/table-12.png +0 -0
- package/docs/src/pages/components/table/images/table-13.png +0 -0
- package/docs/src/pages/components/table/images/table-14.png +0 -0
- package/docs/src/pages/components/table/images/table-15.png +0 -0
- package/docs/src/pages/components/table/images/table-16.png +0 -0
- package/docs/src/pages/components/table/images/table-17.png +0 -0
- package/docs/src/pages/components/table/images/table-18.png +0 -0
- package/docs/src/pages/components/table/images/table-19.png +0 -0
- package/docs/src/pages/components/table/images/table-2.png +0 -0
- package/docs/src/pages/components/table/images/table-20.png +0 -0
- package/docs/src/pages/components/table/images/table-21.png +0 -0
- package/docs/src/pages/components/table/images/table-22.png +0 -0
- package/docs/src/pages/components/table/images/table-23.png +0 -0
- package/docs/src/pages/components/table/images/table-24.png +0 -0
- package/docs/src/pages/components/table/images/table-25.png +0 -0
- package/docs/src/pages/components/table/images/table-26.png +0 -0
- package/docs/src/pages/components/table/images/table-27.png +0 -0
- package/docs/src/pages/components/table/images/table-28.png +0 -0
- package/docs/src/pages/components/table/images/table-29.png +0 -0
- package/docs/src/pages/components/table/images/table-3.png +0 -0
- package/docs/src/pages/components/table/images/table-30.png +0 -0
- package/docs/src/pages/components/table/images/table-4.png +0 -0
- package/docs/src/pages/components/table/images/table-5.png +0 -0
- package/docs/src/pages/components/table/images/table-6.png +0 -0
- package/docs/src/pages/components/table/images/table-7.png +0 -0
- package/docs/src/pages/components/table/images/table-8.png +0 -0
- package/docs/src/pages/components/table/images/table-9.png +0 -0
- package/docs/src/pages/components/table/interactions.mdx +97 -0
- package/docs/src/pages/components/table/usage.mdx +364 -0
- package/docs/src/pages/components/tabs/code.mdx +15 -0
- package/docs/src/pages/components/tabs/images/tabs-1.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-2.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-3.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-4.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-5.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-6.png +0 -0
- package/docs/src/pages/components/tabs/images/tabs-7.png +0 -0
- package/docs/src/pages/components/tabs/interactions.mdx +487 -0
- package/docs/src/pages/components/tabs/usage.mdx +164 -0
- package/docs/src/pages/components/toast/code.mdx +15 -0
- package/docs/src/pages/components/toast/images/toast-1.png +0 -0
- package/docs/src/pages/components/toast/images/toast-2.gif +0 -0
- package/docs/src/pages/components/toast/images/toast-3.gif +0 -0
- package/docs/src/pages/components/toast/images/toast-4.png +0 -0
- package/docs/src/pages/components/toast/images/toast-5.gif +0 -0
- package/docs/src/pages/components/toast/images/toast-6.gif +0 -0
- package/docs/src/pages/components/toast/interactions.mdx +218 -0
- package/docs/src/pages/components/toast/usage.mdx +156 -0
- package/docs/src/pages/components/tooltip/code.mdx +16 -0
- package/docs/src/pages/components/tooltip/images/Tooltip-1.png +0 -0
- package/docs/src/pages/components/tooltip/images/tooltip-2.gif +0 -0
- package/docs/src/pages/components/tooltip/images/tooltip-3.gif +0 -0
- package/docs/src/pages/components/tooltip/interactions.mdx +219 -0
- package/docs/src/pages/components/tooltip/usage.mdx +80 -0
- package/docs/src/pages/content/button-guidelines/index.mdx +7 -0
- package/docs/src/pages/content/button-guidelines/tabs/button-glossary.mdx +144 -0
- package/docs/src/pages/content/button-guidelines/tabs/confusing-buttons.mdx +184 -0
- package/docs/src/pages/content/email-guidelines.mdx +107 -0
- package/docs/src/pages/content/empty-states.mdx +8 -0
- package/docs/src/pages/content/error-messages.mdx +165 -0
- package/docs/src/pages/content/house-rules/tabs/basics.mdx +236 -0
- package/docs/src/pages/content/house-rules/tabs/date,-time-&-numbers.mdx +462 -0
- package/docs/src/pages/content/house-rules/tabs/grammer.mdx +744 -0
- package/docs/src/pages/content/house-rules/tabs/punctuations.mdx +666 -0
- package/docs/src/pages/content/placeholder-text.mdx +58 -0
- package/docs/src/pages/content/rules.mdx +136 -0
- package/docs/src/pages/content/voice-and-tone-guidelines/index.mdx +7 -0
- package/docs/src/pages/content/voice-and-tone-guidelines/tabs/usage.mdx +309 -0
- package/docs/src/pages/content/voice-and-tone-guidelines/tabs/voice-and-tone.mdx +38 -0
- package/docs/src/pages/contributions.mdx +16 -0
- package/docs/src/pages/foundations/colors.mdx +149 -0
- package/docs/src/pages/foundations/interactions.mdx +192 -0
- package/docs/src/pages/foundations/layout/images/baseline-grid.png +0 -0
- package/docs/src/pages/foundations/layout/images/grid-column.jpeg +0 -0
- package/docs/src/pages/foundations/layout/images/grid-layout.jpeg +0 -0
- package/docs/src/pages/foundations/layout/images/grid-margin.jpeg +0 -0
- package/docs/src/pages/foundations/layout/images/spacing.png +0 -0
- package/docs/src/pages/foundations/layout/images/typography.png +0 -0
- package/docs/src/pages/foundations/layout/index.mdx +151 -0
- package/docs/src/pages/foundations/logos.mdx +88 -0
- package/docs/src/pages/foundations/principles.mdx +60 -0
- package/docs/src/pages/foundations/response-time.mdx +124 -0
- package/docs/src/pages/foundations/typography.mdx +8 -0
- package/docs/src/pages/getting-started/index.mdx +9 -0
- package/docs/src/pages/guides/MDX.mdx +17 -0
- package/docs/src/pages/home/HomeBanner.png +0 -0
- package/docs/src/pages/home/homepage.css +23 -0
- package/docs/src/pages/index.js +241 -0
- package/docs/src/pages/introduction/get-started/designers.mdx +89 -0
- package/docs/src/pages/introduction/get-started/developers.mdx +128 -0
- package/docs/src/pages/introduction/what's-new.mdx +801 -0
- package/docs/src/pages/mobile/components/avatar/code.mdx +12 -0
- package/docs/src/pages/mobile/components/avatar/usage.mdx +20 -0
- package/docs/src/pages/mobile/components/badges/code.mdx +16 -0
- package/docs/src/pages/mobile/components/badges/usage.mdx +23 -0
- package/docs/src/pages/mobile/components/breadcrumbs/code.mdx +16 -0
- package/docs/src/pages/mobile/components/breadcrumbs/usage.mdx +34 -0
- package/docs/src/pages/mobile/components/button/code.mdx +12 -0
- package/docs/src/pages/mobile/components/button/content.mdx +1 -0
- package/docs/src/pages/mobile/components/button/usage.mdx +55 -0
- package/docs/src/pages/mobile/components/card/code.mdx +16 -0
- package/docs/src/pages/mobile/components/card/usage.mdx +23 -0
- package/docs/src/pages/mobile/components/checkbox/code.mdx +16 -0
- package/docs/src/pages/mobile/components/checkbox/usage.mdx +49 -0
- package/docs/src/pages/mobile/components/index.mdx +7 -0
- package/docs/src/pages/mobile/components/message/code.mdx +16 -0
- package/docs/src/pages/mobile/components/message/usage.mdx +26 -0
- package/docs/src/pages/mobile/components/overview/index.mdx +8 -0
- package/docs/src/pages/mobile/components/overview/tabs/all-components.mdx +8 -0
- package/docs/src/pages/mobile/components/overview/tabs/status.mdx +115 -0
- package/docs/src/pages/mobile/foundations/colors.mdx +149 -0
- package/docs/src/pages/mobile/foundations/interactions.mdx +192 -0
- package/docs/src/pages/mobile/foundations/layout/images/baseline-grid.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/images/grid-column.jpeg +0 -0
- package/docs/src/pages/mobile/foundations/layout/images/grid-layout.jpeg +0 -0
- package/docs/src/pages/mobile/foundations/layout/images/grid-margin.jpeg +0 -0
- package/docs/src/pages/mobile/foundations/layout/images/spacing.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/images/typography.png +0 -0
- package/docs/src/pages/mobile/foundations/layout/index.mdx +151 -0
- package/docs/src/pages/mobile/foundations/logos.mdx +88 -0
- package/docs/src/pages/mobile/foundations/principles.mdx +47 -0
- package/docs/src/pages/mobile/foundations/response-time.mdx +124 -0
- package/docs/src/pages/mobile/foundations/typography.mdx +8 -0
- package/docs/src/pages/patterns/index.mdx +7 -0
- package/docs/src/pages/resources/index.mdx +7 -0
- package/docs/src/util/FooterItems.js +21 -0
- package/docs/src/util/Frontmatter.js +35 -0
- package/docs/src/util/HeaderItems.js +21 -0
- package/docs/src/util/Helpers.js +7 -0
- package/docs/src/util/HomeMenu.js +24 -0
- package/docs/src/util/HomeResources.js +23 -0
- package/docs/src/util/InPageNavItems.js +36 -0
- package/docs/src/util/Logos.js +19 -0
- package/docs/src/util/MdsChangelog.js +55 -0
- package/docs/src/util/MediumBlogs.js +27 -0
- package/docs/src/util/NavItems.js +82 -0
- package/docs/src/util/StorybookData.js +24 -0
- package/docs/src/util/constants.js +7 -0
- package/docs/src/util/context/NavContext.js +54 -0
- package/docs/src/util/hooks/index.js +1 -0
- package/docs/src/util/hooks/useMetadata.js +21 -0
- package/docs/src/util/index.js +4 -0
- package/docs/static/icons/4691539_codesandbox_icon.svg +1 -0
- package/docs/static/icons/card-image.png +0 -0
- package/docs/static/icons/favicon_io/android-chrome-192x192.png +0 -0
- package/docs/static/icons/favicon_io/android-chrome-512x512.png +0 -0
- package/docs/static/icons/favicon_io/apple-touch-icon.png +0 -0
- package/docs/static/icons/favicon_io/favicon-16x16.png +0 -0
- package/docs/static/icons/favicon_io/favicon-32x32.png +0 -0
- package/docs/static/icons/favicon_io/favicon.ico +0 -0
- package/docs/static/images/P360.png +0 -0
- package/docs/static/images/dap.png +0 -0
- package/docs/static/images/default.png +0 -0
- package/docs/static/images/designtoken.png +0 -0
- package/docs/static/images/figma.png +0 -0
- package/docs/static/images/headerLogo.png +0 -0
- package/docs/static/images/inacademy.png +0 -0
- package/docs/static/images/inapi.png +0 -0
- package/docs/static/images/incare.png +0 -0
- package/docs/static/images/inconnect.png +0 -0
- package/docs/static/images/indata.png +0 -0
- package/docs/static/images/ingraph.png +0 -0
- package/docs/static/images/innote.png +0 -0
- package/docs/static/images/inoffice.png +0 -0
- package/docs/static/images/inreport.png +0 -0
- package/docs/static/images/storybook.png +0 -0
- package/docs/static/images/withoutType.png +0 -0
- package/docs/tools/build.sh +6 -0
- package/docs/tools/changelog.sh +1 -0
- package/docs/tools/changeloghead.md +14 -0
- package/docs/tools/develop.sh +5 -0
- package/docs/tools/extract.js +52 -0
- package/docs/tools/update-mds.sh +3 -0
- package/package.json +1 -1
- package/tsconfig.json +1 -1
- package/tsconfig.type.json +2 -1
- package/docs/AppTutorial.md +0 -474
- package/docs/images/BasicLayout.png +0 -0
- package/docs/images/Breadcrumb.png +0 -0
- package/docs/images/Covid-App.png +0 -0
- package/docs/images/DrilledLayout.png +0 -0
- package/docs/images/DrilledPage.png +0 -0
- package/docs/images/Footer.png +0 -0
- package/docs/images/Graph1.png +0 -0
- package/docs/images/Graph2.png +0 -0
- package/docs/images/Header.png +0 -0
- package/docs/images/Map.png +0 -0
- package/docs/images/StaticComponent.png +0 -0
- package/docs/images/Summary.png +0 -0
- package/docs/images/Table.png +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import Markdown from 'markdown-to-jsx';
|
|
3
|
+
import { transparentize } from 'polished';
|
|
4
|
+
import { styled } from '@storybook/theming';
|
|
5
|
+
import { ArgType, Args, TableAnnotation } from './types';
|
|
6
|
+
import { ArgJsDoc } from './ArgJsDoc';
|
|
7
|
+
import { ArgValue } from './ArgValue';
|
|
8
|
+
import { theme } from './theme';
|
|
9
|
+
// import { ArgControl, ArgControlProps } from './ArgControl';
|
|
10
|
+
import { codeCommon } from './Shared';
|
|
11
|
+
|
|
12
|
+
export interface ArgRowProps {
|
|
13
|
+
row: ArgType;
|
|
14
|
+
arg: any;
|
|
15
|
+
updateArgs?: (args: Args) => void;
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
expandable?: boolean;
|
|
18
|
+
initialExpandedArgs?: boolean;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Name = styled.span({ fontWeight: 'bold' });
|
|
22
|
+
|
|
23
|
+
const Required = styled.span(() => ({
|
|
24
|
+
color: theme.color.negative,
|
|
25
|
+
fontFamily: theme.typography.fonts.mono,
|
|
26
|
+
cursor: 'help',
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
const Description = styled.div(() => ({
|
|
30
|
+
'&&': {
|
|
31
|
+
p: {
|
|
32
|
+
margin: '0 0 10px 0',
|
|
33
|
+
},
|
|
34
|
+
a: {
|
|
35
|
+
color: theme.color.secondary,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
code: codeCommon(),
|
|
40
|
+
|
|
41
|
+
'& code': {
|
|
42
|
+
margin: 0,
|
|
43
|
+
display: 'inline-block',
|
|
44
|
+
},
|
|
45
|
+
}));
|
|
46
|
+
|
|
47
|
+
const Type = styled.div<{ hasDescription: boolean }>(
|
|
48
|
+
({ hasDescription }) => ({
|
|
49
|
+
color:
|
|
50
|
+
theme.base === 'light'
|
|
51
|
+
? transparentize(0.1, theme.color.defaultText)
|
|
52
|
+
: transparentize(0.2, theme.color.defaultText),
|
|
53
|
+
marginTop: hasDescription ? 4 : 0,
|
|
54
|
+
})
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const TypeWithJsDoc = styled.div<{
|
|
58
|
+
hasDescription: boolean;
|
|
59
|
+
}>(({ hasDescription }) => ({
|
|
60
|
+
color:
|
|
61
|
+
theme.base === 'light'
|
|
62
|
+
? transparentize(0.1, theme.color.defaultText)
|
|
63
|
+
: transparentize(0.2, theme.color.defaultText),
|
|
64
|
+
marginTop: hasDescription ? 12 : 0,
|
|
65
|
+
marginBottom: 12,
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
const StyledTd = styled.td<{ expandable: boolean }>(
|
|
69
|
+
({ expandable }) => ({
|
|
70
|
+
paddingLeft: '20px',
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
export const ArgRow: FC<ArgRowProps> = (props) => {
|
|
75
|
+
const {
|
|
76
|
+
row,
|
|
77
|
+
updateArgs,
|
|
78
|
+
compact,
|
|
79
|
+
initialExpandedArgs,
|
|
80
|
+
} = props;
|
|
81
|
+
const { name, description } = row;
|
|
82
|
+
const table = (row.table || {}) as TableAnnotation;
|
|
83
|
+
const type = table.type || row.type;
|
|
84
|
+
const defaultValue =
|
|
85
|
+
table.defaultValue || row.defaultValue;
|
|
86
|
+
const required = row.type?.required;
|
|
87
|
+
const hasDescription =
|
|
88
|
+
description != null && description !== '';
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<tr>
|
|
92
|
+
<StyledTd expandable={true}>
|
|
93
|
+
<Name>{name}</Name>
|
|
94
|
+
{required ? (
|
|
95
|
+
<Required title="Required">*</Required>
|
|
96
|
+
) : null}
|
|
97
|
+
</StyledTd>
|
|
98
|
+
{compact ? null : (
|
|
99
|
+
<td>
|
|
100
|
+
{hasDescription && (
|
|
101
|
+
<Description>
|
|
102
|
+
<Markdown>{description}</Markdown>
|
|
103
|
+
</Description>
|
|
104
|
+
)}
|
|
105
|
+
{table.jsDocTags != null ? (
|
|
106
|
+
<>
|
|
107
|
+
<TypeWithJsDoc
|
|
108
|
+
hasDescription={hasDescription}
|
|
109
|
+
>
|
|
110
|
+
<ArgValue
|
|
111
|
+
value={type}
|
|
112
|
+
initialExpandedArgs={initialExpandedArgs}
|
|
113
|
+
/>
|
|
114
|
+
</TypeWithJsDoc>
|
|
115
|
+
<ArgJsDoc tags={table.jsDocTags} />
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
<Type hasDescription={hasDescription}>
|
|
119
|
+
<ArgValue
|
|
120
|
+
value={type}
|
|
121
|
+
initialExpandedArgs={initialExpandedArgs}
|
|
122
|
+
/>
|
|
123
|
+
</Type>
|
|
124
|
+
)}
|
|
125
|
+
</td>
|
|
126
|
+
)}
|
|
127
|
+
{compact ? null : (
|
|
128
|
+
<td>
|
|
129
|
+
<ArgValue
|
|
130
|
+
value={defaultValue}
|
|
131
|
+
initialExpandedArgs={initialExpandedArgs}
|
|
132
|
+
/>
|
|
133
|
+
</td>
|
|
134
|
+
)}
|
|
135
|
+
{updateArgs ? (
|
|
136
|
+
<td>
|
|
137
|
+
{/* <ArgControl {...(props as ArgControlProps)} /> */}
|
|
138
|
+
</td>
|
|
139
|
+
) : null}
|
|
140
|
+
</tr>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import React, { FC, useState } from 'react';
|
|
2
|
+
import { styled } from '@storybook/theming';
|
|
3
|
+
import uniq from 'lodash/uniq';
|
|
4
|
+
import { PropSummaryValue } from './types';
|
|
5
|
+
import { theme } from './theme';
|
|
6
|
+
import { codeCommon } from './Shared';
|
|
7
|
+
|
|
8
|
+
interface ArgValueProps {
|
|
9
|
+
value?: PropSummaryValue;
|
|
10
|
+
initialExpandedArgs?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ArgTextProps {
|
|
14
|
+
text: string;
|
|
15
|
+
simple?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ArgSummaryProps {
|
|
19
|
+
value: PropSummaryValue;
|
|
20
|
+
initialExpandedArgs?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ITEMS_BEFORE_EXPANSION = 8;
|
|
24
|
+
|
|
25
|
+
const Summary = styled.div<{ isExpanded?: boolean }>(
|
|
26
|
+
({ isExpanded }) => ({
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: isExpanded ? 'column' : 'row',
|
|
29
|
+
flexWrap: 'wrap',
|
|
30
|
+
alignItems: 'flex-start',
|
|
31
|
+
marginBottom: '-4px',
|
|
32
|
+
minWidth: 100,
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const Text = styled.span<{ simple?: boolean }>(
|
|
37
|
+
codeCommon,
|
|
38
|
+
({ simple = false }) => ({
|
|
39
|
+
flex: '0 0 auto',
|
|
40
|
+
fontFamily: theme.typography.fonts.mono,
|
|
41
|
+
fontSize: '12px',
|
|
42
|
+
wordBreak: 'break-word',
|
|
43
|
+
whiteSpace: 'normal',
|
|
44
|
+
maxWidth: '100%',
|
|
45
|
+
margin: 0,
|
|
46
|
+
marginRight: '4px',
|
|
47
|
+
marginBottom: '4px',
|
|
48
|
+
paddingTop: '2px',
|
|
49
|
+
paddingBottom: '2px',
|
|
50
|
+
lineHeight: '13px',
|
|
51
|
+
...(simple && {
|
|
52
|
+
background: 'transparent',
|
|
53
|
+
border: '0 none',
|
|
54
|
+
paddingLeft: 0,
|
|
55
|
+
}),
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const ExpandButton = styled.button<{}>(() => ({
|
|
60
|
+
fontFamily: theme.typography.fonts.mono,
|
|
61
|
+
color: theme.color.secondary,
|
|
62
|
+
marginBottom: '4px',
|
|
63
|
+
background: 'none',
|
|
64
|
+
border: 'none',
|
|
65
|
+
}));
|
|
66
|
+
|
|
67
|
+
const Expandable = styled.div<{}>(
|
|
68
|
+
codeCommon,
|
|
69
|
+
({ theme }) => ({
|
|
70
|
+
fontFamily: theme.typography.fonts.mono,
|
|
71
|
+
color: theme.color.secondary,
|
|
72
|
+
fontSize: theme.typography.size.s1, // overrides codeCommon
|
|
73
|
+
margin: 0,
|
|
74
|
+
whiteSpace: 'nowrap',
|
|
75
|
+
display: 'flex',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
const EmptyArg = () => {
|
|
81
|
+
return <span>-</span>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const ArgText: FC<ArgTextProps> = ({ text, simple }) => {
|
|
85
|
+
return <Text simple={simple}>{text}</Text>;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const getSummaryItems = (summary: string) => {
|
|
89
|
+
if (!summary) return [summary];
|
|
90
|
+
const splittedItems = summary.split('|');
|
|
91
|
+
const summaryItems = splittedItems.map((value) =>
|
|
92
|
+
value.trim()
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
return uniq(summaryItems);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const renderSummaryItems = (
|
|
99
|
+
summaryItems: string[],
|
|
100
|
+
isExpanded = true
|
|
101
|
+
) => {
|
|
102
|
+
let items = summaryItems;
|
|
103
|
+
if (!isExpanded) {
|
|
104
|
+
items = summaryItems.slice(0, ITEMS_BEFORE_EXPANSION);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return items.map((item) => (
|
|
108
|
+
<ArgText key={item} text={item === '' ? '""' : item} />
|
|
109
|
+
));
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const ArgSummary: FC<ArgSummaryProps> = ({
|
|
113
|
+
value,
|
|
114
|
+
initialExpandedArgs,
|
|
115
|
+
}) => {
|
|
116
|
+
const { summary, detail } = value;
|
|
117
|
+
|
|
118
|
+
const [isExpanded, setIsExpanded] = useState(
|
|
119
|
+
initialExpandedArgs || false
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
if (summary === undefined || summary === null)
|
|
123
|
+
return null;
|
|
124
|
+
// summary is used for the default value
|
|
125
|
+
// below check fixes not displaying default values for boolean typescript vars
|
|
126
|
+
const summaryAsString =
|
|
127
|
+
typeof summary.toString === 'function'
|
|
128
|
+
? summary.toString()
|
|
129
|
+
: summary;
|
|
130
|
+
|
|
131
|
+
if (detail == null) {
|
|
132
|
+
const cannotBeSafelySplitted = /[(){}[\]<>]/.test(
|
|
133
|
+
summaryAsString
|
|
134
|
+
);
|
|
135
|
+
|
|
136
|
+
if (cannotBeSafelySplitted) {
|
|
137
|
+
return <ArgText text={summaryAsString} />;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const summaryItems = getSummaryItems(summaryAsString);
|
|
141
|
+
const itemsCount = summaryItems.length;
|
|
142
|
+
const hasManyItems =
|
|
143
|
+
itemsCount > ITEMS_BEFORE_EXPANSION;
|
|
144
|
+
|
|
145
|
+
return hasManyItems ? (
|
|
146
|
+
<Summary isExpanded={isExpanded}>
|
|
147
|
+
{renderSummaryItems(summaryItems, isExpanded)}
|
|
148
|
+
<ExpandButton
|
|
149
|
+
onClick={() => setIsExpanded(!isExpanded)}
|
|
150
|
+
>
|
|
151
|
+
{isExpanded
|
|
152
|
+
? 'Show less...'
|
|
153
|
+
: `Show ${
|
|
154
|
+
itemsCount - ITEMS_BEFORE_EXPANSION
|
|
155
|
+
} more...`}
|
|
156
|
+
</ExpandButton>
|
|
157
|
+
</Summary>
|
|
158
|
+
) : (
|
|
159
|
+
<Summary>{renderSummaryItems(summaryItems)}</Summary>
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<Expandable className="sbdocs-expandable">
|
|
165
|
+
<span>{summaryAsString}</span>
|
|
166
|
+
</Expandable>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
169
|
+
|
|
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
|
+
);
|
|
182
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { styled } from '@storybook/theming';
|
|
3
|
+
import { withReset } from './Shared';
|
|
4
|
+
|
|
5
|
+
const Wrapper = styled.div<{}>(withReset, ({ theme }) => ({
|
|
6
|
+
backgroundColor:
|
|
7
|
+
theme.base === 'light' ? 'rgba(0,0,0,.01)' : 'rgba(255,255,255,.01)',
|
|
8
|
+
borderRadius: theme.appBorderRadius,
|
|
9
|
+
border: `1px dashed ${theme.appBorderColor}`,
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
padding: 20,
|
|
14
|
+
margin: '25px 0 40px',
|
|
15
|
+
|
|
16
|
+
// color: transparentize(0.3, theme.color.defaultText),
|
|
17
|
+
// fontSize: theme.typography.size.s2,
|
|
18
|
+
}));
|
|
19
|
+
|
|
20
|
+
export const EmptyBlock = (props: any) => (
|
|
21
|
+
<Wrapper {...props} className="docblock-emptyblock" />
|
|
22
|
+
);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useState, FC } from 'react';
|
|
2
|
+
import { transparentize } from 'polished';
|
|
3
|
+
import { styled } from '@storybook/theming';
|
|
4
|
+
// import { Icons } from '../../icon/icon';
|
|
5
|
+
|
|
6
|
+
type Level = 'section' | 'subsection';
|
|
7
|
+
|
|
8
|
+
export interface SectionRowProps {
|
|
9
|
+
label: string;
|
|
10
|
+
level: Level;
|
|
11
|
+
initialExpanded?: boolean;
|
|
12
|
+
colSpan: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const FlexWrapper = styled.span<{}>(({ theme }) => ({
|
|
16
|
+
display: 'flex',
|
|
17
|
+
lineHeight: '20px',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
}));
|
|
20
|
+
|
|
21
|
+
const Section = styled.td<{}>(({ theme }) => ({
|
|
22
|
+
position: 'relative',
|
|
23
|
+
letterSpacing: '0.35em',
|
|
24
|
+
textTransform: 'uppercase',
|
|
25
|
+
fontWeight: theme.typography.weight.black,
|
|
26
|
+
fontSize: theme.typography.size.s1 - 1,
|
|
27
|
+
color:
|
|
28
|
+
theme.base === 'light'
|
|
29
|
+
? transparentize(0.4, theme.color.defaultText)
|
|
30
|
+
: transparentize(0.6, theme.color.defaultText),
|
|
31
|
+
background: `${theme.background.app} !important`,
|
|
32
|
+
'& ~ td': {
|
|
33
|
+
background: `${theme.background.app} !important`,
|
|
34
|
+
},
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
const Subsection = styled.td<{}>(({ theme }) => ({
|
|
38
|
+
position: 'relative',
|
|
39
|
+
fontWeight: theme.typography.weight.bold,
|
|
40
|
+
fontSize: theme.typography.size.s2 - 1,
|
|
41
|
+
background: theme.background.content,
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
const StyledTd = styled.td<{}>(({ theme }) => ({
|
|
45
|
+
position: 'relative',
|
|
46
|
+
}));
|
|
47
|
+
|
|
48
|
+
const StyledTr = styled.tr<{}>(({ theme }) => ({
|
|
49
|
+
'&:hover > td': {
|
|
50
|
+
backgroundColor: `${theme.background.hoverable} !important`,
|
|
51
|
+
boxShadow: `${theme.color.mediumlight} 0 - 1px 0 0 inset`,
|
|
52
|
+
cursor: 'row-resize',
|
|
53
|
+
},
|
|
54
|
+
}));
|
|
55
|
+
|
|
56
|
+
const ClickIntercept = styled.button<{}>(() => ({
|
|
57
|
+
// reset button style
|
|
58
|
+
background: 'none',
|
|
59
|
+
border: 'none',
|
|
60
|
+
padding: '0',
|
|
61
|
+
font: 'inherit',
|
|
62
|
+
|
|
63
|
+
// add custom style
|
|
64
|
+
position: 'absolute',
|
|
65
|
+
top: 0,
|
|
66
|
+
bottom: 0,
|
|
67
|
+
left: 0,
|
|
68
|
+
right: 0,
|
|
69
|
+
height: '100%',
|
|
70
|
+
width: '100%',
|
|
71
|
+
color: 'transparent',
|
|
72
|
+
cursor: 'row-resize !important',
|
|
73
|
+
}));
|
|
74
|
+
|
|
75
|
+
export const SectionRow: FC<SectionRowProps> = ({
|
|
76
|
+
level = 'section',
|
|
77
|
+
label,
|
|
78
|
+
children,
|
|
79
|
+
initialExpanded = true,
|
|
80
|
+
colSpan = 3,
|
|
81
|
+
}) => {
|
|
82
|
+
const [expanded, setExpanded] = useState(initialExpanded);
|
|
83
|
+
const Level =
|
|
84
|
+
level === 'subsection' ? Subsection : Section;
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
const itemCount = children?.length || 0;
|
|
87
|
+
const caption =
|
|
88
|
+
level === 'subsection'
|
|
89
|
+
? `${itemCount} item${itemCount !== 1 ? 's' : ''}`
|
|
90
|
+
: '';
|
|
91
|
+
const icon = expanded ? 'arrowdown' : 'arrowright';
|
|
92
|
+
|
|
93
|
+
const helperText = `${expanded ? 'Hide' : 'Side'} ${
|
|
94
|
+
level === 'subsection' ? itemCount : label
|
|
95
|
+
} item${itemCount !== 1 ? 's' : ''}`;
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<>
|
|
99
|
+
<StyledTr title={helperText}>
|
|
100
|
+
<Level colSpan={1}>
|
|
101
|
+
<ClickIntercept
|
|
102
|
+
onClick={(e) => setExpanded(!expanded)}
|
|
103
|
+
tabIndex={0}
|
|
104
|
+
>
|
|
105
|
+
{helperText}
|
|
106
|
+
</ClickIntercept>
|
|
107
|
+
<FlexWrapper>
|
|
108
|
+
{/* <ExpanderIcon icon={icon} /> */}
|
|
109
|
+
{label}
|
|
110
|
+
</FlexWrapper>
|
|
111
|
+
</Level>
|
|
112
|
+
<StyledTd colSpan={colSpan - 1}>
|
|
113
|
+
<ClickIntercept
|
|
114
|
+
onClick={(e) => setExpanded(!expanded)}
|
|
115
|
+
tabIndex={-1}
|
|
116
|
+
style={{ outline: 'none' }}
|
|
117
|
+
>
|
|
118
|
+
{helperText}
|
|
119
|
+
</ClickIntercept>
|
|
120
|
+
{expanded ? null : caption}
|
|
121
|
+
</StyledTd>
|
|
122
|
+
</StyledTr>
|
|
123
|
+
{expanded ? children : null}
|
|
124
|
+
</>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { transparentize } from 'polished';
|
|
2
|
+
import { CSSObject, Theme } from '@storybook/theming';
|
|
3
|
+
import { theme } from './theme';
|
|
4
|
+
|
|
5
|
+
export const headerCommon = (): CSSObject => ({
|
|
6
|
+
margin: '20px 0 8px',
|
|
7
|
+
padding: 0,
|
|
8
|
+
cursor: 'text',
|
|
9
|
+
position: 'relative',
|
|
10
|
+
color: theme.color.defaultText,
|
|
11
|
+
'&:first-of-type': {
|
|
12
|
+
marginTop: 0,
|
|
13
|
+
paddingTop: 0,
|
|
14
|
+
},
|
|
15
|
+
'&:hover a.anchor': {
|
|
16
|
+
textDecoration: 'none',
|
|
17
|
+
},
|
|
18
|
+
'& tt, & code': {
|
|
19
|
+
fontSize: 'inherit',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const codeCommon = (): CSSObject => ({
|
|
24
|
+
lineHeight: 1,
|
|
25
|
+
margin: '0 2px',
|
|
26
|
+
padding: '3px 5px',
|
|
27
|
+
whiteSpace: 'nowrap',
|
|
28
|
+
|
|
29
|
+
borderRadius: 4,
|
|
30
|
+
fontSize: '12px',
|
|
31
|
+
fontWeight: 'bold',
|
|
32
|
+
border: theme.base === 'light' ? `1px solid #E5E5E5` : `1px solid#E5E5E5`,
|
|
33
|
+
color:
|
|
34
|
+
theme.base === 'light'
|
|
35
|
+
? transparentize(0.1, theme.color.defaultText)
|
|
36
|
+
: transparentize(0.3, theme.color.defaultText),
|
|
37
|
+
backgroundColor: '#F4F4F4',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const withReset = (): CSSObject => ({
|
|
41
|
+
fontFamily: 'monospace',
|
|
42
|
+
fontSize: '14px',
|
|
43
|
+
margin: 0,
|
|
44
|
+
|
|
45
|
+
WebkitFontSmoothing: 'antialiased',
|
|
46
|
+
MozOsxFontSmoothing: 'grayscale',
|
|
47
|
+
WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',
|
|
48
|
+
WebkitOverflowScrolling: 'touch',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const withMargin: CSSObject = {
|
|
52
|
+
margin: '16px 0',
|
|
53
|
+
};
|