@mintmoney/react 0.1.0-alpha-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.
Files changed (104) hide show
  1. package/LICENSE +21 -0
  2. package/dist/css/styles.css +119 -0
  3. package/dist/esm/components/buttons/index.js +25 -0
  4. package/dist/esm/components/buttons/index.js.map +1 -0
  5. package/dist/esm/components/icons/close.js +20 -0
  6. package/dist/esm/components/icons/close.js.map +1 -0
  7. package/dist/esm/components/icons/index.js +2 -0
  8. package/dist/esm/components/icons/index.js.map +1 -0
  9. package/dist/esm/components/index.js +4 -0
  10. package/dist/esm/components/index.js.map +1 -0
  11. package/dist/esm/components/modals/index.js +4 -0
  12. package/dist/esm/components/modals/index.js.map +1 -0
  13. package/dist/esm/components/modals/modal-with-views.js +29 -0
  14. package/dist/esm/components/modals/modal-with-views.js.map +1 -0
  15. package/dist/esm/components/modals/modal.js +14 -0
  16. package/dist/esm/components/modals/modal.js.map +1 -0
  17. package/dist/esm/components/modals/use-modal-with-views.js +29 -0
  18. package/dist/esm/components/modals/use-modal-with-views.js.map +1 -0
  19. package/dist/esm/config.js +10 -0
  20. package/dist/esm/config.js.map +1 -0
  21. package/dist/esm/context.js +15 -0
  22. package/dist/esm/context.js.map +1 -0
  23. package/dist/esm/exports/components.js +2 -0
  24. package/dist/esm/exports/components.js.map +1 -0
  25. package/dist/esm/exports/config.js +3 -0
  26. package/dist/esm/exports/config.js.map +1 -0
  27. package/dist/esm/exports/hooks.js +2 -0
  28. package/dist/esm/exports/hooks.js.map +1 -0
  29. package/dist/esm/exports/index.js +4 -0
  30. package/dist/esm/exports/index.js.map +1 -0
  31. package/dist/esm/exports/themes.js +2 -0
  32. package/dist/esm/exports/themes.js.map +1 -0
  33. package/dist/esm/hooks/index.js +3 -0
  34. package/dist/esm/hooks/index.js.map +1 -0
  35. package/dist/esm/hooks/useCheckout.js +36 -0
  36. package/dist/esm/hooks/useCheckout.js.map +1 -0
  37. package/dist/esm/hooks/usePayment.js +31 -0
  38. package/dist/esm/hooks/usePayment.js.map +1 -0
  39. package/dist/esm/index.js +2 -0
  40. package/dist/esm/index.js.map +1 -0
  41. package/dist/esm/themes/default.js +45 -0
  42. package/dist/esm/themes/default.js.map +1 -0
  43. package/dist/esm/themes/index.js +3 -0
  44. package/dist/esm/themes/index.js.map +1 -0
  45. package/dist/esm/themes/types.js +2 -0
  46. package/dist/esm/themes/types.js.map +1 -0
  47. package/dist/types/components/buttons/index.d.ts +25 -0
  48. package/dist/types/components/buttons/index.d.ts.map +1 -0
  49. package/dist/types/components/icons/close.d.ts +6 -0
  50. package/dist/types/components/icons/close.d.ts.map +1 -0
  51. package/dist/types/components/icons/index.d.ts +2 -0
  52. package/dist/types/components/icons/index.d.ts.map +1 -0
  53. package/dist/types/components/index.d.ts +4 -0
  54. package/dist/types/components/index.d.ts.map +1 -0
  55. package/dist/types/components/modals/index.d.ts +4 -0
  56. package/dist/types/components/modals/index.d.ts.map +1 -0
  57. package/dist/types/components/modals/modal-with-views.d.ts +20 -0
  58. package/dist/types/components/modals/modal-with-views.d.ts.map +1 -0
  59. package/dist/types/components/modals/modal.d.ts +11 -0
  60. package/dist/types/components/modals/modal.d.ts.map +1 -0
  61. package/dist/types/components/modals/use-modal-with-views.d.ts +14 -0
  62. package/dist/types/components/modals/use-modal-with-views.d.ts.map +1 -0
  63. package/dist/types/config.d.ts +13 -0
  64. package/dist/types/config.d.ts.map +1 -0
  65. package/dist/types/context.d.ts +9 -0
  66. package/dist/types/context.d.ts.map +1 -0
  67. package/dist/types/exports/components.d.ts +2 -0
  68. package/dist/types/exports/components.d.ts.map +1 -0
  69. package/dist/types/exports/config.d.ts +3 -0
  70. package/dist/types/exports/config.d.ts.map +1 -0
  71. package/dist/types/exports/hooks.d.ts +2 -0
  72. package/dist/types/exports/hooks.d.ts.map +1 -0
  73. package/dist/types/exports/index.d.ts +6 -0
  74. package/dist/types/exports/index.d.ts.map +1 -0
  75. package/dist/types/exports/themes.d.ts +2 -0
  76. package/dist/types/exports/themes.d.ts.map +1 -0
  77. package/dist/types/hooks/index.d.ts +3 -0
  78. package/dist/types/hooks/index.d.ts.map +1 -0
  79. package/dist/types/hooks/useCheckout.d.ts +9 -0
  80. package/dist/types/hooks/useCheckout.d.ts.map +1 -0
  81. package/dist/types/hooks/usePayment.d.ts +9 -0
  82. package/dist/types/hooks/usePayment.d.ts.map +1 -0
  83. package/dist/types/index.d.ts +2 -0
  84. package/dist/types/index.d.ts.map +1 -0
  85. package/dist/types/themes/default.d.ts +3 -0
  86. package/dist/types/themes/default.d.ts.map +1 -0
  87. package/dist/types/themes/index.d.ts +3 -0
  88. package/dist/types/themes/index.d.ts.map +1 -0
  89. package/dist/types/themes/types.d.ts +24 -0
  90. package/dist/types/themes/types.d.ts.map +1 -0
  91. package/package.json +96 -0
  92. package/src/components/index.ts +3 -0
  93. package/src/components/modals/index.ts +3 -0
  94. package/src/config.ts +27 -0
  95. package/src/exports/components.ts +1 -0
  96. package/src/exports/config.ts +2 -0
  97. package/src/exports/hooks.ts +1 -0
  98. package/src/exports/index.ts +9 -0
  99. package/src/exports/themes.ts +1 -0
  100. package/src/hooks/index.ts +2 -0
  101. package/src/hooks/useCheckout.ts +38 -0
  102. package/src/hooks/usePayment.ts +37 -0
  103. package/src/index.ts +0 -0
  104. package/src/themes/types.ts +26 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 getmintmoney
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,119 @@
1
+ /* Checkout Modal Container */
2
+
3
+ .mm-qr-container {
4
+ display: flex;
5
+ justify-content: center;
6
+ align-items: center;
7
+ padding: 16px;
8
+ background: #e6f0ff;
9
+ border-radius: 12px;
10
+ }
11
+
12
+ .mm-address-container {
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: space-between;
16
+ background: #eef5ff;
17
+ padding: 8px 12px;
18
+ border-radius: 8px;
19
+ }
20
+
21
+ .copy-button {
22
+ background-color: #1a53ff;
23
+ color: white;
24
+ border: none;
25
+ padding: 8px 16px;
26
+ font-size: 14px;
27
+ font-weight: 600;
28
+ border-radius: 8px;
29
+ cursor: pointer;
30
+ transition: background-color 0.2s ease-in-out;
31
+ }
32
+
33
+ .copy-button:hover {
34
+ background-color: #0039cc;
35
+ }
36
+
37
+ .copy-button:active {
38
+ background-color: #002a99;
39
+ }
40
+
41
+ .copy-button:focus {
42
+ outline: none;
43
+ box-shadow: 0 0 0 3px rgba(26, 83, 255, 0.4);
44
+ }
45
+
46
+ /* Modal Base Styles */
47
+ .mm-modal-overlay {
48
+ position: fixed;
49
+ inset: 0;
50
+ z-index: 50;
51
+ background-color: rgba(0, 0, 0, 0.2);
52
+ backdrop-filter: blur(4px);
53
+ }
54
+
55
+ .mm-modal-container {
56
+ display: flex;
57
+ flex-direction: column;
58
+ z-index: 50;
59
+ position: fixed;
60
+ inset: 0;
61
+ max-width: 100%;
62
+ background-color: #ffffff;
63
+ padding: 24px;
64
+ box-sizing: border-box;
65
+ width: fit-content;
66
+ height: fit-content;
67
+ }
68
+
69
+ @media (min-width: 768px) {
70
+ .mm-modal-container {
71
+ max-width: 600px;
72
+ border-radius: 20px;
73
+ margin: auto;
74
+ }
75
+
76
+ .mm-checkout-modal {
77
+ min-width: 426px;
78
+ }
79
+ }
80
+
81
+ /* Modal Navigation */
82
+ .mm-modal-nav {
83
+ display: flex;
84
+ margin-bottom: 16px;
85
+ justify-content: space-between;
86
+ align-items: center;
87
+ }
88
+
89
+ .mm-modal-nav-left {
90
+ justify-content: flex-start;
91
+ }
92
+
93
+ .mm-modal-nav-center {
94
+ justify-content: center;
95
+ }
96
+
97
+ .mm-modal-nav-right {
98
+ justify-content: flex-end;
99
+ }
100
+
101
+ /* Modal Header */
102
+ .mm-modal-header {
103
+ padding-bottom: 12px;
104
+ font-size: 18px;
105
+ font-weight: bold;
106
+ }
107
+
108
+ /* Modal Body */
109
+ .mm-modal-body {
110
+ flex-grow: 1;
111
+ overflow-y: auto;
112
+ }
113
+
114
+ /* Modal Footer */
115
+ .mm-modal-footer {
116
+ padding-top: 24px;
117
+ }
118
+
119
+ /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jc3Mvc3R5bGVzLmNzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsImZpbGUiOiJzdHlsZXMuY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLyogQ2hlY2tvdXQgTW9kYWwgQ29udGFpbmVyICovXG5cbi5tbS1xci1jb250YWluZXIge1xuICBkaXNwbGF5OiBmbGV4O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgcGFkZGluZzogMTZweDtcbiAgYmFja2dyb3VuZDogI2U2ZjBmZjtcbiAgYm9yZGVyLXJhZGl1czogMT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IDEycHg7XG4gIGZvbnQtc2l6ZTogMThweDtcbiAgZm9udC13ZWlnaHQ6IGJvbGQ7XG59XG5cbi8qIE1vZGFsIEJvZHkgKi9cbi5tbS1tb2RhbC1ib2R5IHtcbiAgZmxleC1ncm93OiAxO1xuICBvdmVyZmxvdy15OiBhdXRvO1xufVxuXG4vKiBNb2RhbCBGb290ZXIgKi9cbi5tbS1tb2RhbC1mb290ZXIge1xuICBwYWRkaW5nLXRvcDogMjRweDtcbn1cbiJdfQ== */
@@ -0,0 +1,25 @@
1
+ import { styled } from "styled-components";
2
+ const StyledButton = styled.button `
3
+ width: 100%;
4
+ padding: 16px 24px; /* Adjusted padding for better spacing */
5
+ border-radius: 32px; /* Fully rounded corners */
6
+ border: 2px solid ${({ theme }) => theme.default.borderColor};
7
+ background-color: ${({ theme }) => theme.default.backgroundColor};
8
+ color: ${({ theme }) => theme.default.textColor};
9
+ transition: all 0.3s ease-in-out;
10
+
11
+ &:hover {
12
+ background-color: ${({ theme }) => theme.hover.backgroundColor};
13
+ border-color: ${({ theme }) => theme.hover.borderColor};
14
+ color: ${({ theme }) => theme.hover.textColor};
15
+ }
16
+
17
+ &:disabled {
18
+ background-color: ${({ theme }) => theme.disabled.backgroundColor};
19
+ border-color: ${({ theme }) => theme.disabled.borderColor};
20
+ color: ${({ theme }) => theme.disabled.textColor};
21
+ cursor: not-allowed;
22
+ }
23
+ `;
24
+ export { StyledButton };
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/buttons/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAqB3C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAmB;;;;sBAI/B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW;sBACxC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe;WACvD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS;;;;wBAIzB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,eAAe;oBAC9C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW;aAC7C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS;;;;wBAIzB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,eAAe;oBACjD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW;aAChD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS;;;CAGnD,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { styled } from "styled-components";
3
+ import { useMintMoneyConfig } from "@mintmoney/react";
4
+ const StyledSvg = styled.svg `
5
+ stroke: ${({ color }) => color};
6
+ width: ${({ width }) => width}px;
7
+ height: ${({ height }) => height}px;
8
+ cursor: pointer;
9
+ transition: stroke 0.2s ease-in-out;
10
+
11
+ &:hover {
12
+ stroke: ${({ color }) => color}CC; /* Slight transparency on hover */
13
+ }
14
+ `;
15
+ const CloseIcon = ({ size = 20 }) => {
16
+ const { theme } = useMintMoneyConfig();
17
+ return (_jsxs(StyledSvg, { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: theme.icon.close.strokeColor, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", color: theme.icon.close.color, children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }));
18
+ };
19
+ export { CloseIcon };
20
+ //# sourceMappingURL=close.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close.js","sourceRoot":"","sources":["../../../../src/components/icons/close.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAMtD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAmB;YACnC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;WACrB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;YACnB,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM;;;;;cAKpB,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK;;CAEjC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAkB,EAAE,EAAE;IAClD,MAAM,EAAE,KAAK,EAAE,GAAG,kBAAkB,EAAE,CAAC;IAEvC,OAAO,CACL,MAAC,SAAS,IACR,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EACpC,WAAW,EAAC,GAAG,EACf,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,aAE7B,eAAM,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,GAAQ,EAC3C,eAAM,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,GAAQ,IACjC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./close.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/icons/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./modals/index.js";
2
+ export * from "./icons/index.js";
3
+ export * from "./buttons/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./modal.js";
2
+ export * from "./modal-with-views.js";
3
+ export * from "./use-modal-with-views.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/modals/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import { Modal } from "./modal.js";
4
+ import { ModalWithViewProvider, useModalWithView, } from "./use-modal-with-views.js";
5
+ function ModalWithViewInner({ isOpen, className, onOpenChange, views, initialView, }) {
6
+ const { currentView, goToView, viewProps } = useModalWithView();
7
+ const currentViewConfig = views[currentView];
8
+ if (!currentViewConfig) {
9
+ throw new Error("No config provided");
10
+ }
11
+ useEffect(() => {
12
+ if (currentView.includes("success") || currentView.includes("error")) {
13
+ const timer = setTimeout(() => {
14
+ onOpenChange?.(false);
15
+ goToView(initialView);
16
+ }, 2000);
17
+ return () => clearTimeout(timer);
18
+ }
19
+ return undefined;
20
+ }, [currentView, onOpenChange, goToView, initialView]);
21
+ return (_jsx(Modal, { className: className, title: currentViewConfig.title, open: isOpen, onOpenChange: (open) => {
22
+ onOpenChange?.(open);
23
+ goToView(initialView);
24
+ }, children: _jsxs(_Fragment, { children: [currentViewConfig.header && (_jsx("div", { className: "mm-modal-header", children: currentViewConfig.header(viewProps) })), _jsx("div", { className: "mm-modal-body", children: currentViewConfig.content(viewProps) }), currentViewConfig.footer && (_jsx("div", { className: "mm-modal-footer", children: currentViewConfig.footer(viewProps) }))] }) }));
25
+ }
26
+ export function ModalWithView(props) {
27
+ return (_jsx(ModalWithViewProvider, { initialView: props.initialView, children: _jsx(ModalWithViewInner, { ...props }) }));
28
+ }
29
+ //# sourceMappingURL=modal-with-views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal-with-views.js","sourceRoot":"","sources":["../../../../src/components/modals/modal-with-views.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAuBnC,SAAS,kBAAkB,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,YAAY,EACZ,KAAK,EACL,WAAW,GACQ;IACnB,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAChE,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC;IAE7C,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,WAAW,CAAC,QAAQ,CAA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{ jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as Dialog from "@radix-ui/react-dialog";
3
+ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
4
+ import { CloseIcon } from "../icons/close.js";
5
+ export const Modal = ({ className, open, onOpenChange, navBarComponent, disableCloseOnInteractOutside, title, children, }) => {
6
+ return (_jsx(Dialog.Root, { open: open, onOpenChange: (open) => {
7
+ onOpenChange?.(open);
8
+ }, children: _jsxs(Dialog.Portal, { children: [_jsx(Dialog.Overlay, { className: "mm-modal-overlay" }), _jsxs(Dialog.Content, { className: `mm-modal-container ${className || ""}`, onInteractOutside: (e) => {
9
+ if (disableCloseOnInteractOutside) {
10
+ e.preventDefault();
11
+ }
12
+ }, children: [_jsx(VisuallyHidden, { children: _jsx(Dialog.Title, { children: title }) }), _jsxs("div", { className: "mm-modal-content", children: [_jsx("div", { className: `mm-modal-nav`, children: navBarComponent || (_jsxs(_Fragment, { children: [title, _jsx(Dialog.Close, { asChild: true, children: _jsx("button", { children: _jsx(CloseIcon, {}) }) })] })) }), children] })] })] }) }));
13
+ };
14
+ //# sourceMappingURL=modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.js","sourceRoot":"","sources":["../../../../src/components/modals/modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAY9C,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EACpB,SAAS,EACT,IAAI,EACJ,YAAY,EACZ,eAAe,EACf,6BAA6B,EAC7B,KAAK,EACL,QAAQ,GACG,EAAE,EAAE;IACf,OAAO,CACL,KAAC,MAAM,CAAC,IAAI,IACV,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;YACrB,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;QACvB,CAAC,YAED,MAAC,MAAM,CAAC,MAAM,eACZ,KAAC,MAAM,CAAC,OAAO,IAAC,SAAS,EAAC,kBAAkB,GAAG,EAC/C,MAAC,MAAM,CAAC,OAAO,IACb,SAAS,EAAE,sBAAsB,SAAS,IAAI,EAAE,EAAE,EAClD,iBAAiB,EAAE,CAAC,CAAC,EAAE,EAAE;wBACvB,IAAI,6BAA6B,EAAE,CAAC;4BAClC,CAAC,CAAC,cAAc,EAAE,CAAC;wBACrB,CAAC;oBACH,CAAC,aAED,KAAC,cAAc,cACb,KAAC,MAAM,CAAC,KAAK,cAAE,KAAK,GAAgB,GACrB,EACjB,eAAK,SAAS,EAAC,kBAAkB,aAC/B,cAAK,SAAS,EAAE,cAAc,YAC3B,eAAe,IAAI,CAClB,8BACG,KAAK,EACN,KAAC,MAAM,CAAC,KAAK,IAAC,OAAO,kBACnB,2BACE,KAAC,SAAS,KAAG,GACN,GACI,IACd,CACJ,GACG,EACL,QAAQ,IACL,IACS,IACH,GACJ,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, useEffect, useState } from "react";
3
+ const ModalContext = createContext({
4
+ currentView: "",
5
+ goToView: () => { },
6
+ viewProps: {},
7
+ });
8
+ export const ModalWithViewProvider = ({ children, initialView, }) => {
9
+ const [currentView, setCurrentView] = useState(initialView);
10
+ const [viewProps, setViewProps] = useState({});
11
+ function goToView(view, props = {}) {
12
+ setCurrentView(view);
13
+ setViewProps(props);
14
+ }
15
+ useEffect(() => {
16
+ console.log(initialView);
17
+ setCurrentView(initialView);
18
+ }, [initialView]);
19
+ const context = {
20
+ currentView,
21
+ goToView,
22
+ viewProps,
23
+ };
24
+ return (_jsxs(ModalContext.Provider, { value: context, children: [" ", children, " "] }));
25
+ };
26
+ export const useModalWithView = () => {
27
+ return useContext(ModalContext);
28
+ };
29
+ //# sourceMappingURL=use-modal-with-views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-modal-with-views.js","sourceRoot":"","sources":["../../../../src/components/modals/use-modal-with-views.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAU9E,MAAM,YAAY,GAAG,aAAa,CAA2B;IAC3D,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE,GAAG,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,EACpC,QAAQ,EACR,WAAW,GAGZ,EAAE,EAAE;IACH,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,WAAW,CAAC,CAAC;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAA0B,EAAE,CAAC,CAAC;IAExE,SAAS,QAAQ,CAAC,IAAY,EAAE,QAAiC,EAAE;QACjE,cAAc,CAAC,IAAI,CAAC,CAAC;QACrB,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IAED,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,cAAc,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,OAAO,GAAG;QACd,WAAW;QACX,QAAQ;QACR,SAAS;KACV,CAAC;IAEF,OAAO,CACL,MAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,kBAAI,QAAQ,SAA0B,CAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAiB,EAAE;IACjD,OAAO,UAAU,CAAC,YAAY,CAAiB,CAAC;AAClD,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import merge from "lodash.merge";
2
+ import { defaultTheme } from "./themes/default.js";
3
+ const _MINT_API = "https://api.getmint.money";
4
+ export const createConfig = (publicKey, options) => {
5
+ return {
6
+ publicKey: publicKey,
7
+ ...merge({ apiUrl: _MINT_API, theme: defaultTheme }, options),
8
+ };
9
+ };
10
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,cAAc,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAanD,MAAM,SAAS,GAAG,2BAA2B,CAAC;AAE9C,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,SAAiB,EACjB,OAAuB,EACf,EAAE;IACV,OAAO;QACL,SAAS,EAAE,SAAS;QACpB,GAAG,KAAK,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE,OAAO,CAAC;KAC9D,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createContext, useContext } from "react";
4
+ const MintMoneyContext = createContext(undefined);
5
+ export function MintMoneyProvider({ config, children, }) {
6
+ return (_jsx(MintMoneyContext.Provider, { value: config, children: children }));
7
+ }
8
+ export function useMintMoneyConfig() {
9
+ const context = useContext(MintMoneyContext);
10
+ if (!context) {
11
+ throw new Error("useMintMoneyConfig must be used within a MintMoneyProvider");
12
+ }
13
+ return context;
14
+ }
15
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,gBAAgB,GAAG,aAAa,CAAqB,SAAS,CAAC,CAAC;AAOtE,MAAM,UAAU,iBAAiB,CAAC,EAChC,MAAM,EACN,QAAQ,GACe;IACvB,OAAO,CACL,KAAC,gBAAgB,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YACrC,QAAQ,GACiB,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "../components/index.js";
2
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../../src/exports/components.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createConfig } from "../config.js";
2
+ export { useMintMoneyConfig, MintMoneyProvider } from "../context.js";
3
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/exports/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { useCheckout, usePayments } from "../hooks/index.js";
2
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/exports/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { createConfig } from "../config.js";
2
+ export { useMintMoneyConfig, MintMoneyProvider } from "../context.js";
3
+ export * from "../components/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exports/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,YAAY,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAItE,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "../themes/index.js";
2
+ //# sourceMappingURL=themes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../src/exports/themes.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { useCheckout } from "./useCheckout.js";
2
+ export { usePayments } from "./usePayment.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { useEffect, useState } from "react";
2
+ import { useMintMoneyConfig } from "@mintmoney/react";
3
+ import { getCheckoutById } from "@mintmoney/core/checkouts";
4
+ export function useCheckout(checkoutId) {
5
+ const config = useMintMoneyConfig();
6
+ const [checkout, setCheckout] = useState(null);
7
+ const [loading, setLoading] = useState(true);
8
+ const [error, setError] = useState(null);
9
+ useEffect(() => {
10
+ async function fetchCheckout() {
11
+ try {
12
+ setLoading(true);
13
+ setError(null);
14
+ const checkoutData = await getCheckoutById(checkoutId);
15
+ setCheckout(checkoutData);
16
+ }
17
+ catch (err) {
18
+ setError("Failed to fetch checkout details");
19
+ }
20
+ finally {
21
+ setLoading(false);
22
+ }
23
+ }
24
+ if (checkoutId) {
25
+ fetchCheckout();
26
+ }
27
+ }, [config.apiUrl, checkoutId]);
28
+ return {
29
+ checkout,
30
+ loading,
31
+ error,
32
+ refresh: () => getCheckoutById(checkoutId).then(setCheckout),
33
+ isReady: checkout !== null && !loading && !error,
34
+ };
35
+ }
36
+ //# sourceMappingURL=useCheckout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCheckout.js","sourceRoot":"","sources":["../../../src/hooks/useCheckout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAY,MAAM,2BAA2B,CAAC;AAEtE,MAAM,UAAU,WAAW,CAAC,UAAkB;IAC5C,MAAM,MAAM,GAAG,kBAAkB,EAAE,CAAC;IACpC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAkB,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,UAAU,aAAa;YAC1B,IAAI,CAAC;gBACH,UAAU,CAAC,IAAI,CAAC,CAAC;gBACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAEf,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,CAAC;gBACvD,WAAW,CAAC,YAAY,CAAC,CAAC;YAC5B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,QAAQ,CAAC,kCAAkC,CAAC,CAAC;YAC/C,CAAC;oBAAS,CAAC;gBACT,UAAU,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;QACH,CAAC;QAED,IAAI,UAAU,EAAE,CAAC;YACf,aAAa,EAAE,CAAC;QAClB,CAAC;IACH,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;IAEhC,OAAO;QACL,QAAQ;QACR,OAAO;QACP,KAAK;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;QAC5D,OAAO,EAAE,QAAQ,KAAK,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK;KACjD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { useState } from "react";
2
+ import { createPayment, } from "@mintmoney/core/payments";
3
+ export function usePayments() {
4
+ const [payment, setPayment] = useState(null);
5
+ const [loading, setLoading] = useState(false);
6
+ const [error, setError] = useState(null);
7
+ async function handleCreatePayment(params) {
8
+ try {
9
+ setLoading(true);
10
+ setError(null);
11
+ const newPayment = await createPayment({ ...params });
12
+ setPayment(newPayment);
13
+ return newPayment;
14
+ }
15
+ catch (err) {
16
+ setError("Failed to create payment");
17
+ return null;
18
+ }
19
+ finally {
20
+ setLoading(false);
21
+ }
22
+ }
23
+ return {
24
+ payment,
25
+ loading,
26
+ error,
27
+ createPayment: handleCreatePayment,
28
+ isReady: payment !== null && !loading && !error,
29
+ };
30
+ }
31
+ //# sourceMappingURL=usePayment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePayment.js","sourceRoot":"","sources":["../../../src/hooks/usePayment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EACL,aAAa,GAGd,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,IAAI,CAAC,CAAC;IAC7D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,KAAK,UAAU,mBAAmB,CAAC,MAA2B;QAC5D,IAAI,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,QAAQ,CAAC,IAAI,CAAC,CAAC;YAEf,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;YACtD,UAAU,CAAC,UAAU,CAAC,CAAC;YAEvB,OAAO,UAAU,CAAC;QACpB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,0BAA0B,CAAC,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;gBAAS,CAAC;YACT,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO;QACL,OAAO;QACP,OAAO;QACP,KAAK;QACL,aAAa,EAAE,mBAAmB;QAClC,OAAO,EAAE,OAAO,KAAK,IAAI,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK;KAChD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
@@ -0,0 +1,45 @@
1
+ export const defaultTheme = {
2
+ btn: {
3
+ primary: {
4
+ default: {
5
+ backgroundColor: "#80FFBF",
6
+ borderColor: "#6CD29F",
7
+ textColor: "#FFFFFF",
8
+ },
9
+ hover: {
10
+ backgroundColor: "rgba(128, 255, 191, 0.8)",
11
+ borderColor: "rgba(108, 210, 159, 0.8)",
12
+ textColor: "#FFFFFF",
13
+ },
14
+ disabled: {
15
+ backgroundColor: "rgba(128, 255, 191, 0.5)",
16
+ borderColor: "rgba(108, 210, 159, 0.5)",
17
+ textColor: "#FFFFFF",
18
+ },
19
+ },
20
+ back: {
21
+ default: {
22
+ backgroundColor: "#FFF",
23
+ borderColor: "#6CD29F",
24
+ textColor: "#000",
25
+ },
26
+ hover: {
27
+ backgroundColor: "#FFF",
28
+ borderColor: "#80FFBF",
29
+ textColor: "#000",
30
+ },
31
+ disabled: {
32
+ backgroundColor: "#FEFEFE",
33
+ borderColor: "#CCC",
34
+ textColor: "#000",
35
+ },
36
+ },
37
+ },
38
+ icon: {
39
+ close: {
40
+ strokeColor: "#ccc",
41
+ color: "#ccc",
42
+ },
43
+ },
44
+ };
45
+ //# sourceMappingURL=default.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"default.js","sourceRoot":"","sources":["../../../src/themes/default.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,GAAG,EAAE;QACH,OAAO,EAAE;YACP,OAAO,EAAE;gBACP,eAAe,EAAE,SAAS;gBAC1B,WAAW,EAAE,SAAS;gBACtB,SAAS,EAAE,SAAS;aACrB;YACD,KAAK,EAAE;gBACL,eAAe,EAAE,0BAA0B;gBAC3C,WAAW,EAAE,0BAA0B;gBACvC,SAAS,EAAE,SAAS;aACrB;YACD,QAAQ,EAAE;gBACR,eAAe,EAAE,0BAA0B;gBAC3C,WAAW,EAAE,0BAA0B;gBACvC,SAAS,EAAE,SAAS;aACrB;SACF;QACD,IAAI,EAAE;YACJ,OAAO,EAAE;gBACP,eAAe,EAAE,MAAM;gBACvB,WAAW,EAAE,SAAS;gBACtB,SAAS,EAAE,MAAM;aAClB;YACD,KAAK,EAAE;gBACL,eAAe,EAAE,MAAM;gBACvB,WAAW,EAAE,SAAS;gBACtB,SAAS,EAAE,MAAM;aAClB;YACD,QAAQ,EAAE;gBACR,eAAe,EAAE,SAAS;gBAC1B,WAAW,EAAE,MAAM;gBACnB,SAAS,EAAE,MAAM;aAClB;SACF;KACF;IACD,IAAI,EAAE;QACJ,KAAK,EAAE;YACL,WAAW,EAAE,MAAM;YACnB,KAAK,EAAE,MAAM;SACd;KACF;CACa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { defaultTheme } from "./default.js";
2
+ export * from "./types.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/themes/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,cAAc,YAAY,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/themes/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ export interface StyledButtonProps {
2
+ theme: {
3
+ default: {
4
+ backgroundColor: string;
5
+ borderColor: string;
6
+ textColor: string;
7
+ };
8
+ hover: {
9
+ backgroundColor: string;
10
+ borderColor: string;
11
+ textColor: string;
12
+ };
13
+ disabled: {
14
+ backgroundColor: string;
15
+ borderColor: string;
16
+ textColor: string;
17
+ };
18
+ };
19
+ disabled?: boolean;
20
+ onClick?: () => void;
21
+ key?: string;
22
+ }
23
+ declare const StyledButton: import("styled-components/dist/types.js").IStyledComponentBase<"web", import("styled-components/dist/types.js").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, StyledButtonProps>> & string;
24
+ export { StyledButton };
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/buttons/index.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE;QACL,OAAO,EAAE;YACP,eAAe,EAAE,MAAM,CAAC;YACxB,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;QACF,KAAK,EAAE;YAAE,eAAe,EAAE,MAAM,CAAC;YAAC,WAAW,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3E,QAAQ,EAAE;YACR,eAAe,EAAE,MAAM,CAAC;YACxB,WAAW,EAAE,MAAM,CAAC;YACpB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,QAAA,MAAM,YAAY,wQAqBjB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ interface CloseIconProps {
2
+ size?: number;
3
+ }
4
+ declare const CloseIcon: ({ size }: CloseIconProps) => import("react/jsx-runtime").JSX.Element;
5
+ export { CloseIcon };
6
+ //# sourceMappingURL=close.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"close.d.ts","sourceRoot":"","sources":["../../../../src/components/icons/close.tsx"],"names":[],"mappings":"AAGA,UAAU,cAAc;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAcD,QAAA,MAAM,SAAS,aAAmB,cAAc,4CAoB/C,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./close.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/icons/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./modals/index.js";
2
+ export * from "./icons/index.js";
3
+ export * from "./buttons/index.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./modal.js";
2
+ export * from "./modal-with-views.js";
3
+ export * from "./use-modal-with-views.js";
4
+ //# sourceMappingURL=index.d.ts.map