@mmb-digital/ds-lilly 0.10.9 → 0.10.11
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-lilly.js
CHANGED
|
@@ -97676,7 +97676,7 @@ function createDomMotionComponent(key) {
|
|
|
97676
97676
|
|
|
97677
97677
|
|
|
97678
97678
|
var CollapseHeader = function (_a) {
|
|
97679
|
-
var header = _a.header, iconBackground = _a.iconBackground, iconBadge = _a.iconBadge, _b = _a.iconBadgePosition, iconBadgePosition = _b === void 0 ? 'bottomRight' : _b, iconName = _a.iconName, _c = _a.iconSize, iconSize = _c === void 0 ? 'large' : _c, isCollapsible = _a.isCollapsible, isIconAlignTop = _a.isIconAlignTop, isIconRight = _a.isIconRight, isInteractive = _a.isInteractive, onToggle = _a.onToggle;
|
|
97679
|
+
var header = _a.header, iconBackground = _a.iconBackground, iconBadge = _a.iconBadge, _b = _a.iconBadgePosition, iconBadgePosition = _b === void 0 ? 'bottomRight' : _b, iconColor = _a.iconColor, iconName = _a.iconName, _c = _a.iconSize, iconSize = _c === void 0 ? 'large' : _c, isCollapsible = _a.isCollapsible, isIconAlignTop = _a.isIconAlignTop, isIconRight = _a.isIconRight, isInteractive = _a.isInteractive, onToggle = _a.onToggle;
|
|
97680
97680
|
var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useContext"])(contexts_CardContext), hasCustomTrigger = _d.hasCustomTrigger, identification = _d.identification, isOpened = _d.isOpened, withoutOpener = _d.withoutOpener;
|
|
97681
97681
|
var handleOnToggle = function (event) { return !hasCustomTrigger && onToggle(event); };
|
|
97682
97682
|
return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { "aria-controls": isCollapsible && !hasCustomTrigger ? identification + "_content" : undefined, "aria-expanded": isCollapsible && !hasCustomTrigger ? isOpened : undefined, className: classBinder_cx('c-card__header', {
|
|
@@ -97686,7 +97686,7 @@ var CollapseHeader = function (_a) {
|
|
|
97686
97686
|
'c-card__icon--alignTop': isIconAlignTop,
|
|
97687
97687
|
'c-card__icon--right': isIconRight
|
|
97688
97688
|
}) },
|
|
97689
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { backgroundColor: iconBackground, badge: iconBadge, badgePosition: iconBadgePosition, name: iconName, size: iconSize }))),
|
|
97689
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { backgroundColor: iconBackground, badge: iconBadge, badgePosition: iconBadgePosition, color: iconColor, name: iconName, size: iconSize }))),
|
|
97690
97690
|
header && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: "c-card__header__text", id: identification + "_header" }, header)),
|
|
97691
97691
|
!hasCustomTrigger && !withoutOpener && (isInteractive || isCollapsible) && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-card__collapseIcon c-card__collapseIcon--right') },
|
|
97692
97692
|
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: isCollapsible ? 'arrowDown' : 'arrowRight', size: "small" })))));
|
|
@@ -97702,7 +97702,7 @@ var CollapseHeader = function (_a) {
|
|
|
97702
97702
|
|
|
97703
97703
|
var Card = function (_a) {
|
|
97704
97704
|
var _b;
|
|
97705
|
-
var allowEventPropagation = _a.allowEventPropagation, backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, children = _a.children, disabledTooltip = _a.disabledTooltip, disabledTooltipType = _a.disabledTooltipType, _c = _a.hasCustomTrigger, hasCustomTrigger = _c === void 0 ? false : _c, collapseHeader = _a.header, iconBackgroundColor = _a.iconBackgroundColor, iconBadge = _a.iconBadge, _d = _a.iconBadgePosition, iconBadgePosition = _d === void 0 ? 'bottomRight' : _d, iconName = _a.iconName, iconSize = _a.iconSize, isCollapsible = _a.isCollapsible, isDisabled = _a.isDisabled, isIconAlignTop = _a.isIconAlignTop, isIconRight = _a.isIconRight, isInteractive = _a.isInteractive, _e = _a.isOpen, isOpen = _e === void 0 ? false : _e, isSelected = _a.isSelected, onClick = _a.onClick, onRef = _a.onRef, onToggle = _a.onToggle, shadowSize = _a.shadowSize, size = _a.size, testId = _a.testId, theme = _a.theme, _f = _a.withoutOpener, withoutOpener = _f === void 0 ? false : _f, _g = _a.withoutRole, withoutRole = _g === void 0 ? false : _g;
|
|
97705
|
+
var allowEventPropagation = _a.allowEventPropagation, backgroundColor = _a.backgroundColor, borderColor = _a.borderColor, children = _a.children, disabledTooltip = _a.disabledTooltip, disabledTooltipType = _a.disabledTooltipType, _c = _a.hasCustomTrigger, hasCustomTrigger = _c === void 0 ? false : _c, collapseHeader = _a.header, iconBackgroundColor = _a.iconBackgroundColor, iconBadge = _a.iconBadge, _d = _a.iconBadgePosition, iconBadgePosition = _d === void 0 ? 'bottomRight' : _d, iconColor = _a.iconColor, iconName = _a.iconName, iconSize = _a.iconSize, isCollapsible = _a.isCollapsible, isDisabled = _a.isDisabled, isIconAlignTop = _a.isIconAlignTop, isIconRight = _a.isIconRight, isInteractive = _a.isInteractive, _e = _a.isOpen, isOpen = _e === void 0 ? false : _e, isSelected = _a.isSelected, onClick = _a.onClick, onRef = _a.onRef, onToggle = _a.onToggle, shadowSize = _a.shadowSize, size = _a.size, testId = _a.testId, theme = _a.theme, _f = _a.withoutOpener, withoutOpener = _f === void 0 ? false : _f, _g = _a.withoutRole, withoutRole = _g === void 0 ? false : _g;
|
|
97706
97706
|
var identification = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return "card_" + cuid_default()(); }, []);
|
|
97707
97707
|
var _h = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(isOpen), isOpened = _h[0], setIsOpened = _h[1];
|
|
97708
97708
|
var cardRef = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])(null);
|
|
@@ -97713,6 +97713,12 @@ var Card = function (_a) {
|
|
|
97713
97713
|
: isHovered
|
|
97714
97714
|
? "" + iconBackgroundColor.replace('Normal', 'Hover')
|
|
97715
97715
|
: "" + iconBackgroundColor);
|
|
97716
|
+
var iconColorName = iconColor &&
|
|
97717
|
+
(isActive
|
|
97718
|
+
? "" + iconColor.replace('Normal', 'Active')
|
|
97719
|
+
: isHovered
|
|
97720
|
+
? "" + iconColor.replace('Normal', 'Hover')
|
|
97721
|
+
: iconColor);
|
|
97716
97722
|
var handleOnClick = function (event) {
|
|
97717
97723
|
if (isDisabled)
|
|
97718
97724
|
return;
|
|
@@ -97763,7 +97769,7 @@ var Card = function (_a) {
|
|
|
97763
97769
|
_b["c-card--" + shadowSize + "Shadow"] = shadowSize,
|
|
97764
97770
|
_b["c-card--" + size] = size,
|
|
97765
97771
|
_b), theme), "data-testid": testId, role: isInteractive && !withoutRole ? 'button' : undefined, tabIndex: (isInteractive || isCollapsible) && !withoutRole ? 0 : undefined, onClick: handleOnClick, onKeyDown: handleKeyDown },
|
|
97766
|
-
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(CollapseHeader, { header: collapseHeader ? collapseHeader : children, iconBackground: iconBackground, iconBadge: iconBadge, iconBadgePosition: iconBadgePosition, iconName: iconName, iconSize: iconSize, isCollapsible: isCollapsible, isIconAlignTop: isIconAlignTop, isIconRight: isIconRight, isInteractive: isInteractive, onToggle: handleOnToggle }),
|
|
97772
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(CollapseHeader, { header: collapseHeader ? collapseHeader : children, iconBackground: iconBackground, iconBadge: iconBadge, iconBadgePosition: iconBadgePosition, iconColor: iconColorName, iconName: iconName, iconSize: iconSize, isCollapsible: isCollapsible, isIconAlignTop: isIconAlignTop, isIconRight: isIconRight, isInteractive: isInteractive, onToggle: handleOnToggle }),
|
|
97767
97773
|
isCollapsible ? (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(AnimatePresence, { initial: false }, isOpened && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(motion.div, { key: "content", animate: "open", "aria-labelledby": identification + "_header", className: classBinder_cx('c-card__motion'), exit: "collapsed", initial: "collapsed", role: "region", transition: { duration: 0.6, ease: [0.04, 0.62, 0.23, 0.98] }, variants: {
|
|
97768
97774
|
open: { opacity: 1, height: 'auto' },
|
|
97769
97775
|
collapsed: { opacity: 0, height: 0 }
|
|
@@ -20,6 +20,8 @@ export interface CardPropsType extends ComponentPropsType, DisabledTooltipPropsT
|
|
|
20
20
|
iconBackgroundColor?: BackgroundColorType;
|
|
21
21
|
/** Icon badge */
|
|
22
22
|
iconBadge?: AvatarPropsType | IconPropsType;
|
|
23
|
+
/** Color of icon SVG fill from palette--(light|dark).scss example orangeDark */
|
|
24
|
+
iconColor?: string;
|
|
23
25
|
/** Icon badge position */
|
|
24
26
|
iconBadgePosition?: IconBadgePosition;
|
|
25
27
|
/** Define Icon name if you want some to be displayed. */
|
|
@@ -57,6 +59,6 @@ export interface CardPropsType extends ComponentPropsType, DisabledTooltipPropsT
|
|
|
57
59
|
}
|
|
58
60
|
export declare type ShadowSizeType = 'small' | 'medium' | 'large' | 'no';
|
|
59
61
|
declare type CardBackgroundColorType = 'cloud' | 'grey' | 'gold' | 'primaryDark' | 'transparent';
|
|
60
|
-
export declare const Card: ({ allowEventPropagation, backgroundColor, borderColor, children, disabledTooltip, disabledTooltipType, hasCustomTrigger, header: collapseHeader, iconBackgroundColor, iconBadge, iconBadgePosition, iconName, iconSize, isCollapsible, isDisabled, isIconAlignTop, isIconRight, isInteractive, isOpen, isSelected, onClick, onRef, onToggle, shadowSize, size, testId, theme, withoutOpener, withoutRole }: CardPropsType) => JSX.Element;
|
|
62
|
+
export declare const Card: ({ allowEventPropagation, backgroundColor, borderColor, children, disabledTooltip, disabledTooltipType, hasCustomTrigger, header: collapseHeader, iconBackgroundColor, iconBadge, iconBadgePosition, iconColor, iconName, iconSize, isCollapsible, isDisabled, isIconAlignTop, isIconRight, isInteractive, isOpen, isSelected, onClick, onRef, onToggle, shadowSize, size, testId, theme, withoutOpener, withoutRole }: CardPropsType) => JSX.Element;
|
|
61
63
|
export {};
|
|
62
64
|
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -8,6 +8,7 @@ export interface CollapseHeaderPropsType {
|
|
|
8
8
|
iconBackground?: BackgroundColorType;
|
|
9
9
|
iconBadge?: AvatarPropsType | IconPropsType;
|
|
10
10
|
iconBadgePosition?: IconBadgePosition;
|
|
11
|
+
iconColor?: string;
|
|
11
12
|
iconName: CardPropsType['iconName'];
|
|
12
13
|
iconSize?: IconSizeType;
|
|
13
14
|
isCollapsible: CardPropsType['isCollapsible'];
|
|
@@ -16,5 +17,5 @@ export interface CollapseHeaderPropsType {
|
|
|
16
17
|
isInteractive: CardPropsType['isInteractive'];
|
|
17
18
|
onToggle: (event: SyntheticEvent) => void;
|
|
18
19
|
}
|
|
19
|
-
export declare const CollapseHeader: ({ header, iconBackground, iconBadge, iconBadgePosition, iconName, iconSize, isCollapsible, isIconAlignTop, isIconRight, isInteractive, onToggle }: CollapseHeaderPropsType) => JSX.Element;
|
|
20
|
+
export declare const CollapseHeader: ({ header, iconBackground, iconBadge, iconBadgePosition, iconColor, iconName, iconSize, isCollapsible, isIconAlignTop, isIconRight, isInteractive, onToggle }: CollapseHeaderPropsType) => JSX.Element;
|
|
20
21
|
//# sourceMappingURL=CollapseHeader.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmb-digital/ds-lilly",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.11",
|
|
4
4
|
"description": "MMB LILLY design system",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "dist/ds-lilly.js",
|
|
8
|
-
"module": "dist/",
|
|
8
|
+
"module": "dist/ds-lilly.js",
|
|
9
9
|
"source": "src/index.ts",
|
|
10
10
|
"types": "dist/types/src/index.d.ts",
|
|
11
11
|
"files": [
|