@neo4j-ndl/react 4.23.4 → 4.24.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/lib/cjs/announcement-banner/AnnouncementBanner.js +198 -0
- package/lib/cjs/announcement-banner/AnnouncementBanner.js.map +1 -0
- package/lib/cjs/announcement-banner/index.js +38 -0
- package/lib/cjs/announcement-banner/index.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-closeable.story.js +30 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-closeable.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-custom-icons.story.js +31 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-custom-icons.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-default.story.js +30 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-default.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-injected-non-urgent.story.js +32 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-injected-non-urgent.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-injected-urgent.story.js +32 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-injected-urgent.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-present-at-page-render.story.js +30 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-present-at-page-render.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-variants.story.js +30 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-variants.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-with-actions.story.js +30 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-with-actions.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-with-page-content.story.js +32 -0
- package/lib/cjs/announcement-banner/stories/announcement-banner-with-page-content.story.js.map +1 -0
- package/lib/cjs/announcement-banner/stories/index.js +64 -0
- package/lib/cjs/announcement-banner/stories/index.js.map +1 -0
- package/lib/cjs/index.js +4 -2
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/text-input/TextInput.js +4 -3
- package/lib/cjs/text-input/TextInput.js.map +1 -1
- package/lib/esm/announcement-banner/AnnouncementBanner.js +159 -0
- package/lib/esm/announcement-banner/AnnouncementBanner.js.map +1 -0
- package/lib/esm/announcement-banner/index.js +22 -0
- package/lib/esm/announcement-banner/index.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-closeable.story.js +28 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-closeable.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-custom-icons.story.js +29 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-custom-icons.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-default.story.js +28 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-default.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-injected-non-urgent.story.js +30 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-injected-non-urgent.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-injected-urgent.story.js +30 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-injected-urgent.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-present-at-page-render.story.js +28 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-present-at-page-render.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-variants.story.js +28 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-variants.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-with-actions.story.js +28 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-with-actions.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-with-page-content.story.js +30 -0
- package/lib/esm/announcement-banner/stories/announcement-banner-with-page-content.story.js.map +1 -0
- package/lib/esm/announcement-banner/stories/index.js +49 -0
- package/lib/esm/announcement-banner/stories/index.js.map +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/text-input/TextInput.js +4 -3
- package/lib/esm/text-input/TextInput.js.map +1 -1
- package/lib/types/announcement-banner/AnnouncementBanner.d.ts +75 -0
- package/lib/types/announcement-banner/AnnouncementBanner.d.ts.map +1 -0
- package/lib/types/announcement-banner/index.d.ts +22 -0
- package/lib/types/announcement-banner/index.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-closeable.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-closeable.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-custom-icons.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-custom-icons.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-default.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-default.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-injected-non-urgent.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-injected-non-urgent.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-injected-urgent.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-injected-urgent.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-present-at-page-render.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-present-at-page-render.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-variants.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-variants.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-with-actions.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-with-actions.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/announcement-banner-with-page-content.story.d.ts +24 -0
- package/lib/types/announcement-banner/stories/announcement-banner-with-page-content.story.d.ts.map +1 -0
- package/lib/types/announcement-banner/stories/index.d.ts +39 -0
- package/lib/types/announcement-banner/stories/index.d.ts.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/text-input/TextInput.d.ts.map +1 -1
- package/package.json +7 -2
- package/skills/ndl-react/SKILL.md +3 -2
- package/skills/ndl-react/components/announcement-banner.md +468 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
36
|
+
var t = {};
|
|
37
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
38
|
+
t[p] = s[p];
|
|
39
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
40
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
42
|
+
t[p[i]] = s[p[i]];
|
|
43
|
+
}
|
|
44
|
+
return t;
|
|
45
|
+
};
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.AnnouncementBanner = void 0;
|
|
51
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) "Neo4j"
|
|
55
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
56
|
+
*
|
|
57
|
+
* This file is part of Neo4j.
|
|
58
|
+
*
|
|
59
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
60
|
+
* it under the terms of the GNU General Public License as published by
|
|
61
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
62
|
+
* (at your option) any later version.
|
|
63
|
+
*
|
|
64
|
+
* This program is distributed in the hope that it will be useful,
|
|
65
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
66
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
67
|
+
* GNU General Public License for more details.
|
|
68
|
+
*
|
|
69
|
+
* You should have received a copy of the GNU General Public License
|
|
70
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
71
|
+
*/
|
|
72
|
+
const classnames_1 = __importDefault(require("classnames"));
|
|
73
|
+
const react_1 = __importStar(require("react"));
|
|
74
|
+
const clean_icon_button_1 = require("../clean-icon-button");
|
|
75
|
+
const BoltIconOutline_1 = require("../icons/generated/heroIcons/BoltIconOutline");
|
|
76
|
+
const ExclamationCircleIconSolid_1 = require("../icons/generated/heroIcons/ExclamationCircleIconSolid");
|
|
77
|
+
const ExclamationTriangleIconSolid_1 = require("../icons/generated/heroIcons/ExclamationTriangleIconSolid");
|
|
78
|
+
const InformationCircleIconSolid_1 = require("../icons/generated/heroIcons/InformationCircleIconSolid");
|
|
79
|
+
const SparklesIconSolid_1 = require("../icons/generated/heroIcons/SparklesIconSolid");
|
|
80
|
+
const XMarkIconOutline_1 = require("../icons/generated/heroIcons/XMarkIconOutline");
|
|
81
|
+
const typography_1 = require("../typography");
|
|
82
|
+
const LIVE_REGION_REGISTRATION_DELAY = 100;
|
|
83
|
+
const StatusIcon = ({ icon, variant, }) => {
|
|
84
|
+
const canUseCustomIcon = variant === 'discovery' || variant === 'neutral';
|
|
85
|
+
const iconComponent = (() => {
|
|
86
|
+
if (canUseCustomIcon && icon) {
|
|
87
|
+
return icon;
|
|
88
|
+
}
|
|
89
|
+
switch (variant) {
|
|
90
|
+
case 'warning':
|
|
91
|
+
return (0, jsx_runtime_1.jsx)(ExclamationTriangleIconSolid_1.ExclamationTriangleIconSolid, {});
|
|
92
|
+
case 'danger':
|
|
93
|
+
return (0, jsx_runtime_1.jsx)(ExclamationCircleIconSolid_1.ExclamationCircleIconSolid, {});
|
|
94
|
+
case 'discovery':
|
|
95
|
+
return (0, jsx_runtime_1.jsx)(SparklesIconSolid_1.SparklesIconSolid, {});
|
|
96
|
+
case 'info':
|
|
97
|
+
return (0, jsx_runtime_1.jsx)(InformationCircleIconSolid_1.InformationCircleIconSolid, {});
|
|
98
|
+
case 'neutral':
|
|
99
|
+
return (0, jsx_runtime_1.jsx)(BoltIconOutline_1.BoltIconOutline, {});
|
|
100
|
+
default:
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
})();
|
|
104
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: "ndl-announcement-banner-status-icon", "aria-hidden": "true", children: iconComponent }));
|
|
105
|
+
};
|
|
106
|
+
const AnnouncementBannerContext = react_1.default.createContext({
|
|
107
|
+
hasIcon: false,
|
|
108
|
+
variant: 'info',
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Short title or message for the announcement.
|
|
112
|
+
*/
|
|
113
|
+
const AnnouncementBannerHeader = (_a) => {
|
|
114
|
+
var { children, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "htmlAttributes", "ref"]);
|
|
115
|
+
const { hasIcon, icon, variant } = (0, react_1.useContext)(AnnouncementBannerContext);
|
|
116
|
+
const classes = (0, classnames_1.default)('ndl-announcement-banner-header', className);
|
|
117
|
+
return ((0, jsx_runtime_1.jsxs)(typography_1.Typography, Object.assign({ as: "span", variant: "body-medium", className: classes, style: style, ref: ref, htmlAttributes: htmlAttributes }, restProps, { children: [hasIcon && (0, jsx_runtime_1.jsx)(StatusIcon, { icon: icon, variant: variant }), children] })));
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Optional actions shown next to the announcement message.
|
|
121
|
+
*/
|
|
122
|
+
const AnnouncementBannerActions = (_a) => {
|
|
123
|
+
var { children, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "className", "style", "htmlAttributes", "ref"]);
|
|
124
|
+
const classes = (0, classnames_1.default)('ndl-announcement-banner-actions', className);
|
|
125
|
+
return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: classes, style: style, ref: ref }, restProps, htmlAttributes, { children: children })));
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Full-width announcement bar intended to sit at the top of its parent.
|
|
129
|
+
* It stays in normal document flow so sibling content is shifted down.
|
|
130
|
+
*
|
|
131
|
+
* @remarks
|
|
132
|
+
* Place `AnnouncementBanner` as the first child of a full-width parent (for
|
|
133
|
+
* example the page shell).
|
|
134
|
+
*/
|
|
135
|
+
const AnnouncementBannerComponent = (_a) => {
|
|
136
|
+
var _b;
|
|
137
|
+
var { as, variant = 'info', hasIcon = false, icon, onClose, className, children, isCloseable = false, htmlAttributes, liveRegion, ref } = _a, restProps = __rest(_a, ["as", "variant", "hasIcon", "icon", "onClose", "className", "children", "isCloseable", "htmlAttributes", "liveRegion", "ref"]);
|
|
138
|
+
const Element = as !== null && as !== void 0 ? as : 'section';
|
|
139
|
+
const contentRef = (0, react_1.useRef)(null);
|
|
140
|
+
const [pendingAnnouncement, setPendingAnnouncement] = (0, react_1.useState)(null);
|
|
141
|
+
const classes = (0, classnames_1.default)('ndl-announcement-banner', className, {
|
|
142
|
+
'ndl-announcement-banner-closeable': isCloseable,
|
|
143
|
+
'ndl-danger': variant === 'danger',
|
|
144
|
+
'ndl-discovery': variant === 'discovery',
|
|
145
|
+
'ndl-info': variant === 'info',
|
|
146
|
+
'ndl-neutral': variant === 'neutral',
|
|
147
|
+
'ndl-warning': variant === 'warning',
|
|
148
|
+
});
|
|
149
|
+
const handleClose = (error) => {
|
|
150
|
+
if (onClose && typeof onClose === 'function') {
|
|
151
|
+
onClose(error);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
(0, react_1.useEffect)(() => {
|
|
155
|
+
if (!liveRegion || !contentRef.current) {
|
|
156
|
+
setPendingAnnouncement(null);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const header = contentRef.current.querySelector('.ndl-announcement-banner-header');
|
|
160
|
+
if (!header) {
|
|
161
|
+
setPendingAnnouncement(null);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
let timeoutId;
|
|
165
|
+
const announceHeader = () => {
|
|
166
|
+
var _a;
|
|
167
|
+
window.clearTimeout(timeoutId);
|
|
168
|
+
setPendingAnnouncement(null);
|
|
169
|
+
const message = (_a = header.textContent) === null || _a === void 0 ? void 0 : _a.trim();
|
|
170
|
+
if (message) {
|
|
171
|
+
timeoutId = window.setTimeout(() => {
|
|
172
|
+
setPendingAnnouncement({ message, role: liveRegion });
|
|
173
|
+
}, LIVE_REGION_REGISTRATION_DELAY);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
const observer = new MutationObserver(announceHeader);
|
|
177
|
+
observer.observe(header, {
|
|
178
|
+
characterData: true,
|
|
179
|
+
childList: true,
|
|
180
|
+
subtree: true,
|
|
181
|
+
});
|
|
182
|
+
announceHeader();
|
|
183
|
+
return () => {
|
|
184
|
+
observer.disconnect();
|
|
185
|
+
window.clearTimeout(timeoutId);
|
|
186
|
+
};
|
|
187
|
+
}, [liveRegion]);
|
|
188
|
+
const announcement = (pendingAnnouncement === null || pendingAnnouncement === void 0 ? void 0 : pendingAnnouncement.role) === liveRegion
|
|
189
|
+
? ((_b = pendingAnnouncement === null || pendingAnnouncement === void 0 ? void 0 : pendingAnnouncement.message) !== null && _b !== void 0 ? _b : '')
|
|
190
|
+
: '';
|
|
191
|
+
return ((0, jsx_runtime_1.jsxs)(Element, Object.assign({ className: classes, ref: ref }, restProps, htmlAttributes, { children: [liveRegion && ((0, jsx_runtime_1.jsx)("span", { className: "ndl-announcement-banner-live-region", role: liveRegion, "aria-atomic": "true", children: announcement })), (0, jsx_runtime_1.jsx)("div", { className: "ndl-announcement-banner-container", ref: contentRef, children: (0, jsx_runtime_1.jsx)(AnnouncementBannerContext.Provider, { value: { hasIcon, icon, variant }, children: children }) }), isCloseable && ((0, jsx_runtime_1.jsx)("div", { className: "ndl-announcement-banner-close", children: (0, jsx_runtime_1.jsx)(clean_icon_button_1.CleanIconButton, { size: "small", onClick: handleClose, description: null, htmlAttributes: { 'aria-label': 'Close' }, children: (0, jsx_runtime_1.jsx)(XMarkIconOutline_1.XMarkIconOutline, {}) }) }))] })));
|
|
192
|
+
};
|
|
193
|
+
const AnnouncementBanner = Object.assign(AnnouncementBannerComponent, {
|
|
194
|
+
Actions: AnnouncementBannerActions,
|
|
195
|
+
Header: AnnouncementBannerHeader,
|
|
196
|
+
});
|
|
197
|
+
exports.AnnouncementBanner = AnnouncementBanner;
|
|
198
|
+
//# sourceMappingURL=AnnouncementBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnnouncementBanner.js","sourceRoot":"","sources":["../../../src/announcement-banner/AnnouncementBanner.tsx"],"names":[],"mappings":"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","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport React, { useContext, useEffect, useRef, useState } from 'react';\n\nimport {\n type CommonProps,\n type PolymorphicCommonProps,\n} from '../_common/types';\nimport { CleanIconButton } from '../clean-icon-button';\nimport { BoltIconOutline } from '../icons/generated/heroIcons/BoltIconOutline';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { ExclamationTriangleIconSolid } from '../icons/generated/heroIcons/ExclamationTriangleIconSolid';\nimport { InformationCircleIconSolid } from '../icons/generated/heroIcons/InformationCircleIconSolid';\nimport { SparklesIconSolid } from '../icons/generated/heroIcons/SparklesIconSolid';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { Typography } from '../typography';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype AnnouncementBannerVariant =\n | 'info'\n | 'warning'\n | 'danger'\n | 'discovery'\n | 'neutral';\n\ntype AnnouncementBannerLiveRegion = 'status' | 'alert';\n\ntype PendingAnnouncement = {\n message: string;\n role: AnnouncementBannerLiveRegion;\n};\n\ntype AnnouncementBannerCommonProps = {\n /** Shows a status icon. The icon is based on the value of the `variant` prop */\n hasIcon?: boolean;\n\n /**\n * Decorative icon shown when `hasIcon` is true. Only used for `discovery`\n * and `neutral`; those variants fall back to Sparkles and Bolt. `info`,\n * `warning`, and `danger` always use their status icons.\n */\n icon?: React.ReactNode;\n\n /** Content to be shown in the announcement banner. */\n children?: React.ReactNode;\n\n /**\n * Announces the header when the banner appears or its header changes.\n * `status` announces politely, while `alert` interrupts the user. Leave this\n * unset for banners that are present during the page's initial render.\n * This is independent of the visual `variant`.\n */\n liveRegion?: AnnouncementBannerLiveRegion;\n\n /** The variant of the announcement banner */\n variant?: AnnouncementBannerVariant;\n};\n\ntype CloseableAnnouncementBannerProps = {\n /** If the banner is closeable. Renders an icon button on the right */\n isCloseable: true;\n\n /** Event handler for when the close icon is clicked */\n onClose: (\n error?: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,\n ) => void;\n};\n\ntype NonCloseableAnnouncementBannerProps = {\n isCloseable?: false;\n onClose?: never;\n};\n\ntype AnnouncementBannerCloseProps =\n | CloseableAnnouncementBannerProps\n | NonCloseableAnnouncementBannerProps;\n\ntype AnnouncementBannerProps = AnnouncementBannerCommonProps &\n AnnouncementBannerCloseProps;\n\nconst LIVE_REGION_REGISTRATION_DELAY = 100;\n\nconst StatusIcon = ({\n icon,\n variant,\n}: {\n icon?: React.ReactNode;\n variant: AnnouncementBannerVariant;\n}) => {\n const canUseCustomIcon = variant === 'discovery' || variant === 'neutral';\n const iconComponent = (() => {\n if (canUseCustomIcon && icon) {\n return icon;\n }\n\n switch (variant) {\n case 'warning':\n return <ExclamationTriangleIconSolid />;\n case 'danger':\n return <ExclamationCircleIconSolid />;\n case 'discovery':\n return <SparklesIconSolid />;\n case 'info':\n return <InformationCircleIconSolid />;\n case 'neutral':\n return <BoltIconOutline />;\n default:\n return null;\n }\n })();\n\n return (\n <span className=\"ndl-announcement-banner-status-icon\" aria-hidden=\"true\">\n {iconComponent}\n </span>\n );\n};\n\nconst AnnouncementBannerContext = React.createContext<{\n hasIcon: boolean;\n icon?: React.ReactNode;\n variant: AnnouncementBannerVariant;\n}>({\n hasIcon: false,\n variant: 'info',\n});\n\n/**\n * Short title or message for the announcement.\n */\nconst AnnouncementBannerHeader = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'span', { children: React.ReactNode }>) => {\n const { hasIcon, icon, variant } = useContext(AnnouncementBannerContext);\n const classes = classNames('ndl-announcement-banner-header', className);\n return (\n <Typography\n as=\"span\"\n variant=\"body-medium\"\n className={classes}\n style={style}\n ref={ref}\n htmlAttributes={htmlAttributes}\n {...restProps}\n >\n {hasIcon && <StatusIcon icon={icon} variant={variant} />}\n {children}\n </Typography>\n );\n};\n\n/**\n * Optional actions shown next to the announcement message.\n */\nconst AnnouncementBannerActions = ({\n children,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', { children: React.ReactNode }>) => {\n const classes = classNames('ndl-announcement-banner-actions', className);\n return (\n <div\n className={classes}\n style={style}\n ref={ref}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Full-width announcement bar intended to sit at the top of its parent.\n * It stays in normal document flow so sibling content is shifted down.\n *\n * @remarks\n * Place `AnnouncementBanner` as the first child of a full-width parent (for\n * example the page shell).\n */\nconst AnnouncementBannerComponent = <\n TElement extends React.ElementType = 'section',\n>({\n as,\n variant = 'info',\n hasIcon = false,\n icon,\n onClose,\n className,\n children,\n isCloseable = false,\n htmlAttributes,\n liveRegion,\n ref,\n ...restProps\n}: PolymorphicCommonProps<TElement, AnnouncementBannerProps>) => {\n const Element: React.ElementType = as ?? 'section';\n const contentRef = useRef<HTMLDivElement>(null);\n const [pendingAnnouncement, setPendingAnnouncement] =\n useState<PendingAnnouncement | null>(null);\n\n const classes = classNames('ndl-announcement-banner', className, {\n 'ndl-announcement-banner-closeable': isCloseable,\n 'ndl-danger': variant === 'danger',\n 'ndl-discovery': variant === 'discovery',\n 'ndl-info': variant === 'info',\n 'ndl-neutral': variant === 'neutral',\n 'ndl-warning': variant === 'warning',\n });\n\n const handleClose = (\n error:\n | React.MouseEvent<HTMLElement, MouseEvent>\n | React.KeyboardEvent<HTMLElement>,\n ) => {\n if (onClose && typeof onClose === 'function') {\n onClose(error);\n }\n };\n\n useEffect(() => {\n if (!liveRegion || !contentRef.current) {\n setPendingAnnouncement(null);\n return;\n }\n\n const header = contentRef.current.querySelector(\n '.ndl-announcement-banner-header',\n );\n\n if (!header) {\n setPendingAnnouncement(null);\n return;\n }\n\n let timeoutId: number | undefined;\n\n const announceHeader = () => {\n window.clearTimeout(timeoutId);\n setPendingAnnouncement(null);\n\n const message = header.textContent?.trim();\n\n if (message) {\n timeoutId = window.setTimeout(() => {\n setPendingAnnouncement({ message, role: liveRegion });\n }, LIVE_REGION_REGISTRATION_DELAY);\n }\n };\n\n const observer = new MutationObserver(announceHeader);\n observer.observe(header, {\n characterData: true,\n childList: true,\n subtree: true,\n });\n announceHeader();\n\n return () => {\n observer.disconnect();\n window.clearTimeout(timeoutId);\n };\n }, [liveRegion]);\n\n const announcement =\n pendingAnnouncement?.role === liveRegion\n ? (pendingAnnouncement?.message ?? '')\n : '';\n\n return (\n <Element className={classes} ref={ref} {...restProps} {...htmlAttributes}>\n {liveRegion && (\n <span\n className=\"ndl-announcement-banner-live-region\"\n role={liveRegion}\n aria-atomic=\"true\"\n >\n {announcement}\n </span>\n )}\n <div className=\"ndl-announcement-banner-container\" ref={contentRef}>\n <AnnouncementBannerContext.Provider value={{ hasIcon, icon, variant }}>\n {children}\n </AnnouncementBannerContext.Provider>\n </div>\n {isCloseable && (\n <div className=\"ndl-announcement-banner-close\">\n <CleanIconButton\n size=\"small\"\n onClick={handleClose}\n description={null}\n htmlAttributes={{ 'aria-label': 'Close' }}\n >\n <XMarkIconOutline />\n </CleanIconButton>\n </div>\n )}\n </Element>\n );\n};\n\nconst AnnouncementBanner = Object.assign(AnnouncementBannerComponent, {\n Actions: AnnouncementBannerActions,\n Header: AnnouncementBannerHeader,\n});\n\nexport { AnnouncementBanner };\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) "Neo4j"
|
|
5
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
6
|
+
*
|
|
7
|
+
* This file is part of Neo4j.
|
|
8
|
+
*
|
|
9
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU General Public License as published by
|
|
11
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
12
|
+
* (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*/
|
|
22
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
26
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
27
|
+
}
|
|
28
|
+
Object.defineProperty(o, k2, desc);
|
|
29
|
+
}) : (function(o, m, k, k2) {
|
|
30
|
+
if (k2 === undefined) k2 = k;
|
|
31
|
+
o[k2] = m[k];
|
|
32
|
+
}));
|
|
33
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
34
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
__exportStar(require("./AnnouncementBanner"), exports);
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/announcement-banner/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;AAEH,uDAAqC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport * from './AnnouncementBanner';\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { isCloseable: true, onClose: () => alert('Announcement banner closed'), children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "This announcement can be dismissed." }) }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# sourceMappingURL=announcement-banner-closeable.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-closeable.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-closeable.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAsD;AAEtD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,0BAAkB,IACjB,WAAW,EAAE,IAAI,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,4BAA4B,CAAC,YAElD,uBAAC,0BAAkB,CAAC,MAAM,sDAEE,GACT,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { AnnouncementBanner } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <AnnouncementBanner\n isCloseable={true}\n onClose={() => alert('Announcement banner closed')}\n >\n <AnnouncementBanner.Header>\n This announcement can be dismissed.\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const icons_1 = require("@neo4j-ndl/react/icons");
|
|
27
|
+
const Component = () => {
|
|
28
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8 n-w-full", children: [(0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "discovery", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Discovery with the default Sparkles icon" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "discovery", hasIcon: true, icon: (0, jsx_runtime_1.jsx)(icons_1.GiftIconSolid, {}), children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Discovery with a custom gift icon" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "neutral", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Neutral with the default Bolt icon" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "neutral", hasIcon: true, icon: (0, jsx_runtime_1.jsx)(icons_1.RocketLaunchIconSolid, {}), children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Neutral with a custom rocket icon" }) })] }));
|
|
29
|
+
};
|
|
30
|
+
exports.default = Component;
|
|
31
|
+
//# sourceMappingURL=announcement-banner-custom-icons.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-custom-icons.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-custom-icons.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAsD;AACtD,kDAA8E;AAE9E,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,0CAA0C,aACvD,uBAAC,0BAAkB,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,IAAI,YACnD,uBAAC,0BAAkB,CAAC,MAAM,2DAEE,GACT,EACrB,uBAAC,0BAAkB,IACjB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,uBAAC,qBAAa,KAAG,YAEvB,uBAAC,0BAAkB,CAAC,MAAM,oDAEE,GACT,EACrB,uBAAC,0BAAkB,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,IAAI,YACjD,uBAAC,0BAAkB,CAAC,MAAM,qDAEE,GACT,EACrB,uBAAC,0BAAkB,IACjB,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,IAAI,EACb,IAAI,EAAE,uBAAC,6BAAqB,KAAG,YAE/B,uBAAC,0BAAkB,CAAC,MAAM,oDAEE,GACT,IACjB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { AnnouncementBanner } from '@neo4j-ndl/react';\nimport { GiftIconSolid, RocketLaunchIconSolid } from '@neo4j-ndl/react/icons';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-8 n-w-full\">\n <AnnouncementBanner variant=\"discovery\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Discovery with the default Sparkles icon\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner\n variant=\"discovery\"\n hasIcon={true}\n icon={<GiftIconSolid />}\n >\n <AnnouncementBanner.Header>\n Discovery with a custom gift icon\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner variant=\"neutral\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Neutral with the default Bolt icon\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner\n variant=\"neutral\"\n hasIcon={true}\n icon={<RocketLaunchIconSolid />}\n >\n <AnnouncementBanner.Header>\n Neutral with a custom rocket icon\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "info", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Scheduled maintenance starts tonight at 22:00 UTC." }) }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# sourceMappingURL=announcement-banner-default.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-default.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-default.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAsD;AAEtD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,uBAAC,0BAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,IAAI,YAC9C,uBAAC,0BAAkB,CAAC,MAAM,qEAEE,GACT,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { AnnouncementBanner } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <AnnouncementBanner variant=\"info\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Scheduled maintenance starts tonight at 22:00 UTC.\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = () => {
|
|
28
|
+
const [isVisible, setIsVisible] = (0, react_2.useState)(false);
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-w-full", children: [isVisible && ((0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "discovery", hasIcon: true, liveRegion: "status", isCloseable: true, onClose: () => setIsVisible(false), children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "New Aura features are available for your organization." }) })), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16 n-p-token-24 n-bg-neutral-bg-default", children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => setIsVisible((visible) => !visible), children: isVisible ? 'Hide announcement' : 'Show announcement' }), (0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["The page is already loaded. Toggle the announcement in to simulate a later campaign or poll. ", (0, jsx_runtime_1.jsx)("code", { children: "liveRegion=\"status\"" }), ' ', "announces politely without interrupting."] })] })] }));
|
|
30
|
+
};
|
|
31
|
+
exports.default = Component;
|
|
32
|
+
//# sourceMappingURL=announcement-banner-injected-non-urgent.story.js.map
|
package/lib/cjs/announcement-banner/stories/announcement-banner-injected-non-urgent.story.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-injected-non-urgent.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-injected-non-urgent.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAI0B;AAC1B,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CACL,iCAAK,SAAS,EAAC,4BAA4B,aACxC,SAAS,IAAI,CACZ,uBAAC,0BAAkB,IACjB,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,IAAI,EACb,UAAU,EAAC,QAAQ,EACnB,WAAW,EAAE,IAAI,EACjB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,YAElC,uBAAC,0BAAkB,CAAC,MAAM,yEAEE,GACT,CACtB,EACD,iCAAK,SAAS,EAAC,uEAAuE,aACpF,uBAAC,sBAAc,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,YAC/D,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,GACvC,EACjB,wBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,8GAEP,qEAA0C,EAAC,GAAG,gDAE3D,IACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n AnnouncementBanner,\n OutlinedButton,\n Typography,\n} from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <div className=\"n-flex n-flex-col n-w-full\">\n {isVisible && (\n <AnnouncementBanner\n variant=\"discovery\"\n hasIcon={true}\n liveRegion=\"status\"\n isCloseable={true}\n onClose={() => setIsVisible(false)}\n >\n <AnnouncementBanner.Header>\n New Aura features are available for your organization.\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n )}\n <div className=\"n-flex n-flex-col n-gap-token-16 n-p-token-24 n-bg-neutral-bg-default\">\n <OutlinedButton onClick={() => setIsVisible((visible) => !visible)}>\n {isVisible ? 'Hide announcement' : 'Show announcement'}\n </OutlinedButton>\n <Typography variant=\"body-medium\">\n The page is already loaded. Toggle the announcement in to simulate a\n later campaign or poll. <code>liveRegion="status"</code>{' '}\n announces politely without interrupting.\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const react_2 = require("react");
|
|
27
|
+
const Component = () => {
|
|
28
|
+
const [isVisible, setIsVisible] = (0, react_2.useState)(false);
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-w-full", children: [isVisible && ((0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "danger", hasIcon: true, liveRegion: "alert", children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Error: connection to the database was lost. Reconnecting\u2026" }) })), (0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-16 n-p-token-24 n-bg-neutral-bg-default", children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { onClick: () => setIsVisible((visible) => !visible), children: isVisible ? 'Hide announcement' : 'Show announcement' }), (0, jsx_runtime_1.jsxs)(react_1.Typography, { variant: "body-medium", children: ["The page is already loaded. Toggle the announcement in to simulate a connection loss or session expiry.", ' ', (0, jsx_runtime_1.jsx)("code", { children: "liveRegion=\"alert\"" }), " interrupts the screen reader because the message is time-sensitive."] })] })] }));
|
|
30
|
+
};
|
|
31
|
+
exports.default = Component;
|
|
32
|
+
//# sourceMappingURL=announcement-banner-injected-urgent.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-injected-urgent.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-injected-urgent.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAI0B;AAC1B,iCAAiC;AAEjC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAElD,OAAO,CACL,iCAAK,SAAS,EAAC,4BAA4B,aACxC,SAAS,IAAI,CACZ,uBAAC,0BAAkB,IAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAC,OAAO,YACpE,uBAAC,0BAAkB,CAAC,MAAM,iFAEE,GACT,CACtB,EACD,iCAAK,SAAS,EAAC,uEAAuE,aACpF,uBAAC,sBAAc,IAAC,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,YAC/D,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,GACvC,EACjB,wBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,wHAEI,GAAG,EACtC,oEAAyC,4EAE9B,IACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n AnnouncementBanner,\n OutlinedButton,\n Typography,\n} from '@neo4j-ndl/react';\nimport { useState } from 'react';\n\nconst Component = () => {\n const [isVisible, setIsVisible] = useState(false);\n\n return (\n <div className=\"n-flex n-flex-col n-w-full\">\n {isVisible && (\n <AnnouncementBanner variant=\"danger\" hasIcon={true} liveRegion=\"alert\">\n <AnnouncementBanner.Header>\n Error: connection to the database was lost. Reconnecting…\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n )}\n <div className=\"n-flex n-flex-col n-gap-token-16 n-p-token-24 n-bg-neutral-bg-default\">\n <OutlinedButton onClick={() => setIsVisible((visible) => !visible)}>\n {isVisible ? 'Hide announcement' : 'Show announcement'}\n </OutlinedButton>\n <Typography variant=\"body-medium\">\n The page is already loaded. Toggle the announcement in to simulate a\n connection loss or session expiry.{' '}\n <code>liveRegion="alert"</code> interrupts the screen reader\n because the message is time-sensitive.\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
package/lib/cjs/announcement-banner/stories/announcement-banner-present-at-page-render.story.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-w-full", children: [(0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "danger", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Warning: your marketplace subscription will be deprecated on September 19, 2026." }) }), (0, jsx_runtime_1.jsx)("div", { className: "n-p-token-24 n-bg-neutral-bg-default", children: (0, jsx_runtime_1.jsx)(react_1.Typography, { variant: "body-medium", children: "This banner is part of the initial page render, so `liveRegion` is omitted. Screen reader users hear it when they reach it in the page, not as an interruption." }) })] }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# sourceMappingURL=announcement-banner-present-at-page-render.story.js.map
|
package/lib/cjs/announcement-banner/stories/announcement-banner-present-at-page-render.story.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-present-at-page-render.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-present-at-page-render.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAkE;AAElE,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,4BAA4B,aACzC,uBAAC,0BAAkB,IAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,YAChD,uBAAC,0BAAkB,CAAC,MAAM,mGAGE,GACT,EACrB,gCAAK,SAAS,EAAC,sCAAsC,YACnD,uBAAC,kBAAU,IAAC,OAAO,EAAC,aAAa,gLAIpB,GACT,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { AnnouncementBanner, Typography } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-w-full\">\n <AnnouncementBanner variant=\"danger\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Warning: your marketplace subscription will be deprecated on September\n 19, 2026.\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <div className=\"n-p-token-24 n-bg-neutral-bg-default\">\n <Typography variant=\"body-medium\">\n This banner is part of the initial page render, so `liveRegion` is\n omitted. Screen reader users hear it when they reach it in the page,\n not as an interruption.\n </Typography>\n </div>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "n-flex n-flex-col n-gap-token-8 n-w-full", children: [(0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "info", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Info announcement" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "warning", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Warning announcement" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "danger", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Danger announcement" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "discovery", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Discovery announcement" }) }), (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner, { variant: "neutral", hasIcon: true, children: (0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Neutral announcement" }) })] }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# sourceMappingURL=announcement-banner-variants.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-variants.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-variants.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAAsD;AAEtD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,iCAAK,SAAS,EAAC,0CAA0C,aACvD,uBAAC,0BAAkB,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,IAAI,YAC9C,uBAAC,0BAAkB,CAAC,MAAM,oCAA8C,GACrD,EACrB,uBAAC,0BAAkB,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,IAAI,YACjD,uBAAC,0BAAkB,CAAC,MAAM,uCAEE,GACT,EACrB,uBAAC,0BAAkB,IAAC,OAAO,EAAC,QAAQ,EAAC,OAAO,EAAE,IAAI,YAChD,uBAAC,0BAAkB,CAAC,MAAM,sCAEE,GACT,EACrB,uBAAC,0BAAkB,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,IAAI,YACnD,uBAAC,0BAAkB,CAAC,MAAM,yCAEE,GACT,EACrB,uBAAC,0BAAkB,IAAC,OAAO,EAAC,SAAS,EAAC,OAAO,EAAE,IAAI,YACjD,uBAAC,0BAAkB,CAAC,MAAM,uCAEE,GACT,IACjB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport { AnnouncementBanner } from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <div className=\"n-flex n-flex-col n-gap-token-8 n-w-full\">\n <AnnouncementBanner variant=\"info\" hasIcon={true}>\n <AnnouncementBanner.Header>Info announcement</AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner variant=\"warning\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Warning announcement\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner variant=\"danger\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Danger announcement\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner variant=\"discovery\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Discovery announcement\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n <AnnouncementBanner variant=\"neutral\" hasIcon={true}>\n <AnnouncementBanner.Header>\n Neutral announcement\n </AnnouncementBanner.Header>\n </AnnouncementBanner>\n </div>\n );\n};\n\nexport default Component;\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) "Neo4j"
|
|
7
|
+
* Neo4j Sweden AB [http://neo4j.com]
|
|
8
|
+
*
|
|
9
|
+
* This file is part of Neo4j.
|
|
10
|
+
*
|
|
11
|
+
* Neo4j is free software: you can redistribute it and/or modify
|
|
12
|
+
* it under the terms of the GNU General Public License as published by
|
|
13
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
14
|
+
* (at your option) any later version.
|
|
15
|
+
*
|
|
16
|
+
* This program is distributed in the hope that it will be useful,
|
|
17
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
|
+
* GNU General Public License for more details.
|
|
20
|
+
*
|
|
21
|
+
* You should have received a copy of the GNU General Public License
|
|
22
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
23
|
+
*/
|
|
24
|
+
require("@neo4j-ndl/base/lib/neo4j-ds-styles.css");
|
|
25
|
+
const react_1 = require("@neo4j-ndl/react");
|
|
26
|
+
const Component = () => {
|
|
27
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.AnnouncementBanner, { hasIcon: true, variant: "warning", children: [(0, jsx_runtime_1.jsx)(react_1.AnnouncementBanner.Header, { children: "Your trial ends in 3 days." }), (0, jsx_runtime_1.jsxs)(react_1.AnnouncementBanner.Actions, { children: [(0, jsx_runtime_1.jsx)(react_1.OutlinedButton, { children: "Upgrade" }), (0, jsx_runtime_1.jsx)(react_1.TextButton, { children: "Learn more" })] })] }));
|
|
28
|
+
};
|
|
29
|
+
exports.default = Component;
|
|
30
|
+
//# sourceMappingURL=announcement-banner-with-actions.story.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcement-banner-with-actions.story.js","sourceRoot":"","sources":["../../../../src/announcement-banner/stories/announcement-banner-with-actions.story.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,mDAAiD;AAEjD,4CAI0B;AAE1B,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,CACL,wBAAC,0BAAkB,IAAC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAC,SAAS,aAClD,uBAAC,0BAAkB,CAAC,MAAM,6CAEE,EAC5B,wBAAC,0BAAkB,CAAC,OAAO,eACzB,uBAAC,sBAAc,0BAAyB,EACxC,uBAAC,kBAAU,6BAAwB,IACR,IACV,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,SAAS,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport '@neo4j-ndl/base/lib/neo4j-ds-styles.css';\n\nimport {\n AnnouncementBanner,\n OutlinedButton,\n TextButton,\n} from '@neo4j-ndl/react';\n\nconst Component = () => {\n return (\n <AnnouncementBanner hasIcon={true} variant=\"warning\">\n <AnnouncementBanner.Header>\n Your trial ends in 3 days.\n </AnnouncementBanner.Header>\n <AnnouncementBanner.Actions>\n <OutlinedButton>Upgrade</OutlinedButton>\n <TextButton>Learn more</TextButton>\n </AnnouncementBanner.Actions>\n </AnnouncementBanner>\n );\n};\n\nexport default Component;\n"]}
|