@dynamic-framework/ui-react 1.18.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/css/dynamic-ui-non-root.css +1363 -868
  2. package/dist/css/dynamic-ui-non-root.min.css +2 -2
  3. package/dist/css/dynamic-ui-root.css +493 -29
  4. package/dist/css/dynamic-ui-root.min.css +2 -2
  5. package/dist/css/dynamic-ui.css +1855 -896
  6. package/dist/css/dynamic-ui.min.css +2 -2
  7. package/dist/index.esm.js +117 -151
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +118 -155
  10. package/dist/index.js.map +1 -1
  11. package/dist/types/components/DAvatar/DAvatar.d.ts +9 -0
  12. package/dist/types/components/DAvatar/index.d.ts +2 -0
  13. package/dist/types/components/DCarousel/DCarousel.d.ts +5 -4
  14. package/dist/types/components/DToastContainer/DToastContainer.d.ts +9 -7
  15. package/dist/types/components/DToastContainer/index.d.ts +1 -1
  16. package/dist/types/components/DToastContainer/{useToast.d.ts → useDToast.d.ts} +7 -4
  17. package/dist/types/components/index.d.ts +1 -1
  18. package/dist/types/components/interface.d.ts +1 -0
  19. package/dist/types/contexts/DContext.d.ts +8 -7
  20. package/dist/types/contexts/DPortalContext.d.ts +29 -0
  21. package/dist/types/contexts/index.d.ts +1 -2
  22. package/package.json +3 -3
  23. package/src/style/abstracts/_mixins.scss +110 -94
  24. package/src/style/abstracts/_utilities.scss +34 -1
  25. package/src/style/abstracts/variables/_+import.scss +2 -0
  26. package/src/style/abstracts/variables/_accordion.scss +2 -2
  27. package/src/style/abstracts/variables/_alerts.scss +1 -1
  28. package/src/style/abstracts/variables/_cards.scss +2 -0
  29. package/src/style/abstracts/variables/_collapse-icon-text.scss +2 -2
  30. package/src/style/abstracts/variables/_forms.scss +5 -7
  31. package/src/style/abstracts/variables/_navs.scss +2 -2
  32. package/src/style/abstracts/variables/_pagination.scss +4 -4
  33. package/src/style/abstracts/variables/_progress.scss +2 -2
  34. package/src/style/abstracts/variables/_quick-action-button.scss +4 -4
  35. package/src/style/abstracts/variables/_quick-action-check.scss +4 -4
  36. package/src/style/abstracts/variables/_quick-action-select.scss +3 -3
  37. package/src/style/abstracts/variables/_quick-action-switch.scss +2 -2
  38. package/src/style/abstracts/variables/_tooltip.scss +16 -0
  39. package/src/style/abstracts/variables/_typography.scss +76 -20
  40. package/src/style/abstracts/variables/_z-index.scss +11 -0
  41. package/src/style/base/_+import.scss +7 -2
  42. package/src/style/base/_avatar.scss +61 -0
  43. package/src/style/base/_backdrop.scss +9 -0
  44. package/src/style/base/_button-group.scss +13 -0
  45. package/src/style/base/{_button.scss → _buttons.scss} +14 -48
  46. package/src/style/base/_form-check.scss +2 -1
  47. package/src/style/base/_input-group.scss +11 -6
  48. package/src/style/base/_tooltip.scss +23 -0
  49. package/src/style/base/_type.scss +104 -0
  50. package/src/style/components/_+import.scss +0 -1
  51. package/src/style/components/_d-datepicker.scss +7 -7
  52. package/src/style/components/_d-monthpicker.scss +4 -4
  53. package/src/style/components/_d-quick-action-button.scss +8 -0
  54. package/src/style/components/_d-quick-action-select.scss +2 -0
  55. package/src/style/components/_d-quick-action-switch.scss +4 -4
  56. package/src/style/components/_d-select.scss +1 -1
  57. package/src/style/components/_d-stepper-mobile.scss +3 -3
  58. package/src/style/helpers/_+import.scss +1 -0
  59. package/src/style/helpers/_text-truncate.scss +8 -0
  60. package/src/style/root/_root.scss +98 -21
  61. package/dist/types/contexts/DModalContext.d.ts +0 -31
  62. package/dist/types/contexts/DOffcanvasContext.d.ts +0 -31
  63. package/src/style/components/_d-tooltip.scss +0 -35
package/dist/index.esm.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import React, { useMemo, createContext, useState, useCallback, useContext, useEffect, forwardRef, useRef } from 'react';
2
+ import React, { useMemo, useEffect, useState, useCallback, createContext, useContext, forwardRef, useRef } from 'react';
3
3
  import classNames from 'classnames';
4
4
  import { __rest } from 'tslib';
5
+ import { createPortal } from 'react-dom';
5
6
  import { useDropzone } from 'react-dropzone';
6
7
  import { SplideSlide, Splide } from '@splidejs/react-splide';
7
8
  import currency from 'currency.js';
@@ -12,10 +13,9 @@ import Select, { components } from 'react-select';
12
13
  import ResponsivePagination from 'react-responsive-pagination';
13
14
  import { useFloating, offset, flip, shift, autoUpdate, useClick, useDismiss, useRole, useInteractions, useId, FloatingFocusManager, arrow, useHover, useFocus, FloatingPortal, FloatingArrow } from '@floating-ui/react';
14
15
  import ContentLoader from 'react-content-loader';
15
- import { ToastContainer, Slide, toast } from 'react-toastify';
16
+ import { ToastContainer, Bounce, Flip, Slide, Zoom, toast } from 'react-toastify';
16
17
  import i18n from 'i18next';
17
18
  import { initReactI18next } from 'react-i18next';
18
- import { createPortal } from 'react-dom';
19
19
 
20
20
  const PREFIX_BS = 'bs-';
21
21
 
@@ -61,71 +61,6 @@ function DIconBase({ icon, theme, style, className, size = '1.5rem', loading = f
61
61
  return (jsx("i", { className: classNames(generateClasses), style: generateStyleVariables, children: materialStyle && icon }));
62
62
  }
63
63
 
64
- const defaultState = {
65
- language: 'en',
66
- currency: {
67
- symbol: '$',
68
- precision: 2,
69
- separator: ',',
70
- decimal: '.',
71
- },
72
- icon: {
73
- familyClass: 'bi',
74
- familyPrefix: 'bi-',
75
- materialStyle: false,
76
- },
77
- iconMap: {
78
- x: 'x',
79
- xLg: 'x-lg',
80
- chevronUp: 'chevron-up',
81
- chevronDown: 'chevron-down',
82
- chevronLeft: 'chevron-left',
83
- chevronRight: 'chevron-right',
84
- upload: 'cloud-upload',
85
- calendar: 'calendar',
86
- check: 'check',
87
- alert: {
88
- warning: 'exclamation-circle',
89
- danger: 'exclamation-triangle',
90
- success: 'check-circle',
91
- info: 'info-circle',
92
- dark: 'info-circle',
93
- light: 'info-circle',
94
- primary: 'info-circle',
95
- secondary: 'info-circle',
96
- },
97
- input: {
98
- invalid: 'exclamation-circle',
99
- valid: 'check',
100
- search: 'search',
101
- show: 'eye',
102
- hide: 'eye-slash',
103
- increase: 'plus-square',
104
- decrease: 'dash-square',
105
- },
106
- },
107
- setContext: () => { },
108
- };
109
- const DContext = createContext(defaultState);
110
- function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, children, }) {
111
- const [internalContext, setInternalContext,] = useState({
112
- language,
113
- currency,
114
- icon,
115
- iconMap,
116
- });
117
- const setContext = useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
118
- const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
119
- return (jsx(DContext.Provider, { value: value, children: children }));
120
- }
121
- function useDContext() {
122
- const context = useContext(DContext);
123
- if (context === undefined) {
124
- throw new Error('useDContext was used outside of DContextProvider');
125
- }
126
- return context;
127
- }
128
-
129
64
  function useDisableBodyScrollEffect(disable) {
130
65
  useEffect(() => {
131
66
  if (disable) {
@@ -173,20 +108,9 @@ function useStackState(initialList) {
173
108
  ]);
174
109
  }, []);
175
110
  const pop = useCallback(() => {
176
- setList((prevList) => {
177
- if (prevList.length === 0) {
178
- return prevList;
179
- }
180
- const [, ...newList] = prevList;
181
- return newList;
182
- });
111
+ setList((prevList) => (prevList.slice(0, prevList.length - 1)));
183
112
  }, []);
184
- const peek = useCallback(() => {
185
- if (list.length > 0) {
186
- return list[list.length - 1];
187
- }
188
- return undefined;
189
- }, [list]);
113
+ const peek = useCallback(() => list.at(-1), [list]);
190
114
  const clear = () => setList([]);
191
115
  const isEmpty = useCallback(() => list.length === 0, [list]);
192
116
  const controls = {
@@ -200,78 +124,108 @@ function useStackState(initialList) {
200
124
  return [list, controls];
201
125
  }
202
126
 
203
- const DModalContext = createContext(undefined);
204
- function DModalContextProvider({ portalName, children, availableModals, }) {
127
+ const DPortalContext = createContext(undefined);
128
+ function DPortalContextProvider({ portalName, children, availablePortals, }) {
205
129
  const { created } = usePortal(portalName);
206
- const [stack, { push, pop, peek }] = useStackState([]);
130
+ const [stack, { push, pop, isEmpty }] = useStackState([]);
207
131
  useDisableBodyScrollEffect(Boolean(stack.length));
208
- const openModal = useCallback((modalName, payload) => {
209
- const Component = availableModals[modalName];
132
+ const openPortal = useCallback((name, payload) => {
133
+ if (!availablePortals) {
134
+ throw new Error(`there is no component for portal ${name.toString()}`);
135
+ }
136
+ const Component = availablePortals[name];
210
137
  if (!Component) {
211
- throw new Error(`there is no component for modal ${modalName.toString()}`);
138
+ throw new Error(`there is no component for portal ${name.toString()}`);
212
139
  }
213
140
  push({
214
- modalName,
141
+ name,
215
142
  Component,
216
143
  payload,
217
144
  });
218
- }, [availableModals, push]);
219
- const closeModal = useCallback(() => {
220
- const stackItem = peek();
221
- if (!stackItem) {
145
+ }, [availablePortals, push]);
146
+ const closePortal = useCallback(() => {
147
+ if (isEmpty()) {
222
148
  return;
223
149
  }
224
150
  pop();
225
- }, [peek, pop]);
151
+ }, [isEmpty, pop]);
226
152
  const value = useMemo(() => ({
227
153
  stack,
228
- openModal,
229
- closeModal,
230
- }), [stack, openModal, closeModal]);
231
- return (jsxs(DModalContext.Provider, { value: value, children: [children, created && createPortal(jsxs(Fragment, { children: [stack.map(({ Component, modalName, payload, }) => (jsx(Component, { name: modalName, payload: payload, openModal: openModal, closeModal: closeModal }, modalName))), !!stack.length && jsx("div", { className: "modal-backdrop fade show" })] }), document.getElementById(portalName))] }));
154
+ openPortal,
155
+ closePortal,
156
+ }), [stack, openPortal, closePortal]);
157
+ return (jsxs(DPortalContext.Provider, { value: value, children: [children, created && createPortal(jsx(Fragment, { children: stack.map(({ Component, name, payload, }) => (jsxs(Fragment, { children: [jsx("div", { className: "backdrop fade show" }), jsx(Component, { name: name, payload: payload })] }))) }), document.getElementById(portalName))] }));
232
158
  }
233
- function useDModalContext() {
234
- const context = useContext(DModalContext);
159
+ function useDPortalContext() {
160
+ const context = useContext(DPortalContext);
235
161
  if (context === undefined) {
236
- throw new Error('useModalContext was used outside of ModalContextProvider');
162
+ throw new Error('usePortalContext was used outside of PortalContextProvider');
237
163
  }
238
164
  return context;
239
165
  }
240
166
 
241
- const DOffcanvasContext = createContext(undefined);
242
- function DOffcanvasContextProvider({ portalName, children, availableOffcanvas, }) {
243
- const { created } = usePortal(portalName);
244
- const [stack, { push, pop, peek }] = useStackState([]);
245
- useDisableBodyScrollEffect(Boolean(stack.length));
246
- const openOffcanvas = useCallback((offcanvasName, payload) => {
247
- const Component = availableOffcanvas[offcanvasName];
248
- if (!Component) {
249
- throw new Error(`there is no component for offcanvas ${offcanvasName}`);
250
- }
251
- push({
252
- offcanvasName,
253
- Component,
254
- payload,
255
- });
256
- }, [availableOffcanvas, push]);
257
- const closeOffcanvas = useCallback(() => {
258
- const stackItem = peek();
259
- if (!stackItem) {
260
- return;
261
- }
262
- pop();
263
- }, [peek, pop]);
264
- const value = useMemo(() => ({
265
- stack,
266
- openOffcanvas,
267
- closeOffcanvas,
268
- }), [stack, openOffcanvas, closeOffcanvas]);
269
- return (jsxs(DOffcanvasContext.Provider, { value: value, children: [children, created && createPortal(jsxs(Fragment, { children: [stack.map(({ Component, offcanvasName, payload, }) => (jsx(Component, { name: offcanvasName, payload: payload, openOffcanvas: openOffcanvas, closeOffcanvas: closeOffcanvas }, offcanvasName))), !!stack.length && jsx("div", { className: "offcanvas-backdrop fade show" })] }), document.getElementById(portalName))] }));
167
+ const defaultState = {
168
+ language: 'en',
169
+ currency: {
170
+ symbol: '$',
171
+ precision: 2,
172
+ separator: ',',
173
+ decimal: '.',
174
+ },
175
+ icon: {
176
+ familyClass: 'bi',
177
+ familyPrefix: 'bi-',
178
+ materialStyle: false,
179
+ },
180
+ iconMap: {
181
+ x: 'x',
182
+ xLg: 'x-lg',
183
+ chevronUp: 'chevron-up',
184
+ chevronDown: 'chevron-down',
185
+ chevronLeft: 'chevron-left',
186
+ chevronRight: 'chevron-right',
187
+ upload: 'cloud-upload',
188
+ calendar: 'calendar',
189
+ check: 'check',
190
+ alert: {
191
+ warning: 'exclamation-circle',
192
+ danger: 'exclamation-triangle',
193
+ success: 'check-circle',
194
+ info: 'info-circle',
195
+ dark: 'info-circle',
196
+ light: 'info-circle',
197
+ primary: 'info-circle',
198
+ secondary: 'info-circle',
199
+ },
200
+ input: {
201
+ invalid: 'exclamation-circle',
202
+ valid: 'check',
203
+ search: 'search',
204
+ show: 'eye',
205
+ hide: 'eye-slash',
206
+ increase: 'plus-square',
207
+ decrease: 'dash-square',
208
+ },
209
+ },
210
+ setContext: () => { },
211
+ portalName: 'd-portal',
212
+ };
213
+ const DContext = createContext(defaultState);
214
+ function DContextProvider({ language = defaultState.language, currency = defaultState.currency, icon = defaultState.icon, iconMap = defaultState.iconMap, portalName = defaultState.portalName, availablePortals, children, }) {
215
+ const [internalContext, setInternalContext,] = useState({
216
+ language,
217
+ currency,
218
+ icon,
219
+ iconMap,
220
+ });
221
+ const setContext = useCallback((newValue) => (setInternalContext((prevInternalContext) => (Object.assign(Object.assign({}, prevInternalContext), newValue)))), []);
222
+ const value = useMemo(() => (Object.assign(Object.assign({}, internalContext), { setContext })), [internalContext, setContext]);
223
+ return (jsx(DContext.Provider, { value: value, children: jsx(DPortalContextProvider, { portalName: portalName, availablePortals: availablePortals, children: children }) }));
270
224
  }
271
- function useDOffcanvasContext() {
272
- const context = useContext(DOffcanvasContext);
225
+ function useDContext() {
226
+ const context = useContext(DContext);
273
227
  if (context === undefined) {
274
- throw new Error('useOffcanvasContext was used outside of OffcanvasContextProvider');
228
+ throw new Error('useDContext was used outside of DContextProvider');
275
229
  }
276
230
  return context;
277
231
  }
@@ -361,9 +315,9 @@ function DCarouselSlide(_a) {
361
315
  return (jsx(SplideSlide, Object.assign({ className: classNames('d-carousel-slide', className) }, props)));
362
316
  }
363
317
 
364
- function DCarousel(_a) {
318
+ function DCarousel(_a, ref) {
365
319
  var { children, className, style, options } = _a, props = __rest(_a, ["children", "className", "style", "options"]);
366
- return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, options: Object.assign(Object.assign({}, options), { classes: {
320
+ return (jsx(Splide, Object.assign({ className: classNames('d-carousel', className), style: style, ref: ref, options: Object.assign(Object.assign({}, options), { classes: {
367
321
  // Arrows
368
322
  arrows: 'splide__arrows d-carousel-arrows',
369
323
  arrow: 'splide__arrow d-carousel-arrow',
@@ -374,7 +328,9 @@ function DCarousel(_a) {
374
328
  page: 'splide__pagination__page d-carousel-pagination-page',
375
329
  } }) }, props, { children: children })));
376
330
  }
377
- var DCarousel$1 = Object.assign(DCarousel, {
331
+ const ForwardedDCarousel = forwardRef(DCarousel);
332
+ ForwardedDCarousel.displayName = 'DCarousel';
333
+ var DCarousel$1 = Object.assign(ForwardedDCarousel, {
378
334
  Slide: DCarouselSlide,
379
335
  });
380
336
 
@@ -405,7 +361,7 @@ function DCollapse({ id, className, style, Component, hasSeparator = false, defa
405
361
  const generateStyles = useMemo(() => ({
406
362
  [`--${PREFIX_BS}collapse-separator-display`]: hasSeparator ? 'block' : 'none',
407
363
  }), [hasSeparator]);
408
- return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}ref-fs-small)`, icon: toggle ? iconOpen : iconClose, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })] }), toggle && (jsx("div", { className: classNames({
364
+ return (jsxs("div", { id: id, className: classNames('collapse-container', className), style: style, children: [jsxs("button", { className: "collapse-button", type: "button", onClick: onChangeCollapse, children: [jsx("div", { className: "flex-grow-1", children: Component }), jsx(DIcon, { color: `var(--${PREFIX_BS}gray)`, size: `var(--${PREFIX_BS}fs-small)`, icon: toggle ? iconOpen : iconClose, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })] }), toggle && (jsx("div", { className: classNames({
409
365
  'collapse-body': true,
410
366
  }), style: generateStyles, children: children }))] }));
411
367
  }
@@ -1057,7 +1013,7 @@ function DModal({ name, className, style, staticBackdrop, scrollable, centered,
1057
1013
  }
1058
1014
  return '';
1059
1015
  }, [fullScreenFrom, fullScreen]);
1060
- const generateClasses = useMemo(() => (Object.assign({ 'modal fade show': true }, className && { [className]: true })), [className]);
1016
+ const generateClasses = useMemo(() => (Object.assign({ 'modal portal fade show': true }, className && { [className]: true })), [className]);
1061
1017
  const generateModalDialogClasses = useMemo(() => (Object.assign({ 'modal-dialog': true, 'modal-dialog-centered': !!centered, 'modal-dialog-scrollable': !!scrollable, [fullScreenClass]: !!fullScreen }, size && { [`modal-${size}`]: true })), [fullScreenClass, centered, fullScreen, scrollable, size]);
1062
1018
  return (jsx("div", Object.assign({ className: classNames(generateClasses), id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false", style: style }, staticBackdrop && ({
1063
1019
  [`data-${PREFIX_BS}backdrop`]: 'static',
@@ -1085,7 +1041,7 @@ function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className,
1085
1041
  }
1086
1042
 
1087
1043
  function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
1088
- return (jsx("div", Object.assign({ className: classNames('offcanvas show', {
1044
+ return (jsx("div", Object.assign({ className: classNames('offcanvas portal show', {
1089
1045
  [`offcanvas-${openFrom}`]: openFrom,
1090
1046
  }, className), style: style, id: name, tabIndex: -1, "aria-labelledby": `${name}Label`, "aria-hidden": "false" }, staticBackdrop && ({
1091
1047
  [`data-${PREFIX_BS}backdrop`]: 'static',
@@ -1203,7 +1159,7 @@ function DQuickActionSwitch({ id, name, label, hint, checked, disabled, classNam
1203
1159
  event.stopPropagation();
1204
1160
  onClick === null || onClick === void 0 ? void 0 : onClick(checked);
1205
1161
  }, [checked, onClick]);
1206
- return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [jsxs("div", { className: "d-quick-action-switch-content", children: [jsx(DInputSwitch, { id: id, name: name, disabled: disabled, checked: checked, readonly: true }), jsx("label", { className: "d-quick-action-switch-label", htmlFor: id, children: label })] }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
1162
+ return (jsxs("button", { className: classNames('d-quick-action-switch', className), type: "button", onClick: clickHandler, style: style, children: [jsx("div", { className: "d-quick-action-switch-content", children: jsx(DInputSwitch, { id: id, name: name, disabled: disabled, checked: checked, readonly: true, label: label }) }), jsx("div", { className: "d-quick-action-switch-hint", children: hint })] }));
1207
1163
  }
1208
1164
 
1209
1165
  function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, children, }) {
@@ -1310,8 +1266,8 @@ function DTooltip({ className, childrenClassName, style, offSet = ARROW_HEIGHT +
1310
1266
  dismiss,
1311
1267
  role,
1312
1268
  ]);
1313
- const generateClasses = useMemo(() => (Object.assign({ 'd-tooltip': true, [`d-tooltip-${size}`]: !!size, [`d-tooltip-${theme}`]: !!theme }, className && { [className]: true })), [size, theme, className]);
1314
- return (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsx(FloatingPortal, { children: isOpen && (jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsx(FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), children] }))) })] }));
1269
+ const generateClasses = useMemo(() => (Object.assign({ 'tooltip show': true, [`tooltip-${size}`]: !!size, [`tooltip-${theme}`]: !!theme }, className && { [className]: true })), [size, theme, className]);
1270
+ return (jsxs(Fragment, { children: [jsx("div", Object.assign({ className: childrenClassName, ref: refs.setReference }, getReferenceProps(), { children: Component })), jsx(FloatingPortal, { children: isOpen && (jsxs("div", Object.assign({ className: classNames(generateClasses), ref: refs.setFloating, style: Object.assign(Object.assign({}, floatingStyles), style) }, getFloatingProps(), { children: [jsx(FloatingArrow, { ref: arrowRef, context: context, width: ARROW_WIDTH, height: ARROW_HEIGHT }), jsx("div", { className: "tooltip-inner", children: children })] }))) })] }));
1315
1271
  }
1316
1272
 
1317
1273
  const TabContext = createContext(undefined);
@@ -1358,17 +1314,27 @@ var DTabs$1 = Object.assign(DTabs, {
1358
1314
  Tab: DTabContent,
1359
1315
  });
1360
1316
 
1361
- function DToastContainer({ style, position = 'top-right', className, }) {
1362
- return (jsx(ToastContainer, { toastClassName: () => classNames('shadow-none p-0 cursor-default', className), position: position, autoClose: false, hideProgressBar: true, closeOnClick: false, closeButton: false, transition: Slide, style: style }));
1317
+ const TOAST_TRANSITIONS$1 = {
1318
+ bounce: Bounce,
1319
+ flip: Flip,
1320
+ slide: Slide,
1321
+ zoom: Zoom,
1322
+ };
1323
+ function DToastContainer({ style, className, closeOnClick, position = 'bottom-center', autoClose = false, stacked = false, transition = 'slide', containerId, }) {
1324
+ const selectedTransition = useMemo(() => TOAST_TRANSITIONS$1[transition], [transition]);
1325
+ return (jsx(ToastContainer, { toastClassName: () => classNames('shadow-none p-0 cursor-default', className), position: position, autoClose: autoClose, closeOnClick: closeOnClick, transition: selectedTransition, closeButton: false, style: style, hideProgressBar: true, stacked: stacked, containerId: containerId }));
1363
1326
  }
1364
1327
 
1365
- function useToast() {
1366
- const toast$1 = useCallback((message, { position = 'top-right', type = 'info', showClose = true, autoClose = false, icon, iconClose, } = {}) => {
1367
- toast(({ closeToast }) => (jsx(DAlert, { type: type, showClose: showClose, onClose: closeToast, id: "alertID", icon: icon, iconClose: iconClose, children: message })), {
1368
- transition: Slide,
1369
- position,
1370
- autoClose,
1371
- });
1328
+ const TOAST_TRANSITIONS = {
1329
+ bounce: Bounce,
1330
+ flip: Flip,
1331
+ slide: Slide,
1332
+ zoom: Zoom,
1333
+ };
1334
+ function useDToast() {
1335
+ const toast$1 = useCallback((message, _a) => {
1336
+ var { icon, iconClose, type = 'info', showClose = true, transition } = _a, rest = __rest(_a, ["icon", "iconClose", "type", "showClose", "transition"]);
1337
+ toast(({ closeToast }) => (jsx(DAlert, { onClose: closeToast, id: "alertID", type: type, icon: icon, iconClose: iconClose, showClose: showClose, children: message })), Object.assign({ transition: transition && TOAST_TRANSITIONS[transition] }, rest));
1372
1338
  }, []);
1373
1339
  return {
1374
1340
  toast: toast$1,
@@ -1389,5 +1355,5 @@ async function configureI8n(resources, _a = {}) {
1389
1355
  .then((t) => t);
1390
1356
  }
1391
1357
 
1392
- export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem, DModal$1 as DModal, DModalBody, DModalContext, DModalContextProvider, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasContext, DOffcanvasContextProvider, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPopover, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSelect$1 as DSelect, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTabs$1 as DTabs, DToastContainer, DTooltip, configureI8n as configureI18n, formatCurrency, useDContext, useDModalContext, useDOffcanvasContext, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, usePortal, useProvidedRefOrCreate, useStackState, useTabContext, useToast };
1358
+ export { DAlert, DBadge, DBoxFile, DButton, DCard$1 as DCard, DCardBody, DCardFooter, DCardHeader, DCarousel$1 as DCarousel, DCarouselSlide, DChip, DCollapse, DContext, DContextProvider, DCurrencyText, DDatePicker, DIcon, DIconBase, DInput$1 as DInput, DInputCheck, DInputCounter$1 as DInputCounter, DInputCurrency$1 as DInputCurrency, DInputCurrencyBase$1 as DInputCurrencyBase, DInputMask$1 as DInputMask, DInputPassword$1 as DInputPassword, DInputPin, DInputSearch$1 as DInputSearch, DInputSelect, DInputSwitch, DList$1 as DList, DListItem, DModal$1 as DModal, DModalBody, DModalFooter, DModalHeader, DOffcanvas$1 as DOffcanvas, DOffcanvasBody, DOffcanvasFooter, DOffcanvasHeader, DPaginator, DPopover, DPortalContext, DPortalContextProvider, DProgress, DQuickActionButton, DQuickActionCheck, DQuickActionSelect, DQuickActionSwitch, DSelect$1 as DSelect, DSkeleton, DStepper, DStepper$2 as DStepperDesktop, DStepper$1 as DStepperMobile, DTabContent, DTabs$1 as DTabs, DToastContainer, DTooltip, configureI8n as configureI18n, formatCurrency, useDContext, useDPortalContext, useDToast, useDisableBodyScrollEffect, useDisableInputWheel, useFormatCurrency, useInputCurrency, usePortal, useProvidedRefOrCreate, useStackState, useTabContext };
1393
1359
  //# sourceMappingURL=index.esm.js.map