@spark-web/button 5.0.0 → 5.0.1
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @spark-web/button
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#535](https://github.com/brighte-labs/spark-web/pull/535)
|
|
8
|
+
[`c1dbf2a`](https://github.com/brighte-labs/spark-web/commit/c1dbf2af1b4fb21a72034243e904580caf0152b4)
|
|
9
|
+
Thanks [@mkt-brighte](https://github.com/mkt-brighte)! - Add aria-label on
|
|
10
|
+
button
|
|
11
|
+
|
|
3
12
|
## 5.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
@@ -5,5 +5,5 @@ export declare type ButtonLinkProps = LinkComponentProps & CommonButtonProps;
|
|
|
5
5
|
/** The appearance of a `Button`, with the semantics of a link. */
|
|
6
6
|
export declare const ButtonLink: <Comp extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "a">(props: {
|
|
7
7
|
as?: Comp | undefined;
|
|
8
|
-
ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "
|
|
8
|
+
ref?: import("react").Ref<Comp extends "symbol" | "text" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "text" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "set" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
|
|
9
9
|
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & ButtonLinkProps) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -10,6 +10,8 @@ export declare type ButtonProps = CommonButtonProps & {
|
|
|
10
10
|
'aria-describedby'?: NativeButtonProps['aria-describedby'];
|
|
11
11
|
/** Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed. */
|
|
12
12
|
'aria-expanded'?: NativeButtonProps['aria-expanded'];
|
|
13
|
+
/** Defines a string value that labels the current element. */
|
|
14
|
+
'aria-label'?: NativeButtonProps['aria-label'];
|
|
13
15
|
/** When true, prevents onClick from firing. */
|
|
14
16
|
disabled?: boolean;
|
|
15
17
|
/** When true, the button will display a loading spinner. */
|
|
@@ -366,7 +366,7 @@ function useButtonStyles(_ref) {
|
|
|
366
366
|
})];
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
369
|
+
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "aria-label", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
370
370
|
/**
|
|
371
371
|
* Buttons are used to initialize an action, their label should express what
|
|
372
372
|
* action will occur when the user interacts with it.
|
|
@@ -375,6 +375,7 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
375
375
|
var ariaControls = _ref['aria-controls'],
|
|
376
376
|
ariaDescribedBy = _ref['aria-describedby'],
|
|
377
377
|
ariaExpanded = _ref['aria-expanded'],
|
|
378
|
+
ariaLabel = _ref['aria-label'],
|
|
378
379
|
data = _ref.data,
|
|
379
380
|
disabled = _ref.disabled,
|
|
380
381
|
id = _ref.id,
|
|
@@ -408,7 +409,7 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
408
409
|
"aria-controls": ariaControls,
|
|
409
410
|
"aria-describedby": ariaDescribedBy,
|
|
410
411
|
"aria-expanded": ariaExpanded,
|
|
411
|
-
"aria-label": props.label,
|
|
412
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : props.label,
|
|
412
413
|
css: react$1.css(buttonStyles, react$1.css(customCss)),
|
|
413
414
|
data: data,
|
|
414
415
|
disabled: loading || disabled,
|
|
@@ -366,7 +366,7 @@ function useButtonStyles(_ref) {
|
|
|
366
366
|
})];
|
|
367
367
|
}
|
|
368
368
|
|
|
369
|
-
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
369
|
+
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "aria-label", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
370
370
|
/**
|
|
371
371
|
* Buttons are used to initialize an action, their label should express what
|
|
372
372
|
* action will occur when the user interacts with it.
|
|
@@ -375,6 +375,7 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
375
375
|
var ariaControls = _ref['aria-controls'],
|
|
376
376
|
ariaDescribedBy = _ref['aria-describedby'],
|
|
377
377
|
ariaExpanded = _ref['aria-expanded'],
|
|
378
|
+
ariaLabel = _ref['aria-label'],
|
|
378
379
|
data = _ref.data,
|
|
379
380
|
disabled = _ref.disabled,
|
|
380
381
|
id = _ref.id,
|
|
@@ -408,7 +409,7 @@ var Button = /*#__PURE__*/react.forwardRef(function (_ref, forwardedRef) {
|
|
|
408
409
|
"aria-controls": ariaControls,
|
|
409
410
|
"aria-describedby": ariaDescribedBy,
|
|
410
411
|
"aria-expanded": ariaExpanded,
|
|
411
|
-
"aria-label": props.label,
|
|
412
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : props.label,
|
|
412
413
|
css: react$1.css(buttonStyles, react$1.css(customCss)),
|
|
413
414
|
data: data,
|
|
414
415
|
disabled: loading || disabled,
|
|
@@ -362,7 +362,7 @@ function useButtonStyles(_ref) {
|
|
|
362
362
|
})];
|
|
363
363
|
}
|
|
364
364
|
|
|
365
|
-
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
365
|
+
var _excluded$1 = ["aria-controls", "aria-describedby", "aria-expanded", "aria-label", "data", "disabled", "id", "loading", "onClick", "css", "rounded", "prominence", "size", "tone", "type"];
|
|
366
366
|
/**
|
|
367
367
|
* Buttons are used to initialize an action, their label should express what
|
|
368
368
|
* action will occur when the user interacts with it.
|
|
@@ -371,6 +371,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
371
371
|
var ariaControls = _ref['aria-controls'],
|
|
372
372
|
ariaDescribedBy = _ref['aria-describedby'],
|
|
373
373
|
ariaExpanded = _ref['aria-expanded'],
|
|
374
|
+
ariaLabel = _ref['aria-label'],
|
|
374
375
|
data = _ref.data,
|
|
375
376
|
disabled = _ref.disabled,
|
|
376
377
|
id = _ref.id,
|
|
@@ -404,7 +405,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
404
405
|
"aria-controls": ariaControls,
|
|
405
406
|
"aria-describedby": ariaDescribedBy,
|
|
406
407
|
"aria-expanded": ariaExpanded,
|
|
407
|
-
"aria-label": props.label,
|
|
408
|
+
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : props.label,
|
|
408
409
|
css: css(buttonStyles, css(customCss)),
|
|
409
410
|
data: data,
|
|
410
411
|
disabled: loading || disabled,
|