indicator-ui 0.0.9 → 0.0.11

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/index.js CHANGED
@@ -8181,25 +8181,28 @@ const FlexField = (0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({ value, ty
8181
8181
  const getDropdown = () => {
8182
8182
  if (!dropdown)
8183
8183
  return undefined;
8184
- if (typeof dropdown === "boolean") {
8185
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: (0,clsx__WEBPACK_IMPORTED_MODULE_3__["default"])(className?.dropdown, { [className?.dropdownReverse]: dropdownState }), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_assets__WEBPACK_IMPORTED_MODULE_4__.ChevronDownSVG, {}) });
8186
- }
8187
- else {
8188
- return dropdown;
8189
- }
8184
+ const dropdownIcon = typeof dropdown === "boolean" ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_assets__WEBPACK_IMPORTED_MODULE_4__.ChevronDownSVG, {}) : dropdown;
8185
+ let dropdownClassName = typeof dropdownState === 'string' ? dropdownState : (0,clsx__WEBPACK_IMPORTED_MODULE_3__["default"])(className?.dropdown, { [className?.dropdownReverse]: dropdownState });
8186
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: dropdownClassName, children: dropdownIcon });
8190
8187
  };
8191
8188
  const getButton = () => {
8192
8189
  if (!button)
8193
8190
  return undefined;
8194
- if (typeof button === "boolean") {
8195
- return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onButtonClick, className: (0,clsx__WEBPACK_IMPORTED_MODULE_3__["default"])(className?.button, {
8196
- [className?.gray]: buttonState === 'gray',
8197
- [className?.red]: buttonState === 'red'
8198
- }), children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_assets__WEBPACK_IMPORTED_MODULE_4__.XCloseSVG, {}) });
8191
+ const buttonIcon = typeof button === "boolean" ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_assets__WEBPACK_IMPORTED_MODULE_4__.XCloseSVG, {}) : button;
8192
+ let buttonClassName;
8193
+ if (['red', 'gray'].includes(buttonState)) {
8194
+ buttonClassName = (0,clsx__WEBPACK_IMPORTED_MODULE_3__["default"])(className?.button, {
8195
+ [className?.gray]: buttonState === 'gray',
8196
+ [className?.red]: buttonState === 'red'
8197
+ });
8198
+ }
8199
+ else if (typeof buttonState === "string") {
8200
+ buttonClassName = buttonState;
8199
8201
  }
8200
8202
  else {
8201
- return button;
8203
+ buttonClassName = '';
8202
8204
  }
8205
+ return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: buttonClassName, children: buttonIcon });
8203
8206
  };
8204
8207
  return ((0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { ref: ref, onClick: onClick, className: (0,clsx__WEBPACK_IMPORTED_MODULE_3__["default"])(className?.flexField, {
8205
8208
  [className?.isError]: isError,