@nulogy/components 16.0.0 → 16.0.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/dist/locales/ja_JP.json +63 -0
- package/dist/main.js +1778 -646
- package/dist/main.js.map +1 -1
- package/dist/main.module.js +1777 -645
- package/dist/main.module.js.map +1 -1
- package/dist/src/Alert/Alert.d.ts +1 -1
- package/dist/src/Alert/Alert.js +3 -8
- package/dist/src/Alert/Alert.story.d.ts +1 -1
- package/dist/src/Alert/Alert.story.js +3 -9
- package/dist/src/Alert/CloseButton.d.ts +1 -1
- package/dist/src/Alert/CloseButton.js +2 -3
- package/dist/src/AppTag/AppTag.d.ts +1 -2
- package/dist/src/AppTag/AppTag.js +2 -6
- package/dist/src/AppTag/components/NulogyLogo.d.ts +1 -1
- package/dist/src/AppTag/components/NulogyLogo.js +2 -3
- package/dist/src/AppTag/stories/AppTag.story.d.ts +2 -3
- package/dist/src/AppTag/stories/AppTag.story.js +6 -8
- package/dist/src/AppTag/stories/AppTag.usecases.story.d.ts +5 -6
- package/dist/src/AppTag/stories/AppTag.usecases.story.js +12 -58
- package/dist/src/AsyncSelect/AsyncSelect.graphql.story.d.ts +1 -2
- package/dist/src/AsyncSelect/AsyncSelect.graphql.story.js +4 -4
- package/dist/src/AsyncSelect/AsyncSelect.js +21 -23
- package/dist/src/AsyncSelect/AsyncSelect.story.d.ts +9 -10
- package/dist/src/AsyncSelect/AsyncSelect.story.js +11 -14
- package/dist/src/AsyncSelect/AsyncSelectComponents.d.ts +8 -9
- package/dist/src/AsyncSelect/AsyncSelectComponents.js +9 -19
- package/dist/src/Banner/Banner.d.ts +2 -2
- package/dist/src/Banner/Banner.js +2 -2
- package/dist/src/Banner/Banner.story.d.ts +6 -7
- package/dist/src/Banner/Banner.story.js +7 -24
- package/dist/src/BottomSheet/BottomSheet.d.ts +1 -1
- package/dist/src/BottomSheet/BottomSheet.js +3 -17
- package/dist/src/BottomSheet/BottomSheet.parts.d.ts +5 -5
- package/dist/src/BottomSheet/BottomSheet.parts.js +6 -5
- package/dist/src/BottomSheet/BottomSheet.styled.d.ts +12 -8
- package/dist/src/BottomSheet/BottomSheetProvider.d.ts +1 -1
- package/dist/src/BottomSheet/BottomSheetProvider.js +2 -2
- package/dist/src/BottomSheet/stories/BottomSheet.actions.story.d.ts +3 -4
- package/dist/src/BottomSheet/stories/BottomSheet.actions.story.js +4 -9
- package/dist/src/BottomSheet/stories/BottomSheet.content.story.d.ts +3 -4
- package/dist/src/BottomSheet/stories/BottomSheet.content.story.js +4 -11
- package/dist/src/BottomSheet/stories/BottomSheet.features.story.d.ts +5 -6
- package/dist/src/BottomSheet/stories/BottomSheet.features.story.js +12 -42
- package/dist/src/BottomSheet/stories/BottomSheet.parts.story.d.ts +2 -3
- package/dist/src/BottomSheet/stories/BottomSheet.parts.story.js +3 -23
- package/dist/src/BottomSheet/stories/BottomSheet.story.d.ts +2 -3
- package/dist/src/BottomSheet/stories/BottomSheet.story.js +3 -5
- package/dist/src/Box/Box.d.ts +12 -13
- package/dist/src/Box/Box.story.d.ts +12 -13
- package/dist/src/Box/Box.story.js +14 -32
- package/dist/src/BrandedNavBar/BrandLogoContainer.d.ts +1 -1
- package/dist/src/BrandedNavBar/BrandLogoContainer.js +2 -5
- package/dist/src/BrandedNavBar/DesktopMenu.d.ts +3 -1
- package/dist/src/BrandedNavBar/DesktopMenu.js +6 -9
- package/dist/src/BrandedNavBar/MenuTrigger.d.ts +1 -1
- package/dist/src/BrandedNavBar/MenuTrigger.js +12 -12
- package/dist/src/BrandedNavBar/MenuTriggerButton.js +7 -8
- package/dist/src/BrandedNavBar/MobileMenu.d.ts +1 -1
- package/dist/src/BrandedNavBar/MobileMenu.js +8 -24
- package/dist/src/BrandedNavBar/NavBar.d.ts +1 -1
- package/dist/src/BrandedNavBar/NavBar.js +8 -18
- package/dist/src/BrandedNavBar/NavBar.story.d.ts +13 -14
- package/dist/src/BrandedNavBar/NavBar.story.js +27 -42
- package/dist/src/BrandedNavBar/NavBarDropdownMenu.js +34 -39
- package/dist/src/BrandedNavBar/NulogyLogo.d.ts +1 -2
- package/dist/src/BrandedNavBar/NulogyLogo.js +2 -14
- package/dist/src/BrandedNavBar/NulogyLogoContainer.d.ts +1 -2
- package/dist/src/BrandedNavBar/NulogyLogoContainer.js +2 -5
- package/dist/src/BrandedNavBar/SmallNavBar.js +9 -17
- package/dist/src/BrandedNavBar/SmallNavBar.story.d.ts +6 -7
- package/dist/src/BrandedNavBar/SmallNavBar.story.js +10 -16
- package/dist/src/BrandedNavBar/SubMenuTrigger.d.ts +1 -1
- package/dist/src/BrandedNavBar/SubMenuTrigger.js +4 -5
- package/dist/src/BrandedNavBar/SubMenuTriggerButton.js +2 -4
- package/dist/src/BrandedNavBar/renderSubMenuItems.js +5 -10
- package/dist/src/Branding/Branding.d.ts +1 -2
- package/dist/src/Branding/Branding.js +5 -10
- package/dist/src/Branding/Branding.story.d.ts +1 -2
- package/dist/src/Branding/Branding.story.js +2 -77
- package/dist/src/Branding/LettermarkLogo.d.ts +1 -2
- package/dist/src/Branding/LettermarkLogo.js +2 -3
- package/dist/src/Branding/WordmarkLogo.d.ts +1 -1
- package/dist/src/Branding/WordmarkLogo.js +2 -10
- package/dist/src/Breadcrumbs/Breadcrumbs.d.ts +1 -2
- package/dist/src/Breadcrumbs/Breadcrumbs.js +4 -5
- package/dist/src/Breadcrumbs/Breadcrumbs.story.d.ts +3 -4
- package/dist/src/Breadcrumbs/Breadcrumbs.story.js +4 -16
- package/dist/src/Button/Button.js +2 -4
- package/dist/src/Button/Button.story.d.ts +9 -10
- package/dist/src/Button/Button.story.js +10 -26
- package/dist/src/Button/CloseButton.js +2 -2
- package/dist/src/Button/ControlIcon.js +2 -2
- package/dist/src/Button/ControlIcon.story.d.ts +3 -4
- package/dist/src/Button/ControlIcon.story.js +4 -4
- package/dist/src/Button/DangerButton.d.ts +3 -1
- package/dist/src/Button/IconicButton.js +13 -17
- package/dist/src/Button/IconicButton.story.d.ts +15 -16
- package/dist/src/Button/IconicButton.story.js +16 -31
- package/dist/src/Button/PrimaryButton.d.ts +3 -1
- package/dist/src/Button/QuietButton.d.ts +3 -1
- package/dist/src/ButtonGroup/ButtonGroup.story.d.ts +5 -6
- package/dist/src/ButtonGroup/ButtonGroup.story.js +6 -43
- package/dist/src/Card/Card.d.ts +1 -2
- package/dist/src/Card/Card.js +2 -2
- package/dist/src/Card/Card.story.d.ts +4 -5
- package/dist/src/Card/Card.story.js +6 -39
- package/dist/src/Checkbox/Checkbox.js +3 -6
- package/dist/src/Checkbox/Checkbox.story.d.ts +11 -12
- package/dist/src/Checkbox/Checkbox.story.js +13 -26
- package/dist/src/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/src/Checkbox/CheckboxGroup.js +3 -11
- package/dist/src/Checkbox/CheckboxGroup.story.d.ts +6 -7
- package/dist/src/Checkbox/CheckboxGroup.story.js +7 -25
- package/dist/src/DatePickers/DatePicker.js +3 -2
- package/dist/src/DatePickers/MonthPicker.js +3 -2
- package/dist/src/DatePickers/WeekPicker.js +4 -7
- package/dist/src/DatePickers/custom/MonthPickerHeader.d.ts +1 -2
- package/dist/src/DatePickers/custom/MonthPickerHeader.js +2 -5
- package/dist/src/DatePickers/shared/components/BasePicker.js +3 -5
- package/dist/src/DatePickers/shared/components/DatePickerHeader.d.ts +2 -2
- package/dist/src/DatePickers/shared/components/DatePickerHeader.js +3 -9
- package/dist/src/DatePickers/shared/components/DatePickerInput.js +2 -1
- package/dist/src/DatePickers/stories/DatePicker.story.d.ts +4 -4
- package/dist/src/DatePickers/stories/DatePicker.story.js +6 -7
- package/dist/src/DatePickers/stories/MonthPicker.story.d.ts +6 -7
- package/dist/src/DatePickers/stories/MonthPicker.story.js +8 -7
- package/dist/src/DatePickers/stories/WeekPicker.story.d.ts +8 -9
- package/dist/src/DatePickers/stories/WeekPicker.story.js +10 -11
- package/dist/src/DateRange/DateRange.js +12 -17
- package/dist/src/DateRange/DateRange.story.d.ts +12 -13
- package/dist/src/DateRange/DateRange.story.js +14 -20
- package/dist/src/DateRange/EndTime.d.ts +5 -7
- package/dist/src/DateRange/StartTime.d.ts +5 -7
- package/dist/src/Decorations/index.d.ts +1 -2
- package/dist/src/Decorations/index.js +2 -4
- package/dist/src/DescriptionList/DescriptionList.d.ts +1 -2
- package/dist/src/DescriptionList/DescriptionList.js +2 -4
- package/dist/src/DescriptionList/DescriptionListContext.d.ts +2 -2
- package/dist/src/DescriptionList/DescriptionListContext.js +3 -2
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.d.ts +3 -4
- package/dist/src/DescriptionList/stories/DescriptionList.column.story.js +7 -26
- package/dist/src/DescriptionList/stories/DescriptionList.group-min-width.story.js +2 -8
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.d.ts +3 -4
- package/dist/src/DescriptionList/stories/DescriptionList.layout.story.js +4 -30
- package/dist/src/DescriptionList/stories/DescriptionList.playground.story.js +83 -148
- package/dist/src/DescriptionList/stories/DescriptionList.sizing.story.d.ts +3 -4
- package/dist/src/DescriptionList/stories/DescriptionList.sizing.story.js +5 -44
- package/dist/src/DescriptionList/stories/DescriptionList.spanning.story.d.ts +3 -4
- package/dist/src/DescriptionList/stories/DescriptionList.spanning.story.js +5 -59
- package/dist/src/DescriptionList/stories/fixtures.d.ts +3 -3
- package/dist/src/DescriptionList/stories/fixtures.js +2 -27
- package/dist/src/Divider/Divider.story.d.ts +4 -4
- package/dist/src/Divider/Divider.story.js +5 -17
- package/dist/src/DropdownMenu/DropdownMenu.js +10 -10
- package/dist/src/DropdownMenu/DropdownMenu.story.d.ts +12 -13
- package/dist/src/DropdownMenu/DropdownMenu.story.js +13 -45
- package/dist/src/DropdownMenu/DropdownMenuContainer.d.ts +1 -1
- package/dist/src/DropdownMenu/DropdownText.d.ts +2 -2
- package/dist/src/FieldLabel/FieldLabel.d.ts +1 -2
- package/dist/src/FieldLabel/FieldLabel.js +2 -10
- package/dist/src/FieldLabel/FieldLabel.story.d.ts +7 -8
- package/dist/src/FieldLabel/FieldLabel.story.js +12 -32
- package/dist/src/FieldLabel/HelpText.d.ts +1 -1
- package/dist/src/FieldLabel/MaybeFieldLabel.d.ts +1 -2
- package/dist/src/FieldLabel/MaybeFieldLabel.js +2 -2
- package/dist/src/FieldLabel/RequirementText.d.ts +1 -2
- package/dist/src/FieldLabel/RequirementText.js +2 -2
- package/dist/src/Flex/Flex.story.d.ts +18 -19
- package/dist/src/Flex/Flex.story.js +23 -122
- package/dist/src/Form/Form.d.ts +1 -1
- package/dist/src/Form/Form.js +2 -4
- package/dist/src/Form/Form.story.d.ts +6 -7
- package/dist/src/Form/Form.story.js +7 -59
- package/dist/src/Form/FormSection.d.ts +1 -1
- package/dist/src/Form/FormSection.js +2 -4
- package/dist/src/Icon/Icon.d.ts +6 -2
- package/dist/src/Icon/Icon.js +5 -5
- package/dist/src/Icon/Icon.story.d.ts +6 -7
- package/dist/src/Icon/Icon.story.js +8 -37
- package/dist/src/Icon/LoadingIcon.js +2 -11
- package/dist/src/Input/Input.js +3 -4
- package/dist/src/Input/Input.story.d.ts +11 -12
- package/dist/src/Input/Input.story.js +24 -55
- package/dist/src/Input/InputField.js +5 -13
- package/dist/src/Input/Prefix.d.ts +1 -2
- package/dist/src/Input/Prefix.js +2 -3
- package/dist/src/Input/Suffix.d.ts +1 -2
- package/dist/src/Input/Suffix.js +2 -3
- package/dist/src/Layout/ApplicationFrame.d.ts +2 -2
- package/dist/src/Layout/ApplicationFrame.js +2 -6
- package/dist/src/Layout/ApplicationFrame.story.d.ts +1 -2
- package/dist/src/Layout/ApplicationFrame.story.js +2 -2
- package/dist/src/Layout/Header.d.ts +2 -2
- package/dist/src/Layout/Header.js +2 -13
- package/dist/src/Layout/Header.story.d.ts +10 -11
- package/dist/src/Layout/Header.story.js +12 -52
- package/dist/src/Layout/Page.applicationFrame.story.d.ts +2 -3
- package/dist/src/Layout/Page.applicationFrame.story.js +7 -14
- package/dist/src/Layout/Page.d.ts +2 -2
- package/dist/src/Layout/Page.js +4 -6
- package/dist/src/Layout/Page.story.d.ts +1 -2
- package/dist/src/Layout/Page.story.js +15 -28
- package/dist/src/Layout/Sidebar.d.ts +1 -1
- package/dist/src/Layout/Sidebar.js +4 -16
- package/dist/src/Layout/Sidebar.story.d.ts +10 -11
- package/dist/src/Layout/Sidebar.story.js +17 -88
- package/dist/src/Link/Link.d.ts +1 -1
- package/dist/src/Link/Link.js +3 -6
- package/dist/src/Link/Link.story.d.ts +10 -11
- package/dist/src/Link/Link.story.js +11 -12
- package/dist/src/List/List.story.d.ts +5 -6
- package/dist/src/List/List.story.js +6 -21
- package/dist/src/LoadingAnimation/LoadingAnimation.d.ts +1 -1
- package/dist/src/LoadingAnimation/LoadingAnimation.js +2 -21
- package/dist/src/LoadingAnimation/LoadingAnimation.story.d.ts +4 -5
- package/dist/src/LoadingAnimation/LoadingAnimation.story.js +5 -22
- package/dist/src/MaybeTooltip/MaybeTooltip.d.ts +1 -2
- package/dist/src/MaybeTooltip/MaybeTooltip.js +3 -3
- package/dist/src/MaybeTooltip/MaybeTooltip.story.d.ts +1 -2
- package/dist/src/MaybeTooltip/MaybeTooltip.story.js +4 -5
- package/dist/src/MiniTooltip/index.d.ts +2 -2
- package/dist/src/MiniTooltip/index.js +3 -7
- package/dist/src/Modal/Modal.d.ts +5 -3
- package/dist/src/Modal/Modal.js +7 -12
- package/dist/src/Modal/Modal.story.d.ts +1 -23
- package/dist/src/Modal/Modal.story.js +10 -40
- package/dist/src/Modal/ModalCloseButton.d.ts +4 -2
- package/dist/src/Modal/ModalContent.d.ts +1 -1
- package/dist/src/NDSProvider/ComponentVariantContext.d.ts +1 -1
- package/dist/src/NDSProvider/ComponentVariantContext.js +3 -2
- package/dist/src/NDSProvider/FeatureFlagsContext.d.ts +1 -1
- package/dist/src/NDSProvider/FeatureFlagsContext.js +3 -2
- package/dist/src/NDSProvider/GlobalStylesComposer.d.ts +1 -1
- package/dist/src/NDSProvider/GlobalStylesComposer.js +3 -6
- package/dist/src/NDSProvider/LocaleContext.d.ts +1 -1
- package/dist/src/NDSProvider/LocaleContext.js +2 -1
- package/dist/src/NDSProvider/NDSProvider.d.ts +1 -1
- package/dist/src/NDSProvider/NDSProvider.js +3 -7
- package/dist/src/NDSProvider/renderWithNDSProvider.spec-utils.js +2 -2
- package/dist/src/NavBarSearch/NavBarSearch.d.ts +1 -1
- package/dist/src/NavBarSearch/NavBarSearch.js +2 -5
- package/dist/src/Navigation/Navigation.d.ts +1 -1
- package/dist/src/Navigation/Navigation.js +2 -2
- package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.d.ts +1 -1
- package/dist/src/Navigation/components/AppSwitcher/NulogyAppSwitcher.js +3 -12
- package/dist/src/Navigation/components/AppSwitcher/parts/Item.d.ts +3 -1
- package/dist/src/Navigation/components/AppSwitcher/parts/Item.js +2 -1
- package/dist/src/Navigation/components/AppSwitcher/parts/Link.js +2 -2
- package/dist/src/Navigation/components/AppSwitcher/parts/index.d.ts +15 -7
- package/dist/src/Navigation/components/DesktopNav/DesktopNav.d.ts +1 -2
- package/dist/src/Navigation/components/DesktopNav/DesktopNav.js +3 -30
- package/dist/src/Navigation/components/DesktopNav/parts/MoreMenuItem.d.ts +6 -2
- package/dist/src/Navigation/components/DesktopNav/parts/MoreMenuItem.js +2 -2
- package/dist/src/Navigation/components/EnvironmentBanner/EnvironmentBanner.d.ts +1 -1
- package/dist/src/Navigation/components/EnvironmentBanner/EnvironmentBanner.js +2 -3
- package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.d.ts +1 -2
- package/dist/src/Navigation/components/MenuSubItem/MenuSubItem.js +5 -13
- package/dist/src/Navigation/components/MenuSubItem/parts/styled.d.ts +17 -5
- package/dist/src/Navigation/components/MobileNav/MobileNav.d.ts +1 -2
- package/dist/src/Navigation/components/MobileNav/MobileNav.js +2 -29
- package/dist/src/Navigation/components/MobileNav/parts/MobileMenuItem.js +11 -27
- package/dist/src/Navigation/components/MobileNav/parts/styled.d.ts +10 -4
- package/dist/src/Navigation/components/NulogyLogo/NulogyLogo.d.ts +1 -2
- package/dist/src/Navigation/components/NulogyLogo/NulogyLogo.js +8 -10
- package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.d.ts +2 -2
- package/dist/src/Navigation/components/NulogyLogo/SvgNulogyLogo.js +2 -9
- package/dist/src/Navigation/components/UserMenu/UserMenu.d.ts +6 -2
- package/dist/src/Navigation/components/UserMenu/parts/Header.d.ts +1 -2
- package/dist/src/Navigation/components/UserMenu/parts/Header.js +2 -6
- package/dist/src/Navigation/components/UserMenu/parts/Item.js +5 -7
- package/dist/src/Navigation/components/UserMenu/parts/MobileItem.js +6 -10
- package/dist/src/Navigation/components/UserMenu/parts/styled.d.ts +6 -2
- package/dist/src/Navigation/components/shared/NavigationLogo.d.ts +1 -1
- package/dist/src/Navigation/components/shared/NavigationLogo.js +2 -2
- package/dist/src/Navigation/components/shared/NavigationLogoLink.d.ts +1 -2
- package/dist/src/Navigation/components/shared/NavigationLogoLink.js +2 -2
- package/dist/src/Navigation/components/shared/NavigationMenuContent.d.ts +5 -1
- package/dist/src/Navigation/components/shared/NavigationMenuItem.d.ts +3 -1
- package/dist/src/Navigation/components/shared/NavigationMenuItem.js +9 -18
- package/dist/src/Navigation/components/shared/components.d.ts +35 -9
- package/dist/src/Navigation/stories/Navigation.appSwitcher.story.d.ts +4 -5
- package/dist/src/Navigation/stories/Navigation.appSwitcher.story.js +10 -30
- package/dist/src/Navigation/stories/Navigation.logos.story.d.ts +9 -10
- package/dist/src/Navigation/stories/Navigation.logos.story.js +11 -70
- package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.d.ts +5 -6
- package/dist/src/Navigation/stories/Navigation.mobileVisibility.story.js +12 -38
- package/dist/src/Navigation/stories/Navigation.navigationMenus.story.d.ts +5 -6
- package/dist/src/Navigation/stories/Navigation.navigationMenus.story.js +17 -70
- package/dist/src/Navigation/stories/Navigation.navigationMenus.subMenus.story.d.ts +3 -4
- package/dist/src/Navigation/stories/Navigation.navigationMenus.subMenus.story.js +4 -4
- package/dist/src/Navigation/stories/Navigation.story.d.ts +3 -4
- package/dist/src/Navigation/stories/Navigation.story.js +16 -36
- package/dist/src/Navigation/stories/Navigation.userMenu.story.d.ts +5 -6
- package/dist/src/Navigation/stories/Navigation.userMenu.story.js +40 -71
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.d.ts +2 -2
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo2.js +2 -13
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.d.ts +2 -2
- package/dist/src/Navigation/stories/fixtures/logos/CustomLogo3.js +2 -29
- package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.d.ts +2 -2
- package/dist/src/Navigation/stories/fixtures/logos/Customlogo1.js +2 -3
- package/dist/src/Overlay/Overlay.story.d.ts +2 -3
- package/dist/src/Overlay/Overlay.story.js +3 -9
- package/dist/src/Pagination/NextButton.d.ts +1 -1
- package/dist/src/Pagination/NextButton.js +2 -4
- package/dist/src/Pagination/Pagination.d.ts +2 -2
- package/dist/src/Pagination/Pagination.js +23 -26
- package/dist/src/Pagination/Pagination.story.d.ts +6 -7
- package/dist/src/Pagination/Pagination.story.js +12 -44
- package/dist/src/Pagination/PaginationCount.d.ts +1 -2
- package/dist/src/Pagination/PaginationCount.js +2 -2
- package/dist/src/Pagination/PreviousButton.d.ts +1 -1
- package/dist/src/Pagination/PreviousButton.js +2 -4
- package/dist/src/Popper/Popper.js +25 -26
- package/dist/src/Radio/Radio.js +3 -9
- package/dist/src/Radio/Radio.story.d.ts +12 -14
- package/dist/src/Radio/Radio.story.js +8 -16
- package/dist/src/Radio/RadioGroup.d.ts +1 -1
- package/dist/src/Radio/RadioGroup.js +3 -8
- package/dist/src/Radio/RadioGroup.story.d.ts +6 -7
- package/dist/src/Radio/RadioGroup.story.js +7 -28
- package/dist/src/RangeContainer/RangeContainer.d.ts +1 -1
- package/dist/src/RangeContainer/RangeContainer.js +2 -9
- package/dist/src/RangeContainer/RangeContainer.story.d.ts +1 -2
- package/dist/src/RangeContainer/RangeContainer.story.js +2 -2
- package/dist/src/Select/MenuList.d.ts +1 -2
- package/dist/src/Select/MenuList.js +10 -10
- package/dist/src/Select/Select.js +18 -20
- package/dist/src/Select/Select.story.d.ts +24 -24
- package/dist/src/Select/Select.story.fixture.d.ts +2 -3
- package/dist/src/Select/Select.story.fixture.js +4 -8
- package/dist/src/Select/Select.story.js +29 -52
- package/dist/src/Select/SelectComponents.d.ts +7 -8
- package/dist/src/Select/SelectComponents.js +8 -15
- package/dist/src/Select/SelectOption.d.ts +1 -1
- package/dist/src/Select/SelectOption.js +2 -3
- package/dist/src/SortingTable/SortingTable.d.ts +1 -2
- package/dist/src/SortingTable/SortingTable.js +4 -3
- package/dist/src/SortingTable/SortingTable.story.d.ts +1 -2
- package/dist/src/SortingTable/SortingTable.story.js +2 -2
- package/dist/src/StatusIndicator/StatusIndicator.story.d.ts +10 -11
- package/dist/src/StatusIndicator/StatusIndicator.story.js +11 -51
- package/dist/src/Summary/Summary.d.ts +1 -2
- package/dist/src/Summary/Summary.js +4 -5
- package/dist/src/Summary/Summary.story.d.ts +2 -3
- package/dist/src/Summary/Summary.story.js +3 -11
- package/dist/src/Summary/SummaryContext.d.ts +3 -1
- package/dist/src/Summary/SummaryContext.js +6 -5
- package/dist/src/Summary/SummaryDivider.d.ts +1 -2
- package/dist/src/Summary/SummaryDivider.js +2 -2
- package/dist/src/Summary/SummaryItem.d.ts +1 -1
- package/dist/src/Summary/SummaryItem.js +4 -6
- package/dist/src/Switcher/Switch.js +2 -1
- package/dist/src/Switcher/Switcher.d.ts +2 -2
- package/dist/src/Switcher/Switcher.js +4 -4
- package/dist/src/Switcher/Switcher.story.d.ts +3 -4
- package/dist/src/Switcher/Switcher.story.js +5 -17
- package/dist/src/Table/BaseTable.d.ts +2 -2
- package/dist/src/Table/BaseTable.js +2 -5
- package/dist/src/Table/SortingColumnHeader.d.ts +1 -1
- package/dist/src/Table/SortingColumnHeader.js +2 -4
- package/dist/src/Table/StatefulTable.d.ts +1 -1
- package/dist/src/Table/StatefulTable.js +3 -4
- package/dist/src/Table/Table.d.ts +1 -2
- package/dist/src/Table/Table.js +2 -2
- package/dist/src/Table/TableBody.d.ts +2 -2
- package/dist/src/Table/TableBody.js +8 -13
- package/dist/src/Table/TableCell.d.ts +1 -1
- package/dist/src/Table/TableCell.js +3 -3
- package/dist/src/Table/TableFoot.d.ts +1 -2
- package/dist/src/Table/TableFoot.js +8 -8
- package/dist/src/Table/TableHead.d.ts +1 -2
- package/dist/src/Table/TableHead.js +3 -4
- package/dist/src/Table/addExpandableControl.js +3 -3
- package/dist/src/Table/addSelectableControl.js +4 -4
- package/dist/src/Table/stories/BaseTable.story.d.ts +7 -8
- package/dist/src/Table/stories/BaseTable.story.js +15 -24
- package/dist/src/Table/stories/CustomContent.story.d.ts +2 -3
- package/dist/src/Table/stories/CustomContent.story.js +89 -116
- package/dist/src/Table/stories/Density.story.d.ts +2 -3
- package/dist/src/Table/stories/Density.story.js +3 -3
- package/dist/src/Table/stories/Table.story.js +6 -13
- package/dist/src/Table/stories/TableWithCustomSorting.story.d.ts +1 -2
- package/dist/src/Table/stories/TableWithCustomSorting.story.js +5 -4
- package/dist/src/Table/stories/TableWithExpandableRows.story.d.ts +2 -3
- package/dist/src/Table/stories/TableWithExpandableRows.story.js +4 -5
- package/dist/src/Table/stories/TableWithFiltering.story.d.ts +2 -3
- package/dist/src/Table/stories/TableWithFiltering.story.js +7 -6
- package/dist/src/Table/stories/TableWithSelectableRows.story.d.ts +2 -3
- package/dist/src/Table/stories/TableWithSelectableRows.story.js +3 -3
- package/dist/src/Table/stories/TableWithServerSidePagination.story.d.ts +1 -2
- package/dist/src/Table/stories/TableWithServerSidePagination.story.js +3 -4
- package/dist/src/Tabs/Tab.js +2 -1
- package/dist/src/Tabs/TabScrollIndicator.d.ts +1 -1
- package/dist/src/Tabs/TabScrollIndicator.js +4 -5
- package/dist/src/Tabs/TabScrollIndicators.d.ts +1 -1
- package/dist/src/Tabs/TabScrollIndicators.js +5 -8
- package/dist/src/Tabs/Tabs.d.ts +2 -2
- package/dist/src/Tabs/Tabs.js +3 -6
- package/dist/src/Tabs/Tabs.story.d.ts +9 -10
- package/dist/src/Tabs/Tabs.story.js +11 -60
- package/dist/src/Textarea/Textarea.js +3 -5
- package/dist/src/Textarea/Textarea.story.d.ts +9 -10
- package/dist/src/Textarea/Textarea.story.js +11 -12
- package/dist/src/TimePicker/TimePicker.d.ts +1 -1
- package/dist/src/TimePicker/TimePicker.js +10 -14
- package/dist/src/TimePicker/TimePicker.story.d.ts +10 -11
- package/dist/src/TimePicker/TimePicker.story.js +13 -14
- package/dist/src/TimePicker/TimePickerInput.d.ts +3 -1
- package/dist/src/TimeRange/TimeRange.d.ts +3 -2
- package/dist/src/TimeRange/TimeRange.js +5 -4
- package/dist/src/TimeRange/TimeRange.story.d.ts +5 -6
- package/dist/src/TimeRange/TimeRange.story.js +7 -9
- package/dist/src/Toast/Toast.d.ts +1 -2
- package/dist/src/Toast/Toast.js +3 -3
- package/dist/src/Toast/Toast.story.d.ts +7 -8
- package/dist/src/Toast/Toast.story.js +18 -39
- package/dist/src/ToastContainer/ToastContainer.d.ts +1 -2
- package/dist/src/ToastContainer/ToastContainer.js +3 -2
- package/dist/src/ToastContainer/ToastContainer.story.d.ts +1 -2
- package/dist/src/ToastContainer/ToastContainer.story.js +26 -51
- package/dist/src/ToastContainer/ToastFunction.js +8 -9
- package/dist/src/Toggle/Toggle.js +2 -5
- package/dist/src/Toggle/Toggle.story.d.ts +8 -9
- package/dist/src/Toggle/Toggle.story.js +10 -14
- package/dist/src/Toggle/ToggleButton.js +7 -8
- package/dist/src/Tokens/Tokens.story.d.ts +9 -10
- package/dist/src/Tokens/Tokens.story.js +13 -46
- package/dist/src/Tooltip/Tooltip.d.ts +1 -1
- package/dist/src/Tooltip/Tooltip.js +2 -6
- package/dist/src/Tooltip/Tooltip.story.js +14 -89
- package/dist/src/Tooltip/components/TooltipComponents.d.ts +1 -1
- package/dist/src/Tooltip/components/TooltipComponents.js +5 -7
- package/dist/src/TopBar/TopBar.d.ts +1 -1
- package/dist/src/TopBar/TopBar.js +2 -4
- package/dist/src/TopBar/TopBar.styled.d.ts +16 -15
- package/dist/src/TopBar/components/BackLink.d.ts +3 -1
- package/dist/src/TopBar/components/BackLink.js +2 -5
- package/dist/src/TopBar/components/Menu.d.ts +1 -1
- package/dist/src/TopBar/components/Menu.js +6 -10
- package/dist/src/TopBar/components/MenuItem.d.ts +1 -1
- package/dist/src/TopBar/components/MenuItem.js +2 -2
- package/dist/src/TopBar/components/MenuItemLink.d.ts +3 -1
- package/dist/src/TopBar/components/MenuItemLink.js +2 -6
- package/dist/src/TopBar/components/PageTitle.d.ts +2 -2
- package/dist/src/TopBar/components/PageTitle.js +2 -2
- package/dist/src/TopBar/stories/TopBar.backButton.story.d.ts +3 -4
- package/dist/src/TopBar/stories/TopBar.backButton.story.js +9 -21
- package/dist/src/TopBar/stories/TopBar.menu.story.d.ts +5 -6
- package/dist/src/TopBar/stories/TopBar.menu.story.js +6 -27
- package/dist/src/TopBar/stories/TopBar.story.d.ts +3 -4
- package/dist/src/TopBar/stories/TopBar.story.js +4 -38
- package/dist/src/TruncatedText/TruncatedText.d.ts +1 -2
- package/dist/src/TruncatedText/TruncatedText.js +3 -3
- package/dist/src/TruncatedText/TruncatedText.story.d.ts +9 -10
- package/dist/src/TruncatedText/TruncatedText.story.js +10 -17
- package/dist/src/TruncatedText/components/TruncatedTextFillWidth.d.ts +1 -2
- package/dist/src/TruncatedText/components/TruncatedTextFillWidth.js +3 -3
- package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.d.ts +1 -2
- package/dist/src/TruncatedText/components/TruncatedTextMaxCharacters.js +2 -3
- package/dist/src/Type/Headings.d.ts +8 -8
- package/dist/src/Type/Headings.story.d.ts +3 -4
- package/dist/src/Type/Headings.story.js +4 -12
- package/dist/src/Type/Text.story.d.ts +6 -7
- package/dist/src/Type/Text.story.js +7 -24
- package/dist/src/Type/Typography.story.d.ts +2 -3
- package/dist/src/Type/Typography.story.js +3 -204
- package/dist/src/Validation/InlineValidation.d.ts +1 -1
- package/dist/src/Validation/InlineValidation.js +2 -7
- package/dist/src/Validation/InlineValidation.story.d.ts +4 -5
- package/dist/src/Validation/InlineValidation.story.js +5 -10
- package/dist/src/Validation/mapErrorsToList.d.ts +1 -2
- package/dist/src/Validation/mapErrorsToList.js +2 -2
- package/dist/src/VerticalDivider/VerticalDivider.story.d.ts +2 -2
- package/dist/src/VerticalDivider/VerticalDivider.story.js +3 -9
- package/dist/src/VisualTests/Select.story.d.ts +6 -7
- package/dist/src/VisualTests/Select.story.js +7 -15
- package/dist/src/VisualTests/WithSpace.story.d.ts +18 -19
- package/dist/src/VisualTests/WithSpace.story.js +19 -39
- package/dist/src/i18n.js +4 -0
- package/dist/src/locale.story.d.ts +1 -2
- package/dist/src/locale.story.js +8 -7
- package/dist/src/locales.const.d.ts +5 -0
- package/dist/src/locales.const.js +7 -1
- package/dist/src/pages/ErrorPage.story.d.ts +4 -5
- package/dist/src/pages/ErrorPage.story.js +5 -31
- package/dist/src/pages/LoginPage.story.d.ts +5 -6
- package/dist/src/pages/LoginPage.story.js +6 -55
- package/dist/src/theme/NDSThemeProvider.d.ts +1 -2
- package/dist/src/theme/NDSThemeProvider.js +2 -3
- package/dist/src/utils/DetectOutsideClick.d.ts +1 -1
- package/dist/src/utils/DetectOutsideClick.js +2 -1
- package/dist/src/utils/ScrollIndicators.d.ts +1 -1
- package/dist/src/utils/ScrollIndicators.js +7 -13
- package/dist/src/utils/story/dashed.d.ts +1 -3
- package/dist/src/utils/story/placeholder.d.ts +1 -2
- package/dist/src/utils/story/placeholder.js +2 -7
- package/dist/src/utils/story/resizable.d.ts +5 -3
- package/dist/src/utils/story/resizable.js +5 -8
- package/dist/src/utils/ts/FocusManager.d.ts +1 -1
- package/dist/src/utils/ts/FocusManager.js +9 -8
- package/dist/src/utils/useWindowDimension.story.d.ts +1 -2
- package/dist/src/utils/useWindowDimension.story.js +2 -14
- package/dist/src/utils/withMenuState.js +2 -1
- package/dist/vite.config.js +2 -0
- package/package.json +32 -35
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text, Heading2, Heading3 } from "../Type";
|
|
3
3
|
import { Box } from "../Box";
|
|
4
4
|
import { Flex } from "../Flex";
|
|
@@ -6,59 +6,19 @@ import { StatusIndicator } from "./";
|
|
|
6
6
|
export default {
|
|
7
7
|
title: "Components/StatusIndicator",
|
|
8
8
|
};
|
|
9
|
-
export const All = () => (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
export const Dark = () => React.createElement(StatusIndicator, { type: "dark" }, "Dark");
|
|
19
|
-
export const Quiet = () => React.createElement(StatusIndicator, { type: "quiet" }, "Quiet");
|
|
20
|
-
export const Informative = () => React.createElement(StatusIndicator, { type: "informative" }, "Informative");
|
|
21
|
-
export const Success = () => React.createElement(StatusIndicator, { type: "success" }, "Success");
|
|
22
|
-
export const Warning = () => React.createElement(StatusIndicator, { type: "warning" }, "Warning");
|
|
23
|
-
export const Danger = () => React.createElement(StatusIndicator, { type: "danger" }, "Danger");
|
|
24
|
-
export const FollowingText = () => (React.createElement(React.Fragment, null,
|
|
25
|
-
React.createElement(Box, { mb: "x3" },
|
|
26
|
-
React.createElement(Heading2, { inline: true, mr: "x1" }, "Label"),
|
|
27
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
28
|
-
React.createElement(Box, { mb: "x3" },
|
|
29
|
-
React.createElement(Heading3, { inline: true, mr: "x1" }, "Label"),
|
|
30
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
31
|
-
React.createElement(Box, { mb: "x3" },
|
|
32
|
-
React.createElement(Text, { inline: true, mr: "x1" }, "Label"),
|
|
33
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
34
|
-
React.createElement(Box, { mb: "x3" },
|
|
35
|
-
React.createElement(Text, { fontSize: "small", lineHeight: "smallTextBase", inline: true, mr: "x1" }, "Label"),
|
|
36
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
37
|
-
React.createElement(Box, { mb: "x3" },
|
|
38
|
-
React.createElement(Text, { fontSize: "smaller", lineHeight: "smallerText", inline: true, mr: "x1" }, "Label"),
|
|
39
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
40
|
-
React.createElement(Box, { mb: "x3" },
|
|
41
|
-
React.createElement(Text, { inline: true, mr: "x1" }, "Long label Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in eleifend metus, in tempus sapien. Morbi eget felis est. Nunc facilisis vel nisi nec ornare. Ut blandit ullamcorper enim sed fringilla. Quisque malesuada pharetra tincidunt. Mauris mauris tortor, maximus vitae tempor ac, tincidunt pharetra augue. In eget suscipit est. Suspendisse feugiat risus urna"),
|
|
42
|
-
React.createElement(StatusIndicator, null, "Status"))));
|
|
9
|
+
export const All = () => (_jsxs(_Fragment, { children: [_jsx(StatusIndicator, { type: "neutral", mr: "half", children: "Neutral" }), _jsx(StatusIndicator, { type: "dark", mr: "half", children: "Dark" }), _jsx(StatusIndicator, { type: "quiet", mr: "half", children: "Quiet" }), _jsx(StatusIndicator, { type: "informative", mr: "half", children: "Informative" }), _jsx(StatusIndicator, { type: "success", mr: "half", children: "Success" }), _jsx(StatusIndicator, { type: "warning", mr: "half", children: "Warning" }), _jsx(StatusIndicator, { type: "danger", mr: "half", children: "Danger" })] }));
|
|
10
|
+
export const Neutral = () => _jsx(StatusIndicator, { type: "neutral", children: "Neutral" });
|
|
11
|
+
export const Dark = () => _jsx(StatusIndicator, { type: "dark", children: "Dark" });
|
|
12
|
+
export const Quiet = () => _jsx(StatusIndicator, { type: "quiet", children: "Quiet" });
|
|
13
|
+
export const Informative = () => _jsx(StatusIndicator, { type: "informative", children: "Informative" });
|
|
14
|
+
export const Success = () => _jsx(StatusIndicator, { type: "success", children: "Success" });
|
|
15
|
+
export const Warning = () => _jsx(StatusIndicator, { type: "warning", children: "Warning" });
|
|
16
|
+
export const Danger = () => _jsx(StatusIndicator, { type: "danger", children: "Danger" });
|
|
17
|
+
export const FollowingText = () => (_jsxs(_Fragment, { children: [_jsxs(Box, { mb: "x3", children: [_jsx(Heading2, { inline: true, mr: "x1", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Box, { mb: "x3", children: [_jsx(Heading3, { inline: true, mr: "x1", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Box, { mb: "x3", children: [_jsx(Text, { inline: true, mr: "x1", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Box, { mb: "x3", children: [_jsx(Text, { fontSize: "small", lineHeight: "smallTextBase", inline: true, mr: "x1", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Box, { mb: "x3", children: [_jsx(Text, { fontSize: "smaller", lineHeight: "smallerText", inline: true, mr: "x1", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Box, { mb: "x3", children: [_jsx(Text, { inline: true, mr: "x1", children: "Long label Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in eleifend metus, in tempus sapien. Morbi eget felis est. Nunc facilisis vel nisi nec ornare. Ut blandit ullamcorper enim sed fringilla. Quisque malesuada pharetra tincidunt. Mauris mauris tortor, maximus vitae tempor ac, tincidunt pharetra augue. In eget suscipit est. Suspendisse feugiat risus urna" }), _jsx(StatusIndicator, { children: "Status" })] })] }));
|
|
43
18
|
FollowingText.story = {
|
|
44
19
|
name: "Following text",
|
|
45
20
|
};
|
|
46
|
-
export const InsideFlex = () => (
|
|
47
|
-
React.createElement(Flex, { mb: "x3" },
|
|
48
|
-
React.createElement(Heading2, { inline: true, mr: "x1", mb: "0" }, "Label"),
|
|
49
|
-
React.createElement(StatusIndicator, { className: "my-test-classname" }, "Status")),
|
|
50
|
-
React.createElement(Flex, { mb: "x3" },
|
|
51
|
-
React.createElement(Heading3, { inline: true, mr: "x1", mb: "0" }, "Label"),
|
|
52
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
53
|
-
React.createElement(Flex, { mb: "x3" },
|
|
54
|
-
React.createElement(Text, { inline: true, mr: "x1", mb: "0" }, "Label"),
|
|
55
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
56
|
-
React.createElement(Flex, { mb: "x3" },
|
|
57
|
-
React.createElement(Text, { fontSize: "small", lineHeight: "smallTextBase", inline: true, mr: "x1", mb: "0" }, "Label"),
|
|
58
|
-
React.createElement(StatusIndicator, null, "Status")),
|
|
59
|
-
React.createElement(Flex, { mb: "x3" },
|
|
60
|
-
React.createElement(Text, { fontSize: "smaller", lineHeight: "smallerText", inline: true, mr: "x1", mb: "0" }, "Label"),
|
|
61
|
-
React.createElement(StatusIndicator, null, "Status"))));
|
|
21
|
+
export const InsideFlex = () => (_jsxs(_Fragment, { children: [_jsxs(Flex, { mb: "x3", children: [_jsx(Heading2, { inline: true, mr: "x1", mb: "0", children: "Label" }), _jsx(StatusIndicator, { className: "my-test-classname", children: "Status" })] }), _jsxs(Flex, { mb: "x3", children: [_jsx(Heading3, { inline: true, mr: "x1", mb: "0", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Flex, { mb: "x3", children: [_jsx(Text, { inline: true, mr: "x1", mb: "0", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Flex, { mb: "x3", children: [_jsx(Text, { fontSize: "small", lineHeight: "smallTextBase", inline: true, mr: "x1", mb: "0", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] }), _jsxs(Flex, { mb: "x3", children: [_jsx(Text, { fontSize: "smaller", lineHeight: "smallerText", inline: true, mr: "x1", mb: "0", children: "Label" }), _jsx(StatusIndicator, { children: "Status" })] })] }));
|
|
62
22
|
InsideFlex.story = {
|
|
63
23
|
name: "Inside flex",
|
|
64
24
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { BoxProps } from "../Box/Box";
|
|
3
2
|
type SummaryProps = Omit<BoxProps, "as"> & {
|
|
4
3
|
breakpoint?: number | string;
|
|
5
4
|
};
|
|
6
|
-
declare
|
|
5
|
+
declare function Summary({ breakpoint, children, ...rest }: SummaryProps): import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
export default Summary;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { styled, useTheme } from "styled-components";
|
|
3
3
|
import numberFromDimension from "../utils/numberFromDimension";
|
|
4
4
|
import { Box } from "../Box";
|
|
@@ -21,11 +21,10 @@ const SummaryWrapper = styled(Box)(({ theme, breakpoint }) => ({
|
|
|
21
21
|
rowGap: 0,
|
|
22
22
|
},
|
|
23
23
|
}));
|
|
24
|
-
|
|
24
|
+
function Summary({ breakpoint, children, ...rest }) {
|
|
25
25
|
const theme = useTheme();
|
|
26
26
|
breakpoint || (breakpoint = theme.breakpoints.medium);
|
|
27
27
|
const breakpointPx = numberFromDimension(breakpoint);
|
|
28
|
-
return (
|
|
29
|
-
|
|
30
|
-
};
|
|
28
|
+
return (_jsx(SummaryContextProvider, { breakpoint: breakpointPx, children: _jsx(SummaryWrapper, { breakpoint: breakpointPx, ...rest, children: children }) }));
|
|
29
|
+
}
|
|
31
30
|
export default Summary;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function WithMainInfoOnly(): React.JSX.Element;
|
|
1
|
+
export declare function Default(): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function WithMainInfoOnly(): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
declare const _default: {
|
|
5
4
|
title: string;
|
|
6
5
|
};
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { StatusIndicator } from "../StatusIndicator";
|
|
3
3
|
import { Summary, SummaryDivider, SummaryItem } from "..";
|
|
4
4
|
export function Default() {
|
|
5
|
-
return (
|
|
6
|
-
React.createElement(SummaryItem, { value: 2, status: React.createElement(StatusIndicator, { type: "danger" }, "Missed") }),
|
|
7
|
-
React.createElement(SummaryItem, { value: 42, status: React.createElement(StatusIndicator, { type: "warning" }, "Delayed") }),
|
|
8
|
-
React.createElement(SummaryItem, { value: 139, status: React.createElement(StatusIndicator, { type: "neutral" }, "On Time") }),
|
|
9
|
-
React.createElement(SummaryDivider, null),
|
|
10
|
-
React.createElement(SummaryItem, { value: 12, status: React.createElement(StatusIndicator, { type: "success" }, "Delivered") })));
|
|
5
|
+
return (_jsxs(Summary, { children: [_jsx(SummaryItem, { value: 2, status: _jsx(StatusIndicator, { type: "danger", children: "Missed" }) }), _jsx(SummaryItem, { value: 42, status: _jsx(StatusIndicator, { type: "warning", children: "Delayed" }) }), _jsx(SummaryItem, { value: 139, status: _jsx(StatusIndicator, { type: "neutral", children: "On Time" }) }), _jsx(SummaryDivider, {}), _jsx(SummaryItem, { value: 12, status: _jsx(StatusIndicator, { type: "success", children: "Delivered" }) })] }));
|
|
11
6
|
}
|
|
12
7
|
export function WithMainInfoOnly() {
|
|
13
|
-
return (
|
|
14
|
-
React.createElement(SummaryItem, { value: 42, status: React.createElement(StatusIndicator, { type: "informative" }, "On Time") }),
|
|
15
|
-
React.createElement(SummaryItem, { value: 42, status: React.createElement(StatusIndicator, { type: "informative" }, "On Time") }),
|
|
16
|
-
React.createElement(SummaryItem, { value: 42, status: React.createElement(StatusIndicator, { type: "informative" }, "On Time") })));
|
|
8
|
+
return (_jsxs(Summary, { children: [_jsx(SummaryItem, { value: 42, status: _jsx(StatusIndicator, { type: "informative", children: "On Time" }) }), _jsx(SummaryItem, { value: 42, status: _jsx(StatusIndicator, { type: "informative", children: "On Time" }) }), _jsx(SummaryItem, { value: 42, status: _jsx(StatusIndicator, { type: "informative", children: "On Time" }) })] }));
|
|
17
9
|
}
|
|
18
10
|
export default {
|
|
19
11
|
title: "Components/Summary",
|
|
@@ -3,5 +3,7 @@ type SummaryContextValue = {
|
|
|
3
3
|
breakpoint: number;
|
|
4
4
|
};
|
|
5
5
|
export declare function useSummaryContext(): SummaryContextValue;
|
|
6
|
-
export declare
|
|
6
|
+
export declare function SummaryContextProvider({ breakpoint, children }: SummaryContextValue & {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
2
3
|
const SummaryContext = createContext(undefined);
|
|
3
4
|
export function useSummaryContext() {
|
|
4
5
|
const context = useContext(SummaryContext);
|
|
@@ -7,8 +8,8 @@ export function useSummaryContext() {
|
|
|
7
8
|
}
|
|
8
9
|
return context;
|
|
9
10
|
}
|
|
10
|
-
export
|
|
11
|
-
return (
|
|
11
|
+
export function SummaryContextProvider({ breakpoint, children }) {
|
|
12
|
+
return (_jsx(SummaryContext.Provider, { value: {
|
|
12
13
|
breakpoint,
|
|
13
|
-
}
|
|
14
|
-
}
|
|
14
|
+
}, children: children }));
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
import { Box } from "../Box";
|
|
4
4
|
import numberFromDimension from "../utils/numberFromDimension";
|
|
@@ -16,6 +16,6 @@ const Divider = styled(Box)(({ theme, breakpoint }) => ({
|
|
|
16
16
|
}));
|
|
17
17
|
const SummaryDivider = (props) => {
|
|
18
18
|
const { breakpoint } = useSummaryContext();
|
|
19
|
-
return
|
|
19
|
+
return _jsx(Divider, { breakpoint: numberFromDimension(breakpoint), ...props });
|
|
20
20
|
};
|
|
21
21
|
export default SummaryDivider;
|
|
@@ -4,5 +4,5 @@ type SummaryItemProps = Omit<FlexProps, "as"> & {
|
|
|
4
4
|
value: number | string;
|
|
5
5
|
status: React.ReactNode;
|
|
6
6
|
};
|
|
7
|
-
declare
|
|
7
|
+
declare function SummaryItem({ value, status, ...rest }: SummaryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default SummaryItem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
import { Flex } from "../Flex";
|
|
4
4
|
import { Text } from "../Type";
|
|
@@ -11,12 +11,10 @@ const SummaryItemWrapper = styled(Flex)(({ theme, breakpoint }) => ({
|
|
|
11
11
|
flexDirection: "row",
|
|
12
12
|
},
|
|
13
13
|
}));
|
|
14
|
-
|
|
14
|
+
function SummaryItem({ value, status, ...rest }) {
|
|
15
15
|
const { breakpoint } = useSummaryContext();
|
|
16
16
|
const matches = useMediaQuery(`(max-width: ${breakpoint}px)`);
|
|
17
17
|
delete rest["children"];
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
status));
|
|
21
|
-
};
|
|
18
|
+
return (_jsxs(SummaryItemWrapper, { breakpoint: breakpoint, ...rest, children: [_jsx(Text, { fontWeight: "medium", fontSize: !matches ? "heading4" : undefined, children: value }), status] }));
|
|
19
|
+
}
|
|
22
20
|
export default SummaryItem;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { styled } from "styled-components";
|
|
3
4
|
import { variant } from "styled-system";
|
|
4
5
|
import numberFromDimension from "../utils/numberFromDimension";
|
|
5
6
|
const Switch = React.forwardRef(({ children, ...rest }, ref) => {
|
|
6
|
-
return (
|
|
7
|
+
return (_jsx(SwitchButton, { ...rest, ref: ref, children: children }));
|
|
7
8
|
});
|
|
8
9
|
const SwitchButton = styled.button(({ selected, theme }) => ({
|
|
9
10
|
margin: 1,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
2
|
import type { ComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
3
3
|
import type { SwitchProps } from "./Switch";
|
|
4
4
|
type SwitcherProps = {
|
|
@@ -7,5 +7,5 @@ type SwitcherProps = {
|
|
|
7
7
|
selected?: string;
|
|
8
8
|
onChange?: (value: string) => void;
|
|
9
9
|
};
|
|
10
|
-
declare
|
|
10
|
+
declare function Switcher({ variant, selected, onChange, ...rest }: SwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Switcher;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import React from "react";
|
|
2
3
|
import { Box } from "../Box";
|
|
3
4
|
import FocusManager from "../utils/ts/FocusManager";
|
|
4
5
|
import { useComponentVariant } from "../NDSProvider/ComponentVariantContext";
|
|
5
|
-
|
|
6
|
+
function Switcher({ variant, selected, onChange, ...rest }) {
|
|
6
7
|
const componentVariant = useComponentVariant(variant);
|
|
7
8
|
const optionRefs = [];
|
|
8
9
|
const isSelected = (value, index) => {
|
|
@@ -35,7 +36,6 @@ const Switcher = ({ variant, selected, onChange, ...rest }) => {
|
|
|
35
36
|
});
|
|
36
37
|
});
|
|
37
38
|
};
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
};
|
|
39
|
+
return (_jsx(Box, { display: "inline-flex", bg: "whiteGrey", borderRadius: "9999px", ...rest, children: _jsx(FocusManager, { refs: optionRefs, defaultFocusedIndex: getSelectedIndex(), children: ({ focusedIndex, setFocusedIndex, handleArrowNavigation }) => options(focusedIndex, setFocusedIndex, handleArrowNavigation) }) }));
|
|
40
|
+
}
|
|
41
41
|
export default Switcher;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const WithContent: () => React.JSX.Element;
|
|
1
|
+
export declare const WithSelectedValue: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const WithOtherInteractiveElements: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const WithContent: () => import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
declare const _default: {
|
|
6
5
|
title: string;
|
|
7
6
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
2
3
|
import { Box } from "../Box";
|
|
3
4
|
import { Text } from "../Type";
|
|
4
5
|
import { Button } from "../Button";
|
|
@@ -7,25 +8,12 @@ import Switcher from "./Switcher";
|
|
|
7
8
|
import Switch from "./Switch";
|
|
8
9
|
export const WithSelectedValue = () => {
|
|
9
10
|
const [selected, setSelected] = useState("option_2");
|
|
10
|
-
return (
|
|
11
|
-
React.createElement(Switch, { value: "option_1" }, "Option 1"),
|
|
12
|
-
React.createElement(Switch, { value: "option_2" }, "Option 2")));
|
|
11
|
+
return (_jsxs(Switcher, { "aria-label": "storybook-switcher", selected: selected, onChange: setSelected, children: [_jsx(Switch, { value: "option_1", children: "Option 1" }), _jsx(Switch, { value: "option_2", children: "Option 2" })] }));
|
|
13
12
|
};
|
|
14
|
-
export const WithOtherInteractiveElements = () => (
|
|
15
|
-
React.createElement(Button, null, "Click me"),
|
|
16
|
-
React.createElement(Switcher, { "aria-label": "storybook-switcher", selected: "option_2" },
|
|
17
|
-
React.createElement(Switch, { value: "option_1" }, "Option 1"),
|
|
18
|
-
React.createElement(Switch, { value: "option_2" }, "Option 2"))));
|
|
13
|
+
export const WithOtherInteractiveElements = () => (_jsxs(Flex, { gap: "x1", alignItems: "center", children: [_jsx(Button, { children: "Click me" }), _jsxs(Switcher, { "aria-label": "storybook-switcher", selected: "option_2", children: [_jsx(Switch, { value: "option_1", children: "Option 1" }), _jsx(Switch, { value: "option_2", children: "Option 2" })] })] }));
|
|
19
14
|
export const WithContent = () => {
|
|
20
15
|
const [selected, setSelected] = useState("all");
|
|
21
|
-
return (
|
|
22
|
-
React.createElement(Switcher, { "aria-label": "storybook-switcher", selected: selected, onChange: setSelected },
|
|
23
|
-
React.createElement(Switch, { value: "all" }, "All"),
|
|
24
|
-
React.createElement(Switch, { value: "option_1" }, "Option 1"),
|
|
25
|
-
React.createElement(Switch, { value: "option_2" }, "Option 2")),
|
|
26
|
-
React.createElement(Box, { px: "x1", py: "x3" },
|
|
27
|
-
["all", "option_1"].includes(selected) && React.createElement(Text, null, "Option 1 Content"),
|
|
28
|
-
["all", "option_2"].includes(selected) && React.createElement(Text, null, "Option 2 Content"))));
|
|
16
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Switcher, { "aria-label": "storybook-switcher", selected: selected, onChange: setSelected, children: [_jsx(Switch, { value: "all", children: "All" }), _jsx(Switch, { value: "option_1", children: "Option 1" }), _jsx(Switch, { value: "option_2", children: "Option 2" })] }), _jsxs(Box, { px: "x1", py: "x3", children: [["all", "option_1"].includes(selected) && _jsx(Text, { children: "Option 1 Content" }), ["all", "option_2"].includes(selected) && _jsx(Text, { children: "Option 2 Content" })] })] }));
|
|
29
17
|
};
|
|
30
18
|
export default {
|
|
31
19
|
title: "Components/Switcher",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { RowType, Columns, RowBorder } from "./Table.types";
|
|
3
3
|
export type BaseTableProps<ColumnMetaData> = {
|
|
4
4
|
columns: Columns<ColumnMetaData>;
|
|
@@ -18,5 +18,5 @@ export type BaseTableProps<ColumnMetaData> = {
|
|
|
18
18
|
onMouseLeave?: any;
|
|
19
19
|
rowBorder?: RowBorder;
|
|
20
20
|
};
|
|
21
|
-
declare function BaseTable<ColumnMetaData>({ noRowsContent, keyField, loading, footerRows, rowHovers, compact, stickyHeader, onRowMouseEnter, onRowMouseLeave, columns, rows, id, className, rowBorder, ...props }: BaseTableProps<ColumnMetaData>):
|
|
21
|
+
declare function BaseTable<ColumnMetaData>({ noRowsContent, keyField, loading, footerRows, rowHovers, compact, stickyHeader, onRowMouseEnter, onRowMouseLeave, columns, rows, id, className, rowBorder, ...props }: BaseTableProps<ColumnMetaData>): import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default BaseTable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
import { space } from "styled-system";
|
|
4
4
|
import TableHead from "./TableHead";
|
|
@@ -11,9 +11,6 @@ const StyledTable = styled.table(space, {
|
|
|
11
11
|
position: "relative",
|
|
12
12
|
});
|
|
13
13
|
function BaseTable({ noRowsContent = "No records have been created for this table.", keyField = "id", loading = false, footerRows = [], rowHovers = true, compact = false, stickyHeader = false, onRowMouseEnter = () => { }, onRowMouseLeave = () => { }, columns, rows, id, className, rowBorder = false, ...props }) {
|
|
14
|
-
return (
|
|
15
|
-
React.createElement(TableHead, { columns: columns, compact: compact, sticky: stickyHeader }),
|
|
16
|
-
React.createElement(TableBody, { columns: columns, rows: rows, keyField: keyField, noRowsContent: noRowsContent, loading: loading, rowHovers: rowHovers, compact: compact, onRowMouseLeave: onRowMouseLeave, onRowMouseEnter: onRowMouseEnter, rowBorder: rowBorder }),
|
|
17
|
-
footerRows && (React.createElement(TableFoot, { columns: columns, rows: footerRows, keyField: keyField, loading: loading, compact: compact }))));
|
|
14
|
+
return (_jsxs(StyledTable, { id: id, className: className, ...props, children: [_jsx(TableHead, { columns: columns, compact: compact, sticky: stickyHeader }), _jsx(TableBody, { columns: columns, rows: rows, keyField: keyField, noRowsContent: noRowsContent, loading: loading, rowHovers: rowHovers, compact: compact, onRowMouseLeave: onRowMouseLeave, onRowMouseEnter: onRowMouseEnter, rowBorder: rowBorder }), footerRows && (_jsx(TableFoot, { columns: columns, rows: footerRows, keyField: keyField, loading: loading, compact: compact }))] }));
|
|
18
15
|
}
|
|
19
16
|
export default BaseTable;
|
|
@@ -6,5 +6,5 @@ interface SortingColumnHeaderProps {
|
|
|
6
6
|
ascending?: boolean;
|
|
7
7
|
active?: boolean;
|
|
8
8
|
}
|
|
9
|
-
declare function SortingColumnHeader({ onChange, label, ariaLabel, ascending, active, }: SortingColumnHeaderProps):
|
|
9
|
+
declare function SortingColumnHeader({ onChange, label, ariaLabel, ascending, active, }: SortingColumnHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default SortingColumnHeader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation } from "react-i18next";
|
|
3
3
|
import { Text } from "../Type";
|
|
4
4
|
import { Flex } from "../Flex";
|
|
@@ -6,8 +6,6 @@ import { ControlIcon } from "../Button";
|
|
|
6
6
|
function SortingColumnHeader({ onChange, label, ariaLabel, ascending = false, active = false, }) {
|
|
7
7
|
const { t } = useTranslation();
|
|
8
8
|
const defaultAriaLabel = ascending ? t("sort descending") : t("sort ascending");
|
|
9
|
-
return (
|
|
10
|
-
React.createElement(Text, { mr: "x1" }, label),
|
|
11
|
-
React.createElement(ControlIcon, { size: "x3", icon: ascending ? "sortDown" : "sortUp", label: ariaLabel || defaultAriaLabel, toggled: active, onClick: onChange })));
|
|
9
|
+
return (_jsxs(Flex, { alignItems: "center", children: [_jsx(Text, { mr: "x1", children: label }), _jsx(ControlIcon, { size: "x3", icon: ascending ? "sortDown" : "sortUp", label: ariaLabel || defaultAriaLabel, toggled: active, onClick: onChange })] }));
|
|
12
10
|
}
|
|
13
11
|
export default SortingColumnHeader;
|
|
@@ -102,6 +102,6 @@ declare class StatefulTable<ColumnMetaData> extends Component<StatefulTableProps
|
|
|
102
102
|
onSelectHeader?: (...args: any[]) => any;
|
|
103
103
|
isHeaderSelected?: any;
|
|
104
104
|
};
|
|
105
|
-
render():
|
|
105
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
106
106
|
}
|
|
107
107
|
export default StatefulTable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Component } from "react";
|
|
2
3
|
import propTypes from "@styled-system/prop-types";
|
|
3
4
|
import { Pagination } from "../Pagination";
|
|
4
5
|
import { pick } from "../utils/subset";
|
|
@@ -192,9 +193,7 @@ class StatefulTable extends Component {
|
|
|
192
193
|
const { paginatedRows, currentPage } = this.state;
|
|
193
194
|
const { rowsPerPage, paginationProps, paginationCss } = this.props;
|
|
194
195
|
const baseTableProps = pick(this.getControlProps(), ...propNames);
|
|
195
|
-
return (
|
|
196
|
-
React.createElement(BaseTable, { ...baseTableProps }),
|
|
197
|
-
rowsPerPage && (React.createElement(Pagination, { pt: "x2", currentPage: currentPage, totalPages: paginatedRows.length || 1, onSelectPage: this.goToPage, onNext: this.goToNextPage, onPrevious: this.goToPrevPage, justifyContent: "flex-end", css: paginationCss, ...paginationProps }))));
|
|
196
|
+
return (_jsxs(_Fragment, { children: [_jsx(BaseTable, { ...baseTableProps }), rowsPerPage && (_jsx(Pagination, { pt: "x2", currentPage: currentPage, totalPages: paginatedRows.length || 1, onSelectPage: this.goToPage, onNext: this.goToNextPage, onPrevious: this.goToPrevPage, justifyContent: "flex-end", css: paginationCss, ...paginationProps }))] }));
|
|
198
197
|
}
|
|
199
198
|
}
|
|
200
199
|
StatefulTable.defaultProps = {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import SortingColumnHeader from "./SortingColumnHeader";
|
|
3
2
|
import { StatefulTableProps } from "./StatefulTable";
|
|
4
3
|
import { ColumnType, RowType, CellInfoType } from "./Table.types";
|
|
@@ -6,7 +5,7 @@ export type TableProps<ColumnMetadata = unknown> = StatefulTableProps<ColumnMeta
|
|
|
6
5
|
export type TableColumnType<ColumnMetadata = unknown> = ColumnType<ColumnMetadata>;
|
|
7
6
|
export type TableRowType = RowType;
|
|
8
7
|
export type TableCellInfoType<ColumnMetadata = unknown> = CellInfoType<ColumnMetadata>;
|
|
9
|
-
declare function Table<ColumnMetadata>({ hasSelectableRows, rowsPerPage, hasExpandableRows, selectedRows, onRowSelectionChange, onRowExpansionChange, onPageChange, selectAllAriaLabel, deselectAllAriaLabel, paginationCss, paginationProps, ...props }: TableProps<ColumnMetadata>):
|
|
8
|
+
declare function Table<ColumnMetadata>({ hasSelectableRows, rowsPerPage, hasExpandableRows, selectedRows, onRowSelectionChange, onRowExpansionChange, onPageChange, selectAllAriaLabel, deselectAllAriaLabel, paginationCss, paginationProps, ...props }: TableProps<ColumnMetadata>): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
declare namespace Table {
|
|
11
10
|
var SortingHeader: typeof SortingColumnHeader;
|
|
12
11
|
}
|
package/dist/src/Table/Table.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import StatefulTable from "./StatefulTable";
|
|
3
3
|
import BaseTable from "./BaseTable";
|
|
4
4
|
import SortingColumnHeader from "./SortingColumnHeader";
|
|
5
5
|
function Table({ hasSelectableRows, rowsPerPage, hasExpandableRows, selectedRows, onRowSelectionChange, onRowExpansionChange, onPageChange, selectAllAriaLabel, deselectAllAriaLabel, paginationCss, paginationProps, ...props }) {
|
|
6
|
-
return hasSelectableRows || rowsPerPage || hasExpandableRows ? (
|
|
6
|
+
return hasSelectableRows || rowsPerPage || hasExpandableRows ? (_jsx(StatefulTable, { hasExpandableRows: hasExpandableRows, hasSelectableRows: hasSelectableRows, onRowExpansionChange: onRowExpansionChange, onRowSelectionChange: onRowSelectionChange, selectedRows: selectedRows, rowsPerPage: rowsPerPage, onPageChange: onPageChange, selectAllAriaLabel: selectAllAriaLabel, deselectAllAriaLabel: deselectAllAriaLabel, paginationCss: paginationCss, paginationProps: paginationProps, ...props })) : (_jsx(BaseTable, { ...props }));
|
|
7
7
|
}
|
|
8
8
|
Table.SortingHeader = SortingColumnHeader;
|
|
9
9
|
export default Table;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { RowBorder } from "./Table.types";
|
|
3
3
|
interface TableBodyProps {
|
|
4
4
|
rows: any[];
|
|
@@ -12,5 +12,5 @@ interface TableBodyProps {
|
|
|
12
12
|
onRowMouseEnter?: (...args: any[]) => any;
|
|
13
13
|
rowBorder?: RowBorder;
|
|
14
14
|
}
|
|
15
|
-
declare const TableBody: ({ rows, columns, keyField, noRowsContent, loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }: TableBodyProps) =>
|
|
15
|
+
declare const TableBody: ({ rows, columns, keyField, noRowsContent, loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }: TableBodyProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export default TableBody;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
import { Box } from "../Box";
|
|
4
4
|
import TableCell from "./TableCell";
|
|
@@ -20,18 +20,13 @@ const StyledTr = styled.tr(({ rowHovers, rowBorder, theme }) => ({
|
|
|
20
20
|
}));
|
|
21
21
|
const renderRows = (rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder) => rows.length > 0 ? (rows.map((row, rowIndex) => {
|
|
22
22
|
const rowKey = row[keyField] !== undefined ? row[keyField] : rowIndex;
|
|
23
|
-
return (
|
|
24
|
-
})) : (
|
|
23
|
+
return (_jsx(TableBodyRow, { row: row, columns: columns, keyField: keyField, rowHovers: rowHovers, compact: compact, rowClassName: row.rowClassName, onMouseEnter: (e) => onRowMouseEnter({ row, e }), onMouseLeave: (e) => onRowMouseLeave({ row, e }), rowBorder: rowBorder }, rowKey));
|
|
24
|
+
})) : (_jsx(TableMessageContainer, { colSpan: columns.length, children: noRowsContent }));
|
|
25
25
|
const TableBodyRow = ({ row, columns, rowHovers, compact, rowClassName, onMouseLeave, onMouseEnter, rowBorder, }) => {
|
|
26
|
-
const renderAllCells = () => columns.map((column, index) => (
|
|
27
|
-
return (
|
|
28
|
-
React.createElement(StyledTr, { rowHovers: rowHovers, "data-testid": "table-row", className: rowClassName, onMouseLeave: onMouseLeave, onMouseEnter: onMouseEnter, rowBorder: rowBorder }, row.heading ? (React.createElement(TableCell, { row: row, colSpan: columns.length, cellData: row.heading, compact: compact })) : (renderAllCells())),
|
|
29
|
-
row.expandedContent && row.expanded && (React.createElement("tr", { "data-testid": "expanded-table-row" },
|
|
30
|
-
React.createElement("td", { colSpan: columns.length }, row.expandedContent({ row }))))));
|
|
26
|
+
const renderAllCells = () => columns.map((column, index) => (_jsx(TableCell, { row: row, column: column, cellData: row[column.dataKey], compact: compact }, column.dataKey ?? column.key ?? index)));
|
|
27
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledTr, { rowHovers: rowHovers, "data-testid": "table-row", className: rowClassName, onMouseLeave: onMouseLeave, onMouseEnter: onMouseEnter, rowBorder: rowBorder, children: row.heading ? (_jsx(TableCell, { row: row, colSpan: columns.length, cellData: row.heading, compact: compact })) : (renderAllCells()) }), row.expandedContent && row.expanded && (_jsx("tr", { "data-testid": "expanded-table-row", children: _jsx("td", { colSpan: columns.length, children: row.expandedContent({ row }) }) }))] }));
|
|
31
28
|
};
|
|
32
|
-
const TableMessageContainer = ({ colSpan, children }) => (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const LoadingContent = ({ colSpan }) => (React.createElement(TableMessageContainer, { colSpan: colSpan }, "Loading..."));
|
|
36
|
-
const TableBody = ({ rows, columns, keyField = "id", noRowsContent = "No records have been created for this table.", loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }) => (React.createElement("tbody", { "data-testid": "table-body" }, !loading ? (renderRows(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder)) : (React.createElement(LoadingContent, { colSpan: columns.length }))));
|
|
29
|
+
const TableMessageContainer = ({ colSpan, children }) => (_jsx("tr", { "data-testid": "table-message-container", children: _jsx("td", { colSpan: colSpan, children: _jsx(StyledMessageContainer, { className: "nds-table__no-rows-content", children: children }) }) }));
|
|
30
|
+
const LoadingContent = ({ colSpan }) => (_jsx(TableMessageContainer, { colSpan: colSpan, children: "Loading..." }));
|
|
31
|
+
const TableBody = ({ rows, columns, keyField = "id", noRowsContent = "No records have been created for this table.", loading, rowHovers, compact, onRowMouseLeave, onRowMouseEnter, rowBorder, }) => (_jsx("tbody", { "data-testid": "table-body", children: !loading ? (renderRows(rows, columns, keyField, rowHovers, noRowsContent, compact, onRowMouseLeave, onRowMouseEnter, rowBorder)) : (_jsx(LoadingContent, { colSpan: columns.length })) }));
|
|
37
32
|
export default TableBody;
|
|
@@ -6,5 +6,5 @@ type TableCellProps = {
|
|
|
6
6
|
cellData?: Record<string, unknown> | React.ReactNode | boolean;
|
|
7
7
|
compact?: boolean;
|
|
8
8
|
};
|
|
9
|
-
declare const TableCell: ({ column, row, cellData, colSpan, compact }: TableCellProps) =>
|
|
9
|
+
declare const TableCell: ({ column, row, cellData, colSpan, compact }: TableCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default TableCell;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
const StyledTableCell = styled.td(({ align, compact, verticalAlign, theme }) => {
|
|
4
4
|
const padding = compact ? theme.space.x1 : theme.space.x2;
|
|
@@ -19,8 +19,8 @@ const TableCell = ({ column = {}, row = {}, cellData = "", colSpan = undefined,
|
|
|
19
19
|
const isCustomCell = Boolean(cellRenderer);
|
|
20
20
|
const cellContent = cellFormatter ? cellFormatter({ cellData, column, row }) : cellData;
|
|
21
21
|
if (isCustomCell) {
|
|
22
|
-
return
|
|
22
|
+
return _jsx("td", { colSpan: colSpan, children: cellRenderer ? cellRenderer({ cellData, column, row }) : cellData });
|
|
23
23
|
}
|
|
24
|
-
return (
|
|
24
|
+
return (_jsx(StyledTableCell, { align: column.align, compact: compact, verticalAlign: row.verticalAlign, children: cellContent }));
|
|
25
25
|
};
|
|
26
26
|
export default TableCell;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { RowType, Columns } from "./Table.types";
|
|
3
2
|
declare function TableFoot<ColumnMetadata>({ columns, rows, keyField, loading, compact, }: {
|
|
4
3
|
columns: Columns<ColumnMetadata>;
|
|
@@ -6,5 +5,5 @@ declare function TableFoot<ColumnMetadata>({ columns, rows, keyField, loading, c
|
|
|
6
5
|
keyField?: string;
|
|
7
6
|
loading?: boolean;
|
|
8
7
|
compact?: boolean;
|
|
9
|
-
}):
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export default TableFoot;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from "styled-components";
|
|
3
3
|
import TableCell from "./TableCell";
|
|
4
4
|
import StyledTh from "./StyledTh";
|
|
@@ -7,17 +7,17 @@ const StyledFooterRow = styled.tr(({ theme }) => ({
|
|
|
7
7
|
borderTop: `1px solid ${theme.colors.lightGrey}`,
|
|
8
8
|
},
|
|
9
9
|
}));
|
|
10
|
-
const renderRows = (rows, columns, keyField, loading, compact) => rows.map((row) => (
|
|
10
|
+
const renderRows = (rows, columns, keyField, loading, compact) => rows.map((row) => (_jsx(TableFooterRow, { row: row, columns: columns, loading: loading, compact: compact }, row[keyField])));
|
|
11
11
|
const TableFooterRow = ({ row, columns, loading, compact }) => {
|
|
12
12
|
const columnsWithoutControls = columns.filter((column) => column.dataKey !== "selected" && column.dataKey !== "expanded");
|
|
13
13
|
const numberOfControlColumns = columns.length - columnsWithoutControls.length;
|
|
14
|
-
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
return (_jsx(StyledFooterRow, { children: columnsWithoutControls.map((column, index) => index === 0 ? (_jsx(StyledTh, { scope: "row", colSpan: numberOfControlColumns + 1, compact: compact, children: row[column.dataKey] }, column.dataKey)) : (!loading && (_jsx(TableCell, { row: row, column: {
|
|
15
|
+
dataKey: column.dataKey,
|
|
16
|
+
label: column.label,
|
|
17
|
+
align: column.align,
|
|
18
|
+
}, cellData: row[column.dataKey], compact: compact }, column.dataKey ?? column.key ?? index)))) }));
|
|
19
19
|
};
|
|
20
20
|
function TableFoot({ columns, rows, keyField = "id", loading = false, compact = false, }) {
|
|
21
|
-
return
|
|
21
|
+
return _jsx("tfoot", { children: renderRows(rows, columns, keyField, loading, compact) });
|
|
22
22
|
}
|
|
23
23
|
export default TableFoot;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import type { Columns } from "./Table.types";
|
|
3
2
|
interface TableHeadProps<ColumnMetadata> {
|
|
4
3
|
columns: Columns<ColumnMetadata>;
|
|
5
4
|
compact?: boolean;
|
|
6
5
|
sticky?: boolean;
|
|
7
6
|
}
|
|
8
|
-
declare function TableHead<ColumnMetadata>({ columns, compact, sticky }: TableHeadProps<ColumnMetadata>):
|
|
7
|
+
declare function TableHead<ColumnMetadata>({ columns, compact, sticky }: TableHeadProps<ColumnMetadata>): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default TableHead;
|