@dynamic-framework/ui-react 1.26.0 → 1.27.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 (51) hide show
  1. package/dist/css/dynamic-ui-non-root.css +269 -905
  2. package/dist/css/dynamic-ui-non-root.min.css +2 -2
  3. package/dist/css/dynamic-ui-root.css +228 -152
  4. package/dist/css/dynamic-ui-root.min.css +2 -2
  5. package/dist/css/dynamic-ui.css +496 -1056
  6. package/dist/css/dynamic-ui.min.css +2 -2
  7. package/dist/index.esm.js +112 -47
  8. package/dist/index.esm.js.map +1 -1
  9. package/dist/index.js +113 -46
  10. package/dist/index.js.map +1 -1
  11. package/dist/types/components/DButtonIcon/DButtonIcon.d.ts +19 -0
  12. package/dist/types/components/DButtonIcon/index.d.ts +2 -0
  13. package/dist/types/components/DInput/DInput.d.ts +3 -2
  14. package/dist/types/components/DInputCheck/DInputCheck.d.ts +3 -1
  15. package/dist/types/components/DInputCounter/DInputCounter.d.ts +2 -1
  16. package/dist/types/components/DInputCurrency/DInputCurrency.d.ts +2 -1
  17. package/dist/types/components/DInputCurrencyBase/DInputCurrencyBase.d.ts +2 -1
  18. package/dist/types/components/DInputMask/DInputMask.d.ts +2 -1
  19. package/dist/types/components/DInputSearch/DInputSearch.d.ts +2 -1
  20. package/dist/types/components/DInputSelect/DInputSelect.d.ts +3 -2
  21. package/dist/types/components/DInputSwitch/DInputSwitch.d.ts +3 -1
  22. package/dist/types/components/DSelect/DSelect.d.ts +3 -3
  23. package/dist/types/components/DStepper/DStepper.d.ts +2 -1
  24. package/dist/types/components/DStepperDesktop/DStepperDesktop.d.ts +2 -1
  25. package/dist/types/components/DTableHead/DTableHead.d.ts +9 -0
  26. package/dist/types/components/DTableHead/index.d.ts +2 -0
  27. package/dist/types/components/DToastContainer/DToastContainer.d.ts +2 -14
  28. package/dist/types/components/DToastContainer/useDToast.d.ts +11 -12
  29. package/dist/types/components/index.d.ts +2 -0
  30. package/dist/types/contexts/DContext.d.ts +1 -1
  31. package/dist/types/hooks/useFormatCurrency.d.ts +2 -1
  32. package/package.json +4 -4
  33. package/src/style/abstracts/_mixins.scss +41 -21
  34. package/src/style/abstracts/variables/_+import.scss +11 -3
  35. package/src/style/abstracts/variables/_border.scss +1 -1
  36. package/src/style/abstracts/variables/_buttons.scss +3 -5
  37. package/src/style/abstracts/variables/_colors.scss +10 -10
  38. package/src/style/abstracts/variables/_forms.scss +24 -50
  39. package/src/style/abstracts/variables/_quick-action-switch.scss +0 -2
  40. package/src/style/base/_alert.scss +1 -1
  41. package/src/style/base/_buttons.scss +41 -16
  42. package/src/style/base/_form-check.scss +2 -19
  43. package/src/style/base/_form-switch.scss +4 -53
  44. package/src/style/components/_+import.scss +3 -2
  45. package/src/style/components/_d-button-icon.scss +26 -0
  46. package/src/style/components/_d-close.scss +11 -0
  47. package/src/style/components/_d-modal.scss +0 -11
  48. package/src/style/components/_d-offcanvas.scss +0 -11
  49. package/src/style/components/_d-quick-action-switch.scss +0 -7
  50. package/src/style/components/_d-table-head.scss +18 -0
  51. package/src/style/root/_root.scss +42 -36
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var mask = require('@react-input/mask');
15
15
  var ResponsivePagination = require('react-responsive-pagination');
16
16
  var react = require('@floating-ui/react');
17
17
  var ContentLoader = require('react-content-loader');
18
- var reactToastify = require('react-toastify');
18
+ var reactHotToast = require('react-hot-toast');
19
19
  var i18n = require('i18next');
20
20
  var reactI18next = require('react-i18next');
21
21
 
@@ -159,20 +159,26 @@ function DPortalContextProvider({ portalName, children, availablePortals, }) {
159
159
  closePortal,
160
160
  }), [stack, openPortal, closePortal]);
161
161
  const handleClose = React.useCallback((target) => {
162
- if (target instanceof HTMLDivElement) {
163
- if (target.classList.contains('portal')) {
164
- if (!('bsBackdrop' in target.dataset)) {
165
- closePortal();
166
- }
162
+ if (!(target instanceof HTMLDivElement)) {
163
+ return;
164
+ }
165
+ if (target.classList.contains('portal') && !('bsBackdrop' in target.dataset)) {
166
+ closePortal();
167
+ return;
168
+ }
169
+ if (target.classList.contains('backdrop')) {
170
+ const lastPortal = target.nextElementSibling;
171
+ if (lastPortal && lastPortal.classList.contains('portal') && !('bsBackdrop' in lastPortal.dataset)) {
172
+ closePortal();
167
173
  }
168
174
  }
169
175
  }, [closePortal]);
170
176
  React.useEffect(() => {
171
177
  const keyEvent = (event) => {
172
178
  if (event.key === 'Escape') {
173
- const lastModal = document.querySelector(`#${portalName} > div > div:last-child`);
174
- if (lastModal) {
175
- handleClose(lastModal);
179
+ const lastPortal = document.querySelector(`#${portalName} > div > div:last-child`);
180
+ if (lastPortal) {
181
+ handleClose(lastPortal);
176
182
  }
177
183
  }
178
184
  };
@@ -321,6 +327,28 @@ function DButton({ theme = 'primary', size, variant, state, text = '', ariaLabel
321
327
  return (jsxRuntime.jsxs("button", Object.assign({ className: classNames(generateClasses, className), style: style, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, form: form }, value && { value }, { children: [iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix, materialStyle: iconStartMaterialStyle })), (text && !loading) && (jsxRuntime.jsx("span", { children: text })), loading && (jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) })), iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix, materialStyle: iconEndMaterialStyle }))] })));
322
328
  }
323
329
 
330
+ function DButtonIcon({ id, icon, size, className, variant, state, loadingAriaLabel, iconMaterialStyle, ariaLabel, theme = 'primary', type = 'button', loading = false, disabled = false, stopPropagationEnabled = true, style, iconFamilyClass, iconFamilyPrefix, onClick, }) {
331
+ const generateClasses = React.useMemo(() => {
332
+ const variantClass = variant
333
+ ? `btn-${variant}-${theme}`
334
+ : `btn-${theme}`;
335
+ return Object.assign(Object.assign(Object.assign({ 'btn d-button-icon': true, [variantClass]: true }, size && { [`btn-${size}`]: true }), (state && state !== 'disabled') && { [state]: true }), { loading });
336
+ }, [variant, theme, size, state, loading]);
337
+ const clickHandler = React.useCallback((event) => {
338
+ if (stopPropagationEnabled) {
339
+ event.stopPropagation();
340
+ }
341
+ onClick === null || onClick === void 0 ? void 0 : onClick(event);
342
+ }, [stopPropagationEnabled, onClick]);
343
+ const isDisabled = React.useMemo(() => (state === 'disabled' || loading || disabled), [state, loading, disabled]);
344
+ const newAriaLabel = React.useMemo(() => (loading
345
+ ? (loadingAriaLabel || ariaLabel)
346
+ : (ariaLabel)), [ariaLabel, loading, loadingAriaLabel]);
347
+ return (jsxRuntime.jsx("button", { className: classNames(generateClasses, className), style: style, type: type, disabled: isDisabled, onClick: clickHandler, "aria-label": newAriaLabel, id: id, children: loading
348
+ ? (jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }))
349
+ : (jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle })) }));
350
+ }
351
+
324
352
  function DCardHeader({ className, style, children, }) {
325
353
  return (jsxRuntime.jsx("div", { className: classNames('card-header', className), style: style, children: children }));
326
354
  }
@@ -404,7 +432,7 @@ function formatCurrency(amount, options) {
404
432
 
405
433
  function useFormatCurrency(...args) {
406
434
  const { currency } = useDContext();
407
- const format = React.useCallback((value) => formatCurrency(value, currency), [currency]);
435
+ const format = React.useCallback((value, currencyOptions) => formatCurrency(value, currencyOptions || currency), [currency]);
408
436
  const values = (args || []).map((value) => (formatCurrency(value !== null && value !== void 0 ? value : 0, currency)));
409
437
  return {
410
438
  format,
@@ -438,7 +466,7 @@ function useProvidedRefOrCreate(providedRef) {
438
466
  }
439
467
 
440
468
  function DInput(_a, ref) {
441
- var { id: idProp, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, labelIconMaterialStyle, disabled = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconStartMaterialStyle, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, iconEndMaterialStyle, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "labelIconMaterialStyle", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "invalidIcon", "validIcon", "hint", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
469
+ var { id: idProp, style, className, label = '', labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, labelIconMaterialStyle, disabled = false, loading = false, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, iconStart, iconStartDisabled, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconStartMaterialStyle, iconEnd, iconEndDisabled, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, iconEndMaterialStyle, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, size, invalid = false, valid = false, floatingLabel = false, inputStart, inputEnd, value, placeholder = '', onChange, onIconStartClick, onIconEndClick } = _a, inputProps = tslib.__rest(_a, ["id", "style", "className", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "labelIconMaterialStyle", "disabled", "loading", "iconFamilyClass", "iconFamilyPrefix", "iconMaterialStyle", "iconStart", "iconStartDisabled", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconStartMaterialStyle", "iconEnd", "iconEndDisabled", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "iconEndMaterialStyle", "invalidIcon", "validIcon", "hint", "size", "invalid", "valid", "floatingLabel", "inputStart", "inputEnd", "value", "placeholder", "onChange", "onIconStartClick", "onIconEndClick"]);
442
470
  const inputRef = useProvidedRefOrCreate(ref);
443
471
  const innerId = React.useId();
444
472
  const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
@@ -473,6 +501,7 @@ function DInput(_a, ref) {
473
501
  hint,
474
502
  ]);
475
503
  const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", Object.assign({ ref: inputRef, id: id, className: classNames('form-control', {
504
+ [`form-control-${size}`]: !!size,
476
505
  'is-invalid': invalid,
477
506
  'is-valid': valid,
478
507
  }), disabled: disabled || loading, value: value, onChange: handleOnChange }, (floatingLabel || placeholder) && { placeholder: floatingLabel ? '' : placeholder }, ariaDescribedby && { 'aria-describedby': ariaDescribedby }, inputProps))), [
@@ -488,6 +517,7 @@ function DInput(_a, ref) {
488
517
  floatingLabel,
489
518
  valid,
490
519
  value,
520
+ size,
491
521
  ]);
492
522
  const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix, materialStyle: labelIconMaterialStyle }))] })), [
493
523
  id,
@@ -530,7 +560,7 @@ const ForwardedDDatePickerInput = React.forwardRef(DDatePickerInput);
530
560
  ForwardedDDatePickerInput.displayName = 'DDatePickerInput';
531
561
  var DDatePickerInput$1 = ForwardedDDatePickerInput;
532
562
 
533
- function DInputCheck({ id: idProp, type, name, label, ariaLabel, checked = false, disabled = false, indeterminate, value, onChange, className, style, }) {
563
+ function DInputCheck({ id: idProp, type, name, label, ariaLabel, checked = false, disabled = false, invalid = false, valid = false, indeterminate, value, onChange, className, style, }) {
534
564
  const innerRef = React.useRef(null);
535
565
  const innerId = React.useId();
536
566
  const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
@@ -547,10 +577,15 @@ function DInputCheck({ id: idProp, type, name, label, ariaLabel, checked = false
547
577
  innerRef.current.checked = checked;
548
578
  }
549
579
  }, [checked]);
550
- const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", { ref: innerRef, onChange: handleChange, className: classNames('form-check-input', className), style: style, id: id, disabled: disabled, type: type, name: name, value: value, "aria-label": ariaLabel })), [
580
+ const inputComponent = React.useMemo(() => (jsxRuntime.jsx("input", { ref: innerRef, onChange: handleChange, className: classNames('form-check-input', {
581
+ 'is-invalid': invalid,
582
+ 'is-valid': valid,
583
+ }, className), style: style, id: id, disabled: disabled, type: type, name: name, value: value, "aria-label": ariaLabel })), [
551
584
  ariaLabel,
552
585
  className,
553
586
  disabled,
587
+ valid,
588
+ invalid,
554
589
  handleChange,
555
590
  id,
556
591
  name,
@@ -633,13 +668,16 @@ function DSelectSingleValueEmojiText(_a) {
633
668
  }
634
669
 
635
670
  function DSelect(_a) {
636
- var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid, menuWithMaxContent = false, disabled, clearable, loading, rtl, searchable, multi, components, defaultValue, onIconStartClick, onIconEndClick } = _a, props = tslib.__rest(_a, ["id", "className", "style", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "hint", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "invalid", "valid", "menuWithMaxContent", "disabled", "clearable", "loading", "rtl", "searchable", "multi", "components", "defaultValue", "onIconStartClick", "onIconEndClick"]);
671
+ var { id, className, style, label, labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, hint, iconFamilyClass, iconFamilyPrefix, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconStartTabIndex, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconEndTabIndex, invalid, valid, invalidIcon: invalidIconProp, validIcon: validIconProp, menuWithMaxContent = false, disabled, clearable, loading, rtl, searchable, multi, components, defaultValue, onIconStartClick, onIconEndClick } = _a, props = tslib.__rest(_a, ["id", "className", "style", "label", "labelIcon", "labelIconFamilyClass", "labelIconFamilyPrefix", "hint", "iconFamilyClass", "iconFamilyPrefix", "iconStart", "iconStartFamilyClass", "iconStartFamilyPrefix", "iconStartAriaLabel", "iconStartTabIndex", "iconEnd", "iconEndFamilyClass", "iconEndFamilyPrefix", "iconEndAriaLabel", "iconEndTabIndex", "invalid", "valid", "invalidIcon", "validIcon", "menuWithMaxContent", "disabled", "clearable", "loading", "rtl", "searchable", "multi", "components", "defaultValue", "onIconStartClick", "onIconEndClick"]);
637
672
  const handleOnIconStartClick = React.useCallback(() => {
638
673
  onIconStartClick === null || onIconStartClick === void 0 ? void 0 : onIconStartClick(defaultValue);
639
674
  }, [onIconStartClick, defaultValue]);
640
675
  const handleOnIconEndClick = React.useCallback(() => {
641
676
  onIconEndClick === null || onIconEndClick === void 0 ? void 0 : onIconEndClick(defaultValue);
642
677
  }, [onIconEndClick, defaultValue]);
678
+ const { iconMap: { input } } = useDContext();
679
+ const invalidIcon = React.useMemo(() => invalidIconProp || input.invalid, [input.invalid, invalidIconProp]);
680
+ const validIcon = React.useMemo(() => validIconProp || input.valid, [input.valid, validIconProp]);
643
681
  return (jsxRuntime.jsxs("div", { className: classNames('d-select', className, {
644
682
  disabled: disabled || loading,
645
683
  }), style: style, children: [label && (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), jsxRuntime.jsxs("div", { className: classNames({
@@ -649,11 +687,11 @@ function DSelect(_a) {
649
687
  }), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: handleOnIconStartClick, disabled: disabled || loading, "aria-label": iconStartAriaLabel, tabIndex: iconStartTabIndex, children: jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix }) })), jsxRuntime.jsx(Select, Object.assign({ styles: {
650
688
  control: (base) => (Object.assign(Object.assign({}, base), { minHeight: 'unset' })),
651
689
  container: (base) => (Object.assign(Object.assign({}, base), { flex: 1 })),
652
- menu: (base) => (Object.assign(Object.assign({}, base), { width: menuWithMaxContent ? 'max-context' : '100%' })),
690
+ menu: (base) => (Object.assign(Object.assign({}, base), { width: menuWithMaxContent ? 'max-context' : '100%', zIndex: 1000 })),
653
691
  }, className: classNames('d-select-component', {
654
692
  'is-invalid': invalid,
655
693
  'is-valid': valid,
656
- }), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, unstyled: true, components: Object.assign({ DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? 'exclamation-circle' : 'check', familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
694
+ }), classNamePrefix: "d-select", isDisabled: disabled || loading, isClearable: clearable, isLoading: loading, isRtl: rtl, isSearchable: searchable, isMulti: multi, defaultValue: defaultValue, unstyled: true, components: Object.assign({ DropdownIndicator: DSelectDropdownIndicator, ClearIndicator: DSelectClearIndicator, MultiValueRemove: DSelectMultiValueRemove, LoadingIndicator: DSelectLoadingIndicator }, components) }, props)), ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), (iconEnd && !loading) && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: handleOnIconEndClick, disabled: disabled || loading, "aria-label": iconEndAriaLabel, tabIndex: iconEndTabIndex, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
657
695
  }
658
696
  var DSelect$1 = Object.assign(DSelect, {
659
697
  OptionCheck: DSelectOptionCheck,
@@ -956,7 +994,7 @@ function DInputPin({ id: idProp, label = '', labelIcon, labelIconFamilyClass, la
956
994
  }), value: activeInput[index], type: secret ? 'password' : type, "aria-describedby": `${id}State`, inputMode: innerInputMode, id: `pinIndex${index}`, name: `pin-${index}`, maxLength: 1, onInput: (event) => nextInput(event, index), onKeyDown: (event) => prevInput(event, index), onFocus: () => focusInput(index), onWheel: wheelInput, onClick: (event) => event.preventDefault(), onPaste: (event) => handlePaste(event), autoComplete: "off", placeholder: placeholder, disabled: disabled || loading, required: true }, type === 'number' && ({ min: 0, max: 9 })), index))), (invalid || valid) && !loading && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix }) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
957
995
  }
958
996
 
959
- function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, value, floatingLabel = false, invalid = false, valid = false, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
997
+ function DInputSelect({ id: idProp, name, label = '', className, style, options = [], labelIcon, labelIconFamilyClass, labelIconFamilyPrefix, disabled = false, loading = false, iconStart, iconStartFamilyClass, iconStartFamilyPrefix, iconStartAriaLabel, iconEnd, iconEndFamilyClass, iconEndFamilyPrefix, iconEndAriaLabel, iconFamilyClass, iconFamilyPrefix, iconMaterialStyle, invalidIcon: invalidIconProp, validIcon: validIconProp, hint, value, size, floatingLabel = false, invalid = false, valid = false, valueExtractor, labelExtractor, onChange, onBlur, onIconStartClick, onIconEndClick, }) {
960
998
  const innerId = React.useId();
961
999
  const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
962
1000
  const internalValueExtractor = React.useCallback((option) => {
@@ -1005,6 +1043,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
1005
1043
  .join(' ')), [id, iconStart, iconEnd, hint]);
1006
1044
  const selectComponent = React.useMemo(() => (jsxRuntime.jsx("select", Object.assign({ id: id, name: name, className: classNames({
1007
1045
  'form-select': true,
1046
+ [`form-select-${size}`]: !!size,
1008
1047
  'floating-label': floatingLabel,
1009
1048
  'is-invalid': invalid,
1010
1049
  'is-valid': valid,
@@ -1024,6 +1063,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
1024
1063
  floatingLabel,
1025
1064
  invalid,
1026
1065
  valid,
1066
+ size,
1027
1067
  ]);
1028
1068
  const labelComponent = React.useMemo(() => (jsxRuntime.jsxs("label", { htmlFor: id, children: [label, labelIcon && (jsxRuntime.jsx(DIcon, { icon: labelIcon, size: `var(--${PREFIX_BS}input-label-font-size)`, familyClass: labelIconFamilyClass, familyPrefix: labelIconFamilyPrefix }))] })), [
1029
1069
  id,
@@ -1043,7 +1083,7 @@ function DInputSelect({ id: idProp, name, label = '', className, style, options
1043
1083
  }), children: [iconStart && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}Start`, onClick: iconStartClickHandler, disabled: disabled || loading, "aria-label": iconStartAriaLabel, children: iconStart && (jsxRuntime.jsx(DIcon, { icon: iconStart, familyClass: iconStartFamilyClass, familyPrefix: iconStartFamilyPrefix })) })), dynamicComponent, ((invalid || valid) && !iconEnd && !loading) && (jsxRuntime.jsx("span", { className: "input-group-text", id: `${id}State`, children: jsxRuntime.jsx(DIcon, { className: "input-group-validation-icon", icon: invalid ? invalidIcon : validIcon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: iconMaterialStyle }) })), iconEnd && !loading && (jsxRuntime.jsx("button", { type: "button", className: "input-group-text", id: `${id}End`, onClick: iconEndClickHandler, disabled: disabled || loading, "aria-label": iconEndAriaLabel, children: iconEnd && (jsxRuntime.jsx(DIcon, { icon: iconEnd, familyClass: iconEndFamilyClass, familyPrefix: iconEndFamilyPrefix })) })), loading && (jsxRuntime.jsx("div", { className: "input-group-text form-control-icon loading", children: jsxRuntime.jsx("span", { className: "spinner-border spinner-border-sm", role: "status", "aria-hidden": "true", children: jsxRuntime.jsx("span", { className: "visually-hidden", children: "Loading..." }) }) }))] }), hint && (jsxRuntime.jsx("div", { className: "form-text", id: `${id}Hint`, children: hint }))] }));
1044
1084
  }
1045
1085
 
1046
- function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, readonly, className, style, onChange, }) {
1086
+ function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, invalid = false, valid = false, readonly, className, style, onChange, }) {
1047
1087
  const innerId = React.useId();
1048
1088
  const id = React.useMemo(() => idProp || innerId, [idProp, innerId]);
1049
1089
  const [internalIsChecked, setInternalIsChecked] = React.useState(checked);
@@ -1055,7 +1095,10 @@ function DInputSwitch({ id: idProp, label, ariaLabel, name, checked, disabled, r
1055
1095
  setInternalIsChecked(value);
1056
1096
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
1057
1097
  }, [onChange]);
1058
- return (jsxRuntime.jsxs("div", { className: "form-check form-switch", children: [jsxRuntime.jsx("input", { id: id, name: name, onChange: readonly ? () => false : changeHandler, className: classNames('form-check-input', className), style: style, type: "checkbox", role: "switch", checked: internalIsChecked, disabled: disabled, "aria-label": ariaLabel }), label && (jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label }))] }));
1098
+ return (jsxRuntime.jsxs("div", { className: "form-check form-switch", children: [jsxRuntime.jsx("input", { id: id, name: name, onChange: readonly ? () => false : changeHandler, className: classNames('form-check-input', {
1099
+ 'is-invalid': invalid,
1100
+ 'is-valid': valid,
1101
+ }, className), style: style, type: "checkbox", role: "switch", checked: internalIsChecked, disabled: disabled, "aria-label": ariaLabel }), label && (jsxRuntime.jsx("label", { className: "form-check-label", htmlFor: id, children: label }))] }));
1059
1102
  }
1060
1103
 
1061
1104
  function DInputRange(_a, ref) {
@@ -1124,7 +1167,7 @@ var DList$1 = Object.assign(DList, {
1124
1167
  function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1125
1168
  const { iconMap: { xLg, }, } = useDContext();
1126
1169
  const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
1127
- return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-modal-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1170
+ return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1128
1171
  }
1129
1172
 
1130
1173
  function DModalBody({ children, className, style, }) {
@@ -1161,7 +1204,7 @@ var DModal$1 = Object.assign(DModal, {
1161
1204
  function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1162
1205
  const { iconMap: { xLg, }, } = useDContext();
1163
1206
  const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
1164
- return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-offcanvas-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1207
+ return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", { children: children }), showCloseButton && (jsxRuntime.jsx("button", { type: "button", className: "d-close", "aria-label": "Close", onClick: onClose, children: jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1165
1208
  }
1166
1209
 
1167
1210
  function DOffcanvasBody({ children, className, style, }) {
@@ -1318,7 +1361,7 @@ function DSkeleton({ speed = 2, viewBox, backgroundColor, foregroundColor, child
1318
1361
  return (jsxRuntime.jsx(ContentLoader, { speed: speed, viewBox: viewBox, backgroundColor: innerBackgroundColor, foregroundColor: innerForegroundColor, children: children }));
1319
1362
  }
1320
1363
 
1321
- function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, className, style, }) {
1364
+ function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, completed, className, style, }) {
1322
1365
  const { iconMap: { check, }, } = useDContext();
1323
1366
  const icon = React.useMemo(() => iconSuccessProp || check, [check, iconSuccessProp]);
1324
1367
  if (currentStep < 1 || currentStep > options.length) {
@@ -1329,9 +1372,9 @@ function DStepper$2({ options, currentStep, iconSuccess: iconSuccessProp, iconSu
1329
1372
  'is-vertical': vertical,
1330
1373
  }, className), style: style, children: options.map(({ label, value }) => (jsxRuntime.jsxs("div", { className: "d-step", children: [jsxRuntime.jsx("div", { className: "d-step-value", children: jsxRuntime.jsx("div", { className: classNames({
1331
1374
  'd-step-icon-container': true,
1332
- 'd-step-check': value < currentStep,
1333
- 'd-step-current': value === currentStep,
1334
- }), children: value < currentStep
1375
+ 'd-step-check': value < currentStep || completed,
1376
+ 'd-step-current': value === currentStep && !completed,
1377
+ }), children: value < currentStep || completed
1335
1378
  ? (jsxRuntime.jsx(DIcon, { icon: icon, familyClass: iconSuccessFamilyClass, familyPrefix: iconSuccessFamilyPrefix, materialStyle: iconSuccessMaterialStyle, className: "d-step-icon" }))
1336
1379
  : value }) }), jsxRuntime.jsx("div", { className: "d-step-label", children: label })] }, value))) }));
1337
1380
  }
@@ -1366,8 +1409,8 @@ function DStepper$1({ options, currentStep, className, style, }) {
1366
1409
  return (jsxRuntime.jsxs("div", { className: classNames('d-stepper', className), style: style, children: [jsxRuntime.jsx("div", { className: "d-step-bar", style: { background: progressStyle }, children: jsxRuntime.jsx("p", { className: "d-step-number", children: `${currentStep}/${options.length}` }) }), jsxRuntime.jsx("div", { className: "d-step-info", children: Object.keys(currentOption).length > 0 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-step-label", children: currentOption.label }), jsxRuntime.jsx("div", { className: "d-step-description", children: currentOption.description || '' })] })) })] }));
1367
1410
  }
1368
1411
 
1369
- function DStepper({ options, currentStep, iconSuccess, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, breakpoint = 'lg', className, style, }) {
1370
- return (jsxRuntime.jsxs("div", { className: className, style: style, children: [jsxRuntime.jsx("div", { className: `d-block d-${breakpoint}-none`, children: jsxRuntime.jsx(DStepper$1, { options: options, currentStep: currentStep }) }), jsxRuntime.jsx("div", { className: `d-none d-${breakpoint}-block`, children: jsxRuntime.jsx(DStepper$2, { options: options, currentStep: currentStep, vertical: vertical, iconSuccess: iconSuccess, iconSuccessFamilyClass: iconSuccessFamilyClass, iconSuccessFamilyPrefix: iconSuccessFamilyPrefix, iconSuccessMaterialStyle: iconSuccessMaterialStyle }) })] }));
1412
+ function DStepper({ options, currentStep, iconSuccess, iconSuccessFamilyClass, iconSuccessFamilyPrefix, iconSuccessMaterialStyle = false, vertical = false, breakpoint = 'lg', className, completed = false, style, }) {
1413
+ return (jsxRuntime.jsxs("div", { className: className, style: style, children: [jsxRuntime.jsx("div", { className: `d-block d-${breakpoint}-none`, children: jsxRuntime.jsx(DStepper$1, { options: options, currentStep: currentStep }) }), jsxRuntime.jsx("div", { className: `d-none d-${breakpoint}-block`, children: jsxRuntime.jsx(DStepper$2, { options: options, currentStep: currentStep, vertical: vertical, iconSuccess: iconSuccess, iconSuccessFamilyClass: iconSuccessFamilyClass, iconSuccessFamilyPrefix: iconSuccessFamilyPrefix, iconSuccessMaterialStyle: iconSuccessMaterialStyle, completed: completed }) })] }));
1371
1414
  }
1372
1415
 
1373
1416
  const ARROW_WIDTH = 8;
@@ -1468,33 +1511,55 @@ var DToast$1 = Object.assign(DToast, {
1468
1511
  Body: DToastBody,
1469
1512
  });
1470
1513
 
1471
- const TOAST_TRANSITIONS$1 = {
1472
- bounce: reactToastify.Bounce,
1473
- flip: reactToastify.Flip,
1474
- slide: reactToastify.Slide,
1475
- zoom: reactToastify.Zoom,
1476
- };
1477
- function DToastContainer({ style, className, closeOnClick, position = 'bottom-center', autoClose = false, stacked = false, transition = 'slide', containerId, }) {
1478
- const selectedTransition = React.useMemo(() => TOAST_TRANSITIONS$1[transition], [transition]);
1479
- return (jsxRuntime.jsx(reactToastify.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 }));
1514
+ function DToastContainer({ containerClassName, position = 'bottom-center', reverseOrder = false, containerStyle, toastOptions, gutter, }) {
1515
+ return (jsxRuntime.jsx(reactHotToast.Toaster, { containerClassName: containerClassName, position: position, reverseOrder: reverseOrder, containerStyle: containerStyle, gutter: gutter, toastOptions: toastOptions }));
1480
1516
  }
1481
1517
 
1482
- const TOAST_TRANSITIONS = {
1483
- bounce: reactToastify.Bounce,
1484
- flip: reactToastify.Flip,
1485
- slide: reactToastify.Slide,
1486
- zoom: reactToastify.Zoom,
1487
- };
1488
1518
  function useDToast() {
1489
- const toast = React.useCallback((message, _a) => {
1490
- var { icon, iconClose, type = 'info', showClose = true, transition } = _a, rest = tslib.__rest(_a, ["icon", "iconClose", "type", "showClose", "transition"]);
1491
- reactToastify.toast(({ closeToast }) => (jsxRuntime.jsx(DAlert, { onClose: closeToast, id: "alertID", type: type, icon: icon, iconClose: iconClose, showClose: showClose, children: message })), Object.assign({ transition: transition && TOAST_TRANSITIONS[transition] }, rest));
1492
- }, []);
1519
+ const { iconMap: { xLg, }, } = useDContext();
1520
+ const toast = React.useCallback((data, toastProps) => {
1521
+ if (typeof data === 'function') {
1522
+ return reactHotToast.toast.custom(data, toastProps);
1523
+ }
1524
+ const { title, description, icon, closeIcon, timestamp, theme, soft, } = data;
1525
+ return reactHotToast.toast.custom(({ id, visible }) => {
1526
+ if (!visible) {
1527
+ return null;
1528
+ }
1529
+ return (jsxRuntime.jsxs(DToast$1, { className: classNames({
1530
+ [`bg-${theme}-soft`]: !!theme && soft,
1531
+ [`text-bg-${theme}`]: !!theme && !soft,
1532
+ 'border-0': !!theme,
1533
+ }, 'show'), children: [!description && (jsxRuntime.jsxs(DToast$1.Body, { className: "d-flex justify-content-between align-items-center", children: [jsxRuntime.jsx("span", { className: "me-auto", children: title }), jsxRuntime.jsx("button", { type: "button", className: classNames({
1534
+ [`text-bg-${theme}`]: !!theme && !soft,
1535
+ 'd-close': true,
1536
+ }), "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] })), description && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(DToast$1.Header, { className: classNames({
1537
+ [`bg-${theme}-soft`]: !!theme && soft,
1538
+ [`text-bg-${theme}`]: !!theme && !soft,
1539
+ }, 'show'), children: [icon && (jsxRuntime.jsx(DIcon, { icon: icon })), jsxRuntime.jsx("p", { className: "mb-0 me-auto", children: title }), timestamp && (jsxRuntime.jsx("small", { children: timestamp })), jsxRuntime.jsx("button", { type: "button", className: classNames({
1540
+ [`text-bg-${theme}`]: !!theme && !soft,
1541
+ 'd-close': true,
1542
+ }), "aria-label": "Close", onClick: () => reactHotToast.toast.dismiss(id), children: jsxRuntime.jsx(DIcon, { icon: closeIcon || xLg }) })] }), jsxRuntime.jsx(DToast$1.Body, { className: "d-flex justify-content-between align-items-center", children: jsxRuntime.jsx("span", { children: description }) })] }))] }));
1543
+ }, toastProps);
1544
+ }, [xLg]);
1493
1545
  return {
1494
1546
  toast,
1495
1547
  };
1496
1548
  }
1497
1549
 
1550
+ function DTableHead({ className, style, field, label, value = '', onChange, }) {
1551
+ const handleOnChange = React.useCallback(() => {
1552
+ if (value === field) {
1553
+ return onChange(`-${field}`);
1554
+ }
1555
+ if (value === `-${field}`) {
1556
+ return onChange('');
1557
+ }
1558
+ return onChange(field);
1559
+ }, [field, value, onChange]);
1560
+ return (jsxRuntime.jsx("th", { style: style, className: classNames('d-table-head', className), children: jsxRuntime.jsxs("button", { type: "button", onClick: handleOnChange, children: [label, value && value.includes(field) && (jsxRuntime.jsx(DIcon, { icon: value === field ? 'arrow-up' : 'arrow-down' }))] }) }));
1561
+ }
1562
+
1498
1563
  async function configureI8n(resources, _a = {}) {
1499
1564
  var { lng = 'en', fallbackLng = 'en' } = _a, config = tslib.__rest(_a, ["lng", "fallbackLng"]);
1500
1565
  return i18n
@@ -1513,6 +1578,7 @@ exports.DAlert = DAlert;
1513
1578
  exports.DBadge = DBadge;
1514
1579
  exports.DBoxFile = DBoxFile;
1515
1580
  exports.DButton = DButton;
1581
+ exports.DButtonIcon = DButtonIcon;
1516
1582
  exports.DCard = DCard$1;
1517
1583
  exports.DCardBody = DCardBody;
1518
1584
  exports.DCardFooter = DCardFooter;
@@ -1562,6 +1628,7 @@ exports.DStepper = DStepper;
1562
1628
  exports.DStepperDesktop = DStepper$2;
1563
1629
  exports.DStepperMobile = DStepper$1;
1564
1630
  exports.DTabContent = DTabContent;
1631
+ exports.DTableHead = DTableHead;
1565
1632
  exports.DTabs = DTabs$1;
1566
1633
  exports.DToast = DToast$1;
1567
1634
  exports.DToastContainer = DToastContainer;