@emiketic/lib-mantine 1.0.0 → 1.0.2

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/index.js CHANGED
@@ -1,28 +1,75 @@
1
+ "use strict";
2
+ "use client";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+
31
+ // src/index.ts
32
+ var src_exports = {};
33
+ __export(src_exports, {
34
+ ClientOnly: () => ClientOnly,
35
+ ConfirmBar: () => ConfirmBar_default,
36
+ ContentLoader: () => ContentLoader_default,
37
+ ImageInput: () => ImageInput_default,
38
+ Logo: () => Logo_default,
39
+ NativePDFViewer: () => NativePDFViewer,
40
+ NoData: () => NoData_default,
41
+ PageContainer: () => PageContainer_default,
42
+ PhoneInput: () => PhoneInput_default,
43
+ TextEditor: () => TextEditor_default,
44
+ ThemeToggle: () => ThemeToggle_default
45
+ });
46
+ module.exports = __toCommonJS(src_exports);
47
+
1
48
  // src/components/ClientOnly/index.tsx
2
- import { useEffect, useState } from "react";
3
- import { LoadingOverlay } from "@mantine/core";
4
- import { jsx } from "react/jsx-runtime";
49
+ var import_react = require("react");
50
+ var import_core = require("@mantine/core");
51
+ var import_jsx_runtime = require("react/jsx-runtime");
5
52
  function ClientOnly({
6
53
  children,
7
54
  withLoader = false,
8
55
  ...delegated
9
56
  }) {
10
- const [hasMounted, setHasMounted] = useState(false);
11
- useEffect(() => {
57
+ const [hasMounted, setHasMounted] = (0, import_react.useState)(false);
58
+ (0, import_react.useEffect)(() => {
12
59
  setHasMounted(true);
13
60
  }, []);
14
61
  if (!hasMounted) {
15
62
  if (withLoader) {
16
- return /* @__PURE__ */ jsx(LoadingOverlay, {});
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.LoadingOverlay, {});
17
64
  }
18
65
  return null;
19
66
  }
20
- return /* @__PURE__ */ jsx("div", { ...delegated, children });
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...delegated, children });
21
68
  }
22
69
 
23
70
  // src/components/ConfirmBar/index.tsx
24
- import { Box, Button, Group } from "@mantine/core";
25
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
71
+ var import_core2 = require("@mantine/core");
72
+ var import_jsx_runtime2 = require("react/jsx-runtime");
26
73
  function ConfirmBar({
27
74
  onConfirm = () => {
28
75
  },
@@ -35,10 +82,10 @@ function ConfirmBar({
35
82
  withCancel = true,
36
83
  ...props
37
84
  }) {
38
- return /* @__PURE__ */ jsx2(Box, { ...props, children: /* @__PURE__ */ jsxs(Group, { h: "100%", justify: "flex-end", align: "center", children: [
39
- withCancel ? /* @__PURE__ */ jsx2(Button, { onClick: () => onCancel(), variant: "subtle", children: labelProps?.cancel ?? "Cancel" }) : null,
40
- /* @__PURE__ */ jsx2(
41
- Button,
85
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Box, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_core2.Group, { h: "100%", justify: "flex-end", align: "center", children: [
86
+ withCancel ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_core2.Button, { onClick: () => onCancel(), variant: "subtle", children: labelProps?.cancel ?? "Cancel" }) : null,
87
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
88
+ import_core2.Button,
42
89
  {
43
90
  onClick: () => onConfirm(),
44
91
  disabled,
@@ -53,9 +100,9 @@ function ConfirmBar({
53
100
  var ConfirmBar_default = ConfirmBar;
54
101
 
55
102
  // src/components/ContentLoader/index.tsx
56
- import { Fragment } from "react";
57
- import { Skeleton, Space, Stack } from "@mantine/core";
58
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
103
+ var import_react2 = require("react");
104
+ var import_core3 = require("@mantine/core");
105
+ var import_jsx_runtime3 = require("react/jsx-runtime");
59
106
  function ContentLoader({
60
107
  numberOfBars = 3,
61
108
  numberOfBarGroups = 3,
@@ -69,25 +116,25 @@ function ContentLoader({
69
116
  if (!visible) {
70
117
  return null;
71
118
  }
72
- return /* @__PURE__ */ jsxs2(Stack, { gap: "sm", px: "5rem", py: "md", ...props, children: [
73
- withCircle ? /* @__PURE__ */ jsx3(Skeleton, { height: 70, circle: true, mb: "xl" }) : null,
74
- Array.from({ length: numberOfBarGroups }).map((_, index) => /* @__PURE__ */ jsxs2(Fragment, { children: [
75
- Array.from({ length: Math.ceil(numberOfBars / numberOfBarGroups) }).map((_2, index2) => /* @__PURE__ */ jsxs2(Fragment, { children: [
76
- /* @__PURE__ */ jsx3(Skeleton, { height: barHeight, radius: "xl" }),
77
- /* @__PURE__ */ jsx3(Skeleton, { height: barHeight, mt: barSpacing, radius: "xl" }),
78
- /* @__PURE__ */ jsx3(Skeleton, { height: barHeight, mt: barSpacing, width: "70%", radius: "xl" })
119
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_core3.Stack, { gap: "sm", px: "5rem", py: "md", ...props, children: [
120
+ withCircle ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Skeleton, { height: 70, circle: true, mb: "xl" }) : null,
121
+ Array.from({ length: numberOfBarGroups }).map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react2.Fragment, { children: [
122
+ Array.from({ length: Math.ceil(numberOfBars / numberOfBarGroups) }).map((_2, index2) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react2.Fragment, { children: [
123
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Skeleton, { height: barHeight, radius: "xl" }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Skeleton, { height: barHeight, mt: barSpacing, radius: "xl" }),
125
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Skeleton, { height: barHeight, mt: barSpacing, width: "70%", radius: "xl" })
79
126
  ] }, index2)),
80
- /* @__PURE__ */ jsx3(Space, { h: barGroupSpacing })
127
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_core3.Space, { h: barGroupSpacing })
81
128
  ] }, index))
82
129
  ] });
83
130
  }
84
131
  var ContentLoader_default = ContentLoader;
85
132
 
86
133
  // src/components/ImageInput/index.tsx
87
- import { useEffect as useEffect2, useState as useState2 } from "react";
88
- import { ActionIcon, Avatar, FileInput, Group as Group2, Image as Image2, Paper } from "@mantine/core";
89
- import { IconUpload } from "@tabler/icons-react";
90
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
134
+ var import_react3 = require("react");
135
+ var import_core4 = require("@mantine/core");
136
+ var import_icons_react = require("@tabler/icons-react");
137
+ var import_jsx_runtime4 = require("react/jsx-runtime");
91
138
  var DEFAULT_MAX_FILE_SIZE_BYTES = 5e5;
92
139
  var isClient = () => typeof window !== "undefined";
93
140
  function ImageInput({
@@ -96,11 +143,11 @@ function ImageInput({
96
143
  maxFileSizeBytes = DEFAULT_MAX_FILE_SIZE_BYTES,
97
144
  ...props
98
145
  }) {
99
- const [imageUrl, setImageUrl] = useState2(null);
146
+ const [imageUrl, setImageUrl] = (0, import_react3.useState)(null);
100
147
  const largeFile = isClient() && value && value instanceof File && value.size >= maxFileSizeBytes;
101
148
  const isFileValue = isClient() && value instanceof File;
102
149
  const isString = typeof value == "string";
103
- useEffect2(() => {
150
+ (0, import_react3.useEffect)(() => {
104
151
  if (isFileValue) {
105
152
  setImageUrl(URL.createObjectURL(value));
106
153
  } else if (isString) {
@@ -108,8 +155,8 @@ function ImageInput({
108
155
  }
109
156
  }, [value, isFileValue, isString]);
110
157
  if (props.disabled && !isFileValue) {
111
- return /* @__PURE__ */ jsx4(
112
- Avatar,
158
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
159
+ import_core4.Avatar,
113
160
  {
114
161
  size: "xl",
115
162
  src: imageUrl,
@@ -117,9 +164,9 @@ function ImageInput({
117
164
  }
118
165
  );
119
166
  }
120
- return /* @__PURE__ */ jsxs3(Group2, { children: [
121
- withPreview && /* @__PURE__ */ jsx4(Paper, { radius: "md", p: "sm", withBorder: true, children: /* @__PURE__ */ jsx4(
122
- Image2,
167
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_core4.Group, { children: [
168
+ withPreview && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.Paper, { radius: "md", p: "sm", withBorder: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
169
+ import_core4.Image,
123
170
  {
124
171
  w: "5rem",
125
172
  h: "5rem",
@@ -129,11 +176,11 @@ function ImageInput({
129
176
  ...props.previewProps
130
177
  }
131
178
  ) }),
132
- /* @__PURE__ */ jsx4(
133
- FileInput,
179
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
180
+ import_core4.FileInput,
134
181
  {
135
182
  styles: { input: { fontSize: "var(--mantine-font-size-xs)" } },
136
- leftSection: /* @__PURE__ */ jsx4(ActionIcon, { variant: "light", size: "xs", color: "gray", children: /* @__PURE__ */ jsx4(IconUpload, {}) }),
183
+ leftSection: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_core4.ActionIcon, { variant: "light", size: "xs", color: "gray", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons_react.IconUpload, {}) }),
137
184
  placeholder: "Upload",
138
185
  error: largeFile ? `File size must be under ${maxFileSizeBytes / 1e3} KB` : void 0,
139
186
  onChange: (file) => {
@@ -150,12 +197,12 @@ function ImageInput({
150
197
  var ImageInput_default = ImageInput;
151
198
 
152
199
  // src/components/Logo/index.tsx
153
- import { useEffect as useEffect3, useState as useState3 } from "react";
154
- import { Avatar as Avatar2, ThemeIcon } from "@mantine/core";
200
+ var import_react4 = require("react");
201
+ var import_core6 = require("@mantine/core");
155
202
 
156
203
  // src/utils/colors.ts
157
- import chroma from "chroma-js";
158
- import { darken, lighten } from "@mantine/core";
204
+ var import_chroma_js = __toESM(require("chroma-js"));
205
+ var import_core5 = require("@mantine/core");
159
206
  function loadImage(imageUrl) {
160
207
  return new Promise((resolve, reject) => {
161
208
  const image = new Image();
@@ -177,7 +224,7 @@ function extractQuantizedPixels(imageData) {
177
224
  const red = quantizeChannel(imageData[index] ?? 0);
178
225
  const green = quantizeChannel(imageData[index + 1] ?? 0);
179
226
  const blue = quantizeChannel(imageData[index + 2] ?? 0);
180
- colors.push(chroma(red, green, blue).hex());
227
+ colors.push((0, import_chroma_js.default)(red, green, blue).hex());
181
228
  }
182
229
  return colors;
183
230
  }
@@ -194,7 +241,7 @@ function extractEdgeQuantizedPixels(imageData, width, height) {
194
241
  const red = quantizeChannel(imageData[pixelIndex] ?? 0);
195
242
  const green = quantizeChannel(imageData[pixelIndex + 1] ?? 0);
196
243
  const blue = quantizeChannel(imageData[pixelIndex + 2] ?? 0);
197
- edgeColors.push(chroma(red, green, blue).hex());
244
+ edgeColors.push((0, import_chroma_js.default)(red, green, blue).hex());
198
245
  }
199
246
  }
200
247
  return edgeColors;
@@ -233,7 +280,7 @@ var getDominantColorFromImageUrl = async (imageUrl, fallbackDominantColor = "#00
233
280
  const edgePixels = extractEdgeQuantizedPixels(imageData, canvas.width, canvas.height);
234
281
  const background = getMostFrequentColor(edgePixels) ?? getMostFrequentColor(allPixels);
235
282
  const dominant = getMostFrequentColor(
236
- background ? allPixels.filter((hex) => chroma.distance(hex, background, "rgb") > 28) : allPixels
283
+ background ? allPixels.filter((hex) => import_chroma_js.default.distance(hex, background, "rgb") > 28) : allPixels
237
284
  ) ?? getMostFrequentColor(allPixels);
238
285
  return {
239
286
  dominant: dominant ?? fallbackDominantColor,
@@ -245,14 +292,14 @@ var getDominantColorFromImageUrl = async (imageUrl, fallbackDominantColor = "#00
245
292
  };
246
293
 
247
294
  // src/components/Logo/index.tsx
248
- import { IconBuildingSkyscraper as IconFallback } from "@tabler/icons-react";
249
- import { jsx as jsx5 } from "react/jsx-runtime";
295
+ var import_icons_react2 = require("@tabler/icons-react");
296
+ var import_jsx_runtime5 = require("react/jsx-runtime");
250
297
  function Logo({ withColorPair = true, ...props }) {
251
- const [logoColorPair, setLogoColorPair] = useState3({
298
+ const [logoColorPair, setLogoColorPair] = (0, import_react4.useState)({
252
299
  dominant: "#000000",
253
300
  background: "#ffffff"
254
301
  });
255
- useEffect3(() => {
302
+ (0, import_react4.useEffect)(() => {
256
303
  let isMounted = true;
257
304
  if (props.src && withColorPair) {
258
305
  getDominantColorFromImageUrl(props.src).then(({ dominant, background }) => {
@@ -267,8 +314,8 @@ function Logo({ withColorPair = true, ...props }) {
267
314
  isMounted = false;
268
315
  };
269
316
  }, [props.src, withColorPair]);
270
- return /* @__PURE__ */ jsx5(
271
- Avatar2,
317
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
318
+ import_core6.Avatar,
272
319
  {
273
320
  size: "5rem",
274
321
  radius: "lg",
@@ -282,16 +329,16 @@ function Logo({ withColorPair = true, ...props }) {
282
329
  },
283
330
  imageProps: { referrerPolicy: "no-referrer" },
284
331
  ...props,
285
- children: /* @__PURE__ */ jsx5(ThemeIcon, { variant: "transparent", size: "5rem", children: /* @__PURE__ */ jsx5(IconFallback, { size: 48 * 1.5, stroke: 1 }) })
332
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_core6.ThemeIcon, { variant: "transparent", size: "5rem", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_icons_react2.IconBuildingSkyscraper, { size: 48 * 1.5, stroke: 1 }) })
286
333
  }
287
334
  );
288
335
  }
289
336
  var Logo_default = Logo;
290
337
 
291
338
  // src/components/NativePDFViewer/index.tsx
292
- import { useState as useState4 } from "react";
293
- import { Box as Box2, Center, Loader } from "@mantine/core";
294
- import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
339
+ var import_react5 = require("react");
340
+ var import_core7 = require("@mantine/core");
341
+ var import_jsx_runtime6 = require("react/jsx-runtime");
295
342
  function getBrowser() {
296
343
  const { userAgent } = navigator;
297
344
  const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
@@ -311,7 +358,7 @@ function NativePDFViewer({
311
358
  withToolbar = true,
312
359
  fallback = "Cannot display PDF on this browser. Use a different browser or download the PDF."
313
360
  }) {
314
- const [loading, setLoading] = useState4(false);
361
+ const [loading, setLoading] = (0, import_react5.useState)(false);
315
362
  const toolbarHeight = {
316
363
  Safari: 0,
317
364
  Edge: 40,
@@ -330,8 +377,8 @@ function NativePDFViewer({
330
377
  if (!mediaUrl) {
331
378
  return null;
332
379
  }
333
- return /* @__PURE__ */ jsxs4(
334
- Box2,
380
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
381
+ import_core7.Box,
335
382
  {
336
383
  w: "100%",
337
384
  h: toolbarHeight ? `calc(100% + ${toolbarHeight}px)` : "100%",
@@ -339,8 +386,8 @@ function NativePDFViewer({
339
386
  transform: toolbarHeight ? `translateY(-${toolbarHeight}px)` : void 0
340
387
  },
341
388
  children: [
342
- loading ? /* @__PURE__ */ jsx6(Center, { h: "100%", w: "100%", children: /* @__PURE__ */ jsx6(Loader, { size: "xl" }) }) : null,
343
- /* @__PURE__ */ jsx6(
389
+ loading ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core7.Center, { h: "100%", w: "100%", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core7.Loader, { size: "xl" }) }) : null,
390
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
344
391
  "object",
345
392
  {
346
393
  data: `${mediaUrl}${optionsString}`,
@@ -349,7 +396,7 @@ function NativePDFViewer({
349
396
  height: "100%",
350
397
  onLoad: () => setLoading(false),
351
398
  onError: () => setLoading(false),
352
- children: /* @__PURE__ */ jsx6(Box2, { children: renderFallback() })
399
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core7.Box, { children: renderFallback() })
353
400
  }
354
401
  )
355
402
  ]
@@ -358,16 +405,16 @@ function NativePDFViewer({
358
405
  }
359
406
 
360
407
  // src/components/NoData/index.tsx
361
- import { Alert, Center as Center2 } from "@mantine/core";
362
- import { jsx as jsx7 } from "react/jsx-runtime";
408
+ var import_core8 = require("@mantine/core");
409
+ var import_jsx_runtime7 = require("react/jsx-runtime");
363
410
  function NoData({ title, children, alertProps, ...props }) {
364
- return /* @__PURE__ */ jsx7(Center2, { h: "100%", ...props, children: /* @__PURE__ */ jsx7(Alert, { p: "3rem", title: title ?? "No data", ...alertProps, children: /* @__PURE__ */ jsx7(Center2, { children }) }) });
411
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.Center, { h: "100%", ...props, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.Alert, { p: "3rem", title: title ?? "No data", ...alertProps, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_core8.Center, { children }) }) });
365
412
  }
366
413
  var NoData_default = NoData;
367
414
 
368
415
  // src/components/PageContainer/index.tsx
369
- import { Box as Box3, Container, Group as Group3, ScrollArea, Stack as Stack2, Title } from "@mantine/core";
370
- import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
416
+ var import_core9 = require("@mantine/core");
417
+ var import_jsx_runtime8 = require("react/jsx-runtime");
371
418
  function PageContainer({
372
419
  children,
373
420
  title,
@@ -383,7 +430,7 @@ function PageContainer({
383
430
  }) {
384
431
  function getTitle() {
385
432
  if (title) {
386
- return /* @__PURE__ */ jsx8(Title, { order: 2, ...titleProps, children: title });
433
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Title, { order: 2, ...titleProps, children: title });
387
434
  }
388
435
  return null;
389
436
  }
@@ -391,64 +438,61 @@ function PageContainer({
391
438
  if (header) {
392
439
  return header;
393
440
  }
394
- return /* @__PURE__ */ jsxs5(Group3, { justify: "space-between", w: "100%", ...headerProps, children: [
441
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core9.Group, { justify: "space-between", w: "100%", ...headerProps, children: [
395
442
  getTitle(),
396
443
  rightSection
397
444
  ] });
398
445
  }
399
446
  function getContent() {
400
447
  if (fullPage) {
401
- return /* @__PURE__ */ jsx8(Box3, { ...contentProps, children });
448
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Box, { ...contentProps, children });
402
449
  }
403
- return /* @__PURE__ */ jsxs5(Stack2, { gap: "xl", ...outerContentProps, children: [
450
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_core9.Stack, { gap: "xl", ...outerContentProps, children: [
404
451
  getHeader(),
405
- /* @__PURE__ */ jsx8(Stack2, { px: "xl", py: "lg", h: "100%", w: "100%", ...contentProps, children })
452
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Stack, { px: "xl", py: "lg", h: "100%", w: "100%", ...contentProps, children })
406
453
  ] });
407
454
  }
408
455
  if (withContentScroll) {
409
- return /* @__PURE__ */ jsx8(ScrollArea, { h: "100vh", p: 0, ...props, children: /* @__PURE__ */ jsx8(Container, { fluid: true, children: getContent() }) });
456
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.ScrollArea, { h: "100vh", p: 0, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Container, { fluid: true, children: getContent() }) });
410
457
  }
411
- return /* @__PURE__ */ jsx8(Container, { p: 0, w: "100%", fluid: true, children: getContent() });
458
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_core9.Container, { p: 0, w: "100%", fluid: true, children: getContent() });
412
459
  }
413
460
  var PageContainer_default = PageContainer;
414
461
 
415
462
  // src/components/PhoneInput/index.tsx
416
- import { useEffect as useEffect4, useState as useState5 } from "react";
417
- import { getCountryData, getEmojiFlag } from "countries-list";
418
- import parsePhoneNumber, {
419
- getCountries,
420
- getCountryCallingCode
421
- } from "libphonenumber-js";
422
- import { Group as Group4, Select, TextInput } from "@mantine/core";
423
- import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
424
- var COUNTRY_CODES = getCountries();
463
+ var import_react6 = require("react");
464
+ var import_countries_list = require("countries-list");
465
+ var import_libphonenumber_js = __toESM(require("libphonenumber-js"));
466
+ var import_core10 = require("@mantine/core");
467
+ var import_jsx_runtime9 = require("react/jsx-runtime");
468
+ var COUNTRY_CODES = (0, import_libphonenumber_js.getCountries)();
425
469
  function PhoneInput({ value, defaultValue, defaultCountryCode, ...props }) {
426
470
  const valueNumber = value ?? "";
427
- const valueNumberData = parsePhoneNumber(valueNumber);
471
+ const valueNumberData = (0, import_libphonenumber_js.default)(valueNumber);
428
472
  let valueNumberCountryCode;
429
473
  if (valueNumberData?.isValid()) {
430
474
  valueNumberCountryCode = valueNumberData.country;
431
475
  }
432
- const [selectedCountryCode, setSelectedCountryCode] = useState5(
476
+ const [selectedCountryCode, setSelectedCountryCode] = (0, import_react6.useState)(
433
477
  defaultCountryCode
434
478
  );
435
- const selectedCountryCodeCallingNumber = selectedCountryCode ? getCountryCallingCode(selectedCountryCode) : void 0;
436
- useEffect4(() => {
479
+ const selectedCountryCodeCallingNumber = selectedCountryCode ? (0, import_libphonenumber_js.getCountryCallingCode)(selectedCountryCode) : void 0;
480
+ (0, import_react6.useEffect)(() => {
437
481
  if (selectedCountryCode && selectedCountryCode !== valueNumberCountryCode) {
438
482
  const code = selectedCountryCode ?? defaultCountryCode ?? "";
439
- const callingCode = getCountryCallingCode(code);
483
+ const callingCode = (0, import_libphonenumber_js.getCountryCallingCode)(code);
440
484
  if (props.onChange) {
441
485
  const numberUpdate = `+${callingCode}${valueNumber.replace(callingCode, "")}`;
442
- const numberUpdateData = parsePhoneNumber(numberUpdate, selectedCountryCode);
486
+ const numberUpdateData = (0, import_libphonenumber_js.default)(numberUpdate, selectedCountryCode);
443
487
  if (numberUpdateData?.isValid()) {
444
488
  props.onChange(`+${callingCode}${valueNumber.replace(callingCode, "")}`);
445
489
  }
446
490
  }
447
491
  }
448
492
  }, [selectedCountryCode]);
449
- return /* @__PURE__ */ jsxs6(Group4, { wrap: "nowrap", children: [
450
- /* @__PURE__ */ jsx9(
451
- Select,
493
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_core10.Group, { wrap: "nowrap", children: [
494
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
495
+ import_core10.Select,
452
496
  {
453
497
  label: "Country code",
454
498
  size: "sm",
@@ -463,27 +507,27 @@ function PhoneInput({ value, defaultValue, defaultCountryCode, ...props }) {
463
507
  }
464
508
  },
465
509
  data: COUNTRY_CODES.map((code) => {
466
- const countryCallingCode = getCountryCallingCode(code);
467
- const countryName = getCountryData(code).name;
510
+ const countryCallingCode = (0, import_libphonenumber_js.getCountryCallingCode)(code);
511
+ const countryName = (0, import_countries_list.getCountryData)(code).name;
468
512
  return {
469
513
  value: code,
470
- label: `${countryName} ${getEmojiFlag(code)} +${countryCallingCode}`
514
+ label: `${countryName} ${(0, import_countries_list.getEmojiFlag)(code)} +${countryCallingCode}`
471
515
  };
472
516
  }),
473
- rightSection: props.disabled ? /* @__PURE__ */ jsx9(Fragment2, {}) : void 0,
517
+ rightSection: props.disabled ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_jsx_runtime9.Fragment, {}) : void 0,
474
518
  disabled: props.disabled,
475
519
  searchable: true
476
520
  }
477
521
  ),
478
- /* @__PURE__ */ jsx9(
479
- TextInput,
522
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
523
+ import_core10.TextInput,
480
524
  {
481
525
  ...props,
482
526
  defaultValue: valueNumberData?.nationalNumber,
483
527
  onChange: (e) => {
484
528
  if (props.onChange && selectedCountryCodeCallingNumber) {
485
529
  const numberUpdate = `+${selectedCountryCodeCallingNumber}${e.currentTarget.value.replace(selectedCountryCodeCallingNumber, "")}`;
486
- const numberUpdateData = parsePhoneNumber(numberUpdate, selectedCountryCode);
530
+ const numberUpdateData = (0, import_libphonenumber_js.default)(numberUpdate, selectedCountryCode);
487
531
  if (numberUpdateData?.isValid()) {
488
532
  props.onChange(numberUpdateData.number);
489
533
  }
@@ -496,16 +540,16 @@ function PhoneInput({ value, defaultValue, defaultCountryCode, ...props }) {
496
540
  var PhoneInput_default = PhoneInput;
497
541
 
498
542
  // src/components/TextEditor/index.tsx
499
- import { useEffect as useEffect5 } from "react";
500
- import Highlight from "@tiptap/extension-highlight";
501
- import SubScript from "@tiptap/extension-subscript";
502
- import Superscript from "@tiptap/extension-superscript";
503
- import TextAlign from "@tiptap/extension-text-align";
504
- import Underline from "@tiptap/extension-underline";
505
- import { useEditor } from "@tiptap/react";
506
- import StarterKit from "@tiptap/starter-kit";
507
- import { Link, RichTextEditor } from "@mantine/tiptap";
508
- import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
543
+ var import_react7 = require("react");
544
+ var import_extension_highlight = __toESM(require("@tiptap/extension-highlight"));
545
+ var import_extension_subscript = __toESM(require("@tiptap/extension-subscript"));
546
+ var import_extension_superscript = __toESM(require("@tiptap/extension-superscript"));
547
+ var import_extension_text_align = __toESM(require("@tiptap/extension-text-align"));
548
+ var import_extension_underline = __toESM(require("@tiptap/extension-underline"));
549
+ var import_react8 = require("@tiptap/react");
550
+ var import_starter_kit = __toESM(require("@tiptap/starter-kit"));
551
+ var import_tiptap = require("@mantine/tiptap");
552
+ var import_jsx_runtime10 = require("react/jsx-runtime");
509
553
  function TextEditor({
510
554
  content,
511
555
  value,
@@ -515,91 +559,85 @@ function TextEditor({
515
559
  },
516
560
  ...props
517
561
  }) {
518
- const editor = useEditor({
562
+ const editor = (0, import_react8.useEditor)({
519
563
  editable: true,
520
564
  extensions: [
521
- StarterKit,
522
- Underline,
523
- Link,
524
- Superscript,
525
- SubScript,
526
- Highlight,
527
- TextAlign.configure({ types: ["heading", "paragraph"] })
565
+ import_starter_kit.default,
566
+ import_extension_underline.default,
567
+ import_tiptap.Link,
568
+ import_extension_superscript.default,
569
+ import_extension_subscript.default,
570
+ import_extension_highlight.default,
571
+ import_extension_text_align.default.configure({ types: ["heading", "paragraph"] })
528
572
  ],
529
573
  content
530
574
  });
531
- useEffect5(() => {
575
+ (0, import_react7.useEffect)(() => {
532
576
  onChangeEditorHTML(editor?.getHTML());
533
577
  onChange(editor?.getHTML());
534
578
  }, [editor?.state, editor, onChangeEditorHTML, onChange]);
535
- return /* @__PURE__ */ jsxs7(RichTextEditor, { editor, ...props, children: [
536
- /* @__PURE__ */ jsxs7(RichTextEditor.Toolbar, { sticky: true, stickyOffset: 60, children: [
537
- /* @__PURE__ */ jsxs7(RichTextEditor.ControlsGroup, { children: [
538
- /* @__PURE__ */ jsx10(RichTextEditor.Bold, {}),
539
- /* @__PURE__ */ jsx10(RichTextEditor.Italic, {}),
540
- /* @__PURE__ */ jsx10(RichTextEditor.Underline, {}),
541
- /* @__PURE__ */ jsx10(RichTextEditor.Strikethrough, {}),
542
- /* @__PURE__ */ jsx10(RichTextEditor.ClearFormatting, {}),
543
- /* @__PURE__ */ jsx10(RichTextEditor.Highlight, {}),
544
- /* @__PURE__ */ jsx10(RichTextEditor.Code, {})
579
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor, { editor, ...props, children: [
580
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.Toolbar, { sticky: true, stickyOffset: 60, children: [
581
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.ControlsGroup, { children: [
582
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Bold, {}),
583
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Italic, {}),
584
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Underline, {}),
585
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Strikethrough, {}),
586
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.ClearFormatting, {}),
587
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Highlight, {}),
588
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Code, {})
545
589
  ] }),
546
- /* @__PURE__ */ jsxs7(RichTextEditor.ControlsGroup, { children: [
547
- /* @__PURE__ */ jsx10(RichTextEditor.H1, {}),
548
- /* @__PURE__ */ jsx10(RichTextEditor.H2, {}),
549
- /* @__PURE__ */ jsx10(RichTextEditor.H3, {}),
550
- /* @__PURE__ */ jsx10(RichTextEditor.H4, {})
590
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.ControlsGroup, { children: [
591
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.H1, {}),
592
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.H2, {}),
593
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.H3, {}),
594
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.H4, {})
551
595
  ] }),
552
- /* @__PURE__ */ jsxs7(RichTextEditor.ControlsGroup, { children: [
553
- /* @__PURE__ */ jsx10(RichTextEditor.Blockquote, {}),
554
- /* @__PURE__ */ jsx10(RichTextEditor.Hr, {}),
555
- /* @__PURE__ */ jsx10(RichTextEditor.BulletList, {}),
556
- /* @__PURE__ */ jsx10(RichTextEditor.OrderedList, {}),
557
- /* @__PURE__ */ jsx10(RichTextEditor.Subscript, {}),
558
- /* @__PURE__ */ jsx10(RichTextEditor.Superscript, {})
596
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.ControlsGroup, { children: [
597
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Blockquote, {}),
598
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Hr, {}),
599
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.BulletList, {}),
600
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.OrderedList, {}),
601
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Subscript, {}),
602
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Superscript, {})
559
603
  ] }),
560
- /* @__PURE__ */ jsxs7(RichTextEditor.ControlsGroup, { children: [
561
- /* @__PURE__ */ jsx10(RichTextEditor.Link, {}),
562
- /* @__PURE__ */ jsx10(RichTextEditor.Unlink, {})
604
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.ControlsGroup, { children: [
605
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Link, {}),
606
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Unlink, {})
563
607
  ] }),
564
- /* @__PURE__ */ jsxs7(RichTextEditor.ControlsGroup, { children: [
565
- /* @__PURE__ */ jsx10(RichTextEditor.AlignLeft, {}),
566
- /* @__PURE__ */ jsx10(RichTextEditor.AlignCenter, {}),
567
- /* @__PURE__ */ jsx10(RichTextEditor.AlignJustify, {}),
568
- /* @__PURE__ */ jsx10(RichTextEditor.AlignRight, {})
608
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_tiptap.RichTextEditor.ControlsGroup, { children: [
609
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.AlignLeft, {}),
610
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.AlignCenter, {}),
611
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.AlignJustify, {}),
612
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.AlignRight, {})
569
613
  ] })
570
614
  ] }),
571
- /* @__PURE__ */ jsx10(RichTextEditor.Content, {})
615
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_tiptap.RichTextEditor.Content, {})
572
616
  ] });
573
617
  }
574
618
  var TextEditor_default = TextEditor;
575
619
 
576
620
  // src/components/ThemeToggle/index.tsx
577
- import {
578
- Switch,
579
- ThemeIcon as ThemeIcon2,
580
- Tooltip,
581
- useComputedColorScheme,
582
- useMantineColorScheme
583
- } from "@mantine/core";
584
- import { IconMoon as IconSwitchDark, IconSun as IconSwitchLight } from "@tabler/icons-react";
585
- import { jsx as jsx11 } from "react/jsx-runtime";
621
+ var import_core11 = require("@mantine/core");
622
+ var import_icons_react3 = require("@tabler/icons-react");
623
+ var import_jsx_runtime11 = require("react/jsx-runtime");
586
624
  function ThemeToggle({ ...props }) {
587
- const { setColorScheme } = useMantineColorScheme();
588
- const computedColorScheme = useComputedColorScheme("light", { getInitialValueInEffect: true });
589
- return /* @__PURE__ */ jsx11(
590
- Tooltip,
625
+ const { setColorScheme } = (0, import_core11.useMantineColorScheme)();
626
+ const computedColorScheme = (0, import_core11.useComputedColorScheme)("light", { getInitialValueInEffect: true });
627
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
628
+ import_core11.Tooltip,
591
629
  {
592
630
  label: computedColorScheme === "light" ? "Switch to dark mode" : "Switch to light mode",
593
631
  position: "bottom",
594
632
  withinPortal: true,
595
- children: /* @__PURE__ */ jsx11(ClientOnly, { children: /* @__PURE__ */ jsx11(
596
- Switch,
633
+ children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ClientOnly, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
634
+ import_core11.Switch,
597
635
  {
598
636
  styles: { track: { cursor: "pointer" } },
599
637
  defaultChecked: computedColorScheme === "dark",
600
638
  onChange: () => setColorScheme(computedColorScheme === "light" ? "dark" : "light"),
601
- onLabel: /* @__PURE__ */ jsx11(ThemeIcon2, { size: props.size ?? "sm", variant: "transparent", children: /* @__PURE__ */ jsx11(IconSwitchDark, {}) }),
602
- offLabel: /* @__PURE__ */ jsx11(ThemeIcon2, { size: props.size ?? "sm", color: "yellow", variant: "transparent", children: /* @__PURE__ */ jsx11(IconSwitchLight, {}) }),
639
+ onLabel: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.ThemeIcon, { size: props.size ?? "sm", variant: "transparent", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons_react3.IconMoon, {}) }),
640
+ offLabel: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_core11.ThemeIcon, { size: props.size ?? "sm", color: "yellow", variant: "transparent", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_icons_react3.IconSun, {}) }),
603
641
  color: "dark",
604
642
  size: "md",
605
643
  ...props
@@ -609,17 +647,18 @@ function ThemeToggle({ ...props }) {
609
647
  );
610
648
  }
611
649
  var ThemeToggle_default = ThemeToggle;
612
- export {
650
+ // Annotate the CommonJS export names for ESM import in node:
651
+ 0 && (module.exports = {
613
652
  ClientOnly,
614
- ConfirmBar_default as ConfirmBar,
615
- ContentLoader_default as ContentLoader,
616
- ImageInput_default as ImageInput,
617
- Logo_default as Logo,
653
+ ConfirmBar,
654
+ ContentLoader,
655
+ ImageInput,
656
+ Logo,
618
657
  NativePDFViewer,
619
- NoData_default as NoData,
620
- PageContainer_default as PageContainer,
621
- PhoneInput_default as PhoneInput,
622
- TextEditor_default as TextEditor,
623
- ThemeToggle_default as ThemeToggle
624
- };
658
+ NoData,
659
+ PageContainer,
660
+ PhoneInput,
661
+ TextEditor,
662
+ ThemeToggle
663
+ });
625
664
  //# sourceMappingURL=index.js.map