@omnikit-js/ui 0.6.1 → 0.9.2

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.
@@ -1,196 +0,0 @@
1
- "use client";
2
- import { useState, useEffect } from 'react';
3
- import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
-
5
- // src/components/client/Tabs/index.tsx
6
- function Tabs({ tabs, defaultTab, className = "" }) {
7
- const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id);
8
- return /* @__PURE__ */ jsxs("div", { className, children: [
9
- /* @__PURE__ */ jsx("div", { className: "border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsx("nav", { className: "-mb-px flex space-x-8", children: tabs.map((tab) => /* @__PURE__ */ jsx(
10
- "button",
11
- {
12
- onClick: () => setActiveTab(tab.id),
13
- className: `
14
- whitespace-nowrap border-b-2 px-1 pb-4 text-sm font-medium transition-colors
15
- ${activeTab === tab.id ? "border-blue-500 text-blue-600 dark:text-blue-400" : "border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}
16
- `,
17
- children: tab.label
18
- },
19
- tab.id
20
- )) }) }),
21
- /* @__PURE__ */ jsx("div", { className: "mt-6", children: tabs.find((tab) => tab.id === activeTab)?.content })
22
- ] });
23
- }
24
- function Modal({ isOpen, onClose, title, children, className = "" }) {
25
- useEffect(() => {
26
- const handleEscape = (e) => {
27
- if (e.key === "Escape") onClose();
28
- };
29
- if (isOpen) {
30
- document.addEventListener("keydown", handleEscape);
31
- document.body.style.overflow = "hidden";
32
- }
33
- return () => {
34
- document.removeEventListener("keydown", handleEscape);
35
- document.body.style.overflow = "unset";
36
- };
37
- }, [isOpen, onClose]);
38
- if (!isOpen) return null;
39
- return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
40
- /* @__PURE__ */ jsx(
41
- "div",
42
- {
43
- className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
44
- onClick: onClose
45
- }
46
- ),
47
- /* @__PURE__ */ jsxs(
48
- "div",
49
- {
50
- className: `relative bg-white dark:bg-gray-900 rounded-lg shadow-xl max-w-md w-full max-h-[90vh] overflow-y-auto ${className}`,
51
- children: [
52
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700", children: [
53
- /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: title }),
54
- /* @__PURE__ */ jsx(
55
- "button",
56
- {
57
- onClick: onClose,
58
- className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",
59
- children: /* @__PURE__ */ jsx("svg", { className: "w-6 h-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
60
- }
61
- )
62
- ] }),
63
- /* @__PURE__ */ jsx("div", { className: "p-6", children })
64
- ]
65
- }
66
- )
67
- ] });
68
- }
69
- function PaymentMethodManager({ currentMethod }) {
70
- const [isModalOpen, setIsModalOpen] = useState(false);
71
- return /* @__PURE__ */ jsxs(Fragment, { children: [
72
- /* @__PURE__ */ jsxs("div", { children: [
73
- /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold mb-4", children: "Current Payment Method" }),
74
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg mb-6", children: [
75
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
76
- /* @__PURE__ */ jsx("div", { className: "h-12 w-16 rounded bg-gradient-to-br from-blue-600 to-blue-800 flex items-center justify-center text-white font-bold text-sm", children: currentMethod.type }),
77
- /* @__PURE__ */ jsxs("div", { children: [
78
- /* @__PURE__ */ jsxs("p", { className: "font-medium", children: [
79
- "\u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 \u2022\u2022\u2022\u2022 ",
80
- currentMethod.last4
81
- ] }),
82
- /* @__PURE__ */ jsxs("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
83
- "Expires ",
84
- currentMethod.expiry
85
- ] })
86
- ] })
87
- ] }),
88
- /* @__PURE__ */ jsx(
89
- "button",
90
- {
91
- onClick: () => setIsModalOpen(true),
92
- className: "rounded-lg border border-gray-300 dark:border-gray-600 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",
93
- children: "Update"
94
- }
95
- )
96
- ] }),
97
- /* @__PURE__ */ jsx(
98
- "button",
99
- {
100
- onClick: () => setIsModalOpen(true),
101
- className: "w-full rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",
102
- children: "Add New Payment Method"
103
- }
104
- )
105
- ] }),
106
- /* @__PURE__ */ jsx(
107
- Modal,
108
- {
109
- isOpen: isModalOpen,
110
- onClose: () => setIsModalOpen(false),
111
- title: "Add Payment Method",
112
- children: /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
113
- /* @__PURE__ */ jsxs("div", { children: [
114
- /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Cardholder Name" }),
115
- /* @__PURE__ */ jsx(
116
- "input",
117
- {
118
- type: "text",
119
- placeholder: "John Doe",
120
- className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
121
- }
122
- )
123
- ] }),
124
- /* @__PURE__ */ jsxs("div", { children: [
125
- /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Card Number" }),
126
- /* @__PURE__ */ jsx(
127
- "input",
128
- {
129
- type: "text",
130
- placeholder: "1234 5678 9012 3456",
131
- className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
132
- }
133
- )
134
- ] }),
135
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
136
- /* @__PURE__ */ jsxs("div", { children: [
137
- /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "Expiry Date" }),
138
- /* @__PURE__ */ jsx(
139
- "input",
140
- {
141
- type: "text",
142
- placeholder: "MM/YY",
143
- className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
144
- }
145
- )
146
- ] }),
147
- /* @__PURE__ */ jsxs("div", { children: [
148
- /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: "CVC" }),
149
- /* @__PURE__ */ jsx(
150
- "input",
151
- {
152
- type: "text",
153
- placeholder: "123",
154
- className: "w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20"
155
- }
156
- )
157
- ] })
158
- ] }),
159
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
160
- /* @__PURE__ */ jsx(
161
- "input",
162
- {
163
- type: "checkbox",
164
- id: "setDefaultModal",
165
- className: "rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500"
166
- }
167
- ),
168
- /* @__PURE__ */ jsx("label", { htmlFor: "setDefaultModal", className: "text-sm text-gray-700 dark:text-gray-300", children: "Set as default payment method" })
169
- ] }),
170
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3 pt-4", children: [
171
- /* @__PURE__ */ jsx(
172
- "button",
173
- {
174
- onClick: () => setIsModalOpen(false),
175
- className: "flex-1 rounded-lg border border-gray-300 dark:border-gray-600 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",
176
- children: "Cancel"
177
- }
178
- ),
179
- /* @__PURE__ */ jsx(
180
- "button",
181
- {
182
- onClick: () => setIsModalOpen(false),
183
- className: "flex-1 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",
184
- children: "Add Card"
185
- }
186
- )
187
- ] })
188
- ] })
189
- }
190
- )
191
- ] });
192
- }
193
-
194
- export { Modal, PaymentMethodManager, Tabs };
195
- //# sourceMappingURL=chunk-MQEH3FTA.mjs.map
196
- //# sourceMappingURL=chunk-MQEH3FTA.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/client/Tabs/index.tsx","../src/components/client/Modal/index.tsx","../src/components/client/PaymentMethodManager/index.tsx"],"names":["jsxs","jsx","useState"],"mappings":";;;;AAgBO,SAAS,KAAK,EAAE,IAAA,EAAM,UAAA,EAAY,SAAA,GAAY,IAAG,EAAc;AACpE,EAAA,MAAM,CAAC,WAAW,YAAY,CAAA,GAAI,SAAS,UAAA,IAAc,IAAA,CAAK,CAAC,CAAA,EAAG,EAAE,CAAA;AAEpE,EAAA,uBACE,IAAA,CAAC,SAAI,SAAA,EACH,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,+CAAA,EACb,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,uBAAA,EACZ,QAAA,EAAA,IAAA,CAAK,GAAA,CAAI,CAAC,GAAA,qBACT,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QAEC,OAAA,EAAS,MAAM,YAAA,CAAa,GAAA,CAAI,EAAE,CAAA;AAAA,QAClC,SAAA,EAAW;AAAA;AAAA,gBAAA,EAGP,SAAA,KAAc,GAAA,CAAI,EAAA,GACd,kDAAA,GACA,wHACN;AAAA,cAAA,CAAA;AAAA,QAGD,QAAA,EAAA,GAAA,CAA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ACC,IAAA,EAAK,MAAA;AAAA,kBACL,WAAA,EAAY,KAAA;AAAA,kBACZ,SAAA,EAAU;AAAA;AAAA;AACZ,aAAA,EACF;AAAA,WAAA,EACF,CAAA;AAAA,0BACAD,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,yBAAA,EACb,QAAA,EAAA;AAAA,4BAAAC,GAAAA;AAAA,cAAC,OAAA;AAAA,cAAA;AAAA,gBACC,IAAA,EAAK,UAAA;AAAA,gBACL,EAAA,EAAG,iBAAA;AAAA,gBACH,SAAA,EAAU;AAAA;AAAA,aACZ;AAAA,4BACAA,GAAAA,CAAC,OAAA,EAAA,EAAM,SAAQ,iBAAA,EAAkB,SAAA,EAAU,4CAA2C,QAAA,EAAA,+BAAA,EAEtF;AAAA,WAAA,EACF,CAAA;AAAA,0BACAD,IAAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,iBAAA,EACb,QAAA,EAAA;AAAA,4BAAAC,GAAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,cAAA,CAAe,KAAK,CAAA;AAAA,gBACnC,SAAA,EAAU,wLAAA;AAAA,gBACX,QAAA,EAAA;AAAA;AAAA,aAED;AAAA,4BACAA,GAAAA;AAAA,cAAC,QAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,cAAA,CAAe,KAAK,CAAA;AAAA,gBACnC,SAAA,EAAU,4GAAA;AAAA,gBACX,QAAA,EAAA;AAAA;AAAA;AAED,WAAA,EACF;AAAA,SAAA,EACF;AAAA;AAAA;AACF,GAAA,EACF,CAAA;AAEJ","file":"chunk-MQEH3FTA.mjs","sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\nexport interface Tab {\n id: string\n label: string\n content: React.ReactNode\n}\n\nexport interface TabsProps {\n tabs: Tab[]\n defaultTab?: string\n className?: string\n}\n\nexport function Tabs({ tabs, defaultTab, className = '' }: TabsProps) {\n const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id)\n\n return (\n <div className={className}>\n <div className=\"border-b border-gray-200 dark:border-gray-700\">\n <nav className=\"-mb-px flex space-x-8\">\n {tabs.map((tab) => (\n <button\n key={tab.id}\n onClick={() => setActiveTab(tab.id)}\n className={`\n whitespace-nowrap border-b-2 px-1 pb-4 text-sm font-medium transition-colors\n ${\n activeTab === tab.id\n ? 'border-blue-500 text-blue-600 dark:text-blue-400'\n : 'border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300'\n }\n `}\n >\n {tab.label}\n </button>\n ))}\n </nav>\n </div>\n <div className=\"mt-6\">\n {tabs.find((tab) => tab.id === activeTab)?.content}\n </div>\n </div>\n )\n}\n","'use client'\n\nimport { useEffect } from 'react'\n\nexport interface ModalProps {\n isOpen: boolean\n onClose: () => void\n title: string\n children: React.ReactNode\n className?: string\n}\n\nexport function Modal({ isOpen, onClose, title, children, className = '' }: ModalProps) {\n useEffect(() => {\n const handleEscape = (e: KeyboardEvent) => {\n if (e.key === 'Escape') onClose()\n }\n\n if (isOpen) {\n document.addEventListener('keydown', handleEscape)\n document.body.style.overflow = 'hidden'\n }\n\n return () => {\n document.removeEventListener('keydown', handleEscape)\n document.body.style.overflow = 'unset'\n }\n }, [isOpen, onClose])\n\n if (!isOpen) return null\n\n return (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center p-4\">\n {/* Backdrop */}\n <div\n className=\"absolute inset-0 bg-black/50 backdrop-blur-sm\"\n onClick={onClose}\n />\n\n {/* Modal */}\n <div\n className={`relative bg-white dark:bg-gray-900 rounded-lg shadow-xl max-w-md w-full max-h-[90vh] overflow-y-auto ${className}`}\n >\n {/* Header */}\n <div className=\"flex items-center justify-between p-6 border-b border-gray-200 dark:border-gray-700\">\n <h2 className=\"text-xl font-semibold\">{title}</h2>\n <button\n onClick={onClose}\n className=\"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors\"\n >\n <svg className=\"w-6 h-6\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Content */}\n <div className=\"p-6\">\n {children}\n </div>\n </div>\n </div>\n )\n}\n","'use client'\n\nimport { useState } from 'react'\nimport { Modal } from '../Modal'\n\nexport interface PaymentMethodManagerProps {\n currentMethod: {\n type: string\n last4: string\n expiry: string\n }\n}\n\nexport function PaymentMethodManager({ currentMethod }: PaymentMethodManagerProps) {\n const [isModalOpen, setIsModalOpen] = useState(false)\n\n return (\n <>\n <div>\n <h3 className=\"text-lg font-semibold mb-4\">Current Payment Method</h3>\n <div className=\"flex items-center justify-between p-4 border border-gray-200 dark:border-gray-700 rounded-lg mb-6\">\n <div className=\"flex items-center gap-4\">\n <div className=\"h-12 w-16 rounded bg-gradient-to-br from-blue-600 to-blue-800 flex items-center justify-center text-white font-bold text-sm\">\n {currentMethod.type}\n </div>\n <div>\n <p className=\"font-medium\">•••• •••• •••• {currentMethod.last4}</p>\n <p className=\"text-sm text-gray-600 dark:text-gray-400\">\n Expires {currentMethod.expiry}\n </p>\n </div>\n </div>\n <button\n onClick={() => setIsModalOpen(true)}\n className=\"rounded-lg border border-gray-300 dark:border-gray-600 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors\"\n >\n Update\n </button>\n </div>\n\n <button\n onClick={() => setIsModalOpen(true)}\n className=\"w-full rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors\"\n >\n Add New Payment Method\n </button>\n </div>\n\n <Modal\n isOpen={isModalOpen}\n onClose={() => setIsModalOpen(false)}\n title=\"Add Payment Method\"\n >\n <div className=\"space-y-4\">\n <div>\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2\">\n Cardholder Name\n </label>\n <input\n type=\"text\"\n placeholder=\"John Doe\"\n className=\"w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2\">\n Card Number\n </label>\n <input\n type=\"text\"\n placeholder=\"1234 5678 9012 3456\"\n className=\"w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20\"\n />\n </div>\n <div className=\"grid grid-cols-2 gap-4\">\n <div>\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2\">\n Expiry Date\n </label>\n <input\n type=\"text\"\n placeholder=\"MM/YY\"\n className=\"w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20\"\n />\n </div>\n <div>\n <label className=\"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2\">\n CVC\n </label>\n <input\n type=\"text\"\n placeholder=\"123\"\n className=\"w-full rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 px-4 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500/20\"\n />\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <input\n type=\"checkbox\"\n id=\"setDefaultModal\"\n className=\"rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500\"\n />\n <label htmlFor=\"setDefaultModal\" className=\"text-sm text-gray-700 dark:text-gray-300\">\n Set as default payment method\n </label>\n </div>\n <div className=\"flex gap-3 pt-4\">\n <button\n onClick={() => setIsModalOpen(false)}\n className=\"flex-1 rounded-lg border border-gray-300 dark:border-gray-600 px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors\"\n >\n Cancel\n </button>\n <button\n onClick={() => setIsModalOpen(false)}\n className=\"flex-1 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors\"\n >\n Add Card\n </button>\n </div>\n </div>\n </Modal>\n </>\n )\n}\n"]}
@@ -1,40 +0,0 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
-
3
- interface Tab {
4
- id: string;
5
- label: string;
6
- content: React.ReactNode;
7
- }
8
- interface TabsProps {
9
- tabs: Tab[];
10
- defaultTab?: string;
11
- className?: string;
12
- }
13
- declare function Tabs({ tabs, defaultTab, className }: TabsProps): react_jsx_runtime.JSX.Element;
14
-
15
- interface ModalProps {
16
- isOpen: boolean;
17
- onClose: () => void;
18
- title: string;
19
- children: React.ReactNode;
20
- className?: string;
21
- }
22
- declare function Modal({ isOpen, onClose, title, children, className }: ModalProps): react_jsx_runtime.JSX.Element | null;
23
-
24
- interface PaymentMethodManagerProps {
25
- currentMethod: {
26
- type: string;
27
- last4: string;
28
- expiry: string;
29
- };
30
- }
31
- declare function PaymentMethodManager({ currentMethod }: PaymentMethodManagerProps): react_jsx_runtime.JSX.Element;
32
-
33
- /**
34
- * Client Components
35
- * These components run on the client side
36
- */
37
-
38
- declare const OMNIKIT_CLIENT_VERSION = "0.6.1";
39
-
40
- export { Modal, type ModalProps, OMNIKIT_CLIENT_VERSION, PaymentMethodManager, type PaymentMethodManagerProps, type Tab, Tabs, type TabsProps };
@@ -1,8 +0,0 @@
1
- export { Modal, PaymentMethodManager, Tabs } from '../../chunk-MQEH3FTA.mjs';
2
-
3
- // src/components/client/index.ts
4
- var OMNIKIT_CLIENT_VERSION = "0.6.1";
5
-
6
- export { OMNIKIT_CLIENT_VERSION };
7
- //# sourceMappingURL=index.mjs.map
8
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/components/client/index.ts"],"names":[],"mappings":";;;AAcO,IAAM,sBAAA,GAAyB","file":"index.mjs","sourcesContent":["/**\n * Client Components\n * These components run on the client side\n */\n\nexport { Tabs } from './Tabs'\nexport type { TabsProps, Tab } from './Tabs'\n\nexport { Modal } from './Modal'\nexport type { ModalProps } from './Modal'\n\nexport { PaymentMethodManager } from './PaymentMethodManager'\nexport type { PaymentMethodManagerProps } from './PaymentMethodManager'\n\nexport const OMNIKIT_CLIENT_VERSION = '0.6.1'\n"]}
@@ -1,2 +0,0 @@
1
- export { B as Billing, d as BillingProps, C as Column, c as ColumnDefinition, D as DataList, b as DataListProps } from '../../index-CsOyTW-D.mjs';
2
- import 'react/jsx-runtime';
@@ -1,4 +0,0 @@
1
- export { Billing, DataList } from '../../chunk-FPLMULY5.mjs';
2
- import '../../chunk-MQEH3FTA.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map
package/dist/index.mjs DELETED
@@ -1,4 +0,0 @@
1
- export { Billing, DataList, OmniKitClient, createOmniKitClient } from './chunk-FPLMULY5.mjs';
2
- import './chunk-MQEH3FTA.mjs';
3
- //# sourceMappingURL=index.mjs.map
4
- //# sourceMappingURL=index.mjs.map