@allxsmith/bestax-bulma 5.16.8 → 5.16.10
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 +95 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +96 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Avatar.d.ts +25 -2
- package/dist/types/components/Card.d.ts +0 -4
- package/dist/types/components/Dropdown.d.ts +3 -0
- package/dist/types/components/Navbar.d.ts +19 -2
- package/dist/types/components/Toast.d.ts +5 -1
- package/dist/types/elements/Notification.d.ts +7 -2
- package/dist/types/form/File.d.ts +9 -2
- package/dist/types-cjs/components/Avatar.d.ts +25 -2
- package/dist/types-cjs/components/Card.d.ts +0 -4
- package/dist/types-cjs/components/Dropdown.d.ts +3 -0
- package/dist/types-cjs/components/Navbar.d.ts +19 -2
- package/dist/types-cjs/components/Toast.d.ts +5 -1
- package/dist/types-cjs/elements/Notification.d.ts +7 -2
- package/dist/types-cjs/form/File.d.ts +9 -2
- package/package.json +1 -1
|
@@ -18,7 +18,14 @@ export interface AvatarOwnProps extends Omit<BulmaClassesProps, 'color'> {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
/** Image URL. On load error (or if absent), falls back to initials, then `icon`. */
|
|
20
20
|
src?: string;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Alternate text for the image (used for the accessible name in every render mode). An
|
|
23
|
+
* explicit `alt=""` marks a non-interactive avatar as decorative.
|
|
24
|
+
*
|
|
25
|
+
* A link or button avatar is never decorative — it keeps an accessible name — and a custom
|
|
26
|
+
* component passed to `as` counts as one unless it states otherwise, so `alt=""` on a custom
|
|
27
|
+
* wrapper needs that signal alongside it. `as` documents which props carry it.
|
|
28
|
+
*/
|
|
22
29
|
alt?: string;
|
|
23
30
|
/** Derives initials and a deterministic background color when no `src` is shown. */
|
|
24
31
|
name?: string;
|
|
@@ -80,7 +87,23 @@ type AvatarForwardedProp = 'href' | 'target' | 'rel';
|
|
|
80
87
|
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
81
88
|
*/
|
|
82
89
|
export type AvatarProps<T extends React.ElementType = 'figure'> = Omit<AvatarOwnProps, Extract<AvatarForwardedProp, keyof React.ComponentPropsWithoutRef<T>>> & Omit<React.ComponentPropsWithoutRef<T>, Exclude<keyof AvatarOwnProps, AvatarForwardedProp> | 'as'> & {
|
|
83
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Element/component to render as. Defaults to `'a'` when `href` is set, else `'figure'`.
|
|
92
|
+
*
|
|
93
|
+
* This also decides whether the avatar is treated as interactive, which is what keeps
|
|
94
|
+
* `role="img"` and the `alt=""` decorative opt-out off a link or button. A custom
|
|
95
|
+
* component counts — a router link takes `to` rather than this component's `href`, so
|
|
96
|
+
* its own props cannot say — while `'a'`, `'button'`, and a custom element given an
|
|
97
|
+
* `href` count for the reason they read.
|
|
98
|
+
*
|
|
99
|
+
* If your custom component renders something that really is just a picture, say so with
|
|
100
|
+
* `role="img"` and it is treated as one, `alt=""` included. A truthy `aria-hidden` says it
|
|
101
|
+
* too, and so do `role="presentation"` and `role="none"` — though ARIA's own conflict
|
|
102
|
+
* resolution drops those two whenever the avatar still carries a name, so prefer
|
|
103
|
+
* `role="img"`. A role claiming the opposite, such as `"button"`, says nothing here, and
|
|
104
|
+
* neither does an `href`: that settles it on its own. A genuine `'a'`/`'button'`/`href`
|
|
105
|
+
* avatar keeps its accessible name either way.
|
|
106
|
+
*/
|
|
84
107
|
as?: T;
|
|
85
108
|
};
|
|
86
109
|
/**
|
|
@@ -160,7 +160,3 @@ export declare const Card: React.FC<CardProps> & {
|
|
|
160
160
|
Footer: React.FC<CardFooterProps>;
|
|
161
161
|
FooterItem: React.FC<CardFooterItemProps>;
|
|
162
162
|
};
|
|
163
|
-
/** Internal test-only exports. Not part of the public API. */
|
|
164
|
-
export declare const __test_exports__: {
|
|
165
|
-
renderFooter: (footer: CardProps["footer"], classPrefix: string | undefined) => React.JSX.Element[] | null;
|
|
166
|
-
};
|
|
@@ -3,6 +3,9 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
|
|
|
3
3
|
import type { ConstrainedPolymorphicComponentWithoutRef } from '../helpers/polymorphic.js';
|
|
4
4
|
/**
|
|
5
5
|
* Checks if code is running in a browser environment.
|
|
6
|
+
* @deprecated Dropdown's internal SSR guard, exported by accident; it will
|
|
7
|
+
* be removed in the next major. Check `typeof window !== 'undefined' &&
|
|
8
|
+
* typeof document !== 'undefined'` instead.
|
|
6
9
|
* @param win - Window object.
|
|
7
10
|
* @param doc - Document object.
|
|
8
11
|
* @returns {boolean} True if in browser, false otherwise.
|
|
@@ -106,7 +106,11 @@ export interface NavbarBurgerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
106
106
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
107
107
|
/** Whether the burger is active. */
|
|
108
108
|
active?: boolean;
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Custom content inside the burger, rendered after its four bar spans.
|
|
111
|
+
* Bulma styles every `<span>` in the burger as a bar, so an extra span here
|
|
112
|
+
* draws an extra bar.
|
|
113
|
+
*/
|
|
110
114
|
children?: React.ReactNode;
|
|
111
115
|
/** Aria label for accessibility. */
|
|
112
116
|
'aria-label'?: string;
|
|
@@ -217,7 +221,20 @@ export interface NavbarLinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'b
|
|
|
217
221
|
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
218
222
|
*/
|
|
219
223
|
export type NavbarLinkProps<T extends React.ElementType = 'a'> = NavbarLinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {
|
|
220
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.
|
|
226
|
+
*
|
|
227
|
+
* Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom
|
|
228
|
+
* component is taken to be interactive already — a router link, typically — so it
|
|
229
|
+
* keeps its own role and click behaviour. An intrinsic tag is judged on what it is:
|
|
230
|
+
* `'button'`, or anything carrying an `href`, is left alone, and everything else
|
|
231
|
+
* (`'span'`, a bare `'a'`, a custom element) gets `role="button"`, `tabIndex` and a
|
|
232
|
+
* click that opens the dropdown.
|
|
233
|
+
*
|
|
234
|
+
* If your custom component renders something non-interactive, pass `role="button"` and
|
|
235
|
+
* it takes that fallback too — `tabIndex` and click included. The keyboard path is
|
|
236
|
+
* attached either way.
|
|
237
|
+
*/
|
|
221
238
|
as?: T;
|
|
222
239
|
};
|
|
223
240
|
/**
|
|
@@ -16,7 +16,11 @@ export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
16
16
|
type?: ToastType;
|
|
17
17
|
/** Color variant — colors the **action button** text. */
|
|
18
18
|
actionType?: ToastType;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Position on the screen. Default: 'top-right'. On a standalone `<Toast>`
|
|
21
|
+
* this places it; through `toast.show()` it is currently ignored, because
|
|
22
|
+
* `ToastContainer`'s own `position` places every toast it shows.
|
|
23
|
+
*/
|
|
20
24
|
position?: ToastPosition;
|
|
21
25
|
/** Duration in ms before auto-close. `0` disables auto-close. */
|
|
22
26
|
duration?: number;
|
|
@@ -58,7 +58,10 @@ export interface NotificationOptions {
|
|
|
58
58
|
isLight?: boolean;
|
|
59
59
|
/** Duration in ms before auto-close. Default 3000. */
|
|
60
60
|
duration?: number;
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Position on the screen. Currently ignored: `NotificationContainer`'s own
|
|
63
|
+
* `position` places every notification it shows, so set it there.
|
|
64
|
+
*/
|
|
62
65
|
position?: NotificationPosition;
|
|
63
66
|
/** When true, notifications enter a FIFO queue and display one at a time. Default false. */
|
|
64
67
|
queue?: boolean;
|
|
@@ -136,7 +139,9 @@ export declare const notification: {
|
|
|
136
139
|
};
|
|
137
140
|
/**
|
|
138
141
|
* Container component for rendering programmatic notifications.
|
|
139
|
-
* Place once at your app root to enable the notification API.
|
|
142
|
+
* Place once at your app root to enable the notification API. Mount it
|
|
143
|
+
* before calling `notification`: a notification shown while no container is
|
|
144
|
+
* mounted doesn't appear when one mounts, only alongside the next call.
|
|
140
145
|
*
|
|
141
146
|
* @function
|
|
142
147
|
* @param {{ position?: NotificationPosition }} props - Container props.
|
|
@@ -29,9 +29,16 @@ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
29
29
|
hasName?: boolean;
|
|
30
30
|
/** Text on the file CTA button (defaults to "Choose a file…"). */
|
|
31
31
|
buttonLabel?: React.ReactNode;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Left icon element. It renders inside the `<label>` that names the file input, beside
|
|
34
|
+
* `buttonLabel`, so pass an `Icon` with `aria-hidden` (`<Icon name="upload" aria-hidden="true" />`);
|
|
35
|
+
* otherwise its default `aria-label="icon"` becomes part of the input's accessible name.
|
|
36
|
+
*/
|
|
33
37
|
iconLeft?: React.ReactNode;
|
|
34
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Right icon element. Sits inside the same `<label>` as `iconLeft`, so the same applies:
|
|
40
|
+
* give an `Icon` here `aria-hidden`, or "icon" joins the input's accessible name.
|
|
41
|
+
*/
|
|
35
42
|
iconRight?: React.ReactNode;
|
|
36
43
|
/** Additional CSS classes to apply. */
|
|
37
44
|
className?: string;
|
|
@@ -18,7 +18,14 @@ export interface AvatarOwnProps extends Omit<BulmaClassesProps, 'color'> {
|
|
|
18
18
|
className?: string;
|
|
19
19
|
/** Image URL. On load error (or if absent), falls back to initials, then `icon`. */
|
|
20
20
|
src?: string;
|
|
21
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Alternate text for the image (used for the accessible name in every render mode). An
|
|
23
|
+
* explicit `alt=""` marks a non-interactive avatar as decorative.
|
|
24
|
+
*
|
|
25
|
+
* A link or button avatar is never decorative — it keeps an accessible name — and a custom
|
|
26
|
+
* component passed to `as` counts as one unless it states otherwise, so `alt=""` on a custom
|
|
27
|
+
* wrapper needs that signal alongside it. `as` documents which props carry it.
|
|
28
|
+
*/
|
|
22
29
|
alt?: string;
|
|
23
30
|
/** Derives initials and a deterministic background color when no `src` is shown. */
|
|
24
31
|
name?: string;
|
|
@@ -80,7 +87,23 @@ type AvatarForwardedProp = 'href' | 'target' | 'rel';
|
|
|
80
87
|
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
81
88
|
*/
|
|
82
89
|
export type AvatarProps<T extends React.ElementType = 'figure'> = Omit<AvatarOwnProps, Extract<AvatarForwardedProp, keyof React.ComponentPropsWithoutRef<T>>> & Omit<React.ComponentPropsWithoutRef<T>, Exclude<keyof AvatarOwnProps, AvatarForwardedProp> | 'as'> & {
|
|
83
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Element/component to render as. Defaults to `'a'` when `href` is set, else `'figure'`.
|
|
92
|
+
*
|
|
93
|
+
* This also decides whether the avatar is treated as interactive, which is what keeps
|
|
94
|
+
* `role="img"` and the `alt=""` decorative opt-out off a link or button. A custom
|
|
95
|
+
* component counts — a router link takes `to` rather than this component's `href`, so
|
|
96
|
+
* its own props cannot say — while `'a'`, `'button'`, and a custom element given an
|
|
97
|
+
* `href` count for the reason they read.
|
|
98
|
+
*
|
|
99
|
+
* If your custom component renders something that really is just a picture, say so with
|
|
100
|
+
* `role="img"` and it is treated as one, `alt=""` included. A truthy `aria-hidden` says it
|
|
101
|
+
* too, and so do `role="presentation"` and `role="none"` — though ARIA's own conflict
|
|
102
|
+
* resolution drops those two whenever the avatar still carries a name, so prefer
|
|
103
|
+
* `role="img"`. A role claiming the opposite, such as `"button"`, says nothing here, and
|
|
104
|
+
* neither does an `href`: that settles it on its own. A genuine `'a'`/`'button'`/`href`
|
|
105
|
+
* avatar keeps its accessible name either way.
|
|
106
|
+
*/
|
|
84
107
|
as?: T;
|
|
85
108
|
};
|
|
86
109
|
/**
|
|
@@ -160,7 +160,3 @@ export declare const Card: React.FC<CardProps> & {
|
|
|
160
160
|
Footer: React.FC<CardFooterProps>;
|
|
161
161
|
FooterItem: React.FC<CardFooterItemProps>;
|
|
162
162
|
};
|
|
163
|
-
/** Internal test-only exports. Not part of the public API. */
|
|
164
|
-
export declare const __test_exports__: {
|
|
165
|
-
renderFooter: (footer: CardProps["footer"], classPrefix: string | undefined) => React.JSX.Element[] | null;
|
|
166
|
-
};
|
|
@@ -3,6 +3,9 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
|
|
|
3
3
|
import type { ConstrainedPolymorphicComponentWithoutRef } from '../helpers/polymorphic.js';
|
|
4
4
|
/**
|
|
5
5
|
* Checks if code is running in a browser environment.
|
|
6
|
+
* @deprecated Dropdown's internal SSR guard, exported by accident; it will
|
|
7
|
+
* be removed in the next major. Check `typeof window !== 'undefined' &&
|
|
8
|
+
* typeof document !== 'undefined'` instead.
|
|
6
9
|
* @param win - Window object.
|
|
7
10
|
* @param doc - Document object.
|
|
8
11
|
* @returns {boolean} True if in browser, false otherwise.
|
|
@@ -106,7 +106,11 @@ export interface NavbarBurgerProps extends React.ButtonHTMLAttributes<HTMLButton
|
|
|
106
106
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
107
107
|
/** Whether the burger is active. */
|
|
108
108
|
active?: boolean;
|
|
109
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* Custom content inside the burger, rendered after its four bar spans.
|
|
111
|
+
* Bulma styles every `<span>` in the burger as a bar, so an extra span here
|
|
112
|
+
* draws an extra bar.
|
|
113
|
+
*/
|
|
110
114
|
children?: React.ReactNode;
|
|
111
115
|
/** Aria label for accessibility. */
|
|
112
116
|
'aria-label'?: string;
|
|
@@ -217,7 +221,20 @@ export interface NavbarLinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'b
|
|
|
217
221
|
* @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.
|
|
218
222
|
*/
|
|
219
223
|
export type NavbarLinkProps<T extends React.ElementType = 'a'> = NavbarLinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {
|
|
220
|
-
/**
|
|
224
|
+
/**
|
|
225
|
+
* Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.
|
|
226
|
+
*
|
|
227
|
+
* Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom
|
|
228
|
+
* component is taken to be interactive already — a router link, typically — so it
|
|
229
|
+
* keeps its own role and click behaviour. An intrinsic tag is judged on what it is:
|
|
230
|
+
* `'button'`, or anything carrying an `href`, is left alone, and everything else
|
|
231
|
+
* (`'span'`, a bare `'a'`, a custom element) gets `role="button"`, `tabIndex` and a
|
|
232
|
+
* click that opens the dropdown.
|
|
233
|
+
*
|
|
234
|
+
* If your custom component renders something non-interactive, pass `role="button"` and
|
|
235
|
+
* it takes that fallback too — `tabIndex` and click included. The keyboard path is
|
|
236
|
+
* attached either way.
|
|
237
|
+
*/
|
|
221
238
|
as?: T;
|
|
222
239
|
};
|
|
223
240
|
/**
|
|
@@ -16,7 +16,11 @@ export interface ToastProps extends Omit<React.HTMLAttributes<HTMLDivElement>, '
|
|
|
16
16
|
type?: ToastType;
|
|
17
17
|
/** Color variant — colors the **action button** text. */
|
|
18
18
|
actionType?: ToastType;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Position on the screen. Default: 'top-right'. On a standalone `<Toast>`
|
|
21
|
+
* this places it; through `toast.show()` it is currently ignored, because
|
|
22
|
+
* `ToastContainer`'s own `position` places every toast it shows.
|
|
23
|
+
*/
|
|
20
24
|
position?: ToastPosition;
|
|
21
25
|
/** Duration in ms before auto-close. `0` disables auto-close. */
|
|
22
26
|
duration?: number;
|
|
@@ -58,7 +58,10 @@ export interface NotificationOptions {
|
|
|
58
58
|
isLight?: boolean;
|
|
59
59
|
/** Duration in ms before auto-close. Default 3000. */
|
|
60
60
|
duration?: number;
|
|
61
|
-
/**
|
|
61
|
+
/**
|
|
62
|
+
* Position on the screen. Currently ignored: `NotificationContainer`'s own
|
|
63
|
+
* `position` places every notification it shows, so set it there.
|
|
64
|
+
*/
|
|
62
65
|
position?: NotificationPosition;
|
|
63
66
|
/** When true, notifications enter a FIFO queue and display one at a time. Default false. */
|
|
64
67
|
queue?: boolean;
|
|
@@ -136,7 +139,9 @@ export declare const notification: {
|
|
|
136
139
|
};
|
|
137
140
|
/**
|
|
138
141
|
* Container component for rendering programmatic notifications.
|
|
139
|
-
* Place once at your app root to enable the notification API.
|
|
142
|
+
* Place once at your app root to enable the notification API. Mount it
|
|
143
|
+
* before calling `notification`: a notification shown while no container is
|
|
144
|
+
* mounted doesn't appear when one mounts, only alongside the next call.
|
|
140
145
|
*
|
|
141
146
|
* @function
|
|
142
147
|
* @param {{ position?: NotificationPosition }} props - Container props.
|
|
@@ -29,9 +29,16 @@ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
29
29
|
hasName?: boolean;
|
|
30
30
|
/** Text on the file CTA button (defaults to "Choose a file…"). */
|
|
31
31
|
buttonLabel?: React.ReactNode;
|
|
32
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Left icon element. It renders inside the `<label>` that names the file input, beside
|
|
34
|
+
* `buttonLabel`, so pass an `Icon` with `aria-hidden` (`<Icon name="upload" aria-hidden="true" />`);
|
|
35
|
+
* otherwise its default `aria-label="icon"` becomes part of the input's accessible name.
|
|
36
|
+
*/
|
|
33
37
|
iconLeft?: React.ReactNode;
|
|
34
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Right icon element. Sits inside the same `<label>` as `iconLeft`, so the same applies:
|
|
40
|
+
* give an `Icon` here `aria-hidden`, or "icon" joins the input's accessible name.
|
|
41
|
+
*/
|
|
35
42
|
iconRight?: React.ReactNode;
|
|
36
43
|
/** Additional CSS classes to apply. */
|
|
37
44
|
className?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.10",
|
|
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",
|