@allxsmith/bestax-bulma 1.0.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.
Files changed (61) hide show
  1. package/dist/index.cjs.js +3799 -0
  2. package/dist/index.cjs.js.map +1 -0
  3. package/dist/index.esm.js +3701 -0
  4. package/dist/index.esm.js.map +1 -0
  5. package/dist/types/columns/Column.d.ts +73 -0
  6. package/dist/types/columns/Columns.d.ts +55 -0
  7. package/dist/types/components/Breadcrumb.d.ts +45 -0
  8. package/dist/types/components/Card.d.ts +44 -0
  9. package/dist/types/components/Dropdown.d.ts +72 -0
  10. package/dist/types/components/Menu.d.ts +79 -0
  11. package/dist/types/components/Message.d.ts +34 -0
  12. package/dist/types/components/Modal.d.ts +36 -0
  13. package/dist/types/components/Navbar.d.ts +229 -0
  14. package/dist/types/components/Pagination.d.ts +117 -0
  15. package/dist/types/components/Panel.d.ts +136 -0
  16. package/dist/types/components/Tab.d.ts +79 -0
  17. package/dist/types/components/Tabs.d.ts +79 -0
  18. package/dist/types/elements/Block.d.ts +30 -0
  19. package/dist/types/elements/Box.d.ts +33 -0
  20. package/dist/types/elements/Button.d.ts +64 -0
  21. package/dist/types/elements/Buttons.d.ts +36 -0
  22. package/dist/types/elements/Content.d.ts +33 -0
  23. package/dist/types/elements/Delete.d.ts +36 -0
  24. package/dist/types/elements/Icon.d.ts +41 -0
  25. package/dist/types/elements/IconText.d.ts +45 -0
  26. package/dist/types/elements/Image.d.ts +44 -0
  27. package/dist/types/elements/Notification.d.ts +31 -0
  28. package/dist/types/elements/Progress.d.ts +31 -0
  29. package/dist/types/elements/SubTitle.d.ts +38 -0
  30. package/dist/types/elements/Table.d.ts +38 -0
  31. package/dist/types/elements/Tag.d.ts +46 -0
  32. package/dist/types/elements/Tags.d.ts +27 -0
  33. package/dist/types/elements/Tbody.d.ts +26 -0
  34. package/dist/types/elements/Td.d.ts +33 -0
  35. package/dist/types/elements/Tfoot.d.ts +26 -0
  36. package/dist/types/elements/Th.d.ts +39 -0
  37. package/dist/types/elements/Thead.d.ts +26 -0
  38. package/dist/types/elements/Title.d.ts +40 -0
  39. package/dist/types/elements/Tr.d.ts +31 -0
  40. package/dist/types/form/Checkbox.d.ts +25 -0
  41. package/dist/types/form/Checkboxes.d.ts +23 -0
  42. package/dist/types/form/Control.d.ts +61 -0
  43. package/dist/types/form/Field.d.ts +96 -0
  44. package/dist/types/form/File.d.ts +45 -0
  45. package/dist/types/form/Input.d.ts +38 -0
  46. package/dist/types/form/Radio.d.ts +25 -0
  47. package/dist/types/form/Radios.d.ts +23 -0
  48. package/dist/types/form/Select.d.ts +38 -0
  49. package/dist/types/form/TextArea.d.ts +44 -0
  50. package/dist/types/grid/Cell.d.ts +43 -0
  51. package/dist/types/grid/Grid.d.ts +65 -0
  52. package/dist/types/helpers/classNames.d.ts +16 -0
  53. package/dist/types/helpers/useBulmaClasses.d.ts +194 -0
  54. package/dist/types/index.d.ts +54 -0
  55. package/dist/types/layout/Container.d.ts +43 -0
  56. package/dist/types/layout/Footer.d.ts +31 -0
  57. package/dist/types/layout/Hero.d.ts +98 -0
  58. package/dist/types/layout/Level.d.ts +104 -0
  59. package/dist/types/layout/Media.d.ts +96 -0
  60. package/dist/types/layout/Section.d.ts +34 -0
  61. package/package.json +95 -0
@@ -0,0 +1,96 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the Field component.
5
+ *
6
+ * @property {boolean} [horizontal] - Renders the field as horizontal (label and control side by side).
7
+ * @property {boolean|'centered'|'right'|'multiline'} [grouped] - Group controls in a row (optionally centered, right, or multiline).
8
+ * @property {boolean} [hasAddons] - Group controls as addons.
9
+ * @property {React.ReactNode} [label] - Field label.
10
+ * @property {'small'|'normal'|'medium'|'large'} [labelSize] - Size for the label.
11
+ * @property {object} [labelProps] - Props for the label element.
12
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the field.
13
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the field.
14
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the field.
15
+ * @property {string} [className] - Additional CSS classes.
16
+ * @property {React.ReactNode} [children] - Field content.
17
+ */
18
+ export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
19
+ horizontal?: boolean;
20
+ grouped?: boolean | 'centered' | 'right' | 'multiline';
21
+ hasAddons?: boolean;
22
+ label?: React.ReactNode;
23
+ labelSize?: 'small' | 'normal' | 'medium' | 'large';
24
+ labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
25
+ [key: string]: unknown;
26
+ };
27
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
28
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
29
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
30
+ className?: string;
31
+ children?: React.ReactNode;
32
+ }
33
+ /**
34
+ * Props for the FieldLabel component.
35
+ *
36
+ * @property {'small'|'normal'|'medium'|'large'} [size] - Size for the field label.
37
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the label.
38
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the label.
39
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the label.
40
+ * @property {string} [className] - Additional CSS classes.
41
+ * @property {React.ReactNode} [children] - Field label content.
42
+ */
43
+ export interface FieldLabelProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
44
+ size?: 'small' | 'normal' | 'medium' | 'large';
45
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
46
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
47
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
48
+ className?: string;
49
+ children?: React.ReactNode;
50
+ }
51
+ /**
52
+ * Props for the FieldBody component.
53
+ *
54
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the field body.
55
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the field body.
56
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the field body.
57
+ * @property {string} [className] - Additional CSS classes.
58
+ * @property {React.ReactNode} [children] - Field body content.
59
+ */
60
+ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
61
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
62
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
63
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
64
+ className?: string;
65
+ children?: React.ReactNode;
66
+ }
67
+ /**
68
+ * FieldLabel component for rendering a Bulma field label.
69
+ *
70
+ * @function
71
+ * @param {FieldLabelProps} props - Props for the FieldLabel component.
72
+ * @returns {JSX.Element} The rendered field label.
73
+ */
74
+ declare const FieldLabel: React.FC<FieldLabelProps>;
75
+ /**
76
+ * FieldBody component for rendering Bulma field body.
77
+ *
78
+ * @function
79
+ * @param {FieldBodyProps} props - Props for the FieldBody component.
80
+ * @returns {JSX.Element} The rendered field body.
81
+ */
82
+ declare const FieldBody: React.FC<FieldBodyProps>;
83
+ /**
84
+ * Field component for rendering a Bulma field container.
85
+ * Supports horizontal, grouped, and labelled fields.
86
+ *
87
+ * @function
88
+ * @param {FieldProps} props - Props for the Field component.
89
+ * @returns {JSX.Element} The rendered field container.
90
+ * @see {@link https://bulma.io/documentation/form/general/#field | Bulma Field documentation}
91
+ */
92
+ declare const Field: React.FC<FieldProps> & {
93
+ Label: typeof FieldLabel;
94
+ Body: typeof FieldBody;
95
+ };
96
+ export default Field;
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the File component.
5
+ *
6
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the file input.
7
+ * @property {'small'|'medium'|'large'} [size] - Size modifier for the file input.
8
+ * @property {boolean} [isBoxed] - Whether the file input is boxed.
9
+ * @property {boolean} [isFullwidth] - Whether the file input expands to full width.
10
+ * @property {boolean} [isRight] - Align file input to the right.
11
+ * @property {boolean} [isCentered] - Center the file input.
12
+ * @property {boolean} [hasName] - Show a file name indicator.
13
+ * @property {React.ReactNode} [label] - Custom label text or node.
14
+ * @property {React.ReactNode} [iconLeft] - Left icon element.
15
+ * @property {React.ReactNode} [iconRight] - Right icon element.
16
+ * @property {string} [className] - Additional CSS classes to apply.
17
+ * @property {string} [inputClassName] - Additional CSS classes for the input.
18
+ * @property {string} [fileName] - File name to display.
19
+ */
20
+ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'> {
21
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
22
+ size?: 'small' | 'medium' | 'large';
23
+ isBoxed?: boolean;
24
+ isFullwidth?: boolean;
25
+ isRight?: boolean;
26
+ isCentered?: boolean;
27
+ hasName?: boolean;
28
+ label?: React.ReactNode;
29
+ iconLeft?: React.ReactNode;
30
+ iconRight?: React.ReactNode;
31
+ className?: string;
32
+ inputClassName?: string;
33
+ fileName?: string;
34
+ }
35
+ /**
36
+ * Bulma File upload component with full Bulma helper class support.
37
+ * isRight and isCentered are mutually exclusive (Bulma spec).
38
+ *
39
+ * @function
40
+ * @param {FileProps} props - Props for the File component.
41
+ * @returns {JSX.Element} The rendered file upload field.
42
+ * @see {@link https://bulma.io/documentation/form/file/ | Bulma File documentation}
43
+ */
44
+ declare const File: React.ForwardRefExoticComponent<FileProps & React.RefAttributes<HTMLInputElement>>;
45
+ export default File;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the Input component.
5
+ *
6
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the input.
7
+ * @property {'small'|'medium'|'large'} [size] - Size modifier for the input.
8
+ * @property {boolean} [isRounded] - Renders the input with rounded corners.
9
+ * @property {boolean} [isStatic] - Renders the input as static text.
10
+ * @property {boolean} [isHovered] - Applies the hovered state.
11
+ * @property {boolean} [isFocused] - Applies the focused state.
12
+ * @property {boolean} [isLoading] - Shows loading indicator.
13
+ * @property {string} [className] - Additional CSS classes to apply.
14
+ * @property {boolean} [disabled] - Whether the input is disabled.
15
+ * @property {boolean} [readOnly] - Whether the input is read-only.
16
+ */
17
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
18
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
19
+ size?: 'small' | 'medium' | 'large';
20
+ isRounded?: boolean;
21
+ isStatic?: boolean;
22
+ isHovered?: boolean;
23
+ isFocused?: boolean;
24
+ isLoading?: boolean;
25
+ className?: string;
26
+ disabled?: boolean;
27
+ readOnly?: boolean;
28
+ }
29
+ /**
30
+ * Bulma Input component with full Bulma helper class support.
31
+ *
32
+ * @function
33
+ * @param {InputProps} props - Props for the Input component.
34
+ * @returns {JSX.Element} The rendered input element.
35
+ * @see {@link https://bulma.io/documentation/form/input/ | Bulma Input documentation}
36
+ */
37
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
38
+ export default Input;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the Radio component.
5
+ *
6
+ * @property {boolean} [disabled] - Whether the radio is disabled.
7
+ * @property {string} [className] - Additional CSS classes to apply.
8
+ * @property {React.ReactNode} [children] - The label/content for the radio.
9
+ * @see Bulma Radio documentation: https://bulma.io/documentation/form/radio/
10
+ */
11
+ export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'color'>, Omit<BulmaClassesProps, 'color'> {
12
+ disabled?: boolean;
13
+ className?: string;
14
+ children?: React.ReactNode;
15
+ }
16
+ /**
17
+ * Bulma Radio component with Bulma helper classes support.
18
+ * The label is provided via the children prop.
19
+ *
20
+ * @function
21
+ * @param {RadioProps} props - Props for the Radio component.
22
+ * @returns {JSX.Element} The rendered radio element.
23
+ */
24
+ declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
25
+ export default Radio;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the Radios component.
5
+ *
6
+ * @property {string} [className] - Additional CSS classes to apply.
7
+ * @property {React.ReactNode} children - Radio elements to render in the group.
8
+ */
9
+ export interface RadiosProps extends Omit<BulmaClassesProps, 'color'> {
10
+ className?: string;
11
+ children: React.ReactNode;
12
+ }
13
+ /**
14
+ * Wraps Radio components inside a Bulma 'radios' wrapper.
15
+ * Leverages useBulmaClasses for consistency with other components.
16
+ *
17
+ * @function
18
+ * @param {RadiosProps} props - Props for the Radios component.
19
+ * @returns {JSX.Element} The rendered radios group.
20
+ * @see {@link https://bulma.io/documentation/form/radio/#grouped-radios | Bulma Radios documentation}
21
+ */
22
+ declare const Radios: React.FC<RadiosProps>;
23
+ export default Radios;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the Select component.
5
+ *
6
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the select.
7
+ * @property {'small'|'medium'|'large'} [size] - Size modifier for the select.
8
+ * @property {boolean} [isRounded] - Renders the select with rounded corners.
9
+ * @property {boolean} [isLoading] - Shows loading indicator.
10
+ * @property {boolean} [isActive] - Applies Bulma's is-active modifier.
11
+ * @property {string} [className] - Additional CSS classes to apply.
12
+ * @property {boolean} [disabled] - Whether the select is disabled.
13
+ * @property {boolean} [multiple] - Whether the select allows multiple values.
14
+ * @property {number} [multipleSize] - For multiple select: number of visible options.
15
+ * @property {React.ReactNode} [children] - Option elements.
16
+ */
17
+ export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
18
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
19
+ size?: 'small' | 'medium' | 'large';
20
+ isRounded?: boolean;
21
+ isLoading?: boolean;
22
+ isActive?: boolean;
23
+ className?: string;
24
+ disabled?: boolean;
25
+ multiple?: boolean;
26
+ multipleSize?: number;
27
+ children?: React.ReactNode;
28
+ }
29
+ /**
30
+ * Bulma Select component with full Bulma helper class support.
31
+ *
32
+ * @function
33
+ * @param {SelectProps} props - Props for the Select component.
34
+ * @returns {JSX.Element} The rendered select element.
35
+ * @see {@link https://bulma.io/documentation/form/select/ | Bulma Select documentation}
36
+ */
37
+ declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
38
+ export default Select;
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Props for the TextArea component.
5
+ *
6
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the textarea.
7
+ * @property {'small'|'medium'|'large'} [size] - Size modifier for the textarea.
8
+ * @property {boolean} [isRounded] - Renders the textarea with rounded corners.
9
+ * @property {boolean} [isStatic] - Renders the textarea as static text.
10
+ * @property {boolean} [isHovered] - Applies the hovered state.
11
+ * @property {boolean} [isFocused] - Applies the focused state.
12
+ * @property {boolean} [isLoading] - Shows loading indicator.
13
+ * @property {boolean} [isActive] - Applies Bulma's is-active modifier.
14
+ * @property {boolean} [hasFixedSize] - Applies Bulma's has-fixed-size modifier.
15
+ * @property {string} [className] - Additional CSS classes to apply.
16
+ * @property {boolean} [disabled] - Whether the textarea is disabled.
17
+ * @property {boolean} [readOnly] - Whether the textarea is read-only.
18
+ * @property {number} [rows] - Number of visible text lines.
19
+ */
20
+ export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
21
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
22
+ size?: 'small' | 'medium' | 'large';
23
+ isRounded?: boolean;
24
+ isStatic?: boolean;
25
+ isHovered?: boolean;
26
+ isFocused?: boolean;
27
+ isLoading?: boolean;
28
+ isActive?: boolean;
29
+ hasFixedSize?: boolean;
30
+ className?: string;
31
+ disabled?: boolean;
32
+ readOnly?: boolean;
33
+ rows?: number;
34
+ }
35
+ /**
36
+ * Bulma TextArea component with full Bulma helper class support.
37
+ *
38
+ * @function
39
+ * @param {TextAreaProps} props - Props for the TextArea component.
40
+ * @returns {JSX.Element} The rendered textarea element.
41
+ * @see {@link https://bulma.io/documentation/form/textarea/ | Bulma Textarea documentation}
42
+ */
43
+ declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
44
+ export default TextArea;
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Type for grid cell span values.
5
+ */
6
+ export type CellSpanValue = number;
7
+ /**
8
+ * Props for the Cell component.
9
+ *
10
+ * @property {number} [colStart] - Which column the cell starts at (Bulma: is-col-start-x).
11
+ * @property {number} [colFromEnd] - Which column the cell ends at, counting from the end (Bulma: is-col-from-end-x).
12
+ * @property {CellSpanValue} [colSpan] - How many columns the cell will span (Bulma: is-col-span-x).
13
+ * @property {number} [rowStart] - Which row the cell starts at (Bulma: is-row-start-x).
14
+ * @property {number} [rowFromEnd] - Which row the cell ends at, counting from the end (Bulma: is-row-from-end-x).
15
+ * @property {CellSpanValue} [rowSpan] - How many rows the cell will span (Bulma: is-row-span-x).
16
+ * @property {string} [className] - Additional CSS class names.
17
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color (Bulma color, 'inherit', or 'current').
18
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color modifier for the cell.
19
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color (Bulma color, 'inherit', or 'current').
20
+ * @property {React.ReactNode} [children] - Children to render inside the cell.
21
+ */
22
+ export interface CellProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
23
+ colStart?: number;
24
+ colFromEnd?: number;
25
+ colSpan?: CellSpanValue;
26
+ rowStart?: number;
27
+ rowFromEnd?: number;
28
+ rowSpan?: CellSpanValue;
29
+ className?: string;
30
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
31
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
32
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
33
+ children?: React.ReactNode;
34
+ }
35
+ /**
36
+ * Bulma Cell component for CSS Grid layouts.
37
+ *
38
+ * @function
39
+ * @param {CellProps} props - Props for the Cell component.
40
+ * @returns {JSX.Element} The rendered grid cell.
41
+ * @see {@link https://bulma.io/documentation/grid/ | Bulma Grid documentation}
42
+ */
43
+ export declare const Cell: React.FC<CellProps>;
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
3
+ /**
4
+ * Allowed gap values for Bulma grid.
5
+ */
6
+ export type BulmaGapValue = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
7
+ /**
8
+ * Allowed minimum column values for Bulma grid.
9
+ */
10
+ export type BulmaMinColValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32;
11
+ /**
12
+ * Allowed fixed grid columns for Bulma grid.
13
+ */
14
+ export type BulmaFixedGridCols = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
15
+ /**
16
+ * Allowed fixed grid columns prop for Bulma grid.
17
+ */
18
+ export type BulmaFixedGridColsProp = BulmaFixedGridCols | 'auto';
19
+ /**
20
+ * Props for the Grid component.
21
+ *
22
+ * @property {boolean} [isFixed] - Use a fixed grid layout (Bulma's .fixed-grid > .grid).
23
+ * @property {BulmaGapValue} [gap] - Main gap for grid (applies is-gap-X, 0-8).
24
+ * @property {BulmaGapValue} [columnGap] - Column gap for grid (applies is-column-gap-X, 0-8).
25
+ * @property {BulmaGapValue} [rowGap] - Row gap for grid (applies is-row-gap-X, 0-8).
26
+ * @property {BulmaMinColValue} [minCol] - Minimum column width for the grid (applies is-col-min-X, 1-32).
27
+ * @property {BulmaFixedGridColsProp} [fixedCols] - For fixed grid only: explicit column count (applies has-X-cols, 0-12), or 'auto' for has-auto-count.
28
+ * @property {BulmaFixedGridCols} [fixedColsMobile] - For fixed grid only: explicit column count for mobile.
29
+ * @property {BulmaFixedGridCols} [fixedColsTablet] - For fixed grid only: explicit column count for tablet.
30
+ * @property {BulmaFixedGridCols} [fixedColsDesktop] - For fixed grid only: explicit column count for desktop.
31
+ * @property {BulmaFixedGridCols} [fixedColsWidescreen] - For fixed grid only: explicit column count for widescreen.
32
+ * @property {BulmaFixedGridCols} [fixedColsFullhd] - For fixed grid only: explicit column count for fullhd.
33
+ * @property {string} [className] - Additional CSS class names.
34
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color (Bulma color, 'inherit', or 'current').
35
+ * @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color modifier for the grid.
36
+ * @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color (Bulma color, 'inherit', or 'current').
37
+ * @property {React.ReactNode} [children] - Children to render inside the grid.
38
+ */
39
+ export interface GridProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
40
+ isFixed?: boolean;
41
+ gap?: BulmaGapValue;
42
+ columnGap?: BulmaGapValue;
43
+ rowGap?: BulmaGapValue;
44
+ minCol?: BulmaMinColValue;
45
+ fixedCols?: BulmaFixedGridColsProp;
46
+ fixedColsMobile?: BulmaFixedGridCols;
47
+ fixedColsTablet?: BulmaFixedGridCols;
48
+ fixedColsDesktop?: BulmaFixedGridCols;
49
+ fixedColsWidescreen?: BulmaFixedGridCols;
50
+ fixedColsFullhd?: BulmaFixedGridCols;
51
+ className?: string;
52
+ textColor?: (typeof validColors)[number] | 'inherit' | 'current';
53
+ color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
54
+ bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
55
+ children?: React.ReactNode;
56
+ }
57
+ /**
58
+ * Bulma Grid component for CSS Grid layouts, supports both fixed and responsive grid modes.
59
+ *
60
+ * @function
61
+ * @param {GridProps} props - Props for the Grid component.
62
+ * @returns {JSX.Element} The rendered grid.
63
+ * @see {@link https://bulma.io/documentation/grid/ | Bulma Grid documentation}
64
+ */
65
+ export declare const Grid: React.FC<GridProps>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Returns a space-separated string of class names based on input arguments.
3
+ *
4
+ * Accepts any mix of strings, numbers, arrays, or objects. Falsy values are ignored.
5
+ * Array and object values are recursively flattened, and object keys are included
6
+ * if their value is truthy. Duplicate class names are removed.
7
+ *
8
+ * @param {...(string | number | undefined | null | false | Record<string, unknown> | unknown[])} args - Class values to join.
9
+ * @returns {string} A space-separated string of unique class names.
10
+ *
11
+ * @example
12
+ * classNames('foo', ['bar', { baz: true }], { qux: false, quux: true });
13
+ * // => 'foo bar baz quux'
14
+ */
15
+ export declare function classNames(...args: (string | number | undefined | null | false | Record<string, unknown> | unknown[])[]): string;
16
+ export default classNames;
@@ -0,0 +1,194 @@
1
+ /**
2
+ * Valid Bulma color classes.
3
+ * @example 'primary', 'link', 'info'
4
+ */
5
+ export declare const validColors: readonly ["primary", "link", "info", "success", "warning", "danger", "black", "black-bis", "black-ter", "grey-darker", "grey-dark", "grey", "grey-light", "grey-lighter", "white", "light", "dark"];
6
+ /**
7
+ * Valid Bulma color shade suffixes.
8
+ * @example '00', '05', 'invert'
9
+ */
10
+ export declare const validColorShades: readonly ["00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55", "60", "65", "70", "75", "80", "85", "90", "95", "invert"];
11
+ /**
12
+ * Valid Bulma size classes for margins and paddings.
13
+ * @example '0', '1', 'auto'
14
+ */
15
+ export declare const validSizes: readonly ["0", "1", "2", "3", "4", "5", "6", "auto"];
16
+ /**
17
+ * Valid Bulma text size classes.
18
+ * @example '1', '2', '3'
19
+ */
20
+ export declare const validTextSizes: readonly ["1", "2", "3", "4", "5", "6", "7"];
21
+ /**
22
+ * Valid Bulma text alignment classes.
23
+ * @example 'centered', 'left', 'right'
24
+ */
25
+ export declare const validAlignments: readonly ["centered", "justified", "left", "right"];
26
+ /**
27
+ * Valid Bulma text transformation classes.
28
+ * @example 'capitalized', 'uppercase', 'italic'
29
+ */
30
+ export declare const validTextTransforms: readonly ["capitalized", "lowercase", "uppercase", "italic"];
31
+ /**
32
+ * Valid Bulma text weight classes.
33
+ * @example 'light', 'normal', 'bold'
34
+ */
35
+ export declare const validTextWeights: readonly ["light", "normal", "medium", "semibold", "bold"];
36
+ /**
37
+ * Valid Bulma font family classes.
38
+ * @example 'sans-serif', 'monospace', 'code'
39
+ */
40
+ export declare const validFontFamilies: readonly ["sans-serif", "monospace", "primary", "secondary", "code"];
41
+ /**
42
+ * Valid Bulma display classes.
43
+ * @example 'block', 'flex', 'inline'
44
+ */
45
+ export declare const validDisplays: readonly ["block", "flex", "inline", "inline-block", "inline-flex"];
46
+ /**
47
+ * Valid Bulma visibility classes.
48
+ * @example 'hidden', 'sr-only'
49
+ */
50
+ export declare const validVisibilities: readonly ["hidden", "sr-only"];
51
+ /**
52
+ * Valid Bulma flex direction classes.
53
+ * @example 'row', 'column', 'row-reverse'
54
+ */
55
+ export declare const validFlexDirections: readonly ["row", "row-reverse", "column", "column-reverse"];
56
+ /**
57
+ * Valid Bulma flex wrap classes.
58
+ * @example 'nowrap', 'wrap', 'wrap-reverse'
59
+ */
60
+ export declare const validFlexWraps: readonly ["nowrap", "wrap", "wrap-reverse"];
61
+ /**
62
+ * Valid Bulma justify-content classes.
63
+ * @example 'flex-start', 'center', 'space-between'
64
+ */
65
+ export declare const validJustifyContents: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly", "start", "end", "left", "right"];
66
+ /**
67
+ * Valid Bulma align-content classes.
68
+ * @example 'flex-start', 'center', 'stretch'
69
+ */
70
+ export declare const validAlignContents: readonly ["flex-start", "flex-end", "center", "space-between", "space-around", "space-evenly", "stretch"];
71
+ /**
72
+ * Valid Bulma align-items classes.
73
+ * @example 'stretch', 'flex-start', 'center'
74
+ */
75
+ export declare const validAlignItems: readonly ["stretch", "flex-start", "flex-end", "center", "baseline", "start", "end"];
76
+ /**
77
+ * Valid Bulma align-self classes.
78
+ * @example 'auto', 'flex-start', 'center'
79
+ */
80
+ export declare const validAlignSelfs: readonly ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"];
81
+ /**
82
+ * Valid Bulma flex grow and shrink values.
83
+ * @example '0', '1'
84
+ */
85
+ export declare const validFlexGrowShrink: readonly ["0", "1"];
86
+ /**
87
+ * Valid Bulma viewport classes for responsive design.
88
+ * @example 'mobile', 'tablet', 'desktop'
89
+ */
90
+ export declare const validViewports: readonly ["mobile", "tablet", "desktop", "widescreen", "fullhd"];
91
+ /**
92
+ * Props for applying Bulma helper classes to components.
93
+ */
94
+ export interface BulmaClassesProps {
95
+ /** Text color class (e.g., 'primary', 'info'). */
96
+ color?: (typeof validColors)[number] | 'inherit' | 'current';
97
+ /** Background color class (e.g., 'primary', 'info'). */
98
+ backgroundColor?: (typeof validColors)[number] | 'inherit' | 'current';
99
+ /** Color shade suffix (e.g., '00', 'invert'). */
100
+ colorShade?: (typeof validColorShades)[number];
101
+ /** Margin (e.g., '0', '1'). */
102
+ m?: (typeof validSizes)[number];
103
+ /** Margin top. */
104
+ mt?: (typeof validSizes)[number];
105
+ /** Margin right. */
106
+ mr?: (typeof validSizes)[number];
107
+ /** Margin bottom. */
108
+ mb?: (typeof validSizes)[number];
109
+ /** Margin left. */
110
+ ml?: (typeof validSizes)[number];
111
+ /** Margin horizontal (left and right). */
112
+ mx?: (typeof validSizes)[number];
113
+ /** Margin vertical (top and bottom). */
114
+ my?: (typeof validSizes)[number];
115
+ /** Padding (e.g., '0', '1'). */
116
+ p?: (typeof validSizes)[number];
117
+ /** Padding top. */
118
+ pt?: (typeof validSizes)[number];
119
+ /** Padding right. */
120
+ pr?: (typeof validSizes)[number];
121
+ /** Padding bottom. */
122
+ pb?: (typeof validSizes)[number];
123
+ /** Padding left. */
124
+ pl?: (typeof validSizes)[number];
125
+ /** Padding horizontal (left and right). */
126
+ px?: (typeof validSizes)[number];
127
+ /** Padding vertical (top and bottom). */
128
+ py?: (typeof validSizes)[number];
129
+ /** Text size (e.g., '1', '2'). */
130
+ textSize?: (typeof validTextSizes)[number];
131
+ /** Text alignment (e.g., 'centered', 'left'). */
132
+ textAlign?: (typeof validAlignments)[number];
133
+ /** Text transformation (e.g., 'uppercase', 'italic'). */
134
+ textTransform?: (typeof validTextTransforms)[number];
135
+ /** Text weight (e.g., 'light', 'bold'). */
136
+ textWeight?: (typeof validTextWeights)[number];
137
+ /** Font family (e.g., 'sans-serif', 'code'). */
138
+ fontFamily?: (typeof validFontFamilies)[number];
139
+ /** Display type (e.g., 'block', 'flex'). */
140
+ display?: (typeof validDisplays)[number];
141
+ /** Visibility (e.g., 'hidden', 'sr-only'). */
142
+ visibility?: (typeof validVisibilities)[number];
143
+ /** Flex direction (e.g., 'row', 'column'). */
144
+ flexDirection?: (typeof validFlexDirections)[number];
145
+ /** Flex wrap (e.g., 'wrap', 'nowrap'). */
146
+ flexWrap?: (typeof validFlexWraps)[number];
147
+ /** Justify content (e.g., 'center', 'space-between'). */
148
+ justifyContent?: (typeof validJustifyContents)[number];
149
+ /** Align content (e.g., 'center', 'stretch'). */
150
+ alignContent?: (typeof validAlignContents)[number];
151
+ /** Align items (e.g., 'center', 'flex-start'). */
152
+ alignItems?: (typeof validAlignItems)[number];
153
+ /** Align self (e.g., 'auto', 'center'). */
154
+ alignSelf?: (typeof validAlignSelfs)[number];
155
+ /** Flex grow value (e.g., '0', '1'). */
156
+ flexGrow?: (typeof validFlexGrowShrink)[number];
157
+ /** Flex shrink value (e.g., '0', '1'). */
158
+ flexShrink?: (typeof validFlexGrowShrink)[number];
159
+ /** Float direction (e.g., 'left', 'right'). */
160
+ float?: 'left' | 'right';
161
+ /** Overflow behavior (e.g., 'clipped'). */
162
+ overflow?: 'clipped';
163
+ /** Applies overlay styling if true. */
164
+ overlay?: boolean;
165
+ /** Interaction behavior (e.g., 'unselectable', 'clickable'). */
166
+ interaction?: 'unselectable' | 'clickable';
167
+ /** Border radius style (e.g., 'radiusless'). */
168
+ radius?: 'radiusless';
169
+ /** Shadow style (e.g., 'shadowless'). */
170
+ shadow?: 'shadowless';
171
+ /** Responsive behavior (e.g., 'mobile', 'narrow'). */
172
+ responsive?: 'mobile' | 'narrow';
173
+ /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */
174
+ viewport?: (typeof validViewports)[number];
175
+ }
176
+ /**
177
+ * A hook that generates Bulma helper classes from props and separates unhandled props.
178
+ *
179
+ * @function useBulmaClasses
180
+ * @param props - Combination of BulmaClassesProps and additional props.
181
+ * @returns An object containing the Bulma helper classes and unhandled props.
182
+ * @example
183
+ * const { bulmaHelperClasses, rest } = useBulmaClasses({
184
+ * color: 'primary',
185
+ * textSize: '3',
186
+ * className: 'custom-class'
187
+ * });
188
+ * // bulmaHelperClasses: 'has-text-primary is-size-3'
189
+ * // rest: { className: 'custom-class' }
190
+ */
191
+ export declare const useBulmaClasses: <T extends Record<string, unknown>>(props: BulmaClassesProps & T) => {
192
+ bulmaHelperClasses: string;
193
+ rest: Omit<T, keyof BulmaClassesProps>;
194
+ };