ag-common 0.0.892 → 0.0.894
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/api/helpers/acm.js +7 -17
- package/dist/api/helpers/api.js +28 -23
- package/dist/api/helpers/apigw.js +54 -71
- package/dist/api/helpers/cosmos/delete.js +81 -94
- package/dist/api/helpers/cosmos/get.js +170 -195
- package/dist/api/helpers/cosmos/index.js +23 -53
- package/dist/api/helpers/cosmos/write.js +88 -92
- package/dist/api/helpers/dynamo/delete.js +22 -52
- package/dist/api/helpers/dynamo/get.js +145 -135
- package/dist/api/helpers/dynamo/set.js +22 -29
- package/dist/api/helpers/enforceDynamoProvisionCap.js +5 -5
- package/dist/api/helpers/google/apikey.js +1 -2
- package/dist/api/helpers/google/gemini.js +26 -37
- package/dist/api/helpers/retryOnError.js +15 -26
- package/dist/api/helpers/s3.js +102 -121
- package/dist/api/helpers/ses.js +19 -26
- package/dist/api/helpers/sqs.js +5 -15
- package/dist/api/helpers/ssmInfra/dynamo.js +9 -5
- package/dist/api/helpers/sts.js +26 -37
- package/dist/api/helpers/validations.js +7 -17
- package/dist/api/helpers/zod.js +1 -2
- package/dist/common/helpers/async.js +27 -42
- package/dist/common/helpers/csv.js +1 -4
- package/dist/common/helpers/date.js +2 -2
- package/dist/common/helpers/fetch.js +42 -55
- package/dist/common/helpers/generator.js +11 -22
- package/dist/common/helpers/i18n.js +3 -5
- package/dist/common/helpers/log.js +4 -4
- package/dist/common/helpers/math.js +1 -2
- package/dist/common/helpers/node-cache.js +10 -2
- package/dist/common/helpers/random.js +2 -2
- package/dist/common/helpers/secondsInNearest.js +1 -2
- package/dist/common/helpers/stream.js +24 -35
- package/dist/common/helpers/string/redact.js +1 -2
- package/dist/common/helpers/withRetry.js +5 -14
- package/dist/common/helpers/xml.js +9 -22
- package/dist/node/helpers/fetch.js +22 -33
- package/dist/ui/components/DarkMode/Base.js +10 -5
- package/dist/ui/components/Markdown/index.js +4 -5
- package/dist/ui/components/shadcn/accordion.js +13 -36
- package/dist/ui/components/shadcn/alert.d.ts +1 -1
- package/dist/ui/components/shadcn/alert.js +3 -23
- package/dist/ui/components/shadcn/avatar.js +4 -24
- package/dist/ui/components/shadcn/button.d.ts +1 -1
- package/dist/ui/components/shadcn/button.js +2 -14
- package/dist/ui/components/shadcn/card.js +6 -35
- package/dist/ui/components/shadcn/checkbox.js +4 -18
- package/dist/ui/components/shadcn/dialog.js +17 -46
- package/dist/ui/components/shadcn/dropdown-list.js +2 -2
- package/dist/ui/components/shadcn/dropdown-menu.js +22 -58
- package/dist/ui/components/shadcn/input-selector.js +4 -5
- package/dist/ui/components/shadcn/input.js +2 -14
- package/dist/ui/components/shadcn/label.d.ts +1 -1
- package/dist/ui/components/shadcn/label.js +2 -16
- package/dist/ui/components/shadcn/popover.js +3 -17
- package/dist/ui/components/shadcn/radio-group.js +4 -17
- package/dist/ui/components/shadcn/scroll-area.js +9 -26
- package/dist/ui/components/shadcn/select.js +23 -55
- package/dist/ui/components/shadcn/sheet.d.ts +1 -1
- package/dist/ui/components/shadcn/sheet.js +13 -42
- package/dist/ui/components/shadcn/switch.js +3 -17
- package/dist/ui/components/shadcn/textarea.js +2 -14
- package/dist/ui/components/shadcn/toast.js +6 -4
- package/dist/ui/helpers/cookie/get.js +5 -1
- package/dist/ui/helpers/cookie/raw.js +1 -2
- package/dist/ui/helpers/cookie/set.js +2 -2
- package/dist/ui/helpers/cookie/use.js +19 -9
- package/dist/ui/helpers/date.js +3 -4
- package/dist/ui/helpers/debounce.js +1 -1
- package/dist/ui/helpers/extractAttributes.js +1 -2
- package/dist/ui/helpers/openDialog.js +1 -2
- package/dist/ui/helpers/routes.js +6 -4
- package/dist/ui/helpers/serviceWorker.js +7 -18
- package/dist/ui/helpers/useContextMenu.js +2 -3
- package/dist/ui/helpers/useElementAttribute.js +1 -1
- package/dist/ui/helpers/useGranularHook.js +2 -2
- package/dist/ui/helpers/useInterval.js +5 -7
- package/dist/ui/helpers/useLocalStorage.js +1 -1
- package/dist/ui/helpers/useOnClickOutside.js +2 -3
- package/dist/ui/helpers/useOnScroll.js +6 -8
- package/dist/ui/helpers/useOverloadPageSearch.js +1 -1
- package/dist/ui/helpers/useQueryString.js +2 -2
- package/dist/ui/helpers/useResize.js +1 -1
- package/dist/ui/helpers/useTimeout.js +1 -1
- package/dist/ui/helpers/useTooltip.js +8 -5
- package/dist/ui/icons/Checkmark.js +2 -5
- package/dist/ui/icons/Circle.js +2 -5
- package/dist/ui/icons/Magnify.js +2 -5
- package/dist/ui/icons/Sun.js +8 -11
- package/dist/ui/icons/Warning.js +7 -10
- package/dist/ui/styles/common.js +8 -20
- package/package.json +66 -65
|
@@ -1,41 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.getStringFromStream = getStringFromStream;
|
|
13
4
|
const log_1 = require("./log");
|
|
14
|
-
function getStringFromStream(stream) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
result += chunkString;
|
|
30
|
-
}
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
async function getStringFromStream(stream) {
|
|
6
|
+
const decoder = new TextDecoder();
|
|
7
|
+
const reader = stream.getReader();
|
|
8
|
+
let result = '';
|
|
9
|
+
try {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
11
|
+
while (true) {
|
|
12
|
+
// eslint-disable-next-line no-await-in-loop
|
|
13
|
+
const { done, value } = await reader.read();
|
|
14
|
+
if (done)
|
|
15
|
+
break;
|
|
16
|
+
// Convert the Uint8Array chunk to a string
|
|
17
|
+
const chunkString = decoder.decode(value);
|
|
18
|
+
// Append the chunk to the final result
|
|
19
|
+
result += chunkString;
|
|
32
20
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
}
|
|
23
|
+
catch (e) {
|
|
24
|
+
(0, log_1.error)('error converting stream');
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
reader.releaseLock();
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
41
30
|
}
|
|
@@ -64,13 +64,12 @@ function redactString(str) {
|
|
|
64
64
|
return ret;
|
|
65
65
|
}
|
|
66
66
|
function getShannonEntropy(str) {
|
|
67
|
-
var _a;
|
|
68
67
|
const len = str.length;
|
|
69
68
|
if (len === 0)
|
|
70
69
|
return 0;
|
|
71
70
|
const frequencies = new Map();
|
|
72
71
|
for (const char of str) {
|
|
73
|
-
frequencies.set(char, (
|
|
72
|
+
frequencies.set(char, (frequencies.get(char) ?? 0) + 1);
|
|
74
73
|
}
|
|
75
74
|
let entropy = 0;
|
|
76
75
|
for (const count of frequencies.values()) {
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.withRetry = void 0;
|
|
13
4
|
/* eslint-disable no-await-in-loop */
|
|
14
5
|
const log_1 = require("./log");
|
|
15
6
|
const sleep_1 = require("./sleep");
|
|
16
|
-
const withRetry = (operation, operationName, opt) =>
|
|
7
|
+
const withRetry = async (operation, operationName, opt) => {
|
|
17
8
|
let retryCount = 0;
|
|
18
9
|
const baseDelay = 2000;
|
|
19
|
-
const { maxRetries = 3 } = opt
|
|
10
|
+
const { maxRetries = 3 } = opt ?? {};
|
|
20
11
|
// eslint-disable-next-line
|
|
21
12
|
while (true) {
|
|
22
13
|
try {
|
|
23
|
-
return
|
|
14
|
+
return await operation();
|
|
24
15
|
}
|
|
25
16
|
catch (e) {
|
|
26
17
|
const error = e;
|
|
@@ -36,11 +27,11 @@ const withRetry = (operation, operationName, opt) => __awaiter(void 0, void 0, v
|
|
|
36
27
|
}
|
|
37
28
|
const delay = baseDelay + retryCount * 1000;
|
|
38
29
|
(0, log_1.warn)(`${operationName}: Throttled. Retry ${retryCount}. Sleeping for ${delay}ms`);
|
|
39
|
-
|
|
30
|
+
await (0, sleep_1.sleep)(delay);
|
|
40
31
|
continue;
|
|
41
32
|
}
|
|
42
33
|
throw error;
|
|
43
34
|
}
|
|
44
35
|
}
|
|
45
|
-
}
|
|
36
|
+
};
|
|
46
37
|
exports.withRetry = withRetry;
|
|
@@ -1,27 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.XMLParser = exports.convertXmlToJson = void 0;
|
|
13
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
14
|
-
const convertXmlToJson = (p) =>
|
|
5
|
+
const convertXmlToJson = async (p) => {
|
|
15
6
|
const parser = new XMLParser();
|
|
16
7
|
const ret = parser.parse(p.xmlData);
|
|
17
8
|
return ret;
|
|
18
|
-
}
|
|
9
|
+
};
|
|
19
10
|
exports.convertXmlToJson = convertXmlToJson;
|
|
20
11
|
class XMLParser {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.currentObject = {};
|
|
24
|
-
}
|
|
12
|
+
stack = [];
|
|
13
|
+
currentObject = {};
|
|
25
14
|
parse(xmlData) {
|
|
26
15
|
const parser = new XMLReader();
|
|
27
16
|
parser.onStartElement = this.onStartElement.bind(this);
|
|
@@ -33,7 +22,7 @@ class XMLParser {
|
|
|
33
22
|
onStartElement(name, attributes) {
|
|
34
23
|
let newObject = {};
|
|
35
24
|
if (Object.keys(attributes).length > 0) {
|
|
36
|
-
newObject =
|
|
25
|
+
newObject = { ...newObject, ...attributes };
|
|
37
26
|
}
|
|
38
27
|
this.stack.push(this.currentObject);
|
|
39
28
|
const parent = this.stack[this.stack.length - 1];
|
|
@@ -64,12 +53,10 @@ class XMLParser {
|
|
|
64
53
|
}
|
|
65
54
|
exports.XMLParser = XMLParser;
|
|
66
55
|
class XMLReader {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.onText = () => { };
|
|
72
|
-
}
|
|
56
|
+
buffer = '';
|
|
57
|
+
onStartElement = () => { };
|
|
58
|
+
onEndElement = () => { };
|
|
59
|
+
onText = () => { };
|
|
73
60
|
parse(xmlData) {
|
|
74
61
|
this.buffer = xmlData.replace(/\r\n/g, '').replace(/\n/g, '');
|
|
75
62
|
const regex = /<\/?([^\s>]+)(\s*[^>]*?)?>|([^<>]+)/g;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
4
|
};
|
|
@@ -18,30 +9,28 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
18
9
|
* download(fetch) file
|
|
19
10
|
* @param p
|
|
20
11
|
*/
|
|
21
|
-
function fetchFile(p) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
if (done) {
|
|
32
|
-
fileStream.close();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
fileStream.write(value);
|
|
36
|
-
yield write();
|
|
37
|
-
});
|
|
38
|
-
yield write();
|
|
39
|
-
try {
|
|
12
|
+
async function fetchFile(p) {
|
|
13
|
+
const response = await fetch(p.FILE_URL);
|
|
14
|
+
if (!response.ok || !response.body) {
|
|
15
|
+
throw new Error(`Failed to download: ${response.statusText}`);
|
|
16
|
+
}
|
|
17
|
+
const fileStream = fs_1.default.createWriteStream(p.FILE_PATH);
|
|
18
|
+
const reader = response.body.getReader();
|
|
19
|
+
const write = async () => {
|
|
20
|
+
const { done, value } = await reader.read();
|
|
21
|
+
if (done) {
|
|
40
22
|
fileStream.close();
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
//
|
|
23
|
+
return;
|
|
45
24
|
}
|
|
46
|
-
|
|
25
|
+
fileStream.write(value);
|
|
26
|
+
await write();
|
|
27
|
+
};
|
|
28
|
+
await write();
|
|
29
|
+
try {
|
|
30
|
+
fileStream.close();
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
//
|
|
35
|
+
}
|
|
47
36
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
2
|
+
"use strict";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -119,10 +119,15 @@ const DarkModeAux = ({ iconSize = '2.5rem', className, mode, onSubmit, style, dm
|
|
|
119
119
|
//
|
|
120
120
|
}
|
|
121
121
|
dm.setDarkmode(newDarkMode);
|
|
122
|
-
onSubmit
|
|
122
|
+
onSubmit?.(newDarkMode);
|
|
123
123
|
};
|
|
124
|
-
return (react_1.default.createElement("div", { className: (0, utils_1.cn)('flex flex-row overflow-hidden justify-between items-center rounded-4xl', 'border-2 border-solid p-[2px] box-border', 'data-[mode=vert]:flex-col', className), "data-mode": mode
|
|
125
|
-
|
|
124
|
+
return (react_1.default.createElement("div", { className: (0, utils_1.cn)('flex flex-row overflow-hidden justify-between items-center rounded-4xl', 'border-2 border-solid p-[2px] box-border', 'data-[mode=vert]:flex-col', className), "data-mode": mode ?? 'horiz', style: {
|
|
125
|
+
...style,
|
|
126
|
+
background,
|
|
127
|
+
borderColor: fill,
|
|
128
|
+
width,
|
|
129
|
+
height,
|
|
130
|
+
} }, modes.map((v, i) => {
|
|
126
131
|
const selected = index === i;
|
|
127
132
|
return (react_1.default.createElement("div", { className: (0, utils_1.cn)('flex flex-col items-center justify-center rounded-full overflow-hidden cursor-pointer', selected && 'bg-white cursor-default'), "data-selected": selected, style: { width: iconSize, height: iconSize },
|
|
128
133
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -140,6 +145,6 @@ exports.DarkModeAux = DarkModeAux;
|
|
|
140
145
|
/** shows darkmode toggle. Persists to cookie, and modifies html classList with either dark-mode or light-mode */
|
|
141
146
|
const DarkMode = (p) => {
|
|
142
147
|
const dm = (0, exports.UseDarkMode)({ cookieDocument: p.cookieDocument });
|
|
143
|
-
return (0, exports.DarkModeAux)(
|
|
148
|
+
return (0, exports.DarkModeAux)({ ...p, dm });
|
|
144
149
|
};
|
|
145
150
|
exports.DarkMode = DarkMode;
|
|
@@ -30,7 +30,6 @@ const injectGroup = ({ output, pos, wrap, }) => {
|
|
|
30
30
|
return output;
|
|
31
31
|
};
|
|
32
32
|
function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
33
|
-
var _a, _b, _c, _d;
|
|
34
33
|
const lines = markdown.split('\n');
|
|
35
34
|
let output = [];
|
|
36
35
|
let ol;
|
|
@@ -39,7 +38,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
39
38
|
let a = -1;
|
|
40
39
|
do {
|
|
41
40
|
a += 1;
|
|
42
|
-
const line =
|
|
41
|
+
const line = lines[a] ?? '';
|
|
43
42
|
const la = line + a;
|
|
44
43
|
const star = /\*\*(.*?)\*\*/gim;
|
|
45
44
|
//handle inline **s
|
|
@@ -62,7 +61,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
62
61
|
}
|
|
63
62
|
//ol
|
|
64
63
|
if (line.match(/^[0-9]+\./gim)) {
|
|
65
|
-
ol
|
|
64
|
+
ol ??= { matchLine: line, outputIndex: output.length };
|
|
66
65
|
}
|
|
67
66
|
else if (ol && ol.matchLine !== line) {
|
|
68
67
|
output = injectGroup({
|
|
@@ -74,7 +73,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
74
73
|
}
|
|
75
74
|
//ul
|
|
76
75
|
if (line.startsWith('-') || line.startsWith('*')) {
|
|
77
|
-
ul
|
|
76
|
+
ul ??= { matchLine: line, outputIndex: output.length };
|
|
78
77
|
}
|
|
79
78
|
else if (ul && ul.matchLine !== line) {
|
|
80
79
|
output = injectGroup({
|
|
@@ -86,7 +85,7 @@ function renderMarkdown({ markdown, preprocessText = (s) => s, }) {
|
|
|
86
85
|
}
|
|
87
86
|
// h1
|
|
88
87
|
if (line.startsWith('#')) {
|
|
89
|
-
const level =
|
|
88
|
+
const level = line.match(/^#+/)?.[0]?.length ?? 0;
|
|
90
89
|
const t = (0, trim_1.trimSide)(line, true, '#').trim();
|
|
91
90
|
if (level === 1) {
|
|
92
91
|
output.push(react_1.default.createElement("h1", { key: t }, preprocessText(t)));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
2
|
+
"use strict";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -33,17 +33,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
37
|
exports.AccordionTrigger = exports.AccordionSimple = exports.AccordionItem = exports.AccordionContent = exports.Accordion = exports.AccordionHeader = void 0;
|
|
49
38
|
const AccordionPrimitive = __importStar(require("@radix-ui/react-accordion"));
|
|
@@ -53,31 +42,19 @@ const utils_1 = require("../../helpers/utils");
|
|
|
53
42
|
const Accordion = AccordionPrimitive.Root;
|
|
54
43
|
exports.Accordion = Accordion;
|
|
55
44
|
exports.AccordionHeader = AccordionPrimitive.AccordionHeader;
|
|
56
|
-
const AccordionItem = (
|
|
57
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
58
|
-
return (React.createElement(AccordionPrimitive.Item, Object.assign({ className: (0, utils_1.cn)('border-b', className) }, props)));
|
|
59
|
-
};
|
|
45
|
+
const AccordionItem = ({ className, ...props }) => (React.createElement(AccordionPrimitive.Item, { className: (0, utils_1.cn)('border-b', className), ...props }));
|
|
60
46
|
exports.AccordionItem = AccordionItem;
|
|
61
|
-
const AccordionTrigger = (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
React.createElement(
|
|
66
|
-
children,
|
|
67
|
-
React.createElement(react_icons_1.ChevronDownIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200", style: { color: chevronColour } })))));
|
|
68
|
-
};
|
|
47
|
+
const AccordionTrigger = ({ className, children, chevronColour = 'currentColor', ...props }) => (React.createElement(AccordionPrimitive.Header, { asChild: true },
|
|
48
|
+
React.createElement("div", { className: "flex" },
|
|
49
|
+
React.createElement(AccordionPrimitive.Trigger, { className: (0, utils_1.cn)('flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180', className), ...props },
|
|
50
|
+
children,
|
|
51
|
+
React.createElement(react_icons_1.ChevronDownIcon, { className: "h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200", style: { color: chevronColour } })))));
|
|
69
52
|
exports.AccordionTrigger = AccordionTrigger;
|
|
70
|
-
const AccordionContent = (
|
|
71
|
-
|
|
72
|
-
return (React.createElement(AccordionPrimitive.Content, Object.assign({ className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down" }, props),
|
|
73
|
-
React.createElement("div", { className: (0, utils_1.cn)('pb-4 pt-0', className) }, children)));
|
|
74
|
-
};
|
|
53
|
+
const AccordionContent = ({ className, children, ...props }) => (React.createElement(AccordionPrimitive.Content, { className: "overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down", ...props },
|
|
54
|
+
React.createElement("div", { className: (0, utils_1.cn)('pb-4 pt-0', className) }, children)));
|
|
75
55
|
exports.AccordionContent = AccordionContent;
|
|
76
|
-
const AccordionSimple = (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
React.createElement(
|
|
80
|
-
React.createElement(AccordionTrigger, { chevronColour: chevronColour }, title),
|
|
81
|
-
React.createElement(AccordionContent, null, children))));
|
|
82
|
-
};
|
|
56
|
+
const AccordionSimple = ({ title, chevronColour = 'currentColor', children, className, ...props }) => (React.createElement(Accordion, { type: "single", collapsible: true, className: (0, utils_1.cn)('w-full', className), ...props },
|
|
57
|
+
React.createElement(AccordionItem, { value: "item-1" },
|
|
58
|
+
React.createElement(AccordionTrigger, { chevronColour: chevronColour }, title),
|
|
59
|
+
React.createElement(AccordionContent, null, children))));
|
|
83
60
|
exports.AccordionSimple = AccordionSimple;
|
|
@@ -2,7 +2,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
-
} & import("class-variance-authority/
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare const Alert: ({ className, variant, ...props }: React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>) => React.JSX.Element;
|
|
7
7
|
declare const AlertTitle: ({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
8
8
|
declare const AlertDescription: ({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>) => React.JSX.Element;
|
|
@@ -32,17 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
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
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
36
|
exports.AlertTitle = exports.AlertDescription = exports.Alert = void 0;
|
|
48
37
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
@@ -59,18 +48,9 @@ const alertVariants = (0, class_variance_authority_1.cva)('relative w-full round
|
|
|
59
48
|
variant: 'default',
|
|
60
49
|
},
|
|
61
50
|
});
|
|
62
|
-
const Alert = (
|
|
63
|
-
var { className, variant } = _a, props = __rest(_a, ["className", "variant"]);
|
|
64
|
-
return (React.createElement("div", Object.assign({ role: "alert", className: (0, utils_1.cn)(alertVariants({ variant }), className) }, props)));
|
|
65
|
-
};
|
|
51
|
+
const Alert = ({ className, variant, ...props }) => (React.createElement("div", { role: "alert", className: (0, utils_1.cn)(alertVariants({ variant }), className), ...props }));
|
|
66
52
|
exports.Alert = Alert;
|
|
67
|
-
const AlertTitle = (
|
|
68
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
69
|
-
return (React.createElement("h5", Object.assign({ className: (0, utils_1.cn)('mb-1 font-medium leading-none tracking-tight', className) }, props)));
|
|
70
|
-
};
|
|
53
|
+
const AlertTitle = ({ className, ...props }) => (React.createElement("h5", { className: (0, utils_1.cn)('mb-1 font-medium leading-none tracking-tight', className), ...props }));
|
|
71
54
|
exports.AlertTitle = AlertTitle;
|
|
72
|
-
const AlertDescription = (
|
|
73
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
74
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('text-sm [&_p]:leading-relaxed', className) }, props)));
|
|
75
|
-
};
|
|
55
|
+
const AlertDescription = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('text-sm [&_p]:leading-relaxed', className), ...props }));
|
|
76
56
|
exports.AlertDescription = AlertDescription;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
2
|
+
"use strict";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -33,34 +33,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
37
|
exports.AvatarFallback = exports.AvatarImage = exports.Avatar = void 0;
|
|
49
38
|
const AvatarPrimitive = __importStar(require("@radix-ui/react-avatar"));
|
|
50
39
|
const React = __importStar(require("react"));
|
|
51
40
|
const utils_1 = require("../../helpers/utils");
|
|
52
|
-
const Avatar = (
|
|
53
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
54
|
-
return (React.createElement(AvatarPrimitive.Root, Object.assign({ className: (0, utils_1.cn)('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className) }, props)));
|
|
55
|
-
};
|
|
41
|
+
const Avatar = ({ className, ...props }) => (React.createElement(AvatarPrimitive.Root, { className: (0, utils_1.cn)('relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full', className), ...props }));
|
|
56
42
|
exports.Avatar = Avatar;
|
|
57
|
-
const AvatarImage = (
|
|
58
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
59
|
-
return (React.createElement(AvatarPrimitive.Image, Object.assign({ className: (0, utils_1.cn)('aspect-square h-full w-full', className) }, props)));
|
|
60
|
-
};
|
|
43
|
+
const AvatarImage = ({ className, ...props }) => (React.createElement(AvatarPrimitive.Image, { className: (0, utils_1.cn)('aspect-square h-full w-full', className), ...props }));
|
|
61
44
|
exports.AvatarImage = AvatarImage;
|
|
62
|
-
const AvatarFallback = (
|
|
63
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
64
|
-
return (React.createElement(AvatarPrimitive.Fallback, Object.assign({ className: (0, utils_1.cn)('flex h-full w-full items-center justify-center rounded-full bg-muted', className) }, props)));
|
|
65
|
-
};
|
|
45
|
+
const AvatarFallback = ({ className, ...props }) => (React.createElement(AvatarPrimitive.Fallback, { className: (0, utils_1.cn)('flex h-full w-full items-center justify-center rounded-full bg-muted', className), ...props }));
|
|
66
46
|
exports.AvatarFallback = AvatarFallback;
|
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
size?: "default" | "icon" | "sm" | "lg" | null | undefined;
|
|
6
|
-
} & import("class-variance-authority/
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>;
|
|
8
8
|
declare const Button: ({ className, variant, size, ...props }: ButtonProps) => React.JSX.Element;
|
|
9
9
|
export { Button, buttonVariants };
|
|
@@ -32,17 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
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
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
36
|
exports.buttonVariants = exports.Button = void 0;
|
|
48
37
|
const class_variance_authority_1 = require("class-variance-authority");
|
|
@@ -71,8 +60,7 @@ const buttonVariants = (0, class_variance_authority_1.cva)('!cursor-pointer inli
|
|
|
71
60
|
},
|
|
72
61
|
});
|
|
73
62
|
exports.buttonVariants = buttonVariants;
|
|
74
|
-
const Button = (
|
|
75
|
-
|
|
76
|
-
return (React.createElement("button", Object.assign({ className: (0, utils_1.cn)(buttonVariants({ variant, size, className })) }, props)));
|
|
63
|
+
const Button = ({ className, variant, size, ...props }) => {
|
|
64
|
+
return (React.createElement("button", { className: (0, utils_1.cn)(buttonVariants({ variant, size, className })), ...props }));
|
|
77
65
|
};
|
|
78
66
|
exports.Button = Button;
|
|
@@ -32,48 +32,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
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
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
36
|
exports.CardTitle = exports.CardHeader = exports.CardFooter = exports.CardDescription = exports.CardContent = exports.Card = void 0;
|
|
48
37
|
const React = __importStar(require("react"));
|
|
49
38
|
const utils_1 = require("../../helpers/utils");
|
|
50
|
-
const Card = (
|
|
51
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
52
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('rounded-xl border bg-card text-card-foreground shadow-sm max-w-full', className) }, props)));
|
|
53
|
-
};
|
|
39
|
+
const Card = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('rounded-xl border bg-card text-card-foreground shadow-sm max-w-full', className), ...props }));
|
|
54
40
|
exports.Card = Card;
|
|
55
|
-
const CardHeader = (
|
|
56
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
57
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('flex flex-col space-y-1.5 p-2 pb-0', className) }, props)));
|
|
58
|
-
};
|
|
41
|
+
const CardHeader = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('flex flex-col space-y-1.5 p-2 pb-0', className), ...props }));
|
|
59
42
|
exports.CardHeader = CardHeader;
|
|
60
|
-
const CardTitle = (
|
|
61
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
62
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('font-semibold leading-none tracking-tight', className) }, props)));
|
|
63
|
-
};
|
|
43
|
+
const CardTitle = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('font-semibold leading-none tracking-tight', className), ...props }));
|
|
64
44
|
exports.CardTitle = CardTitle;
|
|
65
|
-
const CardDescription = (
|
|
66
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
67
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('text-sm text-muted-foreground', className) }, props)));
|
|
68
|
-
};
|
|
45
|
+
const CardDescription = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('text-sm text-muted-foreground', className), ...props }));
|
|
69
46
|
exports.CardDescription = CardDescription;
|
|
70
|
-
const CardContent = (
|
|
71
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
72
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('p-2 pt-0', className) }, props)));
|
|
73
|
-
};
|
|
47
|
+
const CardContent = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('p-2 pt-0', className), ...props }));
|
|
74
48
|
exports.CardContent = CardContent;
|
|
75
|
-
const CardFooter = (
|
|
76
|
-
var { className } = _a, props = __rest(_a, ["className"]);
|
|
77
|
-
return (React.createElement("div", Object.assign({ className: (0, utils_1.cn)('flex items-center p-2 pt-0', className) }, props)));
|
|
78
|
-
};
|
|
49
|
+
const CardFooter = ({ className, ...props }) => (React.createElement("div", { className: (0, utils_1.cn)('flex items-center p-2 pt-0', className), ...props }));
|
|
79
50
|
exports.CardFooter = CardFooter;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
2
|
+
"use strict";
|
|
3
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
4
|
if (k2 === undefined) k2 = k;
|
|
5
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -33,28 +33,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
35
|
})();
|
|
36
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
-
var t = {};
|
|
38
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
-
t[p] = s[p];
|
|
40
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
-
t[p[i]] = s[p[i]];
|
|
44
|
-
}
|
|
45
|
-
return t;
|
|
46
|
-
};
|
|
47
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
37
|
exports.CheckboxIndicator = exports.Checkbox = void 0;
|
|
49
38
|
const CheckboxPrimitive = __importStar(require("@radix-ui/react-checkbox"));
|
|
50
39
|
const react_icons_1 = require("@radix-ui/react-icons");
|
|
51
40
|
const React = __importStar(require("react"));
|
|
52
41
|
const utils_1 = require("../../helpers/utils");
|
|
53
|
-
const Checkbox = (
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
React.createElement(CheckboxPrimitive.Indicator, { className: (0, utils_1.cn)('flex items-center justify-center text-current') },
|
|
57
|
-
React.createElement(react_icons_1.CheckIcon, { className: "h-4 w-4" }))));
|
|
58
|
-
};
|
|
42
|
+
const Checkbox = ({ className, ...props }) => (React.createElement(CheckboxPrimitive.Root, { ...props, className: (0, utils_1.cn)('peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow-sm focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground', className) },
|
|
43
|
+
React.createElement(CheckboxPrimitive.Indicator, { className: (0, utils_1.cn)('flex items-center justify-center text-current') },
|
|
44
|
+
React.createElement(react_icons_1.CheckIcon, { className: "h-4 w-4" }))));
|
|
59
45
|
exports.Checkbox = Checkbox;
|
|
60
46
|
exports.CheckboxIndicator = CheckboxPrimitive.Indicator;
|