@allxsmith/bestax-bulma 5.16.9 → 5.16.10

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.cjs CHANGED
@@ -1690,18 +1690,6 @@ const Breadcrumb = ({ className, alignment, separator, size, children, ...props
1690
1690
  */
1691
1691
  const mergeBulmaStyles = (helperStyles, style) => helperStyles || style ? { ...helperStyles, ...style } : undefined;
1692
1692
 
1693
- /**
1694
- * Wrap each footer item in a `.card-footer-item` span.
1695
- * @param {CardProps['footer']} footer - Footer content (single node or array).
1696
- * @param {string | undefined} classPrefix - Bulma class prefix.
1697
- * @returns {React.ReactNode[] | null} Wrapped footer items, or null if no footer.
1698
- */
1699
- const renderFooter = (footer, classPrefix) => {
1700
- if (!footer)
1701
- return null;
1702
- const items = Array.isArray(footer) ? footer : [footer];
1703
- return items.map((item, idx) => (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: item }, idx)));
1704
- };
1705
1693
  /**
1706
1694
  * Check if children contain any Card compound sub-components.
1707
1695
  * @param {React.ReactNode} children - The children to inspect.
@@ -1749,6 +1737,9 @@ const CardComponent = ({ className, children, textColor, color, bgColor, hasShad
1749
1737
  'is-centered': headerCentered,
1750
1738
  }), children: header })), headerIcon] }));
1751
1739
  };
1740
+ // Any falsy footer (including `0`) and an empty array render no footer bar,
1741
+ // rather than a stray `0` or an empty `.card-footer`.
1742
+ const hasFooter = Array.isArray(footer) ? footer.length > 0 : Boolean(footer);
1752
1743
  return (jsxRuntime.jsxs("div", { className: cardClasses, style: mergeBulmaStyles(bulmaHelperStyles, style), ...rest, children: [renderHeader(header, headerIcon, headerCentered, classPrefix), image && (jsxRuntime.jsx("div", { className: prefixedClassNames(classPrefix, 'card-image'), children: typeof image === 'string' ? (jsxRuntime.jsx("figure", { className: prefixedClassNames(classPrefix, 'image'), children: jsxRuntime.jsx("img", { src: image, alt: imageAlt ?? 'Card image' }) })) : (image) })), typeof children !== 'undefined' &&
1753
1744
  children !== null &&
1754
1745
  children !== '' &&
@@ -1756,9 +1747,7 @@ const CardComponent = ({ className, children, textColor, color, bgColor, hasShad
1756
1747
  children !== null &&
1757
1748
  children !== '' &&
1758
1749
  hasCompoundComponents(children) &&
1759
- children, footer && (jsxRuntime.jsx("footer", { className: prefixedClassNames(classPrefix, 'card-footer'), children: Array.isArray(footer)
1760
- ? footer.map((item, idx) => (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: item }, idx)))
1761
- : footer && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: footer })) }))] }));
1750
+ children, hasFooter && (jsxRuntime.jsx("footer", { className: prefixedClassNames(classPrefix, 'card-footer'), children: Array.isArray(footer) ? (footer.map((item, idx) => (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: item }, idx)))) : (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'card-footer-item'), children: footer })) }))] }));
1762
1751
  };
1763
1752
  /**
1764
1753
  * Card header compound component. Wraps children in a `.card-header` element.
@@ -1888,8 +1877,6 @@ const Card = withSubComponents(CardComponent, {
1888
1877
  Footer: CardFooter,
1889
1878
  FooterItem: CardFooterItem,
1890
1879
  }, 'Card');
1891
- /** Internal test-only exports. Not part of the public API. */
1892
- const __test_exports__ = { renderFooter };
1893
1880
 
1894
1881
  /**
1895
1882
  * The runtime mirror of `AnchorOnlyAttributes`, keyed so the two cannot drift.
@@ -1962,6 +1949,9 @@ function omitAttrs(props, strip) {
1962
1949
 
1963
1950
  /**
1964
1951
  * Checks if code is running in a browser environment.
1952
+ * @deprecated Dropdown's internal SSR guard, exported by accident; it will
1953
+ * be removed in the next major. Check `typeof window !== 'undefined' &&
1954
+ * typeof document !== 'undefined'` instead.
1965
1955
  * @param win - Window object.
1966
1956
  * @param doc - Document object.
1967
1957
  * @returns {boolean} True if in browser, false otherwise.
@@ -2064,7 +2054,10 @@ const DropdownComponent = React.forwardRef(function DropdownComponent({ label, c
2064
2054
  /* istanbul ignore next: dropdownRef.current is never null once mounted */
2065
2055
  if (!dropdownRef.current)
2066
2056
  return [];
2067
- return Array.from(dropdownRef.current.querySelectorAll('[role="menuitem"]')).filter(el => !el.hasAttribute('disabled') &&
2057
+ return Array.from(
2058
+ // Every menu-item role, so an item a caller gives `menuitemcheckbox`
2059
+ // or `menuitemradio` (a filter or sort menu) stays reachable.
2060
+ dropdownRef.current.querySelectorAll('[role="menuitem"], [role="menuitemcheckbox"], [role="menuitemradio"]')).filter(el => !el.hasAttribute('disabled') &&
2068
2061
  el.getAttribute('aria-disabled') !== 'true');
2069
2062
  };
2070
2063
  // Focus the pending menu item once the menu becomes visible; the item is
@@ -2232,7 +2225,11 @@ const DropdownItem = ((itemProps) => {
2232
2225
  const forwarded = Component === 'a' ? rest : omitAttrs(rest, STRIP_FROM_NON_ANCHOR$1);
2233
2226
  return (jsxRuntime.jsx(Component, { className: classNames(usePrefixedClassNames('dropdown-item', {
2234
2227
  'is-active': active,
2235
- }), bulmaHelperClasses, className), tabIndex: 0, role: "menuitem", "data-testid": "dropdown-item", ...forwarded, ...(Component === 'button'
2228
+ }), bulmaHelperClasses, className), tabIndex: 0, "data-testid": "dropdown-item", ...forwarded,
2229
+ // After `forwarded` for the same reason as `type` below: a spread
2230
+ // carrying `role: undefined` would otherwise erase the default, and an
2231
+ // item with no role drops out of the menu and its arrow-key order.
2232
+ role: forwarded.role ?? 'menuitem', ...(Component === 'button'
2236
2233
  ? {
2237
2234
  type: forwarded.type ?? 'button',
2238
2235
  }
@@ -2887,7 +2884,7 @@ const NavbarBurger = React.forwardRef(function NavbarBurger({ className, active,
2887
2884
  });
2888
2885
  return (jsxRuntime.jsxs("button", { ref: ref, type: "button", className: classNames(usePrefixedClassNames('navbar-burger', {
2889
2886
  'is-active': active,
2890
- }), bulmaHelperClasses, className), "aria-label": props['aria-label'] || 'menu', "aria-expanded": props['aria-expanded'] ?? !!active, ...rest, children: [jsxRuntime.jsx("span", { "aria-hidden": "true" }), jsxRuntime.jsx("span", { "aria-hidden": "true" }), jsxRuntime.jsx("span", { "aria-hidden": "true" }), children] }));
2887
+ }), bulmaHelperClasses, className), "aria-label": props['aria-label'] || 'menu', "aria-expanded": props['aria-expanded'] ?? !!active, ...rest, children: [jsxRuntime.jsx("span", { "aria-hidden": "true" }), jsxRuntime.jsx("span", { "aria-hidden": "true" }), jsxRuntime.jsx("span", { "aria-hidden": "true" }), jsxRuntime.jsx("span", { "aria-hidden": "true" }), children] }));
2891
2888
  });
2892
2889
  NavbarBurger.displayName = 'NavbarBurger';
2893
2890
  /**
@@ -6169,6 +6166,7 @@ const notification = {
6169
6166
  const NotificationItem = ({ instance, onClose }) => {
6170
6167
  const { message, color, isLight, duration = 3000, hasDelete = true, indefinite = false, pauseOnHover = true, } = instance.options;
6171
6168
  const [isPaused, setIsPaused] = React.useState(false);
6169
+ const urgent = color === 'danger' || color === 'warning';
6172
6170
  const handleClose = React.useCallback(() => {
6173
6171
  onClose(instance.id);
6174
6172
  }, [onClose, instance.id]);
@@ -6187,11 +6185,13 @@ const NotificationItem = ({ instance, onClose }) => {
6187
6185
  if (pauseOnHover)
6188
6186
  setIsPaused(false);
6189
6187
  }, [pauseOnHover]);
6190
- return (jsxRuntime.jsx(Notification, { color: color, isLight: isLight, hasDelete: hasDelete, onDelete: handleClose, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: { pointerEvents: 'auto' }, children: message }));
6188
+ return (jsxRuntime.jsx(Notification, { color: color, isLight: isLight, hasDelete: hasDelete, onDelete: handleClose, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, style: { pointerEvents: 'auto' }, children: urgent ? (jsxRuntime.jsx("span", { role: "alert", "aria-live": "assertive", children: message })) : (jsxRuntime.jsx("span", { role: "status", "aria-live": "polite", children: message })) }));
6191
6189
  };
6192
6190
  /**
6193
6191
  * Container component for rendering programmatic notifications.
6194
- * Place once at your app root to enable the notification API.
6192
+ * Place once at your app root to enable the notification API. Mount it
6193
+ * before calling `notification`: a notification shown while no container is
6194
+ * mounted doesn't appear when one mounts, only alongside the next call.
6195
6195
  *
6196
6196
  * @function
6197
6197
  * @param {{ position?: NotificationPosition }} props - Container props.
@@ -13494,7 +13494,6 @@ exports.ToastContainer = ToastContainer;
13494
13494
  exports.Tooltip = Tooltip;
13495
13495
  exports.Tr = Tr;
13496
13496
  exports.UnorderedList = UnorderedList;
13497
- exports.__test_exports__ = __test_exports__;
13498
13497
  exports.checkboxColors = checkboxColors;
13499
13498
  exports.checkboxSizes = checkboxSizes;
13500
13499
  exports.classNames = classNames;