orcs-design-system 2.0.63 → 2.0.64
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.
|
@@ -72,13 +72,9 @@ export var fullWidth = function fullWidth() {
|
|
|
72
72
|
};
|
|
73
73
|
fullWidth.storyName = "Full width";
|
|
74
74
|
export var disabled = function disabled() {
|
|
75
|
-
return /*#__PURE__*/React.createElement(
|
|
76
|
-
my: "3"
|
|
77
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
75
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
78
76
|
disabled: true
|
|
79
|
-
}, "Disabled button")
|
|
80
|
-
variant: "disabled"
|
|
81
|
-
}, "Also disabled"));
|
|
77
|
+
}, "Disabled button");
|
|
82
78
|
};
|
|
83
79
|
disabled.storyName = "Disabled state";
|
|
84
80
|
export var loading = function loading() {
|
|
@@ -14,8 +14,7 @@ var StyledButton = styled("button").withConfig({
|
|
|
14
14
|
shouldForwardProp: shouldForwardProp
|
|
15
15
|
}).attrs(function (props) {
|
|
16
16
|
return {
|
|
17
|
-
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
18
|
-
disabled: props.disabled ? true : props.variant == "disabled" ? true : false
|
|
17
|
+
"data-testid": props.dataTestId ? props.dataTestId : props["data-testid"] ? props["data-testid"] : null
|
|
19
18
|
};
|
|
20
19
|
}).withConfig({
|
|
21
20
|
displayName: "Button__StyledButton",
|
|
@@ -114,16 +113,6 @@ var StyledButton = styled("button").withConfig({
|
|
|
114
113
|
boxShadow: themeGet("shadows.thinOutline")(props) + " " + themeGet("colors.danger30")(props)
|
|
115
114
|
}
|
|
116
115
|
},
|
|
117
|
-
disabled: {
|
|
118
|
-
bg: "greyLighter",
|
|
119
|
-
color: "grey",
|
|
120
|
-
borderColor: "greyLighter",
|
|
121
|
-
"&:hover": {
|
|
122
|
-
bg: "greyLighter",
|
|
123
|
-
color: "grey",
|
|
124
|
-
borderColor: "greyLighter"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
116
|
ghost: {
|
|
128
117
|
bg: "primaryLightest",
|
|
129
118
|
color: "primary",
|
|
@@ -140,6 +129,17 @@ var StyledButton = styled("button").withConfig({
|
|
|
140
129
|
}
|
|
141
130
|
}
|
|
142
131
|
});
|
|
132
|
+
}, function (props) {
|
|
133
|
+
return props.disabled ? css({
|
|
134
|
+
bg: "greyLighter",
|
|
135
|
+
color: "grey",
|
|
136
|
+
borderColor: "greyLighter",
|
|
137
|
+
"&:hover": {
|
|
138
|
+
bg: "greyLighter",
|
|
139
|
+
color: "grey",
|
|
140
|
+
borderColor: "greyLighter"
|
|
141
|
+
}
|
|
142
|
+
}) : css();
|
|
143
143
|
}, ButtonStyles);
|
|
144
144
|
export var Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
145
145
|
var large = props.large,
|
|
@@ -173,7 +173,6 @@ export var Button = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
173
173
|
borderWidth: "1px",
|
|
174
174
|
borderStyle: "solid",
|
|
175
175
|
disabled: disabled,
|
|
176
|
-
variant: disabled ? "disabled" : null,
|
|
177
176
|
onClick: onClick,
|
|
178
177
|
ref: ref
|
|
179
178
|
}, ButtonStyles, props), leftIcon && /*#__PURE__*/React.createElement(Icon, {
|
|
@@ -226,9 +225,6 @@ Button.__docgenInfo = {
|
|
|
226
225
|
}, {
|
|
227
226
|
"value": "\"danger\"",
|
|
228
227
|
"computed": false
|
|
229
|
-
}, {
|
|
230
|
-
"value": "\"disabled\"",
|
|
231
|
-
"computed": false
|
|
232
228
|
}, {
|
|
233
229
|
"value": "\"ghost\"",
|
|
234
230
|
"computed": false
|
|
@@ -335,7 +331,7 @@ Button.propTypes = {
|
|
|
335
331
|
small: PropTypes.bool,
|
|
336
332
|
|
|
337
333
|
/** Specifies alternate button colours/styles. */
|
|
338
|
-
variant: PropTypes.oneOf(["success", "danger", "
|
|
334
|
+
variant: PropTypes.oneOf(["success", "danger", "ghost", "default"]),
|
|
339
335
|
|
|
340
336
|
/** Full width button that takes up all available space of parent */
|
|
341
337
|
fullWidth: PropTypes.bool,
|