@chekinapp/ui 0.0.55 → 0.0.57

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.cjs CHANGED
@@ -267,6 +267,7 @@ __export(index_exports, {
267
267
  CopyLinkButton: () => CopyLinkButton,
268
268
  CopyString: () => CopyString,
269
269
  CustomCheckboxDropdownGroup: () => CustomCheckboxDropdownGroup,
270
+ DEVICE_BREAKPOINTS: () => DEVICE_BREAKPOINTS,
270
271
  DataTable: () => DataTable,
271
272
  DatePicker: () => DatePicker,
272
273
  DateTableFilter: () => DateTableFilter,
@@ -504,6 +505,7 @@ __export(index_exports, {
504
505
  cn: () => cn,
505
506
  copyToClipboard: () => copyToClipboard,
506
507
  emptyMediaVariants: () => emptyMediaVariants,
508
+ getErrorMessage: () => getErrorMessage,
507
509
  getScrollableAreaState: () => getScrollableAreaState,
508
510
  getSidebarState: () => getSidebarState,
509
511
  inputVariants: () => inputVariants,
@@ -14454,6 +14456,59 @@ function getNextEnabledIndex(options, startIndex, step) {
14454
14456
  }
14455
14457
  return -1;
14456
14458
  }
14459
+
14460
+ // src/lib/breakpoints.ts
14461
+ var DEVICE_BREAKPOINTS = {
14462
+ mobileS: "320px",
14463
+ mobileM: "375px",
14464
+ mobileL: "425px",
14465
+ tabletS: "640px",
14466
+ tablet: "768px",
14467
+ tabletL: "970px",
14468
+ laptop: "1024px",
14469
+ yFullHD: "1080px",
14470
+ laptopM: "1280px",
14471
+ laptopL: "1400px",
14472
+ desktop: "2560px"
14473
+ };
14474
+
14475
+ // src/lib/getErrorMessage.ts
14476
+ function getErrorMessage(error) {
14477
+ let message = "";
14478
+ if (!error) {
14479
+ return message;
14480
+ }
14481
+ if (typeof error === "string") {
14482
+ return error;
14483
+ }
14484
+ if (error?.details) {
14485
+ return error?.details;
14486
+ }
14487
+ if (error?.errors?.length) {
14488
+ const nonFieldErrors = "non_field_errors";
14489
+ Object.values(error.errors).forEach((err) => {
14490
+ const error2 = err;
14491
+ message += ` ${error2.field && error2.field !== nonFieldErrors ? `${error2.field}: ` : ""} ${error2.message}
14492
+ `;
14493
+ });
14494
+ } else if (error?.message) {
14495
+ message = error.message;
14496
+ } else {
14497
+ if (typeof error === "object") {
14498
+ Object.values(error).forEach((err) => {
14499
+ message += ` ${err}
14500
+ `;
14501
+ });
14502
+ }
14503
+ }
14504
+ if (typeof message === "object") {
14505
+ return "";
14506
+ }
14507
+ if (message?.startsWith("Unexpected JSON")) {
14508
+ return "Server error.";
14509
+ }
14510
+ return message;
14511
+ }
14457
14512
  // Annotate the CommonJS export names for ESM import in node:
14458
14513
  0 && (module.exports = {
14459
14514
  Accordion,
@@ -14503,6 +14558,7 @@ function getNextEnabledIndex(options, startIndex, step) {
14503
14558
  CopyLinkButton,
14504
14559
  CopyString,
14505
14560
  CustomCheckboxDropdownGroup,
14561
+ DEVICE_BREAKPOINTS,
14506
14562
  DataTable,
14507
14563
  DatePicker,
14508
14564
  DateTableFilter,
@@ -14740,6 +14796,7 @@ function getNextEnabledIndex(options, startIndex, step) {
14740
14796
  cn,
14741
14797
  copyToClipboard,
14742
14798
  emptyMediaVariants,
14799
+ getErrorMessage,
14743
14800
  getScrollableAreaState,
14744
14801
  getSidebarState,
14745
14802
  inputVariants,