@allxsmith/bestax-bulma 5.24.0 → 5.25.0

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
@@ -267,6 +267,35 @@ const validSchemeColors = [
267
267
  * @example '0', '1', 'auto'
268
268
  */
269
269
  const validSizes$1 = ['0', '1', '2', '3', '4', '5', '6', 'auto'];
270
+ /**
271
+ * Valid Bulma gap steps, taken by `gap`, `columnGap` and `rowGap`. Each whole
272
+ * step is 0.5rem, so `2` is 1rem and `8` is 4rem, and the half steps sit
273
+ * between them. They render `is-gap-<value>`, `is-column-gap-<value>` and
274
+ * `is-row-gap-<value>`.
275
+ *
276
+ * This is a different scale from `validSizes`: `gap="2"` is 1rem where
277
+ * `m="2"` is 0.5rem.
278
+ * @example '0', '0.5', '2', '8'
279
+ */
280
+ const validGaps = [
281
+ '0',
282
+ '0.5',
283
+ '1',
284
+ '1.5',
285
+ '2',
286
+ '2.5',
287
+ '3',
288
+ '3.5',
289
+ '4',
290
+ '4.5',
291
+ '5',
292
+ '5.5',
293
+ '6',
294
+ '6.5',
295
+ '7',
296
+ '7.5',
297
+ '8',
298
+ ];
270
299
  /**
271
300
  * Valid Bulma text size classes.
272
301
  * @example '1', '2', '3'
@@ -649,7 +678,13 @@ const useColorStyles = (props) => {
649
678
  };
650
679
 
651
680
  /**
652
- * A hook that generates Bulma margin and padding helper classes.
681
+ * A gap step as the class reads it. Numbers are accepted for the steps, so
682
+ * `2` and `'2'` both become `'2'`; anything else is checked against
683
+ * `validGaps` by the caller.
684
+ */
685
+ const gapValue = (value) => typeof value === 'number' ? String(value) : value;
686
+ /**
687
+ * A hook that generates Bulma margin, padding and gap helper classes.
653
688
  *
654
689
  * @function useSpacingClasses
655
690
  * @param props - Spacing-related Bulma helper props.
@@ -660,9 +695,9 @@ const useColorStyles = (props) => {
660
695
  */
661
696
  const useSpacingClasses = (props) => {
662
697
  const { classPrefix } = useConfig();
663
- const { m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py } = props;
698
+ const { m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, gap, columnGap, rowGap, gapless, } = props;
664
699
  return useMemo(() => {
665
- const { classes, addClassNoViewport } = createBulmaClassHelpers(classPrefix);
700
+ const { classes, addClassNoViewport, addPrefixedClass } = createBulmaClassHelpers(classPrefix);
666
701
  // Spacing (no viewport support in Bulma)
667
702
  addClassNoViewport('m', m, validSizes$1);
668
703
  addClassNoViewport('mt', mt, validSizes$1);
@@ -678,8 +713,42 @@ const useSpacingClasses = (props) => {
678
713
  addClassNoViewport('pl', pl, validSizes$1);
679
714
  addClassNoViewport('px', px, validSizes$1);
680
715
  addClassNoViewport('py', py, validSizes$1);
716
+ // Gap (no viewport support in Bulma). `gapless` and `is-gap-*` both set
717
+ // the `gap` shorthand at one class of specificity, so beside each other
718
+ // the stylesheet's rule order would decide. A valid `gap` settles it on
719
+ // its own. The axis props need no such care: Bulma declares every
720
+ // `is-column-gap-*` and `is-row-gap-*` after the shorthands, so each wins
721
+ // its own axis over `gap` and `gapless` alike.
722
+ const gapStep = gapValue(gap);
723
+ const hasGap = validGaps.some(v => v === gapStep);
724
+ addClassNoViewport('is-gap', gapStep, validGaps);
725
+ if (gapless && !hasGap) {
726
+ addPrefixedClass('is-gapless');
727
+ }
728
+ addClassNoViewport('is-column-gap', gapValue(columnGap), validGaps);
729
+ addClassNoViewport('is-row-gap', gapValue(rowGap), validGaps);
681
730
  return classNames(classes);
682
- }, [classPrefix, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py]);
731
+ }, [
732
+ classPrefix,
733
+ m,
734
+ mt,
735
+ mr,
736
+ mb,
737
+ ml,
738
+ mx,
739
+ my,
740
+ p,
741
+ pt,
742
+ pr,
743
+ pb,
744
+ pl,
745
+ px,
746
+ py,
747
+ gap,
748
+ columnGap,
749
+ rowGap,
750
+ gapless,
751
+ ]);
683
752
  };
684
753
 
685
754
  /**
@@ -1111,7 +1180,7 @@ const useOtherClasses = (props) => {
1111
1180
  * // rest: { className: 'custom-class' }
1112
1181
  */
1113
1182
  const useBulmaClasses = (props) => {
1114
- 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, overflowX, overflowY, overlay, interaction, cursor, radius, shadow, responsive, viewport, displayMobile, displayTablet, displayTabletOnly, displayTouch, displayDesktop, displayDesktopOnly, displayWidescreen, displayWidescreenOnly, displayFullhd, textSizeMobile, textSizeTablet, textSizeDesktop, textSizeWidescreen, textSizeFullhd, textAlignMobile, textAlignTablet, textAlignDesktop, textAlignWidescreen, textAlignFullhd, visibilityMobile, visibilityTablet, visibilityTabletOnly, visibilityTouch, visibilityDesktop, visibilityDesktopOnly, visibilityWidescreen, visibilityWidescreenOnly, visibilityFullhd, skeleton, clearfix, pos, relative, fullHeight, aspectRatio, ...rest } = props;
1183
+ const { color, backgroundColor, colorShade, backgroundColorShade, m, mt, mr, mb, ml, mx, my, p, pt, pr, pb, pl, px, py, gap, columnGap, rowGap, gapless, textSize, textAlign, textTransform, textWeight, fontFamily, display, visibility, flexDirection, flexWrap, justifyContent, alignContent, alignItems, alignSelf, flexGrow, flexShrink, float, overflow, overflowX, overflowY, overlay, interaction, cursor, radius, shadow, responsive, viewport, displayMobile, displayTablet, displayTabletOnly, displayTouch, displayDesktop, displayDesktopOnly, displayWidescreen, displayWidescreenOnly, displayFullhd, textSizeMobile, textSizeTablet, textSizeDesktop, textSizeWidescreen, textSizeFullhd, textAlignMobile, textAlignTablet, textAlignDesktop, textAlignWidescreen, textAlignFullhd, visibilityMobile, visibilityTablet, visibilityTabletOnly, visibilityTouch, visibilityDesktop, visibilityDesktopOnly, visibilityWidescreen, visibilityWidescreenOnly, visibilityFullhd, skeleton, clearfix, pos, relative, fullHeight, aspectRatio, ...rest } = props;
1115
1184
  const colorClasses = useColorClasses({
1116
1185
  color,
1117
1186
  colorShade,
@@ -1134,6 +1203,10 @@ const useBulmaClasses = (props) => {
1134
1203
  pl,
1135
1204
  px,
1136
1205
  py,
1206
+ gap,
1207
+ columnGap,
1208
+ rowGap,
1209
+ gapless,
1137
1210
  });
1138
1211
  const typographyClasses = useTypographyClasses({
1139
1212
  textSize,
@@ -1302,10 +1375,13 @@ const ColumnsComponent = ({ className, textColor, color: _fieldColor, bgColor, i
1302
1375
  const resolvedGapDesktop = gapDesktop ?? gapSizeDesktop;
1303
1376
  const resolvedGapWidescreen = gapWidescreen ?? gapSizeWidescreen;
1304
1377
  const resolvedGapFullhd = gapFullhd ?? gapSizeFullhd;
1378
+ // Untyped code can still pass the gap helpers ColumnsProps leaves out. They
1379
+ // are dropped here, so they render no class and never reach the DOM.
1380
+ const { columnGap: _columnGap, rowGap: _rowGap, ...helperProps } = props;
1305
1381
  const { bulmaHelperClasses, rest } = useBulmaClasses({
1306
1382
  color: textColor,
1307
1383
  backgroundColor: bgColor,
1308
- ...props,
1384
+ ...helperProps,
1309
1385
  });
1310
1386
  const mainClass = usePrefixedClassNames('columns');
1311
1387
  // Build gap classes with prefixes
@@ -15863,5 +15939,5 @@ const Section = ({ size, className, children, color, bgColor, textColor, style,
15863
15939
  return (jsx("section", { className: sectionClasses, style: mergeBulmaStyles(bulmaHelperStyles, style), ...rest, children: children }));
15864
15940
  };
15865
15941
 
15866
- export { Autocomplete, Avatar, Avatars, Badge, Block, Box, Breadcrumb, Button, Buttons, Card, Carousel, CarouselItem, Cell, Checkbox, Checkboxes, ClientOnly, Code, Collapse, Collapses, Column, Columns, ConfigProvider, Container, Content, Control, DateInput, DateInputBase, DateTimeInput, DateTimeInputBase, Delete, Dialog, DialogContainer, Divider, Dropdown, DropdownDivider, DropdownItem, Emphasis, Field, FieldBody, FieldLabel, Figure, File, Footer, Grid, Hero, HeroBody, HeroFoot, HeroHead, Icon, IconText, Image, Input, InputBase, Level, LevelItem, LevelLeft, LevelRight, Link, LinkButton, ListItem, Loader, Loading, Media, MediaContent, MediaLeft, MediaRight, Menu, MenuItem, MenuLabel, MenuList, Message, Modal, Navbar, NavbarBrand, NavbarBurger, NavbarDivider, NavbarDropdown, NavbarDropdownMenu, NavbarEnd, NavbarItem, NavbarLink, NavbarMenu, NavbarStart, Notification, NotificationContainer, NumberInput, Numberinput, OrderedList, Pagination, PaginationEllipsis, PaginationLink, PaginationList, PaginationNext, PaginationPrevious, Panel, PanelBlock, PanelButtonBlock, PanelCheckboxBlock, PanelHeading, PanelIcon, PanelInputBlock, PanelTabs, Paragraph, Popover, PopoverBody, PopoverClose, PopoverFooter, PopoverHeader, Portal, Pre, Progress, Radio, Radios, Rate, Reveal, Section, Select, SelectBase, Sidebar, Skeleton, Slider, Span, Step, Steps, Strong, SubTitle, Switch, Tab, TabContentItem, TabItem, TabList, Table, Tabs, TabsContent, Tag, TagInput, Taginput, Tags, Tbody, Td, TextArea, TextAreaBase, Tfoot, Th, Thead, Theme, TimeInput, TimeInputBase, Title, Toast, ToastContainer, Tooltip, Tr, UnorderedList, checkboxColors, checkboxSizes, classNames, createPrefixedClassNames, dialog, isBrowser$1 as isBrowser, mergeBulmaStyles, notification, prefixedClassNames, radioColors, radioSizes, switchColors, switchSizes, toast, useBulmaClasses, useClassPrefix, useColorClasses, useColorStyles, useConfig, useFlexboxClasses, useFocusTrap, useIconLibrary, useInsideControl, useInsideField, useIsHydrated, useOtherClasses, usePrefixedClass, usePrefixedClassNames, useSpacingClasses, useTypographyClasses, useVisibilityClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments$1 as validAlignments, validAspectRatios, validAxisOverflows, validColorShades, validColors, validCursors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFloats, validFontFamilies, validInteractions, validJustifyContents, validOverflows, validPositions, validRadii, validResponsives, validSchemeColors, validShadows, validSizes$1 as validSizes, validTableColors, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
15942
+ export { Autocomplete, Avatar, Avatars, Badge, Block, Box, Breadcrumb, Button, Buttons, Card, Carousel, CarouselItem, Cell, Checkbox, Checkboxes, ClientOnly, Code, Collapse, Collapses, Column, Columns, ConfigProvider, Container, Content, Control, DateInput, DateInputBase, DateTimeInput, DateTimeInputBase, Delete, Dialog, DialogContainer, Divider, Dropdown, DropdownDivider, DropdownItem, Emphasis, Field, FieldBody, FieldLabel, Figure, File, Footer, Grid, Hero, HeroBody, HeroFoot, HeroHead, Icon, IconText, Image, Input, InputBase, Level, LevelItem, LevelLeft, LevelRight, Link, LinkButton, ListItem, Loader, Loading, Media, MediaContent, MediaLeft, MediaRight, Menu, MenuItem, MenuLabel, MenuList, Message, Modal, Navbar, NavbarBrand, NavbarBurger, NavbarDivider, NavbarDropdown, NavbarDropdownMenu, NavbarEnd, NavbarItem, NavbarLink, NavbarMenu, NavbarStart, Notification, NotificationContainer, NumberInput, Numberinput, OrderedList, Pagination, PaginationEllipsis, PaginationLink, PaginationList, PaginationNext, PaginationPrevious, Panel, PanelBlock, PanelButtonBlock, PanelCheckboxBlock, PanelHeading, PanelIcon, PanelInputBlock, PanelTabs, Paragraph, Popover, PopoverBody, PopoverClose, PopoverFooter, PopoverHeader, Portal, Pre, Progress, Radio, Radios, Rate, Reveal, Section, Select, SelectBase, Sidebar, Skeleton, Slider, Span, Step, Steps, Strong, SubTitle, Switch, Tab, TabContentItem, TabItem, TabList, Table, Tabs, TabsContent, Tag, TagInput, Taginput, Tags, Tbody, Td, TextArea, TextAreaBase, Tfoot, Th, Thead, Theme, TimeInput, TimeInputBase, Title, Toast, ToastContainer, Tooltip, Tr, UnorderedList, checkboxColors, checkboxSizes, classNames, createPrefixedClassNames, dialog, isBrowser$1 as isBrowser, mergeBulmaStyles, notification, prefixedClassNames, radioColors, radioSizes, switchColors, switchSizes, toast, useBulmaClasses, useClassPrefix, useColorClasses, useColorStyles, useConfig, useFlexboxClasses, useFocusTrap, useIconLibrary, useInsideControl, useInsideField, useIsHydrated, useOtherClasses, usePrefixedClass, usePrefixedClassNames, useSpacingClasses, useTypographyClasses, useVisibilityClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments$1 as validAlignments, validAspectRatios, validAxisOverflows, validColorShades, validColors, validCursors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFloats, validFontFamilies, validGaps, validInteractions, validJustifyContents, validOverflows, validPositions, validRadii, validResponsives, validSchemeColors, validShadows, validSizes$1 as validSizes, validTableColors, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
15867
15943
  //# sourceMappingURL=index.esm.js.map