@allxsmith/bestax-bulma 1.0.13 → 1.1.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.cjs.js CHANGED
@@ -594,7 +594,7 @@ const validViewports = [
594
594
  'fullhd',
595
595
  ];
596
596
  const useBulmaClasses = (props) => {
597
- 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, ...rest } = props;
597
+ 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, skeleton, ...rest } = props;
598
598
  const bulmaHelperClasses = React.useMemo(() => {
599
599
  const classes = [];
600
600
  const addClass = (prefix, value, validValues) => {
@@ -681,6 +681,9 @@ const useBulmaClasses = (props) => {
681
681
  if (responsive) {
682
682
  addClass('is', responsive, ['mobile', 'narrow']);
683
683
  }
684
+ if (skeleton) {
685
+ classes.push('is-skeleton');
686
+ }
684
687
  return classNames(classes);
685
688
  }, [
686
689
  color,
@@ -723,6 +726,7 @@ const useBulmaClasses = (props) => {
723
726
  shadow,
724
727
  responsive,
725
728
  viewport,
729
+ skeleton,
726
730
  ]);
727
731
  return { bulmaHelperClasses, rest };
728
732
  };
@@ -1408,6 +1412,13 @@ const Progress = ({ className, color, size, value, max, children, ...props }) =>
1408
1412
  return (jsxRuntimeExports.jsx("progress", { className: progressClasses, value: value, max: max, ...rest, children: children }));
1409
1413
  };
1410
1414
 
1415
+ const Skeleton = ({ className, variant = 'block', lines = 3, children, ...props }) => {
1416
+ if (variant === 'lines') {
1417
+ return (jsxRuntimeExports.jsx("div", { className: classNames('skeleton-lines', className), ...props, children: Array.from({ length: lines }).map((_, i) => (jsxRuntimeExports.jsx("div", {}, i))) }));
1418
+ }
1419
+ return (jsxRuntimeExports.jsx("div", { className: classNames('skeleton-block', className), ...props, children: children }));
1420
+ };
1421
+
1411
1422
  const validSubTitleSizes = ['1', '2', '3', '4', '5', '6'];
1412
1423
  const validSubTitleElements = [
1413
1424
  'h1',
@@ -1418,12 +1429,13 @@ const validSubTitleElements = [
1418
1429
  'h6',
1419
1430
  'p',
1420
1431
  ];
1421
- const SubTitle = ({ className, size, as = 'h1', children, ...props }) => {
1432
+ const SubTitle = ({ className, size, as = 'h1', hasSkeleton, children, ...props }) => {
1422
1433
  const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
1423
1434
  const element = validSubTitleElements.includes(as) ? as : 'h1';
1424
1435
  const validSize = size && validSubTitleSizes.includes(size) ? size : undefined;
1425
1436
  const subTitleClasses = classNames('subtitle', className, bulmaHelperClasses, {
1426
1437
  [`is-${validSize}`]: validSize,
1438
+ 'has-skeleton': hasSkeleton,
1427
1439
  });
1428
1440
  const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
1429
1441
  return (jsxRuntimeExports.jsx(Tag, { className: subTitleClasses, ...rest, children: children }));
@@ -1531,13 +1543,14 @@ const Thead = ({ className, children, ...props }) => {
1531
1543
 
1532
1544
  const validTitleSizes = ['1', '2', '3', '4', '5', '6'];
1533
1545
  const validTitleElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
1534
- const Title = ({ className, size, isSpaced, as = 'h1', children, ...props }) => {
1546
+ const Title = ({ className, size, isSpaced, as = 'h1', hasSkeleton, children, ...props }) => {
1535
1547
  const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
1536
1548
  const element = validTitleElements.includes(as) ? as : 'h1';
1537
1549
  const validSize = size && validTitleSizes.includes(size) ? size : undefined;
1538
1550
  const titleClasses = classNames('title', className, bulmaHelperClasses, {
1539
1551
  [`is-${validSize}`]: validSize,
1540
1552
  'is-spaced': isSpaced,
1553
+ 'has-skeleton': hasSkeleton,
1541
1554
  });
1542
1555
  const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
1543
1556
  return (jsxRuntimeExports.jsx(Tag, { className: titleClasses, ...rest, children: children }));
@@ -2071,6 +2084,7 @@ exports.Radio = Radio;
2071
2084
  exports.Radios = Radios;
2072
2085
  exports.Section = Section;
2073
2086
  exports.Select = Select;
2087
+ exports.Skeleton = Skeleton;
2074
2088
  exports.SubTitle = SubTitle;
2075
2089
  exports.TabItem = TabItem;
2076
2090
  exports.TabList = TabList;