@allxsmith/bestax-bulma 5.12.0 → 5.14.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.cjs.js +346 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +346 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Dropdown.d.ts +2 -0
- package/dist/types/components/Navbar.d.ts +2 -0
- package/dist/types/components/Panel.d.ts +5 -4
- package/dist/types/elements/Icon.d.ts +30 -7
- package/dist/types/elements/IconText.d.ts +4 -4
- package/dist/types/elements/Tags.d.ts +7 -1
- package/dist/types/form/Control.d.ts +4 -4
- package/dist/types/helpers/bulmaClassHelpers.d.ts +11 -3
- package/dist/types/helpers/useVisibilityClasses.d.ts +8 -0
- package/package.json +1 -1
|
@@ -46,6 +46,8 @@ export interface DropdownItemProps extends Omit<React.HTMLAttributes<HTMLElement
|
|
|
46
46
|
className?: string;
|
|
47
47
|
/** The element type to render. */
|
|
48
48
|
as?: 'a' | 'div' | 'button';
|
|
49
|
+
/** Marks the item as disabled; disabled items are skipped during keyboard navigation. Use with `as="button"` for a native disabled control, or pair with `aria-disabled` on a link. */
|
|
50
|
+
disabled?: boolean;
|
|
49
51
|
/** Item content. */
|
|
50
52
|
children?: React.ReactNode;
|
|
51
53
|
}
|
|
@@ -186,6 +186,8 @@ export interface NavbarDropdownProps extends React.HTMLAttributes<HTMLDivElement
|
|
|
186
186
|
hoverable?: boolean;
|
|
187
187
|
/** Dropdown is open. */
|
|
188
188
|
active?: boolean;
|
|
189
|
+
/** Callback when dropdown active state changes. */
|
|
190
|
+
onActiveChange?: (active: boolean) => void;
|
|
189
191
|
/** Dropdown content. */
|
|
190
192
|
children?: React.ReactNode;
|
|
191
193
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
|
-
import {
|
|
3
|
+
import { IconChildrenProps, IconNameProps } from '../elements/Icon';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Panel component.
|
|
6
6
|
*/
|
|
@@ -45,7 +45,7 @@ export interface PanelBlockProps extends React.AnchorHTMLAttributes<HTMLAnchorEl
|
|
|
45
45
|
* Props for the PanelIcon component.
|
|
46
46
|
* Extends IconProps but uses 'panel-icon' as the container class.
|
|
47
47
|
*/
|
|
48
|
-
export type PanelIconProps = Omit<
|
|
48
|
+
export type PanelIconProps = Omit<IconNameProps, 'containerClassName'> | Omit<IconChildrenProps, 'containerClassName'>;
|
|
49
49
|
/**
|
|
50
50
|
* Props for the PanelInputBlock component.
|
|
51
51
|
*/
|
|
@@ -102,8 +102,9 @@ export declare const PanelTabs: React.FC<PanelTabsProps>;
|
|
|
102
102
|
*/
|
|
103
103
|
export declare const PanelBlock: React.FC<PanelBlockProps>;
|
|
104
104
|
/**
|
|
105
|
-
* Icon wrapper with panel styling (renders as `<span class="panel-icon"
|
|
106
|
-
*
|
|
105
|
+
* Icon wrapper with panel styling (renders as `<span class="panel-icon">`, containing an
|
|
106
|
+
* `<i/>` when a `name` is given, or the custom node passed as `children`).
|
|
107
|
+
* Accepts all Icon props (`name`, `variant`, `features`, etc.), or `children` for a custom node.
|
|
107
108
|
*
|
|
108
109
|
* @function
|
|
109
110
|
* @param {PanelIconProps} props - Props for the PanelIcon component.
|
|
@@ -21,9 +21,10 @@ declare module 'react' {
|
|
|
21
21
|
}
|
|
22
22
|
type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* Shared props for the Icon component, independent of whether a class-based `name` or a
|
|
25
|
+
* custom `children` node supplies the glyph.
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
interface IconBaseProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaClassesProps {
|
|
27
28
|
/** Additional CSS classes to apply. */
|
|
28
29
|
className?: string;
|
|
29
30
|
/** Text color helper. */
|
|
@@ -32,18 +33,16 @@ export interface IconProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaC
|
|
|
32
33
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
33
34
|
/** Background color helper. */
|
|
34
35
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
35
|
-
/** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). */
|
|
36
|
-
name: string;
|
|
37
36
|
/** DEPRECATED: Legacy prop, use `name` instead. */
|
|
38
37
|
icon?: string;
|
|
39
38
|
/**
|
|
40
|
-
* The icon library to use ('fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols). Defaults to the value set in ConfigProvider or 'fa' if not configured.
|
|
39
|
+
* The icon library to use ('fa' = Font Awesome, 'mdi' = Material Design Icons, 'ion' = Ionicons Web Components, 'material-icons' = Google Material Icons, 'material-symbols' = Google Material Symbols). Defaults to the value set in ConfigProvider or 'fa' if not configured. Ignored when `children` supplies the glyph instead of `name`.
|
|
41
40
|
* @defaultValue 'fa'
|
|
42
41
|
*/
|
|
43
42
|
library?: IconLibrary;
|
|
44
|
-
/** Icon style variant (e.g. `'solid'`, `'outlined'`, `'rounded'`). */
|
|
43
|
+
/** Icon style variant (e.g. `'solid'`, `'outlined'`, `'rounded'`). Ignored when `children` supplies the glyph instead of `name`. */
|
|
45
44
|
variant?: string;
|
|
46
|
-
/** Additional modifiers (e.g. `'fa-lg'`, `'fa-spin'`, `'is-size-1'`). */
|
|
45
|
+
/** Additional modifiers (e.g. `'fa-lg'`, `'fa-spin'`, `'is-size-1'`). Ignored when `children` supplies the glyph instead of `name`. */
|
|
47
46
|
features?: string | string[];
|
|
48
47
|
/** **DEPRECATED:** Use `variant` and `features` instead. */
|
|
49
48
|
libraryFeatures?: string | string[];
|
|
@@ -64,6 +63,30 @@ export interface IconProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaC
|
|
|
64
63
|
/** Override the default `'icon'` container class (e.g., `'panel-icon'`). */
|
|
65
64
|
containerClassName?: string;
|
|
66
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Props for `Icon` rendering a class-based glyph from an icon library.
|
|
68
|
+
*/
|
|
69
|
+
export interface IconNameProps extends IconBaseProps {
|
|
70
|
+
/** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */
|
|
71
|
+
name: string;
|
|
72
|
+
/** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */
|
|
73
|
+
children?: never;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Props for `Icon` rendering a custom node (an inline SVG, a `react-icons` component, a Font
|
|
77
|
+
* Awesome React `<FontAwesomeIcon>`, …) in place of a class-based glyph.
|
|
78
|
+
*/
|
|
79
|
+
export interface IconChildrenProps extends IconBaseProps {
|
|
80
|
+
/** The icon name, with or without its library prefix (e.g. `'star'` or `'fa-star'`). Mutually exclusive with `children`. */
|
|
81
|
+
name?: undefined;
|
|
82
|
+
/** A custom node (an inline SVG, a `react-icons` component, …) rendered inside the icon container in place of a class-based glyph. Mutually exclusive with `name`. */
|
|
83
|
+
children: Exclude<React.ReactNode, undefined>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Props for the Icon component — a discriminated union of a class-based `name` and a custom
|
|
87
|
+
* `children` node.
|
|
88
|
+
*/
|
|
89
|
+
export type IconProps = IconNameProps | IconChildrenProps;
|
|
67
90
|
/**
|
|
68
91
|
* The `Icon` component is a Bulma-styled wrapper for displaying icons from various libraries (Font Awesome, Material Design Icons, Ionicons, Google Material Icons, Material Symbols, etc.).
|
|
69
92
|
*
|
|
@@ -5,8 +5,8 @@ import { IconProps } from './Icon';
|
|
|
5
5
|
* Represents an item for the IconText component, containing icon props and optional text.
|
|
6
6
|
*/
|
|
7
7
|
interface IconTextItem {
|
|
8
|
-
/** Props for the Icon component. */
|
|
9
|
-
iconProps: IconProps;
|
|
8
|
+
/** Props for the Icon component, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */
|
|
9
|
+
iconProps: IconProps | React.ReactNode;
|
|
10
10
|
/** Optional text to display next to the icon. */
|
|
11
11
|
text?: string;
|
|
12
12
|
}
|
|
@@ -27,8 +27,8 @@ interface IconTextProps extends React.HTMLAttributes<HTMLSpanElement>, BulmaClas
|
|
|
27
27
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
28
28
|
/** Background color helper. */
|
|
29
29
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
30
|
-
/** Props for a single Icon component
|
|
31
|
-
iconProps?: IconProps;
|
|
30
|
+
/** Props for a single Icon component, or a custom node, for single icon mode. */
|
|
31
|
+
iconProps?: IconProps | React.ReactNode;
|
|
32
32
|
/** Text for a single icon (for single icon mode). */
|
|
33
33
|
children?: React.ReactNode;
|
|
34
34
|
/** Array of icon/text pairs (for multiple icons mode). */
|
|
@@ -13,7 +13,13 @@ export interface TagsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'c
|
|
|
13
13
|
className?: string;
|
|
14
14
|
/** Group tags together as add-ons (no spacing). */
|
|
15
15
|
hasAddons?: boolean;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* No-op retained for backwards compatibility.
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Bulma's `.tags` wraps by default (no shipped `are-multiline`
|
|
20
|
+
* CSS exists for it) — this prop has never had a visual effect and will be
|
|
21
|
+
* removed in the next major version.
|
|
22
|
+
*/
|
|
17
23
|
isMultiline?: boolean;
|
|
18
24
|
/** Size of every tag in the group. */
|
|
19
25
|
size?: TagsSize;
|
|
@@ -21,10 +21,10 @@ export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
21
21
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
22
22
|
/** Background color. */
|
|
23
23
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
24
|
-
/** Icon props for left icon. */
|
|
25
|
-
iconLeft?: IconProps;
|
|
26
|
-
/** Icon props for right icon. */
|
|
27
|
-
iconRight?: IconProps;
|
|
24
|
+
/** Icon props for left icon, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */
|
|
25
|
+
iconLeft?: IconProps | React.ReactNode;
|
|
26
|
+
/** Icon props for right icon, or a custom node (an inline SVG, a `react-icons` component, …) rendered in place of a class-based glyph. */
|
|
27
|
+
iconRight?: IconProps | React.ReactNode;
|
|
28
28
|
/** Shortcut for left icon name. */
|
|
29
29
|
iconLeftName?: string;
|
|
30
30
|
/** Shortcut for left icon size. */
|
|
@@ -51,7 +51,7 @@ export declare const validFontFamilies: readonly ["sans-serif", "monospace", "pr
|
|
|
51
51
|
* Valid Bulma display classes.
|
|
52
52
|
* @example 'block', 'flex', 'inline'
|
|
53
53
|
*/
|
|
54
|
-
export declare const validDisplays: readonly ["block", "flex", "inline", "inline-block", "inline-flex"];
|
|
54
|
+
export declare const validDisplays: readonly ["block", "flex", "inline", "inline-block", "inline-flex", "grid"];
|
|
55
55
|
/**
|
|
56
56
|
* Valid Bulma visibility classes.
|
|
57
57
|
* These are all the valid visibility options available in Bulma.
|
|
@@ -97,7 +97,7 @@ export declare const validFlexGrowShrink: readonly ["0", "1", "2", "3", "4", "5"
|
|
|
97
97
|
* Valid Bulma viewport classes for responsive design.
|
|
98
98
|
* @example 'mobile', 'tablet', 'desktop'
|
|
99
99
|
*/
|
|
100
|
-
export declare const validViewports: readonly ["mobile", "tablet", "desktop", "widescreen", "fullhd"];
|
|
100
|
+
export declare const validViewports: readonly ["mobile", "tablet", "tablet-only", "touch", "desktop", "desktop-only", "widescreen", "widescreen-only", "fullhd"];
|
|
101
101
|
/**
|
|
102
102
|
* Props for applying a Bulma viewport modifier to viewport-aware helper classes.
|
|
103
103
|
*/
|
|
@@ -116,10 +116,18 @@ export interface BulmaDisplayProps {
|
|
|
116
116
|
displayMobile?: (typeof validDisplays)[number] | 'none';
|
|
117
117
|
/** Display type for tablet viewport (769px - 1023px). */
|
|
118
118
|
displayTablet?: (typeof validDisplays)[number] | 'none';
|
|
119
|
+
/** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */
|
|
120
|
+
displayTabletOnly?: (typeof validDisplays)[number] | 'none';
|
|
121
|
+
/** Display type for touch viewport (up to 1023px; mobile + tablet). */
|
|
122
|
+
displayTouch?: (typeof validDisplays)[number] | 'none';
|
|
119
123
|
/** Display type for desktop viewport (1024px - 1215px). */
|
|
120
124
|
displayDesktop?: (typeof validDisplays)[number] | 'none';
|
|
125
|
+
/** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */
|
|
126
|
+
displayDesktopOnly?: (typeof validDisplays)[number] | 'none';
|
|
121
127
|
/** Display type for widescreen viewport (1216px - 1407px). */
|
|
122
128
|
displayWidescreen?: (typeof validDisplays)[number] | 'none';
|
|
129
|
+
/** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */
|
|
130
|
+
displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';
|
|
123
131
|
/** Display type for fullhd viewport (1408px and above). */
|
|
124
132
|
displayFullhd?: (typeof validDisplays)[number] | 'none';
|
|
125
133
|
}
|
|
@@ -136,6 +144,6 @@ export interface BulmaDisplayProps {
|
|
|
136
144
|
export declare const createBulmaClassHelpers: (classPrefix?: string, viewport?: (typeof validViewports)[number]) => {
|
|
137
145
|
classes: string[];
|
|
138
146
|
addPrefixedClass: (className: string) => void;
|
|
139
|
-
addClass: (prefix: string, value: string | undefined, validValues: readonly string[], supportsViewport?: boolean) => void;
|
|
147
|
+
addClass: (prefix: string, value: string | undefined, validValues: readonly string[], supportsViewport?: boolean, supportedViewports?: readonly string[]) => void;
|
|
140
148
|
addClassNoViewport: (prefix: string, value: string | undefined, validValues: readonly string[]) => void;
|
|
141
149
|
};
|
|
@@ -9,10 +9,18 @@ export interface BulmaVisibilityProps extends BulmaViewportProps, BulmaDisplayPr
|
|
|
9
9
|
visibilityMobile?: (typeof validVisibilities)[number];
|
|
10
10
|
/** Visibility for tablet viewport (769px - 1023px). */
|
|
11
11
|
visibilityTablet?: (typeof validVisibilities)[number];
|
|
12
|
+
/** Visibility for tablet-only viewport (769px - 1023px, excludes desktop+). */
|
|
13
|
+
visibilityTabletOnly?: (typeof validVisibilities)[number];
|
|
14
|
+
/** Visibility for touch viewport (up to 1023px; mobile + tablet). */
|
|
15
|
+
visibilityTouch?: (typeof validVisibilities)[number];
|
|
12
16
|
/** Visibility for desktop viewport (1024px - 1215px). */
|
|
13
17
|
visibilityDesktop?: (typeof validVisibilities)[number];
|
|
18
|
+
/** Visibility for desktop-only viewport (1024px - 1215px, excludes widescreen+). */
|
|
19
|
+
visibilityDesktopOnly?: (typeof validVisibilities)[number];
|
|
14
20
|
/** Visibility for widescreen viewport (1216px - 1407px). */
|
|
15
21
|
visibilityWidescreen?: (typeof validVisibilities)[number];
|
|
22
|
+
/** Visibility for widescreen-only viewport (1216px - 1407px, excludes fullhd). */
|
|
23
|
+
visibilityWidescreenOnly?: (typeof validVisibilities)[number];
|
|
16
24
|
/** Visibility for fullhd viewport (1408px and above). */
|
|
17
25
|
visibilityFullhd?: (typeof validVisibilities)[number];
|
|
18
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.14.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.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|