pallote-react 0.16.10 → 0.16.11
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/dist/components/Alert.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
type AlertColor = 'success' | 'info' | 'warning' | 'error';
|
|
3
3
|
type AlertVariant = 'bar' | 'toast' | 'notice';
|
|
4
4
|
export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -6,11 +6,12 @@ export interface AlertProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
variant?: AlertVariant;
|
|
7
7
|
title: string;
|
|
8
8
|
subtitle?: string;
|
|
9
|
+
actions?: ReactNode;
|
|
9
10
|
dense?: boolean;
|
|
10
11
|
noIcon?: boolean;
|
|
11
12
|
show?: boolean;
|
|
12
13
|
onClose?: () => void;
|
|
13
14
|
className?: string;
|
|
14
15
|
}
|
|
15
|
-
export declare const Alert: ({ color, variant, title, subtitle, dense, noIcon, show, onClose, className, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare const Alert: ({ color, variant, title, subtitle, actions, dense, noIcon, show, onClose, className, ...props }: AlertProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -272,7 +272,7 @@ const a$6 = /* @__PURE__ */ new Map([
|
|
|
272
272
|
const e$7 = e$9.forwardRef((r, t) => /* @__PURE__ */ e$9.createElement(p, { ref: t, ...r, weights: a$6 }));
|
|
273
273
|
e$7.displayName = "XIcon";
|
|
274
274
|
|
|
275
|
-
const Alert = ({ color = 'success', variant = 'toast', title, subtitle, dense, noIcon, show, onClose, className, ...props }) => {
|
|
275
|
+
const Alert = ({ color = 'success', variant = 'toast', title, subtitle, actions, dense, noIcon, show, onClose, className, ...props }) => {
|
|
276
276
|
const [shouldRender, setRender] = useState(show);
|
|
277
277
|
const [container] = useState(() => {
|
|
278
278
|
let el = document.getElementById('alerts');
|
|
@@ -302,7 +302,7 @@ const Alert = ({ color = 'success', variant = 'toast', title, subtitle, dense, n
|
|
|
302
302
|
'alert-noIcon': noIcon
|
|
303
303
|
},
|
|
304
304
|
className
|
|
305
|
-
]), onAnimationEnd: onAnimationEnd, ...props, children: [jsxs("div", { className: classnames('alert_content'), children: [title ? jsx(Text, { className: classnames('alert_title'), variant: dense ? 'caption' : 'body', weight: 'bold', children: title }) : null, subtitle ? jsx(Text, { variant: dense ? 'overline' : 'caption', className: classnames('alert_subtitle'), children: subtitle }) : null] }), onClose ? (jsx("button", { type: "button", className: classnames('alert_close'), onClick: onClose, "aria-label": "Dismiss alert", children: jsx(e$7, { size: dense ? 14 : 16, "aria-hidden": "true" }) })) : null] }));
|
|
305
|
+
]), onAnimationEnd: onAnimationEnd, ...props, children: [jsxs("div", { className: classnames('alert_content'), children: [title ? jsx(Text, { className: classnames('alert_title'), variant: dense ? 'caption' : 'body', weight: 'bold', children: title }) : null, subtitle ? jsx(Text, { variant: dense ? 'overline' : 'caption', className: classnames('alert_subtitle'), children: subtitle }) : null] }), actions ? jsx("div", { className: classnames('alert_actions'), children: actions }) : null, onClose ? (jsx("button", { type: "button", className: classnames('alert_close'), onClick: onClose, "aria-label": "Dismiss alert", children: jsx(e$7, { size: dense ? 14 : 16, "aria-hidden": "true" }) })) : null] }));
|
|
306
306
|
if (variant === 'notice') {
|
|
307
307
|
return jsx(Fragment, { children: alert });
|
|
308
308
|
}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pallote-react",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"classnames": "^2.5.1",
|
|
25
25
|
"react-syntax-highlighter": "^15.6.1",
|
|
26
26
|
"sass": "^1.71.1",
|
|
27
|
-
"pallote-css": "^0.10.
|
|
27
|
+
"pallote-css": "^0.10.6"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@chromatic-com/storybook": "^3.2.4",
|