@emiketic/lib-mantine 1.0.0 → 1.0.1

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