@commercetools-uikit/primary-action-dropdown 19.20.1 → 19.22.0
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.
|
@@ -15,6 +15,7 @@ require('@commercetools-uikit/utils');
|
|
|
15
15
|
var icons = require('@commercetools-uikit/icons');
|
|
16
16
|
var hooks = require('@commercetools-uikit/hooks');
|
|
17
17
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
18
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
18
19
|
|
|
19
20
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
20
21
|
|
|
@@ -130,16 +131,16 @@ const PrimaryActionDropdown = props => {
|
|
|
130
131
|
css: /*#__PURE__*/react$1.css("position:relative;display:inline-flex;align-items:column;>:first-of-type>button{height:", designSystem.designTokens.heightForButtonAs40, ";}" + ("" ), "" ),
|
|
131
132
|
children: [jsxRuntime.jsx(DropdownHead, {
|
|
132
133
|
iconLeft: primaryOption.props.iconLeft,
|
|
133
|
-
isDisabled: primaryOption.props.isDisabled,
|
|
134
|
+
isDisabled: Boolean(primaryOption.props.isDisabled),
|
|
134
135
|
onClick: handleClickOnHead,
|
|
135
136
|
chevron: jsxRuntime.jsx(DropdownChevron, {
|
|
136
137
|
ref: ref,
|
|
137
138
|
onClick: handleClickOnChevron,
|
|
138
|
-
isDisabled: primaryOption.props.isDisabled,
|
|
139
|
+
isDisabled: Boolean(primaryOption.props.isDisabled),
|
|
139
140
|
isOpen: isOpen
|
|
140
141
|
}),
|
|
141
142
|
children: primaryOption.props.children
|
|
142
|
-
}), isOpen && !primaryOption.props.isDisabled && jsxRuntime.jsx(Options, {
|
|
143
|
+
}), isOpen && !Boolean(primaryOption.props.isDisabled) && jsxRuntime.jsx(Options, {
|
|
143
144
|
children: childrenAsArray
|
|
144
145
|
})]
|
|
145
146
|
});
|
|
@@ -148,22 +149,25 @@ PrimaryActionDropdown.propTypes = {};
|
|
|
148
149
|
PrimaryActionDropdown.displayName = 'PrimaryActionDropdown';
|
|
149
150
|
var PrimaryActionDropdown$1 = PrimaryActionDropdown;
|
|
150
151
|
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
152
|
+
const _excluded = ["isDisabled"];
|
|
153
|
+
const Option = _ref => {
|
|
154
|
+
let _ref$isDisabled = _ref.isDisabled,
|
|
155
|
+
isDisabled = _ref$isDisabled === void 0 ? false : _ref$isDisabled,
|
|
156
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
157
|
+
return jsxRuntime.jsx(AccessibleButton__default["default"], {
|
|
158
|
+
label: props.children,
|
|
159
|
+
onClick: props.onClick,
|
|
160
|
+
isDisabled: isDisabled,
|
|
161
|
+
css: [/*#__PURE__*/react$1.css("display:block;text-align:left;width:100%;padding:", designSystem.designTokens.spacing20, ";background-color:", designSystem.designTokens.colorSurface, ";&:first-of-type{border-radius:", designSystem.designTokens.borderRadius6, " ", designSystem.designTokens.borderRadius6, " 0 0;}&:last-of-type{border-radius:0 0 ", designSystem.designTokens.borderRadius6, " ", designSystem.designTokens.borderRadius6, ";}&:hover{background-color:", designSystem.designTokens.colorNeutral95, ";}" + ("" ), "" ), isDisabled && /*#__PURE__*/react$1.css("color:", designSystem.designTokens.colorNeutral, ";" + ("" ), "" ), "" , "" ],
|
|
162
|
+
children: props.children
|
|
163
|
+
});
|
|
164
|
+
};
|
|
158
165
|
Option.propTypes = {};
|
|
159
166
|
Option.displayName = 'Option';
|
|
160
|
-
Option.defaultProps = {
|
|
161
|
-
isDisabled: false
|
|
162
|
-
};
|
|
163
167
|
var Option$1 = Option;
|
|
164
168
|
|
|
165
169
|
// NOTE: This string will be replaced on build time with the package version.
|
|
166
|
-
var version = "19.
|
|
170
|
+
var version = "19.22.0";
|
|
167
171
|
|
|
168
172
|
exports.Option = Option$1;
|
|
169
173
|
exports["default"] = PrimaryActionDropdown$1;
|