@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.esm.js CHANGED
@@ -1036,16 +1036,15 @@ var DList$1 = Object.assign(DList, {
1036
1036
  function DModalHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1037
1037
  const { iconMap: { xLg, }, } = useDContext();
1038
1038
  const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
1039
- return (jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { className: "d-modal-slot", children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-modal-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1039
+ return (jsxs("div", { className: classNames('modal-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-modal-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1040
1040
  }
1041
1041
 
1042
1042
  function DModalBody({ children, className, style, }) {
1043
- const generateStyleVariables = useMemo(() => (Object.assign(Object.assign({}, style), { [`--${PREFIX_BS}modal-component-body-padding`]: 0 })), [style]);
1044
- return (jsx("div", { className: classNames('d-modal-slot modal-body', className), style: generateStyleVariables, children: children }));
1043
+ return (jsx("div", { className: classNames('modal-body', className), style: style, children: children }));
1045
1044
  }
1046
1045
 
1047
1046
  function DModalFooter({ className, style, actionPlacement = 'fill', children, }) {
1048
- return (jsxs(Fragment, { children: [jsx("div", { className: "d-modal-separator" }), jsx("div", { className: classNames(`d-modal-slot modal-footer d-modal-action-${actionPlacement}`, className), style: style, children: children })] }));
1047
+ return (jsxs(Fragment, { children: [jsx("div", { className: "d-modal-separator" }), jsx("div", { className: classNames(`modal-footer d-modal-action-${actionPlacement}`, className), style: style, children: children })] }));
1049
1048
  }
1050
1049
 
1051
1050
  function DModal({ name, className, style, staticBackdrop, scrollable, centered, fullScreen, fullScreenFrom, size, children, }) {
@@ -1074,15 +1073,15 @@ var DModal$1 = Object.assign(DModal, {
1074
1073
  function DOffcanvasHeader({ showCloseButton, onClose, children, className, style, iconFamilyClass, iconFamilyPrefix, icon: iconProp, materialStyle = false, }) {
1075
1074
  const { iconMap: { xLg, }, } = useDContext();
1076
1075
  const icon = useMemo(() => iconProp || xLg, [iconProp, xLg]);
1077
- return (jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsx("div", { className: "d-offcanvas-slot", children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-offcanvas-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1076
+ return (jsxs("div", { className: classNames('offcanvas-header', className), style: style, children: [jsx("div", { children: children }), showCloseButton && (jsx("button", { type: "button", className: "d-offcanvas-close", "aria-label": "Close", onClick: onClose, children: jsx(DIcon, { icon: icon, familyClass: iconFamilyClass, familyPrefix: iconFamilyPrefix, materialStyle: materialStyle }) }))] }));
1078
1077
  }
1079
1078
 
1080
1079
  function DOffcanvasBody({ children, className, style, }) {
1081
- return (jsx("div", { className: classNames('d-offcanvas-slot offcanvas-body', className), style: style, children: children }));
1080
+ return (jsx("div", { className: classNames('offcanvas-body', className), style: style, children: children }));
1082
1081
  }
1083
1082
 
1084
1083
  function DOffcanvasFooter({ footerActionPlacement = 'fill', children, className, style, }) {
1085
- return (jsx("div", { className: classNames(`d-offcanvas-slot d-offcanvas-footer d-offcanvas-action-${footerActionPlacement}`, className), style: style, children: children }));
1084
+ return (jsx("div", { className: classNames(`d-offcanvas-footer d-offcanvas-action-${footerActionPlacement}`, className), style: style, children: children }));
1086
1085
  }
1087
1086
 
1088
1087
  function DOffcanvas({ name, className, style, staticBackdrop, scrollable, openFrom = 'end', children, }) {
@@ -1332,7 +1331,7 @@ function DTabContent({ tab, children, className, style, }) {
1332
1331
  return (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 }));
1333
1332
  }
1334
1333
 
1335
- function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, }) {
1334
+ function DTabs({ children, defaultSelected, onChange, options, className, style, vertical, pill, }) {
1336
1335
  const [selected, setSelected] = useState(defaultSelected);
1337
1336
  const onSelect = useCallback((option) => {
1338
1337
  if (option.tab) {
@@ -1347,10 +1346,11 @@ function DTabs({ children, defaultSelected, onChange, options, className, style,
1347
1346
  const value = useMemo(() => ({
1348
1347
  isSelected,
1349
1348
  }), [isSelected]);
1349
+ const generateClasses = useMemo(() => (Object.assign({ nav: true, 'flex-column align-items-center': vertical, 'nav-pills': pill, 'nav-tabs': !pill }, className && { [className]: true })), [vertical, pill, className]);
1350
1350
  return (jsx(TabContext.Provider, { value: value, children: jsxs("div", { className: classNames({
1351
- 'd-tabs': true,
1352
- 'd-tabs-vertical': vertical,
1353
- }, className), style: style, children: [jsx("nav", { className: "nav", children: options.map((option) => (jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
1351
+ 'd-flex': true,
1352
+ 'flex-column': !vertical,
1353
+ }, className), style: style, children: [jsx("nav", { className: classNames(generateClasses), children: options.map((option) => (jsx("button", { id: `${option.tab}Tab`, className: classNames('nav-link', {
1354
1354
  active: option.tab === selected,
1355
1355
  }, 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))) }), jsx("div", { className: "tab-content", children: children })] }) }));
1356
1356
  }