ag-common 0.0.675 → 0.0.676
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.
|
@@ -10,4 +10,4 @@ export interface IImage {
|
|
|
10
10
|
/** if true is counted as a small image, and will be sized accordingly. default false */
|
|
11
11
|
small?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => React.JSX.Element;
|
|
13
|
+
export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => React.JSX.Element | null;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use client';
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
3
26
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
4
27
|
var t = {};
|
|
5
28
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -17,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
41
|
exports.Image = void 0;
|
|
19
42
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
20
|
-
const react_1 =
|
|
43
|
+
const react_1 = __importStar(require("react"));
|
|
21
44
|
const media_1 = require("../../styles/media");
|
|
22
45
|
const Base = styled_1.default.img `
|
|
23
46
|
object-fit: contain;
|
|
@@ -62,6 +85,10 @@ const Base = styled_1.default.img `
|
|
|
62
85
|
`;
|
|
63
86
|
const Image = (p) => {
|
|
64
87
|
const { smalltop, bigonly, smallonly, small } = p, p1 = __rest(p, ["smalltop", "bigonly", "smallonly", "small"]);
|
|
65
|
-
|
|
88
|
+
const [display, setDisplay] = (0, react_1.useState)(true);
|
|
89
|
+
if (!display) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return (react_1.default.createElement(Base, Object.assign({}, p1, { "data-smalltop": smalltop, "data-bigonly": bigonly, "data-smallonly": smallonly, "data-small": small, onError: () => setDisplay(false) })));
|
|
66
93
|
};
|
|
67
94
|
exports.Image = Image;
|
|
@@ -126,17 +126,17 @@ const Toast = ({ toast, close, style, }) => {
|
|
|
126
126
|
return () => clearTimeout(timeout);
|
|
127
127
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
128
128
|
}, []);
|
|
129
|
+
const closeStyle = { color: style.color, '--bg': style.borderColor };
|
|
130
|
+
const toastStyle = Object.assign(Object.assign({}, style), { boxShadow: `hsl(from ${style.borderColor} h s 25%) 0px 7px 29px 0px` });
|
|
129
131
|
if (toast.type === 'standard') {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: st }, "\u00D7"),
|
|
132
|
+
return (react_1.default.createElement(ToastStyle, { style: toastStyle },
|
|
133
|
+
react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: closeStyle }, "\u00D7"),
|
|
133
134
|
react_1.default.createElement(Icon, { style: { fill: style.color } }, icon),
|
|
134
135
|
toast.message,
|
|
135
136
|
closeMs !== undefined && (react_1.default.createElement(ProgressBarStyled, { max: 100, min: 0, dotPercentages: null, transitionToMs: closeMs }))));
|
|
136
137
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: st }, "\u00D7"),
|
|
138
|
+
return (react_1.default.createElement(ToastStyle, { style: toastStyle },
|
|
139
|
+
react_1.default.createElement(CloseStyle, { onClick: () => close(toast.id), style: closeStyle }, "\u00D7"),
|
|
140
140
|
react_1.default.createElement(FlexRow_1.FlexRow, { noWrap: true, center: true },
|
|
141
141
|
toast.icon === undefined && react_1.default.createElement(Icon, null, icon),
|
|
142
142
|
toast.icon,
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.676",
|
|
3
3
|
"name": "ag-common",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
@@ -45,25 +45,26 @@
|
|
|
45
45
|
"@emotion/react": "11.11.4",
|
|
46
46
|
"@emotion/styled": "11.11.0",
|
|
47
47
|
"@smithy/types": "2.12.0",
|
|
48
|
-
"@storybook/addon-actions": "
|
|
49
|
-
"@storybook/addon-docs": "
|
|
50
|
-
"@storybook/addon-essentials": "
|
|
51
|
-
"@storybook/addon-interactions": "
|
|
52
|
-
"@storybook/addon-links": "
|
|
48
|
+
"@storybook/addon-actions": "8.0.4",
|
|
49
|
+
"@storybook/addon-docs": "8.0.4",
|
|
50
|
+
"@storybook/addon-essentials": "8.0.4",
|
|
51
|
+
"@storybook/addon-interactions": "8.0.4",
|
|
52
|
+
"@storybook/addon-links": "8.0.4",
|
|
53
|
+
"@storybook/addon-webpack5-compiler-swc": "1.0.2",
|
|
53
54
|
"@storybook/addons": "7.6.17",
|
|
54
|
-
"@storybook/react": "
|
|
55
|
-
"@storybook/react-webpack5": "
|
|
56
|
-
"@storybook/theming": "
|
|
55
|
+
"@storybook/react": "8.0.4",
|
|
56
|
+
"@storybook/react-webpack5": "8.0.4",
|
|
57
|
+
"@storybook/theming": "8.0.4",
|
|
57
58
|
"@types/jsonwebtoken": "9.0.6",
|
|
58
59
|
"@types/node": "20.11.30",
|
|
59
60
|
"@types/react": "18.2.67",
|
|
60
61
|
"@types/react-dom": "18.2.22",
|
|
61
62
|
"cross-env": "7.0.3",
|
|
62
63
|
"eslint-config-e7npm": "0.0.93",
|
|
63
|
-
"globstar": "
|
|
64
|
+
"globstar": "1.0.0",
|
|
64
65
|
"rimraf": "5.0.5",
|
|
65
|
-
"storybook": "
|
|
66
|
-
"tsx": "
|
|
66
|
+
"storybook": "8.0.4",
|
|
67
|
+
"tsx": "4.7.0"
|
|
67
68
|
},
|
|
68
69
|
"files": [
|
|
69
70
|
"dist/**/*",
|