@kaizen/components 1.57.1 → 1.58.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/bin/codemod.sh +39 -0
- package/codemods/README.md +31 -0
- package/codemods/__tests__/utils/index.ts +1 -0
- package/codemods/__tests__/utils/parseJsx.ts +11 -0
- package/codemods/migrateBrandMomentMoodToVariant/index.ts +21 -0
- package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.spec.ts +44 -0
- package/codemods/migrateBrandMomentMoodToVariant/transformBrandMomentMoodToVariant.ts +24 -0
- package/codemods/migrateCardVariantToColor/index.ts +15 -0
- package/codemods/migrateCardVariantToColor/transformCardVariantToColor.spec.ts +91 -0
- package/codemods/migrateCardVariantToColor/transformCardVariantToColor.ts +32 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/index.ts +19 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.spec.ts +110 -0
- package/codemods/migrateConfirmationModalMoodsToVariant/transformConfirmationModalMoodsToVariant.ts +59 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/index.ts +21 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.spec.ts +74 -0
- package/codemods/migrateEmptyStateIllustrationTypeToVariant/transformEmptyStateIllustrationTypeToVariant.ts +28 -0
- package/codemods/migrateGlobalNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateInformationTileMoodToVariant/index.ts +21 -0
- package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.spec.ts +84 -0
- package/codemods/migrateInformationTileMoodToVariant/transformInformationTileMoodToVariant.ts +22 -0
- package/codemods/migrateInlineNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateMultiActionTileMoodToVariant/index.ts +21 -0
- package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.spec.ts +84 -0
- package/codemods/migrateMultiActionTileMoodToVariant/transformMultiActionTileMoodToVariant.ts +22 -0
- package/codemods/migrateNotificationTypeToVariant/index.ts +1 -0
- package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.spec.ts +107 -0
- package/codemods/migrateNotificationTypeToVariant/migrateNotificationTypeToVariant.ts +28 -0
- package/codemods/migrateProgressBarMoodToColor/index.ts +21 -0
- package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.spec.ts +54 -0
- package/codemods/migrateProgressBarMoodToColor/transformProgressBarMoodToColor.ts +26 -0
- package/codemods/migrateToastNotificationTypeToVariant/index.ts +19 -0
- package/codemods/migrateWellVariantToColor/index.ts +15 -0
- package/codemods/migrateWellVariantToColor/transformWellVariantToColor.spec.ts +192 -0
- package/codemods/migrateWellVariantToColor/transformWellVariantToColor.ts +75 -0
- package/codemods/removeInputEditModalMood/index.ts +19 -0
- package/codemods/removeInputEditModalMood/removeInputEditModalMood.spec.ts +80 -0
- package/codemods/removeInputEditModalMood/removeInputEditModalMood.ts +40 -0
- package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.spec.ts +118 -0
- package/codemods/updateGuidanceBlockVariantProp/transformGuidanceBlockVariantProp.ts +64 -0
- package/codemods/utils/__fixtures__/KaioComponent.tsx +6 -0
- package/codemods/utils/__snapshots__/transformSource.spec.ts.snap +11 -0
- package/codemods/utils/getPropValueText.spec.ts +75 -0
- package/codemods/utils/getPropValueText.ts +21 -0
- package/codemods/utils/getTagName.spec.ts +24 -0
- package/codemods/utils/getTagName.ts +32 -0
- package/codemods/utils/index.ts +7 -0
- package/codemods/utils/migrateStringProp.spec.ts +129 -0
- package/codemods/utils/migrateStringProp.ts +43 -0
- package/codemods/utils/printAst.ts +6 -0
- package/codemods/utils/transformComponentsInDir.ts +42 -0
- package/codemods/utils/transformSource.spec.ts +56 -0
- package/codemods/utils/transformSource.ts +25 -0
- package/codemods/utils/updateJsxElementWithNewProps.spec.ts +67 -0
- package/codemods/utils/updateJsxElementWithNewProps.ts +24 -0
- package/dist/cjs/BrandMoment/BrandMoment.cjs +3 -2
- package/dist/cjs/BrandMoment/BrandMoment.module.scss.cjs +3 -1
- package/dist/cjs/Card/Card.cjs +7 -6
- package/dist/cjs/Card/Card.module.scss.cjs +10 -2
- package/dist/cjs/EmptyState/EmptyState.cjs +14 -6
- package/dist/cjs/EmptyState/EmptyState.module.scss.cjs +3 -0
- package/dist/cjs/ErrorPage/ErrorPage.cjs +1 -1
- package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.cjs +9 -5
- package/dist/cjs/Modal/ConfirmationModal/ConfirmationModal.module.scss.cjs +6 -2
- package/dist/cjs/Notification/ToastNotification/ToastNotification/ToastNotification.cjs +1 -3
- package/dist/cjs/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.cjs +1 -3
- package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.cjs +6 -3
- package/dist/cjs/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.cjs +5 -3
- package/dist/cjs/Notification/subcomponents/NotificationIcon/NotificationIcon.cjs +35 -3
- package/dist/cjs/ProgressBar/ProgressBar.cjs +3 -2
- package/dist/cjs/ProgressBar/ProgressBar.module.scss.cjs +8 -4
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.cjs +7 -5
- package/dist/cjs/Tile/subcomponents/GenericTile/GenericTile.module.scss.cjs +8 -6
- package/dist/cjs/Well/Well.cjs +5 -4
- package/dist/cjs/Well/Well.module.scss.cjs +9 -1
- package/dist/cjs/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.cjs +6 -6
- package/dist/cjs/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.cjs +33 -0
- package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.cjs +160 -0
- package/dist/cjs/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.cjs +28 -0
- package/dist/cjs/containersV1.cjs +4 -0
- package/dist/cjs/containersV2.cjs +4 -0
- package/dist/cjs/index.cjs +2 -2
- package/dist/esm/BrandMoment/BrandMoment.mjs +3 -2
- package/dist/esm/BrandMoment/BrandMoment.module.scss.mjs +3 -1
- package/dist/esm/Card/Card.mjs +7 -6
- package/dist/esm/Card/Card.module.scss.mjs +10 -2
- package/dist/esm/EmptyState/EmptyState.mjs +15 -7
- package/dist/esm/EmptyState/EmptyState.module.scss.mjs +3 -0
- package/dist/esm/ErrorPage/ErrorPage.mjs +1 -1
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.mjs +9 -5
- package/dist/esm/Modal/ConfirmationModal/ConfirmationModal.module.scss.mjs +6 -2
- package/dist/esm/Notification/ToastNotification/ToastNotification/ToastNotification.mjs +1 -3
- package/dist/esm/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.mjs +1 -3
- package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.mjs +8 -5
- package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs +5 -3
- package/dist/esm/Notification/subcomponents/NotificationIcon/NotificationIcon.mjs +39 -5
- package/dist/esm/ProgressBar/ProgressBar.mjs +3 -2
- package/dist/esm/ProgressBar/ProgressBar.module.scss.mjs +8 -4
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.mjs +7 -5
- package/dist/esm/Tile/subcomponents/GenericTile/GenericTile.module.scss.mjs +8 -6
- package/dist/esm/Well/Well.mjs +5 -4
- package/dist/esm/Well/Well.module.scss.mjs +9 -1
- package/dist/esm/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.mjs +6 -6
- package/dist/esm/__containers__/GuidanceBlock/v1/GuidanceBlock.module.scss.mjs +31 -0
- package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.mjs +153 -0
- package/dist/esm/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss.mjs +26 -0
- package/dist/esm/containersV1.mjs +1 -0
- package/dist/esm/containersV2.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/styles.css +13 -12
- package/dist/types/BrandMoment/BrandMoment.d.ts +19 -3
- package/dist/types/Card/Card.d.ts +20 -7
- package/dist/types/EmptyState/EmptyState.d.ts +14 -6
- package/dist/types/Modal/ConfirmationModal/ConfirmationModal.d.ts +25 -7
- package/dist/types/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.d.ts +3 -0
- package/dist/types/Modal/InputEditModal/InputEditModal.d.ts +4 -1
- package/dist/types/Notification/GlobalNotification/GlobalNotification.d.ts +3 -3
- package/dist/types/Notification/InlineNotification/InlineNotification.d.ts +3 -3
- package/dist/types/Notification/ToastNotification/ToastNotification/ToastNotification.d.ts +5 -4
- package/dist/types/Notification/ToastNotification/context/ToastNotificationContext.d.ts +4 -3
- package/dist/types/Notification/ToastNotification/types.d.ts +3 -3
- package/dist/types/Notification/subcomponents/GenericNotification/GenericNotification.d.ts +24 -4
- package/dist/types/Notification/subcomponents/NotificationIcon/NotificationIcon.d.ts +11 -4
- package/dist/types/Notification/types.d.ts +2 -1
- package/dist/types/ProgressBar/ProgressBar.d.ts +25 -6
- package/dist/types/Tile/subcomponents/GenericTile/GenericTile.d.ts +10 -3
- package/dist/types/Well/Well.d.ts +6 -2
- package/dist/types/Well/types.d.ts +4 -0
- package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.d.ts +4 -4
- package/dist/types/__containers__/GuidanceBlock/v2/GuidanceBlock.d.ts +59 -0
- package/dist/types/__containers__/GuidanceBlock/v2/index.d.ts +1 -0
- package/dist/types/__containers__/v1.d.ts +1 -0
- package/dist/types/__containers__/v2.d.ts +1 -0
- package/dist/types/index.d.ts +1 -1
- package/package.json +19 -5
- package/src/BrandMoment/BrandMoment.module.scss +20 -9
- package/src/BrandMoment/BrandMoment.tsx +26 -3
- package/src/BrandMoment/_docs/BrandMoment.mdx +13 -13
- package/src/BrandMoment/_docs/BrandMoment.stickersheet.stories.tsx +102 -0
- package/src/BrandMoment/_docs/BrandMoment.stories.tsx +17 -99
- package/src/Card/Card.module.scss +56 -7
- package/src/Card/Card.tsx +35 -11
- package/src/Card/_docs/Card.mdx +6 -3
- package/src/Card/_docs/Card.stickersheet.stories.tsx +44 -39
- package/src/Card/_docs/Card.stories.tsx +23 -23
- package/src/EmptyState/EmptyState.module.scss +32 -14
- package/src/EmptyState/EmptyState.tsx +32 -18
- package/src/EmptyState/_docs/EmptyState.stickersheet.stories.tsx +69 -121
- package/src/EmptyState/_docs/EmptyState.stories.tsx +6 -8
- package/src/ErrorPage/ErrorPage.tsx +1 -1
- package/src/Modal/ConfirmationModal/ConfirmationModal.module.scss +100 -78
- package/src/Modal/ConfirmationModal/ConfirmationModal.spec.tsx +5 -5
- package/src/Modal/ConfirmationModal/ConfirmationModal.tsx +41 -10
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.mdx +3 -3
- package/src/Modal/ConfirmationModal/_docs/ConfirmationModal.stories.tsx +11 -4
- package/src/Modal/ContextModal/_docs/ContextModal.stories.tsx +3 -1
- package/src/Modal/GenericModal/subcomponents/ModalFooter/ModalFooter.tsx +3 -0
- package/src/Modal/InputEditModal/InputEditModal.tsx +4 -1
- package/src/Modal/InputEditModal/_docs/InputEditModal.mdx +0 -13
- package/src/Modal/InputEditModal/_docs/InputEditModal.stories.tsx +9 -10
- package/src/Notification/GlobalNotification/GlobalNotification.tsx +9 -4
- package/src/Notification/GlobalNotification/_docs/GlobalNotification.stickersheet.stories.tsx +68 -58
- package/src/Notification/GlobalNotification/_docs/GlobalNotification.stories.tsx +10 -13
- package/src/Notification/InlineNotification/InlineNotification.tsx +9 -4
- package/src/Notification/InlineNotification/_docs/InlineNotification.stickersheet.stories.tsx +79 -44
- package/src/Notification/InlineNotification/_docs/InlineNotification.stories.tsx +17 -17
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.tsx +7 -5
- package/src/Notification/ToastNotification/ToastNotificationsList/subcomponents/ToastNotificationsMap/ToastNotificationsMap.tsx +1 -2
- package/src/Notification/ToastNotification/_docs/ToastNotification.stickersheet.stories.tsx +12 -7
- package/src/Notification/ToastNotification/_docs/ToastNotification.stories.tsx +6 -1
- package/src/Notification/ToastNotification/context/ToastNotificationContext.tsx +7 -3
- package/src/Notification/ToastNotification/types.ts +8 -3
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.module.scss +42 -5
- package/src/Notification/subcomponents/GenericNotification/GenericNotification.tsx +40 -6
- package/src/Notification/subcomponents/GenericNotification/_mixins.scss +2 -1
- package/src/Notification/subcomponents/NotificationIcon/NotificationIcon.tsx +31 -5
- package/src/Notification/types.ts +9 -2
- package/src/ProgressBar/ProgressBar.module.scss +37 -25
- package/src/ProgressBar/ProgressBar.tsx +30 -5
- package/src/ProgressBar/_docs/ProgressBar.mdx +2 -3
- package/src/ProgressBar/_docs/ProgressBar.stickersheet.stories.tsx +95 -51
- package/src/ProgressBar/_docs/ProgressBar.stories.tsx +56 -25
- package/src/Tile/InformationTile/_docs/InformationTile.mdx +3 -2
- package/src/Tile/InformationTile/_docs/InformationTile.stickersheet.stories.tsx +57 -19
- package/src/Tile/InformationTile/_docs/InformationTile.stories.tsx +19 -7
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.mdx +3 -2
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stickersheet.stories.tsx +62 -24
- package/src/Tile/MultiActionTile/_docs/MultiActionTile.stories.tsx +19 -7
- package/src/Tile/subcomponents/GenericTile/GenericTile.module.scss +34 -22
- package/src/Tile/subcomponents/GenericTile/GenericTile.tsx +17 -8
- package/src/Tile/subcomponents/GenericTile/_docs/GenericTile.stickersheet.stories.tsx +57 -19
- package/src/Well/Well.module.scss +70 -33
- package/src/Well/Well.tsx +9 -3
- package/src/Well/_docs/Well.mdx +9 -2
- package/src/Well/_docs/Well.stickersheet.stories.tsx +10 -1
- package/src/Well/_docs/Well.stories.tsx +54 -29
- package/src/Well/types.ts +15 -0
- package/src/__actions__/Button/v3/_docs/ApiSpecification.mdx +1 -1
- package/src/__actions__/Menu/v3/MenuItem.module.scss +1 -0
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.module.scss +2 -2
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.mdx +2 -2
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stickersheet.stories.tsx +1 -1
- package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/_docs/GuidanceBlock.stories.tsx +1 -1
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.module.scss +356 -0
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.spec.tsx +82 -0
- package/src/__containers__/GuidanceBlock/v2/GuidanceBlock.tsx +262 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.mdx +38 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stickersheet.stories.tsx +118 -0
- package/src/__containers__/GuidanceBlock/v2/_docs/GuidanceBlock.stories.tsx +152 -0
- package/src/__containers__/GuidanceBlock/v2/index.ts +1 -0
- package/src/__containers__/v1.ts +1 -0
- package/src/__containers__/v2.ts +1 -0
- package/src/index.ts +2 -1
- package/v1/containers/package.json +5 -0
- package/v2/containers/package.json +5 -0
- package/dist/cjs/GuidanceBlock/GuidanceBlock.module.scss.cjs +0 -33
- package/dist/esm/GuidanceBlock/GuidanceBlock.module.scss.mjs +0 -31
- package/dist/types/Tile/subcomponents/GenericTile/types.d.ts +0 -2
- package/src/EmptyState/_docs/EmptyState.stories.module.scss +0 -15
- package/src/Notification/ToastNotification/ToastNotification/ToastNotification.spec.tsx +0 -33
- package/src/Tile/subcomponents/GenericTile/types.ts +0 -10
- /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.d.ts +0 -0
- /package/dist/types/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.d.ts +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.spec.tsx +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/GuidanceBlock.tsx +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/index.ts +0 -0
- /package/src/{GuidanceBlock → __containers__/GuidanceBlock/v1}/types.ts +0 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var Media = require('react-media');
|
|
7
|
+
var Heading = require('../../../Heading/Heading.cjs');
|
|
8
|
+
require('../../../Icon/subcomponents/SVG/SVG.cjs');
|
|
9
|
+
var ArrowForwardIcon = require('../../../Icon/ArrowForwardIcon.cjs');
|
|
10
|
+
var Text = require('../../../Text/Text.cjs');
|
|
11
|
+
var index = require('../../../__overlays__/Tooltip/v1/index.cjs');
|
|
12
|
+
var GuidanceBlock_module = require('./GuidanceBlock.module.scss.cjs');
|
|
13
|
+
var Button = require('../../../__actions__/Button/v1/Button/Button.cjs');
|
|
14
|
+
function _interopDefault(e) {
|
|
15
|
+
return e && e.__esModule ? e : {
|
|
16
|
+
default: e
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
20
|
+
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
|
|
21
|
+
var Media__default = /*#__PURE__*/_interopDefault(Media);
|
|
22
|
+
var WithTooltip = function (_a) {
|
|
23
|
+
var tooltipProps = _a.tooltipProps,
|
|
24
|
+
children = _a.children;
|
|
25
|
+
return !!tooltipProps ? React__default.default.createElement(index.Tooltip, tslib.__assign({}, tooltipProps), children) : React__default.default.createElement(React__default.default.Fragment, null, children);
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* {@link https://cultureamp.atlassian.net/wiki/spaces/DesignSystem/pages/3082093807/Guidance+Block Guidance} |
|
|
29
|
+
* {@link https://cultureamp.design/?path=/docs/components-guidanceblock--docs Storybook}
|
|
30
|
+
*/
|
|
31
|
+
var GuidanceBlock = function (_a) {
|
|
32
|
+
var _b, _c, _d, _e;
|
|
33
|
+
var _f = _a.layout,
|
|
34
|
+
layout = _f === void 0 ? "default" : _f,
|
|
35
|
+
_g = _a.variant,
|
|
36
|
+
variant = _g === void 0 ? "default" : _g,
|
|
37
|
+
_h = _a.withActionButtonArrow,
|
|
38
|
+
withActionButtonArrow = _h === void 0 ? true : _h,
|
|
39
|
+
_j = _a.noMaxWidth,
|
|
40
|
+
noMaxWidth = _j === void 0 ? false : _j,
|
|
41
|
+
_k = _a.illustrationType,
|
|
42
|
+
illustrationType = _k === void 0 ? "spot" : _k,
|
|
43
|
+
_l = _a.smallScreenTextAlignment,
|
|
44
|
+
smallScreenTextAlignment = _l === void 0 ? "center" : _l,
|
|
45
|
+
actions = _a.actions,
|
|
46
|
+
illustration = _a.illustration,
|
|
47
|
+
secondaryDismiss = _a.secondaryDismiss,
|
|
48
|
+
restProps = tslib.__rest(_a, ["layout", "variant", "withActionButtonArrow", "noMaxWidth", "illustrationType", "smallScreenTextAlignment", "actions", "illustration", "secondaryDismiss"]);
|
|
49
|
+
var _m = React.useState(false),
|
|
50
|
+
hidden = _m[0],
|
|
51
|
+
setHidden = _m[1];
|
|
52
|
+
var _o = React.useState(false),
|
|
53
|
+
removed = _o[0],
|
|
54
|
+
setRemoved = _o[1];
|
|
55
|
+
var _p = React.useState(""),
|
|
56
|
+
mediaQueryLayout = _p[0],
|
|
57
|
+
setMediaQueryLayout = _p[1];
|
|
58
|
+
var containerRef = React__default.default.createRef();
|
|
59
|
+
React.useEffect(function () {
|
|
60
|
+
if (layout === "inline" || layout === "stacked") {
|
|
61
|
+
containerQuery();
|
|
62
|
+
}
|
|
63
|
+
}, []);
|
|
64
|
+
var handleDismissBanner = function () {
|
|
65
|
+
var _a;
|
|
66
|
+
setHidden(true);
|
|
67
|
+
(_a = actions === null || actions === void 0 ? void 0 : actions.dismiss) === null || _a === void 0 ? void 0 : _a.onClick();
|
|
68
|
+
};
|
|
69
|
+
var onTransitionEnd = function (e) {
|
|
70
|
+
// Be careful: this assumes the final CSS property to be animated is "margin-top".
|
|
71
|
+
if (hidden && e.propertyName === "margin-top") {
|
|
72
|
+
setRemoved(true);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
var containerQuery = function () {
|
|
76
|
+
var resizeObserver = new ResizeObserver(function (entries) {
|
|
77
|
+
if (entries.length === 1) {
|
|
78
|
+
handleMediaQueryLayout(entries[0].contentRect.width);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
resizeObserver.observe(containerRef.current);
|
|
82
|
+
};
|
|
83
|
+
var handleMediaQueryLayout = function (width) {
|
|
84
|
+
if (width <= 320) {
|
|
85
|
+
setMediaQueryLayout("centerContent");
|
|
86
|
+
} else {
|
|
87
|
+
setMediaQueryLayout("");
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
var marginTop = function () {
|
|
91
|
+
if (hidden && containerRef.current) {
|
|
92
|
+
return -containerRef.current.clientHeight + "px";
|
|
93
|
+
}
|
|
94
|
+
return "0";
|
|
95
|
+
};
|
|
96
|
+
if (removed) {
|
|
97
|
+
return React__default.default.createElement(React__default.default.Fragment, null);
|
|
98
|
+
}
|
|
99
|
+
var componentIsMobile = mediaQueryLayout.includes("centerContent");
|
|
100
|
+
return React__default.default.createElement("div", {
|
|
101
|
+
className: classnames__default.default(GuidanceBlock_module.banner, variant && GuidanceBlock_module[variant], layout && GuidanceBlock_module[layout], hidden && GuidanceBlock_module.hidden, mediaQueryLayout === "centerContent" && GuidanceBlock_module.centerContent, noMaxWidth && GuidanceBlock_module.noMaxWidth, illustrationType === "scene" && GuidanceBlock_module.hasSceneIllustration, smallScreenTextAlignment === "left" && GuidanceBlock_module.smallScreenTextAlignment),
|
|
102
|
+
style: {
|
|
103
|
+
marginTop: marginTop()
|
|
104
|
+
},
|
|
105
|
+
ref: containerRef,
|
|
106
|
+
onTransitionEnd: onTransitionEnd
|
|
107
|
+
}, React__default.default.createElement("div", {
|
|
108
|
+
className: GuidanceBlock_module.illustrationWrapper
|
|
109
|
+
}, React__default.default.createElement("div", {
|
|
110
|
+
className: GuidanceBlock_module.illustration
|
|
111
|
+
}, illustrationType === "scene" ? React__default.default.cloneElement(illustration, {
|
|
112
|
+
enableAspectRatio: true
|
|
113
|
+
}) : illustration)), React__default.default.createElement("div", {
|
|
114
|
+
className: GuidanceBlock_module.descriptionAndActions
|
|
115
|
+
}, React__default.default.createElement("div", {
|
|
116
|
+
className: GuidanceBlock_module.descriptionContainer
|
|
117
|
+
}, "content" in restProps && restProps.content, "text" in restProps && React__default.default.createElement(React__default.default.Fragment, null, React__default.default.createElement("div", {
|
|
118
|
+
className: GuidanceBlock_module.headingWrapper
|
|
119
|
+
}, React__default.default.createElement(Heading.Heading, {
|
|
120
|
+
tag: (_c = (_b = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _b === void 0 ? void 0 : _b.titleTag) !== null && _c !== void 0 ? _c : "h3",
|
|
121
|
+
variant: "heading-3"
|
|
122
|
+
}, (_d = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _d === void 0 ? void 0 : _d.title)), React__default.default.createElement(Text.Text, {
|
|
123
|
+
tag: "p",
|
|
124
|
+
variant: "body"
|
|
125
|
+
}, (_e = restProps === null || restProps === void 0 ? void 0 : restProps.text) === null || _e === void 0 ? void 0 : _e.description))), (actions === null || actions === void 0 ? void 0 : actions.primary) && React__default.default.createElement(Media__default.default, {
|
|
126
|
+
query: "(max-width: 767px)"
|
|
127
|
+
}, function (isMobile) {
|
|
128
|
+
var _a;
|
|
129
|
+
return React__default.default.createElement("div", {
|
|
130
|
+
className: classnames__default.default({
|
|
131
|
+
noRightMargin: isMobile || componentIsMobile,
|
|
132
|
+
rightMargin: !(isMobile || componentIsMobile) && layout === "default"
|
|
133
|
+
})
|
|
134
|
+
}, React__default.default.createElement("div", {
|
|
135
|
+
className: classnames__default.default(GuidanceBlock_module.buttonContainer, (actions === null || actions === void 0 ? void 0 : actions.secondary) && GuidanceBlock_module.secondaryAction)
|
|
136
|
+
}, React__default.default.createElement(WithTooltip, {
|
|
137
|
+
tooltipProps: actions.primary.tooltip
|
|
138
|
+
}, React__default.default.createElement(Button.Button, tslib.__assign({
|
|
139
|
+
icon: withActionButtonArrow ? React__default.default.createElement(ArrowForwardIcon.ArrowForwardIcon, {
|
|
140
|
+
role: "presentation"
|
|
141
|
+
}) : undefined,
|
|
142
|
+
iconPosition: "end"
|
|
143
|
+
}, actions.primary, {
|
|
144
|
+
fullWidth: isMobile || componentIsMobile
|
|
145
|
+
}))), (actions === null || actions === void 0 ? void 0 : actions.secondary) && React__default.default.createElement(WithTooltip, {
|
|
146
|
+
tooltipProps: actions.secondary.tooltip
|
|
147
|
+
}, React__default.default.createElement("div", {
|
|
148
|
+
className: GuidanceBlock_module.secondaryAction
|
|
149
|
+
}, React__default.default.createElement(Button.Button, tslib.__assign({
|
|
150
|
+
secondary: true
|
|
151
|
+
}, actions.secondary, {
|
|
152
|
+
onClick: secondaryDismiss ? function () {
|
|
153
|
+
return handleDismissBanner();
|
|
154
|
+
} : (_a = actions === null || actions === void 0 ? void 0 : actions.secondary) === null || _a === void 0 ? void 0 : _a.onClick,
|
|
155
|
+
fullWidth: isMobile || componentIsMobile
|
|
156
|
+
}))))));
|
|
157
|
+
})));
|
|
158
|
+
};
|
|
159
|
+
GuidanceBlock.displayName = "GuidanceBlock";
|
|
160
|
+
exports.GuidanceBlock = GuidanceBlock;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var styles = {
|
|
4
|
+
"rightMargin": "GuidanceBlock-module_rightMargin__gIzig",
|
|
5
|
+
"noRightMargin": "GuidanceBlock-module_noRightMargin__xtPiX",
|
|
6
|
+
"banner": "GuidanceBlock-module_banner__ng6kh",
|
|
7
|
+
"noMaxWidth": "GuidanceBlock-module_noMaxWidth__V-DbD",
|
|
8
|
+
"illustrationWrapper": "GuidanceBlock-module_illustrationWrapper__-rRYc",
|
|
9
|
+
"illustration": "GuidanceBlock-module_illustration__LpEwu",
|
|
10
|
+
"hasSceneIllustration": "GuidanceBlock-module_hasSceneIllustration__HxwOA",
|
|
11
|
+
"descriptionContainer": "GuidanceBlock-module_descriptionContainer__N1EEi",
|
|
12
|
+
"descriptionAndActions": "GuidanceBlock-module_descriptionAndActions__D206m",
|
|
13
|
+
"buttonContainer": "GuidanceBlock-module_buttonContainer__w3vEh",
|
|
14
|
+
"hidden": "GuidanceBlock-module_hidden__hgakl",
|
|
15
|
+
"headingWrapper": "GuidanceBlock-module_headingWrapper__xqjf-",
|
|
16
|
+
"cancel": "GuidanceBlock-module_cancel__0lcBe",
|
|
17
|
+
"icon": "GuidanceBlock-module_icon__XVKkH",
|
|
18
|
+
"disabled": "GuidanceBlock-module_disabled__tbZPh",
|
|
19
|
+
"hover": "GuidanceBlock-module_hover__vs7Wu",
|
|
20
|
+
"active": "GuidanceBlock-module_active__eJu5N",
|
|
21
|
+
"default": "GuidanceBlock-module_default__W7fnR",
|
|
22
|
+
"expert-advice": "GuidanceBlock-module_expert-advice__uGg7D",
|
|
23
|
+
"inline": "GuidanceBlock-module_inline__DC0LQ",
|
|
24
|
+
"stacked": "GuidanceBlock-module_stacked__2SSuH",
|
|
25
|
+
"centerContent": "GuidanceBlock-module_centerContent__pS9uQ",
|
|
26
|
+
"smallScreenTextAlignment": "GuidanceBlock-module_smallScreenTextAlignment__iaw5d"
|
|
27
|
+
};
|
|
28
|
+
module.exports = styles;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -60,7 +60,6 @@ var getTruncatedLabel = require('./Filter/FilterMultiSelect/utils/getTruncatedLa
|
|
|
60
60
|
var getSelectedOptionLabels = require('./Filter/FilterMultiSelect/utils/getSelectedOptionLabels.cjs');
|
|
61
61
|
var getSelectedOptionKeys = require('./Filter/FilterMultiSelect/utils/getSelectedOptionKeys.cjs');
|
|
62
62
|
var FilterSelect = require('./Filter/FilterSelect/FilterSelect.cjs');
|
|
63
|
-
var GuidanceBlock = require('./GuidanceBlock/GuidanceBlock.cjs');
|
|
64
63
|
var Heading = require('./Heading/Heading.cjs');
|
|
65
64
|
var AcademyIcon = require('./Icon/AcademyIcon.cjs');
|
|
66
65
|
var ActionOffIcon = require('./Icon/ActionOffIcon.cjs');
|
|
@@ -410,6 +409,7 @@ var index = require('./__overlays__/Tooltip/v1/index.cjs');
|
|
|
410
409
|
var index$1 = require('./__actions__/Menu/v1/index.cjs');
|
|
411
410
|
var Button = require('./__actions__/Button/v1/Button/Button.cjs');
|
|
412
411
|
var IconButton = require('./__actions__/Button/v1/IconButton/IconButton.cjs');
|
|
412
|
+
var GuidanceBlock = require('./__containers__/GuidanceBlock/v1/GuidanceBlock.cjs');
|
|
413
413
|
function _interopNamespace(e) {
|
|
414
414
|
if (e && e.__esModule) return e;
|
|
415
415
|
var n = Object.create(null);
|
|
@@ -503,7 +503,6 @@ exports.getTruncatedLabels = getTruncatedLabel.getTruncatedLabels;
|
|
|
503
503
|
exports.getSelectedOptionLabels = getSelectedOptionLabels.getSelectedOptionLabels;
|
|
504
504
|
exports.getSelectedOptionKeys = getSelectedOptionKeys.getSelectedOptionKeys;
|
|
505
505
|
exports.FilterSelect = FilterSelect.FilterSelect;
|
|
506
|
-
exports.GuidanceBlock = GuidanceBlock.GuidanceBlock;
|
|
507
506
|
exports.Heading = Heading.Heading;
|
|
508
507
|
exports.AcademyIcon = AcademyIcon.AcademyIcon;
|
|
509
508
|
exports.ActionOffIcon = ActionOffIcon.ActionOffIcon;
|
|
@@ -1044,3 +1043,4 @@ exports.MenuList = index$1.MenuList;
|
|
|
1044
1043
|
exports.StatelessMenu = index$1.StatelessMenu;
|
|
1045
1044
|
exports.Button = Button.Button;
|
|
1046
1045
|
exports.IconButton = IconButton.IconButton;
|
|
1046
|
+
exports.GuidanceBlock = GuidanceBlock.GuidanceBlock;
|
|
@@ -15,6 +15,7 @@ import { Button } from '../__actions__/Button/v1/Button/Button.mjs';
|
|
|
15
15
|
const BrandMoment = /*#__PURE__*/function () {
|
|
16
16
|
const BrandMoment = function (_a) {
|
|
17
17
|
var mood = _a.mood,
|
|
18
|
+
variant = _a.variant,
|
|
18
19
|
illustration = _a.illustration,
|
|
19
20
|
header = _a.header,
|
|
20
21
|
body = _a.body,
|
|
@@ -22,10 +23,10 @@ const BrandMoment = /*#__PURE__*/function () {
|
|
|
22
23
|
secondaryAction = _a.secondaryAction,
|
|
23
24
|
text = _a.text,
|
|
24
25
|
classNameOverride = _a.classNameOverride,
|
|
25
|
-
restProps = __rest(_a, ["mood", "illustration", "header", "body", "primaryAction", "secondaryAction", "text", "classNameOverride"]);
|
|
26
|
+
restProps = __rest(_a, ["mood", "variant", "illustration", "header", "body", "primaryAction", "secondaryAction", "text", "classNameOverride"]);
|
|
26
27
|
var queries = useMediaQueries().queries;
|
|
27
28
|
return /*#__PURE__*/React.createElement("div", __assign({
|
|
28
|
-
className: classnames(styles.body, styles[mood], classNameOverride)
|
|
29
|
+
className: classnames(styles.body, variant ? styles[variant] : styles[mood], classNameOverride)
|
|
29
30
|
}, restProps), /*#__PURE__*/React.createElement("header", {
|
|
30
31
|
className: styles.header
|
|
31
32
|
}, header), /*#__PURE__*/React.createElement("main", {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"body": "BrandMoment-module_body__J4lls",
|
|
3
|
-
"informative": "BrandMoment-module_informative__Qvwcd",
|
|
4
3
|
"positive": "BrandMoment-module_positive__78wqJ",
|
|
5
4
|
"negative": "BrandMoment-module_negative__atXal",
|
|
5
|
+
"informative": "BrandMoment-module_informative__Qvwcd",
|
|
6
|
+
"success": "BrandMoment-module_success__v503M",
|
|
7
|
+
"warning": "BrandMoment-module_warning__dWih8",
|
|
6
8
|
"container": "BrandMoment-module_container__4ORHI",
|
|
7
9
|
"header": "BrandMoment-module_header__EAP5Q",
|
|
8
10
|
"main": "BrandMoment-module_main__cdWko",
|
package/dist/esm/Card/Card.mjs
CHANGED
|
@@ -12,15 +12,16 @@ const Card = /*#__PURE__*/function () {
|
|
|
12
12
|
var children = _a.children,
|
|
13
13
|
_b = _a.tag,
|
|
14
14
|
tag = _b === void 0 ? "div" : _b,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
variant = _a.variant,
|
|
16
|
+
_c = _a.color,
|
|
17
|
+
color = _c === void 0 ? "white" : _c,
|
|
17
18
|
_d = _a.isElevated,
|
|
18
19
|
isElevated = _d === void 0 ? false : _d,
|
|
19
20
|
classNameOverride = _a.classNameOverride,
|
|
20
|
-
props = __rest(_a, ["children", "tag", "variant", "isElevated", "classNameOverride"]);
|
|
21
|
-
var
|
|
22
|
-
return /*#__PURE__*/React.createElement(
|
|
23
|
-
className: classnames(styles.wrapper, styles[variant], classNameOverride, isElevated && styles.elevated)
|
|
21
|
+
props = __rest(_a, ["children", "tag", "variant", "color", "isElevated", "classNameOverride"]);
|
|
22
|
+
var Element = tag;
|
|
23
|
+
return /*#__PURE__*/React.createElement(Element, __assign({
|
|
24
|
+
className: classnames(styles.wrapper, variant ? styles[variant] : styles[color], classNameOverride, isElevated && styles.elevated)
|
|
24
25
|
}, props), children);
|
|
25
26
|
};
|
|
26
27
|
Card.displayName = "Card";
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
var styles = {
|
|
2
2
|
"wrapper": "Card-module_wrapper__h5MUx",
|
|
3
|
+
"elevated": "Card-module_elevated__m7z8s",
|
|
4
|
+
"blue": "Card-module_blue__3-ogH",
|
|
5
|
+
"gray": "Card-module_gray__laFe8",
|
|
6
|
+
"green": "Card-module_green__FOeLt",
|
|
7
|
+
"orange": "Card-module_orange__hIZPr",
|
|
8
|
+
"purple": "Card-module_purple__7tEwm",
|
|
9
|
+
"red": "Card-module_red__e6deN",
|
|
10
|
+
"white": "Card-module_white__HD1ph",
|
|
11
|
+
"yellow": "Card-module_yellow__j4aX-",
|
|
3
12
|
"default": "Card-module_default__MzW74",
|
|
4
13
|
"informative": "Card-module_informative__4yRSy",
|
|
5
14
|
"positive": "Card-module_positive__KvUqp",
|
|
6
15
|
"cautionary": "Card-module_cautionary__iMWR-",
|
|
7
16
|
"destructive": "Card-module_destructive__9wC8X",
|
|
8
17
|
"assertive": "Card-module_assertive__6d1GM",
|
|
9
|
-
"highlight": "Card-module_highlight__2GSL-"
|
|
10
|
-
"elevated": "Card-module_elevated__m7z8s"
|
|
18
|
+
"highlight": "Card-module_highlight__2GSL-"
|
|
11
19
|
};
|
|
12
20
|
export { styles as default };
|
|
@@ -4,14 +4,21 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { Heading } from '../Heading/Heading.mjs';
|
|
5
5
|
import '../Illustration/subcomponents/Base/Base.mjs';
|
|
6
6
|
import '../Illustration/Scene/BrandMomentCaptureIntro/BrandMomentCaptureIntro.mjs';
|
|
7
|
-
import { EmptyStatesPositive,
|
|
7
|
+
import { EmptyStatesPositive, EmptyStatesNegative, EmptyStatesInformative, EmptyStatesNeutral } from '../Illustration/Scene/Scene.mjs';
|
|
8
8
|
import { Text } from '../Text/Text.mjs';
|
|
9
9
|
import styles from './EmptyState.module.scss.mjs';
|
|
10
10
|
var ILLUSTRATIONS = {
|
|
11
|
+
success: EmptyStatesPositive,
|
|
12
|
+
warning: EmptyStatesNegative,
|
|
13
|
+
informative: EmptyStatesInformative,
|
|
14
|
+
"expert-advice": EmptyStatesNeutral,
|
|
15
|
+
/** @deprecated Replaced by success */
|
|
11
16
|
positive: EmptyStatesPositive,
|
|
17
|
+
/** @deprecated Replaced by expert-advice */
|
|
12
18
|
neutral: EmptyStatesNeutral,
|
|
19
|
+
/** @deprecated Replaced by warning */
|
|
13
20
|
negative: EmptyStatesNegative,
|
|
14
|
-
|
|
21
|
+
/** @deprecated Replaced by warning */
|
|
15
22
|
action: EmptyStatesNegative
|
|
16
23
|
};
|
|
17
24
|
/**
|
|
@@ -22,8 +29,9 @@ const EmptyState = /*#__PURE__*/function () {
|
|
|
22
29
|
const EmptyState = function (_a) {
|
|
23
30
|
var children = _a.children,
|
|
24
31
|
id = _a.id,
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
illustrationType = _a.illustrationType,
|
|
33
|
+
_b = _a.variant,
|
|
34
|
+
variant = _b === void 0 ? "informative" : _b,
|
|
27
35
|
_c = _a.layoutContext,
|
|
28
36
|
layoutContext = _c === void 0 ? "sidebarAndContent" : _c,
|
|
29
37
|
headingProps = _a.headingProps,
|
|
@@ -34,10 +42,10 @@ const EmptyState = /*#__PURE__*/function () {
|
|
|
34
42
|
_e = _a.loop,
|
|
35
43
|
loop = _e === void 0 ? false : _e,
|
|
36
44
|
classNameOverride = _a.classNameOverride,
|
|
37
|
-
props = __rest(_a, ["children", "id", "illustrationType", "layoutContext", "headingProps", "bodyText", "straightCorners", "isAnimated", "loop", "classNameOverride"]);
|
|
38
|
-
var IllustrationComponent = ILLUSTRATIONS[illustrationType];
|
|
45
|
+
props = __rest(_a, ["children", "id", "illustrationType", "variant", "layoutContext", "headingProps", "bodyText", "straightCorners", "isAnimated", "loop", "classNameOverride"]);
|
|
46
|
+
var IllustrationComponent = ILLUSTRATIONS[illustrationType !== null && illustrationType !== void 0 ? illustrationType : variant];
|
|
39
47
|
return /*#__PURE__*/React.createElement("div", __assign({
|
|
40
|
-
className: classnames(
|
|
48
|
+
className: classnames(styles.container, illustrationType ? styles[illustrationType] : styles[variant], styles[layoutContext], straightCorners && styles.straightCorners, classNameOverride),
|
|
41
49
|
id: id
|
|
42
50
|
}, props), /*#__PURE__*/React.createElement("div", {
|
|
43
51
|
className: styles.illustrationSide
|
|
@@ -7,7 +7,10 @@ var styles = {
|
|
|
7
7
|
"negative": "EmptyState-module_negative__e5ci6",
|
|
8
8
|
"action": "EmptyState-module_action__OdsgJ",
|
|
9
9
|
"neutral": "EmptyState-module_neutral__L6fBb",
|
|
10
|
+
"success": "EmptyState-module_success__y7jKP",
|
|
11
|
+
"warning": "EmptyState-module_warning__-PrRp",
|
|
10
12
|
"informative": "EmptyState-module_informative__x0GSr",
|
|
13
|
+
"expert-advice": "EmptyState-module_expert-advice__VVB8i",
|
|
11
14
|
"illustrationSide": "EmptyState-module_illustrationSide__ZSjF3",
|
|
12
15
|
"textSide": "EmptyState-module_textSide__tv54w",
|
|
13
16
|
"illustration": "EmptyState-module_illustration__HyD2k",
|
|
@@ -60,7 +60,7 @@ const ErrorPage = /*#__PURE__*/function () {
|
|
|
60
60
|
isAnimated: true,
|
|
61
61
|
loop: true
|
|
62
62
|
}),
|
|
63
|
-
|
|
63
|
+
variant: "warning",
|
|
64
64
|
primaryAction: __assign(__assign({}, actions.primary), {
|
|
65
65
|
icon: /*#__PURE__*/React.createElement(ArrowRightIcon, {
|
|
66
66
|
role: "presentation"
|
|
@@ -18,8 +18,8 @@ import { ModalHeader } from '../GenericModal/subcomponents/ModalHeader/ModalHead
|
|
|
18
18
|
import { ModalAccessibleLabel } from '../GenericModal/subcomponents/ModalAccessibleLabel/ModalAccessibleLabel.mjs';
|
|
19
19
|
import { ModalBody } from '../GenericModal/subcomponents/ModalBody/ModalBody.mjs';
|
|
20
20
|
import styles from './ConfirmationModal.module.scss.mjs';
|
|
21
|
-
var getIcon = function (
|
|
22
|
-
switch (
|
|
21
|
+
var getIcon = function (variantName, isProminent) {
|
|
22
|
+
switch (variantName) {
|
|
23
23
|
case "cautionary":
|
|
24
24
|
return isProminent ? ( /*#__PURE__*/React.createElement(Cautionary, null)) : ( /*#__PURE__*/React.createElement(CautionWhiteIcon, {
|
|
25
25
|
inheritSize: true,
|
|
@@ -31,11 +31,13 @@ var getIcon = function (mood, isProminent) {
|
|
|
31
31
|
role: "presentation"
|
|
32
32
|
}));
|
|
33
33
|
case "negative":
|
|
34
|
+
case "warning":
|
|
34
35
|
return isProminent ? ( /*#__PURE__*/React.createElement(Negative, null)) : ( /*#__PURE__*/React.createElement(ExclamationWhiteIcon, {
|
|
35
36
|
inheritSize: true,
|
|
36
37
|
role: "presentation"
|
|
37
38
|
}));
|
|
38
39
|
case "positive":
|
|
40
|
+
case "success":
|
|
39
41
|
return isProminent ? ( /*#__PURE__*/React.createElement(Positive, null)) : ( /*#__PURE__*/React.createElement(SuccessWhiteIcon, {
|
|
40
42
|
inheritSize: true,
|
|
41
43
|
role: "presentation"
|
|
@@ -59,6 +61,7 @@ const ConfirmationModal = /*#__PURE__*/function () {
|
|
|
59
61
|
_c = _a.unpadded,
|
|
60
62
|
unpadded = _c === void 0 ? false : _c,
|
|
61
63
|
mood = _a.mood,
|
|
64
|
+
variant = _a.variant,
|
|
62
65
|
title = _a.title,
|
|
63
66
|
onConfirm = _a.onConfirm,
|
|
64
67
|
onAfterLeave = _a.onAfterLeave,
|
|
@@ -70,7 +73,8 @@ const ConfirmationModal = /*#__PURE__*/function () {
|
|
|
70
73
|
confirmWorking = _a.confirmWorking,
|
|
71
74
|
propsOnDismiss = _a.onDismiss,
|
|
72
75
|
children = _a.children,
|
|
73
|
-
props = __rest(_a, ["isOpen", "isProminent", "unpadded", "mood", "title", "onConfirm", "onAfterLeave", "onAfterEnter", "confirmLabel", "dismissLabel", "confirmWorking", "onDismiss", "children"]);
|
|
76
|
+
props = __rest(_a, ["isOpen", "isProminent", "unpadded", "mood", "variant", "title", "onConfirm", "onAfterLeave", "onAfterEnter", "confirmLabel", "dismissLabel", "confirmWorking", "onDismiss", "children"]);
|
|
77
|
+
var variantName = variant || mood;
|
|
74
78
|
var onDismiss = confirmWorking ? undefined : propsOnDismiss;
|
|
75
79
|
var footerActions = [];
|
|
76
80
|
if (onConfirm) {
|
|
@@ -102,12 +106,12 @@ const ConfirmationModal = /*#__PURE__*/function () {
|
|
|
102
106
|
}, props), /*#__PURE__*/React.createElement(ModalHeader, {
|
|
103
107
|
onDismiss: onDismiss
|
|
104
108
|
}, /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: classnames(styles.header, styles["".concat(mood, "Header")], isProminent && styles.prominent, !unpadded && styles.padded)
|
|
109
|
+
className: classnames(styles.header, variant ? styles[variant] : styles["".concat(mood, "Header")], isProminent && styles.prominent, !unpadded && styles.padded)
|
|
106
110
|
}, /*#__PURE__*/React.createElement("div", {
|
|
107
111
|
className: classnames(styles.iconContainer, isProminent && styles.prominent)
|
|
108
112
|
}, /*#__PURE__*/React.createElement("div", {
|
|
109
113
|
className: styles.spotIcon
|
|
110
|
-
}, getIcon(
|
|
114
|
+
}, getIcon(variantName, isProminent))), /*#__PURE__*/React.createElement(ModalAccessibleLabel, {
|
|
111
115
|
isProminent: isProminent
|
|
112
116
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
113
117
|
tag: "h2",
|
|
@@ -13,15 +13,19 @@ var styles = {
|
|
|
13
13
|
"unscrollable": "ConfirmationModal-module_unscrollable__wg2AZ",
|
|
14
14
|
"pseudoScrollbar": "ConfirmationModal-module_pseudoScrollbar__NqMuT",
|
|
15
15
|
"hide": "ConfirmationModal-module_hide__jOdWV",
|
|
16
|
+
"spotIcon": "ConfirmationModal-module_spotIcon__rFSHQ",
|
|
16
17
|
"header": "ConfirmationModal-module_header__Ooy23",
|
|
17
18
|
"padded": "ConfirmationModal-module_padded__nGa2-",
|
|
18
19
|
"iconContainer": "ConfirmationModal-module_iconContainer__QjdGa",
|
|
20
|
+
"prominent": "ConfirmationModal-module_prominent__8-gkP",
|
|
19
21
|
"positiveHeader": "ConfirmationModal-module_positiveHeader__8Dmja",
|
|
20
|
-
"spotIcon": "ConfirmationModal-module_spotIcon__rFSHQ",
|
|
21
22
|
"informativeHeader": "ConfirmationModal-module_informativeHeader__lTv94",
|
|
22
23
|
"negativeHeader": "ConfirmationModal-module_negativeHeader__Pmob9",
|
|
23
24
|
"assertiveHeader": "ConfirmationModal-module_assertiveHeader__3chNK",
|
|
24
25
|
"cautionaryHeader": "ConfirmationModal-module_cautionaryHeader__ZnE4P",
|
|
25
|
-
"
|
|
26
|
+
"success": "ConfirmationModal-module_success__4feh-",
|
|
27
|
+
"informative": "ConfirmationModal-module_informative__-kOIo",
|
|
28
|
+
"warning": "ConfirmationModal-module_warning__QlnBO",
|
|
29
|
+
"cautionary": "ConfirmationModal-module_cautionary__AJSCG"
|
|
26
30
|
};
|
|
27
31
|
export { styles as default };
|
|
@@ -5,11 +5,10 @@ var ToastNotification = function (_a) {
|
|
|
5
5
|
var propsId = _a.id,
|
|
6
6
|
_b = _a.hideCloseIcon,
|
|
7
7
|
hideCloseIcon = _b === void 0 ? false : _b,
|
|
8
|
-
type = _a.type,
|
|
9
8
|
title = _a.title,
|
|
10
9
|
onHide = _a.onHide,
|
|
11
10
|
children = _a.children,
|
|
12
|
-
restProps = __rest(_a, ["id", "hideCloseIcon", "
|
|
11
|
+
restProps = __rest(_a, ["id", "hideCloseIcon", "title", "onHide", "children"]);
|
|
13
12
|
var reactId = useId();
|
|
14
13
|
var id = propsId || reactId;
|
|
15
14
|
var addToastNotification = useToastNotificationContext().addToastNotification;
|
|
@@ -17,7 +16,6 @@ var ToastNotification = function (_a) {
|
|
|
17
16
|
useEffect(function () {
|
|
18
17
|
addToastNotification(__assign({
|
|
19
18
|
id: id,
|
|
20
|
-
type: type,
|
|
21
19
|
title: title,
|
|
22
20
|
message: children,
|
|
23
21
|
persistent: persistent,
|
|
@@ -12,16 +12,14 @@ const ToastNotificationsMap = /*#__PURE__*/function () {
|
|
|
12
12
|
// this list cannot render with a container (must be portalled into one).
|
|
13
13
|
return /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(React.Fragment, null, notifications.map(function (_a) {
|
|
14
14
|
var id = _a.id,
|
|
15
|
-
type = _a.type,
|
|
16
15
|
title = _a.title,
|
|
17
16
|
persistent = _a.persistent,
|
|
18
17
|
onHide = _a.onHide,
|
|
19
18
|
message = _a.message,
|
|
20
|
-
restProps = __rest(_a, ["id", "
|
|
19
|
+
restProps = __rest(_a, ["id", "title", "persistent", "onHide", "message"]);
|
|
21
20
|
return /*#__PURE__*/React.createElement(GenericNotification, __assign({
|
|
22
21
|
key: id,
|
|
23
22
|
style: "toast",
|
|
24
|
-
type: type,
|
|
25
23
|
title: title,
|
|
26
24
|
persistent: persistent,
|
|
27
25
|
onHide: function () {
|
|
@@ -3,11 +3,12 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { CancelButton } from '../CancelButton/CancelButton.mjs';
|
|
5
5
|
import { NotificationHeading } from '../NotificationHeading/NotificationHeading.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { NotificationIconType, NotificationIconVariant } from '../NotificationIcon/NotificationIcon.mjs';
|
|
7
7
|
import styles from './GenericNotification.module.scss.mjs';
|
|
8
8
|
const GenericNotification = /*#__PURE__*/function () {
|
|
9
9
|
const GenericNotification = function (_a) {
|
|
10
10
|
var type = _a.type,
|
|
11
|
+
variant = _a.variant,
|
|
11
12
|
style = _a.style,
|
|
12
13
|
children = _a.children,
|
|
13
14
|
title = _a.title,
|
|
@@ -18,7 +19,7 @@ const GenericNotification = /*#__PURE__*/function () {
|
|
|
18
19
|
forceMultiline = _a.forceMultiline,
|
|
19
20
|
headingProps = _a.headingProps,
|
|
20
21
|
classNameOverride = _a.classNameOverride,
|
|
21
|
-
restProps = __rest(_a, ["type", "style", "children", "title", "persistent", "onHide", "noBottomMargin", "forceMultiline", "headingProps", "classNameOverride"]);
|
|
22
|
+
restProps = __rest(_a, ["type", "variant", "style", "children", "title", "persistent", "onHide", "noBottomMargin", "forceMultiline", "headingProps", "classNameOverride"]);
|
|
22
23
|
var _c = useState(true),
|
|
23
24
|
isHidden = _c[0],
|
|
24
25
|
setIsHidden = _c[1];
|
|
@@ -51,16 +52,18 @@ const GenericNotification = /*#__PURE__*/function () {
|
|
|
51
52
|
}
|
|
52
53
|
return /*#__PURE__*/React.createElement("div", __assign({
|
|
53
54
|
ref: containerRef,
|
|
54
|
-
className: classnames(styles.notification, styles[type], styles[style], isHidden && styles.hidden, noBottomMargin && styles.noBottomMargin, classNameOverride, persistent && styles.persistent),
|
|
55
|
+
className: classnames(styles.notification, variant ? styles[variant] : styles[type], styles[style], isHidden && styles.hidden, noBottomMargin && styles.noBottomMargin, classNameOverride, persistent && styles.persistent),
|
|
55
56
|
style: {
|
|
56
57
|
marginTop: getMarginTop()
|
|
57
58
|
},
|
|
58
59
|
onTransitionEnd: onTransitionEnd
|
|
59
60
|
}, restProps), /*#__PURE__*/React.createElement("div", {
|
|
60
61
|
className: styles.icon
|
|
61
|
-
}, /*#__PURE__*/React.createElement(
|
|
62
|
+
}, type ? ( /*#__PURE__*/React.createElement(NotificationIconType, {
|
|
62
63
|
type: type
|
|
63
|
-
}))
|
|
64
|
+
})) : ( /*#__PURE__*/React.createElement(NotificationIconVariant, {
|
|
65
|
+
variant: variant
|
|
66
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
64
67
|
className: classnames(styles.textContainer, forceMultiline && styles.forceMultiline)
|
|
65
68
|
}, style !== "global" && ( /*#__PURE__*/React.createElement(NotificationHeading, {
|
|
66
69
|
titleProp: title,
|
package/dist/esm/Notification/subcomponents/GenericNotification/GenericNotification.module.scss.mjs
CHANGED
|
@@ -4,8 +4,6 @@ var styles = {
|
|
|
4
4
|
"toast": "GenericNotification-module_toast__GOVfC",
|
|
5
5
|
"global": "GenericNotification-module_global__Weka-",
|
|
6
6
|
"positive": "GenericNotification-module_positive__U-3HK",
|
|
7
|
-
"informative": "GenericNotification-module_informative__WLimi",
|
|
8
|
-
"cautionary": "GenericNotification-module_cautionary__lneFu",
|
|
9
7
|
"security": "GenericNotification-module_security__QTALa",
|
|
10
8
|
"negative": "GenericNotification-module_negative__lUWhD",
|
|
11
9
|
"hidden": "GenericNotification-module_hidden__WJjct",
|
|
@@ -22,6 +20,10 @@ var styles = {
|
|
|
22
20
|
"hover": "GenericNotification-module_hover__hUURd",
|
|
23
21
|
"active": "GenericNotification-module_active__-6ahb",
|
|
24
22
|
"cancelLabel": "GenericNotification-module_cancelLabel__HJzsk",
|
|
25
|
-
"notificationTitle": "GenericNotification-module_notificationTitle__Oaqb8"
|
|
23
|
+
"notificationTitle": "GenericNotification-module_notificationTitle__Oaqb8",
|
|
24
|
+
"success": "GenericNotification-module_success__oLGIP",
|
|
25
|
+
"informative": "GenericNotification-module_informative__WLimi",
|
|
26
|
+
"cautionary": "GenericNotification-module_cautionary__lneFu",
|
|
27
|
+
"warning": "GenericNotification-module_warning__7275P"
|
|
26
28
|
};
|
|
27
29
|
export { styles as default };
|
|
@@ -4,8 +4,8 @@ import { ExclamationIcon } from '../../../Icon/ExclamationIcon.mjs';
|
|
|
4
4
|
import { InformationIcon } from '../../../Icon/InformationIcon.mjs';
|
|
5
5
|
import { SecurityTipIcon } from '../../../Icon/SecurityTipIcon.mjs';
|
|
6
6
|
import { SuccessIcon } from '../../../Icon/SuccessIcon.mjs';
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const NotificationIconType = /*#__PURE__*/function () {
|
|
8
|
+
const NotificationIconType = function (_a) {
|
|
9
9
|
var type = _a.type;
|
|
10
10
|
switch (type) {
|
|
11
11
|
case "positive":
|
|
@@ -40,7 +40,41 @@ const NotificationIcon = /*#__PURE__*/function () {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
|
|
44
|
-
return
|
|
43
|
+
NotificationIconType.displayName = "NotificationIconType";
|
|
44
|
+
return NotificationIconType;
|
|
45
45
|
}();
|
|
46
|
-
|
|
46
|
+
const NotificationIconVariant = /*#__PURE__*/function () {
|
|
47
|
+
const NotificationIconVariant = function (_a) {
|
|
48
|
+
var variant = _a.variant;
|
|
49
|
+
switch (variant) {
|
|
50
|
+
case "success":
|
|
51
|
+
return /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
52
|
+
role: "presentation",
|
|
53
|
+
inheritSize: true
|
|
54
|
+
});
|
|
55
|
+
case "warning":
|
|
56
|
+
return /*#__PURE__*/React.createElement(ExclamationIcon, {
|
|
57
|
+
role: "presentation",
|
|
58
|
+
inheritSize: true
|
|
59
|
+
});
|
|
60
|
+
case "cautionary":
|
|
61
|
+
return /*#__PURE__*/React.createElement(CautionIcon, {
|
|
62
|
+
role: "presentation",
|
|
63
|
+
inheritSize: true
|
|
64
|
+
});
|
|
65
|
+
case "informative":
|
|
66
|
+
return /*#__PURE__*/React.createElement(InformationIcon, {
|
|
67
|
+
role: "presentation",
|
|
68
|
+
inheritSize: true
|
|
69
|
+
});
|
|
70
|
+
case "security":
|
|
71
|
+
return /*#__PURE__*/React.createElement(SecurityTipIcon, {
|
|
72
|
+
role: "presentation",
|
|
73
|
+
inheritSize: true
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
NotificationIconVariant.displayName = "NotificationIconVariant";
|
|
78
|
+
return NotificationIconVariant;
|
|
79
|
+
}();
|
|
80
|
+
export { NotificationIconType, NotificationIconVariant };
|