orcs-design-system 3.2.1 → 3.2.3
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
5
|
+
var _excluded = ["ariaLabel"];
|
|
4
6
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
7
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
8
|
import React from "react";
|
|
@@ -154,18 +156,25 @@ var StyledButton = styled("button").withConfig({
|
|
|
154
156
|
displayName: "Button__StyledButton",
|
|
155
157
|
componentId: "sc-10uojnk-0"
|
|
156
158
|
})(["", ""], buttonStyles);
|
|
159
|
+
var linkStyles = css(["width:", ";display:", ";align-items:", ";"], function (props) {
|
|
160
|
+
return props.width || "fit-content";
|
|
161
|
+
}, function (props) {
|
|
162
|
+
return props.height || props.width ? "flex" : props.display || "inline-block";
|
|
163
|
+
}, function (props) {
|
|
164
|
+
return props.alignItems || "center";
|
|
165
|
+
});
|
|
157
166
|
var StyledButtonLink = styled.a.withConfig({
|
|
158
167
|
shouldForwardProp: shouldForwardProp
|
|
159
168
|
}).attrs(attrs).withConfig({
|
|
160
169
|
displayName: "Button__StyledButtonLink",
|
|
161
170
|
componentId: "sc-10uojnk-1"
|
|
162
|
-
})(["", "
|
|
171
|
+
})(["", " ", ""], buttonStyles, linkStyles);
|
|
163
172
|
var StyledReactButtonLink = styled(Link).withConfig({
|
|
164
173
|
shouldForwardProp: shouldForwardProp
|
|
165
174
|
}).attrs(attrs).withConfig({
|
|
166
175
|
displayName: "Button__StyledReactButtonLink",
|
|
167
176
|
componentId: "sc-10uojnk-2"
|
|
168
|
-
})(["", "
|
|
177
|
+
})(["", " ", ""], buttonStyles, linkStyles);
|
|
169
178
|
var buttonPropTypes = {
|
|
170
179
|
/** Large button */
|
|
171
180
|
large: PropTypes.bool,
|
|
@@ -208,10 +217,13 @@ var buttonPropTypes = {
|
|
|
208
217
|
/** Specifies the color theme object. */
|
|
209
218
|
theme: PropTypes.object
|
|
210
219
|
};
|
|
211
|
-
var renderButton = function renderButton(ButtonComponent,
|
|
220
|
+
var renderButton = function renderButton(ButtonComponent, _ref) {
|
|
221
|
+
var ariaLabel = _ref.ariaLabel,
|
|
222
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
212
223
|
return /*#__PURE__*/React.createElement(ButtonComponent, _extends({
|
|
213
224
|
borderStyle: "solid"
|
|
214
225
|
}, props.ButtonStyles, props, {
|
|
226
|
+
"aria-label": ariaLabel,
|
|
215
227
|
ref: props.ref
|
|
216
228
|
}), props.leftIcon && /*#__PURE__*/React.createElement(Icon, {
|
|
217
229
|
icon: props.leftIcon,
|