@jobber/components 7.14.1 → 7.14.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/dist/Button/Button.d.ts +2 -1
- package/dist/Button-cjs.js +2 -1
- package/dist/Button-es.js +2 -1
- package/dist/docs/Button/Button.md +5 -2
- package/package.json +2 -2
package/dist/Button/Button.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import React from "react";
|
|
|
2
2
|
import type { ButtonProps } from "./Button.types";
|
|
3
3
|
import { ButtonIcon, ButtonLabel } from "./ButtonInternals";
|
|
4
4
|
type ButtonElement = HTMLAnchorElement | HTMLButtonElement;
|
|
5
|
-
type ButtonRuntimeProps = ButtonProps & React.HTMLAttributes<ButtonElement> & {
|
|
5
|
+
type ButtonRuntimeProps = ButtonProps & Pick<React.HTMLAttributes<ButtonElement>, "aria-controls" | "aria-haspopup" | "aria-expanded" | "aria-label" | "onKeyDown" | "onKeyUp" | "onFocus" | "onBlur" | "onPointerDown" | "onPointerUp" | "onPointerEnter" | "onPointerLeave" | "onMouseEnter" | "onMouseLeave" | "onTouchStart" | "onTouchEnd" | "onContextMenu" | "tabIndex" | "title"> & {
|
|
6
6
|
readonly className?: string;
|
|
7
7
|
readonly ref?: React.Ref<ButtonElement>;
|
|
8
8
|
readonly style?: React.CSSProperties;
|
|
9
|
+
readonly [key: `data-${string}`]: unknown;
|
|
9
10
|
};
|
|
10
11
|
declare function Button(props: ButtonRuntimeProps): React.JSX.Element;
|
|
11
12
|
declare namespace Button {
|
package/dist/Button-cjs.js
CHANGED
|
@@ -80,7 +80,8 @@ function ButtonWrapper(props) {
|
|
|
80
80
|
const { combined } = useButtonStyles(props);
|
|
81
81
|
const isLinkButton = Boolean(url || to);
|
|
82
82
|
const buttonClassNames = classnames(combined, UNSAFE_className.container, className);
|
|
83
|
-
const
|
|
83
|
+
const dataAttributes = Object.fromEntries(Object.entries(rest).filter(([key]) => key.startsWith("data-")));
|
|
84
|
+
const sharedTagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, dataAttributes), { className: buttonClassNames, id, style: Object.assign(Object.assign({}, style), UNSAFE_style.container) }), (!disabled && {
|
|
84
85
|
onClick: (event) => {
|
|
85
86
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
86
87
|
},
|
package/dist/Button-es.js
CHANGED
|
@@ -78,7 +78,8 @@ function ButtonWrapper(props) {
|
|
|
78
78
|
const { combined } = useButtonStyles(props);
|
|
79
79
|
const isLinkButton = Boolean(url || to);
|
|
80
80
|
const buttonClassNames = classnames(combined, UNSAFE_className.container, className);
|
|
81
|
-
const
|
|
81
|
+
const dataAttributes = Object.fromEntries(Object.entries(rest).filter(([key]) => key.startsWith("data-")));
|
|
82
|
+
const sharedTagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, dataAttributes), { className: buttonClassNames, id, style: Object.assign(Object.assign({}, style), UNSAFE_style.container) }), (!disabled && {
|
|
82
83
|
onClick: (event) => {
|
|
83
84
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
84
85
|
},
|
|
@@ -908,6 +908,7 @@ export const styles = StyleSheet.create({
|
|
|
908
908
|
| `ariaExpanded` | `boolean` | No | — | |
|
|
909
909
|
| `ariaHaspopup` | `boolean` | No | — | |
|
|
910
910
|
| `ariaLabel` | `string` | No | — | |
|
|
911
|
+
| `className` | `string` | No | — | |
|
|
911
912
|
| `disabled` | `boolean` | No | — | |
|
|
912
913
|
| `external` | `boolean` | No | — | |
|
|
913
914
|
| `fullWidth` | `boolean` | No | — | |
|
|
@@ -917,10 +918,12 @@ export const styles = StyleSheet.create({
|
|
|
917
918
|
| `label` | `string` | No | — | |
|
|
918
919
|
| `loading` | `boolean` | No | — | |
|
|
919
920
|
| `name` | `string` | No | — | |
|
|
920
|
-
| `onClick` | `(
|
|
921
|
-
| `onMouseDown` | `(
|
|
921
|
+
| `onClick` | `(event: MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void` | No | — | |
|
|
922
|
+
| `onMouseDown` | `(event: MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void` | No | — | |
|
|
922
923
|
| `ref` | `Ref<ButtonElement>` | No | — | |
|
|
924
|
+
| `role` | `string` | No | — | Used to override the default button role. |
|
|
923
925
|
| `size` | `ButtonSize` | No | — | |
|
|
926
|
+
| `style` | `CSSProperties` | No | — | |
|
|
924
927
|
| `submit` | `boolean` | No | — | Allows the button to submit a form |
|
|
925
928
|
| `to` | `LocationDescriptor<unknown> | ((location: Location<unknown>) => LocationDescriptor<unknown>)` | No | — | **Deprecated**: to will be removed in the next major version @deprecated |
|
|
926
929
|
| `type` | `ButtonType` | No | — | |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "7.14.
|
|
3
|
+
"version": "7.14.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -583,5 +583,5 @@
|
|
|
583
583
|
"> 1%",
|
|
584
584
|
"IE 10"
|
|
585
585
|
],
|
|
586
|
-
"gitHead": "
|
|
586
|
+
"gitHead": "6975929e15bee2078a0d3b7a75828b2052bd2836"
|
|
587
587
|
}
|