@spark-web/button 5.0.0 → 5.0.2

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,28 @@
1
1
  # @spark-web/button
2
2
 
3
+ ## 5.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#542](https://github.com/brighte-labs/spark-web/pull/542)
8
+ [`602547f`](https://github.com/brighte-labs/spark-web/commit/602547f280fb12f7ce4de86b7046719167ada075)
9
+ Thanks [@ralcoriza-brighte](https://github.com/ralcoriza-brighte)! - Update
10
+ button story
11
+
12
+ - Updated dependencies
13
+ [[`602547f`](https://github.com/brighte-labs/spark-web/commit/602547f280fb12f7ce4de86b7046719167ada075)]:
14
+ - @spark-web/theme@5.2.0
15
+ - @spark-web/text@5.1.0
16
+
17
+ ## 5.0.1
18
+
19
+ ### Patch Changes
20
+
21
+ - [#535](https://github.com/brighte-labs/spark-web/pull/535)
22
+ [`c1dbf2a`](https://github.com/brighte-labs/spark-web/commit/c1dbf2af1b4fb21a72034243e904580caf0152b4)
23
+ Thanks [@mkt-brighte](https://github.com/mkt-brighte)! - Add aria-label on
24
+ button
25
+
3
26
  ## 5.0.0
4
27
 
5
28
  ### Major Changes
@@ -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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-web/button",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "homepage": "https://github.com/brighte-labs/spark-web#readme",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,8 +22,8 @@
22
22
  "@spark-web/icon": "^5.0.0",
23
23
  "@spark-web/link": "^5.0.0",
24
24
  "@spark-web/spinner": "^5.0.0",
25
- "@spark-web/text": "^5.0.0",
26
- "@spark-web/theme": "^5.0.0",
25
+ "@spark-web/text": "^5.1.0",
26
+ "@spark-web/theme": "^5.2.0",
27
27
  "@spark-web/utils": "^5.0.0"
28
28
  },
29
29
  "devDependencies": {