@dynamic-framework/ui-react 2.0.0-dev.21 → 2.0.0-dev.23

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.
Files changed (28) hide show
  1. package/dist/css/dynamic-ui-non-root.css +13222 -2
  2. package/dist/css/dynamic-ui-non-root.min.css +3 -3
  3. package/dist/css/dynamic-ui-root.css +2 -2
  4. package/dist/css/dynamic-ui-root.min.css +2 -2
  5. package/dist/css/dynamic-ui.css +13222 -2
  6. package/dist/css/dynamic-ui.min.css +3 -3
  7. package/dist/index.esm.js +149 -13
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +157 -12
  10. package/dist/index.js.map +1 -1
  11. package/dist/types/components/DButton/DButton.d.ts +4 -1
  12. package/dist/types/components/DButtonIcon/DButtonIcon.d.ts +5 -2
  13. package/dist/types/components/DCreditCard/DCreditCard.d.ts +2 -1
  14. package/dist/types/components/DDataStateWrapper/DDataStateWrapper.d.ts +14 -0
  15. package/dist/types/components/DDataStateWrapper/components/EmptyState.d.ts +8 -0
  16. package/dist/types/components/DDataStateWrapper/components/ErrorState.d.ts +8 -0
  17. package/dist/types/components/DDataStateWrapper/components/LoadingState.d.ts +6 -0
  18. package/dist/types/components/DDataStateWrapper/index.d.ts +2 -0
  19. package/dist/types/components/DErrorBoundary/DErrorBoundary.d.ts +11 -0
  20. package/dist/types/components/DErrorBoundary/components/DefaultErrorBoundary.d.ts +6 -0
  21. package/dist/types/components/DErrorBoundary/index.d.ts +3 -0
  22. package/dist/types/components/DVoucher/DVoucher.d.ts +5 -4
  23. package/dist/types/components/index.d.ts +2 -0
  24. package/package.json +3 -2
  25. package/src/style/abstracts/_utilities-dark.scss +72 -0
  26. package/src/style/components/_d-voucher.scss +1 -0
  27. package/src/style/dynamic-ui-non-root.scss +2 -0
  28. package/src/style/dynamic-ui.scss +1 -0
package/dist/index.esm.js CHANGED
@@ -18,21 +18,58 @@ import { Toaster, toast } from 'react-hot-toast';
18
18
  import { defaultCountries, parseCountry, usePhoneInput, CountrySelector } from 'react-international-phone';
19
19
  import { PhoneNumberUtil } from 'google-libphonenumber';
20
20
  import html2canvas from 'html2canvas';
21
+ import { getErrorMessage, ErrorBoundary } from 'react-error-boundary';
22
+ export { getErrorMessage, useErrorBoundary } from 'react-error-boundary';
21
23
  import i18n from 'i18next';
22
24
  import { initReactI18next } from 'react-i18next';
23
25
 
24
26
  const PREFIX_BS = 'bs-';
25
27
 
28
+ /* eslint-disable no-lonely-if */
26
29
  function useDisableBodyScrollEffect(disable) {
27
30
  useEffect(() => {
28
- if (disable) {
31
+ let observer;
32
+ let timer;
33
+ const lock = () => {
34
+ const { clientWidth } = document.documentElement;
35
+ const { innerWidth } = window;
36
+ const scrollbarWidth = clientWidth ? innerWidth - clientWidth : 0;
29
37
  document.body.style.overflow = 'hidden';
30
- document.body.style.paddingRight = '0';
38
+ document.body.style.paddingRight = `${Math.max(0, scrollbarWidth)}px`;
39
+ };
40
+ const unlock = () => {
41
+ document.body.style.overflow = 'unset';
42
+ document.body.style.paddingRight = '0px';
43
+ };
44
+ if (disable) {
45
+ lock();
31
46
  }
32
47
  else {
33
- document.body.style.overflow = 'unset';
34
- document.body.style.paddingRight = 'unset';
48
+ // Wait until all portal elements are removed (exit animations done)
49
+ if (document.querySelector('.portal')) {
50
+ observer = new MutationObserver(() => {
51
+ if (!document.querySelector('.portal')) {
52
+ unlock();
53
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
54
+ }
55
+ });
56
+ observer.observe(document.body, { childList: true, subtree: true });
57
+ // Fallback in case observer misses changes
58
+ timer = window.setTimeout(() => {
59
+ unlock();
60
+ observer === null || observer === void 0 ? void 0 : observer.disconnect();
61
+ }, 3000);
62
+ }
63
+ else {
64
+ unlock();
65
+ }
35
66
  }
67
+ return () => {
68
+ if (observer)
69
+ observer.disconnect();
70
+ if (timer)
71
+ window.clearTimeout(timer);
72
+ };
36
73
  }, [disable]);
37
74
  }
38
75
 
@@ -966,7 +1003,7 @@ function DBoxFile(_a) {
966
1003
  }
967
1004
 
968
1005
  const DButton = forwardRef((props, ref) => {
969
- const { color = 'primary', size, variant, text, children, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, loading = false, loadingText, loadingAriaLabel, disabled = false, className, style, dataAttributes, onClick, type = 'button' } = props, rest = __rest(props, ["color", "size", "variant", "text", "children", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartMaterialStyle", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndMaterialStyle", "loading", "loadingText", "loadingAriaLabel", "disabled", "className", "style", "dataAttributes", "onClick", "type"]);
1006
+ const { color = 'primary', size, variant, text, children, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartMaterialStyle, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndMaterialStyle, loading = false, loadingText, loadingAriaLabel, disabled = false, className, style, dataAttributes, onClick, type = 'button', target, rel } = props, rest = __rest(props, ["color", "size", "variant", "text", "children", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartMaterialStyle", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndMaterialStyle", "loading", "loadingText", "loadingAriaLabel", "disabled", "className", "style", "dataAttributes", "onClick", "type", "target", "rel"]);
970
1007
  const [buttonWidth, setButtonWidth] = useState();
971
1008
  const buttonRef = useRef(null);
972
1009
  const isDisabled = useMemo(() => disabled || loading, [disabled, loading]);
@@ -1003,6 +1040,19 @@ const DButton = forwardRef((props, ref) => {
1003
1040
  }
1004
1041
  // eslint-disable-next-line react-hooks/exhaustive-deps
1005
1042
  }, [content, iconEnd, iconStart]);
1043
+ if (props.href) {
1044
+ return (jsxs("a", Object.assign({ href: props.href, target: target, rel: rel, ref: (node) => {
1045
+ buttonRef.current = node;
1046
+ if (typeof ref === 'function')
1047
+ ref(node);
1048
+ // eslint-disable-next-line max-len
1049
+ // eslint-disable-next-line no-param-reassign, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
1050
+ else if (ref)
1051
+ ref.current = node;
1052
+ }, className: classNames(classes, className), style: Object.assign(Object.assign({}, style), (loading && buttonWidth
1053
+ ? { minWidth: `${buttonWidth}px` }
1054
+ : undefined)), "aria-label": ariaLabel, "aria-busy": loading, "aria-disabled": isDisabled, onClick: handleClick }, dataAttributes, { children: [loading && (jsxs("span", { className: "btn-loading", children: [jsx("span", { className: "spinner-border spinner-border-sm", "aria-hidden": "true" }), loadingText && jsx("span", { role: "status", children: loadingText })] })), !loading && (jsxs(Fragment, { children: [iconStart && (jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), content, iconEnd && (jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] }))] })));
1055
+ }
1006
1056
  return (jsxs("button", Object.assign({ ref: (node) => {
1007
1057
  buttonRef.current = node;
1008
1058
  if (typeof ref === 'function')
@@ -1019,23 +1069,32 @@ const DButton = forwardRef((props, ref) => {
1019
1069
  });
1020
1070
  DButton.displayName = 'DButton';
1021
1071
 
1022
- function DButtonIcon({ id, icon, size, className, variant, state, loadingAriaLabel, iconMaterialStyle, ariaLabel, color = 'primary', type = 'button', loading = false, disabled = false, stopPropagationEnabled = true, style, iconFamilyClass, iconFamilyPrefix, dataAttributes, onClick, }) {
1072
+ function DButtonIcon({ id, icon, size, className, variant, state, loadingAriaLabel, iconMaterialStyle, ariaLabel, color = 'primary', type = 'button', loading = false, disabled = false, href, target, rel, stopPropagationEnabled = true, style, iconFamilyClass, iconFamilyPrefix, dataAttributes, onClick, }) {
1023
1073
  const generateClasses = useMemo(() => {
1024
1074
  const variantClass = variant
1025
1075
  ? `btn-${variant}-${color}`
1026
1076
  : `btn-${color}`;
1027
1077
  return Object.assign(Object.assign(Object.assign({ 'btn d-button-icon': true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
1028
1078
  }, [variant, color, size, state, loading]);
1079
+ const isDisabled = useMemo(() => (state === 'disabled' || loading || disabled), [state, loading, disabled]);
1029
1080
  const clickHandler = useCallback((event) => {
1030
1081
  if (stopPropagationEnabled) {
1031
1082
  event.stopPropagation();
1032
1083
  }
1084
+ if (isDisabled) {
1085
+ event.preventDefault();
1086
+ return;
1087
+ }
1033
1088
  onClick === null || onClick === void 0 ? void 0 : onClick(event);
1034
- }, [stopPropagationEnabled, onClick]);
1035
- const isDisabled = useMemo(() => (state === 'disabled' || loading || disabled), [state, loading, disabled]);
1089
+ }, [stopPropagationEnabled, onClick, isDisabled]);
1036
1090
  const newAriaLabel = useMemo(() => (loading
1037
1091
  ? (loadingAriaLabel || ariaLabel)
1038
1092
  : (ariaLabel)), [ariaLabel, loading, loadingAriaLabel]);
1093
+ if (href) {
1094
+ return (jsx("a", Object.assign({ href: href, target: target, rel: rel, className: classNames(generateClasses, className), style: style, onClick: clickHandler, "aria-label": newAriaLabel, "aria-disabled": isDisabled, id: id }, dataAttributes, { children: loading
1095
+ ? (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }))
1096
+ : (jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })) })));
1097
+ }
1039
1098
  return (jsx("button", Object.assign({ className: classNames(generateClasses, className), style: style, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, id: id }, dataAttributes, { children: loading
1040
1099
  ? (jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsx("span", { className: "visually-hidden", children: "Loading..." }) }))
1041
1100
  : (jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })) })));
@@ -2417,8 +2476,12 @@ ForwardedDInputPhone.displayName = 'DInputPhone';
2417
2476
 
2418
2477
  const DEFAULT_IMAGE = 'https://cdn.modyo.cloud/uploads/06b434f7-b943-4f54-9543-84a904e189aa/original/Visa_Logo_1_.png';
2419
2478
  const CHIP_IMAGE = 'https://cdn.modyo.cloud/uploads/4660ad00-e5d8-477e-8919-52b53d0a26fb/original/chip-debit-svgrepo-com_1_.png';
2479
+ const BRAND_LOGOS = {
2480
+ visa: DEFAULT_IMAGE,
2481
+ mastercard: 'https://cdn.modyo.cloud/uploads/f686b9aa-65ab-4369-9db3-89ceece84f29/original/mastercard.png',
2482
+ };
2420
2483
  function DCreditCard({ brand = 'visa', name, number, holderText = 'Card Holder', logoImage, isChipVisible = true, className, isVertical = false, }) {
2421
- return (jsxs("div", { className: classNames('d-credit-card overflow-hidden text-white', 'position-relative rounded-3', 'd-none d-lg-flex', isVertical && 'is-vertical', className), children: [jsxs("div", { className: "d-credit-card-header", children: [jsx("img", { src: logoImage || DEFAULT_IMAGE, alt: brand, className: "d-credit-card-logo", width: 100 }), isChipVisible && (jsx("div", { className: "d-credit-card-chip p-2 rounded-2", children: jsx("img", { src: CHIP_IMAGE, alt: "chip", width: 30, className: "d-credit-card-chip-image" }) }))] }), jsxs("div", { className: "d-credit-card-details mt-auto d-none d-sm-block", children: [jsx("div", { className: "d-credit-card-number d-none d-sm-block mb-4", children: number }), jsx("small", { className: "d-block opacity-50", children: holderText }), jsx("span", { className: "name", children: name })] })] }));
2484
+ return (jsxs("div", { className: classNames('d-credit-card overflow-hidden text-white', 'position-relative rounded-3', 'd-flex', isVertical && 'is-vertical', className), children: [jsxs("div", { className: "d-credit-card-header", children: [jsx("img", { src: logoImage || BRAND_LOGOS[brand] || DEFAULT_IMAGE, alt: brand, className: "d-credit-card-logo", width: 100 }), isChipVisible && (jsx("div", { className: "d-credit-card-chip p-2 rounded-2", children: jsx("img", { src: CHIP_IMAGE, alt: "chip", width: 30, className: "d-credit-card-chip-image" }) }))] }), jsxs("div", { className: "d-credit-card-details mt-auto d-none d-sm-block", children: [jsx("div", { className: "d-credit-card-number d-none d-sm-block mb-4", children: number }), jsx("small", { className: "d-block opacity-50", children: holderText }), jsx("span", { className: "name", children: name })] })] }));
2422
2485
  }
2423
2486
 
2424
2487
  const getItemClass = (action) => {
@@ -2560,7 +2623,7 @@ function useScreenshotWebShare() {
2560
2623
  };
2561
2624
  }
2562
2625
 
2563
- function DVoucher({ amount, amountDetails, icon = 'CircleCheckBig', color = 'success', title, onError, message, downloadText = 'Download', shareText = 'Share', children, }) {
2626
+ function DVoucher({ amount, amountDetails, icon, title, onError, message, downloadText = 'Download', shareText = 'Share', className, children, }) {
2564
2627
  const { shareRef, share } = useScreenshotWebShare();
2565
2628
  const { downloadRef, download } = useScreenshotDownload();
2566
2629
  const handleShare = () => {
@@ -2585,10 +2648,25 @@ function DVoucher({ amount, amountDetails, icon = 'CircleCheckBig', color = 'suc
2585
2648
  // Error already handled by onError
2586
2649
  });
2587
2650
  };
2588
- return (jsx("div", { className: "d-voucher", ref: (el) => {
2651
+ const defaultIconProps = {
2652
+ icon: 'CircleCheckBig',
2653
+ color: 'success',
2654
+ size: '2rem',
2655
+ hasCircle: true,
2656
+ };
2657
+ const resolvedIconProps = (() => {
2658
+ if (icon === false || icon == null)
2659
+ return null;
2660
+ if (typeof icon === 'string')
2661
+ return Object.assign(Object.assign({}, defaultIconProps), { icon });
2662
+ if (typeof icon === 'object')
2663
+ return Object.assign(Object.assign({}, defaultIconProps), icon);
2664
+ return defaultIconProps;
2665
+ })();
2666
+ return (jsx("div", { className: classNames('d-voucher', className), ref: (el) => {
2589
2667
  shareRef.current = el;
2590
2668
  downloadRef.current = el;
2591
- }, children: jsxs("div", { children: [jsxs("div", { className: "d-voucher-header", children: [jsx(DIcon, { icon: icon, color: color }), jsxs("div", { className: "text-center", children: [jsx("h3", { className: "mb-2", children: title }), jsx("p", { className: "m-0", children: message })] })] }), amount && (jsxs("div", { className: "d-voucher-amount", children: [jsx("div", { className: classNames('text-center fw-bold fs-3', amountDetails ? 'mb-1' : 'm-0'), children: amount }), amountDetails] })), jsx("hr", { className: "my-4" }), children, jsx("hr", { className: "my-4" }), jsxs("div", { className: "d-voucher-footer", children: [jsx(DButton, { onClick: handleShare, iconStart: "Share2", text: shareText, variant: "outline", size: "sm" }), jsx(DButton, { onClick: handleDownload, iconStart: "Download", text: downloadText, variant: "outline", size: "sm" })] })] }) }));
2669
+ }, children: jsxs("div", { children: [jsxs("div", { className: "d-voucher-header", children: [resolvedIconProps && (jsx(DIcon, Object.assign({}, resolvedIconProps))), jsxs("div", { className: "text-center", children: [jsx("h3", { className: "mb-2", children: title }), jsx("p", { className: "m-0", children: message })] })] }), amount && (jsxs("div", { className: "d-voucher-amount", children: [jsx("div", { className: classNames('text-center fw-bold fs-3', amountDetails ? 'mb-1' : 'm-0'), children: amount }), amountDetails] })), jsx("hr", { className: "my-4" }), children, jsx("hr", { className: "my-4" }), jsxs("div", { className: "d-voucher-footer", children: [jsx(DButton, { onClick: handleShare, iconStart: "Share2", text: shareText, variant: "outline", size: "sm" }), jsx(DButton, { onClick: handleDownload, iconStart: "Download", text: downloadText, variant: "outline", size: "sm" })] })] }) }));
2592
2670
  }
2593
2671
 
2594
2672
  function useCountdown(seconds) {
@@ -2660,5 +2738,63 @@ function DOtp({ className, action, isLoading, otpSize = 6, texts = TEXT_PROPS, s
2660
2738
  }, loading: isLoading }), jsx("p", { className: "small ms-lg-auto mb-0", children: texts.contact })] })] })] }));
2661
2739
  }
2662
2740
 
2663
- export { DAlert, DAvatar, DBadge, DBox, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCreditCard, DCurrencyText, DDatePicker, DDropdown, 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, 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, changeQueryString, checkMediaQuery, configureI8n as configureI18n, formatCurrency, getCssVariable, getQueryString, subscribeToMediaQuery, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, useMediaBreakpointUpLg, useMediaBreakpointUpMd, useMediaBreakpointUpSm, useMediaBreakpointUpXl, useMediaBreakpointUpXs, useMediaBreakpointUpXxl, useMediaQuery, usePortal, useProvidedRefOrCreate, useStackState, useTabContext, validatePhoneNumber };
2741
+ function DefaultErrorBoundary({ resetErrorBoundary }) {
2742
+ return (jsx(DAlert, { color: "danger", showClose: false, children: jsxs("div", { className: "d-flex align-items-center gap-2", children: [jsx("span", { children: "An unexpected error occurred." }), jsx(DButton, { color: "secondary", variant: "outline", size: "sm", onClick: resetErrorBoundary, children: "Retry" })] }) }));
2743
+ }
2744
+
2745
+ function DErrorBoundary({ name, fallback, resetKeys, onReset, onError, children, }) {
2746
+ const handleError = useCallback((error, info) => {
2747
+ // eslint-disable-next-line no-console
2748
+ console.error(`[DErrorBoundary${name ? `:${name}` : ''}]`, getErrorMessage(error), info);
2749
+ onError === null || onError === void 0 ? void 0 : onError(error, info);
2750
+ }, [name, onError]);
2751
+ const FallbackRender = useCallback((props) => {
2752
+ if (fallback)
2753
+ return fallback(props);
2754
+ return (jsx(DefaultErrorBoundary, { resetErrorBoundary: props.resetErrorBoundary }));
2755
+ }, [fallback]);
2756
+ return (jsx(ErrorBoundary, { resetKeys: resetKeys, onReset: onReset, onError: handleError, fallbackRender: FallbackRender, children: children }));
2757
+ }
2758
+
2759
+ function ErrorState({ message, onRetry, retryMessage = 'Retry', color = 'danger', }) {
2760
+ return (jsxs(DAlert, { color: color, className: "d-flex align-items-center gap-3", children: [jsx("div", { className: "flex-grow-1", children: jsx("p", { className: "mb-0", children: message !== null && message !== void 0 ? message : 'An unexpected error occurred.' }) }), onRetry && (jsx(DButton, { onClick: onRetry, text: retryMessage, variant: "outline", iconStart: "RefreshCw" }))] }));
2761
+ }
2762
+
2763
+ function EmptyState({ message, icon = 'FileText', actionText, onAction, }) {
2764
+ return (jsxs("div", { className: "d-flex flex-column align-items-center justify-content-center p-5 text-center", children: [jsx(DIcon, { icon: icon, size: "3rem", className: "text-secondary mb-3" }), jsx("p", { className: "text-secondary mb-3", children: message !== null && message !== void 0 ? message : 'No data available.' }), actionText && onAction && (jsx(DButton, { onClick: onAction, text: actionText, variant: "outline" }))] }));
2765
+ }
2766
+
2767
+ function LoadingState({ ariaLabel = 'Loading...', className }) {
2768
+ return (jsx("div", { className: `d-flex align-items-center justify-content-center p-4 ${className || ''}`.trim(), "aria-busy": "true", "aria-live": "polite", children: jsx("span", { className: "spinner-border", role: "status", "aria-label": ariaLabel }) }));
2769
+ }
2770
+
2771
+ function render(renderable) {
2772
+ if (renderable === undefined)
2773
+ return null;
2774
+ return typeof renderable === 'function' ? renderable() : renderable;
2775
+ }
2776
+ function DDataStateWrapper({ isLoading, isError, data, onRetry, renderLoading, renderEmpty, renderError, children, }) {
2777
+ // 1. Loading
2778
+ if (isLoading) {
2779
+ if (renderLoading)
2780
+ return render(renderLoading);
2781
+ return jsx(LoadingState, {});
2782
+ }
2783
+ // 2. Error
2784
+ if (isError) {
2785
+ if (renderError)
2786
+ return render(renderError);
2787
+ return (jsx(ErrorState, { onRetry: onRetry }));
2788
+ }
2789
+ // 3. Empty
2790
+ if (!(data === null || data === void 0 ? void 0 : data.length)) {
2791
+ if (renderEmpty)
2792
+ return render(renderEmpty);
2793
+ return (jsx(EmptyState, {}));
2794
+ }
2795
+ // 4. Success
2796
+ return jsx(Fragment, { children: children(data) });
2797
+ }
2798
+
2799
+ export { DAlert, DAvatar, DBadge, DBox, DBoxFile, DButton, DButtonIcon, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, 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, 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, changeQueryString, checkMediaQuery, configureI8n as configureI18n, formatCurrency, getCssVariable, getQueryString, subscribeToMediaQuery, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, useItemSelection, useMediaBreakpointUpLg, useMediaBreakpointUpMd, useMediaBreakpointUpSm, useMediaBreakpointUpXl, useMediaBreakpointUpXs, useMediaBreakpointUpXxl, useMediaQuery, usePortal, useProvidedRefOrCreate, useStackState, useTabContext, validatePhoneNumber };
2664
2800
  //# sourceMappingURL=index.esm.js.map