ag-common 0.0.894 → 0.0.896
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/LICENSE.md +2 -3
- package/README.md +2 -2
- package/dist/api/helpers/acm.d.ts +1 -1
- package/dist/api/helpers/acm.js +3 -3
- package/dist/api/helpers/api.d.ts +2 -2
- package/dist/api/helpers/api.js +26 -22
- package/dist/api/helpers/apigw.js +4 -4
- package/dist/api/helpers/aws.js +2 -2
- package/dist/api/helpers/cosmos/delete.d.ts +1 -1
- package/dist/api/helpers/cosmos/delete.js +15 -16
- package/dist/api/helpers/cosmos/get.d.ts +3 -3
- package/dist/api/helpers/cosmos/get.js +26 -32
- package/dist/api/helpers/cosmos/index.d.ts +3 -3
- package/dist/api/helpers/cosmos/index.js +1 -1
- package/dist/api/helpers/cosmos/utils.d.ts +1 -1
- package/dist/api/helpers/cosmos/utils.js +3 -7
- package/dist/api/helpers/cosmos/write.d.ts +1 -1
- package/dist/api/helpers/cosmos/write.js +11 -12
- package/dist/api/helpers/dynamo/delete.d.ts +1 -1
- package/dist/api/helpers/dynamo/delete.js +3 -3
- package/dist/api/helpers/dynamo/get.d.ts +2 -2
- package/dist/api/helpers/dynamo/get.js +20 -14
- package/dist/api/helpers/dynamo/index.d.ts +10 -38
- package/dist/api/helpers/dynamo/index.js +4 -4
- package/dist/api/helpers/dynamo/set.d.ts +1 -1
- package/dist/api/helpers/dynamo/set.js +10 -10
- package/dist/api/helpers/dynamo/types.d.ts +3 -3
- package/dist/api/helpers/dynamo/types.js +1 -1
- package/dist/api/helpers/enforceDynamoProvisionCap.d.ts +13 -1
- package/dist/api/helpers/enforceDynamoProvisionCap.js +3 -4
- package/dist/api/helpers/google/apikey.js +1 -1
- package/dist/api/helpers/google/gemini.d.ts +1 -1
- package/dist/api/helpers/google/gemini.js +43 -45
- package/dist/api/helpers/google/index.d.ts +2 -2
- package/dist/api/helpers/index.d.ts +17 -17
- package/dist/api/helpers/retryOnError.js +6 -11
- package/dist/api/helpers/s3.d.ts +9 -9
- package/dist/api/helpers/s3.js +19 -16
- package/dist/api/helpers/ses.d.ts +1 -1
- package/dist/api/helpers/ses.js +9 -9
- package/dist/api/helpers/sqs.d.ts +1 -1
- package/dist/api/helpers/sqs.js +1 -1
- package/dist/api/helpers/ssm.d.ts +1 -1
- package/dist/api/helpers/ssm.js +2 -2
- package/dist/api/helpers/ssmInfra/apigw.d.ts +6 -6
- package/dist/api/helpers/ssmInfra/apigw.js +6 -10
- package/dist/api/helpers/ssmInfra/dynamo.d.ts +2 -2
- package/dist/api/helpers/ssmInfra/dynamo.js +1 -1
- package/dist/api/helpers/ssmInfra/index.d.ts +4 -4
- package/dist/api/helpers/ssmInfra/s3.d.ts +3 -3
- package/dist/api/helpers/ssmInfra/s3.js +1 -1
- package/dist/api/helpers/ssmInfra/sqs.d.ts +3 -3
- package/dist/api/helpers/ssmInfra/sqs.js +1 -1
- package/dist/api/helpers/sts.d.ts +1 -1
- package/dist/api/helpers/sts.js +4 -4
- package/dist/api/helpers/validations.d.ts +2 -2
- package/dist/api/helpers/validations.js +14 -14
- package/dist/api/helpers/zod.d.ts +1 -1
- package/dist/api/helpers/zod.js +21 -27
- package/dist/api/index.d.ts +2 -2
- package/dist/api/types/aws.d.ts +0 -56
- package/dist/api/types/aws.js +0 -1
- package/dist/api/types/index.d.ts +1 -1
- package/dist/common/helpers/array.js +9 -10
- package/dist/common/helpers/async.js +2 -2
- package/dist/common/helpers/binary.d.ts +1 -1
- package/dist/common/helpers/binary.js +1 -1
- package/dist/common/helpers/csv.d.ts +4 -2
- package/dist/common/helpers/csv.js +8 -12
- package/dist/common/helpers/date.d.ts +2 -4
- package/dist/common/helpers/date.js +2 -2
- package/dist/common/helpers/email.js +2 -2
- package/dist/common/helpers/fetch.js +8 -8
- package/dist/common/helpers/generator.js +2 -2
- package/dist/common/helpers/groupBy.js +0 -2
- package/dist/common/helpers/hashCode.js +2 -6
- package/dist/common/helpers/headers.d.ts +20 -20
- package/dist/common/helpers/headers.js +38 -38
- package/dist/common/helpers/i18n.d.ts +2 -2
- package/dist/common/helpers/i18n.js +5 -6
- package/dist/common/helpers/index.d.ts +25 -25
- package/dist/common/helpers/log.d.ts +1 -1
- package/dist/common/helpers/log.js +30 -30
- package/dist/common/helpers/math.d.ts +2 -2
- package/dist/common/helpers/math.js +6 -6
- package/dist/common/helpers/memo.d.ts +1 -1
- package/dist/common/helpers/memo.js +1 -3
- package/dist/common/helpers/node-cache.d.ts +2 -2
- package/dist/common/helpers/node-cache.js +0 -1
- package/dist/common/helpers/object.d.ts +1 -1
- package/dist/common/helpers/object.js +16 -27
- package/dist/common/helpers/secondsInNearest.js +5 -5
- package/dist/common/helpers/stream.js +4 -6
- package/dist/common/helpers/string/base64.js +2 -2
- package/dist/common/helpers/string/chunk.js +1 -1
- package/dist/common/helpers/string/contains.js +1 -3
- package/dist/common/helpers/string/getExtendedStringSegment.js +1 -1
- package/dist/common/helpers/string/index.d.ts +11 -11
- package/dist/common/helpers/string/json.js +1 -1
- package/dist/common/helpers/string/redact.js +38 -39
- package/dist/common/helpers/string/trim.js +4 -4
- package/dist/common/helpers/string/truncate.js +1 -1
- package/dist/common/helpers/string/url.js +7 -8
- package/dist/common/helpers/withRetry.js +7 -7
- package/dist/common/helpers/xml.d.ts +7 -3
- package/dist/common/helpers/xml.js +33 -36
- package/dist/common/index.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/node/helpers/fetch.js +1 -2
- package/dist/node/helpers/fs.js +2 -2
- package/dist/node/helpers/index.d.ts +2 -2
- package/dist/node/index.d.ts +1 -1
- package/dist/ui/components/DarkMode/Base.d.ts +4 -4
- package/dist/ui/components/DarkMode/Base.js +26 -31
- package/dist/ui/components/DarkMode/index.d.ts +2 -2
- package/dist/ui/components/DarkMode/types.d.ts +5 -5
- package/dist/ui/components/HeadersRaw/index.d.ts +2 -2
- package/dist/ui/components/HeadersRaw/index.js +5 -5
- package/dist/ui/components/Markdown/index.d.ts +1 -1
- package/dist/ui/components/Markdown/index.js +10 -10
- package/dist/ui/components/index.d.ts +4 -4
- package/dist/ui/components/shadcn/accordion.d.ts +4 -4
- package/dist/ui/components/shadcn/accordion.js +6 -6
- package/dist/ui/components/shadcn/alert.d.ts +2 -2
- package/dist/ui/components/shadcn/alert.js +6 -6
- package/dist/ui/components/shadcn/avatar.d.ts +2 -2
- package/dist/ui/components/shadcn/avatar.js +4 -4
- package/dist/ui/components/shadcn/button.d.ts +4 -4
- package/dist/ui/components/shadcn/button.js +14 -14
- package/dist/ui/components/shadcn/card.d.ts +2 -2
- package/dist/ui/components/shadcn/card.js +6 -6
- package/dist/ui/components/shadcn/checkbox.d.ts +2 -2
- package/dist/ui/components/shadcn/checkbox.js +3 -3
- package/dist/ui/components/shadcn/dialog.d.ts +10 -10
- package/dist/ui/components/shadcn/dialog.js +9 -11
- package/dist/ui/components/shadcn/divider.d.ts +1 -1
- package/dist/ui/components/shadcn/divider.js +1 -1
- package/dist/ui/components/shadcn/dropdown-list.d.ts +1 -1
- package/dist/ui/components/shadcn/dropdown-list.js +5 -5
- package/dist/ui/components/shadcn/dropdown-menu.d.ts +6 -6
- package/dist/ui/components/shadcn/dropdown-menu.js +11 -11
- package/dist/ui/components/shadcn/index.d.ts +21 -21
- package/dist/ui/components/shadcn/input-selector.d.ts +1 -1
- package/dist/ui/components/shadcn/input-selector.js +10 -12
- package/dist/ui/components/shadcn/input.d.ts +1 -1
- package/dist/ui/components/shadcn/input.js +1 -1
- package/dist/ui/components/shadcn/label.d.ts +3 -3
- package/dist/ui/components/shadcn/label.js +2 -2
- package/dist/ui/components/shadcn/popover.d.ts +2 -2
- package/dist/ui/components/shadcn/popover.js +3 -3
- package/dist/ui/components/shadcn/radio-group.d.ts +2 -2
- package/dist/ui/components/shadcn/radio-group.js +2 -2
- package/dist/ui/components/shadcn/scroll-area.d.ts +2 -2
- package/dist/ui/components/shadcn/scroll-area.js +3 -5
- package/dist/ui/components/shadcn/select.d.ts +2 -2
- package/dist/ui/components/shadcn/select.js +12 -12
- package/dist/ui/components/shadcn/sheet.d.ts +12 -12
- package/dist/ui/components/shadcn/sheet.js +15 -15
- package/dist/ui/components/shadcn/switch.d.ts +2 -2
- package/dist/ui/components/shadcn/switch.js +3 -3
- package/dist/ui/components/shadcn/textarea.d.ts +1 -1
- package/dist/ui/components/shadcn/textarea.js +1 -1
- package/dist/ui/components/shadcn/toast.d.ts +2 -2
- package/dist/ui/components/shadcn/toast.js +25 -25
- package/dist/ui/helpers/cognito.d.ts +1 -1
- package/dist/ui/helpers/cookie/const.js +1 -1
- package/dist/ui/helpers/cookie/get.js +3 -4
- package/dist/ui/helpers/cookie/index.d.ts +5 -5
- package/dist/ui/helpers/cookie/raw.d.ts +1 -1
- package/dist/ui/helpers/cookie/raw.js +8 -9
- package/dist/ui/helpers/cookie/use.d.ts +1 -1
- package/dist/ui/helpers/cookie/use.js +4 -4
- package/dist/ui/helpers/date.js +8 -8
- package/dist/ui/helpers/debounce.js +1 -1
- package/dist/ui/helpers/dom.d.ts +1 -1
- package/dist/ui/helpers/dom.js +4 -14
- package/dist/ui/helpers/index.d.ts +26 -26
- package/dist/ui/helpers/jwt.d.ts +3 -3
- package/dist/ui/helpers/openDialog.d.ts +2 -2
- package/dist/ui/helpers/openDialog.js +8 -8
- package/dist/ui/helpers/plural.js +1 -1
- package/dist/ui/helpers/routes.d.ts +2 -2
- package/dist/ui/helpers/routes.js +14 -15
- package/dist/ui/helpers/serviceWorker.js +1 -1
- package/dist/ui/helpers/useContextMenu.d.ts +1 -1
- package/dist/ui/helpers/useContextMenu.js +9 -10
- package/dist/ui/helpers/useElementAttribute.js +3 -5
- package/dist/ui/helpers/useGranularHook.d.ts +1 -1
- package/dist/ui/helpers/useGranularHook.js +2 -3
- package/dist/ui/helpers/useInterval.d.ts +2 -2
- package/dist/ui/helpers/useInterval.js +2 -2
- package/dist/ui/helpers/useIsInViewport.d.ts +1 -1
- package/dist/ui/helpers/useIsInViewport.js +0 -1
- package/dist/ui/helpers/useLocalStorage.js +6 -6
- package/dist/ui/helpers/useLockBodyScroll.js +2 -2
- package/dist/ui/helpers/useOnClickOutside.d.ts +1 -1
- package/dist/ui/helpers/useOnClickOutside.js +3 -6
- package/dist/ui/helpers/useOnScroll.d.ts +1 -1
- package/dist/ui/helpers/useOnScroll.js +3 -4
- package/dist/ui/helpers/useOverloadPageSearch.js +8 -10
- package/dist/ui/helpers/useQueryString.js +7 -7
- package/dist/ui/helpers/useResize.js +5 -6
- package/dist/ui/helpers/useTimeout.js +1 -1
- package/dist/ui/helpers/useTooltip.d.ts +2 -2
- package/dist/ui/helpers/useTooltip.js +5 -7
- package/dist/ui/helpers/utils.d.ts +2 -2
- package/dist/ui/icons/Checkmark.d.ts +2 -2
- package/dist/ui/icons/Checkmark.js +1 -1
- package/dist/ui/icons/ChevronRight.d.ts +1 -1
- package/dist/ui/icons/Circle.d.ts +2 -2
- package/dist/ui/icons/Circle.js +1 -1
- package/dist/ui/icons/CircleDot.d.ts +2 -2
- package/dist/ui/icons/Cog.d.ts +2 -2
- package/dist/ui/icons/Computer.d.ts +2 -2
- package/dist/ui/icons/Door.d.ts +1 -1
- package/dist/ui/icons/Hamburger.d.ts +1 -1
- package/dist/ui/icons/HorizontalDots.d.ts +1 -1
- package/dist/ui/icons/House.d.ts +2 -2
- package/dist/ui/icons/Magnify.d.ts +2 -2
- package/dist/ui/icons/Magnify.js +1 -1
- package/dist/ui/icons/Moon.d.ts +2 -2
- package/dist/ui/icons/Pencil.d.ts +1 -1
- package/dist/ui/icons/Save.d.ts +1 -1
- package/dist/ui/icons/Sun.d.ts +1 -1
- package/dist/ui/icons/Sun.js +1 -1
- package/dist/ui/icons/Undo.d.ts +1 -1
- package/dist/ui/icons/UserOutline.d.ts +1 -1
- package/dist/ui/icons/Warning.d.ts +2 -2
- package/dist/ui/icons/Warning.js +1 -1
- package/dist/ui/icons/index.d.ts +32 -74
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/styles/colours.js +29 -29
- package/dist/ui/styles/common.d.ts +1 -1
- package/dist/ui/styles/common.js +10 -10
- package/dist/ui/styles/index.d.ts +3 -3
- package/package.json +65 -75
|
@@ -7,11 +7,11 @@ function useLockBodyScroll(enabled) {
|
|
|
7
7
|
let originalStyle;
|
|
8
8
|
if (enabled) {
|
|
9
9
|
originalStyle = window.getComputedStyle(document.body).overflow;
|
|
10
|
-
document.body.style.overflow =
|
|
10
|
+
document.body.style.overflow = "hidden";
|
|
11
11
|
}
|
|
12
12
|
return () => {
|
|
13
13
|
if (enabled) {
|
|
14
|
-
document.body.style.overflow = originalStyle ||
|
|
14
|
+
document.body.style.overflow = originalStyle || "";
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
}, [enabled]);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useOnClickOutside = useOnClickOutside;
|
|
5
5
|
const react_1 = require("react");
|
|
@@ -7,9 +7,7 @@ const dom_1 = require("./dom");
|
|
|
7
7
|
function useOnClickOutside(p, handler) {
|
|
8
8
|
(0, react_1.useEffect)(() => {
|
|
9
9
|
const listener = (event) => {
|
|
10
|
-
const disabled = !p.disabled || typeof p.disabled ===
|
|
11
|
-
? (p.disabled ?? false)
|
|
12
|
-
: p.disabled();
|
|
10
|
+
const disabled = !p.disabled || typeof p.disabled === "boolean" ? (p.disabled ?? false) : p.disabled();
|
|
13
11
|
if (disabled) {
|
|
14
12
|
return;
|
|
15
13
|
}
|
|
@@ -47,9 +45,8 @@ function useOnClickOutside(p, handler) {
|
|
|
47
45
|
document.removeEventListener(`mousedown`, listener);
|
|
48
46
|
document.removeEventListener(`touchstart`, listener);
|
|
49
47
|
document.removeEventListener(`mousemove`, listener);
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
51
48
|
}
|
|
52
|
-
catch
|
|
49
|
+
catch {
|
|
53
50
|
//
|
|
54
51
|
}
|
|
55
52
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useOnScroll = useOnScroll;
|
|
5
5
|
const react_1 = require("react");
|
|
@@ -40,7 +40,7 @@ function useOnScroll({ onScroll, element, } = {}) {
|
|
|
40
40
|
if (l) {
|
|
41
41
|
setStartScrollTopY(l.y);
|
|
42
42
|
}
|
|
43
|
-
}, { key:
|
|
43
|
+
}, { key: "onscroll", time: 20 });
|
|
44
44
|
};
|
|
45
45
|
(element?.current ?? document).addEventListener(`scroll`, listenDebounce, {
|
|
46
46
|
passive: true,
|
|
@@ -48,9 +48,8 @@ function useOnScroll({ onScroll, element, } = {}) {
|
|
|
48
48
|
return () => {
|
|
49
49
|
try {
|
|
50
50
|
(element?.current ?? document).removeEventListener(`scroll`, listenDebounce);
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
52
51
|
}
|
|
53
|
-
catch
|
|
52
|
+
catch {
|
|
54
53
|
//
|
|
55
54
|
}
|
|
56
55
|
};
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useOverloadPageSearch = void 0;
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const useOverloadPageSearch = ({ disabled = false, onTrigger, }) => {
|
|
7
7
|
(0, react_1.useEffect)(() => {
|
|
8
8
|
const ctrlF = (e) => {
|
|
9
|
-
const macSearch = e.metaKey && e.code ===
|
|
10
|
-
const winSearch = e.ctrlKey && e.code ===
|
|
9
|
+
const macSearch = e.metaKey && e.code === "KeyF";
|
|
10
|
+
const winSearch = e.ctrlKey && e.code === "KeyF";
|
|
11
11
|
if (winSearch || macSearch) {
|
|
12
12
|
e.preventDefault();
|
|
13
13
|
onTrigger();
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
try {
|
|
17
|
-
window.removeEventListener(
|
|
17
|
+
window.removeEventListener("keydown", ctrlF);
|
|
18
18
|
if (!disabled) {
|
|
19
|
-
window.addEventListener(
|
|
19
|
+
window.addEventListener("keydown", ctrlF);
|
|
20
20
|
}
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
21
|
}
|
|
23
|
-
catch
|
|
22
|
+
catch {
|
|
24
23
|
//
|
|
25
24
|
}
|
|
26
25
|
return () => {
|
|
27
26
|
try {
|
|
28
|
-
window.removeEventListener(
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
27
|
+
window.removeEventListener("keydown", ctrlF);
|
|
30
28
|
}
|
|
31
|
-
catch
|
|
29
|
+
catch {
|
|
32
30
|
//
|
|
33
31
|
}
|
|
34
32
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useQueryStringSingle = exports.useQueryStringArray = exports.useQueryStringRaw = void 0;
|
|
5
5
|
const react_1 = require("react");
|
|
@@ -23,13 +23,13 @@ const useQueryStringRaw = ({ name, queryValues, defaultValue, stringify, parse,
|
|
|
23
23
|
else {
|
|
24
24
|
delete qv[name];
|
|
25
25
|
}
|
|
26
|
-
const qs =
|
|
27
|
-
if (typeof window !==
|
|
26
|
+
const qs = "?" + (0, object_1.objectToString)(qv, "=", "&");
|
|
27
|
+
if (typeof window !== "undefined") {
|
|
28
28
|
const loc = window.location.pathname + qs + window.location.hash;
|
|
29
|
-
window.history.replaceState({},
|
|
29
|
+
window.history.replaceState({}, "", loc);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
(0, log_1.info)(
|
|
32
|
+
(0, log_1.info)("cant change url params on server");
|
|
33
33
|
}
|
|
34
34
|
setStateRaw(v);
|
|
35
35
|
};
|
|
@@ -51,8 +51,8 @@ const useQueryStringArray = ({ name, queryValues, defaultValue, }) => (0, export
|
|
|
51
51
|
name,
|
|
52
52
|
defaultValue,
|
|
53
53
|
queryValues,
|
|
54
|
-
stringify: (v) => (v.length === 0 ? undefined : v.join(
|
|
55
|
-
parse: (v) => (!v ? defaultValue : v.split(
|
|
54
|
+
stringify: (v) => (v.length === 0 ? undefined : v.join(",")),
|
|
55
|
+
parse: (v) => (!v ? defaultValue : v.split(",")),
|
|
56
56
|
});
|
|
57
57
|
exports.useQueryStringArray = useQueryStringArray;
|
|
58
58
|
/**
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use client';
|
|
2
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.useResize = useResize;
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const media_1 = require("../styles/media");
|
|
7
7
|
function getWindowDimensions() {
|
|
8
|
-
if (typeof window ===
|
|
8
|
+
if (typeof window === "undefined") {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
11
|
const width = window.innerWidth;
|
|
@@ -28,14 +28,13 @@ function useResize() {
|
|
|
28
28
|
}
|
|
29
29
|
setWindowDimensions(wd);
|
|
30
30
|
}
|
|
31
|
-
window.addEventListener(
|
|
31
|
+
window.addEventListener("resize", handleResize);
|
|
32
32
|
handleResize();
|
|
33
33
|
return () => {
|
|
34
34
|
try {
|
|
35
|
-
window.removeEventListener(
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
35
|
+
window.removeEventListener("resize", handleResize);
|
|
37
36
|
}
|
|
38
|
-
catch
|
|
37
|
+
catch {
|
|
39
38
|
//
|
|
40
39
|
}
|
|
41
40
|
};
|
|
@@ -97,7 +97,7 @@ const Comp = ({ pos, children, }) => {
|
|
|
97
97
|
right,
|
|
98
98
|
top,
|
|
99
99
|
bottom,
|
|
100
|
-
...(!pos.hasParent && { position:
|
|
100
|
+
...(!pos.hasParent && { position: "fixed" }),
|
|
101
101
|
...(!size && { zIndex: -1 }),
|
|
102
102
|
} }, children(pos, size)));
|
|
103
103
|
const e = document.querySelector(`#${pos.portalId}`);
|
|
@@ -107,26 +107,24 @@ const Comp = ({ pos, children, }) => {
|
|
|
107
107
|
return Content;
|
|
108
108
|
};
|
|
109
109
|
const useTooltip = (p) => {
|
|
110
|
-
const portalId = p?.portalId ||
|
|
110
|
+
const portalId = p?.portalId || "ag-tooltip-portal";
|
|
111
111
|
const [pos, setPosRaw] = (0, react_1.useState)();
|
|
112
112
|
(0, react_1.useEffect)(() => {
|
|
113
113
|
if (document.querySelectorAll(`#${portalId}`).length > 0) {
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
const d = document.createElement(
|
|
116
|
+
const d = document.createElement("div");
|
|
117
117
|
d.id = portalId;
|
|
118
118
|
document.body.appendChild(d);
|
|
119
119
|
return () => {
|
|
120
120
|
try {
|
|
121
121
|
document.querySelector(`#${portalId}`)?.remove();
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
123
122
|
}
|
|
124
|
-
catch
|
|
123
|
+
catch {
|
|
125
124
|
//
|
|
126
125
|
}
|
|
127
126
|
};
|
|
128
|
-
|
|
129
|
-
}, []);
|
|
127
|
+
}, [portalId]);
|
|
130
128
|
const setPos = (p) => {
|
|
131
129
|
if (!p) {
|
|
132
130
|
setPosRaw(undefined);
|
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Checkmark = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Checkmark = ({ style, }) => (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "2 2 20 20", style: style },
|
|
9
|
-
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ??
|
|
9
|
+
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ?? "#000", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M8 12.333 10.461 15 16 9m5 3a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" })));
|
|
10
10
|
exports.Checkmark = Checkmark;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const ChevronRight: React.JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CSSProperties } from
|
|
2
|
-
import React from
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import React from "react";
|
|
3
3
|
export declare const Circle: ({ style, dotted, }: {
|
|
4
4
|
style?: {
|
|
5
5
|
/** change the colour of the circle. default black */
|
package/dist/ui/icons/Circle.js
CHANGED
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Circle = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Circle = ({ style, dotted = false, }) => (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "2 2 20 20", style: style },
|
|
9
|
-
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ??
|
|
9
|
+
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ?? "#000", strokeLinecap: "round", strokeLinejoin: "round", strokeDasharray: !dotted ? "" : "4 4", strokeWidth: "2", d: "M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" })));
|
|
10
10
|
exports.Circle = Circle;
|
package/dist/ui/icons/Cog.d.ts
CHANGED
package/dist/ui/icons/Door.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const Door: React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const HorizontalDots: React.JSX.Element;
|
package/dist/ui/icons/House.d.ts
CHANGED
package/dist/ui/icons/Magnify.js
CHANGED
|
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Magnify = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Magnify = ({ style, }) => (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 490 490", style: style },
|
|
9
|
-
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ??
|
|
9
|
+
react_1.default.createElement("path", { fill: "none", stroke: style?.fill ?? "black", strokeWidth: "36", strokeLinecap: "round", d: "M280 278a153 153 0 1 0-2 2l170 170m-91-117 110 110-26 26-110-110" })));
|
|
10
10
|
exports.Magnify = Magnify;
|
package/dist/ui/icons/Moon.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const Pencil: () => React.JSX.Element;
|
package/dist/ui/icons/Save.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const Save: () => React.JSX.Element;
|
package/dist/ui/icons/Sun.d.ts
CHANGED
package/dist/ui/icons/Sun.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.Sun = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const Sun = (p) => (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" },
|
|
9
|
-
react_1.default.createElement("g", { stroke: p?.style?.fill ??
|
|
9
|
+
react_1.default.createElement("g", { stroke: p?.style?.fill ?? "black", strokeMiterlimit: "10", strokeWidth: "1.5", clipPath: "url(#a)" },
|
|
10
10
|
react_1.default.createElement("path", { strokeLinecap: "round", d: "M5 12H1m22 0h-4M7.05 7.05 4.222 4.222m15.556 15.556L16.95 16.95m-9.9 0-2.828 2.828M19.778 4.222 16.95 7.05" }),
|
|
11
11
|
react_1.default.createElement("path", { fillOpacity: "0", d: "M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" }),
|
|
12
12
|
react_1.default.createElement("path", { strokeLinecap: "round", d: "M12 19v4m0-22v4" })),
|
package/dist/ui/icons/Undo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const Undo: () => React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from "react";
|
|
2
2
|
export declare const UserOutline: React.JSX.Element;
|
package/dist/ui/icons/Warning.js
CHANGED
|
@@ -11,6 +11,6 @@ const Warning = ({ style, className, }) => (react_1.default.createElement("svg",
|
|
|
11
11
|
react_1.default.createElement("linearGradient", { id: "a", x2: "0", y1: "45.47", y2: "-.599", gradientTransform: "matrix(1.31117 0 0 1.30239 737.39 159.91)", gradientUnits: "userSpaceOnUse" },
|
|
12
12
|
react_1.default.createElement("stop", { stopColor: "none" }),
|
|
13
13
|
react_1.default.createElement("stop", { offset: "1", stopColor: "none" }))),
|
|
14
|
-
react_1.default.createElement("path", { fill: style?.fill ??
|
|
14
|
+
react_1.default.createElement("path", { fill: style?.fill ?? "#ffc515", stroke: "url(#a)", strokeWidth: "4px", d: "m797.94 212.01-25.607-48c-.736-1.333-2.068-2.074-3.551-2.074s-2.822.889-3.569 2.222l-25.417 48c-.598 1.185-.605 2.815.132 4s1.921 1.778 3.404 1.778h51.02c1.483 0 2.821-.741 3.42-1.926.747-1.185.753-2.667.165-4", transform: "translate(-627.02 -130.8) scale(.85714)" }),
|
|
15
15
|
react_1.default.createElement("path", { fillOpacity: ".75", stroke: "none", strokeWidth: ".90168", d: "M31.996 24.239a1.93 1.93 0 0 0-1.926 1.92v11.559c0 1.06.855 1.92 1.926 1.92a1.929 1.929 0 0 0 1.925-1.92v-11.56c0-1.06-.853-1.92-1.925-1.92zm0 19.249c-1.064 0-1.926.86-1.926 1.925 0 1.064.86 1.925 1.926 1.925 1.064 0 1.925-.86 1.925-1.925a1.922 1.922 0 0 0-1.925-1.925z" })));
|
|
16
16
|
exports.Warning = Warning;
|
package/dist/ui/icons/index.d.ts
CHANGED
|
@@ -1,81 +1,39 @@
|
|
|
1
|
-
import { Checkmark } from
|
|
2
|
-
import { ChevronRight } from
|
|
3
|
-
import { Circle } from
|
|
4
|
-
import { CircleDot } from
|
|
5
|
-
import { Cog } from
|
|
6
|
-
import { Computer } from
|
|
7
|
-
import { Door } from
|
|
8
|
-
import { Hamburger } from
|
|
9
|
-
import { HorizontalDots } from
|
|
10
|
-
import { House } from
|
|
11
|
-
import { Magnify } from
|
|
12
|
-
import { Moon } from
|
|
13
|
-
import { Pencil } from
|
|
14
|
-
import { Save } from
|
|
15
|
-
import { Sun } from
|
|
16
|
-
import { Undo } from
|
|
17
|
-
import { UserOutline } from
|
|
18
|
-
import { Warning } from
|
|
1
|
+
import { Checkmark } from "./Checkmark";
|
|
2
|
+
import { ChevronRight } from "./ChevronRight";
|
|
3
|
+
import { Circle } from "./Circle";
|
|
4
|
+
import { CircleDot } from "./CircleDot";
|
|
5
|
+
import { Cog } from "./Cog";
|
|
6
|
+
import { Computer } from "./Computer";
|
|
7
|
+
import { Door } from "./Door";
|
|
8
|
+
import { Hamburger } from "./Hamburger";
|
|
9
|
+
import { HorizontalDots } from "./HorizontalDots";
|
|
10
|
+
import { House } from "./House";
|
|
11
|
+
import { Magnify } from "./Magnify";
|
|
12
|
+
import { Moon } from "./Moon";
|
|
13
|
+
import { Pencil } from "./Pencil";
|
|
14
|
+
import { Save } from "./Save";
|
|
15
|
+
import { Sun } from "./Sun";
|
|
16
|
+
import { Undo } from "./Undo";
|
|
17
|
+
import { UserOutline } from "./UserOutline";
|
|
18
|
+
import { Warning } from "./Warning";
|
|
19
19
|
declare const icons: {
|
|
20
|
-
Cog:
|
|
21
|
-
|
|
22
|
-
fill?: string;
|
|
23
|
-
} & import("react").CSSProperties;
|
|
24
|
-
}) => import("react").JSX.Element;
|
|
25
|
-
Checkmark: ({ style, }: {
|
|
26
|
-
style?: {
|
|
27
|
-
fill?: string;
|
|
28
|
-
} & import("react").CSSProperties;
|
|
29
|
-
}) => import("react").JSX.Element;
|
|
20
|
+
Cog: typeof Cog;
|
|
21
|
+
Checkmark: typeof Checkmark;
|
|
30
22
|
ChevronRight: import("react").JSX.Element;
|
|
31
|
-
Circle:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} & import("react").CSSProperties;
|
|
35
|
-
dotted?: boolean;
|
|
36
|
-
}) => import("react").JSX.Element;
|
|
37
|
-
CircleDot: ({ style }: {
|
|
38
|
-
style?: import("react").CSSProperties;
|
|
39
|
-
}) => import("react").JSX.Element;
|
|
40
|
-
Computer: ({ style, }: {
|
|
41
|
-
style?: {
|
|
42
|
-
fill?: string;
|
|
43
|
-
} & import("react").CSSProperties;
|
|
44
|
-
}) => import("react").JSX.Element;
|
|
23
|
+
Circle: typeof Circle;
|
|
24
|
+
CircleDot: typeof CircleDot;
|
|
25
|
+
Computer: typeof Computer;
|
|
45
26
|
Door: import("react").JSX.Element;
|
|
46
|
-
Hamburger:
|
|
47
|
-
|
|
48
|
-
}) => import("react").JSX.Element;
|
|
49
|
-
House: ({ style, }: {
|
|
50
|
-
style?: {
|
|
51
|
-
fill?: string;
|
|
52
|
-
} & import("react").CSSProperties;
|
|
53
|
-
}) => import("react").JSX.Element;
|
|
27
|
+
Hamburger: typeof Hamburger;
|
|
28
|
+
House: typeof House;
|
|
54
29
|
HorizontalDots: import("react").JSX.Element;
|
|
55
|
-
Magnify:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
style?: {
|
|
62
|
-
fill?: string;
|
|
63
|
-
} & import("react").CSSProperties;
|
|
64
|
-
}) => import("react").JSX.Element;
|
|
65
|
-
Pencil: () => import("react").JSX.Element;
|
|
66
|
-
Save: () => import("react").JSX.Element;
|
|
67
|
-
Sun: (p?: {
|
|
68
|
-
style?: {
|
|
69
|
-
fill?: string;
|
|
70
|
-
};
|
|
71
|
-
}) => import("react").JSX.Element;
|
|
72
|
-
Undo: () => import("react").JSX.Element;
|
|
30
|
+
Magnify: typeof Magnify;
|
|
31
|
+
Moon: typeof Moon;
|
|
32
|
+
Pencil: typeof Pencil;
|
|
33
|
+
Save: typeof Save;
|
|
34
|
+
Sun: typeof Sun;
|
|
35
|
+
Undo: typeof Undo;
|
|
73
36
|
UserOutline: import("react").JSX.Element;
|
|
74
|
-
Warning:
|
|
75
|
-
className?: string;
|
|
76
|
-
style?: {
|
|
77
|
-
fill?: string;
|
|
78
|
-
} & import("react").CSSProperties;
|
|
79
|
-
}) => import("react").JSX.Element;
|
|
37
|
+
Warning: typeof Warning;
|
|
80
38
|
};
|
|
81
39
|
export { Checkmark, ChevronRight, Circle, CircleDot, Cog, Computer, Door, Hamburger, HorizontalDots, House, icons, Magnify, Moon, Pencil, Save, Sun, Undo, UserOutline, Warning, };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from "./components";
|
|
2
|
+
export * from "./helpers";
|
|
3
|
+
export * from "./icons";
|