@raystack/apsara 0.44.2 → 0.44.4

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 (44) hide show
  1. package/dist/errorstate/errorstate.cjs +3 -0
  2. package/dist/errorstate/errorstate.cjs.map +1 -1
  3. package/dist/errorstate/errorstate.d.ts +3 -0
  4. package/dist/errorstate/errorstate.d.ts.map +1 -1
  5. package/dist/errorstate/errorstate.js +3 -0
  6. package/dist/errorstate/errorstate.js.map +1 -1
  7. package/dist/style.css +1 -1
  8. package/dist/textfield/textfield.cjs +3 -0
  9. package/dist/textfield/textfield.cjs.map +1 -1
  10. package/dist/textfield/textfield.d.ts +6 -0
  11. package/dist/textfield/textfield.d.ts.map +1 -1
  12. package/dist/textfield/textfield.js +3 -0
  13. package/dist/textfield/textfield.js.map +1 -1
  14. package/dist/v1/components/avatar/avatar.cjs +5 -2
  15. package/dist/v1/components/avatar/avatar.cjs.map +1 -1
  16. package/dist/v1/components/avatar/avatar.d.ts +1 -1
  17. package/dist/v1/components/avatar/avatar.d.ts.map +1 -1
  18. package/dist/v1/components/avatar/avatar.js +5 -2
  19. package/dist/v1/components/avatar/avatar.js.map +1 -1
  20. package/dist/v1/components/avatar/utils.cjs +20 -0
  21. package/dist/v1/components/avatar/utils.cjs.map +1 -1
  22. package/dist/v1/components/avatar/utils.d.ts +3 -0
  23. package/dist/v1/components/avatar/utils.d.ts.map +1 -1
  24. package/dist/v1/components/avatar/utils.js +20 -1
  25. package/dist/v1/components/avatar/utils.js.map +1 -1
  26. package/dist/v1/components/calendar/calendar.cjs +1 -1
  27. package/dist/v1/components/calendar/calendar.cjs.map +1 -1
  28. package/dist/v1/components/calendar/calendar.d.ts.map +1 -1
  29. package/dist/v1/components/calendar/calendar.js +1 -1
  30. package/dist/v1/components/calendar/calendar.js.map +1 -1
  31. package/dist/v1/components/calendar/range-picker.cjs +21 -6
  32. package/dist/v1/components/calendar/range-picker.cjs.map +1 -1
  33. package/dist/v1/components/calendar/range-picker.d.ts.map +1 -1
  34. package/dist/v1/components/calendar/range-picker.js +22 -7
  35. package/dist/v1/components/calendar/range-picker.js.map +1 -1
  36. package/dist/v1/components/filter-chip/filter-chip.cjs +2 -2
  37. package/dist/v1/components/filter-chip/filter-chip.cjs.map +1 -1
  38. package/dist/v1/components/filter-chip/filter-chip.d.ts.map +1 -1
  39. package/dist/v1/components/filter-chip/filter-chip.js +3 -3
  40. package/dist/v1/components/filter-chip/filter-chip.js.map +1 -1
  41. package/dist/v1/components/filter-chip/filter-chip.module.css.cjs +1 -1
  42. package/dist/v1/components/filter-chip/filter-chip.module.css.js +1 -1
  43. package/dist/v1/style.css +1 -1
  44. package/package.json +1 -1
@@ -51,6 +51,9 @@ const getHeadline = (status = "Something gone wrong") => {
51
51
  }
52
52
  };
53
53
  const errorstate = index.cva(errorstate_module.default.errorstate);
54
+ /**
55
+ * @deprecated Use EmptyState from '@raystack/apsara/v1' instead.
56
+ */
54
57
  function ErrorState({ children, className, status, icon, message, ...props }) {
55
58
  return (jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { justify: "center", style: { width: "100%", height: "100%" }, children: jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction: "column", gap: "large", align: "center", justify: "center", className: errorstate({ className }), style: { textAlign: "center", maxWidth: "400px" }, ...props, children: [icon ? icon : getIcon(status), jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { direction: "column", gap: "medium", children: [jsxRuntime.jsxRuntimeExports.jsx(headline.Headline, { size: "large", children: getHeadline(status) }), jsxRuntime.jsxRuntimeExports.jsx(body.Body, { size: "large", children: message ? message : getMessage(status) })] })] }) }));
56
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorstate.cjs","sources":["../../errorstate/errorstate.tsx"],"sourcesContent":["import {\n ExclamationTriangleIcon,\n FileIcon,\n FileTextIcon,\n} from \"@radix-ui/react-icons\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { Body } from \"../body\";\nimport { Flex } from \"../flex\";\nimport { Headline } from \"../headline\";\nimport styles from \"./errorstate.module.css\";\n\ntype Status =\n | \"404\"\n | \"NOT_FOUND\"\n | \"UNDER_MAINTENANCE\"\n | \"SOMETHING_WENT_WRONG\"\n | string;\n\nconst getIcon = (status: string = \"\") => {\n switch (status) {\n case \"400\":\n return <FileTextIcon width={80} height={80} />;\n case \"NOT_FOUND\":\n return <FileIcon width={80} height={80} />;\n case \"UNDER_MAINTENANCE\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n case \"SOMETHING_WENT_WRONG\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n default:\n return <ExclamationTriangleIcon width={80} height={80} />;\n }\n};\n\nconst getMessage = (\n status: string = \"System is facing some issue with your request, please try again later\"\n) => {\n switch (status) {\n case \"400\":\n return \"Sorry, the page you are looking for doesn’t exist or has been moved.\";\n case \"NOT_FOUND\":\n return \"Sorry, the resource you are looking for doesn’t exist or has been deleted.\";\n case \"UNDER_MAINTENANCE\":\n return \"The page you are looking for is under maintenance and will be back soon.\";\n case \"SOMETHING_WENT_WRONG\":\n return \"System is facing some issue with your request, please try again later\";\n default:\n return status;\n }\n};\n\nconst getHeadline = (status: string = \"Something gone wrong\") => {\n switch (status) {\n case \"400\":\n return \"404 error\";\n case \"NOT_FOUND\":\n return \"Resource not found\";\n case \"UNDER_MAINTENANCE\":\n return \"Under maintenance\";\n case \"SOMETHING_WENT_WRONG\":\n return \"Something gone wrong\";\n default:\n return status;\n }\n};\n\nconst errorstate = cva(styles.errorstate);\ntype ErrorStateProps = PropsWithChildren<VariantProps<typeof errorstate>> &\n HTMLAttributes<HTMLElement> & {\n icon?: React.ReactElement;\n status?: Status;\n message?: string;\n };\n\nexport function ErrorState({\n children,\n className,\n status,\n icon,\n message,\n ...props\n}: ErrorStateProps) {\n return (\n <Flex justify=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <Flex\n direction=\"column\"\n gap=\"large\"\n align=\"center\"\n justify=\"center\"\n className={errorstate({ className })}\n style={{ textAlign: \"center\", maxWidth: \"400px\" }}\n {...props}\n >\n {icon ? icon : getIcon(status)}\n <Flex direction=\"column\" gap=\"medium\">\n <Headline size=\"large\">{getHeadline(status)}</Headline>\n <Body size=\"large\">{message ? message : getMessage(status)}</Body>\n </Flex>\n </Flex>\n </Flex>\n );\n}\n"],"names":["_jsx","FileTextIcon","FileIcon","ExclamationTriangleIcon","cva","styles","Flex","_jsxs","Headline","Body"],"mappings":";;;;;;;;;;AAmBA,MAAM,OAAO,GAAG,CAAC,MAAiB,GAAA,EAAE,KAAI;IACtC,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;YACR,OAAOA,gCAAA,CAACC,2BAAY,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AACjD,QAAA,KAAK,WAAW;YACd,OAAOD,gCAAA,CAACE,uBAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC7C,QAAA,KAAK,mBAAmB;YACtB,OAAOF,gCAAA,CAACG,sCAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC5D,QAAA,KAAK,sBAAsB;YACzB,OAAOH,gCAAA,CAACG,sCAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC5D,QAAA;YACE,OAAOH,gCAAA,CAACG,sCAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;KAC7D;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CACjB,MAAiB,GAAA,uEAAuE,KACtF;IACF,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,sEAAsE,CAAC;AAChF,QAAA,KAA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I,GAAG,OAAO,CAAC,MAAM,CAAC,EAC9BC,iCAAC,CAAAD,SAAI,EAAC,EAAA,SAAS,EAAC,QAAQ,EAAC,GAAG,EAAC,QAAQ,EACnC,QAAA,EAAA,CAAAN,gCAAA,CAACQ,iBAAQ,EAAA,EAAC,IAAI,EAAC,OAAO,EAAA,QAAA,EAAE,WAAW,CAAC,MAAM,CAAC,EAAY,CAAA,EACvDR,gCAAC,CAAAS,SAAI,EAAC,EAAA,IAAI,EAAC,OAAO,EAAE,QAAA,EAAA,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,EAAA,CAAQ,CAC7D,EAAA,CAAA,CAAA,EAAA,CACF,EACF,CAAA,EACP;AACJ;;;;"}
1
+ {"version":3,"file":"errorstate.cjs","sources":["../../errorstate/errorstate.tsx"],"sourcesContent":["import {\n ExclamationTriangleIcon,\n FileIcon,\n FileTextIcon,\n} from \"@radix-ui/react-icons\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { Body } from \"../body\";\nimport { Flex } from \"../flex\";\nimport { Headline } from \"../headline\";\nimport styles from \"./errorstate.module.css\";\n\ntype Status =\n | \"404\"\n | \"NOT_FOUND\"\n | \"UNDER_MAINTENANCE\"\n | \"SOMETHING_WENT_WRONG\"\n | string;\n\nconst getIcon = (status: string = \"\") => {\n switch (status) {\n case \"400\":\n return <FileTextIcon width={80} height={80} />;\n case \"NOT_FOUND\":\n return <FileIcon width={80} height={80} />;\n case \"UNDER_MAINTENANCE\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n case \"SOMETHING_WENT_WRONG\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n default:\n return <ExclamationTriangleIcon width={80} height={80} />;\n }\n};\n\nconst getMessage = (\n status: string = \"System is facing some issue with your request, please try again later\"\n) => {\n switch (status) {\n case \"400\":\n return \"Sorry, the page you are looking for doesn’t exist or has been moved.\";\n case \"NOT_FOUND\":\n return \"Sorry, the resource you are looking for doesn’t exist or has been deleted.\";\n case \"UNDER_MAINTENANCE\":\n return \"The page you are looking for is under maintenance and will be back soon.\";\n case \"SOMETHING_WENT_WRONG\":\n return \"System is facing some issue with your request, please try again later\";\n default:\n return status;\n }\n};\n\nconst getHeadline = (status: string = \"Something gone wrong\") => {\n switch (status) {\n case \"400\":\n return \"404 error\";\n case \"NOT_FOUND\":\n return \"Resource not found\";\n case \"UNDER_MAINTENANCE\":\n return \"Under maintenance\";\n case \"SOMETHING_WENT_WRONG\":\n return \"Something gone wrong\";\n default:\n return status;\n }\n};\n\nconst errorstate = cva(styles.errorstate);\ntype ErrorStateProps = PropsWithChildren<VariantProps<typeof errorstate>> &\n HTMLAttributes<HTMLElement> & {\n icon?: React.ReactElement;\n status?: Status;\n message?: string;\n };\n\n/**\n * @deprecated Use EmptyState from '@raystack/apsara/v1' instead.\n */\nexport function ErrorState({\n children,\n className,\n status,\n icon,\n message,\n ...props\n}: ErrorStateProps) {\n return (\n <Flex justify=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <Flex\n direction=\"column\"\n gap=\"large\"\n align=\"center\"\n justify=\"center\"\n className={errorstate({ className })}\n style={{ textAlign: \"center\", maxWidth: \"400px\" }}\n {...props}\n >\n {icon ? icon : getIcon(status)}\n <Flex direction=\"column\" gap=\"medium\">\n <Headline size=\"large\">{getHeadline(status)}</Headline>\n <Body size=\"large\">{message ? message : getMessage(status)}</Body>\n </Flex>\n </Flex>\n </Flex>\n );\n}\n"],"names":["_jsx","FileTextIcon","FileIcon","ExclamationTriangleIcon","cva","styles","Flex","_jsxs","Headline","Body"],"mappings":";;;;;;;;;;AAmBA,MAAM,OAAO,GAAG,CAAC,MAAiB,GAAA,EAAE,KAAI;IACtC,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;YACR,OAAOA,gCAAA,CAACC,2BAAY,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AACjD,QAAA,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string;
9
9
  };
10
+ /**
11
+ * @deprecated Use EmptyState from '@raystack/apsara/v1' instead.
12
+ */
10
13
  export declare function ErrorState({ children, className, status, icon, message, ...props }: ErrorStateProps): import("react/jsx-runtime").JSX.Element;
11
14
  export {};
12
15
  //# sourceMappingURL=errorstate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errorstate.d.ts","sourceRoot":"","sources":["../../errorstate/errorstate.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM1D,KAAK,MAAM,GACP,KAAK,GACL,WAAW,GACX,mBAAmB,GACnB,sBAAsB,GACtB,MAAM,CAAC;AAiDX,QAAA,MAAM,UAAU,oFAAyB,CAAC;AAC1C,KAAK,eAAe,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,GACvE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,2CAoBjB"}
1
+ {"version":3,"file":"errorstate.d.ts","sourceRoot":"","sources":["../../errorstate/errorstate.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM1D,KAAK,MAAM,GACP,KAAK,GACL,WAAW,GACX,mBAAmB,GACnB,sBAAsB,GACtB,MAAM,CAAC;AAiDX,QAAA,MAAM,UAAU,oFAAyB,CAAC;AAC1C,KAAK,eAAe,GAAG,iBAAiB,CAAC,YAAY,CAAC,OAAO,UAAU,CAAC,CAAC,GACvE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,YAAY,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEJ;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,eAAe,2CAoBjB"}
@@ -49,6 +49,9 @@ const getHeadline = (status = "Something gone wrong") => {
49
49
  }
50
50
  };
51
51
  const errorstate = cva(styles.errorstate);
52
+ /**
53
+ * @deprecated Use EmptyState from '@raystack/apsara/v1' instead.
54
+ */
52
55
  function ErrorState({ children, className, status, icon, message, ...props }) {
53
56
  return (jsxRuntimeExports.jsx(Flex, { justify: "center", style: { width: "100%", height: "100%" }, children: jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: "large", align: "center", justify: "center", className: errorstate({ className }), style: { textAlign: "center", maxWidth: "400px" }, ...props, children: [icon ? icon : getIcon(status), jsxRuntimeExports.jsxs(Flex, { direction: "column", gap: "medium", children: [jsxRuntimeExports.jsx(Headline, { size: "large", children: getHeadline(status) }), jsxRuntimeExports.jsx(Body, { size: "large", children: message ? message : getMessage(status) })] })] }) }));
54
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorstate.js","sources":["../../errorstate/errorstate.tsx"],"sourcesContent":["import {\n ExclamationTriangleIcon,\n FileIcon,\n FileTextIcon,\n} from \"@radix-ui/react-icons\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { Body } from \"../body\";\nimport { Flex } from \"../flex\";\nimport { Headline } from \"../headline\";\nimport styles from \"./errorstate.module.css\";\n\ntype Status =\n | \"404\"\n | \"NOT_FOUND\"\n | \"UNDER_MAINTENANCE\"\n | \"SOMETHING_WENT_WRONG\"\n | string;\n\nconst getIcon = (status: string = \"\") => {\n switch (status) {\n case \"400\":\n return <FileTextIcon width={80} height={80} />;\n case \"NOT_FOUND\":\n return <FileIcon width={80} height={80} />;\n case \"UNDER_MAINTENANCE\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n case \"SOMETHING_WENT_WRONG\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n default:\n return <ExclamationTriangleIcon width={80} height={80} />;\n }\n};\n\nconst getMessage = (\n status: string = \"System is facing some issue with your request, please try again later\"\n) => {\n switch (status) {\n case \"400\":\n return \"Sorry, the page you are looking for doesn’t exist or has been moved.\";\n case \"NOT_FOUND\":\n return \"Sorry, the resource you are looking for doesn’t exist or has been deleted.\";\n case \"UNDER_MAINTENANCE\":\n return \"The page you are looking for is under maintenance and will be back soon.\";\n case \"SOMETHING_WENT_WRONG\":\n return \"System is facing some issue with your request, please try again later\";\n default:\n return status;\n }\n};\n\nconst getHeadline = (status: string = \"Something gone wrong\") => {\n switch (status) {\n case \"400\":\n return \"404 error\";\n case \"NOT_FOUND\":\n return \"Resource not found\";\n case \"UNDER_MAINTENANCE\":\n return \"Under maintenance\";\n case \"SOMETHING_WENT_WRONG\":\n return \"Something gone wrong\";\n default:\n return status;\n }\n};\n\nconst errorstate = cva(styles.errorstate);\ntype ErrorStateProps = PropsWithChildren<VariantProps<typeof errorstate>> &\n HTMLAttributes<HTMLElement> & {\n icon?: React.ReactElement;\n status?: Status;\n message?: string;\n };\n\nexport function ErrorState({\n children,\n className,\n status,\n icon,\n message,\n ...props\n}: ErrorStateProps) {\n return (\n <Flex justify=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <Flex\n direction=\"column\"\n gap=\"large\"\n align=\"center\"\n justify=\"center\"\n className={errorstate({ className })}\n style={{ textAlign: \"center\", maxWidth: \"400px\" }}\n {...props}\n >\n {icon ? icon : getIcon(status)}\n <Flex direction=\"column\" gap=\"medium\">\n <Headline size=\"large\">{getHeadline(status)}</Headline>\n <Body size=\"large\">{message ? message : getMessage(status)}</Body>\n </Flex>\n </Flex>\n </Flex>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAmBA,MAAM,OAAO,GAAG,CAAC,MAAiB,GAAA,EAAE,KAAI;IACtC,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;YACR,OAAOA,qBAAA,CAAC,YAAY,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AACjD,QAAA,KAAK,WAAW;YACd,OAAOA,qBAAA,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC7C,QAAA,KAAK,mBAAmB;YACtB,OAAOA,qBAAA,CAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC5D,QAAA,KAAK,sBAAsB;YACzB,OAAOA,qBAAA,CAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC5D,QAAA;YACE,OAAOA,qBAAA,CAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;KAC7D;AACH,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CACjB,MAAiB,GAAA,uEAAuE,KACtF;IACF,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;AACR,YAAA,OAAO,sEAAsE,CAAC;AAChF,QAAA,KAAK,WAAW;AACd,YAAA,OAAO,4EAA4E,CAAC;AACtF,QAAA,KAAK,mBAAmB;AACtB,YAAA,OAAO,0EAA0E,CAAC;AACpF,QAAA,KAAK,sBAAsB;AACzB,YAAA,OAAO,uEAAuE,CAAC;AACjF,QAAA;AACE,YAAA,OAAO,MAAM,CAAC;KACjB;A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,WAAW,CAAC,MAAM,CAAC,EAAY,CAAA,EACvDA,qBAAC,CAAA,IAAI,EAAC,EAAA,IAAI,EAAC,OAAO,EAAE,QAAA,EAAA,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,EAAA,CAAQ,CAC7D,EAAA,CAAA,CAAA,EAAA,CACF,EACF,CAAA,EACP;AACJ;;;;"}
1
+ {"version":3,"file":"errorstate.js","sources":["../../errorstate/errorstate.tsx"],"sourcesContent":["import {\n ExclamationTriangleIcon,\n FileIcon,\n FileTextIcon,\n} from \"@radix-ui/react-icons\";\nimport { VariantProps, cva } from \"class-variance-authority\";\nimport { HTMLAttributes, PropsWithChildren } from \"react\";\nimport { Body } from \"../body\";\nimport { Flex } from \"../flex\";\nimport { Headline } from \"../headline\";\nimport styles from \"./errorstate.module.css\";\n\ntype Status =\n | \"404\"\n | \"NOT_FOUND\"\n | \"UNDER_MAINTENANCE\"\n | \"SOMETHING_WENT_WRONG\"\n | string;\n\nconst getIcon = (status: string = \"\") => {\n switch (status) {\n case \"400\":\n return <FileTextIcon width={80} height={80} />;\n case \"NOT_FOUND\":\n return <FileIcon width={80} height={80} />;\n case \"UNDER_MAINTENANCE\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n case \"SOMETHING_WENT_WRONG\":\n return <ExclamationTriangleIcon width={80} height={80} />;\n default:\n return <ExclamationTriangleIcon width={80} height={80} />;\n }\n};\n\nconst getMessage = (\n status: string = \"System is facing some issue with your request, please try again later\"\n) => {\n switch (status) {\n case \"400\":\n return \"Sorry, the page you are looking for doesn’t exist or has been moved.\";\n case \"NOT_FOUND\":\n return \"Sorry, the resource you are looking for doesn’t exist or has been deleted.\";\n case \"UNDER_MAINTENANCE\":\n return \"The page you are looking for is under maintenance and will be back soon.\";\n case \"SOMETHING_WENT_WRONG\":\n return \"System is facing some issue with your request, please try again later\";\n default:\n return status;\n }\n};\n\nconst getHeadline = (status: string = \"Something gone wrong\") => {\n switch (status) {\n case \"400\":\n return \"404 error\";\n case \"NOT_FOUND\":\n return \"Resource not found\";\n case \"UNDER_MAINTENANCE\":\n return \"Under maintenance\";\n case \"SOMETHING_WENT_WRONG\":\n return \"Something gone wrong\";\n default:\n return status;\n }\n};\n\nconst errorstate = cva(styles.errorstate);\ntype ErrorStateProps = PropsWithChildren<VariantProps<typeof errorstate>> &\n HTMLAttributes<HTMLElement> & {\n icon?: React.ReactElement;\n status?: Status;\n message?: string;\n };\n\n/**\n * @deprecated Use EmptyState from '@raystack/apsara/v1' instead.\n */\nexport function ErrorState({\n children,\n className,\n status,\n icon,\n message,\n ...props\n}: ErrorStateProps) {\n return (\n <Flex justify=\"center\" style={{ width: \"100%\", height: \"100%\" }}>\n <Flex\n direction=\"column\"\n gap=\"large\"\n align=\"center\"\n justify=\"center\"\n className={errorstate({ className })}\n style={{ textAlign: \"center\", maxWidth: \"400px\" }}\n {...props}\n >\n {icon ? icon : getIcon(status)}\n <Flex direction=\"column\" gap=\"medium\">\n <Headline size=\"large\">{getHeadline(status)}</Headline>\n <Body size=\"large\">{message ? message : getMessage(status)}</Body>\n </Flex>\n </Flex>\n </Flex>\n );\n}\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;AAmBA,MAAM,OAAO,GAAG,CAAC,MAAiB,GAAA,EAAE,KAAI;IACtC,QAAQ,MAAM;AACZ,QAAA,KAAK,KAAK;YACR,OAAOA,qBAAA,CAAC,YAAY,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AACjD,QAAA,KAAK,WAAW;YACd,OAAOA,qBAAA,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC7C,QAAA,KAAK,mBAAmB;YACtB,OAAOA,qBAAA,CAAC,uBAAuB,EAAA,EAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAA,CAAI,CAAC;AAC5D,QAAA,KAAK,sB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