@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/constants.cjs +30 -0
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +18 -0
- package/dist/constants.esm.js +30 -1
- package/dist/constants.esm.js.map +1 -1
- package/dist/index.cjs +83 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +83 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/types/columns/Columns.d.ts +10 -2
- package/dist/types/grid/Grid.d.ts +16 -8
- package/dist/types/helpers/Theme.d.ts +1 -1
- package/dist/types/helpers/bulmaClassHelpers.d.ts +18 -0
- package/dist/types/helpers/useBulmaClasses.d.ts +3 -3
- package/dist/types/helpers/useSpacingClasses.d.ts +34 -3
- package/dist/types-cjs/columns/Columns.d.ts +10 -2
- package/dist/types-cjs/grid/Grid.d.ts +16 -8
- package/dist/types-cjs/helpers/Theme.d.ts +1 -1
- package/dist/types-cjs/helpers/bulmaClassHelpers.d.ts +18 -0
- package/dist/types-cjs/helpers/useBulmaClasses.d.ts +3 -3
- package/dist/types-cjs/helpers/useSpacingClasses.d.ts +34 -3
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ export type BulmaGapSize = BulmaGapValue;
|
|
|
10
10
|
/**
|
|
11
11
|
* Props for the Columns component.
|
|
12
12
|
*/
|
|
13
|
-
export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
13
|
+
export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'columnGap' | 'rowGap'> {
|
|
14
14
|
/** Additional CSS classes for the columns container. */
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Text color. */
|
|
@@ -31,7 +31,15 @@ export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit
|
|
|
31
31
|
isMobile?: boolean;
|
|
32
32
|
/** Apply columns layout on desktop and up. */
|
|
33
33
|
isDesktop?: boolean;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Gap size for all breakpoints, the columns gutter (`is-<value>`). Whole
|
|
36
|
+
* steps of the same scale as `Grid`'s `gap` prop; wins over `gapSize` if
|
|
37
|
+
* both are set.
|
|
38
|
+
*
|
|
39
|
+
* This is not the `gap` helper prop other components take, which renders
|
|
40
|
+
* `is-gap-<value>`: on `Columns` the gutter is padding inside each column,
|
|
41
|
+
* so the helper's CSS `gap` would add to it rather than replace it.
|
|
42
|
+
*/
|
|
35
43
|
gap?: BulmaGapValue;
|
|
36
44
|
/** Gap size for mobile. Wins over `gapSizeMobile` if both are set. */
|
|
37
45
|
gapMobile?: BulmaGapValue;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
import type { BulmaGapStep } from '../helpers/bulmaClassHelpers.js';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* The whole steps of Bulma's 0-8 gap scale, as `Columns` takes them. Accepts
|
|
6
|
+
* the value as a number or a numeric string.
|
|
7
|
+
*
|
|
8
|
+
* `Grid`'s gap props and the shared `gap`, `columnGap` and `rowGap` helper
|
|
9
|
+
* props take the half steps as well, as `BulmaGapStep`.
|
|
6
10
|
*/
|
|
7
11
|
export type BulmaGapValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
8
12
|
/**
|
|
@@ -23,12 +27,16 @@ export type BulmaFixedGridColsProp = BulmaFixedGridCols | 'auto';
|
|
|
23
27
|
export interface GridProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
24
28
|
/** Use a fixed grid layout (`.fixed-grid > .grid`). */
|
|
25
29
|
isFixed?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Main gap for grid (Bulma `is-gap-X`), a whole or half step of Bulma's gap
|
|
32
|
+
* scale. The same values and class as the `gap` helper prop on every other
|
|
33
|
+
* component.
|
|
34
|
+
*/
|
|
35
|
+
gap?: BulmaGapStep;
|
|
36
|
+
/** Column gap for grid (`is-column-gap-X`), on the same scale as `gap`. */
|
|
37
|
+
columnGap?: BulmaGapStep;
|
|
38
|
+
/** Row gap for grid (`is-row-gap-X`), on the same scale as `gap`. */
|
|
39
|
+
rowGap?: BulmaGapStep;
|
|
32
40
|
/** Minimum column width for the grid (`is-col-min-X`). */
|
|
33
41
|
minCol?: BulmaMinColValue;
|
|
34
42
|
/** For fixed grids: explicit column count (`has-X-cols`), or `'auto'` for auto-count. */
|
|
@@ -53,7 +53,7 @@ type BulmaVars = Partial<Record<BulmaVarKey, string>>;
|
|
|
53
53
|
* @property {string} [dangerS] - Danger color saturation.
|
|
54
54
|
* @property {string} [dangerL] - Danger color lightness.
|
|
55
55
|
*/
|
|
56
|
-
export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
56
|
+
export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'columnGap'> {
|
|
57
57
|
children: ReactNode;
|
|
58
58
|
className?: string;
|
|
59
59
|
/**
|
|
@@ -22,6 +22,24 @@ export declare const validSchemeColors: readonly ["scheme-main", "scheme-main-bi
|
|
|
22
22
|
* @example '0', '1', 'auto'
|
|
23
23
|
*/
|
|
24
24
|
export declare const validSizes: readonly ["0", "1", "2", "3", "4", "5", "6", "auto"];
|
|
25
|
+
/**
|
|
26
|
+
* Valid Bulma gap steps, taken by `gap`, `columnGap` and `rowGap`. Each whole
|
|
27
|
+
* step is 0.5rem, so `2` is 1rem and `8` is 4rem, and the half steps sit
|
|
28
|
+
* between them. They render `is-gap-<value>`, `is-column-gap-<value>` and
|
|
29
|
+
* `is-row-gap-<value>`.
|
|
30
|
+
*
|
|
31
|
+
* This is a different scale from `validSizes`: `gap="2"` is 1rem where
|
|
32
|
+
* `m="2"` is 0.5rem.
|
|
33
|
+
* @example '0', '0.5', '2', '8'
|
|
34
|
+
*/
|
|
35
|
+
export declare const validGaps: readonly ["0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8"];
|
|
36
|
+
/**
|
|
37
|
+
* A gap step as `gap`, `columnGap` and `rowGap` take it: a value from
|
|
38
|
+
* `validGaps`, or the same step written as a number (`gap={2}`,
|
|
39
|
+
* `gap={1.5}`). `Grid` took its gaps as numbers before the gap helpers were
|
|
40
|
+
* shared, so every gap prop still does.
|
|
41
|
+
*/
|
|
42
|
+
export type BulmaGapStep = '0' | '0.5' | '1' | '1.5' | '2' | '2.5' | '3' | '3.5' | '4' | '4.5' | '5' | '5.5' | '6' | '6.5' | '7' | '7.5' | '8' | 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5 | 5.5 | 6 | 6.5 | 7 | 7.5 | 8;
|
|
25
43
|
/**
|
|
26
44
|
* Valid Bulma text size classes.
|
|
27
45
|
* @example '1', '2', '3'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import { BulmaDisplayProps, BulmaViewportProps } from './bulmaClassHelpers.js';
|
|
2
|
+
import { BulmaDisplayProps, BulmaViewportProps, type BulmaGapStep } from './bulmaClassHelpers.js';
|
|
3
3
|
import { BulmaColorProps, BulmaColorPropsWithScheme } from './useColorClasses.js';
|
|
4
4
|
import { BulmaSpacingProps } from './useSpacingClasses.js';
|
|
5
5
|
import { BulmaTypographyProps } from './useTypographyClasses.js';
|
|
@@ -50,8 +50,8 @@ export declare const useBulmaClasses: <T extends object>(props: BulmaClassesProp
|
|
|
50
50
|
bulmaHelperStyles?: CSSProperties;
|
|
51
51
|
rest: Omit<T, keyof BulmaClassesProps>;
|
|
52
52
|
};
|
|
53
|
-
export { validColors, validColorShades, validSchemeColors, validSizes, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, validFloats, validOverflows, validAxisOverflows, validInteractions, validCursors, validRadii, validShadows, validResponsives, validPositions, validAspectRatios, } from './bulmaClassHelpers.js';
|
|
54
|
-
export type { BulmaViewportProps, BulmaDisplayProps };
|
|
53
|
+
export { validColors, validColorShades, validSchemeColors, validSizes, validGaps, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, validFloats, validOverflows, validAxisOverflows, validInteractions, validCursors, validRadii, validShadows, validResponsives, validPositions, validAspectRatios, } from './bulmaClassHelpers.js';
|
|
54
|
+
export type { BulmaViewportProps, BulmaDisplayProps, BulmaGapStep };
|
|
55
55
|
export * from './useColorClasses.js';
|
|
56
56
|
export * from './useSpacingClasses.js';
|
|
57
57
|
export * from './useTypographyClasses.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validSizes } from './bulmaClassHelpers.js';
|
|
1
|
+
import { validSizes, type BulmaGapStep } from './bulmaClassHelpers.js';
|
|
2
2
|
/**
|
|
3
|
-
* Props for applying Bulma margin and
|
|
3
|
+
* Props for applying Bulma margin, padding and gap helper classes.
|
|
4
4
|
*/
|
|
5
5
|
export interface BulmaSpacingProps {
|
|
6
6
|
/** Margin (e.g., '0', '1'). */
|
|
@@ -31,9 +31,40 @@ export interface BulmaSpacingProps {
|
|
|
31
31
|
px?: (typeof validSizes)[number];
|
|
32
32
|
/** Padding vertical (top and bottom). */
|
|
33
33
|
py?: (typeof validSizes)[number];
|
|
34
|
+
/**
|
|
35
|
+
* Space between the children of a flex or grid container (`is-gap-<value>`),
|
|
36
|
+
* on Bulma's gap scale: each whole step is 0.5rem, so `gap="2"` is 1rem, with
|
|
37
|
+
* half steps such as `"1.5"` between them. Also takes the step as a number.
|
|
38
|
+
*
|
|
39
|
+
* It sets the CSS `gap`, which does nothing unless the element lays its
|
|
40
|
+
* children out as flex or grid, so pair it with `display="flex"` on most
|
|
41
|
+
* components. The scale is not the margin scale: `m="2"` is 0.5rem.
|
|
42
|
+
*
|
|
43
|
+
* `Grid` and `Columns` declare their own `gap`. `Grid`'s renders the same
|
|
44
|
+
* class; `Columns`' is the columns gutter (`is-<value>`) and takes whole
|
|
45
|
+
* steps only.
|
|
46
|
+
*/
|
|
47
|
+
gap?: BulmaGapStep;
|
|
48
|
+
/**
|
|
49
|
+
* Space between columns only (`is-column-gap-<value>`), on the same scale as
|
|
50
|
+
* `gap`. Beside `gap` or `gapless`, it wins on its own axis.
|
|
51
|
+
*/
|
|
52
|
+
columnGap?: BulmaGapStep;
|
|
53
|
+
/**
|
|
54
|
+
* Space between rows only (`is-row-gap-<value>`), on the same scale as
|
|
55
|
+
* `gap`. Beside `gap` or `gapless`, it wins on its own axis.
|
|
56
|
+
*/
|
|
57
|
+
rowGap?: BulmaGapStep;
|
|
58
|
+
/**
|
|
59
|
+
* Removes the gap between children (`is-gapless`), the shortcut for
|
|
60
|
+
* `gap="0"`; a valid `gap` wins when both are set. `Columns` is the
|
|
61
|
+
* exception: its `gap` is its gutter, and there `gapless` is Bulma's gapless
|
|
62
|
+
* columns modifier, the same as `isGapless`.
|
|
63
|
+
*/
|
|
64
|
+
gapless?: boolean;
|
|
34
65
|
}
|
|
35
66
|
/**
|
|
36
|
-
* A hook that generates Bulma margin and
|
|
67
|
+
* A hook that generates Bulma margin, padding and gap helper classes.
|
|
37
68
|
*
|
|
38
69
|
* @function useSpacingClasses
|
|
39
70
|
* @param props - Spacing-related Bulma helper props.
|
|
@@ -10,7 +10,7 @@ export type BulmaGapSize = BulmaGapValue;
|
|
|
10
10
|
/**
|
|
11
11
|
* Props for the Columns component.
|
|
12
12
|
*/
|
|
13
|
-
export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
13
|
+
export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'columnGap' | 'rowGap'> {
|
|
14
14
|
/** Additional CSS classes for the columns container. */
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Text color. */
|
|
@@ -31,7 +31,15 @@ export interface ColumnsProps extends React.HTMLAttributes<HTMLDivElement>, Omit
|
|
|
31
31
|
isMobile?: boolean;
|
|
32
32
|
/** Apply columns layout on desktop and up. */
|
|
33
33
|
isDesktop?: boolean;
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Gap size for all breakpoints, the columns gutter (`is-<value>`). Whole
|
|
36
|
+
* steps of the same scale as `Grid`'s `gap` prop; wins over `gapSize` if
|
|
37
|
+
* both are set.
|
|
38
|
+
*
|
|
39
|
+
* This is not the `gap` helper prop other components take, which renders
|
|
40
|
+
* `is-gap-<value>`: on `Columns` the gutter is padding inside each column,
|
|
41
|
+
* so the helper's CSS `gap` would add to it rather than replace it.
|
|
42
|
+
*/
|
|
35
43
|
gap?: BulmaGapValue;
|
|
36
44
|
/** Gap size for mobile. Wins over `gapSizeMobile` if both are set. */
|
|
37
45
|
gapMobile?: BulmaGapValue;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses.js';
|
|
3
|
+
import type { BulmaGapStep } from '../helpers/bulmaClassHelpers.js';
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
5
|
+
* The whole steps of Bulma's 0-8 gap scale, as `Columns` takes them. Accepts
|
|
6
|
+
* the value as a number or a numeric string.
|
|
7
|
+
*
|
|
8
|
+
* `Grid`'s gap props and the shared `gap`, `columnGap` and `rowGap` helper
|
|
9
|
+
* props take the half steps as well, as `BulmaGapStep`.
|
|
6
10
|
*/
|
|
7
11
|
export type BulmaGapValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
8
12
|
/**
|
|
@@ -23,12 +27,16 @@ export type BulmaFixedGridColsProp = BulmaFixedGridCols | 'auto';
|
|
|
23
27
|
export interface GridProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
24
28
|
/** Use a fixed grid layout (`.fixed-grid > .grid`). */
|
|
25
29
|
isFixed?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Main gap for grid (Bulma `is-gap-X`), a whole or half step of Bulma's gap
|
|
32
|
+
* scale. The same values and class as the `gap` helper prop on every other
|
|
33
|
+
* component.
|
|
34
|
+
*/
|
|
35
|
+
gap?: BulmaGapStep;
|
|
36
|
+
/** Column gap for grid (`is-column-gap-X`), on the same scale as `gap`. */
|
|
37
|
+
columnGap?: BulmaGapStep;
|
|
38
|
+
/** Row gap for grid (`is-row-gap-X`), on the same scale as `gap`. */
|
|
39
|
+
rowGap?: BulmaGapStep;
|
|
32
40
|
/** Minimum column width for the grid (`is-col-min-X`). */
|
|
33
41
|
minCol?: BulmaMinColValue;
|
|
34
42
|
/** For fixed grids: explicit column count (`has-X-cols`), or `'auto'` for auto-count. */
|
|
@@ -53,7 +53,7 @@ type BulmaVars = Partial<Record<BulmaVarKey, string>>;
|
|
|
53
53
|
* @property {string} [dangerS] - Danger color saturation.
|
|
54
54
|
* @property {string} [dangerL] - Danger color lightness.
|
|
55
55
|
*/
|
|
56
|
-
export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
56
|
+
export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'columnGap'> {
|
|
57
57
|
children: ReactNode;
|
|
58
58
|
className?: string;
|
|
59
59
|
/**
|
|
@@ -22,6 +22,24 @@ export declare const validSchemeColors: readonly ["scheme-main", "scheme-main-bi
|
|
|
22
22
|
* @example '0', '1', 'auto'
|
|
23
23
|
*/
|
|
24
24
|
export declare const validSizes: readonly ["0", "1", "2", "3", "4", "5", "6", "auto"];
|
|
25
|
+
/**
|
|
26
|
+
* Valid Bulma gap steps, taken by `gap`, `columnGap` and `rowGap`. Each whole
|
|
27
|
+
* step is 0.5rem, so `2` is 1rem and `8` is 4rem, and the half steps sit
|
|
28
|
+
* between them. They render `is-gap-<value>`, `is-column-gap-<value>` and
|
|
29
|
+
* `is-row-gap-<value>`.
|
|
30
|
+
*
|
|
31
|
+
* This is a different scale from `validSizes`: `gap="2"` is 1rem where
|
|
32
|
+
* `m="2"` is 0.5rem.
|
|
33
|
+
* @example '0', '0.5', '2', '8'
|
|
34
|
+
*/
|
|
35
|
+
export declare const validGaps: readonly ["0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5", "5.5", "6", "6.5", "7", "7.5", "8"];
|
|
36
|
+
/**
|
|
37
|
+
* A gap step as `gap`, `columnGap` and `rowGap` take it: a value from
|
|
38
|
+
* `validGaps`, or the same step written as a number (`gap={2}`,
|
|
39
|
+
* `gap={1.5}`). `Grid` took its gaps as numbers before the gap helpers were
|
|
40
|
+
* shared, so every gap prop still does.
|
|
41
|
+
*/
|
|
42
|
+
export type BulmaGapStep = '0' | '0.5' | '1' | '1.5' | '2' | '2.5' | '3' | '3.5' | '4' | '4.5' | '5' | '5.5' | '6' | '6.5' | '7' | '7.5' | '8' | 0 | 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5 | 5.5 | 6 | 6.5 | 7 | 7.5 | 8;
|
|
25
43
|
/**
|
|
26
44
|
* Valid Bulma text size classes.
|
|
27
45
|
* @example '1', '2', '3'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import { BulmaDisplayProps, BulmaViewportProps } from './bulmaClassHelpers.js';
|
|
2
|
+
import { BulmaDisplayProps, BulmaViewportProps, type BulmaGapStep } from './bulmaClassHelpers.js';
|
|
3
3
|
import { BulmaColorProps, BulmaColorPropsWithScheme } from './useColorClasses.js';
|
|
4
4
|
import { BulmaSpacingProps } from './useSpacingClasses.js';
|
|
5
5
|
import { BulmaTypographyProps } from './useTypographyClasses.js';
|
|
@@ -50,8 +50,8 @@ export declare const useBulmaClasses: <T extends object>(props: BulmaClassesProp
|
|
|
50
50
|
bulmaHelperStyles?: CSSProperties;
|
|
51
51
|
rest: Omit<T, keyof BulmaClassesProps>;
|
|
52
52
|
};
|
|
53
|
-
export { validColors, validColorShades, validSchemeColors, validSizes, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, validFloats, validOverflows, validAxisOverflows, validInteractions, validCursors, validRadii, validShadows, validResponsives, validPositions, validAspectRatios, } from './bulmaClassHelpers.js';
|
|
54
|
-
export type { BulmaViewportProps, BulmaDisplayProps };
|
|
53
|
+
export { validColors, validColorShades, validSchemeColors, validSizes, validGaps, validTextSizes, validAlignments, validTextTransforms, validTextWeights, validFontFamilies, validDisplays, validVisibilities, validFlexDirections, validFlexWraps, validJustifyContents, validAlignContents, validAlignItems, validAlignSelfs, validFlexGrowShrink, validViewports, validFloats, validOverflows, validAxisOverflows, validInteractions, validCursors, validRadii, validShadows, validResponsives, validPositions, validAspectRatios, } from './bulmaClassHelpers.js';
|
|
54
|
+
export type { BulmaViewportProps, BulmaDisplayProps, BulmaGapStep };
|
|
55
55
|
export * from './useColorClasses.js';
|
|
56
56
|
export * from './useSpacingClasses.js';
|
|
57
57
|
export * from './useTypographyClasses.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { validSizes } from './bulmaClassHelpers.js';
|
|
1
|
+
import { validSizes, type BulmaGapStep } from './bulmaClassHelpers.js';
|
|
2
2
|
/**
|
|
3
|
-
* Props for applying Bulma margin and
|
|
3
|
+
* Props for applying Bulma margin, padding and gap helper classes.
|
|
4
4
|
*/
|
|
5
5
|
export interface BulmaSpacingProps {
|
|
6
6
|
/** Margin (e.g., '0', '1'). */
|
|
@@ -31,9 +31,40 @@ export interface BulmaSpacingProps {
|
|
|
31
31
|
px?: (typeof validSizes)[number];
|
|
32
32
|
/** Padding vertical (top and bottom). */
|
|
33
33
|
py?: (typeof validSizes)[number];
|
|
34
|
+
/**
|
|
35
|
+
* Space between the children of a flex or grid container (`is-gap-<value>`),
|
|
36
|
+
* on Bulma's gap scale: each whole step is 0.5rem, so `gap="2"` is 1rem, with
|
|
37
|
+
* half steps such as `"1.5"` between them. Also takes the step as a number.
|
|
38
|
+
*
|
|
39
|
+
* It sets the CSS `gap`, which does nothing unless the element lays its
|
|
40
|
+
* children out as flex or grid, so pair it with `display="flex"` on most
|
|
41
|
+
* components. The scale is not the margin scale: `m="2"` is 0.5rem.
|
|
42
|
+
*
|
|
43
|
+
* `Grid` and `Columns` declare their own `gap`. `Grid`'s renders the same
|
|
44
|
+
* class; `Columns`' is the columns gutter (`is-<value>`) and takes whole
|
|
45
|
+
* steps only.
|
|
46
|
+
*/
|
|
47
|
+
gap?: BulmaGapStep;
|
|
48
|
+
/**
|
|
49
|
+
* Space between columns only (`is-column-gap-<value>`), on the same scale as
|
|
50
|
+
* `gap`. Beside `gap` or `gapless`, it wins on its own axis.
|
|
51
|
+
*/
|
|
52
|
+
columnGap?: BulmaGapStep;
|
|
53
|
+
/**
|
|
54
|
+
* Space between rows only (`is-row-gap-<value>`), on the same scale as
|
|
55
|
+
* `gap`. Beside `gap` or `gapless`, it wins on its own axis.
|
|
56
|
+
*/
|
|
57
|
+
rowGap?: BulmaGapStep;
|
|
58
|
+
/**
|
|
59
|
+
* Removes the gap between children (`is-gapless`), the shortcut for
|
|
60
|
+
* `gap="0"`; a valid `gap` wins when both are set. `Columns` is the
|
|
61
|
+
* exception: its `gap` is its gutter, and there `gapless` is Bulma's gapless
|
|
62
|
+
* columns modifier, the same as `isGapless`.
|
|
63
|
+
*/
|
|
64
|
+
gapless?: boolean;
|
|
34
65
|
}
|
|
35
66
|
/**
|
|
36
|
-
* A hook that generates Bulma margin and
|
|
67
|
+
* A hook that generates Bulma margin, padding and gap helper classes.
|
|
37
68
|
*
|
|
38
69
|
* @function useSpacingClasses
|
|
39
70
|
* @param props - Spacing-related Bulma helper props.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.25.0",
|
|
4
4
|
"description": "A fully-typed React component library for the Bulma CSS framework. Build modern UIs quickly with reusable, accessible, and customizable Bulma-based React components.",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.esm.js",
|