@cashub/ui 0.10.2 → 0.10.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.10.2",
3
+ "version": "0.10.4",
4
4
  "private": false,
5
5
  "author": "CASHUB Team",
6
6
  "description": "CASHUB UI components library",
package/select/Select.js CHANGED
@@ -255,7 +255,8 @@ var Select = function Select(_ref) {
255
255
  content: value.text,
256
256
  onClick: function onClick(event) {
257
257
  return handleOnDeselect(event, value.id);
258
- }
258
+ },
259
+ disabled: disabled
259
260
  }, value.id);
260
261
  });
261
262
  }
@@ -266,7 +267,7 @@ var Select = function Select(_ref) {
266
267
  }
267
268
 
268
269
  return placeholder;
269
- }, [placeholder, handleOnDeselect, multiple, selectedOptions]);
270
+ }, [placeholder, handleOnDeselect, multiple, selectedOptions, disabled]);
270
271
  var optionItem = (0, _react.useMemo)(function () {
271
272
  if (optionList.length <= 0) return null;
272
273
  return optionList.map(function (option) {
@@ -577,6 +578,7 @@ var Select = function Select(_ref) {
577
578
  $fill: fill,
578
579
  fillReverse: fillReverse,
579
580
  onFocus: handleFocus,
581
+ placeholder: placeholder,
580
582
  children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
581
583
  onClick: function onClick() {
582
584
  onSelect('');
@@ -613,7 +615,7 @@ var Select = function Select(_ref) {
613
615
  });
614
616
  };
615
617
 
616
- var Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n min-width: 160px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--color-white);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", "\n\n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref2) {
618
+ var Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n min-width: 160px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--color-white);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", "\n ", "\n \n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), function (_ref2) {
617
619
  var disabled = _ref2.disabled;
618
620
  return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
619
621
  }, function (_ref3) {
@@ -623,16 +625,19 @@ var Combobox = _styledComponents.default.div(_templateObject || (_templateObject
623
625
  var disabled = _ref4.disabled;
624
626
  return disabled && 'cursor: not-allowed;opacity: 0.5;';
625
627
  }, function (_ref5) {
626
- var fullWidth = _ref5.fullWidth;
627
- return fullWidth ? 'width: 100%' : 'max-width: 320px';
628
+ var placeholder = _ref5.placeholder;
629
+ return placeholder && 'color: var(--font-on-mute);';
628
630
  }, function (_ref6) {
629
- var large = _ref6.large;
630
- return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
631
+ var fullWidth = _ref6.fullWidth;
632
+ return fullWidth ? 'width: 100%' : 'max-width: 320px';
631
633
  }, function (_ref7) {
632
- var $fill = _ref7.$fill;
633
- return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
634
+ var large = _ref7.large;
635
+ return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
634
636
  }, function (_ref8) {
635
- var fillReverse = _ref8.fillReverse;
637
+ var $fill = _ref8.$fill;
638
+ return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
639
+ }, function (_ref9) {
640
+ var fillReverse = _ref9.fillReverse;
636
641
  return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
637
642
  });
638
643
 
@@ -19,9 +19,10 @@ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(
19
19
 
20
20
  var SelectedMultiple = function SelectedMultiple(_ref) {
21
21
  var content = _ref.content,
22
- onClick = _ref.onClick;
22
+ onClick = _ref.onClick,
23
+ disabled = _ref.disabled;
23
24
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Selected, {
24
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
25
+ children: [!disabled && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
25
26
  onClick: onClick,
26
27
  "data-testid": "removeOption",
27
28
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaTimes, {})