glints-aries 4.0.322 → 4.0.323
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/es/@next/Card/Card.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare type CardProps = {
|
|
|
9
9
|
headerPrimaryAction?: ComponentAction;
|
|
10
10
|
headerSecondaryAction?: ComponentAction;
|
|
11
11
|
actionsAlignment?: 'left' | 'right';
|
|
12
|
+
/** Defining custom actions will not show primary and secondary actions */
|
|
13
|
+
customActions?: React.ReactNode;
|
|
12
14
|
};
|
|
13
15
|
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
14
16
|
Section: ({ children }: {
|
package/es/@next/Card/Card.js
CHANGED
|
@@ -12,6 +12,7 @@ var CardComponent = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
|
|
|
12
12
|
subheading = _ref.subheading,
|
|
13
13
|
primaryAction = _ref.primaryAction,
|
|
14
14
|
secondaryAction = _ref.secondaryAction,
|
|
15
|
+
customActions = _ref.customActions,
|
|
15
16
|
headerPrimaryAction = _ref.headerPrimaryAction,
|
|
16
17
|
headerSecondaryAction = _ref.headerSecondaryAction,
|
|
17
18
|
_ref$actionsAlignment = _ref.actionsAlignment,
|
|
@@ -34,8 +35,14 @@ var CardComponent = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
|
|
|
34
35
|
}
|
|
35
36
|
return /*#__PURE__*/React.createElement(StyledCardHeaderSection, null, subHeadingMarkup);
|
|
36
37
|
};
|
|
38
|
+
var defaultActionContent = /*#__PURE__*/React.createElement(ButtonGroup, null, secondaryAction && /*#__PURE__*/React.createElement(Button, _extends({
|
|
39
|
+
onClick: secondaryAction.action
|
|
40
|
+
}, secondaryAction), secondaryAction.label), primaryAction && /*#__PURE__*/React.createElement(PrimaryButton, _extends({
|
|
41
|
+
onClick: primaryAction.action
|
|
42
|
+
}, primaryAction), primaryAction.label));
|
|
43
|
+
var actionsContent = customActions ? customActions : defaultActionContent;
|
|
37
44
|
var showHeader = !!heading || !!subheading;
|
|
38
|
-
var showActions = !!primaryAction || !!secondaryAction;
|
|
45
|
+
var showActions = !!customActions || !!primaryAction || !!secondaryAction;
|
|
39
46
|
return /*#__PURE__*/React.createElement(StyledCardContainer, {
|
|
40
47
|
ref: ref
|
|
41
48
|
}, showHeader && /*#__PURE__*/React.createElement(StyledCardHeaderWrapper, null, /*#__PURE__*/React.createElement(StyledCardHeaderLeftContainer, null, headerMarkup()), /*#__PURE__*/React.createElement(StyledCardHeaderRightContainer, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
@@ -50,12 +57,9 @@ var CardComponent = /*#__PURE__*/React.forwardRef(function Card(_ref, ref) {
|
|
|
50
57
|
}, headerPrimaryAction), headerPrimaryAction.label)))), /*#__PURE__*/React.createElement(StyledCardContentWrapper, {
|
|
51
58
|
"data-actions": showActions
|
|
52
59
|
}, children), showActions && /*#__PURE__*/React.createElement(StyledCardActionWrapper, {
|
|
53
|
-
"data-align": actionsAlignment
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}, secondaryAction), secondaryAction.label), primaryAction && /*#__PURE__*/React.createElement(PrimaryButton, _extends({
|
|
57
|
-
onClick: primaryAction.action
|
|
58
|
-
}, primaryAction), primaryAction.label))));
|
|
60
|
+
"data-align": actionsAlignment,
|
|
61
|
+
className: "card-actions-wrapper"
|
|
62
|
+
}, actionsContent));
|
|
59
63
|
});
|
|
60
64
|
export var Card = Object.assign(CardComponent, {
|
|
61
65
|
Section: Section
|
package/lib/@next/Card/Card.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare type CardProps = {
|
|
|
9
9
|
headerPrimaryAction?: ComponentAction;
|
|
10
10
|
headerSecondaryAction?: ComponentAction;
|
|
11
11
|
actionsAlignment?: 'left' | 'right';
|
|
12
|
+
/** Defining custom actions will not show primary and secondary actions */
|
|
13
|
+
customActions?: React.ReactNode;
|
|
12
14
|
};
|
|
13
15
|
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>> & {
|
|
14
16
|
Section: ({ children }: {
|
package/lib/@next/Card/Card.js
CHANGED
|
@@ -17,6 +17,7 @@ var CardComponent = /*#__PURE__*/_react["default"].forwardRef(function Card(_ref
|
|
|
17
17
|
subheading = _ref.subheading,
|
|
18
18
|
primaryAction = _ref.primaryAction,
|
|
19
19
|
secondaryAction = _ref.secondaryAction,
|
|
20
|
+
customActions = _ref.customActions,
|
|
20
21
|
headerPrimaryAction = _ref.headerPrimaryAction,
|
|
21
22
|
headerSecondaryAction = _ref.headerSecondaryAction,
|
|
22
23
|
_ref$actionsAlignment = _ref.actionsAlignment,
|
|
@@ -39,8 +40,14 @@ var CardComponent = /*#__PURE__*/_react["default"].forwardRef(function Card(_ref
|
|
|
39
40
|
}
|
|
40
41
|
return /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardHeaderSection, null, subHeadingMarkup);
|
|
41
42
|
};
|
|
43
|
+
var defaultActionContent = /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, null, secondaryAction && /*#__PURE__*/_react["default"].createElement(_Button.Button, (0, _extends2["default"])({
|
|
44
|
+
onClick: secondaryAction.action
|
|
45
|
+
}, secondaryAction), secondaryAction.label), primaryAction && /*#__PURE__*/_react["default"].createElement(_Button.PrimaryButton, (0, _extends2["default"])({
|
|
46
|
+
onClick: primaryAction.action
|
|
47
|
+
}, primaryAction), primaryAction.label));
|
|
48
|
+
var actionsContent = customActions ? customActions : defaultActionContent;
|
|
42
49
|
var showHeader = !!heading || !!subheading;
|
|
43
|
-
var showActions = !!primaryAction || !!secondaryAction;
|
|
50
|
+
var showActions = !!customActions || !!primaryAction || !!secondaryAction;
|
|
44
51
|
return /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardContainer, {
|
|
45
52
|
ref: ref
|
|
46
53
|
}, showHeader && /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardHeaderWrapper, null, /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardHeaderLeftContainer, null, headerMarkup()), /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardHeaderRightContainer, null, /*#__PURE__*/_react["default"].createElement(_ButtonGroup.ButtonGroup, {
|
|
@@ -55,12 +62,9 @@ var CardComponent = /*#__PURE__*/_react["default"].forwardRef(function Card(_ref
|
|
|
55
62
|
}, headerPrimaryAction), headerPrimaryAction.label)))), /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardContentWrapper, {
|
|
56
63
|
"data-actions": showActions
|
|
57
64
|
}, children), showActions && /*#__PURE__*/_react["default"].createElement(_CardStyle.StyledCardActionWrapper, {
|
|
58
|
-
"data-align": actionsAlignment
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, secondaryAction), secondaryAction.label), primaryAction && /*#__PURE__*/_react["default"].createElement(_Button.PrimaryButton, (0, _extends2["default"])({
|
|
62
|
-
onClick: primaryAction.action
|
|
63
|
-
}, primaryAction), primaryAction.label))));
|
|
65
|
+
"data-align": actionsAlignment,
|
|
66
|
+
className: "card-actions-wrapper"
|
|
67
|
+
}, actionsContent));
|
|
64
68
|
});
|
|
65
69
|
var Card = Object.assign(CardComponent, {
|
|
66
70
|
Section: _Section.Section
|