@jobber/components 6.38.2-fix-button-91dfa4d.0 → 6.38.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 +39 -39
- package/dist/Button/Button.types.d.ts +2 -7
- package/dist/Button-cjs.js +8 -41
- package/dist/Button-es.js +8 -41
- package/dist/styles.css +8 -0
- package/package.json +2 -2
package/dist/Button/Button.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
10
10
|
readonly type?: import("./Button.types").ButtonType | undefined;
|
|
11
11
|
readonly value?: string | undefined;
|
|
12
12
|
readonly id?: string | undefined;
|
|
13
|
-
onMouseDown?:
|
|
13
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
14
14
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
15
15
|
readonly disabled?: boolean | undefined;
|
|
16
16
|
readonly UNSAFE_className?: {
|
|
@@ -45,7 +45,7 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
45
45
|
readonly type?: import("./Button.types").ButtonType | undefined;
|
|
46
46
|
readonly value?: string | undefined;
|
|
47
47
|
readonly id?: string | undefined;
|
|
48
|
-
onMouseDown?:
|
|
48
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
49
49
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
50
50
|
readonly disabled?: boolean | undefined;
|
|
51
51
|
readonly UNSAFE_className?: {
|
|
@@ -88,8 +88,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
88
88
|
readonly loading?: boolean | undefined;
|
|
89
89
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
90
90
|
readonly ariaLabel?: string | undefined;
|
|
91
|
-
onClick?:
|
|
92
|
-
onMouseDown?:
|
|
91
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
92
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
93
93
|
readonly UNSAFE_className?: {
|
|
94
94
|
container?: string;
|
|
95
95
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -123,8 +123,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
123
123
|
readonly loading?: boolean | undefined;
|
|
124
124
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
125
125
|
readonly ariaLabel: string;
|
|
126
|
-
onClick?:
|
|
127
|
-
onMouseDown?:
|
|
126
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
127
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
128
128
|
readonly UNSAFE_className?: {
|
|
129
129
|
container?: string;
|
|
130
130
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -158,8 +158,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
158
158
|
readonly loading?: boolean | undefined;
|
|
159
159
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
160
160
|
readonly ariaLabel?: string | undefined;
|
|
161
|
-
onClick?:
|
|
162
|
-
onMouseDown?:
|
|
161
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
162
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
163
163
|
readonly UNSAFE_className?: {
|
|
164
164
|
container?: string;
|
|
165
165
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -193,8 +193,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
193
193
|
readonly loading?: boolean | undefined;
|
|
194
194
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
195
195
|
readonly ariaLabel: string;
|
|
196
|
-
onClick?:
|
|
197
|
-
onMouseDown?:
|
|
196
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
197
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
198
198
|
readonly UNSAFE_className?: {
|
|
199
199
|
container?: string;
|
|
200
200
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -228,8 +228,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
228
228
|
readonly loading?: boolean | undefined;
|
|
229
229
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
230
230
|
readonly ariaLabel?: string | undefined;
|
|
231
|
-
onClick?:
|
|
232
|
-
onMouseDown?:
|
|
231
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
232
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
233
233
|
readonly UNSAFE_className?: {
|
|
234
234
|
container?: string;
|
|
235
235
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -263,8 +263,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
263
263
|
readonly loading?: boolean | undefined;
|
|
264
264
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
265
265
|
readonly ariaLabel: string;
|
|
266
|
-
onClick?:
|
|
267
|
-
onMouseDown?:
|
|
266
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
267
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
268
268
|
readonly UNSAFE_className?: {
|
|
269
269
|
container?: string;
|
|
270
270
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -298,8 +298,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
298
298
|
readonly loading?: boolean | undefined;
|
|
299
299
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
300
300
|
readonly ariaLabel?: string | undefined;
|
|
301
|
-
onClick?:
|
|
302
|
-
onMouseDown?:
|
|
301
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
302
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
303
303
|
readonly UNSAFE_className?: {
|
|
304
304
|
container?: string;
|
|
305
305
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -333,8 +333,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
333
333
|
readonly loading?: boolean | undefined;
|
|
334
334
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
335
335
|
readonly ariaLabel: string;
|
|
336
|
-
onClick?:
|
|
337
|
-
onMouseDown?:
|
|
336
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
337
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
338
338
|
readonly UNSAFE_className?: {
|
|
339
339
|
container?: string;
|
|
340
340
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -368,8 +368,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
368
368
|
readonly loading?: boolean | undefined;
|
|
369
369
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
370
370
|
readonly ariaLabel?: string | undefined;
|
|
371
|
-
onClick?:
|
|
372
|
-
onMouseDown?:
|
|
371
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
372
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
373
373
|
readonly UNSAFE_className?: {
|
|
374
374
|
container?: string;
|
|
375
375
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -403,8 +403,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
403
403
|
readonly loading?: boolean | undefined;
|
|
404
404
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
405
405
|
readonly ariaLabel: string;
|
|
406
|
-
onClick?:
|
|
407
|
-
onMouseDown?:
|
|
406
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
407
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
408
408
|
readonly UNSAFE_className?: {
|
|
409
409
|
container?: string;
|
|
410
410
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -438,8 +438,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
438
438
|
readonly loading?: boolean | undefined;
|
|
439
439
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
440
440
|
readonly ariaLabel?: string | undefined;
|
|
441
|
-
onClick?:
|
|
442
|
-
onMouseDown?:
|
|
441
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
442
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
443
443
|
readonly UNSAFE_className?: {
|
|
444
444
|
container?: string;
|
|
445
445
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -473,8 +473,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
473
473
|
readonly loading?: boolean | undefined;
|
|
474
474
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
475
475
|
readonly ariaLabel: string;
|
|
476
|
-
onClick?:
|
|
477
|
-
onMouseDown?:
|
|
476
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
477
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
478
478
|
readonly UNSAFE_className?: {
|
|
479
479
|
container?: string;
|
|
480
480
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -503,7 +503,7 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
503
503
|
readonly type?: import("./Button.types").ButtonType | undefined;
|
|
504
504
|
readonly value?: string | undefined;
|
|
505
505
|
readonly id?: string | undefined;
|
|
506
|
-
onMouseDown?:
|
|
506
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
507
507
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
508
508
|
readonly disabled?: boolean | undefined;
|
|
509
509
|
readonly UNSAFE_className?: {
|
|
@@ -546,8 +546,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
546
546
|
readonly loading?: boolean | undefined;
|
|
547
547
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
548
548
|
readonly ariaLabel?: string | undefined;
|
|
549
|
-
onClick?:
|
|
550
|
-
onMouseDown?:
|
|
549
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
550
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
551
551
|
readonly UNSAFE_className?: {
|
|
552
552
|
container?: string;
|
|
553
553
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -581,8 +581,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
581
581
|
readonly loading?: boolean | undefined;
|
|
582
582
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
583
583
|
readonly ariaLabel?: string | undefined;
|
|
584
|
-
onClick?:
|
|
585
|
-
onMouseDown?:
|
|
584
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
585
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
586
586
|
readonly UNSAFE_className?: {
|
|
587
587
|
container?: string;
|
|
588
588
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -616,8 +616,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
616
616
|
readonly loading?: boolean | undefined;
|
|
617
617
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
618
618
|
readonly ariaLabel?: string | undefined;
|
|
619
|
-
onClick?:
|
|
620
|
-
onMouseDown?:
|
|
619
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
620
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
621
621
|
readonly UNSAFE_className?: {
|
|
622
622
|
container?: string;
|
|
623
623
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -651,8 +651,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
651
651
|
readonly loading?: boolean | undefined;
|
|
652
652
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
653
653
|
readonly ariaLabel?: string | undefined;
|
|
654
|
-
onClick?:
|
|
655
|
-
onMouseDown?:
|
|
654
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
655
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
656
656
|
readonly UNSAFE_className?: {
|
|
657
657
|
container?: string;
|
|
658
658
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -686,8 +686,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
686
686
|
readonly loading?: boolean | undefined;
|
|
687
687
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
688
688
|
readonly ariaLabel?: string | undefined;
|
|
689
|
-
onClick?:
|
|
690
|
-
onMouseDown?:
|
|
689
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
690
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
691
691
|
readonly UNSAFE_className?: {
|
|
692
692
|
container?: string;
|
|
693
693
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -721,8 +721,8 @@ declare const ButtonNamespace: React.ForwardRefExoticComponent<({
|
|
|
721
721
|
readonly loading?: boolean | undefined;
|
|
722
722
|
readonly size?: import("./Button.types").ButtonSize | undefined;
|
|
723
723
|
readonly ariaLabel?: string | undefined;
|
|
724
|
-
onClick?:
|
|
725
|
-
onMouseDown?:
|
|
724
|
+
onClick?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
725
|
+
onMouseDown?: ((event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void) | undefined;
|
|
726
726
|
readonly UNSAFE_className?: {
|
|
727
727
|
container?: string;
|
|
728
728
|
buttonLabel?: import("..").TypographyProps["UNSAFE_className"];
|
|
@@ -8,7 +8,6 @@ export type HTMLButtonType = "button" | "submit";
|
|
|
8
8
|
export type ButtonVariation = "work" | "learning" | "subtle" | "destructive";
|
|
9
9
|
export type ButtonSize = "small" | "base" | "large";
|
|
10
10
|
export type ButtonType = "primary" | "secondary" | "tertiary";
|
|
11
|
-
export type ClickEventHandler = ((event: React.MouseEvent<HTMLButtonElement>) => void) | ((event: React.MouseEvent<HTMLAnchorElement>) => void);
|
|
12
11
|
export interface ButtonFoundationProps {
|
|
13
12
|
/**
|
|
14
13
|
* Used for screen readers. Will override label on screen
|
|
@@ -24,8 +23,8 @@ export interface ButtonFoundationProps {
|
|
|
24
23
|
readonly loading?: boolean;
|
|
25
24
|
readonly size?: ButtonSize;
|
|
26
25
|
readonly ariaLabel?: string;
|
|
27
|
-
onClick
|
|
28
|
-
onMouseDown
|
|
26
|
+
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
27
|
+
onMouseDown?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
29
28
|
/**
|
|
30
29
|
* **Use at your own risk:** Custom class names for specific elements. This should only be used as a
|
|
31
30
|
* **last resort**. Using this may result in unexpected side effects.
|
|
@@ -68,8 +67,6 @@ interface ButtonAnchorProps extends ButtonFoundationProps {
|
|
|
68
67
|
* Used to create an 'href' on an anchor tag.
|
|
69
68
|
*/
|
|
70
69
|
readonly url?: string;
|
|
71
|
-
onClick?: ClickEventHandler;
|
|
72
|
-
onMouseDown?: ClickEventHandler;
|
|
73
70
|
}
|
|
74
71
|
interface ButtonLinkProps<S = unknown> extends ButtonFoundationProps {
|
|
75
72
|
/**
|
|
@@ -77,8 +74,6 @@ interface ButtonLinkProps<S = unknown> extends ButtonFoundationProps {
|
|
|
77
74
|
* @deprecated
|
|
78
75
|
*/
|
|
79
76
|
readonly to?: LinkProps<S>["to"];
|
|
80
|
-
onClick?: ClickEventHandler;
|
|
81
|
-
onMouseDown?: ClickEventHandler;
|
|
82
77
|
}
|
|
83
78
|
interface BaseActionProps extends ButtonFoundationProps {
|
|
84
79
|
readonly variation?: ButtonVariation;
|
package/dist/Button-cjs.js
CHANGED
|
@@ -82,54 +82,21 @@ const ButtonWrapper = React.forwardRef(
|
|
|
82
82
|
const buttonType = submit ? "submit" : "button";
|
|
83
83
|
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
84
84
|
// Base props common to all element types
|
|
85
|
-
const commonProps = {
|
|
86
|
-
|
|
87
|
-
disabled,
|
|
88
|
-
id,
|
|
89
|
-
style: UNSAFE_style.container,
|
|
90
|
-
"aria-controls": ariaControls,
|
|
91
|
-
"aria-haspopup": ariaHaspopup,
|
|
92
|
-
"aria-expanded": ariaExpanded,
|
|
93
|
-
"aria-label": ariaLabel,
|
|
94
|
-
role: role,
|
|
95
|
-
};
|
|
85
|
+
const commonProps = Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
|
|
86
|
+
id, style: UNSAFE_style.container }, (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
96
87
|
const buttonInternals = children || React.createElement(ButtonContent, Object.assign({}, props));
|
|
97
88
|
if (to) {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onClick &&
|
|
101
|
-
onClick(event);
|
|
102
|
-
},
|
|
103
|
-
onMouseDown: (event) => {
|
|
104
|
-
onMouseDown &&
|
|
105
|
-
onMouseDown(event);
|
|
106
|
-
},
|
|
107
|
-
}));
|
|
89
|
+
// Props specific to Link
|
|
90
|
+
const linkProps = Object.assign(Object.assign({}, commonProps), { to: to });
|
|
108
91
|
return React.createElement(reactRouterDom.Link, Object.assign({}, linkProps), buttonInternals);
|
|
109
92
|
}
|
|
110
93
|
if (url) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
onClick &&
|
|
114
|
-
onClick(event);
|
|
115
|
-
},
|
|
116
|
-
onMouseDown: (event) => {
|
|
117
|
-
onMouseDown &&
|
|
118
|
-
onMouseDown(event);
|
|
119
|
-
},
|
|
120
|
-
})), { ref: ref });
|
|
94
|
+
// Props specific to anchor
|
|
95
|
+
const anchorProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { href: !disabled ? url : undefined }), (external && { target: "_blank" })), { ref: ref });
|
|
121
96
|
return React.createElement("a", Object.assign({}, anchorProps), buttonInternals);
|
|
122
97
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
onClick &&
|
|
126
|
-
onClick(event);
|
|
127
|
-
},
|
|
128
|
-
onMouseDown: (event) => {
|
|
129
|
-
onMouseDown &&
|
|
130
|
-
onMouseDown(event);
|
|
131
|
-
},
|
|
132
|
-
})), { ref: ref });
|
|
98
|
+
// Props specific to button
|
|
99
|
+
const buttonProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { type: buttonType }), (submit && { name, value })), { ref: ref });
|
|
133
100
|
// Explanation: "type" IS defined in the buttonProps object
|
|
134
101
|
// eslint-disable-next-line react/button-has-type
|
|
135
102
|
return React.createElement("button", Object.assign({}, buttonProps), buttonInternals);
|
package/dist/Button-es.js
CHANGED
|
@@ -80,54 +80,21 @@ const ButtonWrapper = forwardRef(
|
|
|
80
80
|
const buttonType = submit ? "submit" : "button";
|
|
81
81
|
const buttonClassNames = classnames(combined, UNSAFE_className.container);
|
|
82
82
|
// Base props common to all element types
|
|
83
|
-
const commonProps = {
|
|
84
|
-
|
|
85
|
-
disabled,
|
|
86
|
-
id,
|
|
87
|
-
style: UNSAFE_style.container,
|
|
88
|
-
"aria-controls": ariaControls,
|
|
89
|
-
"aria-haspopup": ariaHaspopup,
|
|
90
|
-
"aria-expanded": ariaExpanded,
|
|
91
|
-
"aria-label": ariaLabel,
|
|
92
|
-
role: role,
|
|
93
|
-
};
|
|
83
|
+
const commonProps = Object.assign(Object.assign(Object.assign({ className: buttonClassNames, disabled,
|
|
84
|
+
id, style: UNSAFE_style.container }, (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
94
85
|
const buttonInternals = children || React__default.createElement(ButtonContent, Object.assign({}, props));
|
|
95
86
|
if (to) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
onClick &&
|
|
99
|
-
onClick(event);
|
|
100
|
-
},
|
|
101
|
-
onMouseDown: (event) => {
|
|
102
|
-
onMouseDown &&
|
|
103
|
-
onMouseDown(event);
|
|
104
|
-
},
|
|
105
|
-
}));
|
|
87
|
+
// Props specific to Link
|
|
88
|
+
const linkProps = Object.assign(Object.assign({}, commonProps), { to: to });
|
|
106
89
|
return React__default.createElement(Link, Object.assign({}, linkProps), buttonInternals);
|
|
107
90
|
}
|
|
108
91
|
if (url) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
onClick &&
|
|
112
|
-
onClick(event);
|
|
113
|
-
},
|
|
114
|
-
onMouseDown: (event) => {
|
|
115
|
-
onMouseDown &&
|
|
116
|
-
onMouseDown(event);
|
|
117
|
-
},
|
|
118
|
-
})), { ref: ref });
|
|
92
|
+
// Props specific to anchor
|
|
93
|
+
const anchorProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { href: !disabled ? url : undefined }), (external && { target: "_blank" })), { ref: ref });
|
|
119
94
|
return React__default.createElement("a", Object.assign({}, anchorProps), buttonInternals);
|
|
120
95
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
onClick &&
|
|
124
|
-
onClick(event);
|
|
125
|
-
},
|
|
126
|
-
onMouseDown: (event) => {
|
|
127
|
-
onMouseDown &&
|
|
128
|
-
onMouseDown(event);
|
|
129
|
-
},
|
|
130
|
-
})), { ref: ref });
|
|
96
|
+
// Props specific to button
|
|
97
|
+
const buttonProps = Object.assign(Object.assign(Object.assign(Object.assign({}, commonProps), { type: buttonType }), (submit && { name, value })), { ref: ref });
|
|
131
98
|
// Explanation: "type" IS defined in the buttonProps object
|
|
132
99
|
// eslint-disable-next-line react/button-has-type
|
|
133
100
|
return React__default.createElement("button", Object.assign({}, buttonProps), buttonInternals);
|
package/dist/styles.css
CHANGED
|
@@ -915,6 +915,14 @@
|
|
|
915
915
|
-webkit-box-shadow: 0 0 0 30px var(--color-surface) inset !important;
|
|
916
916
|
}
|
|
917
917
|
|
|
918
|
+
.vtSDcuzNr9Q-:-webkit-autofill,
|
|
919
|
+
.vtSDcuzNr9Q-:-webkit-autofill:hover,
|
|
920
|
+
.vtSDcuzNr9Q-:-webkit-autofill:focus,
|
|
921
|
+
.vtSDcuzNr9Q-:-webkit-autofill:active {
|
|
922
|
+
-webkit-text-fill-color: hsl(197, 90%, 12%);
|
|
923
|
+
-webkit-text-fill-color: var(--field--value-color);
|
|
924
|
+
}
|
|
925
|
+
|
|
918
926
|
.hGr6YW4AeLM-:not(:has(.Dgk00tzlODA-)) .vtSDcuzNr9Q- {
|
|
919
927
|
padding-top: var(--field--padding-top);
|
|
920
928
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jobber/components",
|
|
3
|
-
"version": "6.38.2
|
|
3
|
+
"version": "6.38.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -534,5 +534,5 @@
|
|
|
534
534
|
"> 1%",
|
|
535
535
|
"IE 10"
|
|
536
536
|
],
|
|
537
|
-
"gitHead": "
|
|
537
|
+
"gitHead": "90e851ce375c5fa0599a88ca378378f44e4f6b9e"
|
|
538
538
|
}
|