@cashub/ui 0.26.1 → 0.26.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.
- package/package.json +1 -1
- package/select/Select.js +82 -70
- package/tooltip/Tooltip.js +2 -2
package/package.json
CHANGED
package/select/Select.js
CHANGED
|
@@ -44,7 +44,8 @@ const Select = _ref => {
|
|
|
44
44
|
fill,
|
|
45
45
|
fillReverse,
|
|
46
46
|
onBlur,
|
|
47
|
-
onSearch
|
|
47
|
+
onSearch,
|
|
48
|
+
flexGrow
|
|
48
49
|
} = _ref;
|
|
49
50
|
const {
|
|
50
51
|
t
|
|
@@ -494,64 +495,70 @@ const Select = _ref => {
|
|
|
494
495
|
}
|
|
495
496
|
}
|
|
496
497
|
}, [setupFocus, display, allowSearch]);
|
|
497
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
if (onBlur) onBlur();
|
|
501
|
-
setIsFocusCombobox(false);
|
|
498
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
499
|
+
style: {
|
|
500
|
+
flexGrow: flexGrow ? 1 : 0
|
|
502
501
|
},
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
$display: display,
|
|
515
|
-
disabled: disabled,
|
|
516
|
-
fullWidth: fullWidth,
|
|
517
|
-
large: large,
|
|
518
|
-
$fill: fill,
|
|
519
|
-
fillReverse: fillReverse,
|
|
520
|
-
onFocus: handleFocus,
|
|
521
|
-
placeholder: placeholder,
|
|
522
|
-
children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
523
|
-
onClick: () => {
|
|
524
|
-
onSelect('');
|
|
525
|
-
}
|
|
526
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandArrow, {
|
|
502
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
|
|
503
|
+
onOutsideClick: () => {
|
|
504
|
+
setDisplay(false);
|
|
505
|
+
if (onBlur) onBlur();
|
|
506
|
+
setIsFocusCombobox(false);
|
|
507
|
+
},
|
|
508
|
+
disabled: !isFocusCombobox,
|
|
509
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Combobox, {
|
|
510
|
+
flexGrow: flexGrow,
|
|
511
|
+
role: "combobox",
|
|
512
|
+
tabIndex: "0",
|
|
527
513
|
"aria-haspopup": "listbox",
|
|
528
|
-
"aria-expanded": display
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
514
|
+
"aria-expanded": display,
|
|
515
|
+
"aria-owns": id,
|
|
516
|
+
ref: setComboboxElement,
|
|
517
|
+
onClick: handleToggle,
|
|
518
|
+
onKeyUp: handleKeyUp,
|
|
519
|
+
onKeyDown: handleKeyDown,
|
|
520
|
+
$display: display,
|
|
521
|
+
disabled: disabled,
|
|
522
|
+
fullWidth: fullWidth,
|
|
523
|
+
large: large,
|
|
524
|
+
$fill: fill,
|
|
525
|
+
fillReverse: fillReverse,
|
|
526
|
+
onFocus: handleFocus,
|
|
527
|
+
placeholder: placeholder,
|
|
528
|
+
children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
|
|
529
|
+
onClick: () => {
|
|
530
|
+
onSelect('');
|
|
531
|
+
}
|
|
532
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandArrow, {
|
|
533
|
+
"aria-haspopup": "listbox",
|
|
534
|
+
"aria-expanded": display
|
|
535
|
+
})]
|
|
536
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
|
|
537
|
+
role: "listbox",
|
|
538
|
+
tabIndex: "0",
|
|
539
|
+
id: id,
|
|
540
|
+
ref: setListBoxElement,
|
|
541
|
+
onKeyUp: handleKeyUp,
|
|
542
|
+
onKeyDown: handleKeyDown,
|
|
543
|
+
width: listBoxWidth,
|
|
544
|
+
$display: display,
|
|
545
|
+
style: styles.popper,
|
|
546
|
+
...attributes.popper,
|
|
547
|
+
placement: state && state.placement,
|
|
548
|
+
children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
|
|
549
|
+
ref: searchBoxElement,
|
|
550
|
+
placeholder: "Search",
|
|
551
|
+
onChange: handleSearchChange,
|
|
552
|
+
value: search
|
|
553
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Options.default, {
|
|
554
|
+
ref: optionsElementRef,
|
|
555
|
+
allowSearch: allowSearch,
|
|
556
|
+
children: optionItem || /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
|
|
557
|
+
children: "No results found"
|
|
558
|
+
})
|
|
559
|
+
})]
|
|
553
560
|
})]
|
|
554
|
-
})
|
|
561
|
+
})
|
|
555
562
|
});
|
|
556
563
|
};
|
|
557
564
|
const Icon = _ref2 => {
|
|
@@ -570,45 +577,50 @@ const Icon = _ref2 => {
|
|
|
570
577
|
}), "\xA0"]
|
|
571
578
|
});
|
|
572
579
|
};
|
|
573
|
-
const Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n
|
|
580
|
+
const Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--font-on-background);\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\n ", "\n"])), _ref3 => {
|
|
574
581
|
let {
|
|
575
582
|
disabled
|
|
576
583
|
} = _ref3;
|
|
577
584
|
return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
578
585
|
}, _ref4 => {
|
|
579
586
|
let {
|
|
580
|
-
|
|
587
|
+
flexGrow
|
|
581
588
|
} = _ref4;
|
|
582
|
-
return
|
|
589
|
+
return !flexGrow && 'min-width: 160px;';
|
|
583
590
|
}, _ref5 => {
|
|
584
591
|
let {
|
|
585
|
-
|
|
592
|
+
$display
|
|
586
593
|
} = _ref5;
|
|
587
|
-
return
|
|
594
|
+
return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
|
|
588
595
|
}, _ref6 => {
|
|
589
596
|
let {
|
|
590
|
-
|
|
597
|
+
disabled
|
|
591
598
|
} = _ref6;
|
|
592
|
-
return
|
|
599
|
+
return disabled && 'cursor: not-allowed;opacity: 0.5;';
|
|
593
600
|
}, _ref7 => {
|
|
594
601
|
let {
|
|
595
|
-
|
|
602
|
+
placeholder
|
|
596
603
|
} = _ref7;
|
|
597
|
-
return
|
|
604
|
+
return placeholder && 'color: var(--font-on-mute);';
|
|
598
605
|
}, _ref8 => {
|
|
599
606
|
let {
|
|
600
|
-
|
|
607
|
+
fullWidth
|
|
601
608
|
} = _ref8;
|
|
602
|
-
return
|
|
609
|
+
return fullWidth ? 'width: 100%' : 'max-width: 320px';
|
|
603
610
|
}, _ref9 => {
|
|
604
611
|
let {
|
|
605
|
-
|
|
612
|
+
large
|
|
606
613
|
} = _ref9;
|
|
607
|
-
return
|
|
614
|
+
return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
|
|
608
615
|
}, _ref10 => {
|
|
609
616
|
let {
|
|
610
|
-
|
|
617
|
+
$fill
|
|
611
618
|
} = _ref10;
|
|
619
|
+
return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
|
|
620
|
+
}, _ref11 => {
|
|
621
|
+
let {
|
|
622
|
+
fillReverse
|
|
623
|
+
} = _ref11;
|
|
612
624
|
return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
|
|
613
625
|
});
|
|
614
626
|
Combobox.displayName = 'Combobox';
|
package/tooltip/Tooltip.js
CHANGED
|
@@ -91,11 +91,11 @@ const Tooltip = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
91
91
|
})
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
|
-
const TooltipTooltip = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: pre-line;\n
|
|
94
|
+
const TooltipTooltip = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n white-space: pre-line;\n display: ", ";\n border: 1px solid var(--border-color);\n color: var(--font-on-background);\n background: var(--color-background2);\n box-shadow: var(--box-shadow);\n border-radius: calc(var(--border-radius) / 2);\n padding: var(--spacing-xs);\n z-index: 80;\n text-align: left;\n font-size: var(--font-body1);\n font-weight: var(--font-normal);\n line-height: 1.5;\n word-break: break-word;\n max-width: 50vw;\n"])), _ref2 => {
|
|
95
95
|
let {
|
|
96
96
|
$display
|
|
97
97
|
} = _ref2;
|
|
98
|
-
return $display ? '
|
|
98
|
+
return $display ? 'block' : 'none';
|
|
99
99
|
});
|
|
100
100
|
const TooltipArrow = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n display: ", ";\n top: -0.5rem;\n left: 0;\n width: 1rem;\n height: 1rem;\n\n &::before {\n position: absolute;\n display: block;\n content: '';\n border-color: transparent;\n border-style: solid;\n top: 0;\n border-width: 0 0.5rem 0.5rem 0.5rem;\n border-bottom-color: var(--border-color);\n }\n"])), _ref3 => {
|
|
101
101
|
let {
|