@allxsmith/bestax-bulma 5.16.8 → 5.16.9
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 +73 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +73 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Avatar.d.ts +25 -2
- package/dist/types/components/Navbar.d.ts +14 -1
- package/dist/types-cjs/components/Avatar.d.ts +25 -2
- package/dist/types-cjs/components/Navbar.d.ts +14 -1
- 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
|
/**
|
|
@@ -217,7 +217,20 @@ export interface NavbarLinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'b
|
|
|
217
217
|
* @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
218
|
*/
|
|
219
219
|
export type NavbarLinkProps<T extends React.ElementType = 'a'> = NavbarLinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {
|
|
220
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.
|
|
222
|
+
*
|
|
223
|
+
* Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom
|
|
224
|
+
* component is taken to be interactive already — a router link, typically — so it
|
|
225
|
+
* keeps its own role and click behaviour. An intrinsic tag is judged on what it is:
|
|
226
|
+
* `'button'`, or anything carrying an `href`, is left alone, and everything else
|
|
227
|
+
* (`'span'`, a bare `'a'`, a custom element) gets `role="button"`, `tabIndex` and a
|
|
228
|
+
* click that opens the dropdown.
|
|
229
|
+
*
|
|
230
|
+
* If your custom component renders something non-interactive, pass `role="button"` and
|
|
231
|
+
* it takes that fallback too — `tabIndex` and click included. The keyboard path is
|
|
232
|
+
* attached either way.
|
|
233
|
+
*/
|
|
221
234
|
as?: T;
|
|
222
235
|
};
|
|
223
236
|
/**
|
|
@@ -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
|
/**
|
|
@@ -217,7 +217,20 @@ export interface NavbarLinkOwnProps extends Omit<BulmaClassesProps, 'color' | 'b
|
|
|
217
217
|
* @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
218
|
*/
|
|
219
219
|
export type NavbarLinkProps<T extends React.ElementType = 'a'> = NavbarLinkOwnProps & Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {
|
|
220
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.
|
|
222
|
+
*
|
|
223
|
+
* Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom
|
|
224
|
+
* component is taken to be interactive already — a router link, typically — so it
|
|
225
|
+
* keeps its own role and click behaviour. An intrinsic tag is judged on what it is:
|
|
226
|
+
* `'button'`, or anything carrying an `href`, is left alone, and everything else
|
|
227
|
+
* (`'span'`, a bare `'a'`, a custom element) gets `role="button"`, `tabIndex` and a
|
|
228
|
+
* click that opens the dropdown.
|
|
229
|
+
*
|
|
230
|
+
* If your custom component renders something non-interactive, pass `role="button"` and
|
|
231
|
+
* it takes that fallback too — `tabIndex` and click included. The keyboard path is
|
|
232
|
+
* attached either way.
|
|
233
|
+
*/
|
|
221
234
|
as?: T;
|
|
222
235
|
};
|
|
223
236
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allxsmith/bestax-bulma",
|
|
3
|
-
"version": "5.16.
|
|
3
|
+
"version": "5.16.9",
|
|
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",
|