@dynamic-framework/ui-react 2.9.0 → 2.10.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/dist/css/dynamic-ui.css +1 -1
- package/dist/css/dynamic-ui.min.css +1 -1
- package/dist/esm/components/DAlert/DAlert.js +16 -0
- package/dist/esm/components/DAlert/DAlert.js.map +1 -0
- package/dist/esm/components/DAlert/index.js +6 -0
- package/dist/esm/components/DAlert/index.js.map +1 -0
- package/dist/esm/components/DAvatar/DAvatar.js +23 -0
- package/dist/esm/components/DAvatar/DAvatar.js.map +1 -0
- package/dist/esm/components/DAvatar/index.js +6 -0
- package/dist/esm/components/DAvatar/index.js.map +1 -0
- package/dist/esm/components/DBadge/DBadge.js +31 -0
- package/dist/esm/components/DBadge/DBadge.js.map +1 -0
- package/dist/esm/components/DBadge/index.js +6 -0
- package/dist/esm/components/DBadge/index.js.map +1 -0
- package/dist/esm/components/DBox/DBox.js +9 -0
- package/dist/esm/components/DBox/DBox.js.map +1 -0
- package/dist/esm/components/DBox/index.js +6 -0
- package/dist/esm/components/DBox/index.js.map +1 -0
- package/dist/esm/components/DBoxFile/DBoxFile.js +26 -0
- package/dist/esm/components/DBoxFile/DBoxFile.js.map +1 -0
- package/dist/esm/components/DBoxFile/index.js +6 -0
- package/dist/esm/components/DBoxFile/index.js.map +1 -0
- package/dist/esm/components/DBoxFile/useDBoxFile.js +236 -0
- package/dist/esm/components/DBoxFile/useDBoxFile.js.map +1 -0
- package/dist/esm/components/DBoxFile/utils.js +127 -0
- package/dist/esm/components/DBoxFile/utils.js.map +1 -0
- package/dist/esm/components/DButton/DButton.js +84 -0
- package/dist/esm/components/DButton/DButton.js.map +1 -0
- package/dist/esm/components/DButton/index.js +6 -0
- package/dist/esm/components/DButton/index.js.map +1 -0
- package/dist/esm/components/DButtonIcon/DButtonIcon.js +52 -0
- package/dist/esm/components/DButtonIcon/DButtonIcon.js.map +1 -0
- package/dist/esm/components/DButtonIcon/index.js +6 -0
- package/dist/esm/components/DButtonIcon/index.js.map +1 -0
- package/dist/esm/components/DButtonIcon/warnMissingAccessibleName.js +40 -0
- package/dist/esm/components/DButtonIcon/warnMissingAccessibleName.js.map +1 -0
- package/dist/esm/components/DCard/DCard.js +17 -0
- package/dist/esm/components/DCard/DCard.js.map +1 -0
- package/dist/esm/components/DCard/components/DCardBody.js +9 -0
- package/dist/esm/components/DCard/components/DCardBody.js.map +1 -0
- package/dist/esm/components/DCard/components/DCardFooter.js +9 -0
- package/dist/esm/components/DCard/components/DCardFooter.js.map +1 -0
- package/dist/esm/components/DCard/components/DCardHeader.js +9 -0
- package/dist/esm/components/DCard/components/DCardHeader.js.map +1 -0
- package/dist/esm/components/DCard/index.js +9 -0
- package/dist/esm/components/DCard/index.js.map +1 -0
- package/dist/esm/components/DCarousel/DCarousel.js +39 -0
- package/dist/esm/components/DCarousel/DCarousel.js.map +1 -0
- package/dist/esm/components/DCarousel/components/DCarouselSlide.js +12 -0
- package/dist/esm/components/DCarousel/components/DCarouselSlide.js.map +1 -0
- package/dist/esm/components/DCarousel/index.js +7 -0
- package/dist/esm/components/DCarousel/index.js.map +1 -0
- package/dist/esm/components/DChip/DChip.js +18 -0
- package/dist/esm/components/DChip/DChip.js.map +1 -0
- package/dist/esm/components/DChip/index.js +6 -0
- package/dist/esm/components/DChip/index.js.map +1 -0
- package/dist/esm/components/DCollapse/DCollapse.js +30 -0
- package/dist/esm/components/DCollapse/DCollapse.js.map +1 -0
- package/dist/esm/components/DCollapse/index.js +6 -0
- package/dist/esm/components/DCollapse/index.js.map +1 -0
- package/dist/esm/components/DConfirmModal/DConfirmModalContainer.js +59 -0
- package/dist/esm/components/DConfirmModal/DConfirmModalContainer.js.map +1 -0
- package/dist/esm/components/DConfirmModal/DConfirmModalUI.js +39 -0
- package/dist/esm/components/DConfirmModal/DConfirmModalUI.js.map +1 -0
- package/dist/esm/components/DConfirmModal/confirmModalStore.js +38 -0
- package/dist/esm/components/DConfirmModal/confirmModalStore.js.map +1 -0
- package/dist/esm/components/DCreditCard/DCreditCard.js +15 -0
- package/dist/esm/components/DCreditCard/DCreditCard.js.map +1 -0
- package/dist/esm/components/DCreditCard/index.js +6 -0
- package/dist/esm/components/DCreditCard/index.js.map +1 -0
- package/dist/esm/components/DCurrencyText/DCurrencyText.js +10 -0
- package/dist/esm/components/DCurrencyText/DCurrencyText.js.map +1 -0
- package/dist/esm/components/DCurrencyText/index.js +6 -0
- package/dist/esm/components/DCurrencyText/index.js.map +1 -0
- package/dist/esm/components/DDataStateWrapper/DDataStateWrapper.js +35 -0
- package/dist/esm/components/DDataStateWrapper/DDataStateWrapper.js.map +1 -0
- package/dist/esm/components/DDataStateWrapper/components/EmptyState.js +10 -0
- package/dist/esm/components/DDataStateWrapper/components/EmptyState.js.map +1 -0
- package/dist/esm/components/DDataStateWrapper/components/ErrorState.js +10 -0
- package/dist/esm/components/DDataStateWrapper/components/ErrorState.js.map +1 -0
- package/dist/esm/components/DDataStateWrapper/components/LoadingState.js +8 -0
- package/dist/esm/components/DDataStateWrapper/components/LoadingState.js.map +1 -0
- package/dist/esm/components/DDataStateWrapper/index.js +9 -0
- package/dist/esm/components/DDataStateWrapper/index.js.map +1 -0
- package/dist/esm/components/DDatePicker/DDatePicker.js +54 -0
- package/dist/esm/components/DDatePicker/DDatePicker.js.map +1 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerHeaderSelector.js +50 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerHeaderSelector.js.map +1 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerInput.js +16 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerInput.js.map +1 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerTime.js +11 -0
- package/dist/esm/components/DDatePicker/components/DDatePickerTime.js.map +1 -0
- package/dist/esm/components/DDatePicker/index.js +6 -0
- package/dist/esm/components/DDatePicker/index.js.map +1 -0
- package/dist/esm/components/DDropdown/DDropdown.js +315 -0
- package/dist/esm/components/DDropdown/DDropdown.js.map +1 -0
- package/dist/esm/components/DDropdown/index.js +6 -0
- package/dist/esm/components/DDropdown/index.js.map +1 -0
- package/dist/esm/components/DErrorBoundary/DErrorBoundary.js +22 -0
- package/dist/esm/components/DErrorBoundary/DErrorBoundary.js.map +1 -0
- package/dist/esm/components/DErrorBoundary/components/DefaultErrorBoundary.js +10 -0
- package/dist/esm/components/DErrorBoundary/components/DefaultErrorBoundary.js.map +1 -0
- package/dist/esm/components/DErrorBoundary/index.js +7 -0
- package/dist/esm/components/DErrorBoundary/index.js.map +1 -0
- package/dist/esm/components/DIcon/DIcon.js +21 -0
- package/dist/esm/components/DIcon/DIcon.js.map +1 -0
- package/dist/esm/components/DIcon/index.js +6 -0
- package/dist/esm/components/DIcon/index.js.map +1 -0
- package/dist/esm/components/DIconBase/DIconBase.js +146 -0
- package/dist/esm/components/DIconBase/DIconBase.js.map +1 -0
- package/dist/esm/components/DIconBase/index.js +6 -0
- package/dist/esm/components/DIconBase/index.js.map +1 -0
- package/dist/esm/components/DIconBase/resolveIconFromRegistry.js +20 -0
- package/dist/esm/components/DIconBase/resolveIconFromRegistry.js.map +1 -0
- package/dist/esm/components/DIconBase/warnUnknownIcon.js +59 -0
- package/dist/esm/components/DIconBase/warnUnknownIcon.js.map +1 -0
- package/dist/esm/components/DInput/DInput.js +83 -0
- package/dist/esm/components/DInput/DInput.js.map +1 -0
- package/dist/esm/components/DInput/index.js +6 -0
- package/dist/esm/components/DInput/index.js.map +1 -0
- package/dist/esm/components/DInputCheck/DInputCheck.js +57 -0
- package/dist/esm/components/DInputCheck/DInputCheck.js.map +1 -0
- package/dist/esm/components/DInputCheck/index.js +6 -0
- package/dist/esm/components/DInputCheck/index.js.map +1 -0
- package/dist/esm/components/DInputCounter/DInputCounter.js +49 -0
- package/dist/esm/components/DInputCounter/DInputCounter.js.map +1 -0
- package/dist/esm/components/DInputCounter/index.js +6 -0
- package/dist/esm/components/DInputCounter/index.js.map +1 -0
- package/dist/esm/components/DInputCurrency/DInputCurrency.js +20 -0
- package/dist/esm/components/DInputCurrency/DInputCurrency.js.map +1 -0
- package/dist/esm/components/DInputCurrency/index.js +6 -0
- package/dist/esm/components/DInputCurrency/index.js.map +1 -0
- package/dist/esm/components/DInputMask/DInputMask.js +13 -0
- package/dist/esm/components/DInputMask/DInputMask.js.map +1 -0
- package/dist/esm/components/DInputMask/index.js +6 -0
- package/dist/esm/components/DInputMask/index.js.map +1 -0
- package/dist/esm/components/DInputPassword/DInputPassword.js +24 -0
- package/dist/esm/components/DInputPassword/DInputPassword.js.map +1 -0
- package/dist/esm/components/DInputPassword/index.js +6 -0
- package/dist/esm/components/DInputPassword/index.js.map +1 -0
- package/dist/esm/components/DInputPhone/DInputPhone.js +96 -0
- package/dist/esm/components/DInputPhone/DInputPhone.js.map +1 -0
- package/dist/esm/components/DInputPhone/index.js +6 -0
- package/dist/esm/components/DInputPhone/index.js.map +1 -0
- package/dist/esm/components/DInputPin/DInputPin.js +86 -0
- package/dist/esm/components/DInputPin/DInputPin.js.map +1 -0
- package/dist/esm/components/DInputPin/index.js +6 -0
- package/dist/esm/components/DInputPin/index.js.map +1 -0
- package/dist/esm/components/DInputRange/DInputRange.js +46 -0
- package/dist/esm/components/DInputRange/DInputRange.js.map +1 -0
- package/dist/esm/components/DInputRange/index.js +6 -0
- package/dist/esm/components/DInputRange/index.js.map +1 -0
- package/dist/esm/components/DInputSearch/DInputSearch.js +57 -0
- package/dist/esm/components/DInputSearch/DInputSearch.js.map +1 -0
- package/dist/esm/components/DInputSearch/index.js +6 -0
- package/dist/esm/components/DInputSearch/index.js.map +1 -0
- package/dist/esm/components/DInputSelect/DInputSelect.js +90 -0
- package/dist/esm/components/DInputSelect/DInputSelect.js.map +1 -0
- package/dist/esm/components/DInputSelect/index.js +6 -0
- package/dist/esm/components/DInputSelect/index.js.map +1 -0
- package/dist/esm/components/DInputSwitch/DInputSwitch.js +32 -0
- package/dist/esm/components/DInputSwitch/DInputSwitch.js.map +1 -0
- package/dist/esm/components/DInputSwitch/index.js +6 -0
- package/dist/esm/components/DInputSwitch/index.js.map +1 -0
- package/dist/esm/components/DLayout/DLayout.js +22 -0
- package/dist/esm/components/DLayout/DLayout.js.map +1 -0
- package/dist/esm/components/DLayout/components/DLayoutPane.js +16 -0
- package/dist/esm/components/DLayout/components/DLayoutPane.js.map +1 -0
- package/dist/esm/components/DLayout/index.js +7 -0
- package/dist/esm/components/DLayout/index.js.map +1 -0
- package/dist/esm/components/DListGroup/DListGroup.js +31 -0
- package/dist/esm/components/DListGroup/DListGroup.js.map +1 -0
- package/dist/esm/components/DListGroup/components/DListGroupItem.js +41 -0
- package/dist/esm/components/DListGroup/components/DListGroupItem.js.map +1 -0
- package/dist/esm/components/DListGroup/index.js +7 -0
- package/dist/esm/components/DListGroup/index.js.map +1 -0
- package/dist/esm/components/DModal/DModal.js +37 -0
- package/dist/esm/components/DModal/DModal.js.map +1 -0
- package/dist/esm/components/DModal/components/DModalBody.js +9 -0
- package/dist/esm/components/DModal/components/DModalBody.js.map +1 -0
- package/dist/esm/components/DModal/components/DModalFooter.js +14 -0
- package/dist/esm/components/DModal/components/DModalFooter.js.map +1 -0
- package/dist/esm/components/DModal/components/DModalHeader.js +15 -0
- package/dist/esm/components/DModal/components/DModalHeader.js.map +1 -0
- package/dist/esm/components/DModal/index.js +9 -0
- package/dist/esm/components/DModal/index.js.map +1 -0
- package/dist/esm/components/DOffcanvas/DOffcanvas.js +82 -0
- package/dist/esm/components/DOffcanvas/DOffcanvas.js.map +1 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasBody.js +9 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasBody.js.map +1 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasFooter.js +14 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasFooter.js.map +1 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasHeader.js +15 -0
- package/dist/esm/components/DOffcanvas/components/DOffcanvasHeader.js.map +1 -0
- package/dist/esm/components/DOffcanvas/index.js +9 -0
- package/dist/esm/components/DOffcanvas/index.js.map +1 -0
- package/dist/esm/components/DOtp/DOtp.js +26 -0
- package/dist/esm/components/DOtp/DOtp.js.map +1 -0
- package/dist/esm/components/DOtp/components/OtpCountdown.js +12 -0
- package/dist/esm/components/DOtp/components/OtpCountdown.js.map +1 -0
- package/dist/esm/components/DOtp/index.js +6 -0
- package/dist/esm/components/DOtp/index.js.map +1 -0
- package/dist/esm/components/DPaginator/DPaginator.js +12 -0
- package/dist/esm/components/DPaginator/DPaginator.js.map +1 -0
- package/dist/esm/components/DPaginator/index.js +6 -0
- package/dist/esm/components/DPaginator/index.js.map +1 -0
- package/dist/esm/components/DPasswordStrengthMeter/DPasswordStrengthMeter.js +27 -0
- package/dist/esm/components/DPasswordStrengthMeter/DPasswordStrengthMeter.js.map +1 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordCheckItem.js +10 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordCheckItem.js.map +1 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordCheckList.js +41 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordCheckList.js.map +1 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordStrength.js +23 -0
- package/dist/esm/components/DPasswordStrengthMeter/PasswordStrength.js.map +1 -0
- package/dist/esm/components/DPasswordStrengthMeter/index.js +6 -0
- package/dist/esm/components/DPasswordStrengthMeter/index.js.map +1 -0
- package/dist/esm/components/DPopover/DPopover.js +49 -0
- package/dist/esm/components/DPopover/DPopover.js.map +1 -0
- package/dist/esm/components/DPopover/index.js +6 -0
- package/dist/esm/components/DPopover/index.js.map +1 -0
- package/dist/esm/components/DProgress/DProgress.js +16 -0
- package/dist/esm/components/DProgress/DProgress.js.map +1 -0
- package/dist/esm/components/DProgress/index.js +6 -0
- package/dist/esm/components/DProgress/index.js.map +1 -0
- package/dist/esm/components/DSelect/DSelect.js +60 -0
- package/dist/esm/components/DSelect/DSelect.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectClearIndicator.js +12 -0
- package/dist/esm/components/DSelect/components/DSelectClearIndicator.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectDropdownIndicator.js +12 -0
- package/dist/esm/components/DSelect/components/DSelectDropdownIndicator.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectLoadingIndicator.js +12 -0
- package/dist/esm/components/DSelect/components/DSelectLoadingIndicator.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectMultiValueRemove.js +12 -0
- package/dist/esm/components/DSelect/components/DSelectMultiValueRemove.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectOptionCheck.js +14 -0
- package/dist/esm/components/DSelect/components/DSelectOptionCheck.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectOptionEmoji.js +14 -0
- package/dist/esm/components/DSelect/components/DSelectOptionEmoji.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectOptionIcon.js +15 -0
- package/dist/esm/components/DSelect/components/DSelectOptionIcon.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectPlaceholder.js +14 -0
- package/dist/esm/components/DSelect/components/DSelectPlaceholder.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueEmoji.js +15 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueEmoji.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueEmojiText.js +15 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueEmojiText.js.map +1 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueIconText.js +16 -0
- package/dist/esm/components/DSelect/components/DSelectSingleValueIconText.js.map +1 -0
- package/dist/esm/components/DSelect/index.js +6 -0
- package/dist/esm/components/DSelect/index.js.map +1 -0
- package/dist/esm/components/DStepper/DStepper.js +13 -0
- package/dist/esm/components/DStepper/DStepper.js.map +1 -0
- package/dist/esm/components/DStepper/index.js +6 -0
- package/dist/esm/components/DStepper/index.js.map +1 -0
- package/dist/esm/components/DStepperDesktop/DStepperDesktop.js +27 -0
- package/dist/esm/components/DStepperDesktop/DStepperDesktop.js.map +1 -0
- package/dist/esm/components/DStepperDesktop/index.js +6 -0
- package/dist/esm/components/DStepperDesktop/index.js.map +1 -0
- package/dist/esm/components/DStepperMobile/DStepperMobile.js +37 -0
- package/dist/esm/components/DStepperMobile/DStepperMobile.js.map +1 -0
- package/dist/esm/components/DStepperMobile/index.js +6 -0
- package/dist/esm/components/DStepperMobile/index.js.map +1 -0
- package/dist/esm/components/DTabs/DTabs.js +117 -0
- package/dist/esm/components/DTabs/DTabs.js.map +1 -0
- package/dist/esm/components/DTabs/TabContext.js +13 -0
- package/dist/esm/components/DTabs/TabContext.js.map +1 -0
- package/dist/esm/components/DTabs/components/DTabContent.js +14 -0
- package/dist/esm/components/DTabs/components/DTabContent.js.map +1 -0
- package/dist/esm/components/DTabs/index.js +8 -0
- package/dist/esm/components/DTabs/index.js.map +1 -0
- package/dist/esm/components/DTimeline/DTimeline.js +12 -0
- package/dist/esm/components/DTimeline/DTimeline.js.map +1 -0
- package/dist/esm/components/DTimeline/index.js +6 -0
- package/dist/esm/components/DTimeline/index.js.map +1 -0
- package/dist/esm/components/DToast/DToast.js +15 -0
- package/dist/esm/components/DToast/DToast.js.map +1 -0
- package/dist/esm/components/DToast/components/DToastBody.js +9 -0
- package/dist/esm/components/DToast/components/DToastBody.js.map +1 -0
- package/dist/esm/components/DToast/components/DToastHeader.js +9 -0
- package/dist/esm/components/DToast/components/DToastHeader.js.map +1 -0
- package/dist/esm/components/DToast/index.js +8 -0
- package/dist/esm/components/DToast/index.js.map +1 -0
- package/dist/esm/components/DToastContainer/DToastContainer.js +9 -0
- package/dist/esm/components/DToastContainer/DToastContainer.js.map +1 -0
- package/dist/esm/components/DToastContainer/index.js +7 -0
- package/dist/esm/components/DToastContainer/index.js.map +1 -0
- package/dist/esm/components/DToastContainer/useDToast.js +58 -0
- package/dist/esm/components/DToastContainer/useDToast.js.map +1 -0
- package/dist/esm/components/DTooltip/DTooltip.js +51 -0
- package/dist/esm/components/DTooltip/DTooltip.js.map +1 -0
- package/dist/esm/components/DTooltip/index.js +6 -0
- package/dist/esm/components/DTooltip/index.js.map +1 -0
- package/dist/esm/components/DVoucher/DVoucher.js +55 -0
- package/dist/esm/components/DVoucher/DVoucher.js.map +1 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshot.js +30 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshot.js.map +1 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshotDownload.js +30 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshotDownload.js.map +1 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshotWebShare.js +27 -0
- package/dist/esm/components/DVoucher/hooks/useScreenshotWebShare.js.map +1 -0
- package/dist/esm/components/DVoucher/index.js +9 -0
- package/dist/esm/components/DVoucher/index.js.map +1 -0
- package/dist/esm/components/config.js +14 -0
- package/dist/esm/components/config.js.map +1 -0
- package/dist/esm/contexts/DContext.js +124 -0
- package/dist/esm/contexts/DContext.js.map +1 -0
- package/dist/esm/contexts/DPortalContext.js +128 -0
- package/dist/esm/contexts/DPortalContext.js.map +1 -0
- package/dist/esm/hooks/useConfirmModal.js +63 -0
- package/dist/esm/hooks/useConfirmModal.js.map +1 -0
- package/dist/esm/hooks/useCountdown.js +45 -0
- package/dist/esm/hooks/useCountdown.js.map +1 -0
- package/dist/esm/hooks/useDisableBodyScrollEffect.js +52 -0
- package/dist/esm/hooks/useDisableBodyScrollEffect.js.map +1 -0
- package/dist/esm/hooks/useDisableInputWheel.js +17 -0
- package/dist/esm/hooks/useDisableInputWheel.js.map +1 -0
- package/dist/esm/hooks/useFormatCurrency.js +16 -0
- package/dist/esm/hooks/useFormatCurrency.js.map +1 -0
- package/dist/esm/hooks/useInputCurrency.js +76 -0
- package/dist/esm/hooks/useInputCurrency.js.map +1 -0
- package/dist/esm/hooks/useItemSelection.js +35 -0
- package/dist/esm/hooks/useItemSelection.js.map +1 -0
- package/dist/esm/hooks/useMediaBreakpointUp.js +30 -0
- package/dist/esm/hooks/useMediaBreakpointUp.js.map +1 -0
- package/dist/esm/hooks/useMediaQuery.js +11 -0
- package/dist/esm/hooks/useMediaQuery.js.map +1 -0
- package/dist/esm/hooks/useOtp.js +107 -0
- package/dist/esm/hooks/useOtp.js.map +1 -0
- package/dist/esm/hooks/usePortal.js +26 -0
- package/dist/esm/hooks/usePortal.js.map +1 -0
- package/dist/esm/hooks/useProvidedRefOrCreate.js +24 -0
- package/dist/esm/hooks/useProvidedRefOrCreate.js.map +1 -0
- package/dist/esm/hooks/useResponsiveProp.js +50 -0
- package/dist/esm/hooks/useResponsiveProp.js.map +1 -0
- package/dist/esm/hooks/useStackState.js +40 -0
- package/dist/esm/hooks/useStackState.js.map +1 -0
- package/dist/esm/icons/coreIcons.js +55 -0
- package/dist/esm/icons/coreIcons.js.map +1 -0
- package/dist/esm/index.js +98 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/utils/attr-accept.js +38 -0
- package/dist/esm/utils/attr-accept.js.map +1 -0
- package/dist/esm/utils/buildUrl.js +57 -0
- package/dist/esm/utils/buildUrl.js.map +1 -0
- package/dist/esm/utils/changeQueryString.js +19 -0
- package/dist/esm/utils/changeQueryString.js.map +1 -0
- package/dist/esm/utils/configureI18n.js +20 -0
- package/dist/esm/utils/configureI18n.js.map +1 -0
- package/dist/esm/utils/formatCurrency.js +8 -0
- package/dist/esm/utils/formatCurrency.js.map +1 -0
- package/dist/esm/utils/getCssVariable.js +7 -0
- package/dist/esm/utils/getCssVariable.js.map +1 -0
- package/dist/esm/utils/getKeyboardFocusableElements.js +11 -0
- package/dist/esm/utils/getKeyboardFocusableElements.js.map +1 -0
- package/dist/esm/utils/getQueryString.js +8 -0
- package/dist/esm/utils/getQueryString.js.map +1 -0
- package/dist/esm/utils/mediaQuery.js +13 -0
- package/dist/esm/utils/mediaQuery.js.map +1 -0
- package/dist/esm/utils/sanitizeHref.js +67 -0
- package/dist/esm/utils/sanitizeHref.js.map +1 -0
- package/dist/esm/utils/validatePhoneNumber.js +14 -0
- package/dist/esm/utils/validatePhoneNumber.js.map +1 -0
- package/dist/icons-core.json +33 -0
- package/dist/index.esm.js +287 -22
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +287 -21
- package/dist/index.js.map +1 -1
- package/dist/types/components/DButtonIcon/warnMissingAccessibleName.d.ts +18 -0
- package/dist/types/components/DIcon/DIcon.d.ts +8 -0
- package/dist/types/components/DIconBase/DIconBase.d.ts +43 -1
- package/dist/types/components/DIconBase/resolveIconFromRegistry.d.ts +14 -0
- package/dist/types/components/DIconBase/warnUnknownIcon.d.ts +13 -0
- package/dist/types/components/DInputRange/DInputRange.d.ts +1 -1
- package/dist/types/components/config.d.ts +10 -0
- package/dist/types/icons/coreIcons.d.ts +24 -0
- package/dist/types/icons/index.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +4 -4
- package/dist/types/components/DVoucher/hooks/useScreenshotDownload.spec.d.ts +0 -1
- package/dist/types/components/DVoucher/hooks/useScreenshotWebShare.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useCountdown.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useDisableBodyScrollEffect.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useDisableInputWheel.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useFormatCurrency.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useInputCurrency.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useItemSelection.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useMediaBreakpointUp.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useMediaQuery.spec.d.ts +0 -1
- package/dist/types/hooks/tests/usePortal.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useProvidedRefOrCreate.spec.d.ts +0 -1
- package/dist/types/hooks/tests/useStackState.spec.d.ts +0 -1
- package/dist/types/utils/tests/attr-accept.spec.d.ts +0 -1
- package/dist/types/utils/tests/buildUrl.spec.d.ts +0 -1
- package/dist/types/utils/tests/changeQueryString.spec.d.ts +0 -1
- package/dist/types/utils/tests/configureI18n.spec.d.ts +0 -1
- package/dist/types/utils/tests/formatCurrency.spec.d.ts +0 -1
- package/dist/types/utils/tests/getCssVariable.spec.d.ts +0 -1
- package/dist/types/utils/tests/getKeyboardFocusableElements.spec.d.ts +0 -1
- package/dist/types/utils/tests/getQueryString.spec.d.ts +0 -1
- package/dist/types/utils/tests/mediaQuery.spec.d.ts +0 -1
- package/dist/types/utils/tests/sanitizeHref.spec.d.ts +0 -1
- package/dist/types/utils/tests/validatePhoneNumber.spec.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatCurrency.js","sources":["../../../dist-transpiled/utils/formatCurrency.js"],"sourcesContent":["import currency from 'currency.js';\nexport default function formatCurrency(amount, options) {\n return currency(amount, options).format();\n}\n//# sourceMappingURL=formatCurrency.js.map"],"names":[],"mappings":";;AACe,SAAS,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE;AACxD,IAAI,OAAO,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,MAAM,EAAE;AAC7C;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCssVariable.js","sources":["../../../dist-transpiled/utils/getCssVariable.js"],"sourcesContent":["export default function getCssVariable(variable) {\n const computedStyle = getComputedStyle(document.documentElement);\n return computedStyle.getPropertyValue(variable).trim();\n}\n//# sourceMappingURL=getCssVariable.js.map"],"names":[],"mappings":"AAAe,SAAS,cAAc,CAAC,QAAQ,EAAE;AACjD,IAAI,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,eAAe,CAAC;AACpE,IAAI,OAAO,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;AAC1D;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function getKeyboardFocusableElements(container) {
|
|
2
|
+
if (!container) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
return [
|
|
6
|
+
...container.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'),
|
|
7
|
+
].filter((element) => !element.hasAttribute('disabled'));
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { getKeyboardFocusableElements as default };
|
|
11
|
+
//# sourceMappingURL=getKeyboardFocusableElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getKeyboardFocusableElements.js","sources":["../../../dist-transpiled/utils/getKeyboardFocusableElements.js"],"sourcesContent":["export default function getKeyboardFocusableElements(container) {\n if (!container) {\n return [];\n }\n return [\n ...container.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'),\n ].filter((element) => !element.hasAttribute('disabled'));\n}\n//# sourceMappingURL=getKeyboardFocusableElements.js.map"],"names":[],"mappings":"AAAe,SAAS,4BAA4B,CAAC,SAAS,EAAE;AAChE,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,OAAO,EAAE;AACjB,IAAI;AACJ,IAAI,OAAO;AACX,QAAQ,GAAG,SAAS,CAAC,gBAAgB,CAAC,8EAA8E,CAAC;AACrH,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;AAC5D;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function getQueryString(value, config = {}) {
|
|
2
|
+
const { useSearch = true, default: defaultValue } = config;
|
|
3
|
+
const urlParams = new URLSearchParams(useSearch ? window.location.search : '');
|
|
4
|
+
return urlParams.get(value) || defaultValue;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export { getQueryString as default };
|
|
8
|
+
//# sourceMappingURL=getQueryString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getQueryString.js","sources":["../../../dist-transpiled/utils/getQueryString.js"],"sourcesContent":["export default function getQueryString(value, config = {}) {\n const { useSearch = true, default: defaultValue } = config;\n const urlParams = new URLSearchParams(useSearch ? window.location.search : '');\n return urlParams.get(value) || defaultValue;\n}\n//# sourceMappingURL=getQueryString.js.map"],"names":[],"mappings":"AAAe,SAAS,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE;AAC3D,IAAI,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,MAAM;AAC9D,IAAI,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,EAAE,CAAC;AAClF,IAAI,OAAO,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,YAAY;AAC/C;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function subscribeToMediaQuery(query, callback) {
|
|
2
|
+
const mediaQueryList = window.matchMedia(query);
|
|
3
|
+
mediaQueryList.addEventListener('change', callback);
|
|
4
|
+
return () => {
|
|
5
|
+
mediaQueryList.removeEventListener('change', callback);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function checkMediaQuery(query) {
|
|
9
|
+
return window.matchMedia(query).matches;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { checkMediaQuery, subscribeToMediaQuery };
|
|
13
|
+
//# sourceMappingURL=mediaQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaQuery.js","sources":["../../../dist-transpiled/utils/mediaQuery.js"],"sourcesContent":["export function subscribeToMediaQuery(query, callback) {\n const mediaQueryList = window.matchMedia(query);\n mediaQueryList.addEventListener('change', callback);\n return () => {\n mediaQueryList.removeEventListener('change', callback);\n };\n}\nexport function checkMediaQuery(query) {\n return window.matchMedia(query).matches;\n}\n//# sourceMappingURL=mediaQuery.js.map"],"names":[],"mappings":"AAAO,SAAS,qBAAqB,CAAC,KAAK,EAAE,QAAQ,EAAE;AACvD,IAAI,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC;AACnD,IAAI,cAAc,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC;AACvD,IAAI,OAAO,MAAM;AACjB,QAAQ,cAAc,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC;AAC9D,IAAI,CAAC;AACL;AACO,SAAS,eAAe,CAAC,KAAK,EAAE;AACvC,IAAI,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO;AAC3C;;;;"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const SAFE_SCHEMES = new Set(['http:', 'https:', 'mailto:', 'tel:']);
|
|
2
|
+
/**
|
|
3
|
+
* Characters the URL parser drops before resolving a URL, so they cannot be used to hide a
|
|
4
|
+
* scheme-relative prefix or a dangerous scheme (e.g. `/<TAB>/evil.com`, `java<TAB>script:`).
|
|
5
|
+
*/
|
|
6
|
+
const IGNORED_CHARS = /[\t\n\r]/g;
|
|
7
|
+
/**
|
|
8
|
+
* Two leading separators in any combination. Browsers treat a leading `\` exactly like a
|
|
9
|
+
* leading `/`, so `//`, `/\`, `\/` and `\\` all resolve to a scheme-relative URL.
|
|
10
|
+
*/
|
|
11
|
+
const SCHEME_RELATIVE = /^[/\\]{2}/;
|
|
12
|
+
const LEADING_SEPARATOR = /^[/\\]/;
|
|
13
|
+
/**
|
|
14
|
+
* Validates a `href` value and returns it only if it is safe to render as a link,
|
|
15
|
+
* preventing XSS through unsafe URL schemes and scheme-relative URLs.
|
|
16
|
+
*
|
|
17
|
+
* Before validating, the value is trimmed and every tab, line feed and carriage return is
|
|
18
|
+
* removed, because the URL parser ignores those characters too and they would otherwise
|
|
19
|
+
* hide an unsafe value from the checks below.
|
|
20
|
+
*
|
|
21
|
+
* A `href` is considered safe when it is either:
|
|
22
|
+
* - An absolute path starting with a single separator (e.g. `/accounts/42`). A leading `\`
|
|
23
|
+
* is normalized to `/` in the returned value, since that is how the browser resolves it.
|
|
24
|
+
* - A URL using one of the allowed schemes: `http:`, `https:`, `mailto:`, `tel:`.
|
|
25
|
+
*
|
|
26
|
+
* A `href` is rejected (returns `undefined`) when it is:
|
|
27
|
+
* - Empty or made only of whitespace/ignored characters (`''`, `' '`).
|
|
28
|
+
* - Scheme-relative (starts with two separators, e.g. `//evil.com`, `/\evil.com`,
|
|
29
|
+
* `/<TAB>/evil.com`), since the browser would resolve it using the current protocol and it
|
|
30
|
+
* can be used to redirect to an attacker-controlled host.
|
|
31
|
+
* - Using a disallowed/dangerous scheme, such as `javascript:` or `data:`
|
|
32
|
+
* (e.g. `javascript:alert(1)`, `data:text/html,<script>...</script>`).
|
|
33
|
+
* - Not parseable as an absolute URL and not an absolute path, such as bare fragments
|
|
34
|
+
* (`#anchor`) or scheme-less relative paths (`relative/path`). These cannot be validated
|
|
35
|
+
* against `SAFE_SCHEMES`, so they are rejected rather than assumed safe.
|
|
36
|
+
*
|
|
37
|
+
* @param href - The raw URL or path to validate, typically coming from user input,
|
|
38
|
+
* a CMS, or an external API.
|
|
39
|
+
* @returns The sanitized `href` when safe, `undefined` otherwise.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* sanitizeHref('/accounts/42'); // '/accounts/42'
|
|
43
|
+
* sanitizeHref('https://example.com'); // 'https://example.com'
|
|
44
|
+
* sanitizeHref('mailto:test@example.com'); // 'mailto:test@example.com'
|
|
45
|
+
* sanitizeHref('//evil.com'); // undefined
|
|
46
|
+
* sanitizeHref('/\\evil.com'); // undefined
|
|
47
|
+
* sanitizeHref('javascript:alert(1)'); // undefined
|
|
48
|
+
*/
|
|
49
|
+
function sanitizeHref(href) {
|
|
50
|
+
const normalized = href.trim().replace(IGNORED_CHARS, '');
|
|
51
|
+
if (!normalized)
|
|
52
|
+
return undefined;
|
|
53
|
+
if (SCHEME_RELATIVE.test(normalized))
|
|
54
|
+
return undefined;
|
|
55
|
+
if (LEADING_SEPARATOR.test(normalized))
|
|
56
|
+
return `/${normalized.slice(1)}`;
|
|
57
|
+
try {
|
|
58
|
+
const { protocol } = new URL(normalized);
|
|
59
|
+
return SAFE_SCHEMES.has(protocol) ? normalized : undefined;
|
|
60
|
+
}
|
|
61
|
+
catch (_a) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { sanitizeHref as default };
|
|
67
|
+
//# sourceMappingURL=sanitizeHref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sanitizeHref.js","sources":["../../../dist-transpiled/utils/sanitizeHref.js"],"sourcesContent":["const SAFE_SCHEMES = new Set(['http:', 'https:', 'mailto:', 'tel:']);\n/**\n * Characters the URL parser drops before resolving a URL, so they cannot be used to hide a\n * scheme-relative prefix or a dangerous scheme (e.g. `/<TAB>/evil.com`, `java<TAB>script:`).\n */\nconst IGNORED_CHARS = /[\\t\\n\\r]/g;\n/**\n * Two leading separators in any combination. Browsers treat a leading `\\` exactly like a\n * leading `/`, so `//`, `/\\`, `\\/` and `\\\\` all resolve to a scheme-relative URL.\n */\nconst SCHEME_RELATIVE = /^[/\\\\]{2}/;\nconst LEADING_SEPARATOR = /^[/\\\\]/;\n/**\n * Validates a `href` value and returns it only if it is safe to render as a link,\n * preventing XSS through unsafe URL schemes and scheme-relative URLs.\n *\n * Before validating, the value is trimmed and every tab, line feed and carriage return is\n * removed, because the URL parser ignores those characters too and they would otherwise\n * hide an unsafe value from the checks below.\n *\n * A `href` is considered safe when it is either:\n * - An absolute path starting with a single separator (e.g. `/accounts/42`). A leading `\\`\n * is normalized to `/` in the returned value, since that is how the browser resolves it.\n * - A URL using one of the allowed schemes: `http:`, `https:`, `mailto:`, `tel:`.\n *\n * A `href` is rejected (returns `undefined`) when it is:\n * - Empty or made only of whitespace/ignored characters (`''`, `' '`).\n * - Scheme-relative (starts with two separators, e.g. `//evil.com`, `/\\evil.com`,\n * `/<TAB>/evil.com`), since the browser would resolve it using the current protocol and it\n * can be used to redirect to an attacker-controlled host.\n * - Using a disallowed/dangerous scheme, such as `javascript:` or `data:`\n * (e.g. `javascript:alert(1)`, `data:text/html,<script>...</script>`).\n * - Not parseable as an absolute URL and not an absolute path, such as bare fragments\n * (`#anchor`) or scheme-less relative paths (`relative/path`). These cannot be validated\n * against `SAFE_SCHEMES`, so they are rejected rather than assumed safe.\n *\n * @param href - The raw URL or path to validate, typically coming from user input,\n * a CMS, or an external API.\n * @returns The sanitized `href` when safe, `undefined` otherwise.\n *\n * @example\n * sanitizeHref('/accounts/42'); // '/accounts/42'\n * sanitizeHref('https://example.com'); // 'https://example.com'\n * sanitizeHref('mailto:test@example.com'); // 'mailto:test@example.com'\n * sanitizeHref('//evil.com'); // undefined\n * sanitizeHref('/\\\\evil.com'); // undefined\n * sanitizeHref('javascript:alert(1)'); // undefined\n */\nexport default function sanitizeHref(href) {\n const normalized = href.trim().replace(IGNORED_CHARS, '');\n if (!normalized)\n return undefined;\n if (SCHEME_RELATIVE.test(normalized))\n return undefined;\n if (LEADING_SEPARATOR.test(normalized))\n return `/${normalized.slice(1)}`;\n try {\n const { protocol } = new URL(normalized);\n return SAFE_SCHEMES.has(protocol) ? normalized : undefined;\n }\n catch (_a) {\n return undefined;\n }\n}\n//# sourceMappingURL=sanitizeHref.js.map"],"names":[],"mappings":"AAAA,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AACpE;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,WAAW;AACjC;AACA;AACA;AACA;AACA,MAAM,eAAe,GAAG,WAAW;AACnC,MAAM,iBAAiB,GAAG,QAAQ;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAAS,YAAY,CAAC,IAAI,EAAE;AAC3C,IAAI,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC;AAC7D,IAAI,IAAI,CAAC,UAAU;AACnB,QAAQ,OAAO,SAAS;AACxB,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC;AACxC,QAAQ,OAAO,SAAS;AACxB,IAAI,IAAI,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;AAC1C,QAAQ,OAAO,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxC,IAAI,IAAI;AACR,QAAQ,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC;AAChD,QAAQ,OAAO,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,UAAU,GAAG,SAAS;AAClE,IAAI;AACJ,IAAI,OAAO,EAAE,EAAE;AACf,QAAQ,OAAO,SAAS;AACxB,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PhoneNumberUtil } from 'google-libphonenumber';
|
|
2
|
+
|
|
3
|
+
const phoneUtil = PhoneNumberUtil.getInstance();
|
|
4
|
+
function validatePhoneNumber(phone) {
|
|
5
|
+
try {
|
|
6
|
+
return phoneUtil.isValidNumber(phoneUtil.parseAndKeepRawInput(phone));
|
|
7
|
+
}
|
|
8
|
+
catch (error) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { validatePhoneNumber as default };
|
|
14
|
+
//# sourceMappingURL=validatePhoneNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validatePhoneNumber.js","sources":["../../../dist-transpiled/utils/validatePhoneNumber.js"],"sourcesContent":["import { PhoneNumberUtil } from 'google-libphonenumber';\nconst phoneUtil = PhoneNumberUtil.getInstance();\nexport default function validatePhoneNumber(phone) {\n try {\n return phoneUtil.isValidNumber(phoneUtil.parseAndKeepRawInput(phone));\n }\n catch (error) {\n return false;\n }\n}\n//# sourceMappingURL=validatePhoneNumber.js.map"],"names":[],"mappings":";;AACA,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,EAAE;AAChC,SAAS,mBAAmB,CAAC,KAAK,EAAE;AACnD,IAAI,IAAI;AACR,QAAQ,OAAO,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;AAC7E,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,OAAO,KAAK;AACpB,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dynamicUi": "2.10.0",
|
|
3
|
+
"lucideReact": "^0.553.0",
|
|
4
|
+
"icons": [
|
|
5
|
+
"AlertCircle",
|
|
6
|
+
"AlertTriangle",
|
|
7
|
+
"Calendar",
|
|
8
|
+
"Check",
|
|
9
|
+
"CheckCircle",
|
|
10
|
+
"ChevronDown",
|
|
11
|
+
"ChevronLeft",
|
|
12
|
+
"ChevronRight",
|
|
13
|
+
"ChevronUp",
|
|
14
|
+
"Eye",
|
|
15
|
+
"EyeOff",
|
|
16
|
+
"Info",
|
|
17
|
+
"Minus",
|
|
18
|
+
"Plus",
|
|
19
|
+
"Search",
|
|
20
|
+
"Upload",
|
|
21
|
+
"X",
|
|
22
|
+
"Circle",
|
|
23
|
+
"CircleCheck",
|
|
24
|
+
"CircleCheckBig",
|
|
25
|
+
"Download",
|
|
26
|
+
"FileText",
|
|
27
|
+
"MoreVertical",
|
|
28
|
+
"Paperclip",
|
|
29
|
+
"RefreshCw",
|
|
30
|
+
"Share2",
|
|
31
|
+
"Trash"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/dist/index.esm.js
CHANGED
|
@@ -25,6 +25,16 @@ import i18n from 'i18next';
|
|
|
25
25
|
import { initReactI18next } from 'react-i18next';
|
|
26
26
|
|
|
27
27
|
const PREFIX_BS = 'bs-';
|
|
28
|
+
/**
|
|
29
|
+
* Default icon-font family configured by `DContextProvider`.
|
|
30
|
+
*
|
|
31
|
+
* `DIconBase` compares the family it receives against these values to tell an
|
|
32
|
+
* unconfigured consumer apart from one that deliberately opted into an icon
|
|
33
|
+
* font (Material Symbols, Bootstrap Icons). Only the former gets the
|
|
34
|
+
* development warning for an unresolved icon name.
|
|
35
|
+
*/
|
|
36
|
+
const DEFAULT_ICON_FAMILY_CLASS = 'bi';
|
|
37
|
+
const DEFAULT_ICON_FAMILY_PREFIX = 'bi-';
|
|
28
38
|
|
|
29
39
|
/* eslint-disable no-lonely-if */
|
|
30
40
|
function useDisableBodyScrollEffect(disable) {
|
|
@@ -306,8 +316,8 @@ const DEFAULT_STATE = {
|
|
|
306
316
|
decimal: '.',
|
|
307
317
|
},
|
|
308
318
|
icon: {
|
|
309
|
-
familyClass:
|
|
310
|
-
familyPrefix:
|
|
319
|
+
familyClass: DEFAULT_ICON_FAMILY_CLASS,
|
|
320
|
+
familyPrefix: DEFAULT_ICON_FAMILY_PREFIX,
|
|
311
321
|
materialStyle: false,
|
|
312
322
|
},
|
|
313
323
|
iconRegistry: undefined,
|
|
@@ -412,6 +422,79 @@ function useDContext() {
|
|
|
412
422
|
return useContext(DContext);
|
|
413
423
|
}
|
|
414
424
|
|
|
425
|
+
/**
|
|
426
|
+
* Resolves a string icon name against the registry supplied through
|
|
427
|
+
* `DContextProvider`'s `iconRegistry` prop.
|
|
428
|
+
*
|
|
429
|
+
* This is the single implementation shared by `DIcon` and `DIconBase`, so both
|
|
430
|
+
* public entry points — and every Dynamic UI component that renders an icon
|
|
431
|
+
* through them — resolve names identically.
|
|
432
|
+
*
|
|
433
|
+
* A non-string `icon` is returned untouched: a component passed directly needs
|
|
434
|
+
* no lookup. A name missing from the registry is also returned untouched, so
|
|
435
|
+
* the caller can fall through to lucide-react and then to the icon-font family.
|
|
436
|
+
*/
|
|
437
|
+
function resolveIconFromRegistry(icon, iconRegistry) {
|
|
438
|
+
if (typeof icon !== 'string')
|
|
439
|
+
return icon;
|
|
440
|
+
return (iconRegistry === null || iconRegistry === void 0 ? void 0 : iconRegistry[icon]) || icon;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Names already reported, so a name repeated across renders or across many
|
|
445
|
+
* instances only warns once per page load.
|
|
446
|
+
*/
|
|
447
|
+
const warnedIconNames = new Set();
|
|
448
|
+
/**
|
|
449
|
+
* True when the icon-font family is the one `DContextProvider` defaults to.
|
|
450
|
+
*
|
|
451
|
+
* The warning is limited to that case so a consumer who configured a different
|
|
452
|
+
* font — Material Symbols, for instance — is not told about names that font
|
|
453
|
+
* resolves perfectly well.
|
|
454
|
+
*
|
|
455
|
+
* It cannot tell "never configured a font" apart from "configured exactly the
|
|
456
|
+
* defaults", and those defaults are also the standard Bootstrap Icons setup, so
|
|
457
|
+
* a consumer who deliberately uses Bootstrap Icons is warned too. The message
|
|
458
|
+
* says so; silencing that case would need a new context flag, which is beyond
|
|
459
|
+
* what this helper should decide.
|
|
460
|
+
*/
|
|
461
|
+
function isDefaultIconFamily(familyClass, familyPrefix) {
|
|
462
|
+
return familyClass === DEFAULT_ICON_FAMILY_CLASS
|
|
463
|
+
&& familyPrefix === DEFAULT_ICON_FAMILY_PREFIX;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Warns, once per name and only outside production builds, that an icon name
|
|
467
|
+
* resolved to neither the registry nor lucide-react and is falling back to the
|
|
468
|
+
* default icon font, which this package no longer ships.
|
|
469
|
+
*
|
|
470
|
+
* Whether that fallback renders depends on the host app: if it loads the font
|
|
471
|
+
* itself the `<i>` shows the glyph, and if it does not, nothing appears. The
|
|
472
|
+
* message states both possibilities instead of assuming the second.
|
|
473
|
+
*
|
|
474
|
+
* The `process.env.NODE_ENV` guard is what bundlers constant-fold, so the whole
|
|
475
|
+
* call — and this module — drops out of a consumer's production bundle.
|
|
476
|
+
*/
|
|
477
|
+
function warnUnknownIcon(name, familyClass, familyPrefix) {
|
|
478
|
+
if (!isDefaultIconFamily(familyClass, familyPrefix))
|
|
479
|
+
return;
|
|
480
|
+
if (warnedIconNames.has(name))
|
|
481
|
+
return;
|
|
482
|
+
warnedIconNames.add(name);
|
|
483
|
+
const fallbackClass = `${DEFAULT_ICON_FAMILY_CLASS} ${DEFAULT_ICON_FAMILY_PREFIX}${name}`;
|
|
484
|
+
// eslint-disable-next-line no-console
|
|
485
|
+
console.warn(`[Dynamic UI] Icon "${name}" is not in the icon registry and is not a `
|
|
486
|
+
+ 'lucide-react export, so it falls back to the default icon font: '
|
|
487
|
+
+ `<i class="${fallbackClass}">. That renders only if your app loads that `
|
|
488
|
+
+ 'font, which this package stopped shipping in v2.0.0. '
|
|
489
|
+
+ 'If the icon is missing, pass a PascalCase lucide-react name such as '
|
|
490
|
+
+ '"Home", or register the component with '
|
|
491
|
+
+ '<DContextProvider iconRegistry={{ MyIcon }}>. '
|
|
492
|
+
+ `If you use the "${DEFAULT_ICON_FAMILY_CLASS}" font on purpose, this is a `
|
|
493
|
+
+ 'false positive: the warning fires whenever the configured family equals '
|
|
494
|
+
+ 'the package default, which is also the standard Bootstrap Icons setup. '
|
|
495
|
+
+ 'It never appears in production builds.');
|
|
496
|
+
}
|
|
497
|
+
|
|
415
498
|
function subscribeToMediaQuery(query, callback) {
|
|
416
499
|
const mediaQueryList = window.matchMedia(query);
|
|
417
500
|
mediaQueryList.addEventListener('change', callback);
|
|
@@ -501,7 +584,31 @@ function useResponsiveProp(useListener = false) {
|
|
|
501
584
|
function isIconComponent(value) {
|
|
502
585
|
return typeof value !== 'string' && isValidElementType(value);
|
|
503
586
|
}
|
|
504
|
-
|
|
587
|
+
/**
|
|
588
|
+
* Renders an icon, resolving the `icon` prop in this order:
|
|
589
|
+
*
|
|
590
|
+
* 1. **Icon registry** — a string name found in `DContextProvider`'s
|
|
591
|
+
* `iconRegistry` renders the component registered under it. A component
|
|
592
|
+
* passed directly skips this step and renders as-is.
|
|
593
|
+
* 2. **lucide-react** — a PascalCase name exported by lucide-react renders that
|
|
594
|
+
* icon. When `materialStyle` is on, this step is skipped and the name is
|
|
595
|
+
* emitted as the text content of the icon-font element instead.
|
|
596
|
+
* 3. **Icon-font family** — anything left over renders as
|
|
597
|
+
* `<i class="{familyClass} {familyPrefix}{name}">`, the legacy path for
|
|
598
|
+
* Material Symbols and Bootstrap Icons. Outside production builds, a name
|
|
599
|
+
* that reaches this step while the family is still the package default logs
|
|
600
|
+
* a one-time warning.
|
|
601
|
+
*
|
|
602
|
+
* A name that resolves nowhere and has no family configured renders `?`.
|
|
603
|
+
*
|
|
604
|
+
* Every path is hidden from the accessibility tree by default (`aria-hidden`),
|
|
605
|
+
* since icons are overwhelmingly decorative. See `ariaHidden` / `ariaLabel` to
|
|
606
|
+
* override that for an icon that carries meaning on its own.
|
|
607
|
+
*/
|
|
608
|
+
function DIconBase({ icon: iconProp, color, style, className, size, useListenerSize = false, hasCircle = false, materialStyle = false, familyClass, familyPrefix, strokeWidth = 2, ariaHidden, ariaLabel, dataAttributes, }) {
|
|
609
|
+
const { iconRegistry } = useDContext();
|
|
610
|
+
// The registry wins over every other source, including Material icons.
|
|
611
|
+
const icon = resolveIconFromRegistry(iconProp, iconRegistry);
|
|
505
612
|
// If materialStyle is true, use Material Design icons (legacy)
|
|
506
613
|
const isStringIcon = typeof icon === 'string';
|
|
507
614
|
const useMaterialIcons = materialStyle && isStringIcon;
|
|
@@ -523,6 +630,61 @@ function DIconBase({ icon, color, style, className, size, useListenerSize = fals
|
|
|
523
630
|
}, [responsivePropValue, size]);
|
|
524
631
|
const generateStyleVariables = useMemo(() => (Object.assign(Object.assign(Object.assign({}, resolvedSize && { [`--${PREFIX_BS}icon-component-size`]: resolvedSize }), hasCircle && { [`--${PREFIX_BS}icon-component-padding`]: `calc(var(--${PREFIX_BS}icon-component-size, 24px) * 0.4)` }), style)), [resolvedSize, hasCircle, style]);
|
|
525
632
|
const generateClasses = useMemo(() => (Object.assign(Object.assign(Object.assign({ 'd-icon': true }, className && { [className]: true }), { 'd-icon-has-circle': hasCircle }), color && { [`d-icon-color-${color}`]: true })), [className, hasCircle, color]);
|
|
633
|
+
/**
|
|
634
|
+
* Decorative by default. `ariaHidden` and `ariaLabel` are not symmetric:
|
|
635
|
+
* hiding is absolute, so `ariaHidden` wins over a name, but `ariaHidden={false}`
|
|
636
|
+
* and `ariaLabel` agree — both expose the icon — and the name is honoured.
|
|
637
|
+
*/
|
|
638
|
+
const accessibilityProps = useMemo(() => {
|
|
639
|
+
// Hiding is absolute: it wins over a name.
|
|
640
|
+
if (ariaHidden === true)
|
|
641
|
+
return { 'aria-hidden': true };
|
|
642
|
+
// A name exposes the icon, which is also what `ariaHidden={false}` asks for.
|
|
643
|
+
if (ariaLabel)
|
|
644
|
+
return { role: 'img', 'aria-label': ariaLabel };
|
|
645
|
+
// Exposed with no name: an explicit opt-out of the default, warned about below.
|
|
646
|
+
if (ariaHidden === false)
|
|
647
|
+
return {};
|
|
648
|
+
return { 'aria-hidden': true };
|
|
649
|
+
}, [ariaHidden, ariaLabel]);
|
|
650
|
+
/**
|
|
651
|
+
* `dataAttributes` is typed to `data-*`, but casting through it was the only
|
|
652
|
+
* way to reach the DOM before `ariaHidden` existed, so it still wins over the
|
|
653
|
+
* computed values — and therefore decides the effective state below.
|
|
654
|
+
*/
|
|
655
|
+
const domAttributes = useMemo(() => (Object.assign(Object.assign({}, accessibilityProps), dataAttributes)), [accessibilityProps, dataAttributes]);
|
|
656
|
+
/**
|
|
657
|
+
* lucide-react hides its own `<svg>` unless it receives an a11y prop, and a
|
|
658
|
+
* registry component may do the same, which would keep the graphic out of the
|
|
659
|
+
* tree even when this wrapper is not hidden. Only matters when the icon is
|
|
660
|
+
* exposed without a name: under `role="img"` the wrapper is a leaf, so a
|
|
661
|
+
* hidden child changes nothing.
|
|
662
|
+
*
|
|
663
|
+
* A registry component that hardcodes `aria-hidden` on its own `<svg>` instead
|
|
664
|
+
* of spreading props still wins — nothing here can reach inside it.
|
|
665
|
+
*/
|
|
666
|
+
const isExposedWithoutName = useMemo(() => {
|
|
667
|
+
const attributes = domAttributes;
|
|
668
|
+
const hidden = attributes['aria-hidden'];
|
|
669
|
+
return hidden !== true && hidden !== 'true' && !attributes.role;
|
|
670
|
+
}, [domAttributes]);
|
|
671
|
+
/**
|
|
672
|
+
* Diagnostics read the effective state, so a `dataAttributes` override that
|
|
673
|
+
* hides the icon after all is not reported as exposing it. Memoised like the
|
|
674
|
+
* values above, so re-rendering with the same props does not repeat them.
|
|
675
|
+
*/
|
|
676
|
+
useMemo(() => {
|
|
677
|
+
if (process.env.NODE_ENV === 'production')
|
|
678
|
+
return;
|
|
679
|
+
if (ariaHidden === true && ariaLabel) {
|
|
680
|
+
// eslint-disable-next-line no-console
|
|
681
|
+
console.warn(`DIcon: ariaLabel "${ariaLabel}" is ignored because ariaHidden is true. Drop ariaHidden to expose the name.`);
|
|
682
|
+
}
|
|
683
|
+
if (ariaHidden === false && isExposedWithoutName) {
|
|
684
|
+
// eslint-disable-next-line no-console
|
|
685
|
+
console.warn('DIcon: ariaHidden={false} without an ariaLabel exposes an unnamed graphic to assistive technology. Pass ariaLabel to name it.');
|
|
686
|
+
}
|
|
687
|
+
}, [ariaHidden, ariaLabel, isExposedWithoutName]);
|
|
526
688
|
const iconSize = useMemo(() => {
|
|
527
689
|
if (resolvedSize) {
|
|
528
690
|
const numSize = parseInt(resolvedSize, 10);
|
|
@@ -532,35 +694,38 @@ function DIconBase({ icon, color, style, className, size, useListenerSize = fals
|
|
|
532
694
|
}, [resolvedSize]);
|
|
533
695
|
// Render Material Design icon (legacy support)
|
|
534
696
|
if (useMaterialIcons) {
|
|
535
|
-
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables },
|
|
697
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass), style: generateStyleVariables }, domAttributes, { children: isStringIcon ? icon : null })));
|
|
536
698
|
}
|
|
537
699
|
if (isIconComponent(icon)) {
|
|
538
|
-
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables },
|
|
539
|
-
width: resolvedSize || 24,
|
|
540
|
-
height: resolvedSize || 24,
|
|
541
|
-
strokeWidth,
|
|
542
|
-
}) })));
|
|
700
|
+
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, domAttributes, { children: createElement(icon, Object.assign({ width: resolvedSize || 24, height: resolvedSize || 24, strokeWidth }, isExposedWithoutName && { 'aria-hidden': false })) })));
|
|
543
701
|
}
|
|
544
702
|
// Render Lucide icon
|
|
545
703
|
if (!LucideIcon) {
|
|
546
|
-
if (
|
|
547
|
-
|
|
704
|
+
if (typeof icon === 'string' && familyClass && familyPrefix) {
|
|
705
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
706
|
+
warnUnknownIcon(icon, familyClass, familyPrefix);
|
|
707
|
+
}
|
|
708
|
+
return (jsx("i", Object.assign({ className: classNames(generateClasses, familyClass, `${familyPrefix}${icon}`), style: generateStyleVariables }, domAttributes)));
|
|
548
709
|
}
|
|
549
710
|
// eslint-disable-next-line no-console
|
|
550
711
|
console.warn(`Icon "${String(icon)}" not found in Lucide. Make sure to use PascalCase names (e.g., "Home", "User", "Settings")`);
|
|
551
|
-
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables },
|
|
712
|
+
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, domAttributes, { children: "?" })));
|
|
552
713
|
}
|
|
553
|
-
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables },
|
|
714
|
+
return (jsx("span", Object.assign({ className: classNames(generateClasses), style: generateStyleVariables }, domAttributes, { children: jsx(LucideIcon, Object.assign({ size: iconSize || 24, strokeWidth: strokeWidth }, isExposedWithoutName && { 'aria-hidden': false })) })));
|
|
554
715
|
}
|
|
555
716
|
|
|
717
|
+
/**
|
|
718
|
+
* Thin wrapper over `DIconBase` that fills the icon-font configuration
|
|
719
|
+
* (`familyClass`, `familyPrefix`, `materialStyle`) from `DContextProvider`
|
|
720
|
+
* whenever the caller does not pass it explicitly.
|
|
721
|
+
*
|
|
722
|
+
* Name resolution itself — registry, then lucide-react, then the icon-font
|
|
723
|
+
* family — lives in `DIconBase`, so both components behave identically.
|
|
724
|
+
*/
|
|
556
725
|
function DIcon(_a) {
|
|
557
726
|
var { icon, familyClass: propFamilyClass, familyPrefix: propFamilyPrefix, materialStyle: propMaterialStyle } = _a, props = __rest(_a, ["icon", "familyClass", "familyPrefix", "materialStyle"]);
|
|
558
|
-
const { icon: { familyClass, familyPrefix, materialStyle, },
|
|
559
|
-
|
|
560
|
-
? iconRegistry === null || iconRegistry === void 0 ? void 0 : iconRegistry[icon]
|
|
561
|
-
: undefined;
|
|
562
|
-
const resolvedIcon = registryIcon || icon;
|
|
563
|
-
return (jsx(DIconBase, Object.assign({ icon: resolvedIcon, familyClass: propFamilyClass !== null && propFamilyClass !== void 0 ? propFamilyClass : familyClass, familyPrefix: propFamilyPrefix !== null && propFamilyPrefix !== void 0 ? propFamilyPrefix : familyPrefix, materialStyle: propMaterialStyle !== null && propMaterialStyle !== void 0 ? propMaterialStyle : materialStyle }, props)));
|
|
727
|
+
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
728
|
+
return (jsx(DIconBase, Object.assign({ icon: icon, familyClass: propFamilyClass !== null && propFamilyClass !== void 0 ? propFamilyClass : familyClass, familyPrefix: propFamilyPrefix !== null && propFamilyPrefix !== void 0 ? propFamilyPrefix : familyPrefix, materialStyle: propMaterialStyle !== null && propMaterialStyle !== void 0 ? propMaterialStyle : materialStyle }, props)));
|
|
564
729
|
}
|
|
565
730
|
|
|
566
731
|
function DAlert({ color = 'success', icon: iconProp, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconClose: iconCloseProp, iconCloseFamilyClass, iconCloseFamilyPrefix, iconCloseMaterialStyle, showClose, onClose, children, id, className, style, dataAttributes, }) {
|
|
@@ -702,7 +867,7 @@ function DInput(_a, ref) {
|
|
|
702
867
|
[`input-group-${size}`]: !!size,
|
|
703
868
|
'input-group': true,
|
|
704
869
|
'has-validation': invalid || valid,
|
|
705
|
-
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (onIconStartClick ? (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel || (typeof iconStart === 'string' ? iconStart : 'start icon'), tabIndex: iconStartTabIndex, children: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass !== null && iconStartFamilyClass !== void 0 ? iconStartFamilyClass : familyClass, familyPrefix: iconStartFamilyPrefix !== null && iconStartFamilyPrefix !== void 0 ? iconStartFamilyPrefix : familyPrefix, materialStyle: iconStartMaterialStyle !== null && iconStartMaterialStyle !== void 0 ? iconStartMaterialStyle : materialStyle }) })) : (jsx("div", { className: "input-group-text", id: `${id}Start`,
|
|
870
|
+
}), children: [!!inputStart && (jsx("div", { className: "input-group-text", id: `${id}InputStart`, children: inputStart })), iconStart && (onIconStartClick ? (jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading || iconStartDisabled, "aria-label": iconStartAriaLabel || (typeof iconStart === 'string' ? iconStart : 'start icon'), tabIndex: iconStartTabIndex, children: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass !== null && iconStartFamilyClass !== void 0 ? iconStartFamilyClass : familyClass, familyPrefix: iconStartFamilyPrefix !== null && iconStartFamilyPrefix !== void 0 ? iconStartFamilyPrefix : familyPrefix, materialStyle: iconStartMaterialStyle !== null && iconStartMaterialStyle !== void 0 ? iconStartMaterialStyle : materialStyle }) })) : (jsx("div", { className: "input-group-text", id: `${id}Start`, tabIndex: -1, children: jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass !== null && iconStartFamilyClass !== void 0 ? iconStartFamilyClass : familyClass, familyPrefix: iconStartFamilyPrefix !== null && iconStartFamilyPrefix !== void 0 ? iconStartFamilyPrefix : familyPrefix, materialStyle: iconStartMaterialStyle !== null && iconStartMaterialStyle !== void 0 ? iconStartMaterialStyle : materialStyle }) }))), dynamicComponent, (iconEnd && !loading) && (onIconEndClick ? (jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading || iconEndDisabled, "aria-label": iconEndAriaLabel || (typeof iconEnd === 'string' ? iconEnd : 'end icon'), tabIndex: iconEndTabIndex, children: jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass !== null && iconEndFamilyClass !== void 0 ? iconEndFamilyClass : familyClass, familyPrefix: iconEndFamilyPrefix !== null && iconEndFamilyPrefix !== void 0 ? iconEndFamilyPrefix : familyPrefix, materialStyle: iconEndMaterialStyle !== null && iconEndMaterialStyle !== void 0 ? iconEndMaterialStyle : materialStyle }) })) : (jsx("div", { className: "input-group-text", id: `${id}End`, tabIndex: -1, children: jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass !== null && iconEndFamilyClass !== void 0 ? iconEndFamilyClass : familyClass, familyPrefix: iconEndFamilyPrefix !== null && iconEndFamilyPrefix !== void 0 ? iconEndFamilyPrefix : familyPrefix, materialStyle: iconEndMaterialStyle !== null && iconEndMaterialStyle !== void 0 ? iconEndMaterialStyle : materialStyle }) }))), loading && (jsx("div", { className: "input-group-text", id: `${id}Loading`, children: jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", "data-testid": "loading-spinner", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }) })), !!inputEnd && (jsx("div", { className: "input-group-text", id: `${id}InputEnd`, children: inputEnd }))] }), hint && (jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] })));
|
|
706
871
|
}
|
|
707
872
|
const ForwardedDInput = forwardRef(DInput);
|
|
708
873
|
ForwardedDInput.displayName = 'DInput';
|
|
@@ -1185,6 +1350,44 @@ const DButton = forwardRef((props, ref) => {
|
|
|
1185
1350
|
});
|
|
1186
1351
|
DButton.displayName = 'DButton';
|
|
1187
1352
|
|
|
1353
|
+
/**
|
|
1354
|
+
* Controls already reported, keyed by kind and icon, so the same unlabelled one
|
|
1355
|
+
* only warns once per page load however often it re-renders or however many
|
|
1356
|
+
* instances exist.
|
|
1357
|
+
*/
|
|
1358
|
+
const warnedControls = new Set();
|
|
1359
|
+
/**
|
|
1360
|
+
* Warns, once per icon and only outside production builds, that an icon-only
|
|
1361
|
+
* button has no accessible name.
|
|
1362
|
+
*
|
|
1363
|
+
* The control has no text to fall back on and its icon is hidden from the
|
|
1364
|
+
* accessibility tree, so the name has to be given explicitly. `aria-label` is
|
|
1365
|
+
* the direct way; on a button `aria-labelledby` and `title` count too, since
|
|
1366
|
+
* `rest` reaches the DOM there, while an anchor drops them — hence `kind`, so
|
|
1367
|
+
* the advice matches what the element can actually receive.
|
|
1368
|
+
*
|
|
1369
|
+
* A legacy icon-font icon used to leak its ligature as the name by accident —
|
|
1370
|
+
* never a good one, being unlocalised and often meaningless ("more_vert") — and
|
|
1371
|
+
* no longer does, so the omission is now visible instead of silent.
|
|
1372
|
+
*
|
|
1373
|
+
* The `process.env.NODE_ENV` guard is what bundlers constant-fold, so the whole
|
|
1374
|
+
* call — and this module — drops out of a consumer's production bundle.
|
|
1375
|
+
*/
|
|
1376
|
+
function warnMissingAccessibleName(icon, kind) {
|
|
1377
|
+
const key = `${kind}:${icon}`;
|
|
1378
|
+
if (warnedControls.has(key))
|
|
1379
|
+
return;
|
|
1380
|
+
warnedControls.add(key);
|
|
1381
|
+
const alternatives = kind === 'button'
|
|
1382
|
+
? 'On a button, aria-labelledby or title work too. '
|
|
1383
|
+
: 'A link renders from the href branch, which does not forward aria-labelledby or title, so aria-label is the only option. ';
|
|
1384
|
+
// eslint-disable-next-line no-console
|
|
1385
|
+
console.warn(`[Dynamic UI] DButtonIcon: the "${icon}" ${kind} has no accessible name. `
|
|
1386
|
+
+ 'Pass aria-label, since an icon-only control has no text to fall back on '
|
|
1387
|
+
+ `and its icon is hidden from the accessibility tree. ${alternatives}`
|
|
1388
|
+
+ 'It never appears in production builds.');
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1188
1391
|
function DButtonIcon(_a) {
|
|
1189
1392
|
var { id, icon, size, className, variant, state, loadingAriaLabel, iconMaterialStyle, disabled = false, color = 'primary', loading = false, href, target, rel, stopPropagationEnabled = true, style, iconFamilyClass, iconFamilyPrefix, dataAttributes, onClick, 'aria-label': ariaLabelProp } = _a, rest = __rest(_a, ["id", "icon", "size", "className", "variant", "state", "loadingAriaLabel", "iconMaterialStyle", "disabled", "color", "loading", "href", "target", "rel", "stopPropagationEnabled", "style", "iconFamilyClass", "iconFamilyPrefix", "dataAttributes", "onClick", 'aria-label']);
|
|
1190
1393
|
const { icon: { familyClass, familyPrefix, materialStyle, }, } = useDContext();
|
|
@@ -1208,6 +1411,15 @@ function DButtonIcon(_a) {
|
|
|
1208
1411
|
const ariaLabel = useMemo(() => (loading
|
|
1209
1412
|
? loadingAriaLabel || ariaLabelProp
|
|
1210
1413
|
: ariaLabelProp), [loading, loadingAriaLabel, ariaLabelProp]);
|
|
1414
|
+
/**
|
|
1415
|
+
* `aria-labelledby` and `title` also name a control, but they travel in `rest`,
|
|
1416
|
+
* which only the button branch spreads — an anchor drops them, so there the
|
|
1417
|
+
* button really is unnamed and the warning still applies.
|
|
1418
|
+
*/
|
|
1419
|
+
const hasAccessibleName = useMemo(() => !!ariaLabel || (!href && (!!rest['aria-labelledby'] || !!rest.title)), [ariaLabel, href, rest]);
|
|
1420
|
+
if (process.env.NODE_ENV !== 'production' && !hasAccessibleName) {
|
|
1421
|
+
warnMissingAccessibleName(icon, href ? 'link' : 'button');
|
|
1422
|
+
}
|
|
1211
1423
|
if (href) {
|
|
1212
1424
|
return (jsx("a", Object.assign({ id: id, href: href, target: target, rel: rel, className: classNames(generateClasses, className), style: style, onClick: clickHandler, "aria-label": ariaLabel, "aria-disabled": isDisabled }, dataAttributes, { children: loading
|
|
1213
1425
|
? (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }))
|
|
@@ -2697,7 +2909,7 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
|
|
|
2697
2909
|
function DTimeline({ className, style, dataAttributes, items, }) {
|
|
2698
2910
|
return (jsx("div", Object.assign({ style: style, className: classNames('d-timeline', className) }, dataAttributes, { children: items.map((item, index) => (jsxs("div", { className: classNames('d-timeline-item', {
|
|
2699
2911
|
[`d-timeline-item-${item.status}`]: item.status,
|
|
2700
|
-
}), children: [jsx("div", { className: "d-timeline-item-connector" }), jsx("div", { className: "d-timeline-item-icon", children: jsx(DIcon, { icon: item.icon || '
|
|
2912
|
+
}), children: [jsx("div", { className: "d-timeline-item-connector" }), jsx("div", { className: "d-timeline-item-icon", children: jsx(DIcon, { icon: item.icon || 'Check', size: "1rem" }) }), jsxs("div", { className: "d-timeline-item-content", children: [jsx("div", { className: "d-timeline-item-title", children: item.title }), item.description && jsx("div", { className: "d-timeline-item-description", children: item.description }), item.time && jsx("div", { className: "d-timeline-item-time", children: item.time }), item.children] })] }, index))) })));
|
|
2701
2913
|
}
|
|
2702
2914
|
|
|
2703
2915
|
const TabContext = createContext(undefined);
|
|
@@ -3742,5 +3954,58 @@ function DConfirmModalContainer({ nodeId }) {
|
|
|
3742
3954
|
return createPortal(jsx(AnimatePresence, { children: entries.map((entry) => (jsxs(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0, transition: { delay: 0.3 } }, transition: { duration: 0.15, ease: 'linear' }, children: [jsx("div", { className: "backdrop backdrop-confirm-modal", onClick: entry.onCloseAction, role: "presentation" }), jsx(DConfirmModalUI, { entry: entry })] }, entry.id))) }), portalNode);
|
|
3743
3955
|
}
|
|
3744
3956
|
|
|
3745
|
-
|
|
3957
|
+
/**
|
|
3958
|
+
* The lucide-react icons Dynamic UI renders on its own, without the consumer
|
|
3959
|
+
* asking for them by name.
|
|
3960
|
+
*
|
|
3961
|
+
* Two sources feed this list:
|
|
3962
|
+
*
|
|
3963
|
+
* - The `iconMap` defaults of `DContextProvider` (`src/contexts/DContext.tsx`),
|
|
3964
|
+
* used by close buttons, chevrons, alert states, input adornments and the
|
|
3965
|
+
* stepper checkmark.
|
|
3966
|
+
* - Names hard-coded in component JSX or in a prop default, such as
|
|
3967
|
+
* `DDropdown`'s toggle or `DVoucher`'s action buttons.
|
|
3968
|
+
*
|
|
3969
|
+
* Any bundler-level optimisation that narrows lucide-react down to the icons a
|
|
3970
|
+
* widget actually uses must keep this set, or Dynamic UI components break for
|
|
3971
|
+
* reasons the widget author cannot see in their own source. That is why the
|
|
3972
|
+
* list ships in the package as `dist/icons-core.json` and is exported here.
|
|
3973
|
+
*
|
|
3974
|
+
* `src/icons/coreIcons.spec.ts` scans `src/components/**` and fails when an
|
|
3975
|
+
* internally used icon name is missing from this list or absent from
|
|
3976
|
+
* lucide-react, so the two cannot drift apart.
|
|
3977
|
+
*/
|
|
3978
|
+
const CORE_LUCIDE_ICONS = [
|
|
3979
|
+
// iconMap defaults — src/contexts/DContext.tsx
|
|
3980
|
+
'AlertCircle',
|
|
3981
|
+
'AlertTriangle',
|
|
3982
|
+
'Calendar',
|
|
3983
|
+
'Check',
|
|
3984
|
+
'CheckCircle',
|
|
3985
|
+
'ChevronDown',
|
|
3986
|
+
'ChevronLeft',
|
|
3987
|
+
'ChevronRight',
|
|
3988
|
+
'ChevronUp',
|
|
3989
|
+
'Eye',
|
|
3990
|
+
'EyeOff',
|
|
3991
|
+
'Info',
|
|
3992
|
+
'Minus',
|
|
3993
|
+
'Plus',
|
|
3994
|
+
'Search',
|
|
3995
|
+
'Upload',
|
|
3996
|
+
'X',
|
|
3997
|
+
// Hard-coded in component JSX or in a prop default
|
|
3998
|
+
'Circle',
|
|
3999
|
+
'CircleCheck',
|
|
4000
|
+
'CircleCheckBig',
|
|
4001
|
+
'Download',
|
|
4002
|
+
'FileText',
|
|
4003
|
+
'MoreVertical',
|
|
4004
|
+
'Paperclip',
|
|
4005
|
+
'RefreshCw',
|
|
4006
|
+
'Share2',
|
|
4007
|
+
'Trash',
|
|
4008
|
+
];
|
|
4009
|
+
|
|
4010
|
+
export { CORE_LUCIDE_ICONS, DAlert, DAvatar, DBadge, DBox, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DConfirmModalContainer, DContext, DContextProvider, DCreditCard, DCurrencyText, DDataStateWrapper, DDatePicker, DDropdown, DErrorBoundary, DIcon, DIconBase, ForwardedDInput as DInput, DInputCheck, ForwardedDInputCounter as DInputCounter, ForwardedDInputCurrency as DInputCurrency, ForwardedDInputMask as DInputMask, ForwardedDInputPassword as DInputPassword, ForwardedDInputPhone as DInputPhone, DInputPin, ForwardedDInputRange as DInputRange, ForwardedDInputSearch as DInputSearch, DInputSelect, DInputSwitch, DLayout$1 as DLayout, DLayoutPane, DListGroup$1 as DListGroup, DListGroupItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DOtp, DPaginator, DPasswordStrengthMeter, DPopover, DProgress, DSelect$1 as DSelect, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTabs$1 as DTabs, DTimeline, DToast$1 as DToast, DToastContainer, DTooltip, DVoucher, EmptyState, ErrorState, LoadingState, buildUrl, changeQueryString, checkMediaQuery, configureI8n as configureI18n, formatCurrency, getCssVariable, getQueryString, sanitizeHref, subscribeToMediaQuery, useConfirmModal, useCountdown, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, useMediaBreakpointUpLg, useMediaBreakpointUpMd, useMediaBreakpointUpSm, useMediaBreakpointUpXl, useMediaBreakpointUpXs, useMediaBreakpointUpXxl, useMediaQuery, useOtp, useProvidedRefOrCreate, useScreenshot, useScreenshotDownload, useScreenshotWebShare, useStackState, useTabContext, validatePhoneNumber };
|
|
3746
4011
|
//# sourceMappingURL=index.esm.js.map
|