@zauru-sdk/components 1.0.54 → 1.0.60

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 (94) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/LICENCE.md +11 -11
  3. package/package.json +7 -7
  4. package/src/Alerts/ErrorBoundaryAlert/ErrorBoundaryAlert.tsx +66 -66
  5. package/src/Alerts/StaticAlert.tsx +121 -121
  6. package/src/Alerts/index.ts +2 -2
  7. package/src/BlockUI/BlockUI.tsx +50 -50
  8. package/src/BlockUI/index.tsx +1 -1
  9. package/src/Buttons/Button.tsx +90 -90
  10. package/src/Buttons/index.ts +1 -1
  11. package/src/Card/Card.tsx +24 -24
  12. package/src/Card/index.ts +1 -1
  13. package/src/Chat/ChatLayout.tsx +131 -131
  14. package/src/Chat/ChatMessageHistory.tsx +142 -142
  15. package/src/Chat/index.ts +2 -2
  16. package/src/ConnectionState/ConnectionState.tsx +27 -27
  17. package/src/ConnectionState/index.tsx +1 -1
  18. package/src/Containers/BodyContainer.tsx +14 -14
  19. package/src/Containers/ButtonSectionContainer.tsx +21 -21
  20. package/src/Containers/Container.tsx +39 -39
  21. package/src/Containers/DoubleContainer.tsx +48 -48
  22. package/src/Containers/MainContainer.tsx +17 -17
  23. package/src/Containers/OutletContainer.tsx +14 -14
  24. package/src/Containers/SubContainer.tsx +37 -37
  25. package/src/Containers/index.ts +7 -7
  26. package/src/DynamicTable/BasicPrintDynamicTable.tsx +73 -73
  27. package/src/DynamicTable/DynamicPrintTable.tsx +288 -288
  28. package/src/DynamicTable/DynamicTable.tsx +405 -405
  29. package/src/DynamicTable/GenericDynamicTable.tsx +456 -456
  30. package/src/DynamicTable/index.tsx +4 -4
  31. package/src/Footer/Footer.tsx +50 -50
  32. package/src/Footer/index.tsx +1 -1
  33. package/src/Form/Checkbox/index.tsx +96 -96
  34. package/src/Form/Checklist/index.tsx +35 -35
  35. package/src/Form/DatePicker/index.tsx +132 -132
  36. package/src/Form/DynamicBaculoForm/index.tsx +361 -361
  37. package/src/Form/FieldContainer/DoubleFieldContainer.tsx +35 -35
  38. package/src/Form/FieldContainer/QuadrupleFieldContainer.tsx +36 -36
  39. package/src/Form/FieldContainer/TripleFieldContainer.tsx +35 -35
  40. package/src/Form/FieldContainer/index.ts +3 -3
  41. package/src/Form/FileUpload/index.tsx +184 -184
  42. package/src/Form/FormButtons/index.tsx +78 -78
  43. package/src/Form/FormLayout/index.tsx +37 -37
  44. package/src/Form/SelectField/index.tsx +237 -237
  45. package/src/Form/TextArea/index.tsx +125 -125
  46. package/src/Form/TextField/index.tsx +194 -194
  47. package/src/Form/TimePicker/index.tsx +127 -127
  48. package/src/Form/YesNo/index.tsx +77 -77
  49. package/src/Form/index.ts +13 -13
  50. package/src/Labels/InfoLabel/index.tsx +21 -21
  51. package/src/Labels/index.tsx +1 -1
  52. package/src/Layouts/homeLayout/index.tsx +34 -34
  53. package/src/Layouts/index.ts +1 -1
  54. package/src/LineSeparator/LineSeparator.tsx +3 -3
  55. package/src/LineSeparator/index.tsx +1 -1
  56. package/src/Modal/Modal.tsx +104 -104
  57. package/src/Modal/index.tsx +1 -1
  58. package/src/NavBar/NavBar.tsx +223 -223
  59. package/src/NavBar/NavBar.types.ts +64 -64
  60. package/src/NavBar/NavBar.utils.ts +58 -58
  61. package/src/NavBar/index.tsx +5 -5
  62. package/src/ProgressBar/ProgressBar.tsx +25 -25
  63. package/src/ProgressBar/ProgressCircle.tsx +75 -75
  64. package/src/ProgressBar/index.tsx +2 -2
  65. package/src/Skeletons/LoadingInputSkeleton.tsx +12 -12
  66. package/src/Skeletons/index.ts +1 -1
  67. package/src/Tab/Tab.tsx +63 -63
  68. package/src/Tab/index.ts +1 -1
  69. package/src/Table/ZauruTable.tsx +265 -265
  70. package/src/Table/index.tsx +1 -1
  71. package/src/TaskList/TaskList.tsx +88 -88
  72. package/src/TaskList/index.ts +1 -1
  73. package/src/Titles/LabelArray.tsx +17 -17
  74. package/src/Titles/TableColumnTitle.tsx +9 -9
  75. package/src/Titles/TitleH1.tsx +10 -10
  76. package/src/Titles/TitleH2.tsx +10 -10
  77. package/src/Titles/TitleH3.tsx +10 -10
  78. package/src/Titles/index.ts +5 -5
  79. package/src/Tooltip/Tooltip.tsx +42 -42
  80. package/src/Tooltip/index.ts +1 -1
  81. package/src/WithTooltip/WithTooltip.tsx +21 -21
  82. package/src/WithTooltip/index.tsx +1 -1
  83. package/src/Wizards/StepWizard.tsx +88 -88
  84. package/src/Wizards/index.ts +1 -1
  85. package/src/Zendesk/Chat.tsx +83 -83
  86. package/src/Zendesk/index.ts +2 -2
  87. package/src/Zendesk/zendesk.config.ts +40 -40
  88. package/src/index.ts +24 -24
  89. package/src/postcss.config.mjs +5 -5
  90. package/src/tailwind.config.ts +10 -10
  91. package/src/tailwind.css +3 -3
  92. package/tsconfig.cjs.json +8 -8
  93. package/tsconfig.esm.json +11 -11
  94. package/tsconfig.json +17 -17
package/CHANGELOG.md CHANGED
@@ -3,6 +3,54 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.60](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.59...v1.0.60) (2024-04-17)
7
+
8
+ **Note:** Version bump only for package @zauru-sdk/components
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.59](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.58...v1.0.59) (2024-04-17)
15
+
16
+ **Note:** Version bump only for package @zauru-sdk/components
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.0.58](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.57...v1.0.58) (2024-04-17)
23
+
24
+ **Note:** Version bump only for package @zauru-sdk/components
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.0.57](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.56...v1.0.57) (2024-04-17)
31
+
32
+ **Note:** Version bump only for package @zauru-sdk/components
33
+
34
+
35
+
36
+
37
+
38
+ ## [1.0.56](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.55...v1.0.56) (2024-04-17)
39
+
40
+ **Note:** Version bump only for package @zauru-sdk/components
41
+
42
+
43
+
44
+
45
+
46
+ ## [1.0.55](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.54...v1.0.55) (2024-04-17)
47
+
48
+ **Note:** Version bump only for package @zauru-sdk/components
49
+
50
+
51
+
52
+
53
+
6
54
  ## [1.0.54](https://github.com/intuitiva/zauru-typescript-sdk/compare/v1.0.53...v1.0.54) (2024-04-03)
7
55
 
8
56
  **Note:** Version bump only for package @zauru-sdk/components
package/LICENCE.md CHANGED
@@ -1,11 +1,11 @@
1
- # Released under MIT License
2
-
3
- Copyright (c) 2013 Mark Otto.
4
-
5
- Copyright (c) 2017 Andrew Fong.
6
-
7
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
-
9
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # Released under MIT License
2
+
3
+ Copyright (c) 2013 Mark Otto.
4
+
5
+ Copyright (c) 2017 Andrew Fong.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zauru-sdk/components",
3
- "version": "1.0.54",
3
+ "version": "1.0.60",
4
4
  "description": "Componentes reutilizables en las WebApps de Zauru.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -33,11 +33,11 @@
33
33
  "dependencies": {
34
34
  "@reduxjs/toolkit": "^2.2.1",
35
35
  "@remix-run/react": "^2.8.1",
36
- "@zauru-sdk/common": "^1.0.50",
37
- "@zauru-sdk/hooks": "^1.0.54",
38
- "@zauru-sdk/icons": "^1.0.50",
39
- "@zauru-sdk/types": "^1.0.49",
40
- "@zauru-sdk/utils": "^1.0.52",
36
+ "@zauru-sdk/common": "^1.0.60",
37
+ "@zauru-sdk/hooks": "^1.0.60",
38
+ "@zauru-sdk/icons": "^1.0.60",
39
+ "@zauru-sdk/types": "^1.0.60",
40
+ "@zauru-sdk/utils": "^1.0.60",
41
41
  "framer-motion": "^11.0.8",
42
42
  "jsonwebtoken": "^9.0.2",
43
43
  "react": "^18.2.0",
@@ -47,5 +47,5 @@
47
47
  "react-select": "^5.8.0",
48
48
  "styled-components": "^5.3.5"
49
49
  },
50
- "gitHead": "8a03d876ee3a3209d9826505852f99d8ba26795e"
50
+ "gitHead": "8f9219bf94b9171f79ba4d5ddcab512d2715f314"
51
51
  }
@@ -1,66 +1,66 @@
1
- //<reference> https://tailwindtemplates.io/templates?category=alert
2
- import React from "react";
3
-
4
- type Props = { title: string; description: string };
5
-
6
- export const ErrorBoundaryAlert = (props: Props) => {
7
- const { title, description } = props;
8
- return (
9
- <div className="rounded-full top-20 mx-auto p-3">
10
- <div className="p-4 text-red-900 bg-red-100 border border-red-200 rounded-md">
11
- <div className="flex justify-between flex-wrap">
12
- <div className="w-0 flex-1 flex">
13
- <div className="mr-3 pt-1">
14
- <svg
15
- width="26"
16
- height="26"
17
- viewBox="0 0 24 24"
18
- xmlns="http://www.w3.org/2000/svg"
19
- fill="currentColor"
20
- >
21
- <path d="M13.6086 3.247l8.1916 15.8c.0999.2.1998.5.1998.8 0 1-.7992 1.8-1.7982 1.8H3.7188c-.2997 0-.4995-.1-.7992-.2-.7992-.5-1.1988-1.5-.6993-2.4 5.3067-10.1184 8.0706-15.385 8.2915-15.8.3314-.6222.8681-.8886 1.4817-.897.6135-.008 1.273.2807 1.6151.897zM12 18.95c.718 0 1.3-.582 1.3-1.3 0-.718-.582-1.3-1.3-1.3-.718 0-1.3.582-1.3 1.3 0 .718.582 1.3 1.3 1.3zm-.8895-10.203v5.4c0 .5.4.9.9.9s.9-.4.9-.9v-5.3c0-.5-.4-.9-.9-.9s-.9.4-.9.8z"></path>
22
- </svg>
23
- </div>
24
- <div>
25
- <h4 className="text-md leading-6 font-medium">
26
- {title?.toString()}
27
- </h4>
28
- <p className="text-sm">{description?.toString()}</p>
29
- {/* ============== BOTONES ============= */}
30
- {/* <div className="flex mt-3">
31
- <button
32
- type="button"
33
- className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:w-auto sm:text-sm"
34
- >
35
- Primary button
36
- </button>
37
- <button
38
- type="button"
39
- className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 ml-2 bg-red-200 text-base font-medium hover:bg-red-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-400 sm:w-auto sm:text-sm"
40
- >
41
- Secondary button
42
- </button>
43
- </div> */}
44
- </div>
45
- </div>
46
- <div>
47
- <button
48
- type="button"
49
- className="rounded-md focus:outline-none focus:ring-2 focus:ring-red-500"
50
- >
51
- <svg
52
- width="24"
53
- height="24"
54
- viewBox="0 0 24 24"
55
- xmlns="http://www.w3.org/2000/svg"
56
- fill="currentColor"
57
- >
58
- <path d="M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"></path>
59
- </svg>
60
- </button>
61
- </div>
62
- </div>
63
- </div>
64
- </div>
65
- );
66
- };
1
+ //<reference> https://tailwindtemplates.io/templates?category=alert
2
+ import React from "react";
3
+
4
+ type Props = { title: string; description: string };
5
+
6
+ export const ErrorBoundaryAlert = (props: Props) => {
7
+ const { title, description } = props;
8
+ return (
9
+ <div className="rounded-full top-20 mx-auto p-3">
10
+ <div className="p-4 text-red-900 bg-red-100 border border-red-200 rounded-md">
11
+ <div className="flex justify-between flex-wrap">
12
+ <div className="w-0 flex-1 flex">
13
+ <div className="mr-3 pt-1">
14
+ <svg
15
+ width="26"
16
+ height="26"
17
+ viewBox="0 0 24 24"
18
+ xmlns="http://www.w3.org/2000/svg"
19
+ fill="currentColor"
20
+ >
21
+ <path d="M13.6086 3.247l8.1916 15.8c.0999.2.1998.5.1998.8 0 1-.7992 1.8-1.7982 1.8H3.7188c-.2997 0-.4995-.1-.7992-.2-.7992-.5-1.1988-1.5-.6993-2.4 5.3067-10.1184 8.0706-15.385 8.2915-15.8.3314-.6222.8681-.8886 1.4817-.897.6135-.008 1.273.2807 1.6151.897zM12 18.95c.718 0 1.3-.582 1.3-1.3 0-.718-.582-1.3-1.3-1.3-.718 0-1.3.582-1.3 1.3 0 .718.582 1.3 1.3 1.3zm-.8895-10.203v5.4c0 .5.4.9.9.9s.9-.4.9-.9v-5.3c0-.5-.4-.9-.9-.9s-.9.4-.9.8z"></path>
22
+ </svg>
23
+ </div>
24
+ <div>
25
+ <h4 className="text-md leading-6 font-medium">
26
+ {title?.toString()}
27
+ </h4>
28
+ <p className="text-sm">{description?.toString()}</p>
29
+ {/* ============== BOTONES ============= */}
30
+ {/* <div className="flex mt-3">
31
+ <button
32
+ type="button"
33
+ className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:w-auto sm:text-sm"
34
+ >
35
+ Primary button
36
+ </button>
37
+ <button
38
+ type="button"
39
+ className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 ml-2 bg-red-200 text-base font-medium hover:bg-red-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-400 sm:w-auto sm:text-sm"
40
+ >
41
+ Secondary button
42
+ </button>
43
+ </div> */}
44
+ </div>
45
+ </div>
46
+ <div>
47
+ <button
48
+ type="button"
49
+ className="rounded-md focus:outline-none focus:ring-2 focus:ring-red-500"
50
+ >
51
+ <svg
52
+ width="24"
53
+ height="24"
54
+ viewBox="0 0 24 24"
55
+ xmlns="http://www.w3.org/2000/svg"
56
+ fill="currentColor"
57
+ >
58
+ <path d="M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"></path>
59
+ </svg>
60
+ </button>
61
+ </div>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ );
66
+ };
@@ -1,121 +1,121 @@
1
- //<reference> https://tailwindtemplates.io/templates?category=StaticAlert
2
- import React from "react";
3
-
4
- type Props = {
5
- className?: string;
6
- title: string;
7
- description: any;
8
- showCloseButton?: boolean;
9
- onClose?: () => void;
10
- type?: "success" | "info";
11
- loading?: boolean;
12
- };
13
-
14
- const getConfig = (type: string) => {
15
- switch (type) {
16
- case "info":
17
- return {
18
- containerClassName:
19
- "text-blue-900 bg-blue-100 border border-blue-200 rounded-md",
20
- buttonClassName:
21
- "rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",
22
- path: (
23
- <path d="M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"></path>
24
- ),
25
- };
26
- case "success":
27
- return {
28
- containerClassName:
29
- "text-green-900 bg-green-100 border border-green-200 rounded-md",
30
- buttonClassName:
31
- "rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",
32
- path: (
33
- <path d="M8.445 12.6675A.9.9 0 0 0 7.1424 13.91l2.5726 2.7448c.3679.3856.9884.3689 1.335-.036l5.591-7.0366a.9.9 0 0 0-1.3674-1.1705l-4.6548 5.9132a.4.4 0 0 1-.607.0252l-1.567-1.6826zM1.9995 12c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z"></path>
34
- ),
35
- };
36
- default:
37
- return {
38
- containerClassName:
39
- "text-blue-900 bg-blue-100 border border-blue-200 rounded-md",
40
- buttonClassName:
41
- "rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",
42
- path: (
43
- <path d="M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"></path>
44
- ),
45
- };
46
- }
47
- };
48
-
49
- export const StaticAlert = (props: Props) => {
50
- const {
51
- className,
52
- title,
53
- description,
54
- onClose,
55
- type = "info",
56
- loading = false,
57
- } = props;
58
-
59
- const config = getConfig(type);
60
-
61
- return (
62
- <div
63
- className={`${className} ${config.containerClassName} ${
64
- loading ? " hidden" : ""
65
- }`}
66
- >
67
- <div className="flex justify-between flex-wrap">
68
- <div className="w-0 flex-1 flex">
69
- <div className="mr-3 pt-1">
70
- <svg
71
- width="26"
72
- height="26"
73
- viewBox="0 0 24 24"
74
- xmlns="http://www.w3.org/2000/svg"
75
- fill="currentColor"
76
- >
77
- {config.path}
78
- </svg>
79
- </div>
80
- <div>
81
- <h4 className="text-md leading-6 font-medium">{title}</h4>
82
- <div className="text-sm">{description}</div>
83
- {/* <div className="flex mt-3">
84
- <button
85
- type="button"
86
- className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-${color}-700 text-base font-medium text-white hover:bg-${color}-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${color}-500 sm:w-auto sm:text-sm"
87
- >
88
- Primary button
89
- </button>
90
- <button
91
- type="button"
92
- className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 ml-2 bg-${color}-200 text-base font-medium hover:bg-${color}-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${color}-400 sm:w-auto sm:text-sm"
93
- >
94
- Secondary button
95
- </button>
96
- </div> */}
97
- </div>
98
- </div>
99
- {onClose && (
100
- <div>
101
- <button
102
- type="button"
103
- className={`${config.buttonClassName}`}
104
- onClick={onClose}
105
- >
106
- <svg
107
- width="24"
108
- height="24"
109
- viewBox="0 0 24 24"
110
- xmlns="http://www.w3.org/2000/svg"
111
- fill="currentColor"
112
- >
113
- <path d="M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"></path>
114
- </svg>
115
- </button>
116
- </div>
117
- )}
118
- </div>
119
- </div>
120
- );
121
- };
1
+ //<reference> https://tailwindtemplates.io/templates?category=StaticAlert
2
+ import React from "react";
3
+
4
+ type Props = {
5
+ className?: string;
6
+ title: string;
7
+ description: any;
8
+ showCloseButton?: boolean;
9
+ onClose?: () => void;
10
+ type?: "success" | "info";
11
+ loading?: boolean;
12
+ };
13
+
14
+ const getConfig = (type: string) => {
15
+ switch (type) {
16
+ case "info":
17
+ return {
18
+ containerClassName:
19
+ "text-blue-900 bg-blue-100 border border-blue-200 rounded-md",
20
+ buttonClassName:
21
+ "rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",
22
+ path: (
23
+ <path d="M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"></path>
24
+ ),
25
+ };
26
+ case "success":
27
+ return {
28
+ containerClassName:
29
+ "text-green-900 bg-green-100 border border-green-200 rounded-md",
30
+ buttonClassName:
31
+ "rounded-md focus:outline-none focus:ring-2 focus:ring-green-500",
32
+ path: (
33
+ <path d="M8.445 12.6675A.9.9 0 0 0 7.1424 13.91l2.5726 2.7448c.3679.3856.9884.3689 1.335-.036l5.591-7.0366a.9.9 0 0 0-1.3674-1.1705l-4.6548 5.9132a.4.4 0 0 1-.607.0252l-1.567-1.6826zM1.9995 12c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z"></path>
34
+ ),
35
+ };
36
+ default:
37
+ return {
38
+ containerClassName:
39
+ "text-blue-900 bg-blue-100 border border-blue-200 rounded-md",
40
+ buttonClassName:
41
+ "rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",
42
+ path: (
43
+ <path d="M14.1667 17h-3.3334c-.5 0-.8333-.3146-.8333-.7865 0-.472.3333-.7865.8333-.7865H11.5c.0833 0 .1667-.0787.1667-.1573v-3.5394c0-.0786-.0834-.1573-.1667-.1573h-.6667c-.5 0-.8333-.3146-.8333-.7865S10.3333 10 10.8333 10h.8334c.9166 0 1.6666.7079 1.6666 1.573v3.7753c0 .0787.0834.1573.1667.1573h.6667c.5 0 .8333.3146.8333.7865 0 .472-.3333.7079-.8333.7079zM12.3 6c.6933 0 1.3.6067 1.3 1.3s-.52 1.3-1.3 1.3S11 7.9933 11 7.3 11.6067 6 12.3 6zM12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2"></path>
44
+ ),
45
+ };
46
+ }
47
+ };
48
+
49
+ export const StaticAlert = (props: Props) => {
50
+ const {
51
+ className,
52
+ title,
53
+ description,
54
+ onClose,
55
+ type = "info",
56
+ loading = false,
57
+ } = props;
58
+
59
+ const config = getConfig(type);
60
+
61
+ return (
62
+ <div
63
+ className={`${className} ${config.containerClassName} ${
64
+ loading ? " hidden" : ""
65
+ }`}
66
+ >
67
+ <div className="flex justify-between flex-wrap">
68
+ <div className="w-0 flex-1 flex">
69
+ <div className="mr-3 pt-1">
70
+ <svg
71
+ width="26"
72
+ height="26"
73
+ viewBox="0 0 24 24"
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ fill="currentColor"
76
+ >
77
+ {config.path}
78
+ </svg>
79
+ </div>
80
+ <div>
81
+ <h4 className="text-md leading-6 font-medium">{title}</h4>
82
+ <div className="text-sm">{description}</div>
83
+ {/* <div className="flex mt-3">
84
+ <button
85
+ type="button"
86
+ className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-${color}-700 text-base font-medium text-white hover:bg-${color}-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${color}-500 sm:w-auto sm:text-sm"
87
+ >
88
+ Primary button
89
+ </button>
90
+ <button
91
+ type="button"
92
+ className="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 ml-2 bg-${color}-200 text-base font-medium hover:bg-${color}-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${color}-400 sm:w-auto sm:text-sm"
93
+ >
94
+ Secondary button
95
+ </button>
96
+ </div> */}
97
+ </div>
98
+ </div>
99
+ {onClose && (
100
+ <div>
101
+ <button
102
+ type="button"
103
+ className={`${config.buttonClassName}`}
104
+ onClick={onClose}
105
+ >
106
+ <svg
107
+ width="24"
108
+ height="24"
109
+ viewBox="0 0 24 24"
110
+ xmlns="http://www.w3.org/2000/svg"
111
+ fill="currentColor"
112
+ >
113
+ <path d="M17.6555 6.3331a.9.9 0 0 1 .001 1.2728l-4.1032 4.1085a.4.4 0 0 0 0 .5653l4.1031 4.1088a.9002.9002 0 0 1 .0797 1.1807l-.0806.092a.9.9 0 0 1-1.2728-.0009l-4.1006-4.1068a.4.4 0 0 0-.5662 0l-4.099 4.1068a.9.9 0 1 1-1.2738-1.2718l4.1027-4.1089a.4.4 0 0 0 0-.5652L6.343 7.6059a.9002.9002 0 0 1-.0796-1.1807l.0806-.092a.9.9 0 0 1 1.2728.0009l4.099 4.1055a.4.4 0 0 0 .5662 0l4.1006-4.1055a.9.9 0 0 1 1.2728-.001z"></path>
114
+ </svg>
115
+ </button>
116
+ </div>
117
+ )}
118
+ </div>
119
+ </div>
120
+ );
121
+ };
@@ -1,2 +1,2 @@
1
- export * from "./ErrorBoundaryAlert/ErrorBoundaryAlert.js";
2
- export * from "./StaticAlert.js";
1
+ export * from "./ErrorBoundaryAlert/ErrorBoundaryAlert.js";
2
+ export * from "./StaticAlert.js";
@@ -1,50 +1,50 @@
1
- import React from "react";
2
-
3
- type Props = {
4
- children: React.ReactNode;
5
- active: boolean;
6
- loadingText?: string;
7
- };
8
-
9
- export const BlockUI = (props: Props) => {
10
- const { children, active, loadingText } = props;
11
-
12
- if (!active) {
13
- return <>{children}</>;
14
- }
15
-
16
- return (
17
- <div>
18
- <div className="relative">
19
- <div className="absolute bg-gray-100 bg-opacity-20 z-10 h-full w-full flex items-center justify-center">
20
- <div className="flex items-center">
21
- <span className="text-3xl mr-4">{loadingText}</span>
22
- {/* <!-- loading icon --> */}
23
- <svg
24
- className="animate-spin h-5 w-5 text-gray-600"
25
- xmlns="http://www.w3.org/2000/svg"
26
- fill="none"
27
- viewBox="0 0 24 24"
28
- >
29
- <circle
30
- className="opacity-25"
31
- cx="12"
32
- cy="12"
33
- r="10"
34
- stroke="currentColor"
35
- strokeWidth="4"
36
- ></circle>
37
- <path
38
- className="opacity-75"
39
- fill="currentColor"
40
- d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
41
- ></path>
42
- </svg>
43
- {/* <!-- end loading icon --> */}
44
- </div>
45
- </div>
46
- {children}
47
- </div>
48
- </div>
49
- );
50
- };
1
+ import React from "react";
2
+
3
+ type Props = {
4
+ children: React.ReactNode;
5
+ active: boolean;
6
+ loadingText?: string;
7
+ };
8
+
9
+ export const BlockUI = (props: Props) => {
10
+ const { children, active, loadingText } = props;
11
+
12
+ if (!active) {
13
+ return <>{children}</>;
14
+ }
15
+
16
+ return (
17
+ <div>
18
+ <div className="relative">
19
+ <div className="absolute bg-gray-100 bg-opacity-20 z-10 h-full w-full flex items-center justify-center">
20
+ <div className="flex items-center">
21
+ <span className="text-3xl mr-4">{loadingText}</span>
22
+ {/* <!-- loading icon --> */}
23
+ <svg
24
+ className="animate-spin h-5 w-5 text-gray-600"
25
+ xmlns="http://www.w3.org/2000/svg"
26
+ fill="none"
27
+ viewBox="0 0 24 24"
28
+ >
29
+ <circle
30
+ className="opacity-25"
31
+ cx="12"
32
+ cy="12"
33
+ r="10"
34
+ stroke="currentColor"
35
+ strokeWidth="4"
36
+ ></circle>
37
+ <path
38
+ className="opacity-75"
39
+ fill="currentColor"
40
+ d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
41
+ ></path>
42
+ </svg>
43
+ {/* <!-- end loading icon --> */}
44
+ </div>
45
+ </div>
46
+ {children}
47
+ </div>
48
+ </div>
49
+ );
50
+ };
@@ -1 +1 @@
1
- export * from "./BlockUI.js";
1
+ export * from "./BlockUI.js";