@useblu/ocean-react 1.115.0 → 1.116.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/CardListAction/CardListAction.d.ts.map +1 -1
- package/ListSelectable/ListSelectable.d.ts +24 -0
- package/ListSelectable/ListSelectable.d.ts.map +1 -0
- package/ListSelectable/index.d.ts +2 -0
- package/ListSelectable/index.d.ts.map +1 -0
- package/Radio/Radio.d.ts +2 -0
- package/Radio/Radio.d.ts.map +1 -1
- package/SettingsListItem/SettingsListItem.d.ts.map +1 -1
- package/_shared/components/ContentList/ContentList.d.ts.map +1 -1
- package/_shared/components/InternalListActions/InternalListActions.d.ts.map +1 -1
- package/_shared/components/InternalListActions/components/DragHandle.d.ts.map +1 -1
- package/_shared/components/InternalListActions/components/MenuList.d.ts.map +1 -1
- package/_shared/components/InternalListActions/components/TriggerButton.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.es.js +90 -46
- package/index.es.js.map +1 -1
- package/index.js +90 -45
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -5346,10 +5346,12 @@ var Checkbox = e.forwardRef(function (_a, ref) {
|
|
|
5346
5346
|
Checkbox.displayName = 'Checkbox';
|
|
5347
5347
|
|
|
5348
5348
|
var Radio = e.forwardRef(function (_a, ref) {
|
|
5349
|
-
var className = _a.className, label = _a.label, id = _a.id, rest = __rest$1(_a, ["className", "label", "id"]);
|
|
5349
|
+
var className = _a.className, label = _a.label, id = _a.id, error = _a.error, rest = __rest$1(_a, ["className", "label", "id", "error"]);
|
|
5350
5350
|
return (e.createElement("label", { className: "ods-radio__root", htmlFor: id },
|
|
5351
5351
|
e.createElement("input", __assign$1({ ref: ref, id: id, className: classNames('ods-radio', className) }, rest, { type: "radio" })),
|
|
5352
|
-
e.createElement("span", { className:
|
|
5352
|
+
e.createElement("span", { className: classNames('ods-radio__checkmark', {
|
|
5353
|
+
'ods-radio__checkmark--error': error,
|
|
5354
|
+
}) }),
|
|
5353
5355
|
label && (e.createElement("span", { className: "ods-typography ods-typography__description ods-radio__label" }, label))));
|
|
5354
5356
|
});
|
|
5355
5357
|
Radio.displayName = 'Radio';
|
|
@@ -5366,6 +5368,79 @@ var TextArea = e.forwardRef(function (_a, ref) {
|
|
|
5366
5368
|
});
|
|
5367
5369
|
TextArea.displayName = 'TextArea';
|
|
5368
5370
|
|
|
5371
|
+
var ContentList = function (_a) {
|
|
5372
|
+
var _b, _c, _d;
|
|
5373
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _e = _a.inverted, inverted = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? 'default' : _f;
|
|
5374
|
+
return (e.createElement("div", { className: "ods-content-list" },
|
|
5375
|
+
e.createElement("p", { className: classNames('ods-typography', (_b = {
|
|
5376
|
+
'ods-typography__paragraph': !inverted,
|
|
5377
|
+
'ods-typography__description': inverted
|
|
5378
|
+
},
|
|
5379
|
+
_b["ods-typography__paragraph--".concat(type)] = type && (!inverted || type === 'inactive'),
|
|
5380
|
+
_b)) },
|
|
5381
|
+
strikethroughDescription && type === 'strikethrough' && !inverted && (e.createElement("span", { className: "ods-typography__paragraph--strikethrough-text" }, strikethroughDescription)),
|
|
5382
|
+
title),
|
|
5383
|
+
description && (e.createElement("p", { className: classNames("ods-typography", (_c = {
|
|
5384
|
+
'ods-typography__description': !inverted,
|
|
5385
|
+
'ods-typography__paragraph': inverted
|
|
5386
|
+
},
|
|
5387
|
+
_c["ods-typography__paragraph--".concat(type)] = type && (inverted || type === 'inactive'),
|
|
5388
|
+
_c)) },
|
|
5389
|
+
strikethroughDescription && type === 'strikethrough' && inverted && (e.createElement("span", { className: "ods-typography__paragraph--strikethrough-text" }, strikethroughDescription)),
|
|
5390
|
+
description)),
|
|
5391
|
+
caption && (e.createElement("p", { className: classNames("ods-typography ods-typography__captionbold", (_d = {},
|
|
5392
|
+
_d["ods-typography__paragraph--".concat(type)] = type && type === 'inactive',
|
|
5393
|
+
_d)) }, caption))));
|
|
5394
|
+
};
|
|
5395
|
+
|
|
5396
|
+
var SkeletonBar = function (_a) {
|
|
5397
|
+
var width = _a.width, height = _a.height, props = __rest$1(_a, ["width", "height"]);
|
|
5398
|
+
return (e.createElement("div", __assign$1({ className: "ods-skeleton-bar", style: { width: width, height: height } }, props)));
|
|
5399
|
+
};
|
|
5400
|
+
|
|
5401
|
+
var ListSelectable = e.forwardRef(function (_a, ref) {
|
|
5402
|
+
var _b, _c;
|
|
5403
|
+
var title = _a.title, description = _a.description, caption = _a.caption, strikethroughDescription = _a.strikethroughDescription, inverted = _a.inverted, loading = _a.loading, disabled = _a.disabled, checkbox = _a.checkbox, radio = _a.radio, className = _a.className, showDivider = _a.showDivider, indicator = _a.indicator, _d = _a.status, status = _d === void 0 ? 'default' : _d, _e = _a.type, type = _e === void 0 ? 'card' : _e, _f = _a.platform, platform = _f === void 0 ? 'web' : _f, rest = __rest$1(_a, ["title", "description", "caption", "strikethroughDescription", "inverted", "loading", "disabled", "checkbox", "radio", "className", "showDivider", "indicator", "status", "type", "platform"]);
|
|
5404
|
+
var hasError = e.useMemo(function () { return (radio === null || radio === void 0 ? void 0 : radio.error) || (checkbox === null || checkbox === void 0 ? void 0 : checkbox.error); }, [radio === null || radio === void 0 ? void 0 : radio.error, checkbox === null || checkbox === void 0 ? void 0 : checkbox.error]);
|
|
5405
|
+
var isInputDisabled = e.useMemo(function () { return (radio === null || radio === void 0 ? void 0 : radio.disabled) || (checkbox === null || checkbox === void 0 ? void 0 : checkbox.disabled) || disabled; }, [radio === null || radio === void 0 ? void 0 : radio.disabled, checkbox === null || checkbox === void 0 ? void 0 : checkbox.disabled, disabled]);
|
|
5406
|
+
var internalList = e.useMemo(function () {
|
|
5407
|
+
var _a;
|
|
5408
|
+
return (e.createElement(e.Fragment, null,
|
|
5409
|
+
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: disabled ? 'inactive' : status }),
|
|
5410
|
+
indicator && (e.createElement("div", { className: classNames('ods-list-selectable__indicator', (_a = {},
|
|
5411
|
+
_a["ods-list-selectable__indicator--".concat(platform)] = platform,
|
|
5412
|
+
_a)) }, indicator))));
|
|
5413
|
+
}, [
|
|
5414
|
+
title,
|
|
5415
|
+
description,
|
|
5416
|
+
caption,
|
|
5417
|
+
strikethroughDescription,
|
|
5418
|
+
inverted,
|
|
5419
|
+
status,
|
|
5420
|
+
indicator,
|
|
5421
|
+
disabled,
|
|
5422
|
+
platform,
|
|
5423
|
+
]);
|
|
5424
|
+
if (loading) {
|
|
5425
|
+
return (e.createElement("div", { className: "ods-list-selectable--loading" },
|
|
5426
|
+
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
5427
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" })));
|
|
5428
|
+
}
|
|
5429
|
+
return (e.createElement("div", { className: classNames('ods-list-selectable__root', (_b = {},
|
|
5430
|
+
_b["ods-list-selectable__root--".concat(type)] = type,
|
|
5431
|
+
_b["ods-list-selectable__root--".concat(type, "--error")] = hasError,
|
|
5432
|
+
_b)) },
|
|
5433
|
+
e.createElement("div", __assign$1({ className: classNames('ods-list-selectable', className, (_c = {
|
|
5434
|
+
'ods-list-selectable--disabled': isInputDisabled
|
|
5435
|
+
},
|
|
5436
|
+
_c["ods-list-selectable--".concat(platform)] = platform,
|
|
5437
|
+
_c)), ref: ref }, rest),
|
|
5438
|
+
checkbox && e.createElement(Checkbox, __assign$1({}, checkbox, { label: internalList })),
|
|
5439
|
+
radio && e.createElement(Radio, __assign$1({}, radio, { label: internalList }))),
|
|
5440
|
+
showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-selectable__root--text--divider" }))));
|
|
5441
|
+
});
|
|
5442
|
+
ListSelectable.displayName = 'ListSelectable';
|
|
5443
|
+
|
|
5369
5444
|
var TextListItem = e.forwardRef(function (_a, ref) {
|
|
5370
5445
|
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$1(_a, ["title", "description", "caption", "tagLabel", "infoText", "infoTextType", "withAction", "onActionClick", "checkbox", "radio", "disabled", "className"]);
|
|
5371
5446
|
var buttonElementRef = e.useRef(null);
|
|
@@ -47105,36 +47180,6 @@ var WebNotification = e.forwardRef(function (_a, ref) {
|
|
|
47105
47180
|
});
|
|
47106
47181
|
WebNotification.displayName = 'WebNotification';
|
|
47107
47182
|
|
|
47108
|
-
var ContentList = function (_a) {
|
|
47109
|
-
var _b, _c, _d;
|
|
47110
|
-
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _e = _a.inverted, inverted = _e === void 0 ? false : _e, _f = _a.type, type = _f === void 0 ? 'default' : _f;
|
|
47111
|
-
return (e.createElement("div", { className: "ods-content-list" },
|
|
47112
|
-
e.createElement("p", { className: classNames('ods-typography', (_b = {
|
|
47113
|
-
'ods-typography__paragraph': !inverted,
|
|
47114
|
-
'ods-typography__description': inverted
|
|
47115
|
-
},
|
|
47116
|
-
_b["ods-typography__paragraph--".concat(type)] = type && (!inverted || type === 'inactive'),
|
|
47117
|
-
_b)) },
|
|
47118
|
-
strikethroughDescription && type === 'strikethrough' && !inverted && (e.createElement("span", { className: "ods-typography__paragraph--strikethrough-text" }, strikethroughDescription)),
|
|
47119
|
-
title),
|
|
47120
|
-
description && (e.createElement("p", { className: classNames("ods-typography", (_c = {
|
|
47121
|
-
'ods-typography__description': !inverted,
|
|
47122
|
-
'ods-typography__paragraph': inverted
|
|
47123
|
-
},
|
|
47124
|
-
_c["ods-typography__paragraph--".concat(type)] = type && (inverted || type === 'inactive'),
|
|
47125
|
-
_c)) },
|
|
47126
|
-
strikethroughDescription && type === 'strikethrough' && inverted && (e.createElement("span", { className: "ods-typography__paragraph--strikethrough-text" }, strikethroughDescription)),
|
|
47127
|
-
description)),
|
|
47128
|
-
caption && (e.createElement("p", { className: classNames("ods-typography ods-typography__captionbold", (_d = {},
|
|
47129
|
-
_d["ods-typography__paragraph--".concat(type)] = type && type === 'inactive',
|
|
47130
|
-
_d)) }, caption))));
|
|
47131
|
-
};
|
|
47132
|
-
|
|
47133
|
-
var SkeletonBar = function (_a) {
|
|
47134
|
-
var width = _a.width, height = _a.height, props = __rest$1(_a, ["width", "height"]);
|
|
47135
|
-
return (e.createElement("div", __assign$1({ className: "ods-skeleton-bar", style: { width: width, height: height } }, props)));
|
|
47136
|
-
};
|
|
47137
|
-
|
|
47138
47183
|
var SettingsListItem = function (_a) {
|
|
47139
47184
|
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, errorMessage = _a.errorMessage, button = _a.button, tag = _a.tag, disabled = _a.disabled, _b = _a.type, type = _b === void 0 ? 'default' : _b, _c = _a.loading, loading = _c === void 0 ? false : _c, _d = _a.showDivider, showDivider = _d === void 0 ? true : _d, _e = _a.blocked, blocked = _e === void 0 ? false : _e, _f = _a.state, state = _f === void 0 ? 'default' : _f;
|
|
47140
47185
|
return (e.createElement("div", { className: classNames('ods-settings-list-item', {
|
|
@@ -47330,7 +47375,7 @@ var MenuList = function (_a) {
|
|
|
47330
47375
|
var menuContent = (e.createElement("ul", { ref: menuRef, className: classNames('ods-internal-list-actions__menu', "ods-internal-list-actions__menu--".concat(position), {
|
|
47331
47376
|
'ods-internal-list-actions__menu--closing': isClosing,
|
|
47332
47377
|
'ods-internal-list-actions__menu--portal': !isSwipeMode,
|
|
47333
|
-
}), style: isSwipeMode ? undefined : menuStyle, role: "menu", "aria-orientation": isSwipeMode ?
|
|
47378
|
+
}), style: isSwipeMode ? undefined : menuStyle, role: "menu", "aria-orientation": isSwipeMode ? 'horizontal' : 'vertical', tabIndex: -1, onClick: handleMenuClick, onKeyDown: handleMenuKeyDown },
|
|
47334
47379
|
isSwipeMode && (e.createElement(DragHandle, { onClose: onClose, onKeyDown: onDragHandleKeyDown })),
|
|
47335
47380
|
actions.map(function (action) { return (e.createElement(MenuItem, { key: action.label, action: action, onClick: onActionClick })); })));
|
|
47336
47381
|
if (isSwipeMode || typeof document === 'undefined') {
|
|
@@ -47385,8 +47430,7 @@ var InternalListActions = e.forwardRef(function (_a, forwardedRef) {
|
|
|
47385
47430
|
forwardedRef(wrapperRef.current);
|
|
47386
47431
|
}
|
|
47387
47432
|
else {
|
|
47388
|
-
forwardedRef.current =
|
|
47389
|
-
wrapperRef.current;
|
|
47433
|
+
forwardedRef.current = wrapperRef.current;
|
|
47390
47434
|
}
|
|
47391
47435
|
}
|
|
47392
47436
|
}, [forwardedRef]);
|
|
@@ -47427,7 +47471,7 @@ var CardListAction = e.forwardRef(function (_a, ref) {
|
|
|
47427
47471
|
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _b = _a.inverted, inverted = _b === void 0 ? false : _b, _c = _a.type, type = _c === void 0 ? 'default' : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.loading, loading = _e === void 0 ? false : _e, icon = _a.icon, indicator = _a.indicator, _f = _a.actionType, actionType = _f === void 0 ? 'chevron' : _f, menuActions = _a.menuActions, _g = _a.menuPosition, menuPosition = _g === void 0 ? 'bottom-right' : _g, onClick = _a.onClick, className = _a.className, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "disabled", "loading", "icon", "indicator", "actionType", "menuActions", "menuPosition", "onClick", "className"]);
|
|
47428
47472
|
var renderActionIcon = function () {
|
|
47429
47473
|
if (actionType === 'chevron') {
|
|
47430
|
-
return (e.createElement("div", { className:
|
|
47474
|
+
return (e.createElement("div", { className: "ods-card-list-action__action" },
|
|
47431
47475
|
e.createElement(re, { size: 20 })));
|
|
47432
47476
|
}
|
|
47433
47477
|
if (actionType === 'menu' || actionType === 'swipe') {
|
|
@@ -47436,21 +47480,21 @@ var CardListAction = e.forwardRef(function (_a, ref) {
|
|
|
47436
47480
|
return null;
|
|
47437
47481
|
};
|
|
47438
47482
|
if (loading) {
|
|
47439
|
-
return (e.createElement("button", __assign$1({ ref: ref, type:
|
|
47440
|
-
e.createElement("div", { className:
|
|
47441
|
-
e.createElement(SkeletonBar, { width:
|
|
47442
|
-
e.createElement(SkeletonBar, { width:
|
|
47483
|
+
return (e.createElement("button", __assign$1({ ref: ref, type: "button", "data-testid": "card-list-action", className: classNames('ods-card-list-action', 'ods-card-list-action--loading', className) }, rest),
|
|
47484
|
+
e.createElement("div", { className: "ods-card-list-action__skeleton" },
|
|
47485
|
+
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
47486
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }))));
|
|
47443
47487
|
}
|
|
47444
|
-
return (e.createElement("button", __assign$1({ ref: ref, type:
|
|
47488
|
+
return (e.createElement("button", __assign$1({ ref: ref, type: "button", "data-testid": "card-list-action", className: classNames('ods-card-list-action', className, {
|
|
47445
47489
|
'ods-card-list-action--disabled': disabled,
|
|
47446
47490
|
'ods-card-list-action--swipe-mode': actionType === 'swipe',
|
|
47447
47491
|
}), onClick: onClick, disabled: disabled }, rest),
|
|
47448
|
-
icon && e.createElement("div", { className: classNames('ods-card-list-action__icon', {
|
|
47492
|
+
icon && (e.createElement("div", { className: classNames('ods-card-list-action__icon', {
|
|
47449
47493
|
'ods-card-list-action__icon--inactive': type === 'inactive',
|
|
47450
|
-
}) }, icon),
|
|
47494
|
+
}) }, icon)),
|
|
47451
47495
|
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: type }),
|
|
47452
|
-
e.createElement("div", { className:
|
|
47453
|
-
indicator && (e.createElement("div", { className:
|
|
47496
|
+
e.createElement("div", { className: "ods-card-list-action__trailing" },
|
|
47497
|
+
indicator && (e.createElement("div", { className: "ods-card-list-action__indicator" }, indicator)),
|
|
47454
47498
|
renderActionIcon())));
|
|
47455
47499
|
});
|
|
47456
47500
|
CardListAction.displayName = 'CardListAction';
|
|
@@ -47480,6 +47524,7 @@ exports.IconButton = IconButton;
|
|
|
47480
47524
|
exports.Input = Input;
|
|
47481
47525
|
exports.Link = Link;
|
|
47482
47526
|
exports.List = List;
|
|
47527
|
+
exports.ListSelectable = ListSelectable;
|
|
47483
47528
|
exports.Modal = Modal;
|
|
47484
47529
|
exports.Progress = Progress;
|
|
47485
47530
|
exports.Radio = Radio;
|