@useblu/ocean-react 1.70.1 → 1.71.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.
- package/CHANGELOG.md +6 -0
- package/TextListItem/TextListItem.d.ts +31 -0
- package/TextListItem/TextListItem.d.ts.map +1 -0
- package/TextListItem/index.d.ts +2 -0
- package/TextListItem/index.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.es.js +63 -2
- package/index.es.js.map +1 -1
- package/index.js +62 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -6675,6 +6675,67 @@ var TextArea = e__default["default"].forwardRef(function (_a, ref) {
|
|
|
6675
6675
|
});
|
|
6676
6676
|
TextArea.displayName = 'TextArea';
|
|
6677
6677
|
|
|
6678
|
+
var TextListItem = e__default["default"].forwardRef(function (_a, ref) {
|
|
6679
|
+
var title = _a.title, description = _a.description, caption = _a.caption, tagLabel = _a.tagLabel, infoText = _a.infoText, _b = _a.infoTextType, infoTextType = _b === void 0 ? 'neutral' : _b, withAction = _a.withAction, onActionClick = _a.onActionClick, checkbox = _a.checkbox, radio = _a.radio, className = _a.className, rest = __rest$2(_a, ["title", "description", "caption", "tagLabel", "infoText", "infoTextType", "withAction", "onActionClick", "checkbox", "radio", "className"]);
|
|
6680
|
+
var buttonElementRef = e.useRef(null);
|
|
6681
|
+
var divElementRef = e.useRef(null);
|
|
6682
|
+
var _c = e.useState(false), isWide = _c[0], setIsWide = _c[1];
|
|
6683
|
+
e.useEffect(function () {
|
|
6684
|
+
var updateWidth = function () {
|
|
6685
|
+
if (buttonElementRef.current) {
|
|
6686
|
+
var width = buttonElementRef.current.offsetWidth;
|
|
6687
|
+
setIsWide(width >= 992);
|
|
6688
|
+
}
|
|
6689
|
+
if (divElementRef.current) {
|
|
6690
|
+
var width = divElementRef.current.offsetWidth;
|
|
6691
|
+
setIsWide(width >= 992);
|
|
6692
|
+
}
|
|
6693
|
+
};
|
|
6694
|
+
updateWidth();
|
|
6695
|
+
window.addEventListener('resize', updateWidth);
|
|
6696
|
+
return function () {
|
|
6697
|
+
window.removeEventListener('resize', updateWidth);
|
|
6698
|
+
};
|
|
6699
|
+
}, []);
|
|
6700
|
+
var textListitem = e.useMemo(function () { return (e__default["default"].createElement("div", __assign$2({ className: classNames('ods-text-list-item', className, {
|
|
6701
|
+
'ods-text-list-item--with-action': withAction,
|
|
6702
|
+
'ods-text-list-item--wide': isWide,
|
|
6703
|
+
'ods-text-list-item--selectable': checkbox || radio
|
|
6704
|
+
}), ref: ref }, rest),
|
|
6705
|
+
e__default["default"].createElement("div", { className: "ods-text-list-item__default-content" },
|
|
6706
|
+
e__default["default"].createElement("p", { className: "ods-typography ods-typography__paragraph" },
|
|
6707
|
+
title,
|
|
6708
|
+
tagLabel && (e__default["default"].createElement(Tag, { type: "neutral", size: "medium" }, tagLabel))),
|
|
6709
|
+
e__default["default"].createElement("p", { className: "ods-typography ods-typography__description" }, description),
|
|
6710
|
+
caption && (e__default["default"].createElement("p", { className: "ods-typography ods-typography__captionbold" }, caption))),
|
|
6711
|
+
infoText && (e__default["default"].createElement("p", { className: classNames('ods-typography ods-typography__description', 'ods-text-list-item__info-text', "ods-text-list-item__info-text--".concat(infoTextType)) }, infoText)),
|
|
6712
|
+
withAction && e__default["default"].createElement(re, null))); }, [
|
|
6713
|
+
title,
|
|
6714
|
+
description,
|
|
6715
|
+
caption,
|
|
6716
|
+
tagLabel,
|
|
6717
|
+
infoText,
|
|
6718
|
+
infoTextType,
|
|
6719
|
+
withAction,
|
|
6720
|
+
checkbox,
|
|
6721
|
+
radio,
|
|
6722
|
+
className,
|
|
6723
|
+
isWide,
|
|
6724
|
+
ref,
|
|
6725
|
+
rest,
|
|
6726
|
+
]);
|
|
6727
|
+
if (checkbox) {
|
|
6728
|
+
return (e__default["default"].createElement("div", { className: "ods-text-list-item-selectable", ref: divElementRef },
|
|
6729
|
+
e__default["default"].createElement(Checkbox, __assign$2({}, checkbox, { label: textListitem }))));
|
|
6730
|
+
}
|
|
6731
|
+
if (radio) {
|
|
6732
|
+
return (e__default["default"].createElement("div", { className: "ods-text-list-item-selectable", ref: divElementRef },
|
|
6733
|
+
e__default["default"].createElement(Radio, __assign$2({}, radio, { label: textListitem }))));
|
|
6734
|
+
}
|
|
6735
|
+
return (e__default["default"].createElement("button", { ref: buttonElementRef, onClick: onActionClick, type: "button", className: "ods-text-list-item--button" }, textListitem));
|
|
6736
|
+
});
|
|
6737
|
+
TextListItem.displayName = 'TextListItem';
|
|
6738
|
+
|
|
6678
6739
|
var Context = e__default["default"].createContext({});
|
|
6679
6740
|
|
|
6680
6741
|
var Option = e__default["default"].memo(function (option) {
|
|
@@ -48351,6 +48412,7 @@ exports.SubHeader = SubHeader;
|
|
|
48351
48412
|
exports.Switch = Switch;
|
|
48352
48413
|
exports.Tag = Tag;
|
|
48353
48414
|
exports.TextArea = TextArea;
|
|
48415
|
+
exports.TextListItem = TextListItem;
|
|
48354
48416
|
exports.TokenInput = TokenInput;
|
|
48355
48417
|
exports.TopBar = TopBar;
|
|
48356
48418
|
exports.TransactionListItem = TransactionListItem;
|