@dnb/eufemia 9.17.0 → 9.19.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/CHANGELOG.md +63 -0
- package/cjs/components/Avatar.d.ts +14 -0
- package/cjs/components/Avatar.js +52 -0
- package/cjs/components/InfoCard.d.ts +14 -0
- package/cjs/components/InfoCard.js +52 -0
- package/cjs/components/Tag.d.ts +14 -0
- package/cjs/components/Tag.js +52 -0
- package/cjs/components/Timeline.d.ts +14 -0
- package/cjs/components/Timeline.js +52 -0
- package/cjs/components/accordion/Accordion.d.ts +7 -7
- package/cjs/components/autocomplete/Autocomplete.d.ts +13 -13
- package/cjs/components/avatar/Avatar.js +149 -0
- package/cjs/components/avatar/AvatarGroup.js +131 -0
- package/cjs/components/avatar/index.d.ts +8 -0
- package/cjs/components/avatar/index.js +52 -0
- package/cjs/components/avatar/style/_avatar.scss +145 -0
- package/cjs/components/avatar/style/dnb-avatar.css +218 -0
- package/cjs/components/avatar/style/dnb-avatar.min.css +1 -0
- package/cjs/components/avatar/style/dnb-avatar.scss +12 -0
- package/cjs/components/avatar/style/index.d.ts +6 -0
- package/cjs/components/avatar/style/index.js +3 -0
- package/cjs/components/avatar/style/themes/dnb-avatar-theme-ui.css +36 -0
- package/cjs/components/avatar/style/themes/dnb-avatar-theme-ui.min.css +1 -0
- package/cjs/components/avatar/style/themes/dnb-avatar-theme-ui.scss +29 -0
- package/cjs/components/avatar/style/themes/ui.js +3 -0
- package/cjs/components/avatar/style.js +3 -0
- package/cjs/components/breadcrumb/BreadcrumbItem.js +3 -3
- package/cjs/components/button/Button.d.ts +8 -8
- package/cjs/components/button/Button.js +7 -5
- package/cjs/components/button/style/themes/dnb-button-theme-ui.scss +3 -0
- package/cjs/components/checkbox/Checkbox.d.ts +3 -3
- package/cjs/components/date-picker/DatePicker.d.ts +14 -14
- package/cjs/components/date-picker/DatePicker.js +4 -2
- package/cjs/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/cjs/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/cjs/components/date-picker/DatePickerFooter.d.ts +1 -0
- package/cjs/components/date-picker/DatePickerFooter.js +10 -6
- package/cjs/components/date-picker/DatePickerInput.d.ts +1 -1
- package/cjs/components/dropdown/Dropdown.d.ts +11 -10
- package/cjs/components/form-label/FormLabel.d.ts +1 -1
- package/cjs/components/form-row/FormRow.d.ts +4 -4
- package/cjs/components/form-set/FormSet.d.ts +5 -5
- package/cjs/components/global-error/GlobalError.d.ts +1 -1
- package/cjs/components/global-status/GlobalStatus.d.ts +5 -5
- package/cjs/components/heading/Heading.d.ts +2 -2
- package/cjs/components/heading/HeadingProvider.d.ts +2 -2
- package/cjs/components/help-button/HelpButton.d.ts +1 -1
- package/cjs/components/help-button/HelpButtonInstance.d.ts +3 -2
- package/cjs/components/icon/Icon.d.ts +2 -2
- package/cjs/components/icon-primary/IconPrimary.d.ts +2 -2
- package/cjs/components/index.d.ts +8 -0
- package/cjs/components/index.js +32 -0
- package/cjs/components/info-card/InfoCard.js +180 -0
- package/cjs/components/info-card/index.d.ts +8 -0
- package/cjs/components/info-card/index.js +52 -0
- package/cjs/components/info-card/style/_info-card.scss +52 -0
- package/cjs/components/info-card/style/dnb-info-card.css +135 -0
- package/cjs/components/info-card/style/dnb-info-card.min.css +1 -0
- package/cjs/components/info-card/style/dnb-info-card.scss +12 -0
- package/cjs/components/info-card/style/index.d.ts +6 -0
- package/cjs/components/info-card/style/index.js +3 -0
- package/cjs/components/info-card/style.js +3 -0
- package/cjs/components/input/Input.d.ts +11 -10
- package/cjs/components/input-masked/InputMasked.d.ts +11 -11
- package/cjs/components/input-masked/InputMasked.js +6 -3
- package/cjs/components/input-masked/InputMaskedHooks.js +45 -52
- package/cjs/components/input-masked/InputMaskedUtils.js +9 -20
- package/cjs/components/lib.js +36 -0
- package/cjs/components/modal/Modal.js +157 -299
- package/cjs/components/modal/ModalContent.js +169 -274
- package/cjs/components/modal/ModalRoot.js +194 -0
- package/cjs/components/modal/components/CloseButton.js +125 -0
- package/cjs/components/modal/components/ModalHeader.js +124 -0
- package/cjs/components/modal/{ModalHeader.js → components/ModalHeaderBar.js} +50 -162
- package/cjs/components/modal/{ModalInner.js → components/ModalInner.js} +11 -19
- package/cjs/components/modal/helpers.js +80 -0
- package/cjs/components/modal/types.js +1 -0
- package/cjs/components/number-format/NumberFormat.d.ts +10 -10
- package/cjs/components/pagination/Pagination.d.ts +30 -30
- package/cjs/components/pagination/Pagination.js +11 -1
- package/cjs/components/pagination/PaginationProvider.d.ts +2 -2
- package/cjs/components/radio/Radio.d.ts +5 -5
- package/cjs/components/radio/RadioGroup.d.ts +4 -4
- package/cjs/components/section/Section.d.ts +3 -2
- package/cjs/components/skeleton/Skeleton.d.ts +2 -2
- package/cjs/components/slider/Slider.d.ts +5 -5
- package/cjs/components/step-indicator/StepIndicator.d.ts +6 -6
- package/cjs/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/cjs/components/step-indicator/StepIndicatorItem.d.ts +3 -3
- package/cjs/components/step-indicator/StepIndicatorItem.js +1 -0
- package/cjs/components/step-indicator/StepIndicatorSidebar.d.ts +4 -4
- package/cjs/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/cjs/components/switch/Switch.d.ts +6 -6
- package/cjs/components/tabs/Tabs.d.ts +8 -8
- package/cjs/components/tabs/TabsContentWrapper.d.ts +2 -2
- package/cjs/components/tabs/TabsCustomContent.d.ts +1 -1
- package/cjs/components/tag/Tag.js +157 -0
- package/cjs/components/tag/TagContext.js +14 -0
- package/cjs/components/tag/TagGroup.js +123 -0
- package/cjs/components/tag/index.d.ts +8 -0
- package/cjs/components/tag/index.js +52 -0
- package/cjs/components/tag/style/_tag.scss +90 -0
- package/cjs/components/tag/style/dnb-tag.css +925 -0
- package/cjs/components/tag/style/dnb-tag.min.css +1 -0
- package/cjs/components/tag/style/dnb-tag.scss +15 -0
- package/cjs/components/tag/style/index.d.ts +6 -0
- package/cjs/components/tag/style/index.js +3 -0
- package/cjs/components/tag/style/themes/_tag-mixins.scss +18 -0
- package/cjs/components/tag/style.js +3 -0
- package/cjs/components/textarea/Textarea.d.ts +4 -4
- package/cjs/components/timeline/Timeline.js +129 -0
- package/cjs/components/timeline/TimelineItem.js +149 -0
- package/cjs/components/timeline/index.d.ts +8 -0
- package/cjs/components/timeline/index.js +52 -0
- package/cjs/components/timeline/style/_timeline.scss +42 -0
- package/cjs/components/timeline/style/dnb-timeline.css +307 -0
- package/cjs/components/timeline/style/dnb-timeline.min.css +1 -0
- package/cjs/components/timeline/style/dnb-timeline.scss +12 -0
- package/cjs/components/timeline/style/index.d.ts +6 -0
- package/cjs/components/timeline/style/index.js +3 -0
- package/cjs/components/timeline/style/themes/dnb-timeline-theme-ui.css +185 -0
- package/cjs/components/timeline/style/themes/dnb-timeline-theme-ui.min.css +1 -0
- package/cjs/components/timeline/style/themes/dnb-timeline-theme-ui.scss +105 -0
- package/cjs/components/timeline/style/themes/ui.js +3 -0
- package/cjs/components/timeline/style.js +3 -0
- package/cjs/components/toggle-button/ToggleButton.d.ts +7 -7
- package/cjs/components/toggle-button/ToggleButtonGroup.d.ts +4 -4
- package/cjs/components/tooltip/Tooltip.d.ts +5 -5
- package/cjs/components/tooltip/TooltipContainer.d.ts +3 -3
- package/cjs/components/tooltip/TooltipPortal.d.ts +1 -1
- package/cjs/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/cjs/elements/Img.d.ts +2 -2
- package/cjs/extensions/payment-card/PaymentCard.d.ts +1 -1
- package/cjs/extensions/payment-card/style/_payment-card.scss +0 -1
- package/cjs/extensions/payment-card/style/dnb-payment-card.css +0 -1
- package/cjs/extensions/payment-card/style/dnb-payment-card.min.css +1 -1
- package/cjs/fragments/drawer-list/DrawerListProvider.js +1 -0
- package/cjs/fragments/scroll-view/ScrollView.js +7 -16
- package/cjs/index.d.ts +8 -0
- package/cjs/index.js +32 -0
- package/cjs/shared/Context.js +11 -4
- package/cjs/shared/locales/en-GB.js +5 -0
- package/cjs/shared/locales/nb-NO.js +5 -0
- package/cjs/style/core/helper-classes/skip-link.scss +1 -1
- package/cjs/style/dnb-ui-components.css +716 -0
- package/cjs/style/dnb-ui-components.min.css +3 -3
- package/cjs/style/dnb-ui-components.scss +4 -0
- package/cjs/style/dnb-ui-elements.css +3 -0
- package/cjs/style/dnb-ui-elements.min.css +1 -1
- package/cjs/style/dnb-ui-extensions.css +0 -1
- package/cjs/style/dnb-ui-extensions.min.css +1 -1
- package/cjs/style/dnb-ui-tags.css +6 -0
- package/cjs/style/dnb-ui-tags.min.css +2 -2
- package/cjs/style/elements/code.scss +3 -0
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.css +226 -0
- package/cjs/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +3 -3
- package/cjs/style/themes/theme-ui/dnb-theme-ui.css +226 -0
- package/cjs/style/themes/theme-ui/dnb-theme-ui.min.css +3 -3
- package/cjs/style/themes/theme-ui/dnb-theme-ui.scss +2 -0
- package/components/Avatar.d.ts +14 -0
- package/components/Avatar.js +3 -0
- package/components/InfoCard.d.ts +14 -0
- package/components/InfoCard.js +3 -0
- package/components/Tag.d.ts +14 -0
- package/components/Tag.js +3 -0
- package/components/Timeline.d.ts +14 -0
- package/components/Timeline.js +3 -0
- package/components/accordion/Accordion.d.ts +7 -7
- package/components/autocomplete/Autocomplete.d.ts +13 -13
- package/components/avatar/Avatar.js +89 -0
- package/components/avatar/Avatar.tsx +163 -0
- package/components/avatar/AvatarGroup.js +94 -0
- package/components/avatar/AvatarGroup.tsx +167 -0
- package/components/avatar/index.d.ts +8 -0
- package/components/avatar/index.js +3 -0
- package/components/avatar/style/_avatar.scss +145 -0
- package/components/avatar/style/dnb-avatar.css +218 -0
- package/components/avatar/style/dnb-avatar.min.css +1 -0
- package/components/avatar/style/dnb-avatar.scss +12 -0
- package/components/avatar/style/index.d.ts +6 -0
- package/components/avatar/style/index.js +1 -0
- package/components/avatar/style/themes/dnb-avatar-theme-ui.css +36 -0
- package/components/avatar/style/themes/dnb-avatar-theme-ui.min.css +1 -0
- package/components/avatar/style/themes/dnb-avatar-theme-ui.scss +29 -0
- package/components/avatar/style/themes/ui.js +1 -0
- package/components/avatar/style.js +1 -0
- package/components/breadcrumb/BreadcrumbItem.js +3 -3
- package/components/breadcrumb/BreadcrumbItem.tsx +2 -2
- package/components/button/Button.d.ts +7 -7
- package/components/button/Button.js +7 -5
- package/components/button/style/themes/dnb-button-theme-ui.scss +3 -0
- package/components/checkbox/Checkbox.d.ts +3 -3
- package/components/date-picker/DatePicker.d.ts +14 -14
- package/components/date-picker/DatePicker.js +4 -2
- package/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/components/date-picker/DatePickerFooter.d.ts +1 -0
- package/components/date-picker/DatePickerFooter.js +10 -6
- package/components/date-picker/DatePickerInput.d.ts +1 -1
- package/components/dropdown/Dropdown.d.ts +11 -10
- package/components/form-label/FormLabel.d.ts +1 -1
- package/components/form-row/FormRow.d.ts +4 -4
- package/components/form-set/FormSet.d.ts +5 -5
- package/components/global-error/GlobalError.d.ts +1 -1
- package/components/global-status/GlobalStatus.d.ts +5 -5
- package/components/heading/Heading.d.ts +2 -2
- package/components/heading/HeadingProvider.d.ts +2 -2
- package/components/help-button/HelpButton.d.ts +1 -1
- package/components/help-button/HelpButtonInstance.d.ts +3 -2
- package/components/icon/Icon.d.ts +2 -2
- package/components/index.d.ts +8 -0
- package/components/index.js +5 -1
- package/components/info-card/InfoCard.js +140 -0
- package/components/info-card/InfoCard.tsx +249 -0
- package/components/info-card/index.d.ts +8 -0
- package/components/info-card/index.js +3 -0
- package/components/info-card/style/_info-card.scss +52 -0
- package/components/info-card/style/dnb-info-card.css +135 -0
- package/components/info-card/style/dnb-info-card.min.css +1 -0
- package/components/info-card/style/dnb-info-card.scss +12 -0
- package/components/info-card/style/index.d.ts +6 -0
- package/components/info-card/style/index.js +1 -0
- package/components/info-card/style.js +1 -0
- package/components/input/Input.d.ts +11 -10
- package/components/input-masked/InputMasked.d.ts +11 -11
- package/components/input-masked/InputMasked.js +6 -4
- package/components/input-masked/InputMaskedHooks.js +43 -46
- package/components/input-masked/InputMaskedUtils.js +9 -20
- package/components/lib.js +9 -1
- package/components/modal/Modal.js +146 -278
- package/components/modal/Modal.tsx +524 -0
- package/components/modal/ModalContent.js +162 -256
- package/components/modal/ModalContent.tsx +515 -0
- package/components/modal/ModalContext.tsx +10 -0
- package/components/modal/ModalRoot.js +145 -0
- package/components/modal/ModalRoot.tsx +131 -0
- package/components/modal/components/CloseButton.js +72 -0
- package/components/modal/components/CloseButton.tsx +56 -0
- package/components/modal/components/ModalHeader.js +70 -0
- package/components/modal/components/ModalHeader.tsx +79 -0
- package/components/modal/components/ModalHeaderBar.js +122 -0
- package/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
- package/components/modal/components/ModalInner.tsx +45 -0
- package/components/modal/helpers.js +64 -0
- package/components/modal/helpers.ts +63 -0
- package/components/modal/types.js +1 -0
- package/{cjs/components/modal/Modal.d.ts → components/modal/types.ts} +125 -179
- package/components/number-format/NumberFormat.d.ts +10 -10
- package/components/pagination/Pagination.d.ts +30 -30
- package/components/pagination/Pagination.js +7 -0
- package/components/pagination/PaginationProvider.d.ts +2 -2
- package/components/radio/Radio.d.ts +5 -5
- package/components/radio/RadioGroup.d.ts +4 -4
- package/components/section/Section.d.ts +3 -1
- package/components/skeleton/Skeleton.d.ts +2 -2
- package/components/slider/Slider.d.ts +5 -5
- package/components/step-indicator/StepIndicator.d.ts +6 -6
- package/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/components/step-indicator/StepIndicatorItem.d.ts +3 -3
- package/components/step-indicator/StepIndicatorItem.js +1 -0
- package/components/step-indicator/StepIndicatorSidebar.d.ts +4 -4
- package/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/components/switch/Switch.d.ts +6 -6
- package/components/tabs/Tabs.d.ts +8 -8
- package/components/tabs/TabsContentWrapper.d.ts +2 -2
- package/components/tabs/TabsCustomContent.d.ts +1 -1
- package/components/tag/Tag.js +122 -0
- package/components/tag/Tag.tsx +194 -0
- package/components/tag/TagContext.js +2 -0
- package/components/tag/TagContext.tsx +3 -0
- package/components/tag/TagGroup.js +60 -0
- package/components/tag/TagGroup.tsx +80 -0
- package/components/tag/index.d.ts +8 -0
- package/components/tag/index.js +3 -0
- package/components/tag/style/_tag.scss +90 -0
- package/components/tag/style/dnb-tag.css +925 -0
- package/components/tag/style/dnb-tag.min.css +1 -0
- package/components/tag/style/dnb-tag.scss +15 -0
- package/components/tag/style/index.d.ts +6 -0
- package/components/tag/style/index.js +1 -0
- package/components/tag/style/themes/_tag-mixins.scss +18 -0
- package/components/tag/style.js +1 -0
- package/components/textarea/Textarea.d.ts +4 -4
- package/components/timeline/Timeline.js +57 -0
- package/components/timeline/Timeline.tsx +91 -0
- package/components/timeline/TimelineItem.js +112 -0
- package/components/timeline/TimelineItem.tsx +193 -0
- package/components/timeline/index.d.ts +8 -0
- package/components/timeline/index.js +3 -0
- package/components/timeline/style/_timeline.scss +42 -0
- package/components/timeline/style/dnb-timeline.css +307 -0
- package/components/timeline/style/dnb-timeline.min.css +1 -0
- package/components/timeline/style/dnb-timeline.scss +12 -0
- package/components/timeline/style/index.d.ts +6 -0
- package/components/timeline/style/index.js +1 -0
- package/components/timeline/style/themes/dnb-timeline-theme-ui.css +185 -0
- package/components/timeline/style/themes/dnb-timeline-theme-ui.min.css +1 -0
- package/components/timeline/style/themes/dnb-timeline-theme-ui.scss +105 -0
- package/components/timeline/style/themes/ui.js +1 -0
- package/components/timeline/style.js +1 -0
- package/components/toggle-button/ToggleButton.d.ts +7 -7
- package/components/toggle-button/ToggleButtonGroup.d.ts +4 -4
- package/components/tooltip/Tooltip.d.ts +5 -5
- package/components/tooltip/TooltipContainer.d.ts +3 -3
- package/components/tooltip/TooltipPortal.d.ts +1 -1
- package/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/elements/Img.d.ts +1 -1
- package/es/components/Avatar.d.ts +14 -0
- package/es/components/Avatar.js +3 -0
- package/es/components/InfoCard.d.ts +14 -0
- package/es/components/InfoCard.js +3 -0
- package/es/components/Tag.d.ts +14 -0
- package/es/components/Tag.js +3 -0
- package/es/components/Timeline.d.ts +14 -0
- package/es/components/Timeline.js +3 -0
- package/es/components/accordion/Accordion.d.ts +7 -7
- package/es/components/autocomplete/Autocomplete.d.ts +13 -13
- package/es/components/avatar/Avatar.js +83 -0
- package/es/components/avatar/Avatar.tsx +163 -0
- package/es/components/avatar/AvatarGroup.js +89 -0
- package/es/components/avatar/AvatarGroup.tsx +167 -0
- package/es/components/avatar/index.d.ts +8 -0
- package/es/components/avatar/index.js +3 -0
- package/es/components/avatar/style/_avatar.scss +145 -0
- package/es/components/avatar/style/dnb-avatar.css +218 -0
- package/es/components/avatar/style/dnb-avatar.min.css +1 -0
- package/es/components/avatar/style/dnb-avatar.scss +12 -0
- package/es/components/avatar/style/index.d.ts +6 -0
- package/es/components/avatar/style/index.js +1 -0
- package/es/components/avatar/style/themes/dnb-avatar-theme-ui.css +36 -0
- package/es/components/avatar/style/themes/dnb-avatar-theme-ui.min.css +1 -0
- package/es/components/avatar/style/themes/dnb-avatar-theme-ui.scss +29 -0
- package/es/components/avatar/style/themes/ui.js +1 -0
- package/es/components/avatar/style.js +1 -0
- package/es/components/breadcrumb/BreadcrumbItem.js +3 -3
- package/es/components/breadcrumb/BreadcrumbItem.tsx +2 -2
- package/es/components/button/Button.d.ts +8 -8
- package/es/components/button/Button.js +7 -5
- package/es/components/button/style/themes/dnb-button-theme-ui.scss +3 -0
- package/es/components/checkbox/Checkbox.d.ts +3 -3
- package/es/components/date-picker/DatePicker.d.ts +14 -14
- package/es/components/date-picker/DatePicker.js +4 -2
- package/es/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/es/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/es/components/date-picker/DatePickerFooter.d.ts +1 -0
- package/es/components/date-picker/DatePickerFooter.js +9 -6
- package/es/components/date-picker/DatePickerInput.d.ts +1 -1
- package/es/components/dropdown/Dropdown.d.ts +11 -10
- package/es/components/form-label/FormLabel.d.ts +1 -1
- package/es/components/form-row/FormRow.d.ts +4 -4
- package/es/components/form-set/FormSet.d.ts +5 -5
- package/es/components/global-error/GlobalError.d.ts +1 -1
- package/es/components/global-status/GlobalStatus.d.ts +5 -5
- package/es/components/heading/Heading.d.ts +2 -2
- package/es/components/heading/HeadingProvider.d.ts +2 -2
- package/es/components/help-button/HelpButton.d.ts +1 -1
- package/es/components/help-button/HelpButtonInstance.d.ts +3 -2
- package/es/components/icon/Icon.d.ts +2 -2
- package/es/components/icon-primary/IconPrimary.d.ts +2 -2
- package/es/components/index.d.ts +8 -0
- package/es/components/index.js +5 -1
- package/es/components/info-card/InfoCard.js +135 -0
- package/es/components/info-card/InfoCard.tsx +249 -0
- package/es/components/info-card/index.d.ts +8 -0
- package/es/components/info-card/index.js +3 -0
- package/es/components/info-card/style/_info-card.scss +52 -0
- package/es/components/info-card/style/dnb-info-card.css +135 -0
- package/es/components/info-card/style/dnb-info-card.min.css +1 -0
- package/es/components/info-card/style/dnb-info-card.scss +12 -0
- package/es/components/info-card/style/index.d.ts +6 -0
- package/es/components/info-card/style/index.js +1 -0
- package/es/components/info-card/style.js +1 -0
- package/es/components/input/Input.d.ts +11 -10
- package/es/components/input-masked/InputMasked.d.ts +11 -11
- package/es/components/input-masked/InputMasked.js +6 -4
- package/es/components/input-masked/InputMaskedHooks.js +28 -31
- package/es/components/input-masked/InputMaskedUtils.js +7 -18
- package/es/components/lib.js +9 -1
- package/es/components/modal/Modal.js +127 -251
- package/es/components/modal/Modal.tsx +524 -0
- package/es/components/modal/ModalContent.js +120 -213
- package/es/components/modal/ModalContent.tsx +515 -0
- package/es/components/modal/ModalContext.tsx +10 -0
- package/es/components/modal/ModalRoot.js +108 -0
- package/es/components/modal/ModalRoot.tsx +131 -0
- package/es/components/modal/components/CloseButton.js +41 -0
- package/es/components/modal/components/CloseButton.tsx +56 -0
- package/es/components/modal/components/ModalHeader.js +40 -0
- package/es/components/modal/components/ModalHeader.tsx +79 -0
- package/es/components/modal/components/ModalHeaderBar.js +88 -0
- package/es/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/es/components/modal/{ModalInner.js → components/ModalInner.js} +8 -18
- package/es/components/modal/components/ModalInner.tsx +45 -0
- package/es/components/modal/helpers.js +60 -0
- package/es/components/modal/helpers.ts +63 -0
- package/es/components/modal/types.js +1 -0
- package/es/components/modal/{Modal.d.ts → types.ts} +125 -179
- package/es/components/number-format/NumberFormat.d.ts +10 -10
- package/es/components/pagination/Pagination.d.ts +30 -30
- package/es/components/pagination/Pagination.js +3 -0
- package/es/components/pagination/PaginationProvider.d.ts +2 -2
- package/es/components/radio/Radio.d.ts +5 -5
- package/es/components/radio/RadioGroup.d.ts +4 -4
- package/es/components/section/Section.d.ts +3 -2
- package/es/components/skeleton/Skeleton.d.ts +2 -2
- package/es/components/slider/Slider.d.ts +5 -5
- package/es/components/step-indicator/StepIndicator.d.ts +6 -6
- package/es/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/es/components/step-indicator/StepIndicatorItem.d.ts +3 -3
- package/es/components/step-indicator/StepIndicatorItem.js +1 -0
- package/es/components/step-indicator/StepIndicatorSidebar.d.ts +4 -4
- package/es/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/es/components/switch/Switch.d.ts +6 -6
- package/es/components/tabs/Tabs.d.ts +8 -8
- package/es/components/tabs/TabsContentWrapper.d.ts +2 -2
- package/es/components/tabs/TabsCustomContent.d.ts +1 -1
- package/es/components/tag/Tag.js +115 -0
- package/es/components/tag/Tag.tsx +194 -0
- package/es/components/tag/TagContext.js +2 -0
- package/es/components/tag/TagContext.tsx +3 -0
- package/es/components/tag/TagGroup.js +53 -0
- package/es/components/tag/TagGroup.tsx +80 -0
- package/es/components/tag/index.d.ts +8 -0
- package/es/components/tag/index.js +3 -0
- package/es/components/tag/style/_tag.scss +90 -0
- package/es/components/tag/style/dnb-tag.css +925 -0
- package/es/components/tag/style/dnb-tag.min.css +1 -0
- package/es/components/tag/style/dnb-tag.scss +15 -0
- package/es/components/tag/style/index.d.ts +6 -0
- package/es/components/tag/style/index.js +1 -0
- package/es/components/tag/style/themes/_tag-mixins.scss +18 -0
- package/es/components/tag/style.js +1 -0
- package/es/components/textarea/Textarea.d.ts +4 -4
- package/es/components/timeline/Timeline.js +48 -0
- package/es/components/timeline/Timeline.tsx +91 -0
- package/es/components/timeline/TimelineItem.js +111 -0
- package/es/components/timeline/TimelineItem.tsx +193 -0
- package/es/components/timeline/index.d.ts +8 -0
- package/es/components/timeline/index.js +3 -0
- package/es/components/timeline/style/_timeline.scss +42 -0
- package/es/components/timeline/style/dnb-timeline.css +307 -0
- package/es/components/timeline/style/dnb-timeline.min.css +1 -0
- package/es/components/timeline/style/dnb-timeline.scss +12 -0
- package/es/components/timeline/style/index.d.ts +6 -0
- package/es/components/timeline/style/index.js +1 -0
- package/es/components/timeline/style/themes/dnb-timeline-theme-ui.css +185 -0
- package/es/components/timeline/style/themes/dnb-timeline-theme-ui.min.css +1 -0
- package/es/components/timeline/style/themes/dnb-timeline-theme-ui.scss +105 -0
- package/es/components/timeline/style/themes/ui.js +1 -0
- package/es/components/timeline/style.js +1 -0
- package/es/components/toggle-button/ToggleButton.d.ts +7 -7
- package/es/components/toggle-button/ToggleButtonGroup.d.ts +4 -4
- package/es/components/tooltip/Tooltip.d.ts +5 -5
- package/es/components/tooltip/TooltipContainer.d.ts +3 -3
- package/es/components/tooltip/TooltipPortal.d.ts +1 -1
- package/es/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/es/elements/Img.d.ts +2 -2
- package/es/extensions/payment-card/PaymentCard.d.ts +1 -1
- package/es/extensions/payment-card/style/_payment-card.scss +0 -1
- package/es/extensions/payment-card/style/dnb-payment-card.css +0 -1
- package/es/extensions/payment-card/style/dnb-payment-card.min.css +1 -1
- package/es/fragments/drawer-list/DrawerListProvider.js +1 -0
- package/es/fragments/scroll-view/ScrollView.js +7 -15
- package/es/fragments/scroll-view/ScrollView.tsx +92 -0
- package/es/index.d.ts +8 -0
- package/es/index.js +5 -1
- package/es/shared/Context.js +11 -4
- package/es/shared/locales/en-GB.js +5 -0
- package/es/shared/locales/nb-NO.js +5 -0
- package/es/style/core/helper-classes/skip-link.scss +1 -1
- package/es/style/dnb-ui-components.css +716 -0
- package/es/style/dnb-ui-components.min.css +3 -3
- package/es/style/dnb-ui-components.scss +4 -0
- package/es/style/dnb-ui-elements.css +3 -0
- package/es/style/dnb-ui-elements.min.css +1 -1
- package/es/style/dnb-ui-extensions.css +0 -1
- package/es/style/dnb-ui-extensions.min.css +1 -1
- package/es/style/dnb-ui-tags.css +6 -0
- package/es/style/dnb-ui-tags.min.css +2 -2
- package/es/style/elements/code.scss +3 -0
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.css +226 -0
- package/es/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +3 -3
- package/es/style/themes/theme-ui/dnb-theme-ui.css +226 -0
- package/es/style/themes/theme-ui/dnb-theme-ui.min.css +3 -3
- package/es/style/themes/theme-ui/dnb-theme-ui.scss +2 -0
- package/esm/components/Avatar.d.ts +14 -0
- package/esm/components/Avatar.js +3 -0
- package/esm/components/InfoCard.d.ts +14 -0
- package/esm/components/InfoCard.js +3 -0
- package/esm/components/Tag.d.ts +14 -0
- package/esm/components/Tag.js +3 -0
- package/esm/components/Timeline.d.ts +14 -0
- package/esm/components/Timeline.js +3 -0
- package/esm/components/accordion/Accordion.d.ts +7 -7
- package/esm/components/autocomplete/Autocomplete.d.ts +13 -13
- package/esm/components/avatar/Avatar.js +89 -0
- package/esm/components/avatar/Avatar.tsx +163 -0
- package/esm/components/avatar/AvatarGroup.js +94 -0
- package/esm/components/avatar/AvatarGroup.tsx +167 -0
- package/esm/components/avatar/index.d.ts +8 -0
- package/esm/components/avatar/index.js +3 -0
- package/esm/components/avatar/style/_avatar.scss +145 -0
- package/esm/components/avatar/style/dnb-avatar.css +218 -0
- package/esm/components/avatar/style/dnb-avatar.min.css +1 -0
- package/esm/components/avatar/style/dnb-avatar.scss +12 -0
- package/esm/components/avatar/style/index.d.ts +6 -0
- package/esm/components/avatar/style/index.js +1 -0
- package/esm/components/avatar/style/themes/dnb-avatar-theme-ui.css +36 -0
- package/esm/components/avatar/style/themes/dnb-avatar-theme-ui.min.css +1 -0
- package/esm/components/avatar/style/themes/dnb-avatar-theme-ui.scss +29 -0
- package/esm/components/avatar/style/themes/ui.js +1 -0
- package/esm/components/avatar/style.js +1 -0
- package/esm/components/breadcrumb/BreadcrumbItem.js +3 -3
- package/esm/components/breadcrumb/BreadcrumbItem.tsx +2 -2
- package/esm/components/button/Button.d.ts +7 -7
- package/esm/components/button/Button.js +7 -5
- package/esm/components/button/style/themes/dnb-button-theme-ui.scss +3 -0
- package/esm/components/checkbox/Checkbox.d.ts +3 -3
- package/esm/components/date-picker/DatePicker.d.ts +14 -14
- package/esm/components/date-picker/DatePicker.js +4 -2
- package/esm/components/date-picker/DatePickerAddon.d.ts +1 -1
- package/esm/components/date-picker/DatePickerCalendar.d.ts +1 -1
- package/esm/components/date-picker/DatePickerFooter.d.ts +1 -0
- package/esm/components/date-picker/DatePickerFooter.js +10 -6
- package/esm/components/date-picker/DatePickerInput.d.ts +1 -1
- package/esm/components/dropdown/Dropdown.d.ts +11 -10
- package/esm/components/form-label/FormLabel.d.ts +1 -1
- package/esm/components/form-row/FormRow.d.ts +4 -4
- package/esm/components/form-set/FormSet.d.ts +5 -5
- package/esm/components/global-error/GlobalError.d.ts +1 -1
- package/esm/components/global-status/GlobalStatus.d.ts +5 -5
- package/esm/components/heading/Heading.d.ts +2 -2
- package/esm/components/heading/HeadingProvider.d.ts +2 -2
- package/esm/components/help-button/HelpButton.d.ts +1 -1
- package/esm/components/help-button/HelpButtonInstance.d.ts +3 -2
- package/esm/components/icon/Icon.d.ts +2 -2
- package/esm/components/index.d.ts +8 -0
- package/esm/components/index.js +5 -1
- package/esm/components/info-card/InfoCard.js +140 -0
- package/esm/components/info-card/InfoCard.tsx +249 -0
- package/esm/components/info-card/index.d.ts +8 -0
- package/esm/components/info-card/index.js +3 -0
- package/esm/components/info-card/style/_info-card.scss +52 -0
- package/esm/components/info-card/style/dnb-info-card.css +135 -0
- package/esm/components/info-card/style/dnb-info-card.min.css +1 -0
- package/esm/components/info-card/style/dnb-info-card.scss +12 -0
- package/esm/components/info-card/style/index.d.ts +6 -0
- package/esm/components/info-card/style/index.js +1 -0
- package/esm/components/info-card/style.js +1 -0
- package/esm/components/input/Input.d.ts +11 -10
- package/esm/components/input-masked/InputMasked.d.ts +11 -11
- package/esm/components/input-masked/InputMasked.js +6 -4
- package/esm/components/input-masked/InputMaskedHooks.js +43 -46
- package/esm/components/input-masked/InputMaskedUtils.js +9 -20
- package/esm/components/lib.js +9 -1
- package/esm/components/modal/Modal.js +146 -278
- package/esm/components/modal/Modal.tsx +524 -0
- package/esm/components/modal/ModalContent.js +162 -256
- package/esm/components/modal/ModalContent.tsx +515 -0
- package/esm/components/modal/ModalContext.tsx +10 -0
- package/esm/components/modal/ModalRoot.js +145 -0
- package/esm/components/modal/ModalRoot.tsx +131 -0
- package/esm/components/modal/components/CloseButton.js +72 -0
- package/esm/components/modal/components/CloseButton.tsx +56 -0
- package/esm/components/modal/components/ModalHeader.js +70 -0
- package/esm/components/modal/components/ModalHeader.tsx +79 -0
- package/esm/components/modal/components/ModalHeaderBar.js +122 -0
- package/esm/components/modal/components/ModalHeaderBar.tsx +118 -0
- package/esm/components/modal/{ModalInner.js → components/ModalInner.js} +11 -17
- package/esm/components/modal/components/ModalInner.tsx +45 -0
- package/esm/components/modal/helpers.js +64 -0
- package/esm/components/modal/helpers.ts +63 -0
- package/esm/components/modal/types.js +1 -0
- package/esm/components/modal/{Modal.d.ts → types.ts} +125 -179
- package/esm/components/number-format/NumberFormat.d.ts +10 -10
- package/esm/components/pagination/Pagination.d.ts +30 -30
- package/esm/components/pagination/Pagination.js +7 -0
- package/esm/components/pagination/PaginationProvider.d.ts +2 -2
- package/esm/components/radio/Radio.d.ts +5 -5
- package/esm/components/radio/RadioGroup.d.ts +4 -4
- package/esm/components/section/Section.d.ts +3 -1
- package/esm/components/skeleton/Skeleton.d.ts +2 -2
- package/esm/components/slider/Slider.d.ts +5 -5
- package/esm/components/step-indicator/StepIndicator.d.ts +6 -6
- package/esm/components/step-indicator/StepIndicatorContext.d.ts +1 -1
- package/esm/components/step-indicator/StepIndicatorItem.d.ts +3 -3
- package/esm/components/step-indicator/StepIndicatorItem.js +1 -0
- package/esm/components/step-indicator/StepIndicatorSidebar.d.ts +4 -4
- package/esm/components/step-indicator/StepIndicatorTriggerButton.d.ts +1 -1
- package/esm/components/switch/Switch.d.ts +6 -6
- package/esm/components/tabs/Tabs.d.ts +8 -8
- package/esm/components/tabs/TabsContentWrapper.d.ts +2 -2
- package/esm/components/tabs/TabsCustomContent.d.ts +1 -1
- package/esm/components/tag/Tag.js +122 -0
- package/esm/components/tag/Tag.tsx +194 -0
- package/esm/components/tag/TagContext.js +2 -0
- package/esm/components/tag/TagContext.tsx +3 -0
- package/esm/components/tag/TagGroup.js +60 -0
- package/esm/components/tag/TagGroup.tsx +80 -0
- package/esm/components/tag/index.d.ts +8 -0
- package/esm/components/tag/index.js +3 -0
- package/esm/components/tag/style/_tag.scss +90 -0
- package/esm/components/tag/style/dnb-tag.css +925 -0
- package/esm/components/tag/style/dnb-tag.min.css +1 -0
- package/esm/components/tag/style/dnb-tag.scss +15 -0
- package/esm/components/tag/style/index.d.ts +6 -0
- package/esm/components/tag/style/index.js +1 -0
- package/esm/components/tag/style/themes/_tag-mixins.scss +18 -0
- package/esm/components/tag/style.js +1 -0
- package/esm/components/textarea/Textarea.d.ts +4 -4
- package/esm/components/timeline/Timeline.js +57 -0
- package/esm/components/timeline/Timeline.tsx +91 -0
- package/esm/components/timeline/TimelineItem.js +112 -0
- package/esm/components/timeline/TimelineItem.tsx +193 -0
- package/esm/components/timeline/index.d.ts +8 -0
- package/esm/components/timeline/index.js +3 -0
- package/esm/components/timeline/style/_timeline.scss +42 -0
- package/esm/components/timeline/style/dnb-timeline.css +307 -0
- package/esm/components/timeline/style/dnb-timeline.min.css +1 -0
- package/esm/components/timeline/style/dnb-timeline.scss +12 -0
- package/esm/components/timeline/style/index.d.ts +6 -0
- package/esm/components/timeline/style/index.js +1 -0
- package/esm/components/timeline/style/themes/dnb-timeline-theme-ui.css +185 -0
- package/esm/components/timeline/style/themes/dnb-timeline-theme-ui.min.css +1 -0
- package/esm/components/timeline/style/themes/dnb-timeline-theme-ui.scss +105 -0
- package/esm/components/timeline/style/themes/ui.js +1 -0
- package/esm/components/timeline/style.js +1 -0
- package/esm/components/toggle-button/ToggleButton.d.ts +7 -7
- package/esm/components/toggle-button/ToggleButtonGroup.d.ts +4 -4
- package/esm/components/tooltip/Tooltip.d.ts +5 -5
- package/esm/components/tooltip/TooltipContainer.d.ts +3 -3
- package/esm/components/tooltip/TooltipPortal.d.ts +1 -1
- package/esm/components/tooltip/TooltipWithEvents.d.ts +1 -1
- package/esm/dnb-ui-components.min.mjs +4 -4
- package/esm/dnb-ui-elements.min.mjs +1 -1
- package/esm/dnb-ui-extensions.min.mjs +3 -3
- package/esm/dnb-ui-lib.min.mjs +4 -4
- package/esm/dnb-ui-web-components.min.mjs +4 -4
- package/esm/elements/Img.d.ts +1 -1
- package/esm/extensions/payment-card/PaymentCard.d.ts +1 -1
- package/esm/extensions/payment-card/style/_payment-card.scss +0 -1
- package/esm/extensions/payment-card/style/dnb-payment-card.css +0 -1
- package/esm/extensions/payment-card/style/dnb-payment-card.min.css +1 -1
- package/esm/fragments/drawer-list/DrawerListProvider.js +1 -0
- package/esm/fragments/scroll-view/ScrollView.js +10 -16
- package/esm/fragments/scroll-view/ScrollView.tsx +92 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +5 -1
- package/esm/shared/Context.js +11 -4
- package/esm/shared/locales/en-GB.js +5 -0
- package/esm/shared/locales/nb-NO.js +5 -0
- package/esm/style/core/helper-classes/skip-link.scss +1 -1
- package/esm/style/dnb-ui-components.css +716 -0
- package/esm/style/dnb-ui-components.min.css +3 -3
- package/esm/style/dnb-ui-components.scss +4 -0
- package/esm/style/dnb-ui-elements.css +3 -0
- package/esm/style/dnb-ui-elements.min.css +1 -1
- package/esm/style/dnb-ui-extensions.css +0 -1
- package/esm/style/dnb-ui-extensions.min.css +1 -1
- package/esm/style/dnb-ui-tags.css +6 -0
- package/esm/style/dnb-ui-tags.min.css +2 -2
- package/esm/style/elements/code.scss +3 -0
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.css +226 -0
- package/esm/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +3 -3
- package/esm/style/themes/theme-ui/dnb-theme-ui.css +226 -0
- package/esm/style/themes/theme-ui/dnb-theme-ui.min.css +3 -3
- package/esm/style/themes/theme-ui/dnb-theme-ui.scss +2 -0
- package/extensions/payment-card/PaymentCard.d.ts +1 -1
- package/extensions/payment-card/style/_payment-card.scss +0 -1
- package/extensions/payment-card/style/dnb-payment-card.css +0 -1
- package/extensions/payment-card/style/dnb-payment-card.min.css +1 -1
- package/fragments/drawer-list/DrawerListProvider.js +1 -0
- package/fragments/scroll-view/ScrollView.js +10 -16
- package/fragments/scroll-view/ScrollView.tsx +92 -0
- package/index.d.ts +8 -0
- package/index.js +5 -1
- package/package.json +2 -3
- package/shared/Context.js +11 -4
- package/shared/locales/en-GB.js +5 -0
- package/shared/locales/nb-NO.js +5 -0
- package/style/core/helper-classes/skip-link.scss +1 -1
- package/style/dnb-ui-components.css +716 -0
- package/style/dnb-ui-components.min.css +3 -3
- package/style/dnb-ui-components.scss +4 -0
- package/style/dnb-ui-elements.css +3 -0
- package/style/dnb-ui-elements.min.css +1 -1
- package/style/dnb-ui-extensions.css +0 -1
- package/style/dnb-ui-extensions.min.css +1 -1
- package/style/dnb-ui-tags.css +6 -0
- package/style/dnb-ui-tags.min.css +2 -2
- package/style/elements/code.scss +3 -0
- package/style/themes/theme-open-banking/dnb-theme-open-banking.css +226 -0
- package/style/themes/theme-open-banking/dnb-theme-open-banking.min.css +3 -3
- package/style/themes/theme-ui/dnb-theme-ui.css +226 -0
- package/style/themes/theme-ui/dnb-theme-ui.min.css +3 -3
- package/style/themes/theme-ui/dnb-theme-ui.scss +2 -0
- package/umd/dnb-ui-components.min.js +5 -5
- package/umd/dnb-ui-elements.min.js +3 -3
- package/umd/dnb-ui-extensions.min.js +3 -3
- package/umd/dnb-ui-lib.min.js +5 -5
- package/umd/dnb-ui-web-components.min.js +5 -5
- package/cjs/components/modal/ModalContent.d.ts +0 -168
- package/cjs/components/modal/ModalHeader.d.ts +0 -73
- package/cjs/components/modal/ModalInner.d.ts +0 -20
- package/cjs/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/components/modal/Modal.d.ts +0 -325
- package/components/modal/ModalContent.d.ts +0 -168
- package/components/modal/ModalHeader.d.ts +0 -73
- package/components/modal/ModalHeader.js +0 -224
- package/components/modal/ModalInner.d.ts +0 -20
- package/es/components/modal/ModalContent.d.ts +0 -168
- package/es/components/modal/ModalHeader.d.ts +0 -73
- package/es/components/modal/ModalHeader.js +0 -166
- package/es/components/modal/ModalInner.d.ts +0 -20
- package/es/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/esm/components/modal/ModalContent.d.ts +0 -168
- package/esm/components/modal/ModalHeader.d.ts +0 -73
- package/esm/components/modal/ModalHeader.js +0 -224
- package/esm/components/modal/ModalInner.d.ts +0 -20
- package/esm/fragments/scroll-view/ScrollView.d.ts +0 -1
- package/fragments/scroll-view/ScrollView.d.ts +0 -1
|
@@ -13,7 +13,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConst
|
|
|
13
13
|
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
|
|
14
14
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
15
15
|
var _excluded = ["triggeredBy"],
|
|
16
|
-
_excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "
|
|
16
|
+
_excluded2 = ["mode", "hide", "title", "labelled_by", "header_content", "modal_content", "bar_content", "id", "close_title", "dialog_title", "hide_close_button", "close_button_attributes", "spacing", "prevent_core_style", "animation_duration", "no_animation", "no_animation_on_mobile", "min_width", "max_width", "fullscreen", "align_content", "container_placement", "closeModal", "className", "class", "content_class", "overlay_class", "content_id", "children"];
|
|
17
17
|
|
|
18
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
19
|
|
|
@@ -22,7 +22,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
22
22
|
import "core-js/modules/es.array.filter.js";
|
|
23
23
|
import "core-js/modules/es.object.to-string.js";
|
|
24
24
|
import "core-js/modules/web.dom-collections.for-each.js";
|
|
25
|
-
import "core-js/modules/es.regexp.exec.js";
|
|
26
25
|
import "core-js/modules/es.parse-float.js";
|
|
27
26
|
|
|
28
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -30,15 +29,16 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
30
29
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
31
30
|
|
|
32
31
|
import React from 'react';
|
|
33
|
-
import PropTypes from 'prop-types';
|
|
34
32
|
import classnames from 'classnames';
|
|
35
33
|
import keycode from 'keycode';
|
|
36
34
|
import { disableBodyScroll, enableBodyScroll, clearAllBodyScrollLocks } from './bodyScrollLock';
|
|
37
35
|
import { warn, isTrue, makeUniqueId, InteractionInvalidation, findElementInChildren, combineLabelledBy, combineDescribedBy, validateDOMAttributes, dispatchCustomElementEvent } from '../../shared/component-helper';
|
|
38
36
|
import ScrollView from '../../fragments/scroll-view/ScrollView';
|
|
39
37
|
import ModalContext from './ModalContext';
|
|
40
|
-
import ModalHeader
|
|
41
|
-
import
|
|
38
|
+
import ModalHeader from './components/ModalHeader';
|
|
39
|
+
import ModalHeaderBar from './components/ModalHeaderBar';
|
|
40
|
+
import { IS_IOS, IS_SAFARI, IS_MAC, isAndroid } from '../../shared/helpers';
|
|
41
|
+
import { getListOfModalRoots, getModalRoot, addToIndex, removeFromIndex } from './helpers';
|
|
42
42
|
|
|
43
43
|
var ModalContent = function (_React$PureComponent) {
|
|
44
44
|
_inherits(ModalContent, _React$PureComponent);
|
|
@@ -54,10 +54,53 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
54
54
|
|
|
55
55
|
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
56
56
|
triggeredBy: null,
|
|
57
|
-
triggeredByEvent: null
|
|
57
|
+
triggeredByEvent: null,
|
|
58
|
+
color: null
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "_contentRef", void 0);
|
|
62
|
+
|
|
63
|
+
_defineProperty(_assertThisInitialized(_this), "_id", void 0);
|
|
64
|
+
|
|
65
|
+
_defineProperty(_assertThisInitialized(_this), "_lockTimeout", void 0);
|
|
66
|
+
|
|
67
|
+
_defineProperty(_assertThisInitialized(_this), "_focusTimeout", void 0);
|
|
68
|
+
|
|
69
|
+
_defineProperty(_assertThisInitialized(_this), "_androidFocusTimeout", void 0);
|
|
70
|
+
|
|
71
|
+
_defineProperty(_assertThisInitialized(_this), "_ii", void 0);
|
|
72
|
+
|
|
73
|
+
_defineProperty(_assertThisInitialized(_this), "_iiLocal", void 0);
|
|
74
|
+
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "lockBody", function () {
|
|
76
|
+
var modalRoots = getListOfModalRoots();
|
|
77
|
+
var firstLevel = modalRoots[0];
|
|
78
|
+
|
|
79
|
+
if (firstLevel === _assertThisInitialized(_this)) {
|
|
80
|
+
_this._ii = new InteractionInvalidation();
|
|
81
|
+
|
|
82
|
+
_this._ii.setBypassSelector(['.dnb-modal__content *', "#dnb-modal-".concat(_this.props.root_id || 'root', " *")].filter(Boolean));
|
|
83
|
+
|
|
84
|
+
_this._ii.activate();
|
|
85
|
+
} else {
|
|
86
|
+
modalRoots.forEach(function (modal) {
|
|
87
|
+
if (modal !== _assertThisInitialized(_this) && typeof modal._iiLocal === 'undefined' && typeof modal._contentRef !== 'undefined') {
|
|
88
|
+
modal._iiLocal = new InteractionInvalidation();
|
|
89
|
+
|
|
90
|
+
modal._iiLocal.activate(modal._contentRef.current);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (typeof document !== 'undefined') {
|
|
96
|
+
document.addEventListener('keydown', _this.onKeyDownHandler);
|
|
97
|
+
}
|
|
58
98
|
});
|
|
59
99
|
|
|
60
100
|
_defineProperty(_assertThisInitialized(_this), "_androidFocusHelper", function () {
|
|
101
|
+
var _this$props$animation = _this.props.animation_duration,
|
|
102
|
+
animation_duration = _this$props$animation === void 0 ? null : _this$props$animation;
|
|
103
|
+
var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
61
104
|
clearTimeout(_this._androidFocusTimeout);
|
|
62
105
|
_this._androidFocusTimeout = setTimeout(function () {
|
|
63
106
|
try {
|
|
@@ -67,38 +110,38 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
67
110
|
document.activeElement.scrollIntoView();
|
|
68
111
|
}
|
|
69
112
|
} catch (e) {}
|
|
70
|
-
},
|
|
113
|
+
}, timeoutDuration / 2);
|
|
71
114
|
});
|
|
72
115
|
|
|
73
|
-
_defineProperty(_assertThisInitialized(_this), "preventClick", function (
|
|
74
|
-
if (
|
|
75
|
-
|
|
116
|
+
_defineProperty(_assertThisInitialized(_this), "preventClick", function (event) {
|
|
117
|
+
if (event) {
|
|
118
|
+
event.stopPropagation();
|
|
76
119
|
}
|
|
77
120
|
});
|
|
78
121
|
|
|
79
|
-
_defineProperty(_assertThisInitialized(_this), "onCloseClickHandler", function (
|
|
80
|
-
_this.
|
|
122
|
+
_defineProperty(_assertThisInitialized(_this), "onCloseClickHandler", function (event) {
|
|
123
|
+
_this.closeModalContent(event, {
|
|
81
124
|
triggeredBy: 'button'
|
|
82
125
|
});
|
|
83
126
|
});
|
|
84
127
|
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "onContentClickHandler", function (
|
|
86
|
-
_this.
|
|
128
|
+
_defineProperty(_assertThisInitialized(_this), "onContentClickHandler", function (event) {
|
|
129
|
+
_this.closeModalContent(event, {
|
|
87
130
|
triggeredBy: 'overlay',
|
|
88
131
|
ifIsLatest: false
|
|
89
132
|
});
|
|
90
133
|
});
|
|
91
134
|
|
|
92
|
-
_defineProperty(_assertThisInitialized(_this), "onKeyDownHandler", function (
|
|
93
|
-
switch (keycode(
|
|
135
|
+
_defineProperty(_assertThisInitialized(_this), "onKeyDownHandler", function (event) {
|
|
136
|
+
switch (keycode(event)) {
|
|
94
137
|
case 'esc':
|
|
95
138
|
{
|
|
96
|
-
var mostCurrent =
|
|
139
|
+
var mostCurrent = getModalRoot(-1);
|
|
97
140
|
|
|
98
141
|
if (mostCurrent === _assertThisInitialized(_this)) {
|
|
99
|
-
|
|
142
|
+
event.preventDefault();
|
|
100
143
|
|
|
101
|
-
_this.
|
|
144
|
+
_this.closeModalContent(event, {
|
|
102
145
|
triggeredBy: 'keyboard'
|
|
103
146
|
});
|
|
104
147
|
}
|
|
@@ -109,6 +152,8 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
109
152
|
});
|
|
110
153
|
|
|
111
154
|
_defineProperty(_assertThisInitialized(_this), "setBackgroundColor", function (color) {
|
|
155
|
+
document.documentElement.style.setProperty('--modal-background-color', color);
|
|
156
|
+
|
|
112
157
|
_this.setState({
|
|
113
158
|
color: color
|
|
114
159
|
});
|
|
@@ -122,23 +167,26 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
122
167
|
_createClass(ModalContent, [{
|
|
123
168
|
key: "componentDidMount",
|
|
124
169
|
value: function componentDidMount() {
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
|
|
170
|
+
var _this$props = this.props,
|
|
171
|
+
_this$props$id = _this$props.id,
|
|
172
|
+
id = _this$props$id === void 0 ? null : _this$props$id,
|
|
173
|
+
_this$props$no_animat = _this$props.no_animation,
|
|
174
|
+
no_animation = _this$props$no_animat === void 0 ? false : _this$props$no_animat,
|
|
175
|
+
_this$props$animation2 = _this$props.animation_duration,
|
|
176
|
+
animation_duration = _this$props$animation2 === void 0 ? null : _this$props$animation2;
|
|
177
|
+
var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
178
|
+
addToIndex(this);
|
|
128
179
|
this.removeScrollPossibility();
|
|
129
180
|
this.setFocus();
|
|
130
181
|
this.setAndroidFocusHelper();
|
|
131
|
-
var id = this.props.id;
|
|
132
182
|
dispatchCustomElementEvent(this, 'on_open', {
|
|
133
183
|
id: id
|
|
134
184
|
});
|
|
135
185
|
|
|
136
|
-
if (isTrue(
|
|
186
|
+
if (isTrue(no_animation) || process.env.NODE_ENV === 'test') {
|
|
137
187
|
this.lockBody();
|
|
138
188
|
} else {
|
|
139
|
-
this._lockTimeout = setTimeout(
|
|
140
|
-
_this2.lockBody();
|
|
141
|
-
}, 500);
|
|
189
|
+
this._lockTimeout = setTimeout(this.lockBody, timeoutDuration * 1.2);
|
|
142
190
|
}
|
|
143
191
|
}
|
|
144
192
|
}, {
|
|
@@ -148,40 +196,12 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
148
196
|
clearTimeout(this._lockTimeout);
|
|
149
197
|
this.removeLocks();
|
|
150
198
|
}
|
|
151
|
-
}, {
|
|
152
|
-
key: "lockBody",
|
|
153
|
-
value: function lockBody() {
|
|
154
|
-
var _this3 = this;
|
|
155
|
-
|
|
156
|
-
var modalRoots = getListOfModalRoots();
|
|
157
|
-
var firstLevel = modalRoots[0];
|
|
158
|
-
|
|
159
|
-
if (firstLevel === this) {
|
|
160
|
-
this._ii = new InteractionInvalidation();
|
|
161
|
-
|
|
162
|
-
this._ii.setBypassSelector(['.dnb-modal__content *', "#dnb-modal-".concat(this.props.root_id || 'root', " *")].filter(Boolean));
|
|
163
|
-
|
|
164
|
-
this._ii.activate();
|
|
165
|
-
} else {
|
|
166
|
-
modalRoots.forEach(function (modal) {
|
|
167
|
-
if (modal !== _this3 && typeof modal._iiLocal === 'undefined' && typeof modal._contentRef !== 'undefined') {
|
|
168
|
-
modal._iiLocal = new InteractionInvalidation();
|
|
169
|
-
|
|
170
|
-
modal._iiLocal.activate(modal._contentRef.current);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
if (typeof document !== 'undefined') {
|
|
176
|
-
document.addEventListener('keydown', this.onKeyDownHandler);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
199
|
}, {
|
|
180
200
|
key: "removeLocks",
|
|
181
201
|
value: function removeLocks() {
|
|
182
202
|
var modalRoots = getListOfModalRoots();
|
|
183
203
|
var firstLevel = modalRoots[0];
|
|
184
|
-
|
|
204
|
+
removeFromIndex(this);
|
|
185
205
|
|
|
186
206
|
if (firstLevel === this) {
|
|
187
207
|
var _this$_ii;
|
|
@@ -220,7 +240,7 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
220
240
|
}, {
|
|
221
241
|
key: "setAndroidFocusHelper",
|
|
222
242
|
value: function setAndroidFocusHelper() {
|
|
223
|
-
if (typeof window !== 'undefined' &&
|
|
243
|
+
if (typeof window !== 'undefined' && isAndroid()) {
|
|
224
244
|
window.addEventListener('resize', this._androidFocusHelper);
|
|
225
245
|
}
|
|
226
246
|
}
|
|
@@ -230,48 +250,18 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
230
250
|
window.removeEventListener('resize', this._androidFocusHelper);
|
|
231
251
|
clearTimeout(this._androidFocusTimeout);
|
|
232
252
|
}
|
|
233
|
-
}, {
|
|
234
|
-
key: "addToIndex",
|
|
235
|
-
value: function addToIndex() {
|
|
236
|
-
if (typeof window !== 'undefined') {
|
|
237
|
-
try {
|
|
238
|
-
if (!Array.isArray(window.__modalStack)) {
|
|
239
|
-
window.__modalStack = [];
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
window.__modalStack.push(this);
|
|
243
|
-
} catch (e) {
|
|
244
|
-
warn(e);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}, {
|
|
249
|
-
key: "removeFromIndex",
|
|
250
|
-
value: function removeFromIndex() {
|
|
251
|
-
var _this4 = this;
|
|
252
|
-
|
|
253
|
-
if (typeof window !== 'undefined') {
|
|
254
|
-
try {
|
|
255
|
-
if (!Array.isArray(window.__modalStack)) {
|
|
256
|
-
window.__modalStack = [];
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
window.__modalStack = window.__modalStack.filter(function (cur) {
|
|
260
|
-
return cur !== _this4;
|
|
261
|
-
});
|
|
262
|
-
} catch (e) {
|
|
263
|
-
warn(e);
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
253
|
}, {
|
|
268
254
|
key: "setFocus",
|
|
269
255
|
value: function setFocus() {
|
|
270
|
-
var _this$
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
256
|
+
var _this$props2 = this.props,
|
|
257
|
+
_this$props2$focus_se = _this$props2.focus_selector,
|
|
258
|
+
focus_selector = _this$props2$focus_se === void 0 ? null : _this$props2$focus_se,
|
|
259
|
+
_this$props2$no_anima = _this$props2.no_animation,
|
|
260
|
+
no_animation = _this$props2$no_anima === void 0 ? null : _this$props2$no_anima,
|
|
261
|
+
_this$props2$animatio = _this$props2.animation_duration,
|
|
262
|
+
animation_duration = _this$props2$animatio === void 0 ? null : _this$props2$animatio;
|
|
274
263
|
var elem = this._contentRef.current;
|
|
264
|
+
var timeoutDuration = typeof animation_duration === 'string' ? parseFloat(animation_duration) : animation_duration;
|
|
275
265
|
|
|
276
266
|
if (elem) {
|
|
277
267
|
clearTimeout(this._focusTimeout);
|
|
@@ -292,7 +282,7 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
292
282
|
} catch (e) {
|
|
293
283
|
warn(e);
|
|
294
284
|
}
|
|
295
|
-
}, isTrue(no_animation) ? 0 :
|
|
285
|
+
}, isTrue(no_animation) ? 0 : timeoutDuration || 0);
|
|
296
286
|
}
|
|
297
287
|
}
|
|
298
288
|
}, {
|
|
@@ -309,10 +299,10 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
309
299
|
clearAllBodyScrollLocks();
|
|
310
300
|
}
|
|
311
301
|
}, {
|
|
312
|
-
key: "
|
|
313
|
-
value: function
|
|
302
|
+
key: "closeModalContent",
|
|
303
|
+
value: function closeModalContent(event, _ref) {
|
|
314
304
|
var _event$persist,
|
|
315
|
-
|
|
305
|
+
_this2 = this;
|
|
316
306
|
|
|
317
307
|
var triggeredBy = _ref.triggeredBy,
|
|
318
308
|
params = _objectWithoutProperties(_ref, _excluded);
|
|
@@ -322,7 +312,7 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
322
312
|
triggeredBy: triggeredBy,
|
|
323
313
|
triggeredByEvent: event
|
|
324
314
|
}, function () {
|
|
325
|
-
|
|
315
|
+
_this2.props.closeModal(event, _objectSpread({
|
|
326
316
|
triggeredBy: triggeredBy
|
|
327
317
|
}, params));
|
|
328
318
|
});
|
|
@@ -330,61 +320,65 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
330
320
|
}, {
|
|
331
321
|
key: "render",
|
|
332
322
|
value: function render() {
|
|
333
|
-
var _this$
|
|
334
|
-
mode = _this$
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
323
|
+
var _this$props3 = this.props,
|
|
324
|
+
_this$props3$mode = _this$props3.mode,
|
|
325
|
+
mode = _this$props3$mode === void 0 ? 'modal' : _this$props3$mode,
|
|
326
|
+
hide = _this$props3.hide,
|
|
327
|
+
title = _this$props3.title,
|
|
328
|
+
labelled_by = _this$props3.labelled_by,
|
|
329
|
+
header_content = _this$props3.header_content,
|
|
330
|
+
modal_content = _this$props3.modal_content,
|
|
331
|
+
bar_content = _this$props3.bar_content,
|
|
332
|
+
_id = _this$props3.id,
|
|
333
|
+
_this$props3$close_ti = _this$props3.close_title,
|
|
334
|
+
close_title = _this$props3$close_ti === void 0 ? 'Lukk' : _this$props3$close_ti,
|
|
335
|
+
_this$props3$dialog_t = _this$props3.dialog_title,
|
|
336
|
+
dialog_title = _this$props3$dialog_t === void 0 ? 'Vindu' : _this$props3$dialog_t,
|
|
337
|
+
_this$props3$hide_clo = _this$props3.hide_close_button,
|
|
338
|
+
hide_close_button = _this$props3$hide_clo === void 0 ? false : _this$props3$hide_clo,
|
|
339
|
+
close_button_attributes = _this$props3.close_button_attributes,
|
|
340
|
+
_this$props3$spacing = _this$props3.spacing,
|
|
341
|
+
spacing = _this$props3$spacing === void 0 ? true : _this$props3$spacing,
|
|
342
|
+
_this$props3$prevent_ = _this$props3.prevent_core_style,
|
|
343
|
+
prevent_core_style = _this$props3$prevent_ === void 0 ? false : _this$props3$prevent_,
|
|
344
|
+
animation_duration = _this$props3.animation_duration,
|
|
345
|
+
_this$props3$no_anima = _this$props3.no_animation,
|
|
346
|
+
no_animation = _this$props3$no_anima === void 0 ? false : _this$props3$no_anima,
|
|
347
|
+
_this$props3$no_anima2 = _this$props3.no_animation_on_mobile,
|
|
348
|
+
no_animation_on_mobile = _this$props3$no_anima2 === void 0 ? false : _this$props3$no_anima2,
|
|
349
|
+
min_width = _this$props3.min_width,
|
|
350
|
+
max_width = _this$props3.max_width,
|
|
351
|
+
_this$props3$fullscre = _this$props3.fullscreen,
|
|
352
|
+
fullscreen = _this$props3$fullscre === void 0 ? 'auto' : _this$props3$fullscre,
|
|
353
|
+
align_content = _this$props3.align_content,
|
|
354
|
+
container_placement = _this$props3.container_placement,
|
|
355
|
+
closeModal = _this$props3.closeModal,
|
|
356
|
+
className = _this$props3.className,
|
|
357
|
+
_className = _this$props3.class,
|
|
358
|
+
content_class = _this$props3.content_class,
|
|
359
|
+
overlay_class = _this$props3.overlay_class,
|
|
360
|
+
content_id = _this$props3.content_id,
|
|
361
|
+
children = _this$props3.children,
|
|
362
|
+
rest = _objectWithoutProperties(_this$props3, _excluded2);
|
|
363
|
+
|
|
364
|
+
var color = this.state.color;
|
|
368
365
|
var contentId = content_id || makeUniqueId('modal-');
|
|
369
|
-
var style = this.state.color ? {
|
|
370
|
-
'--modal-background-color': "var(--color-".concat(this.state.color, ")")
|
|
371
|
-
} : null;
|
|
372
366
|
var minWidth = min_width;
|
|
373
367
|
var maxWidth = max_width;
|
|
374
368
|
|
|
375
|
-
if (minWidth && !maxWidth && parseFloat(minWidth) > 0) {
|
|
369
|
+
if (minWidth && !maxWidth && parseFloat(String(minWidth)) > 0) {
|
|
376
370
|
maxWidth = 0;
|
|
377
|
-
} else if (maxWidth && !minWidth && parseFloat(maxWidth) > 0) {
|
|
371
|
+
} else if (maxWidth && !minWidth && parseFloat(String(maxWidth)) > 0) {
|
|
378
372
|
minWidth = 0;
|
|
379
373
|
}
|
|
380
374
|
|
|
381
375
|
var useDialogRole = !(IS_MAC || IS_SAFARI || IS_IOS);
|
|
382
376
|
var contentParams = {
|
|
383
377
|
role: useDialogRole ? 'dialog' : 'region',
|
|
384
|
-
'aria-modal': useDialogRole ?
|
|
378
|
+
'aria-modal': useDialogRole ? true : undefined,
|
|
385
379
|
'aria-labelledby': combineLabelledBy(this.props, title ? contentId + '-title' : null, labelled_by),
|
|
386
380
|
'aria-describedby': combineDescribedBy(this.props, contentId + '-content'),
|
|
387
|
-
'aria-label': !title && !labelled_by ?
|
|
381
|
+
'aria-label': !title && !labelled_by ? dialog_title : undefined,
|
|
388
382
|
className: classnames('dnb-modal__content', (container_placement || mode === 'drawer') && "dnb-modal__content--".concat(container_placement || 'right'), isTrue(fullscreen) ? 'dnb-modal__content--fullscreen' : fullscreen === 'auto' && 'dnb-modal__content--auto-fullscreen', content_class, mode && "dnb-modal__content--".concat(mode), hide && 'dnb-modal__content--hide', isTrue(spacing) && 'dnb-modal__content--spacing', align_content && "dnb-modal__content__align--".concat(align_content), isTrue(no_animation) && 'dnb-modal__content--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__content--no-animation-on-mobile'),
|
|
389
383
|
onClick: this.onContentClickHandler
|
|
390
384
|
};
|
|
@@ -400,134 +394,46 @@ var ModalContent = function (_React$PureComponent) {
|
|
|
400
394
|
onKeyDown: this.onKeyDownHandler
|
|
401
395
|
}, rest);
|
|
402
396
|
|
|
403
|
-
var overlayParams = {
|
|
404
|
-
className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && "dnb-modal__overlay--".concat(mode), isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile')
|
|
405
|
-
};
|
|
406
397
|
validateDOMAttributes(this.props, innerParams);
|
|
407
|
-
var
|
|
398
|
+
var barExists = findElementInChildren(modal_content, function (cur) {
|
|
408
399
|
return cur.type === ModalHeaderBar;
|
|
409
|
-
})
|
|
410
|
-
var
|
|
400
|
+
});
|
|
401
|
+
var headerExists = findElementInChildren(modal_content, function (cur) {
|
|
411
402
|
return cur.type === ModalHeader;
|
|
412
|
-
})
|
|
413
|
-
title: title
|
|
414
|
-
}, header_content);
|
|
415
|
-
var content = React.createElement("div", {
|
|
416
|
-
id: contentId + '-content',
|
|
417
|
-
className: "dnb-modal__content__wrapper"
|
|
418
|
-
}, modal_content);
|
|
403
|
+
});
|
|
419
404
|
return React.createElement(ModalContext.Provider, {
|
|
420
|
-
value:
|
|
421
|
-
id:
|
|
422
|
-
|
|
423
|
-
|
|
405
|
+
value: {
|
|
406
|
+
id: this.props.id,
|
|
407
|
+
title: title,
|
|
408
|
+
hide_close_button: hide_close_button,
|
|
409
|
+
close_button_attributes: close_button_attributes,
|
|
410
|
+
close_title: close_title,
|
|
411
|
+
mode: mode,
|
|
412
|
+
setBackgroundColor: this.setBackgroundColor,
|
|
424
413
|
onCloseClickHandler: this.onCloseClickHandler
|
|
425
|
-
}
|
|
414
|
+
}
|
|
426
415
|
}, React.createElement("div", _extends({
|
|
427
416
|
id: contentId
|
|
428
417
|
}, contentParams), React.createElement(ScrollView, innerParams, React.createElement("div", {
|
|
429
|
-
tabIndex:
|
|
418
|
+
tabIndex: -1,
|
|
430
419
|
className: "dnb-modal__content__spacing dnb-no-focus",
|
|
431
|
-
style:
|
|
420
|
+
style: color ? {
|
|
421
|
+
'--modal-background-color': "var(--color-".concat(color, ")")
|
|
422
|
+
} : null,
|
|
432
423
|
ref: this._contentRef
|
|
433
|
-
},
|
|
424
|
+
}, !barExists && React.createElement(ModalHeaderBar, null, bar_content), !headerExists && React.createElement(ModalHeader, {
|
|
425
|
+
title: title
|
|
426
|
+
}, header_content), React.createElement("div", {
|
|
427
|
+
id: contentId + '-content',
|
|
428
|
+
className: "dnb-modal__content__wrapper"
|
|
429
|
+
}, modal_content)))), React.createElement("span", {
|
|
430
|
+
className: classnames('dnb-modal__overlay', overlay_class, hide && 'dnb-modal__overlay--hide', mode && "dnb-modal__overlay--".concat(mode), isTrue(no_animation) && 'dnb-modal__overlay--no-animation', isTrue(no_animation_on_mobile) && 'dnb-modal__overlay--no-animation-on-mobile'),
|
|
434
431
|
"aria-hidden": "true"
|
|
435
|
-
}))
|
|
432
|
+
}));
|
|
436
433
|
}
|
|
437
434
|
}]);
|
|
438
435
|
|
|
439
436
|
return ModalContent;
|
|
440
437
|
}(React.PureComponent);
|
|
441
438
|
|
|
442
|
-
|
|
443
|
-
mode: null,
|
|
444
|
-
bar_content: null,
|
|
445
|
-
header_content: null,
|
|
446
|
-
hide: null,
|
|
447
|
-
id: null,
|
|
448
|
-
root_id: null,
|
|
449
|
-
labelled_by: null,
|
|
450
|
-
focus_selector: null,
|
|
451
|
-
content_id: null,
|
|
452
|
-
title: null,
|
|
453
|
-
close_title: null,
|
|
454
|
-
dialog_title: null,
|
|
455
|
-
hide_close_button: null,
|
|
456
|
-
close_button_attributes: null,
|
|
457
|
-
spacing: null,
|
|
458
|
-
prevent_close: null,
|
|
459
|
-
prevent_core_style: null,
|
|
460
|
-
animation_duration: null,
|
|
461
|
-
no_animation: null,
|
|
462
|
-
no_animation_on_mobile: null,
|
|
463
|
-
min_width: null,
|
|
464
|
-
max_width: null,
|
|
465
|
-
fullscreen: null,
|
|
466
|
-
align_content: null,
|
|
467
|
-
container_placement: null,
|
|
468
|
-
class: null,
|
|
469
|
-
overlay_class: null,
|
|
470
|
-
content_class: null,
|
|
471
|
-
closeModal: null,
|
|
472
|
-
className: null,
|
|
473
|
-
children: null
|
|
474
|
-
});
|
|
475
|
-
|
|
476
|
-
export { ModalContent as default };
|
|
477
|
-
process.env.NODE_ENV !== "production" ? ModalContent.propTypes = {
|
|
478
|
-
modal_content: PropTypes.node.isRequired,
|
|
479
|
-
mode: PropTypes.oneOf(['modal', 'drawer']),
|
|
480
|
-
bar_content: PropTypes.node,
|
|
481
|
-
header_content: PropTypes.node,
|
|
482
|
-
hide: PropTypes.bool,
|
|
483
|
-
id: PropTypes.string,
|
|
484
|
-
root_id: PropTypes.string,
|
|
485
|
-
labelled_by: PropTypes.string,
|
|
486
|
-
focus_selector: PropTypes.string,
|
|
487
|
-
content_id: PropTypes.string,
|
|
488
|
-
title: PropTypes.node,
|
|
489
|
-
close_title: PropTypes.string,
|
|
490
|
-
dialog_title: PropTypes.string,
|
|
491
|
-
hide_close_button: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
492
|
-
close_button_attributes: PropTypes.object,
|
|
493
|
-
spacing: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
494
|
-
prevent_close: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
495
|
-
prevent_core_style: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
496
|
-
animation_duration: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
497
|
-
no_animation: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
498
|
-
no_animation_on_mobile: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
499
|
-
min_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
500
|
-
max_width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
501
|
-
fullscreen: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
|
|
502
|
-
align_content: PropTypes.string,
|
|
503
|
-
container_placement: PropTypes.string,
|
|
504
|
-
class: PropTypes.string,
|
|
505
|
-
content_class: PropTypes.string,
|
|
506
|
-
overlay_class: PropTypes.string,
|
|
507
|
-
closeModal: PropTypes.func.isRequired,
|
|
508
|
-
className: PropTypes.string,
|
|
509
|
-
children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func])
|
|
510
|
-
} : void 0;
|
|
511
|
-
export function getListOfModalRoots() {
|
|
512
|
-
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
513
|
-
|
|
514
|
-
if (typeof window !== 'undefined') {
|
|
515
|
-
try {
|
|
516
|
-
var stack = window.__modalStack || [];
|
|
517
|
-
|
|
518
|
-
if (index !== null) {
|
|
519
|
-
if (index === -1 && stack.length) {
|
|
520
|
-
return stack[stack.length - 1];
|
|
521
|
-
} else if (index > -1) {
|
|
522
|
-
return stack[index];
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
return stack;
|
|
527
|
-
} catch (e) {
|
|
528
|
-
warn(e);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
return [];
|
|
533
|
-
}
|
|
439
|
+
export { ModalContent as default };
|