@mmb-digital/ds-lilly 0.4.3 → 0.5.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/dist/.DS_Store +0 -0
- package/dist/ds-lilly.css +1 -1
- package/dist/ds-lilly.css.map +1 -0
- package/dist/ds-lilly.d.ts +2498 -0
- package/dist/ds-lilly.js +21 -21
- package/dist/ds-lilly.js.map +1 -0
- package/dist/types/src/components/Components/Badge/Badge.d.ts +4 -2
- package/dist/types/src/components/Components/Pills/Pills.d.ts +6 -0
- package/dist/types/src/components/Navigation/Tabs/_elements_/TabListItem.d.ts +3 -1
- package/package.json +1 -1
package/dist/ds-lilly.js
CHANGED
|
@@ -84446,11 +84446,11 @@ Select2Context.displayName = 'Select2Context';
|
|
|
84446
84446
|
|
|
84447
84447
|
// CONCATENATED MODULE: ./src/contexts/TabsContext.tsx
|
|
84448
84448
|
|
|
84449
|
-
|
|
84449
|
+
|
|
84450
84450
|
var TabsContext = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["createContext"])({
|
|
84451
84451
|
activeItem: 0,
|
|
84452
84452
|
identification: '',
|
|
84453
|
-
setActiveItem:
|
|
84453
|
+
setActiveItem: noop,
|
|
84454
84454
|
tabsLimit: 0,
|
|
84455
84455
|
tabs: []
|
|
84456
84456
|
});
|
|
@@ -87142,10 +87142,10 @@ var Avatar = function (_a) {
|
|
|
87142
87142
|
|
|
87143
87143
|
|
|
87144
87144
|
var Badge = function (_a) {
|
|
87145
|
-
var ariaLabel = _a.ariaLabel, children = _a.children,
|
|
87146
|
-
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { "aria-label": ariaLabel, className: classBinder_cx('c-badge', theme), "data-testid": testId },
|
|
87145
|
+
var ariaLabel = _a.ariaLabel, children = _a.children, count = _a.count, _b = _a.hasNotification, hasNotification = _b === void 0 ? false : _b, _c = _a.isDotVisible, isDotVisible = _c === void 0 ? false : _c, _d = _a.maxCount, maxCount = _d === void 0 ? 99 : _d, testId = _a.testId, theme = _a.theme;
|
|
87146
|
+
return hasNotification || isDotVisible || children || count ? (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { "aria-label": ariaLabel, className: classBinder_cx('c-badge', theme), "data-testid": testId },
|
|
87147
87147
|
children,
|
|
87148
|
-
(isDotVisible ||
|
|
87148
|
+
(isDotVisible || hasNotification || count) && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("span", { className: classBinder_cx('c-badge__point', { 'c-badge__point--relative': !children }, { 'c-badge__point--dot': isDotVisible || hasNotification }) }, count && (!isDotVisible || !hasNotification) ? (count > maxCount ? maxCount + "+" : count) : null)))) : null;
|
|
87149
87149
|
};
|
|
87150
87150
|
|
|
87151
87151
|
// CONCATENATED MODULE: ./src/components/Components/Badge/index.ts
|
|
@@ -97057,31 +97057,35 @@ var useModal = function (disableCloseByOutsideClick, onHide, onShow) {
|
|
|
97057
97057
|
|
|
97058
97058
|
|
|
97059
97059
|
|
|
97060
|
+
|
|
97060
97061
|
var Pills = function (_a) {
|
|
97061
97062
|
var ariaLabel = _a.ariaLabel, _b = _a.initialPill, initialPill = _b === void 0 ? '' : _b, onChange = _a.onChange, pills = _a.pills, _c = _a.testId, testId = _c === void 0 ? 'Pills' : _c, theme = _a.theme;
|
|
97062
97063
|
var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), activePill = _d[0], setActivePill = _d[1];
|
|
97063
|
-
var updateActivePill = function (pill) {
|
|
97064
|
-
if (onChange)
|
|
97064
|
+
var updateActivePill = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (pill) {
|
|
97065
|
+
if (onChange) {
|
|
97065
97066
|
onChange(pill);
|
|
97067
|
+
}
|
|
97066
97068
|
setActivePill(pill);
|
|
97067
|
-
};
|
|
97068
|
-
var handleOnClick = function (pill, isDisabled) { return function (event) {
|
|
97069
|
+
}, [onChange]);
|
|
97070
|
+
var handleOnClick = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (pill, isDisabled) { return function (event) {
|
|
97069
97071
|
if (isDisabled) {
|
|
97070
97072
|
event.preventDefault();
|
|
97071
97073
|
}
|
|
97072
97074
|
updateActivePill(pill);
|
|
97073
|
-
}; };
|
|
97075
|
+
}; }, [updateActivePill]);
|
|
97074
97076
|
Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
|
|
97075
97077
|
setActivePill(initialPill);
|
|
97076
97078
|
}, [initialPill]);
|
|
97077
97079
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("ul", { "aria-label": ariaLabel, className: classBinder_cx('c-pills__list', theme), "data-testid": testId }, pills.map(function (_a) {
|
|
97078
97080
|
var _b;
|
|
97079
|
-
var disabledTooltip = _a.disabledTooltip, _c = _a.
|
|
97081
|
+
var disabledTooltip = _a.disabledTooltip, _c = _a.hasNotification, hasNotification = _c === void 0 ? false : _c, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, label = _a.label, notificationCount = _a.notificationCount, notificationMaxCount = _a.notificationMaxCount, value = _a.value;
|
|
97080
97082
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("li", { key: "pills-" + cuid_default()() + "-" + value, className: classBinder_cx('c-pills__listItem', (_b = {},
|
|
97081
|
-
_b[
|
|
97082
|
-
_b[
|
|
97083
|
+
_b['c-pills__listItem--disabled'] = isDisabled,
|
|
97084
|
+
_b['c-pills__listItem--selected'] = activePill === value,
|
|
97083
97085
|
_b)) },
|
|
97084
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { disabledTooltip: disabledTooltip, isDisabled: isDisabled, theme: classBinder_cx('c-pills__listButton'), type: "transparent", onClick: handleOnClick(value, isDisabled) },
|
|
97086
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Button, { disabledTooltip: disabledTooltip, isDisabled: isDisabled, theme: classBinder_cx('c-pills__listButton'), type: "transparent", onClick: handleOnClick(value, isDisabled) },
|
|
97087
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Badge, { count: notificationCount, hasNotification: hasNotification, maxCount: notificationMaxCount, theme: "u-mr--xxSmall" }),
|
|
97088
|
+
label)));
|
|
97085
97089
|
})));
|
|
97086
97090
|
};
|
|
97087
97091
|
|
|
@@ -113280,15 +113284,11 @@ var Stepper = function (_a) {
|
|
|
113280
113284
|
// CONCATENATED MODULE: ./src/components/Navigation/Tabs/_elements_/TabListItem.tsx
|
|
113281
113285
|
|
|
113282
113286
|
|
|
113287
|
+
|
|
113283
113288
|
var TabListItem = function (_a) {
|
|
113284
|
-
var _b;
|
|
113285
|
-
var _c = _a.countLimit, countLimit = _c === void 0 ? 99 : _c, hasNotification = _a.hasNotification, notificationCount = _a.notificationCount, value = _a.value;
|
|
113289
|
+
var _b = _a.countLimit, countLimit = _b === void 0 ? 99 : _b, hasNotification = _a.hasNotification, notificationCount = _a.notificationCount, notificationMaxCount = _a.notificationMaxCount, value = _a.value;
|
|
113286
113290
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Flex, { alignItems: hasNotification ? 'center' : 'baseline' },
|
|
113287
|
-
|
|
113288
|
-
? notificationCount > countLimit
|
|
113289
|
-
? countLimit + "+"
|
|
113290
|
-
: notificationCount
|
|
113291
|
-
: null)),
|
|
113291
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Badge, { count: notificationCount, hasNotification: hasNotification, maxCount: notificationMaxCount || countLimit, theme: "u-mr--xxSmall" }),
|
|
113292
113292
|
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-tabs__text') }, value)));
|
|
113293
113293
|
};
|
|
113294
113294
|
|