@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.esm.js CHANGED
@@ -592,7 +592,7 @@ const validViewports = [
592
592
  'fullhd',
593
593
  ];
594
594
  const useBulmaClasses = (props) => {
595
- 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;
595
+ 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;
596
596
  const bulmaHelperClasses = useMemo(() => {
597
597
  const classes = [];
598
598
  const addClass = (prefix, value, validValues) => {
@@ -679,6 +679,9 @@ const useBulmaClasses = (props) => {
679
679
  if (responsive) {
680
680
  addClass('is', responsive, ['mobile', 'narrow']);
681
681
  }
682
+ if (skeleton) {
683
+ classes.push('is-skeleton');
684
+ }
682
685
  return classNames(classes);
683
686
  }, [
684
687
  color,
@@ -721,6 +724,7 @@ const useBulmaClasses = (props) => {
721
724
  shadow,
722
725
  responsive,
723
726
  viewport,
727
+ skeleton,
724
728
  ]);
725
729
  return { bulmaHelperClasses, rest };
726
730
  };
@@ -1406,6 +1410,13 @@ const Progress = ({ className, color, size, value, max, children, ...props }) =>
1406
1410
  return (jsxRuntimeExports.jsx("progress", { className: progressClasses, value: value, max: max, ...rest, children: children }));
1407
1411
  };
1408
1412
 
1413
+ const Skeleton = ({ className, variant = 'block', lines = 3, children, ...props }) => {
1414
+ if (variant === 'lines') {
1415
+ return (jsxRuntimeExports.jsx("div", { className: classNames('skeleton-lines', className), ...props, children: Array.from({ length: lines }).map((_, i) => (jsxRuntimeExports.jsx("div", {}, i))) }));
1416
+ }
1417
+ return (jsxRuntimeExports.jsx("div", { className: classNames('skeleton-block', className), ...props, children: children }));
1418
+ };
1419
+
1409
1420
  const validSubTitleSizes = ['1', '2', '3', '4', '5', '6'];
1410
1421
  const validSubTitleElements = [
1411
1422
  'h1',
@@ -1416,12 +1427,13 @@ const validSubTitleElements = [
1416
1427
  'h6',
1417
1428
  'p',
1418
1429
  ];
1419
- const SubTitle = ({ className, size, as = 'h1', children, ...props }) => {
1430
+ const SubTitle = ({ className, size, as = 'h1', hasSkeleton, children, ...props }) => {
1420
1431
  const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
1421
1432
  const element = validSubTitleElements.includes(as) ? as : 'h1';
1422
1433
  const validSize = size && validSubTitleSizes.includes(size) ? size : undefined;
1423
1434
  const subTitleClasses = classNames('subtitle', className, bulmaHelperClasses, {
1424
1435
  [`is-${validSize}`]: validSize,
1436
+ 'has-skeleton': hasSkeleton,
1425
1437
  });
1426
1438
  const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
1427
1439
  return (jsxRuntimeExports.jsx(Tag, { className: subTitleClasses, ...rest, children: children }));
@@ -1529,13 +1541,14 @@ const Thead = ({ className, children, ...props }) => {
1529
1541
 
1530
1542
  const validTitleSizes = ['1', '2', '3', '4', '5', '6'];
1531
1543
  const validTitleElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
1532
- const Title = ({ className, size, isSpaced, as = 'h1', children, ...props }) => {
1544
+ const Title = ({ className, size, isSpaced, as = 'h1', hasSkeleton, children, ...props }) => {
1533
1545
  const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
1534
1546
  const element = validTitleElements.includes(as) ? as : 'h1';
1535
1547
  const validSize = size && validTitleSizes.includes(size) ? size : undefined;
1536
1548
  const titleClasses = classNames('title', className, bulmaHelperClasses, {
1537
1549
  [`is-${validSize}`]: validSize,
1538
1550
  'is-spaced': isSpaced,
1551
+ 'has-skeleton': hasSkeleton,
1539
1552
  });
1540
1553
  const Tag = element === 'p' ? 'p' : validSize ? `h${validSize}` : element;
1541
1554
  return (jsxRuntimeExports.jsx(Tag, { className: titleClasses, ...rest, children: children }));
@@ -1993,5 +2006,5 @@ const Section = ({ size, className, children, ...props }) => {
1993
2006
  return (jsxRuntimeExports.jsx("section", { className: sectionClasses, ...rest, children: children }));
1994
2007
  };
1995
2008
 
1996
- export { Block, Box, Breadcrumb, Button, Buttons, Card, Cell, Checkbox, Checkboxes, Column, Columns, 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, SubTitle, TabItem, TabList, Table, Tabs, Tag, Tags, Tbody, Td, TextArea, Tfoot, Th, Thead, Title, Tr, __test_exports__, classNames, isBrowser, useBulmaClasses, 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 };
2009
+ export { Block, Box, Breadcrumb, Button, Buttons, Card, Cell, Checkbox, Checkboxes, Column, Columns, 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, Title, Tr, __test_exports__, classNames, isBrowser, useBulmaClasses, 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 };
1997
2010
  //# sourceMappingURL=index.esm.js.map