@useblu/ocean-react 1.70.1 → 1.73.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/index.js CHANGED
@@ -6675,6 +6675,74 @@ 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, disabled = _a.disabled, className = _a.className, rest = __rest$2(_a, ["title", "description", "caption", "tagLabel", "infoText", "infoTextType", "withAction", "onActionClick", "checkbox", "radio", "disabled", "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: classNames('ods-text-list-item__default-content', {
6706
+ 'ods-text-list-item__default-content--disabled': disabled
6707
+ }) },
6708
+ e__default["default"].createElement("p", { className: "ods-typography ods-typography__paragraph" },
6709
+ title,
6710
+ tagLabel && (e__default["default"].createElement(Tag, { type: "neutral", size: "medium" }, tagLabel))),
6711
+ e__default["default"].createElement("p", { className: "ods-typography ods-typography__description" }, description),
6712
+ caption && (e__default["default"].createElement("p", { className: "ods-typography ods-typography__captionbold" }, caption))),
6713
+ 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)),
6714
+ withAction && e__default["default"].createElement(re, null))); }, [
6715
+ title,
6716
+ description,
6717
+ caption,
6718
+ tagLabel,
6719
+ infoText,
6720
+ infoTextType,
6721
+ withAction,
6722
+ checkbox,
6723
+ radio,
6724
+ className,
6725
+ isWide,
6726
+ ref,
6727
+ rest,
6728
+ disabled,
6729
+ ]);
6730
+ if (checkbox) {
6731
+ return (e__default["default"].createElement("div", { className: classNames('ods-text-list-item-selectable', {
6732
+ 'ods-text-list-item-selectable--disabled': disabled
6733
+ }), ref: divElementRef },
6734
+ e__default["default"].createElement(Checkbox, __assign$2({ disabled: disabled }, checkbox, { label: textListitem }))));
6735
+ }
6736
+ if (radio) {
6737
+ return (e__default["default"].createElement("div", { className: classNames('ods-text-list-item-selectable', {
6738
+ 'ods-text-list-item-selectable--disabled': disabled
6739
+ }), ref: divElementRef },
6740
+ e__default["default"].createElement(Radio, __assign$2({ disabled: disabled }, radio, { label: textListitem }))));
6741
+ }
6742
+ return (e__default["default"].createElement("button", { ref: buttonElementRef, onClick: onActionClick, type: "button", className: "ods-text-list-item--button" }, textListitem));
6743
+ });
6744
+ TextListItem.displayName = 'TextListItem';
6745
+
6678
6746
  var Context = e__default["default"].createContext({});
6679
6747
 
6680
6748
  var Option = e__default["default"].memo(function (option) {
@@ -48351,6 +48419,7 @@ exports.SubHeader = SubHeader;
48351
48419
  exports.Switch = Switch;
48352
48420
  exports.Tag = Tag;
48353
48421
  exports.TextArea = TextArea;
48422
+ exports.TextListItem = TextListItem;
48354
48423
  exports.TokenInput = TokenInput;
48355
48424
  exports.TopBar = TopBar;
48356
48425
  exports.TransactionListItem = TransactionListItem;