@dynamic-framework/ui-react 1.16.0 → 1.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1038,16 +1038,15 @@ var DList$1 = Object.assign(DList, {
1038
1038
  function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1039
1039
  const { iconMap: { xLg, }, } = useDContext();
1040
1040
  const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
1041
- return (jsxRuntime.jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsxRuntime.jsx("div", { className: "d-modal-slot", 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 }) }))] }));
1041
+ 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 }) }))] }));
1042
1042
  }
1043
1043
 
1044
1044
  function DModalBody({ children, className, style, }) {
1045
- const generateStyleVariables = React.useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}modal-component-body-padding`]: 0 })), [style]);
1046
- return (jsxRuntime.jsx("div", { className: classNames('d-modal-slot modal-body', className), style: generateStyleVariables, children: children }));
1045
+ return (jsxRuntime.jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
1047
1046
  }
1048
1047
 
1049
1048
  function DModalFooter({ className, style, actionPlacement = 'fill', children, }) {
1050
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(`d-modal-slot modal-footer d-modal-action-${actionPlacement}`, className), style: style, children: children })] }));
1049
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "d-modal-separator" }), jsxRuntime.jsx("div", { className: classNames(`modal-footer d-modal-action-${actionPlacement}`, className), style: style, children: children })] }));
1051
1050
  }
1052
1051
 
1053
1052
  function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, }) {
@@ -1076,15 +1075,15 @@ var DModal$1 = Object.assign(DModal, {
1076
1075
  function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1077
1076
  const { iconMap: { xLg, }, } = useDContext();
1078
1077
  const icon = React.useMemo(() => iconProp || xLg, [iconProp, xLg]);
1079
- return (jsxRuntime.jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsxRuntime.jsx("div", { className: "d-offcanvas-slot", 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 }) }))] }));
1078
+ 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 }) }))] }));
1080
1079
  }
1081
1080
 
1082
1081
  function DOffcanvasBody({ children, className, style, }) {
1083
- return (jsxRuntime.jsx("div", { className: classNames('d-offcanvas-slot offcanvas-body', className), style: style, children: children }));
1082
+ return (jsxRuntime.jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
1084
1083
  }
1085
1084
 
1086
1085
  function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className, style, }) {
1087
- return (jsxRuntime.jsx("div", { className: classNames(`d-offcanvas-slot d-offcanvas-footer d-offcanvas-action-${footerActionPlacement}`, className), style: style, children: children }));
1086
+ return (jsxRuntime.jsx("div", { className: classNames(`d-offcanvas-footer d-offcanvas-action-${footerActionPlacement}`, className), style: style, children: children }));
1088
1087
  }
1089
1088
 
1090
1089
  function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
@@ -1334,7 +1333,7 @@ function DTabContent({ tab, children, className, style, }) {
1334
1333
  return (jsxRuntime.jsx("div", { className: classNames('tab-pane fade show active', className), id: `${tab}Pane`, role: "tabpanel", tabIndex: 0, "aria-labelledby": `${tab}Tab`, style: style, children: children }));
1335
1334
  }
1336
1335
 
1337
- function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, }) {
1336
+ function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, pill, }) {
1338
1337
  const [selected, setSelected] = React.useState(defaultSelected);
1339
1338
  const onSelect = React.useCallback((option) => {
1340
1339
  if (option.tab) {
@@ -1349,10 +1348,11 @@ function DTabs({ children, defaultSelected, onChange, options, className, style,
1349
1348
  const value = React.useMemo(() => ({
1350
1349
  isSelected,
1351
1350
  }), [isSelected]);
1351
+ const generateClasses = React.useMemo(() => (Object.assign({ nav: true, 'flex-column align-items-center': vertical, 'nav-pills': pill, 'nav-tabs': !pill }, className && { [className]: true })), [vertical, pill, className]);
1352
1352
  return (jsxRuntime.jsx(TabContext.Provider, { value: value, children: jsxRuntime.jsxs("div", { className: classNames({
1353
- 'd-tabs': true,
1354
- 'd-tabs-vertical': vertical,
1355
- }, className), style: style, children: [jsxRuntime.jsx("nav", { className: "nav", children: options.map((option) => (jsxRuntime.jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
1353
+ 'd-flex': true,
1354
+ 'flex-column': !vertical,
1355
+ }, className), style: style, children: [jsxRuntime.jsx("nav", { className: classNames(generateClasses), children: options.map((option) => (jsxRuntime.jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
1356
1356
  active: option.tab === selected,
1357
1357
  }, className), type: "button", role: "tab", "aria-controls": `${option.tab}Pane`, "aria-selected": option.tab === selected, disabled: option.disabled, onClick: () => onSelect(option), children: option.label }, option.label))) }), jsxRuntime.jsx("div", { className: "tab-content", children: children })] }) }));
1358
1358
  }