@allxsmith/bestax-bulma 2.0.1 → 2.0.2

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
@@ -564,6 +564,11 @@ const validColorShades = [
564
564
  '90',
565
565
  '95',
566
566
  'invert',
567
+ 'light',
568
+ 'dark',
569
+ 'soft',
570
+ 'bold',
571
+ 'on-scheme',
567
572
  ];
568
573
  const validSizes$1 = ['0', '1', '2', '3', '4', '5', '6', 'auto'];
569
574
  const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'];
@@ -600,7 +605,7 @@ const validDisplays = [
600
605
  'inline-block',
601
606
  'inline-flex',
602
607
  ];
603
- const validVisibilities = ['hidden', 'sr-only'];
608
+ const validVisibilities = ['hidden', 'sr-only', 'invisible'];
604
609
  const validFlexDirections = [
605
610
  'row',
606
611
  'row-reverse',
@@ -656,54 +661,93 @@ const validViewports = [
656
661
  ];
657
662
  const useBulmaClasses = (props) => {
658
663
  const { classPrefix } = useConfig();
659
- const { color, backgroundColor, colorShade, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, textSize, textAlign, textTransform, textWeight, fontFamily, display, visibility, flexDirection, flexWrap, justifyContent, alignContent, alignItems, alignSelf, flexGrow, flexShrink, float, overflow, overlay, interaction, radius, shadow, responsive, viewport, displayMobile, displayTablet, displayDesktop, displayWidescreen, displayFullhd, skeleton, ...rest } = props;
664
+ const { color, backgroundColor, colorShade, backgroundColorShade, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, textSize, textAlign, textTransform, textWeight, fontFamily, display, visibility, flexDirection, flexWrap, justifyContent, alignContent, alignItems, alignSelf, flexGrow, flexShrink, float, overflow, overlay, interaction, radius, shadow, responsive, viewport, displayMobile, displayTablet, displayDesktop, displayWidescreen, displayFullhd, textSizeMobile, textSizeTablet, textSizeDesktop, textSizeWidescreen, textSizeFullhd, textAlignMobile, textAlignTablet, textAlignDesktop, textAlignWidescreen, textAlignFullhd, visibilityMobile, visibilityTablet, visibilityDesktop, visibilityWidescreen, visibilityFullhd, skeleton, clearfix, relative, ...rest } = props;
660
665
  const bulmaHelperClasses = useMemo(() => {
661
666
  const classes = [];
662
667
  const addPrefixedClass = (className) => {
663
668
  classes.push(classPrefix ? `${classPrefix}${className}` : className);
664
669
  };
665
- const addClass = (prefix, value, validValues) => {
666
- if (value && (!validValues.length || validValues.includes(value))) {
667
- const className = viewport && validViewports.includes(viewport)
670
+ const addClass = (prefix, value, validValues, supportsViewport = false) => {
671
+ if (value && validValues.includes(value)) {
672
+ const className = supportsViewport && viewport && validViewports.includes(viewport)
668
673
  ? `${prefix}-${value}-${viewport}`
669
674
  : `${prefix}-${value}`;
670
675
  addPrefixedClass(className);
671
676
  }
672
677
  };
678
+ const addClassNoViewport = (prefix, value, validValues) => {
679
+ if (value && (!validValues.length || validValues.includes(value))) {
680
+ addPrefixedClass(`${prefix}-${value}`);
681
+ }
682
+ };
673
683
  const addColorClass = (prefix, value, shade) => {
674
684
  if (!value || ![...validColors, 'inherit', 'current'].includes(value))
675
685
  return;
676
686
  if (shade && validColorShades.includes(shade)) {
677
- const className = prefix === 'has-text' && viewport && validViewports.includes(viewport)
678
- ? `${prefix}-${value}-${shade}-${viewport}`
679
- : `${prefix}-${value}-${shade}`;
687
+ const className = `${prefix}-${value}-${shade}`;
680
688
  addPrefixedClass(className);
681
689
  }
682
690
  else {
683
- addClass(prefix, value, [...validColors, 'inherit', 'current']);
691
+ addClass(prefix, value, [...validColors, 'inherit', 'current'], false);
684
692
  }
685
693
  };
686
694
  addColorClass('has-text', color, colorShade);
687
- addColorClass('has-background', backgroundColor, colorShade);
688
- addClass('m', m, validSizes$1);
689
- addClass('mt', mt, validSizes$1);
690
- addClass('mr', mr, validSizes$1);
691
- addClass('mb', mb, validSizes$1);
692
- addClass('ml', ml, validSizes$1);
693
- addClass('mx', mx, validSizes$1);
694
- addClass('my', my, validSizes$1);
695
- addClass('p', p, validSizes$1);
696
- addClass('pt', pt, validSizes$1);
697
- addClass('pr', pr, validSizes$1);
698
- addClass('pb', pb, validSizes$1);
699
- addClass('pl', pl, validSizes$1);
700
- addClass('px', px, validSizes$1);
701
- addClass('py', py, validSizes$1);
702
- addClass('is-size', textSize, validTextSizes);
703
- addClass('has-text', textAlign, validAlignments$1);
704
- addClass('is', textTransform, validTextTransforms);
705
- addClass('has-text-weight', textWeight, validTextWeights);
706
- addClass('is-family', fontFamily, validFontFamilies);
695
+ addColorClass('has-background', backgroundColor, backgroundColorShade);
696
+ addClassNoViewport('m', m, validSizes$1);
697
+ addClassNoViewport('mt', mt, validSizes$1);
698
+ addClassNoViewport('mr', mr, validSizes$1);
699
+ addClassNoViewport('mb', mb, validSizes$1);
700
+ addClassNoViewport('ml', ml, validSizes$1);
701
+ addClassNoViewport('mx', mx, validSizes$1);
702
+ addClassNoViewport('my', my, validSizes$1);
703
+ addClassNoViewport('p', p, validSizes$1);
704
+ addClassNoViewport('pt', pt, validSizes$1);
705
+ addClassNoViewport('pr', pr, validSizes$1);
706
+ addClassNoViewport('pb', pb, validSizes$1);
707
+ addClassNoViewport('pl', pl, validSizes$1);
708
+ addClassNoViewport('px', px, validSizes$1);
709
+ addClassNoViewport('py', py, validSizes$1);
710
+ addClass('is-size', textSize, validTextSizes, true);
711
+ addClass('has-text', textAlign, validAlignments$1, true);
712
+ addClassNoViewport('is', textTransform, validTextTransforms);
713
+ addClassNoViewport('has-text-weight', textWeight, validTextWeights);
714
+ addClassNoViewport('is-family', fontFamily, validFontFamilies);
715
+ const addViewportSpecificTextSizeClass = (value, viewportSuffix) => {
716
+ if (value && validTextSizes.includes(value)) {
717
+ addPrefixedClass(`is-size-${value}${viewportSuffix}`);
718
+ }
719
+ };
720
+ addViewportSpecificTextSizeClass(textSizeMobile, '-mobile');
721
+ addViewportSpecificTextSizeClass(textSizeTablet, '-tablet');
722
+ addViewportSpecificTextSizeClass(textSizeDesktop, '-desktop');
723
+ addViewportSpecificTextSizeClass(textSizeWidescreen, '-widescreen');
724
+ addViewportSpecificTextSizeClass(textSizeFullhd, '-fullhd');
725
+ const addViewportSpecificTextAlignClass = (value, viewportSuffix) => {
726
+ if (value && validAlignments$1.includes(value)) {
727
+ addPrefixedClass(`has-text-${value}${viewportSuffix}`);
728
+ }
729
+ };
730
+ addViewportSpecificTextAlignClass(textAlignMobile, '-mobile');
731
+ addViewportSpecificTextAlignClass(textAlignTablet, '-tablet');
732
+ addViewportSpecificTextAlignClass(textAlignDesktop, '-desktop');
733
+ addViewportSpecificTextAlignClass(textAlignWidescreen, '-widescreen');
734
+ addViewportSpecificTextAlignClass(textAlignFullhd, '-fullhd');
735
+ const addViewportSpecificVisibilityClass = (value, viewportSuffix) => {
736
+ if (value === 'hidden') {
737
+ addPrefixedClass(`is-hidden${viewportSuffix}`);
738
+ }
739
+ else if (value === 'sr-only') {
740
+ addPrefixedClass(`is-sr-only${viewportSuffix}`);
741
+ }
742
+ else if (value === 'invisible') {
743
+ addPrefixedClass(`is-invisible${viewportSuffix}`);
744
+ }
745
+ };
746
+ addViewportSpecificVisibilityClass(visibilityMobile, '-mobile');
747
+ addViewportSpecificVisibilityClass(visibilityTablet, '-tablet');
748
+ addViewportSpecificVisibilityClass(visibilityDesktop, '-desktop');
749
+ addViewportSpecificVisibilityClass(visibilityWidescreen, '-widescreen');
750
+ addViewportSpecificVisibilityClass(visibilityFullhd, '-fullhd');
707
751
  const addDisplayClass = (displayValue, viewportSuffix) => {
708
752
  if (displayValue) {
709
753
  if (displayValue === 'none') {
@@ -734,14 +778,14 @@ const useBulmaClasses = (props) => {
734
778
  }
735
779
  }
736
780
  else {
737
- addClass('is', display, [...validDisplays]);
781
+ addClass('is', display, [...validDisplays], true);
738
782
  }
739
783
  }
740
784
  if (visibility) {
741
- if (visibility === 'hidden' &&
785
+ if ((visibility === 'hidden' || visibility === 'invisible') &&
742
786
  viewport &&
743
787
  validViewports.includes(viewport)) {
744
- addPrefixedClass(`is-hidden-${viewport}`);
788
+ addPrefixedClass(`is-${visibility}-${viewport}`);
745
789
  }
746
790
  else if (validVisibilities.includes(visibility)) {
747
791
  addPrefixedClass(`is-${visibility}`);
@@ -760,45 +804,52 @@ const useBulmaClasses = (props) => {
760
804
  displayFullhd === 'flex' ||
761
805
  displayFullhd === 'inline-flex';
762
806
  if (hasFlexDisplay) {
763
- addClass('is-flex-direction', flexDirection, validFlexDirections);
764
- addClass('is-flex-wrap', flexWrap, validFlexWraps);
765
- addClass('is-justify-content', justifyContent, validJustifyContents);
766
- addClass('is-align-content', alignContent, validAlignContents);
767
- addClass('is-align-items', alignItems, validAlignItems);
768
- addClass('is-align-self', alignSelf, validAlignSelfs);
769
- addClass('is-flex-grow', flexGrow, validFlexGrowShrink);
770
- addClass('is-flex-shrink', flexShrink, validFlexGrowShrink);
807
+ addClassNoViewport('is-flex-direction', flexDirection, validFlexDirections);
808
+ addClassNoViewport('is-flex-wrap', flexWrap, validFlexWraps);
809
+ addClassNoViewport('is-justify-content', justifyContent, validJustifyContents);
810
+ addClassNoViewport('is-align-content', alignContent, validAlignContents);
811
+ addClassNoViewport('is-align-items', alignItems, validAlignItems);
771
812
  }
813
+ addClassNoViewport('is-align-self', alignSelf, validAlignSelfs);
814
+ addClassNoViewport('is-flex-grow', flexGrow, validFlexGrowShrink);
815
+ addClassNoViewport('is-flex-shrink', flexShrink, validFlexGrowShrink);
772
816
  if (float) {
773
- addClass('is-pulled', float, ['left', 'right']);
817
+ addClassNoViewport('is-pulled', float, ['left', 'right']);
774
818
  }
775
819
  if (overflow) {
776
- addClass('is', overflow, ['clipped']);
820
+ addClassNoViewport('is', overflow, ['clipped']);
777
821
  }
778
822
  if (overlay) {
779
823
  addPrefixedClass('is-overlay');
780
824
  }
781
825
  if (interaction) {
782
- addClass('is', interaction, ['unselectable', 'clickable']);
826
+ addClassNoViewport('is', interaction, ['unselectable', 'clickable']);
783
827
  }
784
828
  if (radius) {
785
- addClass('is', radius, ['radiusless']);
829
+ addClassNoViewport('is', radius, ['radiusless']);
786
830
  }
787
831
  if (shadow) {
788
- addClass('is', shadow, ['shadowless']);
832
+ addClassNoViewport('is', shadow, ['shadowless']);
789
833
  }
790
834
  if (responsive) {
791
- addClass('is', responsive, ['mobile', 'narrow']);
835
+ addClassNoViewport('is', responsive, ['mobile', 'narrow']);
792
836
  }
793
837
  if (skeleton) {
794
838
  addPrefixedClass('is-skeleton');
795
839
  }
840
+ if (clearfix) {
841
+ addPrefixedClass('is-clearfix');
842
+ }
843
+ if (relative) {
844
+ addPrefixedClass('is-relative');
845
+ }
796
846
  return classNames(classes);
797
847
  }, [
798
848
  classPrefix,
799
849
  color,
800
850
  backgroundColor,
801
851
  colorShade,
852
+ backgroundColorShade,
802
853
  m,
803
854
  mt,
804
855
  mr,
@@ -842,6 +893,23 @@ const useBulmaClasses = (props) => {
842
893
  displayWidescreen,
843
894
  displayFullhd,
844
895
  skeleton,
896
+ clearfix,
897
+ relative,
898
+ textSizeMobile,
899
+ textSizeTablet,
900
+ textSizeDesktop,
901
+ textSizeWidescreen,
902
+ textSizeFullhd,
903
+ textAlignMobile,
904
+ textAlignTablet,
905
+ textAlignDesktop,
906
+ textAlignWidescreen,
907
+ textAlignFullhd,
908
+ visibilityMobile,
909
+ visibilityTablet,
910
+ visibilityDesktop,
911
+ visibilityWidescreen,
912
+ visibilityFullhd,
845
913
  ]);
846
914
  return { bulmaHelperClasses, rest };
847
915
  };
@@ -928,7 +996,19 @@ const renderFooter = (footer) => {
928
996
  const items = Array.isArray(footer) ? footer : [footer];
929
997
  return items.map((item, idx) => (jsxRuntimeExports.jsx("span", { className: "card-footer-item", children: item }, idx)));
930
998
  };
931
- const Card = ({ className, children, textColor, bgColor, hasShadow = true, header, headerCentered, headerIcon, footer, image, imageAlt, ...props }) => {
999
+ const hasCompoundComponents = (children) => {
1000
+ return React.Children.toArray(children).some(child => {
1001
+ if (!React.isValidElement(child))
1002
+ return false;
1003
+ return (child.type === CardHeader ||
1004
+ child.type === CardContent ||
1005
+ child.type === CardImage ||
1006
+ child.type === CardFooter ||
1007
+ child.type === CardFooterItem ||
1008
+ child.type === CardHeaderIcon);
1009
+ });
1010
+ };
1011
+ const CardComponent = ({ className, children, textColor, bgColor, hasShadow = true, header, headerCentered, headerIcon, footer, image, imageAlt, ...props }) => {
932
1012
  const { bulmaHelperClasses, rest } = useBulmaClasses({
933
1013
  color: textColor,
934
1014
  backgroundColor: bgColor,
@@ -947,8 +1027,36 @@ const Card = ({ className, children, textColor, bgColor, hasShadow = true, heade
947
1027
  };
948
1028
  return (jsxRuntimeExports.jsxs("div", { className: cardClasses, ...rest, children: [renderHeader(header, headerIcon, headerCentered), image && (jsxRuntimeExports.jsx("div", { className: "card-image", children: typeof image === 'string' ? (jsxRuntimeExports.jsx("figure", { className: "image", children: jsxRuntimeExports.jsx("img", { src: image, alt: imageAlt !== null && imageAlt !== void 0 ? imageAlt : 'Card image' }) })) : (image) })), typeof children !== 'undefined' &&
949
1029
  children !== null &&
950
- children !== '' && jsxRuntimeExports.jsx("div", { className: "card-content", children: children }), footer && (jsxRuntimeExports.jsx("footer", { className: "card-footer", children: renderFooter(footer) }))] }));
951
- };
1030
+ children !== '' &&
1031
+ !hasCompoundComponents(children) && (jsxRuntimeExports.jsx("div", { className: "card-content", children: children })), typeof children !== 'undefined' &&
1032
+ children !== null &&
1033
+ children !== '' &&
1034
+ hasCompoundComponents(children) &&
1035
+ children, footer && (jsxRuntimeExports.jsx("footer", { className: "card-footer", children: renderFooter(footer) }))] }));
1036
+ };
1037
+ const CardHeader = ({ className, children, centered, ...props }) => {
1038
+ const hasHeaderTitle = React.Children.toArray(children).some(child => React.isValidElement(child) &&
1039
+ typeof child.type === 'function' &&
1040
+ child.type === CardHeaderTitle);
1041
+ return (jsxRuntimeExports.jsx("header", { className: classNames('card-header', className), ...props, children: hasHeaderTitle ? (children) : (jsxRuntimeExports.jsx("div", { className: classNames('card-header-title', {
1042
+ 'is-centered': centered,
1043
+ }), children: children })) }));
1044
+ };
1045
+ const CardHeaderTitle = ({ className, children, centered, ...props }) => (jsxRuntimeExports.jsx("div", { className: classNames('card-header-title', { 'is-centered': centered }, className), ...props, children: children }));
1046
+ const CardHeaderIcon = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("button", { className: classNames('card-header-icon', className), "aria-label": props['aria-label'] || 'more options', ...props, children: children }));
1047
+ const CardImage = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("div", { className: classNames('card-image', className), ...props, children: children }));
1048
+ const CardContent = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("div", { className: classNames('card-content', className), ...props, children: children }));
1049
+ const CardFooter = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("footer", { className: classNames('card-footer', className), ...props, children: children }));
1050
+ const CardFooterItem = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("span", { className: classNames('card-footer-item', className), ...props, children: children }));
1051
+ const CardWithSubComponents = CardComponent;
1052
+ const CardHeaderWithTitle = CardHeader;
1053
+ CardHeaderWithTitle.Title = CardHeaderTitle;
1054
+ CardHeaderWithTitle.Icon = CardHeaderIcon;
1055
+ CardWithSubComponents.Header = CardHeaderWithTitle;
1056
+ CardWithSubComponents.Image = CardImage;
1057
+ CardWithSubComponents.Content = CardContent;
1058
+ CardWithSubComponents.Footer = CardFooter;
1059
+ CardWithSubComponents.FooterItem = CardFooterItem;
952
1060
  const __test_exports__ = { renderFooter };
953
1061
 
954
1062
  const isBrowser = (win, doc) => typeof win !== 'undefined' && typeof doc !== 'undefined';
@@ -1055,7 +1163,7 @@ const Menu = Object.assign(MenuComponent, {
1055
1163
  Item: MenuItem,
1056
1164
  });
1057
1165
 
1058
- const Message = ({ className, title, textColor, color, bgColor, onClose, children, ...props }) => {
1166
+ const MessageComponent = ({ className, title, textColor, color, bgColor, onClose, children, ...props }) => {
1059
1167
  const { bulmaHelperClasses, rest } = useBulmaClasses({
1060
1168
  color: textColor,
1061
1169
  backgroundColor: bgColor,
@@ -1068,6 +1176,11 @@ const Message = ({ className, title, textColor, color, bgColor, onClose, childre
1068
1176
  const messageClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
1069
1177
  return (jsxRuntimeExports.jsxs("article", { className: messageClasses, ...rest, "data-testid": "message", children: [(title || onClose) && (jsxRuntimeExports.jsxs("div", { className: "message-header", children: [title && jsxRuntimeExports.jsx("span", { children: title }), onClose && (jsxRuntimeExports.jsx("button", { className: deleteClass, "aria-label": "delete", onClick: onClose, type: "button", "data-testid": "message-close" }))] })), children && (jsxRuntimeExports.jsx("div", { className: "message-body", "data-testid": "message-body", children: children }))] }));
1070
1178
  };
1179
+ const MessageHeader = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("div", { className: classNames('message-header', className), ...props, children: children }));
1180
+ const MessageBody = ({ className, children, ...props }) => (jsxRuntimeExports.jsx("div", { className: classNames('message-body', className), ...props, children: children }));
1181
+ const MessageWithSubComponents = MessageComponent;
1182
+ MessageWithSubComponents.Header = MessageHeader;
1183
+ MessageWithSubComponents.Body = MessageBody;
1071
1184
 
1072
1185
  const Modal = ({ active = false, onClose, className, textColor, bgColor, modalCardTitle, modalCardFoot, type, children, ...props }) => {
1073
1186
  const { bulmaHelperClasses, rest } = useBulmaClasses({
@@ -1386,45 +1499,130 @@ const Delete = ({ className, textColor, bgColor, onClick, size, ariaLabel = 'Clo
1386
1499
  return (jsxRuntimeExports.jsx("button", { className: classes, onClick: onClick, "aria-label": ariaLabel, disabled: disabled, type: "button", ...rest }));
1387
1500
  };
1388
1501
 
1389
- function getIconClasses(library, name, libraryFeatures) {
1502
+ function getIconClasses(library, name, variant, features) {
1390
1503
  let baseClass = '';
1391
1504
  let iconClass = '';
1392
- let features = Array.isArray(libraryFeatures)
1393
- ? libraryFeatures
1394
- : libraryFeatures
1395
- ? [libraryFeatures]
1505
+ let featureList = Array.isArray(features)
1506
+ ? features
1507
+ : features
1508
+ ? [features]
1396
1509
  : [];
1397
1510
  switch (library) {
1398
1511
  case 'fa': {
1399
- const faStyle = features.find(f => ['fas', 'far', 'fab', 'fal', 'fad', 'fat'].includes(f)) || 'fas';
1512
+ const styleMap = {
1513
+ solid: 'fas',
1514
+ regular: 'far',
1515
+ brands: 'fab',
1516
+ light: 'fal',
1517
+ duotone: 'fad',
1518
+ thin: 'fat',
1519
+ };
1520
+ const faStyle = variant ? styleMap[variant] || variant : 'fas';
1400
1521
  baseClass = faStyle;
1401
1522
  iconClass = `fa-${name}`;
1402
- features = features.filter(f => f !== faStyle);
1403
- return [baseClass, iconClass, ...features].join(' ');
1523
+ return [baseClass, iconClass, ...featureList].join(' ');
1404
1524
  }
1405
1525
  case 'mdi':
1406
1526
  baseClass = 'mdi';
1407
1527
  iconClass = `mdi-${name}`;
1408
- return [baseClass, iconClass, ...features].join(' ');
1409
- case 'ion':
1410
- baseClass = 'ion';
1411
- iconClass = `ion-${name}`;
1412
- return [baseClass, iconClass, ...features].join(' ');
1528
+ return [baseClass, iconClass, ...featureList].join(' ');
1529
+ case 'material-icons': {
1530
+ const styleVariants = {
1531
+ filled: 'material-icons',
1532
+ outlined: 'material-icons-outlined',
1533
+ round: 'material-icons-round',
1534
+ sharp: 'material-icons-sharp',
1535
+ };
1536
+ baseClass = variant
1537
+ ? styleVariants[variant] || `material-icons-${variant}`
1538
+ : 'material-icons';
1539
+ return [baseClass, ...featureList].join(' ');
1540
+ }
1541
+ case 'material-symbols': {
1542
+ const styleVariants = {
1543
+ outlined: 'material-symbols-outlined',
1544
+ rounded: 'material-symbols-rounded',
1545
+ sharp: 'material-symbols-sharp',
1546
+ };
1547
+ baseClass = variant
1548
+ ? styleVariants[variant] || `material-symbols-${variant}`
1549
+ : 'material-symbols-outlined';
1550
+ return [baseClass, ...featureList].join(' ');
1551
+ }
1413
1552
  default:
1414
- return [name, ...features].join(' ');
1553
+ return [name, ...featureList].join(' ');
1415
1554
  }
1416
1555
  }
1417
- const Icon = ({ className, textColor, bgColor, name, library = 'fa', libraryFeatures, size, ariaLabel = 'icon', style, ...props }) => {
1556
+ const Icon = ({ className, textColor, bgColor, name, library = 'fa', variant, features, libraryFeatures, size, ariaLabel = 'icon', style, ...restProps }) => {
1418
1557
  const { bulmaHelperClasses, rest } = useBulmaClasses({
1419
1558
  color: textColor,
1420
1559
  backgroundColor: bgColor,
1421
- ...props,
1560
+ ...restProps,
1422
1561
  });
1423
1562
  const bulmaClasses = usePrefixedClassNames('icon', {
1424
1563
  [`is-${size}`]: size,
1425
1564
  });
1426
1565
  const iconContainerClasses = classNames(bulmaClasses, bulmaHelperClasses, className);
1427
- const iClasses = getIconClasses(library, name, libraryFeatures);
1566
+ let finalVariant = variant;
1567
+ let finalFeatures = features;
1568
+ if (libraryFeatures && !variant && !features) {
1569
+ const legacyFeatures = Array.isArray(libraryFeatures)
1570
+ ? libraryFeatures
1571
+ : [libraryFeatures];
1572
+ if (library === 'fa') {
1573
+ const faStyle = legacyFeatures.find(f => [
1574
+ 'fas',
1575
+ 'far',
1576
+ 'fab',
1577
+ 'fal',
1578
+ 'fad',
1579
+ 'fat',
1580
+ 'solid',
1581
+ 'regular',
1582
+ 'brands',
1583
+ 'light',
1584
+ 'duotone',
1585
+ 'thin',
1586
+ ].includes(f));
1587
+ if (faStyle) {
1588
+ finalVariant = faStyle;
1589
+ finalFeatures = legacyFeatures.filter(f => f !== faStyle);
1590
+ }
1591
+ else {
1592
+ finalFeatures = legacyFeatures;
1593
+ }
1594
+ }
1595
+ else if (library === 'material-icons' || library === 'material-symbols') {
1596
+ const styleVariants = library === 'material-icons'
1597
+ ? ['filled', 'outlined', 'round', 'sharp']
1598
+ : ['outlined', 'rounded', 'sharp'];
1599
+ const styleVariant = legacyFeatures.find(f => styleVariants.includes(f));
1600
+ if (styleVariant) {
1601
+ finalVariant = styleVariant;
1602
+ finalFeatures = legacyFeatures.filter(f => f !== styleVariant);
1603
+ }
1604
+ else {
1605
+ finalFeatures = legacyFeatures;
1606
+ }
1607
+ }
1608
+ else {
1609
+ finalFeatures = legacyFeatures;
1610
+ }
1611
+ }
1612
+ if (library === 'ion') {
1613
+ let ionName = name;
1614
+ if (finalVariant === 'outline') {
1615
+ ionName = `${name}-outline`;
1616
+ }
1617
+ else if (finalVariant === 'sharp') {
1618
+ ionName = `${name}-sharp`;
1619
+ }
1620
+ return (jsxRuntimeExports.jsx("span", { className: iconContainerClasses, "aria-label": ariaLabel, style: style, ...rest, children: jsxRuntimeExports.jsx("ion-icon", { name: ionName }) }));
1621
+ }
1622
+ const iClasses = getIconClasses(library, name, finalVariant, finalFeatures);
1623
+ if (library === 'material-icons' || library === 'material-symbols') {
1624
+ return (jsxRuntimeExports.jsx("span", { className: iconContainerClasses, "aria-label": ariaLabel, style: style, ...rest, children: jsxRuntimeExports.jsx("i", { className: iClasses, children: name }) }));
1625
+ }
1428
1626
  return (jsxRuntimeExports.jsx("span", { className: iconContainerClasses, "aria-label": ariaLabel, style: style, ...rest, children: jsxRuntimeExports.jsx("i", { className: iClasses }) }));
1429
1627
  };
1430
1628
 
@@ -2737,5 +2935,5 @@ const Section = ({ size, className, children, color, bgColor, textColor, ...prop
2737
2935
  return (jsxRuntimeExports.jsx("section", { className: sectionClasses, ...rest, children: children }));
2738
2936
  };
2739
2937
 
2740
- export { Block, Box, Breadcrumb, Button, Buttons, Card, Cell, Checkbox, Checkboxes, Column, Columns, ConfigProvider, Container, Content, Control, Delete, Dropdown, DropdownDivider, DropdownItem, Field, FieldBody, FieldLabel, File, Footer, Grid, Hero, HeroBody, HeroFoot, HeroHead, Icon, IconText, Image, Input, Level, LevelItem, LevelLeft, LevelRight, Media, MediaContent, MediaLeft, MediaRight, Menu, MenuItem, MenuLabel, MenuList, Message, Modal, Navbar, NavbarBrand, NavbarBurger, NavbarDivider, NavbarDropdown, NavbarDropdownMenu, NavbarEnd, NavbarItem, NavbarMenu, NavbarStart, Notification, Pagination, PaginationEllipsis, PaginationLink, PaginationList, PaginationNext, PaginationPrevious, Panel, PanelBlock, PanelButtonBlock, PanelCheckboxBlock, PanelHeading, PanelIcon, PanelInputBlock, PanelTabs, Progress, Radio, Radios, Section, Select, Skeleton, SubTitle, TabItem, TabList, Table, Tabs, Tag, Tags, Tbody, Td, TextArea, Tfoot, Th, Thead, Theme, Title, Tr, __test_exports__, classNames, createPrefixedClassNames, isBrowser, prefixedClassNames, useBulmaClasses, useClassPrefix, useConfig, usePrefixedClass, usePrefixedClassNames, validAlignContents, validAlignItems, validAlignSelfs, validAlignments$1 as validAlignments, validColorShades, validColors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFontFamilies, validJustifyContents, validSizes$1 as validSizes, validTableColors, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
2938
+ export { Block, Box, Breadcrumb, Button, Buttons, CardWithSubComponents as Card, Cell, Checkbox, Checkboxes, Column, Columns, ConfigProvider, Container, Content, Control, Delete, Dropdown, DropdownDivider, DropdownItem, Field, FieldBody, FieldLabel, File, Footer, Grid, Hero, HeroBody, HeroFoot, HeroHead, Icon, IconText, Image, Input, Level, LevelItem, LevelLeft, LevelRight, Media, MediaContent, MediaLeft, MediaRight, Menu, MenuItem, MenuLabel, MenuList, MessageWithSubComponents as Message, Modal, Navbar, NavbarBrand, NavbarBurger, NavbarDivider, NavbarDropdown, NavbarDropdownMenu, NavbarEnd, NavbarItem, NavbarMenu, NavbarStart, Notification, Pagination, PaginationEllipsis, PaginationLink, PaginationList, PaginationNext, PaginationPrevious, Panel, PanelBlock, PanelButtonBlock, PanelCheckboxBlock, PanelHeading, PanelIcon, PanelInputBlock, PanelTabs, Progress, Radio, Radios, Section, Select, Skeleton, SubTitle, TabItem, TabList, Table, Tabs, Tag, Tags, Tbody, Td, TextArea, Tfoot, Th, Thead, Theme, Title, Tr, __test_exports__, classNames, createPrefixedClassNames, isBrowser, prefixedClassNames, useBulmaClasses, useClassPrefix, useConfig, usePrefixedClass, usePrefixedClassNames, validAlignContents, validAlignItems, validAlignSelfs, validAlignments$1 as validAlignments, validColorShades, validColors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFontFamilies, validJustifyContents, validSizes$1 as validSizes, validTableColors, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
2741
2939
  //# sourceMappingURL=index.esm.js.map