@useblu/ocean-react 1.124.0 → 1.125.1
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 +12 -0
- package/CardListItem/CardListItem.d.ts.map +1 -1
- package/Progress/Progress.d.ts +2 -0
- package/Progress/Progress.d.ts.map +1 -1
- package/Progress/img/IconDeterminate.d.ts +8 -0
- package/Progress/img/IconDeterminate.d.ts.map +1 -0
- package/index.es.js +25 -4
- package/index.es.js.map +1 -1
- package/index.js +25 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -377,14 +377,33 @@ var IconLg = function () { return (e.createElement("svg", { width: "32", height:
|
|
|
377
377
|
e.createElement("circle", { opacity: "0.4", cx: "16", cy: "16", r: "14", stroke: "#B8C3FF", strokeWidth: "4" }),
|
|
378
378
|
e.createElement("path", { d: "M16 2C17.8385 2 19.659 2.36212 21.3576 3.06569C23.0561 3.76925 24.5995 4.80049 25.8995 6.10051C27.1995 7.40053 28.2307 8.94388 28.9343 10.6424C29.6379 12.341 30 14.1615 30 16", stroke: "#0025E0", strokeWidth: "4", strokeLinecap: "round", strokeLinejoin: "round" }))); };
|
|
379
379
|
|
|
380
|
+
var SIZE_CONFIG = {
|
|
381
|
+
sm: { size: 16, strokeWidth: 3, radius: 6 },
|
|
382
|
+
md: { size: 24, strokeWidth: 4, radius: 10 },
|
|
383
|
+
lg: { size: 32, strokeWidth: 5, radius: 13 },
|
|
384
|
+
};
|
|
385
|
+
var IconDeterminate = function (_a) {
|
|
386
|
+
var size = _a.size, percentage = _a.percentage;
|
|
387
|
+
var config = SIZE_CONFIG[size];
|
|
388
|
+
var circumference = 2 * Math.PI * config.radius;
|
|
389
|
+
var normalizedPercentage = Math.min(100, Math.max(0, percentage !== null && percentage !== void 0 ? percentage : 0));
|
|
390
|
+
var strokeDashoffset = circumference - (normalizedPercentage / 100) * circumference;
|
|
391
|
+
return (e.createElement("svg", { width: config.size, height: config.size, viewBox: "0 0 ".concat(config.size, " ").concat(config.size), fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "ods-progress__determinate" },
|
|
392
|
+
e.createElement("circle", { className: "ods-progress__track", cx: config.size / 2, cy: config.size / 2, r: config.radius, strokeWidth: config.strokeWidth, fill: "none" }),
|
|
393
|
+
e.createElement("circle", { className: "ods-progress__fill", cx: config.size / 2, cy: config.size / 2, r: config.radius, strokeWidth: config.strokeWidth, fill: "none", strokeLinecap: "round", strokeDasharray: circumference, strokeDashoffset: strokeDashoffset, transform: "rotate(-90 ".concat(config.size / 2, " ").concat(config.size / 2, ")") })));
|
|
394
|
+
};
|
|
395
|
+
|
|
380
396
|
var Progress = e.forwardRef(function (_a, ref) {
|
|
381
|
-
var _b = _a.onColor, onColor = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, className = _a.className, rest = __rest$1(_a, ["onColor", "size", "className"]);
|
|
397
|
+
var _b = _a.onColor, onColor = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? 'md' : _c, percentage = _a.percentage, className = _a.className, rest = __rest$1(_a, ["onColor", "size", "percentage", "className"]);
|
|
398
|
+
var isIndeterminate = typeof percentage === 'undefined';
|
|
382
399
|
return (e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-progress', "ods-progress--".concat(size), className, {
|
|
383
400
|
'ods-progress--on-color': onColor,
|
|
384
|
-
|
|
401
|
+
'ods-progress--indeterminate': isIndeterminate,
|
|
402
|
+
'ods-progress--determinate': !isIndeterminate,
|
|
403
|
+
}), role: "progressbar", "aria-valuenow": isIndeterminate ? undefined : percentage, "aria-valuemin": isIndeterminate ? undefined : 0, "aria-valuemax": isIndeterminate ? undefined : 100 }, rest), isIndeterminate ? (e.createElement(e.Fragment, null,
|
|
385
404
|
size === 'sm' && e.createElement(IconSm, null),
|
|
386
405
|
size === 'md' && e.createElement(IconMd, null),
|
|
387
|
-
size === 'lg' && e.createElement(IconLg, null)));
|
|
406
|
+
size === 'lg' && e.createElement(IconLg, null))) : (e.createElement(IconDeterminate, { size: size, percentage: percentage }))));
|
|
388
407
|
});
|
|
389
408
|
Progress.displayName = 'Progress';
|
|
390
409
|
|
|
@@ -47022,7 +47041,9 @@ var Shortcut = function (_a) {
|
|
|
47022
47041
|
|
|
47023
47042
|
var CardListItem = e.forwardRef(function (_a, ref) {
|
|
47024
47043
|
var title = _a.title, description = _a.description, caption = _a.caption, leadingIcon = _a.leadingIcon, actionIcon = _a.actionIcon, _b = _a.size, size = _b === void 0 ? 'medium' : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.fullWidth, fullWidth = _d === void 0 ? false : _d, onClick = _a.onClick, loading = _a.loading, tag = _a.tag, rest = __rest$1(_a, ["title", "description", "caption", "leadingIcon", "actionIcon", "size", "disabled", "fullWidth", "onClick", "loading", "tag"]);
|
|
47025
|
-
var tagElement = typeof tag === 'string' ? (e.createElement(Tag,
|
|
47044
|
+
var tagElement = typeof tag === 'string' ? (e.createElement(Tag, __assign$1({}, (disabled
|
|
47045
|
+
? { variant: 'default', type: 'neutral' }
|
|
47046
|
+
: { variant: 'highlight', type: 'important' })), tag)) : (e.createElement(Tag, __assign$1({}, tag)));
|
|
47026
47047
|
if (loading) {
|
|
47027
47048
|
return (e.createElement("div", __assign$1({ ref: ref }, rest, { "data-testid": "card-list-item", className: classNames('ods-card-list-item', "ods-card-list-item--size-".concat(size), { 'ods-card-list-item--full-width': fullWidth }, {
|
|
47028
47049
|
'ods-card-list-item--loading': loading,
|