@deque/cauldron-react 5.6.2-canary.b103453d → 5.7.0-canary.7cfac7d0
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/components/Notice/index.d.ts +16 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { IconType } from '../Icon';
|
|
3
|
+
import { ContentNode } from '../../types';
|
|
4
|
+
declare const iconTypeMap: {
|
|
5
|
+
caution: string;
|
|
6
|
+
danger: string;
|
|
7
|
+
info: string;
|
|
8
|
+
};
|
|
9
|
+
export interface NoticeProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
10
|
+
type?: keyof typeof iconTypeMap;
|
|
11
|
+
title: ContentNode;
|
|
12
|
+
icon?: IconType;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
declare const Notice: React.ForwardRefExoticComponent<NoticeProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export default Notice;
|
package/lib/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export { default as Pagination, usePagination } from './components/Pagination';
|
|
|
51
51
|
export { default as FieldWrap } from './components/FieldWrap';
|
|
52
52
|
export { default as Breadcrumb, BreadcrumbItem, BreadcrumbLink } from './components/Breadcrumb';
|
|
53
53
|
export { default as TwoColumnPanel, ColumnHeader, ColumnGroupHeader, ColumnLeft, ColumnRight, ColumnList } from './components/TwoColumnPanel';
|
|
54
|
+
export { default as Notice } from './components/Notice';
|
|
54
55
|
/**
|
|
55
56
|
* Helpers / Utils
|
|
56
57
|
*/
|
package/lib/index.js
CHANGED
|
@@ -9121,6 +9121,37 @@ ColumnList.propTypes = {
|
|
|
9121
9121
|
className: PropTypes.string
|
|
9122
9122
|
};
|
|
9123
9123
|
|
|
9124
|
+
var iconTypeMap = {
|
|
9125
|
+
caution: 'caution',
|
|
9126
|
+
danger: 'caution',
|
|
9127
|
+
info: 'info-circle'
|
|
9128
|
+
};
|
|
9129
|
+
var Notice = React.forwardRef(function (_a, ref) {
|
|
9130
|
+
var _b;
|
|
9131
|
+
var _c = _a.type, type = _c === void 0 ? 'info' : _c, title = _a.title, icon = _a.icon, children = _a.children, otherProps = tslib.__rest(_a, ["type", "title", "icon", "children"]);
|
|
9132
|
+
return (React__default.createElement("div", tslib.__assign({ className: classNames('Notice', (_b = {},
|
|
9133
|
+
_b["Notice--".concat(type)] = type,
|
|
9134
|
+
_b)), ref: ref }, otherProps),
|
|
9135
|
+
React__default.createElement("div", { className: "Notice__title" },
|
|
9136
|
+
React__default.createElement(Icon, { type: icon || iconTypeMap[type] }),
|
|
9137
|
+
title),
|
|
9138
|
+
children && React__default.createElement("div", { className: "Notice__content" }, children)));
|
|
9139
|
+
});
|
|
9140
|
+
Notice.displayName = 'Notice';
|
|
9141
|
+
Notice.propTypes = {
|
|
9142
|
+
// @ts-expect-error
|
|
9143
|
+
children: PropTypes.node,
|
|
9144
|
+
type: PropTypes.oneOf(['caution', 'info', 'danger']),
|
|
9145
|
+
// @ts-expect-error
|
|
9146
|
+
title: PropTypes.oneOfType([
|
|
9147
|
+
PropTypes.string,
|
|
9148
|
+
PropTypes.number,
|
|
9149
|
+
PropTypes.element
|
|
9150
|
+
]),
|
|
9151
|
+
// @ts-expect-error
|
|
9152
|
+
icon: PropTypes.string
|
|
9153
|
+
};
|
|
9154
|
+
|
|
9124
9155
|
var LIGHT_THEME_CLASS = 'cauldron--theme-light';
|
|
9125
9156
|
var DARK_THEME_CLASS = 'cauldron--theme-dark';
|
|
9126
9157
|
var ThemeContext = React.createContext({});
|
|
@@ -9231,6 +9262,7 @@ exports.ModalContent = ModalContent;
|
|
|
9231
9262
|
exports.ModalFooter = ModalFooter;
|
|
9232
9263
|
exports.NavBar = NavBar;
|
|
9233
9264
|
exports.NavItem = NavItem;
|
|
9265
|
+
exports.Notice = Notice;
|
|
9234
9266
|
exports.Offscreen = Offscreen;
|
|
9235
9267
|
exports.OptionsMenu = OptionsMenu;
|
|
9236
9268
|
exports.OptionsMenuItem = OptionsMenuItem;
|
package/package.json
CHANGED