ag-common 0.0.893 → 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.
Files changed (92) hide show
  1. package/dist/api/helpers/acm.js +7 -17
  2. package/dist/api/helpers/api.js +28 -23
  3. package/dist/api/helpers/apigw.js +54 -71
  4. package/dist/api/helpers/cosmos/delete.js +81 -94
  5. package/dist/api/helpers/cosmos/get.js +170 -195
  6. package/dist/api/helpers/cosmos/index.js +23 -53
  7. package/dist/api/helpers/cosmos/write.js +88 -92
  8. package/dist/api/helpers/dynamo/delete.js +22 -52
  9. package/dist/api/helpers/dynamo/get.js +145 -135
  10. package/dist/api/helpers/dynamo/set.js +22 -29
  11. package/dist/api/helpers/enforceDynamoProvisionCap.js +5 -5
  12. package/dist/api/helpers/google/apikey.js +1 -2
  13. package/dist/api/helpers/google/gemini.js +26 -37
  14. package/dist/api/helpers/retryOnError.js +15 -26
  15. package/dist/api/helpers/s3.js +102 -121
  16. package/dist/api/helpers/ses.js +19 -26
  17. package/dist/api/helpers/sqs.js +5 -15
  18. package/dist/api/helpers/ssmInfra/dynamo.js +9 -5
  19. package/dist/api/helpers/sts.js +26 -37
  20. package/dist/api/helpers/validations.js +7 -17
  21. package/dist/api/helpers/zod.js +1 -2
  22. package/dist/common/helpers/async.js +27 -42
  23. package/dist/common/helpers/csv.js +1 -4
  24. package/dist/common/helpers/date.js +2 -2
  25. package/dist/common/helpers/fetch.js +42 -55
  26. package/dist/common/helpers/generator.js +11 -22
  27. package/dist/common/helpers/i18n.js +3 -5
  28. package/dist/common/helpers/log.js +4 -4
  29. package/dist/common/helpers/math.js +1 -2
  30. package/dist/common/helpers/node-cache.js +10 -2
  31. package/dist/common/helpers/random.js +2 -2
  32. package/dist/common/helpers/secondsInNearest.js +1 -2
  33. package/dist/common/helpers/stream.js +24 -35
  34. package/dist/common/helpers/string/redact.js +1 -2
  35. package/dist/common/helpers/withRetry.js +5 -14
  36. package/dist/common/helpers/xml.js +9 -22
  37. package/dist/node/helpers/fetch.js +22 -33
  38. package/dist/ui/components/DarkMode/Base.js +10 -5
  39. package/dist/ui/components/Markdown/index.js +4 -5
  40. package/dist/ui/components/shadcn/accordion.js +13 -36
  41. package/dist/ui/components/shadcn/alert.d.ts +1 -1
  42. package/dist/ui/components/shadcn/alert.js +3 -23
  43. package/dist/ui/components/shadcn/avatar.js +4 -24
  44. package/dist/ui/components/shadcn/button.d.ts +1 -1
  45. package/dist/ui/components/shadcn/button.js +2 -14
  46. package/dist/ui/components/shadcn/card.js +6 -35
  47. package/dist/ui/components/shadcn/checkbox.js +4 -18
  48. package/dist/ui/components/shadcn/dialog.js +17 -46
  49. package/dist/ui/components/shadcn/dropdown-list.js +2 -2
  50. package/dist/ui/components/shadcn/dropdown-menu.js +22 -58
  51. package/dist/ui/components/shadcn/input-selector.js +4 -5
  52. package/dist/ui/components/shadcn/input.js +2 -14
  53. package/dist/ui/components/shadcn/label.d.ts +1 -1
  54. package/dist/ui/components/shadcn/label.js +2 -16
  55. package/dist/ui/components/shadcn/popover.js +3 -17
  56. package/dist/ui/components/shadcn/radio-group.js +4 -17
  57. package/dist/ui/components/shadcn/scroll-area.js +9 -26
  58. package/dist/ui/components/shadcn/select.js +23 -55
  59. package/dist/ui/components/shadcn/sheet.d.ts +1 -1
  60. package/dist/ui/components/shadcn/sheet.js +13 -42
  61. package/dist/ui/components/shadcn/switch.js +3 -17
  62. package/dist/ui/components/shadcn/textarea.js +2 -14
  63. package/dist/ui/components/shadcn/toast.js +6 -4
  64. package/dist/ui/helpers/cookie/get.js +5 -1
  65. package/dist/ui/helpers/cookie/raw.js +1 -2
  66. package/dist/ui/helpers/cookie/set.js +2 -2
  67. package/dist/ui/helpers/cookie/use.js +19 -9
  68. package/dist/ui/helpers/date.js +3 -4
  69. package/dist/ui/helpers/debounce.js +1 -1
  70. package/dist/ui/helpers/extractAttributes.js +1 -2
  71. package/dist/ui/helpers/openDialog.js +1 -2
  72. package/dist/ui/helpers/routes.js +6 -4
  73. package/dist/ui/helpers/serviceWorker.js +7 -18
  74. package/dist/ui/helpers/useContextMenu.js +2 -3
  75. package/dist/ui/helpers/useElementAttribute.js +1 -1
  76. package/dist/ui/helpers/useGranularHook.js +2 -2
  77. package/dist/ui/helpers/useInterval.js +5 -7
  78. package/dist/ui/helpers/useLocalStorage.js +1 -1
  79. package/dist/ui/helpers/useOnClickOutside.js +2 -3
  80. package/dist/ui/helpers/useOnScroll.js +6 -8
  81. package/dist/ui/helpers/useOverloadPageSearch.js +1 -1
  82. package/dist/ui/helpers/useQueryString.js +2 -2
  83. package/dist/ui/helpers/useResize.js +1 -1
  84. package/dist/ui/helpers/useTimeout.js +1 -1
  85. package/dist/ui/helpers/useTooltip.js +8 -5
  86. package/dist/ui/icons/Checkmark.js +2 -5
  87. package/dist/ui/icons/Circle.js +2 -5
  88. package/dist/ui/icons/Magnify.js +2 -5
  89. package/dist/ui/icons/Sun.js +8 -11
  90. package/dist/ui/icons/Warning.js +7 -10
  91. package/dist/ui/styles/common.js +8 -20
  92. 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
- return __awaiter(this, void 0, void 0, function* () {
16
- const decoder = new TextDecoder();
17
- const reader = stream.getReader();
18
- let result = '';
19
- try {
20
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
21
- while (true) {
22
- // eslint-disable-next-line no-await-in-loop
23
- const { done, value } = yield reader.read();
24
- if (done)
25
- break;
26
- // Convert the Uint8Array chunk to a string
27
- const chunkString = decoder.decode(value);
28
- // Append the chunk to the final result
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
- catch (e) {
34
- (0, log_1.error)('error converting stream');
35
- }
36
- finally {
37
- reader.releaseLock();
38
- }
39
- return result;
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, ((_a = frequencies.get(char)) !== null && _a !== void 0 ? _a : 0) + 1);
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) => __awaiter(void 0, void 0, void 0, function* () {
7
+ const withRetry = async (operation, operationName, opt) => {
17
8
  let retryCount = 0;
18
9
  const baseDelay = 2000;
19
- const { maxRetries = 3 } = opt !== null && opt !== void 0 ? opt : {};
10
+ const { maxRetries = 3 } = opt ?? {};
20
11
  // eslint-disable-next-line
21
12
  while (true) {
22
13
  try {
23
- return yield operation();
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
- yield (0, sleep_1.sleep)(delay);
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) => __awaiter(void 0, void 0, void 0, function* () {
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
- constructor() {
22
- this.stack = [];
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 = Object.assign(Object.assign({}, newObject), attributes);
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
- constructor() {
68
- this.buffer = '';
69
- this.onStartElement = () => { };
70
- this.onEndElement = () => { };
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
- return __awaiter(this, void 0, void 0, function* () {
23
- const response = yield fetch(p.FILE_URL);
24
- if (!response.ok || !response.body) {
25
- throw new Error(`Failed to download: ${response.statusText}`);
26
- }
27
- const fileStream = fs_1.default.createWriteStream(p.FILE_PATH);
28
- const reader = response.body.getReader();
29
- const write = () => __awaiter(this, void 0, void 0, function* () {
30
- const { done, value } = yield reader.read();
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
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
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 === null || onSubmit === void 0 ? void 0 : onSubmit(newDarkMode);
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 !== null && mode !== void 0 ? mode : 'horiz', style: Object.assign(Object.assign({}, style), { background, borderColor: fill, width,
125
- height }) }, modes.map((v, i) => {
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)(Object.assign(Object.assign({}, p), { dm }));
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 = (_a = lines[a]) !== null && _a !== void 0 ? _a : '';
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 !== null && ol !== void 0 ? ol : (ol = { matchLine: line, outputIndex: output.length });
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 !== null && ul !== void 0 ? ul : (ul = { matchLine: line, outputIndex: output.length });
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 = (_d = (_c = (_b = line.match(/^#+/)) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0;
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 = (_a) => {
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 = (_a) => {
62
- var { className, children, chevronColour = 'currentColor' } = _a, props = __rest(_a, ["className", "children", "chevronColour"]);
63
- return (React.createElement(AccordionPrimitive.Header, { asChild: true },
64
- React.createElement("div", { className: "flex" },
65
- React.createElement(AccordionPrimitive.Trigger, Object.assign({ 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),
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 = (_a) => {
71
- var { className, children } = _a, props = __rest(_a, ["className", "children"]);
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 = (_a) => {
77
- var { title, chevronColour = 'currentColor', children, className } = _a, props = __rest(_a, ["title", "chevronColour", "children", "className"]);
78
- return (React.createElement(Accordion, Object.assign({ type: "single", collapsible: true, className: (0, utils_1.cn)('w-full', className) }, props),
79
- React.createElement(AccordionItem, { value: "item-1" },
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/dist/types").ClassProp) | undefined) => string;
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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/dist/types").ClassProp) | undefined) => string;
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 = (_a) => {
75
- var { className, variant, size } = _a, props = __rest(_a, ["className", "variant", "size"]);
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
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 = (_a) => {
54
- var { className } = _a, props = __rest(_a, ["className"]);
55
- return (React.createElement(CheckboxPrimitive.Root, Object.assign({}, 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) }),
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;