@dhis2-ui/alert 9.3.0-alpha.1 → 9.3.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/build/cjs/alert-bar/action.js +3 -3
- package/build/cjs/alert-bar/actions.js +3 -3
- package/build/cjs/alert-bar/alert-bar.stories.js +1 -18
- package/build/cjs/alert-bar/alert-bar.styles.js +2 -2
- package/build/cjs/alert-bar/dismiss.js +3 -3
- package/build/cjs/alert-bar/icon.js +3 -3
- package/build/cjs/alert-stack/alert-stack.js +3 -3
- package/build/cjs/alert-stack/alert-stack.stories.js +4 -31
- package/build/es/alert-bar/action.js +3 -3
- package/build/es/alert-bar/actions.js +3 -3
- package/build/es/alert-bar/alert-bar.stories.js +0 -14
- package/build/es/alert-bar/alert-bar.styles.js +2 -2
- package/build/es/alert-bar/dismiss.js +3 -3
- package/build/es/alert-bar/icon.js +3 -3
- package/build/es/alert-stack/alert-stack.js +3 -3
- package/build/es/alert-stack/alert-stack.stories.js +2 -24
- package/package.json +4 -4
@@ -35,11 +35,11 @@ class Action extends _react.Component {
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement("span", {
|
36
36
|
onClick: this.onClick,
|
37
37
|
"data-test": this.props.dataTest,
|
38
|
-
className: _style.default.dynamic([["
|
38
|
+
className: _style.default.dynamic([["445241221", [_uiConstants.spacers.dp12]]])
|
39
39
|
}, this.props.label, /*#__PURE__*/_react.default.createElement(_style.default, {
|
40
|
-
id: "
|
40
|
+
id: "445241221",
|
41
41
|
dynamic: [_uiConstants.spacers.dp12]
|
42
|
-
}, ["span.__jsx-style-dynamic-selector{margin-
|
42
|
+
}, ["span.__jsx-style-dynamic-selector{margin-right:".concat(_uiConstants.spacers.dp12, ";-webkit-text-decoration:underline;text-decoration:underline;white-space:nowrap;}"), "span.__jsx-style-dynamic-selector:hover{cursor:pointer;}"]));
|
43
43
|
}
|
44
44
|
|
45
45
|
}
|
@@ -33,16 +33,16 @@ const Actions = _ref => {
|
|
33
33
|
}
|
34
34
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
36
|
-
className: _style.default.dynamic([["
|
36
|
+
className: _style.default.dynamic([["961263490", [_uiConstants.spacers.dp48, _uiConstants.spacers.dp12]]])
|
37
37
|
}, actions.map(action => /*#__PURE__*/_react.default.createElement(_action.Action, _extends({
|
38
38
|
key: action.label
|
39
39
|
}, action, {
|
40
40
|
hide: hide,
|
41
41
|
dataTest: "".concat(dataTest, "-action")
|
42
42
|
}))), /*#__PURE__*/_react.default.createElement(_style.default, {
|
43
|
-
id: "
|
43
|
+
id: "961263490",
|
44
44
|
dynamic: [_uiConstants.spacers.dp48, _uiConstants.spacers.dp12]
|
45
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
45
|
+
}, ["div.__jsx-style-dynamic-selector{margin-left:".concat(_uiConstants.spacers.dp48, ";margin-right:-").concat(_uiConstants.spacers.dp12, ";}")]));
|
46
46
|
};
|
47
47
|
|
48
48
|
exports.Actions = Actions;
|
@@ -3,7 +3,7 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.default = exports.WithActionsAndInsufficientSpace = exports.WithActions = exports.TextOverflow = exports.States = exports.
|
6
|
+
exports.default = exports.WithActionsAndInsufficientSpace = exports.WithActions = exports.TextOverflow = exports.States = exports.Icons = exports.HiddenProp = exports.Default = exports.AutoHiding = void 0;
|
7
7
|
|
8
8
|
var _uiIcons = require("@dhis2/ui-icons");
|
9
9
|
|
@@ -104,23 +104,6 @@ const States = () => /*#__PURE__*/_react.default.createElement(_react.default.Fr
|
|
104
104
|
|
105
105
|
exports.States = States;
|
106
106
|
|
107
|
-
const RTL = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
108
|
-
dir: "rtl"
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
110
|
-
permanent: true
|
111
|
-
}, "Default (info)"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
112
|
-
permanent: true,
|
113
|
-
success: true
|
114
|
-
}, "Success"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
115
|
-
permanent: true,
|
116
|
-
warning: true
|
117
|
-
}, "Warning"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
118
|
-
permanent: true,
|
119
|
-
critical: true
|
120
|
-
}, "Critical")));
|
121
|
-
|
122
|
-
exports.RTL = RTL;
|
123
|
-
|
124
107
|
const AutoHiding = () => /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
125
108
|
permanent: true
|
126
109
|
}, "Permanent never auto-hides"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
@@ -9,7 +9,7 @@ var _uiConstants = require("@dhis2/ui-constants");
|
|
9
9
|
|
10
10
|
const ANIMATION_TIME = 350;
|
11
11
|
exports.ANIMATION_TIME = ANIMATION_TIME;
|
12
|
-
const _defaultExport = ["div.jsx-
|
13
|
-
_defaultExport.__hash = "
|
12
|
+
const _defaultExport = ["div.jsx-2593868549{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:4px;box-shadow:".concat(_uiConstants.elevations.e300, ";padding-top:").concat(_uiConstants.spacers.dp8, ";padding-right:").concat(_uiConstants.spacers.dp8, ";padding-bottom:").concat(_uiConstants.spacers.dp8, ";padding-left:").concat(_uiConstants.spacers.dp24, ";margin-bottom:").concat(_uiConstants.spacers.dp16, ";max-width:600px;min-width:300px;font-size:14px;pointer-events:all;}"), "div.info.jsx-2593868549{background-color:".concat(_uiConstants.colors.grey900, ";color:").concat(_uiConstants.colors.white, ";}"), "div.success.jsx-2593868549{background-color:".concat(_uiConstants.colors.green800, ";color:").concat(_uiConstants.colors.white, ";}"), "div.warning.jsx-2593868549{background-color:".concat(_uiConstants.colors.yellow300, ";color:").concat(_uiConstants.colors.yellow900, ";}"), "div.critical.jsx-2593868549{background-color:".concat(_uiConstants.colors.red800, ";color:").concat(_uiConstants.colors.white, ";}"), "@-webkit-keyframes slidein-jsx-2593868549{from{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}to{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@keyframes slidein-jsx-2593868549{from{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}to{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@-webkit-keyframes slideout-jsx-2593868549{from{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}to{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}}", "@keyframes slideout-jsx-2593868549{from{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}to{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}}", "div.inViewport.jsx-2593868549{-webkit-animation-duration:".concat(ANIMATION_TIME, "ms;animation-duration:").concat(ANIMATION_TIME, "ms;-webkit-animation-name:slidein-jsx-2593868549;animation-name:slidein-jsx-2593868549;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.6,1);animation-timing-function:cubic-bezier(0.4,0,0.6,1);}"), "div.jsx-2593868549{-webkit-animation-duration:".concat(ANIMATION_TIME, "ms;animation-duration:").concat(ANIMATION_TIME, "ms;-webkit-animation-name:slideout-jsx-2593868549;animation-name:slideout-jsx-2593868549;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.6,1);animation-timing-function:cubic-bezier(0.4,0,0.6,1);}")];
|
13
|
+
_defaultExport.__hash = "2593868549";
|
14
14
|
var _default = _defaultExport;
|
15
15
|
exports.default = _default;
|
@@ -25,11 +25,11 @@ const Dismiss = _ref => {
|
|
25
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
26
26
|
onClick: onClick,
|
27
27
|
"data-test": dataTest,
|
28
|
-
className: _style.default.dynamic([["
|
28
|
+
className: _style.default.dynamic([["489362409", [_uiConstants.spacers.dp16]]])
|
29
29
|
}, /*#__PURE__*/_react.default.createElement(_uiIcons.IconCross24, null), /*#__PURE__*/_react.default.createElement(_style.default, {
|
30
|
-
id: "
|
30
|
+
id: "489362409",
|
31
31
|
dynamic: [_uiConstants.spacers.dp16]
|
32
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
32
|
+
}, ["div.__jsx-style-dynamic-selector{margin-left:".concat(_uiConstants.spacers.dp16, ";min-height:32px;min-width:32px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;border-radius:5px;}"), "div.__jsx-style-dynamic-selector:hover{cursor:pointer;background:rgba(0,0,0,0.15);}", "div.__jsx-style-dynamic-selector:active{background:rgba(0,0,0,0.25);}", "div.__jsx-style-dynamic-selector svg{width:18px;height:18px;}"]));
|
33
33
|
};
|
34
34
|
|
35
35
|
exports.Dismiss = Dismiss;
|
@@ -82,16 +82,16 @@ const Icon = _ref2 => {
|
|
82
82
|
|
83
83
|
return /*#__PURE__*/_react.default.createElement("div", {
|
84
84
|
"data-test": dataTest,
|
85
|
-
className: _style.default.dynamic([["
|
85
|
+
className: _style.default.dynamic([["2057519855", [_uiConstants.spacers.dp16]]])
|
86
86
|
}, /*#__PURE__*/_react.default.isValidElement(icon) ? icon : /*#__PURE__*/_react.default.createElement(StatusIcon, {
|
87
87
|
valid: success,
|
88
88
|
error: critical,
|
89
89
|
warning: warning,
|
90
90
|
info: info
|
91
91
|
}), /*#__PURE__*/_react.default.createElement(_style.default, {
|
92
|
-
id: "
|
92
|
+
id: "2057519855",
|
93
93
|
dynamic: [_uiConstants.spacers.dp16]
|
94
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
94
|
+
}, ["div.__jsx-style-dynamic-selector{margin-right:".concat(_uiConstants.spacers.dp16, ";}")]));
|
95
95
|
};
|
96
96
|
|
97
97
|
exports.Icon = Icon;
|
@@ -27,11 +27,11 @@ const AlertStack = _ref => {
|
|
27
27
|
} = _ref;
|
28
28
|
return /*#__PURE__*/_react.default.createElement(_portal.Portal, null, /*#__PURE__*/_react.default.createElement("div", {
|
29
29
|
"data-test": dataTest,
|
30
|
-
className: _style.default.dynamic([["
|
30
|
+
className: _style.default.dynamic([["132471376", [_uiConstants.layers.alert]]]) + " " + ((0, _classnames.default)(className) || "")
|
31
31
|
}, children, /*#__PURE__*/_react.default.createElement(_style.default, {
|
32
|
-
id: "
|
32
|
+
id: "132471376",
|
33
33
|
dynamic: [_uiConstants.layers.alert]
|
34
|
-
}, ["div.__jsx-style-dynamic-selector{position:fixed;top:auto;
|
34
|
+
}, ["div.__jsx-style-dynamic-selector{position:fixed;top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);z-index:".concat(_uiConstants.layers.alert, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;pointer-events:none;}")])));
|
35
35
|
};
|
36
36
|
|
37
37
|
exports.AlertStack = AlertStack;
|
@@ -3,17 +3,15 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.default = exports.
|
6
|
+
exports.default = exports.Default = void 0;
|
7
7
|
|
8
|
-
var _react =
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
10
|
var _index = require("../alert-bar/index.js");
|
11
11
|
|
12
12
|
var _alertStack = require("./alert-stack.js");
|
13
13
|
|
14
|
-
function
|
15
|
-
|
16
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
17
15
|
|
18
16
|
const description = "\nA container for Alert Bars.\n\n_**Note:** The demos on this page may be slow._\n\n```js\nimport { AlertStack } from '@dhis2/ui'\n```\n";
|
19
17
|
var _default = {
|
@@ -45,29 +43,4 @@ const Default = args => /*#__PURE__*/_react.default.createElement(_alertStack.Al
|
|
45
43
|
success: true
|
46
44
|
}, "Fourth notification - I am at the top"));
|
47
45
|
|
48
|
-
exports.Default = Default;
|
49
|
-
|
50
|
-
const RTL = args => {
|
51
|
-
(0, _react.useEffect)(() => {
|
52
|
-
document.body.dir = 'rtl';
|
53
|
-
return () => {
|
54
|
-
document.body.dir = 'ltr';
|
55
|
-
};
|
56
|
-
}, []);
|
57
|
-
return /*#__PURE__*/_react.default.createElement("div", {
|
58
|
-
dir: "rtl"
|
59
|
-
}, /*#__PURE__*/_react.default.createElement(_alertStack.AlertStack, args, /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
60
|
-
permanent: true
|
61
|
-
}, "First notification - I am at the bottom"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
62
|
-
permanent: true,
|
63
|
-
critical: true
|
64
|
-
}, "Second notification"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
65
|
-
permanent: true,
|
66
|
-
warning: true
|
67
|
-
}, "Third notification"), /*#__PURE__*/_react.default.createElement(_index.AlertBar, {
|
68
|
-
permanent: true,
|
69
|
-
success: true
|
70
|
-
}, "Fourth notification - I am at the top")));
|
71
|
-
};
|
72
|
-
|
73
|
-
exports.RTL = RTL;
|
46
|
+
exports.Default = Default;
|
@@ -20,11 +20,11 @@ class Action extends Component {
|
|
20
20
|
return /*#__PURE__*/React.createElement("span", {
|
21
21
|
onClick: this.onClick,
|
22
22
|
"data-test": this.props.dataTest,
|
23
|
-
className: _JSXStyle.dynamic([["
|
23
|
+
className: _JSXStyle.dynamic([["445241221", [spacers.dp12]]])
|
24
24
|
}, this.props.label, /*#__PURE__*/React.createElement(_JSXStyle, {
|
25
|
-
id: "
|
25
|
+
id: "445241221",
|
26
26
|
dynamic: [spacers.dp12]
|
27
|
-
}, ["span.__jsx-style-dynamic-selector{margin-
|
27
|
+
}, ["span.__jsx-style-dynamic-selector{margin-right:".concat(spacers.dp12, ";-webkit-text-decoration:underline;text-decoration:underline;white-space:nowrap;}"), "span.__jsx-style-dynamic-selector:hover{cursor:pointer;}"]));
|
28
28
|
}
|
29
29
|
|
30
30
|
}
|
@@ -20,16 +20,16 @@ const Actions = _ref => {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
return /*#__PURE__*/React.createElement("div", {
|
23
|
-
className: _JSXStyle.dynamic([["
|
23
|
+
className: _JSXStyle.dynamic([["961263490", [spacers.dp48, spacers.dp12]]])
|
24
24
|
}, actions.map(action => /*#__PURE__*/React.createElement(Action, _extends({
|
25
25
|
key: action.label
|
26
26
|
}, action, {
|
27
27
|
hide: hide,
|
28
28
|
dataTest: "".concat(dataTest, "-action")
|
29
29
|
}))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
30
|
-
id: "
|
30
|
+
id: "961263490",
|
31
31
|
dynamic: [spacers.dp48, spacers.dp12]
|
32
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
32
|
+
}, ["div.__jsx-style-dynamic-selector{margin-left:".concat(spacers.dp48, ";margin-right:-").concat(spacers.dp12, ";}")]));
|
33
33
|
};
|
34
34
|
|
35
35
|
const actionsPropType = arrayWithLength(0, 2, PropTypes.shape({
|
@@ -82,20 +82,6 @@ export const States = () => /*#__PURE__*/React.createElement(React.Fragment, nul
|
|
82
82
|
permanent: true,
|
83
83
|
critical: true
|
84
84
|
}, "Critical"));
|
85
|
-
export const RTL = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
86
|
-
dir: "rtl"
|
87
|
-
}, /*#__PURE__*/React.createElement(AlertBar, {
|
88
|
-
permanent: true
|
89
|
-
}, "Default (info)"), /*#__PURE__*/React.createElement(AlertBar, {
|
90
|
-
permanent: true,
|
91
|
-
success: true
|
92
|
-
}, "Success"), /*#__PURE__*/React.createElement(AlertBar, {
|
93
|
-
permanent: true,
|
94
|
-
warning: true
|
95
|
-
}, "Warning"), /*#__PURE__*/React.createElement(AlertBar, {
|
96
|
-
permanent: true,
|
97
|
-
critical: true
|
98
|
-
}, "Critical")));
|
99
85
|
export const AutoHiding = () => /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AlertBar, {
|
100
86
|
permanent: true
|
101
87
|
}, "Permanent never auto-hides"), /*#__PURE__*/React.createElement(AlertBar, {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { colors, spacers, elevations } from '@dhis2/ui-constants';
|
2
2
|
export const ANIMATION_TIME = 350;
|
3
|
-
const _defaultExport = ["div.jsx-
|
4
|
-
_defaultExport.__hash = "
|
3
|
+
const _defaultExport = ["div.jsx-2593868549{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border-radius:4px;box-shadow:".concat(elevations.e300, ";padding-top:").concat(spacers.dp8, ";padding-right:").concat(spacers.dp8, ";padding-bottom:").concat(spacers.dp8, ";padding-left:").concat(spacers.dp24, ";margin-bottom:").concat(spacers.dp16, ";max-width:600px;min-width:300px;font-size:14px;pointer-events:all;}"), "div.info.jsx-2593868549{background-color:".concat(colors.grey900, ";color:").concat(colors.white, ";}"), "div.success.jsx-2593868549{background-color:".concat(colors.green800, ";color:").concat(colors.white, ";}"), "div.warning.jsx-2593868549{background-color:".concat(colors.yellow300, ";color:").concat(colors.yellow900, ";}"), "div.critical.jsx-2593868549{background-color:".concat(colors.red800, ";color:").concat(colors.white, ";}"), "@-webkit-keyframes slidein-jsx-2593868549{from{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}to{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@keyframes slidein-jsx-2593868549{from{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}to{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}}", "@-webkit-keyframes slideout-jsx-2593868549{from{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}to{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}}", "@keyframes slideout-jsx-2593868549{from{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}to{-webkit-transform:translateY(1000px);-ms-transform:translateY(1000px);transform:translateY(1000px);}}", "div.inViewport.jsx-2593868549{-webkit-animation-duration:".concat(ANIMATION_TIME, "ms;animation-duration:").concat(ANIMATION_TIME, "ms;-webkit-animation-name:slidein-jsx-2593868549;animation-name:slidein-jsx-2593868549;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.6,1);animation-timing-function:cubic-bezier(0.4,0,0.6,1);}"), "div.jsx-2593868549{-webkit-animation-duration:".concat(ANIMATION_TIME, "ms;animation-duration:").concat(ANIMATION_TIME, "ms;-webkit-animation-name:slideout-jsx-2593868549;animation-name:slideout-jsx-2593868549;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:cubic-bezier(0.4,0,0.6,1);animation-timing-function:cubic-bezier(0.4,0,0.6,1);}")];
|
4
|
+
_defaultExport.__hash = "2593868549";
|
5
5
|
export default _defaultExport;
|
@@ -12,11 +12,11 @@ const Dismiss = _ref => {
|
|
12
12
|
return /*#__PURE__*/React.createElement("div", {
|
13
13
|
onClick: onClick,
|
14
14
|
"data-test": dataTest,
|
15
|
-
className: _JSXStyle.dynamic([["
|
15
|
+
className: _JSXStyle.dynamic([["489362409", [spacers.dp16]]])
|
16
16
|
}, /*#__PURE__*/React.createElement(IconCross24, null), /*#__PURE__*/React.createElement(_JSXStyle, {
|
17
|
-
id: "
|
17
|
+
id: "489362409",
|
18
18
|
dynamic: [spacers.dp16]
|
19
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
19
|
+
}, ["div.__jsx-style-dynamic-selector{margin-left:".concat(spacers.dp16, ";min-height:32px;min-width:32px;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;border-radius:5px;}"), "div.__jsx-style-dynamic-selector:hover{cursor:pointer;background:rgba(0,0,0,0.15);}", "div.__jsx-style-dynamic-selector:active{background:rgba(0,0,0,0.25);}", "div.__jsx-style-dynamic-selector svg{width:18px;height:18px;}"]));
|
20
20
|
};
|
21
21
|
|
22
22
|
Dismiss.propTypes = {
|
@@ -68,16 +68,16 @@ const Icon = _ref2 => {
|
|
68
68
|
|
69
69
|
return /*#__PURE__*/React.createElement("div", {
|
70
70
|
"data-test": dataTest,
|
71
|
-
className: _JSXStyle.dynamic([["
|
71
|
+
className: _JSXStyle.dynamic([["2057519855", [spacers.dp16]]])
|
72
72
|
}, /*#__PURE__*/React.isValidElement(icon) ? icon : /*#__PURE__*/React.createElement(StatusIcon, {
|
73
73
|
valid: success,
|
74
74
|
error: critical,
|
75
75
|
warning: warning,
|
76
76
|
info: info
|
77
77
|
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
78
|
-
id: "
|
78
|
+
id: "2057519855",
|
79
79
|
dynamic: [spacers.dp16]
|
80
|
-
}, ["div.__jsx-style-dynamic-selector{margin-
|
80
|
+
}, ["div.__jsx-style-dynamic-selector{margin-right:".concat(spacers.dp16, ";}")]));
|
81
81
|
};
|
82
82
|
|
83
83
|
const iconPropType = PropTypes.oneOfType([PropTypes.bool, PropTypes.element]);
|
@@ -12,11 +12,11 @@ export const AlertStack = _ref => {
|
|
12
12
|
} = _ref;
|
13
13
|
return /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
|
14
14
|
"data-test": dataTest,
|
15
|
-
className: _JSXStyle.dynamic([["
|
15
|
+
className: _JSXStyle.dynamic([["132471376", [layers.alert]]]) + " " + (cx(className) || "")
|
16
16
|
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
17
|
-
id: "
|
17
|
+
id: "132471376",
|
18
18
|
dynamic: [layers.alert]
|
19
|
-
}, ["div.__jsx-style-dynamic-selector{position:fixed;top:auto;
|
19
|
+
}, ["div.__jsx-style-dynamic-selector{position:fixed;top:auto;right:auto;bottom:0;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);z-index:".concat(layers.alert, ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column-reverse;-ms-flex-direction:column-reverse;flex-direction:column-reverse;pointer-events:none;}")])));
|
20
20
|
};
|
21
21
|
AlertStack.defaultProps = {
|
22
22
|
dataTest: 'dhis2-uicore-alertstack'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
2
|
import { AlertBar } from '../alert-bar/index.js';
|
3
3
|
import { AlertStack } from './alert-stack.js';
|
4
4
|
const description = "\nA container for Alert Bars.\n\n_**Note:** The demos on this page may be slow._\n\n```js\nimport { AlertStack } from '@dhis2/ui'\n```\n";
|
@@ -27,26 +27,4 @@ export const Default = args => /*#__PURE__*/React.createElement(AlertStack, args
|
|
27
27
|
}, "Third notification"), /*#__PURE__*/React.createElement(AlertBar, {
|
28
28
|
permanent: true,
|
29
29
|
success: true
|
30
|
-
}, "Fourth notification - I am at the top"));
|
31
|
-
export const RTL = args => {
|
32
|
-
useEffect(() => {
|
33
|
-
document.body.dir = 'rtl';
|
34
|
-
return () => {
|
35
|
-
document.body.dir = 'ltr';
|
36
|
-
};
|
37
|
-
}, []);
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
39
|
-
dir: "rtl"
|
40
|
-
}, /*#__PURE__*/React.createElement(AlertStack, args, /*#__PURE__*/React.createElement(AlertBar, {
|
41
|
-
permanent: true
|
42
|
-
}, "First notification - I am at the bottom"), /*#__PURE__*/React.createElement(AlertBar, {
|
43
|
-
permanent: true,
|
44
|
-
critical: true
|
45
|
-
}, "Second notification"), /*#__PURE__*/React.createElement(AlertBar, {
|
46
|
-
permanent: true,
|
47
|
-
warning: true
|
48
|
-
}, "Third notification"), /*#__PURE__*/React.createElement(AlertBar, {
|
49
|
-
permanent: true,
|
50
|
-
success: true
|
51
|
-
}, "Fourth notification - I am at the top")));
|
52
|
-
};
|
30
|
+
}, "Fourth notification - I am at the top"));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dhis2-ui/alert",
|
3
|
-
"version": "9.3.0
|
3
|
+
"version": "9.3.0",
|
4
4
|
"description": "UI Alert",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -33,9 +33,9 @@
|
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
35
|
"@dhis2/prop-types": "^3.1.2",
|
36
|
-
"@dhis2-ui/portal": "9.3.0
|
37
|
-
"@dhis2/ui-constants": "9.3.0
|
38
|
-
"@dhis2/ui-icons": "9.3.0
|
36
|
+
"@dhis2-ui/portal": "9.3.0",
|
37
|
+
"@dhis2/ui-constants": "9.3.0",
|
38
|
+
"@dhis2/ui-icons": "9.3.0",
|
39
39
|
"classnames": "^2.3.1",
|
40
40
|
"prop-types": "^15.7.2"
|
41
41
|
},
|