@homecode/ui 5.18.10 → 5.18.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.
|
@@ -7,7 +7,7 @@ import { Icon } from '../Icon/Icon.js';
|
|
|
7
7
|
|
|
8
8
|
function Chip({ children, className, selected, onRemove, onClick, removeTooltip, size = 'm', }) {
|
|
9
9
|
const closeIcon = jsx(Icon, { type: "close", size: size });
|
|
10
|
-
return (jsxs("div", { className: cn(S.chip, S[`size_${size}`],
|
|
10
|
+
return (jsxs("div", { className: cn(S.chip, S[`size_${size}`], onClick && S.clickable, selected && S.selected, className), onClick: onClick, children: [jsx("span", { className: S.content, children: children }), onRemove && (jsx(Button, { round: true, square: true, variant: "clear", size: size, className: S.remove, onClick: e => {
|
|
11
11
|
e.stopPropagation();
|
|
12
12
|
onRemove();
|
|
13
13
|
}, children: removeTooltip ? (jsx(Tooltip, { content: removeTooltip, children: closeIcon })) : (closeIcon) }))] }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var css_248z = ".Chip_chip__DXD0C{align-items:center;background:var(--accent-color-alpha-100);
|
|
2
|
-
var S = {"chip":"Chip_chip__DXD0C","remove":"Chip_remove__vqyOL","size_xs":"Chip_size_xs__IbN1f","size_s":"Chip_size_s__ERE3z","size_m":"Chip_size_m__F2Bbw","size_l":"Chip_size_l__YgtcF","size_xl":"Chip_size_xl__-sKg7","selected":"Chip_selected__UcBat","content":"Chip_content__2xloA"};
|
|
1
|
+
var css_248z = ".Chip_chip__DXD0C{align-items:center;background:var(--accent-color-alpha-100);border-radius:var(--chip-h);box-sizing:border-box;display:inline-flex;gap:2px;height:var(--chip-h);transition:background .2s ease;white-space:nowrap}.Chip_chip__DXD0C:not(:has(.Chip_remove__vqyOL)){padding-right:var(--chip-pad)}.Chip_clickable__uJZcG{cursor:pointer}.Chip_clickable__uJZcG:hover{background:var(--accent-color-alpha-200)}.Chip_size_xs__IbN1f{--chip-h:24px;--chip-pad:var(--p-2);font-size:14px;padding-left:var(--chip-pad)}.Chip_size_s__ERE3z{--chip-h:32px;--chip-pad:var(--p-4);font-size:18px;padding-left:var(--chip-pad)}.Chip_size_m__F2Bbw{--chip-h:40px;--chip-pad:var(--p-5);font-size:22px;padding-left:var(--chip-pad)}.Chip_size_l__YgtcF{--chip-h:48px;--chip-pad:var(--p-8)}.Chip_size_l__YgtcF,.Chip_size_xl__-sKg7{font-size:26px;padding-left:var(--chip-pad)}.Chip_size_xl__-sKg7{--chip-h:56px;--chip-pad:var(--p-10)}.Chip_chip__DXD0C.Chip_selected__UcBat,.Chip_chip__DXD0C.Chip_selected__UcBat:hover{background:var(--accent-color-alpha-300)}.Chip_content__2xloA{align-items:center;display:flex}.Chip_chip__DXD0C .Chip_remove__vqyOL{align-items:center;box-sizing:border-box;display:flex;flex:none;height:var(--chip-h);justify-content:center;max-height:var(--chip-h);min-height:var(--chip-h);min-width:var(--chip-h);opacity:.3;padding:0;transform:scale(.6);transition:opacity .2s ease,transform .1s ease;width:var(--chip-h)}.Chip_chip__DXD0C .Chip_remove__vqyOL:hover{background-color:var(--danger-color-alpha-300);transform:scale(.8)}.Chip_chip__DXD0C .Chip_remove__vqyOL svg{transform:scale(.8)}.Chip_chip__DXD0C:hover .Chip_remove__vqyOL{opacity:1}";
|
|
2
|
+
var S = {"chip":"Chip_chip__DXD0C","remove":"Chip_remove__vqyOL","clickable":"Chip_clickable__uJZcG","size_xs":"Chip_size_xs__IbN1f","size_s":"Chip_size_s__ERE3z","size_m":"Chip_size_m__F2Bbw","size_l":"Chip_size_l__YgtcF","size_xl":"Chip_size_xl__-sKg7","selected":"Chip_selected__UcBat","content":"Chip_content__2xloA"};
|
|
3
3
|
if (typeof document !== 'undefined') {
|
|
4
4
|
var __uilibHead = document.head || document.getElementsByTagName('head')[0];
|
|
5
5
|
if (__uilibHead) {
|
|
@@ -241,7 +241,7 @@ function Select2(props) {
|
|
|
241
241
|
const label = getLabel(id);
|
|
242
242
|
if (!label)
|
|
243
243
|
return null;
|
|
244
|
-
return (jsx(Chip, { className: cn(S.chip, selectedChipIds?.includes(id) && selectedChipClassName, optionsById.items[id]?.chipClassName), size: size, selected: selectedChipIds?.includes(id), onRemove: () => onItemToggle(id), onClick: () => onChipClick
|
|
244
|
+
return (jsx(Chip, { className: cn(S.chip, selectedChipIds?.includes(id) && selectedChipClassName, optionsById.items[id]?.chipClassName), size: size, selected: selectedChipIds?.includes(id), onRemove: () => onItemToggle(id), onClick: onChipClick && (() => onChipClick(id)), removeTooltip: selectedChipRemoveTooltip, children: label }, id));
|
|
245
245
|
});
|
|
246
246
|
const renderTriggerInput = () => {
|
|
247
247
|
const inputValue = isSearching ? searchVal : isMultiple$1 ? '' : selectedLabel;
|